FreeBSD Bugzilla – Attachment 216622 Details for
Bug 248138
aw_gpio: some hardware does not support reading input while in interrupt mode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
a proof-of-concept patch
aw_gpio.diff (text/plain), 986 bytes, created by
Andriy Gapon
on 2020-07-21 08:46:05 UTC
(
hide
)
Description:
a proof-of-concept patch
Filename:
MIME Type:
Creator:
Andriy Gapon
Created:
2020-07-21 08:46:05 UTC
Size:
986 bytes
patch
obsolete
>diff --git a/sys/arm/allwinner/aw_gpio.c b/sys/arm/allwinner/aw_gpio.c >index e041b2a8f86ed..3c7265262f7cc 100644 >--- a/sys/arm/allwinner/aw_gpio.c >+++ b/sys/arm/allwinner/aw_gpio.c >@@ -663,18 +663,30 @@ aw_gpio_pin_get_locked(struct aw_gpio_softc *sc,uint32_t pin, > unsigned int *val) > { > uint32_t bank, reg_data; >+ int32_t func; >+ int err; > > AW_GPIO_LOCK_ASSERT(sc); > > if (pin > sc->conf->padconf->npins) > return (EINVAL); > >+ func = aw_gpio_get_function(sc, pin); >+ if (func == sc->conf->padconf->pins[pin].eint_func) { /* "pl_eintX */ >+ err = aw_gpio_set_function(sc, pin, AW_GPIO_INPUT); >+ if (err != 0) >+ return (err); >+ } >+ > bank = sc->conf->padconf->pins[pin].port; > pin = sc->conf->padconf->pins[pin].pin; > > reg_data = AW_GPIO_READ(sc, AW_GPIO_GP_DAT(bank)); > *val = (reg_data & (1 << pin)) ? 1 : 0; > >+ if (func == sc->conf->padconf->pins[pin].eint_func) >+ (void)aw_gpio_set_function(sc, pin, func); >+ > return (0); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 248138
: 216622