Browse Source

pm: device: remove ctrl_command callback argument

The ctrl_command is not used anymore, so remove it from the callback
signature.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
pull/37443/head
Gerard Marull-Paretas 4 years ago committed by Anas Nashif
parent
commit
9e7d545bb4
  1. 2
      drivers/display/display_st7735r.c
  2. 4
      drivers/display/display_st7789v.c
  3. 1
      drivers/entropy/entropy_cc13xx_cc26xx.c
  4. 1
      drivers/ethernet/eth_mcux.c
  5. 1
      drivers/flash/spi_flash_at45.c
  6. 1
      drivers/gpio/gpio_dw.c
  7. 1
      drivers/gpio/gpio_stm32.c
  8. 1
      drivers/i2c/i2c_cc13xx_cc26xx.c
  9. 3
      drivers/i2c/i2c_nrfx_twi.c
  10. 1
      drivers/i2c/i2c_nrfx_twim.c
  11. 1
      drivers/interrupt_controller/intc_arcv2_irq_unit.c
  12. 1
      drivers/interrupt_controller/intc_ioapic.c
  13. 1
      drivers/interrupt_controller/intc_loapic.c
  14. 2
      drivers/led/led_pwm.c
  15. 4
      drivers/pwm/pwm_nrfx.c
  16. 1
      drivers/sensor/apds9960/apds9960.c
  17. 3
      drivers/sensor/bme280/bme280.c
  18. 1
      drivers/sensor/bmp388/bmp388.c
  19. 4
      drivers/sensor/bq274xx/bq274xx.c
  20. 1
      drivers/sensor/fdc2x1x/fdc2x1x.c
  21. 4
      drivers/sensor/lis2mdl/lis2mdl.c
  22. 1
      drivers/sensor/qdec_nrfx/qdec_nrfx.c
  23. 4
      drivers/sensor/sgp40/sgp40.c
  24. 1
      drivers/sensor/vcnl4040/vcnl4040.c
  25. 1
      drivers/serial/uart_cc13xx_cc26xx.c
  26. 4
      drivers/serial/uart_npcx.c
  27. 1
      drivers/serial/uart_nrfx_uart.c
  28. 1
      drivers/serial/uart_nrfx_uarte.c
  29. 3
      drivers/serial/uart_stm32.c
  30. 1
      drivers/spi/spi_cc13xx_cc26xx.c
  31. 3
      drivers/spi/spi_nrfx_spi.c
  32. 1
      drivers/spi/spi_nrfx_spim.c
  33. 1
      drivers/timer/sys_clock_init.c
  34. 2
      include/device.h
  35. 2
      include/drivers/timer/system_timer.h
  36. 5
      include/pm/device.h
  37. 1
      samples/subsys/pm/device_pm/src/dummy_driver.c
  38. 1
      samples/subsys/pm/device_pm/src/dummy_parent.c
  39. 2
      subsys/pm/device.c
  40. 2
      tests/net/pm/src/main.c
  41. 1
      tests/subsys/pm/device_runtime/src/dummy_driver.c
  42. 1
      tests/subsys/pm/power_mgmt/src/dummy_driver.c

2
drivers/display/display_st7735r.c

