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:
Ishwarya Balaji Gururajan
2018-02-07 15:45:21 -08:00
committed by Prafull Suryawanshi
parent a89f31f800
commit 80169e7ded

View File

@@ -43,6 +43,7 @@
#include "tegra_cec.h" #include "tegra_cec.h"
#include "../../../../nvidia/drivers/video/tegra/dc/dc.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_RESERVED2 0xD
#define LOGICAL_ADDRESS_TV 0x0 #define LOGICAL_ADDRESS_TV 0x0
@@ -511,9 +512,7 @@ static int tegra_cec_probe(struct platform_device *pdev)
{ {
struct tegra_cec *cec; struct tegra_cec *cec;
struct resource *res; struct resource *res;
#if defined(CONFIG_TEGRA_DISPLAY) struct device_node *np = pdev->dev.of_node;
struct device_node *np = pdev->dev->of_node;
#endif
int ret = 0; int ret = 0;
cec = devm_kzalloc(&pdev->dev, sizeof(struct tegra_cec), GFP_KERNEL); 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->tx_lock);
mutex_init(&cec->recovery_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); ret = tegra_unpowergate_partition(cec->soc->powergate_id);
if (ret) { 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; goto clk_error;
} }
dev_info(&pdev->dev, "Unpowergate DISP: %d.\n", ret); dev_info(&pdev->dev, "Unpowergate DISP: %d.\n", ret);
}
#endif #endif
#if defined(CONFIG_TEGRA_DISPLAY) if (tegra_dc_is_nvdisplay()) {
if (np) if (np)
cec->clk = of_clk_get_by_name(np, "cec"); cec->clk = of_clk_get_by_name(np, "cec");
#else } else {
cec->clk = clk_get(&pdev->dev, "cec"); cec->clk = clk_get(&pdev->dev, "cec");
#endif }
if (IS_ERR_OR_NULL(cec->clk)) { if (IS_ERR_OR_NULL(cec->clk)) {
dev_err(&pdev->dev, "can't get clock for CEC\n"); dev_err(&pdev->dev, "can't get clock for CEC\n");
@@ -656,7 +658,8 @@ cec_error:
cancel_work_sync(&cec->work); cancel_work_sync(&cec->work);
clk_disable(cec->clk); clk_disable(cec->clk);
clk_put(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); tegra_powergate_partition(cec->soc->powergate_id);
#endif #endif
clk_error: clk_error:
@@ -669,7 +672,8 @@ static int tegra_cec_remove(struct platform_device *pdev)
clk_disable(cec->clk); clk_disable(cec->clk);
clk_put(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); tegra_powergate_partition(cec->soc->powergate_id);
#endif #endif
@@ -696,7 +700,8 @@ static int tegra_cec_suspend(struct platform_device *pdev, pm_message_t state)
atomic_set(&cec->init_cancel, 0); atomic_set(&cec->init_cancel, 0);
clk_disable(cec->clk); 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); tegra_powergate_partition(cec->soc->powergate_id);
#endif #endif
@@ -710,7 +715,8 @@ static int tegra_cec_resume(struct platform_device *pdev)
dev_notice(&pdev->dev, "Resuming\n"); 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); tegra_unpowergate_partition(cec->soc->powergate_id);
#endif #endif
clk_enable(cec->clk); clk_enable(cec->clk);