summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Bayer <bbayer@multitech.com>2016-11-01 15:50:29 -0500
committerBrandon Bayer <bbayer@multitech.com>2016-11-01 15:50:29 -0500
commit4b5fa3b77d46aedd106312f9f14fddb1483fb0ef (patch)
treef3221c46044d2655468524529a33293eb126f3da
parent02c87437da63b8f07e8f19244b69d7927586e636 (diff)
downloadmts-io-4b5fa3b77d46aedd106312f9f14fddb1483fb0ef.tar.gz
mts-io-4b5fa3b77d46aedd106312f9f14fddb1483fb0ef.tar.bz2
mts-io-4b5fa3b77d46aedd106312f9f14fddb1483fb0ef.zip
mtcap: rename mtp to mtcap1.5.0
-rw-r--r--io-module/mtcap.c (renamed from io-module/mtp.c)78
-rw-r--r--io-module/mts_io.c16
-rw-r--r--io-module/mts_io.h4
3 files changed, 49 insertions, 49 deletions
diff --git a/io-module/mtp.c b/io-module/mtcap.c
index 9e411b2..e651406 100644
--- a/io-module/mtp.c
+++ b/io-module/mtcap.c
@@ -1,4 +1,4 @@
-static struct gpio_pin gpio_pins_mtp_0_0[] = {
+static struct gpio_pin gpio_pins_mtcap_0_0[] = {
{
.name = "ETH_RESET",
.pin = {
@@ -106,7 +106,7 @@ static struct gpio_pin gpio_pins_mtp_0_0[] = {
{ },
};
-static int radio_unconditional_shutdown_mtp(void)
+static int radio_unconditional_shutdown_mtcap(void)
{
struct gpio_pin *rst_pin = gpio_pin_by_attr_name("radio-reset");
struct gpio_pin *pwrmon_pin = gpio_pin_by_attr_name("radio-power-monitor");
@@ -139,8 +139,8 @@ static int radio_unconditional_shutdown_mtp(void)
}
-/* radio control (power/reset) for mtp */
-static int radio_off_mtp(void)
+/* radio control (power/reset) for mtcap */
+static int radio_off_mtcap(void)
{
// ref: Telit_LE910_Hardware_User_Guide_r6.pdf (4.3.2 Hardware Shutdown)
struct gpio_pin *pwrmon_pin = gpio_pin_by_attr_name("radio-power-monitor");
@@ -188,13 +188,13 @@ static int radio_off_mtp(void)
}
else {
log_warning("cell radio is still on. performing unconditional shutdown...");
- radio_unconditional_shutdown_mtp();
+ radio_unconditional_shutdown_mtcap();
}
return 0;
}
-static int radio_on_mtp(void)
+static int radio_on_mtcap(void)
{
// ref: Telit_LE910_Hardware_User_Guide_r6.pdf
struct gpio_pin *pwrmon_pin = gpio_pin_by_attr_name("radio-power-monitor");
@@ -233,7 +233,7 @@ static int radio_on_mtp(void)
return 0;
}
-static int radio_reset_mtp(void)
+static int radio_reset_mtcap(void)
{
// ref: Telit_LE910_Hardware_User_Guide_r6.pdf
struct gpio_pin *rst_pin = gpio_pin_by_attr_name("radio-reset");
@@ -249,7 +249,7 @@ static int radio_reset_mtp(void)
log_info("performing unconditional cell radio shutdown");
- radio_unconditional_shutdown_mtp();
+ radio_unconditional_shutdown_mtcap();
//
// Turning on radio
@@ -268,7 +268,7 @@ static int radio_reset_mtp(void)
return 0;
}
-static ssize_t mts_attr_store_radio_power_mtp(struct device *dev,
+static ssize_t mts_attr_store_radio_power_mtcap(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
int value;
@@ -280,9 +280,9 @@ static ssize_t mts_attr_store_radio_power_mtp(struct device *dev,
mutex_lock(&mts_io_mutex);
if (value == 0) {
- err = radio_off_mtp();
+ err = radio_off_mtcap();
} else {
- err = radio_on_mtp();
+ err = radio_on_mtcap();
}
mutex_unlock(&mts_io_mutex);
@@ -293,7 +293,7 @@ static ssize_t mts_attr_store_radio_power_mtp(struct device *dev,
return count;
}
-static ssize_t mts_attr_store_radio_reset_mtp(struct device *dev,
+static ssize_t mts_attr_store_radio_reset_mtcap(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
int value;
@@ -331,7 +331,7 @@ static ssize_t mts_attr_store_radio_reset_mtp(struct device *dev,
mutex_lock(&mts_io_mutex);
- err = radio_reset_mtp();
+ err = radio_reset_mtcap();
mutex_unlock(&mts_io_mutex);
@@ -342,7 +342,7 @@ static ssize_t mts_attr_store_radio_reset_mtp(struct device *dev,
return count;
}
-static ssize_t mts_attr_show_radio_power_mtp(struct device *dev,
+static ssize_t mts_attr_show_radio_power_mtcap(struct device *dev,
struct device_attribute *attr,
char *buf)
{
@@ -357,7 +357,7 @@ static ssize_t mts_attr_show_radio_power_mtp(struct device *dev,
return sprintf(buf, "%d\n", value);
}
-static int lora_reset_mtp(void)
+static int lora_reset_mtcap(void)
{
struct gpio_pin *rst_pin = gpio_pin_by_attr_name("lora-reset");
@@ -381,7 +381,7 @@ static int lora_reset_mtp(void)
return 0;
}
-static ssize_t mts_attr_store_lora_reset_mtp(struct device *dev,
+static ssize_t mts_attr_store_lora_reset_mtcap(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
int value;
@@ -395,7 +395,7 @@ static ssize_t mts_attr_store_lora_reset_mtp(struct device *dev,
mutex_lock(&mts_io_mutex);
- err = lora_reset_mtp();
+ err = lora_reset_mtcap();
mutex_unlock(&mts_io_mutex);
@@ -406,7 +406,7 @@ static ssize_t mts_attr_store_lora_reset_mtp(struct device *dev,
return count;
}
-static int eth_reset_mtp(void)
+static int eth_reset_mtcap(void)
{
struct gpio_pin *rst_pin = gpio_pin_by_attr_name("eth-reset");
@@ -429,7 +429,7 @@ static int eth_reset_mtp(void)
return 0;
}
-static ssize_t mts_attr_store_eth_reset_mtp(struct device *dev,
+static ssize_t mts_attr_store_eth_reset_mtcap(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
int value;
@@ -443,7 +443,7 @@ static ssize_t mts_attr_store_eth_reset_mtp(struct device *dev,
mutex_lock(&mts_io_mutex);
- err = eth_reset_mtp();
+ err = eth_reset_mtcap();
mutex_unlock(&mts_io_mutex);
@@ -454,28 +454,28 @@ static ssize_t mts_attr_store_eth_reset_mtp(struct device *dev,
return count;
}
-static DEVICE_ATTR_MTS(dev_attr_radio_reset_mtp, "radio-reset",
- mts_attr_show_gpio_pin, mts_attr_store_radio_reset_mtp);
+static DEVICE_ATTR_MTS(dev_attr_radio_reset_mtcap, "radio-reset",
+ mts_attr_show_gpio_pin, mts_attr_store_radio_reset_mtcap);
-static DEVICE_ATTR_MTS(dev_attr_radio_power_mtp, "radio-power",
- mts_attr_show_radio_power_mtp, mts_attr_store_radio_power_mtp);
+static DEVICE_ATTR_MTS(dev_attr_radio_power_mtcap, "radio-power",
+ mts_attr_show_radio_power_mtcap, mts_attr_store_radio_power_mtcap);
-static DEVICE_ATTR_MTS(dev_attr_lora_reset_mtp, "lora-reset",
- mts_attr_show_gpio_pin, mts_attr_store_lora_reset_mtp);
+static DEVICE_ATTR_MTS(dev_attr_lora_reset_mtcap, "lora-reset",
+ mts_attr_show_gpio_pin, mts_attr_store_lora_reset_mtcap);
-static DEVICE_ATTR_MTS(dev_attr_eth_reset_mtp, "eth-reset",
- mts_attr_show_gpio_pin, mts_attr_store_eth_reset_mtp);
+static DEVICE_ATTR_MTS(dev_attr_eth_reset_mtcap, "eth-reset",
+ mts_attr_show_gpio_pin, mts_attr_store_eth_reset_mtcap);
-static DEVICE_ATTR_MTS(dev_attr_led_lora_gpio_mtp, "led-lora",
+static DEVICE_ATTR_MTS(dev_attr_led_lora_gpio_mtcap, "led-lora",
mts_attr_show_gpio_pin, mts_attr_store_gpio_pin);
-static DEVICE_ATTR_MTS(dev_attr_led_wifi_gpio_mtp, "led-wifi",
+static DEVICE_ATTR_MTS(dev_attr_led_wifi_gpio_mtcap, "led-wifi",
mts_attr_show_gpio_pin, mts_attr_store_gpio_pin);
static DEVICE_ATTR_RO_MTS(dev_attr_lora_eui, "lora-eui",
mts_attr_show_product_info);
-static struct attribute *mtp_0_0_platform_attributes[] = {
+static struct attribute *mtcap_0_0_platform_attributes[] = {
&dev_attr_vendor_id.attr,
&dev_attr_product_id.attr,
&dev_attr_device_id.attr,
@@ -487,12 +487,12 @@ static struct attribute *mtp_0_0_platform_attributes[] = {
&dev_attr_reset_monitor.attr,
&dev_attr_reset_monitor_intervals.attr,
- &dev_attr_eth_reset_mtp.attr,
+ &dev_attr_eth_reset_mtcap.attr,
- &dev_attr_lora_reset_mtp.attr,
+ &dev_attr_lora_reset_mtcap.attr,
- &dev_attr_radio_power_mtp.attr,
- &dev_attr_radio_reset_mtp.attr,
+ &dev_attr_radio_power_mtcap.attr,
+ &dev_attr_radio_reset_mtcap.attr,
&dev_attr_radio_reset_backoffs.attr,
&dev_attr_radio_reset_backoff_index.attr,
@@ -500,14 +500,14 @@ static struct attribute *mtp_0_0_platform_attributes[] = {
&dev_attr_led_status.attr,
&dev_attr_led_cd_gpio.attr,
- &dev_attr_led_lora_gpio_mtp.attr,
- &dev_attr_led_wifi_gpio_mtp.attr,
+ &dev_attr_led_lora_gpio_mtcap.attr,
+ &dev_attr_led_wifi_gpio_mtcap.attr,
&dev_attr_lora_eui.attr,
NULL,
};
-static struct attribute_group mtp_0_0_platform_attribute_group = {
- .attrs = mtp_0_0_platform_attributes
+static struct attribute_group mtcap_0_0_platform_attribute_group = {
+ .attrs = mtcap_0_0_platform_attributes
};
diff --git a/io-module/mts_io.c b/io-module/mts_io.c
index 0b22592..547f099 100644
--- a/io-module/mts_io.c
+++ b/io-module/mts_io.c
@@ -47,7 +47,7 @@
#include "mts_io.h"
-#define DRIVER_VERSION "v1.4.2"
+#define DRIVER_VERSION "v1.5.0"
#define DRIVER_AUTHOR "James Maki <jmaki@multitech.com>"
#define DRIVER_DESC "MTS-IO Controller"
#define DRIVER_NAME "mts-io"
@@ -635,7 +635,7 @@ static DEVICE_ATTR_RO_MTS(dev_attr_eth_mac, "mac-eth",
/* include per-device pins and attributes */
#include "mtcdt.c"
-#include "mtp.c"
+#include "mtcap.c"
#if NUM_AP > 0
@@ -786,11 +786,11 @@ static int mts_id_eeprom_load()
if (mts_id_eeprom[0] == 0xFF) {
log_error("uninitialized eeprom");
return -EIO;
- } else if (strncmp(id_eeprom.hw_version, HW_VERSION_MTP_0_0, strlen(HW_VERSION_MTP_0_0)) == 0) {
- attr_group = &mtp_0_0_platform_attribute_group;
- gpio_pins = gpio_pins_mtp_0_0;
- mts_hw_version = MTP_0_0;
- log_info("detected board %s", HW_VERSION_MTP_0_0);
+ } else if (strncmp(id_eeprom.hw_version, HW_VERSION_MTCAP_0_0, strlen(HW_VERSION_MTCAP_0_0)) == 0) {
+ attr_group = &mtcap_0_0_platform_attribute_group;
+ gpio_pins = gpio_pins_mtcap_0_0;
+ mts_hw_version = MTCAP_0_0;
+ log_info("detected board %s", HW_VERSION_MTCAP_0_0);
}
else if (strncmp(id_eeprom.hw_version, HW_VERSION_MTCDT_0_1, strlen(HW_VERSION_MTCDT_0_1)) == 0) {
attr_blength = sizeof mtcdt_0_1_platform_attributes;
@@ -877,7 +877,7 @@ static int mts_id_eeprom_load()
}
log_info("uuid: %s", (char*)buf);
- if (mts_hw_version == MTP_0_0) {
+ if (mts_hw_version == MTCAP_0_0) {
log_info("lora-eui: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X",
id_eeprom.lora_eui[0],
id_eeprom.lora_eui[1],
diff --git a/io-module/mts_io.h b/io-module/mts_io.h
index cc33b80..5918fa9 100644
--- a/io-module/mts_io.h
+++ b/io-module/mts_io.h
@@ -67,7 +67,7 @@ struct device_attribute _dev_name = { \
#define HW_VERSION_MTR_0_1 "MTR-0.1"
#define HW_VERSION_MTCDT_0_0 "MTCDT-0.0"
#define HW_VERSION_MTCDT_0_1 "MTCDT-0.1"
-#define HW_VERSION_MTP_0_0 "MTP-0.0"
+#define HW_VERSION_MTCAP_0_0 "MTCAP-0.0"
enum {
MTCDP_E1_DK_0_0,
@@ -77,7 +77,7 @@ enum {
MTR_0_1,
MTCDT_0_0,
MTCDT_0_1,
- MTP_0_0,
+ MTCAP_0_0,
};
enum {