Skip to content

Commit fed6d9a

Browse files
jwrdegoedeandy-shev
authored andcommitted
pinctrl: baytrail: Fix selecting gpio pinctrl state
For all the "score" pin-groups all the intel_pingroup-s to select the non GPIO function are re-used for byt_score_gpio_groups[]. But this is incorrect since a pin-group includes the mode setting, which for the non GPIO functions generally is 1, where as to select the GPIO function mode must be set to 0. So the GPIO function needs separate intel_pingroup-s with their own mode value of 0. Add a new PIN_GROUP_GPIO macro which adds a foo_gpio entry to each pin-group defined this way and update byt_score_gpio_groups[] to point to the new foo_gpio entries. The "sus" usb_oc_grp usb_ulpi_grp and pcu_spi_grp pin-groups are special because these have a non 0 mode value to select the GPIO functions and these already have matching foo_gpio pin-groups, leave these are unchanged. The pmu_clk "sus" groups added in commit 2f46d7f ("pinctrl: baytrail: Add pinconf group + function for the pmu_clk") do need to use the new PIN_GROUP_GPIO macro. Fixes: 2f46d7f ("pinctrl: baytrail: Add pinconf group + function for the pmu_clk") Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
1 parent 4cece76 commit fed6d9a

File tree

2 files changed

+42
-36
lines changed

2 files changed

+42
-36
lines changed

drivers/pinctrl/intel/pinctrl-baytrail.c

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -278,33 +278,33 @@ static const unsigned int byt_score_plt_clk5_pins[] = { 101 };
278278
static const unsigned int byt_score_smbus_pins[] = { 51, 52, 53 };
279279

280280
static const struct intel_pingroup byt_score_groups[] = {
281-
PIN_GROUP("uart1_grp", byt_score_uart1_pins, 1),
282-
PIN_GROUP("uart2_grp", byt_score_uart2_pins, 1),
283-
PIN_GROUP("pwm0_grp", byt_score_pwm0_pins, 1),
284-
PIN_GROUP("pwm1_grp", byt_score_pwm1_pins, 1),
285-
PIN_GROUP("ssp2_grp", byt_score_ssp2_pins, 1),
286-
PIN_GROUP("sio_spi_grp", byt_score_sio_spi_pins, 1),
287-
PIN_GROUP("i2c5_grp", byt_score_i2c5_pins, 1),
288-
PIN_GROUP("i2c6_grp", byt_score_i2c6_pins, 1),
289-
PIN_GROUP("i2c4_grp", byt_score_i2c4_pins, 1),
290-
PIN_GROUP("i2c3_grp", byt_score_i2c3_pins, 1),
291-
PIN_GROUP("i2c2_grp", byt_score_i2c2_pins, 1),
292-
PIN_GROUP("i2c1_grp", byt_score_i2c1_pins, 1),
293-
PIN_GROUP("i2c0_grp", byt_score_i2c0_pins, 1),
294-
PIN_GROUP("ssp0_grp", byt_score_ssp0_pins, 1),
295-
PIN_GROUP("ssp1_grp", byt_score_ssp1_pins, 1),
296-
PIN_GROUP("sdcard_grp", byt_score_sdcard_pins, byt_score_sdcard_mux_values),
297-
PIN_GROUP("sdio_grp", byt_score_sdio_pins, 1),
298-
PIN_GROUP("emmc_grp", byt_score_emmc_pins, 1),
299-
PIN_GROUP("lpc_grp", byt_score_ilb_lpc_pins, 1),
300-
PIN_GROUP("sata_grp", byt_score_sata_pins, 1),
301-
PIN_GROUP("plt_clk0_grp", byt_score_plt_clk0_pins, 1),
302-
PIN_GROUP("plt_clk1_grp", byt_score_plt_clk1_pins, 1),
303-
PIN_GROUP("plt_clk2_grp", byt_score_plt_clk2_pins, 1),
304-
PIN_GROUP("plt_clk3_grp", byt_score_plt_clk3_pins, 1),
305-
PIN_GROUP("plt_clk4_grp", byt_score_plt_clk4_pins, 1),
306-
PIN_GROUP("plt_clk5_grp", byt_score_plt_clk5_pins, 1),
307-
PIN_GROUP("smbus_grp", byt_score_smbus_pins, 1),
281+
PIN_GROUP_GPIO("uart1_grp", byt_score_uart1_pins, 1),
282+
PIN_GROUP_GPIO("uart2_grp", byt_score_uart2_pins, 1),
283+
PIN_GROUP_GPIO("pwm0_grp", byt_score_pwm0_pins, 1),
284+
PIN_GROUP_GPIO("pwm1_grp", byt_score_pwm1_pins, 1),
285+
PIN_GROUP_GPIO("ssp2_grp", byt_score_ssp2_pins, 1),
286+
PIN_GROUP_GPIO("sio_spi_grp", byt_score_sio_spi_pins, 1),
287+
PIN_GROUP_GPIO("i2c5_grp", byt_score_i2c5_pins, 1),
288+
PIN_GROUP_GPIO("i2c6_grp", byt_score_i2c6_pins, 1),
289+
PIN_GROUP_GPIO("i2c4_grp", byt_score_i2c4_pins, 1),
290+
PIN_GROUP_GPIO("i2c3_grp", byt_score_i2c3_pins, 1),
291+
PIN_GROUP_GPIO("i2c2_grp", byt_score_i2c2_pins, 1),
292+
PIN_GROUP_GPIO("i2c1_grp", byt_score_i2c1_pins, 1),
293+
PIN_GROUP_GPIO("i2c0_grp", byt_score_i2c0_pins, 1),
294+
PIN_GROUP_GPIO("ssp0_grp", byt_score_ssp0_pins, 1),
295+
PIN_GROUP_GPIO("ssp1_grp", byt_score_ssp1_pins, 1),
296+
PIN_GROUP_GPIO("sdcard_grp", byt_score_sdcard_pins, byt_score_sdcard_mux_values),
297+
PIN_GROUP_GPIO("sdio_grp", byt_score_sdio_pins, 1),
298+
PIN_GROUP_GPIO("emmc_grp", byt_score_emmc_pins, 1),
299+
PIN_GROUP_GPIO("lpc_grp", byt_score_ilb_lpc_pins, 1),
300+
PIN_GROUP_GPIO("sata_grp", byt_score_sata_pins, 1),
301+
PIN_GROUP_GPIO("plt_clk0_grp", byt_score_plt_clk0_pins, 1),
302+
PIN_GROUP_GPIO("plt_clk1_grp", byt_score_plt_clk1_pins, 1),
303+
PIN_GROUP_GPIO("plt_clk2_grp", byt_score_plt_clk2_pins, 1),
304+
PIN_GROUP_GPIO("plt_clk3_grp", byt_score_plt_clk3_pins, 1),
305+
PIN_GROUP_GPIO("plt_clk4_grp", byt_score_plt_clk4_pins, 1),
306+
PIN_GROUP_GPIO("plt_clk5_grp", byt_score_plt_clk5_pins, 1),
307+
PIN_GROUP_GPIO("smbus_grp", byt_score_smbus_pins, 1),
308308
};
309309

