All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: "shufan_lee(李書帆)" <shufan_lee@richtek.com>
Cc: "Heikki Krogerus" <heikki.krogerus@linux.intel.com>,
	"'Jun Li'" <jun.li@nxp.com>, ShuFanLee <leechu729@gmail.com>,
	"cy_huang(黃啟原)" <cy_huang@richtek.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: [PATCH] USB TYPEC: RT1711H Type-C Chip Driver
Date: Mon, 22 Jan 2018 10:50:34 -0800	[thread overview]
Message-ID: <20180122185034.GA26058@roeck-us.net> (raw)
In-Reply-To: <dddc2060d19b47c69b582c9de51a85b1@ex1.rt.l>

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!

WARNING: multiple messages have this Message-ID (diff)
From: Guenter Roeck <linux@roeck-us.net>
To: "shufan_lee(李書帆)" <shufan_lee@richtek.com>
Cc: "Heikki Krogerus" <heikki.krogerus@linux.intel.com>,
	"'Jun Li'" <jun.li@nxp.com>, ShuFanLee <leechu729@gmail.com>,
	"cy_huang(黃啟原)" <cy_huang@richtek.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: USB TYPEC: RT1711H Type-C Chip Driver
Date: Mon, 22 Jan 2018 10:50:34 -0800	[thread overview]
Message-ID: <20180122185034.GA26058@roeck-us.net> (raw)

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!
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2018-01-22 18:50 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-10  6:59 [PATCH] USB TYPEC: RT1711H Type-C Chip Driver ShuFanLee
2018-01-10  6:59 ` ShuFanLee
2018-01-17  9:30 ` [PATCH] " shufan_lee(李書帆)
2018-01-17  9:30   ` shufan_lee(李書帆)
2018-01-17 11:08   ` [PATCH] " Heikki Krogerus
2018-01-17 11:08     ` Heikki Krogerus
2018-01-17 11:14     ` [PATCH] " Greg KH
2018-01-17 11:14       ` Greg Kroah-Hartman
2018-01-17 12:00       ` [PATCH] " Heikki Krogerus
2018-01-17 12:00         ` Heikki Krogerus
2018-01-17 13:31         ` [PATCH] " Greg KH
2018-01-17 13:31           ` Greg Kroah-Hartman
2018-01-17 13:33 ` [PATCH] " Greg KH
2018-01-17 13:33   ` Greg KH
2018-01-17 13:33 ` [PATCH] " Greg KH
2018-01-17 13:33   ` Greg KH
2018-01-17 13:42 ` [PATCH] " Greg KH
2018-01-17 13:42   ` Greg KH
2018-01-18 13:13   ` [PATCH] " shufan_lee(李書帆)
2018-01-18 13:13     ` shufan_lee(李書帆)
2018-01-19  8:03     ` [PATCH] " 'Greg KH'
2018-01-19  8:03       ` Greg KH
2018-01-19  3:09 ` [PATCH] " Jun Li
2018-01-19  3:09   ` Jun Li
2018-01-19  5:48   ` [PATCH] " shufan_lee(李書帆)
2018-01-19  5:48     ` shufan_lee(李書帆)
2018-01-19  8:22     ` [PATCH] " Heikki Krogerus
2018-01-19  8:22       ` Heikki Krogerus
2018-01-19  9:01       ` [PATCH] " shufan_lee(李書帆)
2018-01-19  9:01         ` shufan_lee(李書帆)
2018-01-19  9:24         ` [PATCH] " Heikki Krogerus
2018-01-19  9:24           ` Heikki Krogerus
2018-01-19 16:02           ` [PATCH] " Guenter Roeck
2018-01-19 16:02             ` Guenter Roeck
2018-01-22  2:01             ` [PATCH] " shufan_lee(李書帆)
2018-01-22  2:01               ` shufan_lee(李書帆)
2018-01-22 18:50               ` Guenter Roeck [this message]
2018-01-22 18:50                 ` Guenter Roeck
2018-01-29  7:19                 ` [PATCH] " shufan_lee(李書帆)
2018-01-29  7:19                   ` shufan_lee(李書帆)
2018-01-29 19:57                   ` [PATCH] " Guenter Roeck
2018-01-29 19:57                     ` Guenter Roeck
2018-01-30 13:21                     ` [PATCH] " shufan_lee(李書帆)
2018-01-30 13:21                       ` shufan_lee(李書帆)
2018-01-30 23:25                       ` [PATCH] " Guenter Roeck
2018-01-30 23:25                         ` Guenter Roeck
  -- strict thread matches above, loose matches on Subject: below --
2018-01-09  3:13 [PATCH] " shufan_lee(李書帆)
2018-01-09  6:18 ` Randy Dunlap
2018-01-09  8:45   ` shufan_lee(李書帆)
2018-01-09 17:26     ` Randy Dunlap
2018-01-10  2:49       ` shufan_lee(李書帆)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180122185034.GA26058@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=cy_huang@richtek.com \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=jun.li@nxp.com \
    --cc=leechu729@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=shufan_lee@richtek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.