summaryrefslogtreecommitdiff
path: root/mtac_pulse.c
diff options
context:
space:
mode:
Diffstat (limited to 'mtac_pulse.c')
-rw-r--r--mtac_pulse.c65
1 files changed, 21 insertions, 44 deletions
diff --git a/mtac_pulse.c b/mtac_pulse.c
index 569e640..ac58f5e 100644
--- a/mtac_pulse.c
+++ b/mtac_pulse.c
@@ -1,10 +1,9 @@
-#define DRIVER_VERSION "v1.1.1"
+#define DRIVER_VERSION "v2.0.0"
#define DRIVER_AUTHOR "Multi-Tech"
#define DRIVER_DESC "MTAC Pulse Accessory Card"
#define DRIVER_NAME "mtac-pulse"
#include <linux/types.h>
-#include <linux/gpio.h>
#include <linux/platform_device.h>
#include <linux/kmod.h>
#include <linux/bitops.h>
@@ -12,67 +11,56 @@
#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
+#include <linux/gpio/consumer.h>
/**********************************************************************
* COPYRIGHT 2012-2018 CONNECTED DEVELOPMENT, LLC
*
- * ALL RIGHTS RESERVED BY AND FOR THE EXCLUSIVE BENEFIT OF
- * CONNECTED DEVELOPMENT, LLC.
- *
- * CONNECTED DEVELOPMENT, LLC - CONFIDENTIAL AND PROPRIETARY
- * INFORMATION AND/OR TRADE SECRET.
- *
- * NOTICE: ALL CODE, PROGRAM, INFORMATION, SCRIPT, INSTRUCTION,
- * DATA, AND COMMENT HEREIN IS AND SHALL REMAIN THE CONFIDENTIAL
- * INFORMATION AND PROPERTY OF CONNECTED DEVELOPMENT, LLC.
- * USE AND DISCLOSURE THEREOF, EXCEPT AS STRICTLY AUTHORIZED IN A
- * WRITTEN AGREEMENT SIGNED BY CONNECTED DEVELOPMENT, LLC IS PROHIBITED.
- *
+ * Copyright 2022 Multi-Tech Systems
***********************************************************************/
static struct gpio_pin gpio_pins_mtac_pulse[] = {
// gpio pins for Accessory Card 1
{
- .name = "AP1_RESET",
+ .name = "AP1_NRESET",
.pin = {
- .gpio = M_AP1_NRESET,
- .flags = GPIOF_OUT_INIT_HIGH,
+ .gpio = ~0U,
+ .flags = GPIOD_OUT_HIGH, /* Not setting Open-Drain see README */
.label = "ap1-reset",
- }
+ },
+ .do_gpio_desc = 1,
},
{
.name = "AP1_GPIO1",
.pin = {
- .gpio = M_AP1_GPIO1,
- .flags = GPIOF_OUT_INIT_LOW,
+ .gpio = ~0,
+ .flags = GPIOD_OUT_LOW,
.label = "ap1-gpio1",
},
+ .do_gpio_desc = 1,
.active_low = 1,
},
// gpio pins for Accessory Card 2
{
- .name = "AP2_RESET",
+ .name = "AP2_NRESET",
.pin = {
- .gpio = M_AP1_NRESET,
- .flags = GPIOF_OUT_INIT_HIGH,
+ .gpio = ~0,
+ .flags = GPIOD_OUT_HIGH, /* Not setting Open-Drain see README */
.label = "ap2-reset",
- }
+ },
+ .do_gpio_desc = 1,
},
{
.name = "AP2_GPIO1",
.pin = {
- .gpio = M_AP2_GPIO1,
- .flags = GPIOF_OUT_INIT_LOW,
+ .gpio = ~0,
+ .flags = GPIOD_OUT_LOW,
.label = "ap2-gpio1",
},
+ .do_gpio_desc = 1,
.active_low = 1,
- }
+ },
+ {},
};
static char* pulse_gpio_pin_name_by_attr_name(const char *name, int port) {
@@ -211,17 +199,6 @@ static bool pulse_setup(enum ap port) {
return false;
}
- /* override ap_reset output mode to open drain */
- if (port == 1) {
- res = gpio_request_one(M_AP1_NRESET, GPIOF_OUT_INIT_HIGH | GPIOF_OPEN_DRAIN, "ap1-reset");
- } else {
- res = gpio_request_one(M_AP2_NRESET, GPIOF_OUT_INIT_HIGH | GPIOF_OPEN_DRAIN, "ap2-reset");
- }
- if (res != 0)
- {
- log_error("failed to change ap%d_reset to open drain output", port);
- }
-
return true;
}