From cdf9e59ab6a793bb158c91c91aa0312a72211ad0 Mon Sep 17 00:00:00 2001 From: Jesse Gilles Date: Tue, 4 Nov 2014 11:04:24 -0600 Subject: rename mtr2d2 to mtcdt --- io-module/mtcdt.c | 297 +++++++++++++++++++++++++++++++++++++++++++++++++++++ io-module/mtr2d2.c | 297 ----------------------------------------------------- io-module/mts_io.c | 8 +- io-module/mts_io.h | 6 +- 4 files changed, 304 insertions(+), 304 deletions(-) create mode 100644 io-module/mtcdt.c delete mode 100644 io-module/mtr2d2.c diff --git a/io-module/mtcdt.c b/io-module/mtcdt.c new file mode 100644 index 0000000..02ed59d --- /dev/null +++ b/io-module/mtcdt.c @@ -0,0 +1,297 @@ +static struct gpio_pin gpio_pins_mtcdt_0_0[] = { + { + .name = "RADIO_RESET", + .pin = { + .gpio = AT91_PIN_PC3, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "radio-reset", + }, + }, + { + .name = "RADIO_RESET", + .pin = { + .gpio = AT91_PIN_PC3, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "radio-power", + }, + }, + { + .name = "DEVICE_RESET", + .pin = { + .gpio = AT91_PIN_PC2, + .flags = GPIOF_IN, + .label = "reset", + }, + .active_low = 1, + }, + { + .name = "LS_LED", /* LED7 */ + .pin = { + .gpio = AT91_PIN_PA14, +#if LED_LS_CONTROLLABLE + .flags = GPIOF_OUT_INIT_HIGH, +#else + .flags = GPIOF_IN, +#endif + .label = "led-ls", + }, + .active_low = 1, + }, + { + .name = "STATUS_LED", /* LED2 */ + .pin = { + .gpio = AT91_PIN_PA24, + .flags = GPIOF_OUT_INIT_LOW, + .label = "led-status", + }, + .active_low = 1, + }, + { + .name = "STATUS_LED", + .pin = { + .gpio = AT91_PIN_PA24, + .flags = GPIOF_OUT_INIT_LOW, + .label = "led-a", + }, + .active_low = 1, + }, + { + .name = "LED5", + .pin = { + .gpio = AT91_PIN_PA25, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "led-cd", + }, + .active_low = 1, + }, + { + .name = "LED5", + .pin = { + .gpio = AT91_PIN_PA25, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "led-b", + }, + .active_low = 1, + }, + { + .name = "LED1", + .pin = { + .gpio = AT91_PIN_PA26, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "led-sig1", + }, + .active_low = 1, + }, + { + .name = "LED1", + .pin = { + .gpio = AT91_PIN_PA26, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "led-c", + }, + .active_low = 1, + }, + { + .name = "LED4", + .pin = { + .gpio = AT91_PIN_PA27, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "led-sig2", + }, + .active_low = 1, + }, + { + .name = "LED4", + .pin = { + .gpio = AT91_PIN_PA27, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "led-d", + }, + .active_low = 1, + }, + { + .name = "LED3", + .pin = { + .gpio = AT91_PIN_PA28, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "led-sig3", + }, + .active_low = 1, + }, + { + .name = "LED3", + .pin = { + .gpio = AT91_PIN_PA28, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "led-e", + }, + .active_low = 1, + }, + + // gpio pins for Accessory Card 1 + { + .name = "AP1_RESET", + .pin = { + .gpio = AT91_PIN_PB12, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "ap1-reset", + } + }, + { + .name = "AP1_GPIO1", + .pin = { + .gpio = AT91_PIN_PC6, + .flags = GPIOF_OUT_INIT_LOW, + .label = "ap1-gpio1", + }, + .active_low = 1, + }, + { + .name = "AP1_GPIO2", + .pin = { + .gpio = AT91_PIN_PC7, + .flags = GPIOF_OUT_INIT_LOW, + .label = "ap1-gpio2", + } + }, + { + .name = "AP1_GPIO3", + .pin = { + .gpio = AT91_PIN_PC8, + .flags = GPIOF_OUT_INIT_LOW, + .label = "ap1-gpio3", + } + }, + { + .name = "AP1_GPIO4", + .pin = { + .gpio = AT91_PIN_PC9, + .flags = GPIOF_OUT_INIT_LOW, + .label = "ap1-gpio4", + } + }, + { + .name = "AP1_INTERRUPT1", + .pin = { + .gpio = AT91_PIN_PB14, + .flags = GPIOF_IN, + .label = "ap1-interrupt1", + } + }, + { + .name = "AP1_INTERRUPT2", + .pin = { + .gpio = AT91_PIN_PB15, + .flags = GPIOF_IN, + .label = "ap1-interrupt2", + } + }, + { + .name = "AP1_GPS_PPS", + .pin = { + .gpio = AT91_PIN_PA29, + .flags = GPIOF_IN, + .label = "ap1-gps-pps", + } + }, + + // gpio pins for Accessory Card 2 + { + .name = "AP2_RESET", + .pin = { + .gpio = AT91_PIN_PB13, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "ap2-reset", + } + }, + { + .name = "AP2_GPIO1", + .pin = { + .gpio = AT91_PIN_PC20, + .flags = GPIOF_OUT_INIT_LOW, + .label = "ap2-gpio1", + }, + .active_low = 1, + }, + { + .name = "AP2_GPIO2", + .pin = { + .gpio = AT91_PIN_PC21, + .flags = GPIOF_OUT_INIT_LOW, + .label = "ap2-gpio2", + } + }, + { + .name = "AP2_GPIO3", + .pin = { + .gpio = AT91_PIN_PC22, + .flags = GPIOF_OUT_INIT_LOW, + .label = "ap2-gpio3", + } + }, + { + .name = "AP2_GPIO4", + .pin = { + .gpio = AT91_PIN_PC23, + .flags = GPIOF_OUT_INIT_LOW, + .label = "ap2-gpio4", + } + }, + { + .name = "AP2_INTERRUPT1", + .pin = { + .gpio = AT91_PIN_PB17, + .flags = GPIOF_IN, + .label = "ap2-interrupt1", + } + }, + { + .name = "AP2_INTERRUPT2", + .pin = { + .gpio = AT91_PIN_PB18, + .flags = GPIOF_IN, + .label = "ap2-interrupt2", + } + }, + { + .name = "AP2_GPS_PPS", + .pin = { + .gpio = AT91_PIN_PA6, + .flags = GPIOF_IN, + .label = "ap2-gps-pps", + } + }, + + { }, +}; + +static struct attribute *mtcdt_platform_attributes[] = { + &dev_attr_vendor_id.attr, + &dev_attr_product_id.attr, + &dev_attr_device_id.attr, + &dev_attr_hw_version.attr, + &dev_attr_imei.attr, + &dev_attr_eth_mac.attr, + &dev_attr_reset.attr, + &dev_attr_reset_monitor.attr, + &dev_attr_reset_monitor_intervals.attr, + &dev_attr_radio_power.attr, + &dev_attr_radio_reset.attr, + + &dev_attr_led_status.attr, + &dev_attr_led_cd_gpio.attr, + &dev_attr_led_sig1_gpio.attr, + &dev_attr_led_sig2_gpio.attr, + &dev_attr_led_sig3_gpio.attr, + + &dev_attr_led_a_gpio.attr, + &dev_attr_led_b_gpio.attr, + &dev_attr_led_c_gpio.attr, + &dev_attr_led_d_gpio.attr, + &dev_attr_led_e_gpio.attr, + NULL, +}; + +static struct attribute_group mtcdt_platform_attribute_group = { + .attrs = mtcdt_platform_attributes +}; diff --git a/io-module/mtr2d2.c b/io-module/mtr2d2.c deleted file mode 100644 index 4876c90..0000000 --- a/io-module/mtr2d2.c +++ /dev/null @@ -1,297 +0,0 @@ -static struct gpio_pin gpio_pins_mtr2d2_0_0[] = { - { - .name = "RADIO_RESET", - .pin = { - .gpio = AT91_PIN_PC3, - .flags = GPIOF_OUT_INIT_HIGH, - .label = "radio-reset", - }, - }, - { - .name = "RADIO_RESET", - .pin = { - .gpio = AT91_PIN_PC3, - .flags = GPIOF_OUT_INIT_HIGH, - .label = "radio-power", - }, - }, - { - .name = "DEVICE_RESET", - .pin = { - .gpio = AT91_PIN_PC2, - .flags = GPIOF_IN, - .label = "reset", - }, - .active_low = 1, - }, - { - .name = "LS_LED", /* LED7 */ - .pin = { - .gpio = AT91_PIN_PA14, -#if LED_LS_CONTROLLABLE - .flags = GPIOF_OUT_INIT_HIGH, -#else - .flags = GPIOF_IN, -#endif - .label = "led-ls", - }, - .active_low = 1, - }, - { - .name = "STATUS_LED", /* LED2 */ - .pin = { - .gpio = AT91_PIN_PA24, - .flags = GPIOF_OUT_INIT_LOW, - .label = "led-status", - }, - .active_low = 1, - }, - { - .name = "STATUS_LED", - .pin = { - .gpio = AT91_PIN_PA24, - .flags = GPIOF_OUT_INIT_LOW, - .label = "led-a", - }, - .active_low = 1, - }, - { - .name = "LED5", - .pin = { - .gpio = AT91_PIN_PA25, - .flags = GPIOF_OUT_INIT_HIGH, - .label = "led-cd", - }, - .active_low = 1, - }, - { - .name = "LED5", - .pin = { - .gpio = AT91_PIN_PA25, - .flags = GPIOF_OUT_INIT_HIGH, - .label = "led-b", - }, - .active_low = 1, - }, - { - .name = "LED1", - .pin = { - .gpio = AT91_PIN_PA26, - .flags = GPIOF_OUT_INIT_HIGH, - .label = "led-sig1", - }, - .active_low = 1, - }, - { - .name = "LED1", - .pin = { - .gpio = AT91_PIN_PA26, - .flags = GPIOF_OUT_INIT_HIGH, - .label = "led-c", - }, - .active_low = 1, - }, - { - .name = "LED4", - .pin = { - .gpio = AT91_PIN_PA27, - .flags = GPIOF_OUT_INIT_HIGH, - .label = "led-sig2", - }, - .active_low = 1, - }, - { - .name = "LED4", - .pin = { - .gpio = AT91_PIN_PA27, - .flags = GPIOF_OUT_INIT_HIGH, - .label = "led-d", - }, - .active_low = 1, - }, - { - .name = "LED3", - .pin = { - .gpio = AT91_PIN_PA28, - .flags = GPIOF_OUT_INIT_HIGH, - .label = "led-sig3", - }, - .active_low = 1, - }, - { - .name = "LED3", - .pin = { - .gpio = AT91_PIN_PA28, - .flags = GPIOF_OUT_INIT_HIGH, - .label = "led-e", - }, - .active_low = 1, - }, - - // gpio pins for Accessory Card 1 - { - .name = "AP1_RESET", - .pin = { - .gpio = AT91_PIN_PB12, - .flags = GPIOF_OUT_INIT_HIGH, - .label = "ap1-reset", - } - }, - { - .name = "AP1_GPIO1", - .pin = { - .gpio = AT91_PIN_PC6, - .flags = GPIOF_OUT_INIT_LOW, - .label = "ap1-gpio1", - }, - .active_low = 1, - }, - { - .name = "AP1_GPIO2", - .pin = { - .gpio = AT91_PIN_PC7, - .flags = GPIOF_OUT_INIT_LOW, - .label = "ap1-gpio2", - } - }, - { - .name = "AP1_GPIO3", - .pin = { - .gpio = AT91_PIN_PC8, - .flags = GPIOF_OUT_INIT_LOW, - .label = "ap1-gpio3", - } - }, - { - .name = "AP1_GPIO4", - .pin = { - .gpio = AT91_PIN_PC9, - .flags = GPIOF_OUT_INIT_LOW, - .label = "ap1-gpio4", - } - }, - { - .name = "AP1_INTERRUPT1", - .pin = { - .gpio = AT91_PIN_PB14, - .flags = GPIOF_IN, - .label = "ap1-interrupt1", - } - }, - { - .name = "AP1_INTERRUPT2", - .pin = { - .gpio = AT91_PIN_PB15, - .flags = GPIOF_IN, - .label = "ap1-interrupt2", - } - }, - { - .name = "AP1_GPS_PPS", - .pin = { - .gpio = AT91_PIN_PA29, - .flags = GPIOF_IN, - .label = "ap1-gps-pps", - } - }, - - // gpio pins for Accessory Card 2 - { - .name = "AP2_RESET", - .pin = { - .gpio = AT91_PIN_PB13, - .flags = GPIOF_OUT_INIT_HIGH, - .label = "ap2-reset", - } - }, - { - .name = "AP2_GPIO1", - .pin = { - .gpio = AT91_PIN_PC20, - .flags = GPIOF_OUT_INIT_LOW, - .label = "ap2-gpio1", - }, - .active_low = 1, - }, - { - .name = "AP2_GPIO2", - .pin = { - .gpio = AT91_PIN_PC21, - .flags = GPIOF_OUT_INIT_LOW, - .label = "ap2-gpio2", - } - }, - { - .name = "AP2_GPIO3", - .pin = { - .gpio = AT91_PIN_PC22, - .flags = GPIOF_OUT_INIT_LOW, - .label = "ap2-gpio3", - } - }, - { - .name = "AP2_GPIO4", - .pin = { - .gpio = AT91_PIN_PC23, - .flags = GPIOF_OUT_INIT_LOW, - .label = "ap2-gpio4", - } - }, - { - .name = "AP2_INTERRUPT1", - .pin = { - .gpio = AT91_PIN_PB17, - .flags = GPIOF_IN, - .label = "ap2-interrupt1", - } - }, - { - .name = "AP2_INTERRUPT2", - .pin = { - .gpio = AT91_PIN_PB18, - .flags = GPIOF_IN, - .label = "ap2-interrupt2", - } - }, - { - .name = "AP2_GPS_PPS", - .pin = { - .gpio = AT91_PIN_PA6, - .flags = GPIOF_IN, - .label = "ap2-gps-pps", - } - }, - - { }, -}; - -static struct attribute *mtr2d2_platform_attributes[] = { - &dev_attr_vendor_id.attr, - &dev_attr_product_id.attr, - &dev_attr_device_id.attr, - &dev_attr_hw_version.attr, - &dev_attr_imei.attr, - &dev_attr_eth_mac.attr, - &dev_attr_reset.attr, - &dev_attr_reset_monitor.attr, - &dev_attr_reset_monitor_intervals.attr, - &dev_attr_radio_power.attr, - &dev_attr_radio_reset.attr, - - &dev_attr_led_status.attr, - &dev_attr_led_cd_gpio.attr, - &dev_attr_led_sig1_gpio.attr, - &dev_attr_led_sig2_gpio.attr, - &dev_attr_led_sig3_gpio.attr, - - &dev_attr_led_a_gpio.attr, - &dev_attr_led_b_gpio.attr, - &dev_attr_led_c_gpio.attr, - &dev_attr_led_d_gpio.attr, - &dev_attr_led_e_gpio.attr, - NULL, -}; - -static struct attribute_group mtr2d2_platform_attribute_group = { - .attrs = mtr2d2_platform_attributes -}; diff --git a/io-module/mts_io.c b/io-module/mts_io.c index 9058096..cd39f99 100644 --- a/io-module/mts_io.c +++ b/io-module/mts_io.c @@ -374,7 +374,7 @@ static DEVICE_ATTR_RO_MTS(dev_attr_eth_mac, "mac-eth", mts_attr_show_product_info); /* include per-device pins and attributes */ -#include "mtr2d2.c" +#include "mtcdt.c" static bool load_port(int port) { int port_index = port - 1; @@ -455,9 +455,9 @@ static int mts_id_eeprom_load(void) log_error("uninitialized eeprom"); return -EIO; } else { - attr_group = &mtr2d2_platform_attribute_group; - gpio_pins = gpio_pins_mtr2d2_0_0; - log_info("detected board %s", HW_VERSION_MTR2D2_0_0); + attr_group = &mtcdt_platform_attribute_group; + gpio_pins = gpio_pins_mtcdt_0_0; + log_info("detected board %s", HW_VERSION_MTCDT_0_0); } log_info("sizeof: %lu", (unsigned long) sizeof(struct mts_id_eeprom_layout)); diff --git a/io-module/mts_io.h b/io-module/mts_io.h index 3645e17..1b51cd3 100644 --- a/io-module/mts_io.h +++ b/io-module/mts_io.h @@ -43,7 +43,7 @@ struct device_attribute _dev_name = { \ #define PRODUCT_ID_MTCDP_E1_DK "MTCDP-E1-DK" #define PRODUCT_ID_MT100EOCG "MT100EOCG" #define PRODUCT_ID_MTR "MTR" -#define PRODUCT_ID_MTR2D2 "MTR2D2" +#define PRODUCT_ID_MTCDT "MTCDT" #define PRODUCT_ID_MTAC_GPIOB "MTAC-GPIOB" #define PRODUCT_ID_MTAC_MFSER "MTAC-MFSER" @@ -55,7 +55,7 @@ struct device_attribute _dev_name = { \ #define HW_VERSION_MT100EOCG_0_0 "MT100EOCG-0.0" #define HW_VERSION_MTR_0_0 "MTR-0.0" #define HW_VERSION_MTR_0_1 "MTR-0.1" -#define HW_VERSION_MTR2D2_0_0 "MTR2D2-0.0" +#define HW_VERSION_MTCDT_0_0 "MTCDT-0.0" enum { MTCDP_E1_DK_0_0, @@ -63,7 +63,7 @@ enum { MT100EOCG_0_0, MTR_0_0, MTR_0_1, - MTR2D2_0_0, + MTCDT_0_0, }; enum { -- cgit v1.2.3