Commit graph

349044 commits

Author SHA1 Message Date
Dan Carpenter cf1364b17e [media] tuners/xc5000: fix MODE_AIR in xc5000_set_params()
There is a missing break so we use XC_RF_MODE_CABLE instead of
XC_RF_MODE_AIR.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 21:01:50 -02:00
Frank Schaefer 9b4539bebb [media] em28xx: input: use common work_struct callback function for IR RC key polling
Remove em28xx_i2c_ir_work() and check the device type in the common callback
function em28xx_ir_work() instead. Simplifies em28xx_ir_start().
Reduces the code size with a minor performance drawback.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 20:43:16 -02:00
Frank Schaefer 1d968cdaae [media] em28xx: i2c RC devices: minor code size and memory usage optimization
Set up the i2c_client locally in em28xx_i2c_ir_handle_key().

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 20:42:34 -02:00
Frank Schaefer 450c7dd65b [media] em28xx: fix a comment and a small coding style issue
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 20:40:02 -02:00
Frank Schaefer 146b7ee638 [media] em28xx: remove unused parameter ir_raw from i2c RC key polling functions
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 20:39:20 -02:00
Frank Schaefer 768da3dbcf [media] em28xx: get rid of the dependency on module ir-kbd-i2c
We already have the key polling functions and the polling infrastructure in
em28xx-input, so we can easily get rid of the dependency on module ir-kbd-i2c.
For maximum safety, do not touch the key reporting mechanism for those devices.
Code size could be improved further but would have minor peformance impacts.
Tested with device "Terratec Cinergy 200 USB" (EM2800_BOARD_TERRATEC_CINERGY_200)

[mchehab@redhat.com: Fix two checkpatch.pl warnings:
 ERROR: "foo * bar" should be "foo *bar" (line 465)
 WARNING: kfree(NULL) is safe this check is probably not required (line 725)]

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 20:38:50 -02:00
Frank Schaefer 62ec3f86ff [media] em28xx: remove i2cdprintk() messages
We don't report any key/scan codes or errors inside the key polling functions
for internal IR RC devices, just in the key handling fucntions.
Do the same for external devices.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 20:38:48 -02:00
Frank Schaefer 59cf17d843 [media] em28xx-input: remove dead code line from em28xx_get_key_em_haup()
Field 'old' of struct IR_i2c is used nowhere in module ir-kbd-i2c.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 20:38:47 -02:00
Frank Schaefer 0b3966e40c [media] em28xx: add missing IR RC slave address to the list of known i2c devices
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 20:25:23 -02:00
Dan Carpenter f62436a96a [media] cx231xx: add a missing break statement
My static checker complains about the fall through here.  From the
context it looks like we should add a break statement.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 20:22:06 -02:00
Dan Carpenter f1ec57239f [media] staging: go7007: print the audio input type
Smatch complains that the "Audio input:" printk isn't reachable.  Hiding
the "return 0;" behind another statement is a style violation.
It looks like audio_input is normally configured so I've enabled the
print statement.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 20:20:36 -02:00
Nickolai Zeldovich bb71b14d80 [media] drivers/media/pci: use memmove for overlapping regions
Change several memcpy() to memmove() in cases when the regions are
definitely overlapping; memcpy() of overlapping regions is undefined
behavior in C and can produce different results depending on the compiler,
the memcpy implementation, etc.

Cc: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Nickolai Zeldovich <nickolai@csail.mit.edu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 19:26:38 -02:00
Laurent Pinchart 22331a5e0a [media] DocBook: media: struct v4l2_capability card field is a UTF-8 string
The struct v4l2_capability card field stores the device name. That name
can be hardcoded in drivers, or be retrieved directly from the device.
The later is very common with USB devices. As several devices already
report names that include non-ASCII characters, update the field
description to use UTF-8.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 19:24:03 -02:00
Nickolai Zeldovich a46edeb0f6 [media] media: cx18, ivtv: eliminate unnecessary array index checks
The idx values passed to cx18_i2c_register() and ivtv_i2c_register()
by cx18_init_subdevs() and ivtv_load_and_init_modules() respectively
are always in-range, based on how the hw_all bitmask is populated.
Previously, the checks were already ineffective because arrays were
being dereferenced using the index before the check.

Acked-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Nickolai Zeldovich <nickolai@csail.mit.edu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 19:19:44 -02:00
Nickolai Zeldovich 7e20f6bfc4 [media] drivers/media/usb/dvb-usb/dib0700_core.c: fix left shift
Fix bug introduced in 7757ddda6f, where
instead of bit-negating the bitmask, the bit position was bit-negated
instead.

