public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] extcon: palmas: Dont set USB state if ID pin is grounded
@ 2013-09-10  7:49 George Cherian
  2013-09-10  8:24 ` Kishon Vijay Abraham I
  2013-09-10  9:17 ` Laxman Dewangan
  0 siblings, 2 replies; 7+ messages in thread
From: George Cherian @ 2013-09-10  7:49 UTC (permalink / raw)
  To: linux-kernel; +Cc: myungjoo.ham, cw00.choi, kishon, ldewangan, George Cherian

In OMAP5 when USB-HOST is set true, the VBUS regulator  is turned ON.
This causes a VBUS interrupt, ignore the same if we are already in
USB-HOST.

Signed-off-by: George Cherian <george.cherian@ti.com>
---
 drivers/extcon/extcon-palmas.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/extcon/extcon-palmas.c b/drivers/extcon/extcon-palmas.c
index 9672f31..91b31af 100644
--- a/drivers/extcon/extcon-palmas.c
+++ b/drivers/extcon/extcon-palmas.c
@@ -50,6 +50,9 @@ static irqreturn_t palmas_vbus_irq_handler(int irq, void *_palmas_usb)
 	struct palmas_usb *palmas_usb = _palmas_usb;
 	unsigned int vbus_line_state;
 
+	if (palmas_usb->linkstat == PALMAS_USB_STATE_ID)
+		return IRQ_HANDLED;
+
 	palmas_read(palmas_usb->palmas, PALMAS_INTERRUPT_BASE,
 		PALMAS_INT3_LINE_STATE, &vbus_line_state);
 
-- 
1.8.1.4


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

* Re: [PATCH] extcon: palmas: Dont set USB state if ID pin is grounded
  2013-09-10  7:49 [PATCH] extcon: palmas: Dont set USB state if ID pin is grounded George Cherian
@ 2013-09-10  8:24 ` Kishon Vijay Abraham I
  2013-09-10  8:31   ` George Cherian
  2013-09-10  9:17 ` Laxman Dewangan
  1 sibling, 1 reply; 7+ messages in thread
From: Kishon Vijay Abraham I @ 2013-09-10  8:24 UTC (permalink / raw)
  To: George Cherian; +Cc: linux-kernel, myungjoo.ham, cw00.choi, ldewangan

Hi,

On Tuesday 10 September 2013 01:19 PM, George Cherian wrote:
> In OMAP5 when USB-HOST is set true, the VBUS regulator  is turned ON.
> This causes a VBUS interrupt, ignore the same if we are already in
> USB-HOST.

You'll get VBUS interrupt when detaching USB-HOST cable also no? (because you
do a regulator disable to SMPS10).

Thanks
Kishon

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

* Re: [PATCH] extcon: palmas: Dont set USB state if ID pin is grounded
  2013-09-10  8:24 ` Kishon Vijay Abraham I
@ 2013-09-10  8:31   ` George Cherian
  2013-09-10  8:33     ` Kishon Vijay Abraham I
  0 siblings, 1 reply; 7+ messages in thread
From: George Cherian @ 2013-09-10  8:31 UTC (permalink / raw)
  To: Kishon Vijay Abraham I; +Cc: linux-kernel, myungjoo.ham, cw00.choi, ldewangan

On 9/10/2013 1:54 PM, Kishon Vijay Abraham I wrote:
> Hi,
>
> On Tuesday 10 September 2013 01:19 PM, George Cherian wrote:
>> In OMAP5 when USB-HOST is set true, the VBUS regulator  is turned ON.
>> This causes a VBUS interrupt, ignore the same if we are already in
>> USB-HOST.
> You'll get VBUS interrupt when detaching USB-HOST cable also no? (because you
> do a regulator disable to SMPS10).
Yes since we are ignoring the previous interrupt(for attach), the detach 
is accounted as a spurious one.
If we dont igonre the attach then the USB is set to true, which is wrong.
>
> Thanks
> Kishon


-- 
-George


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

* Re: [PATCH] extcon: palmas: Dont set USB state if ID pin is grounded
  2013-09-10  8:31   ` George Cherian
@ 2013-09-10  8:33     ` Kishon Vijay Abraham I
  0 siblings, 0 replies; 7+ messages in thread
