diff options
author | Chanwoo Choi <cw00.choi@samsung.com> | 2012-04-27 02:17:28 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-29 22:03:49 -0400 |
commit | f4cce69611ee941bac0729c6069795f106905ef9 (patch) | |
tree | 4714e3c3862316bf22197240baa6f2dbc05b4115 /drivers/extcon | |
parent | a1d26ac0ddc4ea561e17a75dd3b5f9d3c1812f16 (diff) |
Extcon: Notify changed state for only one cable to notifee
This patch inform the state of only one cable instead of previous data
including the state of 32 cables to notifee which use
extcon_register_interest()
function to monitor whether the specific cable is attachd or detached.
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/extcon')
-rw-r--r-- | drivers/extcon/extcon_class.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/extcon/extcon_class.c b/drivers/extcon/extcon_class.c index 53c64a98b0be..4657ad38164b 100644 --- a/drivers/extcon/extcon_class.c +++ b/drivers/extcon/extcon_class.c | |||
@@ -425,8 +425,15 @@ static int _call_per_cable(struct notifier_block *nb, unsigned long val, | |||
425 | 425 | ||
426 | if ((val & (1 << obj->cable_index)) != | 426 | if ((val & (1 << obj->cable_index)) != |
427 | (edev->state & (1 << obj->cable_index))) { | 427 | (edev->state & (1 << obj->cable_index))) { |
428 | bool cable_state = true; | ||
429 | |||
428 | obj->previous_value = val; | 430 | obj->previous_value = val; |
429 | return obj->user_nb->notifier_call(obj->user_nb, val, ptr); | 431 | |
432 | if (val & (1 << obj->cable_index)) | ||
433 | cable_state = false; | ||
434 | |||
435 | return obj->user_nb->notifier_call(obj->user_nb, | ||
436 | cable_state, ptr); | ||
430 | } | 437 | } |
431 | 438 | ||
432 | return NOTIFY_OK; | 439 | return NOTIFY_OK; |