Re:

2015-11-13 Thread Alberto Mardegan
On 11/12/2015 07:20 PM, Mauro Carvalho Chehab wrote:
> Complaining doesn't help at all. We don't read the mailing list to

I wasn't complaining, just asking :-)

[...]
> All patches that goes to the ML are automatically stored there, and will be
> handled by one of the (sub-)maintainers.
[...]

That was the information I missed. Then all is fine, thanks. :-)

Ciao,
  Alberto

-- 
http://blog.mardy.it <- geek in un lingua international!
--
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:

2015-11-13 Thread Mauro Carvalho Chehab
Em Fri, 13 Nov 2015 10:54:31 +0100
Patrick Boettcher  escreveu:

> On Thu, 12 Nov 2015 15:41:50 -0200 Mauro Carvalho Chehab
>  wrote:
> > > Is putting the patch in an attachment OK?
> > 
> > No, because it doesn't make easy for people to reply with comments.
> 
> Except if you are using claws. With which you can select text in a text
> attachment and click the reply button and it will create a response
> with the selected text in the message body. But only this part, not the
> rest of the message.

Yes, I use such feature when needed, but then I need to do two "replies"
and merge on a single reply email, with kinda sucks and spends me more time.
So, I tend to postpone those patches, if I am in a hurry.

However, lots of developers use mutt, with doesn't have such option.

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


[PATCH] [media] radio-shark2: constify radio_tea5777_ops structures

2015-11-13 Thread Julia Lawall
The radio_tea5777_ops structure is never modified, so declare it as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall 

---
 drivers/media/radio/radio-shark2.c  |2 +-
 drivers/media/radio/radio-tea5777.h |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/radio/radio-tea5777.h 
b/drivers/media/radio/radio-tea5777.h
index 4ea43a9..4bd9425 100644
--- a/drivers/media/radio/radio-tea5777.h
+++ b/drivers/media/radio/radio-tea5777.h
@@ -76,7 +76,7 @@ struct radio_tea5777 {
u32 read_reg;
u64 write_reg;
struct mutex mutex;
-   struct radio_tea5777_ops *ops;
+   const struct radio_tea5777_ops *ops;
void *private_data;
u8 card[32];
u8 bus_info[32];
diff --git a/drivers/media/radio/radio-shark2.c 
b/drivers/media/radio/radio-shark2.c
index 8654e0d..0e65a85 100644
--- a/drivers/media/radio/radio-shark2.c
+++ b/drivers/media/radio/radio-shark2.c
@@ -137,7 +137,7 @@ static int shark_read_reg(struct radio_tea5777 *tea, u32 
*reg_ret)
return 0;
 }
 
-static struct radio_tea5777_ops shark_tea_ops = {
+static const struct radio_tea5777_ops shark_tea_ops = {
.write_reg = shark_write_reg,
.read_reg  = shark_read_reg,
 };

--
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] v4l2-dv-timings: add new arg to v4l2_match_dv_timings

2015-11-13 Thread Hans Verkuil
Add the new match_reduced_fps argument to v4l2_match_dv_timings().
Depending on the situation you may or may not desire to match the
reduced_fps flag. Typically only HDMI transmitters will need to
check for this flag.

Signed-off-by: Hans Verkuil 
---

Needed to make Prashant's "[RFC v2 0/4] vivid: reduced fps support"
patch series work for HDMI output.

https://www.mail-archive.com/linux-media@vger.kernel.org/msg92552.html

 drivers/media/i2c/adv7604.c  | 6 +++---
 drivers/media/i2c/adv7842.c  | 6 +++---
 drivers/media/i2c/tc358743.c | 4 ++--
 drivers/media/pci/cobalt/cobalt-v4l2.c   | 2 +-
 drivers/media/platform/s5p-tv/hdmi_drv.c | 2 +-
 drivers/media/platform/vivid/vivid-vid-cap.c | 2 +-
 drivers/media/platform/vivid/vivid-vid-out.c | 2 +-
 drivers/media/usb/hdpvr/hdpvr-video.c| 2 +-
 drivers/media/v4l2-core/v4l2-dv-timings.c| 9 +++--
 include/media/v4l2-dv-timings.h  | 4 +++-
 10 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index 5631ec0..d642303 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -905,7 +905,7 @@ static int find_and_set_predefined_video_timings(struct 
v4l2_subdev *sd,
 
for (i = 0; predef_vid_timings[i].timings.bt.width; i++) {
if (!v4l2_match_dv_timings(timings, 
_vid_timings[i].timings,
-   is_digital_input(sd) ? 25 : 
100))
+   is_digital_input(sd) ? 25 : 100, false))
continue;
io_write(sd, 0x00, predef_vid_timings[i].vid_std); /* video std 
*/
io_write(sd, 0x01, (predef_vid_timings[i].v_freq << 4) +
@@ -1479,7 +1479,7 @@ static void 
adv76xx_fill_optional_dv_timings_fields(struct v4l2_subdev *sd,
 
for (i = 0; adv76xx_timings[i].bt.width; i++) {
if (v4l2_match_dv_timings(timings, _timings[i],
-   is_digital_input(sd) ? 25 : 
100)) {
+   is_digital_input(sd) ? 25 : 100, 
false)) {
*timings = adv76xx_timings[i];
break;
}
@@ -1644,7 +1644,7 @@ static int adv76xx_s_dv_timings(struct v4l2_subdev *sd,
if (!timings)
return -EINVAL;
 
-   if (v4l2_match_dv_timings(>timings, timings, 0)) {
+   if (v4l2_match_dv_timings(>timings, timings, 0, false)) {
v4l2_dbg(1, debug, sd, "%s: no change\n", __func__);
return 0;
}
diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c
index b7269b8..56726dc 100644
--- a/drivers/media/i2c/adv7842.c
+++ b/drivers/media/i2c/adv7842.c
@@ -155,7 +155,7 @@ static bool adv7842_check_dv_timings(const struct 
v4l2_dv_timings *t, void *hdl)
int i;
 
for (i = 0; adv7842_timings_exceptions[i].bt.width; i++)
-   if (v4l2_match_dv_timings(t, adv7842_timings_exceptions + i, 0))
+   if (v4l2_match_dv_timings(t, adv7842_timings_exceptions + i, 0, 
false))
return false;
return true;
 }
@@ -1008,7 +1008,7 @@ static int find_and_set_predefined_video_timings(struct 
v4l2_subdev *sd,
 
for (i = 0; predef_vid_timings[i].timings.bt.width; i++) {
if (!v4l2_match_dv_timings(timings, 
_vid_timings[i].timings,
- is_digital_input(sd) ? 25 : 
100))
+ is_digital_input(sd) ? 25 : 100, 
false))
continue;
/* video std */
io_write(sd, 0x00, predef_vid_timings[i].vid_std);
@@ -1659,7 +1659,7 @@ static int adv7842_s_dv_timings(struct v4l2_subdev *sd,
if (state->mode == ADV7842_MODE_SDP)
return -ENODATA;
 
-   if (v4l2_match_dv_timings(>timings, timings, 0)) {
+   if (v4l2_match_dv_timings(>timings, timings, 0, false)) {
v4l2_dbg(1, debug, sd, "%s: no change\n", __func__);
return 0;
}
diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c
index 9ef5baa..fdf1333 100644
--- a/drivers/media/i2c/tc358743.c
+++ b/drivers/media/i2c/tc358743.c
@@ -862,7 +862,7 @@ static void tc358743_format_change(struct v4l2_subdev *sd)
v4l2_dbg(1, debug, sd, "%s: Format changed. No signal\n",
__func__);
} else {
-   if (!v4l2_match_dv_timings(>timings, , 0))
+   if (!v4l2_match_dv_timings(>timings, , 0, false))
enable_stream(sd, false);
 
v4l2_print_dv_timings(sd->name,
@@ -1366,7 +1366,7 @@ static int tc358743_s_dv_timings(struct v4l2_subdev *sd,
v4l2_print_dv_timings(sd->name, "tc358743_s_dv_timings: ",

Re:

2015-11-13 Thread Patrick Boettcher
On Thu, 12 Nov 2015 15:41:50 -0200 Mauro Carvalho Chehab
 wrote:
> > Is putting the patch in an attachment OK?
> 
> No, because it doesn't make easy for people to reply with comments.

Except if you are using claws. With which you can select text in a text
attachment and click the reply button and it will create a response
with the selected text in the message body. But only this part, not the
rest of the message.

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


Re: [Patch v2 1/2] media: v4l: ti-vpe: Add CAL v4l2 camera capture driver

2015-11-13 Thread Hans Verkuil
On 10/20/2015 09:55 PM, Hans Verkuil wrote:
> On 10/16/2015 05:07 PM, Hans Verkuil wrote:
>> On 09/21/2015 10:04 PM, Benoit Parrot wrote:
>>> The Camera Adaptation Layer (CAL) is a block which consists of a dual
>>> port CSI2/MIPI camera capture engine.
>>> Port #0 can handle CSI2 camera connected to up to 4 data lanes.
>>> Port #1 can handle CSI2 camera connected to up to 2 data lanes.
>>> The driver implements the required API/ioctls to be V4L2 compliant.
>>> Driver supports the following:
>>> - V4L2 API using DMABUF/MMAP buffer access based on videobuf2 api
>>> - Asynchronous sensor sub device registration
>>> - DT support
>>>
>>> Signed-off-by: Benoit Parrot 
>>> ---
>>>  drivers/media/platform/Kconfig   |   12 +
>>>  drivers/media/platform/Makefile  |2 +
>>>  drivers/media/platform/ti-vpe/Makefile   |4 +
>>>  drivers/media/platform/ti-vpe/cal.c  | 2161 
>>> ++
>>>  drivers/media/platform/ti-vpe/cal_regs.h |  779 +++
>>>  5 files changed, 2958 insertions(+)
>>>  create mode 100644 drivers/media/platform/ti-vpe/cal.c
>>>  create mode 100644 drivers/media/platform/ti-vpe/cal_regs.h
>>>
>>> diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
>>> index dc75694ac12d..c7f5704c56a2 100644
>>> --- a/drivers/media/platform/Kconfig
>>> +++ b/drivers/media/platform/Kconfig
>>> @@ -120,6 +120,18 @@ source "drivers/media/platform/s5p-tv/Kconfig"
>>>  source "drivers/media/platform/am437x/Kconfig"
>>>  source "drivers/media/platform/xilinx/Kconfig"
>>>  
>>> +config VIDEO_TI_CAL
>>> +   tristate "TI CAL (Camera Adaptation Layer) driver"
>>> +   depends on VIDEO_DEV && VIDEO_V4L2 && SOC_DRA7XX
>>> +   depends on VIDEO_V4L2_SUBDEV_API
>>> +   depends on VIDEOBUF2_DMA_CONTIG
>>
>> This should be:
>>
>>depends on VIDEO_DEV && VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API
>>depends on SOC_DRA7XX || COMPILE_TEST
>>select VIDEOBUF2_DMA_CONTIG
>>
>>> +   default n
>>> +   ---help---
>>> + Support for the TI CAL (Camera Adaptation Layer) block
>>> + found on DRA72X SoC.
>>> + In TI Technical Reference Manual this module is referred as
>>> + Camera Interface Subsystem (CAMSS).
>>> +
>>>  endif # V4L_PLATFORM_DRIVERS
>>>  
>>>  menuconfig V4L_MEM2MEM_DRIVERS
>>
>> By compiling with COMPILE_TEST I found a number of compile warnings and it 
>> also no
>> longer compiled due to vb2 changes. Both are fixed in the patch below.
>>
>> SoB for the patch: Signed-off-by: Hans Verkuil 
>>
>> That said, I'll postpone merging this until the remainder of the vb2 split 
>> patches
>> have been merged. When that's done this driver will have to be changed some 
>> more.
> 
> OK, the vb2 split patches were just merged. Can you rebase and repost?

Ping!

I'd like to merge this driver, so if you can rebase and take care of the 
trivial comments
I made in my review?

Thanks,

Hans

--
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] ttusb-dec: constify ttusbdecfe_config structure

2015-11-13 Thread Julia Lawall
The ttusbdecfe_config structure is never modified, so declare it
as const.

Other references to this structure type were already declared as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall 

---
 drivers/media/usb/ttusb-dec/ttusb_dec.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/ttusb-dec/ttusb_dec.c 
b/drivers/media/usb/ttusb-dec/ttusb_dec.c
index a5de46f..4e36e24 100644
--- a/drivers/media/usb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/usb/ttusb-dec/ttusb_dec.c
@@ -1606,7 +1606,7 @@ static int fe_send_command(struct dvb_frontend* fe, const 
u8 command,
return ttusb_dec_send_command(dec, command, param_length, params, 
result_length, cmd_result);
 }
 
-static struct ttusbdecfe_config fe_config = {
+static const struct ttusbdecfe_config fe_config = {
.send_command = fe_send_command
 };
 

--
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] drivers/media/usb/dvb-usb-v2: constify mxl111sf_demod_config structure

2015-11-13 Thread Michael Ira Krufky
Thanks for this!

Reviewed-by: Michael Ira Krufky 

On Fri, Nov 13, 2015 at 7:24 AM, Julia Lawall  wrote:
> The mxl111sf_demod_config structure is never modified, so declare it
> as const.
>
> Done with the help of Coccinelle.
>
> Signed-off-by: Julia Lawall 
>
> ---
>  drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c |4 ++--
>  drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h |4 ++--
>  drivers/media/usb/dvb-usb-v2/mxl111sf.c   |2 +-
>  3 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c 
> b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c
> index ea37536..84f6de6 100644
> --- a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c
> +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c
> @@ -35,7 +35,7 @@ MODULE_PARM_DESC(debug, "set debugging level (1=info 
> (or-able)).");
>  struct mxl111sf_demod_state {
> struct mxl111sf_state *mxl_state;
>
> -   struct mxl111sf_demod_config *cfg;
> +   const struct mxl111sf_demod_config *cfg;
>
> struct dvb_frontend fe;
>  };
> @@ -579,7 +579,7 @@ static struct dvb_frontend_ops mxl111sf_demod_ops = {
>  };
>
>  struct dvb_frontend *mxl111sf_demod_attach(struct mxl111sf_state *mxl_state,
> -  struct mxl111sf_demod_config *cfg)
> +  const struct mxl111sf_demod_config *cfg)
>  {
> struct mxl111sf_demod_state *state = NULL;
>
> diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h 
> b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h
> index 0bd83e5..7065aca 100644
> --- a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h
> +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h
> @@ -35,11 +35,11 @@ struct mxl111sf_demod_config {
>  #if IS_ENABLED(CONFIG_DVB_USB_MXL111SF)
>  extern
>  struct dvb_frontend *mxl111sf_demod_attach(struct mxl111sf_state *mxl_state,
> -  struct mxl111sf_demod_config *cfg);
> +  const struct mxl111sf_demod_config *cfg);
>  #else
>  static inline
>  struct dvb_frontend *mxl111sf_demod_attach(struct mxl111sf_state *mxl_state,
> -  struct mxl111sf_demod_config *cfg)
> +  const struct mxl111sf_demod_config *cfg)
>  {
> printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
> return NULL;
> diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf.c 
> b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
> index bec12b0..c4a4a99 100644
> --- a/drivers/media/usb/dvb-usb-v2/mxl111sf.c
> +++ b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
> @@ -731,7 +731,7 @@ fail:
> return ret;
>  }
>
> -static struct mxl111sf_demod_config mxl_demod_config = {
> +static const struct mxl111sf_demod_config mxl_demod_config = {
> .read_reg= mxl111sf_read_reg,
> .write_reg   = mxl111sf_write_reg,
> .program_regs= mxl111sf_ctrl_program_regs,
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] [media] include/media: move platform driver headers to a separate dir

2015-11-13 Thread Mauro Carvalho Chehab
Em Wed, 11 Nov 2015 21:26:31 +0100
Arnd Bergmann  escreveu:

> On Wednesday 11 November 2015 15:14:48 Mauro Carvalho Chehab wrote:
> >  rename include/media/{ => platform}/exynos-fimc.h (100%)
> >  rename include/media/{ => platform}/mmp-camera.h (100%)
> >  rename include/media/{ => platform}/omap1_camera.h (100%)
> >  rename include/media/{ => platform}/omap4iss.h (100%)
> >  rename include/media/{ => platform}/s3c_camif.h (100%)
> >  rename include/media/{ => platform}/s5p_hdmi.h (100%)
> >  rename include/media/{ => platform}/sh_mobile_ceu.h (100%)
> >  rename include/media/{ => platform}/sh_mobile_csi2.h (100%)
> >  rename include/media/{ => platform}/sh_vou.h (100%)
> >  rename include/media/{ => platform}/sii9234.h (100%)
> >  rename include/media/{ => platform}/soc_camera.h (100%)
> >  rename include/media/{ => platform}/soc_camera_platform.h (98%)
> >  rename include/media/{ => platform}/soc_mediabus.h (100%)
> 
> This still seems to be a mix of various things. Some of these are interfaces
> between drivers, while others declare a foo_platform_data structure that
> is used to interface between platform code and the driver.

True. What about calling putting those driver interfaces under
include/media/drv-intf? That also helps moving the headers for other
non-platform drivers too.

> 
> I think the latter should go into include/linux/platform_data/media/*.h 
> instead.

Agreed.

Please see the enclosed patch:


Subject: [PATCH] [media] include/media: move platform driver headers to a
 separate dirs

Let's not mix headers used by the core with those headers that
are needed by some specific platform drivers or by platform data.

This patch was made via this script:
mkdir include/media/platform mkdir include/media/platform_data
(cd include/media/; git mv $(grep -l platform_data *.h|grep -v v4l2) 
platform_data/)
for i in include/media/*.h; do n=`basename $i`;  (for j in $(git grep 
-l $n); do dirname $j; done)|sort|uniq|grep -ve '^.$' > list; num=$(wc -l 
list|cut -d' ' -f1); if [ $num == 1 ]; then if [ "`grep platform list`" != "" 
]; then git mv $i include/media/drv-intf; fi; fi; done
git mv include/media/exynos* include/media/soc_* include/media/sh_* 
include/media/drv-intf/

And some headers were manually adjusted. Then, this script fixed the
address for those new headers:

for i in $(find include/media/ -type f); do n=`basename $i`; git grep 
-l $n; done|sort|uniq >files && (echo "for i in \$(cat files); do cat \$i | 
\\"; cd include/media; for j in platform/ platform_data/; do for i in $(ls $j); 
do echo "perl -ne 's,(include [\\\"\\<]media/)($i)([\\\"\\>]),\1$j\2\3,; print 
\$_' |\\"; done; done; echo "cat > a && mv a \$i; done") >script&& . ./script

Signed-off-by: Mauro Carvalho Chehab 

---

 arch/arm/mach-imx/mach-imx27_visstrim_m10.c  | 2 +-
 arch/arm/mach-imx/mach-mx27_3ds.c| 2 +-
 arch/arm/mach-imx/mach-mx31_3ds.c| 2 +-
 arch/arm/mach-imx/mach-mx35_3ds.c| 2 +-
 arch/arm/mach-imx/mach-pcm037.c  | 2 +-
 arch/arm/mach-imx/mx31moboard-marxbot.c  | 2 +-
 arch/arm/mach-imx/mx31moboard-smartbot.c | 2 +-
 arch/arm/mach-omap1/board-ams-delta.c| 2 +-
 arch/arm/mach-omap1/include/mach/camera.h| 2 +-
 arch/arm/mach-omap2/board-rx51-peripherals.c | 4 ++--
 arch/arm/mach-pxa/em-x270.c  | 2 +-
 arch/arm/mach-pxa/ezx.c  | 2 +-
 arch/arm/mach-pxa/mioa701.c  | 2 +-
 arch/arm/mach-pxa/palmz72.c  | 2 +-
 arch/arm/mach-pxa/pcm990-baseboard.c | 2 +-
 arch/arm/mach-shmobile/board-bockw.c | 2 +-
 arch/arm/plat-samsung/devs.c | 2 +-
 arch/sh/boards/mach-ap325rxa/setup.c | 6 +++---
 arch/sh/boards/mach-ecovec24/setup.c | 6 +++---
 arch/sh/boards/mach-kfr2r09/setup.c  | 4 ++--
 arch/sh/boards/mach-migor/setup.c| 4 ++--
 arch/sh/boards/mach-se/7724/setup.c  | 4 ++--
 drivers/media/common/cx2341x.c   | 2 +-
 drivers/media/common/saa7146/saa7146_core.c  | 2 +-
 drivers/media/common/saa7146/saa7146_fops.c  | 2 +-
 drivers/media/common/saa7146/saa7146_hlp.c   | 2 +-
 drivers/media/common/saa7146/saa7146_i2c.c   | 2 +-
 drivers/media/common/saa7146/saa7146_vbi.c   | 2 +-
 drivers/media/common/saa7146/saa7146_video.c | 2 +-
 drivers/media/i2c/cx25840/cx25840-audio.c| 2 +-
 drivers/media/i2c/cx25840/cx25840-core.c | 2 +-
 drivers/media/i2c/cx25840/cx25840-firmware.c | 2 +-
 drivers/media/i2c/cx25840/cx25840-ir.c   | 2 +-
 

[PATCH 4/4] si2165: Add DVB-C support for HVR-4400/HVR-5500

2015-11-13 Thread Matthias Schwarzott
It works only for HVR-4400/HVR-5500.
For WinTV-HVR-930C-HD it fails with bad/no reception
for unknown reasons.

Signed-off-by: Matthias Schwarzott 
---
 drivers/media/dvb-frontends/si2165.c | 132 +++
 1 file changed, 120 insertions(+), 12 deletions(-)

diff --git a/drivers/media/dvb-frontends/si2165.c 
b/drivers/media/dvb-frontends/si2165.c
index c87d927..97a6eac 100644
--- a/drivers/media/dvb-frontends/si2165.c
+++ b/drivers/media/dvb-frontends/si2165.c
@@ -760,7 +760,7 @@ static int si2165_set_oversamp(struct si2165_state *state, 
u32 dvb_rate)
do_div(oversamp, dvb_rate);
reg_value = oversamp & 0x3fff;
 
-   /* oversamp, usbdump contained 0x0310; */
+   dprintk("%s: Write oversamp=%#x\n", __func__, reg_value);
return si2165_writereg32(state, 0x00e4, reg_value);
 }
 
@@ -823,7 +823,7 @@ static const struct si2165_reg_value_pair dvbt_regs[] = {
{ 0x0387, 0x00 }
 };
 
-static int si2165_set_parameters(struct dvb_frontend *fe)
+static int si2165_set_frontend_dvbt(struct dvb_frontend *fe)
 {
int ret;
struct dtv_frontend_properties *p = >dtv_property_cache;
@@ -851,9 +851,6 @@ static int si2165_set_parameters(struct dvb_frontend *fe)
if (ret < 0)
return ret;
 
-   ret = si2165_set_if_freq_shift(state);
-   if (ret < 0)
-   return ret;
ret = si2165_writereg8(state, 0x08f8, 0x00);
if (ret < 0)
return ret;
@@ -874,6 +871,110 @@ static int si2165_set_parameters(struct dvb_frontend *fe)
if (ret < 0)
return ret;
 
+   return 0;
+}
+
+static const struct si2165_reg_value_pair dvbc_regs[] = {
+   /* agc2 */
+   { 0x016e, 0x50 },
+   { 0x016c, 0x0e },
+   { 0x016d, 0x10 },
+   /* agc */
+   { 0x015b, 0x03 },
+   { 0x0150, 0x68 },
+   /* agc */
+   { 0x01a0, 0x68 },
+   { 0x01c8, 0x50 },
+
+   { 0x0278, 0x0d },
+
+   { 0x023a, 0x05 },
+   { 0x0261, 0x09 },
+   REG16(0x0350, 0x3e80),
+   { 0x02f4, 0x00 }
+};
+
+static int si2165_set_frontend_dvbc(struct dvb_frontend *fe)
+{
+   struct si2165_state *state = fe->demodulator_priv;
+   int ret;
+   struct dtv_frontend_properties *p = >dtv_property_cache;
+   const u32 dvb_rate = p->symbol_rate;
+   const u32 bw_hz = p->bandwidth_hz;
+
+   if (!state->has_dvbc)
+   return -EINVAL;
+
+   if (dvb_rate == 0)
+   return -EINVAL;
+
+   /* standard = DVB-C */
+   ret = si2165_writereg8(state, 0x00ec, 0x05);
+   if (ret < 0)
+   return ret;
+   ret = si2165_adjust_pll_divl(state, 14);
+   if (ret < 0)
+   return ret;
+
+   ret = si2165_writereg8(state, 0x08f8, 0x00);
+   if (ret < 0)
+   return ret;
+
+   /* Oversampling */
+   ret = si2165_set_oversamp(state, dvb_rate);
+   if (ret < 0)
+   return ret;
+
+   ret = si2165_write_reg_list(state, dvbc_regs, ARRAY_SIZE(dvbc_regs));
+   if (ret < 0)
+   return ret;
+
+   /* dsp_addr_jump */
+   ret = si2165_writereg32(state, 0x0348, 0xf400);
+   if (ret < 0)
+   return ret;
+
+   si2165_writereg32(state, 0x00c4, bw_hz);
+   si2165_writereg8(state, 0x00cb, 0x01);
+   si2165_writereg8(state, 0x00c0, 0x00);
+   si2165_writereg16(state, 0x024c, 0x);
+   si2165_writereg16(state, 0x027c, 0x);
+   si2165_writereg8(state, 0x0232, 0x03);
+   si2165_writereg8(state, 0x02f4, 0x0b);
+   si2165_writereg8(state, 0x00c0, 0x00);
+   si2165_writereg8(state, 0x018b, 0x00);
+
+   return 0;
+}
+
+static int si2165_set_frontend(struct dvb_frontend *fe)
+{
+   struct si2165_state *state = fe->demodulator_priv;
+   struct dtv_frontend_properties *p = >dtv_property_cache;
+   u32 delsys = p->delivery_system;
+   int ret;
+   u8 val[3];
+
+   /* initial setting of if freq shift */
+   ret = si2165_set_if_freq_shift(state);
+   if (ret < 0)
+   return ret;
+
+   switch (delsys) {
+   case SYS_DVBT:
+   ret = si2165_set_frontend_dvbt(fe);
+   if (ret < 0)
+   return ret;
+   break;
+   case SYS_DVBC_ANNEX_A:
+   ret = si2165_set_frontend_dvbc(fe);
+   if (ret < 0)
+   return ret;
+   break;
+   default:
+   return -EINVAL;
+   }
+
if (fe->ops.tuner_ops.set_params)
fe->ops.tuner_ops.set_params(fe);
 
@@ -889,6 +990,7 @@ static int si2165_set_parameters(struct dvb_frontend *fe)
ret = si2165_writereg8(state, 0x0341, 0x00);
if (ret < 0)
return ret;
+
/* reset all */
ret = si2165_writereg8(state, 0x00c0, 0x00);
if (ret < 0)
@@ -902,7 +1004,7 @@ static int si2165_set_parameters(struct dvb_frontend *fe)
 

Re: [PATCH 2/2] [media] include/media: move platform driver headers to a separate dir

2015-11-13 Thread Mauro Carvalho Chehab
Em Fri, 13 Nov 2015 22:31:15 +0100
Arnd Bergmann  escreveu:

> On Friday 13 November 2015 17:13:41 Mauro Carvalho Chehab wrote:
> > Em Wed, 11 Nov 2015 21:26:31 +0100
> > Arnd Bergmann  escreveu:
> > 
> 
> >  include/media/{ => drv-intf}/cx2341x.h   | 0
> >  include/media/{ => drv-intf}/cx25840.h   | 0
> >  include/media/{ => drv-intf}/exynos-fimc.h   | 0
> >  include/media/{ => drv-intf}/msp3400.h   | 0
> >  include/media/{ => drv-intf}/s3c_camif.h | 0
> >  include/media/{ => drv-intf}/saa7146.h   | 0
> >  include/media/{ => drv-intf}/saa7146_vv.h| 2 +-
> >  include/media/{ => drv-intf}/sh_mobile_ceu.h | 0
> >  include/media/{ => drv-intf}/sh_mobile_csi2.h| 0
> >  include/media/{ => drv-intf}/sh_vou.h| 0
> >  include/media/{ => drv-intf}/si476x.h| 0
> >  include/media/{ => drv-intf}/soc_mediabus.h  | 0
> >  include/media/{ => drv-intf}/tea575x.h   | 0
> >  include/media/i2c/tw9910.h   | 2 +-
> >  include/media/{ => platform_data}/gpio-ir-recv.h | 0
> >  include/media/{ => platform_data}/ir-rx51.h  | 0
> >  include/media/{ => platform_data}/mmp-camera.h   | 0
> >  include/media/{ => platform_data}/omap1_camera.h | 0
> >  include/media/{ => platform_data}/omap4iss.h | 0
> >  include/media/{ => platform_data}/s5p_hdmi.h | 0
> >  include/media/{ => platform_data}/si4713.h   | 0
> >  include/media/{ => platform_data}/sii9234.h  | 0
> >  include/media/{ => platform_data}/smiapp.h   | 0
> >  include/media/{ => platform_data}/soc_camera.h   | 0
> >  include/media/{ => platform_data}/soc_camera_platform.h  | 2 +-
> >  include/media/{ => platform_data}/timb_radio.h   | 0
> >  include/media/{ => platform_data}/timb_video.h   | 0
> >  sound/pci/es1968.c   | 2 +-
> >  sound/pci/fm801.c| 2 +-
> >  155 files changed, 158 insertions(+), 158 deletions(-)
> 
> As Geert said, include/linux/platform_data/media/ would be nicer for
> consistency with other subsystems.

OK! I have a new series of patches almost ready. I'll be sending it
tomorrow, after addressing your concerns.

> 
> > diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c 
> > b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
> > index ede2bdbb5dd5..44ba1f28bb34 100644
> > --- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
> > +++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
> > @@ -33,7 +33,7 @@
> >  #include 
> >  #include 
> >  #include 
> > -#include 
> > +#include 
> >  #include 
> >  #include 
> >  #include 
> 
> This looks like a mistake: the header contains the string 'platform_data',
> but it is not actually a platform data header file in the sense
> that it defines the interface between platform and driver.
> 
> Maybe soc_camera.h is important enough to still leave it as a core
> file in the existing location? Or possibly a separate directory for
> media/soc_camera/*.h

Ok, I'll fix it. 

> 
> > @@ -24,7 +24,7 @@
> >  #include 
> >  #include 
> >  #include 
> > -#include 
> > +#include 
> >  #include 
> >  
> >  #include "cx25840-core.h"
> 
> For this case, I think the original patch to move it into include/media/i2c
> was more logical as it mirrors the file structure. I was mainly talking
> about the platform_data being different from the rest.

cx25840 is not (always) an I2C. On most devices, this is actually an IP
block inside the bridge chipset. 

That's why I didn't include it on patch 1/1. There's one thing to
notice about that, though: while most of the header is describing
the driver interface, it does contain one platform_data in the end:

/* pvr150_workaround activates a workaround for a hardware bug that is
   present in Hauppauge PVR-150 (and possibly PVR-500) cards that have
   certain NTSC tuners (tveeprom tuner model numbers 85, 99 and 112). The
   audio autodetect fails on some channels for these models and the workaround
   is to select the audio standard explicitly. Many thanks to Hauppauge for
   providing this information.
   This platform data only needs to be supplied by the ivtv driver. */
struct cx25840_platform_data {
int pvr150_workaround;
};

While we might split it, I guess it is not worth, specially since
I don't think we'll see any new driver using it.

Also, this is actually a hack used only by the ivtv driver.

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


Re: [PATCH 2/2] [media] include/media: move platform driver headers to a separate dir

2015-11-13 Thread Arnd Bergmann
On Friday 13 November 2015 17:13:41 Mauro Carvalho Chehab wrote:
> Em Wed, 11 Nov 2015 21:26:31 +0100
> Arnd Bergmann  escreveu:
> 

>  include/media/{ => drv-intf}/cx2341x.h   | 0
>  include/media/{ => drv-intf}/cx25840.h   | 0
>  include/media/{ => drv-intf}/exynos-fimc.h   | 0
>  include/media/{ => drv-intf}/msp3400.h   | 0
>  include/media/{ => drv-intf}/s3c_camif.h | 0
>  include/media/{ => drv-intf}/saa7146.h   | 0
>  include/media/{ => drv-intf}/saa7146_vv.h| 2 +-
>  include/media/{ => drv-intf}/sh_mobile_ceu.h | 0
>  include/media/{ => drv-intf}/sh_mobile_csi2.h| 0
>  include/media/{ => drv-intf}/sh_vou.h| 0
>  include/media/{ => drv-intf}/si476x.h| 0
>  include/media/{ => drv-intf}/soc_mediabus.h  | 0
>  include/media/{ => drv-intf}/tea575x.h   | 0
>  include/media/i2c/tw9910.h   | 2 +-
>  include/media/{ => platform_data}/gpio-ir-recv.h | 0
>  include/media/{ => platform_data}/ir-rx51.h  | 0
>  include/media/{ => platform_data}/mmp-camera.h   | 0
>  include/media/{ => platform_data}/omap1_camera.h | 0
>  include/media/{ => platform_data}/omap4iss.h | 0
>  include/media/{ => platform_data}/s5p_hdmi.h | 0
>  include/media/{ => platform_data}/si4713.h   | 0
>  include/media/{ => platform_data}/sii9234.h  | 0
>  include/media/{ => platform_data}/smiapp.h   | 0
>  include/media/{ => platform_data}/soc_camera.h   | 0
>  include/media/{ => platform_data}/soc_camera_platform.h  | 2 +-
>  include/media/{ => platform_data}/timb_radio.h   | 0
>  include/media/{ => platform_data}/timb_video.h   | 0
>  sound/pci/es1968.c   | 2 +-
>  sound/pci/fm801.c| 2 +-
>  155 files changed, 158 insertions(+), 158 deletions(-)

As Geert said, include/linux/platform_data/media/ would be nicer for
consistency with other subsystems.

> diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c 
> b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
> index ede2bdbb5dd5..44ba1f28bb34 100644
> --- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
> +++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
> @@ -33,7 +33,7 @@
>  #include 
>  #include 
>  #include 
> -#include 
> +#include 
>  #include 
>  #include 
>  #include 

This looks like a mistake: the header contains the string 'platform_data',
but it is not actually a platform data header file in the sense
that it defines the interface between platform and driver.

Maybe soc_camera.h is important enough to still leave it as a core
file in the existing location? Or possibly a separate directory for
media/soc_camera/*.h

> @@ -24,7 +24,7 @@
>  #include 
>  #include 
>  #include 
> -#include 
> +#include 
>  #include 
>  
>  #include "cx25840-core.h"

For this case, I think the original patch to move it into include/media/i2c
was more logical as it mirrors the file structure. I was mainly talking
about the platform_data being different from the rest.

Arnd
--
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] i2c: constify v4l2_ctrl_ops structures

2015-11-13 Thread Julia Lawall
These v4l2_ctrl_ops structures are never modified, like all the other
v4l2_ctrl_ops structures, so declare them as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall 

---
 drivers/media/i2c/mt9m032.c |2 +-
 drivers/media/i2c/mt9p031.c |2 +-
 drivers/media/i2c/mt9t001.c |2 +-
 drivers/media/i2c/mt9v011.c |2 +-
 drivers/media/i2c/mt9v032.c |2 +-
 drivers/media/i2c/ov2659.c  |2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/media/i2c/mt9t001.c b/drivers/media/i2c/mt9t001.c
index 8ae99f7..3486bc8 100644
--- a/drivers/media/i2c/mt9t001.c
+++ b/drivers/media/i2c/mt9t001.c
@@ -626,7 +626,7 @@ static int mt9t001_s_ctrl(struct v4l2_ctrl *ctrl)
return 0;
 }
 
-static struct v4l2_ctrl_ops mt9t001_ctrl_ops = {
+static const struct v4l2_ctrl_ops mt9t001_ctrl_ops = {
.s_ctrl = mt9t001_s_ctrl,
 };
 
diff --git a/drivers/media/i2c/mt9v032.c b/drivers/media/i2c/mt9v032.c
index a68ce94..b8e80c0 100644
--- a/drivers/media/i2c/mt9v032.c
+++ b/drivers/media/i2c/mt9v032.c
@@ -703,7 +703,7 @@ static int mt9v032_s_ctrl(struct v4l2_ctrl *ctrl)
return 0;
 }
 
-static struct v4l2_ctrl_ops mt9v032_ctrl_ops = {
+static const struct v4l2_ctrl_ops mt9v032_ctrl_ops = {
.s_ctrl = mt9v032_s_ctrl,
 };
 
diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
index 0db15f5..1e78aa2 100644
--- a/drivers/media/i2c/mt9p031.c
+++ b/drivers/media/i2c/mt9p031.c
@@ -817,7 +817,7 @@ static int mt9p031_s_ctrl(struct v4l2_ctrl *ctrl)
return 0;
 }
 
-static struct v4l2_ctrl_ops mt9p031_ctrl_ops = {
+static const struct v4l2_ctrl_ops mt9p031_ctrl_ops = {
.s_ctrl = mt9p031_s_ctrl,
 };
 
diff --git a/drivers/media/i2c/mt9v011.c b/drivers/media/i2c/mt9v011.c
index a4a5c39..c681b3b 100644
--- a/drivers/media/i2c/mt9v011.c
+++ b/drivers/media/i2c/mt9v011.c
@@ -454,7 +454,7 @@ static int mt9v011_s_ctrl(struct v4l2_ctrl *ctrl)
return 0;
 }
 
-static struct v4l2_ctrl_ops mt9v011_ctrl_ops = {
+static const struct v4l2_ctrl_ops mt9v011_ctrl_ops = {
.s_ctrl = mt9v011_s_ctrl,
 };
 
diff --git a/drivers/media/i2c/ov2659.c b/drivers/media/i2c/ov2659.c
index 49109f4..b952e7d 100644
--- a/drivers/media/i2c/ov2659.c
+++ b/drivers/media/i2c/ov2659.c
@@ -1249,7 +1249,7 @@ static int ov2659_s_ctrl(struct v4l2_ctrl *ctrl)
return 0;
 }
 
-static struct v4l2_ctrl_ops ov2659_ctrl_ops = {
+static const struct v4l2_ctrl_ops ov2659_ctrl_ops = {
.s_ctrl = ov2659_s_ctrl,
 };
 
diff --git a/drivers/media/i2c/mt9m032.c b/drivers/media/i2c/mt9m032.c
index c7747bd..eec064e 100644
--- a/drivers/media/i2c/mt9m032.c
+++ b/drivers/media/i2c/mt9m032.c
@@ -671,7 +671,7 @@ static int mt9m032_set_ctrl(struct v4l2_ctrl *ctrl)
return 0;
 }
 
-static struct v4l2_ctrl_ops mt9m032_ctrl_ops = {
+static const struct v4l2_ctrl_ops mt9m032_ctrl_ops = {
.s_ctrl = mt9m032_set_ctrl,
.try_ctrl = mt9m032_try_ctrl,
 };

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


[PATCH 3/4] si2165: cleanup logic

2015-11-13 Thread Matthias Schwarzott
Make si2165_set_if_freq_shift query IF frequency itself.
create function to write a set of registers
Always write adc registers after reset.

Signed-off-by: Matthias Schwarzott 
---
 drivers/media/dvb-frontends/si2165.c | 173 ++-
 1 file changed, 87 insertions(+), 86 deletions(-)

diff --git a/drivers/media/dvb-frontends/si2165.c 
b/drivers/media/dvb-frontends/si2165.c
index c5d7c0d..c87d927 100644
--- a/drivers/media/dvb-frontends/si2165.c
+++ b/drivers/media/dvb-frontends/si2165.c
@@ -243,6 +243,27 @@ err:
return ret;
 }
 
+#define REG16(reg, val) { (reg), (val) & 0xff }, { (reg)+1, (val)>>8 & 0xff }
+struct si2165_reg_value_pair {
+   u16 reg;
+   u8 val;
+};
+
+static int si2165_write_reg_list(struct si2165_state *state,
+const struct si2165_reg_value_pair *regs,
+int count)
+{
+   int i;
+   int ret;
+
+   for (i = 0; i < count; i++) {
+   ret = si2165_writereg8(state, regs[i].reg, regs[i].val);
+   if (ret < 0)
+   return ret;
+   }
+   return 0;
+}
+
 static int si2165_get_tune_settings(struct dvb_frontend *fe,
struct dvb_frontend_tune_settings *s)
 {
@@ -669,22 +690,19 @@ static int si2165_init(struct dvb_frontend *fe)
goto error;
}
 
-   /* write adc values after each reset*/
-   ret = si2165_writereg8(state, 0x012a, 0x46);
-   if (ret < 0)
-   goto error;
-   ret = si2165_writereg8(state, 0x012c, 0x00);
+   /* ts output config */
+   ret = si2165_writereg8(state, 0x04e4, 0x20);
if (ret < 0)
-   goto error;
-   ret = si2165_writereg8(state, 0x012e, 0x0a);
+   return ret;
+   ret = si2165_writereg16(state, 0x04ef, 0x00fe);
if (ret < 0)
-   goto error;
-   ret = si2165_writereg8(state, 0x012f, 0xff);
+   return ret;
+   ret = si2165_writereg24(state, 0x04f4, 0x55);
if (ret < 0)
-   goto error;
-   ret = si2165_writereg8(state, 0x0123, 0x70);
+   return ret;
+   ret = si2165_writereg8(state, 0x04e5, 0x01);
if (ret < 0)
-   goto error;
+   return ret;
 
return 0;
 error:
@@ -746,12 +764,22 @@ static int si2165_set_oversamp(struct si2165_state 
*state, u32 dvb_rate)
return si2165_writereg32(state, 0x00e4, reg_value);
 }
 
-static int si2165_set_if_freq_shift(struct si2165_state *state, u32 IF)
+static int si2165_set_if_freq_shift(struct si2165_state *state)
 {
+   struct dvb_frontend *fe = &(state->frontend);
u64 if_freq_shift;
s32 reg_value = 0;
u32 fe_clk = si2165_get_fe_clk(state);
+   u32 IF = 0;
+
+   if (!fe->ops.tuner_ops.get_if_frequency) {
+   dev_err(>i2c->dev,
+   "%s: Error: get_if_frequency() not defined at tuner. 
Can't work without it!\n",
+   KBUILD_MODNAME);
+   return -EINVAL;
+   }
 
+   fe->ops.tuner_ops.get_if_frequency(fe, );
if_freq_shift = IF;
if_freq_shift <<= 29;
 
@@ -767,35 +795,53 @@ static int si2165_set_if_freq_shift(struct si2165_state 
*state, u32 IF)
return si2165_writereg32(state, 0x00e8, reg_value);
 }
 
+static const struct si2165_reg_value_pair agc_rewrite[] = {
+   { 0x012a, 0x46 },
+   { 0x012c, 0x00 },
+   { 0x012e, 0x0a },
+   { 0x012f, 0xff },
+   { 0x0123, 0x70 }
+};
+
+static const struct si2165_reg_value_pair dvbt_regs[] = {
+   /* impulsive_noise_remover */
+   { 0x031c, 0x01 },
+   { 0x00cb, 0x00 },
+   /* agc2 */
+   { 0x016e, 0x41 },
+   { 0x016c, 0x0e },
+   { 0x016d, 0x10 },
+   /* agc */
+   { 0x015b, 0x03 },
+   { 0x0150, 0x78 },
+   /* agc */
+   { 0x01a0, 0x78 },
+   { 0x01c8, 0x68 },
+   /* freq_sync_range */
+   REG16(0x030c, 0x0064),
+   /* gp_reg0 */
+   { 0x0387, 0x00 }
+};
+
 static int si2165_set_parameters(struct dvb_frontend *fe)
 {
int ret;
struct dtv_frontend_properties *p = >dtv_property_cache;
struct si2165_state *state = fe->demodulator_priv;
-   u8 val[3];
-   u32 IF;
u32 dvb_rate = 0;
u16 bw10k;
+   u32 bw_hz = p->bandwidth_hz;
 
dprintk("%s: called\n", __func__);
 
-   if (!fe->ops.tuner_ops.get_if_frequency) {
-   dev_err(>i2c->dev,
-   "%s: Error: get_if_frequency() not defined at tuner. 
Can't work without it!\n",
-   KBUILD_MODNAME);
-   return -EINVAL;
-   }
-
if (!state->has_dvbt)
return -EINVAL;
 
-   if (p->bandwidth_hz > 0) {
-   dvb_rate = p->bandwidth_hz * 8 / 7;
-   bw10k = p->bandwidth_hz / 1;
-   } else {
-   dvb_rate = 8 * 8 / 7;
- 

[PATCH 2/4] si2165: fix checkpatch issues

2015-11-13 Thread Matthias Schwarzott
Signed-off-by: Matthias Schwarzott 
---
 drivers/media/dvb-frontends/si2165.c | 69 
 1 file changed, 39 insertions(+), 30 deletions(-)

diff --git a/drivers/media/dvb-frontends/si2165.c 
b/drivers/media/dvb-frontends/si2165.c
index 7c2..c5d7c0d 100644
--- a/drivers/media/dvb-frontends/si2165.c
+++ b/drivers/media/dvb-frontends/si2165.c
@@ -1,21 +1,21 @@
 /*
-Driver for Silicon Labs Si2161 DVB-T and Si2165 DVB-C/-T Demodulator
-
-Copyright (C) 2013-2014 Matthias Schwarzott 
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-References:
-http://www.silabs.com/Support%20Documents/TechnicalDocs/Si2165-short.pdf
-*/
+ *  Driver for Silicon Labs Si2161 DVB-T and Si2165 DVB-C/-T Demodulator
+ *
+ *  Copyright (C) 2013-2014 Matthias Schwarzott 
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  References:
+ *  http://www.silabs.com/Support%20Documents/TechnicalDocs/Si2165-short.pdf
+ */
 
 #include 
 #include 
@@ -31,11 +31,13 @@
 #include "si2165_priv.h"
 #include "si2165.h"
 
-/* Hauppauge WinTV-HVR-930C-HD B130 / PCTV QuatroStick 521e 1113xx
- * uses 16 MHz xtal */
-
-/* Hauppauge WinTV-HVR-930C-HD B131 / PCTV QuatroStick 522e 1114xx
- * uses 24 MHz clock provided by tuner */
+/*
+ * Hauppauge WinTV-HVR-930C-HD B130 / PCTV QuatroStick 521e 1113xx
+ * uses 16 MHz xtal
+ *
+ * Hauppauge WinTV-HVR-930C-HD B131 / PCTV QuatroStick 522e 1114xx
+ * uses 24 MHz clock provided by tuner
+ */
 
 struct si2165_state {
struct i2c_adapter *i2c;
@@ -258,8 +260,10 @@ static int si2165_init_pll(struct si2165_state *state)
u8 divl = 12;
u8 buf[4];
 
-   /* hardcoded values can be deleted if calculation is verified
-* or it yields the same values as the windows driver */
+   /*
+* hardcoded values can be deleted if calculation is verified
+* or it yields the same values as the windows driver
+*/
switch (ref_freq_Hz) {
case 1600u:
divn = 56;
@@ -274,8 +278,10 @@ static int si2165_init_pll(struct si2165_state *state)
if (ref_freq_Hz > 1600u)
divr = 2;
 
-   /* now select divn and divp such that
-* fvco is in 1624..1824 MHz */
+   /*
+* now select divn and divp such that
+* fvco is in 1624..1824 MHz
+*/
if (162400u * divr > ref_freq_Hz * 2u * 63u)
divp = 4;
 
@@ -341,10 +347,12 @@ static int si2165_upload_firmware_block(struct 
si2165_state *state,
if (len % 4 != 0)
return -EINVAL;
 
-   deb_fw_load("si2165_upload_firmware_block called with len=0x%x 
offset=0x%x blockcount=0x%x\n",
+   deb_fw_load(
+   "si2165_upload_firmware_block called with len=0x%x offset=0x%x 
blockcount=0x%x\n",
len, offset, block_count);
while (offset+12 <= len && cur_block < block_count) {
-   deb_fw_load("si2165_upload_firmware_block in while len=0x%x 
offset=0x%x cur_block=0x%x blockcount=0x%x\n",
+   deb_fw_load(
+   "si2165_upload_firmware_block in while len=0x%x 
offset=0x%x cur_block=0x%x blockcount=0x%x\n",
len, offset, cur_block, block_count);
wordcount = data[offset];
if (wordcount < 1 || data[offset+1] ||
@@ -383,7 +391,8 @@ static int si2165_upload_firmware_block(struct si2165_state 
*state,
cur_block++;
}
 
-   deb_fw_load("si2165_upload_firmware_block after while len=0x%x 
offset=0x%x cur_block=0x%x blockcount=0x%x\n",
+   deb_fw_load(
+   "si2165_upload_firmware_block after while len=0x%x offset=0x%x 
cur_block=0x%x blockcount=0x%x\n",
len, offset, cur_block, block_count);
 
if (poffset)
@@ -633,7 +642,7 @@ static int si2165_init(struct dvb_frontend *fe)
   

Re: [PATCH 2/2] [media] include/media: move platform driver headers to a separate dir

2015-11-13 Thread Geert Uytterhoeven
On Fri, Nov 13, 2015 at 8:13 PM, Mauro Carvalho Chehab
 wrote:
>> I think the latter should go into include/linux/platform_data/media/*.h 
>> instead.
>
> Agreed.
>
> Please see the enclosed patch:
>
>
> Subject: [PATCH] [media] include/media: move platform driver headers to a
>  separate dirs
>
> Let's not mix headers used by the core with those headers that
> are needed by some specific platform drivers or by platform data.
>
> This patch was made via this script:
> mkdir include/media/platform mkdir include/media/platform_data
> (cd include/media/; git mv $(grep -l platform_data *.h|grep -v v4l2)

I think include/linux/platform_data/media/, like Arnd suggested,
would be better.

Then we can make it a common goal to empty include/linux/platform_data/ ;-)

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/4] si2165: cleanup logic

2015-11-13 Thread kbuild test robot
Hi Matthias,

[auto build test ERROR on v4.3-rc7]
[also build test ERROR on next-20151113]

url:
https://github.com/0day-ci/linux/commits/Matthias-Schwarzott/cx231xx_dvb-use-demod_i2c-for-demod-attach/20151114-065917
config: xtensa-allyesconfig (attached as .config)
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=xtensa 

Note: the 
linux-review/Matthias-Schwarzott/cx231xx_dvb-use-demod_i2c-for-demod-attach/20151114-065917
 HEAD 92eaa21d1f22e14d623c057e06ab9d5035f6df7b builds fine.
  It only hurts bisectibility.

All errors (new ones prefixed by >>):

   drivers/media/dvb-frontends/si2165.c: In function 'si2165_set_parameters':
>> drivers/media/dvb-frontends/si2165.c:886:39: error: 'val' undeclared (first 
>> use in this function)
 ret = si2165_readreg8(state, 0x0341, val);
  ^
   drivers/media/dvb-frontends/si2165.c:886:39: note: each undeclared 
identifier is reported only once for each function it appears in
>> drivers/media/dvb-frontends/si2165.c:905:3: error: label 'error' used but 
>> not defined
  goto error;
  ^

vim +/val +886 drivers/media/dvb-frontends/si2165.c

3e54a169 Matthias Schwarzott 2014-07-22  880/* recalc if_freq_shift if IF 
might has changed */
b480ae7b Matthias Schwarzott 2015-11-13  881ret = 
si2165_set_if_freq_shift(state);
3e54a169 Matthias Schwarzott 2014-07-22  882if (ret < 0)
3e54a169 Matthias Schwarzott 2014-07-22  883return ret;
3e54a169 Matthias Schwarzott 2014-07-22  884  
3e54a169 Matthias Schwarzott 2014-07-22  885/* boot/wdog status */
3e54a169 Matthias Schwarzott 2014-07-22 @886ret = si2165_readreg8(state, 
0x0341, val);
3e54a169 Matthias Schwarzott 2014-07-22  887if (ret < 0)
3e54a169 Matthias Schwarzott 2014-07-22  888return ret;
3e54a169 Matthias Schwarzott 2014-07-22  889ret = si2165_writereg8(state, 
0x0341, 0x00);
3e54a169 Matthias Schwarzott 2014-07-22  890if (ret < 0)
3e54a169 Matthias Schwarzott 2014-07-22  891return ret;
3e54a169 Matthias Schwarzott 2014-07-22  892/* reset all */
3e54a169 Matthias Schwarzott 2014-07-22  893ret = si2165_writereg8(state, 
0x00c0, 0x00);
3e54a169 Matthias Schwarzott 2014-07-22  894if (ret < 0)
3e54a169 Matthias Schwarzott 2014-07-22  895return ret;
3e54a169 Matthias Schwarzott 2014-07-22  896/* gp_reg0 */
3e54a169 Matthias Schwarzott 2014-07-22  897ret = si2165_writereg32(state, 
0x0384, 0x);
3e54a169 Matthias Schwarzott 2014-07-22  898if (ret < 0)
3e54a169 Matthias Schwarzott 2014-07-22  899return ret;
b480ae7b Matthias Schwarzott 2015-11-13  900  
b480ae7b Matthias Schwarzott 2015-11-13  901/* write adc values after each 
reset*/
b480ae7b Matthias Schwarzott 2015-11-13  902ret = 
si2165_write_reg_list(state, agc_rewrite,
b480ae7b Matthias Schwarzott 2015-11-13  903
ARRAY_SIZE(agc_rewrite));
b480ae7b Matthias Schwarzott 2015-11-13  904if (ret < 0)
b480ae7b Matthias Schwarzott 2015-11-13 @905goto error;
b480ae7b Matthias Schwarzott 2015-11-13  906  
3e54a169 Matthias Schwarzott 2014-07-22  907/* start_synchro */
3e54a169 Matthias Schwarzott 2014-07-22  908ret = si2165_writereg8(state, 
0x02e0, 0x01);

:: The code at line 886 was first introduced by commit
:: 3e54a1697ace99d1ad602ec268abf117ace1412f [media] si2165: Add demod 
driver for DVB-T only

:: TO: Matthias Schwarzott <z...@gentoo.org>
:: CC: Mauro Carvalho Chehab <m.che...@samsung.com>

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data


cron job: media_tree daily build: ERRORS

2015-11-13 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:   Sat Nov 14 04:00:17 CET 2015
git branch: test
git hash:   79f5b6ae960d380c829fb67d5dadcd1d025d2775
gcc version:i686-linux-gcc (GCC) 5.1.0
sparse version: v0.5.0
smatch version: host hardware:  x86_64
host os:4.2.0-164

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-bf561: OK
linux-git-i686: OK
linux-git-m32r: OK
linux-git-mips: OK
linux-git-powerpc64: OK
linux-git-sh: OK
linux-git-x86_64: OK
linux-2.6.32.27-i686: OK
linux-2.6.33.7-i686: OK
linux-2.6.34.7-i686: OK
linux-2.6.35.9-i686: OK
linux-2.6.36.4-i686: OK
linux-2.6.37.6-i686: OK
linux-2.6.38.8-i686: OK
linux-2.6.39.4-i686: OK
linux-3.0.60-i686: OK
linux-3.1.10-i686: OK
linux-3.2.37-i686: OK
linux-3.3.8-i686: OK
linux-3.4.27-i686: OK
linux-3.5.7-i686: OK
linux-3.6.11-i686: OK
linux-3.7.4-i686: OK
linux-3.8-i686: OK
linux-3.9.2-i686: OK
linux-3.10.1-i686: OK
linux-3.11.1-i686: OK
linux-3.12.23-i686: OK
linux-3.13.11-i686: OK
linux-3.14.9-i686: OK
linux-3.15.2-i686: OK
linux-3.16.7-i686: OK
linux-3.17.8-i686: OK
linux-3.18.7-i686: OK
linux-3.19-i686: OK
linux-4.0-i686: OK
linux-4.1.1-i686: OK
linux-4.2-i686: OK
linux-4.3-i686: OK
linux-2.6.32.27-x86_64: OK
linux-2.6.33.7-x86_64: OK
linux-2.6.34.7-x86_64: OK
linux-2.6.35.9-x86_64: OK
linux-2.6.36.4-x86_64: OK
linux-2.6.37.6-x86_64: OK
linux-2.6.38.8-x86_64: OK
linux-2.6.39.4-x86_64: OK
linux-3.0.60-x86_64: OK
linux-3.1.10-x86_64: OK
linux-3.2.37-x86_64: OK
linux-3.3.8-x86_64: OK
linux-3.4.27-x86_64: OK
linux-3.5.7-x86_64: OK
linux-3.6.11-x86_64: OK
linux-3.7.4-x86_64: OK
linux-3.8-x86_64: OK
linux-3.9.2-x86_64: OK
linux-3.10.1-x86_64: OK
linux-3.11.1-x86_64: OK
linux-3.12.23-x86_64: OK
linux-3.13.11-x86_64: OK
linux-3.14.9-x86_64: OK
linux-3.15.2-x86_64: OK
linux-3.16.7-x86_64: OK
linux-3.17.8-x86_64: OK
linux-3.18.7-x86_64: OK
linux-3.19-x86_64: OK
linux-4.0-x86_64: OK
linux-4.1.1-x86_64: OK
linux-4.2-x86_64: OK
linux-4.3-x86_64: ERRORS
apps: WARNINGS
spec-git: OK
sparse: ERRORS
smatch: OK

Detailed results are available here:

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

Full logs are available here:

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

The Media Infrastructure API from this daily build is here:

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


[PATCH] [media] media: videobuf2: fix compare_const_fl.cocci warnings

2015-11-13 Thread Julia Lawall
 Move constants to the right of binary operators.

Generated by: scripts/coccinelle/misc/compare_const_fl.cocci

CC: Junghak Sung 
Signed-off-by: Fengguang Wu 
Signed-off-by: Julia Lawall 
---

!b->m.planes could also be possible.  Up to you.

 videobuf2-v4l2.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/media/v4l2-core/videobuf2-v4l2.c
+++ b/drivers/media/v4l2-core/videobuf2-v4l2.c
@@ -52,7 +52,7 @@ static int __verify_planes_array(struct
return 0;

/* Is memory for copying plane information present? */
-   if (NULL == b->m.planes) {
+   if (b->m.planes == NULL) {
dprintk(1, "multi-planar buffer passed but "
   "planes array not provided\n");
return -EINVAL;
--
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] v4l2-pci-skeleton.c: forgot to update v4l2_match_dv_timings call

2015-11-13 Thread kbuild test robot
Hi Hans,

[auto build test ERROR on v4.3-rc7]
[also build test ERROR on next-20151113]

url:
https://github.com/0day-ci/linux/commits/Hans-Verkuil/v4l2-pci-skeleton-c-forgot-to-update-v4l2_match_dv_timings-call/20151113-220325
config: i386-randconfig-s0-201545 (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All errors (new ones prefixed by >>):

   Documentation/video4linux/v4l2-pci-skeleton.c: In function 
'skeleton_s_dv_timings':
>> Documentation/video4linux/v4l2-pci-skeleton.c:510:6: error: too many 
>> arguments to function 'v4l2_match_dv_timings'
 if (v4l2_match_dv_timings(timings, >timings, 0, false))
 ^
   In file included from Documentation/video4linux/v4l2-pci-skeleton.c:37:0:
   include/media/v4l2-dv-timings.h:113:6: note: declared here
bool v4l2_match_dv_timings(const struct v4l2_dv_timings *measured,
 ^

vim +/v4l2_match_dv_timings +510 Documentation/video4linux/v4l2-pci-skeleton.c

   504  /* Check if the timings are part of the CEA-861 timings. */
   505  if (!v4l2_find_dv_timings_cap(timings, _timings_cap,
   5060, NULL, NULL))
   507  return -EINVAL;
   508  
   509  /* Return 0 if the new timings are the same as the current 
timings. */
 > 510  if (v4l2_match_dv_timings(timings, >timings, 0, false))
   511  return 0;
   512  
   513  /*

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data


[GIT PULL FOR v4.5] Various fixes/enhancements

2015-11-13 Thread Hans Verkuil
Hi Mauro,

A large pile of various fixes and enhancements.

Regards,

Hans

The following changes since commit 79f5b6ae960d380c829fb67d5dadcd1d025d2775:

  [media] c8sectpfe: Remove select on CONFIG_FW_LOADER_USER_HELPER_FALLBACK 
(2015-10-20 16:02:41 -0200)

are available in the git repository at:

  git://linuxtv.org/hverkuil/media_tree.git for-v4.5a

for you to fetch changes up to 54adb10d0947478b3364640a131fff1f1ab190fa:

  v4l2-dv-timings: add new arg to v4l2_match_dv_timings (2015-11-13 14:15:55 
+0100)


Antonio Ospite (1):
  gspca: ov534/topro: prevent a division by 0

Antti Palosaari (2):
  hackrf: move RF gain ctrl enable behind module parameter
  hackrf: fix possible null ptr on debug printing

Arnd Bergmann (1):
  sh-vou: clarify videobuf2 dependency

Dan Carpenter (2):
  av7110: don't allow negative volumes
  av7110: potential divide by zero

Hans Verkuil (6):
  DocBook media: s/input stream/capture stream/
  go7007: fix broken test
  vivid: fix compliance error
  vb2: fix a regression in poll() behavior for output,streams
  adv7511: fix incorrect bit offset
  v4l2-dv-timings: add new arg to v4l2_match_dv_timings

Julia Lawall (2):
  media: videobuf2: fix compare_const_fl.cocci warnings
  radio-shark2: constify radio_tea5777_ops structures

Kosuke Tatsukawa (1):
  media: fix waitqueue_active without memory barrier in cpia2 driver

Mats Randgaard (1):
  v4l2-dv-timings: Compare horizontal blanking

Oliver Neukum (1):
  usbvision fix overflow of interfaces array

Prashant Laddha (4):
  v4l2-dv-timings: add condition checks for reduced fps
  vivid: add support for reduced fps in video out
  vivid-capture: add control for reduced frame rate
  vivid: add support for reduced frame rate in video capture

Ricardo Ribalda Delgado (7):
  v4l2-core/v4l2-ctrls: Filter NOOP CH_RANGE events
  videodev2.h: Extend struct v4l2_ext_controls
  media/core: Replace ctrl_class with which
  media/v4l2-core: struct struct v4l2_ext_controls param which
  usb/uvc: Support for V4L2_CTRL_WHICH_DEF_VAL
  media/usb/pvrusb2: Support for V4L2_CTRL_WHICH_DEF_VAL
  Docbook: media: Document changes on struct v4l2_ext_controls

Terry Heo (1):
  cx231xx: fix bulk transfer mode

Tommi Franttila (1):
  v4l2-device: Don't unregister ACPI/Device Tree based devices

Ulrich Hecht (1):
  media: adv7180: increase delay after reset to 5ms

 Documentation/DocBook/media/v4l/io.xml | 10 
 Documentation/DocBook/media/v4l/v4l2.xml   | 10 
 Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml | 28 
++---
 drivers/media/i2c/adv7180.c|  2 +-
 drivers/media/i2c/adv7511.c|  2 +-
 drivers/media/i2c/adv7604.c|  6 ++---
 drivers/media/i2c/adv7842.c|  6 ++---
 drivers/media/i2c/tc358743.c   |  4 +--
 drivers/media/pci/cobalt/cobalt-v4l2.c |  2 +-
 drivers/media/pci/ttpci/av7110_av.c|  9 +--
 drivers/media/pci/ttpci/av7110_av.h|  3 ++-
 drivers/media/platform/Kconfig |  2 +-
 drivers/media/platform/s5p-mfc/s5p_mfc_dec.c   |  2 +-
 drivers/media/platform/s5p-mfc/s5p_mfc_enc.c   |  2 +-
 drivers/media/platform/s5p-tv/hdmi_drv.c   |  2 +-
 drivers/media/platform/vivid/vivid-core.h  |  1 +
 drivers/media/platform/vivid/vivid-ctrls.c | 21 ++--
 drivers/media/platform/vivid/vivid-vid-cap.c   | 12 +++--
 drivers/media/platform/vivid/vivid-vid-out.c   | 11 ++--
 drivers/media/radio/radio-shark2.c |  2 +-
 drivers/media/radio/radio-tea5777.h|  2 +-
 drivers/media/usb/cpia2/cpia2_usb.c|  3 +--
 drivers/media/usb/cx231xx/cx231xx-core.c   | 15 ++-
 drivers/media/usb/go7007/go7007-usb.c  |  2 +-
 drivers/media/usb/gspca/ov534.c|  9 +--
 drivers/media/usb/gspca/topro.c|  6 -
 drivers/media/usb/hackrf/hackrf.c  | 13 +-
 drivers/media/usb/hdpvr/hdpvr-video.c  |  2 +-
 drivers/media/usb/pvrusb2/pvrusb2-v4l2.c   | 16 ++--
 drivers/media/usb/usbvision/usbvision-video.c  |  7 ++
 drivers/media/usb/uvc/uvc_v4l2.c   | 20 +++
 drivers/media/v4l2-core/v4l2-compat-ioctl32.c  |  6 ++---
 drivers/media/v4l2-core/v4l2-ctrls.c   | 77 
++--
 drivers/media/v4l2-core/v4l2-device.c  | 21 +++-
 drivers/media/v4l2-core/v4l2-dv-timings.c  | 16 ++--
 

[PATCH] v4l2-pci-skeleton.c: forgot to update v4l2_match_dv_timings call

2015-11-13 Thread Hans Verkuil
Add missing new argument to v4l2_match_dv_timings() in this skeleton driver.

Signed-off-by: Hans Verkuil 

diff --git a/Documentation/video4linux/v4l2-pci-skeleton.c 
b/Documentation/video4linux/v4l2-pci-skeleton.c
index 95ae828..1c8b102 100644
--- a/Documentation/video4linux/v4l2-pci-skeleton.c
+++ b/Documentation/video4linux/v4l2-pci-skeleton.c
@@ -509,7 +509,7 @@ static int skeleton_s_dv_timings(struct file *file, void 
*_fh,
return -EINVAL;
 
/* Return 0 if the new timings are the same as the current timings. */
-   if (v4l2_match_dv_timings(timings, >timings, 0))
+   if (v4l2_match_dv_timings(timings, >timings, 0, false))
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


[PATCH] drivers/media/usb/dvb-usb-v2: constify mxl111sf_demod_config structure

2015-11-13 Thread Julia Lawall
The mxl111sf_demod_config structure is never modified, so declare it
as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall 

---
 drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c |4 ++--
 drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h |4 ++--
 drivers/media/usb/dvb-usb-v2/mxl111sf.c   |2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c 
b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c
index ea37536..84f6de6 100644
--- a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c
+++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c
@@ -35,7 +35,7 @@ MODULE_PARM_DESC(debug, "set debugging level (1=info 
(or-able)).");
 struct mxl111sf_demod_state {
struct mxl111sf_state *mxl_state;
 
-   struct mxl111sf_demod_config *cfg;
+   const struct mxl111sf_demod_config *cfg;
 
struct dvb_frontend fe;
 };
@@ -579,7 +579,7 @@ static struct dvb_frontend_ops mxl111sf_demod_ops = {
 };
 
 struct dvb_frontend *mxl111sf_demod_attach(struct mxl111sf_state *mxl_state,
-  struct mxl111sf_demod_config *cfg)
+  const struct mxl111sf_demod_config *cfg)
 {
struct mxl111sf_demod_state *state = NULL;
 
diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h 
b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h
index 0bd83e5..7065aca 100644
--- a/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h
+++ b/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.h
@@ -35,11 +35,11 @@ struct mxl111sf_demod_config {
 #if IS_ENABLED(CONFIG_DVB_USB_MXL111SF)
 extern
 struct dvb_frontend *mxl111sf_demod_attach(struct mxl111sf_state *mxl_state,
-  struct mxl111sf_demod_config *cfg);
+  const struct mxl111sf_demod_config *cfg);
 #else
 static inline
 struct dvb_frontend *mxl111sf_demod_attach(struct mxl111sf_state *mxl_state,
-  struct mxl111sf_demod_config *cfg)
+  const struct mxl111sf_demod_config *cfg)
 {
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return NULL;
diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf.c 
b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
index bec12b0..c4a4a99 100644
--- a/drivers/media/usb/dvb-usb-v2/mxl111sf.c
+++ b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
@@ -731,7 +731,7 @@ fail:
return ret;
 }
 
-static struct mxl111sf_demod_config mxl_demod_config = {
+static const struct mxl111sf_demod_config mxl_demod_config = {
.read_reg= mxl111sf_read_reg,
.write_reg   = mxl111sf_write_reg,
.program_regs= mxl111sf_ctrl_program_regs,

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