Re: [PATCH v4 1/4] [media] videodev2: Add V4L2_BUF_FLAG_LAST

2015-04-12 Thread Pawel Osciak
Hi,
Thanks for working on this!

On Wed, Mar 25, 2015 at 2:46 AM, Philipp Zabel p.za...@pengutronix.de wrote:
 From: Peter Seiderer ps.rep...@gmx.net

 This v4l2_buffer flag can be used by drivers to mark a capture buffer
 as the last generated buffer, for example after a V4L2_DEC_CMD_STOP
 command was issued.
 The DocBook is updated to mention mem2mem codecs and the mem2mem draining flow
 signals in the VIDIOC_DECODER_CMD V4L2_DEC_CMD_STOP and VIDIOC_ENCODER_CMD
 V4L2_ENC_CMD_STOP documentation.

 Signed-off-by: Peter Seiderer ps.rep...@gmx.net
 Signed-off-by: Philipp Zabel p.za...@pengutronix.de
 ---
 Changes since v3:
  - Added DocBook update mentioning V4L2_BUF_FLAG_LAST in the encoder/decoder
stop command documentation.
 ---
  Documentation/DocBook/media/v4l/io.xml | 10 ++
  Documentation/DocBook/media/v4l/vidioc-decoder-cmd.xml |  6 +-
  Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml |  5 -
  include/trace/events/v4l2.h|  3 ++-
  include/uapi/linux/videodev2.h |  2 ++
  5 files changed, 23 insertions(+), 3 deletions(-)

 diff --git a/Documentation/DocBook/media/v4l/io.xml 
 b/Documentation/DocBook/media/v4l/io.xml
 index 1c17f80..f3b8bc0 100644
 --- a/Documentation/DocBook/media/v4l/io.xml
 +++ b/Documentation/DocBook/media/v4l/io.xml
 @@ -1129,6 +1129,16 @@ in this buffer has not been created by the CPU but by 
 some DMA-capable unit,
  in which case caches have not been used./entry
   /row
   row
 +   entryconstantV4L2_BUF_FLAG_LAST/constant/entry
 +   entry0x0010/entry
 +   entryLast buffer produced by the hardware. mem2mem codec drivers
 +set this flag on the capture queue for the last buffer when the
 +link linkend=vidioc-querybufVIDIOC_QUERYBUF/link or
 +link linkend=vidioc-qbufVIDIOC_DQBUF/link ioctl is called. After the
 +queue is drained, the link linkend=vidioc-qbufVIDIOC_DQBUF/link ioctl 
 will

Perhaps just s/After the queue is drained, the/Any subsequent/ ? This
would make it more clear I feel.
DQBUF of LAST is the end of draining.

 +not block anymore, but return an EPIPE;./entry
 + /row
 + row
 entryconstantV4L2_BUF_FLAG_TIMESTAMP_MASK/constant/entry
 entry0xe000/entry
 entryMask for timestamp types below. To test the
 diff --git a/Documentation/DocBook/media/v4l/vidioc-decoder-cmd.xml 
 b/Documentation/DocBook/media/v4l/vidioc-decoder-cmd.xml
 index 9215627..cbb7135 100644
 --- a/Documentation/DocBook/media/v4l/vidioc-decoder-cmd.xml
 +++ b/Documentation/DocBook/media/v4l/vidioc-decoder-cmd.xml
 @@ -197,7 +197,11 @@ be muted when playing back at a non-standard speed.
  this command does nothing. This command has two flags:
  if constantV4L2_DEC_CMD_STOP_TO_BLACK/constant is set, then the decoder 
 will
  set the picture to black after it stopped decoding. Otherwise the last image 
 will
 -repeat. If constantV4L2_DEC_CMD_STOP_IMMEDIATELY/constant is set, then 
 the decoder
 +repeat. mem2mem decoders will stop producing new frames altogether. They 
 will send
 +a constantV4L2_EVENT_EOS/constant event after the last frame was decoded 
 and

s/was decoded/has been decoded and all frames are ready to be dequeued/

 +will set the constantV4L2_BUF_FLAG_LAST/constant buffer flag when there 
 will
 +be no new buffers produced to dequeue.

To make the timing description more explicit, s/when there will be no
new buffers produced to dequeue./on the final buffer being dequeued/
perhaps?
EOS indicates no more buffers will be produced and all are ready to
be dequeued, while LAST indicates final buffer being dequeued.

 +If constantV4L2_DEC_CMD_STOP_IMMEDIATELY/constant is set, then the 
 decoder
  stops immediately (ignoring the structfieldpts/structfield value), 
 otherwise it
  will keep decoding until timestamp = pts or until the last of the pending 
 data from
  its internal buffers was decoded.
 diff --git a/Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml 
 b/Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml
 index 0619ca5..e9cf601 100644
 --- a/Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml
 +++ b/Documentation/DocBook/media/v4l/vidioc-encoder-cmd.xml
 @@ -129,7 +129,10 @@ this command./entry
  encoding will continue until the end of the current wordaswordGroup
  Of Pictures/wordasword, otherwise encoding will stop immediately.
  When the encoder is already stopped, this command does
 -nothing./entry
 +nothing. mem2mem encoders will send a constantV4L2_EVENT_EOS/constant 
 event
 +after the last frame was encoded and will set the
 +constantV4L2_BUF_FLAG_LAST/constant buffer flag on the capture queue when
 +there will be no new buffers produced to dequeue/entry

I'd propose the same here.

-- 
Thanks,
Pawel
--
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  

cron job: media_tree daily build: ERRORS

2015-04-12 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:   Mon Apr 13 04:00:15 CEST 2015
git branch: test
git hash:   e183201b9e917daf2530b637b2f34f1d5afb934d
gcc version:i686-linux-gcc (GCC) 4.9.1
sparse version: v0.5.0-44-g40791b9
smatch version: 0.4.1-3153-g7d56ab3
host hardware:  x86_64
host os:3.19.0-1.slh.1-amd64

linux-git-arm-at91: OK
linux-git-arm-davinci: OK
linux-git-arm-exynos: OK
linux-git-arm-mx: OK
linux-git-arm-omap: OK
linux-git-arm-omap1: OK
linux-git-arm-pxa: OK
linux-git-blackfin: OK
linux-git-i686: 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: ERRORS
linux-2.6.33.7-i686: ERRORS
linux-2.6.34.7-i686: ERRORS
linux-2.6.35.9-i686: ERRORS
linux-2.6.36.4-i686: ERRORS
linux-2.6.37.6-i686: ERRORS
linux-2.6.38.8-i686: WARNINGS
linux-2.6.39.4-i686: WARNINGS
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: ERRORS
linux-3.14.9-i686: ERRORS
linux-3.15.2-i686: ERRORS
linux-3.16.7-i686: ERRORS
linux-3.17.8-i686: WARNINGS
linux-3.18.7-i686: WARNINGS
linux-3.19-i686: WARNINGS
linux-4.0-rc1-i686: WARNINGS
linux-2.6.32.27-x86_64: ERRORS
linux-2.6.33.7-x86_64: ERRORS
linux-2.6.34.7-x86_64: ERRORS
linux-2.6.35.9-x86_64: ERRORS
linux-2.6.36.4-x86_64: ERRORS
linux-2.6.37.6-x86_64: ERRORS
linux-2.6.38.8-x86_64: WARNINGS
linux-2.6.39.4-x86_64: WARNINGS
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: ERRORS
linux-3.14.9-x86_64: ERRORS
linux-3.15.2-x86_64: ERRORS
linux-3.16.7-x86_64: ERRORS
linux-3.17.8-x86_64: OK
linux-3.18.7-x86_64: OK
linux-3.19-x86_64: OK
linux-4.0-rc1-x86_64: OK
apps: OK
spec-git: OK
sparse: WARNINGS
smatch: ERRORS

Detailed results are available here:

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

Full logs are available here:

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

The Media Infrastructure API from this daily build is here:

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


Re: [PATCH] [media] omap4iss: avoid broken OMAP4 dependency

2015-04-12 Thread Laurent Pinchart
Hi Arnd,

Thank you for the patch.

