Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp4596556rwb; Mon, 8 Aug 2022 04:04:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR7iRP/kRrIYigl+BqKS/NYsQq3CE5pvypj02Z3CL644A02p4nN4ui2aD+EoS4/w1wIOJYwi X-Received: by 2002:a05:6402:241e:b0:440:2c03:cdc8 with SMTP id t30-20020a056402241e00b004402c03cdc8mr12499096eda.237.1659956686854; Mon, 08 Aug 2022 04:04:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659956686; cv=none; d=google.com; s=arc-20160816; b=NN01UsMcGXJq9V6ZwqgJRsVjdV9YEI9wtfm2JxrZa0CNhhm8AG2oMnM2xhoRA6X000 8KmXVRcwHp6yovHy1Oxcrh5m8EwSWWROfY9Uy9dNGH9xAlQK2SjP9wpeE/hDdJHGEd6n Y6aTAe1uFQ52K5HxNJXB8kRhxwf5K+SJ7sznGeCSfRcAYFyJckvf3ihrVrZHlwEnnzuB JucwcsX6yzms0EPi3WfND7NfX8uFzfnxIvBuWFwr7YIxaOer7Rc0w+ot+kTnYqN862Hn WenjTUDKHbWcHLZUMThqzckAApc/62YvlxNuks1vGyepqNZJeoBZfocBaIDVfpyf24Ca k/Sg== 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=9t79T65d3FxRxrvzQYb7TTz8x/weCpZpwuJori7PN/c=; b=vInXlzWKFmoWTkXXtQkvMqbhLkAavSjLx7tqdqcDJ0FM2WXI2N2RO9Vj7Xsr48OLAC /Gibt9RC1qWhQSY71Q0Be3eKwkEg9I1fypECMYUoLwENvoZkelfQhq40GkjdE8wPAjzd lWlUkWPykcgjQLobW/bx/ae1luTwbvBgjF+eRxbJVziL1Xi0CYK1az0dFO1dLKnKB6lh +3E+5U492L+DlTTp3YAqZ7gym/uc3a/oQTPxkNiwtZgMHuWsjgpkcJpVZSn6/z9Dhz1L xwe3By6G4gAEWcz809zfa1p6XTwb19QTdgSBYJIW4u9DZiGSHIP1KwaMeYdJ6GPmH4sE TSkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DMS1YJRi; 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 g13-20020a056402090d00b004396851005fsi6667991edz.100.2022.08.08.04.04.19; Mon, 08 Aug 2022 04:04:46 -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=DMS1YJRi; 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 S242042AbiHHKiZ (ORCPT + 99 others); Mon, 8 Aug 2022 06:38:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237547AbiHHKiW (ORCPT ); Mon, 8 Aug 2022 06:38:22 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46001A1B9; Mon, 8 Aug 2022 03:38:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659955101; x=1691491101; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=i0OaVs7vkKYWne9ZknDeoaUYlRMrkt/ldlaa0MEbAZA=; b=DMS1YJRiaClfsW8aERSbM/kc24XQjpNEO/ZsVejHN6QxaEnqpIeBwene 1mNp1sqMzhhJbbzbzYiD+QpMSnw9HAx4gCfUDhNOGnc+/jTS6d70KFeX9 9sqdO0GXrJXfb4lONRWZAGetEYaAxGqWdiPPWxsTAjzK12QdJNPgW311d tdNmZQiXcllX0+93M8fmBEK1H5TiuoAY2aBqNXcz8nJ1zWDTK/zgYbgOu n8zYgw/EVPxU9O4VrK0hZrmN6Q9gxQ4x4yIm+lEXRbjBJkjCS8eOp3D3A K96GBBPZB+PNoDBTlXVQDtVZ0izjWjKgegLzmmZerRrUAz6S5t/AVu0IS Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10432"; a="354559347" X-IronPort-AV: E=Sophos;i="5.93,222,1654585200"; d="scan'208";a="354559347" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2022 03:38:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,222,1654585200"; d="scan'208";a="746584608" Received: from kuha.fi.intel.com ([10.237.72.185]) by fmsmga001.fm.intel.com with SMTP; 08 Aug 2022 03:38:17 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Mon, 08 Aug 2022 13:38:16 +0300 Date: Mon, 8 Aug 2022 13:38:16 +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 v4 4/7] usb: typec: tcpci_rt1711h: Add initial phy setting Message-ID: References: <20220805071714.150882-1-gene.chen.richtek@gmail.com> <20220805071714.150882-5-gene.chen.richtek@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220805071714.150882-5-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,T_SCC_BODY_TEXT_LINE 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 On Fri, Aug 05, 2022 at 03:17:10PM +0800, Gene Chen wrote: > From: Gene Chen > > Add initial phy setting about phy dicard retry, > rx filter deglitch time and BMC-encoded wait time > > Signed-off-by: Gene Chen > Reviewed-by: Guenter Roeck Reviewed-by: Heikki Krogerus > --- > drivers/usb/typec/tcpm/tcpci_rt1711h.c | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/typec/tcpm/tcpci_rt1711h.c b/drivers/usb/typec/tcpm/tcpci_rt1711h.c > index fb19d7b..5c51d04 100644 > --- a/drivers/usb/typec/tcpm/tcpci_rt1711h.c > +++ b/drivers/usb/typec/tcpm/tcpci_rt1711h.c > @@ -19,6 +19,9 @@ > #define RT1711H_VID 0x29CF > #define RT1711H_PID 0x1711 > > +#define RT1711H_PHYCTRL1 0x80 > +#define RT1711H_PHYCTRL2 0x81 > + > #define RT1711H_RTCTRL8 0x9B > > /* Autoidle timeout = (tout * 2 + 1) * 6.4ms */ > @@ -106,8 +109,18 @@ static int rt1711h_init(struct tcpci *tcpci, struct tcpci_data *tdata) > return ret; > > /* dcSRC.DRP : 33% */ > - return rt1711h_write16(chip, RT1711H_RTCTRL16, 330); > + ret = rt1711h_write16(chip, RT1711H_RTCTRL16, 330); > + if (ret < 0) > + return ret; > + > + /* Enable phy discard retry, retry count 7, rx filter deglitch 100 us */ > + ret = rt1711h_write8(chip, RT1711H_PHYCTRL1, 0xF1); > + if (ret < 0) > + return ret; > > + /* Decrease wait time of BMC-encoded 1 bit from 2.67us to 2.55us */ > + /* wait time : (val * .4167) us */ > + return rt1711h_write8(chip, RT1711H_PHYCTRL2, 62); > } > > static int rt1711h_set_vbus(struct tcpci *tcpci, struct tcpci_data *tdata, > -- > 2.7.4 -- heikki