aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2015-11-12 10:39:59 +0100
committerLinus Walleij <linus.walleij@linaro.org>2016-02-05 13:53:49 +0100
commiteff03d24104d5d75e24effa9f192b13f48f30f35 (patch)
tree3931dbb5397e69d8767a659fb31d02ffbe87a3b4
parentf3eae1f82b9511d84c7f9f930b8ad5bfe3ba7688 (diff)
pinctrl: abx500: remove IRQ cluster handling
This hardcoded IRQ cluster handling is messy now that the drivers are all-devicetree. Instead of these hard-coded clusters, we will pass the interrupts from the devicetree to the GPIO node of the ABx500 like is done for the other subdrivers. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/pinctrl/nomadik/pinctrl-ab8500.c19
-rw-r--r--drivers/pinctrl/nomadik/pinctrl-ab8505.c23
-rw-r--r--drivers/pinctrl/nomadik/pinctrl-ab8540.c16
-rw-r--r--drivers/pinctrl/nomadik/pinctrl-ab9540.c12
-rw-r--r--drivers/pinctrl/nomadik/pinctrl-abx500.c33
-rw-r--r--drivers/pinctrl/nomadik/pinctrl-abx500.h37
6 files changed, 0 insertions, 140 deletions
diff --git a/drivers/pinctrl/nomadik/pinctrl-ab8500.c b/drivers/pinctrl/nomadik/pinctrl-ab8500.c
index 2ac2d0ad3025..caa6285070cf 100644
--- a/drivers/pinctrl/nomadik/pinctrl-ab8500.c
+++ b/drivers/pinctrl/nomadik/pinctrl-ab8500.c
@@ -448,20 +448,6 @@ alternate_functions ab8500_alternate_functions[AB8500_GPIO_MAX_NUMBER + 1] = {
ALTERNATE_FUNCTIONS(42, 1, UNUSED, UNUSED, 0, 0, 0), /* GPIO42, altA controlled by bit 1 */
};
-/*
- * Only some GPIOs are interrupt capable, and they are
- * organized in discontiguous clusters:
- *
- * GPIO6 to GPIO13
- * GPIO24 and GPIO25
- * GPIO36 to GPIO41
- */
-static struct abx500_gpio_irq_cluster ab8500_gpio_irq_cluster[] = {
- GPIO_IRQ_CLUSTER(6, 13, AB8500_INT_GPIO6R),
- GPIO_IRQ_CLUSTER(24, 25, AB8500_INT_GPIO24R),
- GPIO_IRQ_CLUSTER(36, 41, AB8500_INT_GPIO36R),
-};
-
static struct abx500_pinctrl_soc_data ab8500_soc = {
.gpio_ranges = ab8500_pinranges,
.gpio_num_ranges = ARRAY_SIZE(ab8500_pinranges),
@@ -472,11 +458,6 @@ static struct abx500_pinctrl_soc_data ab8500_soc = {
.groups = ab8500_groups,
.ngroups = ARRAY_SIZE(ab8500_groups),
.alternate_functions = ab8500_alternate_functions,
- .gpio_irq_cluster = ab8500_gpio_irq_cluster,
- .ngpio_irq_cluster = ARRAY_SIZE(ab8500_gpio_irq_cluster),
- .irq_gpio_rising_offset = AB8500_INT_GPIO6R,
- .irq_gpio_falling_offset = AB8500_INT_GPIO6F,
- .irq_gpio_factor = 1,
};
void abx500_pinctrl_ab8500_init(struct abx500_pinctrl_soc_data **soc)
diff --git a/drivers/pinctrl/nomadik/pinctrl-ab8505.c b/drivers/pinctrl/nomadik/pinctrl-ab8505.c
index 42c6e1f7886b..465fc78bd91a 100644
--- a/drivers/pinctrl/nomadik/pinctrl-ab8505.c
+++ b/drivers/pinctrl/nomadik/pinctrl-ab8505.c
@@ -339,24 +339,6 @@ alternate_functions ab8505_alternate_functions[AB8505_GPIO_MAX_NUMBER + 1] = {
ALTERNATE_FUNCTIONS(53, 4, UNUSED, UNUSED, 0, 0, 0), /* GPIO53, altA controlled by bit 4 */
};
-/*
- * For AB8505 Only some GPIOs are interrupt capable, and they are
- * organized in discontiguous clusters:
- *
- * GPIO10 to GPIO11
- * GPIO13
- * GPIO40 and GPIO41
- * GPIO50
- * GPIO52 to GPIO53
- */
-static struct abx500_gpio_irq_cluster ab8505_gpio_irq_cluster[] = {
- GPIO_IRQ_CLUSTER(10, 11, AB8500_INT_GPIO10R),
- GPIO_IRQ_CLUSTER(13, 13, AB8500_INT_GPIO13R),
- GPIO_IRQ_CLUSTER(40, 41, AB8500_INT_GPIO40R),
- GPIO_IRQ_CLUSTER(50, 50, AB9540_INT_GPIO50R),
- GPIO_IRQ_CLUSTER(52, 53, AB9540_INT_GPIO52R),
-};
-
static struct abx500_pinctrl_soc_data ab8505_soc = {
.gpio_ranges = ab8505_pinranges,
.gpio_num_ranges = ARRAY_SIZE(ab8505_pinranges),
@@ -367,11 +349,6 @@ static struct abx500_pinctrl_soc_data ab8505_soc = {
.groups = ab8505_groups,
.ngroups = ARRAY_SIZE(ab8505_groups),
.alternate_functions = ab8505_alternate_functions,
- .gpio_irq_cluster = ab8505_gpio_irq_cluster,
- .ngpio_irq_cluster = ARRAY_SIZE(ab8505_gpio_irq_cluster),
- .irq_gpio_rising_offset = AB8500_INT_GPIO6R,
- .irq_gpio_falling_offset = AB8500_INT_GPIO6F,
- .irq_gpio_factor = 1,
};
void
diff --git a/drivers/pinctrl/nomadik/pinctrl-ab8540.c b/drivers/pinctrl/nomadik/pinctrl-ab8540.c
index 9867535d49c1..8a55a5f6a8b7 100644
--- a/drivers/pinctrl/nomadik/pinctrl-ab8540.c
+++ b/drivers/pinctrl/nomadik/pinctrl-ab8540.c
@@ -372,17 +372,6 @@ static struct pullud ab8540_pullud = {
.last_pin = 54, /* GPIO4_VBAT */
};
-/*
- * For AB8540 Only some GPIOs are interrupt capable:
- * GPIO43 to GPIO44
- * GPIO51 to GPIO54
- */
-static struct abx500_gpio_irq_cluster ab8540_gpio_irq_cluster[] = {
- GPIO_IRQ_CLUSTER(43, 43, AB8540_INT_GPIO43F),
- GPIO_IRQ_CLUSTER(44, 44, AB8540_INT_GPIO44F),
- GPIO_IRQ_CLUSTER(51, 54, AB9540_INT_GPIO51R),
-};
-
static struct abx500_pinctrl_soc_data ab8540_soc = {
.gpio_ranges = ab8540_pinranges,
.gpio_num_ranges = ARRAY_SIZE(ab8540_pinranges),
@@ -394,11 +383,6 @@ static struct abx500_pinctrl_soc_data ab8540_soc = {
.ngroups = ARRAY_SIZE(ab8540_groups),
.alternate_functions = ab8540_alternate_functions,
.pullud = &ab8540_pullud,
- .gpio_irq_cluster = ab8540_gpio_irq_cluster,
- .ngpio_irq_cluster = ARRAY_SIZE(ab8540_gpio_irq_cluster),
- .irq_gpio_rising_offset = AB8540_INT_GPIO43R,
- .irq_gpio_falling_offset = AB8540_INT_GPIO43F,
- .irq_gpio_factor = 2,
};
void
diff --git a/drivers/pinctrl/nomadik/pinctrl-ab9540.c b/drivers/pinctrl/nomadik/pinctrl-ab9540.c
index 1a281ca95dac..a7d101c42492 100644
--- a/drivers/pinctrl/nomadik/pinctrl-ab9540.c
+++ b/drivers/pinctrl/nomadik/pinctrl-ab9540.c
@@ -455,13 +455,6 @@ alternate_functions ab9540alternate_functions[AB9540_GPIO_MAX_NUMBER + 1] = {
ALTERNATE_FUNCTIONS(54, 5, UNUSED, UNUSED, 0, 0, 0), /* GPIO54 = GPIO60, altA controlled by bit 5 */
};
-static struct abx500_gpio_irq_cluster ab9540_gpio_irq_cluster[] = {
- GPIO_IRQ_CLUSTER(10, 13, AB8500_INT_GPIO10R),
- GPIO_IRQ_CLUSTER(24, 25, AB8500_INT_GPIO24R),
- GPIO_IRQ_CLUSTER(40, 41, AB8500_INT_GPIO40R),
- GPIO_IRQ_CLUSTER(50, 54, AB9540_INT_GPIO50R),
-};
-
static struct abx500_pinctrl_soc_data ab9540_soc = {
.gpio_ranges = ab9540_pinranges,
.gpio_num_ranges = ARRAY_SIZE(ab9540_pinranges),
@@ -472,11 +465,6 @@ static struct abx500_pinctrl_soc_data ab9540_soc = {
.groups = ab9540_groups,
.ngroups = ARRAY_SIZE(ab9540_groups),
.alternate_functions = ab9540alternate_functions,
- .gpio_irq_cluster = ab9540_gpio_irq_cluster,
- .ngpio_irq_cluster = ARRAY_SIZE(ab9540_gpio_irq_cluster),
- .irq_gpio_rising_offset = AB8500_INT_GPIO6R,
- .irq_gpio_falling_offset = AB8500_INT_GPIO6F,
- .irq_gpio_factor = 1,
};
void
diff --git a/drivers/pinctrl/nomadik/pinctrl-abx500.c b/drivers/pinctrl/nomadik/pinctrl-abx500.c
index b59fbb4b1fb1..72c4a40a22fb 100644
--- a/drivers/pinctrl/nomadik/pinctrl-abx500.c
+++ b/drivers/pinctrl/nomadik/pinctrl-abx500.c
@@ -105,8 +105,6 @@ struct abx500_pinctrl {
struct abx500_pinctrl_soc_data *soc;
struct gpio_chip chip;
struct ab8500 *parent;
- struct abx500_gpio_irq_cluster *irq_cluster;
- int irq_cluster_size;
};
/**
@@ -330,33 +328,6 @@ static int abx500_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
ABX500_GPIO_INPUT);
}
-static int abx500_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
-{
- struct abx500_pinctrl *pct = to_abx500_pinctrl(chip);
- /* The AB8500 GPIO numbers are off by one */
- int gpio = offset + 1;
- int hwirq;
- int i;
-
- for (i = 0; i < pct->irq_cluster_size; i++) {
- struct abx500_gpio_irq_cluster *cluster =
- &pct->irq_cluster[i];
-
- if (gpio >= cluster->start && gpio <= cluster->end) {
- /*
- * The ABx500 GPIO's associated IRQs are clustered together
- * throughout the interrupt numbers at irregular intervals.
- * To solve this quandry, we have placed the read-in values
- * into the cluster information table.
- */
- hwirq = gpio - cluster->start + cluster->to_irq;
- return irq_create_mapping(pct->parent->domain, hwirq);
- }
- }
-
- return -EINVAL;
-}
-
static int abx500_set_mode(struct pinctrl_dev *pctldev, struct gpio_chip *chip,
unsigned gpio, int alt_setting)
{
@@ -624,7 +595,6 @@ static void abx500_gpio_dbg_show_one(struct seq_file *s,
mode = abx500_get_mode(pctldev, chip, offset);
seq_printf(s, " %s", (mode < 0) ? "unknown" : modes[mode]);
-
out:
if (ret < 0)
dev_err(pct->dev, "%s failed (%d)\n", __func__, ret);
@@ -663,7 +633,6 @@ static struct gpio_chip abx500gpio_chip = {
.get = abx500_gpio_get,
.direction_output = abx500_gpio_direction_output,
.set = abx500_gpio_set,
- .to_irq = abx500_gpio_to_irq,
.dbg_show = abx500_gpio_dbg_show,
};
@@ -1207,8 +1176,6 @@ static int abx500_gpio_probe(struct platform_device *pdev)
}
pct->chip.ngpio = abx500_get_gpio_num(pct->soc);
- pct->irq_cluster = pct->soc->gpio_irq_cluster;
- pct->irq_cluster_size = pct->soc->ngpio_irq_cluster;
ret = gpiochip_add(&pct->chip);
if (ret) {
diff --git a/drivers/pinctrl/nomadik/pinctrl-abx500.h b/drivers/pinctrl/nomadik/pinctrl-abx500.h
index 2beef3bfe9ca..5551d7ae53fd 100644
--- a/drivers/pinctrl/nomadik/pinctrl-abx500.h
+++ b/drivers/pinctrl/nomadik/pinctrl-abx500.h
@@ -106,30 +106,6 @@ struct pullud {
unsigned last_pin;
};
-#define GPIO_IRQ_CLUSTER(a, b, c) \
-{ \
- .start = a, \
- .end = b, \
- .to_irq = c, \
-}
-
-/**
- * struct abx500_gpio_irq_cluster - indicates GPIOs which are interrupt
- * capable
- * @start: The pin number of the first pin interrupt capable
- * @end: The pin number of the last pin interrupt capable
- * @to_irq: The ABx500 GPIO's associated IRQs are clustered
- * together throughout the interrupt numbers at irregular
- * intervals. To solve this quandary, we will place the
- * read-in values into the cluster information table
- */
-
-struct abx500_gpio_irq_cluster {
- int start;
- int end;
- int to_irq;
-};
-
/**
* struct abx500_pinrange - map pin numbers to GPIO offsets
* @offset: offset into the GPIO local numberspace, incidentally
@@ -163,14 +139,6 @@ struct abx500_pinrange {
* how to set it.
* @pullud: array describing pins which supports pull up/down
* specific registers.
- * @gpio_irq_cluster: An array of GPIO interrupt capable for this SoC
- * @ngpio_irq_cluster: The number of GPIO inetrrupt capable for this SoC
- * @irq_gpio_rising_offset: Interrupt offset used as base to compute specific
- * setting strategy of the rising interrupt line
- * @irq_gpio_falling_offset: Interrupt offset used as base to compute specific
- * setting strategy of the falling interrupt line
- * @irq_gpio_factor: Factor used to compute specific setting strategy of
- * the interrupt line
*/
struct abx500_pinctrl_soc_data {
@@ -184,11 +152,6 @@ struct abx500_pinctrl_soc_data {
unsigned ngroups;
struct alternate_functions *alternate_functions;
struct pullud *pullud;
- struct abx500_gpio_irq_cluster *gpio_irq_cluster;
- unsigned ngpio_irq_cluster;
- int irq_gpio_rising_offset;
- int irq_gpio_falling_offset;
- int irq_gpio_factor;
};
#ifdef CONFIG_PINCTRL_AB8500