Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 May 2014 16:30:56 -0300
From:      Luiz Otavio O Souza <loos.br@gmail.com>
To:        "freebsd-embedded@freebsd.org" <freebsd-embedded@freebsd.org>
Subject:   [RFC] GPIO interrupt support
Message-ID:  <CAJ8CS7pqo-ONpVfo-3mTEpREw5OUKo0GDxWD9%2BfN7FPRkJ6LdA@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
--001a11c335ce38a5b404f96138f2
Content-Type: text/plain; charset=UTF-8

Hi,

I've been working on the attached patches which adds the GPIO interrupt support.

gpio-intr.diff has the bus changes for FDT and non-FDT systems.

ar71xx_gpio-intr.diff has the changes to AR71xx GPIO driver.

bcm2835_gpio-intr.diff has the changes to BCM2835 (RPi) GPIO driver.

ti_gpio-intr.diff has the changes for AM335x (Beaglebone), OMAP3 and
OMAP4 (panda board).

The other attached file (gpio-intr-kqueue.c) is an example program
i've been using to check for interrupts from userland.

Userland is notified about GPIO interrupts by a kqueue event.

The changes have been tested on BBB, RPi and RSPRO.

The manual page changes are still to be done (but it will surely be done).

Comments ?

Regards,
Luiz

--001a11c335ce38a5b404f96138f2
Content-Type: text/plain; charset=US-ASCII; name="ar71xx_gpio-intr.diff"
Content-Disposition: attachment; filename="ar71xx_gpio-intr.diff"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_hv6zeusf0

SW5kZXg6IHN5cy9taXBzL2F0aGVyb3MvYXI3MXh4X2dwaW8uYwo9PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBzeXMv
bWlwcy9hdGhlcm9zL2FyNzF4eF9ncGlvLmMJKHJldmlzaW9uIDI2NTgxNykKKysrIHN5cy9taXBz
L2F0aGVyb3MvYXI3MXh4X2dwaW8uYwkod29ya2luZyBjb3B5KQpAQCAtNDQsNiArNDQsNyBAQAog
I2luY2x1ZGUgPHN5cy9tYWxsb2MuaD4KICNpbmNsdWRlIDxzeXM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KIAogI2VuZGlmCS8qIF9f
QVI3MVhYX0dQSU9WQVJfSF9fICovCg==
--001a11c335ce38a5b404f96138f2
Content-Type: text/plain; charset=US-ASCII; name="bcm2835_gpio-intr.diff"
Content-Disposition: attachment; filename="bcm2835_gpio-intr.diff"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_hv6zeuta1

SW5kZXg6IHN5cy9hcm0vYnJvYWRjb20vYmNtMjgzNS9iY20yODM1X2dwaW8uYwo9PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
Ci0tLSBzeXMvYXJtL2Jyb2FkY29tL2JjbTI4MzUvYmNtMjgzNV9ncGlvLmMJKHJldmlzaW9uIDI2
NTg0MikKKysrIHN5cy9hcm0vYnJvYWRjb20vYmNtMjgzNS9iY20yODM1X2dwaW8uYwkod29ya2lu
ZyBjb3B5KQpAQCAtMzksNiArMzksNyBAQAogI2luY2x1ZGUgPHN5cy9tdXRleC5oPgogI2luY2x1
ZGUgPHN5cy9ncGlvLmg+CiAjaW5jbHVkZSA8c3lzL3N5c2N0bC5oPgorI2luY2x1ZGUgPHN5cy9p
bnRlcnJ1cHQuaD4KIAogI2luY2x1ZGUgPG1hY2hpbmUvYnVzLmg+CiAjaW5jbHVkZSA8bWFjaGlu
ZS9jcHUuaD4KQEAgLTYyLDEwICs2MywyMCBAQAogI2RlZmluZSBkcHJpbnRmKGZtdCwgYXJncy4u
LikKICNlbmRpZgogCisjZGVmaW5lCUJDTV9HUElPX0lSUVMJCTQKICNkZWZpbmUJQkNNX0dQSU9f
UElOUwkJNTQKKyNkZWZpbmUJQkNNX0dQSU9fUElOU19QRVJfQkFOSwkzMgogI2RlZmluZQlCQ01f
R1BJT19ERUZBVUxUX0NBUFMJKEdQSU9fUElOX0lOUFVUIHwgR1BJT19QSU5fT1VUUFVUIHwJXAog
ICAgIEdQSU9fUElOX1BVTExVUCB8IEdQSU9fUElOX1BVTExET1dOKQogCitzdG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19nZXRfbm9k
ZSksCiAK
--001a11c335ce38a5b404f96138f2
Content-Type: text/plain; charset=US-ASCII; name="gpio-intr.diff"
Content-Disposition: attachment; filename="gpio-intr.diff"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_hv6zeuus3

SW5kZXg6IHN5cy9jb25mL2ZpbGVzCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9jb25mL2ZpbGVzCShyZXZp
c2lvbiAyNjU4MTcpCisrKyBzeXMvY29uZi9maWxlcwkod29ya2luZyBjb3B5KQpAQCAtMTM5Nyw5
ICsxMzk3LDggQEAKIGRldi9nZW0vaWZfZ2VtX3NidXMuYwkJb3B0aW9uYWwgZ2VtIHNidXMKIGRl
di9ncGlvL2dwaW9idXMuYwkJb3B0aW9uYWwgZ3BpbwkJCQlcCiAJZGVwZW5kZW5jeQkiZ3Bpb2J1
c19pZi5oIgotZGV2L2dwaW8vZ3Bpb2MuYwkJb3B0aW9uYWwgZ3BpbwkJCQlcCi0JZGVwZW5kZW5j
eQkiZ3Bpb19pZi5oIgogZGV2L2dwaW8vZ3Bpb2lpYy5jCQlvcHRpb25hbCBncGlvaWljCitkZXYv
Z3Bpby9ncGlvaW50ci5jCQlvcHRpb25hbCBncGlvaW50cgogZGV2L2dwaW8vZ3Bpb2xlZC5jCQlv
cHRpb25hbCBncGlvbGVkCiBkZXYvZ3Bpby9ncGlvX2lmLm0JCW9wdGlvbmFsIGdwaW8KIGRldi9n
cGlvL2dwaW9idXNfaWYubQkJb3B0aW9uYWwgZ3BpbwpJbmRleDogc3lzL2Rldi9ncGlvL2dwaW9i
dXMuYwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09Ci0tLSBzeXMvZGV2L2dwaW8vZ3Bpb2J1cy5jCShyZXZpc2lvbiAyNjU4
MTcpCisrKyBzeXMvZGV2L2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worCQlyZXR1cm4g
KE5VTEwpOworCX0KKworCXJldHVybiAocnYpOworfQorCitzdGF0aWMgaW50CitncGlvYnVzX3Jl
bGVhc2VfcmVzb3VyY2UoZGV2aWNlX3QgYnVzIF9fdW51c2VkLCBkZXZpY2VfdCBjaGlsZCwgaW50
IHR5cGUsCisgICAgaW50IHJpZCwgc3RydWN0IHJlc291cmNlICpyKQoreworCWludCBlcnJvcjsK
KworCWlmICgocm1hbl9nZXRfZmxhZ3MocikgJiBSRl9BQ1RJVkUpICE9IDApIHsKKwkJZXJyb3Ig
PSBidXNfZGVhY3RpdmF0ZV9yZXNvdXJjZShjaGlsZCwgdHlwZSwgcmlkLCByKTsKKwkJaWYgKGVy
cm9yKQorCQkJcmV0dXJuIChlcnJvcik7CisJfQorCisJcmV0dXJuIChybWFuX3JlbGVhc2VfcmVz
b3VyY2UocikpOworfQorCitzdGF0aWMgc3RydWN0IHJlc291cmNlX2xpc3QgKgorZ3Bpb2J1c19n
ZXRfcmVzb3VyY2VfbGlzdChkZXZpY2VfdCBidXMgX191bnVzZWQsIGRldmljZV90IGNoaWxkKQor
eworCXN0cnVjdCBncGlvYnVzX2l2YXIgKml2YXI7CisKKwlpdmFyID0gR1BJT0JVU19JVkFSKGNo
aWxkKTsKKworCXJldHVybiAoJml2YXItPnJsKTsKK30KKwogc3RhdGljIGRldmljZV9tZXRob2Rf
dCBncGlvYnVzX21ldGhvZHNbXSA9IHsKIAkvKiBEZXZpY2UgaW50ZXJmYWNlICovCiAJREVWTUVU
SE9EKGRldmljZV9wcm9iZSwJCWdwaW9idXNfcHJvYmUpLApAQCAtNDUzLDYgKzg1MSwxNSBAQAog
CURFVk1FVEhPRChkZXZpY2VfcmVzdW1lLAlncGlvYnVzX3Jlc3VtZSksCiAKIAkvKiBCdXMgaW50
ZXJmYWNlICovCisJREVWTUVUSE9EKGJ1c19zZXR1cF9pbnRyLAlncGlvYnVzX3NldHVwX2ludHIp
LAorCURFVk1FVEhPRChidXNfY29uZmlnX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sICs9IGJ1c19wcmludF9jaGlsZF9oZWFkZXIoZGV2LCBjaGlsZCk7CiAJcmV0dmFs
ICs9IHByaW50ZigiIGF0IHBpbihzKSAiKTsKIAlncGlvYnVzX3ByaW50X3BpbnMoJmRldmktPm9w
ZF9kaW5mbyk7CisJcmVzb3VyY2VfbGlzdF9wcmludF90eXBlKCZkZXZpLT5vcGRfZGluZm8ucmws
ICJpcnEiLCBTWVNfUkVTX0lSUSwKKwkgICAgIiVsZCIpOwogCXJldHZhbCArPSBidXNfcHJpbnRf
Y2hpbGRfZm9vdGVyKGRldiwgY2hpbGQpOwogCiAJcmV0dXJuIChyZXR2YWwpOwo=
--001a11c335ce38a5b404f96138f2
Content-Type: text/plain; charset=US-ASCII; name="ti_gpio-intr.diff"
Content-Disposition: attachment; filename="ti_gpio-intr.diff"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_hv6zeuvh4

