From patchwork Fri Jan 3 00:22:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loc Ho X-Patchwork-Id: 3429231 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D64C89F2E9 for ; Fri, 3 Jan 2014 00:23:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CD00820173 for ; Fri, 3 Jan 2014 00:23:44 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B9BDC20176 for ; Fri, 3 Jan 2014 00:23:43 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VysXf-0004HZ-3U; Fri, 03 Jan 2014 00:23:11 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VysXY-0002lB-8K; Fri, 03 Jan 2014 00:23:04 +0000 Received: from exprod5og116.obsmtp.com ([64.18.0.147]) by merlin.infradead.org with smtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VysXT-0002j1-Si for linux-arm-kernel@lists.infradead.org; Fri, 03 Jan 2014 00:23:01 +0000 Received: from mail-pd0-f180.google.com ([209.85.192.180]) (using TLSv1) by exprod5ob116.postini.com ([64.18.4.12]) with SMTP ID DSNKUsYCzRx1QKQawpCv/vcCltbG0u+ooYov@postini.com; Thu, 02 Jan 2014 16:22:59 PST Received: by mail-pd0-f180.google.com with SMTP id q10so14673249pdj.25 for ; Thu, 02 Jan 2014 16:22:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RSQMD780geN/g+0aZflinbuJm5ZVToMcVMtRo6Ngfkg=; b=eFAvO/jNT+r7wLDjPAEpB/V9/VDHru6OsMQgDBn/+0pcc18/dZBt1HY32VXuxNLsYo I0MzDfLkKy4OolqCjbxMy/mEj9xGuCpO4bVjBKZgJ4qZdz9+CpfyxKWU/XNLkNVVY/dS kSXoz1CplYOi0IpcMuP3q1+q2hwRwQoOAG4I60R/ANR+iGU2moAE9FelzqiZNVvVbcRe FnZO8Z9uZHjdR1IfVW17QGlpnbH5pVZt2nXgNWEpoaHH6MlYRIDZMYsf9owyXDLjQPyQ NNZWVX/LtV+62DCy6YTSOIvtUrXuOQkwypeCb3HvANWjuhvYc1/SzyGuSjWKpBmqY8CD waJw== X-Gm-Message-State: ALoCoQnT4El9lW29Ae43mzmO0uyQHFAWbrbvOMstWenZ6bJTsWZQXKC/7iplRtdUATU6JJAUJmL3kYj6o2Gg4kvz3MtWi+pA32XBPlKBjv+VRBzobudRhcpSvJ+MQdTTyCShJTogNc5KBy8ltYrDdOfSHEjm5Tt+y7Kd7sJ2KFOSiI8opEiYi4F+/Rm4wQP47zo+9kZt2Gbc X-Received: by 10.68.234.67 with SMTP id uc3mr77823316pbc.27.1388708557438; Thu, 02 Jan 2014 16:22:37 -0800 (PST) X-Received: by 10.68.234.67 with SMTP id uc3mr77823306pbc.27.1388708557362; Thu, 02 Jan 2014 16:22:37 -0800 (PST) Received: from localhost ([198.137.200.11]) by mx.google.com with ESMTPSA id ki1sm104577630pbd.1.2014.01.02.16.22.35 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 02 Jan 2014 16:22:36 -0800 (PST) From: Loc Ho To: olof@lixom.net, tj@kernel.org, arnd@arndb.de Subject: [PATCH v7 1/4] ata: Export required functions by APM X-Gene SATA driver Date: Thu, 2 Jan 2014 17:22:16 -0700 Message-Id: <1388708539-333-2-git-send-email-lho@apm.com> X-Mailer: git-send-email 1.5.5 In-Reply-To: <1388708539-333-1-git-send-email-lho@apm.com> References: <1388708539-333-1-git-send-email-lho@apm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140102_192300_262552_AB83662D X-CRM114-Status: GOOD ( 11.36 ) X-Spam-Score: -4.2 (----) Cc: devicetree@vger.kernel.org, Suman Tripathi , linux-scsi@vger.kernel.org, jcm@redhat.com, patches@apm.com, linux-ide@vger.kernel.org, Loc Ho , Tuan Phan , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch exports functions required by APM X-Gene SoC SATA host controller driver to avoid duplication of code. Signed-off-by: Loc Ho Signed-off-by: Tuan Phan Signed-off-by: Suman Tripathi --- drivers/ata/ahci.h | 9 +++++++++ drivers/ata/libahci.c | 16 ++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h index 2289efd..8163b59 100644 --- a/drivers/ata/ahci.h +++ b/drivers/ata/ahci.h @@ -370,6 +370,15 @@ irqreturn_t ahci_thread_fn(int irq, void *dev_instance); void ahci_print_info(struct ata_host *host, const char *scc_s); int ahci_host_activate(struct ata_host *host, int irq, unsigned int n_msis); void ahci_error_handler(struct ata_port *ap); +void ahci_sw_activity(struct ata_link *link); +int ahci_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val); +void ahci_error_intr(struct ata_port *ap, u32 irq_stat); +int ahci_exec_polled_cmd(struct ata_port *ap, int pmp, + struct ata_taskfile *tf, int is_cmd, u16 flags, + unsigned long timeout_msec); +void ahci_fill_cmd_slot(struct ahci_port_priv *pp, unsigned int tag, + u32 opts); +unsigned int ahci_fill_sg(struct ata_queued_cmd *qc, void *cmd_tbl); static inline void __iomem *__ahci_port_base(struct ata_host *host, unsigned int port_no) diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index c482f8c..1d24bf5 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -68,7 +68,6 @@ static ssize_t ahci_transmit_led_message(struct ata_port *ap, u32 state, static int ahci_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val); -static int ahci_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val); static unsigned int ahci_qc_issue(struct ata_queued_cmd *qc); static bool ahci_qc_fill_rtf(struct ata_queued_cmd *qc); static int ahci_port_start(struct ata_port *ap); @@ -553,7 +552,7 @@ static int ahci_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val) return -EINVAL; } -static int ahci_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val) +int ahci_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val) { void __iomem *port_mmio = ahci_port_base(link->ap); int offset = ahci_scr_offset(link->ap, sc_reg); @@ -564,6 +563,7 @@ static int ahci_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val) } return -EINVAL; } +EXPORT_SYMBOL_GPL(ahci_scr_write); void ahci_start_engine(struct ata_port *ap) { @@ -869,7 +869,7 @@ int ahci_reset_controller(struct ata_host *host) } EXPORT_SYMBOL_GPL(ahci_reset_controller); -static void ahci_sw_activity(struct ata_link *link) +void ahci_sw_activity(struct ata_link *link) { struct ata_port *ap = link->ap; struct ahci_port_priv *pp = ap->private_data; @@ -882,6 +882,7 @@ static void ahci_sw_activity(struct ata_link *link) if (!timer_pending(&emp->timer)) mod_timer(&emp->timer, jiffies + msecs_to_jiffies(10)); } +EXPORT_SYMBOL_GPL(ahci_sw_activity); static void ahci_sw_activity_blink(unsigned long arg) { @@ -1239,7 +1240,7 @@ int ahci_kick_engine(struct ata_port *ap) } EXPORT_SYMBOL_GPL(ahci_kick_engine); -static int ahci_exec_polled_cmd(struct ata_port *ap, int pmp, +int ahci_exec_polled_cmd(struct ata_port *ap, int pmp, struct ata_taskfile *tf, int is_cmd, u16 flags, unsigned long timeout_msec) { @@ -1268,6 +1269,7 @@ static int ahci_exec_polled_cmd(struct ata_port *ap, int pmp, return 0; } +EXPORT_SYMBOL_GPL(ahci_exec_polled_cmd); int ahci_do_softreset(struct ata_link *link, unsigned int *class, int pmp, unsigned long deadline, @@ -1472,7 +1474,7 @@ static void ahci_postreset(struct ata_link *link, unsigned int *class) } } -static unsigned int ahci_fill_sg(struct ata_queued_cmd *qc, void *cmd_tbl) +unsigned int ahci_fill_sg(struct ata_queued_cmd *qc, void *cmd_tbl) { struct scatterlist *sg; struct ahci_sg *ahci_sg = cmd_tbl + AHCI_CMD_TBL_HDR_SZ; @@ -1494,6 +1496,7 @@ static unsigned int ahci_fill_sg(struct ata_queued_cmd *qc, void *cmd_tbl) return si; } +EXPORT_SYMBOL_GPL(ahci_fill_sg); static int ahci_pmp_qc_defer(struct ata_queued_cmd *qc) { @@ -1568,7 +1571,7 @@ static void ahci_fbs_dec_intr(struct ata_port *ap) dev_err(ap->host->dev, "failed to clear device error\n"); } -static void ahci_error_intr(struct ata_port *ap, u32 irq_stat) +void ahci_error_intr(struct ata_port *ap, u32 irq_stat) { struct ahci_host_priv *hpriv = ap->host->private_data; struct ahci_port_priv *pp = ap->private_data; @@ -1678,6 +1681,7 @@ static void ahci_error_intr(struct ata_port *ap, u32 irq_stat) } else ata_port_abort(ap); } +EXPORT_SYMBOL_GPL(ahci_error_intr); static void ahci_handle_port_interrupt(struct ata_port *ap, void __iomem *port_mmio, u32 status)