linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] extcon: Modify the name of unused external connector
@ 2015-04-27 12:31 Chanwoo Choi
  2015-04-27 12:31 ` [PATCH 1/4] extcon: Unify the jig cable names on RT8963 and MAX14577/77693/77843 Chanwoo Choi
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Chanwoo Choi @ 2015-04-27 12:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: jaewon02.kim, k.kozlowski, myungjoo.ham, kyungmin.park, cw00.choi

This patchset alter the unused name of external connector (jig/dock/MHL) as
following. The name of jig cable and dock device include the non-standard H/W
information. On user-space side, this information are not necessary. The extcon
core will support the other method to inform the specific H/W information to
kernel device driver and framework. For example, extcon core have the plan to add
the notifier chain for USB ID/VBUS pin state. If extcon consumer (kernel device
driver and framework) use the notifer chain for USB ID/VBUS, they can get the
state of both JIG and USB when JIG-USB-ON cable is attached.

And last patch removes the unused 'num_cables' filed on extcon-adc-jack.c.

1. jig cable name
- JIG-USB-ON   -->|
- JIG-USB-OFF  -->|
- JIG-UART-ON  -->|
- JIG-UART-OFF -->|--> JIG

2. dock device name
- Dock-Smart   -->|
- Dock-Desk    -->|
- Dock-Audio   -->|
- Dock-Card    -->|--> DOCK

3. MHL-TA cable name
- MHL-TA -> TA

Chanwoo Choi (4):
  extcon: Unify the jig cable names on RT8963 and MAX14577/77693/77843
  extcon: Unify the dock device names on MAX8997/77693
  extcon: Alter MHL-TA cable name to TA cable name
  extcon: adc-jack: Remove the unneeded num_cables field

 drivers/extcon/extcon-adc-jack.c | 12 --------
 drivers/extcon/extcon-max14577.c | 19 ++----------
 drivers/extcon/extcon-max77693.c | 66 +++++++++++++---------------------------
 drivers/extcon/extcon-max77843.c | 45 ++++++++++-----------------
 drivers/extcon/extcon-max8997.c  | 10 ++----
 drivers/extcon/extcon-rt8973a.c  | 22 +++-----------
 6 files changed, 48 insertions(+), 126 deletions(-)

-- 
1.8.5.5


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/4] extcon: Unify the jig cable names on RT8963 and MAX14577/77693/77843
  2015-04-27 12:31 [PATCH 0/4] extcon: Modify the name of unused external connector Chanwoo Choi
@ 2015-04-27 12:31 ` Chanwoo Choi
  2015-04-30  2:00   ` Krzysztof Kozlowski
  2015-04-27 12:31 ` [PATCH 2/4] extcon: Unify the dock device names on MAX8997/77693 Chanwoo Choi
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Chanwoo Choi @ 2015-04-27 12:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: jaewon02.kim, k.kozlowski, myungjoo.ham, kyungmin.park, cw00.choi

This patch change the name of various jig cables as 'JIG' because the name of
various jig cables are strange and ambiguous on user-space aspect. They include
the different information of either USB and UART state. It is never important
for user-space process. This patch unifies the name of jig cables as following:
- JIG-USB-ON   -->|--> JIG
- JIG-USB-OFF  -->|
- JIG-UART-ON  -->|
- JIG-UART-OFF -->|

Cc: Jaewon Kim <jaewon02.kim@samsung.com>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/extcon/extcon-max14577.c | 19 +++----------------
 drivers/extcon/extcon-max77693.c | 23 +++--------------------
 drivers/extcon/extcon-max77843.c | 39 ++++++++++++++-------------------------
 drivers/extcon/extcon-rt8973a.c  | 22 +++++-----------------
 4 files changed, 25 insertions(+), 78 deletions(-)

diff --git a/drivers/extcon/extcon-max14577.c b/drivers/extcon/extcon-max14577.c
index 3823aa4..6d5febe 100644
--- a/drivers/extcon/extcon-max14577.c
+++ b/drivers/extcon/extcon-max14577.c
@@ -155,10 +155,7 @@ enum {
 	EXTCON_CABLE_FAST_CHARGER,
 	EXTCON_CABLE_SLOW_CHARGER,
 	EXTCON_CABLE_CHARGE_DOWNSTREAM,
-	EXTCON_CABLE_JIG_USB_ON,
-	EXTCON_CABLE_JIG_USB_OFF,
-	EXTCON_CABLE_JIG_UART_OFF,
-	EXTCON_CABLE_JIG_UART_ON,
+	EXTCON_CABLE_JIG,
 
 	_EXTCON_CABLE_NUM,
 };
@@ -169,10 +166,7 @@ static const char *max14577_extcon_cable[] = {
 	[EXTCON_CABLE_FAST_CHARGER]		= "Fast-charger",
 	[EXTCON_CABLE_SLOW_CHARGER]		= "Slow-charger",
 	[EXTCON_CABLE_CHARGE_DOWNSTREAM]	= "Charge-downstream",
-	[EXTCON_CABLE_JIG_USB_ON]		= "JIG-USB-ON",
-	[EXTCON_CABLE_JIG_USB_OFF]		= "JIG-USB-OFF",
-	[EXTCON_CABLE_JIG_UART_OFF]		= "JIG-UART-OFF",
-	[EXTCON_CABLE_JIG_UART_ON]		= "JIG-UART-ON",
+	[EXTCON_CABLE_JIG]			= "JIG",
 
 	NULL,
 };
