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

Commit 98e9c7f8 authored by Sagar Gore's avatar Sagar Gore
Browse files

msm: camera: Avoid writing wrong reg in BF_scale stats configuration



BUS_STATS_BF_SCALE_XXXX unlike other STATS, only contains PING, PONG and
UB_CFG (not FRAMEDROP_PATTERN, ADDR_CFG and IRQ_SUBSAMPLE_PATTERN).
But the current code assumes they are present and configure such
registers, overwriting other registers. Fix added to avoid writing
those registers for configuring BF Scale stats.

Change-Id: Idb1b8ec32b456484ae39996c7fde595ab055a340
Signed-off-by: default avatarSagar Gore <sgore@codeaurora.org>
parent 416e5ce5
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2014, 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
@@ -811,6 +811,7 @@ static void msm_vfe44_axi_clear_wm_reg(
{
	uint32_t val = 0;
	uint32_t wm_base = VFE44_WM_BASE(stream_info->wm[plane_idx]);

	/*WR_ADDR_CFG*/
	msm_camera_io_w(val, vfe_dev->vfe_base + wm_base + 0xC);
	/*WR_IMAGE_SIZE*/
@@ -1084,6 +1085,11 @@ static void msm_vfe44_stats_cfg_wm_reg(
	int stats_idx = STATS_IDX(stream_info->stream_handle);
	uint32_t stats_base = VFE44_STATS_BASE(stats_idx);

	/* BF_SCALE does not have its own WR_ADDR_CFG,
	 * IRQ_FRAMEDROP_PATTERN and IRQ_SUBSAMPLE_PATTERN;
	 * it's using the same from BF */
	if (stats_idx == STATS_IDX_BF_SCALE)
		return;
	/*WR_ADDR_CFG*/
	msm_camera_io_w(stream_info->framedrop_period << 2,
		vfe_dev->vfe_base + stats_base + 0x8);
@@ -1102,6 +1108,11 @@ static void msm_vfe44_stats_clear_wm_reg(
	uint32_t val = 0;
	int stats_idx = STATS_IDX(stream_info->stream_handle);
	uint32_t stats_base = VFE44_STATS_BASE(stats_idx);
	/* BF_SCALE does not have its own WR_ADDR_CFG,
	 * IRQ_FRAMEDROP_PATTERN and IRQ_SUBSAMPLE_PATTERN;
	 * it's using the same from BF */
	if (stats_idx == STATS_IDX_BF_SCALE)
		return;

	/*WR_ADDR_CFG*/
	msm_camera_io_w(val, vfe_dev->vfe_base + stats_base + 0x8);