@ -499,7 +499,7 @@ static int st7735r_enter_sleep(struct st7735r_data *data) @@ -499,7 +499,7 @@ static int st7735r_enter_sleep(struct st7735r_data *data)
return st7735r_transmit(data, ST7735R_CMD_SLEEP_IN, NULL, 0);
}
static int st7735r_pm_control(const struct device *dev, uint32_t ctrl_command,
static int st7735r_pm_control(const struct device *dev,
enum pm_device_state *state)
{
int ret = 0;

4
drivers/display/display_st7789v.c

@ -401,8 +401,8 @@ static void st7789v_enter_sleep(struct st7789v_data *data) @@ -401,8 +401,8 @@ static void st7789v_enter_sleep(struct st7789v_data *data)
st7789v_transmit(data, ST7789V_CMD_SLEEP_IN, NULL, 0);
}
static int st7789v_pm_control(const struct device *dev, uint32_t ctrl_command,
enum pm_device_state *state)
static int st7789v_pm_control(const struct device *dev,
enum pm_device_state *state)
{
struct st7789v_data *data = (struct st7789v_data *)dev->data;

1
drivers/entropy/entropy_cc13xx_cc26xx.c

@ -291,7 +291,6 @@ static int entropy_cc13xx_cc26xx_set_power_state(const struct device *dev, @@ -291,7 +291,6 @@ static int entropy_cc13xx_cc26xx_set_power_state(const struct device *dev,
}
static int entropy_cc13xx_cc26xx_pm_control(const struct device *dev,
uint32_t ctrl_command,
enum pm_device_state *state)
{
int ret = 0;

1
drivers/ethernet/eth_mcux.c

@ -185,7 +185,6 @@ static void eth_mcux_phy_enter_reset(struct eth_context *context); @@ -185,7 +185,6 @@ static void eth_mcux_phy_enter_reset(struct eth_context *context);
void eth_mcux_phy_stop(struct eth_context *context);
static int eth_mcux_device_pm_control(const struct device *dev,
uint32_t command,
enum pm_device_state *state)
{
struct eth_context *eth_ctx = (struct eth_context *)dev->data;

1
drivers/flash/spi_flash_at45.c

@ -625,7 +625,6 @@ static int spi_flash_at45_init(const struct device *dev) @@ -625,7 +625,6 @@ static int spi_flash_at45_init(const struct device *dev)
#if IS_ENABLED(CONFIG_PM_DEVICE)
static int spi_flash_at45_pm_control(const struct device *dev,
uint32_t ctrl_command,
enum pm_device_state *state)
{
const struct spi_flash_at45_config *dev_config = get_dev_config(dev);

1
drivers/gpio/gpio_dw.c

@ -442,7 +442,6 @@ static inline int gpio_dw_resume_from_suspend_port(const struct device *port) @@ -442,7 +442,6 @@ static inline int gpio_dw_resume_from_suspend_port(const struct device *port)
* the *context may include IN data or/and OUT data
*/
static int gpio_dw_device_ctrl(const struct device *port,
uint32_t ctrl_command,
enum pm_device_state *state)
{
int ret = 0;

1
drivers/gpio/gpio_stm32.c

@ -595,7 +595,6 @@ static int gpio_stm32_set_power_state(const struct device *dev, @@ -595,7 +595,6 @@ static int gpio_stm32_set_power_state(const struct device *dev,
}
static int gpio_stm32_pm_device_ctrl(const struct device *dev,
uint32_t ctrl_command,
enum pm_device_state *state)
{
int ret = 0;

1
drivers/i2c/i2c_cc13xx_cc26xx.c

@ -365,7 +365,6 @@ static int i2c_cc13xx_cc26xx_set_power_state(const struct device *dev, @@ -365,7 +365,6 @@ static int i2c_cc13xx_cc26xx_set_power_state(const struct device *dev,
}
static int i2c_cc13xx_cc26xx_pm_control(const struct device *dev,
uint32_t ctrl_command,
enum pm_device_state *state)
{
int ret = 0;

3
drivers/i2c/i2c_nrfx_twi.c

@ -217,8 +217,7 @@ static int init_twi(const struct device *dev) @@ -217,8 +217,7 @@ static int init_twi(const struct device *dev)
#ifdef CONFIG_PM_DEVICE
static int twi_nrfx_pm_control(const struct device *dev,
uint32_t ctrl_command,
enum pm_device_state *state)
enum pm_device_state *state)
{
int ret = 0;
enum pm_device_state curr_state;

1
drivers/i2c/i2c_nrfx_twim.c

@ -255,7 +255,6 @@ static int init_twim(const struct device *dev) @@ -255,7 +255,6 @@ static int init_twim(const struct device *dev)
#ifdef CONFIG_PM_DEVICE
static int twim_nrfx_pm_control(const struct device *dev,
uint32_t ctrl_command,
enum pm_device_state *state)
{
int ret = 0;

1
drivers/interrupt_controller/intc_arcv2_irq_unit.c

@ -175,7 +175,6 @@ static int arc_v2_irq_unit_resume(const struct device *dev) @@ -175,7 +175,6 @@ static int arc_v2_irq_unit_resume(const struct device *dev)
* @return operation result
*/
static int arc_v2_irq_unit_device_ctrl(const struct device *dev,
uint32_t ctrl_command,
enum pm_device_state *state)
{
int ret = 0;

1
drivers/interrupt_controller/intc_ioapic.c

@ -310,7 +310,6 @@ int ioapic_resume_from_suspend(const struct device *port) @@ -310,7 +310,6 @@ int ioapic_resume_from_suspend(const struct device *port)
*/
__pinned_func
static int ioapic_device_ctrl(const struct device *dev,
uint32_t ctrl_command,
enum pm_device_state *state)
{
int ret = 0;

1
drivers/interrupt_controller/intc_loapic.c

@ -409,7 +409,6 @@ int loapic_resume(const struct device *port) @@ -409,7 +409,6 @@ int loapic_resume(const struct device *port)
*/
__pinned_func
static int loapic_device_ctrl(const struct device *port,
uint32_t ctrl_command,
enum pm_device_state *state)
{
int ret = 0;

2
drivers/led/led_pwm.c

@ -142,7 +142,7 @@ static int led_pwm_pm_set_state(const struct device *dev, @@ -142,7 +142,7 @@ static int led_pwm_pm_set_state(const struct device *dev,
return 0;
}
static int led_pwm_pm_control(const struct device *dev, uint32_t ctrl_command,
static int led_pwm_pm_control(const struct device *dev,
enum pm_device_state *state)
{
return led_pwm_pm_set_state(dev, *state);

4
drivers/pwm/pwm_nrfx.c

@ -318,7 +318,6 @@ static int pwm_nrfx_set_power_state(enum pm_device_state new_state, @@ -318,7 +318,6 @@ static int pwm_nrfx_set_power_state(enum pm_device_state new_state,
}
static int pwm_nrfx_pm_control(const struct device *dev,
uint32_t ctrl_command,
enum pm_device_state *state)
{
int err = 0;
@ -334,10 +333,9 @@ static int pwm_nrfx_pm_control(const struct device *dev, @@ -334,10 +333,9 @@ static int pwm_nrfx_pm_control(const struct device *dev,
#define PWM_NRFX_PM_CONTROL(idx) \
static int pwm_##idx##_nrfx_pm_control(const struct device *dev, \
uint32_t ctrl_command, \
enum pm_device_state *state) \
{ \
return pwm_nrfx_pm_control(dev, ctrl_command, state) \
return pwm_nrfx_pm_control(dev, state) \
}
#else

1
drivers/sensor/apds9960/apds9960.c

@ -409,7 +409,6 @@ static int apds9960_init_interrupt(const struct device *dev) @@ -409,7 +409,6 @@ static int apds9960_init_interrupt(const struct device *dev)
#ifdef CONFIG_PM_DEVICE
static int apds9960_device_ctrl(const struct device *dev,
uint32_t ctrl_command,
enum pm_device_state *state)
{
const struct apds9960_config *config = dev->config;

3
drivers/sensor/bme280/bme280.c

@ -410,8 +410,7 @@ static int bme280_chip_init(const struct device *dev) @@ -410,8 +410,7 @@ static int bme280_chip_init(const struct device *dev)
}
#ifdef CONFIG_PM_DEVICE
int bme280_pm_ctrl(const struct device *dev, uint32_t ctrl_command,
enum pm_device_state *state)
int bme280_pm_ctrl(const struct device *dev, enum pm_device_state *state)
{
int ret = 0;
enum pm_device_state curr_state;

1
drivers/sensor/bmp388/bmp388.c

@ -583,7 +583,6 @@ static int bmp388_set_power_state(const struct device *dev, @@ -583,7 +583,6 @@ static int bmp388_set_power_state(const struct device *dev,
static int bmp388_device_ctrl(
const struct device *dev,
uint32_t ctrl_command,
enum pm_device_state *state)
{
int ret = 0;

4
drivers/sensor/bq274xx/bq274xx.c

@ -731,8 +731,8 @@ static int bq274xx_exit_shutdown_mode(const struct device *dev) @@ -731,8 +731,8 @@ static int bq274xx_exit_shutdown_mode(const struct device *dev)
return 0;
}
static int bq274xx_pm_control(const struct device *dev, uint32_t ctrl_command,
enum pm_device_state *state)
static int bq274xx_pm_control(const struct device *dev,
enum pm_device_state *state)
{
int ret = 0;
struct bq274xx_data *data = dev->data;

1
drivers/sensor/fdc2x1x/fdc2x1x.c

@ -535,7 +535,6 @@ static int fdc2x1x_set_pm_state(const struct device *dev, @@ -535,7 +535,6 @@ static int fdc2x1x_set_pm_state(const struct device *dev,
}
static int fdc2x1x_device_pm_ctrl(const struct device *dev,
uint32_t ctrl_command,
enum pm_device_state *state)
{
struct fdc2x1x_data *data = dev->data;

4
drivers/sensor/lis2mdl/lis2mdl.c

@ -475,8 +475,8 @@ static int lis2mdl_set_power_state(struct lis2mdl_data *lis2mdl, @@ -475,8 +475,8 @@ static int lis2mdl_set_power_state(struct lis2mdl_data *lis2mdl,
return status;
}
static int lis2mdl_pm_control(const struct device *dev, uint32_t ctrl_command,
enum pm_device_state *state)
static int lis2mdl_pm_control(const struct device *dev,
enum pm_device_state *state)
{
struct lis2mdl_data *lis2mdl = dev->data;
const struct lis2mdl_config *const config = dev->config;

1
drivers/sensor/qdec_nrfx/qdec_nrfx.c

@ -240,7 +240,6 @@ static int qdec_nrfx_pm_set_state(struct qdec_nrfx_data *data, @@ -240,7 +240,6 @@ static int qdec_nrfx_pm_set_state(struct qdec_nrfx_data *data,
}
static int qdec_nrfx_pm_control(const struct device *dev,
uint32_t ctrl_command,
enum pm_device_state *state)
{
struct qdec_nrfx_data *data = &qdec_nrfx_data;

4
drivers/sensor/sgp40/sgp40.c

@ -218,9 +218,7 @@ static int sgp40_set_power_state(const struct device *dev, @@ -218,9 +218,7 @@ static int sgp40_set_power_state(const struct device *dev,
return 0;
}
static int sgp40_pm_ctrl(const struct device *dev,
uint32_t ctrl_command,
enum pm_device_state *state)
static int sgp40_pm_ctrl(const struct device *dev, enum pm_device_state *state)
{
return sgp40_set_power_state(dev, *state);
}

1
drivers/sensor/vcnl4040/vcnl4040.c

@ -219,7 +219,6 @@ static int vcnl4040_ambient_setup(const struct device *dev) @@ -219,7 +219,6 @@ static int vcnl4040_ambient_setup(const struct device *dev)
#ifdef CONFIG_PM_DEVICE
static int vcnl4040_device_ctrl(const struct device *dev,
uint32_t ctrl_command,
enum pm_device_state *state)
{
int ret = 0;

1
drivers/serial/uart_cc13xx_cc26xx.c

@ -441,7 +441,6 @@ static int uart_cc13xx_cc26xx_set_power_state(const struct device *dev, @@ -441,7 +441,6 @@ static int uart_cc13xx_cc26xx_set_power_state(const struct device *dev,
}
static int uart_cc13xx_cc26xx_pm_control(const struct device *dev,
uint32_t ctrl_command,
enum pm_device_state *state)
{
int ret = 0;

4
drivers/serial/uart_npcx.c

@ -457,8 +457,8 @@ static inline int uart_npcx_set_power_state(const struct device *dev, @@ -457,8 +457,8 @@ static inline int uart_npcx_set_power_state(const struct device *dev,
}
/* Implements the device power management control functionality */
static int uart_npcx_pm_control(const struct device *dev, uint32_t ctrl_command,
enum pm_device_state *state)
static int uart_npcx_pm_control(const struct device *dev,
enum pm_device_state *state)
{
return uart_npcx_set_power_state(dev, *state);
}

1
drivers/serial/uart_nrfx_uart.c

@ -1159,7 +1159,6 @@ static void uart_nrfx_set_power_state(const struct device *dev, @@ -1159,7 +1159,6 @@ static void uart_nrfx_set_power_state(const struct device *dev,
}
static int uart_nrfx_pm_control(const struct device *dev,
uint32_t ctrl_command,
enum pm_device_state *state)
{
enum pm_device_state current_state;

1
drivers/serial/uart_nrfx_uarte.c

@ -1922,7 +1922,6 @@ static void uarte_nrfx_set_power_state(const struct device *dev, @@ -1922,7 +1922,6 @@ static void uarte_nrfx_set_power_state(const struct device *dev,
}
static int uarte_nrfx_pm_control(const struct device *dev,
uint32_t ctrl_command,
enum pm_device_state *state)
{
enum pm_device_state curr_state;

3
drivers/serial/uart_stm32.c

@ -1460,8 +1460,7 @@ static int uart_stm32_set_power_state(const struct device *dev, @@ -1460,8 +1460,7 @@ static int uart_stm32_set_power_state(const struct device *dev,
* @return 0
*/
static int uart_stm32_pm_control(const struct device *dev,
uint32_t ctrl_command,
enum pm_device_state *state)
enum pm_device_state *state)
{
enum pm_device_state curr_state;

1
drivers/spi/spi_cc13xx_cc26xx.c

@ -248,7 +248,6 @@ static int spi_cc13xx_cc26xx_set_power_state(const struct device *dev, @@ -248,7 +248,6 @@ static int spi_cc13xx_cc26xx_set_power_state(const struct device *dev,
}
static int spi_cc13xx_cc26xx_pm_control(const struct device *dev,
uint32_t ctrl_command,
enum pm_device_state *state)
{
int ret = 0;

3
drivers/spi/spi_nrfx_spi.c

@ -278,8 +278,7 @@ static int init_spi(const struct device *dev) @@ -278,8 +278,7 @@ static int init_spi(const struct device *dev)
#ifdef CONFIG_PM_DEVICE
static int spi_nrfx_pm_control(const struct device *dev,
uint32_t ctrl_command,
enum pm_device_state *state)
enum pm_device_state *state)
{
int ret = 0;
struct spi_nrfx_data *data = get_dev_data(dev);

1
drivers/spi/spi_nrfx_spim.c

@ -325,7 +325,6 @@ static int init_spim(const struct device *dev) @@ -325,7 +325,6 @@ static int init_spim(const struct device *dev)
#ifdef CONFIG_PM_DEVICE
static int spim_nrfx_pm_control(const struct device *dev,
uint32_t ctrl_command,
enum pm_device_state *state)
{
int ret = 0;

1
drivers/timer/sys_clock_init.c

@ -31,7 +31,6 @@ int __weak sys_clock_driver_init(const struct device *dev) @@ -31,7 +31,6 @@ int __weak sys_clock_driver_init(const struct device *dev)
}
int __weak sys_clock_device_ctrl(const struct device *dev,
uint32_t ctrl_command,
enum pm_device_state *state)
{
return -ENOSYS;

2
include/device.h

@ -384,7 +384,7 @@ struct device { @@ -384,7 +384,7 @@ struct device {
const device_handle_t *const handles;
#ifdef CONFIG_PM_DEVICE
/** Power Management function */
int (*pm_control)(const struct device *dev, uint32_t command,
int (*pm_control)(const struct device *dev,
enum pm_device_state *state);
/** Pointer to device instance power management data */
struct pm_device * const pm;

2
include/drivers/timer/system_timer.h

@ -46,7 +46,7 @@ extern int sys_clock_driver_init(const struct device *dev); @@ -46,7 +46,7 @@ extern int sys_clock_driver_init(const struct device *dev);
* management. It is a weak symbol that will be implemented as a noop
* if undefined in the clock driver.
*/
extern int clock_device_ctrl(const struct device *dev, uint32_t ctrl_command,
extern int clock_device_ctrl(const struct device *dev,
enum pm_device_state *state);
/**

5
include/pm/device.h

@ -62,11 +62,6 @@ enum pm_device_state { @@ -62,11 +62,6 @@ enum pm_device_state {
PM_DEVICE_STATE_SUSPENDING,
};
/** Device PM set state control command. */
#define PM_DEVICE_STATE_SET 0
/** Device PM get state control command. */
#define PM_DEVICE_STATE_GET 1
/** @brief Device PM flags. */
enum pm_device_flag {
/** Indicate if the device is busy or not. */

1
samples/subsys/pm/device_pm/src/dummy_driver.c

@ -87,7 +87,6 @@ static int dummy_close(const struct device *dev) @@ -87,7 +87,6 @@ static int dummy_close(const struct device *dev)
}
static int dummy_device_pm_ctrl(const struct device *dev,
uint32_t ctrl_command,
enum pm_device_state *state)
{
if (*state == PM_DEVICE_STATE_ACTIVE) {

1
samples/subsys/pm/device_pm/src/dummy_parent.c

@ -25,7 +25,6 @@ static int dummy_transfer(const struct device *dev, uint32_t cmd, @@ -25,7 +25,6 @@ static int dummy_transfer(const struct device *dev, uint32_t cmd,
}
static int dummy_parent_pm_ctrl(const struct device *dev,
uint32_t ctrl_command,
enum pm_device_state *state)
{
if (*state == PM_DEVICE_STATE_ACTIVE) {

2
subsys/pm/device.c

@ -137,7 +137,7 @@ int pm_device_state_set(const struct device *dev, @@ -137,7 +137,7 @@ int pm_device_state_set(const struct device *dev,
return -ENOSYS;
}
ret = dev->pm_control(dev, PM_DEVICE_STATE_SET, &device_power_state);
ret = dev->pm_control(dev, &device_power_state);
if (ret < 0) {
return ret;
}

2
tests/net/pm/src/main.c

@ -21,7 +21,7 @@ struct fake_dev_context { @@ -21,7 +21,7 @@ struct fake_dev_context {
struct net_if *iface;
};
static int fake_dev_pm_control(const struct device *dev, uint32_t command,
static int fake_dev_pm_control(const struct device *dev,
enum pm_device_state *state)
{
struct fake_dev_context *ctx = dev->data;

1
tests/subsys/pm/device_runtime/src/dummy_driver.c

@ -35,7 +35,6 @@ static int dummy_close_sync(const struct device *dev) @@ -35,7 +35,6 @@ static int dummy_close_sync(const struct device *dev)
}
static int dummy_device_pm_ctrl(const struct device *dev,
uint32_t ctrl_command,
enum pm_device_state *state)
{
return 0;

1
tests/subsys/pm/power_mgmt/src/dummy_driver.c

@ -20,7 +20,6 @@ static int dummy_close(const struct device *dev) @@ -20,7 +20,6 @@ static int dummy_close(const struct device *dev)
}
static int dummy_device_pm_ctrl(const struct device *dev,
uint32_t ctrl_command,
enum pm_device_state *state)
{
return 0;

Loading…
Cancel
Save