Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: sh-pfc: r8a7794: Implement voltage switching for SDHI

All the SHDIs can operate with either 3.3V or 1.8V signals, depending
on negotiation with the card.

Based on work by Wolfram Sang for the r8a7790.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

authored by

Simon Horman and committed by
Geert Uytterhoeven
77fd4136 0e1396f1

+27 -1
+27 -1
drivers/pinctrl/sh-pfc/pfc-r8a7794.c
··· 22 22 PORT_GP_32(3, fn, sfx), \ 23 23 PORT_GP_32(4, fn, sfx), \ 24 24 PORT_GP_28(5, fn, sfx), \ 25 - PORT_GP_26(6, fn, sfx) 25 + PORT_GP_CFG_24(6, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE), \ 26 + PORT_GP_1(6, 24, fn, sfx), \ 27 + PORT_GP_1(6, 25, fn, sfx) 26 28 27 29 enum { 28 30 PINMUX_RESERVED = 0, ··· 5162 5160 { }, 5163 5161 }; 5164 5162 5163 + static int r8a7794_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin, u32 *pocctrl) 5164 + { 5165 + *pocctrl = 0xe606006c; 5166 + 5167 + switch (pin & 0x1f) { 5168 + case 6: return 23; 5169 + case 7: return 16; 5170 + case 14: return 15; 5171 + case 15: return 8; 5172 + case 0 ... 5: 5173 + case 8 ... 13: 5174 + return 22 - (pin & 0x1f); 5175 + case 16 ... 23: 5176 + return 47 - (pin & 0x1f); 5177 + } 5178 + 5179 + return -EINVAL; 5180 + } 5181 + 5182 + static const struct sh_pfc_soc_operations r8a7794_pinmux_ops = { 5183 + .pin_to_pocctrl = r8a7794_pin_to_pocctrl, 5184 + }; 5185 + 5165 5186 const struct sh_pfc_soc_info r8a7794_pinmux_info = { 5166 5187 .name = "r8a77940_pfc", 5188 + .ops = &r8a7794_pinmux_ops, 5167 5189 .unlock_reg = 0xe6060000, /* PMMR */ 5168 5190 5169 5191 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },