All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Inderpal Singh <inderpal.singh@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org, kgene.kim@samsung.com,
	myungjoo.ham@samsung.com, Inderpal Singh <inderpal.s@samsung.com>
Subject: Re: [PATCH] ARM: EXYNOS4: Configure MAX8997 PMIC for Origen
Date: Wed, 17 Aug 2011 00:19:18 +0900	[thread overview]
Message-ID: <20110816151916.GA15484@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <CAG17yqTP+Amg_UhWNjwZ0x8bH+VzV82k3La5Y0fep9WRArbe+g@mail.gmail.com>

On Tue, Aug 16, 2011 at 04:38:46PM +0530, Inderpal Singh wrote:
> On 14 August 2011 20:31, Mark Brown <broonie@opensource.wolfsonmicro.com>wrote:
> > On Thu, Aug 11, 2011 at 09:26:05AM +0530, Inderpal Singh wrote:

> > > +static struct regulator_consumer_supply __initdata ldo7_consumer[] = {
> > > +     REGULATOR_SUPPLY("avdd", "soc-audio"), /* Reatek ALC5625*/
> > > +};

> > Ick, no.  The soc-audio device is a virtual device within Linux and is
> > being phased out, any driver adding new soc-audio devices will be
> > rejected.  The CODEC driver should deal with its own power.

> Ok. So does it mean that sound cards will have their own devices? And those
> device names should be listed as consumers?

As I said above "The CODEC driver should deal with its own power."

> > > +static struct i2c_board_info i2c0_devs[] __initdata = {
> > > +[I2C0_MAX8997] = {
> > > +     I2C_BOARD_INFO("max8997", (0xCC >> 1)),
> > > +     .platform_data = &origen_max8997_pdata,
> > > +     },
> > > +};

> > Why are you assigning the array index?  That's very unusual.

> Have seen this kind of initialisation at few places. It looked more
> readable.
> If its not preferred, I will remove it.

You shouldn't need to be looking up individual members in a board info
array in the first place.

> > > +     s3c_i2c0_set_platdata(NULL);
> > > +     i2c0_devs[I2C0_MAX8997].irq = gpio_to_irq(EXYNOS4_GPX0(4));

> > There should be defines to do this statically.

> What advantages do you see in using defines?

It's non-idiomatic to modify the I2C board info at runtime, all the
numbers are known at compile time anyway.

WARNING: multiple messages have this Message-ID (diff)
From: broonie@opensource.wolfsonmicro.com (Mark Brown)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: EXYNOS4: Configure MAX8997 PMIC for Origen
Date: Wed, 17 Aug 2011 00:19:18 +0900	[thread overview]
Message-ID: <20110816151916.GA15484@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <CAG17yqTP+Amg_UhWNjwZ0x8bH+VzV82k3La5Y0fep9WRArbe+g@mail.gmail.com>

On Tue, Aug 16, 2011 at 04:38:46PM +0530, Inderpal Singh wrote:
> On 14 August 2011 20:31, Mark Brown <broonie@opensource.wolfsonmicro.com>wrote:
> > On Thu, Aug 11, 2011 at 09:26:05AM +0530, Inderpal Singh wrote:

> > > +static struct regulator_consumer_supply __initdata ldo7_consumer[] = {
> > > +     REGULATOR_SUPPLY("avdd", "soc-audio"), /* Reatek ALC5625*/
> > > +};

> > Ick, no.  The soc-audio device is a virtual device within Linux and is
> > being phased out, any driver adding new soc-audio devices will be
> > rejected.  The CODEC driver should deal with its own power.

> Ok. So does it mean that sound cards will have their own devices? And those
> device names should be listed as consumers?

As I said above "The CODEC driver should deal with its own power."

> > > +static struct i2c_board_info i2c0_devs[] __initdata = {
> > > +[I2C0_MAX8997] = {
> > > +     I2C_BOARD_INFO("max8997", (0xCC >> 1)),
> > > +     .platform_data = &origen_max8997_pdata,
> > > +     },
> > > +};

> > Why are you assigning the array index?  That's very unusual.

> Have seen this kind of initialisation at few places. It looked more
> readable.
> If its not preferred, I will remove it.

You shouldn't need to be looking up individual members in a board info
array in the first place.

> > > +     s3c_i2c0_set_platdata(NULL);
> > > +     i2c0_devs[I2C0_MAX8997].irq = gpio_to_irq(EXYNOS4_GPX0(4));

> > There should be defines to do this statically.

> What advantages do you see in using defines?

It's non-idiomatic to modify the I2C board info at runtime, all the
numbers are known at compile time anyway.

  parent reply	other threads:[~2011-08-16 15:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-11  3:56 [PATCH] ARM: EXYNOS4: Configure MAX8997 PMIC for Origen Inderpal Singh
2011-08-11  3:56 ` Inderpal Singh
2011-08-14 15:01 ` Mark Brown
2011-08-14 15:01   ` Mark Brown
     [not found]   ` <CAG17yqTP+Amg_UhWNjwZ0x8bH+VzV82k3La5Y0fep9WRArbe+g@mail.gmail.com>
2011-08-16 15:19     ` Mark Brown [this message]
2011-08-16 15:19       ` Mark Brown
2011-08-17 10:50       ` Inderpal Singh
2011-08-17 10:50         ` Inderpal Singh
2011-08-22  6:39 ` [PATCH v2] " Inderpal Singh
2011-08-22  6:39   ` Inderpal Singh
2011-10-02  7:07   ` Kukjin Kim
2011-10-02  7:07     ` Kukjin Kim
2011-10-03  3:27   ` Kukjin Kim
2011-10-03  3:27     ` Kukjin Kim
2011-10-03  7:36     ` Inderpal Singh
2011-10-03  7:36       ` Inderpal Singh

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=20110816151916.GA15484@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=inderpal.s@samsung.com \
    --cc=inderpal.singh@linaro.org \
    --cc=kgene.kim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=myungjoo.ham@samsung.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.