1
0
Fork 0
Commit Graph

16570 Commits (f9eb7bf424e766e00bbc6d69fd7eaaf4bd003cf9)

Author SHA1 Message Date
Frank Schaefer 52f1f2303f [media] em28xx: add comment about Samsung and Kodak sensor probing addresses
The Windows driver also probes at least two further i2c addresses (0x22 >> 1
and 0x66 >> 1). I've got some hints that they are very likely used by Samsung
and Kodak sensors, which are known to be used in Empia devices, too.
We havn't seen any devices using these sensors yet and don't know how to probe
them properly, so leave a comment.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-29 06:40:47 -03:00
Frank Schaefer bde0368432 [media] em28xx: add probing procedure for OmniVision sensors
OmniVision sensors are used as well in Empiatech based cameras such as the
"SpeedLink Vicious And Devine Laplace" webcam (EM2765 + Omnivision OV2640).
With this patch applied, OminiVision sensors with 8 bit address and register
width are detected (recent models have a 16 bit address width and use different
client addresses).
The most commonly used sensors (including the ones listed by Empiatech) are
detected properly, although there is no support for them yet.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-29 06:40:10 -03:00
Frank Schaefer 0af0b25a64 [media] em28xx: move the probing of Micron sensors to a separate function
Other sensors like the ones from OmniVision need a different probing procedure,
so it makes sense have separate functions for each manufacturer/sensor type.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-29 06:39:06 -03:00
Frank Schaefer 176013b19e [media] em28xx: detect further Micron sensors
Add further Micron chip IDs to be able to identify all Micron sensors listed
by Empiatech.
Also probe the two alternate i2c addresses used by Micron sensors with 8 bit
address and 16 bit register width.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-29 06:38:08 -03:00
Frank Schaefer 855ff38e88 [media] em28xx: move sensor code to a separate source code file em28xx-camera.c
em28xx-cards.c is very large and the sensor/camera related code is growing,
so move this code to a separate source code file em28xx-camera.c.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-29 06:36:20 -03:00
Frank Schaefer b3944c8f67 [media] em28xx: rename em28xx_hint_sensor() to em28xx_detect_sensor()
Now that the board hints and the sensor initialization/configuration have been
separated, em28xx_detect_sensor() is the better name for this function.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-29 06:34:25 -03:00
Frank Schaefer 484fbbeb3e [media] em28xx: separate sensor detection and initialization/configuration
Sensor detection and initialization/configuration are currently mixed together.
This works as long as all devices with a particular sensor are working with the
same board configuration. In the long run, this will be not sufficient, so
separate these both steps to make the code more flexible and future proof.
This also makes the code more consistent, because the initialization of the
MT9V011 sensor subdevice is already separated.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-29 06:34:01 -03:00
Frank Schaefer 2d466e1136 [media] em28xx: fix and separate the board hints for sensor devices
The current board hint code is mixed together with the sensor detection and
initialization code. It actually selects a board depending on the detected
sensor type only, with the result that 3 of the 6 webcam boards are currently
dead.
Separate it and move it to em28xx_hint_board() which already contains the board
hints for analog capturing+TV and DVB devices.
This way, we have all board hints at a common place which makes it easier
to extend the code and reduces the risk of regressions.
It also makes it possible again to use the boards EM2750_BOARD_DLCW_130,
EM2820_BOARD_VIDEOLOGY_20K14XUSB and EM2860_BOARD_NETGMBH_CAM (using the module
parameter "card").
NOTE: the current board hint logic for webcams is preserved. Not more not less.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-29 06:31:38 -03:00
Frank Schaefer 72cc9ba39a [media] em28xx: ignore isoc DVB USB endpoints with wMaxPacketSize = 0 bytes for all alt settings
Some devices without DVB support (such as the "Terratec Grabby" and
"Easycap DC-60") provide isochronous DVB USB endpoints with wMaxPacketSize set
to 0 bytes for all alt settings.
Ignore these endpoints and avoid registering a DVB device node and loading the
DVB driver extension.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Tested-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-28 18:39:44 -03:00
Laurent Pinchart b418697115 [media] uvcvideo: Return -EINVAL when setting a menu control to an invalid value
-ERANGE is the right error code when the value is outside of the menu
range, but -EINVAL must be reported for invalid values inside the range.

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-03-28 18:37:11 -03:00
Frank Schaefer 1e2e9086c7 [media] em28xx: write output frame resolution to regs 0x34+0x35 for em25xx family bridges
The Windows driver writes the output resolution to registers 0x34 (width / 16)
and 0x35 (height / 16) always.
We don't know yet what these registers are used for.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-28 17:54:44 -03:00
Frank Schaefer c8c39796c4 [media] em28xx: make em28xx_set_outfmt() working with EM25xx family bridges
Streaming doesn't work with the EM2765 if bit 5 of the output format register
0x27 is set.
It's actually not clear if really has to be set for the other chips, but for
now let's keep it to avoid regressions and add a comment to the code.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-28 17:49:49 -03:00
Frank Schaefer e507e0e513 [media] em28xx: add support for em25xx/em276x/em277x/em278x frame data processing
The em25xx/em276x/em277x/em278x frame data format is different to the one used
by the em2710/em2750/em28xx chips.
With the recent cleanups and reorganization of the frame data processing code it
can be easily extended to support these devices.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-28 17:47:57 -03:00
Frank Schaefer 736a320bd2 [media] em28xx: add chip id of the em2765
This chip can be found in the SpeedLink VAD Laplace webcam (1ae7:9003 and 1ae7:9004).

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-28 17:43:45 -03:00
Frank Schaefer a3ea4bf98b [media] em28xx: add support for em25xx i2c bus B read/write/check device operations
The webcam "SpeedLink VAD Laplace" (em2765 + ov2640) uses a special algorithm
for i2c communication with the sensor, which is connected to a second i2c bus.
We don't know yet how to find out which devices support/use it.
It's very likely used by all em25xx and em276x+ bridges.
Tests with other em28xx chips (em2820, em2882/em2883) show, that this
algorithm always succeeds there although no slave device is connected.
The algorithm likely also works for real i2c client devices (OV2640 uses SCCB),
because the Windows driver seems to use it for probing Samsung and Kodak
sensors.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-28 17:37:45 -03:00
Simon Horman e5c5d22e8d net: add ETH_P_802_3_MIN
Add a new constant ETH_P_802_3_MIN, the minimum ethernet type for
an 802.3 frame. Frames with a lower value in the ethernet type field
are Ethernet II.

Also update all the users of this value that David Miller and
I could find to use the new constant.

Also correct a bug in util.c. The comparison with ETH_P_802_3_MIN
should be >= not >.

As suggested by Jesse Gross.

Compile tested only.

