From patchwork Wed Apr 3 09:55:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 2385931 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 6DBA2DFB79 for ; Wed, 3 Apr 2013 09:56:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763384Ab3DCJ42 (ORCPT ); Wed, 3 Apr 2013 05:56:28 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:32285 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1763353Ab3DCJ41 (ORCPT ); Wed, 3 Apr 2013 05:56:27 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MKO005TWBM1PT90@mailout2.samsung.com> for linux-media@vger.kernel.org; Wed, 03 Apr 2013 18:56:26 +0900 (KST) X-AuditID: cbfee61a-b7fa86d0000045ae-4c-515bfcca58b8 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 1F.32.17838.ACCFB515; Wed, 03 Apr 2013 18:56:26 +0900 (KST) Received: from amdc1344.digital.local ([106.116.147.32]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MKO00AXXBL7KB50@mmp2.samsung.com>; Wed, 03 Apr 2013 18:56:26 +0900 (KST) From: Sylwester Nawrocki To: linux-media@vger.kernel.org Cc: kyungmin.park@samsung.com, t.figa@samsung.com, Sylwester Nawrocki Subject: [PATCH v2] exynos4-is: Remove dependency on SYSCON for non-dt platforms Date: Wed, 03 Apr 2013 11:55:53 +0200 Message-id: <1364982953-21324-1-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNJMWRmVeSWpSXmKPExsVy+t9jQd1Tf6IDDXrWClicbXrDbtGzYSur xeE37awW62e8ZnFg8ejbsorR4/MmuQCmKC6blNSczLLUIn27BK6M49e72QomylU8P72CqYHx pmQXIyeHhICJxIOOt6wQtpjEhXvr2boYuTiEBKYzSqxd/xfK6WCSuNC/ixmkik3AUKL3aB8j iC0iIC/xpPcGG4jNLJAgseLSOyYQW1ggQOL05mVA9RwcLAKqEo97o0FMXgE3iYYpCiCmhICC xJxJNhMYuRcwMqxiFE0tSC4oTkrPNdQrTswtLs1L10vOz93ECPbyM6kdjCsbLA4xCnAwKvHw nvgSFSjEmlhWXJl7iFGCg1lJhJfzeHSgEG9KYmVValF+fFFpTmrxIUZpDhYlcd4DrdaBQgLp iSWp2ampBalFMFkmDk6pBkYx27nXq+rfZfrYxv32rws7Y5Q/fW16ywbRaR1vJvkcqvBUFRNm eTevif1BmPKEC823NtXkBYbG2amv2XIz8GbMbYt5+RXTgtuzWOO/MK433y/30+lya8qq0wVX cw3vaZW05v4/uHzX8jgL1UquPbPEH+5ee+dr0L2XcztW2tneL5jL++uF+QolluKMREMt5qLi RACpezwG7gEAAA== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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: Sylwester Nawrocki Signed-off-by: Kyungmin Park --- Changes since v1: - select MFD_SYSCON if OF is enabled and use this symbol in the code, rather than creating a separate Kconfig option. --- drivers/media/platform/exynos4-is/Kconfig | 2 +- drivers/media/platform/exynos4-is/fimc-core.c | 3 +-- drivers/media/platform/exynos4-is/fimc-core.h | 10 ++++++++++ drivers/media/platform/exynos4-is/fimc-reg.c | 3 +++ 4 files changed, 15 insertions(+), 3 deletions(-) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/platform/exynos4-is/Kconfig b/drivers/media/platform/exynos4-is/Kconfig index 91dbd4b..ae57920 100644 --- a/drivers/media/platform/exynos4-is/Kconfig +++ b/drivers/media/platform/exynos4-is/Kconfig @@ -2,7 +2,6 @@ config VIDEO_SAMSUNG_EXYNOS4_IS bool "Samsung S5P/EXYNOS4 SoC series Camera Subsystem driver" depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && PLAT_S5P && PM_RUNTIME - depends on MFD_SYSCON help Say Y here to enable camera host interface devices for Samsung S5P and EXYNOS SoC series. @@ -14,6 +13,7 @@ config VIDEO_S5P_FIMC depends on I2C select VIDEOBUF2_DMA_CONTIG select V4L2_MEM2MEM_DEV + select MFD_SYSCON if OF help This is a V4L2 driver for Samsung S5P and EXYNOS4 SoC camera host interface and video postprocessor (FIMC) devices. diff --git a/drivers/media/platform/exynos4-is/fimc-core.c b/drivers/media/platform/exynos4-is/fimc-core.c index 44239e5..6b4a244 100644 --- a/drivers/media/platform/exynos4-is/fimc-core.c +++ b/drivers/media/platform/exynos4-is/fimc-core.c @@ -966,8 +966,7 @@ static int fimc_probe(struct platform_device *pdev) spin_lock_init(&fimc->slock); mutex_init(&fimc->lock); - fimc->sysreg = syscon_regmap_lookup_by_phandle(dev->of_node, - "samsung,sysreg"); + fimc->sysreg = fimc_get_sysreg_regmap(dev->of_node); if (IS_ERR(fimc->sysreg)) return PTR_ERR(fimc->sysreg); diff --git a/drivers/media/platform/exynos4-is/fimc-core.h b/drivers/media/platform/exynos4-is/fimc-core.h index 793333a..7d361b2 100644 --- a/drivers/media/platform/exynos4-is/fimc-core.h +++ b/drivers/media/platform/exynos4-is/fimc-core.h @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -645,6 +646,15 @@ void fimc_unregister_m2m_device(struct fimc_dev *fimc); int fimc_register_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 */ void fimc_m2m_job_finish(struct fimc_ctx *ctx, int vb_state); diff --git a/drivers/media/platform/exynos4-is/fimc-reg.c b/drivers/media/platform/exynos4-is/fimc-reg.c index c276eb8..c82e9bd 100644 --- a/drivers/media/platform/exynos4-is/fimc-reg.c +++ b/drivers/media/platform/exynos4-is/fimc-reg.c @@ -805,6 +805,9 @@ int fimc_hw_camblk_cfg_writeback(struct fimc_dev *fimc) unsigned int mask, val, camblk_cfg; int ret; + if (map == NULL) + return 0; + ret = regmap_read(map, SYSREG_CAMBLK, &camblk_cfg); if (ret < 0 || ((camblk_cfg & 0x00700000) >> 20 != 0x3)) return ret;