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] [day] [month] [year] [list]
Date:	Wed, 20 Apr 2011 16:17:26 +0100
From:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
To:	Jorge Eduardo Candelaria <jedu@...mlogic.co.uk>
Cc:	linux-kernel@...r.kernel.org, lrg@...com, sameo@...ux.intel.com,
	Graeme Gregory <gg@...mlogic.co.uk>
Subject: Re: [PATCHv3 4/4] TPS65910: Add tps65910 regulator driver

On Tue, Apr 19, 2011 at 08:27:35PM -0500, Jorge Eduardo Candelaria wrote:
> From: Graeme Gregory <gg@...mlogic.co.uk>
> 
> The regulator module consists of 3 DCDCs and 8 LDOs. The output
> voltages are configurable and are meant to supply power to the
> main processor and other components
> 
> Signed-off-by: Graeme Gregory <gg@...mlogic.co.uk>
> Signed-off-by: Jorge Eduardo Candelaria <jedu@...mlogic.co.uk>

This looks good except for some small nits:

> +		//voltage = pmic->info[id]->table[srvsel] * 100;
> +		voltage = (srvsel * 125 + 6000) * 100;

> +		//voltage = pmic->info[id]->table[opvsel] * 100;
> +		voltage = (opvsel * 125 + 6000) * 100;

Delete the old code.

> +	value = tps65910_reg_read(pmic, reg);
> +	if (value < 0)
> +		return value;
> +
> +	switch (id) {
> +	case TPS65910_REG_VIO:
> +	case TPS65910_REG_VDIG1:
> +	case TPS65910_REG_VDIG2:
> +	case TPS65910_REG_VPLL:
> +	case TPS65910_REG_VDAC:
> +	case TPS65910_REG_VAUX1:
> +	case TPS65910_REG_VAUX2:
> +	case TPS65910_REG_VAUX33:
> +	case TPS65910_REG_VMMC:
> +		value &= ~(LDO_SEL_MASK);
> +		value |= (selector << LDO_SEL_SHIFT);
> +		break;
> +	default:
> +		return -EINVAL;
> +	}
> +
> +	return tps65910_reg_write(pmic, reg, value);

This looks like you need a read/modify/write operation for setting
arbatrary bits rather than specifically setting or clearing.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