diff options
author | Shaojie Sun <shaojie.sun@linaro.com> | 2013-09-17 14:15:19 +0800 |
---|---|---|
committer | Shaojie Sun <shaojie.sun@linaro.com> | 2013-09-18 11:33:02 +0800 |
commit | ed97318cfc768bb34bb0baf07936fee752928615 (patch) | |
tree | 8697149f526a4047add20ae07722d6e637359619 | |
parent | 2489bc70a2e3084cb8d070c9b5b4cc711f67c0e0 (diff) |
Read gpio value after gpio direction changed.
When gpio direction was changed from IN to OUT though sysfs. gpio
value would changed to zero. So after gpio direction changed, we
must read gpio value again.
Signed-off-by: Shaojie Sun <shaojie.sun@linaro.com>
-rw-r--r-- | gpio.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -284,6 +284,7 @@ static int gpio_change(int keyvalue) strcpy(gpio->direction, "in"); file_write_value(t->path, "direction", "%s", &gpio->direction); file_read_value(t->path, "direction", "%s", &gpio->direction); + file_read_value(t->path, "value", "%d", &gpio->value); break; |