[PATCH 13/14] usb: typec: ucsi: Remove struct ucsi_control

2019-09-26 Thread Heikki Krogerus
considerable and makes it much easier to for example add support for big endian systems later on. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/ucsi/displayport.c | 18 +-- drivers/usb/typec/ucsi/trace.c | 11 -- drivers/usb/typec/ucsi/trace.h | 50 +- drivers/usb/typec

[PATCH 12/14] usb: typec: ucsi: Remove the old API

2019-09-26 Thread Heikki Krogerus
The drivers now only use the new API, so removing the old one. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/ucsi/displayport.c | 8 +- drivers/usb/typec/ucsi/trace.h | 17 -- drivers/usb/typec/ucsi/ucsi.c| 346 +++ drivers/usb/typec/ucsi/ucsi.h

[PATCH 14/14] usb: typec: ucsi: Remove all bit-fields

2019-09-26 Thread Heikki Krogerus
We can't use bit fields with data that is received or send to/from the device. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/ucsi/trace.h | 12 ++--- drivers/usb/typec/ucsi/ucsi.c | 52 +++ drivers/usb/typec/ucsi/ucsi.h | 93 +- 3

[PATCH 10/14] usb: typec: ucsi: acpi: Move to the new API

2019-09-26 Thread Heikki Krogerus
/or complete pending command completions based on it. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/ucsi/ucsi_acpi.c | 96 -- 1 file changed, 77 insertions(+), 19 deletions(-) diff --git a/drivers/usb/typec/ucsi/ucsi_acpi.c b/drivers/usb/typec/ucsi/ucsi_acpi.

[PATCH 11/14] usb: typec: ucsi: ccg: Move to the new API

2019-09-26 Thread Heikki Krogerus
nd completions based on it. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/ucsi/ucsi_ccg.c | 172 +++--- 1 file changed, 87 insertions(+), 85 deletions(-) diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c b/drivers/usb/typec/ucsi/ucsi_ccg.c index d772fce51905..bbe87

[PATCH 04/14] usb: typec: tcpm: Start using struct typec_operations

2019-09-26 Thread Heikki Krogerus
Supplying the operation callbacks as part of a struct typec_operations instead of as part of struct typec_capability during port registration. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/tcpm/tcpm.c | 47 --- 1 file changed, 21 insertions(+), 26

[PATCH 09/14] usb: typec: ucsi: Simplified interface registration and I/O API

2019-09-26 Thread Heikki Krogerus
ucsi.c, and that should allow for example quirks to be handled completely in the drivers without the need to touch ucsi.c. The old API is kept until all drivers have been converted to the new API. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/ucsi/ucsi.c | 326

[PATCH 06/14] usb: typec: ucsi: Start using struct typec_operations

2019-09-26 Thread Heikki Krogerus
Supplying the operation callbacks as part of a struct typec_operations instead of as part of struct typec_capability during port registration. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/ucsi/ucsi.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff

[PATCH 01/14] usb: typec: Copy everything from struct typec_capability during registration

2019-09-26 Thread Heikki Krogerus
Copying everything from struct typec_capability to struct typec_port during port registration. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/class.c | 55 +-- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/drivers/usb/typec/class.c b

[PATCH 03/14] usb: typec: Separate the operations vector

2019-09-26 Thread Heikki Krogerus
Introducing struct typec_operations which has the same callbacks as struct typec_capability. The old callbacks are kept for now, but after all users have been converted, they will be removed. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/class.c | 90

[PATCH 02/14] usb: typec: Introduce typec_get_drvdata()

2019-09-26 Thread Heikki Krogerus
Leaving the private driver_data pointer of the port device to the port drivers. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/class.c | 11 +++ include/linux/usb/typec.h | 4 2 files changed, 15 insertions(+) diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec

[PATCH 08/14] usb: typec: ucsi: ccg: Remove run_isr flag

2019-09-26 Thread Heikki Krogerus
h ccg_read() and ccg_write() are called with the mutex already taken at least from ccg_send_command(). In ccg_read() and ccg_write, the mutex is only acquired so that run_isr flag can be set. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/ucsi/ucsi_ccg.c | 42 +++--

[PATCH 05/14] usb: typec: tps6598x: Start using struct typec_operations

2019-09-26 Thread Heikki Krogerus
Supplying the operation callbacks as part of a struct typec_operations instead of as part of struct typec_capability during port registration. After this there is not need to keep the capabilities stored anywhere in the driver. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/tps6598x.c

[PATCH 00/14] usb: typec: UCSI driver overhaul

2019-09-26 Thread Heikki Krogerus
ccg.c alone. There should not be any problem with that anymore. thanks, Heikki Krogerus (14): usb: typec: Copy everything from struct typec_capability during registration usb: typec: Introduce typec_get_drvdata() usb: typec: Separate the operations vector usb: typec: tcpm: Start usin

[PATCH 07/14] usb: typec: Remove the callback members from struct typec_capability

2019-09-26 Thread Heikki Krogerus
There are no more users for them. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/class.c | 65 +-- include/linux/usb/typec.h | 17 -- 2 files changed, 22 insertions(+), 60 deletions(-) diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec

Re: [RFC PATCH] usb: typec: ucsi: ccg: Remove run_isr flag

2019-09-24 Thread Heikki Krogerus
Hi Ajay, On Mon, Sep 23, 2019 at 06:15:59PM +, Ajay Gupta wrote: > Hi Heikki, > > > -Original Message- > > From: linux-usb-ow...@vger.kernel.org > > On Behalf Of Heikki Krogerus > > Sent: Monday, September 23, 2019 6:31 AM > > To: Ajay Gupt

