[PATCH 0/4] Exynos 5433 jpeg h/w codec support

2015-09-18 Thread Andrzej Pietrasiewicz
Support for Exynos 5433 to the s5p-jpeg driver.

The series also includes jpeg codec node definition for Device Tree,
but it depends on:

git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git
branch v4.3-drop/dt64-samsung which has not made it into 4.3,
but the driver is meant for 4.4.

Rebased onto Mauro's master with the branch mentioned above merged.

This patch series also adds Andrzej Pietrasiewicz and
Jacek Anaszewski as maintainers of drivers/media/platform/s5p-jpeg.

Andrzej is the original author of the driver, and has committed
support for three Exynos chip models and some fixes.
Jacek has committed support for another three and a number of fixes,
and is the second author of the driver.
The code size is now quite large compared to the initial release,
so having it maintained is a good idea and we both have the supported
hardware at hand.

Andrzej Pietrasiewicz (2):
  s5p-jpeg: add support for 5433
  MAINTAINERS: add exynos jpeg codec maintainers

Marek Szyprowski (2):
  s5p-jpeg: generalize clocks handling
  ARM64: dts: exynos5433: add jpeg node

 .../bindings/media/exynos-jpeg-codec.txt   |   3 +-
 MAINTAINERS|   8 +
 arch/arm64/boot/dts/exynos/exynos5433.dtsi |  21 +
 drivers/media/platform/s5p-jpeg/jpeg-core.c| 444 ++---
 drivers/media/platform/s5p-jpeg/jpeg-core.h|  41 +-
 drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c  |  80 +++-
 drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.h  |  11 +-
 drivers/media/platform/s5p-jpeg/jpeg-regs.h|  85 ++--
 8 files changed, 588 insertions(+), 105 deletions(-)

-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/4] s5p-jpeg: add support for 5433

2015-09-18 Thread Andrzej Pietrasiewicz
JPEG IP found in Exynos5433 is similar to what is in Exynos4, but
there are some subtle differences which this patch takes into account.

The most important difference is in what is processed by the JPEG IP and
what has to be provided to it. In case of 5433 the IP does not parse
Huffman and quantisation tables, so this has to be performed with the CPU
and the majority of the code in this patch does that.

A small but important difference is in what address is passed to the JPEG
IP. In case of 5433 it is the SOS (start of scan) position, which is
natural, because the headers must be parsed elsewhere.

There is also a difference in how the hardware is put to work in
device_run.

Data structures are extended as appropriate to accommodate the above
changes.

Signed-off-by: Andrzej Pietrasiewicz 
---
 .../bindings/media/exynos-jpeg-codec.txt   |   3 +-
 drivers/media/platform/s5p-jpeg/jpeg-core.c| 378 +++--
 drivers/media/platform/s5p-jpeg/jpeg-core.h|  31 ++
 drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c  |  80 -
 drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.h  |  11 +-
 drivers/media/platform/s5p-jpeg/jpeg-regs.h|  85 +++--
 6 files changed, 522 insertions(+), 66 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt 
b/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt
index 4ef4563..38941db 100644
--- a/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt
+++ b/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt
@@ -4,7 +4,8 @@ Required properties:
 
 - compatible   : should be one of:
  "samsung,s5pv210-jpeg", "samsung,exynos4210-jpeg",
- "samsung,exynos3250-jpeg", "samsung,exynos5420-jpeg";
+ "samsung,exynos3250-jpeg", "samsung,exynos5420-jpeg",
+ "samsung,exynos5433-jpeg";
 - reg  : address and length of the JPEG codec IP register set;
 - interrupts   : specifies the JPEG codec IP interrupt;
 - clock-names   : should contain:
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c 
b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index 03d0904..bc5505a 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -626,6 +626,7 @@ static int s5p_jpeg_to_user_subsampling(struct s5p_jpeg_ctx 
*ctx)
return V4L2_JPEG_CHROMA_SUBSAMPLING_411;
return exynos3250_decoded_subsampling[ctx->subsampling];
case SJPEG_EXYNOS4:
+   case SJPEG_EXYNOS5433:
if (ctx->subsampling > 2)
return V4L2_JPEG_CHROMA_SUBSAMPLING_420;
return exynos4x12_decoded_subsampling[ctx->subsampling];
@@ -750,6 +751,211 @@ static void exynos4_jpeg_set_huff_tbl(void __iomem *base)
ARRAY_SIZE(hactblg0));
 }
 
+static inline int __exynos4_huff_tbl(int class, int id, bool lenval)
+{
+   /*
+* class: 0 - DC, 1 - AC
+* id: 0 - Y, 1 - Cb/Cr
+*/
+   if (class) {
+   if (id)
+   return lenval ? EXYNOS4_HUFF_TBL_HACCL :
+   EXYNOS4_HUFF_TBL_HACCV;
+   return lenval ? EXYNOS4_HUFF_TBL_HACLL : EXYNOS4_HUFF_TBL_HACLV;
+
+   }
+   /* class == 0 */
+   if (id)
+   return lenval ? EXYNOS4_HUFF_TBL_HDCCL : EXYNOS4_HUFF_TBL_HDCCV;
+
+   return lenval ? EXYNOS4_HUFF_TBL_HDCLL : EXYNOS4_HUFF_TBL_HDCLV;
+}
+
+static inline int exynos4_huff_tbl_len(int class, int id)
+{
+   return __exynos4_huff_tbl(class, id, true);
+}
+
+static inline int exynos4_huff_tbl_val(int class, int id)
+{
+   return __exynos4_huff_tbl(class, id, false);
+}
+
+static int get_byte(struct s5p_jpeg_buffer *buf);
+static int get_word_be(struct s5p_jpeg_buffer *buf, unsigned int *word);
+static void skip(struct s5p_jpeg_buffer *buf, long len);
+
+static void exynos4_jpeg_parse_decode_h_tbl(struct s5p_jpeg_ctx *ctx)
+{
+   struct s5p_jpeg *jpeg = ctx->jpeg;
+   struct vb2_buffer *vb = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx);
+   struct s5p_jpeg_buffer jpeg_buffer;
+   unsigned int word;
+   int c, x, components;
+
+   jpeg_buffer.size = 2; /* Ls */
+   jpeg_buffer.data =
+   (unsigned long)vb2_plane_vaddr(vb, 0) + ctx->out_q.sos + 2;
+   jpeg_buffer.curr = 0;
+
+   word = 0;
+
+   if (get_word_be(&jpeg_buffer, &word))
+   return;
+   jpeg_buffer.size = (long)word - 2;
+   jpeg_buffer.data += 2;
+   jpeg_buffer.curr = 0;
+
+   components = get_byte(&jpeg_buffer);
+   if (components == -1)
+   return;
+   while (components--) {
+   c = get_byte(&jpeg_buffer);
+   if (c == -1)
+   retu

[PATCH 4/4] ARM64: dts: exynos5433: add jpeg node

2015-09-18 Thread Andrzej Pietrasiewicz
From: Marek Szyprowski 

Add Exynos 5433 jpeg h/w codec node.

Signed-off-by: Marek Szyprowski 
Signed-off-by: Andrzej Pietrasiewicz 
---
 arch/arm64/boot/dts/exynos/exynos5433.dtsi | 21 +
 1 file changed, 21 insertions(+)

diff --git a/arch/arm64/boot/dts/exynos/exynos5433.dtsi 
b/arch/arm64/boot/dts/exynos/exynos5433.dtsi
index 59e21b6..5cb489f 100644
--- a/arch/arm64/boot/dts/exynos/exynos5433.dtsi
+++ b/arch/arm64/boot/dts/exynos/exynos5433.dtsi
@@ -916,6 +916,27 @@
io-channel-ranges;
status = "disabled";
};
+   jpeg: jpeg@1502 {
+   compatible = "samsung,exynos5433-jpeg";
+   reg = <0x1502 0x1>;
+   interrupts = <0 411 0>;
+   clock-names = "pclk",
+ "aclk",
+ "aclk_xiu",
+ "sclk";
+   clocks = <&cmu_mscl CLK_PCLK_JPEG>,
+<&cmu_mscl CLK_ACLK_JPEG>,
+<&cmu_mscl CLK_ACLK_XIU_MSCLX>,
+<&cmu_mscl CLK_SCLK_JPEG>;
+   assigned-clocks = <&cmu_mscl 
CLK_MOUT_ACLK_MSCL_400_USER>,
+ <&cmu_mscl CLK_MOUT_SCLK_JPEG_USER>,
+ <&cmu_mscl CLK_MOUT_SCLK_JPEG>,
+ <&cmu_top CLK_MOUT_SCLK_JPEG_A>;
+   assigned-clock-parents = <&cmu_top CLK_ACLK_MSCL_400>,
+<&cmu_top CLK_SCLK_JPEG_MSCL>,
+<&cmu_mscl 
CLK_MOUT_SCLK_JPEG_USER>,
+<&cmu_top 
CLK_MOUT_BUS_PLL_USER>;
+   };
};
 
timer {
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/4] MAINTAINERS: add exynos jpeg codec maintainers

2015-09-18 Thread Andrzej Pietrasiewicz
Add Andrzej Pietrasiewicz and Jacek Anaszewski
as maintainers of drivers/media/platform/s5p-jpeg.

Signed-off-by: Andrzej Pietrasiewicz 
---
 MAINTAINERS | 8 
 1 file changed, 8 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 8133cef..ee9240b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1452,6 +1452,14 @@ L:   linux-me...@vger.kernel.org
 S: Maintained
 F: drivers/media/platform/s5p-tv/
 
+ARM/SAMSUNG S5P SERIES JPEG CODEC SUPPORT
+M: Andrzej Pietrasiewicz 
+M: Jacek Anaszewski 
+L: linux-arm-ker...@lists.infradead.org
+L: linux-me...@vger.kernel.org
+S: Maintained
+F: drivers/media/platform/s5p-jpeg/
+
 ARM/SHMOBILE ARM ARCHITECTURE
 M: Simon Horman 
 M: Magnus Damm 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/4] s5p-jpeg: generalize clocks handling

2015-09-18 Thread Andrzej Pietrasiewicz
From: Marek Szyprowski 

Allow jpeg codec variants declare clocks they need.
Before this patch is applied jpeg-core gets jpeg->sclk
"speculatively": if it is not there, we assume no problem.

This patch eliminates this by explicitly declaring
what clocks are needed for each variant.

This is a preparation for adding Exynos 5433 variant support, which
needs 4 clocks of names not compatible with any previous version of
jpeg hw module.

Signed-off-by: Marek Szyprowski 
[Rebase and commit message]
Signed-off-by: Andrzej Pietrasiewicz 
---
 drivers/media/platform/s5p-jpeg/jpeg-core.c | 66 ++---
 drivers/media/platform/s5p-jpeg/jpeg-core.h | 10 +++--
 2 files changed, 37 insertions(+), 39 deletions(-)

diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c 
b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index bfbf157..03d0904 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -2455,7 +2455,7 @@ static int s5p_jpeg_probe(struct platform_device *pdev)
 {
struct s5p_jpeg *jpeg;
struct resource *res;
-   int ret;
+   int i, ret;
 
/* JPEG IP abstraction struct */
jpeg = devm_kzalloc(&pdev->dev, sizeof(struct s5p_jpeg), GFP_KERNEL);
@@ -2490,23 +2490,21 @@ static int s5p_jpeg_probe(struct platform_device *pdev)
}
 
/* clocks */
-   jpeg->clk = clk_get(&pdev->dev, "jpeg");
-   if (IS_ERR(jpeg->clk)) {
-   dev_err(&pdev->dev, "cannot get clock\n");
-   ret = PTR_ERR(jpeg->clk);
-   return ret;
+   for (i = 0; i < jpeg->variant->num_clocks; i++) {
+   jpeg->clocks[i] = devm_clk_get(&pdev->dev,
+ jpeg->variant->clk_names[i]);
+   if (IS_ERR(jpeg->clocks[i])) {
+   dev_err(&pdev->dev, "failed to get clock: %s\n",
+   jpeg->variant->clk_names[i]);
+   return PTR_ERR(jpeg->clocks[i]);
+   }
}
-   dev_dbg(&pdev->dev, "clock source %p\n", jpeg->clk);
-
-   jpeg->sclk = clk_get(&pdev->dev, "sclk");
-   if (IS_ERR(jpeg->sclk))
-   dev_info(&pdev->dev, "sclk clock not available\n");
 
/* v4l2 device */
ret = v4l2_device_register(&pdev->dev, &jpeg->v4l2_dev);
if (ret) {
dev_err(&pdev->dev, "Failed to register v4l2 device\n");
-   goto clk_get_rollback;
+   return ret;
}
 
/* mem2mem device */
@@ -2607,17 +2605,13 @@ m2m_init_rollback:
 device_register_rollback:
v4l2_device_unregister(&jpeg->v4l2_dev);
 
-clk_get_rollback:
-   clk_put(jpeg->clk);
-   if (!IS_ERR(jpeg->sclk))
-   clk_put(jpeg->sclk);
-
return ret;
 }
 
 static int s5p_jpeg_remove(struct platform_device *pdev)
 {
struct s5p_jpeg *jpeg = platform_get_drvdata(pdev);
+   int i;
 
pm_runtime_disable(jpeg->dev);
 
@@ -2630,15 +2624,10 @@ static int s5p_jpeg_remove(struct platform_device *pdev)
v4l2_device_unregister(&jpeg->v4l2_dev);
 
if (!pm_runtime_status_suspended(&pdev->dev)) {
-   clk_disable_unprepare(jpeg->clk);
-   if (!IS_ERR(jpeg->sclk))
-   clk_disable_unprepare(jpeg->sclk);
+   for (i = jpeg->variant->num_clocks - 1; i >= 0; i--)
+   clk_disable_unprepare(jpeg->clocks[i]);
}
 
-   clk_put(jpeg->clk);
-   if (!IS_ERR(jpeg->sclk))
-   clk_put(jpeg->sclk);
-
return 0;
 }
 
@@ -2646,10 +2635,10 @@ static int s5p_jpeg_remove(struct platform_device *pdev)
 static int s5p_jpeg_runtime_suspend(struct device *dev)
 {
struct s5p_jpeg *jpeg = dev_get_drvdata(dev);
+   int i;
 
-   clk_disable_unprepare(jpeg->clk);
-   if (!IS_ERR(jpeg->sclk))
-   clk_disable_unprepare(jpeg->sclk);
+   for (i = jpeg->variant->num_clocks - 1; i >= 0; i--)
+   clk_disable_unprepare(jpeg->clocks[i]);
 
return 0;
 }
@@ -2658,16 +2647,15 @@ static int s5p_jpeg_runtime_resume(struct device *dev)
 {
struct s5p_jpeg *jpeg = dev_get_drvdata(dev);
unsigned long flags;
-   int ret;
+   int i, ret;
 
-   ret = clk_prepare_enable(jpeg->clk);
-   if (ret < 0)
-   return ret;
-
-   if (!IS_ERR(jpeg->sclk)) {
-   ret = clk_prepare_enable(jpeg->sclk);
-   if (ret < 0)
+   for (i = 0; i < jpeg->variant->num_clocks; i++) {
+   ret = clk_prepare_enable(jpeg->clocks[i]);
+   if (ret) {
+  

Re: [PATCH 4/4] ARM64: dts: exynos5433: add jpeg node

2015-09-21 Thread Andrzej Pietrasiewicz

Hi Hans,

W dniu 21.09.2015 o 11:50, Hans Verkuil pisze:

On 18-09-15 16:21, Andrzej Pietrasiewicz wrote:

From: Marek Szyprowski 

Add Exynos 5433 jpeg h/w codec node.

Signed-off-by: Marek Szyprowski 
Signed-off-by: Andrzej Pietrasiewicz 
---
  arch/arm64/boot/dts/exynos/exynos5433.dtsi | 21 +
  1 file changed, 21 insertions(+)

diff --git a/arch/arm64/boot/dts/exynos/exynos5433.dtsi 
b/arch/arm64/boot/dts/exynos/exynos5433.dtsi


This dtsi file doesn't exist in the media-git tree. What is the story here?

Should this go through a different subsystem?

I think the media subsystem can take patches 1-3 and whoever does DT patches can
take this patch, right?



The cover letter explains that the series is rebased onto Mauro's
master with Kukjin's branch merged. The latter does contain
the exynos5433.dtsi. That said, yes, taking patches 1-3 in
media subsystem and leaving DT patch to someone else is the
way to go.

Andrzej
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/4] ARM64: dts: exynos5433: add jpeg node

2015-09-21 Thread Andrzej Pietrasiewicz

Hi Mauro,

W dniu 21.09.2015 o 13:41, Mauro Carvalho Chehab pisze:





I think the media subsystem can take patches 1-3 and whoever does DT patches can
take this patch, right?



The cover letter explains that the series is rebased onto Mauro's
master with Kukjin's branch merged. The latter does contain
the exynos5433.dtsi. That said, yes, taking patches 1-3 in
media subsystem and leaving DT patch to someone else is the
way to go.


I'm ok with such strategy, provided that the new driver builds fine with
COMPILE_TEST without the need of the dtsi patch.



I've checked. It does compile with COMPILE_TEST.



Please also notice that, if the driver uses MC, it has to wait for
the MC next gen support to be merged,


No, it does not. It is a rather simple mem2mem device.

Sylwester has answered about camera support which is a different
topic.

Andrzej
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] ARM: dts: exynos5420: add nodes for jpeg codec

2015-03-05 Thread Andrzej Pietrasiewicz
Signed-off-by: Andrzej Pietrasiewicz 
---
 arch/arm/boot/dts/exynos5420.dtsi | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5420.dtsi 
b/arch/arm/boot/dts/exynos5420.dtsi
index 73c1851..c8722d9 100644
--- a/arch/arm/boot/dts/exynos5420.dtsi
+++ b/arch/arm/boot/dts/exynos5420.dtsi
@@ -775,6 +775,24 @@
iommus = <&sysmmu_gscl1>;
};
 
+   jpeg_0: jpeg@11F5 {
+   compatible = "samsung,exynos5420-jpeg";
+   reg = <0x11F5 0x1000>;
+   interrupts = <0 89 0>;
+   clock-names = "jpeg";
+   clocks = <&clock CLK_JPEG>;
+   iommus = <&sysmmu_jpeg>;
+   };
+
+   jpeg_1: jpeg@11F6 {
+   compatible = "samsung,exynos5420-jpeg";
+   reg = <0x11F6 0x1000>;
+   interrupts = <0 168 0>;
+   clock-names = "jpeg";
+   clocks = <&clock CLK_JPEG2>;
+   iommus = <&sysmmu_jpeg2>;
+   };
+
pmu_system_controller: system-controller@1004 {
compatible = "samsung,exynos5420-pmu", "syscon";
reg = <0x1004 0x5000>;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/2] Support for JPEG IP on Exynos542x

2015-03-05 Thread Andrzej Pietrasiewicz
This short series adds support for JPEG IP on Exynos542x SoC.
The first patch adds necessary device tree nodes and the second
one does JPEG IP support proper. The JPEG IP on Exynos542x is
similar to what is on Exynos3250, there just slight differences.

Andrzej Pietrasiewicz (2):
  ARM: dts: exynos5420: add nodes for jpeg codec
  media: s5p-jpeg: add 5420 family support

 .../bindings/media/exynos-jpeg-codec.txt   |  2 +-
 arch/arm/boot/dts/exynos5420.dtsi  | 18 ++
 drivers/media/platform/s5p-jpeg/jpeg-core.c| 69 +-
 drivers/media/platform/s5p-jpeg/jpeg-core.h|  1 +
 4 files changed, 74 insertions(+), 16 deletions(-)

-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] media: s5p-jpeg: add 5420 family support

