Skip to content

Commit dbf46b3

Browse files
gmarullnashif
authored andcommitted
pm: rename device_pm_cb to pm_device_cb
Prefix all device PM functions/data structures with pm. Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent 7bfd3a1 commit dbf46b3

38 files changed

+39
-39
lines changed

doc/reference/power_management/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ Device Set Power State
295295

296296
.. code-block:: c
297297
298-
int device_set_power_state(const struct device *dev, uint32_t device_power_state, device_pm_cb cb, void *arg);
298+
int device_set_power_state(const struct device *dev, uint32_t device_power_state, pm_device_cb cb, void *arg);
299299
300300
Calls the :c:func:`pm_control()` handler function implemented by the
301301
device driver with PM_DEVICE_SET_POWER_STATE command.

drivers/display/display_st7735r.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ static int st7735r_enter_sleep(struct st7735r_data *data)
520520
}
521521

522522
static int st7735r_pm_control(const struct device *dev, uint32_t ctrl_command,
523-
void *context, device_pm_cb cb, void *arg)
523+
void *context, pm_device_cb cb, void *arg)
524524
{
525525
int ret = 0;
526526
struct st7735r_data *data = (struct st7735r_data *)dev->data;

drivers/display/display_st7789v.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ static void st7789v_enter_sleep(struct st7789v_data *data)
409409
}
410410

411411
static int st7789v_pm_control(const struct device *dev, uint32_t ctrl_command,
412-
void *context, device_pm_cb cb, void *arg)
412+
void *context, pm_device_cb cb, void *arg)
413413
{
414414
int ret = 0;
415415
struct st7789v_data *data = (struct st7789v_data *)dev->data;

drivers/entropy/entropy_cc13xx_cc26xx.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ static int entropy_cc13xx_cc26xx_set_power_state(const struct device *dev,
293293

294294
static int entropy_cc13xx_cc26xx_pm_control(const struct device *dev,
295295
uint32_t ctrl_command,
296-
void *context, device_pm_cb cb,
296+
void *context, pm_device_cb cb,
297297
void *arg)
298298
{
299299
struct entropy_cc13xx_cc26xx_data *data = get_dev_data(dev);

drivers/ethernet/eth_mcux.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ void eth_mcux_phy_stop(struct eth_context *context);
186186

187187
static int eth_mcux_device_pm_control(const struct device *dev,
188188
uint32_t command,
189-
void *context, device_pm_cb cb, void *arg)
189+
void *context, pm_device_cb cb, void *arg)
190190
{
191191
struct eth_context *eth_ctx = (struct eth_context *)dev->data;
192192
int ret = 0;

drivers/flash/spi_flash_at45.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ static int spi_flash_at45_init(const struct device *dev)
570570
#if IS_ENABLED(CONFIG_PM_DEVICE)
571571
static int spi_flash_at45_pm_control(const struct device *dev,
572572
uint32_t ctrl_command,
573-
void *context, device_pm_cb cb, void *arg)
573+
void *context, pm_device_cb cb, void *arg)
574574
{
575575
struct spi_flash_at45_data *dev_data = get_dev_data(dev);
576576
const struct spi_flash_at45_config *dev_config = get_dev_config(dev);

drivers/gpio/gpio_dw.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ static inline int gpio_dw_resume_from_suspend_port(const struct device *port)
461461
*/
462462
static int gpio_dw_device_ctrl(const struct device *port,
463463
uint32_t ctrl_command,
464-
void *context, device_pm_cb cb, void *arg)
464+
void *context, pm_device_cb cb, void *arg)
465465
{
466466
int ret = 0;
467467

drivers/i2c/i2c_cc13xx_cc26xx.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ static int i2c_cc13xx_cc26xx_set_power_state(const struct device *dev,
368368

369369
static int i2c_cc13xx_cc26xx_pm_control(const struct device *dev,
370370
uint32_t ctrl_command,
371-
void *context, device_pm_cb cb,
371+
void *context, pm_device_cb cb,
372372
void *arg)
373373
{
374374
int ret = 0;

drivers/i2c/i2c_nrfx_twi.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ static int init_twi(const struct device *dev)
215215
#ifdef CONFIG_PM_DEVICE
216216
static int twi_nrfx_pm_control(const struct device *dev,
217217
uint32_t ctrl_command,
218-
void *context, device_pm_cb cb, void *arg)
218+
void *context, pm_device_cb cb, void *arg)
219219
{
220220
int ret = 0;
221221
uint32_t pm_current_state = get_dev_data(dev)->pm_state;

drivers/i2c/i2c_nrfx_twim.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ static int init_twim(const struct device *dev)
265265
#ifdef CONFIG_PM_DEVICE
266266
static int twim_nrfx_pm_control(const struct device *dev,
267267
uint32_t ctrl_command,
268-
void *context, device_pm_cb cb, void *arg)
268+
void *context, pm_device_cb cb, void *arg)
269269
{
270270
int ret = 0;
271271
uint32_t pm_current_state = get_dev_data(dev)->pm_state;

drivers/interrupt_controller/intc_arcv2_irq_unit.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ static int arc_v2_irq_unit_get_state(const struct device *dev)
193193
*/
194194
static int arc_v2_irq_unit_device_ctrl(const struct device *dev,
195195
uint32_t ctrl_command, void *context,
196-
device_pm_cb cb, void *arg)
196+
pm_device_cb cb, void *arg)
197197
{
198198
int ret = 0;
199199
unsigned int key = arch_irq_lock();

drivers/interrupt_controller/intc_ioapic.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ int ioapic_resume_from_suspend(const struct device *port)
305305
*/
306306
static int ioapic_device_ctrl(const struct device *dev,
307307
uint32_t ctrl_command,
308-
void *context, device_pm_cb cb, void *arg)
308+
void *context, pm_device_cb cb, void *arg)
309309
{
310310
int ret = 0;
311311

drivers/interrupt_controller/intc_loapic.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ int loapic_resume(const struct device *port)
404404
*/
405405
static int loapic_device_ctrl(const struct device *port,
406406
uint32_t ctrl_command,
407-
void *context, device_pm_cb cb, void *arg)
407+
void *context, pm_device_cb cb, void *arg)
408408
{
409409
int ret = 0;
410410

drivers/led/led_pwm.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ static int led_pwm_pm_set_state(const struct device *dev, uint32_t new_state)
176176
}
177177

178178
static int led_pwm_pm_control(const struct device *dev, uint32_t ctrl_command,
179-
void *context, device_pm_cb cb, void *arg)
179+
void *context, pm_device_cb cb, void *arg)
180180
{
181181
int err;
182182

drivers/pwm/pwm_nrfx.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ static int pwm_nrfx_pm_control(const struct device *dev,
345345
static int pwm_##idx##_nrfx_pm_control(const struct device *dev, \
346346
uint32_t ctrl_command, \
347347
void *context, \
348-
device_pm_cb cb, \
348+
pm_device_cb cb, \
349349
void *arg) \
350350
{ \
351351
static uint32_t current_state = PM_DEVICE_ACTIVE_STATE; \

drivers/sensor/apds9960/apds9960.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ static int apds9960_init_interrupt(const struct device *dev)
410410
#ifdef CONFIG_PM_DEVICE
411411
static int apds9960_device_ctrl(const struct device *dev,
412412
uint32_t ctrl_command,
413-
void *context, device_pm_cb cb, void *arg)
413+
void *context, pm_device_cb cb, void *arg)
414414
{
415415
const struct apds9960_config *config = dev->config;
416416
struct apds9960_data *data = dev->data;

drivers/sensor/bme280/bme280.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ static int bme280_chip_init(const struct device *dev)
391391

392392
#ifdef CONFIG_PM_DEVICE
393393
int bme280_pm_ctrl(const struct device *dev, uint32_t ctrl_command,
394-
void *context, device_pm_cb cb, void *arg)
394+
void *context, pm_device_cb cb, void *arg)
395395
{
396396
struct bme280_data *data = to_data(dev);
397397

drivers/sensor/bmp388/bmp388.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ static int bmp388_device_ctrl(
590590
const struct device *dev,
591591
uint32_t ctrl_command,
592592
void *context,
593-
device_pm_cb cb,
593+
pm_device_cb cb,
594594
void *arg)
595595
{
596596
int ret = 0;

drivers/sensor/fdc2x1x/fdc2x1x.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ static int fdc2x1x_set_pm_state(const struct device *dev,
543543

544544
static int fdc2x1x_device_pm_ctrl(const struct device *dev,
545545
uint32_t ctrl_command,
546-
void *context, device_pm_cb cb, void *arg)
546+
void *context, pm_device_cb cb, void *arg)
547547
{
548548
struct fdc2x1x_data *data = dev->data;
549549
uint32_t new_state;

drivers/sensor/lis2mdl/lis2mdl.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ static int lis2mdl_set_power_state(struct lis2mdl_data *lis2mdl,
520520
}
521521

522522
static int lis2mdl_pm_control(const struct device *dev, uint32_t ctrl_command,
523-
void *context, device_pm_cb cb, void *arg)
523+
void *context, pm_device_cb cb, void *arg)
524524
{
525525
struct lis2mdl_data *lis2mdl = dev->data;
526526
const struct lis2mdl_config *const config = dev->config;

drivers/sensor/qdec_nrfx/qdec_nrfx.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ static int qdec_nrfx_pm_set_state(struct qdec_nrfx_data *data,
268268

269269
static int qdec_nrfx_pm_control(const struct device *dev,
270270
uint32_t ctrl_command,
271-
void *context, device_pm_cb cb, void *arg)
271+
void *context, pm_device_cb cb, void *arg)
272272
{
273273
struct qdec_nrfx_data *data = &qdec_nrfx_data;
274274
int err;

drivers/sensor/vcnl4040/vcnl4040.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ static int vcnl4040_ambient_setup(const struct device *dev)
220220
#ifdef CONFIG_PM_DEVICE
221221
static int vcnl4040_device_ctrl(const struct device *dev,
222222
uint32_t ctrl_command, void *context,
223-
device_pm_cb cb, void *arg)
223+
pm_device_cb cb, void *arg)
224224
{
225225
int ret = 0;
226226

drivers/serial/uart_cc13xx_cc26xx.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ static int uart_cc13xx_cc26xx_set_power_state(const struct device *dev,
444444

445445
static int uart_cc13xx_cc26xx_pm_control(const struct device *dev,
446446
uint32_t ctrl_command,
447-
void *context, device_pm_cb cb,
447+
void *context, pm_device_cb cb,
448448
void *arg)
449449
{
450450
int ret = 0;

drivers/serial/uart_npcx.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ static inline int uart_npcx_set_power_state(const struct device *dev,
449449

450450
/* Implements the device power management control functionality */
451451
static int uart_npcx_pm_control(const struct device *dev, uint32_t ctrl_command,
452-
void *context, device_pm_cb cb, void *arg)
452+
void *context, pm_device_cb cb, void *arg)
453453
{
454454
int ret = 0;
455455

drivers/serial/uart_nrfx_uart.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,7 @@ static void uart_nrfx_set_power_state(const struct device *dev,
11581158

11591159
static int uart_nrfx_pm_control(const struct device *dev,
11601160
uint32_t ctrl_command,
1161-
void *context, device_pm_cb cb, void *arg)
1161+
void *context, pm_device_cb cb, void *arg)
11621162
{
11631163
static uint32_t current_state = PM_DEVICE_ACTIVE_STATE;
11641164

drivers/serial/uart_nrfx_uarte.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1863,7 +1863,7 @@ static void uarte_nrfx_set_power_state(const struct device *dev,
18631863

18641864
static int uarte_nrfx_pm_control(const struct device *dev,
18651865
uint32_t ctrl_command,
1866-
void *context, device_pm_cb cb, void *arg)
1866+
void *context, pm_device_cb cb, void *arg)
18671867
{
18681868
struct uarte_nrfx_data *data = get_dev_data(dev);
18691869

drivers/serial/uart_stm32.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1461,7 +1461,7 @@ static int uart_stm32_set_power_state(const struct device *dev,
14611461
*/
14621462
static int uart_stm32_pm_control(const struct device *dev,
14631463
uint32_t ctrl_command,
1464-
void *context, device_pm_cb cb,
1464+
void *context, pm_device_cb cb,
14651465
void *arg)
14661466
{
14671467
struct uart_stm32_data *data = DEV_DATA(dev);

drivers/spi/spi_cc13xx_cc26xx.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ static int spi_cc13xx_cc26xx_set_power_state(const struct device *dev,
251251

252252
static int spi_cc13xx_cc26xx_pm_control(const struct device *dev,
253253
uint32_t ctrl_command,
254-
void *context, device_pm_cb cb,
254+
void *context, pm_device_cb cb,
255255
void *arg)
256256
{
257257
int ret = 0;

drivers/spi/spi_nrfx_spi.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ static int init_spi(const struct device *dev)
286286
#ifdef CONFIG_PM_DEVICE
287287
static int spi_nrfx_pm_control(const struct device *dev,
288288
uint32_t ctrl_command,
289-
void *context, device_pm_cb cb, void *arg)
289+
void *context, pm_device_cb cb, void *arg)
290290
{
291291
int ret = 0;
292292
struct spi_nrfx_data *data = get_dev_data(dev);

drivers/spi/spi_nrfx_spim.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ static int init_spim(const struct device *dev)
334334
#ifdef CONFIG_PM_DEVICE
335335
static int spim_nrfx_pm_control(const struct device *dev,
336336
uint32_t ctrl_command,
337-
void *context, device_pm_cb cb, void *arg)
337+
void *context, pm_device_cb cb, void *arg)
338338
{
339339
int ret = 0;
340340
struct spi_nrfx_data *data = get_dev_data(dev);

drivers/timer/sys_clock_init.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ int __weak sys_clock_driver_init(const struct device *dev)
3232

3333
int __weak sys_clock_device_ctrl(const struct device *dev,
3434
uint32_t ctrl_command,
35-
void *context, device_pm_cb cb, void *arg)
35+
void *context, pm_device_cb cb, void *arg)
3636
{
3737
return -ENOTSUP;
3838
}

include/device.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ struct device {
387387
#ifdef CONFIG_PM_DEVICE
388388
/** Power Management function */
389389
int (*pm_control)(const struct device *dev, uint32_t command,
390-
void *context, device_pm_cb cb, void *arg);
390+
void *context, pm_device_cb cb, void *arg);
391391
/** Pointer to device instance power management data */
392392
struct pm_device * const pm;
393393
#endif
@@ -657,7 +657,7 @@ void device_busy_clear(const struct device *dev);
657657
*/
658658
static inline int device_set_power_state(const struct device *dev,
659659
uint32_t device_power_state,
660-
device_pm_cb cb, void *arg)
660+
pm_device_cb cb, void *arg)
661661
{
662662
if (dev->pm_control == NULL) {
663663
return -ENOSYS;

include/drivers/timer/system_timer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ extern int sys_clock_driver_init(const struct device *dev);
4848
*/
4949
extern int clock_device_ctrl(const struct device *dev,
5050
uint32_t ctrl_command,
51-
void *context, device_pm_cb cb, void *arg);
51+
void *context, pm_device_cb cb, void *arg);
5252

5353
/**
5454
* @brief Set system clock timeout

include/pm/device.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ struct device;
7777
#define PM_DEVICE_SET_POWER_STATE 1
7878
#define PM_DEVICE_GET_POWER_STATE 2
7979

80-
typedef void (*device_pm_cb)(const struct device *dev,
80+
typedef void (*pm_device_cb)(const struct device *dev,
8181
int status, void *context, void *arg);
8282

8383
/**

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ static int dummy_resume_from_suspend(const struct device *dev)
116116

117117
static int dummy_device_pm_ctrl(const struct device *dev,
118118
uint32_t ctrl_command,
119-
void *context, device_pm_cb cb, void *arg)
119+
void *context, pm_device_cb cb, void *arg)
120120
{
121121
int ret = 0;
122122

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static int dummy_resume_from_suspend(const struct device *dev)
4747

4848
static int dummy_parent_pm_ctrl(const struct device *dev,
4949
uint32_t ctrl_command,
50-
void *context, device_pm_cb cb, void *arg)
50+
void *context, pm_device_cb cb, void *arg)
5151
{
5252
int ret = 0;
5353

tests/net/pm/src/main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ struct fake_dev_context {
2222
};
2323

2424
static int fake_dev_pm_control(const struct device *dev, uint32_t command,
25-
void *context, device_pm_cb cb, void *arg)
25+
void *context, pm_device_cb cb, void *arg)
2626
{
2727
struct fake_dev_context *ctx = dev->data;
2828
int ret = 0;

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static int dummy_resume_from_suspend(const struct device *dev)
4040

4141
static int dummy_device_pm_ctrl(const struct device *dev,
4242
uint32_t ctrl_command,
43-
void *context, device_pm_cb cb, void *arg)
43+
void *context, pm_device_cb cb, void *arg)
4444
{
4545
int ret = 0;
4646

0 commit comments

Comments
 (0)