Re: [PATCH v5 6/7] pinctrl: ingenic: Handle X2600 Port E Schmitt trigger

From: Paul Cercueil

Date: Wed Nov 25 2026 - 09:57:03 EST


Le mercredi 25 novembre 2026 à 15:51 +0100, H. Nikolaus Schaller a écrit :
> Hi Paul,
>
> > Am 25.11.2026 um 15:34 schrieb Paul Cercueil <paul@xxxxxxxxxxxxxxx>:
> >
> > Le mercredi 25 novembre 2026 à 07:49 +0100, H. Nikolaus Schaller a écrit :
> > > Port E has two Schmitt trigger configuration bits per pin.
> > > Select the lower-hysteresis mode when enabling and read both bits
> > > to report firmware-initialized settings.
> > >
> > > Signed-off-by: H. Nikolaus Schaller <hns@xxxxxxxxxxxxx>
> >
> > Reviewed-by: Paul Cercueil <paul@xxxxxxxxxxxxxxx>
> >
> > With one question below.
> >
> > > ---
> > >
> > > Notes:
> > >     Changes V5:
> > >     - Keep the ingenic_get_pin_config() call and the Port E
> > >       condition on single lines, as suggested by Paul Cercueil.
> > >
> > >  drivers/pinctrl/pinctrl-ingenic.c | 7 +++++++
> > >  1 file changed, 7 insertions(+)
> > >
> > > diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-
> > > ingenic.c
> > > index 88531d472cd2e..d253674accacd 100644
> > > --- a/drivers/pinctrl/pinctrl-ingenic.c
> > > +++ b/drivers/pinctrl/pinctrl-ingenic.c
> > > @@ -69,6 +69,7 @@
> > >  #define X2000_GPIO_PEPD 0x90
> > >  #define X2000_GPIO_SR 0xd0
> > >  #define X2000_GPIO_SMT 0xe0
> > > +#define X2600_GPIO_SMT1 0x100
> > >  
> > >  #define X2600_GPIO_SHADOW_OFFSET 0x800
> > >  #define X2600_GPIO_PAGLD (X2600_GPIO_SHADOW_OFFSET +
> > > 0xf0)
> > > @@ -4693,6 +4694,8 @@ static int ingenic_pinconf_get(struct pinctrl_dev
> > > *pctldev,
> > >   return -EINVAL;
> > >  
> > >   arg = !!ingenic_get_pin_config(jzpc, pin, reg);
> > > + if (is_soc(jzpc, ID_X2600) && offt == 4)
> > > + arg |= !!ingenic_get_pin_config(jzpc, pin,
> > > X2600_GPIO_SMT1);
> > >   break;
> > >  
> > >   case PIN_CONFIG_SLEW_RATE:
> > > @@ -4767,6 +4770,10 @@ static void ingenic_set_bias(struct ingenic_pinctrl
> > > *jzpc,
> > >  static void ingenic_set_schmitt_trigger(struct ingenic_pinctrl *jzpc,
> > >   unsigned int pin, bool enable)
> > >  {
> > > + /* Port E uses two bits; select the lower-hysteresis Schmitt mode. */
> > > + if (is_soc(jzpc, ID_X2600) && pin / PINS_PER_GPIO_CHIP == 4)
> > > + ingenic_config_pin(jzpc, pin, X2600_GPIO_SMT1, false);
> >
> > So on port E it will configure both X2600_GPIO_SMT1 and X2000_GPIO_SMT?
>
> Yes because the X2600 just adds one additional register SMT1 and I think
> it is not necessary to introduce a separate name and code for X2600_GPIO_SMT.
> And naming it X2000_GPIO_SMT1 would be wrong. So it is a compromise.

The register name is fine. I just wanted to make sure that it was correct that
ingenic_config_pin() is called twice.

-Paul