twl6040-core.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  1. /*
  2. * MFD driver for TWL6040 audio device
  3. *
  4. * Authors: Misael Lopez Cruz <misael.lopez@ti.com>
  5. * Jorge Eduardo Candelaria <jorge.candelaria@ti.com>
  6. * Peter Ujfalusi <peter.ujfalusi@ti.com>
  7. *
  8. * Copyright: (C) 2011 Texas Instruments, Inc.
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2 as
  12. * published by the Free Software Foundation.
  13. *
  14. * This program is distributed in the hope that it will be useful, but
  15. * WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  22. * 02110-1301 USA
  23. *
  24. */
  25. #include <linux/module.h>
  26. #include <linux/types.h>
  27. #include <linux/slab.h>
  28. #include <linux/kernel.h>
  29. #include <linux/platform_device.h>
  30. #include <linux/gpio.h>
  31. #include <linux/delay.h>
  32. #include <linux/i2c/twl.h>
  33. #include <linux/mfd/core.h>
  34. #include <linux/mfd/twl6040.h>
  35. static struct platform_device *twl6040_dev;
  36. int twl6040_reg_read(struct twl6040 *twl6040, unsigned int reg)
  37. {
  38. int ret;
  39. u8 val = 0;
  40. mutex_lock(&twl6040->io_mutex);
  41. ret = twl_i2c_read_u8(TWL_MODULE_AUDIO_VOICE, &val, reg);
  42. if (ret < 0) {
  43. mutex_unlock(&twl6040->io_mutex);
  44. return ret;
  45. }
  46. mutex_unlock(&twl6040->io_mutex);
  47. return val;
  48. }
  49. EXPORT_SYMBOL(twl6040_reg_read);
  50. int twl6040_reg_write(struct twl6040 *twl6040, unsigned int reg, u8 val)
  51. {
  52. int ret;
  53. mutex_lock(&twl6040->io_mutex);
  54. ret = twl_i2c_write_u8(TWL_MODULE_AUDIO_VOICE, val, reg);
  55. mutex_unlock(&twl6040->io_mutex);
  56. return ret;
  57. }
  58. EXPORT_SYMBOL(twl6040_reg_write);
  59. int twl6040_set_bits(struct twl6040 *twl6040, unsigned int reg, u8 mask)
  60. {
  61. int ret;
  62. u8 val;
  63. mutex_lock(&twl6040->io_mutex);
  64. ret = twl_i2c_read_u8(TWL_MODULE_AUDIO_VOICE, &val, reg);
  65. if (ret)
  66. goto out;
  67. val |= mask;
  68. ret = twl_i2c_write_u8(TWL_MODULE_AUDIO_VOICE, val, reg);
  69. out:
  70. mutex_unlock(&twl6040->io_mutex);
  71. return ret;
  72. }
  73. EXPORT_SYMBOL(twl6040_set_bits);
  74. int twl6040_clear_bits(struct twl6040 *twl6040, unsigned int reg, u8 mask)
  75. {
  76. int ret;
  77. u8 val;
  78. mutex_lock(&twl6040->io_mutex);
  79. ret = twl_i2c_read_u8(TWL_MODULE_AUDIO_VOICE, &val, reg);
  80. if (ret)
  81. goto out;
  82. val &= ~mask;
  83. ret = twl_i2c_write_u8(TWL_MODULE_AUDIO_VOICE, val, reg);
  84. out:
  85. mutex_unlock(&twl6040->io_mutex);
  86. return ret;
  87. }
  88. EXPORT_SYMBOL(twl6040_clear_bits);
  89. /* twl6040 codec manual power-up sequence */
  90. static int twl6040_power_up(struct twl6040 *twl6040)
  91. {
  92. u8 ldoctl, ncpctl, lppllctl;
  93. int ret;
  94. /* enable high-side LDO, reference system and internal oscillator */
  95. ldoctl = TWL6040_HSLDOENA | TWL6040_REFENA | TWL6040_OSCENA;
  96. ret = twl6040_reg_write(twl6040, TWL6040_REG_LDOCTL, ldoctl);
  97. if (ret)
  98. return ret;
  99. usleep_range(10000, 10500);
  100. /* enable negative charge pump */
  101. ncpctl = TWL6040_NCPENA;
  102. ret = twl6040_reg_write(twl6040, TWL6040_REG_NCPCTL, ncpctl);
  103. if (ret)
  104. goto ncp_err;
  105. usleep_range(1000, 1500);
  106. /* enable low-side LDO */
  107. ldoctl |= TWL6040_LSLDOENA;
  108. ret = twl6040_reg_write(twl6040, TWL6040_REG_LDOCTL, ldoctl);
  109. if (ret)
  110. goto lsldo_err;
  111. usleep_range(1000, 1500);
  112. /* enable low-power PLL */
  113. lppllctl = TWL6040_LPLLENA;
  114. ret = twl6040_reg_write(twl6040, TWL6040_REG_LPPLLCTL, lppllctl);
  115. if (ret)
  116. goto lppll_err;
  117. usleep_range(5000, 5500);
  118. /* disable internal oscillator */
  119. ldoctl &= ~TWL6040_OSCENA;
  120. ret = twl6040_reg_write(twl6040, TWL6040_REG_LDOCTL, ldoctl);
  121. if (ret)
  122. goto osc_err;
  123. return 0;
  124. osc_err:
  125. lppllctl &= ~TWL6040_LPLLENA;
  126. twl6040_reg_write(twl6040, TWL6040_REG_LPPLLCTL, lppllctl);
  127. lppll_err:
  128. ldoctl &= ~TWL6040_LSLDOENA;
  129. twl6040_reg_write(twl6040, TWL6040_REG_LDOCTL, ldoctl);
  130. lsldo_err:
  131. ncpctl &= ~TWL6040_NCPENA;
  132. twl6040_reg_write(twl6040, TWL6040_REG_NCPCTL, ncpctl);
  133. ncp_err:
  134. ldoctl &= ~(TWL6040_HSLDOENA | TWL6040_REFENA | TWL6040_OSCENA);
  135. twl6040_reg_write(twl6040, TWL6040_REG_LDOCTL, ldoctl);
  136. return ret;
  137. }
  138. /* twl6040 manual power-down sequence */
  139. static void twl6040_power_down(struct twl6040 *twl6040)
  140. {
  141. u8 ncpctl, ldoctl, lppllctl;
  142. ncpctl = twl6040_reg_read(twl6040, TWL6040_REG_NCPCTL);
  143. ldoctl = twl6040_reg_read(twl6040, TWL6040_REG_LDOCTL);
  144. lppllctl = twl6040_reg_read(twl6040, TWL6040_REG_LPPLLCTL);
  145. /* enable internal oscillator */
  146. ldoctl |= TWL6040_OSCENA;
  147. twl6040_reg_write(twl6040, TWL6040_REG_LDOCTL, ldoctl);
  148. usleep_range(1000, 1500);
  149. /* disable low-power PLL */
  150. lppllctl &= ~TWL6040_LPLLENA;
  151. twl6040_reg_write(twl6040, TWL6040_REG_LPPLLCTL, lppllctl);
  152. /* disable low-side LDO */
  153. ldoctl &= ~TWL6040_LSLDOENA;
  154. twl6040_reg_write(twl6040, TWL6040_REG_LDOCTL, ldoctl);
  155. /* disable negative charge pump */
  156. ncpctl &= ~TWL6040_NCPENA;
  157. twl6040_reg_write(twl6040, TWL6040_REG_NCPCTL, ncpctl);
  158. /* disable high-side LDO, reference system and internal oscillator */
  159. ldoctl &= ~(TWL6040_HSLDOENA | TWL6040_REFENA | TWL6040_OSCENA);
  160. twl6040_reg_write(twl6040, TWL6040_REG_LDOCTL, ldoctl);
  161. }
  162. static irqreturn_t twl6040_naudint_handler(int irq, void *data)
  163. {
  164. struct twl6040 *twl6040 = data;
  165. u8 intid, status;
  166. intid = twl6040_reg_read(twl6040, TWL6040_REG_INTID);
  167. if (intid & TWL6040_READYINT)
  168. complete(&twl6040->ready);
  169. if (intid & TWL6040_THINT) {
  170. status = twl6040_reg_read(twl6040, TWL6040_REG_STATUS);
  171. if (status & TWL6040_TSHUTDET) {
  172. dev_warn(&twl6040_dev->dev,
  173. "Thermal shutdown, powering-off");
  174. twl6040_power(twl6040, 0);
  175. } else {
  176. dev_warn(&twl6040_dev->dev,
  177. "Leaving thermal shutdown, powering-on");
  178. twl6040_power(twl6040, 1);
  179. }
  180. }
  181. return IRQ_HANDLED;
  182. }
  183. static int twl6040_power_up_completion(struct twl6040 *twl6040,
  184. int naudint)
  185. {
  186. int time_left;
  187. u8 intid;
  188. time_left = wait_for_completion_timeout(&twl6040->ready,
  189. msecs_to_jiffies(144));
  190. if (!time_left) {
  191. intid = twl6040_reg_read(twl6040, TWL6040_REG_INTID);
  192. if (!(intid & TWL6040_READYINT)) {
  193. dev_err(&twl6040_dev->dev,
  194. "timeout waiting for READYINT\n");
  195. return -ETIMEDOUT;
  196. }
  197. }
  198. return 0;
  199. }
  200. int twl6040_power(struct twl6040 *twl6040, int on)
  201. {
  202. int audpwron = twl6040->audpwron;
  203. int naudint = twl6040->irq;
  204. int ret = 0;
  205. mutex_lock(&twl6040->mutex);
  206. if (on) {
  207. /* already powered-up */
  208. if (twl6040->power_count++)
  209. goto out;
  210. if (gpio_is_valid(audpwron)) {
  211. /* use AUDPWRON line */
  212. gpio_set_value(audpwron, 1);
  213. /* wait for power-up completion */
  214. ret = twl6040_power_up_completion(twl6040, naudint);
  215. if (ret) {
  216. dev_err(&twl6040_dev->dev,
  217. "automatic power-down failed\n");
  218. twl6040->power_count = 0;
  219. goto out;
  220. }
  221. } else {
  222. /* use manual power-up sequence */
  223. ret = twl6040_power_up(twl6040);
  224. if (ret) {
  225. dev_err(&twl6040_dev->dev,
  226. "manual power-up failed\n");
  227. twl6040->power_count = 0;
  228. goto out;
  229. }
  230. }
  231. /* Default PLL configuration after power up */
  232. twl6040->pll = TWL6040_SYSCLK_SEL_LPPLL;
  233. twl6040->sysclk = 19200000;
  234. } else {
  235. /* already powered-down */
  236. if (!twl6040->power_count) {
  237. dev_err(&twl6040_dev->dev,
  238. "device is already powered-off\n");
  239. ret = -EPERM;
  240. goto out;
  241. }
  242. if (--twl6040->power_count)
  243. goto out;
  244. if (gpio_is_valid(audpwron)) {
  245. /* use AUDPWRON line */
  246. gpio_set_value(audpwron, 0);
  247. /* power-down sequence latency */
  248. usleep_range(500, 700);
  249. } else {
  250. /* use manual power-down sequence */
  251. twl6040_power_down(twl6040);
  252. }
  253. twl6040->sysclk = 0;
  254. }
  255. out:
  256. mutex_unlock(&twl6040->mutex);
  257. return ret;
  258. }
  259. EXPORT_SYMBOL(twl6040_power);
  260. int twl6040_set_pll(struct twl6040 *twl6040, int pll_id,
  261. unsigned int freq_in, unsigned int freq_out)
  262. {
  263. u8 hppllctl, lppllctl;
  264. int ret = 0;
  265. mutex_lock(&twl6040->mutex);
  266. hppllctl = twl6040_reg_read(twl6040, TWL6040_REG_HPPLLCTL);
  267. lppllctl = twl6040_reg_read(twl6040, TWL6040_REG_LPPLLCTL);
  268. switch (pll_id) {
  269. case TWL6040_SYSCLK_SEL_LPPLL:
  270. /* low-power PLL divider */
  271. switch (freq_out) {
  272. case 17640000:
  273. lppllctl |= TWL6040_LPLLFIN;
  274. break;
  275. case 19200000:
  276. lppllctl &= ~TWL6040_LPLLFIN;
  277. break;
  278. default:
  279. dev_err(&twl6040_dev->dev,
  280. "freq_out %d not supported\n", freq_out);
  281. ret = -EINVAL;
  282. goto pll_out;
  283. }
  284. twl6040_reg_write(twl6040, TWL6040_REG_LPPLLCTL, lppllctl);
  285. switch (freq_in) {
  286. case 32768:
  287. lppllctl |= TWL6040_LPLLENA;
  288. twl6040_reg_write(twl6040, TWL6040_REG_LPPLLCTL,
  289. lppllctl);
  290. mdelay(5);
  291. lppllctl &= ~TWL6040_HPLLSEL;
  292. twl6040_reg_write(twl6040, TWL6040_REG_LPPLLCTL,
  293. lppllctl);
  294. hppllctl &= ~TWL6040_HPLLENA;
  295. twl6040_reg_write(twl6040, TWL6040_REG_HPPLLCTL,
  296. hppllctl);
  297. break;
  298. default:
  299. dev_err(&twl6040_dev->dev,
  300. "freq_in %d not supported\n", freq_in);
  301. ret = -EINVAL;
  302. goto pll_out;
  303. }
  304. break;
  305. case TWL6040_SYSCLK_SEL_HPPLL:
  306. /* high-performance PLL can provide only 19.2 MHz */
  307. if (freq_out != 19200000) {
  308. dev_err(&twl6040_dev->dev,
  309. "freq_out %d not supported\n", freq_out);
  310. ret = -EINVAL;
  311. goto pll_out;
  312. }
  313. hppllctl &= ~TWL6040_MCLK_MSK;
  314. switch (freq_in) {
  315. case 12000000:
  316. /* PLL enabled, active mode */
  317. hppllctl |= TWL6040_MCLK_12000KHZ |
  318. TWL6040_HPLLENA;
  319. break;
  320. case 19200000:
  321. /*
  322. * PLL disabled
  323. * (enable PLL if MCLK jitter quality
  324. * doesn't meet specification)
  325. */
  326. hppllctl |= TWL6040_MCLK_19200KHZ;
  327. break;
  328. case 26000000:
  329. /* PLL enabled, active mode */
  330. hppllctl |= TWL6040_MCLK_26000KHZ |
  331. TWL6040_HPLLENA;
  332. break;
  333. case 38400000:
  334. /* PLL enabled, active mode */
  335. hppllctl |= TWL6040_MCLK_38400KHZ |
  336. TWL6040_HPLLENA;
  337. break;
  338. default:
  339. dev_err(&twl6040_dev->dev,
  340. "freq_in %d not supported\n", freq_in);
  341. ret = -EINVAL;
  342. goto pll_out;
  343. }
  344. /* enable clock slicer to ensure input waveform is square */
  345. hppllctl |= TWL6040_HPLLSQRENA;
  346. twl6040_reg_write(twl6040, TWL6040_REG_HPPLLCTL, hppllctl);
  347. usleep_range(500, 700);
  348. lppllctl |= TWL6040_HPLLSEL;
  349. twl6040_reg_write(twl6040, TWL6040_REG_LPPLLCTL, lppllctl);
  350. lppllctl &= ~TWL6040_LPLLENA;
  351. twl6040_reg_write(twl6040, TWL6040_REG_LPPLLCTL, lppllctl);
  352. break;
  353. default:
  354. dev_err(&twl6040_dev->dev, "unknown pll id %d\n", pll_id);
  355. ret = -EINVAL;
  356. goto pll_out;
  357. }
  358. twl6040->sysclk = freq_out;
  359. twl6040->pll = pll_id;
  360. pll_out:
  361. mutex_unlock(&twl6040->mutex);
  362. return ret;
  363. }
  364. EXPORT_SYMBOL(twl6040_set_pll);
  365. int twl6040_get_pll(struct twl6040 *twl6040)
  366. {
  367. if (twl6040->power_count)
  368. return twl6040->pll;
  369. else
  370. return -ENODEV;
  371. }
  372. EXPORT_SYMBOL(twl6040_get_pll);
  373. unsigned int twl6040_get_sysclk(struct twl6040 *twl6040)
  374. {
  375. return twl6040->sysclk;
  376. }
  377. EXPORT_SYMBOL(twl6040_get_sysclk);
  378. static struct resource twl6040_vibra_rsrc[] = {
  379. {
  380. .flags = IORESOURCE_IRQ,
  381. },
  382. };
  383. static struct resource twl6040_codec_rsrc[] = {
  384. {
  385. .flags = IORESOURCE_IRQ,
  386. },
  387. };
  388. static int __devinit twl6040_probe(struct platform_device *pdev)
  389. {
  390. struct twl4030_audio_data *pdata = pdev->dev.platform_data;
  391. struct twl6040 *twl6040;
  392. struct mfd_cell *cell = NULL;
  393. int ret, children = 0;
  394. if (!pdata) {
  395. dev_err(&pdev->dev, "Platform data is missing\n");
  396. return -EINVAL;
  397. }
  398. /* In order to operate correctly we need valid interrupt config */
  399. if (!pdata->naudint_irq || !pdata->irq_base) {
  400. dev_err(&pdev->dev, "Invalid IRQ configuration\n");
  401. return -EINVAL;
  402. }
  403. twl6040 = kzalloc(sizeof(struct twl6040), GFP_KERNEL);
  404. if (!twl6040)
  405. return -ENOMEM;
  406. platform_set_drvdata(pdev, twl6040);
  407. twl6040_dev = pdev;
  408. twl6040->dev = &pdev->dev;
  409. twl6040->audpwron = pdata->audpwron_gpio;
  410. twl6040->irq = pdata->naudint_irq;
  411. twl6040->irq_base = pdata->irq_base;
  412. mutex_init(&twl6040->mutex);
  413. mutex_init(&twl6040->io_mutex);
  414. init_completion(&twl6040->ready);
  415. twl6040->rev = twl6040_reg_read(twl6040, TWL6040_REG_ASICREV);
  416. if (gpio_is_valid(twl6040->audpwron)) {
  417. ret = gpio_request(twl6040->audpwron, "audpwron");
  418. if (ret)
  419. goto gpio1_err;
  420. ret = gpio_direction_output(twl6040->audpwron, 0);
  421. if (ret)
  422. goto gpio2_err;
  423. }
  424. /* ERRATA: Automatic power-up is not possible in ES1.0 */
  425. if (twl6040->rev == TWL6040_REV_ES1_0)
  426. twl6040->audpwron = -EINVAL;
  427. /* codec interrupt */
  428. ret = twl6040_irq_init(twl6040);
  429. if (ret)
  430. goto gpio2_err;
  431. ret = request_threaded_irq(twl6040->irq_base + TWL6040_IRQ_READY,
  432. NULL, twl6040_naudint_handler, 0,
  433. "twl6040_irq_ready", twl6040);
  434. if (ret) {
  435. dev_err(twl6040->dev, "READY IRQ request failed: %d\n",
  436. ret);
  437. goto irq_err;
  438. }
  439. /* dual-access registers controlled by I2C only */
  440. twl6040_set_bits(twl6040, TWL6040_REG_ACCCTL, TWL6040_I2CSEL);
  441. if (pdata->codec) {
  442. int irq = twl6040->irq_base + TWL6040_IRQ_PLUG;
  443. cell = &twl6040->cells[children];
  444. cell->name = "twl6040-codec";
  445. twl6040_codec_rsrc[0].start = irq;
  446. twl6040_codec_rsrc[0].end = irq;
  447. cell->resources = twl6040_codec_rsrc;
  448. cell->num_resources = ARRAY_SIZE(twl6040_codec_rsrc);
  449. cell->platform_data = pdata->codec;
  450. cell->pdata_size = sizeof(*pdata->codec);
  451. children++;
  452. }
  453. if (pdata->vibra) {
  454. int irq = twl6040->irq_base + TWL6040_IRQ_VIB;
  455. cell = &twl6040->cells[children];
  456. cell->name = "twl6040-vibra";
  457. twl6040_vibra_rsrc[0].start = irq;
  458. twl6040_vibra_rsrc[0].end = irq;
  459. cell->resources = twl6040_vibra_rsrc;
  460. cell->num_resources = ARRAY_SIZE(twl6040_vibra_rsrc);
  461. cell->platform_data = pdata->vibra;
  462. cell->pdata_size = sizeof(*pdata->vibra);
  463. children++;
  464. }
  465. if (children) {
  466. ret = mfd_add_devices(&pdev->dev, pdev->id, twl6040->cells,
  467. children, NULL, 0);
  468. if (ret)
  469. goto mfd_err;
  470. } else {
  471. dev_err(&pdev->dev, "No platform data found for children\n");
  472. ret = -ENODEV;
  473. goto mfd_err;
  474. }
  475. return 0;
  476. mfd_err:
  477. free_irq(twl6040->irq_base + TWL6040_IRQ_READY, twl6040);
  478. irq_err:
  479. twl6040_irq_exit(twl6040);
  480. gpio2_err:
  481. if (gpio_is_valid(twl6040->audpwron))
  482. gpio_free(twl6040->audpwron);
  483. gpio1_err:
  484. platform_set_drvdata(pdev, NULL);
  485. kfree(twl6040);
  486. twl6040_dev = NULL;
  487. return ret;
  488. }
  489. static int __devexit twl6040_remove(struct platform_device *pdev)
  490. {
  491. struct twl6040 *twl6040 = platform_get_drvdata(pdev);
  492. if (twl6040->power_count)
  493. twl6040_power(twl6040, 0);
  494. if (gpio_is_valid(twl6040->audpwron))
  495. gpio_free(twl6040->audpwron);
  496. free_irq(twl6040->irq_base + TWL6040_IRQ_READY, twl6040);
  497. twl6040_irq_exit(twl6040);
  498. mfd_remove_devices(&pdev->dev);
  499. platform_set_drvdata(pdev, NULL);
  500. kfree(twl6040);
  501. twl6040_dev = NULL;
  502. return 0;
  503. }
  504. static struct platform_driver twl6040_driver = {
  505. .probe = twl6040_probe,
  506. .remove = __devexit_p(twl6040_remove),
  507. .driver = {
  508. .owner = THIS_MODULE,
  509. .name = "twl6040",
  510. },
  511. };
  512. static int __devinit twl6040_init(void)
  513. {
  514. return platform_driver_register(&twl6040_driver);
  515. }
  516. module_init(twl6040_init);
  517. static void __devexit twl6040_exit(void)
  518. {
  519. platform_driver_unregister(&twl6040_driver);
  520. }
  521. module_exit(twl6040_exit);
  522. MODULE_DESCRIPTION("TWL6040 MFD");
  523. MODULE_AUTHOR("Misael Lopez Cruz <misael.lopez@ti.com>");
  524. MODULE_AUTHOR("Jorge Eduardo Candelaria <jorge.candelaria@ti.com>");
  525. MODULE_LICENSE("GPL");
  526. MODULE_ALIAS("platform:twl6040");