Skip to content

Commit

Permalink
msm: ispif: Adding csid version check
Browse files Browse the repository at this point in the history
Check the csid version check before enabling camera
clocks to avoid device crash.

CRs-Fixed: 2189721
Change-Id: I1028bd776b6722190d0d981c3b63a9d60386152b
Signed-off-by: VijayaKumar T M <vtmuni@codeaurora.org>
Signed-off-by: Suman Mukherjee <sumam@codeaurora.org>
Signed-off-by: khusika <khusikadhamar@gmail.com>
  • Loading branch information
VijayaKumar T M authored and khusika committed Oct 13, 2018
1 parent e01529b commit ba39c2c
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions drivers/media/platform/msm/camera_v2/ispif/msm_ispif_32.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2018, 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
Expand Down Expand Up @@ -43,6 +43,8 @@
#define ISPIF_TIMEOUT_SLEEP_US 1000
#define ISPIF_TIMEOUT_ALL_US 1000000

#define CSID_VERSION_V37 0x30070000

#undef CDBG
#ifdef CONFIG_MSMB_CAMERA_DEBUG
#define CDBG(fmt, args...) pr_debug(fmt, ##args)
Expand Down Expand Up @@ -123,6 +125,11 @@ static int msm_ispif_reset_hw(struct ispif_device *ispif)

ispif->clk_idx = 0;

if (ispif->csid_version != CSID_VERSION_V37) {
pr_err("%s:%d error returning\n", __func__, __LINE__);
return -EINVAL;
}

rc = msm_cam_clk_enable(&ispif->pdev->dev,
ispif_8974_reset_clk_info, reset_clk,
ARRAY_SIZE(ispif_8974_reset_clk_info), 1);
Expand Down Expand Up @@ -1255,8 +1262,12 @@ static int msm_ispif_init(struct ispif_device *ispif,
goto error_ahb;
}

msm_ispif_reset_hw(ispif);

rc = msm_ispif_reset_hw(ispif);
if (rc < 0) {
pr_err("%s:%d msm_ispif_reset_hw failed\n", __func__,
__LINE__);
goto error_ahb;
}
rc = msm_ispif_reset(ispif);
if (rc == 0) {
ispif->ispif_state = ISPIF_POWER_UP;
Expand Down

0 comments on commit ba39c2c

Please sign in to comment.