From c69ede622c6798227da30aca989bf1f18da58be4 Mon Sep 17 00:00:00 2001 From: Karthik Jayakumar Date: Mon, 2 Nov 2020 19:20:09 -0800 Subject: [PATCH] msm: camera: common: Migrate dt-bindings to techpack To support external module compilation on Waipio, camera dt-bindings header files need to be moved out of kernel SI and into the camera-kernel vendor SI. This is to maintain seperation between the two SI's. CRs-Fixed: 2835738 Change-Id: I8d63b48b6d406ed7b4a07f3bd4f1721ecd2dd0b0 Signed-off-by: Karthik Jayakumar --- Kbuild | 10 +- Makefile | 4 +- drivers/cam_cpas/cam_cpas_hw.h | 3 +- drivers/cam_cpas/cam_cpas_intf.c | 4 +- drivers/cam_cpas/cam_cpas_soc.c | 2 + drivers/cam_cpas/cpas_top/cam_cpastop_hw.c | 9 ++ .../isp_hw/ife_csid_hw/cam_ife_csid_common.c | 3 +- .../isp_hw/ife_csid_hw/cam_ife_csid_hw_ver1.c | 2 +- .../isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c | 4 +- .../cam_csiphy/cam_csiphy_core.c | 2 +- dt-bindings/msm-camera.h | 93 +++++++++++++++++++ 11 files changed, 123 insertions(+), 13 deletions(-) create mode 100644 dt-bindings/msm-camera.h diff --git a/Kbuild b/Kbuild index ccbfd20508..9816302b82 100644 --- a/Kbuild +++ b/Kbuild @@ -41,11 +41,11 @@ cam_include_dirs := $(shell dirname `find $(CAMERA_KERNEL_ROOT) -name '*.h'` | u USERINCLUDE += \ -I$(CAMERA_KERNEL_ROOT)/include/uapi/ # Include Kernel headers -LINUXINCLUDE += \ - -I$(KERNEL_ROOT) \ - $(addprefix -I,$(cam_include_dirs)) \ - -I$(CAMERA_KERNEL_ROOT)/include/uapi/camera - +LINUXINCLUDE += \ + -I$(KERNEL_ROOT) \ + $(addprefix -I,$(cam_include_dirs)) \ + -I$(CAMERA_KERNEL_ROOT)/include/uapi/camera \ + -I$(CAMERA_KERNEL_ROOT)/ # Optional include directories ccflags-$(CONFIG_MSM_GLOBAL_SYNX) += -I$(KERNEL_ROOT)/drivers/media/platform/msm/synx diff --git a/Makefile b/Makefile index b9a7b4f0ba..1b53edbfa2 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,9 @@ KBUILD_OPTIONS += CAMERA_KERNEL_ROOT=$(shell pwd) KBUILD_OPTIONS += KERNEL_ROOT=$(ROOT_DIR)/$(KERNEL_DIR) KBUILD_OPTIONS += MODNAME=camera -modules: +all: modules + +modules dtbs: $(MAKE) -C $(KERNEL_SRC) M=$(M) modules $(KBUILD_OPTIONS) modules_install: diff --git a/drivers/cam_cpas/cam_cpas_hw.h b/drivers/cam_cpas/cam_cpas_hw.h index 1c25d0f562..14030d1786 100644 --- a/drivers/cam_cpas/cam_cpas_hw.h +++ b/drivers/cam_cpas/cam_cpas_hw.h @@ -6,7 +6,8 @@ #ifndef _CAM_CPAS_HW_H_ #define _CAM_CPAS_HW_H_ -#include +#include + #include "cam_cpas_api.h" #include "cam_cpas_hw_intf.h" #include "cam_common_util.h" diff --git a/drivers/cam_cpas/cam_cpas_intf.c b/drivers/cam_cpas/cam_cpas_intf.c index 1ff8f92fdd..b09156a1e2 100644 --- a/drivers/cam_cpas/cam_cpas_intf.c +++ b/drivers/cam_cpas/cam_cpas_intf.c @@ -7,12 +7,14 @@ #include #include #include + #include #include #include #include #include -#include + +#include #include "cam_subdev.h" #include "cam_cpas_hw_intf.h" diff --git a/drivers/cam_cpas/cam_cpas_soc.c b/drivers/cam_cpas/cam_cpas_soc.c index fefc6dcde1..22f088e6b1 100644 --- a/drivers/cam_cpas/cam_cpas_soc.c +++ b/drivers/cam_cpas/cam_cpas_soc.c @@ -10,6 +10,8 @@ #include #include +#include + #include "cam_cpas_api.h" #include "cam_cpas_hw_intf.h" #include "cam_cpas_hw.h" diff --git a/drivers/cam_cpas/cpas_top/cam_cpastop_hw.c b/drivers/cam_cpas/cpas_top/cam_cpastop_hw.c index 67faa34432..d8cb87978f 100644 --- a/drivers/cam_cpas/cpas_top/cam_cpastop_hw.c +++ b/drivers/cam_cpas/cpas_top/cam_cpastop_hw.c @@ -131,6 +131,15 @@ static const uint32_t cam_cpas_hw_version_map 0, CAM_CPAS_TITAN_570_V200, }, + /* for camera_680 */ + { + CAM_CPAS_TITAN_680_V100, + 0, + 0, + 0, + 0, + 0, + }, /* for camera_165 */ { CAM_CPAS_TITAN_165_V100, diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_common.c b/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_common.c index fec03b0c35..ac9aa8d64f 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_common.c +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_common.c @@ -9,7 +9,8 @@ #include #include -#include +#include + #include "cam_soc_util.h" #include "cam_io_util.h" #include "cam_debug_util.h" diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver1.c b/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver1.c index 072cb99404..888e58b965 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver1.c +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver1.c @@ -9,7 +9,7 @@ #include #include -#include +#include #include "cam_ife_csid_common.h" #include "cam_ife_csid_hw_ver1.h" diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c b/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c index 60bdcc721e..a490cc3327 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c @@ -9,7 +9,7 @@ #include #include -#include +#include #include "cam_ife_csid_common.h" #include "cam_ife_csid_hw_ver2.h" @@ -3964,7 +3964,7 @@ static int cam_ife_csid_hw_init_irq( return rc; } -int cam_ife_csid_hw_ver2_init(struct cam_hw_intf *hw_intf, +int cam_ife_csid_hw_ver2_init(struct cam_hw_intf *hw_intf, struct cam_ife_csid_core_info *core_info, bool is_custom) { diff --git a/drivers/cam_sensor_module/cam_csiphy/cam_csiphy_core.c b/drivers/cam_sensor_module/cam_csiphy/cam_csiphy_core.c index 6eda179659..a0d5983a8e 100644 --- a/drivers/cam_sensor_module/cam_csiphy/cam_csiphy_core.c +++ b/drivers/cam_sensor_module/cam_csiphy/cam_csiphy_core.c @@ -5,7 +5,7 @@ #include -#include +#include #include "cam_compat.h" #include "cam_csiphy_core.h" diff --git a/dt-bindings/msm-camera.h b/dt-bindings/msm-camera.h new file mode 100644 index 0000000000..e40d7d7fa6 --- /dev/null +++ b/dt-bindings/msm-camera.h @@ -0,0 +1,93 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. + */ + +#ifndef __MSM_CAMERA_H +#define __MSM_CAMERA_H + +/* CPAS path data types */ +#define CAM_CPAS_PATH_DATA_IFE_START_OFFSET 0 +#define CAM_CPAS_PATH_DATA_IFE_LINEAR (CAM_CPAS_PATH_DATA_IFE_START_OFFSET + 0) +#define CAM_CPAS_PATH_DATA_IFE_VID (CAM_CPAS_PATH_DATA_IFE_START_OFFSET + 1) +#define CAM_CPAS_PATH_DATA_IFE_DISP (CAM_CPAS_PATH_DATA_IFE_START_OFFSET + 2) +#define CAM_CPAS_PATH_DATA_IFE_STATS (CAM_CPAS_PATH_DATA_IFE_START_OFFSET + 3) +#define CAM_CPAS_PATH_DATA_IFE_RDI0 (CAM_CPAS_PATH_DATA_IFE_START_OFFSET + 4) +#define CAM_CPAS_PATH_DATA_IFE_RDI1 (CAM_CPAS_PATH_DATA_IFE_START_OFFSET + 5) +#define CAM_CPAS_PATH_DATA_IFE_RDI2 (CAM_CPAS_PATH_DATA_IFE_START_OFFSET + 6) +#define CAM_CPAS_PATH_DATA_IFE_RDI3 (CAM_CPAS_PATH_DATA_IFE_START_OFFSET + 7) +#define CAM_CPAS_PATH_DATA_IFE_PDAF (CAM_CPAS_PATH_DATA_IFE_START_OFFSET + 8) +#define CAM_CPAS_PATH_DATA_IFE_PIXEL_RAW \ + (CAM_CPAS_PATH_DATA_IFE_START_OFFSET + 9) +#define CAM_CPAS_PATH_DATA_IFE_MAX_OFFSET \ + (CAM_CPAS_PATH_DATA_IFE_START_OFFSET + 31) + +#define CAM_CPAS_PATH_DATA_IPE_START_OFFSET 32 +#define CAM_CPAS_PATH_DATA_IPE_RD_IN (CAM_CPAS_PATH_DATA_IPE_START_OFFSET + 0) +#define CAM_CPAS_PATH_DATA_IPE_RD_REF (CAM_CPAS_PATH_DATA_IPE_START_OFFSET + 1) +#define CAM_CPAS_PATH_DATA_IPE_WR_VID (CAM_CPAS_PATH_DATA_IPE_START_OFFSET + 2) +#define CAM_CPAS_PATH_DATA_IPE_WR_DISP (CAM_CPAS_PATH_DATA_IPE_START_OFFSET + 3) +#define CAM_CPAS_PATH_DATA_IPE_WR_REF (CAM_CPAS_PATH_DATA_IPE_START_OFFSET + 4) +#define CAM_CPAS_PATH_DATA_IPE_MAX_OFFSET \ + (CAM_CPAS_PATH_DATA_IPE_START_OFFSET + 31) + +#define CAM_CPAS_PATH_DATA_OPE_START_OFFSET 64 +#define CAM_CPAS_PATH_DATA_OPE_RD_IN (CAM_CPAS_PATH_DATA_OPE_START_OFFSET + 0) +#define CAM_CPAS_PATH_DATA_OPE_RD_REF (CAM_CPAS_PATH_DATA_OPE_START_OFFSET + 1) +#define CAM_CPAS_PATH_DATA_OPE_WR_VID (CAM_CPAS_PATH_DATA_OPE_START_OFFSET + 2) +#define CAM_CPAS_PATH_DATA_OPE_WR_DISP (CAM_CPAS_PATH_DATA_OPE_START_OFFSET + 3) +#define CAM_CPAS_PATH_DATA_OPE_WR_REF (CAM_CPAS_PATH_DATA_OPE_START_OFFSET + 4) +#define CAM_CPAS_PATH_DATA_OPE_MAX_OFFSET \ + (CAM_CPAS_PATH_DATA_OPE_START_OFFSET + 31) + +#define CAM_CPAS_PATH_DATA_SFE_START_OFFSET 96 +#define CAM_CPAS_PATH_DATA_SFE_NRDI (CAM_CPAS_PATH_DATA_SFE_START_OFFSET + 0) +#define CAM_CPAS_PATH_DATA_SFE_RDI0 (CAM_CPAS_PATH_DATA_SFE_START_OFFSET + 1) +#define CAM_CPAS_PATH_DATA_SFE_RDI1 (CAM_CPAS_PATH_DATA_SFE_START_OFFSET + 2) +#define CAM_CPAS_PATH_DATA_SFE_RDI2 (CAM_CPAS_PATH_DATA_SFE_START_OFFSET + 3) +#define CAM_CPAS_PATH_DATA_SFE_RDI3 (CAM_CPAS_PATH_DATA_SFE_START_OFFSET + 4) +#define CAM_CPAS_PATH_DATA_SFE_RDI4 (CAM_CPAS_PATH_DATA_SFE_START_OFFSET + 5) +#define CAM_CPAS_PATH_DATA_SFE_STATS (CAM_CPAS_PATH_DATA_SFE_START_OFFSET + 6) +#define CAM_CPAS_PATH_DATA_SFE_MAX_OFFSET \ + (CAM_CPAS_PATH_DATA_SFE_START_OFFSET + 31) + +#define CAM_CPAS_PATH_DATA_CONSO_OFFSET 256 +#define CAM_CPAS_PATH_DATA_ALL (CAM_CPAS_PATH_DATA_CONSO_OFFSET + 0) + +/* IFE consolidated paths */ +#define CAM_CPAS_PATH_DATA_IFE_LINEAR_PDAF (CAM_CPAS_PATH_DATA_CONSO_OFFSET + 1) +#define CAM_CPAS_PATH_DATA_IFE_UBWC_STATS (CAM_CPAS_PATH_DATA_CONSO_OFFSET + 2) +#define CAM_CPAS_PATH_DATA_IFE_PIXEL_ALL (CAM_CPAS_PATH_DATA_CONSO_OFFSET + 3) +#define CAM_CPAS_PATH_DATA_IFE_RDI_PIXEL_RAW \ + (CAM_CPAS_PATH_DATA_CONSO_OFFSET + 4) +#define CAM_CPAS_PATH_DATA_IFE_RDI_ALL (CAM_CPAS_PATH_DATA_CONSO_OFFSET + 5) +#define CAM_CPAS_PATH_DATA_IFE_UBWC (CAM_CPAS_PATH_DATA_CONSO_OFFSET + 6) +#define CAM_CPAS_PATH_DATA_IFE_LINEAR_STATS \ + (CAM_CPAS_PATH_DATA_CONSO_OFFSET + 7) + +/* IPE Consolidated paths */ +#define CAM_CPAS_PATH_DATA_IPE_WR_VID_DISP (CAM_CPAS_PATH_DATA_CONSO_OFFSET + 1) + +/* CPAS transaction types */ +#define CAM_CPAS_TRANSACTION_READ 0 +#define CAM_CPAS_TRANSACTION_WRITE 1 + +/* CPAS traffic merge types */ +#define CAM_CPAS_TRAFFIC_MERGE_SUM 0 +#define CAM_CPAS_TRAFFIC_MERGE_SUM_INTERLEAVE 1 + +/* Feature bit type */ +#define CAM_CPAS_FEATURE_TYPE_DISABLE 0 +#define CAM_CPAS_FEATURE_TYPE_ENABLE 1 +#define CAM_CPAS_FEATURE_TYPE_VALUE 2 + +/* Feature support bit positions in feature fuse register*/ +#define CAM_CPAS_QCFA_BINNING_ENABLE 0 +#define CAM_CPAS_SECURE_CAMERA_ENABLE 1 +#define CAM_CPAS_MF_HDR_ENABLE 2 +#define CAM_CPAS_MP_LIMIT_FUSE 3 +#define CAM_CPAS_ISP_FUSE 4 +#define CAM_CPAS_ISP_PIX_FUSE 5 +#define CAM_CPAS_FUSE_FEATURE_MAX 6 + +#endif