aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/legacy/ht6560b.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-02 13:56:40 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-02 13:56:40 -0500
commit1f2cf8b0014fdfa3141449b508aca25e78c078a7 (patch)
tree2bbed83a1c7f5fc037cd64c2af108f081aff4c65 /drivers/ide/legacy/ht6560b.c
parent807b90d0be23b8d088d4369b02539dada70f03f4 (diff)
ide: add ->port_init_devs method to ide_hwif_t
* Add ->port_init_devs method to ide_hwif_t for a host specific initialization of devices on a port. Call the new method from ide_port_init_devices(). * Convert ht6560b, qd65xx and opti621 host drivers to use the new ->port_init_devs method. There should be no functionality changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/legacy/ht6560b.c')
-rw-r--r--drivers/ide/legacy/ht6560b.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c
index a89cd80d8124..02d12c74764a 100644
--- a/drivers/ide/legacy/ht6560b.c
+++ b/drivers/ide/legacy/ht6560b.c
@@ -300,6 +300,18 @@ static void ht6560b_set_pio_mode(ide_drive_t *drive, const u8 pio)
300#endif 300#endif
301} 301}
302 302
303static void __init ht6560b_port_init_devs(ide_hwif_t *hwif)
304{
305 /* Setting default configurations for drives. */
306 int t = (HT_CONFIG_DEFAULT << 8) | HT_TIMING_DEFAULT;
307
308 if (hwif->channel)
309 t |= (HT_SECONDARY_IF << 8);
310
311 hwif->drives[0].drive_data = t;
312 hwif->drives[1].drive_data = t;
313}
314
303int probe_ht6560b = 0; 315int probe_ht6560b = 0;
304 316
305module_param_named(probe, probe_ht6560b, bool, 0); 317module_param_named(probe, probe_ht6560b, bool, 0);
@@ -318,7 +330,6 @@ static int __init ht6560b_init(void)
318{ 330{
319 ide_hwif_t *hwif, *mate; 331 ide_hwif_t *hwif, *mate;
320 static u8 idx[4] = { 0, 1, 0xff, 0xff }; 332 static u8 idx[4] = { 0, 1, 0xff, 0xff };
321 int t;
322 333
323 if (probe_ht6560b == 0) 334 if (probe_ht6560b == 0)
324 return -ENODEV; 335 return -ENODEV;
@@ -343,17 +354,8 @@ static int __init ht6560b_init(void)
343 mate->selectproc = &ht6560b_selectproc; 354 mate->selectproc = &ht6560b_selectproc;
344 mate->set_pio_mode = &ht6560b_set_pio_mode; 355 mate->set_pio_mode = &ht6560b_set_pio_mode;
345 356
346 /* 357 hwif->port_init_devs = ht6560b_port_init_devs;
347 * Setting default configurations for drives 358 mate->port_init_devs = ht6560b_port_init_devs;
348 */
349 t = (HT_CONFIG_DEFAULT << 8);
350 t |= HT_TIMING_DEFAULT;
351 hwif->drives[0].drive_data = t;
352 hwif->drives[1].drive_data = t;
353
354 t |= (HT_SECONDARY_IF << 8);
355 mate->drives[0].drive_data = t;
356 mate->drives[1].drive_data = t;
357 359
358 ide_device_add(idx, &ht6560b_port_info); 360 ide_device_add(idx, &ht6560b_port_info);
359 361