diff options
author | Jesse Gilles <jgilles@multitech.com> | 2013-01-14 18:15:58 -0600 |
---|---|---|
committer | Jesse Gilles <jgilles@multitech.com> | 2013-01-14 18:15:58 -0600 |
commit | 3eb107eb75d909c0a940b99cb1c033b6da485f9c (patch) | |
tree | b0bbbceb2ab0d8e4a9a96407bbcfd08eaaf38854 /io-module/mts_io.c | |
parent | ef8856a810429e44003294fd9585b16509a9d962 (diff) | |
download | cdp-io-controller-3eb107eb75d909c0a940b99cb1c033b6da485f9c.tar.gz cdp-io-controller-3eb107eb75d909c0a940b99cb1c033b6da485f9c.tar.bz2 cdp-io-controller-3eb107eb75d909c0a940b99cb1c033b6da485f9c.zip |
read hw_version for MTR, MTR2, log detected board config
* allows for different product-id as long as hw-version is right (MTR3)
Diffstat (limited to 'io-module/mts_io.c')
-rw-r--r-- | io-module/mts_io.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/io-module/mts_io.c b/io-module/mts_io.c index 547f730..1f3040e 100644 --- a/io-module/mts_io.c +++ b/io-module/mts_io.c @@ -774,6 +774,7 @@ static int mts_id_eeprom_load(void) gpio_pins = gpio_pins_mtcdp_0_0; mts_product_id = MTCDP_E1_DK_0_0; + log_info("detected board %s", HW_VERSION_MTCDP_0_0); } else if (strncmp(id_eeprom.product_id, PRODUCT_ID_MT100EOCG, strlen(PRODUCT_ID_MT100EOCG)) == 0) { gpio_pins = gpio_pins_mt100eocg_0_0; mts_product_id = MT100EOCG_0_0; @@ -781,20 +782,23 @@ static int mts_id_eeprom_load(void) has_spi_din = 1; has_spi_dout = 1; has_spi_temp = 1; - } else if (strncmp(id_eeprom.product_id, PRODUCT_ID_MTR2, strlen(PRODUCT_ID_MTR2)) == 0) { + log_info("detected board %s", HW_VERSION_MT100EOCG_0_0); + } else if (strncmp(id_eeprom.hw_version, HW_VERSION_MTR2_0_0, strlen(HW_VERSION_MTR2_0_0)) == 0) { gpio_pins = gpio_pins_mtr2_0_0; mts_product_id = MTR2_0_0; has_spi_sout = 0; has_spi_din = 0; has_spi_dout = 0; has_spi_temp = 1; - } else if (strncmp(id_eeprom.product_id, PRODUCT_ID_MTR, strlen(PRODUCT_ID_MTR)) == 0) { + log_info("detected board %s", HW_VERSION_MTR2_0_0); + } else if (strncmp(id_eeprom.hw_version, HW_VERSION_MTR_0_0, strlen(HW_VERSION_MTR_0_0)) == 0) { gpio_pins = gpio_pins_mtr_0_0; mts_product_id = MTR_0_0; has_spi_sout = 0; has_spi_din = 0; has_spi_dout = 0; has_spi_temp = 0; + log_info("detected board %s", HW_VERSION_MTR_0_0); } else { gpio_pins = gpio_pins_mtcdp_1_0; mts_product_id = MTCDP_E1_DK_1_0; @@ -802,6 +806,7 @@ static int mts_id_eeprom_load(void) has_spi_din = 1; has_spi_dout = 1; has_spi_temp = 1; + log_info("detected board %s", HW_VERSION_MTCDP_1_0); } log_info("sizeof: %lu", (unsigned long) sizeof(struct mts_id_eeprom_layout)); |