Re: [PATCH] media: v4l2: make allocation algorithm more robust and flexible

2014-07-30 Thread Sachin Kamat
Hi Zhaowei,

On Wed, Jul 30, 2014 at 9:39 AM, Zhaowei Yuan zhaowei.y...@samsung.com wrote:
 Current algorithm relies on the fact that caller will align the
 size to PAGE_SIZE, otherwise order will be decreased to negative
 when remain size is less than PAGE_SIZE, it makes the function
 hard to be migrated.
 This patch sloves the hidden problem.

 Signed-off-by: Zhaowei Yuan zhaowei.y...@samsung.com
 ---
  drivers/media/v4l2-core/videobuf2-dma-sg.c |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/drivers/media/v4l2-core/videobuf2-dma-sg.c 
 b/drivers/media/v4l2-core/videobuf2-dma-sg.c
 index adefc31..40d18aa 100644
 --- a/drivers/media/v4l2-core/videobuf2-dma-sg.c
 +++ b/drivers/media/v4l2-core/videobuf2-dma-sg.c
 @@ -58,7 +58,7 @@ static int vb2_dma_sg_alloc_compacted(struct vb2_dma_sg_buf 
 *buf,

 order = get_order(size);
 /* Dont over allocate*/
 -   if ((PAGE_SIZE  order)  size)
 +   if (order  0  (PAGE_SIZE  order)  size)
 order--;

If size is not page aligned, then wouldn't decrementing the order
under-allocate the memory?

-- 
Regards,
Sachin.
--
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] exynos-gsc: Remove PM_RUNTIME dependency

2014-07-21 Thread Sachin Kamat
Hi Shaik,

On Mon, Jul 21, 2014 at 10:24 AM, Shaik Ameer Basha
shaik.am...@samsung.com wrote:
 1] Currently Gscaler clock is enabled only inside pm_runtime callbacks.
If PM_RUNTIME is disabled, driver hangs. This patch removes the
PM_RUNTIME dependency by keeping the clock enable/disable functions
in m2m start/stop streaming callbacks.

 2] For Exynos5420/5800, Gscaler clock has to be Turned ON before powering
on/off the Gscaler power domain. This dependency is taken care by
this patch at driver level.

 Signed-off-by: Shaik Ameer Basha shaik.am...@samsung.com
 ---
  drivers/media/platform/exynos-gsc/gsc-core.c |   10 ++
  drivers/media/platform/exynos-gsc/gsc-m2m.c  |   13 +
  2 files changed, 15 insertions(+), 8 deletions(-)

 diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c 
 b/drivers/media/platform/exynos-gsc/gsc-core.c
 index 9d0cc04..39c0953 100644
 --- a/drivers/media/platform/exynos-gsc/gsc-core.c
 +++ b/drivers/media/platform/exynos-gsc/gsc-core.c
 @@ -1132,23 +1132,17 @@ static int gsc_probe(struct platform_device *pdev)

 platform_set_drvdata(pdev, gsc);
 pm_runtime_enable(dev);
 -   ret = pm_runtime_get_sync(pdev-dev);
 -   if (ret  0)
 -   goto err_m2m;

 /* Initialize continious memory allocator */
 gsc-alloc_ctx = vb2_dma_contig_init_ctx(dev);
 if (IS_ERR(gsc-alloc_ctx)) {
 ret = PTR_ERR(gsc-alloc_ctx);
 -   goto err_pm;
 +   goto err_m2m;
 }

 dev_dbg(dev, gsc-%d registered successfully\n, gsc-id);
 -
 -   pm_runtime_put(dev);
 return 0;
 -err_pm:
 -   pm_runtime_put(dev);
 +
  err_m2m:
 gsc_unregister_m2m_device(gsc);
  err_v4l2:
 diff --git a/drivers/media/platform/exynos-gsc/gsc-m2m.c 
 b/drivers/media/platform/exynos-gsc/gsc-m2m.c
 index e434f1f0..a98462c 100644
 --- a/drivers/media/platform/exynos-gsc/gsc-m2m.c
 +++ b/drivers/media/platform/exynos-gsc/gsc-m2m.c
 @@ -60,19 +60,32 @@ static void __gsc_m2m_job_abort(struct gsc_ctx *ctx)
  static int gsc_m2m_start_streaming(struct vb2_queue *q, unsigned int count)
  {
 struct gsc_ctx *ctx = q-drv_priv;
 +   struct gsc_dev *gsc = ctx-gsc_dev;
 int ret;

 +   ret = clk_enable(gsc-clock);
 +   if (ret)
 +   return ret;
 +
 ret = pm_runtime_get_sync(ctx-gsc_dev-pdev-dev);
 +
 +   if (!pm_runtime_enabled(gsc-pdev-dev)) {
 +   gsc_hw_set_sw_reset(gsc);
 +   gsc_wait_reset(gsc);
 +   }
 +
 return ret  0 ? 0 : ret;
  }

  static void gsc_m2m_stop_streaming(struct vb2_queue *q)
  {
 struct gsc_ctx *ctx = q-drv_priv;
 +   struct gsc_dev *gsc = ctx-gsc_dev;

 __gsc_m2m_job_abort(ctx);

 pm_runtime_put(ctx-gsc_dev-pdev-dev);
 +   clk_disable(gsc-clock);
  }

  void gsc_m2m_job_finish(struct gsc_ctx *ctx, int vb_state)
 --
 1.7.9.5


Looks like there is some issue while runtime PM is disabled. The
conversion operation hangs. Tested on 5420 based Arndale Octa
board with latest next kernel.

-- 
Regards,
Sachin.
--
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 1/3] s5p-mfc: Fix selective sclk_mfc init

2014-07-08 Thread Sachin Kamat
Hi Jacek,

On Tue, Jul 8, 2014 at 6:33 PM, Jacek Anaszewski
j.anaszew...@samsung.com wrote:
 fc906b6d Remove special clock usage in driver removed
 initialization of MFC special clock, arguing that there's
 no need to do it explicitly, since it's one of MFC gate clock's
 dependencies and gets enabled along with it. However, there's
 no promise of keeping this hierarchy across Exynos SoC
 releases, therefore this approach fails to provide a stable,
 portable solution.

 Out of all MFC versions, only v6 doesn't use special clock at all.

 Signed-off-by: Mateusz Zalega m.zal...@samsung.com
 Signed-off-by: Seung-Woo Kim sw0312@samsung.com
 Signed-off-by: Jacek Anaszewski j.anaszew...@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
 ---
  drivers/media/platform/s5p-mfc/s5p_mfc_pm.c |   26 ++
  1 file changed, 26 insertions(+)

 diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c 
 b/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c
 index 11d5f1d..cc562fc 100644
 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c
 +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c
 @@ -21,6 +21,8 @@
  #include s5p_mfc_pm.h

  #define MFC_GATE_CLK_NAME  mfc
 +#define MFC_CLK_NAME   sclk-mfc
 +#define MFC_CLK_RATE   (200 * 100)

  #define CLK_DEBUG

 @@ -50,6 +52,23 @@ int s5p_mfc_init_pm(struct s5p_mfc_dev *dev)
 goto err_p_ip_clk;
 }

 +   if (dev-variant-version != MFC_VERSION_V6) {
 +   pm-clock = clk_get(dev-plat_dev-dev, MFC_CLK_NAME);
 +   if (IS_ERR(pm-clock)) {
 +   mfc_err(Failed to get gating clock control\n);
 +   ret = PTR_ERR(pm-clock);
 +   goto err_s_clk;

Shouldn't this be err_p_ip_clk?

 +   }
 +
 +   clk_set_rate(pm-clock, MFC_CLK_RATE);
 +   ret = clk_prepare_enable(pm-clock);
 +   if (ret) {
 +   mfc_err(Failed to enable MFC core operating 
 clock\n);
 +   ret = PTR_ERR(pm-clock);

Why are you doing this (re-assigning)?

 +   goto err_s_clk;
 +   }
 +   }
 +
 atomic_set(pm-power, 0);
  #ifdef CONFIG_PM_RUNTIME
 pm-device = dev-plat_dev-dev;
 @@ -59,6 +78,9 @@ int s5p_mfc_init_pm(struct s5p_mfc_dev *dev)
 atomic_set(clk_ref, 0);
  #endif
 return 0;
 +
 +err_s_clk:
 +   clk_put(pm-clock);
  err_p_ip_clk:
 clk_put(pm-clock_gate);
  err_g_ip_clk:
 @@ -67,6 +89,10 @@ err_g_ip_clk:

  void s5p_mfc_final_pm(struct s5p_mfc_dev *dev)
  {
 +   if (dev-variant-version != MFC_VERSION_V6) {
 +   clk_disable_unprepare(pm-clock);
 +   clk_put(pm-clock);
 +   }
 clk_unprepare(pm-clock_gate);
 clk_put(pm-clock_gate);
  #ifdef CONFIG_PM_RUNTIME
 --
 1.7.9.5

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



-- 
Regards,
Sachin.
--
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 v2 0/3] Support for multiple MFC FW sub-versions

2014-05-21 Thread Sachin Kamat
On 21 May 2014 14:59, Arun Kumar K arun...@samsung.com wrote:
 This patchset is for supporting multple firmware sub-versions
 for MFC. Newer firmwares come with changed interfaces and fixes
 without any change in the fw version number.
 So this implementation is as per Tomasz Figa's suggestion [1].
 [1] http://permalink.gmane.org/gmane.linux.kernel.samsung-soc/31735

 Changes from v1
 - Addressed nits pointed by Sachin on PATCH 2/3

Thanks Arun.

Series looks good.
Reviewed-by: Sachin Kamat sachin.ka...@linaro.org

-- 
With warm regards,
Sachin
--
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 2/3] [media] s5p-mfc: Support multiple firmware sub-versions

2014-05-20 Thread Sachin Kamat
Hi Arun,

On 20 May 2014 15:47, Arun Kumar K arun...@samsung.com wrote:
 For MFC firmwares, improved versions with bug fixes and
 feature additions are released keeping the firmware version
 including major and minor number same. The issue came with
 the release of a new MFCv6 firmware with an interface change.
 This patch adds the support of accepting multiple firmware
 binaries for every version with the driver trying to load
 firmwares starting from latest. This ensures full backward
 compatibility regardless of which firmware version and kernel
 version is used.

 Signed-off-by: Arun Kumar K arun...@samsung.com
 ---
  drivers/media/platform/s5p-mfc/s5p_mfc.c|9 +
  drivers/media/platform/s5p-mfc/s5p_mfc_common.h |   11 ++-
  drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c   |   15 ---
  3 files changed, 27 insertions(+), 8 deletions(-)

 diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c 
 b/drivers/media/platform/s5p-mfc/s5p_mfc.c
 index 8da4c23..514e7ec 100644
 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
 +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
 @@ -1343,7 +1343,7 @@ static struct s5p_mfc_variant mfc_drvdata_v5 = {
 .port_num   = MFC_NUM_PORTS,
 .buf_size   = buf_size_v5,
 .buf_align  = mfc_buf_align_v5,
 -   .fw_name= s5p-mfc.fw,
 +   .fw_name[0] = s5p-mfc.fw,
  };

  struct s5p_mfc_buf_size_v6 mfc_buf_size_v6 = {
 @@ -1370,7 +1370,8 @@ static struct s5p_mfc_variant mfc_drvdata_v6 = {
 .port_num   = MFC_NUM_PORTS_V6,
 .buf_size   = buf_size_v6,
 .buf_align  = mfc_buf_align_v6,
 -   .fw_name= s5p-mfc-v6.fw,
 +   .fw_name[0] = s5p-mfc-v6.fw,
 +   .fw_name[1] = s5p-mfc-v6-v2.fw,

Probably a simple 1 line comment about the difference between the
versions would help.

  };

  struct s5p_mfc_buf_size_v6 mfc_buf_size_v7 = {
 @@ -1397,7 +1398,7 @@ static struct s5p_mfc_variant mfc_drvdata_v7 = {
 .port_num   = MFC_NUM_PORTS_V7,
 .buf_size   = buf_size_v7,
 .buf_align  = mfc_buf_align_v7,
 -   .fw_name= s5p-mfc-v7.fw,
 +   .fw_name[0] = s5p-mfc-v7.fw,
  };

  struct s5p_mfc_buf_size_v6 mfc_buf_size_v8 = {
 @@ -1424,7 +1425,7 @@ static struct s5p_mfc_variant mfc_drvdata_v8 = {
 .port_num   = MFC_NUM_PORTS_V8,
 .buf_size   = buf_size_v8,
 .buf_align  = mfc_buf_align_v8,
 -   .fw_name= s5p-mfc-v8.fw,
 +   .fw_name[0] = s5p-mfc-v8.fw,
  };

  static struct platform_device_id mfc_driver_ids[] = {
 diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h 
 b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
 index 89681c3..de60185 100644
 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
 +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
 @@ -38,6 +38,8 @@
  #define MFC_BANK2_ALIGN_ORDER  13
  #define MFC_BASE_ALIGN_ORDER   17

 +#define MFC_FW_MAX_VERSIONS2
 +
  #include media/videobuf2-dma-contig.h

  static inline dma_addr_t s5p_mfc_mem_cookie(void *a, void *b)
 @@ -163,6 +165,11 @@ enum s5p_mfc_decode_arg {
 MFC_DEC_RES_CHANGE,
  };

 +enum s5p_mfc_fw_ver {
 +   MFC_FW_V1,
 +   MFC_FW_V2,
 +};
 +
  #define MFC_BUF_FLAG_USED  (1  0)
  #define MFC_BUF_FLAG_EOS   (1  1)

 @@ -225,7 +232,7 @@ struct s5p_mfc_variant {
 u32 version_bit;
 struct s5p_mfc_buf_size *buf_size;
 struct s5p_mfc_buf_align *buf_align;
 -   char*fw_name;
 +   char*fw_name[MFC_FW_MAX_VERSIONS];
  };

  /**
 @@ -287,6 +294,7 @@ struct s5p_mfc_priv_buf {
   * @warn_start:hardware error code from which warnings start
   * @mfc_ops:   ops structure holding HW operation function pointers
   * @mfc_cmds:  cmd structure holding HW commands function pointers
 + * @fw_ver:loaded firmware sub-version
   *
   */
  struct s5p_mfc_dev {
 @@ -331,6 +339,7 @@ struct s5p_mfc_dev {
 struct s5p_mfc_hw_ops *mfc_ops;
 struct s5p_mfc_hw_cmds *mfc_cmds;
 const struct s5p_mfc_regs *mfc_regs;
 +   enum s5p_mfc_fw_ver fw_ver;
  };

  /**
 diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c 
 b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c
 index c97c7c8..7aabcdb 100644
 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c
 +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c
 @@ -78,14 +78,23 @@ int s5p_mfc_alloc_firmware(struct s5p_mfc_dev *dev)
  int s5p_mfc_load_firmware(struct s5p_mfc_dev *dev)
  {
 struct firmware *fw_blob;
 -   int err;
 +   int err = -EINVAL, i;

nit: Please use either
int i, err = -EINVAL;
or
int i;
int err = -EINVAL;


 /* Firmare has to be present as a separate file or compiled
  * into kernel. */
 mfc_debug_enter();

 -   err = request_firmware((const struct firmware **)fw_blob,
 -

Re: [PATCH] [media] s5p-mfc: Dequeue sequence header after STREAMON

2014-05-08 Thread Sachin Kamat
Hi Arun,

Just 2 small nits.

On 7 May 2014 17:00, Arun Kumar K arun...@samsung.com wrote:
 MFCv6 encoder needs specific minimum number of buffers to
 be queued in the CAPTURE plane. This minimum number will
 be known only when the sequence header is generated.
 So we used to allow STREAMON on the CAPTURE plane only after
 sequence header is generated and checked with the minimum
 buffer requirement.

 But this causes a problem that we call a vb2_buffer_done
 for the sequence header buffer before doing a STREAON on the
 CAPTURE plane. This used to still work fine until this patch
 was merged b3379c6201bb3555298cdbf0aa004af260f2a6a4.

Please provide the patch title too along with commit ID
(first 12 characters of ID is enough).


 This problem should also come in earlier MFC firmware versions
 if the application calls STREAMON on CAPTURE with some delay
 after doing STREAMON on OUTPUT.

 So this patch keeps the header buffer until the other frame
 buffers are ready and dequeues it just before the first frame
 is ready.

 Signed-off-by: Arun Kumar K arun...@samsung.com
 ---
  drivers/media/platform/s5p-mfc/s5p_mfc_common.h |2 ++
  drivers/media/platform/s5p-mfc/s5p_mfc_enc.c|6 +-
  2 files changed, 7 insertions(+), 1 deletion(-)

 diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h 
 b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
 index d64b680..4fd1034 100644
 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
 +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
 @@ -523,6 +523,7 @@ struct s5p_mfc_codec_ops {
   * @output_state:  state of the output buffers queue
   * @src_bufs:  information on allocated source buffers
   * @dst_bufs:  information on allocated destination buffers
 + * @header_mb: buf pointer of the encoded sequence header

s/buf/buffer

-- 
With warm regards,
Sachin
--
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 2/3] [media] s5p-mfc: Core support to add v8 decoder

2014-04-29 Thread Sachin Kamat
Hi Arun,

On 23 April 2014 18:27, Arun Kumar K arun...@samsung.com wrote:
 From: Kiran AVND avnd.ki...@samsung.com

 This patch adds variant data and core support for
 V8 decoder. This patch also adds the register definition
 file for new firmware version v8 for MFC.

 Signed-off-by: Kiran AVND avnd.ki...@samsung.com
 Signed-off-by: Pawel Osciak posc...@chromium.org
 Signed-off-by: Arun Kumar K arun...@samsung.com
 ---
...
 +
 +/* Returned value register for specific setting */
 +#define S5P_FIMV_D_RET_PICTURE_TAG_TOP_V8  0xf674
 +#define S5P_FIMV_D_RET_PICTURE_TAG_BOT_V8  0xf678
 +#define S5P_FIMV_D_MVC_VIEW_ID_V8  0xf6d8
 +
 +/* SEI related information */
 +#define S5P_FIMV_D_FRAME_PACK_SEI_AVAIL_V8 0xf6dc
 +
 +/* MFCv8 Context buffer sizes */
 +#define MFC_CTX_BUF_SIZE_V8(30 * SZ_1K)/*  30KB */

Please include header file for size macros.

...
  };
 diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h 
 b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
 index 48a14b5..f0e63f5 100644
 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
 +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
 @@ -23,8 +23,7 @@
  #include media/v4l2-ioctl.h
  #include media/videobuf2-core.h
  #include regs-mfc.h
 -#include regs-mfc-v6.h
 -#include regs-mfc-v7.h
 +#include regs-mfc-v8.h

  /* Definitions related to MFC memory */

 @@ -705,5 +704,6 @@ void set_work_bit_irqsave(struct s5p_mfc_ctx *ctx);
  #define IS_TWOPORT(dev)(dev-variant-port_num == 2 ? 1 : 0)
  #define IS_MFCV6_PLUS(dev) (dev-variant-version = 0x60 ? 1 : 0)
  #define IS_MFCV7(dev)  (dev-variant-version = 0x70 ? 1 : 0)

Is MFC v8 superset of MFC v7?

 +#define IS_MFCV8(dev)  (dev-variant-version = 0x80 ? 1 : 0)

-- 
With warm regards,
Sachin
--
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 2/3] [media] s5p-mfc: Core support to add v8 decoder

2014-04-29 Thread Sachin Kamat
Hi Arun,

On 30 April 2014 11:15, Arun Kumar K arunkk.sams...@gmail.com wrote:
 Hi Sachin,

 Thank you for the review.


 On 04/29/14 22:45, Sachin Kamat wrote:

 Hi Arun,

 On 23 April 2014 18:27, Arun Kumar K arun...@samsung.com wrote:

 From: Kiran AVND avnd.ki...@samsung.com

 This patch adds variant data and core support for
 V8 decoder. This patch also adds the register definition
 file for new firmware version v8 for MFC.

 Signed-off-by: Kiran AVND avnd.ki...@samsung.com
 Signed-off-by: Pawel Osciak posc...@chromium.org
 Signed-off-by: Arun Kumar K arun...@samsung.com
 ---

 ...

 +
 +/* Returned value register for specific setting */
 +#define S5P_FIMV_D_RET_PICTURE_TAG_TOP_V8  0xf674
 +#define S5P_FIMV_D_RET_PICTURE_TAG_BOT_V8  0xf678
 +#define S5P_FIMV_D_MVC_VIEW_ID_V8  0xf6d8
 +
 +/* SEI related information */
 +#define S5P_FIMV_D_FRAME_PACK_SEI_AVAIL_V8 0xf6dc
 +
 +/* MFCv8 Context buffer sizes */
 +#define MFC_CTX_BUF_SIZE_V8(30 * SZ_1K)/*  30KB */


 Please include header file for size macros.


 The file linux/sizes.h is included in regs-mfc-v6.h which
 inturn gets included in this file. Isnt that fine?

Direct inclusions are encouraged. Please add it in this file.



 ...

   };
 diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
 b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
 index 48a14b5..f0e63f5 100644
 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
 +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h
 @@ -23,8 +23,7 @@
   #include media/v4l2-ioctl.h
   #include media/videobuf2-core.h
   #include regs-mfc.h
 -#include regs-mfc-v6.h
 -#include regs-mfc-v7.h
 +#include regs-mfc-v8.h

   /* Definitions related to MFC memory */

 @@ -705,5 +704,6 @@ void set_work_bit_irqsave(struct s5p_mfc_ctx *ctx);
   #define IS_TWOPORT(dev)(dev-variant-port_num == 2 ? 1
 : 0)
   #define IS_MFCV6_PLUS(dev) (dev-variant-version = 0x60 ? 1 : 0)
   #define IS_MFCV7(dev)  (dev-variant-version = 0x70 ? 1 : 0)


 Is MFC v8 superset of MFC v7?


 Yes it is a superset.
 So the last patch in this series renames IS_MFCV7 to IS_MFCV7_PLUS.

Shouldn't that be done first in that case?

-- 
With warm regards,
Sachin
--
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 7/8] [media] s5p_jpeg: Prevent JPEG 4:2:0 YUV 4:2:0 decompression

2014-04-09 Thread Sachin Kamat
Hi Jacek,

On 9 April 2014 13:01, Jacek Anaszewski j.anaszew...@samsung.com wrote:
 On 04/08/2014 09:49 AM, Sachin Kamat wrote:


 Hello Sachin,

 Thanks for the review. I put it into info message because this is
 rather hard for the user to figure out why the adjustment occurred,
 bearing in mind that JPEG with the same subsampling and even width
 is decompressed properly. This is not a common adjustment like
 alignment, and thus in my opinion it requires displaying the
 information. Are there some rules that say what cases are relevant
 for using the v4l2_info macro?

Not really, but generally info messages are concise and detailed explanations
provided as part of comments.

-- 
With warm regards,
Sachin
--
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 4/8] [media] s5p-jpeg: Fix build break when CONFIG_OF is undefined

2014-04-08 Thread Sachin Kamat
Hi Jacek,

On 7 April 2014 18:46, Jacek Anaszewski j.anaszew...@samsung.com wrote:
 This patch fixes build break occurring when
 there is no support for Device Tree turned on
 in the kernel configuration. In such a case only
 the driver variant for S5PC210 SoC will be available.

 Signed-off-by: Jacek Anaszewski j.anaszew...@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
 ---
snip


 +   if (!IS_ENABLED(CONFIG_OF) || dev-of_node == NULL)

!dev-of_node instead of equating to NULL.


 +   return s5p_jpeg_drvdata;
 +
 match = of_match_node(of_match_ptr(samsung_jpeg_match),

Since you are returning above if CONFIG_OF is not enabled, of_match_ptr
is not needed.

-- 
With warm regards,
Sachin
--
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 7/8] [media] s5p_jpeg: Prevent JPEG 4:2:0 YUV 4:2:0 decompression

2014-04-08 Thread Sachin Kamat
Hi Jacek,

On 7 April 2014 18:46, Jacek Anaszewski j.anaszew...@samsung.com wrote:
 Prevent decompression of a JPEG 4:2:0 with odd width to
 the YUV 4:2:0 compliant formats for Exynos4x12 SoCs and
 adjust capture format to RGB565 in such a case. This is
 required because the configuration would produce a raw
 image with broken luma component.

 Signed-off-by: Jacek Anaszewski j.anaszew...@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
 ---
snip

 +   if (ctx-subsampling == V4L2_JPEG_CHROMA_SUBSAMPLING_420 
 +   (ctx-out_q.w  1) 
 +   (pix-pixelformat == V4L2_PIX_FMT_NV12 ||
 +pix-pixelformat == V4L2_PIX_FMT_NV21 ||
 +pix-pixelformat == V4L2_PIX_FMT_YUV420)) {
 +   pix-pixelformat = V4L2_PIX_FMT_RGB565;
 +   fmt = s5p_jpeg_find_format(ctx, pix-pixelformat,
 +   FMT_TYPE_CAPTURE);
 +   v4l2_info(ctx-jpeg-v4l2_dev,
 + Adjusted capture fourcc to RGB565. Decompression\n
 + of a JPEG file with 4:2:0 subsampling and odd\n
 + width to the YUV 4:2:0 compliant formats 
 produces\n
 + a raw image with broken luma component.\n);

This could be made a comment in the code rather than a info message.

-- 
With warm regards,
Sachin
--
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] s5-mfc: remove meaningless memory bank assignment

2014-03-05 Thread Sachin Kamat
On 5 March 2014 16:38, Seung-Woo Kim sw0312@samsung.com wrote:
 There was assignment of memory bank with dma address converted
 from physical address. But allocation has been changed with dma
 function, so the assignment is not necessary.

 Signed-off-by: Seung-Woo Kim sw0312@samsung.com
 ---
 change from v1
 - fixes subject and adds proper description
 ---
  drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c |2 --
  1 files changed, 0 insertions(+), 2 deletions(-)

 diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c 
 b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c
 index 2475a3c..ee05f2d 100644
 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c
 +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c
 @@ -44,8 +44,6 @@ int s5p_mfc_alloc_firmware(struct s5p_mfc_dev *dev)
 return -ENOMEM;
 }

 -   dev-bank1 = dev-bank1;

Are you sure this isn't some kind of typo? If not then your commit
description is too verbose
to actually say that the code is redundant and could be removed. The
code here is something like

 a = a;

which does not make sense nor add any value and hence redundant and
could be removed.

-- 
With warm regards,
Sachin
--
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] s5-mfc: remove meaningless memory bank assignment

2014-03-05 Thread Sachin Kamat
Hi Seung-Woo,

On 6 March 2014 07:43, Seung-Woo Kim sw0312@samsung.com wrote:
 Hello Sachin,

 On 2014년 03월 05일 20:42, Sachin Kamat wrote:
 On 5 March 2014 16:38, Seung-Woo Kim sw0312@samsung.com wrote:

 (...)

 -   dev-bank1 = dev-bank1;

 Are you sure this isn't some kind of typo? If not then your commit
 description is too verbose
 to actually say that the code is redundant and could be removed. The
 code here is something like

  a = a;

 which does not make sense nor add any value and hence redundant and
 could be removed.

 Right, this meaningless code can be simply removed as like the first
 version. Anyway this redundant made from change of address type in
 earlier patch. So I tried to describe that.

What Kamil meant was that it is not a good practice to leave the
commit description
blank however trivial the patch might be. So a single line stating the
obvious should
be sufficient in this case.

-- 
With warm regards,
Sachin
--
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 v3] [media] s5p-mfc: remove meaningless memory bank assignment

2014-03-05 Thread Sachin Kamat
Hi Seung-Woo,

On 6 March 2014 10:25, Seung-Woo Kim sw0312@samsung.com wrote:
 This patch removes meaningless assignment of memory bank to itself.

 Signed-off-by: Seung-Woo Kim sw0312@samsung.com
 ---

Thanks for re-doing this.

Acked-by: Sachin Kamat sachin.ka...@linaro.org

-- 
With warm regards,
Sachin
--
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: exynos4 / g2d

2014-02-10 Thread Sachin Kamat
+cc Joonyoung Shim

Hi,

On 10 February 2014 13:58, Tobias Jakobi tjak...@math.uni-bielefeld.de wrote:
 Hello!


 Sachin Kamat wrote:
 +cc linux-media list and some related maintainers

 Hi,

 On 10 February 2014 00:22, Tobias Jakobi tjak...@math.uni-bielefeld.de 
 wrote:
 Hello!

 I noticed while here
 (https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/arch/arm/boot/dts/exynos4x12.dtsi?id=3a0d48f6f81459c874165ffb14b310c0b5bb0c58)
 the necessary entry for the dts was made, on the drm driver side
 (https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/exynos/exynos_drm_g2d.c)
 this was never added.

 Shouldn't samsung,exynos4212-g2d go into exynos_g2d_match as well?
 The DRM version of G2D driver does not support Exynos4 based G2D IP
 yet. The support for this IP
 is available only in the V4L2 version of the driver. Please see the file:
 drivers/media/platform/s5p-g2d/g2d.c

 That doesn't make sense to me. From the initial commit message of the
 DRM code:
 The G2D is a 2D graphic accelerator that supports Bit Block Transfer.
 This G2D driver is exynos drm specific and supports only G2D(version
 4.1) of later Exynos series from Exynos4X12 because supporting DMA.
 (https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/drivers/gpu/drm/exynos/exynos_drm_g2d.c?id=d7f1642c90ab5eb2d7c48af0581c993094f97e1a)

 In fact, this doesn't even mention the Exynos5?!

It does say later Exynos series from Exynos4X12 which technically
includes Exynos5 and
does not include previous Exynos series SoCs like 4210, etc.
Anyway, I haven't tested this driver on Exynos4 based platforms and
hence cannot confirm if it
supports 4x12 in the current form. I leave it to the original author
and Inki to comment about it.

-- 
With warm regards,
Sachin
--
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: exynos4 / g2d

2014-02-10 Thread Sachin Kamat
On 10 February 2014 14:28, Inki Dae inki@samsung.com wrote:
 2014-02-10 17:44 GMT+09:00 Sachin Kamat sachin.ka...@linaro.org:
 +cc Joonyoung Shim

 Hi,

 On 10 February 2014 13:58, Tobias Jakobi tjak...@math.uni-bielefeld.de 
 wrote:
 Hello!


 Sachin Kamat wrote:
 +cc linux-media list and some related maintainers

 Hi,

 On 10 February 2014 00:22, Tobias Jakobi tjak...@math.uni-bielefeld.de 
 wrote:
 Hello!

 I noticed while here
 (https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/arch/arm/boot/dts/exynos4x12.dtsi?id=3a0d48f6f81459c874165ffb14b310c0b5bb0c58)
 the necessary entry for the dts was made, on the drm driver side
 (https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/exynos/exynos_drm_g2d.c)
 this was never added.

 Shouldn't samsung,exynos4212-g2d go into exynos_g2d_match as well?
 The DRM version of G2D driver does not support Exynos4 based G2D IP
 yet. The support for this IP
 is available only in the V4L2 version of the driver. Please see the file:
 drivers/media/platform/s5p-g2d/g2d.c

 That doesn't make sense to me. From the initial commit message of the
 DRM code:
 The G2D is a 2D graphic accelerator that supports Bit Block Transfer.
 This G2D driver is exynos drm specific and supports only G2D(version
 4.1) of later Exynos series from Exynos4X12 because supporting DMA.
 (https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/drivers/gpu/drm/exynos/exynos_drm_g2d.c?id=d7f1642c90ab5eb2d7c48af0581c993094f97e1a)

 In fact, this doesn't even mention the Exynos5?!

 It does say later Exynos series from Exynos4X12 which technically
 includes Exynos5 and

 Right, supported.

 does not include previous Exynos series SoCs like 4210, etc.
 Anyway, I haven't tested this driver on Exynos4 based platforms and
 hence cannot confirm if it
 supports 4x12 in the current form. I leave it to the original author
 and Inki to comment about it.


 Just add samsung,exynos4212-g2d to exynos_g2d_match if you want to
 use g2d driver on exynos4212 SoC. We already tested this driver on
 Exynos4x12 SoC also. We didn't just post dt support patch for
 exynos4x12 series.

If you prefer I could add that and send a patch. I wouldn't be able to
test it though.

-- 
With warm regards,
Sachin
--
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: exynos4 / g2d

2014-02-09 Thread Sachin Kamat
+cc linux-media list and some related maintainers

Hi,

On 10 February 2014 00:22, Tobias Jakobi tjak...@math.uni-bielefeld.de wrote:
 Hello!

 I noticed while here
 (https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/arch/arm/boot/dts/exynos4x12.dtsi?id=3a0d48f6f81459c874165ffb14b310c0b5bb0c58)
 the necessary entry for the dts was made, on the drm driver side
 (https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/exynos/exynos_drm_g2d.c)
 this was never added.

 Shouldn't samsung,exynos4212-g2d go into exynos_g2d_match as well?

The DRM version of G2D driver does not support Exynos4 based G2D IP
yet. The support for this IP
is available only in the V4L2 version of the driver. Please see the file:
drivers/media/platform/s5p-g2d/g2d.c

-- 
With warm regards,
Sachin
--
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 v2 0/2] drivers/media: Add controls for Horizontal and Vertical MV Search Range

2014-01-29 Thread Sachin Kamat
Hi Amit,

On 30 January 2014 11:12, Amit Grover amit.gro...@samsung.com wrote:
 Based on 'master' branch of Linux-next.

Kamil's tree [1] would be more current most of the times for this driver.

[1] git://linuxtv.org/kdebski/media.git


 This is v2 version for the patch:
 s5p-mfc: Add Horizontal and Vertical search range for Video Macro Blocks
 (https://lkml.org/lkml/2013/12/30/83)

 Changes from v1:
 1) Splitted the patch into v4l2 and mfc driver patches.
 2) Incorporated review comments of v1

 Amit Grover (2):
   drivers/media: v4l2: Add settings for Horizontal and Vertical MV
 Search Range
   drivers/media: s5p-mfc: Add Horizontal and Vertical MV Search Range

nit: media changes use the following title format:
[media] v4l2: Add settings for Horizontal and Vertical MV Search Range
[media] s5p-mfc: Add Horizontal and Vertical MV Search Range



-- 
With warm regards,
Sachin
--
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] [media] radio-keene: Use module_usb_driver

2014-01-27 Thread Sachin Kamat
module_usb_driver eliminates the boilerplate and makes the code simpler.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/media/radio/radio-keene.c |   19 +--
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/drivers/media/radio/radio-keene.c 
b/drivers/media/radio/radio-keene.c
index fa3964022b96..3d127825eceb 100644
--- a/drivers/media/radio/radio-keene.c
+++ b/drivers/media/radio/radio-keene.c
@@ -416,22 +416,5 @@ static struct usb_driver usb_keene_driver = {
.reset_resume   = usb_keene_resume,
 };
 
-static int __init keene_init(void)
-{
-   int retval = usb_register(usb_keene_driver);
-
-   if (retval)
-   pr_err(KBUILD_MODNAME
-   : usb_register failed. Error number %d\n, retval);
-
-   return retval;
-}
-
-static void __exit keene_exit(void)
-{
-   usb_deregister(usb_keene_driver);
-}
-
-module_init(keene_init);
-module_exit(keene_exit);
+module_usb_driver(usb_keene_driver);
 
-- 
1.7.9.5

--
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] Add driver for Samsung S5K5BAF camera sensor

2014-01-08 Thread Sachin Kamat
Hi Dan,

On 8 January 2014 14:39, Dan Carpenter dan.carpen...@oracle.com wrote:
 Hello Andrzej Hajda,

 This is a semi-automatic email about new static checker warnings.

 The patch 7d459937dc09: [media] Add driver for Samsung S5K5BAF
 camera sensor from Dec 5, 2013, leads to the following Smatch
 complaint:

 drivers/media/i2c/s5k5baf.c:554 s5k5baf_fw_get_seq()
  warn: variable dereferenced before check 'fw' (see line 551)

 drivers/media/i2c/s5k5baf.c
550  struct s5k5baf_fw *fw = state-fw;
551  u16 *data = fw-data + 2 * fw-count;
^
 Dereference.

552  int i;
553
554  if (fw == NULL)
 ^^
 Check.

555  return NULL;
556


A patch [1] to fix this has already been queued up by Mauro.

[1] https://linuxtv.org/patch/21292/

-- 
With warm regards,
Sachin
--
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 1/3] [media] s5k5baf: Fix build warning

2014-01-08 Thread Sachin Kamat
Hi Andrzej,

On 8 January 2014 16:30, Andrzej Hajda a.ha...@samsung.com wrote:
 On 01/06/2014 12:48 PM, Sachin Kamat wrote:
 Hi Sachin,

 Thanks for the fixes.

 Gentle ping on this series :)

 Sorry for late reply, but it seems Mauro has merged them already.

No worries. Yes, Mauro has queued them for 3.14.

-- 
With warm regards,
Sachin
--
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 1/3] [media] s5k5baf: Fix build warning

