diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2016-02-14 16:07:07 +0300 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2016-03-16 11:50:37 +0300 |
commit | b273c5e0b65a98003e6fde6bf2eeba15d1ce8cf4 (patch) | |
tree | 8003fbe853bbb53fc5454b3849eccc8a4b442c4b /drivers/mfd | |
parent | 5c1488906f852473b4d7837c3e33e411e0eb6910 (diff) | |
download | linux-b273c5e0b65a98003e6fde6bf2eeba15d1ce8cf4.tar.xz |
mfd: stmpe: Add the proper PWM resources
This adds the PWM resources to the STMPE MFD driver, so that
it can properly grab and use them.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/stmpe.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c index 8222e374e4b1..fb8f9e8b75df 100644 --- a/drivers/mfd/stmpe.c +++ b/drivers/mfd/stmpe.c @@ -334,6 +334,31 @@ static const struct mfd_cell stmpe_keypad_cell = { }; /* + * PWM (1601, 2401, 2403) + */ +static struct resource stmpe_pwm_resources[] = { + { + .name = "PWM0", + .flags = IORESOURCE_IRQ, + }, + { + .name = "PWM1", + .flags = IORESOURCE_IRQ, + }, + { + .name = "PWM2", + .flags = IORESOURCE_IRQ, + }, +}; + +static const struct mfd_cell stmpe_pwm_cell = { + .name = "stmpe-pwm", + .of_compatible = "st,stmpe-pwm", + .resources = stmpe_pwm_resources, + .num_resources = ARRAY_SIZE(stmpe_pwm_resources), +}; + +/* * STMPE801 */ static const u8 stmpe801_regs[] = { @@ -537,6 +562,11 @@ static struct stmpe_variant_block stmpe1601_blocks[] = { .irq = STMPE1601_IRQ_KEYPAD, .block = STMPE_BLOCK_KEYPAD, }, + { + .cell = &stmpe_pwm_cell, + .irq = STMPE1601_IRQ_PWM0, + .block = STMPE_BLOCK_PWM, + }, }; /* supported autosleep timeout delay (in msecs) */ @@ -771,6 +801,11 @@ static struct stmpe_variant_block stmpe24xx_blocks[] = { .irq = STMPE24XX_IRQ_KEYPAD, .block = STMPE_BLOCK_KEYPAD, }, + { + .cell = &stmpe_pwm_cell, + .irq = STMPE24XX_IRQ_PWM0, + .block = STMPE_BLOCK_PWM, + }, }; static int stmpe24xx_enable(struct stmpe *stmpe, unsigned int blocks, |