Re: [PATCH] dmaengine: cppi41: Fix cppi41_dma_prep_slave_sg() when idle

2019-10-23 Thread Andy Shevchenko
27;, comparison (error < 0) just doesn't look > right. > If it was *if* (error), it would have been more correct. It's error when it's negative. That's how PM runtime is designed. > > + pm_runtime_put_noidle(cdd->ddev.dev); > > + > > + return NULL; > > + } -- With Best Regards, Andy Shevchenko

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

2019-07-23 Thread Andy Shevchenko
Use fwnode_property_count_uXX() directly, that makes code neater. Signed-off-by: Andy Shevchenko --- drivers/usb/typec/mux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/typec/mux.c b/drivers/usb/typec/mux.c index 61b7bc58dd81..57907f26f681 100644 --- a

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

2019-07-23 Thread Andy Shevchenko
Use use fwnode_property_count_uXX() directly, that makes code neater. Signed-off-by: Andy Shevchenko --- drivers/usb/typec/tcpm/tcpm.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index fba32d84e578

[PATCH v1] usb: dwc3: Switch to use device_property_count_u32()

2019-07-23 Thread Andy Shevchenko
Use use device_property_count_u32() directly, that makes code neater. Signed-off-by: Andy Shevchenko --- drivers/usb/dwc3/core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index c9bb93a2c81e..98bce85c29d0 100644 --- a

[PATCH v1] usb: dwc2: Switch to use device_property_count_u32()

2019-07-23 Thread Andy Shevchenko
Use use device_property_count_u32() directly, that makes code neater. Signed-off-by: Andy Shevchenko --- drivers/usb/dwc2/params.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c index 55f841a54015..31e090ac9f1e

[PATCH v1] usb: dwc3: Free resource immediately after use

2019-03-27 Thread Andy Shevchenko
When we read an array of integers from device properties, the temporary buffer is allocated. However, in case of dwc3_set_incr_burst_type() it's not freed. Free allocated buffer immediately after use. Signed-off-by: Andy Shevchenko --- drivers/usb/dwc3/core.c | 3 +++ 1 file chang

Re: [PATCH 3/5] usb: roles: add API to get usb_role_switch by node

2019-03-07 Thread Andy Shevchenko
er > usb_role_switch. > +static int __switch_match_node(struct device *dev, const void *node) > +{ > + return dev->parent->of_node == (const struct device_node *)node; > +} Hmm... Shouldn't be slightly better to compare fwnode instead? -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 10/12] hikey960: Support usb functionality of Hikey960

2019-03-03 Thread Andy Shevchenko
On Mon, Mar 4, 2019 at 4:35 AM Chen Yu wrote: > On 2019/3/3 0:01, Andy Shevchenko wrote: > > On Sat, Mar 2, 2019 at 11:05 AM Yu Chen wrote: > >> +config HISI_HIKEY_USB > >> + tristate "USB functionality of HiSilicon Hikey Platform" > >> +

Re: [PATCH v3 10/12] hikey960: Support usb functionality of Hikey960

2019-03-03 Thread Andy Shevchenko
will have ->probed() and not functional device. Am I missing something? -- With Best Regards, Andy Shevchenko

Re: [PATCH v2 2/2] usb: typec: add typec switch via GPIO control

2019-03-02 Thread Andy Shevchenko
On Fri, Mar 1, 2019 at 3:25 AM Jun Li wrote: > > This patch adds a simple typec switch driver which only needs > a GPIO to switch the super speed active channel according to > typec orientation. FWIW, Reviewed-by: Andy Shevchenko One minor below. > > Signed-off-by: Li Jun

Re: [PATCH v3 10/12] hikey960: Support usb functionality of Hikey960

2019-03-02 Thread Andy Shevchenko
(IS_ERR(hisi_hikey_usb->role_sw)) Redundant 'else' > + return PTR_ERR(hisi_hikey_usb->role_sw); > +static const struct of_device_id id_table_hisi_hikey_usb[] = { > + {.compatible = "hisilicon,gpio_hubv1"}, > + {.compatible = "hisilicon,hikey960_usb"}, > + {} > +}; MODULE_DEVICE_TABLE()? -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 07/12] phy: Add usb phy support for hi3660 Soc of Hisilicon

2019-03-02 Thread Andy Shevchenko
On Sat, Mar 2, 2019 at 11:06 AM Yu Chen wrote: > > This driver handles usb phy power on and shutdown for hi3660 Soc of > Hisilicon. Few comments below. After fixing them, FWIW Reviewed-by: Andy Shevchenko > +#define HI3660_USB_DEFAULT_PHY_PARAM 0x1c466e3 A bit of descr

Re: [PATCH v3 06/12] usb: dwc3: Increase timeout for CmdAct cleared by device controller

2019-03-02 Thread Andy Shevchenko
On Sat, Mar 2, 2019 at 11:06 AM Yu Chen wrote: > > It needs more time for the device controller to clear the CmdAct of > DEPCMD on Hisilicon Kirin Soc. > 5x times more? Can you provide more specific details on that? > Cc: Andy Shevchenko > Cc: Felipe Balbi > Cc: Greg Kroa

Re: [PATCH 2/2] usb: typec: add typec switch via GPIO control

2019-02-25 Thread Andy Shevchenko
t; +#include I don't see how these are in use. -- With Best Regards, Andy Shevchenko

[PATCH v1] usb: dwc3: drd: Defer probe if extcon device is not found

2019-02-18 Thread Andy Shevchenko
In case the "linux,extcon-name" property is defined but device itself is not ready, defer the probe. Cc: Felipe Balbi Signed-off-by: Andy Shevchenko --- This is a missed part of the v2 [1] of the commit 268784ba14a7 ("usb: dwc3: drd: Add support for DR detection through

Re: [PATCH v2 04/10] usb: dwc3: Add two quirks for Hisilicon Kirin Soc Platform

2019-02-18 Thread Andy Shevchenko
= 1000; > + u32 timeout = 5000; I don't see anything about this change in commit message. Moreoever, it looks like it must be a separate logical change with its own description. > u32 saved_config = 0; > u32 reg; -- With Best Regards, Andy Shevchenko

Re: [usb:usb-testing 63/64] drivers/usb/typec/mux.c:167 typec_mux_match() warn: unsigned 'nval' is never less than zero.

2019-02-15 Thread Andy Shevchenko
On Fri, Feb 15, 2019 at 4:40 PM Heikki Krogerus wrote: > > On Fri, Feb 15, 2019 at 11:19:47AM +0200, Andy Shevchenko wrote: > > On Fri, Feb 15, 2019 at 11:01 AM Heikki Krogerus > > wrote: > > > > > > On Fri, Feb 15, 2019 at 01:33:24PM +0800, kbuild tes

Re: [usb:usb-testing 63/64] drivers/usb/typec/mux.c:167 typec_mux_match() warn: unsigned 'nval' is never less than zero.

2019-02-15 Thread Andy Shevchenko
76 goto find_mux; > >177} > >178} > >179kfree(val); > >180return NULL; > >181 > >182find_mux: > >183list_for_each_entry(mux, &mux_list, entry) > >184if (dev_fwnode(mux->dev) == con->fwnode) > >185return mux; > >186 > >187return match ? ERR_PTR(-EPROBE_DEFER) : NULL; > >188} > >189 > > thanks, > > -- > heikki -- With Best Regards, Andy Shevchenko

Re: [PATCH v2 7/9] usb: typec: Find the ports by also matching against the device node

2019-02-11 Thread Andy Shevchenko
On Mon, Feb 11, 2019 at 10:39 AM Heikki Krogerus wrote: > On Thu, Jan 31, 2019 at 03:35:37PM +0200, Heikki Krogerus wrote: > > On Wed, Jan 30, 2019 at 06:51:56PM +0200, Andy Shevchenko wrote: > > > On Wed, Jan 30, 2019 at 6:03 PM Heikki Krogerus > > > wrote: > >

Re: [PATCH v3 4/6] usb:common Simplify usb_decode_get_set_descriptor function.

2019-01-31 Thread Andy Shevchenko
On Thu, Jan 31, 2019 at 1:53 PM Pawel Laszczak wrote: > > Patch moves switch responsible for decoding descriptor type > outside snprintf. It's little improves code readability. > + char *s; const ? -- With Best Regards, Andy Shevchenko

Re: [PATCH v2 7/9] usb: typec: Find the ports by also matching against the device node

2019-01-30 Thread Andy Shevchenko
PTR(-EPROBE_DEFER); Just to be clear, this one takes a reference on dev. Is it taken into account? -- With Best Regards, Andy Shevchenko

Re: [PATCH 4/8] usb: typec: mux: Find the muxes by also matching against the device node

2019-01-28 Thread Andy Shevchenko
On Mon, Jan 28, 2019 at 5:46 PM Heikki Krogerus wrote: > On Mon, Jan 28, 2019 at 11:53:54AM +0200, Andy Shevchenko wrote: > > On Fri, Jan 25, 2019 at 3:17 PM Heikki Krogerus > > wrote: > > > + bool match = !con->id; > > > > I don't see how

Re: [PATCH 8/8] device connection: Find device connections also from device graphs

2019-01-28 Thread Andy Shevchenko
on *con, int ep, > + void *data); devcon_match_fn ? _t sounds to me more like a struct or a redefined POD. -- With Best Regards, Andy Shevchenko

Re: [PATCH 4/8] usb: typec: mux: Find the muxes by also matching against the device node

2019-01-28 Thread Andy Shevchenko
+ if (dev_fwnode(mux->dev) == con->fwnode) > return mux; > > - /* > -* We only get called if a connection was found, tell the caller to > -* wait for the switch to show up. > -*/ > - return ERR_PTR(-EPROBE_DEFER); > + return match ? ERR_PTR(-EPROBE_DEFER) : NULL; > } -- With Best Regards, Andy Shevchenko

Re: [PATCH 2/8] usb: typec: Rationalize the API for the muxes

2019-01-28 Thread Andy Shevchenko
typec_mux_match); Not related to this series, but shouldn't device_connection_find_match() be improved to avoid dropping const qualifier? -- With Best Regards, Andy Shevchenko

Re: [PATCH 1/8] platform/x86: intel_cht_int33fe: Remove connection for the alt mode mux

2019-01-28 Thread Andy Shevchenko
On Fri, Jan 25, 2019 at 3:17 PM Heikki Krogerus wrote: > > Driver for fusb302 does not support alternate modes, so the > connection is not really needed for now. Removing that > connection description allows us to improve the USB Type-C > mux API. > Acked-by: Andy Shevchenko

Re: [PATCH] Revert "usb: dwc3: pci: Use devm functions to get the phy GPIOs"

