msm: camera: config: Fix lahaina configuration
Top-level Makefile doesn't export techpack configs. As such, we must revert to generating our own conf.h file instead of relying on autoconf.h. This has the side-effect of not allowing IS_REACHABLE/IS_ENABLED macro's from working on configs enabled within a techpack. CRs-Fixed: 2584631 Change-Id: I9c35b305b81c5a6a6892ca87ace9f69192fcca5b Signed-off-by: Karthik Jayakumar <kjayakum@codeaurora.org>
This commit is contained in:
5
Makefile
5
Makefile
@@ -32,6 +32,11 @@ LINUXINCLUDE += \
|
|||||||
-include $(srctree)/techpack/camera/config/bengalcameraconf.h
|
-include $(srctree)/techpack/camera/config/bengalcameraconf.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_ARCH_LAHAINA), y)
|
||||||
|
LINUXINCLUDE += \
|
||||||
|
-include $(srctree)/techpack/camera/config/lahainacameraconf.h
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq (,$(filter $(CONFIG_SPECTRA_CAMERA), y m))
|
ifneq (,$(filter $(CONFIG_SPECTRA_CAMERA), y m))
|
||||||
# Use USERINCLUDE when you must reference the UAPI directories only.
|
# Use USERINCLUDE when you must reference the UAPI directories only.
|
||||||
USERINCLUDE += \
|
USERINCLUDE += \
|
||||||
|
11
config/lahainacameraconf.h
Normal file
11
config/lahainacameraconf.h
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2019, The Linux Foundation. All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#define CONFIG_SPECTRA_CAMERA 1
|
||||||
|
#define CONFIG_SPECTRA_ISP 1
|
||||||
|
#define CONFIG_SPECTRA_SENSOR 1
|
||||||
|
#define CONFIG_SPECTRA_ICP 1
|
||||||
|
#define CONFIG_SPECTRA_JPEG 1
|
@@ -46,7 +46,7 @@ camera-y := \
|
|||||||
cam_cdm/cam_cdm_virtual_core.o \
|
cam_cdm/cam_cdm_virtual_core.o \
|
||||||
cam_cdm/cam_cdm_hw_core.o
|
cam_cdm/cam_cdm_hw_core.o
|
||||||
|
|
||||||
ifdef CONFIG_QCOM_CX_IPEAK
|
ifneq (,$(filter $(CONFIG_QCOM_CX_IPEAK),y m))
|
||||||
camera-y += cam_utils/cam_cx_ipeak.o
|
camera-y += cam_utils/cam_cx_ipeak.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@@ -46,6 +46,8 @@
|
|||||||
#include "cam_custom_csid_dev.h"
|
#include "cam_custom_csid_dev.h"
|
||||||
#include "cam_custom_sub_mod_dev.h"
|
#include "cam_custom_sub_mod_dev.h"
|
||||||
|
|
||||||
|
#include "cam_debug_util.h"
|
||||||
|
|
||||||
struct camera_submodule_component {
|
struct camera_submodule_component {
|
||||||
int (*init)(void);
|
int (*init)(void);
|
||||||
void (*exit)(void);
|
void (*exit)(void);
|
||||||
@@ -67,7 +69,7 @@ static const struct camera_submodule_component camera_base[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static const struct camera_submodule_component camera_isp[] = {
|
static const struct camera_submodule_component camera_isp[] = {
|
||||||
#if IS_ENABLED(CONFIG_SPECTRA_ISP)
|
#ifdef CONFIG_SPECTRA_ISP
|
||||||
{&cam_ife_csid17x_init_module, &cam_ife_csid17x_exit_module},
|
{&cam_ife_csid17x_init_module, &cam_ife_csid17x_exit_module},
|
||||||
{&cam_ife_csid_lite_init_module, &cam_ife_csid_lite_exit_module},
|
{&cam_ife_csid_lite_init_module, &cam_ife_csid_lite_exit_module},
|
||||||
{&cam_vfe_init_module, &cam_vfe_exit_module},
|
{&cam_vfe_init_module, &cam_vfe_exit_module},
|
||||||
@@ -76,7 +78,7 @@ static const struct camera_submodule_component camera_isp[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static const struct camera_submodule_component camera_sensor[] = {
|
static const struct camera_submodule_component camera_sensor[] = {
|
||||||
#if IS_ENABLED(CONFIG_SPECTRA_SENSOR)
|
#ifdef CONFIG_SPECTRA_SENSOR
|
||||||
{&cam_res_mgr_init, &cam_res_mgr_exit},
|
{&cam_res_mgr_init, &cam_res_mgr_exit},
|
||||||
{&cam_cci_init_module, &cam_cci_exit_module},
|
{&cam_cci_init_module, &cam_cci_exit_module},
|
||||||
{&cam_csiphy_init_module, &cam_csiphy_exit_module},
|
{&cam_csiphy_init_module, &cam_csiphy_exit_module},
|
||||||
@@ -91,7 +93,7 @@ static const struct camera_submodule_component camera_sensor[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static const struct camera_submodule_component camera_icp[] = {
|
static const struct camera_submodule_component camera_icp[] = {
|
||||||
#if IS_ENABLED(CONFIG_SPECTRA_ICP)
|
#ifdef CONFIG_SPECTRA_ICP
|
||||||
{&cam_a5_init_module, &cam_a5_exit_module},
|
{&cam_a5_init_module, &cam_a5_exit_module},
|
||||||
{&cam_ipe_init_module, &cam_ipe_exit_module},
|
{&cam_ipe_init_module, &cam_ipe_exit_module},
|
||||||
{&cam_bps_init_module, &cam_bps_exit_module},
|
{&cam_bps_init_module, &cam_bps_exit_module},
|
||||||
@@ -100,7 +102,7 @@ static const struct camera_submodule_component camera_icp[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static const struct camera_submodule_component camera_jpeg[] = {
|
static const struct camera_submodule_component camera_jpeg[] = {
|
||||||
#if IS_ENABLED(CONFIG_SPECTRA_JPEG)
|
#ifdef CONFIG_SPECTRA_JPEG
|
||||||
{&cam_jpeg_enc_init_module, &cam_jpeg_enc_exit_module},
|
{&cam_jpeg_enc_init_module, &cam_jpeg_enc_exit_module},
|
||||||
{&cam_jpeg_dma_init_module, &cam_jpeg_dma_exit_module},
|
{&cam_jpeg_dma_init_module, &cam_jpeg_dma_exit_module},
|
||||||
{&cam_jpeg_dev_init_module, &cam_jpeg_dev_exit_module},
|
{&cam_jpeg_dev_init_module, &cam_jpeg_dev_exit_module},
|
||||||
@@ -108,21 +110,21 @@ static const struct camera_submodule_component camera_jpeg[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static const struct camera_submodule_component camera_fd[] = {
|
static const struct camera_submodule_component camera_fd[] = {
|
||||||
#if IS_ENABLED(CONFIG_SPECTRA_FD)
|
#ifdef CONFIG_SPECTRA_FD
|
||||||
{&cam_fd_hw_init_module, &cam_fd_hw_exit_module},
|
{&cam_fd_hw_init_module, &cam_fd_hw_exit_module},
|
||||||
{&cam_fd_dev_init_module, &cam_fd_dev_exit_module},
|
{&cam_fd_dev_init_module, &cam_fd_dev_exit_module},
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct camera_submodule_component camera_lrme[] = {
|
static const struct camera_submodule_component camera_lrme[] = {
|
||||||
#if IS_ENABLED(CONFIG_SPECTRA_LRME)
|
#ifdef CONFIG_SPECTRA_LRME
|
||||||
{&cam_lrme_hw_init_module, &cam_lrme_hw_exit_module},
|
{&cam_lrme_hw_init_module, &cam_lrme_hw_exit_module},
|
||||||
{&cam_lrme_dev_init_module, &cam_lrme_dev_exit_module},
|
{&cam_lrme_dev_init_module, &cam_lrme_dev_exit_module},
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct camera_submodule_component camera_custom[] = {
|
static const struct camera_submodule_component camera_custom[] = {
|
||||||
#if IS_ENABLED(CONFIG_SPECTRA_CUSTOM)
|
#ifdef CONFIG_SPECTRA_CUSTOM
|
||||||
{&cam_custom_hw_sub_module_init, &cam_custom_hw_sub_module_exit},
|
{&cam_custom_hw_sub_module_init, &cam_custom_hw_sub_module_exit},
|
||||||
{&cam_custom_csid_driver_init, &cam_custom_csid_driver_exit},
|
{&cam_custom_csid_driver_init, &cam_custom_csid_driver_exit},
|
||||||
{&cam_custom_dev_init_module, &cam_custom_dev_exit_module},
|
{&cam_custom_dev_init_module, &cam_custom_dev_exit_module},
|
||||||
@@ -188,16 +190,16 @@ static int camera_verify_submodules(void)
|
|||||||
submodule_table[i].component[j].init,
|
submodule_table[i].component[j].init,
|
||||||
submodule_table[i].component[j].exit);
|
submodule_table[i].component[j].exit);
|
||||||
rc = -EINVAL;
|
rc = -EINVAL;
|
||||||
goto err;
|
goto end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err:
|
end:
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void camera_error_exit(int i, int j)
|
static void __camera_exit(int i, int j)
|
||||||
{
|
{
|
||||||
uint num_exits;
|
uint num_exits;
|
||||||
|
|
||||||
@@ -225,6 +227,8 @@ static int camera_init(void)
|
|||||||
/* For Probing all available submodules */
|
/* For Probing all available submodules */
|
||||||
for (i = 0; i < ARRAY_SIZE(submodule_table); i++) {
|
for (i = 0; i < ARRAY_SIZE(submodule_table); i++) {
|
||||||
num_inits = submodule_table[i].num_component;
|
num_inits = submodule_table[i].num_component;
|
||||||
|
CAM_DBG(CAM_UTIL, "Number of %s components: %u",
|
||||||
|
submodule_table[i].name, num_inits);
|
||||||
for (j = 0; j < num_inits; j++) {
|
for (j = 0; j < num_inits; j++) {
|
||||||
rc = submodule_table[i].component[j].init();
|
rc = submodule_table[i].component[j].init();
|
||||||
if (rc) {
|
if (rc) {
|
||||||
@@ -233,13 +237,13 @@ static int camera_init(void)
|
|||||||
submodule_table[i].name,
|
submodule_table[i].name,
|
||||||
submodule_table[i].component[j].init,
|
submodule_table[i].component[j].init,
|
||||||
rc);
|
rc);
|
||||||
camera_error_exit(i, j);
|
__camera_exit(i, j);
|
||||||
goto end_init;
|
goto end_init;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CAM_INFO(CAM_UTIL, "Camera driver initialized");
|
CAM_INFO(CAM_UTIL, "Spectra camera driver initialized!");
|
||||||
|
|
||||||
end_init:
|
end_init:
|
||||||
return rc;
|
return rc;
|
||||||
@@ -247,19 +251,13 @@ end_init:
|
|||||||
|
|
||||||
static void camera_exit(void)
|
static void camera_exit(void)
|
||||||
{
|
{
|
||||||
uint i, j, num_exits;
|
__camera_exit(ARRAY_SIZE(submodule_table), 0);
|
||||||
|
|
||||||
for (i = ARRAY_SIZE(submodule_table) - 1; i >= 0; i--) {
|
CAM_INFO(CAM_UTIL, "Spectra camera driver exited!");
|
||||||
num_exits = submodule_table[i].num_component;
|
|
||||||
for (j = num_exits - 1; j >= 0; j--)
|
|
||||||
submodule_table[i].component[j].exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
CAM_INFO(CAM_UTIL, "Camera driver exited!");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module_init(camera_init);
|
module_init(camera_init);
|
||||||
module_exit(camera_exit);
|
module_exit(camera_exit);
|
||||||
|
|
||||||
MODULE_DESCRIPTION("Spectra_Camera Driver");
|
MODULE_DESCRIPTION("Spectra camera driver");
|
||||||
MODULE_LICENSE("GPL v2");
|
MODULE_LICENSE("GPL v2");
|
||||||
|
Reference in New Issue
Block a user