Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp2400969imn; Tue, 2 Aug 2022 01:02:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uY0FV2kwi9u6pB+Y5w0hceXL1sIllsjSLXIlGfjBDTCvKHnOsMVm80yiZdlCmLr33d+ft2 X-Received: by 2002:a05:6402:2b8d:b0:43a:5410:a9fc with SMTP id fj13-20020a0564022b8d00b0043a5410a9fcmr20144749edb.99.1659427332866; Tue, 02 Aug 2022 01:02:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659427332; cv=none; d=google.com; s=arc-20160816; b=kOqUdNwvee5T2/TDVNUeuyGrr8eWoZzdrt9x7wpqRVN803mJxULEKiLvXTrv2RrbPw s8LWpKwaS9ZmgWsP0KLP+wDCej+WhSKH8pYTg/EzY572u6pcfdwcaWSRR8tRMxY8AH9U Um+LYa67tg2/2H0qke+XHBfVwtCCCy+yaPDln+GPr8cl8vwQej0Yi0t0JTrtL34gt1bm qnLs/IScY6Ji/fqf+klsGQIsmQ/lUwFtwpYZYCMTVdzaGOHxnvthEsehsQovj4C3Bok/ O6Ehj5Tl0/eF/dXPRgCjWoHJ3sTr6CU4Yi1E4MeI+hfknXPLpr3gNJrju9Gs2n+K25xW An2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=T5crsGfXKTR2+fnuoFrYzDnkRv/hRE2jLMf/113koYM=; b=w+tW0D5TFCXyJ+ts7HjFwqrV5MTDBxdbOTjpm2NFQhc41nm4T4TJj7A75GejacYD5+ ChAIT/xBdwk5aurVOCBeze8HRpKoV48CtOvARC8mDgUwwzWYHHUumHy6GwwE9+6CdaGC uGQX2SrOZkyrLAnh14tuA8wTTeQbfNlKfsoSlUg5CrpRskOcPsgYo4brAWtSksuuD/Io hIv7vL7YJgugMORLayjp8QHi3N6BXYQcdWY3wJA9V2mhvjveGazhXtv8Sr2Y4U0FxLdn Ch+cmXNZ1GBqzJ7hgXbe5j3Kb1xMzL2zd48bLHGklLXJcO1mhVXn6vHbw8/DHaCa6+yr Kc8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZTQAEWjC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o10-20020a170906974a00b00730551afa8esi9423834ejy.885.2022.08.02.01.01.44; Tue, 02 Aug 2022 01:02:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZTQAEWjC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236145AbiHBH6C (ORCPT + 99 others); Tue, 2 Aug 2022 03:58:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233160AbiHBH6A (ORCPT ); Tue, 2 Aug 2022 03:58:00 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77EF12F38A; Tue, 2 Aug 2022 00:57:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659427078; x=1690963078; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=o8494un4vXRlvd50TpzXogqNJizswoyXDmZmi+TkmX0=; b=ZTQAEWjCp/Dcra2LEUEQzLviGCfMOuxzX/GVZaDEJzpRP4lQIZcLYgUD qK7i9MfGADx6BWxMEqfmAEE2cWtc56/5azOw6+5N9AxCMCdU95REixyjN egOtBFxuUCHjCNqEKefju3hrnDco9u+YbeKHzOODDhxv4nZXirJv58kCl M6ndhghoqqG5SaGGpBjdnvduTv+lUktS/F3gbt1O5xs1HiKOEj4T43pN5 08o0Yjztw/lW+JGwP+IugXaQPe5MWEUgYuxc9H5hlRna06BDf55wqAf1s 6VDQjCuYJzcCk19c7jcLqwZLhF+1Yl57k1qCScO0QOpeDSCAqVsEP/PFt A==; X-IronPort-AV: E=McAfee;i="6400,9594,10426"; a="290563300" X-IronPort-AV: E=Sophos;i="5.93,210,1654585200"; d="scan'208";a="290563300" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2022 00:57:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,210,1654585200"; d="scan'208";a="744580849" Received: from kuha.fi.intel.com ([10.237.72.185]) by fmsmga001.fm.intel.com with SMTP; 02 Aug 2022 00:57:54 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Tue, 02 Aug 2022 10:57:53 +0300 Date: Tue, 2 Aug 2022 10:57:53 +0300 From: Heikki Krogerus To: Gene Chen Cc: linux@roeck-us.net, gregkh@linuxfoundation.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, gene_chen@richtek.com, cy_huang@richtek.com Subject: Re: [PATCH v3 2/7] usb: typec: tcpci_rt1711h: Fix vendor setting when set vconn Message-ID: References: <20220801101447.86207-1-gene.chen.richtek@gmail.com> <20220801101447.86207-3-gene.chen.richtek@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220801101447.86207-3-gene.chen.richtek@gmail.com> X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Gene, On Mon, Aug 01, 2022 at 06:14:42PM +0800, Gene Chen wrote: > From: Gene Chen > > replace overwrite whole register with update bits > > Signed-off-by: Gene Chen > --- > drivers/usb/typec/tcpm/tcpci_rt1711h.c | 15 +++++++++------ > 1 file changed, 9 insertions(+), 6 deletions(-) > > diff --git a/drivers/usb/typec/tcpm/tcpci_rt1711h.c b/drivers/usb/typec/tcpm/tcpci_rt1711h.c > index b56a0880a044..6197d9a05d36 100644 > --- a/drivers/usb/typec/tcpm/tcpci_rt1711h.c > +++ b/drivers/usb/typec/tcpm/tcpci_rt1711h.c > @@ -5,13 +5,15 @@ > * Richtek RT1711H Type-C Chip Driver > */ > > -#include > -#include > +#include > +#include > #include > #include > -#include > -#include > +#include > +#include > #include > +#include That header reshuffling is not necessary for this change - at least you are not giving any reason for it in your commit message. If there is no real need for that in this patch, then please leave the headers as they are. You can propose changing the order of the headers in a separate patch. Though, I would not bother with it unless there is some real benefit in doing so, and I'm pretty sure there isn't any. > #include "tcpci.h" > > #define RT1711H_VID 0x29CF > @@ -23,6 +25,7 @@ > #define RT1711H_RTCTRL8_SET(ck300, ship_off, auto_idle, tout) \ > (((ck300) << 7) | ((ship_off) << 5) | \ > ((auto_idle) << 3) | ((tout) & 0x07)) > +#define RT1711H_AUTOIDLEEN BIT(3) > > #define RT1711H_RTCTRL11 0x9E > > @@ -109,8 +112,8 @@ static int rt1711h_set_vconn(struct tcpci *tcpci, struct tcpci_data *tdata, > { > struct rt1711h_chip *chip = tdata_to_rt1711h(tdata); > > - return rt1711h_write8(chip, RT1711H_RTCTRL8, > - RT1711H_RTCTRL8_SET(0, 1, !enable, 2)); > + return regmap_update_bits(chip->data.regmap, RT1711H_RTCTRL8, > + RT1711H_AUTOIDLEEN, enable ? 0 : RT1711H_AUTOIDLEEN); > } > > static int rt1711h_start_drp_toggling(struct tcpci *tcpci, > -- > 2.25.1 thanks, -- heikki