summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
AgeCommit message (Collapse)Author
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-01-19pvrusb2: Emit VIDIOC_S_TUNER correctlyMike Isely
From: Mike Isely <isely@pobox.com> Audio mode changes are not private to the audio chip - other I2C modules need to see this as well. And since the command in question is VIDIOC_S_TUNER which is a standard v4l2 command, we really should be broadcasting it out. This change sets up a broadcast pathway for VIDIOC_S_TUNER and also eliminates the now redundant code from the audio chip handler. This fix enables stereo reception for the FM radio Signed-off-by: Mike Isely <isely@pobox.com>
2007-01-19pvrusb2: VIDIOC_G_TUNER cleanupMike Isely
From: Mike Isely <isely@pobox.com> Clean up use of VIDIOC_G_TUNER; we now correctly gather info from all the I2C client modules. Also abide by V4L2_TUNER_CAP_LOW appropriately. Signed-off-by: Mike Isely <isely@pobox.com>
2006-12-27pvrusb2: cosmetic comment tweakMike Isely
From: Mike Isely <isely@pobox.com> Signed-off-by: Mike Isely <isely@pobox.com>
2006-12-27pvrusb2: Better radio versus tv frequency handlingMike Isely
From: Mike Isely <isely@pobox.com> Separate track radio versus tv frequency so that when we switch modes we can also switch to a sane frequency appropriate for the mode. Also implement logic to automate mode switching in certain cases. Signed-off-by: Mike Isely <isely@pobox.com>
2006-12-27pvrusb2: Fix tuning calculation when in radio modeMike Isely
From: Mike Isely <isely@pobox.com> Frequency units in V4L2 are apparently different when in radio mode compared to tv mode. Why? Who knows. This change adapts the driver appropriately - so that internally we always only deal in Hz and don't have to muck with craziness like this. Signed-off-by: Mike Isely <isely@pobox.com>
2006-12-27pvrusb2: Fix tuner frequency calculationMike Isely
From: Mike Isely <isely@pobox.com> A conversion from Hz to V4L frequency units was accidentally removed by an earlier change. Restore it. Signed-off-by: Mike Isely <isely@pobox.com>
2006-12-27pvrusb2: video standard broadcast fix for radio modeMike Isely
From: Mike Isely <isely@pobox.com> Ensure we don't accidentally broadcast the standard while in radio mode. Signed-off-by: Mike Isely <isely@pobox.com>
2006-12-27pvrusb2: Make units uniform when tracking tuning frequencyMike Isely
From: Mike Isely <isely@pobox.com> The initial radio implementation used different units for tuning when in radio mode. This changes everything to Hz. Signed-off-by: Mike Isely <isely@pobox.com>
2006-12-27pvrusb2: Enable radio mode round #2Mike Isely
From: Pantelis Koukousoulas <pakt223@freemail.gr> This is the logic that a) Ensures /sys/class/pvrusb2/sn-*/ctl_frequency/{max,min}_val are "automagically" reset to sane values on each mode change. b) Allows tuning to a radio frequency by something like: echo `perl -e "print int(94.9*16000 + 0.5)"` \ > /sys/class/pvrusb2/sn-*/ctl_input/cur_val The trick was to take advantage of the already existing .get_{min,max}_value function pointers in pvr2_ctrl, to "dynamically override" the hardcoded values for min/max frequency at runtime. For a moment I thought to dispose of the hardcoded MIN/MAX_FREQ and use the hirange/lowrange fields of the v4l2_tuner struct instead, but then I see that tuner-core.c kinda hardcodes these as well, so I decided to not bother. --Pantelis Signed-off-by: Pantelis Koukousoulas <pakt223@freemail.gr> Signed-off-by: Mike Isely <isely@pobox.com>
2006-12-27pvrusb2: Enable radio mode round #1Mike Isely
From: Pantelis Koukousoulas <pakt223@freemail.gr> This is the logic that supports switching modes via e.g., echo radio > /sys/class/pvrusb2/sn-*/ctl_input/cur_val. To do the mode switching we need to a) broadcast AUDC_SET_RADIO and b) issue the CX2341X_ENC_MUTE_VIDEO command to the encoder. The first is done by adding a new pvr2_i2c_op and having it trigger on input change, the second by adding this command in pvr2_encoder_start() and requesting an encoder restart on input change by setting stale_subsys_mask appropriately. The clues about AUDC_SET_RADIO and CX2341X_ENC_MUTE_VIDEO were kindly provided by Hans Verkuil on the pvrusb2 mailing list. The idea to implement mode switching this way (on input change) is due to Mike Isely. Why AUDC_SET_RADIO/VIDIOC_S_STD are used for switching? I can 't be sure, but I think this can be traced to a cornell student being the first to implement radio support in ivtv "as a different standard". I think the rest just evolved from there (it 's in the ivtv ML archives). --Pantelis Signed-off-by: Pantelis Koukousoulas <pakt223@freemail.gr> Signed-off-by: Mike Isely <isely@pobox.com>
2006-08-08Fix a warning on PPC64Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c: In function 'set_standard': drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c:33: warning: format '%llx' expects type 'long long unsigned int', but argument 2 has type 'v4l2_std_id' Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-06-30Clean out a zillion sparse warnings in pvrusb2Mauro Carvalho Chehab
From: Mike Isely <isely@pobox.com> Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-04-19Another rework of pvrusb2 video standard handlingMike Isely
From: Mike Isely <isely@pobox.com> Clean up logic for handling video standards in the pvrusb2 driver. New implementation should be able to handle all possible V4L defined video standards now, and it should be far easier to maintain this going forward. Signed-off-by: Mike Isely <isely@pobox.com>
2006-04-19Rework pvrusb2 internal controls implementationMike Isely
From: Mike Isely <isely@pobox.com> Rework controls internal architecture. Rework video standard handling. This is a major change. Signed-off-by: Mike Isely <isely@pobox.com>
2006-04-19Get rid of redundant inclusion of videodev2.hMike Isely
From: Mike Isely <isely@pobox.com> Signed-off-by: Mike Isely <isely@pobox.com>
2006-04-11Merge: from V4L1 treeMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-03-28Major pvrusb2 rework to remove translationsMike Isely
From: Mike Isely <isely@pobox.com> Rework entire internal controls interface to eliminate the need for visibly defined control IDs which must otherwise be translated by the V4L2 public interface. As part of this work, internal structures which mimiced various V4L2 structures (video standards, audio modes) have been reworked to actually use the native structures. This triggered a _significant_ rework for how video standards are dealt with (and what is in place now should be much more flexible and forgiving for various handling less-common video standards). Signed-off-by: Mike Isely <isely@pobox.com>
2006-03-25Merge from masterMike Isely
From: Mike Isely <isely@pobox.com> Signed-off-by: Mike Isely <isely@pobox.com>
2006-03-25Adjust pvrusb2 stream on/off control handlingMike Isely
From: Mike Isely <isely@pobox.com> Code in pvrusb2 which issues stream on/off commands was previously in a place specific to the saa7115. This change moves that function to a place where it can be used for other things (like controlling a future cx25840). Signed-off-by: Mike Isely <isely@pobox.com>
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-02-26moved pvrusb2 driver into the kernel treeMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>