[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120813134638.GF13446@opensource.wolfsonmicro.com>
Date: Mon, 13 Aug 2012 14:46:39 +0100
From: Mark Brown <broonie@...nsource.wolfsonmicro.com>
To: Linus Walleij <linus.walleij@...aro.org>
Cc: Anthony Olech <anthony.olech.opensource@...semi.com>,
Grant Likely <grant.likely@...retlab.ca>,
Linus Walleij <linus.walleij@...ricsson.com>,
LKML <linux-kernel@...r.kernel.org>,
David Dajun Chen <david.chen@...semi.com>,
Samuel Ortiz <sameo@...ux.intel.com>,
Lee Jones <lee.jones@...aro.org>
Subject: Re: [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);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists