Re: [PATCH] pinctrl: intel: Implement intel_gpio_get_direction callback

2018-03-06 Thread Mika Westerberg
On Tue, Mar 06, 2018 at 04:56:05PM +0200, Andy Shevchenko wrote: > On Tue, 2018-03-06 at 14:31 +, Javier Arteaga wrote: > > (Fix Andy's Cc: - apologies) > > > > On 06/03/2018 13:42, Javier Arteaga wrote: > > > Allows querying GPIO direction from the pad config register. > > > If the pad is not

Re: [PATCH] pinctrl: intel: Implement intel_gpio_get_direction callback

2018-03-06 Thread Javier Arteaga
On 06/03/2018 14:59, Andy Shevchenko wrote: > On Tue, 2018-03-06 at 16:56 +0200, Andy Shevchenko wrote: >> On Tue, 2018-03-06 at 14:31 +, Javier Arteaga wrote: > +static int intel_gpio_get_direction(struct gpio_chip *chip, unsigned int offset) +{ > + if (padcfg0 & PADCFG0

Re: [PATCH] pinctrl: intel: Implement intel_gpio_get_direction callback

2018-03-06 Thread Andy Shevchenko
On Tue, 2018-03-06 at 16:56 +0200, Andy Shevchenko wrote: > On Tue, 2018-03-06 at 14:31 +, Javier Arteaga wrote: > > > +static int intel_gpio_get_direction(struct gpio_chip *chip, > > > unsigned int offset) > > > +{ > > > + if (padcfg0 & PADCFG0_PMODE_MASK) > > > + return -EINVAL; >

Re: [PATCH] pinctrl: intel: Implement intel_gpio_get_direction callback

2018-03-06 Thread Andy Shevchenko
On Tue, 2018-03-06 at 14:31 +, Javier Arteaga wrote: > (Fix Andy's Cc: - apologies) > > On 06/03/2018 13:42, Javier Arteaga wrote: > > Allows querying GPIO direction from the pad config register. > > If the pad is not in GPIO mode, return an error. > > > > Signed-off-by: Javier Arteaga > > -

Re: [PATCH] pinctrl: intel: Implement intel_gpio_get_direction callback

2018-03-06 Thread Javier Arteaga
(Fix Andy's Cc: - apologies) On 06/03/2018 13:42, Javier Arteaga wrote: > Allows querying GPIO direction from the pad config register. > If the pad is not in GPIO mode, return an error. > > Signed-off-by: Javier Arteaga > --- > This is needed by the drivers for the UP Squared board, an APL-based