From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2993397AbcHETvm (ORCPT ); Fri, 5 Aug 2016 15:51:42 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:55743 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2993124AbcHETvf (ORCPT ); Fri, 5 Aug 2016 15:51:35 -0400 Date: Fri, 5 Aug 2016 21:51:31 +0200 From: Pavel Machek To: Marcel Holtmann Cc: David Lechner , linux-leds@vger.kernel.org, Richard Purdie , Jacek Anaszewski , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Joel Becker Subject: Re: [RFC] User-defined leds Message-ID: <20160805195130.GA26694@amd> References: <57965C15.1070705@lechnology.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! > > short version: I have a use case for leds where I want to be able to use the triggers in the leds subsystem without having a physical hardware led. > > > > long version: I am working on a program to make one embedded system (http://fatcatlab.com/product/evb/) compatible with another (http://mindstorms.lego.com). One has physical red/green LEDs, that use the gpio leds driver to control them. The other system does not have physical leds. However, it does have a color screen. So, my idea is > > to create virtual LEDs on the screen that emulate the physical LEDs on the other device. > > > > I would like to make a userspace program that works the same on both devices. If the leds were simple on-off, then it would of course be simpler to make the virtual leds completely in userspace. However, we are currently using other triggers (disk activity/heatbeat/etc.) with the leds. I would like for the virtual LEDs to be able to use these triggers as well. > > this is funny since I have just written a ledsim.c using debugfs to emulate a LED and read out its state via a simple cat command. I found that useful for testing triggers in the Bluetooth subsystem and see if they behave correctly without bothering to run this on real hardware. > Could the device tree be used to bind LED driver to otherwise unused gpio? Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html