@@ -404,8 +404,6 @@ kauai_lookup_timing(struct kauai_timing* table, int cycle_time)
404404#define IDE_WAKEUP_DELAY (1*HZ)
405405
406406static int pmac_ide_init_dma (ide_hwif_t * , const struct ide_port_info * );
407- static void pmac_ide_selectproc (ide_drive_t * drive );
408- static void pmac_ide_kauai_selectproc (ide_drive_t * drive );
409407
410408#define PMAC_IDE_REG (x ) \
411409 ((void __iomem *)((drive)->hwif->io_ports.data_addr + (x)))
@@ -415,8 +413,7 @@ static void pmac_ide_kauai_selectproc(ide_drive_t *drive);
415413 * timing register when selecting that unit. This version is for
416414 * ASICs with a single timing register
417415 */
418- static void
419- pmac_ide_selectproc (ide_drive_t * drive )
416+ static void pmac_ide_apply_timings (ide_drive_t * drive )
420417{
421418 ide_hwif_t * hwif = drive -> hwif ;
422419 pmac_ide_hwif_t * pmif =
@@ -434,8 +431,7 @@ pmac_ide_selectproc(ide_drive_t *drive)
434431 * timing register when selecting that unit. This version is for
435432 * ASICs with a dual timing register (Kauai)
436433 */
437- static void
438- pmac_ide_kauai_selectproc (ide_drive_t * drive )
434+ static void pmac_ide_kauai_apply_timings (ide_drive_t * drive )
439435{
440436 ide_hwif_t * hwif = drive -> hwif ;
441437 pmac_ide_hwif_t * pmif =
@@ -464,9 +460,25 @@ pmac_ide_do_update_timings(ide_drive_t *drive)
464460 if (pmif -> kind == controller_sh_ata6 ||
465461 pmif -> kind == controller_un_ata6 ||
466462 pmif -> kind == controller_k2_ata6 )
467- pmac_ide_kauai_selectproc (drive );
463+ pmac_ide_kauai_apply_timings (drive );
468464 else
469- pmac_ide_selectproc (drive );
465+ pmac_ide_apply_timings (drive );
466+ }
467+
468+ static void pmac_dev_select (ide_drive_t * drive )
469+ {
470+ pmac_ide_apply_timings (drive );
471+
472+ writeb (drive -> select | ATA_DEVICE_OBS ,
473+ (void __iomem * )drive -> hwif -> io_ports .device_addr );
474+ }
475+
476+ static void pmac_kauai_dev_select (ide_drive_t * drive )
477+ {
478+ pmac_ide_kauai_apply_timings (drive );
479+
480+ writeb (drive -> select | ATA_DEVICE_OBS ,
481+ (void __iomem * )drive -> hwif -> io_ports .device_addr );
470482}
471483
472484static void pmac_exec_command (ide_hwif_t * hwif , u8 cmd )
@@ -947,34 +959,39 @@ static const struct ide_tp_ops pmac_tp_ops = {
947959 .read_altstatus = ide_read_altstatus ,
948960 .write_devctl = pmac_write_devctl ,
949961
962+ .dev_select = pmac_dev_select ,
950963 .tf_load = ide_tf_load ,
951964 .tf_read = ide_tf_read ,
952965
953966 .input_data = ide_input_data ,
954967 .output_data = ide_output_data ,
955968};
956969
957- static const struct ide_port_ops pmac_ide_ata6_port_ops = {
958- .init_dev = pmac_ide_init_dev ,
959- .set_pio_mode = pmac_ide_set_pio_mode ,
960- .set_dma_mode = pmac_ide_set_dma_mode ,
961- .selectproc = pmac_ide_kauai_selectproc ,
962- .cable_detect = pmac_ide_cable_detect ,
970+ static const struct ide_tp_ops pmac_ata6_tp_ops = {
971+ .exec_command = pmac_exec_command ,
972+ .read_status = ide_read_status ,
973+ .read_altstatus = ide_read_altstatus ,
974+ .write_devctl = pmac_write_devctl ,
975+
976+ .dev_select = pmac_kauai_dev_select ,
977+ .tf_load = ide_tf_load ,
978+ .tf_read = ide_tf_read ,
979+
980+ .input_data = ide_input_data ,
981+ .output_data = ide_output_data ,
963982};
964983
965984static const struct ide_port_ops pmac_ide_ata4_port_ops = {
966985 .init_dev = pmac_ide_init_dev ,
967986 .set_pio_mode = pmac_ide_set_pio_mode ,
968987 .set_dma_mode = pmac_ide_set_dma_mode ,
969- .selectproc = pmac_ide_selectproc ,
970988 .cable_detect = pmac_ide_cable_detect ,
971989};
972990
973991static const struct ide_port_ops pmac_ide_port_ops = {
974992 .init_dev = pmac_ide_init_dev ,
975993 .set_pio_mode = pmac_ide_set_pio_mode ,
976994 .set_dma_mode = pmac_ide_set_dma_mode ,
977- .selectproc = pmac_ide_selectproc ,
978995};
979996
980997static const struct ide_dma_ops pmac_dma_ops ;
@@ -1011,15 +1028,18 @@ static int __devinit pmac_ide_setup_device(pmac_ide_hwif_t *pmif, hw_regs_t *hw)
10111028 pmif -> broken_dma = pmif -> broken_dma_warn = 0 ;
10121029 if (of_device_is_compatible (np , "shasta-ata" )) {
10131030 pmif -> kind = controller_sh_ata6 ;
1014- d .port_ops = & pmac_ide_ata6_port_ops ;
1031+ d .tp_ops = & pmac_ata6_tp_ops ;
1032+ d .port_ops = & pmac_ide_ata4_port_ops ;
10151033 d .udma_mask = ATA_UDMA6 ;
10161034 } else if (of_device_is_compatible (np , "kauai-ata" )) {
10171035 pmif -> kind = controller_un_ata6 ;
1018- d .port_ops = & pmac_ide_ata6_port_ops ;
1036+ d .tp_ops = & pmac_ata6_tp_ops ;
1037+ d .port_ops = & pmac_ide_ata4_port_ops ;
10191038 d .udma_mask = ATA_UDMA5 ;
10201039 } else if (of_device_is_compatible (np , "K2-UATA" )) {
10211040 pmif -> kind = controller_k2_ata6 ;
1022- d .port_ops = & pmac_ide_ata6_port_ops ;
1041+ d .tp_ops = & pmac_ata6_tp_ops ;
1042+ d .port_ops = & pmac_ide_ata4_port_ops ;
10231043 d .udma_mask = ATA_UDMA5 ;
10241044 } else if (of_device_is_compatible (np , "keylargo-ata" )) {
10251045 if (strcmp (np -> name , "ata-4" ) == 0 ) {
0 commit comments