linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Add hook for custom xfer function in PATA Platform driver
@ 2010-05-09  5:21 Graeme Russ
       [not found] ` <4BE6910D.9070504@ru.mvista.com>
  0 siblings, 1 reply; 21+ messages in thread
From: Graeme Russ @ 2010-05-09  5:21 UTC (permalink / raw)
  To: linux-ide; +Cc: Graeme Russ

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


^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2010-06-09 12:36 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-09  5:21 [PATCH] Add hook for custom xfer function in PATA Platform driver Graeme Russ
     [not found] ` <4BE6910D.9070504@ru.mvista.com>
2010-05-09 11:29   ` 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

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).