Signed-off-by: Nickolai Zeldovich <nickolai@csail.mit.edu>
Cc: Olivier Grenie <olivier.grenie@dibcom.fr>
Cc: Patrick Boettcher <patrick.boettcher@dibcom.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 19:03:52 -02:00
Sean Young c6a3ea570e [media] iguanair: intermittent initialization failure
On cold boot the device does not initialize until the first packet is
received, and that packet is not processed.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 19:00:48 -02:00
Sean Young d0aab6564d [media] iguanair: ensure transmission mask is initialized
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 18:59:42 -02:00
Sean Young 6f2627c29f [media] winbond-cir: only enable higher sample resolution if needed
A sample resolution of 2us generates more than 300 interrupts per key
and this resolution is not needed unless carrier reports are enabled.
Revert to a resolution of 10us unless carrier reports are needed. This
generates up to a fifth of the interrupts.

Signed-off-by: Sean Young <sean@mess.org>
Acked-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 18:59:23 -02:00
Lad, Prabhakar 3e85a44aac [media] ARM: davinci: da850 evm: pass platform data for adv7343 encoder
Without this patch the adv7343 encoder was being set to default
configuration which caused display not to work on this board.
This patch passes the necessary platform data required for adv7343
encoder to work on da850 evm.

Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Acked-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 18:46:18 -02:00
Lad, Prabhakar 0b302d8853 [media] media: adv7343: accept configuration through platform data
The current code was implemented with some default configurations,
this default configuration works on board and doesn't work on other.
This patch accepts the configuration through platform data and configures
the encoder depending on the data passed.

Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 18:45:47 -02:00
Hans Verkuil ed57256f6f [media] tm6000: fix G/TRY_FMT
Two fixes:
- the priv field wasn't set to 0.
- only V4L2_FIELD_INTERLACED is supported.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 18:33:27 -02:00
Hans Verkuil 52dec548d4 [media] tm6000: add poll op for radio device node
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 18:32:49 -02:00
Hans Verkuil e618578dd8 [media] tm6000: set colorspace field
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 18:32:22 -02:00
Hans Verkuil 770056c47f [media] tm6000: add support for control events and prio handling
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 18:31:33 -02:00
Hans Verkuil 9f7473592b [media] tm6000: convert to the control framework
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 18:30:43 -02:00
Hans Verkuil 2c2a053626 [media] tm6000: fix querycap and input/tuner compliance issues
- add device_caps support
- fix bus_info
- fix numerous tuner-related problems due to incorrect tests
  and setting v4l2_tuner fields to wrong values.
- remove (audio) input support from the radio: it doesn't belong
  there. This also fixed a nasty issue where opening the radio
  would set dev->input to 5 for no good reason. This was never
  set back to a valid TV input after closing the radio device,
  thus leaving it at 5 which is out of bounds of the vinput
  card array.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 18:30:12 -02:00
Hans Verkuil ed986d1fee [media] meye: convert to the control framework
Convert the meye driver to the control framework. Some private controls
have been replaced with standardized controls (SHARPNESS and JPEGQUAL).
The AGC control looks like it can be replaced by the AUTOGAIN control, but
it isn't a boolean so I do not know how to interpret it.
The FRAMERATE control looks like it can be replaced by S_PARM, but again,
without knowing how to interpret it I decided to leave it alone.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 18:23:47 -02:00
Hans Verkuil cd13823f5d [media] videobuf2: don't return POLLERR when only polling for events
If you only poll for events, then vb2_poll will return POLLPRI | POLLERR if
no streaming is in progress. That's not right, it's perfectly valid to
poll just for events.

