1 // SPDX-License-Identifier: GPL-2.0
3 * Pin Control driver for SuperH Pin Function Controller.
5 * Authors: Magnus Damm, Paul Mundt, Laurent Pinchart
7 * Copyright (C) 2008 Magnus Damm
8 * Copyright (C) 2009 - 2012 Paul Mundt
9 * Copyright (C) 2017 Marek Vasut
12 #define DRV_NAME "sh-pfc"
17 #include <dm/device_compat.h>
18 #include <dm/devres.h>
19 #include <dm/pinctrl.h>
21 #include <linux/sizes.h>
40 struct sh_pfc_pin_config {
44 struct sh_pfc_pinctrl {
47 struct sh_pfc_pin_config *configs;
49 const char *func_prop_name;
50 const char *groups_prop_name;
51 const char *pins_prop_name;
54 struct sh_pfc_pin_range {
59 struct sh_pfc_pinctrl_priv {
61 struct sh_pfc_pinctrl pmx;
64 int sh_pfc_get_pin_index(struct sh_pfc *pfc, unsigned int pin)
69 for (i = 0, offset = 0; i < pfc->nr_ranges; ++i) {
70 const struct sh_pfc_pin_range *range = &pfc->ranges[i];
72 if (pin <= range->end)
73 return pin >= range->start
74 ? offset + pin - range->start : -1;
76 offset += range->end - range->start + 1;
82 static int sh_pfc_enum_in_range(u16 enum_id, const struct pinmux_range *r)
84 if (enum_id < r->begin)
93 u32 sh_pfc_read_raw_reg(void __iomem *mapped_reg, unsigned int reg_width)
97 return readb(mapped_reg);
99 return readw(mapped_reg);
101 return readl(mapped_reg);
108 void sh_pfc_write_raw_reg(void __iomem *mapped_reg, unsigned int reg_width,
113 writeb(data, mapped_reg);
116 writew(data, mapped_reg);
119 writel(data, mapped_reg);
126 u32 sh_pfc_read(struct sh_pfc *pfc, u32 reg)
128 return sh_pfc_read_raw_reg((void __iomem *)(uintptr_t)reg, 32);
131 void sh_pfc_write(struct sh_pfc *pfc, u32 reg, u32 data)
133 void __iomem *unlock_reg =
134 (void __iomem *)(uintptr_t)pfc->info->unlock_reg;
136 if (pfc->info->unlock_reg)
137 sh_pfc_write_raw_reg(unlock_reg, 32, ~data);
139 sh_pfc_write_raw_reg((void __iomem *)(uintptr_t)reg, 32, data);
142 static void sh_pfc_config_reg_helper(struct sh_pfc *pfc,
143 const struct pinmux_cfg_reg *crp,
145 void __iomem **mapped_regp, u32 *maskp,
150 *mapped_regp = (void __iomem *)(uintptr_t)crp->reg;
152 if (crp->field_width) {
153 *maskp = (1 << crp->field_width) - 1;
154 *posp = crp->reg_width - ((in_pos + 1) * crp->field_width);
156 *maskp = (1 << crp->var_field_width[in_pos]) - 1;
157 *posp = crp->reg_width;
158 for (k = 0; k <= in_pos; k++)
159 *posp -= crp->var_field_width[k];
163 static void sh_pfc_write_config_reg(struct sh_pfc *pfc,
164 const struct pinmux_cfg_reg *crp,
165 unsigned int field, u32 value)
167 void __iomem *mapped_reg;
168 void __iomem *unlock_reg =
169 (void __iomem *)(uintptr_t)pfc->info->unlock_reg;
173 sh_pfc_config_reg_helper(pfc, crp, field, &mapped_reg, &mask, &pos);
175 dev_dbg(pfc->dev, "write_reg addr = %x, value = 0x%x, field = %u, "
176 "r_width = %u, f_width = %u\n",
177 crp->reg, value, field, crp->reg_width, crp->field_width);
179 mask = ~(mask << pos);
180 value = value << pos;
182 data = sh_pfc_read_raw_reg(mapped_reg, crp->reg_width);
186 if (pfc->info->unlock_reg)
187 sh_pfc_write_raw_reg(unlock_reg, 32, ~data);
189 sh_pfc_write_raw_reg(mapped_reg, crp->reg_width, data);
192 static int sh_pfc_get_config_reg(struct sh_pfc *pfc, u16 enum_id,
193 const struct pinmux_cfg_reg **crp,
194 unsigned int *fieldp, u32 *valuep)
199 const struct pinmux_cfg_reg *config_reg =
200 pfc->info->cfg_regs + k;
201 unsigned int r_width = config_reg->reg_width;
202 unsigned int f_width = config_reg->field_width;
203 unsigned int curr_width;
204 unsigned int bit_pos;
205 unsigned int pos = 0;
211 for (bit_pos = 0; bit_pos < r_width; bit_pos += curr_width) {
216 curr_width = f_width;
218 curr_width = config_reg->var_field_width[m];
220 ncomb = 1 << curr_width;
221 for (n = 0; n < ncomb; n++) {
222 if (config_reg->enum_ids[pos + n] == enum_id) {
238 static int sh_pfc_mark_to_enum(struct sh_pfc *pfc, u16 mark, int pos,
241 const u16 *data = pfc->info->pinmux_data;
245 *enum_idp = data[pos + 1];
249 for (k = 0; k < pfc->info->pinmux_data_size; k++) {
250 if (data[k] == mark) {
251 *enum_idp = data[k + 1];
256 dev_err(pfc->dev, "cannot locate data/mark enum_id for mark %d\n",
261 int sh_pfc_config_mux(struct sh_pfc *pfc, unsigned mark, int pinmux_type)
263 const struct pinmux_range *range;
266 switch (pinmux_type) {
267 case PINMUX_TYPE_GPIO:
268 case PINMUX_TYPE_FUNCTION:
272 case PINMUX_TYPE_OUTPUT:
273 range = &pfc->info->output;
276 case PINMUX_TYPE_INPUT:
277 range = &pfc->info->input;
284 /* Iterate over all the configuration fields we need to update. */
286 const struct pinmux_cfg_reg *cr;
293 pos = sh_pfc_mark_to_enum(pfc, mark, pos, &enum_id);
300 /* Check if the configuration field selects a function. If it
301 * doesn't, skip the field if it's not applicable to the
302 * requested pinmux type.
304 in_range = sh_pfc_enum_in_range(enum_id, &pfc->info->function);
306 if (pinmux_type == PINMUX_TYPE_FUNCTION) {
307 /* Functions are allowed to modify all
311 } else if (pinmux_type != PINMUX_TYPE_GPIO) {
312 /* Input/output types can only modify fields
313 * that correspond to their respective ranges.
315 in_range = sh_pfc_enum_in_range(enum_id, range);
318 * special case pass through for fixed
319 * input-only or output-only pins without
320 * function enum register association.
322 if (in_range && enum_id == range->force)
325 /* GPIOs are only allowed to modify function fields. */
331 ret = sh_pfc_get_config_reg(pfc, enum_id, &cr, &field, &value);
335 sh_pfc_write_config_reg(pfc, cr, field, value);
341 const struct pinmux_bias_reg *
342 sh_pfc_pin_to_bias_reg(const struct sh_pfc *pfc, unsigned int pin,
347 for (i = 0; pfc->info->bias_regs[i].puen; i++) {
348 for (j = 0; j < ARRAY_SIZE(pfc->info->bias_regs[i].pins); j++) {
349 if (pfc->info->bias_regs[i].pins[j] == pin) {
351 return &pfc->info->bias_regs[i];
356 WARN_ONCE(1, "Pin %u is not in bias info list\n", pin);
361 static int sh_pfc_init_ranges(struct sh_pfc *pfc)
363 struct sh_pfc_pin_range *range;
364 unsigned int nr_ranges;
367 if (pfc->info->pins[0].pin == (u16)-1) {
368 /* Pin number -1 denotes that the SoC doesn't report pin numbers
369 * in its pin arrays yet. Consider the pin numbers range as
370 * continuous and allocate a single range.
373 pfc->ranges = kzalloc(sizeof(*pfc->ranges), GFP_KERNEL);
374 if (pfc->ranges == NULL)
377 pfc->ranges->start = 0;
378 pfc->ranges->end = pfc->info->nr_pins - 1;
379 pfc->nr_gpio_pins = pfc->info->nr_pins;
384 /* Count, allocate and fill the ranges. The PFC SoC data pins array must
385 * be sorted by pin numbers, and pins without a GPIO port must come
388 for (i = 1, nr_ranges = 1; i < pfc->info->nr_pins; ++i) {
389 if (pfc->info->pins[i-1].pin != pfc->info->pins[i].pin - 1)
393 pfc->nr_ranges = nr_ranges;
394 pfc->ranges = kzalloc(sizeof(*pfc->ranges) * nr_ranges, GFP_KERNEL);
395 if (pfc->ranges == NULL)
399 range->start = pfc->info->pins[0].pin;
401 for (i = 1; i < pfc->info->nr_pins; ++i) {
402 if (pfc->info->pins[i-1].pin == pfc->info->pins[i].pin - 1)
405 range->end = pfc->info->pins[i-1].pin;
406 if (!(pfc->info->pins[i-1].configs & SH_PFC_PIN_CFG_NO_GPIO))
407 pfc->nr_gpio_pins = range->end + 1;
410 range->start = pfc->info->pins[i].pin;
413 range->end = pfc->info->pins[i-1].pin;
414 if (!(pfc->info->pins[i-1].configs & SH_PFC_PIN_CFG_NO_GPIO))
415 pfc->nr_gpio_pins = range->end + 1;
420 static int sh_pfc_pinctrl_get_pins_count(struct udevice *dev)
422 struct sh_pfc_pinctrl_priv *priv = dev_get_priv(dev);
424 return priv->pfc.info->nr_pins;
427 static const char *sh_pfc_pinctrl_get_pin_name(struct udevice *dev,
430 struct sh_pfc_pinctrl_priv *priv = dev_get_priv(dev);
432 return priv->pfc.info->pins[selector].name;
435 static int sh_pfc_pinctrl_get_groups_count(struct udevice *dev)
437 struct sh_pfc_pinctrl_priv *priv = dev_get_priv(dev);
439 return priv->pfc.info->nr_groups;
442 static const char *sh_pfc_pinctrl_get_group_name(struct udevice *dev,
445 struct sh_pfc_pinctrl_priv *priv = dev_get_priv(dev);
447 return priv->pfc.info->groups[selector].name;
450 static int sh_pfc_pinctrl_get_functions_count(struct udevice *dev)
452 struct sh_pfc_pinctrl_priv *priv = dev_get_priv(dev);
454 return priv->pfc.info->nr_functions;
457 static const char *sh_pfc_pinctrl_get_function_name(struct udevice *dev,
460 struct sh_pfc_pinctrl_priv *priv = dev_get_priv(dev);
462 return priv->pfc.info->functions[selector].name;
465 static int sh_pfc_gpio_request_enable(struct udevice *dev,
466 unsigned pin_selector)
468 struct sh_pfc_pinctrl_priv *priv = dev_get_priv(dev);
469 struct sh_pfc_pinctrl *pmx = &priv->pmx;
470 struct sh_pfc *pfc = &priv->pfc;
471 struct sh_pfc_pin_config *cfg;
472 const struct sh_pfc_pin *pin = NULL;
475 for (i = 0; i < pfc->info->nr_pins; i++) {
476 if (priv->pfc.info->pins[i].pin != pin_selector)
479 pin = &priv->pfc.info->pins[i];
486 idx = sh_pfc_get_pin_index(pfc, pin->pin);
487 cfg = &pmx->configs[idx];
489 if (cfg->type != PINMUX_TYPE_NONE)
492 ret = sh_pfc_config_mux(pfc, pin->enum_id, PINMUX_TYPE_GPIO);
496 cfg->type = PINMUX_TYPE_GPIO;
501 static int sh_pfc_gpio_disable_free(struct udevice *dev,
502 unsigned pin_selector)
504 struct sh_pfc_pinctrl_priv *priv = dev_get_priv(dev);
505 struct sh_pfc_pinctrl *pmx = &priv->pmx;
506 struct sh_pfc *pfc = &priv->pfc;
507 struct sh_pfc_pin_config *cfg;
508 const struct sh_pfc_pin *pin = NULL;
511 for (i = 0; i < pfc->info->nr_pins; i++) {
512 if (priv->pfc.info->pins[i].pin != pin_selector)
515 pin = &priv->pfc.info->pins[i];
522 idx = sh_pfc_get_pin_index(pfc, pin->pin);
523 cfg = &pmx->configs[idx];
525 cfg->type = PINMUX_TYPE_NONE;
530 static int sh_pfc_pinctrl_pin_set(struct udevice *dev, unsigned pin_selector,
531 unsigned func_selector)
533 struct sh_pfc_pinctrl_priv *priv = dev_get_priv(dev);
534 struct sh_pfc_pinctrl *pmx = &priv->pmx;
535 struct sh_pfc *pfc = &priv->pfc;
536 const struct sh_pfc_pin *pin = &priv->pfc.info->pins[pin_selector];
537 int idx = sh_pfc_get_pin_index(pfc, pin->pin);
538 struct sh_pfc_pin_config *cfg = &pmx->configs[idx];
540 if (cfg->type != PINMUX_TYPE_NONE)
543 return sh_pfc_config_mux(pfc, pin->enum_id, PINMUX_TYPE_FUNCTION);
546 static int sh_pfc_pinctrl_group_set(struct udevice *dev, unsigned group_selector,
547 unsigned func_selector)
549 struct sh_pfc_pinctrl_priv *priv = dev_get_priv(dev);
550 struct sh_pfc_pinctrl *pmx = &priv->pmx;
551 struct sh_pfc *pfc = &priv->pfc;
552 const struct sh_pfc_pin_group *grp = &priv->pfc.info->groups[group_selector];
556 for (i = 0; i < grp->nr_pins; ++i) {
557 int idx = sh_pfc_get_pin_index(pfc, grp->pins[i]);
558 struct sh_pfc_pin_config *cfg = &pmx->configs[idx];
560 if (cfg->type != PINMUX_TYPE_NONE) {
566 for (i = 0; i < grp->nr_pins; ++i) {
567 ret = sh_pfc_config_mux(pfc, grp->mux[i], PINMUX_TYPE_FUNCTION);
575 #if CONFIG_IS_ENABLED(PINCONF)
576 static const struct pinconf_param sh_pfc_pinconf_params[] = {
577 { "bias-disable", PIN_CONFIG_BIAS_DISABLE, 0 },
578 { "bias-pull-up", PIN_CONFIG_BIAS_PULL_UP, 1 },
579 { "bias-pull-down", PIN_CONFIG_BIAS_PULL_DOWN, 1 },
580 { "drive-strength", PIN_CONFIG_DRIVE_STRENGTH, 0 },
581 { "power-source", PIN_CONFIG_POWER_SOURCE, 3300 },
584 static void __iomem *
585 sh_pfc_pinconf_find_drive_strength_reg(struct sh_pfc *pfc, unsigned int pin,
586 unsigned int *offset, unsigned int *size)
588 const struct pinmux_drive_reg_field *field;
589 const struct pinmux_drive_reg *reg;
592 for (reg = pfc->info->drive_regs; reg->reg; ++reg) {
593 for (i = 0; i < ARRAY_SIZE(reg->fields); ++i) {
594 field = ®->fields[i];
596 if (field->size && field->pin == pin) {
597 *offset = field->offset;
600 return (void __iomem *)(uintptr_t)reg->reg;
608 static int sh_pfc_pinconf_set_drive_strength(struct sh_pfc *pfc,
609 unsigned int pin, u16 strength)
615 void __iomem *unlock_reg =
616 (void __iomem *)(uintptr_t)pfc->info->unlock_reg;
619 reg = sh_pfc_pinconf_find_drive_strength_reg(pfc, pin, &offset, &size);
623 step = size == 2 ? 6 : 3;
625 if (strength < step || strength > 24)
628 /* Convert the value from mA based on a full drive strength value of
629 * 24mA. We can make the full value configurable later if needed.
631 strength = strength / step - 1;
633 val = sh_pfc_read_raw_reg(reg, 32);
634 val &= ~GENMASK(offset + 4 - 1, offset);
635 val |= strength << offset;
638 sh_pfc_write_raw_reg(unlock_reg, 32, ~val);
640 sh_pfc_write_raw_reg(reg, 32, val);
645 /* Check whether the requested parameter is supported for a pin. */
646 static bool sh_pfc_pinconf_validate(struct sh_pfc *pfc, unsigned int _pin,
649 int idx = sh_pfc_get_pin_index(pfc, _pin);
650 const struct sh_pfc_pin *pin = &pfc->info->pins[idx];
653 case PIN_CONFIG_BIAS_DISABLE:
654 return pin->configs &
655 (SH_PFC_PIN_CFG_PULL_UP | SH_PFC_PIN_CFG_PULL_DOWN);
657 case PIN_CONFIG_BIAS_PULL_UP:
658 return pin->configs & SH_PFC_PIN_CFG_PULL_UP;
660 case PIN_CONFIG_BIAS_PULL_DOWN:
661 return pin->configs & SH_PFC_PIN_CFG_PULL_DOWN;
663 case PIN_CONFIG_DRIVE_STRENGTH:
664 return pin->configs & SH_PFC_PIN_CFG_DRIVE_STRENGTH;
666 case PIN_CONFIG_POWER_SOURCE:
667 return pin->configs & SH_PFC_PIN_CFG_IO_VOLTAGE;
674 static int sh_pfc_pinconf_set(struct sh_pfc_pinctrl *pmx, unsigned _pin,
675 unsigned int param, unsigned int arg)
677 struct sh_pfc *pfc = pmx->pfc;
678 void __iomem *pocctrl;
679 void __iomem *unlock_reg =
680 (void __iomem *)(uintptr_t)pfc->info->unlock_reg;
684 if (!sh_pfc_pinconf_validate(pfc, _pin, param))
688 case PIN_CONFIG_BIAS_PULL_UP:
689 case PIN_CONFIG_BIAS_PULL_DOWN:
690 case PIN_CONFIG_BIAS_DISABLE:
691 if (!pfc->info->ops || !pfc->info->ops->set_bias)
694 pfc->info->ops->set_bias(pfc, _pin, param);
698 case PIN_CONFIG_DRIVE_STRENGTH:
699 ret = sh_pfc_pinconf_set_drive_strength(pfc, _pin, arg);
705 case PIN_CONFIG_POWER_SOURCE:
706 if (!pfc->info->ops || !pfc->info->ops->pin_to_pocctrl)
709 bit = pfc->info->ops->pin_to_pocctrl(pfc, _pin, &addr);
711 printf("invalid pin %#x", _pin);
715 if (arg != 1800 && arg != 3300)
718 pocctrl = (void __iomem *)(uintptr_t)addr;
720 val = sh_pfc_read_raw_reg(pocctrl, 32);
727 sh_pfc_write_raw_reg(unlock_reg, 32, ~val);
729 sh_pfc_write_raw_reg(pocctrl, 32, val);
740 static int sh_pfc_pinconf_pin_set(struct udevice *dev,
741 unsigned int pin_selector,
742 unsigned int param, unsigned int arg)
744 struct sh_pfc_pinctrl_priv *priv = dev_get_priv(dev);
745 struct sh_pfc_pinctrl *pmx = &priv->pmx;
746 struct sh_pfc *pfc = &priv->pfc;
747 const struct sh_pfc_pin *pin = &pfc->info->pins[pin_selector];
749 sh_pfc_pinconf_set(pmx, pin->pin, param, arg);
754 static int sh_pfc_pinconf_group_set(struct udevice *dev,
755 unsigned int group_selector,
756 unsigned int param, unsigned int arg)
758 struct sh_pfc_pinctrl_priv *priv = dev_get_priv(dev);
759 struct sh_pfc_pinctrl *pmx = &priv->pmx;
760 struct sh_pfc *pfc = &priv->pfc;
761 const struct sh_pfc_pin_group *grp = &pfc->info->groups[group_selector];
764 for (i = 0; i < grp->nr_pins; i++)
765 sh_pfc_pinconf_set(pmx, grp->pins[i], param, arg);
771 static struct pinctrl_ops sh_pfc_pinctrl_ops = {
772 .get_pins_count = sh_pfc_pinctrl_get_pins_count,
773 .get_pin_name = sh_pfc_pinctrl_get_pin_name,
774 .get_groups_count = sh_pfc_pinctrl_get_groups_count,
775 .get_group_name = sh_pfc_pinctrl_get_group_name,
776 .get_functions_count = sh_pfc_pinctrl_get_functions_count,
777 .get_function_name = sh_pfc_pinctrl_get_function_name,
779 #if CONFIG_IS_ENABLED(PINCONF)
780 .pinconf_num_params = ARRAY_SIZE(sh_pfc_pinconf_params),
781 .pinconf_params = sh_pfc_pinconf_params,
782 .pinconf_set = sh_pfc_pinconf_pin_set,
783 .pinconf_group_set = sh_pfc_pinconf_group_set,
785 .pinmux_set = sh_pfc_pinctrl_pin_set,
786 .pinmux_group_set = sh_pfc_pinctrl_group_set,
787 .set_state = pinctrl_generic_set_state,
789 .gpio_request_enable = sh_pfc_gpio_request_enable,
790 .gpio_disable_free = sh_pfc_gpio_disable_free,
793 static int sh_pfc_map_pins(struct sh_pfc *pfc, struct sh_pfc_pinctrl *pmx)
797 /* Allocate and initialize the pins and configs arrays. */
798 pmx->configs = kzalloc(sizeof(*pmx->configs) * pfc->info->nr_pins,
800 if (unlikely(!pmx->configs))
803 for (i = 0; i < pfc->info->nr_pins; ++i) {
804 struct sh_pfc_pin_config *cfg = &pmx->configs[i];
805 cfg->type = PINMUX_TYPE_NONE;
812 static int sh_pfc_pinctrl_probe(struct udevice *dev)
814 struct sh_pfc_pinctrl_priv *priv = dev_get_priv(dev);
815 enum sh_pfc_model model = dev_get_driver_data(dev);
818 base = devfdt_get_addr(dev);
819 if (base == FDT_ADDR_T_NONE)
822 priv->pfc.regs = devm_ioremap(dev, base, SZ_2K);
826 #ifdef CONFIG_PINCTRL_PFC_R8A7790
827 if (model == SH_PFC_R8A7790)
828 priv->pfc.info = &r8a7790_pinmux_info;
830 #ifdef CONFIG_PINCTRL_PFC_R8A7791
831 if (model == SH_PFC_R8A7791)
832 priv->pfc.info = &r8a7791_pinmux_info;
834 #ifdef CONFIG_PINCTRL_PFC_R8A7792
835 if (model == SH_PFC_R8A7792)
836 priv->pfc.info = &r8a7792_pinmux_info;
838 #ifdef CONFIG_PINCTRL_PFC_R8A7793
839 if (model == SH_PFC_R8A7793)
840 priv->pfc.info = &r8a7793_pinmux_info;
842 #ifdef CONFIG_PINCTRL_PFC_R8A7794
843 if (model == SH_PFC_R8A7794)
844 priv->pfc.info = &r8a7794_pinmux_info;
846 #ifdef CONFIG_PINCTRL_PFC_R8A7795
847 if (model == SH_PFC_R8A7795)
848 priv->pfc.info = &r8a7795_pinmux_info;
850 #ifdef CONFIG_PINCTRL_PFC_R8A7796
851 if (model == SH_PFC_R8A7796)
852 priv->pfc.info = &r8a7796_pinmux_info;
854 #ifdef CONFIG_PINCTRL_PFC_R8A77965
855 if (model == SH_PFC_R8A77965)
856 priv->pfc.info = &r8a77965_pinmux_info;
858 #ifdef CONFIG_PINCTRL_PFC_R8A77970
859 if (model == SH_PFC_R8A77970)
860 priv->pfc.info = &r8a77970_pinmux_info;
862 #ifdef CONFIG_PINCTRL_PFC_R8A77980
863 if (model == SH_PFC_R8A77980)
864 priv->pfc.info = &r8a77980_pinmux_info;
866 #ifdef CONFIG_PINCTRL_PFC_R8A77990
867 if (model == SH_PFC_R8A77990)
868 priv->pfc.info = &r8a77990_pinmux_info;
870 #ifdef CONFIG_PINCTRL_PFC_R8A77995
871 if (model == SH_PFC_R8A77995)
872 priv->pfc.info = &r8a77995_pinmux_info;
875 priv->pmx.pfc = &priv->pfc;
876 sh_pfc_init_ranges(&priv->pfc);
877 sh_pfc_map_pins(&priv->pfc, &priv->pmx);
882 static const struct udevice_id sh_pfc_pinctrl_ids[] = {
883 #ifdef CONFIG_PINCTRL_PFC_R8A7790
885 .compatible = "renesas,pfc-r8a7790",
886 .data = SH_PFC_R8A7790,
889 #ifdef CONFIG_PINCTRL_PFC_R8A7791
891 .compatible = "renesas,pfc-r8a7791",
892 .data = SH_PFC_R8A7791,
895 #ifdef CONFIG_PINCTRL_PFC_R8A7792
897 .compatible = "renesas,pfc-r8a7792",
898 .data = SH_PFC_R8A7792,
901 #ifdef CONFIG_PINCTRL_PFC_R8A7793
903 .compatible = "renesas,pfc-r8a7793",
904 .data = SH_PFC_R8A7793,
907 #ifdef CONFIG_PINCTRL_PFC_R8A7794
909 .compatible = "renesas,pfc-r8a7794",
910 .data = SH_PFC_R8A7794,
913 #ifdef CONFIG_PINCTRL_PFC_R8A7795
915 .compatible = "renesas,pfc-r8a7795",
916 .data = SH_PFC_R8A7795,
919 #ifdef CONFIG_PINCTRL_PFC_R8A7796
921 .compatible = "renesas,pfc-r8a7796",
922 .data = SH_PFC_R8A7796,
925 #ifdef CONFIG_PINCTRL_PFC_R8A77965
927 .compatible = "renesas,pfc-r8a77965",
928 .data = SH_PFC_R8A77965,
931 #ifdef CONFIG_PINCTRL_PFC_R8A77970
933 .compatible = "renesas,pfc-r8a77970",
934 .data = SH_PFC_R8A77970,
937 #ifdef CONFIG_PINCTRL_PFC_R8A77980
939 .compatible = "renesas,pfc-r8a77980",
940 .data = SH_PFC_R8A77980,
943 #ifdef CONFIG_PINCTRL_PFC_R8A77990
945 .compatible = "renesas,pfc-r8a77990",
946 .data = SH_PFC_R8A77990,
949 #ifdef CONFIG_PINCTRL_PFC_R8A77995
951 .compatible = "renesas,pfc-r8a77995",
952 .data = SH_PFC_R8A77995,
958 U_BOOT_DRIVER(pinctrl_sh_pfc) = {
959 .name = "sh_pfc_pinctrl",
960 .id = UCLASS_PINCTRL,
961 .of_match = sh_pfc_pinctrl_ids,
962 .priv_auto_alloc_size = sizeof(struct sh_pfc_pinctrl_priv),
963 .ops = &sh_pfc_pinctrl_ops,
964 .probe = sh_pfc_pinctrl_probe,