diff options
author | TOMARI Hisanobu <posco.grubb@gmail.com> | 2009-03-31 14:15:34 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-31 14:15:34 -0400 |
commit | a9d5a97fa3828e7cbc577805eba3d0a0d35dd5a0 (patch) | |
tree | c415f1f3099efa63ac872044dec25b2ea2c7fcc3 /drivers | |
parent | fdd88f0af616db59a6a36bdf0185181d2b779f53 (diff) |
ide-pmac: IDE cable detection on Apple PowerBook
As IDE cable used on Apple PowerBook/iBook laptops are always of "Short 40"
type when the firmware says it's 80 conductor one, the cable detection should
return ATA_CBL_PATA40_SHORT on those machines. This enables to automatically
use UDMA5 even with drives that doesn't correctly detect those cables on Apple
laptops.
Signed-off-by: TOMARI Hisanobu <posco.grubb@gmail.com>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: benh@kernel.crashing.org
[bart: beautify patch description]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ide/pmac.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c index 24ce1f805cd7..052b9bf1f8fb 100644 --- a/drivers/ide/pmac.c +++ b/drivers/ide/pmac.c | |||
@@ -919,10 +919,18 @@ static u8 pmac_ide_cable_detect(ide_hwif_t *hwif) | |||
919 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); | 919 | (pmac_ide_hwif_t *)dev_get_drvdata(hwif->gendev.parent); |
920 | struct device_node *np = pmif->node; | 920 | struct device_node *np = pmif->node; |
921 | const char *cable = of_get_property(np, "cable-type", NULL); | 921 | const char *cable = of_get_property(np, "cable-type", NULL); |
922 | struct device_node *root = of_find_node_by_path("/"); | ||
923 | const char *model = of_get_property(root, "model", NULL); | ||
922 | 924 | ||
923 | /* Get cable type from device-tree. */ | 925 | /* Get cable type from device-tree. */ |
924 | if (cable && !strncmp(cable, "80-", 3)) | 926 | if (cable && !strncmp(cable, "80-", 3)) { |
925 | return ATA_CBL_PATA80; | 927 | /* Some drives fail to detect 80c cable in PowerBook */ |
928 | /* These machine use proprietary short IDE cable anyway */ | ||
929 | if (!strncmp(model, "PowerBook", 9)) | ||
930 | return ATA_CBL_PATA40_SHORT; | ||
931 | else | ||
932 | return ATA_CBL_PATA80; | ||
933 | } | ||
926 | 934 | ||
927 | /* | 935 | /* |
928 | * G5's seem to have incorrect cable type in device-tree. | 936 | * G5's seem to have incorrect cable type in device-tree. |