[RFC PATCH] usb: typec: ucsi: ccg: Remove run_isr flag

2019-09-23 Thread Heikki Krogerus
so that run_isr flag can be set. Signed-off-by: Heikki Krogerus --- Hi Ajay, Before going forward with this I would like to get confirmation from you that it is OK, and that I'm not missing anything. I did not see any real purpose for that run_isr flag. The only thing that I can see it preve

Re: [PATCH v5] usb: typec: ucsi: add support for separate DP altmode devices

2019-09-19 Thread Heikki Krogerus
On Tue, Sep 17, 2019 at 09:41:49PM +, Ajay Gupta wrote: > Hi Heikki, > > > -Original Message- > > From: Heikki Krogerus > > Sent: Friday, September 13, 2019 8:20 AM > > To: Ajay Gupta > > Cc: linux-usb@vger.kernel.org; Ajay Gupta > > Sub

Re: [PATCH v5] usb: typec: ucsi: add support for separate DP altmode devices

2019-09-13 Thread Heikki Krogerus
Hi Ajay, On Fri, Sep 06, 2019 at 09:55:16AM -0700, Ajay Gupta wrote: > From: Ajay Gupta > > CCGx controller used on NVIDIA GPU card has two separate display > altmode for two DP pin assignments. UCSI specification doesn't > prohibits using separate display altmode. > > Current UCSI Type-C frame

Re: [PATCH v4] usb: typec: ucsi: add support for separate DP altmode devices

2019-09-06 Thread Heikki Krogerus
On Wed, Sep 04, 2019 at 09:27:14AM -0700, Ajay Gupta wrote: > From: Ajay Gupta > > CCGx controller used on NVIDIA GPU card has two separate display > altmode for two DP pin assignments. UCSI specification doesn't > prohibits using separate display altmode. > > Current UCSI Type-C framework expec

Re: [PATCH v4 2/2] usb: roles: intel: Enable static DRD mode for role switch

2019-08-29 Thread Heikki Krogerus
sed. But, do not enable > static DRD mode for Cherrytrail devices which rely on firmware > for role switch. > > Signed-off-by: Saranya Gopal > Signed-off-by: Balaji Manoharan Reviewed-by: Heikki Krogerus > --- > changes since v3: Initialized drd_config variable to fix war

Re: [PATCH v4 1/2] xhci-ext-caps.c: Add property to disable Intel SW switch

2019-08-29 Thread Heikki Krogerus
abled in > Cherrytrail devices. > > Signed-off-by: Saranya Gopal > Signed-off-by: Balaji Manoharan > Suggested-by: Heikki Krogerus Reviewed-by: Heikki Krogerus > --- > changes since v3: none > changes since v2: Added suggested-by tag > changes since v1:

Re: [PATCH v3 2/2] usb: roles: intel: Enable static DRD mode for role switch

2019-08-29 Thread Heikki Krogerus
Hi, > static int intel_xhci_usb_set_role(struct device *dev, enum usb_role role) > @@ -44,7 +52,7 @@ static int intel_xhci_usb_set_role(struct device *dev, enum > usb_role role) > struct intel_xhci_usb_data *data = dev_get_drvdata(dev); > unsigned long timeout; > acpi_status st

Re: [PATCH v2 2/2] usb: roles: intel: Enable static DRD mode for role switch

2019-08-28 Thread Heikki Krogerus
sed. But, do not enable > static DRD mode for Cherrytrail devices which rely on firmware > for role switch. > > Signed-off-by: Saranya Gopal > Signed-off-by: Balaji Manoharan > Signed-off-by: Heikki Krogerus Ditto. Can't use my SoB anymore. Note. Since I only proposed

Re: [PATCH v2 1/2] xhci-ext-caps.c: Add property to disable Intel SW switch

2019-08-28 Thread Heikki Krogerus
abled in > Cherrytrail devices. > > Signed-off-by: Saranya Gopal > Signed-off-by: Balaji Manoharan > Signed-off-by: Heikki Krogerus You can't use my SoB anymore. With this patch you should probable put here something like "Suggested-by: Heikki..." instead. thanks, -- heikki

Re: [PATCH 2/2] usb: roles: intel: Enable static DRD mode for role switch

2019-08-28 Thread Heikki Krogerus
On Tue, Aug 27, 2019 at 03:39:18PM +0200, Hans de Goede wrote: > Hi, > > On 26-08-19 16:32, Heikki Krogerus wrote: > > From: Saranya Gopal > > > > Enable static DRD mode in Intel platforms which guarantees > > successful role switch all the time. This fixes iss

[PATCH 1/2] usb: xhci: ext-caps: Add property to disable Intel SW switch

2019-08-26 Thread Heikki Krogerus
Signed-off-by: Balaji Manoharan Signed-off-by: Heikki Krogerus --- drivers/usb/host/xhci-ext-caps.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/drivers/usb/host/xhci-ext-caps.c b/drivers/usb/host/xhci-ext-caps.c index 399113f9fc5c..f498160df969 100644 --- a/drivers/usb

[PATCH 2/2] usb: roles: intel: Enable static DRD mode for role switch

2019-08-26 Thread Heikki Krogerus
devices which rely on firmware for role switch. Signed-off-by: Saranya Gopal Signed-off-by: Balaji Manoharan Signed-off-by: Heikki Krogerus --- .../usb/roles/intel-xhci-usb-role-switch.c| 26 ++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/drivers/usb/roles/intel

[PATCH 0/2] usb: roles: intel: Use static mode by default

2019-08-26 Thread Heikki Krogerus
Hi Hans, These have been in my queue for a while now. For some reason I've been under the impression that there was still an issue with them, but that was a misunderstanding. Saranya and Balaji, I'm really sorry about that. Hans, I don't know if you remember these, but they address an issue where

Re: [PATCH v2] usb: typec: ucsi: add support for separate DP altmode devices

2019-08-26 Thread Heikki Krogerus
Hi Ajay, On Mon, Aug 19, 2019 at 10:23:29PM +, Ajay Gupta wrote: > > > diff --git a/drivers/usb/typec/ucsi/ucsi.h > > > b/drivers/usb/typec/ucsi/ucsi.h index de87d0b8319d..7bbdf83c8d4a > > > 100644 > > > --- a/drivers/usb/typec/ucsi/ucsi.h > > > +++ b/drivers/usb/typec/ucsi/ucsi.h > > > @@ -27

Re: [PATCH] typec: tcpm: fix a typo in the comparison of pdo_max_voltage

2019-08-22 Thread Heikki Krogerus
eve this > is a typo. Fix this. > > Addresses-Coverity: ("Copy-paste error") > Fixes: 5007e1b5db73 ("typec: tcpm: Validate source and sink caps") > Signed-off-by: Colin Ian King Reviewed-by: Heikki Krogerus > --- > drivers/usb/typec/tcpm/tcpm.c | 2 +- &g

Re: [PATCH 1/3] usb: typec: tcpm: Use usb_debug_root as root for our debugfs entry

2019-08-16 Thread Heikki Krogerus
dev_name() (on the same device) for the debugfs > entry name. So we also prefix dev_name() with "tcpm-" here to avoid a > name conflict. > > Signed-off-by: Hans de Goede Reviewed-by: Heikki Krogerus > --- > drivers/usb/typec/tcpm/tcpm.c | 17 + >

Re: [PATCH 2/3] usb: typec: fusb: Use usb_debug_root as root for our debugfs entry

2019-08-16 Thread Heikki Krogerus
On Thu, Aug 15, 2019 at 09:18:14PM +0200, Hans de Goede wrote: > Use usb_debug_root as root for our debugfs entry instead of creating our > own subdirectory under the debugfs root. > > Signed-off-by: Hans de Goede I have one question below. Otherwise: Reviewed-by: Hei

Re: [PATCH 3/3] usb: typec: fusb302: Call fusb302_debugfs_init earlier

2019-08-16 Thread Heikki Krogerus
006f0 > Call Trace: > ? find_held_lock+0x39/0x90 > ? _fusb302_log+0x81/0x1d0 [fusb302] > ? vsnprintf+0x3aa/0x4f0 > ? _fusb302_log+0x81/0x1d0 [fusb302] > _fusb302_log+0x81/0x1d0 [fusb302] > ... > > Signed-off-by: Hans de Goede Reviewed-by: Heikki Krogerus &g

Re: [PATCH v2] usb: typec: ucsi: add support for separate DP altmode devices

2019-08-15 Thread Heikki Krogerus
Hi Ajay, I'm really sorry for being so late with the review. On Mon, Aug 05, 2019 at 11:24:13AM -0700, Ajay Gupta wrote: > From: Ajay Gupta > > CCGx controller used on NVIDIA GPU card has two separate display > altmode for two DP pin assignments. UCSI specification doesn't > prohibits using sep

Re: [PATCH] usb: typec: fusb302: Call fusb302_debugfs_init earlier

2019-08-15 Thread Heikki Krogerus
On Thu, Aug 15, 2019 at 02:54:41PM +0200, Greg Kroah-Hartman wrote: > On Tue, Aug 13, 2019 at 01:52:16PM +0300, Heikki Krogerus wrote: > > Hi Hans, > > > > On Tue, Aug 13, 2019 at 12:15:24PM +0200, Hans de Goede wrote: > > > tcpm_register_port() will call some o

Re: [PATCH 0/3] usb: typec: fusb302: Small changes

2019-08-14 Thread Heikki Krogerus
On Wed, Aug 14, 2019 at 03:42:46PM +0200, Hans de Goede wrote: > Hi, > > On 14-08-19 15:24, Heikki Krogerus wrote: > > Hi, > > > > This series removes the deprecated fusb302 specific properties, and > > stops using struct tcpc_config in the driver. > > Se

[PATCH 1/3] usb: typec: fusb302: Remove unused properties

2019-08-14 Thread Heikki Krogerus
Removing the deprecated fusb302 specific properties. There are no more platforms using them. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/tcpm/fusb302.c | 31 +++ 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/drivers/usb/typec/tcpm/fusb302.c

[PATCH 2/3] dt-bindings: usb: fusb302: Remove deprecated properties

2019-08-14 Thread Heikki Krogerus
There are no platforms using them anymore. Signed-off-by: Heikki Krogerus --- Documentation/devicetree/bindings/usb/fcs,fusb302.txt | 7 --- 1 file changed, 7 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/fcs,fusb302.txt b/Documentation/devicetree/bindings/usb/fcs

[PATCH 0/3] usb: typec: fusb302: Small changes

2019-08-14 Thread Heikki Krogerus
Hi, This series removes the deprecated fusb302 specific properties, and stops using struct tcpc_config in the driver. thanks, Heikki Krogerus (3): usb: typec: fusb302: Remove unused properties dt-bindings: usb: fusb302: Remove deprecated properties usb: typec: fusb302: Always provide

[PATCH 3/3] usb: typec: fusb302: Always provide fwnode for the port

2019-08-14 Thread Heikki Krogerus
By registering a software fwnode for the port when the firmware does not supply one, we can always provide tcpm the connector capabilities by using the common USB connector device properties instead of using tcpc_config platform data. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/tcpm

Re: [PATCH] usb: typec: fusb302: Call fusb302_debugfs_init earlier

2019-08-14 Thread Heikki Krogerus
On Wed, Aug 14, 2019 at 10:17:14AM +0800, Chunfeng Yun wrote: > On Tue, 2019-08-13 at 13:52 +0300, Heikki Krogerus wrote: > > Hi Hans, > > > > On Tue, Aug 13, 2019 at 12:15:24PM +0200, Hans de Goede wrote: > > > tcpm_register_port() will call some of the fusb302

Re: [PATCH] usb: typec: fusb302: Call fusb302_debugfs_init earlier

2019-08-13 Thread Heikki Krogerus
On Tue, Aug 13, 2019 at 02:13:45PM +0200, Hans de Goede wrote: > Hi Heikki, > > On 13-08-19 12:52, Heikki Krogerus wrote: > > Hi Hans, > > > > On Tue, Aug 13, 2019 at 12:15:24PM +0200, Hans de Goede wrote: > > > tcpm_register_port() will call some of the fu

Re: [PATCH next v9 07/11] usb: roles: Add fwnode_usb_role_switch_get() function

2019-08-13 Thread Heikki Krogerus
On Tue, Aug 13, 2019 at 07:27:10PM +0800, Chunfeng Yun wrote: > From: Heikki Krogerus > > The fwnode_usb_role_switch_get() function is exactly the > same as usb_role_switch_get(), except that it takes struct > fwnode_handle as parameter instead of struct device. > >

Re: [PATCH] usb: typec: fusb302: Call fusb302_debugfs_init earlier

2019-08-13 Thread Heikki Krogerus
Hi Hans, On Tue, Aug 13, 2019 at 12:15:24PM +0200, Hans de Goede wrote: > tcpm_register_port() will call some of the fusb302 code's callbacks > wich in turn will call fusb302_log(). So we need to call > fusb302_debugfs_init() before we call tcpm_register_port(). > > This fixes the following warni

Re: [PATCH v2] usb: typec: ucsi: add support for separate DP altmode devices

2019-08-12 Thread Heikki Krogerus
Hi Ajay, On Mon, Aug 05, 2019 at 11:24:13AM -0700, Ajay Gupta wrote: > From: Ajay Gupta > > CCGx controller used on NVIDIA GPU card has two separate display > altmode for two DP pin assignments. UCSI specification doesn't > prohibits using separate display altmode. > > Current UCSI Type-C frame

Re: [PATCH v10 5/6] usb:cdns3 Add Cadence USB3 DRD Driver

