summaryrefslogtreecommitdiff
path: root/io-module/mts_capab.c
diff options
context:
space:
mode:
Diffstat (limited to 'io-module/mts_capab.c')
-rw-r--r--io-module/mts_capab.c35
1 files changed, 24 insertions, 11 deletions
diff --git a/io-module/mts_capab.c b/io-module/mts_capab.c
index 17c505a..38e8442 100644
--- a/io-module/mts_capab.c
+++ b/io-module/mts_capab.c
@@ -68,21 +68,34 @@ static struct attribute_group mts_capa_attr_group = {
};
static struct kobject *mts_capa_kobject = NULL;
+EXPORT_SYMBOL(mts_capa_kobject);
-static int mts_capab_dir_create(void)
+static int mts_capab_dir_create(uint8_t hw_version)
{
- mts_capa_kobject = kobject_create_and_add("capability", &mts_io_platform_device->dev.kobj);
- if (!mts_capa_kobject) {
- log_error("kobject_create_and_add for capability directory failed");
- return -ENOMEM;
- }
+ int i,j;
+
+ if (hw_version == MTCPM_0_0) {
+ for (i=0; mts_capa_attributes[i]; i++) {
+ /* Remove capa_lora for MTCPM mts-io driver */
+ if (mts_capa_attributes[i] == &capa_attr_lora.attr) {
+ for(j=i; mts_capa_attributes[j]; j++)
+ mts_capa_attributes[j] = mts_capa_attributes[j+1];
+ break;
+ }
+ }
+ }
+ mts_capa_kobject = kobject_create_and_add("capability", &mts_io_platform_device->dev.kobj);
+ if (!mts_capa_kobject) {
+ log_error("kobject_create_and_add for capability directory failed");
+ return -ENOMEM;
+ }
- if (sysfs_create_group(mts_capa_kobject, &mts_capa_attr_group)) {
- log_error("sysfs_create_group failed to create capability group");
- return -ENOMEM;
- }
+ if (sysfs_create_group(mts_capa_kobject, &mts_capa_attr_group)) {
+ log_error("sysfs_create_group failed to create capability group");
+ return -ENOMEM;
+ }
- return 0;
+ return 0;
}
static void mts_capab_dir_delete(void)