linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@ti.com>
To: Chanwoo Choi <cw00.choi@samsung.com>
Cc: <myungjoo.ham@samsung.com>, <tony@atomide.com>, <nm@ti.com>,
	<balbi@ti.com>, <linux-omap@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/2] extcon: palmas: Support GPIO based USB ID detection
Date: Fri, 31 Jul 2015 12:05:02 +0300	[thread overview]
Message-ID: <55BB3A3E.7040606@ti.com> (raw)
In-Reply-To: <55BB27D3.8040209@samsung.com>

Hi Chanwoo,

On 31/07/15 10:46, Chanwoo Choi wrote:
> Hi Roger,
> 
> When I apply it for build test, merge conflict happen.
> So, I recommend that you rebase this patchset on extcon-next branch.

Alright.

> 
> On 07/27/2015 10:10 PM, Roger Quadros wrote:
>> Some palmas based chip variants do not have OTG based ID logic.
>> For these variants we rely on GPIO based USB ID detection.
>>
>> These chips do have VBUS comparator for VBUS detection so we
>> continue to use the old way of detecting VBUS.
>>
>> Signed-off-by: Roger Quadros <rogerq@ti.com>
>> ---
>>  .../devicetree/bindings/extcon/extcon-palmas.txt   |   5 +-
>>  drivers/extcon/extcon-palmas.c                     | 114 ++++++++++++++++++---
>>  include/linux/mfd/palmas.h                         |   6 ++
>>  3 files changed, 109 insertions(+), 16 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/extcon/extcon-palmas.txt b/Documentation/devicetree/bindings/extcon/extcon-palmas.txt
>> index 45414bb..f61d5af 100644
>> --- a/Documentation/devicetree/bindings/extcon/extcon-palmas.txt
>> +++ b/Documentation/devicetree/bindings/extcon/extcon-palmas.txt
>> @@ -10,8 +10,11 @@ Required Properties:
>>  
>>  Optional Properties:
>>   - ti,wakeup : To enable the wakeup comparator in probe
>> - - ti,enable-id-detection: Perform ID detection.
>> + - ti,enable-id-detection: Perform ID detection. If id-gpio is specified
>> +		it performs id-detection using GPIO else using OTG core.
>>   - ti,enable-vbus-detection: Perform VBUS detection.
>> + - id-gpio: gpio for GPIO ID detection. See gpio binding.
>> + - debounce-delay-ms: debounce delay for GPIO ID pin in milliseconds.
>>  
>>  palmas-usb {
>>         compatible = "ti,twl6035-usb", "ti,palmas-usb";
>> diff --git a/drivers/extcon/extcon-palmas.c b/drivers/extcon/extcon-palmas.c
>> index 080d5cc..d0ed764 100644
>> --- a/drivers/extcon/extcon-palmas.c
>> +++ b/drivers/extcon/extcon-palmas.c
>> @@ -28,6 +28,9 @@
>>  #include <linux/mfd/palmas.h>
>>  #include <linux/of.h>
>>  #include <linux/of_platform.h>
>> +#include <linux/of_gpio.h>
>> +
>> +#define USB_GPIO_DEBOUNCE_MS	20	/* ms */
>>  
>>  static const unsigned int palmas_extcon_cable[] = {
>>  	EXTCON_USB,
>> @@ -120,19 +123,52 @@ static irqreturn_t palmas_id_irq_handler(int irq, void *_palmas_usb)
>>  	return IRQ_HANDLED;
>>  }
>>  
>> +static void palmas_gpio_id_detect(struct palmas_usb *palmas_usb)
>> +{
>> +	int id;
>> +
>> +	if (!palmas_usb->id_gpiod)
>> +		return;
>> +
>> +	id = gpiod_get_value_cansleep(palmas_usb->id_gpiod);
>> +
>> +	if (id) {
>> +		extcon_set_cable_state(palmas_usb->edev, "USB-HOST", false);
> 
> Use the extcon_set_cable_state_() because extcon_set_cable_state() with cable name
> is deprecated.

OK.

cheers,
-roger

> 
>> +		dev_info(palmas_usb->dev, "USB-HOST cable is detached\n");
>> +	} else {
>> +		extcon_set_cable_state(palmas_usb->edev, "USB-HOST", true);
> 
> ditto. Use the extcon_set_cable_state_() with extcon id.
> 
> [snip]
> 
> Thanks,
> Chanwoo Choi
> 

  reply	other threads:[~2015-07-31  9:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-27 13:10 [PATCH v2 0/2] extcon: palmas: am57xx-beagle-x15: use palmas for VBUS/ID detection Roger Quadros
2015-07-27 13:10 ` [PATCH v2 1/2] extcon: palmas: Support GPIO based USB ID detection Roger Quadros
2015-07-31  7:46   ` Chanwoo Choi
2015-07-31  9:05     ` Roger Quadros [this message]
2015-07-31 11:08   ` [PATCH v3 " Roger Quadros
2015-07-31 15:34     ` Chanwoo Choi
2015-08-03 14:40     ` [PATCH v4 " Roger Quadros
2015-08-07  8:24       ` Roger Quadros
2015-08-10  2:46         ` Chanwoo Choi
2015-08-10  8:35       ` Lee Jones
2015-07-27 13:10 ` [PATCH v2 2/2] ARM: dts: am57xx-beagle-x15: use palmas-usb for USB2 Roger Quadros
2015-08-05 10:37   ` Tony Lindgren
2015-08-05 23:36     ` Chanwoo Choi
2015-09-03  7:36       ` Roger Quadros
2015-09-15 10:43         ` Roger Quadros
2015-09-17  0:06           ` Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55BB3A3E.7040606@ti.com \
    --to=rogerq@ti.com \
    --cc=balbi@ti.com \
    --cc=cw00.choi@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=nm@ti.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).