cron job: media_tree daily build: WARNINGS

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

Results of the daily build of media_tree:

date:   Wed May 27 04:00:14 CEST 2015
git branch: test
git hash:   2a80f296422a01178d0a993479369e94f5830127
gcc version:i686-linux-gcc (GCC) 5.1.0
sparse version: v0.5.0-44-g40791b9
smatch version: 0.4.1-3153-g7d56ab3
host hardware:  x86_64
host os:4.0.0-3.slh.1-amd64

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

Detailed results are available here:

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

Full logs are available here:

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

The Media Infrastructure API from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/media.html
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 1/2] media: atmel-isi: add runtime pm support

2015-05-26 Thread Josh Wu
The runtime pm resume/suspend will enable/disable pclk (ISI peripheral
clock).
And we need to call runtime_pm_get_sync()/runtime_pm_put() when we need
access ISI registers. In atmel_isi_probe(), remove the isi disable code
as in the moment ISI peripheral clock is not enable yet.

In the meantime, as clock_start()/clock_stop() is used to control the
mclk not ISI peripheral clock. So move this to start[stop]_streaming()
function.

Signed-off-by: Josh Wu josh...@atmel.com
---

Changes in v4:
- need to call pm_runtime_disable() in atmel_isi_remove().
- merged the patch which remove isi disable code in atmel_isi_probe() as
  isi peripherial clock is not enabled in this moment.
- refine the commit log

Changes in v3: None
Changes in v2:
- merged v1 two patch into one.
- use runtime_pm_put() instead of runtime_pm_put_sync()
- enable peripheral clock before access ISI registers.

 drivers/media/platform/soc_camera/atmel-isi.c | 54 +++
 1 file changed, 46 insertions(+), 8 deletions(-)

diff --git a/drivers/media/platform/soc_camera/atmel-isi.c 
b/drivers/media/platform/soc_camera/atmel-isi.c
index 2879026..194e875 100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -20,6 +20,7 @@
 #include linux/kernel.h
 #include linux/module.h
 #include linux/platform_device.h
+#include linux/pm_runtime.h
 #include linux/slab.h
 
 #include media/atmel-isi.h
@@ -386,6 +387,8 @@ static int start_streaming(struct vb2_queue *vq, unsigned 
int count)
struct atmel_isi *isi = ici-priv;
int ret;
 
+   pm_runtime_get_sync(ici-v4l2_dev.dev);
+
/* Reset ISI */
ret = atmel_isi_wait_status(isi, WAIT_ISI_RESET);
if (ret  0) {
@@ -445,6 +448,8 @@ static void stop_streaming(struct vb2_queue *vq)
ret = atmel_isi_wait_status(isi, WAIT_ISI_DISABLE);
if (ret  0)
dev_err(icd-parent, Disable ISI timed out\n);
+
+   pm_runtime_put(ici-v4l2_dev.dev);
 }
 
 static struct vb2_ops isi_video_qops = {
@@ -516,7 +521,13 @@ static int isi_camera_set_fmt(struct soc_camera_device 
*icd,
if (mf-code != xlate-code)
return -EINVAL;
 
+   /* Enable PM and peripheral clock before operate isi registers */
+   pm_runtime_get_sync(ici-v4l2_dev.dev);
+
ret = configure_geometry(isi, pix-width, pix-height, xlate-code);
+
+   pm_runtime_put(ici-v4l2_dev.dev);
+
if (ret  0)
return ret;
 
@@ -736,14 +747,9 @@ static int isi_camera_clock_start(struct soc_camera_host 
*ici)
struct atmel_isi *isi = ici-priv;
int ret;
 
-   ret = clk_prepare_enable(isi-pclk);
-   if (ret)
-   return ret;
-
if (!IS_ERR(isi-mck)) {
ret = clk_prepare_enable(isi-mck);
if (ret) {
-   clk_disable_unprepare(isi-pclk);
return ret;
}
}
@@ -758,7 +764,6 @@ static void isi_camera_clock_stop(struct soc_camera_host 
*ici)
 
if (!IS_ERR(isi-mck))
clk_disable_unprepare(isi-mck);
-   clk_disable_unprepare(isi-pclk);
 }
 
 static unsigned int isi_camera_poll(struct file *file, poll_table *pt)
@@ -855,9 +860,14 @@ static int isi_camera_set_bus_param(struct 
soc_camera_device *icd)
 
cfg1 |= ISI_CFG1_THMASK_BEATS_16;
 
+   /* Enable PM and peripheral clock before operate isi registers */
+   pm_runtime_get_sync(ici-v4l2_dev.dev);
+
isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS);
isi_writel(isi, ISI_CFG1, cfg1);
 
+   pm_runtime_put(ici-v4l2_dev.dev);
+
return 0;
 }
 
@@ -889,6 +899,7 @@ static int atmel_isi_remove(struct platform_device *pdev)
sizeof(struct fbd) * MAX_BUFFER_NUM,
isi-p_fb_descriptors,
isi-fb_descriptors_phys);
+   pm_runtime_disable(pdev-dev);
 
return 0;
 }
@@ -1027,8 +1038,6 @@ static int atmel_isi_probe(struct platform_device *pdev)
if (isi-pdata.data_width_flags  ISI_DATAWIDTH_10)
isi-width_flags |= 1  9;
 
