From 9cd55be4d22376893d2818ce3c0e5706a3d74121 Mon Sep 17 00:00:00 2001 From: Olof Johansson Date: Tue, 4 Dec 2007 14:44:32 -0600 Subject: [POWERPC] pasemi: Move electra-ide to pata_of_platform Move electra-ide glue over to the new pata_of_platform framework, and add the quirks needed to that driver. Signed-off-by: Olof Johansson --- drivers/ata/pata_of_platform.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/ata/pata_of_platform.c b/drivers/ata/pata_of_platform.c index b7bc4e4a0a26..938f48a807eb 100644 --- a/drivers/ata/pata_of_platform.c +++ b/drivers/ata/pata_of_platform.c @@ -34,11 +34,20 @@ static int __devinit pata_of_platform_probe(struct of_device *ofdev, return -EINVAL; } - ret = of_address_to_resource(dn, 1, &ctl_res); - if (ret) { - dev_err(&ofdev->dev, "can't get CTL address from " - "device tree\n"); - return -EINVAL; + if (of_device_is_compatible(dn, "electra-ide")) { + /* Altstatus is really at offset 0x3f6 from the primary window + * on electra-ide. Adjust ctl_res and io_res accordingly. + */ + ctl_res = io_res; + ctl_res.start = ctl_res.start+0x3f6; + io_res.end = ctl_res.start-1; + } else { + ret = of_address_to_resource(dn, 1, &ctl_res); + if (ret) { + dev_err(&ofdev->dev, "can't get CTL address from " + "device tree\n"); + return -EINVAL; + } } ret = of_irq_to_resource(dn, 0, &irq_res); @@ -76,6 +85,7 @@ static int __devexit pata_of_platform_remove(struct of_device *ofdev) static struct of_device_id pata_of_platform_match[] = { { .compatible = "ata-generic", }, + { .compatible = "electra-ide", }, {}, }; MODULE_DEVICE_TABLE(of, pata_of_platform_match); -- cgit v1.2.3