From: Mark Brown <broonie@kernel.org>
To: Oder Chiou <oder_chiou@realtek.com>
Cc: bardliao@realtek.com, alsa-devel@alsa-project.org,
lgirdwood@gmail.com, flove@realtek.com
Subject: Re: [PATCH 2/2] ASoC: rt5677: Add the GPIO function
Date: Mon, 15 Sep 2014 14:46:42 -0700 [thread overview]
Message-ID: <20140915214641.GY7960@sirena.org.uk> (raw)
In-Reply-To: <1410782325-10541-2-git-send-email-oder_chiou@realtek.com>
[-- Attachment #1.1: Type: text/plain, Size: 551 bytes --]
On Mon, Sep 15, 2014 at 07:58:45PM +0800, Oder Chiou wrote:
> + switch (offset) {
> + case RT5677_GPIO1:
> + regmap_update_bits(rt5677->regmap, RT5677_GPIO_CTRL2,
> + RT5677_GPIO1_OUT_MASK, !!value << RT5677_GPIO1_OUT_SFT);
> + break;
All these functions could be cut down quite a bit - rather than having
individual switch statements for every single operation for every single
GPIO we can calculate the required shifts, we just need to look up the
register to write into (or calculate it). This would be much nicer from
a code point of view.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2014-09-15 21:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-15 11:58 [PATCH 1/2] ASoC: rt5677: Revise the wrong name in the header file Oder Chiou
2014-09-15 11:58 ` [PATCH 2/2] ASoC: rt5677: Add the GPIO function Oder Chiou
2014-09-15 21:46 ` Mark Brown [this message]
2014-09-15 21:49 ` [PATCH 1/2] ASoC: rt5677: Revise the wrong name in the header file 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=20140915214641.GY7960@sirena.org.uk \
--to=broonie@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=bardliao@realtek.com \
--cc=flove@realtek.com \
--cc=lgirdwood@gmail.com \
--cc=oder_chiou@realtek.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;
as well as URLs for NNTP newsgroup(s).