From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Vladimir Zapolskiy <vz@mleia.com>,
"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Axel Lin <axel.lin@ingics.com>, Takashi Iwai <tiwai@suse.de>,
patches@opensource.wolfsonmicro.com,
Liam Girdwood <lgirdwood@gmail.com>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
Mark Brown <broonie@kernel.org>,
Alexandre Courbot <acourbot@nvidia.com>
Subject: Re: [alsa-devel] [PATCH 3/7] ASoC: wm8903: generalize GPIO control register bits
Date: Thu, 4 Jun 2015 09:47:36 +0100 [thread overview]
Message-ID: <20150604084736.GB3902@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <CACRpkdaGf+oQA3OF5HnVGXh5exz2L8RSye1Fj=r-=wzsMay_ag@mail.gmail.com>
On Thu, Jun 04, 2015 at 10:30:10AM +0200, Linus Walleij wrote:
> On Tue, Jun 2, 2015 at 1:09 AM, Vladimir Zapolskiy <vz@mleia.com> wrote:
>
> > All GPIO1/2/3/4/5 control registers have the same bit map, but in
> > implementation of gpiolib callbacks WM8903_GPn_*, WM8903_GP1_* and
> > WM8903_GP2_* macro are mixed up. Replace particular GPIOn control
> > register bit definitions with generic ones and save ~150 LoCs.
> >
> > No functional change.
> >
> > Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
> > Cc: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
> > Cc: Lars-Peter Clausen <lars@metafoo.de>
> > Cc: Axel Lin <axel.lin@ingics.com>
> > Cc: patches@opensource.wolfsonmicro.com
>
> This comment is not about the refactoring as such, which is OK...
>
> > +#define WM8903_GPn_FN_MASK 0x1F00 /* GPn_FN - [12:8] */
> > +#define WM8903_GPn_FN_SHIFT 8 /* GPn_FN - [12:8] */
> > +#define WM8903_GPn_FN_WIDTH 5 /* GPn_FN - [12:8] */
>
> Function selection?
>
> > +#define WM8903_GPn_PD 0x0008 /* GPn_PD */
> > +#define WM8903_GPn_PD_MASK 0x0008 /* GPn_PD */
> > +#define WM8903_GPn_PD_SHIFT 3 /* GPn_PD */
> > +#define WM8903_GPn_PD_WIDTH 1 /* GPn_PD */
> > +#define WM8903_GPn_PU 0x0004 /* GPn_PU */
> > +#define WM8903_GPn_PU_MASK 0x0004 /* GPn_PU */
> > +#define WM8903_GPn_PU_SHIFT 2 /* GPn_PU */
> > +#define WM8903_GPn_PU_WIDTH 1 /* GPn_PU */
>
> Pull-down/pull-up?
>
> That is pin control, not GPIO.
>
> I know I should probably be a bit relaxed on enforcing strict frameworks
> on ASoC and DRI/DRM alike, because the drivers are complex and sometimes
> need to be on top of things rather than split things apart and set up
> complex cobwebs of subsystem cross-dependencies, but I'd
> like to know a bit more about the design philisophy here.
>
> I guess this dates back to the time before the pin control subsystem?
>
Yeah this all dates back to before pin control, I have had some
initial looks at converting some of the newer drivers over to use
pin control instead but it is still very much a work in progress
and to be fair it is debatable when I will find time for older
drivers such as this one.
Thanks,
Charles
next prev parent reply other threads:[~2015-06-04 8:47 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-01 23:07 [PATCH 0/7] ASoC: remove bitwise operations on GPIO level value Vladimir Zapolskiy
2015-06-01 23:09 ` [PATCH 1/7] ASoC: rt5677: add GPIO helper macros Vladimir Zapolskiy
2015-06-02 5:23 ` Takashi Iwai
2015-06-01 23:09 ` [PATCH 2/7] ASoC: rt5677: clean up gpiolib callbacks Vladimir Zapolskiy
2015-06-02 19:38 ` Mark Brown
2015-06-02 20:39 ` Vladimir Zapolskiy
2015-06-02 20:50 ` Mark Brown
2015-06-02 21:54 ` Vladimir Zapolskiy
2015-06-03 11:38 ` Mark Brown
2015-06-01 23:09 ` [PATCH 3/7] ASoC: wm8903: generalize GPIO control register bits Vladimir Zapolskiy
2015-06-02 9:19 ` Charles Keepax
2015-06-04 8:30 ` Linus Walleij
2015-06-04 8:47 ` Charles Keepax [this message]
2015-06-04 9:19 ` Mark Brown
2015-06-04 9:24 ` Charles Keepax
2015-06-04 10:34 ` Mark Brown
2015-06-01 23:09 ` [PATCH 4/7] ASoC: wm8903: simplify gpiolib callbacks Vladimir Zapolskiy
2015-06-02 8:38 ` Charles Keepax
2015-06-02 19:41 ` Mark Brown
2015-06-02 20:18 ` Vladimir Zapolskiy
2015-06-02 20:31 ` Mark Brown
2015-06-02 20:41 ` Vladimir Zapolskiy
2015-06-01 23:09 ` [PATCH 5/7] ASoC: wm5100: remove bitwise operations involving GPIO level value Vladimir Zapolskiy
2015-06-02 8:40 ` Charles Keepax
2015-06-02 19:45 ` Mark Brown
2015-06-02 20:23 ` Vladimir Zapolskiy
2015-06-02 20:36 ` Mark Brown
2015-06-02 20:58 ` Vladimir Zapolskiy
2015-06-03 10:50 ` Trent Piepho
2015-06-03 11:07 ` Mark Brown
2015-06-03 19:13 ` [alsa-devel] " Vladimir Zapolskiy
2015-06-03 21:51 ` Trent Piepho
2015-06-03 22:58 ` Vladimir Zapolskiy
2015-06-01 23:09 ` [PATCH 6/7] ASoC: wm8962: " Vladimir Zapolskiy
2015-06-02 8:41 ` Charles Keepax
2015-06-01 23:09 ` [PATCH 7/7] ASoC: wm8996: " Vladimir Zapolskiy
2015-06-02 8:43 ` Charles Keepax
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=20150604084736.GB3902@opensource.wolfsonmicro.com \
--to=ckeepax@opensource.wolfsonmicro.com \
--cc=acourbot@nvidia.com \
--cc=alsa-devel@alsa-project.org \
--cc=axel.lin@ingics.com \
--cc=broonie@kernel.org \
--cc=lars@metafoo.de \
--cc=lgirdwood@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=patches@opensource.wolfsonmicro.com \
--cc=tiwai@suse.de \
--cc=vz@mleia.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).