blob: 88165657fa5367ade7663cf786b7831a5dfe5719 [file] [log] [blame]
Ben Dookseca86552009-03-06 19:49:48 +00001/* linux/arch/arm/plat-s3c/dev-usb.c
2 *
3 * Copyright 2008 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 * http://armlinux.simtec.co.uk/
6 *
7 * S3C series device definition for USB host
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12*/
13
14#include <linux/kernel.h>
15#include <linux/string.h>
16#include <linux/platform_device.h>
17
18#include <mach/irqs.h>
19#include <mach/map.h>
20
21#include <plat/devs.h>
Ben Dooksf1267522010-01-13 14:59:46 +090022#include <plat/usb-control.h>
Ben Dookseca86552009-03-06 19:49:48 +000023
24static struct resource s3c_usb_resource[] = {
25 [0] = {
Ben Dookse6a2a9c2009-03-06 19:51:50 +000026 .start = S3C_PA_USBHOST,
27 .end = S3C_PA_USBHOST + 0x100 - 1,
Ben Dookseca86552009-03-06 19:49:48 +000028 .flags = IORESOURCE_MEM,
29 },
30 [1] = {
31 .start = IRQ_USBH,
32 .end = IRQ_USBH,
33 .flags = IORESOURCE_IRQ,
34 }
35};
36
37static u64 s3c_device_usb_dmamask = 0xffffffffUL;
38
Ben Dooksb8132482009-11-23 00:13:39 +000039struct platform_device s3c_device_ohci = {
Ben Dookseca86552009-03-06 19:49:48 +000040 .name = "s3c2410-ohci",
41 .id = -1,
42 .num_resources = ARRAY_SIZE(s3c_usb_resource),
43 .resource = s3c_usb_resource,
44 .dev = {
45 .dma_mask = &s3c_device_usb_dmamask,
46 .coherent_dma_mask = 0xffffffffUL
47 }
48};
49
Ben Dooksb8132482009-11-23 00:13:39 +000050EXPORT_SYMBOL(s3c_device_ohci);
Ben Dooksf1267522010-01-13 14:59:46 +090051
52/**
53 * s3c_ohci_set_platdata - initialise OHCI device platform data
54 * @info: The platform data.
55 *
56 * This call copies the @info passed in and sets the device .platform_data
57 * field to that copy. The @info is copied so that the original can be marked
58 * __initdata.
59 */
60void __init s3c_ohci_set_platdata(struct s3c2410_hcd_info *info)
61{
62 struct s3c2410_hcd_info *npd;
63
64 npd = kmemdup(info, sizeof(struct s3c2410_hcd_info), GFP_KERNEL);
65 if (!npd)
66 printk(KERN_ERR "%s: no memory for platform data\n", __func__);
67
68 s3c_device_ohci.dev.platform_data = npd;
69}