summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2019-02-04 23:34:13 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2019-02-04 23:34:13 -0800
commitb27a053258dbbb505147b429e716a08c74a26918 (patch)
treee29dee1861f99e3973dce296d25d2c95209f629f
parented6ee95b3f73481494d4603c6e9890cf25038b42 (diff)
parent59400944fb900d7c36068d92c2c2c17e3a256c84 (diff)
Merge "msm-camera: add cx-ipeak support in cpp"
-rw-r--r--drivers/media/platform/msm/camera_v2/pproc/cpp/msm_cpp.c24
-rw-r--r--drivers/media/platform/msm/camera_v2/pproc/cpp/msm_cpp.h3
2 files changed, 20 insertions, 7 deletions
diff --git a/drivers/media/platform/msm/camera_v2/pproc/cpp/msm_cpp.c b/drivers/media/platform/msm/camera_v2/pproc/cpp/msm_cpp.c
index 4b5671cd9c28..d61e6beabfa4 100644
--- a/drivers/media/platform/msm/camera_v2/pproc/cpp/msm_cpp.c
+++ b/drivers/media/platform/msm/camera_v2/pproc/cpp/msm_cpp.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -36,6 +36,7 @@
#include "msm_camera_io_util.h"
#include <linux/debugfs.h>
#include "cam_smmu_api.h"
+#include "msm_cam_cx_ipeak.h"
#define MSM_CPP_DRV_NAME "msm_cpp"
@@ -1537,7 +1538,9 @@ static int cpp_close_node(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
}
if (cpp_dev->turbo_vote == 1) {
- rc = cx_ipeak_update(cpp_dev->cpp_cx_ipeak, false);
+ pr_debug("%s:cx_ipeak_update unvote. ipeak bit %d\n",
+ __func__, cpp_dev->cx_ipeak_bit);
+ rc = cam_cx_ipeak_unvote_cx_ipeak(cpp_dev->cx_ipeak_bit);
if (rc)
pr_err("cx_ipeak_update failed");
else
@@ -3109,7 +3112,9 @@ unsigned long cpp_cx_ipeak_update(struct cpp_device *cpp_dev,
if ((clock >= cpp_dev->hw_info.freq_tbl
[(cpp_dev->hw_info.freq_tbl_count) - 1]) &&
(cpp_dev->turbo_vote == 0)) {
- ret = cx_ipeak_update(cpp_dev->cpp_cx_ipeak, true);
+ pr_debug("%s: clk is more than Nominal cpp, ipeak bit %d\n",
+ __func__, cpp_dev->cx_ipeak_bit);
+ ret = cam_cx_ipeak_update_vote_cx_ipeak(cpp_dev->cx_ipeak_bit);
if (ret) {
pr_err("cx_ipeak voting failed setting clock below turbo");
clock = cpp_dev->hw_info.freq_tbl
@@ -3122,7 +3127,10 @@ unsigned long cpp_cx_ipeak_update(struct cpp_device *cpp_dev,
[(cpp_dev->hw_info.freq_tbl_count) - 1]) {
clock_rate = msm_cpp_set_core_clk(cpp_dev, clock, idx);
if (cpp_dev->turbo_vote == 1) {
- ret = cx_ipeak_update(cpp_dev->cpp_cx_ipeak, false);
+ pr_debug("%s:clk is less than Nominal, ipeak bit %d\n",
+ __func__, cpp_dev->cx_ipeak_bit);
+ ret = cam_cx_ipeak_unvote_cx_ipeak(
+ cpp_dev->cx_ipeak_bit);
if (ret)
pr_err("cx_ipeak unvoting failed");
else
@@ -4605,8 +4613,12 @@ static int cpp_probe(struct platform_device *pdev)
if (of_find_property(pdev->dev.of_node, "qcom,cpp-cx-ipeak", NULL)) {
cpp_dev->cpp_cx_ipeak = cx_ipeak_register(
pdev->dev.of_node, "qcom,cpp-cx-ipeak");
- if (cpp_dev->cpp_cx_ipeak)
- CPP_DBG("Cx ipeak Registration Successful ");
+ if (cpp_dev->cpp_cx_ipeak) {
+ cam_cx_ipeak_register_cx_ipeak(cpp_dev->cpp_cx_ipeak,
+ &cpp_dev->cx_ipeak_bit);
+ pr_err("%s register cx_ipeak received bit %d\n",
+ __func__, cpp_dev->cx_ipeak_bit);
+ }
else
pr_err("Cx ipeak Registration Unsuccessful");
}
diff --git a/drivers/media/platform/msm/camera_v2/pproc/cpp/msm_cpp.h b/drivers/media/platform/msm/camera_v2/pproc/cpp/msm_cpp.h
index f2c544785f46..0f5d6759acd3 100644
--- a/drivers/media/platform/msm/camera_v2/pproc/cpp/msm_cpp.h
+++ b/drivers/media/platform/msm/camera_v2/pproc/cpp/msm_cpp.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2017, 2019 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -293,6 +293,7 @@ struct cpp_device {
struct msm_cpp_vbif_data *vbif_data;
bool turbo_vote;
struct cx_ipeak_client *cpp_cx_ipeak;
+ int cx_ipeak_bit;
enum cpp_iommu_fault_state fault_status;
};