From patchwork Mon Apr 10 13:17:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 97134 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp1358632qgd; Mon, 10 Apr 2017 06:18:43 -0700 (PDT) X-Received: by 10.99.56.88 with SMTP id h24mr55538092pgn.108.1491830322994; Mon, 10 Apr 2017 06:18:42 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y5si13569236pgi.411.2017.04.10.06.18.42; Mon, 10 Apr 2017 06:18:42 -0700 (PDT) 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=@ti.com; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753673AbdDJNSh (ORCPT + 24 others); Mon, 10 Apr 2017 09:18:37 -0400 Received: from fllnx210.ext.ti.com ([198.47.19.17]:11353 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753632AbdDJNSf (ORCPT ); Mon, 10 Apr 2017 09:18:35 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id v3ADIYgN025908; Mon, 10 Apr 2017 08:18:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1491830314; bh=ctROvsBNoljxpOpOgcJXYycz+idjczGX25NSQx92vOI=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ER81yZUts1vqPWx49vQmbvdUf4ml6ZeBw/eDr0taq6kIf1csABqsxLiA7hnJ+1AWA RUBdMtNlh5in44qZAJJQb68jSEJWNqZe2O7JI8RvK9eFFr0tatzsS8IAIboohCjG35 reUVuEEVGhioLSCc2gFmjR/qDnkQSHbWl7ydmh1k= Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v3ADIYrs020149; Mon, 10 Apr 2017 08:18:34 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.294.0; Mon, 10 Apr 2017 08:18:33 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v3ADIOLx032573; Mon, 10 Apr 2017 08:18:32 -0500 From: Kishon Vijay Abraham I To: CC: , Subject: [PATCH 05/32] phy: sun4i-usb: change PHYCTL register clearing code Date: Mon, 10 Apr 2017 18:47:56 +0530 Message-ID: <20170410131823.26485-6-kishon@ti.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170410131823.26485-1-kishon@ti.com> References: <20170410131823.26485-1-kishon@ti.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Icenowy Zheng It seems that all SoCs with the PHYCTL register offset as 0x10 need the PHYCTL register to be cleared before it's written. Change PHYCTL register clearing code to judge whether clearing is needed based on the PHYCTL offset. Signed-off-by: Icenowy Zheng Signed-off-by: Kishon Vijay Abraham I --- drivers/phy/phy-sun4i-usb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.11.0 diff --git a/drivers/phy/phy-sun4i-usb.c b/drivers/phy/phy-sun4i-usb.c index a21b5f24a340..62b4d25448c6 100644 --- a/drivers/phy/phy-sun4i-usb.c +++ b/drivers/phy/phy-sun4i-usb.c @@ -188,10 +188,8 @@ static void sun4i_usb_phy_write(struct sun4i_usb_phy *phy, u32 addr, u32 data, spin_lock_irqsave(&phy_data->reg_lock, flags); - if (phy_data->cfg->type == sun8i_a33_phy || - phy_data->cfg->type == sun50i_a64_phy || - phy_data->cfg->type == sun8i_v3s_phy) { - /* A33 or A64 needs us to set phyctl to 0 explicitly */ + if (phy_data->cfg->phyctl_offset == REG_PHYCTL_A33) { + /* SoCs newer than A33 need us to set phyctl to 0 explicitly */ writel(0, phyctl); }