hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/pinctrl/meson/pinctrl-meson.h
....@@ -1,21 +1,18 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Pin controller and GPIO driver for Amlogic Meson SoCs
34 *
45 * Copyright (C) 2014 Beniamino Galvani <b.galvani@gmail.com>
5
- *
6
- * This program is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU General Public License
8
- * version 2 as published by the Free Software Foundation.
9
- *
10
- * You should have received a copy of the GNU General Public License
11
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
126 */
137
14
-#include <linux/gpio.h>
8
+#include <linux/gpio/driver.h>
159 #include <linux/pinctrl/pinctrl.h>
1610 #include <linux/platform_device.h>
1711 #include <linux/regmap.h>
1812 #include <linux/types.h>
13
+#include <linux/module.h>
14
+
15
+struct meson_pinctrl;
1916
2017 /**
2118 * struct meson_pmx_group - a pinmux group
....@@ -71,7 +68,18 @@
7168 REG_DIR,
7269 REG_OUT,
7370 REG_IN,
71
+ REG_DS,
7472 NUM_REG,
73
+};
74
+
75
+/**
76
+ * enum meson_pinconf_drv - value of drive-strength supported
77
+ */
78
+enum meson_pinconf_drv {
79
+ MESON_PINCONF_DRV_500UA,
80
+ MESON_PINCONF_DRV_2500UA,
81
+ MESON_PINCONF_DRV_3000UA,
82
+ MESON_PINCONF_DRV_4000UA,
7583 };
7684
7785 /**
....@@ -109,6 +117,7 @@
109117 unsigned int num_banks;
110118 const struct pinmux_ops *pmx_ops;
111119 void *pmx_data;
120
+ int (*parse_dt)(struct meson_pinctrl *pc);
112121 };
113122
114123 struct meson_pinctrl {
....@@ -120,6 +129,7 @@
120129 struct regmap *reg_pullen;
121130 struct regmap *reg_pull;
122131 struct regmap *reg_gpio;
132
+ struct regmap *reg_ds;
123133 struct gpio_chip chip;
124134 struct device_node *of_node;
125135 };
....@@ -131,7 +141,8 @@
131141 .num_groups = ARRAY_SIZE(fn ## _groups), \
132142 }
133143
134
-#define BANK(n, f, l, fi, li, per, peb, pr, pb, dr, db, or, ob, ir, ib) \
144
+#define BANK_DS(n, f, l, fi, li, per, peb, pr, pb, dr, db, or, ob, ir, ib, \
145
+ dsr, dsb) \
135146 { \
136147 .name = n, \
137148 .first = f, \
....@@ -144,8 +155,12 @@
144155 [REG_DIR] = { dr, db }, \
145156 [REG_OUT] = { or, ob }, \
146157 [REG_IN] = { ir, ib }, \
158
+ [REG_DS] = { dsr, dsb }, \
147159 }, \
148160 }
161
+
162
+#define BANK(n, f, l, fi, li, per, peb, pr, pb, dr, db, or, ob, ir, ib) \
163
+ BANK_DS(n, f, l, fi, li, per, peb, pr, pb, dr, db, or, ob, ir, ib, 0, 0)
149164
150165 #define MESON_PIN(x) PINCTRL_PIN(x, #x)
151166
....@@ -160,3 +175,7 @@
160175
161176 /* Common probe function */
162177 int meson_pinctrl_probe(struct platform_device *pdev);
178
+/* Common ao groups extra dt parse function for SoCs before g12a */
179
+int meson8_aobus_parse_dt_extra(struct meson_pinctrl *pc);
180
+/* Common extra dt parse function for SoCs like A1 */
181
+int meson_a1_parse_dt_extra(struct meson_pinctrl *pc);