diff options
author | Mykyta Dorokhin <mykyta.dorokhin@globallogic.com> | 2017-04-03 15:08:56 +0300 |
---|---|---|
committer | Mykyta Dorokhin <mykyta.dorokhin@globallogic.com> | 2017-04-03 15:08:56 +0300 |
commit | 5a93570f21fb963f2dc1bdd4dedc01f2d9a86200 (patch) | |
tree | f97cb9a24e56a23147a1b03ecf0d620d902d3a3c /io-module/mts_io.c | |
parent | e1db81e1665f45461e284e69c9cfbc037ba3cb2b (diff) | |
download | mts-io-5a93570f21fb963f2dc1bdd4dedc01f2d9a86200.tar.gz mts-io-5a93570f21fb963f2dc1bdd4dedc01f2d9a86200.tar.bz2 mts-io-5a93570f21fb963f2dc1bdd4dedc01f2d9a86200.zip |
Add mtr support
Diffstat (limited to 'io-module/mts_io.c')
-rw-r--r-- | io-module/mts_io.c | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/io-module/mts_io.c b/io-module/mts_io.c index 371243c..1217250 100644 --- a/io-module/mts_io.c +++ b/io-module/mts_io.c @@ -47,7 +47,7 @@ #include "mts_io.h" -#define DRIVER_VERSION "v1.5.10" +#define DRIVER_VERSION "v1.5.11" #define DRIVER_AUTHOR "James Maki <jmaki@multitech.com>" #define DRIVER_DESC "MTS-IO Controller" #define DRIVER_NAME "mts-io" @@ -124,7 +124,7 @@ static void reset_callback(struct work_struct *ignored) mutex_lock(&mts_io_mutex); - pin = gpio_pin_by_name("DEVICE_RESET"); + pin = gpio_pin_by_attr_name("reset"); if (pin) { reset_pressed = !gpio_get_value(pin->pin.gpio); } @@ -288,7 +288,7 @@ static ssize_t mts_attr_store_radio_reset(struct device *dev, log_info("radio is reset\n"); - pin = gpio_pin_by_name("RADIO_RESET"); + pin = gpio_pin_by_attr_name("radio-reset"); if (!pin) { return -ENODEV; @@ -592,6 +592,14 @@ static ssize_t mts_attr_show_product_info(struct device *dev, value = sprintf(buf, "%.32s\n", id_eeprom.hw_version); } else if (strcmp(attr->attr.name, "imei") == 0) { value = sprintf(buf, "%.32s\n", id_eeprom.imei); + } else if (strcmp(attr->attr.name, "mac-wifi") == 0) { + value = sprintf(buf, "%02X:%02X:%02X:%02X:%02X:%02X\n", + id_eeprom.mac_wifi[0], + id_eeprom.mac_wifi[1], + id_eeprom.mac_wifi[2], + id_eeprom.mac_wifi[3], + id_eeprom.mac_wifi[4], + id_eeprom.mac_wifi[5]); } else if (strcmp(attr->attr.name, "mac-eth") == 0) { value = sprintf(buf, "%02X:%02X:%02X:%02X:%02X:%02X\n", id_eeprom.mac_addr[0], @@ -640,6 +648,7 @@ static DEVICE_ATTR_RO_MTS(dev_attr_eth_mac, "mac-eth", /* include per-device pins and attributes */ #include "mtcdt.c" #include "mtcap.c" +#include "mtr.c" /* include capabilities sub-directory support */ #include "mts_capab.c" @@ -821,8 +830,27 @@ static int mts_id_eeprom_load() } mts_hw_version = MTCAP_0_0; log_info("detected board %s", HW_VERSION_MTCAP_0_0); - } - else if (strncmp(id_eeprom.hw_version, HW_VERSION_MTCDT_0_1, strlen(HW_VERSION_MTCDT_0_1)) == 0) { + } else if (strncmp(id_eeprom.hw_version, HW_VERSION_MTR_0_0, strlen(HW_VERSION_MTR_0_0)) == 0) { + attr_group = &mtr_platform_attribute_group; + gpio_pins = gpio_pins_mtr_0_0; + mts_hw_version = MTR_0_0; + log_info("detected board %s", HW_VERSION_MTR_0_0); + } else if (strncmp(id_eeprom.hw_version, HW_VERSION_MTR_0_1, strlen(HW_VERSION_MTR_0_1)) == 0) { + attr_group = &mtr_platform_attribute_group; + gpio_pins = gpio_pins_mtr_0_1; + mts_hw_version = MTR_0_1; + log_info("detected board %s", HW_VERSION_MTR_0_1); + } else if (strncmp(id_eeprom.hw_version, HW_VERSION_MTRV1_0_0, strlen(HW_VERSION_MTRV1_0_0)) == 0) { + attr_group = &mtr_platform_attribute_group; + gpio_pins = gpio_pins_mtrv1_0_0; + mts_hw_version = MTRV1_0_0; + log_info("detected board %s", HW_VERSION_MTRV1_0_0); + } else if (strncmp(id_eeprom.hw_version, HW_VERSION_MTRV1_0_1, strlen(HW_VERSION_MTRV1_0_1)) == 0) { + attr_group = &mtrv1_0_1_platform_attribute_group; + gpio_pins = gpio_pins_mtrv1_0_1; + mts_hw_version = MTRV1_0_1; + log_info("detected board %s", HW_VERSION_MTRV1_0_1); + } else if (strncmp(id_eeprom.hw_version, HW_VERSION_MTCDT_0_1, strlen(HW_VERSION_MTCDT_0_1)) == 0) { attr_blength = sizeof mtcdt_0_1_platform_attributes; if(DEVICE_CAPA(id_eeprom.capa, CAPA_WIFI)) { attr_blength += sizeof mtcdt_0_1_wifi_bt_attributes; |