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:
Manuel Arguelles 2023-08-06 12:45:32 +07:00 committed by Fabio Baltieri
commit 35ad5358a4

View file

@ -1,5 +1,5 @@
/*
* Copyright 2022 NXP
* Copyright 2022-2023 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -325,7 +325,7 @@ static int spi_nxp_s32_configure(const struct device *dev,
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"
" control CS line instead");
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);
if (spi_cfg->cs == NULL) {
if (!spi_cs_is_gpio(spi_cfg)) {
/* Use inner CS signal from SPI module */
data->transfer_cfg.PushrCmd |= hold_cs << 15U;
data->transfer_cfg.PushrCmd |= (1U << spi_cfg->slave);