summaryrefslogtreecommitdiff
path: root/io-module/mtcdt.c
diff options
context:
space:
mode:
authorJesse Gilles <jgilles@multitech.com>2014-11-04 11:04:24 -0600
committerJesse Gilles <jgilles@multitech.com>2014-11-04 11:04:24 -0600
commitcdf9e59ab6a793bb158c91c91aa0312a72211ad0 (patch)
treeac23d2b0b3e2f62744253707117edf5d6233a2cf /io-module/mtcdt.c
parente87ec476597042ce75ec11e82287a5540933291b (diff)
downloadmts-io-cdf9e59ab6a793bb158c91c91aa0312a72211ad0.tar.gz
mts-io-cdf9e59ab6a793bb158c91c91aa0312a72211ad0.tar.bz2
mts-io-cdf9e59ab6a793bb158c91c91aa0312a72211ad0.zip
rename mtr2d2 to mtcdt
Diffstat (limited to 'io-module/mtcdt.c')
-rw-r--r--io-module/mtcdt.c297
1 files changed, 297 insertions, 0 deletions
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
+};