Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752921AbbKVXk2 (ORCPT ); Sun, 22 Nov 2015 18:40:28 -0500 Received: from devils.ext.ti.com ([198.47.26.153]:43483 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752536AbbKVXk0 (ORCPT ); Sun, 22 Nov 2015 18:40:26 -0500 Subject: Re: [PATCH RESEND 15/16] leds: add LM3633 driver To: Jacek Anaszewski References: <1446441875-1256-1-git-send-email-milo.kim@ti.com> <1446441875-1256-16-git-send-email-milo.kim@ti.com> <5638DD99.9070502@samsung.com> <56419F0C.90009@ti.com> <564EE66C.5010709@samsung.com> CC: , , , From: "Kim, Milo" Message-ID: <56525262.60308@ti.com> Date: Mon, 23 Nov 2015 08:40:18 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <564EE66C.5010709@samsung.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2470 Lines: 64 Hi Jacek, On 11/20/2015 6:22 PM, Jacek Anaszewski wrote: > On 11/10/2015 08:38 AM, Kim, Milo wrote: > [...] >>>> + cat /sys/class/leds//pattern_levels >>>> + low brightness: 0, high brightness: 255 >>>> + >>>> +What: /sys/class/leds//run_pattern >>>> +Date: Oct 2015 >>>> +KernelVersion: 4.3 >>>> +Contact: Milo Kim >>>> +Description: write only >>>> + After 'pattern_times' and 'pattern_levels' are updated, >>>> + run the pattern by writing 1 to 'run_pattern'. >>>> + To stop running pattern, writes 0 to 'run_pattern'. >>> >>> I wonder how registering an in-driver trigger would work. It would >>> allow for hiding above pattern attributes when the trigger is inactive, >>> and thus making the sysfs interface more transparent. You could avoid >>> the need for run_pattern attribute, as setting the trigger would itself >>> activate the pattern, and setting brightness to 0 would turn it off. >> >> I like this idea, let me try to fix it. > > After thinking it over, I came to conclusion that implementing it as > an in-driver trigger is not a proper way to go, since triggers are > defined as kernel based source of LED events. > > This is somehow abused in case of timer trigger which takes hardware > blinking feature as a first choice and applies software blinking as > a fallback only. To be consistent with that, we could go for adding > generic pattern trigger and add a led_pattern_set() API, similarly > to existing led_blink_set(). > > The problem is that different LED controllers may implement blinking > patterns that are configured with different set of parameters. This > subject would definitely require thorough analysis. > > For now, please just expose pattern settings as separate sysfs > attributes of a LED class device. > Thanks for your suggestion. Then, LM3633 LED driver will support 8 device attributes. pattern_time_delay pattern_time_rise pattern_time_high pattern_time_fall pattern_time_low pattern_brightness_low pattern_brightness_high pattern_run_pattern Details will be updated in Documentation/ABI/testing/sysfs-class-led-lm3633. Best regards, Milo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/