Skip to content

Commit

Permalink
pinctrl: nomadik: Convert drivers to use struct pingroup and PINCTRL_…
Browse files Browse the repository at this point in the history
…PINGROUP()

The pin control header provides struct pingroup and PINCTRL_PINGROUP() macro.
Utilize them instead of open coded variants in the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
  • Loading branch information
andy-shev authored and intel-lab-lkp committed Jun 20, 2022
1 parent 0e9e313 commit b4fae75
Show file tree
Hide file tree
Showing 4 changed files with 172 additions and 179 deletions.
295 changes: 146 additions & 149 deletions drivers/pinctrl/nomadik/pinctrl-nomadik-db8500.c
Expand Up @@ -674,163 +674,160 @@ static const unsigned hwobs_oc4_1_pins[] = { DB8500_PIN_D17, DB8500_PIN_D16,
DB8500_PIN_D21, DB8500_PIN_D20, DB8500_PIN_C20, DB8500_PIN_B21,
DB8500_PIN_C21, DB8500_PIN_A22, DB8500_PIN_B24, DB8500_PIN_C22 };

#define DB8500_PIN_GROUP(a, b) { .name = #a, .pins = a##_pins, \
.npins = ARRAY_SIZE(a##_pins), .altsetting = b }

static const struct nmk_pingroup nmk_db8500_groups[] = {
/* Altfunction A column */
DB8500_PIN_GROUP(u0_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(u1rxtx_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(u1ctsrts_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(ipi2c_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(ipi2c_a_2, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(msp0txrx_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(msp0tfstck_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(msp0rfsrck_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(mc0_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(mc0_a_2, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(mc0_dat47_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(mc0dat31dir_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(msp1txrx_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(msp1_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(lcdb_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(lcdvsi0_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(lcdvsi1_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(lcd_d0_d7_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(lcd_d8_d11_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(lcd_d12_d15_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(lcd_d12_d23_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(kp_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(kpskaskb_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(mc2_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(mc2_a_2, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(ssp1_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(ssp0_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(i2c0_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(ipgpio0_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(ipgpio1_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(modem_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(kp_a_2, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(msp2sck_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(msp2_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(mc4_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(mc1_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(mc1_a_2, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(mc1dir_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(hsir_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(hsit_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(hsit_a_2, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(clkout1_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(clkout1_a_2, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(clkout2_a_1, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(clkout2_a_2, NMK_GPIO_ALT_A),
DB8500_PIN_GROUP(usb_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(u0_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(u1rxtx_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(u1ctsrts_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(ipi2c_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(ipi2c_a_2, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(msp0txrx_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(msp0tfstck_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(msp0rfsrck_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(mc0_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(mc0_a_2, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(mc0_dat47_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(mc0dat31dir_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(msp1txrx_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(msp1_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(lcdb_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(lcdvsi0_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(lcdvsi1_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(lcd_d0_d7_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(lcd_d8_d11_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(lcd_d12_d15_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(lcd_d12_d23_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(kp_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(kpskaskb_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(mc2_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(mc2_a_2, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(ssp1_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(ssp0_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(i2c0_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(ipgpio0_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(ipgpio1_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(modem_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(kp_a_2, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(msp2sck_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(msp2_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(mc4_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(mc1_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(mc1_a_2, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(mc1dir_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(hsir_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(hsit_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(hsit_a_2, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(clkout1_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(clkout1_a_2, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(clkout2_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(clkout2_a_2, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(usb_a_1, NMK_GPIO_ALT_A),
/* Altfunction B column */
DB8500_PIN_GROUP(trig_b_1, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(i2c4_b_1, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(i2c1_b_1, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(i2c2_b_1, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(i2c2_b_2, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(msp0txrx_b_1, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(i2c1_b_2, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(u2rxtx_b_1, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(uartmodtx_b_1, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(msp0sck_b_1, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(uartmodrx_b_1, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(stmmod_b_1, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(uartmodrx_b_2, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(spi3_b_1, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(msp1txrx_b_1, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(kp_b_1, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(kp_b_2, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(sm_b_1, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(smcs0_b_1, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(smcs1_b_1, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(ipgpio7_b_1, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(ipgpio2_b_1, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(ipgpio3_b_1, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(lcdaclk_b_1, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(lcda_b_1, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(lcd_b_1, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(lcd_d16_d23_b_1, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(ddrtrig_b_1, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(pwl_b_1, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(spi1_b_1, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(mc3_b_1, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(pwl_b_2, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(pwl_b_3, NMK_GPIO_ALT_B),
DB8500_PIN_GROUP(pwl_b_4, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(trig_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(i2c4_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(i2c1_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(i2c2_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(i2c2_b_2, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(msp0txrx_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(i2c1_b_2, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(u2rxtx_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(uartmodtx_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(msp0sck_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(uartmodrx_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(stmmod_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(uartmodrx_b_2, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(spi3_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(msp1txrx_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(kp_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(kp_b_2, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(sm_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(smcs0_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(smcs1_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(ipgpio7_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(ipgpio2_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(ipgpio3_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(lcdaclk_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(lcda_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(lcd_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(lcd_d16_d23_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(ddrtrig_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(pwl_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(spi1_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(mc3_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(pwl_b_2, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(pwl_b_3, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(pwl_b_4, NMK_GPIO_ALT_B),
/* Altfunction C column */
DB8500_PIN_GROUP(ipjtag_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(ipgpio6_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(ipgpio0_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(ipgpio1_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(ipgpio3_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(ipgpio2_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(slim0_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(ms_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(iptrigout_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(u2rxtx_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(u2ctsrts_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(u0_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(ipgpio4_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(ipgpio5_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(ipgpio6_c_2, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(ipgpio7_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(smcleale_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(stmape_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(u2rxtx_c_2, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(ipgpio2_c_2, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(ipgpio3_c_2, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(ipgpio4_c_2, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(ipgpio5_c_2, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(mc5_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(mc2rstn_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(kp_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(smps0_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(smps1_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(u2rxtx_c_3, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(stmape_c_2, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(uartmodrx_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(uartmodtx_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(stmmod_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(usbsim_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(mc4rstn_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(clkout1_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(clkout2_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(i2c3_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(spi0_c_1, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(usbsim_c_2, NMK_GPIO_ALT_C),
DB8500_PIN_GROUP(i2c3_c_2, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(ipjtag_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(ipgpio6_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(ipgpio0_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(ipgpio1_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(ipgpio3_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(ipgpio2_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(slim0_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(ms_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(iptrigout_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(u2rxtx_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(u2ctsrts_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(u0_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(ipgpio4_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(ipgpio5_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(ipgpio6_c_2, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(ipgpio7_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(smcleale_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(stmape_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(u2rxtx_c_2, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(ipgpio2_c_2, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(ipgpio3_c_2, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(ipgpio4_c_2, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(ipgpio5_c_2, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(mc5_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(mc2rstn_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(kp_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(smps0_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(smps1_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(u2rxtx_c_3, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(stmape_c_2, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(uartmodrx_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(uartmodtx_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(stmmod_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(usbsim_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(mc4rstn_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(clkout1_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(clkout2_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(i2c3_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(spi0_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(usbsim_c_2, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(i2c3_c_2, NMK_GPIO_ALT_C),
/* Other alt C1 column */
DB8500_PIN_GROUP(u2rx_oc1_1, NMK_GPIO_ALT_C1),
DB8500_PIN_GROUP(stmape_oc1_1, NMK_GPIO_ALT_C1),
DB8500_PIN_GROUP(remap0_oc1_1, NMK_GPIO_ALT_C1),
DB8500_PIN_GROUP(remap1_oc1_1, NMK_GPIO_ALT_C1),
DB8500_PIN_GROUP(ptma9_oc1_1, NMK_GPIO_ALT_C1),
DB8500_PIN_GROUP(kp_oc1_1, NMK_GPIO_ALT_C1),
DB8500_PIN_GROUP(rf_oc1_1, NMK_GPIO_ALT_C1),
DB8500_PIN_GROUP(hxclk_oc1_1, NMK_GPIO_ALT_C1),
DB8500_PIN_GROUP(uartmodrx_oc1_1, NMK_GPIO_ALT_C1),
DB8500_PIN_GROUP(uartmodtx_oc1_1, NMK_GPIO_ALT_C1),
DB8500_PIN_GROUP(stmmod_oc1_1, NMK_GPIO_ALT_C1),
DB8500_PIN_GROUP(hxgpio_oc1_1, NMK_GPIO_ALT_C1),
DB8500_PIN_GROUP(rf_oc1_2, NMK_GPIO_ALT_C1),
DB8500_PIN_GROUP(spi2_oc1_1, NMK_GPIO_ALT_C1),
DB8500_PIN_GROUP(spi2_oc1_2, NMK_GPIO_ALT_C1),
NMK_PIN_GROUP(u2rx_oc1_1, NMK_GPIO_ALT_C1),
NMK_PIN_GROUP(stmape_oc1_1, NMK_GPIO_ALT_C1),
NMK_PIN_GROUP(remap0_oc1_1, NMK_GPIO_ALT_C1),
NMK_PIN_GROUP(remap1_oc1_1, NMK_GPIO_ALT_C1),
NMK_PIN_GROUP(ptma9_oc1_1, NMK_GPIO_ALT_C1),
NMK_PIN_GROUP(kp_oc1_1, NMK_GPIO_ALT_C1),
NMK_PIN_GROUP(rf_oc1_1, NMK_GPIO_ALT_C1),
NMK_PIN_GROUP(hxclk_oc1_1, NMK_GPIO_ALT_C1),
NMK_PIN_GROUP(uartmodrx_oc1_1, NMK_GPIO_ALT_C1),
NMK_PIN_GROUP(uartmodtx_oc1_1, NMK_GPIO_ALT_C1),
NMK_PIN_GROUP(stmmod_oc1_1, NMK_GPIO_ALT_C1),
NMK_PIN_GROUP(hxgpio_oc1_1, NMK_GPIO_ALT_C1),
NMK_PIN_GROUP(rf_oc1_2, NMK_GPIO_ALT_C1),
NMK_PIN_GROUP(spi2_oc1_1, NMK_GPIO_ALT_C1),
NMK_PIN_GROUP(spi2_oc1_2, NMK_GPIO_ALT_C1),
/* Other alt C2 column */
DB8500_PIN_GROUP(sbag_oc2_1, NMK_GPIO_ALT_C2),
DB8500_PIN_GROUP(etmr4_oc2_1, NMK_GPIO_ALT_C2),
DB8500_PIN_GROUP(ptma9_oc2_1, NMK_GPIO_ALT_C2),
NMK_PIN_GROUP(sbag_oc2_1, NMK_GPIO_ALT_C2),
NMK_PIN_GROUP(etmr4_oc2_1, NMK_GPIO_ALT_C2),
NMK_PIN_GROUP(ptma9_oc2_1, NMK_GPIO_ALT_C2),
/* Other alt C3 column */
DB8500_PIN_GROUP(stmmod_oc3_1, NMK_GPIO_ALT_C3),
DB8500_PIN_GROUP(stmmod_oc3_2, NMK_GPIO_ALT_C3),
DB8500_PIN_GROUP(uartmodrx_oc3_1, NMK_GPIO_ALT_C3),
DB8500_PIN_GROUP(uartmodtx_oc3_1, NMK_GPIO_ALT_C3),
DB8500_PIN_GROUP(etmr4_oc3_1, NMK_GPIO_ALT_C3),
NMK_PIN_GROUP(stmmod_oc3_1, NMK_GPIO_ALT_C3),
NMK_PIN_GROUP(stmmod_oc3_2, NMK_GPIO_ALT_C3),
NMK_PIN_GROUP(uartmodrx_oc3_1, NMK_GPIO_ALT_C3),
NMK_PIN_GROUP(uartmodtx_oc3_1, NMK_GPIO_ALT_C3),
NMK_PIN_GROUP(etmr4_oc3_1, NMK_GPIO_ALT_C3),
/* Other alt C4 column */
DB8500_PIN_GROUP(sbag_oc4_1, NMK_GPIO_ALT_C4),
DB8500_PIN_GROUP(hwobs_oc4_1, NMK_GPIO_ALT_C4),
NMK_PIN_GROUP(sbag_oc4_1, NMK_GPIO_ALT_C4),
NMK_PIN_GROUP(hwobs_oc4_1, NMK_GPIO_ALT_C4),
};

/* We use this macro to define the groups applicable to a function */
Expand Down
29 changes: 13 additions & 16 deletions drivers/pinctrl/nomadik/pinctrl-nomadik-stn8815.c
Expand Up @@ -303,23 +303,20 @@ static const unsigned usbhs_c_1_pins[] = { STN8815_PIN_E21, STN8815_PIN_E20,
STN8815_PIN_C16, STN8815_PIN_A15,
STN8815_PIN_D17, STN8815_PIN_C17 };

#define STN8815_PIN_GROUP(a, b) { .name = #a, .pins = a##_pins, \
.npins = ARRAY_SIZE(a##_pins), .altsetting = b }

static const struct nmk_pingroup nmk_stn8815_groups[] = {
STN8815_PIN_GROUP(u0txrx_a_1, NMK_GPIO_ALT_A),
STN8815_PIN_GROUP(u0ctsrts_a_1, NMK_GPIO_ALT_A),
STN8815_PIN_GROUP(u0modem_a_1, NMK_GPIO_ALT_A),
STN8815_PIN_GROUP(mmcsd_a_1, NMK_GPIO_ALT_A),
STN8815_PIN_GROUP(mmcsd_b_1, NMK_GPIO_ALT_B),
STN8815_PIN_GROUP(u1_a_1, NMK_GPIO_ALT_A),
STN8815_PIN_GROUP(i2c1_a_1, NMK_GPIO_ALT_A),
STN8815_PIN_GROUP(i2c0_a_1, NMK_GPIO_ALT_A),
STN8815_PIN_GROUP(u1_b_1, NMK_GPIO_ALT_B),
STN8815_PIN_GROUP(i2cusb_b_1, NMK_GPIO_ALT_B),
STN8815_PIN_GROUP(clcd_16_23_b_1, NMK_GPIO_ALT_B),
STN8815_PIN_GROUP(usbfs_b_1, NMK_GPIO_ALT_B),
STN8815_PIN_GROUP(usbhs_c_1, NMK_GPIO_ALT_C),
NMK_PIN_GROUP(u0txrx_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(u0ctsrts_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(u0modem_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(mmcsd_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(mmcsd_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(u1_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(i2c1_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(i2c0_a_1, NMK_GPIO_ALT_A),
NMK_PIN_GROUP(u1_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(i2cusb_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(clcd_16_23_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(usbfs_b_1, NMK_GPIO_ALT_B),
NMK_PIN_GROUP(usbhs_c_1, NMK_GPIO_ALT_C),
};

/* We use this macro to define the groups applicable to a function */
Expand Down
11 changes: 5 additions & 6 deletions drivers/pinctrl/nomadik/pinctrl-nomadik.c
Expand Up @@ -1179,17 +1179,17 @@ static const char *nmk_get_group_name(struct pinctrl_dev *pctldev,
{
struct nmk_pinctrl *npct = pinctrl_dev_get_drvdata(pctldev);

return npct->soc->groups[selector].name;
return npct->soc->groups[selector].grp.name;
}

static int nmk_get_group_pins(struct pinctrl_dev *pctldev, unsigned selector,
const unsigned **pins,
unsigned *num_pins)
unsigned *npins)
{
struct nmk_pinctrl *npct = pinctrl_dev_get_drvdata(pctldev);

*pins = npct->soc->groups[selector].pins;
*num_pins = npct->soc->groups[selector].npins;
*pins = npct->soc->groups[selector].grp.pins;
*npins = npct->soc->groups[selector].grp.npins;
return 0;
}

Expand Down Expand Up @@ -1526,8 +1526,7 @@ static int nmk_pmx_set(struct pinctrl_dev *pctldev, unsigned function,
int ret = -EINVAL;
int i;

g = &npct->soc->groups[group];

g = &npct->soc->groups[group].grp;
if (g->altsetting < 0)
return -EINVAL;

Expand Down

0 comments on commit b4fae75

Please sign in to comment.