Commit 8b45b6a0 authored by Chanwoo Choi's avatar Chanwoo Choi

extcon: Add the EXTCON_CHG_USB_SDP to support SDP charing port

This patch adds the new EXTCON_CHG_USB_SDP connector to support SDP (Standard
Downstream Port) USB charging port. The commit 11eecf91 ("extcon: Modify
the id and name of external connector") add the new EXTCON_CHG_USB_SDP
connector which support the both data transfer and usb charging at the same
time.
Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
parent b51b3870
...@@ -150,6 +150,7 @@ enum max14577_muic_acc_type { ...@@ -150,6 +150,7 @@ enum max14577_muic_acc_type {
static const unsigned int max14577_extcon_cable[] = { static const unsigned int max14577_extcon_cable[] = {
EXTCON_USB, EXTCON_USB,
EXTCON_CHG_USB_SDP,
EXTCON_CHG_USB_DCP, EXTCON_CHG_USB_DCP,
EXTCON_CHG_USB_FAST, EXTCON_CHG_USB_FAST,
EXTCON_CHG_USB_SLOW, EXTCON_CHG_USB_SLOW,
...@@ -454,6 +455,8 @@ static int max14577_muic_chg_handler(struct max14577_muic_info *info) ...@@ -454,6 +455,8 @@ static int max14577_muic_chg_handler(struct max14577_muic_info *info)
return ret; return ret;
extcon_set_cable_state_(info->edev, EXTCON_USB, attached); extcon_set_cable_state_(info->edev, EXTCON_USB, attached);
extcon_set_cable_state_(info->edev, EXTCON_CHG_USB_SDP,
attached);
break; break;
case MAX14577_CHARGER_TYPE_DEDICATED_CHG: case MAX14577_CHARGER_TYPE_DEDICATED_CHG:
extcon_set_cable_state_(info->edev, EXTCON_CHG_USB_DCP, extcon_set_cable_state_(info->edev, EXTCON_CHG_USB_DCP,
......
...@@ -204,6 +204,7 @@ enum max77693_muic_acc_type { ...@@ -204,6 +204,7 @@ enum max77693_muic_acc_type {
static const unsigned int max77693_extcon_cable[] = { static const unsigned int max77693_extcon_cable[] = {
EXTCON_USB, EXTCON_USB,
EXTCON_USB_HOST, EXTCON_USB_HOST,
EXTCON_CHG_USB_SDP,
EXTCON_CHG_USB_DCP, EXTCON_CHG_USB_DCP,
EXTCON_CHG_USB_FAST, EXTCON_CHG_USB_FAST,
EXTCON_CHG_USB_SLOW, EXTCON_CHG_USB_SLOW,
...@@ -512,8 +513,11 @@ static int max77693_muic_dock_handler(struct max77693_muic_info *info, ...@@ -512,8 +513,11 @@ static int max77693_muic_dock_handler(struct max77693_muic_info *info,
break; break;
case MAX77693_MUIC_ADC_AV_CABLE_NOLOAD: /* Dock-Audio */ case MAX77693_MUIC_ADC_AV_CABLE_NOLOAD: /* Dock-Audio */
dock_id = EXTCON_DOCK; dock_id = EXTCON_DOCK;
if (!attached) if (!attached) {
extcon_set_cable_state_(info->edev, EXTCON_USB, false); extcon_set_cable_state_(info->edev, EXTCON_USB, false);
extcon_set_cable_state_(info->edev, EXTCON_CHG_USB_SDP,
false);
}
break; break;
default: default:
dev_err(info->dev, "failed to detect %s dock device\n", dev_err(info->dev, "failed to detect %s dock device\n",
...@@ -601,6 +605,8 @@ static int max77693_muic_adc_ground_handler(struct max77693_muic_info *info) ...@@ -601,6 +605,8 @@ static int max77693_muic_adc_ground_handler(struct max77693_muic_info *info)
if (ret < 0) if (ret < 0)
return ret; return ret;
extcon_set_cable_state_(info->edev, EXTCON_USB, attached); extcon_set_cable_state_(info->edev, EXTCON_USB, attached);
extcon_set_cable_state_(info->edev, EXTCON_CHG_USB_SDP,
attached);
break; break;
case MAX77693_MUIC_GND_MHL: case MAX77693_MUIC_GND_MHL:
case MAX77693_MUIC_GND_MHL_VB: case MAX77693_MUIC_GND_MHL_VB:
...@@ -830,6 +836,8 @@ static int max77693_muic_chg_handler(struct max77693_muic_info *info) ...@@ -830,6 +836,8 @@ static int max77693_muic_chg_handler(struct max77693_muic_info *info)
*/ */
extcon_set_cable_state_(info->edev, EXTCON_USB, extcon_set_cable_state_(info->edev, EXTCON_USB,
attached); attached);
extcon_set_cable_state_(info->edev, EXTCON_CHG_USB_SDP,
attached);
if (!cable_attached) if (!cable_attached)
extcon_set_cable_state_(info->edev, EXTCON_DOCK, extcon_set_cable_state_(info->edev, EXTCON_DOCK,
...@@ -899,6 +907,8 @@ static int max77693_muic_chg_handler(struct max77693_muic_info *info) ...@@ -899,6 +907,8 @@ static int max77693_muic_chg_handler(struct max77693_muic_info *info)
extcon_set_cable_state_(info->edev, EXTCON_USB, extcon_set_cable_state_(info->edev, EXTCON_USB,
attached); attached);
extcon_set_cable_state_(info->edev, EXTCON_CHG_USB_SDP,
attached);
break; break;
case MAX77693_CHARGER_TYPE_DEDICATED_CHG: case MAX77693_CHARGER_TYPE_DEDICATED_CHG:
/* Only TA cable */ /* Only TA cable */
......
...@@ -122,6 +122,7 @@ enum max77843_muic_charger_type { ...@@ -122,6 +122,7 @@ enum max77843_muic_charger_type {
static const unsigned int max77843_extcon_cable[] = { static const unsigned int max77843_extcon_cable[] = {
EXTCON_USB, EXTCON_USB,
EXTCON_USB_HOST, EXTCON_USB_HOST,
EXTCON_CHG_USB_SDP,
EXTCON_CHG_USB_DCP, EXTCON_CHG_USB_DCP,
EXTCON_CHG_USB_CDP, EXTCON_CHG_USB_CDP,
EXTCON_CHG_USB_FAST, EXTCON_CHG_USB_FAST,
...@@ -486,6 +487,8 @@ static int max77843_muic_chg_handler(struct max77843_muic_info *info) ...@@ -486,6 +487,8 @@ static int max77843_muic_chg_handler(struct max77843_muic_info *info)
return ret; return ret;
extcon_set_cable_state_(info->edev, EXTCON_USB, attached); extcon_set_cable_state_(info->edev, EXTCON_USB, attached);
extcon_set_cable_state_(info->edev, EXTCON_CHG_USB_SDP,
attached);
break; break;
case MAX77843_MUIC_CHG_DOWNSTREAM: case MAX77843_MUIC_CHG_DOWNSTREAM:
ret = max77843_muic_set_path(info, ret = max77843_muic_set_path(info,
......
...@@ -148,6 +148,7 @@ struct max8997_muic_info { ...@@ -148,6 +148,7 @@ struct max8997_muic_info {
static const unsigned int max8997_extcon_cable[] = { static const unsigned int max8997_extcon_cable[] = {
EXTCON_USB, EXTCON_USB,
EXTCON_USB_HOST, EXTCON_USB_HOST,
EXTCON_CHG_USB_SDP,
EXTCON_CHG_USB_DCP, EXTCON_CHG_USB_DCP,
EXTCON_CHG_USB_FAST, EXTCON_CHG_USB_FAST,
EXTCON_CHG_USB_SLOW, EXTCON_CHG_USB_SLOW,
...@@ -334,6 +335,8 @@ static int max8997_muic_handle_usb(struct max8997_muic_info *info, ...@@ -334,6 +335,8 @@ static int max8997_muic_handle_usb(struct max8997_muic_info *info,
break; break;
case MAX8997_USB_DEVICE: case MAX8997_USB_DEVICE:
extcon_set_cable_state_(info->edev, EXTCON_USB, attached); extcon_set_cable_state_(info->edev, EXTCON_USB, attached);
extcon_set_cable_state_(info->edev, EXTCON_CHG_USB_SDP,
attached);
break; break;
default: default:
dev_err(info->dev, "failed to detect %s usb cable\n", dev_err(info->dev, "failed to detect %s usb cable\n",
......
...@@ -93,6 +93,7 @@ static struct reg_data rt8973a_reg_data[] = { ...@@ -93,6 +93,7 @@ static struct reg_data rt8973a_reg_data[] = {
static const unsigned int rt8973a_extcon_cable[] = { static const unsigned int rt8973a_extcon_cable[] = {
EXTCON_USB, EXTCON_USB,
EXTCON_USB_HOST, EXTCON_USB_HOST,
EXTCON_CHG_USB_SDP,
EXTCON_CHG_USB_DCP, EXTCON_CHG_USB_DCP,
EXTCON_JIG, EXTCON_JIG,
EXTCON_NONE, EXTCON_NONE,
...@@ -398,6 +399,9 @@ static int rt8973a_muic_cable_handler(struct rt8973a_muic_info *info, ...@@ -398,6 +399,9 @@ static int rt8973a_muic_cable_handler(struct rt8973a_muic_info *info,
/* Change the state of external accessory */ /* Change the state of external accessory */
extcon_set_cable_state_(info->edev, id, attached); extcon_set_cable_state_(info->edev, id, attached);
if (id == EXTCON_USB)
extcon_set_cable_state_(info->edev, EXTCON_CHG_USB_SDP,
attached);
return 0; return 0;
} }
......
...@@ -95,6 +95,7 @@ static struct reg_data sm5502_reg_data[] = { ...@@ -95,6 +95,7 @@ static struct reg_data sm5502_reg_data[] = {
static const unsigned int sm5502_extcon_cable[] = { static const unsigned int sm5502_extcon_cable[] = {
EXTCON_USB, EXTCON_USB,
EXTCON_USB_HOST, EXTCON_USB_HOST,
EXTCON_CHG_USB_SDP,
EXTCON_CHG_USB_DCP, EXTCON_CHG_USB_DCP,
EXTCON_NONE, EXTCON_NONE,
}; };
...@@ -411,6 +412,9 @@ static int sm5502_muic_cable_handler(struct sm5502_muic_info *info, ...@@ -411,6 +412,9 @@ static int sm5502_muic_cable_handler(struct sm5502_muic_info *info,
/* Change the state of external accessory */ /* Change the state of external accessory */
extcon_set_cable_state_(info->edev, id, attached); extcon_set_cable_state_(info->edev, id, attached);
if (id == EXTCON_USB)
extcon_set_cable_state_(info->edev, EXTCON_CHG_USB_SDP,
attached);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment