All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukasz Majewski <l.majewski@samsung.com>
To: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: linux-kernel@vger.kernel.org,
	Samuel Ortiz <sameo@linux.intel.com>,
	Liam Girdwood <lrg@slimlogic.co.uk>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Alessandro Zummo <a.zummo@towertech.it>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Joonyoung Shim <jy0922.shim@samsung.com>,
	myungjoo.ham@gmail.com
Subject: Re: [PATCH v4 2/3] regulator MAX8998/LP3974: Support DVS-GPIO.
Date: Tue, 04 Jan 2011 08:49:04 +0100	[thread overview]
Message-ID: <20110104084904.5765cd9e@lmajewski.digital.local> (raw)
In-Reply-To: <1294118261-18906-3-git-send-email-myungjoo.ham@samsung.com>

On Tue, 04 Jan 2011 14:17:40 +0900
MyungJoo Ham <myungjoo.ham@samsung.com> wrote:

Hi all,

I've posted some comments below:

if (gpio_is_valid(pdata->buck2_set3)) {
> -			if (max8998->buck2_vol[0] == i) {
> -				max8998->buck2_idx = 0;
> -				buck2_gpio_set(pdata->buck2_set3, 0);
> -			} else {
> -				max8998->buck2_idx = 1;
> -				ret =
> max8998_get_voltage_register(rdev, &reg, -
> &shift,
> -
> &mask);
> -				ret = max8998_write_reg(i2c, reg, i);
> -				max8998->buck2_vol[1] = i;
> -				buck2_gpio_set(pdata->buck2_set3, 1);
> +
> +			/* check if requested voltage */
> +			/* value is already defined */
> +			for (j = 0; j <
> ARRAY_SIZE(max8998->buck2_vol); j++) {
> +				if (max8998->buck2_vol[j] == i) {
> +					max8998->buck2_idx = j;
> +
> buck2_gpio_set(pdata->buck2_set3, j);
> +					goto buck2_exit;
> +				}
>  			}
> +
> +			if (pdata->buck_voltage_lock)
> +				return -EINVAL;
> +
> +			max8998_get_voltage_register(rdev,
> +					&reg, &shift, &mask);
> +			ret = max8998_write_reg(i2c, reg, i);
> +			max8998->buck2_vol[max8998->buck2_idx] = i;
> +
> buck2_gpio_set(pdata->buck2_set3,max8998->buck2_idx); +buck2_exit:
> dev_dbg(max8998->dev, "%s: SET3:%d\n", i2c->name,
gpio_get_value(pdata->buck2_set3));

Maybe only the matter of taste. The "for" loop for only two elements?

> + * @buck_voltage_lock: Do NOT change the values of the following six
> + *   registers set by buck?_voltage?. The voltage of BUCK1/2 cannot
> + *   be other than the preset values.
> + * @buck1_voltage1: BUCK1 DVS mode 1 voltage register
> + * @buck1_voltage2: BUCK1 DVS mode 2 voltage register
> + * @buck1_voltage3: BUCK1 DVS mode 3 voltage register
> + * @buck1_voltage4: BUCK1 DVS mode 4 voltage register
> + * @buck2_voltage1: BUCK2 DVS mode 1 voltage register
> + * @buck2_voltage2: BUCK2 DVS mode 2 voltage register

Is it desirable to define all four for BUCK1 and two for BUCK2 DVS
voltages in platform code? 

Why the "general purpose" slots approach for user changeable/definable
voltages (as it was done previously) have been replaced? Is the current
approach faster?


-- 
Best regards,

Lukasz Majewski

Samsung Poland R&D Center
Platform Group

  reply	other threads:[~2011-01-04  7:49 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-23  8:53 [PATCH v3 0/4] MFD MAX8998/LP3974 Driver Update MyungJoo Ham
2010-12-23  8:53 ` [PATCH v3 1/4] MFD MAX8998/LP3974: Support Hibernation MyungJoo Ham
2010-12-24 11:38   ` Samuel Ortiz
2010-12-23  8:53 ` [PATCH v3 2/4] MFD MAX8998/LP3974: Support LP3974 RTC MyungJoo Ham
2010-12-24 11:38   ` Samuel Ortiz
2011-01-04  5:17     ` [PATCH v4 0/3] MFD MAX8998/LP3974 Driver Update MyungJoo Ham
2011-01-04  5:17     ` [PATCH v4 1/3] MFD MAX8998/LP3974: Support LP3974 RTC MyungJoo Ham
2011-01-04 13:40       ` Mark Brown
2011-01-11 11:22       ` Samuel Ortiz
2011-01-04  5:17     ` [PATCH v4 2/3] regulator MAX8998/LP3974: Support DVS-GPIO MyungJoo Ham
2011-01-04  7:49       ` Lukasz Majewski [this message]
2011-01-04  8:16         ` MyungJoo Ham
2011-01-04 13:44           ` Mark Brown
2011-01-11 11:22       ` Samuel Ortiz
2011-01-04  5:17     ` [PATCH v4 3/3] MFD MAX8998/LP3974: Support Charger MyungJoo Ham
2011-01-04 13:56       ` Mark Brown
2011-01-05  0:43         ` MyungJoo Ham
2011-01-14  5:22         ` [PATCH v5] " MyungJoo Ham
2011-01-18 11:37           ` Mark Brown
2010-12-23  8:53 ` [PATCH v3 3/4] regulator MAX8998/LP3974: Support DVS-GPIO MyungJoo Ham
2010-12-24 11:36   ` Samuel Ortiz
2011-01-02 13:56   ` Mark Brown
2010-12-23  8:53 ` [PATCH v3 4/4] MFD MAX8998/LP3974: Support Charger MyungJoo Ham
2010-12-24 11:37   ` Samuel Ortiz

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=20110104084904.5765cd9e@lmajewski.digital.local \
    --to=l.majewski@samsung.com \
    --cc=a.zummo@towertech.it \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=jy0922.shim@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=myungjoo.ham@gmail.com \
    --cc=myungjoo.ham@samsung.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 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.