pinctrl: intel: Read back TX buffer state
Subsystems (3)
PATCH 1/2 pinctrl: intel: Read back TX buffer state
In the same way as it's done in pinctrl-cherryview.c we would provide a readback TX buffer state.
--- drivers/pinctrl/intel/pinctrl-intel.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/pinctrl/intel/pinctrl-intel.c +6 -1
@@ -751,12 +751,17 @@ static int intel_gpio_get(struct gpio_chip *chip, unsigned offset) {struct intel_pinctrl *pctrl =gpiochip_get_data (chip);void __iomem *reg; +u32 padcfg0; reg =intel_get_padcfg (pctrl, offset,PADCFG0 );if (!reg)return -EINVAL ; -return !!(readl (reg) &PADCFG0_GPIORXSTATE ); + padcfg0 =readl (reg); +if (!(padcfg0 &PADCFG0_GPIOTXDIS )) +return !!(padcfg0 &PADCFG0_GPIOTXSTATE ); + +return !!(padcfg0 &PADCFG0_GPIORXSTATE ); }static void intel_gpio_set (struct gpio_chip *chip,unsigned offset,int value)
Signature · 1 line
2.14.1
RFC PATCH 2/2 pinctrl: intel: Decrease indentation in intel_gpio_set()
Decrease indentation in intel_gpio_set() to make it looking slightly better and be in align with intel_gpio_get().
--- drivers/pinctrl/intel/pinctrl-intel.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/pinctrl/intel/pinctrl-intel.c +12 -12
@@ -767,22 +767,22 @@ static int intel_gpio_get(struct gpio_chip *chip, unsigned offset)static void intel_gpio_set (struct gpio_chip *chip,unsigned offset,int value) {struct intel_pinctrl *pctrl =gpiochip_get_data (chip); +unsigned long flags;void __iomem *reg; +u32 padcfg0; reg =intel_get_padcfg (pctrl, offset,PADCFG0 ); -if (reg) { -unsigned long flags; -u32 padcfg0; +if (!reg) +return ; -raw_spin_lock_irqsave (&pctrl->lock, flags); - padcfg0 =readl (reg); -if (value) - padcfg0 |=PADCFG0_GPIOTXSTATE ; -else - padcfg0 &= ~PADCFG0_GPIOTXSTATE ; -writel (padcfg0, reg); -raw_spin_unlock_irqrestore (&pctrl->lock, flags); - } +raw_spin_lock_irqsave (&pctrl->lock, flags); + padcfg0 =readl (reg); +if (value) + padcfg0 |=PADCFG0_GPIOTXSTATE ; +else + padcfg0 &= ~PADCFG0_GPIOTXSTATE ; +writel (padcfg0, reg); +raw_spin_unlock_irqrestore (&pctrl->lock, flags); }static int intel_gpio_direction_input (struct gpio_chip *chip,unsigned offset)
Signature · 1 line
2.14.1
Quoted 6 lines · Andy Shevchenko
In the same way as it's done in
pinctrl-cherryview.cwe would provide a readback TX buffer state.Fixes 17fab473693 ("pinctrl: intel: Set pin direction properly")Reported-by "Bourque, Francis" <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>
Thanks Andy for taking care of this!
Re: [RFC, PATCH v1 2/2] pinctrl: intel: Decrease indentation in intel_gpio_set()
In reply to Andy ShevchenkoQuoted 4 lines · Andy Shevchenko
Decrease indentation in
intel_gpio_set()to make it looking slightly better and be in align withintel_gpio_get().Signed-off-by Andy Shevchenko <[email protected]>
No objections from me. Looks better this way :)
We tested on KBL-Y based design with a 4.12.3 kernel + patch
Francis Bourque
Platform Architect at Intel
Phone (503) 712-4558
-----Original Message-----
From: Andy Shevchenko [mailto:[email protected]]
Sent: Thursday, August 24, 2017 1:20 AM
To: Linus Walleij <[email protected]>; [email protected]; Mika Westerberg <[email protected]>; Heikki Krogerus <[email protected]>
Cc: Andy Shevchenko <[email protected]>; Bourque, Francis <[email protected]>
Subject: [PATCH v1 1/2] pinctrl: intel: Read back TX buffer state
In the same way as it's done in pinctrl-cherryview.c we would provide a readback TX buffer state.
--- drivers/pinctrl/intel/pinctrl-intel.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/pinctrl/intel/pinctrl-intel.c +6 -2
@@ -751,12 +751,17 @@ static int intel_gpio_get(struct gpio_chip *chip, unsigned offset) {struct intel_pinctrl *pctrl =gpiochip_get_data (chip);void __iomem *reg; +u32 padcfg0; reg =intel_get_padcfg (pctrl, offset,PADCFG0 );if (!reg)return -EINVAL ; -return !!(readl (reg) &PADCFG0_GPIORXSTATE ); + padcfg0 =readl (reg); +if (!(padcfg0 &PADCFG0_GPIOTXDIS )) +return !!(padcfg0 &PADCFG0_GPIOTXSTATE ); + +return !!(padcfg0 &PADCFG0_GPIORXSTATE ); }static void intel_gpio_set (struct gpio_chip *chip,unsigned offset,int value) --
2.14.1
Re: [RFC, PATCH v1 2/2] pinctrl: intel: Decrease indentation in intel_gpio_set()
In reply to Andy ShevchenkoQuoted 4 lines · Andy Shevchenko
Decrease indentation in
intel_gpio_set()to make it looking slightly better and be in align withintel_gpio_get().Signed-off-by Andy Shevchenko <[email protected]>
Patch applied with Mika's ACK.
Yours,
Linus Walleij
Quoted 6 lines · Andy Shevchenko
In the same way as it's done in
pinctrl-cherryview.cwe would provide a readback TX buffer state.Fixes 17fab473693 ("pinctrl: intel: Set pin direction properly")Reported-by "Bourque, Francis" <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>
Patch applied with the ACKs.
Yours,
Linus Walleij