Skip to content

Commit 241bb05

Browse files
XenuIsWatchingdkalowsk
authored andcommitted
drivers: spi: cdns: remove pm device call
The PM Device callbacks is rather unimplemented. There currently is no device agnostic clock management api (yet), and the pinctrl isn't fully implemented in this driver. Remove it all. Signed-off-by: Ryan McClelland <[email protected]>
1 parent 0d61895 commit 241bb05

File tree

1 file changed

+2
-42
lines changed

1 file changed

+2
-42
lines changed

drivers/spi/spi_cdns.c

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,6 @@ struct spi_cdns_cfg {
108108
uint32_t clock_frequency;
109109
uint32_t ext_clock;
110110
irq_config_func_t irq_config;
111-
#ifdef CONFIG_PINCTRL
112-
const struct pinctrl_dev_config *pcfg;
113-
#endif
114111
uint8_t fifo_width;
115112
uint16_t rx_fifo_depth;
116113
uint16_t tx_fifo_depth;
@@ -573,7 +570,6 @@ static void spi_cdns_isr(const struct device *dev)
573570
spi_cdns_cs_control(dev, false);
574571
}
575572
pm_device_busy_clear(dev);
576-
pm_device_runtime_put(dev);
577573
}
578574
#endif
579575

@@ -642,7 +638,6 @@ static int spi_cdns_transceive(const struct device *dev, const struct spi_config
642638

643639
spi_context_lock(&data->ctx, asynchronous, cb, userdata, config);
644640

645-
pm_device_runtime_get(dev);
646641
pm_device_busy_set(dev);
647642

648643
spi_cdns_spi_enable(dev, false);
@@ -712,7 +707,6 @@ static int spi_cdns_transceive(const struct device *dev, const struct spi_config
712707
spi_cdns_cs_control(dev, false);
713708
}
714709
pm_device_busy_clear(dev);
715-
pm_device_runtime_put(dev);
716710
}
717711

718712
#ifdef CONFIG_SPI_SLAVE
@@ -795,39 +789,6 @@ static int spi_cdns_release(const struct device *dev, const struct spi_config *c
795789
return 0;
796790
}
797791

798-
#ifdef CONFIG_PM_DEVICE
799-
static int spi_cdns_pm_action(const struct device *dev, enum pm_device_action action)
800-
{
801-
const struct spi_cdns_cfg *cfg = dev->config;
802-
int ret;
803-
804-
switch (action) {
805-
case PM_DEVICE_ACTION_RESUME:
806-
/* TODO: Enable SPI Clock */
807-
#ifdef CONFIG_PINCTRL
808-
ret = pinctrl_apply_state(cfg->pcfg, PINCTRL_STATE_DEFAULT);
809-
if (ret < 0) {
810-
return ret;
811-
}
812-
#endif
813-
break;
814-
case PM_DEVICE_ACTION_SUSPEND:
815-
/* TODO: Disable SPI Clock */
816-
#ifdef CONFIG_PINCTRL
817-
ret = pinctrl_apply_state(cfg->pcfg, PINCTRL_STATE_SLEEP);
818-
if (ret < 0) {
819-
return ret;
820-
}
821-
#endif
822-
break;
823-
default:
824-
ret = -ENOTSUP;
825-
}
826-
827-
return ret;
828-
}
829-
#endif /* CONFIG_PM_DEVICE */
830-
831792
/**
832793
* SPI driver API registered in Zephyr spi framework
833794
*/
@@ -863,9 +824,8 @@ static DEVICE_API(spi, spi_cdns_api) = {
863824
.tx_fifo_depth = DT_INST_PROP(n, tx_fifo_depth), \
864825
.rx_fifo_depth = DT_INST_PROP(n, rx_fifo_depth), \
865826
}; \
866-
SPI_DEVICE_DT_INST_DEFINE(n, spi_cdns_init, spi_cdns_pm_action, &spi_cdns_data_##n, \
867-
&spi_cdns_cfg_##n, POST_KERNEL, CONFIG_SPI_INIT_PRIORITY, \
868-
&spi_cdns_api); \
827+
SPI_DEVICE_DT_INST_DEFINE(n, spi_cdns_init, NULL, &spi_cdns_data_##n, &spi_cdns_cfg_##n, \
828+
POST_KERNEL, CONFIG_SPI_INIT_PRIORITY, &spi_cdns_api); \
869829
static void spi_cdns_irq_config_##n(void) \
870830
{ \
871831
IRQ_CONNECT(DT_INST_IRQN(n), DT_INST_IRQ(n, priority), spi_cdns_isr, \

0 commit comments

Comments
 (0)