mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
drivers: video: Remove emc clock management
EMC clock is not intended to be managed by the kernel/ccplex. It is completely managed by the BPMP BWMGR driver. Remove outdated code that touches emc clock directly, and fix the NULL pointer dereference issue. Bug 5622903 Change-Id: Ied1b6aaceaa026f954917b4b46f47dece1521d62 Signed-off-by: Johnny Liu <johnliu@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3487187 Reviewed-by: Chinniah Poosapadi <cpoosapadi@nvidia.com> Reviewed-by: Narendra Kondapalli <nkondapalli@nvidia.com> Reviewed-by: Shubham Chandra <shubhamc@nvidia.com> Reviewed-by: Akihiro Mizusawa <amizusawa@nvidia.com> GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com> Reviewed-by: svcacv <svcacv@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
59fa283238
commit
4d81ee0f63
@@ -1107,22 +1107,12 @@ static int vi5_channel_stop_streaming(struct vb2_queue *vq)
|
|||||||
|
|
||||||
int tegra_vi5_enable(struct tegra_mc_vi *vi)
|
int tegra_vi5_enable(struct tegra_mc_vi *vi)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
|
|
||||||
ret = tegra_camera_emc_clk_enable();
|
|
||||||
if (ret)
|
|
||||||
goto err_emc_enable;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_emc_enable:
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void tegra_vi5_disable(struct tegra_mc_vi *vi)
|
void tegra_vi5_disable(struct tegra_mc_vi *vi)
|
||||||
{
|
{
|
||||||
tegra_channel_ec_close(vi);
|
tegra_channel_ec_close(vi);
|
||||||
tegra_camera_emc_clk_disable();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vi5_power_on(struct tegra_channel *chan)
|
static int vi5_power_on(struct tegra_channel *chan)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: Copyright (c) 2015-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
* SPDX-FileCopyrightText: Copyright (c) 2015-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <nvidia/conftest.h>
|
#include <nvidia/conftest.h>
|
||||||
@@ -91,46 +91,6 @@ static int tegra_camera_isomgr_request(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int tegra_camera_emc_clk_enable(void)
|
|
||||||
{
|
|
||||||
struct tegra_camera_info *info;
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
info = dev_get_drvdata(tegra_camera_misc.parent);
|
|
||||||
if (!info)
|
|
||||||
return -EINVAL;
|
|
||||||
ret = clk_prepare_enable(info->emc);
|
|
||||||
if (ret) {
|
|
||||||
dev_err(info->dev, "Cannot enable camera.emc\n");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = clk_prepare_enable(info->iso_emc);
|
|
||||||
if (ret) {
|
|
||||||
dev_err(info->dev, "Cannot enable camera_iso.emc\n");
|
|
||||||
goto err_iso_emc;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
err_iso_emc:
|
|
||||||
clk_disable_unprepare(info->emc);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(tegra_camera_emc_clk_enable);
|
|
||||||
|
|
||||||
int tegra_camera_emc_clk_disable(void)
|
|
||||||
{
|
|
||||||
struct tegra_camera_info *info;
|
|
||||||
|
|
||||||
info = dev_get_drvdata(tegra_camera_misc.parent);
|
|
||||||
if (!info)
|
|
||||||
return -EINVAL;
|
|
||||||
clk_disable_unprepare(info->emc);
|
|
||||||
clk_disable_unprepare(info->iso_emc);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(tegra_camera_emc_clk_disable);
|
|
||||||
|
|
||||||
static int tegra_camera_open(struct inode *inode, struct file *file)
|
static int tegra_camera_open(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
struct tegra_camera_info *info;
|
struct tegra_camera_info *info;
|
||||||
@@ -140,7 +100,7 @@ static int tegra_camera_open(struct inode *inode, struct file *file)
|
|||||||
info = dev_get_drvdata(mdev->parent);
|
info = dev_get_drvdata(mdev->parent);
|
||||||
file->private_data = info;
|
file->private_data = info;
|
||||||
|
|
||||||
return tegra_camera_emc_clk_enable();
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tegra_camera_release(struct inode *inode, struct file *file)
|
static int tegra_camera_release(struct inode *inode, struct file *file)
|
||||||
@@ -148,7 +108,7 @@ static int tegra_camera_release(struct inode *inode, struct file *file)
|
|||||||
struct tegra_camera_info *info;
|
struct tegra_camera_info *info;
|
||||||
|
|
||||||
info = file->private_data;
|
info = file->private_data;
|
||||||
tegra_camera_emc_clk_disable();
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: Copyright (C) 2015-2023 NVIDIA CORPORATION. All rights reserved.
|
* SPDX-FileCopyrightText: Copyright (C) 2015-2025 NVIDIA CORPORATION. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _TEGRA_CAMERA_PLATFORM_H_
|
#ifndef _TEGRA_CAMERA_PLATFORM_H_
|
||||||
@@ -90,8 +90,6 @@ struct tegra_camera_dev_info {
|
|||||||
};
|
};
|
||||||
|
|
||||||
int tegra_camera_update_isobw(void);
|
int tegra_camera_update_isobw(void);
|
||||||
int tegra_camera_emc_clk_enable(void);
|
|
||||||
int tegra_camera_emc_clk_disable(void);
|
|
||||||
int tegra_camera_device_register(struct tegra_camera_dev_info *cdev_info,
|
int tegra_camera_device_register(struct tegra_camera_dev_info *cdev_info,
|
||||||
void *priv);
|
void *priv);
|
||||||
int tegra_camera_device_unregister(void *priv);
|
int tegra_camera_device_unregister(void *priv);
|
||||||
|
|||||||
Reference in New Issue
Block a user