[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090514095700.GA28291@sirena.org.uk>
Date: Thu, 14 May 2009 10:57:01 +0100
From: Mark Brown <broonie@...nsource.wolfsonmicro.com>
To: Marek Szyprowski <m.szyprowski@...sung.com>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-arm-kernel@...ts.arm.linux.org.uk"
<linux-arm-kernel@...ts.arm.linux.org.uk>,
'Liam Girdwood' <lrg@...mlogic.co.uk>,
"kyungmin.park@...sung.com" <kyungmin.park@...sung.com>
Subject: Re: [PATCH] LP3971 PMIC regulator driver
On Thu, May 14, 2009 at 09:33:40AM +0200, Marek Szyprowski wrote:
> This patch adds regulator drivers for National Semiconductors LP3971 PMIC.
> This LP3971 PMIC controller has 3 DC/DC voltage converters and 5 low drop-out
> (LDO) regulators. LP3971 PMIC controller uses I2C interface.
>
> Reviewed-by: Kyungmin Park <kyungmin.park@...sung.com>
> Signed-off-by: Marek Szyprowski <m.szyprowski@...sung.com>
This looks basically good, a few comments below but personally I'd be
inclined to merge this as-is and deal with the remaining issues as
separate patches so:
Acked-by: Mark Brown <broonie@...nsource.wolfsonmicro.com>
It'd be good to also implement list_voltage().
> +static int lp3971_dcdc_get_voltage(struct regulator_dev *dev)
> +{
> + struct lp3971 *lp3971 = rdev_get_drvdata(dev);
> + int buck = rdev_get_id(dev) - LP3971_DCDC1;
> + u16 reg;
> + int val;
> +
> + reg = lp3971_reg_read(lp3971, LP3971_BUCK_TARGET_VOL1_REG(buck));
> + reg &= BUCK_TARGET_VOL_MASK;
> +
> + if (reg <= BUCK_TARGET_VOL_MAX_IDX)
> + val = 1000 * buck_voltage_map[reg];
> + else
> + val = 0;
I'd expect some kind of warning to be displayed here?
> + /* Detect LP3971 (initial system control 1 reg is '0x60') */
> + ret = lp3971_i2c_read(i2c, LP3971_SYS_CONTROL1_REG, 1, &val);
> + if (ret < 0) {
> + dev_err(&i2c->dev, "failed to detect device\n");
> + goto err_detect;
> + }
> +
You don't actually appear to check the value you read back here?
--
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