From fb1341ca0996b26fc95857a4763e3bc6d94db24d Mon Sep 17 00:00:00 2001 From: John Klug Date: Fri, 2 Oct 2020 15:49:47 -0500 Subject: Move PIN mapping for MTAC-PULSE to MTAC driver, add TI --- mtac_pulse.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/mtac_pulse.c b/mtac_pulse.c index 9b5443a..569e640 100644 --- a/mtac_pulse.c +++ b/mtac_pulse.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 "MTAC Pulse Accessory Card" #define DRIVER_NAME "mtac-pulse" @@ -12,6 +12,12 @@ #include #include #include +#ifdef TI43X +#include +#endif +#ifdef SAM9G25 +#include +#endif /********************************************************************** * COPYRIGHT 2012-2018 CONNECTED DEVELOPMENT, LLC @@ -30,12 +36,12 @@ * ***********************************************************************/ -static struct gpio_pin gpio_pins_mtcdt_mtac_pulse[] = { +static struct gpio_pin gpio_pins_mtac_pulse[] = { // gpio pins for Accessory Card 1 { .name = "AP1_RESET", .pin = { - .gpio = AT91_PIN_PB12, + .gpio = M_AP1_NRESET, .flags = GPIOF_OUT_INIT_HIGH, .label = "ap1-reset", } @@ -43,7 +49,7 @@ static struct gpio_pin gpio_pins_mtcdt_mtac_pulse[] = { { .name = "AP1_GPIO1", .pin = { - .gpio = AT91_PIN_PC6, + .gpio = M_AP1_GPIO1, .flags = GPIOF_OUT_INIT_LOW, .label = "ap1-gpio1", }, @@ -53,7 +59,7 @@ static struct gpio_pin gpio_pins_mtcdt_mtac_pulse[] = { { .name = "AP2_RESET", .pin = { - .gpio = AT91_PIN_PB13, + .gpio = M_AP1_NRESET, .flags = GPIOF_OUT_INIT_HIGH, .label = "ap2-reset", } @@ -61,7 +67,7 @@ static struct gpio_pin gpio_pins_mtcdt_mtac_pulse[] = { { .name = "AP2_GPIO1", .pin = { - .gpio = AT91_PIN_PC20, + .gpio = M_AP2_GPIO1, .flags = GPIOF_OUT_INIT_LOW, .label = "ap2-gpio1", }, @@ -128,7 +134,7 @@ static bool pulse_setup(enum ap port) { return false; } - mtac_set_port_pins(port_index,gpio_pins_mtcdt_mtac_pulse,subdir); + mtac_set_port_pins(port_index,gpio_pins_mtac_pulse,subdir); // create the link to the apX directory this card is in // if we're in the first slot, we get plain "pulse" @@ -207,9 +213,9 @@ static bool pulse_setup(enum ap port) { /* override ap_reset output mode to open drain */ if (port == 1) { - res = gpio_request_one(AT91_PIN_PB12, GPIOF_OUT_INIT_HIGH | GPIOF_OPEN_DRAIN, "ap1-reset"); + res = gpio_request_one(M_AP1_NRESET, GPIOF_OUT_INIT_HIGH | GPIOF_OPEN_DRAIN, "ap1-reset"); } else { - res = gpio_request_one(AT91_PIN_PB13, GPIOF_OUT_INIT_HIGH | GPIOF_OPEN_DRAIN, "ap2-reset"); + res = gpio_request_one(M_AP2_NRESET, GPIOF_OUT_INIT_HIGH | GPIOF_OPEN_DRAIN, "ap2-reset"); } if (res != 0) { -- cgit v1.2.3