Cc: Pawel Osciak <pawel@osciak.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 18:22:15 -02:00
Hans Verkuil 971dfc6781 [media] bw-qcam: remove unnecessary qc_reset and qc_setscanmode calls
These are already done elsewhere.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 18:20:38 -02:00
Hans Verkuil 1888e4a974 [media] bw-qcam: convert to videobuf2
I know, nobody really cares about this black-and-white webcam anymore, but
it was fun to do.
Tested with an actual webcam.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 18:20:06 -02:00
Hans Verkuil 11d3793952 [media] bw-qcam: zero priv field
Fix a v4l2-compliance problem: the priv field of v4l2_pix_format must be
cleared by drivers.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 18:19:29 -02:00
Hans Verkuil 9bbc5820ff [media] radio-miropcm20: fix signal and stereo indication
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 18:17:03 -02:00
Hans Verkuil f5e7cc4af3 [media] radio-miropcm20: Fix audmode/tuner/frequency handling
- instead of a mute module option, use audmode as per the spec.
- clamp the frequency before setting it.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 18:15:33 -02:00
Hans Verkuil f7c096f735 [media] radio-miropcm20: add prio and control event support
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 18:13:27 -02:00
Hans Verkuil 7f51a61083 [media] radio-miropcm20: convert to the control framework
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 18:12:53 -02:00
Hans Verkuil 1a64b63481 [media] radio-miropcm20: remove input/audio ioctls
Such ioctls are not valid for radio devices.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 18:11:06 -02:00
Hans Verkuil f122d9a83e [media] radio-miropcm20: fix querycap
Don't set version (done by the v4l2 core), fill in bus_info, set correct
driver name and add device_caps support.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 18:10:37 -02:00
Hans Verkuil c9114031d8 [media] tvaudio: convert to the control framework
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 18:04:07 -02:00
Hans Verkuil 71df09bc67 [media] tvaudio: fix two tea6420 errors
The inputmask for the tea6420 wasn't set and the wrong mute register value
was used.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 18:03:44 -02:00
Hans Verkuil a346caacf3 [media] tvaudio: fix broken volume/balance calculations
The balance control did not do what it is supposed to do due to wrong
calculations.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 18:03:23 -02:00
Hans Verkuil ea01a83d5c [media] mt9v011: convert to the control framework
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 18:02:49 -02:00
Hans Verkuil 28718152e0 [media] Move DV-class control IDs from videodev2.h to v4l2-controls.h
When the control IDs were split off from videodev2.h to v4l2-controls.h
these new Digital Video controls were forgotten (the two patches may
have crossed one another).
Move these controls to their proper place in v4l2-controls.h.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 18:00:00 -02:00
Sylwester Nawrocki 56bc911ac3 [media] s5p-fimc: Redefine platform data structure for fimc-is
Newer Exynos4 SoC are equipped with a local camera ISP that
controls external raw image sensor directly. Such sensors
can be connected through FIMC-LITEn (and MIPI-CSISn) IPs to
the ISP, which then feeds image data to the FIMCn IP. Thus
there can be two busses associated with an image source
(sensor). Rename struct s5p_fimc_isp_info describing external
image sensor (video decoder) to struct fimc_source_info to
avoid confusion. bus_type is split into fimc_bus_type and
sensor_bus_type. The bus type enumeration is extended to
include both FIMC Writeback input types.
The bus_type enumeration and the data structure name in the
board files are modified according to the above changes.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 17:55:58 -02:00
Andrzej Hajda b84ef24e1e [media] MAINTAINERS: Add s5c73m3 driver entry
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 17:54:41 -02:00
Sachin Kamat 33fba5de1e [media] s5c73m3: Use devm_regulator_bulk_get API
devm_regulator_bulk_get saves some cleanup and exit code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 17:54:22 -02:00
Sylwester Nawrocki 0e23cbbe47 [media] s5p-fimc: Add clk_prepare/unprepare for sclk_cam clocks
Add clk_prepare(), clk_unprepare() calls for the sclk_cam clocks
to ensure the driver works on platforms with the common clocks
API enabled.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 17:54:03 -02:00
Sylwester Nawrocki 8b164105d8 [media] s5p-fimc: Fix FIMC.n subdev set_selection ioctl handler
The V4L2_SEL_TGT_CROP_BOUNDS, V4L2_SEL_TGT_COMPOSE_BOUNDS selection
targets are not supposed to be handled in the set_selection ioctl.
Remove the code that doesn't do anything sensible now and make sure
ctx->state is modified with the spinlock held.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 17:53:25 -02:00
Sylwester Nawrocki 81619ce193 [media] s5p-fimc: Set default image format at device open()
Make sure a valid image format is initially set on both the CAPTURE
and the OUTPUT buffer queue.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 17:52:41 -02:00
Sylwester Nawrocki 031f515b3d [media] s5p-fimc: Avoid null pointer dereference in fimc_capture_ctrls_create()
With presence of some faults, e.g. caused by wrong platform data or
the device tree structure the IDX_SENSOR entry in the array may be NULL,
so make sure it is not dereferenced then.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 17:51:58 -02:00
Sachin Kamat c6c03915b6 [media] s5c73m3: Staticize some symbols
Fixes the following sparse warnings:
drivers/media/i2c/s5c73m3/s5c73m3-core.c:42:5: warning:
symbol 'boot_from_rom' was not declared. Should it be static?
drivers/media/i2c/s5c73m3/s5c73m3-core.c:45:5: warning:
symbol 'update_fw' was not declared. Should it be static?
drivers/media/i2c/s5c73m3/s5c73m3-core.c:298:5: warning:
symbol 's5c73m3_isp_comm_result' was not declared. Should it be static?

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05 17:51:18 -02:00