]> Pileus Git - ~andy/linux/log
~andy/linux
10 years ago[media] davinci: vpif_capture: fix error return code in vpif_probe()
Wei Yongjun [Fri, 23 Aug 2013 02:00:01 +0000 (23:00 -0300)]
[media] davinci: vpif_capture: fix error return code in vpif_probe()

Fix to return -ENODEV in the subdevice register error handling
case instead of 0, as done elsewhere in this function.
Introduced by commit 873229e4fdf34196aa5d707957c59ba54c25eaba
([media] media: davinci: vpif: capture: add V4L2-async support)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] davinci: vpif_display: fix error return code in vpif_probe()
Wei Yongjun [Fri, 23 Aug 2013 01:59:44 +0000 (22:59 -0300)]
[media] davinci: vpif_display: fix error return code in vpif_probe()

Fix to return -ENODEV in the subdevice register error handling
case instead of 0, as done elsewhere in this function.
Introduce by commit 4b8a531e6bb0686203e9cf82a54dfe189de7d5c2.
([media] media: davinci: vpif: display: add V4L2-async support)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] MAINTAINERS: add entries for adv7511 and adv7842
Hans Verkuil [Mon, 12 Aug 2013 13:02:48 +0000 (10:02 -0300)]
[media] MAINTAINERS: add entries for adv7511 and adv7842

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] adv7511: add new video encoder
Hans Verkuil [Fri, 23 Aug 2013 12:12:36 +0000 (09:12 -0300)]
[media] adv7511: add new video encoder

This is an Analog Devices HDMI transmitter.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] adv7842: add new video decoder driver
Hans Verkuil [Thu, 22 Aug 2013 09:14:22 +0000 (06:14 -0300)]
[media] adv7842: add new video decoder driver

This is a Analog Devices Component/Graphics/SD Digitizer with 2:1
Multiplexed HDMI Receiver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] ARM: shmobile: Marzen: enable VIN and ADV7180 in defconfig
Vladimir Barinov [Thu, 22 Aug 2013 20:27:08 +0000 (17:27 -0300)]
[media] ARM: shmobile: Marzen: enable VIN and ADV7180 in defconfig

Add the VIN and ADV7180 drivers to 'marzen_defconfig'.

Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] ARM: shmobile: Marzen: add VIN and ADV7180 support
Vladimir Barinov [Thu, 22 Aug 2013 20:25:25 +0000 (17:25 -0300)]
[media] ARM: shmobile: Marzen: add VIN and ADV7180 support

Add ADV7180 platform devices on the Marzen board, configure VIN1/3 pins, and
register VIN1/3 devices with the ADV7180 specific platform data.
[Sergei: removed superfluous tabulation and inserted empty lines in the  macro
definition, updated the copyrights, annotated VIN platform data as '__initdata']

Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] ARM: shmobile: r8a7779: add VIN support
Vladimir Barinov [Thu, 22 Aug 2013 20:23:13 +0000 (17:23 -0300)]
[media] ARM: shmobile: r8a7779: add VIN support

Add VIN clocks and platform devices for R8A7779 SoC; add function to register
the VIN platform devices.
[Sergei: added 'id' parameter check to r8a7779_add_vin_device(), used '*pdata'
in *sizeof* operator there, renamed some variables, annotated vin[0-3]_resources
[] and 'vin[0-3]_info' as '__initdata'.]

Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] msi3101: Fix compilation on i386
Mauro Carvalho Chehab [Sat, 24 Aug 2013 16:35:14 +0000 (13:35 -0300)]
[media] msi3101: Fix compilation on i386

as reported by: kbuild test robot <fengguang.wu@intel.com>:
[linuxtv-media:master 459/499] sdr-msi3101.c:undefined reference to `__umoddi3'

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] vsp1: Fix a sparse warning
Mauro Carvalho Chehab [Sat, 24 Aug 2013 11:47:51 +0000 (08:47 -0300)]
[media] vsp1: Fix a sparse warning

As reported by: kbuild test robot <fengguang.wu@intel.com>:
 drivers/media/platform/vsp1/vsp1_drv.c:434:21: sparse: cast removes address space of expression

   433 vsp1->mmio = devm_ioremap_resource(&pdev->dev, io);
 > 434 if (IS_ERR((void *)vsp1->mmio))
 > 435 return PTR_ERR((void *)vsp1->mmio);

There's no need to convert it to void *.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] sound/pci/Kconfig: select RADIO_ADAPTERS if needed
Mauro Carvalho Chehab [Sat, 24 Aug 2013 11:15:03 +0000 (08:15 -0300)]
[media] sound/pci/Kconfig: select RADIO_ADAPTERS if needed

As reported by kbuild test robot <fengguang.wu@intel.com>:
warning: (SND_ES1968_RADIO && SND_FM801_TEA575X_BOOL) selects RADIO_TEA575X which has unmet direct dependencies (MEDIA_SUPPORT && RADIO_ADAPTERS && VIDEO_V4L2)

That happens because a radio driver is selected, without selecting the
RADIO_ADAPTERS menu.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] cx88: fix build when VP3054=m and CX88_DVB=y
Mauro Carvalho Chehab [Sat, 24 Aug 2013 10:52:25 +0000 (07:52 -0300)]
[media] cx88: fix build when VP3054=m and CX88_DVB=y

As reported by Jim Davis <jim.epost@gmail.com>:

randconfig build error with next-20130813, in drivers/media/pci/cx88,
when:
CONFIG_VIDEO_CX88=y
CONFIG_VIDEO_CX88_BLACKBIRD=m
CONFIG_VIDEO_CX88_DVB=y
CONFIG_VIDEO_CX88_VP3054=m
CONFIG_VIDEO_CX88_MPEG=y

  LD      init/built-in.o
drivers/built-in.o: In function `cx8802_dvb_remove':
cx88-dvb.c:(.text+0x3a9914): undefined reference to `vp3054_i2c_remove'
drivers/built-in.o: In function `cx8802_dvb_probe':
cx88-dvb.c:(.text+0x3a9c4b): undefined reference to `vp3054_i2c_probe'
make: *** [vmlinux] Error 1

That happens because the vp3054 symbols aren't available builtin.
So, make it builtin, if CX88_DVB=y, or module otherwise, if this
support is selected.

Reported-by: Jim Davis <jim.epost@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] sms: fix randconfig building error
Mauro Carvalho Chehab [Sat, 24 Aug 2013 09:54:59 +0000 (06:54 -0300)]
[media] sms: fix randconfig building error

As reported by Jim Davis <jim.epost@gmail.com>,
building with:
CONFIG_USB=m
CONFIG_SMS_USB_DRV=m
CONFIG_SMS_SDIO_DRV=y
CONFIG_SMS_SIANO_MDTV=y
CONFIG_SMS_SIANO_DEBUGFS=y

causes a build error:

drivers/built-in.o: In function `smsdvb_debugfs_register':
/home/jim/linux/drivers/media/common/siano/smsdvb-debugfs.c:537:
undefined reference to `usb_debug_root'
make: *** [vmlinux] Error 1

That happens because the siano-mdtv is builtin, while USB is a
module. As it makes not much sense to have sms-usb compiled as 'm'
and sms-sdio compiled as 'y' (or vice-versa), only allow enabling
debugfs if both are either 'y' or 'm'.

Reported-by: Jim Davis <jim.epost@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] Fix build errors on usbtv when driver is builtin
Mauro Carvalho Chehab [Sat, 24 Aug 2013 08:54:56 +0000 (05:54 -0300)]
[media] Fix build errors on usbtv when driver is builtin

As reported by Fengguang Wu <fengguang.wu@intel.com>

   drivers/built-in.o: In function `vb2_ioctl_streamon':
>> (.text+0x8d354): undefined reference to `video_devdata'
   drivers/built-in.o: In function `vb2_ioctl_streamoff':
>> (.text+0x8d397): undefined reference to `video_devdata'
   drivers/built-in.o: In function `vb2_ioctl_expbuf':
...

That happens when:
CONFIG_VIDEO_DEV=y
CONFIG_VIDEO_V4L2=m
CONFIG_VIDEO_USBTV=y

As the core is module, usbtv should also be compiled as module.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] Fixed misleading error when handling IR interrupts
Luis Alves [Thu, 11 Jul 2013 15:02:44 +0000 (12:02 -0300)]
[media] Fixed misleading error when handling IR interrupts

Hi,
Handling the AV Core/IR interrupts schedules its workqueue but
the schedule_work function returns false if @work was already on the
kernel-global workqueue and true otherwise.
Printing an error message if @work wasn't in the queue is wrong.
Regards,
Luis

Signed-off-by: Luis Alves <ljalvs@gmail.com>
Acked-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] ARM: shmobile: BOCK-W: enable VIN and ML86V7667 in defconfig
Vladimir Barinov [Thu, 22 Aug 2013 20:40:36 +0000 (17:40 -0300)]
[media] ARM: shmobile: BOCK-W: enable VIN and ML86V7667 in defconfig

Add the VIN and ML86V7667 drivers to 'bockw_defconfig'.

Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] ARM: shmobile: BOCK-W: add VIN and ML86V7667 support
Vladimir Barinov [Thu, 22 Aug 2013 20:38:50 +0000 (17:38 -0300)]
[media] ARM: shmobile: BOCK-W: add VIN and ML86V7667 support

Add ML86V7667 platform devices on BOCK-W board, configure VIN0/1 pins, and
register VIN0/1 devices with the ML86V7667 specific platform data.
[Sergei: some macro/comment cleanup; updated the copyrights, removed duplicate
'sh_eth' driver being enabled before registering VIN1 due to a pin conflict,
removed superfluous semicolon after iclink[01]_ml86v7667' initializer.]

Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] ARM: shmobile: r8a7778: add VIN support
Vladimir Barinov [Thu, 22 Aug 2013 20:36:36 +0000 (17:36 -0300)]
[media] ARM: shmobile: r8a7778: add VIN support

Add VIN clocks and platform devices on R8A7778 SoC; add function to register
the VIN platform devices.
[Sergei: added 'id' parameter check to r8a7778_add_vin_device(), used '*pdata'
in *sizeof* operator, and added an empty line there; renamed some variables,
annotated 'vin[01]_info' and vin[01]_resources[] as '__initdata'.]

Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] ov9650: off by one in ov965x_enum_frame_sizes()
Dan Carpenter [Fri, 23 Aug 2013 08:33:48 +0000 (05:33 -0300)]
[media] ov9650: off by one in ov965x_enum_frame_sizes()

The ">" should be ">=" otherwise we read one space beyond the end of the
array.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] s5k6aa: off by one in s5k6aa_enum_frame_interval()
Dan Carpenter [Fri, 23 Aug 2013 08:33:06 +0000 (05:33 -0300)]
[media] s5k6aa: off by one in s5k6aa_enum_frame_interval()

The check is off by one so we could read one space past the end of the
array.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] s3c-camif: forever loop in camif_hw_set_source_format()
Dan Carpenter [Fri, 23 Aug 2013 08:41:47 +0000 (05:41 -0300)]
[media] s3c-camif: forever loop in camif_hw_set_source_format()

Because "i" is unsigned then "i-- >= 0" is always true.  If we don't
find what we are looking for then we loop forever.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] s5p-tv: Include missing v4l2-dv-timings.h header file
Sylwester Nawrocki [Fri, 23 Aug 2013 16:26:10 +0000 (13:26 -0300)]
[media] s5p-tv: Include missing v4l2-dv-timings.h header file

Include the v4l2-dv-timings.h header file which in the s5p-tv driver which
was supposed to be updated in commit 2576415846bcbad3c0a6885fc44f95083710
"[media] v4l2: move dv-timings related code to v4l2-dv-timings.c"
This fixes following build error:
drivers/media/platform/s5p-tv/hdmi_drv.c: In function ‘hdmi_s_dv_timings’:
drivers/media/platform/s5p-tv/hdmi_drv.c:628:3: error: implicit declaration of function ‘v4l_match_dv_timings’

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] exynos4-is: Ensure the FIMC gate clock is disabled at driver remove()
Andrzej Hajda [Fri, 19 Jul 2013 10:39:53 +0000 (07:39 -0300)]
[media] exynos4-is: Ensure the FIMC gate clock is disabled at driver remove()

The patch fixes following warning:
[ 9664.460000] WARNING: CPU: 0 PID: 2880 at drivers/clk/clk.c:695 __clk_unprepare+0x8c/0xa4()
[ 9664.470000] Modules linked in: m5mols s5k5baf s5p_fimc(-) ipv6 s5p_csis v4l2_mem2mem videobuf2_dma_contig videobuf2_memops exynos4_is_common videobuf2_core [last unloaded: m5mols]
[ 9664.485000] CPU: 0 PID: 2880 Comm: rmmod Tainted: G        W    3.11.0-rc1-00070-ga94e22f-dirty #1558
[ 9664.495000] [<c0014aec>] (unwind_backtrace+0x0/0xf8) from [<c0011574>] (show_stack+0x10/0x14)
[ 9664.505000] [<c0011574>] (show_stack+0x10/0x14) from [<c038b248>] (dump_stack+0x6c/0xac)
[ 9664.510000] [<c038b248>] (dump_stack+0x6c/0xac) from [<c001d824>] (warn_slowpath_common+0x64/0x88)
[ 9664.520000] [<c001d824>] (warn_slowpath_common+0x64/0x88) from [<c001d864>] (warn_slowpath_null+0x1c/0x24)
[ 9664.530000] [<c001d864>] (warn_slowpath_null+0x1c/0x24) from [<c02f0b9c>] (__clk_unprepare+0x8c/0xa4)
[ 9664.540000] [<c02f0b9c>] (__clk_unprepare+0x8c/0xa4) from [<c02f0bc8>] (clk_unprepare+0x14/0x1c)
[ 9664.550000] [<c02f0bc8>] (clk_unprepare+0x14/0x1c) from [<bf191344>] (fimc_clk_put+0x3c/0x5c [s5p_fimc])
[ 9664.560000] [<bf191344>] (fimc_clk_put+0x3c/0x5c [s5p_fimc]) from [<bf1913c0>] (fimc_remove+0x5c/0x90 [s5p_fimc])
[ 9664.570000] [<bf1913c0>] (fimc_remove+0x5c/0x90 [s5p_fimc]) from [<c0219ca0>] (platform_drv_remove+0x18/0x1c)
[ 9664.580000] [<c0219ca0>] (platform_drv_remove+0x18/0x1c) from [<c021856c>] (__device_release_driver+0x70/0xcc)
[ 9664.590000] [<c021856c>] (__device_release_driver+0x70/0xcc) from [<c0218d54>] (driver_detach+0xac/0xb0)
[ 9664.595000] [<c0218d54>] (driver_detach+0xac/0xb0) from [<c021839c>] (bus_remove_driver+0x7c/0xc0)
[ 9664.605000] [<c021839c>] (bus_remove_driver+0x7c/0xc0) from [<c00659d8>] (SyS_delete_module+0x11c/0x204)
[ 9664.615000] [<c00659d8>] (SyS_delete_module+0x11c/0x204) from [<c000e360>] (ret_fast_syscall+0x0/0x30)
[ 9664.625000] ---[ end trace 662c092cce432c8d ]---

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] exynos4-is: Print error message on timeout
Dan Carpenter [Fri, 23 Aug 2013 08:36:56 +0000 (05:36 -0300)]
[media] exynos4-is: Print error message on timeout

There is a stray '!' character so the error message never gets printed.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] exynos4-is: Annotate unused functions
Sachin Kamat [Fri, 2 Aug 2013 05:32:13 +0000 (02:32 -0300)]
[media] exynos4-is: Annotate unused functions

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

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] exynos4-is: Simplify sclk_cam clocks handling
Sylwester Nawrocki [Fri, 19 Jul 2013 13:05:17 +0000 (10:05 -0300)]
[media] exynos4-is: Simplify sclk_cam clocks handling

