1
2
3
4
5
6
7
8
9
10
11#define DRV_NAME "sh-pfc"
12
13#include <linux/bitops.h>
14#include <linux/err.h>
15#include <linux/errno.h>
16#include <linux/io.h>
17#include <linux/ioport.h>
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/of.h>
21#include <linux/of_device.h>
22#include <linux/pinctrl/machine.h>
23#include <linux/platform_device.h>
24#include <linux/psci.h>
25#include <linux/slab.h>
26
27#include "core.h"
28
29static int sh_pfc_map_resources(struct sh_pfc *pfc,
30 struct platform_device *pdev)
31{
32 unsigned int num_windows, num_irqs;
33 struct sh_pfc_window *windows;
34 unsigned int *irqs = NULL;
35 struct resource *res;
36 unsigned int i;
37 int irq;
38
39
40 for (num_windows = 0;; num_windows++) {
41 res = platform_get_resource(pdev, IORESOURCE_MEM, num_windows);
42 if (!res)
43 break;
44 }
45 for (num_irqs = 0;; num_irqs++) {
46 irq = platform_get_irq(pdev, num_irqs);
47 if (irq == -EPROBE_DEFER)
48 return irq;
49 if (irq < 0)
50 break;
51 }
52
53 if (num_windows == 0)
54 return -EINVAL;
55
56
57 windows = devm_kcalloc(pfc->dev, num_windows, sizeof(*windows),
58 GFP_KERNEL);
59 if (windows == NULL)
60 return -ENOMEM;
61
62 pfc->num_windows = num_windows;
63 pfc->windows = windows;
64
65 if (num_irqs) {
66 irqs = devm_kcalloc(pfc->dev, num_irqs, sizeof(*irqs),
67 GFP_KERNEL);
68 if (irqs == NULL)
69 return -ENOMEM;
70
71 pfc->num_irqs = num_irqs;
72 pfc->irqs = irqs;
73 }
74
75
76 for (i = 0; i < num_windows; i++) {
77 res = platform_get_resource(pdev, IORESOURCE_MEM, i);
78 windows->phys = res->start;
79 windows->size = resource_size(res);
80 windows->virt = devm_ioremap_resource(pfc->dev, res);
81 if (IS_ERR(windows->virt))
82 return -ENOMEM;
83 windows++;
84 }
85 for (i = 0; i < num_irqs; i++)
86 *irqs++ = platform_get_irq(pdev, i);
87
88 return 0;
89}
90
91static void __iomem *sh_pfc_phys_to_virt(struct sh_pfc *pfc, u32 reg)
92{
93 struct sh_pfc_window *window;
94 phys_addr_t address = reg;
95 unsigned int i;
96
97
98 for (i = 0; i < pfc->num_windows; i++) {
99 window = pfc->windows + i;
100
101 if (address < window->phys)
102 continue;
103
104 if (address >= (window->phys + window->size))
105 continue;
106
107 return window->virt + (address - window->phys);
108 }
109
110 BUG();
111 return NULL;
112}
113
114int sh_pfc_get_pin_index(struct sh_pfc *pfc, unsigned int pin)
115{
116 unsigned int offset;
117 unsigned int i;
118
119 for (i = 0, offset = 0; i < pfc->nr_ranges; ++i) {
120 const struct sh_pfc_pin_range *range = &pfc->ranges[i];
121
122 if (pin <= range->end)
123 return pin >= range->start
124 ? offset + pin - range->start : -1;
125
126 offset += range->end - range->start + 1;
127 }
128
129 return -EINVAL;
130}
131
132static int sh_pfc_enum_in_range(u16 enum_id, const struct pinmux_range *r)
133{
134 if (enum_id < r->begin)
135 return 0;
136
137 if (enum_id > r->end)
138 return 0;
139
140 return 1;
141}
142
143u32 sh_pfc_read_raw_reg(void __iomem *mapped_reg, unsigned int reg_width)
144{
145 switch (reg_width) {
146 case 8:
147 return ioread8(mapped_reg);
148 case 16:
149 return ioread16(mapped_reg);
150 case 32:
151 return ioread32(mapped_reg);
152 }
153
154 BUG();
155 return 0;
156}
157
158void sh_pfc_write_raw_reg(void __iomem *mapped_reg, unsigned int reg_width,
159 u32 data)
160{
161 switch (reg_width) {
162 case 8:
163 iowrite8(data, mapped_reg);
164 return;
165 case 16:
166 iowrite16(data, mapped_reg);
167 return;
168 case 32:
169 iowrite32(data, mapped_reg);
170 return;
171 }
172
173 BUG();
174}
175
176u32 sh_pfc_read(struct sh_pfc *pfc, u32 reg)
177{
178 return sh_pfc_read_raw_reg(sh_pfc_phys_to_virt(pfc, reg), 32);
179}
180
181void sh_pfc_write(struct sh_pfc *pfc, u32 reg, u32 data)
182{
183 if (pfc->info->unlock_reg)
184 sh_pfc_write_raw_reg(
185 sh_pfc_phys_to_virt(pfc, pfc->info->unlock_reg), 32,
186 ~data);
187
188 sh_pfc_write_raw_reg(sh_pfc_phys_to_virt(pfc, reg), 32, data);
189}
190
191static void sh_pfc_config_reg_helper(struct sh_pfc *pfc,
192 const struct pinmux_cfg_reg *crp,
193 unsigned int in_pos,
194 void __iomem **mapped_regp, u32 *maskp,
195 unsigned int *posp)
196{
197 unsigned int k;
198
199 *mapped_regp = sh_pfc_phys_to_virt(pfc, crp->reg);
200
201 if (crp->field_width) {
202 *maskp = (1 << crp->field_width) - 1;
203 *posp = crp->reg_width - ((in_pos + 1) * crp->field_width);
204 } else {
205 *maskp = (1 << crp->var_field_width[in_pos]) - 1;
206 *posp = crp->reg_width;
207 for (k = 0; k <= in_pos; k++)
208 *posp -= crp->var_field_width[k];
209 }
210}
211
212static void sh_pfc_write_config_reg(struct sh_pfc *pfc,
213 const struct pinmux_cfg_reg *crp,
214 unsigned int field, u32 value)
215{
216 void __iomem *mapped_reg;
217 unsigned int pos;
218 u32 mask, data;
219
220 sh_pfc_config_reg_helper(pfc, crp, field, &mapped_reg, &mask, &pos);
221
222 dev_dbg(pfc->dev, "write_reg addr = %x, value = 0x%x, field = %u, "
223 "r_width = %u, f_width = %u\n",
224 crp->reg, value, field, crp->reg_width, hweight32(mask));
225
226 mask = ~(mask << pos);
227 value = value << pos;
228
229 data = sh_pfc_read_raw_reg(mapped_reg, crp->reg_width);
230 data &= mask;
231 data |= value;
232
233 if (pfc->info->unlock_reg)
234 sh_pfc_write_raw_reg(
235 sh_pfc_phys_to_virt(pfc, pfc->info->unlock_reg), 32,
236 ~data);
237
238 sh_pfc_write_raw_reg(mapped_reg, crp->reg_width, data);
239}
240
241static int sh_pfc_get_config_reg(struct sh_pfc *pfc, u16 enum_id,
242 const struct pinmux_cfg_reg **crp,
243 unsigned int *fieldp, u32 *valuep)
244{
245 unsigned int k = 0;
246
247 while (1) {
248 const struct pinmux_cfg_reg *config_reg =
249 pfc->info->cfg_regs + k;
250 unsigned int r_width = config_reg->reg_width;
251 unsigned int f_width = config_reg->field_width;
252 unsigned int curr_width;
253 unsigned int bit_pos;
254 unsigned int pos = 0;
255 unsigned int m = 0;
256
257 if (!r_width)
258 break;
259
260 for (bit_pos = 0; bit_pos < r_width; bit_pos += curr_width) {
261 u32 ncomb;
262 u32 n;
263
264 if (f_width)
265 curr_width = f_width;
266 else
267 curr_width = config_reg->var_field_width[m];
268
269 ncomb = 1 << curr_width;
270 for (n = 0; n < ncomb; n++) {
271 if (config_reg->enum_ids[pos + n] == enum_id) {
272 *crp = config_reg;
273 *fieldp = m;
274 *valuep = n;
275 return 0;
276 }
277 }
278 pos += ncomb;
279 m++;
280 }
281 k++;
282 }
283
284 return -EINVAL;
285}
286
287static int sh_pfc_mark_to_enum(struct sh_pfc *pfc, u16 mark, int pos,
288 u16 *enum_idp)
289{
290 const u16 *data = pfc->info->pinmux_data;
291 unsigned int k;
292
293 if (pos) {
294 *enum_idp = data[pos + 1];
295 return pos + 1;
296 }
297
298 for (k = 0; k < pfc->info->pinmux_data_size; k++) {
299 if (data[k] == mark) {
300 *enum_idp = data[k + 1];
301 return k + 1;
302 }
303 }
304
305 dev_err(pfc->dev, "cannot locate data/mark enum_id for mark %d\n",
306 mark);
307 return -EINVAL;
308}
309
310int sh_pfc_config_mux(struct sh_pfc *pfc, unsigned mark, int pinmux_type)
311{
312 const struct pinmux_range *range;
313 int pos = 0;
314
315 switch (pinmux_type) {
316 case PINMUX_TYPE_GPIO:
317 case PINMUX_TYPE_FUNCTION:
318 range = NULL;
319 break;
320
321 case PINMUX_TYPE_OUTPUT:
322 range = &pfc->info->output;
323 break;
324
325 case PINMUX_TYPE_INPUT:
326 range = &pfc->info->input;
327 break;
328
329 default:
330 return -EINVAL;
331 }
332
333
334 while (1) {
335 const struct pinmux_cfg_reg *cr;
336 unsigned int field;
337 u16 enum_id;
338 u32 value;
339 int in_range;
340 int ret;
341
342 pos = sh_pfc_mark_to_enum(pfc, mark, pos, &enum_id);
343 if (pos < 0)
344 return pos;
345
346 if (!enum_id)
347 break;
348
349
350
351
352
353 in_range = sh_pfc_enum_in_range(enum_id, &pfc->info->function);
354 if (!in_range) {
355 if (pinmux_type == PINMUX_TYPE_FUNCTION) {
356
357
358
359 in_range = 1;
360 } else if (pinmux_type != PINMUX_TYPE_GPIO) {
361
362
363
364 in_range = sh_pfc_enum_in_range(enum_id, range);
365
366
367
368
369
370
371 if (in_range && enum_id == range->force)
372 continue;
373 }
374
375 }
376
377 if (!in_range)
378 continue;
379
380 ret = sh_pfc_get_config_reg(pfc, enum_id, &cr, &field, &value);
381 if (ret < 0)
382 return ret;
383
384 sh_pfc_write_config_reg(pfc, cr, field, value);
385 }
386
387 return 0;
388}
389
390const struct pinmux_bias_reg *
391sh_pfc_pin_to_bias_reg(const struct sh_pfc *pfc, unsigned int pin,
392 unsigned int *bit)
393{
394 unsigned int i, j;
395
396 for (i = 0; pfc->info->bias_regs[i].puen; i++) {
397 for (j = 0; j < ARRAY_SIZE(pfc->info->bias_regs[i].pins); j++) {
398 if (pfc->info->bias_regs[i].pins[j] == pin) {
399 *bit = j;
400 return &pfc->info->bias_regs[i];
401 }
402 }
403 }
404
405 WARN_ONCE(1, "Pin %u is not in bias info list\n", pin);
406
407 return NULL;
408}
409
410static int sh_pfc_init_ranges(struct sh_pfc *pfc)
411{
412 struct sh_pfc_pin_range *range;
413 unsigned int nr_ranges;
414 unsigned int i;
415
416 if (pfc->info->pins[0].pin == (u16)-1) {
417
418
419
420
421 pfc->nr_ranges = 1;
422 pfc->ranges = devm_kzalloc(pfc->dev, sizeof(*pfc->ranges),
423 GFP_KERNEL);
424 if (pfc->ranges == NULL)
425 return -ENOMEM;
426
427 pfc->ranges->start = 0;
428 pfc->ranges->end = pfc->info->nr_pins - 1;
429 pfc->nr_gpio_pins = pfc->info->nr_pins;
430
431 return 0;
432 }
433
434
435
436
437
438 for (i = 1, nr_ranges = 1; i < pfc->info->nr_pins; ++i) {
439 if (pfc->info->pins[i-1].pin != pfc->info->pins[i].pin - 1)
440 nr_ranges++;
441 }
442
443 pfc->nr_ranges = nr_ranges;
444 pfc->ranges = devm_kcalloc(pfc->dev, nr_ranges, sizeof(*pfc->ranges),
445 GFP_KERNEL);
446 if (pfc->ranges == NULL)
447 return -ENOMEM;
448
449 range = pfc->ranges;
450 range->start = pfc->info->pins[0].pin;
451
452 for (i = 1; i < pfc->info->nr_pins; ++i) {
453 if (pfc->info->pins[i-1].pin == pfc->info->pins[i].pin - 1)
454 continue;
455
456 range->end = pfc->info->pins[i-1].pin;
457 if (!(pfc->info->pins[i-1].configs & SH_PFC_PIN_CFG_NO_GPIO))
458 pfc->nr_gpio_pins = range->end + 1;
459
460 range++;
461 range->start = pfc->info->pins[i].pin;
462 }
463
464 range->end = pfc->info->pins[i-1].pin;
465 if (!(pfc->info->pins[i-1].configs & SH_PFC_PIN_CFG_NO_GPIO))
466 pfc->nr_gpio_pins = range->end + 1;
467
468 return 0;
469}
470
471#ifdef CONFIG_OF
472static const struct of_device_id sh_pfc_of_table[] = {
473#ifdef CONFIG_PINCTRL_PFC_EMEV2
474 {
475 .compatible = "renesas,pfc-emev2",
476 .data = &emev2_pinmux_info,
477 },
478#endif
479#ifdef CONFIG_PINCTRL_PFC_R8A73A4
480 {
481 .compatible = "renesas,pfc-r8a73a4",
482 .data = &r8a73a4_pinmux_info,
483 },
484#endif
485#ifdef CONFIG_PINCTRL_PFC_R8A7740
486 {
487 .compatible = "renesas,pfc-r8a7740",
488 .data = &r8a7740_pinmux_info,
489 },
490#endif
491#ifdef CONFIG_PINCTRL_PFC_R8A7743
492 {
493 .compatible = "renesas,pfc-r8a7743",
494 .data = &r8a7743_pinmux_info,
495 },
496#endif
497#ifdef CONFIG_PINCTRL_PFC_R8A7744
498 {
499 .compatible = "renesas,pfc-r8a7744",
500 .data = &r8a7744_pinmux_info,
501 },
502#endif
503#ifdef CONFIG_PINCTRL_PFC_R8A7745
504 {
505 .compatible = "renesas,pfc-r8a7745",
506 .data = &r8a7745_pinmux_info,
507 },
508#endif
509#ifdef CONFIG_PINCTRL_PFC_R8A77470
510 {
511 .compatible = "renesas,pfc-r8a77470",
512 .data = &r8a77470_pinmux_info,
513 },
514#endif
515#ifdef CONFIG_PINCTRL_PFC_R8A774A1
516 {
517 .compatible = "renesas,pfc-r8a774a1",
518 .data = &r8a774a1_pinmux_info,
519 },
520#endif
521#ifdef CONFIG_PINCTRL_PFC_R8A774C0
522 {
523 .compatible = "renesas,pfc-r8a774c0",
524 .data = &r8a774c0_pinmux_info,
525 },
526#endif
527#ifdef CONFIG_PINCTRL_PFC_R8A7778
528 {
529 .compatible = "renesas,pfc-r8a7778",
530 .data = &r8a7778_pinmux_info,
531 },
532#endif
533#ifdef CONFIG_PINCTRL_PFC_R8A7779
534 {
535 .compatible = "renesas,pfc-r8a7779",
536 .data = &r8a7779_pinmux_info,
537 },
538#endif
539#ifdef CONFIG_PINCTRL_PFC_R8A7790
540 {
541 .compatible = "renesas,pfc-r8a7790",
542 .data = &r8a7790_pinmux_info,
543 },
544#endif
545#ifdef CONFIG_PINCTRL_PFC_R8A7791
546 {
547 .compatible = "renesas,pfc-r8a7791",
548 .data = &r8a7791_pinmux_info,
549 },
550#endif
551#ifdef CONFIG_PINCTRL_PFC_R8A7792
552 {
553 .compatible = "renesas,pfc-r8a7792",
554 .data = &r8a7792_pinmux_info,
555 },
556#endif
557#ifdef CONFIG_PINCTRL_PFC_R8A7793
558 {
559 .compatible = "renesas,pfc-r8a7793",
560 .data = &r8a7793_pinmux_info,
561 },
562#endif
563#ifdef CONFIG_PINCTRL_PFC_R8A7794
564 {
565 .compatible = "renesas,pfc-r8a7794",
566 .data = &r8a7794_pinmux_info,
567 },
568#endif
569#ifdef CONFIG_PINCTRL_PFC_R8A7795
570 {
571 .compatible = "renesas,pfc-r8a7795",
572 .data = &r8a7795_pinmux_info,
573 },
574#endif
575#ifdef CONFIG_PINCTRL_PFC_R8A7796
576 {
577 .compatible = "renesas,pfc-r8a7796",
578 .data = &r8a7796_pinmux_info,
579 },
580#endif
581#ifdef CONFIG_PINCTRL_PFC_R8A77965
582 {
583 .compatible = "renesas,pfc-r8a77965",
584 .data = &r8a77965_pinmux_info,
585 },
586#endif
587#ifdef CONFIG_PINCTRL_PFC_R8A77970
588 {
589 .compatible = "renesas,pfc-r8a77970",
590 .data = &r8a77970_pinmux_info,
591 },
592#endif
593#ifdef CONFIG_PINCTRL_PFC_R8A77980
594 {
595 .compatible = "renesas,pfc-r8a77980",
596 .data = &r8a77980_pinmux_info,
597 },
598#endif
599#ifdef CONFIG_PINCTRL_PFC_R8A77990
600 {
601 .compatible = "renesas,pfc-r8a77990",
602 .data = &r8a77990_pinmux_info,
603 },
604#endif
605#ifdef CONFIG_PINCTRL_PFC_R8A77995
606 {
607 .compatible = "renesas,pfc-r8a77995",
608 .data = &r8a77995_pinmux_info,
609 },
610#endif
611#ifdef CONFIG_PINCTRL_PFC_SH73A0
612 {
613 .compatible = "renesas,pfc-sh73a0",
614 .data = &sh73a0_pinmux_info,
615 },
616#endif
617 { },
618};
619#endif
620
621#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_ARM_PSCI_FW)
622static void sh_pfc_nop_reg(struct sh_pfc *pfc, u32 reg, unsigned int idx)
623{
624}
625
626static void sh_pfc_save_reg(struct sh_pfc *pfc, u32 reg, unsigned int idx)
627{
628 pfc->saved_regs[idx] = sh_pfc_read(pfc, reg);
629}
630
631static void sh_pfc_restore_reg(struct sh_pfc *pfc, u32 reg, unsigned int idx)
632{
633 sh_pfc_write(pfc, reg, pfc->saved_regs[idx]);
634}
635
636static unsigned int sh_pfc_walk_regs(struct sh_pfc *pfc,
637 void (*do_reg)(struct sh_pfc *pfc, u32 reg, unsigned int idx))
638{
639 unsigned int i, n = 0;
640
641 if (pfc->info->cfg_regs)
642 for (i = 0; pfc->info->cfg_regs[i].reg; i++)
643 do_reg(pfc, pfc->info->cfg_regs[i].reg, n++);
644
645 if (pfc->info->drive_regs)
646 for (i = 0; pfc->info->drive_regs[i].reg; i++)
647 do_reg(pfc, pfc->info->drive_regs[i].reg, n++);
648
649 if (pfc->info->bias_regs)
650 for (i = 0; pfc->info->bias_regs[i].puen; i++) {
651 do_reg(pfc, pfc->info->bias_regs[i].puen, n++);
652 if (pfc->info->bias_regs[i].pud)
653 do_reg(pfc, pfc->info->bias_regs[i].pud, n++);
654 }
655
656 if (pfc->info->ioctrl_regs)
657 for (i = 0; pfc->info->ioctrl_regs[i].reg; i++)
658 do_reg(pfc, pfc->info->ioctrl_regs[i].reg, n++);
659
660 return n;
661}
662
663static int sh_pfc_suspend_init(struct sh_pfc *pfc)
664{
665 unsigned int n;
666
667
668 if (!psci_ops.cpu_suspend)
669 return 0;
670
671 n = sh_pfc_walk_regs(pfc, sh_pfc_nop_reg);
672 if (!n)
673 return 0;
674
675 pfc->saved_regs = devm_kmalloc_array(pfc->dev, n,
676 sizeof(*pfc->saved_regs),
677 GFP_KERNEL);
678 if (!pfc->saved_regs)
679 return -ENOMEM;
680
681 dev_dbg(pfc->dev, "Allocated space to save %u regs\n", n);
682 return 0;
683}
684
685static int sh_pfc_suspend_noirq(struct device *dev)
686{
687 struct sh_pfc *pfc = dev_get_drvdata(dev);
688
689 if (pfc->saved_regs)
690 sh_pfc_walk_regs(pfc, sh_pfc_save_reg);
691 return 0;
692}
693
694static int sh_pfc_resume_noirq(struct device *dev)
695{
696 struct sh_pfc *pfc = dev_get_drvdata(dev);
697
698 if (pfc->saved_regs)
699 sh_pfc_walk_regs(pfc, sh_pfc_restore_reg);
700 return 0;
701}
702
703static const struct dev_pm_ops sh_pfc_pm = {
704 SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(sh_pfc_suspend_noirq, sh_pfc_resume_noirq)
705};
706#define DEV_PM_OPS &sh_pfc_pm
707#else
708static int sh_pfc_suspend_init(struct sh_pfc *pfc) { return 0; }
709#define DEV_PM_OPS NULL
710#endif
711
712static int sh_pfc_probe(struct platform_device *pdev)
713{
714#ifdef CONFIG_OF
715 struct device_node *np = pdev->dev.of_node;
716#endif
717 const struct sh_pfc_soc_info *info;
718 struct sh_pfc *pfc;
719 int ret;
720
721#ifdef CONFIG_OF
722 if (np)
723 info = of_device_get_match_data(&pdev->dev);
724 else
725#endif
726 info = (const void *)platform_get_device_id(pdev)->driver_data;
727
728 pfc = devm_kzalloc(&pdev->dev, sizeof(*pfc), GFP_KERNEL);
729 if (pfc == NULL)
730 return -ENOMEM;
731
732 pfc->info = info;
733 pfc->dev = &pdev->dev;
734
735 ret = sh_pfc_map_resources(pfc, pdev);
736 if (unlikely(ret < 0))
737 return ret;
738
739 spin_lock_init(&pfc->lock);
740
741 if (info->ops && info->ops->init) {
742 ret = info->ops->init(pfc);
743 if (ret < 0)
744 return ret;
745
746
747 info = pfc->info;
748 }
749
750 ret = sh_pfc_suspend_init(pfc);
751 if (ret)
752 return ret;
753
754
755 if (!of_have_populated_dt())
756 pinctrl_provide_dummies();
757
758 ret = sh_pfc_init_ranges(pfc);
759 if (ret < 0)
760 return ret;
761
762
763
764
765 ret = sh_pfc_register_pinctrl(pfc);
766 if (unlikely(ret != 0))
767 return ret;
768
769#ifdef CONFIG_PINCTRL_SH_PFC_GPIO
770
771
772
773 ret = sh_pfc_register_gpiochip(pfc);
774 if (unlikely(ret != 0)) {
775
776
777
778
779
780 dev_notice(pfc->dev, "failed to init GPIO chip, ignoring...\n");
781 }
782#endif
783
784 platform_set_drvdata(pdev, pfc);
785
786 dev_info(pfc->dev, "%s support registered\n", info->name);
787
788 return 0;
789}
790
791static const struct platform_device_id sh_pfc_id_table[] = {
792#ifdef CONFIG_PINCTRL_PFC_SH7203
793 { "pfc-sh7203", (kernel_ulong_t)&sh7203_pinmux_info },
794#endif
795#ifdef CONFIG_PINCTRL_PFC_SH7264
796 { "pfc-sh7264", (kernel_ulong_t)&sh7264_pinmux_info },
797#endif
798#ifdef CONFIG_PINCTRL_PFC_SH7269
799 { "pfc-sh7269", (kernel_ulong_t)&sh7269_pinmux_info },
800#endif
801#ifdef CONFIG_PINCTRL_PFC_SH7720
802 { "pfc-sh7720", (kernel_ulong_t)&sh7720_pinmux_info },
803#endif
804#ifdef CONFIG_PINCTRL_PFC_SH7722
805 { "pfc-sh7722", (kernel_ulong_t)&sh7722_pinmux_info },
806#endif
807#ifdef CONFIG_PINCTRL_PFC_SH7723
808 { "pfc-sh7723", (kernel_ulong_t)&sh7723_pinmux_info },
809#endif
810#ifdef CONFIG_PINCTRL_PFC_SH7724
811 { "pfc-sh7724", (kernel_ulong_t)&sh7724_pinmux_info },
812#endif
813#ifdef CONFIG_PINCTRL_PFC_SH7734
814 { "pfc-sh7734", (kernel_ulong_t)&sh7734_pinmux_info },
815#endif
816#ifdef CONFIG_PINCTRL_PFC_SH7757
817 { "pfc-sh7757", (kernel_ulong_t)&sh7757_pinmux_info },
818#endif
819#ifdef CONFIG_PINCTRL_PFC_SH7785
820 { "pfc-sh7785", (kernel_ulong_t)&sh7785_pinmux_info },
821#endif
822#ifdef CONFIG_PINCTRL_PFC_SH7786
823 { "pfc-sh7786", (kernel_ulong_t)&sh7786_pinmux_info },
824#endif
825#ifdef CONFIG_PINCTRL_PFC_SHX3
826 { "pfc-shx3", (kernel_ulong_t)&shx3_pinmux_info },
827#endif
828 { },
829};
830
831static struct platform_driver sh_pfc_driver = {
832 .probe = sh_pfc_probe,
833 .id_table = sh_pfc_id_table,
834 .driver = {
835 .name = DRV_NAME,
836 .of_match_table = of_match_ptr(sh_pfc_of_table),
837 .pm = DEV_PM_OPS,
838 },
839};
840
841static int __init sh_pfc_init(void)
842{
843 return platform_driver_register(&sh_pfc_driver);
844}
845postcore_initcall(sh_pfc_init);
846