Re: [PATCH] musb: am35x: fix compile error due to control apis

2010-12-30 Thread Felipe Balbi

On Thu, Dec 30, 2010 at 02:44:40AM -0500, Ben Gamari wrote:

On Mon, 27 Dec 2010 11:20:38 +0200, Felipe Balbi ba...@ti.com wrote:

On Thu, Dec 23, 2010 at 12:16:22PM -0500, Ben Gamari wrote:
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).

yes, it is.


Are you sure? We are currently at -rc8 and yet this patch has yet to
make it into my tree.


Yes. The patch is waiting for the merge window, check linux-next or
Greg's usb-next branch.

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


Re: [PATCH] musb: am35x: fix compile error due to control apis

2010-12-30 Thread Sergei Shtylyov

Hello.

On 30-12-2010 15:27, Felipe Balbi wrote:


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).



yes, it is.



Are you sure? We are currently at -rc8 and yet this patch has yet to
make it into my tree.



Yes. The patch is waiting for the merge window, check linux-next or
Greg's usb-next branch.


   And yet he was asking you about 2.6.37. :-)

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


Re: [PATCH] musb: am35x: fix compile error due to control apis

2010-12-30 Thread Ben Gamari
On Thu, 30 Dec 2010 14:27:38 +0200, Felipe Balbi ba...@ti.com wrote:
 Yes. The patch is waiting for the merge window, check linux-next or
 Greg's usb-next branch.
 
So I guess no working USB in 2.6.37 in that case?

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


Re: [PATCH] musb: am35x: fix compile error due to control apis

2010-12-30 Thread Anca Emanuel
On Thu, Dec 30, 2010 at 5:00 PM, Ben Gamari bgamari.f...@gmail.com wrote:
 On Thu, 30 Dec 2010 14:27:38 +0200, Felipe Balbi ba...@ti.com wrote:
 Yes. The patch is waiting for the merge window, check linux-next or
 Greg's usb-next branch.

 So I guess no working USB in 2.6.37 in that case?

You can ask Greg to make an pull request, or mail Linus directly.
It is an driver, and Linus will accept patches that makes drivers work.
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] musb: am35x: fix compile error due to control apis

2010-12-30 Thread Felipe Balbi

On Thu, Dec 30, 2010 at 05:24:05PM +0200, Anca Emanuel wrote:

On Thu, Dec 30, 2010 at 5:00 PM, Ben Gamari bgamari.f...@gmail.com wrote:

On Thu, 30 Dec 2010 14:27:38 +0200, Felipe Balbi ba...@ti.com wrote:

Yes. The patch is waiting for the merge window, check linux-next or
Greg's usb-next branch.


So I guess no working USB in 2.6.37 in that case?


You can ask Greg to make an pull request, or mail Linus directly.
It is an driver, and Linus will accept patches that makes drivers work.


Don't do that. I'll back port the changes to 2.6.37-stable. If you do
any such thing you'll break the changes which are on Greg's queue. Sorry

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


Re: [PATCH] musb: am35x: fix compile error due to control apis

2010-12-30 Thread Felipe Balbi

On Thu, Dec 30, 2010 at 10:00:46AM -0500, Ben Gamari wrote:

On Thu, 30 Dec 2010 14:27:38 +0200, Felipe Balbi ba...@ti.com wrote:

Yes. The patch is waiting for the merge window, check linux-next or
Greg's usb-next branch.


So I guess no working USB in 2.6.37 in that case?


For am35x, I guess not. All in all, it was a change to omap's arch code
which broke am35x in the first place. Well, the driver shouldn't be
using that header anyway.

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


Re: [PATCH] musb: am35x: fix compile error due to control apis

2010-12-30 Thread Sergei Shtylyov

Hello.

Felipe Balbi wrote:


Yes. The patch is waiting for the merge window, check linux-next or
Greg's usb-next branch.



So I guess no working USB in 2.6.37 in that case?



For am35x, I guess not. All in all, it was a change to omap's arch code
which broke am35x in the first place. Well, the driver shouldn't be
using that header anyway.


   This was a dubious decision, IMHO. It would have been better to accept the 
initial patch to make things compile in 2.6.37, and then do the big change for 
2.6.38...


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


Re: [PATCH] musb: am35x: fix compile error due to control apis

2010-12-30 Thread Ben Gamari
On Fri,  3 Dec 2010 23:42:45 +0530, Ajay Kumar Gupta ajay.gu...@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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] musb: am35x: fix compile error due to control apis

2010-12-29 Thread Ben Gamari
On Mon, 27 Dec 2010 11:20:38 +0200, Felipe Balbi ba...@ti.com wrote:
 On Thu, Dec 23, 2010 at 12:16:22PM -0500, Ben Gamari wrote:
 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).
 
 yes, it is.
 
Are you sure? We are currently at -rc8 and yet this patch has yet to
make it into my tree.

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


Re: [PATCH] musb: am35x: fix compile error due to control apis

2010-12-27 Thread Felipe Balbi

On Thu, Dec 23, 2010 at 12:16:22PM -0500, Ben Gamari wrote:

On Fri,  3 Dec 2010 23:42:45 +0530, Ajay Kumar Gupta ajay.gu...@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).


yes, it is.

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


Re: [PATCH] musb: am35x: fix compile error due to control apis

2010-12-23 Thread Ben Gamari
On Fri,  3 Dec 2010 23:42:45 +0530, Ajay Kumar Gupta ajay.gu...@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
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH] musb: am35x: fix compile error due to control apis

2010-12-04 Thread Gupta, Ajay Kumar
  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.gu...@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
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH] musb: am35x: fix compile error due to control apis

2010-12-04 Thread Gupta, Ajay Kumar
  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

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


RE: [PATCH] musb: am35x: fix compile error due to control apis

2010-12-03 Thread Anand Gadiyar
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.gu...@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.

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


Re: [PATCH] musb: am35x: fix compile error due to control apis

2010-12-03 Thread Sergei Shtylyov

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.gu...@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

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