Messages in this thread | | | Date | Tue, 03 May 2011 09:31:16 -0700 | From | Stephen Boyd <> | Subject | Re: [PATCH 2/5] regulator: tps65911: Add new chip version |
| |
On 05/03/2011 09:18 AM, Jorge Eduardo Candelaria wrote: > @@ -419,17 +541,21 @@ static int tps65910_get_voltage_dcdc(struct regulator_dev *dev) > mult=1; > > if (sr) { > - /* Valid range is 3-75 so normalise */ > - if (srvsel < 3) srvsel = 3; > - if (srvsel > 75) srvsel = 75; > + /* normalise to valid range */ > + if (srvsel < 3) > + srvsel = 3; > + if (srvsel > vselmax) > + srvsel = vselmax; > srvsel -= 3; > > voltage = (srvsel * VDD1_2_OFFSET + VDD1_2_MIN_VOLT) * 100; > } else { > > - /* Valid range is 3-75 so normalise */ > - if (opvsel < 3) opvsel = 3; > - if (opvsel > 75) opvsel = 75; > + /* normalise to valid range*/ > + if (opvsel < 3) > + opvsel = 3; > + if (opvsel > vselmax) > + opvsel = vselmax;
Can we use clamp() instead?
-- Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
| |