Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * include/asm-sh/bus-sh.h |
| 3 | * |
| 4 | * Copyright (C) 2004 Paul Mundt |
| 5 | * |
| 6 | * This file is subject to the terms and conditions of the GNU General Public |
| 7 | * License. See the file "COPYING" in the main directory of this archive |
| 8 | * for more details. |
| 9 | */ |
| 10 | #ifndef __ASM_SH_BUS_SH_H |
| 11 | #define __ASM_SH_BUS_SH_H |
| 12 | |
| 13 | extern struct bus_type sh_bus_types[]; |
| 14 | |
| 15 | struct sh_dev { |
| 16 | struct device dev; |
| 17 | char *name; |
| 18 | unsigned int dev_id; |
| 19 | unsigned int bus_id; |
| 20 | struct resource res; |
| 21 | void *mapbase; |
| 22 | unsigned int irq[6]; |
| 23 | u64 *dma_mask; |
Paul Mundt | 0d83177 | 2006-01-16 22:14:09 -0800 | [diff] [blame] | 24 | u64 coherent_dma_mask; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | }; |
| 26 | |
| 27 | #define to_sh_dev(d) container_of((d), struct sh_dev, dev) |
| 28 | |
| 29 | #define sh_get_drvdata(d) dev_get_drvdata(&(d)->dev) |
| 30 | #define sh_set_drvdata(d,p) dev_set_drvdata(&(d)->dev, (p)) |
| 31 | |
| 32 | struct sh_driver { |
| 33 | struct device_driver drv; |
| 34 | unsigned int dev_id; |
| 35 | unsigned int bus_id; |
| 36 | int (*probe)(struct sh_dev *); |
| 37 | int (*remove)(struct sh_dev *); |
Pavel Machek | 3bfffd9 | 2005-04-16 15:25:37 -0700 | [diff] [blame] | 38 | int (*suspend)(struct sh_dev *, pm_message_t); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | int (*resume)(struct sh_dev *); |
| 40 | }; |
| 41 | |
| 42 | #define to_sh_driver(d) container_of((d), struct sh_driver, drv) |
| 43 | #define sh_name(d) ((d)->dev.driver->name) |
| 44 | |
| 45 | /* |
| 46 | * Device ID numbers for bus types |
| 47 | */ |
| 48 | enum { |
| 49 | SH_DEV_ID_USB_OHCI, |
| 50 | }; |
| 51 | |
| 52 | #define SH_NR_BUSES 1 |
| 53 | #define SH_BUS_NAME_VIRT "shbus" |
| 54 | |
| 55 | enum { |
| 56 | SH_BUS_VIRT, |
| 57 | }; |
| 58 | |
| 59 | /* arch/sh/kernel/cpu/bus.c */ |
| 60 | extern int sh_device_register(struct sh_dev *dev); |
| 61 | extern void sh_device_unregister(struct sh_dev *dev); |
| 62 | extern int sh_driver_register(struct sh_driver *drv); |
| 63 | extern void sh_driver_unregister(struct sh_driver *drv); |
| 64 | |
| 65 | #endif /* __ASM_SH_BUS_SH_H */ |
| 66 | |