blob: 8a108f3805a0b7929ea69dfdde3cf72784006b34 [file] [log] [blame]
Bill Richardsoneece4322012-10-20 11:44:34 +00001/*
2 * Copyright (c) 2012 The Chromium OS Authors.
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02003 * SPDX-License-Identifier: GPL-2.0+
Bill Richardsoneece4322012-10-20 11:44:34 +00004 */
5
6/*
7 * This is a GPIO driver for Intel ICH6 and later. The x86 GPIOs are accessed
8 * through the PCI bus. Each PCI device has 256 bytes of configuration space,
9 * consisting of a standard header and a device-specific set of registers. PCI
10 * bus 0, device 31, function 0 gives us access to the chipset GPIOs (among
11 * other things). Within the PCI configuration space, the GPIOBASE register
12 * tells us where in the device's I/O region we can find more registers to
13 * actually access the GPIOs.
14 *
15 * PCI bus/device/function 0:1f:0 => PCI config registers
16 * PCI config register "GPIOBASE"
17 * PCI I/O space + [GPIOBASE] => start of GPIO registers
18 * GPIO registers => gpio pin function, direction, value
Bill Richardson50a5ebe2012-10-20 11:44:36 +000019 *
20 *
21 * Danger Will Robinson! Bank 0 (GPIOs 0-31) seems to be fairly stable. Most
22 * ICH versions have more, but the decoding the matrix that describes them is
23 * absurdly complex and constantly changing. We'll provide Bank 1 and Bank 2,
24 * but they will ONLY work for certain unspecified chipsets because the offset
25 * from GPIOBASE changes randomly. Even then, many GPIOs are unimplemented or
26 * reserved or subject to arcane restrictions.
Bill Richardsoneece4322012-10-20 11:44:34 +000027 */
28
29#include <common.h>
Simon Glass2b4071b2014-10-10 07:49:18 -060030#include <dm.h>
31#include <errno.h>
32#include <fdtdec.h>
Bill Richardsoneece4322012-10-20 11:44:34 +000033#include <pci.h>
34#include <asm/gpio.h>
35#include <asm/io.h>
Simon Glass60af0172014-11-12 22:42:24 -070036#include <asm/pci.h>
Bill Richardsoneece4322012-10-20 11:44:34 +000037
Simon Glass2b4071b2014-10-10 07:49:18 -060038#define GPIO_PER_BANK 32
39
Simon Glass2b4071b2014-10-10 07:49:18 -060040struct ich6_bank_priv {
41 /* These are I/O addresses */
Bin Meng9b649692014-12-17 15:50:38 +080042 uint16_t use_sel;
43 uint16_t io_sel;
44 uint16_t lvl;
Bill Richardson50a5ebe2012-10-20 11:44:36 +000045};
46
Gabriel Huauf8135482015-05-25 22:27:37 -070047#define GPIO_USESEL_OFFSET(x) (x)
48#define GPIO_IOSEL_OFFSET(x) (x + 4)
49#define GPIO_LVL_OFFSET(x) (x + 8)
50
51#define IOPAD_MODE_MASK 0x7
52#define IOPAD_PULL_ASSIGN_SHIFT 7
53#define IOPAD_PULL_ASSIGN_MASK (0x3 << IOPAD_PULL_ASSIGN_SHIFT)
54#define IOPAD_PULL_STRENGTH_SHIFT 9
55#define IOPAD_PULL_STRENGTH_MASK (0x3 << IOPAD_PULL_STRENGTH_SHIFT)
56
Simon Glass60af0172014-11-12 22:42:24 -070057/* TODO: Move this to device tree, or platform data */
58void ich_gpio_set_gpio_map(const struct pch_gpio_map *map)
59{
60 gd->arch.gpio_map = map;
61}
Simon Glass60af0172014-11-12 22:42:24 -070062
Gabriel Huauf8135482015-05-25 22:27:37 -070063static int gpio_ich6_get_base(unsigned long base)
Bill Richardson50a5ebe2012-10-20 11:44:36 +000064{
Simon Glass2b4071b2014-10-10 07:49:18 -060065 pci_dev_t pci_dev; /* handle for 0:1f:0 */
Bill Richardsoneece4322012-10-20 11:44:34 +000066 u8 tmpbyte;
67 u16 tmpword;
68 u32 tmplong;
Bill Richardsoneece4322012-10-20 11:44:34 +000069
70 /* Where should it be? */
Simon Glass2b4071b2014-10-10 07:49:18 -060071 pci_dev = PCI_BDF(0, 0x1f, 0);
Bill Richardsoneece4322012-10-20 11:44:34 +000072
73 /* Is the device present? */
Simon Glass240d06d2015-03-05 12:25:15 -070074 tmpword = x86_pci_read_config16(pci_dev, PCI_VENDOR_ID);
Bill Richardsoneece4322012-10-20 11:44:34 +000075 if (tmpword != PCI_VENDOR_ID_INTEL) {
76 debug("%s: wrong VendorID\n", __func__);
Simon Glass2b4071b2014-10-10 07:49:18 -060077 return -ENODEV;
Bill Richardsoneece4322012-10-20 11:44:34 +000078 }
Bill Richardson50a5ebe2012-10-20 11:44:36 +000079
Simon Glass240d06d2015-03-05 12:25:15 -070080 tmpword = x86_pci_read_config16(pci_dev, PCI_DEVICE_ID);
Bill Richardson50a5ebe2012-10-20 11:44:36 +000081 debug("Found %04x:%04x\n", PCI_VENDOR_ID_INTEL, tmpword);
Bill Richardsoneece4322012-10-20 11:44:34 +000082 /*
Bill Richardson50a5ebe2012-10-20 11:44:36 +000083 * We'd like to validate the Device ID too, but pretty much any
Bill Richardsoneece4322012-10-20 11:44:34 +000084 * value is either a) correct with slight differences, or b)
Bill Richardson50a5ebe2012-10-20 11:44:36 +000085 * correct but undocumented. We'll have to check a bunch of other
86 * things instead...
Bill Richardsoneece4322012-10-20 11:44:34 +000087 */
88
89 /* I/O should already be enabled (it's a RO bit). */
Simon Glass240d06d2015-03-05 12:25:15 -070090 tmpword = x86_pci_read_config16(pci_dev, PCI_COMMAND);
Bill Richardsoneece4322012-10-20 11:44:34 +000091 if (!(tmpword & PCI_COMMAND_IO)) {
92 debug("%s: device IO not enabled\n", __func__);
Simon Glass2b4071b2014-10-10 07:49:18 -060093 return -ENODEV;
Bill Richardsoneece4322012-10-20 11:44:34 +000094 }
95
96 /* Header Type must be normal (bits 6-0 only; see spec.) */
Simon Glass240d06d2015-03-05 12:25:15 -070097 tmpbyte = x86_pci_read_config8(pci_dev, PCI_HEADER_TYPE);
Bill Richardsoneece4322012-10-20 11:44:34 +000098 if ((tmpbyte & 0x7f) != PCI_HEADER_TYPE_NORMAL) {
99 debug("%s: invalid Header type\n", __func__);
Simon Glass2b4071b2014-10-10 07:49:18 -0600100 return -ENODEV;
Bill Richardsoneece4322012-10-20 11:44:34 +0000101 }
102
103 /* Base Class must be a bridge device */
Simon Glass240d06d2015-03-05 12:25:15 -0700104 tmpbyte = x86_pci_read_config8(pci_dev, PCI_CLASS_CODE);
Bill Richardsoneece4322012-10-20 11:44:34 +0000105 if (tmpbyte != PCI_CLASS_CODE_BRIDGE) {
106 debug("%s: invalid class\n", __func__);
Simon Glass2b4071b2014-10-10 07:49:18 -0600107 return -ENODEV;
Bill Richardsoneece4322012-10-20 11:44:34 +0000108 }
109 /* Sub Class must be ISA */
Simon Glass240d06d2015-03-05 12:25:15 -0700110 tmpbyte = x86_pci_read_config8(pci_dev, PCI_CLASS_SUB_CODE);
Bill Richardsoneece4322012-10-20 11:44:34 +0000111 if (tmpbyte != PCI_CLASS_SUB_CODE_BRIDGE_ISA) {
112 debug("%s: invalid subclass\n", __func__);
Simon Glass2b4071b2014-10-10 07:49:18 -0600113 return -ENODEV;
Bill Richardsoneece4322012-10-20 11:44:34 +0000114 }
115
116 /* Programming Interface must be 0x00 (no others exist) */
Simon Glass240d06d2015-03-05 12:25:15 -0700117 tmpbyte = x86_pci_read_config8(pci_dev, PCI_CLASS_PROG);
Bill Richardsoneece4322012-10-20 11:44:34 +0000118 if (tmpbyte != 0x00) {
119 debug("%s: invalid interface type\n", __func__);
Simon Glass2b4071b2014-10-10 07:49:18 -0600120 return -ENODEV;
Bill Richardsoneece4322012-10-20 11:44:34 +0000121 }
122
123 /*
124 * GPIOBASE moved to its current offset with ICH6, but prior to
125 * that it was unused (or undocumented). Check that it looks
Bin Meng9b649692014-12-17 15:50:38 +0800126 * okay: not all ones or zeros.
127 *
128 * Note we don't need check bit0 here, because the Tunnel Creek
129 * GPIO base address register bit0 is reserved (read returns 0),
130 * while on the Ivybridge the bit0 is used to indicate it is an
131 * I/O space.
Bill Richardsoneece4322012-10-20 11:44:34 +0000132 */
Gabriel Huauf8135482015-05-25 22:27:37 -0700133 tmplong = x86_pci_read_config32(pci_dev, base);
Bin Meng9b649692014-12-17 15:50:38 +0800134 if (tmplong == 0x00000000 || tmplong == 0xffffffff) {
Gabriel Huauf8135482015-05-25 22:27:37 -0700135 debug("%s: unexpected BASE value\n", __func__);
Simon Glass2b4071b2014-10-10 07:49:18 -0600136 return -ENODEV;
Bill Richardsoneece4322012-10-20 11:44:34 +0000137 }
138
139 /*
140 * Okay, I guess we're looking at the right device. The actual
141 * GPIO registers are in the PCI device's I/O space, starting
142 * at the offset that we just read. Bit 0 indicates that it's
143 * an I/O address, not a memory address, so mask that off.
144 */
Gabriel Huauf8135482015-05-25 22:27:37 -0700145 return tmplong & 0xfffc;
146}
147
148static int _ich6_gpio_set_value(uint16_t base, unsigned offset, int value)
149{
150 u32 val;
151
152 val = inl(base);
153 if (value)
154 val |= (1UL << offset);
155 else
156 val &= ~(1UL << offset);
157 outl(val, base);
158
159 return 0;
160}
161
162static int _ich6_gpio_set_function(uint16_t base, unsigned offset, int func)
163{
164 u32 val;
165
166 if (func) {
167 val = inl(base);
168 val |= (1UL << offset);
169 outl(val, base);
170 } else {
171 val = inl(base);
172 val &= ~(1UL << offset);
173 outl(val, base);
174 }
175
176 return 0;
177}
178
179static int _ich6_gpio_set_direction(uint16_t base, unsigned offset, int dir)
180{
181 u32 val;
182
183 if (!dir) {
184 val = inl(base);
185 val |= (1UL << offset);
186 outl(val, base);
187 } else {
188 val = inl(base);
189 val &= ~(1UL << offset);
190 outl(val, base);
191 }
192
193 return 0;
194}
195
196static int _gpio_ich6_pinctrl_cfg_pin(s32 gpiobase, s32 iobase, int pin_node)
197{
198 u32 gpio_offset[2];
199 int pad_offset;
200 int val;
201 int ret;
202 const void *prop;
203
204 /*
205 * GPIO node is not mandatory, so we only do the
206 * pinmuxing if the node exist.
207 */
208 ret = fdtdec_get_int_array(gd->fdt_blob, pin_node, "gpio-offset",
209 gpio_offset, 2);
210 if (!ret) {
211 /* Do we want to force the GPIO mode? */
212 prop = fdt_getprop(gd->fdt_blob, pin_node, "mode-gpio",
213 NULL);
214 if (prop)
215 _ich6_gpio_set_function(GPIO_USESEL_OFFSET
216 (gpiobase) +
217 gpio_offset[0],
218 gpio_offset[1], 1);
219
220 val =
221 fdtdec_get_int(gd->fdt_blob, pin_node, "direction", -1);
222 if (val != -1)
223 _ich6_gpio_set_direction(GPIO_IOSEL_OFFSET
224 (gpiobase) +
225 gpio_offset[0],
226 gpio_offset[1], val);
227
228 val =
229 fdtdec_get_int(gd->fdt_blob, pin_node, "output-value", -1);
230 if (val != -1)
231 _ich6_gpio_set_value(GPIO_LVL_OFFSET(gpiobase)
232 + gpio_offset[0],
233 gpio_offset[1], val);
234 }
235
236 /* if iobase is present, let's configure the pad */
237 if (iobase != -1) {
238 int iobase_addr;
239
240 /*
241 * The offset for the same pin for the IOBASE and GPIOBASE are
242 * different, so instead of maintaining a lookup table,
243 * the device tree should provide directly the correct
244 * value for both mapping.
245 */
246 pad_offset =
247 fdtdec_get_int(gd->fdt_blob, pin_node, "pad-offset", -1);
248 if (pad_offset == -1) {
249 debug("%s: Invalid register io offset %d\n",
250 __func__, pad_offset);
251 return -EINVAL;
252 }
253
254 /* compute the absolute pad address */
255 iobase_addr = iobase + pad_offset;
256
257 /*
258 * Do we need to set a specific function mode?
259 * If someone put also 'mode-gpio', this option will
260 * be just ignored by the controller
261 */
262 val = fdtdec_get_int(gd->fdt_blob, pin_node, "mode-func", -1);
263 if (val != -1)
264 clrsetbits_le32(iobase_addr, IOPAD_MODE_MASK, val);
265
266 /* Configure the pull-up/down if needed */
267 val = fdtdec_get_int(gd->fdt_blob, pin_node, "pull-assign", -1);
268 if (val != -1)
269 clrsetbits_le32(iobase_addr,
270 IOPAD_PULL_ASSIGN_MASK,
271 val << IOPAD_PULL_ASSIGN_SHIFT);
272
273 val =
274 fdtdec_get_int(gd->fdt_blob, pin_node, "pull-strength", -1);
275 if (val != -1)
276 clrsetbits_le32(iobase_addr,
277 IOPAD_PULL_STRENGTH_MASK,
278 val << IOPAD_PULL_STRENGTH_SHIFT);
279
280 debug("%s: pad cfg [0x%x]: %08x\n", __func__, pad_offset,
281 readl(iobase_addr));
282 }
283
284 return 0;
285}
286
287int gpio_ich6_pinctrl_init(void)
288{
289 int pin_node;
290 int node;
291 int ret;
292 int gpiobase;
293 int iobase_offset;
294 int iobase = -1;
295
296 /*
297 * Get the memory/io base address to configure every pins.
298 * IOBASE is used to configure the mode/pads
299 * GPIOBASE is used to configure the direction and default value
300 */
301 gpiobase = gpio_ich6_get_base(PCI_CFG_GPIOBASE);
302 if (gpiobase < 0) {
303 debug("%s: invalid GPIOBASE address (%08x)\n", __func__,
304 gpiobase);
305 return -EINVAL;
306 }
307
308 /* This is not an error to not have a pinctrl node */
309 node =
310 fdtdec_next_compatible(gd->fdt_blob, 0, COMPAT_INTEL_X86_PINCTRL);
311 if (node <= 0) {
312 debug("%s: no pinctrl node\n", __func__);
313 return 0;
314 }
315
316 /*
317 * Get the IOBASE, this is not mandatory as this is not
318 * supported by all the CPU
319 */
320 iobase_offset = fdtdec_get_int(gd->fdt_blob, node, "io-base", -1);
321 if (iobase_offset == -1) {
322 debug("%s: io-base offset not present\n", __func__);
323 } else {
324 iobase = gpio_ich6_get_base(iobase_offset);
325 if (iobase < 0) {
326 debug("%s: invalid IOBASE address (%08x)\n", __func__,
327 iobase);
328 return -EINVAL;
329 }
330 }
331
332 for (pin_node = fdt_first_subnode(gd->fdt_blob, node);
333 pin_node > 0;
334 pin_node = fdt_next_subnode(gd->fdt_blob, pin_node)) {
335 /* Configure the pin */
336 ret = _gpio_ich6_pinctrl_cfg_pin(gpiobase, iobase, pin_node);
337 if (ret != 0) {
338 debug("%s: invalid configuration for the pin %d\n",
339 __func__, pin_node);
340 return ret;
341 }
342 }
343
344 return 0;
345}
346
347static int gpio_ich6_ofdata_to_platdata(struct udevice *dev)
348{
349 struct ich6_bank_platdata *plat = dev_get_platdata(dev);
350 u16 gpiobase;
351 int offset;
352
353 gpiobase = gpio_ich6_get_base(PCI_CFG_GPIOBASE);
Simon Glass2b4071b2014-10-10 07:49:18 -0600354 offset = fdtdec_get_int(gd->fdt_blob, dev->of_offset, "reg", -1);
355 if (offset == -1) {
356 debug("%s: Invalid register offset %d\n", __func__, offset);
357 return -EINVAL;
358 }
359 plat->base_addr = gpiobase + offset;
360 plat->bank_name = fdt_getprop(gd->fdt_blob, dev->of_offset,
361 "bank-name", NULL);
Bill Richardsoneece4322012-10-20 11:44:34 +0000362
Bill Richardsoneece4322012-10-20 11:44:34 +0000363 return 0;
364}
365
Simon Glass60af0172014-11-12 22:42:24 -0700366static int ich6_gpio_probe(struct udevice *dev)
Bill Richardsoneece4322012-10-20 11:44:34 +0000367{
Simon Glass2b4071b2014-10-10 07:49:18 -0600368 struct ich6_bank_platdata *plat = dev_get_platdata(dev);
Simon Glassde0977b2015-03-05 12:25:20 -0700369 struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
Simon Glass2b4071b2014-10-10 07:49:18 -0600370 struct ich6_bank_priv *bank = dev_get_priv(dev);
Bill Richardsoneece4322012-10-20 11:44:34 +0000371
Simon Glass60af0172014-11-12 22:42:24 -0700372 if (gd->arch.gpio_map) {
Bin Menga55173f2014-12-12 21:05:23 +0800373 setup_pch_gpios(plat->base_addr, gd->arch.gpio_map);
Simon Glass60af0172014-11-12 22:42:24 -0700374 gd->arch.gpio_map = NULL;
375 }
Bin Menga55173f2014-12-12 21:05:23 +0800376
Simon Glass2b4071b2014-10-10 07:49:18 -0600377 uc_priv->gpio_count = GPIO_PER_BANK;
378 uc_priv->bank_name = plat->bank_name;
379 bank->use_sel = plat->base_addr;
380 bank->io_sel = plat->base_addr + 4;
381 bank->lvl = plat->base_addr + 8;
Bill Richardsoneece4322012-10-20 11:44:34 +0000382
Simon Glass2b4071b2014-10-10 07:49:18 -0600383 return 0;
384}
385
Simon Glass60af0172014-11-12 22:42:24 -0700386static int ich6_gpio_request(struct udevice *dev, unsigned offset,
387 const char *label)
Simon Glass2b4071b2014-10-10 07:49:18 -0600388{
389 struct ich6_bank_priv *bank = dev_get_priv(dev);
390 u32 tmplong;
Bill Richardsoneece4322012-10-20 11:44:34 +0000391
392 /*
393 * Make sure that the GPIO pin we want isn't already in use for some
394 * built-in hardware function. We have to check this for every
395 * requested pin.
396 */
Simon Glass2b4071b2014-10-10 07:49:18 -0600397 tmplong = inl(bank->use_sel);
398 if (!(tmplong & (1UL << offset))) {
Bill Richardson50a5ebe2012-10-20 11:44:36 +0000399 debug("%s: gpio %d is reserved for internal use\n", __func__,
Simon Glass2b4071b2014-10-10 07:49:18 -0600400 offset);
401 return -EPERM;
Bill Richardsoneece4322012-10-20 11:44:34 +0000402 }
403
Bill Richardsoneece4322012-10-20 11:44:34 +0000404 return 0;
405}
406
Simon Glass2b4071b2014-10-10 07:49:18 -0600407static int ich6_gpio_direction_input(struct udevice *dev, unsigned offset)
Bill Richardsoneece4322012-10-20 11:44:34 +0000408{
Simon Glass2b4071b2014-10-10 07:49:18 -0600409 struct ich6_bank_priv *bank = dev_get_priv(dev);
Bill Richardson50a5ebe2012-10-20 11:44:36 +0000410
Gabriel Huauf8135482015-05-25 22:27:37 -0700411 return _ich6_gpio_set_direction(inl(bank->io_sel), offset, 0);
Bill Richardsoneece4322012-10-20 11:44:34 +0000412}
413
Simon Glass2b4071b2014-10-10 07:49:18 -0600414static int ich6_gpio_direction_output(struct udevice *dev, unsigned offset,
415 int value)
Bill Richardsoneece4322012-10-20 11:44:34 +0000416{
Gabriel Huauf8135482015-05-25 22:27:37 -0700417 int ret;
Simon Glass2b4071b2014-10-10 07:49:18 -0600418 struct ich6_bank_priv *bank = dev_get_priv(dev);
Bill Richardsoneece4322012-10-20 11:44:34 +0000419
Gabriel Huauf8135482015-05-25 22:27:37 -0700420 ret = _ich6_gpio_set_direction(inl(bank->io_sel), offset, 1);
421 if (ret)
422 return ret;
Axel Lin6df0e9e2014-12-07 12:48:27 +0800423
Gabriel Huauf8135482015-05-25 22:27:37 -0700424 return _ich6_gpio_set_value(bank->lvl, offset, value);
Bill Richardsoneece4322012-10-20 11:44:34 +0000425}
426
Simon Glass2b4071b2014-10-10 07:49:18 -0600427static int ich6_gpio_get_value(struct udevice *dev, unsigned offset)
Bill Richardsoneece4322012-10-20 11:44:34 +0000428{
Simon Glass2b4071b2014-10-10 07:49:18 -0600429 struct ich6_bank_priv *bank = dev_get_priv(dev);
Bill Richardsoneece4322012-10-20 11:44:34 +0000430 u32 tmplong;
Bill Richardson50a5ebe2012-10-20 11:44:36 +0000431 int r;
Bill Richardsoneece4322012-10-20 11:44:34 +0000432
Simon Glass2b4071b2014-10-10 07:49:18 -0600433 tmplong = inl(bank->lvl);
434 r = (tmplong & (1UL << offset)) ? 1 : 0;
Bill Richardson50a5ebe2012-10-20 11:44:36 +0000435 return r;
Bill Richardsoneece4322012-10-20 11:44:34 +0000436}
437
Simon Glass2b4071b2014-10-10 07:49:18 -0600438static int ich6_gpio_set_value(struct udevice *dev, unsigned offset,
439 int value)
Bill Richardsoneece4322012-10-20 11:44:34 +0000440{
Simon Glass2b4071b2014-10-10 07:49:18 -0600441 struct ich6_bank_priv *bank = dev_get_priv(dev);
Gabriel Huauf8135482015-05-25 22:27:37 -0700442 return _ich6_gpio_set_value(bank->lvl, offset, value);
Bill Richardsoneece4322012-10-20 11:44:34 +0000443}
Simon Glass2b4071b2014-10-10 07:49:18 -0600444
445static int ich6_gpio_get_function(struct udevice *dev, unsigned offset)
446{
447 struct ich6_bank_priv *bank = dev_get_priv(dev);
448 u32 mask = 1UL << offset;
449
450 if (!(inl(bank->use_sel) & mask))
451 return GPIOF_FUNC;
452 if (inl(bank->io_sel) & mask)
453 return GPIOF_INPUT;
454 else
455 return GPIOF_OUTPUT;
456}
457
458static const struct dm_gpio_ops gpio_ich6_ops = {
459 .request = ich6_gpio_request,
460 .direction_input = ich6_gpio_direction_input,
461 .direction_output = ich6_gpio_direction_output,
462 .get_value = ich6_gpio_get_value,
463 .set_value = ich6_gpio_set_value,
464 .get_function = ich6_gpio_get_function,
465};
466
467static const struct udevice_id intel_ich6_gpio_ids[] = {
468 { .compatible = "intel,ich6-gpio" },
469 { }
470};
471
472U_BOOT_DRIVER(gpio_ich6) = {
473 .name = "gpio_ich6",
474 .id = UCLASS_GPIO,
475 .of_match = intel_ich6_gpio_ids,
476 .ops = &gpio_ich6_ops,
477 .ofdata_to_platdata = gpio_ich6_ofdata_to_platdata,
478 .probe = ich6_gpio_probe,
479 .priv_auto_alloc_size = sizeof(struct ich6_bank_priv),
480 .platdata_auto_alloc_size = sizeof(struct ich6_bank_platdata),
481};