From: Kent Gibson <warthog618@gmail.com>
To: "Tay Ivan (AquaEasy)" <Ivan.Tay@sg.bosch.com>
Cc: "linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>
Subject: Re: Accessing Intel J4125 GPIO Pins
Date: Mon, 26 Jun 2023 16:06:25 +0800 [thread overview]
Message-ID: <ZJlHATTAIek9UsSD@sol> (raw)
In-Reply-To: <DU0PR10MB6083CF3B3E4B6495BA540BE0A826A@DU0PR10MB6083.EURPRD10.PROD.OUTLOOK.COM>
On Mon, Jun 26, 2023 at 05:09:50AM +0000, Tay Ivan (AquaEasy) wrote:
> Hi,
>
> Does anyone knows how to access and write to the Intel J4125 board GPIO?
> I have tried using the raspberrypi GPIO tools and it cannot detect the
> hardware pins.
You mean the raspberrypi GPIO tools that use /dev/gpiomem to access the
pi hardware directly?? I would be horrified if it did.
> I have tired to load the gpio-it87 module and the gpiochip0 shows up
> (using gpiodetect) but I am unable to change the pin values, meaning
> using gpioset (gpioset 0 0=0 or gpioset 0 0=1) writing a 1 or 0 changes
> nothing because the read (gpioget 0 0) always return 1.
Note that by default gpioget changes the line direction to an input and
then reads it, so that whatever you set using gpioset will be lost.
You need to physically check the pin, or use the libgpiod v2 version of
gpioget that supports the --as-is option to read the line without changing
its direction.
And even then, and depending on the device driver, when gpioset exits the
line may be set back to its default value. So you need to keep gpioset
running (the libgpiod v1 gpioset exits by default, whereas the v2 gpioset
will not).
You are almost certainly using v1 gpioset, so try `gpioset -m wait 0 0=1`
and then check the pin.
Alternatively, externally pull a line and use gpioget to check the value
read with gpioget is correct. Just be sure you have the correct pin.
TL;DR As gpiochip0 is recognised by gpiodetect, there is a very good
chance it IS working, but the other tools have convinced you otherwise.
Cheers,
Kent.
prev parent reply other threads:[~2023-06-26 8:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <DU0PR10MB608373C134CD9CE8C7290DF8A826A@DU0PR10MB6083.EURPRD10.PROD.OUTLOOK.COM>
2023-06-26 5:09 ` Accessing Intel J4125 GPIO Pins Tay Ivan (AquaEasy)
2023-06-26 8:06 ` Kent Gibson [this message]
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=ZJlHATTAIek9UsSD@sol \
--to=warthog618@gmail.com \
--cc=Ivan.Tay@sg.bosch.com \
--cc=linux-gpio@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).