Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 8389
b: refs/heads/master
c: 2665b89
h: refs/heads/master
i:
  8387: ebb3e3b
v: v3
  • Loading branch information
Clemens Buchacher authored and Linus Torvalds committed Sep 10, 2005
1 parent 5581faa commit 6db7701
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 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: ecec4cb7a9df5f61fe00710d2f2c69ce9a3b1d40
refs/heads/master: 2665b891c42ef67eb4cb51d665b523892f992749
25 changes: 12 additions & 13 deletions trunk/drivers/ide/ide-timing.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
*/

#include <linux/kernel.h>
#include <linux/hdreg.h>

#define XFER_PIO_5 0x0d
Expand Down Expand Up @@ -96,11 +97,9 @@ static struct ide_timing ide_timing[] = {
#define IDE_TIMING_UDMA 0x80
#define IDE_TIMING_ALL 0xff

#define MIN(a,b) ((a)<(b)?(a):(b))
#define MAX(a,b) ((a)>(b)?(a):(b))
#define FIT(v,min,max) MAX(MIN(v,max),min)
#define ENOUGH(v,unit) (((v)-1)/(unit)+1)
#define EZ(v,unit) ((v)?ENOUGH(v,unit):0)
#define FIT(v,vmin,vmax) max_t(short,min_t(short,v,vmax),vmin)
#define ENOUGH(v,unit) (((v)-1)/(unit)+1)
#define EZ(v,unit) ((v)?ENOUGH(v,unit):0)

#define XFER_MODE 0xf0
#define XFER_UDMA_133 0x48
Expand Down Expand Up @@ -188,14 +187,14 @@ static void ide_timing_quantize(struct ide_timing *t, struct ide_timing *q, int

static void ide_timing_merge(struct ide_timing *a, struct ide_timing *b, struct ide_timing *m, unsigned int what)
{
if (what & IDE_TIMING_SETUP ) m->setup = MAX(a->setup, b->setup);
if (what & IDE_TIMING_ACT8B ) m->act8b = MAX(a->act8b, b->act8b);
if (what & IDE_TIMING_REC8B ) m->rec8b = MAX(a->rec8b, b->rec8b);
if (what & IDE_TIMING_CYC8B ) m->cyc8b = MAX(a->cyc8b, b->cyc8b);
if (what & IDE_TIMING_ACTIVE ) m->active = MAX(a->active, b->active);
if (what & IDE_TIMING_RECOVER) m->recover = MAX(a->recover, b->recover);
if (what & IDE_TIMING_CYCLE ) m->cycle = MAX(a->cycle, b->cycle);
if (what & IDE_TIMING_UDMA ) m->udma = MAX(a->udma, b->udma);
if (what & IDE_TIMING_SETUP ) m->setup = max(a->setup, b->setup);
if (what & IDE_TIMING_ACT8B ) m->act8b = max(a->act8b, b->act8b);
if (what & IDE_TIMING_REC8B ) m->rec8b = max(a->rec8b, b->rec8b);
if (what & IDE_TIMING_CYC8B ) m->cyc8b = max(a->cyc8b, b->cyc8b);
if (what & IDE_TIMING_ACTIVE ) m->active = max(a->active, b->active);
if (what & IDE_TIMING_RECOVER) m->recover = max(a->recover, b->recover);
if (what & IDE_TIMING_CYCLE ) m->cycle = max(a->cycle, b->cycle);
if (what & IDE_TIMING_UDMA ) m->udma = max(a->udma, b->udma);
}

static struct ide_timing* ide_timing_find_mode(short speed)
Expand Down

0 comments on commit 6db7701

Please sign in to comment.