From: Roger Quadros <rogerq@ti.com>
To: Chanwoo Choi <cw00.choi@samsung.com>, <linux-kernel@vger.kernel.org>
Cc: <k.kozlowski@samsung.com>, <ckeepax@opensource.wolfsonmicro.com>,
<gregkh@linuxfoundation.org>, <ramakrishna.pallala@intel.com>,
<patches@opensource.wolfsonmicro.com>, <myungjoo.ham@samsung.com>
Subject: Re: [PATCH 2/2] extcon: Add the support of EXTCON_CHG_USB when SDP port is attached or detached
Date: Tue, 6 Oct 2015 14:49:39 +0300 [thread overview]
Message-ID: <5613B553.9080005@ti.com> (raw)
In-Reply-To: <1444130485-23325-3-git-send-email-cw00.choi@samsung.com>
Hi,
On 06/10/15 14:21, Chanwoo Choi wrote:
> The SDP (Standard Downstream Port) is one of various USB Charging ports. The SDP
> supports both the data transmission and the charging through USB connector at
> the same time. So, the EXTCON framework defines two connector type for USB SDP
> connector as following:
> - EXTCON_USB means the USB cable for data transmission.
> - EXTCON_CHG_USB means the USB charger cable for battery charging.
>
> This patch add the support of EXTCON_CHG_USB when USB SDP is attached or
> detached.
I didn't understand why this change is needed. SDP, EXTCON_USB and EXTCON_CHG_USB
are the same thing. no?
cheers,
-roger
>
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> ---
> drivers/extcon/extcon-max14577.c | 2 ++
> drivers/extcon/extcon-max77693.c | 11 ++++++++++-
> drivers/extcon/extcon-max77843.c | 2 ++
> drivers/extcon/extcon-max8997.c | 2 ++
> drivers/extcon/extcon-palmas.c | 3 +++
> drivers/extcon/extcon-rt8973a.c | 3 +++
> drivers/extcon/extcon-sm5502.c | 3 +++
> drivers/extcon/extcon-usb-gpio.c | 3 +++
> 8 files changed, 28 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/extcon/extcon-max14577.c b/drivers/extcon/extcon-max14577.c
> index 15c2dcc73fc6..f262dad10560 100644
> --- a/drivers/extcon/extcon-max14577.c
> +++ b/drivers/extcon/extcon-max14577.c
> @@ -150,6 +150,7 @@ enum max14577_muic_acc_type {
>
> static const unsigned int max14577_extcon_cable[] = {
> EXTCON_USB,
> + EXTCON_CHG_USB,
> EXTCON_CHG_USB_DCP,
> EXTCON_CHG_USB_DCP_FAST,
> EXTCON_CHG_USB_DCP_SLOW,
> @@ -454,6 +455,7 @@ static int max14577_muic_chg_handler(struct max14577_muic_info *info)
> return ret;
>
> extcon_set_cable_state_(info->edev, EXTCON_USB, attached);
> + extcon_set_cable_state_(info->edev, EXTCON_CHG_USB, attached);
> break;
> case MAX14577_CHARGER_TYPE_DEDICATED_CHG:
> extcon_set_cable_state_(info->edev, EXTCON_CHG_USB_DCP,
> diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
> index 95c707b1fcee..ee63718de787 100644
> --- a/drivers/extcon/extcon-max77693.c
> +++ b/drivers/extcon/extcon-max77693.c
> @@ -204,6 +204,7 @@ enum max77693_muic_acc_type {
> static const unsigned int max77693_extcon_cable[] = {
> EXTCON_USB,
> EXTCON_USB_HOST,
> + EXTCON_CHG_USB,
> EXTCON_CHG_USB_DCP,
> EXTCON_CHG_USB_DCP_FAST,
> EXTCON_CHG_USB_DCP_SLOW,
> @@ -512,8 +513,11 @@ static int max77693_muic_dock_handler(struct max77693_muic_info *info,
> break;
> case MAX77693_MUIC_ADC_AV_CABLE_NOLOAD: /* Dock-Audio */
> dock_id = EXTCON_DOCK;
> - if (!attached)
> + if (!attached) {
> extcon_set_cable_state_(info->edev, EXTCON_USB, false);
> + extcon_set_cable_state_(info->edev, EXTCON_CHG_USB,
> + false);
> + }
> break;
> default:
> dev_err(info->dev, "failed to detect %s dock device\n",
> @@ -601,6 +605,7 @@ static int max77693_muic_adc_ground_handler(struct max77693_muic_info *info)
> if (ret < 0)
> return ret;
> extcon_set_cable_state_(info->edev, EXTCON_USB, attached);
> + extcon_set_cable_state_(info->edev, EXTCON_CHG_USB, attached);
> break;
> case MAX77693_MUIC_GND_MHL:
> case MAX77693_MUIC_GND_MHL_VB:
> @@ -830,6 +835,8 @@ static int max77693_muic_chg_handler(struct max77693_muic_info *info)
> */
> extcon_set_cable_state_(info->edev, EXTCON_USB,
> attached);
> + extcon_set_cable_state_(info->edev, EXTCON_CHG_USB,
> + attached);
>
> if (!cable_attached)
> extcon_set_cable_state_(info->edev, EXTCON_DOCK,
> @@ -899,6 +906,8 @@ static int max77693_muic_chg_handler(struct max77693_muic_info *info)
>
> extcon_set_cable_state_(info->edev, EXTCON_USB,
> attached);
> + extcon_set_cable_state_(info->edev, EXTCON_CHG_USB,
> + attached);
> break;
> case MAX77693_CHARGER_TYPE_DEDICATED_CHG:
> /* Only TA cable */
> diff --git a/drivers/extcon/extcon-max77843.c b/drivers/extcon/extcon-max77843.c
> index 97aebe5d67a6..5bfd4a5ec9c4 100644
> --- a/drivers/extcon/extcon-max77843.c
> +++ b/drivers/extcon/extcon-max77843.c
> @@ -122,6 +122,7 @@ enum max77843_muic_charger_type {
> static const unsigned int max77843_extcon_cable[] = {
> EXTCON_USB,
> EXTCON_USB_HOST,
> + EXTCON_CHG_USB,
> EXTCON_CHG_USB_DCP,
> EXTCON_CHG_USB_CDP,
> EXTCON_CHG_USB_DCP_FAST,
> @@ -486,6 +487,7 @@ static int max77843_muic_chg_handler(struct max77843_muic_info *info)
> return ret;
>
> extcon_set_cable_state_(info->edev, EXTCON_USB, attached);
> + extcon_set_cable_state_(info->edev, EXTCON_CHG_USB, attached);
> break;
> case MAX77843_MUIC_CHG_DOWNSTREAM:
> ret = max77843_muic_set_path(info,
> diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c
> index 8dbec5febdb6..3e8c6ab546b6 100644
> --- a/drivers/extcon/extcon-max8997.c
> +++ b/drivers/extcon/extcon-max8997.c
> @@ -148,6 +148,7 @@ struct max8997_muic_info {
> static const unsigned int max8997_extcon_cable[] = {
> EXTCON_USB,
> EXTCON_USB_HOST,
> + EXTCON_CHG_USB,
> EXTCON_CHG_USB_DCP,
> EXTCON_CHG_USB_DCP_FAST,
> EXTCON_CHG_USB_DCP_SLOW,
> @@ -334,6 +335,7 @@ static int max8997_muic_handle_usb(struct max8997_muic_info *info,
> break;
> case MAX8997_USB_DEVICE:
> extcon_set_cable_state_(info->edev, EXTCON_USB, attached);
> + extcon_set_cable_state_(info->edev, EXTCON_CHG_USB, attached);
> break;
> default:
> dev_err(info->dev, "failed to detect %s usb cable\n",
> diff --git a/drivers/extcon/extcon-palmas.c b/drivers/extcon/extcon-palmas.c
> index 93c30a885740..a1e984ff4398 100644
> --- a/drivers/extcon/extcon-palmas.c
> +++ b/drivers/extcon/extcon-palmas.c
> @@ -37,6 +37,7 @@
> static const unsigned int palmas_extcon_cable[] = {
> EXTCON_USB,
> EXTCON_USB_HOST,
> + EXTCON_CHG_USB,
> EXTCON_NONE,
> };
>
> @@ -62,6 +63,7 @@ static irqreturn_t palmas_vbus_irq_handler(int irq, void *_palmas_usb)
> if (palmas_usb->linkstat != PALMAS_USB_STATE_VBUS) {
> palmas_usb->linkstat = PALMAS_USB_STATE_VBUS;
> extcon_set_cable_state_(edev, EXTCON_USB, true);
> + extcon_set_cable_state_(edev, EXTCON_CHG_USB, true);
> dev_info(palmas_usb->dev, "USB cable is attached\n");
> } else {
> dev_dbg(palmas_usb->dev,
> @@ -71,6 +73,7 @@ static irqreturn_t palmas_vbus_irq_handler(int irq, void *_palmas_usb)
> if (palmas_usb->linkstat == PALMAS_USB_STATE_VBUS) {
> palmas_usb->linkstat = PALMAS_USB_STATE_DISCONNECT;
> extcon_set_cable_state_(edev, EXTCON_USB, false);
> + extcon_set_cable_state_(edev, EXTCON_CHG_USB, false);
> dev_info(palmas_usb->dev, "USB cable is detached\n");
> } else {
> dev_dbg(palmas_usb->dev,
> diff --git a/drivers/extcon/extcon-rt8973a.c b/drivers/extcon/extcon-rt8973a.c
> index 36bf1d63791c..64c7d8a90a11 100644
> --- a/drivers/extcon/extcon-rt8973a.c
> +++ b/drivers/extcon/extcon-rt8973a.c
> @@ -93,6 +93,7 @@ static struct reg_data rt8973a_reg_data[] = {
> static const unsigned int rt8973a_extcon_cable[] = {
> EXTCON_USB,
> EXTCON_USB_HOST,
> + EXTCON_CHG_USB,
> EXTCON_CHG_USB_DCP,
> EXTCON_JIG,
> EXTCON_NONE,
> @@ -398,6 +399,8 @@ static int rt8973a_muic_cable_handler(struct rt8973a_muic_info *info,
>
> /* Change the state of external accessory */
> extcon_set_cable_state_(info->edev, id, attached);
> + if (id == EXTCON_USB)
> + extcon_set_cable_state_(info->edev, EXTCON_CHG_USB, attached);
>
> return 0;
> }
> diff --git a/drivers/extcon/extcon-sm5502.c b/drivers/extcon/extcon-sm5502.c
> index 7aac3cc7efd7..24031759d306 100644
> --- a/drivers/extcon/extcon-sm5502.c
> +++ b/drivers/extcon/extcon-sm5502.c
> @@ -95,6 +95,7 @@ static struct reg_data sm5502_reg_data[] = {
> static const unsigned int sm5502_extcon_cable[] = {
> EXTCON_USB,
> EXTCON_USB_HOST,
> + EXTCON_CHG_USB,
> EXTCON_CHG_USB_DCP,
> EXTCON_NONE,
> };
> @@ -411,6 +412,8 @@ static int sm5502_muic_cable_handler(struct sm5502_muic_info *info,
>
> /* Change the state of external accessory */
> extcon_set_cable_state_(info->edev, id, attached);
> + if (id == EXTCON_USB)
> + extcon_set_cable_state_(info->edev, EXTCON_CHG_USB, attached);
>
> return 0;
> }
> diff --git a/drivers/extcon/extcon-usb-gpio.c b/drivers/extcon/extcon-usb-gpio.c
> index 2b2fecffb1ad..ae8e3df0b5a6 100644
> --- a/drivers/extcon/extcon-usb-gpio.c
> +++ b/drivers/extcon/extcon-usb-gpio.c
> @@ -43,6 +43,7 @@ struct usb_extcon_info {
> static const unsigned int usb_extcon_cable[] = {
> EXTCON_USB,
> EXTCON_USB_HOST,
> + EXTCON_CHG_USB,
> EXTCON_NONE,
> };
>
> @@ -63,12 +64,14 @@ static void usb_extcon_detect_cable(struct work_struct *work)
> */
> extcon_set_cable_state_(info->edev, EXTCON_USB_HOST, false);
> extcon_set_cable_state_(info->edev, EXTCON_USB, true);
> + extcon_set_cable_state_(info->edev, EXTCON_CHG_USB, true);
> } else {
> /*
> * ID = 0 means USB HOST cable attached.
> * As we don't have event for USB peripheral cable detached,
> * we simulate USB peripheral detach here.
> */
> + extcon_set_cable_state_(info->edev, EXTCON_CHG_USB, false);
> extcon_set_cable_state_(info->edev, EXTCON_USB, false);
> extcon_set_cable_state_(info->edev, EXTCON_USB_HOST, true);
> }
>
next prev parent reply other threads:[~2015-10-06 11:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-06 11:21 [PATCH v2 0/2] extcon: Modify the name of external connector Chanwoo Choi
2015-10-06 11:21 ` [PATCH 1/2] extcon: Modify the id and " Chanwoo Choi
2015-10-06 11:42 ` Pallala, Ramakrishna
2015-10-06 11:51 ` Chanwoo Choi
2015-10-06 11:57 ` Pallala, Ramakrishna
2015-10-06 11:21 ` [PATCH 2/2] extcon: Add the support of EXTCON_CHG_USB when SDP port is attached or detached Chanwoo Choi
2015-10-06 11:49 ` Roger Quadros [this message]
2015-10-06 12:12 ` Chanwoo Choi
2015-10-06 12:22 ` Roger Quadros
2015-10-06 12:28 ` Chanwoo Choi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5613B553.9080005@ti.com \
--to=rogerq@ti.com \
--cc=ckeepax@opensource.wolfsonmicro.com \
--cc=cw00.choi@samsung.com \
--cc=gregkh@linuxfoundation.org \
--cc=k.kozlowski@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
--cc=patches@opensource.wolfsonmicro.com \
--cc=ramakrishna.pallala@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).