Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1306955 > unrolled thread

[PATCH] regulator: fan53555: fill set_suspend_enable/disable callback

Started byzhangqing <zhangqing@rock-chips.com>
First post2016-01-12 04:20 +0100
Last post2016-01-12 08:10 +0100
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] regulator: fan53555: fill set_suspend_enable/disable callback zhangqing <zhangqing@rock-chips.com> - 2016-01-12 04:20 +0100
    Re: [PATCH] regulator: fan53555: fill set_suspend_enable/disable callback Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-01-12 06:10 +0100
      Re: [PATCH] regulator: fan53555: fill set_suspend_enable/disable  callback zhangqing <zhangqing@rock-chips.com> - 2016-01-12 07:40 +0100
        Re: [PATCH] regulator: fan53555: fill set_suspend_enable/disable  callback Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-01-12 08:10 +0100

#1306955 — [PATCH] regulator: fan53555: fill set_suspend_enable/disable callback

Fromzhangqing <zhangqing@rock-chips.com>
Date2016-01-12 04:20 +0100
Subject[PATCH] regulator: fan53555: fill set_suspend_enable/disable callback
Message-ID<qPXEZ-3xb-1@gated-at.bofh.it>
Setting the set_suspend_enable/disable callback to support
enable and disable the dcdc when system is suspend.

Signed-off-by: zhangqing <zhangqing@rock-chips.com>
---
 drivers/regulator/fan53555.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
index 4940e82..2cb5cc3 100644
--- a/drivers/regulator/fan53555.c
+++ b/drivers/regulator/fan53555.c
@@ -114,6 +114,22 @@ static int fan53555_set_suspend_voltage(struct regulator_dev *rdev, int uV)
 	return 0;
 }
 
+static int fan53555_set_suspend_enable(struct regulator_dev *rdev)
+{
+	struct fan53555_device_info *di = rdev_get_drvdata(rdev);
+
+	return regmap_update_bits(di->regmap, di->sleep_reg,
+				  VSEL_BUCK_EN, VSEL_BUCK_EN);
+}
+
+static int fan53555_set_suspend_disable(struct regulator_dev *rdev)
+{
+	struct fan53555_device_info *di = rdev_get_drvdata(rdev);
+
+	return regmap_update_bits(di->regmap, di->sleep_reg,
+				  VSEL_BUCK_EN, 0);
+}
+
 static int fan53555_set_mode(struct regulator_dev *rdev, unsigned int mode)
 {
 	struct fan53555_device_info *di = rdev_get_drvdata(rdev);
@@ -192,6 +208,8 @@ static struct regulator_ops fan53555_regulator_ops = {
 	.set_mode = fan53555_set_mode,
 	.get_mode = fan53555_get_mode,
 	.set_ramp_delay = fan53555_set_ramp,
+	.set_suspend_enable = fan53555_set_suspend_enable,
+	.set_suspend_disable = fan53555_set_suspend_disable,
 };
 
 static int fan53555_voltages_setup_fairchild(struct fan53555_device_info *di)
-- 
1.9.1

[toc] | [next] | [standalone]


#1306986

FromKrzysztof Kozlowski <k.kozlowski@samsung.com>
Date2016-01-12 06:10 +0100
Message-ID<qPZnr-4Jw-7@gated-at.bofh.it>
In reply to#1306955
2016-01-12 20:05 GMT+09:00 zhangqing <zhangqing@rock-chips.com>:
> Setting the set_suspend_enable/disable callback to support
> enable and disable the dcdc when system is suspend.
>
> Signed-off-by: zhangqing <zhangqing@rock-chips.com>
> ---
>  drivers/regulator/fan53555.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
>
> diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
> index 4940e82..2cb5cc3 100644
> --- a/drivers/regulator/fan53555.c
> +++ b/drivers/regulator/fan53555.c
> @@ -114,6 +114,22 @@ static int fan53555_set_suspend_voltage(struct regulator_dev *rdev, int uV)
>         return 0;
>  }
>
> +static int fan53555_set_suspend_enable(struct regulator_dev *rdev)
> +{
> +       struct fan53555_device_info *di = rdev_get_drvdata(rdev);
> +
> +       return regmap_update_bits(di->regmap, di->sleep_reg,
> +                                 VSEL_BUCK_EN, VSEL_BUCK_EN);

You are just writing the enable_mask (BTW, just use the enable_mask,
not the value itself in such case) instead of enabling the suspend
mode. In the disable callback you are just disabling the regulator.

What do you want to achieve with these callbacks?

Best regards,
Krzysztof

> +}
> +
> +static int fan53555_set_suspend_disable(struct regulator_dev *rdev)
> +{
> +       struct fan53555_device_info *di = rdev_get_drvdata(rdev);
> +
> +       return regmap_update_bits(di->regmap, di->sleep_reg,
> +                                 VSEL_BUCK_EN, 0);
> +}
> +
>  static int fan53555_set_mode(struct regulator_dev *rdev, unsigned int mode)
>  {
>         struct fan53555_device_info *di = rdev_get_drvdata(rdev);
> @@ -192,6 +208,8 @@ static struct regulator_ops fan53555_regulator_ops = {
>         .set_mode = fan53555_set_mode,
>         .get_mode = fan53555_get_mode,
>         .set_ramp_delay = fan53555_set_ramp,
> +       .set_suspend_enable = fan53555_set_suspend_enable,
> +       .set_suspend_disable = fan53555_set_suspend_disable,
>  };
>
>  static int fan53555_voltages_setup_fairchild(struct fan53555_device_info *di)
> --
> 1.9.1
>
>

[toc] | [prev] | [next] | [standalone]


#1307009 — Re: [PATCH] regulator: fan53555: fill set_suspend_enable/disable callback

Fromzhangqing <zhangqing@rock-chips.com>
Date2016-01-12 07:40 +0100
SubjectRe: [PATCH] regulator: fan53555: fill set_suspend_enable/disable callback
Message-ID<qQ0My-5yb-13@gated-at.bofh.it>
In reply to#1306986

On 01/11/2016 09:03 PM, Krzysztof Kozlowski wrote:
> 2016-01-12 20:05 GMT+09:00 zhangqing <zhangqing@rock-chips.com>:
>> Setting the set_suspend_enable/disable callback to support
>> enable and disable the dcdc when system is suspend.
>>
>> Signed-off-by: zhangqing <zhangqing@rock-chips.com>
>> ---
>>   drivers/regulator/fan53555.c | 18 ++++++++++++++++++
>>   1 file changed, 18 insertions(+)
>>
>> diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
>> index 4940e82..2cb5cc3 100644
>> --- a/drivers/regulator/fan53555.c
>> +++ b/drivers/regulator/fan53555.c
>> @@ -114,6 +114,22 @@ static int fan53555_set_suspend_voltage(struct regulator_dev *rdev, int uV)
>>          return 0;
>>   }
>>
>> +static int fan53555_set_suspend_enable(struct regulator_dev *rdev)
>> +{
>> +       struct fan53555_device_info *di = rdev_get_drvdata(rdev);
>> +
>> +       return regmap_update_bits(di->regmap, di->sleep_reg,
>> +                                 VSEL_BUCK_EN, VSEL_BUCK_EN);
>
> You are just writing the enable_mask (BTW, just use the enable_mask,
> not the value itself in such case) instead of enabling the suspend
> mode. In the disable callback you are just disabling the regulator.
>
> What do you want to achieve with these callbacks?
        return regmap_update_bits(di->regmap, di->sleep_reg,
                                  VSEL_BUCK_EN, VSEL_BUCK_EN);
This callback is setting sleep_reg, setting this dcdc output is enable 
or disable when system enter sleep.
In our system this dcdc need disabled when sleep. But the current 
software not support.

>
> Best regards,
> Krzysztof
>
>> +}
>> +
>> +static int fan53555_set_suspend_disable(struct regulator_dev *rdev)
>> +{
>> +       struct fan53555_device_info *di = rdev_get_drvdata(rdev);
>> +
>> +       return regmap_update_bits(di->regmap, di->sleep_reg,
>> +                                 VSEL_BUCK_EN, 0);
>> +}
>> +
>>   static int fan53555_set_mode(struct regulator_dev *rdev, unsigned int mode)
>>   {
>>          struct fan53555_device_info *di = rdev_get_drvdata(rdev);
>> @@ -192,6 +208,8 @@ static struct regulator_ops fan53555_regulator_ops = {
>>          .set_mode = fan53555_set_mode,
>>          .get_mode = fan53555_get_mode,
>>          .set_ramp_delay = fan53555_set_ramp,
>> +       .set_suspend_enable = fan53555_set_suspend_enable,
>> +       .set_suspend_disable = fan53555_set_suspend_disable,
>>   };
>>
>>   static int fan53555_voltages_setup_fairchild(struct fan53555_device_info *di)
>> --
>> 1.9.1
>>
>>
>
>
>

[toc] | [prev] | [next] | [standalone]


#1307040 — Re: [PATCH] regulator: fan53555: fill set_suspend_enable/disable callback

FromKrzysztof Kozlowski <k.kozlowski@samsung.com>
Date2016-01-12 08:10 +0100
SubjectRe: [PATCH] regulator: fan53555: fill set_suspend_enable/disable callback
Message-ID<qQ1fA-5XB-7@gated-at.bofh.it>
In reply to#1307009
On 12.01.2016 23:28, zhangqing wrote:
> 
> 
> On 01/11/2016 09:03 PM, Krzysztof Kozlowski wrote:
>> 2016-01-12 20:05 GMT+09:00 zhangqing <zhangqing@rock-chips.com>:
>>> Setting the set_suspend_enable/disable callback to support
>>> enable and disable the dcdc when system is suspend.
>>>
>>> Signed-off-by: zhangqing <zhangqing@rock-chips.com>
>>> ---
>>>   drivers/regulator/fan53555.c | 18 ++++++++++++++++++
>>>   1 file changed, 18 insertions(+)
>>>
>>> diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
>>> index 4940e82..2cb5cc3 100644
>>> --- a/drivers/regulator/fan53555.c
>>> +++ b/drivers/regulator/fan53555.c
>>> @@ -114,6 +114,22 @@ static int fan53555_set_suspend_voltage(struct
>>> regulator_dev *rdev, int uV)
>>>          return 0;
>>>   }
>>>
>>> +static int fan53555_set_suspend_enable(struct regulator_dev *rdev)
>>> +{
>>> +       struct fan53555_device_info *di = rdev_get_drvdata(rdev);
>>> +
>>> +       return regmap_update_bits(di->regmap, di->sleep_reg,
>>> +                                 VSEL_BUCK_EN, VSEL_BUCK_EN);
>>
>> You are just writing the enable_mask (BTW, just use the enable_mask,
>> not the value itself in such case) instead of enabling the suspend
>> mode. In the disable callback you are just disabling the regulator.
>>
>> What do you want to achieve with these callbacks?
>        return regmap_update_bits(di->regmap, di->sleep_reg,
>                                  VSEL_BUCK_EN, VSEL_BUCK_EN);
> This callback is setting sleep_reg, setting this dcdc output is enable
> or disable when system enter sleep.
> In our system this dcdc need disabled when sleep. But the current
> software not support.
> 

I missed that the register is different - sleep_reg instead of
enable_reg. It makes sense and as this is separate register then usage
of desc->enable_mask is up to you, I think.

Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

Best regards,
Krzysztof

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web