From: Olof Johansson <olof@lixom•net>
To: Anton Vorontsov <avorontsov@ru•mvista.com>
Cc: Jeff Garzik <jeff@garzik•org>, Arnd Bergmann <arnd@arndb•de>,
linux-ide@vger•kernel.org, linuxppc-dev@ozlabs•org,
Paul Mundt <lethal@linux-sh•org>
Subject: [PATCH] pata_of_platform: Move electra-ide support over to new framework
Date: Tue, 4 Dec 2007 14:44:32 -0600 [thread overview]
Message-ID: <20071204204432.GD8099@lixom.net> (raw)
In-Reply-To: <20071204170442.GA10460@localhost.localdomain>
[POWERPC] Move electra-ide support over to new pata_of_platform framework
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 <olof@lixom•net>
---
I'll remove the electra-ide stuff from arch/powerpc/platforms/pasemi
once this hits a common tree, since otherwise I'd be without IDE until
they converge (i.e. 2.6.25 merge window).
-Olof
diff --git a/drivers/ata/pata_of_platform.c b/drivers/ata/pata_of_platform.c
index 4daf118..3e9675a 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);
next prev parent reply other threads:[~2007-12-04 20:40 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-04 17:04 [PATCH v2 0/4] OF-platform PATA driver Anton Vorontsov
2007-12-04 17:06 ` [PATCH v2 1/4] [libata] pata_platform: make probe and remove functions device type neutral Anton Vorontsov
2007-12-04 20:40 ` Olof Johansson
2007-12-05 15:37 ` Anton Vorontsov
2007-12-04 17:07 ` [PATCH v2 2/4] [libata] pata_of_platform: OF-Platform PATA device driver Anton Vorontsov
2007-12-04 18:48 ` Olof Johansson
2007-12-04 19:49 ` Anton Vorontsov
2007-12-04 20:01 ` Olof Johansson
2007-12-04 20:37 ` Anton Vorontsov
2007-12-04 20:39 ` Olof Johansson
2007-12-05 0:48 ` Paul Mundt
2007-12-05 3:26 ` Olof Johansson
2007-12-05 18:39 ` Scott Wood
2007-12-14 8:23 ` Olof Johansson
2007-12-14 16:09 ` Scott Wood
2007-12-14 16:33 ` Olof Johansson
2007-12-04 17:07 ` [PATCH v2 3/4] [POWERPC] MPC8349E-mITX: introduce localbus and pata nodes Anton Vorontsov
2007-12-04 19:16 ` Olof Johansson
2007-12-04 19:23 ` Scott Wood
2007-12-04 19:45 ` Anton Vorontsov
2007-12-04 20:40 ` Olof Johansson
2007-12-04 17:07 ` [PATCH v2 4/4] [libata] pata_platform: s/ioport_shift/reg_shift/g Anton Vorontsov
2007-12-04 17:08 ` Sergei Shtylyov
2007-12-05 0:56 ` Paul Mundt
2007-12-04 20:44 ` Olof Johansson [this message]
2007-12-04 20:50 ` [PATCH] pata_of_platform: Move electra-ide support over to new framework Jeff Garzik
2007-12-04 21:03 ` Olof Johansson
2007-12-20 3:53 ` Paul Mackerras
2007-12-20 15:33 ` Olof Johansson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071204204432.GD8099@lixom.net \
--to=olof@lixom$(echo .)net \
--cc=arnd@arndb$(echo .)de \
--cc=avorontsov@ru$(echo .)mvista.com \
--cc=jeff@garzik$(echo .)org \
--cc=lethal@linux-sh$(echo .)org \
--cc=linux-ide@vger$(echo .)kernel.org \
--cc=linuxppc-dev@ozlabs$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox