summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2020-10-02 15:20:57 -0500
committerJohn Klug <john.klug@multitech.com>2020-10-02 15:20:57 -0500
commite6c76e4b3fa7df78186c3381ea4aadf7b9decd0c (patch)
tree3f6613494f7ea1674259acddeb05b1e8cc7533f0
parent04fd03e97b7b0eab59a7f693a7145e2b064c049d (diff)
downloadmtac-xdot-1.1.1.tar.gz
mtac-xdot-1.1.1.tar.bz2
mtac-xdot-1.1.1.zip
Move PIN mapping for MTAC-XDOT to MTAC driver, add TI1.1.1
-rw-r--r--mtac_xdot.c20
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]) {