aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pinctrl/sh-pfc/pfc-r8a7791.c')
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-r8a7791.c186
1 files changed, 167 insertions, 19 deletions
diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7791.c b/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
index fdd2c8729791..3ddf23ec9f0b 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
@@ -2928,6 +2928,79 @@ static const unsigned int msiof2_tx_e_pins[] = {
2928static const unsigned int msiof2_tx_e_mux[] = { 2928static const unsigned int msiof2_tx_e_mux[] = {
2929 MSIOF2_TXD_E_MARK, 2929 MSIOF2_TXD_E_MARK,
2930}; 2930};
2931/* - PWM -------------------------------------------------------------------- */
2932static const unsigned int pwm0_pins[] = {
2933 RCAR_GP_PIN(6, 14),
2934};
2935static const unsigned int pwm0_mux[] = {
2936 PWM0_MARK,
2937};
2938static const unsigned int pwm0_b_pins[] = {
2939 RCAR_GP_PIN(5, 30),
2940};
2941static const unsigned int pwm0_b_mux[] = {
2942 PWM0_B_MARK,
2943};
2944static const unsigned int pwm1_pins[] = {
2945 RCAR_GP_PIN(1, 17),
2946};
2947static const unsigned int pwm1_mux[] = {
2948 PWM1_MARK,
2949};
2950static const unsigned int pwm1_b_pins[] = {
2951 RCAR_GP_PIN(6, 15),
2952};
2953static const unsigned int pwm1_b_mux[] = {
2954 PWM1_B_MARK,
2955};
2956static const unsigned int pwm2_pins[] = {
2957 RCAR_GP_PIN(1, 18),
2958};
2959static const unsigned int pwm2_mux[] = {
2960 PWM2_MARK,
2961};
2962static const unsigned int pwm2_b_pins[] = {
2963 RCAR_GP_PIN(0, 16),
2964};
2965static const unsigned int pwm2_b_mux[] = {
2966 PWM2_B_MARK,
2967};
2968static const unsigned int pwm3_pins[] = {
2969 RCAR_GP_PIN(1, 24),
2970};
2971static const unsigned int pwm3_mux[] = {
2972 PWM3_MARK,
2973};
2974static const unsigned int pwm4_pins[] = {
2975 RCAR_GP_PIN(3, 26),
2976};
2977static const unsigned int pwm4_mux[] = {
2978 PWM4_MARK,
2979};
2980static const unsigned int pwm4_b_pins[] = {
2981 RCAR_GP_PIN(3, 31),
2982};
2983static const unsigned int pwm4_b_mux[] = {
2984 PWM4_B_MARK,
2985};
2986static const unsigned int pwm5_pins[] = {
2987 RCAR_GP_PIN(7, 21),
2988};
2989static const unsigned int pwm5_mux[] = {
2990 PWM5_MARK,
2991};
2992static const unsigned int pwm5_b_pins[] = {
2993 RCAR_GP_PIN(7, 20),
2994};
2995static const unsigned int pwm5_b_mux[] = {
2996 PWM5_B_MARK,
2997};
2998static const unsigned int pwm6_pins[] = {
2999 RCAR_GP_PIN(7, 22),
3000};
3001static const unsigned int pwm6_mux[] = {
3002 PWM6_MARK,
3003};
2931/* - QSPI ------------------------------------------------------------------- */ 3004/* - QSPI ------------------------------------------------------------------- */
2932static const unsigned int qspi_ctrl_pins[] = { 3005static const unsigned int qspi_ctrl_pins[] = {
2933 /* SPCLK, SSL */ 3006 /* SPCLK, SSL */
@@ -4348,6 +4421,18 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
4348 SH_PFC_PIN_GROUP(msiof2_sync_e), 4421 SH_PFC_PIN_GROUP(msiof2_sync_e),
4349 SH_PFC_PIN_GROUP(msiof2_rx_e), 4422 SH_PFC_PIN_GROUP(msiof2_rx_e),
4350 SH_PFC_PIN_GROUP(msiof2_tx_e), 4423 SH_PFC_PIN_GROUP(msiof2_tx_e),
4424 SH_PFC_PIN_GROUP(pwm0),
4425 SH_PFC_PIN_GROUP(pwm0_b),
4426 SH_PFC_PIN_GROUP(pwm1),
4427 SH_PFC_PIN_GROUP(pwm1_b),
4428 SH_PFC_PIN_GROUP(pwm2),
4429 SH_PFC_PIN_GROUP(pwm2_b),
4430 SH_PFC_PIN_GROUP(pwm3),
4431 SH_PFC_PIN_GROUP(pwm4),
4432 SH_PFC_PIN_GROUP(pwm4_b),
4433 SH_PFC_PIN_GROUP(pwm5),
4434 SH_PFC_PIN_GROUP(pwm5_b),
4435 SH_PFC_PIN_GROUP(pwm6),
4351 SH_PFC_PIN_GROUP(qspi_ctrl), 4436 SH_PFC_PIN_GROUP(qspi_ctrl),
4352 SH_PFC_PIN_GROUP(qspi_data2), 4437 SH_PFC_PIN_GROUP(qspi_data2),
4353 SH_PFC_PIN_GROUP(qspi_data4), 4438 SH_PFC_PIN_GROUP(qspi_data4),
@@ -4745,6 +4830,39 @@ static const char * const msiof2_groups[] = {
4745 "msiof2_tx_e", 4830 "msiof2_tx_e",
4746}; 4831};
4747 4832
4833static const char * const pwm0_groups[] = {
4834 "pwm0",
4835 "pwm0_b",
4836};
4837
4838static const char * const pwm1_groups[] = {
4839 "pwm1",
4840 "pwm1_b",
4841};
4842
4843static const char * const pwm2_groups[] = {
4844 "pwm2",
4845 "pwm2_b",
4846};
4847
4848static const char * const pwm3_groups[] = {
4849 "pwm3",
4850};
4851
4852static const char * const pwm4_groups[] = {
4853 "pwm4",
4854 "pwm4_b",
4855};
4856
4857static const char * const pwm5_groups[] = {
4858 "pwm5",
4859 "pwm5_b",
4860};
4861
4862static const char * const pwm6_groups[] = {
4863 "pwm6",
4864};
4865
4748static const char * const qspi_groups[] = { 4866static const char * const qspi_groups[] = {
4749 "qspi_ctrl", 4867 "qspi_ctrl",
4750 "qspi_data2", 4868 "qspi_data2",
@@ -4989,6 +5107,13 @@ static const struct sh_pfc_function pinmux_functions[] = {
4989 SH_PFC_FUNCTION(msiof0), 5107 SH_PFC_FUNCTION(msiof0),
4990 SH_PFC_FUNCTION(msiof1), 5108 SH_PFC_FUNCTION(msiof1),
4991 SH_PFC_FUNCTION(msiof2), 5109 SH_PFC_FUNCTION(msiof2),
5110 SH_PFC_FUNCTION(pwm0),
5111 SH_PFC_FUNCTION(pwm1),
5112 SH_PFC_FUNCTION(pwm2),
5113 SH_PFC_FUNCTION(pwm3),
5114 SH_PFC_FUNCTION(pwm4),
5115 SH_PFC_FUNCTION(pwm5),
5116 SH_PFC_FUNCTION(pwm6),
4992 SH_PFC_FUNCTION(qspi), 5117 SH_PFC_FUNCTION(qspi),
4993 SH_PFC_FUNCTION(scif0), 5118 SH_PFC_FUNCTION(scif0),
4994 SH_PFC_FUNCTION(scif1), 5119 SH_PFC_FUNCTION(scif1),
@@ -6000,7 +6125,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
6000 { PINMUX_CFG_REG_VAR("MOD_SEL", 0xE6060090, 32, 6125 { PINMUX_CFG_REG_VAR("MOD_SEL", 0xE6060090, 32,
6001 1, 2, 2, 2, 3, 2, 1, 1, 1, 1, 6126 1, 2, 2, 2, 3, 2, 1, 1, 1, 1,
6002 3, 2, 2, 2, 1, 2, 2, 2) { 6127 3, 2, 2, 2, 1, 2, 2, 2) {
6003 /* RESEVED [1] */ 6128 /* RESERVED [1] */
6004 0, 0, 6129 0, 0,
6005 /* SEL_SCIF1 [2] */ 6130 /* SEL_SCIF1 [2] */
6006 FN_SEL_SCIF1_0, FN_SEL_SCIF1_1, FN_SEL_SCIF1_2, FN_SEL_SCIF1_3, 6131 FN_SEL_SCIF1_0, FN_SEL_SCIF1_1, FN_SEL_SCIF1_2, FN_SEL_SCIF1_3,
@@ -6027,11 +6152,11 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
6027 FN_SEL_HSCIF1_0, FN_SEL_HSCIF1_1, FN_SEL_HSCIF1_2, 6152 FN_SEL_HSCIF1_0, FN_SEL_HSCIF1_1, FN_SEL_HSCIF1_2,
6028 FN_SEL_HSCIF1_3, FN_SEL_HSCIF1_4, 6153 FN_SEL_HSCIF1_3, FN_SEL_HSCIF1_4,
6029 0, 0, 0, 6154 0, 0, 0,
6030 /* RESEVED [2] */ 6155 /* RESERVED [2] */
6031 0, 0, 0, 0, 6156 0, 0, 0, 0,
6032 /* SEL_VI1 [2] */ 6157 /* SEL_VI1 [2] */
6033 FN_SEL_VI1_0, FN_SEL_VI1_1, FN_SEL_VI1_2, 0, 6158 FN_SEL_VI1_0, FN_SEL_VI1_1, FN_SEL_VI1_2, 0,
6034 /* RESEVED [2] */ 6159 /* RESERVED [2] */
6035 0, 0, 0, 0, 6160 0, 0, 0, 0,
6036 /* SEL_TMU [1] */ 6161 /* SEL_TMU [1] */
6037 FN_SEL_TMU1_0, FN_SEL_TMU1_1, 6162 FN_SEL_TMU1_0, FN_SEL_TMU1_1,
@@ -6049,7 +6174,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
6049 FN_SEL_SCIF0_0, FN_SEL_SCIF0_1, FN_SEL_SCIF0_2, 6174 FN_SEL_SCIF0_0, FN_SEL_SCIF0_1, FN_SEL_SCIF0_2,
6050 FN_SEL_SCIF0_3, FN_SEL_SCIF0_4, 6175 FN_SEL_SCIF0_3, FN_SEL_SCIF0_4,
6051 0, 0, 0, 6176 0, 0, 0,
6052 /* RESEVED [1] */ 6177 /* RESERVED [1] */
6053 0, 0, 6178 0, 0,
6054 /* SEL_SCIF [1] */ 6179 /* SEL_SCIF [1] */
6055 FN_SEL_SCIF_0, FN_SEL_SCIF_1, 6180 FN_SEL_SCIF_0, FN_SEL_SCIF_1,
@@ -6059,13 +6184,13 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
6059 0, 0, 6184 0, 0,
6060 /* SEL_CAN1 [2] */ 6185 /* SEL_CAN1 [2] */
6061 FN_SEL_CAN1_0, FN_SEL_CAN1_1, FN_SEL_CAN1_2, FN_SEL_CAN1_3, 6186 FN_SEL_CAN1_0, FN_SEL_CAN1_1, FN_SEL_CAN1_2, FN_SEL_CAN1_3,
6062 /* RESEVED [1] */ 6187 /* RESERVED [1] */
6063 0, 0, 6188 0, 0,
6064 /* SEL_SCIFA2 [1] */ 6189 /* SEL_SCIFA2 [1] */
6065 FN_SEL_SCIFA2_0, FN_SEL_SCIFA2_1, 6190 FN_SEL_SCIFA2_0, FN_SEL_SCIFA2_1,
6066 /* SEL_SCIF4 [2] */ 6191 /* SEL_SCIF4 [2] */
6067 FN_SEL_SCIF4_0, FN_SEL_SCIF4_1, FN_SEL_SCIF4_2, 0, 6192 FN_SEL_SCIF4_0, FN_SEL_SCIF4_1, FN_SEL_SCIF4_2, 0,
6068 /* RESEVED [2] */ 6193 /* RESERVED [2] */
6069 0, 0, 0, 0, 6194 0, 0, 0, 0,
6070 /* SEL_ADG [1] */ 6195 /* SEL_ADG [1] */
6071 FN_SEL_ADG_0, FN_SEL_ADG_1, 6196 FN_SEL_ADG_0, FN_SEL_ADG_1,
@@ -6075,7 +6200,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
6075 0, 0, 0, 6200 0, 0, 0,
6076 /* SEL_SCIFA5 [2] */ 6201 /* SEL_SCIFA5 [2] */
6077 FN_SEL_SCIFA5_0, FN_SEL_SCIFA5_1, FN_SEL_SCIFA5_2, 0, 6202 FN_SEL_SCIFA5_0, FN_SEL_SCIFA5_1, FN_SEL_SCIFA5_2, 0,
6078 /* RESEVED [1] */ 6203 /* RESERVED [1] */
6079 0, 0, 6204 0, 0,
6080 /* SEL_GPS [2] */ 6205 /* SEL_GPS [2] */
6081 FN_SEL_GPS_0, FN_SEL_GPS_1, FN_SEL_GPS_2, FN_SEL_GPS_3, 6206 FN_SEL_GPS_0, FN_SEL_GPS_1, FN_SEL_GPS_2, FN_SEL_GPS_3,
@@ -6085,7 +6210,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
6085 FN_SEL_SCIFA3_0, FN_SEL_SCIFA3_1, FN_SEL_SCIFA3_2, 0, 6210 FN_SEL_SCIFA3_0, FN_SEL_SCIFA3_1, FN_SEL_SCIFA3_2, 0,
6086 /* SEL_SIM [1] */ 6211 /* SEL_SIM [1] */
6087 FN_SEL_SIM_0, FN_SEL_SIM_1, 6212 FN_SEL_SIM_0, FN_SEL_SIM_1,
6088 /* RESEVED [1] */ 6213 /* RESERVED [1] */
6089 0, 0, 6214 0, 0,
6090 /* SEL_SSI8 [1] */ 6215 /* SEL_SSI8 [1] */
6091 FN_SEL_SSI8_0, FN_SEL_SSI8_1, } 6216 FN_SEL_SSI8_0, FN_SEL_SSI8_1, }
@@ -6115,7 +6240,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
6115 FN_SEL_MMC_0, FN_SEL_MMC_1, 6240 FN_SEL_MMC_0, FN_SEL_MMC_1,
6116 /* SEL_SCIF5 [1] */ 6241 /* SEL_SCIF5 [1] */
6117 FN_SEL_SCIF5_0, FN_SEL_SCIF5_1, 6242 FN_SEL_SCIF5_0, FN_SEL_SCIF5_1,
6118 /* RESEVED [2] */ 6243 /* RESERVED [2] */
6119 0, 0, 0, 0, 6244 0, 0, 0, 0,
6120 /* SEL_IIC2 [2] */ 6245 /* SEL_IIC2 [2] */
6121 FN_SEL_IIC2_0, FN_SEL_IIC2_1, FN_SEL_IIC2_2, FN_SEL_IIC2_3, 6246 FN_SEL_IIC2_0, FN_SEL_IIC2_1, FN_SEL_IIC2_2, FN_SEL_IIC2_3,
@@ -6125,11 +6250,11 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
6125 0, 0, 0, 6250 0, 0, 0,
6126 /* SEL_IIC0 [2] */ 6251 /* SEL_IIC0 [2] */
6127 FN_SEL_IIC0_0, FN_SEL_IIC0_1, FN_SEL_IIC0_2, 0, 6252 FN_SEL_IIC0_0, FN_SEL_IIC0_1, FN_SEL_IIC0_2, 0,
6128 /* RESEVED [2] */ 6253 /* RESERVED [2] */
6129 0, 0, 0, 0, 6254 0, 0, 0, 0,
6130 /* RESEVED [2] */ 6255 /* RESERVED [2] */
6131 0, 0, 0, 0, 6256 0, 0, 0, 0,
6132 /* RESEVED [1] */ 6257 /* RESERVED [1] */
6133 0, 0, } 6258 0, 0, }
6134 }, 6259 },
6135 { PINMUX_CFG_REG_VAR("MOD_SEL4", 0xE606009C, 32, 6260 { PINMUX_CFG_REG_VAR("MOD_SEL4", 0xE606009C, 32,
@@ -6143,7 +6268,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
6143 FN_SEL_HSCIF0_0, FN_SEL_HSCIF0_1, FN_SEL_HSCIF0_2, 0, 6268 FN_SEL_HSCIF0_0, FN_SEL_HSCIF0_1, FN_SEL_HSCIF0_2, 0,
6144 /* SEL_DIS [2] */ 6269 /* SEL_DIS [2] */
6145 FN_SEL_DIS_0, FN_SEL_DIS_1, FN_SEL_DIS_2, 0, 6270 FN_SEL_DIS_0, FN_SEL_DIS_1, FN_SEL_DIS_2, 0,
6146 /* RESEVED [1] */ 6271 /* RESERVED [1] */
6147 0, 0, 6272 0, 0,
6148 /* SEL_RAD [1] */ 6273 /* SEL_RAD [1] */
6149 FN_SEL_RAD_0, FN_SEL_RAD_1, 6274 FN_SEL_RAD_0, FN_SEL_RAD_1,
@@ -6155,15 +6280,15 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
6155 FN_SEL_SCIF2_0, FN_SEL_SCIF2_1, FN_SEL_SCIF2_2, 6280 FN_SEL_SCIF2_0, FN_SEL_SCIF2_1, FN_SEL_SCIF2_2,
6156 FN_SEL_SCIF2_3, FN_SEL_SCIF2_4, 6281 FN_SEL_SCIF2_3, FN_SEL_SCIF2_4,
6157 0, 0, 0, 6282 0, 0, 0,
6158 /* RESEVED [2] */ 6283 /* RESERVED [2] */
6159 0, 0, 0, 0, 6284 0, 0, 0, 0,
6160 /* RESEVED [2] */ 6285 /* RESERVED [2] */
6161 0, 0, 0, 0, 6286 0, 0, 0, 0,
6162 /* SEL_SOF2 [3] */ 6287 /* SEL_SOF2 [3] */
6163 FN_SEL_SOF2_0, FN_SEL_SOF2_1, FN_SEL_SOF2_2, 6288 FN_SEL_SOF2_0, FN_SEL_SOF2_1, FN_SEL_SOF2_2,
6164 FN_SEL_SOF2_3, FN_SEL_SOF2_4, 6289 FN_SEL_SOF2_3, FN_SEL_SOF2_4,
6165 0, 0, 0, 6290 0, 0, 0,
6166 /* RESEVED [1] */ 6291 /* RESERVED [1] */
6167 0, 0, 6292 0, 0,
6168 /* SEL_SSI1 [1] */ 6293 /* SEL_SSI1 [1] */
6169 FN_SEL_SSI1_0, FN_SEL_SSI1_1, 6294 FN_SEL_SSI1_0, FN_SEL_SSI1_1,
@@ -6171,16 +6296,17 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
6171 FN_SEL_SSI0_0, FN_SEL_SSI0_1, 6296 FN_SEL_SSI0_0, FN_SEL_SSI0_1,
6172 /* SEL_SSP [2] */ 6297 /* SEL_SSP [2] */
6173 FN_SEL_SSP_0, FN_SEL_SSP_1, FN_SEL_SSP_2, 0, 6298 FN_SEL_SSP_0, FN_SEL_SSP_1, FN_SEL_SSP_2, 0,
6174 /* RESEVED [2] */ 6299 /* RESERVED [2] */
6175 0, 0, 0, 0, 6300 0, 0, 0, 0,
6176 /* RESEVED [2] */ 6301 /* RESERVED [2] */
6177 0, 0, 0, 0, 6302 0, 0, 0, 0,
6178 /* RESEVED [2] */ 6303 /* RESERVED [2] */
6179 0, 0, 0, 0, } 6304 0, 0, 0, 0, }
6180 }, 6305 },
6181 { }, 6306 { },
6182}; 6307};
6183 6308
6309#ifdef CONFIG_PINCTRL_PFC_R8A7791
6184const struct sh_pfc_soc_info r8a7791_pinmux_info = { 6310const struct sh_pfc_soc_info r8a7791_pinmux_info = {
6185 .name = "r8a77910_pfc", 6311 .name = "r8a77910_pfc",
6186 .unlock_reg = 0xe6060000, /* PMMR */ 6312 .unlock_reg = 0xe6060000, /* PMMR */
@@ -6199,3 +6325,25 @@ const struct sh_pfc_soc_info r8a7791_pinmux_info = {
6199 .gpio_data = pinmux_data, 6325 .gpio_data = pinmux_data,
6200 .gpio_data_size = ARRAY_SIZE(pinmux_data), 6326 .gpio_data_size = ARRAY_SIZE(pinmux_data),
6201}; 6327};
6328#endif
6329
6330#ifdef CONFIG_PINCTRL_PFC_R8A7793
6331const struct sh_pfc_soc_info r8a7793_pinmux_info = {
6332 .name = "r8a77930_pfc",
6333 .unlock_reg = 0xe6060000, /* PMMR */
6334
6335 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
6336
6337 .pins = pinmux_pins,
6338 .nr_pins = ARRAY_SIZE(pinmux_pins),
6339 .groups = pinmux_groups,
6340 .nr_groups = ARRAY_SIZE(pinmux_groups),
6341 .functions = pinmux_functions,
6342 .nr_functions = ARRAY_SIZE(pinmux_functions),
6343
6344 .cfg_regs = pinmux_config_regs,
6345
6346 .gpio_data = pinmux_data,
6347 .gpio_data_size = ARRAY_SIZE(pinmux_data),
6348};
6349#endif