Skip to content

Commit 0f7711a

Browse files
KojiMatsuokageertu
authored andcommitted
pinctrl: sh-pfc: r8a7794: Add VIN pin groups
Add VIN0/1 pin groups to R8A7794 PFC driver. Sergei: rebased, renamed, added changelog, gathered 12 VIN1 data pins into a single pin group, added "vin1_data10" pin group, used 'union vin_data' and VIN_DATA_PIN_GROUP() macro to describe VIN1 pins, reversed the order of the VIN1 pin groups, removed unneeded empty lines, fixed VIN1 separator comment. Signed-off-by: Koji Matsuoka <[email protected]> Signed-off-by: Sergei Shtylyov <[email protected]> Signed-off-by: Geert Uytterhoeven <[email protected]>
1 parent 423caa5 commit 0f7711a

File tree

1 file changed

+184
-0
lines changed

1 file changed

+184
-0
lines changed

drivers/pinctrl/sh-pfc/pfc-r8a7794.c

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2774,6 +2774,146 @@ static const unsigned int usb1_mux[] = {
27742774
USB1_PWEN_MARK,
27752775
USB1_OVC_MARK,
27762776
};
2777+
/* - VIN0 ------------------------------------------------------------------- */
2778+
static const union vin_data vin0_data_pins = {
2779+
.data24 = {
2780+
/* B */
2781+
RCAR_GP_PIN(3, 1), RCAR_GP_PIN(3, 2),
2782+
RCAR_GP_PIN(3, 3), RCAR_GP_PIN(3, 4),
2783+
RCAR_GP_PIN(3, 5), RCAR_GP_PIN(3, 6),
2784+
RCAR_GP_PIN(3, 7), RCAR_GP_PIN(3, 8),
2785+
/* G */
2786+
RCAR_GP_PIN(3, 13), RCAR_GP_PIN(3, 14),
2787+
RCAR_GP_PIN(3, 15), RCAR_GP_PIN(3, 16),
2788+
RCAR_GP_PIN(3, 17), RCAR_GP_PIN(3, 18),
2789+
RCAR_GP_PIN(3, 19), RCAR_GP_PIN(3, 20),
2790+
/* R */
2791+
RCAR_GP_PIN(3, 21), RCAR_GP_PIN(3, 22),
2792+
RCAR_GP_PIN(3, 23), RCAR_GP_PIN(3, 24),
2793+
RCAR_GP_PIN(3, 25), RCAR_GP_PIN(3, 26),
2794+
RCAR_GP_PIN(3, 27), RCAR_GP_PIN(3, 28),
2795+
},
2796+
};
2797+
static const union vin_data vin0_data_mux = {
2798+
.data24 = {
2799+
/* B */
2800+
VI0_DATA0_VI0_B0_MARK, VI0_DATA1_VI0_B1_MARK,
2801+
VI0_DATA2_VI0_B2_MARK, VI0_DATA3_VI0_B3_MARK,
2802+
VI0_DATA4_VI0_B4_MARK, VI0_DATA5_VI0_B5_MARK,
2803+
VI0_DATA6_VI0_B6_MARK, VI0_DATA7_VI0_B7_MARK,
2804+
/* G */
2805+
VI0_G0_MARK, VI0_G1_MARK,
2806+
VI0_G2_MARK, VI0_G3_MARK,
2807+
VI0_G4_MARK, VI0_G5_MARK,
2808+
VI0_G6_MARK, VI0_G7_MARK,
2809+
/* R */
2810+
VI0_R0_MARK, VI0_R1_MARK,
2811+
VI0_R2_MARK, VI0_R3_MARK,
2812+
VI0_R4_MARK, VI0_R5_MARK,
2813+
VI0_R6_MARK, VI0_R7_MARK,
2814+
},
2815+
};
2816+
static const unsigned int vin0_data18_pins[] = {
2817+
/* B */
2818+
RCAR_GP_PIN(3, 3), RCAR_GP_PIN(3, 4),
2819+
RCAR_GP_PIN(3, 5), RCAR_GP_PIN(3, 6),
2820+
RCAR_GP_PIN(3, 7), RCAR_GP_PIN(3, 8),
2821+
/* G */
2822+
RCAR_GP_PIN(3, 15), RCAR_GP_PIN(3, 16),
2823+
RCAR_GP_PIN(3, 17), RCAR_GP_PIN(3, 18),
2824+
RCAR_GP_PIN(3, 19), RCAR_GP_PIN(3, 20),
2825+
/* R */
2826+
RCAR_GP_PIN(3, 23), RCAR_GP_PIN(3, 24),
2827+
RCAR_GP_PIN(3, 25), RCAR_GP_PIN(3, 26),
2828+
RCAR_GP_PIN(3, 27), RCAR_GP_PIN(3, 28),
2829+
};
2830+
static const unsigned int vin0_data18_mux[] = {
2831+
/* B */
2832+
VI0_DATA2_VI0_B2_MARK, VI0_DATA3_VI0_B3_MARK,
2833+
VI0_DATA4_VI0_B4_MARK, VI0_DATA5_VI0_B5_MARK,
2834+
VI0_DATA6_VI0_B6_MARK, VI0_DATA7_VI0_B7_MARK,
2835+
/* G */
2836+
VI0_G2_MARK, VI0_G3_MARK,
2837+
VI0_G4_MARK, VI0_G5_MARK,
2838+
VI0_G6_MARK, VI0_G7_MARK,
2839+
/* R */
2840+
VI0_R2_MARK, VI0_R3_MARK,
2841+
VI0_R4_MARK, VI0_R5_MARK,
2842+
VI0_R6_MARK, VI0_R7_MARK,
2843+
};
2844+
static const unsigned int vin0_sync_pins[] = {
2845+
RCAR_GP_PIN(3, 11), /* HSYNC */
2846+
RCAR_GP_PIN(3, 12), /* VSYNC */
2847+
};
2848+
static const unsigned int vin0_sync_mux[] = {
2849+
VI0_HSYNC_N_MARK,
2850+
VI0_VSYNC_N_MARK,
2851+
};
2852+
static const unsigned int vin0_field_pins[] = {
2853+
RCAR_GP_PIN(3, 10),
2854+
};
2855+
static const unsigned int vin0_field_mux[] = {
2856+
VI0_FIELD_MARK,
2857+
};
2858+
static const unsigned int vin0_clkenb_pins[] = {
2859+
RCAR_GP_PIN(3, 9),
2860+
};
2861+
static const unsigned int vin0_clkenb_mux[] = {
2862+
VI0_CLKENB_MARK,
2863+
};
2864+
static const unsigned int vin0_clk_pins[] = {
2865+
RCAR_GP_PIN(3, 0),
2866+
};
2867+
static const unsigned int vin0_clk_mux[] = {
2868+
VI0_CLK_MARK,
2869+
};
2870+
/* - VIN1 ------------------------------------------------------------------- */
2871+
static const union vin_data vin1_data_pins = {
2872+
.data12 = {
2873+
RCAR_GP_PIN(5, 12), RCAR_GP_PIN(5, 13),
2874+
RCAR_GP_PIN(5, 14), RCAR_GP_PIN(5, 15),
2875+
RCAR_GP_PIN(5, 16), RCAR_GP_PIN(5, 17),
2876+
RCAR_GP_PIN(5, 18), RCAR_GP_PIN(5, 19),
2877+
RCAR_GP_PIN(1, 10), RCAR_GP_PIN(1, 11),
2878+
RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 13),
2879+
},
2880+
};
2881+
static const union vin_data vin1_data_mux = {
2882+
.data12 = {
2883+
VI1_DATA0_MARK, VI1_DATA1_MARK,
2884+
VI1_DATA2_MARK, VI1_DATA3_MARK,
2885+
VI1_DATA4_MARK, VI1_DATA5_MARK,
2886+
VI1_DATA6_MARK, VI1_DATA7_MARK,
2887+
VI1_DATA8_MARK, VI1_DATA9_MARK,
2888+
VI1_DATA10_MARK, VI1_DATA11_MARK,
2889+
},
2890+
};
2891+
static const unsigned int vin1_sync_pins[] = {
2892+
RCAR_GP_PIN(5, 22), /* HSYNC */
2893+
RCAR_GP_PIN(5, 23), /* VSYNC */
2894+
};
2895+
static const unsigned int vin1_sync_mux[] = {
2896+
VI1_HSYNC_N_MARK,
2897+
VI1_VSYNC_N_MARK,
2898+
};
2899+
static const unsigned int vin1_field_pins[] = {
2900+
RCAR_GP_PIN(5, 21),
2901+
};
2902+
static const unsigned int vin1_field_mux[] = {
2903+
VI1_FIELD_MARK,
2904+
};
2905+
static const unsigned int vin1_clkenb_pins[] = {
2906+
RCAR_GP_PIN(5, 20),
2907+
};
2908+
static const unsigned int vin1_clkenb_mux[] = {
2909+
VI1_CLKENB_MARK,
2910+
};
2911+
static const unsigned int vin1_clk_pins[] = {
2912+
RCAR_GP_PIN(5, 11),
2913+
};
2914+
static const unsigned int vin1_clk_mux[] = {
2915+
VI1_CLK_MARK,
2916+
};
27772917

