public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix•de>
To: Oleksandr Suvorov <oleksandr.suvorov@toradex•com>,
	linux-next@vger•kernel.org
Cc: Igor Opaniuk <igor.opaniuk@toradex•com>,
	Marcel Ziswiler <marcel.ziswiler@toradex•com>,
	linux-kernel@vger•kernel.org,
	Philippe Schenker <philippe.schenker@toradex•com>,
	Maxime Coquelin <mcoquelin.stm32@gmail•com>,
	Lee Jones <lee.jones@linaro•org>,
	linux-stm32@st-md-mailman•stormreply.com,
	linux-arm-kernel@lists•infradead.org
Subject: Re: [Linux-stm32] [PATCH] mfd: stmpe: Support disabling sub-functions
Date: Sat, 26 Dec 2020 16:50:17 +0100	[thread overview]
Message-ID: <bf750784-eb4a-675a-2ec4-bc52283dcc9a@pengutronix.de> (raw)
In-Reply-To: <20201226094722.16580-1-oleksandr.suvorov@toradex.com>

Hello Oleksander,

On 26.12.20 10:47, Oleksandr Suvorov wrote:
> 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>
> ---
> 
>  drivers/mfd/stmpe.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
> index 90f3292230c9..2182607b75f6 100644
> --- a/drivers/mfd/stmpe.c
> +++ b/drivers/mfd/stmpe.c
> @@ -1358,6 +1358,9 @@ static void stmpe_of_probe(struct stmpe_platform_data *pdata,
>  	pdata->autosleep = (pdata->autosleep_timeout) ? true : false;
>  
>  		(np, child) {
> +		/* skip disabled sub-function */
> +		if (!of_device_is_available(child))
> +			continue;

Better use for_each_available_child_of_node().

>  		if (of_node_name_eq(child, "stmpe_gpio")) {
>  			pdata->blocks |= STMPE_BLOCK_GPIO;
>  		} else if (of_node_name_eq(child, "stmpe_keypad")) {
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

  reply	other threads:[~2020-12-26 15:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-26  9:47 [PATCH] mfd: stmpe: Support disabling sub-functions Oleksandr Suvorov
2020-12-26 15:50 ` Ahmad Fatoum [this message]
2020-12-26 16:28   ` [PATCH v2] " Oleksandr Suvorov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bf750784-eb4a-675a-2ec4-bc52283dcc9a@pengutronix.de \
    --to=a.fatoum@pengutronix$(echo .)de \
    --cc=igor.opaniuk@toradex$(echo .)com \
    --cc=lee.jones@linaro$(echo .)org \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=linux-stm32@st-md-mailman$(echo .)stormreply.com \
    --cc=marcel.ziswiler@toradex$(echo .)com \
    --cc=mcoquelin.stm32@gmail$(echo .)com \
    --cc=oleksandr.suvorov@toradex$(echo .)com \
    --cc=philippe.schenker@toradex$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox