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

Commit 95e901bf authored by minz1's avatar minz1
Browse files

msm: camera: reset to CAF

parent c6e59ddb
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -34,19 +34,7 @@ config MSMB_CAMERA_DEBUG
	  Enable printk() debug for msm camera 2.0

if MSMB_CAMERA
if SEC_FORTUNA_PROJECT
source "drivers/media/platform/msm/camera_v2_fortuna/Kconfig"
endif # SEC_FORTUNA_PROJECT
if MACH_J5LTE_CHN_CMCC
source "drivers/media/platform/msm/camera_v2_j5/Kconfig"
endif # SEC_J5_PROJECT
if SEC_J7_PROJECT
source "drivers/media/platform/msm/camera_v2_j7lte/Kconfig"
endif # SEC_J7_PROJECT

if !(SEC_FORTUNA_PROJECT || MACH_J5LTE_CHN_CMCC || SEC_J7_PROJECT)
source "drivers/media/platform/msm/camera_v2/Kconfig"
endif # SEC_FORTUNA_PROJECT
endif # MSMB_CAMERA

source "drivers/media/platform/msm/vidc/Kconfig"
+0 −8
Original line number Diff line number Diff line
@@ -7,14 +7,6 @@ obj-$(CONFIG_MSM_VIDC_V4L2) += vidc/
obj-y += broadcast/
obj-$(CONFIG_DVB_MPQ) += dvb/

ifeq ($(CONFIG_MACH_J5LTE_CHN_CMCC),y)
obj-$(CONFIG_MSMB_CAMERA) += camera_v2_j5/
else ifeq ($(CONFIG_SEC_FORTUNA_PROJECT),y)
obj-$(CONFIG_MSMB_CAMERA) += camera_v2_fortuna/
else ifeq ($(CONFIG_SEC_J7_PROJECT),y)
obj-$(CONFIG_MSMB_CAMERA) += camera_v2_j7lte/
else
obj-$(CONFIG_MSMB_CAMERA) += camera_v2/
endif

obj-$(CONFIG_MSM_VPU) += vpu/
+21 −187
Original line number Diff line number Diff line
@@ -93,23 +93,6 @@ config MSM_EEPROM
          and also provides support for writing data in case of FLASH ROM.
	  Currently supports I2C, CCI and SPI protocol

config MSM_FRONT_EEPROM
        bool "Qualcomm MSM Camera ROM Interface for Calibration support"
        depends on MSMB_CAMERA
        ---help---
          Enable support for ROM Interface for Calibration
          Provides interface for reading the Claibration data.
          and also provides support for writing data in case of FLASH ROM.
          Currently supports I2C, CCI and SPI protocol

config MSM_OTP
        bool "Qualcomm MSM Camera ROM Interface for Calibration support"
        depends on MSMB_CAMERA
        ---help---
          Enable support for ROM Interface for Calibration
          Provides interface for reading the Claibration data.
          and also provides support for writing data

config MSM_ISPIF
        bool "Qualcomm MSM Image Signal Processing interface support"
        depends on MSMB_CAMERA
@@ -128,12 +111,6 @@ config MSM_ISPIF_V1
          of any CID of MSM_CSI22_HEADER can be routed to of pixel
          or raw data interface in VFE.

config SENSOR_8_BPP
        bool "8 bits per pixel YUV sensor output"
        depends on MSMB_CAMERA
        ---help---
          8 bits per pixel YUV sensor output.

config IMX134
	bool "Sensor IMX134 (BAYER 8M)"
	depends on MSMB_CAMERA
@@ -152,22 +129,6 @@ config IMX132
		snapshot config = 1920 x 1080 at 30 fps,
		Video HDR support.

config SR352
        bool "Sensor for front camera"
        depends on MSMB_CAMERA
        default n
        ---help---
          Siliconfile 3MP sensor,
          Rear sensor.

config SR130PC20
        bool "Sensor for front camera"
        depends on MSMB_CAMERA
        default n
        ---help---
          Siliconfile 1.3MP sensor,
          Front sensor.

