Received: by 10.223.176.46 with SMTP id f43csp3253091wra; Mon, 22 Jan 2018 10:51:39 -0800 (PST) X-Google-Smtp-Source: AH8x225pa1AI7fNEyQUEeG/DYVlE0Sun8dqv8RXbl3KnsD/mPhkejyAjZi7idquVhdcR4mwVANES X-Received: by 10.36.243.7 with SMTP id t7mr9285363ith.139.1516647099871; Mon, 22 Jan 2018 10:51:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516647099; cv=none; d=google.com; s=arc-20160816; b=psfu1KxW7qphvPgYu0Ewe91OZ2yKX3g7TWnSqtnnoFeHSaLfOIStFd1ymlvWfGQpim /uWe97yXghcVFkFVHQnm8bZMPGlO8OEpPelHZZ51mYJol1YwPyycIpGM8BG4o1ojKhRh zNdPhdTleCZ/jkv49p6wrSs6LpAKHO1+OAhtRvZHfkAdnwHLjpuFr7ZeEzfSznvCC6/f HXGVY6scRPh5fIHqberUTL4IzQ2RK1qL3boQ+Vh6ub6K33Xs0banibEINl1FiRzO8SH5 rCbV3oBxvQjl25iD/tLpsYuDkOTU9WsVYhee3e7/Vi1TdPSABF8QdFqUBIPiggc+FTXK jpCw== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=r8PQKM7Ba4hBneWJ8qXgLGnpQFPc0gfRlCaAHTgwp9c=; b=w9E2J7MJZdyqNwC3JHQTYKUI54NvFIWPGsVywhzfUjAzyNuWnTtZkJ1kbVUUJWQZv5 W2CB3KhMllgUfq7aelTVrVJuSbFNWzuvwJfM2vzTaZTq85qAooKMB9kIH847TXeEQHKz dhm3q4GUsJx03SYh9uh0ojFXLfWAVwRauNP/d2rl377SEnywjcLqhx0A68324hxgVqCJ LwPvvhWBImZFSL+CIcrB1m5XLdWSCQv4bWE1R57Wad1jcemyisr0mb/7ufojYztxitsE VFaLWtpSdmKAFe/ssxWayP2hFVMasv4lXE6jbwEpY/b3ILqGBhGqqAaSGxeFKLqbii9E sTbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=FXS86mju; 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 r34si13793279ioi.129.2018.01.22.10.51.14; Mon, 22 Jan 2018 10:51:39 -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=fail header.i=@gmail.com header.s=20161025 header.b=FXS86mju; 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 S1751239AbeAVSul (ORCPT + 99 others); Mon, 22 Jan 2018 13:50:41 -0500 Received: from mail-pg0-f47.google.com ([74.125.83.47]:40596 "EHLO mail-pg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751125AbeAVSuh (ORCPT ); Mon, 22 Jan 2018 13:50:37 -0500 Received: by mail-pg0-f47.google.com with SMTP id g16so7765114pgn.7; Mon, 22 Jan 2018 10:50:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=r8PQKM7Ba4hBneWJ8qXgLGnpQFPc0gfRlCaAHTgwp9c=; b=FXS86mjutdcnnapUpipxcr+yYaRjIMAPvgpq0uU/+1NMfviOYHZUgluJkc4+iwSOZm pIQAqHQ362IFr77hH3VGoeB3tu9X+kQjwGCPvITGHp6o5Q9Bl8V98tJPJ+9s0y7fAFM5 Eg+571FuoLC6zdzuNVNltfwQW9mtB/vf6+qQld2c824uTeoU0owq4f1rSkrE/DCQ31vU hzJDQ/XS0bYfyyDR2mR5xm4waYBrEglGnU8ahqKZKXUXVwqK4sthJCzeaKADssx2p9AD SXUk3DlIMEj8SdSctwjuiQs9I6eo6HKsG7zSkqpKQCsO8GiOJPR0uL/11omH7BoMc+s9 f+5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=r8PQKM7Ba4hBneWJ8qXgLGnpQFPc0gfRlCaAHTgwp9c=; b=gV0Lu3my8t0Jrj4rWqYeW2xIQp5a9S4mcPFUIzNDXS/Fw3oofgpNwRZ/NxebPbdOBl P12fBUQP7NGk5Dl0k5CggCdsDRKoOJ5ERK0/Kj4iEgrXK1tpRj8R7K/l/PNsxFzUpmDC hA8HRzYBz+iHiDF3MztHDh6dYQ7dzakIVUUCiUq6c1pOaWflt4Hqd04mNgyEDdZ7+dkj tVDiXIDwHu1viSn8vHL84eSzdh1Qg6bJsxuxEUzEE9+8+2JhglwiD8mURu00xoOY2GRb G38x14W/bHvaibfrswzFAmXq0K79PJC4nbqNd2e5OfSUX6wtB+mMBQIQvyNBZginBQwr KAsQ== X-Gm-Message-State: AKwxytd2VIrsCA0T7zhD3yr2wLwbv79sIaQKn2gZMmvGbuelDN1lwtr9 N2HrgqkeHkNrE0/04nMyfJY= X-Received: by 10.98.19.137 with SMTP id 9mr8819654pft.5.1516647037114; Mon, 22 Jan 2018 10:50:37 -0800 (PST) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by smtp.gmail.com with ESMTPSA id i9sm3193286pfi.154.2018.01.22.10.50.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Jan 2018 10:50:36 -0800 (PST) Date: Mon, 22 Jan 2018 10:50:34 -0800 From: Guenter Roeck To: =?utf-8?B?c2h1ZmFuX2xlZSjmnY7mm7jluIYp?= Cc: Heikki Krogerus , 'Jun Li' , ShuFanLee , =?utf-8?B?Y3lfaHVhbmco6buD5ZWf5Y6fKQ==?= , "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" Subject: Re: [PATCH] USB TYPEC: RT1711H Type-C Chip Driver Message-ID: <20180122185034.GA26058@roeck-us.net> References: <1515567552-7692-1-git-send-email-leechu729@gmail.com> <20180119082218.GA22976@kuha.fi.intel.com> <25ced79e8ea84908bf6110a613ed81a2@ex1.rt.l> <20180119092413.GB22976@kuha.fi.intel.com> <20180119160235.GA21066@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 22, 2018 at 02:01:13AM +0000, shufan_lee(李書帆) wrote: > Dear Heikki and Guenter, > > Because there are still other controls of RT1711H that are different from standard TCPCI, e.x. flow of drp toggling. > > Is the suggestion to customize the difference based on tcpci.c for RT1711H? > In general, I would say yes. However, I won't have ime to review the differences between tcpci and the RT1711H. On a high level, if RT1711H claims to suport TCPCI, it should use (or, rather, extend) the TCPCI driver. Note that the TCPCI driver does not claim to be complete; there is a reason why it is still in staging. However, I would prefer if new devices claiming to support TCPCI would use it instead of going their own way. I don't have problems extending it with chip specific details if needed. Such extensions may be implemented in tcpci.c, or maybe better in a chip specific file. Even if you don't use the existing driver, I don't really see why it would make sense to redeclare all its defines. Either case, you might want to run checkpatch --strict on your driver. Most of that it reports is really unnecessary. Also, some of the code, such as +#ifndef BIT +#define BIT(x) (1 << (x)) +#endif is _really_ odd and, at least in this case, simply wrong. Guenter > Best Regards, > ***************************** > Shu-Fan Lee > Richtek Technology Corporation > TEL: +886-3-5526789 #2359 > FAX: +886-3-5526612 > ***************************** > > -----Original Message----- > From: Guenter Roeck [mailto:groeck7@gmail.com] On Behalf Of Guenter Roeck > Sent: Saturday, January 20, 2018 12:03 AM > To: Heikki Krogerus > Cc: shufan_lee(李書帆); 'Jun Li'; ShuFanLee; cy_huang(黃啟原); linux-kernel@vger.kernel.org; linux-usb@vger.kernel.org > Subject: Re: [PATCH] USB TYPEC: RT1711H Type-C Chip Driver > > On Fri, Jan 19, 2018 at 11:24:13AM +0200, Heikki Krogerus wrote: > > Hi, > > > > On Fri, Jan 19, 2018 at 09:01:24AM +0000, shufan_lee(?????|) wrote: > > > Hi Heikki, > > > > > > For example, the flow of tcpci_init is a little bit different. > > > In tcpci_init, there are more parameters need to be set for RT1711H. > > > > Different init parameters is really not a reason for a fork of the > > driver. The configuration of the TCPC will depend on the platform and > > TCPC vendor most cases. > > > Agreed. dwc3 usb support is an excellent example on how to handle this kind of variation. > > Guenter > ************* Email Confidentiality Notice ******************** > > The information contained in this e-mail message (including any attachments) may be confidential, proprietary, privileged, or otherwise exempt from disclosure under applicable laws. It is intended to be conveyed only to the designated recipient(s). Any use, dissemination, distribution, printing, retaining or copying of this e-mail (including its attachments) by unintended recipient(s) is strictly prohibited and may be unlawful. If you are not an intended recipient of this e-mail, or believe that you have received this e-mail in error, please notify the sender immediately (by replying to this e-mail), delete any and all copies of this e-mail (including any attachments) from your system, and do not disclose the content of this e-mail to any other person. Thank you!