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

Commit 288c0ef6 authored by Samyukta Mogily's avatar Samyukta Mogily
Browse files

msm: camera: Adding sensor i2c changes to enable camera on 8909 MTP



Camera crash is being observed on 8909-MTP due to i2c write failures.
Hence adding sensor i2c retry logic which handles these errors and
enables camera on 8909 MTP.

Change-Id: I22c09ce5c4f9eaa7c8dff1df699e2ad3263dcb1d
Signed-off-by: default avatarSamyukta Mogily <smogily@codeaurora.org>
parent 36d0c813
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
/* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2017, 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
@@ -29,11 +29,11 @@
#include <media/videobuf2-dma-contig.h>
#include <media/msmb_camera.h>

/* Setting MAX timeout to 6.5seconds considering
/* Setting MAX timeout to 10seconds considering
 * backend will operate @ .6fps in certain usecases
 * like Long exposure usecase and isp needs max of 2 frames
 * to stop the hardware which will be around 3 seconds*/
#define MSM_POST_EVT_TIMEOUT 6500
#define MSM_POST_EVT_TIMEOUT 10000
#define MSM_POST_EVT_NOTIMEOUT 0xFFFFFFFF
#define MSM_CAMERA_STREAM_CNT_BITS  32

+14 −4
Original line number Diff line number Diff line
/* Copyright (c) 2011, 2013-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011, 2013-2017, 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
@@ -269,6 +269,7 @@ int32_t msm_camera_qup_i2c_write_table(struct msm_camera_i2c_client *client,
	int32_t rc = -EFAULT;
	struct msm_camera_i2c_reg_array *reg_setting;
	uint16_t client_addr_type;
	int retry = 0;

	if (!client || !write_setting)
		return rc;
@@ -286,11 +287,20 @@ int32_t msm_camera_qup_i2c_write_table(struct msm_camera_i2c_client *client,
	for (i = 0; i < write_setting->size; i++) {
		CDBG("%s addr 0x%x data 0x%x\n", __func__,
			reg_setting->reg_addr, reg_setting->reg_data);
		do {
			rc = msm_camera_qup_i2c_write(client,
				reg_setting->reg_addr, reg_setting->reg_data,
				write_setting->data_type);
			if (rc >= 0)
				break;
		} while (retry++ < 2);

		rc = msm_camera_qup_i2c_write(client, reg_setting->reg_addr,
			reg_setting->reg_data, write_setting->data_type);
		if (rc < 0)
		if (rc < 0) {
			pr_err("FAILED: %s addr 0x%x data 0x%x\n", __func__,
				reg_setting->reg_addr, reg_setting->reg_data);
			break;
		}
		retry = 0;
		reg_setting++;
	}
	if (write_setting->delay > 20)
+2 −2
Original line number Diff line number Diff line
/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2017, 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
@@ -10,7 +10,7 @@
 * GNU General Public License for more details.
 */

#define SENSOR_DRIVER_I2C "i2c_camera"
#define SENSOR_DRIVER_I2C "camera"
/* Header file declaration */
#include "msm_sensor.h"
#include "msm_sd.h"