2018-12-09 Thread Andy Shevchenko
(gpio)) > return PTR_ERR(gpio); > > if (gpio) { > gpiod_set_value_cansleep(gpio, 1); > + gpiod_put(gpio); > usleep_range(1, 11000); If something happens to GPIO line in between of these lines, the sleep might become obsolete. Shouldn't gpiod_put() be placed after? > } > } -- With Best Regards, Andy Shevchenko

Re: [PATCH v2 1/3] staging: typec: fusb302: Rename fcs,extcon-name to linux,extcon-name

2018-12-05 Thread Andy Shevchenko
On Wed, Dec 05, 2018 at 10:25:36AM +0100, Greg Kroah-Hartman wrote: > On Mon, Dec 03, 2018 at 09:23:44PM +0200, Andy Shevchenko wrote: > > On Thu, Nov 15, 2018 at 04:53:03PM +0200, Heikki Krogerus wrote: > > > FWIW, the series: > > > Reviewed-by: Heikki Krogerus >

Re: [PATCH v1] usb: dwc3: trace: Refactor nested switch to make compiler happy

2018-12-05 Thread Andy Shevchenko
On Wed, Dec 05, 2018 at 11:18:45AM +0200, Andy Shevchenko wrote: > On Wed, Dec 05, 2018 at 11:10:46AM +0200, Felipe Balbi wrote: > > Andy Shevchenko writes: > > > > > The missed break statement in the outer switch makes the code fall through > > > always a

Re: [PATCH v1] usb: dwc3: trace: Refactor nested switch to make compiler happy

2018-12-05 Thread Andy Shevchenko
On Wed, Dec 05, 2018 at 11:10:46AM +0200, Felipe Balbi wrote: > Andy Shevchenko writes: > > > The missed break statement in the outer switch makes the code fall through > > always and thus always same value will be printed. > > > > Besides that, compiler warns ab

Re: [PATCH v1 10/12] hikey960: Support usb functionality of Hikey960

2018-12-05 Thread Andy Shevchenko
On Wed, Dec 5, 2018 at 3:57 AM Chen Yu wrote: > On 2018/12/5 1:47, Andy Shevchenko wrote: > > On Tue, Dec 4, 2018 at 3:40 AM Chen Yu wrote: > >> On 2018/12/3 17:23, Andy Shevchenko wrote: > >>> On Mon, Dec 3, 2018 at 5:47 AM Yu Chen wrote: > > &g

Re: [PATCH v1 10/12] hikey960: Support usb functionality of Hikey960

2018-12-04 Thread Andy Shevchenko
On Tue, Dec 4, 2018 at 3:40 AM Chen Yu wrote: > On 2018/12/3 17:23, Andy Shevchenko wrote: > > On Mon, Dec 3, 2018 at 5:47 AM Yu Chen wrote: > >> + .of_match_table = of_match_ptr(id_table_hisi_hikey_usb), > > > > Does it compiles for non-OF case? Why

Re: [PATCH v2 1/3] staging: typec: fusb302: Rename fcs,extcon-name to linux,extcon-name

2018-12-03 Thread Andy Shevchenko
On Thu, Nov 15, 2018 at 04:53:03PM +0200, Heikki Krogerus wrote: > On Thu, Nov 15, 2018 at 03:16:19PM +0200, Andy Shevchenko wrote: > > Since we are going to use the same in Designware USB 3 driver, > > rename the property to be consistent across the drivers. > > > > No

[PATCH v1] usb: dwc3: trace: Refactor nested switch to make compiler happy

2018-12-03 Thread Andy Shevchenko
ned-off-by: Andy Shevchenko --- drivers/usb/dwc3/trace.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/usb/dwc3/trace.h b/drivers/usb/dwc3/trace.h index f22714cce070..8e1625a6c19f 100644 --- a/drivers/usb/dwc3/trace.h +++ b/drivers/usb/dwc3/trace.h @@ -23

Re: [PATCH v1 11/12] usb: gadget: Add configfs attribuite for controling match_existing_only

2018-12-03 Thread Andy Shevchenko
len; > +} > + struct usb_gadget_driver *gadget_driver = > + &(to_gadget_info(item)->composite.gadget_driver); Make it neat. -- With Best Regards, Andy Shevchenko

Re: [PATCH v1 10/12] hikey960: Support usb functionality of Hikey960

2018-12-03 Thread Andy Shevchenko
_NULL(hisi_hikey_usb->role_sw)) { > + pr_err("%s: usb_role_switch_get failed\n", __func__); Noise and same comment to the conditional check as above > + if (!hisi_hikey_usb->role_sw) > + ret = -ENOENT; > + el

Re: [PATCH v1 09/12] usb: dwc3: Registering a role switch in the DRD code.

2018-12-03 Thread Andy Shevchenko
("%s:set role %d\n", __func__, role); Noise! > + return role; > + Redundant blank line. > +} -- With Best Regards, Andy Shevchenko

Re: [PATCH v1 07/12] usb: roles: Find the usb role switch by also matching against the device node

2018-12-03 Thread Andy Shevchenko
ntroduced some more generic function for this. > sw = device_connection_find_match(dev, "usb-role-switch", NULL, > usb_role_switch_match); > + sw = of_graph_find_match_by_type(dev, "usb-role-switch"); Why this is here?!

Re: [PATCH v1 06/12] phy: Add usb phy support for hi3660 Soc of Hisilicon

2018-12-03 Thread Andy Shevchenko
TG3_CTRL7 (0x1c) > +#define REF_SSP_EN BIT(16) > + > +#define HI3660_USB_DEFAULT_PHY_PARAM (0x1c466e3) A lot of redundant parens. > +static const struct of_device_id hi3660_phy_of_match[] = { > + {.compatible = "hisilicon,hi3660-usb-phy",}, > + { }, No comma needed. > +}; -- With Best Regards, Andy Shevchenko

Re: [PATCH v1 04/12] usb: dwc3: dwc3-hisi: Add code for dwc3 of Hisilicon Soc Platform

