diff --git a/drivers/amlogic/mailbox/scpi_protocol.c b/drivers/amlogic/mailbox/scpi_protocol.c index f8592adedb27..20f05c10b454 100644 --- a/drivers/amlogic/mailbox/scpi_protocol.c +++ b/drivers/amlogic/mailbox/scpi_protocol.c @@ -541,3 +541,21 @@ int scpi_get_cec_val(enum scpi_std_cmd index, u32 *p_cec) } EXPORT_SYMBOL_GPL(scpi_get_cec_val); +u8 scpi_get_ethernet_calc(void) +{ + struct scpi_data_buf sdata; + struct mhu_data_buf mdata; + u8 temp = 0; + + struct __packed { + u32 status; + u8 eth_calc; + } buf; + + SCPI_SETUP_DBUF(sdata, mdata, SCPI_CL_NONE, + SCPI_CMD_GET_ETHERNET_CALC, temp, buf); + if (scpi_execute_cmd(&sdata)) + return -EPERM; + return buf.eth_calc; +} +EXPORT_SYMBOL_GPL(scpi_get_ethernet_calc); diff --git a/include/linux/amlogic/scpi_protocol.h b/include/linux/amlogic/scpi_protocol.h index c0c9de6b9583..771b2bfbb255 100644 --- a/include/linux/amlogic/scpi_protocol.h +++ b/include/linux/amlogic/scpi_protocol.h @@ -67,6 +67,8 @@ enum scpi_std_cmd { SCPI_CMD_OSCRING_VALUE = 0x43, SCPI_CMD_WAKEUP_REASON_GET = 0x30, SCPI_CMD_WAKEUP_REASON_CLR = 0X31, + SCPI_CMD_GET_ETHERNET_CALC = 0x32, + SCPI_CMD_GET_CEC1 = 0xB4, SCPI_CMD_GET_CEC2 = 0xB5, SCPI_CMD_COUNT @@ -98,4 +100,5 @@ int scpi_get_ring_value(unsigned char *val); int scpi_get_wakeup_reason(u32 *wakeup_reason); int scpi_clr_wakeup_reason(void); int scpi_get_cec_val(enum scpi_std_cmd index, u32 *p_cec); +u8 scpi_get_ethernet_calc(void); #endif /*_SCPI_PROTOCOL_H_*/