pinctrl-meson.h (e0cdd3a095f9a933ff74e89e5fc625e4c2f3a7f0) pinctrl-meson.h (3c910ecbdda4227abd145967774f92b1a3341493)
1/* SPDX-License-Identifier: GPL-2.0 */
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Pin controller and GPIO driver for Amlogic Meson SoCs
4 *
5 * Copyright (C) 2014 Beniamino Galvani <b.galvani@gmail.com>
6 */
7
8#include <linux/gpio/driver.h>
9#include <linux/pinctrl/pinctrl.h>

--- 50 unchanged lines hidden (view full) ---

60 * enum meson_reg_type - type of registers encoded in @meson_reg_desc
61 */
62enum meson_reg_type {
63 REG_PULLEN,
64 REG_PULL,
65 REG_DIR,
66 REG_OUT,
67 REG_IN,
2/*
3 * Pin controller and GPIO driver for Amlogic Meson SoCs
4 *
5 * Copyright (C) 2014 Beniamino Galvani <b.galvani@gmail.com>
6 */
7
8#include <linux/gpio/driver.h>
9#include <linux/pinctrl/pinctrl.h>

--- 50 unchanged lines hidden (view full) ---

60 * enum meson_reg_type - type of registers encoded in @meson_reg_desc
61 */
62enum meson_reg_type {
63 REG_PULLEN,
64 REG_PULL,
65 REG_DIR,
66 REG_OUT,
67 REG_IN,
68 REG_DS,
69 NUM_REG,
70};
71
72/**
68 NUM_REG,
69};
70
71/**
73 * enum meson_pinconf_drv - value of drive-strength supported
74 */
75enum meson_pinconf_drv {
76 MESON_PINCONF_DRV_500UA,
77 MESON_PINCONF_DRV_2500UA,
78 MESON_PINCONF_DRV_3000UA,
79 MESON_PINCONF_DRV_4000UA,
80};
81
82/**
83 * struct meson bank
84 *
85 * @name: bank name
86 * @first: first pin of the bank
87 * @last: last pin of the bank
88 * @irq: hwirq base number of the bank
89 * @regs: array of register descriptors
90 *

--- 41 unchanged lines hidden (view full) ---

132
133#define FUNCTION(fn) \
134 { \
135 .name = #fn, \
136 .groups = fn ## _groups, \
137 .num_groups = ARRAY_SIZE(fn ## _groups), \
138 }
139
72 * struct meson bank
73 *
74 * @name: bank name
75 * @first: first pin of the bank
76 * @last: last pin of the bank
77 * @irq: hwirq base number of the bank
78 * @regs: array of register descriptors
79 *

--- 41 unchanged lines hidden (view full) ---

121
122#define FUNCTION(fn) \
123 { \
124 .name = #fn, \
125 .groups = fn ## _groups, \
126 .num_groups = ARRAY_SIZE(fn ## _groups), \
127 }
128
140#define BANK_DS(n, f, l, fi, li, per, peb, pr, pb, dr, db, or, ob, ir, ib, \
141 dsr, dsb) \
129#define BANK(n, f, l, fi, li, per, peb, pr, pb, dr, db, or, ob, ir, ib) \
142 { \
143 .name = n, \
144 .first = f, \
145 .last = l, \
146 .irq_first = fi, \
147 .irq_last = li, \
148 .regs = { \
149 [REG_PULLEN] = { per, peb }, \
150 [REG_PULL] = { pr, pb }, \
151 [REG_DIR] = { dr, db }, \
152 [REG_OUT] = { or, ob }, \
153 [REG_IN] = { ir, ib }, \
130 { \
131 .name = n, \
132 .first = f, \
133 .last = l, \
134 .irq_first = fi, \
135 .irq_last = li, \
136 .regs = { \
137 [REG_PULLEN] = { per, peb }, \
138 [REG_PULL] = { pr, pb }, \
139 [REG_DIR] = { dr, db }, \
140 [REG_OUT] = { or, ob }, \
141 [REG_IN] = { ir, ib }, \
154 [REG_DS] = { dsr, dsb }, \
155 }, \
156 }
157
142 }, \
143 }
144
158#define BANK(n, f, l, fi, li, per, peb, pr, pb, dr, db, or, ob, ir, ib) \
159 BANK_DS(n, f, l, fi, li, per, peb, pr, pb, dr, db, or, ob, ir, ib, 0, 0)
160
161#define MESON_PIN(x) PINCTRL_PIN(x, #x)
162
163/* Common pmx functions */
164int meson_pmx_get_funcs_count(struct pinctrl_dev *pcdev);
165const char *meson_pmx_get_func_name(struct pinctrl_dev *pcdev,
166 unsigned selector);
167int meson_pmx_get_groups(struct pinctrl_dev *pcdev,
168 unsigned selector,
169 const char * const **groups,
170 unsigned * const num_groups);
171
172/* Common probe function */
173int meson_pinctrl_probe(struct platform_device *pdev);
145#define MESON_PIN(x) PINCTRL_PIN(x, #x)
146
147/* Common pmx functions */
148int meson_pmx_get_funcs_count(struct pinctrl_dev *pcdev);
149const char *meson_pmx_get_func_name(struct pinctrl_dev *pcdev,
150 unsigned selector);
151int meson_pmx_get_groups(struct pinctrl_dev *pcdev,
152 unsigned selector,
153 const char * const **groups,
154 unsigned * const num_groups);
155
156/* Common probe function */
157int meson_pinctrl_probe(struct platform_device *pdev);