Gpio_Leds Driver - Embest SBC8600B User Manual

Hide thumbs Also See for SBC8600B:
Table of Contents

Advertisement

Embest Technology Co., Ltd
}
static void gpio_keys_gpio_report_event(struct gpio_button_data *bdata)
{
const struct gpio_keys_button *button = bdata->button;
struct input_dev *input = bdata->input;
unsigned int type = button->type ?: EV_KEY;
int state = (gpio_get_value_cansleep(button->gpio) ? 1 : 0) ^ button->active_low;
if (type == EV_ABS) {
if (state)
} else {
}
input_sync(input);
}

3.8.2 GPIO_leds Driver

1) Device Definition
Linux-4.1/arch/arm/boot/dts/embest-SBC-SBC8600.dts
Configure GPIO1.30 as "sys_led" (system indicator)and GPIO1.31 as "user_led",
both lighted up by high level signal.
leds {
compatible = "gpio-leds";
pinctrl-names = "default", "sleep";
pinctrl-0 = <&user_leds_default>;
pinctrl-1 = <&user_leds_sleep>;
led@0 {
};
led@1 {
Copyright © 2017 Embest Technology
input_event(input, type, button->code, button->value);
input_event(input, type, button->code, !!state);
label = "sys";
gpios = <&gpio1 30 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "heartbeat";
default-state = "off";
label = "D36";
SBC8600B-UM-V2.0
49

Advertisement

Table of Contents
loading

Table of Contents