Skip to contentSkip to conversation

Extcon: Notify changed state for only one cable to notifee

PATCH New Chanwoo Choi 1 participant 1 message Apr 27, 2012 External connector subsystem (extcon)

lore
Share & tools
lore

Chanwoo Choi

author maintainer
#0 lore raw

PATCH 1/1 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.

---
 drivers/extcon/extcon_class.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
drivers/extcon/extcon_class.c +0 -0
index dbd3bfb..9cf3166 100644
@@ -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;

Signature · 1 line
1.7.0.4