diff options
author | John Klug <john.klug@multitech.com> | 2020-10-02 11:38:47 -0500 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2020-10-02 11:38:47 -0500 |
commit | a0f2265f433f14f0e0afa768b098ff4a54b2b27a (patch) | |
tree | 4379b0f71aa79439978129b7ff59711bcad3fcbb | |
parent | 3f05329be8476d12900ce31e78bb48a8f38a9761 (diff) | |
download | mtac-mfser-a0f2265f433f14f0e0afa768b098ff4a54b2b27a.tar.gz mtac-mfser-a0f2265f433f14f0e0afa768b098ff4a54b2b27a.tar.bz2 mtac-mfser-a0f2265f433f14f0e0afa768b098ff4a54b2b27a.zip |
Add TI Processer GPIO's to MTAC-MFSER module
-rw-r--r-- | machine/sam9g25_mfser_gpio.h | 19 | ||||
-rw-r--r-- | machine/ti43x_mfser_gpio.h | 19 | ||||
-rw-r--r-- | mtac_mfser.c | 32 |
3 files changed, 57 insertions, 13 deletions
diff --git a/machine/sam9g25_mfser_gpio.h b/machine/sam9g25_mfser_gpio.h new file mode 100644 index 0000000..1f94a83 --- /dev/null +++ b/machine/sam9g25_mfser_gpio.h @@ -0,0 +1,19 @@ +#ifndef SAM9G25_MFSER_GPIO_H +#define SAM9G25_MFSER_GPIO_H + +#include <linux/at91gpio.h> + +// M_* for machine specific GPIO pin + +// gpio pins for Accessory Card 1 +#define M_AP1_GPIO1 AT91_PIN_PC6 +#define M_AP1_GPIO2 AT91_PIN_PC7 +#define M_AP1_GPIO3 AT91_PIN_PC8 +#define M_AP1_GPIO4 AT91_PIN_PC9 + +// gpio pins for Accessory Card 2 +#define M_AP2_GPIO1 AT91_PIN_PC20 +#define M_AP2_GPIO2 AT91_PIN_PC21 +#define M_AP2_GPIO3 AT91_PIN_PC22 +#define M_AP2_GPIO4 AT91_PIN_PC23 +#endif /* SAM9G25_MFSER_GPIO_H */
\ No newline at end of file diff --git a/machine/ti43x_mfser_gpio.h b/machine/ti43x_mfser_gpio.h new file mode 100644 index 0000000..ce227e7 --- /dev/null +++ b/machine/ti43x_mfser_gpio.h @@ -0,0 +1,19 @@ +#ifndef TI43X_MFSER_GPIO_H +#define TI43X_MFSER_GPIO_H + +#define OMAP_GPIO(BANK, GPIO) ((BANK*32)+GPIO) + +// M_* for machine specific GPIO pin + +// gpio pins for Accessory Card 1 +#define M_AP1_GPIO1 OMAP_GPIO(1,0) +#define M_AP1_GPIO2 OMAP_GPIO(0,24) +#define M_AP1_GPIO3 OMAP_GPIO(0,23) +#define M_AP1_GPIO4 OMAP_GPIO(0,22) + +// gpio pins for Accessory Card 2 +#define M_AP2_GPIO1 OMAP_GPIO(3,19) +#define M_AP2_GPIO2 OMAP_GPIO(3,16) +#define M_AP2_GPIO3 OMAP_GPIO(3,20) +#define M_AP2_GPIO4 OMAP_GPIO(0,19) +#endif /* SAM9G25_MFSER_GPIO_H */
\ No newline at end of file diff --git a/mtac_mfser.c b/mtac_mfser.c index 2b5ca29..04da4e8 100644 --- a/mtac_mfser.c +++ b/mtac_mfser.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 Multi-Fuction Serial Accessory Card" #define DRIVER_NAME "mtac-mfser" @@ -12,13 +12,19 @@ #include <linux/slab.h> #include <linux/mtac.h> #include <linux/mts_io.h> - -static struct gpio_pin gpio_pins_mtcdt_mtac_mfser[] = { +#ifdef TI43X +#include "machine/ti43x_mfser_gpio.h" +#endif +#ifdef SAM9G25 +#include "machine/sam9g25_mfser_gpio.h" +#endif + +static struct gpio_pin gpio_pins_mtac_mfser[] = { // gpio pins for Accessory Card 1 { .name = "AP1_GPIO1", .pin = { - .gpio = AT91_PIN_PC6, + .gpio = M_AP1_GPIO1, .flags = GPIOF_OUT_INIT_LOW, .label = "ap1-gpio1", }, @@ -27,7 +33,7 @@ static struct gpio_pin gpio_pins_mtcdt_mtac_mfser[] = { { .name = "AP1_GPIO2", .pin = { - .gpio = AT91_PIN_PC7, + .gpio = M_AP1_GPIO2, .flags = GPIOF_OUT_INIT_LOW, .label = "ap1-gpio2", } @@ -35,7 +41,7 @@ static struct gpio_pin gpio_pins_mtcdt_mtac_mfser[] = { { .name = "AP1_GPIO3", .pin = { - .gpio = AT91_PIN_PC8, + .gpio = M_AP1_GPIO3, .flags = GPIOF_OUT_INIT_LOW, .label = "ap1-gpio3", } @@ -43,7 +49,7 @@ static struct gpio_pin gpio_pins_mtcdt_mtac_mfser[] = { { .name = "AP1_GPIO4", .pin = { - .gpio = AT91_PIN_PC9, + .gpio = M_AP1_GPIO4, .flags = GPIOF_OUT_INIT_LOW, .label = "ap1-gpio4", } @@ -54,7 +60,7 @@ static struct gpio_pin gpio_pins_mtcdt_mtac_mfser[] = { { .name = "AP2_GPIO1", .pin = { - .gpio = AT91_PIN_PC20, + .gpio = M_AP2_GPIO1, .flags = GPIOF_OUT_INIT_LOW, .label = "ap2-gpio1", }, @@ -63,7 +69,7 @@ static struct gpio_pin gpio_pins_mtcdt_mtac_mfser[] = { { .name = "AP2_GPIO2", .pin = { - .gpio = AT91_PIN_PC21, + .gpio = M_AP2_GPIO2, .flags = GPIOF_OUT_INIT_LOW, .label = "ap2-gpio2", } @@ -71,7 +77,7 @@ static struct gpio_pin gpio_pins_mtcdt_mtac_mfser[] = { { .name = "AP2_GPIO3", .pin = { - .gpio = AT91_PIN_PC22, + .gpio = M_AP2_GPIO3, .flags = GPIOF_OUT_INIT_LOW, .label = "ap2-gpio3", } @@ -79,7 +85,7 @@ static struct gpio_pin gpio_pins_mtcdt_mtac_mfser[] = { { .name = "AP2_GPIO4", .pin = { - .gpio = AT91_PIN_PC23, + .gpio = M_AP2_GPIO4, .flags = GPIOF_OUT_INIT_LOW, .label = "ap2-gpio4", } @@ -268,7 +274,7 @@ static bool mfser_setup(enum ap port) { return false; } - mtac_set_port_pins(port_index,gpio_pins_mtcdt_mtac_mfser,subdir); + mtac_set_port_pins(port_index,gpio_pins_mtac_mfser,subdir); // create the link to the apX directory this card is in // if we're in the first slot, we get plain "mfser" |