diff options
author | Jesse Gilles <jgilles@multitech.com> | 2014-05-20 16:49:47 -0500 |
---|---|---|
committer | Jesse Gilles <jgilles@multitech.com> | 2014-06-18 12:07:38 -0500 |
commit | f8a371233d759309cd58672192294180c7f8842e (patch) | |
tree | 04a2089501c69e2b9b986828f41fc9a92b5d4398 /io-module/gpio.c | |
parent | 7e07fe3959a903dd3fbcc1546058dc8a84241b28 (diff) | |
download | mts-io-f8a371233d759309cd58672192294180c7f8842e.tar.gz mts-io-f8a371233d759309cd58672192294180c7f8842e.tar.bz2 mts-io-f8a371233d759309cd58672192294180c7f8842e.zip |
add reset_gpio_pin for generic pin reset
Diffstat (limited to 'io-module/gpio.c')
-rw-r--r-- | io-module/gpio.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/io-module/gpio.c b/io-module/gpio.c index 72c55f6..4a2d963 100644 --- a/io-module/gpio.c +++ b/io-module/gpio.c @@ -81,3 +81,18 @@ static ssize_t mts_attr_store_gpio_pin(struct device *dev, return count; } + +static int reset_gpio_pin(struct gpio_pin *pin, unsigned int delay_ms, unsigned int value) +{ + if (!pin) { + return -ENODEV; + } + + gpio_set_value(pin->pin.gpio, value); + + mdelay(delay_ms); + + gpio_set_value(pin->pin.gpio, !value); + + return 0; +} |