一、查看硬件闪光灯pin脚
二、修改相关pin脚功能
\linux\kernel\arch\arm\mach-xgold\include\mach\xgold_pinctrl\pcl_hal_cfg_xmm6321a2_es2_rk_tablet_sdk_v1.1.h
/* PCL_PAD_DIF_D7 (52) */
{ 64, // GPIO_064
{ { PCL_HW_GPIO, PCL_ENABLE | PCL_NO_PUPD | PCL_PUSH_PULL | PCL_DRV_CLASS_E | PCL_RESET_ALL |PCL_GPIO | PCL_GPIO_OUT | PCL_GPIO_D1, },
{ PCL_HW_GPIO, PCL_ENABLE | PCL_NO_PUPD | PCL_PUSH_PULL | PCL_DRV_CLASS_E | PCL_RESET_ALL |PCL_GPIO | PCL_GPIO_OUT | PCL_GPIO_D0, },
{ PCL_HW_GPIO, PCL_ENABLE | PCL_PU | PCL_PUSH_PULL | PCL_DRV_CLASS_E | PCL_RESET_ALL |PCL_GPIO | PCL_GPIO_IN | PCL_GPIO_D0, }, }, },
三、控制该pin脚
linux\kernel\arch\arm\plat-xgold\dev-lcd-bl-tablet.c
int xgold_set_flash(int intensity)
{
int ret;
unsigned long pcl_state;
pr_err("%s Enter intensity=%d\n", __func__,intensity);
intensity ? (pcl_state = pcl_deactivate) : (pcl_state = pcl_activate);
ret = pin_config_set("xmm6310-pinctrl", "PCL_PAD_DIF_D7",
pcl_state);
pr_debug("%s Exit\n", __func__);
return 0;
}
EXPORT_SYMBOL_GPL(xgold_set_flash);
说明:
1.如果闪两下觉得不妥,可以修改
linux\kernel\drivers\media\video\xgold\xgold-v4l2.c
int update_mi_mp(struct xgold_v4l2_device *xgold_v4l2)
{
struct xgold_hardware *xgold_hw = &xgold_v4l2->xgold_hw;
struct marvinconfig *marvin_config = &xgold_hw->marvin_config;
int ret = 0;
if (marvin_config->jpeg_config.enable) {
/* in case of jpeg encoding, we don't have to disable the
MI, because the encoding
anyway has to be started explicitely */
if (!marvin_config->jpeg_config.busy) {
if ((xgold_hw->mp_dma_add ==
marvin_config->mi_config.mp.y_base)
&& (xgold_hw->mp_dma_add !=
marvin_config->mi_config.null_buff_dma_addr)) {
#ifdef CONFIG_CAMERA_FLASH_SUPPORT
//if (xgold_hw->xgold_flash_enable == FLASH_ON)
//xgold_set_flash(1);//去掉此句,
#endif
2.闪光灯延迟时间调整
Y:\work\bak-xmm6321\kitkat\hardware\intel\libcamera_native\Camera.h
#define CAMERA_PRE_SHOT_FLASH_US (1000 * 1000)