aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2016-02-14 08:07:07 -0500
committerLee Jones <lee.jones@linaro.org>2016-03-16 04:50:37 -0400
commitb273c5e0b65a98003e6fde6bf2eeba15d1ce8cf4 (patch)
tree8003fbe853bbb53fc5454b3849eccc8a4b442c4b
parent5c1488906f852473b4d7837c3e33e411e0eb6910 (diff)
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>
-rw-r--r--drivers/mfd/stmpe.c35
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 = {
334}; 334};
335 335
336/* 336/*
337 * PWM (1601, 2401, 2403)
338 */
339static struct resource stmpe_pwm_resources[] = {
340 {
341 .name = "PWM0",
342 .flags = IORESOURCE_IRQ,
343 },
344 {
345 .name = "PWM1",
346 .flags = IORESOURCE_IRQ,
347 },
348 {
349 .name = "PWM2",
350 .flags = IORESOURCE_IRQ,
351 },
352};
353
354static const struct mfd_cell stmpe_pwm_cell = {
355 .name = "stmpe-pwm",
356 .of_compatible = "st,stmpe-pwm",
357 .resources = stmpe_pwm_resources,
358 .num_resources = ARRAY_SIZE(stmpe_pwm_resources),
359};
360
361/*
337 * STMPE801 362 * STMPE801
338 */ 363 */
339static const u8 stmpe801_regs[] = { 364static const u8 stmpe801_regs[] = {
@@ -537,6 +562,11 @@ static struct stmpe_variant_block stmpe1601_blocks[] = {
537 .irq = STMPE1601_IRQ_KEYPAD, 562 .irq = STMPE1601_IRQ_KEYPAD,
538 .block = STMPE_BLOCK_KEYPAD, 563 .block = STMPE_BLOCK_KEYPAD,
539 }, 564 },
565 {
566 .cell = &stmpe_pwm_cell,
567 .irq = STMPE1601_IRQ_PWM0,
568 .block = STMPE_BLOCK_PWM,
569 },
540}; 570};
541 571
542/* supported autosleep timeout delay (in msecs) */ 572/* supported autosleep timeout delay (in msecs) */
@@ -771,6 +801,11 @@ static struct stmpe_variant_block stmpe24xx_blocks[] = {
771 .irq = STMPE24XX_IRQ_KEYPAD, 801 .irq = STMPE24XX_IRQ_KEYPAD,
772 .block = STMPE_BLOCK_KEYPAD, 802 .block = STMPE_BLOCK_KEYPAD,
773 }, 803 },
804 {
805 .cell = &stmpe_pwm_cell,
806 .irq = STMPE24XX_IRQ_PWM0,
807 .block = STMPE_BLOCK_PWM,
808 },
774}; 809};
775 810
776static int stmpe24xx_enable(struct stmpe *stmpe, unsigned int blocks, 811static int stmpe24xx_enable(struct stmpe *stmpe, unsigned int blocks,