Re: LED module not creating /sys/class/leds entry

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/05/2013 07:34 PM, Bryan Wu wrote:
> But you missed to register this platform device in your kernel. You
> should put some code in your specific's board file, like
> arch/arm/mach-omap2/board-omap3beagle.c.
> 
> Define a structure to tell kernel that you have a dummy led device.
> 
> +static struct platform_device leds_dummy_device = {
> +       .name   = "dummy-led",
> +       .id     = 0,
> +};
> 
> Then register it in your board init code:
> +       platform_device_register(&leds_dummy_device);
> 

In my case I don't have board init code.  At first I just plan to
explore the API, using my normal workstation.  Eventually, I hope to
get the drive activity LEDs on my NAS working, but it's still basically
a standard x86_64 PC (Atom D2550) that just happens to have some
extra hardware (a PCA9532 controlling 13 LEDs).

The good news is that calling platform_device_register from my module's
init function seems to work:

static int __init dummy_led_init(void)
{
	int ret;
	
	if ((ret = platform_driver_register(&dummy_led_driver)) != 0) {
		return ret;
	}
	
	if ((ret = platform_device_register(&dummy_led_pdev)) != 0) {
		platform_driver_unregister(&dummy_led_driver);
	}
	
	return ret;	
}

Thanks!

-- 
========================================================================
Ian Pilcher                                         arequipeno@xxxxxxxxx
Sometimes there's nothing left to do but crash and burn...or die trying.
========================================================================
--
To unsubscribe from this list: send the line "unsubscribe linux-leds" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux