linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Graeme Russ <graeme.russ@gmail.com>
To: linux-ide@vger.kernel.org
Cc: Graeme Russ <graeme.russ@gmail.com>
Subject: [PATCH] Add hook for custom xfer function in PATA Platform driver
Date: Sun,  9 May 2010 15:21:33 +1000	[thread overview]
Message-ID: <1273382493-5859-1-git-send-email-graeme.russ@gmail.com> (raw)

Allows the existing 16-bit data transfer function used by the PATA Platform
driver to be overriden by a vendor specific fuction. This is useful if,
for example, the PATA device is only capable of 8-bit data transfers

Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
---
 drivers/ata/pata_platform.c  |    7 +++++++
 include/linux/ata_platform.h |    5 +++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/ata/pata_platform.c b/drivers/ata/pata_platform.c
index 3f6ebc6..dc516b4 100644
--- a/drivers/ata/pata_platform.c
+++ b/drivers/ata/pata_platform.c
@@ -238,6 +238,13 @@ static int __devinit pata_platform_probe(struct platform_device *pdev)
 	if (irq_res)
 		irq_res->flags = pp_info ? pp_info->irq_flags : 0;
 
+	/*
+	 * Assign custom data transfer function (if defined)
+	 */
+	if (pp_info)
+		if (unlikely(pp_info->data_xfer))
+			pata_platform_port_ops.sff_data_xfer = pp_info->data_xfer;
+
 	return __pata_platform_probe(&pdev->dev, io_res, ctl_res, irq_res,
 				     pp_info ? pp_info->ioport_shift : 0,
 				     pio_mask);
diff --git a/include/linux/ata_platform.h b/include/linux/ata_platform.h
index 9a26c83..0913633 100644
--- a/include/linux/ata_platform.h
+++ b/include/linux/ata_platform.h
@@ -13,6 +13,11 @@ struct pata_platform_info {
 	 * IRQ flags when call request_irq()
 	 */
 	unsigned int irq_flags;
+	/*
+	 * Custom data transfer function
+	 */
+	unsigned int (*data_xfer)(struct ata_device *dev,
+			unsigned char *buf, unsigned int buflen, int rw);
 };
 
 extern int __devinit __pata_platform_probe(struct device *dev,
-- 
1.7.1.rc1.12.ga601


             reply	other threads:[~2010-05-09  5:21 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-09  5:21 Graeme Russ [this message]
     [not found] ` <4BE6910D.9070504@ru.mvista.com>
2010-05-09 11:29   ` [PATCH] Add hook for custom xfer function in PATA Platform driver Graeme Russ
2010-05-09 13:36     ` Sergei Shtylyov
2010-05-10  0:10       ` Graeme Russ
2010-05-10  9:51         ` Sergei Shtylyov
2010-05-10 10:03           ` Sergei Shtylyov
2010-05-11  0:25           ` Robert Hancock
2010-05-12 20:58             ` Sergei Shtylyov
2010-05-13  4:00               ` Graeme Russ
2010-05-13 21:02                 ` Sergei Shtylyov
2010-05-14  4:04                   ` Graeme Russ
2010-05-26 14:05                     ` Sergei Shtylyov
2010-06-09 12:36                       ` Graeme Russ
2010-05-11  9:55           ` Alan Cox
2010-05-12 20:30             ` Sergei Shtylyov
2010-05-12 23:13               ` Alan Cox
2010-05-13  4:09                 ` Graeme Russ
2010-05-13 21:22                   ` Sergei Shtylyov
2010-05-13 22:30                     ` Alan Cox
2010-05-14  4:37                     ` Graeme Russ
2010-05-26 14:26                       ` Sergei Shtylyov

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=1273382493-5859-1-git-send-email-graeme.russ@gmail.com \
    --to=graeme.russ@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).