310310
static const char * const byt_score_uart_groups[] = {
@@ -332,12 +332,14 @@ static const char * const byt_score_plt_clk_groups[] = {
332332
};
333333
static const char * const byt_score_smbus_groups[] = { "smbus_grp" };
334334
static const char * const byt_score_gpio_groups[] = {
335-
"uart1_grp", "uart2_grp", "pwm0_grp", "pwm1_grp", "ssp0_grp",
336-
"ssp1_grp", "ssp2_grp", "sio_spi_grp", "i2c0_grp", "i2c1_grp",
337-
"i2c2_grp", "i2c3_grp", "i2c4_grp", "i2c5_grp", "i2c6_grp",
338-
"sdcard_grp", "sdio_grp", "emmc_grp", "lpc_grp", "sata_grp",
339-
"plt_clk0_grp", "plt_clk1_grp", "plt_clk2_grp", "plt_clk3_grp",
340-
"plt_clk4_grp", "plt_clk5_grp", "smbus_grp",
335+
"uart1_grp_gpio", "uart2_grp_gpio", "pwm0_grp_gpio",
336+
"pwm1_grp_gpio", "ssp0_grp_gpio", "ssp1_grp_gpio", "ssp2_grp_gpio",
337+
"sio_spi_grp_gpio", "i2c0_grp_gpio", "i2c1_grp_gpio", "i2c2_grp_gpio",
338+
"i2c3_grp_gpio", "i2c4_grp_gpio", "i2c5_grp_gpio", "i2c6_grp_gpio",
339+
"sdcard_grp_gpio", "sdio_grp_gpio", "emmc_grp_gpio", "lpc_grp_gpio",
340+
"sata_grp_gpio", "plt_clk0_grp_gpio", "plt_clk1_grp_gpio",
341+
"plt_clk2_grp_gpio", "plt_clk3_grp_gpio", "plt_clk4_grp_gpio",
342+
"plt_clk5_grp_gpio", "smbus_grp_gpio",
341343
};
342344

343345
static const struct intel_function byt_score_functions[] = {
@@ -456,8 +458,8 @@ static const struct intel_pingroup byt_sus_groups[] = {
456458
PIN_GROUP("usb_oc_grp_gpio", byt_sus_usb_over_current_pins, byt_sus_usb_over_current_gpio_mode_values),
457459
PIN_GROUP("usb_ulpi_grp_gpio", byt_sus_usb_ulpi_pins, byt_sus_usb_ulpi_gpio_mode_values),
458460
PIN_GROUP("pcu_spi_grp_gpio", byt_sus_pcu_spi_pins, byt_sus_pcu_spi_gpio_mode_values),
459-
PIN_GROUP("pmu_clk1_grp", byt_sus_pmu_clk1_pins, 1),
460-
PIN_GROUP("pmu_clk2_grp", byt_sus_pmu_clk2_pins, 1),
461+
PIN_GROUP_GPIO("pmu_clk1_grp", byt_sus_pmu_clk1_pins, 1),
462+
PIN_GROUP_GPIO("pmu_clk2_grp", byt_sus_pmu_clk2_pins, 1),
461463
};
462464

463465
static const char * const byt_sus_usb_groups[] = {
@@ -469,7 +471,7 @@ static const char * const byt_sus_pmu_clk_groups[] = {
469471
};
470472
static const char * const byt_sus_gpio_groups[] = {
471473
"usb_oc_grp_gpio", "usb_ulpi_grp_gpio", "pcu_spi_grp_gpio",
472-
"pmu_clk1_grp", "pmu_clk2_grp",
474+
"pmu_clk1_grp_gpio", "pmu_clk2_grp_gpio",
473475
};
474476

475477
static const struct intel_function byt_sus_functions[] = {

drivers/pinctrl/intel/pinctrl-intel.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ struct intel_community {
179179
.modes = __builtin_choose_expr(__builtin_constant_p((m)), NULL, (m)), \
180180
}
181181

182+
#define PIN_GROUP_GPIO(n, p, m) \
183+
PIN_GROUP(n, p, m), \
184+
PIN_GROUP(n "_gpio", p, 0)
185+
182186
#define FUNCTION(n, g) \
183187
{ \
184188
.func = PINCTRL_PINFUNCTION((n), (g), ARRAY_SIZE(g)), \

0 commit comments

Comments
 (0)