diff options
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/Kconfig | 11 | ||||
-rw-r--r-- | drivers/ide/Makefile | 2 | ||||
-rw-r--r-- | drivers/ide/cs5536.c | 13 | ||||
-rw-r--r-- | drivers/ide/ide-acpi.c | 5 | ||||
-rw-r--r-- | drivers/ide/ide-h8300.c | 109 | ||||
-rw-r--r-- | drivers/ide/ide-sysfs.c | 35 | ||||
-rw-r--r-- | drivers/ide/ide.c | 2 | ||||
-rw-r--r-- | drivers/ide/pmac.c | 52 |
8 files changed, 49 insertions, 180 deletions
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig index 02906ca99b41..8fb46aab2d87 100644 --- a/drivers/ide/Kconfig +++ b/drivers/ide/Kconfig @@ -197,8 +197,8 @@ comment "IDE chipset support/bugfixes" config IDE_GENERIC tristate "generic/default IDE chipset support" - depends on ALPHA || X86 || IA64 || M32R || MIPS || ARCH_RPC || ARCH_SHARK - default ARM && (ARCH_RPC || ARCH_SHARK) + depends on ALPHA || X86 || IA64 || M32R || MIPS || ARCH_RPC + default ARM && ARCH_RPC help This is the generic IDE driver. This driver attaches to the fixed legacy ports (e.g. on PCs 0x1f0/0x170, 0x1e8/0x168 and @@ -722,13 +722,6 @@ config BLK_DEV_IDE_RAPIDE Say Y here if you want to support the Yellowstone RapIDE controller manufactured for use with Acorn computers. -config IDE_H8300 - tristate "H8300 IDE support" - depends on H8300 - default y - help - Enables the H8300 IDE driver. - config BLK_DEV_GAYLE tristate "Amiga Gayle IDE interface support" depends on AMIGA diff --git a/drivers/ide/Makefile b/drivers/ide/Makefile index af8d016c37ea..a04ee82f1c8f 100644 --- a/drivers/ide/Makefile +++ b/drivers/ide/Makefile @@ -78,8 +78,6 @@ obj-$(CONFIG_BLK_DEV_CMD640) += cmd640.o obj-$(CONFIG_BLK_DEV_IDE_PMAC) += pmac.o -obj-$(CONFIG_IDE_H8300) += ide-h8300.o - obj-$(CONFIG_IDE_GENERIC) += ide-generic.o obj-$(CONFIG_BLK_DEV_IDEPNP) += ide-pnp.o diff --git a/drivers/ide/cs5536.c b/drivers/ide/cs5536.c index 24214ab60ac0..de9185db41d4 100644 --- a/drivers/ide/cs5536.c +++ b/drivers/ide/cs5536.c @@ -295,15 +295,7 @@ static struct pci_driver cs5536_pci_driver = { .resume = ide_pci_resume, }; -static int __init cs5536_init(void) -{ - return pci_register_driver(&cs5536_pci_driver); -} - -static void __exit cs5536_exit(void) -{ - pci_unregister_driver(&cs5536_pci_driver); -} +module_pci_driver(cs5536_pci_driver); MODULE_AUTHOR("Martin K. Petersen, Bartlomiej Zolnierkiewicz"); MODULE_DESCRIPTION("low-level driver for the CS5536 IDE controller"); @@ -312,6 +304,3 @@ MODULE_DEVICE_TABLE(pci, cs5536_pci_tbl); module_param_named(msr, use_msr, int, 0644); MODULE_PARM_DESC(msr, "Force using MSR to configure IDE function (Default: 0)"); - -module_init(cs5536_init); -module_exit(cs5536_exit); diff --git a/drivers/ide/ide-acpi.c b/drivers/ide/ide-acpi.c index 140c8ef50529..d9e1f7ccfe6f 100644 --- a/drivers/ide/ide-acpi.c +++ b/drivers/ide/ide-acpi.c @@ -7,6 +7,7 @@ * Copyright (C) 2006 Hannes Reinecke */ +#include <linux/acpi.h> #include <linux/ata.h> #include <linux/delay.h> #include <linux/device.h> @@ -19,8 +20,6 @@ #include <linux/dmi.h> #include <linux/module.h> -#include <acpi/acpi_bus.h> - #define REGS_PER_GTF 7 struct GTM_buffer { @@ -128,7 +127,7 @@ static int ide_get_dev_handle(struct device *dev, acpi_handle *handle, DEBPRINT("ENTER: pci %02x:%02x.%01x\n", bus, devnum, func); - dev_handle = DEVICE_ACPI_HANDLE(dev); + dev_handle = ACPI_HANDLE(dev); if (!dev_handle) { DEBPRINT("no acpi handle for device\n"); goto err; diff --git a/drivers/ide/ide-h8300.c b/drivers/ide/ide-h8300.c deleted file mode 100644 index 520f42c5445a..000000000000 --- a/drivers/ide/ide-h8300.c +++ /dev/null @@ -1,109 +0,0 @@ -/* - * H8/300 generic IDE interface - */ - -#include <linux/init.h> -#include <linux/ide.h> - -#include <asm/io.h> -#include <asm/irq.h> - -#define DRV_NAME "ide-h8300" - -#define bswap(d) \ -({ \ - u16 r; \ - __asm__("mov.b %w1,r1h\n\t" \ - "mov.b %x1,r1l\n\t" \ - "mov.w r1,%0" \ - :"=r"(r) \ - :"r"(d) \ - :"er1"); \ - (r); \ -}) - -static void mm_outsw(unsigned long addr, void *buf, u32 len) -{ - unsigned short *bp = (unsigned short *)buf; - for (; len > 0; len--, bp++) - *(volatile u16 *)addr = bswap(*bp); -} - -static void mm_insw(unsigned long addr, void *buf, u32 len) -{ - unsigned short *bp = (unsigned short *)buf; - for (; len > 0; len--, bp++) - *bp = bswap(*(volatile u16 *)addr); -} - -static void h8300_input_data(ide_drive_t *drive, struct ide_cmd *cmd, - void *buf, unsigned int len) -{ - mm_insw(drive->hwif->io_ports.data_addr, buf, (len + 1) / 2); -} - -static void h8300_output_data(ide_drive_t *drive, struct ide_cmd *cmd, - void *buf, unsigned int len) -{ - mm_outsw(drive->hwif->io_ports.data_addr, buf, (len + 1) / 2); -} - -static const struct ide_tp_ops h8300_tp_ops = { - .exec_command = ide_exec_command, - .read_status = ide_read_status, - .read_altstatus = ide_read_altstatus, - .write_devctl = ide_write_devctl, - - .dev_select = ide_dev_select, - .tf_load = ide_tf_load, - .tf_read = ide_tf_read, - - .input_data = h8300_input_data, - .output_data = h8300_output_data, -}; - -#define H8300_IDE_GAP (2) - -static inline void hw_setup(struct ide_hw *hw) -{ - int i; - - memset(hw, 0, sizeof(*hw)); - for (i = 0; i <= 7; i++) - hw->io_ports_array[i] = CONFIG_H8300_IDE_BASE + H8300_IDE_GAP*i; - hw->io_ports.ctl_addr = CONFIG_H8300_IDE_ALT; - hw->irq = EXT_IRQ0 + CONFIG_H8300_IDE_IRQ; -} - -static const struct ide_port_info h8300_port_info = { - .tp_ops = &h8300_tp_ops, - .host_flags = IDE_HFLAG_NO_IO_32BIT | IDE_HFLAG_NO_DMA, - .chipset = ide_generic, -}; - -static int __init h8300_ide_init(void) -{ - struct ide_hw hw, *hws[] = { &hw }; - - printk(KERN_INFO DRV_NAME ": H8/300 generic IDE interface\n"); - - if (!request_region(CONFIG_H8300_IDE_BASE, H8300_IDE_GAP*8, "ide-h8300")) - goto out_busy; - if (!request_region(CONFIG_H8300_IDE_ALT, H8300_IDE_GAP, "ide-h8300")) { - release_region(CONFIG_H8300_IDE_BASE, H8300_IDE_GAP*8); - goto out_busy; - } - - hw_setup(&hw); - - return ide_host_add(&h8300_port_info, hws, 1, NULL); - -out_busy: - printk(KERN_ERR "ide-h8300: IDE I/F resource already used.\n"); - - return -EBUSY; -} - -module_init(h8300_ide_init); - -MODULE_LICENSE("GPL"); diff --git a/drivers/ide/ide-sysfs.c b/drivers/ide/ide-sysfs.c index 883ffacaf45a..84a6a9e08d64 100644 --- a/drivers/ide/ide-sysfs.c +++ b/drivers/ide/ide-sysfs.c @@ -25,6 +25,7 @@ static ssize_t media_show(struct device *dev, struct device_attribute *attr, ide_drive_t *drive = to_ide_device(dev); return sprintf(buf, "%s\n", ide_media_string(drive)); } +static DEVICE_ATTR_RO(media); static ssize_t drivename_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -32,6 +33,7 @@ static ssize_t drivename_show(struct device *dev, struct device_attribute *attr, ide_drive_t *drive = to_ide_device(dev); return sprintf(buf, "%s\n", drive->name); } +static DEVICE_ATTR_RO(drivename); static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -39,6 +41,7 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, ide_drive_t *drive = to_ide_device(dev); return sprintf(buf, "ide:m-%s\n", ide_media_string(drive)); } +static DEVICE_ATTR_RO(modalias); static ssize_t model_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -46,6 +49,7 @@ static ssize_t model_show(struct device *dev, struct device_attribute *attr, ide_drive_t *drive = to_ide_device(dev); return sprintf(buf, "%s\n", (char *)&drive->id[ATA_ID_PROD]); } +static DEVICE_ATTR_RO(model); static ssize_t firmware_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -53,6 +57,7 @@ static ssize_t firmware_show(struct device *dev, struct device_attribute *attr, ide_drive_t *drive = to_ide_device(dev); return sprintf(buf, "%s\n", (char *)&drive->id[ATA_ID_FW_REV]); } +static DEVICE_ATTR_RO(firmware); static ssize_t serial_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -60,16 +65,28 @@ static ssize_t serial_show(struct device *dev, struct device_attribute *attr, ide_drive_t *drive = to_ide_device(dev); return sprintf(buf, "%s\n", (char *)&drive->id[ATA_ID_SERNO]); } +static DEVICE_ATTR(serial, 0400, serial_show, NULL); + +static DEVICE_ATTR(unload_heads, 0644, ide_park_show, ide_park_store); + +static struct attribute *ide_attrs[] = { + &dev_attr_media.attr, + &dev_attr_drivename.attr, + &dev_attr_modalias.attr, + &dev_attr_model.attr, + &dev_attr_firmware.attr, + &dev_attr_serial.attr, + &dev_attr_unload_heads.attr, + NULL, +}; + +static const struct attribute_group ide_attr_group = { + .attrs = ide_attrs, +}; -struct device_attribute ide_dev_attrs[] = { - __ATTR_RO(media), - __ATTR_RO(drivename), - __ATTR_RO(modalias), - __ATTR_RO(model), - __ATTR_RO(firmware), - __ATTR(serial, 0400, serial_show, NULL), - __ATTR(unload_heads, 0644, ide_park_show, ide_park_store), - __ATTR_NULL +const struct attribute_group *ide_dev_groups[] = { + &ide_attr_group, + NULL, }; static ssize_t store_delete_devices(struct device *portdev, diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index fa896210ed7b..2ce6268a2734 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -158,7 +158,7 @@ struct bus_type ide_bus_type = { .probe = generic_ide_probe, .remove = generic_ide_remove, .shutdown = generic_ide_shutdown, - .dev_attrs = ide_dev_attrs, + .dev_groups = ide_dev_groups, .suspend = generic_ide_suspend, .resume = generic_ide_resume, }; diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c index bf83d7bb6bc6..2db803cd095c 100644 --- a/drivers/ide/pmac.c +++ b/drivers/ide/pmac.c @@ -416,8 +416,7 @@ static int pmac_ide_init_dma(ide_hwif_t *, const struct ide_port_info *); static void pmac_ide_apply_timings(ide_drive_t *drive) { ide_hwif_t *hwif = drive->hwif; - pmac_ide_hwif_t *pmif = - (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); + pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); if (drive->dn & 1) writel(pmif->timings[1], PMAC_IDE_REG(IDE_TIMING_CONFIG)); @@ -434,8 +433,7 @@ static void pmac_ide_apply_timings(ide_drive_t *drive) static void pmac_ide_kauai_apply_timings(ide_drive_t *drive) { ide_hwif_t *hwif = drive->hwif; - pmac_ide_hwif_t *pmif = - (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); + pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); if (drive->dn & 1) { writel(pmif->timings[1], PMAC_IDE_REG(IDE_KAUAI_PIO_CONFIG)); @@ -454,8 +452,7 @@ static void pmac_ide_do_update_timings(ide_drive_t *drive) { ide_hwif_t *hwif = drive->hwif; - pmac_ide_hwif_t *pmif = - (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); + pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); if (pmif->kind == controller_sh_ata6 || pmif->kind == controller_un_ata6 || @@ -500,8 +497,7 @@ static void pmac_write_devctl(ide_hwif_t *hwif, u8 ctl) */ static void pmac_ide_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive) { - pmac_ide_hwif_t *pmif = - (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); + pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); const u8 pio = drive->pio_mode - XFER_PIO_0; struct ide_timing *tim = ide_timing_find_mode(XFER_PIO_0 + pio); u32 *timings, t; @@ -781,8 +777,7 @@ set_timings_mdma(ide_drive_t *drive, int intf_type, u32 *timings, u32 *timings2, static void pmac_ide_set_dma_mode(ide_hwif_t *hwif, ide_drive_t *drive) { - pmac_ide_hwif_t *pmif = - (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); + pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); int ret = 0; u32 *timings, *timings2, tl[2]; u8 unit = drive->dn & 1; @@ -919,8 +914,7 @@ static int pmac_ide_do_resume(pmac_ide_hwif_t *pmif) static u8 pmac_ide_cable_detect(ide_hwif_t *hwif) { - pmac_ide_hwif_t *pmif = - (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); + pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); struct device_node *np = pmif->node; const char *cable = of_get_property(np, "cable-type", NULL); struct device_node *root = of_find_node_by_path("/"); @@ -951,8 +945,7 @@ static u8 pmac_ide_cable_detect(ide_hwif_t *hwif) static void pmac_ide_init_dev(ide_drive_t *drive) { ide_hwif_t *hwif = drive->hwif; - pmac_ide_hwif_t *pmif = - (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); + pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); if (on_media_bay(pmif)) { if (check_media_bay(pmif->mdev->media_bay) == MB_CD) { @@ -1228,8 +1221,7 @@ out_free_pmif: static int pmac_ide_macio_suspend(struct macio_dev *mdev, pm_message_t mesg) { - pmac_ide_hwif_t *pmif = - (pmac_ide_hwif_t *)dev_get_drvdata(&mdev->ofdev.dev); + pmac_ide_hwif_t *pmif = dev_get_drvdata(&mdev->ofdev.dev); int rc = 0; if (mesg.event != mdev->ofdev.dev.power.power_state.event @@ -1245,8 +1237,7 @@ pmac_ide_macio_suspend(struct macio_dev *mdev, pm_message_t mesg) static int pmac_ide_macio_resume(struct macio_dev *mdev) { - pmac_ide_hwif_t *pmif = - (pmac_ide_hwif_t *)dev_get_drvdata(&mdev->ofdev.dev); + pmac_ide_hwif_t *pmif = dev_get_drvdata(&mdev->ofdev.dev); int rc = 0; if (mdev->ofdev.dev.power.power_state.event != PM_EVENT_ON) { @@ -1318,7 +1309,6 @@ static int pmac_ide_pci_attach(struct pci_dev *pdev, rc = pmac_ide_setup_device(pmif, &hw); if (rc != 0) { /* The inteface is released to the common IDE layer */ - pci_set_drvdata(pdev, NULL); iounmap(base); pci_release_regions(pdev); kfree(pmif); @@ -1365,8 +1355,7 @@ pmac_ide_pci_resume(struct pci_dev *pdev) #ifdef CONFIG_PMAC_MEDIABAY static void pmac_ide_macio_mb_event(struct macio_dev* mdev, int mb_state) { - pmac_ide_hwif_t *pmif = - (pmac_ide_hwif_t *)dev_get_drvdata(&mdev->ofdev.dev); + pmac_ide_hwif_t *pmif = dev_get_drvdata(&mdev->ofdev.dev); switch(mb_state) { case MB_CD: @@ -1468,8 +1457,7 @@ out: static int pmac_ide_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd) { ide_hwif_t *hwif = drive->hwif; - pmac_ide_hwif_t *pmif = - (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); + pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); struct dbdma_cmd *table; volatile struct dbdma_regs __iomem *dma = pmif->dma_regs; struct scatterlist *sg; @@ -1546,8 +1534,7 @@ static int pmac_ide_build_dmatable(ide_drive_t *drive, struct ide_cmd *cmd) static int pmac_ide_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd) { ide_hwif_t *hwif = drive->hwif; - pmac_ide_hwif_t *pmif = - (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); + pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); u8 unit = drive->dn & 1, ata4 = (pmif->kind == controller_kl_ata4); u8 write = !!(cmd->tf_flags & IDE_TFLAG_WRITE); @@ -1572,8 +1559,7 @@ static void pmac_ide_dma_start(ide_drive_t *drive) { ide_hwif_t *hwif = drive->hwif; - pmac_ide_hwif_t *pmif = - (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); + pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); volatile struct dbdma_regs __iomem *dma; dma = pmif->dma_regs; @@ -1590,8 +1576,7 @@ static int pmac_ide_dma_end (ide_drive_t *drive) { ide_hwif_t *hwif = drive->hwif; - pmac_ide_hwif_t *pmif = - (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); + pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); volatile struct dbdma_regs __iomem *dma = pmif->dma_regs; u32 dstat; @@ -1615,8 +1600,7 @@ static int pmac_ide_dma_test_irq (ide_drive_t *drive) { ide_hwif_t *hwif = drive->hwif; - pmac_ide_hwif_t *pmif = - (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); + pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); volatile struct dbdma_regs __iomem *dma = pmif->dma_regs; unsigned long status, timeout; @@ -1670,8 +1654,7 @@ static void pmac_ide_dma_lost_irq (ide_drive_t *drive) { ide_hwif_t *hwif = drive->hwif; - pmac_ide_hwif_t *pmif = - (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); + pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); volatile struct dbdma_regs __iomem *dma = pmif->dma_regs; unsigned long status = readl(&dma->status); @@ -1693,8 +1676,7 @@ static const struct ide_dma_ops pmac_dma_ops = { */ static int pmac_ide_init_dma(ide_hwif_t *hwif, const struct ide_port_info *d) { - pmac_ide_hwif_t *pmif = - (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); + pmac_ide_hwif_t *pmif = dev_get_drvdata(hwif->gendev.parent); struct pci_dev *dev = to_pci_dev(hwif->dev); /* We won't need pci_dev if we switch to generic consistent |