diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-07-09 17:17:58 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-07-09 17:17:58 -0400 |
commit | 49521f97ccd3c2bf6e71a91cea8fe65d170fa4fb (patch) | |
tree | f61c34da6092f2f1a97a78da567afc59ad40850b /drivers/ide/pci/jmicron.c | |
parent | 75b1d97535327d0428c6bffd9d5407e65546fd5d (diff) |
ide: add short cables support
This patch allows users to override both host and device side cable detection
with "ideX=ata66" kernel parameter. Thanks to this it should be now possible
to use UDMA > 2 modes on systems (laptops mainly) which use short 40-pin cable
instead of 80-pin one.
Next patches add automatic detection of some systems using short cables.
Changes:
* Rename hwif->udma_four to hwif->cbl and make it u8.
* Convert all existing users accordingly (use ATA_CBL_* defines while at it).
* Add ATA_CBL_PATA40_SHORT support to ide-iops.c:eighty_ninty_three().
* Use ATA_CBL_PATA40_SHORT for "ideX=ata66" kernel parameter.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Reviewed-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Diffstat (limited to 'drivers/ide/pci/jmicron.c')
-rw-r--r-- | drivers/ide/pci/jmicron.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/ide/pci/jmicron.c b/drivers/ide/pci/jmicron.c index 76ed25147229..a6008f63e71e 100644 --- a/drivers/ide/pci/jmicron.c +++ b/drivers/ide/pci/jmicron.c | |||
@@ -25,10 +25,10 @@ typedef enum { | |||
25 | * ata66_jmicron - Cable check | 25 | * ata66_jmicron - Cable check |
26 | * @hwif: IDE port | 26 | * @hwif: IDE port |
27 | * | 27 | * |
28 | * Return 1 if the cable is 80pin | 28 | * Returns the cable type. |
29 | */ | 29 | */ |
30 | 30 | ||
31 | static int __devinit ata66_jmicron(ide_hwif_t *hwif) | 31 | static u8 __devinit ata66_jmicron(ide_hwif_t *hwif) |
32 | { | 32 | { |
33 | struct pci_dev *pdev = hwif->pci_dev; | 33 | struct pci_dev *pdev = hwif->pci_dev; |
34 | 34 | ||
@@ -70,16 +70,17 @@ static int __devinit ata66_jmicron(ide_hwif_t *hwif) | |||
70 | { | 70 | { |
71 | case PORT_PATA0: | 71 | case PORT_PATA0: |
72 | if (control & (1 << 3)) /* 40/80 pin primary */ | 72 | if (control & (1 << 3)) /* 40/80 pin primary */ |
73 | return 0; | 73 | return ATA_CBL_PATA40; |
74 | return 1; | 74 | return ATA_CBL_PATA80; |
75 | case PORT_PATA1: | 75 | case PORT_PATA1: |
76 | if (control5 & (1 << 19)) /* 40/80 pin secondary */ | 76 | if (control5 & (1 << 19)) /* 40/80 pin secondary */ |
77 | return 0; | 77 | return ATA_CBL_PATA40; |
78 | return 1; | 78 | return ATA_CBL_PATA80; |
79 | case PORT_SATA: | 79 | case PORT_SATA: |
80 | break; | 80 | break; |
81 | } | 81 | } |
82 | return 1; /* Avoid bogus "control reaches end of non-void function" */ | 82 | /* Avoid bogus "control reaches end of non-void function" */ |
83 | return ATA_CBL_PATA80; | ||
83 | } | 84 | } |
84 | 85 | ||
85 | static void jmicron_tuneproc (ide_drive_t *drive, byte mode_wanted) | 86 | static void jmicron_tuneproc (ide_drive_t *drive, byte mode_wanted) |
@@ -159,8 +160,9 @@ static void __devinit init_hwif_jmicron(ide_hwif_t *hwif) | |||
159 | hwif->mwdma_mask = 0x07; | 160 | hwif->mwdma_mask = 0x07; |
160 | 161 | ||
161 | hwif->ide_dma_check = &jmicron_config_drive_for_dma; | 162 | hwif->ide_dma_check = &jmicron_config_drive_for_dma; |
162 | if (!(hwif->udma_four)) | 163 | |
163 | hwif->udma_four = ata66_jmicron(hwif); | 164 | if (hwif->cbl != ATA_CBL_PATA40_SHORT) |
165 | hwif->cbl = ata66_jmicron(hwif); | ||
164 | 166 | ||
165 | hwif->autodma = 1; | 167 | hwif->autodma = 1; |
166 | hwif->drives[0].autodma = hwif->autodma; | 168 | hwif->drives[0].autodma = hwif->autodma; |