aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mmp/pxa168.c
diff options
context:
space:
mode:
authorTanmay Upadhyay <tanmay.upadhyay@einfochips.com>2011-07-20 00:30:58 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-08-22 18:38:30 -0400
commit3abd7f68b28dcf6394c71c998376fc7bc92342c4 (patch)
tree31bda72bb574ba7766607ab19f3b2d121fc45808 /arch/arm/mach-mmp/pxa168.c
parent7a01f496c5218d98ea4542f74fccb60c23b6185c (diff)
USB: pxa168: Add onchip USB host controller support
- Add EHCI Host controller driver - Add wrapper that creates resources for host controller driver v2 - Call clk_put() after clk_disable() in probe function Signed-off-by: Tanmay Upadhyay <tanmay.upadhyay@einfochips.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/arm/mach-mmp/pxa168.c')
-rw-r--r--arch/arm/mach-mmp/pxa168.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c
index 0156f535dae7..b2b280c517dd 100644
--- a/arch/arm/mach-mmp/pxa168.c
+++ b/arch/arm/mach-mmp/pxa168.c
@@ -25,6 +25,9 @@
25#include <mach/dma.h> 25#include <mach/dma.h>
26#include <mach/devices.h> 26#include <mach/devices.h>
27#include <mach/mfp.h> 27#include <mach/mfp.h>
28#include <linux/platform_device.h>
29#include <linux/dma-mapping.h>
30#include <mach/pxa168.h>
28 31
29#include "common.h" 32#include "common.h"
30#include "clock.h" 33#include "clock.h"
@@ -83,6 +86,7 @@ static APBC_CLK(keypad, PXA168_KPC, 0, 32000);
83static APMU_CLK(nand, NAND, 0x19b, 156000000); 86static APMU_CLK(nand, NAND, 0x19b, 156000000);
84static APMU_CLK(lcd, LCD, 0x7f, 312000000); 87static APMU_CLK(lcd, LCD, 0x7f, 312000000);
85static APMU_CLK(eth, ETH, 0x09, 0); 88static APMU_CLK(eth, ETH, 0x09, 0);
89static APMU_CLK(usb, USB, 0x12, 0);
86 90
87/* device and clock bindings */ 91/* device and clock bindings */
88static struct clk_lookup pxa168_clkregs[] = { 92static struct clk_lookup pxa168_clkregs[] = {
@@ -104,6 +108,7 @@ static struct clk_lookup pxa168_clkregs[] = {
104 INIT_CLKREG(&clk_lcd, "pxa168-fb", NULL), 108 INIT_CLKREG(&clk_lcd, "pxa168-fb", NULL),
105 INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL), 109 INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL),
106 INIT_CLKREG(&clk_eth, "pxa168-eth", "MFUCLK"), 110 INIT_CLKREG(&clk_eth, "pxa168-eth", "MFUCLK"),
111 INIT_CLKREG(&clk_usb, "pxa168-ehci", "PXA168-USBCLK"),
107}; 112};
108 113
109static int __init pxa168_init(void) 114static int __init pxa168_init(void)
@@ -169,3 +174,44 @@ PXA168_DEVICE(ssp5, "pxa168-ssp", 4, SSP5, 0xd4021000, 0x40, 60, 61);
169PXA168_DEVICE(fb, "pxa168-fb", -1, LCD, 0xd420b000, 0x1c8); 174PXA168_DEVICE(fb, "pxa168-fb", -1, LCD, 0xd420b000, 0x1c8);
170PXA168_DEVICE(keypad, "pxa27x-keypad", -1, KEYPAD, 0xd4012000, 0x4c); 175PXA168_DEVICE(keypad, "pxa27x-keypad", -1, KEYPAD, 0xd4012000, 0x4c);
171PXA168_DEVICE(eth, "pxa168-eth", -1, MFU, 0xc0800000, 0x0fff); 176PXA168_DEVICE(eth, "pxa168-eth", -1, MFU, 0xc0800000, 0x0fff);
177
178struct resource pxa168_usb_host_resources[] = {
179 /* USB Host conroller register base */
180 [0] = {
181 .start = 0xd4209000,
182 .end = 0xd4209000 + 0x200,
183 .flags = IORESOURCE_MEM,
184 .name = "pxa168-usb-host",
185 },
186 /* USB PHY register base */
187 [1] = {
188 .start = 0xd4206000,
189 .end = 0xd4206000 + 0xff,
190 .flags = IORESOURCE_MEM,
191 .name = "pxa168-usb-phy",
192 },
193 [2] = {
194 .start = IRQ_PXA168_USB2,
195 .end = IRQ_PXA168_USB2,
196 .flags = IORESOURCE_IRQ,
197 },
198};
199
200static u64 pxa168_usb_host_dmamask = DMA_BIT_MASK(32);
201struct platform_device pxa168_device_usb_host = {
202 .name = "pxa168-ehci",
203 .id = -1,
204 .dev = {
205 .dma_mask = &pxa168_usb_host_dmamask,
206 .coherent_dma_mask = DMA_BIT_MASK(32),
207 },
208
209 .num_resources = ARRAY_SIZE(pxa168_usb_host_resources),
210 .resource = pxa168_usb_host_resources,
211};
212
213int __init pxa168_add_usb_host(struct pxa168_usb_pdata *pdata)
214{
215 pxa168_device_usb_host.dev.platform_data = pdata;
216 return platform_device_register(&pxa168_device_usb_host);
217}