[PATCH v4 3/3] gpio: add support for the Diolan DLN-2 USB GPIO driver

2014-09-09 Thread Octavian Purdila
From: Daniel Baluta This patch adds GPIO and IRQ support for the Diolan DLN-2 GPIO module. Information about the USB protocol interface can be found in the Programmer's Reference Manual [1], see section 2.9 for the GPIO module commands and responses. [1] https://www.diolan.com/downloads/dln-api

Re: [PATCH v4 3/3] gpio: add support for the Diolan DLN-2 USB GPIO driver

2014-09-18 Thread Johan Hovold
On Tue, Sep 09, 2014 at 10:24:46PM +0300, Octavian Purdila wrote: > +#define DLN2_GPIO_DIRECTION_IN 0 > +#define DLN2_GPIO_DIRECTION_OUT 1 > + > +static int dln2_gpio_get_direction(struct gpio_chip *chip, unsigned offset) > +{ > + int ret; > + struct dln2_gpio

Re: [PATCH v4 3/3] gpio: add support for the Diolan DLN-2 USB GPIO driver

2014-09-18 Thread Octavian Purdila
On Thu, Sep 18, 2014 at 1:54 PM, Johan Hovold wrote: > On Tue, Sep 09, 2014 at 10:24:46PM +0300, Octavian Purdila wrote: > > > >> +#define DLN2_GPIO_DIRECTION_IN 0 >> +#define DLN2_GPIO_DIRECTION_OUT 1 >> + >> +static int dln2_gpio_get_direction(struct gpio_chip *chip,

Re: [PATCH v4 3/3] gpio: add support for the Diolan DLN-2 USB GPIO driver

2014-09-18 Thread Johan Hovold
On Thu, Sep 18, 2014 at 03:43:07PM +0300, Octavian Purdila wrote: > On Thu, Sep 18, 2014 at 1:54 PM, Johan Hovold wrote: > > On Tue, Sep 09, 2014 at 10:24:46PM +0300, Octavian Purdila wrote: > > Either way, it looks like this could race with get_direction() if you > > get a set_direction() while

Re: [PATCH v4 3/3] gpio: add support for the Diolan DLN-2 USB GPIO driver

2014-09-18 Thread Octavian Purdila
On Thu, Sep 18, 2014 at 3:46 PM, Johan Hovold wrote: > On Thu, Sep 18, 2014 at 03:43:07PM +0300, Octavian Purdila wrote: >> On Thu, Sep 18, 2014 at 1:54 PM, Johan Hovold wrote: >> > On Tue, Sep 09, 2014 at 10:24:46PM +0300, Octavian Purdila wrote: > >> > Either way, it looks like this could race

Re: [PATCH v4 3/3] gpio: add support for the Diolan DLN-2 USB GPIO driver

2014-09-19 Thread Johan Hovold
On Thu, Sep 18, 2014 at 06:54:34PM +0300, Octavian Purdila wrote: > On Thu, Sep 18, 2014 at 3:46 PM, Johan Hovold wrote: > > On Thu, Sep 18, 2014 at 03:43:07PM +0300, Octavian Purdila wrote: > >> On Thu, Sep 18, 2014 at 1:54 PM, Johan Hovold wrote: > >> > On Tue, Sep 09, 2014 at 10:24:46PM +0300,