From: Boris Brezillon Date: Tue, 14 Jun 2016 09:13:17 +0000 (+0200) Subject: UPSTREAM: regulator: pwm: Adjust PWM config at probe time X-Git-Tag: firefly_0821_release~425 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5452a5568c2b87d73f7c33c0a9529153d62f90ee;p=firefly-linux-kernel-4.4.55.git UPSTREAM: regulator: pwm: Adjust PWM config at probe time The PWM attached to a PWM regulator device might have been previously configured by the bootloader. Make sure the bootloader and linux config are in sync, and adjust the PWM config if that's not the case. Signed-off-by: Boris Brezillon Acked-by: Mark Brown Acked-by: Brian Norris Tested-by: Brian Norris Tested-by: Heiko Stuebner Signed-off-by: Thierry Reding (cherry picked from commit fd4f99c4c3ce8ccd9b8ea751afc614a7624ecef2) Change-Id: I06abddddc4666cd6510b6317795931f282e44eb0 Signed-off-by: David Wu --- diff --git a/drivers/regulator/pwm-regulator.c b/drivers/regulator/pwm-regulator.c index 666bc3bb52ef..cb2f22c02469 100644 --- a/drivers/regulator/pwm-regulator.c +++ b/drivers/regulator/pwm-regulator.c @@ -316,11 +316,9 @@ static int pwm_regulator_probe(struct platform_device *pdev) return ret; } - /* - * FIXME: pwm_apply_args() should be removed when switching to the - * atomic PWM API. - */ - pwm_apply_args(drvdata->pwm); + ret = pwm_adjust_config(drvdata->pwm); + if (ret) + return ret; regulator = devm_regulator_register(&pdev->dev, &drvdata->desc, &config);