blob: bfa1af1b519fdf74f30080b5e7701ac641bc999e [file] [log] [blame]
Grant Likelyc103de22011-06-04 18:38:28 -06001/*
2 * Moorestown platform Langwell chip GPIO driver
3 *
Andy Shevchenko611a4852013-05-22 13:20:14 +03004 * Copyright (c) 2008, 2009, 2013, Intel Corporation.
Alek Du8bf02612009-09-22 16:46:36 -07005 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20/* Supports:
21 * Moorestown platform Langwell chip.
Alek Du8081c842010-05-26 14:42:25 -070022 * Medfield platform Penwell chip.
Alek Du8bf02612009-09-22 16:46:36 -070023 */
24
25#include <linux/module.h>
26#include <linux/pci.h>
Alan Cox72b43792010-10-27 15:33:23 -070027#include <linux/platform_device.h>
Alek Du8bf02612009-09-22 16:46:36 -070028#include <linux/kernel.h>
29#include <linux/delay.h>
30#include <linux/stddef.h>
31#include <linux/interrupt.h>
32#include <linux/init.h>
33#include <linux/irq.h>
34#include <linux/io.h>
35#include <linux/gpio.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090036#include <linux/slab.h>
Kristen Carlson Accardi78128032011-05-10 14:23:45 +010037#include <linux/pm_runtime.h>
Mika Westerberg465f2bd2012-05-02 11:15:50 +030038#include <linux/irqdomain.h>
Alek Du8bf02612009-09-22 16:46:36 -070039
Alek Du8081c842010-05-26 14:42:25 -070040/*
41 * Langwell chip has 64 pins and thus there are 2 32bit registers to control
42 * each feature, while Penwell chip has 96 pins for each block, and need 3 32bit
43 * registers to control them, so we only define the order here instead of a
44 * structure, to get a bit offset for a pin (use GPDR as an example):
45 *
46 * nreg = ngpio / 32;
47 * reg = offset / 32;
48 * bit = offset % 32;
49 * reg_addr = reg_base + GPDR * nreg * 4 + reg * 4;
50 *
51 * so the bit of reg_addr is to control pin offset's GPDR feature
52*/
53
54enum GPIO_REG {
55 GPLR = 0, /* pin level read-only */
56 GPDR, /* pin direction */
57 GPSR, /* pin set */
58 GPCR, /* pin clear */
59 GRER, /* rising edge detect */
60 GFER, /* falling edge detect */
61 GEDR, /* edge detect result */
Adrian Hunter8c0f7b12011-10-03 14:36:07 +030062 GAFR, /* alt function */
Alek Du8bf02612009-09-22 16:46:36 -070063};
64
65struct lnw_gpio {
66 struct gpio_chip chip;
Andy Shevchenko64c8cbc2013-05-22 13:20:11 +030067 void __iomem *reg_base;
Alek Du8bf02612009-09-22 16:46:36 -070068 spinlock_t lock;
Kristen Carlson Accardi78128032011-05-10 14:23:45 +010069 struct pci_dev *pdev;
Mika Westerberg465f2bd2012-05-02 11:15:50 +030070 struct irq_domain *domain;
Alek Du8bf02612009-09-22 16:46:36 -070071};
72
David Cohen46ebfbc2012-12-20 14:45:51 -080073#define to_lnw_priv(chip) container_of(chip, struct lnw_gpio, chip)
74
Alek Du8081c842010-05-26 14:42:25 -070075static void __iomem *gpio_reg(struct gpio_chip *chip, unsigned offset,
Andy Shevchenko611a4852013-05-22 13:20:14 +030076 enum GPIO_REG reg_type)
Alek Du8bf02612009-09-22 16:46:36 -070077{
David Cohen46ebfbc2012-12-20 14:45:51 -080078 struct lnw_gpio *lnw = to_lnw_priv(chip);
Alek Du8081c842010-05-26 14:42:25 -070079 unsigned nreg = chip->ngpio / 32;
Alek Du8bf02612009-09-22 16:46:36 -070080 u8 reg = offset / 32;
Alek Du8bf02612009-09-22 16:46:36 -070081
Andy Shevchenko611a4852013-05-22 13:20:14 +030082 return lnw->reg_base + reg_type * nreg * 4 + reg * 4;
Alek Du8081c842010-05-26 14:42:25 -070083}
84
Adrian Hunter8c0f7b12011-10-03 14:36:07 +030085static void __iomem *gpio_reg_2bit(struct gpio_chip *chip, unsigned offset,
86 enum GPIO_REG reg_type)
87{
David Cohen46ebfbc2012-12-20 14:45:51 -080088 struct lnw_gpio *lnw = to_lnw_priv(chip);
Adrian Hunter8c0f7b12011-10-03 14:36:07 +030089 unsigned nreg = chip->ngpio / 32;
90 u8 reg = offset / 16;
Adrian Hunter8c0f7b12011-10-03 14:36:07 +030091
Andy Shevchenko611a4852013-05-22 13:20:14 +030092 return lnw->reg_base + reg_type * nreg * 4 + reg * 4;
Adrian Hunter8c0f7b12011-10-03 14:36:07 +030093}
94
95static int lnw_gpio_request(struct gpio_chip *chip, unsigned offset)
96{
97 void __iomem *gafr = gpio_reg_2bit(chip, offset, GAFR);
98 u32 value = readl(gafr);
99 int shift = (offset % 16) << 1, af = (value >> shift) & 3;
100
101 if (af) {
102 value &= ~(3 << shift);
103 writel(value, gafr);
104 }
105 return 0;
106}
107
Alek Du8081c842010-05-26 14:42:25 -0700108static int lnw_gpio_get(struct gpio_chip *chip, unsigned offset)
109{
110 void __iomem *gplr = gpio_reg(chip, offset, GPLR);
111
Alek Du8bf02612009-09-22 16:46:36 -0700112 return readl(gplr) & BIT(offset % 32);
113}
114
115static void lnw_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
116{
Alek Du8bf02612009-09-22 16:46:36 -0700117 void __iomem *gpsr, *gpcr;
118
119 if (value) {
Alek Du8081c842010-05-26 14:42:25 -0700120 gpsr = gpio_reg(chip, offset, GPSR);
Alek Du8bf02612009-09-22 16:46:36 -0700121 writel(BIT(offset % 32), gpsr);
122 } else {
Alek Du8081c842010-05-26 14:42:25 -0700123 gpcr = gpio_reg(chip, offset, GPCR);
Alek Du8bf02612009-09-22 16:46:36 -0700124 writel(BIT(offset % 32), gpcr);
125 }
126}
127
128static int lnw_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
129{
David Cohen46ebfbc2012-12-20 14:45:51 -0800130 struct lnw_gpio *lnw = to_lnw_priv(chip);
Alek Du8081c842010-05-26 14:42:25 -0700131 void __iomem *gpdr = gpio_reg(chip, offset, GPDR);
Alek Du8bf02612009-09-22 16:46:36 -0700132 u32 value;
133 unsigned long flags;
Alek Du8bf02612009-09-22 16:46:36 -0700134
Kristen Carlson Accardi78128032011-05-10 14:23:45 +0100135 if (lnw->pdev)
136 pm_runtime_get(&lnw->pdev->dev);
137
Alek Du8bf02612009-09-22 16:46:36 -0700138 spin_lock_irqsave(&lnw->lock, flags);
139 value = readl(gpdr);
140 value &= ~BIT(offset % 32);
141 writel(value, gpdr);
142 spin_unlock_irqrestore(&lnw->lock, flags);
Kristen Carlson Accardi78128032011-05-10 14:23:45 +0100143
144 if (lnw->pdev)
145 pm_runtime_put(&lnw->pdev->dev);
146
Alek Du8bf02612009-09-22 16:46:36 -0700147 return 0;
148}
149
150static int lnw_gpio_direction_output(struct gpio_chip *chip,
151 unsigned offset, int value)
152{
David Cohen46ebfbc2012-12-20 14:45:51 -0800153 struct lnw_gpio *lnw = to_lnw_priv(chip);
Alek Du8081c842010-05-26 14:42:25 -0700154 void __iomem *gpdr = gpio_reg(chip, offset, GPDR);
Alek Du8bf02612009-09-22 16:46:36 -0700155 unsigned long flags;
Alek Du8bf02612009-09-22 16:46:36 -0700156
157 lnw_gpio_set(chip, offset, value);
Kristen Carlson Accardi78128032011-05-10 14:23:45 +0100158
159 if (lnw->pdev)
160 pm_runtime_get(&lnw->pdev->dev);
161
Alek Du8bf02612009-09-22 16:46:36 -0700162 spin_lock_irqsave(&lnw->lock, flags);
163 value = readl(gpdr);
Justin P. Mattock6eab04a2011-04-08 19:49:08 -0700164 value |= BIT(offset % 32);
Alek Du8bf02612009-09-22 16:46:36 -0700165 writel(value, gpdr);
166 spin_unlock_irqrestore(&lnw->lock, flags);
Kristen Carlson Accardi78128032011-05-10 14:23:45 +0100167
168 if (lnw->pdev)
169 pm_runtime_put(&lnw->pdev->dev);
170
Alek Du8bf02612009-09-22 16:46:36 -0700171 return 0;
172}
173
174static int lnw_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
175{
David Cohen46ebfbc2012-12-20 14:45:51 -0800176 struct lnw_gpio *lnw = to_lnw_priv(chip);
Mika Westerberg465f2bd2012-05-02 11:15:50 +0300177 return irq_create_mapping(lnw->domain, offset);
Alek Du8bf02612009-09-22 16:46:36 -0700178}
179
Lennert Buytenhek5ffd72c2011-01-12 17:00:13 -0800180static int lnw_irq_type(struct irq_data *d, unsigned type)
Alek Du8bf02612009-09-22 16:46:36 -0700181{
Lennert Buytenhek5ffd72c2011-01-12 17:00:13 -0800182 struct lnw_gpio *lnw = irq_data_get_irq_chip_data(d);
Mika Westerberg465f2bd2012-05-02 11:15:50 +0300183 u32 gpio = irqd_to_hwirq(d);
Alek Du8bf02612009-09-22 16:46:36 -0700184 unsigned long flags;
185 u32 value;
Alek Du8081c842010-05-26 14:42:25 -0700186 void __iomem *grer = gpio_reg(&lnw->chip, gpio, GRER);
187 void __iomem *gfer = gpio_reg(&lnw->chip, gpio, GFER);
Alek Du8bf02612009-09-22 16:46:36 -0700188
Roel Kluin4efec622009-12-15 16:46:18 -0800189 if (gpio >= lnw->chip.ngpio)
Alek Du8bf02612009-09-22 16:46:36 -0700190 return -EINVAL;
Kristen Carlson Accardi78128032011-05-10 14:23:45 +0100191
192 if (lnw->pdev)
193 pm_runtime_get(&lnw->pdev->dev);
194
Alek Du8bf02612009-09-22 16:46:36 -0700195 spin_lock_irqsave(&lnw->lock, flags);
196 if (type & IRQ_TYPE_EDGE_RISING)
197 value = readl(grer) | BIT(gpio % 32);
198 else
199 value = readl(grer) & (~BIT(gpio % 32));
200 writel(value, grer);
201
202 if (type & IRQ_TYPE_EDGE_FALLING)
203 value = readl(gfer) | BIT(gpio % 32);
204 else
205 value = readl(gfer) & (~BIT(gpio % 32));
206 writel(value, gfer);
207 spin_unlock_irqrestore(&lnw->lock, flags);
208
Kristen Carlson Accardi78128032011-05-10 14:23:45 +0100209 if (lnw->pdev)
210 pm_runtime_put(&lnw->pdev->dev);
211
Alek Du8bf02612009-09-22 16:46:36 -0700212 return 0;
Andrew Mortonfd0574c2010-10-27 15:33:22 -0700213}
Alek Du8bf02612009-09-22 16:46:36 -0700214
Lennert Buytenhek5ffd72c2011-01-12 17:00:13 -0800215static void lnw_irq_unmask(struct irq_data *d)
Alek Du8bf02612009-09-22 16:46:36 -0700216{
Andrew Mortonfd0574c2010-10-27 15:33:22 -0700217}
Alek Du8bf02612009-09-22 16:46:36 -0700218
Lennert Buytenhek5ffd72c2011-01-12 17:00:13 -0800219static void lnw_irq_mask(struct irq_data *d)
Alek Du8bf02612009-09-22 16:46:36 -0700220{
Andrew Mortonfd0574c2010-10-27 15:33:22 -0700221}
Alek Du8bf02612009-09-22 16:46:36 -0700222
223static struct irq_chip lnw_irqchip = {
224 .name = "LNW-GPIO",
Lennert Buytenhek5ffd72c2011-01-12 17:00:13 -0800225 .irq_mask = lnw_irq_mask,
226 .irq_unmask = lnw_irq_unmask,
227 .irq_set_type = lnw_irq_type,
Alek Du8bf02612009-09-22 16:46:36 -0700228};
229
Alek Du8081c842010-05-26 14:42:25 -0700230static DEFINE_PCI_DEVICE_TABLE(lnw_gpio_ids) = { /* pin number */
231 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x080f), .driver_data = 64 },
232 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x081f), .driver_data = 96 },
233 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x081a), .driver_data = 96 },
David Cohen936cb1b2012-12-18 17:52:12 -0800234 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x08eb), .driver_data = 96 },
235 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x08f7), .driver_data = 96 },
Alek Du8bf02612009-09-22 16:46:36 -0700236 { 0, }
237};
238MODULE_DEVICE_TABLE(pci, lnw_gpio_ids);
239
240static void lnw_irq_handler(unsigned irq, struct irq_desc *desc)
241{
Thomas Gleixner20e2aa92011-03-17 19:32:49 +0000242 struct irq_data *data = irq_desc_get_irq_data(desc);
243 struct lnw_gpio *lnw = irq_data_get_irq_handler_data(data);
244 struct irq_chip *chip = irq_data_get_irq_chip(data);
Thomas Gleixner84bead62011-03-17 19:32:58 +0000245 u32 base, gpio, mask;
Thomas Gleixner732063b2011-03-17 19:32:55 +0000246 unsigned long pending;
Alek Du8bf02612009-09-22 16:46:36 -0700247 void __iomem *gedr;
Alek Du8bf02612009-09-22 16:46:36 -0700248
249 /* check GPIO controller to check which pin triggered the interrupt */
Alek Du8081c842010-05-26 14:42:25 -0700250 for (base = 0; base < lnw->chip.ngpio; base += 32) {
251 gedr = gpio_reg(&lnw->chip, base, GEDR);
Mika Westerbergc8f925b2012-05-10 13:01:22 +0300252 while ((pending = readl(gedr))) {
Mathias Nyman2345b202011-07-08 10:02:18 +0100253 gpio = __ffs(pending);
Thomas Gleixner84bead62011-03-17 19:32:58 +0000254 mask = BIT(gpio);
Thomas Gleixner84bead62011-03-17 19:32:58 +0000255 /* Clear before handling so we can't lose an edge */
256 writel(mask, gedr);
Mika Westerberg465f2bd2012-05-02 11:15:50 +0300257 generic_handle_irq(irq_find_mapping(lnw->domain,
258 base + gpio));
Thomas Gleixner732063b2011-03-17 19:32:55 +0000259 }
Alek Du8bf02612009-09-22 16:46:36 -0700260 }
Feng Tang0766d202011-01-25 15:07:15 -0800261
Thomas Gleixner20e2aa92011-03-17 19:32:49 +0000262 chip->irq_eoi(data);
Alek Du8bf02612009-09-22 16:46:36 -0700263}
264
Mika Westerbergf5f93112012-04-05 12:15:17 +0300265static void lnw_irq_init_hw(struct lnw_gpio *lnw)
266{
267 void __iomem *reg;
268 unsigned base;
269
270 for (base = 0; base < lnw->chip.ngpio; base += 32) {
271 /* Clear the rising-edge detect register */
272 reg = gpio_reg(&lnw->chip, base, GRER);
273 writel(0, reg);
274 /* Clear the falling-edge detect register */
275 reg = gpio_reg(&lnw->chip, base, GFER);
276 writel(0, reg);
277 /* Clear the edge detect status register */
278 reg = gpio_reg(&lnw->chip, base, GEDR);
279 writel(~0, reg);
280 }
281}
282
Mika Westerberg465f2bd2012-05-02 11:15:50 +0300283static int lnw_gpio_irq_map(struct irq_domain *d, unsigned int virq,
284 irq_hw_number_t hw)
285{
286 struct lnw_gpio *lnw = d->host_data;
287
288 irq_set_chip_and_handler_name(virq, &lnw_irqchip, handle_simple_irq,
289 "demux");
290 irq_set_chip_data(virq, lnw);
291 irq_set_irq_type(virq, IRQ_TYPE_NONE);
292
293 return 0;
294}
295
296static const struct irq_domain_ops lnw_gpio_irq_ops = {
297 .map = lnw_gpio_irq_map,
298 .xlate = irq_domain_xlate_twocell,
299};
300
Kristen Carlson Accardi78128032011-05-10 14:23:45 +0100301static int lnw_gpio_runtime_idle(struct device *dev)
302{
Rafael J. Wysocki45f0a852013-06-03 21:49:52 +0200303 pm_schedule_suspend(dev, 500);
Kristen Carlson Accardi78128032011-05-10 14:23:45 +0100304 return -EBUSY;
305}
306
Kristen Carlson Accardi78128032011-05-10 14:23:45 +0100307static const struct dev_pm_ops lnw_gpio_pm_ops = {
David Cohen46ebfbc2012-12-20 14:45:51 -0800308 SET_RUNTIME_PM_OPS(NULL, NULL, lnw_gpio_runtime_idle)
Kristen Carlson Accardi78128032011-05-10 14:23:45 +0100309};
310
Bill Pemberton38363092012-11-19 13:22:34 -0500311static int lnw_gpio_probe(struct pci_dev *pdev,
Andy Shevchenko64c8cbc2013-05-22 13:20:11 +0300312 const struct pci_device_id *id)
Alek Du8bf02612009-09-22 16:46:36 -0700313{
Andy Shevchenko64c8cbc2013-05-22 13:20:11 +0300314 void __iomem *base;
Alek Du8bf02612009-09-22 16:46:36 -0700315 struct lnw_gpio *lnw;
Alek Du8bf02612009-09-22 16:46:36 -0700316 u32 gpio_base;
David Cohen2519f9a2013-05-06 16:11:03 -0700317 u32 irq_base;
Julia Lawalld6a2b7b2012-08-05 11:52:34 +0200318 int retval;
Mika Westerbergb3e35af2012-04-05 12:15:16 +0300319 int ngpio = id->driver_data;
Alek Du8bf02612009-09-22 16:46:36 -0700320
Andy Shevchenko786e07e2013-05-22 13:20:12 +0300321 retval = pcim_enable_device(pdev);
Alek Du8bf02612009-09-22 16:46:36 -0700322 if (retval)
Mika Westerberg8302c742012-04-05 12:15:15 +0300323 return retval;
Alek Du8bf02612009-09-22 16:46:36 -0700324
Andy Shevchenko786e07e2013-05-22 13:20:12 +0300325 retval = pcim_iomap_regions(pdev, 1 << 0 | 1 << 1, pci_name(pdev));
Alek Du8bf02612009-09-22 16:46:36 -0700326 if (retval) {
Andy Shevchenko786e07e2013-05-22 13:20:12 +0300327 dev_err(&pdev->dev, "I/O memory mapping error\n");
328 return retval;
Alek Du8bf02612009-09-22 16:46:36 -0700329 }
Andy Shevchenko786e07e2013-05-22 13:20:12 +0300330
331 base = pcim_iomap_table(pdev)[1];
Andy Shevchenko64c8cbc2013-05-22 13:20:11 +0300332
333 irq_base = readl(base);
334 gpio_base = readl(sizeof(u32) + base);
335
Alek Du8bf02612009-09-22 16:46:36 -0700336 /* release the IO mapping, since we already get the info from bar1 */
Andy Shevchenko786e07e2013-05-22 13:20:12 +0300337 pcim_iounmap_regions(pdev, 1 << 1);
Alek Du8bf02612009-09-22 16:46:36 -0700338
David Cohen46ebfbc2012-12-20 14:45:51 -0800339 lnw = devm_kzalloc(&pdev->dev, sizeof(*lnw), GFP_KERNEL);
Alek Du8bf02612009-09-22 16:46:36 -0700340 if (!lnw) {
Andy Shevchenko8aca1192013-05-22 13:20:13 +0300341 dev_err(&pdev->dev, "can't allocate chip data\n");
Andy Shevchenko786e07e2013-05-22 13:20:12 +0300342 return -ENOMEM;
Alek Du8bf02612009-09-22 16:46:36 -0700343 }
Mika Westerbergb3e35af2012-04-05 12:15:16 +0300344
Andy Shevchenko786e07e2013-05-22 13:20:12 +0300345 lnw->reg_base = pcim_iomap_table(pdev)[0];
Alek Du8bf02612009-09-22 16:46:36 -0700346 lnw->chip.label = dev_name(&pdev->dev);
Adrian Hunter8c0f7b12011-10-03 14:36:07 +0300347 lnw->chip.request = lnw_gpio_request;
Alek Du8bf02612009-09-22 16:46:36 -0700348 lnw->chip.direction_input = lnw_gpio_direction_input;
349 lnw->chip.direction_output = lnw_gpio_direction_output;
350 lnw->chip.get = lnw_gpio_get;
351 lnw->chip.set = lnw_gpio_set;
352 lnw->chip.to_irq = lnw_gpio_to_irq;
353 lnw->chip.base = gpio_base;
Mika Westerbergb3e35af2012-04-05 12:15:16 +0300354 lnw->chip.ngpio = ngpio;
Alek Du8bf02612009-09-22 16:46:36 -0700355 lnw->chip.can_sleep = 0;
Kristen Carlson Accardi78128032011-05-10 14:23:45 +0100356 lnw->pdev = pdev;
David Cohen2519f9a2013-05-06 16:11:03 -0700357
Andy Shevchenkoaeb168f2013-05-22 13:20:10 +0300358 spin_lock_init(&lnw->lock);
359
David Cohen2519f9a2013-05-06 16:11:03 -0700360 lnw->domain = irq_domain_add_simple(pdev->dev.of_node, ngpio, irq_base,
361 &lnw_gpio_irq_ops, lnw);
Andy Shevchenko786e07e2013-05-22 13:20:12 +0300362 if (!lnw->domain)
363 return -ENOMEM;
David Cohen2519f9a2013-05-06 16:11:03 -0700364
Alek Du8bf02612009-09-22 16:46:36 -0700365 pci_set_drvdata(pdev, lnw);
366 retval = gpiochip_add(&lnw->chip);
367 if (retval) {
Andy Shevchenko8aca1192013-05-22 13:20:13 +0300368 dev_err(&pdev->dev, "gpiochip_add error %d\n", retval);
Andy Shevchenko786e07e2013-05-22 13:20:12 +0300369 return retval;
Alek Du8bf02612009-09-22 16:46:36 -0700370 }
Mika Westerbergf5f93112012-04-05 12:15:17 +0300371
372 lnw_irq_init_hw(lnw);
373
Thomas Gleixner674db902011-03-17 19:32:52 +0000374 irq_set_handler_data(pdev->irq, lnw);
375 irq_set_chained_handler(pdev->irq, lnw_irq_handler);
Alek Du8bf02612009-09-22 16:46:36 -0700376
Kristen Carlson Accardi78128032011-05-10 14:23:45 +0100377 pm_runtime_put_noidle(&pdev->dev);
378 pm_runtime_allow(&pdev->dev);
379
Mika Westerberg8302c742012-04-05 12:15:15 +0300380 return 0;
Alek Du8bf02612009-09-22 16:46:36 -0700381}
382
383static struct pci_driver lnw_gpio_driver = {
384 .name = "langwell_gpio",
385 .id_table = lnw_gpio_ids,
386 .probe = lnw_gpio_probe,
Kristen Carlson Accardi78128032011-05-10 14:23:45 +0100387 .driver = {
388 .pm = &lnw_gpio_pm_ops,
389 },
Alek Du8bf02612009-09-22 16:46:36 -0700390};
391
392static int __init lnw_gpio_init(void)
393{
Andy Shevchenko10b20a92013-06-17 16:57:06 +0300394 return pci_register_driver(&lnw_gpio_driver);
Alek Du8bf02612009-09-22 16:46:36 -0700395}
396
397device_initcall(lnw_gpio_init);