* [PATCH 0/2] media: Exynos GScaller: add support for Exynos 5433 SoC
[not found] <CGME20161109142950eucas1p27459d022bf3945618deb1b77fe6c4611@eucas1p2.samsung.com>
@ 2016-11-09 14:29 ` Marek Szyprowski
[not found] ` <CGME20161109142950eucas1p28aeab32587655ee249c1eefefcbb408d@eucas1p2.samsung.com>
[not found] ` <CGME20161109142951eucas1p25ea07a6d0ba507b26df345f3888b4539@eucas1p2.samsung.com>
0 siblings, 2 replies; 7+ messages in thread
From: Marek Szyprowski @ 2016-11-09 14:29 UTC (permalink / raw)
To: linux-media, linux-samsung-soc
Cc: Marek Szyprowski, Sylwester Nawrocki, Krzysztof Kozlowski,
Bartlomiej Zolnierkiewicz, Javier Martinez Canillas
Hi!
This patchset add support for Exynos 5433 SoC to Exynos GScaller driver.
This patchset requires fixes for Exynos GScaller driver posted
in the "[PATCH 00/12] media: Exynos GScaller driver fixes" thread.
Tested on Exynos5433-based TM2 board.
Best regards
Marek Szyprowski
Samsung R&D Institute Poland
Patch summary:
Marek Szyprowski (2):
exynos-gsc: Enable driver on ARCH_EXYNOS
exynos-gsc: Add support for Exynos5433 specific version
.../devicetree/bindings/media/exynos5-gsc.txt | 3 +-
drivers/media/platform/Kconfig | 2 +-
drivers/media/platform/exynos-gsc/gsc-core.c | 74 ++++++++++++++++------
drivers/media/platform/exynos-gsc/gsc-core.h | 6 +-
4 files changed, 63 insertions(+), 22 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] exynos-gsc: Enable driver on ARCH_EXYNOS
[not found] ` <CGME20161109142950eucas1p28aeab32587655ee249c1eefefcbb408d@eucas1p2.samsung.com>
@ 2016-11-09 14:29 ` Marek Szyprowski
2016-11-09 17:49 ` Javier Martinez Canillas
2016-11-09 20:06 ` Krzysztof Kozlowski
0 siblings, 2 replies; 7+ messages in thread
From: Marek Szyprowski @ 2016-11-09 14:29 UTC (permalink / raw)
To: linux-media, linux-samsung-soc
Cc: Marek Szyprowski, Sylwester Nawrocki, Krzysztof Kozlowski,
Bartlomiej Zolnierkiewicz, Javier Martinez Canillas
This driver can be also used on Exynos5433, which is ARM64-based
platform, which selects only ARCH_EXYNOS symbol.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
drivers/media/platform/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index 754edbf1..90ae790 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -266,7 +266,7 @@ config VIDEO_MX2_EMMAPRP
config VIDEO_SAMSUNG_EXYNOS_GSC
tristate "Samsung Exynos G-Scaler driver"
depends on VIDEO_DEV && VIDEO_V4L2
- depends on ARCH_EXYNOS5 || COMPILE_TEST
+ depends on ARCH_EXYNOS || COMPILE_TEST
depends on HAS_DMA
select VIDEOBUF2_DMA_CONTIG
select V4L2_MEM2MEM_DEV
--
1.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] exynos-gsc: Add support for Exynos5433 specific version
[not found] ` <CGME20161109142951eucas1p25ea07a6d0ba507b26df345f3888b4539@eucas1p2.samsung.com>
@ 2016-11-09 14:29 ` Marek Szyprowski
2016-11-09 17:55 ` Javier Martinez Canillas
2016-11-09 20:07 ` Krzysztof Kozlowski
0 siblings, 2 replies; 7+ messages in thread
From: Marek Szyprowski @ 2016-11-09 14:29 UTC (permalink / raw)
To: linux-media, linux-samsung-soc
Cc: Marek Szyprowski, Sylwester Nawrocki, Krzysztof Kozlowski,
Bartlomiej Zolnierkiewicz, Javier Martinez Canillas
This patch add support for Exynos5433 specific version of GScaller module.
The main difference is between Exynos 5433 and earlier is addition of
new clocks that have to be controlled.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
.../devicetree/bindings/media/exynos5-gsc.txt | 3 +-
drivers/media/platform/exynos-gsc/gsc-core.c | 74 ++++++++++++++++------
drivers/media/platform/exynos-gsc/gsc-core.h | 6 +-
3 files changed, 62 insertions(+), 21 deletions(-)
diff --git a/Documentation/devicetree/bindings/media/exynos5-gsc.txt b/Documentation/devicetree/bindings/media/exynos5-gsc.txt
index 5fe9372..26ca25b 100644
--- a/Documentation/devicetree/bindings/media/exynos5-gsc.txt
+++ b/Documentation/devicetree/bindings/media/exynos5-gsc.txt
@@ -3,7 +3,8 @@
G-Scaler is used for scaling and color space conversion on EXYNOS5 SoCs.
Required properties:
-- compatible: should be "samsung,exynos5-gsc"
+- compatible: should be "samsung,exynos5-gsc" (for Exynos 5250, 5420 and
+ 5422 SoCs) or "samsung,exynos5433-gsc" (Exynos 5433)
- reg: should contain G-Scaler physical address location and length.
- interrupts: should contain G-Scaler interrupt number
diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c
index 664398c..827c1bb 100644
--- a/drivers/media/platform/exynos-gsc/gsc-core.c
+++ b/drivers/media/platform/exynos-gsc/gsc-core.c
@@ -29,8 +29,6 @@
#include "gsc-core.h"
-#define GSC_CLOCK_GATE_NAME "gscl"
-
static const struct gsc_fmt gsc_formats[] = {
{
.name = "RGB565",
@@ -965,6 +963,19 @@ static irqreturn_t gsc_irq_handler(int irq, void *priv)
[3] = &gsc_v_100_variant,
},
.num_entities = 4,
+ .clk_names = { "gscl" },
+ .num_clocks = 1,
+};
+
+static struct gsc_driverdata gsc_5433_drvdata = {
+ .variant = {
+ [0] = &gsc_v_100_variant,
+ [1] = &gsc_v_100_variant,
+ [2] = &gsc_v_100_variant,
+ },
+ .num_entities = 3,
+ .clk_names = { "pclk", "aclk", "aclk_xiu", "aclk_gsclbend" },
+ .num_clocks = 4,
};
static const struct of_device_id exynos_gsc_match[] = {
@@ -972,6 +983,10 @@ static irqreturn_t gsc_irq_handler(int irq, void *priv)
.compatible = "samsung,exynos5-gsc",
.data = &gsc_v_100_drvdata,
},
+ {
+ .compatible = "samsung,exynos5433-gsc",
+ .data = &gsc_5433_drvdata,
+ },
{},
};
MODULE_DEVICE_TABLE(of, exynos_gsc_match);
@@ -983,6 +998,7 @@ static int gsc_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
const struct gsc_driverdata *drv_data = of_device_get_match_data(dev);
int ret;
+ int i;
gsc = devm_kzalloc(dev, sizeof(struct gsc_dev), GFP_KERNEL);
if (!gsc)
@@ -998,6 +1014,7 @@ static int gsc_probe(struct platform_device *pdev)
return -EINVAL;
}
+ gsc->num_clocks = drv_data->num_clocks;
gsc->variant = drv_data->variant[gsc->id];
gsc->pdev = pdev;
@@ -1016,18 +1033,24 @@ static int gsc_probe(struct platform_device *pdev)
return -ENXIO;
}
- gsc->clock = devm_clk_get(dev, GSC_CLOCK_GATE_NAME);
- if (IS_ERR(gsc->clock)) {
- dev_err(dev, "failed to get clock~~~: %s\n",
- GSC_CLOCK_GATE_NAME);
- return PTR_ERR(gsc->clock);
+ for (i = 0; i < gsc->num_clocks; i++) {
+ gsc->clock[i] = devm_clk_get(dev, drv_data->clk_names[i]);
+ if (IS_ERR(gsc->clock[i])) {
+ dev_err(dev, "failed to get clock: %s\n",
+ drv_data->clk_names[i]);
+ return PTR_ERR(gsc->clock[i]);
+ }
}
- ret = clk_prepare_enable(gsc->clock);
- if (ret) {
- dev_err(&gsc->pdev->dev, "clock prepare failed for clock: %s\n",
- GSC_CLOCK_GATE_NAME);
- return ret;
+ for (i = 0; i < gsc->num_clocks; i++) {
+ ret = clk_prepare_enable(gsc->clock[i]);
+ if (ret) {
+ dev_err(dev, "clock prepare failed for clock: %s\n",
+ drv_data->clk_names[i]);
+ while (--i >= 0)
+ clk_disable_unprepare(gsc->clock[i]);
+ return ret;
+ }
}
ret = devm_request_irq(dev, res->start, gsc_irq_handler,
@@ -1062,13 +1085,15 @@ static int gsc_probe(struct platform_device *pdev)
err_v4l2:
v4l2_device_unregister(&gsc->v4l2_dev);
err_clk:
- clk_disable_unprepare(gsc->clock);
+ for (i = gsc->num_clocks - 1; i >= 0; i--)
+ clk_disable_unprepare(gsc->clock[i]);
return ret;
}
static int gsc_remove(struct platform_device *pdev)
{
struct gsc_dev *gsc = platform_get_drvdata(pdev);
+ int i;
pm_runtime_get_sync(&pdev->dev);
@@ -1076,7 +1101,8 @@ static int gsc_remove(struct platform_device *pdev)
v4l2_device_unregister(&gsc->v4l2_dev);
vb2_dma_contig_clear_max_seg_size(&pdev->dev);
- clk_disable_unprepare(gsc->clock);
+ for (i = 0; i < gsc->num_clocks; i++)
+ clk_disable_unprepare(gsc->clock[i]);
pm_runtime_put_noidle(&pdev->dev);
@@ -1126,12 +1152,18 @@ static int gsc_runtime_resume(struct device *dev)
{
struct gsc_dev *gsc = dev_get_drvdata(dev);
int ret = 0;
+ int i;
pr_debug("gsc%d: state: 0x%lx\n", gsc->id, gsc->state);
- ret = clk_prepare_enable(gsc->clock);
- if (ret)
- return ret;
+ for (i = 0; i < gsc->num_clocks; i++) {
+ ret = clk_prepare_enable(gsc->clock[i]);
+ if (ret) {
+ while (--i >= 0)
+ clk_disable_unprepare(gsc->clock[i]);
+ return ret;
+ }
+ }
gsc_hw_set_sw_reset(gsc);
gsc_wait_reset(gsc);
@@ -1144,10 +1176,14 @@ static int gsc_runtime_suspend(struct device *dev)
{
struct gsc_dev *gsc = dev_get_drvdata(dev);
int ret = 0;
+ int i;
ret = gsc_m2m_suspend(gsc);
- if (!ret)
- clk_disable_unprepare(gsc->clock);
+ if (ret)
+ return ret;
+
+ for (i = gsc->num_clocks - 1; i >= 0; i--)
+ clk_disable_unprepare(gsc->clock[i]);
pr_debug("gsc%d: state: 0x%lx\n", gsc->id, gsc->state);
return ret;
diff --git a/drivers/media/platform/exynos-gsc/gsc-core.h b/drivers/media/platform/exynos-gsc/gsc-core.h
index e5aa8f4..696217e 100644
--- a/drivers/media/platform/exynos-gsc/gsc-core.h
+++ b/drivers/media/platform/exynos-gsc/gsc-core.h
@@ -33,6 +33,7 @@
#define GSC_SHUTDOWN_TIMEOUT ((100*HZ)/1000)
#define GSC_MAX_DEVS 4
+#define GSC_MAX_CLOCKS 4
#define GSC_M2M_BUF_NUM 0
#define GSC_MAX_CTRL_NUM 10
#define GSC_SC_ALIGN_4 4
@@ -307,6 +308,8 @@ struct gsc_variant {
*/
struct gsc_driverdata {
struct gsc_variant *variant[GSC_MAX_DEVS];
+ const char *clk_names[GSC_MAX_CLOCKS];
+ int num_clocks;
int num_entities;
};
@@ -330,7 +333,8 @@ struct gsc_dev {
struct platform_device *pdev;
struct gsc_variant *variant;
u16 id;
- struct clk *clock;
+ int num_clocks;
+ struct clk *clock[GSC_MAX_CLOCKS];
void __iomem *regs;
wait_queue_head_t irq_queue;
struct gsc_m2m_device m2m;
--
1.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] exynos-gsc: Enable driver on ARCH_EXYNOS
2016-11-09 14:29 ` [PATCH 1/2] exynos-gsc: Enable driver on ARCH_EXYNOS Marek Szyprowski
@ 2016-11-09 17:49 ` Javier Martinez Canillas
2016-11-09 20:06 ` Krzysztof Kozlowski
1 sibling, 0 replies; 7+ messages in thread
From: Javier Martinez Canillas @ 2016-11-09 17:49 UTC (permalink / raw)
To: Marek Szyprowski, linux-media, linux-samsung-soc
Cc: Sylwester Nawrocki, Krzysztof Kozlowski,
Bartlomiej Zolnierkiewicz
Hello Marek,
On 11/09/2016 11:29 AM, Marek Szyprowski wrote:
> This driver can be also used on Exynos5433, which is ARM64-based
> platform, which selects only ARCH_EXYNOS symbol.
>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
> drivers/media/platform/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
> index 754edbf1..90ae790 100644
> --- a/drivers/media/platform/Kconfig
> +++ b/drivers/media/platform/Kconfig
> @@ -266,7 +266,7 @@ config VIDEO_MX2_EMMAPRP
> config VIDEO_SAMSUNG_EXYNOS_GSC
> tristate "Samsung Exynos G-Scaler driver"
> depends on VIDEO_DEV && VIDEO_V4L2
> - depends on ARCH_EXYNOS5 || COMPILE_TEST
> + depends on ARCH_EXYNOS || COMPILE_TEST
> depends on HAS_DMA
> select VIDEOBUF2_DMA_CONTIG
> select V4L2_MEM2MEM_DEV
>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
Best regards,
--
Javier Martinez Canillas
Open Source Group
Samsung Research America
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] exynos-gsc: Add support for Exynos5433 specific version
2016-11-09 14:29 ` [PATCH 2/2] exynos-gsc: Add support for Exynos5433 specific version Marek Szyprowski
@ 2016-11-09 17:55 ` Javier Martinez Canillas
2016-11-09 20:07 ` Krzysztof Kozlowski
1 sibling, 0 replies; 7+ messages in thread
From: Javier Martinez Canillas @ 2016-11-09 17:55 UTC (permalink / raw)
To: Marek Szyprowski, linux-media, linux-samsung-soc
Cc: Sylwester Nawrocki, Krzysztof Kozlowski,
Bartlomiej Zolnierkiewicz
Hello Marek,
On 11/09/2016 11:29 AM, Marek Szyprowski wrote:
> This patch add support for Exynos5433 specific version of GScaller module.
s/GScaller/GScaler
> The main difference is between Exynos 5433 and earlier is addition of
> new clocks that have to be controlled.
>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
> .../devicetree/bindings/media/exynos5-gsc.txt | 3 +-
> drivers/media/platform/exynos-gsc/gsc-core.c | 74 ++++++++++++++++------
> drivers/media/platform/exynos-gsc/gsc-core.h | 6 +-
> 3 files changed, 62 insertions(+), 21 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/media/exynos5-gsc.txt b/Documentation/devicetree/bindings/media/exynos5-gsc.txt
Usually the DT changes go in a separate patch as documented in
Documentation/devicetree/bindings/submitting-patches.txt.
But I guess this is a too small change so is OK to squash it?
> index 5fe9372..26ca25b 100644
> --- a/Documentation/devicetree/bindings/media/exynos5-gsc.txt
> +++ b/Documentation/devicetree/bindings/media/exynos5-gsc.txt
> @@ -3,7 +3,8 @@
> G-Scaler is used for scaling and color space conversion on EXYNOS5 SoCs.
>
> Required properties:
> -- compatible: should be "samsung,exynos5-gsc"
> +- compatible: should be "samsung,exynos5-gsc" (for Exynos 5250, 5420 and
> + 5422 SoCs) or "samsung,exynos5433-gsc" (Exynos 5433)
I would also add 5800 to the list.
Besides these minor comments, the patch looks good to me:
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
And I've also tested in an Exynos5800 Peach Pi Chromebook:
Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
Best regards,
--
Javier Martinez Canillas
Open Source Group
Samsung Research America
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] exynos-gsc: Enable driver on ARCH_EXYNOS
2016-11-09 14:29 ` [PATCH 1/2] exynos-gsc: Enable driver on ARCH_EXYNOS Marek Szyprowski
2016-11-09 17:49 ` Javier Martinez Canillas
@ 2016-11-09 20:06 ` Krzysztof Kozlowski
1 sibling, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2016-11-09 20:06 UTC (permalink / raw)
To: Marek Szyprowski
Cc: linux-media, linux-samsung-soc, Sylwester Nawrocki,
Krzysztof Kozlowski, Bartlomiej Zolnierkiewicz,
Javier Martinez Canillas
On Wed, Nov 09, 2016 at 03:29:37PM +0100, Marek Szyprowski wrote:
> This driver can be also used on Exynos5433, which is ARM64-based
> platform, which selects only ARCH_EXYNOS symbol.
>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
> drivers/media/platform/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] exynos-gsc: Add support for Exynos5433 specific version
2016-11-09 14:29 ` [PATCH 2/2] exynos-gsc: Add support for Exynos5433 specific version Marek Szyprowski
2016-11-09 17:55 ` Javier Martinez Canillas
@ 2016-11-09 20:07 ` Krzysztof Kozlowski
1 sibling, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2016-11-09 20:07 UTC (permalink / raw)
To: Marek Szyprowski
Cc: linux-media, linux-samsung-soc, Sylwester Nawrocki,
Krzysztof Kozlowski, Bartlomiej Zolnierkiewicz,
Javier Martinez Canillas
On Wed, Nov 09, 2016 at 03:29:38PM +0100, Marek Szyprowski wrote:
> This patch add support for Exynos5433 specific version of GScaller module.
> The main difference is between Exynos 5433 and earlier is addition of
> new clocks that have to be controlled.
>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
> .../devicetree/bindings/media/exynos5-gsc.txt | 3 +-
> drivers/media/platform/exynos-gsc/gsc-core.c | 74 ++++++++++++++++------
> drivers/media/platform/exynos-gsc/gsc-core.h | 6 +-
> 3 files changed, 62 insertions(+), 21 deletions(-)
>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-11-09 20:07 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20161109142950eucas1p27459d022bf3945618deb1b77fe6c4611@eucas1p2.samsung.com>
2016-11-09 14:29 ` [PATCH 0/2] media: Exynos GScaller: add support for Exynos 5433 SoC Marek Szyprowski
[not found] ` <CGME20161109142950eucas1p28aeab32587655ee249c1eefefcbb408d@eucas1p2.samsung.com>
2016-11-09 14:29 ` [PATCH 1/2] exynos-gsc: Enable driver on ARCH_EXYNOS Marek Szyprowski
2016-11-09 17:49 ` Javier Martinez Canillas
2016-11-09 20:06 ` Krzysztof Kozlowski
[not found] ` <CGME20161109142951eucas1p25ea07a6d0ba507b26df345f3888b4539@eucas1p2.samsung.com>
2016-11-09 14:29 ` [PATCH 2/2] exynos-gsc: Add support for Exynos5433 specific version Marek Szyprowski
2016-11-09 17:55 ` Javier Martinez Canillas
2016-11-09 20:07 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).