summaryrefslogtreecommitdiffstats
path: root/drivers/extcon/extcon.h
diff options
context:
space:
mode:
authorChanwoo Choi2017-03-29 12:30:17 +0200
committerChanwoo Choi2017-04-04 04:22:42 +0200
commit815429b39d94c64f6d05eed9e7c1a9bdfdd5bd70 (patch)
treefdafc76bc625a33c66497c19010d152960a368d0 /drivers/extcon/extcon.h
parentLinux 4.11-rc4 (diff)
downloadkernel-qcow2-linux-815429b39d94c64f6d05eed9e7c1a9bdfdd5bd70.tar.gz
kernel-qcow2-linux-815429b39d94c64f6d05eed9e7c1a9bdfdd5bd70.tar.xz
kernel-qcow2-linux-815429b39d94c64f6d05eed9e7c1a9bdfdd5bd70.zip
extcon: Add new extcon_register_notifier_all() to monitor all external connectors
The extcon core already provides the extcon_register_notifier() function in order to register the notifier block which is used to monitor the state change for the specific external connector such as EXTCON_USB, EXTCON_USB_HOST and so on. The extcon consumer uses the this function. The extcon consumer might need to monitor the all supported external connectors from the extcon device. In this case, The extcon consumer should have each notifier_block structure for each external connector. This patch adds the new extcon_register_notifier_all() function that extcon consumer is able to monitor the state change of all supported external connectors by using only one notifier_block structure. - List of new added functions: int extcon_register_notifier_all(struct extcon_dev *edev, struct notifier_block *nb); int extcon_unregister_notifier_all(struct extcon_dev *edev, struct notifier_block *nb); int devm_extcon_register_notifier_all(struct device *dev, struct extcon_dev *edev, struct notifier_block *nb); void devm_extcon_unregister_notifier_all(struct device *dev, struct extcon_dev *edev, struct notifier_block *nb); Suggested-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Tested-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/extcon/extcon.h')
-rw-r--r--drivers/extcon/extcon.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/extcon/extcon.h b/drivers/extcon/extcon.h
index 993ddccafe11..dddddcfa0587 100644
--- a/drivers/extcon/extcon.h
+++ b/drivers/extcon/extcon.h
@@ -21,6 +21,8 @@
* @dev: Device of this extcon.
* @state: Attach/detach state of this extcon. Do not provide at
* register-time.
+ * @nh_all: Notifier for the state change events for all supported
+ * external connectors from this extcon.
* @nh: Notifier for the state change events from this extcon
* @entry: To support list of extcon devices so that users can
* search for extcon devices based on the extcon name.
@@ -43,6 +45,7 @@ struct extcon_dev {
/* Internal data. Please do not set. */
struct device dev;
+ struct raw_notifier_head nh_all;
struct raw_notifier_head *nh;
struct list_head entry;
int max_supported;