From 6c629fe42a5a3d628a244adbea55435be1eecbdb Mon Sep 17 00:00:00 2001 From: "dalong.zhang" Date: Mon, 5 Dec 2016 18:10:09 +0800 Subject: [PATCH] camera: rockchip: camsys driver v0.0x21.8 Change-Id: Ib0fed5df3edfe4dae042999e71c50d67a490f88e Signed-off-by: dalong.zhang --- drivers/media/video/rk_camsys/camsys_drv.c | 1 + drivers/media/video/rk_camsys/camsys_internal.h | 4 +++- .../rk_camsys/ext_flashled_drv/leds-rt8547.c | 17 ++++++++++------- .../ext_flashled_drv/rk_ext_fshled_ctl.c | 9 ++++++++- 4 files changed, 22 insertions(+), 9 deletions(-) mode change 100755 => 100644 drivers/media/video/rk_camsys/ext_flashled_drv/leds-rt8547.c mode change 100755 => 100644 drivers/media/video/rk_camsys/ext_flashled_drv/rk_ext_fshled_ctl.c diff --git a/drivers/media/video/rk_camsys/camsys_drv.c b/drivers/media/video/rk_camsys/camsys_drv.c index 679217b00cec..e0df6bf7b04f 100755 --- a/drivers/media/video/rk_camsys/camsys_drv.c +++ b/drivers/media/video/rk_camsys/camsys_drv.c @@ -1647,6 +1647,7 @@ static int camsys_platform_remove(struct platform_device *pdev) static const struct of_device_id cif_of_match[] = { { .compatible = "rockchip,isp" }, + { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, cif_of_match); diff --git a/drivers/media/video/rk_camsys/camsys_internal.h b/drivers/media/video/rk_camsys/camsys_internal.h index d766990b1505..4b73fddad5ca 100644 --- a/drivers/media/video/rk_camsys/camsys_internal.h +++ b/drivers/media/video/rk_camsys/camsys_internal.h @@ -144,8 +144,10 @@ 1) support drm iommu. *v0.0x21.7: * 1) remove memset function wrong called code. +*v0.0x21.8: +* 1) flash module exist risk, fix up it. */ -#define CAMSYS_DRIVER_VERSION KERNEL_VERSION(0, 0x21, 7) +#define CAMSYS_DRIVER_VERSION KERNEL_VERSION(0, 0x21, 8) #define CAMSYS_PLATFORM_DRV_NAME "RockChip-CamSys" #define CAMSYS_PLATFORM_MARVIN_NAME "Platform_MarvinDev" diff --git a/drivers/media/video/rk_camsys/ext_flashled_drv/leds-rt8547.c b/drivers/media/video/rk_camsys/ext_flashled_drv/leds-rt8547.c old mode 100755 new mode 100644 index 84d1618a70fd..770db3cad87d --- a/drivers/media/video/rk_camsys/ext_flashled_drv/leds-rt8547.c +++ b/drivers/media/video/rk_camsys/ext_flashled_drv/leds-rt8547.c @@ -36,6 +36,7 @@ struct rt8547_chip { spinlock_t io_lock; unsigned char suspend:1; int in_use_mode; + struct platform_device rt_fled_pdev; #ifdef CONFIG_DEBUG_FS struct flashlight_device *fled_dev; unsigned char reg_addr; @@ -776,10 +777,9 @@ static void rt8547_reg_init(struct rt8547_chip *chip) rt8547_reg_initval[RT8547_FLED_REG3 - 1]); } -static struct platform_device rt_fled_pdev = { - .name = "rt-flash-led", - .id = -1, -}; +static void rt8547_release(struct device *dev) +{ +} static int rt8547_led_probe(struct platform_device *pdev) { @@ -818,8 +818,11 @@ static int rt8547_led_probe(struct platform_device *pdev) chip->base.hal = &rt8547_fled_hal; chip->base.init_props = &rt8547_fled_props; - rt_fled_pdev.dev.parent = &pdev->dev; - ret = platform_device_register(&rt_fled_pdev); + chip->rt_fled_pdev.dev.parent = &pdev->dev; + chip->rt_fled_pdev.dev.release = rt8547_release; + chip->rt_fled_pdev.name = "rt-flash-led"; + chip->rt_fled_pdev.id = -1; + ret = platform_device_register(&chip->rt_fled_pdev); if (ret < 0) { dev_err(&pdev->dev, "register rtfled fail\n"); goto err_io; @@ -844,7 +847,7 @@ static int rt8547_led_remove(struct platform_device *pdev) #ifdef CONFIG_DEBUG_FS rt8547_remove_debugfs(); #endif /* #ifdef CONFIG_DEBUG_FS */ - platform_device_unregister(&rt_fled_pdev); + platform_device_unregister(&chip->rt_fled_pdev); rt8547_io_deinit(chip->pdata); return 0; } diff --git a/drivers/media/video/rk_camsys/ext_flashled_drv/rk_ext_fshled_ctl.c b/drivers/media/video/rk_camsys/ext_flashled_drv/rk_ext_fshled_ctl.c old mode 100755 new mode 100644 index 1f1cb0663fee..c7fef6e008f1 --- a/drivers/media/video/rk_camsys/ext_flashled_drv/rk_ext_fshled_ctl.c +++ b/drivers/media/video/rk_camsys/ext_flashled_drv/rk_ext_fshled_ctl.c @@ -42,6 +42,11 @@ int camsys_deinit_ext_fsh_module() INIT_LIST_HEAD(&g_ext_fsh_devs.dev_list); return 0; } + +static void camsys_ext_fsh_release(struct device *dev) +{ +} + void* camsys_register_ext_fsh_dev(camsys_flash_info_t *fsh_info) { ext_fsh_info_t* new_dev = NULL; @@ -53,7 +58,7 @@ void* camsys_register_ext_fsh_dev(camsys_flash_info_t *fsh_info) goto fail0; } - new_rt_dev = kzalloc(sizeof(ext_fsh_info_t),GFP_KERNEL); + new_rt_dev = kzalloc(sizeof(*new_rt_dev), GFP_KERNEL); if(!new_rt_dev){ camsys_err("register new ext flash dev erro !"); goto fail1; @@ -61,6 +66,7 @@ void* camsys_register_ext_fsh_dev(camsys_flash_info_t *fsh_info) new_dev->pdev.id = -1; new_dev->pdev.name = fsh_info->fl_drv_name; + new_dev->pdev.dev.release = camsys_ext_fsh_release; new_dev->pdev.dev.platform_data = (void*)new_rt_dev; new_dev->dev_model = "rt-flash-led"; @@ -107,6 +113,7 @@ int camsys_deregister_ext_fsh_dev(void* dev) /* free after unregister device ?*/ kfree(cur_fsh_info->pdev.dev.platform_data); kfree(cur_fsh_info); + return 0; } } } -- 2.34.1