From: Joe Perches <joe@perches.com>
To: Guenter Roeck <groeck@google.com>, Jun Li <jun.li@nxp.com>
Cc: Guenter Roeck <groeck@chromium.org>,
Felipe Balbi <felipe.balbi@linux.intel.com>,
Chandra Sekhar Anagani <chandra.sekhar.anagani@intel.com>,
Bruce Ashfield <bruce.ashfield@windriver.com>,
Bin Gao <bin.gao@intel.com>,
Pranav Tipnis <pranav.tipnis@intel.com>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: [RFC PATCH v3 1/2] usb: typec: USB Type-C Port Manager (tcpm)
Date: Fri, 30 Sep 2016 12:41:50 -0700 [thread overview]
Message-ID: <1475264510.1880.2.camel@perches.com> (raw)
In-Reply-To: <CABXOdTfMRFLohkH7aVOXwEi3cGh=nOPYToEVEY-9xJ8yYH9BBQ@mail.gmail.com>
On Fri, 2016-09-30 at 12:06 -0700, Guenter Roeck wrote:
> On Thu, Sep 29, 2016 at 11:37 PM, Jun Li <jun.li@nxp.com> wrote:
[]
> > diff --git a/include/linux/usb/pd.h b/include/linux/usb/pd.h
[]
> > +#define PDO_VAR(min_mv, max_mv, max_ma) \
> > + ((PDO_TYPE_VAR << PDO_TYPE_SHIFT) | \
> > + ((((min_mv) / 50) & PDO_VAR_MIN_VOLT_MASK) << \
> > + PDO_VAR_MIN_VOLT_SHIFT) | \
> > + ((((max_mv) / 50) & PDO_VAR_MAX_VOLT_MASK) << \
> > + PDO_VAR_MAX_VOLT_SHIFT) | \
> > + ((((max_ma) / 50) & PDO_VAR_MAX_CURR_MASK) << \
>
>
> ((((max_ma) / 10) & PDO_VAR_MAX_CURR_MASK) << \
This would be easier to read if laid out differently.
#define PDO_VAR(min_mv, max_mv, max_ma) \
((PDO_TYPE_VAR << PDO_TYPE_SHIFT) | \
((((min_mv) / 50) & PDO_VAR_MIN_VOLT_MASK) << PDO_VAR_MIN_VOLT_SHIFT) | \
((((max_mv) / 50) & PDO_VAR_MAX_VOLT_MASK) << PDO_VAR_MAX_VOLT_SHIFT) | \
((((max_ma) / 10) & PDO_VAR_MAX_CURR_MASK) << PDO_VAR_MAX_CURR_SHIFT))
next prev parent reply other threads:[~2016-09-30 19:42 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-23 21:10 [RFC PATCH v3 0/2] Type-C Port Manager Guenter Roeck
2016-08-23 21:10 ` [RFC PATCH v3 1/2] usb: typec: USB Type-C Port Manager (tcpm) Guenter Roeck
2016-09-10 0:26 ` Jun Li
2016-09-10 2:23 ` Guenter Roeck
2016-09-12 2:16 ` Jun Li
2016-09-12 2:23 ` Guenter Roeck
2016-09-12 2:41 ` Jun Li
2016-09-29 14:35 ` Jun Li
2016-09-29 16:36 ` Guenter Roeck
2016-09-30 6:41 ` Jun Li
2016-09-30 15:46 ` Guenter Roeck
2016-09-30 6:37 ` Jun Li
2016-09-30 19:06 ` Guenter Roeck
2016-09-30 19:41 ` Joe Perches [this message]
2016-09-30 20:57 ` Guenter Roeck
2016-09-30 21:02 ` Joe Perches
2016-10-03 14:04 ` Heikki Krogerus
2016-08-23 21:10 ` [RFC PATCH v3 2/2] usb: typec: Type-C Port Controller Interface driver (tcpci) Guenter Roeck
2016-09-30 6:24 ` Jun Li
2016-09-30 18:45 ` Guenter Roeck
2016-10-01 0:12 ` Jun Li
2016-10-01 16:27 ` Guenter Roeck
2016-08-24 12:52 ` [RFC PATCH v3 0/2] Type-C Port Manager Heikki Krogerus
2016-08-24 17:56 ` Guenter Roeck
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=1475264510.1880.2.camel@perches.com \
--to=joe@perches.com \
--cc=bin.gao@intel.com \
--cc=bruce.ashfield@windriver.com \
--cc=chandra.sekhar.anagani@intel.com \
--cc=felipe.balbi@linux.intel.com \
--cc=groeck@chromium.org \
--cc=groeck@google.com \
--cc=heikki.krogerus@linux.intel.com \
--cc=jun.li@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=pranav.tipnis@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome