From: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Milo Kim <milo.kim-l0cyMroinI0@public.gmane.org>
Cc: Jingoo Han <jg1.han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
Bryan Wu <cooloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Samuel Ortiz <sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Subject: Re: [PATCH 01/10] mfd: Add TI LMU driver
Date: Tue, 18 Feb 2014 08:21:27 +0000 [thread overview]
Message-ID: <20140218082127.GD20218@lee--X1> (raw)
In-Reply-To: <53030F9C.8000605-l0cyMroinI0@public.gmane.org>
> >>+static const struct resource lm3633_effect_resources[] = {
> >>+ {
> >>+ .name = LM3633_EFFECT_BL0_RAMPUP,
> >>+ .flags = IORESOURCE_REG,
> >>+ .start = LM3633_EFFECT_REGISTER(BL0_RAMPUP),
> >>+ },
<snip>
> >>+ {
> >>+ .name = LM3633_EFFECT_PTN_HIGHBRT,
> >>+ .flags = IORESOURCE_REG,
> >>+ .start = LM3633_EFFECT_REGISTER(HIGHBRT),
> >>+ },
> >>+};
> >
> >Can you define a MACRO to do all of these as one liners?
>
> Yes, resource definitions will be replaced by simple macro,
> LMU_EFFECT_RESOURCE().
>
> For example,
>
> #define LMU_EFFECT_RESOURCE(chip, effect) \
> { \
> .name = chip##_EFFECT_##effect, \
> .flags = IORESOURCE_REG, \
> .start = LMU_EFFECT_REGISTER(chip, effect), \
> }
>
> static const struct resource lm3633_effect_resources[] = {
> LMU_EFFECT_RESOURCE(LM3633, BL0_RAMPUP),
<snip>
> LMU_EFFECT_RESOURCE(LM3633, PTN_HIGHBRT),
> };
>
> and so on.
Yes, this is what I had in mind.
> >>+ pdata->en_gpio = of_get_named_gpio(node, "ti,enable-gpio", 0);
> >
> >There is a global DT property for this already.
>
> I've not found it yet, but I agree it looks like general property.
> So I'll replace "ti,enable-gpio" with "ti,lmu-en-gpio".
Just re-use "gpio-enable". No need for it to be vendor specific.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-02-18 8:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-14 6:30 [PATCH 01/10] mfd: Add TI LMU driver Milo Kim
[not found] ` <1392359450-6890-1-git-send-email-milo.kim-l0cyMroinI0@public.gmane.org>
2014-02-17 9:57 ` Lee Jones
2014-02-18 7:45 ` Milo Kim
[not found] ` <53030F9C.8000605-l0cyMroinI0@public.gmane.org>
2014-02-18 8:21 ` Lee Jones [this message]
2014-02-18 23:58 ` Milo Kim
2014-02-19 8:13 ` Lee Jones
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=20140218082127.GD20218@lee--X1 \
--to=lee.jones-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=cooloney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=jg1.han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=milo.kim-l0cyMroinI0@public.gmane.org \
--cc=sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.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).