All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] davinci: DA850 EVM: OHCI platform code
@ 2011-12-20  6:36 ` Manjunathappa, Prakash
  0 siblings, 0 replies; 12+ messages in thread
From: Manjunathappa, Prakash @ 2011-12-20  6:36 UTC (permalink / raw)
  To: davinci-linux-open-source
  Cc: nsekhar, linux-kernel, linux-arm-kernel, linux, Ajay Kumar Gupta

From: Ajay Kumar Gupta <ajay.gupta@ti.com>

On this board the OHCI port's power control and over-current signals from
TPS2065 power switch are connected via GPIO1[15] and GPIO2[1] respectively,
so we can implement the DA8xx OHCI glue layer's hooks for overriding the
root hub port's power and over-current status bits.

We also have to properly set up the clocking mode in the CFGCHIP2 register,
so that internal 24 MHz reference clock is fed to the USB 2.0 (MUSB) PHY and
its output is used to clock the USB 1.1 (OHCI) PHY...

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
---
 arch/arm/mach-davinci/board-da850-evm.c |  126 +++++++++++++++++++++++++++++++
 1 files changed, 126 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 6659a90..df74ba5 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -22,6 +22,7 @@
 #include <linux/gpio.h>
 #include <linux/gpio_keys.h>
 #include <linux/platform_device.h>
+#include <linux/interrupt.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
@@ -42,6 +43,7 @@
 #include <mach/nand.h>
 #include <mach/mux.h>
 #include <mach/aemif.h>
+#include <mach/usb.h>
 #include <mach/spi.h>
 
 #define DA850_EVM_PHY_ID		"0:00"
@@ -734,6 +736,127 @@ static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = {
 	.bus_delay	= 0,	/* usec */
 };
 
+/*
+ * USB1 VBUS is controlled by GPIO2[4], over-current is reported on GPIO6[13].
+ */
+#define ON_BD_USB_DRV	GPIO_TO_PIN(2, 4)
+#define ON_BD_USB_OVC	GPIO_TO_PIN(6, 13)
+
+static const short da850_evm_usb11_pins[] = {
+	DA850_GPIO2_4, DA850_GPIO6_13,
+	-1
+};
+
+static da8xx_ocic_handler_t da850_evm_usb_ocic_handler;
+
+static int da850_evm_usb_set_power(unsigned port, int on)
+{
+	gpio_set_value(ON_BD_USB_DRV, on);
+	return 0;
+}
+
+static int da850_evm_usb_get_power(unsigned port)
+{
+	return gpio_get_value(ON_BD_USB_DRV);
+}
+
+static int da850_evm_usb_get_oci(unsigned port)
+{
+	return !gpio_get_value(ON_BD_USB_OVC);
+}
+
+static irqreturn_t da850_evm_usb_ocic_irq(int, void *);
+
+static int da850_evm_usb_ocic_notify(da8xx_ocic_handler_t handler)
+{
+	int irq		= gpio_to_irq(ON_BD_USB_OVC);
+	int error	= 0;
+
+	if (handler != NULL) {
+		da850_evm_usb_ocic_handler = handler;
+
+		error = request_irq(irq, da850_evm_usb_ocic_irq, IRQF_DISABLED |
+				    IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
+				    "OHCI over-current indicator", NULL);
+		if (error)
+			printk(KERN_ERR "%s: could not request IRQ to watch "
+			       "over-current indicator changes\n", __func__);
+	} else
+		free_irq(irq, NULL);
+
+	return error;
+}
+
+static struct da8xx_ohci_root_hub da850_evm_usb11_pdata = {
+	.set_power	= da850_evm_usb_set_power,
+	.get_power	= da850_evm_usb_get_power,
+	.get_oci	= da850_evm_usb_get_oci,
+	.ocic_notify	= da850_evm_usb_ocic_notify,
+
+	/* TPS2065 switch @ 5V */
+	.potpgt		= (3 + 1) / 2,	/* 3 ms max */
+};
+
+static irqreturn_t da850_evm_usb_ocic_irq(int irq, void *dev_id)
+{
+	da850_evm_usb_ocic_handler(&da850_evm_usb11_pdata, 1);
+	return IRQ_HANDLED;
+}
+
+static __init void da850_evm_usb_init(void)
+{
+	u32 cfgchip2;
+	int ret;
+
+	/*
+	 * Set up USB clock/mode in the CFGCHIP2 register.
+	 * FYI:  CFGCHIP2 is 0x0000ef00 initially.
+	 */
+	cfgchip2 = __raw_readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP2_REG));
+
+	/* USB2.0 PHY reference clock is 24 MHz */
+	cfgchip2 &= ~CFGCHIP2_REFFREQ;
+	cfgchip2 |=  CFGCHIP2_REFFREQ_24MHZ;
+
+	/*
+	 * Select internal reference clock for USB 2.0 PHY
+	 * and use it as a clock source for USB 1.1 PHY
+	 * (this is the default setting anyway).
+	 */
+	cfgchip2 &= ~CFGCHIP2_USB1PHYCLKMUX;
+	cfgchip2 |=  CFGCHIP2_USB2PHYCLKMUX;
+
+	__raw_writel(cfgchip2, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP2_REG));
+
+	ret = davinci_cfg_reg_list(da850_evm_usb11_pins);
+	if (ret) {
+		pr_warning("%s: USB 1.1 PinMux setup failed: %d\n",
+			   __func__, ret);
+		return;
+	}
+
+	ret = gpio_request(ON_BD_USB_DRV, "ON_BD_USB_DRV");
+	if (ret) {
+		printk(KERN_ERR "%s: failed to request GPIO for USB 1.1 port "
+		       "power control: %d\n", __func__, ret);
+		return;
+	}
+	gpio_direction_output(ON_BD_USB_DRV, 0);
+
+	ret = gpio_request(ON_BD_USB_OVC, "ON_BD_USB_OVC");
+	if (ret) {
+		printk(KERN_ERR "%s: failed to request GPIO for USB 1.1 port "
+		       "over-current indicator: %d\n", __func__, ret);
+		return;
+	}
+	gpio_direction_input(ON_BD_USB_OVC);
+
+	ret = da8xx_register_usb11(&da850_evm_usb11_pdata);
+	if (ret)
+		pr_warning("%s: USB 1.1 registration failed: %d\n",
+			   __func__, ret);
+}
+
 static struct davinci_uart_config da850_evm_uart_config __initdata = {
 	.enabled_uarts = 0x7,
 };
@@ -1386,6 +1509,9 @@ static __init void da850_evm_init(void)
 				ret);
 
 	da850_evm_setup_mac_addr();
+
+	/* initilaize usb module */
+	da850_evm_usb_init();
 }
 
 #ifdef CONFIG_SERIAL_8250_CONSOLE
-- 
1.7.1


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

* [PATCH] davinci: DA850 EVM: OHCI platform code
@ 2011-12-20  6:36 ` Manjunathappa, Prakash
  0 siblings, 0 replies; 12+ messages in thread
From: Manjunathappa, Prakash @ 2011-12-20  6:36 UTC (permalink / raw)
  To: linux-arm-kernel

From: Ajay Kumar Gupta <ajay.gupta@ti.com>

On this board the OHCI port's power control and over-current signals from
TPS2065 power switch are connected via GPIO1[15] and GPIO2[1] respectively,
so we can implement the DA8xx OHCI glue layer's hooks for overriding the
root hub port's power and over-current status bits.

We also have to properly set up the clocking mode in the CFGCHIP2 register,
so that internal 24 MHz reference clock is fed to the USB 2.0 (MUSB) PHY and
its output is used to clock the USB 1.1 (OHCI) PHY...

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
---
 arch/arm/mach-davinci/board-da850-evm.c |  126 +++++++++++++++++++++++++++++++
 1 files changed, 126 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 6659a90..df74ba5 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -22,6 +22,7 @@
 #include <linux/gpio.h>
 #include <linux/gpio_keys.h>
 #include <linux/platform_device.h>
+#include <linux/interrupt.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
@@ -42,6 +43,7 @@
 #include <mach/nand.h>
 #include <mach/mux.h>
 #include <mach/aemif.h>
+#include <mach/usb.h>
 #include <mach/spi.h>
 
 #define DA850_EVM_PHY_ID		"0:00"
@@ -734,6 +736,127 @@ static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = {
 	.bus_delay	= 0,	/* usec */
 };
 
+/*
+ * USB1 VBUS is controlled by GPIO2[4], over-current is reported on GPIO6[13].
+ */
+#define ON_BD_USB_DRV	GPIO_TO_PIN(2, 4)
+#define ON_BD_USB_OVC	GPIO_TO_PIN(6, 13)
+
+static const short da850_evm_usb11_pins[] = {
+	DA850_GPIO2_4, DA850_GPIO6_13,
+	-1
+};
+
+static da8xx_ocic_handler_t da850_evm_usb_ocic_handler;
+
+static int da850_evm_usb_set_power(unsigned port, int on)
+{
+	gpio_set_value(ON_BD_USB_DRV, on);
+	return 0;
+}
+
+static int da850_evm_usb_get_power(unsigned port)
+{
+	return gpio_get_value(ON_BD_USB_DRV);
+}
+
+static int da850_evm_usb_get_oci(unsigned port)
+{
+	return !gpio_get_value(ON_BD_USB_OVC);
+}
+
+static irqreturn_t da850_evm_usb_ocic_irq(int, void *);
+
+static int da850_evm_usb_ocic_notify(da8xx_ocic_handler_t handler)
+{
+	int irq		= gpio_to_irq(ON_BD_USB_OVC);
+	int error	= 0;
+
+	if (handler != NULL) {
+		da850_evm_usb_ocic_handler = handler;
+
+		error = request_irq(irq, da850_evm_usb_ocic_irq, IRQF_DISABLED |
+				    IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
+				    "OHCI over-current indicator", NULL);
+		if (error)
+			printk(KERN_ERR "%s: could not request IRQ to watch "
+			       "over-current indicator changes\n", __func__);
+	} else
+		free_irq(irq, NULL);
+
+	return error;
+}
+
+static struct da8xx_ohci_root_hub da850_evm_usb11_pdata = {
+	.set_power	= da850_evm_usb_set_power,
+	.get_power	= da850_evm_usb_get_power,
+	.get_oci	= da850_evm_usb_get_oci,
+	.ocic_notify	= da850_evm_usb_ocic_notify,
+
+	/* TPS2065 switch @ 5V */
+	.potpgt		= (3 + 1) / 2,	/* 3 ms max */
+};
+
+static irqreturn_t da850_evm_usb_ocic_irq(int irq, void *dev_id)
+{
+	da850_evm_usb_ocic_handler(&da850_evm_usb11_pdata, 1);
+	return IRQ_HANDLED;
+}
+
+static __init void da850_evm_usb_init(void)
+{
+	u32 cfgchip2;
+	int ret;
+
+	/*
+	 * Set up USB clock/mode in the CFGCHIP2 register.
+	 * FYI:  CFGCHIP2 is 0x0000ef00 initially.
+	 */
+	cfgchip2 = __raw_readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP2_REG));
+
+	/* USB2.0 PHY reference clock is 24 MHz */
+	cfgchip2 &= ~CFGCHIP2_REFFREQ;
+	cfgchip2 |=  CFGCHIP2_REFFREQ_24MHZ;
+
+	/*
+	 * Select internal reference clock for USB 2.0 PHY
+	 * and use it as a clock source for USB 1.1 PHY
+	 * (this is the default setting anyway).
+	 */
+	cfgchip2 &= ~CFGCHIP2_USB1PHYCLKMUX;
+	cfgchip2 |=  CFGCHIP2_USB2PHYCLKMUX;
+
+	__raw_writel(cfgchip2, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP2_REG));
+
+	ret = davinci_cfg_reg_list(da850_evm_usb11_pins);
+	if (ret) {
+		pr_warning("%s: USB 1.1 PinMux setup failed: %d\n",
+			   __func__, ret);
+		return;
+	}
+
+	ret = gpio_request(ON_BD_USB_DRV, "ON_BD_USB_DRV");
+	if (ret) {
+		printk(KERN_ERR "%s: failed to request GPIO for USB 1.1 port "
+		       "power control: %d\n", __func__, ret);
+		return;
+	}
+	gpio_direction_output(ON_BD_USB_DRV, 0);
+
+	ret = gpio_request(ON_BD_USB_OVC, "ON_BD_USB_OVC");
+	if (ret) {
+		printk(KERN_ERR "%s: failed to request GPIO for USB 1.1 port "
+		       "over-current indicator: %d\n", __func__, ret);
+		return;
+	}
+	gpio_direction_input(ON_BD_USB_OVC);
+
+	ret = da8xx_register_usb11(&da850_evm_usb11_pdata);
+	if (ret)
+		pr_warning("%s: USB 1.1 registration failed: %d\n",
+			   __func__, ret);
+}
+
 static struct davinci_uart_config da850_evm_uart_config __initdata = {
 	.enabled_uarts = 0x7,
 };
@@ -1386,6 +1509,9 @@ static __init void da850_evm_init(void)
 				ret);
 
 	da850_evm_setup_mac_addr();
+
+	/* initilaize usb module */
+	da850_evm_usb_init();
 }
 
 #ifdef CONFIG_SERIAL_8250_CONSOLE
-- 
1.7.1

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

* Re: [PATCH] davinci: DA850 EVM: OHCI platform code
  2011-12-20  6:36 ` Manjunathappa, Prakash
@ 2011-12-20 11:07   ` Sergei Shtylyov
  -1 siblings, 0 replies; 12+ messages in thread
From: Sergei Shtylyov @ 2011-12-20 11:07 UTC (permalink / raw)
  To: Manjunathappa, Prakash, ajay.gupta
  Cc: davinci-linux-open-source, linux, linux-kernel, linux-arm-kernel

Hello.

On 20.12.2011 10:36, Manjunathappa, Prakash wrote:

> From: Ajay Kumar Gupta <ajay.gupta@ti.com>

    It's a good practice to CC the original author of the patch -- which I'm 
doing now...

> On this board the OHCI port's power control and over-current signals from
> TPS2065 power switch are connected via GPIO1[15] and GPIO2[1] respectively,

    Ajay, your description seems to be copied unchganged from the analogous 
DA830 EVM patch, and thus doesn't match your patch: GPIO2[4] and GPIO6[13] are 
used apparently. Be more attentive to detail next time please.

> so we can implement the DA8xx OHCI glue layer's hooks for overriding the
> root hub port's power and over-current status bits.

> We also have to properly set up the clocking mode in the CFGCHIP2 register,
> so that internal 24 MHz reference clock is fed to the USB 2.0 (MUSB) PHY and
> its output is used to clock the USB 1.1 (OHCI) PHY...

> Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
> ---
>   arch/arm/mach-davinci/board-da850-evm.c |  126 +++++++++++++++++++++++++++++++
>   1 files changed, 126 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
> index 6659a90..df74ba5 100644
> --- a/arch/arm/mach-davinci/board-da850-evm.c
> +++ b/arch/arm/mach-davinci/board-da850-evm.c
[...]
> @@ -734,6 +736,127 @@ static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = {
[...]
> +static int da850_evm_usb_ocic_notify(da8xx_ocic_handler_t handler)
> +{
> +	int irq		= gpio_to_irq(ON_BD_USB_OVC);
> +	int error	= 0;
> +
> +	if (handler != NULL) {
> +		da850_evm_usb_ocic_handler = handler;
> +
> +		error = request_irq(irq, da850_evm_usb_ocic_irq, IRQF_DISABLED |

    IRQF_DISABLED is a nop now -- just remove it.

WBR, Sergei

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

* [PATCH] davinci: DA850 EVM: OHCI platform code
@ 2011-12-20 11:07   ` Sergei Shtylyov
  0 siblings, 0 replies; 12+ messages in thread
From: Sergei Shtylyov @ 2011-12-20 11:07 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 20.12.2011 10:36, Manjunathappa, Prakash wrote:

> From: Ajay Kumar Gupta <ajay.gupta@ti.com>

    It's a good practice to CC the original author of the patch -- which I'm 
doing now...

> On this board the OHCI port's power control and over-current signals from
> TPS2065 power switch are connected via GPIO1[15] and GPIO2[1] respectively,

    Ajay, your description seems to be copied unchganged from the analogous 
DA830 EVM patch, and thus doesn't match your patch: GPIO2[4] and GPIO6[13] are 
used apparently. Be more attentive to detail next time please.

> so we can implement the DA8xx OHCI glue layer's hooks for overriding the
> root hub port's power and over-current status bits.

> We also have to properly set up the clocking mode in the CFGCHIP2 register,
> so that internal 24 MHz reference clock is fed to the USB 2.0 (MUSB) PHY and
> its output is used to clock the USB 1.1 (OHCI) PHY...

> Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
> ---
>   arch/arm/mach-davinci/board-da850-evm.c |  126 +++++++++++++++++++++++++++++++
>   1 files changed, 126 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
> index 6659a90..df74ba5 100644
> --- a/arch/arm/mach-davinci/board-da850-evm.c
> +++ b/arch/arm/mach-davinci/board-da850-evm.c
[...]
> @@ -734,6 +736,127 @@ static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = {
[...]
> +static int da850_evm_usb_ocic_notify(da8xx_ocic_handler_t handler)
> +{
> +	int irq		= gpio_to_irq(ON_BD_USB_OVC);
> +	int error	= 0;
> +
> +	if (handler != NULL) {
> +		da850_evm_usb_ocic_handler = handler;
> +
> +		error = request_irq(irq, da850_evm_usb_ocic_irq, IRQF_DISABLED |

    IRQF_DISABLED is a nop now -- just remove it.

WBR, Sergei

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

* Re: [PATCH] davinci: DA850 EVM: OHCI platform code
  2011-12-20  6:36 ` Manjunathappa, Prakash
@ 2011-12-20 11:17   ` Sergei Shtylyov
  -1 siblings, 0 replies; 12+ messages in thread
From: Sergei Shtylyov @ 2011-12-20 11:17 UTC (permalink / raw)
  To: Manjunathappa, Prakash, ajay.gupta
  Cc: davinci-linux-open-source, linux, linux-kernel, linux-arm-kernel

Hello.

On 20-12-2011 10:36, Manjunathappa, Prakash wrote:

> From: Ajay Kumar Gupta<ajay.gupta@ti.com>

> On this board the OHCI port's power control and over-current signals from
> TPS2065 power switch are connected via GPIO1[15] and GPIO2[1] respectively,
> so we can implement the DA8xx OHCI glue layer's hooks for overriding the
> root hub port's power and over-current status bits.

> We also have to properly set up the clocking mode in the CFGCHIP2 register,
> so that internal 24 MHz reference clock is fed to the USB 2.0 (MUSB) PHY and
> its output is used to clock the USB 1.1 (OHCI) PHY...

> Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>

    BTW, Prakash, as you'r on the patch's disrtibution path, shouldn't you add 
your signoff as well?

> ---
>   arch/arm/mach-davinci/board-da850-evm.c |  126 +++++++++++++++++++++++++++++++
>   1 files changed, 126 insertions(+), 0 deletions(-)

> diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
> index 6659a90..df74ba5 100644
> --- a/arch/arm/mach-davinci/board-da850-evm.c
> +++ b/arch/arm/mach-davinci/board-da850-evm.c
[...]
> +static __init void da850_evm_usb_init(void)
> +{
[...]
> +	ret = gpio_request(ON_BD_USB_DRV, "ON_BD_USB_DRV");
> +	if (ret) {
> +		printk(KERN_ERR "%s: failed to request GPIO for USB 1.1 port "
> +		       "power control: %d\n", __func__, ret);
> +		return;
> +	}
> +	gpio_direction_output(ON_BD_USB_DRV, 0);

    You should also use gpio_request_one() instead 
gpio_request()/gpio_direction_output() pair.

> +
> +	ret = gpio_request(ON_BD_USB_OVC, "ON_BD_USB_OVC");
> +	if (ret) {
> +		printk(KERN_ERR "%s: failed to request GPIO for USB 1.1 port "
> +		       "over-current indicator: %d\n", __func__, ret);
> +		return;
> +	}
> +	gpio_direction_input(ON_BD_USB_OVC);

    Same here.

WBR, Sergei

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

* [PATCH] davinci: DA850 EVM: OHCI platform code
@ 2011-12-20 11:17   ` Sergei Shtylyov
  0 siblings, 0 replies; 12+ messages in thread
From: Sergei Shtylyov @ 2011-12-20 11:17 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 20-12-2011 10:36, Manjunathappa, Prakash wrote:

> From: Ajay Kumar Gupta<ajay.gupta@ti.com>

> On this board the OHCI port's power control and over-current signals from
> TPS2065 power switch are connected via GPIO1[15] and GPIO2[1] respectively,
> so we can implement the DA8xx OHCI glue layer's hooks for overriding the
> root hub port's power and over-current status bits.

> We also have to properly set up the clocking mode in the CFGCHIP2 register,
> so that internal 24 MHz reference clock is fed to the USB 2.0 (MUSB) PHY and
> its output is used to clock the USB 1.1 (OHCI) PHY...

> Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>

    BTW, Prakash, as you'r on the patch's disrtibution path, shouldn't you add 
your signoff as well?

> ---
>   arch/arm/mach-davinci/board-da850-evm.c |  126 +++++++++++++++++++++++++++++++
>   1 files changed, 126 insertions(+), 0 deletions(-)

> diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
> index 6659a90..df74ba5 100644
> --- a/arch/arm/mach-davinci/board-da850-evm.c
> +++ b/arch/arm/mach-davinci/board-da850-evm.c
[...]
> +static __init void da850_evm_usb_init(void)
> +{
[...]
> +	ret = gpio_request(ON_BD_USB_DRV, "ON_BD_USB_DRV");
> +	if (ret) {
> +		printk(KERN_ERR "%s: failed to request GPIO for USB 1.1 port "
> +		       "power control: %d\n", __func__, ret);
> +		return;
> +	}
> +	gpio_direction_output(ON_BD_USB_DRV, 0);

    You should also use gpio_request_one() instead 
gpio_request()/gpio_direction_output() pair.

> +
> +	ret = gpio_request(ON_BD_USB_OVC, "ON_BD_USB_OVC");
> +	if (ret) {
> +		printk(KERN_ERR "%s: failed to request GPIO for USB 1.1 port "
> +		       "over-current indicator: %d\n", __func__, ret);
> +		return;
> +	}
> +	gpio_direction_input(ON_BD_USB_OVC);

    Same here.

WBR, Sergei

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

* RE: [PATCH] davinci: DA850 EVM: OHCI platform code
  2011-12-20 11:07   ` Sergei Shtylyov
@ 2011-12-20 13:51     ` Gupta, Ajay Kumar
  -1 siblings, 0 replies; 12+ messages in thread
From: Gupta, Ajay Kumar @ 2011-12-20 13:51 UTC (permalink / raw)
  To: Sergei Shtylyov, Manjunathappa, Prakash
  Cc: davinci-linux-open-source, linux, linux-kernel, linux-arm-kernel

Hi
> Hello.
> 
> On 20.12.2011 10:36, Manjunathappa, Prakash wrote:
> 
> > From: Ajay Kumar Gupta <ajay.gupta@ti.com>
> 
>     It's a good practice to CC the original author of the patch -- which
> I'm
> doing now...
> 
> > On this board the OHCI port's power control and over-current signals
> from
> > TPS2065 power switch are connected via GPIO1[15] and GPIO2[1]
> respectively,
> 
>     Ajay, your description seems to be copied unchganged from the
> analogous
> DA830 EVM patch, and thus doesn't match your patch: GPIO2[4] and
> GPIO6[13] are
> used apparently. Be more attentive to detail next time please.

Well, this patch was created long back for internal release work and
couldn't review this before it is sent out.

Prakash, Please correct the patch description as suggested.

Regards,
Ajay
> .
> > so we can implement the DA8xx OHCI glue layer's hooks for overriding
> the
> > root hub port's power and over-current status bits.
> 
> > We also have to properly set up the clocking mode in the CFGCHIP2
> register,
> > so that internal 24 MHz reference clock is fed to the USB 2.0 (MUSB)
> PHY and
> > its output is used to clock the USB 1.1 (OHCI) PHY...
> 
> > Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
> > ---
> >   arch/arm/mach-davinci/board-da850-evm.c |  126
> +++++++++++++++++++++++++++++++
> >   1 files changed, 126 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-
> davinci/board-da850-evm.c
> > index 6659a90..df74ba5 100644
> > --- a/arch/arm/mach-davinci/board-da850-evm.c
> > +++ b/arch/arm/mach-davinci/board-da850-evm.c
> [...]
> > @@ -734,6 +736,127 @@ static struct davinci_i2c_platform_data
> da850_evm_i2c_0_pdata = {
> [...]
> > +static int da850_evm_usb_ocic_notify(da8xx_ocic_handler_t handler)
> > +{
> > +	int irq		= gpio_to_irq(ON_BD_USB_OVC);
> > +	int error	= 0;
> > +
> > +	if (handler != NULL) {
> > +		da850_evm_usb_ocic_handler = handler;
> > +
> > +		error = request_irq(irq, da850_evm_usb_ocic_irq,
> IRQF_DISABLED |
> 
>     IRQF_DISABLED is a nop now -- just remove it.
> 
> WBR, Sergei

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

* [PATCH] davinci: DA850 EVM: OHCI platform code
@ 2011-12-20 13:51     ` Gupta, Ajay Kumar
  0 siblings, 0 replies; 12+ messages in thread
From: Gupta, Ajay Kumar @ 2011-12-20 13:51 UTC (permalink / raw)
  To: linux-arm-kernel

Hi
> Hello.
> 
> On 20.12.2011 10:36, Manjunathappa, Prakash wrote:
> 
> > From: Ajay Kumar Gupta <ajay.gupta@ti.com>
> 
>     It's a good practice to CC the original author of the patch -- which
> I'm
> doing now...
> 
> > On this board the OHCI port's power control and over-current signals
> from
> > TPS2065 power switch are connected via GPIO1[15] and GPIO2[1]
> respectively,
> 
>     Ajay, your description seems to be copied unchganged from the
> analogous
> DA830 EVM patch, and thus doesn't match your patch: GPIO2[4] and
> GPIO6[13] are
> used apparently. Be more attentive to detail next time please.

Well, this patch was created long back for internal release work and
couldn't review this before it is sent out.

Prakash, Please correct the patch description as suggested.

Regards,
Ajay
> .
> > so we can implement the DA8xx OHCI glue layer's hooks for overriding
> the
> > root hub port's power and over-current status bits.
> 
> > We also have to properly set up the clocking mode in the CFGCHIP2
> register,
> > so that internal 24 MHz reference clock is fed to the USB 2.0 (MUSB)
> PHY and
> > its output is used to clock the USB 1.1 (OHCI) PHY...
> 
> > Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
> > ---
> >   arch/arm/mach-davinci/board-da850-evm.c |  126
> +++++++++++++++++++++++++++++++
> >   1 files changed, 126 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-
> davinci/board-da850-evm.c
> > index 6659a90..df74ba5 100644
> > --- a/arch/arm/mach-davinci/board-da850-evm.c
> > +++ b/arch/arm/mach-davinci/board-da850-evm.c
> [...]
> > @@ -734,6 +736,127 @@ static struct davinci_i2c_platform_data
> da850_evm_i2c_0_pdata = {
> [...]
> > +static int da850_evm_usb_ocic_notify(da8xx_ocic_handler_t handler)
> > +{
> > +	int irq		= gpio_to_irq(ON_BD_USB_OVC);
> > +	int error	= 0;
> > +
> > +	if (handler != NULL) {
> > +		da850_evm_usb_ocic_handler = handler;
> > +
> > +		error = request_irq(irq, da850_evm_usb_ocic_irq,
> IRQF_DISABLED |
> 
>     IRQF_DISABLED is a nop now -- just remove it.
> 
> WBR, Sergei

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

* RE: [PATCH] davinci: DA850 EVM: OHCI platform code
  2011-12-20 11:07   ` Sergei Shtylyov
@ 2011-12-21  5:52     ` Manjunathappa, Prakash
  -1 siblings, 0 replies; 12+ messages in thread
From: Manjunathappa, Prakash @ 2011-12-21  5:52 UTC (permalink / raw)
  To: Sergei Shtylyov, Gupta, Ajay Kumar
  Cc: davinci-linux-open-source, linux, linux-kernel, linux-arm-kernel,
	Nori, Sekhar

Hi Sergei,

On Tue, Dec 20, 2011 at 16:37:16, Sergei Shtylyov wrote:
> Hello.
> 
> On 20.12.2011 10:36, Manjunathappa, Prakash wrote:
> 
> > From: Ajay Kumar Gupta <ajay.gupta@ti.com>
> 
>     It's a good practice to CC the original author of the patch -- which I'm 
> doing now...
> 

I did put author and maintainers in CC, my git send-email log shows it up as below. But I don't know why it doesnot appear when mails reach my inbox. Can you please let me know if I am missing any configuration?:

prakash@linux-psp-server:~/project/linux/linux_torvalds$ git send-email --smtp-server=192.168.247.13 --cc=nsekhar@ti.com --cc=linux-kernel@vger.kernel.org --cc=linux-arm-kernel@lists.infradead.org --cc=linux@arm.linux.org.uk 0001-davinci-DA850-EVM-OHCI-platform-code.patch
0001-davinci-DA850-EVM-OHCI-platform-code.patch
Who should the emails appear to be from? [Manjunathappa, Prakash <prakash.pm@ti.com>]
Emails will be sent from: Manjunathappa, Prakash <prakash.pm@ti.com>
Who should the emails be sent to? davinci-linux-open-source@linux.davincidsp.com
Message-ID to be used as In-Reply-To for the first email?
(mbox) Adding cc: Ajay Kumar Gupta <ajay.gupta@ti.com> from line 'From: Ajay Kumar Gupta <ajay.gupta@ti.com>'
(body) Adding cc: Ajay Kumar Gupta <ajay.gupta@ti.com> from line 'Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>'

From: "Manjunathappa, Prakash" <prakash.pm@ti.com>
To: davinci-linux-open-source@linux.davincidsp.com
Cc: nsekhar@ti.com,
        linux-kernel@vger.kernel.org,
        linux-arm-kernel@lists.infradead.org,
        linux@arm.linux.org.uk,
        Ajay Kumar Gupta <ajay.gupta@ti.com>
Subject: [PATCH] davinci: DA850 EVM: OHCI platform code
Date: Wed, 21 Dec 2011 11:05:38 +0530
Message-Id: <1324445738-7203-1-git-send-email-prakash.pm@ti.com>
X-Mailer: git-send-email 1.7.1

    The Cc list above has been expanded by additional
    addresses found in the patch commit message. By default
    send-email prompts before sending whenever this occurs.
    This behavior is controlled by the sendemail.confirm
    configuration setting.

    For additional information, run 'git send-email --help'.
    To retain the current behavior, but squelch this message,
    run 'git config --global sendemail.confirm auto'.

Send this email? ([y]es|[n]o|[q]uit|[a]ll):

> > On this board the OHCI port's power control and over-current signals from
> > TPS2065 power switch are connected via GPIO1[15] and GPIO2[1] respectively,
> 
>     Ajay, your description seems to be copied unchganged from the analogous 
> DA830 EVM patch, and thus doesn't match your patch: GPIO2[4] and GPIO6[13] are 
> used apparently. Be more attentive to detail next time please.
> 

I will fix this.

> > so we can implement the DA8xx OHCI glue layer's hooks for overriding the
> > root hub port's power and over-current status bits.
> 
> > We also have to properly set up the clocking mode in the CFGCHIP2 register,
> > so that internal 24 MHz reference clock is fed to the USB 2.0 (MUSB) PHY and
> > its output is used to clock the USB 1.1 (OHCI) PHY...
> 
> > Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
> > ---
> >   arch/arm/mach-davinci/board-da850-evm.c |  126 +++++++++++++++++++++++++++++++
> >   1 files changed, 126 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
> > index 6659a90..df74ba5 100644
> > --- a/arch/arm/mach-davinci/board-da850-evm.c
> > +++ b/arch/arm/mach-davinci/board-da850-evm.c
> [...]
> > @@ -734,6 +736,127 @@ static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = {
> [...]
> > +static int da850_evm_usb_ocic_notify(da8xx_ocic_handler_t handler)
> > +{
> > +	int irq		= gpio_to_irq(ON_BD_USB_OVC);
> > +	int error	= 0;
> > +
> > +	if (handler != NULL) {
> > +		da850_evm_usb_ocic_handler = handler;
> > +
> > +		error = request_irq(irq, da850_evm_usb_ocic_irq, IRQF_DISABLED |
> 
>     IRQF_DISABLED is a nop now -- just remove it.
> 

Agreed, I will remove it.

Thanks,
Prakash
> WBR, Sergei
> 


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

* [PATCH] davinci: DA850 EVM: OHCI platform code
@ 2011-12-21  5:52     ` Manjunathappa, Prakash
  0 siblings, 0 replies; 12+ messages in thread
From: Manjunathappa, Prakash @ 2011-12-21  5:52 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Sergei,

On Tue, Dec 20, 2011 at 16:37:16, Sergei Shtylyov wrote:
> Hello.
> 
> On 20.12.2011 10:36, Manjunathappa, Prakash wrote:
> 
> > From: Ajay Kumar Gupta <ajay.gupta@ti.com>
> 
>     It's a good practice to CC the original author of the patch -- which I'm 
> doing now...
> 

I did put author and maintainers in CC, my git send-email log shows it up as below. But I don't know why it doesnot appear when mails reach my inbox. Can you please let me know if I am missing any configuration?:

prakash at linux-psp-server:~/project/linux/linux_torvalds$ git send-email --smtp-server=192.168.247.13 --cc=nsekhar at ti.com --cc=linux-kernel at vger.kernel.org --cc=linux-arm-kernel at lists.infradead.org --cc=linux at arm.linux.org.uk 0001-davinci-DA850-EVM-OHCI-platform-code.patch
0001-davinci-DA850-EVM-OHCI-platform-code.patch
Who should the emails appear to be from? [Manjunathappa, Prakash <prakash.pm@ti.com>]
Emails will be sent from: Manjunathappa, Prakash <prakash.pm@ti.com>
Who should the emails be sent to? davinci-linux-open-source at linux.davincidsp.com
Message-ID to be used as In-Reply-To for the first email?
(mbox) Adding cc: Ajay Kumar Gupta <ajay.gupta@ti.com> from line 'From: Ajay Kumar Gupta <ajay.gupta@ti.com>'
(body) Adding cc: Ajay Kumar Gupta <ajay.gupta@ti.com> from line 'Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>'

From: "Manjunathappa, Prakash" <prakash.pm@ti.com>
To: davinci-linux-open-source at linux.davincidsp.com
Cc: nsekhar at ti.com,
        linux-kernel at vger.kernel.org,
        linux-arm-kernel at lists.infradead.org,
        linux at arm.linux.org.uk,
        Ajay Kumar Gupta <ajay.gupta@ti.com>
Subject: [PATCH] davinci: DA850 EVM: OHCI platform code
Date: Wed, 21 Dec 2011 11:05:38 +0530
Message-Id: <1324445738-7203-1-git-send-email-prakash.pm@ti.com>
X-Mailer: git-send-email 1.7.1

    The Cc list above has been expanded by additional
    addresses found in the patch commit message. By default
    send-email prompts before sending whenever this occurs.
    This behavior is controlled by the sendemail.confirm
    configuration setting.

    For additional information, run 'git send-email --help'.
    To retain the current behavior, but squelch this message,
    run 'git config --global sendemail.confirm auto'.

Send this email? ([y]es|[n]o|[q]uit|[a]ll):

> > On this board the OHCI port's power control and over-current signals from
> > TPS2065 power switch are connected via GPIO1[15] and GPIO2[1] respectively,
> 
>     Ajay, your description seems to be copied unchganged from the analogous 
> DA830 EVM patch, and thus doesn't match your patch: GPIO2[4] and GPIO6[13] are 
> used apparently. Be more attentive to detail next time please.
> 

I will fix this.

> > so we can implement the DA8xx OHCI glue layer's hooks for overriding the
> > root hub port's power and over-current status bits.
> 
> > We also have to properly set up the clocking mode in the CFGCHIP2 register,
> > so that internal 24 MHz reference clock is fed to the USB 2.0 (MUSB) PHY and
> > its output is used to clock the USB 1.1 (OHCI) PHY...
> 
> > Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
> > ---
> >   arch/arm/mach-davinci/board-da850-evm.c |  126 +++++++++++++++++++++++++++++++
> >   1 files changed, 126 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
> > index 6659a90..df74ba5 100644
> > --- a/arch/arm/mach-davinci/board-da850-evm.c
> > +++ b/arch/arm/mach-davinci/board-da850-evm.c
> [...]
> > @@ -734,6 +736,127 @@ static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = {
> [...]
> > +static int da850_evm_usb_ocic_notify(da8xx_ocic_handler_t handler)
> > +{
> > +	int irq		= gpio_to_irq(ON_BD_USB_OVC);
> > +	int error	= 0;
> > +
> > +	if (handler != NULL) {
> > +		da850_evm_usb_ocic_handler = handler;
> > +
> > +		error = request_irq(irq, da850_evm_usb_ocic_irq, IRQF_DISABLED |
> 
>     IRQF_DISABLED is a nop now -- just remove it.
> 

Agreed, I will remove it.

Thanks,
Prakash
> WBR, Sergei
> 

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

* RE: [PATCH] davinci: DA850 EVM: OHCI platform code
  2011-12-20 11:17   ` Sergei Shtylyov
@ 2011-12-21  5:56     ` Manjunathappa, Prakash
  -1 siblings, 0 replies; 12+ messages in thread
From: Manjunathappa, Prakash @ 2011-12-21  5:56 UTC (permalink / raw)
  To: Sergei Shtylyov, Gupta, Ajay Kumar
  Cc: davinci-linux-open-source, linux, linux-kernel, linux-arm-kernel

Hi Sergei,

On Tue, Dec 20, 2011 at 16:47:22, Sergei Shtylyov wrote:
> Hello.
> 
> On 20-12-2011 10:36, Manjunathappa, Prakash wrote:
> 
> > From: Ajay Kumar Gupta<ajay.gupta@ti.com>
> 
> > On this board the OHCI port's power control and over-current signals from
> > TPS2065 power switch are connected via GPIO1[15] and GPIO2[1] respectively,
> > so we can implement the DA8xx OHCI glue layer's hooks for overriding the
> > root hub port's power and over-current status bits.
> 
> > We also have to properly set up the clocking mode in the CFGCHIP2 register,
> > so that internal 24 MHz reference clock is fed to the USB 2.0 (MUSB) PHY and
> > its output is used to clock the USB 1.1 (OHCI) PHY...
> 
> > Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
> 
>     BTW, Prakash, as you'r on the patch's disrtibution path, shouldn't you add 
> your signoff as well?
> 

Yes, I will make it point to keep my signoff as well while distributing.

> > ---
> >   arch/arm/mach-davinci/board-da850-evm.c |  126 +++++++++++++++++++++++++++++++
> >   1 files changed, 126 insertions(+), 0 deletions(-)
> 
> > diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
> > index 6659a90..df74ba5 100644
> > --- a/arch/arm/mach-davinci/board-da850-evm.c
> > +++ b/arch/arm/mach-davinci/board-da850-evm.c
> [...]
> > +static __init void da850_evm_usb_init(void)
> > +{
> [...]
> > +	ret = gpio_request(ON_BD_USB_DRV, "ON_BD_USB_DRV");
> > +	if (ret) {
> > +		printk(KERN_ERR "%s: failed to request GPIO for USB 1.1 port "
> > +		       "power control: %d\n", __func__, ret);
> > +		return;
> > +	}
> > +	gpio_direction_output(ON_BD_USB_DRV, 0);
> 
>     You should also use gpio_request_one() instead 
> gpio_request()/gpio_direction_output() pair.
> 

Agreed, I will use gpio_request_one().

> > +
> > +	ret = gpio_request(ON_BD_USB_OVC, "ON_BD_USB_OVC");
> > +	if (ret) {
> > +		printk(KERN_ERR "%s: failed to request GPIO for USB 1.1 port "
> > +		       "over-current indicator: %d\n", __func__, ret);
> > +		return;
> > +	}
> > +	gpio_direction_input(ON_BD_USB_OVC);
> 
>     Same here.
> 

Agreed.

Thanks,
Prakash

> WBR, Sergei
> 


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

* [PATCH] davinci: DA850 EVM: OHCI platform code
@ 2011-12-21  5:56     ` Manjunathappa, Prakash
  0 siblings, 0 replies; 12+ messages in thread
From: Manjunathappa, Prakash @ 2011-12-21  5:56 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Sergei,

On Tue, Dec 20, 2011 at 16:47:22, Sergei Shtylyov wrote:
> Hello.
> 
> On 20-12-2011 10:36, Manjunathappa, Prakash wrote:
> 
> > From: Ajay Kumar Gupta<ajay.gupta@ti.com>
> 
> > On this board the OHCI port's power control and over-current signals from
> > TPS2065 power switch are connected via GPIO1[15] and GPIO2[1] respectively,
> > so we can implement the DA8xx OHCI glue layer's hooks for overriding the
> > root hub port's power and over-current status bits.
> 
> > We also have to properly set up the clocking mode in the CFGCHIP2 register,
> > so that internal 24 MHz reference clock is fed to the USB 2.0 (MUSB) PHY and
> > its output is used to clock the USB 1.1 (OHCI) PHY...
> 
> > Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
> 
>     BTW, Prakash, as you'r on the patch's disrtibution path, shouldn't you add 
> your signoff as well?
> 

Yes, I will make it point to keep my signoff as well while distributing.

> > ---
> >   arch/arm/mach-davinci/board-da850-evm.c |  126 +++++++++++++++++++++++++++++++
> >   1 files changed, 126 insertions(+), 0 deletions(-)
> 
> > diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
> > index 6659a90..df74ba5 100644
> > --- a/arch/arm/mach-davinci/board-da850-evm.c
> > +++ b/arch/arm/mach-davinci/board-da850-evm.c
> [...]
> > +static __init void da850_evm_usb_init(void)
> > +{
> [...]
> > +	ret = gpio_request(ON_BD_USB_DRV, "ON_BD_USB_DRV");
> > +	if (ret) {
> > +		printk(KERN_ERR "%s: failed to request GPIO for USB 1.1 port "
> > +		       "power control: %d\n", __func__, ret);
> > +		return;
> > +	}
> > +	gpio_direction_output(ON_BD_USB_DRV, 0);
> 
>     You should also use gpio_request_one() instead 
> gpio_request()/gpio_direction_output() pair.
> 

Agreed, I will use gpio_request_one().

> > +
> > +	ret = gpio_request(ON_BD_USB_OVC, "ON_BD_USB_OVC");
> > +	if (ret) {
> > +		printk(KERN_ERR "%s: failed to request GPIO for USB 1.1 port "
> > +		       "over-current indicator: %d\n", __func__, ret);
> > +		return;
> > +	}
> > +	gpio_direction_input(ON_BD_USB_OVC);
> 
>     Same here.
> 

Agreed.

Thanks,
Prakash

> WBR, Sergei
> 

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

end of thread, other threads:[~2011-12-21  5:56 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-20  6:36 [PATCH] davinci: DA850 EVM: OHCI platform code Manjunathappa, Prakash
2011-12-20  6:36 ` Manjunathappa, Prakash
2011-12-20 11:07 ` Sergei Shtylyov
2011-12-20 11:07   ` Sergei Shtylyov
2011-12-20 13:51   ` Gupta, Ajay Kumar
2011-12-20 13:51     ` Gupta, Ajay Kumar
2011-12-21  5:52   ` Manjunathappa, Prakash
2011-12-21  5:52     ` Manjunathappa, Prakash
2011-12-20 11:17 ` Sergei Shtylyov
2011-12-20 11:17   ` Sergei Shtylyov
2011-12-21  5:56   ` Manjunathappa, Prakash
2011-12-21  5:56     ` Manjunathappa, Prakash

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.