@@ -78,6 +78,7 @@
#define AB8500_NUM_GPIO 42
#define AB9540_NUM_GPIO 54
#define AB8505_NUM_GPIO 53
+#define AB8540_NUM_GPIO 56
#define AB8500_NUM_VIR_GPIO_IRQ 16
enum ab8500_gpio_action {
@@ -146,6 +147,15 @@ static struct ab8500_gpio_irq_cluster ab8505_irq_clusters[] = {
{.start = 51, .end = 52},
};
+/*
+ * For AB8540 Only some GPIOs are interrupt capable:
+ * GPIO51 to GPIO54
+ */
+static struct ab8500_gpio_irq_cluster ab8540_irq_clusters[] = {
+ {.start = 50, .end = 53}, /* GPIO numbers start from 1 */
+};
+
+
/**
* to_ab8500_gpio() - get the pointer to ab8500_gpio
* @chip: Member of the structure ab8500_gpio
@@ -483,7 +493,14 @@ static int __devinit ab8500_gpio_probe(struct platform_device *pdev)
ab8500_gpio->irq_base = pdata->irq_base;
/* Configure GPIO Settings for specific AB devices */
- if (is_ab9540(parent)) {
+ if (is_ab8540(parent)) {
+ ab8500_gpio->chip.ngpio = AB8540_NUM_GPIO;
+ ab8500_gpio->irq_cluster = ab8540_irq_clusters;
+ ab8500_gpio->irq_cluster_size =
+ ARRAY_SIZE(ab8540_irq_clusters);
+ last_gpio_sel_reg = AB9540_GPIO_SEL7_REG;
+ altfun_reg_index = AB9540_ALTFUN_REG_INDEX;
+ } else if (is_ab9540(parent)) {
ab8500_gpio->chip.ngpio = AB9540_NUM_GPIO;
ab8500_gpio->irq_cluster = ab9540_irq_clusters;
ab8500_gpio->irq_cluster_size =