<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src-test/sys/dev/gpio, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src-test/atom?h=main</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src-test/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/'/>
<updated>2020-12-12T18:34:15Z</updated>
<entry>
<title>Provide userland notification of gpio pin changes ("userland gpio interrupts").</title>
<updated>2020-12-12T18:34:15Z</updated>
<author>
<name>Ian Lepore</name>
<email>ian@FreeBSD.org</email>
</author>
<published>2020-12-12T18:34:15Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=ff3468ac94597efdcbc56f372528dfc98b114dac'/>
<id>urn:sha1:ff3468ac94597efdcbc56f372528dfc98b114dac</id>
<content type='text'>
This is an import of the Google Summer of Code 2018 project completed by
Christian Kramer (and, sadly, ignored by us for two years now).  The goals
stated for that project were:

    FreeBSD already has support for interrupts implemented in the GPIO
    controller drivers of several SoCs, but there are no interfaces to take
    advantage of them out of user space yet. The goal of this work is to
    implement such an interface by providing descriptors which integrate
    with the common I/O system calls and multiplexing mechanisms.

The initial imported code supports the following functionality:

 -  A kernel driver that provides an interface to the user space; the
    existing gpioc(4) driver was enhanced with this functionality.
 -  Implement support for the most common I/O system calls / multiplexing
    mechanisms:
     -  read() Places the pin number on which the interrupt occurred in the
        buffer. Blocking and non-blocking behaviour supported.
     -	poll()/select()
     -	kqueue()
     -	signal driven I/O. Posting SIGIO when the O_ASYNC was set.
 -  Many-to-many relationship between pins and file descriptors.
     -  A file descriptor can monitor several GPIO pins.
     -  A GPIO pin can be monitored by multiple file descriptors.
 -  Integration with gpioctl and libgpio.

I added some fixes (mostly to locking) and feature enhancements on top of
the original gsoc code.  The feature ehancements allow the user to choose
between detailed and summary event reporting.  Detailed reporting provides
a record describing each pin change event.  Summary reporting provides the
time of the first and last change of each pin, and a count of how many times
it changed state since the last read(2) call.  Another enhancement allows
the recording of multiple state change events on multiple pins between each
call to read(2) (the original code would track only a single event at a time).

The phabricator review for these changes timed out without approval, but I
cite it below anyway, because the review contains a series of diffs that
show how I evolved the code from its original state in Christian's github
repo for the gsoc project to what is being commited here.  (In effect,
the phab review extends the VC history back to the original code.)

Submitted by:	Christian Kramer
Obtained from:	https://github.com/ckraemer/freebsd/tree/gsoc2018
Differential Revision:	https://reviews.freebsd.org/D27398
</content>
</entry>
<entry>
<title>Allow for interrupts on pl061 children</title>
<updated>2020-09-14T08:59:16Z</updated>
<author>
<name>Andrew Turner</name>
<email>andrew@FreeBSD.org</email>
</author>
<published>2020-09-14T08:59:16Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=d729904a4f9e7c1cd5373a8fbef56c003faf6851'/>
<id>urn:sha1:d729904a4f9e7c1cd5373a8fbef56c003faf6851</id>
<content type='text'>
Add enough infrastructure for interrupts on children of the pl061 GPIO
controller. As gpiobus already provided these the pl061 driver also needs
to pass requests up the newbus hierarchy.

Currently there are no children that expect to configure interrupts, however
this is expected to change to support the ACPI Event Information interface.

Sponsored by:	Innovate UK
</content>
</entry>
<entry>
<title>Move the pl061 acpi attachment earlier</title>
<updated>2020-09-10T14:58:46Z</updated>
<author>
<name>Andrew Turner</name>
<email>andrew@FreeBSD.org</email>
</author>
<published>2020-09-10T14:58:46Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=15fe2adacbbda6c987eb8bbe36d7b3299d3bc7a2'/>
<id>urn:sha1:15fe2adacbbda6c987eb8bbe36d7b3299d3bc7a2</id>
<content type='text'>
As the pl061 driver can be an interrupt controller attach it earlier in the
boot so other drivers can use it.

Use a new GPIO xref to not conflict with the existing root interrupt
controller.

Sponsored by:	Innovate UK
</content>
</entry>
<entry>
<title>Switch the name of the pl061 driver to gpio</title>
<updated>2020-09-10T09:50:43Z</updated>
<author>
<name>Andrew Turner</name>
<email>andrew@FreeBSD.org</email>
</author>
<published>2020-09-10T09:50:43Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=128e746c6ac654792c8e9dde770c5bd4a6860e3b'/>
<id>urn:sha1:128e746c6ac654792c8e9dde770c5bd4a6860e3b</id>
<content type='text'>
We need it to be named gpio for gpiobus to work.

Sponsored by:	Innovate UK
</content>
</entry>
<entry>
<title>Only manage ofw gpio providers on ofw systems</title>
<updated>2020-09-10T09:42:37Z</updated>
<author>
<name>Andrew Turner</name>
<email>andrew@FreeBSD.org</email>
</author>
<published>2020-09-10T09:42:37Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=f5e4e9153ce8268157be828bd7edda1c58072d49'/>
<id>urn:sha1:f5e4e9153ce8268157be828bd7edda1c58072d49</id>
<content type='text'>
On arm64 we may boot via ACPI. In this case we will still try to manage the
gpio providers as if we are using FDT. Fix this by checking if the FDT node
is valid before registering a cross reference.

Sponsored by:	Innovate UK
</content>
</entry>
<entry>
<title>Use the correct variable to check which interrupt mode to use</title>
<updated>2020-09-10T09:37:30Z</updated>
<author>
<name>Andrew Turner</name>
<email>andrew@FreeBSD.org</email>
</author>
<published>2020-09-10T09:37:30Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=365ed84f28e42a41067a90c98e5243aae1790f6d'/>
<id>urn:sha1:365ed84f28e42a41067a90c98e5243aae1790f6d</id>
<content type='text'>
In the PL061 driver we incorrectly used the mask rather than mode to find
how to configure the interrupt.

Sponsored by:	Innovate UK
</content>
</entry>
<entry>
<title>Add a GPIO driver for the Arm pl061 controller</title>
<updated>2020-09-08T11:35:35Z</updated>
<author>
<name>Andrew Turner</name>
<email>andrew@FreeBSD.org</email>
</author>
<published>2020-09-08T11:35:35Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=1fc1a22868264f3a59074fe90cb2ac39309d63d5'/>
<id>urn:sha1:1fc1a22868264f3a59074fe90cb2ac39309d63d5</id>
<content type='text'>
A PL061 is a simple 8 pin GPIO controller. This GPIO device is used to
signal an internal request for shutdown on some virtual machines including
Arm-based Amazon EC2 instances.

Submitted by:	Ali Saidi &lt;alisaidi_amazon.com&gt; (previouss version)
Reviewed by:	Ali Saidi, manu
Differential Revision:	https://reviews.freebsd.org/D24065
</content>
</entry>
<entry>
<title>gpiokeys: add evdev support</title>
<updated>2020-08-12T09:49:25Z</updated>
<author>
<name>Andriy Gapon</name>
<email>avg@FreeBSD.org</email>
</author>
<published>2020-08-12T09:49:25Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=2ad1660ae4cd23b976ec74296f8608792833016c'/>
<id>urn:sha1:2ad1660ae4cd23b976ec74296f8608792833016c</id>
<content type='text'>
Only linux,code is supported as it maps 1:1 to evdev key codes.
No reverse mapping for freebsd,code yet.

Reviewed by:	wulf
MFC after:	3 weeks
Differential Revision: https://reviews.freebsd.org/D25940
</content>
</entry>
<entry>
<title>gpioiic: never drive lines active high</title>
<updated>2020-07-21T07:35:03Z</updated>
<author>
<name>Andriy Gapon</name>
<email>avg@FreeBSD.org</email>
</author>
<published>2020-07-21T07:35:03Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=e57f9c8a9f9b9dc233428d2f86d71d9c2e6b62eb'/>
<id>urn:sha1:e57f9c8a9f9b9dc233428d2f86d71d9c2e6b62eb</id>
<content type='text'>
I2C communication is done by a combination of driving a line low or
letting it float, so that it is either pulled up or driven low by
another party.

r355276 besides the stated goal of the change -- using the new GPIO API
-- also changed the logic, so that active state is signaled by actively
driving a line.

That worked with iicbb prior to r362042, but stopped working after that
commit on at least some hardware.  My guess that the breakage was
related to getting an ACK bit.  A device expected to be able to drive
SDA actively low, but controller was actively driving it high for some
time.

Anyway, this change seems to fix the problem.
Tested using gpioiic on Orange Pi PC Plus with HTU21 sensor.

Reported by:	Nick Kostirya &lt;nikolay.kostirya@i11.co&gt;
Reviewed by:	manu
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D25684
</content>
</entry>
<entry>
<title>gpiobus_release_pin: remove incorrect prefix from error messages</title>
<updated>2020-06-22T10:32:41Z</updated>
<author>
<name>Andriy Gapon</name>
<email>avg@FreeBSD.org</email>
</author>
<published>2020-06-22T10:32:41Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=f31030ba6102f12ce96f42e9ac37a0bee85e43ae'/>
<id>urn:sha1:f31030ba6102f12ce96f42e9ac37a0bee85e43ae</id>
<content type='text'>
It's interesting that similar messages from gpiobus_acquire_pin never
had any prefix while gpiobus_release_pin messages were prefixed with
"gpiobus_acquire_pin".
Anyway, the prefix is not that useful and can be deduced from context.

MFC after:	2 weeks
</content>
</entry>
</feed>
