mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-06 14:31:46 +00:00
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>
This commit is contained in:
parent
c02ed2e75e
commit
815429b39d
4 changed files with 146 additions and 5 deletions
|
@ -236,11 +236,11 @@ extern int extcon_set_property_capability(struct extcon_dev *edev,
|
|||
unsigned int id, unsigned int prop);
|
||||
|
||||
/*
|
||||
* Following APIs are to monitor every action of a notifier.
|
||||
* Registrar gets notified for every external port of a connection device.
|
||||
* Probably this could be used to debug an action of notifier; however,
|
||||
* we do not recommend to use this for normal 'notifiee' device drivers who
|
||||
* want to be notified by a specific external port of the notifier.
|
||||
* Following APIs are to monitor the status change of the external connectors.
|
||||
* extcon_register_notifier(*edev, id, *nb) : Register a notifier block
|
||||
* for specific external connector of the extcon.
|
||||
* extcon_register_notifier_all(*edev, *nb) : Register a notifier block
|
||||
* for all supported external connectors of the extcon.
|
||||
*/
|
||||
extern int extcon_register_notifier(struct extcon_dev *edev, unsigned int id,
|
||||
struct notifier_block *nb);
|
||||
|
@ -253,6 +253,17 @@ extern void devm_extcon_unregister_notifier(struct device *dev,
|
|||
struct extcon_dev *edev, unsigned int id,
|
||||
struct notifier_block *nb);
|
||||
|
||||
extern int extcon_register_notifier_all(struct extcon_dev *edev,
|
||||
struct notifier_block *nb);
|
||||
extern int extcon_unregister_notifier_all(struct extcon_dev *edev,
|
||||
struct notifier_block *nb);
|
||||
extern int devm_extcon_register_notifier_all(struct device *dev,
|
||||
struct extcon_dev *edev,
|
||||
struct notifier_block *nb);
|
||||
extern void devm_extcon_unregister_notifier_all(struct device *dev,
|
||||
struct extcon_dev *edev,
|
||||
struct notifier_block *nb);
|
||||
|
||||
/*
|
||||
* Following API get the extcon device from devicetree.
|
||||
* This function use phandle of devicetree to get extcon device directly.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue