diff options
author | Michael Buesch <mb@bu3sch.de> | 2007-09-27 15:33:12 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:54:10 -0400 |
commit | 135900c182c321a4888ec496b014e6707272faca (patch) | |
tree | d17a3e12bf2e047c7a627f61e623e40dfbad87bf /include/linux/rfkill.h | |
parent | 937a049dd903bd810d858d0303cf86af9eb08b6f (diff) |
[RFKILL]: Add support for an rfkill LED.
This adds a LED trigger.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/rfkill.h')
-rw-r--r-- | include/linux/rfkill.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h index d76397ca95ad..26fddea12c25 100644 --- a/include/linux/rfkill.h +++ b/include/linux/rfkill.h | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/list.h> | 26 | #include <linux/list.h> |
27 | #include <linux/mutex.h> | 27 | #include <linux/mutex.h> |
28 | #include <linux/device.h> | 28 | #include <linux/device.h> |
29 | #include <linux/leds.h> | ||
29 | 30 | ||
30 | /** | 31 | /** |
31 | * enum rfkill_type - type of rfkill switch. | 32 | * enum rfkill_type - type of rfkill switch. |
@@ -56,6 +57,7 @@ enum rfkill_state { | |||
56 | * @data: Pointer to the RF button drivers private data which will be | 57 | * @data: Pointer to the RF button drivers private data which will be |
57 | * passed along when toggling radio state. | 58 | * passed along when toggling radio state. |
58 | * @toggle_radio(): Mandatory handler to control state of the radio. | 59 | * @toggle_radio(): Mandatory handler to control state of the radio. |
60 | * @led_trigger: A LED trigger for this button's LED. | ||
59 | * @dev: Device structure integrating the switch into device tree. | 61 | * @dev: Device structure integrating the switch into device tree. |
60 | * @node: Used to place switch into list of all switches known to the | 62 | * @node: Used to place switch into list of all switches known to the |
61 | * the system. | 63 | * the system. |
@@ -74,6 +76,10 @@ struct rfkill { | |||
74 | void *data; | 76 | void *data; |
75 | int (*toggle_radio)(void *data, enum rfkill_state state); | 77 | int (*toggle_radio)(void *data, enum rfkill_state state); |
76 | 78 | ||
79 | #ifdef CONFIG_RFKILL_LEDS | ||
80 | struct led_trigger led_trigger; | ||
81 | #endif | ||
82 | |||
77 | struct device dev; | 83 | struct device dev; |
78 | struct list_head node; | 84 | struct list_head node; |
79 | }; | 85 | }; |
@@ -84,4 +90,19 @@ void rfkill_free(struct rfkill *rfkill); | |||
84 | int rfkill_register(struct rfkill *rfkill); | 90 | int rfkill_register(struct rfkill *rfkill); |
85 | void rfkill_unregister(struct rfkill *rfkill); | 91 | void rfkill_unregister(struct rfkill *rfkill); |
86 | 92 | ||
93 | /** | ||
94 | * rfkill_get_led_name - Get the LED trigger name for the button's LED. | ||
95 | * This function might return a NULL pointer if registering of the | ||
96 | * LED trigger failed. | ||
97 | * Use this as "default_trigger" for the LED. | ||
98 | */ | ||
99 | static inline char *rfkill_get_led_name(struct rfkill *rfkill) | ||
100 | { | ||
101 | #ifdef CONFIG_RFKILL_LEDS | ||
102 | return (char *)(rfkill->led_trigger.name); | ||
103 | #else | ||
104 | return NULL; | ||
105 | #endif | ||
106 | } | ||
107 | |||
87 | #endif /* RFKILL_H */ | 108 | #endif /* RFKILL_H */ |