pinctrl-meson.h (2a267e7c41aa88215de2b542de797d03d16ecdfd) pinctrl-meson.h (6ea3e3bbef3705225bb675a8c57af58420c23f81)
1/*
2 * Pin controller and GPIO driver for Amlogic Meson SoCs
3 *
4 * 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.

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

66 * enum meson_reg_type - type of registers encoded in @meson_reg_desc
67 */
68enum meson_reg_type {
69 REG_PULLEN,
70 REG_PULL,
71 REG_DIR,
72 REG_OUT,
73 REG_IN,
1/*
2 * Pin controller and GPIO driver for Amlogic Meson SoCs
3 *
4 * 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.

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

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

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

127
128#define FUNCTION(fn) \
129 { \
130 .name = #fn, \
131 .groups = fn ## _groups, \
132 .num_groups = ARRAY_SIZE(fn ## _groups), \
133 }
134
89 * struct meson bank
90 *
91 * @name: bank name
92 * @first: first pin of the bank
93 * @last: last pin of the bank
94 * @irq: hwirq base number of the bank
95 * @regs: array of register descriptors
96 *

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

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