Re: stv090x vs stv0900 support

2013-08-16 Thread Mariusz Bialonczyk
On 07/24/2013 06:39 PM, Chris Lee wrote:
 Im looking for comments on these two modules, they overlap support for
 the same demods. stv0900 supporting stv0900 and stv090x supporting
 stv0900 and stv0903. Ive flipped a few cards from one to the other and
 they function fine. In some ways stv090x is better suited. Its a pain
 supporting two modules that are written differently but do the same
 thing, a fix in one almost always means it has to be implemented in
 the other as well.
I totally agree with you.

 Im not necessarily suggesting dumping stv0900, but Id like to flip a
 few cards that I own over to stv090x just to standardize it. The Prof
 7301 and Prof 7500.
I did it already for 7301, see here:
http://thread.gmane.org/gmane.linux.drivers.video-input-infrastructure/28082
but due to 'political' reasons it doesn't went upstream.
For private use i am still using this patch on recent kernels, because
it is working much more stable for my card comparing to stv0900.
I think that moving prof 7500 should be relative easy, i even prepared
a patch for this but I was not able to test it due to lack of hardware.

 Whats everyones thoughts on this? It will cut the number of patch''s
 in half when it comes to these demods. Ive got alot more coming lol :)
Oh yes, you could also take into account another duplicate code:
stb6100_cfg.h used for stv090x
stb6100_proc.h used for stv0900
In my patch I've successfully switched to stb6100_cfg.h.
 
 Chris
 --
 To unsubscribe from this list: send the line unsubscribe linux-media in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 

regards,
-- 
Mariusz Białończyk | xmpp/e-mail: ma...@skyboo.net
http://manio.skyboo.net | https://github.com/manio

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


Re: [PATCH v5 01/13] [media] exynos5-is: Adding media device driver for exynos5

2013-08-16 Thread Arun Kumar K
Hi Sylwester

On Thu, Aug 15, 2013 at 5:02 PM, Sylwester Nawrocki
sylvester.nawro...@gmail.com wrote:
 Hi,

 Thanks for the update. I'd like to possibly queue it for 3.12
 once the review comments are addressed and the DT maintainers
 are OK with that.


Thanks. Will post updated patchset today addressing all review comments.

Regards
Arun
--
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 02/13] [media] exynos5-fimc-is: Add Exynos5 FIMC-IS device tree bindings documentation

2013-08-16 Thread Arun Kumar K
Hi Sylwester,

On Thu, Aug 15, 2013 at 8:39 PM, Sylwester Nawrocki
sylvester.nawro...@gmail.com wrote:
 W dniu 2013-08-14 06:46, Arun Kumar K pisze:

 The patch adds the DT binding documentation for Samsung
 Exynos5 SoC series imaging subsystem (FIMC-IS).

 Signed-off-by: Arun Kumar K arun...@samsung.com
 Reviewed-by: Sylwester Nawrocki s.nawro...@samsung.com
 ---
   .../devicetree/bindings/media/exynos5-fimc-is.txt  |   47
 
   1 file changed, 47 insertions(+)
   create mode 100644
 Documentation/devicetree/bindings/media/exynos5-fimc-is.txt

 diff --git a/Documentation/devicetree/bindings/media/exynos5-fimc-is.txt
 b/Documentation/devicetree/bindings/media/exynos5-fimc-is.txt
 new file mode 100644
 index 000..bfd36df
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/media/exynos5-fimc-is.txt
 @@ -0,0 +1,47 @@
 +Samsung EXYNOS5 SoC series Imaging Subsystem (FIMC-IS)
 +--
 +
 +The camera subsystem on Samsung Exynos5 SoC has some changes relative
 +to previous SoC versions. Exynos5 has almost similar MIPI-CSIS and
 +FIMC-LITE IPs but has a much improved version of FIMC-IS which can
 +handle sensor controls and camera post-processing operations. The
 +Exynos5 FIMC-IS has a dedicated ARM Cortex A5 processor, many
 +post-processing blocks (ISP, DRC, FD, ODC, DIS, 3DNR) and two
 +dedicated scalers (SCC and SCP).
 +
 +fimc-is node
 +
 +
 +Required properties:
 +
 +- compatible: must be samsung,exynos5250-fimc-is
 +- reg   : physical base address and size of the memory mapped
 +  registers
 +- interrupt-parent  : parent interrupt controller
 +- interrupts: fimc-is interrupt to the parent combiner


 Is it really only one interrupt or two as in case of Exynos4x12 ?
 Also it's probably more appropriate to say interrupt controller
 instead of combiner, not including details of the the FIMC-IS external
 interrupt controller in this binding.


It needs only one interrupt and that is the one from A5 to main ARM processor.
Will change it to controller.


 +- clocks: list of clock specifiers, corresponding to entries
 in
 +  clock-names property;
 +- clock-names   : must contain isp, mcu_isp, isp_div0,
 isp_div1,
 +  isp_divmpwm, mcu_isp_div0, mcu_isp_div1
 entries,
 +  matching entries in the clocks property.
 +- pmu   : phandle to the fimc-is pmu node describing the
 register
 +  base and size for FIMC-IS PMU.


 This property needs to be prefixed with samsung,.


Ok

Regards
Arun
--
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: st-rc: Add ST remote control driver

2013-08-16 Thread Sean Young
On Wed, Aug 14, 2013 at 06:27:01PM +0100, Srinivas KANDAGATLA wrote:
 From: Srinivas Kandagatla srinivas.kandaga...@st.com
 
 This patch adds support to ST RC driver, which is basically a IR/UHF
 receiver and transmitter. This IP is common across all the ST parts for
 settop box platforms. IRB is embedded in ST COMMS IP block.
 It supports both Rx  Tx functionality.
 
 In this driver adds only Rx functionality via LIRC codec.
 
 Signed-off-by: Srinivas Kandagatla srinivas.kandaga...@st.com
 ---
 Hi Chehab,
 
 This is a very simple rc driver for IRB controller found in STi ARM CA9 SOCs.
 STi ARM SOC support went in 3.11 recently.
 This driver is a raw driver which feeds data to lirc codec for the user lircd
 to decode the keys.
 
 This patch is based on git://linuxtv.org/media_tree.git master branch.
 
 Comments?
 
 Thanks,
 srini
 
  Documentation/devicetree/bindings/media/st-rc.txt |   18 +
  drivers/media/rc/Kconfig  |   10 +
  drivers/media/rc/Makefile |1 +
  drivers/media/rc/st_rc.c  |  371 
 +
  4 files changed, 400 insertions(+), 0 deletions(-)
  create mode 100644 Documentation/devicetree/bindings/media/st-rc.txt
  create mode 100644 drivers/media/rc/st_rc.c
 
 diff --git a/Documentation/devicetree/bindings/media/st-rc.txt 
 b/Documentation/devicetree/bindings/media/st-rc.txt
 new file mode 100644
 index 000..57f9ee8
 --- /dev/null
 +++ b/Documentation/devicetree/bindings/media/st-rc.txt
 @@ -0,0 +1,18 @@
 +Device-Tree bindings for ST IR and UHF receiver
 +
 +Required properties:
 + - compatible: should be st,rc.
 + - st,uhfmode: boolean property to indicate if reception is in UHF.
 + - reg: base physical address of the controller and length of memory
 + mapped  region.
 + - interrupts: interrupt number to the cpu. The interrupt specifier
 + format depends on the interrupt controller parent.
 +
 +Example node:
 +
 + rc: rc@fe518000 {
 + compatible  = st,rc;
 + reg = 0xfe518000 0x234;
 + interrupts  =  0 203 0;
 + };
 +
 diff --git a/drivers/media/rc/Kconfig b/drivers/media/rc/Kconfig
 index 5a79c33..548a705 100644
 --- a/drivers/media/rc/Kconfig
 +++ b/drivers/media/rc/Kconfig
 @@ -321,4 +321,14 @@ config IR_GPIO_CIR
  To compile this driver as a module, choose M here: the module will
  be called gpio-ir-recv.
  
 +config RC_ST
 + tristate ST remote control receiver
 + depends on ARCH_STI  LIRC
 + help
 +  Say Y here if you want support for ST remote control driver
 +  which allows both IR and UHF RX. IR RX receiver is the default mode.
 +  The driver passes raw pluse and space information to the LIRC decoder.
 +
 +  If you're not sure, select N here.
 +
  endif #RC_DEVICES
 diff --git a/drivers/media/rc/Makefile b/drivers/media/rc/Makefile
 index 56bacf0..f4eb32c 100644
 --- a/drivers/media/rc/Makefile
 +++ b/drivers/media/rc/Makefile
 @@ -30,3 +30,4 @@ obj-$(CONFIG_RC_LOOPBACK) += rc-loopback.o
  obj-$(CONFIG_IR_GPIO_CIR) += gpio-ir-recv.o
  obj-$(CONFIG_IR_IGUANA) += iguanair.o
  obj-$(CONFIG_IR_TTUSBIR) += ttusbir.o
 +obj-$(CONFIG_RC_ST) += st_rc.o
 diff --git a/drivers/media/rc/st_rc.c b/drivers/media/rc/st_rc.c
 new file mode 100644
 index 000..712a2fb
 --- /dev/null
 +++ b/drivers/media/rc/st_rc.c
 @@ -0,0 +1,371 @@
 +/*
 + * Copyright (C) 2013 STMicroelectronics Limited
 + * Author: Srinivas Kandagatla srinivas.kandaga...@st.com
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License as published by
 + * the Free Software Foundation; either version 2 of the License, or
 + * (at your option) any later version.
 + */
 +#include linux/kernel.h
 +#include linux/clk.h
 +#include linux/interrupt.h
 +#include linux/module.h
 +#include linux/of.h
 +#include linux/platform_device.h
 +#include media/rc-core.h
 +#include linux/pinctrl/consumer.h
 +
 +struct st_rc_device {
 + struct device   *dev;
 + int irq;
 + int irq_wake;
 + struct clk  *sys_clock;
 + void*base;  /* Register base address */
 + void*rx_base;/* RX Register base address */
 + struct rc_dev   *rdev;
 + booloverclocking;
 + int sample_mult;
 + int sample_div;
 + boolrxuhfmode;
 +};
 +
 +/* Registers */
 +#define IRB_SAMPLE_RATE_COMM 0x64/* sample freq divisor*/
 +#define IRB_CLOCK_SEL0x70/* clock select   */
 +#define IRB_CLOCK_SEL_STATUS 0x74/* clock status   */
 +/* IRB IR/UHF receiver registers */
 +#define IRB_RX_ON   0x40 /* pulse time capture */
 +#define 

Re: DVR card SAA7134/SAA7135HL unknown

2013-08-16 Thread Jody Gugelhupf
Seems like something went wrong with pastebin, here the info again, would 
really appreciate some help:
http://pastebin.com/TUTpkc0F



- Original Message -
From: Jody Gugelhupf knuef...@yahoo.com
To: linux-media@vger.kernel.org linux-media@vger.kernel.org
Cc: 
Sent: Thursday, August 15, 2013 7:15:25 PM
Subject: DVR card SAA7134/SAA7135HL unknown

hi all :)
trying to get this 8 channel dvr card to work in linux, but I get this:

Board is currently unknown. You might try to use the card=nr
saa7134: insmod option to specify which board do you have, but this is
saa7134: somewhat risky, as might damage your card. It is better to ask
saa7134: for support at linux-media@vger.kernel.org.

so here I am. I have not tried to set the card myself as I don't know what 
number to use. Was hoping I could get some help here to get it working. Some 
info I collected so far can be found here http://pastebin.ca/2430477 any ideas 
what I might try next or what card to specify?
thank you in advance for any help.
jody 
--
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 v6 00/13] Exynos5 IS driver

2013-08-16 Thread Arun Kumar K
The patch series add support for Exynos5 camera subsystem. It
re-uses mipi-csis and fimc-lite from exynos4-is and adds a new
media device and fimc-is device drivers for exynos5.
The media device supports asynchronos subdev registration for the
fimc-is sensors and is tested on top of the patch series from Sylwester
for exynos4-is [1].

[1] http://www.mail-archive.com/linux-media@vger.kernel.org/msg64653.html

Changes from v5
---
- Addressed review comments from Sylwester
http://www.mail-archive.com/linux-media@vger.kernel.org/msg65578.html
http://www.mail-archive.com/linux-media@vger.kernel.org/msg65605.html

Changes from v4
---
- Addressed all review comments from Sylwester
- Added separate PMU node as suggested by Stephen Warren
- Added phandle based discovery of subdevs instead of node name

Changes from v3
---
- Dropped the RFC tag
- Addressed all review comments from Sylwester and Sachin
- Removed clock provider for media dev
- Added s5k4e5 sensor devicetree binding doc

Changes from v2
---
- Added exynos5 media device driver from Shaik to this series
- Added ISP pipeline support in media device driver
- Based on Sylwester's latest exynos4-is development
- Asynchronos registration of sensor subdevs
- Made independent IS-sensor support
- Add s5k4e5 sensor driver
- Addressed review comments from Sylwester, Hans, Andrzej, Sachin

Changes from v1
---
- Addressed all review comments from Sylwester
- Made sensor subdevs as independent i2c devices
- Lots of cleanup
- Debugfs support added
- Removed PMU global register access

Arun Kumar K (12):
  [media] exynos5-fimc-is: Add Exynos5 FIMC-IS device tree bindings
documentation
  [media] exynos5-fimc-is: Add driver core files
  [media] exynos5-fimc-is: Add common driver header files
  [media] exynos5-fimc-is: Add register definition and context header
  [media] exynos5-fimc-is: Add isp subdev
  [media] exynos5-fimc-is: Add scaler subdev
  [media] exynos5-fimc-is: Add sensor interface
  [media] exynos5-fimc-is: Add the hardware pipeline control
  [media] exynos5-fimc-is: Add the hardware interface module
  [media] exynos5-is: Add Kconfig and Makefile
  V4L: s5k6a3: Change sensor min/max resolutions
  V4L: Add driver for s5k4e5 image sensor

Shaik Ameer Basha (1):
  [media] exynos5-is: Adding media device driver for exynos5

 .../devicetree/bindings/media/exynos5-fimc-is.txt  |   47 +
 .../devicetree/bindings/media/exynos5-mdev.txt |  126 ++
 .../devicetree/bindings/media/i2c/s5k4e5.txt   |   43 +
 drivers/media/i2c/Kconfig  |8 +
 drivers/media/i2c/Makefile |1 +
 drivers/media/i2c/s5k4e5.c |  361 +
 drivers/media/i2c/s5k6a3.c |   19 +-
 drivers/media/platform/Kconfig |1 +
 drivers/media/platform/Makefile|1 +
 drivers/media/platform/exynos5-is/Kconfig  |   20 +
 drivers/media/platform/exynos5-is/Makefile |7 +
 drivers/media/platform/exynos5-is/exynos5-mdev.c   | 1210 ++
 drivers/media/platform/exynos5-is/exynos5-mdev.h   |  126 ++
 drivers/media/platform/exynos5-is/fimc-is-cmd.h|  187 +++
 drivers/media/platform/exynos5-is/fimc-is-core.c   |  413 +
 drivers/media/platform/exynos5-is/fimc-is-core.h   |  132 ++
 drivers/media/platform/exynos5-is/fimc-is-err.h|  257 +++
 .../media/platform/exynos5-is/fimc-is-interface.c  |  810 ++
 .../media/platform/exynos5-is/fimc-is-interface.h  |  125 ++
 drivers/media/platform/exynos5-is/fimc-is-isp.c|  534 ++
 drivers/media/platform/exynos5-is/fimc-is-isp.h|   90 ++
 .../media/platform/exynos5-is/fimc-is-metadata.h   |  767 +
 drivers/media/platform/exynos5-is/fimc-is-param.h  | 1159 ++
 .../media/platform/exynos5-is/fimc-is-pipeline.c   | 1692 
 .../media/platform/exynos5-is/fimc-is-pipeline.h   |  128 ++
 drivers/media/platform/exynos5-is/fimc-is-regs.h   |  105 ++
 drivers/media/platform/exynos5-is/fimc-is-scaler.c |  472 ++
 drivers/media/platform/exynos5-is/fimc-is-scaler.h |  106 ++
 drivers/media/platform/exynos5-is/fimc-is-sensor.c |   45 +
 drivers/media/platform/exynos5-is/fimc-is-sensor.h |   65 +
 drivers/media/platform/exynos5-is/fimc-is.h|  160 ++
 31 files changed, 9209 insertions(+), 8 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/media/exynos5-fimc-is.txt
 create mode 100644 Documentation/devicetree/bindings/media/exynos5-mdev.txt
 create mode 100644 Documentation/devicetree/bindings/media/i2c/s5k4e5.txt
 create mode 100644 drivers/media/i2c/s5k4e5.c
 create mode 100644 drivers/media/platform/exynos5-is/Kconfig
 create mode 100644 drivers/media/platform/exynos5-is/Makefile
 create mode 100644 drivers/media/platform/exynos5-is/exynos5-mdev.c
 create mode 100644 drivers/media/platform/exynos5-is/exynos5-mdev.h
 create mode 100644 

[PATCH v6 06/13] [media] exynos5-fimc-is: Add isp subdev

2013-08-16 Thread Arun Kumar K
fimc-is driver takes video data input from the ISP video node
which is added in this patch. This node accepts Bayer input
buffers which is given from the IS sensors.

Signed-off-by: Arun Kumar K arun...@samsung.com
Signed-off-by: Kilyeon Im kilyeon...@samsung.com
Reviewed-by: Sylwester Nawrocki s.nawro...@samsung.com
---
 drivers/media/platform/exynos5-is/fimc-is-isp.c |  534 +++
 drivers/media/platform/exynos5-is/fimc-is-isp.h |   90 
 2 files changed, 624 insertions(+)
 create mode 100644 drivers/media/platform/exynos5-is/fimc-is-isp.c
 create mode 100644 drivers/media/platform/exynos5-is/fimc-is-isp.h

diff --git a/drivers/media/platform/exynos5-is/fimc-is-isp.c 
b/drivers/media/platform/exynos5-is/fimc-is-isp.c
new file mode 100644
index 000..882c291
--- /dev/null
+++ b/drivers/media/platform/exynos5-is/fimc-is-isp.c
@@ -0,0 +1,534 @@
+/*
+ * Samsung EXYNOS5250 FIMC-IS (Imaging Subsystem) driver
+ *
+ * Copyright (C) 2013 Samsung Electronics Co., Ltd.
+ *  Arun Kumar K arun...@samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include media/v4l2-ioctl.h
+#include media/videobuf2-dma-contig.h
+
+#include fimc-is.h
+
+#define ISP_DRV_NAME fimc-is-isp
+
+static const struct fimc_is_fmt formats[] = {
+   {
+   .name   = Bayer GR-BG 8bits,
+   .fourcc = V4L2_PIX_FMT_SGRBG8,
+   .depth  = { 8 },
+   .num_planes = 1,
+   },
+   {
+   .name   = Bayer GR-BG 10bits,
+   .fourcc = V4L2_PIX_FMT_SGRBG10,
+   .depth  = { 16 },
+   .num_planes = 1,
+   },
+   {
+   .name   = Bayer GR-BG 12bits,
+   .fourcc = V4L2_PIX_FMT_SGRBG12,
+   .depth  = { 16 },
+   .num_planes = 1,
+   },
+};
+#define NUM_FORMATS ARRAY_SIZE(formats)
+
+static const struct fimc_is_fmt *find_format(struct v4l2_format *f)
+{
+   unsigned int i;
+
+   for (i = 0; i  NUM_FORMATS; i++)
+   if (formats[i].fourcc == f-fmt.pix_mp.pixelformat)
+   return formats[i];
+   return NULL;
+}
+
+static int isp_video_output_start_streaming(struct vb2_queue *vq,
+   unsigned int count)
+{
+   struct fimc_is_isp *isp = vb2_get_drv_priv(vq);
+
+   set_bit(STATE_RUNNING, isp-output_state);
+   return 0;
+}
+
+static int isp_video_output_stop_streaming(struct vb2_queue *vq)
+{
+   struct fimc_is_isp *isp = vb2_get_drv_priv(vq);
+   struct fimc_is_buf *buf;
+
+   /* Release unused buffers */
+   while (!list_empty(isp-wait_queue)) {
+   buf = fimc_is_isp_wait_queue_get(isp);
+   vb2_buffer_done(buf-vb, VB2_BUF_STATE_ERROR);
+   }
+   while (!list_empty(isp-run_queue)) {
+   buf = fimc_is_isp_run_queue_get(isp);
+   vb2_buffer_done(buf-vb, VB2_BUF_STATE_ERROR);
+   }
+
+   clear_bit(STATE_RUNNING, isp-output_state);
+   return 0;
+}
+
+static int isp_video_output_queue_setup(struct vb2_queue *vq,
+   const struct v4l2_format *pfmt,
+   unsigned int *num_buffers, unsigned int *num_planes,
+   unsigned int sizes[], void *allocators[])
+{
+   struct fimc_is_isp *isp = vb2_get_drv_priv(vq);
+   const struct fimc_is_fmt *fmt = isp-fmt;
+   unsigned int wh, i;
+
+   if (!fmt)
+   return -EINVAL;
+
+   *num_planes = fmt-num_planes;
+   wh = isp-width * isp-height;
+
+   for (i = 0; i  *num_planes; i++) {
+   allocators[i] = isp-alloc_ctx;
+   sizes[i] = (wh * fmt-depth[i]) / 8;
+   }
+   return 0;
+}
+
+static int isp_video_output_buffer_init(struct vb2_buffer *vb)
+{
+   struct fimc_is_buf *buf = container_of(vb, struct fimc_is_buf, vb);
+
+   buf-paddr[0] = vb2_dma_contig_plane_dma_addr(vb, 0);
+   return 0;
+}
+
+static int isp_video_output_buffer_prepare(struct vb2_buffer *vb)
+{
+   struct vb2_queue *vq = vb-vb2_queue;
+   struct fimc_is_isp *isp = vb2_get_drv_priv(vq);
+   unsigned long size;
+
+   size = (isp-width * isp-height * isp-fmt-depth[0]) / 8;
+   if (vb2_plane_size(vb, 0)  size) {
+   v4l2_err(isp-subdev, User buffer too small (%ld  %ld)\n,
+vb2_plane_size(vb, 0), size);
+   return -EINVAL;
+   }
+   vb2_set_plane_payload(vb, 0, size);
+
+   return 0;
+}
+
+static void isp_video_output_buffer_queue(struct vb2_buffer *vb)
+{
+   struct vb2_queue *vq = vb-vb2_queue;
+   struct fimc_is_isp *isp = vb2_get_drv_priv(vq);
+   struct fimc_is_buf *buf = container_of(vb, struct fimc_is_buf, vb);
+
+   

[PATCH v6 05/13] [media] exynos5-fimc-is: Add register definition and context header

2013-08-16 Thread Arun Kumar K
This patch adds the register definition file for the fimc-is driver
and also the header file containing the main context for the driver.

Signed-off-by: Arun Kumar K arun...@samsung.com
Signed-off-by: Kilyeon Im kilyeon...@samsung.com
Reviewed-by: Sylwester Nawrocki s.nawro...@samsung.com
---
 drivers/media/platform/exynos5-is/fimc-is-regs.h |  105 ++
 drivers/media/platform/exynos5-is/fimc-is.h  |  160 ++
 2 files changed, 265 insertions(+)
 create mode 100644 drivers/media/platform/exynos5-is/fimc-is-regs.h
 create mode 100644 drivers/media/platform/exynos5-is/fimc-is.h

diff --git a/drivers/media/platform/exynos5-is/fimc-is-regs.h 
b/drivers/media/platform/exynos5-is/fimc-is-regs.h
new file mode 100644
index 000..06aa466
--- /dev/null
+++ b/drivers/media/platform/exynos5-is/fimc-is-regs.h
@@ -0,0 +1,105 @@
+/*
+ * Samsung Exynos5 SoC series FIMC-IS driver
+ *
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd
+ * Arun Kumar K arun...@samsung.com
+ * Kil-yeon Lim kilyeon...@samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef FIMC_IS_REGS_H
+#define FIMC_IS_REGS_H
+
+/* WDT_ISP register */
+#define WDT0x0017
+/* MCUCTL register */
+#define MCUCTL 0x0018
+/* MCU Controller Register */
+#define MCUCTLR(MCUCTL+0x00)
+#define MCUCTLR_AXI_ISPX_AWCACHE(x)((x)  16)
+#define MCUCTLR_AXI_ISPX_ARCACHE(x)((x)  12)
+#define MCUCTLR_MSWRST (1  0)
+/* Boot Base OFfset Address Register */
+#define BBOAR  (MCUCTL+0x04)
+#define BBOAR_BBOA(x)  ((x)  0)
+
+/* Interrupt Generation Register 0 from Host CPU to VIC */
+#define INTGR0 (MCUCTL+0x08)
+#define INTGR0_INTGC(n)(1  ((n) + 16))
+#define INTGR0_INTGD(n)(1  (n))
+
+/* Interrupt Clear Register 0 from Host CPU to VIC */
+#define INTCR0 (MCUCTL+0x0c)
+#define INTCR0_INTCC(n)(1  ((n) + 16))
+#define INTCR0_INTCD(n)(1  (n))
+
+/* Interrupt Mask Register 0 from Host CPU to VIC */
+#define INTMR0 (MCUCTL+0x10)
+#define INTMR0_INTMC(n)(1  ((n) + 16))
+#define INTMR0_INTMD(n)(1  (n))
+
+/* Interrupt Status Register 0 from Host CPU to VIC */
+#define INTSR0 (MCUCTL+0x14)
+#define INTSR0_GET_INTSD(n, x) (((x)  (n))  0x1)
+#define INTSR0_GET_INTSC(n, x) (((x)  ((n) + 16))  0x1)
+
+/* Interrupt Mask Status Register 0 from Host CPU to VIC */
+#define INTMSR0(MCUCTL+0x18)
+#define INTMSR0_GET_INTMSD(n, x)   (((x)  (n))  0x1)
+#define INTMSR0_GET_INTMSC(n, x)   (((x)  ((n) + 16))  0x1)
+
+/* Interrupt Generation Register 1 from ISP CPU to Host IC */
+#define INTGR1 (MCUCTL+0x1c)
+#define INTGR1_INTGC(n)(1  (n))
+
+/* Interrupt Clear Register 1 from ISP CPU to Host IC */
+#define INTCR1 (MCUCTL+0x20)
+#define INTCR1_INTCC(n)(1  (n))
+
+/* Interrupt Mask Register 1 from ISP CPU to Host IC */
+#define INTMR1 (MCUCTL+0x24)
+#define INTMR1_INTMC(n)(1  (n))
+
+/* Interrupt Status Register 1 from ISP CPU to Host IC */
+#define INTSR1 (MCUCTL+0x28)
+/* Interrupt Mask Status Register 1 from ISP CPU to Host IC */
+#define INTMSR1(MCUCTL+0x2c)
+/* Interrupt Clear Register 2 from ISP BLK's interrupts to Host IC */
+#define INTCR2 (MCUCTL+0x30)
+#define INTCR2_INTCC(n)(1  (n))
+
+/* Interrupt Mask Register 2 from ISP BLK's interrupts to Host IC */
+#define INTMR2 (MCUCTL+0x34)
+#define INTMR2_INTMCIS(n)  (1  (n))
+
+/* Interrupt Status Register 2 from ISP BLK's interrupts to Host IC */
+#define INTSR2 (MCUCTL+0x38)
+/* Interrupt Mask Status Register 2 from ISP BLK's interrupts to Host IC */
+#define INTMSR2(MCUCTL+0x3c)
+/* General Purpose Output Control Register (0~17) */
+#define GPOCTLR(MCUCTL+0x40)
+#define GPOCTLR_GPOG(n, x) ((x)  (n))
+
+/* General Purpose Pad Output Enable Register (0~17) */
+#define GPOENCTLR  (MCUCTL+0x44)
+#define GPOENCTLR_GPOEN0(n, x) ((x)  (n))
+
+/* General Purpose Input Control Register (0~17) */
+#define GPICTLR(MCUCTL+0x48)
+
+/* IS Shared Registers between ISP CPU and HOST CPU */
+#define ISSR(n)(MCUCTL + 0x80 + (n))
+
+/* PMU for FIMC-IS*/
+#define 

[PATCH v6 07/13] [media] exynos5-fimc-is: Add scaler subdev

2013-08-16 Thread Arun Kumar K
FIMC-IS has two hardware scalers named as scaler-codec and
scaler-preview. This patch adds the common code handling the
video nodes and subdevs of both the scalers.

Signed-off-by: Arun Kumar K arun...@samsung.com
Signed-off-by: Kilyeon Im kilyeon...@samsung.com
Reviewed-by: Sylwester Nawrocki s.nawro...@samsung.com
---
 drivers/media/platform/exynos5-is/fimc-is-scaler.c |  472 
 drivers/media/platform/exynos5-is/fimc-is-scaler.h |  106 +
 2 files changed, 578 insertions(+)
 create mode 100644 drivers/media/platform/exynos5-is/fimc-is-scaler.c
 create mode 100644 drivers/media/platform/exynos5-is/fimc-is-scaler.h

diff --git a/drivers/media/platform/exynos5-is/fimc-is-scaler.c 
b/drivers/media/platform/exynos5-is/fimc-is-scaler.c
new file mode 100644
index 000..82ba867
--- /dev/null
+++ b/drivers/media/platform/exynos5-is/fimc-is-scaler.c
@@ -0,0 +1,472 @@
+/*
+ * Samsung EXYNOS5250 FIMC-IS (Imaging Subsystem) driver
+ *
+ * Copyright (C) 2013 Samsung Electronics Co., Ltd.
+ *  Arun Kumar K arun...@samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include media/v4l2-ioctl.h
+#include media/videobuf2-dma-contig.h
+
+#include fimc-is.h
+
+#define IS_SCALER_DRV_NAME fimc-is-scaler
+
+static const struct fimc_is_fmt formats[] = {
+   {
+   .name   = YUV 4:2:0 3p MultiPlanar,
+   .fourcc = V4L2_PIX_FMT_YUV420M,
+   .depth  = {8, 2, 2},
+   .num_planes = 3,
+   },
+   {
+   .name   = YUV 4:2:0 2p MultiPlanar,
+   .fourcc = V4L2_PIX_FMT_NV12M,
+   .depth  = {8, 4},
+   .num_planes = 2,
+   },
+   {
+   .name   = YUV 4:2:2 1p MultiPlanar,
+   .fourcc = V4L2_PIX_FMT_NV16,
+   .depth  = {16},
+   .num_planes = 1,
+   },
+};
+#define NUM_FORMATS ARRAY_SIZE(formats)
+
+static const struct fimc_is_fmt *find_format(struct v4l2_format *f)
+{
+   unsigned int i;
+
+   for (i = 0; i  NUM_FORMATS; i++) {
+   if (formats[i].fourcc == f-fmt.pix_mp.pixelformat)
+   return formats[i];
+   }
+   return NULL;
+}
+
+static int scaler_video_capture_start_streaming(struct vb2_queue *vq,
+   unsigned int count)
+{
+   struct fimc_is_scaler *ctx = vb2_get_drv_priv(vq);
+   int ret;
+
+   ret = fimc_is_pipeline_scaler_start(ctx-pipeline,
+   ctx-scaler_id,
+   vq-num_buffers,
+   ctx-fmt-num_planes);
+   if (ret) {
+   v4l2_err(ctx-subdev, Scaler start failed.\n);
+   return -EINVAL;
+   }
+
+   set_bit(STATE_RUNNING, ctx-capture_state);
+   return 0;
+}
+
+static int scaler_video_capture_stop_streaming(struct vb2_queue *vq)
+{
+   struct fimc_is_scaler *ctx = vb2_get_drv_priv(vq);
+   struct fimc_is_buf *buf;
+   int ret;
+
+   ret = fimc_is_pipeline_scaler_stop(ctx-pipeline, ctx-scaler_id);
+   if (ret)
+   v4l2_info(ctx-subdev, Scaler already stopped.\n);
+
+   /* Release un-used buffers */
+   while (!list_empty(ctx-wait_queue)) {
+   buf = fimc_is_scaler_wait_queue_get(ctx);
+   vb2_buffer_done(buf-vb, VB2_BUF_STATE_ERROR);
+   }
+   while (!list_empty(ctx-run_queue)) {
+   buf = fimc_is_scaler_run_queue_get(ctx);
+   vb2_buffer_done(buf-vb, VB2_BUF_STATE_ERROR);
+   }
+
+   clear_bit(STATE_RUNNING, ctx-capture_state);
+   return 0;
+}
+
+static int scaler_video_capture_queue_setup(struct vb2_queue *vq,
+   const struct v4l2_format *pfmt,
+   unsigned int *num_buffers, unsigned int *num_planes,
+   unsigned int sizes[], void *allocators[])
+{
+   struct fimc_is_scaler *ctx = vb2_get_drv_priv(vq);
+   const struct fimc_is_fmt *fmt = ctx-fmt;
+   unsigned int wh;
+   int i;
+
+   if (!fmt)
+   return -EINVAL;
+
+   *num_planes = fmt-num_planes;
+   wh = ctx-width * ctx-height;
+
+   for (i = 0; i  *num_planes; i++) {
+   allocators[i] = ctx-alloc_ctx;
+   sizes[i] = (wh * fmt-depth[i]) / 8;
+   }
+   return 0;
+}
+
+static int scaler_video_capture_buffer_init(struct vb2_buffer *vb)
+{
+   struct vb2_queue *vq = vb-vb2_queue;
+   struct fimc_is_scaler *ctx = vb2_get_drv_priv(vq);
+   struct fimc_is_buf *buf = container_of(vb, struct fimc_is_buf, vb);
+   const struct fimc_is_fmt *fmt;
+   int i;
+
+   fmt = ctx-fmt;
+   for (i = 0; i  fmt-num_planes; i++)
+   buf-paddr[i] = vb2_dma_contig_plane_dma_addr(vb, i);
+
+   

[PATCH v6 03/13] [media] exynos5-fimc-is: Add driver core files

2013-08-16 Thread Arun Kumar K
This driver is for the FIMC-IS IP available in Samsung Exynos5
SoC onwards. This patch adds the core files for the new driver.

Signed-off-by: Arun Kumar K arun...@samsung.com
Signed-off-by: Kilyeon Im kilyeon...@samsung.com
Reviewed-by: Sylwester Nawrocki s.nawro...@samsung.com
---
 drivers/media/platform/exynos5-is/fimc-is-core.c |  413 ++
 drivers/media/platform/exynos5-is/fimc-is-core.h |  132 +++
 2 files changed, 545 insertions(+)
 create mode 100644 drivers/media/platform/exynos5-is/fimc-is-core.c
 create mode 100644 drivers/media/platform/exynos5-is/fimc-is-core.h

diff --git a/drivers/media/platform/exynos5-is/fimc-is-core.c 
b/drivers/media/platform/exynos5-is/fimc-is-core.c
new file mode 100644
index 000..6910581
--- /dev/null
+++ b/drivers/media/platform/exynos5-is/fimc-is-core.c
@@ -0,0 +1,413 @@
+/*
+ * Samsung EXYNOS5 FIMC-IS (Imaging Subsystem) driver
+*
+ * Copyright (C) 2013 Samsung Electronics Co., Ltd.
+ * Arun Kumar K arun...@samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include linux/bug.h
+#include linux/ctype.h
+#include linux/device.h
+#include linux/debugfs.h
+#include linux/delay.h
+#include linux/errno.h
+#include linux/err.h
+#include linux/firmware.h
+#include linux/fs.h
+#include linux/gpio.h
+#include linux/interrupt.h
+#include linux/kernel.h
+#include linux/list.h
+#include linux/module.h
+#include linux/of.h
+#include linux/of_gpio.h
+#include linux/of_address.h
+#include linux/of_platform.h
+#include linux/of_irq.h
+#include linux/pinctrl/consumer.h
+#include linux/platform_device.h
+#include linux/pm_runtime.h
+#include linux/slab.h
+#include linux/types.h
+#include linux/videodev2.h
+
+#include media/v4l2-device.h
+#include media/v4l2-ioctl.h
+#include media/v4l2-mem2mem.h
+#include media/v4l2-of.h
+#include media/videobuf2-core.h
+#include media/videobuf2-dma-contig.h
+
+#include fimc-is.h
+#include fimc-is-i2c.h
+
+#define CLK_MCU_ISP_DIV0_FREQ  (200 * 100)
+#define CLK_MCU_ISP_DIV1_FREQ  (100 * 100)
+#define CLK_ISP_DIV0_FREQ  (134 * 100)
+#define CLK_ISP_DIV1_FREQ  (68 * 100)
+#define CLK_ISP_DIVMPWM_FREQ   (34 * 100)
+
+static const char * const fimc_is_clock_name[] = {
+   [IS_CLK_ISP]= isp,
+   [IS_CLK_MCU_ISP]= mcu_isp,
+   [IS_CLK_ISP_DIV0]   = isp_div0,
+   [IS_CLK_ISP_DIV1]   = isp_div1,
+   [IS_CLK_ISP_DIVMPWM]= isp_divmpwm,
+   [IS_CLK_MCU_ISP_DIV0]   = mcu_isp_div0,
+   [IS_CLK_MCU_ISP_DIV1]   = mcu_isp_div1,
+};
+
+static void fimc_is_put_clocks(struct fimc_is *is)
+{
+   int i;
+
+   for (i = 0; i  IS_CLK_MAX_NUM; i++) {
+   if (IS_ERR(is-clock[i]))
+   continue;
+   clk_unprepare(is-clock[i]);
+   clk_put(is-clock[i]);
+   is-clock[i] = ERR_PTR(-EINVAL);
+   }
+}
+
+static int fimc_is_get_clocks(struct fimc_is *is)
+{
+   struct device *dev = is-pdev-dev;
+   int i, ret;
+
+   for (i = 0; i  IS_CLK_MAX_NUM; i++) {
+   is-clock[i] = clk_get(dev, fimc_is_clock_name[i]);
+   if (IS_ERR(is-clock[i]))
+   goto err;
+   ret = clk_prepare(is-clock[i]);
+   if (ret  0) {
+   clk_put(is-clock[i]);
+   is-clock[i] = ERR_PTR(-EINVAL);
+   goto err;
+   }
+   }
+   return 0;
+err:
+   fimc_is_put_clocks(is);
+   pr_err(Failed to get clock: %s\n, fimc_is_clock_name[i]);
+   return -ENXIO;
+}
+
+static int fimc_is_configure_clocks(struct fimc_is *is)
+{
+   int i, ret;
+
+   for (i = 0; i  IS_CLK_MAX_NUM; i++)
+   is-clock[i] = ERR_PTR(-EINVAL);
+
+   ret = fimc_is_get_clocks(is);
+   if (ret)
+   return ret;
+
+   /* Set rates */
+   ret = clk_set_rate(is-clock[IS_CLK_MCU_ISP_DIV0],
+   CLK_MCU_ISP_DIV0_FREQ);
+   if (ret)
+   return ret;
+   ret = clk_set_rate(is-clock[IS_CLK_MCU_ISP_DIV1],
+   CLK_MCU_ISP_DIV1_FREQ);
+   if (ret)
+   return ret;
+   ret = clk_set_rate(is-clock[IS_CLK_ISP_DIV0], CLK_ISP_DIV0_FREQ);
+   if (ret)
+   return ret;
+   ret = clk_set_rate(is-clock[IS_CLK_ISP_DIV1], CLK_ISP_DIV1_FREQ);
+   if (ret)
+   return ret;
+   ret = clk_set_rate(is-clock[IS_CLK_ISP_DIVMPWM],
+   CLK_ISP_DIVMPWM_FREQ);
+   return ret;
+}
+
+static void fimc_is_pipelines_destroy(struct fimc_is *is)
+{
+   int i;
+
+   for (i = 0; i  is-drvdata-num_instances; i++)
+   fimc_is_pipeline_destroy(is-pipeline[i]);
+}
+
+static int fimc_is_parse_sensor_config(struct fimc_is *is, unsigned int index,
+  

[PATCH v6 02/13] [media] exynos5-fimc-is: Add Exynos5 FIMC-IS device tree bindings documentation

2013-08-16 Thread Arun Kumar K
The patch adds the DT binding documentation for Samsung
Exynos5 SoC series imaging subsystem (FIMC-IS).

Signed-off-by: Arun Kumar K arun...@samsung.com
Reviewed-by: Sylwester Nawrocki s.nawro...@samsung.com
---
 .../devicetree/bindings/media/exynos5-fimc-is.txt  |   47 
 1 file changed, 47 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/exynos5-fimc-is.txt

diff --git a/Documentation/devicetree/bindings/media/exynos5-fimc-is.txt 
b/Documentation/devicetree/bindings/media/exynos5-fimc-is.txt
new file mode 100644
index 000..bc279b4
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/exynos5-fimc-is.txt
@@ -0,0 +1,47 @@
+Samsung EXYNOS5 SoC series Imaging Subsystem (FIMC-IS)
+--
+
+The camera subsystem on Samsung Exynos5 SoC has some changes relative
+to previous SoC versions. Exynos5 has almost similar MIPI-CSIS and
+FIMC-LITE IPs but has a much improved version of FIMC-IS which can
+handle sensor controls and camera post-processing operations. The
+Exynos5 FIMC-IS has a dedicated ARM Cortex A5 processor, many
+post-processing blocks (ISP, DRC, FD, ODC, DIS, 3DNR) and two
+dedicated scalers (SCC and SCP).
+
+fimc-is node
+
+
+Required properties:
+
+- compatible: must be samsung,exynos5250-fimc-is
+- reg   : physical base address and size of the memory mapped
+  registers
+- interrupt-parent  : parent interrupt controller
+- interrupts: fimc-is interrupt to the parent interrupt controller
+- clocks: list of clock specifiers, corresponding to entries in
+  clock-names property;
+- clock-names   : must contain isp, mcu_isp, isp_div0, isp_div1,
+  isp_divmpwm, mcu_isp_div0, mcu_isp_div1 entries,
+  matching entries in the clocks property.
+- samsung,pmu   : phandle to the fimc-is pmu node describing the register
+  base and size for FIMC-IS PMU.
+
+i2c-isp (ISP I2C bus controller) nodes
+--
+
+Required properties:
+
+- compatible   : should be samsung,exynos4212-i2c-isp for Exynos4212,
+ Exynos4412 and Exynos5250 SoCs;
+- reg  : physical base address and length of the registers set;
+- clocks   : must contain gate clock specifier for this controller;
+- clock-names  : must contain i2c_isp entry.
+
+For the i2c-isp node, it is required to specify a pinctrl state named 
default,
+according to the pinctrl bindings defined in ../pinctrl/pinctrl-bindings.txt.
+
+Device tree nodes of the image sensors controlled directly by the FIMC-IS
+firmware must be child nodes of their corresponding ISP I2C bus controller 
node.
+The data link of these image sensors must be specified using the common video
+interfaces bindings, defined in video-interfaces.txt.
-- 
1.7.9.5

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


[PATCH v6 01/13] [media] exynos5-is: Adding media device driver for exynos5

2013-08-16 Thread Arun Kumar K
From: Shaik Ameer Basha shaik.am...@samsung.com

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

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

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

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

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

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

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

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

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

diff --git a/Documentation/devicetree/bindings/media/exynos5-mdev.txt 
b/Documentation/devicetree/bindings/media/exynos5-mdev.txt
new file mode 100644
index 000..b1299e2
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/exynos5-mdev.txt
@@ -0,0 +1,126 @@
+Samsung EXYNOS5 SoC Camera Subsystem
+
+
+The Exynos5 SoC Camera subsystem comprises of multiple sub-devices
+represented by separate device tree nodes. Currently this includes: FIMC-LITE,
+MIPI CSIS and FIMC-IS.
+
+The sub-device nodes are referenced using phandles in the common 'camera' node
+which also includes common properties of the whole subsystem not really
+specific to any single sub-device, like common camera port pins or the common
+camera bus clocks.
+
+Common 'camera' node
+
+
+Required properties:
+
+- compatible   : must be samsung,exynos5250-fimc
+- clocks   : list of clock specifiers, corresponding to entries in
+  the clock-names property;
+- clock-names  : must contain sclk_bayer entry
+- samsung,csis : list of phandles to the mipi-csis device nodes
+- samsung,fimc-lite: list of phandles to the fimc-lite device nodes
+- samsung,fimc-is  : phandle to the fimc-is device node
+
+The pinctrl bindings defined in ../pinctrl/pinctrl-bindings.txt must be used
+to define a required pinctrl state named default.
+
+'parallel-ports' node
+-
+
+This node should contain child 'port' nodes specifying active parallel video
+input ports. It includes camera A, camera B and RGB bay inputs.
+'reg' property in the port nodes specifies the input type:
+ 1 - parallel camport A
+ 2 - parallel camport B
+ 5 - RGB camera bay
+
+3, 4 are for MIPI CSI-2 bus and are already described in samsung-mipi-csis.txt
+
+Image sensor nodes
+--
+
+The sensor device nodes should be added to their control bus controller (e.g.
+I2C0) nodes and linked to a port node in the csis or the parallel-ports node,
+using the common video interfaces bindings, defined in video-interfaces.txt.
+
+Example:
+
+   aliases {
+   fimc-lite0 = fimc_lite_0
+   };
+
+   /* Parallel bus IF sensor */
+   i2c_0: i2c@1386 {
+   s5k6aa: sensor@3c {
+   compatible = samsung,s5k6aafx;
+   reg = 0x3c;
+   vddio-supply = ...;
+
+   clock-frequency = 2400;
+   clocks = ...;
+   clock-names = mclk;
+
+   port {
+   s5k6aa_ep: endpoint {
+   remote-endpoint = fimc0_ep;
+   bus-width = 8;
+   hsync-active = 0;
+   vsync-active = 1;
+   pclk-sample = 1;
+   };
+   };
+   };
+   };
+
+   /* MIPI CSI-2 bus IF sensor */
+   s5c73m3: sensor@1a {
+   compatible = samsung,s5c73m3;
+  

[PATCH v6 10/13] [media] exynos5-fimc-is: Add the hardware interface module

2013-08-16 Thread Arun Kumar K
The hardware interface module finally sends the commands to the
FIMC-IS firmware and runs the interrupt handler for getting the
responses.

Signed-off-by: Arun Kumar K arun...@samsung.com
Signed-off-by: Kilyeon Im kilyeon...@samsung.com
Reviewed-by: Sylwester Nawrocki s.nawro...@samsung.com
---
 .../media/platform/exynos5-is/fimc-is-interface.c  |  810 
 .../media/platform/exynos5-is/fimc-is-interface.h  |  125 +++
 2 files changed, 935 insertions(+)
 create mode 100644 drivers/media/platform/exynos5-is/fimc-is-interface.c
 create mode 100644 drivers/media/platform/exynos5-is/fimc-is-interface.h

diff --git a/drivers/media/platform/exynos5-is/fimc-is-interface.c 
b/drivers/media/platform/exynos5-is/fimc-is-interface.c
new file mode 100644
index 000..c5da6ff
--- /dev/null
+++ b/drivers/media/platform/exynos5-is/fimc-is-interface.c
@@ -0,0 +1,810 @@
+/*
+ * Samsung EXYNOS5 FIMC-IS (Imaging Subsystem) driver
+*
+ * Copyright (C) 2013 Samsung Electronics Co., Ltd.
+ * Kil-yeon Lim kilyeon...@samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include linux/debugfs.h
+#include linux/seq_file.h
+#include fimc-is.h
+#include fimc-is-cmd.h
+#include fimc-is-regs.h
+
+#define init_request_barrier(itf) mutex_init(itf-request_barrier)
+#define enter_request_barrier(itf) mutex_lock(itf-request_barrier)
+#define exit_request_barrier(itf) mutex_unlock(itf-request_barrier)
+
+static inline void itf_get_cmd(struct fimc_is_interface *itf,
+   struct fimc_is_msg *msg, unsigned int index)
+{
+   struct is_common_reg __iomem *com_regs = itf-com_regs;
+
+   memset(msg, 0, sizeof(*msg));
+
+   switch (index) {
+   case INTR_GENERAL:
+   msg-command = com_regs-ihcmd;
+   msg-instance = com_regs-ihc_sensorid;
+   memcpy(msg-param, com_regs-ihc_param,
+   4 * sizeof(msg-param[0]));
+   break;
+   case INTR_SCC_FDONE:
+   msg-command = IHC_FRAME_DONE;
+   msg-instance = com_regs-scc_sensor_id;
+   memcpy(msg-param, com_regs-scc_param,
+   3 * sizeof(msg-param[0]));
+   break;
+   case INTR_SCP_FDONE:
+   msg-command = IHC_FRAME_DONE;
+   msg-instance = com_regs-scp_sensor_id;
+   memcpy(msg-param, com_regs-scp_param,
+   3 * sizeof(msg-param[0]));
+   break;
+   case INTR_META_DONE:
+   msg-command = IHC_FRAME_DONE;
+   msg-instance = com_regs-meta_sensor_id;
+   msg-param[0] = com_regs-meta_param1;
+   break;
+   case INTR_SHOT_DONE:
+   msg-command = IHC_FRAME_DONE;
+   msg-instance = com_regs-shot_sensor_id;
+   memcpy(msg-param, com_regs-shot_param,
+   2 * sizeof(msg-param[0]));
+   break;
+   default:
+   dev_err(itf-dev, %s Unknown command\n, __func__);
+   break;
+   }
+}
+
+static inline unsigned int itf_get_intr(struct fimc_is_interface *itf)
+{
+   unsigned int status;
+   struct is_common_reg __iomem *com_regs = itf-com_regs;
+
+   status = readl(itf-regs + INTMSR1) | com_regs-ihcmd_iflag |
+   com_regs-scc_iflag |
+   com_regs-scp_iflag |
+   com_regs-meta_iflag |
+   com_regs-shot_iflag;
+
+   return status;
+}
+
+static void itf_set_state(struct fimc_is_interface *itf,
+   unsigned long state)
+{
+   unsigned long flags;
+   spin_lock_irqsave(itf-slock_state, flags);
+   __set_bit(state, itf-state);
+   spin_unlock_irqrestore(itf-slock_state, flags);
+}
+
+static void itf_clr_state(struct fimc_is_interface *itf,
+   unsigned long state)
+{
+   unsigned long flags;
+   spin_lock_irqsave(itf-slock_state, flags);
+   __clear_bit(state, itf-state);
+   spin_unlock_irqrestore(itf-slock_state, flags);
+}
+
+static int itf_get_state(struct fimc_is_interface *itf,
+   unsigned long state)
+{
+   int ret = 0;
+   unsigned long flags;
+
+   spin_lock_irqsave(itf-slock_state, flags);
+   ret = test_bit(state, itf-state);
+   spin_unlock_irqrestore(itf-slock_state, flags);
+   return ret;
+}
+
+static void itf_init_wakeup(struct fimc_is_interface *itf)
+{
+   itf_set_state(itf, IS_IF_STATE_INIT);
+   wake_up(itf-irq_queue);
+}
+
+void itf_busy_wakeup(struct fimc_is_interface *itf)
+{
+   itf_clr_state(itf, IS_IF_STATE_BUSY);
+   wake_up(itf-irq_queue);
+}
+
+static int itf_wait_hw_ready(struct fimc_is_interface *itf)
+{
+   int t;
+   for (t = TRY_RECV_AWARE_COUNT; t = 0; t--) {
+   unsigned int cfg = readl(itf-regs + INTMSR0);
+   

[PATCH v6 09/13] [media] exynos5-fimc-is: Add the hardware pipeline control

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

Signed-off-by: Arun Kumar K arun...@samsung.com
Signed-off-by: Kilyeon Im kilyeon...@samsung.com
Reviewed-by: Sylwester Nawrocki s.nawro...@samsung.com
---
 .../media/platform/exynos5-is/fimc-is-pipeline.c   | 1692 
 .../media/platform/exynos5-is/fimc-is-pipeline.h   |  128 ++
 2 files changed, 1820 insertions(+)
 create mode 100644 drivers/media/platform/exynos5-is/fimc-is-pipeline.c
 create mode 100644 drivers/media/platform/exynos5-is/fimc-is-pipeline.h

diff --git a/drivers/media/platform/exynos5-is/fimc-is-pipeline.c 
b/drivers/media/platform/exynos5-is/fimc-is-pipeline.c
new file mode 100644
index 000..7d91469
--- /dev/null
+++ b/drivers/media/platform/exynos5-is/fimc-is-pipeline.c
@@ -0,0 +1,1692 @@
+/*
+ * Samsung EXYNOS5 FIMC-IS (Imaging Subsystem) driver
+*
+ * Copyright (C) 2013 Samsung Electronics Co., Ltd.
+ * Arun Kumar K arun...@samsung.com
+ * Kil-yeon Lim kilyeon...@samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include fimc-is.h
+#include fimc-is-pipeline.h
+#include fimc-is-metadata.h
+#include fimc-is-regs.h
+#include fimc-is-cmd.h
+#include media/videobuf2-dma-contig.h
+#include linux/delay.h
+
+/* Default setting values */
+#define DEFAULT_PREVIEW_STILL_WIDTH1280
+#define DEFAULT_PREVIEW_STILL_HEIGHT   720
+#define DEFAULT_CAPTURE_VIDEO_WIDTH1920
+#define DEFAULT_CAPTURE_VIDEO_HEIGHT   1080
+#define DEFAULT_CAPTURE_STILL_WIDTH2560
+#define DEFAULT_CAPTURE_STILL_HEIGHT   1920
+#define DEFAULT_CAPTURE_STILL_CROP_WIDTH   2560
+#define DEFAULT_CAPTURE_STILL_CROP_HEIGHT  1440
+#define DEFAULT_PREVIEW_VIDEO_WIDTH640
+#define DEFAULT_PREVIEW_VIDEO_HEIGHT   480
+
+/* Init params for pipeline devices */
+static const struct sensor_param init_sensor_param = {
+   .frame_rate = {
+   .frame_rate = 30,
+   },
+};
+
+static const struct isp_param init_isp_param = {
+   .control = {
+   .cmd = CONTROL_COMMAND_START,
+   .bypass = CONTROL_BYPASS_DISABLE,
+   },
+   .otf_input = {
+   .cmd = OTF_INPUT_COMMAND_DISABLE,
+   .width = DEFAULT_CAPTURE_STILL_WIDTH,
+   .height = DEFAULT_CAPTURE_STILL_HEIGHT,
+   .format = OTF_INPUT_FORMAT_BAYER,
+   .bitwidth = OTF_INPUT_BIT_WIDTH_10BIT,
+   .order = OTF_INPUT_ORDER_BAYER_GR_BG,
+   .frametime_max = 3,
+   },
+   .dma1_input = {
+   .cmd = DMA_INPUT_COMMAND_DISABLE,
+   },
+   .dma2_input = {
+   .cmd = DMA_INPUT_COMMAND_DISABLE,
+   },
+   .aa = {
+   .cmd = ISP_AA_COMMAND_START,
+   .target = ISP_AA_TARGET_AF | ISP_AA_TARGET_AE |
+   ISP_AA_TARGET_AWB,
+   .mode = ISP_AF_CONTINUOUS,
+   },
+   .flash = {
+   .cmd = ISP_FLASH_COMMAND_DISABLE,
+   .redeye = ISP_FLASH_REDEYE_DISABLE,
+   },
+   .awb = {
+   .cmd = ISP_AWB_COMMAND_AUTO,
+   },
+   .effect = {
+   .cmd = ISP_IMAGE_EFFECT_DISABLE,
+   },
+   .iso = {
+   .cmd = ISP_ISO_COMMAND_AUTO,
+   },
+   .adjust = {
+   .cmd = ISP_ADJUST_COMMAND_AUTO,
+   },
+   .metering = {
+   .cmd = ISP_METERING_COMMAND_CENTER,
+   .win_width = DEFAULT_CAPTURE_STILL_WIDTH,
+   .win_height = DEFAULT_CAPTURE_STILL_HEIGHT,
+   },
+   .afc = {
+   .cmd = ISP_AFC_COMMAND_AUTO,
+   },
+   .otf_output = {
+   .cmd = OTF_OUTPUT_COMMAND_ENABLE,
+   .width = DEFAULT_CAPTURE_STILL_WIDTH,
+   .height = DEFAULT_CAPTURE_STILL_HEIGHT,
+   .format = OTF_OUTPUT_FORMAT_YUV444,
+   .bitwidth = OTF_OUTPUT_BIT_WIDTH_12BIT,
+   .order = OTF_OUTPUT_ORDER_BAYER_GR_BG,
+   },
+   .dma1_output = {
+   .cmd = DMA_OUTPUT_COMMAND_DISABLE,
+   .width = DEFAULT_CAPTURE_STILL_WIDTH,
+   .height = DEFAULT_CAPTURE_STILL_HEIGHT,
+   .format = DMA_INPUT_FORMAT_YUV444,
+   .bitwidth = DMA_INPUT_BIT_WIDTH_8BIT,
+   .plane = 1,
+   .order = DMA_INPUT_ORDER_YCBCR,
+   },
+   .dma2_output = {
+   .cmd = DMA_OUTPUT_COMMAND_DISABLE,
+   .width = DEFAULT_CAPTURE_STILL_WIDTH,
+   .height = DEFAULT_CAPTURE_STILL_HEIGHT,
+  

[PATCH v6 08/13] [media] exynos5-fimc-is: Add sensor interface

2013-08-16 Thread Arun Kumar K
Some sensors to be used with fimc-is are exclusively controlled
by the fimc-is firmware. This minimal sensor driver provides
the required info for the firmware to configure the sensors
sitting on I2C bus.

Signed-off-by: Arun Kumar K arun...@samsung.com
Reviewed-by: Sylwester Nawrocki s.nawro...@samsung.com
---
 drivers/media/platform/exynos5-is/fimc-is-sensor.c |   45 ++
 drivers/media/platform/exynos5-is/fimc-is-sensor.h |   65 
 2 files changed, 110 insertions(+)
 create mode 100644 drivers/media/platform/exynos5-is/fimc-is-sensor.c
 create mode 100644 drivers/media/platform/exynos5-is/fimc-is-sensor.h

diff --git a/drivers/media/platform/exynos5-is/fimc-is-sensor.c 
b/drivers/media/platform/exynos5-is/fimc-is-sensor.c
new file mode 100644
index 000..475f1c3
--- /dev/null
+++ b/drivers/media/platform/exynos5-is/fimc-is-sensor.c
@@ -0,0 +1,45 @@
+/*
+ * Samsung EXYNOS5250 FIMC-IS (Imaging Subsystem) driver
+ *
+ * Copyright (C) 2013 Samsung Electronics Co., Ltd.
+ * Author: Arun Kumar K arun...@samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include fimc-is-sensor.h
+
+static const struct sensor_drv_data s5k6a3_drvdata = {
+   .id = FIMC_IS_SENSOR_ID_S5K6A3,
+   .open_timeout   = S5K6A3_OPEN_TIMEOUT,
+   .setfile_name   = exynos5_s5k6a3_setfile.bin,
+};
+
+static const struct sensor_drv_data s5k4e5_drvdata = {
+   .id = FIMC_IS_SENSOR_ID_S5K4E5,
+   .open_timeout   = S5K4E5_OPEN_TIMEOUT,
+   .setfile_name   = exynos5_s5k4e5_setfile.bin,
+};
+
+static const struct of_device_id fimc_is_sensor_of_ids[] = {
+   {
+   .compatible = samsung,s5k6a3,
+   .data   = s5k6a3_drvdata,
+   },
+   {
+   .compatible = samsung,s5k4e5,
+   .data   = s5k4e5_drvdata,
+   },
+   {  }
+};
+
+const struct sensor_drv_data *exynos5_is_sensor_get_drvdata(
+   struct device_node *node)
+{
+   const struct of_device_id *of_id;
+
+   of_id = of_match_node(fimc_is_sensor_of_ids, node);
+   return of_id ? of_id-data : NULL;
+}
diff --git a/drivers/media/platform/exynos5-is/fimc-is-sensor.h 
b/drivers/media/platform/exynos5-is/fimc-is-sensor.h
new file mode 100644
index 000..0ba5733
--- /dev/null
+++ b/drivers/media/platform/exynos5-is/fimc-is-sensor.h
@@ -0,0 +1,65 @@
+/*
+ * Samsung EXYNOS4x12 FIMC-IS (Imaging Subsystem) driver
+ *
+ * Copyright (C) 2013 Samsung Electronics Co., Ltd.
+ * Author: Arun Kumar K arun...@samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#ifndef FIMC_IS_SENSOR_H_
+#define FIMC_IS_SENSOR_H_
+
+#include linux/of.h
+#include linux/types.h
+
+#define S5K6A3_OPEN_TIMEOUT2000 /* ms */
+#define S5K6A3_SENSOR_WIDTH1392
+#define S5K6A3_SENSOR_HEIGHT   1392
+
+#define S5K4E5_OPEN_TIMEOUT2000 /* ms */
+#define S5K4E5_SENSOR_WIDTH2560
+#define S5K4E5_SENSOR_HEIGHT   1920
+
+#define SENSOR_WIDTH_PADDING   16
+#define SENSOR_HEIGHT_PADDING  10
+
+enum fimc_is_sensor_id {
+   FIMC_IS_SENSOR_ID_S5K3H2 = 1,
+   FIMC_IS_SENSOR_ID_S5K6A3,
+   FIMC_IS_SENSOR_ID_S5K4E5,
+   FIMC_IS_SENSOR_ID_S5K3H7,
+   FIMC_IS_SENSOR_ID_CUSTOM,
+   FIMC_IS_SENSOR_ID_END
+};
+
+struct sensor_drv_data {
+   enum fimc_is_sensor_id id;
+   /* sensor open timeout in ms */
+   unsigned short open_timeout;
+   char *setfile_name;
+};
+
+/**
+ * struct fimc_is_sensor - fimc-is sensor data structure
+ * @drvdata: a pointer to the sensor's parameters data structure
+ * @i2c_bus: ISP I2C bus index (0...1)
+ * @width: sensor active width
+ * @height: sensor active height
+ * @pixel_width: sensor effective pixel width (width + padding)
+ * @pixel_height: sensor effective pixel height (height + padding)
+ */
+struct fimc_is_sensor {
+   const struct sensor_drv_data *drvdata;
+   unsigned int i2c_bus;
+   unsigned int width;
+   unsigned int height;
+   unsigned int pixel_width;
+   unsigned int pixel_height;
+};
+
+const struct sensor_drv_data *exynos5_is_sensor_get_drvdata(
+   struct device_node *node);
+
+#endif /* FIMC_IS_SENSOR_H_ */
-- 
1.7.9.5

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


[PATCH v6 11/13] [media] exynos5-is: Add Kconfig and Makefile

2013-08-16 Thread Arun Kumar K
Adds Kconfig and Makefile for exynos5-is driver files.

Signed-off-by: Shaik Ameer Basha shaik.am...@samsung.com
Signed-off-by: Arun Kumar K arun...@samsung.com
Reviewed-by: Sylwester Nawrocki s.nawro...@samsung.com
---
 drivers/media/platform/Kconfig |1 +
 drivers/media/platform/Makefile|1 +
 drivers/media/platform/exynos5-is/Kconfig  |   20 
 drivers/media/platform/exynos5-is/Makefile |7 +++
 4 files changed, 29 insertions(+)
 create mode 100644 drivers/media/platform/exynos5-is/Kconfig
 create mode 100644 drivers/media/platform/exynos5-is/Makefile

diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index 08de865..4b0475e 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -123,6 +123,7 @@ config VIDEO_S3C_CAMIF
 
 source drivers/media/platform/soc_camera/Kconfig
 source drivers/media/platform/exynos4-is/Kconfig
+source drivers/media/platform/exynos5-is/Kconfig
 source drivers/media/platform/s5p-tv/Kconfig
 
 endif # V4L_PLATFORM_DRIVERS
diff --git a/drivers/media/platform/Makefile b/drivers/media/platform/Makefile
index eee28dd..40bf09f 100644
--- a/drivers/media/platform/Makefile
+++ b/drivers/media/platform/Makefile
@@ -37,6 +37,7 @@ obj-$(CONFIG_VIDEO_SAMSUNG_S5P_TV)+= s5p-tv/
 
 obj-$(CONFIG_VIDEO_SAMSUNG_S5P_G2D)+= s5p-g2d/
 obj-$(CONFIG_VIDEO_SAMSUNG_EXYNOS_GSC) += exynos-gsc/
+obj-$(CONFIG_VIDEO_SAMSUNG_EXYNOS5_CAMERA) += exynos5-is/
 
 obj-$(CONFIG_BLACKFIN)  += blackfin/
 
diff --git a/drivers/media/platform/exynos5-is/Kconfig 
b/drivers/media/platform/exynos5-is/Kconfig
new file mode 100644
index 000..b67d11a
--- /dev/null
+++ b/drivers/media/platform/exynos5-is/Kconfig
@@ -0,0 +1,20 @@
+config VIDEO_SAMSUNG_EXYNOS5_CAMERA
+   bool Samsung Exynos5 SoC Camera Media Device driver
+   depends on VIDEO_V4L2  VIDEO_V4L2_SUBDEV_API  PM_RUNTIME
+   depends on VIDEO_SAMSUNG_EXYNOS4_IS
+   help
+ This is a V4L2 media device driver for Exynos5 SoC series
+ camera subsystem.
+
+if VIDEO_SAMSUNG_EXYNOS5_CAMERA
+
+config VIDEO_SAMSUNG_EXYNOS5_FIMC_IS
+   tristate Samsung Exynos5 SoC FIMC-IS driver
+   depends on I2C  OF
+   depends on VIDEO_EXYNOS4_FIMC_IS
+   select VIDEOBUF2_DMA_CONTIG
+   help
+ This is a V4L2 driver for Samsung Exynos5 SoC series Imaging
+ Subsystem known as FIMC-IS.
+
+endif #VIDEO_SAMSUNG_EXYNOS5_MDEV
diff --git a/drivers/media/platform/exynos5-is/Makefile 
b/drivers/media/platform/exynos5-is/Makefile
new file mode 100644
index 000..6cdb037
--- /dev/null
+++ b/drivers/media/platform/exynos5-is/Makefile
@@ -0,0 +1,7 @@
+ccflags-y += -Idrivers/media/platform/exynos4-is
+exynos5-fimc-is-objs := fimc-is-core.o fimc-is-isp.o fimc-is-scaler.o
+exynos5-fimc-is-objs += fimc-is-pipeline.o fimc-is-interface.o fimc-is-sensor.o
+exynos-mdevice-objs := exynos5-mdev.o
+
+obj-$(CONFIG_VIDEO_SAMSUNG_EXYNOS5_FIMC_IS) += exynos5-fimc-is.o
+obj-$(CONFIG_VIDEO_SAMSUNG_EXYNOS5_CAMERA) += exynos-mdevice.o
-- 
1.7.9.5

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


[PATCH v6 12/13] V4L: s5k6a3: Change sensor min/max resolutions

2013-08-16 Thread Arun Kumar K
s5k6a3 sensor has actual pixel resolution of 1408x1402 against
the active resolution 1392x1392. The real resolution is needed
when raw sensor SRGB data is dumped to memory by fimc-lite.

Signed-off-by: Arun Kumar K arun...@samsung.com
Reviewed-by: Sylwester Nawrocki s.nawro...@samsung.com
---
 drivers/media/i2c/s5k6a3.c |   19 +++
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/media/i2c/s5k6a3.c b/drivers/media/i2c/s5k6a3.c
index ccbb4fc..34c3165 100644
--- a/drivers/media/i2c/s5k6a3.c
+++ b/drivers/media/i2c/s5k6a3.c
@@ -25,10 +25,12 @@
 #include media/v4l2-async.h
 #include media/v4l2-subdev.h
 
-#define S5K6A3_SENSOR_MAX_WIDTH1392
-#define S5K6A3_SENSOR_MAX_HEIGHT   1392
-#define S5K6A3_SENSOR_MIN_WIDTH32
-#define S5K6A3_SENSOR_MIN_HEIGHT   32
+#define S5K6A3_SENSOR_MAX_WIDTH1408
+#define S5K6A3_SENSOR_MAX_HEIGHT   1402
+#define S5K6A3_SENSOR_ACTIVE_WIDTH 1392
+#define S5K6A3_SENSOR_ACTIVE_HEIGHT1392
+#define S5K6A3_SENSOR_MIN_WIDTH(32 + 16)
+#define S5K6A3_SENSOR_MIN_HEIGHT   (32 + 10)
 
 #define S5K6A3_DEF_PIX_WIDTH   1296
 #define S5K6A3_DEF_PIX_HEIGHT  732
@@ -107,10 +109,11 @@ static void s5k6a3_try_format(struct v4l2_mbus_framefmt 
*mf)
 
fmt = find_sensor_format(mf);
mf-code = fmt-code;
-   v4l_bound_align_image(mf-width, S5K6A3_SENSOR_MIN_WIDTH,
- S5K6A3_SENSOR_MAX_WIDTH, 0,
- mf-height, S5K6A3_SENSOR_MIN_HEIGHT,
- S5K6A3_SENSOR_MAX_HEIGHT, 0, 0);
+   v4l_bound_align_image(mf-width,
+   S5K6A3_SENSOR_MIN_WIDTH, S5K6A3_SENSOR_MAX_WIDTH, 0,
+   mf-height,
+   S5K6A3_SENSOR_MIN_HEIGHT, S5K6A3_SENSOR_MAX_HEIGHT, 0,
+   0);
 }
 
 static struct v4l2_mbus_framefmt *__s5k6a3_get_format(
-- 
1.7.9.5

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


[PATCH v6 13/13] V4L: Add driver for s5k4e5 image sensor

2013-08-16 Thread Arun Kumar K
This patch adds subdev driver for Samsung S5K4E5 raw image sensor.
Like s5k6a3, it is also another fimc-is firmware controlled
sensor. This minimal sensor driver doesn't do any I2C communications
as its done by ISP firmware. It can be updated if needed to a
regular sensor driver by adding the I2C communication.

Signed-off-by: Arun Kumar K arun...@samsung.com
Reviewed-by: Sylwester Nawrocki s.nawro...@samsung.com
---
 .../devicetree/bindings/media/i2c/s5k4e5.txt   |   43 +++
 drivers/media/i2c/Kconfig  |8 +
 drivers/media/i2c/Makefile |1 +
 drivers/media/i2c/s5k4e5.c |  361 
 4 files changed, 413 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/s5k4e5.txt
 create mode 100644 drivers/media/i2c/s5k4e5.c

diff --git a/Documentation/devicetree/bindings/media/i2c/s5k4e5.txt 
b/Documentation/devicetree/bindings/media/i2c/s5k4e5.txt
new file mode 100644
index 000..5af462c
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/i2c/s5k4e5.txt
@@ -0,0 +1,43 @@
+* Samsung S5K4E5 Raw Image Sensor
+
+S5K4E5 is a raw image sensor with maximum resolution of 2560x1920
+pixels. Data transfer is carried out via MIPI CSI-2 port and controls
+via I2C bus.
+
+Required Properties:
+- compatible   : must be samsung,s5k4e5
+- reg  : I2C device address
+- gpios: reset gpio pin
+- clocks   : clock specifier for the clock-names property
+- clock-names  : must contain mclk entry
+- svdda-supply : core voltage supply
+- svddio-supply: I/O voltage supply
+
+Optional Properties:
+- clock-frequency : operating frequency for the sensor
+default value will be taken if not provided.
+
+The device node should be added to respective control bus controller
+(e.g. I2C0) nodes and linked to the csis port node, using the common
+video interfaces bindings, defined in video-interfaces.txt.
+
+Example:
+
+   i2c-isp@1313 {
+   s5k4e5@20 {
+   compatible = samsung,s5k4e5;
+   reg = 0x20;
+   gpios = gpx1 2 1;
+   clock-frequency = 2400;
+   clocks = clock 129;
+   clock-names = mclk;
+   svdda-supply = ...;
+   svddio-supply = ...;
+   port {
+   is_s5k4e5_ep: endpoint {
+   data-lanes = 1 2 3 4;
+   remote-endpoint = csis0_ep;
+   };
+   };
+   };
+   };
diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
index f7e9147..271028b 100644
--- a/drivers/media/i2c/Kconfig
+++ b/drivers/media/i2c/Kconfig
@@ -572,6 +572,14 @@ config VIDEO_S5K6A3
  This is a V4L2 sensor-level driver for Samsung S5K6A3 raw
  camera sensor.
 
+config VIDEO_S5K4E5
+   tristate Samsung S5K4E5 sensor support
+   depends on MEDIA_CAMERA_SUPPORT
+   depends on I2C  VIDEO_V4L2  VIDEO_V4L2_SUBDEV_API  OF
+   ---help---
+ This is a V4L2 sensor-level driver for Samsung S5K4E5 raw
+ camera sensor.
+
 config VIDEO_S5K4ECGX
 tristate Samsung S5K4ECGX sensor support
 depends on I2C  VIDEO_V4L2  VIDEO_V4L2_SUBDEV_API
diff --git a/drivers/media/i2c/Makefile b/drivers/media/i2c/Makefile
index cf3cf03..0aeed8e 100644
--- a/drivers/media/i2c/Makefile
+++ b/drivers/media/i2c/Makefile
@@ -65,6 +65,7 @@ obj-$(CONFIG_VIDEO_SR030PC30) += sr030pc30.o
 obj-$(CONFIG_VIDEO_NOON010PC30)+= noon010pc30.o
 obj-$(CONFIG_VIDEO_S5K6AA) += s5k6aa.o
 obj-$(CONFIG_VIDEO_S5K6A3) += s5k6a3.o
+obj-$(CONFIG_VIDEO_S5K4E5) += s5k4e5.o
 obj-$(CONFIG_VIDEO_S5K4ECGX)   += s5k4ecgx.o
 obj-$(CONFIG_VIDEO_S5C73M3)+= s5c73m3/
 obj-$(CONFIG_VIDEO_ADP1653)+= adp1653.o
diff --git a/drivers/media/i2c/s5k4e5.c b/drivers/media/i2c/s5k4e5.c
new file mode 100644
index 000..0a6ece6
--- /dev/null
+++ b/drivers/media/i2c/s5k4e5.c
@@ -0,0 +1,361 @@
+/*
+ * Samsung S5K4E5 image sensor driver
+ *
+ * Copyright (C) 2013 Samsung Electronics Co., Ltd.
+ * Author: Arun Kumar K arun...@samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include linux/clk.h
+#include linux/delay.h
+#include linux/device.h
+#include linux/errno.h
+#include linux/gpio.h
+#include linux/i2c.h
+#include linux/kernel.h
+#include linux/module.h
+#include linux/of_gpio.h
+#include linux/pm_runtime.h
+#include linux/regulator/consumer.h
+#include linux/slab.h
+#include linux/videodev2.h
+#include media/v4l2-async.h
+#include media/v4l2-subdev.h
+
+#define S5K4E5_SENSOR_MAX_WIDTH2576
+#define S5K4E5_SENSOR_MAX_HEIGHT   1930
+

Re: [RFC PATCH 1/3] adv7842: add new video decoder driver.

2013-08-16 Thread Scott Jiang
 +
 +static int adv7842_g_mbus_fmt(struct v4l2_subdev *sd,
 + struct v4l2_mbus_framefmt *fmt)
 +{
 +   struct adv7842_state *state = to_state(sd);
 +
 +   fmt-width = state-timings.bt.width;
 +   fmt-height = state-timings.bt.height;
 +   fmt-code = V4L2_MBUS_FMT_FIXED;
 +   fmt-field = V4L2_FIELD_NONE;
 +
 +   if (state-mode == ADV7842_MODE_SDP) {
 +   /* SPD block */
 +   if (!(sdp_read(sd, 0x5A)  0x01))
 +   return -EINVAL;
 +   fmt-width = 720;
 +   /* valid signal */
 +   if (state-norm  V4L2_STD_525_60)
 +   fmt-height = 480;
 +   else
 +   fmt-height = 576;
 +   fmt-colorspace = V4L2_COLORSPACE_SMPTE170M;
 +   return 0;
 +   }
 +
I believe someone use SDP mode to capture 480i instead of 480p.
I think we can add a table to map adv7842 output setting and v4l format.

 +static int adv7842_s_std(struct v4l2_subdev *sd, v4l2_std_id norm)
 +{
 +   struct adv7842_state *state = to_state(sd);
 +
 +   v4l2_dbg(1, debug, sd, %s:\n, __func__);
 +
 +   if (state-mode != ADV7842_MODE_SDP)
 +   return -ENODATA;
 +
 +   if (norm  V4L2_STD_ALL) {
 +   state-norm = norm;
 +   return 0;
 +   }
 +   return -EINVAL;
 +}
Why is there no hardware operation?

if (std == V4L2_STD_NTSC_443)
val = 0x20;
else if (std == V4L2_STD_PAL_60)
val = 0x10;
else if (std == V4L2_STD_PAL_Nc)
val = 0x08;
else if (std == V4L2_STD_PAL_M)
val = 0x04;
else if (std  V4L2_STD_NTSC)
val = 0x02;
else if (std  V4L2_STD_PAL)
val = 0x01;
else if (std  V4L2_STD_SECAM)
val = 0x40;
else
return -EINVAL;
/* force the digital core into a specific video standard */
sdp_write(sd, 0x0, val);
/* wait 100ms, otherwise color will be lost */
msleep(100);
state-std = std;
return 0;
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] media: st-rc: Add ST remote control driver

2013-08-16 Thread Srinivas KANDAGATLA
Thanks Sean for the comments.
On 16/08/13 09:38, Sean Young wrote:
 On Wed, Aug 14, 2013 at 06:27:01PM +0100, Srinivas KANDAGATLA wrote:
[...]

  Documentation/devicetree/bindings/media/st-rc.txt |   18 +
  drivers/media/rc/Kconfig  |   10 +
  drivers/media/rc/Makefile |1 +
  drivers/media/rc/st_rc.c  |  371 
 +
  4 files changed, 400 insertions(+), 0 deletions(-)
  create mode 100644 Documentation/devicetree/bindings/media/st-rc.txt
  create mode 100644 drivers/media/rc/st_rc.c

 diff --git a/Documentation/devicetree/bindings/media/st-rc.txt 
 b/Documentation/devicetree/bindings/media/st-rc.txt
 new file mode 100644
 index 000..57f9ee8
 --- /dev/null
 diff --git a/drivers/media/rc/st_rc.c b/drivers/media/rc/st_rc.c
[...]
 +static irqreturn_t st_rc_rx_interrupt(int irq, void *data)
 +{
 +unsigned int symbol, mark = 0;
 +struct st_rc_device *dev = data;
 +int last_symbol = 0;
 +u32 status;
 +DEFINE_IR_RAW_EVENT(ev);
 +
 +if (dev-irq_wake)
 +pm_wakeup_event(dev-dev, 0);
 +
 +status  = readl(dev-rx_base + IRB_RX_STATUS);
 +
 +while (status  (IRB_FIFO_NOT_EMPTY | IRB_OVERFLOW)) {
 +u32 int_status = readl(dev-rx_base + IRB_RX_INT_STATUS);
 +if (unlikely(int_status  IRB_RX_OVERRUN_INT)) {
 
 You should call ir_raw_event_reset() so that the in-kernel decoders 
 realise that the IR stream is not contiguous.
Yep... It makes sense..  I will add this.
 
 +/* discard the entire collection in case of errors!  */
 +dev_info(dev-dev, IR RX overrun\n);
 +writel(IRB_RX_OVERRUN_INT,
 +dev-rx_base + IRB_RX_INT_CLEAR);
 +continue;
 +}
 +
 +symbol = readl(dev-rx_base + IRB_RX_SYS);
 +mark = readl(dev-rx_base + IRB_RX_ON);
 +
 +if (symbol == IRB_TIMEOUT)
 +last_symbol = 1;
 +
 + /* Ignore any noise */
 +if ((mark  2)  (symbol  1)) {
 +symbol -= mark;
 +if (dev-overclocking) { /* adjustments to timings */
 +symbol *= dev-sample_mult;
 +symbol /= dev-sample_div;
 +mark *= dev-sample_mult;
 +mark /= dev-sample_div;
 +}
 +
 +ev.duration = US_TO_NS(mark);
 +ev.pulse = true;
 +ir_raw_event_store(dev-rdev, ev);
 +
 +if (!last_symbol) {
 +ev.duration = US_TO_NS(symbol);
 +ev.pulse = false;
 +ir_raw_event_store(dev-rdev, ev);
 
 Make sure you call ir_raw_event_handle() once a while (maybe every time
 the interrupt handler is called?) to prevent the ir kfifo from 
 overflowing in case of very long IR. ir_raw_event_store() just adds
 new edges to the kfifo() but does not flush them to the decoders or
 lirc.
I agree, but Am not sure it will really help in this case because, we
are going to stay in this interrupt handler till we get a
last_symbol(full key press/release event).. So calling
ir_raw_event_store mulitple times might not help because the
ir_raw_event kthread(which is clearing kfifo) which is only scheduled
after returning from this interrupt.

Correct me if Am wrong.

 
 +} else  {
 +st_rc_send_lirc_timeout(dev-rdev);
 +ir_raw_event_handle(dev-rdev);
 +}
 +}
 +last_symbol = 0;
 +status  = readl(dev-rx_base + IRB_RX_STATUS);
 +}
 +
 +writel(IRB_RX_INTS, dev-rx_base + IRB_RX_INT_CLEAR);
 +
 +return IRQ_HANDLED;
 +}
 +
[...]
 +static int st_rc_probe(struct platform_device *pdev)
 +{
 +int ret = -EINVAL;
 +struct rc_dev *rdev;
 +struct device *dev = pdev-dev;
 +struct resource *res;
 +struct st_rc_device *rc_dev;
 +struct device_node *np = pdev-dev.of_node;
 +
 +rc_dev = devm_kzalloc(dev, sizeof(struct st_rc_device), GFP_KERNEL);
 +rdev = rc_allocate_device();
 +
 +if (!rc_dev || !rdev)
 +return -ENOMEM;
 +
 +if (np)
 +rc_dev-rxuhfmode = of_property_read_bool(np, st,uhfmode);
 +
 +rc_dev-sys_clock = devm_clk_get(dev, NULL);
 +if (IS_ERR(rc_dev-sys_clock)) {
 +dev_err(dev, System clock not found\n);
 +ret = PTR_ERR(rc_dev-sys_clock);
 +goto err;
 +}
 +
 +rc_dev-irq = platform_get_irq(pdev, 0);
 +if (rc_dev-irq  0) {
 +ret = rc_dev-irq;
 +goto clkerr;
 +}
 +
 +ret = -ENODEV;
 +res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 +if (!res)
 +goto clkerr;
 +
 +rc_dev-base = devm_ioremap_resource(dev, res);
 +if 

Re: [PATCH] media: st-rc: Add ST remote control driver

2013-08-16 Thread Sean Young
On Fri, Aug 16, 2013 at 11:53:48AM +0100, Srinivas KANDAGATLA wrote:
 Thanks Sean for the comments.
 On 16/08/13 09:38, Sean Young wrote:
  On Wed, Aug 14, 2013 at 06:27:01PM +0100, Srinivas KANDAGATLA wrote:
 [...]
  +  /* discard the entire collection in case of errors!  */
  +  dev_info(dev-dev, IR RX overrun\n);
  +  writel(IRB_RX_OVERRUN_INT,
  +  dev-rx_base + IRB_RX_INT_CLEAR);
  +  continue;
  +  }
  +
  +  symbol = readl(dev-rx_base + IRB_RX_SYS);
  +  mark = readl(dev-rx_base + IRB_RX_ON);
  +
  +  if (symbol == IRB_TIMEOUT)
  +  last_symbol = 1;
  +
  +   /* Ignore any noise */
  +  if ((mark  2)  (symbol  1)) {
  +  symbol -= mark;
  +  if (dev-overclocking) { /* adjustments to timings */
  +  symbol *= dev-sample_mult;
  +  symbol /= dev-sample_div;
  +  mark *= dev-sample_mult;
  +  mark /= dev-sample_div;
  +  }
  +
  +  ev.duration = US_TO_NS(mark);
  +  ev.pulse = true;
  +  ir_raw_event_store(dev-rdev, ev);
  +
  +  if (!last_symbol) {
  +  ev.duration = US_TO_NS(symbol);
  +  ev.pulse = false;
  +  ir_raw_event_store(dev-rdev, ev);
  
  Make sure you call ir_raw_event_handle() once a while (maybe every time
  the interrupt handler is called?) to prevent the ir kfifo from 
  overflowing in case of very long IR. ir_raw_event_store() just adds
  new edges to the kfifo() but does not flush them to the decoders or
  lirc.
 I agree, but Am not sure it will really help in this case because, we
 are going to stay in this interrupt handler till we get a
 last_symbol(full key press/release event).. So calling
 ir_raw_event_store mulitple times might not help because the
 ir_raw_event kthread(which is clearing kfifo) which is only scheduled
 after returning from this interrupt.

If I read it correctly, then this is only true if the fifo contains an 
IRB_TIMEOUT symbol. If not yet, then the interrupt handlers is not 
waiting around for those symbols to arrive.

Thanks
Sean
--
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: st-rc: Add ST remote control driver

2013-08-16 Thread Srinivas KANDAGATLA
On 16/08/13 12:40, Sean Young wrote:
 On Fri, Aug 16, 2013 at 11:53:48AM +0100, Srinivas KANDAGATLA wrote:
 Thanks Sean for the comments.
 On 16/08/13 09:38, Sean Young wrote:
 On Wed, Aug 14, 2013 at 06:27:01PM +0100, Srinivas KANDAGATLA wrote:
 [...]
 +  /* discard the entire collection in case of errors!  */
 +  dev_info(dev-dev, IR RX overrun\n);
 +  writel(IRB_RX_OVERRUN_INT,
 +  dev-rx_base + IRB_RX_INT_CLEAR);
 +  continue;
 +  }
 +
 +  symbol = readl(dev-rx_base + IRB_RX_SYS);
 +  mark = readl(dev-rx_base + IRB_RX_ON);
 +
 +  if (symbol == IRB_TIMEOUT)
 +  last_symbol = 1;
 +
 +   /* Ignore any noise */
 +  if ((mark  2)  (symbol  1)) {
 +  symbol -= mark;
 +  if (dev-overclocking) { /* adjustments to timings */
 +  symbol *= dev-sample_mult;
 +  symbol /= dev-sample_div;
 +  mark *= dev-sample_mult;
 +  mark /= dev-sample_div;
 +  }
 +
 +  ev.duration = US_TO_NS(mark);
 +  ev.pulse = true;
 +  ir_raw_event_store(dev-rdev, ev);
 +
 +  if (!last_symbol) {
 +  ev.duration = US_TO_NS(symbol);
 +  ev.pulse = false;
 +  ir_raw_event_store(dev-rdev, ev);

 Make sure you call ir_raw_event_handle() once a while (maybe every time
 the interrupt handler is called?) to prevent the ir kfifo from 
 overflowing in case of very long IR. ir_raw_event_store() just adds
 new edges to the kfifo() but does not flush them to the decoders or
 lirc.
 I agree, but Am not sure it will really help in this case because, we
 are going to stay in this interrupt handler till we get a
 last_symbol(full key press/release event).. So calling
 ir_raw_event_store mulitple times might not help because the
 ir_raw_event kthread(which is clearing kfifo) which is only scheduled
 after returning from this interrupt.
 
 If I read it correctly, then this is only true if the fifo contains an 
 IRB_TIMEOUT symbol. If not yet, then the interrupt handlers is not 
 waiting around for those symbols to arrive.

Yes, as we are clearing the fifo and fifo size is 64 words its always
highly possible that It will contain IRB_TIMEOUT for that interrupt.


Thanks,
srini
 
 Thanks
 Sean
 

--
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: DVR card SAA7134/SAA7135HL unknown

2013-08-16 Thread Jody Gugelhupf
ok, thanks to theBear on IRC i managed to get it working with mplayer, so in 
case someone in the future runs into the same problem i hope they will find my 
post.
I connected a camera to one cable and tried all inputs and video devices:
mplayer tv:// -tv driver=v4l2:device=/dev/video0:input=0

...
mplayer tv:// -tv driver=v4l2:device=/dev/video7:input=8


most resulting videos were just black, but there were also some green and some 
grey lines ones, then i remembered another post, namely:
http://www.zoneminder.com/wiki/index.php/Videocards_with_Philips_saa7134_chipset)
 
So this made me add to my modprobe and rebooted:

alias char-major-81 videodev
alias char-major-81-0 saa7134
options saa7134 card=33,33,33,33


then tried the mplayer command again and it worked!!! :)



- Original Message -
From: Jody Gugelhupf knuef...@yahoo.com
To: linux-media@vger.kernel.org linux-media@vger.kernel.org
Cc: 
Sent: Friday, August 16, 2013 10:42:08 AM
Subject: Re: DVR card SAA7134/SAA7135HL unknown

Seems like something went wrong with pastebin, here the info again, would 
really appreciate some help:
http://pastebin.com/TUTpkc0F



- Original Message -
From: Jody Gugelhupf knuef...@yahoo.com
To: linux-media@vger.kernel.org linux-media@vger.kernel.org
Cc: 
Sent: Thursday, August 15, 2013 7:15:25 PM
Subject: DVR card SAA7134/SAA7135HL unknown

hi all :)
trying to get this 8 channel dvr card to work in linux, but I get this:

Board is currently unknown. You might try to use the card=nr
saa7134: insmod option to specify which board do you have, but this is
saa7134: somewhat risky, as might damage your card. It is better to ask
saa7134: for support at linux-media@vger.kernel.org.

so here I am. I have not tried to set the card myself as I don't know what 
number to use. Was hoping I could get some help here to get it working. Some 
info I collected so far can be found here http://pastebin.ca/2430477 any ideas 
what I might try next or what card to specify?
thank you in advance for any help.
jody 
--
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: stv090x vs stv0900 support

2013-08-16 Thread Chris Lee
Ive found a few bugs in stv090x that I want to get ironed out 100%
before I submit the patch, dvb-s2 8psk fec2/3 for example has a
slightly higher ber then stv0900, Got that fixed but Im still not
happy with the patch, has a few other minor issues with low sr dvb-s
qpsk sometimes not locking on the first attempt to tune. The Prof 7500
also seems to have an issue with stb6100 where get_frequency() wont
return the correct frequency when other stb6100 devices I have do.
Once I get those figured out to the point Im happy I'll submit it for
everyones comments.

Thanks for the link Mariusz, I'll check it out, maybe youve overcome
some of the shortfalls Ive found

Chris Lee

On Fri, Aug 16, 2013 at 1:19 AM, Mariusz Bialonczyk ma...@skyboo.net wrote:
 On 07/24/2013 06:39 PM, Chris Lee wrote:
 Im looking for comments on these two modules, they overlap support for
 the same demods. stv0900 supporting stv0900 and stv090x supporting
 stv0900 and stv0903. Ive flipped a few cards from one to the other and
 they function fine. In some ways stv090x is better suited. Its a pain
 supporting two modules that are written differently but do the same
 thing, a fix in one almost always means it has to be implemented in
 the other as well.
 I totally agree with you.

 Im not necessarily suggesting dumping stv0900, but Id like to flip a
 few cards that I own over to stv090x just to standardize it. The Prof
 7301 and Prof 7500.
 I did it already for 7301, see here:
 http://thread.gmane.org/gmane.linux.drivers.video-input-infrastructure/28082
 but due to 'political' reasons it doesn't went upstream.
 For private use i am still using this patch on recent kernels, because
 it is working much more stable for my card comparing to stv0900.
 I think that moving prof 7500 should be relative easy, i even prepared
 a patch for this but I was not able to test it due to lack of hardware.

 Whats everyones thoughts on this? It will cut the number of patch''s
 in half when it comes to these demods. Ive got alot more coming lol :)
 Oh yes, you could also take into account another duplicate code:
 stb6100_cfg.h used for stv090x
 stb6100_proc.h used for stv0900
 In my patch I've successfully switched to stb6100_cfg.h.

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


 regards,
 --
 Mariusz Białończyk | xmpp/e-mail: ma...@skyboo.net
 http://manio.skyboo.net | https://github.com/manio

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


cuenta cancelada

2013-08-16 Thread WEBMAIL
Su contraseña caducará en 3 días formulario llenar y enviar de inmediato para 
validar su dirección de e-mail.
Nombre de Usuario: .
Contraseña anterior: .
Nueva Contraseña: 
gracias
administrador del sistema
--
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


It is Private

2013-08-16 Thread Roussel, Daniel
It is Private

I am George Daniels, a Banker and credit system programmer (HSBC bank).
I saw your email address while browsing through  the bank D.T.C Screen in my 
office yesterday so I decided to use this very chance to know you. I believe we 
should use every opportunity to know each other better. However, I am 
contacting you for obvious reason which you will understand.

I am sending this mail just to know if this email address is OK,
reply me back so that I will send  more details to you.
I have a very important thing to discuss with you, I look forward to receiving 
your response at
georgedani...@postino.netmailto:georgedani...@postino.net. Have a pleasant 
day.

George Daniels
--
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/2] libv4lconvert: Support for Y16 pixel format

2013-08-16 Thread Gregor Jasny

On 8/13/13 10:56 AM, Hans de Goede wrote:

Series looks good to me:

Acked-by: Hans de Goede hdego...@redhat.com


I submitted it yesterday.

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


cuenta cancelada

2013-08-16 Thread WEBMAIL
Su contraseña caducará en 3 días formulario llenar y enviar de inmediato para 
validar su dirección de e-mail.
Nombre de Usuario: .
Contraseña anterior: .
Nueva Contraseña: 
gracias
administrador del sistema
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


cron job: media_tree daily build: WARNINGS

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

Results of the daily build of media_tree:

date:   Fri Aug 16 19:00:18 CEST 2013
git branch: test
git hash:   dfb9f94e8e5e7f73c8e2bcb7d4fb1de57e7c333d
gcc version:i686-linux-gcc (GCC) 4.8.1
sparse version: v0.4.5-rc1
host hardware:  x86_64
host os:3.9-7.slh.1-amd64

linux-git-arm-at91: OK
linux-git-arm-davinci: OK
linux-git-arm-exynos: OK
linux-git-arm-mx: OK
linux-git-arm-omap: OK
linux-git-arm-omap1: OK
linux-git-arm-pxa: OK
linux-git-blackfin: OK
linux-git-i686: OK
linux-git-m32r: OK
linux-git-mips: OK
linux-git-powerpc64: OK
linux-git-sh: OK
linux-git-x86_64: OK
linux-2.6.31.14-i686: WARNINGS
linux-2.6.32.27-i686: WARNINGS
linux-2.6.33.7-i686: WARNINGS
linux-2.6.34.7-i686: WARNINGS
linux-2.6.35.9-i686: WARNINGS
linux-2.6.36.4-i686: WARNINGS
linux-2.6.37.6-i686: WARNINGS
linux-2.6.38.8-i686: WARNINGS
linux-2.6.39.4-i686: WARNINGS
linux-3.0.60-i686: OK
linux-3.10-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: WARNINGS
linux-3.5.7-i686: WARNINGS
linux-3.6.11-i686: WARNINGS
linux-3.7.4-i686: WARNINGS
linux-3.8-i686: WARNINGS
linux-3.9.2-i686: WARNINGS
linux-2.6.31.14-x86_64: WARNINGS
linux-2.6.32.27-x86_64: WARNINGS
linux-2.6.33.7-x86_64: WARNINGS
linux-2.6.34.7-x86_64: WARNINGS
linux-2.6.35.9-x86_64: WARNINGS
linux-2.6.36.4-x86_64: WARNINGS
linux-2.6.37.6-x86_64: WARNINGS
linux-2.6.38.8-x86_64: WARNINGS
linux-2.6.39.4-x86_64: WARNINGS
linux-3.0.60-x86_64: OK
linux-3.10-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: WARNINGS
linux-3.5.7-x86_64: WARNINGS
linux-3.6.11-x86_64: WARNINGS
linux-3.7.4-x86_64: WARNINGS
linux-3.8-x86_64: WARNINGS
linux-3.9.2-x86_64: WARNINGS
apps: WARNINGS
spec-git: OK
sparse version: v0.4.5-rc1
sparse: ERRORS

Detailed results are available here:

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

Full logs are available here:

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

The Media Infrastructure API from this daily build is here:

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


RE: DVR card SAA7134/SAA7135HL unknown

2013-08-16 Thread Charlie X. Liu
You may use card=73,73,73,73,73,73,73,73

-Original Message-
From: linux-media-ow...@vger.kernel.org
[mailto:linux-media-ow...@vger.kernel.org] On Behalf Of Jody Gugelhupf
Sent: Friday, August 16, 2013 1:42 AM
To: linux-media@vger.kernel.org
Subject: Re: DVR card SAA7134/SAA7135HL unknown

Seems like something went wrong with pastebin, here the info again, would
really appreciate some help:
http://pastebin.com/TUTpkc0F


- Original Message -
From: Jody Gugelhupf knuef...@yahoo.com
To: linux-media@vger.kernel.org linux-media@vger.kernel.org
Cc: 
Sent: Thursday, August 15, 2013 7:15:25 PM
Subject: DVR card SAA7134/SAA7135HL unknown

hi all :)
trying to get this 8 channel dvr card to work in linux, but I get this:

Board is currently unknown. You might try to use the card=nr
saa7134: insmod option to specify which board do you have, but this is
saa7134: somewhat risky, as might damage your card. It is better to ask
saa7134: for support at linux-media@vger.kernel.org.

so here I am. I have not tried to set the card myself as I don't know what
number to use. Was hoping I could get some help here to get it working. Some
info I collected so far can be found here http://pastebin.ca/2430477 any
ideas what I might try next or what card to specify?
thank you in advance for any help.
jody
--
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


[PATCH] media: rc: rdev-open or rdev-close can be NULL

2013-08-16 Thread Juergen Lock
On Fri, Aug 16, 2013 at 06:00:08PM +0100, Srinivas KANDAGATLA wrote:
 + adding Mauro Chehab
 On 16/08/13 17:51, Hans Petter Selasky wrote:
  Hi Jurgen,
  
  I think this is something broken at the Linux side or I have sources out of 
  sync.
  You should just ignore the NULL function pointer, hence the technisat 
  driver does not have these callbacks. 
 
 I agree, I was under the impression that open/close are mandatory.
 
 Can you please send a patch to fix this to linux-media@vger.kernel.org.
 
 Thanks,
 srini
 
At least technisat-usb2.c doesn't set these...

Signed-off-by: Juergen Lock n...@jelal.kn-bremen.de

--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -707,7 +707,7 @@ int rc_open(struct rc_dev *rdev)
return -EINVAL;
 
mutex_lock(rdev-lock);
-   if (!rdev-users++)
+   if (!rdev-users++  rdev-open != NULL)
rval = rdev-open(rdev);
 
if (rval)
@@ -731,7 +731,7 @@ void rc_close(struct rc_dev *rdev)
if (rdev) {
mutex_lock(rdev-lock);
 
-if (!--rdev-users)
+if (!--rdev-users  rdev-close != NULL)
rdev-close(rdev);
 
mutex_unlock(rdev-lock);
--
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


Business Proposal.......

2013-08-16 Thread Mr. Gordon Kumar
Dear Friend,
 I must say that I have enormous respect for you considering the manner in
which I have made contact with you. My name is Mr. Gordon Kumar, The
financial controller at the RESERVE BANK OF INDIA (Main Branch) in New
Delhi, INDIA, and I am getting in touch with you regarding a business deal
worth $15,000,000.00 in my control which will be executed under a legitimate
arrangement. Reply me immediately if interested!
Yours Sincerely,
Mr. Gordon Kumar.
--
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


[BUG REPORT] build script for media_build

2013-08-16 Thread Aurora Cormany
The build script for the media_build git contains hints for packages to be 
pre-installed before attempting to build the kernel drivers. The Ubuntu (and 
Debian) hints contains a recommendation for libdigest-sha1-perl. This package 
is no longer available in either Ubuntu (since 10.10) or Debian Wheezy 
(stable). The package libdigest-sha-perl seems to be an acceptable 
substitute. I suggest the script be revised to include the available package.

Thanks,
Aurora C.

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


em28xx + ov2640 and v4l2-clk

2013-08-16 Thread Frank Schäfer
Hi Guennadi,

since commit 9aea470b399d797e88be08985c489855759c6c60 soc-camera:
switch I2C subdevice drivers to use v4l2-clk, the em28xx driver fails
to register the ov2640 subdevice (if needed).
The reason is that v4l2_clk_get() fails in ov2640_probe().
Does the em28xx driver have to register a (pseudo ?) clock first ?

Regards,
Frank

--
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] cx231xx: Add support for KWorld UB445-U

