summaryrefslogtreecommitdiff
path: root/drivers/staging/media/go7007
AgeCommit message (Collapse)Author
2013-05-02Merge branch 'i2c/for-next' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c changes from Wolfram Sang: - an arbitration driver. While the driver is quite simple, it caused discussion if we need additional arbitration on top of the one specified in the I2C standard. Conclusion is that I accept a few generic mechanisms, but not very specific ones. - the core lost the detach_adapter() call. It has no users anymore and was in the way for other cleanups. attach_adapter() is sadly still there since there are users waiting to be converted. - the core gained a bus recovery infrastructure. I2C defines a way to recover if the data line is stalled. This mechanism is now in the core and drivers can now pass some data to make use of it. - bigger driver cleanups for designware, s3c2410 - removing superfluous refcounting from drivers - removing Ben Dooks as second maintainer due to inactivity. Thanks for all your work so far, Ben! - bugfixes, feature additions, devicetree fixups, simplifications... * 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (38 commits) i2c: xiic: must always write 16-bit words to TX_FIFO i2c: octeon: use HZ in timeout value i2c: octeon: Fix i2c fail problem when a process is terminated by a signal i2c: designware-pci: drop superfluous {get|put}_device i2c: designware-plat: drop superfluous {get|put}_device i2c: davinci: drop superfluous {get|put}_device MAINTAINERS: Ben Dooks is inactive regarding I2C i2c: mux: Add i2c-arb-gpio-challenge 'mux' driver i2c: at91: convert to dma_request_slave_channel_compat() i2c: mxs: do error checking and handling in PIO mode i2c: mxs: remove races in PIO code i2c-designware: switch to use runtime PM autosuspend i2c-designware: use usleep_range() in the busy-loop i2c-designware: enable/disable the controller properly i2c-designware: use dynamic adapter numbering on Lynxpoint i2c-designware-pci: use managed functions pcim_* and devm_* i2c-designware-pci: use dev_err() instead of printk() i2c-designware: move to managed functions (devm_*) i2c: remove CONFIG_HOTPLUG ifdefs i2c: s3c2410: Add SMBus emulation for block read ...
2013-04-22[media] go7007: dubious one-bit signed bitfieldsDan Carpenter
Because they're signed, "is_video" and "is_audio" can be 0 and -1 instead of 0 and 1 as intended. It doesn't cause a bug, but it makes Sparse complain: drivers/staging/media/go7007/go7007-priv.h:94:31: error: dubious one-bit signed bitfield drivers/staging/media/go7007/go7007-priv.h:95:31: error: dubious one-bit signed bitfield Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-16[media] staging/media: fix go7007 dependencies and buildRandy Dunlap
VIDEO_GO7007 uses usb interfaces so it should depend on USB. It also selects CYPRESS_FIRMWARE, which depends on USB. Fixes build errors and a kconfig warning: go7007-loader.c:(.text+0xcc7d0): undefined reference to `usb_get_dev' go7007-loader.c:(.init.text+0x49f0): undefined reference to `usb_register_driver' go7007-loader.c:(.exit.text+0x17ce): undefined reference to `usb_deregister' warning: (DVB_USB_AZ6007 && VIDEO_GO7007) selects CYPRESS_FIRMWARE which has unmet direct dependencies (MEDIA_SUPPORT && USB) Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-04-02i2c: Ignore return value of i2c_del_adapter()Lars-Peter Clausen
i2c_del_adapter() always returns 0. So all checks testing whether it will be non zero will always evaluate to false and the conditional code is dead code. This patch updates all callers of i2c_del_mux_adapter() to ignore the return value and assume that it will always succeed (which it will). In a subsequent patch the return type of i2c_del_adapter() will be made void. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Ben Hutchings <bhutchings@solarflare.com> Reviewed-by: Jean Delvare <khali@linux-fr.org> Acked-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2013-03-29[media] media: move dvb-usb-v2/cypress_firmware.c to media/commonHans Verkuil
Loading the cypress firmware is not dvb specific and should be common functionality. Move the source to media/common and make it a standalone module. As a result we can remove the dependency on dvb-usb in go7007, which has nothing to do with dvb. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-26[media] go7007: fix invalid use of sizeof in go7007_usb_i2c_master_xfer()Wei Yongjun
sizeof() when applied to a pointer typed expression gives the size of the pointer, not that of the pointed data. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25[media] go7007: using strlcpy instead of strncpyChen Gang
For NUL terminated string, need always set '\0' in the end. Signed-off-by: Chen Gang <gang.chen@asianux.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25[media] go7007: Remove unneeded version.h header includeSachin Kamat
version.h header inclusion is not necessary as detected by versioncheck. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25[media] go7007: don't continue if firmware can't be loadedHans Verkuil
The go7007 driver would continue during probe if no firmware could be loaded. Without firmware the probe() should return an error, so do that. Also move the registration of devices to the end of the probe() sequence: once devices appear the full driver functionality should be available. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25[media] go7007: update the READMEHans Verkuil
Include the patch required to add support for the go7007 to saa7134. To be applied once the driver is moved out of staging. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-25[media] saa7134-go7007: convert to a subdev and the control frameworkHans Verkuil
The only thing missing after this to make the Sensoray model 614 board work is to hook it up to the saa7134 driver, but that will have to wait until this driver goes out of staging. Signed-off-by: Pete Eberlein <pete@sensoray.com> [hans.verkuil@cisco.com: updated to make it merge correctly] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] go7007: add support for ADS Tech DVD Xpress DX2Hans Verkuil
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[media] go7007: drop firmware name in board config, make configs constHans Verkuil
The firmware is always the same, so drop it from the board configs. Also make the board configs const. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] go7007: correct a header check: MPEG4 has a different GOP codeHans Verkuil
Actually it's called "Group of VOP" start code in MPEG4 terminology. 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[media] go7007: add back 'repeat sequence header' controlHans Verkuil
But now as a proper standard MPEG control. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] go7007: Restore b_frame controlVolokh Konstantin
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[media] go7007: a small improvement to querystd handlingHans Verkuil
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] go7007-loader: add support for the other devices and move fw filesHans Verkuil
Add support for the other devices that need to load the boot firmware. All firmware files are now placed in a single go7007 directory. Also remove the device_extension_s stuff: this is clearly a left-over from the olden days. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] go7007-loader: renamed from s2250-loaderHans Verkuil
All s2250 names are renamed to go7007. This will be the generic go7007 firmware loader for any go7007 device, not just for the s2250/1. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] s2250: add comment describing the hardwareHans Verkuil
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] go7007: remove cropping functionsHans Verkuil
Remove these dummy cropping functions: cropping was never implemented. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] go7007: embed struct video_deviceHans Verkuil
Do not allocate it, but just embed in the go7007 struct. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] go7007: convert to core locking and vb2Hans Verkuil
Convert this driver to videobuf2 and core locking. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] go7007: drop struct go7007_fileHans Verkuil
Remove struct go7007_file: all fields contained in that struct are moved to the go7007 struct since they are really global values. The lock has just been deleted (what's the point of a per-fh lock??). Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] go7007: set up the saa7115 audio clock correctlyHans Verkuil
The s_crystal_freq operation has to be called for the saa7115 to set up the audio clock correctly. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] go7007: simplify the PX-TV402U board ID handlingHans Verkuil
There really is no need to split out the board IDs for each tuner. That's what the tuner_type is for, after all. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] go7007: standardize MPEG handling supportHans Verkuil
The go7007 produces elementary streams, so we shouldn't use the STREAM_TYPE control, since that is for multiplexed streams. Instead use V4L2_PIX_FMT_MPEG1/2/4. Initially set up all the values for MPEG-2 dvd-mode, and select the dvd_mode field if those values match that setup precisely. Clean up lots of obsolete code relating to the custom ioctls for the MPEG support. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] go7007: tuner/std related fixesHans Verkuil
- The Adlink is initially detected as a sensor board, so the driver config is set up as if it was a sensor. Later the driver discovers that it really is a video capture card and that means that the driver configuration has to be updated for a PAL/NTSC capture card. - Setup the correct initial std based on the TV tuner type. - Remember the exact std the user selected, don't map it to STD_PAL or NTSC. - Use v4l2_disable_ioctl to disable ioctls based on the board config and drop a lot of checking code in each of those ioctls since that is no longer needed. - enum_input should use tvnorms to fill its std field. - configure the input, std and initial tuner frequency at driver initialization. - fix std handling in the s2250 driver. - the code handling scaling for devices without a scaler was broken. This is now fixed. - correctly set readbuffers and capability in g/s_parm. - remove the bogus test for capturemode in s_parm. - correctly implement enum_framesizes/intervals. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] go7007: add log_status supportHans Verkuil
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] go7007: add prio and control event supportHans Verkuil
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] s2250: convert to the control frameworkHans Verkuil
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] go7007: convert to the control framework and remove obsolete ↵Hans Verkuil
JPEGCOMP support Just add a read-only V4L2_CID_JPEG_ACTIVE_MARKER control to replace the JPEGCOMP support. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] go7007: fix unregister/disconnect handlingHans Verkuil
- use the v4l2_device's release() callback - remove the unnecessary ref_count - don't free usb data structures on disconnect, only do that in the final release callback. This is the correct way in order to safely handle disconnect and removal of modules. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] go7007: remember boot firmwareHans Verkuil
Don't load it everytime you stop encoding. Instead remember it. Another reason for not loading it every time is that this could be called from within the release() file operation, which turns out to be deadly. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] go7007: fix DMA related errorsHans Verkuil
- Don't pass data allocated on the stack to usb_control_msg. - Use dma_mapping_error after calling dma_map_page(). Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] go7007: remove current_normHans Verkuil
It's deprecated and replaced by g_std. Since this driver already implements g_std the use of current_norm can just be removed. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] go7007: go7007: add device_caps and bus_info support to querycapHans Verkuil
And don't set the version field, the core does that for you. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] s2250-loader: use usbv2_cypress_load_firmwareHans Verkuil
The v2 of this function doesn't do DMA to objects on the stack like its predecessor does. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] go7007: add audio input ioctlsHans Verkuil
Since we now know what audio inputs there are, we can also get/set and enumerate them. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] go7007: remove all wis* driversHans Verkuil
These are now no longer used and so they can be removed. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] go7007: switch to standard tuner/i2c subdevsHans Verkuil
Instead of using the wis-* drivers we now use the standard 'proper' subdev drivers. The board configuration tables now also list the possible audio inputs, this will be used later to implement audio inputs. Special mention deserves a little change in set_capture_size() where the height passed to s_mbus_fmt is doubled: that is because the saa7115 driver expects to see the frame height, not the field height as the wis_saa7115 driver did. Another change is that the tuner input is moved from last to the first input, which is consistent with the common practice in other video drivers. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] go7007: i2c initialization changes for tw2804Volokh Konstantin
Do i2c initialization via struct item as tw2804 has a 0x00 i2c address, so we need to use the I2C_CLIENT_TEN flag for validity. 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[media] tuner: add Sony BTF tunersHans Verkuil
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[media] go7007: fix i2c_xfer return codesHans Verkuil
The i2c_xfer functions didn't return the proper error codes and (especially important) on success they returned 0 instead of the number of transferred messages. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-24[media] v4l2: pass std by value to the write-only s_std ioctlHans Verkuil
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[media] v4l2: add const to argument of write-only s_tuner ioctlHans Verkuil
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[media] v4l2: add const to argument of write-only s_frequency ioctlHans Verkuil
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-23[media] drivers/staging/media/go7007: using strlcpy instead of strncpyChen Gang
for NUL terminated string, need always set 0 in the end. Signed-off-by: Chen Gang <gang.chen@asianux.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-13[media] staging: media: Remove unnecessary OOM messagesJoe Perches
alloc failures already get standardized OOM messages and a dump_stack. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-06[media] staging: go7007: fix test for V4L2_STD_SECAMDan Carpenter
The current test doesn't make a lot of sense. It's likely to be true, which is what we would want in most cases. From looking at how this is handled in other drivers, I think "&" was intended instead of "*". It's an easy mistake to make because they are next to each other on the keyboard. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>