linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Opensource [James Seong-Won Ban]" <James.Ban.opensource@diasemi.com>
To: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Support Opensource <Support.Opensource@diasemi.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
	David Dajun Chen <david.chen@diasemi.com>
Subject: RE: [RESEND PATCH V1] regulator: DA9211 : new regulator driver
Date: Fri, 16 May 2014 01:52:27 +0000	[thread overview]
Message-ID: <8494A6313F8C244E9D54EBA065DD5ACF5ACD3E6C@SW-EX-MBX02.diasemi.com> (raw)
In-Reply-To: <20140514202029.GL12304@sirena.org.uk>

> -----Original Message-----
> From: Mark Brown [mailto:broonie@kernel.org]
> Sent: Thursday, May 15, 2014 5:20 AM
> To: Opensource [James Seong-Won Ban]
> Cc: Liam Girdwood; Support Opensource; LKML; Guennadi Liakhovetski;
> David Dajun Chen
> Subject: Re: [RESEND PATCH V1] regulator: DA9211 : new regulator driver
> 
> On Wed, May 14, 2014 at 04:02:34AM +0100, James Ban wrote:
> > This is the driver for the Dialog DA9211 Multi-phase 12A DC-DC Buck
> > Converter regulator. It communicates via an I2C bus to the device.
> 
> This looks a lot like the DA9210 driver, is there really no opportunity for code
> sharing here?
> 
DA9210 has only one buck. But DA9211 has two buck configuration.
And the register map is different between two driver.
So it is not possible to share the code. 

> > +	/*
> > +	 * There are two voltage register set A & B for voltage ramping but
> > +	 * either one of then can be active therefore we first determine
> > +	 * the active register set.
> > +	 */
> 
> I see this but...
> 
> > +	/* Select register set B for suspend voltage ramping. */
> > +	if (regulator->reg_rselect == DA9211_RSEL_NO_GPIO) {
> > +		ret = regmap_update_bits(chip->regmap, info->conf.reg,
> > +					info->conf.sel_mask,
> > +					DA9211_VBUCKA_SEL_B);
> > +		if (ret < 0)
> > +			return ret;
> > +	}
> 
> ..this fairly clearly says that suspend mode is set B and normal mode is set A.
> 
This is a case with no gpio configuration.
If gpio is configured, the active voltage A/B will be controlled by gpio.
Function da9211_regulator_get/set_voltage_sel  is designed for covering both cases.

> > +static int da9211_suspend_enable(struct regulator_dev *rdev) {
> > +	struct da9211_regulator *regulator = rdev_get_drvdata(rdev);
> > +	struct da9211_regulator_info *info = regulator->info;
> > +	struct da9211 *chip = regulator->da9211;
> > +
> > +	/* Select register set B for voltage ramping. */
> > +	if (regulator->reg_rselect == DA9211_RSEL_NO_GPIO)
> > +		return regmap_update_bits(chip->regmap, info->conf.reg,
> > +					info->conf.sel_mask,
> > +					DA9211_VBUCKA_SEL_B);
> > +	else
> > +		return 0;
> > +}
> 
> This looks like it will immediately shift to the suspend voltage but what this
> should do is set the voltage which will be set in suspend mode - something
> else (usually a hardware signal during suspend) should actually enter it.
> 
The output voltage A/B of DA9211 could be selected by a hardware signal or register.
So if there is no gpio configuration, B voltage channel should be selected during suspend mode.
If user wants to stay same voltage level at suspend mode in case of no gpio configuration,
user must set same voltage level at A/B register.

> > +int da9211_enable_irq(struct da9211 *chip, int irq) {
> > +	enable_irq(irq);
> > +
> > +	return 0;
> > +}
> > +EXPORT_SYMBOL_GPL(da9211_enable_irq);
> 
> > +int da9211_disable_irq(struct da9211 *chip, int irq) int
> > +da9211_mask_irq(struct da9211 *chip, int irq) int
> > +da9211_unmask_irq(struct da9211 *chip, int irq)
> 
> This looks bad...  similarly most of the rest of the interrupt code.
> What is it supposed to be doing?
Originally it is supposed for user to enable/disable various interrupt signal.
But indeed it seems a redundant code. The code will  be reorganized and submitted again. 

      reply	other threads:[~2014-05-16  1:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-14  3:02 [RESEND PATCH V1] regulator: DA9211 : new regulator driver James Ban
2014-05-14 20:20 ` Mark Brown
2014-05-16  1:52   ` Opensource [James Seong-Won Ban] [this message]

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=8494A6313F8C244E9D54EBA065DD5ACF5ACD3E6C@SW-EX-MBX02.diasemi.com \
    --to=james.ban.opensource@diasemi.com \
    --cc=Support.Opensource@diasemi.com \
    --cc=broonie@kernel.org \
    --cc=david.chen@diasemi.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.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).