projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq
[powerpc.git]
/
drivers
/
ide
/
pci
/
pdc202xx_new.c
diff --git
a/drivers/ide/pci/pdc202xx_new.c
b/drivers/ide/pci/pdc202xx_new.c
index
77a9aaa
..
6ceb25b
100644
(file)
--- a/
drivers/ide/pci/pdc202xx_new.c
+++ b/
drivers/ide/pci/pdc202xx_new.c
@@
-92,26
+92,6
@@
static u8 pdcnew_ratemask(ide_drive_t *drive)
return mode;
}
return mode;
}
-static int check_in_drive_lists(ide_drive_t *drive, const char **list)
-{
- struct hd_driveid *id = drive->id;
-
- if (pdc_quirk_drives == list) {
- while (*list) {
- if (strstr(id->model, *list++)) {
- return 2;
- }
- }
- } else {
- while (*list) {
- if (!strcmp(*list++,id->model)) {
- return 1;
- }
- }
- }
- return 0;
-}
-
/**
* get_indexed_reg - Get indexed register
* @hwif: for the port address
/**
* get_indexed_reg - Get indexed register
* @hwif: for the port address
@@
-121,8
+101,8
@@
static u8 get_indexed_reg(ide_hwif_t *hwif, u8 index)
{
u8 value;
{
u8 value;
-
hwif->OUTB
(index, hwif->dma_vendor1);
- value =
hwif->INB
(hwif->dma_vendor3);
+
outb
(index, hwif->dma_vendor1);
+ value =
inb
(hwif->dma_vendor3);
DBG("index[%02X] value[%02X]\n", index, value);
return value;
DBG("index[%02X] value[%02X]\n", index, value);
return value;
@@
-135,8
+115,8
@@
static u8 get_indexed_reg(ide_hwif_t *hwif, u8 index)
*/
static void set_indexed_reg(ide_hwif_t *hwif, u8 index, u8 value)
{
*/
static void set_indexed_reg(ide_hwif_t *hwif, u8 index, u8 value)
{
-
hwif->OUTB
(index, hwif->dma_vendor1);
-
hwif->OUTB
(value, hwif->dma_vendor3);
+
outb
(index, hwif->dma_vendor1);
+
outb
(value, hwif->dma_vendor3);
DBG("index[%02X] value[%02X]\n", index, value);
}
DBG("index[%02X] value[%02X]\n", index, value);
}
@@
-249,13
+229,6
@@
static int pdcnew_tune_chipset(ide_drive_t *drive, u8 speed)
return err;
}
return err;
}
-/* 0 1 2 3 4 5 6 7 8
- * 960, 480, 390, 300, 240, 180, 120, 90, 60
- * 180, 150, 120, 90, 60
- * DMA_Speed
- * 180, 120, 90, 90, 90, 60, 30
- * 11, 5, 4, 3, 2, 1, 0
- */
static void pdcnew_tune_drive(ide_drive_t *drive, u8 pio)
{
pio = ide_get_best_pio_mode(drive, pio, 4, NULL);
static void pdcnew_tune_drive(ide_drive_t *drive, u8 pio)
{
pio = ide_get_best_pio_mode(drive, pio, 4, NULL);
@@
-308,46
+281,25
@@
static int config_chipset_for_dma(ide_drive_t *drive)
static int pdcnew_config_drive_xfer_rate(ide_drive_t *drive)
{
static int pdcnew_config_drive_xfer_rate(ide_drive_t *drive)
{
- ide_hwif_t *hwif = HWIF(drive);
- struct hd_driveid *id = drive->id;
-
drive->init_speed = 0;
drive->init_speed = 0;
- if (id && (id->capability & 1) && drive->autodma) {
-
- if (ide_use_dma(drive)) {
- if (config_chipset_for_dma(drive))
- return hwif->ide_dma_on(drive);
- }
+ if (ide_use_dma(drive) && config_chipset_for_dma(drive))
+ return 0;
- goto fast_ata_pio;
+ if (ide_use_fast_pio(drive))
+ pdcnew_tune_drive(drive, 255);
- } else if ((id->capability & 8) || (id->field_valid & 2)) {
-fast_ata_pio:
- hwif->tuneproc(drive, 255);
- return hwif->ide_dma_off_quietly(drive);
- }
- /* IORDY not supported */
- return 0;
+ return -1;
}
static int pdcnew_quirkproc(ide_drive_t *drive)
{
}
static int pdcnew_quirkproc(ide_drive_t *drive)
{
- return check_in_drive_lists(drive, pdc_quirk_drives);
-}
-
-static int pdcnew_ide_dma_lostirq(ide_drive_t *drive)
-{
- if (HWIF(drive)->resetproc != NULL)
- HWIF(drive)->resetproc(drive);
- return __ide_dma_lostirq(drive);
-}
+ const char **list, *model = drive->id->model;
-static int pdcnew_ide_dma_timeout(ide_drive_t *drive)
-{
- if (HWIF(drive)->resetproc != NULL)
- HWIF(drive)->resetproc(drive);
- return __ide_dma_timeout(drive);
+ for (list = pdc_quirk_drives; *list != NULL; list++)
+ if (strstr(model, *list) != NULL)
+ return 2;
+ return 0;
}
static void pdcnew_reset(ide_drive_t *drive)
}
static void pdcnew_reset(ide_drive_t *drive)
@@
-599,8
+551,6
@@
static void __devinit init_hwif_pdc202new(ide_hwif_t *hwif)
hwif->err_stops_fifo = 1;
hwif->ide_dma_check = &pdcnew_config_drive_xfer_rate;
hwif->err_stops_fifo = 1;
hwif->ide_dma_check = &pdcnew_config_drive_xfer_rate;
- hwif->ide_dma_lostirq = &pdcnew_ide_dma_lostirq;
- hwif->ide_dma_timeout = &pdcnew_ide_dma_timeout;
if (!hwif->udma_four)
hwif->udma_four = pdcnew_cable_detect(hwif) ? 0 : 1;
if (!hwif->udma_four)
hwif->udma_four = pdcnew_cable_detect(hwif) ? 0 : 1;