2 * linux/include/asm-arm/arch-omap/bus.h
4 * Virtual bus for OMAP. Allows better power management, such as managing
5 * shared clocks, and mapping of bus addresses to Local Bus addresses.
7 * See drivers/usb/host/ohci-omap.c or drivers/video/omap/omapfb.c for
8 * examples on how to register drivers to this bus.
10 * Copyright (C) 2003 - 2004 Nokia Corporation
11 * Written by Tony Lindgren <tony@atomide.com>
12 * Portions of code based on sa1111.c.
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 #ifndef __ASM_ARM_ARCH_OMAP_BUS_H
30 #define __ASM_ARM_ARCH_OMAP_BUS_H
32 extern struct bus_type omap_bus_types[];
35 * Description for physical device
38 struct device dev; /* Standard device description */
40 unsigned int devid; /* OMAP device id */
41 unsigned int busid; /* OMAP virtual busid */
42 struct resource res; /* Standard resource description */
43 void *mapbase; /* OMAP physical address */
44 unsigned int irq[6]; /* OMAP interrupts */
45 u64 *dma_mask; /* Used by USB OHCI only */
46 u64 coherent_dma_mask; /* Used by USB OHCI only */
49 #define OMAP_DEV(_d) container_of((_d), struct omap_dev, dev)
51 #define omap_get_drvdata(d) dev_get_drvdata(&(d)->dev)
52 #define omap_set_drvdata(d,p) dev_set_drvdata(&(d)->dev, p)
55 * Description for device driver
58 struct device_driver drv; /* Standard driver description */
59 unsigned int devid; /* OMAP device id for bus */
60 unsigned int busid; /* OMAP virtual busid */
61 unsigned int clocks; /* OMAP shared clocks */
62 int (*probe)(struct omap_dev *);
63 int (*remove)(struct omap_dev *);
64 int (*suspend)(struct omap_dev *, u32);
65 int (*resume)(struct omap_dev *);
68 #define OMAP_DRV(_d) container_of((_d), struct omap_driver, drv)
69 #define OMAP_DRIVER_NAME(_omapdev) ((_omapdev)->dev.driver->name)
72 * Device ID numbers for bus types
74 #define OMAP_OCP_DEVID_USB 0
76 #define OMAP_TIPB_DEVID_OHCI 0
77 #define OMAP_TIPB_DEVID_LCD 1
78 #define OMAP_TIPB_DEVID_MMC 2
79 #define OMAP_TIPB_DEVID_OTG 3
80 #define OMAP_TIPB_DEVID_UDC 4
83 * Virtual bus definitions for OMAP
85 #define OMAP_NR_BUSES 2
87 #define OMAP_BUS_NAME_TIPB "tipb"
88 #define OMAP_BUS_NAME_LBUS "lbus"
95 /* See arch/arm/mach-omap/bus.c for the rest of the bus definitions. */
97 extern int omap_driver_register(struct omap_driver *driver);
98 extern void omap_driver_unregister(struct omap_driver *driver);
99 extern int omap_device_register(struct omap_dev *odev);
100 extern void omap_device_unregister(struct omap_dev *odev);