From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Mika Westerberg <mika.westerberg@linux.intel.com>,
Guenter Roeck <linux@roeck-us.net>,
Oliver Neukum <oneukum@suse.com>
Cc: Greg KH <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCHv14 2/3] usb: USB Type-C connector class
Date: Fri, 6 Jan 2017 12:54:05 +0200 [thread overview]
Message-ID: <20170106105405.GA31031@kuha.fi.intel.com> (raw)
In-Reply-To: <20170105155402.GG3353@lahna.fi.intel.com>
Hi guys,
On Thu, Jan 05, 2017 at 05:54:02PM +0200, Mika Westerberg wrote:
> > +static ssize_t
> > +typec_altmode_roles_show(struct device *dev, struct device_attribute *attr,
> > + char *buf)
> > +{
> > + struct typec_mode *mode = container_of(attr, struct typec_mode,
> > + roles_attr);
> > + ssize_t ret;
> > +
> > + switch (mode->roles) {
> > + case TYPEC_PORT_DFP:
> > + ret = sprintf(buf, "source\n");
>
> Extra space after '='.
>
> > + break;
> > + case TYPEC_PORT_UFP:
> > + ret = sprintf(buf, "sink\n");
> > + break;
> > + case TYPEC_PORT_DRP:
> > + default:
> > + ret = sprintf(buf, "source\nsink\n");
>
> I wonder if "source sink" instead is better? Along the lines of
> /sys/power/state.
>
> Then you can print "[source] sink" when source is selected and so on.
That is more or less how I originally proposed how we list the roles
in general. I introduced the separate "current_*_role" and
"supported_*_roles" attribute files because somebody wanted them. I
don't remember the reason why they were preferred to be in separate
attribute files.
Oliver! Guenter! Do we really need to list the current and supported
roles in separate attribute files? Can't we just have the "power_role"
and "data_role" attribute files for the ports instead of the separate
"supported_*_roles" and "current_*_role", and show the current role
like Mika proposes? I definitely would prefer it that way because it
is similar style used in other places like Mike pointed out.
And since we are talking about the ABI, can we also change the listing
of the accessory mode back to just "audio" and "debug" like I
originally had it? I don't remember who and why wanted it to be
changed to "Audio Adapter Accessory Mode" and "Debug Accessory Mode",
but it differs from the style we list the other details.
Thanks,
--
heikki
next prev parent reply other threads:[~2017-01-06 11:00 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-05 11:01 [PATCHv14 0/3] USB Type-C Connector class Heikki Krogerus
2017-01-05 11:01 ` [PATCHv14 1/3] lib/string: add sysfs_match_string helper Heikki Krogerus
2017-01-05 11:01 ` [PATCHv14 2/3] usb: USB Type-C connector class Heikki Krogerus
2017-01-05 15:54 ` Mika Westerberg
2017-01-05 16:40 ` Greg KH
2017-01-06 10:54 ` Heikki Krogerus [this message]
2017-01-06 15:47 ` Guenter Roeck
2017-01-10 10:08 ` Oliver Neukum
2017-01-11 7:57 ` Heikki Krogerus
2017-01-11 9:05 ` Oliver Neukum
2017-01-09 16:59 ` Guenter Roeck
2017-01-10 8:54 ` Heikki Krogerus
2017-01-10 13:50 ` Guenter Roeck
2017-01-10 14:46 ` Heikki Krogerus
2017-01-10 17:35 ` Guenter Roeck
2017-01-11 11:05 ` Heikki Krogerus
2017-01-05 11:01 ` [PATCHv14 3/3] usb: typec: add driver for Intel Whiskey Cove PMIC USB Type-C PHY Heikki Krogerus
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=20170106105405.GA31031@kuha.fi.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=mika.westerberg@linux.intel.com \
--cc=oneukum@suse.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