Reply

2014-10-02 Thread Mr. James
Sequel to your non-response to my previous email, I am re-sending this to you 
again thus; A deceased client of mine who died of a heart-related ailment about 
3 years ago left behind some funds which I want you to  assist in retriving and 
distributing. Reply so I can give you details.

Regards,

James.
--
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] [media] s5p-jpeg: Only build suspend/resume for PM

2014-10-02 Thread Thierry Reding
From: Thierry Reding tred...@nvidia.com

If power management is disabled these function become unused, so there
is no reason to build them. This fixes a couple of build warnings when
PM(_SLEEP,_RUNTIME) is not enabled.

Signed-off-by: Thierry Reding tred...@nvidia.com
---
 drivers/media/platform/s5p-jpeg/jpeg-core.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c 
b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index e525a7c8d885..cc5d6bd40256 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -2632,6 +2632,7 @@ static int s5p_jpeg_remove(struct platform_device *pdev)
return 0;
 }
 
+#if defined(CONFIG_PM_RUNTIME) || defined(CONFIG_PM_SLEEP)
 static int s5p_jpeg_runtime_suspend(struct device *dev)
 {
struct s5p_jpeg *jpeg = dev_get_drvdata(dev);
@@ -2681,7 +2682,9 @@ static int s5p_jpeg_runtime_resume(struct device *dev)
 
return 0;
 }
+#endif
 
+#ifdef CONFIG_PM_SLEEP
 static int s5p_jpeg_suspend(struct device *dev)
 {
if (pm_runtime_suspended(dev))
@@ -2697,6 +2700,7 @@ static int s5p_jpeg_resume(struct device *dev)
 
return s5p_jpeg_runtime_resume(dev);
 }
+#endif
 
 static const struct dev_pm_ops s5p_jpeg_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(s5p_jpeg_suspend, s5p_jpeg_resume)
-- 
2.1.0

--
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


Re: [PATCH] Fixed all coding style issues for drivers/staging/media/lirc/

2014-10-02 Thread Dan Carpenter
On Wed, Oct 01, 2014 at 07:35:51PM -0700, Amber Thrall wrote:
 Fixed various coding sytles.
 

Fix one type of thing at a time.

 Signed-off-by: Amber Thrall amber.rose.thr...@gmail.com
 ---
  drivers/staging/media/lirc/lirc_bt829.c  |  2 +-
  drivers/staging/media/lirc/lirc_imon.c   |  4 +-
  drivers/staging/media/lirc/lirc_sasem.c  |  6 +--
  drivers/staging/media/lirc/lirc_serial.c | 29 ++
  drivers/staging/media/lirc/lirc_sir.c|  3 +-
  drivers/staging/media/lirc/lirc_zilog.c  | 69 
 +++-
  6 files changed, 52 insertions(+), 61 deletions(-)
 
 diff --git a/drivers/staging/media/lirc/lirc_bt829.c 
 b/drivers/staging/media/lirc/lirc_bt829.c
 index 4c806ba..c70ca68 100644
 --- a/drivers/staging/media/lirc/lirc_bt829.c
 +++ b/drivers/staging/media/lirc/lirc_bt829.c
 @@ -59,7 +59,7 @@ static bool debug;
  #define dprintk(fmt, args...)
  \
   do { \
   if (debug)   \
 - printk(KERN_DEBUG DRIVER_NAME : fmt, ## args); \
 + dev_dbg(DRIVER_NAME, : fmt, ##args); \

I think we need to pass a dev pointer to the dev_dbg() functions.  Does
this even compile?  I can't test it myself at this minute.

My guess is the reason this compiles is because dprintk() is #ifdefed
out of the actual code.

   } while (0)
  
  static int atir_minor;
 diff --git a/drivers/staging/media/lirc/lirc_imon.c 
 b/drivers/staging/media/lirc/lirc_imon.c
 index 7aca44f..bce0408 100644
 --- a/drivers/staging/media/lirc/lirc_imon.c
 +++ b/drivers/staging/media/lirc/lirc_imon.c
 @@ -623,8 +623,8 @@ static void imon_incoming_packet(struct imon_context 
 *context,
   if (debug) {
   dev_info(dev, raw packet: );
   for (i = 0; i  len; ++i)
 - printk(%02x , buf[i]);
 - printk(\n);
 + dev_info(dev, %02x , buf[i]);
 + dev_info(dev, \n);

This doesn't work.  The dev_ functions can't really be split across more
than one line.  The try to put stuff at the start of the line but
we're putting it all on the same line they're putting a bunch of garbage
in the middle of the line.

   }
  
   /*
 diff --git a/drivers/staging/media/lirc/lirc_sasem.c 
 b/drivers/staging/media/lirc/lirc_sasem.c
 index c20ef56..e88e246 100644
 --- a/drivers/staging/media/lirc/lirc_sasem.c
 +++ b/drivers/staging/media/lirc/lirc_sasem.c
 @@ -583,10 +583,10 @@ static void incoming_packet(struct sasem_context 
 *context,
   }
  
   if (debug) {
 - printk(KERN_INFO Incoming data: );
 + pr_info(Incoming data: );
   for (i = 0; i  8; ++i)
 - printk(KERN_CONT %02x , buf[i]);
 - printk(KERN_CONT \n);
 + pr_cont(%02x, buf[i]);
 + pr_cont(\n);

The debug variable really isn't needed if we're going to use the
standard debugging printks.

   }
  
   /*
 diff --git a/drivers/staging/media/lirc/lirc_serial.c 
 b/drivers/staging/media/lirc/lirc_serial.c
 index 181b92b..b07671b 100644
 --- a/drivers/staging/media/lirc/lirc_serial.c
 +++ b/drivers/staging/media/lirc/lirc_serial.c
 @@ -116,8 +116,7 @@ static bool txsense;  /* 0 = active high, 1 = active 
 low */
  #define dprintk(fmt, args...)\
   do {\
   if (debug)  \
 - printk(KERN_DEBUG LIRC_DRIVER_NAME :  \
 -fmt, ## args);   \
 + dev_dbg(LIRC_DRIVER_NAME, : fmt, ##args); \
   } while (0)
  
  /* forward declarations */
 @@ -356,9 +355,8 @@ static int init_timing_params(unsigned int new_duty_cycle,
   /* Derive pulse and space from the period */
   pulse_width = period * duty_cycle / 100;
   space_width = period - pulse_width;
 - dprintk(in init_timing_params, freq=%d, duty_cycle=%d, 
 - clk/jiffy=%ld, pulse=%ld, space=%ld, 
 - conv_us_to_clocks=%ld\n,
 + dprintk(in init_timing_params, freq=%d, duty_cycle=%d, clk/jiffy=%ld,
 + pulse=%ld, space=%ld, conv_us_to_clocks=%ld\n,
   freq, duty_cycle, __this_cpu_read(cpu_info.loops_per_jiffy),
   pulse_width, space_width, conv_us_to_clocks);
   return 0;
 @@ -1075,7 +1073,7 @@ static int __init lirc_serial_init(void)
  
   result = platform_driver_register(lirc_serial_driver);
   if (result) {
 - printk(lirc register returned %d\n, result);
 + dprintk(lirc register returned %d\n, result);

Check to see what printks platform_driver_register() will print on
failure.  People add printks all over the place out of helpfulness but
a lot of the time they aren't needed.

   goto 

[PATCH v2 13/18] smiapp: Split calculating PLL with sensor's limits from updating it

2014-10-02 Thread Sakari Ailus
From: Sakari Ailus sakari.ai...@linux.intel.com

The first one is handy for just trying out a PLL configuration without a
need to apply it.

Signed-off-by: Sakari Ailus sakari.ai...@linux.intel.com
---
 drivers/media/i2c/smiapp/smiapp-core.c |   11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/smiapp/smiapp-core.c 
b/drivers/media/i2c/smiapp/smiapp-core.c
index 861312e..4d3dc25 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -240,7 +240,8 @@ static int smiapp_pll_configure(struct smiapp_sensor 
*sensor)
sensor, SMIAPP_REG_U16_OP_SYS_CLK_DIV, pll-op.sys_clk_div);
 }
 
-static int smiapp_pll_update(struct smiapp_sensor *sensor)
+static int smiapp_pll_try(struct smiapp_sensor *sensor,
+ struct smiapp_pll *pll)
 {
struct i2c_client *client = v4l2_get_subdevdata(sensor-src-sd);
struct smiapp_pll_limits lim = {
@@ -274,6 +275,12 @@ static int smiapp_pll_update(struct smiapp_sensor *sensor)
.min_line_length_pck_bin = 
sensor-limits[SMIAPP_LIMIT_MIN_LINE_LENGTH_PCK_BIN],
.min_line_length_pck = 
sensor-limits[SMIAPP_LIMIT_MIN_LINE_LENGTH_PCK],
};
+
+   return smiapp_pll_calculate(client-dev, lim, pll);
+}
+
+static int smiapp_pll_update(struct smiapp_sensor *sensor)
+{
struct smiapp_pll *pll = sensor-pll;
int rval;
 
@@ -284,7 +291,7 @@ static int smiapp_pll_update(struct smiapp_sensor *sensor)
pll-scale_m = sensor-scale_m;
pll-bits_per_pixel = sensor-csi_format-compressed;
 
-   rval = smiapp_pll_calculate(client-dev, lim, pll);
+   rval = smiapp_pll_try(sensor, pll);
if (rval  0)
return rval;
 
-- 
1.7.10.4

--
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 04/18] smiapp-pll: Separate bounds checking into a separate function

2014-10-02 Thread Sakari Ailus
From: Sakari Ailus sakari.ai...@linux.intel.com

Enough work for this function already.

Signed-off-by: Sakari Ailus sakari.ai...@linux.intel.com
---
 drivers/media/i2c/smiapp-pll.c |  110 +---
 1 file changed, 59 insertions(+), 51 deletions(-)

diff --git a/drivers/media/i2c/smiapp-pll.c b/drivers/media/i2c/smiapp-pll.c
index d14af5c..bde8eb8 100644
--- a/drivers/media/i2c/smiapp-pll.c
+++ b/drivers/media/i2c/smiapp-pll.c
@@ -87,6 +87,64 @@ static void print_pll(struct device *dev, struct smiapp_pll 
*pll)
dev_dbg(dev, vt_pix_clk_freq_hz \t%u\n, pll-vt_pix_clk_freq_hz);
 }
 
+static int check_all_bounds(struct device *dev,
+   const struct smiapp_pll_limits *limits,
+   struct smiapp_pll *pll)
+{
+   int rval;
+
+   rval = bounds_check(dev, pll-pll_ip_clk_freq_hz,
+   limits-min_pll_ip_freq_hz,
+   limits-max_pll_ip_freq_hz,
+   pll_ip_clk_freq_hz);
+   if (!rval)
+   rval = bounds_check(
+   dev, pll-pll_multiplier,
+   limits-min_pll_multiplier, limits-max_pll_multiplier,
+   pll_multiplier);
+   if (!rval)
+   rval = bounds_check(
+   dev, pll-pll_op_clk_freq_hz,
+   limits-min_pll_op_freq_hz, limits-max_pll_op_freq_hz,
+   pll_op_clk_freq_hz);
+   if (!rval)
+   rval = bounds_check(
+   dev, pll-op_sys_clk_div,
+   limits-op.min_sys_clk_div, limits-op.max_sys_clk_div,
+   op_sys_clk_div);
+   if (!rval)
+   rval = bounds_check(
+   dev, pll-op_pix_clk_div,
+   limits-op.min_pix_clk_div, limits-op.max_pix_clk_div,
+   op_pix_clk_div);
+   if (!rval)
+   rval = bounds_check(
+   dev, pll-op_sys_clk_freq_hz,
+   limits-op.min_sys_clk_freq_hz,
+   limits-op.max_sys_clk_freq_hz,
+   op_sys_clk_freq_hz);
+   if (!rval)
+   rval = bounds_check(
+   dev, pll-op_pix_clk_freq_hz,
+   limits-op.min_pix_clk_freq_hz,
+   limits-op.max_pix_clk_freq_hz,
+   op_pix_clk_freq_hz);
+   if (!rval)
+   rval = bounds_check(
+   dev, pll-vt_sys_clk_freq_hz,
+   limits-vt.min_sys_clk_freq_hz,
+   limits-vt.max_sys_clk_freq_hz,
+   vt_sys_clk_freq_hz);
+   if (!rval)
+   rval = bounds_check(
+   dev, pll-vt_pix_clk_freq_hz,
+   limits-vt.min_pix_clk_freq_hz,
+   limits-vt.max_pix_clk_freq_hz,
+   vt_pix_clk_freq_hz);
+
+   return rval;
+}
+
 /*
  * Heuristically guess the PLL tree for a given common multiplier and
  * divisor. Begin with the operational timing and continue to video
@@ -117,7 +175,6 @@ static int __smiapp_pll_calculate(struct device *dev,
uint32_t min_vt_div, max_vt_div, vt_div;
uint32_t min_sys_div, max_sys_div;
unsigned int i;
-   int rval;
 
/*
 * Get pre_pll_clk_div so that our pll_op_clk_freq_hz won't be
@@ -323,56 +380,7 @@ static int __smiapp_pll_calculate(struct device *dev,
pll-pixel_rate_csi =
pll-op_pix_clk_freq_hz * lane_op_clock_ratio;
 
-   rval = bounds_check(dev, pll-pll_ip_clk_freq_hz,
-   limits-min_pll_ip_freq_hz,
-   limits-max_pll_ip_freq_hz,
-   pll_ip_clk_freq_hz);
-   if (!rval)
-   rval = bounds_check(
-   dev, pll-pll_multiplier,
-   limits-min_pll_multiplier, limits-max_pll_multiplier,
-   pll_multiplier);
-   if (!rval)
-   rval = bounds_check(
-   dev, pll-pll_op_clk_freq_hz,
-   limits-min_pll_op_freq_hz, limits-max_pll_op_freq_hz,
-   pll_op_clk_freq_hz);
-   if (!rval)
-   rval = bounds_check(
-   dev, pll-op_sys_clk_div,
-   limits-op.min_sys_clk_div, limits-op.max_sys_clk_div,
-   op_sys_clk_div);
-   if (!rval)
-   rval = bounds_check(
-   dev, pll-op_pix_clk_div,
-   limits-op.min_pix_clk_div, limits-op.max_pix_clk_div,
-   op_pix_clk_div);
-   if (!rval)
-   rval = bounds_check(
-   dev, pll-op_sys_clk_freq_hz,
-   limits-op.min_sys_clk_freq_hz,
-   limits-op.max_sys_clk_freq_hz,
-   

[PATCH v2 06/18] smiapp-pll: Unify OP and VT PLL structs

2014-10-02 Thread Sakari Ailus
From: Sakari Ailus sakari.ai...@linux.intel.com

Uniform representation for VT and OP clocks. This is preparation for
calculating the VT clocks using the OP clock code.

Signed-off-by: Sakari Ailus sakari.ai...@linux.intel.com
---
 drivers/media/i2c/smiapp-pll.c |   60 
 drivers/media/i2c/smiapp-pll.h |   18 +-
 drivers/media/i2c/smiapp/smiapp-core.c |   14 
 3 files changed, 46 insertions(+), 46 deletions(-)

diff --git a/drivers/media/i2c/smiapp-pll.c b/drivers/media/i2c/smiapp-pll.c
index bde8eb8..40a18ba 100644
--- a/drivers/media/i2c/smiapp-pll.c
+++ b/drivers/media/i2c/smiapp-pll.c
@@ -68,23 +68,23 @@ static void print_pll(struct device *dev, struct smiapp_pll 
*pll)
dev_dbg(dev, pre_pll_clk_div\t%u\n,  pll-pre_pll_clk_div);
dev_dbg(dev, pll_multiplier \t%u\n,  pll-pll_multiplier);
if (!(pll-flags  SMIAPP_PLL_FLAG_NO_OP_CLOCKS)) {
-   dev_dbg(dev, op_sys_clk_div \t%u\n, pll-op_sys_clk_div);
-   dev_dbg(dev, op_pix_clk_div \t%u\n, pll-op_pix_clk_div);
+   dev_dbg(dev, op_sys_clk_div \t%u\n, pll-op.sys_clk_div);
+   dev_dbg(dev, op_pix_clk_div \t%u\n, pll-op.pix_clk_div);
}
-   dev_dbg(dev, vt_sys_clk_div \t%u\n,  pll-vt_sys_clk_div);
-   dev_dbg(dev, vt_pix_clk_div \t%u\n,  pll-vt_pix_clk_div);
+   dev_dbg(dev, vt_sys_clk_div \t%u\n,  pll-vt.sys_clk_div);
+   dev_dbg(dev, vt_pix_clk_div \t%u\n,  pll-vt.pix_clk_div);
 
dev_dbg(dev, ext_clk_freq_hz \t%u\n, pll-ext_clk_freq_hz);
dev_dbg(dev, pll_ip_clk_freq_hz \t%u\n, pll-pll_ip_clk_freq_hz);
dev_dbg(dev, pll_op_clk_freq_hz \t%u\n, pll-pll_op_clk_freq_hz);
if (!(pll-flags  SMIAPP_PLL_FLAG_NO_OP_CLOCKS)) {
dev_dbg(dev, op_sys_clk_freq_hz \t%u\n,
-   pll-op_sys_clk_freq_hz);
+   pll-op.sys_clk_freq_hz);
dev_dbg(dev, op_pix_clk_freq_hz \t%u\n,
-   pll-op_pix_clk_freq_hz);
+   pll-op.pix_clk_freq_hz);
}
-   dev_dbg(dev, vt_sys_clk_freq_hz \t%u\n, pll-vt_sys_clk_freq_hz);
-   dev_dbg(dev, vt_pix_clk_freq_hz \t%u\n, pll-vt_pix_clk_freq_hz);
+   dev_dbg(dev, vt_sys_clk_freq_hz \t%u\n, pll-vt.sys_clk_freq_hz);
+   dev_dbg(dev, vt_pix_clk_freq_hz \t%u\n, pll-vt.pix_clk_freq_hz);
 }
 
 static int check_all_bounds(struct device *dev,
@@ -109,35 +109,35 @@ static int check_all_bounds(struct device *dev,
pll_op_clk_freq_hz);
if (!rval)
rval = bounds_check(
-   dev, pll-op_sys_clk_div,
+   dev, pll-op.sys_clk_div,
limits-op.min_sys_clk_div, limits-op.max_sys_clk_div,
op_sys_clk_div);
if (!rval)
rval = bounds_check(
-   dev, pll-op_pix_clk_div,
+   dev, pll-op.pix_clk_div,
limits-op.min_pix_clk_div, limits-op.max_pix_clk_div,
op_pix_clk_div);
if (!rval)
rval = bounds_check(
-   dev, pll-op_sys_clk_freq_hz,
+   dev, pll-op.sys_clk_freq_hz,
limits-op.min_sys_clk_freq_hz,
limits-op.max_sys_clk_freq_hz,
op_sys_clk_freq_hz);
if (!rval)
rval = bounds_check(
-   dev, pll-op_pix_clk_freq_hz,
+   dev, pll-op.pix_clk_freq_hz,
limits-op.min_pix_clk_freq_hz,
limits-op.max_pix_clk_freq_hz,
op_pix_clk_freq_hz);
if (!rval)
rval = bounds_check(
-   dev, pll-vt_sys_clk_freq_hz,
+   dev, pll-vt.sys_clk_freq_hz,
limits-vt.min_sys_clk_freq_hz,
limits-vt.max_sys_clk_freq_hz,
vt_sys_clk_freq_hz);
if (!rval)
rval = bounds_check(
-   dev, pll-vt_pix_clk_freq_hz,
+   dev, pll-vt.pix_clk_freq_hz,
limits-vt.min_pix_clk_freq_hz,
limits-vt.max_pix_clk_freq_hz,
vt_pix_clk_freq_hz);
@@ -240,8 +240,8 @@ static int __smiapp_pll_calculate(struct device *dev,
}
 
pll-pll_multiplier = mul * i;
-   pll-op_sys_clk_div = div * i / pll-pre_pll_clk_div;
-   dev_dbg(dev, op_sys_clk_div: %u\n, pll-op_sys_clk_div);
+   pll-op.sys_clk_div = div * i / pll-pre_pll_clk_div;
+   dev_dbg(dev, op_sys_clk_div: %u\n, pll-op.sys_clk_div);
 
pll-pll_ip_clk_freq_hz = pll-ext_clk_freq_hz
/ pll-pre_pll_clk_div;
@@ -250,14 +250,14 @@ static int __smiapp_pll_calculate(struct device *dev,
* pll-pll_multiplier;
 
/* Derive pll_op_clk_freq_hz. */
-  

[PATCH v2 07/18] smiapp-pll: Calculate OP clocks only for sensors that have them

2014-10-02 Thread Sakari Ailus
From: Sakari Ailus sakari.ai...@linux.intel.com

Profile 0 sensors have no OP clock branck in the clock tree. The PLL
calculator still calculated them, they just weren't used for anything.

Signed-off-by: Sakari Ailus sakari.ai...@linux.intel.com
---
 drivers/media/i2c/smiapp-pll.c |   82 +---
 1 file changed, 52 insertions(+), 30 deletions(-)

diff --git a/drivers/media/i2c/smiapp-pll.c b/drivers/media/i2c/smiapp-pll.c
index 40a18ba..cac1407 100644
--- a/drivers/media/i2c/smiapp-pll.c
+++ b/drivers/media/i2c/smiapp-pll.c
@@ -89,7 +89,9 @@ static void print_pll(struct device *dev, struct smiapp_pll 
*pll)
 
 static int check_all_bounds(struct device *dev,
const struct smiapp_pll_limits *limits,
-   struct smiapp_pll *pll)
+   const struct smiapp_pll_branch_limits *op_limits,
+   struct smiapp_pll *pll,
+   struct smiapp_pll_branch *op_pll)
 {
int rval;
 
@@ -109,25 +111,25 @@ static int check_all_bounds(struct device *dev,
pll_op_clk_freq_hz);
if (!rval)
rval = bounds_check(
-   dev, pll-op.sys_clk_div,
-   limits-op.min_sys_clk_div, limits-op.max_sys_clk_div,
+   dev, op_pll-sys_clk_div,
+   op_limits-min_sys_clk_div, op_limits-max_sys_clk_div,
op_sys_clk_div);
if (!rval)
rval = bounds_check(
-   dev, pll-op.pix_clk_div,
-   limits-op.min_pix_clk_div, limits-op.max_pix_clk_div,
+   dev, op_pll-pix_clk_div,
+   op_limits-min_pix_clk_div, op_limits-max_pix_clk_div,
op_pix_clk_div);
if (!rval)
rval = bounds_check(
-   dev, pll-op.sys_clk_freq_hz,
-   limits-op.min_sys_clk_freq_hz,
-   limits-op.max_sys_clk_freq_hz,
+   dev, op_pll-sys_clk_freq_hz,
+   op_limits-min_sys_clk_freq_hz,
+   op_limits-max_sys_clk_freq_hz,
op_sys_clk_freq_hz);
if (!rval)
rval = bounds_check(
-   dev, pll-op.pix_clk_freq_hz,
-   limits-op.min_pix_clk_freq_hz,
-   limits-op.max_pix_clk_freq_hz,
+   dev, op_pll-pix_clk_freq_hz,
+   op_limits-min_pix_clk_freq_hz,
+   op_limits-max_pix_clk_freq_hz,
op_pix_clk_freq_hz);
if (!rval)
rval = bounds_check(
@@ -156,10 +158,11 @@ static int check_all_bounds(struct device *dev,
  *
  * @return Zero on success, error code on error.
  */
-static int __smiapp_pll_calculate(struct device *dev,
- const struct smiapp_pll_limits *limits,
- struct smiapp_pll *pll, uint32_t mul,
- uint32_t div, uint32_t lane_op_clock_ratio)
+static int __smiapp_pll_calculate(
+   struct device *dev, const struct smiapp_pll_limits *limits,
+   const struct smiapp_pll_branch_limits *op_limits,
+   struct smiapp_pll *pll, struct smiapp_pll_branch *op_pll, uint32_t mul,
+   uint32_t div, uint32_t lane_op_clock_ratio)
 {
uint32_t sys_div;
uint32_t best_pix_div = INT_MAX  1;
@@ -196,7 +199,7 @@ static int __smiapp_pll_calculate(struct device *dev,
more_mul_max);
/* Don't go above the division capability of op sys clock divider. */
more_mul_max = min(more_mul_max,
-  limits-op.max_sys_clk_div * pll-pre_pll_clk_div
+  op_limits-max_sys_clk_div * pll-pre_pll_clk_div
   / div);
dev_dbg(dev, more_mul_max: max_op_sys_clk_div check: %u\n,
more_mul_max);
@@ -226,8 +229,8 @@ static int __smiapp_pll_calculate(struct device *dev,
 
more_mul_factor = lcm(div, pll-pre_pll_clk_div) / div;
dev_dbg(dev, more_mul_factor: %u\n, more_mul_factor);
-   more_mul_factor = lcm(more_mul_factor, limits-op.min_sys_clk_div);
-   dev_dbg(dev, more_mul_factor: min_op_sys_clk_div: %u\n,
+   more_mul_factor = lcm(more_mul_factor, op_limits-min_sys_clk_div);
+   dev_dbg(dev, more_mul_factor: min_op_sys_clk_div: %d\n,
more_mul_factor);
i = roundup(more_mul_min, more_mul_factor);
if (!is_one_or_even(i))
@@ -240,8 +243,8 @@ static int __smiapp_pll_calculate(struct device *dev,
}
 
pll-pll_multiplier = mul * i;
-   pll-op.sys_clk_div = div * i / pll-pre_pll_clk_div;
-   dev_dbg(dev, op_sys_clk_div: %u\n, pll-op.sys_clk_div);
+   op_pll-sys_clk_div = div * i / pll-pre_pll_clk_div;
+   dev_dbg(dev, op_sys_clk_div: %u\n, 

[PATCH v2 05/18] smiapp-pll: External clock frequency isn't an output value

2014-10-02 Thread Sakari Ailus
From: Sakari Ailus sakari.ai...@linux.intel.com

It's input. Move it elsewhere in the struct.

Signed-off-by: Sakari Ailus sakari.ai...@linux.intel.com
---
 drivers/media/i2c/smiapp-pll.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/smiapp-pll.h b/drivers/media/i2c/smiapp-pll.h
index 5ce2b61..2885cd7 100644
--- a/drivers/media/i2c/smiapp-pll.h
+++ b/drivers/media/i2c/smiapp-pll.h
@@ -53,6 +53,7 @@ struct smiapp_pll {
uint8_t scale_n;
uint8_t bits_per_pixel;
uint32_t link_freq;
+   uint32_t ext_clk_freq_hz;
 
/* output values */
uint16_t pre_pll_clk_div;
@@ -62,7 +63,6 @@ struct smiapp_pll {
uint16_t vt_sys_clk_div;
uint16_t vt_pix_clk_div;
 
-   uint32_t ext_clk_freq_hz;
uint32_t pll_ip_clk_freq_hz;
uint32_t pll_op_clk_freq_hz;
uint32_t op_sys_clk_freq_hz;
-- 
1.7.10.4

--
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/18] smiapp: The PLL calculator handles sensors with VT clocks only

2014-10-02 Thread Sakari Ailus
From: Sakari Ailus sakari.ai...@linux.intel.com

No need to pretend the OP limits are there anymore.

Signed-off-by: Sakari Ailus sakari.ai...@linux.intel.com
---
 drivers/media/i2c/smiapp/smiapp-core.c |   10 --
 1 file changed, 10 deletions(-)

diff --git a/drivers/media/i2c/smiapp/smiapp-core.c 
b/drivers/media/i2c/smiapp/smiapp-core.c
index 389e775..d0ea7a3 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -277,16 +277,6 @@ static int smiapp_pll_update(struct smiapp_sensor *sensor)
struct smiapp_pll *pll = sensor-pll;
int rval;
 
-   if (sensor-minfo.smiapp_profile == SMIAPP_PROFILE_0) {
-   /*
-* Fill in operational clock divisors limits from the
-* video timing ones. On profile 0 sensors the
-* requirements regarding them are essentially the
-* same as on VT ones.
-*/
-   lim.op = lim.vt;
-   }
-
pll-binning_horizontal = sensor-binning_horizontal;
pll-binning_vertical = sensor-binning_vertical;
pll-link_freq =
-- 
1.7.10.4

--
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 08/18] smiapp-pll: Don't validate OP clocks if there are none

2014-10-02 Thread Sakari Ailus
From: Sakari Ailus sakari.ai...@linux.intel.com

For profile 0 sensors (which have no OP clocks), the OP limits are in fact
VT limits. Do not verify them again.

Signed-off-by: Sakari Ailus sakari.ai...@linux.intel.com
---
 drivers/media/i2c/smiapp-pll.c |8 
 1 file changed, 8 insertions(+)

diff --git a/drivers/media/i2c/smiapp-pll.c b/drivers/media/i2c/smiapp-pll.c
index cac1407..862ca0c 100644
--- a/drivers/media/i2c/smiapp-pll.c
+++ b/drivers/media/i2c/smiapp-pll.c
@@ -131,6 +131,14 @@ static int check_all_bounds(struct device *dev,
op_limits-min_pix_clk_freq_hz,
op_limits-max_pix_clk_freq_hz,
op_pix_clk_freq_hz);
+
+   /*
+* If there are no OP clocks, the VT clocks are contained in
+* the OP clock struct.
+*/
+   if (pll-flags  SMIAPP_PLL_FLAG_NO_OP_CLOCKS)
+   return rval;
+
if (!rval)
rval = bounds_check(
dev, pll-vt.sys_clk_freq_hz,
-- 
1.7.10.4

--
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 18/18] smiapp: Update PLL when setting format

2014-10-02 Thread Sakari Ailus
The media bus format BPP does affect PLL. Recalculate PLL if the format
changes.

Signed-off-by: Sakari Ailus sakari.ai...@linux.intel.com
---
 drivers/media/i2c/smiapp/smiapp-core.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/smiapp/smiapp-core.c 
b/drivers/media/i2c/smiapp/smiapp-core.c
index 87d4d5a..c938778 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -1776,7 +1776,7 @@ static int smiapp_set_format_source(struct v4l2_subdev 
*subdev,
__fls(*valid_link_freqs), ~*valid_link_freqs,
__ffs(*valid_link_freqs));
 
-   return 0;
+   return smiapp_pll_update(sensor);
 }
 
 static int smiapp_set_format(struct v4l2_subdev *subdev,
-- 
1.7.10.4

--
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 12/18] smiapp: Use actual pixel rate calculated by the PLL calculator

2014-10-02 Thread Sakari Ailus
From: Sakari Ailus sakari.ai...@linux.intel.com

Signed-off-by: Sakari Ailus sakari.ai...@linux.intel.com
---
 drivers/media/i2c/smiapp/smiapp-core.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/smiapp/smiapp-core.c 
b/drivers/media/i2c/smiapp/smiapp-core.c
index d0ea7a3..861312e 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -289,7 +289,7 @@ static int smiapp_pll_update(struct smiapp_sensor *sensor)
return rval;
 
__v4l2_ctrl_s_ctrl_int64(sensor-pixel_rate_parray,
-pll-vt.pix_clk_freq_hz);
+pll-pixel_rate_pixel_array);
__v4l2_ctrl_s_ctrl_int64(sensor-pixel_rate_csi, pll-pixel_rate_csi);
 
return 0;
@@ -894,7 +894,7 @@ static int smiapp_update_mode(struct smiapp_sensor *sensor)
dev_dbg(client-dev, hblank\t\t%d\n, sensor-hblank-val);
 
dev_dbg(client-dev, real timeperframe\t100/%d\n,
-   sensor-pll.vt.pix_clk_freq_hz /
+   sensor-pll.pixel_rate_pixel_array /
((sensor-pixel_array-crop[SMIAPP_PA_PAD_SRC].width
  + sensor-hblank-val) *
 (sensor-pixel_array-crop[SMIAPP_PA_PAD_SRC].height
-- 
1.7.10.4

--
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 01/18] smiapp: Take mutex during PLL update in sensor initialisation

2014-10-02 Thread Sakari Ailus
From: Sakari Ailus sakari.ai...@linux.intel.com

The mutex does not serialise anything in this case but avoids a lockdep
warning from the control framework.

Signed-off-by: Sakari Ailus sakari.ai...@linux.intel.com
---
 drivers/media/i2c/smiapp/smiapp-core.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/i2c/smiapp/smiapp-core.c 
b/drivers/media/i2c/smiapp/smiapp-core.c
index 932ed9b..6174a59 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -2677,7 +2677,9 @@ static int smiapp_registered(struct v4l2_subdev *subdev)
pll-flags |= SMIAPP_PLL_FLAG_NO_OP_CLOCKS;
pll-scale_n = sensor-limits[SMIAPP_LIMIT_SCALER_N_MIN];
 
+   mutex_lock(sensor-mutex);
rval = smiapp_update_mode(sensor);
+   mutex_unlock(sensor-mutex);
if (rval) {
dev_err(client-dev, update mode failed\n);
goto out_nvm_release;
-- 
1.7.10.4

--
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 02/18] smiapp-pll: Correct clock debug prints

2014-10-02 Thread Sakari Ailus
From: Sakari Ailus sakari.ai...@linux.intel.com

The PLL flags were not used correctly.

Signed-off-by: Sakari Ailus sakari.ai...@linux.intel.com
---
 drivers/media/i2c/smiapp-pll.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/smiapp-pll.c b/drivers/media/i2c/smiapp-pll.c
index 2335529..ab5d9a3 100644
--- a/drivers/media/i2c/smiapp-pll.c
+++ b/drivers/media/i2c/smiapp-pll.c
@@ -67,7 +67,7 @@ static void print_pll(struct device *dev, struct smiapp_pll 
*pll)
 {
dev_dbg(dev, pre_pll_clk_div\t%d\n,  pll-pre_pll_clk_div);
dev_dbg(dev, pll_multiplier \t%d\n,  pll-pll_multiplier);
-   if (pll-flags != SMIAPP_PLL_FLAG_NO_OP_CLOCKS) {
+   if (!(pll-flags  SMIAPP_PLL_FLAG_NO_OP_CLOCKS)) {
dev_dbg(dev, op_sys_clk_div \t%d\n, pll-op_sys_clk_div);
dev_dbg(dev, op_pix_clk_div \t%d\n, pll-op_pix_clk_div);
}
@@ -77,7 +77,7 @@ static void print_pll(struct device *dev, struct smiapp_pll 
*pll)
dev_dbg(dev, ext_clk_freq_hz \t%d\n, pll-ext_clk_freq_hz);
dev_dbg(dev, pll_ip_clk_freq_hz \t%d\n, pll-pll_ip_clk_freq_hz);
dev_dbg(dev, pll_op_clk_freq_hz \t%d\n, pll-pll_op_clk_freq_hz);
-   if (pll-flags  SMIAPP_PLL_FLAG_NO_OP_CLOCKS) {
+   if (!(pll-flags  SMIAPP_PLL_FLAG_NO_OP_CLOCKS)) {
dev_dbg(dev, op_sys_clk_freq_hz \t%d\n,
pll-op_sys_clk_freq_hz);
dev_dbg(dev, op_pix_clk_freq_hz \t%d\n,
-- 
1.7.10.4

--
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] smiapp and smiapp-pll: more robust parameter handling, cleanups

2014-10-02 Thread Sakari Ailus
Hi,

This is an update of my previous set of smiapp PLL improvements.

The previous set can be found here:

URL:http://www.spinics.net/lists/linux-media/msg80864.html

Changes since v1:

- smiapp: Clean up smiapp_set_format() has been added to the set.

- smiapp: Decrease link frequency if media bus pixel format BPP
  requires is no longer needed since the control framework handles
  validation of the menu items (based on the mask supplied by the driver).

- A bug in the loop condition in smiapp: Gather information on valid link
  rate and BPP combinations has been fixed. In the same patch, fixed use of
  a non-existent label.

- Print available link frequencies using dev_dbg() rather than dev_info().

-- 
Kind regards,
Sakari
--
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 17/18] smiapp: Set valid link frequency range

2014-10-02 Thread Sakari Ailus
Set supported link frequencies in the menu in control initialisation and
when the bpp changes.

Signed-off-by: Sakari Ailus sakari.ai...@linux.intel.com
---
 drivers/media/i2c/smiapp/smiapp-core.c |   19 +--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/smiapp/smiapp-core.c 
b/drivers/media/i2c/smiapp/smiapp-core.c
index cf8eba8..87d4d5a 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -523,6 +523,8 @@ static const struct v4l2_ctrl_ops smiapp_ctrl_ops = {
 static int smiapp_init_controls(struct smiapp_sensor *sensor)
 {
struct i2c_client *client = v4l2_get_subdevdata(sensor-src-sd);
+   unsigned long *valid_link_freqs = sensor-valid_link_freqs[
+   sensor-csi_format-compressed - SMIAPP_COMPRESSED_BASE];
unsigned int max, i;
int rval;
 
@@ -605,8 +607,8 @@ static int smiapp_init_controls(struct smiapp_sensor 
*sensor)
 
sensor-link_freq = v4l2_ctrl_new_int_menu(
sensor-src-ctrl_handler, smiapp_ctrl_ops,
-   V4L2_CID_LINK_FREQ, max, 0,
-   sensor-platform_data-op_sys_clock);
+   V4L2_CID_LINK_FREQ, __fls(*valid_link_freqs),
+   __ffs(*valid_link_freqs), sensor-platform_data-op_sys_clock);
 
sensor-pixel_rate_csi = v4l2_ctrl_new_std(
sensor-src-ctrl_handler, smiapp_ctrl_ops,
@@ -1735,6 +1737,7 @@ static int smiapp_set_format_source(struct v4l2_subdev 
*subdev,
struct smiapp_sensor *sensor = to_smiapp_sensor(subdev);
const struct smiapp_csi_data_format *csi_format,
*old_csi_format = sensor-csi_format;
+   unsigned long *valid_link_freqs;
u32 code = fmt-format.code;
unsigned int i;
int rval;
@@ -1761,6 +1764,18 @@ static int smiapp_set_format_source(struct v4l2_subdev 
*subdev,
sensor-test_data[i], 0,
(1  csi_format-width) - 1, 1, 0);
 
+   if (csi_format-compressed == old_csi_format-compressed)
+   return 0;
+
+   valid_link_freqs = 
+   sensor-valid_link_freqs[sensor-csi_format-compressed
+ - SMIAPP_COMPRESSED_BASE];
+
+   __v4l2_ctrl_modify_range(
+   sensor-link_freq, 0,
+   __fls(*valid_link_freqs), ~*valid_link_freqs,
+   __ffs(*valid_link_freqs));
+
return 0;
 }
 
-- 
1.7.10.4

--
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 16/18] smiapp: Clean up smiapp_set_format()

2014-10-02 Thread Sakari Ailus
smiapp_set_format() has accumulated a fair amount of changes without a
needed refactoring, do the cleanup now. There's also an unlocked version of
v4l2_ctrl_range_changed(), using that fixes a small serialisation issue with
the user space interface.

Signed-off-by: Sakari Ailus sakari.ai...@linux.intel.com
---
 drivers/media/i2c/smiapp/smiapp-core.c |   65 +++-
 1 file changed, 39 insertions(+), 26 deletions(-)

diff --git a/drivers/media/i2c/smiapp/smiapp-core.c 
b/drivers/media/i2c/smiapp/smiapp-core.c
index 926f60c..cf8eba8 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -1728,6 +1728,42 @@ static const struct smiapp_csi_data_format
return csi_format;
 }
 
+static int smiapp_set_format_source(struct v4l2_subdev *subdev,
+   struct v4l2_subdev_fh *fh,
+   struct v4l2_subdev_format *fmt)
+{
+   struct smiapp_sensor *sensor = to_smiapp_sensor(subdev);
+   const struct smiapp_csi_data_format *csi_format,
+   *old_csi_format = sensor-csi_format;
+   u32 code = fmt-format.code;
+   unsigned int i;
+   int rval;
+
+   rval = __smiapp_get_format(subdev, fh, fmt);
+   if (rval)
+   return rval;
+
+   if (subdev != sensor-src-sd)
+   return 0;
+
+   csi_format = smiapp_validate_csi_data_format(sensor, code);
+
+   fmt-format.code = csi_format-code;
+
+   if (fmt-which != V4L2_SUBDEV_FORMAT_ACTIVE)
+   return 0;
+
+   sensor-csi_format = csi_format;
+
+   if (csi_format-width != old_csi_format-width)
+   for (i = 0; i  ARRAY_SIZE(sensor-test_data); i++)
+   __v4l2_ctrl_modify_range(
+   sensor-test_data[i], 0,
+   (1  csi_format-width) - 1, 1, 0);
+
+   return 0;
+}
+
 static int smiapp_set_format(struct v4l2_subdev *subdev,
 struct v4l2_subdev_fh *fh,
 struct v4l2_subdev_format *fmt)
@@ -1743,36 +1779,13 @@ static int smiapp_set_format(struct v4l2_subdev *subdev,
 * other source pads we just get format here.
 */
if (fmt-pad == ssd-source_pad) {
-   u32 code = fmt-format.code;
-   int rval = __smiapp_get_format(subdev, fh, fmt);
-   bool range_changed = false;
-   unsigned int i;
-
-   if (!rval  subdev == sensor-src-sd) {
-   const struct smiapp_csi_data_format *csi_format =
-   smiapp_validate_csi_data_format(sensor, code);
+   int rval;
 
-   if (fmt-which == V4L2_SUBDEV_FORMAT_ACTIVE) {
-   if (csi_format-width !=
-   sensor-csi_format-width)
-   range_changed = true;
-
-   sensor-csi_format = csi_format;
-   }
-
-   fmt-format.code = csi_format-code;
-   }
+   rval = smiapp_set_format_source(subdev, fh, fmt);
 
mutex_unlock(sensor-mutex);
-   if (rval || !range_changed)
-   return rval;
-
-   for (i = 0; i  ARRAY_SIZE(sensor-test_data); i++)
-   v4l2_ctrl_modify_range(
-   sensor-test_data[i],
-   0, (1  sensor-csi_format-width) - 1, 1, 0);
 
-   return 0;
+   return rval;
}
 
/* Sink pad. Width and height are changeable here. */
-- 
1.7.10.4

--
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 10/18] smiapp: Remove validation of op_pix_clk_div

2014-10-02 Thread Sakari Ailus
From: Sakari Ailus sakari.ai...@linux.intel.com

op_pix_clk_div is directly assigned and not calculated. There's no need to
verify it.

Signed-off-by: Sakari Ailus sakari.ai...@linux.intel.com
---
 drivers/media/i2c/smiapp-pll.c |5 -
 1 file changed, 5 deletions(-)

diff --git a/drivers/media/i2c/smiapp-pll.c b/drivers/media/i2c/smiapp-pll.c
index 862ca0c..0d5c503 100644
--- a/drivers/media/i2c/smiapp-pll.c
+++ b/drivers/media/i2c/smiapp-pll.c
@@ -116,11 +116,6 @@ static int check_all_bounds(struct device *dev,
op_sys_clk_div);
if (!rval)
rval = bounds_check(
-   dev, op_pll-pix_clk_div,
-   op_limits-min_pix_clk_div, op_limits-max_pix_clk_div,
-   op_pix_clk_div);
-   if (!rval)
-   rval = bounds_check(
dev, op_pll-sys_clk_freq_hz,
op_limits-min_sys_clk_freq_hz,
op_limits-max_sys_clk_freq_hz,
-- 
1.7.10.4

--
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 15/18] smiapp: Take valid link frequencies into account in supported mbus codes

2014-10-02 Thread Sakari Ailus
Some media bus codes may be unavailable depending on the available media bus
codes.

Signed-off-by: Sakari Ailus sakari.ai...@linux.intel.com
---
 drivers/media/i2c/smiapp/smiapp-core.c |   24 
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/drivers/media/i2c/smiapp/smiapp-core.c 
b/drivers/media/i2c/smiapp/smiapp-core.c
index d65521a..926f60c 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -806,14 +806,6 @@ static int smiapp_get_mbus_formats(struct smiapp_sensor 
*sensor)
dev_dbg(client-dev, jolly good! %d\n, j);
 
sensor-default_mbus_frame_fmts |= 1  j;
-   if (!sensor-csi_format
-   || f-width  sensor-csi_format-width
-   || (f-width == sensor-csi_format-width
-f-compressed
-sensor-csi_format-compressed)) {
-   sensor-csi_format = f;
-   sensor-internal_csi_format = f;
-   }
}
}
 
@@ -850,6 +842,22 @@ static int smiapp_get_mbus_formats(struct smiapp_sensor 
*sensor)
 
set_bit(j, valid_link_freqs);
}
+
+   if (!*valid_link_freqs) {
+   dev_info(client-dev,
+no valid link frequencies for %u bpp\n,
+f-compressed);
+   sensor-default_mbus_frame_fmts = ~BIT(i);
+   continue;
+   }
+
+   if (!sensor-csi_format
+   || f-width  sensor-csi_format-width
+   || (f-width == sensor-csi_format-width
+f-compressed  sensor-csi_format-compressed)) {
+   sensor-csi_format = f;
+   sensor-internal_csi_format = f;
+   }
}
 
if (!sensor-csi_format) {
-- 
1.7.10.4

--
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 03/18] smiapp-pll: The clock tree values are unsigned --- fix debug prints

2014-10-02 Thread Sakari Ailus
From: Sakari Ailus sakari.ai...@linux.intel.com

These values are unsigned, so use %u instead of %d.

Signed-off-by: Sakari Ailus sakari.ai...@linux.intel.com
---
 drivers/media/i2c/smiapp-pll.c |   94 
 1 file changed, 47 insertions(+), 47 deletions(-)

diff --git a/drivers/media/i2c/smiapp-pll.c b/drivers/media/i2c/smiapp-pll.c
index ab5d9a3..d14af5c 100644
--- a/drivers/media/i2c/smiapp-pll.c
+++ b/drivers/media/i2c/smiapp-pll.c
@@ -65,26 +65,26 @@ static int bounds_check(struct device *dev, uint32_t val,
 
 static void print_pll(struct device *dev, struct smiapp_pll *pll)
 {
-   dev_dbg(dev, pre_pll_clk_div\t%d\n,  pll-pre_pll_clk_div);
-   dev_dbg(dev, pll_multiplier \t%d\n,  pll-pll_multiplier);
+   dev_dbg(dev, pre_pll_clk_div\t%u\n,  pll-pre_pll_clk_div);
+   dev_dbg(dev, pll_multiplier \t%u\n,  pll-pll_multiplier);
if (!(pll-flags  SMIAPP_PLL_FLAG_NO_OP_CLOCKS)) {
-   dev_dbg(dev, op_sys_clk_div \t%d\n, pll-op_sys_clk_div);
-   dev_dbg(dev, op_pix_clk_div \t%d\n, pll-op_pix_clk_div);
+   dev_dbg(dev, op_sys_clk_div \t%u\n, pll-op_sys_clk_div);
+   dev_dbg(dev, op_pix_clk_div \t%u\n, pll-op_pix_clk_div);
}
-   dev_dbg(dev, vt_sys_clk_div \t%d\n,  pll-vt_sys_clk_div);
-   dev_dbg(dev, vt_pix_clk_div \t%d\n,  pll-vt_pix_clk_div);
+   dev_dbg(dev, vt_sys_clk_div \t%u\n,  pll-vt_sys_clk_div);
+   dev_dbg(dev, vt_pix_clk_div \t%u\n,  pll-vt_pix_clk_div);
 
-   dev_dbg(dev, ext_clk_freq_hz \t%d\n, pll-ext_clk_freq_hz);
-   dev_dbg(dev, pll_ip_clk_freq_hz \t%d\n, pll-pll_ip_clk_freq_hz);
-   dev_dbg(dev, pll_op_clk_freq_hz \t%d\n, pll-pll_op_clk_freq_hz);
+   dev_dbg(dev, ext_clk_freq_hz \t%u\n, pll-ext_clk_freq_hz);
+   dev_dbg(dev, pll_ip_clk_freq_hz \t%u\n, pll-pll_ip_clk_freq_hz);
+   dev_dbg(dev, pll_op_clk_freq_hz \t%u\n, pll-pll_op_clk_freq_hz);
if (!(pll-flags  SMIAPP_PLL_FLAG_NO_OP_CLOCKS)) {
-   dev_dbg(dev, op_sys_clk_freq_hz \t%d\n,
+   dev_dbg(dev, op_sys_clk_freq_hz \t%u\n,
pll-op_sys_clk_freq_hz);
-   dev_dbg(dev, op_pix_clk_freq_hz \t%d\n,
+   dev_dbg(dev, op_pix_clk_freq_hz \t%u\n,
pll-op_pix_clk_freq_hz);
}
-   dev_dbg(dev, vt_sys_clk_freq_hz \t%d\n, pll-vt_sys_clk_freq_hz);
-   dev_dbg(dev, vt_pix_clk_freq_hz \t%d\n, pll-vt_pix_clk_freq_hz);
+   dev_dbg(dev, vt_sys_clk_freq_hz \t%u\n, pll-vt_sys_clk_freq_hz);
+   dev_dbg(dev, vt_pix_clk_freq_hz \t%u\n, pll-vt_pix_clk_freq_hz);
 }
 
 /*
@@ -123,11 +123,11 @@ static int __smiapp_pll_calculate(struct device *dev,
 * Get pre_pll_clk_div so that our pll_op_clk_freq_hz won't be
 * too high.
 */
-   dev_dbg(dev, pre_pll_clk_div %d\n, pll-pre_pll_clk_div);
+   dev_dbg(dev, pre_pll_clk_div %u\n, pll-pre_pll_clk_div);
 
/* Don't go above max pll multiplier. */
more_mul_max = limits-max_pll_multiplier / mul;
-   dev_dbg(dev, more_mul_max: max_pll_multiplier check: %d\n,
+   dev_dbg(dev, more_mul_max: max_pll_multiplier check: %u\n,
more_mul_max);
/* Don't go above max pll op frequency. */
more_mul_max =
@@ -135,30 +135,30 @@ static int __smiapp_pll_calculate(struct device *dev,
  more_mul_max,
  limits-max_pll_op_freq_hz
  / (pll-ext_clk_freq_hz / pll-pre_pll_clk_div * mul));
-   dev_dbg(dev, more_mul_max: max_pll_op_freq_hz check: %d\n,
+   dev_dbg(dev, more_mul_max: max_pll_op_freq_hz check: %u\n,
more_mul_max);
/* Don't go above the division capability of op sys clock divider. */
more_mul_max = min(more_mul_max,
   limits-op.max_sys_clk_div * pll-pre_pll_clk_div
   / div);
-   dev_dbg(dev, more_mul_max: max_op_sys_clk_div check: %d\n,
+   dev_dbg(dev, more_mul_max: max_op_sys_clk_div check: %u\n,
more_mul_max);
/* Ensure we won't go above min_pll_multiplier. */
more_mul_max = min(more_mul_max,
   DIV_ROUND_UP(limits-max_pll_multiplier, mul));
-   dev_dbg(dev, more_mul_max: min_pll_multiplier check: %d\n,
+   dev_dbg(dev, more_mul_max: min_pll_multiplier check: %u\n,
more_mul_max);
 
/* Ensure we won't go below min_pll_op_freq_hz. */
more_mul_min = DIV_ROUND_UP(limits-min_pll_op_freq_hz,
pll-ext_clk_freq_hz / pll-pre_pll_clk_div
* mul);
-   dev_dbg(dev, more_mul_min: min_pll_op_freq_hz check: %d\n,
+   dev_dbg(dev, more_mul_min: min_pll_op_freq_hz check: %u\n,
more_mul_min);
/* Ensure we won't go below min_pll_multiplier. */
more_mul_min = max(more_mul_min,
   

[PATCH v2 11/18] smiapp-pll: Add pixel rate in pixel array as output parameters

2014-10-02 Thread Sakari Ailus
From: Sakari Ailus sakari.ai...@linux.intel.com

The actual pixel array pixel rate may be something else than vt_pix_clk_freq
on some implementations. Add a new field which contains the corrected value.

Signed-off-by: Sakari Ailus sakari.ai...@linux.intel.com
---
 drivers/media/i2c/smiapp-pll.c |1 +
 drivers/media/i2c/smiapp-pll.h |1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/media/i2c/smiapp-pll.c b/drivers/media/i2c/smiapp-pll.c
index 0d5c503..e40d902 100644
--- a/drivers/media/i2c/smiapp-pll.c
+++ b/drivers/media/i2c/smiapp-pll.c
@@ -391,6 +391,7 @@ static int __smiapp_pll_calculate(
 out_skip_vt_calc:
pll-pixel_rate_csi =
op_pll-pix_clk_freq_hz * lane_op_clock_ratio;
+   pll-pixel_rate_pixel_array = pll-vt.pix_clk_freq_hz;
 
return check_all_bounds(dev, limits, op_limits, pll, op_pll);
 }
diff --git a/drivers/media/i2c/smiapp-pll.h b/drivers/media/i2c/smiapp-pll.h
index b7c0e66..e8f035a 100644
--- a/drivers/media/i2c/smiapp-pll.h
+++ b/drivers/media/i2c/smiapp-pll.h
@@ -71,6 +71,7 @@ struct smiapp_pll {
struct smiapp_pll_branch op;
 
uint32_t pixel_rate_csi;
+   uint32_t pixel_rate_pixel_array;
 };
 
 struct smiapp_pll_branch_limits {
-- 
1.7.10.4

--
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 14/18] smiapp: Gather information on valid link rate and BPP combinations

2014-10-02 Thread Sakari Ailus
Not all link rates are possible with all BPP values.

Also rearrange other initialisation a little. Obtaining possible PLL
configurations earlier requires that.

Signed-off-by: Sakari Ailus sakari.ai...@linux.intel.com
---
 drivers/media/i2c/smiapp/smiapp-core.c |   69 
 drivers/media/i2c/smiapp/smiapp.h  |8 
 2 files changed, 60 insertions(+), 17 deletions(-)

diff --git a/drivers/media/i2c/smiapp/smiapp-core.c 
b/drivers/media/i2c/smiapp/smiapp-core.c
index 4d3dc25..d65521a 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -742,6 +742,7 @@ static int smiapp_get_limits_binning(struct smiapp_sensor 
*sensor)
 static int smiapp_get_mbus_formats(struct smiapp_sensor *sensor)
 {
struct i2c_client *client = v4l2_get_subdevdata(sensor-src-sd);
+   struct smiapp_pll *pll = sensor-pll;
unsigned int type, n;
unsigned int i, pixel_order;
int rval;
@@ -816,6 +817,41 @@ static int smiapp_get_mbus_formats(struct smiapp_sensor 
*sensor)
}
}
 
+   /* Figure out which BPP values can be used with which formats. */
+   pll-binning_horizontal = 1;
+   pll-binning_vertical = 1;
+   pll-scale_m = sensor-scale_m;
+
+   for (i = 0; i  ARRAY_SIZE(smiapp_csi_data_formats); i++) {
+   const struct smiapp_csi_data_format *f =
+   smiapp_csi_data_formats[i];
+   unsigned long *valid_link_freqs =
+   sensor-valid_link_freqs[
+   f-compressed - SMIAPP_COMPRESSED_BASE];
+   unsigned int j;
+
+   BUG_ON(f-compressed  SMIAPP_COMPRESSED_BASE);
+   BUG_ON(f-compressed  SMIAPP_COMPRESSED_MAX);
+
+   if (!(sensor-default_mbus_frame_fmts  1  i))
+   continue;
+
+   pll-bits_per_pixel = f-compressed;
+
+   for (j = 0; sensor-platform_data-op_sys_clock[j]; j++) {
+   pll-link_freq = sensor-platform_data-op_sys_clock[j];
+
+   rval = smiapp_pll_try(sensor, pll);
+   dev_dbg(client-dev, link freq %u Hz, bpp %u %s\n,
+   pll-link_freq, pll-bits_per_pixel,
+   rval ? not ok : ok);
+   if (rval)
+   continue;
+
+   set_bit(j, valid_link_freqs);
+   }
+   }
+
if (!sensor-csi_format) {
dev_err(client-dev, no supported mbus code found\n);
return -EINVAL;
@@ -2479,12 +2515,6 @@ static int smiapp_registered(struct v4l2_subdev *subdev)
goto out_power_off;
}
 
-   rval = smiapp_get_mbus_formats(sensor);
-   if (rval) {
-   rval = -ENODEV;
-   goto out_power_off;
-   }
-
if (sensor-limits[SMIAPP_LIMIT_BINNING_CAPABILITY]) {
u32 val;
 
@@ -2566,6 +2596,22 @@ static int smiapp_registered(struct v4l2_subdev *subdev)
 
sensor-scale_m = sensor-limits[SMIAPP_LIMIT_SCALER_N_MIN];
 
+   /* prepare PLL configuration input values */
+   pll-bus_type = SMIAPP_PLL_BUS_TYPE_CSI2;
+   pll-csi2.lanes = sensor-platform_data-lanes;
+   pll-ext_clk_freq_hz = sensor-platform_data-ext_clk;
+   pll-flags = smiapp_call_quirk(sensor, pll_flags);
+   pll-scale_n = sensor-limits[SMIAPP_LIMIT_SCALER_N_MIN];
+   /* Profile 0 sensors have no separate OP clock branch. */
+   if (sensor-minfo.smiapp_profile == SMIAPP_PROFILE_0)
+   pll-flags |= SMIAPP_PLL_FLAG_NO_OP_CLOCKS;
+
+   rval = smiapp_get_mbus_formats(sensor);
+   if (rval) {
+   rval = -ENODEV;
+   goto out_nvm_release;
+   }
+
for (i = 0; i  SMIAPP_SUBDEVS; i++) {
struct {
struct smiapp_subdev *ssd;
@@ -2663,17 +2709,6 @@ static int smiapp_registered(struct v4l2_subdev *subdev)
if (rval  0)
goto out_nvm_release;
 
-   /* prepare PLL configuration input values */
-   pll-bus_type = SMIAPP_PLL_BUS_TYPE_CSI2;
-   pll-csi2.lanes = sensor-platform_data-lanes;
-   pll-ext_clk_freq_hz = sensor-platform_data-ext_clk;
-   pll-flags = smiapp_call_quirk(sensor, pll_flags);
-
-   /* Profile 0 sensors have no separate OP clock branch. */
-   if (sensor-minfo.smiapp_profile == SMIAPP_PROFILE_0)
-   pll-flags |= SMIAPP_PLL_FLAG_NO_OP_CLOCKS;
-   pll-scale_n = sensor-limits[SMIAPP_LIMIT_SCALER_N_MIN];
-
mutex_lock(sensor-mutex);
rval = smiapp_update_mode(sensor);
mutex_unlock(sensor-mutex);
diff --git a/drivers/media/i2c/smiapp/smiapp.h 
b/drivers/media/i2c/smiapp/smiapp.h
index 874b49f..f88f8ec 100644
--- a/drivers/media/i2c/smiapp/smiapp.h
+++ b/drivers/media/i2c/smiapp/smiapp.h
@@ -156,6 +156,11 @@ struct smiapp_csi_data_format {
 #define 

[PATCH] [media] s5p-fimc: Only build suspend/resume for PM

2014-10-02 Thread Thierry Reding
From: Thierry Reding tred...@nvidia.com

If power management is disabled these functions become unused, so there
is no reason to build them. This fixes a couple of build warnings when
PM(_SLEEP,_RUNTIME) is not enabled.

Signed-off-by: Thierry Reding tred...@nvidia.com
---
 drivers/media/platform/exynos4-is/fimc-core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/platform/exynos4-is/fimc-core.c 
b/drivers/media/platform/exynos4-is/fimc-core.c
index b70fd996d794..8e7435bfa1f9 100644
--- a/drivers/media/platform/exynos4-is/fimc-core.c
+++ b/drivers/media/platform/exynos4-is/fimc-core.c
@@ -832,6 +832,7 @@ err:
return -ENXIO;
 }
 
+#if defined(CONFIG_PM_SLEEP) || defined(CONFIG_PM_RUNTIME)
 static int fimc_m2m_suspend(struct fimc_dev *fimc)
 {
unsigned long flags;
@@ -870,6 +871,7 @@ static int fimc_m2m_resume(struct fimc_dev *fimc)
 
return 0;
 }
+#endif
 
 static const struct of_device_id fimc_of_match[];
 
-- 
2.1.0

--
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.1 16/18] smiapp: Clean up smiapp_set_format()

2014-10-02 Thread Sakari Ailus
smiapp_set_format() has accumulated a fair amount of changes without a
needed refactoring, do the cleanup now. There's also an unlocked version of
v4l2_ctrl_range_changed(), using that fixes a small serialisation issue with
the user space interface.

__v4l2_ctrl_modify_range() is used instead of v4l2_ctrl_modify_range() in
smiapp_set_format_source() since the mutex is now held during the function
call.

Signed-off-by: Sakari Ailus sakari.ai...@linux.intel.com
---
 drivers/media/i2c/smiapp/smiapp-core.c |   73 +++-
 1 file changed, 43 insertions(+), 30 deletions(-)

since v2:

- Move comment on changed media bus codes to smiapp_set_format_source().

- Add a comment to the patch description on the use of the unlocked variant
  of v4l2_ctrl_modify_range().

diff --git a/drivers/media/i2c/smiapp/smiapp-core.c 
b/drivers/media/i2c/smiapp/smiapp-core.c
index 926f60c..416b7bd 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -1728,51 +1728,64 @@ static const struct smiapp_csi_data_format
return csi_format;
 }
 
-static int smiapp_set_format(struct v4l2_subdev *subdev,
-struct v4l2_subdev_fh *fh,
-struct v4l2_subdev_format *fmt)
+static int smiapp_set_format_source(struct v4l2_subdev *subdev,
+   struct v4l2_subdev_fh *fh,
+   struct v4l2_subdev_format *fmt)
 {
struct smiapp_sensor *sensor = to_smiapp_sensor(subdev);
-   struct smiapp_subdev *ssd = to_smiapp_subdev(subdev);
-   struct v4l2_rect *crops[SMIAPP_PADS];
+   const struct smiapp_csi_data_format *csi_format,
+   *old_csi_format = sensor-csi_format;
+   u32 code = fmt-format.code;
+   unsigned int i;
+   int rval;
 
-   mutex_lock(sensor-mutex);
+   rval = __smiapp_get_format(subdev, fh, fmt);
+   if (rval)
+   return rval;
 
/*
 * Media bus code is changeable on src subdev's source pad. On
 * other source pads we just get format here.
 */
-   if (fmt-pad == ssd-source_pad) {
-   u32 code = fmt-format.code;
-   int rval = __smiapp_get_format(subdev, fh, fmt);
-   bool range_changed = false;
-   unsigned int i;
-
-   if (!rval  subdev == sensor-src-sd) {
-   const struct smiapp_csi_data_format *csi_format =
-   smiapp_validate_csi_data_format(sensor, code);
+   if (subdev != sensor-src-sd)
+   return 0;
 
-   if (fmt-which == V4L2_SUBDEV_FORMAT_ACTIVE) {
-   if (csi_format-width !=
-   sensor-csi_format-width)
-   range_changed = true;
+   csi_format = smiapp_validate_csi_data_format(sensor, code);
 
-   sensor-csi_format = csi_format;
-   }
+   fmt-format.code = csi_format-code;
 
-   fmt-format.code = csi_format-code;
-   }
+   if (fmt-which != V4L2_SUBDEV_FORMAT_ACTIVE)
+   return 0;
 
-   mutex_unlock(sensor-mutex);
-   if (rval || !range_changed)
-   return rval;
+   sensor-csi_format = csi_format;
 
+   if (csi_format-width != old_csi_format-width)
for (i = 0; i  ARRAY_SIZE(sensor-test_data); i++)
-   v4l2_ctrl_modify_range(
-   sensor-test_data[i],
-   0, (1  sensor-csi_format-width) - 1, 1, 0);
+   __v4l2_ctrl_modify_range(
+   sensor-test_data[i], 0,
+   (1  csi_format-width) - 1, 1, 0);
 
-   return 0;
+   return 0;
+}
+
+static int smiapp_set_format(struct v4l2_subdev *subdev,
+struct v4l2_subdev_fh *fh,
+struct v4l2_subdev_format *fmt)
+{
+   struct smiapp_sensor *sensor = to_smiapp_sensor(subdev);
+   struct smiapp_subdev *ssd = to_smiapp_subdev(subdev);
+   struct v4l2_rect *crops[SMIAPP_PADS];
+
+   mutex_lock(sensor-mutex);
+
+   if (fmt-pad == ssd-source_pad) {
+   int rval;
+
+   rval = smiapp_set_format_source(subdev, fh, fmt);
+
+   mutex_unlock(sensor-mutex);
+
+   return rval;
}
 
/* Sink pad. Width and height are changeable here. */
-- 
1.7.10.4

--
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


re: [media] exynos4-is: Add the FIMC-IS ISP capture DMA driver

2014-10-02 Thread Dan Carpenter
Hello Sylwester Nawrocki,

The patch 34947b8aebe3: [media] exynos4-is: Add the FIMC-IS ISP
capture DMA driver from Dec 20, 2013, leads to the following static
checker warning:

drivers/media/platform/exynos4-is/fimc-isp-video.c:413 
isp_video_try_fmt_mplane()
error: NULL dereference inside function.

drivers/media/platform/exynos4-is/fimc-isp-video.c
   388  static void __isp_video_try_fmt(struct fimc_isp *isp,
   389  struct v4l2_pix_format_mplane *pixm,
   390  const struct fimc_fmt **fmt)
   391  {
   392  *fmt = fimc_isp_find_format(pixm-pixelformat, NULL, 2);

fmt isn't allowed to be NULL.

   393  
   394  pixm-colorspace = V4L2_COLORSPACE_SRGB;
   395  pixm-field = V4L2_FIELD_NONE;
   396  pixm-num_planes = (*fmt)-memplanes;
   397  pixm-pixelformat = (*fmt)-fourcc;
   398  /*
   399   * TODO: double check with the docmentation these width/height
   400   * constraints are correct.
   401   */
   402  v4l_bound_align_image(pixm-width, FIMC_ISP_SOURCE_WIDTH_MIN,
   403FIMC_ISP_SOURCE_WIDTH_MAX, 3,
   404pixm-height, FIMC_ISP_SOURCE_HEIGHT_MIN,
   405FIMC_ISP_SOURCE_HEIGHT_MAX, 0, 0);
   406  }
   407  
   408  static int isp_video_try_fmt_mplane(struct file *file, void *fh,
   409  struct v4l2_format *f)
   410  {
   411  struct fimc_isp *isp = video_drvdata(file);
   412  
   413  __isp_video_try_fmt(isp, f-fmt.pix_mp, NULL);
 
NULL dereference here.

   414  return 0;
   415  }

regards,
dan carpenter
--
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


Re: [PATCH] Fixed all coding style issues for drivers/staging/media/lirc/

2014-10-02 Thread Greg KH
On Wed, Oct 01, 2014 at 09:40:02PM -0700, Amber Thrall wrote:
 Fixed various coding style issues, including strings over 80 characters long 
 and many 
 deprecated printk's have been replaced with proper methods.

Only do one thing per patch, you are doing lots of different things
here, and as Dan pointed out, you broke the build.

greg k-h
--
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


Re: [PATCH] Fixed all coding style issues for drivers/staging/media/lirc/

2014-10-02 Thread Mauro Carvalho Chehab
Em Wed, 01 Oct 2014 21:40:02 -0700
Amber Thrall amber.rose.thr...@gmail.com escreveu:

 Fixed various coding style issues, including strings over 80 characters long 
 and many 
 deprecated printk's have been replaced with proper methods.
 
 Signed-off-by: Amber Thrall amber.rose.thr...@gmail.com
 ---
  drivers/staging/media/lirc/lirc_bt829.c  |  2 +-
  drivers/staging/media/lirc/lirc_imon.c   |  4 +-
  drivers/staging/media/lirc/lirc_sasem.c  |  6 +--
  drivers/staging/media/lirc/lirc_serial.c | 29 ++
  drivers/staging/media/lirc/lirc_sir.c|  3 +-
  drivers/staging/media/lirc/lirc_zilog.c  | 69 
 +++-
  6 files changed, 52 insertions(+), 61 deletions(-)
 
 diff --git a/drivers/staging/media/lirc/lirc_bt829.c 
 b/drivers/staging/media/lirc/lirc_bt829.c
 index 4c806ba..c70ca68 100644
 --- a/drivers/staging/media/lirc/lirc_bt829.c
 +++ b/drivers/staging/media/lirc/lirc_bt829.c
 @@ -59,7 +59,7 @@ static bool debug;
  #define dprintk(fmt, args...)
  \
   do { \
   if (debug)   \
 - printk(KERN_DEBUG DRIVER_NAME : fmt, ## args); \
 + dev_dbg(DRIVER_NAME, : fmt, ##args); \

Please don't do that. If dynamic printk is enabled, that would mean that
someone needing to use the debug prints would need to both load the module
with debug=1 and enable the debug prints via sysfs.

In this specific case, probably the best would be to just replace dprintk
for dev_dbg or pr_dbg and remove the macro.

Also, please notice that dev_dbg() is defined as:
#define dev_dbg(dev, format, arg...) 

So, the dev argument should be passed to it. You'll need to be sure that
you have dev on all places and that it was already initialized on all
places you use it, or otherwise you'll break compilation (or runtime, if
you use an initialized dev).

   } while (0)
  
  static int atir_minor;
 diff --git a/drivers/staging/media/lirc/lirc_imon.c 
 b/drivers/staging/media/lirc/lirc_imon.c
 index 7aca44f..bce0408 100644
 --- a/drivers/staging/media/lirc/lirc_imon.c
 +++ b/drivers/staging/media/lirc/lirc_imon.c
 @@ -623,8 +623,8 @@ static void imon_incoming_packet(struct imon_context 
 *context,
   if (debug) {
   dev_info(dev, raw packet: );
   for (i = 0; i  len; ++i)
 - printk(%02x , buf[i]);
 - printk(\n);
 + dev_info(dev, %02x , buf[i]);
 + dev_info(dev, \n);
   }

This is wrong, as the second printk should be printk_cont.

The best here would be to change all above to use %*ph.
So, just:

dev_debug(dev, raw packet: %*ph\n, len, buf);

  
   /*
 diff --git a/drivers/staging/media/lirc/lirc_sasem.c 
 b/drivers/staging/media/lirc/lirc_sasem.c
 index c20ef56..e88e246 100644
 --- a/drivers/staging/media/lirc/lirc_sasem.c
 +++ b/drivers/staging/media/lirc/lirc_sasem.c
 @@ -583,10 +583,10 @@ static void incoming_packet(struct sasem_context 
 *context,
   }
  
   if (debug) {
 - printk(KERN_INFO Incoming data: );
 + pr_info(Incoming data: );
   for (i = 0; i  8; ++i)
 - printk(KERN_CONT %02x , buf[i]);
 - printk(KERN_CONT \n);
 + pr_cont(%02x, buf[i]);
 + pr_cont(\n);
   }

Same as above: use %*ph.

  
   /*
 diff --git a/drivers/staging/media/lirc/lirc_serial.c 
 b/drivers/staging/media/lirc/lirc_serial.c
 index 181b92b..b07671b 100644
 --- a/drivers/staging/media/lirc/lirc_serial.c
 +++ b/drivers/staging/media/lirc/lirc_serial.c
 @@ -116,8 +116,7 @@ static bool txsense;  /* 0 = active high, 1 = active 
 low */
  #define dprintk(fmt, args...)\
   do {\
   if (debug)  \
 - printk(KERN_DEBUG LIRC_DRIVER_NAME :  \
 -fmt, ## args);   \
 + dev_dbg(LIRC_DRIVER_NAME, : fmt, ##args); \
   } while (0)

Again, see my comment #1.

  
  /* forward declarations */
 @@ -356,9 +355,8 @@ static int init_timing_params(unsigned int new_duty_cycle,
   /* Derive pulse and space from the period */
   pulse_width = period * duty_cycle / 100;
   space_width = period - pulse_width;
 - dprintk(in init_timing_params, freq=%d, duty_cycle=%d, 
 - clk/jiffy=%ld, pulse=%ld, space=%ld, 
 - conv_us_to_clocks=%ld\n,
 + dprintk(in init_timing_params, freq=%d, duty_cycle=%d, clk/jiffy=%ld,
 + pulse=%ld, space=%ld, conv_us_to_clocks=%ld\n,
   freq, duty_cycle, __this_cpu_read(cpu_info.loops_per_jiffy),
   pulse_width, space_width, conv_us_to_clocks);
   return 0;
 @@ -1075,7 +1073,7 @@ 

Re: [PATCH] [media] s5p-fimc: Only build suspend/resume for PM

2014-10-02 Thread Mauro Carvalho Chehab
Em Thu, 02 Oct 2014 10:48:11 +0200
Thierry Reding thierry.red...@gmail.com escreveu:

 From: Thierry Reding tred...@nvidia.com
 
 If power management is disabled these functions become unused, so there
 is no reason to build them. This fixes a couple of build warnings when
 PM(_SLEEP,_RUNTIME) is not enabled.
 
 Signed-off-by: Thierry Reding tred...@nvidia.com
 ---
  drivers/media/platform/exynos4-is/fimc-core.c | 2 ++
  1 file changed, 2 insertions(+)
 
 diff --git a/drivers/media/platform/exynos4-is/fimc-core.c 
 b/drivers/media/platform/exynos4-is/fimc-core.c
 index b70fd996d794..8e7435bfa1f9 100644
 --- a/drivers/media/platform/exynos4-is/fimc-core.c
 +++ b/drivers/media/platform/exynos4-is/fimc-core.c
 @@ -832,6 +832,7 @@ err:
   return -ENXIO;
  }
  
 +#if defined(CONFIG_PM_SLEEP) || defined(CONFIG_PM_RUNTIME)
  static int fimc_m2m_suspend(struct fimc_dev *fimc)
  {
   unsigned long flags;
 @@ -870,6 +871,7 @@ static int fimc_m2m_resume(struct fimc_dev *fimc)
  
   return 0;
  }
 +#endif

The patch obviously is correct, but I'm wandering if aren't there a way
to avoid the if/endif.

Not tested here, but perhaps if we mark those functions as inline, the
C compiler would do the right thing without generating any warnings.

If not, maybe we could use some macro like:

#if defined(CONFIG_PM_SLEEP) || defined(CONFIG_PM_RUNTIME)
#define PM_SLEEP_FUNC
#else
#define PM_SLEEP_FUNC   inline
#endif

And put it at pm.h.

That should be enough to shut up to warning without adding any footprint
if PM is disabled.

Regards,
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


Re: [PATCH] [media] s5p-fimc: Only build suspend/resume for PM

2014-10-02 Thread Thierry Reding
On Thu, Oct 02, 2014 at 10:43:21AM -0300, Mauro Carvalho Chehab wrote:
 Em Thu, 02 Oct 2014 10:48:11 +0200
 Thierry Reding thierry.red...@gmail.com escreveu:
 
  From: Thierry Reding tred...@nvidia.com
  
  If power management is disabled these functions become unused, so there
  is no reason to build them. This fixes a couple of build warnings when
  PM(_SLEEP,_RUNTIME) is not enabled.
  
  Signed-off-by: Thierry Reding tred...@nvidia.com
  ---
   drivers/media/platform/exynos4-is/fimc-core.c | 2 ++
   1 file changed, 2 insertions(+)
  
  diff --git a/drivers/media/platform/exynos4-is/fimc-core.c 
  b/drivers/media/platform/exynos4-is/fimc-core.c
  index b70fd996d794..8e7435bfa1f9 100644
  --- a/drivers/media/platform/exynos4-is/fimc-core.c
  +++ b/drivers/media/platform/exynos4-is/fimc-core.c
  @@ -832,6 +832,7 @@ err:
  return -ENXIO;
   }
   
  +#if defined(CONFIG_PM_SLEEP) || defined(CONFIG_PM_RUNTIME)
   static int fimc_m2m_suspend(struct fimc_dev *fimc)
   {
  unsigned long flags;
  @@ -870,6 +871,7 @@ static int fimc_m2m_resume(struct fimc_dev *fimc)
   
  return 0;
   }
  +#endif
 
 The patch obviously is correct, but I'm wandering if aren't there a way
 to avoid the if/endif.
 
 Not tested here, but perhaps if we mark those functions as inline, the
 C compiler would do the right thing without generating any warnings.
 
 If not, maybe we could use some macro like:
 
 #if defined(CONFIG_PM_SLEEP) || defined(CONFIG_PM_RUNTIME)
   #define PM_SLEEP_FUNC
 #else
   #define PM_SLEEP_FUNC   inline
 #endif
 
 And put it at pm.h.
 
 That should be enough to shut up to warning without adding any footprint
 if PM is disabled.

I think you could use __maybe_unused to that effect, but it has the
disadvantage of hiding such messages forever. For instance if the
suspend/resume code was ever to be removed, then you wouldn't get a
warning at all.

And there's a corresponding #ifdef for the fimc_runtime_{suspend,resume}
and fimc_{suspend,resume} already anyway, so I don't see much point in
trying to avoid this particular #ifdef.

Thierry


pgpbBR6pTAJeD.pgp
Description: PGP signature


Re: [PATCH v2.1 16/18] smiapp: Clean up smiapp_set_format()

2014-10-02 Thread Laurent Pinchart
Hi Sakari,

Thank you for the patch.

On Thursday 02 October 2014 15:09:14 Sakari Ailus wrote:
 smiapp_set_format() has accumulated a fair amount of changes without a
 needed refactoring, do the cleanup now. There's also an unlocked version of
 v4l2_ctrl_range_changed(), using that fixes a small serialisation issue with
 the user space interface.
 
 __v4l2_ctrl_modify_range() is used instead of v4l2_ctrl_modify_range() in
 smiapp_set_format_source() since the mutex is now held during the function
 call.
 
 Signed-off-by: Sakari Ailus sakari.ai...@linux.intel.com

For the whole series,

Acked-by: Laurent Pinchart laurent.pinch...@ideasonboard.com

 ---
  drivers/media/i2c/smiapp/smiapp-core.c |   73 -
  1 file changed, 43 insertions(+), 30 deletions(-)
 
 since v2:
 
 - Move comment on changed media bus codes to smiapp_set_format_source().
 
 - Add a comment to the patch description on the use of the unlocked variant
   of v4l2_ctrl_modify_range().
 
 diff --git a/drivers/media/i2c/smiapp/smiapp-core.c
 b/drivers/media/i2c/smiapp/smiapp-core.c index 926f60c..416b7bd 100644
 --- a/drivers/media/i2c/smiapp/smiapp-core.c
 +++ b/drivers/media/i2c/smiapp/smiapp-core.c
 @@ -1728,51 +1728,64 @@ static const struct smiapp_csi_data_format
   return csi_format;
  }
 
 -static int smiapp_set_format(struct v4l2_subdev *subdev,
 -  struct v4l2_subdev_fh *fh,
 -  struct v4l2_subdev_format *fmt)
 +static int smiapp_set_format_source(struct v4l2_subdev *subdev,
 + struct v4l2_subdev_fh *fh,
 + struct v4l2_subdev_format *fmt)
  {
   struct smiapp_sensor *sensor = to_smiapp_sensor(subdev);
 - struct smiapp_subdev *ssd = to_smiapp_subdev(subdev);
 - struct v4l2_rect *crops[SMIAPP_PADS];
 + const struct smiapp_csi_data_format *csi_format,
 + *old_csi_format = sensor-csi_format;
 + u32 code = fmt-format.code;
 + unsigned int i;
 + int rval;
 
 - mutex_lock(sensor-mutex);
 + rval = __smiapp_get_format(subdev, fh, fmt);
 + if (rval)
 + return rval;
 
   /*
* Media bus code is changeable on src subdev's source pad. On
* other source pads we just get format here.
*/
 - if (fmt-pad == ssd-source_pad) {
 - u32 code = fmt-format.code;
 - int rval = __smiapp_get_format(subdev, fh, fmt);
 - bool range_changed = false;
 - unsigned int i;
 -
 - if (!rval  subdev == sensor-src-sd) {
 - const struct smiapp_csi_data_format *csi_format =
 - smiapp_validate_csi_data_format(sensor, code);
 + if (subdev != sensor-src-sd)
 + return 0;
 
 - if (fmt-which == V4L2_SUBDEV_FORMAT_ACTIVE) {
 - if (csi_format-width !=
 - sensor-csi_format-width)
 - range_changed = true;
 + csi_format = smiapp_validate_csi_data_format(sensor, code);
 
 - sensor-csi_format = csi_format;
 - }
 + fmt-format.code = csi_format-code;
 
 - fmt-format.code = csi_format-code;
 - }
 + if (fmt-which != V4L2_SUBDEV_FORMAT_ACTIVE)
 + return 0;
 
 - mutex_unlock(sensor-mutex);
 - if (rval || !range_changed)
 - return rval;
 + sensor-csi_format = csi_format;
 
 + if (csi_format-width != old_csi_format-width)
   for (i = 0; i  ARRAY_SIZE(sensor-test_data); i++)
 - v4l2_ctrl_modify_range(
 - sensor-test_data[i],
 - 0, (1  sensor-csi_format-width) - 1, 1, 0);
 + __v4l2_ctrl_modify_range(
 + sensor-test_data[i], 0,
 + (1  csi_format-width) - 1, 1, 0);
 
 - return 0;
 + return 0;
 +}
 +
 +static int smiapp_set_format(struct v4l2_subdev *subdev,
 +  struct v4l2_subdev_fh *fh,
 +  struct v4l2_subdev_format *fmt)
 +{
 + struct smiapp_sensor *sensor = to_smiapp_sensor(subdev);
 + struct smiapp_subdev *ssd = to_smiapp_subdev(subdev);
 + struct v4l2_rect *crops[SMIAPP_PADS];
 +
 + mutex_lock(sensor-mutex);
 +
 + if (fmt-pad == ssd-source_pad) {
 + int rval;
 +
 + rval = smiapp_set_format_source(subdev, fh, fmt);
 +
 + mutex_unlock(sensor-mutex);
 +
 + return rval;
   }
 
   /* Sink pad. Width and height are changeable here. */

-- 
Regards,

Laurent Pinchart

--
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


[RESEND PATCH] saa7146: Create a device name before it's used

2014-10-02 Thread Lubomir Rintel
request_irq() uses it, tries to create a procfs file with an empty name
otherwise.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=83771
Signed-off-by: Lubomir Rintel lkund...@v3.sk
---
 drivers/media/common/saa7146/saa7146_core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/common/saa7146/saa7146_core.c 
b/drivers/media/common/saa7146/saa7146_core.c
index 97afee6..4418119 100644
--- a/drivers/media/common/saa7146/saa7146_core.c
+++ b/drivers/media/common/saa7146/saa7146_core.c
@@ -364,6 +364,9 @@ static int saa7146_init_one(struct pci_dev *pci, const 
struct pci_device_id *ent
goto out;
}
 
+   /* create a nice device name */
+   sprintf(dev-name, saa7146 (%d), saa7146_num);
+
DEB_EE(pci:%p\n, pci);
 
err = pci_enable_device(pci);
@@ -438,9 +441,6 @@ static int saa7146_init_one(struct pci_dev *pci, const 
struct pci_device_id *ent
 
/* the rest + print status message */
 
-   /* create a nice device name */
-   sprintf(dev-name, saa7146 (%d), saa7146_num);
-
pr_info(found saa7146 @ mem %p (revision %d, irq %d) 
(0x%04x,0x%04x)\n,
dev-mem, dev-revision, pci-irq,
pci-subsystem_vendor, pci-subsystem_device);
-- 
1.9.3

--
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


Re: i.MX6 status for IPU/VPU/GPU

2014-10-02 Thread Jean-Michel Hautbois
Hi Steve,

2014-09-09 18:28 GMT+02:00 Steve Longerbeam slongerb...@gmail.com:
 On 09/09/2014 12:49 AM, Jean-Michel Hautbois wrote:
 2014-08-27 16:23 GMT+02:00 Steve Longerbeam steve_longerb...@mentor.com:

 The complete driver I posted to the list does have some minor issues
 mostly suggested by Hans Verkuil (switch to new selection API instead
 of cropping API for example). It is a full featured driver but it does not
 implement the media device framework, i.e. user does not have direct
 control of the video pipeline, rather the driver chooses the pipeline based
 on the traditional inputs from user (video format and controls).

Here is my first step toward MC support from your work :
https://github.com/Vodalys/linux-2.6-imx/commit/8f0318f53c48a9638a1963b395bc79fbd7ba4c07

This is a WIP, so some parts of code are commented out awaiting a
nicer solution.
I also keep using your eplist array for the moment, and open will
obviously fail when trying to power sensor.
But what I wanted was a complete MC support with parsing links from DT
and I used Laurent's work intensively :).

 I've also worked out what I think is a workable video pipeline graph for 
 i.MX,
 suitable for defining the entities, pads, and links. Unfortunately I haven't
 been able to spend as much time as I'd like on it.

Did you find some time to write the pdf you mentioned ?

Thanks for your work again,
JM
--
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


[RFC PATCH] media: uvc: *HACK* workaround uvc unregister device *HACK*

2014-10-02 Thread Michael Grzeschik
Currently the uvc_driver is not cleaning up its child devices if a
device is still in use. It leads to orphaned devices which are not
sitting on any interface. They get cleaned up on uvc_delete which will
be called on uvc_remove after the userspace application is closing the
stream. When PM_RUNTIME is used in the kernel, this leads to the
following backtrace for missing sysfs entries in the orphaned kobjects.

This patch is moving the device cleanup code for the child devices from
uvc_delete to uvc_unregister_video. It is an *HACK* workaround which
is ment to initiate the discussion for a proper solution.

This behaviour can simply be reproduced by the following command:

$ gst-launch v4l2src device=/dev/video0 ! fakesink

- Now disconnect the UVC Camera while the stream is still open and used

$ Ctrl-C # to close the running gstreamer pipeline

[  258.012048] [ cut here ]
[  258.021206] WARNING: CPU: 0 PID: 280 at fs/sysfs/group.c:220 
sysfs_remove_group+0xb4/0xb8()
[  258.031728] sysfs group 80c79200 not found for kobject 'event0'
[  258.039383] Modules linked in: lock(O) usb_f_ecm g_ether usb_f_rndis u_ether 
libcomposite coda ath6kl_sdio ath6kl_core
[  258.051098] CPU: 0 PID: 280 Comm: v4l2filter0:src Tainted: G   O   
3.17.0-rc6-20140925-1+ #10
[  258.063318] Backtrace:
[  258.066403] [80012ca4] (dump_backtrace) from [80012f94] 
(show_stack+0x18/0x1c)
[  258.077579]  r6:00dc r5:0009 r4:d81f7ba8 r3:
[  258.084549] [80012f7c] (show_stack) from [807872e4] 
(dump_stack+0x24/0x28)
[  258.091791] [807872c0] (dump_stack) from [80025140] 
(warn_slowpath_common+0x78/0x90)
[  258.100770] [800250c8] (warn_slowpath_common) from [80025190] 
(warn_slowpath_fmt+0x38/0x40)
[  258.109818]  r8: r7:da00a218 r6:da0520f0 r5: r4:80c79200
[  258.116675] [8002515c] (warn_slowpath_fmt) from [8015bb4c] 
(sysfs_remove_group+0xb4/0xb8)
[  258.125824]  r3:80c79200 r2:8098e22c
[  258.129463] [8015ba98] (sysfs_remove_group) from [803ec5a4] 
(dpm_sysfs_remove+0x54/0x58)
[  258.138500]  r6:da0520e8 r5:da0520f0 r4:80c79200
[  258.143195] [803ec550] (dpm_sysfs_remove) from [803e3664] 
(device_del+0x4c/0x1b0)
[  258.151790]  r6:da052004 r5:da0520e8 r4:da052000 r3:da306200
[  258.157813] [803e3618] (device_del) from [804eb7a8] 
(evdev_disconnect+0x20/0x48)
[  258.166190]  r7:da00a1b4 r6:da052004 r5:da0520e8 r4:da052000
[  258.172637] [804eb788] (evdev_disconnect) from [804e694c] 
(__input_unregister_device+0xb0/0x150)
[  258.182282]  r6:da00a000 r5:da00a448 r4:da00a434 r3:804eb788
[  258.188064] [804e689c] (__input_unregister_device) from [804e7b50] 
(input_unregister_device+0x50/0x78)
[  258.198271]  r7:da051c00 r6:da009000 r5:81506254 r4:da00a000
[  258.204013] [804e7b00] (input_unregister_device) from [8052eba8] 
(uvc_status_cleanup+0x38/0x3c)
[  258.213557]  r4:da009000 r3:
[  258.217221] [8052eb70] (uvc_status_cleanup) from [80524e64] 
(uvc_delete+0x28/0x140)
[  258.225704]  r4:da051c58 r3:
[  258.229322] [80524e3c] (uvc_delete) from [80525098] 
(uvc_release+0x40/0x44)
[  258.237136]  r8: r7:da051c00 r6:da009428 r5:81506254 r4:da051c58 
r3:da00951c
[  258.245495] [80525058] (uvc_release) from [80500a0c] 
(v4l2_device_release+0xd0/0xf4)
[  258.253608] [8050093c] (v4l2_device_release) from [803e30f4] 
(device_release+0x34/0x98)
[  258.262529]  r8:da054070 r7:da026a40 r6:da021c00 r5:da051c58 r4:da051c60 
r3:8050093c
[  258.270519] [803e30c0] (device_release) from [80323fd4] 
(kobject_cleanup+0x98/0x1b8)
[  258.279105]  r6:80c78848 r5:da051c60 r4:80cb61e8 r3:803e30c0
[  258.284887] [80323f3c] (kobject_cleanup) from [80323e6c] 
(kobject_put+0x50/0x7c)
[  258.292634]  r7:da054070 r6:da562258 r5: r4:da051c60
[  258.298839] [80323e1c] (kobject_put) from [803e350c] 
(put_device+0x1c/0x20)
[  258.306654]  r4:da051c00
[  258.309221] [803e34f0] (put_device) from [804ff73c] 
(v4l2_release+0x58/0x7c)
[  258.317133] [804ff6e4] (v4l2_release) from [800f1444] (__fput+0x9c/0x220)
[  258.324554]  r5:da15e190 r4:da3c8dc0
[  258.328171] [800f13a8] (__fput) from [800f1624] (fput+0x10/0x14)
[  258.335344]  r10:da306200 r9:da30c620 r8:00418004 r7:da306200 r6:80cc2180 
r5:da3ee280
[  258.343252]  r4:da306564
[  258.346086] [800f1614] (fput) from [8003d198] 
(task_work_run+0xa0/0xe4)
[  258.353407] [8003d0f8] (task_work_run) from [80025cb8] 
(do_exit+0x280/0x8d0)
[  258.361489]  r7:da30c624 r6:da3c229c r5:da306574 r4:da3c2240
[  258.367266] [80025a38] (do_exit) from [8002722c] 
(do_group_exit+0x44/0xb8)
[  258.375011]  r7:da30c624
[  258.377584] [800271e8] (do_group_exit) from [80031510] 
(get_signal+0x254/0x6c8)
[  258.385736]  r7:da30c624 r6:d81f7ed4 r5:0009 r4:d81f6000
[  258.391476] [800312bc] (get_signal) from [80012190] 
(do_signal+0x6c/0x3f4)
[  258.399230]  r10: r9:d81f6000 r8:fe00 r7:d81f7ec0 r6:76ca6de6 
r5:76ca6de4
[  258.407190]  r4:d81f7fb0
[  258.409751] [80012124] (do_signal) from [800126c4] 
(do_work_pending+0xa8/0xe8)
[  

Re: [PATCH] Fixed all coding style issues for drivers/staging/media/lirc/

2014-10-02 Thread Joe Perches
On Thu, 2014-10-02 at 10:29 -0300, Mauro Carvalho Chehab wrote:
 Em Wed, 01 Oct 2014 21:40:02 -0700 Amber Thrall amber.rose.thr...@gmail.com 
 escreveu:
  Fixed various coding style issues, including strings over 80 characters 
  long and many 
  deprecated printk's have been replaced with proper methods.
[]
  diff --git a/drivers/staging/media/lirc/lirc_imon.c 
  b/drivers/staging/media/lirc/lirc_imon.c
[]
  @@ -623,8 +623,8 @@ static void imon_incoming_packet(struct imon_context 
  *context,
  if (debug) {
  dev_info(dev, raw packet: );
  for (i = 0; i  len; ++i)
  -   printk(%02x , buf[i]);
  -   printk(\n);
  +   dev_info(dev, %02x , buf[i]);
  +   dev_info(dev, \n);
  }
 
 This is wrong, as the second printk should be printk_cont.
 
 The best here would be to change all above to use %*ph.
 So, just:
 
   dev_debug(dev, raw packet: %*ph\n, len, buf);

Not quite.

%*ph is length limited and only useful for lengths  30 or so.
Even then, it's pretty ugly.

print_hex_dump_debug() is generally better.


--
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 00/10] CODA7 JPEG support

2014-10-02 Thread Philipp Zabel
Hi,

These patches add JPEG encoding and decoding support for CODA7541 (i.MX5).
I have merged the H.264/MPEG4 encoder video devices back together since v1,
so that there now are four video devices, with the JPEG encoder and decoder
separate from the default bitstream encoder and decoder. The video devices
only register relevant controls now.

regards
Philipp

Philipp Zabel (10):
  [media] coda: add support for planar YCbCr 4:2:2 (YUV422P) format
  [media] coda: identify platform device earlier
  [media] coda: add coda_video_device descriptors
  [media] coda: split out encoder control setup to specify controls per
video device
  [media] coda: add JPEG register definitions for CODA7541
  [media] coda: add CODA7541 JPEG support
  [media] coda: store bitstream buffer position with buffer metadata
  [media] coda: pad input stream for JPEG decoder
  [media] coda: try to only queue a single JPEG into the bitstream
  [media] coda: allow userspace to set compressed buffer size in a
certain range

 drivers/media/platform/coda/Makefile  |   2 +-
 drivers/media/platform/coda/coda-bit.c| 204 +++
 drivers/media/platform/coda/coda-common.c | 546 +++---
 drivers/media/platform/coda/coda-jpeg.c   | 225 
 drivers/media/platform/coda/coda.h|  21 +-
 drivers/media/platform/coda/coda_regs.h   |   7 +
 6 files changed, 743 insertions(+), 262 deletions(-)
 create mode 100644 drivers/media/platform/coda/coda-jpeg.c

-- 
2.1.0

--
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 06/10] [media] coda: add CODA7541 JPEG support

2014-10-02 Thread Philipp Zabel
This patch adds JPEG encoding and decoding support for CODA7541,
using the BIT processor. Separate JPEG encoder and decoder video
devices are created due to different streaming behaviour and
different supported pixel formats.
The hardware can not change subsampling on the fly, but encode
and decode 4:2:2 subsampled JPEG images from and into this format.

The CODA7541 JPEG decoder uses the bitstream buffer and thus can run
without new buffers queued if there is a buffer in the bitstream.

Since there is no standard way to store the colorspace used in
JPEGs, and to make v4l2-compliance happy, the JPEG format always
reports V4L2_COLORSPACE_JPEG.

Signed-off-by: Lucas Stach l.st...@pengutronix.de
Signed-off-by: Philipp Zabel p.za...@pengutronix.de
---
 drivers/media/platform/coda/Makefile  |   2 +-
 drivers/media/platform/coda/coda-bit.c| 103 +-
 drivers/media/platform/coda/coda-common.c | 112 ---
 drivers/media/platform/coda/coda-jpeg.c   | 225 ++
 drivers/media/platform/coda/coda.h|   8 +-
 5 files changed, 398 insertions(+), 52 deletions(-)
 create mode 100644 drivers/media/platform/coda/coda-jpeg.c

diff --git a/drivers/media/platform/coda/Makefile 
b/drivers/media/platform/coda/Makefile
index 3543291..25ce155 100644
--- a/drivers/media/platform/coda/Makefile
+++ b/drivers/media/platform/coda/Makefile
@@ -1,3 +1,3 @@
-coda-objs := coda-common.o coda-bit.o coda-h264.o
+coda-objs := coda-common.o coda-bit.o coda-h264.o coda-jpeg.o
 
 obj-$(CONFIG_VIDEO_CODA) += coda.o
diff --git a/drivers/media/platform/coda/coda-bit.c 
b/drivers/media/platform/coda/coda-bit.c
index 746a615..931248d 100644
--- a/drivers/media/platform/coda/coda-bit.c
+++ b/drivers/media/platform/coda/coda-bit.c
@@ -691,6 +691,7 @@ static int coda_start_encoding(struct coda_ctx *ctx)
struct vb2_buffer *buf;
int gamma, ret, value;
u32 dst_fourcc;
+   u32 stride;
 
q_data_src = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_OUTPUT);
q_data_dst = get_q_data(ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE);
@@ -710,6 +711,14 @@ static int coda_start_encoding(struct coda_ctx *ctx)
return -EFAULT;
}
 
+   if (dst_fourcc == V4L2_PIX_FMT_JPEG) {
+   if (!ctx-params.jpeg_qmat_tab[0])
+   ctx-params.jpeg_qmat_tab[0] = kmalloc(64, GFP_KERNEL);
+   if (!ctx-params.jpeg_qmat_tab[1])
+   ctx-params.jpeg_qmat_tab[1] = kmalloc(64, GFP_KERNEL);
+   coda_set_jpeg_compression_quality(ctx, 
ctx-params.jpeg_quality);
+   }
+
mutex_lock(dev-coda_mutex);
 
coda_write(dev, ctx-parabuf.paddr, CODA_REG_BIT_PARA_BUF_ADDR);
@@ -765,6 +774,8 @@ static int coda_start_encoding(struct coda_ctx *ctx)
  CODA_PICHEIGHT_OFFSET;
}
coda_write(dev, value, CODA_CMD_ENC_SEQ_SRC_SIZE);
+   if (dst_fourcc == V4L2_PIX_FMT_JPEG)
+   ctx-params.framerate = 0;
coda_write(dev, ctx-params.framerate,
   CODA_CMD_ENC_SEQ_SRC_F_RATE);
 
@@ -798,6 +809,16 @@ static int coda_start_encoding(struct coda_ctx *ctx)
}
coda_write(dev, value, CODA_CMD_ENC_SEQ_264_PARA);
break;
+   case V4L2_PIX_FMT_JPEG:
+   coda_write(dev, 0, CODA_CMD_ENC_SEQ_JPG_PARA);
+   coda_write(dev, ctx-params.jpeg_restart_interval,
+   CODA_CMD_ENC_SEQ_JPG_RST_INTERVAL);
+   coda_write(dev, 0, CODA_CMD_ENC_SEQ_JPG_THUMB_EN);
+   coda_write(dev, 0, CODA_CMD_ENC_SEQ_JPG_THUMB_SIZE);
+   coda_write(dev, 0, CODA_CMD_ENC_SEQ_JPG_THUMB_OFFSET);
+
+   coda_jpeg_write_tables(ctx);
+   break;
default:
v4l2_err(v4l2_dev,
 dst format (0x%08x) invalid.\n, dst_fourcc);
@@ -805,28 +826,36 @@ static int coda_start_encoding(struct coda_ctx *ctx)
goto out;
}
 
-   switch (ctx-params.slice_mode) {
-   case V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE:
-   value = 0;
-   break;
-   case V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_MB:
-   value  = (ctx-params.slice_max_mb  CODA_SLICING_SIZE_MASK)
- CODA_SLICING_SIZE_OFFSET;
-   value |= (1  CODA_SLICING_UNIT_MASK)
- CODA_SLICING_UNIT_OFFSET;
-   value |=  1  CODA_SLICING_MODE_MASK;
-   break;
-   case V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_BYTES:
-   value  = (ctx-params.slice_max_bits  CODA_SLICING_SIZE_MASK)
- CODA_SLICING_SIZE_OFFSET;
-   value |= (0  CODA_SLICING_UNIT_MASK)
- CODA_SLICING_UNIT_OFFSET;
-   value |=  1  CODA_SLICING_MODE_MASK;
-   break;
+   /*
+* slice mode and GOP size registers are used for thumb size/offset
+* in JPEG mode
+  

[PATCH v2 10/10] [media] coda: allow userspace to set compressed buffer size in a certain range

2014-10-02 Thread Philipp Zabel
For small frame sizes, allocating 1 MiB per compressed buffer is a waste of
space. On the other hand, incompressible 1080p data can produce JPEGs larger
than 1 MiB at higher quality settings. Allow userspace to set the compressed
buffer size and clamp the value to a sensible range.
Also set the initial sizeimage to a value inside the range allowed by try_fmt.
While at it, reduce the default image size to a maximum of 1920*1088 (otherwise
JPEG will default to 8k*8k and 96 MiB buffers).

Signed-off-by: Philipp Zabel p.za...@pengutronix.de
---
 drivers/media/platform/coda/coda-bit.c|  4 ++--
 drivers/media/platform/coda/coda-common.c | 25 +
 2 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/drivers/media/platform/coda/coda-bit.c 
b/drivers/media/platform/coda/coda-bit.c
index 2a6810e..0c67cfd 100644
--- a/drivers/media/platform/coda/coda-bit.c
+++ b/drivers/media/platform/coda/coda-bit.c
@@ -1129,7 +1129,7 @@ static int coda_prepare_encode(struct coda_ctx *ctx)
ctx-vpu_header_size[0] +
ctx-vpu_header_size[1] +
ctx-vpu_header_size[2];
-   pic_stream_buffer_size = CODA_MAX_FRAME_SIZE -
+   pic_stream_buffer_size = q_data_dst-sizeimage -
ctx-vpu_header_size[0] -
ctx-vpu_header_size[1] -
ctx-vpu_header_size[2];
@@ -1143,7 +1143,7 @@ static int coda_prepare_encode(struct coda_ctx *ctx)
} else {
pic_stream_buffer_addr =
vb2_dma_contig_plane_dma_addr(dst_buf, 0);
-   pic_stream_buffer_size = CODA_MAX_FRAME_SIZE;
+   pic_stream_buffer_size = q_data_dst-sizeimage;
}
 
if (src_buf-v4l2_buf.flags  V4L2_BUF_FLAG_KEYFRAME) {
diff --git a/drivers/media/platform/coda/coda-common.c 
b/drivers/media/platform/coda/coda-common.c
index 6eaf88e..151e45b 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -513,7 +513,15 @@ static int coda_try_fmt(struct coda_ctx *ctx, const struct 
coda_codec *codec,
case V4L2_PIX_FMT_H264:
case V4L2_PIX_FMT_MPEG4:
f-fmt.pix.bytesperline = 0;
-   f-fmt.pix.sizeimage = CODA_MAX_FRAME_SIZE;
+   /*
+* This is a rough estimate for sensible compressed buffer
+* sizes (between 1 and 16 bits per pixel). This could be
+* improved by better format specific worst case estimates.
+*/
+   f-fmt.pix.sizeimage = round_up(clamp(f-fmt.pix.sizeimage,
+   f-fmt.pix.width * f-fmt.pix.height / 8,
+   f-fmt.pix.width * f-fmt.pix.height * 2),
+   PAGE_SIZE);
break;
default:
BUG();
@@ -1015,12 +1023,13 @@ static void coda_set_tiled_map_type(struct coda_ctx 
*ctx, int tiled_map_type)
 
 static void set_default_params(struct coda_ctx *ctx)
 {
-   int max_w, max_h;
+   unsigned int max_w, max_h, size;
 
ctx-codec = coda_find_codec(ctx-dev, ctx-cvd-src_formats[0],
 ctx-cvd-dst_formats[0]);
-   max_w = ctx-codec-max_w;
-   max_h = ctx-codec-max_h;
+   max_w = min(ctx-codec-max_w, 1920U);
+   max_h = min(ctx-codec-max_h, 1088U);
+   size = max_w * max_h * 3 / 2;
 
ctx-params.codec_mode = ctx-codec-mode;
ctx-colorspace = V4L2_COLORSPACE_REC709;
@@ -1035,14 +1044,14 @@ static void set_default_params(struct coda_ctx *ctx)
ctx-q_data[V4L2_M2M_DST].height = max_h;
if (ctx-codec-src_fourcc == V4L2_PIX_FMT_YUV420) {
ctx-q_data[V4L2_M2M_SRC].bytesperline = max_w;
-   ctx-q_data[V4L2_M2M_SRC].sizeimage = (max_w * max_h * 3) / 2;
+   ctx-q_data[V4L2_M2M_SRC].sizeimage = size;
ctx-q_data[V4L2_M2M_DST].bytesperline = 0;
-   ctx-q_data[V4L2_M2M_DST].sizeimage = CODA_MAX_FRAME_SIZE;
+   ctx-q_data[V4L2_M2M_DST].sizeimage = round_up(size, PAGE_SIZE);
} else {
ctx-q_data[V4L2_M2M_SRC].bytesperline = 0;
-   ctx-q_data[V4L2_M2M_SRC].sizeimage = CODA_MAX_FRAME_SIZE;
+   ctx-q_data[V4L2_M2M_SRC].sizeimage = round_up(size, PAGE_SIZE);
ctx-q_data[V4L2_M2M_DST].bytesperline = max_w;
-   ctx-q_data[V4L2_M2M_DST].sizeimage = (max_w * max_h * 3) / 2;
+   ctx-q_data[V4L2_M2M_DST].sizeimage = size;
}
ctx-q_data[V4L2_M2M_SRC].rect.width = max_w;
ctx-q_data[V4L2_M2M_SRC].rect.height = max_h;
-- 
2.1.0

--
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 05/10] [media] coda: add JPEG register definitions for CODA7541

2014-10-02 Thread Philipp Zabel
Add JPEG specific sequence initialization registers and bit definitions.

Signed-off-by: Lucas Stach l.st...@pengutronix.de
Signed-off-by: Philipp Zabel p.za...@pengutronix.de
---
 drivers/media/platform/coda/coda_regs.h | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/media/platform/coda/coda_regs.h 
b/drivers/media/platform/coda/coda_regs.h
index c791275..8e015b8 100644
--- a/drivers/media/platform/coda/coda_regs.h
+++ b/drivers/media/platform/coda/coda_regs.h
@@ -147,6 +147,7 @@
 #define CODA_CMD_DEC_SEQ_BB_START  0x180
 #define CODA_CMD_DEC_SEQ_BB_SIZE   0x184
 #define CODA_CMD_DEC_SEQ_OPTION0x188
+#defineCODA_NO_INT_ENABLE  (1  10)
 #defineCODA_REORDER_ENABLE (1  1)
 #defineCODADX6_QP_REPORT   (1  0)
 #defineCODA7_MP4_DEBLK_ENABLE  (1  0)
@@ -332,6 +333,12 @@
 #define CODA9_CMD_ENC_SEQ_ME_OPTION0x1d8
 #define CODA_RET_ENC_SEQ_SUCCESS   0x1c0
 
+#define CODA_CMD_ENC_SEQ_JPG_PARA  0x198
+#define CODA_CMD_ENC_SEQ_JPG_RST_INTERVAL  0x19C
+#define CODA_CMD_ENC_SEQ_JPG_THUMB_EN  0x1a0
+#define CODA_CMD_ENC_SEQ_JPG_THUMB_SIZE0x1a4
+#define CODA_CMD_ENC_SEQ_JPG_THUMB_OFFSET  0x1a8
+
 /* Encoder Picture Run */
 #define CODA9_CMD_ENC_PIC_SRC_INDEX0x180
 #define CODA9_CMD_ENC_PIC_SRC_STRIDE   0x184
-- 
2.1.0

--
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 04/10] [media] coda: split out encoder control setup to specify controls per video device

2014-10-02 Thread Philipp Zabel
This patch splits the encoder specific controls out of the main control setup
function. This way each video device registers only relevant controls.

Signed-off-by: Philipp Zabel p.za...@pengutronix.de
---
Changes since v1:
 - Kept both H.264 and MPEG4 v4l2 controls for bitstream encoder device
---
 drivers/media/platform/coda/coda-common.c | 20 +---
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/drivers/media/platform/coda/coda-common.c 
b/drivers/media/platform/coda/coda-common.c
index 45db1da..7fc0dc0 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -1334,14 +1334,8 @@ static const struct v4l2_ctrl_ops coda_ctrl_ops = {
.s_ctrl = coda_s_ctrl,
 };
 
-static int coda_ctrls_setup(struct coda_ctx *ctx)
+static void coda_encode_ctrls(struct coda_ctx *ctx)
 {
-   v4l2_ctrl_handler_init(ctx-ctrls, 9);
-
-   v4l2_ctrl_new_std(ctx-ctrls, coda_ctrl_ops,
-   V4L2_CID_HFLIP, 0, 1, 1, 0);
-   v4l2_ctrl_new_std(ctx-ctrls, coda_ctrl_ops,
-   V4L2_CID_VFLIP, 0, 1, 1, 0);
v4l2_ctrl_new_std(ctx-ctrls, coda_ctrl_ops,
V4L2_CID_MPEG_VIDEO_BITRATE, 0, 32767000, 1, 0);
v4l2_ctrl_new_std(ctx-ctrls, coda_ctrl_ops,
@@ -1385,6 +1379,18 @@ static int coda_ctrls_setup(struct coda_ctx *ctx)
v4l2_ctrl_new_std(ctx-ctrls, coda_ctrl_ops,
V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB, 0,
1920 * 1088 / 256, 1, 0);
+}
+
+static int coda_ctrls_setup(struct coda_ctx *ctx)
+{
+   v4l2_ctrl_handler_init(ctx-ctrls, 2);
+
+   v4l2_ctrl_new_std(ctx-ctrls, coda_ctrl_ops,
+   V4L2_CID_HFLIP, 0, 1, 1, 0);
+   v4l2_ctrl_new_std(ctx-ctrls, coda_ctrl_ops,
+   V4L2_CID_VFLIP, 0, 1, 1, 0);
+   if (ctx-inst_type == CODA_INST_ENCODER)
+   coda_encode_ctrls(ctx);
 
if (ctx-ctrls.error) {
v4l2_err(ctx-dev-v4l2_dev,
-- 
2.1.0

--
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 08/10] [media] coda: pad input stream for JPEG decoder

2014-10-02 Thread Philipp Zabel
Before starting a PIC_RUN, pad the bitstream with 0xff until 256 bytes
past the next multiple of 256 bytes, if the buffer to be decoded is the
last buffer in the bitstream.

Signed-off-by: Philipp Zabel p.za...@pengutronix.de
---
 drivers/media/platform/coda/coda-bit.c | 20 
 1 file changed, 20 insertions(+)

diff --git a/drivers/media/platform/coda/coda-bit.c 
b/drivers/media/platform/coda/coda-bit.c
index d1ecda5..27e0764 100644
--- a/drivers/media/platform/coda/coda-bit.c
+++ b/drivers/media/platform/coda/coda-bit.c
@@ -1625,6 +1625,26 @@ static int coda_prepare_decode(struct coda_ctx *ctx)
coda_write(dev, ctx-iram_info.axi_sram_use,
CODA7_REG_BIT_AXI_SRAM_USE);
 
+   if (ctx-codec-src_fourcc == V4L2_PIX_FMT_JPEG) {
+   struct coda_buffer_meta *meta;
+
+   /* If this is the last buffer in the bitstream, add padding */
+   meta = list_first_entry(ctx-buffer_meta_list,
+ struct coda_buffer_meta, list);
+   if (meta-end == (ctx-bitstream_fifo.kfifo.in 
+ ctx-bitstream_fifo.kfifo.mask)) {
+   static unsigned char buf[512];
+   unsigned int pad;
+
+   /* Pad to multiple of 256 and then add 256 more */
+   pad = ((0 - meta-end)  0xff) + 256;
+
+   memset(buf, 0xff, sizeof(buf));
+
+   kfifo_in(ctx-bitstream_fifo, buf, pad);
+   }
+   }
+
coda_kfifo_sync_to_device_full(ctx);
 
coda_command_async(ctx, CODA_COMMAND_PIC_RUN);
-- 
2.1.0

--
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 02/10] [media] coda: identify platform device earlier

2014-10-02 Thread Philipp Zabel
We'll use this information to decide whether to request the JPEG IRQ later.

Signed-off-by: Philipp Zabel p.za...@pengutronix.de
---
 drivers/media/platform/coda/coda-common.c | 20 +---
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/media/platform/coda/coda-common.c 
b/drivers/media/platform/coda/coda-common.c
index 48be973..fb83c56 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -1896,6 +1896,15 @@ static int coda_probe(struct platform_device *pdev)
if (!dev)
return -ENOMEM;
 
+   pdev_id = of_id ? of_id-data : platform_get_device_id(pdev);
+
+   if (of_id)
+   dev-devtype = of_id-data;
+   else if (pdev_id)
+   dev-devtype = coda_devdata[pdev_id-driver_data];
+   else
+   return -EINVAL;
+
spin_lock_init(dev-irqlock);
INIT_LIST_HEAD(dev-instances);
 
@@ -1963,17 +1972,6 @@ static int coda_probe(struct platform_device *pdev)
mutex_init(dev-dev_mutex);
mutex_init(dev-coda_mutex);
 
-   pdev_id = of_id ? of_id-data : platform_get_device_id(pdev);
-
-   if (of_id) {
-   dev-devtype = of_id-data;
-   } else if (pdev_id) {
-   dev-devtype = coda_devdata[pdev_id-driver_data];
-   } else {
-   v4l2_device_unregister(dev-v4l2_dev);
-   return -EINVAL;
-   }
-
dev-debugfs_root = debugfs_create_dir(coda, NULL);
if (!dev-debugfs_root)
dev_warn(pdev-dev, failed to create debugfs root\n);
-- 
2.1.0

--
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 03/10] [media] coda: add coda_video_device descriptors

2014-10-02 Thread Philipp Zabel
Each video device descriptor determines the name, callback ops, and input and
output formats on the corresponding video device. This simplifies coda_enum_fmt
and coda_try_fmt a bit and will simplify adding separate video devices for JPEG
codecs due to the slightly different behavior in the CodaDx6/CODA7542 case and
a separate hardware unit on CODA960.

Signed-off-by: Philipp Zabel p.za...@pengutronix.de
---
Changes since v1:
 - Combined bitstream encoder devices
---
 drivers/media/platform/coda/coda-common.c | 350 +-
 drivers/media/platform/coda/coda.h|   7 +-
 2 files changed, 204 insertions(+), 153 deletions(-)

diff --git a/drivers/media/platform/coda/coda-common.c 
b/drivers/media/platform/coda/coda-common.c
index fb83c56..45db1da 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -43,6 +43,7 @@
 #define CODA_NAME  coda
 
 #define CODADX6_MAX_INSTANCES  4
+#define CODA_MAX_FORMATS   4
 
 #define CODA_PARA_BUF_SIZE (10 * 1024)
 #define CODA_ISRAM_SIZE(2048 * 2)
@@ -169,6 +170,58 @@ static const struct coda_codec coda9_codecs[] = {
CODA_CODEC(CODA9_MODE_DECODE_MP4,  V4L2_PIX_FMT_MPEG4,  
V4L2_PIX_FMT_YUV420, 1920, 1088),
 };
 
+struct coda_video_device {
+   const char *name;
+   enum coda_inst_type type;
+   const struct coda_context_ops *ops;
+   u32 src_formats[CODA_MAX_FORMATS];
+   u32 dst_formats[CODA_MAX_FORMATS];
+};
+
+static const struct coda_video_device coda_bit_encoder = {
+   .name = coda-encoder,
+   .type = CODA_INST_ENCODER,
+   .ops = coda_bit_encode_ops,
+   .src_formats = {
+   V4L2_PIX_FMT_YUV420,
+   V4L2_PIX_FMT_YVU420,
+   V4L2_PIX_FMT_NV12,
+   },
+   .dst_formats = {
+   V4L2_PIX_FMT_H264,
+   V4L2_PIX_FMT_MPEG4,
+   },
+};
+
+static const struct coda_video_device coda_bit_decoder = {
+   .name = coda-decoder,
+   .type = CODA_INST_DECODER,
+   .ops = coda_bit_decode_ops,
+   .src_formats = {
+   V4L2_PIX_FMT_H264,
+   V4L2_PIX_FMT_MPEG4,
+   },
+   .dst_formats = {
+   V4L2_PIX_FMT_YUV420,
+   V4L2_PIX_FMT_YVU420,
+   V4L2_PIX_FMT_NV12,
+   },
+};
+
+static const struct coda_video_device *codadx6_video_devices[] = {
+   coda_bit_encoder,
+};
+
+static const struct coda_video_device *coda7_video_devices[] = {
+   coda_bit_encoder,
+   coda_bit_decoder,
+};
+
+static const struct coda_video_device *coda9_video_devices[] = {
+   coda_bit_encoder,
+   coda_bit_decoder,
+};
+
 static bool coda_format_is_yuv(u32 fourcc)
 {
switch (fourcc) {
@@ -182,6 +235,18 @@ static bool coda_format_is_yuv(u32 fourcc)
}
 }
 
+static const char *coda_format_name(u32 fourcc)
+{
+   int i;
+
+   for (i = 0; i  ARRAY_SIZE(coda_formats); i++) {
+   if (coda_formats[i].fourcc == fourcc)
+   return coda_formats[i].name;
+   }
+
+   return NULL;
+}
+
 /*
  * Normalize all supported YUV 4:2:0 formats to the value used in the codec
  * tables.
@@ -240,6 +305,17 @@ static void coda_get_max_dimensions(struct coda_dev *dev,
*max_h = h;
 }
 
+const struct coda_video_device *to_coda_video_device(struct video_device *vdev)
+{
+   struct coda_dev *dev = video_get_drvdata(vdev);
+   unsigned int i = vdev - dev-vfd;
+
+   if (i = dev-devtype-num_vdevs)
+   return NULL;
+
+   return dev-devtype-vdevs[i];
+}
+
 const char *coda_product_name(int product)
 {
static char buf[9];
@@ -278,58 +354,28 @@ static int coda_querycap(struct file *file, void *priv,
 static int coda_enum_fmt(struct file *file, void *priv,
 struct v4l2_fmtdesc *f)
 {
-   struct coda_ctx *ctx = fh_to_ctx(priv);
-   const struct coda_codec *codecs = ctx-dev-devtype-codecs;
-   const struct coda_fmt *formats = coda_formats;
-   const struct coda_fmt *fmt;
-   int num_codecs = ctx-dev-devtype-num_codecs;
-   int num_formats = ARRAY_SIZE(coda_formats);
-   int i, k, num = 0;
-   bool yuv;
-
-   if (ctx-inst_type == CODA_INST_ENCODER)
-   yuv = (f-type == V4L2_BUF_TYPE_VIDEO_OUTPUT);
+   struct video_device *vdev = video_devdata(file);
+   const struct coda_video_device *cvd = to_coda_video_device(vdev);
+   const u32 *formats;
+   const char *name;
+
+   if (f-type == V4L2_BUF_TYPE_VIDEO_OUTPUT)
+   formats = cvd-src_formats;
+   else if (f-type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
+   formats = cvd-dst_formats;
else
-   yuv = (f-type == V4L2_BUF_TYPE_VIDEO_CAPTURE);
-
-   for (i = 0; i  num_formats; i++) {
-   /* Skip either raw or compressed formats */
-   if (yuv != coda_format_is_yuv(formats[i].fourcc))
-   continue;
-   

[PATCH v2 01/10] [media] coda: add support for planar YCbCr 4:2:2 (YUV422P) format

2014-10-02 Thread Philipp Zabel
This patch adds support for the three-plane YUV422P format with one luma plane
and two horizontally subsampled chroma planes.

Signed-off-by: Philipp Zabel p.za...@pengutronix.de
---
 drivers/media/platform/coda/coda-bit.c| 14 +-
 drivers/media/platform/coda/coda-common.c | 13 +
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/coda/coda-bit.c 
b/drivers/media/platform/coda/coda-bit.c
index fde7775..746a615 100644
--- a/drivers/media/platform/coda/coda-bit.c
+++ b/drivers/media/platform/coda/coda-bit.c
@@ -1591,6 +1591,7 @@ static void coda_finish_decode(struct coda_ctx *ctx)
struct coda_q_data *q_data_dst;
struct vb2_buffer *dst_buf;
struct coda_timestamp *ts;
+   unsigned long payload;
int width, height;
int decoded_idx;
int display_idx;
@@ -1776,7 +1777,18 @@ static void coda_finish_decode(struct coda_ctx *ctx)
dst_buf-v4l2_buf.timecode = ts-timecode;
dst_buf-v4l2_buf.timestamp = ts-timestamp;
 
-   vb2_set_plane_payload(dst_buf, 0, width * height * 3 / 2);
+   switch (q_data_dst-fourcc) {
+   case V4L2_PIX_FMT_YUV420:
+   case V4L2_PIX_FMT_YVU420:
+   case V4L2_PIX_FMT_NV12:
+   default:
+   payload = width * height * 3 / 2;
+   break;
+   case V4L2_PIX_FMT_YUV422P:
+   payload = width * height * 2;
+   break;
+   }
+   vb2_set_plane_payload(dst_buf, 0, payload);
 
v4l2_m2m_buf_done(dst_buf, ctx-frame_errors[display_idx] ?
  VB2_BUF_STATE_ERROR : VB2_BUF_STATE_DONE);
diff --git a/drivers/media/platform/coda/coda-common.c 
b/drivers/media/platform/coda/coda-common.c
index 02d47fa..48be973 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -100,6 +100,9 @@ void coda_write_base(struct coda_ctx *ctx, struct 
coda_q_data *q_data,
base_cb = base_y + q_data-bytesperline * q_data-height;
base_cr = base_cb + q_data-bytesperline * q_data-height / 4;
break;
+   case V4L2_PIX_FMT_YUV422P:
+   base_cb = base_y + q_data-bytesperline * q_data-height;
+   base_cr = base_cb + q_data-bytesperline * q_data-height / 2;
}
 
coda_write(ctx-dev, base_y, reg_y);
@@ -124,6 +127,10 @@ static const struct coda_fmt coda_formats[] = {
.fourcc = V4L2_PIX_FMT_NV12,
},
{
+   .name = YUV 4:2:2 Planar, YCbCr,
+   .fourcc = V4L2_PIX_FMT_YUV422P,
+   },
+   {
.name = H264 Encoded Stream,
.fourcc = V4L2_PIX_FMT_H264,
},
@@ -168,6 +175,7 @@ static bool coda_format_is_yuv(u32 fourcc)
case V4L2_PIX_FMT_YUV420:
case V4L2_PIX_FMT_YVU420:
case V4L2_PIX_FMT_NV12:
+   case V4L2_PIX_FMT_YUV422P:
return true;
default:
return false;
@@ -393,6 +401,11 @@ static int coda_try_fmt(struct coda_ctx *ctx, const struct 
coda_codec *codec,
f-fmt.pix.sizeimage = f-fmt.pix.bytesperline *
f-fmt.pix.height * 3 / 2;
break;
+   case V4L2_PIX_FMT_YUV422P:
+   f-fmt.pix.bytesperline = round_up(f-fmt.pix.width, 16);
+   f-fmt.pix.sizeimage = f-fmt.pix.bytesperline *
+   f-fmt.pix.height * 2;
+   break;
case V4L2_PIX_FMT_H264:
case V4L2_PIX_FMT_MPEG4:
case V4L2_PIX_FMT_JPEG:
-- 
2.1.0

--
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 07/10] [media] coda: store bitstream buffer position with buffer metadata

2014-10-02 Thread Philipp Zabel
Storing the buffer position in the bitstream with the buffer metadata
allows to later use that information to drop metadata for skipped buffers
and to determine whether bitstream padding has to be applied.

This patch also renames struct coda_timestamp to struct coda_buffer_meta
to make clear that it contains more than only the buffer timestamp.

Signed-off-by: Philipp Zabel p.za...@pengutronix.de
---
 drivers/media/platform/coda/coda-bit.c| 53 ++-
 drivers/media/platform/coda/coda-common.c | 14 
 drivers/media/platform/coda/coda.h|  8 +++--
 3 files changed, 43 insertions(+), 32 deletions(-)

diff --git a/drivers/media/platform/coda/coda-bit.c 
b/drivers/media/platform/coda/coda-bit.c
index 931248d..d1ecda5 100644
--- a/drivers/media/platform/coda/coda-bit.c
+++ b/drivers/media/platform/coda/coda-bit.c
@@ -217,11 +217,16 @@ static bool coda_bitstream_try_queue(struct coda_ctx *ctx,
 void coda_fill_bitstream(struct coda_ctx *ctx)
 {
struct vb2_buffer *src_buf;
-   struct coda_timestamp *ts;
+   struct coda_buffer_meta *meta;
+   u32 start;
 
while (v4l2_m2m_num_src_bufs_ready(ctx-fh.m2m_ctx)  0) {
src_buf = v4l2_m2m_next_src_buf(ctx-fh.m2m_ctx);
 
+   /* Buffer start position */
+   start = ctx-bitstream_fifo.kfifo.in 
+   ctx-bitstream_fifo.kfifo.mask;
+
if (coda_bitstream_try_queue(ctx, src_buf)) {
/*
 * Source buffer is queued in the bitstream ringbuffer;
@@ -229,12 +234,16 @@ void coda_fill_bitstream(struct coda_ctx *ctx)
 */
src_buf = v4l2_m2m_src_buf_remove(ctx-fh.m2m_ctx);
 
-   ts = kmalloc(sizeof(*ts), GFP_KERNEL);
-   if (ts) {
-   ts-sequence = src_buf-v4l2_buf.sequence;
-   ts-timecode = src_buf-v4l2_buf.timecode;
-   ts-timestamp = src_buf-v4l2_buf.timestamp;
-   list_add_tail(ts-list, ctx-timestamp_list);
+   meta = kmalloc(sizeof(*meta), GFP_KERNEL);
+   if (meta) {
+   meta-sequence = src_buf-v4l2_buf.sequence;
+   meta-timecode = src_buf-v4l2_buf.timecode;
+   meta-timestamp = src_buf-v4l2_buf.timestamp;
+   meta-start = start;
+   meta-end = ctx-bitstream_fifo.kfifo.in 
+   ctx-bitstream_fifo.kfifo.mask;
+   list_add_tail(meta-list,
+ ctx-buffer_meta_list);
}
 
v4l2_m2m_buf_done(src_buf, VB2_BUF_STATE_DONE);
@@ -1629,7 +1638,7 @@ static void coda_finish_decode(struct coda_ctx *ctx)
struct coda_q_data *q_data_src;
struct coda_q_data *q_data_dst;
struct vb2_buffer *dst_buf;
-   struct coda_timestamp *ts;
+   struct coda_buffer_meta *meta;
unsigned long payload;
int width, height;
int decoded_idx;
@@ -1757,23 +1766,23 @@ static void coda_finish_decode(struct coda_ctx *ctx)
val = coda_read(dev, CODA_RET_DEC_PIC_FRAME_NUM) - 1;
val -= ctx-sequence_offset;
mutex_lock(ctx-bitstream_mutex);
-   if (!list_empty(ctx-timestamp_list)) {
-   ts = list_first_entry(ctx-timestamp_list,
- struct coda_timestamp, list);
-   list_del(ts-list);
-   if (val != (ts-sequence  0x)) {
+   if (!list_empty(ctx-buffer_meta_list)) {
+   meta = list_first_entry(ctx-buffer_meta_list,
+ struct coda_buffer_meta, list);
+   list_del(meta-list);
+   if (val != (meta-sequence  0x)) {
v4l2_err(dev-v4l2_dev,
 sequence number mismatch (%d(%d) != 
%d)\n,
 val, ctx-sequence_offset,
-ts-sequence);
+meta-sequence);
}
-   ctx-frame_timestamps[decoded_idx] = *ts;
-   kfree(ts);
+   ctx-frame_metas[decoded_idx] = *meta;
+   kfree(meta);
} else {
v4l2_err(dev-v4l2_dev, empty timestamp list!\n);
-   memset(ctx-frame_timestamps[decoded_idx], 0,
-  sizeof(struct coda_timestamp));
-   ctx-frame_timestamps[decoded_idx].sequence = val;
+   

FOSDEM15: Graphics DevRoom: call for speakers.

2014-10-02 Thread Luc Verhaegen
Hi,

At FOSDEM on the 31st of january and the 1st of February 2015, there 
will be another graphics DevRoom. URL: https://fosdem.org/2015/

The focus of this DevRoom is of course the same as last year, namely:
* Graphics drivers: from display to media to 3d drivers, both in kernel 
  or userspace. Be it part of DRM, KMS, (direct)FB, V4L, Xorg, Mesa...
* Input drivers: kernel and userspace.
* Windowing systems: X, Wayland, Mir, directFB, ...
* Even colour management and other areas which i might have overlooked 
  above are accepted.

Slots are 50 minutes long, and scheduled hourly. This partly to avoid 
confusion and people running all over the place all the time. As a 
speaker, you do not have to fill your whole hour, gaps are never wasted 
time.

Slots will be handed out on a first come, first serve basis. The best 
slots will go to those who apply the earliest. The amount of slots is 
currently not known yet, but i expect there to be around 16 available (8 
on each day), so act quickly.

Talk Submission:


Like last year, the pentabarf system will be used for talk submission. 
It is not perfect from a devroom organizer and talk submitters usability 
point-of-view, but the fosdem organizers are working on it. It is 
however workable and it ended up working out pretty well last year.

https://penta.fosdem.org/submission/FOSDEM15

Remember that FOSDEM is not like XDC, it's not some 50 odd people 
meeting with a sliding schedule which only gets filled out on the last 
day. Upwards of 8000 people are visiting this event, and most of them 
get a printed booklet or use the schedule on the FOSDEM website or an 
app for their phone to figure out what to watch or participate in next. 
So please put some effort in your talk submission and details.

Since this an open source community event, please refrain from turning 
in a talk that is a pure corporate or product commercial. Also, if you 
are unsure on whether you can come or not (this is FOSDEM, why are you 
not there anyway?), please wait with submitting your talk. Submitting a 
talk and then not turning up because you could not be bothered is a 
sure-fire way to get larted and then to never be allowed to talk again.

As for deadlines, i hope to have a pretty much complete schedule between 
christmas and the new year. The rockhard printed schedule deadline is 
probably January 9th, after that you will not be featured in the booklet 
and you will have a lot less visitors. I will hopefully be able to lock 
down entries and descriptions after that date.

Don't count on this deadline: first come first serve! There are perhaps 
only 16 slots. And the worst slots will be assigned to those who come 
last. Do you really want to talk on saturday at 10:00 when people are 
still in zombie mode after the beer event, if they are there at all?

Use your account from last year, so you can try to recycle some of your 
data from last year. If you have forgotten your password, then you can 
reset it here: https://penta.fosdem.org/user/forgot_password

Necessary information:
--

Below is a list of what i need to see filled in when you apply for a 
devroom before i consider it a valid submission. Remember: first come, 
first serve. The best slots are for the earliest submissions and there 
are only around 16 slots.

On your personal page:
* General:
  * First and last name
  * Nickname
  * Image
* Contact:
  * email
  * mobile number (this is a very hard requirement as there will be no 
other reliable form of emergency communication on the day)
* Description:
  * Abstract
  * Description

Create an event:
* On the General page:
  * Event title
  * Event subtitle.
  * Track: Graphics Devroom
  * Event type: Lecture (talk) or Meeting (BoF)
* Persons:
  * Add yourself as speaker.
* Description:
  * Abstract:
  * Full Description
* Links:
  * Add relevant links.

Everything else can be ignored or will be filled in by me or the FOSDEM 
organizers.

That's about it. Hope to see you all at FOSDEM :)

Luc Verhaegen.
--
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


Re: [PATCH] v4l: uvcvideo: Fix buffer completion size check

2014-10-02 Thread Laurent Pinchart
Hi Guennadi,

Ping ?

On Wednesday 01 October 2014 00:42:51 Laurent Pinchart wrote:
 Commit e93e7fd9f5a3fffec7792dbcc4c3574653effda7 (v4l2: uvcvideo: Allow
 using larger buffers) reworked the buffer size sanity check at buffer
 completion time to use the frame size instead of the allocated buffer
 size. However, it introduced two bugs in doing so:
 
 - it assigned the allocated buffer size to the frame_size field, instead
   of assigning the correct frame size
 
 - it performed the assignment in the S_FMT handler, resulting in the
   frame_size field being uninitialized if the userspace application
   doesn't call S_FMT.
 
 Fix both issues by removing the frame_size field and validating the
 buffer size against the UVC video control dwMaxFrameSize.
 
 Fixes: e93e7fd9f5a3 (v4l2: uvcvideo: Allow using larger buffers)
 Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
 ---
  drivers/media/usb/uvc/uvc_v4l2.c  | 1 -
  drivers/media/usb/uvc/uvc_video.c | 2 +-
  drivers/media/usb/uvc/uvcvideo.h  | 1 -
  3 files changed, 1 insertion(+), 3 deletions(-)
 
 Guennadi, could you please test and ack this ASAP, as the bug needs to be
 fixed for v3.18-rc1 if possible ?
 
 diff --git a/drivers/media/usb/uvc/uvc_v4l2.c
 b/drivers/media/usb/uvc/uvc_v4l2.c index f205934..f33a067 100644
 --- a/drivers/media/usb/uvc/uvc_v4l2.c
 +++ b/drivers/media/usb/uvc/uvc_v4l2.c
 @@ -318,7 +318,6 @@ static int uvc_v4l2_set_format(struct uvc_streaming
 *stream, stream-ctrl = probe;
   stream-cur_format = format;
   stream-cur_frame = frame;
 - stream-frame_size = fmt-fmt.pix.sizeimage;
 
  done:
   mutex_unlock(stream-mutex);
 diff --git a/drivers/media/usb/uvc/uvc_video.c
 b/drivers/media/usb/uvc/uvc_video.c index 9ace520..df81b9c 100644
 --- a/drivers/media/usb/uvc/uvc_video.c
 +++ b/drivers/media/usb/uvc/uvc_video.c
 @@ -1143,7 +1143,7 @@ static int uvc_video_encode_data(struct uvc_streaming
 *stream, static void uvc_video_validate_buffer(const struct uvc_streaming
 *stream, struct uvc_buffer *buf)
  {
 - if (stream-frame_size != buf-bytesused 
 + if (stream-ctrl.dwMaxVideoFrameSize != buf-bytesused 
   !(stream-cur_format-flags  UVC_FMT_FLAG_COMPRESSED))
   buf-error = 1;
  }
 diff --git a/drivers/media/usb/uvc/uvcvideo.h
 b/drivers/media/usb/uvc/uvcvideo.h index f585c08..897cfd8 100644
 --- a/drivers/media/usb/uvc/uvcvideo.h
 +++ b/drivers/media/usb/uvc/uvcvideo.h
 @@ -458,7 +458,6 @@ struct uvc_streaming {
   struct uvc_format *def_format;
   struct uvc_format *cur_format;
   struct uvc_frame *cur_frame;
 - size_t frame_size;
 
   /* Protect access to ctrl, cur_format, cur_frame and hardware video
* probe control.

-- 
Regards,

Laurent Pinchart

--
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] pt3 (pci, tc90522, mxl301rf, qm1d1c0042): pt3_unregister_subdev(), pt3_unregister_subdev(), cleanups...

2014-10-02 Thread Буди Романто, AreMa Inc
DVB driver for Earthsoft PT3 PCIE ISDB-S/T receiver
^^^

Status: stable

Changes:
- demod  tuners converted to I2C binding model
- i586  x86_64 clean compile
- lightweight  yet precise CNR calculus
- raw CNR (DVBv3)
- DVBv5 CNR @ 0.0001 dB (ref: include/uapi/linux/dvb/frontend.h, not 1/1000 dB!)
- removed (unused?) tuner's *_release()
- demod/tuner binding: pt3_unregister_subdev(), pt3_unregister_subdev()
- some cleanups

Features:
- tuning enhancements (compared to PT1 DVB)
1. in addition to the real frequency:
ISDB-S : freq. channel ID
ISDB-T : freq# (I/O# +128), ch#, ch# +64 for CATV
2. in addition to TSID:
ISDB-S : slot#
- allocated devices
ISDB-S : /dev/dvb/adapter0, /dev/dvb/adapter1
ISDB-T : /dev/dvb/adapter2, /dev/dvb/adapter3

Main components:
1. SharpVA4M6JC2103 : contains 2 ISDB-S + 2 ISDB-T tuners
ISDB-S : Sharp QM1D1C0042 RF-IC
ISDB-T : MaxLinear CMOS Hybrid TV MxL301RF
2. Toshiba  TC90522XBG  : quad demodulator (2ch OFDM + 2ch 8PSK)
3. Altera   EP4CGX15BF14C8N : customized FPGA PCI bridge

Full package:
- URL:  https://github.com/knight-rider/ptx/tree/master/pt3_dvb

Signed-off-by: Буди Романто, AreMa Inc knightri...@are.ma
---
 drivers/media/dvb-frontends/Kconfig   |6 +-
 drivers/media/dvb-frontends/Makefile  |1 +
 drivers/media/dvb-frontends/tc90522.c | 1145 -
 drivers/media/dvb-frontends/tc90522.h |   39 +-
 drivers/media/pci/pt3/Kconfig |   11 +-
 drivers/media/pci/pt3/Makefile|8 +-
 drivers/media/pci/pt3/pt3_common.h|   85 +++
 drivers/media/pci/pt3/pt3_dma.c   |  461 -
 drivers/media/pci/pt3/pt3_dma.h   |   50 ++
 drivers/media/pci/pt3/pt3_i2c.c   |  281 
 drivers/media/pci/pt3/pt3_i2c.h   |   25 +
 drivers/media/pci/pt3/pt3_pci.c   |  435 +
 drivers/media/tuners/mxl301rf.c   |  549 
 drivers/media/tuners/mxl301rf.h   |   23 +-
 drivers/media/tuners/qm1d1c0042.c |  643 +-
 drivers/media/tuners/qm1d1c0042.h |   32 +-
 16 files changed, 2054 insertions(+), 1740 deletions(-)
 create mode 100644 drivers/media/pci/pt3/pt3_common.h
 create mode 100644 drivers/media/pci/pt3/pt3_dma.h
 create mode 100644 drivers/media/pci/pt3/pt3_i2c.h
 create mode 100644 drivers/media/pci/pt3/pt3_pci.c

diff --git a/drivers/media/dvb-frontends/Kconfig 
b/drivers/media/dvb-frontends/Kconfig
index 5a13454..cd07b17 100644
--- a/drivers/media/dvb-frontends/Kconfig
+++ b/drivers/media/dvb-frontends/Kconfig
@@ -621,7 +621,7 @@ config DVB_S5H1411
  An ATSC 8VSB and QAM64/256 tuner module. Say Y when you want
  to support this frontend.
 
-comment ISDB-T (terrestrial) frontends
+comment ISDB-S (satellite)  ISDB-T (terrestrial) frontends
depends on DVB_CORE
 
 config DVB_S921
@@ -649,11 +649,11 @@ config DVB_MB86A20S
  Say Y when you want to support this frontend.
 
 config DVB_TC90522
-   tristate Toshiba TC90522
+   tristate Toshiba TC90522XBG 8PSK(ISDB-S)/OFDM(ISDB-T)
depends on DVB_CORE  I2C
default m if !MEDIA_SUBDRV_AUTOSELECT
help
- A Toshiba TC90522 2xISDB-T + 2xISDB-S demodulator.
+ Toshiba TC90522XBG 2xISDB-S(8PSK) + 2xISDB-T(OFDM) demodulator.
  Say Y when you want to support this frontend.
 
 comment Digital terrestrial only tuners/PLL
diff --git a/drivers/media/dvb-frontends/Makefile 
b/drivers/media/dvb-frontends/Makefile
index ba59df6..6f05615 100644
--- a/drivers/media/dvb-frontends/Makefile
+++ b/drivers/media/dvb-frontends/Makefile
@@ -116,3 +116,4 @@ obj-$(CONFIG_DVB_M88RS2000) += m88rs2000.o
 obj-$(CONFIG_DVB_AF9033) += af9033.o
 obj-$(CONFIG_DVB_AS102_FE) += as102_fe.o
 obj-$(CONFIG_DVB_TC90522) += tc90522.o
+
diff --git a/drivers/media/dvb-frontends/tc90522.c 
b/drivers/media/dvb-frontends/tc90522.c
index d9905fb..954ca8d 100644
--- a/drivers/media/dvb-frontends/tc90522.c
+++ b/drivers/media/dvb-frontends/tc90522.c
@@ -1,12 +1,12 @@
 /*
- * Toshiba TC90522 Demodulator
+ * Toshiba TC90522XBG 2ch OFDM(ISDB-T) + 2ch 8PSK(ISDB-S) demodulator frontend 
for Earthsoft PT3
  *
- * Copyright (C) 2014 Akihiro Tsukada tsk...@gmail.com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation version 2.
+ * Copyright (C) 2014 Budi Rachmanto, AreMa Inc. i...@are.ma
  *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -14,827 +14,534 @@
  * GNU General Public License for 

[PATCH] [media] doc: fix broken v4l-utils URL

2014-10-02 Thread Michael Opdenacker
This replaces http://git.linuxtv.org/v4l-utils/ (broken link)
by http://git.linuxtv.org/cgit.cgi/v4l-utils.git/

Signed-off-by: Michael Opdenacker michael.opdenac...@free-electrons.com
---
 Documentation/DocBook/media/v4l/common.xml | 2 +-
 drivers/media/rc/keymaps/Kconfig   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/DocBook/media/v4l/common.xml 
b/Documentation/DocBook/media/v4l/common.xml
index 71f6bf9e735e..8b5e014224d6 100644
--- a/Documentation/DocBook/media/v4l/common.xml
+++ b/Documentation/DocBook/media/v4l/common.xml
@@ -110,7 +110,7 @@ makes no provisions to find these related devices. Some 
really
 complex devices use the Media Controller (see xref linkend=media_controller 
/)
 which can be used for this purpose. But most drivers do not use it,
 and while some code exists that uses sysfs to discover related devices
-(see libmedia_dev in the ulink 
url=http://git.linuxtv.org/v4l-utils/;v4l-utils/ulink
+(see libmedia_dev in the ulink 
url=http://git.linuxtv.org/cgit.cgi/v4l-utils.git/;v4l-utils/ulink
 git repository), there is no library yet that can provide a single API towards
 both Media Controller-based devices and devices that do not use the Media 
Controller.
 If you want to work on this please write to the linux-media mailing list: 
v4l-ml;./para
diff --git a/drivers/media/rc/keymaps/Kconfig b/drivers/media/rc/keymaps/Kconfig
index 8e615fd55852..767423bbbdd0 100644
--- a/drivers/media/rc/keymaps/Kconfig
+++ b/drivers/media/rc/keymaps/Kconfig
@@ -12,4 +12,4 @@ config RC_MAP
   The ir-keytable program, available at v4l-utils package
   provide the tool and the same RC maps for load from
   userspace. Its available at
-   http://git.linuxtv.org/v4l-utils
+   http://git.linuxtv.org/cgit.cgi/v4l-utils.git/
-- 
1.9.1

--
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


[GIT PULL for v3.17] media fixes

2014-10-02 Thread Mauro Carvalho Chehab
Hi Linus,

Please pull from:
  git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 
tags/media/v3.17-rc8

For one last time regression fix at em28xx. The removal of .reset_resume
broke suspend/resume on this driver for some devices.

There are more fixes to be done for em28xx suspend/resume to be better
handled, but I'm opting to let them to stay for a while at the media devel
tree, in order to get more tests. So, for now, let's just revert this patch.

Thanks!
Mauro

The following changes since commit 8e2c8717c1812628b5538c05250057b37c66fdbe:

  [media] em28xx-v4l: get rid of field users in struct em28xx_v4l2 
(2014-09-21 21:27:57 -0300)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 
tags/media/v3.17-rc8

for you to fetch changes up to 90a5dbef1a66e9f55b76ccb83c0ef27c0bd87c27:

  Revert [media] media: em28xx - remove reset_resume interface (2014-09-28 
22:25:24 -0300)


media fixes for v3.17-rc8


Mauro Carvalho Chehab (1):
  Revert [media] media: em28xx - remove reset_resume interface

 drivers/media/usb/em28xx/em28xx-cards.c | 1 +
 1 file changed, 1 insertion(+)

--
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


[GIT PULL FOR 3.18] smiapp, smiapp-pll improvements, fixes

2014-10-02 Thread Sakari Ailus
Hi Mauro,

This set contains a number of fixes to the smiapp driver and the smiapp-pll
pll calculator. Some of the issues had been there for longer while the
(harmless) lockdep warning got introduced by smiapp: Use unlocked
__v4l2_ctrl_modify_range().

The format and link frequency combinations are now validated during sensor
initialisation so it's impossible to select an invalid combination anymore.
The driver would simply have returned an error to the user who likely had
little idea of what was wrong.

Please pull.


The following changes since commit cf3167cf1e969b17671a4d3d956d22718a8ceb85:

  [media] pt3: fix DTV FE I2C driver load error paths (2014-09-28 22:23:42 
-0300)

are available in the git repository at:

  ssh://linuxtv.org/git/sailus/media_tree.git smiapp

for you to fetch changes up to 684ca184c145f20b42f84b1277df0cc955b32371:

  smiapp: Update PLL when setting format (2014-10-03 00:37:35 +0300)


Sakari Ailus (18):
  smiapp: Take mutex during PLL update in sensor initialisation
  smiapp-pll: Correct clock debug prints
  smiapp-pll: The clock tree values are unsigned --- fix debug prints
  smiapp-pll: Separate bounds checking into a separate function
  smiapp-pll: External clock frequency isn't an output value
  smiapp-pll: Unify OP and VT PLL structs
  smiapp-pll: Calculate OP clocks only for sensors that have them
  smiapp-pll: Don't validate OP clocks if there are none
  smiapp: The PLL calculator handles sensors with VT clocks only
  smiapp: Remove validation of op_pix_clk_div
  smiapp-pll: Add pixel rate in pixel array as output parameters
  smiapp: Use actual pixel rate calculated by the PLL calculator
  smiapp: Split calculating PLL with sensor's limits from updating it
  smiapp: Gather information on valid link rate and BPP combinations
  smiapp: Take valid link frequencies into account in supported mbus codes
  smiapp: Clean up smiapp_set_format()
  smiapp: Set valid link frequency range
  smiapp: Update PLL when setting format

 drivers/media/i2c/smiapp-pll.c |  280 ++--
 drivers/media/i2c/smiapp-pll.h |   21 +--
 drivers/media/i2c/smiapp/smiapp-core.c |  220 -
 drivers/media/i2c/smiapp/smiapp.h  |8 +
 4 files changed, 321 insertions(+), 208 deletions(-)

-- 
Kind regards,

Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
--
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 1/1] of: Add a function to read 64-bit arrays

2014-10-02 Thread Sakari Ailus
Implement of_property_read_u64_array() for reading 64-bit arrays.

This is needed for e.g. reading the valid link frequencies in the smiapp
driver.

Signed-off-by: Sakari Ailus sakari.ai...@iki.fi
---
Hi,

While the smiapp (found in drivers/media/i2c/smiapp/) OF support which needs
this isn't in yet, other drivers such as mt9v032 which would be reading the
valid link frequency control values will need reading arrays. This might
make it to v4l2-of.c in the end.

 drivers/of/base.c  |   44 
 include/linux/of.h |3 +++
 2 files changed, 39 insertions(+), 8 deletions(-)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index d8574ad..35e24f4 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -1214,6 +1214,41 @@ int of_property_read_u32_array(const struct device_node 
*np,
 EXPORT_SYMBOL_GPL(of_property_read_u32_array);
 
 /**
+ * of_property_read_u64_array - Find and read an array of 64 bit integers
+ * from a property.
+ *
+ * @np:device node from which the property value is to be read.
+ * @propname:  name of the property to be searched.
+ * @out_values:pointer to return value, modified only if return value 
is 0.
+ * @sz:number of array elements to read
+ *
+ * Search for a property in a device node and read 64-bit value(s) from
+ * it. Returns 0 on success, -EINVAL if the property does not exist,
+ * -ENODATA if property does not have a value, and -EOVERFLOW if the
+ * property data isn't large enough.
+ *
+ * The out_values is modified only if a valid u32 value can be decoded.
+ */
+int of_property_read_u64_array(const struct device_node *np,
+  const char *propname, u64 *out_value, size_t sz)
+{
+   const __be32 *val = of_find_property_value_of_size(
+   np, propname, sz * sizeof(*out_value));
+
+   if (IS_ERR(val))
+   return PTR_ERR(val);
+
+   while (sz--) {
+   *out_value = of_read_number(val, 2);
+   out_value++;
+   val += 2;
+   }
+
+   return 0;
+}
+EXPORT_SYMBOL_GPL(of_property_read_u64_array);
+
+/**
  * of_property_read_u64 - Find and read a 64 bit integer from a property
  * @np:device node from which the property value is to be read.
  * @propname:  name of the property to be searched.
@@ -1229,14 +1264,7 @@ EXPORT_SYMBOL_GPL(of_property_read_u32_array);
 int of_property_read_u64(const struct device_node *np, const char *propname,
 u64 *out_value)
 {
-   const __be32 *val = of_find_property_value_of_size(np, propname,
-   sizeof(*out_value));
-
-   if (IS_ERR(val))
-   return PTR_ERR(val);
-
-   *out_value = of_read_number(val, 2);
-   return 0;
+   return of_property_read_u64_array(np, propname, out_value, 1);
 }
 EXPORT_SYMBOL_GPL(of_property_read_u64);
 
diff --git a/include/linux/of.h b/include/linux/of.h
index 6c4363b..e84533f 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -263,6 +263,9 @@ extern int of_property_read_u32_array(const struct 
device_node *np,
  size_t sz);
 extern int of_property_read_u64(const struct device_node *np,
const char *propname, u64 *out_value);
+extern int of_property_read_u64_array(const struct device_node *np,
+ const char *propname, u64 *out_value,
+ size_t sz);
 
 extern int of_property_read_string(struct device_node *np,
   const char *propname,
-- 
1.7.10.4

--
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


color box, display box, corrugated box, color card, blister card, color sleeve, hang tag, label

2014-10-02 Thread Jinghao Printing - CHINA
Hi, this is David Wu from Shanghai, China.
We are a printing company, we can print color box, corrugated box,
label, hang tag etc.
Please let me know if you need these.

I will send you the website then.

Best regards,
David Wu
--
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


Re: [PATCH] Fixed all coding style issues for drivers/staging/media/lirc/

2014-10-02 Thread Antti Palosaari



On 10/02/2014 07:45 PM, Joe Perches wrote:

On Thu, 2014-10-02 at 10:29 -0300, Mauro Carvalho Chehab wrote:

Em Wed, 01 Oct 2014 21:40:02 -0700 Amber Thrall amber.rose.thr...@gmail.com 
escreveu:

Fixed various coding style issues, including strings over 80 characters long 
and many
deprecated printk's have been replaced with proper methods.

[]

diff --git a/drivers/staging/media/lirc/lirc_imon.c 
b/drivers/staging/media/lirc/lirc_imon.c

[]

@@ -623,8 +623,8 @@ static void imon_incoming_packet(struct imon_context 
*context,
if (debug) {
dev_info(dev, raw packet: );
for (i = 0; i  len; ++i)
-   printk(%02x , buf[i]);
-   printk(\n);
+   dev_info(dev, %02x , buf[i]);
+   dev_info(dev, \n);
}


This is wrong, as the second printk should be printk_cont.

The best here would be to change all above to use %*ph.
So, just:

dev_debug(dev, raw packet: %*ph\n, len, buf);


Not quite.

%*ph is length limited and only useful for lengths  30 or so.
Even then, it's pretty ugly.

print_hex_dump_debug() is generally better.


That is place where you print 8 debug bytes, which are received remote 
controller code. IMHO %*ph format is just what you like in that case.


Why print_hex_dump_debug() is better? IIRC it could not be even 
controlled like those dynamic debug printings.


regards
Antti

--
http://palosaari.fi/
--
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


Re: [PATCH] Fixed all coding style issues for drivers/staging/media/lirc/

2014-10-02 Thread Joe Perches
On Fri, 2014-10-03 at 02:58 +0300, Antti Palosaari wrote:
 On 10/02/2014 07:45 PM, Joe Perches wrote:
  On Thu, 2014-10-02 at 10:29 -0300, Mauro Carvalho Chehab wrote:
  Em Wed, 01 Oct 2014 21:40:02 -0700 Amber Thrall 
  amber.rose.thr...@gmail.com escreveu:
  Fixed various coding style issues, including strings over 80 characters 
  long and many
  deprecated printk's have been replaced with proper methods.
  []
  diff --git a/drivers/staging/media/lirc/lirc_imon.c 
  b/drivers/staging/media/lirc/lirc_imon.c
  []
  @@ -623,8 +623,8 @@ static void imon_incoming_packet(struct imon_context 
  *context,
if (debug) {
dev_info(dev, raw packet: );
for (i = 0; i  len; ++i)
  - printk(%02x , buf[i]);
  - printk(\n);
  + dev_info(dev, %02x , buf[i]);
  + dev_info(dev, \n);
}
 
  This is wrong, as the second printk should be printk_cont.
 
  The best here would be to change all above to use %*ph.
  So, just:
 
 dev_debug(dev, raw packet: %*ph\n, len, buf);
 
  Not quite.
 
  %*ph is length limited and only useful for lengths  30 or so.
  Even then, it's pretty ugly.
 
  print_hex_dump_debug() is generally better.
 
 That is place where you print 8 debug bytes, which are received remote 
 controller code. IMHO %*ph format is just what you like in that case.

Hi Antti.

I stand by my statement as I only looked at the
patch snippet itself, not any function real code.

In the actual code, there's a test above it:

if (len != 8) {
dev_warn(dev, imon %s: invalid incoming packet size (len = %d, 
intf%d)\n,
__func__, len, intf);
return;
}

So in my opinion, this would be better/smaller as:

dev_dbg(dev, raw packet: %8ph\n, urb-transfer_buffer);

 Why print_hex_dump_debug() is better? IIRC it could not be even 
 controlled like those dynamic debug printings.

Nope, it is. (from printk.h)

#if defined(CONFIG_DYNAMIC_DEBUG)
#define print_hex_dump_debug(prefix_str, prefix_type, rowsize,  \
 groupsize, buf, len, ascii)\
dynamic_hex_dump(prefix_str, prefix_type, rowsize,  \
 groupsize, buf, len, ascii)
#else
#define print_hex_dump_debug(prefix_str, prefix_type, rowsize,  \
 groupsize, buf, len, ascii)\
print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, rowsize,\
   groupsize, buf, len, ascii)
#endif /* defined(CONFIG_DYNAMIC_DEBUG) */

It prints multiple lines when the length is  16.
It prints the ascii along with the hex if desired.

cheers, Joe

--
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] Staging: media: lirc: cleaned up packet dump in 2 files.

2014-10-02 Thread Amber Thrall
lirc_imon.c and lirc_sasem.c contain an incoming_packet method that
is using deprecated printk's.  Removed blocks replacing with single
dev_info with a %*ph format instead.

Signed-off-by: Amber Thrall amber.rose.thr...@gmail.com
---
 drivers/staging/media/lirc/lirc_imon.c  | 10 ++
 drivers/staging/media/lirc/lirc_sasem.c | 10 ++
 2 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_imon.c 
b/drivers/staging/media/lirc/lirc_imon.c
index 7aca44f..232edd5 100644
--- a/drivers/staging/media/lirc/lirc_imon.c
+++ b/drivers/staging/media/lirc/lirc_imon.c
@@ -606,7 +606,6 @@ static void imon_incoming_packet(struct imon_context 
*context,
struct device *dev = context-driver-dev;
int octet, bit;
unsigned char mask;
-   int i;
 
/*
 * just bail out if no listening IR client
@@ -620,13 +619,8 @@ static void imon_incoming_packet(struct imon_context 
*context,
return;
}
 
-   if (debug) {
-   dev_info(dev, raw packet: );
-   for (i = 0; i  len; ++i)
-   printk(%02x , buf[i]);
-   printk(\n);
-   }
-
+   if (debug)
+   dev_info(dev, raw packet: %*ph\n, len, buf);
/*
 * Translate received data to pulse and space lengths.
 * Received data is active low, i.e. pulses are 0 and
diff --git a/drivers/staging/media/lirc/lirc_sasem.c 
b/drivers/staging/media/lirc/lirc_sasem.c
index c20ef56..2f0463e 100644
--- a/drivers/staging/media/lirc/lirc_sasem.c
+++ b/drivers/staging/media/lirc/lirc_sasem.c
@@ -573,7 +573,6 @@ static void incoming_packet(struct sasem_context *context,
unsigned char *buf = urb-transfer_buffer;
long ms;
struct timeval tv;
-   int i;
 
if (len != 8) {
dev_warn(context-dev-dev,
@@ -582,13 +581,8 @@ static void incoming_packet(struct sasem_context *context,
return;
}
 
-   if (debug) {
-   printk(KERN_INFO Incoming data: );
-   for (i = 0; i  8; ++i)
-   printk(KERN_CONT %02x , buf[i]);
-   printk(KERN_CONT \n);
-   }
-
+   if (debug)
+   dev_info(context-dev-dev, Incoming data: %*ph\n, len, buf);
/*
 * Lirc could deal with the repeat code, but we really need to block it
 * if it arrives too late.  Otherwise we could repeat the wrong code.
-- 
2.1.2

--
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


cron job: media_tree daily build: WARNINGS

2014-10-02 Thread Hans Verkuil
This message is generated daily by a cron job that builds media_tree for
the kernels and architectures in the list below.

Results of the daily build of media_tree:

date:   Fri Oct  3 04:00:20 CEST 2014
git branch: test
git hash:   cf3167cf1e969b17671a4d3d956d22718a8ceb85
gcc version:i686-linux-gcc (GCC) 4.9.1
sparse version: v0.5.0-20-g7abd8a7
host hardware:  x86_64
host os:3.16-3.slh.1-amd64

linux-git-arm-at91: OK
linux-git-arm-davinci: OK
linux-git-arm-exynos: OK
linux-git-arm-mx: OK
linux-git-arm-omap: OK
linux-git-arm-omap1: OK
linux-git-arm-pxa: OK
linux-git-blackfin: OK
linux-git-i686: OK
linux-git-m32r: OK
linux-git-mips: OK
linux-git-powerpc64: OK
linux-git-sh: OK
linux-git-x86_64: OK
linux-2.6.32.27-i686: WARNINGS
linux-2.6.33.7-i686: WARNINGS
linux-2.6.34.7-i686: WARNINGS
linux-2.6.35.9-i686: WARNINGS
linux-2.6.36.4-i686: WARNINGS
linux-2.6.37.6-i686: WARNINGS
linux-2.6.38.8-i686: WARNINGS
linux-2.6.39.4-i686: WARNINGS
linux-3.0.60-i686: WARNINGS
linux-3.1.10-i686: WARNINGS
linux-3.2.37-i686: WARNINGS
linux-3.3.8-i686: WARNINGS
linux-3.4.27-i686: WARNINGS
linux-3.5.7-i686: WARNINGS
linux-3.6.11-i686: WARNINGS
linux-3.7.4-i686: WARNINGS
linux-3.8-i686: WARNINGS
linux-3.9.2-i686: WARNINGS
linux-3.10.1-i686: OK
linux-3.11.1-i686: WARNINGS
linux-3.12.23-i686: WARNINGS
linux-3.13.11-i686: WARNINGS
linux-3.14.9-i686: WARNINGS
linux-3.15.2-i686: OK
linux-3.16-i686: OK
linux-3.17-rc1-i686: OK
linux-2.6.32.27-x86_64: WARNINGS
linux-2.6.33.7-x86_64: WARNINGS
linux-2.6.34.7-x86_64: WARNINGS
linux-2.6.35.9-x86_64: WARNINGS
linux-2.6.36.4-x86_64: WARNINGS
linux-2.6.37.6-x86_64: WARNINGS
linux-2.6.38.8-x86_64: WARNINGS
linux-2.6.39.4-x86_64: WARNINGS
linux-3.0.60-x86_64: WARNINGS
linux-3.1.10-x86_64: WARNINGS
linux-3.2.37-x86_64: WARNINGS
linux-3.3.8-x86_64: WARNINGS
linux-3.4.27-x86_64: WARNINGS
linux-3.5.7-x86_64: WARNINGS
linux-3.6.11-x86_64: WARNINGS
linux-3.7.4-x86_64: WARNINGS
linux-3.8-x86_64: WARNINGS
linux-3.9.2-x86_64: WARNINGS
linux-3.10.1-x86_64: OK
linux-3.11.1-x86_64: WARNINGS
linux-3.12.23-x86_64: WARNINGS
linux-3.13.11-x86_64: WARNINGS
linux-3.14.9-x86_64: WARNINGS
linux-3.15.2-x86_64: WARNINGS
linux-3.16-x86_64: WARNINGS
linux-3.17-rc1-x86_64: WARNINGS
apps: OK
spec-git: OK
sparse: WARNINGS

Detailed results are available here:

http://www.xs4all.nl/~hverkuil/logs/Friday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Friday.tar.bz2

The Media Infrastructure API from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/media.html
--
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


Re: [PATCH] pt3 (pci, tc90522, mxl301rf, qm1d1c0042): pt3_unregister_subdev(), pt3_unregister_subdev(), cleanups...

2014-10-02 Thread Antti Palosaari

On 10/02/2014 09:49 PM, Буди Романто, AreMa Inc wrote:

DVB driver for Earthsoft PT3 PCIE ISDB-S/T receiver
^^^

Status: stable

Changes:
- demod  tuners converted to I2C binding model
- i586  x86_64 clean compile
- lightweight  yet precise CNR calculus
- raw CNR (DVBv3)
- DVBv5 CNR @ 0.0001 dB (ref: include/uapi/linux/dvb/frontend.h, not 1/1000 dB!)
- removed (unused?) tuner's *_release()
- demod/tuner binding: pt3_unregister_subdev(), pt3_unregister_subdev()
- some cleanups


These drivers are already committed, like you have noticed. There is 
surely a lot of issues that could be improved, but it cannot be done by 
big patch which replaces everything. You need to just take one issue at 
the time, fix/improve it, send patch to mailing list for review. One 
patch per one logical change.


regards
Antti

--
http://palosaari.fi/
--
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


Re: [PATCH] pt3 (pci, tc90522, mxl301rf, qm1d1c0042): pt3_unregister_subdev(), pt3_unregister_subdev(), cleanups...

2014-10-02 Thread AreMa Inc.
Mauro  Antti

Please drop  replace Tsukada's PT3 patches.
There are too many weird  violating codes in it.

Thanks
-Bud


2014-10-03 13:54 GMT+09:00 Antti Palosaari cr...@iki.fi:
 On 10/02/2014 09:49 PM, Буди Романто, AreMa Inc wrote:

 DVB driver for Earthsoft PT3 PCIE ISDB-S/T receiver
 ^^^

 Status: stable

 Changes:
 - demod  tuners converted to I2C binding model
 - i586  x86_64 clean compile
 - lightweight  yet precise CNR calculus
 - raw CNR (DVBv3)
 - DVBv5 CNR @ 0.0001 dB (ref: include/uapi/linux/dvb/frontend.h, not
 1/1000 dB!)
 - removed (unused?) tuner's *_release()
 - demod/tuner binding: pt3_unregister_subdev(), pt3_unregister_subdev()
 - some cleanups


 These drivers are already committed, like you have noticed. There is surely
 a lot of issues that could be improved, but it cannot be done by big patch
 which replaces everything. You need to just take one issue at the time,
 fix/improve it, send patch to mailing list for review. One patch per one
 logical change.

 regards
 Antti

 --
 http://palosaari.fi/
--
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