linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: broonie@opensource.wolfsonmicro.com (Mark Brown)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] Samsung SoC ADC: use regulator (VDD for ADC).
Date: Mon, 20 Jun 2011 11:17:38 +0100	[thread overview]
Message-ID: <20110620101737.GA31864@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <BANLkTimHWJ=qgQOxQtBQd9u6-euf79PJTA@mail.gmail.com>

On Mon, Jun 20, 2011 at 02:16:59PM +0900, MyungJoo Ham wrote:
> On Sun, Jun 19, 2011 at 12:06 AM, Mark Brown
> > On Thu, Jun 16, 2011 at 05:30:02PM +0900, MyungJoo Ham wrote:

> >> + ? ? adc->vdd = regulator_get(dev, S3C_ADC_REGULATOR_NAME);

> > I'm not convinced that the #define for the name is terribly good style
> > here, especially given that you actually call it vdd in the code.

> Then, would it be fine to use as [ regulator_get(dev, "vdd"); ] ?

Yes.

> >> + ? ? if (IS_ERR_OR_NULL(adc->vdd)) {
> >> + ? ? ? ? ? ? dev_dbg(dev, "operating without regulator %s.\n", S3C_ADC_REGULATOR_NAME);
> >> + ? ? ? ? ? ? adc->vdd = NULL; /* Do not control regulator */
> >> + ? ? }
> >> +

> > No, don't do this. ?Just unconditionally assume the regulator is present
> > if power is essential for use of the device. ?The regulator API will
> > stub out correctly if it's not in use to allow things to proceed and if
> > vdd is genuinely not hooked up then the driver can't function.

> This ADC driver is for every ADC from S3C24xx series to Exynos4 (and
> its successors as well).
> The regulator (VDD for ADC) is essential for the recent chips
> (S5PC110, S5PV210, and Exynos4).
> I was just worried about the old boards using the same ADC driver
> (mach-s3c2410/mach-*.c, mach-s3c6410/mach-*.c, and so on) without
> ADC-VDD regulators defined.

If the regulator API is in use on a system it is reasonable to expect it
to be set up correctly for the system.

> However, no s3c compliance defconfigs have ever used CONFIG_REGULATOR.
> Thus, it seems that it's safe to enforce using "vdd" with regulators
> in plat-samsung's ADC driver.
> I'll proceed as you have commented.

Note that SMDK6410 and Cragganmore are both using regulators fairly
extensively.

  reply	other threads:[~2011-06-20 10:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-16  8:30 [PATCH 1/2] Samsung SoC ADC: use regulator (VDD for ADC) MyungJoo Ham
2011-06-16  8:30 ` [PATCH 2/2] Samsung SoC ADC: Channel selection for S5PV210, S5PC110, and Exynos4 MyungJoo Ham
2011-06-16  8:33   ` [PATCH] Samsung SoC ADC: register address definition for S5PV210/S5PC110/Exynos4 MyungJoo Ham
2011-06-16  8:47     ` [PATCH] Samsung SoC: header file revised to prevent declaring duplicated MyungJoo Ham
2011-06-22  9:10       ` Kukjin Kim
2011-06-18 15:06 ` [PATCH 1/2] Samsung SoC ADC: use regulator (VDD for ADC) Mark Brown
2011-06-20  5:16   ` MyungJoo Ham
2011-06-20 10:17     ` Mark Brown [this message]
2011-06-21  1:58       ` [PATCH v2 0/5] Update Samsung-SoC ADC (regulator / recent CPU support) MyungJoo Ham
2011-06-21  1:58         ` [PATCH v2 1/5] Samsung SoC ADC: use regulator (VDD for ADC) MyungJoo Ham
2011-06-21 10:43           ` Mark Brown
2011-06-22  2:40             ` MyungJoo Ham
2011-06-21  1:58         ` [PATCH v2 2/5] Samsung SoC ADC: Channel selection for S5PV210, S5PC110, and Exynos4 MyungJoo Ham
2011-06-29 13:42           ` Kukjin Kim
2011-06-30  7:50             ` MyungJoo Ham
2011-06-21  1:58         ` [PATCH v2 3/5] ARM: Exynos4: Support ADC MyungJoo Ham
2011-06-29 13:52           ` Kukjin Kim
2011-06-21  1:58         ` [PATCH v2 4/5] ARM: S5PC110/S5PV210: " MyungJoo Ham
2011-06-21  1:58         ` [PATCH v2 5/5] Samsung SoC: header file revised to prevent declaring duplicated MyungJoo Ham

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=20110620101737.GA31864@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=linux-arm-kernel@lists.infradead.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).