Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 66121
b: refs/heads/master
c: f212ff2
h: refs/heads/master
i:
  66119: 6bc85b0
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Oct 11, 2007
1 parent 4be1709 commit 1495c62
Show file tree
Hide file tree
Showing 33 changed files with 60 additions and 124 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: 3160d5416f39da9d9221fec7cb9d64399b706bbc
refs/heads/master: f212ff28f08e4ddcef9f25b13463c45cc4204a0c
7 changes: 1 addition & 6 deletions trunk/drivers/ide/arm/icside.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,15 +248,10 @@ static void icside_build_sglist(ide_drive_t *drive, struct request *rq)
* MW1 80 50 50 150 C
* MW2 70 25 25 120 C
*/
static int icside_set_speed(ide_drive_t *drive, u8 xfer_mode)
static int icside_set_speed(ide_drive_t *drive, const u8 xfer_mode)
{
int on = 0, cycle_time = 0, use_dma_info = 0;

/*
* Limit the transfer speed to MW_DMA_2.
*/
xfer_mode = ide_rate_filter(drive, xfer_mode);

switch (xfer_mode) {
case XFER_MW_DMA_2:
cycle_time = 250;
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/ide/cris/ide-cris.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,12 +722,10 @@ static void tune_cris_ide(ide_drive_t *drive, u8 pio)
(void)ide_config_drive_speed(drive, XFER_PIO_0 + pio);
}

static int speed_cris_ide(ide_drive_t *drive, u8 speed)
static int speed_cris_ide(ide_drive_t *drive, const u8 speed)
{
int cyc = 0, dvs = 0, strobe = 0, hold = 0;

speed = ide_rate_filter(drive, speed);

if (speed >= XFER_PIO_0 && speed <= XFER_PIO_4) {
tune_cris_ide(drive, speed - XFER_PIO_0);
return ide_config_drive_speed(drive, speed);
Expand Down
17 changes: 8 additions & 9 deletions trunk/drivers/ide/ide-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ EXPORT_SYMBOL(ide_xfer_verbose);
* TODO: check device PIO capabilities
*/

u8 ide_rate_filter(ide_drive_t *drive, u8 speed)
static u8 ide_rate_filter(ide_drive_t *drive, u8 speed)
{
ide_hwif_t *hwif = drive->hwif;
u8 mode = ide_find_dma_mode(drive, speed);
Expand All @@ -96,8 +96,6 @@ u8 ide_rate_filter(ide_drive_t *drive, u8 speed)
return min(speed, mode);
}

EXPORT_SYMBOL(ide_rate_filter);

int ide_use_fast_pio(ide_drive_t *drive)
{
struct hd_driveid *id = drive->id;
Expand Down Expand Up @@ -364,13 +362,14 @@ void ide_toggle_bounce(ide_drive_t *drive, int on)

int ide_set_xfer_rate(ide_drive_t *drive, u8 rate)
{
#ifndef CONFIG_BLK_DEV_IDEDMA
rate = min(rate, (u8) XFER_PIO_4);
#endif
if(HWIF(drive)->speedproc)
return HWIF(drive)->speedproc(drive, rate);
else
ide_hwif_t *hwif = drive->hwif;

if (hwif->speedproc == NULL)
return -1;

rate = ide_rate_filter(drive, rate);

return hwif->speedproc(drive, rate);
}

static void ide_dump_opcode(ide_drive_t *drive)
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/ide/mips/au1xxx-ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,11 @@ static void auide_tune_drive(ide_drive_t *drive, byte pio)
ide_config_drive_speed(drive, speed);
}

static int auide_tune_chipset (ide_drive_t *drive, u8 speed)
static int auide_tune_chipset(ide_drive_t *drive, const u8 speed)
{
int mem_sttime;
int mem_stcfg;

speed = ide_rate_filter(drive, speed);

mem_sttime = 0;
mem_stcfg = au_readl(MEM_STCFG2);

Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/ide/pci/aec62xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,11 @@ static u8 pci_bus_clock_list_ultra (u8 speed, struct chipset_bus_clock_list_entr
return chipset_table->ultra_settings;
}

static int aec6210_tune_chipset (ide_drive_t *drive, u8 xferspeed)
static int aec6210_tune_chipset(ide_drive_t *drive, const u8 speed)
{
ide_hwif_t *hwif = HWIF(drive);
struct pci_dev *dev = hwif->pci_dev;
u16 d_conf = 0;
u8 speed = ide_rate_filter(drive, xferspeed);
u8 ultra = 0, ultra_conf = 0;
u8 tmp0 = 0, tmp1 = 0, tmp2 = 0;
unsigned long flags;
Expand All @@ -115,11 +114,10 @@ static int aec6210_tune_chipset (ide_drive_t *drive, u8 xferspeed)
return(ide_config_drive_speed(drive, speed));
}

static int aec6260_tune_chipset (ide_drive_t *drive, u8 xferspeed)
static int aec6260_tune_chipset(ide_drive_t *drive, const u8 speed)
{
ide_hwif_t *hwif = HWIF(drive);
struct pci_dev *dev = hwif->pci_dev;
u8 speed = ide_rate_filter(drive, xferspeed);
u8 unit = (drive->select.b.unit & 0x01);
u8 tmp1 = 0, tmp2 = 0;
u8 ultra = 0, drive_conf = 0, ultra_conf = 0;
Expand Down
7 changes: 3 additions & 4 deletions trunk/drivers/ide/pci/alim15x3.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,17 +409,16 @@ static u8 ali_udma_filter(ide_drive_t *drive)
/**
* ali15x3_tune_chipset - set up chipset/drive for new speed
* @drive: drive to configure for
* @xferspeed: desired speed
* @speed: desired speed
*
* Configure the hardware for the desired IDE transfer mode.
* We also do the needed drive configuration through helpers
*/
static int ali15x3_tune_chipset (ide_drive_t *drive, u8 xferspeed)

static int ali15x3_tune_chipset(ide_drive_t *drive, const u8 speed)
{
ide_hwif_t *hwif = HWIF(drive);
struct pci_dev *dev = hwif->pci_dev;
u8 speed = ide_rate_filter(drive, xferspeed);
u8 speed1 = speed;
u8 unit = (drive->select.b.unit & 0x01);
u8 tmpbyte = 0x00;
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/ide/pci/amd74xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,12 @@ static void amd_set_speed(struct pci_dev *dev, unsigned char dn, struct ide_timi
* by upper layers.
*/

static int amd_set_drive(ide_drive_t *drive, u8 speed)
static int amd_set_drive(ide_drive_t *drive, const u8 speed)
{
ide_drive_t *peer = HWIF(drive)->drives + (~drive->dn & 1);
struct ide_timing t, p;
int T, UT;

speed = ide_rate_filter(drive, speed);

if (speed != XFER_PIO_SLOW)
ide_config_drive_speed(drive, speed);

Expand Down
8 changes: 3 additions & 5 deletions trunk/drivers/ide/pci/atiixp.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,23 +163,21 @@ static void atiixp_tuneproc(ide_drive_t *drive, u8 pio)
/**
* atiixp_tune_chipset - tune a ATIIXP interface
* @drive: IDE drive to tune
* @xferspeed: speed to configure
* @speed: speed to configure
*
* Set a ATIIXP interface channel to the desired speeds. This involves
* requires the right timing data into the ATIIXP configuration space
* then setting the drive parameters appropriately
*/

static int atiixp_speedproc(ide_drive_t *drive, u8 xferspeed)
static int atiixp_speedproc(ide_drive_t *drive, const u8 speed)
{
struct pci_dev *dev = drive->hwif->pci_dev;
unsigned long flags;
int timing_shift = (drive->dn & 2) ? 16 : 0 + (drive->dn & 1) ? 0 : 8;
u32 tmp32;
u16 tmp16;
u8 speed, pio;

speed = ide_rate_filter(drive, xferspeed);
u8 pio;

if (speed >= XFER_PIO_0 && speed <= XFER_PIO_4) {
atiixp_tune_pio(drive, speed - XFER_PIO_0);
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/ide/pci/cmd64x.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,15 +288,13 @@ static void cmd64x_tune_drive (ide_drive_t *drive, u8 pio)
(void) ide_config_drive_speed(drive, XFER_PIO_0 + pio);
}

static int cmd64x_tune_chipset (ide_drive_t *drive, u8 speed)
static int cmd64x_tune_chipset(ide_drive_t *drive, const u8 speed)
{
ide_hwif_t *hwif = HWIF(drive);
struct pci_dev *dev = hwif->pci_dev;
u8 unit = drive->dn & 0x01;
u8 regU = 0, pciU = hwif->channel ? UDIDETCR1 : UDIDETCR0;

speed = ide_rate_filter(drive, speed);

if (speed >= XFER_SW_DMA_0) {
(void) pci_read_config_byte(dev, pciU, &regU);
regU &= ~(unit ? 0xCA : 0x35);
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/ide/pci/cs5520.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,15 @@ static struct pio_clocks cs5520_pio_clocks[]={
{1, 2, 1}
};

static int cs5520_tune_chipset(ide_drive_t *drive, u8 xferspeed)
static int cs5520_tune_chipset(ide_drive_t *drive, const u8 speed)
{
ide_hwif_t *hwif = HWIF(drive);
struct pci_dev *pdev = hwif->pci_dev;
u8 speed = ide_rate_filter(drive, xferspeed);
int pio = speed;
u8 reg;
int controller = drive->dn > 1 ? 1 : 0;
int error;

switch(speed)
{
case XFER_PIO_4:
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/ide/pci/cs5530.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,11 @@ static int cs5530_config_dma(ide_drive_t *drive)
return 1;
}

static int cs5530_tune_chipset(ide_drive_t *drive, u8 mode)
static int cs5530_tune_chipset(ide_drive_t *drive, const u8 mode)
{
unsigned long basereg;
unsigned int reg, timings = 0;

mode = ide_rate_filter(drive, mode);

/*
* Tell the drive to switch to the new mode; abort on failure.
*/
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/ide/pci/cs5535.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static unsigned int cs5535_udma_timings[5] =
*
* cs5535_set_speed() configures the chipset to a new speed.
*/
static void cs5535_set_speed(ide_drive_t *drive, u8 speed)
static void cs5535_set_speed(ide_drive_t *drive, const u8 speed)
{

u32 reg = 0, dummy;
Expand Down Expand Up @@ -141,7 +141,6 @@ static void cs5535_set_speed(ide_drive_t *drive, u8 speed)
*/
static int cs5535_set_drive(ide_drive_t *drive, u8 speed)
{
speed = ide_rate_filter(drive, speed);
ide_config_drive_speed(drive, speed);
cs5535_set_speed(drive, speed);

Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/ide/pci/hpt34x.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@

#define HPT343_DEBUG_DRIVE_INFO 0

static int hpt34x_tune_chipset (ide_drive_t *drive, u8 xferspeed)
static int hpt34x_tune_chipset(ide_drive_t *drive, const u8 speed)
{
struct pci_dev *dev = HWIF(drive)->pci_dev;
u8 speed = ide_rate_filter(drive, xferspeed);
u32 reg1= 0, tmp1 = 0, reg2 = 0, tmp2 = 0;
u8 hi_speed, lo_speed;

Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/ide/pci/hpt366.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,12 +600,11 @@ static u32 get_speed_setting(u8 speed, struct hpt_info *info)
return (*info->settings)[i];
}

static int hpt36x_tune_chipset(ide_drive_t *drive, u8 xferspeed)
static int hpt36x_tune_chipset(ide_drive_t *drive, const u8 speed)
{
ide_hwif_t *hwif = HWIF(drive);
struct pci_dev *dev = hwif->pci_dev;
struct hpt_info *info = pci_get_drvdata(dev);
u8 speed = ide_rate_filter(drive, xferspeed);
u8 itr_addr = drive->dn ? 0x44 : 0x40;
u32 old_itr = 0;
u32 itr_mask, new_itr;
Expand All @@ -628,12 +627,11 @@ static int hpt36x_tune_chipset(ide_drive_t *drive, u8 xferspeed)
return ide_config_drive_speed(drive, speed);
}

static int hpt37x_tune_chipset(ide_drive_t *drive, u8 xferspeed)
static int hpt37x_tune_chipset(ide_drive_t *drive, const u8 speed)
{
ide_hwif_t *hwif = HWIF(drive);
struct pci_dev *dev = hwif->pci_dev;
struct hpt_info *info = pci_get_drvdata(dev);
u8 speed = ide_rate_filter(drive, xferspeed);
u8 itr_addr = 0x40 + (drive->dn * 4);
u32 old_itr = 0;
u32 itr_mask, new_itr;
Expand Down
10 changes: 3 additions & 7 deletions trunk/drivers/ide/pci/it8213.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,20 +115,16 @@ static void it8213_tuneproc(ide_drive_t *drive, u8 pio)
/**
* it8213_tune_chipset - set controller timings
* @drive: Drive to set up
* @xferspeed: speed we want to achieve
* @speed: speed we want to achieve
*
* Tune the ITE chipset for the desired mode. If we can't achieve
* the desired mode then tune for a lower one, but ultimately
* make the thing work.
* Tune the ITE chipset for the desired mode.
*/

static int it8213_tune_chipset (ide_drive_t *drive, u8 xferspeed)
static int it8213_tune_chipset(ide_drive_t *drive, const u8 speed)
{

ide_hwif_t *hwif = HWIF(drive);
struct pci_dev *dev = hwif->pci_dev;
u8 maslave = 0x40;
u8 speed = ide_rate_filter(drive, xferspeed);
int a_speed = 3 << (drive->dn * 4);
int u_flag = 1 << drive->dn;
int v_flag = 0x01 << drive->dn;
Expand Down
10 changes: 3 additions & 7 deletions trunk/drivers/ide/pci/it821x.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,23 +405,19 @@ static int it821x_dma_end(ide_drive_t *drive)
return ret;
}


/**
* it821x_tune_chipset - set controller timings
* @drive: Drive to set up
* @xferspeed: speed we want to achieve
* @speed: speed we want to achieve
*
* Tune the ITE chipset for the desired mode. If we can't achieve
* the desired mode then tune for a lower one, but ultimately
* make the thing work.
* Tune the ITE chipset for the desired mode.
*/

static int it821x_tune_chipset (ide_drive_t *drive, byte xferspeed)
static int it821x_tune_chipset(ide_drive_t *drive, const u8 speed)
{

ide_hwif_t *hwif = drive->hwif;
struct it821x_dev *itdev = ide_get_hwifdata(hwif);
u8 speed = ide_rate_filter(drive, xferspeed);

switch (speed) {
case XFER_PIO_4:
Expand Down
9 changes: 3 additions & 6 deletions trunk/drivers/ide/pci/jmicron.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,14 @@ static void jmicron_tuneproc(ide_drive_t *drive, u8 pio)
/**
* jmicron_tune_chipset - set controller timings
* @drive: Drive to set up
* @xferspeed: speed we want to achieve
* @speed: speed we want to achieve
*
* As the JMicron snoops for timings all we actually need to do is
* make sure we don't set an invalid mode. We do need to honour
* the cable detect here.
* set the transfer mode on the device.
*/

static int jmicron_tune_chipset (ide_drive_t *drive, byte xferspeed)
static int jmicron_tune_chipset(ide_drive_t *drive, const u8 speed)
{
u8 speed = ide_rate_filter(drive, xferspeed);

return ide_config_drive_speed(drive, speed);
}

Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/ide/pci/pdc202xx_new.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,12 @@ static struct udma_timing {
{ 0x1a, 0x01, 0xcb }, /* UDMA mode 6 */
};

static int pdcnew_tune_chipset(ide_drive_t *drive, u8 speed)
static int pdcnew_tune_chipset(ide_drive_t *drive, const u8 speed)
{
ide_hwif_t *hwif = HWIF(drive);
u8 adj = (drive->dn & 1) ? 0x08 : 0x00;
int err;

speed = ide_rate_filter(drive, speed);

/*
* Issue SETFEATURES_XFER to the drive first. PDC202xx hardware will
* automatically set the timing registers based on 100 MHz PLL output.
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/ide/pci/pdc202xx_old.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,11 @@ static const char *pdc_quirk_drives[] = {

static void pdc_old_disable_66MHz_clock(ide_hwif_t *);

static int pdc202xx_tune_chipset (ide_drive_t *drive, u8 xferspeed)
static int pdc202xx_tune_chipset(ide_drive_t *drive, const u8 speed)
{
ide_hwif_t *hwif = HWIF(drive);
struct pci_dev *dev = hwif->pci_dev;
u8 drive_pci = 0x60 + (drive->dn << 2);
u8 speed = ide_rate_filter(drive, xferspeed);

u8 AP = 0, BP = 0, CP = 0;
u8 TA = 0, TB = 0, TC = 0;
Expand Down
Loading

0 comments on commit 1495c62

Please sign in to comment.