summaryrefslogtreecommitdiff
path: root/io-module/mtr2d2.c
diff options
context:
space:
mode:
authorMike Fiore <mfiore@multitech.com>2014-08-27 16:35:15 -0500
committerMike Fiore <mfiore@multitech.com>2014-08-27 16:35:15 -0500
commit1e563fc723ad8a44850b92f9c6e8c0bb41178215 (patch)
tree18acba9d4715284bd778687abbeef9dfe5984879 /io-module/mtr2d2.c
parent6709e0cb9fce54385937ccd4d42dece2159664a9 (diff)
downloadmts-io-1e563fc723ad8a44850b92f9c6e8c0bb41178215.tar.gz
mts-io-1e563fc723ad8a44850b92f9c6e8c0bb41178215.tar.bz2
mts-io-1e563fc723ad8a44850b92f9c6e8c0bb41178215.zip
accessory cards: support both ports
allow for 2 GPIOB accessory cards to be used at the same time some misc cleanup, more specific logging on init commented out mtr2 platform as it currently causes build issues with accessory card changes
Diffstat (limited to 'io-module/mtr2d2.c')
-rw-r--r--io-module/mtr2d2.c134
1 files changed, 134 insertions, 0 deletions
diff --git a/io-module/mtr2d2.c b/io-module/mtr2d2.c
index 58aeb03..b2fc03f 100644
--- a/io-module/mtr2d2.c
+++ b/io-module/mtr2d2.c
@@ -146,9 +146,130 @@ static struct gpio_pin gpio_pins_mtr2d2_0_0[] = {
},
.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",
+ }
+ },
+
+ // 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",
+ }
+ },
+
{ },
};
+static int mtr2d2_platform_attributes_size = 64; // not including NULL at end
+
static struct attribute *mtr2d2_platform_attributes[] = {
&dev_attr_vendor_id.attr,
&dev_attr_product_id.attr,
@@ -207,6 +328,19 @@ static struct attribute *mtr2d2_platform_attributes[] = {
NULL, // index 49
NULL, // index 50
NULL, // index 51
+ NULL, // index 52
+ NULL, // index 53
+ NULL, // index 54
+ NULL, // index 55
+ NULL, // index 56
+ NULL, // index 57
+ NULL, // index 58
+ NULL, // index 59
+ NULL, // index 60
+ NULL, // index 61
+ NULL, // index 62
+ NULL, // index 63
+ NULL, // index 64
NULL,
};