From patchwork Sat Dec 26 16:28:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Suvorov X-Patchwork-Id: 11990377 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.8 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,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT 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 F2185C433E0 for ; Sat, 26 Dec 2020 16:30:37 +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 A75BD2173E for ; Sat, 26 Dec 2020 16:30:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A75BD2173E Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=toradex.com 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:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=sSQis3QoZP4J3hAMuuouQnPsNn3KQGAyu1NMXGWTHcc=; b=xbrWCkNIL5GT/xuD4NgvGgNVC DMYRuYMf3MOc8LGPskxoVTYZ2ApeiFeAu5/xRetRlYzhsAY5JcOGKijbWjyPMNq94Azjw8AgE7ogq pG4/wVrQ1owmpCvtHqFa1ld93iY/QM9kYQaPkrNSRvvygS/nKIp0JMmIhHqpNmrpGXPqo/ZmlLYa1 PMgjJtItFvhth+7GBIzDkugeJR4jMy5vTKZCgknKkLLtu6rd0YMApXkXJs6nHNgE41zinG8MjrLDb dCiWxeIqn/QIfiNxnEYJfe50fqmGTwWiltpCSQ24+xR5ex2MZ0LdXtXgY6evUUWPvCYZUCrMjT1jn r4OXYZXBg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ktCR8-0004yQ-Ld; Sat, 26 Dec 2020 16:28:58 +0000 Received: from mail-eopbgr60125.outbound.protection.outlook.com ([40.107.6.125] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ktCR5-0004y3-Kd for linux-arm-kernel@lists.infradead.org; Sat, 26 Dec 2020 16:28:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DKWqbVwDEzEyq9kwb+jqXWtwlQ+hrezTUM35bSiz8qJUdW3KiLIm4ClkTAfNZKBQdTyYnq81ew4rSY+XtQ87fEPmiimS4bqpk7DU5u4R9bh3hDXk45k/v+HdUwirm+TTtCbnmPtd3/37yXghokE1d5MoYHS0JT73wwfwwY5xwjMq3cITMmOwBbcwJeCOeCIucDvbPTu0Hw9vz67OozkMWLL/bRBXi0pG0JSRyztVN36loOJi4+c4diNjFvaMelvb+BmuwmvLMj2S2lfMGPjGIzjT0igCrYPeq1TtV5n4KHBOIagpo6SACAUhUGPMo9R9L8C8Zj1ynoEl/LGy0fJSbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N7aDFdy3a0ptxxDM9/efFmxo1bnwv9w463b7E8YDPHA=; b=SQqllPOiMghvdn8EXvBwYdzg09l50rkCIt3IInnM+GeL66QQQC8CFcFRpACJQjwoC0/fOWHfjopqIxahJGwTZ+MLX7hHp9UX9W/2xG7gdTCLh+ilIX9uHWFDW2+e6wmQ3JHuD5gAb4brMmSHxkTF+LaB/ES5TOOIK8wF6fYNxRAB6txaHFKuRAWnB9DcjrEWSyjFT1CvJpbD/avfFgBYjzELBMO6i1CIqcb4cNWf+K8QX7X6DXfLYYAJYtAm++EEBRMggqbAHZV6eyPRDUknpgFY+RSdzHJMqTEkZ4QOhc2AqNZIyGlyc8legqViLYPWEFlcTJhUSHuYm0uINUK6sw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=toradex.com; dmarc=pass action=none header.from=toradex.com; dkim=pass header.d=toradex.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toradex.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N7aDFdy3a0ptxxDM9/efFmxo1bnwv9w463b7E8YDPHA=; b=c4wsiCjTa6dcLARi7cWZVt4C23v8uZCrgqzZghkZ/2tWdjxJRZVeG900qqTzfpwkJhWAESX7dzcAQ493t/tOZwJFwnlylA8BvIZax9ngSzBmotWmhSX5FIe7EvOGAZE7u/76lL3nBYCEsIwYVAOq278pS2uc6BRfBbEhc+DpwjA= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=toradex.com; Received: from AM0PR05MB6002.eurprd05.prod.outlook.com (2603:10a6:208:129::19) by AM0PR05MB6001.eurprd05.prod.outlook.com (2603:10a6:208:124::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3700.27; Sat, 26 Dec 2020 16:28:50 +0000 Received: from AM0PR05MB6002.eurprd05.prod.outlook.com ([fe80::802f:1250:dd1c:9357]) by AM0PR05MB6002.eurprd05.prod.outlook.com ([fe80::802f:1250:dd1c:9357%3]) with mapi id 15.20.3700.031; Sat, 26 Dec 2020 16:28:50 +0000 From: Oleksandr Suvorov To: linux-next@vger.kernel.org Subject: [PATCH v2] mfd: stmpe: Support disabling sub-functions Date: Sat, 26 Dec 2020 18:28:18 +0200 Message-Id: <20201226162818.73782-1-oleksandr.suvorov@toradex.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: References: X-Originating-IP: [82.193.109.226] X-ClientProxiedBy: AM4PR0101CA0082.eurprd01.prod.exchangelabs.com (2603:10a6:200:41::50) To AM0PR05MB6002.eurprd05.prod.outlook.com (2603:10a6:208:129::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from cryobook.toradex.int (82.193.109.226) by AM4PR0101CA0082.eurprd01.prod.exchangelabs.com (2603:10a6:200:41::50) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3700.27 via Frontend Transport; Sat, 26 Dec 2020 16:28:49 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6baebf9d-77bf-4be3-fcac-08d8a9bb5419 X-MS-TrafficTypeDiagnostic: AM0PR05MB6001: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WUwraUWr8ost+bPuyiEnUBIXJmpuJm+fQiF7nE3Emi4BRXc0lrR+3i7cnKYO2/LaZJ2K93T6/AGYiV6ZHFPG7wjNHhaV+baRrDVUk1nWgMGTXtveJmPZrcNOajo3gkUW/Vj1sqdLBuGuXthwiiI3zchXZUfqVD/spV1GCfHVAs+vxkVXIypymhntSSs7PdSYb/HiIHOa68w483IoXhMrya6gW27fN1lS7tMBUiqWeqMAjP6s0VTzAA8wVuEBx8SsyAn/MSxfzke/Mdx54K4DeTZErfYQyuSXK1jCBdd+l3WaMhM9F0licJN3Zwfv1X9x2fiJNLlEyOZ0m565RohDfCS5AGo5+a9n1KqUibjoTQcv2nEfwVzomhcwx/UnLUz4DfcPZeFwoIFilhWPe0LixA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB6002.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39840400004)(376002)(136003)(396003)(366004)(346002)(2616005)(956004)(44832011)(478600001)(36756003)(1076003)(52116002)(6666004)(6916009)(8936002)(4744005)(66476007)(66556008)(66946007)(26005)(55236004)(2906002)(54906003)(5660300002)(86362001)(6512007)(6506007)(83380400001)(4326008)(186003)(16526019)(316002)(8676002)(6486002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: xkAke/vY4++xQpzvoES7Z3QwYnTYdYpBdIfxIIPpfdg+LYgflNUaAJUagAYV1DFNMmhfdDasoPjXA9mJ700j+cCe3j9ZKbyln81Q1UOVC8GYrSSZafpHGmqeuGYeMhlTRJiXo7Q570Bcdhmsi4uflZdSl6ifdQeOSDqtnyb/Km3LyDkCzbCb+IelrNI9kXRepJ4hoUPB+a3b9z0ujmOFNb/g6bQoC4OHLf4srr8Kfi6LgwP3sNOiOdLkxlQH0LDB/bjue/DPkbd7OQKtHaWnuqu6uKSVSU9K83KlPFx3cMTaceDntMci8ftsGCr0IAdNBSQ3J7P6COccyua/Qjy2NrAks2jRNWQyJGH99lw/GssjSmWB5vdpvIK/s3Zs1q7h2wZzoIT5I9sJTwjGjReofyphV03cXHxb+KpJBdqXbNRao6qadO6YbjThAIuormZvU6+JPQ21atfWjcWBNyMSeD57/+hUsM+Tvu3BQjgpavDEz2omYMJROgER0r+hY2H8fHx0aIyRdd+b7KNMtmixmiCq3cO/+kt+x9Bs/wi6kZilNn7z+5iytgQLevGHITcdlsvUQxaqLxtgOvqRzPUZMBf4Ef3EiHImn5KqLsI3sLkxZcQd7sLDvGN1YqrfilLDqvm3GANdK50HoTL0jx2eFlKkpFAe6BFVidBHIuxVtlnjcbWXn8OCDDpIRXM7iTsZ7nv0mnLnOM/JAmKVBy45PWlXrgJ+41b6Oqn9ZMQ6rOUOGd3Retni2e/+6EkKZWfvV4hxP9u/VxZmW21MN7hXwN4wpPci+1ZwOmW0WHXO5SbVDPh/Ch7k3DlumL3EWcNrqmh97wctFNOxVMhg6UJgynZ1vl27TfeCvRJq6BM3Pwc47Wsq6CQaJND45oTOMtrsN2KWIcU0GGKrchpSPKZbTMlo1/F7WDN1ewRAiSmsk82g4mSobzXNDScvhHGaRanHV56bc8g6JtSJjwQA0ix/ht6ihf4jkICTD/jC2a4OsjI31FCNwVg8LvJ8V4z6g1nF X-OriginatorOrg: toradex.com X-MS-Exchange-CrossTenant-AuthSource: AM0PR05MB6002.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2020 16:28:50.6613 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d9995866-0d9b-4251-8315-093f062abab4 X-MS-Exchange-CrossTenant-Network-Message-Id: 6baebf9d-77bf-4be3-fcac-08d8a9bb5419 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SRd1b5n9aNazkBN2McVhcBC143bGk5N6ANli/qomvGisp53MGMsooONBin37LwQ5CISnY4OnY7gbcqoYrbZH27L+KDmK4r25ue5JTxCpgIw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6001 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201226_112855_831698_2EDD9CAE X-CRM114-Status: GOOD ( 11.76 ) 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 , Alexandre Torgue , Marcel Ziswiler , linux-kernel@vger.kernel.org, Oleksandr Suvorov , Philippe Schenker , Maxime Coquelin , Lee Jones , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- Changes in v2: Use for_each_available_child_of_node() instead of checking of_device_is_available() for each node. Thanks for Ahmad Fatoum a.fatoum@pengutronix.de for and idea 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 90f3292230c9..3e4f32673db3 100644 --- a/drivers/mfd/stmpe.c +++ b/drivers/mfd/stmpe.c @@ -1357,7 +1357,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")) {