[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20110503174048.GF1762@opensource.wolfsonmicro.com>
Date: Tue, 3 May 2011 18:40:48 +0100
From: Mark Brown <broonie@...nsource.wolfsonmicro.com>
To: Jorge Eduardo Candelaria <jedu@...mlogic.co.uk>
Cc: linux-kernel@...r.kernel.org, sameo@...ux.intel.com, lrg@...com,
Graeme Gregory <gg@...mlogic.co.uk>, grant.likely@...retlab.ca
Subject: Re: [PATCH 2/5] regulator: tps65911: Add new chip version
On Tue, May 03, 2011 at 11:18:49AM -0500, Jorge Eduardo Candelaria wrote:
Mostly OK - a few small things.
> + if (id == TPS65910_REG_VDD1 || id == TPS65910_REG_VDD2) {
> + dcdc_mult = (selector / VDD1_2_NUM_VOLTS) + 1;
> + if (dcdc_mult == 1) dcdc_mult--;
> + vsel = (selector % VDD1_2_NUM_VOLTS) + 3;
> + } else {
> + vsel = selector;
> + }
Things like this should be switch statements.
> - volt = VDD1_2_MIN_VOLT + (selector % VDD1_2_NUM_VOLTS) * VDD1_2_OFFSET;
> + if (id == TPS65911_REG_VDDCTRL)
> + volt = VDDCTRL_MIN_VOLT + (selector * VDDCTRL_OFFSET);
> + else
> + mult = (selector / VDD1_2_NUM_VOLTS) + 1;
> + volt = VDD1_2_MIN_VOLT +
> + (selector % VDD1_2_NUM_VOLTS) * VDD1_2_OFFSET;
This doesn't tie in with the equivalent change in list_voltage() since
you're testing for a different regulator (but it looks OK from a quick
scan I *think*).
> + if (tps65910_chip_id(tps65910) == TPS65910) {
> + pmic->get_ctrl_reg = &tps65910_get_ctrl_register;
> + info = tps65910_regs;
> + } else if (tps65910_chip_id(tps65910) == TPS65911) {
> + pmic->get_ctrl_reg = &tps65911_get_ctrl_register;
> + info = tps65911_regs;
> + } else {
> + pr_err("Invalid tps chip version\n");
> + return -ENODEV;
> + }
switch statement.
--
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