- 20 Jul, 2023 2 commits
-
-
Yuanjun Gong authored
in mcfqspi_probe(), the return value of function clk_prepare_enable() should be checked, since it may fail. using devm_clk_get_enabled() instead of devm_clk_get() and clk_prepare_enable() can avoid this problem. Signed-off-by:
Yuanjun Gong <ruc_gongyuanjun@163.com> Link: https://lore.kernel.org/r/20230720140909.34084-1-ruc_gongyuanjun@163.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
Yuanjun Gong authored
in bcm2835_spi_probe(), clk_prepare_enable() may fail, therefore, the return value of clk_prepare_enable() should be checked, and the function should return error if clk_prepare_enable() fails. Signed-off-by:
Yuanjun Gong <ruc_gongyuanjun@163.com> Link: https://lore.kernel.org/r/20230720140859.33883-1-ruc_gongyuanjun@163.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
- 19 Jul, 2023 4 commits
-
-
Fabrizio Castro authored
Use device_set_node instead of assigning controller->dev.of_node directly because it also sets the firmware node. Signed-off-by:
Fabrizio Castro <fabrizio.castro.jz@renesas.com> Suggested-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20230718192453.543549-5-fabrizio.castro.jz@renesas.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
Fabrizio Castro authored
Table x_trg can be replaced with ilog2(), and table x_trg_words can be replaced with rounddown_pow_of_two(). Replace the tables usage with the corresponding macros. While at it, remove a couple of unnecessary empty lines. Signed-off-by:
Fabrizio Castro <fabrizio.castro.jz@renesas.com> Suggested-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by:
Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20230718192453.543549-4-fabrizio.castro.jz@renesas.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
Fabrizio Castro authored
"unsigned int" is more appropriate than "int" for the members of "struct rzv2m_csi_priv". Using void* rather than u8* for txbuf and rxbuf allows for the removal of some type casting. Remove the unnecessary casting of "data" to "struct rzv2m_csi_priv*" in function "rzv2m_csi_irq_handler". Also, members "bytes_per_word" and "errors" introduce gaps in the structure. Adjust "struct rzv2m_csi_priv" and its members usage accordingly. Signed-off-by:
Fabrizio Castro <fabrizio.castro.jz@renesas.com> Suggested-by:
Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by:
Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20230718192453.543549-3-fabrizio.castro.jz@renesas.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
Fabrizio Castro authored
Register CLKSEL hosts the configuration for both clock polarity and data phase, and both values can be set in one write operation. Squash the clock polarity and data phase register writes into one statement, for efficiency. Signed-off-by:
Fabrizio Castro <fabrizio.castro.jz@renesas.com> Suggested-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20230718192453.543549-2-fabrizio.castro.jz@renesas.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
- 18 Jul, 2023 3 commits
-
-
Mark Brown authored
Merge series from Fabrizio Castro <fabrizio.castro.jz@renesas.com>: This series is to follow up on Geert and Andy feedback: https://patchwork.kernel.org/project/linux-renesas-soc/patch/20230622113341.657842-4-fabrizio.castro.jz@renesas.com/
-
Alexander Stein authored
PARAM.PCSNUM register on i.MX93 indicates the number of supported (hw) chip-selects. LPSPI4 has 3 while others have only 2. Still allow overwriting from DT. Signed-off-by:
Alexander Stein <alexander.stein@ew.tq-group.com> Link: https://lore.kernel.org/r/20230717085934.409476-3-alexander.stein@ew.tq-group.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
Alexander Stein authored
This is a preparation for reading number of chip-selects from hardware. This needs IO resources mapped and peripheral clocking enabled. No functional changes intended. Signed-off-by:
Alexander Stein <alexander.stein@ew.tq-group.com> Link: https://lore.kernel.org/r/20230717085934.409476-2-alexander.stein@ew.tq-group.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
- 17 Jul, 2023 6 commits
-
-
Fabrizio Castro authored
The ternary operators used to initialize tx_completed and rx_completed are not necessary, replace them with a better implementation. Signed-off-by:
Fabrizio Castro <fabrizio.castro.jz@renesas.com> Reviewed-by:
Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20230715010407.1751715-6-fabrizio.castro.jz@renesas.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
Fabrizio Castro authored
Both rzv2m_csi_sw_reset and rzv2m_csi_start_stop_operation call into readl_poll_timeout upon a certain condition, and return 0 otherwise. Flip the logic to improve readability. Signed-off-by:
Fabrizio Castro <fabrizio.castro.jz@renesas.com> Reviewed-by:
Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20230715010407.1751715-5-fabrizio.castro.jz@renesas.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
Fabrizio Castro authored
Clock "csiclk" gets divided by 2 * CSI_CLKSEL_CKS in order to generate the serial clock (output from master), with CSI_CLKSEL_CKS ranging from 0x1 (that means "csiclk" is divided by 2) to 0x3FFF ("csiclk" is divided by 32766). CSI_CKS_MAX is used for referring to the setting corresponding to the maximum frequency divider. Value 0x3FFF for CSI_CKS_MAX doesn't really means much to the reader without an explanation and a more readable definition. Add a comment with a meaningful description and also replace value 0x3FFF with the corresponding GENMASK, to make it very clear what the macro means. Signed-off-by:
Fabrizio Castro <fabrizio.castro.jz@renesas.com> Reviewed-by:
Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20230715010407.1751715-4-fabrizio.castro.jz@renesas.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
Fabrizio Castro authored
Make use of HZ_PER_MHZ for CSI_MAX_SPI_SCKO to make it clear what its value means. Signed-off-by:
Fabrizio Castro <fabrizio.castro.jz@renesas.com> Reviewed-by:
Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20230715010407.1751715-3-fabrizio.castro.jz@renesas.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
Fabrizio Castro authored
Add missing include of bits.h file. Signed-off-by:
Fabrizio Castro <fabrizio.castro.jz@renesas.com> Reviewed-by:
Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20230715010407.1751715-2-fabrizio.castro.jz@renesas.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
Alexander Stein authored
This is only used during probe() call, so there is no need to store it longer than that. Signed-off-by:
Alexander Stein <alexander.stein@ew.tq-group.com> Link: https://lore.kernel.org/r/20230705090145.1354663-1-alexander.stein@ew.tq-group.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
- 14 Jul, 2023 5 commits
-
-
Rob Herring authored
The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes. Signed-off-by:
Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20230714174955.4064174-1-robh@kernel.orgSigned-off-by:
Mark Brown <broonie@kernel.org>
-
Andy Shevchenko authored
The Documentation/process/deprecated.rst suggests to use flexible array members to provide a way to declare having a dynamically sized set of trailing elements in a structure.This makes code robust agains bunch of the issues described in the documentation, main of which is about the correctness of the sizeof() calculation for this data structure. Due to above, prefer struct_size() over open-coded versions. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230714091748.89681-5-andriy.shevchenko@linux.intel.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
Andy Shevchenko authored
BITS_TO_BYTES() is the existing macro which takes care about full bytes that may fully hold the given amount of bits. Use it. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230714091748.89681-4-andriy.shevchenko@linux.intel.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
Andy Shevchenko authored
Now, spi_add_device_locked() has just a line on top of __spi_add_device(). Besides that, it has a single caller. So, just kill it and embed its parts into the caller. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230714091748.89681-3-andriy.shevchenko@linux.intel.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
Andy Shevchenko authored
The commit 0c79378c ("spi: add ancillary device support") added a dozen of duplicating lines of code. We may move them to the __spi_add_device(). Note, that the code may be called under the mutex. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by:
Sebastian Reichel <sebastian.reichel@collabora.com> Link: https://lore.kernel.org/r/20230714091748.89681-2-andriy.shevchenko@linux.intel.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
- 12 Jul, 2023 4 commits
-
-
Yangtao Li authored
The function no longer returns a value, synchronize the comments. Signed-off-by:
Yangtao Li <frank.li@vivo.com> Link: https://lore.kernel.org/r/20230712064832.67091-1-frank.li@vivo.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
Mark Brown authored
Merge series from Andy Shevchenko <andriy.shevchenko@linux.intel.com>: Various cleanups and refactorings of the SPI header and core parts united in a single series. It also touches drivers under SPI subsystem folder on the pure renaming purposes of some constants. No functional change intended.
-
Mark Brown authored
Merge series from Maksim Kiselev <bigunclemax@gmail.com>: This series extends the previous https://lore.kernel.org/all/20230510081121.3463710-1-bigunclemax@gmail.com And adds support for Dual and Quad SPI modes for the listed SoCs. Both modes have been tested on the T113s and should work on other Allwinner's SoCs that have a similar SPI conttoller. It may also work for previous SoCs that support Dual/Quad modes. One of them are H6 and H616.
-
Mark Brown authored
Merge series from Martin Kurbanov <mmkurbanov@sberdevices.ru>: This series adds support for max_speed_hz and implement adjust_op_size() callback.
-
- 11 Jul, 2023 5 commits
-
-
Andy Shevchenko authored
Fix - spelling typos - capitalization of acronyms in the comments. While at it, fix the multi-line comment style. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230710154932.68377-16-andriy.shevchenko@linux.intel.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
Andy Shevchenko authored
Convert the users under SPI subsystem to SPI_CONTROLLER_HALF_DUPLEX. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230710154932.68377-15-andriy.shevchenko@linux.intel.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
Andy Shevchenko authored
Rename SPI_MASTER_GPIO_SS to SPI_CONTROLLER_GPIO_SS and convert the users to SPI_CONTROLLER_GPIO_SS to follow the new naming shema. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230710154932.68377-14-andriy.shevchenko@linux.intel.comReviewed-by:
Serge Semin <fancer.lancer@gmail.com> Signed-off-by:
Mark Brown <broonie@kernel.org>
-
Andy Shevchenko authored
Convert the users from SPI_MASTER_MUST_TX and/or SPI_MASTER_MUST_RX to SPI_CONTROLLER_MUST_TX and/or SPI_CONTROLLER_MUST_RX respectively and kill the not used anymore definitions. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230710154932.68377-13-andriy.shevchenko@linux.intel.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
Andy Shevchenko authored
Convert the users from SPI_MASTER_NO_TX and/or SPI_MASTER_NO_RX to SPI_CONTROLLER_NO_TX and/or SPI_CONTROLLER_NO_RX respectively and kill the not used anymore definitions. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230710154932.68377-12-andriy.shevchenko@linux.intel.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
- 10 Jul, 2023 5 commits
-
-
Andy Shevchenko authored
Sorting headers alphabetically helps locating duplicates, and make it easier to figure out where to insert new headers. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230710154932.68377-8-andriy.shevchenko@linux.intel.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
Andy Shevchenko authored
Follow the advice of the Documentation/filesystems/sysfs.rst and show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230710154932.68377-7-andriy.shevchenko@linux.intel.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
Andy Shevchenko authored
Instead of if-else-if, simply call roundup_pow_of_two(BITS_PER_BYTES()). Note, there is no division assumed as compiler may optimize it away. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230710154932.68377-4-andriy.shevchenko@linux.intel.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
Andy Shevchenko authored
Refactor spi_register_controller() to drop duplicate IDR allocation. Instead of if-else-if branching use two sequential if:s, which allows to re-use the logic of IDR allocation in all cases. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230710154932.68377-3-andriy.shevchenko@linux.intel.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
Andy Shevchenko authored
In the couple of places the NULL check of OF node is implied by the call that takes it as a parameter. Drop the respective duplicate checks. Signed-off-by:
Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20230710154932.68377-2-andriy.shevchenko@linux.intel.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
- 09 Jul, 2023 6 commits
-
-
Thierry Reding authored
Convert the Tegra114 SPI controller device tree bindings from plain text to json-schema format. Signed-off-by:
Thierry Reding <treding@nvidia.com> Reviewed-by:
Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20230705152603.2514235-3-thierry.reding@gmail.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
Thierry Reding authored
Convert the Tegra SFLASH controller bindings from the free-form text format to json-schema. Signed-off-by:
Thierry Reding <treding@nvidia.com> Reviewed-by:
Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20230705152603.2514235-2-thierry.reding@gmail.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
Thierry Reding authored
Convert the Tegra SLINK bindings from the free-form text format to json-schema. Signed-off-by:
Thierry Reding <treding@nvidia.com> Reviewed-by:
Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20230705152603.2514235-1-thierry.reding@gmail.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
Yangtao Li authored
Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by:
Yangtao Li <frank.li@vivo.com> Link: https://lore.kernel.org/r/20230706032727.9180-7-frank.li@vivo.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
Yangtao Li authored
Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by:
Yangtao Li <frank.li@vivo.com> Acked-by:
Thierry Reding <treding@nvidia.com> Link: https://lore.kernel.org/r/20230706032727.9180-6-frank.li@vivo.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-
Yangtao Li authored
Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by:
Yangtao Li <frank.li@vivo.com> Link: https://lore.kernel.org/r/20230706032727.9180-5-frank.li@vivo.comSigned-off-by:
Mark Brown <broonie@kernel.org>
-