2015-03-05 Thread Andrzej Pietrasiewicz
JPEG IP found in Exynos5420 is similar to what is in Exynos3250, but
there are some subtle differences which this patch takes into account.

Signed-off-by: Andrzej Pietrasiewicz 
---
 .../bindings/media/exynos-jpeg-codec.txt   |  2 +-
 drivers/media/platform/s5p-jpeg/jpeg-core.c| 69 +-
 drivers/media/platform/s5p-jpeg/jpeg-core.h|  1 +
 3 files changed, 56 insertions(+), 16 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt 
b/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt
index bf52ed4..4ef4563 100644
--- a/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt
+++ b/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt
@@ -4,7 +4,7 @@ Required properties:
 
 - compatible   : should be one of:
  "samsung,s5pv210-jpeg", "samsung,exynos4210-jpeg",
- "samsung,exynos3250-jpeg";
+ "samsung,exynos3250-jpeg", "samsung,exynos5420-jpeg";
 - reg  : address and length of the JPEG codec IP register set;
 - interrupts   : specifies the JPEG codec IP interrupt;
 - clock-names   : should contain:
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c 
b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index 12f7452..99bf5b3 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -621,6 +621,7 @@ static int s5p_jpeg_to_user_subsampling(struct s5p_jpeg_ctx 
*ctx)
return V4L2_JPEG_CHROMA_SUBSAMPLING_GRAY;
return ctx->subsampling;
case SJPEG_EXYNOS3250:
+   case SJPEG_EXYNOS5420:
if (ctx->subsampling > 3)
return V4L2_JPEG_CHROMA_SUBSAMPLING_411;
return exynos3250_decoded_subsampling[ctx->subsampling];
@@ -1128,6 +1129,18 @@ static struct s5p_jpeg_fmt *s5p_jpeg_find_format(struct 
s5p_jpeg_ctx *ctx,
return NULL;
 }
 
+static inline bool is_3250_compat(struct s5p_jpeg_ctx *ctx)
+{
+   switch (ctx->jpeg->variant->version) {
+   case SJPEG_EXYNOS3250:
+   case SJPEG_EXYNOS5420:
+   return true;
+   default:
+   return false;
+   }
+   return false;
+}
+
 static void jpeg_bound_align_image(struct s5p_jpeg_ctx *ctx,
   u32 *w, unsigned int wmin, unsigned int wmax,
   unsigned int walign,
@@ -1142,13 +1155,13 @@ static void jpeg_bound_align_image(struct s5p_jpeg_ctx 
*ctx,
w_step = 1 << walign;
h_step = 1 << halign;
 
-   if (ctx->jpeg->variant->version == SJPEG_EXYNOS3250) {
+   if (is_3250_compat(ctx)) {
/*
 * Rightmost and bottommost pixels are cropped by the
-* Exynos3250 JPEG IP for RGB formats, for the specific
-* width and height values respectively. This assignment
-* will result in v4l_bound_align_image returning dimensions
-* reduced by 1 for the aforementioned cases.
+* Exynos3250/compatible JPEG IP for RGB formats, for the
+* specific width and height values respectively. This
+* assignment will result in v4l_bound_align_image returning
+* dimensions reduced by 1 for the aforementioned cases.
 */
if (w_step == 4 && ((width & 3) == 1)) {
wmax = width;
@@ -1384,12 +1397,12 @@ static int s5p_jpeg_s_fmt(struct s5p_jpeg_ctx *ct, 
struct v4l2_format *f)
 
/*
 * Prevent downscaling to YUV420 format by more than 2
-* for Exynos3250 SoC as it produces broken raw image
+* for Exynos3250/compatible SoC as it produces broken raw image
 * in such cases.
 */
if (ct->mode == S5P_JPEG_DECODE &&
f_type == FMT_TYPE_CAPTURE &&
-   ct->jpeg->variant->version == SJPEG_EXYNOS3250 &&
+   is_3250_compat(ct) &&
pix->pixelformat == V4L2_PIX_FMT_YUV420 &&
ct->scale_factor > 2) {
scale_rect.width = ct->out_q.w / 2;
@@ -1569,12 +1582,12 @@ static int s5p_jpeg_s_selection(struct file *file, void 
*fh,
if (s->target == V4L2_SEL_TGT_COMPOSE) {
if (ctx->mode != S5P_JPEG_DECODE)
return -EINVAL;
-   if (ctx->jpeg->variant->version == SJPEG_EXYNOS3250)
+   if (is_3250_compat(ctx))
ret = exynos3250_jpeg_try_downscale(ctx, rect);
} else if (s->target == V4L2_SEL_TGT_CROP) {
if (ctx->mode != S5P_JPEG_ENCODE)
return -EINVAL;
-   if (ctx->jpeg->variant->version == SJPEG_EXYNOS3250)
+   if (i

[PATCHv2 0/2] Support for JPEG IP on Exynos542x

2015-03-06 Thread Andrzej Pietrasiewicz
This short series adds support for JPEG IP on Exynos542x SoC.
The first patch adds necessary device tree nodes and the second
one does JPEG IP support proper. The JPEG IP on Exynos542x is
similar to what is on Exynos3250, there just slight differences.

v1..v2:
- implemented changes resulting from Jacek's review
- removed iommu entries in device tree nodes as iommu is
not available at this moment
- added hw3250_compat and htbl_reinit flags to s5p_jpeg_variant,
which simplifies the code a bit

Andrzej Pietrasiewicz (2):
  ARM: dts: exynos5420: add nodes for jpeg codec
  media: s5p-jpeg: add 5420 family support

 .../bindings/media/exynos-jpeg-codec.txt   |  2 +-
 arch/arm/boot/dts/exynos5420.dtsi  | 16 ++
 drivers/media/platform/s5p-jpeg/jpeg-core.c| 59 +++---
 drivers/media/platform/s5p-jpeg/jpeg-core.h| 12 +++--
 4 files changed, 67 insertions(+), 22 deletions(-)

-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv2 1/2] ARM: dts: exynos5420: add nodes for jpeg codec

2015-03-06 Thread Andrzej Pietrasiewicz
Signed-off-by: Andrzej Pietrasiewicz 
---
 arch/arm/boot/dts/exynos5420.dtsi | 16 
 1 file changed, 16 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5420.dtsi 
b/arch/arm/boot/dts/exynos5420.dtsi
index 73c1851..f8f583c 100644
--- a/arch/arm/boot/dts/exynos5420.dtsi
+++ b/arch/arm/boot/dts/exynos5420.dtsi
@@ -775,6 +775,22 @@
iommus = <&sysmmu_gscl1>;
};
 
+   jpeg_0: jpeg@11F5 {
+   compatible = "samsung,exynos5420-jpeg";
+   reg = <0x11F5 0x1000>;
+   interrupts = <0 89 0>;
+   clock-names = "jpeg";
+   clocks = <&clock CLK_JPEG>;
+   };
+
+   jpeg_1: jpeg@11F6 {
+   compatible = "samsung,exynos5420-jpeg";
+   reg = <0x11F6 0x1000>;
+   interrupts = <0 168 0>;
+   clock-names = "jpeg";
+   clocks = <&clock CLK_JPEG2>;
+   };
+
pmu_system_controller: system-controller@1004 {
compatible = "samsung,exynos5420-pmu", "syscon";
reg = <0x1004 0x5000>;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv2 2/2] media: s5p-jpeg: add 5420 family support

2015-03-06 Thread Andrzej Pietrasiewicz
JPEG IP found in Exynos5420 is similar to what is in Exynos3250, but
there are some subtle differences which this patch takes into account.

Signed-off-by: Andrzej Pietrasiewicz 
---
 .../bindings/media/exynos-jpeg-codec.txt   |  2 +-
 drivers/media/platform/s5p-jpeg/jpeg-core.c| 59 +++---
 drivers/media/platform/s5p-jpeg/jpeg-core.h| 12 +++--
 3 files changed, 51 insertions(+), 22 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt 
b/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt
index bf52ed4..4ef4563 100644
--- a/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt
+++ b/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt
@@ -4,7 +4,7 @@ Required properties:
 
 - compatible   : should be one of:
  "samsung,s5pv210-jpeg", "samsung,exynos4210-jpeg",
- "samsung,exynos3250-jpeg";
+ "samsung,exynos3250-jpeg", "samsung,exynos5420-jpeg";
 - reg  : address and length of the JPEG codec IP register set;
 - interrupts   : specifies the JPEG codec IP interrupt;
 - clock-names   : should contain:
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c 
b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index 12f7452..8b0ca2e 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -621,6 +621,7 @@ static int s5p_jpeg_to_user_subsampling(struct s5p_jpeg_ctx 
*ctx)
return V4L2_JPEG_CHROMA_SUBSAMPLING_GRAY;
return ctx->subsampling;
case SJPEG_EXYNOS3250:
+   case SJPEG_EXYNOS5420:
if (ctx->subsampling > 3)
return V4L2_JPEG_CHROMA_SUBSAMPLING_411;
return exynos3250_decoded_subsampling[ctx->subsampling];
@@ -1142,13 +1143,13 @@ static void jpeg_bound_align_image(struct s5p_jpeg_ctx 
*ctx,
w_step = 1 << walign;
h_step = 1 << halign;
 
-   if (ctx->jpeg->variant->version == SJPEG_EXYNOS3250) {
+   if (ctx->jpeg->variant->hw3250_compat) {
/*
 * Rightmost and bottommost pixels are cropped by the
-* Exynos3250 JPEG IP for RGB formats, for the specific
-* width and height values respectively. This assignment
-* will result in v4l_bound_align_image returning dimensions
-* reduced by 1 for the aforementioned cases.
+* Exynos3250/compatible JPEG IP for RGB formats, for the
+* specific width and height values respectively. This
+* assignment will result in v4l_bound_align_image returning
+* dimensions reduced by 1 for the aforementioned cases.
 */
if (w_step == 4 && ((width & 3) == 1)) {
wmax = width;
@@ -1384,12 +1385,12 @@ static int s5p_jpeg_s_fmt(struct s5p_jpeg_ctx *ct, 
struct v4l2_format *f)
 
/*
 * Prevent downscaling to YUV420 format by more than 2
-* for Exynos3250 SoC as it produces broken raw image
+* for Exynos3250/compatible SoC as it produces broken raw image
 * in such cases.
 */
if (ct->mode == S5P_JPEG_DECODE &&
f_type == FMT_TYPE_CAPTURE &&
-   ct->jpeg->variant->version == SJPEG_EXYNOS3250 &&
+   ct->jpeg->variant->hw3250_compat &&
pix->pixelformat == V4L2_PIX_FMT_YUV420 &&
ct->scale_factor > 2) {
scale_rect.width = ct->out_q.w / 2;
@@ -1569,12 +1570,12 @@ static int s5p_jpeg_s_selection(struct file *file, void 
*fh,
if (s->target == V4L2_SEL_TGT_COMPOSE) {
if (ctx->mode != S5P_JPEG_DECODE)
return -EINVAL;
-   if (ctx->jpeg->variant->version == SJPEG_EXYNOS3250)
+   if (ctx->jpeg->variant->hw3250_compat)
ret = exynos3250_jpeg_try_downscale(ctx, rect);
} else if (s->target == V4L2_SEL_TGT_CROP) {
if (ctx->mode != S5P_JPEG_ENCODE)
return -EINVAL;
-   if (ctx->jpeg->variant->version == SJPEG_EXYNOS3250)
+   if (ctx->jpeg->variant->hw3250_compat)
ret = exynos3250_jpeg_try_crop(ctx, rect);
}
 
@@ -1604,8 +1605,9 @@ static int s5p_jpeg_adjust_subs_ctrl(struct s5p_jpeg_ctx 
*ctx, int *ctrl_val)
case SJPEG_S5P:
return 0;
case SJPEG_EXYNOS3250:
+   case SJPEG_EXYNOS5420:
/*
-* The exynos3250 device can produce JPEG image only
+* The exynos3250/compatible device can produce JPEG image only
 * of 4:4:4 sub

[PATCHv3 1/2] ARM: dts: exynos5420: add nodes for jpeg codec

2015-03-09 Thread Andrzej Pietrasiewicz
Add nodes for jpeg codec in Exynos5420 SoC.

Signed-off-by: Andrzej Pietrasiewicz 
---
 arch/arm/boot/dts/exynos5420.dtsi | 16 
 1 file changed, 16 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5420.dtsi 
b/arch/arm/boot/dts/exynos5420.dtsi
index 73c1851..f8f583c 100644
--- a/arch/arm/boot/dts/exynos5420.dtsi
+++ b/arch/arm/boot/dts/exynos5420.dtsi
@@ -775,6 +775,22 @@
iommus = <&sysmmu_gscl1>;
};
 
+   jpeg_0: jpeg@11F5 {
+   compatible = "samsung,exynos5420-jpeg";
+   reg = <0x11F5 0x1000>;
+   interrupts = <0 89 0>;
+   clock-names = "jpeg";
+   clocks = <&clock CLK_JPEG>;
+   };
+
+   jpeg_1: jpeg@11F6 {
+   compatible = "samsung,exynos5420-jpeg";
+   reg = <0x11F6 0x1000>;
+   interrupts = <0 168 0>;
+   clock-names = "jpeg";
+   clocks = <&clock CLK_JPEG2>;
+   };
+
pmu_system_controller: system-controller@1004 {
compatible = "samsung,exynos5420-pmu", "syscon";
reg = <0x1004 0x5000>;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv3 0/2] Support for JPEG IP on Exynos542x

2015-03-09 Thread Andrzej Pietrasiewicz
This short series adds support for JPEG IP on Exynos542x SoC.
The first patch adds necessary device tree nodes and the second
one does JPEG IP support proper. The JPEG IP on Exynos542x is
similar to what is on Exynos3250, there just slight differences.

v2..v3:
- added commit message to patch 1/2

v1..v2:
- implemented changes resulting from Jacek's review
- removed iommu entries in device tree nodes as iommu is
not available at this moment
- added hw3250_compat and htbl_reinit flags to s5p_jpeg_variant,
which simplifies the code a bit

Andrzej Pietrasiewicz (2):
  ARM: dts: exynos5420: add nodes for jpeg codec
  media: s5p-jpeg: add 5420 family support

 .../bindings/media/exynos-jpeg-codec.txt   |  2 +-
 arch/arm/boot/dts/exynos5420.dtsi  | 16 ++
 drivers/media/platform/s5p-jpeg/jpeg-core.c| 59 +++---
 drivers/media/platform/s5p-jpeg/jpeg-core.h| 12 +++--
 4 files changed, 67 insertions(+), 22 deletions(-)

-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv3 2/2] media: s5p-jpeg: add 5420 family support

2015-03-09 Thread Andrzej Pietrasiewicz
JPEG IP found in Exynos5420 is similar to what is in Exynos3250, but
there are some subtle differences which this patch takes into account.

Signed-off-by: Andrzej Pietrasiewicz 
---
 .../bindings/media/exynos-jpeg-codec.txt   |  2 +-
 drivers/media/platform/s5p-jpeg/jpeg-core.c| 59 +++---
 drivers/media/platform/s5p-jpeg/jpeg-core.h| 12 +++--
 3 files changed, 51 insertions(+), 22 deletions(-)

diff --git a/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt 
b/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt
index bf52ed4..4ef4563 100644
--- a/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt
+++ b/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt
@@ -4,7 +4,7 @@ Required properties:
 
 - compatible   : should be one of:
  "samsung,s5pv210-jpeg", "samsung,exynos4210-jpeg",
- "samsung,exynos3250-jpeg";
+ "samsung,exynos3250-jpeg", "samsung,exynos5420-jpeg";
 - reg  : address and length of the JPEG codec IP register set;
 - interrupts   : specifies the JPEG codec IP interrupt;
 - clock-names   : should contain:
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c 
b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index 12f7452..8b0ca2e 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -621,6 +621,7 @@ static int s5p_jpeg_to_user_subsampling(struct s5p_jpeg_ctx 
*ctx)
return V4L2_JPEG_CHROMA_SUBSAMPLING_GRAY;
return ctx->subsampling;
case SJPEG_EXYNOS3250:
+   case SJPEG_EXYNOS5420:
if (ctx->subsampling > 3)
return V4L2_JPEG_CHROMA_SUBSAMPLING_411;
return exynos3250_decoded_subsampling[ctx->subsampling];
@@ -1142,13 +1143,13 @@ static void jpeg_bound_align_image(struct s5p_jpeg_ctx 
*ctx,
w_step = 1 << walign;
h_step = 1 << halign;
 
-   if (ctx->jpeg->variant->version == SJPEG_EXYNOS3250) {
+   if (ctx->jpeg->variant->hw3250_compat) {
/*
 * Rightmost and bottommost pixels are cropped by the
-* Exynos3250 JPEG IP for RGB formats, for the specific
-* width and height values respectively. This assignment
-* will result in v4l_bound_align_image returning dimensions
-* reduced by 1 for the aforementioned cases.
+* Exynos3250/compatible JPEG IP for RGB formats, for the
+* specific width and height values respectively. This
+* assignment will result in v4l_bound_align_image returning
+* dimensions reduced by 1 for the aforementioned cases.
 */
if (w_step == 4 && ((width & 3) == 1)) {
wmax = width;
@@ -1384,12 +1385,12 @@ static int s5p_jpeg_s_fmt(struct s5p_jpeg_ctx *ct, 
struct v4l2_format *f)
 
/*
 * Prevent downscaling to YUV420 format by more than 2
-* for Exynos3250 SoC as it produces broken raw image
+* for Exynos3250/compatible SoC as it produces broken raw image
 * in such cases.
 */
if (ct->mode == S5P_JPEG_DECODE &&
f_type == FMT_TYPE_CAPTURE &&
-   ct->jpeg->variant->version == SJPEG_EXYNOS3250 &&
+   ct->jpeg->variant->hw3250_compat &&
pix->pixelformat == V4L2_PIX_FMT_YUV420 &&
ct->scale_factor > 2) {
scale_rect.width = ct->out_q.w / 2;
@@ -1569,12 +1570,12 @@ static int s5p_jpeg_s_selection(struct file *file, void 
*fh,
if (s->target == V4L2_SEL_TGT_COMPOSE) {
if (ctx->mode != S5P_JPEG_DECODE)
return -EINVAL;
-   if (ctx->jpeg->variant->version == SJPEG_EXYNOS3250)
+   if (ctx->jpeg->variant->hw3250_compat)
ret = exynos3250_jpeg_try_downscale(ctx, rect);
} else if (s->target == V4L2_SEL_TGT_CROP) {
if (ctx->mode != S5P_JPEG_ENCODE)
return -EINVAL;
-   if (ctx->jpeg->variant->version == SJPEG_EXYNOS3250)
+   if (ctx->jpeg->variant->hw3250_compat)
ret = exynos3250_jpeg_try_crop(ctx, rect);
}
 
@@ -1604,8 +1605,9 @@ static int s5p_jpeg_adjust_subs_ctrl(struct s5p_jpeg_ctx 
*ctx, int *ctrl_val)
case SJPEG_S5P:
return 0;
case SJPEG_EXYNOS3250:
+   case SJPEG_EXYNOS5420:
/*
-* The exynos3250 device can produce JPEG image only
+* The exynos3250/compatible device can produce JPEG image only
 * of 4:4:4 sub

[PATCH] media: s5p-jpeg: Eliminate double kfree

2015-07-03 Thread Andrzej Pietrasiewicz
video_unregister_device() calls device_unregister(), which calls
put_device(), which calls kobject_put(), and if this is the last reference
then kobject_release() is called, which calls kobject_cleanup(), which
calls ktype's release method which happens to be device_release() in this
case, which calls dev->release(), which happens to be
v4l2_device_release() in this case, which calls vdev->release(), which
happens to be video_device_release(). But video_device_release() is
called explicitly both in error recovery path of s5p_jpeg_probe() and
in s5p_jpeg_remove(). The pointers in question are not nullified between
the two calls, so this is harmful.

This patch fixes the driver so that video_device_release() is not called
twice for the same object.

Rebased onto Mauro's master.

Signed-off-by: Andrzej Pietrasiewicz 
---
 drivers/media/platform/s5p-jpeg/jpeg-core.c | 14 --
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c 
b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index bfbf157..9690f9d 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -2544,7 +2544,8 @@ static int s5p_jpeg_probe(struct platform_device *pdev)
ret = video_register_device(jpeg->vfd_encoder, VFL_TYPE_GRABBER, -1);
if (ret) {
v4l2_err(&jpeg->v4l2_dev, "Failed to register video device\n");
-   goto enc_vdev_alloc_rollback;
+   video_device_release(jpeg->vfd_encoder);
+   goto vb2_allocator_rollback;
}
 
video_set_drvdata(jpeg->vfd_encoder, jpeg);
@@ -2572,7 +2573,8 @@ static int s5p_jpeg_probe(struct platform_device *pdev)
ret = video_register_device(jpeg->vfd_decoder, VFL_TYPE_GRABBER, -1);
if (ret) {
v4l2_err(&jpeg->v4l2_dev, "Failed to register video device\n");
-   goto dec_vdev_alloc_rollback;
+   video_device_release(jpeg->vfd_decoder);
+   goto enc_vdev_register_rollback;
}
 
video_set_drvdata(jpeg->vfd_decoder, jpeg);
@@ -2589,15 +2591,9 @@ static int s5p_jpeg_probe(struct platform_device *pdev)
 
return 0;
 
-dec_vdev_alloc_rollback:
-   video_device_release(jpeg->vfd_decoder);
-
 enc_vdev_register_rollback:
video_unregister_device(jpeg->vfd_encoder);
 
-enc_vdev_alloc_rollback:
-   video_device_release(jpeg->vfd_encoder);
-
 vb2_allocator_rollback:
vb2_dma_contig_cleanup_ctx(jpeg->alloc_ctx);
 
@@ -2622,9 +2618,7 @@ static int s5p_jpeg_remove(struct platform_device *pdev)
pm_runtime_disable(jpeg->dev);
 
video_unregister_device(jpeg->vfd_decoder);
-   video_device_release(jpeg->vfd_decoder);
video_unregister_device(jpeg->vfd_encoder);
-   video_device_release(jpeg->vfd_encoder);
vb2_dma_contig_cleanup_ctx(jpeg->alloc_ctx);
v4l2_m2m_release(jpeg->m2m_dev);
v4l2_device_unregister(&jpeg->v4l2_dev);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ARM: EXYNOS4: JPEG: board definition and device registration

2011-10-11 Thread Andrzej Pietrasiewicz
Dear All,

This patch adds board definition code and device registration code
for JPEG IP found in Exynos4 SoC.

Andrzej Pietrasiewicz

Andrzej Pietrasiewicz (1):
  ARM: EXYNOS4: JPEG: board definition and device registration

 arch/arm/mach-exynos4/Kconfig   |1 +
 arch/arm/mach-exynos4/clock.c   |5 +++
 arch/arm/mach-exynos4/include/mach/map.h|3 ++
 arch/arm/mach-exynos4/mach-universal_c210.c |2 +
 arch/arm/plat-s5p/Kconfig   |5 +++
 arch/arm/plat-s5p/Makefile  |1 +
 arch/arm/plat-s5p/dev-jpeg.c|   46 +++
 arch/arm/plat-samsung/include/plat/devs.h   |1 +
 8 files changed, 64 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-s5p/dev-jpeg.c

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ARM: EXYNOS4: JPEG: board definition and device registration

2011-10-11 Thread Andrzej Pietrasiewicz
Exynos4 JPEG IP board definition and device registration

Signed-off-by: Andrzej Pietrasiewicz 
Signed-off-by: Kyungmin Park 
---
 arch/arm/mach-exynos4/Kconfig   |1 +
 arch/arm/mach-exynos4/clock.c   |5 +++
 arch/arm/mach-exynos4/include/mach/map.h|3 ++
 arch/arm/mach-exynos4/mach-universal_c210.c |2 +
 arch/arm/plat-s5p/Kconfig   |5 +++
 arch/arm/plat-s5p/Makefile  |1 +
 arch/arm/plat-s5p/dev-jpeg.c|   46 +++
 arch/arm/plat-samsung/include/plat/devs.h   |1 +
 8 files changed, 64 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-s5p/dev-jpeg.c

diff --git a/arch/arm/mach-exynos4/Kconfig b/arch/arm/mach-exynos4/Kconfig
index cf5b8e2..001d742 100644
--- a/arch/arm/mach-exynos4/Kconfig
+++ b/arch/arm/mach-exynos4/Kconfig
@@ -175,6 +175,7 @@ config MACH_UNIVERSAL_C210
select S5P_DEV_FIMC2
select S5P_DEV_FIMC3
select S5P_DEV_CSIS0
+   select S5P_DEV_JPEG
select S5P_DEV_FIMD0
select S5P_DEV_G2D
select S3C_DEV_HSMMC
diff --git a/arch/arm/mach-exynos4/clock.c b/arch/arm/mach-exynos4/clock.c
index 38ebce3..fa4d954 100644
--- a/arch/arm/mach-exynos4/clock.c
+++ b/arch/arm/mach-exynos4/clock.c
@@ -469,6 +469,11 @@ static struct clk init_clocks_off[] = {
.enable = exynos4_clk_ip_cam_ctrl,
.ctrlbit= (1 << 5),
}, {
+   .name   = "jpeg",
+   .id = 0,
+   .enable = exynos4_clk_ip_cam_ctrl,
+   .ctrlbit= (1 << 6),
+   }, {
.name   = "fimc",
.devname= "exynos4-fimc.0",
.enable = exynos4_clk_ip_cam_ctrl,
diff --git a/arch/arm/mach-exynos4/include/mach/map.h 
b/arch/arm/mach-exynos4/include/mach/map.h
index 8078644..16209fe 100644
--- a/arch/arm/mach-exynos4/include/mach/map.h
+++ b/arch/arm/mach-exynos4/include/mach/map.h
@@ -31,6 +31,8 @@
 #define EXYNOS4_PA_FIMC2   0x1182
 #define EXYNOS4_PA_FIMC3   0x1183
 
+#define EXYNOS4_PA_JPEG0x1184
+
 #define EXYNOS4_PA_G2D 0x1280
 
 #define EXYNOS4_PA_HSOTG   0x1248
@@ -162,6 +164,7 @@
 #define S5P_PA_FIMC1   EXYNOS4_PA_FIMC1
 #define S5P_PA_FIMC2   EXYNOS4_PA_FIMC2
 #define S5P_PA_FIMC3   EXYNOS4_PA_FIMC3
+#define S5P_PA_JPEGEXYNOS4_PA_JPEG
 #define S5P_PA_G2D EXYNOS4_PA_G2D
 #define S5P_PA_MIPI_CSIS0  EXYNOS4_PA_MIPI_CSIS0
 #define S5P_PA_MIPI_CSIS1  EXYNOS4_PA_MIPI_CSIS1
diff --git a/arch/arm/mach-exynos4/mach-universal_c210.c 
b/arch/arm/mach-exynos4/mach-universal_c210.c
index f2fe3dd..8eeebcc 100644
--- a/arch/arm/mach-exynos4/mach-universal_c210.c
+++ b/arch/arm/mach-exynos4/mach-universal_c210.c
@@ -1173,6 +1173,7 @@ static struct platform_device *universal_devices[] 
__initdata = {
&s5p_device_onenand,
&s5p_device_fimd0,
&s3c_device_usb_hsotg,
+   &s5p_device_jpeg,
&universal_spi_gpio,
&s5p_device_mfc,
&s5p_device_mfc_l,
@@ -1260,6 +1261,7 @@ static void __init universal_machine_init(void)
s5p_device_fimd0.dev.parent = &exynos4_device_pd[PD_LCD0].dev;
clk_xusbxti.rate = 2400;
 
+   s5p_device_jpeg.dev.parent =  &exynos4_device_pd[PD_CAM].dev;
s5p_device_fimc0.dev.parent = &exynos4_device_pd[PD_CAM].dev;
s5p_device_fimc1.dev.parent = &exynos4_device_pd[PD_CAM].dev;
s5p_device_fimc2.dev.parent = &exynos4_device_pd[PD_CAM].dev;
diff --git a/arch/arm/plat-s5p/Kconfig b/arch/arm/plat-s5p/Kconfig
index b0b3632..feb9c29 100644
--- a/arch/arm/plat-s5p/Kconfig
+++ b/arch/arm/plat-s5p/Kconfig
@@ -68,6 +68,11 @@ config S5P_DEV_FIMC3
help
  Compile in platform device definitions for FIMC controller 3
 
+config S5P_DEV_JPEG
+   bool
+   help
+ Compile in platform device definitions for JPEG codec
+
 config S5P_DEV_G2D
bool
help
diff --git a/arch/arm/plat-s5p/Makefile b/arch/arm/plat-s5p/Makefile
index 8712ccf..8c5aa54 100644
--- a/arch/arm/plat-s5p/Makefile
+++ b/arch/arm/plat-s5p/Makefile
@@ -30,6 +30,7 @@ obj-$(CONFIG_S5P_DEV_FIMC0)   += dev-fimc0.o
 obj-$(CONFIG_S5P_DEV_FIMC1)+= dev-fimc1.o
 obj-$(CONFIG_S5P_DEV_FIMC2)+= dev-fimc2.o
 obj-$(CONFIG_S5P_DEV_FIMC3)+= dev-fimc3.o
+obj-$(CONFIG_S5P_DEV_JPEG) += dev-jpeg.o
 obj-$(CONFIG_S5P_DEV_FIMD0)+= dev-fimd0.o
 obj-$(CONFIG_S5P_DEV_G2D)  += dev-g2d.o
 obj-$(CONFIG_S5P_DEV_I2C_HDMIPHY) += dev-i2c-hdmiphy.o
diff --git a/arch/arm/plat-s5p/dev-jpeg.c b/arch/arm/plat-s5p/dev-jpeg.c
new file mode 100644
index 000..cad8ae4
--- /dev/null
+++ b/arch/arm/plat-s5p/dev-jpeg.c

[PATCH] ARM: Exynos: JPEG board definition and device register

2012-01-31 Thread Andrzej Pietrasiewicz
Dear All,

This patch adds board definition code and device registration code
for JPEG IP found in Exynos4 SoC.


Signed-off-by: Andrzej Pietrasiewicz 
Signed-off-by: Kyungmin Park 
---
 arch/arm/mach-exynos/Kconfig   |2 ++
 arch/arm/mach-exynos/clock.c   |5 +
 arch/arm/mach-exynos/include/mach/map.h|3 +++
 arch/arm/mach-exynos/mach-nuri.c   |2 ++
 arch/arm/mach-exynos/mach-universal_c210.c |2 ++
 arch/arm/plat-s5p/Kconfig  |5 +
 arch/arm/plat-samsung/devs.c   |   26 ++
 arch/arm/plat-samsung/include/plat/devs.h  |1 +
 8 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index bd4600e..d8ab22f 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -232,6 +232,7 @@ config MACH_UNIVERSAL_C210
select S5P_DEV_FIMC3
select S5P_DEV_G2D
select S5P_DEV_CSIS0
+   select S5P_DEV_JPEG
select S5P_DEV_FIMD0
select S3C_DEV_HSMMC
select S3C_DEV_HSMMC2
@@ -270,6 +271,7 @@ config MACH_NURI
select S3C_DEV_I2C3
select S3C_DEV_I2C5
select S5P_DEV_CSIS0
+   select S5P_DEV_JPEG
select S5P_DEV_FIMC0
select S5P_DEV_FIMC1
select S5P_DEV_FIMC2
diff --git a/arch/arm/mach-exynos/clock.c b/arch/arm/mach-exynos/clock.c
index 5a8c42e..e5d446a 100644
--- a/arch/arm/mach-exynos/clock.c
+++ b/arch/arm/mach-exynos/clock.c
@@ -470,6 +470,11 @@ static struct clk init_clocks_off[] = {
.enable = exynos4_clk_ip_cam_ctrl,
.ctrlbit= (1 << 5),
}, {
+   .name   = "jpeg",
+   .id = 0,
+   .enable = exynos4_clk_ip_cam_ctrl,
+   .ctrlbit= (1 << 6),
+   }, {
.name   = "fimc",
.devname= "exynos4-fimc.0",
.enable = exynos4_clk_ip_cam_ctrl,
diff --git a/arch/arm/mach-exynos/include/mach/map.h 
b/arch/arm/mach-exynos/include/mach/map.h
index 7df9e74..5a9e656 100644
--- a/arch/arm/mach-exynos/include/mach/map.h
+++ b/arch/arm/mach-exynos/include/mach/map.h
@@ -31,6 +31,8 @@
 #define EXYNOS4_PA_FIMC2   0x1182
 #define EXYNOS4_PA_FIMC3   0x1183
 
+#define EXYNOS4_PA_JPEG0x1184
+
 #define EXYNOS4_PA_G2D 0x1280
 
 #define EXYNOS4_PA_I2S00x0383
@@ -164,6 +166,7 @@
 #define S5P_PA_FIMC1   EXYNOS4_PA_FIMC1
 #define S5P_PA_FIMC2   EXYNOS4_PA_FIMC2
 #define S5P_PA_FIMC3   EXYNOS4_PA_FIMC3
+#define S5P_PA_JPEGEXYNOS4_PA_JPEG
 #define S5P_PA_G2D EXYNOS4_PA_G2D
 #define S5P_PA_FIMD0   EXYNOS4_PA_FIMD0
 #define S5P_PA_HDMIEXYNOS4_PA_HDMI
diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c
index 165c876..adeb166 100644
--- a/arch/arm/mach-exynos/mach-nuri.c
+++ b/arch/arm/mach-exynos/mach-nuri.c
@@ -1260,6 +1260,7 @@ static struct platform_device *nuri_devices[] __initdata 
= {
&i2c9_gpio,
&s3c_device_adc,
&s5p_device_g2d,
+   &s5p_device_jpeg,
&s3c_device_rtc,
&s5p_device_mfc,
&s5p_device_mfc_l,
@@ -1319,6 +1320,7 @@ static void __init nuri_machine_init(void)
s5p_device_mfc.dev.parent = &exynos4_device_pd[PD_MFC].dev;
s5p_device_fimd0.dev.parent = &exynos4_device_pd[PD_LCD0].dev;
 
+   s5p_device_jpeg.dev.parent =  &exynos4_device_pd[PD_CAM].dev;
s5p_device_fimc0.dev.parent = &exynos4_device_pd[PD_CAM].dev;
s5p_device_fimc1.dev.parent = &exynos4_device_pd[PD_CAM].dev;
s5p_device_fimc2.dev.parent = &exynos4_device_pd[PD_CAM].dev;
diff --git a/arch/arm/mach-exynos/mach-universal_c210.c 
b/arch/arm/mach-exynos/mach-universal_c210.c
index dd75101..4c6dd86 100644
--- a/arch/arm/mach-exynos/mach-universal_c210.c
+++ b/arch/arm/mach-exynos/mach-universal_c210.c
@@ -980,6 +980,7 @@ static struct platform_device *universal_devices[] 
__initdata = {
&universal_gpio_keys,
&s5p_device_onenand,
&s5p_device_fimd0,
+   &s5p_device_jpeg,
&s5p_device_mfc,
&s5p_device_mfc_l,
&s5p_device_mfc_r,
@@ -1045,6 +1046,7 @@ static void __init universal_machine_init(void)
s5p_device_mfc.dev.parent = &exynos4_device_pd[PD_MFC].dev;
s5p_device_fimd0.dev.parent = &exynos4_device_pd[PD_LCD0].dev;
 
+   s5p_device_jpeg.dev.parent =  &exynos4_device_pd[PD_CAM].dev;
s5p_device_fimc0.dev.parent = &exynos4_device_pd[PD_CAM].dev;
s5p_device_fimc1.dev.parent = &exynos4_device_pd[PD_CAM].dev;

[PATCH v2] ARM: Exynos: JPEG board definition and device register

2012-01-31 Thread Andrzej Pietrasiewicz
Add JPEG board definition and device register

Signed-off-by: Andrzej Pietrasiewicz 
Signed-off-by: Kyungmin Park 
---
Dear All,

This patch adds board definition code and device registration code
for JPEG IP found in Exynos4 SoC.

It is exactly the same as the previous patch but with better coding style
compliance.

 arch/arm/mach-exynos/Kconfig   |2 ++
 arch/arm/mach-exynos/clock.c   |5 +
 arch/arm/mach-exynos/include/mach/map.h|3 +++
 arch/arm/mach-exynos/mach-nuri.c   |2 ++
 arch/arm/mach-exynos/mach-universal_c210.c |2 ++
 arch/arm/plat-s5p/Kconfig  |5 +
 arch/arm/plat-samsung/devs.c   |   26 ++
 arch/arm/plat-samsung/include/plat/devs.h  |1 +
 8 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index bd4600e..d8ab22f 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -232,6 +232,7 @@ config MACH_UNIVERSAL_C210
select S5P_DEV_FIMC3
select S5P_DEV_G2D
select S5P_DEV_CSIS0
+   select S5P_DEV_JPEG
select S5P_DEV_FIMD0
select S3C_DEV_HSMMC
select S3C_DEV_HSMMC2
@@ -270,6 +271,7 @@ config MACH_NURI
select S3C_DEV_I2C3
select S3C_DEV_I2C5
select S5P_DEV_CSIS0
+   select S5P_DEV_JPEG
select S5P_DEV_FIMC0
select S5P_DEV_FIMC1
select S5P_DEV_FIMC2
diff --git a/arch/arm/mach-exynos/clock.c b/arch/arm/mach-exynos/clock.c
index 5a8c42e..e5d446a 100644
--- a/arch/arm/mach-exynos/clock.c
+++ b/arch/arm/mach-exynos/clock.c
@@ -470,6 +470,11 @@ static struct clk init_clocks_off[] = {
.enable = exynos4_clk_ip_cam_ctrl,
.ctrlbit= (1 << 5),
}, {
+   .name   = "jpeg",
+   .id = 0,
+   .enable = exynos4_clk_ip_cam_ctrl,
+   .ctrlbit= (1 << 6),
+   }, {
.name   = "fimc",
.devname= "exynos4-fimc.0",
.enable = exynos4_clk_ip_cam_ctrl,
diff --git a/arch/arm/mach-exynos/include/mach/map.h 
b/arch/arm/mach-exynos/include/mach/map.h
index 7df9e74..5a9e656 100644
--- a/arch/arm/mach-exynos/include/mach/map.h
+++ b/arch/arm/mach-exynos/include/mach/map.h
@@ -31,6 +31,8 @@
 #define EXYNOS4_PA_FIMC2   0x1182
 #define EXYNOS4_PA_FIMC3   0x1183
 
+#define EXYNOS4_PA_JPEG0x1184
+
 #define EXYNOS4_PA_G2D 0x1280
 
 #define EXYNOS4_PA_I2S00x0383
@@ -164,6 +166,7 @@
 #define S5P_PA_FIMC1   EXYNOS4_PA_FIMC1
 #define S5P_PA_FIMC2   EXYNOS4_PA_FIMC2
 #define S5P_PA_FIMC3   EXYNOS4_PA_FIMC3
+#define S5P_PA_JPEGEXYNOS4_PA_JPEG
 #define S5P_PA_G2D EXYNOS4_PA_G2D
 #define S5P_PA_FIMD0   EXYNOS4_PA_FIMD0
 #define S5P_PA_HDMIEXYNOS4_PA_HDMI
diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c
index 165c876..adeb166 100644
--- a/arch/arm/mach-exynos/mach-nuri.c
+++ b/arch/arm/mach-exynos/mach-nuri.c
@@ -1260,6 +1260,7 @@ static struct platform_device *nuri_devices[] __initdata 
= {
&i2c9_gpio,
&s3c_device_adc,
&s5p_device_g2d,
+   &s5p_device_jpeg,
&s3c_device_rtc,
&s5p_device_mfc,
&s5p_device_mfc_l,
@@ -1319,6 +1320,7 @@ static void __init nuri_machine_init(void)
s5p_device_mfc.dev.parent = &exynos4_device_pd[PD_MFC].dev;
s5p_device_fimd0.dev.parent = &exynos4_device_pd[PD_LCD0].dev;
 
+   s5p_device_jpeg.dev.parent =  &exynos4_device_pd[PD_CAM].dev;
s5p_device_fimc0.dev.parent = &exynos4_device_pd[PD_CAM].dev;
s5p_device_fimc1.dev.parent = &exynos4_device_pd[PD_CAM].dev;
s5p_device_fimc2.dev.parent = &exynos4_device_pd[PD_CAM].dev;
diff --git a/arch/arm/mach-exynos/mach-universal_c210.c 
b/arch/arm/mach-exynos/mach-universal_c210.c
index dd75101..4c6dd86 100644
--- a/arch/arm/mach-exynos/mach-universal_c210.c
+++ b/arch/arm/mach-exynos/mach-universal_c210.c
@@ -980,6 +980,7 @@ static struct platform_device *universal_devices[] 
__initdata = {
&universal_gpio_keys,
&s5p_device_onenand,
&s5p_device_fimd0,
+   &s5p_device_jpeg,
&s5p_device_mfc,
&s5p_device_mfc_l,
&s5p_device_mfc_r,
@@ -1045,6 +1046,7 @@ static void __init universal_machine_init(void)
s5p_device_mfc.dev.parent = &exynos4_device_pd[PD_MFC].dev;
s5p_device_fimd0.dev.parent = &exynos4_device_pd[PD_LCD0].dev;
 
+   s5p_device_jpeg.dev.parent =  &exynos4_device_pd[PD_CAM].dev;

RE: [PATCH v2] ARM: Exynos: JPEG board definition and device register

2012-02-01 Thread Andrzej Pietrasiewicz
Hello Tushar,

On Wednesday, February 01, 2012 10:16 AM Tushar Behera wrote:

> 
> On 01/31/2012 03:50 PM, Andrzej Pietrasiewicz wrote:
> > Add JPEG board definition and device register
> >
> > Signed-off-by: Andrzej Pietrasiewicz 
> > Signed-off-by: Kyungmin Park 
> > ---
> > Dear All,
> >
> > This patch adds board definition code and device registration code
> > for JPEG IP found in Exynos4 SoC.
> >
> > It is exactly the same as the previous patch but with better coding
> style
> > compliance.
> >
> >  arch/arm/mach-exynos/Kconfig   |2 ++
> >  arch/arm/mach-exynos/clock.c   |5 +
> >  arch/arm/mach-exynos/include/mach/map.h|3 +++
> >  arch/arm/mach-exynos/mach-nuri.c   |2 ++
> >  arch/arm/mach-exynos/mach-universal_c210.c |2 ++
> >  arch/arm/plat-s5p/Kconfig  |5 +
> >  arch/arm/plat-samsung/devs.c   |   26
> ++
> >  arch/arm/plat-samsung/include/plat/devs.h  |1 +
> >  8 files changed, 46 insertions(+), 0 deletions(-)
> >
> [snip]
> >
> > +#ifdef CONFIG_S5P_DEV_JPEG
> > +static struct resource s5p_jpeg_resource[] = {
> > +   [0] = {
> > +   .start  = S5P_PA_JPEG,
> > +   .end= S5P_PA_JPEG + SZ_4K - 1,
> > +   .flags  = IORESOURCE_MEM,
> > +   },
> > +   [1] = {
> > +   .start  = IRQ_JPEG,
> > +   .end= IRQ_JPEG,
> > +   .flags  = IORESOURCE_IRQ,
> > +   },
> > +};
> 
> Should be using DEFINE_RES_MEM and DEFINE_RES_IRQ.
>
Thank you for pointing this out. I will fix it.
 
> Also, wouldn't be a good idea to split this patch into 2 different
> patches for platform-specific and board-specific changes?
> 
I think I will split it into 3 patches: platform-specific and
2 board-specific (universal, nuri).

Andrzej


--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv3 0/3] ARM: Exynos: JPEG board definition and device register

2012-02-01 Thread Andrzej Pietrasiewicz
Dear All,

This patch series adds board definition code and device registration code
for JPEG IP found in Exynos4 SoC on universal_c210 and nuri boards.

It includes changes after Tushar's review - thanks, Tushar.

Andrzej Pietrasiewicz (3):
  ARM: Exynos: JPEG board definition
  ARM: Exynos: Register JPEG on universal_c210
  ARM: Exynos: Register JPEG on nuri

 arch/arm/mach-exynos/Kconfig   |2 ++
 arch/arm/mach-exynos/clock.c   |5 +
 arch/arm/mach-exynos/include/mach/map.h|3 +++
 arch/arm/mach-exynos/mach-nuri.c   |2 ++
 arch/arm/mach-exynos/mach-universal_c210.c |2 ++
 arch/arm/plat-s5p/Kconfig  |5 +
 arch/arm/plat-samsung/devs.c   |   18 ++
 arch/arm/plat-samsung/include/plat/devs.h  |1 +
 8 files changed, 38 insertions(+), 0 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv3 1/3] ARM: Exynos: JPEG board definition

2012-02-01 Thread Andrzej Pietrasiewicz
ARM: Exynos: JPEG board definition

Signed-off-by: Andrzej Pietrasiewicz 
Signed-off-by: Kyungmin Park 
---
 arch/arm/mach-exynos/clock.c  |5 +
 arch/arm/mach-exynos/include/mach/map.h   |3 +++
 arch/arm/plat-s5p/Kconfig |5 +
 arch/arm/plat-samsung/devs.c  |   18 ++
 arch/arm/plat-samsung/include/plat/devs.h |1 +
 5 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-exynos/clock.c b/arch/arm/mach-exynos/clock.c
index 5a8c42e..e5d446a 100644
--- a/arch/arm/mach-exynos/clock.c
+++ b/arch/arm/mach-exynos/clock.c
@@ -470,6 +470,11 @@ static struct clk init_clocks_off[] = {
.enable = exynos4_clk_ip_cam_ctrl,
.ctrlbit= (1 << 5),
}, {
+   .name   = "jpeg",
+   .id = 0,
+   .enable = exynos4_clk_ip_cam_ctrl,
+   .ctrlbit= (1 << 6),
+   }, {
.name   = "fimc",
.devname= "exynos4-fimc.0",
.enable = exynos4_clk_ip_cam_ctrl,
diff --git a/arch/arm/mach-exynos/include/mach/map.h 
b/arch/arm/mach-exynos/include/mach/map.h
index 7df9e74..5a9e656 100644
--- a/arch/arm/mach-exynos/include/mach/map.h
+++ b/arch/arm/mach-exynos/include/mach/map.h
@@ -31,6 +31,8 @@
 #define EXYNOS4_PA_FIMC2   0x1182
 #define EXYNOS4_PA_FIMC3   0x1183
 
+#define EXYNOS4_PA_JPEG0x1184
+
 #define EXYNOS4_PA_G2D 0x1280
 
 #define EXYNOS4_PA_I2S00x0383
@@ -164,6 +166,7 @@
 #define S5P_PA_FIMC1   EXYNOS4_PA_FIMC1
 #define S5P_PA_FIMC2   EXYNOS4_PA_FIMC2
 #define S5P_PA_FIMC3   EXYNOS4_PA_FIMC3
+#define S5P_PA_JPEGEXYNOS4_PA_JPEG
 #define S5P_PA_G2D EXYNOS4_PA_G2D
 #define S5P_PA_FIMD0   EXYNOS4_PA_FIMD0
 #define S5P_PA_HDMIEXYNOS4_PA_HDMI
diff --git a/arch/arm/plat-s5p/Kconfig b/arch/arm/plat-s5p/Kconfig
index e7fec78..7a30869 100644
--- a/arch/arm/plat-s5p/Kconfig
+++ b/arch/arm/plat-s5p/Kconfig
@@ -80,6 +80,11 @@ config S5P_DEV_FIMC3
help
  Compile in platform device definitions for FIMC controller 3
 
+config S5P_DEV_JPEG
+   bool
+   help
+ Compile in platform device definitions for JPEG codec
+
 config S5P_DEV_G2D
bool
help
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index 145580a..1121372 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -295,6 +295,24 @@ struct platform_device s5p_device_g2d = {
 };
 #endif /* CONFIG_S5P_DEV_G2D */
 
+#ifdef CONFIG_S5P_DEV_JPEG
+static struct resource s5p_jpeg_resource[] = {
+   [0] = DEFINE_RES_MEM(S5P_PA_JPEG, SZ_4K),
+   [1] = DEFINE_RES_IRQ(IRQ_JPEG),
+};
+
+struct platform_device s5p_device_jpeg = {
+   .name   = "s5p-jpeg",
+   .id = 0,
+   .num_resources  = ARRAY_SIZE(s5p_jpeg_resource),
+   .resource   = s5p_jpeg_resource,
+   .dev= {
+   .dma_mask   = &samsung_device_dma_mask,
+   .coherent_dma_mask  = DMA_BIT_MASK(32),
+   },
+};
+#endif /*  CONFIG_S5P_DEV_JPEG */
+
 /* FIMD0 */
 
 #ifdef CONFIG_S5P_DEV_FIMD0
diff --git a/arch/arm/plat-samsung/include/plat/devs.h 
b/arch/arm/plat-samsung/include/plat/devs.h
index bb45848..5e7972d 100644
--- a/arch/arm/plat-samsung/include/plat/devs.h
+++ b/arch/arm/plat-samsung/include/plat/devs.h
@@ -79,6 +79,7 @@ extern struct platform_device s5p_device_fimc1;
 extern struct platform_device s5p_device_fimc2;
 extern struct platform_device s5p_device_fimc3;
 extern struct platform_device s5p_device_fimc_md;
+extern struct platform_device s5p_device_jpeg;
 extern struct platform_device s5p_device_g2d;
 extern struct platform_device s5p_device_fimd0;
 extern struct platform_device s5p_device_hdmi;
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv3 2/3] ARM: Exynos: Register JPEG on universal_c210

2012-02-01 Thread Andrzej Pietrasiewicz
ARM: Exynos: Register JPEG on universal_c210

Signed-off-by: Andrzej Pietrasiewicz 
Signed-off-by: Kyungmin Park 
---
 arch/arm/mach-exynos/Kconfig   |1 +
 arch/arm/mach-exynos/mach-universal_c210.c |2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index bd4600e..042803a 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -232,6 +232,7 @@ config MACH_UNIVERSAL_C210
select S5P_DEV_FIMC3
select S5P_DEV_G2D
select S5P_DEV_CSIS0
+   select S5P_DEV_JPEG
select S5P_DEV_FIMD0
select S3C_DEV_HSMMC
select S3C_DEV_HSMMC2
diff --git a/arch/arm/mach-exynos/mach-universal_c210.c 
b/arch/arm/mach-exynos/mach-universal_c210.c
index dd75101..4c6dd86 100644
--- a/arch/arm/mach-exynos/mach-universal_c210.c
+++ b/arch/arm/mach-exynos/mach-universal_c210.c
@@ -980,6 +980,7 @@ static struct platform_device *universal_devices[] 
__initdata = {
&universal_gpio_keys,
&s5p_device_onenand,
&s5p_device_fimd0,
+   &s5p_device_jpeg,
&s5p_device_mfc,
&s5p_device_mfc_l,
&s5p_device_mfc_r,
@@ -1045,6 +1046,7 @@ static void __init universal_machine_init(void)
s5p_device_mfc.dev.parent = &exynos4_device_pd[PD_MFC].dev;
s5p_device_fimd0.dev.parent = &exynos4_device_pd[PD_LCD0].dev;
 
+   s5p_device_jpeg.dev.parent =  &exynos4_device_pd[PD_CAM].dev;
s5p_device_fimc0.dev.parent = &exynos4_device_pd[PD_CAM].dev;
s5p_device_fimc1.dev.parent = &exynos4_device_pd[PD_CAM].dev;
s5p_device_fimc2.dev.parent = &exynos4_device_pd[PD_CAM].dev;
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv3 3/3] ARM: Exynos: Register JPEG on nuri

2012-02-01 Thread Andrzej Pietrasiewicz
ARM: Exynos: Register JPEG on nuri

Signed-off-by: Andrzej Pietrasiewicz 
Signed-off-by: Kyungmin Park 
---
 arch/arm/mach-exynos/Kconfig |1 +
 arch/arm/mach-exynos/mach-nuri.c |2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 042803a..d8ab22f 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -271,6 +271,7 @@ config MACH_NURI
select S3C_DEV_I2C3
select S3C_DEV_I2C5
select S5P_DEV_CSIS0
+   select S5P_DEV_JPEG
select S5P_DEV_FIMC0
select S5P_DEV_FIMC1
select S5P_DEV_FIMC2
diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c
index 165c876..adeb166 100644
--- a/arch/arm/mach-exynos/mach-nuri.c
+++ b/arch/arm/mach-exynos/mach-nuri.c
@@ -1260,6 +1260,7 @@ static struct platform_device *nuri_devices[] __initdata 
= {
&i2c9_gpio,
&s3c_device_adc,
&s5p_device_g2d,
+   &s5p_device_jpeg,
&s3c_device_rtc,
&s5p_device_mfc,
&s5p_device_mfc_l,
@@ -1319,6 +1320,7 @@ static void __init nuri_machine_init(void)
s5p_device_mfc.dev.parent = &exynos4_device_pd[PD_MFC].dev;
s5p_device_fimd0.dev.parent = &exynos4_device_pd[PD_LCD0].dev;
 
+   s5p_device_jpeg.dev.parent =  &exynos4_device_pd[PD_CAM].dev;
s5p_device_fimc0.dev.parent = &exynos4_device_pd[PD_CAM].dev;
s5p_device_fimc1.dev.parent = &exynos4_device_pd[PD_CAM].dev;
s5p_device_fimc2.dev.parent = &exynos4_device_pd[PD_CAM].dev;
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv4 0/2] ARM: Exynos: JPEG device register

2012-02-21 Thread Andrzej Pietrasiewicz
Dear All,

This patch series adds device registration code for JPEG IP found in
Exynos4 SoC on universal_c210 and nuri boards.

This version is a simplified revision of these patches:

http://www.spinics.net/lists/linux-samsung-soc/msg09164.html
http://www.spinics.net/lists/linux-samsung-soc/msg09165.html

and because of that it relies on this patch:

http://www.spinics.net/lists/linux-samsung-soc/msg09463.html

which adds JPEG power domain to generic power domain infrastructure.

This version also depends on:

http://www.spinics.net/lists/linux-samsung-soc/msg09163.html

which contains JPEG board definition.

Andrzej Pietrasiewicz (2):
  ARM: Exynos: Register JPEG on universal_c210
  ARM: Exynos: Register JPEG on nuri

 arch/arm/mach-exynos/Kconfig   |2 ++
 arch/arm/mach-exynos/mach-nuri.c   |1 +
 arch/arm/mach-exynos/mach-universal_c210.c |1 +
 3 files changed, 4 insertions(+), 0 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] ARM: Exynos: Register JPEG on universal_c210

2012-02-21 Thread Andrzej Pietrasiewicz
ARM: Exynos: Register JPEG on universal_c210

Signed-off-by: Andrzej Pietrasiewicz 
Signed-off-by: Kyungmin Park 
---
 arch/arm/mach-exynos/Kconfig   |1 +
 arch/arm/mach-exynos/mach-universal_c210.c |1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index cf29c35..23b6971 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -235,6 +235,7 @@ config MACH_UNIVERSAL_C210
select S5P_DEV_FIMC3
select S5P_DEV_G2D
select S5P_DEV_CSIS0
+   select S5P_DEV_JPEG
select S5P_DEV_FIMD0
select S3C_DEV_HSMMC
select S3C_DEV_HSMMC2
diff --git a/arch/arm/mach-exynos/mach-universal_c210.c 
b/arch/arm/mach-exynos/mach-universal_c210.c
index 220de1c..c525f42 100644
--- a/arch/arm/mach-exynos/mach-universal_c210.c
+++ b/arch/arm/mach-exynos/mach-universal_c210.c
@@ -981,6 +981,7 @@ static struct platform_device *universal_devices[] 
__initdata = {
&universal_gpio_keys,
&s5p_device_onenand,
&s5p_device_fimd0,
+   &s5p_device_jpeg,
&s5p_device_mfc,
&s5p_device_mfc_l,
&s5p_device_mfc_r,
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] ARM: Exynos: Register JPEG on nuri

2012-02-21 Thread Andrzej Pietrasiewicz
ARM: Exynos: Register JPEG on nuri

Signed-off-by: Andrzej Pietrasiewicz 
Signed-off-by: Kyungmin Park 
---
 arch/arm/mach-exynos/Kconfig |1 +
 arch/arm/mach-exynos/mach-nuri.c |1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 23b6971..189a212 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -274,6 +274,7 @@ config MACH_NURI
select S3C_DEV_I2C3
select S3C_DEV_I2C5
select S5P_DEV_CSIS0
+   select S5P_DEV_JPEG
select S5P_DEV_FIMC0
select S5P_DEV_FIMC1
select S5P_DEV_FIMC2
diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c
index b62e02b..be7bfd2 100644
--- a/arch/arm/mach-exynos/mach-nuri.c
+++ b/arch/arm/mach-exynos/mach-nuri.c
@@ -1260,6 +1260,7 @@ static struct platform_device *nuri_devices[] __initdata 
= {
&i2c9_gpio,
&s3c_device_adc,
&s5p_device_g2d,
+   &s5p_device_jpeg,
&s3c_device_rtc,
&s5p_device_mfc,
&s5p_device_mfc_l,
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCHv5] ARM: Exynos: Register JPEG on nuri

2012-02-24 Thread Andrzej Pietrasiewicz
ARM: Exynos: Register JPEG on nuri

Signed-off-by: Andrzej Pietrasiewicz 
Signed-off-by: Kyungmin Park 
---

This is in response to:
http://www.spinics.net/lists/linux-samsung-soc/msg09530.html

Now it should apply cleanly.

@Sachin: Thank you for spotting the problem.

 arch/arm/mach-exynos/Kconfig |1 +
 arch/arm/mach-exynos/mach-nuri.c |1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index a95146b..6db7dd2 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -265,6 +265,7 @@ config MACH_NURI
select S3C_DEV_I2C5
select S3C_DEV_I2C6
select S5P_DEV_CSIS0
+   select S5P_DEV_JPEG
select S5P_DEV_FIMC0
select S5P_DEV_FIMC1
select S5P_DEV_FIMC2
diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c
index a6b9162..8016649 100644
--- a/arch/arm/mach-exynos/mach-nuri.c
+++ b/arch/arm/mach-exynos/mach-nuri.c
@@ -1320,6 +1320,7 @@ static struct platform_device *nuri_devices[] __initdata 
= {
&i2c9_gpio,
&s3c_device_adc,
&s5p_device_g2d,
+   &s5p_device_jpeg,
&s3c_device_rtc,
&s5p_device_mfc,
&s5p_device_mfc_l,
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html