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

Commit 1d3ed355 authored by Pavan Kumar Chilamkurthi's avatar Pavan Kumar Chilamkurthi
Browse files

msm: camera: utils: Save cell-index into soc info



Save the cell-index value read from dt node into
soc info structure, read reg-cam-base values
only when reg-names exists, few typo corrections
in comment headers.

CRs-Fixed: 2019539
Change-Id: If48e5448d17052efbaa34900ab283588d055d4b9
Signed-off-by: default avatarPavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
parent deda3be7
Loading
Loading
Loading
Loading
+8 −6
Original line number Original line Diff line number Diff line
@@ -267,7 +267,7 @@ int cam_soc_util_get_dt_properties(struct cam_hw_soc_info *soc_info)


	of_node = pdev->dev.of_node;
	of_node = pdev->dev.of_node;


	rc = of_property_read_u32(of_node, "cell-index", &pdev->id);
	rc = of_property_read_u32(of_node, "cell-index", &soc_info->index);
	if (rc) {
	if (rc) {
		pr_err("device %s failed to read cell-index\n", pdev->name);
		pr_err("device %s failed to read cell-index\n", pdev->name);
		return rc;
		return rc;
@@ -317,12 +317,14 @@ int cam_soc_util_get_dt_properties(struct cam_hw_soc_info *soc_info)
		}
		}
	}
	}


	if (soc_info->num_mem_block > 0) {
		rc = of_property_read_u32_array(of_node, "reg-cam-base",
		rc = of_property_read_u32_array(of_node, "reg-cam-base",
			soc_info->mem_block_cam_base, soc_info->num_mem_block);
			soc_info->mem_block_cam_base, soc_info->num_mem_block);
		if (rc) {
		if (rc) {
			pr_err("Error reading register offsets\n");
			pr_err("Error reading register offsets\n");
			return rc;
			return rc;
		}
		}
	}


	rc = of_property_read_string_index(of_node, "interrupt-names", 0,
	rc = of_property_read_string_index(of_node, "interrupt-names", 0,
		&soc_info->irq_name);
		&soc_info->irq_name);
+4 −4
Original line number Original line Diff line number Diff line
@@ -18,6 +18,7 @@
#include <linux/io.h>
#include <linux/io.h>
#include <linux/platform_device.h>
#include <linux/platform_device.h>
#include <linux/regulator/consumer.h>
#include <linux/regulator/consumer.h>

#include "cam_io_util.h"
#include "cam_io_util.h"


#define NO_SET_RATE  -1
#define NO_SET_RATE  -1
@@ -54,7 +55,7 @@ struct cam_soc_reg_map {
 *                          Camera hardware driver module
 *                          Camera hardware driver module
 *
 *
 * @pdev:                   Platform device pointer
 * @pdev:                   Platform device pointer
 * @hw_version;             Camera device version
 * @hw_version:             Camera device version
 * @index:                  Instance id for the camera device
 * @index:                  Instance id for the camera device
 * @irq_name:               Name of the irq associated with the device
 * @irq_name:               Name of the irq associated with the device
 * @irq_line:               Irq resource
 * @irq_line:               Irq resource
@@ -76,7 +77,7 @@ struct cam_soc_reg_map {
 * @clk:                    Array of associated clock resources
 * @clk:                    Array of associated clock resources
 * @clk_rate:               Array of default clock rates
 * @clk_rate:               Array of default clock rates
 * @src_clk_idx:            Source clock index that is rate-controllable
 * @src_clk_idx:            Source clock index that is rate-controllable
 * @soc_private;            Soc private data
 * @soc_private:            Soc private data
 *
 *
 */
 */
struct cam_hw_soc_info {
struct cam_hw_soc_info {
@@ -172,7 +173,6 @@ struct cam_hw_soc_info {
 */
 */
int cam_soc_util_get_dt_properties(struct cam_hw_soc_info *soc_info);
int cam_soc_util_get_dt_properties(struct cam_hw_soc_info *soc_info);



/**
/**
 * cam_soc_util_request_platform_resource()
 * cam_soc_util_request_platform_resource()
 *
 *
@@ -208,7 +208,7 @@ int cam_soc_util_release_platform_resource(struct cam_hw_soc_info *soc_info);
 *                          TRUE: Enable all clocks in soc_info Now.
 *                          TRUE: Enable all clocks in soc_info Now.
 *                          False: Don't enable clocks Now. Driver will
 *                          False: Don't enable clocks Now. Driver will
 *                                 enable independently.
 *                                 enable independently.
 @enable_irq:           Boolean flag:
 * @enable_irq:         Boolean flag:
 *                          TRUE: Enable IRQ in soc_info Now.
 *                          TRUE: Enable IRQ in soc_info Now.
 *                          False: Don't enable IRQ Now. Driver will
 *                          False: Don't enable IRQ Now. Driver will
 *                                 enable independently.
 *                                 enable independently.