Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-18 Thread Jean-Christophe PLAGNIOL-VILLARD
On 07:58 Tue 18 Dec , Wolfgang Grandegger wrote: > On 12/18/2012 06:55 AM, Jean-Christophe PLAGNIOL-VILLARD wrote: > > On 20:47 Mon 17 Dec , Wolfgang Grandegger wrote: > >> On 12/17/2012 07:02 PM, Roland Stigge wrote: > >>> On 12/17/2012 06:37 PM, Wolfgang Grandegger wrote: > /* Do

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-18 Thread Jean-Christophe PLAGNIOL-VILLARD
On 07:58 Tue 18 Dec , Wolfgang Grandegger wrote: On 12/18/2012 06:55 AM, Jean-Christophe PLAGNIOL-VILLARD wrote: On 20:47 Mon 17 Dec , Wolfgang Grandegger wrote: On 12/17/2012 07:02 PM, Roland Stigge wrote: On 12/17/2012 06:37 PM, Wolfgang Grandegger wrote: /* Do synchronous data

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Wolfgang Grandegger
On 12/18/2012 06:55 AM, Jean-Christophe PLAGNIOL-VILLARD wrote: > On 20:47 Mon 17 Dec , Wolfgang Grandegger wrote: >> On 12/17/2012 07:02 PM, Roland Stigge wrote: >>> On 12/17/2012 06:37 PM, Wolfgang Grandegger wrote: /* Do synchronous data output with a single write access */

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Wolfgang Grandegger
On 12/17/2012 10:33 PM, Roland Stigge wrote: > On 17/12/12 20:47, Wolfgang Grandegger wrote: >> On 12/17/2012 07:02 PM, Roland Stigge wrote: >>> On 12/17/2012 06:37 PM, Wolfgang Grandegger wrote: /* Do synchronous data output with a single write access */ __raw_writel(~mask, pio +

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Jean-Christophe PLAGNIOL-VILLARD
On 20:47 Mon 17 Dec , Wolfgang Grandegger wrote: > On 12/17/2012 07:02 PM, Roland Stigge wrote: > > On 12/17/2012 06:37 PM, Wolfgang Grandegger wrote: > >>/* Do synchronous data output with a single write access */ > >>__raw_writel(~mask, pio + PIO_OWDR); > >>__raw_writel(mask, pio

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Roland Stigge
On 17/12/12 20:47, Wolfgang Grandegger wrote: > On 12/17/2012 07:02 PM, Roland Stigge wrote: >> On 12/17/2012 06:37 PM, Wolfgang Grandegger wrote: >>> /* Do synchronous data output with a single write access */ >>> __raw_writel(~mask, pio + PIO_OWDR); >>> __raw_writel(mask, pio +

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Wolfgang Grandegger
On 12/17/2012 07:02 PM, Roland Stigge wrote: > On 12/17/2012 06:37 PM, Wolfgang Grandegger wrote: >> /* Do synchronous data output with a single write access */ >> __raw_writel(~mask, pio + PIO_OWDR); >> __raw_writel(mask, pio + PIO_OWER); >> __raw_writel(val, pio + PIO_ODSR);

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Roland Stigge
On 12/17/2012 06:37 PM, Wolfgang Grandegger wrote: > /* Do synchronous data output with a single write access */ > __raw_writel(~mask, pio + PIO_OWDR); > __raw_writel(mask, pio + PIO_OWER); > __raw_writel(val, pio + PIO_ODSR); > > For caching we would need a storage. Not

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Wolfgang Grandegger
On 12/17/2012 06:15 PM, Roland Stigge wrote: > On 12/17/2012 05:28 PM, Wolfgang Grandegger wrote: >> On 12/17/2012 02:51 PM, Roland Stigge wrote: >>> Hi Wolfgang, And I guess Russell is right: If possible, we should write outputs simultaneously via ODSR (plus OWER/OWDR/OWSR) instead of

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Roland Stigge
On 12/17/2012 05:28 PM, Wolfgang Grandegger wrote: > On 12/17/2012 02:51 PM, Roland Stigge wrote: >> Hi Wolfgang, >>> And I guess Russell is right: If possible, we should write outputs >>> simultaneously via ODSR (plus OWER/OWDR/OWSR) instead of separate set/clear. >>> >>> I wonder if we need to

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Wolfgang Grandegger
On 12/17/2012 02:51 PM, Roland Stigge wrote: > Hi Wolfgang, > > On 12/17/2012 02:32 PM, Roland Stigge wrote: >> And I guess Russell is right: If possible, we should write outputs >> simultaneously via ODSR (plus OWER/OWDR/OWSR) instead of separate set/clear. >> >> I wonder if we need to

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Wolfgang Grandegger
On 12/17/2012 01:10 PM, Russell King - ARM Linux wrote: > On Mon, Dec 17, 2012 at 12:51:32PM +0100, Wolfgang Grandegger wrote: >> +static void at91_gpiolib_set_block(struct gpio_chip *chip, unsigned long >> mask, unsigned long val) >> +{ >> +struct at91_gpio_chip *at91_gpio =

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Roland Stigge
Hi Wolfgang, On 12/17/2012 02:32 PM, Roland Stigge wrote: > And I guess Russell is right: If possible, we should write outputs > simultaneously via ODSR (plus OWER/OWDR/OWSR) instead of separate set/clear. > > I wonder if we need to save/restore the state of OWSR at every write > operation or if

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Roland Stigge
On 12/17/2012 12:51 PM, Wolfgang Grandegger wrote: >>> Without having an AT91 available right now, I guess the hardware >>> interface of this GPIO chip is different from the GPIO block API. While >>> the hardware has clear and set registers, the val parameter of >>> at91_gpiolib_set_block() should

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Russell King - ARM Linux
On Mon, Dec 17, 2012 at 12:51:32PM +0100, Wolfgang Grandegger wrote: > +static void at91_gpiolib_set_block(struct gpio_chip *chip, unsigned long > mask, unsigned long val) > +{ > + struct at91_gpio_chip *at91_gpio = to_at91_gpio_chip(chip); > + void __iomem *pio = at91_gpio->regbase; > +

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Wolfgang Grandegger
On 12/17/2012 12:37 PM, Wolfgang Grandegger wrote: > Hi Roland, > > On 12/15/2012 12:49 AM, Roland Stigge wrote: >> Hi Wolfgang, >> >> thank you for the patch! >> >> On 14/12/12 18:58, Wolfgang Grandegger wrote: >>> +static void at91_gpiolib_set_block(struct gpio_chip *chip, unsigned long >>>

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Wolfgang Grandegger
Hi Roland, On 12/15/2012 12:49 AM, Roland Stigge wrote: > Hi Wolfgang, > > thank you for the patch! > > On 14/12/12 18:58, Wolfgang Grandegger wrote: >> +static void at91_gpiolib_set_block(struct gpio_chip *chip, unsigned long >> mask, unsigned long val) >> +{ >> +struct at91_gpio_chip

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Roland Stigge
On 12/17/2012 05:28 PM, Wolfgang Grandegger wrote: On 12/17/2012 02:51 PM, Roland Stigge wrote: Hi Wolfgang, And I guess Russell is right: If possible, we should write outputs simultaneously via ODSR (plus OWER/OWDR/OWSR) instead of separate set/clear. I wonder if we need to save/restore the

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Wolfgang Grandegger
On 12/17/2012 06:15 PM, Roland Stigge wrote: On 12/17/2012 05:28 PM, Wolfgang Grandegger wrote: On 12/17/2012 02:51 PM, Roland Stigge wrote: Hi Wolfgang, And I guess Russell is right: If possible, we should write outputs simultaneously via ODSR (plus OWER/OWDR/OWSR) instead of separate

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Roland Stigge
On 12/17/2012 06:37 PM, Wolfgang Grandegger wrote: /* Do synchronous data output with a single write access */ __raw_writel(~mask, pio + PIO_OWDR); __raw_writel(mask, pio + PIO_OWER); __raw_writel(val, pio + PIO_ODSR); For caching we would need a storage. Not sure if

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Wolfgang Grandegger
On 12/17/2012 07:02 PM, Roland Stigge wrote: On 12/17/2012 06:37 PM, Wolfgang Grandegger wrote: /* Do synchronous data output with a single write access */ __raw_writel(~mask, pio + PIO_OWDR); __raw_writel(mask, pio + PIO_OWER); __raw_writel(val, pio + PIO_ODSR); For

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Roland Stigge
On 17/12/12 20:47, Wolfgang Grandegger wrote: On 12/17/2012 07:02 PM, Roland Stigge wrote: On 12/17/2012 06:37 PM, Wolfgang Grandegger wrote: /* Do synchronous data output with a single write access */ __raw_writel(~mask, pio + PIO_OWDR); __raw_writel(mask, pio + PIO_OWER);

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Jean-Christophe PLAGNIOL-VILLARD
On 20:47 Mon 17 Dec , Wolfgang Grandegger wrote: On 12/17/2012 07:02 PM, Roland Stigge wrote: On 12/17/2012 06:37 PM, Wolfgang Grandegger wrote: /* Do synchronous data output with a single write access */ __raw_writel(~mask, pio + PIO_OWDR); __raw_writel(mask, pio +

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Wolfgang Grandegger
On 12/17/2012 10:33 PM, Roland Stigge wrote: On 17/12/12 20:47, Wolfgang Grandegger wrote: On 12/17/2012 07:02 PM, Roland Stigge wrote: On 12/17/2012 06:37 PM, Wolfgang Grandegger wrote: /* Do synchronous data output with a single write access */ __raw_writel(~mask, pio + PIO_OWDR);

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Wolfgang Grandegger
On 12/18/2012 06:55 AM, Jean-Christophe PLAGNIOL-VILLARD wrote: On 20:47 Mon 17 Dec , Wolfgang Grandegger wrote: On 12/17/2012 07:02 PM, Roland Stigge wrote: On 12/17/2012 06:37 PM, Wolfgang Grandegger wrote: /* Do synchronous data output with a single write access */

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Wolfgang Grandegger
Hi Roland, On 12/15/2012 12:49 AM, Roland Stigge wrote: Hi Wolfgang, thank you for the patch! On 14/12/12 18:58, Wolfgang Grandegger wrote: +static void at91_gpiolib_set_block(struct gpio_chip *chip, unsigned long mask, unsigned long val) +{ +struct at91_gpio_chip *at91_gpio =

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Wolfgang Grandegger
On 12/17/2012 12:37 PM, Wolfgang Grandegger wrote: Hi Roland, On 12/15/2012 12:49 AM, Roland Stigge wrote: Hi Wolfgang, thank you for the patch! On 14/12/12 18:58, Wolfgang Grandegger wrote: +static void at91_gpiolib_set_block(struct gpio_chip *chip, unsigned long mask, unsigned long

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Russell King - ARM Linux
On Mon, Dec 17, 2012 at 12:51:32PM +0100, Wolfgang Grandegger wrote: +static void at91_gpiolib_set_block(struct gpio_chip *chip, unsigned long mask, unsigned long val) +{ + struct at91_gpio_chip *at91_gpio = to_at91_gpio_chip(chip); + void __iomem *pio = at91_gpio-regbase; + u32

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Roland Stigge
On 12/17/2012 12:51 PM, Wolfgang Grandegger wrote: Without having an AT91 available right now, I guess the hardware interface of this GPIO chip is different from the GPIO block API. While the hardware has clear and set registers, the val parameter of at91_gpiolib_set_block() should be

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Roland Stigge
Hi Wolfgang, On 12/17/2012 02:32 PM, Roland Stigge wrote: And I guess Russell is right: If possible, we should write outputs simultaneously via ODSR (plus OWER/OWDR/OWSR) instead of separate set/clear. I wonder if we need to save/restore the state of OWSR at every write operation or if we

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Wolfgang Grandegger
On 12/17/2012 01:10 PM, Russell King - ARM Linux wrote: On Mon, Dec 17, 2012 at 12:51:32PM +0100, Wolfgang Grandegger wrote: +static void at91_gpiolib_set_block(struct gpio_chip *chip, unsigned long mask, unsigned long val) +{ +struct at91_gpio_chip *at91_gpio = to_at91_gpio_chip(chip);

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-17 Thread Wolfgang Grandegger
On 12/17/2012 02:51 PM, Roland Stigge wrote: Hi Wolfgang, On 12/17/2012 02:32 PM, Roland Stigge wrote: And I guess Russell is right: If possible, we should write outputs simultaneously via ODSR (plus OWER/OWDR/OWSR) instead of separate set/clear. I wonder if we need to save/restore the

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-15 Thread Russell King - ARM Linux
On Sat, Dec 15, 2012 at 12:49:57AM +0100, Roland Stigge wrote: > Without having an AT91 available right now, I guess the hardware > interface of this GPIO chip is different from the GPIO block API. While > the hardware has clear and set registers, the val parameter of > at91_gpiolib_set_block()

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-15 Thread Russell King - ARM Linux
On Sat, Dec 15, 2012 at 12:49:57AM +0100, Roland Stigge wrote: Without having an AT91 available right now, I guess the hardware interface of this GPIO chip is different from the GPIO block API. While the hardware has clear and set registers, the val parameter of at91_gpiolib_set_block() should

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-14 Thread Roland Stigge
Hi Wolfgang, thank you for the patch! On 14/12/12 18:58, Wolfgang Grandegger wrote: > +static void at91_gpiolib_set_block(struct gpio_chip *chip, unsigned long > mask, unsigned long val) > +{ > + struct at91_gpio_chip *at91_gpio = to_at91_gpio_chip(chip); > + void __iomem *pio =

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-14 Thread Wolfgang Grandegger
On 12/14/2012 03:26 PM, Roland Stigge wrote: > This set of patches adds: > > * Block GPIO API to gpiolib > * Sysfs support for GPIO API, to provide userland access > * Device interface for userland access (alternative to sysfs) > * Devicetree support to instantiate GPIO blocks via DT > * Example

[PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-14 Thread Roland Stigge
This set of patches adds: * Block GPIO API to gpiolib * Sysfs support for GPIO API, to provide userland access * Device interface for userland access (alternative to sysfs) * Devicetree support to instantiate GPIO blocks via DT * Example implementations in several gpio drivers since they need

[PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-14 Thread Roland Stigge
This set of patches adds: * Block GPIO API to gpiolib * Sysfs support for GPIO API, to provide userland access * Device interface for userland access (alternative to sysfs) * Devicetree support to instantiate GPIO blocks via DT * Example implementations in several gpio drivers since they need

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-14 Thread Wolfgang Grandegger
On 12/14/2012 03:26 PM, Roland Stigge wrote: This set of patches adds: * Block GPIO API to gpiolib * Sysfs support for GPIO API, to provide userland access * Device interface for userland access (alternative to sysfs) * Devicetree support to instantiate GPIO blocks via DT * Example

Re: [PATCH RESEND 0/6 v10] gpio: Add block GPIO

2012-12-14 Thread Roland Stigge
Hi Wolfgang, thank you for the patch! On 14/12/12 18:58, Wolfgang Grandegger wrote: +static void at91_gpiolib_set_block(struct gpio_chip *chip, unsigned long mask, unsigned long val) +{ + struct at91_gpio_chip *at91_gpio = to_at91_gpio_chip(chip); + void __iomem *pio =