diff options
author | Syed Rafiuddin <srafiuddin@nvidia.com> | 2012-09-03 17:02:41 +0530 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2012-09-11 12:48:10 -0700 |
commit | e2b3db6f717f06b9a2b6e1f0616c7aee9830bb0e (patch) | |
tree | f90303a17260a5804ad092fcd19097887f2b53b4 /drivers/extcon | |
parent | 05b0eb86396e81907f319b0934d90fcae3b09cae (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.
(cherry picked from commit f4cce69611ee941bac0729c6069795f106905ef9)
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>
Change-Id: Ibd6d3def768d60aa5b1bdad3b16d6800ac8661ad
Signed-off-by: Syed Rafiuddin <srafiuddin@nvidia.com>
Reviewed-on: http://git-master/r/130614
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
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, if ((val & (1 << obj->cable_index)) != (edev->state & (1 << obj->cable_index))) { + bool cable_state = true; + obj->previous_value = val; - return obj->user_nb->notifier_call(obj->user_nb, val, ptr); + + if (val & (1 << obj->cable_index)) + cable_state = false; + + return obj->user_nb->notifier_call(obj->user_nb, + cable_state, ptr); } return NOTIFY_OK; |