From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E128BC433DB for ; Sat, 26 Dec 2020 15:51:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9F91720BED for ; Sat, 26 Dec 2020 15:51:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726280AbgLZPvM (ORCPT ); Sat, 26 Dec 2020 10:51:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725995AbgLZPvL (ORCPT ); Sat, 26 Dec 2020 10:51:11 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CCBAC061757 for ; Sat, 26 Dec 2020 07:50:30 -0800 (PST) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[IPv6:::1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1ktBpk-0008BG-43; Sat, 26 Dec 2020 16:50:20 +0100 Subject: Re: [Linux-stm32] [PATCH] mfd: stmpe: Support disabling sub-functions To: Oleksandr Suvorov , linux-next@vger.kernel.org Cc: Igor Opaniuk , Marcel Ziswiler , linux-kernel@vger.kernel.org, Philippe Schenker , Maxime Coquelin , Lee Jones , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org References: <20201226094722.16580-1-oleksandr.suvorov@toradex.com> From: Ahmad Fatoum Message-ID: Date: Sat, 26 Dec 2020 16:50:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <20201226094722.16580-1-oleksandr.suvorov@toradex.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: a.fatoum@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > > 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 | From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 138EAC433DB for ; Sat, 26 Dec 2020 15:52:18 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BDBF920855 for ; Sat, 26 Dec 2020 15:52:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BDBF920855 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=qthx7ZURQldpQmdGGjU14f05TibMLLYThLE9MnegUx4=; b=p77+jsOgL6vScwuLOQco2eXD+ rq6KKUgT2mRvGoAotXBEkw1sFvD7I/WzqTWFNw4ADmPrE/EOz6eXsQhP0tZoBH7s0ZBnmpgqJ6Jr7 qdIA4pvChvc2wZhDu16PIjB4AY2m3lgni3mElTM5XwNLOzPZSt+xQUKcJ3u1z1pQuknM73e4P7wDx UlUPuEJye0KKM4B/Da9CixSwecfq9pPs/MkUF7zImuHgbeAUeReKhEomuKVDLzqauErUGY7JYhWPB OxvZLt3qF7SZbVRwyxRWCAVQrUGN+4wM63dB7RHW5IvbgSozxdNKnHxXwokDnyA/Vu2xkDD2/7wQw zCSHgwrsA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ktBpr-0003ku-6R; Sat, 26 Dec 2020 15:50:27 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ktBpm-0003kT-UL for linux-arm-kernel@lists.infradead.org; Sat, 26 Dec 2020 15:50:25 +0000 Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[IPv6:::1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1ktBpk-0008BG-43; Sat, 26 Dec 2020 16:50:20 +0100 Subject: Re: [Linux-stm32] [PATCH] mfd: stmpe: Support disabling sub-functions To: Oleksandr Suvorov , linux-next@vger.kernel.org References: <20201226094722.16580-1-oleksandr.suvorov@toradex.com> From: Ahmad Fatoum Message-ID: Date: Sat, 26 Dec 2020 16:50:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <20201226094722.16580-1-oleksandr.suvorov@toradex.com> Content-Language: en-US X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: a.fatoum@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201226_105023_001696_A383C7BC X-CRM114-Status: GOOD ( 18.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Igor Opaniuk , Marcel Ziswiler , linux-kernel@vger.kernel.org, Philippe Schenker , Maxime Coquelin , Lee Jones , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 > --- > > 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 | _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel