RE: [NEW DRIVER V3 8/8] DA9058 REGULATOR driver

From: Opensource [Anthony Olech]
Date: Mon Sep 17 2012 - 06:29:40 EST


> -----Original Message-----
> From: Mark Brown [mailto:broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx]
> Sent: 27 August 2012 17:51
> To: Opensource [Anthony Olech]
> Cc: Liam Girdwood; Guenter Roeck; Jean Delvare; Randy Dunlap; LKML; David
> Dajun Chen
> Subject: Re: [NEW DRIVER V3 8/8] DA9058 REGULATOR driver
> On Wed, Aug 15, 2012 at 04:05:25PM +0100, Anthony Olech wrote:
> > +static int da9058_buck_ramp_voltage(struct regulator_dev *rdev,
> > + unsigned int old_selector,
> > + unsigned int new_selector)
> > +{
> > + ret = da9058_set_bits(da9058, regulator->ramp_register,
> > + regulator->ramp_enable_mask);
> > + if (ret)
> > + return ret;
> > + return 2200; /* micro Seconds needed to ramp to new voltage*/
> Why is this function writing to the hardware, especially writing the same value
> every time?


the ramp_register is DA9058_SUPPLY_REG and it is marked as volitile.
Writing to the ramp enable bit starts the voltage change. When the PMIC has
finished making the change it resets the bit. Thus to make another voltage
change the bit needs to be set again.


> > +static int da9058_get_fixed_regulator_voltage(struct regulator_dev
> > +*rdev) {
> > + struct da9058_regulator *regulator = rdev_get_drvdata(rdev);
> > +
> > + if (regulator_is_enabled_regmap(rdev))
> > + return regulator->fixed_voltage;
> > + else
> > + return 0;
> > +}
> list_voltage_linear()
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/