aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-cns3xxx/cns3420vb.c
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2012-10-08 09:11:32 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-22 14:26:19 -0400
commit6da00dd7b4c2e6678c3eab3573fb94a0c14ec1cf (patch)
treeeb47d33e5c730c8214b550b5e8413761e53fb9bc /arch/arm/mach-cns3xxx/cns3420vb.c
parent60da65f966437d1212c99df89deb479b0697620a (diff)
ARM: cns3xxx: use OHCI platform driver
This patch converts the cns3xxx platform to use the ohci-platform driver which is now suitable for use. A previous patch converted the cns3xxx platform to use the ehci-platform driver, and thus introduced the need to have power_{on,off} callbacks. Since both the EHCI and OHCI platform drivers use the same same power_{on,off} callbacks now, rename them to cns3xx_usb_power_{on,off} to show that they are shared. Signed-off-by: Florian Fainelli <florian@openwrt.org> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/arm/mach-cns3xxx/cns3420vb.c')
-rw-r--r--arch/arm/mach-cns3xxx/cns3420vb.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/arch/arm/mach-cns3xxx/cns3420vb.c b/arch/arm/mach-cns3xxx/cns3420vb.c
index 906094cb23fb..8a00cee82228 100644
--- a/arch/arm/mach-cns3xxx/cns3420vb.c
+++ b/arch/arm/mach-cns3xxx/cns3420vb.c
@@ -25,6 +25,7 @@
25#include <linux/mtd/physmap.h> 25#include <linux/mtd/physmap.h>
26#include <linux/mtd/partitions.h> 26#include <linux/mtd/partitions.h>
27#include <linux/usb/ehci_pdriver.h> 27#include <linux/usb/ehci_pdriver.h>
28#include <linux/usb/ohci_pdriver.h>
28#include <asm/setup.h> 29#include <asm/setup.h>
29#include <asm/mach-types.h> 30#include <asm/mach-types.h>
30#include <asm/hardware/gic.h> 31#include <asm/hardware/gic.h>
@@ -127,7 +128,7 @@ static struct resource cns3xxx_usb_ehci_resources[] = {
127 128
128static u64 cns3xxx_usb_ehci_dma_mask = DMA_BIT_MASK(32); 129static u64 cns3xxx_usb_ehci_dma_mask = DMA_BIT_MASK(32);
129 130
130static int csn3xxx_usb_ehci_power_on(struct platform_device *pdev) 131static int csn3xxx_usb_power_on(struct platform_device *pdev)
131{ 132{
132 /* 133 /*
133 * EHCI and OHCI share the same clock and power, 134 * EHCI and OHCI share the same clock and power,
@@ -148,7 +149,7 @@ static int csn3xxx_usb_ehci_power_on(struct platform_device *pdev)
148 return 0; 149 return 0;
149} 150}
150 151
151static void csn3xxx_usb_ehci_power_off(struct platform_device *pdev) 152static void csn3xxx_usb_power_off(struct platform_device *pdev)
152{ 153{
153 /* 154 /*
154 * EHCI and OHCI share the same clock and power, 155 * EHCI and OHCI share the same clock and power,
@@ -162,8 +163,8 @@ static void csn3xxx_usb_ehci_power_off(struct platform_device *pdev)
162 163
163static struct usb_ehci_pdata cns3xxx_usb_ehci_pdata = { 164static struct usb_ehci_pdata cns3xxx_usb_ehci_pdata = {
164 .port_power_off = 1, 165 .port_power_off = 1,
165 .power_on = csn3xxx_usb_ehci_power_on, 166 .power_on = csn3xxx_usb_power_on,
166 .power_off = csn3xxx_usb_ehci_power_off, 167 .power_off = csn3xxx_usb_power_off,
167}; 168};
168 169
169static struct platform_device cns3xxx_usb_ehci_device = { 170static struct platform_device cns3xxx_usb_ehci_device = {
@@ -191,13 +192,20 @@ static struct resource cns3xxx_usb_ohci_resources[] = {
191 192
192static u64 cns3xxx_usb_ohci_dma_mask = DMA_BIT_MASK(32); 193static u64 cns3xxx_usb_ohci_dma_mask = DMA_BIT_MASK(32);
193 194
195static struct usb_ohci_pdata cns3xxx_usb_ohci_pdata = {
196 .num_ports = 1,
197 .power_on = csn3xxx_usb_power_on,
198 .power_off = csn3xxx_usb_power_off,
199};
200
194static struct platform_device cns3xxx_usb_ohci_device = { 201static struct platform_device cns3xxx_usb_ohci_device = {
195 .name = "cns3xxx-ohci", 202 .name = "ohci-platform",
196 .num_resources = ARRAY_SIZE(cns3xxx_usb_ohci_resources), 203 .num_resources = ARRAY_SIZE(cns3xxx_usb_ohci_resources),
197 .resource = cns3xxx_usb_ohci_resources, 204 .resource = cns3xxx_usb_ohci_resources,
198 .dev = { 205 .dev = {
199 .dma_mask = &cns3xxx_usb_ohci_dma_mask, 206 .dma_mask = &cns3xxx_usb_ohci_dma_mask,
200 .coherent_dma_mask = DMA_BIT_MASK(32), 207 .coherent_dma_mask = DMA_BIT_MASK(32),
208 .platform_data = &cns3xxx_usb_ohci_pdata,
201 }, 209 },
202}; 210};
203 211