Use clk_prepare_enable()/clk_disable_unprepare() instead of
separately prearing/unparing the clk_cam clocks. This simplifies
the code that is now mostly not going to be used, function
__fimc_md_set_camclk() is only left for S5PV210 platform which
is not yet converted to Device Tree.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] exynos4-is: Add missing v4l2_device_unregister() call in fimc_md_remove()
Sylwester Nawrocki [Fri, 9 Aug 2013 17:23:53 +0000 (14:23 -0300)]
[media] exynos4-is: Add missing v4l2_device_unregister() call in fimc_md_remove()

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] exynos4-is: Add missing MODULE_LICENSE for exynos-fimc-is.ko
Sylwester Nawrocki [Wed, 31 Jul 2013 14:08:19 +0000 (11:08 -0300)]
[media] exynos4-is: Add missing MODULE_LICENSE for exynos-fimc-is.ko

This fixes compilation warning:
WARNING: modpost: missing MODULE_LICENSE() in
drivers/media/platform/exynos4-is/exynos-fimc-is.o

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] exynos4-is: Initialize the ISP subdev sd->owner field
Sylwester Nawrocki [Mon, 5 Aug 2013 13:35:25 +0000 (10:35 -0300)]
[media] exynos4-is: Initialize the ISP subdev sd->owner field

Set the subdevs owner module so the exynos4_fimc_is module cannot
be unloaded when the FIMC-IS driver is in use.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] exynos4-is: Handle suspend/resume of fimc-is-i2c correctly
Tomasz Figa [Wed, 26 Jun 2013 13:37:14 +0000 (10:37 -0300)]
[media] exynos4-is: Handle suspend/resume of fimc-is-i2c correctly

If the same callbacks are used for runtime and system suspend/resume,
clocks can get disabled twice, which can lead to negative reference
counts and kernel warnings.
This patch splits suspend/resume callbacks into separate runtime and
system-wide functions, so clock gating is done correctly.

Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] gspca_ov519: Fix support for the Terratec Terracam USB Pro
Hans de Goede [Thu, 22 Aug 2013 15:41:14 +0000 (12:41 -0300)]
[media] gspca_ov519: Fix support for the Terratec Terracam USB Pro

This is a camera with an ov518+ revision 0 bridge + ov7620ae sensor,
which appearently needs different handling then the Trust spacecam 320, which
has an ov518+ revision 2 + ov7620ae sensor. The Terracam USB Pro used to write
this patch has kindly been provided by
Dr. Tilmann Bubeck <t.bubeck@reinform.de>.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] ad9389b: set is_private only after successfully creating all controls
Hans Verkuil [Thu, 22 Aug 2013 09:15:31 +0000 (06:15 -0300)]
[media] ad9389b: set is_private only after successfully creating all controls

is_private was set right after creating each control, but the control pointer
might be NULL in case of an error. Set it after all controls were successfully
created, since that guarantees that all control pointers are non-NULL.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] adv7604: set is_private only after successfully creating all controls
Hans Verkuil [Thu, 22 Aug 2013 09:11:17 +0000 (06:11 -0300)]
[media] adv7604: set is_private only after successfully creating all controls

is_private was set right after creating each control, but the control pointer
might be NULL in case of an error. Set it after all controls were successfully
created, since that guarantees that all control pointers are non-NULL.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l2-dv-timings: add callback to handle exceptions
Hans Verkuil [Mon, 19 Aug 2013 14:21:50 +0000 (11:21 -0300)]
[media] v4l2-dv-timings: add callback to handle exceptions

In most cases the v4l2_bt_timings_cap struct has all the information
necessary to determine valid timings, but occasionally there are exceptions.
Add a callback function to be able to test for those exceptions.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l2-dv-timings: rename v4l2_dv_valid_timings to v4l2_valid_dv_timings
Hans Verkuil [Mon, 19 Aug 2013 13:23:33 +0000 (10:23 -0300)]
[media] v4l2-dv-timings: rename v4l2_dv_valid_timings to v4l2_valid_dv_timings

All other functions follow the v4l2_<foo>_dv_timings pattern, do the same for
this function.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l2-dv-timings: export the timings list
Hans Verkuil [Mon, 19 Aug 2013 13:19:54 +0000 (10:19 -0300)]
[media] v4l2-dv-timings: export the timings list

Some drivers need to be able to access the full list of timings.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l2-dv-timings: fill in type field
Hans Verkuil [Mon, 19 Aug 2013 11:38:29 +0000 (08:38 -0300)]
[media] v4l2-dv-timings: fill in type field

The detect_cvt/gtf functions didn't fill in the type field.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] adv7604/ad9389b/ths8200: decrease min_pixelclock to 25MHz
Hans Verkuil [Mon, 19 Aug 2013 11:07:26 +0000 (08:07 -0300)]
[media] adv7604/ad9389b/ths8200: decrease min_pixelclock to 25MHz

The CEA-861 standard allows for the 640x480 format at 25.175 MHz.
Ensure that that's allowed according to the struct v4l2_bt_timings_cap.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l2-dv-timings: rename v4l_match_dv_timings to v4l2_match_dv_timings
Hans Verkuil [Thu, 15 Aug 2013 11:28:47 +0000 (08:28 -0300)]
[media] v4l2-dv-timings: rename v4l_match_dv_timings to v4l2_match_dv_timings

It's the only function in v4l2-dv-timings.c with the v4l prefix instead
of v4l2. Make it consistent with the other functions.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] ad9389b/adv7604/ths8200: use new v4l2_print_dv_timings helper
Hans Verkuil [Thu, 15 Aug 2013 11:05:59 +0000 (08:05 -0300)]
[media] ad9389b/adv7604/ths8200: use new v4l2_print_dv_timings helper

These three drivers all have code to log the dv_timings contents. Replace
that code with the new helper function.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l2-dv-timings: add v4l2_print_dv_timings helper
Hans Verkuil [Thu, 15 Aug 2013 11:02:40 +0000 (08:02 -0300)]
[media] v4l2-dv-timings: add v4l2_print_dv_timings helper

Drivers often have to log the contents of a dv_timings struct. Adding
this helper will make it easier for drivers to do so.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] ad9389b: change initial register configuration in ad9389b_setup()
Mats Randgaard [Wed, 14 Aug 2013 12:26:28 +0000 (09:26 -0300)]
[media] ad9389b: change initial register configuration in ad9389b_setup()

- register 0x17: CSC scaling factor was set to +/- 2.0. This register
  is set by ad9389b_csc_conversion_mode() to the right value.
- register 0x3b: bits for pixel repetition and CSC was set to zero,
  but that is the default value.

Signed-off-by: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] adv7604: corrected edid crc-calculation
Martin Bugge [Wed, 14 Aug 2013 12:25:48 +0000 (09:25 -0300)]
[media] adv7604: corrected edid crc-calculation

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Reviewed-by: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] ad9389b: trigger edid re-read by power-cycle chip
Martin Bugge [Wed, 14 Aug 2013 12:24:33 +0000 (09:24 -0300)]
[media] ad9389b: trigger edid re-read by power-cycle chip

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] ad9389b: no monitor if EDID is wrong
Mats Randgaard [Wed, 14 Aug 2013 12:23:48 +0000 (09:23 -0300)]
[media] ad9389b: no monitor if EDID is wrong

state->have_monitor is set to false if the EDID that is read from
the monitor has too many segments or wrong CRC.

Signed-off-by: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] adv7604: print flags and standards in timing information
Mats Randgaard [Wed, 14 Aug 2013 11:59:44 +0000 (08:59 -0300)]
[media] adv7604: print flags and standards in timing information

Signed-off-by: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] adv7604: improve log_status for HDMI/DVI-D signals
Mats Randgaard [Wed, 14 Aug 2013 11:56:57 +0000 (08:56 -0300)]
[media] adv7604: improve log_status for HDMI/DVI-D signals

Don't log if there is no signal.
If there is a signal, then also log HDCP and audio status.

Signed-off-by: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] adv7604: pixel-clock depends on deep-color-mode
Martin Bugge [Wed, 14 Aug 2013 11:52:46 +0000 (08:52 -0300)]
[media] adv7604: pixel-clock depends on deep-color-mode

The frequency calculation has to take deep-color mode into account.
While we're at it, also log the deep-color mode in log_status.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] adv7604: debounce "format change" notifications
Mats Randgaard [Wed, 14 Aug 2013 10:58:45 +0000 (07:58 -0300)]
[media] adv7604: debounce "format change" notifications

The bridge driver is only notified when the input status has changed
since the previous interrupt.

Signed-off-by: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l2-dv-timings: fix CVT calculation
Martin Bugge [Wed, 14 Aug 2013 07:58:38 +0000 (04:58 -0300)]
[media] v4l2-dv-timings: fix CVT calculation

This patch fixes two errors that caused incorrect format detections:
The first bug is in the calculation of the vertical backporch: the combined
period of vsync and backporch must *exceed* a certain minimum value, and not
be equal to it.
The second bug is a rounding error in the reduced blanking calculation:
expand the ideal_duty_cylce to be in parts per ten thousand to avoid
rounding errors.

Signed-off-by: Martin Bugge <marbugge@cisco.com>
Cc: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l2-dev: Fix race condition on __video_register_device
Ricardo Ribalda [Tue, 13 Aug 2013 14:04:06 +0000 (11:04 -0300)]
[media] v4l2-dev: Fix race condition on __video_register_device

When 2 devices are registered at the same time, in Part 2 both will get
the same minor number, making Part6 crash, because it cannot create a
create a device with a duplicated minor:
[    7.157648] ------------[ cut here ]------------
[    7.157666] WARNING: at fs/sysfs/dir.c:530 sysfs_add_one+0xbd/0xe0()
[    7.157669] sysfs: cannot create duplicate filename '/dev/char/81:1'
[    7.157672] Modules linked in: qtec_xform(+) qt5023_video(+) videobuf2_vmalloc videobuf2_dma_sg videobuf2_memops videobuf2_core gpio_xilinx(+) qtec_white qtec_cmosis(+) qtec_pcie qt5023
[    7.157694] CPU: 0 PID: 120 Comm: systemd-udevd Not tainted 3.10.0-qtec-standard #8
[    7.157698] Hardware name: QTechnology QT5022/QT5022, BIOS PM_2.1.0.309 X64 05/23/2013
[    7.157702]  0000000000000009 ffff8801788358e8 ffffffff8176c487 ffff880178835928
[    7.157707]  ffffffff8106f6f0 ffff880175759770 00000000ffffffef ffff880175759930
[    7.157712]  ffff8801788359e8 ffff880178bff000 ffff880175759930 ffff880178835988
[    7.157718] Call Trace:
[    7.157728]  [<ffffffff8176c487>] dump_stack+0x19/0x1b
[    7.157735]  [<ffffffff8106f6f0>] warn_slowpath_common+0x70/0xa0
[    7.157740]  [<ffffffff8106f7d6>] warn_slowpath_fmt+0x46/0x50
[    7.157746]  [<ffffffff81324b35>] ? strlcat+0x65/0x90
[    7.157750]  [<ffffffff811d516d>] sysfs_add_one+0xbd/0xe0
[    7.157755]  [<ffffffff811d5c6b>] sysfs_do_create_link_sd+0xdb/0x200
[    7.157760]  [<ffffffff811d5db1>] sysfs_create_link+0x21/0x40
[    7.157765]  [<ffffffff813e277b>] device_add+0x21b/0x6d0
[    7.157772]  [<ffffffff813f2985>] ? pm_runtime_init+0xe5/0xf0
[    7.157776]  [<ffffffff813e2c4e>] device_register+0x1e/0x30
[    7.157782]  [<ffffffff8153e8c3>] __video_register_device+0x313/0x610
[    7.157791]  [<ffffffffa00957c5>] qtec_xform_probe+0x465/0x7a4 [qtec_xform]
[    7.157797]  [<ffffffff813e7b13>] platform_drv_probe+0x43/0x80
[    7.157802]  [<ffffffff813e531a>] ? driver_sysfs_add+0x7a/0xb0
[    7.157807]  [<ffffffff813e584b>] driver_probe_device+0x8b/0x3a0
[    7.157812]  [<ffffffff813e5c0b>] __driver_attach+0xab/0xb0
[    7.157816]  [<ffffffff813e5b60>] ? driver_probe_device+0x3a0/0x3a0
[    7.157820]  [<ffffffff813e37fd>] bus_for_each_dev+0x5d/0xa0
[    7.157825]  [<ffffffff813e529e>] driver_attach+0x1e/0x20
[    7.157829]  [<ffffffff813e4d3e>] bus_add_driver+0x10e/0x280
[    7.157833]  [<ffffffffa0099000>] ? 0xffffffffa0098fff
[    7.157837]  [<ffffffffa0099000>] ? 0xffffffffa0098fff
[    7.157842]  [<ffffffff813e6317>] driver_register+0x77/0x170
[    7.157848]  [<ffffffff81151bcc>] ? __vunmap+0x9c/0x110
[    7.157852]  [<ffffffffa0099000>] ? 0xffffffffa0098fff
[    7.157857]  [<ffffffff813e7236>] platform_driver_register+0x46/0x50
[    7.157863]  [<ffffffffa0099010>] qtec_xform_plat_driver_init+0x10/0x12 [qtec_xform]
[    7.157869]  [<ffffffff810002ea>] do_one_initcall+0xea/0x1a0
[    7.157875]  [<ffffffff810cf1f1>] load_module+0x1a91/0x2630
[    7.157880]  [<ffffffff8133bee0>] ? ddebug_proc_show+0xe0/0xe0
[    7.157887]  [<ffffffff817760f2>] ? page_fault+0x22/0x30
[    7.157892]  [<ffffffff810cfe7a>] SyS_init_module+0xea/0x140
[    7.157898]  [<ffffffff8177e5b9>] tracesys+0xd0/0xd5
[    7.157902] ---[ end trace 660cc3a65a4bf01b ]---
[    7.157939] __video_register_device: device_register failed

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l2-ctrl: Suppress build warning from v4l2_ctrl_new_std_menu()
Sylwester Nawrocki [Sun, 18 Aug 2013 19:05:19 +0000 (16:05 -0300)]
[media] v4l2-ctrl: Suppress build warning from v4l2_ctrl_new_std_menu()

Prevent following build warning:
drivers/media/v4l2-core/v4l2-ctrls.c: In function v4l2_ctrl_new_std_menu:
drivers/media/v4l2-core/v4l2-ctrls.c:1768:15: warning: 'qmenu_int_len' may be used uninitialized in this function

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: Arun Kumar K <arun.kk@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] media: i2c: tvp7002: add OF support
Lad, Prabhakar [Sun, 11 Aug 2013 05:25:21 +0000 (02:25 -0300)]
[media] media: i2c: tvp7002: add OF support

add OF support for the tvp7002 driver.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] media: OF: add "sync-on-green-active" property
Lad, Prabhakar [Sun, 11 Aug 2013 05:02:24 +0000 (02:02 -0300)]
[media] media: OF: add "sync-on-green-active" property

This patch adds 'sync-on-green-active' property as part
of endpoint property.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: No need to check the return value of platform_get_resource()
Fabio Estevam [Wed, 21 Aug 2013 14:14:18 +0000 (11:14 -0300)]
[media] coda: No need to check the return value of platform_get_resource()

When using devm_ioremap_resource(), we do not need to check the return value of
platform_get_resource(), so just remove it.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: Check the return value from clk_prepare_enable()
Fabio Estevam [Wed, 21 Aug 2013 14:14:17 +0000 (11:14 -0300)]
[media] coda: Check the return value from clk_prepare_enable()

clk_prepare_enable() may fail, so let's check its return value and propagate it
in the case of error.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] coda: Fix error paths
Fabio Estevam [Wed, 21 Aug 2013 14:14:16 +0000 (11:14 -0300)]
[media] coda: Fix error paths

Some resources were not being released in the error path and some were released
in the incorrect order.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] v4l2-mem2mem: clear m2m context from job_queue before ctx streamoff
Shaik Ameer Basha [Tue, 13 Aug 2013 05:58:07 +0000 (02:58 -0300)]
[media] v4l2-mem2mem: clear m2m context from job_queue before ctx streamoff

