From nobody Thu Apr 2 17:38:56 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F18903446AD for ; Thu, 12 Feb 2026 11:25:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770895517; cv=none; b=fpbQdDtHtj1op1JrXHe3jad1ByXdWFFubFw3fTmTKrsQkNECgOFRbD6WJ9kxy5jEYjLn/e4dNVVe8Z3b2llFP6bYDEIV1lYj+aTYZEs9n8nhByPsSOXgj25siCM+KWxi7ofSdPPt0/hCYhnB5qw5nrzpxoplOrBwglWUzNA9Y5M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770895517; c=relaxed/simple; bh=VunR3z/+JocjgFhytk6SHVWzdSGGqNBZRnDdQx6yCAE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=uW4YELP8/lTrxw8K4WoJLdYaNn6tCqs4lvLUgSWwMXeGVm9matMk676SRX1mTVj3yjl4BhmDKp3jZPd7mKJmnz/YARma54BSePBEiXLIJUt8GoTihVYVWM/FG32Xd1U84oLW/LpjaB9MDf4eEFHWKubh+K1TME81HgXgffx6nys= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=aguKT32Z; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=hfL/fs0R; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="aguKT32Z"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="hfL/fs0R" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61CAGHIY4112109 for ; Thu, 12 Feb 2026 11:25:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=qcppdkim1; bh=5PDGpXXd+WYqIC3XZToRU9plHqBK8VSdCl2 nLvQovpI=; b=aguKT32Zh9CL5EEIJgDfEwKangY/qi/i/qNExPwDzTEdND8YvHF uumIn88o7F0Vb63SG/gFMb1BrDyKFLkeMkqQ8BEwqVaQiuUg96yX9eGqmipxMIsy GWPMZBQSOgq91zggXN5nGBc9KXGOMdTmBt6MWBAMdB749bxWOEeQLLG34HTzfpd4 ViTPh8OhQM2QoJIOOjU/3OMN2cTzjWETV3qk2VL9D0pdgjLQXiUbH13vGWiLynUq WeuJBzGRiY++Fuge3CGsecO9PXD0+ACT+0tCPXDNHyzxxu8f2k5tv+JWhrsduCBO XOukPyc2ehgUMoVvSpLP/tzk2F4zPag8ejw== Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4c9cya86vg-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 12 Feb 2026 11:25:13 +0000 (GMT) Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-8ca3ef536ddso2734769085a.0 for ; Thu, 12 Feb 2026 03:25:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1770895513; x=1771500313; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=5PDGpXXd+WYqIC3XZToRU9plHqBK8VSdCl2nLvQovpI=; b=hfL/fs0RDsr7wGUkzngZFFEgjdpIlG/4f1d39ssJulF4dAbwprgFoEDoI7B+nLarZF 7ApBTDH/Pwxs4zPUEyljB1tqN3uRDl9MRxJN2Wwe83XIgduQ6MKdZ5MA72E3+rjJ6k6b 4cgX/3I1JFd0wiT3ZSjstUfJxWiKQPuiPaEtpgpVkW1DF05GQfPFlFFiLZjBWZMVfCL8 ruxSiJLJRiEpqFYq8crzHM//PdLCMlBCKAxq/8QKkhyvKWAhmhhDyaWLxpjUdVwFXz3B yCxIWY6fl/Gn0SJamk6EW6gKRgKUsqMF+ds0mreRAw5yEwLIlzpuLUujs5ggbsFMDSIR MafQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770895513; x=1771500313; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5PDGpXXd+WYqIC3XZToRU9plHqBK8VSdCl2nLvQovpI=; b=ouKY4QQ4Ku/81ho/EUtweNUlm30IU85i2VDUglKZN4UrJgzF/flKqa+gP6UivsEcQ9 xFdfIqRbLDAmn7YgoXd30n9TV59RM8eL6/xcGYxqTW2ThsCO+BaRJpDctSn3ErAYLe0S 4Nr/rDyRGzbdhr+1GfMcqbqPP1d/bNXTJvyleuhBdue3f3TLxL47vIecM9DNOpJiT36G j6ujgR4T1SFTm8sF/z9pHXw31VN0bttrJutyMPXw0hCyp+eylXH6v4TRr4NYVEA4lI7l 53kVUwyLErIMNqrNQ0c470tTzEuKfCvRTzxt98lzBMFPpiKBReDA3vyTc8pyl2WQzCWc DIxA== X-Forwarded-Encrypted: i=1; AJvYcCW+n0i8lbMxT38kpoigPSXDBZFH/csNLhAMbRjLADDZJnODHdcu9EXM1M5KyLBYoHm3W8wpD7/5XyuKmf4=@vger.kernel.org X-Gm-Message-State: AOJu0Yw0X2y/0OGeyynINH8E/QolIx1y/ZG1bQnpzE2uOGN0RyHFB2a/ +nLp+nsP5e7LMaMRWg54ExstX0NP1gWwOVdWWn49pIPuX2oJ1Dhmii+awrW9+oOufZSrIWLnYSf rjnxAPJ5awNh21cPYmKJ5xZ0LUAFgp6Snh3Qu1D/tftD6rD/aRBIFCqsk4YpHt8fzPCE= X-Gm-Gg: AZuq6aIdSHaFcoRFSX2WMid2eOsZIBSbbi3JCz/z10bwhlhb8UkW/OWeslbvC5xULDr VEjLWXMxkPrjzl/TLrpdMVm6XSfPUVT5jPvNY1Qb6Rms1D1evs/BGReyW178h5a5c83pfJ7PHzG EJMCTRvsm6qat8tzkRG6m4xHFt1GoZ653PxbIb9CiaJ+G4icX1e5tVrOO7zZoWm3h6MGYCIKSDF K748AGjioCDaLBUIR5hJHlw+ZLGL24Mj/Uomwj4h/5HQGFNQ2RK6eM+D41oRdyMkZXUK8PVTTEx UTd/PNtEC3hRUsWZPFF6eXe1smxU5y0dBU84GoiGZhKUDex3vzNEP3xaOvpdebSE182w165Ilb3 JNnNM4/GLBCv8FnXXoSw4WI8Agxpl6hP7jqu4tiOf53cP6sou/ik= X-Received: by 2002:a05:620a:4112:b0:8c7:fdc:e87c with SMTP id af79cd13be357-8cb330fd638mr288563085a.51.1770895513075; Thu, 12 Feb 2026 03:25:13 -0800 (PST) X-Received: by 2002:a05:620a:4112:b0:8c7:fdc:e87c with SMTP id af79cd13be357-8cb330fd638mr288559985a.51.1770895512532; Thu, 12 Feb 2026 03:25:12 -0800 (PST) Received: from brgl-qcom.home ([2a01:cb1d:dc:7e00:afaf:b495:9036:167a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43783d4785fsm11453572f8f.11.2026.02.12.03.25.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Feb 2026 03:25:12 -0800 (PST) From: Bartosz Golaszewski To: Aaro Koskinen , Janusz Krzysztofik , Tony Lindgren , Russell King , Dmitry Torokhov , Arnd Bergmann , Hans de Goede Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, brgl@kernel.org, Bartosz Golaszewski Subject: [RFT PATCH v3] ARM: omap1: enable real software node lookup of GPIOs on Nokia 770 Date: Thu, 12 Feb 2026 12:25:08 +0100 Message-ID: <20260212112508.73500-1-bartosz.golaszewski@oss.qualcomm.com> X-Mailer: git-send-email 2.47.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: zJRBZBLs2g4dtziHoh27dQpvnE4RFzxJ X-Authority-Analysis: v=2.4 cv=OrBCCi/t c=1 sm=1 tr=0 ts=698db899 cx=c_pps a=hnmNkyzTK/kJ09Xio7VxxA==:117 a=xqWC_Br6kY4A:10 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=Mpw57Om8IfrbqaoTuvik:22 a=GgsMoib0sEa3-_RKJdDe:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=AKYXJijLabmKD37pI5EA:9 a=PEH46H7Ffwr30OY-TuGO:22 X-Proofpoint-ORIG-GUID: zJRBZBLs2g4dtziHoh27dQpvnE4RFzxJ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjEyMDA4NSBTYWx0ZWRfX5G4F5cdjfTk+ VCcY+foKPTbK9exbqYZY1a48tjMjkTNtSrSDP8rfernpwaXK/7zXX4pdeJjqrIHudKQdquZmshd IKIh2OU2zGUPziyl+id+8OV0kdOmyBbUybIYAuEQq5uI6GvgxIhX0yPvBS+EkfcVcCWgLcDfdX9 XxnXsyXZpSgWTeNqd4AXNeBEOUvuCw4QgzlluzSr814Ryhqrog6d8AajYGF6VVMwI1NAq9HumOb zbG8kSqa22ikXLdBUdMv993S0xS6iceP/tL6X1BcJFSVAQEqOerAoug7BHfasvymiptdDBtbx/Q VP+J5c6YXGRUAgGEZIIjn0o4wq/4yz8VsdzKL8uNulwRZ7Dl+5abqA+2kTE2rf+I8WWcXe1doFx yE92Z8qHbiM0lx1IGKQTjx5LuIotVCVU/lRBiOc1PGdhzJvtfFO8GVrgagP05/Bo2Dg1KCyXXmu Q0/uizvbwDMrAA122KQ== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-12_03,2026-02-11_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 bulkscore=0 suspectscore=0 spamscore=0 impostorscore=0 malwarescore=0 phishscore=0 lowpriorityscore=0 priorityscore=1501 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602120085 Content-Type: text/plain; charset="utf-8" Currently the board file for Nokia 770 creates dummy software nodes not attached in any way to the actual GPIO controller devices and uses the fact that GPIOLIB matching swnode's name to the GPIO chip's label during software node lookup. This behavior is wrong and we want to remove it. To that end, we need to first convert all existing users to creating actual fwnode links. Create real software nodes for GPIO controllers on OMAP16xx and reference them from the software nodes in the nokia board file. Signed-off-by: Bartosz Golaszewski Acked-by: Arnd Bergmann --- Changes in v3: - fix references to the MPU node Changes in v2: - fix build with CONFIG_I2C_CBUS_GPIO - only export the two symbols that are actually required by the nokia board file This is a follow up to the following discussion[1]. I don't have the hardware for testing so only build-tested it. [1] https://lore.kernel.org/all/aYkdKfP5fg6iywgr@jekhomev/ arch/arm/mach-omap1/board-nokia770.c | 30 +++++----------------------- arch/arm/mach-omap1/common.h | 3 +++ arch/arm/mach-omap1/gpio16xx.c | 29 ++++++++++++++++++++++++++- 3 files changed, 36 insertions(+), 26 deletions(-) diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/boa= rd-nokia770.c index a5bf5554800fe..46f817f6316b7 100644 --- a/arch/arm/mach-omap1/board-nokia770.c +++ b/arch/arm/mach-omap1/board-nokia770.c @@ -36,25 +36,6 @@ #include "clock.h" #include "mmc.h" =20 -static const struct software_node nokia770_mpuio_gpiochip_node =3D { - .name =3D "mpuio", -}; - -static const struct software_node nokia770_gpiochip1_node =3D { - .name =3D "gpio-0-15", -}; - -static const struct software_node nokia770_gpiochip2_node =3D { - .name =3D "gpio-16-31", -}; - -static const struct software_node *nokia770_gpiochip_nodes[] =3D { - &nokia770_mpuio_gpiochip_node, - &nokia770_gpiochip1_node, - &nokia770_gpiochip2_node, - NULL -}; - #define ADS7846_PENDOWN_GPIO 15 =20 static const unsigned int nokia770_keymap[] =3D { @@ -112,7 +93,7 @@ static const struct omap_lcd_config nokia770_lcd_config = __initconst =3D { }; =20 static const struct property_entry nokia770_mipid_props[] =3D { - PROPERTY_ENTRY_GPIO("reset-gpios", &nokia770_gpiochip1_node, + PROPERTY_ENTRY_GPIO("reset-gpios", &omap16xx_gpio1_swnode, 13, GPIO_ACTIVE_LOW), { } }; @@ -138,7 +119,7 @@ static const struct property_entry nokia770_ads7846_pro= ps[] =3D { PROPERTY_ENTRY_U16("ti,x-plate-ohms", 180), PROPERTY_ENTRY_U16("ti,debounce-tol", 3), PROPERTY_ENTRY_U16("ti,debounce-rep", 1), - PROPERTY_ENTRY_GPIO("pendown-gpios", &nokia770_gpiochip1_node, + PROPERTY_ENTRY_GPIO("pendown-gpios", &omap16xx_gpio1_swnode, ADS7846_PENDOWN_GPIO, GPIO_ACTIVE_LOW), { } }; @@ -225,9 +206,9 @@ static inline void nokia770_mmc_init(void) #if IS_ENABLED(CONFIG_I2C_CBUS_GPIO) =20 static const struct software_node_ref_args nokia770_cbus_gpio_refs[] =3D { - SOFTWARE_NODE_REFERENCE(&nokia770_mpuio_gpiochip_node, 9, 0), - SOFTWARE_NODE_REFERENCE(&nokia770_mpuio_gpiochip_node, 10, 0), - SOFTWARE_NODE_REFERENCE(&nokia770_mpuio_gpiochip_node, 11, 0), + SOFTWARE_NODE_REFERENCE(&omap16xx_mpu_gpio_swnode, 9, 0), + SOFTWARE_NODE_REFERENCE(&omap16xx_mpu_gpio_swnode, 10, 0), + SOFTWARE_NODE_REFERENCE(&omap16xx_mpu_gpio_swnode, 11, 0), }; =20 static const struct property_entry nokia770_cbus_props[] =3D { @@ -318,7 +299,6 @@ static void __init omap_nokia770_init(void) /* Unmask SleepX signal */ omap_writew((omap_readw(0xfffb5004) & ~2), 0xfffb5004); =20 - software_node_register_node_group(nokia770_gpiochip_nodes); platform_add_devices(nokia770_devices, ARRAY_SIZE(nokia770_devices)); =20 gpiod_add_lookup_table(&nokia770_irq_gpio_table); diff --git a/arch/arm/mach-omap1/common.h b/arch/arm/mach-omap1/common.h index 7a7c3d9eb84a0..c0f6e231fdb44 100644 --- a/arch/arm/mach-omap1/common.h +++ b/arch/arm/mach-omap1/common.h @@ -35,6 +35,9 @@ #include "soc.h" #include "i2c.h" =20 +extern const struct software_node omap16xx_mpu_gpio_swnode; +extern const struct software_node omap16xx_gpio1_swnode; + #ifdef CONFIG_OMAP_SERIAL_WAKE int omap_serial_wakeup_init(void); #else diff --git a/arch/arm/mach-omap1/gpio16xx.c b/arch/arm/mach-omap1/gpio16xx.c index 55acec22fef4e..177621cb47844 100644 --- a/arch/arm/mach-omap1/gpio16xx.c +++ b/arch/arm/mach-omap1/gpio16xx.c @@ -9,6 +9,7 @@ */ =20 #include +#include #include =20 #include "hardware.h" @@ -55,6 +56,8 @@ static struct omap_gpio_platform_data omap16xx_mpu_gpio_c= onfig =3D { .regs =3D &omap16xx_mpuio_regs, }; =20 +const struct software_node omap16xx_mpu_gpio_swnode =3D { }; + static struct platform_device omap16xx_mpu_gpio =3D { .name =3D "omap_gpio", .id =3D 0, @@ -99,6 +102,8 @@ static struct omap_gpio_platform_data omap16xx_gpio1_con= fig =3D { .regs =3D &omap16xx_gpio_regs, }; =20 +const struct software_node omap16xx_gpio1_swnode =3D { }; + static struct platform_device omap16xx_gpio1 =3D { .name =3D "omap_gpio", .id =3D 1, @@ -122,6 +127,8 @@ static struct resource omap16xx_gpio2_resources[] =3D { }, }; =20 +static const struct software_node omap16xx_gpio2_swnode =3D { }; + static struct omap_gpio_platform_data omap16xx_gpio2_config =3D { .bank_width =3D 16, .regs =3D &omap16xx_gpio_regs, @@ -155,6 +162,8 @@ static struct omap_gpio_platform_data omap16xx_gpio3_co= nfig =3D { .regs =3D &omap16xx_gpio_regs, }; =20 +static const struct software_node omap16xx_gpio3_swnode =3D { }; + static struct platform_device omap16xx_gpio3 =3D { .name =3D "omap_gpio", .id =3D 3, @@ -183,6 +192,8 @@ static struct omap_gpio_platform_data omap16xx_gpio4_co= nfig =3D { .regs =3D &omap16xx_gpio_regs, }; =20 +static const struct software_node omap16xx_gpio4_swnode =3D { }; + static struct platform_device omap16xx_gpio4 =3D { .name =3D "omap_gpio", .id =3D 4, @@ -201,6 +212,14 @@ static struct platform_device *omap16xx_gpio_dev[] __i= nitdata =3D { &omap16xx_gpio4, }; =20 +static const struct software_node *omap16xx_gpio_swnodes[] __initconst =3D= { + &omap16xx_mpu_gpio_swnode, + &omap16xx_gpio1_swnode, + &omap16xx_gpio2_swnode, + &omap16xx_gpio3_swnode, + &omap16xx_gpio4_swnode, +}; + /* * omap16xx_gpio_init needs to be done before * machine_init functions access gpio APIs. @@ -208,7 +227,7 @@ static struct platform_device *omap16xx_gpio_dev[] __in= itdata =3D { */ static int __init omap16xx_gpio_init(void) { - int i; + int i, ret; void __iomem *base; struct resource *res; struct platform_device *pdev; @@ -244,6 +263,14 @@ static int __init omap16xx_gpio_init(void) iounmap(base); =20 platform_device_register(omap16xx_gpio_dev[i]); + + ret =3D device_add_software_node(&omap16xx_gpio_dev[i]->dev, + omap16xx_gpio_swnodes[i]); + + if (ret) { + dev_err(&pdev->dev, "Failed to add software node.\n"); + return ret; + } } =20 return 0; --=20 2.47.3