diff options
author | Mykyta Dorokhin <mykyta.dorokhin@globallogic.com> | 2016-09-15 22:34:20 +0300 |
---|---|---|
committer | Mykyta Dorokhin <mykyta.dorokhin@globallogic.com> | 2016-09-15 22:34:20 +0300 |
commit | e022faf54d1f9885b79e70252a80bd1ae4f15fbd (patch) | |
tree | 15eab3918ace90ae098b055a1bfa2ab9a232d325 /io-module | |
parent | 6192f3b1193c5a839547b5acd9da1ea03bafccce (diff) | |
download | mts-io-e022faf54d1f9885b79e70252a80bd1ae4f15fbd.tar.gz mts-io-e022faf54d1f9885b79e70252a80bd1ae4f15fbd.tar.bz2 mts-io-e022faf54d1f9885b79e70252a80bd1ae4f15fbd.zip |
mtp: perform the radio reset on mts-io module loading.1.3.2
Diffstat (limited to 'io-module')
-rw-r--r-- | io-module/mts_io.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/io-module/mts_io.c b/io-module/mts_io.c index 17bf31f..0d2457d 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.4.0" +#define DRIVER_VERSION "v1.3.2" #define DRIVER_AUTHOR "James Maki <jmaki@multitech.com>" #define DRIVER_DESC "MTS-IO Controller" #define DRIVER_NAME "mts-io" @@ -74,6 +74,7 @@ static struct mts_id_eeprom_layout id_eeprom; #define NUM_AP 0 #endif +static uint8_t mts_hw_version; static struct platform_device *mts_io_platform_device; static struct attribute_group *attr_group; static struct gpio_pin *gpio_pins; @@ -758,6 +759,7 @@ static int mts_id_eeprom_load(void) int i; char buf[64] = {0}; char* ptr; + mts_hw_version = MTCDT_0_0; //The mts_id_eeprom buffer is initialize once on boot //reloading the mts_io.ko module will not reinitialize this buffer @@ -770,15 +772,18 @@ static int mts_id_eeprom_load(void) } else if (strncmp(id_eeprom.hw_version, HW_VERSION_MTP_0_0, strlen(HW_VERSION_MTP_0_0)) == 0) { attr_group = &mtp_0_0_platform_attribute_group; gpio_pins = gpio_pins_mtp_0_0; + mts_hw_version = MTP_0_0; log_info("detected board %s", HW_VERSION_MTP_0_0); } else if (strncmp(id_eeprom.hw_version, HW_VERSION_MTCDT_0_1, strlen(HW_VERSION_MTCDT_0_1)) == 0) { attr_group = &mtcdt_0_1_platform_attribute_group; gpio_pins = gpio_pins_mtcdt_0_1; + mts_hw_version = MTCDT_0_1; log_info("detected board %s", HW_VERSION_MTCDT_0_1); } else { attr_group = &mtcdt_platform_attribute_group; gpio_pins = gpio_pins_mtcdt_0_0; + mts_hw_version = MTCDT_0_0; log_info("detected board %s", HW_VERSION_MTCDT_0_0); } @@ -885,6 +890,14 @@ static int __init mts_io_init(void) // start the reset handler reset_callback(NULL); + if (mts_hw_version == MTP_0_0) { + /* Resetting/powering-on radio on MTP */ + log_info("Resetting/powering-on radio"); + mutex_lock(&mts_io_mutex); + radio_reset_mtp(); + mutex_unlock(&mts_io_mutex); + } + /* init timers */ setup_timer(&radio_reset_timer, radio_reset_timer_callback, 0); setup_timer(&radio_reset_available_timer, radio_reset_available_timer_callback, 0); |