summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2021-10-07 12:03:28 -0500
committerAndrii Pientsov <andrii.pientsov@globallogic.com>2021-11-18 14:17:16 +0200
commit0a530e44b823d51dbf7fd28f3beeecdc35756cb0 (patch)
tree8e23a3d5272714e69e1f39c3e19e5d021188bf74
parenteba8f2e0bdd00faff0347dadebbb1b949e7c2de4 (diff)
downloadmeta-multitech-0a530e44b823d51dbf7fd28f3beeecdc35756cb0.tar.gz
meta-multitech-0a530e44b823d51dbf7fd28f3beeecdc35756cb0.tar.bz2
meta-multitech-0a530e44b823d51dbf7fd28f3beeecdc35756cb0.zip
Add new GPIOs to mtac-mfser
-rw-r--r--recipes-bsp/multitech/mtac-mfser/serial-enable-tx-enable.patch173
-rw-r--r--recipes-bsp/multitech/mtac-mfser_1.1.1.bb3
2 files changed, 175 insertions, 1 deletions
diff --git a/recipes-bsp/multitech/mtac-mfser/serial-enable-tx-enable.patch b/recipes-bsp/multitech/mtac-mfser/serial-enable-tx-enable.patch
new file mode 100644
index 0000000..01a2142
--- /dev/null
+++ b/recipes-bsp/multitech/mtac-mfser/serial-enable-tx-enable.patch
@@ -0,0 +1,173 @@
+diff --git a/mtac_mfser.c b/mtac_mfser.c
+index d8548cb..fd7b0b6 100644
+--- a/mtac_mfser.c
++++ b/mtac_mfser.c
+@@ -1,4 +1,4 @@
+-#define DRIVER_VERSION "v1.1.1"
++#define DRIVER_VERSION "v1.2.0"
+ #define DRIVER_AUTHOR "Multi-Tech"
+ #define DRIVER_DESC "MTS Multi-Fuction Serial Accessory Card"
+ #define DRIVER_NAME "mtac-mfser"
+@@ -12,6 +12,7 @@
+ #include <linux/slab.h>
+ #include <linux/mtac.h>
+ #include <linux/mts_io.h>
++#include <linux/mts_io_module.h>
+ #ifdef TI43X
+ #include <linux/ti43x_gpio.h>
+ #endif
+@@ -54,6 +55,86 @@ static struct gpio_pin gpio_pins_mtac_mfser[] = {
+ .label = "ap1-gpio4",
+ }
+ },
++
++ // gpio pins for Accessory Card 2
++ {
++ .name = "AP2_GPIO1",
++ .pin = {
++ .gpio = M_AP2_GPIO1,
++ .flags = GPIOF_OUT_INIT_LOW,
++ .label = "ap2-gpio1",
++ },
++ .active_low = 1,
++ },
++ {
++ .name = "AP2_GPIO2",
++ .pin = {
++ .gpio = M_AP2_GPIO2,
++ .flags = GPIOF_OUT_INIT_LOW,
++ .label = "ap2-gpio2",
++ }
++ },
++ {
++ .name = "AP2_GPIO3",
++ .pin = {
++ .gpio = M_AP2_GPIO3,
++ .flags = GPIOF_OUT_INIT_LOW,
++ .label = "ap2-gpio3",
++ }
++ },
++ {
++ .name = "AP2_GPIO4",
++ .pin = {
++ .gpio = M_AP2_GPIO4,
++ .flags = GPIOF_OUT_INIT_LOW,
++ .label = "ap2-gpio4",
++ }
++ },
++ { },
++};
++static struct gpio_pin gpio_pins_mtac_mfser_RI[] = {
++ // gpio pins for Accessory Card 1
++ {
++ .name = "AP1_GPIO1",
++ .pin = {
++ .gpio = M_AP1_GPIO1,
++ .flags = GPIOF_OUT_INIT_LOW,
++ .label = "ap1-gpio1",
++ },
++ .active_low = 1,
++ },
++ {
++ .name = "AP1_GPIO2",
++ .pin = {
++ .gpio = M_AP1_GPIO2,
++ .flags = GPIOF_OUT_INIT_LOW,
++ .label = "ap1-gpio2",
++ }
++ },
++ {
++ .name = "AP1_GPIO3",
++ .pin = {
++ .gpio = M_AP1_GPIO3,
++ .flags = GPIOF_OUT_INIT_LOW,
++ .label = "ap1-gpio3",
++ }
++ },
++ {
++ .name = "AP1_GPIO4",
++ .pin = {
++ .gpio = M_AP1_GPIO4,
++ .flags = GPIOF_OUT_INIT_LOW,
++ .label = "ap1-gpio4",
++ }
++ },
++ { // MTCDT-0.4 only
++ .name = "AP1_ENABLE_TX_ENABLE",
++ .pin = {
++ .gpio = AT91_PIN_PC31,
++ .flags = GPIOF_OUT_INIT_LOW,
++ .label = "ap1-enable-tx-enable",
++ }
++ },
+
+
+ // gpio pins for Accessory Card 2
+@@ -90,7 +171,15 @@ static struct gpio_pin gpio_pins_mtac_mfser[] = {
+ .label = "ap2-gpio4",
+ }
+ },
+- { },
++ { // MTCDT-0.4 only
++ .name = "AP2_ENABLE_TX_ENABLE",
++ .pin = {
++ .gpio = AT91_PIN_PC30,
++ .flags = GPIOF_OUT_INIT_LOW,
++ .label = "ap2-enable-tx-enable",
++ }
++ },
++ { },
+ };
+
+ static char* mfser_gpio_pin_name_by_attr_name(const char* name, int port) {
+@@ -251,8 +340,9 @@ static ssize_t mts_attr_store_mfser_mode(struct kobject *kobj,
+ // 1 product-id
+ // 1 device-id
+ // 1 hw-version
++// 1 enable_tx_enable
+ // NULL
+-static size_t ap_mfser_attrs_size = 8;
++static size_t ap_mfser_attrs_size = 9;
+
+ static bool mfser_setup(enum ap port) {
+ int i;
+@@ -264,6 +354,7 @@ static bool mfser_setup(enum ap port) {
+ struct kobj_attribute* attr;
+ struct attribute **attrs;
+ struct kobject *subdir;
++ char *tmp;
+
+ log_info("loading MFSER accessory card in port %d", port);
+
+@@ -273,8 +364,10 @@ static bool mfser_setup(enum ap port) {
+ log_error("kobject_create_and_add for MFSER in port %d failed", port);
+ return false;
+ }
+-
+- mtac_set_port_pins(port_index,gpio_pins_mtac_mfser,subdir);
++ if ((tmp=HW_VERSION_MTCDT_0_2),strncmp(mts_get_hw_version(), tmp, strlen(tmp)) == 0)
++ mtac_set_port_pins(port_index,gpio_pins_mtac_mfser_RI,subdir);
++ else
++ 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"
+@@ -334,6 +427,18 @@ static bool mfser_setup(enum ap port) {
+ attr->store = mtac_attr_store_ap_gpio_pin;
+ attrs[index++] = &attr->attr;
+
++ if ((tmp=HW_VERSION_MTCDT_0_2),strncmp(mts_get_hw_version(), tmp, strlen(tmp)) == 0) {
++ sprintf(buf, "enable-tx-enable");
++ attr = mtac_create_attribute(buf, MTS_ATTR_MODE_RW);
++ if (! attr) {
++ log_error("failed to create attribute [%s] for MFSER in port %d", buf, port);
++ return false;
++ }
++ attr->show = mtac_attr_show_ap_gpio_pin;
++ attr->store = mtac_attr_store_ap_gpio_pin;
++ attrs[index++] = &attr->attr;
++ }
++
+ // add attributes for eeprom contents
+ if (! mtac_add_product_info_attributes(port, attrs, &index)) {
+ log_error("failed to add product info attributes for MFSER in port %d", port);
diff --git a/recipes-bsp/multitech/mtac-mfser_1.1.1.bb b/recipes-bsp/multitech/mtac-mfser_1.1.1.bb
index 213ec1d..5f107b8 100644
--- a/recipes-bsp/multitech/mtac-mfser_1.1.1.bb
+++ b/recipes-bsp/multitech/mtac-mfser_1.1.1.bb
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
do_fetch[depends]+="virtual/kernel:do_shared_workdir"
DEPENDS = "virtual/kernel mtac mts-io"
RDEPENDS_${PN} = "kernel-module-mtac"
-INC_PR = "r1"
+INC_PR = "r2"
COMPATIBLE_MACHINE = "(mtcdt|mtcpmhs)"
SRCREV = "${PV}"
@@ -18,6 +18,7 @@ PKGR = "${PR}${KERNEL_MODULE_PACKAGE_SUFFIX}${EXTENDPRAUTO}"
SRC_URI = " \
git://git.multitech.net/mtac-mfser.git;protocol=git;branch=master \
+ file://serial-enable-tx-enable.patch \
"
S = "${WORKDIR}/git"