Page MenuHomeFreeBSD

D61207.1794681032.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D61207.1794681032.diff

Index: sys/compat/linuxkpi/common/include/linux/gpio/machine.h
===================================================================
--- /dev/null
+++ sys/compat/linuxkpi/common/include/linux/gpio/machine.h
@@ -0,0 +1,59 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2026 The FreeBSD Foundation
+ */
+
+#ifndef _LINUXKPI_LINUX_GPIO_MACHINE_H_
+#define _LINUXKPI_LINUX_GPIO_MACHINE_H_
+
+#include <linux/types.h>
+#include <linux/kernel.h> /* For pr_debug(). */
+
+enum gpio_lookup_flags {
+ GPIO_ACTIVE_HIGH = (0 << 0),
+ GPIO_ACTIVE_LOW = (1 << 0),
+ GPIO_OPEN_DRAIN = (1 << 1),
+ GPIO_OPEN_SOURCE = (1 << 2),
+ GPIO_PERSISTENT = (0 << 3),
+ GPIO_TRANSITORY = (1 << 3),
+ GPIO_PULL_UP = (1 << 4),
+ GPIO_PULL_DOWN = (1 << 5),
+ GPIO_PULL_DISABLE = (1 << 6),
+
+ GPIO_LOOKUP_FLAGS_DEFAULT = GPIO_ACTIVE_HIGH | GPIO_PERSISTENT,
+};
+
+struct gpiod_lookup {
+ const char *key;
+ uint16_t chip_hwnum;
+ const char *con_id;
+ unsigned int idx;
+ unsigned long flags;
+};
+
+struct gpiod_lookup_table {
+ struct list_head list;
+ const char *dev_id;
+ struct gpiod_lookup table[];
+};
+
+#define GPIO_LOOKUP_IDX(_key, _chip_hwnum, _con_id, _idx, _flags) \
+ (struct gpiod_lookup) { \
+ .key = _key, \
+ .chip_hwnum = _chip_hwnum, \
+ .con_id = _con_id, \
+ .idx = _idx, \
+ .flags = _flags, \
+ }
+
+#define GPIO_LOOKUP(_key, _chip_hwnum, _con_id, _flags) \
+ GPIO_LOOKUP_IDX(_key, _chip_hwnum, _con_id, 0, _flags)
+
+static inline void
+gpiod_add_lookup_table(struct gpiod_lookup_table *table __unused)
+{
+ pr_debug("%s: TODO\n", __func__);
+}
+
+#endif /* _LINUXKPI_LINUX_GPIO_MACHINE_H_ */

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 14, 6:30 PM (12 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41711949
Default Alt Text
D61207.1794681032.diff (1 KB)

Event Timeline