summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-microchip-core-spi.c
AgeCommit message (Collapse)Author
12 daysspi: microchip-core: Refactor FIFO read and write handlersAndy Shevchenko
Make both handlers to be shorter and easier to understand. While at it, unify their style. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Prajna Rajendra Kumar <prajna.rajendrakumar@microchip.com> Link: https://patch.msgid.link/20251127190031.2998705-3-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
13 daysspi: microchip-core: Remove unneeded PM related macroAndy Shevchenko
Static declaration by default are 0 or NULL, no need to initialise them explicitly. Remove unneeded PM related macro. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Prajna Rajendra Kumar <prajna.rajendrakumar@microchip.com> Link: https://patch.msgid.link/20251126075558.2035012-7-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
13 daysspi: microchip-core: Use SPI_MODE_X_MASKAndy Shevchenko
Use SPI_MODE_X_MASK instead of open coded variant. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Prajna Rajendra Kumar <prajna.rajendrakumar@microchip.com> Link: https://patch.msgid.link/20251126075558.2035012-6-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
13 daysspi: microchip-core: Utilise temporary variable for struct deviceAndy Shevchenko
Add a temporary variable to keep a pointer to struct device. Utilise it where it makes sense. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Prajna Rajendra Kumar <prajna.rajendrakumar@microchip.com> Link: https://patch.msgid.link/20251126075558.2035012-5-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
13 daysspi: microchip-core: Replace dead code (-ENOMEM error message)Andy Shevchenko
First of all, the convention in the kernel that we do not issue error messages for -ENOMEM. Second, it's ignored by dev_err_probe(). Replace dead code by a simple return statement. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Prajna Rajendra Kumar <prajna.rajendrakumar@microchip.com> Link: https://patch.msgid.link/20251126075558.2035012-4-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
13 daysspi: microchip-core: use min() instead of min_t()Andy Shevchenko
min_t(int, a, b) casts an 'unsigned int' to 'int'. This might lead to the cases when big number is wrongly chosen. On the other hand, the SPI transfer length is unsigned and driver uses signed type for an unknown reason. Change the type of the transfer length to be unsigned and convert use min() instead of min_t(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: David Laight <david.laight.linux@gmail.com> Reviewed-by: Prajna Rajendra Kumar <prajna.rajendrakumar@microchip.com> Link: https://patch.msgid.link/20251126075558.2035012-2-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2025-11-24spi: Fix potential uninitialized variable in probe()Dan Carpenter
If the device tree is messed up, then potentially the "protocol" string could potentially be uninitialized. The property is supposed to default to "motorola" so if the of_property_read_string() function returns -EINVAL then default to "motorola". Fixes: 059f545832be ("spi: add support for microchip "soft" spi controller") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Prajna Rajendra Kumar <prajna.rajendrakumar@microchip.com> Link: https://patch.msgid.link/aSQPkfkiJ0w-FJMW@stanley.mountain Signed-off-by: Mark Brown <broonie@kernel.org>
2025-11-14spi: add support for microchip "soft" spi controllerPrajna Rajendra Kumar
Introduce driver support for the Microchip FPGA CoreSPI IP. This driver supports only Motorola SPI mode and frame size of 8-bits. TI/NSC modes and wider frame sizes are not currently supported. Signed-off-by: Prajna Rajendra Kumar <prajna.rajendrakumar@microchip.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Acked-by: Conor Dooley <conor.dooley@microchip.com> Link: https://patch.msgid.link/20251114104545.284765-4-prajna.rajendrakumar@microchip.com Signed-off-by: Mark Brown <broonie@kernel.org>