From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rob Herring Subject: Re: PWM and backlight devices Date: Tue, 06 Dec 2011 12:20:47 -0600 Message-ID: <4EDE5CFF.1060709@gmail.com> References: <20111206150749.GA13761@avionic-0098.adnet.avionic-design.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20111206150749.GA13761-RM9K5IK7kjIyiCvfTdI0JKcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org To: Thierry Reding Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org List-Id: devicetree@vger.kernel.org On 12/06/2011 09:07 AM, Thierry Reding wrote: > Hi, > > I'm working on adding support for a device which is booted from a device tree > only. Currently this gets me to a login prompt on a serial console and the > device is basically functional. However, the device also has a display with a > backlight that is controlled via a PWM (supplied by the SoC). If this was a > regular board it would be simple to implement this via the pwm-backlight > driver. > > Unfortunately, the pwm-backlight driver doesn't have device tree support yet > and I'm not sure how to best implement it. As far as I can see, I would first > need to have some way of representing a PWM device in the DT that I could > reference in the pwm-backlight device node and I would need to add actual DT > support to pwm-backlight. Implementing support for the data passed in the > platform data should be rather straightforward, but I don't see how the > callback functions could be represented in the DT. > > For some setups it would probably be enough to just specify the used PWM, but > other boards fiddle with some GPIOs in the callbacks and I guess that could > be represented by adding a "gpios" property with a list of pins that need to > be toggled for example when the backlight power is enabled/disabled. > > Has anyone done something similar yet? Am I even on the right track here? > I haven't seen anything. Perhaps something similar to how the gpio-keys binding is done would work here. This could have a phandle to the pwm device similar to gpios. Rob