[PATCH v5 2/3] extcon: Palmas Extcon Driver

2013-05-24 Thread Kishon Vijay Abraham I
From: Graeme Gregory 

This is the driver for the USB comparator built into the palmas chip. It
handles the various USB OTG events that can be generated by cable
insertion/removal.

Signed-off-by: Graeme Gregory 
Signed-off-by: Moiz Sonasath 
Signed-off-by: Ruchika Kharwar 
Signed-off-by: Kishon Vijay Abraham I 
Signed-off-by: George Cherian 
[kis...@ti.com: adapted palmas usb driver to use the extcon framework]
Signed-off-by: Sebastien Guiriec 
---
Changes from v4:
* removed no_control_vbus property (to be used if the platform wants to use
its own vbus control.
* removed unnecessary headers
* moved the palmas_usb_state to palmas.h
* misc cleanups
*A checkpatch warning "WARNING: static const char * array should
 probably be static const char * const"is ignored since it introduces a
 compilation warning.
Changes from v3:
* adapted the driver to extcon framework (so moved to drivers/extcon)
* removed palmas_usb_(write/read) and replaced all calls with
  palmas_(read/write).
* ignored a checkpatch warning in the line 
static const char *palmas_extcon_cable[] = {
  as it seemed to be incorrect?
* removed all references to OMAP in this driver.
* couldn't test this driver with mainline as omap5 panda is not booting
  with mainline.
* A comment to change to platform_get_irq from regmap is not done as I felt
  the data should come from regmap in this case. Graeme?
Changes from v2:
* Moved the driver to drivers/usb/phy/
* Added a bit more explanation in Kconfig
 .../devicetree/bindings/extcon/extcon-twl.txt  |  16 +
 drivers/extcon/Kconfig |   7 +
 drivers/extcon/Makefile|   1 +
 drivers/extcon/extcon-palmas.c | 341 +
 include/linux/mfd/palmas.h |  25 +-
 5 files changed, 380 insertions(+), 10 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/extcon/extcon-twl.txt
 create mode 100644 drivers/extcon/extcon-palmas.c

diff --git a/Documentation/devicetree/bindings/extcon/extcon-twl.txt 
b/Documentation/devicetree/bindings/extcon/extcon-twl.txt
new file mode 100644
index 000..8ffdeed
--- /dev/null
+++ b/Documentation/devicetree/bindings/extcon/extcon-twl.txt
@@ -0,0 +1,15 @@
+EXTCON FOR TWL CHIPS
+
+PALMAS USB COMPARATOR
+Required Properties:
+ - compatible : Should be "ti,palmas-usb" or "ti,twl6035-usb"
+ - vbus-supply : phandle to the regulator device tree node.
+
+Optional Properties:
+ - ti,wakeup : To enable the wakeup comparator in probe
+
+palmas-usb {
+   compatible = "ti,twl6035-usb", "ti,palmas-usb";
+   vbus-supply = <&smps10_reg>;
+   ti,wakeup;
+};
diff --git a/drivers/extcon/Kconfig b/drivers/extcon/Kconfig
index 3297301..63f454e 100644
--- a/drivers/extcon/Kconfig
+++ b/drivers/extcon/Kconfig
@@ -53,4 +53,11 @@ config EXTCON_ARIZONA
  with Wolfson Arizona devices. These are audio CODECs with
  advanced audio accessory detection support.
 
+config EXTCON_PALMAS
+   tristate "Palmas USB EXTCON support"
+   depends on MFD_PALMAS
+   help
+ Say Y here to enable support for USB peripheral and USB host
+ detection by palmas usb.
+
 endif # MULTISTATE_SWITCH
diff --git a/drivers/extcon/Makefile b/drivers/extcon/Makefile
index f98a3c4..540e2c3 100644
--- a/drivers/extcon/Makefile
+++ b/drivers/extcon/Makefile
@@ -8,3 +8,4 @@ obj-$(CONFIG_EXTCON_ADC_JACK)   += extcon-adc-jack.o
 obj-$(CONFIG_EXTCON_MAX77693)  += extcon-max77693.o
 obj-$(CONFIG_EXTCON_MAX8997)   += extcon-max8997.o
 obj-$(CONFIG_EXTCON_ARIZONA)   += extcon-arizona.o
+obj-$(CONFIG_EXTCON_PALMAS)+= extcon-palmas.o
diff --git a/drivers/extcon/extcon-palmas.c b/drivers/extcon/extcon-palmas.c
new file mode 100644
index 000..9e613e9
--- /dev/null
+++ b/drivers/extcon/extcon-palmas.c
@@ -0,0 +1,341 @@
+/*
+ * Palmas USB transceiver driver
+ *
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Author: Graeme Gregory 
+ * Author: Kishon Vijay Abraham I 
+ *
+ * Based on twl6030_usb.c
+ *
+ * Author: Hema HK 
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static const char *palmas_extcon_cable[] = {
+   [0] = "USB",
+   [1] = "USB-HOST",
+   NULL,
+};
+
+static const int mutually_exclusive[] = {0x3, 0x0};
+
+static void palmas_usb_wakeup(struct palmas *palmas, int enable)
+{
+   if (enable)
+   palmas_write(palmas, PALMAS_USB_OTG_BASE, 

Re: [PATCH v5 2/3] extcon: Palmas Extcon Driver

2013-05-25 Thread Laxman Dewangan

Hi Graeme/Kishon,

On Friday 24 May 2013 08:01 PM, Kishon Vijay Abraham I wrote:

From: Graeme Gregory 

This is the driver for the USB comparator built into the palmas chip. It
handles the various USB OTG events that can be generated by cable
insertion/removal.



I have following feedback on this driver to use this on Tegra platform:
1. Can we have very simple driver for detecting VBUS and ID and just 
generate notification. No VBUS control logic or lots of  USB related 
configurations?
2. We will need the VBUS control as optional if it is require for TI 
platform. Currently it is mandatory and hence it is not suite in our 
context.
3. There is VBUS control (enabled/disable) in VBUS detection also. When 
palma detect the VBUS then why actually it need to enable VBUS as VBUS 
is already supplied by HOST? It may be only need when palma detect the 
ID pin and maybe want to enable VBUS but again VBUS control 
(enable/disable) should be part of USB driver, out of extcon driver.




--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 2/3] extcon: Palmas Extcon Driver

2013-05-26 Thread Chanwoo Choi
Hi Kishon,

I have some comment about this patch
and upload modified patch to following repository (extcon-for-palmas).
- 
http://git.kernel.org/cgit/linux/kernel/git/chanwoo/extcon.git/commit/?h=extcon-for-palmas&id=f2b7cb80699cbe1a5fd6c97ef2c600915f8d7f2c

This patchset include patch related to other module
,so I need your opinion to apply this patchset to git repository.

On 05/24/2013 11:31 PM, Kishon Vijay Abraham I wrote:
> From: Graeme Gregory 
>
> This is the driver for the USB comparator built into the palmas chip. It
> handles the various USB OTG events that can be generated by cable
> insertion/removal.
>
> Signed-off-by: Graeme Gregory 
> Signed-off-by: Moiz Sonasath 
> Signed-off-by: Ruchika Kharwar 
> Signed-off-by: Kishon Vijay Abraham I 
> Signed-off-by: George Cherian 
> [kis...@ti.com: adapted palmas usb driver to use the extcon framework]
> Signed-off-by: Sebastien Guiriec 
> ---
> Changes from v4:
> * removed no_control_vbus property (to be used if the platform wants to use
> its own vbus control.
> * removed unnecessary headers
> * moved the palmas_usb_state to palmas.h
> * misc cleanups
> *A checkpatch warning "WARNING: static const char * array should
>  probably be static const char * const"is ignored since it introduces a
>  compilation warning.
> Changes from v3:
> * adapted the driver to extcon framework (so moved to drivers/extcon)
> * removed palmas_usb_(write/read) and replaced all calls with
>   palmas_(read/write).
> * ignored a checkpatch warning in the line 
>   static const char *palmas_extcon_cable[] = {
>   as it seemed to be incorrect?
> * removed all references to OMAP in this driver.
> * couldn't test this driver with mainline as omap5 panda is not booting
>   with mainline.
> * A comment to change to platform_get_irq from regmap is not done as I felt
>   the data should come from regmap in this case. Graeme?
> Changes from v2:
> * Moved the driver to drivers/usb/phy/
> * Added a bit more explanation in Kconfig
>  .../devicetree/bindings/extcon/extcon-twl.txt  |  16 +
>  drivers/extcon/Kconfig |   7 +
>  drivers/extcon/Makefile|   1 +
>  drivers/extcon/extcon-palmas.c | 341 
> +
>  include/linux/mfd/palmas.h |  25 +-
>  5 files changed, 380 insertions(+), 10 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/extcon/extcon-twl.txt
>  create mode 100644 drivers/extcon/extcon-palmas.c
>
> diff --git a/Documentation/devicetree/bindings/extcon/extcon-twl.txt 
> b/Documentation/devicetree/bindings/extcon/extcon-twl.txt
> new file mode 100644
> index 000..8ffdeed
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/extcon/extcon-twl.txt
> @@ -0,0 +1,15 @@
> +EXTCON FOR TWL CHIPS
> +
> +PALMAS USB COMPARATOR
> +Required Properties:
> + - compatible : Should be "ti,palmas-usb" or "ti,twl6035-usb"
> + - vbus-supply : phandle to the regulator device tree node.
> +
> +Optional Properties:
> + - ti,wakeup : To enable the wakeup comparator in probe
> +
> +palmas-usb {
> +   compatible = "ti,twl6035-usb", "ti,palmas-usb";
> +   vbus-supply = <&smps10_reg>;
> +   ti,wakeup;
> +};
> diff --git a/drivers/extcon/Kconfig b/drivers/extcon/Kconfig
> index 3297301..63f454e 100644
> --- a/drivers/extcon/Kconfig
> +++ b/drivers/extcon/Kconfig
> @@ -53,4 +53,11 @@ config EXTCON_ARIZONA
> with Wolfson Arizona devices. These are audio CODECs with
> advanced audio accessory detection support.
>  
> +config EXTCON_PALMAS
> + tristate "Palmas USB EXTCON support"
> + depends on MFD_PALMAS
You should add REGULATOR_PALMAS dependency because
palmas_set_switch_smps10() is defined in palmas regulator driver.

+depends on MFD_PALMAS && REGULATOR_PALMAS

> + help
> +   Say Y here to enable support for USB peripheral and USB host
> +   detection by palmas usb.
> +
>  endif # MULTISTATE_SWITCH
> diff --git a/drivers/extcon/Makefile b/drivers/extcon/Makefile
> index f98a3c4..540e2c3 100644
> --- a/drivers/extcon/Makefile
> +++ b/drivers/extcon/Makefile
> @@ -8,3 +8,4 @@ obj-$(CONFIG_EXTCON_ADC_JACK) += extcon-adc-jack.o
>  obj-$(CONFIG_EXTCON_MAX77693)+= extcon-max77693.o
>  obj-$(CONFIG_EXTCON_MAX8997) += extcon-max8997.o
>  obj-$(CONFIG_EXTCON_ARIZONA) += extcon-arizona.o
> +obj-$(CONFIG_EXTCON_PALMAS)  += extcon-palmas.o
> diff --git a/drivers/extcon/extcon-palmas.c b/drivers/extcon/extcon-palmas.c
> new file mode 100644
> index 000..9e613e9
> --- /dev/null
> +++ b/drivers/extcon/extcon-palmas.c
> @@ -0,0 +1,341 @@
> +/*
> + * Palmas USB transceiver driver
> + *
> + * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later ver

Re: [PATCH v5 2/3] extcon: Palmas Extcon Driver

2013-05-26 Thread Kishon Vijay Abraham I

Hi,

On Monday 27 May 2013 11:04 AM, Chanwoo Choi wrote:

Hi Kishon,

I have some comment about this patch
and upload modified patch to following repository (extcon-for-palmas).
- 
http://git.kernel.org/cgit/linux/kernel/git/chanwoo/extcon.git/commit/?h=extcon-for-palmas&id=f2b7cb80699cbe1a5fd6c97ef2c600915f8d7f2c

This patchset include patch related to other module
,so I need your opinion to apply this patchset to git repository.


yeah.. Still there is some confusion with palmas_set_switch_smps10(). I 
think we can remove it for now and add it separately later. By this at 
least we can have device mode fully functional in OMAP5. What do you think?


Thanks
Kishon
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 2/3] extcon: Palmas Extcon Driver

2013-05-26 Thread Chanwoo Choi
On 05/27/2013 02:54 PM, Kishon Vijay Abraham I wrote:
> Hi,
>
> On Monday 27 May 2013 11:04 AM, Chanwoo Choi wrote:
>> Hi Kishon,
>>
>> I have some comment about this patch
>> and upload modified patch to following repository (extcon-for-palmas).
>> - 
>> http://git.kernel.org/cgit/linux/kernel/git/chanwoo/extcon.git/commit/?h=extcon-for-palmas&id=f2b7cb80699cbe1a5fd6c97ef2c600915f8d7f2c
>>
>> This patchset include patch related to other module
>> ,so I need your opinion to apply this patchset to git repository.
>
> yeah.. Still there is some confusion with palmas_set_switch_smps10(). I think 
> we can remove it for now and add it separately later. By this at least we can 
> have device mode fully functional in OMAP5. What do you think?
>

 I agree your opinion.

But, I propose some fixes about palmas_set_switch_smps10().
I dont' prefer to call global function in exton-palmas.c from 
palmas-regulator.c.
So, Why don't you use regulator consumer instead of global function?
You can register specific regulator for enabling or disabling SMPS10_SWITCH_EN
and then control SMPS10_SWITCH_EN bit through regulator framework in 
extcon-palmas.c
without calling global function.

Thanks,
Chanwoo Choi

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 2/3] extcon: Palmas Extcon Driver

2013-05-26 Thread Laxman Dewangan

On Monday 27 May 2013 11:38 AM, Chanwoo Choi wrote:

On 05/27/2013 02:54 PM, Kishon Vijay Abraham I wrote:

Hi,

On Monday 27 May 2013 11:04 AM, Chanwoo Choi wrote:

Hi Kishon,

I have some comment about this patch
and upload modified patch to following repository (extcon-for-palmas).
- 
http://git.kernel.org/cgit/linux/kernel/git/chanwoo/extcon.git/commit/?h=extcon-for-palmas&id=f2b7cb80699cbe1a5fd6c97ef2c600915f8d7f2c

This patchset include patch related to other module
,so I need your opinion to apply this patchset to git repository.

yeah.. Still there is some confusion with palmas_set_switch_smps10(). I think 
we can remove it for now and add it separately later. By this at least we can 
have device mode fully functional in OMAP5. What do you think?


  I agree your opinion.

But, I propose some fixes about palmas_set_switch_smps10().
I dont' prefer to call global function in exton-palmas.c from 
palmas-regulator.c.
So, Why don't you use regulator consumer instead of global function?
You can register specific regulator for enabling or disabling SMPS10_SWITCH_EN
and then control SMPS10_SWITCH_EN bit through regulator framework in 
extcon-palmas.c
without calling global function.


Along with this, I also like to make the VBUS regulator control to be 
optional here. Currently it is mandatory.

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 2/3] extcon: Palmas Extcon Driver

2013-05-26 Thread Kishon Vijay Abraham I

Hi,

On Monday 27 May 2013 11:52 AM, Laxman Dewangan wrote:

On Monday 27 May 2013 11:38 AM, Chanwoo Choi wrote:

On 05/27/2013 02:54 PM, Kishon Vijay Abraham I wrote:

Hi,

On Monday 27 May 2013 11:04 AM, Chanwoo Choi wrote:

Hi Kishon,

I have some comment about this patch
and upload modified patch to following repository (extcon-for-palmas).
-
http://git.kernel.org/cgit/linux/kernel/git/chanwoo/extcon.git/commit/?h=extcon-for-palmas&id=f2b7cb80699cbe1a5fd6c97ef2c600915f8d7f2c


This patchset include patch related to other module
,so I need your opinion to apply this patchset to git repository.

yeah.. Still there is some confusion with palmas_set_switch_smps10().
I think we can remove it for now and add it separately later. By this
at least we can have device mode fully functional in OMAP5. What do
you think?


  I agree your opinion.

But, I propose some fixes about palmas_set_switch_smps10().
I dont' prefer to call global function in exton-palmas.c from
palmas-regulator.c.
So, Why don't you use regulator consumer instead of global function?
You can register specific regulator for enabling or disabling
SMPS10_SWITCH_EN
and then control SMPS10_SWITCH_EN bit through regulator framework in
extcon-palmas.c
without calling global function.


Along with this, I also like to make the VBUS regulator control to be
optional here. Currently it is mandatory.


But dint you just tell on my v4 of this patch that you don’t require this.
http://www.spinics.net/lists/linux-doc/msg10638.html

Thanks
Kishon
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 2/3] extcon: Palmas Extcon Driver

2013-05-26 Thread Laxman Dewangan

On Monday 27 May 2013 12:01 PM, Kishon Vijay Abraham I wrote:

Hi,

On Monday 27 May 2013 11:52 AM, Laxman Dewangan wrote:

On Monday 27 May 2013 11:38 AM, Chanwoo Choi wrote:

On 05/27/2013 02:54 PM, Kishon Vijay Abraham I wrote:

Hi,

On Monday 27 May 2013 11:04 AM, Chanwoo Choi wrote:

Hi Kishon,

I have some comment about this patch
and upload modified patch to following repository (extcon-for-palmas).
-
http://git.kernel.org/cgit/linux/kernel/git/chanwoo/extcon.git/commit/?h=extcon-for-palmas&id=f2b7cb80699cbe1a5fd6c97ef2c600915f8d7f2c


This patchset include patch related to other module
,so I need your opinion to apply this patchset to git repository.

yeah.. Still there is some confusion with palmas_set_switch_smps10().
I think we can remove it for now and add it separately later. By this
at least we can have device mode fully functional in OMAP5. What do
you think?


   I agree your opinion.

But, I propose some fixes about palmas_set_switch_smps10().
I dont' prefer to call global function in exton-palmas.c from
palmas-regulator.c.
So, Why don't you use regulator consumer instead of global function?
You can register specific regulator for enabling or disabling
SMPS10_SWITCH_EN
and then control SMPS10_SWITCH_EN bit through regulator framework in
extcon-palmas.c
without calling global function.

Along with this, I also like to make the VBUS regulator control to be
optional here. Currently it is mandatory.

But dint you just tell on my v4 of this patch that you don’t require this.
http://www.spinics.net/lists/linux-doc/msg10638.html


In V4, I said remove this VBUS control and my mean was to remove all 
regulator calls for VBUS enabled/disable.
I saw you just remove the platform data option to have this control and 
made VBUS mandatory.


Probably some gap here.

In tegra platform, we dont need VBUS regualtor control from extcon.


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 2/3] extcon: Palmas Extcon Driver

2013-05-26 Thread Kishon Vijay Abraham I

Hi,

On Monday 27 May 2013 12:06 PM, Laxman Dewangan wrote:

On Monday 27 May 2013 12:01 PM, Kishon Vijay Abraham I wrote:

Hi,

On Monday 27 May 2013 11:52 AM, Laxman Dewangan wrote:

On Monday 27 May 2013 11:38 AM, Chanwoo Choi wrote:

On 05/27/2013 02:54 PM, Kishon Vijay Abraham I wrote:

Hi,

On Monday 27 May 2013 11:04 AM, Chanwoo Choi wrote:

Hi Kishon,

I have some comment about this patch
and upload modified patch to following repository
(extcon-for-palmas).
-
http://git.kernel.org/cgit/linux/kernel/git/chanwoo/extcon.git/commit/?h=extcon-for-palmas&id=f2b7cb80699cbe1a5fd6c97ef2c600915f8d7f2c



This patchset include patch related to other module
,so I need your opinion to apply this patchset to git repository.

yeah.. Still there is some confusion with palmas_set_switch_smps10().
I think we can remove it for now and add it separately later. By this
at least we can have device mode fully functional in OMAP5. What do
you think?


   I agree your opinion.

But, I propose some fixes about palmas_set_switch_smps10().
I dont' prefer to call global function in exton-palmas.c from
palmas-regulator.c.
So, Why don't you use regulator consumer instead of global function?
You can register specific regulator for enabling or disabling
SMPS10_SWITCH_EN
and then control SMPS10_SWITCH_EN bit through regulator framework in
extcon-palmas.c
without calling global function.

Along with this, I also like to make the VBUS regulator control to be
optional here. Currently it is mandatory.

But dint you just tell on my v4 of this patch that you don’t require
this.
http://www.spinics.net/lists/linux-doc/msg10638.html


In V4, I said remove this VBUS control and my mean was to remove all
regulator calls for VBUS enabled/disable.
I saw you just remove the platform data option to have this control and
made VBUS mandatory.

Probably some gap here.


Indeed..
I think then we should stick back to how it was with my v4 or else it 
would break OMAP. The regulator calls can't be moved anywhere else as it 
is specific to PALMAS.


Thanks
Kishon
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 2/3] extcon: Palmas Extcon Driver

2013-05-26 Thread Laxman Dewangan

On Monday 27 May 2013 12:11 PM, Kishon Vijay Abraham I wrote:

Hi,

On Monday 27 May 2013 12:06 PM, Laxman Dewangan wrote:

On Monday 27 May 2013 12:01 PM, Kishon Vijay Abraham I wrote:

Hi,

On Monday 27 May 2013 11:52 AM, Laxman Dewangan wrote:

On Monday 27 May 2013 11:38 AM, Chanwoo Choi wrote:

On 05/27/2013 02:54 PM, Kishon Vijay Abraham I wrote:

Hi,

On Monday 27 May 2013 11:04 AM, Chanwoo Choi wrote:

Hi Kishon,

I have some comment about this patch
and upload modified patch to following repository
(extcon-for-palmas).
-
http://git.kernel.org/cgit/linux/kernel/git/chanwoo/extcon.git/commit/?h=extcon-for-palmas&id=f2b7cb80699cbe1a5fd6c97ef2c600915f8d7f2c



This patchset include patch related to other module
,so I need your opinion to apply this patchset to git repository.

yeah.. Still there is some confusion with palmas_set_switch_smps10().
I think we can remove it for now and add it separately later. By this
at least we can have device mode fully functional in OMAP5. What do
you think?


I agree your opinion.

But, I propose some fixes about palmas_set_switch_smps10().
I dont' prefer to call global function in exton-palmas.c from
palmas-regulator.c.
So, Why don't you use regulator consumer instead of global function?
You can register specific regulator for enabling or disabling
SMPS10_SWITCH_EN
and then control SMPS10_SWITCH_EN bit through regulator framework in
extcon-palmas.c
without calling global function.

Along with this, I also like to make the VBUS regulator control to be
optional here. Currently it is mandatory.

But dint you just tell on my v4 of this patch that you don’t require
this.
http://www.spinics.net/lists/linux-doc/msg10638.html

In V4, I said remove this VBUS control and my mean was to remove all
regulator calls for VBUS enabled/disable.
I saw you just remove the platform data option to have this control and
made VBUS mandatory.

Probably some gap here.

Indeed..
I think then we should stick back to how it was with my v4 or else it
would break OMAP. The regulator calls can't be moved anywhere else as it
is specific to PALMAS.



I was thinking that extcon driver just detect the cable type and notify 
to the client. After cable detection, the next level of configuration 
should be done in the respective client.


On Tegra platform,  for ID pin detection, Tegra SOC is capable of detect 
the ID pin presence or Palma is capable. Depending on the board design, 
how the ID pin routed from USB connector to PMIC or to Tegra, we enable 
corresponding detection logic.
Once the USB driver got notification for ID pin presence (by any means), 
the enabling of VBUS (as the Tegra will work as Host now and need to 
supply VBUS), is done in USB driver.

Not sure about the OMAP here.


So in above context, I really do not want to have the VBUS control on 
extcon driver from Tegra context. If it is require in OMAP context then 
please make it as optional so that we can satisfy for Tegra and Omap 
platform.


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v5 2/3] extcon: Palmas Extcon Driver

2013-05-27 Thread Kishon Vijay Abraham I

Hi,

On Monday 27 May 2013 12:26 PM, Laxman Dewangan wrote:

On Monday 27 May 2013 12:11 PM, Kishon Vijay Abraham I wrote:

Hi,

On Monday 27 May 2013 12:06 PM, Laxman Dewangan wrote:

On Monday 27 May 2013 12:01 PM, Kishon Vijay Abraham I wrote:

Hi,

On Monday 27 May 2013 11:52 AM, Laxman Dewangan wrote:

On Monday 27 May 2013 11:38 AM, Chanwoo Choi wrote:

On 05/27/2013 02:54 PM, Kishon Vijay Abraham I wrote:

Hi,

On Monday 27 May 2013 11:04 AM, Chanwoo Choi wrote:

Hi Kishon,

I have some comment about this patch
and upload modified patch to following repository
(extcon-for-palmas).
-
http://git.kernel.org/cgit/linux/kernel/git/chanwoo/extcon.git/commit/?h=extcon-for-palmas&id=f2b7cb80699cbe1a5fd6c97ef2c600915f8d7f2c




This patchset include patch related to other module
,so I need your opinion to apply this patchset to git repository.

yeah.. Still there is some confusion with
palmas_set_switch_smps10().
I think we can remove it for now and add it separately later. By
this
at least we can have device mode fully functional in OMAP5. What do
you think?


I agree your opinion.

But, I propose some fixes about palmas_set_switch_smps10().
I dont' prefer to call global function in exton-palmas.c from
palmas-regulator.c.
So, Why don't you use regulator consumer instead of global function?
You can register specific regulator for enabling or disabling
SMPS10_SWITCH_EN
and then control SMPS10_SWITCH_EN bit through regulator framework in
extcon-palmas.c
without calling global function.

Along with this, I also like to make the VBUS regulator control to be
optional here. Currently it is mandatory.

But dint you just tell on my v4 of this patch that you don’t require
this.
http://www.spinics.net/lists/linux-doc/msg10638.html

In V4, I said remove this VBUS control and my mean was to remove all
regulator calls for VBUS enabled/disable.
I saw you just remove the platform data option to have this control and
made VBUS mandatory.

Probably some gap here.

Indeed..
I think then we should stick back to how it was with my v4 or else it
would break OMAP. The regulator calls can't be moved anywhere else as it
is specific to PALMAS.



I was thinking that extcon driver just detect the cable type and notify
to the client. After cable detection, the next level of configuration
should be done in the respective client.

On Tegra platform,  for ID pin detection, Tegra SOC is capable of detect
the ID pin presence or Palma is capable. Depending on the board design,
how the ID pin routed from USB connector to PMIC or to Tegra, we enable
corresponding detection logic.
Once the USB driver got notification for ID pin presence (by any means),
the enabling of VBUS (as the Tegra will work as Host now and need to
supply VBUS), is done in USB driver.
Not sure about the OMAP here.


I think I got your point here. Will check and send a patch.

Thanks
Kishon
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html