diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-21 14:57:23 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-21 14:57:23 -0400 |
commit | 2bfba3c444fe8b2ab1c38112a89d8f03b61136ca (patch) | |
tree | 17580eee63d868c9d6b97a6bc956a08f25631532 /drivers/ide/ide-4drives.c | |
parent | 2515ddc6db8eb49a79f0fe5e67ff09ac7c81eab4 (diff) |
ide: remove useless subdirs from drivers/ide/
Suggested-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-4drives.c')
-rw-r--r-- | drivers/ide/ide-4drives.c | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/drivers/ide/ide-4drives.c b/drivers/ide/ide-4drives.c new file mode 100644 index 000000000000..9e85b1ec9607 --- /dev/null +++ b/drivers/ide/ide-4drives.c | |||
@@ -0,0 +1,63 @@ | |||
1 | |||
2 | #include <linux/kernel.h> | ||
3 | #include <linux/init.h> | ||
4 | #include <linux/module.h> | ||
5 | #include <linux/ide.h> | ||
6 | |||
7 | #define DRV_NAME "ide-4drives" | ||
8 | |||
9 | static int probe_4drives; | ||
10 | |||
11 | module_param_named(probe, probe_4drives, bool, 0); | ||
12 | MODULE_PARM_DESC(probe, "probe for generic IDE chipset with 4 drives/port"); | ||
13 | |||
14 | static void ide_4drives_init_dev(ide_drive_t *drive) | ||
15 | { | ||
16 | if (drive->hwif->channel) | ||
17 | drive->select ^= 0x20; | ||
18 | } | ||
19 | |||
20 | static const struct ide_port_ops ide_4drives_port_ops = { | ||
21 | .init_dev = ide_4drives_init_dev, | ||
22 | }; | ||
23 | |||
24 | static const struct ide_port_info ide_4drives_port_info = { | ||
25 | .port_ops = &ide_4drives_port_ops, | ||
26 | .host_flags = IDE_HFLAG_SERIALIZE | IDE_HFLAG_NO_DMA, | ||
27 | }; | ||
28 | |||
29 | static int __init ide_4drives_init(void) | ||
30 | { | ||
31 | unsigned long base = 0x1f0, ctl = 0x3f6; | ||
32 | hw_regs_t hw, *hws[] = { &hw, &hw, NULL, NULL }; | ||
33 | |||
34 | if (probe_4drives == 0) | ||
35 | return -ENODEV; | ||
36 | |||
37 | if (!request_region(base, 8, DRV_NAME)) { | ||
38 | printk(KERN_ERR "%s: I/O resource 0x%lX-0x%lX not free.\n", | ||
39 | DRV_NAME, base, base + 7); | ||
40 | return -EBUSY; | ||
41 | } | ||
42 | |||
43 | if (!request_region(ctl, 1, DRV_NAME)) { | ||
44 | printk(KERN_ERR "%s: I/O resource 0x%lX not free.\n", | ||
45 | DRV_NAME, ctl); | ||
46 | release_region(base, 8); | ||
47 | return -EBUSY; | ||
48 | } | ||
49 | |||
50 | memset(&hw, 0, sizeof(hw)); | ||
51 | |||
52 | ide_std_init_ports(&hw, base, ctl); | ||
53 | hw.irq = 14; | ||
54 | hw.chipset = ide_4drives; | ||
55 | |||
56 | return ide_host_add(&ide_4drives_port_info, hws, NULL); | ||
57 | } | ||
58 | |||
59 | module_init(ide_4drives_init); | ||
60 | |||
61 | MODULE_AUTHOR("Bartlomiej Zolnierkiewicz"); | ||
62 | MODULE_DESCRIPTION("generic IDE chipset with 4 drives/port support"); | ||
63 | MODULE_LICENSE("GPL"); | ||