drivers: use new PM macros

Port some drivers to the recently introduced macros to showcase its
usage and be able to do some initial testing (nRF52840).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2021-10-13 12:25:06 +02:00 committed by Carles Cufí
commit 88a69674c0
38 changed files with 123 additions and 71 deletions

View file

@ -573,7 +573,10 @@ static const struct display_driver_api st7735r_api = {
.x_offset = DT_INST_PROP(inst, x_offset), \
.y_offset = DT_INST_PROP(inst, y_offset), \
}; \
DEVICE_DT_INST_DEFINE(inst, st7735r_init, st7735r_pm_action, \
\
PM_DEVICE_DT_INST_DEFINE(inst, st7735r_pm_action); \
\
DEVICE_DT_INST_DEFINE(inst, st7735r_init, PM_DEVICE_DT_INST_REF(inst), \
&st7735r_data_ ## inst, &st7735r_config_ ## inst, \
POST_KERNEL, CONFIG_DISPLAY_INIT_PRIORITY, \
&st7735r_api);

View file

@ -438,6 +438,8 @@ static struct st7789v_data st7789v_data = {
.y_offset = DT_INST_PROP(0, y_offset),
};
PM_DEVICE_DT_INST_DEFINE(0, st7789v_pm_action);
DEVICE_DT_INST_DEFINE(0, &st7789v_init,
st7789v_pm_action, &st7789v_data, NULL, POST_KERNEL,
PM_DEVICE_DT_INST_REF(0), &st7789v_data, NULL, POST_KERNEL,
CONFIG_DISPLAY_INIT_PRIORITY, &st7789v_api);