-   isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS);
-
irq = platform_get_irq(pdev, 0);
if (IS_ERR_VALUE(irq)) {
ret = irq;
@@ -1049,6 +1058,9 @@ static int atmel_isi_probe(struct platform_device *pdev)
soc_host-v4l2_dev.dev  = pdev-dev;
soc_host-nr= pdev-id;
 
+   pm_suspend_ignore_children(pdev-dev, true);
+   pm_runtime_enable(pdev-dev);
+
if (isi-pdata.asd_sizes) {
soc_host-asd = isi-pdata.asd;
soc_host-asd_sizes = isi-pdata.asd_sizes;
@@ -1062,6 +1074,7 @@ static int atmel_isi_probe(struct platform_device *pdev)
return 0;
 
 err_register_soc_camera_host:
+   pm_runtime_disable(pdev-dev);
 err_req_irq:
 err_ioremap:
vb2_dma_contig_cleanup_ctx(isi-alloc_ctx);
@@ -1074,6 +1087,30 @@ err_alloc_ctx:
return ret;
 }
 

[PATCH v4 2/2] media: atmel-isi: remove mck back compatiable code as it's not need

2015-05-26 Thread Josh Wu
The master clock should handled by sensor itself.

Signed-off-by: Josh Wu josh...@atmel.com
Acked-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
---

Changes in v4: None
Changes in v3:
- remove useless definition: ISI_DEFAULT_MCLK_FREQ

Changes in v2:
- totally remove clock_start()/clock_stop() as they are optional.

 drivers/media/platform/soc_camera/atmel-isi.c | 46 ---
 1 file changed, 46 deletions(-)

diff --git a/drivers/media/platform/soc_camera/atmel-isi.c 
b/drivers/media/platform/soc_camera/atmel-isi.c
index 194e875..65d9bc4 100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -35,7 +35,6 @@
 #define VID_LIMIT_BYTES(16 * 1024 * 1024)
 #define MIN_FRAME_RATE 15
 #define FRAME_INTERVAL_MILLI_SEC   (1000 / MIN_FRAME_RATE)
-#define ISI_DEFAULT_MCLK_FREQ  2500
 
 /* Frame buffer descriptor */
 struct fbd {
@@ -83,8 +82,6 @@ struct atmel_isi {
struct completion   complete;
/* ISI peripherial clock */
struct clk  *pclk;
-   /* ISI_MCK, feed to camera sensor to generate pixel clock */
-   struct clk  *mck;
unsigned intirq;
 
struct isi_platform_datapdata;
@@ -741,31 +738,6 @@ static void isi_camera_remove_device(struct 
soc_camera_device *icd)
 icd-devnum);
 }
 
-/* Called with .host_lock held */
-static int isi_camera_clock_start(struct soc_camera_host *ici)
-{
-   struct atmel_isi *isi = ici-priv;
-   int ret;
-
-   if (!IS_ERR(isi-mck)) {
-   ret = clk_prepare_enable(isi-mck);
-   if (ret) {
-   return ret;
-   }
-   }
-
-   return 0;
-}
-
-/* Called with .host_lock held */
-static void isi_camera_clock_stop(struct soc_camera_host *ici)
-{
-   struct atmel_isi *isi = ici-priv;
-
-   if (!IS_ERR(isi-mck))
-   clk_disable_unprepare(isi-mck);
-}
-
 static unsigned int isi_camera_poll(struct file *file, poll_table *pt)
 {
struct soc_camera_device *icd = file-private_data;
@@ -875,8 +847,6 @@ static struct soc_camera_host_ops isi_soc_camera_host_ops = 
{
.owner  = THIS_MODULE,
.add= isi_camera_add_device,
.remove = isi_camera_remove_device,
-   .clock_start= isi_camera_clock_start,
-   .clock_stop = isi_camera_clock_stop,
.set_fmt= isi_camera_set_fmt,
.try_fmt= isi_camera_try_fmt,
.get_formats= isi_camera_get_formats,
@@ -913,7 +883,6 @@ static int atmel_isi_probe_dt(struct atmel_isi *isi,
 
/* Default settings for ISI */
isi-pdata.full_mode = 1;
-   isi-pdata.mck_hz = ISI_DEFAULT_MCLK_FREQ;
isi-pdata.frate = ISI_CFG1_FRATE_CAPTURE_ALL;
 
np = of_graph_get_next_endpoint(np, NULL);
@@ -989,21 +958,6 @@ static int atmel_isi_probe(struct platform_device *pdev)
INIT_LIST_HEAD(isi-video_buffer_list);
INIT_LIST_HEAD(isi-dma_desc_head);
 
-   /* ISI_MCK is the sensor master clock. It should be handled by the
-* sensor driver directly, as the ISI has no use for that clock. Make
-* the clock optional here while platforms transition to the correct
-* model.
-*/
-   isi-mck = devm_clk_get(dev, isi_mck);
-   if (!IS_ERR(isi-mck)) {
-   /* Set ISI_MCK's frequency, it should be faster than pixel
-* clock.
-*/
-   ret = clk_set_rate(isi-mck, isi-pdata.mck_hz);
-   if (ret  0)
-   return ret;
-   }
-
isi-p_fb_descriptors = dma_alloc_coherent(pdev-dev,
sizeof(struct fbd) * MAX_BUFFER_NUM,
isi-fb_descriptors_phys,
-- 
1.9.1

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


[PATCH v4 0/2] media: atmel-isi: rework on the clock part and add runtime pm support

2015-05-26 Thread Josh Wu
This patch series fix the peripheral clock code and enable runtime pm
support.
Also it clean up the code which is for the compatiblity of mck.

Changes in v4:
- need to call pm_runtime_disable() in atmel_isi_remove().
- merged the patch which remove isi disable code in atmel_isi_probe() as
  isi peripherial clock is not enabled in this moment.
- refine the commit log

Changes in v3:
- remove useless definition: ISI_DEFAULT_MCLK_FREQ
- remove some isi disable code if peripheral clock is disabled.

Changes in v2:
- merged v1 two patch into one.
- use runtime_pm_put() instead of runtime_pm_put_sync()
- enable peripheral clock before access ISI registers.
- totally remove clock_start()/clock_stop() as they are optional.

Josh Wu (2):
  media: atmel-isi: add runtime pm support
  media: atmel-isi: remove mck back compatiable code as it's not need

 drivers/media/platform/soc_camera/atmel-isi.c | 100 --
 1 file changed, 46 insertions(+), 54 deletions(-)

-- 
1.9.1

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


Re: [PATCH v4 1/2] media: atmel-isi: add runtime pm support

2015-05-26 Thread Laurent Pinchart
Hi Josh,

Thank you for the patch.

On Tuesday 26 May 2015 16:00:09 Josh Wu wrote:
 The runtime pm resume/suspend will enable/disable pclk (ISI peripheral
 clock).
 And we need to call runtime_pm_get_sync()/runtime_pm_put() when we need
 access ISI registers. In atmel_isi_probe(), remove the isi disable code
 as in the moment ISI peripheral clock is not enable yet.
 
 In the meantime, as clock_start()/clock_stop() is used to control the
 mclk not ISI peripheral clock. So move this to start[stop]_streaming()
 function.
 
 Signed-off-by: Josh Wu josh...@atmel.com
 ---
 
 Changes in v4:
 - need to call pm_runtime_disable() in atmel_isi_remove().
 - merged the patch which remove isi disable code in atmel_isi_probe() as
   isi peripherial clock is not enabled in this moment.
 - refine the commit log
 
 Changes in v3: None
 Changes in v2:
 - merged v1 two patch into one.
 - use runtime_pm_put() instead of runtime_pm_put_sync()
 - enable peripheral clock before access ISI registers.
 
  drivers/media/platform/soc_camera/atmel-isi.c | 54 
  1 file changed, 46 insertions(+), 8 deletions(-)
 
 diff --git a/drivers/media/platform/soc_camera/atmel-isi.c
 b/drivers/media/platform/soc_camera/atmel-isi.c index 2879026..194e875
 100644
 --- a/drivers/media/platform/soc_camera/atmel-isi.c
 +++ b/drivers/media/platform/soc_camera/atmel-isi.c
 @@ -20,6 +20,7 @@
  #include linux/kernel.h
  #include linux/module.h
  #include linux/platform_device.h
 +#include linux/pm_runtime.h
  #include linux/slab.h
 
  #include media/atmel-isi.h
 @@ -386,6 +387,8 @@ static int start_streaming(struct vb2_queue *vq,
 unsigned int count) struct atmel_isi *isi = ici-priv;
   int ret;
 
 + pm_runtime_get_sync(ici-v4l2_dev.dev);
 +
   /* Reset ISI */
   ret = atmel_isi_wait_status(isi, WAIT_ISI_RESET);
   if (ret  0) {

You need to call pm_runtime_put() in the error path, otherwise an 
atmel_isi_wait_status() failure will keep the device enabled.

 @@ -445,6 +448,8 @@ static void stop_streaming(struct vb2_queue *vq)
   ret = atmel_isi_wait_status(isi, WAIT_ISI_DISABLE);
   if (ret  0)
   dev_err(icd-parent, Disable ISI timed out\n);
 +
 + pm_runtime_put(ici-v4l2_dev.dev);
  }
 
  static struct vb2_ops isi_video_qops = {
 @@ -516,7 +521,13 @@ static int isi_camera_set_fmt(struct soc_camera_device
 *icd, if (mf-code != xlate-code)
   return -EINVAL;
 
 + /* Enable PM and peripheral clock before operate isi registers */
 + pm_runtime_get_sync(ici-v4l2_dev.dev);
 +
   ret = configure_geometry(isi, pix-width, pix-height, xlate-code);
 +
 + pm_runtime_put(ici-v4l2_dev.dev);

I think it would simplify the code to move the configure_geometry() call to 
start_streaming() as you already call pm_runtime_get_sync() there. That can be 
done in a separate patch though.

 +
   if (ret  0)
   return ret;
 
 @@ -736,14 +747,9 @@ static int isi_camera_clock_start(struct
 soc_camera_host *ici) struct atmel_isi *isi = ici-priv;
   int ret;
 
 - ret = clk_prepare_enable(isi-pclk);
 - if (ret)
 - return ret;
 -
   if (!IS_ERR(isi-mck)) {
   ret = clk_prepare_enable(isi-mck);
   if (ret) {
 - clk_disable_unprepare(isi-pclk);
   return ret;
   }
   }
 @@ -758,7 +764,6 @@ static void isi_camera_clock_stop(struct soc_camera_host
 *ici)
 
   if (!IS_ERR(isi-mck))
   clk_disable_unprepare(isi-mck);
 - clk_disable_unprepare(isi-pclk);
  }
 
  static unsigned int isi_camera_poll(struct file *file, poll_table *pt)
 @@ -855,9 +860,14 @@ static int isi_camera_set_bus_param(struct
 soc_camera_device *icd)
 
   cfg1 |= ISI_CFG1_THMASK_BEATS_16;
 
 + /* Enable PM and peripheral clock before operate isi registers */
 + pm_runtime_get_sync(ici-v4l2_dev.dev);
 +
   isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS);
   isi_writel(isi, ISI_CFG1, cfg1);
 
 + pm_runtime_put(ici-v4l2_dev.dev);
 +
   return 0;
  }
 
 @@ -889,6 +899,7 @@ static int atmel_isi_remove(struct platform_device
 *pdev) sizeof(struct fbd) * MAX_BUFFER_NUM,
   isi-p_fb_descriptors,
   isi-fb_descriptors_phys);
 + pm_runtime_disable(pdev-dev);
 
   return 0;
  }
 @@ -1027,8 +1038,6 @@ static int atmel_isi_probe(struct platform_device
 *pdev) if (isi-pdata.data_width_flags  ISI_DATAWIDTH_10)
   isi-width_flags |= 1  9;
 
 - isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS);
 -
   irq = platform_get_irq(pdev, 0);
   if (IS_ERR_VALUE(irq)) {
   ret = irq;
 @@ -1049,6 +1058,9 @@ static int atmel_isi_probe(struct platform_device
 *pdev) soc_host-v4l2_dev.dev = pdev-dev;
   soc_host-nr= pdev-id;
 
 + pm_suspend_ignore_children(pdev-dev, true);
 + pm_runtime_enable(pdev-dev);
 +
   if (isi-pdata.asd_sizes) {
   soc_host-asd = isi-pdata.asd;
   

[PATCH] staging: media: omap4iss: Reformat overly long lines

2015-05-26 Thread Piotr S. Staszewski
This reformats lines that were previously above 80 characters long,
improving readability and making checkpatch.pl happy.

Signed-off-by: Piotr S. Staszewski p.staszew...@gmail.com
---
 drivers/staging/media/omap4iss/iss_csi2.c| 21 ---
 drivers/staging/media/omap4iss/iss_ipipe.c   | 30 ++--
 drivers/staging/media/omap4iss/iss_ipipeif.c | 10 ++
 drivers/staging/media/omap4iss/iss_resizer.c |  8 +---
 4 files changed, 44 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/media/omap4iss/iss_csi2.c 
b/drivers/staging/media/omap4iss/iss_csi2.c
index d7ff769..a8714bb 100644
--- a/drivers/staging/media/omap4iss/iss_csi2.c
+++ b/drivers/staging/media/omap4iss/iss_csi2.c
@@ -224,7 +224,8 @@ static u16 csi2_ctx_map_format(struct iss_csi2_device *csi2)
fmtidx = 3;
break;
default:
-   WARN(1, KERN_ERR CSI2: pixel format %08x unsupported!\n,
+   WARN(1,
+KERN_ERR CSI2: pixel format %08x unsupported!\n,
 fmt-code);
return 0;
}
@@ -828,8 +829,10 @@ static const struct iss_video_operations csi2_issvideo_ops 
= {
  */
 
 static struct v4l2_mbus_framefmt *
-__csi2_get_format(struct iss_csi2_device *csi2, struct v4l2_subdev_pad_config 
*cfg,
- unsigned int pad, enum v4l2_subdev_format_whence which)
+__csi2_get_format(struct iss_csi2_device *csi2,
+ struct v4l2_subdev_pad_config *cfg,
+ unsigned int pad,
+ enum v4l2_subdev_format_whence which)
 {
if (which == V4L2_SUBDEV_FORMAT_TRY)
return v4l2_subdev_get_try_format(csi2-subdev, cfg, pad);
@@ -838,8 +841,10 @@ __csi2_get_format(struct iss_csi2_device *csi2, struct 
v4l2_subdev_pad_config *c
 }
 
 static void
-csi2_try_format(struct iss_csi2_device *csi2, struct v4l2_subdev_pad_config 
*cfg,
-   unsigned int pad, struct v4l2_mbus_framefmt *fmt,
+csi2_try_format(struct iss_csi2_device *csi2,
+   struct v4l2_subdev_pad_config *cfg,
+   unsigned int pad,
+   struct v4l2_mbus_framefmt *fmt,
enum v4l2_subdev_format_whence which)
 {
u32 pixelcode;
@@ -967,7 +972,8 @@ static int csi2_enum_frame_size(struct v4l2_subdev *sd,
  * @fmt: pointer to v4l2 subdev format structure
  * return -EINVAL or zero on success
  */
-static int csi2_get_format(struct v4l2_subdev *sd, struct 
v4l2_subdev_pad_config *cfg,
+static int csi2_get_format(struct v4l2_subdev *sd,
+  struct v4l2_subdev_pad_config *cfg,
   struct v4l2_subdev_format *fmt)
 {
struct iss_csi2_device *csi2 = v4l2_get_subdevdata(sd);
@@ -988,7 +994,8 @@ static int csi2_get_format(struct v4l2_subdev *sd, struct 
v4l2_subdev_pad_config
  * @fmt: pointer to v4l2 subdev format structure
  * return -EINVAL or zero on success
  */
-static int csi2_set_format(struct v4l2_subdev *sd, struct 
v4l2_subdev_pad_config *cfg,
+static int csi2_set_format(struct v4l2_subdev *sd,
+  struct v4l2_subdev_pad_config *cfg,
   struct v4l2_subdev_format *fmt)
 {
struct iss_csi2_device *csi2 = v4l2_get_subdevdata(sd);
diff --git a/drivers/staging/media/omap4iss/iss_ipipe.c 
b/drivers/staging/media/omap4iss/iss_ipipe.c
index eaa82da..f94a592 100644
--- a/drivers/staging/media/omap4iss/iss_ipipe.c
+++ b/drivers/staging/media/omap4iss/iss_ipipe.c
@@ -24,8 +24,10 @@
 #include iss_ipipe.h
 
 static struct v4l2_mbus_framefmt *
-__ipipe_get_format(struct iss_ipipe_device *ipipe, struct 
v4l2_subdev_pad_config *cfg,
- unsigned int pad, enum v4l2_subdev_format_whence which);
+__ipipe_get_format(struct iss_ipipe_device *ipipe,
+  struct v4l2_subdev_pad_config *cfg,
+  unsigned int pad,
+  enum v4l2_subdev_format_whence which);
 
 static const unsigned int ipipe_fmts[] = {
MEDIA_BUS_FMT_SGRBG10_1X10,
@@ -176,8 +178,10 @@ static int ipipe_set_stream(struct v4l2_subdev *sd, int 
enable)
 }
 
 static struct v4l2_mbus_framefmt *
-__ipipe_get_format(struct iss_ipipe_device *ipipe, struct 
v4l2_subdev_pad_config *cfg,
- unsigned int pad, enum v4l2_subdev_format_whence which)
+__ipipe_get_format(struct iss_ipipe_device *ipipe,
+  struct v4l2_subdev_pad_config *cfg,
+  unsigned int pad,
+  enum v4l2_subdev_format_whence which)
 {
if (which == V4L2_SUBDEV_FORMAT_TRY)
return v4l2_subdev_get_try_format(ipipe-subdev, cfg, pad);
@@ -193,9 +197,11 @@ __ipipe_get_format(struct iss_ipipe_device *ipipe, struct 
v4l2_subdev_pad_config
  * @fmt: Format
  */
 static void
-ipipe_try_format(struct iss_ipipe_device *ipipe, struct v4l2_subdev_pad_config 
*cfg,
-   unsigned int pad, struct v4l2_mbus_framefmt *fmt,
-   enum v4l2_subdev_format_whence which)

Re: dvb_usb_af9015: command failed=1 _ kernel = 4.1.x

2015-05-26 Thread poma

If it is not taken into account the already known problem of unreliable 
operation of the first tuner of the two,
the device works reliably within kernel 4.0.4 with mxl5007t.ko reverted to
http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/drivers/media/tuners/mxl5007t.c?id=ccae7af
that is in the same state as is in the longterm kernel - 3.18.14,
which is in correspondence with the aforementioned results.


--
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/4] cx24120: Take control of b2c2 receive stream

2015-05-26 Thread Jemma Denson

Hi Patrick,

On 26/05/15 10:05, Patrick Boettcher wrote:

Now that b2c2 has an option to allow us to do so, turn off the
flexcop receive stream when we turn off mpeg output whilst tuning.

Does this not fix (and your '[PATCH 2/4]') the problem of receiving
PAT from the previously tuned transport-stream?

Then patch 1 and 4 should not be necessary, should they?!


Only patch 1 fixes that problem, so out of the 4 here that one is the 
most necessary. Controlling the flexcop receive stream and/or stopping 
the cx24120 from sending doesn't actually appear to do much of anything 
- it doesn't seem any better or worse doing one or the other, both or 
even neither! (Apart from Patch 4 breaking things, as mentioned).


I'm including it though because I presume the reference driver advised 
it was done, and it does tidy up the cx24120 codebase considerably by 
being able to disable the whole turn off sending the stream whilst 
tuning feature - I'm envisioning that in the future someone might want 
to take on the task of merging cx24117  cx24120 as they're quite 
similar, and allowing what seems to just be a flexcop oddity to be 
turned off would make this possible.



Jemma.
--
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 v5 1/3] media: atmel-isi: disable ISI even it has codec request in stop_streaming()

2015-05-26 Thread Josh Wu
In current code, stop_streaming() will just return if ISI is still
working in the codec. But this is incorrect, we need to disable ISI even
it is working on the codec. otherwise stop_streaming() will not work as
we expected.

Signed-off-by: Josh Wu josh...@atmel.com
---

Changes in v5:
- add new patch to fix the condition that codec request still in work.

Changes in v4: None
Changes in v3: None
Changes in v2: None

 drivers/media/platform/soc_camera/atmel-isi.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/media/platform/soc_camera/atmel-isi.c 
b/drivers/media/platform/soc_camera/atmel-isi.c
index 2879026..2227022 100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -431,11 +431,9 @@ static void stop_streaming(struct vb2_queue *vq)
time_before(jiffies, timeout))
msleep(1);
 
-   if (time_after(jiffies, timeout)) {
+   if (time_after(jiffies, timeout))
dev_err(icd-parent,
Timeout waiting for finishing codec request\n);
-   return;
-   }
 
/* Disable interrupts */
isi_writel(isi, ISI_INTDIS,
-- 
1.9.1

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


Re: [PATCH 07/20] media: soc_camera: rcar_vin: Add BT.709 24-bit RGB888 input support

2015-05-26 Thread William Towle

On Mon, 25 May 2015, Guennadi Liakhovetski wrote:

How about this version of this patch:

https://patchwork.linuxtv.org/patch/28098/

? I personally like that one better, it seems clearer to me. This one
first sets a bit to vnmp, then make another check and inverts it, whereas
that version clearly sets it just for equal colour-spaces. I just never
got with proper Sob and (maybe?) authorship.


Hi Guennadi,
  Thanks for noticing - we reverted this patch to the version
previously indicated in testing and it didn't get set back.

  We have a test branch for the next version, and I shall attend to
this and the other authorship comments you made immediately.

Thanks,
  Wills.
--
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 v4 1/2] media: atmel-isi: add runtime pm support

2015-05-26 Thread Josh Wu

Hi, Laurent

On 5/26/2015 4:16 PM, Laurent Pinchart wrote:

Hi Josh,

Thank you for the patch.

On Tuesday 26 May 2015 16:00:09 Josh Wu wrote:

The runtime pm resume/suspend will enable/disable pclk (ISI peripheral
clock).
And we need to call runtime_pm_get_sync()/runtime_pm_put() when we need
access ISI registers. In atmel_isi_probe(), remove the isi disable code
as in the moment ISI peripheral clock is not enable yet.

In the meantime, as clock_start()/clock_stop() is used to control the
mclk not ISI peripheral clock. So move this to start[stop]_streaming()
function.

Signed-off-by: Josh Wu josh...@atmel.com
---

Changes in v4:
- need to call pm_runtime_disable() in atmel_isi_remove().
- merged the patch which remove isi disable code in atmel_isi_probe() as
   isi peripherial clock is not enabled in this moment.
- refine the commit log

Changes in v3: None
Changes in v2:
- merged v1 two patch into one.
- use runtime_pm_put() instead of runtime_pm_put_sync()
- enable peripheral clock before access ISI registers.

  drivers/media/platform/soc_camera/atmel-isi.c | 54 
  1 file changed, 46 insertions(+), 8 deletions(-)

diff --git a/drivers/media/platform/soc_camera/atmel-isi.c
b/drivers/media/platform/soc_camera/atmel-isi.c index 2879026..194e875
100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -20,6 +20,7 @@
  #include linux/kernel.h
  #include linux/module.h
  #include linux/platform_device.h
+#include linux/pm_runtime.h
  #include linux/slab.h

  #include media/atmel-isi.h
@@ -386,6 +387,8 @@ static int start_streaming(struct vb2_queue *vq,
unsigned int count) struct atmel_isi *isi = ici-priv;
int ret;

+   pm_runtime_get_sync(ici-v4l2_dev.dev);
+
/* Reset ISI */
ret = atmel_isi_wait_status(isi, WAIT_ISI_RESET);
if (ret  0) {

You need to call pm_runtime_put() in the error path, otherwise an
atmel_isi_wait_status() failure will keep the device enabled.


Nice catch. Thanks.




@@ -445,6 +448,8 @@ static void stop_streaming(struct vb2_queue *vq)
ret = atmel_isi_wait_status(isi, WAIT_ISI_DISABLE);
if (ret  0)
dev_err(icd-parent, Disable ISI timed out\n);
+
+   pm_runtime_put(ici-v4l2_dev.dev);
  }

  static struct vb2_ops isi_video_qops = {
@@ -516,7 +521,13 @@ static int isi_camera_set_fmt(struct soc_camera_device
*icd, if (mf-code != xlate-code)
return -EINVAL;

+   /* Enable PM and peripheral clock before operate isi registers */
+   pm_runtime_get_sync(ici-v4l2_dev.dev);
+
ret = configure_geometry(isi, pix-width, pix-height, xlate-code);
+
+   pm_runtime_put(ici-v4l2_dev.dev);

I think it would simplify the code to move the configure_geometry() call to
start_streaming() as you already call pm_runtime_get_sync() there. That can be
done in a separate patch though.


I think it's a good idea. I would like to make this in a separate patch 
and not include in this series.


In summary, I'll resend this patch just with the fix you mentioned in 
above (fix the error path in start_streaming).

Is that okay for you?

Best Regards,
Josh Wu




+
if (ret  0)
return ret;

@@ -736,14 +747,9 @@ static int isi_camera_clock_start(struct
soc_camera_host *ici) struct atmel_isi *isi = ici-priv;
int ret;

-   ret = clk_prepare_enable(isi-pclk);
-   if (ret)
-   return ret;
-
if (!IS_ERR(isi-mck)) {
ret = clk_prepare_enable(isi-mck);
if (ret) {
-   clk_disable_unprepare(isi-pclk);
return ret;
}
}
@@ -758,7 +764,6 @@ static void isi_camera_clock_stop(struct soc_camera_host
*ici)

if (!IS_ERR(isi-mck))
clk_disable_unprepare(isi-mck);
-   clk_disable_unprepare(isi-pclk);
  }

  static unsigned int isi_camera_poll(struct file *file, poll_table *pt)
@@ -855,9 +860,14 @@ static int isi_camera_set_bus_param(struct
soc_camera_device *icd)

cfg1 |= ISI_CFG1_THMASK_BEATS_16;

+   /* Enable PM and peripheral clock before operate isi registers */
+   pm_runtime_get_sync(ici-v4l2_dev.dev);
+
isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS);
isi_writel(isi, ISI_CFG1, cfg1);

+   pm_runtime_put(ici-v4l2_dev.dev);
+
return 0;
  }

@@ -889,6 +899,7 @@ static int atmel_isi_remove(struct platform_device
*pdev) sizeof(struct fbd) * MAX_BUFFER_NUM,
isi-p_fb_descriptors,
isi-fb_descriptors_phys);
+   pm_runtime_disable(pdev-dev);

return 0;
  }
@@ -1027,8 +1038,6 @@ static int atmel_isi_probe(struct platform_device
*pdev) if (isi-pdata.data_width_flags  ISI_DATAWIDTH_10)
isi-width_flags |= 1  9;

-   isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS);
-
irq = platform_get_irq(pdev, 0);
if (IS_ERR_VALUE(irq)) {
ret = irq;
@@ 

[PATCH v5 3/3] media: atmel-isi: remove mck back compatiable code as it's not need

2015-05-26 Thread Josh Wu
The master clock should handled by sensor itself.

Signed-off-by: Josh Wu josh...@atmel.com
Acked-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
---

Changes in v5: None
Changes in v4: None
Changes in v3:
- remove useless definition: ISI_DEFAULT_MCLK_FREQ

Changes in v2:
- totally remove clock_start()/clock_stop() as they are optional.

 drivers/media/platform/soc_camera/atmel-isi.c | 46 ---
 1 file changed, 46 deletions(-)

diff --git a/drivers/media/platform/soc_camera/atmel-isi.c 
b/drivers/media/platform/soc_camera/atmel-isi.c
index 0ea360a..9070172 100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -35,7 +35,6 @@
 #define VID_LIMIT_BYTES(16 * 1024 * 1024)
 #define MIN_FRAME_RATE 15
 #define FRAME_INTERVAL_MILLI_SEC   (1000 / MIN_FRAME_RATE)
-#define ISI_DEFAULT_MCLK_FREQ  2500
 
 /* Frame buffer descriptor */
 struct fbd {
@@ -83,8 +82,6 @@ struct atmel_isi {
struct completion   complete;
/* ISI peripherial clock */
struct clk  *pclk;
-   /* ISI_MCK, feed to camera sensor to generate pixel clock */
-   struct clk  *mck;
unsigned intirq;
 
struct isi_platform_datapdata;
@@ -740,31 +737,6 @@ static void isi_camera_remove_device(struct 
soc_camera_device *icd)
 icd-devnum);
 }
 
-/* Called with .host_lock held */
-static int isi_camera_clock_start(struct soc_camera_host *ici)
-{
-   struct atmel_isi *isi = ici-priv;
-   int ret;
-
-   if (!IS_ERR(isi-mck)) {
-   ret = clk_prepare_enable(isi-mck);
-   if (ret) {
-   return ret;
-   }
-   }
-
-   return 0;
-}
-
-/* Called with .host_lock held */
-static void isi_camera_clock_stop(struct soc_camera_host *ici)
-{
-   struct atmel_isi *isi = ici-priv;
-
-   if (!IS_ERR(isi-mck))
-   clk_disable_unprepare(isi-mck);
-}
-
 static unsigned int isi_camera_poll(struct file *file, poll_table *pt)
 {
struct soc_camera_device *icd = file-private_data;
@@ -874,8 +846,6 @@ static struct soc_camera_host_ops isi_soc_camera_host_ops = 
{
.owner  = THIS_MODULE,
.add= isi_camera_add_device,
.remove = isi_camera_remove_device,
-   .clock_start= isi_camera_clock_start,
-   .clock_stop = isi_camera_clock_stop,
.set_fmt= isi_camera_set_fmt,
.try_fmt= isi_camera_try_fmt,
.get_formats= isi_camera_get_formats,
@@ -912,7 +882,6 @@ static int atmel_isi_probe_dt(struct atmel_isi *isi,
 
/* Default settings for ISI */
isi-pdata.full_mode = 1;
-   isi-pdata.mck_hz = ISI_DEFAULT_MCLK_FREQ;
isi-pdata.frate = ISI_CFG1_FRATE_CAPTURE_ALL;
 
np = of_graph_get_next_endpoint(np, NULL);
@@ -988,21 +957,6 @@ static int atmel_isi_probe(struct platform_device *pdev)
INIT_LIST_HEAD(isi-video_buffer_list);
INIT_LIST_HEAD(isi-dma_desc_head);
 
-   /* ISI_MCK is the sensor master clock. It should be handled by the
-* sensor driver directly, as the ISI has no use for that clock. Make
-* the clock optional here while platforms transition to the correct
-* model.
-*/
-   isi-mck = devm_clk_get(dev, isi_mck);
-   if (!IS_ERR(isi-mck)) {
-   /* Set ISI_MCK's frequency, it should be faster than pixel
-* clock.
-*/
-   ret = clk_set_rate(isi-mck, isi-pdata.mck_hz);
-   if (ret  0)
-   return ret;
-   }
-
isi-p_fb_descriptors = dma_alloc_coherent(pdev-dev,
sizeof(struct fbd) * MAX_BUFFER_NUM,
isi-fb_descriptors_phys,
-- 
1.9.1

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


Re: [PATCHv3 1/4] phy: phy-core: Make GENERIC_PHY an invisible option

2015-05-26 Thread Felipe Balbi
On Tue, May 26, 2015 at 11:37:17AM -0700, Arun Ramamurthy wrote:
 Hi
 
 On 15-05-26 07:19 AM, Felipe Balbi wrote:
 HI,
 
 On Mon, May 25, 2015 at 02:19:58PM -0700, Arun Ramamurthy wrote:
 
 
 On 15-05-14 05:52 PM, Felipe Balbi wrote:
 Hi,
 
 On Wed, Apr 22, 2015 at 04:04:10PM -0700, Arun Ramamurthy wrote:
 Most of the phy providers use select to enable GENERIC_PHY. Since select
 is only recommended when the config is not visible, GENERIC_PHY is changed
 an invisible option. To maintain consistency, all phy providers are 
 changed
 to select GENERIC_PHY and all non-phy drivers use depends on when the
 phy framework is explicity required. USB_MUSB_OMAP2PLUS has a cyclic
 dependency, so it is left as select.
 
 Signed-off-by: Arun Ramamurthy arun.ramamur...@broadcom.com
 ---
   drivers/ata/Kconfig   | 1 -
   drivers/media/platform/exynos4-is/Kconfig | 2 +-
   drivers/phy/Kconfig   | 4 ++--
   drivers/usb/host/Kconfig  | 4 ++--
   drivers/video/fbdev/exynos/Kconfig| 2 +-
   5 files changed, 6 insertions(+), 7 deletions(-)
 
 diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
 index 5f60155..6d2e881 100644
 --- a/drivers/ata/Kconfig
 +++ b/drivers/ata/Kconfig
 @@ -301,7 +301,6 @@ config SATA_MV
   tristate Marvell SATA support
   depends on PCI || ARCH_DOVE || ARCH_MV78XX0 || \
  ARCH_MVEBU || ARCH_ORION5X || COMPILE_TEST
 - select GENERIC_PHY
   help
 This option enables support for the Marvell Serial ATA family.
 Currently supports 88SX[56]0[48][01] PCI(-X) chips,
 diff --git a/drivers/media/platform/exynos4-is/Kconfig 
 b/drivers/media/platform/exynos4-is/Kconfig
 index b7b2e47..b6f3eaa 100644
 --- a/drivers/media/platform/exynos4-is/Kconfig
 +++ b/drivers/media/platform/exynos4-is/Kconfig
 @@ -31,7 +31,7 @@ config VIDEO_S5P_FIMC
   config VIDEO_S5P_MIPI_CSIS
   tristate S5P/EXYNOS MIPI-CSI2 receiver (MIPI-CSIS) driver
   depends on REGULATOR
 - select GENERIC_PHY
 + depends on GENERIC_PHY
   help
 This is a V4L2 driver for Samsung S5P and EXYNOS4 SoC 
  MIPI-CSI2
 receiver (MIPI-CSIS) devices.
 diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
 index 2962de2..edecdb1 100644
 --- a/drivers/phy/Kconfig
 +++ b/drivers/phy/Kconfig
 @@ -5,7 +5,7 @@
   menu PHY Subsystem
 
   config GENERIC_PHY
 - bool PHY Core
 + bool
   help
 Generic PHY support.
 
 @@ -72,7 +72,7 @@ config PHY_MIPHY365X
   config PHY_RCAR_GEN2
   tristate Renesas R-Car generation 2 USB PHY driver
   depends on ARCH_SHMOBILE
 - depends on GENERIC_PHY
 + select GENERIC_PHY
 
 so some you changed from depends to select...
 
   help
 Support for USB PHY found on Renesas R-Car generation 2 SoCs.
 
 diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
 index 5ad60e4..e2197e2 100644
 --- a/drivers/usb/host/Kconfig
 +++ b/drivers/usb/host/Kconfig
 @@ -182,7 +182,7 @@ config USB_EHCI_HCD_SPEAR
   config USB_EHCI_HCD_STI
   tristate Support for ST STiHxxx on-chip EHCI USB controller
   depends on ARCH_STI  OF
 - select GENERIC_PHY
 + depends on GENERIC_PHY
 
 while others you changed from select to depends.
 
 NAK.
 
 Felipe, I dont understand your concern, could you please explain it more
 detail?  The logic behind the changes is that in cases where there was an
 explicit dependency, I changed it to depends on and in other cases I
 changed it to selects. Thanks
 
 Since GENERIC_PHY is visible from Kconfig, it would be much nicer to
 avoid select altogether.
 
 Felipe, after discussion with the maintainers, I have made GENERIC_PHY an
 invisible option as part of this change. Thanks

Then, if the option is invisible, how can you depend on it ? It can
never be selected by poking around in Kconfig. IMO, it's
counterintuitive that you need to enable a PHY driver before you can see
your EHCI/OHCI/whatever controller listed in Kconfig.

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCHv3 1/4] phy: phy-core: Make GENERIC_PHY an invisible option

2015-05-26 Thread Arun Ramamurthy

Hi

On 15-05-26 07:19 AM, Felipe Balbi wrote:

HI,

On Mon, May 25, 2015 at 02:19:58PM -0700, Arun Ramamurthy wrote:



On 15-05-14 05:52 PM, Felipe Balbi wrote:

Hi,

On Wed, Apr 22, 2015 at 04:04:10PM -0700, Arun Ramamurthy wrote:

Most of the phy providers use select to enable GENERIC_PHY. Since select
is only recommended when the config is not visible, GENERIC_PHY is changed
an invisible option. To maintain consistency, all phy providers are changed
to select GENERIC_PHY and all non-phy drivers use depends on when the
phy framework is explicity required. USB_MUSB_OMAP2PLUS has a cyclic
dependency, so it is left as select.

Signed-off-by: Arun Ramamurthy arun.ramamur...@broadcom.com
---
  drivers/ata/Kconfig   | 1 -
  drivers/media/platform/exynos4-is/Kconfig | 2 +-
  drivers/phy/Kconfig   | 4 ++--
  drivers/usb/host/Kconfig  | 4 ++--
  drivers/video/fbdev/exynos/Kconfig| 2 +-
  5 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 5f60155..6d2e881 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -301,7 +301,6 @@ config SATA_MV
tristate Marvell SATA support
depends on PCI || ARCH_DOVE || ARCH_MV78XX0 || \
   ARCH_MVEBU || ARCH_ORION5X || COMPILE_TEST
-   select GENERIC_PHY
help
  This option enables support for the Marvell Serial ATA family.
  Currently supports 88SX[56]0[48][01] PCI(-X) chips,
diff --git a/drivers/media/platform/exynos4-is/Kconfig 
b/drivers/media/platform/exynos4-is/Kconfig
index b7b2e47..b6f3eaa 100644
--- a/drivers/media/platform/exynos4-is/Kconfig
+++ b/drivers/media/platform/exynos4-is/Kconfig
@@ -31,7 +31,7 @@ config VIDEO_S5P_FIMC
  config VIDEO_S5P_MIPI_CSIS
tristate S5P/EXYNOS MIPI-CSI2 receiver (MIPI-CSIS) driver
depends on REGULATOR
-   select GENERIC_PHY
+   depends on GENERIC_PHY
help
  This is a V4L2 driver for Samsung S5P and EXYNOS4 SoC MIPI-CSI2
  receiver (MIPI-CSIS) devices.
diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
index 2962de2..edecdb1 100644
--- a/drivers/phy/Kconfig
+++ b/drivers/phy/Kconfig
@@ -5,7 +5,7 @@
  menu PHY Subsystem

  config GENERIC_PHY
-   bool PHY Core
+   bool
help
  Generic PHY support.

@@ -72,7 +72,7 @@ config PHY_MIPHY365X
  config PHY_RCAR_GEN2
tristate Renesas R-Car generation 2 USB PHY driver
depends on ARCH_SHMOBILE
-   depends on GENERIC_PHY
+   select GENERIC_PHY


so some you changed from depends to select...


help
  Support for USB PHY found on Renesas R-Car generation 2 SoCs.

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 5ad60e4..e2197e2 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -182,7 +182,7 @@ config USB_EHCI_HCD_SPEAR
  config USB_EHCI_HCD_STI
tristate Support for ST STiHxxx on-chip EHCI USB controller
depends on ARCH_STI  OF
-   select GENERIC_PHY
+   depends on GENERIC_PHY


while others you changed from select to depends.

NAK.


Felipe, I dont understand your concern, could you please explain it more
detail?  The logic behind the changes is that in cases where there was an
explicit dependency, I changed it to depends on and in other cases I
changed it to selects. Thanks


Since GENERIC_PHY is visible from Kconfig, it would be much nicer to
avoid select altogether.

Felipe, after discussion with the maintainers, I have made GENERIC_PHY 
an invisible option as part of this change. Thanks

--
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 2/3] media: atmel-isi: add runtime pm support

2015-05-26 Thread Laurent Pinchart
Hi Josh,

Thank you for the patch.

On Tuesday 26 May 2015 17:54:46 Josh Wu wrote:
 The runtime pm resume/suspend will enable/disable pclk (ISI peripheral
 clock).
 And we need to call runtime_pm_get_sync()/runtime_pm_put() when we need
 access ISI registers. In atmel_isi_probe(), remove the isi disable code
 as in the moment ISI peripheral clock is not enable yet.
 
 In the meantime, as clock_start()/clock_stop() is used to control the
 mclk not ISI peripheral clock. So move this to start[stop]_streaming()
 function.
 
 Signed-off-by: Josh Wu josh...@atmel.com

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

 ---
 
 Changes in v5:
 - fix the error path in start_streaming() thanks to Laurent.
 
 Changes in v4:
 - need to call pm_runtime_disable() in atmel_isi_remove().
 - merged the patch which remove isi disable code in atmel_isi_probe() as
   isi peripherial clock is not enabled in this moment.
 - refine the commit log
 
 Changes in v3: None
 Changes in v2:
 - merged v1 two patch into one.
 - use runtime_pm_put() instead of runtime_pm_put_sync()
 - enable peripheral clock before access ISI registers.
 
  drivers/media/platform/soc_camera/atmel-isi.c | 55 
  1 file changed, 47 insertions(+), 8 deletions(-)
 
 diff --git a/drivers/media/platform/soc_camera/atmel-isi.c
 b/drivers/media/platform/soc_camera/atmel-isi.c index 2227022..0ea360a
 100644
 --- a/drivers/media/platform/soc_camera/atmel-isi.c
 +++ b/drivers/media/platform/soc_camera/atmel-isi.c
 @@ -20,6 +20,7 @@
  #include linux/kernel.h
  #include linux/module.h
  #include linux/platform_device.h
 +#include linux/pm_runtime.h
  #include linux/slab.h
 
  #include media/atmel-isi.h
 @@ -386,10 +387,13 @@ static int start_streaming(struct vb2_queue *vq,
 unsigned int count) struct atmel_isi *isi = ici-priv;
   int ret;
 
 + pm_runtime_get_sync(ici-v4l2_dev.dev);
 +
   /* Reset ISI */
   ret = atmel_isi_wait_status(isi, WAIT_ISI_RESET);
   if (ret  0) {
   dev_err(icd-parent, Reset ISI timed out\n);
 + pm_runtime_put(ici-v4l2_dev.dev);
   return ret;
   }
   /* Disable all interrupts */
 @@ -443,6 +447,8 @@ static void stop_streaming(struct vb2_queue *vq)
   ret = atmel_isi_wait_status(isi, WAIT_ISI_DISABLE);
   if (ret  0)
   dev_err(icd-parent, Disable ISI timed out\n);
 +
 + pm_runtime_put(ici-v4l2_dev.dev);
  }
 
  static struct vb2_ops isi_video_qops = {
 @@ -514,7 +520,13 @@ static int isi_camera_set_fmt(struct soc_camera_device
 *icd, if (mf-code != xlate-code)
   return -EINVAL;
 
 + /* Enable PM and peripheral clock before operate isi registers */
 + pm_runtime_get_sync(ici-v4l2_dev.dev);
 +
   ret = configure_geometry(isi, pix-width, pix-height, xlate-code);
 +
 + pm_runtime_put(ici-v4l2_dev.dev);
 +
   if (ret  0)
   return ret;
 
 @@ -734,14 +746,9 @@ static int isi_camera_clock_start(struct
 soc_camera_host *ici) struct atmel_isi *isi = ici-priv;
   int ret;
 
 - ret = clk_prepare_enable(isi-pclk);
 - if (ret)
 - return ret;
 -
   if (!IS_ERR(isi-mck)) {
   ret = clk_prepare_enable(isi-mck);
   if (ret) {
 - clk_disable_unprepare(isi-pclk);
   return ret;
   }
   }
 @@ -756,7 +763,6 @@ static void isi_camera_clock_stop(struct soc_camera_host
 *ici)
 
   if (!IS_ERR(isi-mck))
   clk_disable_unprepare(isi-mck);
 - clk_disable_unprepare(isi-pclk);
  }
 
  static unsigned int isi_camera_poll(struct file *file, poll_table *pt)
 @@ -853,9 +859,14 @@ static int isi_camera_set_bus_param(struct
 soc_camera_device *icd)
 
   cfg1 |= ISI_CFG1_THMASK_BEATS_16;
 
 + /* Enable PM and peripheral clock before operate isi registers */
 + pm_runtime_get_sync(ici-v4l2_dev.dev);
 +
   isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS);
   isi_writel(isi, ISI_CFG1, cfg1);
 
 + pm_runtime_put(ici-v4l2_dev.dev);
 +
   return 0;
  }
 
 @@ -887,6 +898,7 @@ static int atmel_isi_remove(struct platform_device
 *pdev) sizeof(struct fbd) * MAX_BUFFER_NUM,
   isi-p_fb_descriptors,
   isi-fb_descriptors_phys);
 + pm_runtime_disable(pdev-dev);
 
   return 0;
  }
 @@ -1025,8 +1037,6 @@ static int atmel_isi_probe(struct platform_device
 *pdev) if (isi-pdata.data_width_flags  ISI_DATAWIDTH_10)
   isi-width_flags |= 1  9;
 
 - isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS);
 -
   irq = platform_get_irq(pdev, 0);
   if (IS_ERR_VALUE(irq)) {
   ret = irq;
 @@ -1047,6 +1057,9 @@ static int atmel_isi_probe(struct platform_device
 *pdev) soc_host-v4l2_dev.dev = pdev-dev;
   soc_host-nr= pdev-id;
 
 + pm_suspend_ignore_children(pdev-dev, true);
 + pm_runtime_enable(pdev-dev);
 +
   if (isi-pdata.asd_sizes) {
   soc_host-asd = isi-pdata.asd;
   

[PATCH v5 0/3] media: atmel-isi: rework on the clock part and add runtime pm support

2015-05-26 Thread Josh Wu
This patch series fix the peripheral clock code and enable runtime support.
Also it clean up the code which is for the compatiblity of mck.

Changes in v5:
- add new patch to fix the condition that codec request still in work.
- fix the error path in start_streaming() thanks to Laurent.

Changes in v4:
- need to call pm_runtime_disable() in atmel_isi_remove().
- merged the patch which remove isi disable code in atmel_isi_probe() as
  isi peripherial clock is not enabled in this moment.
- refine the commit log

Changes in v3:
- remove useless definition: ISI_DEFAULT_MCLK_FREQ

Changes in v2:
- merged v1 two patch into one.
- use runtime_pm_put() instead of runtime_pm_put_sync()
- enable peripheral clock before access ISI registers.
- totally remove clock_start()/clock_stop() as they are optional.

Josh Wu (3):
  media: atmel-isi: disable ISI even it has codec request in
stop_streaming()
  media: atmel-isi: add runtime pm support
  media: atmel-isi: remove mck back compatiable code as it's not need

 drivers/media/platform/soc_camera/atmel-isi.c | 105 --
 1 file changed, 48 insertions(+), 57 deletions(-)

-- 
1.9.1

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


Re: [PATCH v4 1/2] media: atmel-isi: add runtime pm support

2015-05-26 Thread Josh Wu

On 5/26/2015 5:14 PM, Josh Wu wrote:

Hi, Laurent

On 5/26/2015 4:16 PM, Laurent Pinchart wrote:

Hi Josh,

Thank you for the patch.

On Tuesday 26 May 2015 16:00:09 Josh Wu wrote:

The runtime pm resume/suspend will enable/disable pclk (ISI peripheral
clock).
And we need to call runtime_pm_get_sync()/runtime_pm_put() when we need
access ISI registers. In atmel_isi_probe(), remove the isi disable code
as in the moment ISI peripheral clock is not enable yet.

In the meantime, as clock_start()/clock_stop() is used to control the
mclk not ISI peripheral clock. So move this to start[stop]_streaming()
function.

Signed-off-by: Josh Wu josh...@atmel.com
---

Changes in v4:
- need to call pm_runtime_disable() in atmel_isi_remove().
- merged the patch which remove isi disable code in 
atmel_isi_probe() as

   isi peripherial clock is not enabled in this moment.
- refine the commit log

Changes in v3: None
Changes in v2:
- merged v1 two patch into one.
- use runtime_pm_put() instead of runtime_pm_put_sync()
- enable peripheral clock before access ISI registers.

  drivers/media/platform/soc_camera/atmel-isi.c | 54 


  1 file changed, 46 insertions(+), 8 deletions(-)

diff --git a/drivers/media/platform/soc_camera/atmel-isi.c
b/drivers/media/platform/soc_camera/atmel-isi.c index 2879026..194e875
100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -20,6 +20,7 @@
  #include linux/kernel.h
  #include linux/module.h
  #include linux/platform_device.h
+#include linux/pm_runtime.h
  #include linux/slab.h

  #include media/atmel-isi.h
@@ -386,6 +387,8 @@ static int start_streaming(struct vb2_queue *vq,
unsigned int count) struct atmel_isi *isi = ici-priv;
  int ret;

+pm_runtime_get_sync(ici-v4l2_dev.dev);
+
  /* Reset ISI */
  ret = atmel_isi_wait_status(isi, WAIT_ISI_RESET);
  if (ret  0) {

You need to call pm_runtime_put() in the error path, otherwise an
atmel_isi_wait_status() failure will keep the device enabled.


Nice catch. Thanks.




@@ -445,6 +448,8 @@ static void stop_streaming(struct vb2_queue *vq)
  ret = atmel_isi_wait_status(isi, WAIT_ISI_DISABLE);
  if (ret  0)
  dev_err(icd-parent, Disable ISI timed out\n);
+
+pm_runtime_put(ici-v4l2_dev.dev);
  }

  static struct vb2_ops isi_video_qops = {
@@ -516,7 +521,13 @@ static int isi_camera_set_fmt(struct 
soc_camera_device

*icd, if (mf-code != xlate-code)
  return -EINVAL;

+/* Enable PM and peripheral clock before operate isi registers */
+pm_runtime_get_sync(ici-v4l2_dev.dev);
+
  ret = configure_geometry(isi, pix-width, pix-height, 
xlate-code);

+
+pm_runtime_put(ici-v4l2_dev.dev);
I think it would simplify the code to move the configure_geometry() 
call to
start_streaming() as you already call pm_runtime_get_sync() there. 
That can be

done in a separate patch though.


I think it's a good idea. I would like to make this in a separate 
patch and not include in this series.


In summary, I'll resend this patch just with the fix you mentioned in 
above (fix the error path in start_streaming).

Is that okay for you?


As I found another issue on stop_streaming(), so I sent a v5 series for 
this whole patch set with a new fix.

Please check it.

BTW: I don't include the simplify method: move configure_geometry() into 
start_streaming(), I perfer do that after this series is merged.


Best Regards,
Josh Wu



Best Regards,
Josh Wu




+
  if (ret  0)
  return ret;

@@ -736,14 +747,9 @@ static int isi_camera_clock_start(struct
soc_camera_host *ici) struct atmel_isi *isi = ici-priv;
  int ret;

-ret = clk_prepare_enable(isi-pclk);
-if (ret)
-return ret;
-
  if (!IS_ERR(isi-mck)) {
  ret = clk_prepare_enable(isi-mck);
  if (ret) {
-clk_disable_unprepare(isi-pclk);
  return ret;
  }
  }
@@ -758,7 +764,6 @@ static void isi_camera_clock_stop(struct 
soc_camera_host

*ici)

  if (!IS_ERR(isi-mck))
  clk_disable_unprepare(isi-mck);
-clk_disable_unprepare(isi-pclk);
  }

  static unsigned int isi_camera_poll(struct file *file, poll_table 
*pt)

@@ -855,9 +860,14 @@ static int isi_camera_set_bus_param(struct
soc_camera_device *icd)

  cfg1 |= ISI_CFG1_THMASK_BEATS_16;

+/* Enable PM and peripheral clock before operate isi registers */
+pm_runtime_get_sync(ici-v4l2_dev.dev);
+
  isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS);
  isi_writel(isi, ISI_CFG1, cfg1);

+pm_runtime_put(ici-v4l2_dev.dev);
+
  return 0;
  }

@@ -889,6 +899,7 @@ static int atmel_isi_remove(struct platform_device
*pdev) sizeof(struct fbd) * MAX_BUFFER_NUM,
  isi-p_fb_descriptors,
  isi-fb_descriptors_phys);
+pm_runtime_disable(pdev-dev);

  return 0;
  }
@@ -1027,8 +1038,6 @@ static int atmel_isi_probe(struct platform_device
*pdev) if (isi-pdata.data_width_flags  ISI_DATAWIDTH_10)
  

[PATCH 09/13] crypto: omap-des - Support for deferred probing when requesting DMA channels

2015-05-26 Thread Peter Ujfalusi
Switch to use ma_request_slave_channel_compat_reason() to request the DMA
channels. Only fall back to pio mode if the error code returned is not
-EPROBE_DEFER, otherwise return from the probe with the -EPROBE_DEFER.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
CC: Herbert Xu herb...@gondor.apana.org.au
CC: David S. Miller da...@davemloft.net
CC: Lokesh Vutla lokeshvu...@ti.com
---
 drivers/crypto/omap-des.c | 38 --
 1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/drivers/crypto/omap-des.c b/drivers/crypto/omap-des.c
index 46307098f8ba..06be02f520da 100644
--- a/drivers/crypto/omap-des.c
+++ b/drivers/crypto/omap-des.c
@@ -340,7 +340,7 @@ static void omap_des_dma_out_callback(void *data)
 
 static int omap_des_dma_init(struct omap_des_dev *dd)
 {
-   int err = -ENOMEM;
+   int err;
dma_cap_mask_t mask;
 
dd-dma_lch_out = NULL;
@@ -349,21 +349,20 @@ static int omap_des_dma_init(struct omap_des_dev *dd)
dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask);
 
-   dd-dma_lch_in = dma_request_slave_channel_compat(mask,
- omap_dma_filter_fn,
- dd-dma_in,
- dd-dev, rx);
-   if (!dd-dma_lch_in) {
+   dd-dma_lch_in = dma_request_slave_channel_compat_reason(mask,
+   omap_dma_filter_fn, dd-dma_in,
+   dd-dev, rx);
+   if (IS_ERR(dd-dma_lch_in)) {
dev_err(dd-dev, Unable to request in DMA channel\n);
-   goto err_dma_in;
+   return PTR_ERR(dd-dma_lch_in);
}
 
-   dd-dma_lch_out = dma_request_slave_channel_compat(mask,
-  omap_dma_filter_fn,
-  dd-dma_out,
-  dd-dev, tx);
-   if (!dd-dma_lch_out) {
+   dd-dma_lch_out = dma_request_slave_channel_compat_reason(mask,
+   omap_dma_filter_fn, dd-dma_out,
+   dd-dev, tx);
+   if (IS_ERR(dd-dma_lch_out)) {
dev_err(dd-dev, Unable to request out DMA channel\n);
+   err = PTR_ERR(dd-dma_lch_out);
goto err_dma_out;
}
 
@@ -371,14 +370,15 @@ static int omap_des_dma_init(struct omap_des_dev *dd)
 
 err_dma_out:
dma_release_channel(dd-dma_lch_in);
-err_dma_in:
-   if (err)
-   pr_err(error: %d\n, err);
+
return err;
 }
 
 static void omap_des_dma_cleanup(struct omap_des_dev *dd)
 {
+   if (dd-pio_only)
+   return;
+
dma_release_channel(dd-dma_lch_out);
dma_release_channel(dd-dma_lch_in);
 }
@@ -1110,7 +1110,9 @@ static int omap_des_probe(struct platform_device *pdev)
tasklet_init(dd-queue_task, omap_des_queue_task, (unsigned long)dd);
 
err = omap_des_dma_init(dd);
-   if (err  DES_REG_IRQ_STATUS(dd)  DES_REG_IRQ_ENABLE(dd)) {
+   if (err == -EPROBE_DEFER) {
+   goto err_irq;
+   } else if (err  DES_REG_IRQ_STATUS(dd)  DES_REG_IRQ_ENABLE(dd)) {
dd-pio_only = 1;
 
irq = platform_get_irq(pdev, 0);
@@ -1154,8 +1156,8 @@ err_algs:
for (j = dd-pdata-algs_info[i].registered - 1; j = 0; j--)
crypto_unregister_alg(
dd-pdata-algs_info[i].algs_list[j]);
-   if (!dd-pio_only)
-   omap_des_dma_cleanup(dd);
+
+   omap_des_dma_cleanup(dd);
 err_irq:
tasklet_kill(dd-done_task);
tasklet_kill(dd-queue_task);
-- 
2.3.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


OSTRZEZENIE!!!

2015-05-26 Thread IT Help Desk
Szanowny konto uzytkownika z konta poczty e-mail przekroczyla ze kontyngent / 
limit 32GB nie bedzie w stanie otrzymac wszystkich nowych wiadomosci lub 
wysylac nowe wiadomosci, az do ponownej weryfikacji. Wlacz swoja uaktualnienie 
dla prawidlowego funkcjonowania e-mail.

Aby ponownie zatwierdza lizac na link:
http://systemadminhelpdeskcenter.jouwweb.nl/

Dziekujemy za wspólprace z nami
Copyright ©2015 administratorem systemu.
Powiadom Zespolu Pomocy Technicznej

---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com

--
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 07/13] mmc: davinci_mmc: Support for deferred probing when requesting DMA channels

2015-05-26 Thread Peter Ujfalusi
Switch to use ma_request_slave_channel_compat_reason() to request the DMA
channels. Only fall back to pio mode if the error code returned is not
-EPROBE_DEFER, otherwise return from the probe with the -EPROBE_DEFER.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
CC: Ulf Hansson ulf.hans...@linaro.org
---
 drivers/mmc/host/davinci_mmc.c | 26 +++---
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c
index b2b3f8bbfd8c..df81e4e2f662 100644
--- a/drivers/mmc/host/davinci_mmc.c
+++ b/drivers/mmc/host/davinci_mmc.c
@@ -530,20 +530,20 @@ static int __init davinci_acquire_dma_channels(struct 
mmc_davinci_host *host)
dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask);
 
-   host-dma_tx =
-   dma_request_slave_channel_compat(mask, edma_filter_fn,
-   host-txdma, mmc_dev(host-mmc), tx);
-   if (!host-dma_tx) {
+   host-dma_tx = dma_request_slave_channel_compat_reason(mask,
+   edma_filter_fn, host-txdma,
+   mmc_dev(host-mmc), tx);
+   if (IS_ERR(host-dma_tx)) {
dev_err(mmc_dev(host-mmc), Can't get dma_tx channel\n);
-   return -ENODEV;
+   return PTR_ERR(host-dma_tx);
}
 
-   host-dma_rx =
-   dma_request_slave_channel_compat(mask, edma_filter_fn,
-   host-rxdma, mmc_dev(host-mmc), rx);
-   if (!host-dma_rx) {
+   host-dma_rx = dma_request_slave_channel_compat_reason(mask,
+   edma_filter_fn, host-rxdma,
+   mmc_dev(host-mmc), rx);
+   if (IS_ERR(host-dma_rx)) {
dev_err(mmc_dev(host-mmc), Can't get dma_rx channel\n);
-   r = -ENODEV;
+   r = PTR_ERR(host-dma_rx);
goto free_master_write;
}
 
@@ -1307,8 +1307,12 @@ static int __init davinci_mmcsd_probe(struct 
platform_device *pdev)
host-mmc_irq = irq;
host-sdio_irq = platform_get_irq(pdev, 1);
 
-   if (host-use_dma  davinci_acquire_dma_channels(host) != 0)
+   if (host-use_dma) {
+   ret = davinci_acquire_dma_channels(host);
+   if (ret == -EPROBE_DEFER)
+   goto out;
host-use_dma = 0;
+   }
 
/* REVISIT:  someday, support IRQ-driven card detection.  */
mmc-caps |= MMC_CAP_NEEDS_POLL;
-- 
2.3.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 01/13] dmaengine: of_dma: Correct return code for of_dma_request_slave_channel in case !CONFIG_OF

2015-05-26 Thread Peter Ujfalusi
of_dma_request_slave_channel should return either pointer for valid
dma_chan or ERR_PTR() error code, NULL is not expected to be returned.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
CC: Grant Likely grant.lik...@linaro.org
CC: Rob Herring robh...@kernel.org
---
 include/linux/of_dma.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/of_dma.h b/include/linux/of_dma.h
index 98ba7525929e..0fd80be152c4 100644
--- a/include/linux/of_dma.h
+++ b/include/linux/of_dma.h
@@ -80,7 +80,7 @@ static inline int of_dma_router_register(struct device_node 
*np,
 static inline struct dma_chan *of_dma_request_slave_channel(struct device_node 
*np,
 const char *name)
 {
-   return NULL;
+   return ERR_PTR(-ENODEV);
 }
 
 static inline struct dma_chan *of_dma_simple_xlate(struct of_phandle_args 
*dma_spec,
-- 
2.3.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 05/13] mmc: omap_hsmmc: Support for deferred probing when requesting DMA channels

2015-05-26 Thread Peter Ujfalusi
Switch to use ma_request_slave_channel_compat_reason() to request the DMA
channels. In case of error, return the error code we received including
-EPROBE_DEFER

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
CC: Ulf Hansson ulf.hans...@linaro.org
---
 drivers/mmc/host/omap_hsmmc.c | 22 ++
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 57bb85930f81..d252478391ee 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -2088,23 +2088,21 @@ static int omap_hsmmc_probe(struct platform_device 
*pdev)
dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask);
 
-   host-rx_chan =
-   dma_request_slave_channel_compat(mask, omap_dma_filter_fn,
-rx_req, pdev-dev, rx);
+   host-rx_chan = dma_request_slave_channel_compat_reason(mask,
+   omap_dma_filter_fn, rx_req, pdev-dev, rx);
 
-   if (!host-rx_chan) {
+   if (IS_ERR(host-rx_chan)) {
dev_err(mmc_dev(host-mmc), unable to obtain RX DMA engine 
channel %u\n, rx_req);
-   ret = -ENXIO;
+   ret = PTR_ERR(host-rx_chan);
goto err_irq;
}
 
-   host-tx_chan =
-   dma_request_slave_channel_compat(mask, omap_dma_filter_fn,
-tx_req, pdev-dev, tx);
+   host-tx_chan = dma_request_slave_channel_compat_reason(mask,
+   omap_dma_filter_fn, tx_req, pdev-dev, tx);
 
-   if (!host-tx_chan) {
+   if (IS_ERR(host-tx_chan)) {
dev_err(mmc_dev(host-mmc), unable to obtain TX DMA engine 
channel %u\n, tx_req);
-   ret = -ENXIO;
+   ret = PTR_ERR(host-tx_chan);
goto err_irq;
}
 
@@ -2166,9 +2164,9 @@ err_slot_name:
if (host-use_reg)
omap_hsmmc_reg_put(host);
 err_irq:
-   if (host-tx_chan)
+   if (!IS_ERR_OR_NULL(host-tx_chan))
dma_release_channel(host-tx_chan);
-   if (host-rx_chan)
+   if (!IS_ERR_OR_NULL(host-rx_chan))
dma_release_channel(host-rx_chan);
pm_runtime_put_sync(host-dev);
pm_runtime_disable(host-dev);
-- 
2.3.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 04/13] mmc: omap_hsmmc: No need to check DMA channel validity at module remove

2015-05-26 Thread Peter Ujfalusi
The driver will not probe without valid DMA channels so no need to check
if they are valid when the module is removed.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
CC: Ulf Hansson ulf.hans...@linaro.org
---
 drivers/mmc/host/omap_hsmmc.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 2cd828f42151..57bb85930f81 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -2190,10 +2190,8 @@ static int omap_hsmmc_remove(struct platform_device 
*pdev)
if (host-use_reg)
omap_hsmmc_reg_put(host);
 
-   if (host-tx_chan)
-   dma_release_channel(host-tx_chan);
-   if (host-rx_chan)
-   dma_release_channel(host-rx_chan);
+   dma_release_channel(host-tx_chan);
+   dma_release_channel(host-rx_chan);
 
pm_runtime_put_sync(host-dev);
pm_runtime_disable(host-dev);
-- 
2.3.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 02/13] dmaengine: Introduce dma_request_slave_channel_compat_reason()

2015-05-26 Thread Peter Ujfalusi
dma_request_slave_channel_compat() 'eats' up the returned error codes which
prevents drivers using the compat call to be able to do deferred probing.

The new wrapper is identical in functionality but it will return with error
code in case of failure and will pass the -EPROBE_DEFER to the caller in
case dma_request_slave_channel_reason() returned with it.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
---
 include/linux/dmaengine.h | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index abf63ceabef9..6c777394835c 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -1120,4 +1120,26 @@ static inline struct dma_chan
 
return __dma_request_channel(mask, fn, fn_param);
 }
+
+#define dma_request_slave_channel_compat_reason(mask, x, y, dev, name) \
+   __dma_request_slave_channel_compat_reason((mask), x, y, dev, name)
+
+static inline struct dma_chan
+*__dma_request_slave_channel_compat_reason(const dma_cap_mask_t *mask,
+ dma_filter_fn fn, void *fn_param,
+ struct device *dev, char *name)
+{
+   struct dma_chan *chan;
+
+   chan = dma_request_slave_channel_reason(dev, name);
+   /* Try via legacy API if not requesting for deferred probing */
+   if (IS_ERR(chan)  PTR_ERR(chan) != -EPROBE_DEFER)
+   chan = __dma_request_channel(mask, fn, fn_param);
+
+   if (!chan)
+   chan = ERR_PTR(-ENODEV);
+
+   return chan;
+}
+
 #endif /* DMAENGINE_H */
-- 
2.3.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: DVB-T2 PCIe vs DVB-S2

2015-05-26 Thread Olli Salonen
There are indeed a few DVB-T2 PCIe cards that are supported (DVBSky
T9580, T980C, T982C, TechnoTrend CT2-4500 CI, Hauppauge HVR-2205,
Hauppauge HVR-5525 at least come to my mind). PCTV 290e is a USB
device, not PCIe. In the wiki there's currently some issue with the
filtering when it comes to the tables - that's why every PCIe device
is printed instead of just the DVB-T2 supporting ones.

As Jemma points out, the application should be clever enough to tell
the driver that DVB-T2 delivery system is wanted. For the cxd2820r
driver (PCTV 290e) Antti made the fudge, but has decided not to
implement it in the Si2168 driver (reasoning, to which I
wholeheartedly agree, is here:
http://blog.palosaari.fi/2014/09/linux-dvb-t2-tuning-problems.html ).

When it comes to PVR backends, at least tvheadend supports DVBv5 fully
- I don't have a clear picture of other backends.

Cheers,
-olli

On 26 May 2015 at 17:44, Jemma Denson jden...@gmail.com wrote:
 On 26/05/15 08:53, Ian Campbell wrote:

 Hello,

 I'm looking to get a DVB-T2 tuner card to add UK Freeview HD to my
 mythtv box.

 Looking at http://linuxtv.org/wiki/index.php/DVB-T2_PCIe_Cards is seems
 that many (the majority even) of the cards there are actually DVB-S2.

 Is this a mistake or is there something I don't know (like maybe S2 is
 compatible with T2)?

 Thanks,
 Ian.


 That's a mistake - I don't recall that table looking like that when I was
 looking for one, and S2 is quite definitely not compatible with T2!

 I can confirm that the 290e works out of the box with myth with very few
 problems, however it's well out of production now and you might not be after
 a USB device. I'm not sure anything else would work without some hacking
 because last I heard myth doesn't do T2 the proper way using DVBv5 yet, and
 afaik only the 290e driver has a fudge to allow T2 on v3.
 (http://lists.mythtv.org/pipermail/mythtv-users/2014-November/374441.html
 and https://code.mythtv.org/trac/ticket/12342)


 Jemma.
 --
 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
--
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/2] ts2020: Provide DVBv5 API signal strength

2015-05-26 Thread Malcolm Priestley

On 26/05/15 16:04, David Howells wrote:

Provide a DVBv5 API signal strength.  This is in units of 0.001 dBm rather
than a percentage.


From Antti Palosaari's testing with a signal generator, it appears that the

gain calculated according to Montage's specification if negated is a
reasonable representation of the signal strength of the generator.

To this end:

  (1) Polled statistic gathering needed to be implemented in the TS2020 driver.
  This is done in the ts2020_stat_work() function.

  (2) The calculated gain is placed as the signal strength in the
  dtv_property_cache associated with the front end with the scale set to
  FE_SCALE_DECIBEL.

  (3) The DVBv3 format signal strength then needed to be calculated from the
  signal strength stored in the dtv_property_cache rather than accessing
  the value when ts2020_read_signal_strength() is called.

Signed-off-by: David Howells dhowe...@redhat.com
---

  drivers/media/dvb-frontends/ts2020.c |   62 +-
  1 file changed, 53 insertions(+), 9 deletions(-)

diff --git a/drivers/media/dvb-frontends/ts2020.c 
b/drivers/media/dvb-frontends/ts2020.c
index 277e1cf..80ae039 100644
--- a/drivers/media/dvb-frontends/ts2020.c
+++ b/drivers/media/dvb-frontends/ts2020.c
@@ -32,10 +32,11 @@ struct ts2020_priv {
struct regmap_config regmap_config;
struct regmap *regmap;
struct dvb_frontend *fe;
+   struct delayed_work stat_work;
int (*get_agc_pwm)(struct dvb_frontend *fe, u8 *_agc_pwm);
/* i2c details */
-   int i2c_address;
struct i2c_adapter *i2c;
+   int i2c_address;
u8 clk_out:2;
u8 clk_out_div:5;
u32 frequency_div; /* LO output divider switch frequency */
@@ -65,6 +66,7 @@ static int ts2020_release(struct dvb_frontend *fe)
  static int ts2020_sleep(struct dvb_frontend *fe)
  {
struct ts2020_priv *priv = fe-tuner_priv;
+   int ret;
u8 u8tmp;

if (priv-tuner == TS2020_M88TS2020)
@@ -72,11 +74,18 @@ static int ts2020_sleep(struct dvb_frontend *fe)
else
u8tmp = 0x00;

-   return regmap_write(priv-regmap, u8tmp, 0x00);
+   ret = regmap_write(priv-regmap, u8tmp, 0x00);
+   if (ret  0)
+   return ret;
+
+   /* stop statistics polling */
+   cancel_delayed_work_sync(priv-stat_work);
+   return 0;
  }

  static int ts2020_init(struct dvb_frontend *fe)
  {
+   struct dtv_frontend_properties *c = fe-dtv_property_cache;
struct ts2020_priv *priv = fe-tuner_priv;
int i;
u8 u8tmp;
@@ -138,6 +147,13 @@ static int ts2020_init(struct dvb_frontend *fe)
 reg_vals[i].val);
}

+   /* Initialise v5 stats here */
+   c-strength.len = 1;
+   c-strength.stat[0].scale = FE_SCALE_DECIBEL;
+   c-strength.stat[0].uvalue = 0;
+
+   /* Start statistics polling */
+   schedule_delayed_work(priv-stat_work, 0);
return 0;
  }



Hi David

Statistics polling can not be done by lmedm04 driver's implementation of 
M88RS2000/TS2020 because I2C messages stop the devices demuxer.


So any polling must be a config option for this driver.

Regards

Malcolm





--
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: DVB-T2 PCIe vs DVB-S2

2015-05-26 Thread Another Sillyname
TBS cards.PCIe x1 used them for years in both DVB-T2 and DVB-S2
formats..never had a problem (except the drivers were cr*p a fair
few years back).would not hesitate to recommend them to anyone.

Currently have quad tuners of both running in a server that hasn't
needed a reboot in 524 days and counting.

On 26 May 2015 at 20:10, Olli Salonen olli.salo...@iki.fi wrote:
 There are indeed a few DVB-T2 PCIe cards that are supported (DVBSky
 T9580, T980C, T982C, TechnoTrend CT2-4500 CI, Hauppauge HVR-2205,
 Hauppauge HVR-5525 at least come to my mind). PCTV 290e is a USB
 device, not PCIe. In the wiki there's currently some issue with the
 filtering when it comes to the tables - that's why every PCIe device
 is printed instead of just the DVB-T2 supporting ones.

 As Jemma points out, the application should be clever enough to tell
 the driver that DVB-T2 delivery system is wanted. For the cxd2820r
 driver (PCTV 290e) Antti made the fudge, but has decided not to
 implement it in the Si2168 driver (reasoning, to which I
 wholeheartedly agree, is here:
 http://blog.palosaari.fi/2014/09/linux-dvb-t2-tuning-problems.html ).

 When it comes to PVR backends, at least tvheadend supports DVBv5 fully
 - I don't have a clear picture of other backends.

 Cheers,
 -olli

 On 26 May 2015 at 17:44, Jemma Denson jden...@gmail.com wrote:
 On 26/05/15 08:53, Ian Campbell wrote:

 Hello,

 I'm looking to get a DVB-T2 tuner card to add UK Freeview HD to my
 mythtv box.

 Looking at http://linuxtv.org/wiki/index.php/DVB-T2_PCIe_Cards is seems
 that many (the majority even) of the cards there are actually DVB-S2.

 Is this a mistake or is there something I don't know (like maybe S2 is
 compatible with T2)?

 Thanks,
 Ian.


 That's a mistake - I don't recall that table looking like that when I was
 looking for one, and S2 is quite definitely not compatible with T2!

 I can confirm that the 290e works out of the box with myth with very few
 problems, however it's well out of production now and you might not be after
 a USB device. I'm not sure anything else would work without some hacking
 because last I heard myth doesn't do T2 the proper way using DVBv5 yet, and
 afaik only the 290e driver has a fudge to allow T2 on v3.
 (http://lists.mythtv.org/pipermail/mythtv-users/2014-November/374441.html
 and https://code.mythtv.org/trac/ticket/12342)


 Jemma.
 --
 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
 --
 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
--
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] staging: media: omap4iss: Reformat overly long lines

2015-05-26 Thread Greg Kroah-Hartman
On Tue, May 26, 2015 at 10:54:18AM +0200, Piotr S. Staszewski wrote:
 This reformats lines that were previously above 80 characters long,
 improving readability and making checkpatch.pl happy.
 
 Signed-off-by: Piotr S. Staszewski p.staszew...@gmail.com
 ---
  drivers/staging/media/omap4iss/iss_csi2.c| 21 ---
  drivers/staging/media/omap4iss/iss_ipipe.c   | 30 
 ++--
  drivers/staging/media/omap4iss/iss_ipipeif.c | 10 ++
  drivers/staging/media/omap4iss/iss_resizer.c |  8 +---
  4 files changed, 44 insertions(+), 25 deletions(-)
 
 diff --git a/drivers/staging/media/omap4iss/iss_csi2.c 
 b/drivers/staging/media/omap4iss/iss_csi2.c
 index d7ff769..a8714bb 100644
 --- a/drivers/staging/media/omap4iss/iss_csi2.c
 +++ b/drivers/staging/media/omap4iss/iss_csi2.c
 @@ -224,7 +224,8 @@ static u16 csi2_ctx_map_format(struct iss_csi2_device 
 *csi2)
   fmtidx = 3;
   break;
   default:
 - WARN(1, KERN_ERR CSI2: pixel format %08x unsupported!\n,
 + WARN(1,
 +  KERN_ERR CSI2: pixel format %08x unsupported!\n,

That line wasn't over 80 characters long, why change it?

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


[PATCH 1/2] TS2020: Calculate tuner gain correctly

2015-05-26 Thread David Howells
The TS2020 and TS2022 tuners take an input from the demodulator indicating the
AGC setting on that component that is then used to influence the tuner's own
gain.  This should be taken into account when calculating the gain and signal
strength.

Further, the existing TS2020 driver miscalculates the signal strength as the
result of its calculations can exceed the storage capacity of the 16-bit word
used to return it to userspace.

To this end:

 (1) Add a callback function (-get_agc_pwm()) in the ts2020_config struct that
 the tuner can call to get the AGC PWM value from the demodulator.

 (2) Modify the TS2020 driver to calculate the gain according to Montage's
 specification with the adjustment that we produce a negative value and
 scale it to 0.001dB units (which is what the DVBv5 API will require):

 (a) Callback to the demodulator to retrieve the AGC PWM value and then
 turn that into Vagc for incorporation in the calculations.  If the
 callback is unset, assume a Vagc of 0.

 (b) Calculate the tuner gain from a combination of Vagc and the tuner's RF
 gain and baseband gain settings.

 (3) Turn this into a percentage signal strength as per Montage's
 specification for return to userspace with the DVBv3 API.

 (4) Provide a function in the M88DS3103 demodulator driver that can be used to
 get the AGC PWM value on behalf of the tuner.

 (5) The ts2020_config.get_agc_pwm function should be set by the code that
 stitches together the drivers for each card.

 For the DVBSky cards that use the M88DS3103 with the TS2020 or the TS2022,
 set the get_agc_pwm function to point to m88ds3103_get_agc_pwm.

I have tested this with a DVBSky S952 card which has an M88DS3103 and a TS2022.

Thanks to Montage for providing access to information about the workings of
these parts.

Signed-off-by: David Howells dhowe...@redhat.com
---

 drivers/media/dvb-frontends/m88ds3103.c |   16 
 drivers/media/dvb-frontends/m88ds3103.h |2 
 drivers/media/dvb-frontends/ts2020.c|  138 +++
 drivers/media/dvb-frontends/ts2020.h|5 +
 drivers/media/pci/cx23885/cx23885-dvb.c |3 +
 drivers/media/usb/dvb-usb-v2/dvbsky.c   |2 
 6 files changed, 148 insertions(+), 18 deletions(-)

diff --git a/drivers/media/dvb-frontends/m88ds3103.c 
b/drivers/media/dvb-frontends/m88ds3103.c
index 50ede6a..0703316 100644
--- a/drivers/media/dvb-frontends/m88ds3103.c
+++ b/drivers/media/dvb-frontends/m88ds3103.c
@@ -52,6 +52,22 @@ err:
return ret;
 }
 
+/*
+ * Get the demodulator AGC PWM voltage setting supplied to the tuner.
+ */
+int m88ds3103_get_agc_pwm(struct dvb_frontend *fe, u8 *_agc_pwm)
+{
+   struct m88ds3103_dev *dev = fe-demodulator_priv;
+   unsigned tmp;
+   int ret;
+
+   ret = regmap_read(dev-regmap, 0x3f, tmp);
+   if (ret == 0)
+   *_agc_pwm = tmp;
+   return ret;
+}
+EXPORT_SYMBOL(m88ds3103_get_agc_pwm);
+
 static int m88ds3103_read_status(struct dvb_frontend *fe, fe_status_t *status)
 {
struct m88ds3103_dev *dev = fe-demodulator_priv;
diff --git a/drivers/media/dvb-frontends/m88ds3103.h 
b/drivers/media/dvb-frontends/m88ds3103.h
index ff03905..04b355a 100644
--- a/drivers/media/dvb-frontends/m88ds3103.h
+++ b/drivers/media/dvb-frontends/m88ds3103.h
@@ -176,6 +176,7 @@ extern struct dvb_frontend *m88ds3103_attach(
const struct m88ds3103_config *config,
struct i2c_adapter *i2c,
struct i2c_adapter **tuner_i2c);
+extern int m88ds3103_get_agc_pwm(struct dvb_frontend *fe, u8 *_agc_pwm);
 #else
 static inline struct dvb_frontend *m88ds3103_attach(
const struct m88ds3103_config *config,
@@ -185,6 +186,7 @@ static inline struct dvb_frontend *m88ds3103_attach(
pr_warn(%s: driver disabled by Kconfig\n, __func__);
return NULL;
 }
+#define m88ds3103_get_agc_pwm NULL
 #endif
 
 #endif
diff --git a/drivers/media/dvb-frontends/ts2020.c 
b/drivers/media/dvb-frontends/ts2020.c
index f674717..277e1cf 100644
--- a/drivers/media/dvb-frontends/ts2020.c
+++ b/drivers/media/dvb-frontends/ts2020.c
@@ -32,6 +32,7 @@ struct ts2020_priv {
struct regmap_config regmap_config;
struct regmap *regmap;
struct dvb_frontend *fe;
+   int (*get_agc_pwm)(struct dvb_frontend *fe, u8 *_agc_pwm);
/* i2c details */
int i2c_address;
struct i2c_adapter *i2c;
@@ -313,32 +314,132 @@ static int ts2020_get_if_frequency(struct dvb_frontend 
*fe, u32 *frequency)
return 0;
 }
 
-/* read TS2020 signal strength */
-static int ts2020_read_signal_strength(struct dvb_frontend *fe,
-   u16 *signal_strength)
+/*
+ * Get the tuner gain.
+ * @fe: The front end for which we're determining the gain
+ * @v_agc: The voltage of the AGC from the demodulator (0-2600mV)
+ * @_gain: Where to store the gain (in 0.001dB units)
+ *
+ * Returns 0 or a negative error 

[PATCH 2/2] ts2020: Provide DVBv5 API signal strength

2015-05-26 Thread David Howells
Provide a DVBv5 API signal strength.  This is in units of 0.001 dBm rather
than a percentage.

From Antti Palosaari's testing with a signal generator, it appears that the
gain calculated according to Montage's specification if negated is a
reasonable representation of the signal strength of the generator.

To this end:

 (1) Polled statistic gathering needed to be implemented in the TS2020 driver.
 This is done in the ts2020_stat_work() function.

 (2) The calculated gain is placed as the signal strength in the
 dtv_property_cache associated with the front end with the scale set to
 FE_SCALE_DECIBEL.

 (3) The DVBv3 format signal strength then needed to be calculated from the
 signal strength stored in the dtv_property_cache rather than accessing
 the value when ts2020_read_signal_strength() is called.

Signed-off-by: David Howells dhowe...@redhat.com
---

 drivers/media/dvb-frontends/ts2020.c |   62 +-
 1 file changed, 53 insertions(+), 9 deletions(-)

diff --git a/drivers/media/dvb-frontends/ts2020.c 
b/drivers/media/dvb-frontends/ts2020.c
index 277e1cf..80ae039 100644
--- a/drivers/media/dvb-frontends/ts2020.c
+++ b/drivers/media/dvb-frontends/ts2020.c
@@ -32,10 +32,11 @@ struct ts2020_priv {
struct regmap_config regmap_config;
struct regmap *regmap;
struct dvb_frontend *fe;
+   struct delayed_work stat_work;
int (*get_agc_pwm)(struct dvb_frontend *fe, u8 *_agc_pwm);
/* i2c details */
-   int i2c_address;
struct i2c_adapter *i2c;
+   int i2c_address;
u8 clk_out:2;
u8 clk_out_div:5;
u32 frequency_div; /* LO output divider switch frequency */
@@ -65,6 +66,7 @@ static int ts2020_release(struct dvb_frontend *fe)
 static int ts2020_sleep(struct dvb_frontend *fe)
 {
struct ts2020_priv *priv = fe-tuner_priv;
+   int ret;
u8 u8tmp;
 
if (priv-tuner == TS2020_M88TS2020)
@@ -72,11 +74,18 @@ static int ts2020_sleep(struct dvb_frontend *fe)
else
u8tmp = 0x00;
 
-   return regmap_write(priv-regmap, u8tmp, 0x00);
+   ret = regmap_write(priv-regmap, u8tmp, 0x00);
+   if (ret  0)
+   return ret;
+
+   /* stop statistics polling */
+   cancel_delayed_work_sync(priv-stat_work);
+   return 0;
 }
 
 static int ts2020_init(struct dvb_frontend *fe)
 {
+   struct dtv_frontend_properties *c = fe-dtv_property_cache;
struct ts2020_priv *priv = fe-tuner_priv;
int i;
u8 u8tmp;
@@ -138,6 +147,13 @@ static int ts2020_init(struct dvb_frontend *fe)
 reg_vals[i].val);
}
 
+   /* Initialise v5 stats here */
+   c-strength.len = 1;
+   c-strength.stat[0].scale = FE_SCALE_DECIBEL;
+   c-strength.stat[0].uvalue = 0;
+
+   /* Start statistics polling */
+   schedule_delayed_work(priv-stat_work, 0);
return 0;
 }
 
@@ -411,19 +427,46 @@ static int ts2020_get_tuner_gain(struct dvb_frontend *fe, 
__s64 *_gain)
 }
 
 /*
+ * Gather statistics on a regular basis
+ */
+static void ts2020_stat_work(struct work_struct *work)
+{
+   struct ts2020_priv *priv = container_of(work, struct ts2020_priv,
+  stat_work.work);
+   struct i2c_client *client = priv-client;
+   struct dtv_frontend_properties *c = priv-fe-dtv_property_cache;
+   int ret;
+
+   dev_dbg(client-dev, \n);
+
+   ret = ts2020_get_tuner_gain(priv-fe, c-strength.stat[0].svalue);
+   if (ret  0)
+   goto err;
+
+   c-strength.stat[0].scale = FE_SCALE_DECIBEL;
+
+   schedule_delayed_work(priv-stat_work, msecs_to_jiffies(2000));
+   return;
+err:
+   dev_dbg(client-dev, failed=%d\n, ret);
+}
+
+/*
  * Read TS2020 signal strength in v3 format.
  */
 static int ts2020_read_signal_strength(struct dvb_frontend *fe,
-   u16 *signal_strength)
+  u16 *_signal_strength)
 {
+   struct dtv_frontend_properties *c = fe-dtv_property_cache;
unsigned strength;
__s64 gain;
-   int ret;
 
-   /* Determine the total gain of the tuner */
-   ret = ts2020_get_tuner_gain(fe, gain);
-   if (ret  0)
-   return ret;
+   if (c-strength.stat[0].scale == FE_SCALE_NOT_AVAILABLE) {
+   *_signal_strength = 0;
+   return 0;
+   }
+
+   gain = c-strength.stat[0].svalue;
 
/* Calculate the signal strength based on the total gain of the tuner */
if (gain  -85000)
@@ -439,7 +482,7 @@ static int ts2020_read_signal_strength(struct dvb_frontend 
*fe,
/* 90% - 99%: strong signal */
strength = 90 + (45000 + gain) / 5000;
 
-   *signal_strength = strength * 65535 / 100;
+   *_signal_strength = strength * 65535 / 100;
return 0;
 }
 
@@ -546,6 +589,7 @@ static int ts2020_probe(struct 

[PATCH v2] staging: media: omap4iss: Reformat overly long lines

2015-05-26 Thread Piotr S. Staszewski
This reformats lines that were previously above 80 characters long,
improving readability and making checkpatch.pl happier.

Signed-off-by: Piotr S. Staszewski p.staszew...@gmail.com
---
 drivers/staging/media/omap4iss/iss_csi2.c| 18 +++--
 drivers/staging/media/omap4iss/iss_ipipe.c   | 30 ++--
 drivers/staging/media/omap4iss/iss_ipipeif.c | 10 ++
 drivers/staging/media/omap4iss/iss_resizer.c |  8 +---
 4 files changed, 42 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/media/omap4iss/iss_csi2.c 
b/drivers/staging/media/omap4iss/iss_csi2.c
index d7ff769..bc83f82 100644
--- a/drivers/staging/media/omap4iss/iss_csi2.c
+++ b/drivers/staging/media/omap4iss/iss_csi2.c
@@ -828,8 +828,10 @@ static const struct iss_video_operations csi2_issvideo_ops 
= {
  */
 
 static struct v4l2_mbus_framefmt *
-__csi2_get_format(struct iss_csi2_device *csi2, struct v4l2_subdev_pad_config 
*cfg,
- unsigned int pad, enum v4l2_subdev_format_whence which)
+__csi2_get_format(struct iss_csi2_device *csi2,
+ struct v4l2_subdev_pad_config *cfg,
+ unsigned int pad,
+ enum v4l2_subdev_format_whence which)
 {
if (which == V4L2_SUBDEV_FORMAT_TRY)
return v4l2_subdev_get_try_format(csi2-subdev, cfg, pad);
@@ -838,8 +840,10 @@ __csi2_get_format(struct iss_csi2_device *csi2, struct 
v4l2_subdev_pad_config *c
 }
 
 static void
-csi2_try_format(struct iss_csi2_device *csi2, struct v4l2_subdev_pad_config 
*cfg,
-   unsigned int pad, struct v4l2_mbus_framefmt *fmt,
+csi2_try_format(struct iss_csi2_device *csi2,
+   struct v4l2_subdev_pad_config *cfg,
+   unsigned int pad,
+   struct v4l2_mbus_framefmt *fmt,
enum v4l2_subdev_format_whence which)
 {
u32 pixelcode;
@@ -967,7 +971,8 @@ static int csi2_enum_frame_size(struct v4l2_subdev *sd,
  * @fmt: pointer to v4l2 subdev format structure
  * return -EINVAL or zero on success
  */
-static int csi2_get_format(struct v4l2_subdev *sd, struct 
v4l2_subdev_pad_config *cfg,
+static int csi2_get_format(struct v4l2_subdev *sd,
+  struct v4l2_subdev_pad_config *cfg,
   struct v4l2_subdev_format *fmt)
 {
struct iss_csi2_device *csi2 = v4l2_get_subdevdata(sd);
@@ -988,7 +993,8 @@ static int csi2_get_format(struct v4l2_subdev *sd, struct 
v4l2_subdev_pad_config
  * @fmt: pointer to v4l2 subdev format structure
  * return -EINVAL or zero on success
  */
-static int csi2_set_format(struct v4l2_subdev *sd, struct 
v4l2_subdev_pad_config *cfg,
+static int csi2_set_format(struct v4l2_subdev *sd,
+  struct v4l2_subdev_pad_config *cfg,
   struct v4l2_subdev_format *fmt)
 {
struct iss_csi2_device *csi2 = v4l2_get_subdevdata(sd);
diff --git a/drivers/staging/media/omap4iss/iss_ipipe.c 
b/drivers/staging/media/omap4iss/iss_ipipe.c
index eaa82da..f94a592 100644
--- a/drivers/staging/media/omap4iss/iss_ipipe.c
+++ b/drivers/staging/media/omap4iss/iss_ipipe.c
@@ -24,8 +24,10 @@
 #include iss_ipipe.h
 
 static struct v4l2_mbus_framefmt *
-__ipipe_get_format(struct iss_ipipe_device *ipipe, struct 
v4l2_subdev_pad_config *cfg,
- unsigned int pad, enum v4l2_subdev_format_whence which);
+__ipipe_get_format(struct iss_ipipe_device *ipipe,
+  struct v4l2_subdev_pad_config *cfg,
+  unsigned int pad,
+  enum v4l2_subdev_format_whence which);
 
 static const unsigned int ipipe_fmts[] = {
MEDIA_BUS_FMT_SGRBG10_1X10,
@@ -176,8 +178,10 @@ static int ipipe_set_stream(struct v4l2_subdev *sd, int 
enable)
 }
 
 static struct v4l2_mbus_framefmt *
-__ipipe_get_format(struct iss_ipipe_device *ipipe, struct 
v4l2_subdev_pad_config *cfg,
- unsigned int pad, enum v4l2_subdev_format_whence which)
+__ipipe_get_format(struct iss_ipipe_device *ipipe,
+  struct v4l2_subdev_pad_config *cfg,
+  unsigned int pad,
+  enum v4l2_subdev_format_whence which)
 {
if (which == V4L2_SUBDEV_FORMAT_TRY)
return v4l2_subdev_get_try_format(ipipe-subdev, cfg, pad);
@@ -193,9 +197,11 @@ __ipipe_get_format(struct iss_ipipe_device *ipipe, struct 
v4l2_subdev_pad_config
  * @fmt: Format
  */
 static void
-ipipe_try_format(struct iss_ipipe_device *ipipe, struct v4l2_subdev_pad_config 
*cfg,
-   unsigned int pad, struct v4l2_mbus_framefmt *fmt,
-   enum v4l2_subdev_format_whence which)
+ipipe_try_format(struct iss_ipipe_device *ipipe,
+struct v4l2_subdev_pad_config *cfg,
+unsigned int pad,
+struct v4l2_mbus_framefmt *fmt,
+enum v4l2_subdev_format_whence which)
 {
struct v4l2_mbus_framefmt *format;
unsigned int width = fmt-width;
@@ -306,8 +312,9 @@ static int 

Re: [PATCH 3/4] cx24120: Take control of b2c2 receive stream

2015-05-26 Thread Patrick Boettcher
Hi Jemma,

On Fri, 22 May 2015 21:28:27 +0100 Jemma Denson jden...@gmail.com
wrote:

 Now that b2c2 has an option to allow us to do so, turn off the
 flexcop receive stream when we turn off mpeg output whilst tuning.

Does this not fix (and your '[PATCH 2/4]') the problem of receiving
PAT from the previously tuned transport-stream?

Then patch 1 and 4 should not be necessary, should they?!

--
Patrick.



--
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: [PATCHv3 1/4] phy: phy-core: Make GENERIC_PHY an invisible option

2015-05-26 Thread Felipe Balbi
HI,

On Mon, May 25, 2015 at 02:19:58PM -0700, Arun Ramamurthy wrote:
 
 
 On 15-05-14 05:52 PM, Felipe Balbi wrote:
 Hi,
 
 On Wed, Apr 22, 2015 at 04:04:10PM -0700, Arun Ramamurthy wrote:
 Most of the phy providers use select to enable GENERIC_PHY. Since select
 is only recommended when the config is not visible, GENERIC_PHY is changed
 an invisible option. To maintain consistency, all phy providers are changed
 to select GENERIC_PHY and all non-phy drivers use depends on when the
 phy framework is explicity required. USB_MUSB_OMAP2PLUS has a cyclic
 dependency, so it is left as select.
 
 Signed-off-by: Arun Ramamurthy arun.ramamur...@broadcom.com
 ---
   drivers/ata/Kconfig   | 1 -
   drivers/media/platform/exynos4-is/Kconfig | 2 +-
   drivers/phy/Kconfig   | 4 ++--
   drivers/usb/host/Kconfig  | 4 ++--
   drivers/video/fbdev/exynos/Kconfig| 2 +-
   5 files changed, 6 insertions(+), 7 deletions(-)
 
 diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
 index 5f60155..6d2e881 100644
 --- a/drivers/ata/Kconfig
 +++ b/drivers/ata/Kconfig
 @@ -301,7 +301,6 @@ config SATA_MV
 tristate Marvell SATA support
 depends on PCI || ARCH_DOVE || ARCH_MV78XX0 || \
ARCH_MVEBU || ARCH_ORION5X || COMPILE_TEST
 -   select GENERIC_PHY
 help
   This option enables support for the Marvell Serial ATA family.
   Currently supports 88SX[56]0[48][01] PCI(-X) chips,
 diff --git a/drivers/media/platform/exynos4-is/Kconfig 
 b/drivers/media/platform/exynos4-is/Kconfig
 index b7b2e47..b6f3eaa 100644
 --- a/drivers/media/platform/exynos4-is/Kconfig
 +++ b/drivers/media/platform/exynos4-is/Kconfig
 @@ -31,7 +31,7 @@ config VIDEO_S5P_FIMC
   config VIDEO_S5P_MIPI_CSIS
 tristate S5P/EXYNOS MIPI-CSI2 receiver (MIPI-CSIS) driver
 depends on REGULATOR
 -   select GENERIC_PHY
 +   depends on GENERIC_PHY
 help
   This is a V4L2 driver for Samsung S5P and EXYNOS4 SoC MIPI-CSI2
   receiver (MIPI-CSIS) devices.
 diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
 index 2962de2..edecdb1 100644
 --- a/drivers/phy/Kconfig
 +++ b/drivers/phy/Kconfig
 @@ -5,7 +5,7 @@
   menu PHY Subsystem
 
   config GENERIC_PHY
 -   bool PHY Core
 +   bool
 help
   Generic PHY support.
 
 @@ -72,7 +72,7 @@ config PHY_MIPHY365X
   config PHY_RCAR_GEN2
 tristate Renesas R-Car generation 2 USB PHY driver
 depends on ARCH_SHMOBILE
 -   depends on GENERIC_PHY
 +   select GENERIC_PHY
 
 so some you changed from depends to select...
 
 help
   Support for USB PHY found on Renesas R-Car generation 2 SoCs.
 
 diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
 index 5ad60e4..e2197e2 100644
 --- a/drivers/usb/host/Kconfig
 +++ b/drivers/usb/host/Kconfig
 @@ -182,7 +182,7 @@ config USB_EHCI_HCD_SPEAR
   config USB_EHCI_HCD_STI
 tristate Support for ST STiHxxx on-chip EHCI USB controller
 depends on ARCH_STI  OF
 -   select GENERIC_PHY
 +   depends on GENERIC_PHY
 
 while others you changed from select to depends.
 
 NAK.
 
 Felipe, I dont understand your concern, could you please explain it more
 detail?  The logic behind the changes is that in cases where there was an
 explicit dependency, I changed it to depends on and in other cases I
 changed it to selects. Thanks

Since GENERIC_PHY is visible from Kconfig, it would be much nicer to
avoid select altogether.

-- 
balbi


signature.asc
Description: Digital signature


[PATCH v5 2/3] media: atmel-isi: add runtime pm support

2015-05-26 Thread Josh Wu
The runtime pm resume/suspend will enable/disable pclk (ISI peripheral
clock).
And we need to call runtime_pm_get_sync()/runtime_pm_put() when we need
access ISI registers. In atmel_isi_probe(), remove the isi disable code
as in the moment ISI peripheral clock is not enable yet.

In the meantime, as clock_start()/clock_stop() is used to control the
mclk not ISI peripheral clock. So move this to start[stop]_streaming()
function.

Signed-off-by: Josh Wu josh...@atmel.com
---

Changes in v5:
- fix the error path in start_streaming() thanks to Laurent.

Changes in v4:
- need to call pm_runtime_disable() in atmel_isi_remove().
- merged the patch which remove isi disable code in atmel_isi_probe() as
  isi peripherial clock is not enabled in this moment.
- refine the commit log

Changes in v3: None
Changes in v2:
- merged v1 two patch into one.
- use runtime_pm_put() instead of runtime_pm_put_sync()
- enable peripheral clock before access ISI registers.

 drivers/media/platform/soc_camera/atmel-isi.c | 55 +++
 1 file changed, 47 insertions(+), 8 deletions(-)

diff --git a/drivers/media/platform/soc_camera/atmel-isi.c 
b/drivers/media/platform/soc_camera/atmel-isi.c
index 2227022..0ea360a 100644
--- a/drivers/media/platform/soc_camera/atmel-isi.c
+++ b/drivers/media/platform/soc_camera/atmel-isi.c
@@ -20,6 +20,7 @@
 #include linux/kernel.h
 #include linux/module.h
 #include linux/platform_device.h
+#include linux/pm_runtime.h
 #include linux/slab.h
 
 #include media/atmel-isi.h
@@ -386,10 +387,13 @@ static int start_streaming(struct vb2_queue *vq, unsigned 
int count)
struct atmel_isi *isi = ici-priv;
int ret;
 
+   pm_runtime_get_sync(ici-v4l2_dev.dev);
+
/* Reset ISI */
ret = atmel_isi_wait_status(isi, WAIT_ISI_RESET);
if (ret  0) {
dev_err(icd-parent, Reset ISI timed out\n);
+   pm_runtime_put(ici-v4l2_dev.dev);
return ret;
}
/* Disable all interrupts */
@@ -443,6 +447,8 @@ static void stop_streaming(struct vb2_queue *vq)
ret = atmel_isi_wait_status(isi, WAIT_ISI_DISABLE);
if (ret  0)
dev_err(icd-parent, Disable ISI timed out\n);
+
+   pm_runtime_put(ici-v4l2_dev.dev);
 }
 
 static struct vb2_ops isi_video_qops = {
@@ -514,7 +520,13 @@ static int isi_camera_set_fmt(struct soc_camera_device 
*icd,
if (mf-code != xlate-code)
return -EINVAL;
 
+   /* Enable PM and peripheral clock before operate isi registers */
+   pm_runtime_get_sync(ici-v4l2_dev.dev);
+
ret = configure_geometry(isi, pix-width, pix-height, xlate-code);
+
+   pm_runtime_put(ici-v4l2_dev.dev);
+
if (ret  0)
return ret;
 
@@ -734,14 +746,9 @@ static int isi_camera_clock_start(struct soc_camera_host 
*ici)
struct atmel_isi *isi = ici-priv;
int ret;
 
-   ret = clk_prepare_enable(isi-pclk);
-   if (ret)
-   return ret;
-
if (!IS_ERR(isi-mck)) {
ret = clk_prepare_enable(isi-mck);
if (ret) {
-   clk_disable_unprepare(isi-pclk);
return ret;
}
}
@@ -756,7 +763,6 @@ static void isi_camera_clock_stop(struct soc_camera_host 
*ici)
 
if (!IS_ERR(isi-mck))
clk_disable_unprepare(isi-mck);
-   clk_disable_unprepare(isi-pclk);
 }
 
 static unsigned int isi_camera_poll(struct file *file, poll_table *pt)
@@ -853,9 +859,14 @@ static int isi_camera_set_bus_param(struct 
soc_camera_device *icd)
 
cfg1 |= ISI_CFG1_THMASK_BEATS_16;
 
+   /* Enable PM and peripheral clock before operate isi registers */
+   pm_runtime_get_sync(ici-v4l2_dev.dev);
+
isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS);
isi_writel(isi, ISI_CFG1, cfg1);
 
+   pm_runtime_put(ici-v4l2_dev.dev);
+
return 0;
 }
 
@@ -887,6 +898,7 @@ static int atmel_isi_remove(struct platform_device *pdev)
sizeof(struct fbd) * MAX_BUFFER_NUM,
isi-p_fb_descriptors,
isi-fb_descriptors_phys);
+   pm_runtime_disable(pdev-dev);
 
return 0;
 }
@@ -1025,8 +1037,6 @@ static int atmel_isi_probe(struct platform_device *pdev)
if (isi-pdata.data_width_flags  ISI_DATAWIDTH_10)
isi-width_flags |= 1  9;
 
-   isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS);
-
irq = platform_get_irq(pdev, 0);
if (IS_ERR_VALUE(irq)) {
ret = irq;
@@ -1047,6 +1057,9 @@ static int atmel_isi_probe(struct platform_device *pdev)
soc_host-v4l2_dev.dev  = pdev-dev;
soc_host-nr= pdev-id;
 
+   pm_suspend_ignore_children(pdev-dev, true);
+   pm_runtime_enable(pdev-dev);
+
if (isi-pdata.asd_sizes) {
soc_host-asd = isi-pdata.asd;
soc_host-asd_sizes = isi-pdata.asd_sizes;
@@ -1060,6 +1073,7 @@ static int 

Re: [PATCH 03/13] serial: 8250_dma: Support for deferred probing when requesting DMA channels

2015-05-26 Thread Tony Lindgren
* Peter Ujfalusi peter.ujfal...@ti.com [150526 06:28]:
 Switch to use ma_request_slave_channel_compat_reason() to request the DMA
 channels. In case of error, return the error code we received including
 -EPROBE_DEFER
 
 Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
 CC: Greg Kroah-Hartman gre...@linuxfoundation.org
 ---
  drivers/tty/serial/8250/8250_dma.c | 18 --
  1 file changed, 8 insertions(+), 10 deletions(-)
 
 diff --git a/drivers/tty/serial/8250/8250_dma.c 
 b/drivers/tty/serial/8250/8250_dma.c
 index 21d01a491405..a617eca4e97d 100644
 --- a/drivers/tty/serial/8250/8250_dma.c
 +++ b/drivers/tty/serial/8250/8250_dma.c
 @@ -182,21 +182,19 @@ int serial8250_request_dma(struct uart_8250_port *p)
   dma_cap_set(DMA_SLAVE, mask);
  
   /* Get a channel for RX */
 - dma-rxchan = dma_request_slave_channel_compat(mask,
 -dma-fn, dma-rx_param,
 -p-port.dev, rx);
 - if (!dma-rxchan)
 - return -ENODEV;
 + dma-rxchan = dma_request_slave_channel_compat_reason(mask, dma-fn,
 + dma-rx_param, p-port.dev, rx);
 + if (IS_ERR(dma-rxchan))
 + return PTR_ERR(dma-rxchan);
  
   dmaengine_slave_config(dma-rxchan, dma-rxconf);
  
   /* Get a channel for TX */
 - dma-txchan = dma_request_slave_channel_compat(mask,
 -dma-fn, dma-tx_param,
 -p-port.dev, tx);
 - if (!dma-txchan) {
 + dma-txchan = dma_request_slave_channel_compat_reason(mask, dma-fn,
 + dma-tx_param, p-port.dev, tx);
 + if (IS_ERR(dma-txchan)) {
   dma_release_channel(dma-rxchan);
 - return -ENODEV;
 + return PTR_ERR(dma-txchan);
   }
  
   dmaengine_slave_config(dma-txchan, dma-txconf);

In general the drivers need to work just fine also without DMA.

Does this handle the case properly where no DMA channel is configured
for the driver in the dts file?

Regards,

Tony
--
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 00/13] dmaengine + omap drivers: support fro deferred probing

2015-05-26 Thread Peter Ujfalusi
Hi,

Vinod: as I promised: https://lkml.org/lkml/2015/5/8/80

With this series it is possible to put omap-dma or edma to even late_initcall
and the drivers will figure out the load order fine(ish).
We need to add dma_request_slave_channel_compat_reason() which is the equivalent
of dma_request_slave_channel_compat() but returning with error codes in case of
failure instead of NULL pointer.
The rest of the series just converts the OMAP/daVinci drivers to use this new
function to get the channel(s) and to handle the deferred probing.

I did not moved the omap-dma, edma or ti-dma-crossbar from arch_initcall. If I
do so UART will only comes up after the DMA driver is loaded since we are using,
or going to use 8250 with DAM support. This delays the kernel messages. Other
issue is the MMC/SD cards. On  board with eMMC and SD card slot the mmcblk0/1
might get swapped due to different probe order for the MMC/SD drivers. For
example in omap5-uevm:
1. omap-dma in arch_initcall the SD card is mmcblk1 (4809c000.mmc) and eMMC is
mmcblk0 (480b4000.mmc)
2. omap-dma in late_initcall the SD card is mmcblk0 (4809c000.mmc) and eMMC is
mmcblk1 (480b4000.mmc)

Because in case 1 the 4809c000.mmc got deferred by missing regulator so
480b4000.mmc got registered first. In case 2 both deferring because of DMA and
at the end 4809c000.mmc get registered first. So far I have not found a way to
bind mmcblk0/1 to a specific node...

Regards,
Peter
---
Peter Ujfalusi (13):
  dmaengine: of_dma: Correct return code for
of_dma_request_slave_channel in case !CONFIG_OF
  dmaengine: Introduce dma_request_slave_channel_compat_reason()
  serial: 8250_dma: Support for deferred probing when requesting DMA
channels
  mmc: omap_hsmmc: No need to check DMA channel validity at module
remove
  mmc: omap_hsmmc: Support for deferred probing when requesting DMA
channels
  mmc: omap: Support for deferred probing when requesting DMA channels
  mmc: davinci_mmc: Support for deferred probing when requesting DMA
channels
  crypto: omap-aes - Support for deferred probing when requesting DMA
channels
  crypto: omap-des - Support for deferred probing when requesting DMA
channels
  crypto: omap-sham - Support for deferred probing when requesting DMA
channel
  spi: omap2-mcspi: Support for deferred probing when requesting DMA
channels
  [media] omap3isp: Support for deferred probing when requesting DMA
channel
  ASoC: omap-pcm: Switch to use
dma_request_slave_channel_compat_reason()

 drivers/crypto/omap-aes.c | 38 ---
 drivers/crypto/omap-des.c | 38 ---
 drivers/crypto/omap-sham.c| 15 
 drivers/media/platform/omap3isp/isphist.c | 12 +++---
 drivers/mmc/host/davinci_mmc.c| 26 -
 drivers/mmc/host/omap.c   | 20 
 drivers/mmc/host/omap_hsmmc.c | 28 ++-
 drivers/spi/spi-omap2-mcspi.c | 36 +
 drivers/tty/serial/8250/8250_dma.c| 18 +++
 include/linux/dmaengine.h | 22 ++
 include/linux/of_dma.h|  2 +-
 sound/soc/omap/omap-pcm.c | 16 -
 12 files changed, 164 insertions(+), 107 deletions(-)

-- 
2.3.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 03/13] serial: 8250_dma: Support for deferred probing when requesting DMA channels

2015-05-26 Thread Greg Kroah-Hartman
On Tue, May 26, 2015 at 04:25:58PM +0300, Peter Ujfalusi wrote:
 Switch to use ma_request_slave_channel_compat_reason() to request the DMA
 channels. In case of error, return the error code we received including
 -EPROBE_DEFER

I think you typed the function name wrong here :(

--
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 11/13] spi: omap2-mcspi: Support for deferred probing when requesting DMA channels

2015-05-26 Thread Mark Brown
On Tue, May 26, 2015 at 04:26:06PM +0300, Peter Ujfalusi wrote:

 Switch to use ma_request_slave_channel_compat_reason() to request the DMA
 channels. Only fall back to pio mode if the error code returned is not
 -EPROBE_DEFER, otherwise return from the probe with the -EPROBE_DEFER.

I've got two patches from a patch series here with no cover letter...
I'm guessing there's no interdependencies or anything?  Please always
ensure that when sending a patch series everyone getting the patches can
tell what the series as a whole looks like (if there's no dependencies
consider posting as individual patches rather than a series).


signature.asc
Description: Digital signature


[PATCH] media: davinci: vpbe: use v4l2_get_timestamp()

2015-05-26 Thread Lad Prabhakar
From: Lad, Prabhakar prabhakar.cse...@gmail.com

this patch makes use of helper function v4l2_get_timestamp()
to set the timestamp of vb2 buffer.

Signed-off-by: Lad, Prabhakar prabhakar.cse...@gmail.com
---
 drivers/media/platform/davinci/vpbe_display.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/media/platform/davinci/vpbe_display.c 
b/drivers/media/platform/davinci/vpbe_display.c
index c4ab46f..f69cdd7 100644
--- a/drivers/media/platform/davinci/vpbe_display.c
+++ b/drivers/media/platform/davinci/vpbe_display.c
@@ -71,15 +71,10 @@ static int venc_is_second_field(struct vpbe_display 
*disp_dev)
 static void vpbe_isr_even_field(struct vpbe_display *disp_obj,
struct vpbe_layer *layer)
 {
-   struct timespec timevalue;
-
if (layer-cur_frm == layer-next_frm)
return;
-   ktime_get_ts(timevalue);
-   layer-cur_frm-vb.v4l2_buf.timestamp.tv_sec =
-   timevalue.tv_sec;
-   layer-cur_frm-vb.v4l2_buf.timestamp.tv_usec =
-   timevalue.tv_nsec / NSEC_PER_USEC;
+
+   v4l2_get_timestamp(layer-cur_frm-vb.v4l2_buf.timestamp);
vb2_buffer_done(layer-cur_frm-vb, VB2_BUF_STATE_DONE);
/* Make cur_frm pointing to next_frm */
layer-cur_frm = layer-next_frm;
-- 
2.1.0

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


DVB-T2 PCIe vs DVB-S2

2015-05-26 Thread Ian Campbell
Hello,

I'm looking to get a DVB-T2 tuner card to add UK Freeview HD to my
mythtv box.

Looking at http://linuxtv.org/wiki/index.php/DVB-T2_PCIe_Cards is seems
that many (the majority even) of the cards there are actually DVB-S2.

Is this a mistake or is there something I don't know (like maybe S2 is
compatible with T2)?

Thanks,
Ian.

--
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 07/12] trivial: [media] cx25821: cx25821-medusa-reg.h: fix 0x0x prefix

2015-05-26 Thread Jiri Kosina
On Tue, 28 Apr 2015, Antonio Ospite wrote:

 Fix the 0x0x prefix in integer constants.
 
 In this case a padding 0 must also be inserted to make the constants
 look like all the other 16 bits ones.
 
 Signed-off-by: Antonio Ospite a...@ao2.it
 Cc: Mauro Carvalho Chehab mche...@osg.samsung.com
 Cc: linux-media@vger.kernel.org

Doesn't seem to be in linux-next as of today. I am picking it up.

 ---
  drivers/media/pci/cx25821/cx25821-medusa-reg.h | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
 
 diff --git a/drivers/media/pci/cx25821/cx25821-medusa-reg.h 
 b/drivers/media/pci/cx25821/cx25821-medusa-reg.h
 index c98ac94..2e10643 100644
 --- a/drivers/media/pci/cx25821/cx25821-medusa-reg.h
 +++ b/drivers/media/pci/cx25821/cx25821-medusa-reg.h
 @@ -84,9 +84,9 @@
  #define  ABIST_BIN4_VGA3 0x01D4
  #define  ABIST_BIN5_VGA4 0x01D8
  #define  ABIST_BIN6_VGA5 0x01DC
 -#define  ABIST_BIN7_VGA6 0x0x1E0
 -#define  ABIST_CLAMP_A   0x0x1E4
 -#define  ABIST_CLAMP_B   0x0x1E8
 +#define  ABIST_BIN7_VGA6 0x01E0
 +#define  ABIST_CLAMP_A   0x01E4
 +#define  ABIST_CLAMP_B   0x01E8
  #define  ABIST_CLAMP_C   0x01EC
  #define  ABIST_CLAMP_D   0x01F0
  #define  ABIST_CLAMP_E   0x01F4
 -- 
 2.1.4
 

-- 
Jiri Kosina
SUSE Labs
--
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 10/13] crypto: omap-sham - Support for deferred probing when requesting DMA channel

2015-05-26 Thread Peter Ujfalusi
Switch to use ma_request_slave_channel_compat_reason() to request the DMA
channel. Only fall back to polling mode if the error code returned is not
-EPROBE_DEFER, otherwise return from the probe with the -EPROBE_DEFER.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
CC: Herbert Xu herb...@gondor.apana.org.au
CC: David S. Miller da...@davemloft.net
CC: Lokesh Vutla lokeshvu...@ti.com
---
 drivers/crypto/omap-sham.c | 15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c
index b2024c95a3cf..66bae8288741 100644
--- a/drivers/crypto/omap-sham.c
+++ b/drivers/crypto/omap-sham.c
@@ -1946,9 +1946,14 @@ static int omap_sham_probe(struct platform_device *pdev)
dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask);
 
-   dd-dma_lch = dma_request_slave_channel_compat(mask, omap_dma_filter_fn,
-  dd-dma, dev, rx);
-   if (!dd-dma_lch) {
+   dd-dma_lch = dma_request_slave_channel_compat_reason(mask,
+   omap_dma_filter_fn,
+   dd-dma, dev, rx);
+   if (IS_ERR(dd-dma_lch)) {
+   err = PTR_ERR(dd-dma_lch);
+   if (err == -EPROBE_DEFER)
+   goto data_err;
+
dd-polling_mode = 1;
dev_dbg(dev, using polling mode instead of dma\n);
}
@@ -1995,7 +2000,7 @@ err_algs:
dd-pdata-algs_info[i].algs_list[j]);
 err_pm:
pm_runtime_disable(dev);
-   if (dd-dma_lch)
+   if (!dd-polling_mode)
dma_release_channel(dd-dma_lch);
 data_err:
dev_err(dev, initialization failed.\n);
@@ -2021,7 +2026,7 @@ static int omap_sham_remove(struct platform_device *pdev)
tasklet_kill(dd-done_task);
pm_runtime_disable(pdev-dev);
 
-   if (dd-dma_lch)
+   if (!dd-polling_mode)
dma_release_channel(dd-dma_lch);
 
return 0;
-- 
2.3.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 08/13] crypto: omap-aes - Support for deferred probing when requesting DMA channels

2015-05-26 Thread Peter Ujfalusi
Switch to use ma_request_slave_channel_compat_reason() to request the DMA
channels. Only fall back to pio mode if the error code returned is not
-EPROBE_DEFER, otherwise return from the probe with the -EPROBE_DEFER.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
CC: Herbert Xu herb...@gondor.apana.org.au
CC: David S. Miller da...@davemloft.net
CC: Lokesh Vutla lokeshvu...@ti.com
---
 drivers/crypto/omap-aes.c | 38 --
 1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c
index 9a28b7e07c71..699a14509adb 100644
--- a/drivers/crypto/omap-aes.c
+++ b/drivers/crypto/omap-aes.c
@@ -356,7 +356,7 @@ static void omap_aes_dma_out_callback(void *data)
 
 static int omap_aes_dma_init(struct omap_aes_dev *dd)
 {
-   int err = -ENOMEM;
+   int err;
dma_cap_mask_t mask;
 
dd-dma_lch_out = NULL;
@@ -365,21 +365,20 @@ static int omap_aes_dma_init(struct omap_aes_dev *dd)
dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask);
 
-   dd-dma_lch_in = dma_request_slave_channel_compat(mask,
- omap_dma_filter_fn,
- dd-dma_in,
- dd-dev, rx);
-   if (!dd-dma_lch_in) {
+   dd-dma_lch_in = dma_request_slave_channel_compat_reason(mask,
+   omap_dma_filter_fn, dd-dma_in,
+   dd-dev, rx);
+   if (IS_ERR(dd-dma_lch_in)) {
dev_err(dd-dev, Unable to request in DMA channel\n);
-   goto err_dma_in;
+   return PTR_ERR(dd-dma_lch_in);
}
 
-   dd-dma_lch_out = dma_request_slave_channel_compat(mask,
-  omap_dma_filter_fn,
-  dd-dma_out,
-  dd-dev, tx);
-   if (!dd-dma_lch_out) {
+   dd-dma_lch_out = dma_request_slave_channel_compat_reason(mask,
+   omap_dma_filter_fn, dd-dma_out,
+   dd-dev, tx);
+   if (IS_ERR(dd-dma_lch_out)) {
dev_err(dd-dev, Unable to request out DMA channel\n);
+   err = PTR_ERR(dd-dma_lch_out);
goto err_dma_out;
}
 
@@ -387,14 +386,15 @@ static int omap_aes_dma_init(struct omap_aes_dev *dd)
 
 err_dma_out:
dma_release_channel(dd-dma_lch_in);
-err_dma_in:
-   if (err)
-   pr_err(error: %d\n, err);
+
return err;
 }
 
 static void omap_aes_dma_cleanup(struct omap_aes_dev *dd)
 {
+   if (dd-pio_only)
+   return;
+
dma_release_channel(dd-dma_lch_out);
dma_release_channel(dd-dma_lch_in);
 }
@@ -1218,7 +1218,9 @@ static int omap_aes_probe(struct platform_device *pdev)
tasklet_init(dd-queue_task, omap_aes_queue_task, (unsigned long)dd);
 
err = omap_aes_dma_init(dd);
-   if (err  AES_REG_IRQ_STATUS(dd)  AES_REG_IRQ_ENABLE(dd)) {
+   if (err == -EPROBE_DEFER) {
+   goto err_irq;
+   } else if (err  AES_REG_IRQ_STATUS(dd)  AES_REG_IRQ_ENABLE(dd)) {
dd-pio_only = 1;
 
irq = platform_get_irq(pdev, 0);
@@ -1262,8 +1264,8 @@ err_algs:
for (j = dd-pdata-algs_info[i].registered - 1; j = 0; j--)
crypto_unregister_alg(
dd-pdata-algs_info[i].algs_list[j]);
-   if (!dd-pio_only)
-   omap_aes_dma_cleanup(dd);
+
+   omap_aes_dma_cleanup(dd);
 err_irq:
tasklet_kill(dd-done_task);
tasklet_kill(dd-queue_task);
-- 
2.3.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 11/13] spi: omap2-mcspi: Support for deferred probing when requesting DMA channels

2015-05-26 Thread Peter Ujfalusi
Switch to use ma_request_slave_channel_compat_reason() to request the DMA
channels. Only fall back to pio mode if the error code returned is not
-EPROBE_DEFER, otherwise return from the probe with the -EPROBE_DEFER.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
CC: Mark Brown broo...@kernel.org
---
 drivers/spi/spi-omap2-mcspi.c | 36 +---
 1 file changed, 21 insertions(+), 15 deletions(-)

diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index a7d85c5ab2fa..e6ff937688ff 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -948,6 +948,7 @@ static int omap2_mcspi_request_dma(struct spi_device *spi)
struct omap2_mcspi_dma  *mcspi_dma;
dma_cap_mask_t mask;
unsigned sig;
+   int ret = 0;
 
mcspi = spi_master_get_devdata(master);
mcspi_dma = mcspi-dma_channels + spi-chip_select;
@@ -959,30 +960,35 @@ static int omap2_mcspi_request_dma(struct spi_device *spi)
dma_cap_set(DMA_SLAVE, mask);
sig = mcspi_dma-dma_rx_sync_dev;
 
-   mcspi_dma-dma_rx =
-   dma_request_slave_channel_compat(mask, omap_dma_filter_fn,
-sig, master-dev,
-mcspi_dma-dma_rx_ch_name);
-   if (!mcspi_dma-dma_rx)
+   mcspi_dma-dma_rx = dma_request_slave_channel_compat_reason(mask,
+   omap_dma_filter_fn, sig, master-dev,
+   mcspi_dma-dma_rx_ch_name);
+   if (IS_ERR(mcspi_dma-dma_rx)) {
+   ret = PTR_ERR(mcspi_dma-dma_rx);
+   mcspi_dma-dma_rx = NULL;
+   if (ret != -EPROBE_DEFER)
+   ret = -EAGAIN;
goto no_dma;
+   }
 
sig = mcspi_dma-dma_tx_sync_dev;
-   mcspi_dma-dma_tx =
-   dma_request_slave_channel_compat(mask, omap_dma_filter_fn,
-sig, master-dev,
-mcspi_dma-dma_tx_ch_name);
+   mcspi_dma-dma_tx = dma_request_slave_channel_compat_reason(mask,
+   omap_dma_filter_fn, sig, master-dev,
+   mcspi_dma-dma_tx_ch_name);
 
-   if (!mcspi_dma-dma_tx) {
+   if (IS_ERR(mcspi_dma-dma_tx)) {
+   ret = PTR_ERR(mcspi_dma-dma_tx);
+   mcspi_dma-dma_tx = NULL;
dma_release_channel(mcspi_dma-dma_rx);
mcspi_dma-dma_rx = NULL;
-   goto no_dma;
+   if (ret != -EPROBE_DEFER)
+   ret = -EAGAIN;
}
 
-   return 0;
-
 no_dma:
-   dev_warn(spi-dev, not using DMA for McSPI\n);
-   return -EAGAIN;
+   if (ret  ret != -EPROBE_DEFER)
+   dev_warn(spi-dev, not using DMA for McSPI\n);
+   return ret;
 }
 
 static int omap2_mcspi_setup(struct spi_device *spi)
-- 
2.3.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 12/13] [media] omap3isp: Support for deferred probing when requesting DMA channel

2015-05-26 Thread Peter Ujfalusi
Switch to use ma_request_slave_channel_compat_reason() to request the DMA
channel. Only fall back to pio mode if the error code returned is not
-EPROBE_DEFER, otherwise return from the probe with the -EPROBE_DEFER.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
CC: Laurent Pinchart laurent.pinch...@ideasonboard.com
CC: Mauro Carvalho Chehab mche...@osg.samsung.com
---
 drivers/media/platform/omap3isp/isphist.c | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/omap3isp/isphist.c 
b/drivers/media/platform/omap3isp/isphist.c
index 7138b043a4aa..e690ca13af0e 100644
--- a/drivers/media/platform/omap3isp/isphist.c
+++ b/drivers/media/platform/omap3isp/isphist.c
@@ -499,14 +499,20 @@ int omap3isp_hist_init(struct isp_device *isp)
if (res)
sig = res-start;
 
-   hist-dma_ch = dma_request_slave_channel_compat(mask,
+   hist-dma_ch = dma_request_slave_channel_compat_reason(mask,
omap_dma_filter_fn, sig, isp-dev, hist);
-   if (!hist-dma_ch)
+   if (IS_ERR(hist-dma_ch)) {
+   ret = PTR_ERR(hist-dma_ch);
+   if (ret == -EPROBE_DEFER)
+   return ret;
+
+   hist-dma_ch = NULL;
dev_warn(isp-dev,
 hist: DMA channel request failed, using 
PIO\n);
-   else
+   } else {
dev_dbg(isp-dev, hist: using DMA channel %s\n,
dma_chan_name(hist-dma_ch));
+   }
}
 
hist-ops = hist_ops;
-- 
2.3.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 v9 8/8] exynos4-is: Add support for v4l2-flash subdevs

2015-05-26 Thread Sylwester Nawrocki
On 25/05/15 17:14, Jacek Anaszewski wrote:
 This patch adds support for external v4l2-flash devices.
 The support includes parsing camera-flashes DT property

samsung,camera-flashes ?

 and asynchronous sub-device registration.

 +static int fimc_md_register_flash_entities(struct fimc_md *fmd)
 +{
 + struct device_node *parent = fmd-pdev-dev.of_node, *np_sensor,
 + *np_flash;
 + struct v4l2_async_notifier *notifier = fmd-subdev_notifier;
 + struct v4l2_async_subdev *asd;
 + int i, j, num_flashes = 0, num_elems;
 +
 + num_elems = of_property_count_elems_of_size(parent,
 + samsung,camera-flashes, sizeof(np_flash));

I think this should be of_property_count_u32_elems(), phandle is always
a 32-bit value [1], while size of a pointer depends on the architecture.


 + /* samsung,camera-flashes property is optional */
 + if (num_elems  0)
 + return 0;
 +
 + /* samsung,camera-flashes array must have even number of elements */
 + if ((num_elems  1) || (num_elems  FIMC_MAX_SENSORS * 2))
 + return -EINVAL;
 +
 + for (i = 0; i  num_elems; i += 2) {
 + np_sensor = of_parse_phandle(parent,
 +  samsung,camera-flashes, i);
 +
 + for (j = 0; j  fmd-num_sensors; j++)
 + if (fmd-async_subdevs.sensors[j].match.of.node ==
 + np_sensor)
 + break;
 +
 + of_node_put(np_sensor);

Would be good to add some comment here, why is the sensor required.
It's just a DT correctness check? Couldn't we carry on with the flash
registration after just emitting some warning?

 + if (j == fmd-num_sensors)
 + continue;
 +
 + np_flash = of_parse_phandle(parent, samsung,camera-flashes,
 + i + 1);
 +
 + asd = fmd-async_subdevs.flashes[num_flashes++];
 + asd-match_type = V4L2_ASYNC_MATCH_OF;
 + asd-match.of.node = np_flash;
 + notifier-subdevs[notifier-num_subdevs++] = asd;
 +
 + of_node_put(np_flash);
 + }
 +
 + return 0;
 +}

Otherwise looks good to me.

-- 
Thanks,
Sylwester

[1]
http://lxr.free-electrons.com/source/Documentation/devicetree/booting-without-of.txt#L545

--
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 06/13] mmc: omap: Support for deferred probing when requesting DMA channels

2015-05-26 Thread Peter Ujfalusi
Switch to use ma_request_slave_channel_compat_reason() to request the DMA
channels. Only fall back to pio mode if the error code returned is not
-EPROBE_DEFER, otherwise return from the probe with the -EPROBE_DEFER.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
CC: Ulf Hansson ulf.hans...@linaro.org
CC: Jarkko Nikula jarkko.nik...@bitmer.com
---
 drivers/mmc/host/omap.c | 20 
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index 68dd6c79c378..29238d0fbc24 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -1390,20 +1390,32 @@ static int mmc_omap_probe(struct platform_device *pdev)
res = platform_get_resource_byname(pdev, IORESOURCE_DMA, tx);
if (res)
sig = res-start;
-   host-dma_tx = dma_request_slave_channel_compat(mask,
+   host-dma_tx = dma_request_slave_channel_compat_reason(mask,
omap_dma_filter_fn, sig, pdev-dev, tx);
-   if (!host-dma_tx)
+   if (IS_ERR(host-dma_tx)) {
+   ret = PTR_ERR(host-dma_tx);
+   if (ret == -EPROBE_DEFER)
+   goto err_free_dma;
+
+   host-dma_tx = NULL;
dev_warn(host-dev, unable to obtain TX DMA engine channel 
%u\n,
sig);
+   }
 
res = platform_get_resource_byname(pdev, IORESOURCE_DMA, rx);
if (res)
sig = res-start;
-   host-dma_rx = dma_request_slave_channel_compat(mask,
+   host-dma_rx = dma_request_slave_channel_compat_reason(mask,
omap_dma_filter_fn, sig, pdev-dev, rx);
-   if (!host-dma_rx)
+   if (IS_ERR(host-dma_rx)) {
+   ret = PTR_ERR(host-dma_rx);
+   if (ret == -EPROBE_DEFER)
+   goto err_free_dma;
+
+   host-dma_rx = NULL;
dev_warn(host-dev, unable to obtain RX DMA engine channel 
%u\n,
sig);
+   }
 
ret = request_irq(host-irq, mmc_omap_irq, 0, DRIVER_NAME, host);
if (ret)
-- 
2.3.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 03/13] serial: 8250_dma: Support for deferred probing when requesting DMA channels

2015-05-26 Thread Peter Ujfalusi
Switch to use ma_request_slave_channel_compat_reason() to request the DMA
channels. In case of error, return the error code we received including
-EPROBE_DEFER

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
CC: Greg Kroah-Hartman gre...@linuxfoundation.org
---
 drivers/tty/serial/8250/8250_dma.c | 18 --
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_dma.c 
b/drivers/tty/serial/8250/8250_dma.c
index 21d01a491405..a617eca4e97d 100644
--- a/drivers/tty/serial/8250/8250_dma.c
+++ b/drivers/tty/serial/8250/8250_dma.c
@@ -182,21 +182,19 @@ int serial8250_request_dma(struct uart_8250_port *p)
dma_cap_set(DMA_SLAVE, mask);
 
/* Get a channel for RX */
-   dma-rxchan = dma_request_slave_channel_compat(mask,
-  dma-fn, dma-rx_param,
-  p-port.dev, rx);
-   if (!dma-rxchan)
-   return -ENODEV;
+   dma-rxchan = dma_request_slave_channel_compat_reason(mask, dma-fn,
+   dma-rx_param, p-port.dev, rx);
+   if (IS_ERR(dma-rxchan))
+   return PTR_ERR(dma-rxchan);
 
dmaengine_slave_config(dma-rxchan, dma-rxconf);
 
/* Get a channel for TX */
-   dma-txchan = dma_request_slave_channel_compat(mask,
-  dma-fn, dma-tx_param,
-  p-port.dev, tx);
-   if (!dma-txchan) {
+   dma-txchan = dma_request_slave_channel_compat_reason(mask, dma-fn,
+   dma-tx_param, p-port.dev, tx);
+   if (IS_ERR(dma-txchan)) {
dma_release_channel(dma-rxchan);
-   return -ENODEV;
+   return PTR_ERR(dma-txchan);
}
 
dmaengine_slave_config(dma-txchan, dma-txconf);
-- 
2.3.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 13/13] ASoC: omap-pcm: Switch to use dma_request_slave_channel_compat_reason()

2015-05-26 Thread Peter Ujfalusi
dmaengine provides a wrapper function to handle DT and non DT boots when
requesting DMA channel. Use that instead of checking for of_node in the
platform driver.

Signed-off-by: Peter Ujfalusi peter.ujfal...@ti.com
CC: Mark Brown broo...@kernel.org
CC: Jarkko Nikula jarkko.nik...@bitmer.com
CC: Liam Girdwood lgirdw...@gmail.com
---
 sound/soc/omap/omap-pcm.c | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
index 52fd7cbbd1f4..ae04834f4697 100644
--- a/sound/soc/omap/omap-pcm.c
+++ b/sound/soc/omap/omap-pcm.c
@@ -132,6 +132,7 @@ static int omap_pcm_open(struct snd_pcm_substream 
*substream)
struct snd_dmaengine_dai_dma_data *dma_data;
struct dma_slave_caps dma_caps;
struct dma_chan *chan;
+   dma_cap_mask_t mask;
u32 addr_widths = BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) |
  BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) |
  BIT(DMA_SLAVE_BUSWIDTH_4_BYTES);
@@ -139,12 +140,15 @@ static int omap_pcm_open(struct snd_pcm_substream 
*substream)
 
dma_data = snd_soc_dai_get_dma_data(rtd-cpu_dai, substream);
 
-   if (rtd-cpu_dai-dev-of_node)
-   chan = dma_request_slave_channel(rtd-cpu_dai-dev,
-dma_data-filter_data);
-   else
-   chan = snd_dmaengine_pcm_request_channel(omap_dma_filter_fn,
-dma_data-filter_data);
+   dma_cap_zero(mask);
+   dma_cap_set(DMA_SLAVE, mask);
+   dma_cap_set(DMA_CYCLIC, mask);
+   chan = dma_request_slave_channel_compat_reason(mask, omap_dma_filter_fn,
+   dma_data-filter_data, rtd-cpu_dai-dev,
+   dma_data-filter_data);
+
+   if (IS_ERR(chan))
+   return PTR_ERR(chan);
 
if (!dma_get_slave_caps(chan, dma_caps)) {
if (substream-stream == SNDRV_PCM_STREAM_PLAYBACK)
-- 
2.3.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 v9 8/8] exynos4-is: Add support for v4l2-flash subdevs

2015-05-26 Thread Jacek Anaszewski

Hi Sylwester,

Thanks for the review.

On 05/26/2015 11:04 AM, Sylwester Nawrocki wrote:

On 25/05/15 17:14, Jacek Anaszewski wrote:

This patch adds support for external v4l2-flash devices.
The support includes parsing camera-flashes DT property


samsung,camera-flashes ?


Right.


and asynchronous sub-device registration.



+static int fimc_md_register_flash_entities(struct fimc_md *fmd)
+{
+   struct device_node *parent = fmd-pdev-dev.of_node, *np_sensor,
+   *np_flash;
+   struct v4l2_async_notifier *notifier = fmd-subdev_notifier;
+   struct v4l2_async_subdev *asd;
+   int i, j, num_flashes = 0, num_elems;
+
+   num_elems = of_property_count_elems_of_size(parent,
+   samsung,camera-flashes, sizeof(np_flash));


I think this should be of_property_count_u32_elems(), phandle is always
a 32-bit value [1], while size of a pointer depends on the architecture.


Thanks for spotting this.




+   /* samsung,camera-flashes property is optional */
+   if (num_elems  0)
+   return 0;
+
+   /* samsung,camera-flashes array must have even number of elements */
+   if ((num_elems  1) || (num_elems  FIMC_MAX_SENSORS * 2))
+   return -EINVAL;
+
+   for (i = 0; i  num_elems; i += 2) {
+   np_sensor = of_parse_phandle(parent,
+samsung,camera-flashes, i);
+
+   for (j = 0; j  fmd-num_sensors; j++)
+   if (fmd-async_subdevs.sensors[j].match.of.node ==
+   np_sensor)
+   break;
+
+   of_node_put(np_sensor);


Would be good to add some comment here, why is the sensor required.
It's just a DT correctness check?


Yes, it checks whether the phandle points to the sensor node
which was previously registered.


Couldn't we carry on with the flash
registration after just emitting some warning?


Hmm, I've just realized that with this code the flash phandle associated
with the sensor phandle that hasn't been previously registered would be
silently ignored.

I agree that we should register the flash and emit warning in case
sensor phandle doesn't point the known sensor.


+   if (j == fmd-num_sensors)
+   continue;
+
+   np_flash = of_parse_phandle(parent, samsung,camera-flashes,
+   i + 1);
+
+   asd = fmd-async_subdevs.flashes[num_flashes++];
+   asd-match_type = V4L2_ASYNC_MATCH_OF;
+   asd-match.of.node = np_flash;
+   notifier-subdevs[notifier-num_subdevs++] = asd;
+
+   of_node_put(np_flash);
+   }
+
+   return 0;
+}


Otherwise looks good to me.




--
Best Regards,
Jacek Anaszewski
--
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] staging: media: omap4iss: Reformat overly long lines

2015-05-26 Thread Piotr Staszewski
On Tue, May 26, 2015 at 07:15:24AM -0700, Greg Kroah-Hartman wrote:
  -   WARN(1, KERN_ERR CSI2: pixel format %08x unsupported!\n,
  +   WARN(1,
  +KERN_ERR CSI2: pixel format %08x unsupported!\n,
 
 That line wasn't over 80 characters long, why change it?

Indeed my bad. Checkpatch complains there about something else.
I'll resubmit corrected version promptly.

Best regards,
Piotr

-- 
Piotr S. Staszewski  http://www.drbig.one.pl
dRbiG at FreeNode, IRCNet
 But all's one level plain he hunts for flowers.
--
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


[ATTN 0/9] SDR transmitter API

2015-05-26 Thread Antti Palosaari
That patch set adds V4L2 API support for SDR transmitters, with real
life working example driver - HackRF.

It also contains small change for old SDR API as I decided to rename
tuner type from V4L2_TUNER_ADC to V4L2_TUNER_SDR. ADC is SDR receiver
and DAC is SDR transmitter, so I eventually though it is better to
rename ADC to common term than add new type for DAC. Old type works
of course, it is defined also in order to avoid API breakage.

Most of the V4L implementation stuff is pretty trivial, ~copy  paste
from the SDR receiver.

New capability flag V4L2_CAP_SDR_OUTPUT is added to indicate device
is SDR transmitter.

Old capability flag V4L2_CAP_MODULATOR is used to indicate there is
'tuner' to set radio frequency for transmitter. That capability flag
name is pretty misleading in a case of SDR as SDR does not have
hardware modulator at all - but as it is existing flag it is hard to
change anymore (V4L API uses term TUNER for radio receiver and
MODULATOR for radio transmitter).

New v4l2 buffer type V4L2_BUF_TYPE_SDR_OUTPUT.

Transmitter format is negotiated similarly than receiver.

regards
Antti


Antti Palosaari (9):
  v4l2: rename V4L2_TUNER_ADC to V4L2_TUNER_SDR
  v4l2: add RF gain control
  DocBook: document tuner RF gain control
  v4l2: add support for SDR transmitter
  DocBook: document SDR transmitter
  hackrf: add control for RF amplifier
  hackrf: switch to single function which configures everything
  hackrf: add support for transmitter
  hackrf: do not set human readable name for formats

 Documentation/DocBook/media/v4l/compat.xml |   20 +
 Documentation/DocBook/media/v4l/controls.xml   |   19 +
 Documentation/DocBook/media/v4l/dev-sdr.xml|   32 +-
 Documentation/DocBook/media/v4l/io.xml |   10 +-
 Documentation/DocBook/media/v4l/pixfmt.xml |2 +-
 Documentation/DocBook/media/v4l/v4l2.xml   |9 +
 Documentation/DocBook/media/v4l/vidioc-g-fmt.xml   |2 +-
 .../DocBook/media/v4l/vidioc-querycap.xml  |6 +
 drivers/media/usb/hackrf/hackrf.c  | 1019 ++--
 drivers/media/v4l2-core/v4l2-ctrls.c   |4 +
 drivers/media/v4l2-core/v4l2-dev.c |   14 +-
 drivers/media/v4l2-core/v4l2-ioctl.c   |   31 +-
 drivers/media/v4l2-core/videobuf-core.c|4 +-
 include/media/v4l2-ioctl.h |8 +
 include/trace/events/v4l2.h|1 +
 include/uapi/linux/v4l2-controls.h |2 +
 include/uapi/linux/videodev2.h |   10 +-
 17 files changed, 898 insertions(+), 295 deletions(-)

-- 
http://palosaari.fi/

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


[ATTN 6/9] hackrf: add control for RF amplifier

2015-05-26 Thread Antti Palosaari
There is Avago MGA-81563 amplifier just right after antenna connector.
It could be turned on/off and its gain is around 12dB.

Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/hackrf/hackrf.c | 26 +-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/drivers/media/usb/hackrf/hackrf.c 
b/drivers/media/usb/hackrf/hackrf.c
index fd1fa41..136de9a 100644
--- a/drivers/media/usb/hackrf/hackrf.c
+++ b/drivers/media/usb/hackrf/hackrf.c
@@ -31,6 +31,7 @@ enum {
CMD_BOARD_ID_READ  = 0x0e,
CMD_VERSION_STRING_READ= 0x0f,
CMD_SET_FREQ   = 0x10,
+   CMD_AMP_ENABLE = 0x11,
CMD_SET_LNA_GAIN   = 0x13,
CMD_SET_VGA_GAIN   = 0x14,
 };
@@ -133,6 +134,7 @@ struct hackrf_dev {
struct v4l2_ctrl_handler hdl;
struct v4l2_ctrl *bandwidth_auto;
struct v4l2_ctrl *bandwidth;
+   struct v4l2_ctrl *rf_gain;
struct v4l2_ctrl *lna_gain;
struct v4l2_ctrl *if_gain;
 
@@ -164,6 +166,7 @@ static int hackrf_ctrl_msg(struct hackrf_dev *dev, u8 
request, u16 value,
switch (request) {
case CMD_SET_TRANSCEIVER_MODE:
case CMD_SET_FREQ:
+   case CMD_AMP_ENABLE:
case CMD_SAMPLE_RATE_SET:
case CMD_BASEBAND_FILTER_BANDWIDTH_SET:
pipe = usb_sndctrlpipe(dev-udev, 0);
@@ -949,6 +952,22 @@ static int hackrf_set_bandwidth(struct hackrf_dev *dev)
return ret;
 }
 
+static int hackrf_set_rf_gain(struct hackrf_dev *dev)
+{
+   int ret;
+   u8 u8tmp;
+
+   dev_dbg(dev-dev, rf val=%d-%d\n,
+   dev-rf_gain-cur.val, dev-rf_gain-val);
+
+   u8tmp = (dev-rf_gain-val) ? 1 : 0;
+   ret = hackrf_ctrl_msg(dev, CMD_AMP_ENABLE, u8tmp, 0, NULL, 0);
+   if (ret)
+   dev_dbg(dev-dev, failed=%d\n, ret);
+
+   return ret;
+}
+
 static int hackrf_set_lna_gain(struct hackrf_dev *dev)
 {
int ret;
@@ -992,6 +1011,9 @@ static int hackrf_s_ctrl(struct v4l2_ctrl *ctrl)
case V4L2_CID_RF_TUNER_BANDWIDTH:
ret = hackrf_set_bandwidth(dev);
break;
+   case  V4L2_CID_RF_TUNER_RF_GAIN:
+   ret = hackrf_set_rf_gain(dev);
+   break;
case  V4L2_CID_RF_TUNER_LNA_GAIN:
ret = hackrf_set_lna_gain(dev);
break;
@@ -1077,13 +1099,15 @@ static int hackrf_probe(struct usb_interface *intf,
}
 
/* Register controls */
-   v4l2_ctrl_handler_init(dev-hdl, 4);
+   v4l2_ctrl_handler_init(dev-hdl, 5);
dev-bandwidth_auto = v4l2_ctrl_new_std(dev-hdl, hackrf_ctrl_ops,
V4L2_CID_RF_TUNER_BANDWIDTH_AUTO, 0, 1, 1, 1);
dev-bandwidth = v4l2_ctrl_new_std(dev-hdl, hackrf_ctrl_ops,
V4L2_CID_RF_TUNER_BANDWIDTH,
175, 2800, 5, 175);
v4l2_ctrl_auto_cluster(2, dev-bandwidth_auto, 0, false);
+   dev-rf_gain = v4l2_ctrl_new_std(dev-hdl, hackrf_ctrl_ops,
+   V4L2_CID_RF_TUNER_RF_GAIN, 0, 12, 12, 0);
dev-lna_gain = v4l2_ctrl_new_std(dev-hdl, hackrf_ctrl_ops,
V4L2_CID_RF_TUNER_LNA_GAIN, 0, 40, 8, 0);
dev-if_gain = v4l2_ctrl_new_std(dev-hdl, hackrf_ctrl_ops,
-- 
http://palosaari.fi/

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


[ATTN 9/9] hackrf: do not set human readable name for formats

2015-05-26 Thread Antti Palosaari
Format names are set by core nowadays. Remove name from driver.

Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/hackrf/hackrf.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/media/usb/hackrf/hackrf.c 
b/drivers/media/usb/hackrf/hackrf.c
index 6ad6937..1f9483d 100644
--- a/drivers/media/usb/hackrf/hackrf.c
+++ b/drivers/media/usb/hackrf/hackrf.c
@@ -69,7 +69,6 @@ static const struct v4l2_frequency_band bands_rx_tx[] = {
 
 /* stream formats */
 struct hackrf_format {
-   char*name;
u32 pixelformat;
u32 buffersize;
 };
@@ -77,7 +76,6 @@ struct hackrf_format {
 /* format descriptions for capture and preview */
 static struct hackrf_format formats[] = {
{
-   .name   = Complex S8,
.pixelformat= V4L2_SDR_FMT_CS8,
.buffersize = BULK_BUFFER_SIZE,
},
@@ -977,7 +975,6 @@ static int hackrf_enum_fmt_sdr_cap(struct file *file, void 
*priv,
if (f-index = NUM_FORMATS)
return -EINVAL;
 
-   strlcpy(f-description, formats[f-index].name, sizeof(f-description));
f-pixelformat = formats[f-index].pixelformat;
 
return 0;
-- 
http://palosaari.fi/

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


[ATTN 5/9] DocBook: document SDR transmitter

2015-05-26 Thread Antti Palosaari
Add documentation for V4L SDR transmitter (output) devices.

Cc: Hans Verkuil hverk...@xs4all.nl
Signed-off-by: Antti Palosaari cr...@iki.fi
---
 Documentation/DocBook/media/v4l/compat.xml |  4 +++
 Documentation/DocBook/media/v4l/dev-sdr.xml| 30 +++---
 Documentation/DocBook/media/v4l/io.xml | 10 ++--
 Documentation/DocBook/media/v4l/pixfmt.xml |  2 +-
 Documentation/DocBook/media/v4l/v4l2.xml   |  1 +
 Documentation/DocBook/media/v4l/vidioc-g-fmt.xml   |  2 +-
 .../DocBook/media/v4l/vidioc-querycap.xml  |  6 +
 7 files changed, 42 insertions(+), 13 deletions(-)

diff --git a/Documentation/DocBook/media/v4l/compat.xml 
b/Documentation/DocBook/media/v4l/compat.xml
index e8f28bf..a237e36 100644
--- a/Documentation/DocBook/media/v4l/compat.xml
+++ b/Documentation/DocBook/media/v4l/compat.xml
@@ -2604,6 +2604,10 @@ and v4l2-mbus-framefmt;.
  paraAdded constantV4L2_CID_RF_TUNER_RF_GAIN_AUTO/constant and
 constantV4L2_CID_RF_TUNER_RF_GAIN/constant RF Tuner controls./para
/listitem
+   listitem
+ paraAdded transmitter support for Software Defined Radio (SDR)
+Interface./para
+   /listitem
   /orderedlist
 /section
 
diff --git a/Documentation/DocBook/media/v4l/dev-sdr.xml 
b/Documentation/DocBook/media/v4l/dev-sdr.xml
index 3344921..a659771 100644
--- a/Documentation/DocBook/media/v4l/dev-sdr.xml
+++ b/Documentation/DocBook/media/v4l/dev-sdr.xml
@@ -28,6 +28,16 @@ Devices supporting the SDR receiver interface set the
 structfieldcapabilities/structfield field of v4l2-capability;
 returned by the VIDIOC-QUERYCAP; ioctl. That flag means the device has an
 Analog to Digital Converter (ADC), which is a mandatory element for the SDR 
receiver.
+/para
+para
+Devices supporting the SDR transmitter interface set the
+constantV4L2_CAP_SDR_OUTPUT/constant and
+constantV4L2_CAP_MODULATOR/constant flag in the
+structfieldcapabilities/structfield field of v4l2-capability;
+returned by the VIDIOC-QUERYCAP; ioctl. That flag means the device has an
+Digital to Analog Converter (DAC), which is a mandatory element for the SDR 
transmitter.
+/para
+para
 At least one of the read/write, streaming or asynchronous I/O methods must
 be supported.
 /para
@@ -39,14 +49,15 @@ be supported.
 para
 SDR devices can support link linkend=controlcontrols/link, and must
 support the link linkend=tunertuner/link ioctls. Tuner ioctls are used
-for setting the ADC sampling rate (sampling frequency) and the possible RF 
tuner
-frequency.
+for setting the ADC/DAC sampling rate (sampling frequency) and the possible
+radio frequency (RF).
 /para
 
 para
-The constantV4L2_TUNER_SDR/constant tuner type is used for SDR tuners, and
-the constantV4L2_TUNER_RF/constant tuner type is used for RF tuners. The
-tuner index of the RF tuner (if any) must always follow the SDR tuner index.
+The constantV4L2_TUNER_SDR/constant tuner type is used for setting SDR
+device ADC/DAC frequency, and the constantV4L2_TUNER_RF/constant
+tuner type is used for setting radio frequency.
+The tuner index of the RF tuner (if any) must always follow the SDR tuner 
index.
 Normally the SDR tuner is #0 and the RF tuner is #1.
 /para
 
@@ -59,9 +70,9 @@ The VIDIOC-S-HW-FREQ-SEEK; ioctl is not supported.
 titleData Format Negotiation/title
 
 para
-The SDR capture device uses the link linkend=formatformat/link ioctls to
-select the capture format. Both the sampling resolution and the data streaming
-format are bound to that selectable format. In addition to the basic
+The SDR device uses the link linkend=formatformat/link ioctls to
+select the capture and output format. Both the sampling resolution and the data
+streaming format are bound to that selectable format. In addition to the basic
 link linkend=formatformat/link ioctls, the VIDIOC-ENUM-FMT; ioctl
 must be supported as well.
 /para
@@ -69,7 +80,8 @@ must be supported as well.
 para
 To use the link linkend=formatformat/link ioctls applications set the
 structfieldtype/structfield field of a v4l2-format; to
-constantV4L2_BUF_TYPE_SDR_CAPTURE/constant and use the v4l2-sdr-format;
+constantV4L2_BUF_TYPE_SDR_CAPTURE/constant or
+constantV4L2_BUF_TYPE_SDR_OUTPUT/constant and use the v4l2-sdr-format;
 structfieldsdr/structfield member of the structfieldfmt/structfield
 union as needed per the desired operation.
 Currently there is two fields, structfieldpixelformat/structfield and
diff --git a/Documentation/DocBook/media/v4l/io.xml 
b/Documentation/DocBook/media/v4l/io.xml
index bfe6662..5f8d96e 100644
--- a/Documentation/DocBook/media/v4l/io.xml
+++ b/Documentation/DocBook/media/v4l/io.xml
@@ -1006,8 +1006,14 @@ should set this to 0./entry
  row
entryconstantV4L2_BUF_TYPE_SDR_CAPTURE/constant/entry
entry11/entry
-   entryBuffer for Software Defined Radio (SDR), see xref
-   linkend=sdr /./entry
+   

[ATTN 7/9] hackrf: switch to single function which configures everything

2015-05-26 Thread Antti Palosaari
Implement single funtion, hackrf_set_params(), which handles all
needed settings. Controls and other IOCTLs are just wrappers to that
function. That way we can get easily better control what we could do
on different device states - sleeping, receiving, transmitting.

Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/usb/hackrf/hackrf.c | 323 +-
 1 file changed, 175 insertions(+), 148 deletions(-)

diff --git a/drivers/media/usb/hackrf/hackrf.c 
b/drivers/media/usb/hackrf/hackrf.c
index 136de9a..5bd291b 100644
--- a/drivers/media/usb/hackrf/hackrf.c
+++ b/drivers/media/usb/hackrf/hackrf.c
@@ -91,11 +91,17 @@ struct hackrf_frame_buf {
 };
 
 struct hackrf_dev {
-#define POWER_ON   (1  1)
-#define URB_BUF(1  2)
-#define USB_STATE_URB_BUF  (1  3)
+#define POWER_ON 1
+#define USB_STATE_URB_BUF2 /* XXX: set manually */
+#define SAMPLE_RATE_SET 10
+#define RX_BANDWIDTH11
+#define RX_RF_FREQUENCY 12
+#define RX_RF_GAIN  13
+#define RX_LNA_GAIN 14
+#define RX_IF_GAIN  15
unsigned long flags;
 
+   struct usb_interface *intf;
struct device *dev;
struct usb_device *udev;
struct video_device vdev;
@@ -208,6 +214,140 @@ err:
return ret;
 }
 
+static int hackrf_set_params(struct hackrf_dev *dev)
+{
+   struct usb_interface *intf = dev-intf;
+   int ret, i;
+   u8 buf[8], u8tmp;
+   unsigned int uitmp, uitmp1, uitmp2;
+
+   if (!test_bit(POWER_ON, dev-flags)) {
+   dev_dbg(intf-dev, device is sleeping\n);
+   return 0;
+   }
+
+   if (test_and_clear_bit(SAMPLE_RATE_SET, dev-flags)) {
+   dev_dbg(intf-dev, ADC frequency=%u Hz\n, dev-f_adc);
+   uitmp1 = dev-f_adc;
+   uitmp2 = 1;
+   buf[0] = (uitmp1   0)  0xff;
+   buf[1] = (uitmp1   8)  0xff;
+   buf[2] = (uitmp1  16)  0xff;
+   buf[3] = (uitmp1  24)  0xff;
+   buf[4] = (uitmp2   0)  0xff;
+   buf[5] = (uitmp2   8)  0xff;
+   buf[6] = (uitmp2  16)  0xff;
+   buf[7] = (uitmp2  24)  0xff;
+   ret = hackrf_ctrl_msg(dev, CMD_SAMPLE_RATE_SET, 0, 0, buf, 8);
+   if (ret)
+   goto err;
+   }
+
+   if (test_and_clear_bit(RX_BANDWIDTH, dev-flags)) {
+   static const struct {
+   u32 freq;
+   } bandwidth_lut[] = {
+   { 175}, /*  1.75 MHz */
+   { 250}, /*  2.5  MHz */
+   { 350}, /*  3.5  MHz */
+   { 500}, /*  5MHz */
+   { 550}, /*  5.5  MHz */
+   { 600}, /*  6MHz */
+   { 700}, /*  7MHz */
+   { 800}, /*  8MHz */
+   { 900}, /*  9MHz */
+   {1000}, /* 10MHz */
+   {1200}, /* 12MHz */
+   {1400}, /* 14MHz */
+   {1500}, /* 15MHz */
+   {2000}, /* 20MHz */
+   {2400}, /* 24MHz */
+   {2800}, /* 28MHz */
+   };
+
+   if (dev-bandwidth_auto-val == true)
+   uitmp = dev-f_adc;
+   else
+   uitmp = dev-bandwidth-val;
+
+   for (i = 0; i  ARRAY_SIZE(bandwidth_lut); i++) {
+   if (uitmp = bandwidth_lut[i].freq) {
+   uitmp = bandwidth_lut[i].freq;
+   break;
+   }
+   }
+
+   dev-bandwidth-val = uitmp;
+   dev-bandwidth-cur.val = uitmp;
+
+   dev_dbg(intf-dev, bandwidth selected=%u\n, uitmp);
+
+   uitmp1 = 0;
+   uitmp1 |= ((uitmp  0)  0xff)  0;
+   uitmp1 |= ((uitmp  8)  0xff)  8;
+   uitmp2 = 0;
+   uitmp2 |= ((uitmp  16)  0xff)  0;
+   uitmp2 |= ((uitmp  24)  0xff)  8;
+
+   ret = hackrf_ctrl_msg(dev, CMD_BASEBAND_FILTER_BANDWIDTH_SET,
+ uitmp1, uitmp2, NULL, 0);
+   if (ret)
+   goto err;
+   }
+
+   if (test_and_clear_bit(RX_RF_FREQUENCY, dev-flags)) {
+   dev_dbg(intf-dev, RF frequency=%u Hz\n, dev-f_rf);
+   uitmp1 = dev-f_rf / 100;
+   uitmp2 = dev-f_rf % 100;
+   buf[0] = (uitmp1   0)  0xff;
+   buf[1] = (uitmp1   8)  0xff;
+   buf[2] = (uitmp1  16)  0xff;
+   buf[3] = (uitmp1  24)  0xff;
+   buf[4] = (uitmp2   0)  0xff;
+ 

[ATTN 4/9] v4l2: add support for SDR transmitter

2015-05-26 Thread Antti Palosaari
New IOCTL ops:
vidioc_enum_fmt_sdr_out
vidioc_g_fmt_sdr_out
vidioc_s_fmt_sdr_out
vidioc_try_fmt_sdr_out

New vb2 buffertype:
V4L2_BUF_TYPE_SDR_OUTPUT

New v4l2 capability:
V4L2_CAP_SDR_OUTPUT

Cc: Hans Verkuil hverk...@xs4all.nl
Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/v4l2-core/v4l2-dev.c  | 14 --
 drivers/media/v4l2-core/v4l2-ioctl.c| 25 +
 drivers/media/v4l2-core/videobuf-core.c |  4 +++-
 include/media/v4l2-ioctl.h  |  8 
 include/trace/events/v4l2.h |  1 +
 include/uapi/linux/videodev2.h  |  5 -
 6 files changed, 53 insertions(+), 4 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-dev.c 
b/drivers/media/v4l2-core/v4l2-dev.c
index 71a1b93..6b1eaed 100644
--- a/drivers/media/v4l2-core/v4l2-dev.c
+++ b/drivers/media/v4l2-core/v4l2-dev.c
@@ -637,8 +637,8 @@ static void determine_valid_ioctls(struct video_device 
*vdev)
   ops-vidioc_try_fmt_sliced_vbi_out)))
set_bit(_IOC_NR(VIDIOC_TRY_FMT), valid_ioctls);
SET_VALID_IOCTL(ops, VIDIOC_G_SLICED_VBI_CAP, 
vidioc_g_sliced_vbi_cap);
-   } else if (is_sdr) {
-   /* SDR specific ioctls */
+   } else if (is_sdr  is_rx) {
+   /* SDR receiver specific ioctls */
if (ops-vidioc_enum_fmt_sdr_cap)
set_bit(_IOC_NR(VIDIOC_ENUM_FMT), valid_ioctls);
if (ops-vidioc_g_fmt_sdr_cap)
@@ -647,6 +647,16 @@ static void determine_valid_ioctls(struct video_device 
*vdev)
set_bit(_IOC_NR(VIDIOC_S_FMT), valid_ioctls);
if (ops-vidioc_try_fmt_sdr_cap)
set_bit(_IOC_NR(VIDIOC_TRY_FMT), valid_ioctls);
+   } else if (is_sdr  is_tx) {
+   /* SDR transmitter specific ioctls */
+   if (ops-vidioc_enum_fmt_sdr_out)
+   set_bit(_IOC_NR(VIDIOC_ENUM_FMT), valid_ioctls);
+   if (ops-vidioc_g_fmt_sdr_out)
+   set_bit(_IOC_NR(VIDIOC_G_FMT), valid_ioctls);
+   if (ops-vidioc_s_fmt_sdr_out)
+   set_bit(_IOC_NR(VIDIOC_S_FMT), valid_ioctls);
+   if (ops-vidioc_try_fmt_sdr_out)
+   set_bit(_IOC_NR(VIDIOC_TRY_FMT), valid_ioctls);
}
 
if (is_vid || is_vbi || is_sdr) {
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c 
b/drivers/media/v4l2-core/v4l2-ioctl.c
index 03b9daf..5d2501b 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -153,6 +153,7 @@ const char *v4l2_type_names[] = {
[V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE] = vid-cap-mplane,
[V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE] = vid-out-mplane,
[V4L2_BUF_TYPE_SDR_CAPTURE]= sdr-cap,
+   [V4L2_BUF_TYPE_SDR_OUTPUT] = sdr-out,
 };
 EXPORT_SYMBOL(v4l2_type_names);
 
@@ -325,6 +326,7 @@ static void v4l_print_format(const void *arg, bool 
write_only)
sliced-service_lines[1][i]);
break;
case V4L2_BUF_TYPE_SDR_CAPTURE:
+   case V4L2_BUF_TYPE_SDR_OUTPUT:
sdr = p-fmt.sdr;
pr_cont(, pixelformat=%c%c%c%c\n,
(sdr-pixelformat   0)  0xff,
@@ -973,6 +975,10 @@ static int check_fmt(struct file *file, enum v4l2_buf_type 
type)
if (is_sdr  is_rx  ops-vidioc_g_fmt_sdr_cap)
return 0;
break;
+   case V4L2_BUF_TYPE_SDR_OUTPUT:
+   if (is_sdr  is_tx  ops-vidioc_g_fmt_sdr_out)
+   return 0;
+   break;
default:
break;
}
@@ -1321,6 +1327,11 @@ static int v4l_enum_fmt(const struct v4l2_ioctl_ops *ops,
break;
ret = ops-vidioc_enum_fmt_sdr_cap(file, fh, arg);
break;
+   case V4L2_BUF_TYPE_SDR_OUTPUT:
+   if (unlikely(!is_tx || !is_sdr || 
!ops-vidioc_enum_fmt_sdr_out))
+   break;
+   ret = ops-vidioc_enum_fmt_sdr_out(file, fh, arg);
+   break;
}
if (ret == 0)
v4l_fill_fmtdesc(p);
@@ -1415,6 +1426,10 @@ static int v4l_g_fmt(const struct v4l2_ioctl_ops *ops,
if (unlikely(!is_rx || !is_sdr || !ops-vidioc_g_fmt_sdr_cap))
break;
return ops-vidioc_g_fmt_sdr_cap(file, fh, arg);
+   case V4L2_BUF_TYPE_SDR_OUTPUT:
+   if (unlikely(!is_tx || !is_sdr || !ops-vidioc_g_fmt_sdr_out))
+   break;
+   return ops-vidioc_g_fmt_sdr_out(file, fh, arg);
}
return -EINVAL;
 }
@@ -1494,6 +1509,11 @@ static int v4l_s_fmt(const struct v4l2_ioctl_ops *ops,
break;
CLEAR_AFTER_FIELD(p, fmt.sdr);
return ops-vidioc_s_fmt_sdr_cap(file, fh, arg);
+   case V4L2_BUF_TYPE_SDR_OUTPUT:
+ 

Re: DVB-T2 PCIe vs DVB-S2

2015-05-26 Thread Jemma Denson

On 26/05/15 08:53, Ian Campbell wrote:

Hello,

I'm looking to get a DVB-T2 tuner card to add UK Freeview HD to my
mythtv box.

Looking at http://linuxtv.org/wiki/index.php/DVB-T2_PCIe_Cards is seems
that many (the majority even) of the cards there are actually DVB-S2.

Is this a mistake or is there something I don't know (like maybe S2 is
compatible with T2)?

Thanks,
Ian.


That's a mistake - I don't recall that table looking like that when I 
was looking for one, and S2 is quite definitely not compatible with T2!


I can confirm that the 290e works out of the box with myth with very few 
problems, however it's well out of production now and you might not be 
after a USB device. I'm not sure anything else would work without some 
hacking because last I heard myth doesn't do T2 the proper way using 
DVBv5 yet, and afaik only the 290e driver has a fudge to allow T2 on v3.
(http://lists.mythtv.org/pipermail/mythtv-users/2014-November/374441.html and 
https://code.mythtv.org/trac/ticket/12342)



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


[ATTN 3/9] DocBook: document tuner RF gain control

2015-05-26 Thread Antti Palosaari
Add brief description for tuner RF gain control.

Cc: Hans Verkuil hverk...@xs4all.nl
Signed-off-by: Antti Palosaari cr...@iki.fi
---
 Documentation/DocBook/media/v4l/compat.xml   |  4 
 Documentation/DocBook/media/v4l/controls.xml | 19 +++
 Documentation/DocBook/media/v4l/v4l2.xml |  1 +
 3 files changed, 24 insertions(+)

diff --git a/Documentation/DocBook/media/v4l/compat.xml 
b/Documentation/DocBook/media/v4l/compat.xml
index f56faf5..e8f28bf 100644
--- a/Documentation/DocBook/media/v4l/compat.xml
+++ b/Documentation/DocBook/media/v4l/compat.xml
@@ -2600,6 +2600,10 @@ and v4l2-mbus-framefmt;.
 constantV4L2_TUNER_ADC/constant is deprecated now.
  /para
/listitem
+   listitem
+ paraAdded constantV4L2_CID_RF_TUNER_RF_GAIN_AUTO/constant and
+constantV4L2_CID_RF_TUNER_RF_GAIN/constant RF Tuner controls./para
+   /listitem
   /orderedlist
 /section
 
diff --git a/Documentation/DocBook/media/v4l/controls.xml 
b/Documentation/DocBook/media/v4l/controls.xml
index 6e1667b..44f7a3a 100644
--- a/Documentation/DocBook/media/v4l/controls.xml
+++ b/Documentation/DocBook/media/v4l/controls.xml
@@ -5397,6 +5397,13 @@ fulfill desired bandwidth requirement. Used when 
V4L2_CID_RF_TUNER_BANDWIDTH_AUT
 set. Unit is in Hz. The range and step are driver-specific./entry
 /row
 row
+  entry 
spanname=idconstantV4L2_CID_RF_TUNER_RF_GAIN_AUTO/constantnbsp;/entry
+  entryboolean/entry
+/row
+row
+  entry spanname=descrEnables/disables RF amplifier automatic 
gain control (AGC)/entry
+/row
+row
   entry 
spanname=idconstantV4L2_CID_RF_TUNER_LNA_GAIN_AUTO/constantnbsp;/entry
   entryboolean/entry
 /row
@@ -5418,6 +5425,18 @@ set. Unit is in Hz. The range and step are 
driver-specific./entry
   entry spanname=descrEnables/disables IF automatic gain 
control (AGC)/entry
 /row
 row
+  entry 
spanname=idconstantV4L2_CID_RF_TUNER_RF_GAIN/constantnbsp;/entry
+  entryinteger/entry
+/row
+row
+  entry spanname=descrRF amplifier is very first amplifier on
+the receiver signal path, just right after antenna input. Difference between
+LNA gain and RF gain on this document and context is that LNA gain is 
integrated
+to tuner chip whilst RF gain is separate chip. There may be both, RF and LNA
+gain control, on same device. Used when 
constantV4L2_CID_RF_TUNER_RF_GAIN_AUTO/constant is not set.
+The range and step are driver-specific./entry
+/row
+row
   entry 
spanname=idconstantV4L2_CID_RF_TUNER_LNA_GAIN/constantnbsp;/entry
   entryinteger/entry
 /row
diff --git a/Documentation/DocBook/media/v4l/v4l2.xml 
b/Documentation/DocBook/media/v4l/v4l2.xml
index c9eedc1..b94d381 100644
--- a/Documentation/DocBook/media/v4l/v4l2.xml
+++ b/Documentation/DocBook/media/v4l/v4l2.xml
@@ -156,6 +156,7 @@ applications. --
date2015-05-26/date
authorinitialsap/authorinitials
revremarkRenamed V4L2_TUNER_ADC to V4L2_TUNER_SDR.
+Added V4L2_CID_RF_TUNER_RF_GAIN_AUTO and V4L2_CID_RF_TUNER_RF_GAIN controls.
/revremark
   /revision
 
-- 
http://palosaari.fi/

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


[ATTN 2/9] v4l2: add RF gain control

2015-05-26 Thread Antti Palosaari
Add new RF tuner gain control named RF gain. That is aimed for
external LNA (amplifier) chip just right after antenna connector.

Cc: Hans Verkuil hverk...@xs4all.nl
Signed-off-by: Antti Palosaari cr...@iki.fi
---
 drivers/media/v4l2-core/v4l2-ctrls.c | 4 
 include/uapi/linux/v4l2-controls.h   | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c 
b/drivers/media/v4l2-core/v4l2-ctrls.c
index e3a3468..0fc34b8 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -888,6 +888,8 @@ const char *v4l2_ctrl_get_name(u32 id)
case V4L2_CID_TUNE_DEEMPHASIS:  return De-Emphasis;
case V4L2_CID_RDS_RECEPTION:return RDS Reception;
case V4L2_CID_RF_TUNER_CLASS:   return RF Tuner Controls;
+   case V4L2_CID_RF_TUNER_RF_GAIN_AUTO:return RF Gain, Auto;
+   case V4L2_CID_RF_TUNER_RF_GAIN: return RF Gain;
case V4L2_CID_RF_TUNER_LNA_GAIN_AUTO:   return LNA Gain, Auto;
case V4L2_CID_RF_TUNER_LNA_GAIN:return LNA Gain;
case V4L2_CID_RF_TUNER_MIXER_GAIN_AUTO: return Mixer Gain, Auto;
@@ -960,6 +962,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum 
v4l2_ctrl_type *type,
case V4L2_CID_WIDE_DYNAMIC_RANGE:
case V4L2_CID_IMAGE_STABILIZATION:
case V4L2_CID_RDS_RECEPTION:
+   case V4L2_CID_RF_TUNER_RF_GAIN_AUTO:
case V4L2_CID_RF_TUNER_LNA_GAIN_AUTO:
case V4L2_CID_RF_TUNER_MIXER_GAIN_AUTO:
case V4L2_CID_RF_TUNER_IF_GAIN_AUTO:
@@ -1161,6 +1164,7 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum 
v4l2_ctrl_type *type,
case V4L2_CID_PILOT_TONE_FREQUENCY:
case V4L2_CID_TUNE_POWER_LEVEL:
case V4L2_CID_TUNE_ANTENNA_CAPACITOR:
+   case V4L2_CID_RF_TUNER_RF_GAIN:
case V4L2_CID_RF_TUNER_LNA_GAIN:
case V4L2_CID_RF_TUNER_MIXER_GAIN:
case V4L2_CID_RF_TUNER_IF_GAIN:
diff --git a/include/uapi/linux/v4l2-controls.h 
b/include/uapi/linux/v4l2-controls.h
index 9f6e108..87539be 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -932,6 +932,8 @@ enum v4l2_deemphasis {
 
 #define V4L2_CID_RF_TUNER_BANDWIDTH_AUTO   (V4L2_CID_RF_TUNER_CLASS_BASE + 
11)
 #define V4L2_CID_RF_TUNER_BANDWIDTH(V4L2_CID_RF_TUNER_CLASS_BASE + 
12)
+#define V4L2_CID_RF_TUNER_RF_GAIN_AUTO (V4L2_CID_RF_TUNER_CLASS_BASE + 
31)
+#define V4L2_CID_RF_TUNER_RF_GAIN  (V4L2_CID_RF_TUNER_CLASS_BASE + 
32)
 #define V4L2_CID_RF_TUNER_LNA_GAIN_AUTO
(V4L2_CID_RF_TUNER_CLASS_BASE + 41)
 #define V4L2_CID_RF_TUNER_LNA_GAIN (V4L2_CID_RF_TUNER_CLASS_BASE + 
42)
 #define V4L2_CID_RF_TUNER_MIXER_GAIN_AUTO  (V4L2_CID_RF_TUNER_CLASS_BASE + 
51)
-- 
http://palosaari.fi/

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