On Fri, Mar 28, 2014 at 01:39:34PM +0000, Mark Brown wrote: > On Thu, Mar 27, 2014 at 10:29:20PM +0100, Carlo Caione wrote: > > > +static int axp20x_set_suspend_voltage(struct regulator_dev *rdev, int uV) > > +{ > > + int sel = regulator_map_voltage_iterate(rdev, uV, uV); > > + > > + if (sel < 0) > > + return sel; > > + > > + return regulator_set_voltage_sel_regmap(rdev, sel); > > +} > > This is fairly obviously broken - it's overwriting the normal runtime > value, this will disrupt the running system if we want the value we use > on suspend is different to the value we want at runtime. Ok, silly question: isn't it exactly what we want? Set the voltage for the regulator when the system is suspended? > Think about it - if this was a sane thing to do the core would just do > it without needing driver specific code, we already know how to set the > voltage for the device. I thought it was because some regulators can have specific regs for managing the suspend mode. BTW, but then what is the difference between my code and (i.e.) the same routine in da9055-regulator.c? http://lxr.linux.no/linux+v3.13.5/drivers/regulator/da9055-regulator.c#L276 Thanks, -- Carlo Caione -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html