aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/nomadik/pinctrl-nomadik-stn8815.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pinctrl/nomadik/pinctrl-nomadik-stn8815.c')
-rw-r--r--drivers/pinctrl/nomadik/pinctrl-nomadik-stn8815.c30
1 files changed, 9 insertions, 21 deletions
diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik-stn8815.c b/drivers/pinctrl/nomadik/pinctrl-nomadik-stn8815.c
index 2cd71470f270..587b222f12f3 100644
--- a/drivers/pinctrl/nomadik/pinctrl-nomadik-stn8815.c
+++ b/drivers/pinctrl/nomadik/pinctrl-nomadik-stn8815.c
@@ -264,20 +264,6 @@ static const struct pinctrl_pin_desc nmk_stn8815_pins[] = {
264 PINCTRL_PIN(STN8815_PIN_J22, "GPIO123_J22"), 264 PINCTRL_PIN(STN8815_PIN_J22, "GPIO123_J22"),
265}; 265};
266 266
267#define STN8815_GPIO_RANGE(a, b, c) { .name = "STN8815", .id = a, .base = b, \
268 .pin_base = b, .npins = c }
269
270/*
271 * This matches the 32-pin gpio chips registered by the GPIO portion. This
272 * cannot be const since we assign the struct gpio_chip * pointer at runtime.
273 */
274static struct pinctrl_gpio_range nmk_stn8815_ranges[] = {
275 STN8815_GPIO_RANGE(0, 0, 32),
276 STN8815_GPIO_RANGE(1, 32, 32),
277 STN8815_GPIO_RANGE(2, 64, 32),
278 STN8815_GPIO_RANGE(3, 96, 28),
279};
280
281/* 267/*
282 * Read the pin group names like this: 268 * Read the pin group names like this:
283 * u0_a_1 = first groups of pins for uart0 on alt function a 269 * u0_a_1 = first groups of pins for uart0 on alt function a
@@ -285,9 +271,11 @@ static struct pinctrl_gpio_range nmk_stn8815_ranges[] = {
285 */ 271 */
286 272
287/* Altfunction A */ 273/* Altfunction A */
288static const unsigned u0_a_1_pins[] = { STN8815_PIN_B4, STN8815_PIN_D5, 274static const unsigned u0txrx_a_1_pins[] = { STN8815_PIN_B4, STN8815_PIN_D5 };
289 STN8815_PIN_C5, STN8815_PIN_A4, STN8815_PIN_B5, STN8815_PIN_D6, 275static const unsigned u0ctsrts_a_1_pins[] = { STN8815_PIN_C5, STN8815_PIN_B6 };
290 STN8815_PIN_C6, STN8815_PIN_B6 }; 276/* Modem pins: DCD, DSR, RI, DTR */
277static const unsigned u0modem_a_1_pins[] = { STN8815_PIN_A4, STN8815_PIN_B5,
278 STN8815_PIN_D6, STN8815_PIN_C6 };
291static const unsigned mmcsd_a_1_pins[] = { STN8815_PIN_B10, STN8815_PIN_A10, 279static const unsigned mmcsd_a_1_pins[] = { STN8815_PIN_B10, STN8815_PIN_A10,
292 STN8815_PIN_C11, STN8815_PIN_B11, STN8815_PIN_A11, STN8815_PIN_C12, 280 STN8815_PIN_C11, STN8815_PIN_B11, STN8815_PIN_A11, STN8815_PIN_C12,
293 STN8815_PIN_B12, STN8815_PIN_A12, STN8815_PIN_C13, STN8815_PIN_C15 }; 281 STN8815_PIN_B12, STN8815_PIN_A12, STN8815_PIN_C13, STN8815_PIN_C15 };
@@ -304,7 +292,9 @@ static const unsigned i2cusb_b_1_pins[] = { STN8815_PIN_C21, STN8815_PIN_C20 };
304 .npins = ARRAY_SIZE(a##_pins), .altsetting = b } 292 .npins = ARRAY_SIZE(a##_pins), .altsetting = b }
305 293
306static const struct nmk_pingroup nmk_stn8815_groups[] = { 294static const struct nmk_pingroup nmk_stn8815_groups[] = {
307 STN8815_PIN_GROUP(u0_a_1, NMK_GPIO_ALT_A), 295 STN8815_PIN_GROUP(u0txrx_a_1, NMK_GPIO_ALT_A),
296 STN8815_PIN_GROUP(u0ctsrts_a_1, NMK_GPIO_ALT_A),
297 STN8815_PIN_GROUP(u0modem_a_1, NMK_GPIO_ALT_A),
308 STN8815_PIN_GROUP(mmcsd_a_1, NMK_GPIO_ALT_A), 298 STN8815_PIN_GROUP(mmcsd_a_1, NMK_GPIO_ALT_A),
309 STN8815_PIN_GROUP(mmcsd_b_1, NMK_GPIO_ALT_B), 299 STN8815_PIN_GROUP(mmcsd_b_1, NMK_GPIO_ALT_B),
310 STN8815_PIN_GROUP(u1_a_1, NMK_GPIO_ALT_A), 300 STN8815_PIN_GROUP(u1_a_1, NMK_GPIO_ALT_A),
@@ -318,7 +308,7 @@ static const struct nmk_pingroup nmk_stn8815_groups[] = {
318#define STN8815_FUNC_GROUPS(a, b...) \ 308#define STN8815_FUNC_GROUPS(a, b...) \
319static const char * const a##_groups[] = { b }; 309static const char * const a##_groups[] = { b };
320 310
321STN8815_FUNC_GROUPS(u0, "u0_a_1"); 311STN8815_FUNC_GROUPS(u0, "u0txrx_a_1", "u0ctsrts_a_1", "u0modem_a_1");
322STN8815_FUNC_GROUPS(mmcsd, "mmcsd_a_1", "mmcsd_b_1"); 312STN8815_FUNC_GROUPS(mmcsd, "mmcsd_a_1", "mmcsd_b_1");
323STN8815_FUNC_GROUPS(u1, "u1_a_1", "u1_b_1"); 313STN8815_FUNC_GROUPS(u1, "u1_a_1", "u1_b_1");
324STN8815_FUNC_GROUPS(i2c1, "i2c1_a_1"); 314STN8815_FUNC_GROUPS(i2c1, "i2c1_a_1");
@@ -342,8 +332,6 @@ static const struct nmk_function nmk_stn8815_functions[] = {
342}; 332};
343 333
344static const struct nmk_pinctrl_soc_data nmk_stn8815_soc = { 334static const struct nmk_pinctrl_soc_data nmk_stn8815_soc = {
345 .gpio_ranges = nmk_stn8815_ranges,
346 .gpio_num_ranges = ARRAY_SIZE(nmk_stn8815_ranges),
347 .pins = nmk_stn8815_pins, 335 .pins = nmk_stn8815_pins,
348 .npins = ARRAY_SIZE(nmk_stn8815_pins), 336 .npins = ARRAY_SIZE(nmk_stn8815_pins),
349 .functions = nmk_stn8815_functions, 337 .functions = nmk_stn8815_functions,