Commit b3d8b559 authored by Sylwester Nawrocki's avatar Sylwester Nawrocki Committed by Mauro Carvalho Chehab

[media] exynos4-is: Remove dependency on SYSCON for non-dt platforms

Currently the whole driver depends on MFD_SYSCON, which in turn
depends on OF. To allow to use the driver on non-dt platforms
(S5PV210) the SYSREG support is made conditional (it is needed
only for dt enabled platforms) and MFD_SYSCON is selected if
OF is enabled, instead of depending on OF.
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 474c890d
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
config VIDEO_SAMSUNG_EXYNOS4_IS config VIDEO_SAMSUNG_EXYNOS4_IS
bool "Samsung S5P/EXYNOS4 SoC series Camera Subsystem driver" bool "Samsung S5P/EXYNOS4 SoC series Camera Subsystem driver"
depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && PLAT_S5P && PM_RUNTIME depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && PLAT_S5P && PM_RUNTIME
depends on MFD_SYSCON
help help
Say Y here to enable camera host interface devices for Say Y here to enable camera host interface devices for
Samsung S5P and EXYNOS SoC series. Samsung S5P and EXYNOS SoC series.
...@@ -14,6 +13,7 @@ config VIDEO_S5P_FIMC ...@@ -14,6 +13,7 @@ config VIDEO_S5P_FIMC
depends on I2C depends on I2C
select VIDEOBUF2_DMA_CONTIG select VIDEOBUF2_DMA_CONTIG
select V4L2_MEM2MEM_DEV select V4L2_MEM2MEM_DEV
select MFD_SYSCON if OF
help help
This is a V4L2 driver for Samsung S5P and EXYNOS4 SoC camera host This is a V4L2 driver for Samsung S5P and EXYNOS4 SoC camera host
interface and video postprocessor (FIMC) devices. interface and video postprocessor (FIMC) devices.
......
...@@ -966,8 +966,7 @@ static int fimc_probe(struct platform_device *pdev) ...@@ -966,8 +966,7 @@ static int fimc_probe(struct platform_device *pdev)
spin_lock_init(&fimc->slock); spin_lock_init(&fimc->slock);
mutex_init(&fimc->lock); mutex_init(&fimc->lock);
fimc->sysreg = syscon_regmap_lookup_by_phandle(dev->of_node, fimc->sysreg = fimc_get_sysreg_regmap(dev->of_node);
"samsung,sysreg");
if (IS_ERR(fimc->sysreg)) if (IS_ERR(fimc->sysreg))
return PTR_ERR(fimc->sysreg); return PTR_ERR(fimc->sysreg);
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/mfd/syscon.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <linux/io.h> #include <linux/io.h>
...@@ -645,6 +646,15 @@ void fimc_unregister_m2m_device(struct fimc_dev *fimc); ...@@ -645,6 +646,15 @@ void fimc_unregister_m2m_device(struct fimc_dev *fimc);
int fimc_register_driver(void); int fimc_register_driver(void);
void fimc_unregister_driver(void); void fimc_unregister_driver(void);
#ifdef CONFIG_MFD_SYSCON
static inline struct regmap * fimc_get_sysreg_regmap(struct device_node *node)
{
return syscon_regmap_lookup_by_phandle(node, "samsung,sysreg");
}
#else
#define fimc_get_sysreg_regmap(node) (NULL)
#endif
/* -----------------------------------------------------*/ /* -----------------------------------------------------*/
/* fimc-m2m.c */ /* fimc-m2m.c */
void fimc_m2m_job_finish(struct fimc_ctx *ctx, int vb_state); void fimc_m2m_job_finish(struct fimc_ctx *ctx, int vb_state);
......
...@@ -805,6 +805,9 @@ int fimc_hw_camblk_cfg_writeback(struct fimc_dev *fimc) ...@@ -805,6 +805,9 @@ int fimc_hw_camblk_cfg_writeback(struct fimc_dev *fimc)
unsigned int mask, val, camblk_cfg; unsigned int mask, val, camblk_cfg;
int ret; int ret;
if (map == NULL)
return 0;
ret = regmap_read(map, SYSREG_CAMBLK, &camblk_cfg); ret = regmap_read(map, SYSREG_CAMBLK, &camblk_cfg);
if (ret < 0 || ((camblk_cfg & 0x00700000) >> 20 != 0x3)) if (ret < 0 || ((camblk_cfg & 0x00700000) >> 20 != 0x3))
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment