From e022faf54d1f9885b79e70252a80bd1ae4f15fbd Mon Sep 17 00:00:00 2001 From: Mykyta Dorokhin Date: Thu, 15 Sep 2016 22:34:20 +0300 Subject: mtp: perform the radio reset on mts-io module loading. --- io-module/mts_io.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 " #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); -- cgit v1.2.3