mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Anthony Olech <anthony.olech.opensource@diasemi.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Linus Walleij <linus.walleij@stericsson.com>,
	LKML <linux-kernel@vger.kernel.org>,
	David Dajun Chen <david.chen@diasemi.com>,
	Samuel Ortiz <sameo@linux.intel.com>,
	Lee Jones <lee.jones@linaro.org>
Subject: Re: [NEW DRIVER V2 5/7] DA9058 GPIO driver
Date: Mon, 13 Aug 2012 14:46:39 +0100	[thread overview]
Message-ID: <20120813134638.GF13446@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <CACRpkdYLMRCuZoKPhEwyyoPonUY-mgLOxDvmnoCmCbCxiGHwcA@mail.gmail.com>

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);

  reply	other threads:[~2012-08-13 13:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-05 20:43 Anthony Olech
2012-08-13 13:09 ` Linus Walleij
2012-08-13 13:46   ` Mark Brown [this message]
2012-08-15 10:08   ` Opensource [Anthony Olech]
2012-08-15 15:01     ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120813134638.GF13446@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=anthony.olech.opensource@diasemi.com \
    --cc=david.chen@diasemi.com \
    --cc=grant.likely@secretlab.ca \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome