diff options
-rw-r--r-- | mtac_xdot.c | 20 |
1 files 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 <john.klug@multitech.com>" +#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 <linux/slab.h> #include <linux/mtac.h> #include <linux/mts_io.h> +#ifdef TI43X +#include <linux/ti43x_gpio.h> +#endif +#ifdef SAM9G25 +#include <linux/sam9g25_gpio.h> +#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]) { |