mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
misc: tegra_cec: turn on TV ASAP
Turn on the TV as soon as possible for better user experience by sending <Text View On> and <ACTIVE SOURCE> CEC commands if the previous reboot is not recovery. If the previous reboot reason is recovery, don't send <Text View On> to avoid turning on TV when there is an auto OTA on-going. CEC driver uses RESERVED2 logical address as the source address. Later, the upper layer will send OneTouchPlay command by using its valid logical address. Bug 200253563 Change-Id: Iecd759bb50c1f21549f55906e68e3faab905f86b Signed-off-by: Chun XU <chunx@nvidia.com> Reviewed-on: http://git-master/r/1277092 (cherry picked from commit 2beab2dcfc4e40712004500df99633d59ae0e70c)
This commit is contained in:
committed by
Prafull Suryawanshi
parent
0a6fb5c3c9
commit
c061b057db
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* drivers/misc/tegra-cec/tegra_cec.c
|
||||
*
|
||||
* Copyright (c) 2012-2016, NVIDIA CORPORATION. All rights reserved.
|
||||
* Copyright (c) 2012-2017, NVIDIA CORPORATION. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
@@ -42,6 +42,25 @@
|
||||
#include "tegra_cec.h"
|
||||
|
||||
#include "../../../../display/drivers/video/tegra/dc/dc_priv.h"
|
||||
#include "../../../../display/drivers/video/tegra/dc/dc.h"
|
||||
|
||||
#define LOGICAL_ADDRESS_RESERVED2 0xD
|
||||
#define LOGICAL_ADDRESS_TV 0x0
|
||||
#define LOGICAL_ADDRESS_BROADCAST 0xF
|
||||
#define TEXT_VIEW_ON 0x0D
|
||||
#define ACTIVE_SOURCE 0x82
|
||||
|
||||
static bool previous_reboot_reason_is_recovery, text_view_on_sent;
|
||||
static u8 text_view_on_command[] = {
|
||||
LOGICAL_ADDRESS_RESERVED2 << 4 | LOGICAL_ADDRESS_TV,
|
||||
TEXT_VIEW_ON
|
||||
};
|
||||
static u8 active_source_command[] = {
|
||||
LOGICAL_ADDRESS_RESERVED2 << 4 | LOGICAL_ADDRESS_BROADCAST,
|
||||
ACTIVE_SOURCE,
|
||||
0x00,
|
||||
0x00
|
||||
};
|
||||
|
||||
struct tegra_cec_soc {
|
||||
int powergate_id;
|
||||
@@ -293,6 +312,40 @@ static const struct file_operations tegra_cec_fops = {
|
||||
.write = tegra_cec_write,
|
||||
};
|
||||
|
||||
static int tegra_cec_send_one_touch_play(struct tegra_cec *cec)
|
||||
{
|
||||
int res = 0;
|
||||
u8 phy_address[2] = {0};
|
||||
|
||||
text_view_on_sent = true;
|
||||
|
||||
res = tegra_dc_get_source_physical_address(phy_address);
|
||||
if (res) {
|
||||
dev_warn(cec->dev, "Can't find physical addresse.\n");
|
||||
return res;
|
||||
}
|
||||
|
||||
dev_info(cec->dev, "physical address: %02x:%02x.\n",
|
||||
phy_address[0], phy_address[1]);
|
||||
|
||||
active_source_command[2] = phy_address[0];
|
||||
active_source_command[3] = phy_address[1];
|
||||
|
||||
mutex_lock(&cec->tx_lock);
|
||||
res = tegra_cec_native_write_l(cec, text_view_on_command,
|
||||
sizeof(text_view_on_command));
|
||||
dev_notice(cec->dev, "Sent <Text View On> res: %d.\n", res);
|
||||
if (!res) {
|
||||
res = tegra_cec_native_write_l(cec, active_source_command,
|
||||
sizeof(active_source_command));
|
||||
dev_notice(cec->dev,
|
||||
"Broadcast <Active Source> res: %d.\n", res);
|
||||
}
|
||||
mutex_unlock(&cec->tx_lock);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static void tegra_cec_init(struct tegra_cec *cec)
|
||||
{
|
||||
cec->rx_wake = 0;
|
||||
@@ -370,6 +423,8 @@ static void tegra_cec_init(struct tegra_cec *cec)
|
||||
atomic_set(&cec->init_done, 1);
|
||||
wake_up_interruptible(&cec->init_waitq);
|
||||
|
||||
if (!text_view_on_sent && !previous_reboot_reason_is_recovery)
|
||||
tegra_cec_send_one_touch_play(cec);
|
||||
dev_notice(cec->dev, "%s Done.\n", __func__);
|
||||
}
|
||||
|
||||
@@ -634,6 +689,18 @@ static int tegra_cec_resume(struct platform_device *pdev)
|
||||
}
|
||||
#endif
|
||||
|
||||
static int __init check_previous_reboot_reason_is_recovery(char *options)
|
||||
{
|
||||
previous_reboot_reason_is_recovery = true;
|
||||
|
||||
pr_info("tegra_cec: the previous_reboot_reason is%s recovery.\n",
|
||||
previous_reboot_reason_is_recovery ? "" : " not");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
early_param("post_recovery", check_previous_reboot_reason_is_recovery);
|
||||
|
||||
static struct tegra_cec_soc tegra210_soc_data = {
|
||||
.powergate_id = TEGRA210_POWER_DOMAIN_DISA,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user