Commit 35ad5358 authored by Manuel Argüelles's avatar Manuel Argüelles Committed by Fabio Baltieri
Browse files

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: default avatarManuel Argüelles <manuel.arguelles@nxp.com>
parent 76e17857
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
/*
 * 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);