Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (60 commits)
  ide: small whitespace fixes
  ide: ide-cd_ioctl.c fix sparse integer as NULL pointer warnings
  ide: ide-cd.c fix sparse endianness warnings
  ide-cd: convert to using the new atapi_flags
  ide: remove unused PC_FLAG_DRQ_INTERRUPT
  ide-scsi: convert to using the new atapi_flags
  ide-tape: convert to using the new atapi_flags
  ide-floppy: convert to using the new atapi_flags (take 2)
  ide: add per-device flags
  ide: use rq->cmd instead of pc->c in atapi common code
  ide-scsi: pass packet command in rq->cmd
  ide-tape: pass packet command in rq->cmd
  ide-tape: make room for packet command ids in rq->cmd
  ide-floppy: pass packet command in rq->cmd
  ide: remove pc->callback member from ide_atapi_pc
  ide-scsi: use drive->pc_callback instead of pc->callback
  ide-tape: use drive->pc_callback instead of pc->callback
  ide-floppy: use drive->pc_callback instead of pc->callback
  ide: push pc callback pointer into the ide_drive_t structure
  drivers/ide/ide-tape.c: remove double kfree
  ...
  • Loading branch information
torvalds committed Jul 23, 2008
2 parents 876a425 + fc41069 commit e669e81
Show file tree
Hide file tree
Showing 57 changed files with 1,613 additions and 1,466 deletions.
2 changes: 2 additions & 0 deletions drivers/ide/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ config BLK_DEV_TRIFLEX

config BLK_DEV_CY82C693
tristate "CY82C693 chipset support"
depends on ALPHA
select IDE_TIMINGS
select BLK_DEV_IDEDMA_PCI
help
Expand Down Expand Up @@ -548,6 +549,7 @@ config BLK_DEV_CS5535

config BLK_DEV_HPT34X
tristate "HPT34X chipset support"
depends on BROKEN
select BLK_DEV_IDEDMA_PCI
help
This driver adds up to 4 more EIDE devices sharing a single
Expand Down
71 changes: 31 additions & 40 deletions drivers/ide/arm/icside.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ struct icside_state {
void __iomem *ioc_base;
unsigned int sel;
unsigned int type;
ide_hwif_t *hwif[2];
struct ide_host *host;
};

#define ICS_TYPE_A3IN 0
Expand Down Expand Up @@ -375,12 +375,14 @@ static int icside_dma_test_irq(ide_drive_t *drive)

static void icside_dma_timeout(ide_drive_t *drive)
{
ide_hwif_t *hwif = drive->hwif;

printk(KERN_ERR "%s: DMA timeout occurred: ", drive->name);

if (icside_dma_test_irq(drive))
return;

ide_dump_status(drive, "DMA timeout", ide_read_status(drive));
ide_dump_status(drive, "DMA timeout", hwif->tp_ops->read_status(hwif));

icside_dma_end(drive);
}
Expand Down Expand Up @@ -440,10 +442,10 @@ static void icside_setup_ports(hw_regs_t *hw, void __iomem *base,
static int __init
icside_register_v5(struct icside_state *state, struct expansion_card *ec)
{
ide_hwif_t *hwif;
void __iomem *base;
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
hw_regs_t hw;
struct ide_host *host;
hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };
int ret;

base = ecardm_iomap(ec, ECARD_RES_MEMC, 0, 0);
if (!base)
Expand All @@ -463,22 +465,23 @@ icside_register_v5(struct icside_state *state, struct expansion_card *ec)

icside_setup_ports(&hw, base, &icside_cardinfo_v5, ec);

hwif = ide_find_port();
if (!hwif)
host = ide_host_alloc(NULL, hws);
if (host == NULL)
return -ENODEV;

ide_init_port_hw(hwif, &hw);
default_hwif_mmiops(hwif);

state->hwif[0] = hwif;
state->host = host;

ecard_set_drvdata(ec, state);

idx[0] = hwif->index;

ide_device_add(idx, NULL);
ret = ide_host_register(host, NULL, hws);
if (ret)
goto err_free;

return 0;
err_free:
ide_host_free(host);
ecard_set_drvdata(ec, NULL);
return ret;
}

static const struct ide_port_info icside_v6_port_info __initdata = {
Expand All @@ -493,13 +496,12 @@ static const struct ide_port_info icside_v6_port_info __initdata = {
static int __init
icside_register_v6(struct icside_state *state, struct expansion_card *ec)
{
ide_hwif_t *hwif, *mate;
void __iomem *ioc_base, *easi_base;
struct ide_host *host;
unsigned int sel = 0;
int ret;
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
hw_regs_t hw[2], *hws[] = { &hw[0], NULL, NULL, NULL };
struct ide_port_info d = icside_v6_port_info;
hw_regs_t hw[2];

ioc_base = ecardm_iomap(ec, ECARD_RES_IOCFAST, 0, 0);
if (!ioc_base) {
Expand Down Expand Up @@ -538,28 +540,11 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
icside_setup_ports(&hw[0], easi_base, &icside_cardinfo_v6_1, ec);
icside_setup_ports(&hw[1], easi_base, &icside_cardinfo_v6_2, ec);

/*
* Find and register the interfaces.
*/
hwif = ide_find_port();
if (hwif == NULL)
host = ide_host_alloc(&d, hws);
if (host == NULL)
return -ENODEV;

ide_init_port_hw(hwif, &hw[0]);
default_hwif_mmiops(hwif);

idx[0] = hwif->index;

mate = ide_find_port();
if (mate) {
ide_init_port_hw(mate, &hw[1]);
default_hwif_mmiops(mate);

idx[1] = mate->index;
}

state->hwif[0] = hwif;
state->hwif[1] = mate;
state->host = host;

ecard_set_drvdata(ec, state);

Expand All @@ -569,11 +554,17 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
d.dma_ops = NULL;
}

ide_device_add(idx, &d);
ret = ide_host_register(host, NULL, hws);
if (ret)
goto err_free;

return 0;

out:
err_free:
ide_host_free(host);
if (d.dma_ops)
free_dma(ec->dma);
ecard_set_drvdata(ec, NULL);
out:
return ret;
}

Expand Down
14 changes: 2 additions & 12 deletions drivers/ide/arm/ide_arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@

static int __init ide_arm_init(void)
{
ide_hwif_t *hwif;
hw_regs_t hw;
unsigned long base = IDE_ARM_IO, ctl = IDE_ARM_IO + 0x206;
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };

if (!request_region(base, 8, DRV_NAME)) {
printk(KERN_ERR "%s: I/O resource 0x%lX-0x%lX not free.\n",
Expand All @@ -51,15 +49,7 @@ static int __init ide_arm_init(void)
hw.irq = IDE_ARM_IRQ;
hw.chipset = ide_generic;

hwif = ide_find_port();
if (hwif) {
ide_init_port_hw(hwif, &hw);
idx[0] = hwif->index;

ide_device_add(idx, NULL);
}

return 0;
return ide_host_add(NULL, hws, NULL);
}

module_init(ide_arm_init);
Expand Down
30 changes: 9 additions & 21 deletions drivers/ide/arm/palm_bk3710.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,15 +316,14 @@ static u8 __devinit palm_bk3710_cable_detect(ide_hwif_t *hwif)
static int __devinit palm_bk3710_init_dma(ide_hwif_t *hwif,
const struct ide_port_info *d)
{
unsigned long base =
hwif->io_ports.data_addr - IDE_PALM_ATA_PRI_REG_OFFSET;

printk(KERN_INFO " %s: MMIO-DMA\n", hwif->name);

if (ide_allocate_dma_engine(hwif))
return -1;

ide_setup_dma(hwif, base);
hwif->dma_base = hwif->io_ports.data_addr - IDE_PALM_ATA_PRI_REG_OFFSET;

hwif->dma_ops = &sff_dma_ops;

return 0;
}
Expand All @@ -348,11 +347,10 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
{
struct clk *clk;
struct resource *mem, *irq;
ide_hwif_t *hwif;
struct ide_host *host;
unsigned long base, rate;
int i;
hw_regs_t hw;
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
int i, rc;
hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };

clk = clk_get(NULL, "IDECLK");
if (IS_ERR(clk))
Expand Down Expand Up @@ -394,24 +392,14 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
hw.irq = irq->start;
hw.chipset = ide_palm3710;

hwif = ide_find_port();
if (hwif == NULL)
rc = ide_host_add(&palm_bk3710_port_info, hws, NULL);
if (rc)
goto out;

i = hwif->index;

ide_init_port_hw(hwif, &hw);

default_hwif_mmiops(hwif);

idx[0] = i;

ide_device_add(idx, &palm_bk3710_port_info);

return 0;
out:
printk(KERN_WARNING "Palm Chip BK3710 IDE Register Fail\n");
return -ENODEV;
return rc;
}

/* work with hotplug and coldplug */
Expand Down
24 changes: 7 additions & 17 deletions drivers/ide/arm/rapide.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,10 @@ static void rapide_setup_ports(hw_regs_t *hw, void __iomem *base,
static int __devinit
rapide_probe(struct expansion_card *ec, const struct ecard_id *id)
{
ide_hwif_t *hwif;
void __iomem *base;
struct ide_host *host;
int ret;
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
hw_regs_t hw;
hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };

ret = ecard_request_resources(ec);
if (ret)
Expand All @@ -53,20 +52,11 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id)
hw.chipset = ide_generic;
hw.dev = &ec->dev;

hwif = ide_find_port();
if (hwif == NULL) {
ret = -ENOENT;
ret = ide_host_add(&rapide_port_info, hws, &host);
if (ret)
goto release;
}

ide_init_port_hw(hwif, &hw);
default_hwif_mmiops(hwif);

idx[0] = hwif->index;

ide_device_add(idx, &rapide_port_info);

ecard_set_drvdata(ec, hwif);
ecard_set_drvdata(ec, host);
goto out;

release:
Expand All @@ -77,11 +67,11 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id)

static void __devexit rapide_remove(struct expansion_card *ec)
{
ide_hwif_t *hwif = ecard_get_drvdata(ec);
struct ide_host *host = ecard_get_drvdata(ec);

ecard_set_drvdata(ec, NULL);

ide_unregister(hwif);
ide_host_remove(host);

ecard_release_resources(ec);
}
Expand Down
48 changes: 20 additions & 28 deletions drivers/ide/h8300/ide-h8300.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ static void h8300_tf_read(ide_drive_t *drive, ide_task_t *task)
/* be sure we're looking at the low order bits */
outb(ATA_DEVCTL_OBS & ~0x80, io_ports->ctl_addr);

if (task->tf_flags & IDE_TFLAG_IN_FEATURE)
tf->feature = inb(io_ports->feature_addr);
if (task->tf_flags & IDE_TFLAG_IN_NSECT)
tf->nsect = inb(io_ports->nsect_addr);
if (task->tf_flags & IDE_TFLAG_IN_LBAL)
Expand Down Expand Up @@ -153,6 +155,21 @@ static void h8300_output_data(ide_drive_t *drive, struct request *rq,
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,
.read_sff_dma_status = ide_read_sff_dma_status,

.set_irq = ide_set_irq,

.tf_load = h8300_tf_load,
.tf_read = h8300_tf_read,

.input_data = h8300_input_data,
.output_data = h8300_output_data,
};

#define H8300_IDE_GAP (2)

static inline void hw_setup(hw_regs_t *hw)
Expand All @@ -167,27 +184,14 @@ static inline void hw_setup(hw_regs_t *hw)
hw->chipset = ide_generic;
}

static inline void hwif_setup(ide_hwif_t *hwif)
{
default_hwif_iops(hwif);

hwif->tf_load = h8300_tf_load;
hwif->tf_read = h8300_tf_read;

hwif->input_data = h8300_input_data;
hwif->output_data = h8300_output_data;
}

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,
};

static int __init h8300_ide_init(void)
{
hw_regs_t hw;
ide_hwif_t *hwif;
int index;
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
hw_regs_t hw, *hws[] = { &hw, NULL, NULL, NULL };

printk(KERN_INFO DRV_NAME ": H8/300 generic IDE interface\n");

Expand All @@ -200,19 +204,7 @@ static int __init h8300_ide_init(void)

hw_setup(&hw);

hwif = ide_find_port_slot(&h8300_port_info);
if (hwif == NULL)
return -ENOENT;

index = hwif->index;
ide_init_port_hw(hwif, &hw);
hwif_setup(hwif);

idx[0] = index;

ide_device_add(idx, &h8300_port_info);

return 0;
return ide_host_add(&h8300_port_info, hws, NULL);

out_busy:
printk(KERN_ERR "ide-h8300: IDE I/F resource already used.\n");
Expand Down
Loading

0 comments on commit e669e81

Please sign in to comment.