|
|
@ -14,8 +14,6 @@ |
|
|
|
|
|
|
|
|
|
|
|
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); |
|
|
|
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); |
|
|
|
|
|
|
|
|
|
|
|
#if DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct io_channel_config { |
|
|
|
struct io_channel_config { |
|
|
|
const char *label; |
|
|
|
const char *label; |
|
|
|
uint8_t channel; |
|
|
|
uint8_t channel; |
|
|
@ -102,10 +100,11 @@ static int bvd_sample_fetch(struct device *dev, enum sensor_channel chan) { |
|
|
|
|
|
|
|
|
|
|
|
// Disable power GPIO if present
|
|
|
|
// Disable power GPIO if present
|
|
|
|
if (drv_data->gpio) { |
|
|
|
if (drv_data->gpio) { |
|
|
|
rc = gpio_pin_set(drv_data->gpio, drv_cfg->power_gpios.pin, 0); |
|
|
|
int rc2 = gpio_pin_set(drv_data->gpio, drv_cfg->power_gpios.pin, 0); |
|
|
|
|
|
|
|
|
|
|
|
if (rc != 0) { |
|
|
|
if (rc2 != 0) { |
|
|
|
LOG_DBG("Failed to disable ADC power GPIO: %d", rc); |
|
|
|
LOG_DBG("Failed to disable ADC power GPIO: %d", rc2); |
|
|
|
|
|
|
|
return rc2; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -214,5 +213,3 @@ static const struct bvd_config bvd_cfg = { |
|
|
|
|
|
|
|
|
|
|
|
DEVICE_AND_API_INIT(bvd_dev, DT_INST_LABEL(0), &bvd_init, &bvd_data, &bvd_cfg, POST_KERNEL, |
|
|
|
DEVICE_AND_API_INIT(bvd_dev, DT_INST_LABEL(0), &bvd_init, &bvd_data, &bvd_cfg, POST_KERNEL, |
|
|
|
CONFIG_SENSOR_INIT_PRIORITY, &bvd_api); |
|
|
|
CONFIG_SENSOR_INIT_PRIORITY, &bvd_api); |
|
|
|
|
|
|
|
|
|
|
|
#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */ |
|
|
|
|
|
|
|