lkml.org 
[lkml]   [2012]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [NEW DRIVER V2 5/7] DA9058 GPIO driver
On Mon, Aug 13, 2012 at 03:09:31PM +0200, Linus Walleij wrote:
> On Sun, Aug 5, 2012 at 10:43 PM, Anthony Olech

> > +#include <linux/regmap.h>

> If you're using regmap you better select it in Kconfig
> too, but it appears you don't. You should be using regmap in the
> main MFD driver in this case (I haven't looked at it though.)

For MFDs the MFD core should already be ensuring that regmap is
selected.

> > + gpio_cntrl |= 0x0F & gpio->out_config;

> > + ret = da9058_reg_write(da9058, DA9058_GPIO0001_REG, gpio_cntrl);

> Further, if you're checking that flag just in order to avoid doing this
> write if it's not necessary, it's the wrong solution. The right solution
> is to implement regmap in the MFD driver so it quickly sees that
> the right value is already in the register and bounces off.

Just using regmap_update_bits() will do the right thing.

> > + if (offset)
> > + return da9058_to_virt_irq_num(da9058, DA9058_IRQ_EGPI1);
> > + else
> > + return da9058_to_virt_irq_num(da9058, DA9058_IRQ_EGPI0);
> > +}

> Lee Jones and Mark Brown discussed these virtual IRQ mapping functions
> recently, and I think the outcome was to patch irqdomain to do the work
> and not sprinkle these custom interfaces to fetch virtual IRQs all over the
> place.

The easiest thing to do would be to pick the VIRQ numbers so that you
can just do

da9058_to_virt_irq_num(da9058, DA9058_IRQ_EGPI0 + offset);


\
 
 \ /
  Last update: 2012-08-13 16:42    [W:0.052 / U:0.560 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site