How to find platform_device entry from a kernel module
Folks, I have a 3.10.12 kernel and have written a character device driver as a loadable kernel module. From within this driver I want to find a particular device, an LED, that I want to blink as I operate. This LED was registered using "platform_device_reqister". What I would like to do is enumerate all of the devices registered in this manner and find the one I want, but, I have been unable to discover how to start. There is a lot of documentation on the kernel objects, but nothing I can find on how to find a particular one.
I thank any responders in advance! Peace, carl. |
Quote:
|
Thank you, and yes, I did mean programmatically. The particular "device" is an LED, and appears in /sys/class/leds, which I was hoping to parse from my character driver without needing to search a filesystem. I know the LED's name, and the kernel module that contains the function that will set the LED intensity. That function requires a "struct classled" that I don't know how to find.
|
I didn't find any reference to 'struct classled' .. only struct led_classdev, could you point me at a reference ?
|
oops. Spelling
KBP, thank you, you are correct, that is struct led_classdev. This is openwrt source, leds.h, in the "...drivers/leds" directory. The inline _led_set_brightness function is called by led_set_brightness() defined in led-core.c, and THAT function is also helpfully exported, making me think someone would like me to use it!
|
All times are GMT -5. The time now is 08:56 AM. |