drivers: spi: Microchip MEC172x SPI fix for Zephyr 3.4 breakage
Zephyr version 3.4 changed the SPI context structure and macros which broke the logic in the MEC172x SPI driver configuration API. This was not detected by CI due to no tests for this driver are in the tree. The driver now behaves like most other SPI drivers requiring a different configuration structure pointer to be passed if any item in the configuration changes. Signed-off-by: Manimaran A <manimaran.a@microchip.com>
This commit is contained in:
parent
dbc4cfabdb
commit
b328e920b6
1 changed files with 3 additions and 6 deletions
|
@ -346,7 +346,6 @@ static int qmspi_configure(const struct device *dev,
|
|||
{
|
||||
const struct spi_qmspi_config *cfg = dev->config;
|
||||
struct spi_qmspi_data *qdata = dev->data;
|
||||
const struct spi_config *curr_cfg = qdata->ctx.config;
|
||||
struct qmspi_regs *regs = cfg->regs;
|
||||
uint32_t smode;
|
||||
int ret;
|
||||
|
@ -355,13 +354,11 @@ static int qmspi_configure(const struct device *dev,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (curr_cfg->frequency != config->frequency) {
|
||||
qmspi_set_frequency(qdata, regs, config->frequency);
|
||||
if (spi_context_configured(&qdata->ctx, config)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (curr_cfg->operation == config->operation) {
|
||||
return 0; /* no change required */
|
||||
}
|
||||
qmspi_set_frequency(qdata, regs, config->frequency);
|
||||
|
||||
/* check new configuration */
|
||||
ret = spi_feature_support(config);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue