spi: nxp_s32: use spi_cs_is_gpio() in config initializer
Following #56576, the `cs` field in `struct spi_config` is of type `struct spi_cs_control` instead of a pointer to the same type. This PR updated the driver to use `spi_cs_is_gpio()` helper to check if SPI CS is controlled using a GPIO. Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
This commit is contained in:
parent
76e17857e8
commit
35ad5358a4
1 changed files with 3 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2022 NXP
|
* Copyright 2022-2023 NXP
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
@ -325,7 +325,7 @@ static int spi_nxp_s32_configure(const struct device *dev,
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cs_active_high && (spi_cfg->cs == NULL)) {
|
if (cs_active_high && !spi_cs_is_gpio(spi_cfg)) {
|
||||||
LOG_ERR("For CS has active state is high, a GPIO pin must be used to"
|
LOG_ERR("For CS has active state is high, a GPIO pin must be used to"
|
||||||
" control CS line instead");
|
" control CS line instead");
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
|
@ -348,7 +348,7 @@ static int spi_nxp_s32_configure(const struct device *dev,
|
||||||
|
|
||||||
data->transfer_cfg.PushrCmd &= ~((SPI_PUSHR_CONT_MASK | SPI_PUSHR_PCS_MASK) >> 16U);
|
data->transfer_cfg.PushrCmd &= ~((SPI_PUSHR_CONT_MASK | SPI_PUSHR_PCS_MASK) >> 16U);
|
||||||
|
|
||||||
if (spi_cfg->cs == NULL) {
|
if (!spi_cs_is_gpio(spi_cfg)) {
|
||||||
/* Use inner CS signal from SPI module */
|
/* Use inner CS signal from SPI module */
|
||||||
data->transfer_cfg.PushrCmd |= hold_cs << 15U;
|
data->transfer_cfg.PushrCmd |= hold_cs << 15U;
|
||||||
data->transfer_cfg.PushrCmd |= (1U << spi_cfg->slave);
|
data->transfer_cfg.PushrCmd |= (1U << spi_cfg->slave);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue