* [PATCH] musb: am35x: fix compile error due to control apis
@ 2010-12-03 18:12 Ajay Kumar Gupta
[not found] ` <1291399965-19623-1-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>
` (3 more replies)
0 siblings, 4 replies; 16+ messages in thread
From: Ajay Kumar Gupta @ 2010-12-03 18:12 UTC (permalink / raw)
To: linux-usb-u79uwXL29TY76Z2rM5mHXA
Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA, balbi-l0cyMroinI0,
Ajay Kumar Gupta
As the control.h have been moved to new location and it's
uses are not allowed to drivers directly so moving the phy
control, interrupt clear and reset functionality to board
files.
Signed-off-by: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>
---
Patch created against today's linus tree.
arch/arm/mach-omap2/board-am3517evm.c | 13 +++-
arch/arm/mach-omap2/usb-musb.c | 79 ++++++++++++++++++++
arch/arm/plat-omap/include/plat/usb.h | 3 +
drivers/usb/musb/am35x.c | 127 ++++++++++-----------------------
4 files changed, 133 insertions(+), 89 deletions(-)
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index 0739950..da9a70a 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -403,7 +403,18 @@ static struct omap_musb_board_data musb_board_data = {
static __init void am3517_evm_musb_init(void)
{
- u32 devconf2;
+ u32 devconf2, regval;
+
+ /* Reset the musb interface */
+ regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
+
+ regval |= AM35XX_USBOTGSS_SW_RST;
+ omap_ctrl_writel(regval, AM35XX_CONTROL_IP_SW_RESET);
+
+ regval &= ~AM35XX_USBOTGSS_SW_RST;
+ omap_ctrl_writel(regval, AM35XX_CONTROL_IP_SW_RESET);
+
+ regval = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
/*
* Set up USB clock/mode in the DEVCONF2 register.
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index 7260558..1f32fdb 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -33,6 +33,82 @@
#ifdef CONFIG_USB_MUSB_SOC
+static void am35x_musb_phy_power(u8 on)
+{
+ unsigned long timeout = jiffies + msecs_to_jiffies(100);
+ u32 devconf2;
+
+ if (on) {
+ /*
+ * Start the on-chip PHY and its PLL.
+ */
+ devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
+
+ devconf2 &= ~(CONF2_RESET | CONF2_PHYPWRDN | CONF2_OTGPWRDN);
+ devconf2 |= CONF2_PHY_PLLON;
+
+ omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
+
+ printk(KERN_INFO "Waiting for PHY clock good...\n");
+ while (!(omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2)
+ & CONF2_PHYCLKGD)) {
+ cpu_relax();
+
+ if (time_after(jiffies, timeout)) {
+ printk(KERN_ERR "musb PHY clock good timed out\n");
+ break;
+ }
+ }
+ } else {
+ /*
+ * Power down the on-chip PHY.
+ */
+ devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
+
+ devconf2 &= ~CONF2_PHY_PLLON;
+ devconf2 |= CONF2_PHYPWRDN | CONF2_OTGPWRDN;
+ omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
+ }
+}
+
+static void am35x_musb_clear_irq(void)
+{
+ u32 regval;
+
+ regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+ regval |= AM35XX_USBOTGSS_INT_CLR;
+ omap_ctrl_writel(regval, AM35XX_CONTROL_LVL_INTR_CLEAR);
+ regval = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
+}
+
+static void am35x_musb_set_mode(u8 musb_mode)
+{
+ u32 devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
+
+ devconf2 &= ~CONF2_OTGMODE;
+ switch (musb_mode) {
+#ifdef CONFIG_USB_MUSB_HDRC_HCD
+ case MUSB_HOST: /* Force VBUS valid, ID = 0 */
+ devconf2 |= CONF2_FORCE_HOST;
+ break;
+#endif
+#ifdef CONFIG_USB_GADGET_MUSB_HDRC
+ case MUSB_PERIPHERAL: /* Force VBUS valid, ID = 1 */
+ devconf2 |= CONF2_FORCE_DEVICE;
+ break;
+#endif
+#ifdef CONFIG_USB_MUSB_OTG
+ case MUSB_OTG: /* Don't override the VBUS/ID comparators */
+ devconf2 |= CONF2_NO_OVERRIDE;
+ break;
+#endif
+ default:
+ printk(KERN_INFO "Unsupported mode %u\n", musb_mode);
+ }
+
+ omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
+}
+
static struct resource musb_resources[] = {
[0] = { /* start and end set dynamically */
.flags = IORESOURCE_MEM,
@@ -93,6 +169,9 @@ void __init usb_musb_init(struct omap_musb_board_data *board_data)
} else if (cpu_is_omap3517() || cpu_is_omap3505()) {
musb_resources[0].start = AM35XX_IPSS_USBOTGSS_BASE;
musb_resources[1].start = INT_35XX_USBOTG_IRQ;
+ board_data->set_phy_power = am35x_musb_phy_power,
+ board_data->clear_irq = am35x_musb_clear_irq,
+ board_data->set_mode = am35x_musb_set_mode,
} else if (cpu_is_omap34xx()) {
musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE;
} else if (cpu_is_omap44xx()) {
diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h
index 59c7fe7..4299097 100644
--- a/arch/arm/plat-omap/include/plat/usb.h
+++ b/arch/arm/plat-omap/include/plat/usb.h
@@ -69,6 +69,9 @@ struct omap_musb_board_data {
u8 mode;
u16 power;
unsigned extvbus:1;
+ void (*set_phy_power) (u8 on);
+ void (*clear_irq) (void);
+ void (*set_mode) (u8 mode);
};
enum musb_interface {MUSB_INTERFACE_ULPI, MUSB_INTERFACE_UTMI};
diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c
index b0aabf3..66fc08a 100644
--- a/drivers/usb/musb/am35x.c
+++ b/drivers/usb/musb/am35x.c
@@ -30,7 +30,6 @@
#include <linux/clk.h>
#include <linux/io.h>
-#include <plat/control.h>
#include <plat/usb.h>
#include "musb_core.h"
@@ -80,47 +79,6 @@
#define USB_MENTOR_CORE_OFFSET 0x400
-static inline void phy_on(void)
-{
- unsigned long timeout = jiffies + msecs_to_jiffies(100);
- u32 devconf2;
-
- /*
- * Start the on-chip PHY and its PLL.
- */
- devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
-
- devconf2 &= ~(CONF2_RESET | CONF2_PHYPWRDN | CONF2_OTGPWRDN);
- devconf2 |= CONF2_PHY_PLLON;
-
- omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
-
- DBG(1, "Waiting for PHY clock good...\n");
- while (!(omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2)
- & CONF2_PHYCLKGD)) {
- cpu_relax();
-
- if (time_after(jiffies, timeout)) {
- DBG(1, "musb PHY clock good timed out\n");
- break;
- }
- }
-}
-
-static inline void phy_off(void)
-{
- u32 devconf2;
-
- /*
- * Power down the on-chip PHY.
- */
- devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
-
- devconf2 &= ~CONF2_PHY_PLLON;
- devconf2 |= CONF2_PHYPWRDN | CONF2_OTGPWRDN;
- omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
-}
-
/*
* musb_platform_enable - enable interrupts
*/
@@ -255,9 +213,12 @@ static irqreturn_t am35x_interrupt(int irq, void *hci)
{
struct musb *musb = hci;
void __iomem *reg_base = musb->ctrl_base;
+ struct device *dev = musb->controller;
+ struct musb_hdrc_platform_data *plat = dev->platform_data;
+ struct omap_musb_board_data *data = plat->board_data;
unsigned long flags;
irqreturn_t ret = IRQ_NONE;
- u32 epintr, usbintr, lvl_intr;
+ u32 epintr, usbintr;
spin_lock_irqsave(&musb->lock, flags);
@@ -346,9 +307,8 @@ eoi:
/* EOI needs to be written for the IRQ to be re-asserted. */
if (ret == IRQ_HANDLED || epintr || usbintr) {
/* clear level interrupt */
- lvl_intr = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
- lvl_intr |= AM35XX_USBOTGSS_INT_CLR;
- omap_ctrl_writel(lvl_intr, AM35XX_CONTROL_LVL_INTR_CLEAR);
+ if (data->clear_irq)
+ data->clear_irq();
/* write EOI */
musb_writel(reg_base, USB_END_OF_INTR_REG, 0);
}
@@ -364,37 +324,21 @@ eoi:
int musb_platform_set_mode(struct musb *musb, u8 musb_mode)
{
- u32 devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
+ struct device *dev = musb->controller;
+ struct musb_hdrc_platform_data *plat = dev->platform_data;
+ struct omap_musb_board_data *data = plat->board_data;
- devconf2 &= ~CONF2_OTGMODE;
- switch (musb_mode) {
-#ifdef CONFIG_USB_MUSB_HDRC_HCD
- case MUSB_HOST: /* Force VBUS valid, ID = 0 */
- devconf2 |= CONF2_FORCE_HOST;
- break;
-#endif
-#ifdef CONFIG_USB_GADGET_MUSB_HDRC
- case MUSB_PERIPHERAL: /* Force VBUS valid, ID = 1 */
- devconf2 |= CONF2_FORCE_DEVICE;
- break;
-#endif
-#ifdef CONFIG_USB_MUSB_OTG
- case MUSB_OTG: /* Don't override the VBUS/ID comparators */
- devconf2 |= CONF2_NO_OVERRIDE;
- break;
-#endif
- default:
- DBG(2, "Trying to set unsupported mode %u\n", musb_mode);
- }
+ if (data->set_mode)
+ data->set_mode(musb_mode);
- omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
return 0;
}
int __init musb_platform_init(struct musb *musb, void *board_data)
{
+ struct omap_musb_board_data *data = board_data;
void __iomem *reg_base = musb->ctrl_base;
- u32 rev, lvl_intr, sw_reset;
+ u32 rev;
int status;
musb->mregs += USB_MENTOR_CORE_OFFSET;
@@ -429,29 +373,18 @@ int __init musb_platform_init(struct musb *musb, void *board_data)
musb->board_set_vbus = am35x_set_vbus;
- /* Global reset */
- sw_reset = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
-
- sw_reset |= AM35XX_USBOTGSS_SW_RST;
- omap_ctrl_writel(sw_reset, AM35XX_CONTROL_IP_SW_RESET);
-
- sw_reset &= ~AM35XX_USBOTGSS_SW_RST;
- omap_ctrl_writel(sw_reset, AM35XX_CONTROL_IP_SW_RESET);
-
- /* Reset the controller */
- musb_writel(reg_base, USB_CTRL_REG, AM35X_SOFT_RESET_MASK);
-
/* Start the on-chip PHY and its PLL. */
- phy_on();
+ if (data->set_phy_power)
+ data->set_phy_power(1);
msleep(5);
musb->isr = am35x_interrupt;
/* clear level interrupt */
- lvl_intr = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
- lvl_intr |= AM35XX_USBOTGSS_INT_CLR;
- omap_ctrl_writel(lvl_intr, AM35XX_CONTROL_LVL_INTR_CLEAR);
+ if (data->clear_irq)
+ data->clear_irq();
+
return 0;
exit1:
clk_disable(musb->phy_clock);
@@ -463,10 +396,16 @@ exit0:
int musb_platform_exit(struct musb *musb)
{
+ struct device *dev = musb->controller;
+ struct musb_hdrc_platform_data *plat = dev->platform_data;
+ struct omap_musb_board_data *data = plat->board_data;
+
if (is_host_enabled(musb))
del_timer_sync(&otg_workaround);
- phy_off();
+ /* Shutdown the on-chip PHY and its PLL. */
+ if (data->set_phy_power)
+ data->set_phy_power(0);
otg_put_transceiver(musb->xceiv);
usb_nop_xceiv_unregister();
@@ -483,13 +422,25 @@ int musb_platform_exit(struct musb *musb)
void musb_platform_save_context(struct musb *musb,
struct musb_context_registers *musb_context)
{
- phy_off();
+ struct device *dev = musb->controller;
+ struct musb_hdrc_platform_data *plat = dev->platform_data;
+ struct omap_musb_board_data *data = plat->board_data;
+
+ /* Shutdown the on-chip PHY and its PLL. */
+ if (data->set_phy_power)
+ data->set_phy_power(0);
}
void musb_platform_restore_context(struct musb *musb,
struct musb_context_registers *musb_context)
{
- phy_on();
+ struct device *dev = musb->controller;
+ struct musb_hdrc_platform_data *plat = dev->platform_data;
+ struct omap_musb_board_data *data = plat->board_data;
+
+ /* Start the on-chip PHY and its PLL. */
+ if (data->set_phy_power)
+ data->set_phy_power(1);
}
#endif
--
1.6.2.4
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 16+ messages in thread[parent not found: <1291399965-19623-1-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>]
* RE: [PATCH] musb: am35x: fix compile error due to control apis
[not found] ` <1291399965-19623-1-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>
@ 2010-12-03 18:50 ` Anand Gadiyar
2010-12-04 13:53 ` Gupta, Ajay Kumar
0 siblings, 1 reply; 16+ messages in thread
From: Anand Gadiyar @ 2010-12-03 18:50 UTC (permalink / raw)
To: Ajay Kumar Gupta, linux-usb-u79uwXL29TY76Z2rM5mHXA
Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA, Felipe Balbi
Ajay Kumar Gupta wrote:
> As the control.h have been moved to new location and it's
> uses are not allowed to drivers directly so moving the phy
> control, interrupt clear and reset functionality to board
> files.
>
> Signed-off-by: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>
> ---
> Patch created against today's linus tree.
I hope this is a short-term fix only; otherwise you will need
to duplicate this code in all boards that use an AM3517.
- Anand
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 16+ messages in thread* RE: [PATCH] musb: am35x: fix compile error due to control apis
2010-12-03 18:50 ` Anand Gadiyar
@ 2010-12-04 13:53 ` Gupta, Ajay Kumar
0 siblings, 0 replies; 16+ messages in thread
From: Gupta, Ajay Kumar @ 2010-12-04 13:53 UTC (permalink / raw)
To: Gadiyar, Anand, linux-usb@vger.kernel.org
Cc: linux-omap@vger.kernel.org, Balbi, Felipe
> > As the control.h have been moved to new location and it's
> > uses are not allowed to drivers directly so moving the phy
> > control, interrupt clear and reset functionality to board
> > files.
> >
> > Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
> > ---
> > Patch created against today's linus tree.
>
> I hope this is a short-term fix only; otherwise you will need
> to duplicate this code in all boards that use an AM3517.
most of the stuff are in usb-musb.c so can be reused by all the boards.
Only the musb reset part is added in board file.
Ajay
>
> - Anand
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] musb: am35x: fix compile error due to control apis
2010-12-03 18:12 [PATCH] musb: am35x: fix compile error due to control apis Ajay Kumar Gupta
[not found] ` <1291399965-19623-1-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>
@ 2010-12-03 19:23 ` Sergei Shtylyov
2010-12-04 13:57 ` Gupta, Ajay Kumar
2010-12-23 17:16 ` Ben Gamari
2010-12-30 16:20 ` Ben Gamari
3 siblings, 1 reply; 16+ messages in thread
From: Sergei Shtylyov @ 2010-12-03 19:23 UTC (permalink / raw)
To: Ajay Kumar Gupta; +Cc: linux-usb, linux-omap, balbi
Hello.
Ajay Kumar Gupta wrote:
> As the control.h have been moved to new location and it's
> uses are not allowed to drivers directly so moving the phy
> control, interrupt clear and reset functionality to board
> files.
> Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
[...]
> diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
> index 7260558..1f32fdb 100644
> --- a/arch/arm/mach-omap2/usb-musb.c
> +++ b/arch/arm/mach-omap2/usb-musb.c
> @@ -33,6 +33,82 @@
>
> #ifdef CONFIG_USB_MUSB_SOC
>
> +static void am35x_musb_phy_power(u8 on)
> +{
> + unsigned long timeout = jiffies + msecs_to_jiffies(100);
> + u32 devconf2;
> +
> + if (on) {
> + /*
> + * Start the on-chip PHY and its PLL.
> + */
> + devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
> +
> + devconf2 &= ~(CONF2_RESET | CONF2_PHYPWRDN | CONF2_OTGPWRDN);
> + devconf2 |= CONF2_PHY_PLLON;
> +
> + omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
> +
> + printk(KERN_INFO "Waiting for PHY clock good...\n");
pr_info().
> + while (!(omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2)
> + & CONF2_PHYCLKGD)) {
> + cpu_relax();
> +
> + if (time_after(jiffies, timeout)) {
> + printk(KERN_ERR "musb PHY clock good timed out\n");
pr_err().
> diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h
> index 59c7fe7..4299097 100644
> --- a/arch/arm/plat-omap/include/plat/usb.h
> +++ b/arch/arm/plat-omap/include/plat/usb.h
> @@ -69,6 +69,9 @@ struct omap_musb_board_data {
> u8 mode;
> u16 power;
> unsigned extvbus:1;
> + void (*set_phy_power) (u8 on);
> + void (*clear_irq) (void);
> + void (*set_mode) (u8 mode);
Should be no spaces between ) and (. scripts/checkpatch.pl used to complain
about such things, now it's silent though...
> @@ -364,37 +324,21 @@ eoi:
>
> int musb_platform_set_mode(struct musb *musb, u8 musb_mode)
> {
> - u32 devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
> + struct device *dev = musb->controller;
> + struct musb_hdrc_platform_data *plat = dev->platform_data;
> + struct omap_musb_board_data *data = plat->board_data;
>
> - devconf2 &= ~CONF2_OTGMODE;
> - switch (musb_mode) {
> -#ifdef CONFIG_USB_MUSB_HDRC_HCD
> - case MUSB_HOST: /* Force VBUS valid, ID = 0 */
> - devconf2 |= CONF2_FORCE_HOST;
> - break;
> -#endif
> -#ifdef CONFIG_USB_GADGET_MUSB_HDRC
> - case MUSB_PERIPHERAL: /* Force VBUS valid, ID = 1 */
> - devconf2 |= CONF2_FORCE_DEVICE;
> - break;
> -#endif
> -#ifdef CONFIG_USB_MUSB_OTG
> - case MUSB_OTG: /* Don't override the VBUS/ID comparators */
> - devconf2 |= CONF2_NO_OVERRIDE;
> - break;
> -#endif
> - default:
> - DBG(2, "Trying to set unsupported mode %u\n", musb_mode);
> - }
> + if (data->set_mode)
> + data->set_mode(musb_mode);
You should return -EIO if data->set_mode is NULL.
WBR, Sergei
^ permalink raw reply [flat|nested] 16+ messages in thread* RE: [PATCH] musb: am35x: fix compile error due to control apis
2010-12-03 19:23 ` Sergei Shtylyov
@ 2010-12-04 13:57 ` Gupta, Ajay Kumar
0 siblings, 0 replies; 16+ messages in thread
From: Gupta, Ajay Kumar @ 2010-12-04 13:57 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: linux-usb@vger.kernel.org, linux-omap@vger.kernel.org,
Balbi, Felipe
> > diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-
> musb.c
> > index 7260558..1f32fdb 100644
> > --- a/arch/arm/mach-omap2/usb-musb.c
> > +++ b/arch/arm/mach-omap2/usb-musb.c
> > @@ -33,6 +33,82 @@
> >
> > #ifdef CONFIG_USB_MUSB_SOC
> >
> > +static void am35x_musb_phy_power(u8 on)
> > +{
> > + unsigned long timeout = jiffies + msecs_to_jiffies(100);
> > + u32 devconf2;
> > +
> > + if (on) {
> > + /*
> > + * Start the on-chip PHY and its PLL.
> > + */
> > + devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
> > +
> > + devconf2 &= ~(CONF2_RESET | CONF2_PHYPWRDN | CONF2_OTGPWRDN);
> > + devconf2 |= CONF2_PHY_PLLON;
> > +
> > + omap_ctrl_writel(devconf2, AM35XX_CONTROL_DEVCONF2);
> > +
> > + printk(KERN_INFO "Waiting for PHY clock good...\n");
>
> pr_info().
This file already uses printk() so used it for uniformity.
>
> > + while (!(omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2)
> > + & CONF2_PHYCLKGD)) {
> > + cpu_relax();
> > +
> > + if (time_after(jiffies, timeout)) {
> > + printk(KERN_ERR "musb PHY clock good timed
> out\n");
>
> pr_err().
>
> > diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-
> omap/include/plat/usb.h
> > index 59c7fe7..4299097 100644
> > --- a/arch/arm/plat-omap/include/plat/usb.h
> > +++ b/arch/arm/plat-omap/include/plat/usb.h
> > @@ -69,6 +69,9 @@ struct omap_musb_board_data {
> > u8 mode;
> > u16 power;
> > unsigned extvbus:1;
> > + void (*set_phy_power) (u8 on);
> > + void (*clear_irq) (void);
> > + void (*set_mode) (u8 mode);
>
> Should be no spaces between ) and (. scripts/checkpatch.pl used to
> complain
> about such things, now it's silent though...
Yes, I tried with ./scripts/checkpatch and didn't get any error/warning.
>
> > @@ -364,37 +324,21 @@ eoi:
> >
> > int musb_platform_set_mode(struct musb *musb, u8 musb_mode)
> > {
> > - u32 devconf2 = omap_ctrl_readl(AM35XX_CONTROL_DEVCONF2);
> > + struct device *dev = musb->controller;
> > + struct musb_hdrc_platform_data *plat = dev->platform_data;
> > + struct omap_musb_board_data *data = plat->board_data;
> >
> > - devconf2 &= ~CONF2_OTGMODE;
> > - switch (musb_mode) {
> > -#ifdef CONFIG_USB_MUSB_HDRC_HCD
> > - case MUSB_HOST: /* Force VBUS valid, ID = 0 */
> > - devconf2 |= CONF2_FORCE_HOST;
> > - break;
> > -#endif
> > -#ifdef CONFIG_USB_GADGET_MUSB_HDRC
> > - case MUSB_PERIPHERAL: /* Force VBUS valid, ID = 1 */
> > - devconf2 |= CONF2_FORCE_DEVICE;
> > - break;
> > -#endif
> > -#ifdef CONFIG_USB_MUSB_OTG
> > - case MUSB_OTG: /* Don't override the VBUS/ID comparators */
> > - devconf2 |= CONF2_NO_OVERRIDE;
> > - break;
> > -#endif
> > - default:
> > - DBG(2, "Trying to set unsupported mode %u\n", musb_mode);
> > - }
> > + if (data->set_mode)
> > + data->set_mode(musb_mode);
>
> You should return -EIO if data->set_mode is NULL.
Ok fine...
Ajay
>
> WBR, Sergei
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] musb: am35x: fix compile error due to control apis
2010-12-03 18:12 [PATCH] musb: am35x: fix compile error due to control apis Ajay Kumar Gupta
[not found] ` <1291399965-19623-1-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>
2010-12-03 19:23 ` Sergei Shtylyov
@ 2010-12-23 17:16 ` Ben Gamari
[not found] ` <87hbe41kbd.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-12-30 16:20 ` Ben Gamari
3 siblings, 1 reply; 16+ messages in thread
From: Ben Gamari @ 2010-12-23 17:16 UTC (permalink / raw)
To: linux-usb; +Cc: linux-omap, balbi, Ajay Kumar Gupta
On Fri, 3 Dec 2010 23:42:45 +0530, Ajay Kumar Gupta <ajay.gupta@ti.com> wrote:
> As the control.h have been moved to new location and it's
> uses are not allowed to drivers directly so moving the phy
> control, interrupt clear and reset functionality to board
> files.
>
Is this change slated to go into 2.6.37? As it stands it looks like
2.6.37 will be released with completely broken musb support on many boards
(including the BeagleBoard).
- Ben
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: [PATCH] musb: am35x: fix compile error due to control apis
2010-12-03 18:12 [PATCH] musb: am35x: fix compile error due to control apis Ajay Kumar Gupta
` (2 preceding siblings ...)
2010-12-23 17:16 ` Ben Gamari
@ 2010-12-30 16:20 ` Ben Gamari
3 siblings, 0 replies; 16+ messages in thread
From: Ben Gamari @ 2010-12-30 16:20 UTC (permalink / raw)
To: linux-usb; +Cc: linux-omap, balbi, Ajay Kumar Gupta
On Fri, 3 Dec 2010 23:42:45 +0530, Ajay Kumar Gupta <ajay.gupta@ti.com> wrote:
> As the control.h have been moved to new location and it's
> uses are not allowed to drivers directly so moving the phy
> control, interrupt clear and reset functionality to board
> files.
>
I could have sworn I tried applying this before but I guess I must be
wrong. Perhaps I am missing something?
CC arch/arm/mach-omap2/usb-musb.o
arch/arm/mach-omap2/usb-musb.c: In function ‘am35x_musb_phy_power’:
arch/arm/mach-omap2/usb-musb.c:45: error: implicit declaration of function ‘omap_ctrl_readl’
arch/arm/mach-omap2/usb-musb.c:45: error: ‘AM35XX_CONTROL_DEVCONF2’ undeclared (first use in this function)
arch/arm/mach-omap2/usb-musb.c:45: error: (Each undeclared identifier is reported only once
arch/arm/mach-omap2/usb-musb.c:45: error: for each function it appears in.)
arch/arm/mach-omap2/usb-musb.c:50: error: implicit declaration of function ‘omap_ctrl_writel’
arch/arm/mach-omap2/usb-musb.c: In function ‘am35x_musb_clear_irq’:
arch/arm/mach-omap2/usb-musb.c:78: error: ‘AM35XX_CONTROL_LVL_INTR_CLEAR’ undeclared (first use in this function)
arch/arm/mach-omap2/usb-musb.c:79: error: ‘AM35XX_USBOTGSS_INT_CLR’ undeclared (first use in this function)
arch/arm/mach-omap2/usb-musb.c: In function ‘am35x_musb_set_mode’:
arch/arm/mach-omap2/usb-musb.c:86: error: ‘AM35XX_CONTROL_DEVCONF2’ undeclared (first use in this function)
arch/arm/mach-omap2/usb-musb.c: In function ‘usb_musb_init’:
arch/arm/mach-omap2/usb-musb.c:175: error: expected expression before ‘}’ token
- Ben
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2010-12-30 16:20 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-03 18:12 [PATCH] musb: am35x: fix compile error due to control apis Ajay Kumar Gupta
[not found] ` <1291399965-19623-1-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>
2010-12-03 18:50 ` Anand Gadiyar
2010-12-04 13:53 ` Gupta, Ajay Kumar
2010-12-03 19:23 ` Sergei Shtylyov
2010-12-04 13:57 ` Gupta, Ajay Kumar
2010-12-23 17:16 ` Ben Gamari
[not found] ` <87hbe41kbd.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-12-27 9:20 ` Felipe Balbi
[not found] ` <20101227092038.GB2301-UiBtZHVXSwEVvW8u9ZQWYwjfymiNCTlR@public.gmane.org>
2010-12-30 7:44 ` Ben Gamari
[not found] ` <877heriu1j.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-12-30 12:27 ` Felipe Balbi
2010-12-30 13:06 ` Sergei Shtylyov
2010-12-30 15:00 ` Ben Gamari
2010-12-30 15:24 ` Anca Emanuel
[not found] ` <AANLkTinE9Dgz9nCFv-1d=DdF22OEXSYn16s7krxo3CGp-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-30 16:04 ` Felipe Balbi
2010-12-30 16:05 ` Felipe Balbi
2010-12-30 16:14 ` Sergei Shtylyov
2010-12-30 16:20 ` Ben Gamari
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox