diff mbox series

mfd: stmpe: Support disabling sub-functions

Message ID 20211027082155.206449-1-francesco.dolcini@toradex.com (mailing list archive)
State New, archived
Headers show
Series mfd: stmpe: Support disabling sub-functions | expand

Commit Message

Francesco Dolcini Oct. 27, 2021, 8:21 a.m. UTC
From: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

Add support of sub-functions disabling. It allows one to define
an stmpe sub-function device in devicetree, but keep it disabled.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Cc: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
Hello,
the main reason for this patch is to allow enabling/disabling sub-fuctions
using DTS overlay to enable more flexibility on SoM/Carrier boards
combinations.
---
 drivers/mfd/stmpe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marcel Ziswiler Oct. 27, 2021, 4:14 p.m. UTC | #1
Hi Francesco

On Wed, 2021-10-27 at 10:21 +0200, Francesco Dolcini wrote:
> From: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
> 
> Add support of sub-functions disabling. It allows one to define
> an stmpe sub-function device in devicetree, but keep it disabled.
> 
> Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
> Cc: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>

Reviewed-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>

> ---
> Hello,
> the main reason for this patch is to allow enabling/disabling sub-fuctions

:s/sub-fuctions/sub-functions/

> using DTS overlay to enable more flexibility on SoM/Carrier boards

:s/boards/board/

> combinations.
> ---
>  drivers/mfd/stmpe.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
> index e928df95e316..aeb9ea55f97d 100644
> --- a/drivers/mfd/stmpe.c
> +++ b/drivers/mfd/stmpe.c
> @@ -1361,7 +1361,7 @@ static void stmpe_of_probe(struct stmpe_platform_data *pdata,
>  
>         pdata->autosleep = (pdata->autosleep_timeout) ? true : false;
>  
> -       for_each_child_of_node(np, child) {
> +       for_each_available_child_of_node(np, child) {
>                 if (of_node_name_eq(child, "stmpe_gpio")) {
>                         pdata->blocks |= STMPE_BLOCK_GPIO;
>                 } else if (of_node_name_eq(child, "stmpe_keypad")) {

Cheers

Marcel
Linus Walleij Oct. 28, 2021, 12:37 a.m. UTC | #2
On Wed, Oct 27, 2021 at 10:23 AM Francesco Dolcini
<francesco.dolcini@toradex.com> wrote:

> From: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
>
> Add support of sub-functions disabling. It allows one to define
> an stmpe sub-function device in devicetree, but keep it disabled.
>
> Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
> Cc: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>

Looks helpful.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Francesco Dolcini Nov. 1, 2021, 9:48 a.m. UTC | #3
On Wed, Oct 27, 2021 at 10:21:55AM +0200, Francesco Dolcini wrote:
> From: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
> 
> Add support of sub-functions disabling. It allows one to define
> an stmpe sub-function device in devicetree, but keep it disabled.
> 
> Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
> Cc: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>

Hello Lee,
any chance you could take this one line patch for this merge window?

Francesco
Lee Jones Nov. 1, 2021, 12:13 p.m. UTC | #4
On Mon, 01 Nov 2021, Francesco Dolcini wrote:

> On Wed, Oct 27, 2021 at 10:21:55AM +0200, Francesco Dolcini wrote:
> > From: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
> > 
> > Add support of sub-functions disabling. It allows one to define
> > an stmpe sub-function device in devicetree, but keep it disabled.
> > 
> > Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
> > Cc: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
> > Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> 
> Hello Lee,
> any chance you could take this one line patch for this merge window?

For a patch sent 0.5 weeks before the merge-window?  Nope. :)
Francesco Dolcini Nov. 2, 2021, 8:21 a.m. UTC | #5
On Mon, Nov 01, 2021 at 12:13:23PM +0000, Lee Jones wrote:
> On Mon, 01 Nov 2021, Francesco Dolcini wrote:
> > Hello Lee,
> > any chance you could take this one line patch for this merge window?
> 
> For a patch sent 0.5 weeks before the merge-window?  Nope. :)

Hello Lee,
no problem, I thought it was that trivial to not create any worries.
I'll resend it in a while unless you take it before.

Francesco
Lee Jones Nov. 2, 2021, 10:48 a.m. UTC | #6
On Tue, 02 Nov 2021, Francesco Dolcini wrote:

> On Mon, Nov 01, 2021 at 12:13:23PM +0000, Lee Jones wrote:
> > On Mon, 01 Nov 2021, Francesco Dolcini wrote:
> > > Hello Lee,
> > > any chance you could take this one line patch for this merge window?
> > 
> > For a patch sent 0.5 weeks before the merge-window?  Nope. :)
> 
> Hello Lee,
> no problem, I thought it was that trivial to not create any worries.
> I'll resend it in a while unless you take it before.

I like *all* patches to have a soak in -next.

You don't need to resend it.  I'll apply it in due course.
Lee Jones Nov. 24, 2021, 3:45 p.m. UTC | #7
On Wed, 27 Oct 2021, Francesco Dolcini wrote:

> From: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
> 
> Add support of sub-functions disabling. It allows one to define
> an stmpe sub-function device in devicetree, but keep it disabled.
> 
> Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
> Cc: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> ---
> Hello,
> the main reason for this patch is to allow enabling/disabling sub-fuctions
> using DTS overlay to enable more flexibility on SoM/Carrier boards
> combinations.
> ---
>  drivers/mfd/stmpe.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.
diff mbox series

Patch

diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
index e928df95e316..aeb9ea55f97d 100644
--- a/drivers/mfd/stmpe.c
+++ b/drivers/mfd/stmpe.c
@@ -1361,7 +1361,7 @@  static void stmpe_of_probe(struct stmpe_platform_data *pdata,
 
 	pdata->autosleep = (pdata->autosleep_timeout) ? true : false;
 
-	for_each_child_of_node(np, child) {
+	for_each_available_child_of_node(np, child) {
 		if (of_node_name_eq(child, "stmpe_gpio")) {
 			pdata->blocks |= STMPE_BLOCK_GPIO;
 		} else if (of_node_name_eq(child, "stmpe_keypad")) {