config OV9724
	bool "Sensor OV9724 (BAYER 2M)"
	depends on MSMB_CAMERA
@@ -212,20 +173,14 @@ config OV5645
		1280 * 270. It does not support auto focus. It supports
		few special effects like saturation.

config SR200PC20
	bool "Sensor for front camera"
	depends on MSMB_CAMERA
	default n
	---help---
	  Siliconfile 2.0MP sensor,
	  Front sensor.
config SR544
    bool "Sensor for back camera"
config OV7695
	bool "Sensor OV7695 (YUV 0.3MP)"
	depends on MSMB_CAMERA
	default n
	---help---
	5MP sensor
	Rear sensor
		OV7695 is Omnivision YUV sensor. It supports 0.3 MP preview
		and snapshot. The preview and snapshot resolution shall be
		VGA. It does not support auto focus. It supports
		few special effects like saturation.

config SP1628
	bool "Sensor SP1628 (YUV 720P)"
@@ -245,6 +200,15 @@ config GC0339
		Preview and snapshot resolution shall be 640*480 at 30 fps,
		It does not support auto focus.

config GC0310
	bool "Sensor GC0310 (YUV .3M)"
	depends on MSMB_CAMERA
	---help---
		0310 is a Galaxycore .3 MP YUV Sensor.
		It supports 1 mipi lane.
		Preview and snapshot resolution shall be 640*480 at 30 fps,
		It does not support auto focus.

config OV8825
	bool "OmniVision OV8825 (BAYER 8MP)"
	depends on MSMB_CAMERA
@@ -272,63 +236,6 @@ config s5k4e1
		and QSXGA snapshot at 15 fps.
		This sensor driver does not support auto focus.

config S5K8B1YX
	bool "Sensor S5K8B1YX (BAYER 2M)"
	depends on MSMB_CAMERA
	---help---
		LSI 2 MP Bayer Sensor, supports 2 mipi lanes,
		preview and snapshot config at 1280*720 at 30 fps,
		hfr video at 60, 90 and 120 fps. This sensor driver does
		not support auto focus.

config S5K6A3YX
	bool "Sensor S5K6A3YX (BAYER 1.9M)"
	depends on MSMB_CAMERA
	---help---
		S.LSI. 2 MP Bayer Sensor, supports 2 mipi lanes,

config S5K4H5YB
	bool "Sensor S5K4H5YB (BAYER 8M)"
	depends on MSMB_CAMERA
	---help---
		S.LSI. 8 MP Bayer Sensor with auto focus, uses
		4 mipi lanes full resolution @30fps and

config S5K3L2XX
	bool "Sensor S5K3L2XX (BAYER 13M)"
	depends on MSMB_CAMERA
	---help---
		S.LSI. 13MP Bayer Sensor with auto focus, uses
		4 mipi lanes full resolution @30fps

config S5K3P3SX
	bool "Sensor S5K3P3SX (BAYER 16M)"
	depends on MSMB_CAMERA
	---help---
		S.LSI. 16MP Bayer Sensor with auto focus, uses
		4 mipi lanes full resolution @30fps

config S5K5E3YX
	bool "Sensor S5K5E3YX (BAYER 5M)"
	depends on MSMB_CAMERA
	---help---
		S.LSI. 5MP Bayer Sensor with auto focus, uses
		2 mipi lanes full resolution @30fps

config SR552
	bool "Sensor SR552 (BAYER 5M)"
	depends on MSMB_CAMERA
	---help---
		S.LSI. 5MP Bayer Sensor with auto focus, uses
		2 mipi lanes full resolution @30fps

config S5K4ECGX
	bool "Sensor s5k4ecgx (SOC 5MP)"
	depends on MSMB_CAMERA
	---help---
		Samsung 5 MP SOC Sensor. It uses 2 mipi lanes,
		Support auto focus, and flash

config OV12830
	bool "OmniVision OV12830 (BAYER 12MP)"
	depends on MSMB_CAMERA
@@ -361,81 +268,8 @@ config MSM_GEMINI
	---help---
	  Enables support for the Gemini JPEG encoder engine for 8x60.

config SEC_CAMERA_TUNING
	bool "Generic Tuning Concept"
	---help---
	  Enable support for Tuning in eng Binary

config CAM_USE_EXT_VANA_GPIO
	bool "Samsung EXT_VANA_GPIO"
	depends on MSMB_CAMERA
	---help---
	  Board use external LDO controlled by GPIO.

config CAM_DISABLE_LPM_MODE
	bool "Camera is Disabled in LPM mode."
	depends on NFC_PN547
	default n
	---help---
	Because NFC HW limitation which should not be turned on L16.

config CAM_PN547_PVDD_EN_CONTROL
	bool "PN547 NFC PVDD EN CONTROL"
	depends on NFC_PN547
	default n
	help
	  SAMSUNG PN547 NFC PVDD EN CONTROL feature.
	  This feature provides support for NXP PN547 products.
	  You should select this feature if your NFC product uses pvdd en pin.
	  Say Y here to compile support for NXP PN547 PVDD EN CONTROL feature into the
	  kernel.

config SW_LANDING_FOR_MULTI_TASKING
	bool "SW Landing is applied during multi tasking"
	depends on ACTUATOR
	default n
	help
	  If Camera exit while multi tasking with call, actuator makes big noise.
	  SW landing is applied during multi tasking only.

config CAMERA_SYSFS_V2
	bool "CAMERA SYS"
	depends on MSMB_CAMERA
	---help---
	  CAMERA SYS.

config DB8221A
	bool "Sensor for front camera"
	depends on MSMB_CAMERA
	default n
	---help---
	  Dongbu HiTek 2.0MP sensor,
	  Front sensor.

config OIS
        tristate "External ois support"
        depends on MSMB_CAMERA
        default n
        ---help---
          Enables support for external ois module.

config CAM_DUAL_POWER_SEQ
	bool "Dual power up sequence enable"
	depends on MSMB_CAMERA
	---help---
		This flag will allow us to write dual power up sequence.

config FRONT_FLASH
	bool "Rear LEd and Front LED both USING"
	depends on MSMB_CAMERA
	---help---
		ONLY for Front FLASH Model using.
		Front LED for LM3632 or KTD2692 Rear LED SM5703.

config EEPROM_CAMERA_QUP_I2C
	bool "Read EEPROM data in camera module"
config MSM_FD
	 tristate "Qualcomm MSM FD face detection engine support"
	 depends on MSMB_CAMERA
	default n
	 ---help---
		If the eeprom data in camera module is not read successfully,
		it causes actuator to move lens to 0x00 position, which causes actuator noise.
	    Enables support for the MSM FD face detection engine.
+2 −1
Original line number Diff line number Diff line
@@ -6,9 +6,9 @@ ccflags-y += -Idrivers/media/platform/msm/camera_v2/pproc
ccflags-y += -Idrivers/media/platform/msm/camera_v2/msm_vb2
ccflags-y += -Idrivers/media/platform/msm/camera_v2/camera
ccflags-y += -Idrivers/media/platform/msm/camera_v2/jpeg_10
ccflags-y += -Idrivers/media/platform/msm/camera_v2/fd

obj-$(CONFIG_MSMB_CAMERA) += msm.o
obj-$(CONFIG_MSMB_CAMERA) += cam_dummy.o
obj-$(CONFIG_MSMB_CAMERA) += camera/
obj-$(CONFIG_MSMB_CAMERA) += msm_vb2/
obj-$(CONFIG_MSMB_CAMERA) += sensor/
@@ -17,3 +17,4 @@ obj-$(CONFIG_MSMB_CAMERA) += isp/
obj-$(CONFIG_MSMB_CAMERA) += ispif/
obj-$(CONFIG_MSMB_JPEG) += jpeg_10/
obj-$(CONFIG_MSMB_CAMERA) += msm_buf_mgr/
obj-$(CONFIG_MSM_FD) += fd/
+0 −250
Original line number Diff line number Diff line
/* Copyright (c) 2013, 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
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */
#include <linux/of.h>
#include <linux/module.h>
#include <linux/workqueue.h>
#include <linux/delay.h>
#include <linux/types.h>
#include <linux/list.h>
#include <linux/ioctl.h>
#include <linux/spinlock.h>
#include <linux/proc_fs.h>
#include <linux/atomic.h>
#include <linux/wait.h>
#include <linux/videodev2.h>
#include <linux/msm_ion.h>
#include <linux/iommu.h>
#include <linux/platform_device.h>
#include <linux/of_device.h>
#include <media/v4l2-fh.h>
#include "msm.h"
#include "msm_vb2.h"
#include "msm_sd.h"

static struct v4l2_device *msm_v4l2_dev;
/* static struct msm_cam_dummy_queue cam_dummy_queue; */

#if defined CONFIG_SEC_CAMERA_TUNING
int rear_tune;
int front_tune;
#endif

static int msm_open_cam_dummy(struct file *fp)
{
	int rc;

	pr_err("%s: E\n", __func__);
	rc = msm_cam_get_module_init_status();
	pr_err("%s: X %d\n", __func__, rc);
	return rc;
}

#if !defined CONFIG_SEC_CAMERA_TUNING
static long msm_ioctl_cam_dummy(struct file *fp, unsigned int cmd,
	unsigned long arg)
{
	return 0;
}
#endif
static int msm_close_cam_dummy(struct file *f)
{
	return 0;
}

static struct v4l2_file_operations msm_fops_config = {
	.owner  = THIS_MODULE,
	.open  = msm_open_cam_dummy,
	.release = msm_close_cam_dummy,
#if defined CONFIG_SEC_CAMERA_TUNING
	.ioctl   = video_ioctl2,
#else
	.unlocked_ioctl = msm_ioctl_cam_dummy,
#endif
};

static const struct of_device_id cam_dummy_dt_match[] = {
	{.compatible = "qcom,cam_dummy",},
	{}
};

MODULE_DEVICE_TABLE(of, cam_dummy_dt_match);

static struct platform_driver cam_dummy_platform_driver = {
	.driver = {
		.name = "qcom,cam_dummy",
		.owner = THIS_MODULE,
		.of_match_table = cam_dummy_dt_match,
	},
};

#if defined CONFIG_SEC_CAMERA_TUNING
static int msm_v4l2_s_ctrl(struct file *filep, void *fh,
	struct v4l2_control *ctrl)
{
	int rc = 0;
	pr_err("%s TUNING CTRL : ctrl->value %d",__func__,ctrl->value);
	if(ctrl->id >= V4L2_CID_PRIVATE_BASE)
	{
		switch (ctrl->value){
		case NORMAL_MODE :
			rear_tune = 0;
			front_tune = 0;
			pr_err("%s TUNING CTRL : Setting Normal Binary",__func__);
			break;
		case REAR_TUNING :
			rear_tune = 1;
			pr_err("%s TUNING CTRL : Setting Rear Tuning Binary",__func__);
			break;
		case FRONT_TUNING :
			front_tune = 1;
			pr_err("%s TUNING CTRL : Setting Front Tuning Binary",__func__);
			break;
		case REAR_FRONT_TUNING :
			rear_tune = 1;
			front_tune = 1;
			pr_err("%s TUNING CTRL : Setting Rear and Front Tuning Binary",__func__);
			break;
		}
	}
	return rc;
}

static const struct v4l2_ioctl_ops msm_v4l2_ioctl_ops = {
	.vidioc_s_ctrl = msm_v4l2_s_ctrl,
};
#endif

