summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx25840/cx25840-core.c
AgeCommit message (Collapse)Author
2009-07-23cx25840: Bugfix for no DVB-T on the Hauppauge HVR-1700Steven Toth
From: Steven Toth <stoth@kernellabs.com> After the i2c subdev changes the ordering of initialization changed, causing a total loss of previous GPIO settings and a loss of DTV. The generic firmware loading routine has now changed to preserve GPIO values if the device is cx23885 based (safety) and I've moved the GPIO configuration from probe() into the cx23885 init func which is a little clearer and fixes the bug. Priority: normal Tested-By: Sohail Syyed <linuxtv@hubstar.net> Reviewed-by: Michael Krufky <mkrufky@kernellabs.com> Signed-off-by: Steven Toth <stoth@kernellabs.com>
2009-04-02v4l2-subdev: change s_routing prototypeHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> It is no longer needed to use a struct pointer as argument, since v4l2_subdev doesn't require that ioctl-like approach anymore. Instead just pass the input, output and config (new!) arguments directly. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-03-30v4l2: use old-style i2c API for kernels < 2.6.26 instead of < 2.6.22Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Originally the intention was to switch to the new style i2c API starting with the introduction of the API in 2.6.22. However, the i2c_new_probed_device() function has a lethal bug that wasn't fixed until 2.6.25. Or more accurately, it was only fixed in the stable series of 2.6.25 and 2.6.26. Given the fact that the new i2c API also changed starting with 2.6.26 (the addition of i2c_device_id), it is easiest to switch APIs starting with 2.6.26. This patch updates all the legacy code accordingly. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-04-01v4l2-subdev: move s_std from tuner to core.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> s_std didn't belong in the tuner ops. Stricly speaking it should be part of the video ops, but it is used by audio and tuner devices as well, so it is more efficient to make it part of the core ops. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-03-30v4l2-subdev: add load_fw and use that instead of abusing core->init.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The init callback was used in several places to load firmware. Make a separate load_fw callback for that. This makes the code a lot more understandable. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-03-30cx25840: fix 'unused variable' warning.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-03-30cx25840: cleanup: remove intermediate 'ioctl' stepHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The audio and vbi functions where still called through an ioctl-like interface, even though this is no longer needed with v4l2-subdev. Just change each 'case' into a proper function and call that directly. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-03-29cx25840: remove legacy code for old-style i2c APIHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> All drivers that use cx25840 are now converted to v4l2_subdev, so I can remove the support for the old-style i2c API. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-03-13cx25840: cx23885 detection was brokenHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> An earlier commit accidentally broke the detection of the cx25837 part of the cx23885. Reinstated the commented out code. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-03-03cx25840: Fix CodingStyle errors introduced by the last patchMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-03cx25840: prepare it to be used by cx231xx moduleMauro Carvalho Chehab
From: Sri Deevi <Srinivasa.Deevi@conexant.com> Signed-off-by: Srinivasa Deevi <srinivasa.deevi@conexant.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-02-21v4l2-common: remove v4l2_ctrl_query_fill_stdHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The v4l2_ctrl_query_fill_std() function wasn't one the best idea I ever had. It doesn't add anything valuable that cannot be expressed equally well with v4l2_ctrl_query_fill and only adds overhead. Replace it with v4l2_ctrl_query_fill() everywhere it is used and remove it from v4l2_common.c. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-01-29v4l2: fix incorrect hue range checkHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> A hue of -128 was rejected due to an incorrect range check, which was faithfully copy-and-pasted into four drivers... Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-01-27cx25840: ignore TUNER_SET_CONFIG in the command callback.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> These days TUNER_SET_CONFIG is broadcast to the other i2c devices and that triggers a fw load on the cx25840. Ignore this command since cx25840 isn't a tuner and you really do not want to load the firmware that early. Priority: high Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-01-15cx25840: add comments explaining what the init() does.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-01-15cx25840: fix regression: fw not loaded on first useHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> With the conversion to v4l2_subdev one bit of code was accidentally dropped: on receiving the first command the driver has to load the fw. A new init() command was introduced to do that explicitly for bridge drivers that are converted to use v4l2_subdev, but old drivers that are not yet converted no longer worked. This patch fixes this regression for these old drivers. Priority: high Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2009-01-05Fix an error on cx25840Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> On Mon, 2009-01-05 at 15:10 +0100, Gregoire Favre wrote: > Hello, > > compilation of today v4l-hg fails at : > > CC [M] /usr/src/CVS/v4l-dvb/v4l/cx23885-417.o > CC [M] /usr/src/CVS/v4l-dvb/v4l/cx25840-core.o > /usr/src/CVS/v4l-dvb/v4l/cx25840-core.c:186: error: duplicate 'static' > make[2]: *** [/usr/src/CVS/v4l-dvb/v4l/cx25840-core.o] Error 1 > make[1]: *** [_module_/usr/src/CVS/v4l-dvb/v4l] Error 2 > make[1]: Leaving directory `/usr/src/linux-2.6.28-gentoo' > make: *** [default] Error 2 I find the output of an sparse build amusing: marune/build/v4l-dvb-master/v4l/cx25840-core.c:186:8: error: Just how static do you want this type to be? /marune/build/v4l-dvb-master/v4l/cx25840-core.c:186: error: duplicate 'static' make[3]: *** [/marune/build/v4l-dvb-master/v4l/cx25840-core.o] Error 1 The change that introduced it follows. The first part of the change, with the 2 "static"s is the problem. The second part of the change, for older kernels is correct. Remove the duplicate static keyword and the code will compile. Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-05drivers/media: Fix a number of sparse warningsMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> anysee.c:44:5: warning: symbol 'dvb_usb_anysee_delsys' was not declared. Should it be static? cx24116.c:378:3: warning: symbol 'CX24116_MODFEC_MODES' was not declared. Should it be static? stb0899_algo.c:57:5: warning: symbol 'stb0899_get_srate' was not declared. Should it be static? stb0899_algo.c:766:6: warning: symbol 'Log2Int' was not declared. Should it be static? stb0899_drv.c:137:20: warning: symbol 'stb0899_quant_tab' was not declared. Should it be static? stb0899_drv.c:180:20: warning: symbol 'stb0899_est_tab' was not declared. Should it be static? stb0899_drv.c:220:5: warning: symbol '_stb0899_read_reg' was not declared. Should it be static? budget-ci.c:1348:23: warning: symbol 'tt3200_stb6100_config' was not declared. Should it be static? /home/v4l/master/v4l/cx25840-core.c:190:6: warning: symbol 'cx25840_work_handler' was not declared. Should it be static? /home/v4l/master/v4l/m5602_s5k83a.c:116:6: warning: symbol 's5k83a_dump_registers' was not declared. Should it be static? Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-30v4l2: debugging API changed to match against driver name instead of ID.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Since the i2c driver ID will be removed in the near future we have to modify the v4l2 debugging API to use the driver name instead of driver ID. Note that this API is not used in applications other than v4l2-dbg.cpp as it is for debugging and testing only. Should anyone use the old VIDIOC_G_CHIP_IDENT, then this will be logged with a warning that it is deprecated and will be removed in 2.6.30. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-11-29cx25840: convert to v4l2_subdev.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-08-28Steven Toth email address changeSteven Toth
From: Steven Toth <stoth@hauppauge.com> I need this so I can better isolate my linux email from my corporate email. Priority: normal Signed-off-by: Steven Toth <stoth@linuxtv.org>
2008-07-21make cx25840_debug staticMauro Carvalho Chehab
From: Adrian Bunk <bunk@kernel.org> cx25840_debug can now become static. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-17ivtv/cx18: ensure the default control values are correctHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> For several MPEG controls and the volume control the default as returned by VIDIOC_QUERYCTRL was incorrect and did not match the actual initial value. This is now fixed for cx18 and ivtv. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-07-17cx25840: move cx25840_vbi_setup to core.c and rename to cx25840_std_setupHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> cx25840_vbi_setup has nothing to do with setting up VBI, but everything with setting up the standard. Move to cx25840-core.c and rename. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-07-08v4l-dvb: remove support for kernels < 2.6.13Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Phase 3 of the compat cleanup. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-07-08v4l-dvb: remove support for kernels < 2.6.0Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> First phase of the backwards compatibility cleanup: stop supporting kernels older than 2.6.0. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-06-07cx18/cx25840: the S-Video LUMA input can use all In1-In8 inputsHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The S-Video LUMA input was restricted to the In1-In4 inputs, but it turns out that it can use the full range of In1-In8. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-06-05backport I2C changes on several filesMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Some I2C API change patches were committed at kernel. Backport those changes to V4L/DVB tree. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-05-02backport commit d2653e92732bd3911feff6bee5e23dbf959381dbMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> kernel-sync: Author: Jean Delvare <khali@linux-fr.org> Date: Tue Apr 29 23:11:39 2008 +0200 i2c: Add support for device alias names Based on earlier work by Jon Smirl and Jochen Friedrich. This patch allows new-style i2c chip drivers to have alias names using the official kernel aliasing system and MODULE_DEVICE_TABLE(). At this point, the old i2c driver binding scheme (driver_name/type) is still supported. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-18cx25840: Ensure GPIO2 is correctly set for cx23885/7/8 based products.Steven Toth
From: Steven Toth <stoth@hauppauge.com> cx25840: Ensure GPIO2 is correctly set for cx23885/7/8 based products. Signed-off-by: Steven Toth <stoth@hauppauge.com>
2008-03-09cx25840: better PAL-M and NTSC-KR handlingHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-01-09cx25840: Add basic CX23885 AVCore supportSteven Toth
From: Steven Toth <stoth@hauppauge.com> The cx23885/7/8 PCIe bridge has an internal AVCore modelled on the cx2584x family. Many of the registers positions are identical but some moved. The register values are also different because the different bridges run at different clock rates. Signed-off-by: Steven Toth <stoth@hauppauge.com>
2007-12-02cx25840: fix endianness inconsistencyHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> cx25840_read4 reads a little-endian 32-bit value whereas cx25840_write4 writes the 32-bit value as big-endian. Convert write4 to use little-endian as well (that's the correct endianness). Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-09-16Use correct error codes when chip is not recognized.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> If the chip isn't recognized, then the correct errors should be returned. The v4l2_i2c_attach() utility function will return 0 for all errors except -ENOMEM to provide proper compatibility support for the old I2C probing function. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org> --- linux/drivers/media/video/cs53l32a.c | 2 +- linux/drivers/media/video/cx25840/cx25840-core.c | 6 +++++- linux/drivers/media/video/msp3400-driver.c | 4 ++-- linux/drivers/media/video/saa7115.c | 4 ++-- linux/drivers/media/video/saa7127.c | 6 +++--- linux/drivers/media/video/tlv320aic23b.c | 2 +- linux/drivers/media/video/upd64031a.c | 2 +- linux/drivers/media/video/upd64083.c | 2 +- linux/drivers/media/video/v4l2-common.c | 2 +- linux/drivers/media/video/vp27smpx.c | 2 +- linux/drivers/media/video/wm8739.c | 4 ++++ 11 files changed, 22 insertions(+), 14 deletions(-)
2007-09-13cx25840: convert to bus-based I2C API.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org> --- linux/drivers/media/video/cx25840/cx25840-core.c | 495 +++++++++-------------- 1 file changed, 202 insertions(+), 293 deletions(-)
2007-09-01cx25840: fix build warningMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> Fix the following build warning: CC [M] cx25840-core.o cx25840-core.c: In function 'init_dll1': cx25840-core.c:147: warning: implicit declaration of function 'udelay' WARNING: "udelay" [cx25840.ko] undefined! Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2007-08-28cx25840: add a few 10 microsecond delaysHans Verkuil
From: Tyler Trafford <ttrafford@gmail.com> There were a couple of places in the cx25840 initialization where the datasheet called for a 10 microsecond delay, which we ignored because of the 10 usec I2C delay. Put them in anyway now that the I2C delay was decreased to 5 usec. Signed-off-by: Tyler Trafford <ttrafford@gmail.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-08-26cx25840: use a workqueue to load the firmwareHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Loading the firmware using the i2c bit-banging code blocks the kernel. Move the firmware load code into a workqueue so that it plays well with other processes. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-08-07cx25840: make proper use of SOFT_RESET.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Whenever the 0x80b register is used the microcontroller should be reset. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-08-05cx25840: add radio support.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-08-05cx25840: fix audio mute handling and reportingHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Audio muting for the tuner input was implemented by stopping the audio microcontroller and restarting it on unmute. However, it appears that this method can actually crash the audio firmware. It's rare and seems to happen with NTSC only. It has been reimplemented by setting to volume to 0. In addition, the reporting of the mute state has been improved as well: it used to be impossible to detect whether the audio was muted by the user or if it was muted due to the microcontroller trying to detect the audio standard. This is now clearly stated. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-08-04cx25840: resetting also requires reloading the firmwareHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Resetting without reloading the firmware is not enough. Sometimes the firmware is 'stuck' and needs to be reloaded. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-07-22ivtv, cx25840: postpone fw load until first use.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The firmware is now loaded when the driver is actually used for the first time. This allows the driver to be compiled in-kernel instead of as a module. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-04-29Improve / fix support for PAL-60 in cx25840Mike Isely
From: Servaas Vandenberghe <vdb128@picaros.org> This causes the cx25840 module to treat V4L2_STD_PAL_60 similar to other 60Hz timings, and it fixes a wrongly-named variable (timings are independant of color system). Signed-off-by: Mike Isely <isely@pobox.com> Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-02-27Improve VIDIOC_G_CHIP_IDENT (better diagnostics)Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Simplify the VIDIOC_G_CHIP_IDENT implementation by adding a single common function. The ident can now also return NONE: not found, UNKNOWN: found, but we don't know what chip it is, and AMBIGUOUS: multiple chips were matched so the match values were too general. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-02-24Add support for VIDIOC_G_CHIP_IDENTHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> VIDIOC_G_CHIP_IDENT improves debugging of card problems: it can be used to detect which chips are on the board and based on that information selected register dumps can be made, making it easy to debug complicated media chips containing tens or hundreds of registers. This ioctl replaces the internal VIDIOC_INT_G_CHIP_IDENT ioctl. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> CC: Jonathan Corbet <corbet@lwn.net>
2007-02-24Improve chip matching in v4l2_register for VIDIOC_DBG_G/S_REGISTERHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The chip matching in struct v4l2_register was rather primitive. It could not be extended to other busses besides i2c and it lacked a way to differentiate between two i2c chips driven by the same driver on one board (e.g. a PVR500 with two tuner chips, one for analog TV and one for radio). It has now been improved making it much more powerful. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> CC: Mike Isely <isely@isely.net> CC: Trent Piepho <xyzzy@speakeasy.org>
2007-02-19compat: Add -include linux/version.h to cflagsTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> Add -include linux/version.h to the cflags. Now code can have backward compatibility test without including compat.h first. Linux headers included from compat.h are removed, so that code will get the same headers when compiling in v4l-dvb as it does in the kernel. Many drivers have compat.h moved to the end of their include list, as this lets compat.h do things it can't do at the beginning. Such as test of something is defined to include compat code, or to put a wrapper around a function without changing the function's name. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-02-15Fix cx25840 firmware loading.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Due to changes in the i2c handling in 2.6.20 this cx25840 bug surfaced, causing the firmware load to fail for the ivtv driver. The correct sequence is to first attach the i2c client, then use the client's device to load the firmware. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Acked-by: Mike Isely <isely@pobox.com>
2007-02-03Fix cx2584x revision reporting.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Revisions >= 23 were always reported as revision 23. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>