diff mbox

[RFC,v4,2/7] Revert "extcon: usb-gpio: switch to use pm wakeirq apis"

Message ID 1465393686-16644-3-git-send-email-k.kozlowski@samsung.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Krzysztof Kozlowski June 8, 2016, 1:48 p.m. UTC
This reverts commit 8106e404174253639731cc30a44f5b3ab764c5b7.

When using PM wakeirq API only one wakeup IRQ can be set. However the
driver will support also VBUS GPIO so we need two wakeup interrupts.
---
 drivers/extcon/extcon-usb-gpio.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

Comments

Roger Quadros June 9, 2016, 8 a.m. UTC | #1
-balbi@ti
+balbi@kernel

Hi,

On 08/06/16 16:48, Krzysztof Kozlowski wrote:
> This reverts commit 8106e404174253639731cc30a44f5b3ab764c5b7.

The above commit id is not present in v4.7-rc1 and this patch doesn't apply properly.
Can you please rebase this series on v4.7-rc1?

> 
> When using PM wakeirq API only one wakeup IRQ can be set. However the
> driver will support also VBUS GPIO so we need two wakeup interrupts.
> ---
>  drivers/extcon/extcon-usb-gpio.c | 19 +++++++++++++------
>  1 file changed, 13 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/extcon/extcon-usb-gpio.c b/drivers/extcon/extcon-usb-gpio.c
> index 2512660dc4b9..a36aab007022 100644
> --- a/drivers/extcon/extcon-usb-gpio.c
> +++ b/drivers/extcon/extcon-usb-gpio.c
> @@ -24,7 +24,6 @@
>  #include <linux/module.h>
>  #include <linux/of_gpio.h>
>  #include <linux/platform_device.h>
> -#include <linux/pm_wakeirq.h>
>  #include <linux/slab.h>
>  #include <linux/workqueue.h>
>  #include <linux/acpi.h>
> @@ -143,8 +142,7 @@ static int usb_extcon_probe(struct platform_device *pdev)
>  	}
>  
>  	platform_set_drvdata(pdev, info);
> -	device_init_wakeup(dev, true);
> -	dev_pm_set_wake_irq(dev, info->id_irq);
> +	device_init_wakeup(dev, 1);
>  
>  	/* Perform initial detection */
>  	usb_extcon_detect_cable(&info->wq_detcable.work);
> @@ -158,9 +156,6 @@ static int usb_extcon_remove(struct platform_device *pdev)
>  
>  	cancel_delayed_work_sync(&info->wq_detcable);
>  
> -	dev_pm_clear_wake_irq(&pdev->dev);
> -	device_init_wakeup(&pdev->dev, false);
> -
>  	return 0;
>  }
>  
> @@ -170,6 +165,12 @@ static int usb_extcon_suspend(struct device *dev)
>  	struct usb_extcon_info *info = dev_get_drvdata(dev);
>  	int ret = 0;
>  
> +	if (device_may_wakeup(dev)) {
> +		ret = enable_irq_wake(info->id_irq);
> +		if (ret)
> +			return ret;
> +	}
> +
>  	/*
>  	 * We don't want to process any IRQs after this point
>  	 * as GPIOs used behind I2C subsystem might not be
> @@ -185,6 +186,12 @@ static int usb_extcon_resume(struct device *dev)
>  	struct usb_extcon_info *info = dev_get_drvdata(dev);
>  	int ret = 0;
>  
> +	if (device_may_wakeup(dev)) {
> +		ret = disable_irq_wake(info->id_irq);
> +		if (ret)
> +			return ret;
> +	}
> +
>  	enable_irq(info->id_irq);
>  	if (!device_may_wakeup(dev))
>  		queue_delayed_work(system_power_efficient_wq,
> 

--
cheers,
-roger
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Krzysztof Kozlowski June 9, 2016, 8:10 a.m. UTC | #2
On 06/09/2016 10:00 AM, Roger Quadros wrote:
> -balbi@ti
> +balbi@kernel
> 
> Hi,
> 
> On 08/06/16 16:48, Krzysztof Kozlowski wrote:
>> This reverts commit 8106e404174253639731cc30a44f5b3ab764c5b7.
> 
> The above commit id is not present in v4.7-rc1 and this patch doesn't apply properly.
> Can you please rebase this series on v4.7-rc1?

The commit is present in extcon tree for v4.8. The extcon patches will
be applied (probably) to that tree so what is the point of rebasing on
v4.7-rc1?

Also the point of this particular patch is to show that previous change
should be just dropped. Don't replace things to complicated devm-like
functions just to simplify one path in the driver...

Best regards,
Krzysztof


--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Roger Quadros June 9, 2016, 8:20 a.m. UTC | #3
On 09/06/16 11:10, Krzysztof Kozlowski wrote:
> On 06/09/2016 10:00 AM, Roger Quadros wrote:
>> -balbi@ti
>> +balbi@kernel
>>
>> Hi,
>>
>> On 08/06/16 16:48, Krzysztof Kozlowski wrote:
>>> This reverts commit 8106e404174253639731cc30a44f5b3ab764c5b7.
>>
>> The above commit id is not present in v4.7-rc1 and this patch doesn't apply properly.
>> Can you please rebase this series on v4.7-rc1?
> 
> The commit is present in extcon tree for v4.8. The extcon patches will
> be applied (probably) to that tree so what is the point of rebasing on
> v4.7-rc1?

OK, please ignore my comment. Would be nice if you mention in the cover letter
which tree the series is based on.

> 
> Also the point of this particular patch is to show that previous change
> should be just dropped. Don't replace things to complicated devm-like
> functions just to simplify one path in the driver...
> 

--
cheers,
0roger
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/extcon/extcon-usb-gpio.c b/drivers/extcon/extcon-usb-gpio.c
index 2512660dc4b9..a36aab007022 100644
--- a/drivers/extcon/extcon-usb-gpio.c
+++ b/drivers/extcon/extcon-usb-gpio.c
@@ -24,7 +24,6 @@ 
 #include <linux/module.h>
 #include <linux/of_gpio.h>
 #include <linux/platform_device.h>
-#include <linux/pm_wakeirq.h>
 #include <linux/slab.h>
 #include <linux/workqueue.h>
 #include <linux/acpi.h>
@@ -143,8 +142,7 @@  static int usb_extcon_probe(struct platform_device *pdev)
 	}
 
 	platform_set_drvdata(pdev, info);
-	device_init_wakeup(dev, true);
-	dev_pm_set_wake_irq(dev, info->id_irq);
+	device_init_wakeup(dev, 1);
 
 	/* Perform initial detection */
 	usb_extcon_detect_cable(&info->wq_detcable.work);
@@ -158,9 +156,6 @@  static int usb_extcon_remove(struct platform_device *pdev)
 
 	cancel_delayed_work_sync(&info->wq_detcable);
 
-	dev_pm_clear_wake_irq(&pdev->dev);
-	device_init_wakeup(&pdev->dev, false);
-
 	return 0;
 }
 
@@ -170,6 +165,12 @@  static int usb_extcon_suspend(struct device *dev)
 	struct usb_extcon_info *info = dev_get_drvdata(dev);
 	int ret = 0;
 
+	if (device_may_wakeup(dev)) {
+		ret = enable_irq_wake(info->id_irq);
+		if (ret)
+			return ret;
+	}
+
 	/*
 	 * We don't want to process any IRQs after this point
 	 * as GPIOs used behind I2C subsystem might not be
@@ -185,6 +186,12 @@  static int usb_extcon_resume(struct device *dev)
 	struct usb_extcon_info *info = dev_get_drvdata(dev);
 	int ret = 0;
 
+	if (device_may_wakeup(dev)) {
+		ret = disable_irq_wake(info->id_irq);
+		if (ret)
+			return ret;
+	}
+
 	enable_irq(info->id_irq);
 	if (!device_may_wakeup(dev))
 		queue_delayed_work(system_power_efficient_wq,