summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--io-module/mts_io.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/io-module/mts_io.c b/io-module/mts_io.c
index 8c1251b..438e98c 100644
--- a/io-module/mts_io.c
+++ b/io-module/mts_io.c
@@ -1005,10 +1005,19 @@ static ssize_t mts_attr_store_dout(struct device *dev,
mutex_lock(&spi_dout_mutex);
- if (value) {
- spi_dout_value &= ~bit;
- } else {
- spi_dout_value |= bit;
+ if (!strcmp(id_eeprom.product_id, PRODUCT_ID_MT100ECDP)) {
+ if (!value) {
+ spi_dout_value &= ~bit;
+ } else {
+ spi_dout_value |= bit;
+ }
+ }
+ else {
+ if (value) {
+ spi_dout_value &= ~bit;
+ } else {
+ spi_dout_value |= bit;
+ }
}
spi_writen(spi_dout_dev, &spi_dout_value, 1);
@@ -1052,7 +1061,12 @@ static ssize_t mts_attr_show_dout(struct device *dev,
mutex_lock(&spi_dout_mutex);
- value = spi_dout_value & bit ? 0 : 1;
+ if (!strcmp(id_eeprom.product_id, PRODUCT_ID_MT100ECDP)) {
+ value = spi_dout_value & bit ? 1 : 0;
+ }
+ else {
+ value = spi_dout_value & bit ? 0 : 1;
+ }
mutex_unlock(&spi_dout_mutex);
@@ -1769,7 +1783,7 @@ static ssize_t mts_attr_show_gpio11(struct device *dev,
return value;
}
- return sprintf(buf, "%d\n", !value);
+ return sprintf(buf, "%d\n", value);
}
static ssize_t mts_attr_store_gpio11(struct device *dev,
@@ -1789,7 +1803,7 @@ static ssize_t mts_attr_store_gpio11(struct device *dev,
mutex_lock(&mts_io_mutex);
- err = at91_set_gpio_value(pin->pin, !value);
+ err = at91_set_gpio_value(pin->pin, value);
mutex_unlock(&mts_io_mutex);
@@ -1816,7 +1830,7 @@ static ssize_t mts_attr_show_gpio12(struct device *dev,
return value;
}
- return sprintf(buf, "%d\n", !value);
+ return sprintf(buf, "%d\n", value);
}
static ssize_t mts_attr_store_gpio12(struct device *dev,
@@ -1836,7 +1850,7 @@ static ssize_t mts_attr_store_gpio12(struct device *dev,
mutex_lock(&mts_io_mutex);
- err = at91_set_gpio_value(pin->pin, !value);
+ err = at91_set_gpio_value(pin->pin, value);
mutex_unlock(&mts_io_mutex);