|
57 | 57 | #define PIN_CFG_IOLH_C BIT(13)
|
58 | 58 | #define PIN_CFG_SOFT_PS BIT(14)
|
59 | 59 | #define PIN_CFG_OEN BIT(15)
|
60 |
| -#define PIN_CFG_VARIABLE BIT(16) |
61 |
| -#define PIN_CFG_NOGPIO_INT BIT(17) |
62 |
| -#define PIN_CFG_NOD BIT(18) /* N-ch Open Drain */ |
63 |
| -#define PIN_CFG_SMT BIT(19) /* Schmitt-trigger input control */ |
64 |
| -#define PIN_CFG_ELC BIT(20) |
65 |
| -#define PIN_CFG_IOLH_RZV2H BIT(21) |
| 60 | +#define PIN_CFG_NOGPIO_INT BIT(16) |
| 61 | +#define PIN_CFG_NOD BIT(17) /* N-ch Open Drain */ |
| 62 | +#define PIN_CFG_SMT BIT(18) /* Schmitt-trigger input control */ |
| 63 | +#define PIN_CFG_ELC BIT(19) |
| 64 | +#define PIN_CFG_IOLH_RZV2H BIT(20) |
66 | 65 |
|
67 | 66 | #define RZG2L_SINGLE_PIN BIT_ULL(63) /* Dedicated pin */
|
| 67 | +#define RZG2L_VARIABLE_CFG BIT_ULL(62) /* Variable cfg for port pins */ |
68 | 68 |
|
69 | 69 | #define RZG2L_MPXED_COMMON_PIN_FUNCS(group) \
|
70 | 70 | (PIN_CFG_IOLH_##group | \
|
|
100 | 100 | #define RZG2L_GPIO_PORT_SPARSE_PACK(m, a, f) (FIELD_PREP_CONST(PIN_CFG_PIN_MAP_MASK, (m)) | \
|
101 | 101 | FIELD_PREP_CONST(PIN_CFG_PIN_REG_MASK, (a)) | \
|
102 | 102 | FIELD_PREP_CONST(PIN_CFG_MASK, (f)))
|
| 103 | +#define RZG2L_GPIO_PORT_SPARSE_PACK_VARIABLE(m, a) \ |
| 104 | + (RZG2L_VARIABLE_CFG | \ |
| 105 | + RZG2L_GPIO_PORT_SPARSE_PACK(m, a, 0)) |
103 | 106 |
|
104 | 107 | /*
|
105 | 108 | * n indicates number of pins in the port, a is the register index
|
106 | 109 | * and f is pin configuration capabilities supported.
|
107 | 110 | */
|
108 | 111 | #define RZG2L_GPIO_PORT_PACK(n, a, f) RZG2L_GPIO_PORT_SPARSE_PACK((1ULL << (n)) - 1, (a), (f))
|
| 112 | +#define RZG2L_GPIO_PORT_PACK_VARIABLE(n, a) (RZG2L_VARIABLE_CFG | \ |
| 113 | + RZG2L_GPIO_PORT_PACK(n, a, 0)) |
109 | 114 |
|
110 | 115 | #define RZG2L_SINGLE_PIN_INDEX_MASK GENMASK_ULL(62, 56)
|
111 | 116 | #define RZG2L_SINGLE_PIN_BITS_MASK GENMASK_ULL(55, 53)
|
@@ -371,7 +376,7 @@ static u64 rzg2l_pinctrl_get_variable_pin_cfg(struct rzg2l_pinctrl *pctrl,
|
371 | 376 |
|
372 | 377 | if (FIELD_GET(VARIABLE_PIN_CFG_PORT_MASK, cfg) == port &&
|
373 | 378 | FIELD_GET(VARIABLE_PIN_CFG_PIN_MASK, cfg) == pin)
|
374 |
| - return (pincfg & ~PIN_CFG_VARIABLE) | FIELD_GET(PIN_CFG_MASK, cfg); |
| 379 | + return (pincfg & ~RZG2L_VARIABLE_CFG) | FIELD_GET(PIN_CFG_MASK, cfg); |
375 | 380 | }
|
376 | 381 |
|
377 | 382 | return 0;
|
@@ -1835,13 +1840,13 @@ static const u64 r9a07g043_gpio_configs[] = {
|
1835 | 1840 | RZG2L_GPIO_PORT_SPARSE_PACK(0x2, 0x06, PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_PUPD |
|
1836 | 1841 | PIN_CFG_FILONOFF | PIN_CFG_FILNUM | PIN_CFG_FILCLKSEL |
|
1837 | 1842 | PIN_CFG_IEN | PIN_CFG_NOGPIO_INT), /* P19 */
|
1838 |
| - RZG2L_GPIO_PORT_PACK(8, 0x07, PIN_CFG_VARIABLE), /* P20 */ |
| 1843 | + RZG2L_GPIO_PORT_PACK_VARIABLE(8, 0x07), /* P20 */ |
1839 | 1844 | RZG2L_GPIO_PORT_SPARSE_PACK(0x2, 0x08, PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_PUPD |
|
1840 | 1845 | PIN_CFG_IEN | PIN_CFG_NOGPIO_INT), /* P21 */
|
1841 | 1846 | RZG2L_GPIO_PORT_PACK(4, 0x09, PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_PUPD |
|
1842 | 1847 | PIN_CFG_IEN | PIN_CFG_NOGPIO_INT), /* P22 */
|
1843 |
| - RZG2L_GPIO_PORT_SPARSE_PACK(0x3e, 0x0a, PIN_CFG_VARIABLE), /* P23 */ |
1844 |
| - RZG2L_GPIO_PORT_PACK(6, 0x0b, PIN_CFG_VARIABLE), /* P24 */ |
| 1848 | + RZG2L_GPIO_PORT_SPARSE_PACK_VARIABLE(0x3e, 0x0a), /* P23 */ |
| 1849 | + RZG2L_GPIO_PORT_PACK_VARIABLE(6, 0x0b), /* P24 */ |
1845 | 1850 | RZG2L_GPIO_PORT_SPARSE_PACK(0x2, 0x0c, PIN_CFG_IOLH_B | PIN_CFG_SR | PIN_CFG_FILONOFF |
|
1846 | 1851 | PIN_CFG_FILNUM | PIN_CFG_FILCLKSEL |
|
1847 | 1852 | PIN_CFG_NOGPIO_INT), /* P25 */
|
@@ -1913,7 +1918,7 @@ static const u64 r9a09g057_gpio_configs[] = {
|
1913 | 1918 | PIN_CFG_ELC), /* P8 */
|
1914 | 1919 | RZG2L_GPIO_PORT_PACK(8, 0x29, RZV2H_MPXED_PIN_FUNCS), /* P9 */
|
1915 | 1920 | RZG2L_GPIO_PORT_PACK(8, 0x2a, RZV2H_MPXED_PIN_FUNCS), /* PA */
|
1916 |
| - RZG2L_GPIO_PORT_PACK(6, 0x2b, PIN_CFG_VARIABLE), /* PB */ |
| 1921 | + RZG2L_GPIO_PORT_PACK_VARIABLE(6, 0x2b), /* PB */ |
1917 | 1922 | };
|
1918 | 1923 |
|
1919 | 1924 | static const struct {
|
@@ -2637,7 +2642,7 @@ static int rzg2l_pinctrl_register(struct rzg2l_pinctrl *pctrl)
|
2637 | 2642 | if (i && !(i % RZG2L_PINS_PER_PORT))
|
2638 | 2643 | j++;
|
2639 | 2644 | pin_data[i] = pctrl->data->port_pin_configs[j];
|
2640 |
| - if (pin_data[i] & PIN_CFG_VARIABLE) |
| 2645 | + if (pin_data[i] & RZG2L_VARIABLE_CFG) |
2641 | 2646 | pin_data[i] = rzg2l_pinctrl_get_variable_pin_cfg(pctrl,
|
2642 | 2647 | pin_data[i],
|
2643 | 2648 | j,
|
|
0 commit comments