twl-common.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  1. /*
  2. * twl-common.c
  3. *
  4. * Copyright (C) 2011 Texas Instruments, Inc..
  5. * Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * version 2 as published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  19. * 02110-1301 USA
  20. *
  21. */
  22. #include <linux/i2c.h>
  23. #include <linux/i2c/twl.h>
  24. #include <linux/gpio.h>
  25. #include <linux/regulator/machine.h>
  26. #include <linux/regulator/fixed.h>
  27. #include "soc.h"
  28. #include "twl-common.h"
  29. #include "pm.h"
  30. #include "voltage.h"
  31. #include "mux.h"
  32. static struct i2c_board_info __initdata pmic_i2c_board_info = {
  33. .addr = 0x48,
  34. .flags = I2C_CLIENT_WAKE,
  35. };
  36. #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
  37. static int twl_set_voltage(void *data, int target_uV)
  38. {
  39. struct voltagedomain *voltdm = (struct voltagedomain *)data;
  40. return voltdm_scale(voltdm, target_uV);
  41. }
  42. static int twl_get_voltage(void *data)
  43. {
  44. struct voltagedomain *voltdm = (struct voltagedomain *)data;
  45. return voltdm_get_voltage(voltdm);
  46. }
  47. #endif
  48. void __init omap_pmic_init(int bus, u32 clkrate,
  49. const char *pmic_type, int pmic_irq,
  50. struct twl4030_platform_data *pmic_data)
  51. {
  52. omap_mux_init_signal("sys_nirq", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE);
  53. strncpy(pmic_i2c_board_info.type, pmic_type,
  54. sizeof(pmic_i2c_board_info.type));
  55. pmic_i2c_board_info.irq = pmic_irq;
  56. pmic_i2c_board_info.platform_data = pmic_data;
  57. omap_register_i2c_bus(bus, clkrate, &pmic_i2c_board_info, 1);
  58. }
  59. void __init omap4_pmic_init(const char *pmic_type,
  60. struct twl4030_platform_data *pmic_data,
  61. struct i2c_board_info *devices, int nr_devices)
  62. {
  63. /* PMIC part*/
  64. omap_mux_init_signal("sys_nirq1", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE);
  65. omap_pmic_init(1, 400, pmic_type, 7 + OMAP44XX_IRQ_GIC_START, pmic_data);
  66. /* Register additional devices on i2c1 bus if needed */
  67. if (devices)
  68. i2c_register_board_info(1, devices, nr_devices);
  69. }
  70. void __init omap_pmic_late_init(void)
  71. {
  72. /* Init the OMAP TWL parameters (if PMIC has been registerd) */
  73. if (!pmic_i2c_board_info.irq)
  74. return;
  75. omap3_twl_init();
  76. omap4_twl_init();
  77. }
  78. #if defined(CONFIG_ARCH_OMAP3)
  79. static struct twl4030_usb_data omap3_usb_pdata = {
  80. .usb_mode = T2_USB_MODE_ULPI,
  81. };
  82. static int omap3_batt_table[] = {
  83. /* 0 C */
  84. 30800, 29500, 28300, 27100,
  85. 26000, 24900, 23900, 22900, 22000, 21100, 20300, 19400, 18700, 17900,
  86. 17200, 16500, 15900, 15300, 14700, 14100, 13600, 13100, 12600, 12100,
  87. 11600, 11200, 10800, 10400, 10000, 9630, 9280, 8950, 8620, 8310,
  88. 8020, 7730, 7460, 7200, 6950, 6710, 6470, 6250, 6040, 5830,
  89. 5640, 5450, 5260, 5090, 4920, 4760, 4600, 4450, 4310, 4170,
  90. 4040, 3910, 3790, 3670, 3550
  91. };
  92. static struct twl4030_bci_platform_data omap3_bci_pdata = {
  93. .battery_tmp_tbl = omap3_batt_table,
  94. .tblsize = ARRAY_SIZE(omap3_batt_table),
  95. };
  96. static struct twl4030_madc_platform_data omap3_madc_pdata = {
  97. .irq_line = 1,
  98. };
  99. static struct twl4030_codec_data omap3_codec;
  100. static struct twl4030_audio_data omap3_audio_pdata = {
  101. .audio_mclk = 26000000,
  102. .codec = &omap3_codec,
  103. };
  104. static struct regulator_consumer_supply omap3_vdda_dac_supplies[] = {
  105. REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"),
  106. };
  107. static struct regulator_init_data omap3_vdac_idata = {
  108. .constraints = {
  109. .min_uV = 1800000,
  110. .max_uV = 1800000,
  111. .valid_modes_mask = REGULATOR_MODE_NORMAL
  112. | REGULATOR_MODE_STANDBY,
  113. .valid_ops_mask = REGULATOR_CHANGE_MODE
  114. | REGULATOR_CHANGE_STATUS,
  115. },
  116. .num_consumer_supplies = ARRAY_SIZE(omap3_vdda_dac_supplies),
  117. .consumer_supplies = omap3_vdda_dac_supplies,
  118. };
  119. static struct regulator_consumer_supply omap3_vpll2_supplies[] = {
  120. REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
  121. REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi.0"),
  122. };
  123. static struct regulator_init_data omap3_vpll2_idata = {
  124. .constraints = {
  125. .min_uV = 1800000,
  126. .max_uV = 1800000,
  127. .valid_modes_mask = REGULATOR_MODE_NORMAL
  128. | REGULATOR_MODE_STANDBY,
  129. .valid_ops_mask = REGULATOR_CHANGE_MODE
  130. | REGULATOR_CHANGE_STATUS,
  131. },
  132. .num_consumer_supplies = ARRAY_SIZE(omap3_vpll2_supplies),
  133. .consumer_supplies = omap3_vpll2_supplies,
  134. };
  135. static struct regulator_consumer_supply omap3_vdd1_supply[] = {
  136. REGULATOR_SUPPLY("vcc", "cpu0"),
  137. };
  138. static struct regulator_consumer_supply omap3_vdd2_supply[] = {
  139. REGULATOR_SUPPLY("vcc", "l3_main.0"),
  140. };
  141. static struct regulator_init_data omap3_vdd1 = {
  142. .constraints = {
  143. .name = "vdd_mpu_iva",
  144. .min_uV = 600000,
  145. .max_uV = 1450000,
  146. .valid_modes_mask = REGULATOR_MODE_NORMAL,
  147. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
  148. },
  149. .num_consumer_supplies = ARRAY_SIZE(omap3_vdd1_supply),
  150. .consumer_supplies = omap3_vdd1_supply,
  151. };
  152. static struct regulator_init_data omap3_vdd2 = {
  153. .constraints = {
  154. .name = "vdd_core",
  155. .min_uV = 600000,
  156. .max_uV = 1450000,
  157. .valid_modes_mask = REGULATOR_MODE_NORMAL,
  158. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
  159. },
  160. .num_consumer_supplies = ARRAY_SIZE(omap3_vdd2_supply),
  161. .consumer_supplies = omap3_vdd2_supply,
  162. };
  163. static struct twl_regulator_driver_data omap3_vdd1_drvdata = {
  164. .get_voltage = twl_get_voltage,
  165. .set_voltage = twl_set_voltage,
  166. };
  167. static struct twl_regulator_driver_data omap3_vdd2_drvdata = {
  168. .get_voltage = twl_get_voltage,
  169. .set_voltage = twl_set_voltage,
  170. };
  171. void __init omap3_pmic_get_config(struct twl4030_platform_data *pmic_data,
  172. u32 pdata_flags, u32 regulators_flags)
  173. {
  174. if (!pmic_data->vdd1) {
  175. omap3_vdd1.driver_data = &omap3_vdd1_drvdata;
  176. omap3_vdd1_drvdata.data = voltdm_lookup("mpu_iva");
  177. pmic_data->vdd1 = &omap3_vdd1;
  178. }
  179. if (!pmic_data->vdd2) {
  180. omap3_vdd2.driver_data = &omap3_vdd2_drvdata;
  181. omap3_vdd2_drvdata.data = voltdm_lookup("core");
  182. pmic_data->vdd2 = &omap3_vdd2;
  183. }
  184. /* Common platform data configurations */
  185. if (pdata_flags & TWL_COMMON_PDATA_USB && !pmic_data->usb)
  186. pmic_data->usb = &omap3_usb_pdata;
  187. if (pdata_flags & TWL_COMMON_PDATA_BCI && !pmic_data->bci)
  188. pmic_data->bci = &omap3_bci_pdata;
  189. if (pdata_flags & TWL_COMMON_PDATA_MADC && !pmic_data->madc)
  190. pmic_data->madc = &omap3_madc_pdata;
  191. if (pdata_flags & TWL_COMMON_PDATA_AUDIO && !pmic_data->audio)
  192. pmic_data->audio = &omap3_audio_pdata;
  193. /* Common regulator configurations */
  194. if (regulators_flags & TWL_COMMON_REGULATOR_VDAC && !pmic_data->vdac)
  195. pmic_data->vdac = &omap3_vdac_idata;
  196. if (regulators_flags & TWL_COMMON_REGULATOR_VPLL2 && !pmic_data->vpll2)
  197. pmic_data->vpll2 = &omap3_vpll2_idata;
  198. }
  199. #endif /* CONFIG_ARCH_OMAP3 */
  200. #if defined(CONFIG_ARCH_OMAP4)
  201. static struct twl4030_usb_data omap4_usb_pdata = {
  202. };
  203. static struct regulator_consumer_supply omap4_vdda_hdmi_dac_supplies[] = {
  204. REGULATOR_SUPPLY("vdda_hdmi_dac", "omapdss_hdmi"),
  205. };
  206. static struct regulator_init_data omap4_vdac_idata = {
  207. .constraints = {
  208. .min_uV = 1800000,
  209. .max_uV = 1800000,
  210. .valid_modes_mask = REGULATOR_MODE_NORMAL
  211. | REGULATOR_MODE_STANDBY,
  212. .valid_ops_mask = REGULATOR_CHANGE_MODE
  213. | REGULATOR_CHANGE_STATUS,
  214. },
  215. .num_consumer_supplies = ARRAY_SIZE(omap4_vdda_hdmi_dac_supplies),
  216. .consumer_supplies = omap4_vdda_hdmi_dac_supplies,
  217. .supply_regulator = "V2V1",
  218. };
  219. static struct regulator_init_data omap4_vaux2_idata = {
  220. .constraints = {
  221. .min_uV = 1200000,
  222. .max_uV = 2800000,
  223. .apply_uV = true,
  224. .valid_modes_mask = REGULATOR_MODE_NORMAL
  225. | REGULATOR_MODE_STANDBY,
  226. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
  227. | REGULATOR_CHANGE_MODE
  228. | REGULATOR_CHANGE_STATUS,
  229. },
  230. };
  231. static struct regulator_init_data omap4_vaux3_idata = {
  232. .constraints = {
  233. .min_uV = 1000000,
  234. .max_uV = 3000000,
  235. .apply_uV = true,
  236. .valid_modes_mask = REGULATOR_MODE_NORMAL
  237. | REGULATOR_MODE_STANDBY,
  238. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
  239. | REGULATOR_CHANGE_MODE
  240. | REGULATOR_CHANGE_STATUS,
  241. },
  242. };
  243. static struct regulator_consumer_supply omap4_vmmc_supply[] = {
  244. REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
  245. };
  246. /* VMMC1 for MMC1 card */
  247. static struct regulator_init_data omap4_vmmc_idata = {
  248. .constraints = {
  249. .min_uV = 1200000,
  250. .max_uV = 3000000,
  251. .apply_uV = true,
  252. .valid_modes_mask = REGULATOR_MODE_NORMAL
  253. | REGULATOR_MODE_STANDBY,
  254. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
  255. | REGULATOR_CHANGE_MODE
  256. | REGULATOR_CHANGE_STATUS,
  257. },
  258. .num_consumer_supplies = ARRAY_SIZE(omap4_vmmc_supply),
  259. .consumer_supplies = omap4_vmmc_supply,
  260. };
  261. static struct regulator_init_data omap4_vpp_idata = {
  262. .constraints = {
  263. .min_uV = 1800000,
  264. .max_uV = 2500000,
  265. .apply_uV = true,
  266. .valid_modes_mask = REGULATOR_MODE_NORMAL
  267. | REGULATOR_MODE_STANDBY,
  268. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
  269. | REGULATOR_CHANGE_MODE
  270. | REGULATOR_CHANGE_STATUS,
  271. },
  272. };
  273. static struct regulator_init_data omap4_vana_idata = {
  274. .constraints = {
  275. .min_uV = 2100000,
  276. .max_uV = 2100000,
  277. .valid_modes_mask = REGULATOR_MODE_NORMAL
  278. | REGULATOR_MODE_STANDBY,
  279. .valid_ops_mask = REGULATOR_CHANGE_MODE
  280. | REGULATOR_CHANGE_STATUS,
  281. },
  282. };
  283. static struct regulator_consumer_supply omap4_vcxio_supply[] = {
  284. REGULATOR_SUPPLY("vdds_dsi", "omapdss_dss"),
  285. REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi.0"),
  286. REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi.1"),
  287. };
  288. static struct regulator_init_data omap4_vcxio_idata = {
  289. .constraints = {
  290. .min_uV = 1800000,
  291. .max_uV = 1800000,
  292. .valid_modes_mask = REGULATOR_MODE_NORMAL
  293. | REGULATOR_MODE_STANDBY,
  294. .valid_ops_mask = REGULATOR_CHANGE_MODE
  295. | REGULATOR_CHANGE_STATUS,
  296. .always_on = true,
  297. },
  298. .num_consumer_supplies = ARRAY_SIZE(omap4_vcxio_supply),
  299. .consumer_supplies = omap4_vcxio_supply,
  300. .supply_regulator = "V2V1",
  301. };
  302. static struct regulator_init_data omap4_vusb_idata = {
  303. .constraints = {
  304. .min_uV = 3300000,
  305. .max_uV = 3300000,
  306. .valid_modes_mask = REGULATOR_MODE_NORMAL
  307. | REGULATOR_MODE_STANDBY,
  308. .valid_ops_mask = REGULATOR_CHANGE_MODE
  309. | REGULATOR_CHANGE_STATUS,
  310. },
  311. };
  312. static struct regulator_init_data omap4_clk32kg_idata = {
  313. .constraints = {
  314. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  315. },
  316. };
  317. static struct regulator_consumer_supply omap4_vdd1_supply[] = {
  318. REGULATOR_SUPPLY("vcc", "mpu.0"),
  319. };
  320. static struct regulator_consumer_supply omap4_vdd2_supply[] = {
  321. REGULATOR_SUPPLY("vcc", "iva.0"),
  322. };
  323. static struct regulator_consumer_supply omap4_vdd3_supply[] = {
  324. REGULATOR_SUPPLY("vcc", "l3_main.0"),
  325. };
  326. static struct regulator_init_data omap4_vdd1 = {
  327. .constraints = {
  328. .name = "vdd_mpu",
  329. .min_uV = 500000,
  330. .max_uV = 1500000,
  331. .valid_modes_mask = REGULATOR_MODE_NORMAL,
  332. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
  333. },
  334. .num_consumer_supplies = ARRAY_SIZE(omap4_vdd1_supply),
  335. .consumer_supplies = omap4_vdd1_supply,
  336. };
  337. static struct regulator_init_data omap4_vdd2 = {
  338. .constraints = {
  339. .name = "vdd_iva",
  340. .min_uV = 500000,
  341. .max_uV = 1500000,
  342. .valid_modes_mask = REGULATOR_MODE_NORMAL,
  343. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
  344. },
  345. .num_consumer_supplies = ARRAY_SIZE(omap4_vdd2_supply),
  346. .consumer_supplies = omap4_vdd2_supply,
  347. };
  348. static struct regulator_init_data omap4_vdd3 = {
  349. .constraints = {
  350. .name = "vdd_core",
  351. .min_uV = 500000,
  352. .max_uV = 1500000,
  353. .valid_modes_mask = REGULATOR_MODE_NORMAL,
  354. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
  355. },
  356. .num_consumer_supplies = ARRAY_SIZE(omap4_vdd3_supply),
  357. .consumer_supplies = omap4_vdd3_supply,
  358. };
  359. static struct twl_regulator_driver_data omap4_vdd1_drvdata = {
  360. .get_voltage = twl_get_voltage,
  361. .set_voltage = twl_set_voltage,
  362. };
  363. static struct twl_regulator_driver_data omap4_vdd2_drvdata = {
  364. .get_voltage = twl_get_voltage,
  365. .set_voltage = twl_set_voltage,
  366. };
  367. static struct twl_regulator_driver_data omap4_vdd3_drvdata = {
  368. .get_voltage = twl_get_voltage,
  369. .set_voltage = twl_set_voltage,
  370. };
  371. static struct regulator_consumer_supply omap4_v1v8_supply[] = {
  372. REGULATOR_SUPPLY("vio", "1-004b"),
  373. };
  374. static struct regulator_init_data omap4_v1v8_idata = {
  375. .constraints = {
  376. .min_uV = 1800000,
  377. .max_uV = 1800000,
  378. .valid_modes_mask = REGULATOR_MODE_NORMAL
  379. | REGULATOR_MODE_STANDBY,
  380. .valid_ops_mask = REGULATOR_CHANGE_MODE
  381. | REGULATOR_CHANGE_STATUS,
  382. .always_on = true,
  383. },
  384. .num_consumer_supplies = ARRAY_SIZE(omap4_v1v8_supply),
  385. .consumer_supplies = omap4_v1v8_supply,
  386. };
  387. static struct regulator_consumer_supply omap4_v2v1_supply[] = {
  388. REGULATOR_SUPPLY("v2v1", "1-004b"),
  389. };
  390. static struct regulator_init_data omap4_v2v1_idata = {
  391. .constraints = {
  392. .min_uV = 2100000,
  393. .max_uV = 2100000,
  394. .valid_modes_mask = REGULATOR_MODE_NORMAL
  395. | REGULATOR_MODE_STANDBY,
  396. .valid_ops_mask = REGULATOR_CHANGE_MODE
  397. | REGULATOR_CHANGE_STATUS,
  398. },
  399. .num_consumer_supplies = ARRAY_SIZE(omap4_v2v1_supply),
  400. .consumer_supplies = omap4_v2v1_supply,
  401. };
  402. void __init omap4_pmic_get_config(struct twl4030_platform_data *pmic_data,
  403. u32 pdata_flags, u32 regulators_flags)
  404. {
  405. if (!pmic_data->vdd1) {
  406. omap4_vdd1.driver_data = &omap4_vdd1_drvdata;
  407. omap4_vdd1_drvdata.data = voltdm_lookup("mpu");
  408. pmic_data->vdd1 = &omap4_vdd1;
  409. }
  410. if (!pmic_data->vdd2) {
  411. omap4_vdd2.driver_data = &omap4_vdd2_drvdata;
  412. omap4_vdd2_drvdata.data = voltdm_lookup("iva");
  413. pmic_data->vdd2 = &omap4_vdd2;
  414. }
  415. if (!pmic_data->vdd3) {
  416. omap4_vdd3.driver_data = &omap4_vdd3_drvdata;
  417. omap4_vdd3_drvdata.data = voltdm_lookup("core");
  418. pmic_data->vdd3 = &omap4_vdd3;
  419. }
  420. /* Common platform data configurations */
  421. if (pdata_flags & TWL_COMMON_PDATA_USB && !pmic_data->usb)
  422. pmic_data->usb = &omap4_usb_pdata;
  423. /* Common regulator configurations */
  424. if (regulators_flags & TWL_COMMON_REGULATOR_VDAC && !pmic_data->vdac)
  425. pmic_data->vdac = &omap4_vdac_idata;
  426. if (regulators_flags & TWL_COMMON_REGULATOR_VAUX2 && !pmic_data->vaux2)
  427. pmic_data->vaux2 = &omap4_vaux2_idata;
  428. if (regulators_flags & TWL_COMMON_REGULATOR_VAUX3 && !pmic_data->vaux3)
  429. pmic_data->vaux3 = &omap4_vaux3_idata;
  430. if (regulators_flags & TWL_COMMON_REGULATOR_VMMC && !pmic_data->vmmc)
  431. pmic_data->vmmc = &omap4_vmmc_idata;
  432. if (regulators_flags & TWL_COMMON_REGULATOR_VPP && !pmic_data->vpp)
  433. pmic_data->vpp = &omap4_vpp_idata;
  434. if (regulators_flags & TWL_COMMON_REGULATOR_VANA && !pmic_data->vana)
  435. pmic_data->vana = &omap4_vana_idata;
  436. if (regulators_flags & TWL_COMMON_REGULATOR_VCXIO && !pmic_data->vcxio)
  437. pmic_data->vcxio = &omap4_vcxio_idata;
  438. if (regulators_flags & TWL_COMMON_REGULATOR_VUSB && !pmic_data->vusb)
  439. pmic_data->vusb = &omap4_vusb_idata;
  440. if (regulators_flags & TWL_COMMON_REGULATOR_CLK32KG &&
  441. !pmic_data->clk32kg)
  442. pmic_data->clk32kg = &omap4_clk32kg_idata;
  443. if (regulators_flags & TWL_COMMON_REGULATOR_V1V8 && !pmic_data->v1v8)
  444. pmic_data->v1v8 = &omap4_v1v8_idata;
  445. if (regulators_flags & TWL_COMMON_REGULATOR_V2V1 && !pmic_data->v2v1)
  446. pmic_data->v2v1 = &omap4_v2v1_idata;
  447. }
  448. #endif /* CONFIG_ARCH_OMAP4 */
  449. #if defined(CONFIG_SND_OMAP_SOC_OMAP_TWL4030) || \
  450. defined(CONFIG_SND_OMAP_SOC_OMAP_TWL4030_MODULE)
  451. #include <linux/platform_data/omap-twl4030.h>
  452. static struct omap_tw4030_pdata omap_twl4030_audio_data;
  453. static struct platform_device audio_device = {
  454. .name = "omap-twl4030",
  455. .id = -1,
  456. .dev = {
  457. .platform_data = &omap_twl4030_audio_data,
  458. },
  459. };
  460. void __init omap_twl4030_audio_init(char *card_name)
  461. {
  462. omap_twl4030_audio_data.card_name = card_name;
  463. platform_device_register(&audio_device);
  464. }
  465. #else /* SOC_OMAP_TWL4030 */
  466. void __init omap_twl4030_audio_init(char *card_name)
  467. {
  468. return;
  469. }
  470. #endif /* SOC_OMAP_TWL4030 */