Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933298AbcDLLjU (ORCPT ); Tue, 12 Apr 2016 07:39:20 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:35478 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755999AbcDLLjQ (ORCPT ); Tue, 12 Apr 2016 07:39:16 -0400 Date: Tue, 12 Apr 2016 13:39:12 +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 05/46] pwm: introduce the pwm_args concept Message-ID: <20160412113912.GK18882@ulmo.ba.sec> References: <1459368249-13241-1-git-send-email-boris.brezillon@free-electrons.com> <1459368249-13241-6-git-send-email-boris.brezillon@free-electrons.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Ah40dssYA/cDqAW1" Content-Disposition: inline In-Reply-To: <1459368249-13241-6-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: 2238 Lines: 59 --Ah40dssYA/cDqAW1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 30, 2016 at 10:03:28PM +0200, Boris Brezillon wrote: > Currently the PWM core mixes the current PWM state with the per-platform > reference config (specified through the PWM lookup table, DT definition or > directly hardcoded in PWM drivers). >=20 > Create a pwm_args struct to store this reference config, so that PWM users > can differentiate the current config from the reference one. >=20 > Patch all places where pwm->args should be initialized. We keep the > pwm_set_polarity/period() calls until all PWM users are patched to > use pwm_args instead of pwm_get_period/polarity(). Perhaps a helper would be useful? Something like: static inline void pwm_apply_args(struct pwm_device *pwm, const struct pwm_args *args) { pwm_set_duty_cycle(pwm, args->duty_cycle); pwm_set_period(pwm, args->period); } ? That would make it slightly easier to get rid of it again after all clients have been converted. With the exception of pwm-clps711x all of these args are set at of_xlate time (for DT) or from the lookup table in pwm_get() (for non-DT), so it might even be possible to move this call to the core, so that removal of it will be a one-liner. Thierry --Ah40dssYA/cDqAW1 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJXDN5dAAoJEN0jrNd/PrOhqrMP/1GyMeElT/9kJJHiSyaOgN5n MPhuI5mth5V2b9E7zzGZAOxnp4JIdGhPiIGKWaJeqc8LkwXK8oQanTtKlQjFZC7J AvB4RezK7kN5+8c5QqQ3jeGTpGO2FebGf0kJld9MkH2V4P0CuwCdMChxApXXK728 SMsYxDkNl0PupxKV6ZDRqbSZIEwoQZihKNUNqAalJbl6l2v0NVAEP+YhS+NnUO9p IB+D2kwvYg2+ke3vi0GNkrdeFujbuu+oVbvgdejHJHxy8RSKDNCUOUlAA0pXQ9N5 34jUD1kWFlepf6PN5DEMJ6oL8YpSfzYgPJ+NcSKa/5incyinTqtVLMhPx4naFZa6 dwBIC3foyIs2D1Ef7xPVLthV4qVTdw2LSipTteCJL5P/xwvATGsauf8AQNBZyGxO 5wwxvePJgJ14fvIkcINXxXvnmTa1B5L+WeKaUozZ+yJp+RzCmluCEsylJR8905nX 4M8j3cSl4yE3rSWCDyYh2+JbquVrX+enZrx2C/jb/3J7BbbLd8C3H47VMHElbvPu n6/tLKj8V9BhvrEg+hoPVJzuSERa44pq0F5rEusaw47OGZgW59/v3aa4dPWcbT8k BNaX/tTpFt1tzzZun42of7mFkMSaLr9Rd/WPk7fymbi3jlFniDWe0ZAJKKYIT/a7 k0UlPqmhLACboj5tC/qq =+BbA -----END PGP SIGNATURE----- --Ah40dssYA/cDqAW1--