From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Cyrus-Session-Id: sloti22d1t05-2127129-1516647054-2-9284023354064041576 X-Sieve: CMU Sieve 3.0 X-Spam-known-sender: no X-Spam-score: 0.0 X-Spam-hits: BAYES_00 -1.9, HEADER_FROM_DIFFERENT_DOMAINS 0.25, RCVD_IN_DNSWL_HI -5, T_RP_MATCHES_RCVD -0.01, LANGUAGES en, BAYES_USED global, SA_VERSION 3.4.0 X-Spam-source: IP='209.132.180.67', Host='vger.kernel.org', Country='US', FromHeader='net', MailFrom='org' X-Spam-charsets: to='utf-8', cc='utf-8', plain='utf-8' X-Resolved-to: greg@kroah.com X-Delivered-to: greg@kroah.com X-Mail-from: linux-usb-owner@vger.kernel.org ARC-Seal: i=1; a=rsa-sha256; cv=none; d=messagingengine.com; s=arctest; t=1516647054; b=prPzR0U1YSvB7CBonb81OBPGALM/DvcNhvLTh2G4ju3ZDcJ ZDoufBQmr5wfoFBfyjkTruCuKP0+Iweizz8dzvWfWMI5nzsTGJ0Lg7NIAfo+kNHj iDOTboMAdiEC3IJs6m4ObTVa9S2h03KFr7bk0HeYidMoDX6BTE1pPwpEqh9sz6QN gW6tINeCRRFC20is9SKDPyskRQNMWLeWe3B2w/fXenLlDtpK+EK/gTibJaNzrWzu tOKweKCSYw8ZmG92TB4x+Ki2fCBsEzs88Wwsvs1vuKSJYLnGCkTbxN5VMMzG4zLH 9jALQsWt0jNYja/qIrGW9ej+Tz9iOdHkL2cGYaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:content-transfer-encoding :in-reply-to:sender:list-id; s=arctest; t=1516647054; bh=SEALwZc Aepg5sxmRtM477CapV4uj7mFCGPoDl1aMvP0=; b=v1SlFjSGvo4KYk46nX+90o8 XNp9+uEBzUYou9llcGaPrdcwhAJ/n7SktiodubTW+vHE+WyWrgeanGtr9qCYOuoF skPe7FcbsGEtUdzpwnMsvkG9zNDAIMAcfx7JierZfShpm6aKLNkMmQirN05PmES3 hN+SgFHn6RSAOV9Cc10/4JR+pRQ8KKTgke6uRBrHue5x8vRgt8g8MobpzXE2FPKW jvptegNE4YQBdg+LXzYCZsL3zHkKladS8S660kT0k4qLX7nFDl6pVOqSGVN+sAz+ +8Fs5H5DzjXm2d1ZG3qjR2r99DQ2go393Rp8g0of15z117uBFWqbFGUbEWQpTEg= = ARC-Authentication-Results: i=1; mx4.messagingengine.com; arc=none (no signatures found); dkim=fail (message has been altered; 2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=FXS86mju x-bits=2048 x-keytype=rsa x-algorithm=sha256 x-selector=20161025; dmarc=none (p=none,has-list-id=yes,d=none) header.from=roeck-us.net; iprev=pass policy.iprev=209.132.180.67 (vger.kernel.org); spf=none smtp.mailfrom=linux-usb-owner@vger.kernel.org smtp.helo=vger.kernel.org; x-aligned-from=fail; x-google-dkim=fail (message has been altered; 2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=gV0Lu3my; x-ptr=pass x-ptr-helo=vger.kernel.org x-ptr-lookup=vger.kernel.org; x-return-mx=pass smtp.domain=vger.kernel.org smtp.result=pass smtp_org.domain=kernel.org smtp_org.result=pass smtp_is_org_domain=no header.domain=roeck-us.net header.result=pass header_is_org_domain=yes Authentication-Results: mx4.messagingengine.com; arc=none (no signatures found); dkim=fail (message has been altered; 2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=FXS86mju x-bits=2048 x-keytype=rsa x-algorithm=sha256 x-selector=20161025; dmarc=none (p=none,has-list-id=yes,d=none) header.from=roeck-us.net; iprev=pass policy.iprev=209.132.180.67 (vger.kernel.org); spf=none smtp.mailfrom=linux-usb-owner@vger.kernel.org smtp.helo=vger.kernel.org; x-aligned-from=fail; x-google-dkim=fail (message has been altered; 2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=gV0Lu3my; x-ptr=pass x-ptr-helo=vger.kernel.org x-ptr-lookup=vger.kernel.org; x-return-mx=pass smtp.domain=vger.kernel.org smtp.result=pass smtp_org.domain=kernel.org smtp_org.result=pass smtp_is_org_domain=no header.domain=roeck-us.net header.result=pass header_is_org_domain=yes Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751200AbeAVSuk (ORCPT ); Mon, 22 Jan 2018 13:50:40 -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 X-Google-Smtp-Source: AH8x227kB89enxh/NVDQ87yWj3P4KRV5EDtgeV1FV/JgsTHNzJZLJ0xCeX102SS8FDYQFkE4RVHZPw== 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-usb-owner@vger.kernel.org X-Mailing-List: linux-usb@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 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!