Re: [PATCH v2 09/16] s5p-jpeg: Split jpeg-hw.h to jpeg-hw-s5p.c and jpeg-hw-s5p.c

2013-12-18 Thread Mauro Carvalho Chehab
Em Mon, 25 Nov 2013 10:58:16 +0100
Jacek Anaszewski j.anaszew...@samsung.com escreveu:

 Move function definitions from jpeg-hw.h to jpeg-hw-s5p.c
 and put function declarations in the jpeg-hw-s5p.h.
 
 Signed-off-by: Jacek Anaszewski j.anaszew...@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com

...

 +void jpeg_reset(void __iomem *regs);
 +void jpeg_poweron(void __iomem *regs);
 +void jpeg_input_raw_mode(void __iomem *regs, unsigned long mode);
 +void jpeg_input_raw_y16(void __iomem *regs, bool y16);
 +void jpeg_proc_mode(void __iomem *regs, unsigned long mode);
 +void jpeg_subsampling_mode(void __iomem *regs, unsigned int mode);
 +unsigned int jpeg_get_subsampling_mode(void __iomem *regs);
 +void jpeg_dri(void __iomem *regs, unsigned int dri);
 +void jpeg_qtbl(void __iomem *regs, unsigned int t, unsigned int n);
 +void jpeg_htbl_ac(void __iomem *regs, unsigned int t);
 +void jpeg_htbl_dc(void __iomem *regs, unsigned int t);
 +void jpeg_y(void __iomem *regs, unsigned int y);
 +void jpeg_x(void __iomem *regs, unsigned int x);
 +void jpeg_rst_int_enable(void __iomem *regs, bool enable);
 +void jpeg_data_num_int_enable(void __iomem *regs, bool enable);
 +void jpeg_final_mcu_num_int_enable(void __iomem *regs, bool enbl);
 +void jpeg_timer_enable(void __iomem *regs, unsigned long val);
 +void jpeg_timer_disable(void __iomem *regs);
 +int jpeg_timer_stat(void __iomem *regs);
 +void jpeg_clear_timer_stat(void __iomem *regs);
 +void jpeg_enc_stream_int(void __iomem *regs, unsigned long size);
 +int jpeg_enc_stream_stat(void __iomem *regs);
 +void jpeg_clear_enc_stream_stat(void __iomem *regs);
 +void jpeg_outform_raw(void __iomem *regs, unsigned long format);
 +void jpeg_jpgadr(void __iomem *regs, unsigned long addr);
 +void jpeg_imgadr(void __iomem *regs, unsigned long addr);
 +void jpeg_coef(void __iomem *regs, unsigned int i,
 +  unsigned int j, unsigned int coef);
 +void jpeg_start(void __iomem *regs);
 +int jpeg_result_stat_ok(void __iomem *regs);
 +int jpeg_stream_stat_ok(void __iomem *regs);
 +void jpeg_clear_int(void __iomem *regs);
 +unsigned int jpeg_compressed_size(void __iomem *regs);


NACK. Please don't pollute Kernel name space. 

Those functions are specific to s5p. They should all be prepended by s5p_, 
or otherwise it will risk to cause conflicts with other global symbols
that could have the same name, for kernels compiled will allyesconfig.

Regards,
-- 

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


[PATCH v2 09/16] s5p-jpeg: Split jpeg-hw.h to jpeg-hw-s5p.c and jpeg-hw-s5p.c

2013-11-25 Thread Jacek Anaszewski
Move function definitions from jpeg-hw.h to jpeg-hw-s5p.c
and put function declarations in the jpeg-hw-s5p.h.

Signed-off-by: Jacek Anaszewski j.anaszew...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 drivers/media/platform/s5p-jpeg/Makefile   |2 +-
 drivers/media/platform/s5p-jpeg/jpeg-core.c|2 +-
 drivers/media/platform/s5p-jpeg/jpeg-core.h|5 ++
 .../platform/s5p-jpeg/{jpeg-hw.h = jpeg-hw-s5p.c} |   82 
 drivers/media/platform/s5p-jpeg/jpeg-hw-s5p.h  |   63 +++
 5 files changed, 104 insertions(+), 50 deletions(-)
 rename drivers/media/platform/s5p-jpeg/{jpeg-hw.h = jpeg-hw-s5p.c} (71%)
 create mode 100644 drivers/media/platform/s5p-jpeg/jpeg-hw-s5p.h

diff --git a/drivers/media/platform/s5p-jpeg/Makefile 
b/drivers/media/platform/s5p-jpeg/Makefile
index d18cb5e..faf6398 100644
--- a/drivers/media/platform/s5p-jpeg/Makefile
+++ b/drivers/media/platform/s5p-jpeg/Makefile
@@ -1,2 +1,2 @@
-s5p-jpeg-objs := jpeg-core.o
+s5p-jpeg-objs := jpeg-core.o jpeg-hw-s5p.o
 obj-$(CONFIG_VIDEO_SAMSUNG_S5P_JPEG) += s5p-jpeg.o
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c 
b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index e907738..b4d7445 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -29,7 +29,7 @@
 #include media/videobuf2-dma-contig.h
 
 #include jpeg-core.h
-#include jpeg-hw.h
+#include jpeg-hw-s5p.h
 
 static struct s5p_jpeg_fmt formats_enc[] = {
{
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.h 
b/drivers/media/platform/s5p-jpeg/jpeg-core.h
index 4a4776b..7baadf3 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.h
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.h
@@ -42,10 +42,15 @@
 #define EOI0xd9
 #define DHP0xde
 
+#define S5P_JPEG_ENCODE0
+#define S5P_JPEG_DECODE1
+
 /* Flags that indicate a format can be used for capture/output */
 #define MEM2MEM_CAPTURE(1  0)
 #define MEM2MEM_OUTPUT (1  1)
 
+
+
 /**
  * struct s5p_jpeg - JPEG IP abstraction
  * @lock:  the mutex protecting this structure
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-hw.h 
b/drivers/media/platform/s5p-jpeg/jpeg-hw-s5p.c
similarity index 71%
rename from drivers/media/platform/s5p-jpeg/jpeg-hw.h
rename to drivers/media/platform/s5p-jpeg/jpeg-hw-s5p.c
index b47e887..6a1164c 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-hw.h
+++ b/drivers/media/platform/s5p-jpeg/jpeg-hw-s5p.c
@@ -9,27 +9,15 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#ifndef JPEG_HW_H_
-#define JPEG_HW_H_
 
 #include linux/io.h
 #include linux/videodev2.h
 
-#include jpeg-hw.h
+#include jpeg-core.h
 #include jpeg-regs.h
+#include jpeg-hw-s5p.h
 
-#define S5P_JPEG_MIN_WIDTH 32
-#define S5P_JPEG_MIN_HEIGHT32
-#define S5P_JPEG_MAX_WIDTH 8192
-#define S5P_JPEG_MAX_HEIGHT8192
-#define S5P_JPEG_ENCODE0
-#define S5P_JPEG_DECODE1
-#define S5P_JPEG_RAW_IN_5650
-#define S5P_JPEG_RAW_IN_4221
-#define S5P_JPEG_RAW_OUT_422   0
-#define S5P_JPEG_RAW_OUT_420   1
-
-static inline void jpeg_reset(void __iomem *regs)
+void jpeg_reset(void __iomem *regs)
 {
unsigned long reg;
 
@@ -42,12 +30,12 @@ static inline void jpeg_reset(void __iomem *regs)
}
 }
 
-static inline void jpeg_poweron(void __iomem *regs)
+void jpeg_poweron(void __iomem *regs)
 {
writel(S5P_POWER_ON, regs + S5P_JPGCLKCON);
 }
 
-static inline void jpeg_input_raw_mode(void __iomem *regs, unsigned long mode)
+void jpeg_input_raw_mode(void __iomem *regs, unsigned long mode)
 {
unsigned long reg, m;
 
@@ -63,7 +51,7 @@ static inline void jpeg_input_raw_mode(void __iomem *regs, 
unsigned long mode)
writel(reg, regs + S5P_JPGCMOD);
 }
 
-static inline void jpeg_input_raw_y16(void __iomem *regs, bool y16)
+void jpeg_input_raw_y16(void __iomem *regs, bool y16)
 {
unsigned long reg;
 
@@ -75,7 +63,7 @@ static inline void jpeg_input_raw_y16(void __iomem *regs, 
bool y16)
writel(reg, regs + S5P_JPGCMOD);
 }
 
-static inline void jpeg_proc_mode(void __iomem *regs, unsigned long mode)
+void jpeg_proc_mode(void __iomem *regs, unsigned long mode)
 {
unsigned long reg, m;
 
@@ -90,7 +78,7 @@ static inline void jpeg_proc_mode(void __iomem *regs, 
unsigned long mode)
writel(reg, regs + S5P_JPGMOD);
 }
 
-static inline void jpeg_subsampling_mode(void __iomem *regs, unsigned int mode)
+void jpeg_subsampling_mode(void __iomem *regs, unsigned int mode)
 {
unsigned long reg, m;
 
@@ -105,12 +93,12 @@ static inline void jpeg_subsampling_mode(void __iomem 
*regs, unsigned int mode)
writel(reg, regs + S5P_JPGMOD);
 }