Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1333498 > unrolled thread
| Started by | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| First post | 2016-02-14 14:10 +0100 |
| Last post | 2016-02-15 09:40 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] mfd: stmpe: add the proper PWM resources Linus Walleij <linus.walleij@linaro.org> - 2016-02-14 14:10 +0100
Re: [PATCH] mfd: stmpe: add the proper PWM resources Lee Jones <lee.jones@linaro.org> - 2016-02-15 09:40 +0100
| From | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| Date | 2016-02-14 14:10 +0100 |
| Subject | [PATCH] mfd: stmpe: add the proper PWM resources |
| Message-ID | <r24B3-31N-3@gated-at.bofh.it> |
This adds the PWM resources to the STMPE MFD driver, so that
it can properly grab and use them.
Cc: linux-pwm@vger.kernel.org
Cc: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog: split this patch off from the PWM driver and sent
separately. This can be merged separately too so we need no
criss-cross between MFD and PWM anymore, Lee: this one is for
you if it looks all right, excess newlines are gone too.
---
drivers/mfd/stmpe.c | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
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,
--
2.4.3
[toc] | [next] | [standalone]
| From | Lee Jones <lee.jones@linaro.org> |
|---|---|
| Date | 2016-02-15 09:40 +0100 |
| Message-ID | <r2mRn-6Rc-67@gated-at.bofh.it> |
| In reply to | #1333498 |
On Sun, 14 Feb 2016, Linus Walleij wrote:
> This adds the PWM resources to the STMPE MFD driver, so that
> it can properly grab and use them.
>
> Cc: linux-pwm@vger.kernel.org
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> ChangeLog: split this patch off from the PWM driver and sent
> separately. This can be merged separately too so we need no
> criss-cross between MFD and PWM anymore, Lee: this one is for
> you if it looks all right, excess newlines are gone too.
> ---
> drivers/mfd/stmpe.c | 35 +++++++++++++++++++++++++++++++++++
> 1 file changed, 35 insertions(+)
Applied, thanks.
> 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,
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web