From f0d840d1902b8f09687d253c793bee7ad9624c3f Mon Sep 17 00:00:00 2001 From: John Klug Date: Mon, 28 Feb 2022 16:53:09 -0600 Subject: Move MTAC-PULSE to GPIO descriptor library in the kernel --- mtac_pulse.c | 65 ++++++++++++++++++++---------------------------------------- 1 file changed, 21 insertions(+), 44 deletions(-) (limited to 'mtac_pulse.c') 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 -#include #include #include #include @@ -12,67 +11,56 @@ #include #include #include -#ifdef TI43X -#include -#endif -#ifdef SAM9G25 -#include -#endif +#include /********************************************************************** * 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; } -- cgit v1.2.3