Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1702769 > unrolled thread

[PATCH v2 0/5] usb: Replace the deprecated extcon API

Started byChanwoo Choi <cw00.choi@samsung.com>
First post2017-08-03 10:30 +0200
Last post2017-08-03 10:30 +0200
Articles 6 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 0/5] usb: Replace the deprecated extcon API Chanwoo Choi <cw00.choi@samsung.com> - 2017-08-03 10:30 +0200
    [PATCH v2 2/5] phy: rockchip-inno-usb2: Replace the extcon API Chanwoo Choi <cw00.choi@samsung.com> - 2017-08-03 10:30 +0200
    [PATCH v2 4/5] usb: gadget: udc: Replace the deprecated extcon API Chanwoo Choi <cw00.choi@samsung.com> - 2017-08-03 10:30 +0200
      Re: [PATCH v2 4/5] usb: gadget: udc: Replace the deprecated extcon  API Chanwoo Choi <cw00.choi@samsung.com> - 2017-08-07 04:10 +0200
        Re: [PATCH v2 4/5] usb: gadget: udc: Replace the deprecated extcon  API Chanwoo Choi <cw00.choi@samsung.com> - 2017-08-10 02:10 +0200
    [PATCH v2 3/5] phy: phy-bcm-ns2-usbdrd: Replace the deprecated  extcon API Chanwoo Choi <cw00.choi@samsung.com> - 2017-08-03 10:30 +0200

#1702769 — [PATCH v2 0/5] usb: Replace the deprecated extcon API

FromChanwoo Choi <cw00.choi@samsung.com>
Date2017-08-03 10:30 +0200
Subject[PATCH v2 0/5] usb: Replace the deprecated extcon API
Message-ID<uajG1-5ML-3@gated-at.bofh.it>
These patches replace the deprecated extcon API and remove them from extcon.

Patch4 (drivers/usb/gadget/udc/snps_udc_plat.c) neeeds the review
from usb maintainer. After finishing the review of patch4,
I'll create the immutable branch and send the pull request
to both usb and phy maintainer.

Changes from v1:
- Fix capital error for 'acked-by' tag on patch2
- Add the acked-by tag of 'Kishon Vijay Abraham I' to patch3

Chanwoo Choi (5):
  phy: qcom-usb-hs: Replace the extcon API
  phy: rockchip-inno-usb2: Replace the extcon API
  phy: phy-bcm-ns2-usbdrd: Replace the deprecated extcon API
  usb: gadget: udc: Replace the deprecated extcon API
  extcon: Remove deprecated extcon_set/get_cable_state_()

 drivers/phy/broadcom/phy-bcm-ns2-usbdrd.c     |  8 ++++----
 drivers/phy/qualcomm/phy-qcom-usb-hs.c        | 14 +++-----------
 drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 10 +++++-----
 drivers/usb/gadget/udc/snps_udc_plat.c        |  6 +++---
 include/linux/extcon.h                        | 11 -----------
 5 files changed, 15 insertions(+), 34 deletions(-)

-- 
1.9.1

[toc] | [next] | [standalone]


#1702771 — [PATCH v2 2/5] phy: rockchip-inno-usb2: Replace the extcon API

FromChanwoo Choi <cw00.choi@samsung.com>
Date2017-08-03 10:30 +0200
Subject[PATCH v2 2/5] phy: rockchip-inno-usb2: Replace the extcon API
Message-ID<uajG2-5ML-21@gated-at.bofh.it>
In reply to#1702769
This patch uses the resource-managed extcon API for extcon_register_notifier()
and replaces the deprecated extcon API as following:
- extcon_get_cable_state_() -> extcon_get_state()
- extcon_set_cable_state_() -> extcon_set_state_sync()

Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
index 626883d9d176..ef033089b7a0 100644
--- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
+++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
@@ -545,7 +545,7 @@ static void rockchip_usb2phy_otg_sm_work(struct work_struct *work)
 			rockchip_usb2phy_power_off(rport->phy);
 		/* fall through */
 	case OTG_STATE_B_IDLE:
