Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: Andreas Kemnade <andreas@kemnade.info>
To: tony@atomide.com, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, linux-omap@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	hns@goldelico.com
Cc: Andreas Kemnade <andreas@kemnade.info>,
	linux-gpio@vger.kernel.org,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>
Subject: [RFC PATCH] ARM: dts: omap3-gta04: add line names for modem-related GPIOs
Date: Fri, 13 Sep 2024 13:01:25 +0200	[thread overview]
Message-ID: <20240913110125.753142-1-andreas@kemnade.info> (raw)

There is one GPIO which needs a high pulse to toggle power of the
modem. Since GPIO numbering (and even chip numbering) is not stable
anymore, make it detectable via gpiofind, so userspace can take care.

There is another reset-out gpio on the A5 which indicates the power state
of the modem, make it also available.

Note: there is a full kernel space implementation of this issue:
https://git.goldelico.com/?p=letux-kernel.git;a=blob;f=drivers/misc/wwan-on-off.c;h=768b6f9fa745d7f4d820685748a1b801e731962d;hb=letux-6.11-rc7
which never hit mainline.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
CC: linux-gpio@vger.kernel.org
CC: Linus Walleij <linus.walleij@linaro.org>
CC: Bartosz Golaszewski <brgl@bgdev.pl>
---
This looks quite ugly and does not even fully solve the problem, since
gpioset does not keep that gpio state on exit, so scripts using
sysfs-export cannot use it as a drop-in replacement. So probably some
daemon sitting on that gpio is needed, if things should be done in
userspace.
At least this patch improves the description of the hardware
what is what the devicetree is for.

 arch/arm/boot/dts/ti/omap/omap3-gta04.dtsi  | 7 +++++++
 arch/arm/boot/dts/ti/omap/omap3-gta04a5.dts | 4 ++++
 2 files changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/ti/omap/omap3-gta04.dtsi b/arch/arm/boot/dts/ti/omap/omap3-gta04.dtsi
index 5001c4ea35658..b00d0d092eabc 100644
--- a/arch/arm/boot/dts/ti/omap/omap3-gta04.dtsi
+++ b/arch/arm/boot/dts/ti/omap/omap3-gta04.dtsi
@@ -469,6 +469,13 @@ OMAP3630_CORE2_IOPAD(0x25e4, PIN_INPUT | MUX_MODE4) /* rx */
 	};
 };
 
+&gpio6 {
+	gpio-line-names = "", "", "", "", "", "", "", "",
+			  "", "", "", "", "", "", "", "",
+			  "", "", "", "", "", "", "", "",
+			  "", "", "MODEM_EN";
+};
+
 &i2c1 {
 	clock-frequency = <2600000>;
 
diff --git a/arch/arm/boot/dts/ti/omap/omap3-gta04a5.dts b/arch/arm/boot/dts/ti/omap/omap3-gta04a5.dts
index 230f6f4fc6bf8..be7f71d720680 100644
--- a/arch/arm/boot/dts/ti/omap/omap3-gta04a5.dts
+++ b/arch/arm/boot/dts/ti/omap/omap3-gta04a5.dts
@@ -44,6 +44,10 @@ irda-en-hog {
 	};
 };
 
+&twl_gpio {
+	gpio-line-names = "", "", "", "", "", "", "MODEM_RESET_OUT";
+};
+
 &omap3_pmx_core {
 	bt_pins: bt-pins {
 		pinctrl-single,pins = <
-- 
2.39.2


                 reply	other threads:[~2024-09-13 11:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20240913110125.753142-1-andreas@kemnade.info \
    --to=andreas@kemnade.info \
    --cc=brgl@bgdev.pl \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hns@goldelico.com \
    --cc=krzk+dt@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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