From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758140AbcGKJjZ (ORCPT ); Mon, 11 Jul 2016 05:39:25 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:34501 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751847AbcGKJjW (ORCPT ); Mon, 11 Jul 2016 05:39:22 -0400 Date: Mon, 11 Jul 2016 11:39:18 +0200 From: Thierry Reding To: David Hsu Cc: Greg KH , linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] pwm: Create device class for pwm channels Message-ID: <20160711093918.GE5823@ulmo.ba.sec> References: <20160615021204.GA11507@kroah.com> <20160615143720.GA23483@ulmo.ba.sec> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Uwl7UQhJk99r8jnw" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Uwl7UQhJk99r8jnw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 15, 2016 at 04:52:56PM -0700, David Hsu wrote: > On Wed, Jun 15, 2016 at 7:37 AM, Thierry Reding > wrote: > > On Tue, Jun 14, 2016 at 07:12:04PM -0700, Greg KH wrote: > >> From: David Hsu > >> > >> Pwm channels don't send uevents when exported, this change adds the > >> channels to a pwm class and set their device type to pwm_channel so > >> uevents are sent. > >> > >> To do this properly, the device names need to change to uniquely > >> identify a channel. This change is from pwmN to pwm-(chip->base):N > >> > >> Signed-off-by: David Hsu > >> Signed-off-by: Greg Kroah-Hartman > >> --- > >> Documentation/pwm.txt | 6 ++++-- > >> drivers/pwm/sysfs.c | 15 ++++++++++++--- > >> 2 files changed, 16 insertions(+), 5 deletions(-) > >> > >> Note, this patch came from David with his work on a system that has > >> dynamic PWM devices and channels, and we needed some way to tell > >> userspace what is going on when they are added or removed. If anyone > >> knows any other way of doing this that does not involve changing the p= wm > >> names, please let us know. > > > > Is it truly PWM channels that dynamically appear and disappear? I'd be > > interested in how that's achieved, because there are probably other > > issues that will manifest if you do that. Do you have a pointer to the > > work that David's been undertaking? Generally some more context on the > > use-case would be helpful here. >=20 > Only PWM devices are dynamic, the number of channels exposed by > devices do not change after they've been added to the system. In that case, would it not be enough to use the uevents generated by the addition and removal of the PWM chip devices to/from sysfs? > > Also I'd prefer if this avoided using chip->base here, because it exists > > purely for legacy purposes and is supposed to go away eventually. > > > > Thierry >=20 > Would using dev_name(parent) be an acceptable alternative? Yes, that sounds like a more sensible choice to me. Thierry --Uwl7UQhJk99r8jnw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJXg2lGAAoJEN0jrNd/PrOhQ0UQAJTUSqM0WGHhvHjAwqcxIY8A 9NMuwLaE+SgA+KZhnDPfzFB3S3ZpFvjfqwd1izWw6wlBbkRsisHOQeMt0IMqBJE8 4IwugrVaOeXwU2jnCyjk4E8DHdlKnc44aNrDdZRtpimeNjZk3+OK0j9fra539KD2 uEvics3/kz87ngTJNWpXJgELsj7vnDBFD6dQ8acHP7xb7qEGUoED29lAbx1ajbvA pfsirVg1weMvoOTTUTP8sgX6KAzrU0QWiy7Fwds2u8hJ0tJF3D/em9C7mqm/i1Qr mM/8MNROc/OEKmCYXDr+LNpHWUyK4twZERRlu/bcv3bGsksOWdZNXtVHkQSdF3et lCyb5RSgq2MCwyFyv1kIlolBknHYLR6pNqWsos5I0CUHYY8zAt8vQhMTFDF9LcZu wLN4MWPuma9N1VqSHxPhlPsZhgzGGY7t4HlqXyXlMf7heEAWak4NWfSp1Qdrm6ld x0JbHNFCsSlLRB2sLE6+3LBw/AVcaOE7Bu8+IKY4G1aR9zRg5X26Cz12OYmnGyGr v/tRe6LBAIxRciHbljMkHJk6Tkq9Z8VPyg8LTHHwfM1/MvfAdnRoUa9wy1vtbaIz B/3sX1Z93e61cYqYe22kNuA1+xnH11eiM/KcnHhn6syZnO+/kRmqyXSCEgyT2E+w Kj8vEfN6HxCWWqaidpBL =EHl4 -----END PGP SIGNATURE----- --Uwl7UQhJk99r8jnw--