-		if (extcon_get_cable_state_(rphy->edev, EXTCON_USB_HOST) > 0) {
+		if (extcon_get_state(rphy->edev, EXTCON_USB_HOST) > 0) {
 			dev_dbg(&rport->phy->dev, "usb otg host connect\n");
 			rport->state = OTG_STATE_A_HOST;
 			rockchip_usb2phy_power_on(rport->phy);
@@ -598,7 +598,7 @@ static void rockchip_usb2phy_otg_sm_work(struct work_struct *work)
 			rport->vbus_attached = vbus_attach;
 
 			if (notify_charger && rphy->edev) {
-				extcon_set_cable_state_(rphy->edev,
+				extcon_set_state_sync(rphy->edev,
 							cable, vbus_attach);
 				if (cable == EXTCON_CHG_USB_SDP)
 					extcon_set_state_sync(rphy->edev,
@@ -619,7 +619,7 @@ static void rockchip_usb2phy_otg_sm_work(struct work_struct *work)
 		sch_work = true;
 		break;
 	case OTG_STATE_A_HOST:
-		if (extcon_get_cable_state_(rphy->edev, EXTCON_USB_HOST) == 0) {
+		if (extcon_get_state(rphy->edev, EXTCON_USB_HOST) == 0) {
 			dev_dbg(&rport->phy->dev, "usb otg host disconnect\n");
 			rport->state = OTG_STATE_B_IDLE;
 			rockchip_usb2phy_power_off(rport->phy);
@@ -1006,8 +1006,8 @@ static int rockchip_usb2phy_otg_port_init(struct rockchip_usb2phy *rphy,
 	if (!IS_ERR(rphy->edev)) {
 		rport->event_nb.notifier_call = rockchip_otg_event;
 
-		ret = extcon_register_notifier(rphy->edev, EXTCON_USB_HOST,
-					       &rport->event_nb);
+		ret = devm_extcon_register_notifier(rphy->dev, rphy->edev,
+					EXTCON_USB_HOST, &rport->event_nb);
 		if (ret)
 			dev_err(rphy->dev, "register USB HOST notifier failed\n");
 	}
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1702773 — [PATCH v2 4/5] usb: gadget: udc: Replace the deprecated extcon API

FromChanwoo Choi <cw00.choi@samsung.com>
Date2017-08-03 10:30 +0200
Subject[PATCH v2 4/5] usb: gadget: udc: Replace the deprecated extcon API
Message-ID<uajG3-5ML-29@gated-at.bofh.it>
In reply to#1702769
This patch replaces the deprecated extcon API as following:
- extcon_get_cable_state_() -> extcon_get_state()

Cc: Felipe Balbi <balbi@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Raviteja Garimella <raviteja.garimella@broadcom.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/usb/gadget/udc/snps_udc_plat.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/gadget/udc/snps_udc_plat.c b/drivers/usb/gadget/udc/snps_udc_plat.c
index 2e11f19e07ae..0ce7b3ba60ff 100644
--- a/drivers/usb/gadget/udc/snps_udc_plat.c
+++ b/drivers/usb/gadget/udc/snps_udc_plat.c
@@ -184,7 +184,7 @@ static int udc_plat_probe(struct platform_device *pdev)
 			goto exit_phy;
 		}
 
-		ret = extcon_get_cable_state_(udc->edev, EXTCON_USB);
+		ret = extcon_get_state(udc->edev, EXTCON_USB);
 		if (ret < 0) {
 			dev_err(dev, "Can't get cable state\n");
 			goto exit_extcon;
@@ -273,7 +273,7 @@ static int udc_plat_suspend(struct device *dev)
 	udc = dev_get_drvdata(dev);
 	stop_udc(udc);
 
-	if (extcon_get_cable_state_(udc->edev, EXTCON_USB) > 0) {
+	if (extcon_get_state(udc->edev, EXTCON_USB) > 0) {
 		dev_dbg(udc->dev, "device -> idle\n");
 		stop_udc(udc);
 	}
@@ -303,7 +303,7 @@ static int udc_plat_resume(struct device *dev)
 		return ret;
 	}
 
-	if (extcon_get_cable_state_(udc->edev, EXTCON_USB) > 0) {
+	if (extcon_get_state(udc->edev, EXTCON_USB) > 0) {
 		dev_dbg(udc->dev, "idle -> device\n");
 		start_udc(udc);
 	}
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1705052 — Re: [PATCH v2 4/5] usb: gadget: udc: Replace the deprecated extcon API

FromChanwoo Choi <cw00.choi@samsung.com>
Date2017-08-07 04:10 +0200
SubjectRe: [PATCH v2 4/5] usb: gadget: udc: Replace the deprecated extcon API
Message-ID<ubFEu-210-1@gated-at.bofh.it>
In reply to#1702773
Dear Felipe,

Could you please review this patch?
I hope to remove the deprecated extcon API.

Regards,
Chanwoo Choi

On 2017년 08월 03일 17:20, Chanwoo Choi wrote:
> This patch replaces the deprecated extcon API as following:
> - extcon_get_cable_state_() -> extcon_get_state()
> 
> Cc: Felipe Balbi <balbi@kernel.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Raviteja Garimella <raviteja.garimella@broadcom.com>
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> ---
>  drivers/usb/gadget/udc/snps_udc_plat.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/gadget/udc/snps_udc_plat.c b/drivers/usb/gadget/udc/snps_udc_plat.c
> index 2e11f19e07ae..0ce7b3ba60ff 100644
> --- a/drivers/usb/gadget/udc/snps_udc_plat.c
> +++ b/drivers/usb/gadget/udc/snps_udc_plat.c
> @@ -184,7 +184,7 @@ static int udc_plat_probe(struct platform_device *pdev)
>  			goto exit_phy;
>  		}
>  
> -		ret = extcon_get_cable_state_(udc->edev, EXTCON_USB);
> +		ret = extcon_get_state(udc->edev, EXTCON_USB);
>  		if (ret < 0) {
>  			dev_err(dev, "Can't get cable state\n");
>  			goto exit_extcon;
> @@ -273,7 +273,7 @@ static int udc_plat_suspend(struct device *dev)
>  	udc = dev_get_drvdata(dev);
>  	stop_udc(udc);
>  
> -	if (extcon_get_cable_state_(udc->edev, EXTCON_USB) > 0) {
> +	if (extcon_get_state(udc->edev, EXTCON_USB) > 0) {
>  		dev_dbg(udc->dev, "device -> idle\n");
>  		stop_udc(udc);
>  	}
> @@ -303,7 +303,7 @@ static int udc_plat_resume(struct device *dev)
>  		return ret;
>  	}
>  
> -	if (extcon_get_cable_state_(udc->edev, EXTCON_USB) > 0) {
> +	if (extcon_get_state(udc->edev, EXTCON_USB) > 0) {
>  		dev_dbg(udc->dev, "idle -> device\n");
>  		start_udc(udc);
>  	}
> 

[toc] | [prev] | [next] | [standalone]


#1708081 — Re: [PATCH v2 4/5] usb: gadget: udc: Replace the deprecated extcon API

FromChanwoo Choi <cw00.choi@samsung.com>
Date2017-08-10 02:10 +0200
SubjectRe: [PATCH v2 4/5] usb: gadget: udc: Replace the deprecated extcon API
Message-ID<ucJcZ-6lV-3@gated-at.bofh.it>
In reply to#1705052
Ping.

Hi Felipe,

I sent the first patch[1] more than three weeks ago.
But I didn't receive the any review.
[1] https://lkml.org/lkml/2017/7/16/523

This patch is very simple. After finishing the review
I'll remove the deprecated extcon API and then send
the immutable branch to both phy and usb maintainer.


Usually, I send the extcon's pull request to the GregKH
for the next merge after releasing 4.x-rc6.
(4.x-rc4 was released)

Please review this patch.


On 2017년 08월 07일 11:07, Chanwoo Choi wrote:
> Dear Felipe,
> 
> Could you please review this patch?
> I hope to remove the deprecated extcon API.
> 
> Regards,
> Chanwoo Choi
> 
> On 2017년 08월 03일 17:20, Chanwoo Choi wrote:
>> This patch replaces the deprecated extcon API as following:
>> - extcon_get_cable_state_() -> extcon_get_state()
>>
>> Cc: Felipe Balbi <balbi@kernel.org>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Cc: Raviteja Garimella <raviteja.garimella@broadcom.com>
>> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
>> ---
>>  drivers/usb/gadget/udc/snps_udc_plat.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/usb/gadget/udc/snps_udc_plat.c b/drivers/usb/gadget/udc/snps_udc_plat.c
>> index 2e11f19e07ae..0ce7b3ba60ff 100644
>> --- a/drivers/usb/gadget/udc/snps_udc_plat.c
>> +++ b/drivers/usb/gadget/udc/snps_udc_plat.c
>> @@ -184,7 +184,7 @@ static int udc_plat_probe(struct platform_device *pdev)
>>  			goto exit_phy;
>>  		}
>>  
>> -		ret = extcon_get_cable_state_(udc->edev, EXTCON_USB);
>> +		ret = extcon_get_state(udc->edev, EXTCON_USB);
>>  		if (ret < 0) {
>>  			dev_err(dev, "Can't get cable state\n");
>>  			goto exit_extcon;
>> @@ -273,7 +273,7 @@ static int udc_plat_suspend(struct device *dev)
>>  	udc = dev_get_drvdata(dev);
>>  	stop_udc(udc);
>>  
>> -	if (extcon_get_cable_state_(udc->edev, EXTCON_USB) > 0) {
>> +	if (extcon_get_state(udc->edev, EXTCON_USB) > 0) {
>>  		dev_dbg(udc->dev, "device -> idle\n");
>>  		stop_udc(udc);
>>  	}
>> @@ -303,7 +303,7 @@ static int udc_plat_resume(struct device *dev)
>>  		return ret;
>>  	}
>>  
>> -	if (extcon_get_cable_state_(udc->edev, EXTCON_USB) > 0) {
>> +	if (extcon_get_state(udc->edev, EXTCON_USB) > 0) {
>>  		dev_dbg(udc->dev, "idle -> device\n");
>>  		start_udc(udc);
>>  	}
>>
> 
> 
> 
> 


-- 
Best Regards,
Chanwoo Choi
Samsung Electronics

[toc] | [prev] | [next] | [standalone]


#1702775 — [PATCH v2 3/5] phy: phy-bcm-ns2-usbdrd: Replace the deprecated extcon API

FromChanwoo Choi <cw00.choi@samsung.com>
Date2017-08-03 10:30 +0200
Subject[PATCH v2 3/5] phy: phy-bcm-ns2-usbdrd: Replace the deprecated extcon API
Message-ID<uajG3-5ML-37@gated-at.bofh.it>
In reply to#1702769
This patch replaces the deprecated extcon API as following:
- extcon_set_cable_state_() -> extcon_get_state()

Cc: Raviteja Garimella <raviteja.garimella@broadcom.com>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/phy/broadcom/phy-bcm-ns2-usbdrd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/phy/broadcom/phy-bcm-ns2-usbdrd.c b/drivers/phy/broadcom/phy-bcm-ns2-usbdrd.c
index 9ae59e223131..d099a0c8cee5 100644
--- a/drivers/phy/broadcom/phy-bcm-ns2-usbdrd.c
+++ b/drivers/phy/broadcom/phy-bcm-ns2-usbdrd.c
@@ -253,16 +253,16 @@ static void extcon_work(struct work_struct *work)
 	vbus = gpiod_get_value_cansleep(driver->vbus_gpiod);
 
 	if (!id && vbus) { /* Host connected */
-		extcon_set_cable_state_(driver->edev, EXTCON_USB_HOST, true);
+		extcon_set_state_sync(driver->edev, EXTCON_USB_HOST, true);
 		pr_debug("Host cable connected\n");
 		driver->data->new_state = EVT_HOST;
 		connect_change(driver);
 	} else if (id && !vbus) { /* Disconnected */
-		extcon_set_cable_state_(driver->edev, EXTCON_USB_HOST, false);
-		extcon_set_cable_state_(driver->edev, EXTCON_USB, false);
+		extcon_set_state_sync(driver->edev, EXTCON_USB_HOST, false);
+		extcon_set_state_sync(driver->edev, EXTCON_USB, false);
 		pr_debug("Cable disconnected\n");
 	} else if (id && vbus) { /* Device connected */
-		extcon_set_cable_state_(driver->edev, EXTCON_USB, true);
+		extcon_set_state_sync(driver->edev, EXTCON_USB, true);
 		pr_debug("Device cable connected\n");
 		driver->data->new_state = EVT_DEVICE;
 		connect_change(driver);
-- 
1.9.1

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web