Re: [PATCH 1/3] DaVinci: rename setup_usb() to davinci_setup_usb()

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

 



Sergei Shtylyov <sshtylyov@xxxxxxxxxxxxx> writes:

> Rename setup_usb() into davinci_setup_usb().  While at it:
>
> - move its declaration from <mach/common.h> to more fitting <mach/usb.h>;
> - teach it to handle values of the 'mA' parameter greater than 510 and thus
>   pass 1000 instead of 500 for the power switches capable of sourcing over 1 A;
> - teach it to handle odd values of the 'potpgt_ms' parameter...
>
> Signed-off-by: Sergei Shtylyov <sshtylyov@xxxxxxxxxxxxx>

Thanks, applying to davinci-next.

Kevin

> ---
> The patch is against the recent DaVinci tree...
>
>  arch/arm/mach-davinci/board-dm355-evm.c     |    4 ++--
>  arch/arm/mach-davinci/board-dm355-leopard.c |    4 ++--
>  arch/arm/mach-davinci/board-dm644x-evm.c    |    3 ++-
>  arch/arm/mach-davinci/board-sffsdr.c        |    3 ++-
>  arch/arm/mach-davinci/include/mach/common.h |    6 ------
>  arch/arm/mach-davinci/include/mach/usb.h    |    2 ++
>  arch/arm/mach-davinci/usb.c                 |    8 ++++----
>  7 files changed, 14 insertions(+), 16 deletions(-)
>
> Index: linux-davinci/arch/arm/mach-davinci/board-dm355-evm.c
> ===================================================================
> --- linux-davinci.orig/arch/arm/mach-davinci/board-dm355-evm.c
> +++ linux-davinci/arch/arm/mach-davinci/board-dm355-evm.c
> @@ -27,11 +27,11 @@
>  #include <asm/mach/arch.h>
>  
>  #include <mach/dm355.h>
> -#include <mach/common.h>
>  #include <mach/i2c.h>
>  #include <mach/serial.h>
>  #include <mach/nand.h>
>  #include <mach/mmc.h>
> +#include <mach/usb.h>
>  
>  #define DAVINCI_ASYNC_EMIF_CONTROL_BASE		0x01e10000
>  #define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE	0x02000000
> @@ -338,7 +338,7 @@ static __init void dm355_evm_init(void)
>  	gpio_request(2, "usb_id_toggle");
>  	gpio_direction_output(2, USB_ID_VALUE);
>  	/* irlml6401 switches over 1A in under 8 msec */
> -	setup_usb(500, 8);
> +	davinci_setup_usb(1000, 8);
>  
>  	davinci_setup_mmc(0, &dm355evm_mmc_config);
>  	davinci_setup_mmc(1, &dm355evm_mmc_config);
> Index: linux-davinci/arch/arm/mach-davinci/board-dm355-leopard.c
> ===================================================================
> --- linux-davinci.orig/arch/arm/mach-davinci/board-dm355-leopard.c
> +++ linux-davinci/arch/arm/mach-davinci/board-dm355-leopard.c
> @@ -24,11 +24,11 @@
>  #include <asm/mach/arch.h>
>  
>  #include <mach/dm355.h>
> -#include <mach/common.h>
>  #include <mach/i2c.h>
>  #include <mach/serial.h>
>  #include <mach/nand.h>
>  #include <mach/mmc.h>
> +#include <mach/usb.h>
>  
>  #define DAVINCI_ASYNC_EMIF_CONTROL_BASE		0x01e10000
>  #define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE	0x02000000
> @@ -263,7 +263,7 @@ static __init void dm355_leopard_init(vo
>  	gpio_request(2, "usb_id_toggle");
>  	gpio_direction_output(2, USB_ID_VALUE);
>  	/* irlml6401 switches over 1A in under 8 msec */
> -	setup_usb(500, 8);
> +	davinci_setup_usb(1000, 8);
>  
>  	davinci_setup_mmc(0, &dm355leopard_mmc_config);
>  	davinci_setup_mmc(1, &dm355leopard_mmc_config);
> Index: linux-davinci/arch/arm/mach-davinci/board-dm644x-evm.c
> ===================================================================
> --- linux-davinci.orig/arch/arm/mach-davinci/board-dm644x-evm.c
> +++ linux-davinci/arch/arm/mach-davinci/board-dm644x-evm.c
> @@ -36,6 +36,7 @@
>  #include <mach/mux.h>
>  #include <mach/nand.h>
>  #include <mach/mmc.h>
> +#include <mach/usb.h>
>  
>  #define DM644X_EVM_PHY_MASK		(0x2)
>  #define DM644X_EVM_MDIO_FREQUENCY	(2200000) /* PHY bus frequency */
> @@ -465,7 +466,7 @@ evm_u35_setup(struct i2c_client *client,
>  	/* irlml6401 switches over 1A, in under 8 msec;
>  	 * now it can be managed by nDRV_VBUS ...
>  	 */
> -	setup_usb(500, 8);
> +	davinci_setup_usb(1000, 8);
>  
>  	return 0;
>  }
> Index: linux-davinci/arch/arm/mach-davinci/board-sffsdr.c
> ===================================================================
> --- linux-davinci.orig/arch/arm/mach-davinci/board-sffsdr.c
> +++ linux-davinci/arch/arm/mach-davinci/board-sffsdr.c
> @@ -40,6 +40,7 @@
>  #include <mach/i2c.h>
>  #include <mach/serial.h>
>  #include <mach/mux.h>
> +#include <mach/usb.h>
>  
>  #define SFFSDR_PHY_MASK		(0x2)
>  #define SFFSDR_MDIO_FREQUENCY	(2200000) /* PHY bus frequency */
> @@ -152,7 +153,7 @@ static __init void davinci_sffsdr_init(v
>  	davinci_serial_init(&uart_config);
>  	soc_info->emac_pdata->phy_mask = SFFSDR_PHY_MASK;
>  	soc_info->emac_pdata->mdio_max_freq = SFFSDR_MDIO_FREQUENCY;
> -	setup_usb(0, 0); /* We support only peripheral mode. */
> +	davinci_setup_usb(0, 0); /* We support only peripheral mode. */
>  
>  	/* mux VLYNQ pins */
>  	davinci_cfg_reg(DM644X_VLYNQEN);
> Index: linux-davinci/arch/arm/mach-davinci/include/mach/common.h
> ===================================================================
> --- linux-davinci.orig/arch/arm/mach-davinci/include/mach/common.h
> +++ linux-davinci/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;
> Index: linux-davinci/arch/arm/mach-davinci/include/mach/usb.h
> ===================================================================
> --- linux-davinci.orig/arch/arm/mach-davinci/include/mach/usb.h
> +++ linux-davinci/arch/arm/mach-davinci/include/mach/usb.h
> @@ -54,4 +54,6 @@ struct	da8xx_ohci_root_hub {
>  	u8	potpgt;
>  };
>  
> +void davinci_setup_usb(unsigned mA, unsigned potpgt_ms);
> +
>  #endif	/* ifndef __ASM_ARCH_USB_H */
> 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
> @@ -83,10 +83,10 @@ static struct platform_device usb_dev = 
>  	.num_resources  = ARRAY_SIZE(usb_resources),
>  };
>  
> -void __init setup_usb(unsigned mA, unsigned potpgt_msec)
> +void __init davinci_setup_usb(unsigned mA, unsigned potpgt_ms)
>  {
> -	usb_data.power = mA / 2;
> -	usb_data.potpgt = potpgt_msec / 2;
> +	usb_data.power = mA > 510 ? 255 : mA / 2;
> +	usb_data.potpgt = (potpgt_ms + 1) / 2;
>  
>  	if (cpu_is_davinci_dm646x()) {
>  		/* Override the defaults as DM6467 uses different IRQs. */
> @@ -100,7 +100,7 @@ void __init setup_usb(unsigned mA, unsig
>  
>  #else
>  
> -void __init setup_usb(unsigned mA, unsigned potpgt_msec)
> +void __init davinci_setup_usb(unsigned mA, unsigned potpgt_ms)
>  {
>  }
>  
>
>
> _______________________________________________
> Davinci-linux-open-source mailing list
> Davinci-linux-open-source@xxxxxxxxxxxxxxxxxxxx
> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
--
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