From patchwork Fri Oct 30 19:46:14 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 56687 Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9UJlAeO014834 for ; Fri, 30 Oct 2009 19:47:10 GMT Received: from dlep35.itg.ti.com ([157.170.170.118]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id n9UJl9im008648 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 30 Oct 2009 14:47:09 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep35.itg.ti.com (8.13.7/8.13.7) with ESMTP id n9UJl9cf004045 for ; Fri, 30 Oct 2009 14:47:09 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 54E62806A3 for ; Fri, 30 Oct 2009 13:46:51 -0600 (CST) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp52.itg.ti.com (dflp52.itg.ti.com [128.247.22.96]) by linux.omap.com (Postfix) with ESMTP id 79ACB80626 for ; Fri, 30 Oct 2009 13:46:27 -0600 (CST) Received: from neches.ext.ti.com (localhost [127.0.0.1]) by dflp52.itg.ti.com (8.13.7/8.13.7) with ESMTP id n9UJkREC024446 for ; Fri, 30 Oct 2009 14:46:27 -0500 (CDT) Received: from mail39-va3-R.bigfish.com (mail-va3.bigfish.com [216.32.180.111]) by neches.ext.ti.com (8.13.7/8.13.7) with ESMTP id n9UJkQBt024707 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Fri, 30 Oct 2009 14:46:27 -0500 Received: from mail39-va3 (localhost.localdomain [127.0.0.1]) by mail39-va3-R.bigfish.com (Postfix) with ESMTP id 8EBBF10E0551 for ; Fri, 30 Oct 2009 19:46:26 +0000 (UTC) X-SpamScore: 7 X-BigFish: vps7(zzzz1202hzzz2dh6bh259o61h) X-Spam-TCS-SCL: 0:0 X-MS-Exchange-Organization-Antispam-Report: OrigIP: 206.112.117.35; Service: EHS Received: by mail39-va3 (MessageSwitch) id 125693198587732_13232; Fri, 30 Oct 2009 19:46:25 +0000 (UCT) Received: from VA3EHSMHS011.bigfish.com (unknown [10.7.14.236]) by mail39-va3.bigfish.com (Postfix) with ESMTP id 127F68C0053 for ; Fri, 30 Oct 2009 19:46:25 +0000 (UTC) Received: from imap.sh.mvista.com (206.112.117.35) by VA3EHSMHS011.bigfish.com (10.7.99.21) with Microsoft SMTP Server id 14.0.482.32; Fri, 30 Oct 2009 19:46:21 +0000 Received: from wasted.dev.rtsoft.ru (unknown [10.150.0.9]) by imap.sh.mvista.com (Postfix) with SMTP id 527603EFD; Fri, 30 Oct 2009 12:46:18 -0700 (PDT) From: Sergei Shtylyov Organization: MontaVista Software Inc. To: davinci-linux-open-source@linux.davincidsp.com Date: Fri, 30 Oct 2009 23:46:14 +0400 User-Agent: KMail/1.5 MIME-Version: 1.0 Content-Disposition: inline Message-ID: <200910302246.14248.sshtylyov@ru.mvista.com> X-Reverse-DNS: unknown Cc: linux-usb@vger.kernel.org Subject: [PATCH 1/3] DaVinci: rename setup_usb() to davinci_setup_usb() X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.4 Precedence: list List-Id: davinci-linux-open-source.linux.davincidsp.com List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com 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 #include -#include #include #include #include #include +#include #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 #include -#include #include #include #include #include +#include #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 #include #include +#include #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 #include #include +#include #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) { }