aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/most/core.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-05-08staging: most: make interface drivers allocate coherent memoryChristian Gromm1-6/+11
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-08staging: most: add channel property dbr_sizeChristian Gromm1-0/+22
This patch adds the channel property dbr_size to control the corresponding buffer size of the channels of the DIM2 interface. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-08staging: most: allocate only all requested memoryChristian Gromm1-15/+16
This prohibits the allocation of the memory for the MBOs if only the part of the MBOs, requested by the application, may be allocated. The function arm_mbo_chain, if cannot allocate all requested MBO, frees all prior allocated memory and returns 0. Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-08staging: most: Remove unnecessary usage of BUG_ON().Quytelda Kahja1-3/+0
There is no need for the calls to BUG_ON() in this driver, which are used to check if mbo or mbo->context are NULL; mbo is never NULL, and if mbo->context is NULL it would have already been dereferenced and oopsed before reaching the BUG_ON(). Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Acked-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-06staging: most: Indent function parameter.Quytelda Kahja1-1/+2
Indent the parameters for a function call that extends past 80 characters. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-06staging: most: Add a blank line.Quytelda Kahja1-0/+1
Use a blank line after components_show() function declaration. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-01staging: most: Remove unnecessary OOM messages.Quytelda Kahja1-2/+0
It isn't necessary for the driver to log out-of-memory errors, so these have been removed and the functions simply return -ENOMEM. Signed-off-by: Quytelda Kahja <quytelda@tamalin.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08staging: most: Avoid trailing semicolon for macrosRavi Eluri1-1/+1
Fixes checkpatch warning: macros should not use a trailing semicolon. Signed-off-by: Ravi Eluri <venkataravi.e@techveda.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-13staging: most: core: make functions print_links and most_match staticColin Ian King1-2/+2
The functions print_links and most_match static are local to the source and do not need to be in global scope, so make them static. Cleans up sparse warnings: symbol 'print_links' was not declared. Should it be static? symbol 'most_match' was not declared. Should it be static? Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27staging: most: core: fix list traversingAndrey Shvetsov1-4/+13
This patch fixes the offset and data handling when traversing the list of devices that are attached to the bus. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27staging: most: core: remove class generationChristian Gromm1-12/+1
This patch stops the core from generating a module owned class and registering it with the kernel. It is needed, because there is no need for a default MOST class to be present in the kernel. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27staging: most: core: check value returned by match functionChristian Gromm1-0/+4
This patch adds a check for the pointer returned by the function match_component. It is needed to prevent a NULL pointer dereference in case the provided component name does not match any list entry. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27staging: most: core: fix formattingChristian Gromm1-6/+1
This patch fixes coding style violations. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27staging: most: core: denote modules as componentsChristian Gromm1-12/+12
Substrings containing 'module' are replaced with 'component' by this patch. It is needed to complete the process of changing the module designator from AIM to Component. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27staging: most: fix comment sectionsChristian Gromm1-62/+46
This patch updates and corrects the comment sections of the code. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27staging: most: core: rename function link_channel_to_aimChristian Gromm1-4/+4
This patch renames the function link_channel_to_aim to link_channel_to_component. It is needed because userspace interfacing modules are referred to as components. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27staging: most: core: rename aim variablesChristian Gromm1-85/+87
This patch replaces the 'aim' substrings of variable names with 'comp'. It is needed because of the renaming of AIM modules to components. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27staging: most: core: rename mod_listChristian Gromm1-5/+5
This patch renames the variable mod_list to comp_list. It is needed because modules that interface userspace are referred to as components. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27staging: most: rename functions to register a driver with most_coreChristian Gromm1-6/+7
This patch renames the functions to register and deregister a component module with the core. It is needed because the modules that interface the userspace are referred to as components. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27staging: most: rename struct most_aimChristian Gromm1-15/+15
The designator of a module that proivdes means to interface userspace is called an AIM. Since this name seems to be unappropiate, this kind of moduels are going to be referred to as componetns. This is done because such modules function as components to enhance the core with new features. This patch renames the struct most_aim to core_component. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27staging: most: core: put channel name in struct most_channelChristian Gromm1-7/+6
This patch stores a channel's name inside the most_channel structure. It is needed to have the channel attributes tied together. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27staging: most: core: replace struct most_inst_objChristian Gromm1-103/+97
This patch introduces struct interface_private as a replacement for the struct most_inst_obj. This structure holds private data that is only needed by the core module and will be accessed by a pointer from within the most_interface structure. As a result of this replacement the bus helper functions can be used to search for devices. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27staging: most: core: rename functionChristian Gromm1-4/+4
The core module used to have two functions to find a certain channel. One by name and one by interface. Since no channel is searched by its interface name anymore the by_name suffix is rendered redundant. This patch renames the function accordingly. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27staging: most: core: remove struct deviceChristian Gromm1-17/+0
This patch takes out the struct device of struct most_aim, because it is not needed. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27staging: most: core: fix sysfs attribute managementChristian Gromm1-36/+73
This patch creates a new attribute group to manage the attributes of a registered aim module in sysfs and changes the show and store functions accordingly. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27staging: most: core: track aim modules with linked listChristian Gromm1-2/+4
The core needs to know what modules are registered. This patch makes the core keep track of the registered modules. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27staging: most: core: use structure to pack driver specific dataChristian Gromm1-39/+34
This patch introduces the structure "mostcore" to bundle core specific data structures. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27staging: most: core: rename members aim* of struct most_channelChristian Gromm1-52/+52
This patch renames the struct members "aim0" and "aim0" to "pipe0" and "pipe1". It is needed to have a conclusive nomenclature of the struct and its instances. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27staging: most: core: rename struct memeberChristian Gromm1-39/+39
This patch renames the member "ptr" of struct pipe to "aim". This is needed to increase the readability of the code. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27staging: most: core: rename struct most_c_aim_obj to pipeChristian Gromm1-3/+3
This patch replaces the confusing name of struct "most_c_aim_obj" with "pipe" to better express the function that is behind the structure. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27staging: most: core: rename structureChristian Gromm1-52/+52
This patch renames the structure most_c_obj to most_channel. This is needed to enhance readability. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27staging: most: core: encapsulate code in functionChristian Gromm1-13/+26
This patch adds the function link_channel_to_aim to increase readability of the function add_link_store. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27staging: most: core: add a match function for the busChristian Gromm1-0/+9
This patch adds the function most_match. It is needed to accociate registered devices and drivers with the bus. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27staging: most: core: remove function get_channel_by_ifaceChristian Gromm1-34/+13
This patch removes the function get_channel_by_iface that walks a list of all registered interfaces and returns a pointer to a channel when matched. Instead the private field of the interface structure is used to directly access the channel via the id. The patch is needed to remove unnecessary list traversing. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27staging: most: remove proprietary kobjectsChristian Gromm1-569/+234
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-27staging: most: move core filesChristian Gromm1-0/+1943
This patch moves the core files to the root dir of the driver. This is needed to clean up the directory layout. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>