Lines Matching full:rfkill
21 #include <uapi/linux/rfkill.h>
41 struct rfkill;
44 * struct rfkill_ops - rfkill driver methods
46 * @poll: poll the rfkill block state(s) -- only assign this method
52 * @query: query the rfkill block state(s) and call exactly one of the
55 * the rfkill core query your driver before setting a requested
62 void (*poll)(struct rfkill *rfkill, void *data);
63 void (*query)(struct rfkill *rfkill, void *data);
69 * rfkill_alloc - Allocate rfkill structure
73 * @ops: rfkill methods
77 * rfkill structure. Returns %NULL on failure.
79 struct rfkill * __must_check rfkill_alloc(const char *name,
86 * rfkill_register - Register a rfkill structure.
87 * @rfkill: rfkill structure to be registered
90 * the rfkill structure. Before calling this function the driver needs
91 * to be ready to service method calls from rfkill.
100 int __must_check rfkill_register(struct rfkill *rfkill);
103 * rfkill_pause_polling(struct rfkill *rfkill)
110 void rfkill_pause_polling(struct rfkill *rfkill);
113 * rfkill_resume_polling(struct rfkill *rfkill)
119 void rfkill_resume_polling(struct rfkill *rfkill);
123 * rfkill_unregister - Unregister a rfkill structure.
124 * @rfkill: rfkill structure to be unregistered
127 * teardown to destroy rfkill structure. Until it returns, the driver
130 void rfkill_unregister(struct rfkill *rfkill);
133 * rfkill_destroy - Free rfkill structure
134 * @rfkill: rfkill structure to be destroyed
136 * Destroys the rfkill structure.
138 void rfkill_destroy(struct rfkill *rfkill);
141 * rfkill_set_hw_state_reason - Set the internal rfkill hardware block state
143 * @rfkill: pointer to the rfkill class to modify.
149 bool rfkill_set_hw_state_reason(struct rfkill *rfkill,
152 * rfkill_set_hw_state - Set the internal rfkill hardware block state
153 * @rfkill: pointer to the rfkill class to modify.
156 * rfkill drivers that get events when the hard-blocked state changes
157 * use this function to notify the rfkill core (and through that also
163 * This function can be called in any context, even from within rfkill
170 static inline bool rfkill_set_hw_state(struct rfkill *rfkill, bool blocked) in rfkill_set_hw_state() argument
172 return rfkill_set_hw_state_reason(rfkill, blocked, in rfkill_set_hw_state()
177 * rfkill_set_sw_state - Set the internal rfkill software block state
178 * @rfkill: pointer to the rfkill class to modify.
181 * rfkill drivers that get events when the soft-blocked state changes
183 * use this function to notify the rfkill core (and through that also
190 * This function can be called in any context, even from within rfkill
196 bool rfkill_set_sw_state(struct rfkill *rfkill, bool blocked);
200 * @rfkill: pointer to the rfkill class to modify.
203 * rfkill drivers that preserve their software block state over power off
204 * use this function to notify the rfkill core (and through that also
212 void rfkill_init_sw_state(struct rfkill *rfkill, bool blocked);
215 * rfkill_set_states - Set the internal rfkill block states
216 * @rfkill: pointer to the rfkill class to modify.
220 * This function can be called in any context, even from within rfkill
223 void rfkill_set_states(struct rfkill *rfkill, bool sw, bool hw);
226 * rfkill_blocked - Query rfkill block state
228 * @rfkill: rfkill struct to query
230 bool rfkill_blocked(struct rfkill *rfkill);
233 * rfkill_soft_blocked - Query soft rfkill block state
235 * @rfkill: rfkill struct to query
237 bool rfkill_soft_blocked(struct rfkill *rfkill);
240 * rfkill_find_type - Helper for finding rfkill type by name
247 #else /* !RFKILL */
248 static inline struct rfkill * __must_check
258 static inline int __must_check rfkill_register(struct rfkill *rfkill) in rfkill_register() argument
260 if (rfkill == ERR_PTR(-ENODEV)) in rfkill_register()
265 static inline void rfkill_pause_polling(struct rfkill *rfkill) in rfkill_pause_polling() argument
269 static inline void rfkill_resume_polling(struct rfkill *rfkill) in rfkill_resume_polling() argument
273 static inline void rfkill_unregister(struct rfkill *rfkill) in rfkill_unregister() argument
277 static inline void rfkill_destroy(struct rfkill *rfkill) in rfkill_destroy() argument
281 static inline bool rfkill_set_hw_state_reason(struct rfkill *rfkill, in rfkill_set_hw_state_reason() argument
288 static inline bool rfkill_set_hw_state(struct rfkill *rfkill, bool blocked) in rfkill_set_hw_state() argument
293 static inline bool rfkill_set_sw_state(struct rfkill *rfkill, bool blocked) in rfkill_set_sw_state() argument
298 static inline void rfkill_init_sw_state(struct rfkill *rfkill, bool blocked) in rfkill_init_sw_state() argument
302 static inline void rfkill_set_states(struct rfkill *rfkill, bool sw, bool hw) in rfkill_set_states() argument
306 static inline bool rfkill_blocked(struct rfkill *rfkill) in rfkill_blocked() argument
311 static inline bool rfkill_soft_blocked(struct rfkill *rfkill) in rfkill_soft_blocked() argument
321 #endif /* RFKILL || RFKILL_MODULE */
330 const char *rfkill_get_led_trigger_name(struct rfkill *rfkill);
334 * @rfkill: rfkill struct
338 * trigger that rfkill creates. It is optional, but if called
341 void rfkill_set_led_trigger_name(struct rfkill *rfkill, const char *name);
343 static inline const char *rfkill_get_led_trigger_name(struct rfkill *rfkill) in rfkill_get_led_trigger_name() argument
349 rfkill_set_led_trigger_name(struct rfkill *rfkill, const char *name) in rfkill_set_led_trigger_name() argument