On 6/9/05, Mikael Starvik [off-list ref] wrote:
Ok, updated driver and requested include files attached.
Thanks.
The drivers are similar but it would still require many ugly ifdef:s or
similar to combine them. I could of course extract the stuff that is the
same to a common file to make the arch-specific files smaller. These drivers
are rarley touched so I see no major maintanence benefit by combining them.
I still would like to see one driver:
* less maintenance for IDE people
* better readability of ide-v10.c
(IDE specific stuff separated from arch specific stuff)
* good opportunity to cleanup ide-v10.c a bit
this won't require many ugly ifdef's, ie.
#ifdef v10
static void etrax_ide_set_pio(u8 setup, u8 strobe, u8 hold)
{
*R_ATA_CONFIG =
IO_FIELD(R_ATA_CONFIG, enable, 1 ) |
IO_FIELD(R_ATA_CONFIG, dma_strobe, ATA_DMA2_STROBE) |
IO_FIELD(R_ATA_CONFIG, dma_hold, ATA_DMA2_HOLD) |
IO_FIELD(R_ATA_CONFIG, pio_setup, setup) |
IO_FIELD(R_ATA_CONFIG, pio_strobe, strobe) |
IO_FIELD(R_ATA_CONFIG, pio_hold, hold);
}
...
#else
static void etrax_ide_set_pio(u8 setup, u8 strobe, u8 hold)
{
reg_ata_rw_ctrl0 ctrl0 = REG_RD(ata, regi_ata, rw_ctrl0);
ctrl0.pio_setup = setup;
ctrl0.pio_strb = strobe;
ctrl0.pio_hold = hold;
REG_WR(ata, regi_ata, rw_ctrl0, ctrl0);
}
...
#endif
and later just use etrax_ide_set_pio()
Bartlomiej