diff options
author | John Klug <john.klug@multitech.com> | 2016-09-30 17:22:00 -0500 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2016-09-30 17:22:00 -0500 |
commit | cf9e2ae0c4193f784138e098c929a36a9aaa8854 (patch) | |
tree | a9b66d291b8d852c4e5ed71b709fdabe7d154322 /io-module/mtcdt.c | |
parent | 670c959a9bdfd4aaae25a6d0c30e31d29b6761de (diff) | |
download | mts-io-cf9e2ae0c4193f784138e098c929a36a9aaa8854.tar.gz mts-io-cf9e2ae0c4193f784138e098c929a36a9aaa8854.tar.bz2 mts-io-cf9e2ae0c4193f784138e098c929a36a9aaa8854.zip |
mts-io driver for Lora-H and additional resets
Diffstat (limited to 'io-module/mtcdt.c')
-rw-r--r-- | io-module/mtcdt.c | 102 |
1 files changed, 87 insertions, 15 deletions
diff --git a/io-module/mtcdt.c b/io-module/mtcdt.c index 156bd27..21edcfe 100644 --- a/io-module/mtcdt.c +++ b/io-module/mtcdt.c @@ -1,3 +1,8 @@ +/* + * Within a struct gpio_pin, there is only one + * occurance of each pin, so there is only one + * pin label set for each gpio pin. + */ static struct gpio_pin gpio_pins_mtcdt_0_0[] = { { .name = "RADIO_RESET", @@ -436,7 +441,7 @@ static struct gpio_pin gpio_pins_mtcdt_0_1[] = { } }, - // gpio pins for Accessory Card 2 + // gpio pin for Accessory Card 2 { .name = "AP2_RESET", .pin = { @@ -446,6 +451,15 @@ static struct gpio_pin gpio_pins_mtcdt_0_1[] = { } }, { + .name = "ETH_RESET", + .pin = { + .gpio = AT91_PIN_PC4, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "eth-reset", + } + }, + // gpio pin for Accessory Card 2 + { .name = "AP2_GPIO1", .pin = { .gpio = AT91_PIN_PC20, @@ -500,7 +514,8 @@ static struct gpio_pin gpio_pins_mtcdt_0_1[] = { .gpio = AT91_PIN_PA0, .flags = GPIOF_IN, .label = "wifi-bt-ulpwkup", - } + }, + .capability = CAPA_WIFI_BT, }, { .name = "WIFI_BT_LPWKUP", @@ -508,7 +523,8 @@ static struct gpio_pin gpio_pins_mtcdt_0_1[] = { .gpio = AT91_PIN_PA6, .flags = GPIOF_IN, .label = "wifi-bt-lpwkup", - } + }, + .capability = CAPA_WIFI_BT, }, { .name = "WIFI_BT_INT", @@ -516,7 +532,8 @@ static struct gpio_pin gpio_pins_mtcdt_0_1[] = { .gpio = AT91_PIN_PB11, .flags = GPIOF_IN, .label = "wifi-bt-int", - } + }, + .capability = CAPA_WIFI_BT, }, { .name = "WIFI_BT_RESET", @@ -524,15 +541,8 @@ static struct gpio_pin gpio_pins_mtcdt_0_1[] = { .gpio = AT91_PIN_PD14, .flags = GPIOF_OUT_INIT_HIGH, .label = "wifi-bt-reset", - } - }, - { - .name = "WIFI_BT_LPMODE", - .pin = { - .gpio = AT91_PIN_PD20, - .flags = GPIOF_IN, - .label = "wifi-bt-lpmode", - } + }, + .capability = CAPA_WIFI_BT, }, { .name = "GNSS_RESET", @@ -540,7 +550,8 @@ static struct gpio_pin gpio_pins_mtcdt_0_1[] = { .gpio = AT91_PIN_PD15, .flags = GPIOF_OUT_INIT_HIGH, .label = "gnss-reset", - } + }, + .capability = CAPA_GNSS, }, { .name = "SECURE_RESET", @@ -572,10 +583,63 @@ static struct gpio_pin gpio_pins_mtcdt_0_1[] = { .gpio = AT91_PIN_PD19, .flags = GPIOF_OUT_INIT_HIGH, .label = "gnss-int", - } + }, + .capability = CAPA_GNSS, }, + { + .name = "WIFI_BT_LPMODE", + .pin = { + .gpio = AT91_PIN_PD20, + .flags = GPIOF_IN, + .label = "wifi-bt-lpmode", + }, + .capability = CAPA_WIFI_BT, + }, + { }, +}; +// LORA H or 1.5, AP1 +static struct gpio_pin lora_h[3 /* Port */][3 /* Pin */] = { + { // port 1 of 2 + { // gpio 1 for LORA H + .name = "AP1_CDONE", + .pin = { + .gpio = AT91_PIN_PC6, + .flags = GPIOF_IN, + .label = "ap1-cdone", + }, + }, + { // gpio 2 for LORA H + .name = "AP1_CRESET", + .pin = { + .gpio = AT91_PIN_PC7, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "ap1-creset", + } + }, { }, + }, // End of port 1 +// LORA H or 1.5, AP2 + { // Port 2 of 2 + { // gpio 1 for LORA H + .name = "AP2_CDONE", + .pin = { + .gpio = AT91_PIN_PC20, + .flags = GPIOF_IN, + .label = "ap2-cdone", + }, + }, + { // gpio 2 for LORA H + .name = "AP2_CRESET", + .pin = { + .gpio = AT91_PIN_PC21, + .flags = GPIOF_OUT_INIT_HIGH, + .label = "ap2-creset", + } + }, + { }, + }, // End of port 2 + { }, }; static DEVICE_ATTR_MTS(dev_attr_wifi_bt_lpwkup, "wifi-bt-lpwkup", @@ -592,6 +656,12 @@ static DEVICE_ATTR_MTS(dev_attr_gnss_reset, "gnss-reset", mts_attr_show_gpio_pin, mts_attr_store_gpio_pin); static DEVICE_ATTR_MTS(dev_attr_usbhub_reset, "usbhub-reset", mts_attr_show_gpio_pin, mts_attr_store_gpio_pin); +static DEVICE_ATTR_MTS(dev_attr_eth_reset, "eth-reset", + mts_attr_show_gpio_pin, mts_attr_store_gpio_pin); +static DEVICE_ATTR_MTS(dev_attr_gnss_int, "gnss-int", + mts_attr_show_gpio_pin, mts_attr_store_gpio_pin); + + static struct attribute *mtcdt_platform_attributes[] = { &dev_attr_vendor_id.attr, @@ -659,7 +729,9 @@ static struct attribute *mtcdt_0_1_platform_attributes[] = { &dev_attr_wifi_bt_lpmode.attr, &dev_attr_wifi_bt_int, &dev_attr_gnss_reset.attr, + &dev_attr_gnss_int.attr, &dev_attr_usbhub_reset.attr, + &dev_attr_eth_reset.attr, NULL, }; |