Commit graph

24 commits

Author SHA1 Message Date
Christian Gromm
441be56f89 staging: most: usb: use EINVAL error code
This patch replaces the error code EIO with EINVAL, when there is no IO
happening.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Link: https://lore.kernel.org/r/1588672829-28883-3-git-send-email-christian.gromm@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-05 12:17:59 +02:00
Christian Gromm
3e8621aba7 staging: most: usb: remove overcautious parameter checking
The interface pointer passed to a core API function cannot be NULL. This
patch removes unnessecary the sanity check of the pointer.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/1588672829-28883-2-git-send-email-christian.gromm@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-05 12:17:58 +02:00
Christian Gromm
b276527539 staging: most: move core files out of the staging area
This patch moves the core module to the /drivers/most directory
and makes all necessary changes in order to not break the build.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Link: https://lore.kernel.org/r/1583845362-26707-2-git-send-email-christian.gromm@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-24 13:42:44 +01:00
Christian Gromm
fc157998b8 staging: most: usb: check for NULL device
Check if the dci structer has been allocated before trying to release it.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Link: https://lore.kernel.org/r/1579793906-5054-8-git-send-email-christian.gromm@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-24 10:08:41 +01:00
Christian Gromm
723de0f917 staging: most: remove device from interface structure
This patch makes the adapter drivers use their own device structures
when registering a most interface with the core module.
With this the module that actually operates the physical device is the
owner of the device.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Link: https://lore.kernel.org/r/1579793906-5054-2-git-send-email-christian.gromm@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-24 10:08:39 +01:00
Masahiro Yamada
532c291907 staging: most: remove header include path to drivers/staging
There is no need to add "ccflags-y += -I $(srctree)/drivers/staging"
just for including <most/most.h>.

Use the #include "..." directive with the correct relative path.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Link: https://lore.kernel.org/r/20200115164451.13203-1-masahiroy@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-16 20:56:31 +01:00
Christian Gromm
6f4d22d76b staging: most: use angle brackets in include path
This patch replaces the double quotes in all include paths
with angle brackets.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Link: https://lore.kernel.org/r/1576238662-16512-7-git-send-email-christian.gromm@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-17 13:58:31 +01:00
Christian Gromm
c1d3fb8abe staging: most: rename core.h to most.h
This patch renames the core header file core.h to most.h. The intention
behind this is to have a meaningful name once this file is moved to the
/include/linux directory.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Link: https://lore.kernel.org/r/1576238662-16512-2-git-send-email-christian.gromm@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-17 13:50:03 +01:00
Christian Gromm
5b082c2e07 staging: most: usb: remove prefix from description tag
This patch cuts off the usb_device prefix of the description string.
It is not needed, as the interface type is already available with the
interface attribute of a channel.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-16 13:25:17 +02:00
Christian Gromm
869d3acd48 staging: most: usb: add release function for DCI device
This patch adds the missing release function for the DCI device that frees
the container structure it is embedded in.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-02 15:18:36 -07:00
Christian Gromm
bddd3c2546 staging: most: fix label names
This patch makes use of label names that say what the goto
actually does, as recommended in the kernel documentation.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25 21:09:56 +02:00
Christian Gromm
be8a8ca34b staging: most: usb: remove local variable
This patch removes the local variable dev that is used to store the pointer
to the usb_device whenever it is used only once.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-08 13:41:51 +02:00
Christian Gromm
c06b99e002 staging: most: usb: fix usb_disconnect race condition
The functions usb_disconnect and usb_sndbulkpipe are racing for the struct
usb_device, which might cause a null pointer dereference exception. This
patch fixes this race condition by protecting the critical section inside
the function hdm_enque with the io_mutex.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-08 13:41:51 +02:00
Christian Gromm
9a32315b0b staging: most: usb: don't set URB_ZERO_PACKET flag for synchronous data
This patch avoids setting the URB_ZERO_PACKET transfer flag for synchronous
data. This is needed to prevent the host from sending an empty packet when
data is aligned to an endpoint packet boundary.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-08 13:41:51 +02:00
Christian Gromm
3b1a774bfc staging: most: usb: add ep number to log
This patch adds the endpoint number of the USB pipe that reports to be
broken into the log message. It is needed to make debugging for
applications more comfortable.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-08 13:41:50 +02:00
Christian Gromm
69c90cf1b2 staging: most: sound: call snd_card_new with struct device
This patch is needed as function snd_card_new needs a valid
parent device. Passing a NULL pointer leads to kernel Ooops.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-08 13:41:50 +02:00
Christian Gromm
3598cec585 staging: most: make interface drivers allocate coherent memory
On arm64/aarch64 architectures the allocation of coherent memory needs a
device that has the dma_ops properly set. That's why the core module of
the MOST driver is no longer able to allocate this type or memory. This
patch moves the allocation process down to the interface drivers where
the proper devices exist (e.g. platform device or USB system software).

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-08 13:41:50 +02:00
Ravi Eluri
9917b209f8 staging: most: Fix identifiers to function parameters
fixed "function definition argument should have an identifier name",
with appropriate identifier names. Pointed out by checkpatch.

Signed-off-by: Ravi Eluri <venkataravi.e@techveda.org>
Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:34:25 +01:00
Christian Gromm
f15e3ad3ef staging: most: make DEVICE_ATTR structures static
In order to limit the scope of the DEVICE_ATTR structure this patch
adds the keywork static.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-28 13:36:21 +01:00
Christian Gromm
3d9c54b5f9 staging: most: usb: fix show/store function names
This patch renames the show/store functions of the USB module.
It is needed to make the module meet the established naming
convention.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:37 +01:00
Christian Gromm
8f20f2dca8 staging: most: usb: clear functional stall on OUT endpoint
For the MOST packet channel there are two dedicated USB endpoints. But
internally the hardware has actually one channel for data forwarding from
and to MOST. To have the hardware clean up its state machine correctly in
case of an error, both USB pipes need to be reset.  This patch triggers the
host to also clear the OUT endpoint's halt condition in case an IN endpoint
has signaled to be stalled.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:36 +01:00
Christian Gromm
66b468865a staging: most: usb: remove pointer initialization
This patch removes the initialization of the priv pointer of the
most_interface structure.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:35 +01:00
Christian Gromm
4d5f022f3a staging: most: remove proprietary kobjects
This patch removes the proprietary kobjects used by the driver modules and
replaces them with device structs. The patch is needed to have the driver
being integrated into the kernel's device model.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:34 +01:00
Christian Gromm
6e01fc7775 staging: most: usb: rename module
This patch renames the folder of the usb module. It is needed
to clean up the  directory layout of the driver.

Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:34 +01:00
Renamed from drivers/staging/most/hdm-usb/hdm_usb.c (Browse further)