Cc: David Miller <davem@davemloft.net>
Cc: Jesse Gross <jesse@nicira.com>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Bart De Schuymer <bart.de.schuymer@pandora.be>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: Patrick McHardy <kaber@trash.net>
Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Gustavo Padovan <gustavo@padovan.org>
Cc: Johan Hedberg <johan.hedberg@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Cc: netfilter-devel@vger.kernel.org
Cc: bridge@lists.linux-foundation.org
Cc: linux-wireless@vger.kernel.org
Cc: linux1394-devel@lists.sourceforge.net
Cc: linux-media@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: dev@openvswitch.org
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-03-28 01:20:42 -04:00
Paul Bolle 0bb9121c88 radio-shark: Fix printk "CONFIG_LED_CLASS"
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-03-27 13:21:49 +01:00
Hans Verkuil 80f23305ba [media] Fix undefined reference to `au8522_attach'
au8522_attach is dependent on CONFIG_DVB_AU8522_DTV, not CONFIG_DVB_AU8522.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-26 08:37:48 -03:00
Wei Yongjun 0170a39b69 [media] af9035: fix missing unlock on error in af9035_ctrl_msg()
Add the missing unlock before return from function af9035_ctrl_msg()
in the error handling case.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Antti Palosaari <crope@iki.fi>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-26 08:37:45 -03:00
Hans de Goede 35ccecef6e [media] [REGRESSION] bt8xx: Fix too large height in cropcap
Since commit a1fd287780c8e91fed4957b30c757b0c93021162:
"[media] bttv-driver: fix two warnings"
cropcap.defrect.height and cropcap.bounds.height for the PAL entry are 32
resp 30 pixels too large, if a userspace app (ie xawtv) actually tries to use
the full advertised height, the resulting image is broken in ways only a
screenshot can describe.
The cause of this is the fix for this warning:
drivers/media/pci/bt8xx/bttv-driver.c:308:3: warning: initialized field overwritten [-Woverride-init]
In this chunk of the commit:
@@ -301,11 +301,10 @@ const struct bttv_tvnorm bttv_tvnorms[] = {
                        /* totalwidth */ 1135,
                        /* sqwidth */ 944,
                        /* vdelay */ 0x20,
-                       /* sheight */ 576,
-                       /* videostart0 */ 23)
                /* bt878 (and bt848?) can capture another
                   line below active video. */
-               .cropcap.bounds.height = (576 + 2) + 0x20 - 2,
+                       /* sheight */ (576 + 2) + 0x20 - 2,
+                       /* videostart0 */ 23)
        },{
                .v4l2_id        = V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_KR,
                .name           = "NTSC",
Which replaces the overriding of cropcap.bounds.height initialization outside
of the CROPCAP macro (which also initializes it), with passing a
different sheight value to the CROPCAP macro.
There are 2 problems with this warning fix:
1) The sheight value is used twice in the CROPCAP macro, and the old code
   only changed one resulting value.
2) The old code increased the .cropcap.bounds.height value (and did not
   touch the .cropcap.defrect.height value at all) by 2, where as the fixed
   code increases it by 32, as the fixed code passes (576 + 2) + 0x20 - 2
   to the CROPCAP macro, but the + 0x20 - 2 is already done by the macro so
   now is done twice for .cropcap.bounds.height, and also is applied to
   .cropcap.defrect.height where it should not be applied at all.
This patch fixes this by adding an extraheight parameter to the CROPCAP entry
and using it for the PAL entry.

Cc: stable@kernel.org	# For Kernel 3.8
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-26 08:37:00 -03:00
Mauro Carvalho Chehab 004e45d736 [media] tuner-core: handle errors when getting signal strength/afc
If those callbacks fail, it should return zero, and not a random
value. The previous code assumed that all drivers would only change
signal strength if it succeeds, but this may not be true.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 15:10:43 -03:00
Mauro Carvalho Chehab 6f8ca0b541 [media] tuner-core: Remove the now uneeded checks at fe_has_signal/get_afc
Now that those functions are only used when the corresponding
function calls are defined, we don't need to check if those
function calls are present at the structure before using it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 15:10:42 -03:00
Mauro Carvalho Chehab 383730c364 [media] tuner-core: return afc instead of zero
While the driver gets AFC from the tuner, it doesn't return it
back via V4L2 API due to a mistake at the return. fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 15:10:40 -03:00
Hans Verkuil 106cf649d0 [media] tuner-core: don't set has_signal/get_afc if not supported
If the tuner frontend does not support get_rf_strength, then don't set
the has_signal callback. Ditto for get_afc.
Both callbacks overwrite the signal and afc fields of struct v4l2_tuner
but that should only happen if the tuner can actually detect this. If
it can't, then it should leave those fields alone so other subdevices
can try and detect the signal/afc.
This fixes the bug where the au8522 detected a signal and then tuner-core
overwrote it with 0 since the xc5000 tuner does not support get_rf_strength.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 15:10:39 -03:00
Hans Verkuil ea86968fb9 [media] au0828: improve firmware loading & locking
- open/close/read and poll need to take the core lock as well.
- when the tuner goes to sleep we should set std_set_in_tuner_core
  to 0 since the tuner loses the firmware at that time.
- initialize the tuner if std_set_in_tuner_core == 0 whenever:
  1) g/s_tuner, s_std or s_frequency is called
  2) read or poll is called
  3) streamon is called

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 15:10:37 -03:00
Hans Verkuil 56230d1e29 [media] au0828: fix initial video routing
After loading the module the initial video routing is not setup.
Explicitly call s_input to get this right.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 15:10:35 -03:00
Hans Verkuil de8d2bbf0a [media] au0828: don't change global state information on open()
Just opening a device shouldn't have any side-effects.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 15:10:33 -03:00
Hans Verkuil fa09cb9a99 [media] au0828: simplify i2c_gate_ctrl
Turn it into a simple function.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 15:10:32 -03:00
Hans Verkuil 823beb7e22 [media] au0828: fix disconnect sequence
The driver crashed when the device was disconnected while an application
still had a device node open. Fixed by using the release() callback of struct
v4l2_device.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 15:10:30 -03:00
Hans Verkuil dc6d2a2f66 [media] au8522_decoder: remove obsolete control ops
Now that au0828 has been converted to the control framework these
compatilibity ops are no longer needed.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 15:10:29 -03:00
Hans Verkuil 33b6b89bd3 [media] au0828: replace deprecated current_norm by g_std
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 15:10:27 -03:00
Hans Verkuil 8d86e4e814 [media] au0828: add try_fmt_vbi support, zero vbi.reserved, pix.priv
Also get rid of unnecessary format type check.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 15:10:26 -03:00
Hans Verkuil 83b0942232 [media] au0828: add prio, control event and log_status support
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 15:10:24 -03:00
Hans Verkuil e8c26f45b1 [media] au0828: convert to the control framework
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 15:10:22 -03:00
Hans Verkuil a2cf96f929 [media] au0828: fix audio input handling
- V4L2_CAP_AUDIO was set, but enumaudio was not implemented.
- audioset was never filled by enum_input
- ctrl_ainput was never updated when switching the video input
- g_audio was broken due to faulty logic: g_audio should set the
  index, it doesn't receive it from the user.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 15:10:20 -03:00
Hans Verkuil 38823b29e7 [media] au0828: fix intendation coding style issue
No code change, just fixing a wrong indentation.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 15:10:16 -03:00
Hans Verkuil e1cf6587d5 [media] au0828: frequency handling fixes
- define an initial frequency
- return an error if g_frequency is called for an invalid tuner index
- get the clamped frequency value after setting it: i.e. the tuner driver
  may clamp the given frequency to a valid frequency range and ctrl_freq
  should get that actual clamped frequency.
- remove obsolete tuner type checks (done by the core).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 15:10:02 -03:00
Hans Verkuil 59e0548453 [media] au0828: fix querycap
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 15:10:00 -03:00
Hans Verkuil 5a4bdb4b34 [media] au8522_decoder: convert to the control framework
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 15:09:59 -03:00
Mauro Carvalho Chehab 532ee00c44 [media] fix compilation with both V4L2 and I2C as 'm'
When config options are:
	CONFIG_VIDEO_DEV=y
	CONFIG_VIDEO_V4L2=m
	CONFIG_I2C=m

Compilation breaks, as reported by:
	https://bugzilla.kernel.org/show_bug.cgi?id=55681

Before changeset 7b34be71db,
no compilation errors occurred. However, the I2C code there at
v4l2-device was incorrectly disabled.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 15:09:38 -03:00
Hans Verkuil 3b2d17b4ba [media] em28xx: add support for g_chip_name
Add support for vidioc_g_chip_name, allowing AC97 to be implemented as a
second chip on the bridge with the name "ac97". v4l2-dbg can just match the
name with that string in order to detect a ac97-compliant set of registers.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 09:34:22 -03:00
Hans Verkuil c7622fc948 [media] stk1160: remove V4L2_CHIP_MATCH_AC97 placeholder
It was just a placeholder and we want to get rid of the AC97 matching
define.
Also replace MATCH_HOST with MATCH_BRIDGE since we are here anyway.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 09:32:21 -03:00
Hans Verkuil 79b0c64005 [media] v4l2: add new VIDIOC_DBG_G_CHIP_NAME ioctl
Simplify the debugging ioctls by creating the VIDIOC_DBG_G_CHIP_NAME ioctl.
This will eventually replace VIDIOC_DBG_G_CHIP_IDENT. Chip matching is done
by the name or index of subdevices or an index to a bridge chip. Most of this
can all be done automatically, so most drivers just need to provide get/set
register ops.
In particular, it is now possible to get/set subdev registers without
requiring assistance of the bridge driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 09:31:05 -03:00
Hans Verkuil 9d5f4839cc [media] v4l2-common: remove obsolete check for ' at the end of a driver name
During the transition to sub-devices several years ago non-subdev drivers
had a ' at the end of their driver name to tell them apart from already
converted drivers. This check was a left-over from that time and can be
removed.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 09:24:01 -03:00
Tushar Behera 9b6f5dc07a [media] videobuf2-core: print current state of buffer in vb2_buffer_done
In vb2_buffer_done, it would be better the print the value of 'state'
(current state of buffer) than to print 'vb->state' which is always
VB2_BUF_STATE_ACTIVE.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 09:15:53 -03:00
Volokh Konstantin 8dbee53b2a [media] tw2804: Revert ADC Control commit 523a4f7fbc
Case: In AdLink MPG24 there is bt878 exists (it captures one frame of all video
inputs), Video Signal for it one transmits through tw2804 chip, so we can't
control ADC (shut on/off) on tw2804, as some another can use bttv capture way.

Signed-off-by: Volokh Konstantin <volokh84@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 08:13:40 -03:00
Hans Verkuil d4a2cea4f2 [media] tw9603/6.c: use two separate const tables for the 50/60hz setup
Using two separate tables to setup the registers for 50 or 60 hz is
better than the non-const table that is filled in at runtime.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 08:11:43 -03:00
Sachin Kamat b12f7dd51a [media] tw9906: Remove unneeded version.h header include
version.h header inclusion is not necessary as detected by
versioncheck.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 07:55:41 -03:00
Frank Schaefer fa74aca3a3 [media] em28xx-i2c: fix coding style of multi line comments
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 07:51:52 -03:00
Frank Schaefer d230d5ad0b [media] em28xx-i2c: do not break strings across lines
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25 07:50:24 -03:00
Hans Verkuil af2d68d1be [media] vivi: add v4l2_ctrl_modify_range test case
Update the brighness range depending on the selected input. Useful for
testing control range events.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 14:11:22 -03:00
Mauro Carvalho Chehab b781e6be79 [media] sony-btf-mpx: v4l2_tuner struct is now constant
A patchset applied earlier changed v4l2_tuner struct parameter at
vidioc_s_tuner to const. Do this change at sony_btf_mpx_s_tuner(),
in order to remove this warning:

	drivers/media/i2c/sony-btf-mpx.c:335:2: warning: initialization from incompatible pointer type [enabled by default]
	drivers/media/i2c/sony-btf-mpx.c:335:2: warning: (near initialization for 'sony_btf_mpx_tuner_ops.s_tuner') [enabled by default]

Cc: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 14:04:34 -03:00
Hans Verkuil 02fa628217 [media] v4l2 core: remove the obsolete dv_preset support
These ioctls are no longer used by any drivers, so remove them.

[mchehab@redhat.com: Fix merge conflict]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 13:49:17 -03:00
Hans Verkuil 2d80647b6e [media] v4l2-common: remove obsolete v4l_fill_dv_preset_info
It's no longer used, so it can now be removed.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 13:37:10 -03:00
Hans Verkuil a000e9a02b [media] tw9906: add Techwell tw9906 video decoder
Taken from the 0.9.8-5 version of the out-of-tree wis-go7007 driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 13:06:39 -03:00
Volokh Konstantin 523a4f7fbc [media] tw2804: modify ADC power control
Switch off all ADC (max 4) with first init, we control it
when starting/stopping streaming.

Signed-off-by: Volokh Konstantin <volokh84@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 12:29:46 -03:00
Hans Verkuil 12be52a9e0 [media] tw2804: add support for the Techwell tw2804
This is based on the wis-tw2804.c driver that's part of the go7007 driver.
It has been converted to a v4l subdev driver by Volokh Konstantin, and I
made additional cleanups.
Based on work by: Volokh Konstantin <volokh84@gmail.com>

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 12:28:48 -03:00
Hans Verkuil 0890ec19c6 [media] tw9903: add new tw9903 video decoder
This based on the wis-tw9903.c driver that's part of the go7007 driver.
It has been converted to a v4l subdev driver by Pete Eberlein, and I made
additional cleanups.
Based on work by: Pete Eberlein <pete@sensoray.com>

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 12:24:44 -03:00
Hans Verkuil 73d9f97933 [media] uda1342: add new uda1342 audio codec driver
This based on the wis-uda1342.c driver that's part of the go7007 driver.
It has been converted to a v4l subdev driver by Pete Eberlein, and I made
additional cleanups.
Based on work by: Pete Eberlein <pete@sensoray.com>

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 12:24:11 -03:00
Hans Verkuil ec367c3cd1 [media] ov7640: add new ov7640 driver
This based on the wis-ov7640.c driver that's part of the go7007 driver.
It has been converted to a v4l subdev driver by Pete Eberlein, and I made
additional cleanups.
Based on work by: Pete Eberlein <pete@sensoray.com>

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 12:23:33 -03:00
Hans Verkuil c7c54a988d [media] sony-btf-mpx: the MPX driver for the sony BTF PAL/SECAM tuner
The Sony BTF PG472Z has an internal MPX to deal with mono/stereo/bilingual
audio. This is split off from the wis-sony-tuner driver that is part of
the go7007 driver as it should be a separate i2c sub-device driver.
The wis-sony-tuner is really three i2c devices: a standard tuner, a tda9887
compatible demodulator and this mpx. After this patch the wis-sony-tuner
can be replaced by this driver and the standard tuner driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 12:21:29 -03:00
Hans Verkuil e4d2a6162d [media] tuner: add Sony BTF tuners
This adds support for three Sony BTF tuners:
TUNER_SONY_BTF_PG472Z: PAL+SECAM
TUNER_SONY_BTF_PK467Z: NTSC-M-JP
TUNER_SONY_BTF_PB463Z: NTSC-M
These come from the go7007 staging driver where they were implemented in
the wis-sony-tuner i2c driver.
Adding support for these tuners to tuner-types.c is the first step towards
removing the wis-sony-tuner driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 12:11:35 -03:00
Hans Verkuil 1589037f87 [media] saa7115: add support for double-rate ASCLK
Some devices expect a double rate ASCLK. Add a flag to let the driver know
through the s_crystal_freq call.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 12:10:18 -03:00
Hans Verkuil c875dee536 [media] saa7115: improve querystd handling for the saa7115
The saa7115 has better PAL/NTSC detection, so it can detect PAL even
though the chip is currently set up for NTSC.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 12:05:48 -03:00
Hans Verkuil a0fc58868b [media] saa7115: add config flag to change the IDQ polarity
Needed by the go7007 driver: it assumes a different polarity of the IDQ
signal, so we need to be able to tell the saa7115 about this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 12:02:59 -03:00
Hans Verkuil 9ca5470cc1 [media] v4l2-ctrls: add V4L2_CID_MPEG_VIDEO_REPEAT_SEQ_HEADER control
Control whether video sequence headers should be repeated.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 12:02:08 -03:00
Hans Verkuil 73f35418a1 [media] v4l2-ioctl: check if an ioctl is valid
Just checking if the op exists isn't correct, you should check if the ioctl
is valid (which implies that the op exists as well).
One exception is g_std: if current_norm is non-zero, then the g_std op may be
absent. This sort of weird behavior is one of the reasons why I am trying to
get rid of current_norm.
This patch fixes the case where the g/s_std op is set, but these ioctls are
disabled. This can happen in drivers supporting multiple models, some that
have TV input (and support the STD API) and some that have a sensor (and do
not support the STD API). In the latter case qv4l2 would still show the
Standards combobox.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 12:01:26 -03:00
Andy Walls 6cd247ef22 [media] v4l2-ctrls: eliminate lockdep false alarms for struct v4l2_ctrl_handler.lock
When calling v4l2_ctrl_add_handler(), lockdep would detect a potential
recursive locking problem on a situation that is by design intended and
not a recursive lock.  This happened because all struct
v4l2_ctrl_handler.lock mutexes were created as members of the same lock
class in v4l2_ctrl_handler_init(), and v4l2_ctrl_add_handler() takes the
hdl->lock on two different v4l2_ctrl_handler instances.
This change breaks the large lockdep lock class for struct
v4l2_ctrl_handler.lock and breaks it into v4l2_ctrl_handler
instantiation specific lock classes with meaningful class names.
This will validly eliminate lockdep alarms for v4l2_ctrl_handler locking
validation, as long as the relationships between drivers adding v4l2
controls to their own handler from other v4l2 drivers' control handlers
remains straightforward.
struct v4l2_ctrl_handler.lock lock classes are created with names such
that the output of cat /proc/lockdep indicates where in the v4l2 driver
code v4l2_ctrl_handle_init() is being called on instantiations:
ffffffffa045f490 FD:   10 BD:    8 +.+...: cx2341x:1534:(hdl)->lock
ffffffffa0497d20 FD:   12 BD:    2 +.+.+.: saa7115:1581:(hdl)->lock
ffffffffa04ac660 FD:   14 BD:    2 +.+.+.: msp3400_driver:756:(hdl)->lock
ffffffffa0484b90 FD:   12 BD:    1 +.+.+.: ivtv_gpio:366:(&itv->hdl_gpio)->lock
ffffffffa04eb530 FD:   11 BD:    2 +.+.+.: cx25840_core:1982:(&state->hdl)->lock
ffffffffa04fbc80 FD:   11 BD:    3 +.+.+.: wm8775:246:(&state->hdl)->lock
Some lock chains, that were previously causing the recursion alarms, are
now visible in the output of cat /proc/lockdep_chains:
irq_context: 0
[ffffffffa0497d20] saa7115:1581:(hdl)->lock
[ffffffffa045f490] cx2341x:1534:(hdl)->lock
irq_context: 0
[ffffffffa04ac660] msp3400_driver:756:(hdl)->lock
[ffffffffa045f490] cx2341x:1534:(hdl)->lock
irq_context: 0
[ffffffffa0484b90] ivtv_gpio:366:(&itv->hdl_gpio)->lock
[ffffffffa045f490] cx2341x:1534:(hdl)->lock
irq_context: 0
[ffffffffa04eb530] cx25840_core:1982:(&state->hdl)->lock
[ffffffffa045f490] cx2341x:1534:(hdl)->lock
irq_context: 0
[ffffffffa04fbc80] wm8775:246:(&state->hdl)->lock
[ffffffffa045f490] cx2341x:1534:(hdl)->lock

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
[hans.verkuil@cisco.com: keep mutex_init in v4l2_ctrl_handler_init_class]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 11:47:09 -03:00
Hans Verkuil 505d04bdc4 [media] v4l2-ioctl: simplify debug code
The core debug code can now be simplified since all the write-only ioctls are
now const and will not modify the data they pass to the drivers.
So instead of logging write-only ioctls before the driver is called this can
now be done afterwards, which is cleaner when it comes to error reporting as
well.
This also fixes a logic error in the debugging code where there was one 'else'
too many.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 08:47:16 -03:00
Hans Verkuil 977ba3b1b7 [media] v4l2: add const to argument of write-only s_register ioctl
This ioctl is defined as IOW, so pass the argument as const.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 08:47:01 -03:00
Hans Verkuil b5656e8b73 [media] ivtv: prepare ivtv for adding const to s_register
The ivtv_itvc function receives a pointer to v4l2_dbg_register. When we
add const to that pointer in the s_register case we will run into a problem
here since this common function would discard const in that case. So
change this function so it receives the address and a pointer to a value.
In addition we now set the size field in the g_register function which is
where it belongs.
This will simplify the next patch where const will be added to s_register.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 08:46:39 -03:00
Hans Verkuil 27d5a87cf4 [media] v4l2-ioctl: add precision when printing names
Never print more than the size of the buffer containing the name.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 07:13:54 -03:00
Hans Verkuil 314527acbb [media] v4l2: pass std by value to the write-only s_std ioctl
This ioctl is defined as IOW, so pass the argument by value instead of by
reference. I could have chosen to add const instead, but this is 1) easier
to handle in drivers and 2) consistent with the s_std subdev operation.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Jonathan Corbet <corbet@lwn.net>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 06:47:00 -03:00
Hans Verkuil 2f73c7c582 [media] v4l2: add const to argument of write-only s_tuner ioctl
This ioctl is defined as IOW, so pass the argument as const.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Alexey Klimov <klimov.linux@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 06:31:23 -03:00
Hans Verkuil b530a447bb [media] v4l2: add const to argument of write-only s_frequency ioctl
This ioctl is defined as IOW, so pass the argument as const.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24 06:25:34 -03:00
Frank Schaefer 0757f5c503 [media] bttv: apply mute settings on open
Previously, this has been done implicitly for video device nodes by calling
set_input() (which calls audio_input() and also modified the mute
setting).
Since input and mute setting are now untangled (as much as possible), we need to
apply the mute setting with an explicit call to audio_mute().
Also apply the mute setting when the radio device node gets opened.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 11:33:01 -03:00
Frank Schaefer da9f07f2d4 [media] bttv: do not unmute the device before the first open
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 11:32:48 -03:00
Frank Schaefer b1a301572a [media] bttv: untangle audio input and mute setting
Split function audio_mux():
move the mute setting part to function audio_mute() and the input setting part
to function audio_input().

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 11:32:26 -03:00
Frank Schaefer 5f45678173 [media] bttv: separate GPIO part from function audio_mux()
Move the GPIO part of function audio_mux() to a separate function
audio_mux_gpio().
This prepares the code for the next patch which will separate mute and input
setting.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 11:31:49 -03:00
Frank Schaefer 2166f0a971 [media] bttv: rename field 'audio' in struct 'bttv' to 'audio_input'
'audio_input' better describes the meaning of this field.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 11:31:13 -03:00
Frank Schaefer 20167f17f1 [media] bttv: do not save the audio input in audio_mux()
We can't and do not save the mute setting in function audio_mux(), so we
should also not save the input in this function for consistency.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 11:30:55 -03:00
Frank Schaefer 598728e920 [media] bttv: audio_mux(): do not change the value of the v4l2 mute control
There are cases where we want to call audio_mux() without changing the value of
the v4l2 mute control, for example
- mute mute on last close
- mute on device probing

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 11:30:21 -03:00
Frank Schaefer 28cafc38ec [media] bttv: audio_mux(): use a local variable "gpio_mute" instead of modifying the function parameter "mute"
Function audio_mux() actually deals with two types of mute: gpio mute and
subdevice muting.
This patch claryfies the meaning of these values, but mainly prepares the code for
the next patch.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 11:29:10 -03:00
David Härdeman 9719afae5e [media] rc-core: don't treat dev->rc_map.rc_type as a bitmap
store_protocols() treats dev->rc_map.rc_type as a bitmap which is wrong for
two reasons. First of all, it is pretty bogus to change the protocol type of
the keymap just because the hardware has been asked to decode a different
protocol.
Second, dev->rc_map.rc_type is an enum (i.e. a single protocol) as pointed
out by James Hogan <james.hogan@imgtec.com>.
Fix both issues by introducing a separate enabled_protocols member to
struct rc_dev.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 11:25:54 -03:00
Sachin Kamat efa914d7d0 [media] dvb-usb/dw2102: Remove duplicate inclusion of ts2020.h
ts2020.h was included twice.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 11:07:07 -03:00
Jose Alberto Reguero 78c7bc4bd2 [media] [PATH] enable dual tuner to Avermedia Twinstar in af9035 driver
This patch enable dual tuner for Avermedia Twinstar.

Signed-off-by: Jose Alberto Reguero <jareguero@telefonica.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 11:06:20 -03:00
Hans Verkuil 34a518a079 [media] s5p-tv: remove the dv_preset API from hdmiphy
The dv_preset API is deprecated and is replaced by the much improved dv_timings
API. Remove the dv_preset support from this driver as this will allow us to
remove the dv_preset API altogether (s5p-tv being the last user of this code).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Acked-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 11:00:52 -03:00
Hans Verkuil 9b30af98b4 [media] s5p-tv: remove the dv_preset API from hdmi
The dv_preset API is deprecated and is replaced by the much improved dv_timings
API. Remove the dv_preset support from this driver as this will allow us to
remove the dv_preset API altogether (s5p-tv being the last user of this code).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Acked-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 11:00:35 -03:00
Hans Verkuil 3887056bc4 [media] s5p-tv: remove dv_preset support from mixer_video
The dv_preset API is deprecated and is replaced by the much improved dv_timings
API. Remove the dv_preset support from this driver as this will allow us to
remove the dv_preset API altogether (s5p-tv being the last user of this code).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Acked-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 11:00:05 -03:00
Hans Verkuil 8e42bf033e [media] s5p-tv: add dv_timings support for mixer_video
This just adds dv_timings support without modifying existing dv_preset
support.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Acked-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 10:59:47 -03:00
Hans Verkuil 5efb54b2b7 [media] s5p-tv: add dv_timings support for hdmi
This just adds dv_timings support without modifying existing dv_preset
support.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Acked-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 10:59:06 -03:00
Hans Verkuil 8cf2f7ad97 [media] s5p-tv: add dv_timings support for hdmiphy
This just adds dv_timings support without modifying existing dv_preset
support, although I had to refactor a little bit in order to share
hdmiphy_find_conf() between the preset and timings code.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Acked-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 10:58:05 -03:00
Wei Yongjun 8b2c3da108 [media] gspca: remove needless check before usb_free_coherent()
usb_free_coherent() is safe with NULL addr and this check is
not required.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 10:48:56 -03:00
Jean Delvare a3ad56d0ab [media] drxk_hard: Drop unused parameter
Last parameter of function GetLockStatus() isn't used so drop it.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 10:44:31 -03:00
Lad, Prabhakar ced9b21ff6 [media] davinci: vpif: Fix module build for capture and display
export the symbols which are used by two modules vpif_capture and
vpif_display. renamed "ch_params" to "vpif_ch_params" so as to avoid
name collision.
This patch fixes following error:
ERROR: "ch_params" [drivers/media/platform/davinci/vpif_display.ko] undefined!
ERROR: "vpif_ch_params_count" [drivers/media/platform/davinci/vpif_display.ko] undefined!
ERROR: "vpif_base" [drivers/media/platform/davinci/vpif_display.ko] undefined!
ERROR: "ch_params" [drivers/media/platform/davinci/vpif_capture.ko] undefined!
ERROR: "vpif_ch_params_count" [drivers/media/platform/davinci/vpif_capture.ko] undefined!
ERROR: "vpif_base" [drivers/media/platform/davinci/vpif_capture.ko] undefined!
make[1]: *** [__modpost] Error 1

Reported-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 10:38:10 -03:00
Eduardo Valentin 04e1ac04e5 [media] media: radio: add module alias entry for radio-si4713
Add MODULE_ALIAS entry for radio-si4713 platform driver.

Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 10:19:55 -03:00
Eduardo Valentin 04edd7b038 [media] media: radio: add driver owner entry for radio-si4713
Simple addition of platform_driver->driver->owner for radio-si4713.

Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 10:18:22 -03:00
Eduardo Valentin a782ae09b7 [media] media: radio: correct module license (==> GPL v2)
As per code header comment, changing the driver license entry
to match the correct version.

Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 10:14:25 -03:00
Eduardo Valentin 385624a8e7 [media] media: radio: CodingStyle changes on si4713
Minor changes to make alignment match on open parenthesis.

Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 10:12:48 -03:00
Antti Palosaari b09e71a8de [media] it913x: fix pid filter
I just made commit: "dvb_usb_v2: rework USB streaming logic" that
breaks that driver PID filter.
it913x driver checks use of PID filter directly from DVB USB v2 core
internal variable "adap->pid_filtering" and stores it to own state.
Calling order of .pid_filter_ctrl() and .pid_filter() was changed
and due to that state was updated too late. Update state earlier.
TODO: checking PID filter usage from DVB USB v2 is not very good idea
as PID filter callbacks are called only when PID filter is enabled.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 10:02:41 -03:00
Antti Palosaari 96d7ca5ec9 [media] dvb_usb_v2: rework USB streaming logic
Control flow order changed a little bit. HW PID filter is now
disabled also when streaming is stopped - earlier it was just
set only when streaming was started.
Control flow is now:
* set streaming status bit
* submit USB streaming packets
* enable HW PID filter
* ask device to start streaming
* N x add PID to device HW PID filter
... streaming video ...
* N x remove PID from device HW PID filter
* ask device to stop streaming
* disable HW PID filter
* kill USB streaming packets
* clear streaming status bit

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 10:02:04 -03:00
Antti Palosaari 61356eea67 [media] cypress_firmware: make checkpatch.pl happy
New checkpatch version likes to see strings not to split multiple
lines even those are exceeding 80 line length.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 10:00:23 -03:00
Antti Palosaari 6d7cfec413 [media] dvb_usb_v2: make checkpatch.pl happy
New checkpatch version likes to see strings not to split multiple
lines even those are exceeding 80 line length.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 09:59:56 -03:00
Antti Palosaari bdecbe43e3 [media] dvb_usb_v2: replace Kernel userspace lock with wait queue
There was sync mutex which was held over userspace. That is very
wrong and could cause deadlock if different userspace process is
used to "unlock". Wait queue seems to be correct solution for
that kind of synchronizing issue so use it instead.
lock debug gives following bug report:
================================================
[ BUG: lock held when returning to user space! ]
3.9.0-rc1+ #38 Tainted: G           O
------------------------------------------------
tzap/4614 is leaving the kernel with locks still held!
1 lock held by tzap/4614:

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 09:58:49 -03:00
Mauro Carvalho Chehab 028c70ff42 [media] dvb-usb/dvb-usb-v2: use IS_ENABLED
Instead of checking everywhere there for 3 symbols, use instead
IS_ENABLED macro.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 09:33:30 -03:00
Mauro Carvalho Chehab 1c59390b3b [media] cx23885: use IS_ENABLED
Instead of checking everywhere there for 3 symbols, use instead
IS_ENABLED macro.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 09:29:10 -03:00
Mauro Carvalho Chehab 9dc353c67c [media] tuners: use IS_ENABLED
Instead of checking everywhere there for 3 symbols, use instead
IS_ENABLED macro.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 09:22:06 -03:00
Mauro Carvalho Chehab 782d8b743a [media] dvb-frontends: use IS_ENABLED
Instead of checking everywhere there for 3 symbols, use instead
IS_ENABLED macro.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 09:03:59 -03:00
Mauro Carvalho Chehab 54d80904b4 [media] hdpvr-video: Use the proper check for I2C support
As reported by Geert Uytterhoeven <geert@linux-m68k.org>:
	drivers/media/usb/hdpvr/hdpvr-video.c: warning: "CONFIG_I2C_MODULE" is not defined [-Wundef]

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Thanks-to: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-23 01:06:35 -03:00
Wei Yongjun 13828c61e9 [media] dvb_usb_v2: make local function dvb_usb_v2_generic_io() static
dvb_usb_v2_generic_io() was not declared. It should be static.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-22 13:50:12 -03:00
Hans Verkuil bc3d292803 [media] em28xx: tuner setup is broken after algo_data change
Commit aab3125c43 broke em28xx. I traced
this eventually to the change in what algo_data points to. This pointer
is also passed to em28xx_tuner_callback() through several hidden tuner
layers (yuck!) and that callback was not updated.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-22 13:21:10 -03:00
Mauro Carvalho Chehab 3190fbee01 [media] em28xx: Only change I2C bus inside em28xx-i2c
There's currently a bug on em28xx-i2c that makes it write the
wrong values to register 06, that controlls the I2C bus speed
and bus.

Fix it to change only the I2C bus flag.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-22 13:19:52 -03:00
Mauro Carvalho Chehab 9dc033f1ea [media] m5602_ov7660: return error at ov7660_init()
It used to be a code that returns arror at ov7660_init.
However, this was removed by changeset c84e412f:

@@ -231,33 +116,40 @@ int ov7660_init(struct sd *sd)
        if (dump_sensor)
                ov7660_dump_registers(sd);

-   err = ov7660_set_gain(&sd->gspca_dev, sensor_settings[GAIN_IDX]);
-   if (err < 0)
-           return err;
+ return 0;
+}

-   err = ov7660_set_auto_white_balance(&sd->gspca_dev,
-           sensor_settings[AUTO_WHITE_BALANCE_IDX]);
-   if (err < 0)
-           return err;

As complained by gcc:
	drivers/media/usb/gspca/m5602/m5602_ov7660.c: In function 'ov7660_init':
	drivers/media/usb/gspca/m5602/m5602_ov7660.c:99:9: warning: variable 'err' set but not used [-Wunused-but-set-variable]

It should be noticed that the original error code was crappy, as it wasn't
returning any error if sensor init fails.

Fix it by returning an error if the sensor can't be initialized.

Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-22 09:46:48 -03:00
Mauro Carvalho Chehab 39ed1267d9 [media] siano: remove the ir protocol field
This field is unused. Remove it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-22 09:46:46 -03:00
Mauro Carvalho Chehab 48f72a1a4c [media] drxk: fix CNR calculus
Changeset 8f3741e accidentally broke the CNR estimation. It should
be calculated as "a + b - c". However, previously, the subtraction
by c only occurred if SNR would be positive, due to a bad binding
to DVBv3 API.

This also fixes the following warning:
	drivers/media/dvb-frontends/drxk_hard.c:2556:6: warning: variable 'c' set but not used [-Wunused-but-set-variable]

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-22 09:46:45 -03:00
Mauro Carvalho Chehab f35d09db0e [media] siano: use do_div() for 64-bits division
As reported by Frank Schäfer <fschaefer.oss@googlemail.com>:
	ERROR: "__divdi3" [drivers/media/common/siano/smsdvb.ko] undefined!

Reported-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Tested-by: Gianluca Gennari <gennarone@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-22 09:46:31 -03:00
Antti Palosaari 75cd5886ed [media] af9035: style changes for remote controller polling
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 19:06:31 -03:00
Antti Palosaari 1bfd5294dd [media] af9035: check I/O errors on IR polling
Use more careful error checks.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 19:06:13 -03:00
Antti Palosaari 3bf5e55299 [media] af9033: implement i/o optimized reg table writer
Use register address auto increment to reduce I/O when large
register / values tables are written.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 19:06:00 -03:00
Antti Palosaari 0c13c54d85 [media] af9033: sleep on attach()
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 19:05:45 -03:00
Antti Palosaari 086991dd10 [media] af9033: move code from it913x to af9033
That register is property of demodulator so move it correct place.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 19:05:24 -03:00
Antti Palosaari d423e108c1 [media] it913x: remove unused af9033 demod tuner config inits
Those are demodulator init tables according to used tuner tuner
config. af9033 demod driver does those inits currently and due
to that these duplicate inits could be removed.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 19:05:00 -03:00
Antti Palosaari dc4a2c40f8 [media] af9033: add IT9135 tuner config "62" init table
Dumped out from the Windows driver version 12.07.06.1

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 19:04:25 -03:00
Antti Palosaari 85211323fa [media] af9033: add IT9135 tuner config "61" init table
Dumped out from the Windows driver version 12.07.06.1

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 19:04:15 -03:00
Antti Palosaari a49f53a080 [media] af9033: add IT9135 tuner config "60" init table
Dumped out from the Windows driver version 12.07.06.1

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 19:04:01 -03:00
Antti Palosaari 22d729f30e [media] af9033: add IT9135 tuner config "52" init table
Dumped out from the Windows driver version 12.07.06.1

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 19:03:41 -03:00
Antti Palosaari bb2e12a6f9 [media] af9033: add IT9135 tuner config "51" init table
Dumped out from the Windows driver version 12.07.06.1

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 19:03:20 -03:00
Antti Palosaari a72cbb77c1 [media] af9033: add IT9135 tuner config "38" init table
Dumped out from the Windows driver version 12.07.06.1

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 19:03:08 -03:00
Antti Palosaari 70375ecc45 [media] af9035: change dual mode boolean to bit field
For some reason there seems to be value	0x03 in eeprom for dual mode
(and 0x00 for single mode). Boolean is not always 1 bit wide - it
could be 8 bit wide too. Storing number 0x03 to boolean causes driver
to thing there is 4 tuners in some cases :o
Add also some comments regarding to eeprom.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 19:01:58 -03:00
Antti Palosaari 1c72fe2679 [media] af9035: enable remote controller for IT9135 too
There is no difference towards AF9035 remote controller, so enable it.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 19:01:28 -03:00
Antti Palosaari ab56ad6ada [media] af9035: set demod TS mode config in read_config()
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 19:01:14 -03:00
Antti Palosaari 431a6d4ab9 [media] af9035: use already detected eeprom base addr
eeprom memory mapped base address is detected at the very first.
Use it everywhere.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 19:01:00 -03:00
Antti Palosaari 8229da5064 [media] af9035: select firmware loader according to firmware
AF9035 and IT9135 supports two different firmware format. Select
correct loader according to first byte of firmware file.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 19:00:38 -03:00
Antti Palosaari 9d7b848e43 [media] it913x: remove demod init reg tables
These are demod inits and are already done by af9033 demod driver.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 19:00:17 -03:00
Antti Palosaari 463c399c2a [media] af9033: add IT9135 demod reg init tables
Dumped out from Windows driver version 12.07.06.1, 07/06/2012.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 19:00:01 -03:00
Antti Palosaari cfd08f0fb9 [media] it913x: use dev_foo() logging
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:59:33 -03:00
Antti Palosaari c0d300a669 [media] it913x: include tuner IDs from af9033.h
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:59:17 -03:00
Antti Palosaari 1085979792 [media] it913x: remove unused variables
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:59:02 -03:00
Antti Palosaari 44af747f4e [media] it913x: get rid of it913x config struct
We don't need it. Tuner ID and device address are enough.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:58:46 -03:00
Antti Palosaari d19812eb5f [media] it913x: tuner power up routines
Copy forgotten power up registers from it913x-fe driver.
Remove two demod registers as those are already written
by af9033 driver.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:58:17 -03:00
Antti Palosaari 42432b3ce8 [media] it913x: rename functions and variables
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:57:54 -03:00
Antti Palosaari 8c1285a280 [media] it913x: merge it913x_fe_suspend() to it913x_fe_sleep()
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:57:32 -03:00
Antti Palosaari ebb0662cee [media] it913x: merge it913x_fe_start() to it913x_init_tuner()
Merge those functions to one and disable sleep.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:57:17 -03:00
Antti Palosaari df8f1be14f [media] af9035: IT9135 dual tuner related changes
Now it supports IT9135 based dual tuner devices.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:56:42 -03:00
Antti Palosaari fe8eece1fd [media] af9033: IT9135 v2 supported related changes
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:55:45 -03:00
Antti Palosaari bc3c9e10fc [media] af9035: basic support for IT9135 v2 chips
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:55:13 -03:00
Antti Palosaari 9ea3681db4 [media] af9035: merge af9035 and it9135 eeprom read routines
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:51:31 -03:00
Antti Palosaari bada342e08 [media] af9035: USB1.1 support (== PID filters)
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:50:53 -03:00
Antti Palosaari a7816b7667 [media] af9035: constify clock tables
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:49:41 -03:00
Antti Palosaari b799b8102b [media] af9035: [0ccd:0099] TerraTec Cinergy T Stick Dual RC (rev. 2)
That same USB ID is used both AF9015 and AF9035 driver.
iManufacturer is only thing we can select correct driver without a I/O.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:49:20 -03:00
Antti Palosaari e8c7aab50d [media] af9015: reject device TerraTec Cinergy T Stick Dual RC (rev. 2)
That same USB ID is used both AF9015 and AF9035 driver.
iManufacturer is only thing we can select correct driver without a I/O.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:49:02 -03:00
Antti Palosaari 0d94d6a04b [media] af9035: fix af9033 demod sampling frequency
ADC needs to be also multiplied to 2 as it9135.
Fixes bug I introduced few commits ago.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:48:16 -03:00
Antti Palosaari 74c1883a56 [media] af9035: add auto configuration heuristic for it9135
Detect automatically multiple chip versions and select configuration
according to that.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:47:55 -03:00
Antti Palosaari ac77fb0f0c [media] af9035: add support for 1st gen it9135
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:47:19 -03:00
Antti Palosaari 4902bb39b6 [media] af9033: support for it913x tuners
Add support for tuners integrated to the IT9135 and IT9137.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:46:47 -03:00
Antti Palosaari 88b38befc0 [media] ITE IT913X silicon tuner driver
It is tuner driver for tuner integrated to the ITE IT9135 and
IT9137 chips. I split it out from the current it913x-fe driver.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:42:19 -03:00
Kevin Baradon e9e7a16d6d [media] media/rc/imon.c: avoid flooding syslog with "unknown keypress" when keypad is pressed
My 15c2:0036 device floods syslog when a keypad key is pressed:

	Feb 18 19:00:57 homeserver kernel: imon 5-1:1.0: imon_incoming_packet: unknown keypress, code 0x100fff2
	Feb 18 19:00:57 homeserver kernel: imon 5-1:1.0: imon_incoming_packet: unknown keypress, code 0x100fef2
	Feb 18 19:00:57 homeserver kernel: imon 5-1:1.0: imon_incoming_packet: unknown keypress, code 0x100fff2
	Feb 18 19:00:57 homeserver kernel: imon 5-1:1.0: imon_incoming_packet: unknown keypress, code 0x100fff2
	Feb 18 19:00:57 homeserver kernel: imon 5-1:1.0: imon_incoming_packet: unknown keypress, code 0x100fff2

This patch removes those messages from imon, following suggestion from
Mauro. Unknown keys shall be correctly handled by rc/input layer.

Signed-off-by: Kevin Baradon <kevin.baradon@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:37:32 -03:00
Kevin Baradon 26ccbec44a [media] media/rc/imon.c: make send_packet() delay larger for 15c2:0036
Some imon devices (like 15c2:0036) need a higher delay between
send_packet calls.

Default value is still 5ms to avoid regressions on already working
hardware.

Also use interruptible wait to avoid load average going too high (and
let caller handle signals).

Signed-off-by: Kevin Baradon <kevin.baradon@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:34:25 -03:00
Federico Fuga 15170025ee [media] Corrected Oops on omap_vout when no manager is connected
If no manager is connected to the vout device, the omapvid_init() function
fails. No error condition is checked, and the device is started. Later on,
when irq is serviced, a NULL pointer dereference occurs.
Also, the isr routine must be registered only if no error occurs, otherwise
the isr triggers without the proper setup, and the kernel oops again.
To prevent this, the error condition is checked, and the streamon function
exits with error. Also the isr registration call is moved after the setup
procedure is completed.

Reviewed-by: Prabhakar Lad <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:31:51 -03:00
Andrzej Hajda 6ba4d05e84 [media] m5mols: Fix bug in stream on handler
Due to improper condition check streaming start for some pixel
formats was prevent and the s_stream just reatuned -EINVAL.
This fixes regression introduced in commit 5565a2ad47
[media] m5mols: Protect driver data with a mutex.

Signed-off-by: Andrzej Hajda <a.hajda@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 <mchehab@redhat.com>
2013-03-21 18:25:09 -03:00
Sylwester Nawrocki 8c6ecdd7ce [media] s5p-fimc: Do not attempt to disable not enabled media pipeline
This fixes following warnings when all links are being disconnected:
[   20.080000] WARNING: at drivers/media/platform/s5p-fimc/fimc-mdevice.c:1269 __fimc_md_set_camclk+0x208/0x20c()
[   20.090000] Modules linked in:
[   20.095000] [<c001603c>] (unwind_backtrace+0x0/0x13c) from [<c00246dc>] (warn_slowpath_common+0x54/0x64)
[   20.105000] [<c00246dc>] (warn_slowpath_common+0x54/0x64) from [<c0024708>] (warn_slowpath_null+0x1c/0x24)
[   20.115000] [<c0024708>] (warn_slowpath_null+0x1c/0x24) from [<c0323fe8>] (__fimc_md_set_camclk+0x208/0x20c)
[   20.125000] [<c0323fe8>] (__fimc_md_set_camclk+0x208/0x20c) from [<c0324368>] (__fimc_pipeline_close+0x38/0x48)
[   20.135000] [<c0324368>] (__fimc_pipeline_close+0x38/0x48) from [<c0325848>] (fimc_md_link_notify+0x10c/0x198)
[   20.145000] [<c0325848>] (fimc_md_link_notify+0x10c/0x198) from [<c02f9dd4>] (__media_entity_setup_link+0x1c0/0x1e8)
[   20.155000] [<c02f9dd4>] (__media_entity_setup_link+0x1c0/0x1e8) from [<c02f9710>] (media_device_ioctl+0x2c0/0x41c)
[   20.165000] [<c02f9710>] (media_device_ioctl+0x2c0/0x41c) from [<c02f9938>] (media_ioctl+0x30/0x34)
[   20.175000] [<c02f9938>] (media_ioctl+0x30/0x34) from [<c00cf0bc>] (do_vfs_ioctl+0x84/0x5e8)
[   20.185000] [<c00cf0bc>] (do_vfs_ioctl+0x84/0x5e8) from [<c00cf65c>] (sys_ioctl+0x3c/0x60)
[   20.190000] [<c00cf65c>] (sys_ioctl+0x3c/0x60) from [<c000f040>] (ret_fast_syscall+0x0/0x30)

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-03-21 18:24:57 -03:00
Arun Kumar K 053e09f319 [media] s5p-mfc: Fix encoder control 15 issue
mfc-encoder is not working in the latest kernel giving the
erorr "Adding control (15) failed". Adding the missing step
parameter in this control to fix the issue.

Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:24:38 -03:00
Arun Kumar K 90c0ae5009 [media] s5p-mfc: Fix frame skip bug
The issue was seen in VP8 decoding where the last frame was
skipped by the driver. This patch gets the correct frame_type value
to fix this bug.

Signed-off-by: Arun Kumar K <arun.kk@samsung.com>
Signed-off-by: Arun Mankuzhi <arun.m@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:24:07 -03:00
Shaik Ameer Basha e34a89b397 [media] s5p-fimc: send valid m2m ctx to fimc_m2m_job_finish
fimc_m2m_job_finish() has to be called with the m2m context for the necessary
cleanup while resume. But currently fimc_m2m_job_finish() always passes m2m
context as NULL.
This patch preserves the context before making it null, for necessary cleanup.

Signed-off-by: Shaik Ameer Basha <shaik.ameer@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:23:21 -03:00
Shaik Ameer Basha 5d83790be7 [media] exynos-gsc: send valid m2m ctx to gsc_m2m_job_finish
gsc_m2m_job_finish() has to be called with the m2m context for the necessary
cleanup while resume. But currently gsc_m2m_job_finish() always passes m2m
context as NULL.
This patch preserves the context before making it null, for necessary cleanup.
Use gsc_m2m_opened() instead gsc_m2m_active() in gsc_resume().

Signed-off-by: Shaik Ameer Basha <shaik.ameer@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:23:06 -03:00
Shaik Ameer Basha 6a5360966a [media] fimc-lite: Fix the variable type to avoid possible crash
Changing the variable type to 'int' from 'unsigned int'. Driver
logic expects the variable type to be 'int'.

Signed-off-by: Shaik Ameer Basha <shaik.ameer@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:22:43 -03:00
Shaik Ameer Basha 4cec1893d8 [media] fimc-lite: Initialize 'step' field in fimc_lite_ctrl structure
v4l2_ctrl_new() uses check_range() for control range checking.
This function expects 'step' value for V4L2_CTRL_TYPE_BOOLEAN type control.
If 'step' value doesn't match to '1', it returns -ERANGE error.
This patch adds the default .step value to 1.

Signed-off-by: Shaik Ameer Basha <shaik.ameer@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 18:22:08 -03:00
Dmitri Belimov 01ae72866d [media] xc5000: fix incorrect debug printnk
I found very small bug in xc5000 source. When set option debug=1 and
listen a radio we see in dmesg xc5000: xc_SetTVStandard()
Standard = M/N-NTSC/PAL-BTSC at all times. However, it should be, instead
"FM Radio-INPUT1_MONO".

That happens because xc5000_set_radio_freq() gets the correct value for
VideoMode and AudioMode for radio and calls xc_SetTVStandard() where name
of standard comes from the incorrect place priv->video_standard.

This incorrect debug message makes debugging  a little difficult.

Signed-off-by: Dmitry Belimov <d.belimov@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 16:46:05 -03:00
Paul Bolle b3d9a15d9a [media] soc_camera: remove two outdated selects
Release v2.6.30 removed the MT9M001_PCA9536_SWITCH and
MT9V022_PCA9536_SWITCH Kconfig symbols, in commits
36034dc325 ("V4L/DVB (11032): mt9m001:
allow setting of bus width from board code") and
e958e27ade ("V4L/DVB (11033): mt9v022:
allow setting of bus width from board code").
These two commits removed all gpio related code from these two drivers.
But they skipped removing their two selects of GPIO_PCA953X. Remove
these now as they are outdated. Their dependencies can never evaluate to
true anyhow.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:36:05 -03:00
Sachin Kamat b3fd87bc35 [media] sh_vou: Use module_platform_driver_probe macro
module_platform_driver_probe() eliminates the boilerplate and simplifies
the code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:35:50 -03:00
Sachin Kamat 6647b9c003 [media] sh_veu: Use module_platform_driver_probe macro
module_platform_driver_probe() eliminates the boilerplate and simplifies
the code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:35:39 -03:00
Sachin Kamat bd3b4a3fde [media] soc_camera/mx1_camera: Use module_platform_driver_probe macro
module_platform_driver_probe() eliminates the boilerplate and simplifies
the code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:35:27 -03:00
Sachin Kamat f2b4dc1a0f [media] sh_veu.c: Convert to devm_ioremap_resource()
Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() which provides more consistent error handling.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:35:14 -03:00
Sachin Kamat 8efdb13543 [media] soc_camera/pxa_camera: Convert to devm_ioremap_resource()
Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() which provides more consistent error handling.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:34:35 -03:00
Sachin Kamat 2e2d612d80 [media] soc_camera/sh_mobile_csi2: Convert to devm_ioremap_resource()
Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() which provides more consistent error handling.
devm_ioremap_resource() provides its own error messages; so all explicit
error messages can be removed from the failure code paths.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:33:31 -03:00
Sachin Kamat 15a0934201 [media] soc_camera/sh_mobile_ceu_camera: Convert to devm_ioremap_resource()
Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() which provides more consistent error handling.
devm_ioremap_resource() provides its own error messages; so all explicit
error messages can be removed from the failure code paths.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:33:08 -03:00
Andrei Andreyanau bff7993936 [media] mt9v022 driver: send valid HORIZONTAL_BLANKING values to mt9v024 soc camera
This patch fixes the issue that appears when mt9v024 camera is used with the
mt9v022 soc camera driver. The minimum total row time is 690 columns
(horizontal width + horizontal blanking). The minimum horizontal
blanking is 61. Thus, when the window width is set below 627, horizontal blanking must
be increased. For the mt9v024 camera the values above are correct and
for the mt9v022 camera the correct values are in the existing kernel driver.

Signed-off-by: Andrei Andreyanau <a.andreyanau@sam-solutions.net>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:19:50 -03:00
Guennadi Liakhovetski 4a1313c447 [media] mt9m111: fix Oops - initialise context before dereferencing
A recent commit "[media] soc-camera: Push probe-time power management to
drivers" causes an Oops during mt9m111 driver probing because its .ctx
private data field is now dereferenced before it is initialised. Fix this
by initialising the field earlier.

Reported-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Tested-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:19:03 -03:00
Benoît Thébaudeau cbaa5c54cb [media] soc-camera: mt9m111: Fix auto-exposure control
Commit f9bd584365 changed V4L2_CID_EXPOSURE_AUTO
from boolean to enum, and commit af8425c54b
changed the creation of this control into a menu for the mt9m111. However,
mt9m111_set_autoexposure() is still interpreting the value set for this control
as a boolean, which also conflicts with the default value of this control set to
V4L2_EXPOSURE_AUTO (0).
This patch makes mt9m111_set_autoexposure() interpret the value set for
V4L2_CID_EXPOSURE_AUTO as defined by enum v4l2_exposure_auto_type.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Tested-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:18:38 -03:00
Paul Bolle d65fcbb000 [media] ts2020: use customise option correctly
The Kconfig entry for "TS2020 based tuners" defaults to modular if
DVB_FE_CUSTOMISE is set. But that Kconfig symbol was replaced with
MEDIA_SUBDRV_AUTOSELECT as of v3.7. So use the new symbol. And negate
the logic, so we are in line with all the similar entries in this file.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:11:12 -03:00
Manjunath Hadli 5b38b0f88d [media] media: tvp514x: enable TVP514X for media controller based usage
add support for TVP514x as a media entity and support for
pad operations. The decoder supports 1 output pad.
The default format code was V4L2_MBUS_FMT_YUYV10_2X10
changed it to V4L2_MBUS_FMT_UYVY8_2X8.

Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:06:29 -03:00
Lad, Prabhakar 88da0183eb [media] media: ths7353: add support for ths7353 video amplifier
The patch adds support for THS7353 video amplifier.
The the THS7353 amplifier is very much similar to the
existing THS7303 video amplifier driver.
This patch appropriately makes changes to the existing
ths7303 driver and adds support for the THS7353.
This patch also adds V4L2_IDENT_THS7353 for the THS7353
chip and appropriate changes to Kconfig file for building.

Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Martin Bugge <marbugge@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 14:04:47 -03:00
Hans Verkuil ffdc78efe1 [media] vb2-dma-sg: add debug module option
This prevents the kernel log from being spammed with these messages.
By turning on the debug option you will see them again.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 13:25:15 -03:00
Hans Verkuil b6ba2057f7 [media] videobuf2: add gfp_flags
Some drivers have special memory requirements for their buffers, usually
related to DMA (e.g. GFP_DMA or __GFP_DMA32). Make it possible to specify
additional GFP flags for those buffers by adding a gfp_flags field to
vb2_queue.
Note that this field will be replaced in the future with a different
mechanism, but that is still work in progress and we need this feature
now so we won't be able to convert drivers with such requirements to vb2.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Federico Vaga <federico.vaga@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 13:17:51 -03:00
Mauro Carvalho Chehab 808d24d6c0 [media] dvb-core: don't clear stats at DTV_CLEAR
The stats are cleared by the frontend. Don't do it at DTV_CLEAR.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 10:27:35 -03:00
Mauro Carvalho Chehab 340e76965c [media] drxk: Fix bogus signal strength indicator
The DVBv3 signal strength indicator is bogus: it doesn't range
from 0 to 65535 as it would be expected. Also, 0 means the max
signal strength.
Now that a better way to estimate it was added, use the new
way.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 10:27:21 -03:00
Mauro Carvalho Chehab 59a7a23c47 [media] drxk: use a better calculus for RF strength
The AZ6007 driver released by Terratec has a better way to
estimate the signal strength, at CtrlSigStrength(). Port it
to the driver.
It should be noticed that there are two parameters there that
are tuner-specific.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 10:27:05 -03:00
Mauro Carvalho Chehab 8f3741e028 [media] drxk: Add pre/post BER and PER/UCB stats
The original az6007 driver has the code to calculate such
stats. Add it to the driver, reporting them via DVBv5
stats API.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 10:26:50 -03:00
Mauro Carvalho Chehab 2b0e1f3afd [media] drxk: remove dummy BER read code
The BER code does nothing but filling it with zero. Remove it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 10:25:59 -03:00
Mauro Carvalho Chehab 2bf0f93e0d [media] siano: make some functions static
drivers/media/common/siano/smsdvb-debugfs.c:51:6: warning: no previous prototype for 'smsdvb_print_dvb_stats' [-Wmissing-prototypes]
drivers/media/common/siano/smsdvb-debugfs.c:154:6: warning: no previous prototype for 'smsdvb_print_isdb_stats' [-Wmissing-prototypes]
drivers/media/common/siano/smsdvb-debugfs.c:244:6: warning: no previous prototype for 'smsdvb_print_isdb_stats_ex' [-Wmissing-prototypes]
drivers/media/common/siano/smscoreapi.c:832:5: warning: no previous prototype for 'smscore_configure_board' [-Wmissing-prototypes]
drivers/media/common/siano/smscoreapi.c:1301:5: warning: no previous prototype for 'smscore_init_device' [-Wmissing-prototypes]

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 10:04:01 -03:00
Mauro Carvalho Chehab 05ad412a63 [media] siano: Fix the remaining checkpatch.pl compliants
Fix all other remaining checkpatch.pl compliants on the Siano driver,
except for the 80-cols (soft) limit. Those are harder to fix, and
probably not worth to do right now.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 10:03:53 -03:00
Mauro Carvalho Chehab 28a59df4d7 [media] siano: remove the remaining CamelCase compliants
Remove the remaining CamelCase checkpatch.pl compliants.
There are still a few left, but those are due to USB and
DVB APIs.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 10:03:45 -03:00
Mauro Carvalho Chehab 90414248bf [media] siano: fix checkpatch.pl compliants on smscoreapi.h
Fix the remaining checkpatch.pl compliants at smscoreapi.h,
except by the "line over 80 characters" on comments. Fixing those
would require more time, as the better is to convert them into the
struct descriptions used inside the kernel, as described at:
	Documentation/kernel-doc-nano-HOWTO.txt

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 10:03:34 -03:00
Mauro Carvalho Chehab cf0e9cfcc7 [media] siano: convert structure names to lowercase
There are several structures defined in uppercase. Convert them
to lowercase, and simplify their names, when possible.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 10:03:27 -03:00
Mauro Carvalho Chehab dfef84fc13 [media] siano: get rid of CammelCase from smscoreapi.h
It is almost impossible to see a compliant with checkpatch.pl
on those Siano drivers, as there are simply too much violations
on it. So, now that a big change was done, the better is to
cleanup the checkpatch compliants.

Let's first replace all CammelCase symbols found at smscoreapi.h
using camel_case namespace. That removed 144 checkpatch.pl
compliants on this file. Of course, the other files need to be
fixed accordingly.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 10:03:16 -03:00
Heiko Carstens 6c43a51961 drivers/Kconfig: add several missing GENERIC_HARDIRQS dependencies
With this patch an allmodconfig finally builds on s390 again.

Fixes these build errors:

ERROR: "devm_request_threaded_irq" [drivers/spi/spi-altera.ko] undefined!
ERROR: "devm_request_threaded_irq" [drivers/media/platform/sh_veu.ko] undefined!
ERROR: "devm_request_threaded_irq" [drivers/dma/dw_dmac.ko] undefined!

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2013-03-21 13:35:37 +01:00
Mauro Carvalho Chehab c8b8fdb39d [media] siano: add MODULE_FIRMWARE() macros
This driver can use several firmwares. Provide such info at
module firmware metadata.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:54:21 -03:00
Mauro Carvalho Chehab 11ad03a563 [media] siano: use defines for firmware names
There are too many firmwares there. As we need to add
MODULE_FIMWARE() macros, the better is to define their names
on just one place and use the macros for both cards/device type
tables and MODULE_FIRMWARE().

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:54:13 -03:00
Mauro Carvalho Chehab d8a18e88c9 [media] siano: Remove bogus complain about MSG_SMS_DVBT_BDA_DATA
When the driver is tuned into chanel, and it is removed/reinserted,
the message stream data may be arriving during device probe:
	[ 5680.162004] smscore_set_device_mode: set device mode to 6
	[ 5680.162267] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.162391] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.162641] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.162891] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.163016] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.163266] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.163516] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.163640] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.163891] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.164016] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.164265] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.164515] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.164519] smscore_onresponse: Firmware id 6 prots 0x40 ver 8.1
	[ 5680.164766] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.166018] smscore_onresponse: message MSG_SMS_DVBT_BDA_DATA(693) not handled.
	[ 5680.166438] DVB: registering new adapter (Siano Rio Digital Receiver)
Instead of complaining, just silently discard those messages, instead of
complaining.
A proper fix is to put the device on suspend/power down mode when the module
is removed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:53:59 -03:00
Mauro Carvalho Chehab 98c3f94e6d [media] siano: remove doubled new line
sms_debug() and sms_info() already adds a '\n' at the printed
strings. No need to add more.
That helps to cleanup stuff like:
	[ 4868.205648] smscore_onresponse: message not handled.
	[ 4868.205898] smscore_onresponse: message not handled.
and:
	[ 5467.959769] smscore_onresponse:
	data rate 143069 bytes/secs
While here, provides the message name, when the message is not
handled by the smsmdtv core.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:53:50 -03:00
Mauro Carvalho Chehab 07bb6bdddf [media] siano: remove a bogus printk line
The logic that detects the types of sms devices is bogus. It returns
	[ 4645.187790] smsusb_init_device: line: 372: Unspecified sms device type!
For several devices, including the one I have (SMS_RIO). In a matter
of fact, the right thing to do there is to print an error only if
the device is really unknown (SMS_UNKNOWN_TYPE).

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:53:42 -03:00
Mauro Carvalho Chehab 2a7643159d [media] siano: reorder smscore_get_fw_filename() function
Put this function earlier in the code, to avoid the need of
defining a function stub.
No functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:53:26 -03:00
Mauro Carvalho Chehab e584f9d61e [media] siano: remove the bogus firmware lookup code
There is an special lookup code that is called when
SMS_BOARD_UNKNOWN. The logic there is bogus and will cause
an oops, as .type is SMS_UNKNOWN_TYPE (-1).
As the code would do:
	return smscore_fw_lkup[type][mode];
That would mean that it would try to go past the
smscore_fw_lkup table.
So, just remove that bogus code, simplifying the logic.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:52:57 -03:00
Mauro Carvalho Chehab 9711a8a600 [media] siano: honour per-card default mode
Instead of using a global default_mode, passed via modprobe
parameter, use the one defined inside the cards struct.
That will prevent the need of manually specify it for each
board, except, of course, if the user wants to do something
different, on boards that accept multiple types.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:52:48 -03:00
Mauro Carvalho Chehab 5ac14b6011 [media] siano: simplify firmware lookup logic
There are two ways to specify firmware for siano devices: a
per-device ID and a per-device type.
The per-device type logic is currently made by a 11x9 string
table, sparsely filled. It is very hard to read the table at
the source code, as there are too much "none" filling there
("none" there is a way to tell NULL).
Instead of using such problematic table, convert it into an
easy to read table, where the unused values will be defaulted
to NULL.
While here, also simplifies a little bit the logic and print
a message if an user-selected mode doesn't exist.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:52:37 -03:00
Mauro Carvalho Chehab 6a28bd94f4 [media] siano: add support for .poll on debugfs
Implement poll() method for debugfs and be sure that the
debug_data won't be freed on ir or on read().
With this change, poll() will return POLLIN if either data was
filled or if data was read. That allows read() to return 0
to indicate EOF in the latter case.
As poll() is now provided, fix support for non-block mode.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:52:29 -03:00
Mauro Carvalho Chehab 773adad141 [media] siano: fix status report with old firmware and ISDB-T
This seems to be ever broken. That's the status report with
Firmware 2.1, before adding support for sms2270 is:
[22273.787218] smsdvb_onresponse: MSG_SMS_GET_STATISTICS_RES
[22273.792592] IsRfLocked = 1
[22273.792592] IsDemodLocked = 1
...
[22273.792598] TransmissionMode = -64
...
(all unshown fields are filled with zeros)
Of course, transmission mode being a negative number is wrong.
So, we need to take a deeper look on it.
With the debugfs patches applied, it is possible to see that, instead
of filling StatisticsType with 5, and FullSize with the size of the
payload (this is what happens with sms2270 and firmware 8.1),
those fields are also initialized with zero:
StatisticsType = 0	FullSize = 0
IsRfLocked = 1		IsDemodLocked = 1	IsExternalLNAOn = 0
SNR = 0 dB		RSSI = 0 dBm		InBandPwr = 0 dBm
CarrierOffset = 0	Bandwidth = 0		Frequency = 0 Hz
TransmissionMode = -64	ModemState = 0		GuardInterval = 0
SystemType = 0		PartialReception = 0	NumOfLayers = 0
SmsToHostTxErrors = 0
The data under "TransmissionMode" varies according with the signal,
and it is negative. It also matches the value for InBandPwr when
the tuner is on DVB-T (ok, signal doesn't lock, but the power level
should be about the same with the antena fixed, and measured at about
the same time).
So, there's a very high chance that, when StatisticsType is zero, the
signal strength is at the same position as Transmission Mode.
So, discard all other parameters, and provide only signal/rf lock and
signal strength if StatisticsType is 0, for ISDB-T.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:52:16 -03:00
Mauro Carvalho Chehab e1b2ac4d1e [media] siano: Only feed DVB data when there's a feed
Right now, the driver sends DVB data even before tunning.
It was noticed that this may lead into some mistakes at DVB
decode, as the PIDs from wrong channels may be associated with
another frequency, as they may already be inside the PID buffers.
So, prevent it by not feeding DVB demux with data while there's no
feed or while the device is not tuned.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:52:05 -03:00
Mauro Carvalho Chehab 5c3b87435b [media] siano: Fix bandwidth report
It was expected that the bandwidth would be following the defines
at smscoreapi.h. However, this doesn't work. Instead, this field
brings just the bandwidth in MHz. Convert it to Hertz.
It should be noticed that, on ISDB, using the _EX request, the
field TuneBW seems to show the value that matches the bandwidth
code.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:51:47 -03:00
Mauro Carvalho Chehab 9671045f4c [media] siano: fix PER/BER report on DVBv5
The check for lock logic is broken. Due to that, no PER/BER
stats will ever be showed, and the DVBV3 events will be wrong.
Also, the per-layer PER/BER stats for ISDB-T are filled with
the wrong index.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:49:32 -03:00
Mauro Carvalho Chehab f5de95e246 [media] siano: fix signal strength and CNR stats measurements
There are a number of small issues with the stats refactoring:
	- InBandPwr better represents the signal strength;
	- Don't zero signal strength /cnr if no lock;
	- Fix signal strength/cnr scale;
	- Don't need to fill PER/BER if not locked, as the
	  code will disable those stats anyway.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:49:17 -03:00
Mauro Carvalho Chehab a9b9fbdf0a [media] siano: don't request statistics too fast
As each DVBv3 call may generate an stats overhead, prevent doing
it too fast. This is specially useful if a burst of get stats
DVBv3 call is sent.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:49:04 -03:00
Mauro Carvalho Chehab 4cce1f4eb2 [media] siano: add two missing fields to ISDB-T stats debugfs
Those fields help to identify the version of the ISDB stats.
Useful while debuging the driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:48:49 -03:00
Mauro Carvalho Chehab 503efe5cfc [media] siano: split debugfs code into a separate file
To avoid mixing two different things at the same place, move the
debugfs code into a separate file.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:48:41 -03:00
Mauro Carvalho Chehab 3f6b87cff6 [media] siano: allow showing the complete statistics via debugfs
Outputs the result of the statistics responses via debugfs.
That can help to track bugs at the stats filling.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:47:49 -03:00
Mauro Carvalho Chehab c02272f9b9 [media] siano: fix start of statistics
It seems that the first u32 after the header for some stats are used by
something not documented.
The stats struct starts after it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:47:39 -03:00
Mauro Carvalho Chehab d42f1cb253 [media] siano: Convert it to report DVBv5 stats
While this frontend provides a nice set of statistics, the
way it is currently reported to userspace is poor. Worse than
that, instead of using quality indicators that range from 0 to 65535,
as expected by userspace, most indicators range from 0 to 100.
Improve it by using DVBv5 statistics API. The legacy indicators
are still reported using the very same old way, but they're now
using a proper range (0 to 65535 for quality indicadors; 0.1 dB
for SNR).

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:47:31 -03:00
Mauro Carvalho Chehab ff702eb8d9 [media] siano: split debug logic from the status update routine
It is confusing to merge both status updates with debug stuff.
Also, it is a better idea to move those status updates to
debugfs, instead of doing a large amount of printk's like that.
So, break them into a separate block of routines.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:47:18 -03:00
Mauro Carvalho Chehab eab0fa0f04 [media] siano: split get_frontend into per-std functions
Instead of handling both DVB-T and ISDB-T at the same get_frontend
function, break it intow one function per-delivery system.
That makes the code clearer as we start to add support for DVBv5
statistics, and for ISDB-T get frontend stuff.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:46:56 -03:00
Mauro Carvalho Chehab 80ccb51a0f [media] siano: simplify message endianness logic
Currently, every time a message is sent or received, the endiannes
need to be fixed on big endian machines. This is currently done
on every call to the send API, and on every msg reception logic.
Instead of doing that, move it to the send/receive functions.
That simplifies the logic and avoids the risk of forgetting to
fix it somewhere.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:46:18 -03:00
Mauro Carvalho Chehab fe802fd92d [media] siano: call MSG_SMS_INIT_DEVICE_REQ
Newer firmwares seem to require an init device message. Apply
such change from Doron Cohen's patch:
	http://patchwork.linuxtv.org/patch/7889/

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:45:36 -03:00
Mauro Carvalho Chehab dfbf021c9e [media] siano: Configure board's mtu and xtal
Backported from Doron Cohen's patch:
	http://patchwork.linuxtv.org/patch/7889/

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:45:25 -03:00
Mauro Carvalho Chehab 347d8f1fa6 [media] siano: add new devices to the Siano Driver
This patch is based on Doron Cohen's patches:
	http://patchwork.linuxtv.org/patch/7881/
	http://patchwork.linuxtv.org/patch/7888/
	http://patchwork.linuxtv.org/patch/7883/
It basically merges the above patches, rebasing them to
the macro definitions used upstream, with are different
 than the ones used by them internally.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:45:06 -03:00
Mauro Carvalho Chehab b4059095ab [media] siano: use the newer stats message for recent firmwares
The old statistics request don't work with newer firmwares.
Add a logic to use the newer stats if firmware major is 8.
Note that I have only 2 devices here, one with firmware 2.1
(Hauppauge model 55009 Rev B1F7) and another one with
firmware 8.1. We may need to adjust the firmware minimal
version for the *_EX message variants, as we start finding
firmware versions between 2.x and 8.x.
This patch was based on Doron Cohen patch:
	http://patchwork.linuxtv.org/patch/7886/

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:44:31 -03:00
Mauro Carvalho Chehab 0c189fa69e [media] siano: add support for LNA on ISDB-T
The very same code also exists for DVB-T. Add it for ISDB-T.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:44:05 -03:00
Mauro Carvalho Chehab a51fea4fdb [media] siano: add support for ISDB-T full-seg
Fix the DVBv5 API handling for ISDB-T and add support
for 13 segments.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:43:54 -03:00
Mauro Carvalho Chehab 76e41a655a [media] siano: use a separate completion for stats
Instead of re-use tune_done also for stats, the better is to use
a different completion.
Also, it was noticed that sometimes, the driver answers with
MSG_SMS_SIGNAL_DETECTED_IND for status request. Fix the code to
also handle those other signal indicators.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:43:31 -03:00
Mauro Carvalho Chehab faab6820b3 [media] siano: add some new messages to the smscoreapi
Based on Doron Cohen's patch:
	http://patchwork.linuxtv.org/patch/7887/

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:43:09 -03:00
Mauro Carvalho Chehab e5d218ee75 [media] siano: cleanups at smscoreapi.c
Some cleanups at smscoreapi. Most are just CodingStyle.
Also, use kzalloc when allocating a new buffer, as it initializes
the allocated space with zero.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:42:19 -03:00
Mauro Carvalho Chehab 9e915e5bc8 [media] siano: always load smsdvb
Without smsdvb, the driver actually does nothing, as it
lacks the userspace API.
While I wrote it independently, in order to make a sms2270 board
I have here to work, this patch is functionally identical to this
patch from Doron Cohen:
	http://patchwork.linuxtv.org/patch/7894/

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:41:59 -03:00
Mauro Carvalho Chehab 1e19c21ec7 [media] siano: fix the debug message
Instead of displaying this:
	[   61.869415] smscore_load_firmware_family2: rc=0, postload=0x          (null)
Display, instead:
	[ 1348.441160] smscore_load_firmware_family2: rc=0

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:41:42 -03:00
Mauro Carvalho Chehab ab7bdb1298 [media] siano: report the choosed firmware in debug
Don't keep in the dark: report the firmware file name after
lookup. That helps to debug what's happening when a firmware is not
found.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:41:06 -03:00
Mauro Carvalho Chehab 018b0c6f8a [media] siano: make load firmware logic to work with newer firmwares
There are new firmwares for sms2xxx devices. Change the firmware
load logic to handle those newer firmwares and devices.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:40:05 -03:00
Mauro Carvalho Chehab 7333839505 [media] siano: store firmware version
As there are some changes that seem to be firmware-dependent,
we need to store the firmware version, as we don't want to break
support for existing cards that use a legacy (and sometimes
custom) firmware.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:38:16 -03:00
Mauro Carvalho Chehab 05f0ffbc48 [media] siano: use USB endpoint descriptors for in/out endp
Instead of using hardcoded descriptors, detect them from the
USB descriptors.
This patch is rebased form Doron Cohen's patch:
	http://patchwork.linuxtv.org/patch/7883/

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:38:02 -03:00
Mauro Carvalho Chehab db30567a63 [media] siano: add additional attributes to cards entries
Those attributes will be used by the newer sms2xxx cards.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:37:39 -03:00
Mauro Carvalho Chehab 3ba92d0b58 [media] siano: Properly initialize board information
Board #0 is an existing one. Instead of initializing the driver
with it, use a different value to detect if board is unknown.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:36:51 -03:00
Mauro Carvalho Chehab ab2b599ebf [media] siano: add the remaining new defines from new driver
Add the remaining new defines/enums from Doron Cohen's patch:
        http://patchwork.linuxtv.org/patch/7882/

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:36:42 -03:00
Mauro Carvalho Chehab 4c3bdb5e2f [media] siano: better debug send/receive messages
Instead of printing a message for some random messages, print
it for all sent/received ones. That helps a lot to debug
what's going on.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:35:49 -03:00
Mauro Carvalho Chehab f251001c80 [media] siano: update message macros
Convert from #define into an enum and add the newer message
macros as found on this patch from Doron Cohen:
	http://patchwork.linuxtv.org/patch/7882/
No messages got supressed.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:33:26 -03:00
Mauro Carvalho Chehab c31b9fb260 [media] siano: remove a duplicated structure definition
The same GPIO config struct was declared twice at the
driver, with different names and different macros:
	struct smscore_config_gpio
	struct smscore_config_gpio
Remove the one that uses CamelCase and fix the references to
its attributes/macros.
No functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:12:51 -03:00
Mauro Carvalho Chehab 739a8c91a3 [media] siano: Add the new voltage definitions for GPIO
Those new definitions came from this patch, from Doron Cohen:
	http://patchwork.linuxtv.org/patch/7882/

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:10:17 -03:00
Mauro Carvalho Chehab f82757d912 [media] siano: Change GPIO voltage setting names
Siano changed the namespace on more recent API, and re-used some
of the old names. In order to be able to update the API to support
newer chips, the better is to follow this change.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-21 07:10:06 -03:00
Masanari Iida 07f4225889 treewide: Fix typos in printk
Correct spelling typo in various drivers.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-03-20 16:26:32 +01:00
Lad, Prabhakar 0ea21a5240 [media] davinci: vpbe: fix module build
add a null entry in platform_device_id {}.
This patch fixes following error:
drivers/media/platform/davinci/vpbe_venc: struct platform_device_id is 24 bytes.  The last of 3 is:
0x64 0x6d 0x33 0x35 0x35 0x2c 0x76 0x70 0x62 0x65 0x2d 0x76 0x65 0x6e 0x63 0x00 0x00 0x00 0x00 0x00 0x03 0x00 0x00 0x00
FATAL: drivers/media/platform/davinci/vpbe_venc: struct platform_device_id is not terminated with a NULL entry!
make[1]: *** [__modpost] Error 1

Reported-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-19 17:53:04 -03:00
Hans Verkuil a8451ed205 [media] blackfin: replace V4L2_IN/OUT_CAP_CUSTOM_TIMINGS by DV_TIMINGS
The use of V4L2_IN/OUT_CAP_CUSTOM_TIMINGS is obsolete, use DV_TIMINGS instead.
Note that V4L2_IN/OUT_CAP_CUSTOM_TIMINGS is just a #define for
V4L2_IN/OUT_CAP_DV_TIMINGS.
At some point in the future these CUSTOM_TIMINGS defines might be removed.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-19 16:16:41 -03:00
Hans Verkuil db242f62bd [media] davinci: more gama -> gamma typo fixes
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-19 16:16:23 -03:00
Hans Verkuil 1de1951930 [media] davinci/dm644x_ccdc: fix compiler warning
drivers/media/platform/davinci/dm644x_ccdc.c: In function ‘validate_ccdc_param’:
drivers/media/platform/davinci/dm644x_ccdc.c:233:32: warning: comparison between ‘enum ccdc_gama_width’ and ‘enum ccdc_data_size’ [-Wenum-compare]
It took a bit of work, see this thread of an earlier attempt to fix this:
https://patchwork.kernel.org/patch/1923091/
I've chosen not to follow the suggestions in that thread since gamma_width is
really a different property from data_size. What you really want is to know if
gamma_width fits inside data_size and for that you need to translate each
enum into a maximum bit number so you can safely compare the two.
So I put in two static inline translation functions instead, keeping the rest
of the code the same (except for fixing the 'gama' typo).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-19 16:16:04 -03:00
Hans Verkuil b12aed0ec5 [media] davinci/vpfe_capture: remove current_norm
Since vpfe_capture already provided a g_std op setting current_norm
does not actually do anything. Remove it.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-19 16:15:27 -03:00
Hans Verkuil 142b66e82c [media] davinci/vpbe_display: remove deprecated current_norm
Since vpbe_display already provides a g_std op setting current_norm
didn't do anything. Remove that code.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-19 16:15:13 -03:00
Hans Verkuil 6f55dbaea5 [media] davinci/vpfe_capture: convert to the control framework
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-19 16:14:59 -03:00
Hans Verkuil ef2d41b19b [media] davinci: remove VPBE_ENC_DV_PRESET and rename VPBE_ENC_CUSTOM_TIMINGS
Remove VPBE_ENC_DV_PRESET (the DV_PRESET API is no longer supported) and
VPBE_ENC_CUSTOM_TIMINGS is renamed to VPBE_ENC_DV_TIMINGS since the old
"CUSTOM_TIMINGS" name is deprecated in favor of "DV_TIMINGS".

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Acked-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-19 16:09:53 -03:00
Hans Verkuil 416d307651 [media] tvp7002: remove dv_preset support
Finally remove the dv_preset support from this driver. Note that dv_preset
support was already removed from any bridge drivers that use this i2c
driver, so the dv_preset ops were no longer called and can be removed
safely.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-19 16:08:56 -03:00
Hans Verkuil f96067af1f [media] tvp7002: use dv_timings structs instead of presets
In the functions tvp7002_mbus_fmt(), tvp7002_log_status and tvp7002_probe()
we should use the dv_timings data structures instead of dv_preset data
structures and functions.
This is the second step towards removing the deprecated preset support of this
driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-19 16:07:59 -03:00
Hans Verkuil f0cd015e31 [media] tvp7002: replace 'preset' by 'timings' in various structs/variables
This is the first step towards removing the deprecated preset support of this
driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.lad@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-19 16:07:21 -03:00
Andrey Pavlenko f08e9f0d5c [media] [1/1,dvb-usb] GOTVIEW SatelliteHD card support
Added support for the GOTVIEW SatelliteHD card which is based on
Montage M88DS3000 and works very well with this driver.

Signed-off-by: Andrey Pavlenko <andrey.a.pavlenko@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-19 16:00:40 -03:00
David Härdeman 40fc5325e1 [media] rc-core: rename ir_input_class to rc_class
The name is already misleading and will be more so in the future as the
connection to the input subsystem is obscured away further.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-19 15:26:59 -03:00
David Härdeman e76d4ce49f [media] rc-core: initialize rc-core earlier if built-in
rc-core is a subsystem so it should be registered earlier if built into the
kernel.

Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-19 15:26:37 -03:00
Syam Sidhardhan 72873e51c5 [media] lmedm04: Remove redundant NULL check before kfree
kfree on NULL pointer is a no-op.

Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-19 15:19:29 -03:00
John Smith 5144f5b760 [media] dvb_demux: Transport stream continuity check fix
This patch avoids incrementing continuity counter
demux->cnt_storage[pid] for TS packets without payload in accordance
with ISO /IEC 13818-1.

[mchehab@redhat.com: unmangle whitespacing and fix CodingStyle.
 Also checked ISO/IEC spec: patch is according with it]
Reviewed-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: John Smith <johns90812@gmail.com>

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-19 15:14:06 -03:00
Sean Young fa7b9ac2e2 [media] redrat3: missing endian conversions and warnings
Spotted by sparse.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-19 15:14:04 -03:00
Sean Young 4c055a5ae9 [media] redrat3: remove memcpys and fix unaligned memory access
In stead of doing a memcpy from #defined offset, declare structs which
describe the incoming and outgoing data accurately.
Tested on first generation RedRat.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-19 15:14:03 -03:00
Sean Young 801b69f257 [media] redrat3: limit periods to hardware limits
The redrat hardware cannot handle periods of larger than 32767us,
limit appropriately. Also fix memory leak in redrat3_get_timeout.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-19 15:14:00 -03:00
Mauro Carvalho Chehab 4159d01bea [media] em28xx: Add ISDB support for c3tech Digital duo
This is an hybrid board. However, for analog, it requires
a new driver for saa7136. So, for now, let's just add
support for Digital TV.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-19 15:13:50 -03:00
John Sheu 401f6a2729 [media] v4l2-mem2mem: drop rdy_queue on STREAMOFF
When a v4l2-mem2mem context gets a STREAMOFF call on either its CAPTURE
or OUTPUT queues, we should:
* Drop the corresponding rdy_queue, since a subsequent STREAMON expects
  an empty queue.
* Deschedule the context, as it now has at least one empty queue and
  cannot run.

Signed-off-by: John Sheu <sheu@google.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-19 15:13:33 -03:00
Arnd Bergmann e71918ea66 [media] ir: IR_RX51 only works on OMAP2
This driver can be enabled on OMAP1 at the moment, which breaks
allyesconfig for that platform. Let's mark it OMAP2PLUS-only
in Kconfig, since that is the only thing it builds on.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 21:02:04 -03:00
John Sheu f1a0569be6 [media] v4l2-mem2mem: use CAPTURE queue lock
In v4l2_m2m_try_schedule(), use the CAPTURE queue lock when accessing
the CAPTURE queue, instead of relying on just holding the OUTPUT queue
lock.

Signed-off-by: John Sheu <sheu@google.com>
Acked-by: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 20:47:36 -03:00
Sakari Ailus b0a1f2a842 [media] media: implement 32-on-64 bit compat IOCTL handling
Use the same handlers where the structs are the same. Implement a new
handler for link enumeration since struct media_links_enum is different on
32-bit and 64-bit systems.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 20:45:14 -03:00
Sakari Ailus c6c1d50b51 [media] media: Add 64--32 bit compat ioctl handler
Provide an ioctl handler for 32-bit binaries on 64-bit systems.

Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 20:44:36 -03:00
Peter Senna Tschudin cab3e1ffbe [media] cx25821: Cleanup filename assignment code
I'm pasting the original code and my proposal on the commit message for
make it easy to compare the two versions.
Line 62 of cx25821-audio-upstream.h contains:
char *_defaultAudioName = "/root/audioGOOD.wav";
Original code after replace kmemdup for kstrdup, and after fix return error
code:
if (dev->input_audiofilename) {
	dev->_audiofilename = kstrdup(dev->input_audiofilename,
				      GFP_KERNEL);
	if (!dev->_audiofilename) {
		err = -ENOMEM;
		goto error;
	}
	/* Default if filename is empty string */
	if (strcmp(dev->input_audiofilename, "") == 0)
		dev->_audiofilename = "/root/audioGOOD.wav";
} else {
	dev->_audiofilename = kstrdup(_defaultAudioName,
				      GFP_KERNEL);
	if (!dev->_audiofilename) {
		err = -ENOMEM;
		goto error;
	}
}
Code proposed in this patch:
if ((dev->input_audiofilename) &&
    (strcmp(dev->input_audiofilename, "") != 0))
	dev->_audiofilename = kstrdup(dev->input_audiofilename,
				      GFP_KERNEL);
else
	dev->_audiofilename = kstrdup(_defaultAudioName,
				      GFP_KERNEL);
if (!dev->_audiofilename) {
	err = -ENOMEM;
	goto error;
}

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 20:37:09 -03:00
Mauro Carvalho Chehab 52dee392f4 [media] dvb_frontend: Simplify the emulation logic
The current logic was broken and too complex; while it works
fine for DVB-S2/DVB-S, it is broken for ISDB-T.
Make the logic simpler, fixes it for ISDB-T and make it clearer.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 20:33:03 -03:00
Mauro Carvalho Chehab be431b16c6 [media] dvb-frontend: split set_delivery_system()
This function is complex, and has different workflows, one for
DVBv3 calls, and another one for DVBv5 calls. Break it into 3
functions, in order to make easier to understand what each
block does.
No functional changes so far. A few comments got improved.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 20:30:36 -03:00
Frank Schaefer 7f6301d125 [media] em28xx-i2c: relax error check in em28xx_i2c_recv_bytes()
It turned out that some devices return less bytes then requested via i2c when
ALL of the following 3 conditions are met:
- i2c bus B is used
- there was no attempt to write to the specified slave address before
- no device present at the specified slave address
With the current code, this triggers an -EIO error and prints a message to the
system log.
Because it can happen very often during device probing, it is better to ignore
this error and bail out silently after the follwing i2c transaction success
check with -ENODEV.

[mchehab@redhat.com: a small CodingStyle fix]
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 20:18:29 -03:00
Frank Schaefer 195281d0dc [media] em28xx: set the timestamp type for video and vbi vb2_queues
The em28xx driver obtains the timestamps using function v4l2_get_timestamp(),
which produces a montonic timestamp.
Fixes the warnings appearing in the system log since commit 6aa69f99
"[media] vb2: Add support for non monotonic timestamps"

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 20:16:47 -03:00
Mauro Carvalho Chehab aab3125c43 [media] em28xx: add support for registering multiple i2c buses
Register both buses 0 and 1 via I2C API. For now, bus 0 is used
only by eeprom on all known devices. Later patches will be needed
if this changes in the future.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 18:56:27 -03:00
Mauro Carvalho Chehab 3aa2b3b9cc [media] em28xx: Add a separate config dir for secondary bus
Prepare to register a separate bus for the second bus.
For now, just add a new field. A latter patch will add the
bits to make it work.
This patch was generated by this script:
perl -e 'while (<>) { if (s/EM2874_I2C_SECONDARY_BUS_SELECT.*\n//) {
	printf "\t\t.def_i2c_bus  = 1,\n"; $found = 1; print $_ } else { if ($found) { s/^\s+// }; $found = 0; print $_; } }' \
drivers/media/usb/em28xx/em28xx-cards.c >a && mv a drivers/media/usb/em28xx/em28xx-cards.c

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 18:14:52 -03:00
Mauro Carvalho Chehab c7a45e5b4f [media] em28xx: Prepare to support 2 different I2C buses
Newer em28xx devices have 2 buses. Change the logic to allow
using both buses.
This patch was generated by this small script:
for i in drivers/media/usb/em28xx/*.c; do
	sed 's,->i2c_adap,->i2c_adap[dev->def_i2c_bus],g;s,->i2c_client,->i2c_client[dev->def_i2c_bus],'
done
Of course, em28xx.h needed manual edit.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 18:14:15 -03:00
Geert Uytterhoeven da508f5799 [media] media/v4l2: VIDEOBUF2_DMA_CONTIG should depend on HAS_DMA
m68k/sun3:
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’
Make VIDEOBUF2_DMA_CONTIG and VIDEO_SH_VEU (which selects the former and
doesn't have a platform dependency) depend on HAS_DMA to fix this.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 18:03:18 -03:00
Paul Bolle b78a1f3722 [media] m920x: let GCC see 'ret' is used initialized
Since commit 7543f344e9 ("[media] m920x:
factor out a m920x_write_seq() function") building m920x.o triggers this
GCC warning:
    drivers/media/usb/dvb-usb/m920x.c: In function ‘m920x_probe’:
    drivers/media/usb/dvb-usb/m920x.c:91:6: warning: ‘ret’ may be used uninitialized in this function [-Wuninitialized]
This warning is caused by m920x_write_seq(), which is apparently inlined
into m920x_probe(). It is clear why GCC thinks 'ret' may be used
uninitialized. But in practice the first seq->address will always be
non-zero when this function is called. That means we can change the
while()-do{} loop into a do{}-while() loop. And that suffices to make
GCC see that 'ret' will not be used uninitialized.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 17:35:24 -03:00
Sachin Kamat 3c75a2e1cf [media] s5p-mfc: Staticize symbols in s5p_mfc_opr_v5.c
Some symbols are used only in this file. Make them static.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 17:25:30 -03:00
Sachin Kamat b9571a577b [media] s5p-mfc: Staticize symbols in s5p_mfc_opr_v6.c
Symbols used only in this file should be made static.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 17:25:03 -03:00
Sachin Kamat 4294dcf7e3 [media] s5p-mfc: Staticize some symbols in s5p_mfc_cmd_v5.c
These symbols are used only in this file and can be made static.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 17:24:11 -03:00
Sachin Kamat 95a75544cf [media] s5p-mfc: Staticize some symbols in s5p_mfc_cmd_v6.c
Since these symbols are used only in this file, they can be made static.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 17:23:47 -03:00
Matt Gomboc 3ead1ba31b [media] cx231xx : Add support for OTG102 aka EZGrabber2
Thanks for the response, I have done as you suggested.
Below is an updated patch for the OTG102 device against http://git.linuxtv.org/hverkuil/media_tree.git/shortlog/refs/heads/cx231xx, kernel version 3.8.
With further testing it appears the extra clauses in cx231xx-cards.c were not necessary (in static in cx231xx_init_dev and static int cx231xx_usb_probe), so those have been also been removed.

Signed-off-by: Matt Gomboc <gomboc0@gmail.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 17:22:55 -03:00
Syam Sidhardhan 33cef283af [media] dvb-usb: Remove redundant NULL check before kfree
kfree on NULL pointer is a no-op.

Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 17:05:17 -03:00
Syam Sidhardhan f1065c9648 [media] media: tuners: Remove redundant NULL check before kfree
kfree on NULL pointer is a no-op.

Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 17:04:55 -03:00
Syam Sidhardhan 18552ea132 [media] media: ivtv: Remove redundant NULL check before kfree
kfree on NULL pointer is a no-op.

Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 17:04:37 -03:00
Syam Sidhardhan 2da8eab975 [media] siano: Remove redundant NULL check before kfree
kfree on NULL pointer is a no-op.

Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 17:03:41 -03:00
Dmitry Torokhov bf30690029 [media] Media: remove incorrect __init/__exit markups
Even if bus is not hot-pluggable, the devices can be unbound from the
driver via sysfs, so we should not be using __exit annotations on
remove() methods. The only exception is drivers registered with
platform_driver_probe() which specifically disables sysfs bind/unbind
attributes.
Similarly probe() methods should not be marked __init unless
platform_driver_probe() is used.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 16:59:59 -03:00
Antti Palosaari 4458a54c5e [media] anysee: coding style changes
I did what I liked to do. Also corrected two long log writings
as checkpatch.pl was complaining about those.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 16:54:57 -03:00
Antti Palosaari 6c604e8e86 [media] anysee: do not use buffers from stack for usb_bulk_msg()
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 16:54:26 -03:00
Antti Palosaari 3484d37a66 [media] af9035: do not use buffers from stack for usb_bulk_msg()
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 16:53:33 -03:00
Antti Palosaari aff8c2d475 [media] af9015: do not use buffers from stack for usb_bulk_msg()
WARNING: at lib/dma-debug.c:947 check_for_stack+0xa7/0xf0()
ehci-pci 0000:00:04.1: DMA-API: device driver maps memory fromstack

Reported-by: poma <pomidorabelisima@gmail.com>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 16:51:17 -03:00
Antti Palosaari acb0549acc [media] dvb_usb_v2: locked versions of USB bulk IO functions
Implement:
dvb_usbv2_generic_rw_locked()
dvb_usbv2_generic_write_locked()
Caller must hold device lock when locked versions are called.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 16:43:15 -03:00
Syam Sidhardhan 972b072a83 [media] hdpvr: Fix memory leak
This patch fixes the print_buf leaking.

Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 16:39:08 -03:00
Syam Sidhardhan 06f950f43f [media] lmedm04: Fix possible NULL pointer dereference
Check for (adap == NULL) has to done before accessing adap.

Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 16:34:15 -03:00
Thiago Farina 0169ab28b3 [media] media/usb: cx231xx-pcb-cfg.h: Remove unused enum _true_false
Signed-off-by: Thiago Farina <tfarina@chromium.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-14 11:46:07 -03:00
Igor M. Liplianin 44122dd6b6 [media] media: Terratec Cinergy S2 USB HD Rev.2
Terratec Cinergy S2 USB HD Rev.2 support.
This commit is a corrected cherry-pick of 03228792 which got reverted in
b7e38636 because it was rebased incorrectly and introduced compilation
errors.

Signed-off-by: Stephan Hilb <stephan@ecshi.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-14 11:45:36 -03:00
Alexey Khoroshilov c67d2f0740 [media] stv090x: do not unlock unheld mutex in stv090x_sleep()
goto err and goto err_gateoff before mutex_lock(&state->internal->demod_lock)
lead to unlock of unheld mutex in stv090x_sleep().
Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Cc: Manu Abraham <abraham.manu@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-14 11:40:32 -03:00
Sachin Kamat a9fc36afc0 [media] timblogiw: Fix sparse warning
Fixes the below warning:
drivers/media/platform/timblogiw.c:81:31: warning:
symbol 'timblogiw_tvnorms' was not declared. Should it be static?

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-14 11:36:34 -03:00
Fabrizio Gazzato d9b7595bed [media] af9035: add ID [0ccd:00aa] TerraTec Cinergy T Stick (rev. 2)
This patch adds USB ID for alternative "Terratec Cinergy T Stick".
Tested by a friend: works similarly to 0ccd:0093 version (af9035+tua9001)

Signed-off-by: Fabrizio Gazzato <fabrizio.gazzato@gmail.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-14 11:24:03 -03:00
Gianluca Gennari 9bb05696af [media] cx231xx: fix undefined function cx231xx_g_chip_ident()
This patch:
http://git.linuxtv.org/media_tree.git/commit/b86d15440b683f8634c0cb26fc0861a5bc4913ac
is missing a chunk when compared to an older version:
https://patchwork.kernel.org/patch/2063281/
probably because of an unresolved merging conflict.
This causes the following error:
WARNING: "cx231xx_g_chip_ident" [/home/jena/media_build/v4l/cx231xx.ko] undefined!

Signed-off-by: Gianluca Gennari <gennarone@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-14 09:45:55 -03:00
Frank Schaefer 457ba4ce4f [media] bttv: move fini_bttv_i2c() from bttv-input.c to bttv-i2c.c
Like init_bttv_i2c(), fini_bttv_i2c() belongs to bttv-i2c.c.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 17:11:12 -03:00
Frank Schaefer fa56307328 [media] bttv: make remote controls of devices with i2c ir decoder working
Request module ir-kbd-i2c if an i2c ir decoder is detected.
Tested with device "Hauppauge WinTV Theatre" (model 37284 rev B421).

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 17:10:43 -03:00
Fabrizio Gazzato e6a60d768b [media] rtl28xxu: Add USB ID for MaxMedia HU394-T
Add USB ID for MaxMedia HU394-T USB DVB-T Multi (FM, DAB, DAB+)
dongle (RTL2832U+FC0012)

In Italy, is branded as "DIKOM USB-DVBT HD"
lsusb:	ID 1b80:d394 Afatech

Signed-off-by: Fabrizio Gazzato <fabrizio.gazzato@gmail.com>
Acked-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 17:02:54 -03:00
Hans Verkuil 0b84caab36 [media] s2255: fix big-endian support
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 15:42:30 -03:00
Hans Verkuil 5c632b223a [media] s2255: choose YUYV as the default format, not YUV422P
The planar YUV422P is quite unusual and few if any applications support it.
Instead choose the common YUYV format as the default.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 15:41:53 -03:00
Hans Verkuil 05e5d44b07 [media] s2255: Add ENUM_FRAMESIZES support
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 15:41:26 -03:00
Hans Verkuil 3c728118e0 [media] s2255: don't zero struct v4l2_streamparm
All fields after 'type' are already zeroed by the core framework.
Clearing the full struct also clears 'type', which causes a wrong
type value to be returned.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 15:40:25 -03:00
Hans Verkuil 92513611fa [media] s2255: fix field handling
Just set the field value based on the chosen format. It's either INTERLACED
or TOP.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 15:39:57 -03:00
Hans Verkuil 29ceb1101e [media] s2255: zero priv and set colorspace
Set priv field of struct v4l2_pix_format to 0 and fill in colorspace.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 15:37:37 -03:00
Hans Verkuil 469af77a17 [media] s2255: fixes in the way standards are handled
Instead of comparing against STD_NTSC and STD_PAL compare against 60 and
50 Hz formats. That's what you really want.
When the standard is changed, make sure the width and height of the format
are also updated to reflect the current standard.
Also replace the deprecated current_norm by the g_std ioctl.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 15:37:10 -03:00
Hans Verkuil 39696009d0 [media] s2255: add device_caps support to querycap
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 15:36:12 -03:00
Hans Verkuil 44d06d8273 [media] s2255: 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-03-05 15:35:47 -03:00
Hans Verkuil 7041dec7a9 [media] s2255: add V4L2_CID_JPEG_COMPRESSION_QUALITY
The use of the V4L2_CID_JPEG_COMPRESSION_QUALITY control is recommended over
the G/S_JPEGCOMP ioctls.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 15:34:47 -03:00
Hans Verkuil 192f1e78cb [media] s2255: convert to the control framework
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 15:34:24 -03:00
Hans Verkuil 4ca286610f [media] radio-rtrack2: fix mute bug
Setting the frequency would unmute the card. Fixed the mute handling in the
s_frequency code.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 15:20:07 -03:00
Hans Verkuil 8b21eb17e7 [media] radio-isa: fix querycap capabilities code
The device_caps and capabilities fields were swapped.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 15:19:54 -03:00
Theodore Kilgore c93396e135 [media] gspca: Remove gspca-specific debug magic
Instead use v4l2_dbg and v4l2_err. Note that the PDEBUG macro is kept to
make this patch-set less invasive, but it is simply a wrapper around
v4l2_dbg now. Most of the other changes are there to make the dev parameter
for the v4l2_xxx macros available everywhere we do logging.

Signed-off-by: Theodore Kilgore <kilgota@auburn.edu>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 15:13:48 -03:00
Hans de Goede 70c8ecf54b [media] gspca: Remove old control code now that all drivers are converted
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 15:11:22 -03:00
Hans de Goede 2effe6de38 [media] gscpa: Remove autogain_functions.h
Now that sonixj.c has been converted to the control framework it is no
longer used.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 15:11:03 -03:00
Hans Verkuil 9f8c734735 [media] gspca_sonixb: Remove querymenu function (dead code)
We forgot to remove that when sonixb was converted to the control framework.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 15:10:45 -03:00
Hans de Goede c84e412f6f [media] gscpa_m5602: Convert to the control framework
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 15:10:27 -03:00
Hans de Goede 676fdd856b [media] gscpa_gl860: Convert to the control framework
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 15:06:20 -03:00
Hans Verkuil c1f07ab2b3 [media] gspca_sonixj: Convert to the control framework
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 15:05:52 -03:00
Sachin Kamat 5ce60d790a [media] s5p-g2d: Add DT based discovery support
This patch adds device tree based discovery support to the G2D driver.

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-03-05 14:54:17 -03:00
Sylwester Nawrocki 69b95a3a80 [media] s3c-camif: Fail on insufficient number of allocated buffers
Ensure the driver gets always at least its minimum required
number of buffers allocated by checking actual number of
allocated buffers in vb2_reqbufs(). And free any partially
allocated buffer queue with signaling an error to user space.
Without this patch applications may wait forever to dequeue
a filled buffer, because the hardware didn't even start after
VIDIOC_STREAMON, VIDIOC_QBUF calls, due to insufficient number
of empty buffers.

Reported-by: Alexander Nestorov <alexandernst@gmail.com>
Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:53:47 -03:00
Kamil Debski 6aa69f99b2 [media] vb2: Add support for non monotonic timestamps
Not all drivers use monotonic timestamps. This patch adds a way to set the
timestamp type per every queue.
In addition, set proper timestamp type in drivers that I am sure that use
either MONOTONIC or COPY timestamps. Other drivers will correctly report
UNKNOWN timestamp type instead of assuming that all drivers use monotonic
timestamps.

Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:53:05 -03:00
Hans Verkuil 9776e17189 [media] stk-webcam: implement support for count == 0 when calling REQBUFS
The spec specifies that setting count to 0 in v4l2_requestbuffers
should result in releasing any streaming resources and the stream
ownership. Implement this.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:44:17 -03:00
Hans Verkuil f81e372a5d [media] stk-webcam: s_fmt shouldn't grab ownership
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:44:04 -03:00
Hans Verkuil 1b499fe506 [media] stk-webcam: fix read() handling when reqbufs was already called
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:43:41 -03:00
Hans Verkuil f80daa2d7d [media] stk-webcam: enable core-locking
This makes it possible to switch to unlocked_ioctl.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:43:10 -03:00
Hans Verkuil 8407653f5e [media] stk-webcam: zero the priv field of v4l2_pix_format
The priv field should be set to 0. In this case the driver abused the priv
field for internal housekeeping. Modify the code so priv is no longer used
for that purpose.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:42:38 -03:00
Hans Verkuil b27763f0fa [media] stk-webcam: fix querycap and simplify s_input
Add device_caps support to querycap, fill in bus_info correctly and
do not set the version field (let the core handle that).
Also simplify the s_input ioctl.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:42:12 -03:00
Hans Verkuil 89ea47069c [media] stk-webcam: add support for control events and prio handling
Also correct the first_init static: this should be part of the stk_camera struct.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:41:10 -03:00
Hans Verkuil 10351adc6a [media] stk-webcam: don't use private_data, use video_drvdata
file->private_data is needed to store the pointer to struct v4l2_fh.
So use video_drvdata to get hold of the stk_camera struct.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:40:10 -03:00
Hans Verkuil dc0fb28675 [media] stk-webcam: convert to the control framework
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:39:40 -03:00
Hans Verkuil 968c60f603 [media] stk-webcam: add support for struct v4l2_device
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:38:10 -03:00
Hans Verkuil e144760a33 [media] stk-webcam: remove bogus STD support
It's a webcam, the STD API is not applicable to webcams.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:34:39 -03:00
Hans Verkuil 2aeb73e19d [media] stk-webcam: add ASUS F3JC to upside-down list
And add an extensive comment relating the history of the upside-down
handling in this driver.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Arvydas Sidorenko <asido4@gmail.com>
Thanks-to: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:34:03 -03:00
Hans Verkuil 6b236a375d [media] cx231xx: fix gpio big-endian problems
Tested on my big-endian ppc-based test machine.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:26:07 -03:00
Hans Verkuil 69a11a3264 [media] cx231xx: fix big-endian problems
Tested on my big-endian ppc-based test machine.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:26:07 -03:00
Hans Verkuil fff9e818fb [media] cx231xx: don't use port 3 on the Conexant video grabber
It's not working reliably if port 3 is enabled.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:26:06 -03:00
Hans Verkuil 720b3dfad4 [media] cx231xx: don't reset width/height on first open
The last set width/height must be preserved as per the spec.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:26:06 -03:00
Hans Verkuil b31077a88a [media] cx231xx: disable 417 support from the Conexant video grabber
The 417 support doesn't work. Until someone can dig into this driver to
figure out why it isn't working the 417 support is disabled.
Sometimes you can actually stream a bit, but very soon the whole machine
crashes, so something is seriously wrong.
For the record, this was not introduced by my recent changes to this driver,
it was broken before that.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:26:05 -03:00
Hans Verkuil 4485ea917b [media] cx231xx: remove bogus driver prefix in log messages
The prefix is generated automatically, so no need to provide it again.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:26:05 -03:00
Hans Verkuil 88b6ffedd9 [media] cx231xx-417: convert to the control framework
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:26:04 -03:00
Hans Verkuil b86d15440b [media] cx231xx-417: share ioctls with cx231xx-video
Share tuner, frequency, debug and input ioctls with cx231xx-video.
These are all shared resources, so no need to implement them again.

[mchehab@redhat.com: Fix merge conflict and a checkpatch issue]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:26:04 -03:00
Hans Verkuil 5b8acdc5e6 [media] cx231xx-417: checkpatch cleanups
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:26:03 -03:00
Hans Verkuil 5aa95991d7 [media] cx231xx-417: fix g/try_fmt compliance problems
Colorspace, field and priv were not set, and sizeimage was calculated
using the wrong values (dev->ts1.ts_packet_size and dev->ts1.ts_packet_count
can be 0 at module load).

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05 14:26:03 -03:00