diff options
Diffstat (limited to 'drivers/ide/ide.c')
-rw-r--r-- | drivers/ide/ide.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index bced02f9f2c3..6cd112cc4af3 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -1239,6 +1239,38 @@ static void ide_port_class_release(struct device *portdev) | |||
1239 | put_device(&hwif->gendev); | 1239 | put_device(&hwif->gendev); |
1240 | } | 1240 | } |
1241 | 1241 | ||
1242 | static unsigned int ide_ignore_cable; | ||
1243 | |||
1244 | static int ide_set_ignore_cable(const char *s, struct kernel_param *kp) | ||
1245 | { | ||
1246 | int i, j = 1; | ||
1247 | |||
1248 | if (sscanf(s, "%d:%d", &i, &j) != 2 && sscanf(s, "%d", &i) != 1) | ||
1249 | return -EINVAL; | ||
1250 | |||
1251 | if (i >= MAX_HWIFS || j < 0 || j > 1) | ||
1252 | return -EINVAL; | ||
1253 | |||
1254 | if (j) | ||
1255 | ide_ignore_cable |= (1 << i); | ||
1256 | else | ||
1257 | ide_ignore_cable &= (1 << i); | ||
1258 | |||
1259 | return 0; | ||
1260 | } | ||
1261 | |||
1262 | module_param_call(ignore_cable, ide_set_ignore_cable, NULL, NULL, 0); | ||
1263 | MODULE_PARM_DESC(ignore_cable, "ignore cable detection"); | ||
1264 | |||
1265 | void ide_port_apply_params(ide_hwif_t *hwif) | ||
1266 | { | ||
1267 | if (ide_ignore_cable & (1 << hwif->index)) { | ||
1268 | printk(KERN_INFO "ide: ignoring cable detection for %s\n", | ||
1269 | hwif->name); | ||
1270 | hwif->cbl = ATA_CBL_PATA40_SHORT; | ||
1271 | } | ||
1272 | } | ||
1273 | |||
1242 | /* | 1274 | /* |
1243 | * This is gets invoked once during initialization, to set *everything* up | 1275 | * This is gets invoked once during initialization, to set *everything* up |
1244 | */ | 1276 | */ |