static int32_t cam_dummy_platform_probe(struct platform_device *pdev)
{
	int32_t rc = 0;
	const struct of_device_id *match;
	struct msm_video_device *pvdev;

	/* init_waitqueue_head(&cam_dummy_queue.state_wait);*/
	pr_err("%s:%d\n", __func__, __LINE__);
	match = of_match_device(cam_dummy_dt_match, &pdev->dev);

	msm_v4l2_dev = kzalloc(sizeof(*msm_v4l2_dev),
		GFP_KERNEL);
	if (WARN_ON(!msm_v4l2_dev)) {
		rc = -ENOMEM;
		goto probe_end;
	}

	pvdev = kzalloc(sizeof(struct msm_video_device),
		GFP_KERNEL);
	if (WARN_ON(!pvdev)) {
		rc = -ENOMEM;
		goto pvdev_fail;
	}

	pvdev->vdev = video_device_alloc();
	if (WARN_ON(!pvdev->vdev)) {
		rc = -ENOMEM;
		goto video_fail;
	}

#if defined(CONFIG_MEDIA_CONTROLLER)
	msm_v4l2_dev->mdev = kzalloc(sizeof(struct media_device),
		GFP_KERNEL);
	if (!msm_v4l2_dev->mdev) {
		rc = -ENOMEM;
		goto mdev_fail;
	}
	strlcpy(msm_v4l2_dev->mdev->model, MSM_CAMERA_DUMMY_NAME,
			sizeof(msm_v4l2_dev->mdev->model));
	msm_v4l2_dev->mdev->dev = &(pdev->dev);

	rc = media_device_register(msm_v4l2_dev->mdev);
	if (WARN_ON(rc < 0))
		goto media_fail;

	if (WARN_ON((rc == media_entity_init(&pvdev->vdev->entity,
			0, NULL, 0)) < 0))
		goto entity_fail;

	pvdev->vdev->entity.type = MEDIA_ENT_T_DEVNODE_V4L;
	pvdev->vdev->entity.group_id = QCAMERA_VNODE_GROUP_ID;
#endif

	pvdev->vdev->v4l2_dev = msm_v4l2_dev;

	rc = v4l2_device_register(&(pdev->dev), pvdev->vdev->v4l2_dev);
	if (WARN_ON(rc < 0))
		goto register_fail;

	strlcpy(pvdev->vdev->name, "msm-camdummy", sizeof(pvdev->vdev->name));
	pvdev->vdev->release  = video_device_release;
	pvdev->vdev->fops     = &msm_fops_config;
#if defined CONFIG_SEC_CAMERA_TUNING
	pvdev->vdev->ioctl_ops = &msm_v4l2_ioctl_ops;
#endif
	pvdev->vdev->minor     = -1;
	pvdev->vdev->vfl_type  = VFL_TYPE_GRABBER;
	rc = video_register_device(pvdev->vdev,
		VFL_TYPE_GRABBER, -1);
	if (WARN_ON(rc < 0))
		goto v4l2_fail;

#if defined(CONFIG_MEDIA_CONTROLLER)
	/* FIXME: How to get rid of this messy? */
	pvdev->vdev->entity.name = video_device_node_name(pvdev->vdev);
#endif

	atomic_set(&pvdev->opened, 0);
	video_set_drvdata(pvdev->vdev, pvdev);

	goto probe_end;

v4l2_fail:
	v4l2_device_unregister(pvdev->vdev->v4l2_dev);
register_fail:
#if defined(CONFIG_MEDIA_CONTROLLER)
	media_entity_cleanup(&pvdev->vdev->entity);
entity_fail:
	media_device_unregister(msm_v4l2_dev->mdev);
media_fail:
	kzfree(msm_v4l2_dev->mdev);
mdev_fail:
#endif
	video_device_release(pvdev->vdev);
video_fail:
	kzfree(pvdev);
pvdev_fail:
	kzfree(msm_v4l2_dev);
probe_end:
	return rc;
}

static int __init cam_dummy_init_module(void)
{
	int32_t rc = 0;
	pr_err("%s:%d\n", __func__, __LINE__);
	rc = platform_driver_probe(&cam_dummy_platform_driver,
		cam_dummy_platform_probe);
	pr_err("%s:%d rc = %d\n", __func__, __LINE__, rc);
	return rc;
}

static void __exit cam_dummy_exit_module(void)
{
	pr_info("%s:%d\n", __func__, __LINE__);
	platform_driver_unregister(&cam_dummy_platform_driver);
	return;
}

module_init(cam_dummy_init_module);
module_exit(cam_dummy_exit_module);
MODULE_DESCRIPTION("cam_dummy");
MODULE_LICENSE("GPL v2");
Loading