From patchwork Wed Apr 23 11:36:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 28870 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f69.google.com (mail-qg0-f69.google.com [209.85.192.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F292A203AC for ; Wed, 23 Apr 2014 11:38:31 +0000 (UTC) Received: by mail-qg0-f69.google.com with SMTP id a108sf1994658qge.4 for ; Wed, 23 Apr 2014 04:38:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=TtoQHGXZG4nh2dmJ48sSH7k9sCMsnNmaDYo1hEHIWew=; b=MLCeCNJxLQDDoaU5vx2/DfYyEcVTtZpQhnStrEPvU/p3FIpgq6i9Le3yc1yd3c3/6h lLl0oPrWToyB2qD+xxWrnfTl+7ZKjbiaKCgyqhAr7RlSlBOpDLsbc8RDgnouNXvToPqk Opx5kyo/XWEbN8nWdnPl8sYaZcpL7Cb+zAEGhS1n51CrE+sibFUpGrO7MZ+ReLIK9vtI 6DvmABJA0hbiCqSnAqCyrWkJGW1jvUntVmY053CFYsZ06YNmWF3qganRtXtDRzHsAotT yb/1VlfGgi6fZfSeChWW8HzbwUK4wAdj3/1alU34VfSH3vJmcfpVkbzFl97uE+c8igAg dQfg== X-Gm-Message-State: ALoCoQn+cuHAGx8MtahiwU1euisYUvgQz6wqoeivXEQUO0iw30nno/dOGp92L9kaETPv7SgPv1sV X-Received: by 10.52.28.116 with SMTP id a20mr20206001vdh.2.1398253111594; Wed, 23 Apr 2014 04:38:31 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.19.239 with SMTP id 102ls573499qgh.42.gmail; Wed, 23 Apr 2014 04:38:31 -0700 (PDT) X-Received: by 10.58.96.36 with SMTP id dp4mr14357756veb.21.1398253111412; Wed, 23 Apr 2014 04:38:31 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id kp12si111085veb.174.2014.04.23.04.38.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Apr 2014 04:38:31 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id id10so928962vcb.40 for ; Wed, 23 Apr 2014 04:38:31 -0700 (PDT) X-Received: by 10.58.49.10 with SMTP id q10mr44462492ven.5.1398253111327; Wed, 23 Apr 2014 04:38:31 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp96616vcb; Wed, 23 Apr 2014 04:38:30 -0700 (PDT) X-Received: by 10.68.235.6 with SMTP id ui6mr53583336pbc.45.1398253110281; Wed, 23 Apr 2014 04:38:30 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ka6si488497pbc.9.2014.04.23.04.38.29; Wed, 23 Apr 2014 04:38:29 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753428AbaDWLiT (ORCPT + 27 others); Wed, 23 Apr 2014 07:38:19 -0400 Received: from mail-pa0-f49.google.com ([209.85.220.49]:36954 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752436AbaDWLhK (ORCPT ); Wed, 23 Apr 2014 07:37:10 -0400 Received: by mail-pa0-f49.google.com with SMTP id lj1so681864pab.22 for ; Wed, 23 Apr 2014 04:37:09 -0700 (PDT) X-Received: by 10.68.134.169 with SMTP id pl9mr19211449pbb.133.1398253029499; Wed, 23 Apr 2014 04:37:09 -0700 (PDT) Received: from localhost.localdomain ([218.17.215.175]) by mx.google.com with ESMTPSA id qc8sm1892576pbc.68.2014.04.23.04.37.05 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Apr 2014 04:37:08 -0700 (PDT) From: Kefeng Wang To: Tejun Heo , Hans de Goede , Maxime Ripard , linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org Cc: wangkefeng.wang@huawei.com, kefeng.wang@linaro.org Subject: [PATCH v4 2/3] libahci_platform: add host_flags parameter in ahci_platform_init_host() Date: Wed, 23 Apr 2014 19:36:46 +0800 Message-Id: <1398253008-17059-3-git-send-email-kefeng.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1398253008-17059-1-git-send-email-kefeng.wang@linaro.org> References: <1398253008-17059-1-git-send-email-kefeng.wang@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: kefeng.wang@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add a dynamic host flags argument to make ahci_platform_init_host more flexible, then remove the AHCI_HFLAGS(...) argument from some driver's ata_port_info, and pass that in as the new arguments. Cc: Hans de Geode Signed-off-by: Kefeng Wang --- drivers/ata/ahci_da850.c | 3 ++- drivers/ata/ahci_imx.c | 3 ++- drivers/ata/ahci_platform.c | 2 +- drivers/ata/ahci_st.c | 2 +- drivers/ata/ahci_sunxi.c | 9 ++++++--- drivers/ata/ahci_xgene.c | 6 +++++- drivers/ata/libahci_platform.c | 2 ++ include/linux/ahci_platform.h | 1 + 8 files changed, 20 insertions(+), 8 deletions(-) diff --git a/drivers/ata/ahci_da850.c b/drivers/ata/ahci_da850.c index 2c83613..2b77d53 100644 --- a/drivers/ata/ahci_da850.c +++ b/drivers/ata/ahci_da850.c @@ -85,7 +85,8 @@ static int ahci_da850_probe(struct platform_device *pdev) da850_sata_init(dev, pwrdn_reg, hpriv->mmio); - rc = ahci_platform_init_host(pdev, hpriv, &ahci_da850_port_info, 0, 0); + rc = ahci_platform_init_host(pdev, hpriv, &ahci_da850_port_info, + 0, 0, 0); if (rc) goto disable_resources; diff --git a/drivers/ata/ahci_imx.c b/drivers/ata/ahci_imx.c index 497c7ab..e7e44a7 100644 --- a/drivers/ata/ahci_imx.c +++ b/drivers/ata/ahci_imx.c @@ -267,7 +267,8 @@ static int imx_ahci_probe(struct platform_device *pdev) reg_val = clk_get_rate(imxpriv->ahb_clk) / 1000; writel(reg_val, hpriv->mmio + HOST_TIMER1MS); - ret = ahci_platform_init_host(pdev, hpriv, &ahci_imx_port_info, 0, 0); + ret = ahci_platform_init_host(pdev, hpriv, &ahci_imx_port_info, + 0, 0, 0); if (ret) imx_sata_disable(hpriv); diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c index ef67e79..a476a1f 100644 --- a/drivers/ata/ahci_platform.c +++ b/drivers/ata/ahci_platform.c @@ -55,7 +55,7 @@ static int ahci_probe(struct platform_device *pdev) goto disable_resources; } - rc = ahci_platform_init_host(pdev, hpriv, &ahci_port_info, 0, 0); + rc = ahci_platform_init_host(pdev, hpriv, &ahci_port_info, 0, 0, 0); if (rc) goto pdata_exit; diff --git a/drivers/ata/ahci_st.c b/drivers/ata/ahci_st.c index 6332222..2595598 100644 --- a/drivers/ata/ahci_st.c +++ b/drivers/ata/ahci_st.c @@ -166,7 +166,7 @@ static int st_ahci_probe(struct platform_device *pdev) if (err) return err; - err = ahci_platform_init_host(pdev, hpriv, &st_ahci_port_info, 0, 0); + err = ahci_platform_init_host(pdev, hpriv, &st_ahci_port_info, 0, 0, 0); if (err) { ahci_platform_disable_resources(hpriv); return err; diff --git a/drivers/ata/ahci_sunxi.c b/drivers/ata/ahci_sunxi.c index 42d3f64..543132a 100644 --- a/drivers/ata/ahci_sunxi.c +++ b/drivers/ata/ahci_sunxi.c @@ -157,8 +157,6 @@ static void ahci_sunxi_start_engine(struct ata_port *ap) } static const struct ata_port_info ahci_sunxi_port_info = { - AHCI_HFLAGS(AHCI_HFLAG_32BIT_ONLY | AHCI_HFLAG_NO_MSI | - AHCI_HFLAG_NO_PMP | AHCI_HFLAG_YES_NCQ), .flags = AHCI_FLAG_COMMON | ATA_FLAG_NCQ, .pio_mask = ATA_PIO4, .udma_mask = ATA_UDMA6, @@ -169,6 +167,7 @@ static int ahci_sunxi_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct ahci_host_priv *hpriv; + unsigned int hflags; int rc; hpriv = ahci_platform_get_resources(pdev); @@ -185,7 +184,11 @@ static int ahci_sunxi_probe(struct platform_device *pdev) if (rc) goto disable_resources; - rc = ahci_platform_init_host(pdev, hpriv, &ahci_sunxi_port_info, 0, 0); + hflags = AHCI_HFLAG_32BIT_ONLY | AHCI_HFLAG_NO_MSI | + AHCI_HFLAG_NO_PMP | AHCI_HFLAG_YES_NCQ, + + rc = ahci_platform_init_host(pdev, hpriv, &ahci_sunxi_port_info, + hflags, 0, 0); if (rc) goto disable_resources; diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c index 77c89bf..8022b5a 100644 --- a/drivers/ata/ahci_xgene.c +++ b/drivers/ata/ahci_xgene.c @@ -382,6 +382,7 @@ static int xgene_ahci_probe(struct platform_device *pdev) struct ahci_host_priv *hpriv; struct xgene_ahci_context *ctx; struct resource *res; + unsigned int hflags; int rc; hpriv = ahci_platform_get_resources(pdev); @@ -450,7 +451,10 @@ static int xgene_ahci_probe(struct platform_device *pdev) goto disable_resources; } - rc = ahci_platform_init_host(pdev, hpriv, &xgene_ahci_port_info, 0, 0); + hflags = AHCI_HFLAG_NO_PMP | AHCI_HFLAG_YES_NCQ, + + rc = ahci_platform_init_host(pdev, hpriv, &xgene_ahci_port_info, + hflags, 0, 0); if (rc) goto disable_resources; diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c index 7cb3a85..ebd880e 100644 --- a/drivers/ata/libahci_platform.c +++ b/drivers/ata/libahci_platform.c @@ -283,6 +283,7 @@ EXPORT_SYMBOL_GPL(ahci_platform_get_resources); * @pdev: platform device pointer for the host * @hpriv: ahci-host private data for the host * @pi_template: template for the ata_port_info to use + * @host_flags: ahci host flags used in ahci_host_priv * @force_port_map: param passed to ahci_save_initial_config * @mask_port_map: param passed to ahci_save_initial_config * @@ -296,6 +297,7 @@ EXPORT_SYMBOL_GPL(ahci_platform_get_resources); int ahci_platform_init_host(struct platform_device *pdev, struct ahci_host_priv *hpriv, const struct ata_port_info *pi_template, + unsigned int host_flags, unsigned int force_port_map, unsigned int mask_port_map) { diff --git a/include/linux/ahci_platform.h b/include/linux/ahci_platform.h index 1f16d50..45897f6 100644 --- a/include/linux/ahci_platform.h +++ b/include/linux/ahci_platform.h @@ -44,6 +44,7 @@ struct ahci_host_priv *ahci_platform_get_resources( int ahci_platform_init_host(struct platform_device *pdev, struct ahci_host_priv *hpriv, const struct ata_port_info *pi_template, + unsigned int host_flags, unsigned int force_port_map, unsigned int mask_port_map);