When streamoff is called on the context and the context
is added to the job_queue,
1] sometimes device_run receives the empty vb2 buffers (as
   v4l2_m2m_streamoff is dropping the ready queue).
2] sometimes v4l2_m2m_job_finish may not succeed as the m2m_dev->curr_ctx
   is made NULL in the v4l2_m2m_streamoff()
The above points may stop the execution of the other queued contexts.
This patch makes sure that before streamoff is executed on any context,
that context should "not be running" or "not queued" in the job_queue.
1] If the current context is running, then abort job will be called.
2] If the current context is queued, then the context will be removed from
   the job_queue.

Signed-off-by: Shaik Ameer Basha <shaik.ameer@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] media/v4l2: VIDEO_SH_VEU should depend on HAS_DMA
Geert Uytterhoeven [Sun, 18 Aug 2013 11:15:37 +0000 (08:15 -0300)]
[media] media/v4l2: VIDEO_SH_VEU should depend on HAS_DMA

If NO_DMA=y:
drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_mmap’:
drivers/media/v4l2-core/videobuf2-dma-contig.c:204: error: implicit declaration of function ‘dma_mmap_coherent’
drivers/media/v4l2-core/videobuf2-dma-contig.c: In function ‘vb2_dc_get_base_sgt’:
drivers/media/v4l2-core/videobuf2-dma-contig.c:387: error: implicit declaration of function ‘dma_get_sgtable’
Commit da508f5799659241a359e2d07abb8af905f6291c ("[media] media/v4l2:
VIDEOBUF2_DMA_CONTIG should depend on HAS_DMA") added a dependency on
HAS_DMA to VIDEO_SH_VEU, as it selects VIDEOBUF2_DMA_CONTIG.
However, this got lost in the merge conflict resolution in commit
df90e2258950fd631cdbf322c1ee1f22068391aa ("Merge branch 'devel-for-v3.10'
into v4l_for_linus").
Re-add the dependency to fix this.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] cx231xx: Add support for KWorld UB445-U
Johannes Erdfelt [Sat, 17 Aug 2013 00:29:02 +0000 (21:29 -0300)]
[media] cx231xx: Add support for KWorld UB445-U

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 <johannes@erdfelt.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] media: rc: rdev->open or rdev->close can be NULL
Juergen Lock [Fri, 16 Aug 2013 18:00:24 +0000 (15:00 -0300)]
[media] media: rc: rdev->open or rdev->close can be NULL

At least technisat-usb2.c doesn't set these...

Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] marvell-ccic/mmp-driver.c: simplify use of devm_ioremap_resource
Julia Lawall [Wed, 14 Aug 2013 08:11:15 +0000 (05:11 -0300)]
[media] marvell-ccic/mmp-driver.c: simplify use of devm_ioremap_resource

Remove unneeded error handling on the result of a call to
platform_get_resource when the value is passed to devm_ioremap_resource.
A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression pdev,res,n,e,e1;
expression ret != 0;
identifier l;
@@
- res = platform_get_resource(pdev, IORESOURCE_MEM, n);
  ... when != res
- if (res == NULL) { ... \(goto l;\|return ret;\) }
  ... when != res
+ res = platform_get_resource(pdev, IORESOURCE_MEM, n);
  e = devm_ioremap_resource(e1, res);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] siano: fix divide error on 0 counters
Bjørn Mork [Wed, 14 Aug 2013 08:24:39 +0000 (05:24 -0300)]
[media] siano: fix divide error on 0 counters

GIT_AUTHOR_DATE=1376465691
I took a quick look at the code and wonder if the problem is caused by
an initial zero statistics message?  This is all just a wild guess, but
if it is correct, then the attached untested patch might fix it...
Bjørn
>From d78a0599d5b5d4da384eae08bf7da316389dfbe5 Mon Sep 17 00:00:00 2001
ts_packets and ets_packets counters can be 0.  Don't fall over
if they are. Fixes:
[  846.851711] divide error: 0000 [#1] SMP
[  846.851806] Modules linked in: smsdvb dvb_core ir_lirc_codec lirc_dev ir_sanyo_decoder ir_mce_kbd_decoder ir_sony_decoder ir_jvc_decoder ir_rc6_decoder ir_rc5_decoder ir_nec_decoder rc_hauppauge smsusb smsmdtv rc_core pci_stub vboxpci(O) vboxnetadp(O) vboxnetflt(O) vboxdrv(O) parport_pc ppdev lp parport cpufreq_userspace cpufreq_powersave cpufreq_stats cpufreq_conservative rfcomm bnep binfmt_misc uinput nfsd auth_rpcgss oid_registry nfs_acl nfs lockd dns_resolver fscache sunrpc ext4 jbd2 fuse tp_smapi(O) thinkpad_ec(O) loop firewire_sbp2 dm_crypt snd_hda_codec_conexant snd_hda_intel snd_hda_codec snd_hwdep snd_pcm_oss snd_mixer_oss snd_pcm thinkpad_acpi nvram snd_page_alloc hid_generic snd_seq_midi snd_seq_midi_event arc4 usbhid snd_rawmidi uvcvideo hid iwldvm coretemp kvm_intel mac8021
 1 cdc_wdm
[  846.853477]  cdc_acm snd_seq videobuf2_vmalloc videobuf2_memops videobuf2_core videodev media kvm radeon r852 ttm joydev cdc_ether usbnet pcmcia mii sm_common nand btusb drm_kms_helper tpm_tis acpi_cpufreq bluetooth iwlwifi nand_ecc drm nand_ids i2c_i801 mtd snd_seq_device iTCO_wdt iTCO_vendor_support r592 memstick lpc_ich mperf tpm yenta_socket pcmcia_rsrc pcmcia_core cfg80211 snd_timer snd pcspkr i2c_algo_bit crc16 i2c_core tpm_bios processor mfd_core wmi psmouse mei_me rfkill mei serio_raw soundcore evdev battery button video ac microcode ext3 mbcache jbd md_mod dm_mirror dm_region_hash dm_log dm_mod sg sr_mod sd_mod cdrom crc_t10dif firewire_ohci sdhci_pci sdhci mmc_core firewire_core crc_itu_t thermal thermal_sys ahci libahci ehci_pci uhci_hcd ehci_hcd libata scsi_mod usbcore e1000
 e usb_common
[  846.855310]  ptp pps_core
[  846.855356] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G           O 3.10-2-amd64 #1 Debian 3.10.5-1
[  846.855490] Hardware name: LENOVO 4061WFA/4061WFA, BIOS 6FET92WW (3.22 ) 12/14/2011
[  846.855609] task: ffffffff81613400 ti: ffffffff81600000 task.ti: ffffffff81600000
[  846.855636] RIP: 0010:[<ffffffffa092be0c>]  [<ffffffffa092be0c>] smsdvb_onresponse+0x264/0xa86 [smsdvb]
[  846.863906] RSP: 0018:ffff88013bc03cf0  EFLAGS: 00010046
[  846.863906] RAX: 0000000000000000 RBX: ffff880133bf6000 RCX: 0000000000000000
[  846.863906] RDX: 0000000000000000 RSI: ffff88005d3b58c0 RDI: ffff880133bf6000
[  846.863906] RBP: ffff88005d1da000 R08: 0000000000000058 R09: 0000000000000015
[  846.863906] R10: 0000000000001a0d R11: 000000000000021a R12: ffff88005d3b58c0
[  846.863906] R13: ffff88005d1da008 R14: 00000000ffffff8d R15: ffff880036cf5060
[  846.863906] FS:  0000000000000000(0000) GS:ffff88013bc00000(0000) knlGS:0000000000000000
[  846.863906] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[  846.863906] CR2: 00007f3a4b69ae50 CR3: 0000000036dac000 CR4: 00000000000407f0
[  846.863906] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  846.863906] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[  846.863906] Stack:
[  846.863906]  ffff88007a102000 ffff88005d1da000 ffff88005d3b58c0 0000000000085824
[  846.863906]  ffffffffa08c5aa3 ffff88005d1da000 ffff8800a6907390 ffff8800a69073b0
[  846.863906]  ffff8800a6907000 ffffffffa08b642c 000000000000021a ffff8800a69073b0
[  846.863906] Call Trace:
[  846.863906]  <IRQ>
[  846.863906]
[  846.863906]  [<ffffffffa08c5aa3>] ? smscore_onresponse+0x1d5/0x353 [smsmdtv]
[  846.863906]  [<ffffffffa08b642c>] ? smsusb_onresponse+0x146/0x192 [smsusb]
[  846.863906]  [<ffffffffa004cb1a>] ? usb_hcd_giveback_urb+0x6c/0xac [usbcore]
[  846.863906]  [<ffffffffa0217be1>] ? ehci_urb_done+0x62/0x72 [ehci_hcd]
[  846.863906]  [<ffffffffa0217c82>] ? qh_completions+0x91/0x364 [ehci_hcd]
[  846.863906]  [<ffffffffa0219bba>] ? ehci_work+0x8a/0x68e [ehci_hcd]
[  846.863906]  [<ffffffff8107336c>] ? timekeeping_get_ns.constprop.10+0xd/0x31
[  846.863906]  [<ffffffff81064d41>] ? update_cfs_rq_blocked_load+0xde/0xec
[  846.863906]  [<ffffffff81058ec2>] ? run_posix_cpu_timers+0x25/0x575
[  846.863906]  [<ffffffffa021aa46>] ? ehci_irq+0x211/0x23d [ehci_hcd]
[  846.863906]  [<ffffffffa004c0c1>] ? usb_hcd_irq+0x31/0x48 [usbcore]
[  846.863906]  [<ffffffff810996fd>] ? handle_irq_event_percpu+0x49/0x1a4
[  846.863906]  [<ffffffff8109988a>] ? handle_irq_event+0x32/0x4b
[  846.863906]  [<ffffffff8109bd76>] ? handle_fasteoi_irq+0x80/0xb6
[  846.863906]  [<ffffffff8100e93e>] ? handle_irq+0x18/0x20
[  846.863906]  [<ffffffff8100e657>] ? do_IRQ+0x40/0x95
[  846.863906]  [<ffffffff813883ed>] ? common_interrupt+0x6d/0x6d
[  846.863906]  <EOI>
[  846.863906]
[  846.863906]  [<ffffffff812a011c>] ? arch_local_irq_enable+0x4/0x8
[  846.863906]  [<ffffffff812a04f3>] ? cpuidle_enter_state+0x52/0xc1
[  846.863906]  [<ffffffff812a0636>] ? cpuidle_idle_call+0xd4/0x143
[  846.863906]  [<ffffffff8101398c>] ? arch_cpu_idle+0x5/0x17
[  846.863906]  [<ffffffff81072571>] ? cpu_startup_entry+0x10d/0x187
[  846.863906]  [<ffffffff816b3d3d>] ? start_kernel+0x3e8/0x3f3
[  846.863906]  [<ffffffff816b3777>] ? repair_env_string+0x54/0x54
[  846.863906]  [<ffffffff816b3598>] ? x86_64_start_kernel+0xf2/0xfd
[  846.863906] Code: 25 09 00 00 c6 83 da 08 00 00 03 8b 45 54 48 01 83 b6 08 00 00 8b 45 50 48 01 83 db 08 00 00 8b 4d 18 69 c1 ff ff 00 00 03 4d 14 <48> f7 f1 89 83 a8 09 00 00 e9 68 fe ff ff 48 8b 7f 10 e8 79 92
[  846.863906] RIP  [<ffffffffa092be0c>] smsdvb_onresponse+0x264/0xa86 [smsdvb]
[  846.863906]  RSP <ffff88013bc03cf0>
Reference: http://bugs.debian.org/719623

