public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Milo Kim <milo.kim@ti.com>
Cc: Jingoo Han <jg1.han@samsung.com>, Bryan Wu <cooloney@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	Samuel Ortiz <sameo@linux.intel.com>
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@ti.com>

> >>+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

  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
2014-02-17  9:57 ` Lee Jones
2014-02-18  7:45   ` Milo Kim
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@linaro.org \
    --cc=broonie@kernel.org \
    --cc=cooloney@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jg1.han@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=milo.kim@ti.com \
    --cc=sameo@linux.intel.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