pinctrl: tegra: Set specific GPIO compatible string
Subsystems (3)
PATCH v2 1/2 pinctrl: tegra: Set specific GPIO compatible string
From: Thierry Reding <[email protected]>
Rather than reuse the nvidia,tegra30-gpio compatible string to find the GPIO controller on Tegra30, Tegra114, Tegra124 and Tegra210, use the most specific compatible string for each SoC generation for consistency.
--- drivers/pinctrl/tegra/pinctrl-tegra114.c | 2 +- drivers/pinctrl/tegra/pinctrl-tegra124.c | 2 +- drivers/pinctrl/tegra/pinctrl-tegra210.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/pinctrl/tegra/pinctrl-tegra114.c +1 -1
@@ -1831,7 +1831,7 @@ static const struct tegra_pingroup tegra114_groups[] = {static const struct tegra_pinctrl_soc_data tegra114_pinctrl = { .ngpios =NUM_GPIOS , - .gpio_compatible ="nvidia,tegra30-gpio" , + .gpio_compatible ="nvidia,tegra114-gpio" , .pins = tegra114_pins, .npins =ARRAY_SIZE (tegra114_pins), .functions = tegra114_functions,
drivers/pinctrl/tegra/pinctrl-tegra124.c +1 -1
@@ -2043,7 +2043,7 @@ static const struct tegra_pingroup tegra124_groups[] = {static const struct tegra_pinctrl_soc_data tegra124_pinctrl = { .ngpios =NUM_GPIOS , - .gpio_compatible ="nvidia,tegra30-gpio" , + .gpio_compatible ="nvidia,tegra124-gpio" , .pins = tegra124_pins, .npins =ARRAY_SIZE (tegra124_pins), .functions = tegra124_functions,
drivers/pinctrl/tegra/pinctrl-tegra210.c +1 -1
@@ -1545,7 +1545,7 @@ static const struct tegra_pingroup tegra210_groups[] = {static const struct tegra_pinctrl_soc_data tegra210_pinctrl = { .ngpios =NUM_GPIOS , - .gpio_compatible ="nvidia,tegra30-gpio" , + .gpio_compatible ="nvidia,tegra210-gpio" , .pins = tegra210_pins, .npins =ARRAY_SIZE (tegra210_pins), .functions = tegra210_functions,
Signature · 1 line
2.21.0
PATCH v2 2/2 pinctrl: tegra: Add bitmask support for parked bits
From: Thierry Reding <[email protected]>
Some pin groups have park bits for multiple pins in one register. Support this by turning the parked bit field into a parked bitmask field. If no parked bits are supported, the bitmask can be 0.
Update the pingroup table on Tegra210, which is the only generation where this is supported, with the parked bitmask.
---
Changes in v2:
- write to mux_bank/mux_reg or drv_bank/drv_reg depending on pin
drivers/pinctrl/tegra/pinctrl-tegra.c | 18 +++++-- drivers/pinctrl/tegra/pinctrl-tegra.h | 4 +- drivers/pinctrl/tegra/pinctrl-tegra114.c | 4 +- drivers/pinctrl/tegra/pinctrl-tegra124.c | 4 +- drivers/pinctrl/tegra/pinctrl-tegra194.c | 4 +- drivers/pinctrl/tegra/pinctrl-tegra20.c | 6 +-- drivers/pinctrl/tegra/pinctrl-tegra210.c | 60 ++++++++++++------------ drivers/pinctrl/tegra/pinctrl-tegra30.c | 4 +- 8 files changed, 57 insertions(+), 47 deletions(-)
drivers/pinctrl/tegra/pinctrl-tegra.c +14 -4
@@ -613,10 +613,20 @@ static void tegra_pinctrl_clear_parked_bits(struct tegra_pmx *pmx)for (i =0 ; i < pmx->soc->ngroups; ++i) { g = &pmx->soc->groups[i]; -if (g->parked_bit >=0 ) { - val =pmx_readl (pmx, g->mux_bank, g->mux_reg); - val &= ~(1 << g->parked_bit); -pmx_writel (pmx, val, g->mux_bank, g->mux_reg); +if (g->parked_bitmask >0 ) { +unsigned int bank, reg; + +if (g->mux_reg !=-1 ) { + bank = g->mux_bank; + reg = g->mux_reg; + }else { + bank = g->drv_bank; + reg = g->drv_reg; + } + + val =pmx_readl (pmx, bank, reg); + val &= ~g->parked_bitmask; +pmx_writel (pmx, val, bank, reg); } } }
drivers/pinctrl/tegra/pinctrl-tegra.h +2 -2
@@ -96,7 +96,6 @@ struct tegra_function {* @tri_reg: Tri-state register offset. * @tri_bank: Tri-state register bank. * @tri_bit: Tri-state register bit. -* @parked_bit: Parked register bit. -1 if unsupported. * @einput_bit: Enable-input register bit. * @odrain_bit: Open-drain register bit. * @lock_bit: Lock register bit.
@@ -118,6 +117,7 @@ struct tegra_function {* @slwf_bit: Slew Falling register bit. * @slwf_width: Slew Falling field width. * @drvtype_bit: Drive type register bit. +* @parked_bitmask: Parked register mask. 0 if unsupported. * * -1 in a *_reg field means that feature is unsupported for this group. * *_bank and *_reg values are irrelevant when *_reg is -1.
@@ -146,7 +146,6 @@ struct tegra_pingroup { s32 mux_bit:6; s32 pupd_bit:6; s32 tri_bit:6; - s32 parked_bit:6; s32 einput_bit:6; s32 odrain_bit:6; s32 lock_bit:6;
@@ -164,6 +163,7 @@ struct tegra_pingroup { s32 drvup_width:6; s32 slwr_width:6; s32 slwf_width:6; +u32 parked_bitmask; };/**
drivers/pinctrl/tegra/pinctrl-tegra114.c +2 -2
@@ -1572,8 +1572,8 @@ static struct tegra_function tegra114_functions[] = { .lock_bit = 7, \ .ioreset_bit = PINGROUP_BIT_##ior(8), \ .rcv_sel_bit = PINGROUP_BIT_##rcv_sel(9), \ - .parked_bit = -1, \ .drv_reg = -1, \ + .parked_bitmask = 0, \ } #define DRV_PINGROUP(pg_name, r, hsm_b, schmitt_b, lpmd_b, drvdn_b, \
@@ -1593,7 +1593,6 @@ static struct tegra_function tegra114_functions[] = { .rcv_sel_bit = -1, \ .drv_reg = DRV_PINGROUP_REG(r), \ .drv_bank = 0, \ - .parked_bit = -1, \ .hsm_bit = hsm_b, \ .schmitt_bit = schmitt_b, \ .lpmd_bit = lpmd_b, \
@@ -1606,6 +1605,7 @@ static struct tegra_function tegra114_functions[] = { .slwf_bit = slwf_b, \ .slwf_width = slwf_w, \ .drvtype_bit = PINGROUP_BIT_##drvtype(6), \ + .parked_bitmask = 0, \ }static const struct tegra_pingroup tegra114_groups[] = {
drivers/pinctrl/tegra/pinctrl-tegra124.c +2 -2
@@ -1741,8 +1741,8 @@ static struct tegra_function tegra124_functions[] = { .lock_bit = 7, \ .ioreset_bit = PINGROUP_BIT_##ior(8), \ .rcv_sel_bit = PINGROUP_BIT_##rcv_sel(9), \ - .parked_bit = -1, \ .drv_reg = -1, \ + .parked_bitmask = 0, \ } #define DRV_PINGROUP(pg_name, r, hsm_b, schmitt_b, lpmd_b, drvdn_b, \
@@ -1762,7 +1762,6 @@ static struct tegra_function tegra124_functions[] = { .rcv_sel_bit = -1, \ .drv_reg = DRV_PINGROUP_REG(r), \ .drv_bank = 0, \ - .parked_bit = -1, \ .hsm_bit = hsm_b, \ .schmitt_bit = schmitt_b, \ .lpmd_bit = lpmd_b, \
@@ -1775,6 +1774,7 @@ static struct tegra_function tegra124_functions[] = { .slwf_bit = slwf_b, \ .slwf_width = slwf_w, \ .drvtype_bit = PINGROUP_BIT_##drvtype(6), \ + .parked_bitmask = 0, \ }#define MIPI_PAD_CTRL_PINGROUP (pg_name, r, b, f0, f1) \
drivers/pinctrl/tegra/pinctrl-tegra194.c +2 -2
@@ -87,7 +87,6 @@ static struct tegra_function tegra194_functions[] = { .lpmd_bit = -1, \ .lock_bit = -1, \ .hsm_bit = -1, \ - .parked_bit = -1, \ .mux_bank = bank, \ .mux_bit = 0, \ .pupd_reg = ((r)), \
@@ -100,7 +99,8 @@ static struct tegra_function tegra194_functions[] = { .odrain_bit = e_od, \ .schmitt_bit = schmitt_b, \ .drvtype_bit = 13, \ - .drv_reg = -1 + .drv_reg = -1, \ + .parked_bitmask = 0#define drive_pex_l5_clkreq_n_pgg0 \ DRV_PINGROUP_ENTRY_Y(0x14004, 12, 5, 20, 5, -1, -1, -1, -1, 0)
drivers/pinctrl/tegra/pinctrl-tegra20.c +3 -3
@@ -1989,13 +1989,13 @@ static struct tegra_function tegra20_functions[] = { .tri_reg = ((tri_r) - TRISTATE_REG_A), \ .tri_bank = 0, \ .tri_bit = tri_b, \ - .parked_bit = -1, \ .einput_bit = -1, \ .odrain_bit = -1, \ .lock_bit = -1, \ .ioreset_bit = -1, \ .rcv_sel_bit = -1, \ .drv_reg = -1, \ + .parked_bitmask = 0, \ }/* Pin groups with only pull up and pull down control */
@@ -2009,7 +2009,7 @@ static struct tegra_function tegra20_functions[] = { .pupd_bank = 2, \ .pupd_bit = pupd_b, \ .drv_reg = -1, \ - .parked_bit = -1, \ + .parked_bitmask = 0, \ }/* Pin groups for drive strength registers (configurable version) */
@@ -2025,7 +2025,7 @@ static struct tegra_function tegra20_functions[] = { .tri_reg = -1, \ .drv_reg = ((r) - PINGROUP_REG_A), \ .drv_bank = 3, \ - .parked_bit = -1, \ + .parked_bitmask = 0, \ .hsm_bit = hsm_b, \ .schmitt_bit = schmitt_b, \ .lpmd_bit = lpmd_b, \
drivers/pinctrl/tegra/pinctrl-tegra210.c +30 -30
92 lines not on this page · raw message
drivers/pinctrl/tegra/pinctrl-tegra30.c +2 -2
@@ -2133,8 +2133,8 @@ static struct tegra_function tegra30_functions[] = { .lock_bit = 7, \ .ioreset_bit = PINGROUP_BIT_##ior(8), \ .rcv_sel_bit = -1, \ - .parked_bit = -1, \ .drv_reg = -1, \ + .parked_bitmask = 0, \ } #define DRV_PINGROUP(pg_name, r, hsm_b, schmitt_b, lpmd_b, drvdn_b, \
@@ -2154,7 +2154,6 @@ static struct tegra_function tegra30_functions[] = { .rcv_sel_bit = -1, \ .drv_reg = DRV_PINGROUP_REG(r), \ .drv_bank = 0, \ - .parked_bit = -1, \ .hsm_bit = hsm_b, \ .schmitt_bit = schmitt_b, \ .lpmd_bit = lpmd_b, \
@@ -2167,6 +2166,7 @@ static struct tegra_function tegra30_functions[] = { .slwf_bit = slwf_b, \ .slwf_width = slwf_w, \ .drvtype_bit = -1, \ + .parked_bitmask = 0, \ }static const struct tegra_pingroup tegra30_groups[] = {
Signature · 1 line
2.21.0
Re: [PATCH v2 2/2] pinctrl: tegra: Add bitmask support for parked bits
21.06.2019 18:19, Thierry Reding пишет:
Quoted 6 lines
From: Thierry Reding <[email protected]>
Some pin groups have park bits for multiple pins in one register. Support this by turning the parked bit field into a parked bitmask field. If no parked bits are supported, the bitmask can be 0.
Quoted 7 lines
Update the pingroup table on Tegra210, which is the only generation where this is supported, with the parked bitmask.
Signed-off-by Thierry Reding <[email protected]>---
Changes in v2:
- write to mux_bank/mux_reg or drv_bank/drv_reg depending on pin
Looking great! Thank you!
For Tegra20/30
Re: [PATCH v2 2/2] pinctrl: tegra: Add bitmask support for parked bits
In reply to Thierry RedingQuoted 6 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Some pin groups have park bits for multiple pins in one register. Support this by turning the parked bit field into a parked bitmask field. If no parked bits are supported, the bitmask can be 0.
Quoted 7 lines
Update the pingroup table on Tegra210, which is the only generation where this is supported, with the parked bitmask.
Signed-off-by Thierry Reding <[email protected]>---
Changes in v2:
- write to mux_bank/mux_reg or drv_bank/drv_reg depending on pin
Patch applied with Dmitry's ACK.
Yours,
Linus Walleij
21.06.2019 18:19, Thierry Reding пишет:
Quoted 45 lines
From: Thierry Reding <[email protected]>
Rather than reuse the nvidia,tegra30-gpio compatible string to find the GPIO controller on Tegra30, Tegra114, Tegra124 and Tegra210, use the most specific compatible string for each SoC generation for consistency.
Signed-off-by Thierry Reding <[email protected]>--- drivers/pinctrl/tegra/pinctrl-tegra114.c | 2 +- drivers/pinctrl/tegra/pinctrl-tegra124.c | 2 +- drivers/pinctrl/tegra/pinctrl-tegra210.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)drivers/pinctrl/tegra/pinctrl-tegra114.c +1
-1@@ -1831,7 +1831,7 @@ static const struct tegra_pingroup tegra114_groups[] = {static const struct tegra_pinctrl_soc_data tegra114_pinctrl = { .ngpios =NUM_GPIOS , - .gpio_compatible ="nvidia,tegra30-gpio" , + .gpio_compatible ="nvidia,tegra114-gpio" , .pins = tegra114_pins, .npins =ARRAY_SIZE (tegra114_pins), .functions = tegra114_functions,drivers/pinctrl/tegra/pinctrl-tegra124.c +1
-1@@ -2043,7 +2043,7 @@ static const struct tegra_pingroup tegra124_groups[] = {static const struct tegra_pinctrl_soc_data tegra124_pinctrl = { .ngpios =NUM_GPIOS , - .gpio_compatible ="nvidia,tegra30-gpio" , + .gpio_compatible ="nvidia,tegra124-gpio" , .pins = tegra124_pins, .npins =ARRAY_SIZE (tegra124_pins), .functions = tegra124_functions,drivers/pinctrl/tegra/pinctrl-tegra210.c +0
-0
drivers/pinctrl/tegra/pinctrl-tegra210.c static const struct tegra_pingroup tegra210_groups[] = { · line 1551
Quoted 8 lines
drivers/pinctrl/tegra/pinctrl-tegra210.c +1
-1@@ -1545,7 +1545,7 @@ static const struct tegra_pingroup tegra210_groups[] = {static const struct tegra_pinctrl_soc_data tegra210_pinctrl = { .ngpios =NUM_GPIOS , - .gpio_compatible ="nvidia,tegra30-gpio" , + .gpio_compatible ="nvidia,tegra210-gpio" , .pins = tegra210_pins, .npins =ARRAY_SIZE (tegra210_pins), .functions = tegra210_functions,
Quoted 7 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Rather than reuse the nvidia,tegra30-gpio compatible string to find the GPIO controller on Tegra30, Tegra114, Tegra124 and Tegra210, use the most specific compatible string for each SoC generation for consistency.
Signed-off-by Thierry Reding <[email protected]>
Patch applied with Dmitry's ACK.
Yours,
Linus Walleij