2018-12-03 Thread Andy Shevchenko
; Noise > +} > +static int dwc3_hisi_resume(struct device *dev) __maybe_unused ? > +{ > + dev_info(dev, "%s\n", __func__); Noise. > + /* Wait for clock stable */ > + msleep(100); Don't you have any hardware notification that clocks ar

Re: [PATCH v1 05/12] usb: dwc3: Add two quirks for Hisilicon Kirin Soc Platform

2018-12-03 Thread Andy Shevchenko
readl(dwc->regs, DWC3_GCTL); > + reg &= ~(DWC3_GCTL_CORESOFTRESET); > + dwc3_writel(dwc->regs, DWC3_GCTL, reg); > +} > + int reg; Ditto. -- With Best Regards, Andy Shevchenko

[PATCH v2 2/3] usb: dwc3: drd: Switch to device property for 'extcon' handling

2018-11-15 Thread Andy Shevchenko
Switch to device property for 'extcon' handling. No functional change intended. Signed-off-by: Andy Shevchenko Acked-by: Hans de Goede --- drivers/usb/dwc3/drd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/drd.c b/drivers/usb/dwc3/d

[PATCH v2 3/3] usb: dwc3: drd: Add support for DR detection through extcon

2018-11-15 Thread Andy Shevchenko
for kernel internal use by X86/ACPI platform code and as such is not documented in the device tree bindings. Signed-off-by: Andy Shevchenko Acked-by: Hans de Goede --- drivers/usb/dwc3/drd.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/drivers/usb/dwc3/drd.c b/drivers/usb/

[PATCH v2 1/3] staging: typec: fusb302: Rename fcs,extcon-name to linux,extcon-name

2018-11-15 Thread Andy Shevchenko
Since we are going to use the same in Designware USB 3 driver, rename the property to be consistent across the drivers. No functional change intended. Signed-off-by: Andy Shevchenko Cc: Hans de Goede Cc: Guenter Roeck Acked-by: Hans de Goede Acked-by: Guenter Roeck --- drivers/platform/x86

Re: [PATCH v1 2/5] extcon: Return -EPROBE_DEFER when extcon device is not found

2018-11-14 Thread Andy Shevchenko
On Wed, Nov 14, 2018 at 1:17 PM Andy Shevchenko wrote: > On Wed, Nov 14, 2018 at 1:05 PM Chanwoo Choi wrote: > > > Changing NULL to -ENODEV is a trading bad to worse. > P.S. I still disagree with your arguments in relation to de facto use of an > API. I spoke to colleague

Re: [PATCH v1 2/5] extcon: Return -EPROBE_DEFER when extcon device is not found

2018-11-14 Thread Andy Shevchenko
On Wed, Nov 14, 2018 at 1:05 PM Chanwoo Choi wrote: > On 2018년 11월 14일 19:20, Andy Shevchenko wrote: > > On Wed, Nov 14, 2018 at 11:48 AM Chanwoo Choi wrote: > >> On 2018년 11월 14일 18:36, Andy Shevchenko wrote: > >>> On Wed, Nov 14, 2018 at 06:13:37PM +0900, Chanw

Re: [PATCH v1 2/5] extcon: Return -EPROBE_DEFER when extcon device is not found

2018-11-14 Thread Andy Shevchenko
On Wed, Nov 14, 2018 at 11:48 AM Chanwoo Choi wrote: > > On 2018년 11월 14일 18:36, Andy Shevchenko wrote: > > On Wed, Nov 14, 2018 at 06:13:37PM +0900, Chanwoo Choi wrote: > >> On 2018년 11월 14일 17:35, Andy Shevchenko wrote: > >>> On Wed, Nov 14, 2018 at 1

Re: [PATCH v1 2/5] extcon: Return -EPROBE_DEFER when extcon device is not found

2018-11-14 Thread Andy Shevchenko
On Wed, Nov 14, 2018 at 06:13:37PM +0900, Chanwoo Choi wrote: > On 2018년 11월 14일 17:35, Andy Shevchenko wrote: > > On Wed, Nov 14, 2018 at 1:53 AM Chanwoo Choi wrote: > > > >> I was thinking about again to change from NULL to EPROBE_DEFER. > >> > >> e

Re: [PATCH v1 1/5] drivercore: Revert "deferral race condition fix"

2018-11-14 Thread Andy Shevchenko
ork? > > I'm struggling to follow the original explanation too :( Sorry, guys, I confused a nit myself. The bug is there, but exxplanation is not fully corrent, indeed. I'll come back with more details later. -- With Best Regards, Andy Shevchenko

Re: [PATCH v1 2/5] extcon: Return -EPROBE_DEFER when extcon device is not found

2018-11-14 Thread Andy Shevchenko
09:24, Chanwoo Choi wrote: > > On 2018년 11월 11일 03:10, Andy Shevchenko wrote: > >> All current users of extcon_get_extcon_dev() API considers > >> an extcon device a mandatory to appear. Thus, they all convert > >> NULL pointer to -EPROBE_DEFER error code. > &

Re: [PATCH v1 1/5] drivercore: Revert "deferral race condition fix"

2018-11-10 Thread Andy Shevchenko
On Sat, Nov 10, 2018 at 10:26:22AM -0800, Greg Kroah-Hartman wrote: > On Sat, Nov 10, 2018 at 08:10:57PM +0200, Andy Shevchenko wrote: > > Consider the following scenario. > > > > There are two independent devices coupled together by functional > > dependencie

[PATCH v1 5/5] usb: dwc3: drd: Add support for DR detection through extcon

2018-11-10 Thread Andy Shevchenko
for kernel internal use by X86/ACPI platform code and as such is not documented in the device tree bindings. Signed-off-by: Andy Shevchenko --- drivers/usb/dwc3/drd.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/usb/dwc3/drd.c b/drivers/usb/dwc3/drd.c index 5dc4cddd5b68..d6

[PATCH v1 3/5] staging: typec: fusb302: Rename fcs,extcon-name to linux,extcon-name

