public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Ashish Jangam <Ashish.Jangam@kpitcummins.com>
Cc: "sameo@openedhand.com" <sameo@openedhand.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Dajun Chen <Dajun.Chen@diasemi.com>
Subject: Re: [PATCHv2 -next] MFD: MFD module of DA9052 PMIC driver
Date: Tue, 3 May 2011 15:44:42 +0100	[thread overview]
Message-ID: <20110503144441.GS1762@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <E2CAE7F7B064EA49B5CE7EE9A4BB167D151BA5AFBA@KCINPUNHJCMS01.kpit.com>

On Tue, May 03, 2011 at 07:30:54PM +0530, Ashish Jangam wrote:

> +int da9052_unmask_events(struct da9052 *da9052, unsigned int events)
> +{
> +       uint8_t v[4];
> +
> +       da9052->events_mask &= ~events;
> +
> +       v[0] = (da9052->events_mask & 0xff);
> +       v[1] = (da9052->events_mask >> 8) & 0xff;
> +       v[2] = (da9052->events_mask >> 16) & 0xff;
> +       v[3] = (da9052->events_mask >> 24) & 0xff;
> +
> +       return da9052_group_write(da9052, DA9052_IRQ_MASK_A_REG, 4, v);
> +}
> +
> +int da9052_mask_events(struct da9052 *da9052, unsigned int events)
> +{
> +       uint8_t v[4];
> +
> +       da9052->events_mask |= events;
> +
> +       v[0] = (da9052->events_mask & 0xff);
> +       v[1] = (da9052->events_mask >> 8) & 0xff;
> +       v[2] = (da9052->events_mask >> 16) & 0xff;
> +       v[3] = (da9052->events_mask >> 24) & 0xff;
> +
> +       return da9052_group_write(da9052, DA9052_IRQ_MASK_A_REG, 4, v);
> +}

My previous queries about why this is here and not in the IRQ code still
stand.

> +static void da9052_irq_sync_unlock(struct irq_data *data)
> +{
> +       struct da9052 *da9052 = irq_data_get_irq_chip_data(data);
> +       struct da9052_irq_data *irq_data = irq_to_da9052_irq(da9052,
> +                                               data->irq);
> +
> +       da9052_mask_events(da9052, irq_data->event);
> +       mutex_unlock(&da9052->irq_lock);

What happens if an event was enabled while the bus was locked?

  reply	other threads:[~2011-05-03 14:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-03 14:00 [PATCHv2 -next] MFD: MFD module of DA9052 PMIC driver Ashish Jangam
2011-05-03 14:44 ` Mark Brown [this message]
2011-05-09 10:33   ` Ashish Jangam
2011-05-09 12:40     ` Mark Brown

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=20110503144441.GS1762@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=Ashish.Jangam@kpitcummins.com \
    --cc=Dajun.Chen@diasemi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@openedhand.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