Sergei Shtylyov <[email protected]> writes:

> DM646x has MUSB connected to IRQs 13 and 14 (unlike IRQ12 on other platforms),
> so pass the correct IRQ resources with the platform device.
>
> Signed-off-by: Dmitry Krivoschekov <[email protected]>
> Signed-off-by: Sergei Shtylyov <[email protected]>
>
> ---
> The patch is against the recent DaVinci tree...
>
>  arch/arm/mach-davinci/usb.c |   16 +++++++++++++++-
>  1 files changed, 15 insertions(+), 1 deletion(-)
>
> Index: linux-davinci/arch/arm/mach-davinci/usb.c
> ===================================================================
> --- linux-davinci.orig/arch/arm/mach-davinci/usb.c
> +++ linux-davinci/arch/arm/mach-davinci/usb.c
> @@ -13,6 +13,7 @@
>  #include <mach/common.h>
>  #include <mach/hardware.h>
>  #include <mach/irqs.h>
> +#include <mach/cpu.h>
>  
>  #define DAVINCI_USB_OTG_BASE 0x01C64000
>  
> @@ -64,6 +65,9 @@ static struct resource usb_resources[] =
>               .start          = IRQ_USBINT,
>               .flags          = IORESOURCE_IRQ,
>       },
> +     {       /* placeholder for the dedicated CPPI IRQ */
> +             .flags          = IORESOURCE_IRQ,
> +     },
>  };
>  
>  static u64 usb_dmamask = DMA_32BIT_MASK;
> @@ -77,13 +81,23 @@ static struct platform_device usb_dev = 
>               .coherent_dma_mask      = DMA_32BIT_MASK,
>       },
>       .resource       = usb_resources,
> -     .num_resources  = ARRAY_SIZE(usb_resources),
> +     .num_resources  = 2,

How about keep ARRAY_SIZE() here...

>  };
>  
>  void __init setup_usb(unsigned mA, unsigned potpgt_msec)
>  {
>       usb_data.power = mA / 2;
>       usb_data.potpgt = potpgt_msec / 2;
> +
> +     if (cpu_is_davinci_dm646x()) {
> +             /*
> +              * Override the defaults as DM6467 uses different IRQs.
> +              */
> +             usb_dev.resource[1].start = IRQ_DM646X_USBINT;
> +             usb_dev.resource[2].start = IRQ_DM646X_USBDMAINT;
> +             usb_dev.num_resources = 3;

... then drop this change of 'num_resources' ...
> +     }
> +

And add an else here, which sets num_resources = 2 and has a comment
about the other devices not having a dedicated CPPI IRQ.

Kevin


_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to