[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <201701280001.W3qfbUZY%fengguang.wu@intel.com>
Date: Sat, 28 Jan 2017 01:16:44 +0800
From: kbuild test robot <lkp@...el.com>
To: Sebastian Reichel <sre@...nel.org>
Cc: kbuild-all@...org, Sebastian Reichel <sre@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>,
Alexandre Courbot <gnurou@...il.com>,
linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] gpio: mcp23s08: add pinconf support
Hi Sebastian,
[auto build test ERROR on gpio/for-next]
[also build test ERROR on v4.10-rc5 next-20170125]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Sebastian-Reichel/mcp23s08-pinconf-support/20170127-230243
base: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git for-next
config: x86_64-randconfig-x003-201704 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All error/warnings (new ones prefixed by >>):
>> drivers/gpio/gpio-mcp23s08.c:86:22: error: field 'pinctrl_desc' has incomplete type
struct pinctrl_desc pinctrl_desc;
^~~~~~~~~~~~
>> drivers/gpio/gpio-mcp23s08.c:139:38: error: array type has incomplete element type 'struct pinctrl_pin_desc'
static const struct pinctrl_pin_desc mcp23x08_pins[] = {
^~~~~~~~~~~~~
>> drivers/gpio/gpio-mcp23s08.c:140:2: error: implicit declaration of function 'PINCTRL_PIN' [-Werror=implicit-function-declaration]
PINCTRL_PIN(0, "gpio0"),
^~~~~~~~~~~
drivers/gpio/gpio-mcp23s08.c:150:38: error: array type has incomplete element type 'struct pinctrl_pin_desc'
static const struct pinctrl_pin_desc mcp23x17_pins[] = {
^~~~~~~~~~~~~
>> drivers/gpio/gpio-mcp23s08.c:188:21: error: variable 'mcp_pinctrl_ops' has initializer but incomplete type
static const struct pinctrl_ops mcp_pinctrl_ops = {
^~~~~~~~~~~
>> drivers/gpio/gpio-mcp23s08.c:189:2: error: unknown field 'get_groups_count' specified in initializer
.get_groups_count = mcp_pinctrl_get_groups_count,
^
>> drivers/gpio/gpio-mcp23s08.c:189:22: warning: excess elements in struct initializer
.get_groups_count = mcp_pinctrl_get_groups_count,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpio/gpio-mcp23s08.c:189:22: note: (near initialization for 'mcp_pinctrl_ops')
>> drivers/gpio/gpio-mcp23s08.c:190:2: error: unknown field 'get_group_name' specified in initializer
.get_group_name = mcp_pinctrl_get_group_name,
^
drivers/gpio/gpio-mcp23s08.c:190:20: warning: excess elements in struct initializer
.get_group_name = mcp_pinctrl_get_group_name,
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpio/gpio-mcp23s08.c:190:20: note: (near initialization for 'mcp_pinctrl_ops')
>> drivers/gpio/gpio-mcp23s08.c:191:2: error: unknown field 'get_group_pins' specified in initializer
.get_group_pins = mcp_pinctrl_get_group_pins,
^
drivers/gpio/gpio-mcp23s08.c:191:20: warning: excess elements in struct initializer
.get_group_pins = mcp_pinctrl_get_group_pins,
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpio/gpio-mcp23s08.c:191:20: note: (near initialization for 'mcp_pinctrl_ops')
>> drivers/gpio/gpio-mcp23s08.c:193:2: error: unknown field 'dt_node_to_map' specified in initializer
.dt_node_to_map = pinconf_generic_dt_node_to_map_pin,
^
>> drivers/gpio/gpio-mcp23s08.c:193:20: error: 'pinconf_generic_dt_node_to_map_pin' undeclared here (not in a function)
.dt_node_to_map = pinconf_generic_dt_node_to_map_pin,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpio/gpio-mcp23s08.c:193:20: warning: excess elements in struct initializer
drivers/gpio/gpio-mcp23s08.c:193:20: note: (near initialization for 'mcp_pinctrl_ops')
>> drivers/gpio/gpio-mcp23s08.c:194:2: error: unknown field 'dt_free_map' specified in initializer
.dt_free_map = pinconf_generic_dt_free_map,
^
>> drivers/gpio/gpio-mcp23s08.c:194:17: error: 'pinconf_generic_dt_free_map' undeclared here (not in a function)
.dt_free_map = pinconf_generic_dt_free_map,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpio/gpio-mcp23s08.c:194:17: warning: excess elements in struct initializer
drivers/gpio/gpio-mcp23s08.c:194:17: note: (near initialization for 'mcp_pinctrl_ops')
drivers/gpio/gpio-mcp23s08.c: In function 'mcp_pinconf_get':
>> drivers/gpio/gpio-mcp23s08.c:201:25: error: implicit declaration of function 'pinctrl_dev_get_drvdata' [-Werror=implicit-function-declaration]
struct mcp23s08 *mcp = pinctrl_dev_get_drvdata(pctldev);
^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpio/gpio-mcp23s08.c:201:25: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
drivers/gpio/gpio-mcp23s08.c: In function 'mcp_pinconf_set':
drivers/gpio/gpio-mcp23s08.c:226:25: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
struct mcp23s08 *mcp = pinctrl_dev_get_drvdata(pctldev);
^~~~~~~~~~~~~~~~~~~~~~~
drivers/gpio/gpio-mcp23s08.c: At top level:
>> drivers/gpio/gpio-mcp23s08.c:252:21: error: variable 'mcp_pinconf_ops' has initializer but incomplete type
static const struct pinconf_ops mcp_pinconf_ops = {
^~~~~~~~~~~
>> drivers/gpio/gpio-mcp23s08.c:253:2: error: unknown field 'pin_config_get' specified in initializer
.pin_config_get = mcp_pinconf_get,
^
drivers/gpio/gpio-mcp23s08.c:253:20: warning: excess elements in struct initializer
.pin_config_get = mcp_pinconf_get,
^~~~~~~~~~~~~~~
drivers/gpio/gpio-mcp23s08.c:253:20: note: (near initialization for 'mcp_pinconf_ops')
>> drivers/gpio/gpio-mcp23s08.c:254:2: error: unknown field 'pin_config_set' specified in initializer
.pin_config_set = mcp_pinconf_set,
^
drivers/gpio/gpio-mcp23s08.c:254:20: warning: excess elements in struct initializer
.pin_config_set = mcp_pinconf_set,
^~~~~~~~~~~~~~~
drivers/gpio/gpio-mcp23s08.c:254:20: note: (near initialization for 'mcp_pinconf_ops')
>> drivers/gpio/gpio-mcp23s08.c:255:2: error: unknown field 'is_generic' specified in initializer
.is_generic = true,
^
drivers/gpio/gpio-mcp23s08.c:255:16: warning: excess elements in struct initializer
.is_generic = true,
^~~~
drivers/gpio/gpio-mcp23s08.c:255:16: note: (near initialization for 'mcp_pinconf_ops')
drivers/gpio/gpio-mcp23s08.c: In function 'mcp23s08_probe_one':
>> drivers/gpio/gpio-mcp23s08.c:776:17: error: implicit declaration of function 'pinctrl_register' [-Werror=implicit-function-declaration]
mcp->pctldev = pinctrl_register(&mcp->pinctrl_desc, dev, mcp);
^~~~~~~~~~~~~~~~
drivers/gpio/gpio-mcp23s08.c: At top level:
>> drivers/gpio/gpio-mcp23s08.c:188:33: error: storage size of 'mcp_pinctrl_ops' isn't known
static const struct pinctrl_ops mcp_pinctrl_ops = {
^~~~~~~~~~~~~~~
vim +/pinctrl_desc +86 drivers/gpio/gpio-mcp23s08.c
80 struct gpio_chip chip;
81
82 struct regmap *regmap;
83 struct device *dev;
84
85 struct pinctrl_dev *pctldev;
> 86 struct pinctrl_desc pinctrl_desc;
87 };
88
89 static const struct regmap_config mcp23x08_regmap = {
90 .reg_bits = 8,
91 .val_bits = 8,
92
93 .reg_stride = 1,
94 .max_register = MCP_OLAT,
95 };
96
97 static const struct regmap_config mcp23x17_regmap = {
98 .reg_bits = 8,
99 .val_bits = 16,
100
101 .reg_stride = 2,
102 .max_register = MCP_OLAT << 1,
103 .val_format_endian = REGMAP_ENDIAN_LITTLE,
104 };
105
106 static int mcp_read(struct mcp23s08 *mcp, unsigned int reg, unsigned int *val)
107 {
108 return regmap_read(mcp->regmap, reg << mcp->reg_shift, val);
109 }
110
111 static int mcp_write(struct mcp23s08 *mcp, unsigned int reg, unsigned int val)
112 {
113 return regmap_write(mcp->regmap, reg << mcp->reg_shift, val);
114 }
115
116 static int mcp_set_bit(struct mcp23s08 *mcp, unsigned int reg,
117 unsigned int pin, bool enabled)
118 {
119 u16 val = enabled ? 0xffff : 0x0000;
120 u16 mask = BIT(pin);
121 return regmap_update_bits(mcp->regmap, reg << mcp->reg_shift,
122 mask, val);
123 }
124
125 static int mcp_update_cache(struct mcp23s08 *mcp)
126 {
127 int ret, reg, i;
128
129 for (i = 0; i < ARRAY_SIZE(mcp->cache); i++) {
130 ret = mcp_read(mcp, i, ®);
131 if (ret < 0)
132 return ret;
133 mcp->cache[i] = reg;
134 }
135
136 return 0;
137 }
138
> 139 static const struct pinctrl_pin_desc mcp23x08_pins[] = {
> 140 PINCTRL_PIN(0, "gpio0"),
141 PINCTRL_PIN(1, "gpio1"),
142 PINCTRL_PIN(2, "gpio2"),
143 PINCTRL_PIN(3, "gpio3"),
144 PINCTRL_PIN(4, "gpio4"),
145 PINCTRL_PIN(5, "gpio5"),
146 PINCTRL_PIN(6, "gpio6"),
147 PINCTRL_PIN(7, "gpio7"),
148 };
149
> 150 static const struct pinctrl_pin_desc mcp23x17_pins[] = {
151 PINCTRL_PIN(0, "gpio0"),
152 PINCTRL_PIN(1, "gpio1"),
153 PINCTRL_PIN(2, "gpio2"),
154 PINCTRL_PIN(3, "gpio3"),
155 PINCTRL_PIN(4, "gpio4"),
156 PINCTRL_PIN(5, "gpio5"),
157 PINCTRL_PIN(6, "gpio6"),
158 PINCTRL_PIN(7, "gpio7"),
159 PINCTRL_PIN(8, "gpio8"),
160 PINCTRL_PIN(9, "gpio9"),
161 PINCTRL_PIN(10, "gpio10"),
162 PINCTRL_PIN(11, "gpio11"),
163 PINCTRL_PIN(12, "gpio12"),
164 PINCTRL_PIN(13, "gpio13"),
165 PINCTRL_PIN(14, "gpio14"),
166 PINCTRL_PIN(15, "gpio15"),
167 };
168
169 static int mcp_pinctrl_get_groups_count(struct pinctrl_dev *pctldev)
170 {
171 return 0;
172 }
173
174 static const char *mcp_pinctrl_get_group_name(struct pinctrl_dev *pctldev,
175 unsigned int group)
176 {
177 return NULL;
178 }
179
180 static int mcp_pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
181 unsigned int group,
182 const unsigned int **pins,
183 unsigned int *num_pins)
184 {
185 return -ENOTSUPP;
186 }
187
> 188 static const struct pinctrl_ops mcp_pinctrl_ops = {
> 189 .get_groups_count = mcp_pinctrl_get_groups_count,
> 190 .get_group_name = mcp_pinctrl_get_group_name,
> 191 .get_group_pins = mcp_pinctrl_get_group_pins,
192 #ifdef CONFIG_OF
> 193 .dt_node_to_map = pinconf_generic_dt_node_to_map_pin,
> 194 .dt_free_map = pinconf_generic_dt_free_map,
195 #endif
196 };
197
198 static int mcp_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin,
199 unsigned long *config)
200 {
> 201 struct mcp23s08 *mcp = pinctrl_dev_get_drvdata(pctldev);
202 enum pin_config_param param = pinconf_to_config_param(*config);
203 unsigned int data, status;
204 int ret;
205
206 switch (param) {
207 case PIN_CONFIG_BIAS_PULL_UP:
208 ret = mcp_read(mcp, MCP_GPPU, &data);
209 if (ret < 0)
210 return ret;
211 status = (data & BIT(pin)) ? 1 : 0;
212 break;
213 default:
214 dev_err(mcp->dev, "Invalid config param %04x\n", param);
215 return -ENOTSUPP;
216 }
217
218 *config = 0;
219
220 return status ? 0 : -EINVAL;
221 }
222
223 static int mcp_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
224 unsigned long *configs, unsigned int num_configs)
225 {
226 struct mcp23s08 *mcp = pinctrl_dev_get_drvdata(pctldev);
227 enum pin_config_param param;
228 u32 arg, mask;
229 u16 val;
230 int ret = 0;
231 int i;
232
233 for (i = 0; i < num_configs; i++) {
234 param = pinconf_to_config_param(configs[i]);
235 arg = pinconf_to_config_argument(configs[i]);
236
237 switch (param) {
238 case PIN_CONFIG_BIAS_PULL_UP:
239 val = arg ? 0xFFFF : 0x0000;
240 mask = BIT(pin);
241 ret = mcp_set_bit(mcp, MCP_GPPU, pin, arg);
242 break;
243 default:
244 dev_err(mcp->dev, "Invalid config param %04x\n", param);
245 return -ENOTSUPP;
246 }
247 }
248
249 return ret;
250 }
251
> 252 static const struct pinconf_ops mcp_pinconf_ops = {
> 253 .pin_config_get = mcp_pinconf_get,
> 254 .pin_config_set = mcp_pinconf_set,
> 255 .is_generic = true,
256 };
257
258 /*----------------------------------------------------------------------*/
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Download attachment ".config.gz" of type "application/gzip" (24197 bytes)
Powered by blists - more mailing lists