From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Anthony Olech <anthony.olech.opensource@diasemi.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [NEW DRIVER V1 5/7] DA9058 GPIO driver
Date: Thu, 2 Aug 2012 11:19:52 +0100 [thread overview]
Message-ID: <20120802101952.GG29157@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <201208020849.q728nhU3007824@latitude.olech.com>
On Thu, Aug 02, 2012 at 09:48:57AM +0100, Anthony Olech wrote:
> + mutex_lock(&gpio->lock);
> + ret = da9058_reg_read(da9058, DA9058_STATUSC_REG, &gpio_level);
> + mutex_unlock(&gpio->lock);
regmap already does locking for you.
> + ret = da9058_reg_read(da9058, DA9058_GPIO0001_REG, &gpio_cntrl);
> + if (ret)
> + goto exit;
> +
> + if (offset) {
> + gpio_cntrl &= ~0xF0;
> + gpio_cntrl |= 0xF0 & gpio->out_config;
> +
> + ret = da9058_reg_write(da9058, DA9058_GPIO0001_REG, gpio_cntrl);
Just use regmap_update_bits().
next prev parent reply other threads:[~2012-08-02 10:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-02 8:48 [NEW DRIVER V1 5/7] DA9058 GPIO driver Anthony Olech
2012-08-02 10:19 ` Mark Brown [this message]
2012-08-06 15:15 ` Opensource [Anthony Olech]
2012-08-07 17:14 ` Mark Brown
2012-08-08 7:52 ` Opensource [Anthony Olech]
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=20120802101952.GG29157@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=anthony.olech.opensource@diasemi.com \
--cc=linux-kernel@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).