[PATCH v2 2/2] usb: typec: ucsi: Add ACPI driver

2017-06-05 Thread Heikki Krogerus
Driver for ACPI UCSI interface method. This driver replaces the previous UCSI driver drivers/usb/misc/ucsi.c. Signed-off-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> --- drivers/usb/misc/Kconfig | 26 -- drivers/usb/misc/Makefile | 1 - drivers/usb/misc/

[PATCH v2 0/3] New driver for UCSI (USB Type-C)

2017-06-05 Thread Heikki Krogerus
also in ucsi.h as suggested by Guenter. - In ucsi_acpi.c, explicitly pointing out in the comment that we can not use devm_ioremap_resource() as suggested by Guenter. Heikki Krogerus (2): usb: typec: Add support for UCSI interface usb: typec: ucsi: Add ACPI driver drivers/usb/misc/Kconfig

[PATCH v2 1/2] usb: typec: Add support for UCSI interface

2017-06-05 Thread Heikki Krogerus
of the optional UCSI features (alternate modes, power source capabilities, and cable capabilities). Signed-off-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> --- drivers/usb/typec/Kconfig | 2 + drivers/usb/typec/Makefile | 1 + drivers/usb/typec/ucsi/Kconfig | 22 ++ drive

Re: [PATCH v6] usb: typec: Add a sysfs node to manage port type

2017-06-05 Thread Heikki Krogerus
g has not yet picked this: Acked-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> Thanks, -- heikki -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 3/3] usb: typec: ucsi: Add ACPI driver

2017-05-29 Thread Heikki Krogerus
On Fri, May 26, 2017 at 06:30:38AM -0700, Guenter Roeck wrote: > On 05/26/2017 04:08 AM, Heikki Krogerus wrote: > > Hi, > > > > On Thu, May 25, 2017 at 06:23:30AM -0700, Guenter Roeck wrote: > > > > + /* > > > > +* NOTE: The memor

Re: [PATCH 2/3] usb: typec: Add support for UCSI interface

2017-05-29 Thread Heikki Krogerus
On Fri, May 26, 2017 at 06:26:01AM -0700, Guenter Roeck wrote: > > > What happens if trace is not enabled ? If I recall discussions around > > > CLANG > > > correctly, it complains about unused static inline functions. > > > > Nothing happens if trace is not enable. Everything continues to > >

Re: [RFC PATCH] staging: typec: Intel WhiskeyCove PMIC USB Type-C PHY driver

2017-05-26 Thread Heikki Krogerus
Hi, My two cents. On Thu, May 25, 2017 at 10:12:27AM -0700, Guenter Roeck wrote: > > What is keeping this code in staging at the moment? Who isn't agreeing > > on the existing apis we have there? > > > > I don't think the APIs are at issue; I would not expect any substantial > (if any)

Re: [PATCH 3/3] usb: typec: ucsi: Add ACPI driver

2017-05-26 Thread Heikki Krogerus
Hi, On Thu, May 25, 2017 at 06:23:30AM -0700, Guenter Roeck wrote: > > + /* > > +* NOTE: The memory region for the data structures is used also in an > > +* operation region, which means ACPI has already reserved it. Therefore > > +* it can not be requested here. > > +*/ > > +

Re: [PATCH 2/3] usb: typec: Add support for UCSI interface

2017-05-26 Thread Heikki Krogerus
Hi, On Thu, May 25, 2017 at 06:20:16AM -0700, Guenter Roeck wrote: > On 05/16/2017 05:26 AM, Heikki Krogerus wrote: > > UCSI - USB Type-C Connector System Software Interface - is a > > specification that defines set of registers and data > > structures for controlling the U

Re: [RFC PATCH] staging: typec: Intel WhiskeyCove PMIC USB Type-C PHY driver

2017-05-25 Thread Heikki Krogerus
On Wed, May 24, 2017 at 08:22:35AM -0700, Guenter Roeck wrote: > On Wed, May 24, 2017 at 05:08:10PM +0200, Greg Kroah-Hartman wrote: > > On Wed, May 24, 2017 at 03:54:23PM +0300, Heikki Krogerus wrote: > > > Driver for USB Type-C PHY on Intel WhiskeyCove PMIC that > >

Re: [RFC PATCH] staging: typec: Intel WhiskeyCove PMIC USB Type-C PHY driver

2017-05-25 Thread Heikki Krogerus
On Wed, May 24, 2017 at 05:08:10PM +0200, Greg Kroah-Hartman wrote: > On Wed, May 24, 2017 at 03:54:23PM +0300, Heikki Krogerus wrote: > > Driver for USB Type-C PHY on Intel WhiskeyCove PMIC that > > works with Type-C Port Controller Manager to provide USB > > Power De

Re: [RFC PATCH] staging: typec: Intel WhiskeyCove PMIC USB Type-C PHY driver

2017-05-24 Thread Heikki Krogerus
On Wed, May 24, 2017 at 06:11:20AM -0700, Guenter Roeck wrote: > Hello Heikki, > > On 05/24/2017 05:54 AM, Heikki Krogerus wrote: > > Driver for USB Type-C PHY on Intel WhiskeyCove PMIC that > > works with Type-C Port Controller Manager to provide USB > > Po

[RFC PATCH] staging: typec: Intel WhiskeyCove PMIC USB Type-C PHY driver

2017-05-24 Thread Heikki Krogerus
Driver for USB Type-C PHY on Intel WhiskeyCove PMIC that works with Type-C Port Controller Manager to provide USB Power Delivery and USB Type-C functionalities Signed-off-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> --- drivers/staging/typec/Kconfig | 11 + drivers/staging

Re: [PATCH] usb: typec: Add a sysfs node to manage port type

2017-05-23 Thread Heikki Krogerus
On Tue, May 23, 2017 at 06:16:28AM -0700, Guenter Roeck wrote: > On 05/23/2017 03:46 AM, Heikki Krogerus wrote: > > Hi, > > > > On Mon, May 22, 2017 at 01:05:42PM -0700, Badhri Jagan Sridharan wrote: > > > User space applications in some cases have the need to enfo

Re: [PATCH] usb: typec: Add a sysfs node to manage port type

2017-05-23 Thread Heikki Krogerus
n has finished. > + > + Valid values: > + - DRP > + - DFP > + - UFP > > What: /sys/class/typec//supported_accessory_modes > Date:April 2017 > Contact: Heikki Krogerus <heikki.kroge.

Re: [PATCH] usb: typec: Defer checking of valid power role swap to low level drivers

2017-05-19 Thread Heikki Krogerus
On Thu, May 18, 2017 at 02:08:53PM -0700, Badhri Jagan Sridharan wrote: > On Thu, May 18, 2017 at 9:51 AM, Guenter Roeck wrote: > > On Thu, May 18, 2017 at 11:13:51AM +0200, Oliver Neukum wrote: > >> Am Mittwoch, den 17.05.2017, 02:36 -0700 schrieb Guenter Roeck: > >> > On

Re: [PATCH] usb: typec: Defer checking of valid power role swap to low level drivers

2017-05-17 Thread Heikki Krogerus
On Wed, May 17, 2017 at 06:02:47AM -0700, Guenter Roeck wrote: > On 05/17/2017 05:38 AM, Heikki Krogerus wrote: > > Hi guys, > > > > On Wed, May 17, 2017 at 02:36:44AM -0700, Guenter Roeck wrote: > > > On 05/17/2017 12:34 AM, Oliver Neukum wrote: > > > >

Re: [PATCH] doc-rst: fixed kernel-doc directives in usb/typec.rst

2017-05-17 Thread Heikki Krogerus
On Sat, May 13, 2017 at 03:49:17PM +0200, Markus Heiser wrote: > Even if this file is not yet included in any toctree, it is parsed by > Sphinx since it is named '.rst'. This patch fixes the following two > ERRORs from Sphinx build: > > Documentation/usb/typec.rst:116: ERROR: Error in

Re: [PATCH] usb: typec: Defer checking of valid power role swap to low level drivers

2017-05-17 Thread Heikki Krogerus
Hi guys, On Wed, May 17, 2017 at 02:36:44AM -0700, Guenter Roeck wrote: > On 05/17/2017 12:34 AM, Oliver Neukum wrote: > > Am Mittwoch, den 17.05.2017, 00:32 -0700 schrieb Badhri Jagan > > Sridharan: > > > > Hi, > > > > > "Two independent set of mechanisms are defined to allow a USB Type-C > >

[PATCH 3/3] usb: typec: ucsi: Add ACPI driver

2017-05-16 Thread Heikki Krogerus
Driver for ACPI UCSI interface method. This driver replaces the previous UCSI driver drivers/usb/misc/ucsi.c. Signed-off-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> --- drivers/usb/misc/Kconfig | 26 -- drivers/usb/misc/Makefile | 1 - drivers/usb/misc/

[PATCH 0/3] usb: typec: Add proper UCSI support

2017-05-16 Thread Heikki Krogerus
for other interface methods later. Heikki Krogerus (3): usb: typec: update partner power delivery support with opmode usb: typec: Add support for UCSI interface usb: typec: ucsi: Add ACPI driver drivers/usb/misc/Kconfig| 26 -- drivers/usb/misc/Makefile | 1

[PATCH 2/3] usb: typec: Add support for UCSI interface

2017-05-16 Thread Heikki Krogerus
of the optional UCSI features (alternate modes, power source capabilities, and cable capabilities). Signed-off-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> --- drivers/usb/typec/Kconfig | 2 + drivers/usb/typec/Makefile | 1 + drivers/usb/typec/ucsi/Kconfig | 22 ++ drive

[PATCH 1/3] usb: typec: update partner power delivery support with opmode

2017-05-16 Thread Heikki Krogerus
If USB PD contract is established after creation of the partner, the power delivery support attribute of the partner needs to be updated separately. This can be done in typec_set_pwr_opmode() by checking if the port has already partner and updating the value if it does. Signed-off-by: Heikki

Re: [PATCH v5 2/3] phy: Move ULPI phy header out of drivers to include path

2017-05-11 Thread Heikki Krogerus
t; > Cc: Stephen Boyd <stephen.b...@linaro.org> > Cc: Heikki Krogerus <heikki.kroge...@linux.intel.com> > Cc: Kishon Vijay Abraham I <kis...@ti.com> > Cc: linux-arm-ker...@lists.infradead.org > Cc: linux-ker...@vger.kernel.org > Cc: linux-o...@vger.kernel.org > Cc

Re: [PATCH] usb: misc: legousbtower: Fix memory leak

2017-05-05 Thread Heikki Krogerus
;Fixes" tag: Fixes: 942a48730faf ("usb: misc: legousbtower: Fix buffers on stack") Please check Documentation/process/submitting-patches.rst for more information. > Signed-off-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> You are signing the patch for me which y

Re: [PATCH v3] usb: misc: legousbtower: Fix buffers on stack

2017-05-04 Thread Heikki Krogerus
Hi Maksim, Sorry for commenting this so late but.. On Tue, Apr 25, 2017 at 10:49:21PM +0300, Maksim Salau wrote: > @@ -806,7 +814,7 @@ static int tower_probe (struct usb_interface *interface, > const struct usb_device > struct device *idev = >dev; > struct usb_device *udev =

Re: [PATCH v1] ACPI: Switch to use generic UUID API

2017-05-04 Thread Heikki Krogerus
;bske...@redhat.com> > Cc: Benjamin Tissoires <benjamin.tissoi...@redhat.com> > Cc: Joerg Roedel <j...@8bytes.org> > Cc: Adrian Hunter <adrian.hun...@intel.com> > Cc: Yisen Zhuang <yisen.zhu...@huawei.com> > Cc: Bjorn Helgaas <bhelg...@google.com&

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-28 Thread Heikki Krogerus
On Thu, Apr 27, 2017 at 11:10:55AM -0700, Guenter Roeck wrote: > On Thu, Apr 27, 2017 at 11:50:12AM +0530, Rajaram R wrote: > > On Tue, Apr 25, 2017 at 7:40 PM, Guenter Roeck wrote: > > > On 04/25/2017 01:26 AM, Rajaram R wrote: > > >> > > >> On Mon, Apr 24, 2017 at 11:20 PM,

Re: [PATCH v4] usb: typec: Don't prevent using constant typec_mode_desc initializers

2017-04-28 Thread Heikki Krogerus
On Fri, Apr 28, 2017 at 11:25:34AM +0200, Greg KH wrote: > On Wed, Apr 26, 2017 at 01:08:02PM +0300, Heikki Krogerus wrote: > > Hi Mats, > > > > On Tue, Apr 25, 2017 at 11:49:47PM +0200, Mats Karrman wrote: > > > In some situations, e.g. when registering a

Re: [PATCH v4] usb: typec: Don't prevent using constant typec_mode_desc initializers

2017-04-26 Thread Heikki Krogerus
r_altmode() > et.al. to using const pointers. > > Signed-off-by: Mats Karrman <mats.dev.l...@gmail.com> > Reviewed-by: Guenter Roeck <gro...@chromium.org> This is OK by me. FWIW: Acked-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> FYI, in case you guys are i

Re: [RFC PATCH v5 1/2] usb: typec: USB Type-C Port Manager (tcpm)

2017-04-25 Thread Heikki Krogerus
Hi Guenter, On Fri, Apr 21, 2017 at 03:15:52PM -0700, Guenter Roeck wrote: > +/* > + * Logging > + */ > + > +#ifdef CONFIG_DEBUG_FS > + > +static bool tcpm_log_full(struct tcpm_port *port) > +{ > + return port->logbuffer_tail == > + (port->logbuffer_head + 1) % LOG_BUFFER_ENTRIES;

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-21 Thread Heikki Krogerus
Hi, On Thu, Apr 20, 2017 at 12:46:59PM -0700, Badhri Jagan Sridharan wrote: > Thanks for the responses :) > > So seems like we have a plan. > > In Type-C connector class the checks for TYPEC_PWR_MODE_PD > and pd_revision for both the port and the partner will be removed in > power_role_store

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-20 Thread Heikki Krogerus
On Wed, Apr 19, 2017 at 10:22:47AM -0700, Badhri Jagan Sridharan wrote: > On Wed, Apr 19, 2017 at 8:14 AM, Guenter Roeck <li...@roeck-us.net> wrote: > > On Wed, Apr 19, 2017 at 07:45:00AM -0700, Badhri Jagan Sridharan wrote: > >> On Wed, Apr 19, 2017 at 4:23 AM, Heikki Kro

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-20 Thread Heikki Krogerus
Hi, On Wed, Apr 19, 2017 at 07:45:00AM -0700, Badhri Jagan Sridharan wrote: > >> What is the expected behavior when the userspace changes the > >> preferred_role node when the port is in connected state ? > >> > >> 1. the state machine re-resolves the port roles right away based on > >> the new

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-04-19 Thread Heikki Krogerus
Hi, On Tue, Apr 18, 2017 at 11:52:33AM -0700, Badhri Jagan Sridharan wrote: > Hi Heikki, > > I have a question regarding the preferred_role node. > > +What: /sys/class/typec//preferred_role > +Date: March 2017 > +Contact: Heikki Krogerus <heikki.

Re: usb: typec: Missing link for altmode active store

