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,
153 * rfkill_set_hw_state - Set the internal rfkill hardware block state
154 * @rfkill: pointer to the rfkill class to modify.
157 * rfkill drivers that get events when the hard-blocked state changes
158 * use this function to notify the rfkill core (and through that also
164 * This function can be called in any context, even from within rfkill
171 static inline bool rfkill_set_hw_state(struct rfkill *rfkill, bool blocked) in rfkill_set_hw_state() argument
173 return rfkill_set_hw_state_reason(rfkill, blocked, in rfkill_set_hw_state()
178 * rfkill_set_sw_state - Set the internal rfkill software block state
179 * @rfkill: pointer to the rfkill class to modify.
182 * rfkill drivers that get events when the soft-blocked state changes
184 * use this function to notify the rfkill core (and through that also
191 * This function can be called in any context, even from within rfkill
197 bool rfkill_set_sw_state(struct rfkill *rfkill, bool blocked);
201 * @rfkill: pointer to the rfkill class to modify.
204 * rfkill drivers that preserve their software block state over power off
205 * use this function to notify the rfkill core (and through that also
213 void rfkill_init_sw_state(struct rfkill *rfkill, bool blocked);
216 * rfkill_set_states - Set the internal rfkill block states
217 * @rfkill: pointer to the rfkill class to modify.
221 * This function can be called in any context, even from within rfkill
224 void rfkill_set_states(struct rfkill *rfkill, bool sw, bool hw);
227 * rfkill_blocked - Query rfkill block state
229 * @rfkill: rfkill struct to query
231 bool rfkill_blocked(struct rfkill *rfkill);
234 * rfkill_soft_blocked - Query soft rfkill block state
236 * @rfkill: rfkill struct to query
238 bool rfkill_soft_blocked(struct rfkill *rfkill);
241 * rfkill_find_type - Helper for finding rfkill type by name
248 #else /* !RFKILL */
249 static inline struct rfkill * __must_check
259 static inline int __must_check rfkill_register(struct rfkill *rfkill) in rfkill_register() argument
261 if (rfkill == ERR_PTR(-ENODEV)) in rfkill_register()
266 static inline void rfkill_pause_polling(struct rfkill *rfkill) in rfkill_pause_polling() argument
270 static inline void rfkill_resume_polling(struct rfkill *rfkill) in rfkill_resume_polling() argument
274 static inline void rfkill_unregister(struct rfkill *rfkill) in rfkill_unregister() argument
278 static inline void rfkill_destroy(struct rfkill *rfkill) in rfkill_destroy() argument
282 static inline bool rfkill_set_hw_state_reason(struct rfkill *rfkill, in rfkill_set_hw_state_reason() argument
289 static inline bool rfkill_set_hw_state(struct rfkill *rfkill, bool blocked) in rfkill_set_hw_state() argument
294 static inline bool rfkill_set_sw_state(struct rfkill *rfkill, bool blocked) in rfkill_set_sw_state() argument
299 static inline void rfkill_init_sw_state(struct rfkill *rfkill, bool blocked) in rfkill_init_sw_state() argument
303 static inline void rfkill_set_states(struct rfkill *rfkill, bool sw, bool hw) in rfkill_set_states() argument
307 static inline bool rfkill_blocked(struct rfkill *rfkill) in rfkill_blocked() argument
312 static inline bool rfkill_soft_blocked(struct rfkill *rfkill) in rfkill_soft_blocked() argument
322 #endif /* RFKILL || RFKILL_MODULE */
331 const char *rfkill_get_led_trigger_name(struct rfkill *rfkill);
335 * @rfkill: rfkill struct
339 * trigger that rfkill creates. It is optional, but if called
342 void rfkill_set_led_trigger_name(struct rfkill *rfkill, const char *name);
344 static inline const char *rfkill_get_led_trigger_name(struct rfkill *rfkill) in rfkill_get_led_trigger_name() argument
350 rfkill_set_led_trigger_name(struct rfkill *rfkill, const char *name) in rfkill_set_led_trigger_name() argument