Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp576042ybh; Sun, 12 Jul 2020 16:20:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCOscrhcgeVfVFzmYmIt8N2ZW/Y5bgZ6FQ7BtdrnF6XuzllQR5zSsMIlAIQPvniT5MYDan X-Received: by 2002:aa7:d58c:: with SMTP id r12mr92900912edq.160.1594596033575; Sun, 12 Jul 2020 16:20:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594596033; cv=none; d=google.com; s=arc-20160816; b=YHy4cEKABBQPu4FA3ilR9esUHU3EnWjtD8kwSOQ5o18b7l7kssX3rr/w3gVVbQIguJ f6N+Rz5KB3eSgXITzxHoUVABhCpV4ygRTCTI0Aqbx1W+2sV94pKN+2a0Y9RUj64B2AY6 o8Lkyf3SWJKAsLDvpxzS76a6BxwFHK3QrvH1BQ6WcX2W8fAR+yoqGQRZfjZlGZuCY9JL pUpkWg4TjgtHE5FlCz/zcSaQoPfCeowE6fcnsSWXhaIoLSgA482F9p51+2jFrx0LE0yd V+7DUTbb2S8NvO5LgY+osKw7vWwlNC0aG3yMbHjjUAK2oGklDqJYEdwEf01oKAudYLFN 5xyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=7pIFy6SGr1g/w8GOKBvEHZyVl0SUxGTxndxPsf63eX8=; b=fnfakn88Rxsem7RSnJwH7MH58I0c8Vpz4nbYlyFGSHjs3z31AyaAq3MbhFR2GRjuD1 5ShR1vfHd66R4guf0MXWLoMhNwvaBLWnYW7v7l4CpCJi2TZO7+Yx1mc2qx+tx5iZ8rjk FWfbr+2K6leKtKtbx698pN4wdaz4iOCvOQjuokTWGcmtaP4r8h6jMtpZikFnL+oYqw+c sFfSs2AJ+98+ERvC0pU2cWbh2fK7HIxO7bEcm11bFm0SRgjbZ+Bx3ApOy25z0VdIVTOy Sg9zJSFZARFf5hcne1Y1Dy1buxWxTTq5rGEqQXYPq1M+2B+9m/Gc2cXa1yh2lQbsYuKP GKqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b="i9w/8Hsx"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o11si7921837ejr.391.2020.07.12.16.20.10; Sun, 12 Jul 2020 16:20:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b="i9w/8Hsx"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728578AbgGLXUF (ORCPT + 99 others); Sun, 12 Jul 2020 19:20:05 -0400 Received: from vps.xff.cz ([195.181.215.36]:60446 "EHLO vps.xff.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727785AbgGLXUF (ORCPT ); Sun, 12 Jul 2020 19:20:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megous.com; s=mail; t=1594596003; bh=hO4xCkjUxhM7rmK+bUGTraRvUyv4jJ7Jl440PsXvssU=; h=Date:From:To:Cc:Subject:References:X-My-GPG-KeyId:From; b=i9w/8Hsx1wwhoCwIdcamoOeWQxQP7J0lF6qsjenRYx5M1CPvaTrVn46tnwTtFbUSH FyYgRCP2esFHWcjMEsPE5ltIzu3wqcnI51cnOI63CSfJ1yucmA/3bWR+t6+o6g0o0c ZQFmxkO9rvi4Gu20iCn4DHMoZcfJh4OMdfSrkegU= Date: Mon, 13 Jul 2020 01:20:03 +0200 From: =?utf-8?Q?Ond=C5=99ej?= Jirman To: Marek Behun Cc: Pavel Machek , linux-kernel@vger.kernel.org, Jacek Anaszewski , Dan Murphy , "open list:LED SUBSYSTEM" Subject: Re: [PATCH RFC] leds: Add support for per-LED device triggers Message-ID: <20200712232003.qpogdep7xp4hfmu5@core.my.home> Mail-Followup-To: =?utf-8?Q?Ond=C5=99ej?= Jirman , Marek Behun , Pavel Machek , linux-kernel@vger.kernel.org, Jacek Anaszewski , Dan Murphy , "open list:LED SUBSYSTEM" References: <20200702144712.1994685-1-megous@megous.com> <20200711100409.GA18901@amd> <20200711210111.5ysijhexgyzyr7u7@core.my.home> <20200712072554.GC4721@duo.ucw.cz> <20200712134911.r3lig4hgyqhmslth@core.my.home> <20200712191111.GA20592@amd> <20200712223821.742ljr4qxdrx3aqv@core.my.home> <20200713011544.0adc51f1@nic.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200713011544.0adc51f1@nic.cz> X-My-GPG-KeyId: EBFBDDE11FB918D44D1F56C1F9F0A873BE9777ED Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 13, 2020 at 01:15:44AM +0200, Marek Behun wrote: > On Mon, 13 Jul 2020 00:38:21 +0200 > Ondřej Jirman wrote: > > > Hello, > > > > On Sun, Jul 12, 2020 at 09:11:11PM +0200, Pavel Machek wrote: > > > Hi! > > > > > > > [....] > > > > > } > > > diff --git a/include/linux/leds.h b/include/linux/leds.h > > > index 2451962d1ec5..cba52714558f 100644 > > > --- a/include/linux/leds.h > > > +++ b/include/linux/leds.h > > > @@ -57,6 +57,10 @@ struct led_init_data { > > > bool devname_mandatory; > > > }; > > > > > > +struct led_hw_trigger_type { > > > + int dummy; > > > +} > > > + > > > struct led_classdev { > > > const char *name; > > > enum led_brightness brightness; > > > @@ -150,6 +154,8 @@ struct led_classdev { > > > > > > /* Ensures consistent access to the LED Flash Class device */ > > > struct mutex led_access; > > > + > > > + struct led_hw_trigger_type *trigger_type; > > > }; > > > > > > /** > > > @@ -345,6 +351,9 @@ struct led_trigger { > > > int (*activate)(struct led_classdev *led_cdev); > > > void (*deactivate)(struct led_classdev *led_cdev); > > > > > > + /* LED-private triggers have this set. */ > > > + struct led_hw_trigger_type *trigger_type; > > > + > > > /* LEDs under control by this trigger (for simple triggers) */ > > > rwlock_t leddev_list_lock; > > > struct list_head led_cdevs; > > > > So after trying to use this, this seems to disallow the use of multiple HW > > triggers per LED. That's fine by me, because using one HW sysfs configured > > trigger per LED that use case is my proposal, but is it desireable in general? > > Why? If you register one LED and several triggers, all sharing the same > trigger_type pointer, I think it should work. Ah, you're right. :) thanks, o. > Marek