diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/rfkill.txt | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/Documentation/rfkill.txt b/Documentation/rfkill.txt index 0843ed0163a5..28b6ec87c642 100644 --- a/Documentation/rfkill.txt +++ b/Documentation/rfkill.txt | |||
@@ -390,9 +390,10 @@ rfkill lines are inactive, it must return RFKILL_STATE_SOFT_BLOCKED if its soft | |||
390 | rfkill input line is active. Only if none of the rfkill input lines are | 390 | rfkill input line is active. Only if none of the rfkill input lines are |
391 | active, will it return RFKILL_STATE_UNBLOCKED. | 391 | active, will it return RFKILL_STATE_UNBLOCKED. |
392 | 392 | ||
393 | If it doesn't implement the get_state() hook, it must make sure that its calls | 393 | Since the device has a hardware rfkill line, it IS subject to state changes |
394 | to rfkill_force_state() are enough to keep the status always up-to-date, and it | 394 | external to rfkill. Therefore, the driver must make sure that it calls |
395 | must do a rfkill_force_state() on resume from sleep. | 395 | rfkill_force_state() to keep the status always up-to-date, and it must do a |
396 | rfkill_force_state() on resume from sleep. | ||
396 | 397 | ||
397 | Every time the driver gets a notification from the card that one of its rfkill | 398 | Every time the driver gets a notification from the card that one of its rfkill |
398 | lines changed state (polling might be needed on badly designed cards that don't | 399 | lines changed state (polling might be needed on badly designed cards that don't |
@@ -422,13 +423,24 @@ of the hardware is unknown), or read-write (where the hardware can be queried | |||
422 | about its current state). | 423 | about its current state). |
423 | 424 | ||
424 | The rfkill class will call the get_state hook of a device every time it needs | 425 | The rfkill class will call the get_state hook of a device every time it needs |
425 | to know the *real* current state of the hardware. This can happen often. | 426 | to know the *real* current state of the hardware. This can happen often, but |
427 | it does not do any polling, so it is not enough on hardware that is subject | ||
428 | to state changes outside of the rfkill subsystem. | ||
429 | |||
430 | Therefore, calling rfkill_force_state() when a state change happens is | ||
431 | mandatory when the device has a hardware rfkill line, or when something else | ||
432 | like the firmware could cause its state to be changed without going through the | ||
433 | rfkill class. | ||
426 | 434 | ||
427 | Some hardware provides events when its status changes. In these cases, it is | 435 | Some hardware provides events when its status changes. In these cases, it is |
428 | best for the driver to not provide a get_state hook, and instead register the | 436 | best for the driver to not provide a get_state hook, and instead register the |
429 | rfkill class *already* with the correct status, and keep it updated using | 437 | rfkill class *already* with the correct status, and keep it updated using |
430 | rfkill_force_state() when it gets an event from the hardware. | 438 | rfkill_force_state() when it gets an event from the hardware. |
431 | 439 | ||
440 | rfkill_force_state() must be used on the device resume handlers to update the | ||
441 | rfkill status, should there be any chance of the device status changing during | ||
442 | the sleep. | ||
443 | |||
432 | There is no provision for a statically-allocated rfkill struct. You must | 444 | There is no provision for a statically-allocated rfkill struct. You must |
433 | use rfkill_allocate() to allocate one. | 445 | use rfkill_allocate() to allocate one. |
434 | 446 | ||