summaryrefslogtreecommitdiff
path: root/drivers/media/usb/em28xx/em28xx.h
AgeCommit message (Collapse)Author
2014-05-23[media] em28xx: remove field tda9887_conf from struct em28xxFrank Schaefer
The tda9887 chipset is part of the analog tuner. Move it out of em28xx-cards. Also, it is used only one time by the v4l2 sub-module at tuner setup. With that, we can get rid of an additional data inside the em28xx common structure. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23[media] em28xx: move tuner frequency field from struct em28xx to struct v4l2Frank Schaefer
Move V4L2-specific frequency cache to struct em28xx_v4l2. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23[media] em28xx: move v4l2 user counting fields from struct em28xx to struct v4l2Frank Schaefer
Despite being at the common em28xx struct, those two fields are actually taking into account only the usage inside em28xx v4l2 submodule. So, move them out of the common struct. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23[media] em28xx: move capture state tracking fields from struct em28xx to ↵Frank Schaefer
struct v4l2 Move some temporary capture tracking date to the em28xx_v4l2 struct, as those info are used only by em28xx v4l2 submodule. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23[media] em28xx: move sensor parameter fields from struct em28xx to struct v4l2Frank Schaefer
Move camera sensor resolution and xtal out of em28xx common struct, as thore are used only by the em28xx v4l2 submodule. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23[media] em28xx: move progressive/interlaced fields from struct em28xx to ↵Frank Schaefer
struct v4l2 The video progressive data fields belong to analog TV. Move them out of the common em28xx struct. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23[media] em28xx: move struct em28xx_fmt *format from struct em28xx to struct v4l2Frank Schaefer
The analog format struct belongs to analog TV. Move it out of the common em28xx struct. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23[media] em28xx: move TV norm from struct em28xx to struct v4l2Frank Schaefer
TV norm is specific to analog TV reception. move it out of the common em28xx struct. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23[media] em28xx: move vinmode and vinctrl data from struct em28xx to struct v4l2Frank Schaefer
The video input mode and control data also belong only to the analog side. move them to struct em28xx_v4l. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23[media] em28xx: move v4l2 frame resolutions and scale data from struct ↵Frank Schaefer
em28xx to struct v4l2 The em28xx scaler data are used only for analog video. Move them to struct em28xx_v4l2. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23[media] em28xx: move videobuf2 related data from struct em28xx to struct v4l2Frank Schaefer
The video and VBI-specific VB2 queue and mutexes are used only by the v4l2 sub-driver. Move them to the V4L2 struct, preventing wasting memory if this sub-driver is not used. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23[media] em28xx: move video_device structs from struct em28xx to struct v4l2Frank Schaefer
There are 3 struct video_device at the em28xx common struct, for video, VBI and radio. They all are used only by the V4L2 driver. So, move them to the v4l2-specific struct. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23[media] em28xx: move struct v4l2_clk *clk from struct em28xx to struct v4l2Frank Schaefer
The current clock definition applies only to the V4L2 side of the driver. Move its struct pointer to the v4l2_dev, where it belongs. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23[media] em28xx: move struct v4l2_ctrl_handler ctrl_handler from struct ↵Frank Schaefer
em28xx to struct v4l2 Controls are only applicable to V4L2 module. Move the corresponding data structs to the proper place. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23[media] em28xx: start moving em28xx-v4l specific data to its own structFrank Schaefer
That reduces a little bit the memory footprint when em28xx-video is not loaded. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23[media] em28xx: move sub-module data structs to a common place in the main ↵Frank Schaefer
struct Just a cleanup. No functional changes. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23[media] em28xx: move norm_maxw() and norm_maxh() from em28xx.h to em28xx-video.cFrank Schaefer
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23[media] em28xx: remove function em28xx_compression_disable() and its callFrank Schaefer
em28xx_compression_disable() is a single line function which is called only one time and this call also isn't needed. Register 0x26 is always configured as part of the scaler configuration, which in turn is always done when the resolution changes. And the initial resolution setting is applied at first device open. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23[media] em28xx: remove some unused fields from struct em28xxFrank Schaefer
Just driver cleanup. No functional changes. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-23[media] em28xx: add [2013:025f] PCTV tripleStick (292e)Antti Palosaari
Empia EM28178, Silicon Labs Si2168, Silicon Labs Si2157. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-11[media] em28xx: Only deallocate struct em28xx after finishing all extensionsMauro Carvalho Chehab
We can't free struct em28xx while one of the extensions is still using it. So, add a kref() to control it, freeing it only after the extensions fini calls. Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] em28xx: add support for DVB monitor ledMauro Carvalho Chehab
Some devices have a LED to indicate when DVB capture started. Add support for it. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] em28xx: add support for Kworld UB435-Q version 3Mauro Carvalho Chehab
This device is close to Kworld UB435-Q, but it uses a different tuner. Add support for it. Tested with both 8VSB and 256QAM modulations. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-04[media] drx-j: add a driver for Trident drx-j frontendDevin Heitmueller
Add support for the Trident DRX-J driver, including a card profile for the PCTV 80e which uses the chip. Thanks to Trident for allowing the release of this code under a BSD license, and of course Hauppauge/PCTV for pushing for its release to the community. [pdickeybeta@gmail.com: modified to fix compilation errors and also to move the driver files from the drx39xy subdirectory to the frontends directory] [m.chehab@samsung.com: fix merge conflicts, commented drx-j compilation and added EM28XX_R06_I2C_CLK setup also to the board setup] Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-03-03[media] em28xx: add suspend/resume to em28xx_opsShuah Khan
em28xx usb driver will have to suspend and resume its extensions. Adding suspend and resume to em28xx_ops gives extensions the ability to install suspend and resume that can be invoked from em28xx_usb driver suspend() and resume() interfaces. Approach: Add power management support to em28xx usb driver. This driver works in conjunction with extensions for each of the functions on the USB device for video/audio/dvb/remote functionality that is present on media USB devices it supports. During suspend and resume each of these extensions will have to do their part in suspending the components they control. Adding suspend and resume hooks to the existing struct em28xx_ops will enable the extensions the ability to implement suspend and resume hooks to be called from em28xx driver. The overall approach is as follows: -- add suspend and resume hooks to em28xx_ops -- add suspend and resume routines to em28xx-core to invoke suspend and resume hooks for all registered extensions. -- change em28xx dvb, audio, input, and video extensions to implement em28xx_ops: suspend and resume hooks. These hooks do what is necessary to suspend and resume the devices they control. Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-14[media] em28xx: fix usb alternate setting for analog and digital video ↵Frank Schaefer
endpoints > 0 The current code assumes that the analog + digital video endpoints are always at interface number 0 when changing the alternate setting. This seems to work fine for most existing devices. However, at least the SpeedLink VAD Laplace webcam has the video endpoint on interface number 3 (which fortunately doesn't cause any trouble because ist uses bulk transfers only). We already consider the actual interface number for audio endpoints, so rename the the audio_ifnum variable and use it for all device types. Also get get rid of a pointless (ifnum < 0) in em28xx-audio. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-14[media] em28xx: adjust period size at runtimeMauro Carvalho Chehab
While the current hardcoded period is ok for the current values, we may latter change the driver to work with different bit rates or with different latencies than 64ms. So, adust the period size at runtime. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-13[media] em28xx: fix xc3028 demod and firmware setup on DVBMauro Carvalho Chehab
Now that em28xx can be compiled without V4L support, we should call em28xx_setup_xc3028() on both em28xx-v4l and em28xx-dvb modules. Reported-by: Chris Lee <updatelee@gmail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-12[media] em28xx-audio: don't hardcode audio URB calculusMauro Carvalho Chehab
The current code hardcodes the number of audio URBs, the number of packets per URB and the maximum URB size. This is not a good idea, as it: - wastes more bandwidth than necessary, by using a very large number of packets; - those constants are bound to an specific scenario, with a bandwidth of 48 kHz; - don't take the maximum endpoint size into account; - with urb->interval = 1 on xHCI, those constraints cause a "funny" setup: URBs with 64 packets inside, with only 24 bytes total. E. g. a complete waste of space. Change the code to do dynamic URB audio calculus and allocation. For now, use the same constraints as used before this patch, to avoid regressions. A good scenario (tested) seems to use those defines, instead: #define EM28XX_MAX_AUDIO_BUFS 8 #define EM28XX_MIN_AUDIO_PACKETS 2 But let's not do such change here, letting the optimization to happen on latter patches, after more tests. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-10[media] em28xx: use a better value for I2C timeoutsMauro Carvalho Chehab
In the lack of a better spec, let's assume the timeout values compatible with SMBus spec: http://smbus.org/specs/smbus110.pdf at chapter 8 - Electrical Characteristics of SMBus devices Ok, SMBus is a subset of I2C, and not all devices will be following it, but the timeout value before this patch was not even following the spec. So, while we don't have a better guess for it, use 35 + 1 ms as the timeout. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-10[media] em28xx: properly implement AC97 wait codeMauro Carvalho Chehab
Instead of assuming that msleep() is precise, use a jiffies based code to wait for AC97 to be available. Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07[media] em28xx: fix I2S audio sample rate definitions and info outputFrank Schaefer
The audio configuration in chip config register 0x00 and eeprom are always consistent. But currently the audio configuration #defines for the chip config register say 0x20 means 3 sample rates and 0x30 5 sample rates, while the eeprom info output says 0x20 means 1 sample rate and 0x30 3 sample rates. I've checked the datasheet excerpts I have and it seems that the meaning of these bits is different for em2820/40 (1 and 3 sample rates) and em2860+ (3 and 5 smaple rates). I have also checked my Hauppauge WinTV USB 2 (em2840) and the chip/eeprom audio config 0x20 matches the sample rates reproted by the USB device descriptor (32k only). Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07[media] em28xx: unify module versionMauro Carvalho Chehab
Use the same module version on all em28xx sub-modules, and use the same naming convention to describe the driver. Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-07[media] em28xx: make em28xx-video to be a separate moduleMauro Carvalho Chehab
Now that all analog-specific code are at em28xx-video, convert it into an em28xx extension and load it as a separate module. Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com> Tested-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-05[media] em28xx: some cosmetic changesMauro Carvalho Chehab
In order to make easier for the next patches, do some cosmetic changes. No functional changes. Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-01-05[media] em28xx: move some video-specific functions to em28xx-videoMauro Carvalho Chehab
Now that we want to split the video handling to a separate module, move all video-specific functions to em28xx-video. No functional changes. Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-12-20[media] em28xx: reduce the polling interval for GPI connected buttonsFrank Schaefer
For GPI-connected buttons without (hardware) debouncing, the polling interval needs to be reduced to detect button presses properly. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-12-19[media] em28xx: add support for PCTV DVB-S2 Stick (461e) [2013:0258]Antti Palosaari
Device has following chips: Empia EM28178, Montage M88DS3103, Montage M88TS2022, Allegro A8293. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-12-10[media] em28xx: add support for the SpeedLink Vicious And Devine Laplace webcamsFrank Schaefer
The SpeedLink Vicious And Devine Laplace webcam is using an EM2765 bridge and an OV2640 sensor. It has a built-in microphone (USB standard device class) and provides 3 buttons (snapshot, illumination, mute) and 2 LEDs (capturing/mute and illumination/flash). It is also equipped with an eeprom. The device is available in two colors: white (1ae7:9003) and black (1ae7:9004). For further details see http://linuxtv.org/wiki/index.php/VAD_Laplace. Please note the following limitations that need to be addressed later: - resolution limited to 640x480 (sensor supports 1600x1200) - picture quality needs to be improved - AV-mute button doesn't work yet Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-12-10[media] em28xx: add support for illumination button and LEDFrank Schaefer
The SpeedLink VAD Laplace webcam is equipped with an illumination button and an illumination LED. When the button is pressed, the driver must toggle the LED state via the corresponding GPO port. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-12-10[media] em28xx: prepare for supporting multiple LEDsFrank Schaefer
Introduce a LED role and store all LEDs in an array. Also provide a helper function to retrieve a specific LED. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-12-10[media] em28xx: add debouncing mechanism for GPI-connected buttonsFrank Schaefer
So far, the driver only supports a snapshot button which is assigned to register 0x0c bit 5. This special port has a built-in debouncing mechanism. For buttons connected to ordinary GPI ports, this patch implements a software debouncing mechanism. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-12-10[media] em28xx: extend the support for device buttonsFrank Schaefer
The current code supports only a single snapshot button assigned to register 0x0c bit 5. But devices may be equipped with multiple buttons with different functionalities and they can also be assigned to the various GPI-ports. Extend the em28xx-input code to handle multiple buttons assigned to different GPI-ports / register addresses and bits. Also make easier to extend the code with further button types. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-12-10[media] em28xx: add support for GPO controlled analog capturing LEDsFrank Schaefer
Some devices are equipped with a capturing status LED that needs to be switched on/off explicitly via a GPO port. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-10-31[media] Add support for KWorld UB435-Q V2Jean-Francois Thibert
This patch adds support for the UB435-Q V2. You might need to use the device once with the Windows driver provided by KWorld in order to permanently reprogram the device descriptors. Thanks to Jarod Wilson for the initial attempt at adding support for this device. [m.chehab@samsung.com: Fixed Whitespace mangling, Coding Style and improved the error handling at DVB attach] Signed-off-by: Jean-Francois Thibert <jfthibert@google.com> Reviewed-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-10-31[media] V4L2: em28xx: register a V4L2 clock sourceGuennadi Liakhovetski
Camera sensors usually require a master clock for data sampling. This patch registers such a clock source for em28xx cameras. This fixes the currently broken em28xx ov2640 camera support and can also be used by other camera sensors. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-06-19[media] em28xx: remove GPIO register cachingFrank Schaefer
The GPIO register caching is the result of wrong assumptions and incomplete knowledge about the GPIO registers and their functionality. Today, we know that it is not needed. It is also limited to a single register and therefore incomplete (newer chips are using multiple registers). Instead of extending the caching, get rid of it, because it has no real benefits and just bloats/complicates the code. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-05-21[media] em28xx: Add support for 1b80:e1cc Delock 61959Jakob Haufe
Hardware is the same as MaxMedia UB425-TC but ships with a different remote. Signed-off-by: Jakob Haufe <sur5r@sur5r.net> Reviewed-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-29[media] em28xx: add basic support for OmniVision OV2640 sensorsFrank Schaefer
This sensor is used by the "SpeedLink Vicious And Devine Laplace webcam" and others. It supports resolutions up to 1600x1200 (at 7-8 fps), but for resolutions higher than 640x480, further driver changes will be necessary, such as sensor output resolution switching (including further configuration changes), bridge xclk adjustment and disabling of 16 bit (12 bit) output formats at high resolutions. Image quality should also needs to be improved. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-29[media] em28xx: move sensor code to a separate source code file em28xx-camera.cFrank Schaefer
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>