From patchwork Sun May 9 05:21:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Graeme Russ X-Patchwork-Id: 51984 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 62C9EB7D59 for ; Sun, 9 May 2010 15:21:51 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750795Ab0EIFVj (ORCPT ); Sun, 9 May 2010 01:21:39 -0400 Received: from mail-pz0-f204.google.com ([209.85.222.204]:38404 "EHLO mail-pz0-f204.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750753Ab0EIFVj (ORCPT ); Sun, 9 May 2010 01:21:39 -0400 Received: by pzk42 with SMTP id 42so1139716pzk.4 for ; Sat, 08 May 2010 22:21:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=679rNysqRA/+X5u4AKZHofq/5lt5a1M7UKdJQ/OBtIo=; b=pbxdK6mHe+BeEApcrOkDA52PrsHDyuCYvNd+sNvKXV4TEK/89D2aGGsI3KGoaVuyTv J0Jv78/+s452FD9b48qJsC/Bfq2wb3yP0GZd7+0rnFpPfMVeeS5B9Kz4GANnAKmV1oMi rRQpGh603peJY4yWhNR/65C1GVlp7nOjz2pig= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=I+ypMQupA7waFBkHqHPnw7cjgZ6cz5bYUByYla1qD9NdUppM1qRkFeqGqcuXmKBBhy 3JIIxKsbCwK1PzEjzp/wrU3zpRHeEBv1gI62dgjNMi7UFBKNgItATXNp4O1LyxuH4VOu Vsn5LOEOEe+8oBohYkYxiL9D6yf5l7uwUKeq8= Received: by 10.141.90.1 with SMTP id s1mr1399373rvl.57.1273382498652; Sat, 08 May 2010 22:21:38 -0700 (PDT) Received: from helios (d122-109-115-153.sbr6.nsw.optusnet.com.au [122.109.115.153]) by mx.google.com with ESMTPS id 23sm3313509pzk.2.2010.05.08.22.21.36 (version=SSLv3 cipher=RC4-MD5); Sat, 08 May 2010 22:21:38 -0700 (PDT) From: Graeme Russ To: linux-ide@vger.kernel.org Cc: Graeme Russ Subject: [PATCH] Add hook for custom xfer function in PATA Platform driver Date: Sun, 9 May 2010 15:21:33 +1000 Message-Id: <1273382493-5859-1-git-send-email-graeme.russ@gmail.com> X-Mailer: git-send-email 1.7.1.rc1.12.ga601 Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org 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 --- 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,