From cc97a95f953be9a30c26982e39bfbce08ced3b9b Mon Sep 17 00:00:00 2001 From: Martin Blumenstingl Date: Sat, 18 Mar 2017 13:27:35 +0100 Subject: pinctrl: meson: gxl: add the missing PWM pin definitions This adds support for the missing PWM pins on Meson GXL SoCs, namely: - PWM_A - PWM_B - PWM_C - PWM_F (GPIOX_7 and GPIOCLK_1 can be selected as output) - PWM_AO_A (GPIOAO_3 and GPIOAO_8 can be selected as output) Signed-off-by: Martin Blumenstingl Tested-by: Neil Armstrong Reviewed-by: Neil Armstrong Signed-off-by: Linus Walleij --- drivers/pinctrl/meson/pinctrl-meson-gxl.c | 54 +++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) (limited to 'drivers/pinctrl/meson') diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxl.c b/drivers/pinctrl/meson/pinctrl-meson-gxl.c index 4ab94a85e306..a0a7936f8f0d 100644 --- a/drivers/pinctrl/meson/pinctrl-meson-gxl.c +++ b/drivers/pinctrl/meson/pinctrl-meson-gxl.c @@ -195,8 +195,19 @@ static const unsigned int eth_txd1_pins[] = { PIN(GPIOZ_11, EE_OFF) }; static const unsigned int eth_txd2_pins[] = { PIN(GPIOZ_12, EE_OFF) }; static const unsigned int eth_txd3_pins[] = { PIN(GPIOZ_13, EE_OFF) }; +static const unsigned int pwm_a_pins[] = { PIN(GPIOX_6, EE_OFF) }; + +static const unsigned int pwm_b_pins[] = { PIN(GPIODV_29, EE_OFF) }; + +static const unsigned int pwm_c_pins[] = { PIN(GPIOZ_15, EE_OFF) }; + +static const unsigned int pwm_d_pins[] = { PIN(GPIODV_28, EE_OFF) }; + static const unsigned int pwm_e_pins[] = { PIN(GPIOX_16, EE_OFF) }; +static const unsigned int pwm_f_clk_pins[] = { PIN(GPIOCLK_1, EE_OFF) }; +static const unsigned int pwm_f_x_pins[] = { PIN(GPIOX_7, EE_OFF) }; + static const unsigned int hdmi_hpd_pins[] = { PIN(GPIOH_0, EE_OFF) }; static const unsigned int hdmi_sda_pins[] = { PIN(GPIOH_1, EE_OFF) }; static const unsigned int hdmi_scl_pins[] = { PIN(GPIOH_2, EE_OFF) }; @@ -225,6 +236,9 @@ static const unsigned int uart_rts_ao_b_pins[] = { PIN(GPIOAO_3, 0) }; static const unsigned int remote_input_ao_pins[] = {PIN(GPIOAO_7, 0) }; +static const unsigned int pwm_ao_a_3_pins[] = { PIN(GPIOAO_3, 0) }; +static const unsigned int pwm_ao_a_8_pins[] = { PIN(GPIOAO_8, 0) }; + static const unsigned int pwm_ao_b_pins[] = { PIN(GPIOAO_9, 0) }; static struct meson_pmx_group meson_gxl_periphs_groups[] = { @@ -350,7 +364,9 @@ static struct meson_pmx_group meson_gxl_periphs_groups[] = { GROUP(uart_rts_a, 5, 16), GROUP(uart_tx_c, 5, 13), GROUP(uart_rx_c, 5, 12), + GROUP(pwm_a, 5, 25), GROUP(pwm_e, 5, 15), + GROUP(pwm_f_x, 5, 14), /* Bank Z */ GROUP(eth_mdio, 4, 22), @@ -367,6 +383,7 @@ static struct meson_pmx_group meson_gxl_periphs_groups[] = { GROUP(eth_txd1, 4, 12), GROUP(eth_txd2, 4, 11), GROUP(eth_txd3, 4, 10), + GROUP(pwm_c, 3, 20), /* Bank H */ GROUP(hdmi_hpd, 6, 31), @@ -382,6 +399,8 @@ static struct meson_pmx_group meson_gxl_periphs_groups[] = { GROUP(i2c_sda_b, 1, 12), GROUP(i2c_sck_c, 1, 11), GROUP(i2c_sda_c, 1, 10), + GROUP(pwm_b, 2, 11), + GROUP(pwm_d, 2, 12), /* Bank BOOT */ GROUP(emmc_nand_d07, 7, 31), @@ -404,6 +423,9 @@ static struct meson_pmx_group meson_gxl_periphs_groups[] = { GROUP(sdcard_d2, 6, 0), GROUP(sdcard_cmd, 6, 2), GROUP(sdcard_clk, 6, 3), + + /* Bank CLK */ + GROUP(pwm_f_clk, 8, 30), }; static struct meson_pmx_group meson_gxl_aobus_groups[] = { @@ -428,6 +450,8 @@ static struct meson_pmx_group meson_gxl_aobus_groups[] = { GROUP(uart_cts_ao_b, 0, 8), GROUP(uart_rts_ao_b, 0, 7), GROUP(remote_input_ao, 0, 0), + GROUP(pwm_ao_a_3, 0, 22), + GROUP(pwm_ao_a_8, 0, 17), GROUP(pwm_ao_b, 0, 3), }; @@ -513,10 +537,30 @@ static const char * const eth_groups[] = { "eth_txd0", "eth_txd1", "eth_txd2", "eth_txd3", }; +static const char * const pwm_a_groups[] = { + "pwm_a", +}; + +static const char * const pwm_b_groups[] = { + "pwm_b", +}; + +static const char * const pwm_c_groups[] = { + "pwm_c", +}; + +static const char * const pwm_d_groups[] = { + "pwm_d", +}; + static const char * const pwm_e_groups[] = { "pwm_e", }; +static const char * const pwm_f_groups[] = { + "pwm_f_clk", "pwm_f_x", +}; + static const char * const hdmi_hpd_groups[] = { "hdmi_hpd", }; @@ -542,6 +586,10 @@ static const char * const remote_input_ao_groups[] = { "remote_input_ao", }; +static const char * const pwm_ao_a_groups[] = { + "pwm_ao_a_3", "pwm_ao_a_8", +}; + static const char * const pwm_ao_b_groups[] = { "pwm_ao_b", }; @@ -559,7 +607,12 @@ static struct meson_pmx_func meson_gxl_periphs_functions[] = { FUNCTION(i2c_b), FUNCTION(i2c_c), FUNCTION(eth), + FUNCTION(pwm_a), + FUNCTION(pwm_b), + FUNCTION(pwm_c), + FUNCTION(pwm_d), FUNCTION(pwm_e), + FUNCTION(pwm_f), FUNCTION(hdmi_hpd), FUNCTION(hdmi_i2c), }; @@ -569,6 +622,7 @@ static struct meson_pmx_func meson_gxl_aobus_functions[] = { FUNCTION(uart_ao), FUNCTION(uart_ao_b), FUNCTION(remote_input_ao), + FUNCTION(pwm_ao_a), FUNCTION(pwm_ao_b), }; -- cgit v1.2.3 From 6a0ab255ae8df0542529dce37dcea9fd2a0576ac Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Thu, 23 Mar 2017 11:41:10 +0100 Subject: pinctrl: meson-gxl: Fix inverted registers and add missing pins Fix some inverted bit numbers in some pinctrl groups and add missing pins and groups to be in pair with the GXBB pinctrl pins definition. Signed-off-by: Neil Armstrong Signed-off-by: Linus Walleij --- drivers/pinctrl/meson/pinctrl-meson-gxl.c | 83 +++++++++++++++++++++++++------ 1 file changed, 68 insertions(+), 15 deletions(-) (limited to 'drivers/pinctrl/meson') diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxl.c b/drivers/pinctrl/meson/pinctrl-meson-gxl.c index a0a7936f8f0d..6c2a15dde99f 100644 --- a/drivers/pinctrl/meson/pinctrl-meson-gxl.c +++ b/drivers/pinctrl/meson/pinctrl-meson-gxl.c @@ -136,6 +136,11 @@ static const unsigned int emmc_clk_pins[] = { PIN(BOOT_8, EE_OFF) }; static const unsigned int emmc_cmd_pins[] = { PIN(BOOT_10, EE_OFF) }; static const unsigned int emmc_ds_pins[] = { PIN(BOOT_15, EE_OFF) }; +static const unsigned int nor_d_pins[] = { PIN(BOOT_11, EE_OFF) }; +static const unsigned int nor_q_pins[] = { PIN(BOOT_12, EE_OFF) }; +static const unsigned int nor_c_pins[] = { PIN(BOOT_13, EE_OFF) }; +static const unsigned int nor_cs_pins[] = { PIN(BOOT_15, EE_OFF) }; + static const unsigned int sdcard_d0_pins[] = { PIN(CARD_1, EE_OFF) }; static const unsigned int sdcard_d1_pins[] = { PIN(CARD_0, EE_OFF) }; static const unsigned int sdcard_d2_pins[] = { PIN(CARD_5, EE_OFF) }; @@ -167,9 +172,13 @@ static const unsigned int uart_rts_a_pins[] = { PIN(GPIOX_15, EE_OFF) }; static const unsigned int uart_tx_b_pins[] = { PIN(GPIODV_24, EE_OFF) }; static const unsigned int uart_rx_b_pins[] = { PIN(GPIODV_25, EE_OFF) }; +static const unsigned int uart_cts_b_pins[] = { PIN(GPIODV_26, EE_OFF) }; +static const unsigned int uart_rts_b_pins[] = { PIN(GPIODV_27, EE_OFF) }; static const unsigned int uart_tx_c_pins[] = { PIN(GPIOX_8, EE_OFF) }; static const unsigned int uart_rx_c_pins[] = { PIN(GPIOX_9, EE_OFF) }; +static const unsigned int uart_cts_c_pins[] = { PIN(GPIOX_10, EE_OFF) }; +static const unsigned int uart_rts_c_pins[] = { PIN(GPIOX_11, EE_OFF) }; static const unsigned int i2c_sck_a_pins[] = { PIN(GPIODV_25, EE_OFF) }; static const unsigned int i2c_sda_a_pins[] = { PIN(GPIODV_24, EE_OFF) }; @@ -180,6 +189,9 @@ static const unsigned int i2c_sda_b_pins[] = { PIN(GPIODV_26, EE_OFF) }; static const unsigned int i2c_sck_c_pins[] = { PIN(GPIODV_29, EE_OFF) }; static const unsigned int i2c_sda_c_pins[] = { PIN(GPIODV_28, EE_OFF) }; +static const unsigned int i2c_sck_c_dv19_pins[] = { PIN(GPIODV_19, EE_OFF) }; +static const unsigned int i2c_sda_c_dv18_pins[] = { PIN(GPIODV_18, EE_OFF) }; + static const unsigned int eth_mdio_pins[] = { PIN(GPIOZ_0, EE_OFF) }; static const unsigned int eth_mdc_pins[] = { PIN(GPIOZ_1, EE_OFF) }; static const unsigned int eth_clk_rx_clk_pins[] = { PIN(GPIOZ_2, EE_OFF) }; @@ -227,6 +239,8 @@ static const struct pinctrl_pin_desc meson_gxl_aobus_pins[] = { static const unsigned int uart_tx_ao_a_pins[] = { PIN(GPIOAO_0, 0) }; static const unsigned int uart_rx_ao_a_pins[] = { PIN(GPIOAO_1, 0) }; +static const unsigned int uart_tx_ao_b_0_pins[] = { PIN(GPIOAO_0, 0) }; +static const unsigned int uart_rx_ao_b_1_pins[] = { PIN(GPIOAO_1, 0) }; static const unsigned int uart_cts_ao_a_pins[] = { PIN(GPIOAO_2, 0) }; static const unsigned int uart_rts_ao_a_pins[] = { PIN(GPIOAO_3, 0) }; static const unsigned int uart_tx_ao_b_pins[] = { PIN(GPIOAO_4, 0) }; @@ -234,12 +248,18 @@ static const unsigned int uart_rx_ao_b_pins[] = { PIN(GPIOAO_5, 0) }; static const unsigned int uart_cts_ao_b_pins[] = { PIN(GPIOAO_2, 0) }; static const unsigned int uart_rts_ao_b_pins[] = { PIN(GPIOAO_3, 0) }; +static const unsigned int i2c_sck_ao_pins[] = {PIN(GPIOAO_4, 0) }; +static const unsigned int i2c_sda_ao_pins[] = {PIN(GPIOAO_5, 0) }; +static const unsigned int i2c_slave_sck_ao_pins[] = {PIN(GPIOAO_4, 0) }; +static const unsigned int i2c_slave_sda_ao_pins[] = {PIN(GPIOAO_5, 0) }; + static const unsigned int remote_input_ao_pins[] = {PIN(GPIOAO_7, 0) }; static const unsigned int pwm_ao_a_3_pins[] = { PIN(GPIOAO_3, 0) }; static const unsigned int pwm_ao_a_8_pins[] = { PIN(GPIOAO_8, 0) }; static const unsigned int pwm_ao_b_pins[] = { PIN(GPIOAO_9, 0) }; +static const unsigned int pwm_ao_b_6_pins[] = { PIN(GPIOAO_6, 0) }; static struct meson_pmx_group meson_gxl_periphs_groups[] = { GPIO_GROUP(GPIOZ_0, EE_OFF), @@ -355,8 +375,8 @@ static struct meson_pmx_group meson_gxl_periphs_groups[] = { GROUP(sdio_d1, 5, 30), GROUP(sdio_d2, 5, 29), GROUP(sdio_d3, 5, 28), - GROUP(sdio_cmd, 5, 27), - GROUP(sdio_clk, 5, 26), + GROUP(sdio_clk, 5, 27), + GROUP(sdio_cmd, 5, 26), GROUP(sdio_irq, 5, 24), GROUP(uart_tx_a, 5, 19), GROUP(uart_rx_a, 5, 18), @@ -364,13 +384,15 @@ static struct meson_pmx_group meson_gxl_periphs_groups[] = { GROUP(uart_rts_a, 5, 16), GROUP(uart_tx_c, 5, 13), GROUP(uart_rx_c, 5, 12), + GROUP(uart_cts_c, 5, 11), + GROUP(uart_rts_c, 5, 10), GROUP(pwm_a, 5, 25), GROUP(pwm_e, 5, 15), GROUP(pwm_f_x, 5, 14), /* Bank Z */ - GROUP(eth_mdio, 4, 22), - GROUP(eth_mdc, 4, 23), + GROUP(eth_mdio, 4, 23), + GROUP(eth_mdc, 4, 22), GROUP(eth_clk_rx_clk, 4, 21), GROUP(eth_rx_dv, 4, 20), GROUP(eth_rxd0, 4, 19), @@ -393,12 +415,16 @@ static struct meson_pmx_group meson_gxl_periphs_groups[] = { /* Bank DV */ GROUP(uart_tx_b, 2, 16), GROUP(uart_rx_b, 2, 15), - GROUP(i2c_sck_a, 1, 15), - GROUP(i2c_sda_a, 1, 14), - GROUP(i2c_sck_b, 1, 13), - GROUP(i2c_sda_b, 1, 12), - GROUP(i2c_sck_c, 1, 11), - GROUP(i2c_sda_c, 1, 10), + GROUP(uart_cts_b, 2, 14), + GROUP(uart_rts_b, 2, 13), + GROUP(i2c_sda_c_dv18, 1, 17), + GROUP(i2c_sck_c_dv19, 1, 16), + GROUP(i2c_sda_a, 1, 15), + GROUP(i2c_sck_a, 1, 14), + GROUP(i2c_sda_b, 1, 13), + GROUP(i2c_sck_b, 1, 12), + GROUP(i2c_sda_c, 1, 11), + GROUP(i2c_sck_c, 1, 10), GROUP(pwm_b, 2, 11), GROUP(pwm_d, 2, 12), @@ -407,6 +433,10 @@ static struct meson_pmx_group meson_gxl_periphs_groups[] = { GROUP(emmc_clk, 7, 30), GROUP(emmc_cmd, 7, 29), GROUP(emmc_ds, 7, 28), + GROUP(nor_d, 7, 13), + GROUP(nor_q, 7, 12), + GROUP(nor_c, 7, 11), + GROUP(nor_cs, 7, 10), GROUP(nand_ce0, 7, 7), GROUP(nand_ce1, 7, 6), GROUP(nand_rb0, 7, 5), @@ -441,16 +471,23 @@ static struct meson_pmx_group meson_gxl_aobus_groups[] = { GPIO_GROUP(GPIOAO_9, 0), /* bank AO */ + GROUP(uart_tx_ao_b_0, 0, 26), + GROUP(uart_rx_ao_b_1, 0, 25), GROUP(uart_tx_ao_b, 0, 24), - GROUP(uart_rx_ao_b, 0, 25), + GROUP(uart_rx_ao_b, 0, 23), GROUP(uart_tx_ao_a, 0, 12), GROUP(uart_rx_ao_a, 0, 11), GROUP(uart_cts_ao_a, 0, 10), GROUP(uart_rts_ao_a, 0, 9), GROUP(uart_cts_ao_b, 0, 8), GROUP(uart_rts_ao_b, 0, 7), + GROUP(i2c_sck_ao, 0, 6), + GROUP(i2c_sda_ao, 0, 5), + GROUP(i2c_slave_sck_ao, 0, 2), + GROUP(i2c_slave_sda_ao, 0, 1), GROUP(remote_input_ao, 0, 0), GROUP(pwm_ao_a_3, 0, 22), + GROUP(pwm_ao_b_6, 0, 18), GROUP(pwm_ao_a_8, 0, 17), GROUP(pwm_ao_b, 0, 3), }; @@ -491,6 +528,10 @@ static const char * const emmc_groups[] = { "emmc_nand_d07", "emmc_clk", "emmc_cmd", "emmc_ds", }; +static const char * const nor_groups[] = { + "nor_d", "nor_q", "nor_c", "nor_cs", +}; + static const char * const sdcard_groups[] = { "sdcard_d0", "sdcard_d1", "sdcard_d2", "sdcard_d3", "sdcard_cmd", "sdcard_clk", @@ -511,11 +552,11 @@ static const char * const uart_a_groups[] = { }; static const char * const uart_b_groups[] = { - "uart_tx_b", "uart_rx_b", + "uart_tx_b", "uart_rx_b", "uart_cts_b", "uart_rts_b", }; static const char * const uart_c_groups[] = { - "uart_tx_c", "uart_rx_c", + "uart_tx_c", "uart_rx_c", "uart_cts_c", "uart_rts_c", }; static const char * const i2c_a_groups[] = { @@ -527,7 +568,7 @@ static const char * const i2c_b_groups[] = { }; static const char * const i2c_c_groups[] = { - "i2c_sck_c", "i2c_sda_c", + "i2c_sck_c", "i2c_sda_c", "i2c_sda_c_dv18", "i2c_sck_c_dv19", }; static const char * const eth_groups[] = { @@ -580,6 +621,15 @@ static const char * const uart_ao_groups[] = { static const char * const uart_ao_b_groups[] = { "uart_tx_ao_b", "uart_rx_ao_b", "uart_cts_ao_b", "uart_rts_ao_b", + "uart_tx_ao_b_0", "uart_rx_ao_b_1", +}; + +static const char * const i2c_ao_groups[] = { + "i2c_sck_ao", "i2c_sda_ao", +}; + +static const char * const i2c_slave_ao_groups[] = { + "i2c_slave_sck_ao", "i2c_slave_sda_ao", }; static const char * const remote_input_ao_groups[] = { @@ -591,12 +641,13 @@ static const char * const pwm_ao_a_groups[] = { }; static const char * const pwm_ao_b_groups[] = { - "pwm_ao_b", + "pwm_ao_b", "pwm_ao_b_6", }; static struct meson_pmx_func meson_gxl_periphs_functions[] = { FUNCTION(gpio_periphs), FUNCTION(emmc), + FUNCTION(nor), FUNCTION(sdcard), FUNCTION(sdio), FUNCTION(nand), @@ -621,6 +672,8 @@ static struct meson_pmx_func meson_gxl_aobus_functions[] = { FUNCTION(gpio_aobus), FUNCTION(uart_ao), FUNCTION(uart_ao_b), + FUNCTION(i2c_ao), + FUNCTION(i2c_slave_ao), FUNCTION(remote_input_ao), FUNCTION(pwm_ao_a), FUNCTION(pwm_ao_b), -- cgit v1.2.3 From c7fc5fbafa5a676813d68b0f24ce980d717eb940 Mon Sep 17 00:00:00 2001 From: Neil Armstrong Date: Thu, 23 Mar 2017 17:27:28 +0100 Subject: pinctrl: meson: use gpio-ranges from DT When trying to add a gpio-hog, we enter a weird loop where the gpio-ranges is needed when gpiochip_add_data() is called but in the current implementation the ranges are added from the driver afterwards. A simple solution is to rely on the DR gpio-ranges attribute and remove the call to gpiochip_add_pin_range(). Signed-off-by: Neil Armstrong Signed-off-by: Linus Walleij --- drivers/pinctrl/meson/pinctrl-meson.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'drivers/pinctrl/meson') diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c index cf1686e04378..66ed70c12733 100644 --- a/drivers/pinctrl/meson/pinctrl-meson.c +++ b/drivers/pinctrl/meson/pinctrl-meson.c @@ -555,22 +555,10 @@ static int meson_gpiolib_register(struct meson_pinctrl *pc) if (ret) { dev_err(pc->dev, "can't add gpio chip %s\n", pc->data->name); - goto fail; - } - - ret = gpiochip_add_pin_range(&pc->chip, dev_name(pc->dev), - 0, pc->data->pin_base, - pc->chip.ngpio); - if (ret) { - dev_err(pc->dev, "can't add pin range\n"); - goto fail; + return ret; } return 0; -fail: - gpiochip_remove(&pc->chip); - - return ret; } static struct regmap_config meson_regmap_config = { -- cgit v1.2.3 From 0145d490535584bd2176256d082502e71af644b7 Mon Sep 17 00:00:00 2001 From: Jerome Brunet Date: Thu, 23 Mar 2017 17:50:54 +0100 Subject: pinctrl: meson: gxbb: add i2s output pins Signed-off-by: Jerome Brunet Signed-off-by: Linus Walleij --- drivers/pinctrl/meson/pinctrl-meson-gxbb.c | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'drivers/pinctrl/meson') diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c index 7671424d46cb..8d5dd4772042 100644 --- a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c +++ b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c @@ -236,6 +236,10 @@ static const unsigned int hdmi_hpd_pins[] = { PIN(GPIOH_0, EE_OFF) }; static const unsigned int hdmi_sda_pins[] = { PIN(GPIOH_1, EE_OFF) }; static const unsigned int hdmi_scl_pins[] = { PIN(GPIOH_2, EE_OFF) }; +static const unsigned int i2s_out_ch23_y_pins[] = { PIN(GPIOY_8, EE_OFF) }; +static const unsigned int i2s_out_ch45_y_pins[] = { PIN(GPIOY_9, EE_OFF) }; +static const unsigned int i2s_out_ch67_y_pins[] = { PIN(GPIOY_10, EE_OFF) }; + static const struct pinctrl_pin_desc meson_gxbb_aobus_pins[] = { MESON_PIN(GPIOAO_0, 0), MESON_PIN(GPIOAO_1, 0), @@ -274,6 +278,13 @@ static const unsigned int pwm_ao_a_6_pins[] = { PIN(GPIOAO_6, 0) }; static const unsigned int pwm_ao_a_12_pins[] = { PIN(GPIOAO_12, 0) }; static const unsigned int pwm_ao_b_pins[] = { PIN(GPIOAO_13, 0) }; +static const unsigned int i2s_am_clk_pins[] = { PIN(GPIOAO_8, 0) }; +static const unsigned int i2s_out_ao_clk_pins[] = { PIN(GPIOAO_9, 0) }; +static const unsigned int i2s_out_lr_clk_pins[] = { PIN(GPIOAO_10, 0) }; +static const unsigned int i2s_out_ch01_ao_pins[] = { PIN(GPIOAO_11, 0) }; +static const unsigned int i2s_out_ch23_ao_pins[] = { PIN(GPIOAO_12, 0) }; +static const unsigned int i2s_out_ch45_ao_pins[] = { PIN(GPIOAO_13, 0) }; + static struct meson_pmx_group meson_gxbb_periphs_groups[] = { GPIO_GROUP(GPIOZ_0, EE_OFF), GPIO_GROUP(GPIOZ_1, EE_OFF), @@ -426,6 +437,9 @@ static struct meson_pmx_group meson_gxbb_periphs_groups[] = { GROUP(uart_rx_c, 1, 16), GROUP(pwm_a_y, 1, 21), GROUP(pwm_f_y, 1, 20), + GROUP(i2s_out_ch23_y, 1, 5), + GROUP(i2s_out_ch45_y, 1, 6), + GROUP(i2s_out_ch67_y, 1, 7), /* Bank Z */ GROUP(eth_mdio, 6, 1), @@ -523,6 +537,12 @@ static struct meson_pmx_group meson_gxbb_aobus_groups[] = { GROUP(pwm_ao_a_6, 0, 18), GROUP(pwm_ao_a_12, 0, 17), GROUP(pwm_ao_b, 0, 3), + GROUP(i2s_am_clk, 0, 30), + GROUP(i2s_out_ao_clk, 0, 29), + GROUP(i2s_out_lr_clk, 0, 28), + GROUP(i2s_out_ch01_ao, 0, 27), + GROUP(i2s_out_ch23_ao, 1, 0), + GROUP(i2s_out_ch45_ao, 1, 1), }; static const char * const gpio_periphs_groups[] = { @@ -652,6 +672,10 @@ static const char * const hdmi_i2c_groups[] = { "hdmi_sda", "hdmi_scl", }; +static const char * const i2s_out_groups[] = { + "i2s_out_ch23_y", "i2s_out_ch45_y", "i2s_out_ch67_y", +}; + static const char * const gpio_aobus_groups[] = { "GPIOAO_0", "GPIOAO_1", "GPIOAO_2", "GPIOAO_3", "GPIOAO_4", "GPIOAO_5", "GPIOAO_6", "GPIOAO_7", "GPIOAO_8", "GPIOAO_9", @@ -694,6 +718,11 @@ static const char * const pwm_ao_b_groups[] = { "pwm_ao_b", }; +static const char * const i2s_out_ao_groups[] = { + "i2s_am_clk", "i2s_out_ao_clk", "i2s_out_lr_clk", + "i2s_out_ch01_ao", "i2s_out_ch23_ao", "i2s_out_ch45_ao", +}; + static struct meson_pmx_func meson_gxbb_periphs_functions[] = { FUNCTION(gpio_periphs), FUNCTION(emmc), @@ -717,6 +746,7 @@ static struct meson_pmx_func meson_gxbb_periphs_functions[] = { FUNCTION(pwm_f_y), FUNCTION(hdmi_hpd), FUNCTION(hdmi_i2c), + FUNCTION(i2s_out), }; static struct meson_pmx_func meson_gxbb_aobus_functions[] = { @@ -730,6 +760,7 @@ static struct meson_pmx_func meson_gxbb_aobus_functions[] = { FUNCTION(pwm_ao_a_6), FUNCTION(pwm_ao_a_12), FUNCTION(pwm_ao_b), + FUNCTION(i2s_out_ao), }; static struct meson_bank meson_gxbb_periphs_banks[] = { -- cgit v1.2.3 From bce12d66d613d536a55e0384f1f202ea98a14e76 Mon Sep 17 00:00:00 2001 From: Jerome Brunet Date: Thu, 23 Mar 2017 17:50:55 +0100 Subject: pinctrl: meson: gxbb: add spdif output pins Signed-off-by: Jerome Brunet Signed-off-by: Linus Walleij --- drivers/pinctrl/meson/pinctrl-meson-gxbb.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'drivers/pinctrl/meson') diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c index 8d5dd4772042..9bae2e3968af 100644 --- a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c +++ b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c @@ -240,6 +240,8 @@ static const unsigned int i2s_out_ch23_y_pins[] = { PIN(GPIOY_8, EE_OFF) }; static const unsigned int i2s_out_ch45_y_pins[] = { PIN(GPIOY_9, EE_OFF) }; static const unsigned int i2s_out_ch67_y_pins[] = { PIN(GPIOY_10, EE_OFF) }; +static const unsigned int spdif_out_y_pins[] = { PIN(GPIOY_12, EE_OFF) }; + static const struct pinctrl_pin_desc meson_gxbb_aobus_pins[] = { MESON_PIN(GPIOAO_0, 0), MESON_PIN(GPIOAO_1, 0), @@ -285,6 +287,9 @@ static const unsigned int i2s_out_ch01_ao_pins[] = { PIN(GPIOAO_11, 0) }; static const unsigned int i2s_out_ch23_ao_pins[] = { PIN(GPIOAO_12, 0) }; static const unsigned int i2s_out_ch45_ao_pins[] = { PIN(GPIOAO_13, 0) }; +static const unsigned int spdif_out_ao_6_pins[] = { PIN(GPIOAO_6, 0) }; +static const unsigned int spdif_out_ao_13_pins[] = { PIN(GPIOAO_13, 0) }; + static struct meson_pmx_group meson_gxbb_periphs_groups[] = { GPIO_GROUP(GPIOZ_0, EE_OFF), GPIO_GROUP(GPIOZ_1, EE_OFF), @@ -440,6 +445,7 @@ static struct meson_pmx_group meson_gxbb_periphs_groups[] = { GROUP(i2s_out_ch23_y, 1, 5), GROUP(i2s_out_ch45_y, 1, 6), GROUP(i2s_out_ch67_y, 1, 7), + GROUP(spdif_out_y, 1, 9), /* Bank Z */ GROUP(eth_mdio, 6, 1), @@ -543,6 +549,8 @@ static struct meson_pmx_group meson_gxbb_aobus_groups[] = { GROUP(i2s_out_ch01_ao, 0, 27), GROUP(i2s_out_ch23_ao, 1, 0), GROUP(i2s_out_ch45_ao, 1, 1), + GROUP(spdif_out_ao_6, 0, 16), + GROUP(spdif_out_ao_13, 0, 4), }; static const char * const gpio_periphs_groups[] = { @@ -676,6 +684,10 @@ static const char * const i2s_out_groups[] = { "i2s_out_ch23_y", "i2s_out_ch45_y", "i2s_out_ch67_y", }; +static const char * const spdif_out_groups[] = { + "spdif_out_y", +}; + static const char * const gpio_aobus_groups[] = { "GPIOAO_0", "GPIOAO_1", "GPIOAO_2", "GPIOAO_3", "GPIOAO_4", "GPIOAO_5", "GPIOAO_6", "GPIOAO_7", "GPIOAO_8", "GPIOAO_9", @@ -723,6 +735,10 @@ static const char * const i2s_out_ao_groups[] = { "i2s_out_ch01_ao", "i2s_out_ch23_ao", "i2s_out_ch45_ao", }; +static const char * const spdif_out_ao_groups[] = { + "spdif_out_ao_6", "spdif_out_ao_13", +}; + static struct meson_pmx_func meson_gxbb_periphs_functions[] = { FUNCTION(gpio_periphs), FUNCTION(emmc), @@ -747,6 +763,7 @@ static struct meson_pmx_func meson_gxbb_periphs_functions[] = { FUNCTION(hdmi_hpd), FUNCTION(hdmi_i2c), FUNCTION(i2s_out), + FUNCTION(spdif_out), }; static struct meson_pmx_func meson_gxbb_aobus_functions[] = { @@ -761,6 +778,7 @@ static struct meson_pmx_func meson_gxbb_aobus_functions[] = { FUNCTION(pwm_ao_a_12), FUNCTION(pwm_ao_b), FUNCTION(i2s_out_ao), + FUNCTION(spdif_out_ao), }; static struct meson_bank meson_gxbb_periphs_banks[] = { -- cgit v1.2.3 From 2899adf0422a29a92c7314fc5b427817c084beee Mon Sep 17 00:00:00 2001 From: Jerome Brunet Date: Thu, 23 Mar 2017 17:50:56 +0100 Subject: pinctrl: meson: gxl: add i2s output pins Signed-off-by: Jerome Brunet Signed-off-by: Linus Walleij --- drivers/pinctrl/meson/pinctrl-meson-gxl.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'drivers/pinctrl/meson') diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxl.c b/drivers/pinctrl/meson/pinctrl-meson-gxl.c index 6c2a15dde99f..e472213fd673 100644 --- a/drivers/pinctrl/meson/pinctrl-meson-gxl.c +++ b/drivers/pinctrl/meson/pinctrl-meson-gxl.c @@ -224,6 +224,14 @@ static const unsigned int hdmi_hpd_pins[] = { PIN(GPIOH_0, EE_OFF) }; static const unsigned int hdmi_sda_pins[] = { PIN(GPIOH_1, EE_OFF) }; static const unsigned int hdmi_scl_pins[] = { PIN(GPIOH_2, EE_OFF) }; +static const unsigned int i2s_am_clk_pins[] = { PIN(GPIOH_6, EE_OFF) }; +static const unsigned int i2s_out_ao_clk_pins[] = { PIN(GPIOH_7, EE_OFF) }; +static const unsigned int i2s_out_lr_clk_pins[] = { PIN(GPIOH_8, EE_OFF) }; +static const unsigned int i2s_out_ch01_pins[] = { PIN(GPIOH_9, EE_OFF) }; +static const unsigned int i2s_out_ch23_z_pins[] = { PIN(GPIOZ_5, EE_OFF) }; +static const unsigned int i2s_out_ch45_z_pins[] = { PIN(GPIOZ_6, EE_OFF) }; +static const unsigned int i2s_out_ch67_z_pins[] = { PIN(GPIOZ_7, EE_OFF) }; + static const struct pinctrl_pin_desc meson_gxl_aobus_pins[] = { MESON_PIN(GPIOAO_0, 0), MESON_PIN(GPIOAO_1, 0), @@ -261,6 +269,9 @@ static const unsigned int pwm_ao_a_8_pins[] = { PIN(GPIOAO_8, 0) }; static const unsigned int pwm_ao_b_pins[] = { PIN(GPIOAO_9, 0) }; static const unsigned int pwm_ao_b_6_pins[] = { PIN(GPIOAO_6, 0) }; +static const unsigned int i2s_out_ch23_ao_pins[] = { PIN(GPIOAO_8, EE_OFF) }; +static const unsigned int i2s_out_ch45_ao_pins[] = { PIN(GPIOAO_9, EE_OFF) }; + static struct meson_pmx_group meson_gxl_periphs_groups[] = { GPIO_GROUP(GPIOZ_0, EE_OFF), GPIO_GROUP(GPIOZ_1, EE_OFF), @@ -406,11 +417,18 @@ static struct meson_pmx_group meson_gxl_periphs_groups[] = { GROUP(eth_txd2, 4, 11), GROUP(eth_txd3, 4, 10), GROUP(pwm_c, 3, 20), + GROUP(i2s_out_ch23_z, 3, 26), + GROUP(i2s_out_ch45_z, 3, 25), + GROUP(i2s_out_ch67_z, 3, 24), /* Bank H */ GROUP(hdmi_hpd, 6, 31), GROUP(hdmi_sda, 6, 30), GROUP(hdmi_scl, 6, 29), + GROUP(i2s_am_clk, 6, 26), + GROUP(i2s_out_ao_clk, 6, 25), + GROUP(i2s_out_lr_clk, 6, 24), + GROUP(i2s_out_ch01, 6, 23), /* Bank DV */ GROUP(uart_tx_b, 2, 16), @@ -490,6 +508,8 @@ static struct meson_pmx_group meson_gxl_aobus_groups[] = { GROUP(pwm_ao_b_6, 0, 18), GROUP(pwm_ao_a_8, 0, 17), GROUP(pwm_ao_b, 0, 3), + GROUP(i2s_out_ch23_ao, 1, 0), + GROUP(i2s_out_ch45_ao, 1, 1), }; static const char * const gpio_periphs_groups[] = { @@ -610,6 +630,11 @@ static const char * const hdmi_i2c_groups[] = { "hdmi_sda", "hdmi_scl", }; +static const char * const i2s_out_groups[] = { + "i2s_am_clk", "i2s_out_ao_clk", "i2s_out_lr_clk", + "i2s_out_ch01", "i2s_out_ch23_z", "i2s_out_ch45_z", "i2s_out_ch67_z", +}; + static const char * const gpio_aobus_groups[] = { "GPIOAO_0", "GPIOAO_1", "GPIOAO_2", "GPIOAO_3", "GPIOAO_4", "GPIOAO_5", "GPIOAO_6", "GPIOAO_7", "GPIOAO_8", "GPIOAO_9", @@ -644,6 +669,10 @@ static const char * const pwm_ao_b_groups[] = { "pwm_ao_b", "pwm_ao_b_6", }; +static const char * const i2s_out_ao_groups[] = { + "i2s_out_ch23_ao", "i2s_out_ch45_ao", +}; + static struct meson_pmx_func meson_gxl_periphs_functions[] = { FUNCTION(gpio_periphs), FUNCTION(emmc), @@ -666,6 +695,7 @@ static struct meson_pmx_func meson_gxl_periphs_functions[] = { FUNCTION(pwm_f), FUNCTION(hdmi_hpd), FUNCTION(hdmi_i2c), + FUNCTION(i2s_out), }; static struct meson_pmx_func meson_gxl_aobus_functions[] = { @@ -677,6 +707,7 @@ static struct meson_pmx_func meson_gxl_aobus_functions[] = { FUNCTION(remote_input_ao), FUNCTION(pwm_ao_a), FUNCTION(pwm_ao_b), + FUNCTION(i2s_out_ao), }; static struct meson_bank meson_gxl_periphs_banks[] = { -- cgit v1.2.3 From b840d649f9ec7ede484e47b1a53d16ae6f3d0085 Mon Sep 17 00:00:00 2001 From: Jerome Brunet Date: Thu, 23 Mar 2017 17:50:57 +0100 Subject: pinctrl: meson: gxl: add spdif output pins Signed-off-by: Jerome Brunet Signed-off-by: Linus Walleij --- drivers/pinctrl/meson/pinctrl-meson-gxl.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'drivers/pinctrl/meson') diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxl.c b/drivers/pinctrl/meson/pinctrl-meson-gxl.c index e472213fd673..998210eacf37 100644 --- a/drivers/pinctrl/meson/pinctrl-meson-gxl.c +++ b/drivers/pinctrl/meson/pinctrl-meson-gxl.c @@ -232,6 +232,8 @@ static const unsigned int i2s_out_ch23_z_pins[] = { PIN(GPIOZ_5, EE_OFF) }; static const unsigned int i2s_out_ch45_z_pins[] = { PIN(GPIOZ_6, EE_OFF) }; static const unsigned int i2s_out_ch67_z_pins[] = { PIN(GPIOZ_7, EE_OFF) }; +static const unsigned int spdif_out_h_pins[] = { PIN(GPIOH_4, EE_OFF) }; + static const struct pinctrl_pin_desc meson_gxl_aobus_pins[] = { MESON_PIN(GPIOAO_0, 0), MESON_PIN(GPIOAO_1, 0), @@ -272,6 +274,9 @@ static const unsigned int pwm_ao_b_6_pins[] = { PIN(GPIOAO_6, 0) }; static const unsigned int i2s_out_ch23_ao_pins[] = { PIN(GPIOAO_8, EE_OFF) }; static const unsigned int i2s_out_ch45_ao_pins[] = { PIN(GPIOAO_9, EE_OFF) }; +static const unsigned int spdif_out_ao_6_pins[] = { PIN(GPIOAO_6, EE_OFF) }; +static const unsigned int spdif_out_ao_9_pins[] = { PIN(GPIOAO_9, EE_OFF) }; + static struct meson_pmx_group meson_gxl_periphs_groups[] = { GPIO_GROUP(GPIOZ_0, EE_OFF), GPIO_GROUP(GPIOZ_1, EE_OFF), @@ -429,6 +434,7 @@ static struct meson_pmx_group meson_gxl_periphs_groups[] = { GROUP(i2s_out_ao_clk, 6, 25), GROUP(i2s_out_lr_clk, 6, 24), GROUP(i2s_out_ch01, 6, 23), + GROUP(spdif_out_h, 6, 28), /* Bank DV */ GROUP(uart_tx_b, 2, 16), @@ -510,6 +516,8 @@ static struct meson_pmx_group meson_gxl_aobus_groups[] = { GROUP(pwm_ao_b, 0, 3), GROUP(i2s_out_ch23_ao, 1, 0), GROUP(i2s_out_ch45_ao, 1, 1), + GROUP(spdif_out_ao_6, 0, 16), + GROUP(spdif_out_ao_9, 0, 4), }; static const char * const gpio_periphs_groups[] = { @@ -635,6 +643,10 @@ static const char * const i2s_out_groups[] = { "i2s_out_ch01", "i2s_out_ch23_z", "i2s_out_ch45_z", "i2s_out_ch67_z", }; +static const char * const spdif_out_groups[] = { + "spdif_out_h", +}; + static const char * const gpio_aobus_groups[] = { "GPIOAO_0", "GPIOAO_1", "GPIOAO_2", "GPIOAO_3", "GPIOAO_4", "GPIOAO_5", "GPIOAO_6", "GPIOAO_7", "GPIOAO_8", "GPIOAO_9", @@ -673,6 +685,10 @@ static const char * const i2s_out_ao_groups[] = { "i2s_out_ch23_ao", "i2s_out_ch45_ao", }; +static const char * const spdif_out_ao_groups[] = { + "spdif_out_ao_6", "spdif_out_ao_9", +}; + static struct meson_pmx_func meson_gxl_periphs_functions[] = { FUNCTION(gpio_periphs), FUNCTION(emmc), @@ -696,6 +712,7 @@ static struct meson_pmx_func meson_gxl_periphs_functions[] = { FUNCTION(hdmi_hpd), FUNCTION(hdmi_i2c), FUNCTION(i2s_out), + FUNCTION(spdif_out), }; static struct meson_pmx_func meson_gxl_aobus_functions[] = { @@ -708,6 +725,7 @@ static struct meson_pmx_func meson_gxl_aobus_functions[] = { FUNCTION(pwm_ao_a), FUNCTION(pwm_ao_b), FUNCTION(i2s_out_ao), + FUNCTION(spdif_out_ao), }; static struct meson_bank meson_gxl_periphs_banks[] = { -- cgit v1.2.3 From 97ba26b8a9343008504d4e3a87d212bc07b05212 Mon Sep 17 00:00:00 2001 From: Martin Blumenstingl Date: Sat, 1 Apr 2017 15:59:21 +0200 Subject: pinctrl: meson: meson8b: fix the NAND DQS pins The nand_groups table uses different names for the NAND DQS pins than the GROUP() definition in meson8b_cbus_groups (nand_dqs_0 vs nand_dqs0). This prevents using the NAND DQS pins in the devicetree. Fix this by ensuring that the GROUP() definition and the meson8b_cbus_groups use the same name for these pins. Fixes: 0fefcb6876d0 ("pinctrl: Add support for Meson8b") Signed-off-by: Martin Blumenstingl Acked-by: Kevin Hilman Signed-off-by: Linus Walleij --- drivers/pinctrl/meson/pinctrl-meson8b.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/pinctrl/meson') diff --git a/drivers/pinctrl/meson/pinctrl-meson8b.c b/drivers/pinctrl/meson/pinctrl-meson8b.c index 76f077f18193..f87ef5a0ee6c 100644 --- a/drivers/pinctrl/meson/pinctrl-meson8b.c +++ b/drivers/pinctrl/meson/pinctrl-meson8b.c @@ -739,8 +739,8 @@ static const char * const sdxc_c_groups[] = { static const char * const nand_groups[] = { "nand_io", "nand_io_ce0", "nand_io_ce1", "nand_io_rb0", "nand_ale", "nand_cle", - "nand_wen_clk", "nand_ren_clk", "nand_dqs0", - "nand_dqs1" + "nand_wen_clk", "nand_ren_clk", "nand_dqs_0", + "nand_dqs_1" }; static const char * const nor_groups[] = { -- cgit v1.2.3 From 4781c22c7691140b2d945cb663d3b7b03319e07c Mon Sep 17 00:00:00 2001 From: Martin Blumenstingl Date: Sat, 1 Apr 2017 15:59:22 +0200 Subject: pinctrl: meson: meson8b: rename the NAND DQS pin definitions The NAND DQS pins are currently named nand_dqs_0 and nand_dqs_1. However, they both seem to have the same function, just exposed on different pins (unlike the ethernet TX pins for example, where there's eth_txd0..3 - all of these can be active at the same time as they are different data lines). Rename the NAND DQS pins to nand_dqs_15 and nand_dqs_18 to reflect that it's the same functionality just exposed on different pins (BOOT_15 and BOOT_18). Signed-off-by: Martin Blumenstingl Acked-by: Kevin Hilman Signed-off-by: Linus Walleij --- drivers/pinctrl/meson/pinctrl-meson8b.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/pinctrl/meson') diff --git a/drivers/pinctrl/meson/pinctrl-meson8b.c b/drivers/pinctrl/meson/pinctrl-meson8b.c index f87ef5a0ee6c..bf747eb1f3f4 100644 --- a/drivers/pinctrl/meson/pinctrl-meson8b.c +++ b/drivers/pinctrl/meson/pinctrl-meson8b.c @@ -267,8 +267,8 @@ static const unsigned int nand_ale_pins[] = { PIN(BOOT_11, 0) }; static const unsigned int nand_cle_pins[] = { PIN(BOOT_12, 0) }; static const unsigned int nand_wen_clk_pins[] = { PIN(BOOT_13, 0) }; static const unsigned int nand_ren_clk_pins[] = { PIN(BOOT_14, 0) }; -static const unsigned int nand_dqs_0_pins[] = { PIN(BOOT_15, 0) }; -static const unsigned int nand_dqs_1_pins[] = { PIN(BOOT_18, 0) }; +static const unsigned int nand_dqs_15_pins[] = { PIN(BOOT_15, 0) }; +static const unsigned int nand_dqs_18_pins[] = { PIN(BOOT_18, 0) }; static const unsigned int sdxc_d0_c_pins[] = { PIN(BOOT_0, 0)}; static const unsigned int sdxc_d13_c_pins[] = { PIN(BOOT_1, 0), PIN(BOOT_2, 0), @@ -527,8 +527,8 @@ static struct meson_pmx_group meson8b_cbus_groups[] = { GROUP(nand_cle, 2, 20), GROUP(nand_wen_clk, 2, 19), GROUP(nand_ren_clk, 2, 18), - GROUP(nand_dqs_0, 2, 27), - GROUP(nand_dqs_1, 2, 28), + GROUP(nand_dqs_15, 2, 27), + GROUP(nand_dqs_18, 2, 28), GROUP(sdxc_d0_c, 4, 30), GROUP(sdxc_d13_c, 4, 29), GROUP(sdxc_d47_c, 4, 28), @@ -739,8 +739,8 @@ static const char * const sdxc_c_groups[] = { static const char * const nand_groups[] = { "nand_io", "nand_io_ce0", "nand_io_ce1", "nand_io_rb0", "nand_ale", "nand_cle", - "nand_wen_clk", "nand_ren_clk", "nand_dqs_0", - "nand_dqs_1" + "nand_wen_clk", "nand_ren_clk", "nand_dqs_15", + "nand_dqs_18" }; static const char * const nor_groups[] = { -- cgit v1.2.3