summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/msp3400-driver.c
AgeCommit message (Collapse)Author
2007-12-12msp3400: CodingStyle cleanups.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> 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-13msp3400: 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/msp3400-driver.c | 135 +++-------------------------- 1 file changed, 14 insertions(+), 121 deletions(-)
2007-08-27whitespace cleanup: replace leading spaces with tabsMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> There were many instances of 7-space indents spread throughout the v4l-dvb tree. This patch replaces the 7-space indents with tabs. The whitespace cleaner script doesn't catch these, because it assumes that all indents are 8-space. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2007-07-31msp3400-driver.c: kmalloc + memset conversion to kzallocMauro Carvalho Chehab
From: Mariusz Kozlowski <m.kozlowski@tuxland.pl> drivers/media/video/msp3400-driver.c | 28945 -> 28898 (-47 bytes) drivers/media/video/msp3400-driver.o | 125620 -> 125320 (-300 bytes) Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl> CC: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-20Backport changeset from kernel mainstreamMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> kernel-sync: The original patch from Yoann Padioleau <padator@wanadoo.fr>: Transform some calls to kmalloc/memset to a single kzalloc (or kcalloc). Here is a short excerpt of the semantic patch performing this transformation: @@ type T2; expression x; identifier f,fld; expression E; expression E1,E2; expression e1,e2,e3,y; statement S; @@ x = - kmalloc + kzalloc (E1,E2) ... when != \(x->fld=E;\|y=f(...,x,...);\|f(...,x,...);\|x=E;\|while(...) S\|for(e1;e2;e3) S\) - memset((T2)x,0,E1); @@ expression E1,E2,E3; @@ - kzalloc(E1 * E2,E3) + kcalloc(E1,E2,E3) Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-16Clean up setting state and scheduling timeoutsMauro Carvalho Chehab
From: Robert P. J. Day <rpjday@mindspring.com> Replace assignments to "current->state" with the preferred calls to schedule_timeout_interruptible(). Signed-off-by: Robert P. J. Day <rpjday@mindspring.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-03-12Fix suspend/resume in msp3400 and tunerHans Verkuil
From: Jean Delvare <khali@linux-fr.org> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-03-11msp_attach must return 0 if no msp3400 was found.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Returning -1 causes the probe to stop, but it should just continue instead. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-02-28Add VIDIOC_G_CHIP_IDENT to various i2c modulesHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
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-19compat: Add code to compat.h for try_to_sleep()Trent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> Compat.h used to have an argument, now it doesn't. There was also some code: if (current->flags & PF_FREEZE) { refrigerator(PF_FREEZE); } which is the same as try_to_freeze(), and so can be replaced by it. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2006-12-20Msp3400: fix kthread_run error checkMauro Carvalho Chehab
From: Akinobu Mita <akinobu.mita@gmail.com> The return value of kthread_run() should be checked by IS_ERR(). Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-12-18Fix broken audio mode handling for line-in in msp3400.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The wrong matrix was used when an external input was selected instead of the tuner input. The rxsubchans field was also not initialized to STEREO for an external input. And finally the msp34xxg_detect_stereo() should not try to detect stereo for an external input, that code is for the tuner input only. Together these bugs made it hit 'n miss whether you ever got stereo out of the msp3400 for an external input. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-12-16Several stuff backported from 2.6.19-git seriesMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> - INIT_WORK replaced by INIT_DELAYED_WORK - struct work_struct replaced by struct delayed_work - callback parameters also changed - SLAB_KERNEL replaced by GFP_KERNEL - linux/suspend.h replaced by linux/freezer.h - on cpia: INIT_WORK replaced by INIT_WORK_NAR - file->f_dentry->d_inode replaced by file->f_path.dentry->d_inode Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-10-01Fix msp343xG handling (regression from 2.6.16)Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The msp3430G and msp3435G models cannot do Automatic Standard Detection. So these should be forced to BTSC. These chips are early production versions for the msp34xxG series and are quite rare. The workaround for kernel 2.6.18 is to use 'standard=32' as msp3400 module option. Due to broken handling of the 'standard' option in 2.6.17 there is no workaround possible for that kernel. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-07-23Fix for compilation without V4L1 or V4L1_COMPATMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Removed usage of HAVE_V4L1 Including videodev.h will just include videodev2.h if V4L1 is not supported V4L1 code at core drivers will honor CONFIG_V4L1_COMPAT stuff Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-15Add compat.h code for schedule_timeout_interruptible()Trent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> Add a static inline version of schedule_timeout_interruptible(), it's only two lines, to compat.h. This will make bt866 and ks0127 compile with pre 2.6.14 kernels. Remove #if/#else code from msp3400, saa7134-tvaudio, and vivi that used to handle this. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2006-06-18Use control helpers for saa7115, cx25840, msp3400.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Replace hardcoded control description by the standard ones supplied by v4l2-common. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-04-02Improve line-in handlingHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> - improve handling of the EXTERN input: don't start an unnecessary carrier scan - improve the LOG_STATUS output - ensure that a carrier scan is started again when switching back to the tuner. - set correct prescale for L-NICAM Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-04-01Remove obsolete commands from tvp5150.cHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> - Remove old DECODER_ commands from tvp5150.c, replacing them with newer ones if appropriate. - Small VIDIOC_G_TUNER fixes in msp3400 and tuner. - Fix VIDIOC_S_TUNER support in em28xx. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-04-01More msp3400 and bttv fixesHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> - remove obsolete VIDIOC_S_INPUT i2c call in bttv - translate VIDIOCSFREQ to VIDIOC_S_FREQUENCY in i2c call - improve muting during carrier scan in msp3400 - don't start scan unless really needed. - no longer reset chip for msp3400c/d. - remove v4l2 check in tuner-core (radio stops after using the TV) - add missing VIDIOC_INT_ strings in v4l2-common.c Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-03-31Fix msp3400c and bttv stereo/mono/bilingual detection/handlingHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> - msp3400c did not detect the second carrier, thus being always mono. - properly mute the msp3400c while detecting the carrier. - fix checks on the presence of scart2/3 inputs and scart 2 output. - implement proper audio mode fallbacks for msp3400c/d, identical to the way msp3400g works. - MODE_STEREO no longer produces dual languages when set for a bilingual transmission, instead it falls back to LANG1. Use LANG1_LANG2 to hear both languages of a bilingual transmission. This is much more intuitive for the user and is in accordance with the preferred usage in the v4l2 specification. - bttv tried to implement v4l2 calls with v4l1 calls to the i2c devices, completely mangling the audmode/rxsubchans handling. v4l2 calls now do v4l2 calls to the i2c devices. - fixed broken i2c_vidiocschan in bttv. - add start/end lines to LOG_STATUS. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-03-28Don't set msp3400c-non-existent registerHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The driver tried to set a register that is not present on msp3400c devices. Add the missing test. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-03-20Remove VIDIOC_G/S_AUDOUT from msp3400Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> VIDIOC_G/S_AUDOUT does not belong in msp3400 (it's a user level command, not to be used in internal i2c drivers). Also fix a compile warning and improve LOG_STATUS. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-03-19Always wake thread after routing change.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-03-19Implement correct msp3400 input/output routingHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> - implement VIDIOC_INT_S_AUDIO_ROUTING for msp3400 and tvaudio - use the new command in bttv, pvrusb2 and em28xx. - remove the now obsolete MSP_SET_MATRIX from msp3400 (yeah!) - remove the obsolete VIDIOC_S_AUDIO from msp3400. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-03-19Add new media/msp3400.h header containing the routing macrosHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Moved msp3400.h to msp3400-driver.h. Created media/msp3400.h with the new routing defines and lots of comments. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-03-19Last round of msp3400 cleanups before adding routing commandsHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Lots of cleanups: - remove duplicate actions - add D/K3 Dual FM-Stereo and D/K NICAM FM (HDEV3) support - put prescales in the proper place - add missing D/K NICAM - msp34xxg_reset now only resets instead of also starting the autodetect (moved that to msp34xxg_thread) - fix support for SAP. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-03-19Move msp_modus to msp3400-kthreads, add JP and KR std detectionHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> msp_modus is 'G' model specific. Moved it to kthreads and also added proper handling for the Japanese and South Korean TV standards. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-03-19Make scart definitions easier to handleHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> For the new routing implementation it is easier if all the 'normal' scart inputs (IN1-IN4) are consecutive. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-03-19Cleanup audio input handlingHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Cleanup audio input handling in bttv and tvaudio: - inputs were specified that were never used - mute was handled as a special input which led to confusing code - confusing naming made it difficult to see if the setting was for i2c or gpio. The old audiochip.h input names moved to tvaudio.h. Currently this is used both by tvaudio and msp3400 until the msp3400 implements the new msp3400-specific inputs. Detect in bttv the tvaudio and msp3400 i2c clients and use these client pointers to set the inputs directly instead of broadcasting the command. Removed AUDC_SET_INPUT. Now replaced by VIDIOC_S_AUDIO. This will be replaced again later by the new ROUTING commands. Removed VIDIOC_G_AUDIO implementations in i2c drivers: this command is a user level command and not to be used internally. It wasn't called at all anyway. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-01-22audmode and rxsubchans fixes (VIDIOC_G/S_TUNER)Hans Verkuil
- audmode and rxsubchans fixes in msp3400, tuner, tvaudio and cx25840. - msp3400 cleanups Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-01-18Fix handling of VIDIOC_G_TUNER audmode in msp3400Hans Verkuil
Fix handling of VIDIOC_G_TUNER audmode in msp3400: audmode is only changed by the user with S_TUNER, never by the driver. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-01-15Return -EINVAL for unknown commands in msp3400 module.Hans Verkuil
- Return -EINVAL for unknown commands. Requested by Mike Isely. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-01-12removed uneeded init on structs like static int foo=0Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> - static vars are equal to zero by default. Removed unnecessary =0 from them, saving some data space; - Fixed compiling against kernels bellow 2.6.13. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-01-11Fixes some bad global variablesMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@brturbo.com.br> - debug global var is already used inside kernel. - v4l_dbg now expects the debug var - global vars inside msp34xx renamed to msp_* Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2006-01-08Fix stereo and standard reporting of msp3400 (esp. for radio)Hans Verkuil
- Add VIDIOC_LOG_STATUS to the radio device ioctl list. - Reduce the confusion between modes and standards - Fix stereo reporting for radio. - Don't set i2c configuration if the chip doesn't support it. - Fix reporting of current standard for radio. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-01-08msp3400 audio handling bug fixes.Hans Verkuil
- check capabilities for audio settings (volume, balance, bass, treble, loudness, mute) - added loudness support - added missing VIDEO_AUDIO_BALANCE flags for v4l1 compatibility - do not call msp_any_detect_stereo for non-autoselect chips to retrieve the current stereo setting: that will temporarily mute the sound. It is only needed when the stereo mode might be changed, and for autoselect msp processors that do not periodically need to update their stereo setting. - do not wake up the thread if the standard did not change. Prevents temporary audio drop-out if the standard is set to the same value. - fix confused stereo detect code where V4L2_TUNER_SUB_STEREO and V4L2_TUNER_MODE_STEREO values were used incorrectly. - stereo mode reporting was broken (v4l2 value used to index a string array expecting v4l1 mode values). - do not set dsp register 0x30 in the 3410d thread: that register does not exist for pre-'G' revision msp chips. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-01-08msp3400: use v4l2_std_id and determine chip capabilities.Hans Verkuil
- Replace old norm by the v4l2_std_id values. - Add code to correctly detect the various capabilities of the various msp chips. It's not yet used, that's going to be the next step. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-01-08i2c fixes and cleanupsMauro Carvalho Chehab
- Miscelaneous i2c cleanups and fixes to work with kernel >2.6.15 - linux/sound/pci/bt87x.c updated to kernel version. kernel-sync Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2006-01-07printk cleanupsMauro Carvalho Chehab
- some fixes from the previous patches - printk replaced by v4l_ print macros on saa6752 and bt832 Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2006-01-07Some cleanups at I2C modulesMauro Carvalho Chehab
- Latest patch reverted, since __stringfy seems to be needed for kernel < 2.6.15 - Applied kernel I2C cleanups from Jean Delaware. - driver names simplified to allow usage of newer printk macros at v4l2-common.h Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2006-01-02convert diagnostics over to the new v4l2-common.h macros.Hans Verkuil
- convert diagnostics over to the new v4l2-common.h macros. - deprecated tuner_debug option, the new option is debug. - renamed cx25840_debug to debug. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-01-02Added new diagnositics macros, convert msp3400 to the new macros.Hans Verkuil
- Added new v4l_err, v4l_warn, v4l_info and v4l_dbg macros to v4l2-common.h for use in v4l-dvb i2c drivers. This ensures a unique prefix for each device instance. - At a later stage these macros may be reimplemented using the device-generic macros from device.h. - Converted the msp3400 driver to the new macros. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-01-02Split msp3400.c into msp3400-driver.c and msp3400-kthreads.cHans Verkuil
- Split msp3400.c into msp3400-driver.c and msp3400-kthreads.c. - Removed experimental DFPREG ioctls. If this is really needed one day then it should be implemented using VIDIOC_G/S_REGISTER. - Added missing BALANCE control info for VIDIOC_QUERYCTRL. - Still more cleanup, clarified some kernel messages. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2006-01-01more cleanups, simplify volume/balance/bass/treble handlingHans Verkuil
Continue cleanup effort: - more cosmetic changes - combine volume, balance, bass and treble into one audio function. Revert old 2.4 code that crept in. - print internal ioctls using new debug function. - marked all msp3400c (aka manual) functions as such. - removed some unused data structures. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2005-12-31msp3400.c cleanup (almost all cosmetic)Hans Verkuil
Step 1 of the msp3400.c cleanup. Most changes are all cosmetic (moved code around, renamed functions and variables). New additions: - VIDIOC_LOG_STATUS for debugging. - More user friendly messages on driver load. - 'simple' renamed to 'autodetect' - 'simpler' renamed to 'autoselect' Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2005-12-26Fixed API to set I2S speed controlMauro Carvalho Chehab
- Created a new ioctl to control I2S speed. Old calls to an inadequate V4L2 API replaced. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-12-25replace <media/i2c-compat.h> with "i2c-compat.h"Michael Krufky
-#include <media/i2c-compat.h> +#include "i2c-compat.h" Signed-off-by: Michael Krufky <mkrufky@m1k.net>