2018-11-10 Thread Andy Shevchenko
Since we are going to use the same in Designware USB 3 driver, rename the property to be consistent across the drivers. No functional change intended. Cc: Hans de Goede Cc: Guenter Roeck Signed-off-by: Andy Shevchenko --- drivers/platform/x86/intel_cht_int33fe.c | 2 +- drivers/usb/typec

[PATCH v1 4/5] usb: dwc3: drd: Switch to device property for 'extcon' handling

2018-11-10 Thread Andy Shevchenko
Switch to device property for 'extcon' handling. No functional change intended. Signed-off-by: Andy Shevchenko --- drivers/usb/dwc3/drd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/drd.c b/drivers/usb/dwc3/drd.c index e7e421521a34..5d

[PATCH v1 1/5] drivercore: Revert "deferral race condition fix"

2018-11-10 Thread Andy Shevchenko
lipe Balbi Cc: Andrzej Hajda Signed-off-by: Andy Shevchenko --- drivers/base/dd.c | 27 ++- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/drivers/base/dd.c b/drivers/base/dd.c index 169412ee4ae8..9a966e45fda5 100644 --- a/drivers/base/dd.c +++ b/drivers

[PATCH v1 2/5] extcon: Return -EPROBE_DEFER when extcon device is not found

2018-11-10 Thread Andy Shevchenko
-EPROBE_DEFER directly from extcon_get_extcon_dev(). Signed-off-by: Andy Shevchenko --- drivers/extcon/extcon-axp288.c| 4 ++-- drivers/extcon/extcon.c | 2 +- drivers/power/supply/axp288_charger.c | 8 drivers/usb/phy/phy-omap-otg.c| 6 +++--- drivers/usb

Re: [PATCH v15 0/2] Add support for USB Type-C interface on latest NVIDIA GPU

2018-11-09 Thread Andy Shevchenko
On Fri, Nov 09, 2018 at 05:45:16PM +0100, Wolfram Sang wrote: > On Mon, Oct 29, 2018 at 02:42:37PM +0200, Andy Shevchenko wrote: > > On Fri, Oct 26, 2018 at 09:36:57AM -0700, Ajay Gupta wrote: > > > Hi Heikki and Wolfram, > > > > > > These two changes add

Re: [PATCH v15 0/2] Add support for USB Type-C interface on latest NVIDIA GPU

2018-10-29 Thread Andy Shevchenko
limitation is not affecting I2C host which do not have such > limitation. > > I think the patches should through usb tree because the main functionality is > usb Type-C. FWIW, Reviewed-by: Andy Shevchenko > > Thanks > Ajay > > Ajay Gupta (2): > i2c: buses: ad

Re: [PATCH v14 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-10-26 Thread Andy Shevchenko
usleep_range(1, 11000); > + } while (data && --count); I don't see any point to check data here. How can it be different from the check above? > + return -ETIMEDOUT; -- With Best Regards, Andy Shevchenko

