From e6c76e4b3fa7df78186c3381ea4aadf7b9decd0c Mon Sep 17 00:00:00 2001 From: John Klug Date: Fri, 2 Oct 2020 15:20:57 -0500 Subject: Move PIN mapping for MTAC-XDOT to MTAC driver, add TI --- mtac_xdot.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/mtac_xdot.c b/mtac_xdot.c index eae2f4e..2035182 100644 --- a/mtac_xdot.c +++ b/mtac_xdot.c @@ -1,5 +1,5 @@ -#define DRIVER_VERSION "v1.1.0" -#define DRIVER_AUTHOR "John Klug " +#define DRIVER_VERSION "v1.1.1" +#define DRIVER_AUTHOR "Multi-Tech" #define DRIVER_DESC "MTS XDOT (LoRa) Accessory Card" #define DRIVER_NAME "mtac-xdot" #define DEBUG 0 @@ -13,13 +13,19 @@ #include #include #include +#ifdef TI43X +#include +#endif +#ifdef SAM9G25 +#include +#endif static struct gpio_pin gpio_pins_mtcdt_mtac_xdot[] = { // gpio pins for Accessory Card 1 { .name = "AP1_RESET", .pin = { - .gpio = AT91_PIN_PB12, + .gpio = M_AP1_NRESET, .flags = GPIOF_OUT_INIT_HIGH, // Only when not flashing .label = "ap1-reset", } @@ -30,7 +36,7 @@ static struct gpio_pin gpio_pins_mtcdt_mtac_xdot[] = { { .name = "AP2_RESET", .pin = { - .gpio = AT91_PIN_PB13, + .gpio = M_AP2_NRESET, .flags = GPIOF_OUT_INIT_HIGH, // Only when not flashing .label = "ap2-reset", } @@ -61,7 +67,8 @@ static ssize_t xdot_show_reset(struct kobject *kobj, return -ENODEV; } - log_debug("mtac_attr_show_ap_gpio_pin: State of mtac mutex is %d",(*(int *)(&mtac_mutex.count))); + log_debug("mtac_attr_show_ap_gpio_pin: State of mtac mutex is %s", + mutex_is_locked(&mtac_mutex) ? "locked" : "unlocked"); mutex_lock(&mtac_mutex); value = gpio_get_value(pin->pin.gpio); @@ -107,7 +114,8 @@ static ssize_t xdot_store_reset(struct kobject *kobj, log_debug("xdot_store_reset: old %d new %d",reset_state[port_index],value); - log_debug("mtac_attr_store_ap_gpio_pin: State of mtac mutex is %d",(*(int *)(&mtac_mutex.count))); + log_debug("mtac_attr_store_ap_gpio_pin: State of mtac mutex is %s", + mutex_is_locked(&mtac_mutex) ? "locked" : "unlocked"); mutex_lock(&mtac_mutex); if (value == reset_state[port_index]) { -- cgit v1.2.3