summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/saa7134/saa7134-i2c.c
AgeCommit message (Collapse)Author
2009-05-27Building system: Restore compilation with kernels older than 2.6.29Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> Mostly due to ir-kdb-i2c, but also due to two new drivers, compilation with kernels older than 2.6.29 were broken. This quick and dirty changeset, generated semi-automatically, restaures backport to the subsystem by adding lots of #ifs. It is possible to write a much more small changeset that would restore backport without adding so many ifs, but, due to the lack of time, this will also solve it. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-05-27merge: http://www.kernellabs.com/hg/~mkrufky/hvr1110Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-05-13ir-kbd-i2c: Use initialization dataMauro Carvalho Chehab
From: Jean Delvare <khali@linux-fr.org> For specific boards, pass initialization data to ir-kbd-i2c instead of modifying the settings after the device is initialized. This is more efficient and easier to read. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-05-13ir-kbd-i2c: Switch to the new-style device binding modelMauro Carvalho Chehab
From: Jean Delvare <khali@linux-fr.org> Let card drivers probe for IR receiver devices and instantiate them if found. Ultimately it would be better if we could stop probing completely, but I suspect this won't be possible for all card types. There's certainly room for cleanups. For example, some drivers are sharing I2C adapter IDs, so they also had to share the list of I2C addresses being probed for an IR receiver. Now that each driver explicitly says which addresses should be probed, maybe some addresses can be dropped from some drivers. Also, the special cases in saa7134-i2c should probably be handled on a per-board basis. This would be more efficient and less risky than always probing extra addresses on all boards. I'll give it a try later. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
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-02-12Added support for AVerMedia Cardbus Hybrid remote controlMauro Carvalho Chehab
From: Oldřich Jedlička <oldium.pro@seznam.cz> Added support for I2C device at address 0x40 and subaddress 0x0d/0x0b that provides remote control key reading support for AVerMedia Cardbus Hybrid card, possibly for other AVerMedia Cardbus cards. The I2C address 0x40 doesn't like the SAA7134's 0xfd quirk, so it was disabled. Signed-off-by: Oldřich Jedlička <oldium.pro@seznam.cz> [mchehab@redhat.com: CodingStyle fixes] Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-05-20saa7134: fix quirk in saa7134_i2c_xfer for the saa7131 bridgeMichael Krufky
From: Michael Krufky <mkrufky@kernellabs.com> The i2c quirk in the saa7134_i2c_xfer function does a bogus write to i2c address 0xfd, to work around a bug in the silicon that affects read transactions. Unfortunately, this hack is not working properly, since the bogus write is to 0xfd, an invalid i2c address. Fix this quirk by using an actual valid i2c address, 0xfe, which is still unlikely to be used as an i2c address for any actual i2c client. This is required in order to properly communicate with a TDA10048 DVB-T demod located at i2c address 0x10 on the primary i2c bus. Priority: normal Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
2009-01-17saa7134: convert to the new v4l2 framework.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Register v4l2_device and switch to v4l2_subdev to access the i2c modules. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-11-25fix boards for kernels with algo_controlMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> changeset 4ecae6da8244 removed algo_control from i2c drivers. However, on older kernels, a dummy function to implement algo_control is required, otherwise, an OOPS is generated. This patch adds a backport for all i2c drivers that defines an i2c_algorithm, except for cafe_ccic, since OLPC hardware only works for kernels newer than 2.6.19. Some of the backported drivers would need also extra changes to work with older kernels, as specified on v4l/versions.txt. Yet, I decided to add the backport for those drivers also, since the lack of algo_control doesn't generate any compilation error, but it is enough to break the driver. So, better to all for all boards than to allow compiling a kernel backported that just generates OOPS. Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-13Add support for MSI TV@nywhere Plus remoteMauro Carvalho Chehab
From: Brian Rogers <brian_rogers@comcast.net> The IR controller has a couple quirks. It won't respond until some other device on the bus is probed. To work around that, probe 0x50 first. Then, since it won't respond to a zero-byte read, probe with a one-byte read. Signed-off-by: Brian Rogers <brian_rogers@comcast.net> [mchehab.redhat.com: Fix merge conflicts and remove an unused var] Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-09-06saa7134-empress: fix changing the capture standard for non-tuner inputsHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> When changing the standard the saa6752hs was not updated unless the input was the TV tuner. The saa6752hs should be updated regardless of the input. In addition the S_STD and G_STD ioctls for the mpeg video device didn't do anything. This is now fixed: they behave just like S_STD and G_STD on the video0 device. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-07-08v4l-dvb: remove support for kernels < 2.6.16Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Phase 4 removes the compatibility support for kernels < 2.6.16. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-07-08v4l-dvb: remove support for kernels < 2.6.10Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Phase 2 removes support for kernels < 2.6.10. 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-27saa7134-empress: fix MPEG control supportHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The MPEG controls could not be enumerated and so could not be read or set through the v4l2-ctl utility or shown in control panels. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-04-26saa7134: fix tuner setupMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Tuner setup were happening during i2c attach callback. This means that it would happen on two conditions: 1) if tuner module weren't load, it will happen at request_module("tuner"); 2) if tuner is not compiled as a module, or it is already loaded (for example, on setups with more than one tuner), it will happen when saa7134 registers I2C bus. Due to that, if tuner were loaded, tuner setup will happen _before_ reading the proper values at tuner eeprom. Since set_addr refuses to change for a tuner that were previously defined (except if the tuner_addr is set), this were making eeprom tuner detection useless. This patch removes tuner type setup from saa7134-i2c, moving it to the proper place, after taking eeprom into account. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-23saa7134: fix: Properly handle busy states on i2c busMauro Carvalho Chehab
From: Dmitry Belimov <d.belimov@gmail.com> There are two conditions, reported by saa7134 that indicates that the I2C bus is busy: TO_SCL and TO_ARB. On both states, it needs to wait for I2C release, before using the bus. Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov <d.belimov@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-27[PATCH] static memoryDouglas Schilling Landgraf
From: Douglas Schilling Landgraf <dougsland@gmail.com> - Static memory is always initialized with 0. - Replaced in some cases C99 comments for /* */ Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
2008-01-07Add Beholder TV 401/405/407/409/505/507/609/M6 supportMauro Carvalho Chehab
From: Andrey J. Melnikoff (TEMHOTA) <temnota@kmv.ru> This patch updates cardlist for Beholder TV tuners: old models (with GPIO ir) 401, 403, 405, 407, 409, 505, 507 and add support for 607, 609, M6 cards with new i2c-ir. Signed-off-by: Igor Kuznetsov <igk72@yandex.ru> Signed-off-by: Andrey J. Melnikov <temnota@kmv.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-18Replace TDA9887_SET_CONFIG by TUNER_SET_CONFIGMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Currently, the only tuner-specific device that allows special configurations is tda9887. However, tea5767 also may require some special configurations (for example, to specify a different Xtal freq). This patch replaces TDA9887_SET_CONFIG by a more generic internal ioctl (TUNER_SET_CONFIG). The newer one allows specifying what tuner is appliable to a configuration set, and allows an arbitrary configuration struct. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-17backport changeset 3be27d37c257fa5f99363f9c8e06e405cbad712eMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Original description: i2c: Remove NOP i2c_algorithm.algo_control() methods This removes NOP implementations of i2c_algorithm.algo_control. With this change, there are no implementations of this hook in the kernel.org tree ... that hook seems about ripe to remove. kernel-sync: Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-08-21Cleanup: remove linux/moduleparam.h from drivers/media filesMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Since at least kernel 2.6.12-rc2, module.h includes moduleparm.h. This patch removes all occurences of moduleparm.h from drivers/media files. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-02Fix v4l-dvb backward compatibilityMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Due to several internal API changes on kernel, kernel backward compatibility were lost. Basically, compat.h should be the last include for it to work properly. This patch basically reorders kernel headers to allow backward compat to work fine. Also: Some includes were added after some non-include macros, on old drivers. Better to keep all includes at the beginning of the files. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-03-29Use ARRAY_SIZE instead of a magic numberMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-02-17merge with main repositoryHartmut Hackmann
From: Hartmut Hackmann <hartmut.hackmann@t-online.de> Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
2007-02-15updated support for tuner callbacksHartmut Hackmann
From: Hartmut Hackmann <hartmut.hackmann@t-online.de> This change supplies a more generic version of the tuner callback. The tuner struct now has a function pointer int (*tuner_callback) (void *dev, int command, int arg) additionally to a int config parameter. both can be set through the TUNER_SET_TYPE_ADDR client call. Note that the meaning of the parameters depend on the tuner type. Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
2007-02-06Convert to generic boolean-valuesMauro Carvalho Chehab
From: Richard Knutsson <ricknu-0@student.ltu.se> Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-01-23Added a config entry and a gpio function pointer to the tuner structHartmut Hackmann
From: Hartmut Hackmann <hartmut.hackmann@t-online.de> These entries mainly are to support configurations of the tda827x silicon tuner with a preamplifier. The values can be set throgh the attach inform or through the extended TUNER_SET_TYPE_ADDR client call. The function pointer will only be updated if the parameter is not NULL. Since a typecast is necessary to set the pointer, i added a typedef for this pointer (tuner_gpio_func_t) in tuner.h Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
2006-11-29saa7134: add support for remote control of Hauppauge HVR1110Michael Krufky
From: Thomas Genty <tomlohave@gmail.com> This patch adds support for the remote control bundled with the Hauppauge HVR1110 Signed-off-by: Thomas Genty <tomlohave@gmail.com> Signed-off-by: Nickolay V. Shmyrev <nshmyrev@yandex.ru> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2006-04-11Since we are not using CVS, $Id makes no sense anymoreMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
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-01ioctls cleanups.Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@brturbo.com.br> - Now, all internal ioctls are at v4l2-common.h - removed unused ioctl at saa6752hs.h - all debug ioctl code moved to v4l2-common.c - removed duplicated stuff from other cards Signed-off-by: Michael Krufky <mkrufky@m1k.net> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-10-18 - SAA713x keymaps and key builders were moved from ir-kbd-i2c.cMauro Carvalho Chehab
to saa7134-input.c - saa7134-i2c's attach now detects I2C IR and calls saa7134 specific code. - Small bugfix at ir-kbd-i2c. - disable_ir now unregisters i2c device. Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-10-16- Whitespace Cleanups.Mauro Carvalho Chehab
- Whitespace script improved. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-10-09From: Mauro Carvalho Chehab <mchehab@brturbo.com.br>Mauro Carvalho Chehab
- Lots of small changes to allow compiling with kernel 2.4. Compilation result not tested yet. - After this patch, .version should be removed, since its syntax has changed. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-09-19 * saa6588.c: (saa6588_probe):Michael Krufky
- fix build for 2.6.14 * compat.h: * ir-kbd-i2c.c: (ir_probe): * saa7134-i2c.c: * tvaudio.c: (chip_probe): - removed some #if kernel version > 2.6.13 ... using compat.h instead. Signed-off-by: Michael Krufky <mkrufky@m1k.net>
2005-09-13 * bt832.c: (bt832_probe):Michael Krufky
* bttv-i2c.c: (attach_inform): * cx88-i2c.c: (attach_inform), (detach_inform): * id.h: * ir-kbd-i2c.c: (ir_probe): * msp3400.c: (msp34xx_sleep), (msp_attach): * saa6588.c: * saa6752hs.c: * saa7134-i2c.c: (attach_inform): * saa7134-tvaudio.c: (tvaudio_sleep): * tda7432.c: (tda7432_probe): * tda9875.c: (tda9875_probe): * tda9887.c: (tda9887_probe): * tuner-core.c: * tveeprom.c: (tveeprom_attach_adapter): * tvmixer.c: (tvmixer_ioctl), (tvmixer_clients), (tvmixer_cleanup_module): * video-buf.c: (videobuf_dma_free): - Step two, in preparation for 2.6.14-rcX compatability: - Compile tested against vanila kernels 2.6.13 & 2.6.8 - 2.6.14 compile still broken... Signed-off-by: Michael Krufky <mkrufky@m1k.net>
2005-07-22 * scripts/merge-trees.sh:Michael Krufky
- New script to symlink DVB frontend code from dvb-kernel cvs tree into patched video4linux cvs tree for testing and development across both trees. * scripts/unmerge-trees.sh: - New script to be run after development, and before generating patches or making cvs commits. This removes the symlinks to the frontend code, and reverts the patch to the video4linux tree created by merge-trees.sh . Signed-off-by: Michael Krufky <mkrufky@m1k.net>
2005-07-21Ensure a sufficient I2C bus idle time between 2 messagesHartmut Hackmann
Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t.online.de>
2005-07-15 - linux/version.h removed at linux-2.6.13-rc3-mm1.Mauro Carvalho Chehab
- Removed remaining trailing spaces. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-07-07 * lgdt3302.c:Michael Krufky
- Fix bug in lgdt3302_read_status to return correct FE_HAS_SIGNAL and FS_HAS_CARRIER status. * msp3400.c, saa7134-cards.c, saa7134-i2c.c: * tuner-simple.c, video-buf-dvb.c: - Remove trailing whitespace. Signed-off-by: Mac Michaels <wmichaels1@earthlink.net> Signed-off-by: Michael Krufky <mkrufky@m1k.net>
2005-07-05 Rename tuner structures fields. Move MD detection hack toNickolay V. Shmyrev
saa7134-cards.c
2005-07-042005-07-04 17:02 mchehabMauro Carvalho Chehab
* saa7134-i2c.c: - specifying tuner type by parameter was not working. fixed. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-07-03 * bttv-i2c.c, cx88-i2c.c, saa7134-i2c.c:Mauro Carvalho Chehab
- I2C cleanups. Now, all drivers uses the same basic structure. * cx88-video.c: - Duplicated code commented. Should be removed soon. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-07-02 * bttv-cards.c, bttv-i2c.c, cx88-i2c.c, cx88-video.c:Nickolay V. Shmyrev
* saa7134-cards.c, saa7134-core.c, saa7134-i2c.c: * tuner-core.c, tuner.h: Rename v4l2_tuner field in tun_addr structure. Cleanup tuner private calls.
2005-06-28 * cx88-core.c, cx88-dvb.c, cx88-input.c:Michael Krufky
* lgdt3302.c, lgdt3302_priv.h, or51132.c: * saa7134-cards.c, saa7134-core.c: * saa7134-dvb.c, saa7134-i2c.c, saa7134-oss.c: * saa7134-tvaudio.c, saa7134-video.c: * tda8290.c, tea5767.c, tuner-simple.c: - Clean up ALL whitespace using scripts/strip-trailing-whitespaces.sh Signed-off-by: Michael Krufky <mkrufky@m1k.net>
2005-06-28 * cx88-i2c.c, cx88-video.c, saa7134-i2c.c, tuner-core.c, tuner.h:Mauro Carvalho Chehab
- Improved support for multi tuners on multi boards. *tuner-core.c: - Pal M and PAL N added to tuner_fixup_std * tuner-simple.c: - Eliminated old tea code from tuner-simple. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
2005-06-19Second part of Compro PatchNickolay V. Shmyrev
2005-06-12 * tuner-core.c:Mauro Carvalho Chehab
- Solved a problem when compiling with some versions of gcc - Solved a problem compiling without CONFIG_TUNER_MULTI_I2C - cx88-i2c.c, saa7134-i2c.c: - Make it compatible with kernel 2.6.12-rc6-mm1
2005-01-24- sync with 2.6.11-rc2 & latest dvb cvs.Gerd Knorr
- misc card-specific tweaks.