Received: by 10.223.185.116 with SMTP id b49csp8387771wrg; Fri, 2 Mar 2018 00:25:45 -0800 (PST) X-Google-Smtp-Source: AG47ELtA0ZFhV84lwjbnOnsMWXnLGlsjGmECYrSnnXDqye7NCg3oADtjWr9BCiYhiaT0dZlZsNxv X-Received: by 10.99.37.7 with SMTP id l7mr3941435pgl.311.1519979145129; Fri, 02 Mar 2018 00:25:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519979145; cv=none; d=google.com; s=arc-20160816; b=awPUvHhnMNRP2e/FUP3uXLkD0D2qkyXrta0gXEhx5WtNBbBkAzGm0rFJBTQXyuBcHn ICNsJ1stjOrZDfcrqyf0Fw9KlN2OWcfJIneUMCdiy31w95jwxVm+DvxsojtzezFCIuA5 IJAJH/MZCgFKI+FKG39Byvg6D1eWm6VVLB4LV6l+9kqnLEXalCqP1LuFsODVJzGLoDTg ZwaDL6XVrHq0ODnub/5WEV1rWywxKIlD5Ijm9KUwPWZSj1EcNdLQ4HjNYeZ6GztNt7ac WagFmPcfuZKNPkRTvjb05PDXOl8kK5oNvBev2i4gklohSTDowflNw98ws4viz6bsHcXT ceBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=Fymux30qu2O3CuSakuAfGwSpjixLOh1jQNOH0WT/ojs=; b=098YsFBAolML6uAHyC1QabAfkfwhjQFBejr8ncoFRqfnOhCEDPg9fo9sxe0gg48hIJ at7VKY18+TxGom5YMVbmd85wXvhGxeLQoEPu3cFSTFXNJYxfzpGnhjlGkKOMWB91p0os ZlbWAaJ1dYpP665Em/1J6Xv5iNdnxwSU3+ozHajuhjFyzMjfXdRmLz26qNIB47GpTHXQ K3Ir+Ri1eroixYj+S0QNavQ6oDLP7qE45EylReIe6To51Y80UJkcLWzYrNTMwppY3kye 4UW9J0YBPNKVjwV3xIY8PuJSzeO0DTT97n34hR96mnien/BvjgIykFdBJ6nsau0eeTt1 nTdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=PuorBzxp; dkim=pass header.i=@codeaurora.org header.s=default header.b=PuorBzxp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l69si4522333pfk.180.2018.03.02.00.25.30; Fri, 02 Mar 2018 00:25:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=PuorBzxp; dkim=pass header.i=@codeaurora.org header.s=default header.b=PuorBzxp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422895AbeCBIYS (ORCPT + 99 others); Fri, 2 Mar 2018 03:24:18 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:56182 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422781AbeCBIYN (ORCPT ); Fri, 2 Mar 2018 03:24:13 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id D9B6560316; Fri, 2 Mar 2018 08:24:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1519979052; bh=LkuKveq7hbKyDV4MTJ0UVU/E6IZRlpzVv2u+RHC9ULE=; h=From:To:Cc:Subject:Date:From; b=PuorBzxpu73wvXueyOfbADj3E610SmQpBnkAcXMokBj86vqotOQTRym7UezVYP3YI XjgmroZSXusd/xMpavNZQRGaFlxeMqCNS4yNon2yDbol6GUkizY1YO9VrWpOtx1DDB xP51HOef1DmKwWe2DmiQ+AFYQzqouITJWHc/TW2g= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from CANG02.ap.qualcomm.com (unknown [180.166.53.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: cang@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 4DAA160316; Fri, 2 Mar 2018 08:24:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1519979052; bh=LkuKveq7hbKyDV4MTJ0UVU/E6IZRlpzVv2u+RHC9ULE=; h=From:To:Cc:Subject:Date:From; b=PuorBzxpu73wvXueyOfbADj3E610SmQpBnkAcXMokBj86vqotOQTRym7UezVYP3YI XjgmroZSXusd/xMpavNZQRGaFlxeMqCNS4yNon2yDbol6GUkizY1YO9VrWpOtx1DDB xP51HOef1DmKwWe2DmiQ+AFYQzqouITJWHc/TW2g= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4DAA160316 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=cang@codeaurora.org From: Can Guo To: subhashj@codeaurora.org, asutoshd@codeaurora.org, vivek.gautam@codeaurora.org, rnayak@codeaurora.org, vinholikatti@gmail.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, Venkat Gopalakrishnan , Can Guo , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v1] scsi: ufs: add 2 lane support Date: Fri, 2 Mar 2018 16:18:08 +0800 Message-Id: <20180302082346.8188-1-cang@codeaurora.org> X-Mailer: git-send-email 2.15.0.windows.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Venkat Gopalakrishnan Qcom ufs controller v3.1.0 supports 2 lanes, add support to configure 2 lanes during phy initialization. Signed-off-by: Venkat Gopalakrishnan Signed-off-by: Subhash Jadavani Signed-off-by: Can Guo --- drivers/scsi/ufs/ufs-qcom.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c index 2b38db2..51889ad 100644 --- a/drivers/scsi/ufs/ufs-qcom.c +++ b/drivers/scsi/ufs/ufs-qcom.c @@ -113,10 +113,10 @@ static void ufs_qcom_disable_lane_clks(struct ufs_qcom_host *host) if (!host->is_lane_clks_enabled) return; - if (host->hba->lanes_per_direction > 1) + if (host->tx_l1_sync_clk) clk_disable_unprepare(host->tx_l1_sync_clk); clk_disable_unprepare(host->tx_l0_sync_clk); - if (host->hba->lanes_per_direction > 1) + if (host->rx_l1_sync_clk) clk_disable_unprepare(host->rx_l1_sync_clk); clk_disable_unprepare(host->rx_l0_sync_clk); @@ -147,18 +147,15 @@ static int ufs_qcom_enable_lane_clks(struct ufs_qcom_host *host) if (err) goto disable_tx_l0; - err = ufs_qcom_host_clk_enable(dev, "tx_lane1_sync_clk", - host->tx_l1_sync_clk); - if (err) - goto disable_rx_l1; + /* The tx lane1 clk could be muxed, hence keep this optional */ + if (host->tx_l1_sync_clk) + ufs_qcom_host_clk_enable(dev, "tx_lane1_sync_clk", + host->tx_l1_sync_clk); } host->is_lane_clks_enabled = true; goto out; -disable_rx_l1: - if (host->hba->lanes_per_direction > 1) - clk_disable_unprepare(host->rx_l1_sync_clk); disable_tx_l0: clk_disable_unprepare(host->tx_l0_sync_clk); disable_rx_l0: @@ -189,8 +186,9 @@ static int ufs_qcom_init_lane_clks(struct ufs_qcom_host *host) if (err) goto out; - err = ufs_qcom_host_clk_get(dev, "tx_lane1_sync_clk", - &host->tx_l1_sync_clk); + /* The tx lane1 clk could be muxed, hence keep this optional */ + ufs_qcom_host_clk_get(dev, "tx_lane1_sync_clk", + &host->tx_l1_sync_clk); } out: return err; -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project