Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145944889
D25684.id74730.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D25684.id74730.diff
View Options
Index: head/sys/dev/gpio/gpioiic.c
===================================================================
--- head/sys/dev/gpio/gpioiic.c
+++ head/sys/dev/gpio/gpioiic.c
@@ -191,16 +191,14 @@
gpioiic_setsda(device_t dev, int val)
{
struct gpioiic_softc *sc = device_get_softc(dev);
- int err;
- /*
- * Some controllers cannot set an output value while a pin is in input
- * mode; in that case we set the pin again after changing mode.
- */
- err = gpio_pin_set_active(sc->sdapin, val);
- gpio_pin_setflags(sc->sdapin, GPIO_PIN_OUTPUT | GPIO_PIN_OPENDRAIN);
- if (err != 0)
- gpio_pin_set_active(sc->sdapin, val);
+ if (val) {
+ gpio_pin_setflags(sc->sdapin, GPIO_PIN_INPUT);
+ } else {
+ gpio_pin_setflags(sc->sdapin,
+ GPIO_PIN_OUTPUT | GPIO_PIN_OPENDRAIN);
+ gpio_pin_set_active(sc->sdapin, 0);
+ }
}
static void
@@ -208,8 +206,13 @@
{
struct gpioiic_softc *sc = device_get_softc(dev);
- gpio_pin_setflags(sc->sclpin, GPIO_PIN_OUTPUT | GPIO_PIN_OPENDRAIN);
- gpio_pin_set_active(sc->sclpin, val);
+ if (val) {
+ gpio_pin_setflags(sc->sclpin, GPIO_PIN_INPUT);
+ } else {
+ gpio_pin_setflags(sc->sclpin,
+ GPIO_PIN_OUTPUT | GPIO_PIN_OPENDRAIN);
+ gpio_pin_set_active(sc->sclpin, 0);
+ }
}
static int
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Feb 27, 10:03 AM (2 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29025695
Default Alt Text
D25684.id74730.diff (1 KB)
Attached To
Mode
D25684: gpioiic: never drive lines active high
Attached
Detach File
Event Timeline
Log In to Comment