Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 180f7ba0 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm-camera: add cx-ipeak support in cpp"

parents 0a3da25b 04c35a37
Loading
Loading
Loading
Loading
+23 −3
Original line number Original line Diff line number Diff line
@@ -35,6 +35,7 @@
#include "msm_camera_io_util.h"
#include "msm_camera_io_util.h"
#include <linux/debugfs.h>
#include <linux/debugfs.h>
#include "cam_smmu_api.h"
#include "cam_smmu_api.h"
#include "msm_cam_cx_ipeak.h"


#define MSM_CPP_DRV_NAME "msm_cpp"
#define MSM_CPP_DRV_NAME "msm_cpp"


@@ -1523,7 +1524,9 @@ static int cpp_close_node(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
	}
	}


	if (cpp_dev->turbo_vote == 1) {
	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)
			if (rc)
				pr_err("cx_ipeak_update failed");
				pr_err("cx_ipeak_update failed");
			else
			else
@@ -3095,7 +3098,9 @@ static unsigned long cpp_cx_ipeak_update(struct cpp_device *cpp_dev,
	if ((clock >= cpp_dev->hw_info.freq_tbl
	if ((clock >= cpp_dev->hw_info.freq_tbl
		[(cpp_dev->hw_info.freq_tbl_count) - 1]) &&
		[(cpp_dev->hw_info.freq_tbl_count) - 1]) &&
		(cpp_dev->turbo_vote == 0)) {
		(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) {
		if (ret) {
			pr_err("cx_ipeak voting failed setting clock below turbo");
			pr_err("cx_ipeak voting failed setting clock below turbo");
			clock = cpp_dev->hw_info.freq_tbl
			clock = cpp_dev->hw_info.freq_tbl
@@ -3108,7 +3113,10 @@ static unsigned long cpp_cx_ipeak_update(struct cpp_device *cpp_dev,
		[(cpp_dev->hw_info.freq_tbl_count) - 1]) {
		[(cpp_dev->hw_info.freq_tbl_count) - 1]) {
		clock_rate = msm_cpp_set_core_clk(cpp_dev, clock, idx);
		clock_rate = msm_cpp_set_core_clk(cpp_dev, clock, idx);
		if (cpp_dev->turbo_vote == 1) {
		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)
			if (ret)
				pr_err("cx_ipeak unvoting failed");
				pr_err("cx_ipeak unvoting failed");
			else
			else
@@ -4583,6 +4591,18 @@ 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) {
			cam_cx_ipeak_register_cx_ipeak(cpp_dev->cpp_cx_ipeak,
				&cpp_dev->cx_ipeak_bit);
			pr_debug("%s register cx_ipeak received bit %d\n",
				__func__, cpp_dev->cx_ipeak_bit);
		} else
			pr_err("Cx ipeak Registration Unsuccessful");
	}

	rc = msm_camera_get_reset_info(pdev,
	rc = msm_camera_get_reset_info(pdev,
			&cpp_dev->micro_iface_reset);
			&cpp_dev->micro_iface_reset);
	if (rc < 0) {
	if (rc < 0) {
+2 −1
Original line number Original line Diff line number Diff line
/* 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
 * 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
 * it under the terms of the GNU General Public License version 2 and
@@ -292,6 +292,7 @@ struct cpp_device {
	struct msm_cpp_vbif_data *vbif_data;
	struct msm_cpp_vbif_data *vbif_data;
	bool turbo_vote;
	bool turbo_vote;
	struct cx_ipeak_client *cpp_cx_ipeak;
	struct cx_ipeak_client *cpp_cx_ipeak;
	int cx_ipeak_bit;
	enum cpp_iommu_fault_state fault_status;
	enum cpp_iommu_fault_state fault_status;
};
};