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

Commit 9853026f authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: cpp: Changes to adapt cpp driver to soc layer"

parents 6d7d2a20 c17646d0
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -395,32 +395,33 @@ cam_clk_set_err:
EXPORT_SYMBOL(msm_camera_clk_enable);

/* Set rate on a specific clock */
int msm_camera_clk_set_rate(struct device *dev,
long msm_camera_clk_set_rate(struct device *dev,
			struct clk *clk,
			long clk_rate)
{
	int rc = 0;
	long rate = 0;

	if (!dev || !clk)
	if (!dev || !clk || (clk_rate < 0))
		return -EINVAL;

	CDBG("clk : %p, enable : %ld\n", clk, clk_rate);

	if (clk_rate > 0) {
		clk_rate = clk_round_rate(clk, clk_rate);
		if (clk_rate < 0) {
		rate = clk_round_rate(clk, clk_rate);
		if (rate < 0) {
			pr_err("round rate failed\n");
			return -EINVAL;
		}

		rc = clk_set_rate(clk, clk_rate);
		rc = clk_set_rate(clk, rate);
		if (rc < 0) {
			pr_err("set rate failed\n");
			return -EINVAL;
		}
	}

	return 0;
	return rate;
}
EXPORT_SYMBOL(msm_camera_clk_set_rate);

+4 −4
Original line number Diff line number Diff line
@@ -134,19 +134,19 @@ int msm_camera_clk_enable(struct device *dev,
/**
 * @brief      : Set clock rate
 *
 * This function sets the rate for a specified clock
 * This function sets the rate for a specified clock and
 * returns the rounded value
 *
 * @param dev   : Device to get clocks information
 * @param clk   : Pointer to clock to set rate
 * @param clk_rate   : Rate to be set
 *
 * @return Status of operation. Negative in case of error. Zero otherwise.
 * @return Status of operation. Negative in case of error. clk rate otherwise.
 */

int msm_camera_clk_set_rate(struct device *dev,
long msm_camera_clk_set_rate(struct device *dev,
				struct clk *clk,
				long clk_rate);

/**
 * @brief      : Gets regulator info
 *
+1 −1
Original line number Diff line number Diff line
@@ -2,4 +2,4 @@ ccflags-y += -Idrivers/media/platform/msm/camera_v2
ccflags-y += -Idrivers/media/platform/msm/camera_v2/isp/
ccflags-y += -Idrivers/media/platform/msm/camera_v2/sensor/io
ccflags-y += -Idrivers/media/platform/msm/camera_v2/common
obj-$(CONFIG_MSM_CPP) += msm_cpp.o
obj-$(CONFIG_MSM_CPP) += msm_cpp_soc.o msm_cpp.o
+127 −548

File changed.

Preview size limit exceeded, changes collapsed.

+15 −10
Original line number Diff line number Diff line
/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2016, 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
@@ -20,6 +20,8 @@
#include <linux/interrupt.h>
#include <media/v4l2-subdev.h>
#include "msm_sd.h"
#include "cam_soc_api.h"
#include "cam_hw_ops.h"

/* hw version info:
  31:28  Major version
@@ -200,21 +202,16 @@ struct cpp_device {
	struct platform_device *pdev;
	struct msm_sd_subdev msm_sd;
	struct v4l2_subdev subdev;
	struct resource *mem;
	struct resource *irq;
	struct resource *io;
	struct resource	*vbif_mem;
	struct resource *vbif_io;
	struct resource	*cpp_hw_mem;
	struct resource	*camss_cpp;
	void __iomem *vbif_base;
	void __iomem *base;
	void __iomem *cpp_hw_base;
	void __iomem *camss_cpp_base;
	struct clk **cpp_clk;
	struct regulator *fs_cpp;
	struct regulator *fs_camss;
	struct regulator *fs_mmagic_camss;
	struct msm_cam_clk_info *clk_info;
	size_t num_clks;
	struct regulator **cpp_vdd;
	int num_reg;
	struct mutex mutex;
	enum cpp_state state;
	enum cpp_iommu_state iommu_state;
@@ -264,4 +261,12 @@ struct cpp_device {
	uint32_t bus_master_flag;
	struct msm_cpp_payload_params payload_params;
};

int msm_cpp_set_micro_clk(struct cpp_device *cpp_dev);
int msm_update_freq_tbl(struct cpp_device *cpp_dev);
int msm_cpp_get_clock_index(struct cpp_device *cpp_dev, const char *clk_name);
long msm_cpp_set_core_clk(struct cpp_device *cpp_dev, long rate, int idx);
void msm_cpp_fetch_dt_params(struct cpp_device *cpp_dev);
int msm_cpp_read_payload_params_from_dt(struct cpp_device *cpp_dev);

#endif /* __MSM_CPP_H__ */
Loading