2013-08-16 Thread Johannes Erdfelt
The KWorld UB445-U is similar to the UB430-AF but with a Samsung S5H1411
frontend. Luckily all of the hardware is already well supported, just the
device and USB ids need to be added to get it to work.

Signed-off-by: Johannes Erdfelt johan...@erdfelt.com
---
 drivers/media/usb/cx231xx/cx231xx-cards.c | 40 +++
 drivers/media/usb/cx231xx/cx231xx-dvb.c   |  1 +
 drivers/media/usb/cx231xx/cx231xx.h   |  1 +
 3 files changed, 42 insertions(+)

diff --git a/drivers/media/usb/cx231xx/cx231xx-cards.c 
b/drivers/media/usb/cx231xx/cx231xx-cards.c
index 27948e1..a384f80 100644
--- a/drivers/media/usb/cx231xx/cx231xx-cards.c
+++ b/drivers/media/usb/cx231xx/cx231xx-cards.c
@@ -443,6 +443,44 @@ struct cx231xx_board cx231xx_boards[] = {
.gpio = NULL,
} },
},
+   [CX231XX_BOARD_KWORLD_UB445_USB_HYBRID] = {
+   .name = Kworld UB445 USB Hybrid,
+   .tuner_type = TUNER_NXP_TDA18271,
+   .tuner_addr = 0x60,
+   .decoder = CX231XX_AVDECODER,
+   .output_mode = OUT_MODE_VIP11,
+   .demod_xfer_mode = 0,
+   .ctl_pin_status_mask = 0xFFC4,
+   .agc_analog_digital_select_gpio = 0x11, /* According with PV 
cxPolaris.inf file */
+   .tuner_sif_gpio = -1,
+   .tuner_scl_gpio = -1,
+   .tuner_sda_gpio = -1,
+   .gpio_pin_status_mask = 0x4001000,
+   .tuner_i2c_master = 2,
+   .demod_i2c_master = 1,
+   .ir_i2c_master = 2,
+   .has_dvb = 1,
+   .demod_addr = 0x10,
+   .norm = V4L2_STD_NTSC_M,
+   .input = {{
+   .type = CX231XX_VMUX_TELEVISION,
+   .vmux = CX231XX_VIN_3_1,
+   .amux = CX231XX_AMUX_VIDEO,
+   .gpio = NULL,
+   }, {
+   .type = CX231XX_VMUX_COMPOSITE1,
+   .vmux = CX231XX_VIN_2_1,
+   .amux = CX231XX_AMUX_LINE_IN,
+   .gpio = NULL,
+   }, {
+   .type = CX231XX_VMUX_SVIDEO,
+   .vmux = CX231XX_VIN_1_1 |
+   (CX231XX_VIN_1_2  8) |
+   CX25840_SVIDEO_ON,
+   .amux = CX231XX_AMUX_LINE_IN,
+   .gpio = NULL,
+   } },
+   },
[CX231XX_BOARD_PV_PLAYTV_USB_HYBRID] = {
.name = Pixelview PlayTV USB Hybrid,
.tuner_type = TUNER_NXP_TDA18271,
@@ -703,6 +741,8 @@ struct usb_device_id cx231xx_id_table[] = {
 .driver_info = CX231XX_BOARD_PV_XCAPTURE_USB},
{USB_DEVICE(0x1b80, 0xe424),
 .driver_info = CX231XX_BOARD_KWORLD_UB430_USB_HYBRID},
+   {USB_DEVICE(0x1b80, 0xe421),
+.driver_info = CX231XX_BOARD_KWORLD_UB445_USB_HYBRID},
{USB_DEVICE(0x1f4d, 0x0237),
 .driver_info = CX231XX_BOARD_ICONBIT_U100},
{USB_DEVICE(0x0fd9, 0x0037),
diff --git a/drivers/media/usb/cx231xx/cx231xx-dvb.c 
b/drivers/media/usb/cx231xx/cx231xx-dvb.c
index 14e2610..4504bc6 100644
--- a/drivers/media/usb/cx231xx/cx231xx-dvb.c
+++ b/drivers/media/usb/cx231xx/cx231xx-dvb.c
@@ -657,6 +657,7 @@ static int dvb_init(struct cx231xx *dev)
}
break;
case CX231XX_BOARD_CNXT_RDU_253S:
+   case CX231XX_BOARD_KWORLD_UB445_USB_HYBRID:
 
dev-dvb-frontend = dvb_attach(s5h1411_attach,
   tda18271_s5h1411_config,
diff --git a/drivers/media/usb/cx231xx/cx231xx.h 
b/drivers/media/usb/cx231xx/cx231xx.h
index e812119..babca7f 100644
--- a/drivers/media/usb/cx231xx/cx231xx.h
+++ b/drivers/media/usb/cx231xx/cx231xx.h
@@ -72,6 +72,7 @@
 #define CX231XX_BOARD_HAUPPAUGE_USB2_FM_NTSC 15
 #define CX231XX_BOARD_ELGATO_VIDEO_CAPTURE_V2 16
 #define CX231XX_BOARD_OTG102 17
+#define CX231XX_BOARD_KWORLD_UB445_USB_HYBRID 18
 
 /* Limits minimum and default number of buffers */
 #define CX231XX_MIN_BUF 4
-- 
1.8.3.4

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