summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
AgeCommit message (Collapse)Author
2007-12-08pvrusb2: rework device descriptor layoutMike Isely
From: Mike Isely <isely@pobox.com> The pvrusb2 driver tries to keep all device specific attributes in a single data structure in one source file. This change further cleans up how that table is set up. We now try to group everything together for each specific device, and the number of symbols exported from this module has now been reduced to a single global. Signed-off-by: Mike Isely <isely@pobox.com>
2007-12-02pvrusb2: minor rework for default video standard handlingMike Isely
From: Mike Isely <isely@pobox.com> pvrusb2: When a per-device-type default video standard is declared, handle it in such a way that it can be correctly and unambiguously reported in the system log. Signed-off-by: Mike Isely <isely@pobox.com>
2007-12-02pvrusb2: Implement default standard selection based on device typeMike Isely
From: Mike Isely <isely@pobox.com> This adds a default video standard setting to the pvr2_device_desc structure for describing device types. With this change it is possible to set a reasonable default standard based on device type. Signed-off-by: Mike Isely <isely@pobox.com>
2007-12-02pvrusb2: Change division to bit-or for tveeprom standardsMike Isely
From: Roel Kluin <12o3l@tiscali.nl> Signed-off-by: Roel Kluin <12o3l@tiscali.nl> Signed-off-by: Mike Isely <isely@pobox.com>
2007-11-25pvrusb2: Existence of Hauppauge ROM is a device-specific attributeMike Isely
From: Mike Isely <isely@pobox.com> Arrange so that the pvrusb2 driver can optionally work without a Hauppauge ROM being present - which is fairly important for devices that happen to not come from Hauppauge. The expected existence of a Hauppauge ROM is now a device attribute. The tuner type is now also a device attribute, which is consulted if there is no ROM. Signed-off-by: Mike Isely <isely@pobox.com>
2007-11-25pvrusb2: Miscellaneous tweaks for controlling tuner type and video standardMike Isely
From: Mike Isely <isely@pobox.com> Correctly mark when a tuner type is set. Report more faithfully information about known supported device video standards. Signed-off-by: Mike Isely <isely@pobox.com>
2007-11-25pvrusb2: Implement functions to pass descriptive hardware infoMike Isely
From: Mike Isely <isely@pobox.com> Implement additional pvrusb2 device info table entries for a device identifier and a device description. Export this information via the driver's internal API. Make this information available via the sysfs driver interface. Also propagate this information into the v4l2 capability structure. An app can now retrieve and report a descriptive string about the particular type of hardware device it is operating. Signed-off-by: Mike Isely <isely@pobox.com>
2007-11-25pvrusb2: Remove obsolete global hardware type enumerationMike Isely
From: Mike Isely <isely@pobox.com> Device-specific driver behavior is now defined by generic device characteristics rather than by specific device model information. With this change, the hardware type field can go away, thus this change. Signed-off-by: Mike Isely <isely@pobox.com>
2007-11-25pvrusb2: Centralize device specific attributes into a single place.Mike Isely
From: Mike Isely <isely@pobox.com> The pvrusb2 driver currently supports two variants of the Hauppauge PVR USB2. However there are other hardware types potentially supportable, but the driver at the moment is not structured to make it easy to describe these minor variations. This changeset is the first set of changes to make such additional device support possible. Device attributes are held in several tables all contained within pvrusb2-devattr.c; all other device-specific driver behavior now derives from these tables. Signed-off-by: Mike Isely <isely@pobox.com>
2007-11-25pvrusb2: Rework pipeline state controlMike Isely
From: Mike Isely <isely@pobox.com> This is a new implementation for video pipeline control within the pvrusb2 driver. Actual start/stop of the pipeline is moved to the driver's kernel thread. Pipeline stages are controlled autonomously based on surrounding pipeline or application control state. Kernel thread management is also cleaned up and moved into the internal control structure of the driver, solving a set up / tear down race along the way. Better failure recovery is implemented with this new control strategy. Also with this change comes better control of the cx23416 encoder, building on additional information learned about the peculiarities of controlling this part (this information was the original trigger for this rework). With this change, overall encoder stability should be considerably improved. Yes, this is a large change for this driver, but due to the nature of the feature being worked on, the changes are fairly pervasive and would be difficult to break into smaller pieces with any semblence of step-wise stability. Signed-off-by: Mike Isely <isely@pobox.com>
2007-10-14pvrusb2: Improve encoder chip health trackingMike Isely
From: Mike Isely <isely@pobox.com> This is a minor change to help with tracking the viability of the encoder chip within the PVR USB2 device. Signed-off-by: Mike Isely <isely@pobox.com>
2007-10-10pvrusb2: Change list_for_each+list_entry to list_for_each_entryTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Reviewed-by: Mike Isely <isely@pobox.com>
2007-10-01backport kernel changesMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> kernel-sync: A few changes were done at mainstream, affecting v4l/dvb drivers. Backport those changes to the out-kernel tree. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-09-08pvrusb2: Allocate a debug mask bit for reporting video standard thingsMike Isely
From: Mike Isely <isely@pobox.com> It's useful to see specific details for how the pvrusb2 driver is figuring out things related to the video standard, independent of other initialization activities. So let's set up a separate debug mask bit for this and turn it on. Signed-off-by: Mike Isely <isely@pobox.com>
2007-09-08pvrusb2: Do a far better job at setting the default initial video standardMike Isely
From: Mike Isely <isely@pobox.com> The v4l tveeprom logic tells us what video standards are supported by the hardware, however it doesn't directly tell us what should be the preferred initial standard. For example "NTSC/NTSC-J" devices are reported by tveeprom as support NTSC-M and PAL-M, and while that might be true, in the vast majority of cases NTSC-M is really what the user is going to want. However the driver previously just arbitrarily picked the "lowest numbered" standard as the initial default, which in that case would have been PAL-M. (And making matters more confusing - this only caused real problems on 24xxx devices because the saa7115 on 29xxx seems to autodetect the right answer anyway.) This change implements an algorithm that uses the set of "supported" standards as a hint to decide on the initial standard. This algorithm ONLY comes into play if the driver isn't specifically told what to do; said another way - the user can always still change the standard via the sysfs interface, via the usual V4L methods, or even specified as a module parameter. The idea here is only to pick a better starting point if the user (or app) doesn't otherwise do something to set the standard; otherwise this change has no real impact. Signed-off-by: Mike Isely <isely@pobox.com>
2007-09-08pvrusb2: Various changes to better discriminate among device typesMike Isely
From: Mike Isely <isely@pobox.com> This is a bunch of cleanup in various places to improve behavior based on actual device type being driven. While this doesn't actually affect operation with existing devices, it cleans things up so that it will be easier / more deterministic when other devices are added. Ideally we should make stuff like this table-driven, but for now this is just a series of small incremental (read: safe) improvements. Signed-off-by: Mike Isely <isely@pobox.com>
2007-09-08pvrusb2: Implement programmatic means to extract prom contentsMike Isely
From: Mike Isely <isely@pobox.com> The pvrusb2 driver already has a method for extracting the FX2's program memory back out to a user application; this ability is used to facilitate manual firmware extraction as per the procedure documented on the pvrusb2 web site. This change follows that pattern and implements a corresponding method to grab the binary contents of the PVR USB2 prom (which for PVR USB2 devices can contain information in addition to the usual Hauppauge metadata). Signed-off-by: Mike Isely <isely@pobox.com>
2007-09-08pvrusb2: Fix a potential oops in an error leg cleanupMike Isely
From: Mike Isely <isely@pobox.com> Signed-off-by: Mike Isely <isely@pobox.com>
2007-09-08pvrusb2: Properly terminate USB device ID tableMike Isely
From: Mike Isely <isely@pobox.com> Signed-off-by: Mike Isely <isely@pobox.com>
2007-08-21cx2341x: some controls should not be changed while the device is busy.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> The driver should now pass the 'busy' state of the device to the cx2341x module whenever controls are set or tried. -EBUSY will be returned if the device is busy and the user attempts to modify certain 'dangerous' controls. It concerns controls that change the audio or video compression mode and bitrates. The cx88-blackbird and pvrusb2 drivers currently always pass '0' (not busy) to the cx2341x, effectively keeping the old behavior for now. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2007-04-28pvrusb2: use mutex instead of semaphoreMike Isely
From: Matthias Kaehlcke <matthias.kaehlcke@gmail.com> the pvrusb2 driver use a semaphore as mutex. use the mutex API instead of the (binary) semaphore Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com> Signed-off-by: Mike Isely <isely@pobox.com>
2007-04-07pvrusb2: Gather USB bus address info and report itMike Isely
From: Mike Isely <isely@pobox.com> The V4L2 API requires a unique bus_info string returned as part of the v4l2_capability structure. These changes gather up the USB address information, from the underlying device, into a string and report that out through v4l2 and via sysfs (for completeness). Signed-off-by: Mike Isely <isely@pobox.com>
2007-04-07pvrusb2: Use NULL instead of 0 for null pointer values (trivial)Mike Isely
From: Mike Isely <isely@pobox.com> Signed-off-by: Mike Isely <isely@pobox.com>
2007-02-27pvrusb2: (trivial) Fix too-wide source lineMike Isely
From: Mike Isely <isely@pobox.com> Signed-off-by: Mike Isely <isely@pobox.com>
2007-02-27pvrusb2: Fix compilation warning for amd64 builds (use %zu instead of %u)Mike Isely
From: Mike Isely <isely@pobox.com> signed-off-by Mike Isely <isely@pobox.com> signed-off-by Michael Krufky <mkrufky@linuxtv.org>
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-07pvrusb2: Be more forgiving about encoder firmware sizeMike Isely
From: Mike Isely <isely@pobox.com> The pvrusb2 driver previously rejected encoder firmware whose size was not a multiple of 8192. But this is a false check because it's possible to find cx23416 firmware whose size doesn't conform to this limit. So change the firmware loader implementation to be more forgiving of the image size. Signed-off-by: Mike Isely <isely@pobox.com>
2007-01-28pvrusb2: VIDIOC_DBG_[S|G]_REGISTER fixupsMike Isely
From: Mike Isely <isely@pobox.com> Support 64 bit register IDs internally. Only allow root access to this API (for both set and get). Note that actual 64 bit access only becomes possible once the definition for v4l2_register is updated, but this change clears the way for it from the viewpoint of the pvrusb2 driver. Signed-off-by: Mike Isely <isely@pobox.com>
2007-01-28pvrusb2: Control protocol cleanupMike Isely
From: Mike Isely <isely@pobox.com> Several special-case FX2 commands were being issued through pvr2_write_u16() and pvr2_write_8(), but there's really nothing special case about them. These date from a very early time in the driver development. This patch removes these functions and replaces their use with calls to pvr2_send_request. Signed-off-by: Mike Isely <isely@pobox.com>
2007-01-28Merge from v4l-dvbMike Isely
From: Mike Isely <isely@pobox.com> Signed-off-by: Mike Isely <isely@pobox.com>
2007-01-23Make VIDIOC_INT_[SG]_REGISTER ioctls no longer internal onlyTrent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> The direct register access ioctls were defined as kernel internal only, but they are very useful for debugging hardware from userspace and are used as such. Officially export them. VIDIOC_INT_[SG]_REGISTER is renamed to VIDIOC_DBG_[SG]_REGISTER Definition of ioctl and struct v4l2_register is moved from v4l2-common.h to videodev2.h. Types used in struct v4l2_register are changed to the userspace exportable versions (u32 -> __u32, etc). Use of VIDIOC_DBG_S_REGISTER requires CAP_SYS_ADMIN permission, so move the check into the video_ioctl2() dispatcher so it doesn't need to be duplicated in each driver's call-back function. CAP_SYS_ADMIN check is added to pvrusb2 (which doesn't use video_ioctl2). Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-01-21pvrusb2: Use macro names for FX2 commandsMike Isely
From: Michael Krufky <mkrufky@linuxtv.org> This is a maintainability cleanup; use nice names for all the FX2 commands instead of raw bytes. This way we can easily find where we issue FX commands. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mike Isely <isely@pobox.com>
2007-01-19pvrusb2: Use ARRAY_SIZE wherever possibleMike Isely
From: Mike Isely <isely@pobox.com> Signed-off-by: Mike Isely <isely@pobox.com>
2007-01-19pvrusb2: Use kzalloc in place of kmalloc/memset pairsMike Isely
From: Mike Isely <isely@pobox.com> Signed-off-by: Mike Isely <isely@pobox.com>
2007-01-19pvrusb2: A patch to use ARRAY_SIZE macro when appropriateMike Isely
From: Ahmed S. Darwish <darwish.07@gmail.com> Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com> Signed-off-by: Mike Isely <isely@pobox.com>
2007-01-19pvrusb2: Stop hardcoding frequency rangesMike Isely
From: Mike Isely <isely@pobox.com> Rather than hardcoding frequency ranges everywhere, rely on VIDIOC_G_TUNER results wherever we can. Signed-off-by: Mike Isely <isely@pobox.com>
2007-01-19pvrusb2: Remove automodeswitch controlMike Isely
From: Mike Isely <isely@pobox.com> The automodeswitch control was a feature that enable automatic radio / tv switching based on the selected frequency. However since frequency ranges can overlap and also since apparently in some cases it's possible for the same frequency range to be both tv and radio in a specific region, then this feature can't safely work. So it's removed. Signed-off-by: Mike Isely <isely@pobox.com>
2007-01-19pvrusb2: Slight debug printing efficiency fixupMike Isely
From: Mike Isely <isely@pobox.com> 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>
2007-01-07merge: http://linuxtv.org/hg/~mcisely/pvrusb2Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-01-07Pvrusb2-hdw kfree cleanupMauro Carvalho Chehab
From: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Hello, This patch removes redundant argument check for kfree(). Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-12-30pvrusb2: Stream configuration cleanupsMike Isely
From: Mike Isely <isely@pobox.com> Clean up and tighten logic involving stream configuration. This mainly involves changes to pvrusb2-v4l2.c, where we better clarify how we use the stream configuration enum and implement a cleaner means to control streaming for a given device node. Signed-off-by: Mike Isely <isely@pobox.com>
2006-12-30pvrusb2: Fix cut/paste bug in auto_mode_switch controlMike Isely
From: Mike Isely <isely@pobox.com> Signed-off-by: Mike Isely <isely@pobox.com>
2006-12-27pvrusb2: Change default volume to something saneMike Isely
From: Mike Isely <isely@pobox.com> The default volume of 65535 is too high. Make is something smaller. Note that this _only_ changes the default value. Specifically, there are no scaling or other more intrusive changes here. I'm just sick of constantly having to reduce the volume every time I plug in and test the device! (And unfortunately we can't do a better fix like scaling the volume so that 65535 makes sense because doing so will screw up any app - like MythTV - which expects the old scaling.) Too bad V4L controls don't have better defined ranges. 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: Newer frequency range checkingMike Isely
From: Mike Isely <isely@pobox.com> Implement new method for doing integer range checking, so that we can more intelligently range-check radio and tv ranges at once. 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: Use separate enumeration for get/store of minor numberMike Isely
From: Mike Isely <isely@pobox.com> Use separate enum for get/store of minor number; we want pvr2_config to go away eventually and since it really means something different, don't use it here Signed-off-by: Mike Isely <isely@pobox.com>
2006-12-27pvrusb2: Use enumeration for minor number get / store codeMike Isely
From: Mike Isely <isely@pobox.com> Signed-off-by: Mike Isely <isely@pobox.com>