+ return count;
+}
+
+static ssize_t show_debounce_flag(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ if (!gpio_evmi)
+ return -ENODEV;
+
+ return snprintf(buf, PAGE_SIZE, "%u\n", (gpio_evmi->flags & GPIOKPF_DEBOUNCE) ? 1 : 0);
+}
+
+static ssize_t store_debounce_flag(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
+{
+ unsigned flag;
+
+ if (!gpio_evmi)
+ return -ENODEV;
+
+ sscanf(buf, "%u", &flag);
+
+ if (flag) {
+ gpio_evmi->flags |= GPIOKPF_DEBOUNCE;
+ } else {
+ gpio_evmi->flags &= ~GPIOKPF_DEBOUNCE;
+ }
+
+ return count;
+}
+
+static ssize_t show_remove_some_phantom_keys_flag(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ if (!gpio_evmi)
+ return -ENODEV;
+
+ return snprintf(buf, PAGE_SIZE, "%u\n", (gpio_evmi->flags & GPIOKPF_REMOVE_SOME_PHANTOM_KEYS) ? 1 : 0);
+}
+
+static ssize_t store_remove_some_phantom_keys_flag(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
+{
+ unsigned flag;
+
+ if (!gpio_evmi)
+ return -ENODEV;
+
+ sscanf(buf, "%u", &flag);
+
+ if (flag) {
+ gpio_evmi->flags |= GPIOKPF_REMOVE_SOME_PHANTOM_KEYS;
+ } else {
+ gpio_evmi->flags &= ~GPIOKPF_REMOVE_SOME_PHANTOM_KEYS;
+ }
+
+ return count;
+}
+
+static ssize_t show_print_unmapped_keys_flag(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ if (!gpio_evmi)
+ return -ENODEV;
+
+ return snprintf(buf, PAGE_SIZE, "%u\n", (gpio_evmi->flags & GPIOKPF_PRINT_UNMAPPED_KEYS) ? 1 : 0);
+}
+
+static ssize_t store_print_unmapped_keys_flag(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
+{
+ unsigned flag;
+
+ if (!gpio_evmi)
+ return -ENODEV;
+
+ sscanf(buf, "%u", &flag);
+
+ if (flag) {
+ gpio_evmi->flags |= GPIOKPF_PRINT_UNMAPPED_KEYS;
+ } else {
+ gpio_evmi->flags &= ~GPIOKPF_PRINT_UNMAPPED_KEYS;
+ }
+
+ return count;
+}
+
+static ssize_t show_print_mapped_keys_flag(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ if (!gpio_evmi)
+ return -ENODEV;
+
+ return snprintf(buf, PAGE_SIZE, "%u\n", (gpio_evmi->flags & GPIOKPF_PRINT_MAPPED_KEYS) ? 1 : 0);
+}
+
+static ssize_t store_print_mapped_keys_flag(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
+{
+ unsigned flag;
+
+ if (!gpio_evmi)
+ return -ENODEV;
+
+ sscanf(buf, "%u", &flag);
+
+ if (flag) {
+ gpio_evmi->flags |= GPIOKPF_PRINT_MAPPED_KEYS;
+ } else {
+ gpio_evmi->flags &= ~GPIOKPF_PRINT_MAPPED_KEYS;
+ }
+
+ return count;
+}
+
+static ssize_t show_print_phantom_keys_flag(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ if (!gpio_evmi)
+ return -ENODEV;
+
+ return snprintf(buf, PAGE_SIZE, "%u\n", (gpio_evmi->flags & GPIOKPF_PRINT_PHANTOM_KEYS) ? 1 : 0);
+}
+
+static ssize_t store_print_phantom_keys_flag(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
+{
+ unsigned flag;
+
+ if (!gpio_evmi)
+ return -ENODEV;
+
+ sscanf(buf, "%u", &flag);
+
+ if (flag) {
+ gpio_evmi->flags |= GPIOKPF_PRINT_PHANTOM_KEYS;
+ } else {
+ gpio_evmi->flags &= ~GPIOKPF_PRINT_PHANTOM_KEYS;
+ }
+
+ return count;
+}
+
+static ssize_t show_active_high_flag(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ if (!gpio_evmi)
+ return -ENODEV;
+
+ return snprintf(buf, PAGE_SIZE, "%u\n", (gpio_evmi->flags & GPIOKPF_ACTIVE_HIGH) ? 1 : 0);
+}
+
+static ssize_t store_active_high_flag(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
+{
+ unsigned flag;
+
+ if (!gpio_evmi)
+ return -ENODEV;
+
+ sscanf(buf, "%u", &flag);
+
+ if (flag) {
+ gpio_evmi->flags |= GPIOKPF_ACTIVE_HIGH;
+ } else {
+ gpio_evmi->flags &= ~GPIOKPF_ACTIVE_HIGH;
+ }
+
+ return count;
+}
+
+static ssize_t show_drive_inactive_flag(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ if (!gpio_evmi)
+ return -ENODEV;
+
+ return snprintf(buf, PAGE_SIZE, "%u\n", (gpio_evmi->flags & GPIOKPF_DRIVE_INACTIVE) ? 1 : 0);
+}
+
+static ssize_t store_drive_inactive_flag(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
+{
+ unsigned flag;
+
+ if (!gpio_evmi)
+ return -ENODEV;
+
+ sscanf(buf, "%u", &flag);
+
+ if (flag) {
+ gpio_evmi->flags |= GPIOKPF_DRIVE_INACTIVE;
+ } else {
+ gpio_evmi->flags &= ~GPIOKPF_DRIVE_INACTIVE;
+ }
+
+ return count;