Re: [PATCH 1/3 v2] GPIO: gpio-dwapb: Enable platform driver binding to MFD driver

2014-09-09 Thread Shevchenko, Andriy
On Tue, 2014-09-09 at 01:50 +, Chen, Alvin wrote: > > On Friday 05 September 2014 12:02:01 Shevchenko, Andriy wrote: > > > > irq = irq_of_parse_and_map(node, 0); If (!irq) { > > > > pp->irq = -1; > > > > return; > > > > } else { > > > > pp->irq = irq; > > > > } > > > > Then the code looks stran

RE: [PATCH 1/3 v2] GPIO: gpio-dwapb: Enable platform driver binding to MFD driver

2014-09-08 Thread Chen, Alvin
> On Friday 05 September 2014 12:02:01 Shevchenko, Andriy wrote: > > > irq = irq_of_parse_and_map(node, 0); If (!irq) { > > > pp->irq = -1; > > > return; > > > } else { > > > pp->irq = irq; > > > } > > > Then the code looks strange. > > > > > > How do you think? > > > > If I understood correctly yo

RE: [PATCH 1/3 v2] GPIO: gpio-dwapb: Enable platform driver binding to MFD driver

2014-09-08 Thread Chen, Alvin
> > > > +#ifdef CONFIG_OF_GPIO > > + > > +static struct dwapb_platform_data * > > +dwapb_gpio_get_pdata_of(struct device *dev) { > > + struct device_node *node, *port_np; > > + struct dwapb_platform_data *pdata; > > + struct dwapb_port_property *pp; > > + int nports; > > + int i; > > + >

RE: [PATCH 1/3 v2] GPIO: gpio-dwapb: Enable platform driver binding to MFD driver

2014-09-06 Thread Chen, Alvin
> > > > > > - irq_set_chained_handler(irq, dwapb_irq_handler); > > > - irq_set_handler_data(irq, gpio); > > > + if (!pp->irq_shared) { > > > + irq_set_chained_handler(pp->irq, dwapb_irq_handler); > > > + irq_set_handler_data(pp->irq, gpio); > > > + } else { > > > + /* > > >

Re: [PATCH 1/3 v2] GPIO: gpio-dwapb: Enable platform driver binding to MFD driver

2014-09-05 Thread Sebastian Andrzej Siewior
On 2014-09-05 13:50:06 [+0200], Arnd Bergmann wrote: > On Friday 05 September 2014 07:53:16 Weike Chen wrote: > > > > - irq_set_chained_handler(irq, dwapb_irq_handler); > > - irq_set_handler_data(irq, gpio); > > + if (!pp->irq_shared) { > > + irq_set_chained_handler(pp->irq, dwapb

Re: [PATCH 1/3 v2] GPIO: gpio-dwapb: Enable platform driver binding to MFD driver

2014-09-05 Thread Arnd Bergmann
On Friday 05 September 2014 12:02:01 Shevchenko, Andriy wrote: > > irq = irq_of_parse_and_map(node, 0); > > If (!irq) { > > pp->irq = -1; > > return; > > } else { > > pp->irq = irq; > > } > > Then the code looks strange. > > > > How do you think? > > If I understood correctly you messed up with h

Re: [PATCH 1/3 v2] GPIO: gpio-dwapb: Enable platform driver binding to MFD driver

2014-09-05 Thread Shevchenko, Andriy
On Fri, 2014-09-05 at 10:20 +, Chen, Alvin wrote: > > > - port->bgc.gc.ngpio = ngpio; > > > - port->bgc.gc.of_node = port_np; > > > +#ifdef CONFIG_OF_GPIO > > > > Do we really need this #ifdef ? > > of_node will be NULL anyway, or I missed something? > Yes, otherwise, can't compile it. Please

Re: [PATCH 1/3 v2] GPIO: gpio-dwapb: Enable platform driver binding to MFD driver

2014-09-05 Thread Arnd Bergmann
On Friday 05 September 2014 07:53:16 Weike Chen wrote: > > - irq_set_chained_handler(irq, dwapb_irq_handler); > - irq_set_handler_data(irq, gpio); > + if (!pp->irq_shared) { > + irq_set_chained_handler(pp->irq, dwapb_irq_handler); > + irq_set_handler_data(pp->i

RE: [PATCH 1/3 v2] GPIO: gpio-dwapb: Enable platform driver binding to MFD driver

2014-09-05 Thread Chen, Alvin
> > -static void dwapb_irq_handler(u32 irq, struct irq_desc *desc) > > +static u32 _dwapb_irq_handler(struct dwapb_gpio *gpio) > > What about dwapb_do_irq() ? OK, I will improve it. > > +static irqreturn_t dwapb_irq_handler_mfd(int irq, void *dev_id) { > > + u32 worked; > > + struct dwapb_gpi

Re: [PATCH 1/3 v2] GPIO: gpio-dwapb: Enable platform driver binding to MFD driver

2014-09-05 Thread Shevchenko, Andriy
On Fri, 2014-09-05 at 07:53 -0700, Weike Chen wrote: > The Synopsys DesignWare APB GPIO driver only supports open firmware devices. > But, like Intel Quark X1000 SOC, which has a single PCI function exporting > a GPIO and an I2C controller, it is a Multifunction device. This patch is > to enable th