summaryrefslogtreecommitdiff
path: root/include/linux/extcon.h
diff options
context:
space:
mode:
authorChanwoo Choi <cw00.choi@samsung.com>2016-05-31 11:32:30 +0300
committerChanwoo Choi <cw00.choi@samsung.com>2016-06-10 05:12:50 +0300
commit830ae442202e314c2bdf7cb4c7cc64d76db0e197 (patch)
tree10aeebf713a640a274f8338ab5e202cb1a7f79f3 /include/linux/extcon.h
parentb396cff519da6ab9094d5d9cd95e2849701ef9de (diff)
downloadlinux-830ae442202e314c2bdf7cb4c7cc64d76db0e197.tar.xz
extcon: Remove the deprecated extcon functions
This patch removes the deprecated extcon functions using string type to identify the type of external connector. The Commit 2a9de9c0f08d61 ("extcon: Use the unique id for external connector instead of string) uses the unique id to separate the type of external connector instead of string name. - extcon_register_interest() - extcon_unregister_interest() - extcon_set_cable_state() - extcon_get_cable_state() And, extcon_register_interest() finds the first extcon device to include the requested external connector from extcon client device and then register the notifier if extcon device argument is NULL. Instead, extcon_register_notifier() supports this feature. But, this patch remains the deprecatd function definition to prevent the build break. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'include/linux/extcon.h')
-rw-r--r--include/linux/extcon.h80
1 files changed, 23 insertions, 57 deletions
diff --git a/include/linux/extcon.h b/include/linux/extcon.h
index 7abf674c388c..cec5c543afc6 100644
--- a/include/linux/extcon.h
+++ b/include/linux/extcon.h
@@ -146,22 +146,6 @@ struct extcon_cable {
struct attribute *attrs[3]; /* to be fed to attr_g.attrs */
};
-/**
- * struct extcon_specific_cable_nb - An internal data for
- * extcon_register_interest().
- * @user_nb: user provided notifier block for events from
- * a specific cable.
- * @cable_index: the target cable.
- * @edev: the target extcon device.
- * @previous_value: the saved previous event value.
- */
-struct extcon_specific_cable_nb {
- struct notifier_block *user_nb;
- int cable_index;
- struct extcon_dev *edev;
- unsigned long previous_value;
-};
-
#if IS_ENABLED(CONFIG_EXTCON)
/*
@@ -207,23 +191,6 @@ extern int extcon_get_cable_state_(struct extcon_dev *edev, unsigned int id);
extern int extcon_set_cable_state_(struct extcon_dev *edev, unsigned int id,
bool cable_state);
-extern int extcon_get_cable_state(struct extcon_dev *edev,
- const char *cable_name);
-extern int extcon_set_cable_state(struct extcon_dev *edev,
- const char *cable_name, bool cable_state);
-
-/*
- * Following APIs are for notifiees (those who want to be notified)
- * to register a callback for events from a specific cable of the extcon.
- * Notifiees are the connected device drivers wanting to get notified by
- * a specific external port of a connection device.
- */
-extern int extcon_register_interest(struct extcon_specific_cable_nb *obj,
- const char *extcon_name,
- const char *cable_name,
- struct notifier_block *nb);
-extern int extcon_unregister_interest(struct extcon_specific_cable_nb *nb);
-
/*
* Following APIs are to monitor every action of a notifier.
* Registrar gets notified for every external port of a connection device.
@@ -246,6 +213,7 @@ extern struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev,
/* Following API to get information of extcon device */
extern const char *extcon_get_edev_name(struct extcon_dev *edev);
+
#else /* CONFIG_EXTCON */
static inline int extcon_dev_register(struct extcon_dev *edev)
{
@@ -306,18 +274,6 @@ static inline int extcon_set_cable_state_(struct extcon_dev *edev,
return 0;
}
-static inline int extcon_get_cable_state(struct extcon_dev *edev,
- const char *cable_name)
-{
- return 0;
-}
-
-static inline int extcon_set_cable_state(struct extcon_dev *edev,
- const char *cable_name, int state)
-{
- return 0;
-}
-
static inline struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name)
{
return NULL;
@@ -337,24 +293,34 @@ static inline int extcon_unregister_notifier(struct extcon_dev *edev,
return 0;
}
-static inline int extcon_register_interest(struct extcon_specific_cable_nb *obj,
- const char *extcon_name,
- const char *cable_name,
- struct notifier_block *nb)
+static inline struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev,
+ int index)
{
- return 0;
+ return ERR_PTR(-ENODEV);
}
+#endif /* CONFIG_EXTCON */
-static inline int extcon_unregister_interest(struct extcon_specific_cable_nb
- *obj)
+/*
+ * Following structure and API are deprecated. EXTCON remains the function
+ * definition to prevent the build break.
+ */
+struct extcon_specific_cable_nb {
+ struct notifier_block *user_nb;
+ int cable_index;
+ struct extcon_dev *edev;
+ unsigned long previous_value;
+};
+
+static inline int extcon_register_interest(struct extcon_specific_cable_nb *obj,
+ const char *extcon_name, const char *cable_name,
+ struct notifier_block *nb)
{
- return 0;
+ return -EINVAL;
}
-static inline struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev,
- int index)
+static inline int extcon_unregister_interest(struct extcon_specific_cable_nb
+ *obj)
{
- return ERR_PTR(-ENODEV);
+ return -EINVAL;
}
-#endif /* CONFIG_EXTCON */
#endif /* __LINUX_EXTCON_H__ */