2014-01-06 Thread Sachin Kamat
On 24 December 2013 17:12, Sachin Kamat sachin.ka...@linaro.org wrote:
 Fixes the following warnings:
 drivers/media/i2c/s5k5baf.c: In function 's5k5baf_fw_parse':
 drivers/media/i2c/s5k5baf.c:362:3: warning:
 format '%d' expects argument of type 'int', but argument 3 has type 'size_t' 
 [-Wformat=]
 drivers/media/i2c/s5k5baf.c:383:4: warning:
 format '%d' expects argument of type 'int', but argument 4 has type 'size_t' 
 [-Wformat=]

 Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
 Reported-by: kbuild test robot fengguang...@intel.com
 ---
  drivers/media/i2c/s5k5baf.c |4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

 diff --git a/drivers/media/i2c/s5k5baf.c b/drivers/media/i2c/s5k5baf.c
 index e3b44a87460b..139bdd4f5dde 100644
 --- a/drivers/media/i2c/s5k5baf.c
 +++ b/drivers/media/i2c/s5k5baf.c
 @@ -359,7 +359,7 @@ static int s5k5baf_fw_parse(struct device *dev, struct 
 s5k5baf_fw **fw,
 int ret;

 if (count  S5K5BAG_FW_TAG_LEN + 1) {
 -   dev_err(dev, firmware file too short (%d)\n, count);
 +   dev_err(dev, firmware file too short (%zu)\n, count);
 return -EINVAL;
 }

 @@ -379,7 +379,7 @@ static int s5k5baf_fw_parse(struct device *dev, struct 
 s5k5baf_fw **fw,

 f = (struct s5k5baf_fw *)d;
 if (count  1 + 2 * f-count) {
 -   dev_err(dev, invalid firmware header (count=%d size=%d)\n,
 +   dev_err(dev, invalid firmware header (count=%d size=%zu)\n,
 f-count, 2 * (count + S5K5BAG_FW_TAG_LEN));
 return -EINVAL;
 }
 --
 1.7.9.5


Gentle ping on this series :)

-- 
With warm regards,
Sachin
--
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/3] [media] s5k5baf: Fix build warning

2013-12-24 Thread Sachin Kamat
Fixes the following warnings:
drivers/media/i2c/s5k5baf.c: In function 's5k5baf_fw_parse':
drivers/media/i2c/s5k5baf.c:362:3: warning:
format '%d' expects argument of type 'int', but argument 3 has type 'size_t' 
[-Wformat=]
drivers/media/i2c/s5k5baf.c:383:4: warning:
format '%d' expects argument of type 'int', but argument 4 has type 'size_t' 
[-Wformat=]

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Reported-by: kbuild test robot fengguang...@intel.com
---
 drivers/media/i2c/s5k5baf.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/s5k5baf.c b/drivers/media/i2c/s5k5baf.c
index e3b44a87460b..139bdd4f5dde 100644
--- a/drivers/media/i2c/s5k5baf.c
+++ b/drivers/media/i2c/s5k5baf.c
@@ -359,7 +359,7 @@ static int s5k5baf_fw_parse(struct device *dev, struct 
s5k5baf_fw **fw,
int ret;
 
if (count  S5K5BAG_FW_TAG_LEN + 1) {
-   dev_err(dev, firmware file too short (%d)\n, count);
+   dev_err(dev, firmware file too short (%zu)\n, count);
return -EINVAL;
}
 
@@ -379,7 +379,7 @@ static int s5k5baf_fw_parse(struct device *dev, struct 
s5k5baf_fw **fw,
 
f = (struct s5k5baf_fw *)d;
if (count  1 + 2 * f-count) {
-   dev_err(dev, invalid firmware header (count=%d size=%d)\n,
+   dev_err(dev, invalid firmware header (count=%d size=%zu)\n,
f-count, 2 * (count + S5K5BAG_FW_TAG_LEN));
return -EINVAL;
}
-- 
1.7.9.5

--
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 3/3] [media] s5k5baf: Fix potential NULL pointer dereferencing

2013-12-24 Thread Sachin Kamat
Dereference 'fw' after the NULL check.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/media/i2c/s5k5baf.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/s5k5baf.c b/drivers/media/i2c/s5k5baf.c
index 974b865c2ee1..4b838cbd 100644
--- a/drivers/media/i2c/s5k5baf.c
+++ b/drivers/media/i2c/s5k5baf.c
@@ -548,12 +548,14 @@ static void s5k5baf_synchronize(struct s5k5baf *state, 
int timeout, u16 addr)
 static u16 *s5k5baf_fw_get_seq(struct s5k5baf *state, u16 seq_id)
 {
struct s5k5baf_fw *fw = state-fw;
-   u16 *data = fw-data + 2 * fw-count;
+   u16 *data;
int i;
 
if (fw == NULL)
return NULL;
 
+   data = fw-data + 2 * fw-count;
+
for (i = 0; i  fw-count; ++i) {
if (fw-seq[i].id == seq_id)
return data + fw-seq[i].offset;
-- 
1.7.9.5

--
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 2/3] [media] s5k5baf: Fix checkpatch error

2013-12-24 Thread Sachin Kamat
Fixes the following error:
ERROR: return is not a function, parentheses are not required
FILE: drivers/media/i2c/s5k5baf.c:1353:

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/media/i2c/s5k5baf.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/s5k5baf.c b/drivers/media/i2c/s5k5baf.c
index 139bdd4f5dde..974b865c2ee1 100644
--- a/drivers/media/i2c/s5k5baf.c
+++ b/drivers/media/i2c/s5k5baf.c
@@ -1350,8 +1350,8 @@ static enum selection_rect s5k5baf_get_sel_rect(u32 pad, 
u32 target)
 
 static int s5k5baf_is_bound_target(u32 target)
 {
-   return (target == V4L2_SEL_TGT_CROP_BOUNDS ||
-   target == V4L2_SEL_TGT_COMPOSE_BOUNDS);
+   return target == V4L2_SEL_TGT_CROP_BOUNDS ||
+   target == V4L2_SEL_TGT_COMPOSE_BOUNDS;
 }
 
 static int s5k5baf_get_selection(struct v4l2_subdev *sd,
-- 
1.7.9.5

--
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] CHROMIUM: s5p-mfc: add controls to set vp8 enc profile

2013-12-09 Thread Sachin Kamat
Hi Arun,

On 10 December 2013 10:15, Arun Kumar K arunkk.sams...@gmail.com wrote:
 Hi Pawel,

 On Tue, Dec 10, 2013 at 6:21 AM, Pawel Osciak posc...@chromium.org wrote:
 Hi Arun,



 Ok will make the change in next version.


While at it also update the patch subject appropriately.

-- 
With warm regards,
Sachin
--
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 2/6] [media] mt9p031: Include linux/of.h header

2013-11-06 Thread Sachin Kamat
On 6 November 2013 06:58, Laurent Pinchart
laurent.pinch...@ideasonboard.com wrote:
 Hi Sachin,

 Thank you for the patch, and sorry for the late reply.

 On Friday 18 October 2013 08:37:11 Sachin Kamat wrote:
 'of_match_ptr' is defined in linux/of.h. Include it explicitly to avoid
 build breakage in the future.

 Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
 Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com

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

 I've taken the patch in my tree and will push it upstream.

Thanks Laurent.

-- 
With warm regards,
Sachin
--
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 3/7] video: exynos_mipi_dsim: Use the generic PHY driver

2013-10-24 Thread Sachin Kamat
Hi Olof,

On 24 October 2013 20:00, Olof Johansson o...@lixom.net wrote:
 Hi Kishon,

 On Wed, Oct 16, 2013 at 9:28 AM, Kishon Vijay Abraham I kis...@ti.com wrote:
 diff --git a/drivers/video/exynos/exynos_mipi_dsi.c 
 b/drivers/video/exynos/exynos_mipi_dsi.c
 index 32e5406..00b3a52 100644
 --- a/drivers/video/exynos/exynos_mipi_dsi.c
 +++ b/drivers/video/exynos/exynos_mipi_dsi.c
 @@ -156,8 +157,7 @@ static int exynos_mipi_dsi_blank_mode(struct 
 mipi_dsim_device *dsim, int power)
 exynos_mipi_regulator_enable(dsim);

 /* enable MIPI-DSI PHY. */
 -   if (dsim-pd-phy_enable)
 -   dsim-pd-phy_enable(pdev, true);
 +   phy_power_on(dsim-phy);

 clk_enable(dsim-clock);


 This introduces the below with exynos_defconfig:

 ../../drivers/video/exynos/exynos_mipi_dsi.c: In function
 'exynos_mipi_dsi_blank_mode':
 ../../drivers/video/exynos/exynos_mipi_dsi.c:144:26: warning: unused
 variable 'pdev' [-Wunused-variable]
   struct platform_device *pdev = to_platform_device(dsim-dev);


I have already submitted a patch to fix this [1]

[1] http://marc.info/?l=linux-fbdevm=138233359617936w=2


-- 
With warm regards,
Sachin
--
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 2/6] [media] mt9p031: Include linux/of.h header

2013-10-17 Thread Sachin Kamat
'of_match_ptr' is defined in linux/of.h. Include it explicitly to
avoid build breakage in the future.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com
---
 drivers/media/i2c/mt9p031.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
index 4734836..1c2303d 100644
--- a/drivers/media/i2c/mt9p031.c
+++ b/drivers/media/i2c/mt9p031.c
@@ -19,6 +19,7 @@
 #include linux/i2c.h
 #include linux/log2.h
 #include linux/module.h
+#include linux/of.h
 #include linux/of_gpio.h
 #include linux/pm.h
 #include linux/regulator/consumer.h
-- 
1.7.9.5

--
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/6] [media] adv7343: Include linux/of.h header

2013-10-17 Thread Sachin Kamat
'of_match_ptr' is defined in linux/of.h. Include it explicitly to
avoid build breakage in the future.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/media/i2c/adv7343.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/i2c/adv7343.c b/drivers/media/i2c/adv7343.c
index aeb56c5..d4e15a6 100644
--- a/drivers/media/i2c/adv7343.c
+++ b/drivers/media/i2c/adv7343.c
@@ -25,6 +25,7 @@
 #include linux/module.h
 #include linux/videodev2.h
 #include linux/uaccess.h
+#include linux/of.h
 
 #include media/adv7343.h
 #include media/v4l2-async.h
-- 
1.7.9.5

--
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 3/6] [media] ths8200: Include linux/of.h header

2013-10-17 Thread Sachin Kamat
'of_match_ptr' is defined in linux/of.h. Include it explicitly to
avoid build breakage in the future.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/media/i2c/ths8200.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/i2c/ths8200.c b/drivers/media/i2c/ths8200.c
index a58a8f6..51e1964 100644
--- a/drivers/media/i2c/ths8200.c
+++ b/drivers/media/i2c/ths8200.c
@@ -19,6 +19,7 @@
 
 #include linux/i2c.h
 #include linux/module.h
+#include linux/of.h
 #include linux/v4l2-dv-timings.h
 
 #include media/v4l2-dv-timings.h
-- 
1.7.9.5

--
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 4/6] [media] tvp514x: Include linux/of.h header

2013-10-17 Thread Sachin Kamat
'of_match_ptr' is defined in linux/of.h. Include it explicitly to
avoid build breakage in the future.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/media/i2c/tvp514x.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c
index 91f3dd4..83d85df 100644
--- a/drivers/media/i2c/tvp514x.c
+++ b/drivers/media/i2c/tvp514x.c
@@ -35,6 +35,7 @@
 #include linux/videodev2.h
 #include linux/module.h
 #include linux/v4l2-mediabus.h
+#include linux/of.h
 
 #include media/v4l2-async.h
 #include media/v4l2-device.h
-- 
1.7.9.5

--
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 6/6] [media] gpio-ir-recv: Include linux/of.h header

2013-10-17 Thread Sachin Kamat
'of_match_ptr' is defined in linux/of.h. Include it explicitly to
avoid build breakage in the future.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/media/rc/gpio-ir-recv.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/rc/gpio-ir-recv.c b/drivers/media/rc/gpio-ir-recv.c
index 07aacfa..80c611c 100644
--- a/drivers/media/rc/gpio-ir-recv.c
+++ b/drivers/media/rc/gpio-ir-recv.c
@@ -16,6 +16,7 @@
 #include linux/interrupt.h
 #include linux/gpio.h
 #include linux/slab.h
+#include linux/of.h
 #include linux/of_gpio.h
 #include linux/platform_device.h
 #include linux/irq.h
-- 
1.7.9.5

--
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 5/6] [media] tvp7002: Include linux/of.h header

2013-10-17 Thread Sachin Kamat
'of_match_ptr' is defined in linux/of.h. Include it explicitly to
avoid build breakage in the future.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/media/i2c/tvp7002.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c
index 24a08fa..912e1cc 100644
--- a/drivers/media/i2c/tvp7002.c
+++ b/drivers/media/i2c/tvp7002.c
@@ -29,6 +29,7 @@
 #include linux/slab.h
 #include linux/videodev2.h
 #include linux/module.h
+#include linux/of.h
 #include linux/v4l2-dv-timings.h
 #include media/tvp7002.h
 #include media/v4l2-async.h
-- 
1.7.9.5

--
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 00/10] [media] remove unnecessary pci_set_drvdata()

2013-09-30 Thread Sachin Kamat
Hi Hans,

On 30 September 2013 17:52, Hans Verkuil hverk...@xs4all.nl wrote:
 On 09/23/2013 03:43 AM, Jingoo Han wrote:
 Since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
 (device-core: Ensure drvdata = NULL when no driver is bound),
 the driver core clears the driver data to NULL after device_release
 or on probe failure. Thus, it is not needed to manually clear the
 device driver data to NULL.

 For the whole patch series:

 Acked-by: Hans Verkuil hans.verk...@cisco.com


I had sent a similar series (3 days) earlier to Jingoo's  [1]. I hope
to get your ack for that one instead.

[1] http://www.spinics.net/lists/linux-media/msg68164.html


-- 
With warm regards,
Sachin
--
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 v5 0/4] media: s5p-tv: clean-up and fixes

2013-09-22 Thread Sachin Kamat
Hi Mateusz,

On 21 September 2013 20:30, Mateusz Krawczuk
m.krawc...@partner.samsung.com wrote:
 This patch series add restoring previous vpll rate after driver offs stream
 or recives error.
 It also replace mxr_info, mxr_dbg, mxr_warn and mxr_err macro
 by generic solution.

It is a good practice to include revision history of the changes in
the patch set. This will help reviewers
check if the changes previously suggested have been incorporated or
not and to identify any new changes introduced by the author.


-- 
With warm regards,
Sachin
--
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 2/3] [media] pci: cx88-mpeg: Use module_pci_driver

2013-09-20 Thread Sachin Kamat
module_pci_driver removes some boilerplate and makes code simpler.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Jelle Foks je...@foks.us
---
 drivers/media/pci/cx88/cx88-mpeg.c |   14 +-
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/media/pci/cx88/cx88-mpeg.c 
b/drivers/media/pci/cx88/cx88-mpeg.c
index 86d2008..684eff5 100644
--- a/drivers/media/pci/cx88/cx88-mpeg.c
+++ b/drivers/media/pci/cx88/cx88-mpeg.c
@@ -902,20 +902,8 @@ static struct pci_driver cx8802_pci_driver = {
.remove   = cx8802_remove,
 };
 
-static int __init cx8802_init(void)
-{
-   printk(KERN_INFO cx88/2: cx2388x MPEG-TS Driver Manager version %s 
loaded\n,
-  CX88_VERSION);
-   return pci_register_driver(cx8802_pci_driver);
-}
-
-static void __exit cx8802_fini(void)
-{
-   pci_unregister_driver(cx8802_pci_driver);
-}
+module_pci_driver(cx8802_pci_driver);
 
-module_init(cx8802_init);
-module_exit(cx8802_fini);
 EXPORT_SYMBOL(cx8802_buf_prepare);
 EXPORT_SYMBOL(cx8802_buf_queue);
 EXPORT_SYMBOL(cx8802_cancel_buffers);
-- 
1.7.9.5

--
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 3/3] [media] pci: cx88-video: Use module_pci_driver

2013-09-20 Thread Sachin Kamat
module_pci_driver removes some boilerplate and makes code simpler.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Gerd Knorr kra...@bytesex.org
---
 drivers/media/pci/cx88/cx88-video.c |   15 +--
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/drivers/media/pci/cx88/cx88-video.c 
b/drivers/media/pci/cx88/cx88-video.c
index d3c2c7f..1aed764 100644
--- a/drivers/media/pci/cx88/cx88-video.c
+++ b/drivers/media/pci/cx88/cx88-video.c
@@ -2038,17 +2038,4 @@ static struct pci_driver cx8800_pci_driver = {
 #endif
 };
 
-static int __init cx8800_init(void)
-{
-   printk(KERN_INFO cx88/0: cx2388x v4l2 driver version %s loaded\n,
-  CX88_VERSION);
-   return pci_register_driver(cx8800_pci_driver);
-}
-
-static void __exit cx8800_fini(void)
-{
-   pci_unregister_driver(cx8800_pci_driver);
-}
-
-module_init(cx8800_init);
-module_exit(cx8800_fini);
+module_pci_driver(cx8800_pci_driver);
-- 
1.7.9.5

--
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/3] [media] pci: cx88-alsa: Use module_pci_driver

2013-09-20 Thread Sachin Kamat
module_pci_driver removes some boilerplate and makes code simpler.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/media/pci/cx88/cx88-alsa.c |   25 +
 1 file changed, 1 insertion(+), 24 deletions(-)

diff --git a/drivers/media/pci/cx88/cx88-alsa.c 
b/drivers/media/pci/cx88/cx88-alsa.c
index 05428bf..11d0692 100644
--- a/drivers/media/pci/cx88/cx88-alsa.c
+++ b/drivers/media/pci/cx88/cx88-alsa.c
@@ -949,27 +949,4 @@ static struct pci_driver cx88_audio_pci_driver = {
.remove   = cx88_audio_finidev,
 };
 
-/
-   LINUX MODULE INIT
- /
-
-/*
- * module init
- */
-static int __init cx88_audio_init(void)
-{
-   printk(KERN_INFO cx2388x alsa driver version %s loaded\n,
-  CX88_VERSION);
-   return pci_register_driver(cx88_audio_pci_driver);
-}
-
-/*
- * module remove
- */
-static void __exit cx88_audio_fini(void)
-{
-   pci_unregister_driver(cx88_audio_pci_driver);
-}
-
-module_init(cx88_audio_init);
-module_exit(cx88_audio_fini);
+module_pci_driver(cx88_audio_pci_driver);
-- 
1.7.9.5

--
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 6/9] [media] pci: pt1: Remove redundant pci_set_drvdata

2013-09-20 Thread Sachin Kamat
Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Takahito HIRANO hiranot...@zng.info
---
 drivers/media/pci/pt1/pt1.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/media/pci/pt1/pt1.c b/drivers/media/pci/pt1/pt1.c
index 75ce142..db887b0 100644
--- a/drivers/media/pci/pt1/pt1.c
+++ b/drivers/media/pci/pt1/pt1.c
@@ -1076,7 +1076,6 @@ static void pt1_remove(struct pci_dev *pdev)
pt1_update_power(pt1);
pt1_cleanup_adapters(pt1);
i2c_del_adapter(pt1-i2c_adap);
-   pci_set_drvdata(pdev, NULL);
kfree(pt1);
pci_iounmap(pdev, regs);
pci_release_regions(pdev);
@@ -1198,7 +1197,6 @@ err_i2c_del_adapter:
 err_pt1_cleanup_adapters:
pt1_cleanup_adapters(pt1);
 err_kfree:
-   pci_set_drvdata(pdev, NULL);
kfree(pt1);
 err_pci_iounmap:
pci_iounmap(pdev, regs);
-- 
1.7.9.5

--
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 3/9] [media] pci: dm1105: Remove redundant pci_set_drvdata

2013-09-20 Thread Sachin Kamat
Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Igor M. Liplianin liplia...@me.by
---
 drivers/media/pci/dm1105/dm1105.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/media/pci/dm1105/dm1105.c 
b/drivers/media/pci/dm1105/dm1105.c
index ab797fe..e985e3b 100644
--- a/drivers/media/pci/dm1105/dm1105.c
+++ b/drivers/media/pci/dm1105/dm1105.c
@@ -1178,7 +1178,6 @@ err_pci_release_regions:
 err_pci_disable_device:
pci_disable_device(pdev);
 err_kfree:
-   pci_set_drvdata(pdev, NULL);
kfree(dev);
return ret;
 }
@@ -1211,7 +1210,6 @@ static void dm1105_remove(struct pci_dev *pdev)
pci_iounmap(pdev, dev-io_mem);
pci_release_regions(pdev);
pci_disable_device(pdev);
-   pci_set_drvdata(pdev, NULL);
dm1105_devcount--;
kfree(dev);
 }
-- 
1.7.9.5

--
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/9] [media] pci: flexcop: Remove redundant pci_set_drvdata

2013-09-20 Thread Sachin Kamat
Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Patrick Boettcher patrick.boettc...@desy.de
---
 drivers/media/pci/b2c2/flexcop-pci.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/media/pci/b2c2/flexcop-pci.c 
b/drivers/media/pci/b2c2/flexcop-pci.c
index 447afbd..8b5e0b3 100644
--- a/drivers/media/pci/b2c2/flexcop-pci.c
+++ b/drivers/media/pci/b2c2/flexcop-pci.c
@@ -319,7 +319,6 @@ static int flexcop_pci_init(struct flexcop_pci *fc_pci)
 
 err_pci_iounmap:
pci_iounmap(fc_pci-pdev, fc_pci-io_mem);
-   pci_set_drvdata(fc_pci-pdev, NULL);
 err_pci_release_regions:
pci_release_regions(fc_pci-pdev);
 err_pci_disable_device:
@@ -332,7 +331,6 @@ static void flexcop_pci_exit(struct flexcop_pci *fc_pci)
if (fc_pci-init_state  FC_PCI_INIT) {
free_irq(fc_pci-pdev-irq, fc_pci);
pci_iounmap(fc_pci-pdev, fc_pci-io_mem);
-   pci_set_drvdata(fc_pci-pdev, NULL);
pci_release_regions(fc_pci-pdev);
pci_disable_device(fc_pci-pdev);
}
-- 
1.7.9.5

--
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 5/9] [media] pci: pluto2: Remove redundant pci_set_drvdata

2013-09-20 Thread Sachin Kamat
Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Andreas Oberritter o...@linuxtv.org
---
 drivers/media/pci/pluto2/pluto2.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/media/pci/pluto2/pluto2.c 
