Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753093AbcCaHNi (ORCPT ); Thu, 31 Mar 2016 03:13:38 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:57839 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751459AbcCaHNf (ORCPT ); Thu, 31 Mar 2016 03:13:35 -0400 X-AuditID: cbfec7f5-f792a6d000001302-48-56fcce19e584 Message-id: <56FCCE16.8040200@samsung.com> Date: Thu, 31 Mar 2016 09:13:26 +0200 From: Jacek Anaszewski User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130804 Thunderbird/17.0.8 MIME-version: 1.0 To: Boris Brezillon Cc: Thierry Reding , linux-pwm@vger.kernel.org, Mike Turquette , Stephen Boyd , linux-clk@vger.kernel.org, Mark Brown , Liam Girdwood , Kamil Debski , lm-sensors@lm-sensors.org, Jean Delvare , Guenter Roeck , Dmitry Torokhov , linux-input@vger.kernel.org, Bryan Wu , Richard Purdie , linux-leds@vger.kernel.org, Maxime Ripard , Chen-Yu Tsai , linux-sunxi@googlegroups.com, Joachim Eastwood , Thomas Petazzoni , Heiko Stuebner , linux-rockchip@lists.infradead.org, Jingoo Han , Lee Jones , linux-fbdev@vger.kernel.org, Jean-Christophe Plagniol-Villard , Tomi Valkeinen , Robert Jarzmik , Alexandre Belloni , Kukjin Kim , Krzysztof Kozlowski , linux-samsung-soc@vger.kernel.org, intel-gfx@lists.freedesktop.org, Daniel Vetter , Jani Nikula , Jonathan Corbet , linux-doc@vger.kernel.org, David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Hartley Sweeten , Ryan Mallon , Alexander Shiyan , Milo Kim Subject: Re: [PATCH v5 10/46] leds: pwm: use pwm_get_args() where appropriate References: <1459368249-13241-1-git-send-email-boris.brezillon@free-electrons.com> <1459368249-13241-11-git-send-email-boris.brezillon@free-electrons.com> In-reply-to: <1459368249-13241-11-git-send-email-boris.brezillon@free-electrons.com> Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA02SV0xTYRTH/e7qBWxyBccnxBgaR0KCgiM5bo0x3hcHiSHGF614A4ZSSGtV 1ETiZAsaDVbEMrSKWLQEZNWQaq1IRUbBBWUVLRZBwSIIAaXVhLffOed3/uflsKRvH+3PHpUf ExRyqUzCeFN1k+aW4IX1E+EhtoZASKuvJSCxNZ+AGkcuBde77AyYKjIJsNdcRqC16EiYKssk 4XmeA4HVNcjAVLeThtvZv0RwK6OEAG1zMYI3GWFw/+dNEYw6GxhwOkLhSo+ThA6XCcGINZEA fU8rDT9SbTTkXiqg4FX6dxo+DI3Q0FyZzUBpvw5Be3shgqHOKRKy3j4jYLz7pQjsuRYC2m4Y GKh6V4+gVG8gQftbR0Hj6x2g63IQYC4rYkDd7wdVlb00jFpSKLha7g9jlTkU9HaeI6D4zkcG xoxvia0h/OD7iyK+OT2N4B93P6R5w4iG4u36RsRf0Q3TfIW6XcRXZ9YyfH51H8F/bWijeH1h EsO3tVYz/NORTprPqQ3jO1LMBF9ScHZvwAHvjUcE2dHjgmLl5kPeUW2GfiauSXwyRZctSkBp PsnIi8XcGlzQeYvw8HzcYCtmkpE368vdRbjjnOFf8RnhpJoyatoSc0H4XXkFPc0UtxR/vJOP ppnhQvGYw+lOmsftxxN1z2iPPwePXrO5d+dygBO7TO5Qkstj8aTrE/JcaKZx3u9uZtry43bh YXvqv0EOwk/6Hrljvbhw/GQg2c0ktwE/uFqGPLwYlxR9IzPQHPWMi+oZmnqGpkFkIZonqCLi lIcjY1atUEpjlCp55IqI2Bg98jygqxzdfbneiDgWSWaLGyMmwn1p6XFlfIwRYZaUzBVn1f1t iY9I408JitiDCpVMUBpRAEtJFohvVg7u8+UipceEaEGIExT/pwTr5Z+A9KrnqS9udJ2+x26y j6/TFlln9YSvtkQtM32zBS4YlqtpCyd2JXQklZ5MqTlzoUXTFGoM7u1tb1q03rR9aZ3Zx+q3 7UvPA1ls45K9moKgx7HmrNWqg6oTp1F0lSFY7rcjXqPd+mbtQMmWL+dl9en2wEUt+kdheM/O p4m7cx17rMsllDJKGhpEKpTSPwy/Oo98AwAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1698 Lines: 48 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 > --- > 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 -- Best regards, Jacek Anaszewski