mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
misc: tegra-cec: remove NVDISPLAY ifdefs
remove NVDISPLAY ifdefs and replace it with runtime APIs Jira TDS-2761 Change-Id: I920fe5402a91d1780b07aadf542cc15361f73398 Signed-off-by: Ishwarya Balaji Gururajan <igururajan@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1653842 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Prafull Suryawanshi
parent
a89f31f800
commit
80169e7ded
@@ -43,6 +43,7 @@
|
||||
#include "tegra_cec.h"
|
||||
|
||||
#include "../../../../nvidia/drivers/video/tegra/dc/dc.h"
|
||||
#include "../../../../nvidia/drivers/video/tegra/dc/dc_priv.h"
|
||||
|
||||
#define LOGICAL_ADDRESS_RESERVED2 0xD
|
||||
#define LOGICAL_ADDRESS_TV 0x0
|
||||
@@ -511,9 +512,7 @@ static int tegra_cec_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct tegra_cec *cec;
|
||||
struct resource *res;
|
||||
#if defined(CONFIG_TEGRA_DISPLAY)
|
||||
struct device_node *np = pdev->dev->of_node;
|
||||
#endif
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
int ret = 0;
|
||||
|
||||
cec = devm_kzalloc(&pdev->dev, sizeof(struct tegra_cec), GFP_KERNEL);
|
||||
@@ -565,21 +564,24 @@ static int tegra_cec_probe(struct platform_device *pdev)
|
||||
mutex_init(&cec->tx_lock);
|
||||
mutex_init(&cec->recovery_lock);
|
||||
|
||||
#if defined(CONFIG_TEGRA_NVDISPLAY) && defined(CONFIG_TEGRA_POWERGATE)
|
||||
#if defined(CONFIG_TEGRA_POWERGATE)
|
||||
if (tegra_dc_is_nvdisplay()) {
|
||||
ret = tegra_unpowergate_partition(cec->soc->powergate_id);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "Fail to unpowergate DISP: %d.\n", ret);
|
||||
dev_err(&pdev->dev, "Fail to unpowergate DISP: %d.\n",
|
||||
ret);
|
||||
goto clk_error;
|
||||
}
|
||||
dev_info(&pdev->dev, "Unpowergate DISP: %d.\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_TEGRA_DISPLAY)
|
||||
if (tegra_dc_is_nvdisplay()) {
|
||||
if (np)
|
||||
cec->clk = of_clk_get_by_name(np, "cec");
|
||||
#else
|
||||
} else {
|
||||
cec->clk = clk_get(&pdev->dev, "cec");
|
||||
#endif
|
||||
}
|
||||
|
||||
if (IS_ERR_OR_NULL(cec->clk)) {
|
||||
dev_err(&pdev->dev, "can't get clock for CEC\n");
|
||||
@@ -656,7 +658,8 @@ cec_error:
|
||||
cancel_work_sync(&cec->work);
|
||||
clk_disable(cec->clk);
|
||||
clk_put(cec->clk);
|
||||
#if defined(CONFIG_TEGRA_NVDISPLAY) && defined(CONFIG_TEGRA_POWERGATE)
|
||||
#if defined(CONFIG_TEGRA_POWERGATE)
|
||||
if (tegra_dc_is_nvdisplay())
|
||||
tegra_powergate_partition(cec->soc->powergate_id);
|
||||
#endif
|
||||
clk_error:
|
||||
@@ -669,7 +672,8 @@ static int tegra_cec_remove(struct platform_device *pdev)
|
||||
|
||||
clk_disable(cec->clk);
|
||||
clk_put(cec->clk);
|
||||
#if defined(CONFIG_TEGRA_NVDISPLAY) && defined(CONFIG_TEGRA_POWERGATE)
|
||||
#if defined(CONFIG_TEGRA_POWERGATE)
|
||||
if (tegra_dc_is_nvdisplay())
|
||||
tegra_powergate_partition(cec->soc->powergate_id);
|
||||
#endif
|
||||
|
||||
@@ -696,7 +700,8 @@ static int tegra_cec_suspend(struct platform_device *pdev, pm_message_t state)
|
||||
atomic_set(&cec->init_cancel, 0);
|
||||
|
||||
clk_disable(cec->clk);
|
||||
#if defined(CONFIG_TEGRA_NVDISPLAY) && defined(CONFIG_TEGRA_POWERGATE)
|
||||
#if defined(CONFIG_TEGRA_POWERGATE)
|
||||
if (tegra_dc_is_nvdisplay())
|
||||
tegra_powergate_partition(cec->soc->powergate_id);
|
||||
#endif
|
||||
|
||||
@@ -710,7 +715,8 @@ static int tegra_cec_resume(struct platform_device *pdev)
|
||||
|
||||
dev_notice(&pdev->dev, "Resuming\n");
|
||||
|
||||
#if defined(CONFIG_TEGRA_NVDISPLAY) && defined(CONFIG_TEGRA_POWERGATE)
|
||||
#if defined(CONFIG_TEGRA_POWERGATE)
|
||||
if (tegra_dc_is_nvdisplay())
|
||||
tegra_unpowergate_partition(cec->soc->powergate_id);
|
||||
#endif
|
||||
clk_enable(cec->clk);
|
||||
|
||||
Reference in New Issue
Block a user