linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Marco Stornelli <marco.stornelli@coritel.it>
To: LinuxPPC-Embedded <linuxppc-embedded@ozlabs.org>
Subject: Re: Leds
Date: Fri, 08 Feb 2008 11:43:25 +0100	[thread overview]
Message-ID: <47AC324D.1050503@coritel.it> (raw)
In-Reply-To: <20080208112002.42a15c0d@seasc0532.dyn.rnd.as.sw.ericsson.se>

Simon Kagstrom ha scritto:
> Hi Marco,
> 
> On Fri, 08 Feb 2008 11:02:16 +0100
> Marco Stornelli <marco.stornelli@coritel.it> wrote:
> 
>> how can specify a led device in a dts file? These leds are connected
>> with gpio to the microprocessor. I can't find anything like a led node
>> in the dts files of the other boards. Have you got any suggestions?
> 
> Although I'm not sure if it's the "standard" way, we just added a
> "home-made" node like this:
> 
> 	resetLED@c0018000 {
> 		device_type = "leds";
> 		compatible = "reset-leds";
> 		reg = <c0018000 00008000>;
> 	};
> 
> and then just get the info in the probe function for the led driver
> we placed in drivers/leds/:
> 
> 	/* Get device info from OF tree */
> 	np = of_find_compatible_node(NULL, "leds", "reset-leds");
> 	if (!np) {
> 		dev_err(&pdev->dev, "Could not find device tree node for reset-leds\n");
> 		goto error_classdev;
> 	}
> 
> 	if (of_address_to_resource(np, 0, &res)) {
> 		dev_err(&pdev->dev, "Could not convert reset-leds device tree address\n");
> 		of_node_put(np);
> 		goto error_classdev;
> 	}
> 	...
> 
> At least this was all the information we needed from the device tree.
> 
> // Simon
> 

Thanks. In this case where have you added the device registration? In
the probe function? Have you registered the driver with
of_register_platform_driver()?

  reply	other threads:[~2008-02-08 10:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-08 10:02 Leds Marco Stornelli
2008-02-08 10:20 ` Leds Simon Kagstrom
2008-02-08 10:43   ` Marco Stornelli [this message]
2008-02-08 11:26     ` Leds Simon Kagstrom
2008-02-08 19:43   ` Leds Grant Likely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47AC324D.1050503@coritel.it \
    --to=marco.stornelli@coritel.it \
    --cc=linuxppc-embedded@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).