2019-08-12 Thread Heikki Krogerus
Hi, > +real_role = cdsn3_real_role_switch_get(cdns->dev); > + > +current_role = role; > +dev_dbg(cdns->dev, "Switching role"); > + > +ret = cdns3_role_start(cdns, real_role); > +if (ret) { > +/* Back to

Re: [PATCH] USB: typec: ucsi_ccg: convert i2c driver to use dev_groups

2019-08-06 Thread Heikki Krogerus
t; of trying to create sysfs files "by hand". > > Cc: Heikki Krogerus > Cc: Ajay Gupta > Cc: Wolfram Sang > Cc: Wei Yongjun > Signed-off-by: Greg Kroah-Hartman Reviewed-by: Heikki Krogerus > --- > drivers/usb/typec/ucsi/ucsi_ccg.c | 13 +++-- &g

Re: [RFC PATCH] usb: typec: tcpm: Ignore unsupported/unknown alternate mode requests

2019-08-02 Thread Heikki Krogerus
On Thu, Aug 01, 2019 at 06:07:09PM +0200, Greg Kroah-Hartman wrote: > On Wed, Jul 31, 2019 at 12:55:55PM +0300, Heikki Krogerus wrote: > > On Tue, Jul 30, 2019 at 06:28:52AM -0700, Guenter Roeck wrote: > > > On 7/30/19 5:07 AM, Heikki Krogerus wrote: > > > > On M

Re: Linux 5.2, usb: typec: Support for Alternate Modes

2019-08-01 Thread Heikki Krogerus
me, however attempting to enable both > of them will fail. > The returned error message is: > xrandr: Configure crtc 2 failed > > > On Tue, 30 Jul 2019 at 15:27, Heikki Krogerus > wrote: > > > > Hi Matthew, > > > > Copying the respective mailing list.

[PATCH] usb: typec: ucsi: ccg: Fix uninitilized symbol error

2019-08-01 Thread Heikki Krogerus
Fix smatch error: drivers/usb/typec/ucsi/ucsi_ccg.c:975 ccg_fw_update() error: uninitialized symbol 'err'. Fixes: 5c9ae5a87573 ("usb: typec: ucsi: ccg: add firmware flashing support") Cc: sta...@vger.kernel.org Reported-by: kbuild test robot Signed-off-by: Heikki Kroger

Re: [RFC PATCH] usb: typec: tcpm: Ignore unsupported/unknown alternate mode requests

2019-07-31 Thread Heikki Krogerus
On Tue, Jul 30, 2019 at 06:28:52AM -0700, Guenter Roeck wrote: > On 7/30/19 5:07 AM, Heikki Krogerus wrote: > > On Mon, Jul 29, 2019 at 10:31:04AM -0700, Guenter Roeck wrote: > > > On Mon, Jul 29, 2019 at 05:04:57PM +0300, Heikki Krogerus wrote: > > > > Hi, > >

Re: Linux 5.2, usb: typec: Support for Alternate Modes

2019-07-30 Thread Heikki Krogerus
Hi Matthew, Copying the respective mailing list. On Wed, Jul 17, 2019 at 09:22:10AM +0100, Matthew Nicholson wrote: > Hi, > > Thanks for your work on the linux. > > I am using dell xps13 with a wd15 type-c docking station, on Archlinux. > Under kernel version 5.2 (and 5.2.1) I was running into

Re: [RFC PATCH] usb: typec: tcpm: Ignore unsupported/unknown alternate mode requests

2019-07-30 Thread Heikki Krogerus
On Mon, Jul 29, 2019 at 10:31:04AM -0700, Guenter Roeck wrote: > On Mon, Jul 29, 2019 at 05:04:57PM +0300, Heikki Krogerus wrote: > > Hi, > > > > On Wed, Jul 24, 2019 at 09:30:37PM -0700, Guenter Roeck wrote: > > > TCPM may receive PD messages associat

Re: [PATCH v3 1/7] drivers: Introduce device lookup variants by name

2019-07-29 Thread Heikki Krogerus
> Cc: Alexander Aring > Cc: Alexander Shishkin > Cc: Alexandre Belloni > Cc: Arnd Bergmann > Cc: Dan Murphy > Cc: Greg Kroah-Hartman > Cc: Harald Freudenberger > Cc: Heikki Krogerus > Cc: Heiko Carstens > Cc: Jacek Anaszewski > Cc: Lee Jon

Re: [PATCH v1] usb: typec: mux: Switch to use fwnode_property_count_uXX()

2019-07-29 Thread Heikki Krogerus
On Tue, Jul 23, 2019 at 10:47:26PM +0300, Andy Shevchenko wrote: > Use fwnode_property_count_uXX() directly, that makes code neater. > > Signed-off-by: Andy Shevchenko Acked-by: Heikki Krogerus > --- > drivers/usb/typec/mux.c | 2 +- > 1 file changed, 1 insertion(+), 1 del

Re: [PATCH v1] usb: typec: tcpm: Switch to use fwnode_property_count_uXX()

2019-07-29 Thread Heikki Krogerus
On Tue, Jul 23, 2019 at 10:37:50PM +0300, Andy Shevchenko wrote: > Use use fwnode_property_count_uXX() directly, that makes code neater. > > Signed-off-by: Andy Shevchenko Acked-by: Heikki Krogerus > --- > drivers/usb/typec/tcpm/tcpm.c | 6 ++ > 1 file changed,

Re: [PATCH v3 3/7] drivers: Introduce device lookup variants by fwnode

2019-07-29 Thread Heikki Krogerus
Miller" > Cc: Doug Ledford > Cc: Greg Kroah-Hartman > Cc: Heikki Krogerus > Cc: Jason Gunthorpe > Cc: linux-usb@vger.kernel.org > Cc: "Rafael J. Wysocki" > Cc: Greg Kroah-Hartman > Cc: Ulf Hansson > Cc: Joe Perches > Cc: Mathieu Poirier > Cc:

Re: [PATCH v8 08/11] usb: roles: get usb-role-switch from parent

2019-07-29 Thread Heikki Krogerus
xists. > > Signed-off-by: Heikki Krogerus I don't think I actually wrote the patch. I may have proposed the code for you, but I never prepared a patch out out that. Please drop the above Signed-off-by line if that is the case. I case I really did write the patch, then you are missing

Re: [PATCH v2] usb: typec: tcpm: Add NULL check before dereferencing config

2019-07-29 Thread Heikki Krogerus
ptional when registering a Type-C port. Since it is optional, we have > to check if it is NULL before dereferencing it. > > Reported-by: Douglas Gilbert > Cc: Douglas Gilbert > Fixes: 96232cbc6c994 ("usb: typec: tcpm: support get typec and pd config from > device propert

Re: [RFC PATCH] usb: typec: tcpm: Ignore unsupported/unknown alternate mode requests

2019-07-29 Thread Heikki Krogerus
Hi, On Wed, Jul 24, 2019 at 09:30:37PM -0700, Guenter Roeck wrote: > TCPM may receive PD messages associated with unknown or unsupported > alternate modes. If that happens, calls to typec_match_altmode() > will return NULL. The tcpm code does not currently take this into > account. This results in

Re: [RFC] usb: typec: ucsi: add support for separate DP altmode devices

2019-06-28 Thread Heikki Krogerus
On Thu, Jun 27, 2019 at 10:45:47PM -0700, Ajay Gupta wrote: > CCGx controller used on NVIDIA GPU card has two separate display > altmode for two DP pin assignments. UCSI specification doesn't > prohibits using separate display altmode. > > Current UCSI Type-C framework expects only one display alt

[PATCH] usb: typec: Make sure an alt mode exist before getting its partner

2019-06-12 Thread Heikki Krogerus
Adding check to typec_altmode_get_partner() to prevent potential NULL pointer dereference. Reported-by: Vladimir Yerilov Fixes: ad74b8649bea ("usb: typec: ucsi: Preliminary support for alternate modes") Signed-off-by: Heikki Krogerus --- drivers/usb/typec/bus.c | 2 +- 1 file

Re: kernel NULL pointer dereference, ucsi bug

2019-06-12 Thread Heikki Krogerus
On Wed, Jun 12, 2019 at 10:57:35PM +1000, Vladimir Yerilov wrote: > Oh, you are right. I meant... You know what I meant :) > I hope the fix will get there eventually in one way or another. Should > you need any further tests from my side, just ask and I will make my > faulty machine work on it. >

Re: kernel NULL pointer dereference, ucsi bug

2019-06-12 Thread Heikki Krogerus
n't see anything the driver is doing wrong. I'm attaching a patch. Can you test if it fixes the issue? Br, -- heikki >From d6979950ee911194dab9ae7513fe36dc3730f7a9 Mon Sep 17 00:00:00 2001 From: Heikki Krogerus Date: Tue, 11 Jun 2019 11:10:25 +0300 Subject: [PATCH] usb: typec: Make su

Re: kernel NULL pointer dereference, ucsi bug

2019-06-11 Thread Heikki Krogerus
Hi Vladimir, On Sun, Jun 02, 2019 at 09:24:43PM +1000, Vladimir Yerilov wrote: > Good day, > > There's a problem with ucsi starting from 5.2-rc1 (maybe earlier > versions of 5.2 are affected too). > Recently I've tried these versions of rc3 (commits), all have this issue: > 3ab4436f688c2d2f221793

Re: kernel NULL pointer dereference, ucsi bug

2019-06-11 Thread Heikki Krogerus
first bad commit > > commit ad74b8649beaf1a22cf8641324e3321fa0269d16 > > Author: Heikki Krogerus > > Date: Tue Apr 23 17:21:48 2019 +0300 > > > >usb: typec: ucsi: Preliminary support for alternate modes > > > >With UCSI the alternate modes, just like everything

Re: [PATCH v4 5/5] usb: typec: ucsi: ccg: add runtime pm workaround

2019-06-07 Thread Heikki Krogerus
is that i2c bus driver will call pm_request_resume() > to runtime resume ucsi_ccg driver. CCG driver will call the ISR > for any connector change event for NVIDIA GPU card and only if it has > old CCG firmware with the known issue. > > Signed-off-by: Ajay Gupta Acked-by: Heikki Krogerus >

Re: [PATCH v4 3/5] usb: typec: ucsi: ccg: enable runtime pm support

2019-06-07 Thread Heikki Krogerus
bols in ucsi.c for modular build. > > Signed-off-by: Ajay Gupta Was the idea that Wolfram picks these? In that case: Acked-by: Heikki Krogerus > --- > Changes from v3->v4 : None > > drivers/usb/typec/ucsi/ucsi.c | 10 > drivers/usb/typec/ucsi/ucsi.h |

Re: [PATCH v2 3/5] usb: typec: ucsi: ccg: enable runtime pm support

2019-05-22 Thread Heikki Krogerus
On Tue, May 21, 2019 at 05:44:50PM +, Ajay Gupta wrote: > Hi Heikki > > > > +static int ucsi_ccg_resume(struct device *dev) { > > > + struct i2c_client *client = to_i2c_client(dev); > > > + struct ucsi_ccg *uc = i2c_get_clientdata(client); > > > + struct ucsi *ucsi = uc->ucsi; > > > + struct u

Re: [PATCH v2 3/5] usb: typec: ucsi: ccg: enable runtime pm support

2019-05-21 Thread Heikki Krogerus
On Tue, May 21, 2019 at 04:37:27PM +0300, Heikki Krogerus wrote: > Hi, > > On Mon, May 20, 2019 at 11:37:48AM -0700, Ajay Gupta wrote: > > +static int ucsi_ccg_resume(struct device *dev) > > +{ > > + struct i2c_client *client = to_i2c_client(dev);

Re: [PATCH v2 3/5] usb: typec: ucsi: ccg: enable runtime pm support

2019-05-21 Thread Heikki Krogerus
Hi, On Mon, May 20, 2019 at 11:37:48AM -0700, Ajay Gupta wrote: > +static int ucsi_ccg_resume(struct device *dev) > +{ > + struct i2c_client *client = to_i2c_client(dev); > + struct ucsi_ccg *uc = i2c_get_clientdata(client); > + struct ucsi *ucsi = uc->ucsi; > + struct ucsi_control

Re: [v3 PATCH] dt-binding: usb: add usb-role-switch property

2019-05-17 Thread Heikki Krogerus
> Cc: Biju Das > Cc: Yu Chen > Signed-off-by: Chunfeng Yun Who is meant to pick this? Can you include this in your series where you introduce that USB Type-B GPIO connector driver? FWIW: Reviewed-by: Heikki Krogerus > --- > v3: > add property type, modify d

Re: [PATCH v5 4/6] usb: roles: add API to get usb_role_switch by node

2019-05-17 Thread Heikki Krogerus
Hi, On Fri, May 17, 2019 at 01:37:36PM +0300, Heikki Krogerus wrote: > On Tue, May 14, 2019 at 04:47:21PM +0800, Chunfeng Yun wrote: > > Add fwnode_usb_role_switch_get() to make easier to get > > usb_role_switch by fwnode which register it. > > It's useful when ther

Re: [PATCH v5 4/6] usb: roles: add API to get usb_role_switch by node

2019-05-17 Thread Heikki Krogerus
de which register > usb_role_switch. > > Signed-off-by: Chunfeng Yun > Tested-by: Biju Das Acked-by: Heikki Krogerus > --- > v5 changes: > 1. remove linux/of.h suggested by Biju > 2. add tested by Biju > > Note: still depends on [1] > [1]: [v6,08/13] usb: r

Re: [PATCH -next] usb: typec: ucsi: ccg: fix missing unlock on error in ccg_cmd_write_flash_row()

2019-04-29 Thread Heikki Krogerus
y: Wei Yongjun Acked-by: Heikki Krogerus > --- > drivers/usb/typec/ucsi/ucsi_ccg.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/usb/typec/ucsi/ucsi_ccg.c > b/drivers/usb/typec/ucsi/ucsi_ccg.c > index 4632b91a04a6..9d46aa9e4e35 100644 > --- a/drivers/us

[PATCH v4 5/7] usb: typec: ucsi: Support for DisplayPort alt mode

2019-04-23 Thread Heikki Krogerus
driver has. Tested-by: Ajay Gupta Signed-off-by: Heikki Krogerus --- drivers/usb/typec/ucsi/Makefile | 15 +- drivers/usb/typec/ucsi/displayport.c | 315 +++ drivers/usb/typec/ucsi/ucsi.c| 21 +- drivers/usb/typec/ucsi/ucsi.h| 21 ++ 4 files ch

[PATCH v4 3/7] usb: typec: ucsi: ccg: add firmware flashing support

2019-04-23 Thread Heikki Krogerus
and user threads. PD port number information is added which is required while sending PD_PORT_ENABLE command Signed-off-by: Ajay Gupta [ heikki: Added ABI documentation. ] Signed-off-by: Heikki Krogerus --- .../ABI/testing/sysfs-driver-ucsi-ccg | 6 + drivers/usb/typec/ucsi/ucsi_ccg.c

[PATCH v4 6/7] usb: typec: displayport: Export probe and remove functions

2019-04-23 Thread Heikki Krogerus
eikki Krogerus Signed-off-by: Ajay Gupta Signed-off-by: Heikki Krogerus --- drivers/usb/typec/altmodes/displayport.c | 12 +++- drivers/usb/typec/altmodes/displayport.h | 8 2 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 drivers/usb/typec/altmodes/displayp

[PATCH v4 7/7] usb: typec: Add driver for NVIDIA Alt Modes

2019-04-23 Thread Heikki Krogerus
From: Ajay Gupta Latest NVIDIA GPUs support VirtualLink device. Since USBIF has not assigned a Standard ID (SID) for VirtualLink so using NVIDA VID 0x955 as SVID. Signed-off-by: Ajay Gupta Signed-off-by: Heikki Krogerus --- drivers/usb/typec/altmodes/Kconfig | 10 +++ drivers/usb/typec

[PATCH v4 4/7] usb: typec: ucsi: Preliminary support for alternate modes

2019-04-23 Thread Heikki Krogerus
to an alternate mode will not be possible until support for that alternate mode is added to the UCSI driver. Tested-by: Ajay Gupta Signed-off-by: Heikki Krogerus --- drivers/usb/typec/ucsi/trace.c | 12 + drivers/usb/typec/ucsi/trace.h | 26 +++ drivers/usb/typec/ucsi/ucsi.c | 385

[PATCH v4 0/7] usb: typec: ucsi: Remaining changes for v5.2

2019-04-23 Thread Heikki Krogerus
-gpu: Supply CCGx driver the fw build info usb: typec: ucsi: ccg: add firmware flashing support usb: typec: displayport: Export probe and remove functions usb: typec: Add driver for NVIDIA Alt Modes Heikki Krogerus (2): usb: typec: ucsi: Preliminary support for alternate modes usb: typec: u

[PATCH v4 2/7] i2c: nvidia-gpu: Supply CCGx driver the fw build info

2019-04-23 Thread Heikki Krogerus
From: Ajay Gupta Adding device property "ccgx,firmware-build" for the CCGx device, so the CCGx driver knows which firmware binary to use for a specific vendor. Suggested-by: Heikki Krogerus Signed-off-by: Ajay Gupta Signed-off-by: Heikki Krogerus --- drivers/i2c/busses/i2c-nvidia

[PATCH v4 1/7] usb: typec: ucsi: ccg: add get_fw_info function

2019-04-23 Thread Heikki Krogerus
From: Ajay Gupta Function is to get the details of ccg firmware and device version. It will be useful in debugging and also during firmware update. Signed-off-by: Ajay Gupta Signed-off-by: Heikki Krogerus --- drivers/usb/typec/ucsi/ucsi_ccg.c | 66 ++- 1 file

Re: [PATCH v3 0/7] usb: typec: ucsi: Remaining changes for v5.2

2019-04-17 Thread Heikki Krogerus
On Wed, Apr 17, 2019 at 02:47:43PM +0300, Heikki Krogerus wrote: > Hi Greg, > > This is the third version of this collection of UCSI driver related > changes. I fixed the header problem I caused in Ajay's patch adding the > NVIDIA alt mode support (patch 7/7), and I also

[PATCH v3 0/7] usb: typec: ucsi: Remaining changes for v5.2

2019-04-17 Thread Heikki Krogerus
: ucsi: ccg: add get_fw_info function i2c: nvidia-gpu: Supply CCGx driver the fw build info usb: typec: ucsi: ccg: add firmware flashing support usb: typec: displayport: Export probe and remove functions usb: typec: Add driver for NVIDIA Alt Modes Heikki Krogerus (2): usb: typec: ucsi: Preli

[PATCH v3 4/7] usb: typec: ucsi: Preliminary support for alternate modes

2019-04-17 Thread Heikki Krogerus
to an alternate mode will not be possible until support for that alternate mode is added to the UCSI driver. Tested-by: Ajay Gupta Signed-off-by: Heikki Krogerus --- drivers/usb/typec/ucsi/trace.c | 12 ++ drivers/usb/typec/ucsi/trace.h | 26 +++ drivers/usb/typec/ucsi/ucsi.c | 358

[PATCH v3 3/7] usb: typec: ucsi: ccg: add firmware flashing support

2019-04-17 Thread Heikki Krogerus
and user threads. PD port number information is added which is required while sending PD_PORT_ENABLE command Signed-off-by: Ajay Gupta [ heikki: Added ABI documentation. ] Signed-off-by: Heikki Krogerus --- .../ABI/testing/sysfs-driver-ucsi-ccg | 6 + drivers/usb/typec/ucsi/ucsi_ccg.c

[PATCH v3 1/7] usb: typec: ucsi: ccg: add get_fw_info function

2019-04-17 Thread Heikki Krogerus
From: Ajay Gupta Function is to get the details of ccg firmware and device version. It will be useful in debugging and also during firmware update. Signed-off-by: Ajay Gupta Signed-off-by: Heikki Krogerus --- drivers/usb/typec/ucsi/ucsi_ccg.c | 66 ++- 1 file

[PATCH v3 6/7] usb: typec: displayport: Export probe and remove functions

2019-04-17 Thread Heikki Krogerus
eikki Krogerus Signed-off-by: Ajay Gupta Signed-off-by: Heikki Krogerus --- drivers/usb/typec/altmodes/displayport.c | 12 +++- drivers/usb/typec/altmodes/displayport.h | 8 2 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 drivers/usb/typec/altmodes/displayp

[PATCH v3 7/7] usb: typec: Add driver for NVIDIA Alt Modes

2019-04-17 Thread Heikki Krogerus
From: Ajay Gupta Latest NVIDIA GPUs support VirtualLink device. Since USBIF has not assigned a Standard ID (SID) for VirtualLink so using NVIDA VID 0x955 as SVID. Signed-off-by: Ajay Gupta Signed-off-by: Heikki Krogerus --- drivers/usb/typec/altmodes/Kconfig | 10 +++ drivers/usb/typec

[PATCH v3 5/7] usb: typec: ucsi: Support for DisplayPort alt mode

2019-04-17 Thread Heikki Krogerus
driver has. Tested-by: Ajay Gupta Signed-off-by: Heikki Krogerus --- drivers/usb/typec/ucsi/Makefile | 15 +- drivers/usb/typec/ucsi/displayport.c | 306 +++ drivers/usb/typec/ucsi/ucsi.c| 21 +- drivers/usb/typec/ucsi/ucsi.h| 21 ++ 4 files ch

[PATCH v3 2/7] i2c: nvidia-gpu: Supply CCGx driver the fw build info

2019-04-17 Thread Heikki Krogerus
From: Ajay Gupta Adding device property "ccgx,firmware-build" for the CCGx device, so the CCGx driver knows which firmware binary to use for a specific vendor. Suggested-by: Heikki Krogerus Signed-off-by: Ajay Gupta Signed-off-by: Heikki Krogerus --- drivers/i2c/busses/i2c-nvidia

Re: [PATCH v2 3/3] usb: typec: fusb302: Revert "Resolve fixed power role contract setup"

2019-04-16 Thread Heikki Krogerus
> the original functionality is fully restored. > > Fixes: ea3b4d5523bc ("usb: typec: fusb302: Resolve fixed power role ...") > Cc: Adam Thomson > Signed-off-by: Hans de Goede Acked-by: Heikki Krogerus > --- > Changes in v2: > -No changes > --- > dr

Re: [PATCH v2 2/3] usb: typec: fusb302: Implement start_toggling for all port-types

2019-04-16 Thread Heikki Krogerus
oggling for all port-types, so that connection-detection works > on single-role ports too. > > Fixes: ea3b4d5523bc("usb: typec: fusb302: Resolve fixed power role ...") > Cc: Adam Thomson > Signed-off-by: Hans de Goede Acked-by Heikki Krogerus > --- > Chang

Re: [PATCH v2 1/3] usb: typec: tcpm: Notify the tcpc to start connection-detection for SRPs

2019-04-16 Thread Heikki Krogerus
_toggling, > but also get a port_type check added and return -EOPNOTSUPP when port_type > is not DRP. > > Fixes: ea3b4d5523bc("usb: typec: fusb302: Resolve fixed power role ...") > Cc: Adam Thomson > Signed-off-by: Hans de Goede Acked-by Heikki Krogerus > --

Re: [PATCH 1/8] usb: typec: fusb302: Make fusb302_set_cc_polarity also set pull ups / downs

2019-04-16 Thread Heikki Krogerus
On Tue, Apr 16, 2019 at 12:19:53PM +0200, Greg Kroah-Hartman wrote: > On Fri, Feb 22, 2019 at 03:11:58PM +0100, Hans de Goede wrote: > > The 2 callers of fusb302_set_cc_polarity both call fusb302_set_cc_pull > > directly before calling fusb302_set_cc_polarity, this is not ideal for > > 2 reasons: >

Re: [PATCH v2 6/7] usb: typec: displayport: Export probe and remove functions

2019-04-16 Thread Heikki Krogerus
On Tue, Apr 16, 2019 at 09:27:03AM +0300, Heikki Krogerus wrote: > On Tue, Apr 16, 2019 at 12:45:12AM +, Ajay Gupta wrote: > > Hi Heikki, > > > > > -Original Message- > > > From: linux-usb-ow...@vger.kernel.org On > > > Behalf Of Heikki Kro

Re: [PATCH v2 6/7] usb: typec: displayport: Export probe and remove functions

2019-04-15 Thread Heikki Krogerus
On Tue, Apr 16, 2019 at 12:45:12AM +, Ajay Gupta wrote: > Hi Heikki, > > > -Original Message- > > From: linux-usb-ow...@vger.kernel.org On > > Behalf Of Heikki Krogerus > > Sent: Monday, April 15, 2019 5:10 AM > > To: Greg Kroah-Hartman > >

[PATCH v2 0/7] usb: typec: Remaining changes for v5.2

2019-04-15 Thread Heikki Krogerus
g: add get_fw_info function usb: typec: ucsi: ccg: add firmware flashing support usb: typec: displayport: Export probe and remove functions usb: typec: Add driver for NVIDIA Alt Modes Heikki Krogerus (2): usb: typec: ucsi: Preliminary support for alternate modes usb: typec: ucsi: Support f

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