History log of /linux-master/drivers/misc/hisi_hikey_usb.c
Revision Date Author Comments
# 09ed594e 21-Feb-2024 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

misc: hisi_hikey_usb: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: John Stultz <jstultz@google.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/8775e9573fec55c5fc04151800829e9aeafc5dda.1708508896.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3f03dade 04-Mar-2024 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

misc: hisi_hikey_usb: Remove unused of_gpio.h

of_gpio.h is deprecated and subject to remove.
The driver doesn't use it, simply remove the unused header.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: John Stultz <jstultz@google.com>
Link: https://lore.kernel.org/r/20240304180829.1201726-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a34993a2 03-Sep-2021 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

misc: hisi_hikey_usb: change the DT schema

As there's no upstream DT bindings for this driver, let's
update its DT schema, while it is not too late.

While here, add error messages, in order to help discovering
problems during probing time.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/746237a6bdbb84d4271a77994c82bccf524680c7.1630659949.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b36773c3 26-Oct-2020 Sudip Mukherjee <sudipm.mukherjee@gmail.com>

misc: hisi_hikey_usb: use PTR_ERR_OR_ZERO

Coccinelle suggested using PTR_ERR_OR_ZERO() and looking at the code,
we can use PTR_ERR_OR_ZERO() instead of checking IS_ERR() and then
doing 'return 0'.

Tested-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Link: https://lore.kernel.org/r/20201026180026.3350-1-sudipm.mukherjee@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 26ed5146 18-Sep-2020 Dan Carpenter <dan.carpenter@oracle.com>

misc: hisi_hikey_usb: delete a stray tab

This return statement is indented one tab too far.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20200918143405.GF909725@mwanda
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 78ec0349 14-Sep-2020 Colin Ian King <colin.king@canonical.com>

misc: hisi_hikey_usb: fix return of uninitialized ret status variable

Currently the return value from ret is uninitialized so the function
hisi_hikey_usb_parse_kirin970 is returning a garbage value when
succeeding. Since ret is not used anywhere else in the function, remove
it and just return 0 success at the end of the function.

Fixes: d210a0023590 ("misc: hisi_hikey_usb: add support for Hikey 970")
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20200914135646.99334-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d210a002 10-Sep-2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

misc: hisi_hikey_usb: add support for Hikey 970

The HiKey 970 board is similar to Hikey 960 with regards
to its USB configutation: it also relies on a USB HUB
that is used when DWC3 is at host mode.

However, it requires a few extra DT settings, as it
uses a voltage regulator and GPIO reset pin.

Add support for them.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/62843df9927b4d8dac5dc7c4a189567fa52ab2bb.1599717402.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7a6ff4c4 10-Sep-2020 Yu Chen <chenyu56@huawei.com>

misc: hisi_hikey_usb: Driver to support onboard USB gpio hub on Hikey960

The HiKey960 has a fairly complex USB configuration due to it
needing to support a USB-C port for host/device mode and multiple
USB-A ports in host mode, all using a single USB controller.

See schematics here:
https://github.com/96boards/documentation/raw/master/consumer/hikey/hikey960/hardware-docs/HiKey960_Schematics.pdf

This driver acts as a usb-role-switch intermediary, intercepting
the role switch notifications from the tcpm code, and passing
them on to the dwc3 core.

In doing so, it also controls the onboard hub and power gpios in
order to properly route the data lines between the USB-C port
and the onboard hub to the USB-A ports.

Signed-off-by: Yu Chen <chenyu56@huawei.com>
[jstultz: Major rework to make the driver a usb-role-switch
intermediary]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/c263f72e1d803c18c45a69ce2c333e79a7ed89ff.1599717402.git.mchehab+huawei@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>