Reported-by: Johannes Rohr <jorohr@gmail.com>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] cx23885: Add DTV support for Mygica X8502/X8507 boards
Mauro Carvalho Chehab [Fri, 9 Aug 2013 11:53:27 +0000 (08:53 -0300)]
[media] cx23885: Add DTV support for Mygica X8502/X8507 boards

Those boards were missing the ISDB-T support.
Most of the work on this patch were done by Alfredo.
My work here were to port this patch from Kernel 3.2 to upstream,
fix the issue caused by the set_frontend bad hook, and add the
Kconfig bits.
Tested on a X8502 board rebranded as:
"Leadership - Placa PCI-e de Captura de Vídeo Híbrida" - product code 3800.

Thanks-to: Alfredo Delaiti <alfredodelaiti@netscape.net>
Tested-by: Alfredo Delaiti <alfredodelaiti@netscape.net>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] mb86a20s: Fix TS parallel mode
Mauro Carvalho Chehab [Fri, 9 Aug 2013 11:53:26 +0000 (08:53 -0300)]
[media] mb86a20s: Fix TS parallel mode

changeset 768e6dadd74 caused a regression on using mb86a20s
in parallel mode, as the parallel mode selection got
overriden by mb86a20s_init2.

Cc: stable@vger.kernel.org
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] cx23885-dvb: use a better approach to hook set_frontend
Mauro Carvalho Chehab [Fri, 9 Aug 2013 11:53:25 +0000 (08:53 -0300)]
[media] cx23885-dvb: use a better approach to hook set_frontend

When the frontend drivers got converted to DVBv5 API, the original
hook that tracked when a frontend is set got removed, being replaced
by an approach that would use the gate control. That doesn't work
fine with some boards. Also, the code were called more times than
desired.
Replace it by a logic that will hook the dvb set_frontend ops,
with works with both DVBv3 and DVBv5 calls.
Tested on a Mygica X8502 OEM board.

Tested-by: Alfredo Delaiti <alfredodelaiti@netscape.net>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] MAINTAINERS: Add entry for the Aptina PLL library
Laurent Pinchart [Fri, 9 Aug 2013 11:46:11 +0000 (08:46 -0300)]
[media] MAINTAINERS: Add entry for the Aptina PLL library

Add a maintainers entry for the Aptina PLL library, and rename the
Aptina sensors entries to make it clear they refer to Aptina camera
sensors.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] media: vb2: Share code between vb2_prepare_buf and vb2_qbuf
Laurent Pinchart [Fri, 9 Aug 2013 11:11:26 +0000 (08:11 -0300)]
[media] media: vb2: Share code between vb2_prepare_buf and vb2_qbuf

The two operations are very similar, refactor most of the code in a
helper function.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] media: vb2: Fix potential deadlock in vb2_prepare_buffer
Laurent Pinchart [Fri, 9 Aug 2013 11:11:25 +0000 (08:11 -0300)]
[media] media: vb2: Fix potential deadlock in vb2_prepare_buffer

Commit b037c0fde22b1d3cd0b3c3717d28e54619fc1592 ("media: vb2: fix
potential deadlock in mmap vs. get_userptr handling") fixes an AB-BA
deadlock related to the mmap_sem and driver locks. The same deadlock can
occur in vb2_prepare_buffer(), fix it the same way.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] winbond: wire up rc feedback led
Sean Young [Tue, 30 Jul 2013 22:00:03 +0000 (19:00 -0300)]
[media] winbond: wire up rc feedback led

Note that with the rc-feedback trigger, the cir-rx trigger is now
redundant. The cir-tx trigger is not used by default; if this
functionality is desired then it should exist in rc-core, not in
a driver.
Also make sure that the led is suspended on suspend.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] ttusbir: wire up rc feedback led
Sean Young [Tue, 30 Jul 2013 22:00:02 +0000 (19:00 -0300)]
[media] ttusbir: wire up rc feedback led

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] redrat3: wire up rc feedback led
Sean Young [Tue, 30 Jul 2013 22:00:04 +0000 (19:00 -0300)]
[media] redrat3: wire up rc feedback led

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] rc: add feedback led trigger for rc keypresses
Sean Young [Tue, 30 Jul 2013 22:00:01 +0000 (19:00 -0300)]
[media] rc: add feedback led trigger for rc keypresses

