diff options
Diffstat (limited to 'io-module/mts_io.c')
-rw-r--r-- | io-module/mts_io.c | 39 |
1 files changed, 9 insertions, 30 deletions
diff --git a/io-module/mts_io.c b/io-module/mts_io.c index 271857a..550b7c5 100644 --- a/io-module/mts_io.c +++ b/io-module/mts_io.c @@ -480,6 +480,14 @@ static struct gpio_pin gpio_pins_mtr2_0_0[] = { .use_pullup = 0, }, { + .name = "RADIO_RESET", + .attr_name = "radio-power", + .pin = AT91_PIN_PC5, + .direction = GPIO_DIR_OUTPUT, + .output_value = 1, + .use_pullup = 0, + }, + { .name = "DEVICE_RESET", .attr_name = "reset", .pin = AT91_PIN_PC4, @@ -1537,35 +1545,6 @@ static ssize_t mts_attr_store_radio_power_telit(struct device *dev, return count; } -static ssize_t mts_attr_store_radio_power(struct device *dev, - struct device_attribute *attr, const char *buf, size_t count) -{ - int value; - int ret; - - struct gpio_pin *pin = gpio_pin_by_name("RADIO_RESET"); - - if (!pin) { - return -ENODEV; - } - - if (sscanf(buf, "%i", &value) != 1) { - return -EINVAL; - } - - if (value == 0) { - mutex_lock(&mts_io_mutex); - ret = at91_set_gpio_value(pin->pin, 0); - mutex_unlock(&mts_io_mutex); - } else { - mutex_lock(&mts_io_mutex); - ret = at91_set_gpio_value(pin->pin, 1); - mutex_unlock(&mts_io_mutex); - } - - return ret; -} - static int radio_reset_telit(void) { int ret; @@ -1776,7 +1755,7 @@ static ssize_t mts_attr_store_radio_reset_telit(struct device *dev, } static DEVICE_ATTR_MTS(dev_attr_radio_power, "radio-power", - mts_attr_show_gpio_pin, mts_attr_store_radio_power); + mts_attr_show_gpio_pin, mts_attr_store_gpio_pin); static DEVICE_ATTR_MTS(dev_attr_radio_reset, "radio-reset", mts_attr_show_gpio_pin, mts_attr_store_radio_reset); |