pinctrl: merge from mainline

PD#SWPL-15312

Change-Id: I46106dd8f154fedd6ac409e4e1e87aa6f00eaccf
Signed-off-by: Lei Qian <lei.qian@amlogic.com>
This commit is contained in:
Lei Qian
2019-10-17 13:50:25 +08:00
committed by Luke Go
parent 15cf4ac5d4
commit 1fd2cc2bfc
6 changed files with 2046 additions and 5 deletions

View File

@@ -55,6 +55,13 @@ config AMLOGIC_PINCTRL_MESON_TL1
select AMLOGIC_PINCONF_MESON_G12A
default n
config AMLOGIC_PINCTRL_MESON_TM2
bool "Meson tm2 SoC pinctrl driver"
depends on ARM64 || ARM64_A32
select AMLOGIC_PINCTRL_MESON_AXG_PMX
select AMLOGIC_PINCONF_MESON_G12A
default n
config AMLOGIC_PINCONF_MESON_G12A
bool

View File

@@ -12,3 +12,4 @@ obj-$(CONFIG_AMLOGIC_PINCTRL_MESON_TXLX) += pinctrl-meson-txlx.o
obj-$(CONFIG_AMLOGIC_PINCTRL_MESON_G12A) += pinctrl-meson-g12a.o
obj-$(CONFIG_AMLOGIC_PINCTRL_MESON_TXL) += pinctrl-meson-txl.o
obj-$(CONFIG_AMLOGIC_PINCTRL_MESON_TL1) += pinctrl-meson-tl1.o
obj-$(CONFIG_AMLOGIC_PINCTRL_MESON_TM2) += pinctrl-meson-tm2.o

View File

@@ -489,6 +489,53 @@ static const unsigned int clk12_24_z_pins[] = {GPIOZ_13};
static const unsigned int clk12_24_ao_pins[] = {GPIOAO_10};
static const unsigned int clk12_24_e_pins[] = {GPIOE_2};
/* introduce extra ee pin-groups for SM1 based on G12B */
/*sdcard x groupe*/
static const unsigned int sdcard_d0_x_pins[] = {GPIOX_0};
static const unsigned int sdcard_d1_x_pins[] = {GPIOX_1};
static const unsigned int sdcard_d2_x_pins[] = {GPIOX_2};
static const unsigned int sdcard_d3_x_pins[] = {GPIOX_3};
static const unsigned int sdcard_clk_x_pins[] = {GPIOX_4};
static const unsigned int sdcard_cmd_x_pins[] = {GPIOX_5};
/*i2c1 */
static const unsigned int i2c1_sda_z0_pins[] = {GPIOZ_0};
static const unsigned int i2c1_sck_z1_pins[] = {GPIOZ_1};
/* i2c2 */
static const unsigned int i2c2_sda_z10_pins[] = {GPIOZ_10};
static const unsigned int i2c2_sck_z11_pins[] = {GPIOZ_11};
/*tdmb*/
static const unsigned int tdmb_dout4_a_pins[] = {GPIOA_7};
static const unsigned int tdmb_dout5_a_pins[] = {GPIOA_8};
static const unsigned int tdmb_dout6_a_pins[] = {GPIOA_9};
static const unsigned int tdmb_dout7_a0_pins[] = {GPIOA_0};
static const unsigned int tdmb_dout7_a14_pins[] = {GPIOA_14};
/*tdmc*/
static const unsigned int tdmc_dout4_z_pins[] = {GPIOZ_9};
static const unsigned int tdmc_dout4_a_pins[] = {GPIOA_6};
static const unsigned int tdmc_dout5_z_pins[] = {GPIOZ_12};
static const unsigned int tdmc_dout5_a_pins[] = {GPIOA_5};
/*clk_32k*/
static const unsigned int clk_32k_pins[] = {GPIOAO_4};
/*clk_25ee*/
static const unsigned int clk_25ee_pins[] = {GPIOE_2};
/*world sync */
static const unsigned int world_sync_c_pins[] = {GPIOC_7};
static const unsigned int world_sync_a_pins[] = {GPIOA_14};
/*remote input */
static const unsigned int remote_input_a_pins[] = {GPIOA_15};
/*end of SM1*/
static struct meson_pmx_group meson_g12a_periphs_groups[] = {
GPIO_GROUP(GPIOV_0),
GPIO_GROUP(GPIOZ_0),
@@ -683,6 +730,12 @@ static struct meson_pmx_group meson_g12a_periphs_groups[] = {
GROUP(pwm_f_z, 5),
GROUP(clk12_24_z, 2),
GROUP(gen_clk_ee_z, 7),
GROUP(i2c1_sda_z0, 6),
GROUP(i2c1_sck_z1, 6),
GROUP(i2c2_sda_z10, 4),
GROUP(i2c2_sck_z11, 4),
GROUP(tdmc_dout4_z, 4),
GROUP(tdmc_dout5_z, 4),
/* bank GPIOX */
GROUP(sdio_d0, 1),
@@ -739,6 +792,12 @@ static struct meson_pmx_group meson_g12a_periphs_groups[] = {
GROUP(tdma_dout1, 1),
GROUP(mclk1_x, 2),
GROUP(gen_clk_ee_x, 7),
GROUP(sdcard_d0_x, 5),
GROUP(sdcard_d1_x, 5),
GROUP(sdcard_d2_x, 5),
GROUP(sdcard_d3_x, 5),
GROUP(sdcard_clk_x, 5),
GROUP(sdcard_cmd_x, 5),
/* bank GPIOC */
GROUP(sdcard_d0_c, 1),
@@ -767,6 +826,7 @@ static struct meson_pmx_group meson_g12a_periphs_groups[] = {
GROUP(pdm_din2_c, 4),
GROUP(pdm_din3_c, 4),
GROUP(pdm_dclk_c, 4),
GROUP(world_sync_c, 2),
/* bank GPIOH */
GROUP(spi1_mosi, 3),
@@ -838,6 +898,15 @@ static struct meson_pmx_group meson_g12a_periphs_groups[] = {
GROUP(mclk1_a, 2),
GROUP(pwm_d_a4, 3),
GROUP(pwm_f_a11, 3),
GROUP(tdmb_dout4_a, 7),
GROUP(tdmb_dout5_a, 7),
GROUP(tdmb_dout6_a, 7),
GROUP(tdmb_dout7_a0, 2),
GROUP(tdmb_dout7_a14, 7),
GROUP(tdmc_dout4_a, 7),
GROUP(tdmc_dout5_a, 7),
GROUP(world_sync_a, 1),
GROUP(remote_input_a, 1),
/* bank GPIOV */
GROUP(sdio_dummy, 1),
@@ -1017,6 +1086,8 @@ static struct meson_pmx_group meson_g12a_aobus_groups[] = {
GROUP(clk12_24_e, 2),
GROUP(gen_clk_ee_ao, 4),
GROUP(gen_clk_ao, 5),
GROUP(clk_32k, 2),
GROUP(clk_25ee, 2),
};
static const char * const gpio_periphs_groups[] = {
@@ -1080,6 +1151,8 @@ static const char * const sdcard_groups[] = {
"sdcard_clk_c", "sdcard_cmd_c",
"sdcard_d0_z", "sdcard_d1_z", "sdcard_d2_z", "sdcard_d3_z",
"sdcard_clk_z", "sdcard_cmd_z",
"sdcard_d0_x", "sdcard_d1_x", "sdcard_d2_x", "sdcard_d3_x",
"sdcard_clk_x", "sdcard_cmd_x",
};
static const char * const spi0_groups[] = {
@@ -1101,11 +1174,13 @@ static const char * const i2c1_groups[] = {
"i2c1_sda_x", "i2c1_sck_x",
"i2c1_sda_h2", "i2c1_sck_h3",
"i2c1_sda_h6", "i2c1_sck_h7",
"i2c1_sda_z0", "i2c1_sck_z1",
};
static const char * const i2c2_groups[] = {
"i2c2_sda_x", "i2c2_sck_x",
"i2c2_sda_z", "i2c2_sck_z",
"i2c2_sda_z10", "i2c2_sck_z11",
};
static const char * const i2c3_groups[] = {
@@ -1250,6 +1325,9 @@ static const char * const tdmb_out_groups[] = {
"tdmb_sclk", "tdmb_fs", "tdmb_dout0", "tdmb_dout1",
"tdmb_dout2", "tdmb_dout3_a", "tdmb_dout3_h",
"tdmb_slv_sclk", "tdmb_slv_fs",
"tdmb_dout4_a", "tdmb_dout5_a", "tdmb_dout6_a",
"tdmb_dout7_a0", "tdmb_dout7_a14",
};
static const char * const tdmc_in_groups[] = {
@@ -1264,6 +1342,7 @@ static const char * const tdmc_out_groups[] = {
"tdmc_dout2_a", "tdmc_dout3_a", "tdmc_slv_sclk_a", "tdmc_slv_fs_a",
"tdmc_sclk_z", "tdmc_fs_z", "tdmc_dout0_z", "tdmc_dout1_z",
"tdmc_dout2_z", "tdmc_dout3_z", "tdmc_slv_sclk_z", "tdmc_slv_fs_z",
"tdmc_dout4_z", "tdmc_dout4_a", "tdmc_dout5_a", "tdmc_dout5_z",
};
static const char * const remote_out_groups[] = {
@@ -1377,6 +1456,22 @@ static const char * const gen_clk_ao_groups[] = {
"gen_clk_ao",
};
static const char * const clk_32k_groups[] = {
"clk_32k",
};
static const char * const clk_25ee_groups[] = {
"clk_25ee",
};
static const char * const world_sync_groups[] = {
"world_sync",
};
static const char * const remote_input_groups[] = {
"remote_input_a",
};
static struct meson_pmx_func meson_g12a_periphs_functions[] = {
FUNCTION(gpio_periphs),
FUNCTION(emmc),
@@ -1422,6 +1517,8 @@ static struct meson_pmx_func meson_g12a_periphs_functions[] = {
FUNCTION(remote_out),
FUNCTION(clk12_24_ee),
FUNCTION(gen_clk_ee),
FUNCTION(world_sync),
FUNCTION(remote_input),
};
static struct meson_pmx_func meson_g12a_aobus_functions[] = {
@@ -1447,6 +1544,8 @@ static struct meson_pmx_func meson_g12a_aobus_functions[] = {
FUNCTION(clk12_24_ao),
FUNCTION(gen_clk_ee_ao),
FUNCTION(gen_clk_ao),
FUNCTION(clk_32k),
FUNCTION(clk_25ee),
};
static struct meson_bank meson_g12a_periphs_banks[] = {

View File

@@ -755,6 +755,7 @@ static const unsigned int ee_cec_pins[] = { GPIOAO_8 };
/*i2s_out_ao*/
static const unsigned int i2sout_ch23_ao8_pins[] = { GPIOAO_8 };
static const unsigned int i2sout_ch45_ao9_pins[] = { GPIOAO_9 };
static const unsigned int i2sout_ch67_tn_pins[] = { GPIO_TEST_N };
/*spdif_out_ao*/
static const unsigned int spdid_out_ao9_pins[] = { GPIOAO_9 };
@@ -793,13 +794,14 @@ static struct meson_pmx_group meson_gxl_aobus_groups[] = {
GROUP(ir_out_ao7, 0, 21),
GROUP(ao_cec, 0, 15),
GROUP(ee_cec, 0, 14),
GROUP(i2sout_ch23_ao8, 2, 0),
GROUP(i2sout_ch23_ao8, 1, 0),
GROUP(pwm_ao_a_ao8, 0, 17),
GROUP(ir_out_ao9, 0, 31),
GROUP(spdid_out_ao6, 0, 16),
GROUP(spdid_out_ao9, 0, 4),
GROUP(i2sout_ch45_ao9, 2, 1),
GROUP(i2sout_ch45_ao9, 1, 1),
GROUP(pwm_ao_b_ao9, 0, 3),
GROUP(i2sout_ch67_tn, 1, 2),
};
static const char * const gpio_periphs_groups[] = {
@@ -1093,6 +1095,7 @@ static const char * const pwm_ao_b_groups[] = {
static const char * const i2s_out_ao_groups[] = {
"i2sout_ch23_ao8", "i2sout_ch45_ao9",
"i2sout_ch67_tn",
};
static const char * const spdif_out_ao_groups[] = {

File diff suppressed because it is too large Load Diff

View File

@@ -667,8 +667,12 @@ static int meson_pinctrl_parse_dt(struct meson_pinctrl *pc,
pc->reg_gpio = meson_map_resource(pc, gpio_np, "gpio");
if (IS_ERR(pc->reg_gpio)) {
dev_err(pc->dev, "gpio registers not found\n");
return PTR_ERR(pc->reg_gpio);
if (PTR_ERR(pc->reg_gpio) == -ENOENT) {
pc->reg_gpio = pc->reg_mux;
} else {
dev_err(pc->dev, "gpio registers not found\n");
return PTR_ERR(pc->reg_gpio);
}
}
pc->reg_pull = meson_map_resource(pc, gpio_np, "pull");
@@ -696,7 +700,7 @@ static int meson_pinctrl_parse_dt(struct meson_pinctrl *pc,
pc->reg_drive = meson_map_resource(pc, gpio_np, "drive-strength");
if (IS_ERR(pc->reg_drive)) {
if (PTR_ERR(pc->reg_drive) == -ENOENT)
pc->reg_drive = NULL;
pc->reg_drive = pc->reg_pullen;
else {
dev_err(pc->dev, "drive-strength registers not found\n");
return PTR_ERR(pc->reg_drive);