2017-04-18 Thread Heikki Krogerus
Hi Mats, On Sun, Apr 16, 2017 at 09:28:01PM +0200, Mats Karrman wrote: > Hello Heikki, > > I'm working with the new typec class code and have run into a problem. > The struct typec_capability defines a callback function as: > > int (*activate_mode)(const struct typec_capability *, int mode, int

Re: [PATCH v17 0/3] USB Type-C Connector class

2017-03-23 Thread Heikki Krogerus
Hi Mats, On Wed, Mar 22, 2017 at 10:15:20PM +0100, Mats Karrman wrote: > On 03/21/2017 11:37 AM, Heikki Krogerus wrote: > > > > I'm lost in the long thread here, is this series still ready to be > > > merged in, or is there another version that is being worked on? > &g

[PATCH v18 2/3] usb: USB Type-C connector class

2017-03-21 Thread Heikki Krogerus
and Alternate Modes. Signed-off-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerb...@linux.intel.com> Reviewed-and-Tested-by: Felipe Balbi <felipe.ba...@linux.intel.com> Tested-by: Guenter Roeck <li...@roeck-us.net> --- Documentation

[PATCH v18 0/3] USB Type-C Connector class

2017-03-21 Thread Heikki Krogerus
en when the partner type is not "Accessory". Changes since v2: - Notification on role and alternate mode changes - cleanups Changes since v1: - Completely rewrote alternate mode support - Patners, cables and cable plugs presented as devices. Heikki Krogerus (3): lib/string: add sysf

[PATCH v18 1/3] lib/string: add sysfs_match_string helper

2017-03-21 Thread Heikki Krogerus
Make a simple helper for matching strings with sysfs attribute files. In most parts the same as match_string(), except sysfs_match_string() uses sysfs_streq() instead of strcmp() for matching. This is more convenient when used with sysfs attributes. Signed-off-by: Heikki Krogerus <heikki.kr

[PATCH v18 3/3] usb: typec: add driver for Intel Whiskey Cove PMIC USB Type-C PHY

2017-03-21 Thread Heikki Krogerus
This adds driver for the USB Type-C PHY on Intel WhiskeyCove PMIC which is available on some of the Intel Broxton SoC based platforms. Signed-off-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerb...@linux.intel.com> Reviewed-and-Teste

Re: [PATCH v17 0/3] USB Type-C Connector class

2017-03-21 Thread Heikki Krogerus
On Tue, Feb 21, 2017 at 05:42:35PM +0200, Felipe Balbi wrote: > Just to clarify one thing here: wherever it says "Reviewed-by: Felipe > Balbi..." you could also read "Reviewed-and-Tested-by: Felipe Balbi..." > as I have been running these patches for past few months to test code on > Intel Joule.

Re: [PATCH v17 0/3] USB Type-C Connector class