From: Kishon Vijay Abraham I @ 2013-09-10  8:33 UTC (permalink / raw)
  To: George Cherian; +Cc: linux-kernel, myungjoo.ham, cw00.choi, ldewangan

On Tuesday 10 September 2013 02:01 PM, George Cherian wrote:
> On 9/10/2013 1:54 PM, Kishon Vijay Abraham I wrote:
>> Hi,
>>
>> On Tuesday 10 September 2013 01:19 PM, George Cherian wrote:
>>> In OMAP5 when USB-HOST is set true, the VBUS regulator  is turned ON.
>>> This causes a VBUS interrupt, ignore the same if we are already in
>>> USB-HOST.
>> You'll get VBUS interrupt when detaching USB-HOST cable also no? (because you
>> do a regulator disable to SMPS10).
> Yes since we are ignoring the previous interrupt(for attach), the detach is
> accounted as a spurious one.
> If we dont igonre the attach then the USB is set to true, which is wrong.

Alright, thanks.

-Kishon

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

* Re: [PATCH] extcon: palmas: Dont set USB state if ID pin is grounded
  2013-09-10  7:49 [PATCH] extcon: palmas: Dont set USB state if ID pin is grounded George Cherian
  2013-09-10  8:24 ` Kishon Vijay Abraham I
@ 2013-09-10  9:17 ` Laxman Dewangan
  2013-09-10 11:57   ` George Cherian
  1 sibling, 1 reply; 7+ messages in thread
From: Laxman Dewangan @ 2013-09-10  9:17 UTC (permalink / raw)
  To: George Cherian
  Cc: linux-kernel@vger.kernel.org, myungjoo.ham@samsung.com,
	cw00.choi@samsung.com, kishon@ti.com

On Tuesday 10 September 2013 01:19 PM, George Cherian wrote:
> In OMAP5 when USB-HOST is set true, the VBUS regulator  is turned ON.
> This causes a VBUS interrupt, ignore the same if we are already in
> USB-HOST.
>
> Signed-off-by: George Cherian <george.cherian@ti.com>
> ---
>   drivers/extcon/extcon-palmas.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/drivers/extcon/extcon-palmas.c b/drivers/extcon/extcon-palmas.c
> index 9672f31..91b31af 100644
> --- a/drivers/extcon/extcon-palmas.c
> +++ b/drivers/extcon/extcon-palmas.c
> @@ -50,6 +50,9 @@ static irqreturn_t palmas_vbus_irq_handler(int irq, void *_palmas_usb)
>   	struct palmas_usb *palmas_usb = _palmas_usb;
>   	unsigned int vbus_line_state;
>   
> +	if (palmas_usb->linkstat == PALMAS_USB_STATE_ID)
> +		return IRQ_HANDLED;
> +

Should we really handle this on this extcon driver? I think it should be 
handled in the USB driver. If port is OTG type and if usb driver enable 
the VBUS then it can expect the VBUS available notification but based on 
the USB driver state, it should ignore this notification.

Otherwise, Palmas pin find that there is VBUS state true but the SW 
status will show as the VBUS not there.


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

* Re: [PATCH] extcon: palmas: Dont set USB state if ID pin is grounded
  2013-09-10  9:17 ` Laxman Dewangan
@ 2013-09-10 11:57   ` George Cherian
  2013-09-10 12:25     ` Laxman Dewangan
  0 siblings, 1 reply; 7+ messages in thread
From: George Cherian @ 2013-09-10 11:57 UTC (permalink / raw)
  To: Laxman Dewangan
  Cc: linux-kernel@vger.kernel.org, myungjoo.ham@samsung.com,
	cw00.choi@samsung.com, kishon@ti.com

On 9/10/2013 2:47 PM, Laxman Dewangan wrote:
> On Tuesday 10 September 2013 01:19 PM, George Cherian wrote:
>> In OMAP5 when USB-HOST is set true, the VBUS regulator  is turned ON.
>> This causes a VBUS interrupt, ignore the same if we are already in
>> USB-HOST.
>>
>> Signed-off-by: George Cherian <george.cherian@ti.com>
>> ---
>>   drivers/extcon/extcon-palmas.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/extcon/extcon-palmas.c 
>> b/drivers/extcon/extcon-palmas.c
>> index 9672f31..91b31af 100644
>> --- a/drivers/extcon/extcon-palmas.c
>> +++ b/drivers/extcon/extcon-palmas.c
>> @@ -50,6 +50,9 @@ static irqreturn_t palmas_vbus_irq_handler(int irq, 
>> void *_palmas_usb)
>>       struct palmas_usb *palmas_usb = _palmas_usb;
>>       unsigned int vbus_line_state;
>>   +    if (palmas_usb->linkstat == PALMAS_USB_STATE_ID)
>> +        return IRQ_HANDLED;
>> +
>
> Should we really handle this on this extcon driver? I think it should 
> be handled in the USB driver. If port is OTG type and if usb driver 
> enable the VBUS then it can expect the VBUS available notification but 
> based on the USB driver state, it should ignore this notification.
>
Correct extcon should just notify and the consumer should take 
appropriate decision.
> Otherwise, Palmas pin find that there is VBUS state true but the SW 
> status will show as the VBUS not there.
>


-- 
-George


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

* Re: [PATCH] extcon: palmas: Dont set USB state if ID pin is grounded
  2013-09-10 11:57   ` George Cherian
@ 2013-09-10 12:25     ` Laxman Dewangan
  0 siblings, 0 replies; 7+ messages in thread
From: Laxman Dewangan @ 2013-09-10 12:25 UTC (permalink / raw)
  To: George Cherian
  Cc: linux-kernel@vger.kernel.org, myungjoo.ham@samsung.com,
	cw00.choi@samsung.com, kishon@ti.com

On Tuesday 10 September 2013 05:27 PM, George Cherian wrote:
> On 9/10/2013 2:47 PM, Laxman Dewangan wrote:
>> On Tuesday 10 September 2013 01:19 PM, George Cherian wrote:
>>> In OMAP5 when USB-HOST is set true, the VBUS regulator  is turned ON.
>>> This causes a VBUS interrupt, ignore the same if we are already in
>>> USB-HOST.
>>>
>>> Signed-off-by: George Cherian <george.cherian@ti.com>
>>> ---
>>>    drivers/extcon/extcon-palmas.c | 3 +++
>>>    1 file changed, 3 insertions(+)
>>>
>>> diff --git a/drivers/extcon/extcon-palmas.c
>>> b/drivers/extcon/extcon-palmas.c
>>> index 9672f31..91b31af 100644
>>> --- a/drivers/extcon/extcon-palmas.c
>>> +++ b/drivers/extcon/extcon-palmas.c
>>> @@ -50,6 +50,9 @@ static irqreturn_t palmas_vbus_irq_handler(int irq,
>>> void *_palmas_usb)
>>>        struct palmas_usb *palmas_usb = _palmas_usb;
>>>        unsigned int vbus_line_state;
>>>    +    if (palmas_usb->linkstat == PALMAS_USB_STATE_ID)
>>> +        return IRQ_HANDLED;
>>> +
>> Should we really handle this on this extcon driver? I think it should
>> be handled in the USB driver. If port is OTG type and if usb driver
>> enable the VBUS then it can expect the VBUS available notification but
>> based on the USB driver state, it should ignore this notification.
>>
> Correct extcon should just notify and the consumer should take
> appropriate decision.

Thanks, so our code design is same as yours and so we will not need this 
patch.


>> Otherwise, Palmas pin find that there is VBUS state true but the SW
>> status will show as the VBUS not there.
>>
>


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

end of thread, other threads:[~2013-09-10 12:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-10  7:49 [PATCH] extcon: palmas: Dont set USB state if ID pin is grounded George Cherian
2013-09-10  8:24 ` Kishon Vijay Abraham I
2013-09-10  8:31   ` George Cherian
2013-09-10  8:33     ` Kishon Vijay Abraham I
2013-09-10  9:17 ` Laxman Dewangan
2013-09-10 11:57   ` George Cherian
2013-09-10 12:25     ` Laxman Dewangan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox