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


Groups > linux.kernel > #1367583 > unrolled thread

[PATCH v5 10/46] leds: pwm: use pwm_get_args() where appropriate

Started byBoris Brezillon <boris.brezillon@free-electrons.com>
First post2016-03-30 22:20 +0200
Last post2016-03-31 09:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v5 10/46] leds: pwm: use pwm_get_args() where appropriate Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-03-30 22:20 +0200
    Re: [PATCH v5 10/46] leds: pwm: use pwm_get_args() where appropriate Jacek Anaszewski <j.anaszewski@samsung.com> - 2016-03-31 09:20 +0200

#1367583 — [PATCH v5 10/46] leds: pwm: use pwm_get_args() where appropriate

FromBoris Brezillon <boris.brezillon@free-electrons.com>
Date2016-03-30 22:20 +0200
Subject[PATCH v5 10/46] leds: pwm: use pwm_get_args() where appropriate
Message-ID<riuKT-2cZ-43@gated-at.bofh.it>
The PWM framework has clarified the concept of reference PWM config
(the platform dependent config retrieved from the DT or the PWM
lookup table) and real PWM state.

Use pwm_get_args() when the PWM user wants to retrieve this reference
config and not the current state.

This is part of the rework allowing the PWM framework to support
hardware readout and expose real PWM state even when the PWM has
just been requested (before the user calls pwm_config/enable/disable()).

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
---
 drivers/leds/leds-pwm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
index 4783bac..b48231c 100644
--- a/drivers/leds/leds-pwm.c
+++ b/drivers/leds/leds-pwm.c
@@ -91,6 +91,7 @@ static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv,
 		       struct led_pwm *led, struct device_node *child)
 {
 	struct led_pwm_data *led_data = &priv->leds[priv->num_leds];
+	struct pwm_args pargs = { };
 	int ret;
 
 	led_data->active_low = led->active_low;
@@ -117,7 +118,8 @@ static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv,
 	else
 		led_data->cdev.brightness_set_blocking = led_pwm_set_blocking;
 
-	led_data->period = pwm_get_period(led_data->pwm);
+	pwm_get_args(led_data->pwm, &pargs);
+	led_data->period = pargs.period;
 	if (!led_data->period && (led->pwm_period_ns > 0))
 		led_data->period = led->pwm_period_ns;
 
-- 
2.5.0

[toc] | [next] | [standalone]


#1367899

FromJacek Anaszewski <j.anaszewski@samsung.com>
Date2016-03-31 09:20 +0200
Message-ID<riF3z-1p0-7@gated-at.bofh.it>
In reply to#1367583
Hi Boris,

On 03/30/2016 10:03 PM, Boris Brezillon wrote:
> The PWM framework has clarified the concept of reference PWM config
> (the platform dependent config retrieved from the DT or the PWM
> lookup table) and real PWM state.
>
> Use pwm_get_args() when the PWM user wants to retrieve this reference
> config and not the current state.
>
> This is part of the rework allowing the PWM framework to support
> hardware readout and expose real PWM state even when the PWM has
> just been requested (before the user calls pwm_config/enable/disable()).
>
> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> ---
>   drivers/leds/leds-pwm.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
> index 4783bac..b48231c 100644
> --- a/drivers/leds/leds-pwm.c
> +++ b/drivers/leds/leds-pwm.c
> @@ -91,6 +91,7 @@ static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv,
>   		       struct led_pwm *led, struct device_node *child)
>   {
>   	struct led_pwm_data *led_data = &priv->leds[priv->num_leds];
> +	struct pwm_args pargs = { };
>   	int ret;
>
>   	led_data->active_low = led->active_low;
> @@ -117,7 +118,8 @@ static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv,
>   	else
>   		led_data->cdev.brightness_set_blocking = led_pwm_set_blocking;
>
> -	led_data->period = pwm_get_period(led_data->pwm);
> +	pwm_get_args(led_data->pwm, &pargs);
> +	led_data->period = pargs.period;
>   	if (!led_data->period && (led->pwm_period_ns > 0))
>   		led_data->period = led->pwm_period_ns;
>
>

Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com>

-- 
Best regards,
Jacek Anaszewski

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web