2017-03-21 Thread Heikki Krogerus
On Tue, Mar 21, 2017 at 11:23:37AM +0100, Greg KH wrote: > On Tue, Feb 21, 2017 at 05:24:02PM +0300, Heikki Krogerus wrote: > > The USB Type-C class is meant to provide unified interface to the > > userspace to present the USB Type-C ports in a system. > > > > Cha

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-08 Thread Heikki Krogerus
On Tue, Mar 07, 2017 at 11:30:54PM +0100, Mats Karrman wrote: > > > So, both the DP controller and the USB PD phy are I2C devices, and now I > > > have to make them both > > > attach to the AM bus as well? > > The DP controller would provide the driver and the USB PD phy > > (actually, the typec

Re: query on UCSI

2017-03-07 Thread Heikki Krogerus
Hi, On Tue, Mar 07, 2017 at 12:39:39AM +0530, Shah, Nehal-bakulchandra wrote: > Hi Heikki , > > > Thanks for the prompt reply. > If i understood correctly the current driver(drivers/usb/misc/ucsi.c) supports > the OPM and rest all is taken care by EC FW with BIOS . > In ucsi.c file i did not

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-07 Thread Heikki Krogerus
On Tue, Mar 07, 2017 at 01:36:29AM +, Peter Chen wrote: > >On Mon, Mar 06, 2017 at 09:15:51AM +0800, Peter Chen wrote: > >> > > What interface you use when you receive this event to handle > >> > > dual-role switch? I am wonder if a common dual-role class is > >> > > needed, then we can have a

Re: query on UCSI

2017-03-06 Thread Heikki Krogerus
Hi, On Mon, Mar 06, 2017 at 02:41:17PM +0530, Shah, Nehal-bakulchandra wrote: > Hi Greg and Heikki, > > > I can see that ucsi acpi interface driver is available in kernel tree. I have > following queries on the same. Kindly pardon my ignorance as i am a novice to > this. > > - Is there any

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-06 Thread Heikki Krogerus
Hi Peter, On Mon, Mar 06, 2017 at 09:15:51AM +0800, Peter Chen wrote: > > > What interface you use when you receive this event to handle > > > dual-role switch? I am wonder if a common dual-role class is > > > needed, then we can have a common user utility. > > > > > > Eg, if "data_role" has

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-06 Thread Heikki Krogerus
Hi Mats, On Fri, Mar 03, 2017 at 08:27:08PM +0100, Mats Karrman wrote: > On 2017-03-03 13:59, Heikki Krogerus wrote: > > > On Fri, Mar 03, 2017 at 08:29:18AM +0100, Mats Karrman wrote: > > > > > How would something like that sound to you guys? > >

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-03 Thread Heikki Krogerus
Hi Peter, On Fri, Mar 03, 2017 at 11:35:29AM +0800, Peter Chen wrote: > On Tue, Feb 21, 2017 at 05:24:04PM +0300, Heikki Krogerus wrote: > > +/* --- */ > > +/* Driver callbacks to report role updates */ > > + > > +/** > > + *

Re: [PATCH v17 2/3] usb: USB Type-C connector class

2017-03-03 Thread Heikki Krogerus
Hi, On Fri, Mar 03, 2017 at 08:29:18AM +0100, Mats Karrman wrote: > On 2017-03-03 04:13, Guenter Roeck wrote: > > > On 03/02/2017 07:22 AM, Mats Karrman wrote: > > > > > > Looking forward, one thing I have run into is how to connect the typec > > > driver with a > > > driver for an

[PATCH v17 2/3] usb: USB Type-C connector class

2017-02-21 Thread Heikki Krogerus
and Alternate Modes. Signed-off-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerb...@linux.intel.com> Reviewed-by: Felipe Balbi <felipe.ba...@linux.intel.com> Tested-by: Guenter Roeck <li...@roeck-us.net> --- Documentation/ABI/t

[PATCH v17 0/3] USB Type-C Connector class

2017-02-21 Thread Heikki Krogerus
. Changes since v2: - Notification on role and alternate mode changes - cleanups Changes since v1: - Completely rewrote alternate mode support - Patners, cables and cable plugs presented as devices. Heikki Krogerus (3): lib/string: add sysfs_match_string helper usb: USB Type-C connector cla

[PATCH v17 3/3] usb: typec: add driver for Intel Whiskey Cove PMIC USB Type-C PHY

2017-02-21 Thread Heikki Krogerus
This adds driver for the USB Type-C PHY on Intel WhiskeyCove PMIC which is available on some of the Intel Broxton SoC based platforms. Signed-off-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerb...@linux.intel.com> Reviewed-by:

[PATCH v17 1/3] lib/string: add sysfs_match_string helper

2017-02-21 Thread Heikki Krogerus
Make a simple helper for matching strings with sysfs attribute files. In most parts the same as match_string(), except sysfs_match_string() uses sysfs_streq() instead of strcmp() for matching. This is more convenient when used with sysfs attributes. Signed-off-by: Heikki Krogerus <heikki.kr

Re: [PATCH] usb: typec: fix ptr_ret.cocci warnings

2017-02-10 Thread Heikki Krogerus
On Tue, Jan 31, 2017 at 01:38:34AM +0800, kbuild test robot wrote: > drivers/usb/typec/typec.c:1249:1-3: WARNING: PTR_ERR_OR_ZERO can be used > > > Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR > > Generated by: scripts/coccinelle/api/ptr_ret.cocci >

[PATCH v16 1/3] lib/string: add sysfs_match_string helper

2017-01-30 Thread Heikki Krogerus
Make a simple helper for matching strings with sysfs attribute files. In most parts the same as match_string(), except sysfs_match_string() uses sysfs_streq() instead of strcmp() for matching. This is more convenient when used with sysfs attributes. Signed-off-by: Heikki Krogerus <heikki.kr

[PATCH v16 2/3] usb: USB Type-C connector class

2017-01-30 Thread Heikki Krogerus
and Alternate Modes. Signed-off-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerb...@linux.intel.com> Reviewed-by: Felipe Balbi <felipe.ba...@linux.intel.com> --- Documentation/ABI/testing/sysfs-class-typec | 276 ++ Documenta

[PATCH v16 0/3] USB Type-C Connector class

2017-01-30 Thread Heikki Krogerus
hanges - cleanups Changes since v1: - Completely rewrote alternate mode support - Patners, cables and cable plugs presented as devices. Heikki Krogerus (3): lib/string: add sysfs_match_string helper usb: USB Type-C connector class usb: typec: add driver for Intel Whiskey Cove PMIC USB Type-C PH

[PATCH v16 3/3] usb: typec: add driver for Intel Whiskey Cove PMIC USB Type-C PHY

2017-01-30 Thread Heikki Krogerus
This adds driver for the USB Type-C PHY on Intel WhiskeyCove PMIC which is available on some of the Intel Broxton SoC based platforms. Signed-off-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerb...@linux.intel.com> Reviewed-by:

Re: [PATCHv15 2/3] usb: USB Type-C connector class

2017-01-26 Thread Heikki Krogerus
On Wed, Jan 25, 2017 at 10:39:17AM -0800, Guenter Roeck wrote: > On Mon, Jan 23, 2017 at 04:44:23PM +0200, Felipe Balbi wrote: > > > > Hi, > > > > Heikki Krogerus <heikki.kroge...@linux.intel.com> writes: > > > +static void typec_report_identity(struct

Re: [PATCHv15 3/3] usb: typec: add driver for Intel Whiskey Cove PMIC USB Type-C PHY

2017-01-25 Thread Heikki Krogerus
On Wed, Jan 25, 2017 at 12:27:28PM +0200, Felipe Balbi wrote: > > Hi, > > Heikki Krogerus <heikki.kroge...@linux.intel.com> writes: > >> > +wcove->cap.prefer_role = TYPEC_NO_PREFERRED_ROLE; > >> > >> we have a slight problem here that

Re: [PATCHv15 3/3] usb: typec: add driver for Intel Whiskey Cove PMIC USB Type-C PHY

2017-01-25 Thread Heikki Krogerus
On Mon, Jan 23, 2017 at 04:20:08PM +0200, Felipe Balbi wrote: > Heikki Krogerus <heikki.kroge...@linux.intel.com> writes: > > +static int wcove_typec_probe(struct platform_device *pdev) > > +{ > > [snip] > > > + wcove->cap.prefer_role = TYPEC_NO_PREFER

Re: [PATCHv15 2/3] usb: USB Type-C connector class

2017-01-25 Thread Heikki Krogerus
t; > + NULL, > > +}; > > +ATTRIBUTE_GROUPS(typec); > > + > > +static int typec_uevent(struct device *dev, struct kobj_uevent_env *env) > > +{ > > + int ret; > > + > > + ret = add_uevent_var(env, "TYPEC_PORT=%s", dev_name(dev)); > >

Re: [PATCHv15 2/3] usb: USB Type-C connector class

2017-01-25 Thread Heikki Krogerus
Hi, On Mon, Jan 23, 2017 at 04:44:23PM +0200, Felipe Balbi wrote: > Heikki Krogerus <heikki.kroge...@linux.intel.com> writes: > > +static void typec_report_identity(struct device *dev) > > +{ > > + sysfs_notify(>kobj, "identity", "id_header");

Re: [PATCHv15 2/3] usb: USB Type-C connector class

2017-01-17 Thread Heikki Krogerus
Hi Greg, On Mon, Jan 16, 2017 at 04:35:24PM +0100, Greg KH wrote: > On Mon, Jan 16, 2017 at 05:56:13PM +0300, Heikki Krogerus wrote: > > The purpose of USB Type-C connector class is to provide > > unified interface for the user space to get the status and > > basic informa

[PATCHv15 2/3] usb: USB Type-C connector class

2017-01-16 Thread Heikki Krogerus
and Alternate Modes. Signed-off-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerb...@linux.intel.com> --- Documentation/ABI/testing/sysfs-class-typec | 289 ++ Documentation/usb/typec.rst | 185

[PATCHv15 3/3] usb: typec: add driver for Intel Whiskey Cove PMIC USB Type-C PHY

2017-01-16 Thread Heikki Krogerus
This adds driver for the USB Type-C PHY on Intel WhiskeyCove PMIC which is available on some of the Intel Broxton SoC based platforms. Signed-off-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerb...@linux.intel.com> --- drivers/usb/t

[PATCHv15 1/3] lib/string: add sysfs_match_string helper

2017-01-16 Thread Heikki Krogerus
Make a simple helper for matching strings with sysfs attribute files. In most parts the same as match_string(), except sysfs_match_string() uses sysfs_streq() instead of strcmp() for matching. This is more convenient when used with sysfs attributes. Signed-off-by: Heikki Krogerus <heikki.kr

[PATCHv15 0/3] USB Type-C Connector class

2017-01-16 Thread Heikki Krogerus
artner attribute "accessory" is hidden when the partner type is not "Accessory". Changes since v2: - Notification on role and alternate mode changes - cleanups Changes since v1: - Completely rewrote alternate mode support - Patners, cables and cable plugs presented as devices. Heikki Kroge

Re: [PATCHv14 2/3] usb: USB Type-C connector class

2017-01-11 Thread Heikki Krogerus
Hi Guenter, On Tue, Jan 10, 2017 at 09:35:42AM -0800, Guenter Roeck wrote: > > I guess we might as well then split the VDO into header, cert stat and > > product parts. What do you think? > > > > If it's OK, then should we change that file to "identity" and dump the > > whole response from

Re: [PATCHv14 2/3] usb: USB Type-C connector class

2017-01-10 Thread Heikki Krogerus
On Tue, Jan 10, 2017 at 11:08:51AM +0100, Oliver Neukum wrote: > > 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

Re: [PATCHv14 2/3] usb: USB Type-C connector class

2017-01-10 Thread Heikki Krogerus
On Tue, Jan 10, 2017 at 05:50:04AM -0800, Guenter Roeck wrote: > On 01/10/2017 12:54 AM, Heikki Krogerus wrote: > > Hi Guenter, > > > > On Mon, Jan 09, 2017 at 08:59:32AM -0800, Guenter Roeck wrote: > > > > +/** > > > > + * typec_register_partner - Re

Re: [PATCHv14 2/3] usb: USB Type-C connector class

2017-01-10 Thread Heikki Krogerus
Hi Guenter, On Mon, Jan 09, 2017 at 08:59:32AM -0800, Guenter Roeck wrote: > > +/** > > + * typec_register_partner - Register a USB Type-C Partner > > + * @port: The USB Type-C Port the partner is connected to > > + * @desc: Description of the partner > > + * > > + * Registers a device for USB

Re: [PATCHv14 2/3] usb: USB Type-C connector class

2017-01-06 Thread Heikki Krogerus
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, > > +

[PATCHv14 3/3] usb: typec: add driver for Intel Whiskey Cove PMIC USB Type-C PHY

2017-01-05 Thread Heikki Krogerus
This adds driver for the USB Type-C PHY on Intel WhiskeyCove PMIC which is available on some of the Intel Broxton SoC based platforms. Signed-off-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> --- drivers/usb/typec/Kconfig | 14 ++ drivers/usb/typec/Makefile | 1 + d

[PATCHv14 1/3] lib/string: add sysfs_match_string helper

2017-01-05 Thread Heikki Krogerus
Make a simple helper for matching strings with sysfs attribute files. In most parts the same as match_string(), except sysfs_match_string() uses sysfs_streq() instead of strcmp() for matching. This is more convenient when used with sysfs attributes. Signed-off-by: Heikki Krogerus <heikki.kr

[PATCHv14 2/3] usb: USB Type-C connector class

2017-01-05 Thread Heikki Krogerus
and Alternate Modes. Signed-off-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> --- Documentation/ABI/testing/sysfs-class-typec | 219 + Documentation/usb/typec.txt | 181 MAINTAINERS |9 + drivers/usb/K

[PATCHv14 0/3] USB Type-C Connector class

2017-01-05 Thread Heikki Krogerus
y rewrote alternate mode support - Patners, cables and cable plugs presented as devices. Heikki Krogerus (3): lib/string: add sysfs_match_string helper usb: USB Type-C connector class usb: typec: add driver for Intel Whiskey Cove PMIC USB Type-C PHY Documentation/ABI/testing/sysfs-cla

Re: [RFC PATCH] usb: USB Type-C connector class

2016-12-20 Thread Heikki Krogerus
On Mon, Dec 19, 2016 at 09:22:33AM -0800, Guenter Roeck wrote: > On 12/19/2016 06:45 AM, Heikki Krogerus wrote: > > The purpose of USB Type-C connector class is to provide > > unified interface for the user space to get the status and > > basic information about USB Type-C c

[RFC PATCH] usb: USB Type-C connector class

2016-12-19 Thread Heikki Krogerus
and Alternate Modes. Signed-off-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> --- Documentation/ABI/testing/sysfs-class-typec | 220 ++ Documentation/usb/typec.txt | 174 + MAINTAINERS |9 + drivers/usb/K

Re: [PATCHv13 2/3] usb: USB Type-C connector class

2016-12-15 Thread Heikki Krogerus
On Wed, Dec 07, 2016 at 02:52:31PM +0200, Heikki Krogerus wrote: > Hi Oliver, > > On Wed, Dec 07, 2016 at 10:46:48AM +0100, Oliver Neukum wrote: > > On Fri, 2016-12-02 at 10:04 -0800, Guenter Roeck wrote: > > > > Hi, > > > > > At least for my pa

Re: [PATCHv13,1/3] lib/string: add sysfs_match_string helper

2016-12-07 Thread Heikki Krogerus
On Wed, Dec 07, 2016 at 03:54:45PM -0800, Guenter Roeck wrote: > > +int __sysfs_match_string(const char * const *array, size_t n, const char > > *str) > > +{ > > + const char *item; > > + int index; > > + > > + for (index = 0; index < n; index++) { > > + item = array[index]; > > +

Re: [PATCHv13 2/3] usb: USB Type-C connector class

2016-12-07 Thread Heikki Krogerus
Hi Oliver, On Wed, Dec 07, 2016 at 10:46:48AM +0100, Oliver Neukum wrote: > On Fri, 2016-12-02 at 10:04 -0800, Guenter Roeck wrote: > > Hi, > > > At least for my part I very much concentrated on making sure that > > the user space ABI as well as the port driver API are sane and usable. > >

Re: [PATCHv13 2/3] usb: USB Type-C connector class

2016-12-07 Thread Heikki Krogerus
On Fri, Dec 02, 2016 at 10:04:39AM -0800, Guenter Roeck wrote: > At least for my part I very much concentrated on making sure that > the user space ABI as well as the port driver API are sane and usable. > > The driver interface is not my area of expertise. As such, my testing > and understanding

Re: [PATCHv13 2/3] usb: USB Type-C connector class

2016-11-30 Thread Heikki Krogerus
Hi Greg, On Tue, Nov 29, 2016 at 05:27:44PM +0100, Greg KH wrote: > > +struct typec_cable { > > + struct device dev; > > + enum typec_plug_typetype; > > + u32 vdo; > > + unsigned intusb_pd:1; > > + unsigned intactive:1; > > +

Re: [PATCHv12 2/3] usb: USB Type-C connector class

2016-11-29 Thread Heikki Krogerus
Hi Guenter, On Mon, Nov 28, 2016 at 12:11:43PM -0800, Guenter Roeck wrote: > Personally I don't really care about a module parameter; as mentioned above, > I would expect the preference, if it needs to be selectable, to be configured > with devicetree or ACPI properties (or by a platform driver

Re: [PATCHv12 2/3] usb: USB Type-C connector class

2016-11-28 Thread Heikki Krogerus
On Mon, Nov 28, 2016 at 11:19:32AM +0100, Oliver Neukum wrote: > On Thu, 2016-11-24 at 11:57 +0200, Heikki Krogerus wrote: > > On Wed, Nov 23, 2016 at 09:12:04PM -0800, Guenter Roeck wrote: > > > > In our implementation, the default preferred role is determined by the &

[PATCHv13 2/3] usb: USB Type-C connector class

2016-11-24 Thread Heikki Krogerus
and Alternate Modes. Signed-off-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> Reviewed-by: Guenter Roeck <li...@roeck-us.net> Tested-by: Guenter Roeck <li...@roeck-us.net> --- Documentation/ABI/testing/sysfs-class-typec | 220 ++ Documentation/usb/typec.txt

[PATCHv13 1/3] lib/string: add sysfs_match_string helper

2016-11-24 Thread Heikki Krogerus
Make a simple helper for matching strings with sysfs attribute files. In most parts the same as match_string(), except sysfs_match_string() uses sysfs_streq() instead of strcmp() for matching. This is more convenient when used with sysfs attributes. Signed-off-by: Heikki Krogerus <heikki.kr

[PATCHv13 3/3] usb: typec: add driver for Intel Whiskey Cove PMIC USB Type-C PHY

2016-11-24 Thread Heikki Krogerus
This adds driver for the USB Type-C PHY on Intel WhiskeyCove PMIC which is available on some of the Intel Broxton SoC based platforms. Signed-off-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> Reviewed-by: Guenter Roeck <li...@roeck-us.net> --- drivers/usb/typec/Kconfig

[PATCHv13 0/3] USB Type-C Connector class

2016-11-24 Thread Heikki Krogerus
unication. - Partner attribute "accessory" is hidden when the partner type is not "Accessory". Changes since v2: - Notification on role and alternate mode changes - cleanups Changes since v1: - Completely rewrote alternate mode support - Patners, cables and cable plugs present

Re: [PATCHv12 2/3] usb: USB Type-C connector class

2016-11-24 Thread Heikki Krogerus
On Wed, Nov 23, 2016 at 09:12:04PM -0800, Guenter Roeck wrote: > Hello Heikki, > > On 11/22/2016 06:11 AM, Heikki Krogerus wrote: > [ ... ] > > + > > +struct typec_port *typec_register_port(struct device *dev, > > + cons

Re: [PATCHv12 0/3] USB Type-C Connector class

2016-11-23 Thread Heikki Krogerus
Hi Guenter, On Tue, Nov 22, 2016 at 04:11:44PM +0200, Heikki Krogerus wrote: > The USB Type-C class is meant to provide unified interface to the > userspace to present the USB Type-C ports in a system. > > Changes since v11: > - The port drivers are responsible of removin

[PATCHv12 0/3] USB Type-C Connector class

2016-11-22 Thread Heikki Krogerus
Accessory". Changes since v2: - Notification on role and alternate mode changes - cleanups Changes since v1: - Completely rewrote alternate mode support - Patners, cables and cable plugs presented as devices. Heikki Krogerus (3): lib/string: add sysfs_match_string helper usb: USB Type-C

[PATCHv12 2/3] usb: USB Type-C connector class

2016-11-22 Thread Heikki Krogerus
and Alternate Modes. Signed-off-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> --- Documentation/ABI/testing/sysfs-class-typec | 222 ++ Documentation/usb/typec.txt | 103 +++ MAINTAINERS |9 + drivers/usb/K

[PATCHv12 1/3] lib/string: add sysfs_match_string helper

2016-11-22 Thread Heikki Krogerus
Make a simple helper for matching strings with sysfs attribute files. In most parts the same as match_string(), except sysfs_match_string() uses sysfs_streq() instead of strcmp() for matching. This is more convenient when used with sysfs attributes. Signed-off-by: Heikki Krogerus <heikki.kr

[PATCHv12 3/3] usb: typec: add driver for Intel Whiskey Cove PMIC USB Type-C PHY

2016-11-22 Thread Heikki Krogerus
This adds driver for the USB Type-C PHY on Intel WhiskeyCove PMIC which is available on some of the Intel Broxton SoC based platforms. Signed-off-by: Heikki Krogerus <heikki.kroge...@linux.intel.com> --- drivers/usb/typec/Kconfig | 14 ++ drivers/usb/typec/Makefile | 1 + d

Re: [PATCHv11 2/3] usb: USB Type-C connector class

2016-11-22 Thread Heikki Krogerus
On Mon, Nov 21, 2016 at 03:45:06PM +0100, Greg KH wrote: > Again, free the device for which this release function is being called > for, that is why it is there. I will. Thanks, -- heikki -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to

Re: [PATCHv11 2/3] usb: USB Type-C connector class

2016-11-22 Thread Heikki Krogerus
On Tue, Nov 22, 2016 at 12:51:11PM +0200, Heikki Krogerus wrote: > Hi Greg, > > On Mon, Nov 21, 2016 at 03:45:06PM +0100, Greg KH wrote: > > > We could allocate an extra structure for the partner when > > > typec_connect() is called, but we would do that just f

<    1   2   3   4   5   6   7   8   9   10   >