mirror of https://gitee.com/openkylin/linux.git
cmd640: convert to use ide_timing_find_mode()
There should be no functional changes caused by this patch. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This commit is contained in:
parent
288911af12
commit
17b500de0a
|
@ -329,6 +329,7 @@ config BLK_DEV_PLATFORM
|
||||||
config BLK_DEV_CMD640
|
config BLK_DEV_CMD640
|
||||||
tristate "CMD640 chipset bugfix/support"
|
tristate "CMD640 chipset bugfix/support"
|
||||||
depends on X86
|
depends on X86
|
||||||
|
select IDE_TIMINGS
|
||||||
---help---
|
---help---
|
||||||
The CMD-Technologies CMD640 IDE chip is used on many common 486 and
|
The CMD-Technologies CMD640 IDE chip is used on many common 486 and
|
||||||
Pentium motherboards, usually in combination with a "Neptune" or
|
Pentium motherboards, usually in combination with a "Neptune" or
|
||||||
|
|
|
@ -521,6 +521,7 @@ static void program_drive_counts(ide_drive_t *drive, unsigned int index)
|
||||||
static void cmd640_set_mode(ide_drive_t *drive, unsigned int index,
|
static void cmd640_set_mode(ide_drive_t *drive, unsigned int index,
|
||||||
u8 pio_mode, unsigned int cycle_time)
|
u8 pio_mode, unsigned int cycle_time)
|
||||||
{
|
{
|
||||||
|
struct ide_timing *t;
|
||||||
int setup_time, active_time, recovery_time, clock_time;
|
int setup_time, active_time, recovery_time, clock_time;
|
||||||
u8 setup_count, active_count, recovery_count, recovery_count2, cycle_count;
|
u8 setup_count, active_count, recovery_count, recovery_count2, cycle_count;
|
||||||
int bus_speed;
|
int bus_speed;
|
||||||
|
@ -532,8 +533,11 @@ static void cmd640_set_mode(ide_drive_t *drive, unsigned int index,
|
||||||
|
|
||||||
if (pio_mode > 5)
|
if (pio_mode > 5)
|
||||||
pio_mode = 5;
|
pio_mode = 5;
|
||||||
setup_time = ide_pio_timings[pio_mode].setup_time;
|
|
||||||
active_time = ide_pio_timings[pio_mode].active_time;
|
t = ide_timing_find_mode(XFER_PIO_0 + pio_mode);
|
||||||
|
setup_time = t->setup;
|
||||||
|
active_time = t->active;
|
||||||
|
|
||||||
recovery_time = cycle_time - (setup_time + active_time);
|
recovery_time = cycle_time - (setup_time + active_time);
|
||||||
clock_time = 1000 / bus_speed;
|
clock_time = 1000 / bus_speed;
|
||||||
cycle_count = DIV_ROUND_UP(cycle_time, clock_time);
|
cycle_count = DIV_ROUND_UP(cycle_time, clock_time);
|
||||||
|
|
Loading…
Reference in New Issue