[PATCH] mfd: stmpe: Support disabling sub-functions

From: Francesco Dolcini
Date: Wed Oct 27 2021 - 04:22:14 EST


From: Oleksandr Suvorov <oleksandr.suvorov@xxxxxxxxxxx>

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@xxxxxxxxxxx>
Cc: Oleksandr Suvorov <oleksandr.suvorov@xxxxxxxxxxxx>
Signed-off-by: Francesco Dolcini <francesco.dolcini@xxxxxxxxxxx>
---
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(-)

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")) {
--
2.25.1