@@ -348,7 +342,6 @@ static int max14577_muic_get_cable_type(struct max14577_muic_info *info,
 static int max14577_muic_jig_handler(struct max14577_muic_info *info,
 		int cable_type, bool attached)
 {
-	char cable_name[32];
 	int ret = 0;
 	u8 path = CTRL1_SW_OPEN;
 
@@ -358,18 +351,12 @@ static int max14577_muic_jig_handler(struct max14577_muic_info *info,
 
 	switch (cable_type) {
 	case MAX14577_MUIC_ADC_FACTORY_MODE_USB_OFF:	/* ADC_JIG_USB_OFF */
-		/* PATH:AP_USB */
-		strcpy(cable_name, "JIG-USB-OFF");
-		path = CTRL1_SW_USB;
-		break;
 	case MAX14577_MUIC_ADC_FACTORY_MODE_USB_ON:	/* ADC_JIG_USB_ON */
 		/* PATH:AP_USB */
-		strcpy(cable_name, "JIG-USB-ON");
 		path = CTRL1_SW_USB;
 		break;
 	case MAX14577_MUIC_ADC_FACTORY_MODE_UART_OFF:	/* ADC_JIG_UART_OFF */
 		/* PATH:AP_UART */
-		strcpy(cable_name, "JIG-UART-OFF");
 		path = CTRL1_SW_UART;
 		break;
 	default:
@@ -382,7 +369,7 @@ static int max14577_muic_jig_handler(struct max14577_muic_info *info,
 	if (ret < 0)
 		return ret;
 
-	extcon_set_cable_state(info->edev, cable_name, attached);
+	extcon_set_cable_state(info->edev, "JIG", attached);
 
 	return 0;
 }
diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
index a66bec8..1079321 100644
--- a/drivers/extcon/extcon-max77693.c
+++ b/drivers/extcon/extcon-max77693.c
@@ -209,10 +209,7 @@ enum {
 	EXTCON_CABLE_CHARGE_DOWNSTREAM,
 	EXTCON_CABLE_MHL,
 	EXTCON_CABLE_MHL_TA,
-	EXTCON_CABLE_JIG_USB_ON,
-	EXTCON_CABLE_JIG_USB_OFF,
-	EXTCON_CABLE_JIG_UART_OFF,
-	EXTCON_CABLE_JIG_UART_ON,
+	EXTCON_CABLE_JIG,
 	EXTCON_CABLE_DOCK_SMART,
 	EXTCON_CABLE_DOCK_DESK,
 	EXTCON_CABLE_DOCK_AUDIO,
@@ -229,10 +226,7 @@ static const char *max77693_extcon_cable[] = {
 	[EXTCON_CABLE_CHARGE_DOWNSTREAM]	= "Charge-downstream",
 	[EXTCON_CABLE_MHL]			= "MHL",
 	[EXTCON_CABLE_MHL_TA]			= "MHL-TA",
-	[EXTCON_CABLE_JIG_USB_ON]		= "JIG-USB-ON",
-	[EXTCON_CABLE_JIG_USB_OFF]		= "JIG-USB-OFF",
-	[EXTCON_CABLE_JIG_UART_OFF]		= "JIG-UART-OFF",
-	[EXTCON_CABLE_JIG_UART_ON]		= "JIG-UART-ON",
+	[EXTCON_CABLE_JIG]			= "JIG",
 	[EXTCON_CABLE_DOCK_SMART]		= "Dock-Smart",
 	[EXTCON_CABLE_DOCK_DESK]		= "Dock-Desk",
 	[EXTCON_CABLE_DOCK_AUDIO]		= "Dock-Audio",
@@ -642,7 +636,6 @@ static int max77693_muic_adc_ground_handler(struct max77693_muic_info *info)
 static int max77693_muic_jig_handler(struct max77693_muic_info *info,
 		int cable_type, bool attached)
 {
-	char cable_name[32];
 	int ret = 0;
 	u8 path = CONTROL1_SW_OPEN;
 
@@ -652,23 +645,13 @@ static int max77693_muic_jig_handler(struct max77693_muic_info *info,
 
 	switch (cable_type) {
 	case MAX77693_MUIC_ADC_FACTORY_MODE_USB_OFF:	/* ADC_JIG_USB_OFF */
-		/* PATH:AP_USB */
-		strcpy(cable_name, "JIG-USB-OFF");
-		path = CONTROL1_SW_USB;
-		break;
 	case MAX77693_MUIC_ADC_FACTORY_MODE_USB_ON:	/* ADC_JIG_USB_ON */
 		/* PATH:AP_USB */
-		strcpy(cable_name, "JIG-USB-ON");
 		path = CONTROL1_SW_USB;
 		break;
 	case MAX77693_MUIC_ADC_FACTORY_MODE_UART_OFF:	/* ADC_JIG_UART_OFF */
-		/* PATH:AP_UART */
-		strcpy(cable_name, "JIG-UART-OFF");
-		path = CONTROL1_SW_UART;
-		break;
 	case MAX77693_MUIC_ADC_FACTORY_MODE_UART_ON:	/* ADC_JIG_UART_ON */
 		/* PATH:AP_UART */
-		strcpy(cable_name, "JIG-UART-ON");
 		path = CONTROL1_SW_UART;
 		break;
 	default:
@@ -681,7 +664,7 @@ static int max77693_muic_jig_handler(struct max77693_muic_info *info,
 	if (ret < 0)
 		return ret;
 
-	extcon_set_cable_state(info->edev, cable_name, attached);
+	extcon_set_cable_state(info->edev, "JIG", attached);
 
 	return 0;
 }
diff --git a/drivers/extcon/extcon-max77843.c b/drivers/extcon/extcon-max77843.c
index 8db6a92..f1e688b 100644
--- a/drivers/extcon/extcon-max77843.c
+++ b/drivers/extcon/extcon-max77843.c
@@ -127,10 +127,7 @@ enum {
 	MAX77843_CABLE_SLOW_CHARGER,
 	MAX77843_CABLE_MHL,
 	MAX77843_CABLE_MHL_TA,
-	MAX77843_CABLE_JIG_USB_ON,
-	MAX77843_CABLE_JIG_USB_OFF,
-	MAX77843_CABLE_JIG_UART_ON,
-	MAX77843_CABLE_JIG_UART_OFF,
+	MAX77843_CABLE_JIG,
 
 	MAX77843_CABLE_NUM,
 };
@@ -144,10 +141,7 @@ static const char *max77843_extcon_cable[] = {
 	[MAX77843_CABLE_SLOW_CHARGER]		= "SLOW-CHARGER",
 	[MAX77843_CABLE_MHL]			= "MHL",
 	[MAX77843_CABLE_MHL_TA]			= "MHL-TA",
-	[MAX77843_CABLE_JIG_USB_ON]		= "JIG-USB-ON",
-	[MAX77843_CABLE_JIG_USB_OFF]		= "JIG-USB-OFF",
-	[MAX77843_CABLE_JIG_UART_ON]		= "JIG-UART-ON",
-	[MAX77843_CABLE_JIG_UART_OFF]		= "JIG-UART-OFF",
+	[MAX77843_CABLE_JIG]			= "JIG",
 };
 
 struct max77843_muic_irq {
@@ -385,36 +379,31 @@ static int max77843_muic_jig_handler(struct max77843_muic_info *info,
 		int cable_type, bool attached)
 {
 	int ret;
+	u8 path = CTRL1_SW_OPEN;
 
 	dev_dbg(info->dev, "external connector is %s (adc:0x%02x)\n",
 			attached ? "attached" : "detached", cable_type);
 
 	switch (cable_type) {
 	case MAX77843_MUIC_ADC_FACTORY_MODE_USB_OFF:
-		ret = max77843_muic_set_path(info, CONTROL1_SW_USB, attached);
-		if (ret < 0)
-			return ret;
-		extcon_set_cable_state(info->edev, "JIG-USB-OFF", attached);
-		break;
 	case MAX77843_MUIC_ADC_FACTORY_MODE_USB_ON:
-		ret = max77843_muic_set_path(info, CONTROL1_SW_USB, attached);
-		if (ret < 0)
-			return ret;
-		extcon_set_cable_state(info->edev, "JIG-USB-ON", attached);
+		path = CONTROL1_SW_USB;
 		break;
 	case MAX77843_MUIC_ADC_FACTORY_MODE_UART_OFF:
-		ret = max77843_muic_set_path(info, CONTROL1_SW_UART, attached);
-		if (ret < 0)
-			return ret;
-		extcon_set_cable_state(info->edev, "JIG-UART-OFF", attached);
+		path = CONTROL1_SW_UART;
 		break;
 	default:
-		ret = max77843_muic_set_path(info, CONTROL1_SW_OPEN, attached);
-		if (ret < 0)
-			return ret;
-		break;
+		dev_err(info->dev, "failed to detect %s jig cable\n",
+			attached ? "attached" : "detached");
+		return -EINVAL;
 	}
 
+	ret = max77843_muic_set_path(info, path, attached);
+	if (ret < 0)
+		return ret;
+
+	extcon_set_cable_state(info->edev, "JIG", attached);
+
 	return 0;
 }
 
diff --git a/drivers/extcon/extcon-rt8973a.c b/drivers/extcon/extcon-rt8973a.c
index 9ccd5af..8c2194f 100644
--- a/drivers/extcon/extcon-rt8973a.c
+++ b/drivers/extcon/extcon-rt8973a.c
@@ -94,10 +94,7 @@ enum {
 	EXTCON_CABLE_USB = 0,
 	EXTCON_CABLE_USB_HOST,
 	EXTCON_CABLE_TA,
-	EXTCON_CABLE_JIG_OFF_USB,
-	EXTCON_CABLE_JIG_ON_USB,
-	EXTCON_CABLE_JIG_OFF_UART,
-	EXTCON_CABLE_JIG_ON_UART,
+	EXTCON_CABLE_JIG,
 
 	EXTCON_CABLE_END,
 };
@@ -106,10 +103,7 @@ static const char *rt8973a_extcon_cable[] = {
 	[EXTCON_CABLE_USB]		= "USB",
 	[EXTCON_CABLE_USB_HOST]		= "USB-Host",
 	[EXTCON_CABLE_TA]		= "TA",
-	[EXTCON_CABLE_JIG_OFF_USB]	= "JIG-USB-OFF",
-	[EXTCON_CABLE_JIG_ON_USB]	= "JIG-USB-ON",
-	[EXTCON_CABLE_JIG_OFF_UART]	= "JIG-UART-OFF",
-	[EXTCON_CABLE_JIG_ON_UART]	= "JIG-UART-ON",
+	[EXTCON_CABLE_JIG]		= "JIG",
 	NULL,
 };
 
@@ -355,19 +349,13 @@ static int rt8973a_muic_cable_handler(struct rt8973a_muic_info *info,
 		con_sw = DM_DP_SWITCH_OPEN;
 		break;
 	case RT8973A_MUIC_ADC_FACTORY_MODE_BOOT_OFF_USB:
-		idx = EXTCON_CABLE_JIG_OFF_USB;
-		con_sw = DM_DP_SWITCH_UART;
-		break;
 	case RT8973A_MUIC_ADC_FACTORY_MODE_BOOT_ON_USB:
-		idx = EXTCON_CABLE_JIG_ON_USB;
-		con_sw = DM_DP_SWITCH_UART;
+		idx = EXTCON_CABLE_JIG;
+		con_sw = DM_DP_SWITCH_USB;
 		break;
 	case RT8973A_MUIC_ADC_FACTORY_MODE_BOOT_OFF_UART:
-		idx = EXTCON_CABLE_JIG_OFF_UART;
-		con_sw = DM_DP_SWITCH_UART;
-		break;
 	case RT8973A_MUIC_ADC_FACTORY_MODE_BOOT_ON_UART:
-		idx = EXTCON_CABLE_JIG_ON_UART;
+		idx = EXTCON_CABLE_JIG;
 		con_sw = DM_DP_SWITCH_UART;
 		break;
 	case RT8973A_MUIC_ADC_USB:
-- 
1.8.5.5


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/4] extcon: Unify the dock device names on MAX8997/77693
  2015-04-27 12:31 [PATCH 0/4] extcon: Modify the name of unused external connector Chanwoo Choi
  2015-04-27 12:31 ` [PATCH 1/4] extcon: Unify the jig cable names on RT8963 and MAX14577/77693/77843 Chanwoo Choi
@ 2015-04-27 12:31 ` Chanwoo Choi
  2015-04-30  2:12   ` Krzysztof Kozlowski
  2015-04-27 12:31 ` [PATCH 3/4] extcon: Alter MHL-TA cable name to TA cable name Chanwoo Choi
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 13+ messages in thread
From: Chanwoo Choi @ 2015-04-27 12:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: jaewon02.kim, k.kozlowski, myungjoo.ham, kyungmin.park, cw00.choi

This patch change the name of various dock devices as 'DOCK' because the name of
various dock devices have not the standard naming rules. The name of dock devices
include the differenct word but it is ambiguous and never important information
on user-space aspect. This patch unifies the name of dock devices as following:
- Dock-Smart   -->|--> DOCK
- Dock-Desk    -->|
- Dock-Audio   -->|
- Dock-Card    -->|

Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/extcon/extcon-max77693.c | 31 +++++++++++++------------------
 drivers/extcon/extcon-max8997.c  | 10 +++-------
 2 files changed, 16 insertions(+), 25 deletions(-)

diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
index 1079321..652bb13 100644
--- a/drivers/extcon/extcon-max77693.c
+++ b/drivers/extcon/extcon-max77693.c
@@ -210,9 +210,7 @@ enum {
 	EXTCON_CABLE_MHL,
 	EXTCON_CABLE_MHL_TA,
 	EXTCON_CABLE_JIG,
-	EXTCON_CABLE_DOCK_SMART,
-	EXTCON_CABLE_DOCK_DESK,
-	EXTCON_CABLE_DOCK_AUDIO,
+	EXTCON_CABLE_DOCK,
 
 	_EXTCON_CABLE_NUM,
 };
@@ -227,9 +225,7 @@ static const char *max77693_extcon_cable[] = {
 	[EXTCON_CABLE_MHL]			= "MHL",
 	[EXTCON_CABLE_MHL_TA]			= "MHL-TA",
 	[EXTCON_CABLE_JIG]			= "JIG",
-	[EXTCON_CABLE_DOCK_SMART]		= "Dock-Smart",
-	[EXTCON_CABLE_DOCK_DESK]		= "Dock-Desk",
-	[EXTCON_CABLE_DOCK_AUDIO]		= "Dock-Audio",
+	[EXTCON_CABLE_DOCK]			= "DOCK",
 
 	NULL,
 };
@@ -501,15 +497,15 @@ static int max77693_muic_dock_handler(struct max77693_muic_info *info,
 		}
 
 		/*
-		 * Notify Dock-Smart/MHL state.
-		 * - Dock-Smart device include three type of cable which
+		 * Notify Dock/MHL state.
+		 * - Dock device include three type of cable which
 		 * are HDMI, USB for mouse/keyboard and micro-usb port
-		 * for USB/TA cable. Dock-Smart device need always exteranl
-		 * power supply(USB/TA cable through micro-usb cable). Dock-
-		 * Smart device support screen output of target to separate
+		 * for USB/TA cable. Dock device need always exteranl
+		 * power supply(USB/TA cable through micro-usb cable). Dock
+		 * device support screen output of target to separate
 		 * monitor and mouse/keyboard for desktop mode.
 		 *
-		 * Features of 'USB/TA cable with Dock-Smart device'
+		 * Features of 'USB/TA cable with Dock device'
 		 * - Support MHL
 		 * - Support external output feature of audio
 		 * - Support charging through micro-usb port without data
@@ -523,14 +519,14 @@ static int max77693_muic_dock_handler(struct max77693_muic_info *info,
 		if (ret < 0)
 			return ret;
 
-		extcon_set_cable_state(info->edev, "Dock-Smart", attached);
+		extcon_set_cable_state(info->edev, "DOCK", attached);
 		extcon_set_cable_state(info->edev, "MHL", attached);
 		goto out;
 	case MAX77693_MUIC_ADC_AUDIO_MODE_REMOTE:	/* Dock-Desk */
-		strcpy(dock_name, "Dock-Desk");
+		strcpy(dock_name, "DOCK");
 		break;
 	case MAX77693_MUIC_ADC_AV_CABLE_NOLOAD:		/* Dock-Audio */
-		strcpy(dock_name, "Dock-Audio");
+		strcpy(dock_name, "DOCK");
 		if (!attached)
 			extcon_set_cable_state(info->edev, "USB", false);
 		break;
@@ -847,7 +843,7 @@ static int max77693_muic_chg_handler(struct max77693_muic_info *info)
 			extcon_set_cable_state(info->edev, "USB", attached);
 
 			if (!cable_attached)
-				extcon_set_cable_state(info->edev, "Dock-Audio",
+				extcon_set_cable_state(info->edev, "DOCK",
 						      cable_attached);
 			break;
 		case MAX77693_MUIC_ADC_RESERVED_ACC_3:		/* Dock-Smart */
@@ -876,8 +872,7 @@ static int max77693_muic_chg_handler(struct max77693_muic_info *info)
 			if (ret < 0)
 				return ret;
 
-			extcon_set_cable_state(info->edev, "Dock-Smart",
-					      attached);
+			extcon_set_cable_state(info->edev, "DOCK", attached);
 			extcon_set_cable_state(info->edev, "MHL", attached);
 
 			break;
diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c
index 5774e56..da269a1 100644
--- a/drivers/extcon/extcon-max8997.c
+++ b/drivers/extcon/extcon-max8997.c
@@ -153,8 +153,7 @@ enum {
 	EXTCON_CABLE_SLOW_CHARGER,
 	EXTCON_CABLE_CHARGE_DOWNSTREAM,
 	EXTCON_CABLE_MHL,
-	EXTCON_CABLE_DOCK_DESK,
-	EXTCON_CABLE_DOCK_CARD,
+	EXTCON_CABLE_DOCK,
 	EXTCON_CABLE_JIG,
 
 	_EXTCON_CABLE_NUM,
@@ -168,8 +167,7 @@ static const char *max8997_extcon_cable[] = {
 	[EXTCON_CABLE_SLOW_CHARGER]		= "Slow-charger",
 	[EXTCON_CABLE_CHARGE_DOWNSTREAM]	= "Charge-downstream",
 	[EXTCON_CABLE_MHL]			= "MHL",
-	[EXTCON_CABLE_DOCK_DESK]		= "Dock-Desk",
-	[EXTCON_CABLE_DOCK_CARD]		= "Dock-Card",
+	[EXTCON_CABLE_DOCK]			= "DOCK",
 	[EXTCON_CABLE_JIG]			= "JIG",
 
 	NULL,
@@ -374,10 +372,8 @@ static int max8997_muic_handle_dock(struct max8997_muic_info *info,
 
 	switch (cable_type) {
 	case MAX8997_MUIC_ADC_AV_CABLE_NOLOAD:
-		extcon_set_cable_state(info->edev, "Dock-desk", attached);
-		break;
 	case MAX8997_MUIC_ADC_FACTORY_MODE_UART_ON:
-		extcon_set_cable_state(info->edev, "Dock-card", attached);
+		extcon_set_cable_state(info->edev, "DOCK", attached);
 		break;
 	default:
 		dev_err(info->dev, "failed to detect %s dock device\n",
-- 
1.8.5.5


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 3/4] extcon: Alter MHL-TA cable name to TA cable name
  2015-04-27 12:31 [PATCH 0/4] extcon: Modify the name of unused external connector Chanwoo Choi
  2015-04-27 12:31 ` [PATCH 1/4] extcon: Unify the jig cable names on RT8963 and MAX14577/77693/77843 Chanwoo Choi
  2015-04-27 12:31 ` [PATCH 2/4] extcon: Unify the dock device names on MAX8997/77693 Chanwoo Choi
@ 2015-04-27 12:31 ` Chanwoo Choi
  2015-04-30  2:11   ` Krzysztof Kozlowski
  2015-04-27 12:31 ` [PATCH 4/4] extcon: adc-jack: Remove the unneeded num_cables field Chanwoo Choi
  2015-04-28  3:43 ` [PATCH 0/4] extcon: Modify the name of unused external connector Krzysztof Kozlowski
  4 siblings, 1 reply; 13+ messages in thread
From: Chanwoo Choi @ 2015-04-27 12:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: jaewon02.kim, k.kozlowski, myungjoo.ham, kyungmin.park, cw00.choi

This patch alters the MHL-TA cable name to TA cable name because MHL-TA is not
standard name. The MHL-TA is MHL cable with charger cable (TA or USB). So, this
patch use the TA cable instead of MHL-TA to inform the charger cable state.
- MHL-TA -> TA

Cc: Jaewon Kim <jaewon02.kim@samsung.com>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/extcon/extcon-max77693.c | 12 +++++-------
 drivers/extcon/extcon-max77843.c |  6 ++----
 2 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
index 652bb13..a4fe7fd 100644
--- a/drivers/extcon/extcon-max77693.c
+++ b/drivers/extcon/extcon-max77693.c
@@ -208,7 +208,6 @@ enum {
 	EXTCON_CABLE_SLOW_CHARGER,
 	EXTCON_CABLE_CHARGE_DOWNSTREAM,
 	EXTCON_CABLE_MHL,
-	EXTCON_CABLE_MHL_TA,
 	EXTCON_CABLE_JIG,
 	EXTCON_CABLE_DOCK,
 
@@ -223,7 +222,6 @@ static const char *max77693_extcon_cable[] = {
 	[EXTCON_CABLE_SLOW_CHARGER]		= "Slow-charger",
 	[EXTCON_CABLE_CHARGE_DOWNSTREAM]	= "Charge-downstream",
 	[EXTCON_CABLE_MHL]			= "MHL",
-	[EXTCON_CABLE_MHL_TA]			= "MHL-TA",
 	[EXTCON_CABLE_JIG]			= "JIG",
 	[EXTCON_CABLE_DOCK]			= "DOCK",
 
@@ -802,19 +800,19 @@ static int max77693_muic_chg_handler(struct max77693_muic_info *info)
 		case MAX77693_MUIC_GND_MHL:
 		case MAX77693_MUIC_GND_MHL_VB:
 			/*
-			 * MHL cable with MHL-TA(USB/TA) cable
+			 * MHL cable with USB/TA cable
 			 * - MHL cable include two port(HDMI line and separate
 			 * micro-usb port. When the target connect MHL cable,
-			 * extcon driver check whether MHL-TA(USB/TA) cable is
-			 * connected. If MHL-TA cable is connected, extcon
+			 * extcon driver check whether USB/TA cable is
+			 * connected. If USB/TA cable is connected, extcon
 			 * driver notify state to notifiee for charging battery.
 			 *
-			 * Features of 'MHL-TA(USB/TA) with MHL cable'
+			 * Features of 'USB/TA with MHL cable'
 			 * - Support MHL
 			 * - Support charging through micro-usb port without
 			 *   data connection
 			 */
-			extcon_set_cable_state(info->edev, "MHL-TA", attached);
+			extcon_set_cable_state(info->edev, "TA", attached);
 			if (!cable_attached)
 				extcon_set_cable_state(info->edev,
 						      "MHL", cable_attached);
diff --git a/drivers/extcon/extcon-max77843.c b/drivers/extcon/extcon-max77843.c
index f1e688b..28c784d 100644
--- a/drivers/extcon/extcon-max77843.c
+++ b/drivers/extcon/extcon-max77843.c
@@ -126,7 +126,6 @@ enum {
 	MAX77843_CABLE_FAST_CHARGER,
 	MAX77843_CABLE_SLOW_CHARGER,
 	MAX77843_CABLE_MHL,
-	MAX77843_CABLE_MHL_TA,
 	MAX77843_CABLE_JIG,
 
 	MAX77843_CABLE_NUM,
@@ -140,7 +139,6 @@ static const char *max77843_extcon_cable[] = {
 	[MAX77843_CABLE_FAST_CHARGER]		= "FAST-CHARGER",
 	[MAX77843_CABLE_SLOW_CHARGER]		= "SLOW-CHARGER",
 	[MAX77843_CABLE_MHL]			= "MHL",
-	[MAX77843_CABLE_MHL_TA]			= "MHL-TA",
 	[MAX77843_CABLE_JIG]			= "JIG",
 };
 
@@ -531,9 +529,9 @@ static int max77843_muic_chg_handler(struct max77843_muic_info *info)
 
 		/* Charger cable on MHL accessory is attach or detach */
 		if (gnd_type == MAX77843_MUIC_GND_MHL_VB)
-			extcon_set_cable_state(info->edev, "MHL-TA", true);
+			extcon_set_cable_state(info->edev, "TA", true);
 		else if (gnd_type == MAX77843_MUIC_GND_MHL)
-			extcon_set_cable_state(info->edev, "MHL-TA", false);
+			extcon_set_cable_state(info->edev, "TA", false);
 		break;
 	case MAX77843_MUIC_CHG_NONE:
 		break;
-- 
1.8.5.5


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 4/4] extcon: adc-jack: Remove the unneeded num_cables field
  2015-04-27 12:31 [PATCH 0/4] extcon: Modify the name of unused external connector Chanwoo Choi
                   ` (2 preceding siblings ...)
  2015-04-27 12:31 ` [PATCH 3/4] extcon: Alter MHL-TA cable name to TA cable name Chanwoo Choi
@ 2015-04-27 12:31 ` Chanwoo Choi
  2015-04-28  3:43 ` [PATCH 0/4] extcon: Modify the name of unused external connector Krzysztof Kozlowski
  4 siblings, 0 replies; 13+ messages in thread
From: Chanwoo Choi @ 2015-04-27 12:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: jaewon02.kim, k.kozlowski, myungjoo.ham, kyungmin.park, cw00.choi

This patch removes the 'num_cables' filed from 'struct adc_jack_pdata'
because 'struct extcon_dev' contains the 'max_supported' field which
means the number of supported cable of extcon device.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/extcon/extcon-adc-jack.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/drivers/extcon/extcon-adc-jack.c b/drivers/extcon/extcon-adc-jack.c
index 2bb82e5..768eaed 100644
--- a/drivers/extcon/extcon-adc-jack.c
+++ b/drivers/extcon/extcon-adc-jack.c
@@ -29,7 +29,6 @@
  * struct adc_jack_data - internal data for adc_jack device driver
  * @edev:		extcon device.
  * @cable_names:	list of supported cables.
- * @num_cables:		size of cable_names.
  * @adc_conditions:	list of adc value conditions.
  * @num_conditions:	size of adc_conditions.
  * @irq:		irq number of attach/detach event (0 if not exist).
@@ -42,7 +41,6 @@ struct adc_jack_data {
 	struct extcon_dev *edev;
 
 	const char **cable_names;
-	int num_cables;
 	struct adc_jack_cond *adc_conditions;
 	int num_conditions;
 
@@ -114,16 +112,6 @@ static int adc_jack_probe(struct platform_device *pdev)
 	}
 	data->edev->name = pdata->name;
 
-	/* Check the length of array and set num_cables */
-	for (i = 0; data->edev->supported_cable[i]; i++)
-		;
-	if (i == 0 || i > SUPPORTED_CABLE_MAX) {
-		dev_err(&pdev->dev, "error: pdata->cable_names size = %d\n",
-				i - 1);
-		return -EINVAL;
-	}
-	data->num_cables = i;
-
 	if (!pdata->adc_conditions ||
 			!pdata->adc_conditions[0].state) {
 		dev_err(&pdev->dev, "error: adc_conditions not defined.\n");
-- 
1.8.5.5


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/4] extcon: Modify the name of unused external connector
  2015-04-27 12:31 [PATCH 0/4] extcon: Modify the name of unused external connector Chanwoo Choi
                   ` (3 preceding siblings ...)
  2015-04-27 12:31 ` [PATCH 4/4] extcon: adc-jack: Remove the unneeded num_cables field Chanwoo Choi
@ 2015-04-28  3:43 ` Krzysztof Kozlowski
  2015-04-28  8:40   ` Chanwoo Choi
  4 siblings, 1 reply; 13+ messages in thread
From: Krzysztof Kozlowski @ 2015-04-28  3:43 UTC (permalink / raw)
  To: Chanwoo Choi, linux-kernel; +Cc: jaewon02.kim, myungjoo.ham, kyungmin.park

On 27.04.2015 21:31, Chanwoo Choi wrote:
> This patchset alter the unused name of external connector (jig/dock/MHL) as
> following. The name of jig cable and dock device include the non-standard H/W
> information. On user-space side, this information are not necessary. The extcon
> core will support the other method to inform the specific H/W information to
> kernel device driver and framework. For example, extcon core have the plan to add
> the notifier chain for USB ID/VBUS pin state. If extcon consumer (kernel device
> driver and framework) use the notifer chain for USB ID/VBUS, they can get the
> state of both JIG and USB when JIG-USB-ON cable is attached.
>
> And last patch removes the unused 'num_cables' filed on extcon-adc-jack.c.
>
> 1. jig cable name
> - JIG-USB-ON   -->|
> - JIG-USB-OFF  -->|
> - JIG-UART-ON  -->|
> - JIG-UART-OFF -->|--> JIG
>
> 2. dock device name
> - Dock-Smart   -->|
> - Dock-Desk    -->|
> - Dock-Audio   -->|
> - Dock-Card    -->|--> DOCK
>
> 3. MHL-TA cable name
> - MHL-TA -> TA

Hi,

That makes sense but isn't such change a break of interface with 
user-space? The user-space may expect Dock-xxx for Dock.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/4] extcon: Modify the name of unused external connector
  2015-04-28  3:43 ` [PATCH 0/4] extcon: Modify the name of unused external connector Krzysztof Kozlowski
@ 2015-04-28  8:40   ` Chanwoo Choi
  2015-04-30  2:10     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 13+ messages in thread
From: Chanwoo Choi @ 2015-04-28  8:40 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: linux-kernel, jaewon02.kim, myungjoo.ham, Kyungmin Park

On Tue, Apr 28, 2015 at 12:43 PM, Krzysztof Kozlowski
<k.kozlowski@samsung.com> wrote:
> On 27.04.2015 21:31, Chanwoo Choi wrote:
>>
>> This patchset alter the unused name of external connector (jig/dock/MHL)
>> as
>> following. The name of jig cable and dock device include the non-standard
>> H/W
>> information. On user-space side, this information are not necessary. The
>> extcon
>> core will support the other method to inform the specific H/W information
>> to
>> kernel device driver and framework. For example, extcon core have the plan
>> to add
>> the notifier chain for USB ID/VBUS pin state. If extcon consumer (kernel
>> device
>> driver and framework) use the notifer chain for USB ID/VBUS, they can get
>> the
>> state of both JIG and USB when JIG-USB-ON cable is attached.
>>
>> And last patch removes the unused 'num_cables' filed on extcon-adc-jack.c.
>>
>> 1. jig cable name
>> - JIG-USB-ON   -->|
>> - JIG-USB-OFF  -->|
>> - JIG-UART-ON  -->|
>> - JIG-UART-OFF -->|--> JIG
>>
>> 2. dock device name
>> - Dock-Smart   -->|
>> - Dock-Desk    -->|
>> - Dock-Audio   -->|
>> - Dock-Card    -->|--> DOCK
>>
>> 3. MHL-TA cable name
>> - MHL-TA -> TA
>
>
> Hi,
>
> That makes sense but isn't such change a break of interface with user-space?
> The user-space may expect Dock-xxx for Dock.

I guess it's possible. But, the "Dock-{Smart|Desk|Audio}" device name are not
standard. Their name are only used for Samsung Galaxy S3 (releaesd 3.0
kernel) and it is not for mainline kernel.

So, I want to make the standard cable name for mainline kernel and user-space.
The extcon driver will send the event of 'dock' device with specific
external connector which is connected to 'dock' device.

For example, Dock-Smart means the Dock device with MHL cable. When
Dock-Smart is attached, extcon driver will send the two external
connector state of
both 'DOCK' and 'MHL'. So, the user-space process will detect the kind of dock
by catching both 'DOCK' and 'MHL' uevent.

Thanks,
Chanwoo Choi

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/4] extcon: Unify the jig cable names on RT8963 and MAX14577/77693/77843
  2015-04-27 12:31 ` [PATCH 1/4] extcon: Unify the jig cable names on RT8963 and MAX14577/77693/77843 Chanwoo Choi
@ 2015-04-30  2:00   ` Krzysztof Kozlowski
  2015-04-30  2:03     ` Chanwoo Choi
  0 siblings, 1 reply; 13+ messages in thread
From: Krzysztof Kozlowski @ 2015-04-30  2:00 UTC (permalink / raw)
  To: Chanwoo Choi, linux-kernel; +Cc: jaewon02.kim, myungjoo.ham, kyungmin.park

On 27.04.2015 21:31, Chanwoo Choi wrote:
> This patch change the name of various jig cables as 'JIG' because the name of
> various jig cables are strange and ambiguous on user-space aspect. They include
> the different information of either USB and UART state. It is never important
> for user-space process. This patch unifies the name of jig cables as following:
> - JIG-USB-ON   -->|--> JIG
> - JIG-USB-OFF  -->|
> - JIG-UART-ON  -->|
> - JIG-UART-OFF -->|
>
> Cc: Jaewon Kim <jaewon02.kim@samsung.com>
> Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> ---
>   drivers/extcon/extcon-max14577.c | 19 +++----------------
>   drivers/extcon/extcon-max77693.c | 23 +++--------------------
>   drivers/extcon/extcon-max77843.c | 39 ++++++++++++++-------------------------
>   drivers/extcon/extcon-rt8973a.c  | 22 +++++-----------------
>   4 files changed, 25 insertions(+), 78 deletions(-)
>
> diff --git a/drivers/extcon/extcon-max14577.c b/drivers/extcon/extcon-max14577.c
> index 3823aa4..6d5febe 100644
> --- a/drivers/extcon/extcon-max14577.c
> +++ b/drivers/extcon/extcon-max14577.c
> @@ -155,10 +155,7 @@ enum {
>   	EXTCON_CABLE_FAST_CHARGER,
>   	EXTCON_CABLE_SLOW_CHARGER,
>   	EXTCON_CABLE_CHARGE_DOWNSTREAM,
> -	EXTCON_CABLE_JIG_USB_ON,
> -	EXTCON_CABLE_JIG_USB_OFF,
> -	EXTCON_CABLE_JIG_UART_OFF,
> -	EXTCON_CABLE_JIG_UART_ON,
> +	EXTCON_CABLE_JIG,
>
>   	_EXTCON_CABLE_NUM,
>   };
> @@ -169,10 +166,7 @@ static const char *max14577_extcon_cable[] = {
>   	[EXTCON_CABLE_FAST_CHARGER]		= "Fast-charger",
>   	[EXTCON_CABLE_SLOW_CHARGER]		= "Slow-charger",
>   	[EXTCON_CABLE_CHARGE_DOWNSTREAM]	= "Charge-downstream",
> -	[EXTCON_CABLE_JIG_USB_ON]		= "JIG-USB-ON",
> -	[EXTCON_CABLE_JIG_USB_OFF]		= "JIG-USB-OFF",
> -	[EXTCON_CABLE_JIG_UART_OFF]		= "JIG-UART-OFF",
> -	[EXTCON_CABLE_JIG_UART_ON]		= "JIG-UART-ON",
> +	[EXTCON_CABLE_JIG]			= "JIG",
>
>   	NULL,
>   };
> @@ -348,7 +342,6 @@ static int max14577_muic_get_cable_type(struct max14577_muic_info *info,
>   static int max14577_muic_jig_handler(struct max14577_muic_info *info,
>   		int cable_type, bool attached)
>   {
> -	char cable_name[32];
>   	int ret = 0;
>   	u8 path = CTRL1_SW_OPEN;
>
> @@ -358,18 +351,12 @@ static int max14577_muic_jig_handler(struct max14577_muic_info *info,
>
>   	switch (cable_type) {
>   	case MAX14577_MUIC_ADC_FACTORY_MODE_USB_OFF:	/* ADC_JIG_USB_OFF */
> -		/* PATH:AP_USB */
> -		strcpy(cable_name, "JIG-USB-OFF");
> -		path = CTRL1_SW_USB;
> -		break;
>   	case MAX14577_MUIC_ADC_FACTORY_MODE_USB_ON:	/* ADC_JIG_USB_ON */
>   		/* PATH:AP_USB */
> -		strcpy(cable_name, "JIG-USB-ON");
>   		path = CTRL1_SW_USB;
>   		break;
>   	case MAX14577_MUIC_ADC_FACTORY_MODE_UART_OFF:	/* ADC_JIG_UART_OFF */
>   		/* PATH:AP_UART */
> -		strcpy(cable_name, "JIG-UART-OFF");
>   		path = CTRL1_SW_UART;
>   		break;
>   	default:
> @@ -382,7 +369,7 @@ static int max14577_muic_jig_handler(struct max14577_muic_info *info,
>   	if (ret < 0)
>   		return ret;
>
> -	extcon_set_cable_state(info->edev, cable_name, attached);
> +	extcon_set_cable_state(info->edev, "JIG", attached);
>
>   	return 0;
>   }
> diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
> index a66bec8..1079321 100644
> --- a/drivers/extcon/extcon-max77693.c
> +++ b/drivers/extcon/extcon-max77693.c
> @@ -209,10 +209,7 @@ enum {
>   	EXTCON_CABLE_CHARGE_DOWNSTREAM,
>   	EXTCON_CABLE_MHL,
>   	EXTCON_CABLE_MHL_TA,
> -	EXTCON_CABLE_JIG_USB_ON,
> -	EXTCON_CABLE_JIG_USB_OFF,
> -	EXTCON_CABLE_JIG_UART_OFF,
> -	EXTCON_CABLE_JIG_UART_ON,
> +	EXTCON_CABLE_JIG,
>   	EXTCON_CABLE_DOCK_SMART,
>   	EXTCON_CABLE_DOCK_DESK,
>   	EXTCON_CABLE_DOCK_AUDIO,
> @@ -229,10 +226,7 @@ static const char *max77693_extcon_cable[] = {
>   	[EXTCON_CABLE_CHARGE_DOWNSTREAM]	= "Charge-downstream",
>   	[EXTCON_CABLE_MHL]			= "MHL",
>   	[EXTCON_CABLE_MHL_TA]			= "MHL-TA",
> -	[EXTCON_CABLE_JIG_USB_ON]		= "JIG-USB-ON",
> -	[EXTCON_CABLE_JIG_USB_OFF]		= "JIG-USB-OFF",
> -	[EXTCON_CABLE_JIG_UART_OFF]		= "JIG-UART-OFF",
> -	[EXTCON_CABLE_JIG_UART_ON]		= "JIG-UART-ON",
> +	[EXTCON_CABLE_JIG]			= "JIG",
>   	[EXTCON_CABLE_DOCK_SMART]		= "Dock-Smart",
>   	[EXTCON_CABLE_DOCK_DESK]		= "Dock-Desk",
>   	[EXTCON_CABLE_DOCK_AUDIO]		= "Dock-Audio",
> @@ -642,7 +636,6 @@ static int max77693_muic_adc_ground_handler(struct max77693_muic_info *info)
>   static int max77693_muic_jig_handler(struct max77693_muic_info *info,
>   		int cable_type, bool attached)
>   {
> -	char cable_name[32];
>   	int ret = 0;
>   	u8 path = CONTROL1_SW_OPEN;
>
> @@ -652,23 +645,13 @@ static int max77693_muic_jig_handler(struct max77693_muic_info *info,
>
>   	switch (cable_type) {
>   	case MAX77693_MUIC_ADC_FACTORY_MODE_USB_OFF:	/* ADC_JIG_USB_OFF */
> -		/* PATH:AP_USB */
> -		strcpy(cable_name, "JIG-USB-OFF");
> -		path = CONTROL1_SW_USB;
> -		break;
>   	case MAX77693_MUIC_ADC_FACTORY_MODE_USB_ON:	/* ADC_JIG_USB_ON */
>   		/* PATH:AP_USB */
> -		strcpy(cable_name, "JIG-USB-ON");
>   		path = CONTROL1_SW_USB;
>   		break;
>   	case MAX77693_MUIC_ADC_FACTORY_MODE_UART_OFF:	/* ADC_JIG_UART_OFF */
> -		/* PATH:AP_UART */
> -		strcpy(cable_name, "JIG-UART-OFF");
> -		path = CONTROL1_SW_UART;
> -		break;
>   	case MAX77693_MUIC_ADC_FACTORY_MODE_UART_ON:	/* ADC_JIG_UART_ON */
>   		/* PATH:AP_UART */
> -		strcpy(cable_name, "JIG-UART-ON");
>   		path = CONTROL1_SW_UART;
>   		break;
>   	default:
> @@ -681,7 +664,7 @@ static int max77693_muic_jig_handler(struct max77693_muic_info *info,
>   	if (ret < 0)
>   		return ret;
>
> -	extcon_set_cable_state(info->edev, cable_name, attached);
> +	extcon_set_cable_state(info->edev, "JIG", attached);
>
>   	return 0;
>   }
> diff --git a/drivers/extcon/extcon-max77843.c b/drivers/extcon/extcon-max77843.c
> index 8db6a92..f1e688b 100644
> --- a/drivers/extcon/extcon-max77843.c
> +++ b/drivers/extcon/extcon-max77843.c
> @@ -127,10 +127,7 @@ enum {
>   	MAX77843_CABLE_SLOW_CHARGER,
>   	MAX77843_CABLE_MHL,
>   	MAX77843_CABLE_MHL_TA,
> -	MAX77843_CABLE_JIG_USB_ON,
> -	MAX77843_CABLE_JIG_USB_OFF,
> -	MAX77843_CABLE_JIG_UART_ON,
> -	MAX77843_CABLE_JIG_UART_OFF,
> +	MAX77843_CABLE_JIG,
>
>   	MAX77843_CABLE_NUM,
>   };
> @@ -144,10 +141,7 @@ static const char *max77843_extcon_cable[] = {
>   	[MAX77843_CABLE_SLOW_CHARGER]		= "SLOW-CHARGER",
>   	[MAX77843_CABLE_MHL]			= "MHL",
>   	[MAX77843_CABLE_MHL_TA]			= "MHL-TA",
> -	[MAX77843_CABLE_JIG_USB_ON]		= "JIG-USB-ON",
> -	[MAX77843_CABLE_JIG_USB_OFF]		= "JIG-USB-OFF",
> -	[MAX77843_CABLE_JIG_UART_ON]		= "JIG-UART-ON",
> -	[MAX77843_CABLE_JIG_UART_OFF]		= "JIG-UART-OFF",
> +	[MAX77843_CABLE_JIG]			= "JIG",
>   };
>
>   struct max77843_muic_irq {
> @@ -385,36 +379,31 @@ static int max77843_muic_jig_handler(struct max77843_muic_info *info,
>   		int cable_type, bool attached)
>   {
>   	int ret;
> +	u8 path = CTRL1_SW_OPEN;
>
>   	dev_dbg(info->dev, "external connector is %s (adc:0x%02x)\n",
>   			attached ? "attached" : "detached", cable_type);
>
>   	switch (cable_type) {
>   	case MAX77843_MUIC_ADC_FACTORY_MODE_USB_OFF:
> -		ret = max77843_muic_set_path(info, CONTROL1_SW_USB, attached);
> -		if (ret < 0)
> -			return ret;
> -		extcon_set_cable_state(info->edev, "JIG-USB-OFF", attached);
> -		break;
>   	case MAX77843_MUIC_ADC_FACTORY_MODE_USB_ON:
> -		ret = max77843_muic_set_path(info, CONTROL1_SW_USB, attached);
> -		if (ret < 0)
> -			return ret;
> -		extcon_set_cable_state(info->edev, "JIG-USB-ON", attached);
> +		path = CONTROL1_SW_USB;
>   		break;
>   	case MAX77843_MUIC_ADC_FACTORY_MODE_UART_OFF:
> -		ret = max77843_muic_set_path(info, CONTROL1_SW_UART, attached);
> -		if (ret < 0)
> -			return ret;
> -		extcon_set_cable_state(info->edev, "JIG-UART-OFF", attached);
> +		path = CONTROL1_SW_UART;
>   		break;
>   	default:
> -		ret = max77843_muic_set_path(info, CONTROL1_SW_OPEN, attached);
> -		if (ret < 0)
> -			return ret;
> -		break;
> +		dev_err(info->dev, "failed to detect %s jig cable\n",
> +			attached ? "attached" : "detached");
> +		return -EINVAL;

The logic for this default case is changed and it is not related to the 
patch (unification of JIG). Could you split it into separate patch?

Rest looks fine.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 1/4] extcon: Unify the jig cable names on RT8963 and MAX14577/77693/77843
  2015-04-30  2:00   ` Krzysztof Kozlowski
@ 2015-04-30  2:03     ` Chanwoo Choi
  0 siblings, 0 replies; 13+ messages in thread
From: Chanwoo Choi @ 2015-04-30  2:03 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: linux-kernel, jaewon02.kim, myungjoo.ham, kyungmin.park

On 04/30/2015 11:00 AM, Krzysztof Kozlowski wrote:
> On 27.04.2015 21:31, Chanwoo Choi wrote:
>> This patch change the name of various jig cables as 'JIG' because the name of
>> various jig cables are strange and ambiguous on user-space aspect. They include
>> the different information of either USB and UART state. It is never important
>> for user-space process. This patch unifies the name of jig cables as following:
>> - JIG-USB-ON   -->|--> JIG
>> - JIG-USB-OFF  -->|
>> - JIG-UART-ON  -->|
>> - JIG-UART-OFF -->|
>>
>> Cc: Jaewon Kim <jaewon02.kim@samsung.com>
>> Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
>> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
>> ---
>>   drivers/extcon/extcon-max14577.c | 19 +++----------------
>>   drivers/extcon/extcon-max77693.c | 23 +++--------------------
>>   drivers/extcon/extcon-max77843.c | 39 ++++++++++++++-------------------------
>>   drivers/extcon/extcon-rt8973a.c  | 22 +++++-----------------
>>   4 files changed, 25 insertions(+), 78 deletions(-)
>>

[snip]

>>   struct max77843_muic_irq {
>> @@ -385,36 +379,31 @@ static int max77843_muic_jig_handler(struct max77843_muic_info *info,
>>           int cable_type, bool attached)
>>   {
>>       int ret;
>> +    u8 path = CTRL1_SW_OPEN;
>>
>>       dev_dbg(info->dev, "external connector is %s (adc:0x%02x)\n",
>>               attached ? "attached" : "detached", cable_type);
>>
>>       switch (cable_type) {
>>       case MAX77843_MUIC_ADC_FACTORY_MODE_USB_OFF:
>> -        ret = max77843_muic_set_path(info, CONTROL1_SW_USB, attached);
>> -        if (ret < 0)
>> -            return ret;
>> -        extcon_set_cable_state(info->edev, "JIG-USB-OFF", attached);
>> -        break;
>>       case MAX77843_MUIC_ADC_FACTORY_MODE_USB_ON:
>> -        ret = max77843_muic_set_path(info, CONTROL1_SW_USB, attached);
>> -        if (ret < 0)
>> -            return ret;
>> -        extcon_set_cable_state(info->edev, "JIG-USB-ON", attached);
>> +        path = CONTROL1_SW_USB;
>>           break;
>>       case MAX77843_MUIC_ADC_FACTORY_MODE_UART_OFF:
>> -        ret = max77843_muic_set_path(info, CONTROL1_SW_UART, attached);
>> -        if (ret < 0)
>> -            return ret;
>> -        extcon_set_cable_state(info->edev, "JIG-UART-OFF", attached);
>> +        path = CONTROL1_SW_UART;
>>           break;
>>       default:
>> -        ret = max77843_muic_set_path(info, CONTROL1_SW_OPEN, attached);
>> -        if (ret < 0)
>> -            return ret;
>> -        break;
>> +        dev_err(info->dev, "failed to detect %s jig cable\n",
>> +            attached ? "attached" : "detached");
>> +        return -EINVAL;
> 
> The logic for this default case is changed and it is not related to the patch (unification of JIG). Could you split it into separate patch?
> 
> Rest looks fine.

OK. I'll split out.

Thanks,
Chanwoo Choi


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/4] extcon: Modify the name of unused external connector
  2015-04-28  8:40   ` Chanwoo Choi
@ 2015-04-30  2:10     ` Krzysztof Kozlowski
  2015-05-04  5:37       ` Chanwoo Choi
  0 siblings, 1 reply; 13+ messages in thread
From: Krzysztof Kozlowski @ 2015-04-30  2:10 UTC (permalink / raw)
  To: cw00.choi; +Cc: linux-kernel, jaewon02.kim, myungjoo.ham, Kyungmin Park

On 28.04.2015 17:40, Chanwoo Choi wrote:
> On Tue, Apr 28, 2015 at 12:43 PM, Krzysztof Kozlowski
> <k.kozlowski@samsung.com> wrote:
>> On 27.04.2015 21:31, Chanwoo Choi wrote:
>>>
>>> This patchset alter the unused name of external connector (jig/dock/MHL)
>>> as
>>> following. The name of jig cable and dock device include the non-standard
>>> H/W
>>> information. On user-space side, this information are not necessary. The
>>> extcon
>>> core will support the other method to inform the specific H/W information
>>> to
>>> kernel device driver and framework. For example, extcon core have the plan
>>> to add
>>> the notifier chain for USB ID/VBUS pin state. If extcon consumer (kernel
>>> device
>>> driver and framework) use the notifer chain for USB ID/VBUS, they can get
>>> the
>>> state of both JIG and USB when JIG-USB-ON cable is attached.
>>>
>>> And last patch removes the unused 'num_cables' filed on extcon-adc-jack.c.
>>>
>>> 1. jig cable name
>>> - JIG-USB-ON   -->|
>>> - JIG-USB-OFF  -->|
>>> - JIG-UART-ON  -->|
>>> - JIG-UART-OFF -->|--> JIG
>>>
>>> 2. dock device name
>>> - Dock-Smart   -->|
>>> - Dock-Desk    -->|
>>> - Dock-Audio   -->|
>>> - Dock-Card    -->|--> DOCK
>>>
>>> 3. MHL-TA cable name
>>> - MHL-TA -> TA
>>
>>
>> Hi,
>>
>> That makes sense but isn't such change a break of interface with user-space?
>> The user-space may expect Dock-xxx for Dock.
>
> I guess it's possible. But, the "Dock-{Smart|Desk|Audio}" device name are not
> standard. Their name are only used for Samsung Galaxy S3 (releaesd 3.0
> kernel) and it is not for mainline kernel.
>
> So, I want to make the standard cable name for mainline kernel and user-space.
> The extcon driver will send the event of 'dock' device with specific
> external connector which is connected to 'dock' device.
>
> For example, Dock-Smart means the Dock device with MHL cable. When
> Dock-Smart is attached, extcon driver will send the two external
> connector state of
> both 'DOCK' and 'MHL'. So, the user-space process will detect the kind of dock
> by catching both 'DOCK' and 'MHL' uevent.

Okay, one more concern - for Dock-Smart the extcon will send two 
consecutive events (first DOCK, then MHL). So to distinguish this from 
two separate connections of Dock and MHL (user first connects some Dock, 
disconnects, connects MHL), the driver always has to call 
extcon_set_cable_state(edev, "Dock", false) after disconnection.

Without the "disconnect" state this case would mean for userspace 
"Dock+MHL".

This looks like an important part of API for extcon and for driver 
implementations. So it should be documented somewhere?

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 3/4] extcon: Alter MHL-TA cable name to TA cable name
  2015-04-27 12:31 ` [PATCH 3/4] extcon: Alter MHL-TA cable name to TA cable name Chanwoo Choi
@ 2015-04-30  2:11   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 13+ messages in thread
From: Krzysztof Kozlowski @ 2015-04-30  2:11 UTC (permalink / raw)
  To: Chanwoo Choi, linux-kernel; +Cc: jaewon02.kim, myungjoo.ham, kyungmin.park

On 27.04.2015 21:31, Chanwoo Choi wrote:
> This patch alters the MHL-TA cable name to TA cable name because MHL-TA is not
> standard name. The MHL-TA is MHL cable with charger cable (TA or USB). So, this
> patch use the TA cable instead of MHL-TA to inform the charger cable state.
> - MHL-TA -> TA
>
> Cc: Jaewon Kim <jaewon02.kim@samsung.com>
> Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> ---
>   drivers/extcon/extcon-max77693.c | 12 +++++-------
>   drivers/extcon/extcon-max77843.c |  6 ++----
>   2 files changed, 7 insertions(+), 11 deletions(-)
>

Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

Best regards,
Krzysztof



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 2/4] extcon: Unify the dock device names on MAX8997/77693
  2015-04-27 12:31 ` [PATCH 2/4] extcon: Unify the dock device names on MAX8997/77693 Chanwoo Choi
@ 2015-04-30  2:12   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 13+ messages in thread
From: Krzysztof Kozlowski @ 2015-04-30  2:12 UTC (permalink / raw)
  To: Chanwoo Choi, linux-kernel; +Cc: jaewon02.kim, myungjoo.ham, kyungmin.park

On 27.04.2015 21:31, Chanwoo Choi wrote:
> This patch change the name of various dock devices as 'DOCK' because the name of
> various dock devices have not the standard naming rules. The name of dock devices
> include the differenct word but it is ambiguous and never important information
> on user-space aspect. This patch unifies the name of dock devices as following:
> - Dock-Smart   -->|--> DOCK
> - Dock-Desk    -->|
> - Dock-Audio   -->|
> - Dock-Card    -->|
>
> Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>

Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

Best regards,
Krzysztof



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 0/4] extcon: Modify the name of unused external connector
  2015-04-30  2:10     ` Krzysztof Kozlowski
@ 2015-05-04  5:37       ` Chanwoo Choi
  0 siblings, 0 replies; 13+ messages in thread
From: Chanwoo Choi @ 2015-05-04  5:37 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: linux-kernel, jaewon02.kim, myungjoo.ham, Kyungmin Park

On 04/30/2015 11:10 AM, Krzysztof Kozlowski wrote:
> On 28.04.2015 17:40, Chanwoo Choi wrote:
>> On Tue, Apr 28, 2015 at 12:43 PM, Krzysztof Kozlowski
>> <k.kozlowski@samsung.com> wrote:
>>> On 27.04.2015 21:31, Chanwoo Choi wrote:
>>>>
>>>> This patchset alter the unused name of external connector (jig/dock/MHL)
>>>> as
>>>> following. The name of jig cable and dock device include the non-standard
>>>> H/W
>>>> information. On user-space side, this information are not necessary. The
>>>> extcon
>>>> core will support the other method to inform the specific H/W information
>>>> to
>>>> kernel device driver and framework. For example, extcon core have the plan
>>>> to add
>>>> the notifier chain for USB ID/VBUS pin state. If extcon consumer (kernel
>>>> device
>>>> driver and framework) use the notifer chain for USB ID/VBUS, they can get
>>>> the
>>>> state of both JIG and USB when JIG-USB-ON cable is attached.
>>>>
>>>> And last patch removes the unused 'num_cables' filed on extcon-adc-jack.c.
>>>>
>>>> 1. jig cable name
>>>> - JIG-USB-ON   -->|
>>>> - JIG-USB-OFF  -->|
>>>> - JIG-UART-ON  -->|
>>>> - JIG-UART-OFF -->|--> JIG
>>>>
>>>> 2. dock device name
>>>> - Dock-Smart   -->|
>>>> - Dock-Desk    -->|
>>>> - Dock-Audio   -->|
>>>> - Dock-Card    -->|--> DOCK
>>>>
>>>> 3. MHL-TA cable name
>>>> - MHL-TA -> TA
>>>
>>>
>>> Hi,
>>>
>>> That makes sense but isn't such change a break of interface with user-space?
>>> The user-space may expect Dock-xxx for Dock.
>>
>> I guess it's possible. But, the "Dock-{Smart|Desk|Audio}" device name are not
>> standard. Their name are only used for Samsung Galaxy S3 (releaesd 3.0
>> kernel) and it is not for mainline kernel.
>>
>> So, I want to make the standard cable name for mainline kernel and user-space.
>> The extcon driver will send the event of 'dock' device with specific
>> external connector which is connected to 'dock' device.
>>
>> For example, Dock-Smart means the Dock device with MHL cable. When
>> Dock-Smart is attached, extcon driver will send the two external
>> connector state of
>> both 'DOCK' and 'MHL'. So, the user-space process will detect the kind of dock
>> by catching both 'DOCK' and 'MHL' uevent.
> 
> Okay, one more concern - for Dock-Smart the extcon will send two consecutive events (first DOCK, then MHL). So to distinguish this from two separate connections of Dock and MHL (user first connects some Dock, disconnects, connects MHL), the driver always has to call extcon_set_cable_state(edev, "Dock", false) after disconnection.
> 
> Without the "disconnect" state this case would mean for userspace "Dock+MHL".
> 
> This looks like an important part of API for extcon and for driver implementations. So it should be documented somewhere?

There is no document about it. I'll send other patch for the sequence of two events as following:

- attached
1. DOCK is attached
2. MHL is attached
- detached
1. MHL is detached
2. DOCK is detached

Thanks,
Chanwoo Choi



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-05-04  5:37 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-27 12:31 [PATCH 0/4] extcon: Modify the name of unused external connector Chanwoo Choi
2015-04-27 12:31 ` [PATCH 1/4] extcon: Unify the jig cable names on RT8963 and MAX14577/77693/77843 Chanwoo Choi
2015-04-30  2:00   ` Krzysztof Kozlowski
2015-04-30  2:03     ` Chanwoo Choi
2015-04-27 12:31 ` [PATCH 2/4] extcon: Unify the dock device names on MAX8997/77693 Chanwoo Choi
2015-04-30  2:12   ` Krzysztof Kozlowski
2015-04-27 12:31 ` [PATCH 3/4] extcon: Alter MHL-TA cable name to TA cable name Chanwoo Choi
2015-04-30  2:11   ` Krzysztof Kozlowski
2015-04-27 12:31 ` [PATCH 4/4] extcon: adc-jack: Remove the unneeded num_cables field Chanwoo Choi
2015-04-28  3:43 ` [PATCH 0/4] extcon: Modify the name of unused external connector Krzysztof Kozlowski
2015-04-28  8:40   ` Chanwoo Choi
2015-04-30  2:10     ` Krzysztof Kozlowski
2015-05-04  5:37       ` Chanwoo Choi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).