27782918
static const struct sh_pfc_pin_group pinmux_groups[] = {
27792919
SH_PFC_PIN_GROUP(eth_link),
@@ -2949,6 +3089,24 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
29493089
SH_PFC_PIN_GROUP(sdhi2_wp),
29503090
SH_PFC_PIN_GROUP(usb0),
29513091
SH_PFC_PIN_GROUP(usb1),
3092+
VIN_DATA_PIN_GROUP(vin0_data, 24),
3093+
VIN_DATA_PIN_GROUP(vin0_data, 20),
3094+
SH_PFC_PIN_GROUP(vin0_data18),
3095+
VIN_DATA_PIN_GROUP(vin0_data, 16),
3096+
VIN_DATA_PIN_GROUP(vin0_data, 12),
3097+
VIN_DATA_PIN_GROUP(vin0_data, 10),
3098+
VIN_DATA_PIN_GROUP(vin0_data, 8),
3099+
SH_PFC_PIN_GROUP(vin0_sync),
3100+
SH_PFC_PIN_GROUP(vin0_field),
3101+
SH_PFC_PIN_GROUP(vin0_clkenb),
3102+
SH_PFC_PIN_GROUP(vin0_clk),
3103+
VIN_DATA_PIN_GROUP(vin1_data, 12),
3104+
VIN_DATA_PIN_GROUP(vin1_data, 10),
3105+
VIN_DATA_PIN_GROUP(vin1_data, 8),
3106+
SH_PFC_PIN_GROUP(vin1_sync),
3107+
SH_PFC_PIN_GROUP(vin1_field),
3108+
SH_PFC_PIN_GROUP(vin1_clkenb),
3109+
SH_PFC_PIN_GROUP(vin1_clk),
29523110
};
29533111

29543112
static const char * const eth_groups[] = {
@@ -3229,6 +3387,30 @@ static const char * const usb1_groups[] = {
32293387
"usb1",
32303388
};
32313389

3390+
static const char * const vin0_groups[] = {
3391+
"vin0_data24",
3392+
"vin0_data20",
3393+
"vin0_data18",
3394+
"vin0_data16",
3395+
"vin0_data12",
3396+
"vin0_data10",
3397+
"vin0_data8",
3398+
"vin0_sync",
3399+
"vin0_field",
3400+
"vin0_clkenb",
3401+
"vin0_clk",
3402+
};
3403+
3404+
static const char * const vin1_groups[] = {
3405+
"vin1_data12",
3406+
"vin1_data10",
3407+
"vin1_data8",
3408+
"vin1_sync",
3409+
"vin1_field",
3410+
"vin1_clkenb",
3411+
"vin1_clk",
3412+
};
3413+
32323414
static const struct sh_pfc_function pinmux_functions[] = {
32333415
SH_PFC_FUNCTION(eth),
32343416
SH_PFC_FUNCTION(hscif0),
@@ -3265,6 +3447,8 @@ static const struct sh_pfc_function pinmux_functions[] = {
32653447
SH_PFC_FUNCTION(sdhi2),
32663448
SH_PFC_FUNCTION(usb0),
32673449
SH_PFC_FUNCTION(usb1),
3450+
SH_PFC_FUNCTION(vin0),
3451+
SH_PFC_FUNCTION(vin1),
32683452
};
32693453

32703454
static const struct pinmux_cfg_reg pinmux_config_regs[] = {

0 commit comments

Comments
 (0)