sta2x11-mfd.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. /*
  2. * Copyright (c) 2009-2011 Wind River Systems, Inc.
  3. * Copyright (c) 2011 ST Microelectronics (Alessandro Rubini)
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. * See the GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. *
  18. */
  19. #include <linux/kernel.h>
  20. #include <linux/module.h>
  21. #include <linux/spinlock.h>
  22. #include <linux/errno.h>
  23. #include <linux/device.h>
  24. #include <linux/slab.h>
  25. #include <linux/list.h>
  26. #include <linux/io.h>
  27. #include <linux/ioport.h>
  28. #include <linux/pci.h>
  29. #include <linux/seq_file.h>
  30. #include <linux/platform_device.h>
  31. #include <linux/mfd/core.h>
  32. #include <linux/mfd/sta2x11-mfd.h>
  33. #include <linux/regmap.h>
  34. #include <asm/sta2x11.h>
  35. static inline int __reg_within_range(unsigned int r,
  36. unsigned int start,
  37. unsigned int end)
  38. {
  39. return ((r >= start) && (r <= end));
  40. }
  41. /* This describes STA2X11 MFD chip for us, we may have several */
  42. struct sta2x11_mfd {
  43. struct sta2x11_instance *instance;
  44. struct regmap *regmap[sta2x11_n_mfd_plat_devs];
  45. spinlock_t lock;
  46. struct list_head list;
  47. void __iomem *regs[sta2x11_n_mfd_plat_devs];
  48. };
  49. static LIST_HEAD(sta2x11_mfd_list);
  50. /* Three functions to act on the list */
  51. static struct sta2x11_mfd *sta2x11_mfd_find(struct pci_dev *pdev)
  52. {
  53. struct sta2x11_instance *instance;
  54. struct sta2x11_mfd *mfd;
  55. if (!pdev && !list_empty(&sta2x11_mfd_list)) {
  56. pr_warning("%s: Unspecified device, "
  57. "using first instance\n", __func__);
  58. return list_entry(sta2x11_mfd_list.next,
  59. struct sta2x11_mfd, list);
  60. }
  61. instance = sta2x11_get_instance(pdev);
  62. if (!instance)
  63. return NULL;
  64. list_for_each_entry(mfd, &sta2x11_mfd_list, list) {
  65. if (mfd->instance == instance)
  66. return mfd;
  67. }
  68. return NULL;
  69. }
  70. static int __devinit sta2x11_mfd_add(struct pci_dev *pdev, gfp_t flags)
  71. {
  72. struct sta2x11_mfd *mfd = sta2x11_mfd_find(pdev);
  73. struct sta2x11_instance *instance;
  74. if (mfd)
  75. return -EBUSY;
  76. instance = sta2x11_get_instance(pdev);
  77. if (!instance)
  78. return -EINVAL;
  79. mfd = kzalloc(sizeof(*mfd), flags);
  80. if (!mfd)
  81. return -ENOMEM;
  82. INIT_LIST_HEAD(&mfd->list);
  83. spin_lock_init(&mfd->lock);
  84. mfd->instance = instance;
  85. list_add(&mfd->list, &sta2x11_mfd_list);
  86. return 0;
  87. }
  88. static int __devexit mfd_remove(struct pci_dev *pdev)
  89. {
  90. struct sta2x11_mfd *mfd = sta2x11_mfd_find(pdev);
  91. if (!mfd)
  92. return -ENODEV;
  93. list_del(&mfd->list);
  94. kfree(mfd);
  95. return 0;
  96. }
  97. /* This function is exported and is not expected to fail */
  98. u32 __sta2x11_mfd_mask(struct pci_dev *pdev, u32 reg, u32 mask, u32 val,
  99. enum sta2x11_mfd_plat_dev index)
  100. {
  101. struct sta2x11_mfd *mfd = sta2x11_mfd_find(pdev);
  102. u32 r;
  103. unsigned long flags;
  104. void __iomem *regs = mfd->regs[index];
  105. if (!mfd) {
  106. dev_warn(&pdev->dev, ": can't access sctl regs\n");
  107. return 0;
  108. }
  109. if (!regs) {
  110. dev_warn(&pdev->dev, ": system ctl not initialized\n");
  111. return 0;
  112. }
  113. spin_lock_irqsave(&mfd->lock, flags);
  114. r = readl(regs + reg);
  115. r &= ~mask;
  116. r |= val;
  117. if (mask)
  118. writel(r, regs + reg);
  119. spin_unlock_irqrestore(&mfd->lock, flags);
  120. return r;
  121. }
  122. EXPORT_SYMBOL(__sta2x11_mfd_mask);
  123. /*
  124. * Special sta2x11-mfd regmap lock/unlock functions
  125. */
  126. static void sta2x11_regmap_lock(void *__lock)
  127. {
  128. spinlock_t *lock = __lock;
  129. spin_lock(lock);
  130. }
  131. static void sta2x11_regmap_unlock(void *__lock)
  132. {
  133. spinlock_t *lock = __lock;
  134. spin_unlock(lock);
  135. }
  136. static const char *sta2x11_mfd_names[sta2x11_n_mfd_plat_devs] = {
  137. [sta2x11_sctl] = "sta2x11-sctl",
  138. [sta2x11_apbreg] = "sta2x11-apbreg",
  139. [sta2x11_apb_soc_regs] = "sta2x11-apb-soc-regs",
  140. };
  141. static bool sta2x11_sctl_writeable_reg(struct device *dev, unsigned int reg)
  142. {
  143. return !__reg_within_range(reg, SCTL_SCPCIECSBRST, SCTL_SCRSTSTA);
  144. }
  145. static struct regmap_config sta2x11_sctl_regmap_config = {
  146. .reg_bits = 32,
  147. .reg_stride = 4,
  148. .val_bits = 32,
  149. .lock = sta2x11_regmap_lock,
  150. .unlock = sta2x11_regmap_unlock,
  151. .max_register = SCTL_SCRSTSTA,
  152. .writeable_reg = sta2x11_sctl_writeable_reg,
  153. };
  154. static bool sta2x11_apbreg_readable_reg(struct device *dev, unsigned int reg)
  155. {
  156. /* Two blocks (CAN and MLB, SARAC) 0x100 bytes apart */
  157. if (reg >= APBREG_BSR_SARAC)
  158. reg -= APBREG_BSR_SARAC;
  159. switch (reg) {
  160. case APBREG_BSR:
  161. case APBREG_PAER:
  162. case APBREG_PWAC:
  163. case APBREG_PRAC:
  164. case APBREG_PCG:
  165. case APBREG_PUR:
  166. case APBREG_EMU_PCG:
  167. return true;
  168. default:
  169. return false;
  170. }
  171. }
  172. static bool sta2x11_apbreg_writeable_reg(struct device *dev, unsigned int reg)
  173. {
  174. if (reg >= APBREG_BSR_SARAC)
  175. reg -= APBREG_BSR_SARAC;
  176. if (!sta2x11_apbreg_readable_reg(dev, reg))
  177. return false;
  178. return reg != APBREG_PAER;
  179. }
  180. static struct regmap_config sta2x11_apbreg_regmap_config = {
  181. .reg_bits = 32,
  182. .reg_stride = 4,
  183. .val_bits = 32,
  184. .lock = sta2x11_regmap_lock,
  185. .unlock = sta2x11_regmap_unlock,
  186. .max_register = APBREG_EMU_PCG_SARAC,
  187. .readable_reg = sta2x11_apbreg_readable_reg,
  188. .writeable_reg = sta2x11_apbreg_writeable_reg,
  189. };
  190. static bool sta2x11_apb_soc_regs_readable_reg(struct device *dev,
  191. unsigned int reg)
  192. {
  193. return reg <= PCIE_SoC_INT_ROUTER_STATUS3_REG ||
  194. __reg_within_range(reg, DMA_IP_CTRL_REG, SPARE3_RESERVED) ||
  195. __reg_within_range(reg, MASTER_LOCK_REG,
  196. SYSTEM_CONFIG_STATUS_REG) ||
  197. reg == MSP_CLK_CTRL_REG ||
  198. __reg_within_range(reg, COMPENSATION_REG1, TEST_CTL_REG);
  199. }
  200. static bool sta2x11_apb_soc_regs_writeable_reg(struct device *dev,
  201. unsigned int reg)
  202. {
  203. if (!sta2x11_apb_soc_regs_readable_reg(dev, reg))
  204. return false;
  205. switch (reg) {
  206. case PCIE_COMMON_CLOCK_CONFIG_0_4_0:
  207. case SYSTEM_CONFIG_STATUS_REG:
  208. case COMPENSATION_REG1:
  209. case PCIE_SoC_INT_ROUTER_STATUS0_REG...PCIE_SoC_INT_ROUTER_STATUS3_REG:
  210. case PCIE_PM_STATUS_0_PORT_0_4...PCIE_PM_STATUS_7_0_EP4:
  211. return false;
  212. default:
  213. return true;
  214. }
  215. }
  216. static struct regmap_config sta2x11_apb_soc_regs_regmap_config = {
  217. .reg_bits = 32,
  218. .reg_stride = 4,
  219. .val_bits = 32,
  220. .lock = sta2x11_regmap_lock,
  221. .unlock = sta2x11_regmap_unlock,
  222. .max_register = TEST_CTL_REG,
  223. .readable_reg = sta2x11_apb_soc_regs_readable_reg,
  224. .writeable_reg = sta2x11_apb_soc_regs_writeable_reg,
  225. };
  226. static struct regmap_config *
  227. sta2x11_mfd_regmap_configs[sta2x11_n_mfd_plat_devs] = {
  228. [sta2x11_sctl] = &sta2x11_sctl_regmap_config,
  229. [sta2x11_apbreg] = &sta2x11_apbreg_regmap_config,
  230. [sta2x11_apb_soc_regs] = &sta2x11_apb_soc_regs_regmap_config,
  231. };
  232. /* Probe for the three platform devices */
  233. static int sta2x11_mfd_platform_probe(struct platform_device *dev,
  234. enum sta2x11_mfd_plat_dev index)
  235. {
  236. struct pci_dev **pdev;
  237. struct sta2x11_mfd *mfd;
  238. struct resource *res;
  239. const char *name = sta2x11_mfd_names[index];
  240. struct regmap_config *regmap_config = sta2x11_mfd_regmap_configs[index];
  241. pdev = dev->dev.platform_data;
  242. mfd = sta2x11_mfd_find(*pdev);
  243. if (!mfd)
  244. return -ENODEV;
  245. if (!regmap_config)
  246. return -ENODEV;
  247. res = platform_get_resource(dev, IORESOURCE_MEM, 0);
  248. if (!res)
  249. return -ENOMEM;
  250. if (!request_mem_region(res->start, resource_size(res), name))
  251. return -EBUSY;
  252. mfd->regs[index] = ioremap(res->start, resource_size(res));
  253. if (!mfd->regs[index]) {
  254. release_mem_region(res->start, resource_size(res));
  255. return -ENOMEM;
  256. }
  257. regmap_config->lock_arg = &mfd->lock;
  258. /*
  259. No caching, registers could be reached both via regmap and via
  260. void __iomem *
  261. */
  262. regmap_config->cache_type = REGCACHE_NONE;
  263. mfd->regmap[index] = devm_regmap_init_mmio(&dev->dev, mfd->regs[index],
  264. regmap_config);
  265. WARN_ON(!mfd->regmap[index]);
  266. return 0;
  267. }
  268. static int sta2x11_sctl_probe(struct platform_device *dev)
  269. {
  270. return sta2x11_mfd_platform_probe(dev, sta2x11_sctl);
  271. }
  272. static int sta2x11_apbreg_probe(struct platform_device *dev)
  273. {
  274. return sta2x11_mfd_platform_probe(dev, sta2x11_apbreg);
  275. }
  276. static int sta2x11_apb_soc_regs_probe(struct platform_device *dev)
  277. {
  278. return sta2x11_mfd_platform_probe(dev, sta2x11_apb_soc_regs);
  279. }
  280. /* The three platform drivers */
  281. static struct platform_driver sta2x11_sctl_platform_driver = {
  282. .driver = {
  283. .name = "sta2x11-sctl",
  284. .owner = THIS_MODULE,
  285. },
  286. .probe = sta2x11_sctl_probe,
  287. };
  288. static int __init sta2x11_sctl_init(void)
  289. {
  290. pr_info("%s\n", __func__);
  291. return platform_driver_register(&sta2x11_sctl_platform_driver);
  292. }
  293. static struct platform_driver sta2x11_platform_driver = {
  294. .driver = {
  295. .name = "sta2x11-apbreg",
  296. .owner = THIS_MODULE,
  297. },
  298. .probe = sta2x11_apbreg_probe,
  299. };
  300. static int __init sta2x11_apbreg_init(void)
  301. {
  302. pr_info("%s\n", __func__);
  303. return platform_driver_register(&sta2x11_platform_driver);
  304. }
  305. static struct platform_driver sta2x11_apb_soc_regs_platform_driver = {
  306. .driver = {
  307. .name = "sta2x11-apb-soc-regs",
  308. .owner = THIS_MODULE,
  309. },
  310. .probe = sta2x11_apb_soc_regs_probe,
  311. };
  312. static int __init sta2x11_apb_soc_regs_init(void)
  313. {
  314. pr_info("%s\n", __func__);
  315. return platform_driver_register(&sta2x11_apb_soc_regs_platform_driver);
  316. }
  317. /*
  318. * What follows are the PCI devices that host the above pdevs.
  319. * Each logic block is 4kB and they are all consecutive: we use this info.
  320. */
  321. /* Mfd 0 device */
  322. /* Mfd 0, Bar 0 */
  323. enum mfd0_bar0_cells {
  324. STA2X11_GPIO_0 = 0,
  325. STA2X11_GPIO_1,
  326. STA2X11_GPIO_2,
  327. STA2X11_GPIO_3,
  328. STA2X11_SCTL,
  329. STA2X11_SCR,
  330. STA2X11_TIME,
  331. };
  332. /* Mfd 0 , Bar 1 */
  333. enum mfd0_bar1_cells {
  334. STA2X11_APBREG = 0,
  335. };
  336. #define CELL_4K(_name, _cell) { \
  337. .name = _name, \
  338. .start = _cell * 4096, .end = _cell * 4096 + 4095, \
  339. .flags = IORESOURCE_MEM, \
  340. }
  341. static const __devinitconst struct resource gpio_resources[] = {
  342. {
  343. .name = "sta2x11_gpio", /* 4 consecutive cells, 1 driver */
  344. .start = 0,
  345. .end = (4 * 4096) - 1,
  346. .flags = IORESOURCE_MEM,
  347. }
  348. };
  349. static const __devinitconst struct resource sctl_resources[] = {
  350. CELL_4K("sta2x11-sctl", STA2X11_SCTL),
  351. };
  352. static const __devinitconst struct resource scr_resources[] = {
  353. CELL_4K("sta2x11-scr", STA2X11_SCR),
  354. };
  355. static const __devinitconst struct resource time_resources[] = {
  356. CELL_4K("sta2x11-time", STA2X11_TIME),
  357. };
  358. static const __devinitconst struct resource apbreg_resources[] = {
  359. CELL_4K("sta2x11-apbreg", STA2X11_APBREG),
  360. };
  361. #define DEV(_name, _r) \
  362. { .name = _name, .num_resources = ARRAY_SIZE(_r), .resources = _r, }
  363. static __devinitdata struct mfd_cell sta2x11_mfd0_bar0[] = {
  364. DEV("sta2x11-gpio", gpio_resources), /* offset 0: we add pdata later */
  365. DEV("sta2x11-sctl", sctl_resources),
  366. DEV("sta2x11-scr", scr_resources),
  367. DEV("sta2x11-time", time_resources),
  368. };
  369. static __devinitdata struct mfd_cell sta2x11_mfd0_bar1[] = {
  370. DEV("sta2x11-apbreg", apbreg_resources),
  371. };
  372. /* Mfd 1 devices */
  373. /* Mfd 1, Bar 0 */
  374. enum mfd1_bar0_cells {
  375. STA2X11_VIC = 0,
  376. };
  377. /* Mfd 1, Bar 1 */
  378. enum mfd1_bar1_cells {
  379. STA2X11_APB_SOC_REGS = 0,
  380. };
  381. static const __devinitconst struct resource vic_resources[] = {
  382. CELL_4K("sta2x11-vic", STA2X11_VIC),
  383. };
  384. static const __devinitconst struct resource apb_soc_regs_resources[] = {
  385. CELL_4K("sta2x11-apb-soc-regs", STA2X11_APB_SOC_REGS),
  386. };
  387. static __devinitdata struct mfd_cell sta2x11_mfd1_bar0[] = {
  388. DEV("sta2x11-vic", vic_resources),
  389. };
  390. static __devinitdata struct mfd_cell sta2x11_mfd1_bar1[] = {
  391. DEV("sta2x11-apb-soc-regs", apb_soc_regs_resources),
  392. };
  393. static int sta2x11_mfd_suspend(struct pci_dev *pdev, pm_message_t state)
  394. {
  395. pci_save_state(pdev);
  396. pci_disable_device(pdev);
  397. pci_set_power_state(pdev, pci_choose_state(pdev, state));
  398. return 0;
  399. }
  400. static int sta2x11_mfd_resume(struct pci_dev *pdev)
  401. {
  402. int err;
  403. pci_set_power_state(pdev, 0);
  404. err = pci_enable_device(pdev);
  405. if (err)
  406. return err;
  407. pci_restore_state(pdev);
  408. return 0;
  409. }
  410. struct sta2x11_mfd_bar_setup_data {
  411. struct mfd_cell *cells;
  412. int ncells;
  413. };
  414. struct sta2x11_mfd_setup_data {
  415. struct sta2x11_mfd_bar_setup_data bars[2];
  416. };
  417. #define STA2X11_MFD0 0
  418. #define STA2X11_MFD1 1
  419. static struct sta2x11_mfd_setup_data mfd_setup_data[] = {
  420. /* Mfd 0: gpio, sctl, scr, timers / apbregs */
  421. [STA2X11_MFD0] = {
  422. .bars = {
  423. [0] = {
  424. .cells = sta2x11_mfd0_bar0,
  425. .ncells = ARRAY_SIZE(sta2x11_mfd0_bar0),
  426. },
  427. [1] = {
  428. .cells = sta2x11_mfd0_bar1,
  429. .ncells = ARRAY_SIZE(sta2x11_mfd0_bar1),
  430. },
  431. },
  432. },
  433. /* Mfd 1: vic / apb-soc-regs */
  434. [STA2X11_MFD1] = {
  435. .bars = {
  436. [0] = {
  437. .cells = sta2x11_mfd1_bar0,
  438. .ncells = ARRAY_SIZE(sta2x11_mfd1_bar0),
  439. },
  440. [1] = {
  441. .cells = sta2x11_mfd1_bar1,
  442. .ncells = ARRAY_SIZE(sta2x11_mfd1_bar1),
  443. },
  444. },
  445. },
  446. };
  447. static void __devinit sta2x11_mfd_setup(struct pci_dev *pdev,
  448. struct sta2x11_mfd_setup_data *sd)
  449. {
  450. int i, j;
  451. for (i = 0; i < ARRAY_SIZE(sd->bars); i++)
  452. for (j = 0; j < sd->bars[i].ncells; j++) {
  453. sd->bars[i].cells[j].pdata_size = sizeof(pdev);
  454. sd->bars[i].cells[j].platform_data = &pdev;
  455. }
  456. }
  457. static int __devinit sta2x11_mfd_probe(struct pci_dev *pdev,
  458. const struct pci_device_id *pci_id)
  459. {
  460. int err, i;
  461. struct sta2x11_mfd_setup_data *setup_data;
  462. struct sta2x11_gpio_pdata *gpio_data;
  463. dev_info(&pdev->dev, "%s\n", __func__);
  464. err = pci_enable_device(pdev);
  465. if (err) {
  466. dev_err(&pdev->dev, "Can't enable device.\n");
  467. return err;
  468. }
  469. err = pci_enable_msi(pdev);
  470. if (err)
  471. dev_info(&pdev->dev, "Enable msi failed\n");
  472. setup_data = pci_id->device == PCI_DEVICE_ID_STMICRO_GPIO ?
  473. &mfd_setup_data[STA2X11_MFD0] :
  474. &mfd_setup_data[STA2X11_MFD1];
  475. /* Read gpio config data as pci device's platform data */
  476. gpio_data = dev_get_platdata(&pdev->dev);
  477. if (!gpio_data)
  478. dev_warn(&pdev->dev, "no gpio configuration\n");
  479. dev_dbg(&pdev->dev, "%s, gpio_data = %p (%p)\n", __func__,
  480. gpio_data, &gpio_data);
  481. dev_dbg(&pdev->dev, "%s, pdev = %p (%p)\n", __func__,
  482. pdev, &pdev);
  483. /* platform data is the pci device for all of them */
  484. sta2x11_mfd_setup(pdev, setup_data);
  485. /* Record this pdev before mfd_add_devices: their probe looks for it */
  486. sta2x11_mfd_add(pdev, GFP_ATOMIC);
  487. /* Just 2 bars for all mfd's at present */
  488. for (i = 0; i < 2; i++) {
  489. err = mfd_add_devices(&pdev->dev, -1,
  490. setup_data->bars[i].cells,
  491. setup_data->bars[i].ncells,
  492. &pdev->resource[i],
  493. 0, NULL);
  494. if (err) {
  495. dev_err(&pdev->dev,
  496. "mfd_add_devices[%d] failed: %d\n", i, err);
  497. goto err_disable;
  498. }
  499. }
  500. return 0;
  501. err_disable:
  502. mfd_remove_devices(&pdev->dev);
  503. pci_disable_device(pdev);
  504. pci_disable_msi(pdev);
  505. return err;
  506. }
  507. static DEFINE_PCI_DEVICE_TABLE(sta2x11_mfd_tbl) = {
  508. {PCI_DEVICE(PCI_VENDOR_ID_STMICRO, PCI_DEVICE_ID_STMICRO_GPIO)},
  509. {PCI_DEVICE(PCI_VENDOR_ID_STMICRO, PCI_DEVICE_ID_STMICRO_VIC)},
  510. {0,},
  511. };
  512. static struct pci_driver sta2x11_mfd_driver = {
  513. .name = "sta2x11-mfd",
  514. .id_table = sta2x11_mfd_tbl,
  515. .probe = sta2x11_mfd_probe,
  516. .suspend = sta2x11_mfd_suspend,
  517. .resume = sta2x11_mfd_resume,
  518. };
  519. static int __init sta2x11_mfd_init(void)
  520. {
  521. pr_info("%s\n", __func__);
  522. return pci_register_driver(&sta2x11_mfd_driver);
  523. }
  524. /*
  525. * All of this must be ready before "normal" devices like MMCI appear.
  526. * But MFD (the pci device) can't be too early. The following choice
  527. * prepares platform drivers very early and probe the PCI device later,
  528. * but before other PCI devices.
  529. */
  530. subsys_initcall(sta2x11_apbreg_init);
  531. subsys_initcall(sta2x11_sctl_init);
  532. subsys_initcall(sta2x11_apb_soc_regs_init);
  533. rootfs_initcall(sta2x11_mfd_init);
  534. MODULE_LICENSE("GPL v2");
  535. MODULE_AUTHOR("Wind River");
  536. MODULE_DESCRIPTION("STA2x11 mfd for GPIO, SCTL and APBREG");
  537. MODULE_DEVICE_TABLE(pci, sta2x11_mfd_tbl);