Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93589
b: refs/heads/master
c: 79472b6
h: refs/heads/master
i:
  93587: 92e00be
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Apr 26, 2008
1 parent 5bfc045 commit f73e233
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d07616f19336b514eef06e6a361988c4073e6ecb
refs/heads/master: 79472b6ea9e74ee4400ba57ba84cad86426e2d6d
35 changes: 15 additions & 20 deletions trunk/drivers/ide/legacy/qd65xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,11 @@ static void qd6500_set_pio_mode(ide_drive_t *drive, const u8 pio)

static void qd6580_set_pio_mode(ide_drive_t *drive, const u8 pio)
{
int base = HWIF(drive)->select_data;
ide_hwif_t *hwif = drive->hwif;
unsigned int cycle_time;
int active_time = 175;
int recovery_time = 415; /* worst case values from the dos driver */
u8 base = (hwif->config_data & 0xff00) >> 8;

if (drive->id && !qd_find_disk_type(drive, &active_time, &recovery_time)) {
cycle_time = ide_pio_cycle_time(drive, pio);
Expand Down Expand Up @@ -278,21 +279,10 @@ static int __init qd_testreg(int port)
return (readreg != QD_TESTVAL);
}

/*
* qd_setup:
*
* called to setup an ata channel : adjusts attributes & links for tuning
*/

static void __init qd_setup(ide_hwif_t *hwif, int base, int config)
{
hwif->select_data = base;
hwif->config_data = config;
}

static void __init qd6500_port_init_devs(ide_hwif_t *hwif)
{
u8 base = hwif->select_data, config = QD_CONFIG(hwif);
u8 base = (hwif->config_data & 0xff00) >> 8;
u8 config = QD_CONFIG(hwif);

hwif->drives[0].drive_data = QD6500_DEF_DATA;
hwif->drives[1].drive_data = QD6500_DEF_DATA;
Expand All @@ -301,9 +291,10 @@ static void __init qd6500_port_init_devs(ide_hwif_t *hwif)
static void __init qd6580_port_init_devs(ide_hwif_t *hwif)
{
u16 t1, t2;
u8 base = hwif->select_data, config = QD_CONFIG(hwif);
u8 base = (hwif->config_data & 0xff00) >> 8;
u8 config = QD_CONFIG(hwif);

if (QD_CONTROL(hwif) & QD_CONTR_SEC_DISABLED) {
if (hwif->host_flags & IDE_HFLAG_SINGLE) {
t1 = QD6580_DEF_DATA;
t2 = QD6580_DEF_DATA2;
} else
Expand Down Expand Up @@ -370,13 +361,15 @@ static int __init qd_probe(int base)
printk(KERN_DEBUG "qd6500: config=%#x, ID3=%u\n",
config, QD_ID3);

d.host_flags |= IDE_HFLAG_SINGLE;

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

ide_init_port_hw(hwif, &hw[unit]);

qd_setup(hwif, base, config);
hwif->config_data = (base << 8) | config;

hwif->port_init_devs = qd6500_port_init_devs;
hwif->set_pio_mode = qd6500_set_pio_mode;
Expand Down Expand Up @@ -412,13 +405,15 @@ static int __init qd_probe(int base)

printk(KERN_INFO "qd6580: single IDE board\n");

d.host_flags |= IDE_HFLAG_SINGLE;

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

ide_init_port_hw(hwif, &hw[unit]);

qd_setup(hwif, base, config | (control << 8));
hwif->config_data = (base << 8) | config;

hwif->port_init_devs = qd6580_port_init_devs;
hwif->set_pio_mode = qd6580_set_pio_mode;
Expand All @@ -438,7 +433,7 @@ static int __init qd_probe(int base)
hwif = ide_find_port();
if (hwif) {
ide_init_port_hw(hwif, &hw[0]);
qd_setup(hwif, base, config | (control << 8));
hwif->config_data = (base << 8) | config;
hwif->port_init_devs = qd6580_port_init_devs;
hwif->set_pio_mode = qd6580_set_pio_mode;
hwif->selectproc = qd65xx_select;
Expand All @@ -448,7 +443,7 @@ static int __init qd_probe(int base)
mate = ide_find_port();
if (mate) {
ide_init_port_hw(mate, &hw[1]);
qd_setup(mate, base, config | (control << 8));
mate->config_data = (base << 8) | config;
mate->port_init_devs = qd6580_port_init_devs;
mate->set_pio_mode = qd6580_set_pio_mode;
mate->selectproc = qd65xx_select;
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/ide/legacy/qd65xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#define QD_ID3 ((config & QD_CONFIG_ID3)!=0)

#define QD_CONFIG(hwif) ((hwif)->config_data & 0x00ff)
#define QD_CONTROL(hwif) (((hwif)->config_data & 0xff00) >> 8)

#define QD_TIMING(drive) (byte)(((drive)->drive_data) & 0x00ff)
#define QD_TIMREG(drive) (byte)((((drive)->drive_data) & 0xff00) >> 8)
Expand Down

0 comments on commit f73e233

Please sign in to comment.