From ecf5d04a091c441793b589e8406357884ee54d58 Mon Sep 17 00:00:00 2001 From: xianzhu Date: Tue, 19 Feb 2019 10:47:47 +0800 Subject: i2c: add virtual i2c driver add virtual i2c driver for virtualization platform. Change-Id: I5aafa3b9db1e06d990b25a393f54f8763e73f9aa Signed-off-by: xianzhu --- include/uapi/linux/virtio_ids.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/uapi/linux/virtio_ids.h b/include/uapi/linux/virtio_ids.h index 3228d582234a..4914c3037a03 100644 --- a/include/uapi/linux/virtio_ids.h +++ b/include/uapi/linux/virtio_ids.h @@ -43,4 +43,6 @@ #define VIRTIO_ID_INPUT 18 /* virtio input */ #define VIRTIO_ID_VSOCK 19 /* virtio vsock transport */ +#define VIRTIO_ID_I2C 32 /* virtio i2c */ + #endif /* _LINUX_VIRTIO_IDS_H */ -- cgit v1.2.3 From 669f50368505b3a67fb81a5ffec4914c5baa8b7f Mon Sep 17 00:00:00 2001 From: Sriharsha Allenki Date: Tue, 14 May 2019 18:28:23 +0530 Subject: usb: dwc3: Support float charger detection Chargers on some platforms do not support FLOAT charger detection. On these platforms, the float charger can be detected depending on the state of the DP and DM lines as detected by the PHY. So, on these platforms check for the DP DM line state and if found floating, do not start the peripheral mode and notify PMIC -ETIMEDOUT implying the connected charger is of type float. Change-Id: I6bf54b0d5c143a849ce9ea7bc515d62204ed2f33 Signed-off-by: Sriharsha Allenki --- include/linux/usb/phy.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h index d25125402fda..f066d65ac3dd 100644 --- a/include/linux/usb/phy.h +++ b/include/linux/usb/phy.h @@ -126,6 +126,9 @@ struct usb_phy { /* reset the PHY clocks */ int (*reset)(struct usb_phy *x); + + /* return linestate with Idp_src (used for DCD with USB2 PHY) */ + int (*dpdm_with_idp_src)(struct usb_phy *x); }; /** @@ -209,6 +212,15 @@ usb_phy_reset(struct usb_phy *x) return 0; } +static inline int +usb_phy_dpdm_with_idp_src(struct usb_phy *x) +{ + if (x && x->dpdm_with_idp_src) + return x->dpdm_with_idp_src(x); + + return 0; +} + /* for usb host and peripheral controller drivers */ #if IS_ENABLED(CONFIG_USB_PHY) extern struct usb_phy *usb_get_phy(enum usb_phy_type type); -- cgit v1.2.3