SW5kZXg6IHN5cy9hcm0vdGkvdGlfZ3Bpby5jCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9hcm0vdGkvdGlf
Z3Bpby5jCShyZXZpc2lvbiAyNjU4NDIpCisrKyBzeXMvYXJtL3RpL3RpX2dwaW8uYwkod29ya2lu
ZyBjb3B5KQpAQCAtNTIsNiArNTIsNyBAQAogI2luY2x1ZGUgPHN5cy9sb2NrLmg+CiAjaW5jbHVk
ZSA8c3lzL211dGV4Lmg+CiAjaW5jbHVkZSA8c3lzL2dwaW8uaD4KKyNpbmNsdWRlIDxzeXMvaW50
ZXJydXB0Lmg+CiAKICNpbmNsdWRlIDxtYWNoaW5lL2J1cy5oPgogI2luY2x1ZGUgPG1hY2hpbmUv
cmVzb3VyY2UuaD4KQEAgLTE0OCw2ICsxNDksNyBAQAogI2VuZGlmCiAjZGVmaW5lCVBJTlNfUEVS
X0JBTksJCQkzMgogI2RlZmluZQlNQVhfR1BJT19JTlRSUwkJCU1BWF9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9yZXNvdXJj
ZSksCisJREVWTUVUSE9EKGJ1c19jb25maWdfaW50ciwgdGlfZ3Bpb19jb25maWdfaW50ciksCisJ
REVWTUVUSE9EKGJ1c19zZXR1cF9pbnRyLCB0aV9ncGlvX3NldHVwX2ludHIpLAorCURFVk1FVEhP
RChidXNfdGVhcmRvd25faW50ciwgdGlfZ3Bpb190ZWFyZG93bl9pbnRyKSwKKwogCS8qIG9md19i
dXMgaW50ZXJmYWNlICovCiAJREVWTUVUSE9EKG9md19idXNfZ2V0X25vZGUsIHRpX2dwaW9fZ2V0
X25vZGUpLAogCg==
--001a11c335ce38a5b404f96138f2--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ8CS7pqo-ONpVfo-3mTEpREw5OUKo0GDxWD9%2BfN7FPRkJ6LdA>