Skip to content

Commit befcded

Browse files
prabhakarladgeertu
authored andcommitted
pinctrl: renesas: rzg2l: Introduce single macro for digital noise filter configuration
Support for enabling the digital noise filter, and support for configuring the noise filter stages (via the FILNUM register) and the sampling interval (via the FILCLKSEL register) are related: a pin supports either all or none of them. Hence simplify declaring digital noise filter support for a pin by using a single feature flag instead of three separate flags. This patch removes the PIN_CFG_FILNUM and PIN_CFG_FILCLKSEL configuration macros and renames PIN_CFG_FILONOFF to PIN_CFG_NF. Signed-off-by: Lad Prabhakar <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Geert Uytterhoeven <[email protected]>
1 parent dad83b9 commit befcded

File tree

1 file changed

+20
-32
lines changed

1 file changed

+20
-32
lines changed

drivers/pinctrl/renesas/pinctrl-rzg2l.c

Lines changed: 20 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -52,27 +52,23 @@
5252
#define PIN_CFG_IO_VMC_QSPI BIT(7)
5353
#define PIN_CFG_IO_VMC_ETH0 BIT(8)
5454
#define PIN_CFG_IO_VMC_ETH1 BIT(9)
55-
#define PIN_CFG_FILONOFF BIT(10)
56-
#define PIN_CFG_FILNUM BIT(11)
57-
#define PIN_CFG_FILCLKSEL BIT(12)
58-
#define PIN_CFG_IOLH_C BIT(13)
59-
#define PIN_CFG_SOFT_PS BIT(14)
60-
#define PIN_CFG_OEN BIT(15)
61-
#define PIN_CFG_NOGPIO_INT BIT(16)
62-
#define PIN_CFG_NOD BIT(17) /* N-ch Open Drain */
63-
#define PIN_CFG_SMT BIT(18) /* Schmitt-trigger input control */
64-
#define PIN_CFG_ELC BIT(19)
65-
#define PIN_CFG_IOLH_RZV2H BIT(20)
55+
#define PIN_CFG_NF BIT(10) /* Digital noise filter */
56+
#define PIN_CFG_IOLH_C BIT(11)
57+
#define PIN_CFG_SOFT_PS BIT(12)
58+
#define PIN_CFG_OEN BIT(13)
59+
#define PIN_CFG_NOGPIO_INT BIT(14)
60+
#define PIN_CFG_NOD BIT(15) /* N-ch Open Drain */
61+
#define PIN_CFG_SMT BIT(16) /* Schmitt-trigger input control */
62+
#define PIN_CFG_ELC BIT(17)
63+
#define PIN_CFG_IOLH_RZV2H BIT(18)
6664

6765
#define RZG2L_SINGLE_PIN BIT_ULL(63) /* Dedicated pin */
6866
#define RZG2L_VARIABLE_CFG BIT_ULL(62) /* Variable cfg for port pins */
6967

7068
#define RZG2L_MPXED_COMMON_PIN_FUNCS(group) \
7169
(PIN_CFG_IOLH_##group | \
7270
PIN_CFG_PUPD | \
73-
PIN_CFG_FILONOFF | \
74-
PIN_CFG_FILNUM | \
75-
PIN_CFG_FILCLKSEL)
71+
PIN_CFG_NF)
7672

7773
#define RZG2L_MPXED_PIN_FUNCS (RZG2L_MPXED_COMMON_PIN_FUNCS(A) | \
7874
PIN_CFG_SR)
@@ -85,10 +81,7 @@
8581
PIN_CFG_SR | \
8682
PIN_CFG_SMT)
8783

88-
#define RZG2L_MPXED_ETH_PIN_FUNCS(x) ((x) | \
89-
PIN_CFG_FILONOFF | \
90-
PIN_CFG_FILNUM | \
91-
PIN_CFG_FILCLKSEL)
84+
#define RZG2L_MPXED_ETH_PIN_FUNCS(x) ((x) | PIN_CFG_NF)
9285

9386
#define PIN_CFG_PIN_MAP_MASK GENMASK_ULL(61, 54)
9487
#define PIN_CFG_PIN_REG_MASK GENMASK_ULL(53, 46)
@@ -395,13 +388,13 @@ static const u64 r9a09g057_variable_pin_cfg[] = {
395388
#ifdef CONFIG_RISCV
396389
static const u64 r9a07g043f_variable_pin_cfg[] = {
397390
RZG2L_VARIABLE_PIN_CFG_PACK(20, 0, PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_PUPD |
398-
PIN_CFG_FILONOFF | PIN_CFG_FILNUM | PIN_CFG_FILCLKSEL |
391+
PIN_CFG_NF |
399392
PIN_CFG_IEN | PIN_CFG_NOGPIO_INT),
400393
RZG2L_VARIABLE_PIN_CFG_PACK(20, 1, PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_PUPD |
401-
PIN_CFG_FILONOFF | PIN_CFG_FILNUM | PIN_CFG_FILCLKSEL |
394+
PIN_CFG_NF |
402395
PIN_CFG_IEN | PIN_CFG_NOGPIO_INT),
403396
RZG2L_VARIABLE_PIN_CFG_PACK(20, 2, PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_PUPD |
404-
PIN_CFG_FILONOFF | PIN_CFG_FILNUM | PIN_CFG_FILCLKSEL |
397+
PIN_CFG_NF |
405398
PIN_CFG_IEN | PIN_CFG_NOGPIO_INT),
406399
RZG2L_VARIABLE_PIN_CFG_PACK(20, 3, PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_PUPD |
407400
PIN_CFG_IEN | PIN_CFG_NOGPIO_INT),
@@ -432,7 +425,7 @@ static const u64 r9a07g043f_variable_pin_cfg[] = {
432425
RZG2L_VARIABLE_PIN_CFG_PACK(24, 4, PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_PUPD |
433426
PIN_CFG_NOGPIO_INT),
434427
RZG2L_VARIABLE_PIN_CFG_PACK(24, 5, PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_PUPD |
435-
PIN_CFG_FILONOFF | PIN_CFG_FILNUM | PIN_CFG_FILCLKSEL |
428+
PIN_CFG_NF |
436429
PIN_CFG_NOGPIO_INT),
437430
};
438431
#endif
@@ -1887,17 +1880,15 @@ static const u64 r9a07g043_gpio_configs[] = {
18871880
#ifdef CONFIG_RISCV
18881881
/* Below additional port pins (P19 - P28) are exclusively available on RZ/Five SoC only */
18891882
RZG2L_GPIO_PORT_SPARSE_PACK(0x2, 0x06, PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_PUPD |
1890-
PIN_CFG_FILONOFF | PIN_CFG_FILNUM | PIN_CFG_FILCLKSEL |
1891-
PIN_CFG_IEN | PIN_CFG_NOGPIO_INT), /* P19 */
1883+
PIN_CFG_NF | PIN_CFG_IEN | PIN_CFG_NOGPIO_INT), /* P19 */
18921884
RZG2L_GPIO_PORT_PACK_VARIABLE(8, 0x07), /* P20 */
18931885
RZG2L_GPIO_PORT_SPARSE_PACK(0x2, 0x08, PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_PUPD |
18941886
PIN_CFG_IEN | PIN_CFG_NOGPIO_INT), /* P21 */
18951887
RZG2L_GPIO_PORT_PACK(4, 0x09, PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_PUPD |
18961888
PIN_CFG_IEN | PIN_CFG_NOGPIO_INT), /* P22 */
18971889
RZG2L_GPIO_PORT_SPARSE_PACK_VARIABLE(0x3e, 0x0a), /* P23 */
18981890
RZG2L_GPIO_PORT_PACK_VARIABLE(6, 0x0b), /* P24 */
1899-
RZG2L_GPIO_PORT_SPARSE_PACK(0x2, 0x0c, PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_FILONOFF |
1900-
PIN_CFG_FILNUM | PIN_CFG_FILCLKSEL |
1891+
RZG2L_GPIO_PORT_SPARSE_PACK(0x2, 0x0c, PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_NF |
19011892
PIN_CFG_NOGPIO_INT), /* P25 */
19021893
0x0, /* P26 */
19031894
0x0, /* P27 */
@@ -1975,8 +1966,7 @@ static const struct {
19751966
struct rzg2l_dedicated_configs rzg2l_pins[7];
19761967
} rzg2l_dedicated_pins = {
19771968
.common = {
1978-
{ "NMI", RZG2L_SINGLE_PIN_PACK(0x1, 0,
1979-
(PIN_CFG_FILONOFF | PIN_CFG_FILNUM | PIN_CFG_FILCLKSEL)) },
1969+
{ "NMI", RZG2L_SINGLE_PIN_PACK(0x1, 0, PIN_CFG_NF) },
19801970
{ "TMS/SWDIO", RZG2L_SINGLE_PIN_PACK(0x2, 0,
19811971
(PIN_CFG_IOLH_A | PIN_CFG_SR | PIN_CFG_IEN)) },
19821972
{ "TDO", RZG2L_SINGLE_PIN_PACK(0x3, 0,
@@ -2057,8 +2047,7 @@ static const struct {
20572047
};
20582048

20592049
static const struct rzg2l_dedicated_configs rzg3s_dedicated_pins[] = {
2060-
{ "NMI", RZG2L_SINGLE_PIN_PACK(0x0, 0, (PIN_CFG_FILONOFF | PIN_CFG_FILNUM |
2061-
PIN_CFG_FILCLKSEL)) },
2050+
{ "NMI", RZG2L_SINGLE_PIN_PACK(0x0, 0, PIN_CFG_NF) },
20622051
{ "TMS/SWDIO", RZG2L_SINGLE_PIN_PACK(0x1, 0, (PIN_CFG_IOLH_A | PIN_CFG_IEN |
20632052
PIN_CFG_SOFT_PS)) },
20642053
{ "TDO", RZG2L_SINGLE_PIN_PACK(0x1, 1, (PIN_CFG_IOLH_A | PIN_CFG_SOFT_PS)) },
@@ -2097,8 +2086,7 @@ static const struct rzg2l_dedicated_configs rzg3s_dedicated_pins[] = {
20972086
};
20982087

20992088
static struct rzg2l_dedicated_configs rzv2h_dedicated_pins[] = {
2100-
{ "NMI", RZG2L_SINGLE_PIN_PACK(0x1, 0, (PIN_CFG_FILONOFF | PIN_CFG_FILNUM |
2101-
PIN_CFG_FILCLKSEL)) },
2089+
{ "NMI", RZG2L_SINGLE_PIN_PACK(0x1, 0, PIN_CFG_NF) },
21022090
{ "TMS_SWDIO", RZG2L_SINGLE_PIN_PACK(0x3, 0, (PIN_CFG_IOLH_RZV2H | PIN_CFG_SR |
21032091
PIN_CFG_IEN)) },
21042092
{ "TDO", RZG2L_SINGLE_PIN_PACK(0x3, 2, (PIN_CFG_IOLH_RZV2H | PIN_CFG_SR)) },

0 commit comments

Comments
 (0)