b/drivers/media/pci/pluto2/pluto2.c
index 4938285..8164d74 100644
--- a/drivers/media/pci/pluto2/pluto2.c
+++ b/drivers/media/pci/pluto2/pluto2.c
@@ -736,7 +736,6 @@ err_pci_release_regions:
 err_pci_disable_device:
pci_disable_device(pdev);
 err_kfree:
-   pci_set_drvdata(pdev, NULL);
kfree(pluto);
goto out;
 }
@@ -765,7 +764,6 @@ static void pluto2_remove(struct pci_dev *pdev)
pci_iounmap(pdev, pluto-io_mem);
pci_release_regions(pdev);
pci_disable_device(pdev);
-   pci_set_drvdata(pdev, NULL);
kfree(pluto);
 }
 
-- 
1.7.9.5

--
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 4/9] [media] pci: mantis: Remove redundant pci_set_drvdata

2013-09-20 Thread Sachin Kamat
Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Manu Abraham abraham.m...@gmail.com
---
 drivers/media/pci/mantis/mantis_pci.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/media/pci/mantis/mantis_pci.c 
b/drivers/media/pci/mantis/mantis_pci.c
index a846036..9e89e04 100644
--- a/drivers/media/pci/mantis/mantis_pci.c
+++ b/drivers/media/pci/mantis/mantis_pci.c
@@ -143,7 +143,6 @@ fail1:
 
 fail0:
dprintk(MANTIS_ERROR, 1, ERROR: %d exiting, ret);
-   pci_set_drvdata(pdev, NULL);
return ret;
 }
 EXPORT_SYMBOL_GPL(mantis_pci_init);
@@ -161,7 +160,6 @@ void mantis_pci_exit(struct mantis_pci *mantis)
}
 
pci_disable_device(pdev);
-   pci_set_drvdata(pdev, NULL);
 }
 EXPORT_SYMBOL_GPL(mantis_pci_exit);
 
-- 
1.7.9.5

--
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 2/9] [media] pci: cx88: Remove redundant pci_set_drvdata

2013-09-20 Thread Sachin Kamat
Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/media/pci/cx88/cx88-alsa.c  |2 --
 drivers/media/pci/cx88/cx88-mpeg.c  |1 -
 drivers/media/pci/cx88/cx88-video.c |1 -
 3 files changed, 4 deletions(-)

diff --git a/drivers/media/pci/cx88/cx88-alsa.c 
b/drivers/media/pci/cx88/cx88-alsa.c
index 4a3f96e..11d0692 100644
--- a/drivers/media/pci/cx88/cx88-alsa.c
+++ b/drivers/media/pci/cx88/cx88-alsa.c
@@ -935,8 +935,6 @@ static void cx88_audio_finidev(struct pci_dev *pci)
 
snd_card_free((void *)card);
 
-   pci_set_drvdata(pci, NULL);
-
devno--;
 }
 
diff --git a/drivers/media/pci/cx88/cx88-mpeg.c 
b/drivers/media/pci/cx88/cx88-mpeg.c
index e31a75f..684eff5 100644
--- a/drivers/media/pci/cx88/cx88-mpeg.c
+++ b/drivers/media/pci/cx88/cx88-mpeg.c
@@ -520,7 +520,6 @@ static void cx8802_fini_common(struct cx8802_dev *dev)
 
/* unregister stuff */
free_irq(dev-pci-irq, dev);
-   pci_set_drvdata(dev-pci, NULL);
 
/* free memory */
btcx_riscmem_free(dev-pci,dev-mpegq.stopper);
diff --git a/drivers/media/pci/cx88/cx88-video.c 
b/drivers/media/pci/cx88/cx88-video.c
index 356725c..1aed764 100644
--- a/drivers/media/pci/cx88/cx88-video.c
+++ b/drivers/media/pci/cx88/cx88-video.c
@@ -1922,7 +1922,6 @@ static void cx8800_finidev(struct pci_dev *pci_dev)
 
free_irq(pci_dev-irq, dev);
cx8800_unregister_video(dev);
-   pci_set_drvdata(pci_dev, NULL);
 
/* free memory */
btcx_riscmem_free(dev-pci,dev-vidq.stopper);
-- 
1.7.9.5

--
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 8/9] [media] pci: bt878: Remove redundant pci_set_drvdata

2013-09-20 Thread Sachin Kamat
Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/media/pci/bt8xx/bt878.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/pci/bt8xx/bt878.c b/drivers/media/pci/bt8xx/bt878.c
index 66eb0ba..2bd2483 100644
--- a/drivers/media/pci/bt8xx/bt878.c
+++ b/drivers/media/pci/bt8xx/bt878.c
@@ -563,7 +563,6 @@ static void bt878_remove(struct pci_dev *pci_dev)
bt-shutdown = 1;
bt878_mem_free(bt);
 
-   pci_set_drvdata(pci_dev, NULL);
pci_disable_device(pci_dev);
return;
 }
-- 
1.7.9.5

--
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 9/9] [media] pci: ngene: Remove redundant pci_set_drvdata

2013-09-20 Thread Sachin Kamat
Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/media/pci/ngene/ngene-core.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/media/pci/ngene/ngene-core.c 
b/drivers/media/pci/ngene/ngene-core.c
index 37ebc42..8402ed6 100644
--- a/drivers/media/pci/ngene/ngene-core.c
+++ b/drivers/media/pci/ngene/ngene-core.c
@@ -1648,7 +1648,6 @@ void ngene_remove(struct pci_dev *pdev)
cxd_detach(dev);
ngene_stop(dev);
ngene_release_buffers(dev);
-   pci_set_drvdata(pdev, NULL);
pci_disable_device(pdev);
 }
 
@@ -1702,6 +1701,5 @@ fail1:
ngene_release_buffers(dev);
 fail0:
pci_disable_device(pci_dev);
-   pci_set_drvdata(pci_dev, NULL);
return stat;
 }
-- 
1.7.9.5

--
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 7/9] [media] pci: saa7164: Remove redundant pci_set_drvdata

2013-09-20 Thread Sachin Kamat
Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Steven Toth st...@kernellabs.com
---
 drivers/media/pci/saa7164/saa7164-core.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/pci/saa7164/saa7164-core.c 
b/drivers/media/pci/saa7164/saa7164-core.c
index d37ee37..41adf26 100644
--- a/drivers/media/pci/saa7164/saa7164-core.c
+++ b/drivers/media/pci/saa7164/saa7164-core.c
@@ -1439,7 +1439,6 @@ static void saa7164_finidev(struct pci_dev *pci_dev)
 
/* unregister stuff */
free_irq(pci_dev-irq, dev);
-   pci_set_drvdata(pci_dev, NULL);
 
mutex_lock(devlist);
list_del(dev-devlist);
-- 
1.7.9.5

--
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] [media] radio-sf16fmr2: Remove redundant dev_set_drvdata

2013-09-20 Thread Sachin Kamat
Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/media/radio/radio-sf16fmr2.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/radio/radio-sf16fmr2.c 
b/drivers/media/radio/radio-sf16fmr2.c
index f1e3714..448cac9 100644
--- a/drivers/media/radio/radio-sf16fmr2.c
+++ b/drivers/media/radio/radio-sf16fmr2.c
@@ -295,7 +295,6 @@ static void fmr2_remove(struct fmr2 *fmr2)
 static int fmr2_isa_remove(struct device *pdev, unsigned int ndev)
 {
fmr2_remove(dev_get_drvdata(pdev));
-   dev_set_drvdata(pdev, NULL);
 
return 0;
 }
-- 
1.7.9.5

--
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] [media] v4l2-ctrls: Remove duplicate const

2013-08-30 Thread Sachin Kamat
The function returns a pointer to a const array. Duplicate use of const
led to the following warning.
drivers/media/v4l2-core/v4l2-ctrls.c:574:32: warning: duplicate const

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Sylwester Nawrocki s.nawro...@samsung.com
---
 drivers/media/v4l2-core/v4l2-ctrls.c |6 +++---
 include/media/v4l2-common.h  |2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c 
b/drivers/media/v4l2-core/v4l2-ctrls.c
index c6dc1fd..653d48d 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -565,13 +565,13 @@ EXPORT_SYMBOL(v4l2_ctrl_get_menu);
  * Returns NULL or an s64 type array containing the menu for given
  * control ID. The total number of the menu items is returned in @len.
  */
-const s64 const *v4l2_ctrl_get_int_menu(u32 id, u32 *len)
+const s64 *v4l2_ctrl_get_int_menu(u32 id, u32 *len)
 {
-   static const s64 const qmenu_int_vpx_num_partitions[] = {
+   static const s64 qmenu_int_vpx_num_partitions[] = {
1, 2, 4, 8,
};
 
-   static const s64 const qmenu_int_vpx_num_ref_frames[] = {
+   static const s64 qmenu_int_vpx_num_ref_frames[] = {
1, 2, 3,
};
 
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index 16550c4..b87692c 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -86,7 +86,7 @@ int v4l2_ctrl_check(struct v4l2_ext_control *ctrl, struct 
v4l2_queryctrl *qctrl,
const char * const *menu_items);
 const char *v4l2_ctrl_get_name(u32 id);
 const char * const *v4l2_ctrl_get_menu(u32 id);
-const s64 const *v4l2_ctrl_get_int_menu(u32 id, u32 *len);
+const s64 *v4l2_ctrl_get_int_menu(u32 id, u32 *len);
 int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 
step, s32 def);
 int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu,
struct v4l2_queryctrl *qctrl, const char * const *menu_items);
-- 
1.7.9.5

--
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 1/1] [media] v4l2-ctrls: Remove duplicate const

2013-08-30 Thread Sachin Kamat
On 30 August 2013 17:02, Sylwester Nawrocki s.nawro...@samsung.com wrote:
 Hi Sachin,

 On 08/30/2013 01:11 PM, Sachin Kamat wrote:
 The function returns a pointer to a const array. Duplicate use of const
 led to the following warning.
 drivers/media/v4l2-core/v4l2-ctrls.c:574:32: warning: duplicate const

 Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
 Cc: Sylwester Nawrocki s.nawro...@samsung.com

 Thanks for the patch. I have already submitted a fix for this:
 https://patchwork.linuxtv.org/patch/19902/

Oops.. missed out on that. Looks like it is not yet applied to your
for-3.12-3 branch?

-- 
With warm regards,
Sachin
--
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 v5 01/13] [media] exynos5-is: Adding media device driver for exynos5

2013-08-13 Thread Sachin Kamat
Hi Arun,

On 14 August 2013 10:16, Arun Kumar K arun...@samsung.com wrote:
 From: Shaik Ameer Basha shaik.am...@samsung.com

 This patch adds support for media device for EXYNOS5 SoCs.
 The current media device supports the following ips to connect
 through the media controller framework.

 * MIPI-CSIS
   Support interconnection(subdev interface) between devices

 * FIMC-LITE
   Support capture interface from device(Sensor, MIPI-CSIS) to memory
   Support interconnection(subdev interface) between devices

 * FIMC-IS
   Camera post-processing IP having multiple sub-nodes.

 G-Scaler will be added later to the current media device.

 The media device creates two kinds of pipelines for connecting
 the above mentioned IPs.
 The pipeline0 is uses Sensor, MIPI-CSIS and FIMC-LITE which captures
 image data and dumps to memory.
 Pipeline1 uses FIMC-IS components for doing post-processing
 operations on the captured image and give scaled YUV output.

 Pipeline0
   ++ +---+ +---+ ++
   | Sensor | -- | MIPI-CSIS | -- | FIMC-LITE | -- | Memory |
   ++ +---+ +---+ ++

 Pipeline1
  ++  ++ +---+ +---+
  | Memory | --  |  ISP   | -- |SCC| -- |SCP|
  ++  ++ +---+ +---+

 Signed-off-by: Shaik Ameer Basha shaik.am...@samsung.com
 Signed-off-by: Arun Kumar K arun...@samsung.com
 ---
  .../devicetree/bindings/media/exynos5-mdev.txt |  130 +++
  drivers/media/platform/exynos5-is/exynos5-mdev.c   | 1218 
 
  drivers/media/platform/exynos5-is/exynos5-mdev.h   |  160 +++
  3 files changed, 1508 insertions(+)
  create mode 100644 Documentation/devicetree/bindings/media/exynos5-mdev.txt
  create mode 100644 drivers/media/platform/exynos5-is/exynos5-mdev.c
  create mode 100644 drivers/media/platform/exynos5-is/exynos5-mdev.h

 diff --git a/Documentation/devicetree/bindings/media/exynos5-mdev.txt 
 b/Documentation/devicetree/bindings/media/exynos5-mdev.txt
 new file mode 100644
 index 000..007ce21
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/media/exynos5-mdev.txt
 @@ -0,0 +1,130 @@
 +Samsung EXYNOS5 SoC Camera Subsystem
 +
 +
 +The Exynos5 SoC Camera subsystem comprises of multiple sub-devices
 +represented by separate device tree nodes. Currently this includes: 
 FIMC-LITE,
 +MIPI CSIS and FIMC-IS.
 +
 +The sub-subdevices are defined as child nodes of the common 'camera' node 
 which
 +also includes common properties of the whole subsystem not really specific to
 +any single sub-device, like common camera port pins or the CAMCLK clock 
 outputs
 +for external image sensors attached to an SoC.
 +
 +Common 'camera' node
 +
 +
 +Required properties:
 +
 +- compatible   : must be samsung,exynos5-fimc, simple-bus

I think it was concluded that this should be samsung,exynos5250-fimc.


Regards,
Sachin
--
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 2/6] V4L2: mx3_camera: convert to managed resource allocation

2013-08-08 Thread Sachin Kamat
Hi Guennadi ,

On 8 August 2013 20:22, Guennadi Liakhovetski g.liakhovet...@gmx.de wrote:
 Use devm_* resource allocators to simplify the driver's probe and clean up
 paths.

 Signed-off-by: Guennadi Liakhovetski g.liakhovet...@gmx.de
 ---
  drivers/media/platform/soc_camera/mx3_camera.c |   47 
 +---
  1 files changed, 10 insertions(+), 37 deletions(-)

 diff --git a/drivers/media/platform/soc_camera/mx3_camera.c 
 b/drivers/media/platform/soc_camera/mx3_camera.c
 index 1047e3e..e526096 100644
 --- a/drivers/media/platform/soc_camera/mx3_camera.c
 +++ b/drivers/media/platform/soc_camera/mx3_camera.c
 @@ -1151,23 +1151,19 @@ static int mx3_camera_probe(struct platform_device 
 *pdev)
 struct soc_camera_host *soc_host;

 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 -   if (!res) {
 -   err = -ENODEV;
 -   goto egetres;
 -   }
 +   base = devm_ioremap_resource(pdev-dev, res);
 +   if (IS_ERR(base))
 +   return PTR_ERR(base);

 -   mx3_cam = vzalloc(sizeof(*mx3_cam));
 +   mx3_cam = devm_kzalloc(pdev-dev, sizeof(*mx3_cam), GFP_KERNEL);
 if (!mx3_cam) {
 dev_err(pdev-dev, Could not allocate mx3 camera object\n);

This print is also redundant as kzalloc prints error on failure.


-- 
With warm regards,
Sachin
--
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 v3] drm/exynos: Add fallback option to get non physically continous memory for fb

2013-08-06 Thread Sachin Kamat
Hi Vikas,

On 6 August 2013 10:53, Vikas Sajjan vikas.saj...@linaro.org wrote:
 While trying to get boot-logo up on exynos5420 SMDK which has eDP panel
 connected with resolution 2560x1600, following error occured even with
 IOMMU enabled:
 [0.88] [drm:lowlevel_buffer_allocate] *ERROR* failed to allocate buffer.
 [0.89] [drm] Initialized exynos 1.0.0 20110530 on minor 0

 To address the cases where physically continous memory MAY NOT be a
 mandatory requirement for fb, the patch adds a feature to get non physically
 continous memory for fb if IOMMU is supported and if CONTIG memory allocation
 fails.

The patch looks fine. Just a small nit. Please use the word contiguous
instead of continuous to refer to memory locations consistently in
this patch.


 Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
 Signed-off-by: Arun Kumar arun...@samsung.com
 Reviewed-by: Rob Clark robdcl...@gmail.com
 ---
 changes since v2:
 - addressed comments given by Tomasz Figa tomasz.f...@gmail.com.

 changes since v1:
  - Modified to add the fallback patch if CONTIG alloc fails as 
 suggested
  by Rob Clark robdcl...@gmail.com and Tomasz Figa 
 tomasz.f...@gmail.com.

  - changed the commit message.
 ---
  drivers/gpu/drm/exynos/exynos_drm_fbdev.c |   14 --
  1 file changed, 12 insertions(+), 2 deletions(-)

 diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c 
 b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
 index 8e60bd6..faec77e 100644
 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
 +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
 @@ -16,6 +16,7 @@
  #include drm/drm_crtc.h
  #include drm/drm_fb_helper.h
  #include drm/drm_crtc_helper.h
 +#include drm/exynos_drm.h

  #include exynos_drm_drv.h
  #include exynos_drm_fb.h
 @@ -165,8 +166,17 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper 
 *helper,

 size = mode_cmd.pitches[0] * mode_cmd.height;

 -   /* 0 means to allocate physically continuous memory */
 -   exynos_gem_obj = exynos_drm_gem_create(dev, 0, size);
 +   exynos_gem_obj = exynos_drm_gem_create(dev, EXYNOS_BO_CONTIG, size);
 +   /*
 +* If IOMMU is supported then try to get buffer from non physically
 +* continous memory area.
 +*/

To make this more clear, you could say,
If physically contiguous memory allocation fails and if IOMMU is
supported, try to .


 +   if (IS_ERR(exynos_gem_obj)  is_drm_iommu_supported(dev)) {
 +   dev_warn(pdev-dev, contiguous FB allocation failed, 
 falling back to non-contiguous\n);
 +   exynos_gem_obj = exynos_drm_gem_create(dev, 
 EXYNOS_BO_NONCONTIG,
 +   size);
 +   }
 +
 if (IS_ERR(exynos_gem_obj)) {
 ret = PTR_ERR(exynos_gem_obj);
 goto err_release_framebuffer;
 --
 1.7.9.5

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



-- 
With warm regards,
Sachin
--
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: [RFC v3 09/13] [media] exynos5-fimc-is: Add the hardware pipeline control

2013-08-06 Thread Sachin Kamat
Hi Arun,

On 4 August 2013 20:30, Sylwester Nawrocki sylvester.nawro...@gmail.com wrote:
 Hi Arun,

 On 08/02/2013 05:02 PM, Arun Kumar K wrote:

 This patch adds the crucial hardware pipeline control for the
 fimc-is driver. All the subdev nodes will call this pipeline
 interfaces to reach the hardware. Responsibilities of this module
 involves configuring and maintaining the hardware pipeline involving
 multiple sub-ips like ISP, DRC, Scalers, ODC, 3DNR, FD etc.

 Signed-off-by: Arun Kumar Karun...@samsung.com
 Signed-off-by: Kilyeon Imkilyeon...@samsung.com
 ---
   .../media/platform/exynos5-is/fimc-is-pipeline.c   | 1961
 
   .../media/platform/exynos5-is/fimc-is-pipeline.h   |  129 ++
   2 files changed, 2090 insertions(+)
   create mode 100644 drivers/media/platform/exynos5-is/fimc-is-pipeline.c
   create mode 100644 drivers/media/platform/exynos5-is/fimc-is-pipeline.h

[snip]

 +   setfile_name,is-pdev-dev);
 +   if (ret != 0) {
 +   pr_err(Setfile %s not found\n, setfile_name);


 dev_err(), please. I'm a bit tired of commenting on this excessive pr_*
 usage. Please really make sure dev_err()/v4l2_err() is used where possible.

pr_* should be used only when device pointer is not available. In all
other cases dev_* takes priority.

-- 
With warm regards,
Sachin
--
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 2/3] [media] exynos4-is: Annotate unused functions

2013-08-05 Thread Sachin Kamat
Hi Sylwester,

On 5 August 2013 16:35, Sylwester Nawrocki s.nawro...@samsung.com wrote:
 Hi Sachin,

 On 08/05/2013 07:12 AM, Sachin Kamat wrote:
 On 2 August 2013 12:02, Sachin Kamat sachin.ka...@linaro.org wrote:
  __is_set_init_isp_aa and fimc_is_hw_set_tune currently do not have
  any callers. However these functions may be used in the future. Hence
  instead of deleting them, staticize and annotate them with __maybe_unused
  flag to avoid compiler warnings.
 
  Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
 Thanks for applying the other 2 patches in this series. What is your
 opinion about this one?
 Does this look good or do you prefer to delete the code altogether?

 Thanks for your work on this. I think it would be better to call those
 functions somewhere instead, e.g. in the fimc-is initialization routine,
 until there is a user interface available for this 3A control.
 fimc_is_hw_set_tune() just needs a private control a think. Let me see
 if I can come up with at least some intermediate patch to achieve this,
 so the warnings can be eliminated. I wouldn't like to take such steps
 backwards, marking those functions static an unused.

Marking it unused is just a stop gap solution to silence unnecessary warnings.
However if you can come up with some users for these functions, then
that would be great
and right thing to do.

-- 
With warm regards,
Sachin
--
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 2/3] [media] exynos4-is: Annotate unused functions

2013-08-04 Thread Sachin Kamat
Hi Sylwester,

On 2 August 2013 12:02, Sachin Kamat sachin.ka...@linaro.org wrote:
 __is_set_init_isp_aa and fimc_is_hw_set_tune currently do not have
 any callers. However these functions may be used in the future. Hence
 instead of deleting them, staticize and annotate them with __maybe_unused
 flag to avoid compiler warnings.

 Signed-off-by: Sachin Kamat sachin.ka...@linaro.org

Thanks for applying the other 2 patches in this series. What is your
opinion about this one?
Does this look good or do you prefer to delete the code altogether?

 ---
  drivers/media/platform/exynos4-is/fimc-is-param.c |2 +-
  drivers/media/platform/exynos4-is/fimc-is-regs.c  |2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

 diff --git a/drivers/media/platform/exynos4-is/fimc-is-param.c 
 b/drivers/media/platform/exynos4-is/fimc-is-param.c
 index a353be0..9bf3ddd 100644
 --- a/drivers/media/platform/exynos4-is/fimc-is-param.c
 +++ b/drivers/media/platform/exynos4-is/fimc-is-param.c
 @@ -287,7 +287,7 @@ void __is_set_sensor(struct fimc_is *is, int fps)
 fimc_is_set_param_bit(is, PARAM_ISP_OTF_INPUT);
  }

 -void __is_set_init_isp_aa(struct fimc_is *is)
 +static void __maybe_unused __is_set_init_isp_aa(struct fimc_is *is)
  {
 struct isp_param *isp;

 diff --git a/drivers/media/platform/exynos4-is/fimc-is-regs.c 
 b/drivers/media/platform/exynos4-is/fimc-is-regs.c
 index 63c68ec..cf2e13a 100644
 --- a/drivers/media/platform/exynos4-is/fimc-is-regs.c
 +++ b/drivers/media/platform/exynos4-is/fimc-is-regs.c
 @@ -96,7 +96,7 @@ int fimc_is_hw_set_param(struct fimc_is *is)
 return 0;
  }

 -int fimc_is_hw_set_tune(struct fimc_is *is)
 +static int __maybe_unused fimc_is_hw_set_tune(struct fimc_is *is)
  {
 fimc_is_hw_wait_intmsr0_intmsd0(is);

 --
 1.7.9.5




-- 
With warm regards,
Sachin
--
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: [RFC v3 01/13] [media] exynos5-is: Adding media device driver for exynos5

2013-08-04 Thread Sachin Kamat
On 2 August 2013 20:32, Arun Kumar K arun...@samsung.com wrote:
 From: Shaik Ameer Basha shaik.am...@samsung.com

 This patch adds support for media device for EXYNOS5 SoCs.
 The current media device supports the following ips to connect
 through the media controller framework.

 * MIPI-CSIS
   Support interconnection(subdev interface) between devices

 * FIMC-LITE
   Support capture interface from device(Sensor, MIPI-CSIS) to memory
   Support interconnection(subdev interface) between devices

 * FIMC-IS
   Camera post-processing IP having multiple sub-nodes.

 G-Scaler will be added later to the current media device.

 The media device creates two kinds of pipelines for connecting
 the above mentioned IPs.
 The pipeline0 is uses Sensor, MIPI-CSIS and FIMC-LITE which captures
 image data and dumps to memory.
 Pipeline1 uses FIMC-IS components for doing post-processing
 operations on the captured image and give scaled YUV output.

 Pipeline0
   ++ +---+ +---+ ++
   | Sensor | -- | MIPI-CSIS | -- | FIMC-LITE | -- | Memory |
   ++ +---+ +---+ ++

 Pipeline1
  ++  ++ +---+ +---+
  | Memory | --  |  ISP   | -- |SCC| -- |SCP|
  ++  ++ +---+ +---+

 Signed-off-by: Shaik Ameer Basha shaik.am...@samsung.com
 Signed-off-by: Arun Kumar K arun...@samsung.com

[snip]

 +
 +Common 'camera' node
 +
 +
 +Required properties:
 +
 +- compatible   : must be samsung,exynos5-fimc, simple-bus

I am not sure if this point was discusssed during the previous
versions. samsung,exynos5-fimc seems a bit generic.
The compatible string should generally point to a specific SoC (the
first one to have this IP), something like samsung,exynos5250-fimc.

 +- clocks   : list of clock specifiers, corresponding to entries in
 + the clock-names property;
 +- clock-names  : must contain sclk_cam0, sclk_cam1 entries,
 + matching entries in the clocks property.
 +

[snip]

 +Example:
 +
 +   aliases {
 +   fimc-lite0 = fimc_lite_0
 +   };
 +
 +   /* Parallel bus IF sensor */
 +   i2c_0: i2c@1386 {
 +   s5k6aa: sensor@3c {
 +   compatible = samsung,s5k6aafx;
 +   reg = 0x3c;
 +   vddio-supply = ...;
 +
 +   clock-frequency = 2400;
 +   clocks = ...;
 +   clock-names = mclk;
 +
 +   port {
 +   s5k6aa_ep: endpoint {
 +   remote-endpoint = fimc0_ep;
 +   bus-width = 8;
 +   hsync-active = 0;
 +   vsync-active = 1;
 +   pclk-sample = 1;
 +   };
 +   };
 +   };
 +   };
 +
 +   /* MIPI CSI-2 bus IF sensor */
 +   s5c73m3: sensor@0x1a {

0x not needed.

-- 
With warm regards,
Sachin
--
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/3] [media] exynos4-is: Staticize local symbol

2013-08-02 Thread Sachin Kamat
__fimc_is_hw_update_param is used only in this file. Make it static.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/media/platform/exynos4-is/fimc-is-param.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/exynos4-is/fimc-is-param.c 
b/drivers/media/platform/exynos4-is/fimc-is-param.c
index c7e7f69..a353be0 100644
--- a/drivers/media/platform/exynos4-is/fimc-is-param.c
+++ b/drivers/media/platform/exynos4-is/fimc-is-param.c
@@ -56,7 +56,7 @@ static void __fimc_is_hw_update_param_sensor_framerate(struct 
fimc_is *is)
__hw_param_copy(dst, src);
 }
 
-int __fimc_is_hw_update_param(struct fimc_is *is, u32 offset)
+static int __fimc_is_hw_update_param(struct fimc_is *is, u32 offset)
 {
struct is_param_region *par = is-is_p_region-parameter;
struct chain_config *cfg = is-config[is-config_index];
-- 
1.7.9.5

--
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 3/3] [media] exynos4-is: Fix potential NULL pointer dereference

2013-08-02 Thread Sachin Kamat
dev-of_node could be NULL. Hence check for the same and return before
dereferencing it in the subsequent error message.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/media/platform/exynos4-is/fimc-lite.c |3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c 
b/drivers/media/platform/exynos4-is/fimc-lite.c
index 08fbfed..214bde2 100644
--- a/drivers/media/platform/exynos4-is/fimc-lite.c
+++ b/drivers/media/platform/exynos4-is/fimc-lite.c
@@ -1513,6 +1513,9 @@ static int fimc_lite_probe(struct platform_device *pdev)
if (of_id)
drv_data = (struct flite_drvdata *)of_id-data;
fimc-index = of_alias_get_id(dev-of_node, fimc-lite);
+   } else {
+   dev_err(dev, device node not found\n);
+   return -EINVAL;
}
 
if (!drv_data || fimc-index = drv_data-num_instances ||
-- 
1.7.9.5

--
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 2/3] [media] exynos4-is: Annotate unused functions

2013-08-02 Thread Sachin Kamat
__is_set_init_isp_aa and fimc_is_hw_set_tune currently do not have
any callers. However these functions may be used in the future. Hence
instead of deleting them, staticize and annotate them with __maybe_unused
flag to avoid compiler warnings.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/media/platform/exynos4-is/fimc-is-param.c |2 +-
 drivers/media/platform/exynos4-is/fimc-is-regs.c  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/exynos4-is/fimc-is-param.c 
b/drivers/media/platform/exynos4-is/fimc-is-param.c
index a353be0..9bf3ddd 100644
--- a/drivers/media/platform/exynos4-is/fimc-is-param.c
+++ b/drivers/media/platform/exynos4-is/fimc-is-param.c
@@ -287,7 +287,7 @@ void __is_set_sensor(struct fimc_is *is, int fps)
fimc_is_set_param_bit(is, PARAM_ISP_OTF_INPUT);
 }
 
-void __is_set_init_isp_aa(struct fimc_is *is)
+static void __maybe_unused __is_set_init_isp_aa(struct fimc_is *is)
 {
struct isp_param *isp;
 
diff --git a/drivers/media/platform/exynos4-is/fimc-is-regs.c 
b/drivers/media/platform/exynos4-is/fimc-is-regs.c
index 63c68ec..cf2e13a 100644
--- a/drivers/media/platform/exynos4-is/fimc-is-regs.c
+++ b/drivers/media/platform/exynos4-is/fimc-is-regs.c
@@ -96,7 +96,7 @@ int fimc_is_hw_set_param(struct fimc_is *is)
return 0;
 }
 
-int fimc_is_hw_set_tune(struct fimc_is *is)
+static int __maybe_unused fimc_is_hw_set_tune(struct fimc_is *is)
 {
fimc_is_hw_wait_intmsr0_intmsd0(is);
 
-- 
1.7.9.5

--
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 3/3] [media] exynos4-is: Fix potential NULL pointer dereference

2013-08-02 Thread Sachin Kamat
Hi Sylwester,

On 2 August 2013 14:15, Sylwester Nawrocki s.nawro...@samsung.com wrote:
 Hi Sachin,

 On 08/02/2013 08:32 AM, Sachin Kamat wrote:
 dev-of_node could be NULL. Hence check for the same and return before
 dereferencing it in the subsequent error message.

 Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
 ---
  drivers/media/platform/exynos4-is/fimc-lite.c |3 +++
  1 file changed, 3 insertions(+)

 diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c 
 b/drivers/media/platform/exynos4-is/fimc-lite.c
 index 08fbfed..214bde2 100644
 --- a/drivers/media/platform/exynos4-is/fimc-lite.c
 +++ b/drivers/media/platform/exynos4-is/fimc-lite.c
 @@ -1513,6 +1513,9 @@ static int fimc_lite_probe(struct platform_device 
 *pdev)
   if (of_id)
   drv_data = (struct flite_drvdata *)of_id-data;
   fimc-index = of_alias_get_id(dev-of_node, fimc-lite);
 + } else {
 + dev_err(dev, device node not found\n);
 + return -EINVAL;
   }

 Thanks for the patch. I would prefer to add a check at very beginning
 of fimc_lite_probe() like:

 if (!dev-of_node)
 return -ENODEV;

 Those devices are only used on DT platforms.

OK. Sounds good. I will re-spin this one.

-- 
With warm regards,
Sachin
--
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 3/3] [media] exynos4-is: Fix potential NULL pointer dereference

2013-08-02 Thread Sachin Kamat
dev-of_node could be NULL. Hence check for the same and return before
dereferencing it in the subsequent error message.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
Changes since v1:
Moved the NULL check to beginning of probe.
---
 drivers/media/platform/exynos4-is/fimc-lite.c |   13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c 
b/drivers/media/platform/exynos4-is/fimc-lite.c
index 08fbfed..318d4c3 100644
--- a/drivers/media/platform/exynos4-is/fimc-lite.c
+++ b/drivers/media/platform/exynos4-is/fimc-lite.c
@@ -1504,16 +1504,17 @@ static int fimc_lite_probe(struct platform_device *pdev)
struct resource *res;
int ret;
 
+   if (!dev-of_node)
+   return -ENODEV;
+
fimc = devm_kzalloc(dev, sizeof(*fimc), GFP_KERNEL);
if (!fimc)
return -ENOMEM;
 
-   if (dev-of_node) {
-   of_id = of_match_node(flite_of_match, dev-of_node);
-   if (of_id)
-   drv_data = (struct flite_drvdata *)of_id-data;
-   fimc-index = of_alias_get_id(dev-of_node, fimc-lite);
-   }
+   of_id = of_match_node(flite_of_match, dev-of_node);
+   if (of_id)
+   drv_data = (struct flite_drvdata *)of_id-data;
+   fimc-index = of_alias_get_id(dev-of_node, fimc-lite);
 
if (!drv_data || fimc-index = drv_data-num_instances ||
fimc-index  0) {
-- 
1.7.9.5

--
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] drm/exynos: Add check for IOMMU while passing physically continous memory flag

2013-08-01 Thread Sachin Kamat
Hi Vikas,

On 2 August 2013 09:23, Vikas Sajjan vikas.saj...@linaro.org wrote:
 Hi Tomasz,


 On 2 August 2013 04:50, Tomasz Figa tomasz.f...@gmail.com wrote:

 Hi Vikas,

 On Thursday 01 of August 2013 16:49:32 Vikas Sajjan wrote:
  While trying to get boot-logo up on exynos5420 SMDK which has eDP panel
  connected with resolution 2560x1600, following error occured even with
  IOMMU enabled:
  [0.88] [drm:lowlevel_buffer_allocate] *ERROR* failed to allocate
  buffer. [0.89] [drm] Initialized exynos 1.0.0 20110530 on minor 0
 
  This patch fixes the issue by adding a check for IOMMU.
 
  Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
  Signed-off-by: Arun Kumar arun...@samsung.com
  ---
   drivers/gpu/drm/exynos/exynos_drm_fbdev.c |9 -
   1 file changed, 8 insertions(+), 1 deletion(-)
 
  diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
  b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index 8e60bd6..2a8
  100644
  --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
  +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
  @@ -16,6 +16,7 @@
   #include drm/drm_crtc.h
   #include drm/drm_fb_helper.h
   #include drm/drm_crtc_helper.h
  +#include drm/exynos_drm.h
 
   #include exynos_drm_drv.h
   #include exynos_drm_fb.h
  @@ -143,6 +144,7 @@ static int exynos_drm_fbdev_create(struct
  drm_fb_helper *helper, struct platform_device *pdev = dev-platformdev;
unsigned long size;
int ret;
  + unsigned int flag;
 
DRM_DEBUG_KMS(surface width(%d), height(%d) and bpp(%d\n,
sizes-surface_width, sizes-surface_height,
  @@ -166,7 +168,12 @@ static int exynos_drm_fbdev_create(struct
  drm_fb_helper *helper, size = mode_cmd.pitches[0] * mode_cmd.height;
 
/* 0 means to allocate physically continuous memory */
  - exynos_gem_obj = exynos_drm_gem_create(dev, 0, size);
  + if (!is_drm_iommu_supported(dev))
  + flag = 0;
  + else
  + flag = EXYNOS_BO_NONCONTIG;

 While noncontig memory might be used for devices that support IOMMU, there
 should be no problem with using contig memory for them, so this seems more
 like masking the original problem rather than tracking it down.

 Could you check why the allocation fails when requesting contiguous
 memory?


 It is failing if i am giving bigger resolution like 2560x1600, but if
 i try for 1280x780 resolution, it   works fine.
 Looks like arm_dma_alloc() is NOT able to allocate bigger buffer of
 size 2560 * 1600 * 4.

You may need to increase the zoneorder (from current default 11 to say
13) if you need large physically contiguous pages.
However I am not sure if it is recommended.

-- 
With warm regards,
Sachin
--
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] drm/exynos: Add check for IOMMU while passing physically continous memory flag

2013-08-01 Thread Sachin Kamat
Hi Vikas,

On 1 August 2013 16:49, Vikas Sajjan vikas.saj...@linaro.org wrote:
 While trying to get boot-logo up on exynos5420 SMDK which has eDP panel
 connected with resolution 2560x1600, following error occured even with
 IOMMU enabled:
 [0.88] [drm:lowlevel_buffer_allocate] *ERROR* failed to allocate buffer.
 [0.89] [drm] Initialized exynos 1.0.0 20110530 on minor 0

 This patch fixes the issue by adding a check for IOMMU.

 Signed-off-by: Vikas Sajjan vikas.saj...@linaro.org
 Signed-off-by: Arun Kumar arun...@samsung.com
 ---
  drivers/gpu/drm/exynos/exynos_drm_fbdev.c |9 -
  1 file changed, 8 insertions(+), 1 deletion(-)

 diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c 
 b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
 index 8e60bd6..2a8 100644
 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
 +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
 @@ -16,6 +16,7 @@
  #include drm/drm_crtc.h
  #include drm/drm_fb_helper.h
  #include drm/drm_crtc_helper.h
 +#include drm/exynos_drm.h

  #include exynos_drm_drv.h
  #include exynos_drm_fb.h
 @@ -143,6 +144,7 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper 
 *helper,
 struct platform_device *pdev = dev-platformdev;
 unsigned long size;
 int ret;
 +   unsigned int flag;

 DRM_DEBUG_KMS(surface width(%d), height(%d) and bpp(%d\n,
 sizes-surface_width, sizes-surface_height,
 @@ -166,7 +168,12 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper 
 *helper,
 size = mode_cmd.pitches[0] * mode_cmd.height;

 /* 0 means to allocate physically continuous memory */

This comment is now wrongly placed. Please use EXYNOS_BO_CONTIG instead of 0
and get rid of this comment altogether.

 -   exynos_gem_obj = exynos_drm_gem_create(dev, 0, size);
 +   if (!is_drm_iommu_supported(dev))
 +   flag = 0;
 +   else
 +   flag = EXYNOS_BO_NONCONTIG;
 +
 +   exynos_gem_obj = exynos_drm_gem_create(dev, flag, size);
 if (IS_ERR(exynos_gem_obj)) {
 ret = PTR_ERR(exynos_gem_obj);
 goto err_release_framebuffer;

-- 
With warm regards,
Sachin
--
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] [media] s5p-g2d: Fix registration failure

2013-07-15 Thread Sachin Kamat
Commit 1c1d86a1ea ([media] v4l2: always require v4l2_dev,
rename parent to dev_parent) expects v4l2_dev to be always set.
It converted most of the drivers using the parent field of video_device
to v4l2_dev field. G2D driver did not set the parent field. Hence it got
left out. Without this patch we get the following boot warning and G2D
driver fails to register the video device.

WARNING: CPU: 0 PID: 1 at drivers/media/v4l2-core/v4l2-dev.c:775 
__video_register_device+0xfc0/0x1028()
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.11.0-rc1-1-g1c3e372-dirty #9
[c0014b7c] (unwind_backtrace+0x0/0xf4) from [c0011524] 
(show_stack+0x10/0x14)
[c0011524] (show_stack+0x10/0x14) from [c041d7a8] (dump_stack+0x7c/0xb0)
[c041d7a8] (dump_stack+0x7c/0xb0) from [c001dc94] 
(warn_slowpath_common+0x6c/0x88)
[c001dc94] (warn_slowpath_common+0x6c/0x88) from [c001dd4c] 
(warn_slowpath_null+0x1c/0x24)
[c001dd4c] (warn_slowpath_null+0x1c/0x24) from [c02cf8d4] 
(__video_register_device+0xfc0/0x1028)
[c02cf8d4] (__video_register_device+0xfc0/0x1028) from [c0311a94] 
(g2d_probe+0x1f8/0x398)
[c0311a94] (g2d_probe+0x1f8/0x398) from [c0247d54] 
(platform_drv_probe+0x14/0x18)
[c0247d54] (platform_drv_probe+0x14/0x18) from [c0246b10] 
(driver_probe_device+0x108/0x220)
[c0246b10] (driver_probe_device+0x108/0x220) from [c0246cf8] 
(__driver_attach+0x8c/0x90)
[c0246cf8] (__driver_attach+0x8c/0x90) from [c0245050] 
(bus_for_each_dev+0x60/0x94)
[c0245050] (bus_for_each_dev+0x60/0x94) from [c02462c8] 
(bus_add_driver+0x1c0/0x24c)
[c02462c8] (bus_add_driver+0x1c0/0x24c) from [c02472d0] 
(driver_register+0x78/0x140)
[c02472d0] (driver_register+0x78/0x140) from [c00087c8] 
(do_one_initcall+0xf8/0x144)
[c00087c8] (do_one_initcall+0xf8/0x144) from [c05b29e8] 
(kernel_init_freeable+0x13c/0x1d8)
[c05b29e8] (kernel_init_freeable+0x13c/0x1d8) from [c041a108] 
(kernel_init+0xc/0x160)
[c041a108] (kernel_init+0xc/0x160) from [c000e2f8] (ret_from_fork+0x14/0x3c)
---[ end trace 4e0ec028b0028e02 ]---
s5p-g2d 1280.g2d: Failed to register video device
s5p-g2d: probe of 1280.g2d failed with error -22

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Hans Verkuil hans.verk...@cisco.com
---
 drivers/media/platform/s5p-g2d/g2d.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/s5p-g2d/g2d.c 
b/drivers/media/platform/s5p-g2d/g2d.c
index 553d87e..fd6289d 100644
--- a/drivers/media/platform/s5p-g2d/g2d.c
+++ b/drivers/media/platform/s5p-g2d/g2d.c
@@ -784,6 +784,7 @@ static int g2d_probe(struct platform_device *pdev)
}
*vfd = g2d_videodev;
vfd-lock = dev-mutex;
+   vfd-v4l2_dev = dev-v4l2_dev;
ret = video_register_device(vfd, VFL_TYPE_GRABBER, 0);
if (ret) {
v4l2_err(dev-v4l2_dev, Failed to register video device\n);
-- 
1.7.9.5

--
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] dma-buf: Replace PTR_RET with PTR_ERR_OR_ZERO

2013-07-15 Thread Sachin Kamat
PTR_RET is now deprecated. Use PTR_ERR_OR_ZERO instead.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
Compile tested and based on the following tree:
git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux.git (PTR_RET)

Dependent on [1]
[1] http://lkml.indiana.edu/hypermail/linux/kernel/1306.2/00010.html
---
 drivers/base/dma-buf.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/dma-buf.c b/drivers/base/dma-buf.c
index 6687ba7..1219ab7 100644
--- a/drivers/base/dma-buf.c
+++ b/drivers/base/dma-buf.c
@@ -680,7 +680,7 @@ int dma_buf_debugfs_create_file(const char *name,
d = debugfs_create_file(name, S_IRUGO, dma_buf_debugfs_dir,
write, dma_buf_debug_fops);
 
-   return PTR_RET(d);
+   return PTR_ERR_OR_ZERO(d);
 }
 #else
 static inline int dma_buf_init_debugfs(void)
-- 
1.7.9.5

--
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] [media] sh_veu: Replace PTR_RET with PTR_ERR_OR_ZERO

2013-07-15 Thread Sachin Kamat
PTR_RET is now deprecated. Use PTR_ERR_OR_ZERO instead.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
Compile tested and based on the following tree:
git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux.git (PTR_RET)

Dependent on [1]
[1] http://lkml.indiana.edu/hypermail/linux/kernel/1306.2/00010.html
---
 drivers/media/platform/sh_veu.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/sh_veu.c b/drivers/media/platform/sh_veu.c
index aa4cca3..744e43b 100644
--- a/drivers/media/platform/sh_veu.c
+++ b/drivers/media/platform/sh_veu.c
@@ -359,7 +359,7 @@ static int sh_veu_context_init(struct sh_veu_dev *veu)
veu-m2m_ctx = v4l2_m2m_ctx_init(veu-m2m_dev, veu,
 sh_veu_queue_init);
 
-   return PTR_RET(veu-m2m_ctx);
+   return PTR_ERR_OR_ZERO(veu-m2m_ctx);
 }
 
 static int sh_veu_querycap(struct file *file, void *priv,
-- 
1.7.9.5

--
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 v3 4/8] [media] s5p-mfc: Core support for MFC v7

2013-06-26 Thread Sachin Kamat
Hi Arun,

On 26 June 2013 12:18, Arun Kumar K arunkk.sams...@gmail.com wrote:
 Hi Sachin,

 On Tue, Jun 25, 2013 at 4:54 PM, Sachin Kamat sachin.ka...@linaro.org wrote:
 Hi Arun,

 @@ -684,5 +685,6 @@ void set_work_bit_irqsave(struct s5p_mfc_ctx *ctx);
 (dev-variant-port_num ? 1 : 0) : 0) : 0)
  #define IS_TWOPORT(dev)(dev-variant-port_num == 2 ? 1 : 
 0)
  #define IS_MFCV6_PLUS(dev) (dev-variant-version = 0x60 ? 1 : 0)
 +#define IS_MFCV7(dev)  (dev-variant-version = 0x70 ? 1 : 0)

 Considering the definition and pattern, wouldn't it be appropriate to
 call this  IS_MFCV7_PLUS?


 We are still not sure about MFCv8 if it can re-use v7 stuff or not.


OK. In that case probably we can restrict the definition to
(dev-variant-version == 0x70 ? 1 : 0).


-- 
With warm regards,
Sachin
--
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 v3 4/8] [media] s5p-mfc: Core support for MFC v7

2013-06-25 Thread Sachin Kamat
Hi Arun,

 @@ -684,5 +685,6 @@ void set_work_bit_irqsave(struct s5p_mfc_ctx *ctx);
 (dev-variant-port_num ? 1 : 0) : 0) : 0)
  #define IS_TWOPORT(dev)(dev-variant-port_num == 2 ? 1 : 0)
  #define IS_MFCV6_PLUS(dev) (dev-variant-version = 0x60 ? 1 : 0)
 +#define IS_MFCV7(dev)  (dev-variant-version = 0x70 ? 1 : 0)

Considering the definition and pattern, wouldn't it be appropriate to
call this  IS_MFCV7_PLUS?

---
With warm regards,
Sachin
--
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 3/6] [media] s5p-mfc: Core support for MFC v7

2013-06-18 Thread Sachin Kamat
Hi Arun,

On 18 June 2013 11:25, Arun Kumar K arunkk.sams...@gmail.com wrote:
 Hi Sachin,


 On Tue, Jun 18, 2013 at 10:56 AM, Sachin Kamat sachin.ka...@linaro.org 
 wrote:
 On 18 June 2013 10:21, Arun Kumar K arunkk.sams...@gmail.com wrote:
 Hi Kamil,

 Thank you for the review.


  #define IS_MFCV6(dev)(dev-variant-version = 0x60 ? 1 :
 0)
 +#define IS_MFCV7(dev)(dev-variant-version = 0x70 ? 1 :
 0)

 According to this, MFC v7 is also detected as MFC v6. Was this intended?

 Yes this was intentional as most of v7 will be reusing the v6 code and
 only minor
 changes are there w.r.t firmware interface.


 I think that it would be much better to use this in code:
 if (IS_MFCV6(dev) || IS_MFCV7(dev))
 And change the define to detect only single MFC revision:
 #define IS_MFCV6(dev)   (dev-variant-version = 0x60 
 dev-variant-version  0x70)


 I kept it like that since the macro IS_MFCV6() is used quite frequently
 in the driver. Also if MFCv8 comes which is again similar to v6 (not
 sure about this),
 then it will add another OR condition to this check.

 Other possibility I see is to change the name of the check. Although
 IS_MFCV6_OR_NEWER(dev) seems too long :)


 How about making it IS_MFCV6_PLUS()?

 Technically
 #define IS_MFCV6(dev)(dev-variant-version = 0x60...)
 means all lower versions are also higher versions.
 This may not cause much of a problem (other than the macro being a
 misnomer) as all current higher versions are supersets of lower
 versions.
 But this is not guaranteed(?).


 Till now we havent encountered otherwise and we can only hope that
 it remains like this :)


 Hence changing the definition of the macro to (dev-variant-version
= 0x60  dev-variant-version  0x70) as Kamil suggested or
 renaming it to
 IS_MFCV6_PLUS() makes sense.

 OTOH, do we really have intermediate version numbers? For e.g. 0x61, 0x72, 
 etc?

 If not we can make it just:
 #define IS_MFCV6(dev)(dev-variant-version == 0x60 ? 1 : 0)


 The v6 version we use is actually v6.5 and v7 is v7.2.
 In mainline we havent used any FW sub-versions yet.

OK. Do they co-exist or is there a possibility for that (to have v6.5
and say v6.7 or v7.2 and v7.4, etc). Just asking.


-- 
With warm regards,
Sachin
--
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] Documentation: Update driver's directory in video4linux/fimc.txt

2013-06-18 Thread Sachin Kamat
Hi Sylwester,

On 19 June 2013 03:27, Sylwester Nawrocki sylvester.nawro...@gmail.com wrote:
 Hi Sachin,


 On 06/18/2013 05:45 AM, Sachin Kamat wrote:

 Hi Sylwester,

 -The machine code (plat-s5p and arch/arm/mach-*) must select following
 options
 +The machine code (arch/arm/plat-samsung and arch/arm/mach-*) must select
 +following options:


 After the recent platform code cleanup the below entries are not found
 in arch/arm/mach-* (checked in linux-next).

   CONFIG_S5P_DEV_FIMC0   mandatory
   CONFIG_S5P_DEV_FIMC1  \


 AFAICS some are still there:

 $ git grep S5P_DEV_FIMC0
 Documentation/video4linux/fimc.txt:CONFIG_S5P_DEV_FIMC0   mandatory
 arch/arm/mach-s5pc100/Kconfig:  select S5P_DEV_FIMC0
 arch/arm/mach-s5pv210/Kconfig:  select S5P_DEV_FIMC0
 arch/arm/mach-s5pv210/Kconfig:  select S5P_DEV_FIMC0
 arch/arm/mach-s5pv210/Kconfig:  select S5P_DEV_FIMC0
 arch/arm/mach-s5pv210/Kconfig:  select S5P_DEV_FIMC0
 arch/arm/plat-samsung/Kconfig:config S5P_DEV_FIMC0
 arch/arm/plat-samsung/devs.c:#ifdef CONFIG_S5P_DEV_FIMC0
 arch/arm/plat-samsung/devs.c:#endif /* CONFIG_S5P_DEV_FIMC0 */
 arch/arm/plat-samsung/include/plat/fimc-core.h:#ifdef CONFIG_S5P_DEV_FIMC0

 Those symbols have been removed only for Exynos. The above can be dropped
 once we convert S5PV210 and S5PC100 (or drop support for this platform)
 to Device Tree.

Yes you are right. Probably I mis-grepped it.

-- 
With warm regards,
Sachin
--
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] MAINTAINERS: Update S5P/Exynos FIMC driver entry

2013-06-17 Thread Sachin Kamat
Hi Sylwester,

Just a couple of nits inline.

On 17 June 2013 22:12, Sylwester Nawrocki s.nawro...@samsung.com wrote:
 This change is mainly to update the driver's path changed from
 drivers/media/platform/s5p-fimc to drivers/media/platform/exynos4-is/.
 While at it, remove non-existent files rule, move the whole entry to
 the Samsung drivers section and add the patch tracking system URL.

How about adding git URL too (of your repo)?


 Signed-off-by: Sylwester Nawrocki s.nawro...@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
 ---
  MAINTAINERS |   17 -
  1 file changed, 8 insertions(+), 9 deletions(-)

 diff --git a/MAINTAINERS b/MAINTAINERS
 index 3d7782b..d2c5618 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
 @@ -1153,15 +1153,6 @@ L:   linux-media@vger.kernel.org
  S: Maintained
  F: drivers/media/platform/s5p-g2d/

 -ARM/SAMSUNG S5P SERIES FIMC SUPPORT
 -M: Kyungmin Park kyungmin.p...@samsung.com
 -M: Sylwester Nawrocki s.nawro...@samsung.com
 -L: linux-arm-ker...@lists.infradead.org
 -L: linux-media@vger.kernel.org
 -S: Maintained
 -F: arch/arm/plat-samsung/include/plat/*fimc*
 -F: drivers/media/platform/s5p-fimc/
 -
  ARM/SAMSUNG S5P SERIES Multi Format Codec (MFC) SUPPORT

Probably ARM could be removed from here too and may be other places if
they exist just like below entry.

  M: Kyungmin Park kyungmin.p...@samsung.com
  M: Kamil Debski k.deb...@samsung.com
 @@ -6930,6 +6921,14 @@ F:   drivers/regulator/s5m*.c
  F: drivers/rtc/rtc-sec.c
  F: include/linux/mfd/samsung/

 +SAMSUNG S5P/EXYNOS4 SOC SERIES CAMERA SUBSYSTEM DRIVERS
 +M: Kyungmin Park kyungmin.p...@samsung.com
 +M: Sylwester Nawrocki s.nawro...@samsung.com
 +L: linux-media@vger.kernel.org
 +Q: https://patchwork.linuxtv.org/project/linux-media/list/
 +S: Supported
 +F: drivers/media/platform/exynos4-is/
 +

Considering alphabetical order (now that ARM is removed), this block
should come after
SAMSUNG S3C24XX/S3C64XX...

  SAMSUNG S3C24XX/S3C64XX SOC SERIES CAMIF DRIVER
  M: Sylwester Nawrocki sylvester.nawro...@gmail.com
  L: linux-media@vger.kernel.org
 --


-- 
With warm regards,
Sachin
--
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] Documentation: Update driver's directory in video4linux/fimc.txt

2013-06-17 Thread Sachin Kamat
Hi Sylwester,


 -The machine code (plat-s5p and arch/arm/mach-*) must select following options
 +The machine code (arch/arm/plat-samsung and arch/arm/mach-*) must select
 +following options:

After the recent platform code cleanup the below entries are not found
in arch/arm/mach-* (checked in linux-next).


  CONFIG_S5P_DEV_FIMC0   mandatory
  CONFIG_S5P_DEV_FIMC1  \

-- 
With warm regards,
Sachin
--
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 3/6] [media] s5p-mfc: Core support for MFC v7

2013-06-17 Thread Sachin Kamat
On 18 June 2013 10:21, Arun Kumar K arunkk.sams...@gmail.com wrote:
 Hi Kamil,

 Thank you for the review.


  #define IS_MFCV6(dev)(dev-variant-version = 0x60 ? 1 :
 0)
 +#define IS_MFCV7(dev)(dev-variant-version = 0x70 ? 1 :
 0)

 According to this, MFC v7 is also detected as MFC v6. Was this intended?

 Yes this was intentional as most of v7 will be reusing the v6 code and
 only minor
 changes are there w.r.t firmware interface.


 I think that it would be much better to use this in code:
 if (IS_MFCV6(dev) || IS_MFCV7(dev))
 And change the define to detect only single MFC revision:
 #define IS_MFCV6(dev)   (dev-variant-version = 0x60 
 dev-variant-version  0x70)


 I kept it like that since the macro IS_MFCV6() is used quite frequently
 in the driver. Also if MFCv8 comes which is again similar to v6 (not
 sure about this),
 then it will add another OR condition to this check.

 Other possibility I see is to change the name of the check. Although
 IS_MFCV6_OR_NEWER(dev) seems too long :)


 How about making it IS_MFCV6_PLUS()?

Technically
#define IS_MFCV6(dev)(dev-variant-version = 0x60...)
means all lower versions are also higher versions.
This may not cause much of a problem (other than the macro being a
misnomer) as all current higher versions are supersets of lower
versions.
But this is not guaranteed(?).

Hence changing the definition of the macro to (dev-variant-version
= 0x60  dev-variant-version  0x70) as Kamil suggested or
renaming it to
IS_MFCV6_PLUS() makes sense.

OTOH, do we really have intermediate version numbers? For e.g. 0x61, 0x72, etc?

If not we can make it just:
#define IS_MFCV6(dev)(dev-variant-version == 0x60 ? 1 : 0)


-- 
With warm regards,
Sachin
--
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: [RFC v2 06/10] exynos5-fimc-is: Adds isp subdev

2013-06-06 Thread Sachin Kamat
On 31 May 2013 18:33, Arun Kumar K arun...@samsung.com wrote:
 fimc-is driver takes video data input from the ISP video node
 which is added in this patch. This node accepts Bayer input
 buffers which is given from the IS sensors.

 Signed-off-by: Arun Kumar K arun...@samsung.com
 Signed-off-by: Kilyeon Im kilyeon...@samsung.com
 ---
[snip]


 +static int isp_video_output_open(struct file *file)
 +{
 +   struct fimc_is_isp *isp = video_drvdata(file);
 +   int ret = 0;
 +
 +   /* Check if opened before */
 +   if (isp-refcount = FIMC_IS_MAX_INSTANCES) {
 +   pr_err(All instances are in use.\n);
 +   return -EBUSY;
 +   }
 +
 +   INIT_LIST_HEAD(isp-wait_queue);
 +   isp-wait_queue_cnt = 0;
 +   INIT_LIST_HEAD(isp-run_queue);
 +   isp-run_queue_cnt = 0;
 +
 +   isp-refcount++;
 +   return ret;

You can directly return 0 here instead of creating a local variable
'ret' which is not used anywhere else.

 +}
 +
 +static int isp_video_output_close(struct file *file)
 +{
 +   struct fimc_is_isp *isp = video_drvdata(file);
 +   int ret = 0;
 +
 +   isp-refcount--;
 +   isp-output_state = 0;
 +   vb2_fop_release(file);
 +   return ret;

ditto

 +}
 +
 +static const struct v4l2_file_operations isp_video_output_fops = {
 +   .owner  = THIS_MODULE,
 +   .open   = isp_video_output_open,
 +   .release= isp_video_output_close,
 +   .poll   = vb2_fop_poll,
 +   .unlocked_ioctl = video_ioctl2,
 +   .mmap   = vb2_fop_mmap,
 +};
 +

nit: Please consider changing Adds to Add in the patch titles of
this series during the next spin.

-- 
With warm regards,
Sachin
--
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: [RFC v2 04/10] exynos5-fimc-is: Adds the register definition and context header

2013-06-06 Thread Sachin Kamat
On 31 May 2013 18:33, Arun Kumar K arun...@samsung.com wrote:
 This patch adds the register definition file for the fimc-is driver
 and also the header file containing the main context for the driver.

 Signed-off-by: Arun Kumar K arun...@samsung.com
 Signed-off-by: Kilyeon Im kilyeon...@samsung.com
 ---
  drivers/media/platform/exynos5-is/fimc-is-regs.h |  107 +++
  drivers/media/platform/exynos5-is/fimc-is.h  |  151 
 ++
  2 files changed, 258 insertions(+)
  create mode 100644 drivers/media/platform/exynos5-is/fimc-is-regs.h
  create mode 100644 drivers/media/platform/exynos5-is/fimc-is.h

 diff --git a/drivers/media/platform/exynos5-is/fimc-is-regs.h 
 b/drivers/media/platform/exynos5-is/fimc-is-regs.h
 new file mode 100644
 index 000..d00df7b
 --- /dev/null
 +++ b/drivers/media/platform/exynos5-is/fimc-is-regs.h
 @@ -0,0 +1,107 @@
 +/*
 + * Samsung Exynos5 SoC series FIMC-IS driver
 + *
 + * Copyright (c) 2013 Samsung Electronics Co., Ltd
 + * Arun Kumar K arun...@samsung.com
 + * Kil-yeon Lim kilyeon...@samsung.com
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2 as
 + * published by the Free Software Foundation.
 + */
 +
 +#ifndef FIMC_IS_REGS_H
 +#define FIMC_IS_REGS_H
 +
 +#include mach/map.h

Why do you need this?


-- 
With warm regards,
Sachin
--
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: [RFC v2 05/10] exynos5-fimc-is: Adds the sensor subdev

2013-06-06 Thread Sachin Kamat
On 31 May 2013 18:33, Arun Kumar K arun...@samsung.com wrote:
 FIMC-IS uses certain sensors which are exclusively controlled
 from the IS firmware. This patch adds the sensor subdev for the
 fimc-is sensors.

 Signed-off-by: Arun Kumar K arun...@samsung.com
 Signed-off-by: Kilyeon Im kilyeon...@samsung.com
 ---
  drivers/media/platform/exynos5-is/fimc-is-sensor.c |  463 
 
  drivers/media/platform/exynos5-is/fimc-is-sensor.h |  168 +++
  2 files changed, 631 insertions(+)
  create mode 100644 drivers/media/platform/exynos5-is/fimc-is-sensor.c
  create mode 100644 drivers/media/platform/exynos5-is/fimc-is-sensor.h

[snip]

 +static int sensor_s_stream(struct v4l2_subdev *sd, int enable)
 +{
 +   struct fimc_is_sensor *sensor = sd_to_fimc_is_sensor(sd);
 +   int ret;
 +
 +   if (enable) {
 +   pr_debug(Stream ON\n);
 +   /* Open pipeline */
 +   ret = fimc_is_pipeline_open(sensor-pipeline, sensor);
 +   if (ret  0) {
 +   pr_err(Pipeline already opened.\n);
 +   return -EBUSY;

why not propogate 'ret'? Same for other instances below.

 +   }
 +
 +   /* Start IS pipeline */
 +   ret = fimc_is_pipeline_start(sensor-pipeline);
 +   if (ret  0) {
 +   pr_err(Pipeline start failed.\n);
 +   return -EINVAL;
 +   }
 +   } else {
 +   pr_debug(Stream OFF\n);
 +   /* Stop IS pipeline */
 +   ret = fimc_is_pipeline_stop(sensor-pipeline);
 +   if (ret  0) {
 +   pr_err(Pipeline stop failed.\n);
 +   return -EINVAL;
 +   }
 +
 +   /* Close pipeline */
 +   ret = fimc_is_pipeline_close(sensor-pipeline);
 +   if (ret  0) {
 +   pr_err(Pipeline close failed\n);
 +   return -EBUSY;
 +   }
 +   }
 +
 +   return 0;
 +}
 +

[snip]

 +
 +static int fimc_is_sensor_probe(struct i2c_client *client,
 +   const struct i2c_device_id *id)
 +{
 +   struct device *dev = client-dev;
 +   struct fimc_is_sensor *sensor;
 +   const struct of_device_id *of_id;
 +   struct v4l2_subdev *sd;
 +   int gpio, ret;
 +   unsigned int sensor_id;
 +
 +   sensor = devm_kzalloc(dev, sizeof(*sensor), GFP_KERNEL);
 +   if (!sensor)
 +   return -ENOMEM;
 +
 +   sensor-gpio_reset = -EINVAL;
 +
 +   gpio = of_get_gpio_flags(dev-of_node, 0, NULL);
 +   if (gpio_is_valid(gpio)) {
 +   ret = gpio_request_one(gpio, GPIOF_OUT_INIT_LOW, DRIVER_NAME);
 +   if (ret  0)
 +   return ret;
 +   }
 +   pr_err(GPIO Request success : %d, gpio);
 +   sensor-gpio_reset = gpio;
 +
 +   of_id = of_match_node(fimc_is_sensor_of_match, dev-of_node);
 +   if (!of_id) {
 +   ret = -ENODEV;
 +   goto err_gpio;
 +   }
 +
 +   sensor-drvdata = (struct fimc_is_sensor_drv_data *) of_id-data;
 +   sensor-dev = dev;
 +
 +   /* Get FIMC-IS context */
 +   ret = sensor_parse_dt(sensor, dev-of_node);
 +   if (ret) {
 +   pr_err(Unable to obtain IS context\n);
 +   ret = -ENODEV;

Why not propagate 'ret' itself?


-- 
With warm regards,
Sachin
--
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: [RFC v2 07/10] exynos5-fimc-is: Adds scaler subdev

2013-06-06 Thread Sachin Kamat
On 31 May 2013 18:33, Arun Kumar K arun...@samsung.com wrote:
 FIMC-IS has two hardware scalers named as scaler-codec and
 scaler-preview. This patch adds the common code handling the
 video nodes and subdevs of both the scalers.

 Signed-off-by: Arun Kumar K arun...@samsung.com
 Signed-off-by: Kilyeon Im kilyeon...@samsung.com
 ---

[snip]

 +static int scaler_video_capture_open(struct file *file)
 +{
 +   struct fimc_is_scaler *ctx = video_drvdata(file);
 +   int ret = 0;
 +
 +   /* Check if opened before */
 +   if (ctx-refcount = FIMC_IS_MAX_INSTANCES) {
 +   pr_err(All instances are in use.\n);
 +   return -EBUSY;
 +   }
 +
 +   INIT_LIST_HEAD(ctx-wait_queue);
 +   ctx-wait_queue_cnt = 0;
 +   INIT_LIST_HEAD(ctx-run_queue);
 +   ctx-run_queue_cnt = 0;
 +
 +   ctx-fmt = NULL;
 +   ctx-refcount++;
 +
 +   return ret;

Directly return 0.

 +}
 +
 +static int scaler_video_capture_close(struct file *file)
 +{
 +   struct fimc_is_scaler *ctx = video_drvdata(file);
 +   int ret = 0;
 +
 +   ctx-refcount--;
 +   ctx-capture_state = 0;
 +   vb2_fop_release(file);
 +
 +   return ret;

ditto

-- 
With warm regards,
Sachin
--
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 1/2] [media] soc_camera: mt9t112: Remove empty function

2013-06-05 Thread Sachin Kamat
On 5 June 2013 15:32, Guennadi Liakhovetski g.liakhovet...@gmx.de wrote:
 Hi Sachin

 On Tue, 4 Jun 2013, Sachin Kamat wrote:

 On 24 May 2013 16:55, Sachin Kamat sachin.ka...@linaro.org wrote:
  After the switch to devm_* functions, the 'remove' function does
  not do anything. Delete it.
 
  Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
  Cc: Kuninori Morimoto morimoto.kunin...@renesas.com
  ---
   drivers/media/i2c/soc_camera/mt9t112.c |6 --
   1 file changed, 6 deletions(-)

 [snip]

 Gentle ping on this series  :)

 Both these patches are in my queue for 3.11.

Thanks Guennadi.

-- 
With warm regards,
Sachin
--
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: [RFC v2 02/10] exynos5-fimc-is: Adds fimc-is driver core files

2013-06-05 Thread Sachin Kamat
Hi Arun,

On 31 May 2013 18:33, Arun Kumar K arun...@samsung.com wrote:
 This driver is for the FIMC-IS IP available in Samsung Exynos5
 SoC onwards. This patch adds the core files for the new driver.

 Signed-off-by: Arun Kumar K arun...@samsung.com
 Signed-off-by: Kilyeon Im kilyeon...@samsung.com
 ---
[snip]

 +
 +static void fimc_is_clk_put(struct fimc_is *is)
 +{
 +   int i;
 +
 +   for (i = 0; i  IS_CLK_MAX_NUM; i++) {
 +   if (IS_ERR_OR_NULL(is-clock[i]))

You should not check for NULL here. Instead initialize the clocks to
some error value (like  is-clock[i] =  ERR_PTR(-EINVAL); )
and use IS_ERR only.

 +   continue;
 +   clk_unprepare(is-clock[i]);
 +   clk_put(is-clock[i]);
 +   is-clock[i] = NULL;
 +   }
 +}
 +
 +static int fimc_is_clk_get(struct fimc_is *is)
 +{
 +   struct device *dev = is-pdev-dev;
 +   int i, ret;
 +
 +   for (i = 0; i  IS_CLK_MAX_NUM; i++) {
 +   is-clock[i] = clk_get(dev, fimc_is_clock_name[i]);
 +   if (IS_ERR(is-clock[i]))
 +   goto err;
 +   ret = clk_prepare(is-clock[i]);
 +   if (ret  0) {
 +   clk_put(is-clock[i]);
 +   is-clock[i] = NULL;

is-clock[i] =  ERR_PTR(-EINVAL);

 +   goto err;
 +   }
 +   }
 +   return 0;
 +err:
 +   fimc_is_clk_put(is);
 +   pr_err(Failed to get clock: %s\n, fimc_is_clock_name[i]);
 +   return -ENXIO;
 +}
 +
 +static int fimc_is_clk_cfg(struct fimc_is *is)
 +{
 +   int ret;
 +
 +   ret = fimc_is_clk_get(is);
 +   if (ret)
 +   return ret;
 +
 +   /* Set rates */
 +   ret = clk_set_rate(is-clock[IS_CLK_MCU_ISP_DIV0], 200 * 100);
 +   ret |= clk_set_rate(is-clock[IS_CLK_MCU_ISP_DIV1], 100 * 100);
 +   ret |= clk_set_rate(is-clock[IS_CLK_ISP_DIV0], 134 * 100);
 +   ret |= clk_set_rate(is-clock[IS_CLK_ISP_DIV1], 68 * 100);
 +   ret |= clk_set_rate(is-clock[IS_CLK_ISP_DIVMPWM], 34 * 100);
 +
 +   if (ret)
 +   return -EINVAL;
 +
 +   return 0;
 +}
 +
 +static int fimc_is_probe(struct platform_device *pdev)
 +{
 +   struct device *dev = pdev-dev;
 +   struct resource res;
 +   struct fimc_is *is;
 +   struct pinctrl *pctrl;
 +   void __iomem *regs;
 +   struct device_node *node;
 +   int irq, ret;
 +
 +   pr_debug(FIMC-IS Probe Enter\n);
 +
 +   if (!pdev-dev.of_node)
 +   return -ENODEV;
 +
 +   is = devm_kzalloc(pdev-dev, sizeof(*is), GFP_KERNEL);
 +   if (!is)
 +   return -ENOMEM;
 +
 +   is-pdev = pdev;
 +
 +   ret = of_address_to_resource(dev-of_node, 0, res);
 +   if (ret  0)
 +   return ret;
 +
 +   regs = devm_ioremap_resource(dev, res);
 +   if (regs == NULL) {

Please use if(IS_ERR(regs))

 +   dev_err(dev, Failed to obtain io memory\n);

This is not needed as devm_ioremap_resource prints the appropriate
error messages.

 +   return -ENOENT;

return PTR_ERR(regs);

Don't forget to include linux/err.h for using PTR_ERR() .

-- 
With warm regards,
Sachin
--
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 1/2] [media] soc_camera: mt9t112: Remove empty function

2013-06-04 Thread Sachin Kamat
On 24 May 2013 16:55, Sachin Kamat sachin.ka...@linaro.org wrote:
 After the switch to devm_* functions, the 'remove' function does
 not do anything. Delete it.

 Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
 Cc: Kuninori Morimoto morimoto.kunin...@renesas.com
 ---
  drivers/media/i2c/soc_camera/mt9t112.c |6 --
  1 file changed, 6 deletions(-)

 diff --git a/drivers/media/i2c/soc_camera/mt9t112.c 
 b/drivers/media/i2c/soc_camera/mt9t112.c
 index a7256b7..0af29a4 100644
 --- a/drivers/media/i2c/soc_camera/mt9t112.c
 +++ b/drivers/media/i2c/soc_camera/mt9t112.c
 @@ -1118,11 +1118,6 @@ static int mt9t112_probe(struct i2c_client *client,
 return ret;
  }

 -static int mt9t112_remove(struct i2c_client *client)
 -{
 -   return 0;
 -}
 -
  static const struct i2c_device_id mt9t112_id[] = {
 { mt9t112, 0 },
 { }
 @@ -1134,7 +1129,6 @@ static struct i2c_driver mt9t112_i2c_driver = {
 .name = mt9t112,
 },
 .probe= mt9t112_probe,
 -   .remove   = mt9t112_remove,
 .id_table = mt9t112_id,
  };

 --
 1.7.9.5


Gentle ping on this series  :)


-- 
With warm regards,
Sachin
--
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 1/3] s5p-mfc: separate encoder parameters for h264 and mpeg4

2013-05-28 Thread Sachin Kamat
Hi Andrzej,

On 28 May 2013 12:56, Andrzej Hajda a.ha...@samsung.com wrote:
 This patch fixes a bug which caused overwriting h264 codec
 parameters by mpeg4 parameters during V4L2 control setting.

Just curious, what was the use case that triggered this issue?

-- 
With warm regards,
Sachin
--
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 3/3] s5p-mfc: added missing end-of-lines in debug messages

2013-05-28 Thread Sachin Kamat
Hi Andrzej,

On 28 May 2013 12:56, Andrzej Hajda a.ha...@samsung.com wrote:
 Many debug messages missed end-of-line.

 Signed-off-by: Andrzej Hajda a.ha...@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
 ---
  drivers/media/platform/s5p-mfc/s5p_mfc.c|  2 +-
  drivers/media/platform/s5p-mfc/s5p_mfc_debug.h  |  4 ++--
  drivers/media/platform/s5p-mfc/s5p_mfc_enc.c| 16 
  drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c |  4 ++--
  drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c | 16 
  drivers/media/platform/s5p-mfc/s5p_mfc_pm.c |  4 ++--
  6 files changed, 23 insertions(+), 23 deletions(-)

Instead of changing in so many places, can't we add it in the macro
itself, something like this?
 #define mfc_debug(level, fmt, args...) \
do {\
if (debug = level) \
-   printk(KERN_DEBUG %s:%d:  fmt,\
+   printk(KERN_DEBUG %s:%d:  fmt \n,   \
__func__, __LINE__, ##args);\
} while (0)


-- 
With warm regards,
Sachin
--
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] [media] s5p-mfc: Add NULL check for allocated buffer

2013-05-28 Thread Sachin Kamat
In certain cases, dma_alloc_coherent returns NULL. Add check for
NULL pointer.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c 
b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c
index 2e5f30b..dc1fc94 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c
@@ -38,7 +38,7 @@ int s5p_mfc_alloc_firmware(struct s5p_mfc_dev *dev)
dev-fw_virt_addr = dma_alloc_coherent(dev-mem_dev_l, dev-fw_size,
dev-bank1, GFP_KERNEL);
 
-   if (IS_ERR(dev-fw_virt_addr)) {
+   if (IS_ERR_OR_NULL(dev-fw_virt_addr)) {
dev-fw_virt_addr = NULL;
mfc_err(Allocating bitprocessor buffer failed\n);
return -ENOMEM;
-- 
1.7.9.5

--
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/2] [media] soc_camera: mt9t112: Remove empty function

2013-05-24 Thread Sachin Kamat
After the switch to devm_* functions, the 'remove' function does
not do anything. Delete it.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Kuninori Morimoto morimoto.kunin...@renesas.com
---
 drivers/media/i2c/soc_camera/mt9t112.c |6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/media/i2c/soc_camera/mt9t112.c 
b/drivers/media/i2c/soc_camera/mt9t112.c
index a7256b7..0af29a4 100644
--- a/drivers/media/i2c/soc_camera/mt9t112.c
+++ b/drivers/media/i2c/soc_camera/mt9t112.c
@@ -1118,11 +1118,6 @@ static int mt9t112_probe(struct i2c_client *client,
return ret;
 }
 
-static int mt9t112_remove(struct i2c_client *client)
-{
-   return 0;
-}
-
 static const struct i2c_device_id mt9t112_id[] = {
{ mt9t112, 0 },
{ }
@@ -1134,7 +1129,6 @@ static struct i2c_driver mt9t112_i2c_driver = {
.name = mt9t112,
},
.probe= mt9t112_probe,
-   .remove   = mt9t112_remove,
.id_table = mt9t112_id,
 };
 
-- 
1.7.9.5

--
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 2/2] [media] soc_camera: tw9910: Remove empty function

2013-05-24 Thread Sachin Kamat
After the switch to devm_* functions, the 'remove' function does
not do anything. Delete it.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Kuninori Morimoto morimoto.kunin...@renesas.com
---
 drivers/media/i2c/soc_camera/tw9910.c |6 --
 1 file changed, 6 deletions(-)

diff --git a/drivers/media/i2c/soc_camera/tw9910.c 
b/drivers/media/i2c/soc_camera/tw9910.c
index bad90b1..6b9cc2a 100644
--- a/drivers/media/i2c/soc_camera/tw9910.c
+++ b/drivers/media/i2c/soc_camera/tw9910.c
@@ -938,11 +938,6 @@ static int tw9910_probe(struct i2c_client *client,
return tw9910_video_probe(client);
 }
 
-static int tw9910_remove(struct i2c_client *client)
-{
-   return 0;
-}
-
 static const struct i2c_device_id tw9910_id[] = {
{ tw9910, 0 },
{ }
@@ -954,7 +949,6 @@ static struct i2c_driver tw9910_i2c_driver = {
.name = tw9910,
},
.probe= tw9910_probe,
-   .remove   = tw9910_remove,
.id_table = tw9910_id,
 };
 
-- 
1.7.9.5

--
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: Warnings related to anonymous unions in s5p-tv driver

2013-05-22 Thread Sachin Kamat
On 21 May 2013 14:58, Hans Verkuil hverk...@xs4all.nl wrote:
 On Fri 17 May 2013 10:24:50 Sachin Kamat wrote:
 Hi Hans,

 I noticed the following sparse warnings with S5P HDMI driver which I
 think got introduced due to the following commit:
 5efb54b2b7b ([media] s5p-tv: add dv_timings support for hdmi)

 Warnings:
 drivers/media/platform/s5p-tv/hdmi_drv.c:483:18: error: unknown field
 name in initializer
 drivers/media/platform/s5p-tv/hdmi_drv.c:484:18: error: unknown field
 name in initializer
 drivers/media/platform/s5p-tv/hdmi_drv.c:485:18: error: unknown field
 name in initializer
 drivers/media/platform/s5p-tv/hdmi_drv.c:486:18: error: unknown field
 name in initializer
 drivers/media/platform/s5p-tv/hdmi_drv.c:487:18: error: unknown field
 name in initializer
 drivers/media/platform/s5p-tv/hdmi_drv.c:488:18: error: unknown field
 name in initializer
 drivers/media/platform/s5p-tv/hdmi_drv.c:489:18: error: unknown field
 name in initializer
 drivers/media/platform/s5p-tv/hdmi_drv.c:490:18: error: unknown field
 name in initializer
 drivers/media/platform/s5p-tv/hdmi_drv.c:491:18: error: unknown field
 name in initializer
 drivers/media/platform/s5p-tv/hdmi_drv.c:492:18: error: unknown field
 name in initializer

 This looks like the anonymous union initialization problem with GCC.
 Surprisingly I get this with GCC 4.6, 4.7 and 4.8 as well.

 If I add additional braces to the macro V4L2_INIT_BT_TIMINGS like done
 for GCC version  4.6
 like
 { .bt = { _width , ## args } }

 or if I change the GNUC_MINOR comparison to 9 like (__GNUC_MINOR__  9)
 I dont see this error.

 I am using the Linaro GCC toolchain.

 I am not sure if this has already been reported and/or fixed.


 Could it be that a different compiler version is used when using sparse?
 I don't see these errors when running sparse during the daily build.

Please let me know your compiler version. I could probably try with it and see.


-- 
With warm regards,
Sachin
--
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/2] [media] exynos-gsc: Remove redundant use of of_match_ptr macro

2013-05-22 Thread Sachin Kamat
This is a DT only driver and exynos_gsc_match is always compiled
in. Hence of_match_ptr is unnecessary.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/media/platform/exynos-gsc/gsc-core.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c 
b/drivers/media/platform/exynos-gsc/gsc-core.c
index 33b5ffc..559fab2 100644
--- a/drivers/media/platform/exynos-gsc/gsc-core.c
+++ b/drivers/media/platform/exynos-gsc/gsc-core.c
@@ -988,7 +988,7 @@ static void *gsc_get_drv_data(struct platform_device *pdev)
 
if (pdev-dev.of_node) {
const struct of_device_id *match;
-   match = of_match_node(of_match_ptr(exynos_gsc_match),
+   match = of_match_node(exynos_gsc_match,
pdev-dev.of_node);
if (match)
driver_data = (struct gsc_driverdata *)match-data;
-- 
1.7.9.5

--
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 2/2] [media] s5p-mfc: Remove redundant use of of_match_ptr macro

2013-05-22 Thread Sachin Kamat
'exynos_mfc_match' is always compiled in. Hence of_match_ptr
is unnecessary.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Kamil Debski k.deb...@samsung.com
---
 drivers/media/platform/s5p-mfc/s5p_mfc.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c 
b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index 01f9ae0..5d0419b 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -1426,7 +1426,7 @@ static void *mfc_get_drv_data(struct platform_device 
*pdev)
 
if (pdev-dev.of_node) {
const struct of_device_id *match;
-   match = of_match_node(of_match_ptr(exynos_mfc_match),
+   match = of_match_node(exynos_mfc_match,
pdev-dev.of_node);
if (match)
driver_data = (struct s5p_mfc_variant *)match-data;
-- 
1.7.9.5

--
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: Warnings related to anonymous unions in s5p-tv driver

2013-05-21 Thread Sachin Kamat
On 17 May 2013 13:54, Sachin Kamat sachin.ka...@linaro.org wrote:
 Hi Hans,

 I noticed the following sparse warnings with S5P HDMI driver which I
 think got introduced due to the following commit:
 5efb54b2b7b ([media] s5p-tv: add dv_timings support for hdmi)

 Warnings:
 drivers/media/platform/s5p-tv/hdmi_drv.c:483:18: error: unknown field
 name in initializer
 drivers/media/platform/s5p-tv/hdmi_drv.c:484:18: error: unknown field
 name in initializer
 drivers/media/platform/s5p-tv/hdmi_drv.c:485:18: error: unknown field
 name in initializer
 drivers/media/platform/s5p-tv/hdmi_drv.c:486:18: error: unknown field
 name in initializer
 drivers/media/platform/s5p-tv/hdmi_drv.c:487:18: error: unknown field
 name in initializer
 drivers/media/platform/s5p-tv/hdmi_drv.c:488:18: error: unknown field
 name in initializer
 drivers/media/platform/s5p-tv/hdmi_drv.c:489:18: error: unknown field
 name in initializer
 drivers/media/platform/s5p-tv/hdmi_drv.c:490:18: error: unknown field
 name in initializer
 drivers/media/platform/s5p-tv/hdmi_drv.c:491:18: error: unknown field
 name in initializer
 drivers/media/platform/s5p-tv/hdmi_drv.c:492:18: error: unknown field
 name in initializer

 This looks like the anonymous union initialization problem with GCC.
 Surprisingly I get this with GCC 4.6, 4.7 and 4.8 as well.

 If I add additional braces to the macro V4L2_INIT_BT_TIMINGS like done
 for GCC version  4.6
 like
 { .bt = { _width , ## args } }

 or if I change the GNUC_MINOR comparison to 9 like (__GNUC_MINOR__  9)
 I dont see this error.

 I am using the Linaro GCC toolchain.

 I am not sure if this has already been reported and/or fixed.

Ping Hans..


-- 
With warm regards,
Sachin
--
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 1/2] [media] soc_camera/sh_mobile_csi2: Remove redundant platform_set_drvdata()

2013-05-20 Thread Sachin Kamat
On 13 May 2013 14:49, Sachin Kamat sachin.ka...@linaro.org wrote:
 Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
 driver is bound) removes the need to set driver data field to
 NULL.

 Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
 ---
  drivers/media/platform/soc_camera/sh_mobile_csi2.c |8 +---
  1 file changed, 1 insertion(+), 7 deletions(-)

 diff --git a/drivers/media/platform/soc_camera/sh_mobile_csi2.c 
 b/drivers/media/platform/soc_camera/sh_mobile_csi2.c
 index 09cb4fc..13a1f8f 100644
 --- a/drivers/media/platform/soc_camera/sh_mobile_csi2.c
 +++ b/drivers/media/platform/soc_camera/sh_mobile_csi2.c
 @@ -340,18 +340,13 @@ static int sh_csi2_probe(struct platform_device *pdev)
 ret = v4l2_device_register_subdev(pdata-v4l2_dev, priv-subdev);
 dev_dbg(pdev-dev, %s(%p): ret(register_subdev) = %d\n, __func__, 
 priv, ret);
 if (ret  0)
 -   goto esdreg;
 +   return ret;

 pm_runtime_enable(pdev-dev);

 dev_dbg(pdev-dev, CSI2 probed.\n);

 return 0;
 -
 -esdreg:
 -   platform_set_drvdata(pdev, NULL);
 -
 -   return ret;
  }

  static int sh_csi2_remove(struct platform_device *pdev)
 @@ -360,7 +355,6 @@ static int sh_csi2_remove(struct platform_device *pdev)

 v4l2_device_unregister_subdev(priv-subdev);
 pm_runtime_disable(pdev-dev);
 -   platform_set_drvdata(pdev, NULL);

 return 0;
  }
 --
 1.7.9.5


Ping...

-- 
With warm regards,
Sachin
--
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 1/2] [media] soc_camera/sh_mobile_csi2: Remove redundant platform_set_drvdata()

2013-05-20 Thread Sachin Kamat
On 20 May 2013 17:30, Guennadi Liakhovetski g.liakhovet...@gmx.de wrote:
 On Mon, 20 May 2013, Sachin Kamat wrote:

 On 13 May 2013 14:49, Sachin Kamat sachin.ka...@linaro.org wrote:
  Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
  driver is bound) removes the need to set driver data field to
  NULL.
 
  Signed-off-by: Sachin Kamat sachin.ka...@linaro.org

 Thanks, both queued for 3.11.


Thanks Guennadi :)

-- 
With warm regards,
Sachin
--
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


Warnings related to anonymous unions in s5p-tv driver

2013-05-17 Thread Sachin Kamat
Hi Hans,

I noticed the following sparse warnings with S5P HDMI driver which I
think got introduced due to the following commit:
5efb54b2b7b ([media] s5p-tv: add dv_timings support for hdmi)

Warnings:
drivers/media/platform/s5p-tv/hdmi_drv.c:483:18: error: unknown field
name in initializer
drivers/media/platform/s5p-tv/hdmi_drv.c:484:18: error: unknown field
name in initializer
drivers/media/platform/s5p-tv/hdmi_drv.c:485:18: error: unknown field
name in initializer
drivers/media/platform/s5p-tv/hdmi_drv.c:486:18: error: unknown field
name in initializer
drivers/media/platform/s5p-tv/hdmi_drv.c:487:18: error: unknown field
name in initializer
drivers/media/platform/s5p-tv/hdmi_drv.c:488:18: error: unknown field
name in initializer
drivers/media/platform/s5p-tv/hdmi_drv.c:489:18: error: unknown field
name in initializer
drivers/media/platform/s5p-tv/hdmi_drv.c:490:18: error: unknown field
name in initializer
drivers/media/platform/s5p-tv/hdmi_drv.c:491:18: error: unknown field
name in initializer
drivers/media/platform/s5p-tv/hdmi_drv.c:492:18: error: unknown field
name in initializer

This looks like the anonymous union initialization problem with GCC.
Surprisingly I get this with GCC 4.6, 4.7 and 4.8 as well.

If I add additional braces to the macro V4L2_INIT_BT_TIMINGS like done
for GCC version  4.6
like
{ .bt = { _width , ## args } }

or if I change the GNUC_MINOR comparison to 9 like (__GNUC_MINOR__  9)
I dont see this error.

I am using the Linaro GCC toolchain.

I am not sure if this has already been reported and/or fixed.
-- 
With warm regards,
Sachin
--
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 v4 1/2] s5p-tv: Fix incorrect usage of IS_ERR_OR_NULL in hdmi_drv.c

2013-05-16 Thread Sachin Kamat
NULL check on clocks obtained using common clock APIs should not
be done. Use IS_ERR only.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
Based on for-next branch of
git://linuxtv.org/snawrocki/samsung.git

Changes since v3:
Renamed the function and changed the prototype of {hdmi,mxr}_reset_clocks
as suggested by Sylwester.
---
 drivers/media/platform/s5p-tv/hdmi_drv.c |   23 +--
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/s5p-tv/hdmi_drv.c 
b/drivers/media/platform/s5p-tv/hdmi_drv.c
index 4e86626..cd525f1 100644
--- a/drivers/media/platform/s5p-tv/hdmi_drv.c
+++ b/drivers/media/platform/s5p-tv/hdmi_drv.c
@@ -755,6 +755,15 @@ static const struct dev_pm_ops hdmi_pm_ops = {
.runtime_resume  = hdmi_runtime_resume,
 };
 
+static void hdmi_resource_clear_clocks(struct hdmi_resources *res)
+{
+   res-hdmi= ERR_PTR(-EINVAL);
+   res-sclk_hdmi   = ERR_PTR(-EINVAL);
+   res-sclk_pixel  = ERR_PTR(-EINVAL);
+   res-sclk_hdmiphy = ERR_PTR(-EINVAL);
+   res-hdmiphy = ERR_PTR(-EINVAL);
+}
+
 static void hdmi_resources_cleanup(struct hdmi_device *hdev)
 {
struct hdmi_resources *res = hdev-res;
@@ -765,17 +774,18 @@ static void hdmi_resources_cleanup(struct hdmi_device 
*hdev)
regulator_bulk_free(res-regul_count, res-regul_bulk);
/* kfree is NULL-safe */
kfree(res-regul_bulk);
-   if (!IS_ERR_OR_NULL(res-hdmiphy))
+   if (!IS_ERR(res-hdmiphy))
clk_put(res-hdmiphy);
-   if (!IS_ERR_OR_NULL(res-sclk_hdmiphy))
+   if (!IS_ERR(res-sclk_hdmiphy))
clk_put(res-sclk_hdmiphy);
-   if (!IS_ERR_OR_NULL(res-sclk_pixel))
+   if (!IS_ERR(res-sclk_pixel))
clk_put(res-sclk_pixel);
-   if (!IS_ERR_OR_NULL(res-sclk_hdmi))
+   if (!IS_ERR(res-sclk_hdmi))
clk_put(res-sclk_hdmi);
-   if (!IS_ERR_OR_NULL(res-hdmi))
+   if (!IS_ERR(res-hdmi))
clk_put(res-hdmi);
memset(res, 0, sizeof(*res));
+   hdmi_resource_clear_clocks(res);
 }
 
 static int hdmi_resources_init(struct hdmi_device *hdev)
@@ -793,8 +803,9 @@ static int hdmi_resources_init(struct hdmi_device *hdev)
dev_dbg(dev, HDMI resource init\n);
 
memset(res, 0, sizeof(*res));
-   /* get clocks, power */
+   hdmi_resource_clear_clocks(res);
 
+   /* get clocks, power */
res-hdmi = clk_get(dev, hdmi);
if (IS_ERR(res-hdmi)) {
dev_err(dev, failed to get clock 'hdmi'\n);
-- 
1.7.9.5

--
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 v4 2/2] s5p-tv: Fix incorrect usage of IS_ERR_OR_NULL in mixer_drv.c

2013-05-16 Thread Sachin Kamat
NULL check on clocks obtained using common clock APIs should not
be done. Use IS_ERR only.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/media/platform/s5p-tv/mixer_drv.c |   24 ++--
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/s5p-tv/mixer_drv.c 
b/drivers/media/platform/s5p-tv/mixer_drv.c
index 5733033..7aeefdb 100644
--- a/drivers/media/platform/s5p-tv/mixer_drv.c
+++ b/drivers/media/platform/s5p-tv/mixer_drv.c
@@ -211,6 +211,15 @@ fail:
return ret;
 }
 
+static void mxr_resource_clear_clocks(struct mxr_resources *res)
+{
+   res-mixer  = ERR_PTR(-EINVAL);
+   res-vp = ERR_PTR(-EINVAL);
+   res-sclk_mixer = ERR_PTR(-EINVAL);
+   res-sclk_hdmi  = ERR_PTR(-EINVAL);
+   res-sclk_dac   = ERR_PTR(-EINVAL);
+}
+
 static void mxr_release_plat_resources(struct mxr_device *mdev)
 {
free_irq(mdev-res.irq, mdev);
@@ -222,15 +231,15 @@ static void mxr_release_clocks(struct mxr_device *mdev)
 {
struct mxr_resources *res = mdev-res;
 
-   if (!IS_ERR_OR_NULL(res-sclk_dac))
+   if (!IS_ERR(res-sclk_dac))
clk_put(res-sclk_dac);
-   if (!IS_ERR_OR_NULL(res-sclk_hdmi))
+   if (!IS_ERR(res-sclk_hdmi))
clk_put(res-sclk_hdmi);
-   if (!IS_ERR_OR_NULL(res-sclk_mixer))
+   if (!IS_ERR(res-sclk_mixer))
clk_put(res-sclk_mixer);
-   if (!IS_ERR_OR_NULL(res-vp))
+   if (!IS_ERR(res-vp))
clk_put(res-vp);
-   if (!IS_ERR_OR_NULL(res-mixer))
+   if (!IS_ERR(res-mixer))
clk_put(res-mixer);
 }
 
@@ -239,7 +248,9 @@ static int mxr_acquire_clocks(struct mxr_device *mdev)
struct mxr_resources *res = mdev-res;
struct device *dev = mdev-dev;
 
-   res-mixer = clk_get(dev, mixer);
+   mxr_resource_clear_clocks(res);
+
+   res-mixer  = clk_get(dev, mixer);
if (IS_ERR(res-mixer)) {
mxr_err(mdev, failed to get clock 'mixer'\n);
goto fail;
@@ -299,6 +310,7 @@ static void mxr_release_resources(struct mxr_device *mdev)
mxr_release_clocks(mdev);
mxr_release_plat_resources(mdev);
memset(mdev-res, 0, sizeof(mdev-res));
+   mxr_resource_clear_clocks(mdev-res);
 }
 
 static void mxr_release_layers(struct mxr_device *mdev)
-- 
1.7.9.5

--
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] omap3isp: Remove redundant platform_set_drvdata()

2013-05-13 Thread Sachin Kamat
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com
Cc: Sakari Ailus sakari.ai...@iki.fi
---
 drivers/media/platform/omap3isp/isp.c |2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/media/platform/omap3isp/isp.c 
b/drivers/media/platform/omap3isp/isp.c
index 1d7dbd5..4afa421 100644
--- a/drivers/media/platform/omap3isp/isp.c
+++ b/drivers/media/platform/omap3isp/isp.c
@@ -2291,8 +2291,6 @@ error_isp:
isp_xclk_cleanup(isp);
omap3isp_put(isp);
 error:
-   platform_set_drvdata(pdev, NULL);
-
mutex_destroy(isp-isp_mutex);
 
return ret;
-- 
1.7.9.5

--
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/2] [media] soc_camera/sh_mobile_csi2: Remove redundant platform_set_drvdata()

2013-05-13 Thread Sachin Kamat
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 drivers/media/platform/soc_camera/sh_mobile_csi2.c |8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/media/platform/soc_camera/sh_mobile_csi2.c 
b/drivers/media/platform/soc_camera/sh_mobile_csi2.c
index 09cb4fc..13a1f8f 100644
--- a/drivers/media/platform/soc_camera/sh_mobile_csi2.c
+++ b/drivers/media/platform/soc_camera/sh_mobile_csi2.c
@@ -340,18 +340,13 @@ static int sh_csi2_probe(struct platform_device *pdev)
ret = v4l2_device_register_subdev(pdata-v4l2_dev, priv-subdev);
dev_dbg(pdev-dev, %s(%p): ret(register_subdev) = %d\n, __func__, 
priv, ret);
if (ret  0)
-   goto esdreg;
+   return ret;
 
pm_runtime_enable(pdev-dev);
 
dev_dbg(pdev-dev, CSI2 probed.\n);
 
return 0;
-
-esdreg:
-   platform_set_drvdata(pdev, NULL);
-
-   return ret;
 }
 
 static int sh_csi2_remove(struct platform_device *pdev)
@@ -360,7 +355,6 @@ static int sh_csi2_remove(struct platform_device *pdev)
 
v4l2_device_unregister_subdev(priv-subdev);
pm_runtime_disable(pdev-dev);
-   platform_set_drvdata(pdev, NULL);
 
return 0;
 }
-- 
1.7.9.5

--
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 2/2] [media] soc_camera_platform: Remove redundant platform_set_drvdata()

2013-05-13 Thread Sachin Kamat
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
---
 .../platform/soc_camera/soc_camera_platform.c  |7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/media/platform/soc_camera/soc_camera_platform.c 
b/drivers/media/platform/soc_camera/soc_camera_platform.c
index 1b7a88c..bf0bdd0 100644
--- a/drivers/media/platform/soc_camera/soc_camera_platform.c
+++ b/drivers/media/platform/soc_camera/soc_camera_platform.c
@@ -166,14 +166,8 @@ static int soc_camera_platform_probe(struct 
platform_device *pdev)
strncpy(priv-subdev.name, dev_name(pdev-dev), V4L2_SUBDEV_NAME_SIZE);
 
ret = v4l2_device_register_subdev(ici-v4l2_dev, priv-subdev);
-   if (ret)
-   goto evdrs;
 
return ret;
-
-evdrs:
-   platform_set_drvdata(pdev, NULL);
-   return ret;
 }
 
 static int soc_camera_platform_remove(struct platform_device *pdev)
@@ -183,7 +177,6 @@ static int soc_camera_platform_remove(struct 
platform_device *pdev)
 
p-icd-control = NULL;
v4l2_device_unregister_subdev(priv-subdev);
-   platform_set_drvdata(pdev, NULL);
return 0;
 }
 
-- 
1.7.9.5

--
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/2] [media] timblogiw: Remove redundant platform_set_drvdata()

2013-05-13 Thread Sachin Kamat
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat sachin.ka...@linaro.org
Cc: Pelagicore AB i...@pelagicore.com
---
 drivers/media/platform/timblogiw.c |4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/media/platform/timblogiw.c 
b/drivers/media/platform/timblogiw.c
index a2f7bdd..99861c63 100644
--- a/drivers/media/platform/timblogiw.c
+++ b/drivers/media/platform/timblogiw.c
@@ -834,11 +834,9 @@ static int timblogiw_probe(struct platform_device *pdev)
goto err_request;
}
 
-
return 0;
 
 err_request:
-   platform_set_drvdata(pdev, NULL);
v4l2_device_unregister(lw-v4l2_dev);
 err_register:
kfree(lw);
@@ -858,8 +856,6 @@ static int timblogiw_remove(struct platform_device *pdev)
 
kfree(lw);
 
-   platform_set_drvdata(pdev, NULL);
-
return 0;
 }
 
-- 
1.7.9.5

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


  1   2   3   4   >