diff options
Diffstat (limited to 'app/include')
-rw-r--r-- | app/include/drivers/behavior.h | 14 | ||||
-rw-r--r-- | app/include/drivers/ext_power.h | 18 | ||||
-rw-r--r-- | app/include/zmk/events/sensor-event.h | 2 |
3 files changed, 18 insertions, 16 deletions
diff --git a/app/include/drivers/behavior.h b/app/include/drivers/behavior.h index 56ff7af..bc135fd 100644 --- a/app/include/drivers/behavior.h +++ b/app/include/drivers/behavior.h @@ -23,7 +23,8 @@ typedef int (*behavior_keymap_binding_callback_t)(struct zmk_behavior_binding *binding, struct zmk_behavior_binding_event event); typedef int (*behavior_sensor_keymap_binding_callback_t)(struct zmk_behavior_binding *binding, - struct device *sensor, int64_t timestamp); + const struct device *sensor, + int64_t timestamp); __subsystem struct behavior_driver_api { behavior_keymap_binding_callback_t binding_pressed; @@ -48,7 +49,7 @@ __syscall int behavior_keymap_binding_pressed(struct zmk_behavior_binding *bindi static inline int z_impl_behavior_keymap_binding_pressed(struct zmk_behavior_binding *binding, struct zmk_behavior_binding_event event) { - struct device *dev = device_get_binding(binding->behavior_dev); + const struct device *dev = device_get_binding(binding->behavior_dev); const struct behavior_driver_api *api = (const struct behavior_driver_api *)dev->api; if (api->binding_pressed == NULL) { @@ -71,7 +72,7 @@ __syscall int behavior_keymap_binding_released(struct zmk_behavior_binding *bind static inline int z_impl_behavior_keymap_binding_released(struct zmk_behavior_binding *binding, struct zmk_behavior_binding_event event) { - struct device *dev = device_get_binding(binding->behavior_dev); + const struct device *dev = device_get_binding(binding->behavior_dev); const struct behavior_driver_api *api = (const struct behavior_driver_api *)dev->api; if (api->binding_released == NULL) { @@ -92,12 +93,13 @@ static inline int z_impl_behavior_keymap_binding_released(struct zmk_behavior_bi * @retval Negative errno code if failure. */ __syscall int behavior_sensor_keymap_binding_triggered(struct zmk_behavior_binding *binding, - struct device *sensor, int64_t timestamp); + const struct device *sensor, + int64_t timestamp); static inline int z_impl_behavior_sensor_keymap_binding_triggered(struct zmk_behavior_binding *binding, - struct device *sensor, int64_t timestamp) { - struct device *dev = device_get_binding(binding->behavior_dev); + const struct device *sensor, int64_t timestamp) { + const struct device *dev = device_get_binding(binding->behavior_dev); const struct behavior_driver_api *api = (const struct behavior_driver_api *)dev->api; if (api->sensor_binding_triggered == NULL) { diff --git a/app/include/drivers/ext_power.h b/app/include/drivers/ext_power.h index ddc85a3..b422750 100644 --- a/app/include/drivers/ext_power.h +++ b/app/include/drivers/ext_power.h @@ -22,9 +22,9 @@ extern "C" { * (Internal use only.) */ -typedef int (*ext_power_enable_t)(struct device *dev); -typedef int (*ext_power_disable_t)(struct device *dev); -typedef int (*ext_power_get_t)(struct device *dev); +typedef int (*ext_power_enable_t)(const struct device *dev); +typedef int (*ext_power_disable_t)(const struct device *dev); +typedef int (*ext_power_get_t)(const struct device *dev); __subsystem struct ext_power_api { ext_power_enable_t enable; @@ -42,9 +42,9 @@ __subsystem struct ext_power_api { * @retval 0 If successful. * @retval Negative errno code if failure. */ -__syscall int ext_power_enable(struct device *dev); +__syscall int ext_power_enable(const struct device *dev); -static inline int z_impl_ext_power_enable(struct device *dev) { +static inline int z_impl_ext_power_enable(const struct device *dev) { const struct ext_power_api *api = (const struct ext_power_api *)dev->api; if (api->enable == NULL) { @@ -61,9 +61,9 @@ static inline int z_impl_ext_power_enable(struct device *dev) { * @retval 0 If successful. * @retval Negative errno code if failure. */ -__syscall int ext_power_disable(struct device *dev); +__syscall int ext_power_disable(const struct device *dev); -static inline int z_impl_ext_power_disable(struct device *dev) { +static inline int z_impl_ext_power_disable(const struct device *dev) { const struct ext_power_api *api = (const struct ext_power_api *)dev->api; if (api->disable == NULL) { @@ -81,9 +81,9 @@ static inline int z_impl_ext_power_disable(struct device *dev) { * @retval 1 if ext power is enabled. * @retval Negative errno code if failure. */ -__syscall int ext_power_get(struct device *dev); +__syscall int ext_power_get(const struct device *dev); -static inline int z_impl_ext_power_get(struct device *dev) { +static inline int z_impl_ext_power_get(const struct device *dev) { const struct ext_power_api *api = (const struct ext_power_api *)dev->api; if (api->get == NULL) { diff --git a/app/include/zmk/events/sensor-event.h b/app/include/zmk/events/sensor-event.h index d1d72f4..0bd3ccf 100644 --- a/app/include/zmk/events/sensor-event.h +++ b/app/include/zmk/events/sensor-event.h @@ -13,7 +13,7 @@ struct sensor_event { struct zmk_event_header header; uint8_t sensor_number; - struct device *sensor; + const struct device *sensor; int64_t timestamp; }; |