Last active
January 4, 2016 06:42
-
-
Save bkrepo/00483a42fc1d721cb3ea to your computer and use it in GitHub Desktop.
Add disable automatic TV ON function by HDMI-CEC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 6f1e3aa7371d29a2de74b019753e4f2ee82c6bb7 Mon Sep 17 00:00:00 2001 | |
From: Brian Kim <[email protected]> | |
Date: Mon, 4 Jan 2016 15:27:19 +0900 | |
Subject: [PATCH] ODROIDC: Add disable automatic TV power on function in | |
HDMI-CEC | |
This change can disable switch TV on automatically using HDMI-CEC. This | |
function support it using AUTO_POWER_ON_MASK flag in boot parameter. | |
Change-Id: I3257dbeb4e13b829cd1e3c7df8a9a6321060e9e3 | |
Signed-off-by: Brian Kim <[email protected]> | |
--- | |
arch/arm/boot/dts/meson8b_odroidc.dts | 1 - | |
drivers/amlogic/hdmi/hdmi_tx/hdmi_tx_cec.c | 13 +++++++++++++ | |
include/linux/amlogic/hdmi_tx/hdmi_tx_cec.h | 1 + | |
3 files changed, 14 insertions(+), 1 deletion(-) | |
diff --git a/arch/arm/boot/dts/meson8b_odroidc.dts b/arch/arm/boot/dts/meson8b_odroidc.dts | |
index 3bef0b25..e01a67c 100755 | |
--- a/arch/arm/boot/dts/meson8b_odroidc.dts | |
+++ b/arch/arm/boot/dts/meson8b_odroidc.dts | |
@@ -608,7 +608,6 @@ | |
vendor_id = <0x000000>; /* Refer to http://standards.ieee.org/develop/regauth/oui/oui.txt */ | |
product_desc = "ODROID-C1"; /* Max Chars: 16 */ | |
cec_osd_string = "ODROID-C1"; /* Max Chars: 14 */ | |
- cec_config = <0x00000f>; | |
ao_cec = <0x000001>; | |
}; | |
diff --git a/drivers/amlogic/hdmi/hdmi_tx/hdmi_tx_cec.c b/drivers/amlogic/hdmi/hdmi_tx/hdmi_tx_cec.c | |
index 88fdb51..0930f4a 100755 | |
--- a/drivers/amlogic/hdmi/hdmi_tx/hdmi_tx_cec.c | |
+++ b/drivers/amlogic/hdmi/hdmi_tx/hdmi_tx_cec.c | |
@@ -304,6 +304,18 @@ void cec_node_init(hdmitx_dev_t* hdmitx_device) | |
cec_device_vendor_id((cec_rx_message_t*)0); | |
msleep(150); | |
+ | |
+ /* Disable switch TV on automatically */ | |
+ if (!(hdmitx_device->cec_func_config & (1 << AUTO_POWER_ON_MASK))) { | |
+ cec_usrcmd_get_device_power_status(CEC_TV_ADDR); | |
+ wait_event_interruptible(hdmitx_device->cec_wait_rx, | |
+ cec_global_info.cec_rx_msg_buf.rx_read_pos != cec_global_info.cec_rx_msg_buf.rx_write_pos); | |
+ cec_isr_post_process(); | |
+ | |
+ if (cec_global_info.tv_power_status) | |
+ return; | |
+ } | |
+ | |
cec_imageview_on_smp(); | |
msleep(100); | |
@@ -1146,6 +1158,7 @@ void cec_handle_message(cec_rx_message_t* pcec_message) | |
case CEC_OC_REPORT_PHYSICAL_ADDRESS: | |
break; | |
case CEC_OC_REPORT_POWER_STATUS: | |
+ cec_global_info.tv_power_status = pcec_message->content.msg.operands[0]; | |
break; | |
case CEC_OC_SET_OSD_NAME: | |
break; | |
diff --git a/include/linux/amlogic/hdmi_tx/hdmi_tx_cec.h b/include/linux/amlogic/hdmi_tx/hdmi_tx_cec.h | |
index 51a7190..72794b6 100644 | |
--- a/include/linux/amlogic/hdmi_tx/hdmi_tx_cec.h | |
+++ b/include/linux/amlogic/hdmi_tx/hdmi_tx_cec.h | |
@@ -441,6 +441,7 @@ typedef struct { | |
cec_node_info_t cec_node_info[MAX_NUM_OF_DEV]; | |
cec_rx_msg_buf_t cec_rx_msg_buf; | |
hdmitx_dev_t* hdmitx_device; | |
+ cec_power_status_e tv_power_status; | |
} cec_global_info_t; | |
typedef struct { | |
-- | |
1.9.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment