aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds
diff options
context:
space:
mode:
authorThierry Reding <thierry.reding@gmail.com>2016-05-17 14:57:58 +0200
committerThierry Reding <thierry.reding@gmail.com>2016-05-17 14:57:58 +0200
commit18c588786c08458f5d965d8735ab48f9e51e0b4b (patch)
tree925893d58c00432f93830d1b83405c9d44d79bb8 /drivers/leds
parentMerge branch 'for-4.7/pwm-regulator' into for-next (diff)
parentpwm: Add information about polarity, duty cycle and period to debugfs (diff)
downloadlinux-dev-18c588786c08458f5d965d8735ab48f9e51e0b4b.tar.xz
linux-dev-18c588786c08458f5d965d8735ab48f9e51e0b4b.zip
Merge branch 'for-4.7/pwm-atomic' into for-next
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/leds-pwm.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
index 4783bacb2e9d..a9145aa7f36a 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,15 @@ 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);
+ /*
+ * FIXME: pwm_apply_args() should be removed when switching to the
+ * atomic PWM API.
+ */
+ pwm_apply_args(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;