2 * arch/arm/plat-iop/gpio.c
3 * GPIO handling for Intel IOP3xx processors.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or (at
10 * your option) any later version.
13 #include <linux/err.h>
14 #include <linux/module.h>
15 #include <linux/gpio/driver.h>
16 #include <linux/platform_device.h>
18 #define IOP3XX_GPOE 0x0000
19 #define IOP3XX_GPID 0x0004
20 #define IOP3XX_GPOD 0x0008
22 static int iop3xx_gpio_probe(struct platform_device *pdev)
28 gc = devm_kzalloc(&pdev->dev, sizeof(*gc), GFP_KERNEL);
32 base = devm_platform_ioremap_resource(pdev, 0);
36 err = bgpio_init(gc, &pdev->dev, 1, base + IOP3XX_GPID,
37 base + IOP3XX_GPOD, NULL, NULL, base + IOP3XX_GPOE, 0);
42 gc->owner = THIS_MODULE;
44 return devm_gpiochip_add_data(&pdev->dev, gc, NULL);
47 static struct platform_driver iop3xx_gpio_driver = {
51 .probe = iop3xx_gpio_probe,
54 static int __init iop3xx_gpio_init(void)
56 return platform_driver_register(&iop3xx_gpio_driver);
58 arch_initcall(iop3xx_gpio_init);
60 MODULE_DESCRIPTION("GPIO handling for Intel IOP3xx processors");
62 MODULE_LICENSE("GPL");