summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/meson/pinctrl-meson.h
diff options
context:
space:
mode:
authorJerome Brunet <jbrunet@baylibre.com>2018-10-05 09:35:26 +0200
committerNeil Armstrong <narmstrong@baylibre.com>2018-11-26 14:40:52 +0100
commit7c9dcfed50fb3c63d746d6b4108872d906606a9e (patch)
treef2bb0ec249d5d5f25ddf17bc9408ad15b0b7f150 /drivers/pinctrl/meson/pinctrl-meson.h
parentf58d633e538858bf1ccdb93d5b5dc8edc368e30e (diff)
pinctrl: meson: rework gx pmx function
In preparation of supporting the new Amlogix AGX SoCs, we need to move the Amlogic GX pinmux functions out of the common code to be able to add a different set of SoC specific pinmux functions for AXG. Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Diffstat (limited to 'drivers/pinctrl/meson/pinctrl-meson.h')
-rw-r--r--drivers/pinctrl/meson/pinctrl-meson.h37
1 files changed, 17 insertions, 20 deletions
diff --git a/drivers/pinctrl/meson/pinctrl-meson.h b/drivers/pinctrl/meson/pinctrl-meson.h
index 6ec89ba117b..bdee721fc00 100644
--- a/drivers/pinctrl/meson/pinctrl-meson.h
+++ b/drivers/pinctrl/meson/pinctrl-meson.h
@@ -12,9 +12,7 @@ struct meson_pmx_group {
const char *name;
const unsigned int *pins;
unsigned int num_pins;
- bool is_gpio;
- unsigned int reg;
- unsigned int bit;
+ const void *data;
};
struct meson_pmx_func {
@@ -33,6 +31,8 @@ struct meson_pinctrl_data {
unsigned int num_groups;
unsigned int num_funcs;
unsigned int num_banks;
+ const struct driver *gpio_driver;
+ void *pmx_data;
};
struct meson_pinctrl {
@@ -89,23 +89,6 @@ struct meson_bank {
#define PIN(x, b) (b + x)
-#define GROUP(grp, r, b) \
- { \
- .name = #grp, \
- .pins = grp ## _pins, \
- .num_pins = ARRAY_SIZE(grp ## _pins), \
- .reg = r, \
- .bit = b, \
- }
-
-#define GPIO_GROUP(gpio, b) \
- { \
- .name = #gpio, \
- .pins = (const unsigned int[]){ PIN(gpio, b) }, \
- .num_pins = 1, \
- .is_gpio = true, \
- }
-
#define FUNCTION(fn) \
{ \
.name = #fn, \
@@ -131,6 +114,20 @@ struct meson_bank {
extern const struct pinctrl_ops meson_pinctrl_ops;
+int meson_pinctrl_get_groups_count(struct udevice *dev);
+const char *meson_pinctrl_get_group_name(struct udevice *dev,
+ unsigned int selector);
+int meson_pinmux_get_functions_count(struct udevice *dev);
+const char *meson_pinmux_get_function_name(struct udevice *dev,
+ unsigned int selector);
int meson_pinctrl_probe(struct udevice *dev);
+int meson_gpio_get(struct udevice *dev, unsigned int offset);
+int meson_gpio_set(struct udevice *dev, unsigned int offset, int value);
+int meson_gpio_get_direction(struct udevice *dev, unsigned int offset);
+int meson_gpio_direction_input(struct udevice *dev, unsigned int offset);
+int meson_gpio_direction_output(struct udevice *dev, unsigned int offset,
+ int value);
+int meson_gpio_probe(struct udevice *dev);
+
#endif /* __PINCTRL_MESON_H__ */