#ifndef __LINUX_EXTCON_H__
#define __LINUX_EXTCON_H__
#include <linux/device.h>
#define EXTCON_TYPE_USB …
#define EXTCON_TYPE_CHG …
#define EXTCON_TYPE_JACK …
#define EXTCON_TYPE_DISP …
#define EXTCON_TYPE_MISC …
#define EXTCON_NONE …
#define EXTCON_USB …
#define EXTCON_USB_HOST …
#define EXTCON_CHG_USB_SDP …
#define EXTCON_CHG_USB_DCP …
#define EXTCON_CHG_USB_CDP …
#define EXTCON_CHG_USB_ACA …
#define EXTCON_CHG_USB_FAST …
#define EXTCON_CHG_USB_SLOW …
#define EXTCON_CHG_WPT …
#define EXTCON_CHG_USB_PD …
#define EXTCON_JACK_MICROPHONE …
#define EXTCON_JACK_HEADPHONE …
#define EXTCON_JACK_LINE_IN …
#define EXTCON_JACK_LINE_OUT …
#define EXTCON_JACK_VIDEO_IN …
#define EXTCON_JACK_VIDEO_OUT …
#define EXTCON_JACK_SPDIF_IN …
#define EXTCON_JACK_SPDIF_OUT …
#define EXTCON_DISP_HDMI …
#define EXTCON_DISP_MHL …
#define EXTCON_DISP_DVI …
#define EXTCON_DISP_VGA …
#define EXTCON_DISP_DP …
#define EXTCON_DISP_HMD …
#define EXTCON_DISP_CVBS …
#define EXTCON_DISP_EDP …
#define EXTCON_DOCK …
#define EXTCON_JIG …
#define EXTCON_MECHANICAL …
#define EXTCON_NUM …
#define EXTCON_PROP_USB_VBUS …
#define EXTCON_PROP_USB_TYPEC_POLARITY …
#define EXTCON_PROP_USB_SS …
#define EXTCON_PROP_USB_MIN …
#define EXTCON_PROP_USB_MAX …
#define EXTCON_PROP_USB_CNT …
#define EXTCON_PROP_CHG_MIN …
#define EXTCON_PROP_CHG_MAX …
#define EXTCON_PROP_CHG_CNT …
#define EXTCON_PROP_JACK_MIN …
#define EXTCON_PROP_JACK_MAX …
#define EXTCON_PROP_JACK_CNT …
#define EXTCON_PROP_DISP_HPD …
#define EXTCON_PROP_DISP_MIN …
#define EXTCON_PROP_DISP_MAX …
#define EXTCON_PROP_DISP_CNT …
extcon_property_value;
struct extcon_dev;
#if IS_ENABLED(CONFIG_EXTCON)
int extcon_get_state(struct extcon_dev *edev, unsigned int id);
int extcon_get_property(struct extcon_dev *edev, unsigned int id,
unsigned int prop,
union extcon_property_value *prop_val);
int extcon_get_property_capability(struct extcon_dev *edev,
unsigned int id, unsigned int prop);
int extcon_register_notifier(struct extcon_dev *edev, unsigned int id,
struct notifier_block *nb);
int extcon_unregister_notifier(struct extcon_dev *edev, unsigned int id,
struct notifier_block *nb);
int devm_extcon_register_notifier(struct device *dev,
struct extcon_dev *edev, unsigned int id,
struct notifier_block *nb);
void devm_extcon_unregister_notifier(struct device *dev,
struct extcon_dev *edev, unsigned int id,
struct notifier_block *nb);
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);
struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name);
struct extcon_dev *extcon_find_edev_by_node(struct device_node *node);
struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev,
int index);
const char *extcon_get_edev_name(struct extcon_dev *edev);
#else
static inline int extcon_get_state(struct extcon_dev *edev, unsigned int id)
{
return 0;
}
static inline int extcon_get_property(struct extcon_dev *edev, unsigned int id,
unsigned int prop,
union extcon_property_value *prop_val)
{
return 0;
}
static inline int extcon_get_property_capability(struct extcon_dev *edev,
unsigned int id, unsigned int prop)
{
return 0;
}
static inline int extcon_register_notifier(struct extcon_dev *edev,
unsigned int id, struct notifier_block *nb)
{
return 0;
}
static inline int extcon_unregister_notifier(struct extcon_dev *edev,
unsigned int id, struct notifier_block *nb)
{
return 0;
}
static inline int devm_extcon_register_notifier(struct device *dev,
struct extcon_dev *edev, unsigned int id,
struct notifier_block *nb)
{
return -ENOSYS;
}
static inline void devm_extcon_unregister_notifier(struct device *dev,
struct extcon_dev *edev, unsigned int id,
struct notifier_block *nb) { }
static inline int extcon_register_notifier_all(struct extcon_dev *edev,
struct notifier_block *nb)
{
return 0;
}
static inline int extcon_unregister_notifier_all(struct extcon_dev *edev,
struct notifier_block *nb)
{
return 0;
}
static inline int devm_extcon_register_notifier_all(struct device *dev,
struct extcon_dev *edev,
struct notifier_block *nb)
{
return 0;
}
static inline void devm_extcon_unregister_notifier_all(struct device *dev,
struct extcon_dev *edev,
struct notifier_block *nb) { }
static inline struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name)
{
return NULL;
}
static inline struct extcon_dev *extcon_find_edev_by_node(struct device_node *node)
{
return ERR_PTR(-ENODEV);
}
static inline struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev,
int index)
{
return ERR_PTR(-ENODEV);
}
static inline const char *extcon_get_edev_name(struct extcon_dev *edev)
{
return NULL;
}
#endif
struct extcon_specific_cable_nb { … };
#endif