summaryrefslogtreecommitdiff
path: root/include/linux/pinctrl
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2026-07-08 13:42:17 -0600
committerTom Rini <[email protected]>2026-07-08 13:42:17 -0600
commitc991faf4f7a010cae56a9065b69fc23b6ca9ddf4 (patch)
tree7f9e6b7f7eaff6e232aee9e042faac82635e2a0d /include/linux/pinctrl
parent913fedc816570c07bfc7f9c4046dc2a3a55e4099 (diff)
parentc56c7298c42b06043aa3e9ae5bafd021bf1bac4c (diff)
Merge patch series "pinctrl: add support of Airoha SoCs"
Mikhail Kshevetskiy <[email protected]> says: This patch series add pin controller and gpio driver support for EN7523/ AN7581/AN7583 SoCs. The driver based on official linux airoha pinctrl and gpio driver with Matheus Sampaio Queiroga changes. The original Matheus Sampaio Queiroga driver can be taken from the repo: https://sirherobrine23.com.br/airoha_en7523/kernel/src/branch/airoha_en7523_pinctrl Additionally in the EN7523 case the patches removes existing gpio dts nodes and replaces them with pinctrl node. It should not be very dangerous, because: * No official EN7523 gpio support present in U-Boot * Legacy Linux EN7523 GPIO driver is mostly abandoned * The same driver is planned for upstream linux/openwrt This patchset includes bitfield.h patches created for Linux kernel by Geert Uytterhoeven. It suits U-Boot fine. I preserve original author and original commit messages. Please note me, if there is a better way. The patches were tested on EN7523/AN7581/AN7583 boards. Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'include/linux/pinctrl')
-rw-r--r--include/linux/pinctrl/pinctrl.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h
new file mode 100644
index 00000000000..32b56e0ab18
--- /dev/null
+++ b/include/linux/pinctrl/pinctrl.h
@@ -0,0 +1,74 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __LINUX_PINCTRL_PINCTRL_H
+#define __LINUX_PINCTRL_PINCTRL_H
+
+#include <linux/types.h>
+
+/**
+ * struct pingroup - provides information on pingroup
+ * @name: a name for pingroup
+ * @pins: an array of pins in the pingroup
+ * @npins: number of pins in the pingroup
+ */
+struct pingroup {
+ const char *name;
+ const unsigned int *pins;
+ size_t npins;
+};
+
+/* Convenience macro to define a single named or anonymous pingroup */
+#define PINCTRL_PINGROUP(_name, _pins, _npins) \
+(struct pingroup) { \
+ .name = _name, \
+ .pins = _pins, \
+ .npins = _npins, \
+}
+
+/**
+ * struct pinctrl_pin_desc - boards/machines provide information on their
+ * pins, pads or other muxable units in this struct
+ * @number: unique pin number from the global pin number space
+ * @name: a name for this pin
+ * @drv_data: driver-defined per-pin data. pinctrl core does not touch this
+ */
+struct pinctrl_pin_desc {
+ unsigned int number;
+ const char *name;
+ void *drv_data;
+};
+
+/* Convenience macro to define a single named or anonymous pin descriptor */
+#define PINCTRL_PIN(_number, _name) \
+(struct pinctrl_pin_desc) { \
+ .number = _number, \
+ .name = _name, \
+}
+
+#define PINCTRL_PIN_ANON(_number) \
+(struct pinctrl_pin_desc) { \
+ .number = _number, \
+}
+
+/**
+ * struct pinfunction - Description about a function
+ * @name: Name of the function
+ * @groups: An array of groups for this function
+ * @ngroups: Number of groups in @groups
+ * @flags: Additional pin function flags
+ */
+struct pinfunction {
+ const char *name;
+ const char * const *groups;
+ size_t ngroups;
+};
+
+/* Convenience macro to define a single named pinfunction */
+#define PINCTRL_PINFUNCTION(_name, _groups, _ngroups) \
+(struct pinfunction) { \
+ .name = (_name), \
+ .groups = (_groups), \
+ .ngroups = (_ngroups), \
+}
+
+#endif /* __LINUX_PINCTRL_PINCTRL_H */