refactor: Move away from deprecated label usages.

* Move away from DT_LABEL.
* Move to DEVICE_DT_GET for non-behavior device access.
* Move various drivers to `gpio_spec_dt` and `DT` related macros.
* Remove mcp23017 while at it, since better upstream driver is
  available.
This commit is contained in:
Peter Johanson
2023-01-17 20:40:44 -05:00
committed by Pete Johanson
parent 062f94d014
commit 09ed79a867
41 changed files with 199 additions and 828 deletions

View File

@@ -12,7 +12,7 @@
#include <zephyr/logging/log.h>
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
#include <drivers/display.h>
#include <zephyr/drivers/display.h>
#include <lvgl.h>
#include "theme.h"
@@ -21,9 +21,7 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
#include <zmk/events/activity_state_changed.h>
#include <zmk/display/status_screen.h>
#define ZMK_DISPLAY_NAME CONFIG_LV_Z_DISPLAY_DEV_NAME
static const struct device *display;
static const struct device *display = DEVICE_DT_GET(DT_CHOSEN(zephyr_display));
static bool initialized = false;
static lv_obj_t *screen;
@@ -103,8 +101,7 @@ static void initialize_theme() {
void initialize_display(struct k_work *work) {
LOG_DBG("");
display = device_get_binding(ZMK_DISPLAY_NAME);
if (display == NULL) {
if (!device_is_ready(display)) {
LOG_ERR("Failed to find display device");
return;
}
@@ -165,4 +162,4 @@ int display_event_handler(const zmk_event_t *eh) {
ZMK_LISTENER(display, display_event_handler);
ZMK_SUBSCRIPTION(display, zmk_activity_state_changed);
#endif /* IS_ENABLED(CONFIG_ZMK_DISPLAY_BLANK_ON_IDLE) */
#endif /* IS_ENABLED(CONFIG_ZMK_DISPLAY_BLANK_ON_IDLE) */