From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751713AbcFXUyh (ORCPT ); Fri, 24 Jun 2016 16:54:37 -0400 Received: from mail-qk0-f174.google.com ([209.85.220.174]:36500 "EHLO mail-qk0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751349AbcFXUyf (ORCPT ); Fri, 24 Jun 2016 16:54:35 -0400 MIME-Version: 1.0 In-Reply-To: References: <20160615021204.GA11507@kroah.com> <20160615143720.GA23483@ulmo.ba.sec> From: David Hsu Date: Fri, 24 Jun 2016 13:54:33 -0700 Message-ID: Subject: Re: [PATCH] pwm: Create device class for pwm channels To: Thierry Reding Cc: Greg KH , linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 15, 2016 at 4:52 PM, 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 pwm >>> 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. > > Only PWM devices are dynamic, the number of channels exposed by > devices do not change after they've been added to the system. > >> >> 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 > > Would using dev_name(parent) be an acceptable alternative? Ping! Any comments on the above? Thanks, David