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>
This commit is contained in:
Gerard Marull-Paretas 2021-06-09 13:09:42 +02:00 committed by Anas Nashif
commit 9e7d545bb4
42 changed files with 20 additions and 58 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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,
#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

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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);
}

View file

@ -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;

View file

@ -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;

View file

@ -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);
}

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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);
/**

View file

@ -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. */

View file

@ -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) {

View file

@ -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) {

View file

@ -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;
}

View file

@ -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;

View file

@ -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;

View file

@ -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;