Many devices with an ir receiver also have a feedback led. Add the
led trigger to support this.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] redrat3: ensure whole packet is read
Sean Young [Tue, 30 Jul 2013 22:00:00 +0000 (19:00 -0300)]
[media] redrat3: ensure whole packet is read

The length in the header excludes the header itself, so we're getting
spurious readings.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] smiapp: Call the clock "ext_clk"
Sakari Ailus [Sat, 10 Aug 2013 17:49:48 +0000 (14:49 -0300)]
[media] smiapp: Call the clock "ext_clk"

As the clock framework makes it possible to assign a device specific name to
the clocks, remove the ability to use a named clock in the driver.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] smiapp: Prepare and unprepare clocks correctly
Sakari Ailus [Sat, 10 Aug 2013 17:49:47 +0000 (14:49 -0300)]
[media] smiapp: Prepare and unprepare clocks correctly

Prepare clocks before enabling and unprepare after disabling them.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] smiapp-pll: Add a few comments to PLL calculation
Sakari Ailus [Sat, 10 Aug 2013 17:49:46 +0000 (14:49 -0300)]
[media] smiapp-pll: Add a few comments to PLL calculation

The PLL calculation heuristics is rather complicated and and is often
difficult to understand to its original author.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] smiapp: re-use clamp_t instead of min(..., max(...))
Andy Shevchenko [Sat, 10 Aug 2013 17:49:45 +0000 (14:49 -0300)]
[media] smiapp: re-use clamp_t instead of min(..., max(...))

clamp_t does the job to put a variable into the given range.
clamp_t -> clamp as agreed with Andy.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] mt9v032: Use the common clock framework
Laurent Pinchart [Fri, 5 Jul 2013 10:16:02 +0000 (07:16 -0300)]
[media] mt9v032: Use the common clock framework

Configure the device external clock using the common clock framework
instead of a board code callback function.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] introduce gspca-stk1135: Syntek STK1135 driver
Ondrej Zary [Tue, 20 Aug 2013 13:03:59 +0000 (10:03 -0300)]
[media] introduce gspca-stk1135: Syntek STK1135 driver

Hello,
this is a new gspca driver for Syntek STK1135 webcams. The code is completely
new, but register values are based on Syntekdriver (stk11xx) by Nicolas VIVIEN
(http://syntekdriver.sourceforge.net).
Only one webcam type is supported now - vendor 0x174f, device 0x6a31.
It's Asus F5RL laptop flippable webcam with MT9M112.
The camera works better than in Windows - initializes much faster and
provides more resolutions (the sensor can do almost any resolution - just
add it to the stk1135_modes[] - could this feature be somehow used by
applications to avoid SW scaling?).
Autoflip works too - when the camera is flipped around, the image is flipped
automatically.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] gspca-ov534: don't call sd_start() from sd_init()
Antonio Ospite [Thu, 15 Aug 2013 10:29:32 +0000 (07:29 -0300)]
[media] gspca-ov534: don't call sd_start() from sd_init()

sd_start() operates on device controls but after the conversion to the
v4l2 control framework in commits 62bba5d and 1bd7d6a controls are
initialized in sd_init_controls() which is called _after_ sd_init():
The change fixes a NULL pointer dereference for Hercules Blog Webcam;
the problem is observable since 3.6:
  gspca_main: v2.14.0 registered
  gspca_main: ov534-2.14.0 probing 06f8:3002
  BUG: unable to handle kernel NULL pointer dereference at 0000000000000050
  IP: [<ffffffffa03c1b01>] v4l2_ctrl_g_ctrl+0x11/0x60 [videodev]
  PGD 0
  Oops: 0000 [#1] SMP
  Modules linked in: gspca_ov534(+) gspca_main videodev rfcomm bnep ppdev bluetooth binfmt_misc snd_hda_codec_hdmi snd_hda_codec_realtek stir4200 irda crc_ccitt usblp snd_hda_intel snd_hda_codec snd_hwdep snd_pcm hid_generic snd_page_alloc snd_seq_midi snd_seq_midi_event usbhid snd_rawmidi snd_seq snd_seq_device snd_timer hid i915 snd psmouse drm_kms_helper serio_raw mei_me drm mei soundcore video i2c_algo_bit lpc_ich mac_hid coretemp lp parport firewire_ohci firewire_core crc_itu_t ahci libahci alx mdio r8169 mii [last unloaded: parport_pc]
  CPU: 3 PID: 4352 Comm: modprobe Not tainted 3.11.0-031100rc2-generic #201307211535
  Hardware name: Gigabyte Technology Co., Ltd. To be filled by O.E.M./Z77-DS3H, BIOS F9 09/19/2012
  task: ffff8801c20f9770 ti: ffff8801ceaa0000 task.ti: ffff8801ceaa0000
  RIP: 0010:[<ffffffffa03c1b01>]  [<ffffffffa03c1b01>] v4l2_ctrl_g_ctrl+0x11/0x60 [videodev]
  RSP: 0018:ffff8801ceaa1af8  EFLAGS: 00010292
  RAX: 0000000000000001 RBX: 0000000000000000 RCX: 000000000001988b
  RDX: 000000000001988a RSI: ffffffffa032745a RDI: 0000000000000000
  RBP: ffff8801ceaa1b28 R08: 0000000000017380 R09: ffffea0008419d80
  R10: ffffffff81538f5a R11: 0000000000000002 R12: ffffffffa03273dc
  R13: ffffffffa03273dc R14: 0000000000000000 R15: ffffffffa03270a0
  FS:  00007f72d564a740(0000) GS:ffff88021f380000(0000) knlGS:0000000000000000
  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  CR2: 0000000000000050 CR3: 00000001bd1f0000 CR4: 00000000001407e0
  Stack:
   ffff8801ceaa1b28 ffffffffa0325cff ffff8801000001f4 ffff8801ceb44000
   ffffffffa03273dc ffff8801ceb44000 ffff8801ceaa1b58 ffffffffa032688e
   ffff8801ceb44000 ffffffffa03274f0 ffffffffa03274f0 ffff8801ceb44380
  Call Trace:
   [<ffffffffa0325cff>] ? sccb_w_array+0x3f/0x80 [gspca_ov534]
   [<ffffffffa032688e>] sd_start+0xce/0x2b0 [gspca_ov534]
   [<ffffffffa0326bf9>] sd_init+0x189/0x1e8 [gspca_ov534]
   [<ffffffffa02a0c95>] gspca_dev_probe2+0x285/0x410 [gspca_main]
   [<ffffffffa02a0e58>] gspca_dev_probe+0x38/0x60 [gspca_main]
   [<ffffffffa0325081>] sd_probe+0x21/0x30 [gspca_ov534]
   [<ffffffff8153c960>] usb_probe_interface+0x1c0/0x2f0
   [<ffffffff8148758c>] really_probe+0x6c/0x330
   [<ffffffff814879d7>] driver_probe_device+0x47/0xa0
   [<ffffffff81487adb>] __driver_attach+0xab/0xb0
   [<ffffffff81487a30>] ? driver_probe_device+0xa0/0xa0
   [<ffffffff814857be>] bus_for_each_dev+0x5e/0x90
   [<ffffffff8148714e>] driver_attach+0x1e/0x20
   [<ffffffff81486bdc>] bus_add_driver+0x10c/0x290
   [<ffffffff8148805d>] driver_register+0x7d/0x160
   [<ffffffff8153b590>] usb_register_driver+0xa0/0x160
   [<ffffffffa0067000>] ? 0xffffffffa0066fff
   [<ffffffffa006701e>] sd_driver_init+0x1e/0x1000 [gspca_ov534]
   [<ffffffff8100212a>] do_one_initcall+0xfa/0x1b0
   [<ffffffff810578c3>] ? set_memory_nx+0x43/0x50
   [<ffffffff81712e8d>] do_init_module+0x80/0x1d1
   [<ffffffff810d2079>] load_module+0x4c9/0x5f0
   [<ffffffff810cf7b0>] ? add_kallsyms+0x210/0x210
   [<ffffffff810d2254>] SyS_init_module+0xb4/0x100
   [<ffffffff817333ef>] tracesys+0xe1/0xe6
  Code: a0 09 00 00 48 c7 c7 30 c3 3c a0 e8 7a 38 ca e0 eb cf 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 55 48 89 e5 53 48 89 fb 48 83 ec 28 <8b> 47 50 83 e8 05 83 f8 02 77 09 80 b8 20 8c 3c a0 00 74 1d 48
  RIP  [<ffffffffa03c1b01>] v4l2_ctrl_g_ctrl+0x11/0x60 [videodev]
   RSP <ffff8801ceaa1af8>
  CR2: 0000000000000050
  ---[ end trace 6786f15abfd2ac90 ]---
Original bug report from:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1173723/

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Tested-by: Yaroslav Zakharuk <slavikz@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] gspca: fix dev_open() error path
Alexey Khoroshilov [Mon, 5 Aug 2013 20:16:37 +0000 (17:16 -0300)]
[media] gspca: fix dev_open() error path

