core.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683
  1. /*
  2. * Pin Control and GPIO driver for SuperH Pin Function Controller.
  3. *
  4. * Authors: Magnus Damm, Paul Mundt, Laurent Pinchart
  5. *
  6. * Copyright (C) 2008 Magnus Damm
  7. * Copyright (C) 2009 - 2012 Paul Mundt
  8. *
  9. * This file is subject to the terms and conditions of the GNU General Public
  10. * License. See the file "COPYING" in the main directory of this archive
  11. * for more details.
  12. */
  13. #define DRV_NAME "sh-pfc"
  14. #include <linux/bitops.h>
  15. #include <linux/err.h>
  16. #include <linux/errno.h>
  17. #include <linux/io.h>
  18. #include <linux/ioport.h>
  19. #include <linux/kernel.h>
  20. #include <linux/init.h>
  21. #include <linux/of.h>
  22. #include <linux/of_device.h>
  23. #include <linux/pinctrl/machine.h>
  24. #include <linux/platform_device.h>
  25. #include <linux/slab.h>
  26. #include "core.h"
  27. static int sh_pfc_map_resources(struct sh_pfc *pfc,
  28. struct platform_device *pdev)
  29. {
  30. unsigned int num_windows, num_irqs;
  31. struct sh_pfc_window *windows;
  32. unsigned int *irqs = NULL;
  33. struct resource *res;
  34. unsigned int i;
  35. int irq;
  36. /* Count the MEM and IRQ resources. */
  37. for (num_windows = 0;; num_windows++) {
  38. res = platform_get_resource(pdev, IORESOURCE_MEM, num_windows);
  39. if (!res)
  40. break;
  41. }
  42. for (num_irqs = 0;; num_irqs++) {
  43. irq = platform_get_irq(pdev, num_irqs);
  44. if (irq == -EPROBE_DEFER)
  45. return irq;
  46. if (irq < 0)
  47. break;
  48. }
  49. if (num_windows == 0)
  50. return -EINVAL;
  51. /* Allocate memory windows and IRQs arrays. */
  52. windows = devm_kzalloc(pfc->dev, num_windows * sizeof(*windows),
  53. GFP_KERNEL);
  54. if (windows == NULL)
  55. return -ENOMEM;
  56. pfc->num_windows = num_windows;
  57. pfc->windows = windows;
  58. if (num_irqs) {
  59. irqs = devm_kzalloc(pfc->dev, num_irqs * sizeof(*irqs),
  60. GFP_KERNEL);
  61. if (irqs == NULL)
  62. return -ENOMEM;
  63. pfc->num_irqs = num_irqs;
  64. pfc->irqs = irqs;
  65. }
  66. /* Fill them. */
  67. for (i = 0; i < num_windows; i++) {
  68. res = platform_get_resource(pdev, IORESOURCE_MEM, i);
  69. windows->phys = res->start;
  70. windows->size = resource_size(res);
  71. windows->virt = devm_ioremap_resource(pfc->dev, res);
  72. if (IS_ERR(windows->virt))
  73. return -ENOMEM;
  74. windows++;
  75. }
  76. for (i = 0; i < num_irqs; i++)
  77. *irqs++ = platform_get_irq(pdev, i);
  78. return 0;
  79. }
  80. static void __iomem *sh_pfc_phys_to_virt(struct sh_pfc *pfc, u32 reg)
  81. {
  82. struct sh_pfc_window *window;
  83. phys_addr_t address = reg;
  84. unsigned int i;
  85. /* scan through physical windows and convert address */
  86. for (i = 0; i < pfc->num_windows; i++) {
  87. window = pfc->windows + i;
  88. if (address < window->phys)
  89. continue;
  90. if (address >= (window->phys + window->size))
  91. continue;
  92. return window->virt + (address - window->phys);
  93. }
  94. BUG();
  95. return NULL;
  96. }
  97. int sh_pfc_get_pin_index(struct sh_pfc *pfc, unsigned int pin)
  98. {
  99. unsigned int offset;
  100. unsigned int i;
  101. for (i = 0, offset = 0; i < pfc->nr_ranges; ++i) {
  102. const struct sh_pfc_pin_range *range = &pfc->ranges[i];
  103. if (pin <= range->end)
  104. return pin >= range->start
  105. ? offset + pin - range->start : -1;
  106. offset += range->end - range->start + 1;
  107. }
  108. return -EINVAL;
  109. }
  110. static int sh_pfc_enum_in_range(u16 enum_id, const struct pinmux_range *r)
  111. {
  112. if (enum_id < r->begin)
  113. return 0;
  114. if (enum_id > r->end)
  115. return 0;
  116. return 1;
  117. }
  118. u32 sh_pfc_read_raw_reg(void __iomem *mapped_reg, unsigned int reg_width)
  119. {
  120. switch (reg_width) {
  121. case 8:
  122. return ioread8(mapped_reg);
  123. case 16:
  124. return ioread16(mapped_reg);
  125. case 32:
  126. return ioread32(mapped_reg);
  127. }
  128. BUG();
  129. return 0;
  130. }
  131. void sh_pfc_write_raw_reg(void __iomem *mapped_reg, unsigned int reg_width,
  132. u32 data)
  133. {
  134. switch (reg_width) {
  135. case 8:
  136. iowrite8(data, mapped_reg);
  137. return;
  138. case 16:
  139. iowrite16(data, mapped_reg);
  140. return;
  141. case 32:
  142. iowrite32(data, mapped_reg);
  143. return;
  144. }
  145. BUG();
  146. }
  147. u32 sh_pfc_read_reg(struct sh_pfc *pfc, u32 reg, unsigned int width)
  148. {
  149. return sh_pfc_read_raw_reg(sh_pfc_phys_to_virt(pfc, reg), width);
  150. }
  151. void sh_pfc_write_reg(struct sh_pfc *pfc, u32 reg, unsigned int width, u32 data)
  152. {
  153. if (pfc->info->unlock_reg)
  154. sh_pfc_write_raw_reg(
  155. sh_pfc_phys_to_virt(pfc, pfc->info->unlock_reg), 32,
  156. ~data);
  157. sh_pfc_write_raw_reg(sh_pfc_phys_to_virt(pfc, reg), width, data);
  158. }
  159. static void sh_pfc_config_reg_helper(struct sh_pfc *pfc,
  160. const struct pinmux_cfg_reg *crp,
  161. unsigned int in_pos,
  162. void __iomem **mapped_regp, u32 *maskp,
  163. unsigned int *posp)
  164. {
  165. unsigned int k;
  166. *mapped_regp = sh_pfc_phys_to_virt(pfc, crp->reg);
  167. if (crp->field_width) {
  168. *maskp = (1 << crp->field_width) - 1;
  169. *posp = crp->reg_width - ((in_pos + 1) * crp->field_width);
  170. } else {
  171. *maskp = (1 << crp->var_field_width[in_pos]) - 1;
  172. *posp = crp->reg_width;
  173. for (k = 0; k <= in_pos; k++)
  174. *posp -= crp->var_field_width[k];
  175. }
  176. }
  177. static void sh_pfc_write_config_reg(struct sh_pfc *pfc,
  178. const struct pinmux_cfg_reg *crp,
  179. unsigned int field, u32 value)
  180. {
  181. void __iomem *mapped_reg;
  182. unsigned int pos;
  183. u32 mask, data;
  184. sh_pfc_config_reg_helper(pfc, crp, field, &mapped_reg, &mask, &pos);
  185. dev_dbg(pfc->dev, "write_reg addr = %x, value = 0x%x, field = %u, "
  186. "r_width = %u, f_width = %u\n",
  187. crp->reg, value, field, crp->reg_width, crp->field_width);
  188. mask = ~(mask << pos);
  189. value = value << pos;
  190. data = sh_pfc_read_raw_reg(mapped_reg, crp->reg_width);
  191. data &= mask;
  192. data |= value;
  193. if (pfc->info->unlock_reg)
  194. sh_pfc_write_raw_reg(
  195. sh_pfc_phys_to_virt(pfc, pfc->info->unlock_reg), 32,
  196. ~data);
  197. sh_pfc_write_raw_reg(mapped_reg, crp->reg_width, data);
  198. }
  199. static int sh_pfc_get_config_reg(struct sh_pfc *pfc, u16 enum_id,
  200. const struct pinmux_cfg_reg **crp,
  201. unsigned int *fieldp, u32 *valuep)
  202. {
  203. unsigned int k = 0;
  204. while (1) {
  205. const struct pinmux_cfg_reg *config_reg =
  206. pfc->info->cfg_regs + k;
  207. unsigned int r_width = config_reg->reg_width;
  208. unsigned int f_width = config_reg->field_width;
  209. unsigned int curr_width;
  210. unsigned int bit_pos;
  211. unsigned int pos = 0;
  212. unsigned int m = 0;
  213. if (!r_width)
  214. break;
  215. for (bit_pos = 0; bit_pos < r_width; bit_pos += curr_width) {
  216. u32 ncomb;
  217. u32 n;
  218. if (f_width)
  219. curr_width = f_width;
  220. else
  221. curr_width = config_reg->var_field_width[m];
  222. ncomb = 1 << curr_width;
  223. for (n = 0; n < ncomb; n++) {
  224. if (config_reg->enum_ids[pos + n] == enum_id) {
  225. *crp = config_reg;
  226. *fieldp = m;
  227. *valuep = n;
  228. return 0;
  229. }
  230. }
  231. pos += ncomb;
  232. m++;
  233. }
  234. k++;
  235. }
  236. return -EINVAL;
  237. }
  238. static int sh_pfc_mark_to_enum(struct sh_pfc *pfc, u16 mark, int pos,
  239. u16 *enum_idp)
  240. {
  241. const u16 *data = pfc->info->pinmux_data;
  242. unsigned int k;
  243. if (pos) {
  244. *enum_idp = data[pos + 1];
  245. return pos + 1;
  246. }
  247. for (k = 0; k < pfc->info->pinmux_data_size; k++) {
  248. if (data[k] == mark) {
  249. *enum_idp = data[k + 1];
  250. return k + 1;
  251. }
  252. }
  253. dev_err(pfc->dev, "cannot locate data/mark enum_id for mark %d\n",
  254. mark);
  255. return -EINVAL;
  256. }
  257. int sh_pfc_config_mux(struct sh_pfc *pfc, unsigned mark, int pinmux_type)
  258. {
  259. const struct pinmux_range *range;
  260. int pos = 0;
  261. switch (pinmux_type) {
  262. case PINMUX_TYPE_GPIO:
  263. case PINMUX_TYPE_FUNCTION:
  264. range = NULL;
  265. break;
  266. case PINMUX_TYPE_OUTPUT:
  267. range = &pfc->info->output;
  268. break;
  269. case PINMUX_TYPE_INPUT:
  270. range = &pfc->info->input;
  271. break;
  272. default:
  273. return -EINVAL;
  274. }
  275. /* Iterate over all the configuration fields we need to update. */
  276. while (1) {
  277. const struct pinmux_cfg_reg *cr;
  278. unsigned int field;
  279. u16 enum_id;
  280. u32 value;
  281. int in_range;
  282. int ret;
  283. pos = sh_pfc_mark_to_enum(pfc, mark, pos, &enum_id);
  284. if (pos < 0)
  285. return pos;
  286. if (!enum_id)
  287. break;
  288. /* Check if the configuration field selects a function. If it
  289. * doesn't, skip the field if it's not applicable to the
  290. * requested pinmux type.
  291. */
  292. in_range = sh_pfc_enum_in_range(enum_id, &pfc->info->function);
  293. if (!in_range) {
  294. if (pinmux_type == PINMUX_TYPE_FUNCTION) {
  295. /* Functions are allowed to modify all
  296. * fields.
  297. */
  298. in_range = 1;
  299. } else if (pinmux_type != PINMUX_TYPE_GPIO) {
  300. /* Input/output types can only modify fields
  301. * that correspond to their respective ranges.
  302. */
  303. in_range = sh_pfc_enum_in_range(enum_id, range);
  304. /*
  305. * special case pass through for fixed
  306. * input-only or output-only pins without
  307. * function enum register association.
  308. */
  309. if (in_range && enum_id == range->force)
  310. continue;
  311. }
  312. /* GPIOs are only allowed to modify function fields. */
  313. }
  314. if (!in_range)
  315. continue;
  316. ret = sh_pfc_get_config_reg(pfc, enum_id, &cr, &field, &value);
  317. if (ret < 0)
  318. return ret;
  319. sh_pfc_write_config_reg(pfc, cr, field, value);
  320. }
  321. return 0;
  322. }
  323. const struct sh_pfc_bias_info *
  324. sh_pfc_pin_to_bias_info(const struct sh_pfc_bias_info *info,
  325. unsigned int num, unsigned int pin)
  326. {
  327. unsigned int i;
  328. for (i = 0; i < num; i++)
  329. if (info[i].pin == pin)
  330. return &info[i];
  331. WARN_ONCE(1, "Pin %u is not in bias info list\n", pin);
  332. return NULL;
  333. }
  334. static int sh_pfc_init_ranges(struct sh_pfc *pfc)
  335. {
  336. struct sh_pfc_pin_range *range;
  337. unsigned int nr_ranges;
  338. unsigned int i;
  339. if (pfc->info->pins[0].pin == (u16)-1) {
  340. /* Pin number -1 denotes that the SoC doesn't report pin numbers
  341. * in its pin arrays yet. Consider the pin numbers range as
  342. * continuous and allocate a single range.
  343. */
  344. pfc->nr_ranges = 1;
  345. pfc->ranges = devm_kzalloc(pfc->dev, sizeof(*pfc->ranges),
  346. GFP_KERNEL);
  347. if (pfc->ranges == NULL)
  348. return -ENOMEM;
  349. pfc->ranges->start = 0;
  350. pfc->ranges->end = pfc->info->nr_pins - 1;
  351. pfc->nr_gpio_pins = pfc->info->nr_pins;
  352. return 0;
  353. }
  354. /* Count, allocate and fill the ranges. The PFC SoC data pins array must
  355. * be sorted by pin numbers, and pins without a GPIO port must come
  356. * last.
  357. */
  358. for (i = 1, nr_ranges = 1; i < pfc->info->nr_pins; ++i) {
  359. if (pfc->info->pins[i-1].pin != pfc->info->pins[i].pin - 1)
  360. nr_ranges++;
  361. }
  362. pfc->nr_ranges = nr_ranges;
  363. pfc->ranges = devm_kzalloc(pfc->dev, sizeof(*pfc->ranges) * nr_ranges,
  364. GFP_KERNEL);
  365. if (pfc->ranges == NULL)
  366. return -ENOMEM;
  367. range = pfc->ranges;
  368. range->start = pfc->info->pins[0].pin;
  369. for (i = 1; i < pfc->info->nr_pins; ++i) {
  370. if (pfc->info->pins[i-1].pin == pfc->info->pins[i].pin - 1)
  371. continue;
  372. range->end = pfc->info->pins[i-1].pin;
  373. if (!(pfc->info->pins[i-1].configs & SH_PFC_PIN_CFG_NO_GPIO))
  374. pfc->nr_gpio_pins = range->end + 1;
  375. range++;
  376. range->start = pfc->info->pins[i].pin;
  377. }
  378. range->end = pfc->info->pins[i-1].pin;
  379. if (!(pfc->info->pins[i-1].configs & SH_PFC_PIN_CFG_NO_GPIO))
  380. pfc->nr_gpio_pins = range->end + 1;
  381. return 0;
  382. }
  383. #ifdef CONFIG_OF
  384. static const struct of_device_id sh_pfc_of_table[] = {
  385. #ifdef CONFIG_PINCTRL_PFC_EMEV2
  386. {
  387. .compatible = "renesas,pfc-emev2",
  388. .data = &emev2_pinmux_info,
  389. },
  390. #endif
  391. #ifdef CONFIG_PINCTRL_PFC_R8A73A4
  392. {
  393. .compatible = "renesas,pfc-r8a73a4",
  394. .data = &r8a73a4_pinmux_info,
  395. },
  396. #endif
  397. #ifdef CONFIG_PINCTRL_PFC_R8A7740
  398. {
  399. .compatible = "renesas,pfc-r8a7740",
  400. .data = &r8a7740_pinmux_info,
  401. },
  402. #endif
  403. #ifdef CONFIG_PINCTRL_PFC_R8A7778
  404. {
  405. .compatible = "renesas,pfc-r8a7778",
  406. .data = &r8a7778_pinmux_info,
  407. },
  408. #endif
  409. #ifdef CONFIG_PINCTRL_PFC_R8A7779
  410. {
  411. .compatible = "renesas,pfc-r8a7779",
  412. .data = &r8a7779_pinmux_info,
  413. },
  414. #endif
  415. #ifdef CONFIG_PINCTRL_PFC_R8A7790
  416. {
  417. .compatible = "renesas,pfc-r8a7790",
  418. .data = &r8a7790_pinmux_info,
  419. },
  420. #endif
  421. #ifdef CONFIG_PINCTRL_PFC_R8A7791
  422. {
  423. .compatible = "renesas,pfc-r8a7791",
  424. .data = &r8a7791_pinmux_info,
  425. },
  426. #endif
  427. #ifdef CONFIG_PINCTRL_PFC_R8A7792
  428. {
  429. .compatible = "renesas,pfc-r8a7792",
  430. .data = &r8a7792_pinmux_info,
  431. },
  432. #endif
  433. #ifdef CONFIG_PINCTRL_PFC_R8A7793
  434. {
  435. .compatible = "renesas,pfc-r8a7793",
  436. .data = &r8a7793_pinmux_info,
  437. },
  438. #endif
  439. #ifdef CONFIG_PINCTRL_PFC_R8A7794
  440. {
  441. .compatible = "renesas,pfc-r8a7794",
  442. .data = &r8a7794_pinmux_info,
  443. },
  444. #endif
  445. #ifdef CONFIG_PINCTRL_PFC_R8A7795
  446. {
  447. .compatible = "renesas,pfc-r8a7795",
  448. .data = &r8a7795_pinmux_info,
  449. },
  450. #endif
  451. #ifdef CONFIG_PINCTRL_PFC_R8A7796
  452. {
  453. .compatible = "renesas,pfc-r8a7796",
  454. .data = &r8a7796_pinmux_info,
  455. },
  456. #endif
  457. #ifdef CONFIG_PINCTRL_PFC_SH73A0
  458. {
  459. .compatible = "renesas,pfc-sh73a0",
  460. .data = &sh73a0_pinmux_info,
  461. },
  462. #endif
  463. { },
  464. };
  465. #endif
  466. static int sh_pfc_probe(struct platform_device *pdev)
  467. {
  468. const struct platform_device_id *platid = platform_get_device_id(pdev);
  469. #ifdef CONFIG_OF
  470. struct device_node *np = pdev->dev.of_node;
  471. #endif
  472. const struct sh_pfc_soc_info *info;
  473. struct sh_pfc *pfc;
  474. int ret;
  475. #ifdef CONFIG_OF
  476. if (np)
  477. info = of_device_get_match_data(&pdev->dev);
  478. else
  479. #endif
  480. info = platid ? (const void *)platid->driver_data : NULL;
  481. if (info == NULL)
  482. return -ENODEV;
  483. pfc = devm_kzalloc(&pdev->dev, sizeof(*pfc), GFP_KERNEL);
  484. if (pfc == NULL)
  485. return -ENOMEM;
  486. pfc->info = info;
  487. pfc->dev = &pdev->dev;
  488. ret = sh_pfc_map_resources(pfc, pdev);
  489. if (unlikely(ret < 0))
  490. return ret;
  491. spin_lock_init(&pfc->lock);
  492. if (info->ops && info->ops->init) {
  493. ret = info->ops->init(pfc);
  494. if (ret < 0)
  495. return ret;
  496. }
  497. /* Enable dummy states for those platforms without pinctrl support */
  498. if (!of_have_populated_dt())
  499. pinctrl_provide_dummies();
  500. ret = sh_pfc_init_ranges(pfc);
  501. if (ret < 0)
  502. return ret;
  503. /*
  504. * Initialize pinctrl bindings first
  505. */
  506. ret = sh_pfc_register_pinctrl(pfc);
  507. if (unlikely(ret != 0))
  508. return ret;
  509. #ifdef CONFIG_PINCTRL_SH_PFC_GPIO
  510. /*
  511. * Then the GPIO chip
  512. */
  513. ret = sh_pfc_register_gpiochip(pfc);
  514. if (unlikely(ret != 0)) {
  515. /*
  516. * If the GPIO chip fails to come up we still leave the
  517. * PFC state as it is, given that there are already
  518. * extant users of it that have succeeded by this point.
  519. */
  520. dev_notice(pfc->dev, "failed to init GPIO chip, ignoring...\n");
  521. }
  522. #endif
  523. platform_set_drvdata(pdev, pfc);
  524. dev_info(pfc->dev, "%s support registered\n", info->name);
  525. return 0;
  526. }
  527. static const struct platform_device_id sh_pfc_id_table[] = {
  528. #ifdef CONFIG_PINCTRL_PFC_SH7203
  529. { "pfc-sh7203", (kernel_ulong_t)&sh7203_pinmux_info },
  530. #endif
  531. #ifdef CONFIG_PINCTRL_PFC_SH7264
  532. { "pfc-sh7264", (kernel_ulong_t)&sh7264_pinmux_info },
  533. #endif
  534. #ifdef CONFIG_PINCTRL_PFC_SH7269
  535. { "pfc-sh7269", (kernel_ulong_t)&sh7269_pinmux_info },
  536. #endif
  537. #ifdef CONFIG_PINCTRL_PFC_SH7720
  538. { "pfc-sh7720", (kernel_ulong_t)&sh7720_pinmux_info },
  539. #endif
  540. #ifdef CONFIG_PINCTRL_PFC_SH7722
  541. { "pfc-sh7722", (kernel_ulong_t)&sh7722_pinmux_info },
  542. #endif
  543. #ifdef CONFIG_PINCTRL_PFC_SH7723
  544. { "pfc-sh7723", (kernel_ulong_t)&sh7723_pinmux_info },
  545. #endif
  546. #ifdef CONFIG_PINCTRL_PFC_SH7724
  547. { "pfc-sh7724", (kernel_ulong_t)&sh7724_pinmux_info },
  548. #endif
  549. #ifdef CONFIG_PINCTRL_PFC_SH7734
  550. { "pfc-sh7734", (kernel_ulong_t)&sh7734_pinmux_info },
  551. #endif
  552. #ifdef CONFIG_PINCTRL_PFC_SH7757
  553. { "pfc-sh7757", (kernel_ulong_t)&sh7757_pinmux_info },
  554. #endif
  555. #ifdef CONFIG_PINCTRL_PFC_SH7785
  556. { "pfc-sh7785", (kernel_ulong_t)&sh7785_pinmux_info },
  557. #endif
  558. #ifdef CONFIG_PINCTRL_PFC_SH7786
  559. { "pfc-sh7786", (kernel_ulong_t)&sh7786_pinmux_info },
  560. #endif
  561. #ifdef CONFIG_PINCTRL_PFC_SHX3
  562. { "pfc-shx3", (kernel_ulong_t)&shx3_pinmux_info },
  563. #endif
  564. { "sh-pfc", 0 },
  565. { },
  566. };
  567. static struct platform_driver sh_pfc_driver = {
  568. .probe = sh_pfc_probe,
  569. .id_table = sh_pfc_id_table,
  570. .driver = {
  571. .name = DRV_NAME,
  572. .of_match_table = of_match_ptr(sh_pfc_of_table),
  573. },
  574. };
  575. static int __init sh_pfc_init(void)
  576. {
  577. return platform_driver_register(&sh_pfc_driver);
  578. }
  579. postcore_initcall(sh_pfc_init);