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

Commit 48c55694 authored by Amit Nischal's avatar Amit Nischal Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: Add support for reset controller framework



The current api which performs the clock reset is moved to use the reset
framework, so support the changes in camera driver for the same. The reset
framework requires to get reset handle and perform assert/deassert of the
resets.

Change-Id: I5a809e464c90c29b6f69fc0bfba67bae9a9b6551
Signed-off-by: default avatarAmit Nischal <anischal@codeaurora.org>
parent 911e592f
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -22,6 +22,10 @@ Required properties:
  case dynamic clock scaling based on prevalent streams need lower clock rate.
- qcom,cpp-fw-payload-info: Child node for cpp node having infomration on
  cpp firmware payload offsets. This is mandatory node.
- resets: reset specifier pair consists of phandle for the reset controller
  and reset lines used by this controller.
- reset-names: reset signal name strings sorted in the same order as the resets
  property.

Required properties of the child node:
- qcom,stripe-base = Base offset of stripes in cpp payload.
@@ -120,6 +124,7 @@ Example:
			qcom,ref-we-mmu-pf-ptr-off = <22>;
			qcom,set-group-buffer-len = <135>;
			qcom,dup-frame-indicator-off = <70>;

		resets = <&clock_mmss MMSS_CAMSS_MICRO_BCR>;
		reset-names = "micro_iface_reset";
		};
	};
+4 −0
Original line number Diff line number Diff line
@@ -623,6 +623,10 @@
			"camss_cpp_axi_clk", "camss_cpp_clk",
			"micro_iface_clk", "camss_ahb_clk",
			"smmu_cpp_axi_clk", "cpp_vbif_ahb_clk";

		resets = <&clock_mmss CAMSS_MICRO_BCR>;
		reset-names = "micro_iface_reset";

		qcom,clock-rates = <0 0 0 480000000 0 0 480000000 0 0 0 0>;
		qcom,min-clock-rate = <200000000>;
		qcom,bus-master = <1>;
+2 −0
Original line number Diff line number Diff line
@@ -405,6 +405,8 @@
			<106 512 0 0>,
			<106 512 0 0>;
		qcom,msm-bus-vector-dyn-vote;
		resets = <&clock_mmss CAMSS_MICRO_BCR>;
		reset-names = "micro_iface_reset";
		qcom,cpp-fw-payload-info {
			qcom,stripe-base = <790>;
			qcom,plane-base = <715>;
+22 −0
Original line number Diff line number Diff line
@@ -542,6 +542,28 @@ int msm_camera_put_clk_info_and_rates(struct platform_device *pdev,
}
EXPORT_SYMBOL(msm_camera_put_clk_info_and_rates);

/* Get reset info from DT */
int msm_camera_get_reset_info(struct platform_device *pdev,
		struct reset_control **micro_iface_reset)
{
	if (!pdev || !micro_iface_reset)
		return -EINVAL;

	if (of_property_match_string(pdev->dev.of_node, "reset-names",
				"micro_iface_reset")) {
		pr_err("err: Reset property not found\n");
		return -EINVAL;
	}

	*micro_iface_reset = devm_reset_control_get
				(&pdev->dev, "micro_iface_reset");
	if (IS_ERR(*micro_iface_reset))
		return PTR_ERR(*micro_iface_reset);

	return 0;
}
EXPORT_SYMBOL(msm_camera_get_reset_info);

/* Get regulators from DT */
int msm_camera_get_regulator_info(struct platform_device *pdev,
				struct msm_cam_regulator **vdd_info,
+16 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <linux/regulator/consumer.h>
#include <linux/interrupt.h>
#include <linux/slab.h>
#include <linux/reset.h>
#include <soc/qcom/camera2.h>

enum cam_bus_client {
@@ -187,6 +188,21 @@ int msm_camera_clk_enable(struct device *dev,
long msm_camera_clk_set_rate(struct device *dev,
				struct clk *clk,
				long clk_rate);

/**
 * @brief      : Gets reset info
 *
 * This function extracts the reset information for a specific
 * platform device
 *
 * @param pdev   : platform device to get reset information
 * @param micro_iface_reset : Pointer to populate the reset names
 *
 * @return Status of operation. Negative in case of error. Zero otherwise.
 */

int msm_camera_get_reset_info(struct platform_device *pdev,
			struct reset_control **micro_iface_reset);
/**
 * @brief      : Sets flags of a clock
 *
Loading