All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] regulator: fan53555: fill set_suspend_enable/disable callback
  2016-01-12 11:05 [PATCH] regulator: fan53555: fill set_suspend_enable/disable callback zhangqing
@ 2016-01-12  5:03 ` Krzysztof Kozlowski
  2016-01-12 14:28     ` zhangqing
  2016-01-15 18:19 ` Applied "regulator: fan53555: fill set_suspend_enable/disable callback" to the regulator tree Mark Brown
  1 sibling, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2016-01-12  5:03 UTC (permalink / raw)
  To: zhangqing
  Cc: heiko, lgirdwood, broonie, huangtao, zyw, linux-rockchip, linux-kernel

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
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] regulator: fan53555: fill set_suspend_enable/disable callback
  2016-01-12 14:28     ` zhangqing
  (?)
@ 2016-01-12  7:09     ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2016-01-12  7:09 UTC (permalink / raw)
  To: zhangqing
  Cc: heiko, lgirdwood, broonie, huangtao, zyw, linux-rockchip, linux-kernel

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] regulator: fan53555: fill set_suspend_enable/disable callback
@ 2016-01-12 11:05 zhangqing
  2016-01-12  5:03 ` Krzysztof Kozlowski
  2016-01-15 18:19 ` Applied "regulator: fan53555: fill set_suspend_enable/disable callback" to the regulator tree Mark Brown
  0 siblings, 2 replies; 6+ messages in thread
From: zhangqing @ 2016-01-12 11:05 UTC (permalink / raw)
  To: heiko
  Cc: lgirdwood, broonie, huangtao, zyw, linux-rockchip, linux-kernel,
	zhangqing

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] regulator: fan53555: fill set_suspend_enable/disable callback
@ 2016-01-12 14:28     ` zhangqing
  0 siblings, 0 replies; 6+ messages in thread
From: zhangqing @ 2016-01-12 14:28 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: heiko, lgirdwood, broonie, huangtao, zyw, linux-rockchip, linux-kernel



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
>>
>>
>
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] regulator: fan53555: fill set_suspend_enable/disable callback
@ 2016-01-12 14:28     ` zhangqing
  0 siblings, 0 replies; 6+ messages in thread
From: zhangqing @ 2016-01-12 14:28 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: huangtao-TNX95d0MmH7DzftRWevZcw, heiko-4mtYJXux2i+zQB+pC5nmwQ,
	lgirdwood-Re5JQEeQqe8AvxtiuMwx3w,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	broonie-DgEjT+Ai2ygdnm+yROfE0A, zyw-TNX95d0MmH7DzftRWevZcw



On 01/11/2016 09:03 PM, Krzysztof Kozlowski wrote:
> 2016-01-12 20:05 GMT+09:00 zhangqing <zhangqing-TNX95d0MmH7DzftRWevZcw@public.gmane.org>:
>> Setting the set_suspend_enable/disable callback to support
>> enable and disable the dcdc when system is suspend.
>>
>> Signed-off-by: zhangqing <zhangqing-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
>> ---
>>   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
>>
>>
>
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Applied "regulator: fan53555: fill set_suspend_enable/disable callback" to the regulator tree
  2016-01-12 11:05 [PATCH] regulator: fan53555: fill set_suspend_enable/disable callback zhangqing
  2016-01-12  5:03 ` Krzysztof Kozlowski
@ 2016-01-15 18:19 ` Mark Brown
  1 sibling, 0 replies; 6+ messages in thread
From: Mark Brown @ 2016-01-15 18:19 UTC (permalink / raw)
  To: zhangqing, Mark Brown; +Cc: linux-kernel

The patch

   regulator: fan53555: fill set_suspend_enable/disable callback

has been applied to the regulator tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From ab7cad331155bab5e81381b5e34a333220718385 Mon Sep 17 00:00:00 2001
From: zhangqing <zhangqing@rock-chips.com>
Date: Tue, 12 Jan 2016 03:05:56 -0800
Subject: [PATCH] regulator: fan53555: fill set_suspend_enable/disable callback

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>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/regulator/fan53555.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c
index 4940e8287df6..2cb5cc311610 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)
-- 
2.7.0.rc3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-01-15 18:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-12 11:05 [PATCH] regulator: fan53555: fill set_suspend_enable/disable callback zhangqing
2016-01-12  5:03 ` Krzysztof Kozlowski
2016-01-12 14:28   ` zhangqing
2016-01-12 14:28     ` zhangqing
2016-01-12  7:09     ` Krzysztof Kozlowski
2016-01-15 18:19 ` Applied "regulator: fan53555: fill set_suspend_enable/disable callback" to the regulator tree Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.