Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 344952
b: refs/heads/master
c: 7da0cbf
h: refs/heads/master
v: v3
  • Loading branch information
Lee Jones authored and Samuel Ortiz committed Nov 11, 2012
1 parent ed40039 commit 37b778c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8ae754ebd5edffa0b2a2bafa4879a9ace01d5477
refs/heads/master: 7da0cbfc54c82eec793ff3d1b23b7a25406c6dba
25 changes: 13 additions & 12 deletions trunk/drivers/mfd/stmpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,14 +310,10 @@ static struct mfd_cell stmpe_gpio_cell_noirq = {
static struct resource stmpe_keypad_resources[] = {
{
.name = "KEYPAD",
.start = 0,
.end = 0,
.flags = IORESOURCE_IRQ,
},
{
.name = "KEYPAD_OVER",
.start = 1,
.end = 1,
.flags = IORESOURCE_IRQ,
},
};
Expand Down Expand Up @@ -397,14 +393,10 @@ static struct stmpe_variant_info stmpe801_noirq = {
static struct resource stmpe_ts_resources[] = {
{
.name = "TOUCH_DET",
.start = 0,
.end = 0,
.flags = IORESOURCE_IRQ,
},
{
.name = "FIFO_TH",
.start = 1,
.end = 1,
.flags = IORESOURCE_IRQ,
},
};
Expand Down Expand Up @@ -959,27 +951,36 @@ static int __devinit stmpe_chip_init(struct stmpe *stmpe)
}

static int __devinit stmpe_add_device(struct stmpe *stmpe,
struct mfd_cell *cell, int irq)
struct mfd_cell *cell)
{
return mfd_add_devices(stmpe->dev, stmpe->pdata->id, cell, 1,
NULL, stmpe->irq_base + irq, NULL);
NULL, stmpe->irq_base, NULL);
}

static int __devinit stmpe_devices_init(struct stmpe *stmpe)
{
struct stmpe_variant_info *variant = stmpe->variant;
unsigned int platform_blocks = stmpe->pdata->blocks;
int ret = -EINVAL;
int i;
int i, j;

for (i = 0; i < variant->num_blocks; i++) {
struct stmpe_variant_block *block = &variant->blocks[i];

if (!(platform_blocks & block->block))
continue;

for (j = 0; j < block->cell->num_resources; j++) {
struct resource *res =
(struct resource *) &block->cell->resources[j];

/* Dynamically fill in a variant's IRQ. */
if (res->flags & IORESOURCE_IRQ)
res->start = res->end = block->irq + j;
}

platform_blocks &= ~block->block;
ret = stmpe_add_device(stmpe, block->cell, block->irq);
ret = stmpe_add_device(stmpe, block->cell);
if (ret)
return ret;
}
Expand Down

0 comments on commit 37b778c

Please sign in to comment.