On Friday 10 April 2015 22:20:20 Arnd Bergmann wrote:
 The omap4iss driver uses an interface that used to be provided
 by OMAP4 but has now been removed and replaced with a WARN_ON(1)
 statement, which likely broke the iss_csiphy code at runtime.
 
 It also broke compiling the driver when CONFIG_ARCH_OMAP2PLUS
 is set, which is implied by OMAP4:
 
 drivers/staging/media/omap4iss/iss_csiphy.c: In function
 'omap4iss_csiphy_config':
 drivers/staging/media/omap4iss/iss_csiphy.c:167:2: error: implicit
 declaration of function 'omap4_ctrl_pad_writel'
 [-Werror=implicit-function-declaration] omap4_ctrl_pad_writel(cam_rx_ctrl,

 In turn, this broke ARM allyesconfig builds. Replacing the
 omap4_ctrl_pad_writel call with WARN_ON(1) won't make the
 situation any worse than it already is, but fixes the build
 problem.

I've fixed the problem properly by switching to the syscon API. I'll send the 
patch as a separate reply, let's discuss there how to handle the issue.

 Signed-off-by: Arnd Bergmann a...@arndb.de
 Fixes: efde234674d9 (ARM: OMAP4+: control: remove support for legacy pad
 read/write)
 ---
 diff --git a/drivers/staging/media/omap4iss/iss_csiphy.c
 b/drivers/staging/media/omap4iss/iss_csiphy.c index
 7c3d55d811ef..24f56ed90ac3 100644
 --- a/drivers/staging/media/omap4iss/iss_csiphy.c
 +++ b/drivers/staging/media/omap4iss/iss_csiphy.c
 
 @@ -140,9 +140,7 @@ int omap4iss_csiphy_config(struct iss_device *iss,
* - bit [18] : CSIPHY1 CTRLCLK enable
* - bit [17:16] : CSIPHY1 config: 00 d-phy, 01/10 ccp2
*/
 - cam_rx_ctrl = omap4_ctrl_pad_readl(
 - OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_CAMERA_RX);
 -
 + cam_rx_ctrl = WARN_ON(1);
 
   if (subdevs-interface == ISS_INTERFACE_CSI2A_PHY1) {
   cam_rx_ctrl = ~(OMAP4_CAMERARX_CSI21_LANEENABLE_MASK |
 @@ -166,8 +164,7 @@ int omap4iss_csiphy_config(struct iss_device *iss,
   cam_rx_ctrl |= OMAP4_CAMERARX_CSI22_CTRLCLKEN_MASK;
   }
 
 - omap4_ctrl_pad_writel(cam_rx_ctrl,
 -  OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_CAMERA_RX);
 + WARN_ON(1);
 
   /* Reset used lane count */
   csi2-phy-used_data_lanes = 0;

-- 
Regards,

Laurent Pinchart

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


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

2015-04-12 Thread Laurent Pinchart
Hi Josh,

Thank you for the patch.

On Thursday 09 April 2015 17:01:48 Josh Wu wrote:
 The master clock should handled by sensor itself.
 
 Signed-off-by: Josh Wu josh...@atmel.com
 ---
 
 Changes in v2:
 - totally remove clock_start()/clock_stop() as they are optional.
 
  drivers/media/platform/soc_camera/atmel-isi.c | 45 
  1 file changed, 45 deletions(-)
 
 diff --git a/drivers/media/platform/soc_camera/atmel-isi.c
 b/drivers/media/platform/soc_camera/atmel-isi.c index 2b05f89..7bba7d9
 100644
 --- a/drivers/media/platform/soc_camera/atmel-isi.c
 +++ b/drivers/media/platform/soc_camera/atmel-isi.c
 @@ -83,8 +83,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;
 @@ -727,31 +725,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;
 @@ -865,8 +838,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,
 @@ -904,7 +875,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;

You can also remove the #define ISI_DEFAULT_MCLK_FREQ at the beginning of this 
file.

With this fixed,

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

   isi-pdata.frate = ISI_CFG1_FRATE_CAPTURE_ALL;
 
   np = of_graph_get_next_endpoint(np, NULL);
 @@ -980,21 +950,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,

-- 
Regards,

Laurent Pinchart

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


Re: [PATCH v2 1/3] media: atmel-isi: remove the useless code which disable isi

2015-04-12 Thread Laurent Pinchart
Hi Josh,

Thank you for the patch.

On Thursday 09 April 2015 17:01:46 Josh Wu wrote:
 To program ISI control register, the pixel clock should be enabled.

That's an awful hardware design :-(

 So without pixel clock (from sensor) enabled, disable ISI controller is
 not make sense. So this patch remove those code.
 
 Signed-off-by: Josh Wu josh...@atmel.com
 ---
 
 Changes in v2:
 - this file is new added.
 
  drivers/media/platform/soc_camera/atmel-isi.c | 5 -
  1 file changed, 5 deletions(-)
 
 diff --git a/drivers/media/platform/soc_camera/atmel-isi.c
 b/drivers/media/platform/soc_camera/atmel-isi.c index c125b1d..31254b4
 100644
 --- a/drivers/media/platform/soc_camera/atmel-isi.c
 +++ b/drivers/media/platform/soc_camera/atmel-isi.c
 @@ -131,8 +131,6 @@ static int configure_geometry(struct atmel_isi *isi, u32
 width, return -EINVAL;
   }
 
 - isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS);
 -
   cfg2 = isi_readl(isi, ISI_CFG2);

Can the configuration registers be accessed when the pixel clock is disabled ?

   /* Set YCC swap mode */
   cfg2 = ~ISI_CFG2_YCC_SWAP_MODE_MASK;
 @@ -843,7 +841,6 @@ static int isi_camera_set_bus_param(struct
 soc_camera_device *icd)
 
   cfg1 |= ISI_CFG1_THMASK_BEATS_16;
 
 - isi_writel(isi, ISI_CTRL, ISI_CTRL_DIS);
   isi_writel(isi, ISI_CFG1, cfg1);
 
   return 0;
 @@ -1022,8 +1019,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;

-- 
Regards,

Laurent Pinchart

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


Re: [PATCH] v4l: omap4iss: Replace outdated OMAP4 control pad API with syscon

2015-04-12 Thread Sakari Ailus
Hi Laurent,

On Sun, Apr 12, 2015 at 03:28:13PM +0300, Laurent Pinchart wrote:
 diff --git a/drivers/staging/media/omap4iss/iss_csiphy.c 
 b/drivers/staging/media/omap4iss/iss_csiphy.c
 index 7c3d55d..748607f 100644
 --- a/drivers/staging/media/omap4iss/iss_csiphy.c
 +++ b/drivers/staging/media/omap4iss/iss_csiphy.c
 @@ -13,6 +13,7 @@
  
  #include linux/delay.h
  #include linux/device.h
 +#include linux/regmap.h
  
  #include ../../../../arch/arm/mach-omap2/control.h
  
 @@ -140,9 +141,11 @@ int omap4iss_csiphy_config(struct iss_device *iss,
* - bit [18] : CSIPHY1 CTRLCLK enable
* - bit [17:16] : CSIPHY1 config: 00 d-phy, 01/10 ccp2
*/
 - cam_rx_ctrl = omap4_ctrl_pad_readl(
 - OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_CAMERA_RX);
 -
 + /*
 +  * TODO: When implementing DT support specify the CONTROL_CAMERA_RX
 +  * register offset in the syscon property instead of hardcoding it.
 +  */
 + regmap_read(iss-syscon, 0x68, cam_rx_ctrl);

Do you use platform data now? I guess the address is the same on all SoCs
that use the OMAP 4 ISS?

Acked-by: Sakari Alius sakari.ai...@iki.fi

-- 
Kind regards,

Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] v4l: omap4iss: Replace outdated OMAP4 control pad API with syscon

2015-04-12 Thread Laurent Pinchart
The omap4_ctrl_pad_readl and omap4_ctrl_pad_writel functions have been
removed by commit efde234674d9 (ARM: OMAP4+: control: remove support
for legacy pad read/write) but are still used by the OMAP4 ISS driver,
resulting in a compilation breakage:

drivers/staging/media/omap4iss/iss_csiphy.c: In function 
'omap4iss_csiphy_config':
drivers/staging/media/omap4iss/iss_csiphy.c:167:2: error: implicit declaration 
of function 'omap4_ctrl_pad_writel' [-Werror=implicit-function-declaration]
  omap4_ctrl_pad_writel(cam_rx_ctrl,

Fix the problem by using the syscon API to reaplace the control pad API.
Lookup the syscon instance by compatible name for now as the OMAP4 ISS
driver doesn't support DT yet.

Fixes: efde234674d9 (ARM: OMAP4+: control: remove support for legacy pad 
read/write)
Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
---
 drivers/staging/media/omap4iss/Kconfig  |  1 +
 drivers/staging/media/omap4iss/iss.c| 11 +++
 drivers/staging/media/omap4iss/iss.h|  4 
 drivers/staging/media/omap4iss/iss_csiphy.c | 12 +++-
 4 files changed, 23 insertions(+), 5 deletions(-)

Hi Arnd,

This patch doesn't depend nor conflict with the OMAP4 ISS patches scheduled to
be merged in v4.1. If Mauro is fine with that, and if it makes your life
easier, it could get merged through the arm-soc tree. Please let me know what
you prefer.

diff --git a/drivers/staging/media/omap4iss/Kconfig 
b/drivers/staging/media/omap4iss/Kconfig
index b78643f..072dac0 100644
--- a/drivers/staging/media/omap4iss/Kconfig
+++ b/drivers/staging/media/omap4iss/Kconfig
@@ -2,6 +2,7 @@ config VIDEO_OMAP4
bool OMAP 4 Camera support
depends on VIDEO_V4L2=y  VIDEO_V4L2_SUBDEV_API  I2C=y  ARCH_OMAP4
depends on HAS_DMA
+   select MFD_SYSCON
select VIDEOBUF2_DMA_CONTIG
---help---
  Driver for an OMAP 4 ISS controller.
diff --git a/drivers/staging/media/omap4iss/iss.c 
b/drivers/staging/media/omap4iss/iss.c
index 44b81a2..cf22dd2 100644
--- a/drivers/staging/media/omap4iss/iss.c
+++ b/drivers/staging/media/omap4iss/iss.c
@@ -17,6 +17,7 @@
 #include linux/dma-mapping.h
 #include linux/i2c.h
 #include linux/interrupt.h
+#include linux/mfd/syscon.h
 #include linux/module.h
 #include linux/platform_device.h
 #include linux/slab.h
@@ -1386,6 +1387,16 @@ static int iss_probe(struct platform_device *pdev)
 
platform_set_drvdata(pdev, iss);
 
+   /*
+* TODO: When implementing DT support switch to syscon regmap lookup by
+* phandle.
+*/
+   iss-syscon = syscon_regmap_lookup_by_compatible(syscon);
+   if (IS_ERR(iss-syscon)) {
+   ret = PTR_ERR(iss-syscon);
+   goto error;
+   }
+
/* Clocks */
ret = iss_map_mem_resource(pdev, iss, OMAP4_ISS_MEM_TOP);
if (ret  0)
diff --git a/drivers/staging/media/omap4iss/iss.h 
b/drivers/staging/media/omap4iss/iss.h
index 734cfee..35df8b4 100644
--- a/drivers/staging/media/omap4iss/iss.h
+++ b/drivers/staging/media/omap4iss/iss.h
@@ -29,6 +29,8 @@
 #include iss_ipipe.h
 #include iss_resizer.h
 
+struct regmap;
+
 #define to_iss_device(ptr_module)  \
container_of(ptr_module, struct iss_device, ptr_module)
 #define to_device(ptr_module)  \
@@ -79,6 +81,7 @@ struct iss_reg {
 
 /*
  * struct iss_device - ISS device structure.
+ * @syscon: Regmap for the syscon register space
  * @crashed: Bitmask of crashed entities (indexed by entity ID)
  */
 struct iss_device {
@@ -93,6 +96,7 @@ struct iss_device {
 
struct resource *res[OMAP4_ISS_MEM_LAST];
void __iomem *regs[OMAP4_ISS_MEM_LAST];
+   struct regmap *syscon;
 
u64 raw_dmamask;
 
diff --git a/drivers/staging/media/omap4iss/iss_csiphy.c 
b/drivers/staging/media/omap4iss/iss_csiphy.c
index 7c3d55d..748607f 100644
--- a/drivers/staging/media/omap4iss/iss_csiphy.c
+++ b/drivers/staging/media/omap4iss/iss_csiphy.c
@@ -13,6 +13,7 @@
 
 #include linux/delay.h
 #include linux/device.h
+#include linux/regmap.h
 
 #include ../../../../arch/arm/mach-omap2/control.h
 
@@ -140,9 +141,11 @@ int omap4iss_csiphy_config(struct iss_device *iss,
 * - bit [18] : CSIPHY1 CTRLCLK enable
 * - bit [17:16] : CSIPHY1 config: 00 d-phy, 01/10 ccp2
 */
-   cam_rx_ctrl = omap4_ctrl_pad_readl(
-   OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_CAMERA_RX);
-
+   /*
+* TODO: When implementing DT support specify the CONTROL_CAMERA_RX
+* register offset in the syscon property instead of hardcoding it.
+*/
+   regmap_read(iss-syscon, 0x68, cam_rx_ctrl);
 
if (subdevs-interface == ISS_INTERFACE_CSI2A_PHY1) {
cam_rx_ctrl = ~(OMAP4_CAMERARX_CSI21_LANEENABLE_MASK |
@@ -166,8 +169,7 @@ int omap4iss_csiphy_config(struct iss_device *iss,
cam_rx_ctrl |= OMAP4_CAMERARX_CSI22_CTRLCLKEN_MASK;
}
 
-   

Re: [PATCH 7/7] v4l2: remove g/s_crop and cropcap from video ops

2015-04-12 Thread Laurent Pinchart
Hi Hans,

Thank you for the patch.

On Thursday 09 April 2015 12:21:28 Hans Verkuil wrote:
 From: Hans Verkuil hans.verk...@cisco.com
 
 Replace all calls to g/s_crop and cropcap by calls to the
 get/set_selection pad ops.
 
 Remove the old g/s_crop and cropcap video ops since they are now no
 longer used.
 
 Signed-off-by: Hans Verkuil hans.verk...@cisco.com
 Cc: Guennadi Liakhovetski g.liakhovet...@gmx.de
 Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com
 ---
  drivers/media/i2c/ak881x.c |  28 +++--
  drivers/media/i2c/soc_camera/imx074.c  |  42 +++
  drivers/media/i2c/soc_camera/mt9m001.c |  70 ++-
  drivers/media/i2c/soc_camera/mt9m111.c |  57 -
  drivers/media/i2c/soc_camera/mt9t031.c |  52 +
  drivers/media/i2c/soc_camera/mt9t112.c |  60 +-
  drivers/media/i2c/soc_camera/mt9v022.c |  68 ++-
  drivers/media/i2c/soc_camera/ov2640.c  |  41 +++
  drivers/media/i2c/soc_camera/ov5642.c  |  53 +
  drivers/media/i2c/soc_camera/ov6650.c  |  74 ++--
  drivers/media/i2c/soc_camera/ov772x.c  |  44 ---
  drivers/media/i2c/soc_camera/ov9640.c  |  41 +++
  drivers/media/i2c/soc_camera/ov9740.c  |  41 +++
  drivers/media/i2c/soc_camera/rj54n1cb0c.c  |  52 +
  drivers/media/i2c/soc_camera/tw9910.c  |  47 +++-
  drivers/media/i2c/tvp5150.c|  81 +++--
  drivers/media/platform/omap3isp/ispvideo.c |  88 +-

The OMAP3 ISP set crop implementation (as well as the OMAP4 ISS 
implementation, as the code has been copied) is a leftover that should be 
removed. Your patch doesn't hurt though, so

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

for those two drivers.

I'll post a separate patch to remove set_selection on top of this patch 
series.

  drivers/media/platform/sh_vou.c|  13 ++-
  drivers/media/platform/soc_camera/mx2_camera.c |  18 ++-
  drivers/media/platform/soc_camera/mx3_camera.c |  18 ++-
  drivers/media/platform/soc_camera/omap1_camera.c   |  23 ++--
  drivers/media/platform/soc_camera/pxa_camera.c |  17 ++-
  drivers/media/platform/soc_camera/rcar_vin.c   |  26 ++---
  .../platform/soc_camera/sh_mobile_ceu_camera.c |  32 +++--
  drivers/media/platform/soc_camera/soc_camera.c | 130 +-
  .../platform/soc_camera/soc_camera_platform.c  |  45 +++
  drivers/media/platform/soc_camera/soc_scale_crop.c |  85 --
  drivers/media/platform/soc_camera/soc_scale_crop.h |   6 +-
  drivers/staging/media/omap4iss/iss_video.c |  88 +-
  include/media/soc_camera.h |   7 +-
  include/media/v4l2-subdev.h|   3 -
  31 files changed, 735 insertions(+), 715 deletions(-)

-- 
Regards,

Laurent Pinchart

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


Re: [PATCH] v4l: omap4iss: Replace outdated OMAP4 control pad API with syscon

2015-04-12 Thread Laurent Pinchart
Hi Sakari,

Thank you for the review.

On Sunday 12 April 2015 17:31:09 Sakari Ailus wrote:
 On Sun, Apr 12, 2015 at 03:28:13PM +0300, Laurent Pinchart wrote:
  diff --git a/drivers/staging/media/omap4iss/iss_csiphy.c
  b/drivers/staging/media/omap4iss/iss_csiphy.c index 7c3d55d..748607f
  100644
  --- a/drivers/staging/media/omap4iss/iss_csiphy.c
  +++ b/drivers/staging/media/omap4iss/iss_csiphy.c
  @@ -13,6 +13,7 @@
  
   #include linux/delay.h
   #include linux/device.h
  +#include linux/regmap.h
  
   #include ../../../../arch/arm/mach-omap2/control.h
  
  @@ -140,9 +141,11 @@ int omap4iss_csiphy_config(struct iss_device *iss,
   * - bit [18] : CSIPHY1 CTRLCLK enable
   * - bit [17:16] : CSIPHY1 config: 00 d-phy, 01/10 ccp2
   */
  -   cam_rx_ctrl = omap4_ctrl_pad_readl(
  -   OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_CAMERA_RX);
  -
  +   /*
  +* TODO: When implementing DT support specify the CONTROL_CAMERA_RX
  +* register offset in the syscon property instead of hardcoding it.
  +*/
  +   regmap_read(iss-syscon, 0x68, cam_rx_ctrl);
 
 Do you use platform data now? I guess the address is the same on all SoCs
 that use the OMAP 4 ISS?

Yes I use platform data for now. The address is the same on all SoCs on which 
I've tested the driver, which is a single SoC :-) I'll research that when 
implementing DT bindings.

 Acked-by: Sakari Alius sakari.ai...@iki.fi

Thank you.

-- 
Regards,

Laurent Pinchart

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


[PATCH] Add support for TechniSat Skystar S2

2015-04-12 Thread Jemma Denson
Signed-off-by: Jemma Denson jden...@gmail.com
---
 drivers/media/common/b2c2/Kconfig|1 +
 drivers/media/common/b2c2/flexcop-fe-tuner.c |   51 +-
 drivers/media/common/b2c2/flexcop-misc.c |1 +
 drivers/media/common/b2c2/flexcop-reg.h  |1 +
 drivers/media/dvb-frontends/Kconfig  |7 +
 drivers/media/dvb-frontends/Makefile |1 +
 drivers/media/dvb-frontends/cx24120.c| 1577 ++
 drivers/media/dvb-frontends/cx24120.h|   56 +
 8 files changed, 1688 insertions(+), 7 deletions(-)
 create mode 100644 drivers/media/dvb-frontends/cx24120.c
 create mode 100644 drivers/media/dvb-frontends/cx24120.h

diff --git a/drivers/media/common/b2c2/Kconfig 
b/drivers/media/common/b2c2/Kconfig
index a8c6cdf..e593638 100644
--- a/drivers/media/common/b2c2/Kconfig
+++ b/drivers/media/common/b2c2/Kconfig
@@ -14,6 +14,7 @@ config DVB_B2C2_FLEXCOP
select DVB_S5H1420 if MEDIA_SUBDRV_AUTOSELECT
select DVB_TUNER_ITD1000 if MEDIA_SUBDRV_AUTOSELECT
select DVB_ISL6421 if MEDIA_SUBDRV_AUTOSELECT
+   select DVB_CX24120 if MEDIA_SUBDRV_AUTOSELECT
select DVB_CX24123 if MEDIA_SUBDRV_AUTOSELECT
select MEDIA_TUNER_SIMPLE if MEDIA_SUBDRV_AUTOSELECT
select DVB_TUNER_CX24113 if MEDIA_SUBDRV_AUTOSELECT
diff --git a/drivers/media/common/b2c2/flexcop-fe-tuner.c 
b/drivers/media/common/b2c2/flexcop-fe-tuner.c
index 7e14e90..66f6910 100644
--- a/drivers/media/common/b2c2/flexcop-fe-tuner.c
+++ b/drivers/media/common/b2c2/flexcop-fe-tuner.c
@@ -12,6 +12,7 @@
 #include cx24113.h
 #include cx24123.h
 #include isl6421.h
+#include cx24120.h
 #include mt352.h
 #include bcm3510.h
 #include nxt200x.h
@@ -26,6 +27,16 @@
 #define FE_SUPPORTED(fe) (defined(CONFIG_DVB_##fe) || \
(defined(CONFIG_DVB_##fe##_MODULE)  defined(MODULE)))
 
+#if FE_SUPPORTED(BCM3510) || FE_SUPPORTED(CX24120)
+static int flexcop_fe_request_firmware(struct dvb_frontend *fe,
+   const struct firmware **fw, char *name)
+{
+   struct flexcop_device *fc = fe-dvb-priv;
+
+   return request_firmware(fw, name, fc-dev);
+}
+#endif
+
 /* lnb control */
 #if FE_SUPPORTED(MT312) || FE_SUPPORTED(STV0299)
 static int flexcop_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t 
voltage)
@@ -445,13 +456,6 @@ static int airstar_dvbt_attach(struct flexcop_device *fc,
 
 /* AirStar ATSC 1st generation */
 #if FE_SUPPORTED(BCM3510)
-static int flexcop_fe_request_firmware(struct dvb_frontend *fe,
-   const struct firmware **fw, char* name)
-{
-   struct flexcop_device *fc = fe-dvb-priv;
-   return request_firmware(fw, name, fc-dev);
-}
-
 static struct bcm3510_config air2pc_atsc_first_gen_config = {
.demod_address= 0x0f,
.request_firmware = flexcop_fe_request_firmware,
@@ -619,6 +623,38 @@ fail:
 #define cablestar2_attach NULL
 #endif
 
+/* SkyStar S2 PCI DVB-S/S2 card based on Conexant cx24120/cx24118 */
+#if FE_SUPPORTED(CX24120)  FE_SUPPORTED(ISL6421)
+static const struct cx24120_config skystar2_rev3_3_cx24120_config = {
+   .i2c_addr = 0x55,
+   .xtal_khz = 10111,
+   .initial_mpeg_config = { 0xa1, 0x76, 0x07 },
+   .request_firmware = flexcop_fe_request_firmware,
+};
+
+static int skystarS2_rev33_attach(struct flexcop_device *fc,
+   struct i2c_adapter *i2c)
+{
+   fc-fe = dvb_attach(cx24120_attach,
+   skystar2_rev3_3_cx24120_config, i2c);
+   if (fc-fe == NULL)
+   return 0;
+
+   fc-dev_type = FC_SKYS2_REV33;
+   fc-fc_i2c_adap[2].no_base_addr = 1;
+   if ((dvb_attach(isl6421_attach, fc-fe,
+   fc-fc_i2c_adap[2].i2c_adap, 0x08, 0, 0, false) == NULL)) {
+   err(ISL6421 could NOT be attached!);
+   return 0;
+   }
+   info(ISL6421 successfully attached.);
+
+   return 1;
+}
+#else
+#define skystarS2_rev33_attach NULL
+#endif
+
 static struct {
flexcop_device_type_t type;
int (*attach)(struct flexcop_device *, struct i2c_adapter *);
@@ -632,6 +668,7 @@ static struct {
{ FC_AIR_ATSC1, airstar_atsc1_attach },
{ FC_CABLE, cablestar2_attach },
{ FC_SKY_REV23, skystar2_rev23_attach },
+   { FC_SKYS2_REV33, skystarS2_rev33_attach },
 };
 
 /* try to figure out the frontend */
diff --git a/drivers/media/common/b2c2/flexcop-misc.c 
b/drivers/media/common/b2c2/flexcop-misc.c
index f06f3a9..b8eff23 100644
--- a/drivers/media/common/b2c2/flexcop-misc.c
+++ b/drivers/media/common/b2c2/flexcop-misc.c
@@ -56,6 +56,7 @@ static const char *flexcop_device_names[] = {
[FC_SKY_REV26]  = Sky2PC/SkyStar 2 DVB-S rev 2.6,
[FC_SKY_REV27]  = Sky2PC/SkyStar 2 DVB-S rev 2.7a/u,
[FC_SKY_REV28]  = Sky2PC/SkyStar 2 DVB-S rev 2.8,
+   [FC_SKYS2_REV33] = Sky2PC/SkyStar S2 DVB-S/S2 rev 3.3,
 };
 
 static const char *flexcop_bus_names[] = {
diff --git a/drivers/media/common/b2c2/flexcop-reg.h 
b/drivers/media/common/b2c2/flexcop-reg.h
index dc4528d..835c54d 100644