Skip to content

Commit 725933a

Browse files
prabhakarladgeertu
authored andcommitted
pinctrl: renesas: rzg2l: Add support for configuring schmitt-trigger
Add support for configuring the multiplexed pins as schmitt-trigger inputs. Signed-off-by: Lad Prabhakar <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Tested-by: Claudiu Beznea <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Geert Uytterhoeven <[email protected]>
1 parent 9d75b70 commit 725933a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

drivers/pinctrl/renesas/pinctrl-rzg2l.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@
140140
#define PUPD(off) (0x1C00 + (off) * 8)
141141
#define ISEL(off) (0x2C00 + (off) * 8)
142142
#define NOD(off) (0x3000 + (off) * 8)
143+
#define SMT(off) (0x3400 + (off) * 8)
143144
#define SD_CH(off, ch) ((off) + (ch) * 4)
144145
#define ETH_POC(off, ch) ((off) + (ch) * 4)
145146
#define QSPI (0x3008)
@@ -162,6 +163,7 @@
162163
#define SR_MASK 0x01
163164
#define PUPD_MASK 0x03
164165
#define NOD_MASK 0x01
166+
#define SMT_MASK 0x01
165167

166168
#define PM_INPUT 0x1
167169
#define PM_OUTPUT 0x2
@@ -1352,6 +1354,15 @@ static int rzg2l_pinctrl_pinconf_get(struct pinctrl_dev *pctldev,
13521354
return -EINVAL;
13531355
break;
13541356

1357+
case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
1358+
if (!(cfg & PIN_CFG_SMT))
1359+
return -EINVAL;
1360+
1361+
arg = rzg2l_read_pin_config(pctrl, SMT(off), bit, SMT_MASK);
1362+
if (!arg)
1363+
return -EINVAL;
1364+
break;
1365+
13551366
case RENESAS_RZV2H_PIN_CONFIG_OUTPUT_IMPEDANCE:
13561367
if (!(cfg & PIN_CFG_IOLH_RZV2H))
13571368
return -EINVAL;
@@ -1490,6 +1501,13 @@ static int rzg2l_pinctrl_pinconf_set(struct pinctrl_dev *pctldev,
14901501
param == PIN_CONFIG_DRIVE_OPEN_DRAIN ? 1 : 0);
14911502
break;
14921503

1504+
case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
1505+
if (!(cfg & PIN_CFG_SMT))
1506+
return -EINVAL;
1507+
1508+
rzg2l_rmw_pin_config(pctrl, SMT(off), bit, SMT_MASK, arg);
1509+
break;
1510+
14931511
case RENESAS_RZV2H_PIN_CONFIG_OUTPUT_IMPEDANCE:
14941512
if (!(cfg & PIN_CFG_IOLH_RZV2H))
14951513
return -EINVAL;

0 commit comments

Comments
 (0)