If v4l2_fh_open() fails in dev_open(), gspca_dev->module left locked.
The patch adds module_put(gspca_dev->module) on this path.
Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] radio-si470x-usb: Remove software version check
Hans de Goede [Tue, 20 Aug 2013 12:18:24 +0000 (09:18 -0300)]
[media] radio-si470x-usb: Remove software version check

We've an user reporting a device with a software version of 0, which works
fine. Once we lower the version check to accept version 0 it becomes a nop,
so remove it completely.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] msi3101: few improvements for RF tuner
Antti Palosaari [Sat, 17 Aug 2013 22:30:18 +0000 (19:30 -0300)]
[media] msi3101: few improvements for RF tuner

* Fix AM_MODE. Now it could work at least in theory, cannot test.
* Use greatest common divisor algo to divide PLL fractional parts.
* Fix IF frequency mode.
* + some very minor "style" issues

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] msi3101: change stream format 384
Antti Palosaari [Sun, 11 Aug 2013 22:07:02 +0000 (19:07 -0300)]
[media] msi3101: change stream format 384

After feeding different signal levels using RF generator and looking
GNU Radio FFT sink I made decision to change bit shift 3 to bit shift
2 as there was very (too) huge visible leap in FFT sink GUI. Now it
looks more natural.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] msi3101: implement stream format 504
Antti Palosaari [Thu, 8 Aug 2013 18:39:33 +0000 (15:39 -0300)]
[media] msi3101: implement stream format 504

That stream format carries 504 x I+Q samples per 1024 USB frame.
Sample resolution is 8-bit signed. Default it when sampling rate
is 9Msps or over.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] msi3101: a lot of small cleanups
Antti Palosaari [Wed, 7 Aug 2013 18:06:29 +0000 (15:06 -0300)]
[media] msi3101: a lot of small cleanups

Add comments, remove useless code and so. House cleaning party.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] msi3101: changes for tuner PLL freq limits
Antti Palosaari [Wed, 7 Aug 2013 16:20:29 +0000 (13:20 -0300)]
[media] msi3101: changes for tuner PLL freq limits

I made some tuner freq limit tests against RF signal generator.
Adjust some PLL limits according to these test results.
Here are the results, taken from two different devices.
Ranges are measured RF limits + calculated VCO limits.
Mirics MSi3101 SDR Dongle:
VHF_MODE  52 - 132  1664 - 4224
B3_MODE  103 - 263  1648 - 4208
B45_MODE 413 - 960  1652 - 3840
Hauppauge WinTV 133559 LF:
VHF_MODE  49 - 130  1568 - 4160
B3_MODE   98 - 259  1568 - 4144
B45_MODE 391 - 960  1564 - 3840

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] msi3101: add stream format 336 I+Q pairs per frame
Antti Palosaari [Wed, 7 Aug 2013 14:27:21 +0000 (11:27 -0300)]
[media] msi3101: add stream format 336 I+Q pairs per frame

That one seem to have 12-bit resolution. Use it for streams that
has sampling rate 6 <= rate (Msps) < 8, between 6 and 8Msps.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] msi3101: fix overflow in freq setting
Antti Palosaari [Wed, 7 Aug 2013 03:02:40 +0000 (00:02 -0300)]
[media] msi3101: fix overflow in freq setting

Higher frequencies were not possible to set correctly as that value
overflows.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] msi3101: init bits 23:20 on PLL register
Antti Palosaari [Tue, 6 Aug 2013 00:33:31 +0000 (21:33 -0300)]
[media] msi3101: init bits 23:20 on PLL register

It is not sure what is meaning of that number, but it is better
to try do as Windows driver. It seems to have small effect for
signal when looking FM FFT.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] msi3101: add support for stream format "252" I+Q per frame
Antti Palosaari [Mon, 5 Aug 2013 23:43:36 +0000 (20:43 -0300)]
[media] msi3101: add support for stream format "252" I+Q per frame

That one seems to have 14-bit ADC resolution, wow!
It is now used when sampling rate is below 6 Msps.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] msi3101: improve tuner synth calc step size
Antti Palosaari [Sat, 3 Aug 2013 00:49:49 +0000 (21:49 -0300)]
[media] msi3101: improve tuner synth calc step size

Allow stepless synthesizer configuration. With that change we lose
precision a little bit, as it is now between +-500Hz from the target.
It could be better but on that case calculation algorithm goes more
complex and atm there is more important things to do.
Two approach to improve which comes to my mind are:
1) select and use biggest suitable step
2) use greatest common divisor algo to find divisor for thresh & frac
when possible to avoid rounding errors, which is root of cause of
current +-500Hz inaccuracy.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] msi3101: correct ADC sampling rate calc a little bit
Antti Palosaari [Thu, 1 Aug 2013 00:48:51 +0000 (21:48 -0300)]
[media] msi3101: correct ADC sampling rate calc a little bit

No need to compare numbers, we could just store that fractional
value MSB directly.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] msi3101: add debug dump for unknown stream data
Antti Palosaari [Wed, 31 Jul 2013 22:58:12 +0000 (19:58 -0300)]
[media] msi3101: add debug dump for unknown stream data

Dump all unknown 'garbage' data - maybe we will discover someday if there
is something rational...
Also fix comment in USB frame description.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] msi3101: add 2040:d300 Hauppauge WinTV 133559 LF
Antti Palosaari [Wed, 17 Jul 2013 18:05:27 +0000 (15:05 -0300)]
[media] msi3101: add 2040:d300 Hauppauge WinTV 133559 LF

It is based Mirics MSi3101 reference design and will just work
without any changes.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] msi3101: fix stream re-start halt
Antti Palosaari [Thu, 11 Jul 2013 15:19:32 +0000 (12:19 -0300)]
[media] msi3101: fix stream re-start halt

Restarting stream fails quite often. Small delay is between urb killing
and stream stop command - likely to give harware some time to process
killed urbs.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] msi3101: enhance sampling results
Antti Palosaari [Thu, 11 Jul 2013 00:59:58 +0000 (21:59 -0300)]
[media] msi3101: enhance sampling results

It looks like there is some extra data carried to enhance sampling
results. When you tune to some some weak/empty channel those bits
are always zeroes. When you tune to some channel where is very
strong signals those bits are all zeroes.
Examining those 32-bits reveals shortly there is 16 pieces of 2-bit
numbers. Number seen are 0, 1 and 3 - for some reason 2 is not used.
I used that number to shift bits given amount to left, "increasing"
sampling resolution by 3-bits. It may be wrong, but after some testing
it still provides better signal.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] msi3101: add sampling mode control
Antti Palosaari [Tue, 9 Jul 2013 19:19:15 +0000 (16:19 -0300)]
[media] msi3101: add sampling mode control

Whilst Quadrature Sampling is most common sampling technique used in
radio technology there is others too. Add control user could select
sampling mode. We currently support only quadrature sampling.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
10 years ago[media] msi3101: fix sampling rate calculation
Antti Palosaari [Tue, 9 Jul 2013 05:44:56 +0000 (02:44 -0300)]
[media] msi3101: fix sampling rate calculation

These calculations seem to give 100% correct results. Calculation
formulas could be still a little bit wrong as I have no knowledge
what kind of dividers, multipliers and VCO limits there really is.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>