summaryrefslogtreecommitdiff
path: root/include/linux/extcon
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/extcon')
-rw-r--r--include/linux/extcon/sm5502.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/extcon/sm5502.h b/include/linux/extcon/sm5502.h
index 17bd6550c485..030526bf8d79 100644
--- a/include/linux/extcon/sm5502.h
+++ b/include/linux/extcon/sm5502.h
@@ -223,6 +223,29 @@ enum sm5502_reg {
#define SM5502_REG_DEV_TYPE2_TTY_MASK (0x1 << SM5502_REG_DEV_TYPE2_TTY_SHIFT)
#define SM5502_REG_DEV_TYPE2_AV_CABLE_MASK (0x1 << SM5502_REG_DEV_TYPE2_AV_CABLE_SHIFT)
+#define SM5502_REG_MANUAL_SW1_VBUSIN_SHIFT 0
+#define SM5502_REG_MANUAL_SW1_DP_SHIFT 2
+#define SM5502_REG_MANUAL_SW1_DM_SHIFT 5
+#define SM5502_REG_MANUAL_SW1_VBUSIN_MASK (0x3 << SM5502_REG_MANUAL_SW1_VBUSIN_SHIFT)
+#define SM5502_REG_MANUAL_SW1_DP_MASK (0x7 << SM5502_REG_MANUAL_SW1_DP_SHIFT)
+#define SM5502_REG_MANUAL_SW1_DM_MASK (0x7 << SM5502_REG_MANUAL_SW1_DM_SHIFT)
+#define VBUSIN_SWITCH_OPEN 0x0
+#define VBUSIN_SWITCH_VBUSOUT 0x1
+#define VBUSIN_SWITCH_MIC 0x2
+#define VBUSIN_SWITCH_VBUSOUT_WITH_USB 0x3
+#define DM_DP_CON_SWITCH_OPEN 0x0
+#define DM_DP_CON_SWITCH_USB 0x1
+#define DM_DP_CON_SWITCH_AUDIO 0x2
+#define DM_DP_CON_SWITCH_UART 0x3
+#define DM_DP_SWITCH_OPEN ((DM_DP_CON_SWITCH_OPEN <<SM5502_REG_MANUAL_SW1_DP_SHIFT) \
+ | (DM_DP_CON_SWITCH_OPEN <<SM5502_REG_MANUAL_SW1_DM_SHIFT))
+#define DM_DP_SWITCH_USB ((DM_DP_CON_SWITCH_USB <<SM5502_REG_MANUAL_SW1_DP_SHIFT) \
+ | (DM_DP_CON_SWITCH_USB <<SM5502_REG_MANUAL_SW1_DM_SHIFT))
+#define DM_DP_SWITCH_AUDIO ((DM_DP_CON_SWITCH_AUDIO <<SM5502_REG_MANUAL_SW1_DP_SHIFT) \
+ | (DM_DP_CON_SWITCH_AUDIO <<SM5502_REG_MANUAL_SW1_DM_SHIFT))
+#define DM_DP_SWITCH_UART ((DM_DP_CON_SWITCH_UART <<SM5502_REG_MANUAL_SW1_DP_SHIFT) \
+ | (DM_DP_CON_SWITCH_UART <<SM5502_REG_MANUAL_SW1_DM_SHIFT))
+
/* SM5502 Interrupts */
enum sm5502_irq {
/* INT1 */