Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6531494ybi; Wed, 5 Jun 2019 02:23:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqy03Q+fA172/ICjY1B3L9UJbpgkyNJjz7ovB4Y0XsCOqgBvCTHb9lnaE3pA3AWBJtoJlnge X-Received: by 2002:a17:902:87:: with SMTP id a7mr258875pla.158.1559726608591; Wed, 05 Jun 2019 02:23:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559726608; cv=none; d=google.com; s=arc-20160816; b=WvQs1r10ccDvVDLFmDL6vyJiCRZv8dh75QC/ckYyp5xHP0Pj2//jYlyMJXkAi2NlnQ efiUybetytJBWapO3wx7j2VyamY5h8VnWfPgIXrwgQru60KGHZeTDNS8D+ZZbzsvKrxz hw0LdtWvU0O1BihQI+aOBWmp0TaQkmdWR4mbTsIVKMPqwjakltDqixd+I77ayCs+xg2H 2n2njwhYdHlV3SimNHBhyBwTHj9dMTnRvJFqqGZxsmXuouBe/b2jsRTofGAjw7mhfwuP f7jvi4WSoC2gxDozLwRS+XAFaTpjvUTobdCdk/+LMbYZP7ZfIQvQipIxp6nXI0Ju7pfj aHBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=bLLDehKmr+PWBXKyufugRVh2IzQ98pAPvwX/+BnVjig=; b=GFLyQ624Bzc2gRMXjBI36U1XmHwjlKSsxpEyOdMCd3wWDaSq8BdNnBOoBK552uoWVC l8kwpnaLrsA8BS4uLgsRj+5wYroLSxJpmNW/JLM32vqdRw5YtRPXQ0MXPFSsz1A0NxqX 7xnX5VlRgrdSrKr11PBkFRnIb4UZeg8yILkD7IMcWwoJ01pGrto1Y95pX02TrtBJOMx0 g3kXvPH/7dTZaCDghjKvO6SSqGkbMFXVDKEUumYtLgINdsvKTr9M0rlwBW8C+ykO0q8N u/xBvIfYdkn8N+VYot9wE5108H/NMDDsg/JfLabSEXT//rFc99XcvgKB2XA5rnCBJB/i 3R9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jJBnlb9O; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 14si25572754pgw.267.2019.06.05.02.23.12; Wed, 05 Jun 2019 02:23:28 -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=@kernel.org header.s=default header.b=jJBnlb9O; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727055AbfFEJUA (ORCPT + 99 others); Wed, 5 Jun 2019 05:20:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:38958 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726973AbfFEJUA (ORCPT ); Wed, 5 Jun 2019 05:20:00 -0400 Received: from dragon (li1264-180.members.linode.com [45.79.165.180]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 59A5E2075B; Wed, 5 Jun 2019 09:19:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559726399; bh=FZid3iZIC4Rv5X+erq0U81RMe3PNMwfiFD1mq2Y047A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jJBnlb9OnMtwF7KEkX4mRIJ3lu/ZzZitk7k4ZxZ6UqCOtaRX5psjR9ihBFO/iySqW xBwm1h9fTD4Sb2DmeQfavdYll0DKEsyD6RU5N7KkvAackLWQwWExUyhYEjbqC3voWx /34xIx6OjmaoIj/vBpFoMl0YSf8pqK40nLY6jk38= Date: Wed, 5 Jun 2019 17:19:44 +0800 From: Shawn Guo To: Andrey Smirnov Cc: linux-usb@vger.kernel.org, Chris Healy , Felipe Balbi , Fabio Estevam , NXP Linux Team , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: phy: mxs: Disable external charger detect in mxs_phy_hw_init() Message-ID: <20190605091943.GN29853@dragon> References: <20190529065948.5492-1-andrew.smirnov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190529065948.5492-1-andrew.smirnov@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 28, 2019 at 11:59:48PM -0700, Andrey Smirnov wrote: > Since this driver already handles changer detction state, copy the > workaround code currently residing in arch/arm/mach-imx/anatop.c into > this drier to consolidate the places modifying it. > > Signed-off-by: Andrey Smirnov > Cc: Chris Healy > Cc: Felipe Balbi > Cc: Shawn Guo > Cc: Fabio Estevam > Cc: NXP Linux Team > Cc: linux-usb@vger.kernel.org > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-kernel@vger.kernel.org Acked-by: Shawn Guo > --- > > The intent of this patch is to consolidate all of the code maipulating > charge detection state to a signle place and if this patch is agreed > upon I plan to follow it up with this change: > > https://github.com/ndreys/linux/commit/7248f2b85b4706760fd33d2ff970e2ea12d3bea7 > > Thanks, > Andrey Smirnov > > drivers/usb/phy/phy-mxs-usb.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c > index 1b1bb0ad40c3..6fa16ab31e2e 100644 > --- a/drivers/usb/phy/phy-mxs-usb.c > +++ b/drivers/usb/phy/phy-mxs-usb.c > @@ -63,6 +63,7 @@ > > #define ANADIG_USB1_CHRG_DETECT_SET 0x1b4 > #define ANADIG_USB1_CHRG_DETECT_CLR 0x1b8 > +#define ANADIG_USB2_CHRG_DETECT_SET 0x214 > #define ANADIG_USB1_CHRG_DETECT_EN_B BIT(20) > #define ANADIG_USB1_CHRG_DETECT_CHK_CHRG_B BIT(19) > #define ANADIG_USB1_CHRG_DETECT_CHK_CONTACT BIT(18) > @@ -250,6 +251,19 @@ static int mxs_phy_hw_init(struct mxs_phy *mxs_phy) > if (mxs_phy->data->flags & MXS_PHY_NEED_IP_FIX) > writel(BM_USBPHY_IP_FIX, base + HW_USBPHY_IP_SET); > > + if (mxs_phy->regmap_anatop) { > + unsigned int reg = mxs_phy->port_id ? > + ANADIG_USB1_CHRG_DETECT_SET : > + ANADIG_USB2_CHRG_DETECT_SET; > + /* > + * The external charger detector needs to be disabled, > + * or the signal at DP will be poor > + */ > + regmap_write(mxs_phy->regmap_anatop, reg, > + ANADIG_USB1_CHRG_DETECT_EN_B | > + ANADIG_USB1_CHRG_DETECT_CHK_CHRG_B); > + } > + > mxs_phy_tx_init(mxs_phy); > > return 0; > -- > 2.21.0 >