Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933406AbcDLLtR (ORCPT ); Tue, 12 Apr 2016 07:49:17 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:35651 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932260AbcDLLtO (ORCPT ); Tue, 12 Apr 2016 07:49:14 -0400 Date: Tue, 12 Apr 2016 13:49:04 +0200 From: Thierry Reding To: Boris Brezillon Cc: 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 , Jacek Anaszewski , 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 15/46] pwm: introduce the pwm_state concept Message-ID: <20160412114904.GM18882@ulmo.ba.sec> References: <1459368249-13241-1-git-send-email-boris.brezillon@free-electrons.com> <1459368249-13241-16-git-send-email-boris.brezillon@free-electrons.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="bPrm2PuLP7ysUh6c" Content-Disposition: inline In-Reply-To: <1459368249-13241-16-git-send-email-boris.brezillon@free-electrons.com> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2304 Lines: 61 --bPrm2PuLP7ysUh6c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 30, 2016 at 10:03:38PM +0200, Boris Brezillon wrote: > The PWM state, represented by its period, duty_cycle and polarity, > is currently directly stored in the PWM device. > Declare a pwm_state structure embedding those field so that we can later > use this struct to atomically update all the PWM parameters at once. >=20 > All pwm_get_xxx() helpers are now implemented as wrappers around > pwm_get_state(). >=20 > Signed-off-by: Boris Brezillon > --- > drivers/pwm/core.c | 8 ++++---- > include/linux/pwm.h | 54 +++++++++++++++++++++++++++++++++++++++++------= ------ > 2 files changed, 46 insertions(+), 16 deletions(-) >=20 > diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c > index 6433059..f3f91e7 100644 > --- a/drivers/pwm/core.c > +++ b/drivers/pwm/core.c > @@ -268,7 +268,7 @@ int pwmchip_add_with_polarity(struct pwm_chip *chip, > pwm->chip =3D chip; > pwm->pwm =3D chip->base + i; > pwm->hwpwm =3D i; > - pwm->polarity =3D polarity; > + pwm->state.polarity =3D polarity; Would this not more correctly be assigned to pwm->args.polarity? After all this is setting up the "initial" state, much like DT or the lookup tables would for duty cycle and period. Thierry --bPrm2PuLP7ysUh6c Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJXDOCwAAoJEN0jrNd/PrOhF68QAKrMJWoxnwNOpnE/XLaupLry RUQQTeF+cQA1lO4lHfFVMv0XWggtYkblrnI3hvNeG+MBjKBnRHSj2JCruLITHkKw cxWH6brZ6e7hB/0zSe/sBxlpzm9ujTSzkwVAJ0WnznqhuOU8fFYALw4tMLu37q8d whp1cmw3lhaIvgtUJS1DeY0EKl5jBcI71045hZPPPuQ5dYUqj3n5l8MZha8FG0Rl r9XoPzYk2gTXX/9CrEcluXzPF9hmkgOsHBPjZpIx7fb0dutR3GWSbdj1tS/jk4wt Yu/co8aokTh/kkL5E+lh4c48FvLePfkDIyYqLUsX+LzvReixnyN4gy7neV3GJ7v6 6+QWZdqQN5GSiH82iYIKn7Ej2KTqPgOY1ZNP7i6C2cjLajKcVSNhmeCwYK53sRCa YdGpxEqy5TRmtnaUu4kgVJjCRWzysk++1OZufUBl9E0AivAD/6z/4eXaPLYUafjN Rz9vSozXE0kiyLVaZVx7EVlLIpygsb1kDZZJHCJAIa/MTltiIjfw2MPfVYKmK+jk 6n8Si072Aisr32K8Zj0k/djbTeYpIY1C1egGcPQaKef6xOs38FB/mJE66VeuYMvr ImzlLDT6ISDX68KzUTBEJMy0hmpcA9V2tnIzFthzxHaToUG/tkMbby8scysoQxxP flcXc/+fg+cX8lgFJkKR =SGvk -----END PGP SIGNATURE----- --bPrm2PuLP7ysUh6c--