Re: [PATCH Ver 1.0 1/7] Re-structure of Davinci USB platform implementation.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Swaminathan S <swami.iyer@xxxxxx> writes:

> This patch implements the generic DaVinci platform USB configuration
> infrastructure.  Re-structure's usb.c to subscribe for plaform resources for
> the configured instances of controller.  Adds phy_config data member in musb.h
> to enable generic conrol of platform specific USB PHY functionality.
>
> Signed-off-by: Swaminathan S <swami.iyer@xxxxxx>
> ---
>  arch/arm/mach-davinci/include/mach/common.h   |    7 +-
>  arch/arm/mach-davinci/include/mach/usb_musb.h |   41 +++++++
>  arch/arm/mach-davinci/usb.c                   |  144 +++++++------------------
>  include/linux/usb/musb.h                      |    7 ++
>  4 files changed, 87 insertions(+), 112 deletions(-)
>  create mode 100644 arch/arm/mach-davinci/include/mach/usb_musb.h
>
> diff --git a/arch/arm/mach-davinci/include/mach/common.h b/arch/arm/mach-davinci/include/mach/common.h
> index 1fd3917..8fbbb7b 100644
> --- a/arch/arm/mach-davinci/include/mach/common.h
> +++ b/arch/arm/mach-davinci/include/mach/common.h
> @@ -20,12 +20,6 @@ extern void davinci_irq_init(void);
>  extern void __iomem *davinci_intc_base;
>  extern int davinci_intc_type;
>  
> -/* parameters describe VBUS sourcing for host mode */
> -extern void setup_usb(unsigned mA, unsigned potpgt_msec);
> -
> -/* parameters describe VBUS sourcing for host mode */
> -extern void setup_usb(unsigned mA, unsigned potpgt_msec);
> -
>  struct davinci_timer_instance {
>  	void __iomem	*base;
>  	u32		bottom_irq;
> @@ -77,5 +71,6 @@ extern void davinci_common_init(struct davinci_soc_info *soc_info);
>  /* standard place to map on-chip SRAMs; they *may* support DMA */
>  #define SRAM_VIRT	0xfffe0000
>  #define SRAM_SIZE	SZ_128K
> +#define DAVINCI_USB_OTG_BASE    0x01C64000
>  
>  #endif /* __ARCH_ARM_MACH_DAVINCI_COMMON_H */
> diff --git a/arch/arm/mach-davinci/include/mach/usb_musb.h b/arch/arm/mach-davinci/include/mach/usb_musb.h
> new file mode 100644
> index 0000000..e9b35c9
> --- /dev/null
> +++ b/arch/arm/mach-davinci/include/mach/usb_musb.h
> @@ -0,0 +1,41 @@
> +/*
> + * This file contains the architecture specific USB definitions
> + * of the TI DaVinci platforms.
> + *
> + * Copyright (C) 2009 Texas Instruments.
> + *
> + * 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.
> + *
> + * 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.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
> + *
> + */
> +#ifndef USB_MUSB_H_
> +#define USB_MUSB_H_
> +
> +#include <linux/platform_device.h>
> +#include <linux/usb/musb.h>
> +
> +struct plat_res_data {
> +	struct musb_hdrc_platform_data	*plat_data;
> +	struct resource			*res_data;
> +	u8				num_res;
> +};
> +
> +struct usb_plat_data {
> +	struct plat_res_data	*prdata;
> +	u8			num_inst;
> +};

I'm not crazy about these new cryptic structs.  Maybe I'm getting
dumber but it took me 15 minutes to figure out what they are for, and
I still don't fully understand how they are used or why they're
needed.

IMO, I would much rather see the static platform_devices remain with
embedded resources followed by multiple calls to setup_usb() than have
the iteration over lists moved into setup_usb().  To me, setup_usb()
has become signifcantly less readable with this change.

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

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux