Re: [PATCH v2 2/2] MAX8997/8966 PMIC Regulator Driver Initial Release

From: MyungJoo Ham
Date: Mon Mar 07 2011 - 20:50:17 EST


On Sat, Mar 5, 2011 at 9:03 PM, Mark Brown
<broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> On Fri, Mar 04, 2011 at 03:50:27PM +0900, MyungJoo Ham wrote:

[]

>
>> +static int max8997_reg_enable_suspend(struct regulator_dev *rdev)
>> +{
>> + Â Â return 0;
>> +}
>> +
>
> This looks odd, especially since you have a disable operation?

The intention is to keep it enabled if it was enabled before entering
sleep and not to enable if it has not been using while the system is
running. Probably, we need three states for suspend-prepare for
regulators: disable, enable, keep_state?

>

[]

>
>> +static int max8997_resume(struct device *dev)
>> +{
>> + Â Â struct platform_device *pdev = container_of(dev,
>> + Â Â Â Â Â Â Â Â Â Â struct platform_device, dev);
>> + Â Â struct max8997_data *max8997 = platform_get_drvdata(pdev);
>> + Â Â struct i2c_client *i2c = max8997->iodev->i2c;
>> + Â Â struct regulator_dev *rdev;
>> + Â Â int ret, reg, mask, pattern;
>> + Â Â int i;
>> + Â Â u8 val;
>> +
>> + Â Â /* Show Error/Warning Messages for Inconsistency */
>> + Â Â for (i = 0; i < MAX8997_REG_MAX; i++) {
>> + Â Â Â Â Â Â if (max8997->saved_rdev[i]) {
>
> We should put this into the regulator core rather than doing it in
> drivers - it's not really driver specific and other regulators that
> can't preserve state over suspend and resume will need it.
>

This part was sort of "debug and test" part of the driver and removed
in the recent version of the patch.
However, the regulator core depends on calling
regulator_suspend_prepare by machine/architecture pm code and the core
does not have resume-related support. For that matter, I've made and
been using "regulator_suspend_finish" locally. I will post that patch
soon.



Thanks.


- MyungJoo
--
MyungJoo Ham (íëì), Ph.D.
Mobile Software Platform Lab,
Digital Media and Communications (DMC) Business
Samsung Electronics
cell: 82-10-6714-2858
--
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/