Skip to content

Commit 877fa97

Browse files
decsnynashif
authored andcommitted
spi_nxp_lpspi: Remove MCUX branding
Since the LPSPI drivers no long use MCUX at all, remove the MCUX branding, to avoid confusion. In the future if an implementation uses the MCUX SDK driver, it should specifically be called by MCUX in the name. Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
1 parent 2aad9eb commit 877fa97

File tree

14 files changed

+38
-32
lines changed

14 files changed

+38
-32
lines changed

doc/releases/migration-guide-4.2.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,9 @@ OpenThread
597597
SPI
598598
===
599599

600+
* Renamed ``CONFIG_SPI_MCUX_LPSPI`` to :kconfig:option:`CONFIG_SPI_NXP_LPSPI`,
601+
and similar for any child configs for that driver, including
602+
:kconfig:option:`CONFIG_SPI_NXP_LPSPI_DMA` and :kconfig:option:`CONFIG_SPI_NXP_LPSPI_CPU`.
600603
* Renamed the device tree property ``port_sel`` to ``port-sel``.
601604
* Renamed the device tree property ``chip_select`` to ``chip-select``.
602605
* The binding file for :dtcompatible:`andestech,atcspi200` has been renamed to have a name

drivers/clock_control/clock_control_mcux_ccm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include <zephyr/logging/log.h>
2121
LOG_MODULE_REGISTER(clock_control);
2222

23-
#ifdef CONFIG_SPI_MCUX_LPSPI
23+
#ifdef CONFIG_SPI_NXP_LPSPI
2424
static const clock_name_t lpspi_clocks[] = {
2525
kCLOCK_Usb1PllPfd1Clk,
2626
kCLOCK_Usb1PllPfd0Clk,
@@ -207,7 +207,7 @@ static int mcux_ccm_get_subsys_rate(const struct device *dev,
207207
break;
208208
#endif
209209

210-
#ifdef CONFIG_SPI_MCUX_LPSPI
210+
#ifdef CONFIG_SPI_NXP_LPSPI
211211
case IMX_CCM_LPSPI_CLK:
212212
{
213213
uint32_t lpspi_mux = CLOCK_GetMux(kCLOCK_LpspiMux);

drivers/clock_control/clock_control_mcux_ccm_rev2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static int mcux_ccm_get_subsys_rate(const struct device *dev,
8181
break;
8282
#endif
8383

84-
#ifdef CONFIG_SPI_MCUX_LPSPI
84+
#ifdef CONFIG_SPI_NXP_LPSPI
8585
#if defined(CONFIG_SOC_SERIES_IMXRT118X)
8686
case IMX_CCM_LPSPI0102_CLK:
8787
clock_root = kCLOCK_Root_Lpspi0102 + instance;
@@ -91,7 +91,7 @@ static int mcux_ccm_get_subsys_rate(const struct device *dev,
9191
clock_root = kCLOCK_Root_Lpspi1 + instance;
9292
break;
9393
#endif /* CONFIG_SOC_SERIES_IMXRT118X */
94-
#endif /* CONFIG_SPI_MCUX_LPSPI */
94+
#endif /* CONFIG_SPI_NXP_LPSPI */
9595

9696
#ifdef CONFIG_UART_MCUX_LPUART
9797
#if defined(CONFIG_SOC_SERIES_IMXRT118X)

drivers/clock_control/clock_control_mcux_syscon.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,14 +555,14 @@ static int mcux_lpc_syscon_clock_control_get_subsys_rate(const struct device *de
555555
break;
556556
#endif /* defined(CONFIG_DT_HAS_NXP_XSPI_ENABLED) */
557557

558-
#if (defined(CONFIG_SPI_MCUX_LPSPI) && CONFIG_SOC_SERIES_MCXA)
558+
#if (defined(CONFIG_SPI_NXP_LPSPI) && CONFIG_SOC_SERIES_MCXA)
559559
case MCUX_LPSPI0_CLK:
560560
*rate = CLOCK_GetLpspiClkFreq(0);
561561
break;
562562
case MCUX_LPSPI1_CLK:
563563
*rate = CLOCK_GetLpspiClkFreq(1);
564564
break;
565-
#endif /* defined(CONFIG_SPI_MCUX_LPSPI) */
565+
#endif /* defined(CONFIG_SPI_NXP_LPSPI) */
566566
}
567567

568568
return 0;
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Copyright 2024 NXP
22

3-
zephyr_library_sources_ifdef(CONFIG_SPI_MCUX_LPSPI spi_nxp_lpspi_common.c)
4-
zephyr_library_sources_ifdef(CONFIG_SPI_MCUX_LPSPI_CPU spi_nxp_lpspi.c)
5-
zephyr_library_sources_ifdef(CONFIG_SPI_MCUX_LPSPI_DMA spi_nxp_lpspi_dma.c)
3+
zephyr_library_sources_ifdef(CONFIG_SPI_NXP_LPSPI spi_nxp_lpspi_common.c)
4+
zephyr_library_sources_ifdef(CONFIG_SPI_NXP_LPSPI_CPU spi_nxp_lpspi.c)
5+
zephyr_library_sources_ifdef(CONFIG_SPI_NXP_LPSPI_DMA spi_nxp_lpspi_dma.c)

drivers/spi/spi_nxp_lpspi/Kconfig

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright 2018, 2024-2025 NXP
22
# SPDX-License-Identifier: Apache-2.0
33

4-
config SPI_MCUX_LPSPI
4+
config SPI_NXP_LPSPI
55
bool "NXP LPSPI peripheral"
66
default y
77
depends on DT_HAS_NXP_LPSPI_ENABLED
@@ -10,9 +10,9 @@ config SPI_MCUX_LPSPI
1010
help
1111
Enable driver support for NXP LPSPI.
1212

13-
if SPI_MCUX_LPSPI
13+
if SPI_NXP_LPSPI
1414

15-
config SPI_MCUX_LPSPI_DMA
15+
config SPI_NXP_LPSPI_DMA
1616
bool "NXP LPSPI DMA-based Driver"
1717
default y
1818
select DMA
@@ -27,10 +27,10 @@ config SPI_MCUX_LPSPI_DMA
2727
immediately with CPU, so there could be more latency between
2828
the point of requesting a transfer and when it actually starts.
2929

30-
config SPI_MCUX_LPSPI_CPU
30+
config SPI_NXP_LPSPI_CPU
3131
bool "NXP LPSPI CPU-based driver"
3232
default y
33-
depends on $(dt_compat_any_not_has_prop,$(DT_COMPAT_NXP_LPSPI),dmas) || !SPI_MCUX_LPSPI_DMA
33+
depends on $(dt_compat_any_not_has_prop,$(DT_COMPAT_NXP_LPSPI),dmas) || !SPI_NXP_LPSPI_DMA
3434
help
3535
Enable "normal" CPU based SPI driver for LPSPI.
3636
This has lower latency than DMA-based driver but over the
@@ -49,4 +49,4 @@ config SPI_NXP_LPSPI_TXFIFO_WAIT_CYCLES
4949
for if there is some programming error that causes TX fifo not to empty.
5050
The default of 10000 is arbitrary.
5151

52-
endif # SPI_MCUX_LPSPI
52+
endif # SPI_NXP_LPSPI

drivers/spi/spi_nxp_lpspi/spi_nxp_lpspi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ static int transceive(const struct device *dev, const struct spi_config *spi_cfg
311311

312312
spi_context_buffers_setup(ctx, tx_bufs, rx_bufs, lpspi_data->word_size_bytes);
313313

314-
ret = spi_mcux_configure(dev, spi_cfg);
314+
ret = lpspi_configure(dev, spi_cfg);
315315
if (ret) {
316316
goto error;
317317
}
@@ -427,7 +427,7 @@ static int lpspi_init(const struct device *dev)
427427
#define SPI_LPSPI_INIT_IF_DMA(n) IF_DISABLED(SPI_NXP_LPSPI_HAS_DMAS(n), (LPSPI_INIT(n)))
428428

429429
#define SPI_LPSPI_INIT(n) \
430-
COND_CODE_1(CONFIG_SPI_MCUX_LPSPI_DMA, \
430+
COND_CODE_1(CONFIG_SPI_NXP_LPSPI_DMA, \
431431
(SPI_LPSPI_INIT_IF_DMA(n)), (LPSPI_INIT(n)))
432432

433433
DT_INST_FOREACH_STATUS_OKAY(SPI_LPSPI_INIT)

drivers/spi/spi_nxp_lpspi/spi_nxp_lpspi_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ static void lpspi_basic_config(const struct device *dev, const struct spi_config
258258
}
259259
}
260260

261-
int spi_mcux_configure(const struct device *dev, const struct spi_config *spi_cfg)
261+
int lpspi_configure(const struct device *dev, const struct spi_config *spi_cfg)
262262
{
263263
const struct lpspi_config *config = dev->config;
264264
struct lpspi_data *data = dev->data;

drivers/spi/spi_nxp_lpspi/spi_nxp_lpspi_dma.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static int lpspi_dma_next_fill(const struct device *dev)
140140
return lpspi_dma_rxtx_load(dev);
141141
}
142142

143-
static void spi_mcux_dma_callback(const struct device *dev, void *arg, uint32_t channel, int status)
143+
static void lpspi_dma_callback(const struct device *dev, void *arg, uint32_t channel, int status)
144144
{
145145
const struct device *spi_dev = arg;
146146
LPSPI_Type *base = (LPSPI_Type *)DEVICE_MMIO_NAMED_GET(spi_dev, reg_base);
@@ -219,7 +219,7 @@ static int transceive_dma(const struct device *dev, const struct spi_config *spi
219219

220220
spi_context_lock(ctx, asynchronous, cb, userdata, spi_cfg);
221221

222-
ret = spi_mcux_configure(dev, spi_cfg);
222+
ret = lpspi_configure(dev, spi_cfg);
223223
if (ret) {
224224
goto out;
225225
}
@@ -264,7 +264,7 @@ static int lpspi_dma_dev_ready(const struct device *dma_dev)
264264
return true;
265265
}
266266

267-
static int spi_mcux_dma_init(const struct device *dev)
267+
static int lpspi_dma_init(const struct device *dev)
268268
{
269269
struct lpspi_data *data = dev->data;
270270
struct spi_nxp_dma_data *dma_data = (struct spi_nxp_dma_data *)data->driver_data;
@@ -319,7 +319,7 @@ static void lpspi_isr(const struct device *dev)
319319
}
320320

321321
#define LPSPI_DMA_COMMON_CFG(n) \
322-
.dma_callback = spi_mcux_dma_callback, \
322+
.dma_callback = lpspi_dma_callback, \
323323
.source_data_size = 1, \
324324
.dest_data_size = 1, \
325325
.block_count = 1
@@ -347,7 +347,7 @@ static void lpspi_isr(const struct device *dev)
347347
static struct lpspi_data lpspi_data_##n = {.driver_data = &lpspi_dma_data##n, \
348348
SPI_NXP_LPSPI_COMMON_DATA_INIT(n)}; \
349349
\
350-
SPI_DEVICE_DT_INST_DEFINE(n, spi_mcux_dma_init, NULL, &lpspi_data_##n, \
350+
SPI_DEVICE_DT_INST_DEFINE(n, lpspi_dma_init, NULL, &lpspi_data_##n, \
351351
&lpspi_config_##n, POST_KERNEL, CONFIG_SPI_INIT_PRIORITY, \
352352
&lpspi_dma_driver_api);
353353

drivers/spi/spi_nxp_lpspi/spi_nxp_lpspi_priv.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,11 @@ struct lpspi_data {
5353
uint8_t major_version;
5454
};
5555

56-
/* verifies spi_cfg validity and set up configuration of hardware for xfer */
57-
int spi_mcux_configure(const struct device *dev, const struct spi_config *spi_cfg);
56+
/* Verifies spi_cfg validity and set up configuration of hardware for xfer
57+
* Unsets interrupt and watermark options, specific implementation should configure that.
58+
* Sets bits in the TCR ONLY *directly* relating to what is in the spi_config struct.
59+
*/
60+
int lpspi_configure(const struct device *dev, const struct spi_config *spi_cfg);
5861

5962
/* Does these things:
6063
* Set data.dev

0 commit comments

Comments
 (0)