Re: [PATCH v13 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-10-25 Thread Andy Shevchenko
to clear interrupt status. > > > > > > > Shouldn't you return -ETIMEDOUT if count == 0? > > > Yes. Good catch. Does the below fix looks ok? > > > > At least for me looks OK (I dunno why I missed that what Heikki found > > recently). > > Nevertheless, I have one more question about (1) and (2) above. > > > > Is it necessary to do one more read before do-while loop? > Yes, we need to read to get interrupt status bits and then write > them back to clear the status. Ah, I see, but why you not reorganize it to put this into do-while loop? do { read write check for data sleep } while (--count); Also note predecrement. -- With Best Regards, Andy Shevchenko

Re: [PATCH v13 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-10-24 Thread Andy Shevchenko
do { > status = ccg_write(uc, CCGX_RAB_INTR_REG, &data, > sizeof(data)); > if (status < 0) > return status; > > usleep_range(1, 11000); > > status = ccg_read(uc, CCGX_RAB_INTR_REG, &data, sizeof(data)); > if (status < 0) > return status; > > if (!data) > return 0; > } while (data && count--); > > return -ETIMEDOUT; -- With Best Regards, Andy Shevchenko

Re: [PATCH v6 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-09-05 Thread Andy Shevchenko
On Thu, Sep 6, 2018 at 1:22 AM Ajay Gupta wrote: > > Latest NVIDIA GPU cards have a Cypress CCGx Type-C controller > over I2C interface. > > This UCSI I2C driver uses I2C bus driver interface for communicating > with Type-C controller. > FWIW, Reviewed-by: Andy Shevchenko

Re: [PATCH v6 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-09-05 Thread Andy Shevchenko
of USB Type-C UCSI driver. > FWIW, Reviewed-by: Andy Shevchenko > Signed-off-by: Ajay Gupta > --- > Changes from v1 -> v2 > None > Changes from v2 -> v3 > Fixed review comments from Andy and Thierry > Rename i2c-gpu.c -> i2c-nvidia-gpu.c >

Re: [PATCH v3 00/10] usb: typec: A few more improvements for Intel CHT

2018-09-04 Thread Andy Shevchenko
ices. > > The origin thread can be read here: > https://www.spinics.net/lists/linux-usb/msg172033.html > > It seems you forgot my tag Acked-by: Andy Shevchenko for PDx86 bits on condition that Hans is okay with them. > Heikki Krogerus (10): > usb: typec: Take care o

Re: [PATCH v2 00/10] usb: typec: A few more improvements for Intel CHT

2018-09-03 Thread Andy Shevchenko
rs. I also > added a trivial cleanup patch (patch 10/10) for the fusb302.c to this > series, and also a few fixes (1/10 and 2/10) to the mux handling. > > The origin thread can be read here: > https://www.spinics.net/lists/linux-usb/msg172033.html > > Acked-by: Andy Shevchenk

Re: [PATCH 0/8] usb: typec: A few more improvements for Intel CHT

2018-09-03 Thread Andy Shevchenko
On Mon, Sep 3, 2018 at 10:19 AM Heikki Krogerus wrote: > > On Mon, Sep 03, 2018 at 09:17:13AM +0300, Andy Shevchenko wrote: > > On Fri, Aug 31, 2018 at 5:21 PM Heikki Krogerus > > wrote: > > > > > > Hi, > > > > > > The second last patch in th

Re: [PATCH 0/8] usb: typec: A few more improvements for Intel CHT

2018-09-02 Thread Andy Shevchenko
int33fe.c | 34 +++-- > drivers/usb/host/xhci-pci.c | 20 +++-- > drivers/usb/typec/class.c| 38 ++-- > include/linux/device.h | 24 +++ > 4 files changed, 74 insertions(+), 42 deletions(-) > > -- > 2.18.0 > -- With Best Regards, Andy Shevchenko

Re: [PATCH 4/8] usb: xhci: pci: Only create Intel mux device when it's needed

2018-09-02 Thread Andy Shevchenko
it make sense to have this in some header (usb.h?)? -- With Best Regards, Andy Shevchenko

Re: [PATCH v4 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-08-30 Thread Andy Shevchenko
gt;data->ctrl.raw_cmd = ctrl->raw_cmd; > + err = ucsi_ccg_send_data(uc); > + > + return err; > +} > +static int ucsi_ccg_probe(struct i2c_client *client, > + const struct i2c_device_id *id) One line? > +static const struct i2c_device_id ucsi_ccg_device_id[] = { > + {"ccgx-ucsi", 0}, > + {}, Terminator better w/o comma. > +}; > +MODULE_DEVICE_TABLE(i2c, ucsi_ccg_device_id); -- With Best Regards, Andy Shevchenko

Re: [PATCH v4 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-08-30 Thread Andy Shevchenko
he class appears it can be added later on. > + { } > +}; > +MODULE_DEVICE_TABLE(pci, gpu_i2c_ids); > + > +static int gpu_i2c_probe(struct pci_dev *dev, const struct pci_device_id *id) Use pdev instead of dev to distinguish struct device from struct pci_dev type in variable name. > +static void gpu_i2c_remove(struct pci_dev *dev) Ditto. > + struct gpu_i2c_dev *i2cd = pci_get_drvdata(to_pci_dev(dev)); Isn't the same as dev_get_drvdata() ? > + struct gpu_i2c_dev *i2cd = pci_get_drvdata(to_pci_dev(dev)); Ditto. -- With Best Regards, Andy Shevchenko

[PATCH v1] USB: wusbcore: Switch to bitmap_zalloc()

2018-08-30 Thread Andy Shevchenko
Switch to bitmap_zalloc() to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *. Signed-off-by: Andy Shevchenko --- drivers/usb/wusbcore/wa-rpipe.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/usb

Re: [PATCH v3 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-08-30 Thread Andy Shevchenko
+ if (status < 0) { > + dev_err(uc->dev, "ucsi_ccg_init failed - %d\n", status); > + return status; > + } > + > + uc->irq = client->irq; > + > + status = devm_request_threaded_irq(dev, uc->irq, NULL, > ccg_irq_handler, > + IRQF_ONESHOT | IRQF_TRIGGER_HIGH, ONESHORT can be dropped here (it's set based on condition when irq handler NULL and threadirq is not). > + dev_name(dev), uc); > + if (status < 0) { > + dev_err(uc->dev, "request_threaded_irq failed - %d\n", > status); > + return status; > + } > + > + uc->ucsi = ucsi_register_ppm(dev, &uc->ppm); > + if (IS_ERR(uc->ucsi)) { > + dev_err(uc->dev, "ucsi_register_ppm failed\n"); > + return PTR_ERR(uc->ucsi); > + } > + > + i2c_set_clientdata(client, uc); > + return 0; > +} > + > +static int ucsi_ccg_remove(struct i2c_client *client) > +{ > + struct ucsi_ccg *uc = i2c_get_clientdata(client); > + > + ucsi_unregister_ppm(uc->ucsi); > + > + return 0; > +} > + > +static const struct i2c_device_id ucsi_ccg_device_id[] = { > + {"ccgx-ucsi", 0}, > + {}, Terminator line better without comma. > +}; > +MODULE_DEVICE_TABLE(i2c, ucsi_ccg_device_id); > + > +static struct i2c_driver ucsi_ccg_driver = { > + .driver = { > + .name = "ucsi_ccg", > + }, > + .probe = ucsi_ccg_probe, > + .remove = ucsi_ccg_remove, > + .id_table = ucsi_ccg_device_id, > +}; > + > +module_i2c_driver(ucsi_ccg_driver); > + > +MODULE_AUTHOR("Ajay Gupta "); > +MODULE_DESCRIPTION("UCSI driver for Cypress CCGx Type-C controller"); > +MODULE_LICENSE("GPL v2"); > -- > 2.7.4 > -- With Best Regards, Andy Shevchenko

Re: [PATCH v3 1/2] i2c: buses: add i2c bus driver for NVIDIA GPU

2018-08-30 Thread Andy Shevchenko
will be part of USB Type-C UCSI driver. > Some small comments below, after addressing them Reviewed-by: Andy Shevchenko > Signed-off-by: Ajay Gupta > --- > Changes from v1 -> v2 > None > Changes from v2 -> v3 > Fixed review comments from Andy and Thi

[PATCH v1] usb: dwc3: core: Clean up ULPI device

2018-08-27 Thread Andy Shevchenko
If dwc3_core_init_mode() fails with deferred probe, next probe fails on sysfs with sysfs: cannot create duplicate filename '/devices/pci:00/:00:11.0/dwc3.0.auto/dwc3.0.auto.ulpi' To avoid this failure, clean up ULPI device. Signed-off-by: Andy Shevchenko --- drivers/usb/d

Re: [PATCH v2 1/7] usb: chipidea: Add dynamic pinctrl selection

2018-08-27 Thread Andy Shevchenko
ange here. Anyway, it's a minor. Free to fix whenever more serious stuff appears. -- With Best Regards, Andy Shevchenko

Re: [PATCH v2 2/2] usb: typec: ucsi: add support for Cypress CCGx

2018-08-25 Thread Andy Shevchenko
d. If you are not the intended recipient, please contact the > sender by > reply email and destroy all copies of the original message. > --- You have an issue here. -- With Best Regards, Andy Shevchenko

Re: [PATCH 1/6] usb: chipidea: Add dynamic pinctrl selection

2018-08-23 Thread Andy Shevchenko
pinctrl_select_state(ci->platdata->pctl, > +ci->platdata->pins_device); > + if (ci->platdata->pins_device && ci->platdata->pins_default) > + pinctrl_select_state(ci->platdata->pctl, > +ci->platdata->pins_default); Ditto about conditional. -- With Best Regards, Andy Shevchenko

Re: [PATCH 3/4] usb: dwc3: trace: log ep commands in hex

2018-08-23 Thread Andy Shevchenko
On Mon, Aug 20, 2018 at 3:21 PM Laurent Pinchart wrote: > > Hi Andy, > > On Monday, 20 August 2018 15:06:31 EEST Andy Shevchenko wrote: > > On Mon, Aug 20, 2018 at 2:25 PM, Laurent Pinchart wrote: > > >> - TP_printk("%s: cmd '%s&#x

Re: [PATCH 3/4] usb: dwc3: trace: log ep commands in hex

2018-08-20 Thread Andy Shevchenko
Side note: # is one character less for the same. -- With Best Regards, Andy Shevchenko

Re: [PATCH v2] usb: musb: gadget: Fix big-endian arch issue

2018-08-03 Thread Andy Shevchenko
uest->wIndex; > + epnum = (u8) le16_to_cpu(ctrlrequest->wIndex); > + u16 reqval = le16_to_cpu(ctrlrequest->wValue); > + u16 reqidx = le16_to_cpu(ctrlrequest->wIndex); I'm wondering, if you run make with C=1 CF=-D__CHECK_ENDIAN__ before and after your

Re: [PATCH] USB: serial: ftdi_sio: Add support for CBUS GPIO

2018-08-01 Thread Andy Shevchenko
} devm_ ? > + return 0; > +} > + > +static void ftdi_unregister_cbus_gpiochip(struct usb_serial_port *port) > +{ > + struct ftdi_private *priv = usb_get_serial_port_data(port); > + struct ftdi_gpiochip *fgc = priv->fgc; > + > + if (fgc) { How you can b

Re: [PATCH] usb: dwc3: Set default mode for dwc_usb31

2018-07-27 Thread Andy Shevchenko
gt;> either. >> The check is redundant and absence of else adds additional burden on >> the all the rest cases. > > Look a little closer > >> mode = dwc->dr_mode; >> hw_mode = DWC3_GHWPARAMS0_MODE(dwc->hwparams.hwparams0); >> >> switch (hw_mode) { > ^^^ > Switching on hw_mode, not mode. Ah, indeed. That's what I have missed. Thanks for detailed explanation! -- With Best Regards, Andy Shevchenko -- 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] usb: dwc3: Set default mode for dwc_usb31

2018-07-27 Thread Andy Shevchenko
On Fri, Jul 27, 2018 at 2:02 AM, Thinh Nguyen wrote: > On 7/26/2018 2:59 PM, Thinh Nguyen wrote: >> On 7/26/2018 2:32 PM, Andy Shevchenko wrote: >>> On Thu, Jul 26, 2018 at 11:52 PM, Thinh Nguyen >>> wrote: >>>> dwc_usb31 does not support OTG mode. If t

Re: [PATCH] usb: dwc3: Set default mode for dwc_usb31

2018-07-26 Thread Andy Shevchenko
else if (dwc3_is_usb31(...)) ? > + mode = USB_DR_MODE_PERIPHERAL; > } > > if (mode != dwc->dr_mode) { > -- > 2.11.0 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-usb" in > the body of a message to majord...@v

Re: [PATCH v2 3/3] usb: dwc2: Make dwc2_readl/writel functions endianness-agnostic.

2018-07-26 Thread Andy Shevchenko
define swap32(x) (\ > + {typeof(x) x_ = (x); \ > + (((u32)(x_) << 24) & (u32)0xFF00) | \ > + (((u32)(x_) << 8) & (u32)0x00FF) | \ > + (((u32)(x_) >> 8) & (u32)0xFF00) | \ > + (((u32)(x_) >> 24) & (u32)0x00

Re: [PATCH v2 2/3] usb: dwc2: replace ioread32/iowrite32_rep with dwc2_readl/writel_rep

2018-07-26 Thread Andy Shevchenko
On Thu, Jul 26, 2018 at 5:00 PM, Gevorg Sahakyan wrote: > dwc2_readl_rep/dwc2_writel_rep functions using readl/writel in a > loop. Why this is better? Any regression or what? -- With Best Regards, Andy Shevchenko -- To unsubscribe from this list: send the line "unsubscribe linux-

Re: [PATCH v3 1/2] usb: dwc3: pci: Supply device properties via driver data

2018-07-26 Thread Andy Shevchenko
On Thu, 2018-07-26 at 14:50 +0300, Felipe Balbi wrote: > Andy Shevchenko writes: > > > For now all PCI enumerated dwc3 devices require some properties > > to be present. This allows us to unconditionally append them and > > supply > > via driver_data. > >

[PATCH v3 2/2] usb: dwc3: pci: Intel Merrifield can be host

2018-07-26 Thread Andy Shevchenko
On Intel Edison board the OTG function is enabled, thus, USB can switch to the host mode. Allow that by changing dr_mode property to "otg" for Intel Merrifield. Signed-off-by: Andy Shevchenko --- drivers/usb/dwc3/dwc3-pci.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletio

[PATCH v3 1/2] usb: dwc3: pci: Supply device properties via driver data

2018-07-26 Thread Andy Shevchenko
For now all PCI enumerated dwc3 devices require some properties to be present. This allows us to unconditionally append them and supply via driver_data. No functional change intended. Signed-off-by: Andy Shevchenko --- drivers/usb/dwc3/dwc3-pci.c | 107 +--- 1

Re: [PATCH 4/8] usb: dwc3: implement stream transfer timeout

2018-07-25 Thread Andy Shevchenko
uld change it, I will fix it > in v2 But you didn't put that comment before each occurrence of this constant in the code, right? That's what I'm talking about. If reader looks into the code, there is no need to understand the order of the value for timeout, since units are part o

Re: [PATCH 4/8] usb: dwc3: implement stream transfer timeout

2018-07-25 Thread Andy Shevchenko
#define STREAM_TIMEOUT 50 Perhaps, STREAM_TIMEOUT_MS 50 Dunno about this driver, but it's a usual practice to help reader with understanding code on the first glance. -- With Best Regards, Andy Shevchenko -- To unsubscribe from this list: send the line "unsubscribe li

[PATCH v2 3/3] dwc3: Intel Merrifield can be host

2018-07-23 Thread Andy Shevchenko
On Intel Edison board the OTG function is enabled, thus, USB can switch to the host mode. Allow that by changing dr_mode property to "otg" for Intel Merrifield. Signed-off-by: Andy Shevchenko --- drivers/usb/dwc3/dwc3-pci.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletio

[PATCH v2 1/3] dwc3: Describe 'wakeup_work' field of struct dwc3_pci

2018-07-23 Thread Andy Shevchenko
Describe 'wakeup_work' field of struct dwc3_pci to avoid a warning: drivers/usb/dwc3/dwc3-pci.c:59: warning: Function parameter or member 'wakeup_work' not described in 'dwc3_pci' Signed-off-by: Andy Shevchenko --- drivers/usb/dwc3/dwc3-pci.c | 1 + 1 file chang

[PATCH v2 2/3] dwc3: Supply device properties via driver data

2018-07-23 Thread Andy Shevchenko
For now all PCI enumerated dwc3 devices require some properties to be present. This allows us to unconditionally append them and supply via driver_data. No functional change intended. Signed-off-by: Andy Shevchenko --- drivers/usb/dwc3/dwc3-pci.c | 145 +++- 1

[PATCH v1 2/2] dwc3: Supply device properties via driver data

2018-07-20 Thread Andy Shevchenko
For now all PCI enumerated dwc3 devices require some properties to be present. This allows us to unconditionally append them and supply via driver_data. No functional change intended. Signed-off-by: Andy Shevchenko --- drivers/usb/dwc3/dwc3-pci.c | 145 +++- 1

[PATCH v1 1/2] dwc3: Describe 'wakeup_work' field of struct dwc3_pci

2018-07-20 Thread Andy Shevchenko
Describe 'wakeup_work' field of struct dwc3_pci to avoid a warning: drivers/usb/dwc3/dwc3-pci.c:59: warning: Function parameter or member 'wakeup_work' not described in 'dwc3_pci' Signed-off-by: Andy Shevchenko --- drivers/usb/dwc3/dwc3-pci.c | 1 + 1 file chang

Re: [PATCH 4/5] USB: serial: cp210x: generalise CP2102N line-speed handling

2018-07-18 Thread Andy Shevchenko
On Wed, Jul 18, 2018 at 3:37 PM, Johan Hovold wrote: > On Wed, Jul 18, 2018 at 03:34:34PM +0300, Andy Shevchenko wrote: >> On Wed, Jul 18, 2018 at 3:25 PM, Johan Hovold wrote: >> Looks like ping-pong type of changes. >> I think the factoring of this particular piece o

Re: [PATCH 4/5] USB: serial: cp210x: generalise CP2102N line-speed handling

2018-07-18 Thread Andy Shevchenko
00 / (2 * prescaler * clk_div); > - } Looks like ping-pong type of changes. I think the factoring of this particular piece of code can be done in patch 3 in somewhat similar way. -- With Best Regards, Andy Shevchenko -- To unsubscribe from this list: send the line "unsubscribe

Re: [PATCH v5] USB: serial: ftdi_sio: Add MTP NVM support

2018-06-26 Thread Andy Shevchenko
On Tue, Jun 26, 2018 at 3:57 PM, Andy Shevchenko wrote: Just noticed you have sent v6. I'm pretty fine with it, thanks! -- With Best Regards, Andy Shevchenko -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.

Re: [PATCH v5] USB: serial: ftdi_sio: Add MTP NVM support

2018-06-26 Thread Andy Shevchenko
On Tue, Jun 26, 2018 at 2:51 PM, Loic Poulain wrote: > On 26 June 2018 at 13:02, Andy Shevchenko wrote: >> On Mon, Jun 25, 2018 at 3:35 PM, Loic Poulain >> wrote: >>> + unsigned char *buf = val; >> >> Btw, not sure why you need this now... > &g

  1   2   3   >