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

Commit 35226273 authored by Jigarkumar Zala's avatar Jigarkumar Zala Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: Add support for camera PMIC based flash led



Add support for PMIC based Flash LED for camera.
This driver change includes handling different Packet/Cmd_buf
operations, Dual and Single Flash/Torch LED operations,
interactions with LED framework, interactions with CRM module.

CRs-Fixed: 2056624
Change-Id: I146065ebab51dc3e1813d6e740438fe99d05a0b8
Signed-off-by: default avatarJigarkumar Zala <jzala@codeaurora.org>
parent 6e9910de
Loading
Loading
Loading
Loading
+126 −0
Original line number Diff line number Diff line
* Qualcomm Technologies, Inc. MSM FLASH

The MSM camera Flash driver provides the definitions for
enabling and disabling LED Torch/Flash by requesting it to
PMIC/I2C/GPIO based hardware. It provides the functions for
the Client to control the Flash hardware.

=======================================================
Required Node Structure
=======================================================
The Flash device is described in one level of the device node.

======================================
First Level Node - CAM FLASH device
======================================
- compatible
  Usage: required
  Value type: <string>
  Definition: Should be "qcom,camera-flash".

- cell-index
  Usage: required
  Value type: <u32>
  Definition: Should specify the hardware index id.

- reg
  Usage: required
  Value type: <u32>
  Definition: Register values.

- flash-source
  Usage: required
  Value type: <phandle>
  Definition: Should contain array of phandles to Flash source nodes.

- torch-source
  Usage: required
  Value type: <phandle>
  Definition: Should contain array of phandles to torch source nodes.

- switch-source
  Usage: Optional
  Value type: <phandle>
  Definition: Should contain phandle to switch source nodes.

- slave-id
  Usage: optional
  Value type: <u32>
  Definition: should contain i2c slave address, device id address
		      and expected id read value.

- cci-master
  Usage: optional
  Value type: <u32>
  Definition: should contain i2c master id to be used for this camera
              flash.

- max-current
  Usage: optional
  Value type: <u32>
  Definition: Max current in mA supported by flash

- max-duration
  Usage: optional
  Value type: <u32>
  Definition: Max duration in ms flash can glow.

- gpios
  Usage: optional
  Value type: <u32>
  Definition: should specify the gpios to be used for the flash.

- gpio-req-tbl-num
  Usage: optional
  Value type: <u32>
  Definition: should specify the gpio table index.

- gpio-req-tbl-flags
  Usage: optional
  Value type: <u32>
  Definition: should specify the gpio functions.

- gpio-req-tbl-label
  Usage: optional
  Value type: <u32>
  Definition: should specify the gpio labels.

- gpio-flash-reset
  Usage: optional
  Value type: <u32>
  Definition: should contain index to gpio used by flash's "flash reset" pin.

- gpio-flash-en
  Usage: optional
  Value type: <u32>
  Definition: should contain index to gpio used by flash's "flash enable" pin.

- gpio-flash-now
  Usage: optional
  Value type: <u32>
  Definition: should contain index to gpio used by flash's "flash now" pin.

Example:

led_flash_rear: qcom,camera-flash@0 {
		reg = <0x00 0x00>;
		cell-index = <0>;
		compatible = "qcom,camera-flash";
		flash-source = <&pmi8998_flash0 &pmi8998_flash1>;
		torch-source = <&pmi8998_torch0 &pmi8998_torch1>;
		switch-source = <&pmi8998_switch0>;
        qcom,slave-id = <0x00 0x00 0x0011>;
		qcom,cci-master = <0>;
		gpios = <&msmgpio 23 0>,
			<&msmgpio 24 0>;
			<&msmgpio 25 0>;
		qcom,gpio-flash-reset = <0>;
		qcom,gpio-flash-en = <0>;
		qcom,gpio-flash-now = <1>;
		qcom,gpio-req-tbl-num = <0 1>;
		qcom,gpio-req-tbl-flags = <0 0>;
		qcom,gpio-req-tbl-label = "FLASH_EN",
			"FLASH_NOW";
		qcom,max-current = <1500>;
		qcom,max-duration = <1200>;
	};
+11 −11
Original line number Diff line number Diff line
@@ -198,7 +198,7 @@ struct cam_req_mgr_sof_notify {
struct cam_req_mgr_error_notify {
	int32_t  link_hdl;
	int32_t  dev_hdl;
	int64_t req_id;
	uint64_t req_id;
	enum cam_req_mgr_device_error error;
};

@@ -212,7 +212,7 @@ struct cam_req_mgr_error_notify {
struct cam_req_mgr_add_request {
	int32_t  link_hdl;
	int32_t  dev_hdl;
	int64_t req_id;
	uint64_t req_id;
};


@@ -260,7 +260,7 @@ struct cam_req_mgr_core_dev_link_setup {
struct cam_req_mgr_apply_request {
	int32_t    link_hdl;
	int32_t    dev_hdl;
	int64_t    request_id;
	uint64_t   request_id;
	int32_t    report_if_bubble;
};

@@ -276,7 +276,7 @@ struct cam_req_mgr_flush_request {
	int32_t     link_hdl;
	int32_t     dev_hdl;
	uint32_t    type;
	int64_t     req_id;
	uint64_t    req_id;
};

/**
@@ -288,7 +288,7 @@ struct cam_req_mgr_flush_request {
struct cam_req_mgr_link_evt_data {
	int32_t  link_hdl;
	int32_t  dev_hdl;
	int64_t req_id;
	uint64_t req_id;

	enum cam_req_mgr_link_evt_type evt_type;
	union {
+1 −0
Original line number Diff line number Diff line
@@ -4,3 +4,4 @@ obj-$(CONFIG_SPECTRA_CAMERA) += cam_sensor_io/
obj-$(CONFIG_SPECTRA_CAMERA) += cam_csiphy/
obj-$(CONFIG_SPECTRA_CAMERA) += cam_actuator/
obj-$(CONFIG_SPECTRA_CAMERA) += cam_sensor/
obj-$(CONFIG_SPECTRA_CAMERA) += cam_flash/
+9 −0
Original line number Diff line number Diff line
ccflags-y += -Idrivers/media/platform/msm/camera/cam_utils
ccflags-y += -Idrivers/media/platform/msm/camera/cam_sync
ccflags-y += -Idrivers/media/platform/msm/camera/cam_sensor_module/cam_sensor_utils
ccflags-y += -Idrivers/media/platform/msm/camera/cam_sensor_module/cam_sensor_io
ccflags-y += -Idrivers/media/platform/msm/camera/cam_sensor_module/cam_cci
ccflags-y += -Idrivers/media/platform/msm/camera/cam_req_mgr
ccflags-y += -Idrivers/media/platform/msm/camera/cam_smmu/

obj-$(CONFIG_SPECTRA_CAMERA) += cam_flash_dev.o cam_flash_core.o cam_flash_soc.o
+744 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading