summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPortisch <hugo.portisch@yahoo.de>2019-05-21 14:28:12 +0300
committerDongjin Kim <tobetter@gmail.com>2020-02-13 11:13:40 +0300
commit2c67f44981a88d7c92249d198f639f440fd54fad (patch)
treeb8585c8b1149992708fdddb2d2bff7477ef2d8ee
parentfabbf044d38e842d03c06b0b9ff26a64d575c12e (diff)
downloadu-boot-2c67f44981a88d7c92249d198f639f440fd54fad.tar.xz
g12a/g12b: Add IR power key mask handling through SCPI SCPI_CL_REMOTE_MASK
Change-Id: I390fa07f8224860641a313a6a7adcb095b2ffcdd
-rw-r--r--arch/arm/cpu/armv8/g12a/firmware/scp_task/scp_remote.c10
-rw-r--r--arch/arm/cpu/armv8/g12a/firmware/scp_task/user_task.c5
-rw-r--r--arch/arm/cpu/armv8/g12b/firmware/scp_task/scp_remote.c10
-rw-r--r--arch/arm/cpu/armv8/g12b/firmware/scp_task/user_task.c5
4 files changed, 20 insertions, 10 deletions
diff --git a/arch/arm/cpu/armv8/g12a/firmware/scp_task/scp_remote.c b/arch/arm/cpu/armv8/g12a/firmware/scp_task/scp_remote.c
index 7cd5eca454..aaf1015acc 100644
--- a/arch/arm/cpu/armv8/g12a/firmware/scp_task/scp_remote.c
+++ b/arch/arm/cpu/armv8/g12a/firmware/scp_task/scp_remote.c
@@ -28,7 +28,6 @@
#define CONFIG_IR_REMOTE_USE_PROTOCOL 0
#endif
#define CONFIG_END 0xffffffff
-#define IR_POWER_KEY_MASK 0xffffffff
typedef struct reg_remote {
int reg;
@@ -42,6 +41,7 @@ typedef struct remote_pwrkeys {
remote_pwrkeys_t pwr_keys_list;
unsigned int usr_pwr_key = 0xffffffff;
+unsigned int usr_pwr_key_mask = 0xffffffff;
unsigned int usr_ir_proto = 0;
//24M
@@ -442,10 +442,10 @@ static int remote_detect_key(void)
uart_puts("\n");
for (j = 0; j < keysdat->size; j++) {
- if ((power_key & IR_POWER_KEY_MASK) == keysdat->pwrkeys[j])
+ if ((power_key & usr_pwr_key_mask) == (keysdat->pwrkeys[j] & usr_pwr_key_mask))
return 1;
}
- if ((power_key & IR_POWER_KEY_MASK) == usr_pwr_key)
+ if ((power_key & usr_pwr_key_mask) == (usr_pwr_key & usr_pwr_key_mask))
return 2;
}
@@ -461,10 +461,10 @@ static int remote_detect_key(void)
uart_puts("\n");
for (j = 0; j < keysdat->size; j++) {
- if ((power_key & IR_POWER_KEY_MASK) == keysdat->pwrkeys[j])
+ if ((power_key & usr_pwr_key_mask) == (keysdat->pwrkeys[j] & usr_pwr_key_mask))
return 1;
}
- if ((power_key & IR_POWER_KEY_MASK) == usr_pwr_key)
+ if ((power_key & usr_pwr_key_mask) == (usr_pwr_key & usr_pwr_key_mask))
return 2;
}
diff --git a/arch/arm/cpu/armv8/g12a/firmware/scp_task/user_task.c b/arch/arm/cpu/armv8/g12a/firmware/scp_task/user_task.c
index ba7fe8b9a8..fc2e74764c 100644
--- a/arch/arm/cpu/armv8/g12a/firmware/scp_task/user_task.c
+++ b/arch/arm/cpu/armv8/g12a/firmware/scp_task/user_task.c
@@ -39,6 +39,7 @@ enum scpi_client_id {
SCPI_CL_LED_TIMER,
SCPI_CL_WOL,
SCPI_CL_IRPROTO,
+ SCPI_CL_REMOTE_MASK,
SCPI_MAX,
};
@@ -149,6 +150,7 @@ void high_task(void)
}
extern unsigned int usr_pwr_key;
+extern unsigned int usr_pwr_key_mask;
extern unsigned int usr_ir_proto;
extern unsigned int enable_wol;
@@ -169,6 +171,9 @@ void process_low_task(unsigned command)
} else if ((command >> 16) == SCPI_CL_IRPROTO) {
usr_ir_proto = *(pcommand + 2);
dbg_print("usr_ir_proto = ", usr_ir_proto);
+ } else if ((command >> 16) == SCPI_CL_REMOTE_MASK) {
+ usr_pwr_key_mask = *(pcommand + 2);
+ dbg_print("pwr_key_mask = ", usr_pwr_key_mask);
}
}
}
diff --git a/arch/arm/cpu/armv8/g12b/firmware/scp_task/scp_remote.c b/arch/arm/cpu/armv8/g12b/firmware/scp_task/scp_remote.c
index 7cd5eca454..aaf1015acc 100644
--- a/arch/arm/cpu/armv8/g12b/firmware/scp_task/scp_remote.c
+++ b/arch/arm/cpu/armv8/g12b/firmware/scp_task/scp_remote.c
@@ -28,7 +28,6 @@
#define CONFIG_IR_REMOTE_USE_PROTOCOL 0
#endif
#define CONFIG_END 0xffffffff
-#define IR_POWER_KEY_MASK 0xffffffff
typedef struct reg_remote {
int reg;
@@ -42,6 +41,7 @@ typedef struct remote_pwrkeys {
remote_pwrkeys_t pwr_keys_list;
unsigned int usr_pwr_key = 0xffffffff;
+unsigned int usr_pwr_key_mask = 0xffffffff;
unsigned int usr_ir_proto = 0;
//24M
@@ -442,10 +442,10 @@ static int remote_detect_key(void)
uart_puts("\n");
for (j = 0; j < keysdat->size; j++) {
- if ((power_key & IR_POWER_KEY_MASK) == keysdat->pwrkeys[j])
+ if ((power_key & usr_pwr_key_mask) == (keysdat->pwrkeys[j] & usr_pwr_key_mask))
return 1;
}
- if ((power_key & IR_POWER_KEY_MASK) == usr_pwr_key)
+ if ((power_key & usr_pwr_key_mask) == (usr_pwr_key & usr_pwr_key_mask))
return 2;
}
@@ -461,10 +461,10 @@ static int remote_detect_key(void)
uart_puts("\n");
for (j = 0; j < keysdat->size; j++) {
- if ((power_key & IR_POWER_KEY_MASK) == keysdat->pwrkeys[j])
+ if ((power_key & usr_pwr_key_mask) == (keysdat->pwrkeys[j] & usr_pwr_key_mask))
return 1;
}
- if ((power_key & IR_POWER_KEY_MASK) == usr_pwr_key)
+ if ((power_key & usr_pwr_key_mask) == (usr_pwr_key & usr_pwr_key_mask))
return 2;
}
diff --git a/arch/arm/cpu/armv8/g12b/firmware/scp_task/user_task.c b/arch/arm/cpu/armv8/g12b/firmware/scp_task/user_task.c
index ba7fe8b9a8..fc2e74764c 100644
--- a/arch/arm/cpu/armv8/g12b/firmware/scp_task/user_task.c
+++ b/arch/arm/cpu/armv8/g12b/firmware/scp_task/user_task.c
@@ -39,6 +39,7 @@ enum scpi_client_id {
SCPI_CL_LED_TIMER,
SCPI_CL_WOL,
SCPI_CL_IRPROTO,
+ SCPI_CL_REMOTE_MASK,
SCPI_MAX,
};
@@ -149,6 +150,7 @@ void high_task(void)
}
extern unsigned int usr_pwr_key;
+extern unsigned int usr_pwr_key_mask;
extern unsigned int usr_ir_proto;
extern unsigned int enable_wol;
@@ -169,6 +171,9 @@ void process_low_task(unsigned command)
} else if ((command >> 16) == SCPI_CL_IRPROTO) {
usr_ir_proto = *(pcommand + 2);
dbg_print("usr_ir_proto = ", usr_ir_proto);
+ } else if ((command >> 16) == SCPI_CL_REMOTE_MASK) {
+ usr_pwr_key_mask = *(pcommand + 2);
+ dbg_print("pwr_key_mask = ", usr_pwr_key_mask);
}
}
}