summaryrefslogtreecommitdiff
path: root/io-module/mtcdt.c
diff options
context:
space:
mode:
authorMike Nicholson <mikempls@users.noreply.github.com>2019-07-19 16:15:12 -0500
committerMike Nicholson <mikempls@users.noreply.github.com>2019-07-19 16:15:12 -0500
commitb7ce14e05a4a2fb00935a9e4995002a267a9d469 (patch)
tree1764c7c408366546e5e5b300374af1e696a5fed2 /io-module/mtcdt.c
parent6edda2b3a73cbf41f6f92055d8949a4095f24d33 (diff)
downloadmts-io-b7ce14e05a4a2fb00935a9e4995002a267a9d469.tar.gz
mts-io-b7ce14e05a4a2fb00935a9e4995002a267a9d469.tar.bz2
mts-io-b7ce14e05a4a2fb00935a9e4995002a267a9d469.zip
MTCDT3 support (missing device reset, MTQ reset)
Diffstat (limited to 'io-module/mtcdt.c')
-rw-r--r--io-module/mtcdt.c477
1 files changed, 0 insertions, 477 deletions
diff --git a/io-module/mtcdt.c b/io-module/mtcdt.c
deleted file mode 100644
index 69f87f7..0000000
--- a/io-module/mtcdt.c
+++ /dev/null
@@ -1,477 +0,0 @@
-#include "at91gpio.h"
-/*
- * Within a struct gpio_pin, there is only one
- * occurrence 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",
- .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 = "ETH_RESET",
- .pin = {
- .gpio = AT91_PIN_PC4,
- .flags = GPIOF_OUT_INIT_HIGH,
- .label = "eth-reset",
- }
- },
- {
- .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 = "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-a",
- },
- .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-b",
- },
- .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-c",
- },
- .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-d",
- },
- .active_low = 1,
- },
-};
-
-static struct gpio_pin gpio_pins_mtcdt_0_1[] = {
- {
- .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 = "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-a",
- },
- .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-b",
- },
- .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-c",
- },
- .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-d",
- },
- .active_low = 1,
- },
- {
- .name = "ETH_RESET",
- .pin = {
- .gpio = AT91_PIN_PC4,
- .flags = GPIOF_OUT_INIT_HIGH,
- .label = "eth-reset",
- }
- },
- {
- .name = "WIFI_BT_ULPWKUP",
- .pin = {
- .gpio = AT91_PIN_PA0,
- .flags = GPIOF_IN,
- .label = "wifi-bt-ulpwkup",
- },
- .capability = CAPA_WIFI,
- },
- {
- .name = "WIFI_BT_LPWKUP",
- .pin = {
- .gpio = AT91_PIN_PA6,
- .flags = GPIOF_IN,
- .label = "wifi-bt-lpwkup",
- },
- .capability = CAPA_WIFI,
- },
- {
- .name = "WIFI_BT_INT",
- .pin = {
- .gpio = AT91_PIN_PB11,
- .flags = GPIOF_IN,
- .label = "wifi-bt-int",
- },
- .capability = CAPA_WIFI,
- },
- {
- .name = "WIFI_BT_RESET",
- .pin = {
- .gpio = AT91_PIN_PD14,
- .flags = GPIOF_OUT_INIT_HIGH,
- .label = "wifi-bt-reset",
- },
- .capability = CAPA_WIFI,
- },
- {
- .name = "GNSS_RESET",
- .pin = {
- .gpio = AT91_PIN_PD15,
- .flags = GPIOF_OUT_INIT_LOW, /* Keep GPS quiet during boot */
- .label = "gnss-reset",
- },
- .capability = CAPA_GPS,
- },
- {
- .name = "SECURE_RESET",
- .pin = {
- .gpio = AT91_PIN_PD16,
- .flags = GPIOF_OUT_INIT_HIGH,
- .label = "secure-reset",
- }
- },
- {
- .name = "MTQ_RESET",
- .pin = {
- .gpio = AT91_PIN_PD17,
- .flags = GPIOF_OUT_INIT_HIGH,
- .label = "mtq-reset",
- }
- },
- {
- .name = "USBHUB_RESET",
- .pin = {
- .gpio = AT91_PIN_PD18,
- .flags = GPIOF_OUT_INIT_HIGH,
- .label = "usbhub-reset",
- }
- },
- {
- .name = "GNSS_INT",
- .pin = {
- .gpio = AT91_PIN_PD19,
- .flags = GPIOF_OUT_INIT_HIGH,
- .label = "gnss-int",
- },
- .capability = CAPA_GPS,
- },
- {
- .name = "WIFI_BT_LPMODE",
- .pin = {
- .gpio = AT91_PIN_PD20,
- .flags = GPIOF_IN,
- .label = "wifi-bt-lpmode",
- },
- .capability = CAPA_WIFI,
- },
- { },
-};
-
-static DEVICE_ATTR_MTS(dev_attr_wifi_bt_lpwkup, "wifi-bt-lpwkup",
- mts_attr_show_gpio_pin, mts_attr_store_gpio_pin);
-static DEVICE_ATTR_MTS(dev_attr_wifi_bt_ulpwkup, "wifi-bt-ulpwkup",
- mts_attr_show_gpio_pin, mts_attr_store_gpio_pin);
-static DEVICE_ATTR_MTS(dev_attr_wifi_bt_reset, "wifi-bt-reset",
- mts_attr_show_gpio_pin, mts_attr_store_gpio_pin);
-static DEVICE_ATTR_RO_MTS(dev_attr_wifi_bt_lpmode, "wifi-bt-lpmode",
- mts_attr_show_gpio_pin);
-static DEVICE_ATTR_RO_MTS(dev_attr_wifi_bt_int, "wifi-bt-int",
- mts_attr_show_gpio_pin);
-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,
- &dev_attr_product_id.attr,
- &dev_attr_device_id.attr,
- &dev_attr_uuid.attr,
- &dev_attr_hw_version.attr,
- &dev_attr_imei.attr,
- &dev_attr_eth_mac.attr,
- &dev_attr_has_radio.attr,
- &dev_attr_reset.attr,
- &dev_attr_reset_monitor.attr,
- &dev_attr_reset_monitor_intervals.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_eth_reset.attr,
-
- &dev_attr_radio_power.attr,
- &dev_attr_radio_reset.attr,
-
- &dev_attr_radio_reset_backoffs.attr,
- &dev_attr_radio_reset_backoff_index.attr,
- &dev_attr_radio_reset_backoff_seconds.attr,
- NULL,
-};
-
-static struct attribute *mtcdt_0_1_platform_attributes[] = {
- &dev_attr_vendor_id.attr,
- &dev_attr_product_id.attr,
- &dev_attr_device_id.attr,
- &dev_attr_uuid.attr,
- &dev_attr_hw_version.attr,
- &dev_attr_imei.attr,
- &dev_attr_eth_mac.attr,
- &dev_attr_has_radio.attr,
- &dev_attr_reset.attr,
- &dev_attr_reset_monitor.attr,
- &dev_attr_reset_monitor_intervals.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_usbhub_reset.attr,
- &dev_attr_eth_reset.attr,
-
- // radio feature is last to be able to
- // easily remove radio.
- // is_radio_power_attr_mtcdt() searches
- // for this for truncation.
- &dev_attr_radio_power.attr, /* Must be first radio attribute */
- &dev_attr_radio_reset.attr,
-
- &dev_attr_radio_reset_backoffs.attr,
- &dev_attr_radio_reset_backoff_index.attr,
- &dev_attr_radio_reset_backoff_seconds.attr,
-
- NULL,
-};
-
-static struct attribute *mtcdt_0_1_wifi_bt_attributes[] = {
- &dev_attr_wifi_bt_lpwkup.attr,
- &dev_attr_wifi_bt_ulpwkup.attr,
- &dev_attr_wifi_bt_reset.attr,
- &dev_attr_wifi_bt_lpmode.attr,
- &dev_attr_wifi_bt_int.attr,
-};
-
-static struct attribute *mtcdt_0_1_gnss_attributes[] = {
- &dev_attr_gnss_reset.attr,
- &dev_attr_gnss_int.attr,
-};
-
-
-static struct attribute_group mtcdt_platform_attribute_group = {
- .attrs = mtcdt_platform_attributes
-};
-static struct attribute_group mtcdt_0_1_platform_attribute_group = {
- .attrs = mtcdt_0_1_platform_attributes
-};
-
-
-static int
-is_radio_power_attr_mtcdt(struct attribute *attr)
-{
- return (attr == &dev_attr_radio_power.attr);
-}