aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Armstrong <narmstrong@baylibre.com>2016-08-23 07:25:07 -0400
committerLinus Walleij <linus.walleij@linaro.org>2016-08-24 08:22:39 -0400
commita9a5a443d86a7795ad00f74e6715bfca156bbb2d (patch)
treef5e61b3830dbd70417944428e3df71125bec1a37
parentd30351f521595227dcc6142005b759bd588b9f65 (diff)
pinctrl: meson-gxbb: add pins for PWM
Add support for PWM pins, for EE and AO domains. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/pinctrl/meson/pinctrl-meson-gxbb.c79
1 files changed, 79 insertions, 0 deletions
diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c
index 7eeb0530aa5e..9ba9172dd84a 100644
--- a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c
+++ b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c
@@ -193,6 +193,14 @@ static const unsigned int eth_txd1_pins[] = { PIN(GPIOZ_11, EE_OFF) };
193static const unsigned int eth_txd2_pins[] = { PIN(GPIOZ_12, EE_OFF) }; 193static const unsigned int eth_txd2_pins[] = { PIN(GPIOZ_12, EE_OFF) };
194static const unsigned int eth_txd3_pins[] = { PIN(GPIOZ_13, EE_OFF) }; 194static const unsigned int eth_txd3_pins[] = { PIN(GPIOZ_13, EE_OFF) };
195 195
196static const unsigned int pwm_a_x_pins[] = { PIN(GPIOX_6, EE_OFF) };
197static const unsigned int pwm_a_y_pins[] = { PIN(GPIOY_16, EE_OFF) };
198static const unsigned int pwm_b_pins[] = { PIN(GPIODV_29, EE_OFF) };
199static const unsigned int pwm_d_pins[] = { PIN(GPIODV_28, EE_OFF) };
200static const unsigned int pwm_e_pins[] = { PIN(GPIOX_19, EE_OFF) };
201static const unsigned int pwm_f_x_pins[] = { PIN(GPIOX_7, EE_OFF) };
202static const unsigned int pwm_f_y_pins[] = { PIN(GPIOY_15, EE_OFF) };
203
196static const struct pinctrl_pin_desc meson_gxbb_aobus_pins[] = { 204static const struct pinctrl_pin_desc meson_gxbb_aobus_pins[] = {
197 MESON_PIN(GPIOAO_0, 0), 205 MESON_PIN(GPIOAO_0, 0),
198 MESON_PIN(GPIOAO_1, 0), 206 MESON_PIN(GPIOAO_1, 0),
@@ -227,6 +235,11 @@ static const unsigned int i2c_slave_sda_ao_pins[] = {PIN(GPIOAO_5, 0) };
227 235
228static const unsigned int remote_input_ao_pins[] = {PIN(GPIOAO_7, 0) }; 236static const unsigned int remote_input_ao_pins[] = {PIN(GPIOAO_7, 0) };
229 237
238static const unsigned int pwm_ao_a_3_pins[] = { PIN(GPIOAO_3, 0) };
239static const unsigned int pwm_ao_a_6_pins[] = { PIN(GPIOAO_6, 0) };
240static const unsigned int pwm_ao_a_12_pins[] = { PIN(GPIOAO_12, 0) };
241static const unsigned int pwm_ao_b_pins[] = { PIN(GPIOAO_13, 0) };
242
230static struct meson_pmx_group meson_gxbb_periphs_groups[] = { 243static struct meson_pmx_group meson_gxbb_periphs_groups[] = {
231 GPIO_GROUP(GPIOZ_0, EE_OFF), 244 GPIO_GROUP(GPIOZ_0, EE_OFF),
232 GPIO_GROUP(GPIOZ_1, EE_OFF), 245 GPIO_GROUP(GPIOZ_1, EE_OFF),
@@ -361,12 +374,17 @@ static struct meson_pmx_group meson_gxbb_periphs_groups[] = {
361 GROUP(uart_rx_a, 4, 12), 374 GROUP(uart_rx_a, 4, 12),
362 GROUP(uart_cts_a, 4, 11), 375 GROUP(uart_cts_a, 4, 11),
363 GROUP(uart_rts_a, 4, 10), 376 GROUP(uart_rts_a, 4, 10),
377 GROUP(pwm_a_x, 3, 17),
378 GROUP(pwm_e, 2, 30),
379 GROUP(pwm_f_x, 3, 18),
364 380
365 /* Bank Y */ 381 /* Bank Y */
366 GROUP(uart_cts_c, 1, 19), 382 GROUP(uart_cts_c, 1, 19),
367 GROUP(uart_rts_c, 1, 18), 383 GROUP(uart_rts_c, 1, 18),
368 GROUP(uart_tx_c, 1, 17), 384 GROUP(uart_tx_c, 1, 17),
369 GROUP(uart_rx_c, 1, 16), 385 GROUP(uart_rx_c, 1, 16),
386 GROUP(pwm_a_y, 1, 21),
387 GROUP(pwm_f_y, 1, 20),
370 388
371 /* Bank Z */ 389 /* Bank Z */
372 GROUP(eth_mdio, 6, 1), 390 GROUP(eth_mdio, 6, 1),
@@ -389,6 +407,8 @@ static struct meson_pmx_group meson_gxbb_periphs_groups[] = {
389 GROUP(uart_rx_b, 2, 28), 407 GROUP(uart_rx_b, 2, 28),
390 GROUP(uart_cts_b, 2, 27), 408 GROUP(uart_cts_b, 2, 27),
391 GROUP(uart_rts_b, 2, 26), 409 GROUP(uart_rts_b, 2, 26),
410 GROUP(pwm_b, 3, 21),
411 GROUP(pwm_d, 3, 20),
392 412
393 /* Bank BOOT */ 413 /* Bank BOOT */
394 GROUP(emmc_nand_d07, 4, 30), 414 GROUP(emmc_nand_d07, 4, 30),
@@ -435,6 +455,10 @@ static struct meson_pmx_group meson_gxbb_aobus_groups[] = {
435 GROUP(i2c_slave_sck_ao, 0, 2), 455 GROUP(i2c_slave_sck_ao, 0, 2),
436 GROUP(i2c_slave_sda_ao, 0, 1), 456 GROUP(i2c_slave_sda_ao, 0, 1),
437 GROUP(remote_input_ao, 0, 0), 457 GROUP(remote_input_ao, 0, 0),
458 GROUP(pwm_ao_a_3, 0, 22),
459 GROUP(pwm_ao_a_6, 0, 18),
460 GROUP(pwm_ao_a_12, 0, 17),
461 GROUP(pwm_ao_b, 0, 3),
438}; 462};
439 463
440static const char * const gpio_periphs_groups[] = { 464static const char * const gpio_periphs_groups[] = {
@@ -502,6 +526,34 @@ static const char * const eth_groups[] = {
502 "eth_txd0", "eth_txd1", "eth_txd2", "eth_txd3", 526 "eth_txd0", "eth_txd1", "eth_txd2", "eth_txd3",
503}; 527};
504 528
529static const char * const pwm_a_x_groups[] = {
530 "pwm_a_x",
531};
532
533static const char * const pwm_a_y_groups[] = {
534 "pwm_a_y",
535};
536
537static const char * const pwm_b_groups[] = {
538 "pwm_b",
539};
540
541static const char * const pwm_d_groups[] = {
542 "pwm_d",
543};
544
545static const char * const pwm_e_groups[] = {
546 "pwm_e",
547};
548
549static const char * const pwm_f_x_groups[] = {
550 "pwm_f_x",
551};
552
553static const char * const pwm_f_y_groups[] = {
554 "pwm_f_y",
555};
556
505static const char * const gpio_aobus_groups[] = { 557static const char * const gpio_aobus_groups[] = {
506 "GPIOAO_0", "GPIOAO_1", "GPIOAO_2", "GPIOAO_3", "GPIOAO_4", 558 "GPIOAO_0", "GPIOAO_1", "GPIOAO_2", "GPIOAO_3", "GPIOAO_4",
507 "GPIOAO_5", "GPIOAO_6", "GPIOAO_7", "GPIOAO_8", "GPIOAO_9", 559 "GPIOAO_5", "GPIOAO_6", "GPIOAO_7", "GPIOAO_8", "GPIOAO_9",
@@ -528,6 +580,22 @@ static const char * const remote_input_ao_groups[] = {
528 "remote_input_ao", 580 "remote_input_ao",
529}; 581};
530 582
583static const char * const pwm_ao_a_3_groups[] = {
584 "pwm_ao_a_3",
585};
586
587static const char * const pwm_ao_a_6_groups[] = {
588 "pwm_ao_a_6",
589};
590
591static const char * const pwm_ao_a_12_groups[] = {
592 "pwm_ao_a_12",
593};
594
595static const char * const pwm_ao_b_groups[] = {
596 "pwm_ao_b",
597};
598
531static struct meson_pmx_func meson_gxbb_periphs_functions[] = { 599static struct meson_pmx_func meson_gxbb_periphs_functions[] = {
532 FUNCTION(gpio_periphs), 600 FUNCTION(gpio_periphs),
533 FUNCTION(emmc), 601 FUNCTION(emmc),
@@ -536,6 +604,13 @@ static struct meson_pmx_func meson_gxbb_periphs_functions[] = {
536 FUNCTION(uart_b), 604 FUNCTION(uart_b),
537 FUNCTION(uart_c), 605 FUNCTION(uart_c),
538 FUNCTION(eth), 606 FUNCTION(eth),
607 FUNCTION(pwm_a_x),
608 FUNCTION(pwm_a_y),
609 FUNCTION(pwm_b),
610 FUNCTION(pwm_d),
611 FUNCTION(pwm_e),
612 FUNCTION(pwm_f_x),
613 FUNCTION(pwm_f_y),
539}; 614};
540 615
541static struct meson_pmx_func meson_gxbb_aobus_functions[] = { 616static struct meson_pmx_func meson_gxbb_aobus_functions[] = {
@@ -545,6 +620,10 @@ static struct meson_pmx_func meson_gxbb_aobus_functions[] = {
545 FUNCTION(i2c_ao), 620 FUNCTION(i2c_ao),
546 FUNCTION(i2c_slave_ao), 621 FUNCTION(i2c_slave_ao),
547 FUNCTION(remote_input_ao), 622 FUNCTION(remote_input_ao),
623 FUNCTION(pwm_ao_a_3),
624 FUNCTION(pwm_ao_a_6),
625 FUNCTION(pwm_ao_a_12),
626 FUNCTION(pwm_ao_b),
548}; 627};
549 628
550static struct meson_bank meson_gxbb_periphs_banks[] = { 629static struct meson_bank meson_gxbb_periphs_banks[] = {