Skip to content

Commit c89e1b0

Browse files
utsavm9anangl
authored andcommitted
[nrf fromtree] drivers: mspi: mspi_dw: Fix compilation with CONFIG_MSPI_XIP disabled
Move `api_timing_config()` impl outside of the block gated behind CONFIG_MSPI_XIP. Signed-off-by: Utsav Munendra <[email protected]> (cherry picked from commit 030b9f3)
1 parent a6480d2 commit c89e1b0

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

drivers/mspi/Kconfig.dw

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ config MSPI_DW
88
depends on DT_HAS_SNPS_DESIGNWARE_SSI_ENABLED
99
select PINCTRL if $(dt_compat_any_has_prop,$(DT_COMPAT_SNPS_DESIGNWARE_SSI),pinctrl-0)
1010
imply MSPI_XIP
11+
imply MSPI_TIMING
1112

1213
if MSPI_DW
1314

drivers/mspi/mspi_dw.c

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,6 +1193,22 @@ static int api_transceive(const struct device *dev,
11931193
return rc;
11941194
}
11951195

1196+
#if defined(CONFIG_MSPI_TIMING)
1197+
static int api_timing_config(const struct device *dev,
1198+
const struct mspi_dev_id *dev_id,
1199+
const uint32_t param_mask, void *cfg)
1200+
{
1201+
struct mspi_dw_data *dev_data = dev->data;
1202+
struct mspi_dw_timing_cfg *config = cfg;
1203+
1204+
if (param_mask & MSPI_DW_RX_TIMING_CFG) {
1205+
dev_data->rx_sample_dly = config->rx_sample_dly;
1206+
return 0;
1207+
}
1208+
return -ENOTSUP;
1209+
}
1210+
#endif /* defined(CONFIG_MSPI_TIMING) */
1211+
11961212
#if defined(CONFIG_MSPI_XIP)
11971213
static int _api_xip_config(const struct device *dev,
11981214
const struct mspi_dev_id *dev_id,
@@ -1299,20 +1315,6 @@ static int _api_xip_config(const struct device *dev,
12991315
return 0;
13001316
}
13011317

1302-
static int api_timing_config(const struct device *dev,
1303-
const struct mspi_dev_id *dev_id,
1304-
const uint32_t param_mask, void *cfg)
1305-
{
1306-
struct mspi_dw_data *dev_data = dev->data;
1307-
struct mspi_dw_timing_cfg *config = cfg;
1308-
1309-
if (param_mask & MSPI_DW_RX_TIMING_CFG) {
1310-
dev_data->rx_sample_dly = config->rx_sample_dly;
1311-
return 0;
1312-
}
1313-
return -ENOTSUP;
1314-
}
1315-
13161318
static int api_xip_config(const struct device *dev,
13171319
const struct mspi_dev_id *dev_id,
13181320
const struct mspi_xip_cfg *cfg)
@@ -1461,7 +1463,9 @@ static DEVICE_API(mspi, drv_api) = {
14611463
.dev_config = api_dev_config,
14621464
.get_channel_status = api_get_channel_status,
14631465
.transceive = api_transceive,
1466+
#if defined(CONFIG_MSPI_TIMING)
14641467
.timing_config = api_timing_config,
1468+
#endif
14651469
#if defined(CONFIG_MSPI_XIP)
14661470
.xip_config = api_xip_config,
14671471
#endif

0 commit comments

Comments
 (0)