Re: [PATCH 05/61] clk: samsung: simplify getting .drvdata

2018-04-24 Thread Chanwoo Choi
Hi,

On 2018년 04월 19일 23:05, Wolfram Sang wrote:
> We should get drvdata from struct device directly. Going via
> platform_device is an unneeded step back and forth.
> 
> Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
> ---
> 
> Build tested only. buildbot is happy. Please apply individually.
> 
>  drivers/clk/samsung/clk-s3c2410-dclk.c | 6 ++
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/clk/samsung/clk-s3c2410-dclk.c 
> b/drivers/clk/samsung/clk-s3c2410-dclk.c
> index 077df3e539a7..f41d89cef0f1 100644
> --- a/drivers/clk/samsung/clk-s3c2410-dclk.c
> +++ b/drivers/clk/samsung/clk-s3c2410-dclk.c
> @@ -219,8 +219,7 @@ static int s3c24xx_dclk1_div_notify(struct notifier_block 
> *nb,
>  #ifdef CONFIG_PM_SLEEP
>  static int s3c24xx_dclk_suspend(struct device *dev)
>  {
> - struct platform_device *pdev = to_platform_device(dev);
> - struct s3c24xx_dclk *s3c24xx_dclk = platform_get_drvdata(pdev);
> + struct s3c24xx_dclk *s3c24xx_dclk = dev_get_drvdata(dev);
>  
>   s3c24xx_dclk->reg_save = readl_relaxed(s3c24xx_dclk->base);
>   return 0;
> @@ -228,8 +227,7 @@ static int s3c24xx_dclk_suspend(struct device *dev)
>  
>  static int s3c24xx_dclk_resume(struct device *dev)
>  {
> - struct platform_device *pdev = to_platform_device(dev);
> - struct s3c24xx_dclk *s3c24xx_dclk = platform_get_drvdata(pdev);
> + struct s3c24xx_dclk *s3c24xx_dclk = dev_get_drvdata(dev);
>  
>   writel_relaxed(s3c24xx_dclk->reg_save, s3c24xx_dclk->base);
>   return 0;
> 

Reviewed-by: Chanwoo Choi <cw00.c...@samsung.com>

-- 
Best Regards,
Chanwoo Choi
Samsung Electronics


Re: [PATCH] extcon: int3496: use proper GPIO include

2018-04-12 Thread Chanwoo Choi
On 2018년 04월 13일 10:09, Chanwoo Choi wrote:
> Hi,
> 
> On 2018년 04월 10일 21:43, Wolfram Sang wrote:
>> Since commit eca0f13c836a ("extcon: int3496: Ignore incorrect
>> IoRestriction for ID pin"), the driver doesn't use GPIOF_* flags
>> anymore. We can thus now drop the deprecated include file for GPIO and
>> use the new one.
> 
> Looks good to me. But, you need to send stable mailing list
> and add 'Fixes' tag on v2.

You don't need to send stable mailing list. It is my mistake.
Just I'll pick this patch on extcon-fixes branch.

> 
>>
>> Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
>> ---
>>
>> Compile tested only.
>>
>> @linusw: one more gone
>>
>>  drivers/extcon/extcon-intel-int3496.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/extcon/extcon-intel-int3496.c 
>> b/drivers/extcon/extcon-intel-int3496.c
>> index acaccb128fc4..fd24debe58a3 100644
>> --- a/drivers/extcon/extcon-intel-int3496.c
>> +++ b/drivers/extcon/extcon-intel-int3496.c
>> @@ -20,7 +20,7 @@
>>  
>>  #include 
>>  #include 
>> -#include 
>> +#include 
>>  #include 
>>  #include 
>>  #include 
>>
> 
> 


-- 
Best Regards,
Chanwoo Choi
Samsung Electronics


Re: [PATCH] extcon: int3496: use proper GPIO include

2018-04-12 Thread Chanwoo Choi
Hi,

On 2018년 04월 10일 21:43, Wolfram Sang wrote:
> Since commit eca0f13c836a ("extcon: int3496: Ignore incorrect
> IoRestriction for ID pin"), the driver doesn't use GPIOF_* flags
> anymore. We can thus now drop the deprecated include file for GPIO and
> use the new one.

Looks good to me. But, you need to send stable mailing list
and add 'Fixes' tag on v2.

> 
> Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com>
> ---
> 
> Compile tested only.
> 
> @linusw: one more gone
> 
>  drivers/extcon/extcon-intel-int3496.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/extcon/extcon-intel-int3496.c 
> b/drivers/extcon/extcon-intel-int3496.c
> index acaccb128fc4..fd24debe58a3 100644
> --- a/drivers/extcon/extcon-intel-int3496.c
> +++ b/drivers/extcon/extcon-intel-int3496.c
> @@ -20,7 +20,7 @@
>  
>  #include 
>  #include 
> -#include 
> +#include 
>  #include 
>  #include 
>  #include 
> 


-- 
Best Regards,
Chanwoo Choi
Samsung Electronics


Re: [PATCH v2] extcon: Split out extcon header file for consumer and provider device

2017-10-22 Thread Chanwoo Choi
Dear all,

I got the reviews from all maintainers related to this patch.
So, I make the immutable branch on extcon.git and then send
the pull request in order to prevent the possible merge conflict.

Best Regards,
Chanwoo Choi
Samsung Electronics


The following changes since commit 2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e:

  Linux 4.14-rc1 (2017-09-16 15:47:51 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon.git 
ib-extcon-v4.15

for you to fetch changes up to 176aa36012135d172394a928a03fb03dfecd83f9:

  extcon: Split out extcon header file for consumer and provider device 
(2017-10-23 14:07:58 +0900)


Chanwoo Choi (1):
  extcon: Split out extcon header file for consumer and provider device

 drivers/extcon/extcon-adc-jack.c  |   2 +-
 drivers/extcon/extcon-arizona.c   |   2 +-
 drivers/extcon/extcon-axp288.c|   2 +-
 drivers/extcon/extcon-gpio.c  |   2 +-
 drivers/extcon/extcon-intel-cht-wc.c  |   2 +-
 drivers/extcon/extcon-intel-int3496.c |   2 +-
 drivers/extcon/extcon-max14577.c  |   2 +-
 drivers/extcon/extcon-max3355.c   |   2 +-
 drivers/extcon/extcon-max77693.c  |   2 +-
 drivers/extcon/extcon-max77843.c  |   2 +-
 drivers/extcon/extcon-max8997.c   |   2 +-
 drivers/extcon/extcon-qcom-spmi-misc.c|   2 +-
 drivers/extcon/extcon-rt8973a.c   |   2 +-
 drivers/extcon/extcon-sm5502.c|   2 +-
 drivers/extcon/extcon-usb-gpio.c  |   2 +-
 drivers/extcon/extcon-usbc-cros-ec.c  |   2 +-
 drivers/extcon/extcon.h   |   2 +-
 drivers/phy/allwinner/phy-sun4i-usb.c |   2 +-
 drivers/phy/broadcom/phy-bcm-ns2-usbdrd.c |   2 +-
 drivers/phy/renesas/phy-rcar-gen3-usb2.c  |   2 +-
 drivers/phy/rockchip/phy-rockchip-inno-usb2.c |   2 +-
 drivers/power/supply/qcom_smbb.c  |   2 +-
 drivers/usb/gadget/udc/renesas_usb3.c |   2 +-
 drivers/usb/phy/phy-tahvo.c   |   2 +-
 include/linux/extcon-provider.h   | 142 ++
 include/linux/extcon.h| 109 +---
 include/linux/mfd/palmas.h|   2 +-
 27 files changed, 172 insertions(+), 129 deletions(-)
 create mode 100644 include/linux/extcon-provider.h


On 2017년 10월 23일 14:05, Kishon Vijay Abraham I wrote:
> 
> 
> On Wednesday 18 October 2017 07:44 AM, Chanwoo Choi wrote:
>> Gently Ping.
>>
>> Dear Kishon,
>>
>> Could you please review this patch for 'drivers/phy/*'?
> 
> sorry for the delay.. here it is
> 
> Acked-by: Kishon Vijay Abraham I <kis...@ti.com>
>>
>> Regards,
>> Chanwoo Choi
>>
>> On 2017년 10월 12일 12:40, Chanwoo Choi wrote:
>>> Dear Kishon,
>>>
>>> Could you please review this patch?
>>> After that, I'll make the immutable brand and then send the pull request
>>> for power_supply, mfd, phy, usb and extcon framework.
>>>
>>> On 2017년 10월 10일 19:17, Chanwoo Choi wrote:
>>>> The extcon has two type of extcon devices as following.
>>>> - 'extcon provider deivce' adds new extcon device and detect the
>>>>state/properties of external connector. Also, it notifies the
>>>>state/properties to the extcon consumer device.
>>>> - 'extcon consumer device' gets the change state/properties
>>>>from extcon provider device.
>>>> Prior to that, include/linux/extcon.h contains all exported API for
>>>> both provider and consumer device driver. To clarify the meaning of
>>>> header file and to remove the wrong use-case on consumer device,
>>>> this patch separates into extcon.h and extcon-provider.h.
>>>>
>>>> [Description for include/linux/{extcon.h|extcon-provider.h}]
>>>> - extcon.h includes the extcon API and data structure for extcon consumer
>>>>   device driver. This header file contains the following APIs:
>>>>   : Register/unregister the notifier to catch the change of extcon device
>>>>   : Get the extcon device instance
>>>>   : Get the extcon device name
>>>>   : Get the state of each external connector
>>>>   : Get the property value of each external connector
>>>>   : Get the property capability of each external connector
>>>>
>>>> - extcon-provider.h includes the extcon API and data structure for extcon
>>>>   provider device driver. This header file contains the following APIs:
>>>>   : Include 'include/linux/extcon.h'
>>>>   : Allocate the

Re: [PATCH v2] extcon: Split out extcon header file for consumer and provider device

2017-10-17 Thread Chanwoo Choi
Gently Ping.

Dear Kishon,

Could you please review this patch for 'drivers/phy/*'?

Regards,
Chanwoo Choi

On 2017년 10월 12일 12:40, Chanwoo Choi wrote:
> Dear Kishon,
> 
> Could you please review this patch?
> After that, I'll make the immutable brand and then send the pull request
> for power_supply, mfd, phy, usb and extcon framework.
> 
> On 2017년 10월 10일 19:17, Chanwoo Choi wrote:
>> The extcon has two type of extcon devices as following.
>> - 'extcon provider deivce' adds new extcon device and detect the
>>state/properties of external connector. Also, it notifies the
>>state/properties to the extcon consumer device.
>> - 'extcon consumer device' gets the change state/properties
>>from extcon provider device.
>> Prior to that, include/linux/extcon.h contains all exported API for
>> both provider and consumer device driver. To clarify the meaning of
>> header file and to remove the wrong use-case on consumer device,
>> this patch separates into extcon.h and extcon-provider.h.
>>
>> [Description for include/linux/{extcon.h|extcon-provider.h}]
>> - extcon.h includes the extcon API and data structure for extcon consumer
>>   device driver. This header file contains the following APIs:
>>   : Register/unregister the notifier to catch the change of extcon device
>>   : Get the extcon device instance
>>   : Get the extcon device name
>>   : Get the state of each external connector
>>   : Get the property value of each external connector
>>   : Get the property capability of each external connector
>>
>> - extcon-provider.h includes the extcon API and data structure for extcon
>>   provider device driver. This header file contains the following APIs:
>>   : Include 'include/linux/extcon.h'
>>   : Allocate the memory for extcon device instance
>>   : Register/unregister extcon device
>>   : Set the state of each external connector
>>   : Set the property value of each external connector
>>   : Set the property capability of each external connector
>>
>> Cc: Felipe Balbi <ba...@kernel.org>
>> Cc: Kishon Vijay Abraham I <kis...@ti.com>
>> Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
>> Acked-by: Sebastian Reichel <sebastian.reic...@collabora.co.uk>
>> Acked-by: Chen-Yu Tsai <w...@csie.org>
>> Acked-by: Charles Keepax <ckee...@opensource.cirrus.com>
>> Acked-by: Lee Jones <lee.jo...@linaro.org>
>> Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
>> ---
>> Changes from v1:
>> - Don't touch drivers/usb/renesas_usbhs/common.h.
>> - Add acked-by from Sebastian Reichel (for drivers/power/supply/)
>> - Add acked-by from Chen-Yu Tsai (for phy-sun4i-usb.c & extcon-axp288.c)
>> - Add acked-by from Charles Keepax (for drivers/extcon/extcon-arizona.c)
>> - Add acked-by from Lee Jones (fo include/linux/mfd/palmas.h)
>>
>>  drivers/extcon/extcon-adc-jack.c  |   2 +-
>>  drivers/extcon/extcon-arizona.c   |   2 +-
>>  drivers/extcon/extcon-axp288.c|   2 +-
>>  drivers/extcon/extcon-gpio.c  |   2 +-
>>  drivers/extcon/extcon-intel-cht-wc.c  |   2 +-
>>  drivers/extcon/extcon-intel-int3496.c |   2 +-
>>  drivers/extcon/extcon-max14577.c  |   2 +-
>>  drivers/extcon/extcon-max3355.c   |   2 +-
>>  drivers/extcon/extcon-max77693.c  |   2 +-
>>  drivers/extcon/extcon-max77843.c  |   2 +-
>>  drivers/extcon/extcon-max8997.c   |   2 +-
>>  drivers/extcon/extcon-qcom-spmi-misc.c|   2 +-
>>  drivers/extcon/extcon-rt8973a.c   |   2 +-
>>  drivers/extcon/extcon-sm5502.c|   2 +-
>>  drivers/extcon/extcon-usb-gpio.c  |   2 +-
>>  drivers/extcon/extcon-usbc-cros-ec.c  |   2 +-
>>  drivers/extcon/extcon.h   |   2 +-
>>  drivers/phy/allwinner/phy-sun4i-usb.c |   2 +-
>>  drivers/phy/broadcom/phy-bcm-ns2-usbdrd.c |   2 +-
>>  drivers/phy/renesas/phy-rcar-gen3-usb2.c  |   2 +-
>>  drivers/phy/rockchip/phy-rockchip-inno-usb2.c |   2 +-
>>  drivers/power/supply/qcom_smbb.c  |   2 +-
>>  drivers/usb/gadget/udc/renesas_usb3.c |   2 +-
>>  drivers/usb/phy/phy-tahvo.c   |   2 +-
>>  include/linux/extcon-provider.h   | 142 
>> ++
>>  include/linux/extcon.h| 109 +---
>>  include/linux/mfd/palmas.h|   2 +-
>>  27 files changed, 172 insertions(+), 129 deletions(-)

Re: [PATCH v2] extcon: Split out extcon header file for consumer and provider device

2017-10-11 Thread Chanwoo Choi
Dear Kishon,

Could you please review this patch?
After that, I'll make the immutable brand and then send the pull request
for power_supply, mfd, phy, usb and extcon framework.

On 2017년 10월 10일 19:17, Chanwoo Choi wrote:
> The extcon has two type of extcon devices as following.
> - 'extcon provider deivce' adds new extcon device and detect the
>state/properties of external connector. Also, it notifies the
>state/properties to the extcon consumer device.
> - 'extcon consumer device' gets the change state/properties
>from extcon provider device.
> Prior to that, include/linux/extcon.h contains all exported API for
> both provider and consumer device driver. To clarify the meaning of
> header file and to remove the wrong use-case on consumer device,
> this patch separates into extcon.h and extcon-provider.h.
> 
> [Description for include/linux/{extcon.h|extcon-provider.h}]
> - extcon.h includes the extcon API and data structure for extcon consumer
>   device driver. This header file contains the following APIs:
>   : Register/unregister the notifier to catch the change of extcon device
>   : Get the extcon device instance
>   : Get the extcon device name
>   : Get the state of each external connector
>   : Get the property value of each external connector
>   : Get the property capability of each external connector
> 
> - extcon-provider.h includes the extcon API and data structure for extcon
>   provider device driver. This header file contains the following APIs:
>   : Include 'include/linux/extcon.h'
>   : Allocate the memory for extcon device instance
>   : Register/unregister extcon device
>   : Set the state of each external connector
>   : Set the property value of each external connector
>   : Set the property capability of each external connector
> 
> Cc: Felipe Balbi <ba...@kernel.org>
> Cc: Kishon Vijay Abraham I <kis...@ti.com>
> Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
> Acked-by: Sebastian Reichel <sebastian.reic...@collabora.co.uk>
> Acked-by: Chen-Yu Tsai <w...@csie.org>
> Acked-by: Charles Keepax <ckee...@opensource.cirrus.com>
> Acked-by: Lee Jones <lee.jo...@linaro.org>
> Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
> ---
> Changes from v1:
> - Don't touch drivers/usb/renesas_usbhs/common.h.
> - Add acked-by from Sebastian Reichel (for drivers/power/supply/)
> - Add acked-by from Chen-Yu Tsai (for phy-sun4i-usb.c & extcon-axp288.c)
> - Add acked-by from Charles Keepax (for drivers/extcon/extcon-arizona.c)
> - Add acked-by from Lee Jones (fo include/linux/mfd/palmas.h)
> 
>  drivers/extcon/extcon-adc-jack.c  |   2 +-
>  drivers/extcon/extcon-arizona.c   |   2 +-
>  drivers/extcon/extcon-axp288.c|   2 +-
>  drivers/extcon/extcon-gpio.c  |   2 +-
>  drivers/extcon/extcon-intel-cht-wc.c  |   2 +-
>  drivers/extcon/extcon-intel-int3496.c |   2 +-
>  drivers/extcon/extcon-max14577.c  |   2 +-
>  drivers/extcon/extcon-max3355.c   |   2 +-
>  drivers/extcon/extcon-max77693.c  |   2 +-
>  drivers/extcon/extcon-max77843.c  |   2 +-
>  drivers/extcon/extcon-max8997.c   |   2 +-
>  drivers/extcon/extcon-qcom-spmi-misc.c|   2 +-
>  drivers/extcon/extcon-rt8973a.c   |   2 +-
>  drivers/extcon/extcon-sm5502.c|   2 +-
>  drivers/extcon/extcon-usb-gpio.c  |   2 +-
>  drivers/extcon/extcon-usbc-cros-ec.c  |   2 +-
>  drivers/extcon/extcon.h   |   2 +-
>  drivers/phy/allwinner/phy-sun4i-usb.c |   2 +-
>  drivers/phy/broadcom/phy-bcm-ns2-usbdrd.c |   2 +-
>  drivers/phy/renesas/phy-rcar-gen3-usb2.c  |   2 +-
>  drivers/phy/rockchip/phy-rockchip-inno-usb2.c |   2 +-
>  drivers/power/supply/qcom_smbb.c  |   2 +-
>  drivers/usb/gadget/udc/renesas_usb3.c |   2 +-
>  drivers/usb/phy/phy-tahvo.c   |   2 +-
>  include/linux/extcon-provider.h   | 142 
> ++
>  include/linux/extcon.h| 109 +---
>  include/linux/mfd/palmas.h|   2 +-
>  27 files changed, 172 insertions(+), 129 deletions(-)
>  create mode 100644 include/linux/extcon-provider.h
> 
> diff --git a/drivers/extcon/extcon-adc-jack.c 
> b/drivers/extcon/extcon-adc-jack.c
> index 6f6537ab0a79..3877d86c746a 100644
> --- a/drivers/extcon/extcon-adc-jack.c
> +++ b/drivers/extcon/extcon-adc-jack.c
> @@ -26,7 +26,7 @@
>  #include 
>  #include 
>  #include 
> -#include 
> +#include 
>  
>  /**
>   * struct adc_jack_data - internal data for adc_jack device driver
> d

[PATCH v2] extcon: Split out extcon header file for consumer and provider device

2017-10-10 Thread Chanwoo Choi
The extcon has two type of extcon devices as following.
- 'extcon provider deivce' adds new extcon device and detect the
   state/properties of external connector. Also, it notifies the
   state/properties to the extcon consumer device.
- 'extcon consumer device' gets the change state/properties
   from extcon provider device.
Prior to that, include/linux/extcon.h contains all exported API for
both provider and consumer device driver. To clarify the meaning of
header file and to remove the wrong use-case on consumer device,
this patch separates into extcon.h and extcon-provider.h.

[Description for include/linux/{extcon.h|extcon-provider.h}]
- extcon.h includes the extcon API and data structure for extcon consumer
  device driver. This header file contains the following APIs:
  : Register/unregister the notifier to catch the change of extcon device
  : Get the extcon device instance
  : Get the extcon device name
  : Get the state of each external connector
  : Get the property value of each external connector
  : Get the property capability of each external connector

- extcon-provider.h includes the extcon API and data structure for extcon
  provider device driver. This header file contains the following APIs:
  : Include 'include/linux/extcon.h'
  : Allocate the memory for extcon device instance
  : Register/unregister extcon device
  : Set the state of each external connector
  : Set the property value of each external connector
  : Set the property capability of each external connector

Cc: Felipe Balbi <ba...@kernel.org>
Cc: Kishon Vijay Abraham I <kis...@ti.com>
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
Acked-by: Sebastian Reichel <sebastian.reic...@collabora.co.uk>
Acked-by: Chen-Yu Tsai <w...@csie.org>
Acked-by: Charles Keepax <ckee...@opensource.cirrus.com>
Acked-by: Lee Jones <lee.jo...@linaro.org>
Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
---
Changes from v1:
- Don't touch drivers/usb/renesas_usbhs/common.h.
- Add acked-by from Sebastian Reichel (for drivers/power/supply/)
- Add acked-by from Chen-Yu Tsai (for phy-sun4i-usb.c & extcon-axp288.c)
- Add acked-by from Charles Keepax (for drivers/extcon/extcon-arizona.c)
- Add acked-by from Lee Jones (fo include/linux/mfd/palmas.h)

 drivers/extcon/extcon-adc-jack.c  |   2 +-
 drivers/extcon/extcon-arizona.c   |   2 +-
 drivers/extcon/extcon-axp288.c|   2 +-
 drivers/extcon/extcon-gpio.c  |   2 +-
 drivers/extcon/extcon-intel-cht-wc.c  |   2 +-
 drivers/extcon/extcon-intel-int3496.c |   2 +-
 drivers/extcon/extcon-max14577.c  |   2 +-
 drivers/extcon/extcon-max3355.c   |   2 +-
 drivers/extcon/extcon-max77693.c  |   2 +-
 drivers/extcon/extcon-max77843.c  |   2 +-
 drivers/extcon/extcon-max8997.c   |   2 +-
 drivers/extcon/extcon-qcom-spmi-misc.c|   2 +-
 drivers/extcon/extcon-rt8973a.c   |   2 +-
 drivers/extcon/extcon-sm5502.c|   2 +-
 drivers/extcon/extcon-usb-gpio.c  |   2 +-
 drivers/extcon/extcon-usbc-cros-ec.c  |   2 +-
 drivers/extcon/extcon.h   |   2 +-
 drivers/phy/allwinner/phy-sun4i-usb.c |   2 +-
 drivers/phy/broadcom/phy-bcm-ns2-usbdrd.c |   2 +-
 drivers/phy/renesas/phy-rcar-gen3-usb2.c  |   2 +-
 drivers/phy/rockchip/phy-rockchip-inno-usb2.c |   2 +-
 drivers/power/supply/qcom_smbb.c  |   2 +-
 drivers/usb/gadget/udc/renesas_usb3.c |   2 +-
 drivers/usb/phy/phy-tahvo.c   |   2 +-
 include/linux/extcon-provider.h   | 142 ++
 include/linux/extcon.h| 109 +---
 include/linux/mfd/palmas.h|   2 +-
 27 files changed, 172 insertions(+), 129 deletions(-)
 create mode 100644 include/linux/extcon-provider.h

diff --git a/drivers/extcon/extcon-adc-jack.c b/drivers/extcon/extcon-adc-jack.c
index 6f6537ab0a79..3877d86c746a 100644
--- a/drivers/extcon/extcon-adc-jack.c
+++ b/drivers/extcon/extcon-adc-jack.c
@@ -26,7 +26,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 /**
  * struct adc_jack_data - internal data for adc_jack device driver
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
index f84da4a17724..da0e9bc4262f 100644
--- a/drivers/extcon/extcon-arizona.c
+++ b/drivers/extcon/extcon-arizona.c
@@ -27,7 +27,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 
diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c
index f4fd03e58e37..981fba56bc18 100644
--- a/drivers/extcon/extcon-axp288.c
+++ b/drivers/extcon/extcon-axp288.c
@@ -22,7 +22,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/extcon/extcon-gpio.c b/drivers/extcon/extcon-gpio.c
index ebed22f22d75..ab770adc

Re: [PATCH] extcon: Split out extcon header file for consumer and provider device

2017-09-28 Thread Chanwoo Choi
Hi,

On 2017년 09월 29일 11:03, Yoshihiro Shimoda wrote:
> Hi,
> 
>> From: Chanwoo Choi
>> Sent: Friday, September 29, 2017 9:02 AM
>>
> < snip >
>>  drivers/phy/renesas/phy-rcar-gen3-usb2.c  |   2 +-
> < snip >
>>  drivers/usb/gadget/udc/renesas_usb3.c |   2 +-
> 
> These two drivers need the modification.
> But...
> 
> < snip >
>> diff --git a/drivers/usb/renesas_usbhs/common.h 
>> b/drivers/usb/renesas_usbhs/common.h
>> index 8c5fc12ad778..a78764bc23eb 100644
>> --- a/drivers/usb/renesas_usbhs/common.h
>> +++ b/drivers/usb/renesas_usbhs/common.h
>> @@ -17,7 +17,7 @@
>>  #ifndef RENESAS_USB_DRIVER_H
>>  #define RENESAS_USB_DRIVER_H
>>
>> -#include 
>> +#include 
> 
> Since this driver doesn't use any extcon-provider APIs for now,
> we doesn't need the modification, IIUC.

I don't modify 'drivers/usb/renesas_usbhs/common.h'
on v2 patch. Thanks for your comment.

> 
> Best regards,
> Yoshihiro Shimoda
> 
> 
> 
> 


-- 
Best Regards,
Chanwoo Choi
Samsung Electronics


[PATCH] extcon: Split out extcon header file for consumer and provider device

2017-09-28 Thread Chanwoo Choi
The extcon has two type of extcon devices as following.
- 'extcon provider deivce' adds new extcon device and detect the
   state/properties of external connector. Also, it notifies the
   state/properties to the extcon consumer device.
- 'extcon consumer device' gets the change state/properties
   from extcon provider device.
Prior to that, include/linux/extcon.h contains all exported API for
both provider and consumer device driver. To clarify the meaning of
header file and to remove the wrong use-case on consumer device,
this patch separates into extcon.h and extcon-provider.h.

[Description for include/linux/{extcon.h|extcon-provider.h}]
- extcon.h includes the extcon API and data structure for extcon consumer
  device driver. This header file contains the following APIs:
  : Register/unregister the notifier to catch the change of extcon device
  : Get the extcon device instance
  : Get the extcon device name
  : Get the state of each external connector
  : Get the property value of each external connector
  : Get the property capability of each external connector

- extcon-provider.h includes the extcon API and data structure for extcon
  provider device driver. This header file contains the following APIs:
  : Include 'include/linux/extcon.h'
  : Allocate the memory for extcon device instance
  : Register/unregister extcon device
  : Set the state of each external connector
  : Set the property value of each external connector
  : Set the property capability of each external connector

Cc: Felipe Balbi <ba...@kernel.org>
Cc: Kishon Vijay Abraham I <kis...@ti.com>
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
Cc: Sebastian Reichel <s...@kernel.org>
Cc: Lee Jones <lee.jo...@linaro.org>
Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
---
 drivers/extcon/extcon-adc-jack.c  |   2 +-
 drivers/extcon/extcon-arizona.c   |   2 +-
 drivers/extcon/extcon-axp288.c|   2 +-
 drivers/extcon/extcon-gpio.c  |   2 +-
 drivers/extcon/extcon-intel-cht-wc.c  |   2 +-
 drivers/extcon/extcon-intel-int3496.c |   2 +-
 drivers/extcon/extcon-max14577.c  |   2 +-
 drivers/extcon/extcon-max3355.c   |   2 +-
 drivers/extcon/extcon-max77693.c  |   2 +-
 drivers/extcon/extcon-max77843.c  |   2 +-
 drivers/extcon/extcon-max8997.c   |   2 +-
 drivers/extcon/extcon-qcom-spmi-misc.c|   2 +-
 drivers/extcon/extcon-rt8973a.c   |   2 +-
 drivers/extcon/extcon-sm5502.c|   2 +-
 drivers/extcon/extcon-usb-gpio.c  |   2 +-
 drivers/extcon/extcon-usbc-cros-ec.c  |   2 +-
 drivers/extcon/extcon.h   |   2 +-
 drivers/phy/allwinner/phy-sun4i-usb.c |   2 +-
 drivers/phy/broadcom/phy-bcm-ns2-usbdrd.c |   2 +-
 drivers/phy/renesas/phy-rcar-gen3-usb2.c  |   2 +-
 drivers/phy/rockchip/phy-rockchip-inno-usb2.c |   2 +-
 drivers/power/supply/qcom_smbb.c  |   2 +-
 drivers/usb/gadget/udc/renesas_usb3.c |   2 +-
 drivers/usb/phy/phy-tahvo.c   |   2 +-
 drivers/usb/renesas_usbhs/common.h|   2 +-
 include/linux/extcon-provider.h   | 142 ++
 include/linux/extcon.h| 109 +---
 include/linux/mfd/palmas.h|   2 +-
 28 files changed, 173 insertions(+), 130 deletions(-)
 create mode 100644 include/linux/extcon-provider.h

diff --git a/drivers/extcon/extcon-adc-jack.c b/drivers/extcon/extcon-adc-jack.c
index 6f6537ab0a79..3877d86c746a 100644
--- a/drivers/extcon/extcon-adc-jack.c
+++ b/drivers/extcon/extcon-adc-jack.c
@@ -26,7 +26,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 /**
  * struct adc_jack_data - internal data for adc_jack device driver
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
index f84da4a17724..da0e9bc4262f 100644
--- a/drivers/extcon/extcon-arizona.c
+++ b/drivers/extcon/extcon-arizona.c
@@ -27,7 +27,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 
diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c
index f4fd03e58e37..981fba56bc18 100644
--- a/drivers/extcon/extcon-axp288.c
+++ b/drivers/extcon/extcon-axp288.c
@@ -22,7 +22,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/extcon/extcon-gpio.c b/drivers/extcon/extcon-gpio.c
index ebed22f22d75..ab770adcca7e 100644
--- a/drivers/extcon/extcon-gpio.c
+++ b/drivers/extcon/extcon-gpio.c
@@ -17,7 +17,7 @@
  * GNU General Public License for more details.
  */
 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/extcon/extcon-intel-cht-wc.c 
b/drivers/extcon/extcon-intel-cht-wc.c
index 91a0023074af..7c4bc8c44c3f 100644
--- a/drivers/extcon/extcon-intel-cht-wc.c
+++ b/drivers/extcon/extcon-intel-cht-wc.

Re: [PATCH v2 0/2] phy: Replace the deprecated extcon API

2017-01-16 Thread Chanwoo Choi
Hi Kishon,

On 2017년 01월 10일 17:16, Chanwoo Choi wrote:
> Hi Kishon,
> 
> Could you review these patches or pick up them if there is no any comment?

If there are no comments, could you apply these patches?

> 
> On 2016년 12월 30일 13:11, Chanwoo Choi wrote:
>> This patches just replace the deprecated extcon API without any change
>> of extcon operation and use the resource-managed function for
>> extcon_register_notifier().
>>
>> The new extcon API instead of deprecated API.
>> - extcon_set_cable_state_() -> extcon_set_state_sync();
>> - extcon_get_cable_state_() -> extcon_get_state();
>>
>> Changes from v1:
>> - Rebase these patches based on v4.10-rc1.
>> - Drop the usb/power-supply/chipidea patches.
>>
>> Chanwoo Choi (2):
>>   phy: rcar-gen3-usb2: Replace the deprecated extcon API
>>   phy: sun4i-usb: Replace the deprecated extcon API
>>
>>  drivers/phy/phy-rcar-gen3-usb2.c | 8 
>>  drivers/phy/phy-sun4i-usb.c  | 4 ++--
>>  2 files changed, 6 insertions(+), 6 deletions(-)
>>
> 


-- 
Best Regards,
Chanwoo Choi
S/W Center, Samsung Electronics


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

2017-01-10 Thread Chanwoo Choi
Hi Felipe,

These patches have already acked-by tag from you.
Could you please apply them if there is additional comment?

On 2016년 12월 30일 13:08, Chanwoo Choi wrote:
> This patches just replace the deprecated extcon API without any change
> of extcon operation and use the resource-managed function for
> extcon_register_notifier().
> 
> The new extcon API instead of deprecated API.
> - extcon_set_cable_state_() -> extcon_set_state_sync();
> - extcon_get_cable_state_() -> extcon_get_state();
> 
> Changes from v1:
> - Rebase these patches based on v4.10-rc1.
> - Add acked-by tag from usb maintainer and reviewer.
> - Drop the phy/power-supply/chipidea patches.
> 
> Chanwoo Choi (6):
>   usb: dwc3: omap: Replace the extcon API
>   usb: phy: msm: Replace the extcon API
>   usb: phy: omap-otg: Replace the extcon API
>   usb: phy: qcom-8x16-usb: Replace the extcon API
>   usb: phy: tahvo: Replace the deprecated extcon API
>   usb: renesas_usbhs: Replace the deprecated extcon API
> 
>  drivers/usb/dwc3/dwc3-omap.c| 20 +++-
>  drivers/usb/phy/phy-msm-usb.c   | 33 +++--
>  drivers/usb/phy/phy-omap-otg.c  | 24 ++--
>  drivers/usb/phy/phy-qcom-8x16-usb.c | 13 -
>  drivers/usb/phy/phy-tahvo.c | 10 +-
>  drivers/usb/renesas_usbhs/common.c  |  2 +-
>  6 files changed, 34 insertions(+), 68 deletions(-)
> 


-- 
Best Regards,
Chanwoo Choi
S/W Center, Samsung Electronics


Re: [PATCH v2 0/2] phy: Replace the deprecated extcon API

2017-01-10 Thread Chanwoo Choi
Hi Kishon,

Could you review these patches or pick up them if there is no any comment?

On 2016년 12월 30일 13:11, Chanwoo Choi wrote:
> This patches just replace the deprecated extcon API without any change
> of extcon operation and use the resource-managed function for
> extcon_register_notifier().
> 
> The new extcon API instead of deprecated API.
> - extcon_set_cable_state_() -> extcon_set_state_sync();
> - extcon_get_cable_state_() -> extcon_get_state();
> 
> Changes from v1:
> - Rebase these patches based on v4.10-rc1.
> - Drop the usb/power-supply/chipidea patches.
> 
> Chanwoo Choi (2):
>   phy: rcar-gen3-usb2: Replace the deprecated extcon API
>   phy: sun4i-usb: Replace the deprecated extcon API
> 
>  drivers/phy/phy-rcar-gen3-usb2.c | 8 
>  drivers/phy/phy-sun4i-usb.c  | 4 ++--
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 

-- 
Best Regards,
Chanwoo Choi
S/W Center, Samsung Electronics


Re: [PATCH] cpufreq: Remove CONFIG_CPU_FREQ_STAT_DETAILS config option

2017-01-05 Thread Chanwoo Choi
Hi Viresh,

On 2017년 01월 05일 17:27, Viresh Kumar wrote:
> This doesn't have any benefit apart from saving a small amount of memory
> when it is disabled. The ifdef hackery in the code makes it dirty
> unnecessarily.
> 
> Clean it up by removing the Kconfig option completely. Few defconfigs
> are also updated and CONFIG_CPU_FREQ_STAT_DETAILS is replaced with
> CONFIG_CPU_FREQ_STAT now in them, as users wanted stats to be enabled.
> 
> Signed-off-by: Viresh Kumar <viresh.ku...@linaro.org>
> ---
>  arch/arm/configs/exynos_defconfig |  2 +-
>  arch/arm/configs/multi_v5_defconfig   |  2 +-
>  arch/arm/configs/multi_v7_defconfig   |  2 +-
>  arch/arm/configs/mvebu_v5_defconfig   |  2 +-
>  arch/arm/configs/pxa_defconfig|  2 +-
>  arch/arm/configs/shmobile_defconfig   |  2 +-
>  arch/mips/configs/lemote2f_defconfig  |  1 -
>  arch/powerpc/configs/ppc6xx_defconfig |  1 -
>  arch/sh/configs/sh7785lcr_32bit_defconfig |  2 +-
>  drivers/cpufreq/Kconfig   |  8 
>  drivers/cpufreq/cpufreq_stats.c   | 14 --
>  11 files changed, 7 insertions(+), 31 deletions(-)


I agree. Looks good to me.
Reviewed-by: Chanwoo Choi <cw00.c...@samsung.com>

[snip]

-- 
Best Regards,
Chanwoo Choi
Samsung Electronics
<>

Re: [PATCH 06/12] usb: dwc3: omap: Replace the extcon API

2016-12-29 Thread Chanwoo Choi
Hi Felipe,

On 2016년 12월 30일 11:46, Chanwoo Choi wrote:
> Hi Felipe,
> 
> On 2016년 12월 02일 18:03, Felipe Balbi wrote:
>>
>> Hi,
>>
>> Chanwoo Choi <cw00.c...@samsung.com> writes:
>>> Hi Felipe,
>>>
>>> On 2016년 11월 30일 19:36, Felipe Balbi wrote:
>>>>
>>>> Hi,
>>>>
>>>> Chanwoo Choi <cw00.c...@samsung.com> writes:
>>>>> 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()
>>>>>
>>>>> Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
>>>>
>>>> Acked-by: Felipe Balbi <felipe.ba...@linux.intel.com>
>>>>
>>>
>>> Thanks for your review.
>>>
>>> Each patch has no any dependency among patches.
>>> So, If possible, could you pick the patch6/8/9/10/11/12 on your tree?
>>
>> my tree is closed for v4.10, I can pick it up for v4.11
> 
> Could you please pick up these patches(patch6/8/9/10/11/12)?
> These patches were already reviewed by you.
> 

I sent v2 patchset.
[1] https://www.spinics.net/lists/kernel/msg2410950.html
- "[PATCH v2 0/6] usb: Replace the deprecated extcon API"

-- 
Regards,
Chanwoo Choi


[PATCH v2 2/6] usb: phy: msm: Replace the extcon API

2016-12-29 Thread Chanwoo Choi
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()

Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
Acked-by: Felipe Balbi <felipe.ba...@linux.intel.com>
---
 drivers/usb/phy/phy-msm-usb.c | 33 +++--
 1 file changed, 11 insertions(+), 22 deletions(-)

diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
index 8a34759727bb..a15a89d4235d 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -1742,14 +1742,14 @@ static int msm_otg_read_dt(struct platform_device 
*pdev, struct msm_otg *motg)
if (!IS_ERR(ext_vbus)) {
motg->vbus.extcon = ext_vbus;
motg->vbus.nb.notifier_call = msm_otg_vbus_notifier;
-   ret = extcon_register_notifier(ext_vbus, EXTCON_USB,
-   >vbus.nb);
+   ret = devm_extcon_register_notifier(>dev, ext_vbus,
+   EXTCON_USB, >vbus.nb);
if (ret < 0) {
dev_err(>dev, "register VBUS notifier failed\n");
return ret;
}
 
-   ret = extcon_get_cable_state_(ext_vbus, EXTCON_USB);
+   ret = extcon_get_state(ext_vbus, EXTCON_USB);
if (ret)
set_bit(B_SESS_VLD, >inputs);
else
@@ -1759,16 +1759,14 @@ static int msm_otg_read_dt(struct platform_device 
*pdev, struct msm_otg *motg)
if (!IS_ERR(ext_id)) {
motg->id.extcon = ext_id;
motg->id.nb.notifier_call = msm_otg_id_notifier;
-   ret = extcon_register_notifier(ext_id, EXTCON_USB_HOST,
-   >id.nb);
+   ret = devm_extcon_register_notifier(>dev, ext_id,
+   EXTCON_USB_HOST, >id.nb);
if (ret < 0) {
dev_err(>dev, "register ID notifier failed\n");
-   extcon_unregister_notifier(motg->vbus.extcon,
-  EXTCON_USB, >vbus.nb);
return ret;
}
 
-   ret = extcon_get_cable_state_(ext_id, EXTCON_USB_HOST);
+   ret = extcon_get_state(ext_id, EXTCON_USB_HOST);
if (ret)
clear_bit(ID, >inputs);
else
@@ -1883,10 +1881,9 @@ static int msm_otg_probe(struct platform_device *pdev)
 */
if (motg->phy_number) {
phy_select = devm_ioremap_nocache(>dev, USB2_PHY_SEL, 4);
-   if (!phy_select) {
-   ret = -ENOMEM;
-   goto unregister_extcon;
-   }
+   if (!phy_select)
+   return -ENOMEM;
+
/* Enable second PHY with the OTG port */
writel(0x1, phy_select);
}
@@ -1897,7 +1894,7 @@ static int msm_otg_probe(struct platform_device *pdev)
if (motg->irq < 0) {
dev_err(>dev, "platform_get_irq failed\n");
ret = motg->irq;
-   goto unregister_extcon;
+   return motg->irq;
}
 
regs[0].supply = "vddcx";
@@ -1906,7 +1903,7 @@ static int msm_otg_probe(struct platform_device *pdev)
 
ret = devm_regulator_bulk_get(motg->phy.dev, ARRAY_SIZE(regs), regs);
if (ret)
-   goto unregister_extcon;
+   return ret;
 
motg->vddcx = regs[0].consumer;
motg->v3p3  = regs[1].consumer;
@@ -2003,11 +2000,6 @@ static int msm_otg_probe(struct platform_device *pdev)
clk_disable_unprepare(motg->clk);
if (!IS_ERR(motg->core_clk))
clk_disable_unprepare(motg->core_clk);
-unregister_extcon:
-   extcon_unregister_notifier(motg->id.extcon,
-  EXTCON_USB_HOST, >id.nb);
-   extcon_unregister_notifier(motg->vbus.extcon,
-  EXTCON_USB, >vbus.nb);
 
return ret;
 }
@@ -2029,9 +2021,6 @@ static int msm_otg_remove(struct platform_device *pdev)
 */
gpiod_set_value_cansleep(motg->switch_gpio, 0);
 
-   extcon_unregister_notifier(motg->id.extcon, EXTCON_USB_HOST, 
>id.nb);
-   extcon_unregister_notifier(motg->vbus.extcon, EXTCON_USB, 
>vbus.nb);
-
msm_otg_debugfs_cleanup();
cancel_delayed_work_sync(>chg_work);
cancel_work_sync(>sm_work);
-- 
1.9.1



[PATCH v2 1/2] phy: rcar-gen3-usb2: Replace the deprecated extcon API

2016-12-29 Thread Chanwoo Choi
This patch replaces the deprecated extcon API as following:
- extcon_set_cable_state_() -> extcon_set_state_sync()

Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
Acked-by: Yoshihiro Shimoda <yoshihiro.shimoda...@renesas.com>
---
 drivers/phy/phy-rcar-gen3-usb2.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/phy/phy-rcar-gen3-usb2.c b/drivers/phy/phy-rcar-gen3-usb2.c
index c63da1b955c1..54a83675f0a8 100644
--- a/drivers/phy/phy-rcar-gen3-usb2.c
+++ b/drivers/phy/phy-rcar-gen3-usb2.c
@@ -94,11 +94,11 @@ static void rcar_gen3_phy_usb2_work(struct work_struct 
*work)
 work);
 
if (ch->extcon_host) {
-   extcon_set_cable_state_(ch->extcon, EXTCON_USB_HOST, true);
-   extcon_set_cable_state_(ch->extcon, EXTCON_USB, false);
+   extcon_set_state_sync(ch->extcon, EXTCON_USB_HOST, true);
+   extcon_set_state_sync(ch->extcon, EXTCON_USB, false);
} else {
-   extcon_set_cable_state_(ch->extcon, EXTCON_USB_HOST, false);
-   extcon_set_cable_state_(ch->extcon, EXTCON_USB, true);
+   extcon_set_state_sync(ch->extcon, EXTCON_USB_HOST, false);
+   extcon_set_state_sync(ch->extcon, EXTCON_USB, true);
}
 }
 
-- 
1.9.1



[PATCH v2 0/2] phy: Replace the deprecated extcon API

2016-12-29 Thread Chanwoo Choi
This patches just replace the deprecated extcon API without any change
of extcon operation and use the resource-managed function for
extcon_register_notifier().

The new extcon API instead of deprecated API.
- extcon_set_cable_state_() -> extcon_set_state_sync();
- extcon_get_cable_state_() -> extcon_get_state();

Changes from v1:
- Rebase these patches based on v4.10-rc1.
- Drop the usb/power-supply/chipidea patches.

Chanwoo Choi (2):
  phy: rcar-gen3-usb2: Replace the deprecated extcon API
  phy: sun4i-usb: Replace the deprecated extcon API

 drivers/phy/phy-rcar-gen3-usb2.c | 8 
 drivers/phy/phy-sun4i-usb.c  | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

-- 
1.9.1



[PATCH v2 2/2] phy: sun4i-usb: Replace the deprecated extcon API

2016-12-29 Thread Chanwoo Choi
This patch replaces the deprecated extcon API as following:
- extcon_set_cable_state_() -> extcon_set_state_sync()

Cc: Kishon Vijay Abraham I <kis...@ti.com>
Cc: Maxime Ripard <maxime.rip...@free-electrons.com>
Cc: Chen-Yu Tsai <w...@csie.org>
Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
---
 drivers/phy/phy-sun4i-usb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/phy-sun4i-usb.c b/drivers/phy/phy-sun4i-usb.c
index bf28a0fdd569..eae171e18043 100644
--- a/drivers/phy/phy-sun4i-usb.c
+++ b/drivers/phy/phy-sun4i-usb.c
@@ -534,7 +534,7 @@ static void sun4i_usb_phy0_id_vbus_det_scan(struct 
work_struct *work)
mutex_unlock(>mutex);
 
if (id_notify) {
-   extcon_set_cable_state_(data->extcon, EXTCON_USB_HOST,
+   extcon_set_state_sync(data->extcon, EXTCON_USB_HOST,
!id_det);
/* When leaving host mode force end the session here */
if (force_session_end && id_det == 1) {
@@ -547,7 +547,7 @@ static void sun4i_usb_phy0_id_vbus_det_scan(struct 
work_struct *work)
}
 
if (vbus_notify)
-   extcon_set_cable_state_(data->extcon, EXTCON_USB, vbus_det);
+   extcon_set_state_sync(data->extcon, EXTCON_USB, vbus_det);
 
if (sun4i_usb_phy0_poll(data))
queue_delayed_work(system_wq, >detect, POLL_TIME);
-- 
1.9.1



[PATCH v2 3/6] usb: phy: omap-otg: Replace the extcon API

2016-12-29 Thread Chanwoo Choi
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()

Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
Acked-by: Felipe Balbi <felipe.ba...@linux.intel.com>
---
 drivers/usb/phy/phy-omap-otg.c | 24 ++--
 1 file changed, 6 insertions(+), 18 deletions(-)

diff --git a/drivers/usb/phy/phy-omap-otg.c b/drivers/usb/phy/phy-omap-otg.c
index 6523af4f8f93..800d1d90753d 100644
--- a/drivers/usb/phy/phy-omap-otg.c
+++ b/drivers/usb/phy/phy-omap-otg.c
@@ -118,19 +118,19 @@ static int omap_otg_probe(struct platform_device *pdev)
otg_dev->id_nb.notifier_call = omap_otg_id_notifier;
otg_dev->vbus_nb.notifier_call = omap_otg_vbus_notifier;
 
-   ret = extcon_register_notifier(extcon, EXTCON_USB_HOST, 
_dev->id_nb);
+   ret = devm_extcon_register_notifier(>dev, extcon,
+   EXTCON_USB_HOST, _dev->id_nb);
if (ret)
return ret;
 
-   ret = extcon_register_notifier(extcon, EXTCON_USB, _dev->vbus_nb);
+   ret = devm_extcon_register_notifier(>dev, extcon,
+   EXTCON_USB, _dev->vbus_nb);
if (ret) {
-   extcon_unregister_notifier(extcon, EXTCON_USB_HOST,
-   _dev->id_nb);
return ret;
}
 
-   otg_dev->id = extcon_get_cable_state_(extcon, EXTCON_USB_HOST);
-   otg_dev->vbus = extcon_get_cable_state_(extcon, EXTCON_USB);
+   otg_dev->id = extcon_get_state(extcon, EXTCON_USB_HOST);
+   otg_dev->vbus = extcon_get_state(extcon, EXTCON_USB);
omap_otg_set_mode(otg_dev);
 
rev = readl(otg_dev->base);
@@ -145,20 +145,8 @@ static int omap_otg_probe(struct platform_device *pdev)
return 0;
 }
 
-static int omap_otg_remove(struct platform_device *pdev)
-{
-   struct otg_device *otg_dev = platform_get_drvdata(pdev);
-   struct extcon_dev *edev = otg_dev->extcon;
-
-   extcon_unregister_notifier(edev, EXTCON_USB_HOST, _dev->id_nb);
-   extcon_unregister_notifier(edev, EXTCON_USB, _dev->vbus_nb);
-
-   return 0;
-}
-
 static struct platform_driver omap_otg_driver = {
.probe  = omap_otg_probe,
-   .remove = omap_otg_remove,
.driver = {
.name   = "omap_otg",
},
-- 
1.9.1



[PATCH v2 4/6] usb: phy: qcom-8x16-usb: Replace the extcon API

2016-12-29 Thread Chanwoo Choi
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()

Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
Acked-by: Felipe Balbi <felipe.ba...@linux.intel.com>
---
 drivers/usb/phy/phy-qcom-8x16-usb.c | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/phy/phy-qcom-8x16-usb.c 
b/drivers/usb/phy/phy-qcom-8x16-usb.c
index d8593adb3621..fdf686398772 100644
--- a/drivers/usb/phy/phy-qcom-8x16-usb.c
+++ b/drivers/usb/phy/phy-qcom-8x16-usb.c
@@ -187,7 +187,7 @@ static int phy_8x16_init(struct usb_phy *phy)
val = ULPI_PWR_OTG_COMP_DISABLE;
usb_phy_io_write(phy, val, ULPI_SET(ULPI_PWR_CLK_MNG_REG));
 
-   state = extcon_get_cable_state_(qphy->vbus_edev, EXTCON_USB);
+   state = extcon_get_state(qphy->vbus_edev, EXTCON_USB);
if (state)
phy_8x16_vbus_on(qphy);
else
@@ -316,23 +316,20 @@ static int phy_8x16_probe(struct platform_device *pdev)
goto off_clks;
 
qphy->vbus_notify.notifier_call = phy_8x16_vbus_notify;
-   ret = extcon_register_notifier(qphy->vbus_edev, EXTCON_USB,
-  >vbus_notify);
+   ret = devm_extcon_register_notifier(>dev, qphy->vbus_edev,
+   EXTCON_USB, >vbus_notify);
if (ret < 0)
goto off_power;
 
ret = usb_add_phy_dev(>phy);
if (ret)
-   goto off_extcon;
+   goto off_power;
 
qphy->reboot_notify.notifier_call = phy_8x16_reboot_notify;
register_reboot_notifier(>reboot_notify);
 
return 0;
 
-off_extcon:
-   extcon_unregister_notifier(qphy->vbus_edev, EXTCON_USB,
-  >vbus_notify);
 off_power:
regulator_bulk_disable(ARRAY_SIZE(qphy->regulator), qphy->regulator);
 off_clks:
@@ -347,8 +344,6 @@ static int phy_8x16_remove(struct platform_device *pdev)
struct phy_8x16 *qphy = platform_get_drvdata(pdev);
 
unregister_reboot_notifier(>reboot_notify);
-   extcon_unregister_notifier(qphy->vbus_edev, EXTCON_USB,
-  >vbus_notify);
 
/*
 * Ensure that D+/D- lines are routed to uB connector, so
-- 
1.9.1



[PATCH v2 5/6] usb: phy: tahvo: Replace the deprecated extcon API

2016-12-29 Thread Chanwoo Choi
This patch replaces the deprecated extcon API as following:
- extcon_set_cable_state_() -> extcon_set_state_sync()

Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
Acked-by: Felipe Balbi <felipe.ba...@linux.intel.com>
---
 drivers/usb/phy/phy-tahvo.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/phy/phy-tahvo.c b/drivers/usb/phy/phy-tahvo.c
index ab5d364f6e8c..a31c8682e998 100644
--- a/drivers/usb/phy/phy-tahvo.c
+++ b/drivers/usb/phy/phy-tahvo.c
@@ -121,7 +121,7 @@ static void check_vbus_state(struct tahvo_usb *tu)
prev_state = tu->vbus_state;
tu->vbus_state = reg & TAHVO_STAT_VBUS;
if (prev_state != tu->vbus_state) {
-   extcon_set_cable_state_(tu->extcon, EXTCON_USB, tu->vbus_state);
+   extcon_set_state_sync(tu->extcon, EXTCON_USB, tu->vbus_state);
sysfs_notify(>pt_dev->dev.kobj, NULL, "vbus_state");
}
 }
@@ -130,7 +130,7 @@ static void tahvo_usb_become_host(struct tahvo_usb *tu)
 {
struct retu_dev *rdev = dev_get_drvdata(tu->pt_dev->dev.parent);
 
-   extcon_set_cable_state_(tu->extcon, EXTCON_USB_HOST, true);
+   extcon_set_state_sync(tu->extcon, EXTCON_USB_HOST, true);
 
/* Power up the transceiver in USB host mode */
retu_write(rdev, TAHVO_REG_USBR, USBR_REGOUT | USBR_NSUSPEND |
@@ -149,7 +149,7 @@ static void tahvo_usb_become_peripheral(struct tahvo_usb 
*tu)
 {
struct retu_dev *rdev = dev_get_drvdata(tu->pt_dev->dev.parent);
 
-   extcon_set_cable_state_(tu->extcon, EXTCON_USB_HOST, false);
+   extcon_set_state_sync(tu->extcon, EXTCON_USB_HOST, false);
 
/* Power up transceiver and set it in USB peripheral mode */
retu_write(rdev, TAHVO_REG_USBR, USBR_SLAVE_CONTROL | USBR_REGOUT |
@@ -379,9 +379,9 @@ static int tahvo_usb_probe(struct platform_device *pdev)
}
 
/* Set the initial cable state. */
-   extcon_set_cable_state_(tu->extcon, EXTCON_USB_HOST,
+   extcon_set_state_sync(tu->extcon, EXTCON_USB_HOST,
   tu->tahvo_mode == TAHVO_MODE_HOST);
-   extcon_set_cable_state_(tu->extcon, EXTCON_USB, tu->vbus_state);
+   extcon_set_state_sync(tu->extcon, EXTCON_USB, tu->vbus_state);
 
/* Create OTG interface */
tahvo_usb_power_off(tu);
-- 
1.9.1



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

2016-12-29 Thread Chanwoo Choi
This patches just replace the deprecated extcon API without any change
of extcon operation and use the resource-managed function for
extcon_register_notifier().

The new extcon API instead of deprecated API.
- extcon_set_cable_state_() -> extcon_set_state_sync();
- extcon_get_cable_state_() -> extcon_get_state();

Changes from v1:
- Rebase these patches based on v4.10-rc1.
- Add acked-by tag from usb maintainer and reviewer.
- Drop the phy/power-supply/chipidea patches.

Chanwoo Choi (6):
  usb: dwc3: omap: Replace the extcon API
  usb: phy: msm: Replace the extcon API
  usb: phy: omap-otg: Replace the extcon API
  usb: phy: qcom-8x16-usb: Replace the extcon API
  usb: phy: tahvo: Replace the deprecated extcon API
  usb: renesas_usbhs: Replace the deprecated extcon API

 drivers/usb/dwc3/dwc3-omap.c| 20 +++-
 drivers/usb/phy/phy-msm-usb.c   | 33 +++--
 drivers/usb/phy/phy-omap-otg.c  | 24 ++--
 drivers/usb/phy/phy-qcom-8x16-usb.c | 13 -
 drivers/usb/phy/phy-tahvo.c | 10 +-
 drivers/usb/renesas_usbhs/common.c  |  2 +-
 6 files changed, 34 insertions(+), 68 deletions(-)

-- 
1.9.1



Re: [PATCH 06/12] usb: dwc3: omap: Replace the extcon API

2016-12-29 Thread Chanwoo Choi
Hi Felipe,

On 2016년 12월 02일 18:03, Felipe Balbi wrote:
> 
> Hi,
> 
> Chanwoo Choi <cw00.c...@samsung.com> writes:
>> Hi Felipe,
>>
>> On 2016년 11월 30일 19:36, Felipe Balbi wrote:
>>>
>>> Hi,
>>>
>>> Chanwoo Choi <cw00.c...@samsung.com> writes:
>>>> 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()
>>>>
>>>> Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
>>>
>>> Acked-by: Felipe Balbi <felipe.ba...@linux.intel.com>
>>>
>>
>> Thanks for your review.
>>
>> Each patch has no any dependency among patches.
>> So, If possible, could you pick the patch6/8/9/10/11/12 on your tree?
> 
> my tree is closed for v4.10, I can pick it up for v4.11

Could you please pick up these patches(patch6/8/9/10/11/12)?
These patches were already reviewed by you.

-- 
Regards,
Chanwoo Choi


Re: [PATCH 03/12] power_supply: axp288_charger: Replace the extcon API

2016-12-06 Thread Chanwoo Choi
Hi Sebastian,

On 2016년 12월 07일 12:05, Sebastian Reichel wrote:
> Hi Chanwoo,
> 
> On Tue, Dec 06, 2016 at 09:26:14AM +0900, Chanwoo Choi wrote:
>> Could you please review and pick the patch3/4 for power-supply driver?
> 
> Patches look fine. As I expect the merge window to open next week I
> would rather not queue this for 4.10 and instead do it once 4.10-rc1
> has been tagged.
> 
> -- Sebastian
> 

Thanks for your pick up.

-- 
Best Regards,
Chanwoo Choi


Re: [PATCH 01/12] phy: rcar-gen3-usb2: Replace the deprecated extcon API

2016-12-05 Thread Chanwoo Choi
Hi Kishon,

Could you review and pick the patch1/2 for phy driver?

Best Regards,
Chanwoo Choi

On 2016년 11월 30일 14:57, Chanwoo Choi wrote:
> This patch replaces the deprecated extcon API as following:
> - extcon_set_cable_state_() -> extcon_set_state_sync()
> 
> Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
> ---
>  drivers/phy/phy-rcar-gen3-usb2.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/phy/phy-rcar-gen3-usb2.c 
> b/drivers/phy/phy-rcar-gen3-usb2.c
> index bd2430d7339c..7f8081f157f4 100644
> --- a/drivers/phy/phy-rcar-gen3-usb2.c
> +++ b/drivers/phy/phy-rcar-gen3-usb2.c
> @@ -93,11 +93,11 @@ static void rcar_gen3_phy_usb2_work(struct work_struct 
> *work)
>work);
>  
>   if (ch->extcon_host) {
> - extcon_set_cable_state_(ch->extcon, EXTCON_USB_HOST, true);
> - extcon_set_cable_state_(ch->extcon, EXTCON_USB, false);
> + extcon_set_state_sync(ch->extcon, EXTCON_USB_HOST, true);
> + extcon_set_state_sync(ch->extcon, EXTCON_USB, false);
>   } else {
> - extcon_set_cable_state_(ch->extcon, EXTCON_USB_HOST, false);
> - extcon_set_cable_state_(ch->extcon, EXTCON_USB, true);
> + extcon_set_state_sync(ch->extcon, EXTCON_USB_HOST, false);
> + extcon_set_state_sync(ch->extcon, EXTCON_USB, true);
>   }
>  }
>  
> 



Re: [PATCH 03/12] power_supply: axp288_charger: Replace the extcon API

2016-12-05 Thread Chanwoo Choi
Hi Sebastian,

Could you please review and pick the patch3/4 for power-supply driver?

Best Regards,
Chanwoo Choi

On 2016년 11월 30일 14:57, Chanwoo Choi wrote:
> 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()
> 
> Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
> ---
>  drivers/power/supply/axp288_charger.c | 51 
> +--
>  1 file changed, 13 insertions(+), 38 deletions(-)
> 
> diff --git a/drivers/power/supply/axp288_charger.c 
> b/drivers/power/supply/axp288_charger.c
> index 75b8e0c7402b..1115052e9a69 100644
> --- a/drivers/power/supply/axp288_charger.c
> +++ b/drivers/power/supply/axp288_charger.c
> @@ -581,15 +581,15 @@ static void axp288_charger_extcon_evt_worker(struct 
> work_struct *work)
>   bool old_connected = info->cable.connected;
>  
>   /* Determine cable/charger type */
> - if (extcon_get_cable_state_(edev, EXTCON_CHG_USB_SDP) > 0) {
> + if (extcon_get_state(edev, EXTCON_CHG_USB_SDP) > 0) {
>   dev_dbg(>pdev->dev, "USB SDP charger  is connected");
>   info->cable.connected = true;
>   info->cable.chg_type = POWER_SUPPLY_TYPE_USB;
> - } else if (extcon_get_cable_state_(edev, EXTCON_CHG_USB_CDP) > 0) {
> + } else if (extcon_get_state(edev, EXTCON_CHG_USB_CDP) > 0) {
>   dev_dbg(>pdev->dev, "USB CDP charger is connected");
>   info->cable.connected = true;
>   info->cable.chg_type = POWER_SUPPLY_TYPE_USB_CDP;
> - } else if (extcon_get_cable_state_(edev, EXTCON_CHG_USB_DCP) > 0) {
> + } else if (extcon_get_state(edev, EXTCON_CHG_USB_DCP) > 0) {
>   dev_dbg(>pdev->dev, "USB DCP charger is connected");
>   info->cable.connected = true;
>   info->cable.chg_type = POWER_SUPPLY_TYPE_USB_DCP;
> @@ -686,7 +686,7 @@ static int axp288_charger_handle_otg_evt(struct 
> notifier_block *nb,
>   struct axp288_chrg_info *info =
>   container_of(nb, struct axp288_chrg_info, otg.id_nb);
>   struct extcon_dev *edev = info->otg.cable;
> - int usb_host = extcon_get_cable_state_(edev, EXTCON_USB_HOST);
> + int usb_host = extcon_get_state(edev, EXTCON_USB_HOST);
>  
>   dev_dbg(>pdev->dev, "external connector USB-Host is %s\n",
>   usb_host ? "attached" : "detached");
> @@ -841,33 +841,27 @@ static int axp288_charger_probe(struct platform_device 
> *pdev)
>   /* Register for extcon notification */
>   INIT_WORK(>cable.work, axp288_charger_extcon_evt_worker);
>   info->cable.nb.notifier_call = axp288_charger_handle_cable_evt;
> - ret = extcon_register_notifier(info->cable.edev, EXTCON_CHG_USB_SDP,
> - >cable.nb);
> + ret = devm_extcon_register_notifier(>dev, info->cable.edev,
> + EXTCON_CHG_USB_SDP, >cable.nb);
>   if (ret) {
>   dev_err(>pdev->dev,
>   "failed to register extcon notifier for SDP %d\n", ret);
>   return ret;
>   }
>  
> - ret = extcon_register_notifier(info->cable.edev, EXTCON_CHG_USB_CDP,
> - >cable.nb);
> + ret = devm_extcon_register_notifier(>dev, info->cable.edev,
> + EXTCON_CHG_USB_CDP, >cable.nb);
>   if (ret) {
>   dev_err(>pdev->dev,
>   "failed to register extcon notifier for CDP %d\n", ret);
> - extcon_unregister_notifier(info->cable.edev,
> - EXTCON_CHG_USB_SDP, >cable.nb);
>   return ret;
>   }
>  
> - ret = extcon_register_notifier(info->cable.edev, EXTCON_CHG_USB_DCP,
> - >cable.nb);
> + ret = devm_extcon_register_notifier(>dev, info->cable.edev,
> + EXTCON_CHG_USB_DCP, >cable.nb);
>   if (ret) {
>   dev_err(>pdev->dev,
>   "failed to register extcon notifier for DCP %d\n", ret);
> - extcon_unregister_notifier(info->cable.edev,
> - EXTCON_CHG_USB_SDP, >cable.nb);
> - extcon_unregister_notifier(info->cable.edev,
> - EXTCON_CHG_USB_CDP, >cable.nb);
>   return ret;
>   }
>  
> @@ -887,13 +881,13 @@ stati

Re: [PATCH 07/12] usb: sunxi: Uses the resource-managed extcon API when registering extcon notifier

2016-12-05 Thread Chanwoo Choi
On 2016년 12월 06일 01:32, Bin Liu wrote:
> On Wed, Nov 30, 2016 at 09:45:03AM +0100, Maxime Ripard wrote:
>> On Wed, Nov 30, 2016 at 02:57:35PM +0900, Chanwoo Choi wrote:
>>> This patch just uses the resource-managed extcon API when registering
>>> the extcon notifier.
>>>
>>> Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
>>
>> Acked-by: Maxime Ripard <maxime.rip...@free-electrons.com>
> 
> It would be ideal if the subject was "usb: musb: sunxi: ...".
> 
> Acked-by: Bin Liu <b-...@ti.com>
> 

Thanks for the review. I'll change the subject.

-- 
Best Regards,
Chanwoo Choi


Re: [PATCH 06/12] usb: dwc3: omap: Replace the extcon API

2016-12-02 Thread Chanwoo Choi
Hi Felipe,

2016-12-02 18:03 GMT+09:00 Felipe Balbi <ba...@kernel.org>:
>
> Hi,
>
> Chanwoo Choi <cw00.c...@samsung.com> writes:
>> Hi Felipe,
>>
>> On 2016년 11월 30일 19:36, Felipe Balbi wrote:
>>>
>>> Hi,
>>>
>>> Chanwoo Choi <cw00.c...@samsung.com> writes:
>>>> 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()
>>>>
>>>> Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
>>>
>>> Acked-by: Felipe Balbi <felipe.ba...@linux.intel.com>
>>>
>>
>> Thanks for your review.
>>
>> Each patch has no any dependency among patches.
>> So, If possible, could you pick the patch6/8/9/10/11/12 on your tree?
>
> my tree is closed for v4.10, I can pick it up for v4.11

Thanks for your pickup to 4.11.

-- 
Best Regards,
Chanwoo Choi


Re: [PATCH 06/12] usb: dwc3: omap: Replace the extcon API

2016-12-01 Thread Chanwoo Choi
Hi Felipe,

On 2016년 11월 30일 19:36, Felipe Balbi wrote:
> 
> Hi,
> 
> Chanwoo Choi <cw00.c...@samsung.com> writes:
>> 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()
>>
>> Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
> 
> Acked-by: Felipe Balbi <felipe.ba...@linux.intel.com>
> 

Thanks for your review.

Each patch has no any dependency among patches.
So, If possible, could you pick the patch6/8/9/10/11/12 on your tree?

-- 
Best Regards,
Chanwoo Choi


[PATCH 06/12] usb: dwc3: omap: Replace the extcon API

2016-11-29 Thread Chanwoo Choi
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()

Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
---
 drivers/usb/dwc3/dwc3-omap.c | 20 +++-
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index 29e80cc9b634..2d2e9aa1db08 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -425,20 +425,20 @@ static int dwc3_omap_extcon_register(struct dwc3_omap 
*omap)
}
 
omap->vbus_nb.notifier_call = dwc3_omap_vbus_notifier;
-   ret = extcon_register_notifier(edev, EXTCON_USB,
-   >vbus_nb);
+   ret = devm_extcon_register_notifier(omap->dev, edev,
+   EXTCON_USB, >vbus_nb);
if (ret < 0)
dev_vdbg(omap->dev, "failed to register notifier for 
USB\n");
 
omap->id_nb.notifier_call = dwc3_omap_id_notifier;
-   ret = extcon_register_notifier(edev, EXTCON_USB_HOST,
-   >id_nb);
+   ret = devm_extcon_register_notifier(omap->dev, edev,
+   EXTCON_USB_HOST, >id_nb);
if (ret < 0)
dev_vdbg(omap->dev, "failed to register notifier for 
USB-HOST\n");
 
-   if (extcon_get_cable_state_(edev, EXTCON_USB) == true)
+   if (extcon_get_state(edev, EXTCON_USB) == true)
dwc3_omap_set_mailbox(omap, OMAP_DWC3_VBUS_VALID);
-   if (extcon_get_cable_state_(edev, EXTCON_USB_HOST) == true)
+   if (extcon_get_state(edev, EXTCON_USB_HOST) == true)
dwc3_omap_set_mailbox(omap, OMAP_DWC3_ID_GROUND);
 
omap->edev = edev;
@@ -527,17 +527,13 @@ static int dwc3_omap_probe(struct platform_device *pdev)
ret = of_platform_populate(node, NULL, NULL, dev);
if (ret) {
dev_err(>dev, "failed to create dwc3 core\n");
-   goto err2;
+   goto err1;
}
 
dwc3_omap_enable_irqs(omap);
 
return 0;
 
-err2:
-   extcon_unregister_notifier(omap->edev, EXTCON_USB, >vbus_nb);
-   extcon_unregister_notifier(omap->edev, EXTCON_USB_HOST, >id_nb);
-
 err1:
pm_runtime_put_sync(dev);
pm_runtime_disable(dev);
@@ -549,8 +545,6 @@ static int dwc3_omap_remove(struct platform_device *pdev)
 {
struct dwc3_omap*omap = platform_get_drvdata(pdev);
 
-   extcon_unregister_notifier(omap->edev, EXTCON_USB, >vbus_nb);
-   extcon_unregister_notifier(omap->edev, EXTCON_USB_HOST, >id_nb);
dwc3_omap_disable_irqs(omap);
of_platform_depopulate(omap->dev);
pm_runtime_put_sync(>dev);
-- 
1.9.1



[PATCH 02/12] phy: sun4i-usb: Replace the deprecated extcon API

2016-11-29 Thread Chanwoo Choi
This patch replaces the deprecated extcon API as following:
- extcon_set_cable_state_() -> extcon_set_state_sync()

Cc: Kishon Vijay Abraham I <kis...@ti.com>
Cc: Maxime Ripard <maxime.rip...@free-electrons.com>
Cc: Chen-Yu Tsai <w...@csie.org>
Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
---
 drivers/phy/phy-sun4i-usb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/phy-sun4i-usb.c b/drivers/phy/phy-sun4i-usb.c
index eeda5134c777..95cdb08c339f 100644
--- a/drivers/phy/phy-sun4i-usb.c
+++ b/drivers/phy/phy-sun4i-usb.c
@@ -528,7 +528,7 @@ static void sun4i_usb_phy0_id_vbus_det_scan(struct 
work_struct *work)
mutex_unlock(>mutex);
 
if (id_notify) {
-   extcon_set_cable_state_(data->extcon, EXTCON_USB_HOST,
+   extcon_set_state_sync(data->extcon, EXTCON_USB_HOST,
!id_det);
/* When leaving host mode force end the session here */
if (force_session_end && id_det == 1) {
@@ -541,7 +541,7 @@ static void sun4i_usb_phy0_id_vbus_det_scan(struct 
work_struct *work)
}
 
if (vbus_notify)
-   extcon_set_cable_state_(data->extcon, EXTCON_USB, vbus_det);
+   extcon_set_state_sync(data->extcon, EXTCON_USB, vbus_det);
 
if (sun4i_usb_phy0_poll(data))
queue_delayed_work(system_wq, >detect, POLL_TIME);
-- 
1.9.1



[PATCH 08/12] usb: phy: msm: Replace the extcon API

2016-11-29 Thread Chanwoo Choi
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()

Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
---
 drivers/usb/phy/phy-msm-usb.c | 33 +++--
 1 file changed, 11 insertions(+), 22 deletions(-)

diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
index 8a34759727bb..a15a89d4235d 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -1742,14 +1742,14 @@ static int msm_otg_read_dt(struct platform_device 
*pdev, struct msm_otg *motg)
if (!IS_ERR(ext_vbus)) {
motg->vbus.extcon = ext_vbus;
motg->vbus.nb.notifier_call = msm_otg_vbus_notifier;
-   ret = extcon_register_notifier(ext_vbus, EXTCON_USB,
-   >vbus.nb);
+   ret = devm_extcon_register_notifier(>dev, ext_vbus,
+   EXTCON_USB, >vbus.nb);
if (ret < 0) {
dev_err(>dev, "register VBUS notifier failed\n");
return ret;
}
 
-   ret = extcon_get_cable_state_(ext_vbus, EXTCON_USB);
+   ret = extcon_get_state(ext_vbus, EXTCON_USB);
if (ret)
set_bit(B_SESS_VLD, >inputs);
else
@@ -1759,16 +1759,14 @@ static int msm_otg_read_dt(struct platform_device 
*pdev, struct msm_otg *motg)
if (!IS_ERR(ext_id)) {
motg->id.extcon = ext_id;
motg->id.nb.notifier_call = msm_otg_id_notifier;
-   ret = extcon_register_notifier(ext_id, EXTCON_USB_HOST,
-   >id.nb);
+   ret = devm_extcon_register_notifier(>dev, ext_id,
+   EXTCON_USB_HOST, >id.nb);
if (ret < 0) {
dev_err(>dev, "register ID notifier failed\n");
-   extcon_unregister_notifier(motg->vbus.extcon,
-  EXTCON_USB, >vbus.nb);
return ret;
}
 
-   ret = extcon_get_cable_state_(ext_id, EXTCON_USB_HOST);
+   ret = extcon_get_state(ext_id, EXTCON_USB_HOST);
if (ret)
clear_bit(ID, >inputs);
else
@@ -1883,10 +1881,9 @@ static int msm_otg_probe(struct platform_device *pdev)
 */
if (motg->phy_number) {
phy_select = devm_ioremap_nocache(>dev, USB2_PHY_SEL, 4);
-   if (!phy_select) {
-   ret = -ENOMEM;
-   goto unregister_extcon;
-   }
+   if (!phy_select)
+   return -ENOMEM;
+
/* Enable second PHY with the OTG port */
writel(0x1, phy_select);
}
@@ -1897,7 +1894,7 @@ static int msm_otg_probe(struct platform_device *pdev)
if (motg->irq < 0) {
dev_err(>dev, "platform_get_irq failed\n");
ret = motg->irq;
-   goto unregister_extcon;
+   return motg->irq;
}
 
regs[0].supply = "vddcx";
@@ -1906,7 +1903,7 @@ static int msm_otg_probe(struct platform_device *pdev)
 
ret = devm_regulator_bulk_get(motg->phy.dev, ARRAY_SIZE(regs), regs);
if (ret)
-   goto unregister_extcon;
+   return ret;
 
motg->vddcx = regs[0].consumer;
motg->v3p3  = regs[1].consumer;
@@ -2003,11 +2000,6 @@ static int msm_otg_probe(struct platform_device *pdev)
clk_disable_unprepare(motg->clk);
if (!IS_ERR(motg->core_clk))
clk_disable_unprepare(motg->core_clk);
-unregister_extcon:
-   extcon_unregister_notifier(motg->id.extcon,
-  EXTCON_USB_HOST, >id.nb);
-   extcon_unregister_notifier(motg->vbus.extcon,
-  EXTCON_USB, >vbus.nb);
 
return ret;
 }
@@ -2029,9 +2021,6 @@ static int msm_otg_remove(struct platform_device *pdev)
 */
gpiod_set_value_cansleep(motg->switch_gpio, 0);
 
-   extcon_unregister_notifier(motg->id.extcon, EXTCON_USB_HOST, 
>id.nb);
-   extcon_unregister_notifier(motg->vbus.extcon, EXTCON_USB, 
>vbus.nb);
-
msm_otg_debugfs_cleanup();
cancel_delayed_work_sync(>chg_work);
cancel_work_sync(>sm_work);
-- 
1.9.1



[PATCH 10/12] usb: phy: qcom-8x16-usb: Replace the extcon API

2016-11-29 Thread Chanwoo Choi
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()

Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
---
 drivers/usb/phy/phy-qcom-8x16-usb.c | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/phy/phy-qcom-8x16-usb.c 
b/drivers/usb/phy/phy-qcom-8x16-usb.c
index d8593adb3621..fdf686398772 100644
--- a/drivers/usb/phy/phy-qcom-8x16-usb.c
+++ b/drivers/usb/phy/phy-qcom-8x16-usb.c
@@ -187,7 +187,7 @@ static int phy_8x16_init(struct usb_phy *phy)
val = ULPI_PWR_OTG_COMP_DISABLE;
usb_phy_io_write(phy, val, ULPI_SET(ULPI_PWR_CLK_MNG_REG));
 
-   state = extcon_get_cable_state_(qphy->vbus_edev, EXTCON_USB);
+   state = extcon_get_state(qphy->vbus_edev, EXTCON_USB);
if (state)
phy_8x16_vbus_on(qphy);
else
@@ -316,23 +316,20 @@ static int phy_8x16_probe(struct platform_device *pdev)
goto off_clks;
 
qphy->vbus_notify.notifier_call = phy_8x16_vbus_notify;
-   ret = extcon_register_notifier(qphy->vbus_edev, EXTCON_USB,
-  >vbus_notify);
+   ret = devm_extcon_register_notifier(>dev, qphy->vbus_edev,
+   EXTCON_USB, >vbus_notify);
if (ret < 0)
goto off_power;
 
ret = usb_add_phy_dev(>phy);
if (ret)
-   goto off_extcon;
+   goto off_power;
 
qphy->reboot_notify.notifier_call = phy_8x16_reboot_notify;
register_reboot_notifier(>reboot_notify);
 
return 0;
 
-off_extcon:
-   extcon_unregister_notifier(qphy->vbus_edev, EXTCON_USB,
-  >vbus_notify);
 off_power:
regulator_bulk_disable(ARRAY_SIZE(qphy->regulator), qphy->regulator);
 off_clks:
@@ -347,8 +344,6 @@ static int phy_8x16_remove(struct platform_device *pdev)
struct phy_8x16 *qphy = platform_get_drvdata(pdev);
 
unregister_reboot_notifier(>reboot_notify);
-   extcon_unregister_notifier(qphy->vbus_edev, EXTCON_USB,
-  >vbus_notify);
 
/*
 * Ensure that D+/D- lines are routed to uB connector, so
-- 
1.9.1



[PATCH 12/12] usb: renesas_usbhs: Replace the deprecated extcon API

2016-11-29 Thread Chanwoo Choi
This patch replaces the deprecated extcon API as following:
- extcon_get_cable_state_() -> extcon_get_state()

Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
---
 drivers/usb/renesas_usbhs/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/renesas_usbhs/common.c 
b/drivers/usb/renesas_usbhs/common.c
index 012a37aa3e0d..623c51300393 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -389,7 +389,7 @@ static void usbhsc_hotplug(struct usbhs_priv *priv)
 
if (enable && !mod) {
if (priv->edev) {
-   cable = extcon_get_cable_state_(priv->edev, 
EXTCON_USB_HOST);
+   cable = extcon_get_state(priv->edev, EXTCON_USB_HOST);
if ((cable > 0 && id != USBHS_HOST) ||
(!cable && id != USBHS_GADGET)) {
dev_info(>dev,
-- 
1.9.1



[PATCH 04/12] power_supply: qcom_smbb: Replace the deprecated extcon API

2016-11-29 Thread Chanwoo Choi
This patch replaces the deprecated extcon API as following:
- extcon_set_cable_state_() -> extcon_set_state_sync()

Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
---
 drivers/power/supply/qcom_smbb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/supply/qcom_smbb.c b/drivers/power/supply/qcom_smbb.c
index bb91a1c339bc..7b1991265b03 100644
--- a/drivers/power/supply/qcom_smbb.c
+++ b/drivers/power/supply/qcom_smbb.c
@@ -378,7 +378,7 @@ static irqreturn_t smbb_usb_valid_handler(int irq, void 
*_data)
struct smbb_charger *chg = _data;
 
smbb_set_line_flag(chg, irq, STATUS_USBIN_VALID);
-   extcon_set_cable_state_(chg->edev, EXTCON_USB,
+   extcon_set_state_sync(chg->edev, EXTCON_USB,
chg->status & STATUS_USBIN_VALID);
power_supply_changed(chg->usb_psy);
 
-- 
1.9.1



[PATCH 09/12] usb: phy: omap-otg: Replace the extcon API

2016-11-29 Thread Chanwoo Choi
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()

Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
---
 drivers/usb/phy/phy-omap-otg.c | 24 ++--
 1 file changed, 6 insertions(+), 18 deletions(-)

diff --git a/drivers/usb/phy/phy-omap-otg.c b/drivers/usb/phy/phy-omap-otg.c
index 6523af4f8f93..800d1d90753d 100644
--- a/drivers/usb/phy/phy-omap-otg.c
+++ b/drivers/usb/phy/phy-omap-otg.c
@@ -118,19 +118,19 @@ static int omap_otg_probe(struct platform_device *pdev)
otg_dev->id_nb.notifier_call = omap_otg_id_notifier;
otg_dev->vbus_nb.notifier_call = omap_otg_vbus_notifier;
 
-   ret = extcon_register_notifier(extcon, EXTCON_USB_HOST, 
_dev->id_nb);
+   ret = devm_extcon_register_notifier(>dev, extcon,
+   EXTCON_USB_HOST, _dev->id_nb);
if (ret)
return ret;
 
-   ret = extcon_register_notifier(extcon, EXTCON_USB, _dev->vbus_nb);
+   ret = devm_extcon_register_notifier(>dev, extcon,
+   EXTCON_USB, _dev->vbus_nb);
if (ret) {
-   extcon_unregister_notifier(extcon, EXTCON_USB_HOST,
-   _dev->id_nb);
return ret;
}
 
-   otg_dev->id = extcon_get_cable_state_(extcon, EXTCON_USB_HOST);
-   otg_dev->vbus = extcon_get_cable_state_(extcon, EXTCON_USB);
+   otg_dev->id = extcon_get_state(extcon, EXTCON_USB_HOST);
+   otg_dev->vbus = extcon_get_state(extcon, EXTCON_USB);
omap_otg_set_mode(otg_dev);
 
rev = readl(otg_dev->base);
@@ -145,20 +145,8 @@ static int omap_otg_probe(struct platform_device *pdev)
return 0;
 }
 
-static int omap_otg_remove(struct platform_device *pdev)
-{
-   struct otg_device *otg_dev = platform_get_drvdata(pdev);
-   struct extcon_dev *edev = otg_dev->extcon;
-
-   extcon_unregister_notifier(edev, EXTCON_USB_HOST, _dev->id_nb);
-   extcon_unregister_notifier(edev, EXTCON_USB, _dev->vbus_nb);
-
-   return 0;
-}
-
 static struct platform_driver omap_otg_driver = {
.probe  = omap_otg_probe,
-   .remove = omap_otg_remove,
.driver = {
.name   = "omap_otg",
},
-- 
1.9.1



[PATCH 05/12] usb: chipdata: Replace the extcon API

2016-11-29 Thread Chanwoo Choi
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()

Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
---
 drivers/usb/chipidea/core.c | 30 ++
 1 file changed, 6 insertions(+), 24 deletions(-)

diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 69426e644d17..a5b44963eaea 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -742,7 +742,7 @@ static int ci_get_platdata(struct device *dev,
cable->edev = ext_vbus;
 
if (!IS_ERR(ext_vbus)) {
-   ret = extcon_get_cable_state_(cable->edev, EXTCON_USB);
+   ret = extcon_get_state(cable->edev, EXTCON_USB);
if (ret)
cable->state = true;
else
@@ -754,7 +754,7 @@ static int ci_get_platdata(struct device *dev,
cable->edev = ext_id;
 
if (!IS_ERR(ext_id)) {
-   ret = extcon_get_cable_state_(cable->edev, EXTCON_USB_HOST);
+   ret = extcon_get_state(cable->edev, EXTCON_USB_HOST);
if (ret)
cable->state = false;
else
@@ -771,8 +771,8 @@ static int ci_extcon_register(struct ci_hdrc *ci)
id = >platdata->id_extcon;
id->ci = ci;
if (!IS_ERR(id->edev)) {
-   ret = extcon_register_notifier(id->edev, EXTCON_USB_HOST,
-  >nb);
+   ret = devm_extcon_register_notifier(ci->dev, id->edev,
+   EXTCON_USB_HOST, >nb);
if (ret < 0) {
dev_err(ci->dev, "register ID failed\n");
return ret;
@@ -782,11 +782,9 @@ static int ci_extcon_register(struct ci_hdrc *ci)
vbus = >platdata->vbus_extcon;
vbus->ci = ci;
if (!IS_ERR(vbus->edev)) {
-   ret = extcon_register_notifier(vbus->edev, EXTCON_USB,
-  >nb);
+   ret = devm_extcon_register_notifier(ci->dev, vbus->edev,
+   EXTCON_USB, >nb);
if (ret < 0) {
-   extcon_unregister_notifier(id->edev, EXTCON_USB_HOST,
-  >nb);
dev_err(ci->dev, "register VBUS failed\n");
return ret;
}
@@ -795,20 +793,6 @@ static int ci_extcon_register(struct ci_hdrc *ci)
return 0;
 }
 
-static void ci_extcon_unregister(struct ci_hdrc *ci)
-{
-   struct ci_hdrc_cable *cable;
-
-   cable = >platdata->id_extcon;
-   if (!IS_ERR(cable->edev))
-   extcon_unregister_notifier(cable->edev, EXTCON_USB_HOST,
-  >nb);
-
-   cable = >platdata->vbus_extcon;
-   if (!IS_ERR(cable->edev))
-   extcon_unregister_notifier(cable->edev, EXTCON_USB, >nb);
-}
-
 static DEFINE_IDA(ci_ida);
 
 struct platform_device *ci_hdrc_add_device(struct device *dev,
@@ -1053,7 +1037,6 @@ static int ci_hdrc_probe(struct platform_device *pdev)
if (!ret)
return 0;
 
-   ci_extcon_unregister(ci);
 stop:
ci_role_destroy(ci);
 deinit_phy:
@@ -1073,7 +1056,6 @@ static int ci_hdrc_remove(struct platform_device *pdev)
}
 
dbg_remove_files(ci);
-   ci_extcon_unregister(ci);
ci_role_destroy(ci);
ci_hdrc_enter_lpm(ci, true);
ci_usb_phy_exit(ci);
-- 
1.9.1



[PATCH 07/12] usb: sunxi: Uses the resource-managed extcon API when registering extcon notifier

2016-11-29 Thread Chanwoo Choi
This patch just uses the resource-managed extcon API when registering
the extcon notifier.

Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
---
 drivers/usb/musb/sunxi.c | 12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/musb/sunxi.c b/drivers/usb/musb/sunxi.c
index 1408245be18e..4b531551e49d 100644
--- a/drivers/usb/musb/sunxi.c
+++ b/drivers/usb/musb/sunxi.c
@@ -261,14 +261,14 @@ static int sunxi_musb_init(struct musb *musb)
writeb(SUNXI_MUSB_VEND0_PIO_MODE, musb->mregs + SUNXI_MUSB_VEND0);
 
/* Register notifier before calling phy_init() */
-   ret = extcon_register_notifier(glue->extcon, EXTCON_USB_HOST,
-  >host_nb);
+   ret = devm_extcon_register_notifier(glue->dev, glue->extcon,
+   EXTCON_USB_HOST, >host_nb);
if (ret)
goto error_reset_assert;
 
ret = phy_init(glue->phy);
if (ret)
-   goto error_unregister_notifier;
+   goto error_reset_assert;
 
musb->isr = sunxi_musb_interrupt;
 
@@ -277,9 +277,6 @@ static int sunxi_musb_init(struct musb *musb)
 
return 0;
 
-error_unregister_notifier:
-   extcon_unregister_notifier(glue->extcon, EXTCON_USB_HOST,
-  >host_nb);
 error_reset_assert:
if (test_bit(SUNXI_MUSB_FL_HAS_RESET, >flags))
reset_control_assert(glue->rst);
@@ -303,9 +300,6 @@ static int sunxi_musb_exit(struct musb *musb)
 
phy_exit(glue->phy);
 
-   extcon_unregister_notifier(glue->extcon, EXTCON_USB_HOST,
-  >host_nb);
-
if (test_bit(SUNXI_MUSB_FL_HAS_RESET, >flags))
reset_control_assert(glue->rst);
 
-- 
1.9.1



[PATCH 03/12] power_supply: axp288_charger: Replace the extcon API

2016-11-29 Thread Chanwoo Choi
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()

Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
---
 drivers/power/supply/axp288_charger.c | 51 +--
 1 file changed, 13 insertions(+), 38 deletions(-)

diff --git a/drivers/power/supply/axp288_charger.c 
b/drivers/power/supply/axp288_charger.c
index 75b8e0c7402b..1115052e9a69 100644
--- a/drivers/power/supply/axp288_charger.c
+++ b/drivers/power/supply/axp288_charger.c
@@ -581,15 +581,15 @@ static void axp288_charger_extcon_evt_worker(struct 
work_struct *work)
bool old_connected = info->cable.connected;
 
/* Determine cable/charger type */
-   if (extcon_get_cable_state_(edev, EXTCON_CHG_USB_SDP) > 0) {
+   if (extcon_get_state(edev, EXTCON_CHG_USB_SDP) > 0) {
dev_dbg(>pdev->dev, "USB SDP charger  is connected");
info->cable.connected = true;
info->cable.chg_type = POWER_SUPPLY_TYPE_USB;
-   } else if (extcon_get_cable_state_(edev, EXTCON_CHG_USB_CDP) > 0) {
+   } else if (extcon_get_state(edev, EXTCON_CHG_USB_CDP) > 0) {
dev_dbg(>pdev->dev, "USB CDP charger is connected");
info->cable.connected = true;
info->cable.chg_type = POWER_SUPPLY_TYPE_USB_CDP;
-   } else if (extcon_get_cable_state_(edev, EXTCON_CHG_USB_DCP) > 0) {
+   } else if (extcon_get_state(edev, EXTCON_CHG_USB_DCP) > 0) {
dev_dbg(>pdev->dev, "USB DCP charger is connected");
info->cable.connected = true;
info->cable.chg_type = POWER_SUPPLY_TYPE_USB_DCP;
@@ -686,7 +686,7 @@ static int axp288_charger_handle_otg_evt(struct 
notifier_block *nb,
struct axp288_chrg_info *info =
container_of(nb, struct axp288_chrg_info, otg.id_nb);
struct extcon_dev *edev = info->otg.cable;
-   int usb_host = extcon_get_cable_state_(edev, EXTCON_USB_HOST);
+   int usb_host = extcon_get_state(edev, EXTCON_USB_HOST);
 
dev_dbg(>pdev->dev, "external connector USB-Host is %s\n",
usb_host ? "attached" : "detached");
@@ -841,33 +841,27 @@ static int axp288_charger_probe(struct platform_device 
*pdev)
/* Register for extcon notification */
INIT_WORK(>cable.work, axp288_charger_extcon_evt_worker);
info->cable.nb.notifier_call = axp288_charger_handle_cable_evt;
-   ret = extcon_register_notifier(info->cable.edev, EXTCON_CHG_USB_SDP,
-   >cable.nb);
+   ret = devm_extcon_register_notifier(>dev, info->cable.edev,
+   EXTCON_CHG_USB_SDP, >cable.nb);
if (ret) {
dev_err(>pdev->dev,
"failed to register extcon notifier for SDP %d\n", ret);
return ret;
}
 
-   ret = extcon_register_notifier(info->cable.edev, EXTCON_CHG_USB_CDP,
-   >cable.nb);
+   ret = devm_extcon_register_notifier(>dev, info->cable.edev,
+   EXTCON_CHG_USB_CDP, >cable.nb);
if (ret) {
dev_err(>pdev->dev,
"failed to register extcon notifier for CDP %d\n", ret);
-   extcon_unregister_notifier(info->cable.edev,
-   EXTCON_CHG_USB_SDP, >cable.nb);
return ret;
}
 
-   ret = extcon_register_notifier(info->cable.edev, EXTCON_CHG_USB_DCP,
-   >cable.nb);
+   ret = devm_extcon_register_notifier(>dev, info->cable.edev,
+   EXTCON_CHG_USB_DCP, >cable.nb);
if (ret) {
dev_err(>pdev->dev,
"failed to register extcon notifier for DCP %d\n", ret);
-   extcon_unregister_notifier(info->cable.edev,
-   EXTCON_CHG_USB_SDP, >cable.nb);
-   extcon_unregister_notifier(info->cable.edev,
-   EXTCON_CHG_USB_CDP, >cable.nb);
return ret;
}
 
@@ -887,13 +881,13 @@ static int axp288_charger_probe(struct platform_device 
*pdev)
/* Register for OTG notification */
INIT_WORK(>otg.work, axp288_charger_otg_evt_worker);
info->otg.id_nb.notifier_call = axp288_charger_handle_otg_evt;
-   ret = extcon_register_notifier(info->otg.cable, EXTCON_USB_HOST,
-  >otg.id_nb);
+   ret = devm_extcon_register_notifier(>dev, info->otg.cable,
+   

[PATCH 11/12] usb: phy: tahvo: Replace the deprecated extcon API

2016-11-29 Thread Chanwoo Choi
This patch replaces the deprecated extcon API as following:
- extcon_set_cable_state_() -> extcon_set_state_sync()

Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
---
 drivers/usb/phy/phy-tahvo.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/phy/phy-tahvo.c b/drivers/usb/phy/phy-tahvo.c
index 1343bff004eb..9a7822e12156 100644
--- a/drivers/usb/phy/phy-tahvo.c
+++ b/drivers/usb/phy/phy-tahvo.c
@@ -121,7 +121,7 @@ static void check_vbus_state(struct tahvo_usb *tu)
prev_state = tu->vbus_state;
tu->vbus_state = reg & TAHVO_STAT_VBUS;
if (prev_state != tu->vbus_state) {
-   extcon_set_cable_state_(tu->extcon, EXTCON_USB, tu->vbus_state);
+   extcon_set_state_sync(tu->extcon, EXTCON_USB, tu->vbus_state);
sysfs_notify(>pt_dev->dev.kobj, NULL, "vbus_state");
}
 }
@@ -130,7 +130,7 @@ static void tahvo_usb_become_host(struct tahvo_usb *tu)
 {
struct retu_dev *rdev = dev_get_drvdata(tu->pt_dev->dev.parent);
 
-   extcon_set_cable_state_(tu->extcon, EXTCON_USB_HOST, true);
+   extcon_set_state_sync(tu->extcon, EXTCON_USB_HOST, true);
 
/* Power up the transceiver in USB host mode */
retu_write(rdev, TAHVO_REG_USBR, USBR_REGOUT | USBR_NSUSPEND |
@@ -149,7 +149,7 @@ static void tahvo_usb_become_peripheral(struct tahvo_usb 
*tu)
 {
struct retu_dev *rdev = dev_get_drvdata(tu->pt_dev->dev.parent);
 
-   extcon_set_cable_state_(tu->extcon, EXTCON_USB_HOST, false);
+   extcon_set_state_sync(tu->extcon, EXTCON_USB_HOST, false);
 
/* Power up transceiver and set it in USB peripheral mode */
retu_write(rdev, TAHVO_REG_USBR, USBR_SLAVE_CONTROL | USBR_REGOUT |
@@ -379,9 +379,9 @@ static int tahvo_usb_probe(struct platform_device *pdev)
}
 
/* Set the initial cable state. */
-   extcon_set_cable_state_(tu->extcon, EXTCON_USB_HOST,
+   extcon_set_state_sync(tu->extcon, EXTCON_USB_HOST,
   tu->tahvo_mode == TAHVO_MODE_HOST);
-   extcon_set_cable_state_(tu->extcon, EXTCON_USB, tu->vbus_state);
+   extcon_set_state_sync(tu->extcon, EXTCON_USB, tu->vbus_state);
 
/* Create OTG interface */
tahvo_usb_power_off(tu);
-- 
1.9.1



[PATCH 00/12] extcon: Replace the deprecated extcon API

2016-11-29 Thread Chanwoo Choi
This patches just replace the deprecated extcon API without any change
of extcon operation and use the resource-managed function for
extcon_register_notifier().

The new extcon API instead of deprecated API.
- extcon_set_cable_state_() -> extcon_set_state_sync();
- extcon_get_cable_state_() -> extcon_get_state();

The each patch has not any dependency among patches. So, each maintainer
could pick up each patch without any problem.

Chanwoo Choi (12):
  phy: rcar-gen3-usb2: Replace the deprecated extcon API
  phy: sun4i-usb: Replace the deprecated extcon API
  power_supply: axp288_charger: Replace the extcon API
  power_supply: qcom_smbb: Replace the deprecated extcon API
  usb: chipdata: Replace the extcon API
  usb: dwc3: omap: Replace the extcon API
  usb: sunxi: Uses the resource-managed extcon API when registering extcon 
notifier
  usb: phy: msm: Replace the extcon API
  usb: phy: omap-otg: Replace the extcon API
  usb: phy: qcom-8x16-usb: Replace the extcon API
  usb: phy: tahvo: Replace the deprecated extcon API
  usb: renesas_usbhs: Replace the deprecated extcon API

 drivers/phy/phy-rcar-gen3-usb2.c  |  8 +++---
 drivers/phy/phy-sun4i-usb.c   |  4 +--
 drivers/power/supply/axp288_charger.c | 51 +--
 drivers/power/supply/qcom_smbb.c  |  2 +-
 drivers/usb/chipidea/core.c   | 30 +
 drivers/usb/dwc3/dwc3-omap.c  | 20 +-
 drivers/usb/musb/sunxi.c  | 12 +++--
 drivers/usb/phy/phy-msm-usb.c | 33 ---
 drivers/usb/phy/phy-omap-otg.c| 24 +
 drivers/usb/phy/phy-qcom-8x16-usb.c   | 13 +++--
 drivers/usb/phy/phy-tahvo.c   | 10 +++
 drivers/usb/renesas_usbhs/common.c|  2 +-
 12 files changed, 63 insertions(+), 146 deletions(-)

-- 
1.9.1



[PATCH 01/12] phy: rcar-gen3-usb2: Replace the deprecated extcon API

2016-11-29 Thread Chanwoo Choi
This patch replaces the deprecated extcon API as following:
- extcon_set_cable_state_() -> extcon_set_state_sync()

Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
---
 drivers/phy/phy-rcar-gen3-usb2.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/phy/phy-rcar-gen3-usb2.c b/drivers/phy/phy-rcar-gen3-usb2.c
index bd2430d7339c..7f8081f157f4 100644
--- a/drivers/phy/phy-rcar-gen3-usb2.c
+++ b/drivers/phy/phy-rcar-gen3-usb2.c
@@ -93,11 +93,11 @@ static void rcar_gen3_phy_usb2_work(struct work_struct 
*work)
 work);
 
if (ch->extcon_host) {
-   extcon_set_cable_state_(ch->extcon, EXTCON_USB_HOST, true);
-   extcon_set_cable_state_(ch->extcon, EXTCON_USB, false);
+   extcon_set_state_sync(ch->extcon, EXTCON_USB_HOST, true);
+   extcon_set_state_sync(ch->extcon, EXTCON_USB, false);
} else {
-   extcon_set_cable_state_(ch->extcon, EXTCON_USB_HOST, false);
-   extcon_set_cable_state_(ch->extcon, EXTCON_USB, true);
+   extcon_set_state_sync(ch->extcon, EXTCON_USB_HOST, false);
+   extcon_set_state_sync(ch->extcon, EXTCON_USB, true);
}
 }
 
-- 
1.9.1



[PATCH] extcon: Split out the extcon APIs for extcon provider driver

2016-11-29 Thread Chanwoo Choi
This patchs split out the extcon APIs of extcon provider driver in order to
prevent the direct access of struct extcon_dev by extcon consumer driver.
The extcon consumer driver don't need to handle the extcon provider APIs.

The extcon subsystem has two type of extcon drivers as following:
- extcon provider driver
: Detect the external connector and identify the state/property of
  each external connector. And it send the notification to synchronize
  the information between provider and consumer driver.
- extcon consumer driver
: Receive the notifcation from extcon provider driver. When receving the noti,
  it can get the both state and property of specific external connector.

Cc: Myungjoo Ham <myungjoo@samsung.com>
Cc: Chen-Yu Tsai <w...@csie.org>
Cc: Krzysztof Kozlowski <k...@kernel.org>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda...@renesas.com>
Cc: Kishon Vijay Abraham I <kis...@ti.com>
Cc: Maxime Ripard <maxime.rip...@free-electrons.com>
Cc: Felipe Balbi <ba...@kernel.org>
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
Cc: Chris Zhong <z...@rock-chips.com>
Cc: Roger Quadros <rog...@ti.com>
Cc: Charles Keepax <ckee...@opensource.wolfsonmicro.com>
Cc: patc...@opensource.wolfsonmicro.com
Cc: linux-renesas-soc@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-...@vger.kernel.org
Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
---
 drivers/extcon/devres.c|   2 +-
 drivers/extcon/extcon-adc-jack.c   |   2 +-
 drivers/extcon/extcon-arizona.c|   2 +-
 drivers/extcon/extcon-axp288.c |   2 +-
 drivers/extcon/extcon-gpio.c   |   2 +-
 drivers/extcon/extcon-max14577.c   |   2 +-
 drivers/extcon/extcon-max3355.c|   2 +-
 drivers/extcon/extcon-max77693.c   |   2 +-
 drivers/extcon/extcon-max77843.c   |   2 +-
 drivers/extcon/extcon-max8997.c|   2 +-
 drivers/extcon/extcon-palmas.c |   1 +
 drivers/extcon/extcon-qcom-spmi-misc.c |   2 +-
 drivers/extcon/extcon-rt8973a.c|   2 +-
 drivers/extcon/extcon-sm5502.c |   2 +-
 drivers/extcon/extcon-usb-gpio.c   |   2 +-
 drivers/extcon/extcon.c|   2 +-
 drivers/phy/phy-rcar-gen3-usb2.c   |   2 +-
 drivers/phy/phy-sun4i-usb.c|   2 +-
 drivers/power/supply/qcom_smbb.c   |   2 +-
 drivers/usb/phy/phy-tahvo.c|   2 +-
 include/linux/extcon-provider.h| 262 +
 include/linux/extcon.h | 168 +
 22 files changed, 286 insertions(+), 183 deletions(-)
 create mode 100644 include/linux/extcon-provider.h

diff --git a/drivers/extcon/devres.c b/drivers/extcon/devres.c
index e686acd1c459..1b7dce13b21b 100644
--- a/drivers/extcon/devres.c
+++ b/drivers/extcon/devres.c
@@ -14,7 +14,7 @@
  * GNU General Public License for more details.
  */
 
-#include 
+#include 
 
 static int devm_extcon_dev_match(struct device *dev, void *res, void *data)
 {
diff --git a/drivers/extcon/extcon-adc-jack.c b/drivers/extcon/extcon-adc-jack.c
index bc538708c753..0882813a95f9 100644
--- a/drivers/extcon/extcon-adc-jack.c
+++ b/drivers/extcon/extcon-adc-jack.c
@@ -26,7 +26,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 /**
  * struct adc_jack_data - internal data for adc_jack device driver
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
index aeab47df9233..292878714ed9 100644
--- a/drivers/extcon/extcon-arizona.c
+++ b/drivers/extcon/extcon-arizona.c
@@ -27,7 +27,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 
diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c
index 42f41e808292..f5b3687d29e8 100644
--- a/drivers/extcon/extcon-axp288.c
+++ b/drivers/extcon/extcon-axp288.c
@@ -23,7 +23,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/extcon/extcon-gpio.c b/drivers/extcon/extcon-gpio.c
index ebed22f22d75..ab770adcca7e 100644
--- a/drivers/extcon/extcon-gpio.c
+++ b/drivers/extcon/extcon-gpio.c
@@ -17,7 +17,7 @@
  * GNU General Public License for more details.
  */
 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/extcon/extcon-max14577.c b/drivers/extcon/extcon-max14577.c
index 12e26c4e7763..9a7524ebf698 100644
--- a/drivers/extcon/extcon-max14577.c
+++ b/drivers/extcon/extcon-max14577.c
@@ -23,7 +23,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #defineDELAY_MS_DEFAULT17000   /* unit: 
millisecond */
 
diff --git a/drivers/extcon/extcon-max3355.c b/drivers/extcon/extcon-max3355.c
index 533e16a952b8..0aa410836f4e 100644
--- a/drivers/extcon/extcon-max3355.c
+++ b/drivers/extcon/extcon-max3355.c
@@ -9,7 +9,7 @@
  * may be copied, distributed, and modified under those terms.
  */
 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/extcon

[PATCH] extcon: Split out the extcon APIs for extcon provider driver

2016-08-01 Thread Chanwoo Choi
This patchs split out the extcon APIs of extcon provider driver in order to
prevent the direct access of struct extcon_dev by extcon consumer driver.
The extcon consumer driver don't need to handle the extcon provider APIs.

The extcon subsystem has two type of extcon drivers as following:
- extcon provider driver
: Detect the external connector and identify the state/property of
  each external connector. And it send the notification to synchronize
  the information between provider and consumer driver.
- extcon consumer driver
: Receive the notifcation from extcon provider driver. When receving the noti,
  it can get the both state and property of specific external connector.

Cc: Myungjoo Ham <myungjoo@samsung.com>
Cc: Chen-Yu Tsai <w...@csie.org>
Cc: Krzysztof Kozlowski <k.kozlow...@samsung.com>
Cc: Yoshihiro Shimoda <yoshihiro.shimoda...@renesas.com>
Cc: Kishon Vijay Abraham I <kis...@ti.com>
Cc: Maxime Ripard <maxime.rip...@free-electrons.com>
Cc: Felipe Balbi <ba...@kernel.org>
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
Cc: Chris Zhong <z...@rock-chips.com>
Cc: Roger Quadros <rog...@ti.com>
Cc: Charles Keepax <ckee...@opensource.wolfsonmicro.com>
Cc: patc...@opensource.wolfsonmicro.com
Cc: linux-renesas-soc@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-...@vger.kernel.org
Signed-off-by: Chanwoo Choi <cw00.c...@samsung.com>
---
 drivers/extcon/devres.c  |   2 +-
 drivers/extcon/extcon-adc-jack.c |   2 +-
 drivers/extcon/extcon-arizona.c  |   2 +-
 drivers/extcon/extcon-axp288.c   |   2 +-
 drivers/extcon/extcon-gpio.c |   2 +-
 drivers/extcon/extcon-max14577.c |   2 +-
 drivers/extcon/extcon-max3355.c  |   2 +-
 drivers/extcon/extcon-max77693.c |   2 +-
 drivers/extcon/extcon-max77843.c |   2 +-
 drivers/extcon/extcon-max8997.c  |   2 +-
 drivers/extcon/extcon-palmas.c   |   1 +
 drivers/extcon/extcon-rt8973a.c  |   2 +-
 drivers/extcon/extcon-sm5502.c   |   2 +-
 drivers/extcon/extcon-usb-gpio.c |   2 +-
 drivers/extcon/extcon.c  |   2 +-
 drivers/phy/phy-rcar-gen3-usb2.c |   2 +-
 drivers/phy/phy-sun4i-usb.c  |   2 +-
 drivers/usb/phy/phy-tahvo.c  |   2 +-
 include/linux/extcon-provider.h  | 262 +++
 include/linux/extcon.h   | 169 +
 20 files changed, 284 insertions(+), 182 deletions(-)
 create mode 100644 include/linux/extcon-provider.h

diff --git a/drivers/extcon/devres.c b/drivers/extcon/devres.c
index e686acd1c459..1b7dce13b21b 100644
--- a/drivers/extcon/devres.c
+++ b/drivers/extcon/devres.c
@@ -14,7 +14,7 @@
  * GNU General Public License for more details.
  */
 
-#include 
+#include 
 
 static int devm_extcon_dev_match(struct device *dev, void *res, void *data)
 {
diff --git a/drivers/extcon/extcon-adc-jack.c b/drivers/extcon/extcon-adc-jack.c
index e62e6cd7e00a..7340b03487fb 100644
--- a/drivers/extcon/extcon-adc-jack.c
+++ b/drivers/extcon/extcon-adc-jack.c
@@ -26,7 +26,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 /**
  * struct adc_jack_data - internal data for adc_jack device driver
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
index 493bd9fe5f67..bf35697f7278 100644
--- a/drivers/extcon/extcon-arizona.c
+++ b/drivers/extcon/extcon-arizona.c
@@ -27,7 +27,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 
diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c
index fd55c2f2080a..2ba1a14a51fa 100644
--- a/drivers/extcon/extcon-axp288.c
+++ b/drivers/extcon/extcon-axp288.c
@@ -23,7 +23,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/extcon/extcon-gpio.c b/drivers/extcon/extcon-gpio.c
index b1b0264eb12d..835488ea7dbb 100644
--- a/drivers/extcon/extcon-gpio.c
+++ b/drivers/extcon/extcon-gpio.c
@@ -17,7 +17,7 @@
  * GNU General Public License for more details.
  */
 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/extcon/extcon-max14577.c b/drivers/extcon/extcon-max14577.c
index 852a7112f451..d0a01490649b 100644
--- a/drivers/extcon/extcon-max14577.c
+++ b/drivers/extcon/extcon-max14577.c
@@ -23,7 +23,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #defineDELAY_MS_DEFAULT17000   /* unit: 
millisecond */
 
diff --git a/drivers/extcon/extcon-max3355.c b/drivers/extcon/extcon-max3355.c
index c24abec5d06c..ec94c2ff8f6f 100644
--- a/drivers/extcon/extcon-max3355.c
+++ b/drivers/extcon/extcon-max3355.c
@@ -9,7 +9,7 @@
  * may be copied, distributed, and modified under those terms.
  */
 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
index f17cb76b567c..9729b1fc402c 100644
--- a/drivers/extcon/extcon-max77693.c
+++ b/drivers/extcon/extcon-max77693.c
@@ -26,7 +26,7 @@
 #i

Re: [PATCH 1/7] extcon: add missing of_node_put after calling of_parse_phandle

2016-07-01 Thread Chanwoo Choi
Hi Peter,

Applied it.

Regards,
Chanwoo Choi

2016-07-01 18:41 GMT+09:00 Peter Chen <peter.c...@nxp.com>:
> of_node_put needs to be called when the device node which is got
> from of_parse_phandle has finished using.
>
> Cc: MyungJoo Ham <myungjoo....@samsung.com>
> Cc: Chanwoo Choi <cw00.c...@samsung.com>
> Signed-off-by: Peter Chen <peter.c...@nxp.com>
> ---
>  drivers/extcon/extcon.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
> index 21a123c..86ea14d 100644
> --- a/drivers/extcon/extcon.c
> +++ b/drivers/extcon/extcon.c
> @@ -1107,10 +1107,12 @@ struct extcon_dev *extcon_get_edev_by_phandle(struct 
> device *dev, int index)
> list_for_each_entry(edev, _dev_list, entry) {
> if (edev->dev.parent && edev->dev.parent->of_node == node) {
> mutex_unlock(_dev_list_lock);
> +   of_node_put(node);
> return edev;
> }
> }
> mutex_unlock(_dev_list_lock);
> +   of_node_put(node);
>
> return ERR_PTR(-EPROBE_DEFER);
>  }
> --
> 1.9.1
>
>
> ___
> linux-arm-kernel mailing list
> linux-arm-ker...@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel


Re: [PATCH 7/7] devfreq: exynos-bus: add missing of_node_put after calling of_parse_phandle

2016-07-01 Thread Chanwoo Choi
Hi Peter,

2016-07-01 18:42 GMT+09:00 Peter Chen <peter.c...@nxp.com>:
> of_node_put needs to be called when the device node which is got
> from of_parse_phandle has finished using.
>
> Cc: Chanwoo Choi <cw00.c...@samsung.com>
> Cc: MyungJoo Ham <myungjoo@samsung.com>
> Cc: Kyungmin Park <kyungmin.p...@samsung.com>
> Cc: Kukjin Kim <kg...@kernel.org>
> Cc: Krzysztof Kozlowski <k.kozlow...@samsung.com>
> Signed-off-by: Peter Chen <peter.c...@nxp.com>
> ---
>  drivers/devfreq/exynos-bus.c | 9 ++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
> index 2363d0a..a38b5ec 100644
> --- a/drivers/devfreq/exynos-bus.c
> +++ b/drivers/devfreq/exynos-bus.c
> @@ -383,7 +383,7 @@ err_clk:
>  static int exynos_bus_probe(struct platform_device *pdev)
>  {
> struct device *dev = >dev;
> -   struct device_node *np = dev->of_node;
> +   struct device_node *np = dev->of_node, node;
> struct devfreq_dev_profile *profile;
> struct devfreq_simple_ondemand_data *ondemand_data;
> struct devfreq_passive_data *passive_data;
> @@ -415,10 +415,13 @@ static int exynos_bus_probe(struct platform_device 
> *pdev)
> goto err;
> }
>
> -   if (of_parse_phandle(dev->of_node, "devfreq", 0))
> +   node = of_parse_phandle(dev->of_node, "devfreq", 0);
> +   if (node) {
> +   of_node_put(node);
> goto passive;
> -   else
> +   } else {
> ret = exynos_bus_parent_parse_of(np, bus);
> +   }
>
> if (ret < 0)
> goto err;

Acked-by: Chanwoo Choi <cw00.c...@samsung.com>

Regards,
Chanwoo Choi


Re: [PATCH 3/3] phy: rcar-gen3-usb2: add extcon support

2016-03-13 Thread Chanwoo Choi
Hi Yoshihiro,

On 2016년 03월 03일 19:09, Yoshihiro Shimoda wrote:
> This patch adds extcon support for otg related channel.
> 
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda...@renesas.com>
> ---
>  drivers/phy/Kconfig  |  1 +
>  drivers/phy/phy-rcar-gen3-usb2.c | 26 ++
>  2 files changed, 27 insertions(+)
> 
> diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
> index ba68f14..db57d6c 100644
> --- a/drivers/phy/Kconfig
> +++ b/drivers/phy/Kconfig
> @@ -121,6 +121,7 @@ config PHY_RCAR_GEN2
>  config PHY_RCAR_GEN3_USB2
>   tristate "Renesas R-Car generation 3 USB 2.0 PHY driver"
>   depends on OF && ARCH_RENESAS
> + depends on EXTCON
>   select GENERIC_PHY
>   help
> Support for USB 2.0 PHY found on Renesas R-Car generation 3 SoCs.
> diff --git a/drivers/phy/phy-rcar-gen3-usb2.c 
> b/drivers/phy/phy-rcar-gen3-usb2.c
> index 7b14244..76bb88f 100644
> --- a/drivers/phy/phy-rcar-gen3-usb2.c
> +++ b/drivers/phy/phy-rcar-gen3-usb2.c
> @@ -12,6 +12,7 @@
>   * published by the Free Software Foundation.
>   */
>  
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -77,6 +78,7 @@
>  
>  struct rcar_gen3_chan {
>   void __iomem *base;
> + struct extcon_dev *extcon;
>   struct phy *phy;
>   struct regulator *vbus;
>   bool has_otg;
> @@ -127,6 +129,9 @@ static void rcar_gen3_init_for_host(struct rcar_gen3_chan 
> *ch)
>   rcar_gen3_set_linectrl(ch, 1, 1);
>   rcar_gen3_set_host_mode(ch, 1);
>   rcar_gen3_enable_vbus_ctrl(ch, 1);
> +
> + extcon_set_cable_state_(ch->extcon, EXTCON_USB_HOST, true);
> + extcon_set_cable_state_(ch->extcon, EXTCON_USB, false);
>  }
>  
>  static void rcar_gen3_init_for_peri(struct rcar_gen3_chan *ch)
> @@ -134,6 +139,9 @@ static void rcar_gen3_init_for_peri(struct rcar_gen3_chan 
> *ch)
>   rcar_gen3_set_linectrl(ch, 0, 1);
>   rcar_gen3_set_host_mode(ch, 0);
>   rcar_gen3_enable_vbus_ctrl(ch, 0);
> +
> + extcon_set_cable_state_(ch->extcon, EXTCON_USB_HOST, false);
> + extcon_set_cable_state_(ch->extcon, EXTCON_USB, true);
>  }
>  
>  static bool rcar_gen3_check_vbus(struct rcar_gen3_chan *ch)
> @@ -272,6 +280,12 @@ static const struct of_device_id 
> rcar_gen3_phy_usb2_match_table[] = {
>  };
>  MODULE_DEVICE_TABLE(of, rcar_gen3_phy_usb2_match_table);
>  
> +static const unsigned int rcar_gen3_phy_cable[] = {
> + EXTCON_USB,
> + EXTCON_USB_HOST,
> + EXTCON_NONE,
> +};
> +
>  static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev)
>  {
>   struct device *dev = >dev;
> @@ -297,11 +311,23 @@ static int rcar_gen3_phy_usb2_probe(struct 
> platform_device *pdev)
>   /* call request_irq for OTG */
>   irq = platform_get_irq(pdev, 0);
>   if (irq >= 0) {
> + int ret;
> +
>   irq = devm_request_irq(dev, irq, rcar_gen3_phy_usb2_irq,
>  IRQF_SHARED, dev_name(dev), channel);
>   if (irq < 0)
>   dev_err(dev, "No irq handler (%d)\n", irq);
>   channel->has_otg = true;
> + channel->extcon = devm_extcon_dev_allocate(dev,
> + rcar_gen3_phy_cable);
> + if (IS_ERR(channel->extcon))
> + return PTR_ERR(channel->extcon);
> +
> +     ret = devm_extcon_dev_register(dev, channel->extcon);
> + if (ret < 0) {
> + dev_err(dev, "Failed to register extcon\n");
> + return ret;
> + }
>   }
>  
>   /* devm_phy_create() will call pm_runtime_enable(dev); */
> 

Looks good to me about extcon usgae.

Reviewed-by: Chanwoo Choi <cw00.c...@samsung.com>

Best Regards,
Chanwoo Choi