lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 14 May 2014 21:20:29 +0100
From:	Mark Brown <broonie@...nel.org>
To:	James Ban <james.ban.opensource@...semi.com>
Cc:	Liam Girdwood <lgirdwood@...il.com>,
	Support Opensource <support.opensource@...semi.com>,
	LKML <linux-kernel@...r.kernel.org>,
	Guennadi Liakhovetski <g.liakhovetski@....de>,
	David Dajun Chen <david.chen@...semi.com>
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?

> +	/*
> +	 * 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.

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

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

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