summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
AgeCommit message (Collapse)Author
2009-04-30remove driver_data direct access of struct deviceMauro Carvalho Chehab
From: Greg Kroah-Hartman <gregkh@suse.de> In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-31pvrusb2: Report def_val items in sysfs symbolically, consistent with cur_valMike Isely
From: Mike Isely <isely@pobox.com> Priority: normal Signed-off-by: Mike Isely <isely@pobox.com>
2009-01-14pvrusb2: Change sysfs serial number handlingMauro Carvalho Chehab
From: Mike Isely <isely@pobox.com> Use the new pvrusb2 internal API to grab the device identifier, rather than generating it directly. This unifies some code and make possible use of that identifier in places other than sysfs. Priority: normal Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-10-30V4L: struct device - replace bus_id with dev_name(), dev_set_name()Mauro Carvalho Chehab
From: Kay Sievers <kay.sievers@vrfy.org> This patch is part of a larger patch series which will remove the "char bus_id[20]" name string from struct device. The device name is managed in the kobject anyway, and without any size limitation, and just needlessly copied into "struct device". To set and read the device name dev_name(dev) and dev_set_name(dev) must be used. If your code uses static kobjects, which it shouldn't do, "const char *init_name" can be used to statically provide the name the registered device should have. At registration time, the init_name field is cleared, to enforce the use of dev_name(dev) to access the device name at a later time. We need to get rid of all occurrences of bus_id in the entire tree to be able to enable the new interface. Please apply this patch, and possibly convert any remaining remaining occurrences of bus_id. We want to submit a patch to -next, which will remove bus_id from "struct device", to find the remaining pieces to convert, and finally switch over to the new api, which will remove the 20 bytes array and does no longer have a size limitation. Thanks, Kay Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-Off-By: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-09-03pvrusb2: Remove comment lines which refer to checkpatch's behaviorMike Isely
From: Mike Isely <isely@pobox.com> Priority: normal Signed-off-by: Mike Isely <isely@pobox.com>
2008-08-31pvrusb2: Implement default value retrieval in sysfs interfaceMike Isely
From: Mike Isely <isely@pobox.com> Priority: normal Signed-off-by: Mike Isely <isely@pobox.com>
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-05-26pvrusb2: Remove sysfs interface hackeryMike Isely
From: Mike Isely <isely@pobox.com> Back in the early days of the pvrusb2 driver, the kernel class mechanism in use for the sysfs interface had no means to pass per-attribute information to the show / store functions. This forced me to implement a horrible ugly thunking mechanism (i.e. infer the missing data through the use of dedicated cookie cutter bounce functions). However now we're using a better mechanism which also passes enough additional information to the show / store functions that we no longer need the hack. So eliminate all the crap. Yay! Signed-off-by: Mike Isely <isely@pobox.com>
2008-05-25pvrusb2: Remove svn Id keyword from all sourcesMike Isely
From: Mike Isely <isely@pobox.com> Signed-off-by: Mike Isely <isely@pobox.com>
2008-04-26backport commit d3135846f6c1858dbad6ccb780a42e6c98953e6dMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> kernel-sync: Author: Matthew Wilcox <matthew@wil.cx> drivers: Remove unnecessary inclusions of asm/semaphore.h None of these files use any of the functionality promised by asm/semaphore.h. It's possible that they rely on it dragging in some unrelated header file, but I can't build all these files, so we'll have fix any build failures as they come up. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-04-09pvrusb2: Clean out all use of __FUNCTION__Mike Isely
From: Mike Isely <isely@pobox.com> Apparently the kernel developers no longer consider it proper etiquette to use __FUNCTION__; everyone must instead use __func__ (even though it breaks with older compilers). And worse still, actual effort is being expended to sweep this change throughout the kernel source tree. Don't these people have better things to do? So... Completely clean out all use of __FUNCTION__ from the pvrusb2 driver (it was just in the sysfs interface). I'm not going to use __func__ either. So there. Signed-off-by: Mike Isely <isely@pobox.com>
2008-03-07pvrusb2: Fix compilation warningMike Isely
From: Mike Isely <isely@pobox.com> Fix use of a non-int (size_t) being passed in a printf width field. This benign issue has apparently been around for a long time, but went undetected until now. Signed-off-by: Mike Isely <isely@pobox.com>
2008-02-03pvrusb2: Implement addition sysfs tracingMike Isely
From: Mike Isely <isely@pobox.com> 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-10-28pvrusb2: Remove dead sysfs codeMike Isely
From: Mike Isely <isely@pobox.com> The pvrusb2 driver's sysfs implementation had long since implemented a dummy hotplug function because at the time the kernel would oops without at least the empty function being present. Today - after numerous class interface changes in the kernel - this pvrusb2 change had been dutifully carried forward but an inspection of the kernel sources shows that it is no longer needed. So remove the dummy function and its reference. This also solves a recurring backwards compatibility issue in the pvrusb2 driver as the class interface has been getting thrashed in the kernel. Signed-off-by: Mike Isely <isely@pobox.com>
2007-10-17backport commit 7eff2e7a8b65c25920207324e56611150eb1cd9aMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Original Description: Author: Kay Sievers <kay.sievers@vrfy.org> Date: Tue Aug 14 15:15:12 2007 +0200 Driver core: change add_uevent_var to use a struct This changes the uevent buffer functions to use a struct instead of a long list of parameters. It does no longer require the caller to do the proper buffer termination and size accounting, which is currently wrong in some places. It fixes a known bug where parts of the uevent environment are overwritten because of wrong index calculations. Many thanks to Mathieu Desnoyers for finding bugs and improving the error handling. CC: Mike Isely <isely@isely.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-10-14pvrusb2: Fix broken build for 2.6.18 kernelMike Isely
From: Mike Isely <isely@pobox.com> Earlier changes to move away from use of struct class_device introduced breakage for kernels older than 2.6.19. This change at least allows it to build again for 2.6.18. Still unclear about older kernels, unfortunately :-( Signed-off-by: Mike Isely <isely@pobox.com>
2007-10-08pvrusb: Update DEBUGIFC sysfs to kernel 2.6.13+Trent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> The prototypes for the show and store methods of a device_attribute changed in kernel 2.6.13, but the code in pvrusb2 was never updated. I guess the DEBUGIFC stuff isn't used much.... Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2007-10-08V4L: convert struct class_device to struct deviceMauro Carvalho Chehab
From: Kay Sievers <kay.sievers@vrfy.org> The currently used "struct class_device" will be removed from the kernel. Here is a patch that converts all users in drivers/media/video/ to struct device. Reviewed-by: Thierry Merle <thierry.merle@free.fr> Reviewed-by: Mike Isely <isely@pobox.com> Reviewed-by: Luca Risolia <luca.risolia@studio.unibo.it> Signed-off-by: Kay Sievers <kay.sievers@vrfy.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-04-28pvrusb2: kill unnecessary attribute->ownerMike Isely
From: Tejun Heo <htejun@gmail.com> [Mike Isely: This is the pvrusb2 affected part of a much larger patch in the kernel from Tejun Heo] sysfs is now completely out of driver/module lifetime game. After deletion, a sysfs node doesn't access anything outside sysfs proper, so there's no reason to hold onto the attribute owners. Note that often the wrong modules were accounted for as owners leading to accessing removed modules. This patch kills now unnecessary attribute->owner. Note that with this change, userland holding a sysfs node does not prevent the backing module from being unloaded. For more info regarding lifetime rule cleanup, please read the following message. http://article.gmane.org/gmane.linux.kernel/510293 Signed-off-by: Tejun Heo <htejun@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-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>
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>
2006-12-27pvrusb2: Implement multiple minor device number handlingMike Isely
From: Pantelis Koukousoulas <pakt223@freemail.gr> This is the first patch in preparation of the V4L2/IVTV radio interface. It does away with the assumption of only one minor per device. It also adds a file to show the radio minor as well. This can be useful for a program like pvr-radio.c (when it grows up), since this way it can search for the minor of the /dev/radioX device it opened and use the video minor of the same driver instance to get to the actual stream. The implementation looks kinda ugly. Feel free to improve (that is the reason behind separate patches anyway). --Pantelis Signed-off-by: Pantelis Koukousoulas <pakt223@freemail.gr> Signed-off-by: Mike Isely <isely@pobox.com>
2006-09-02Remove some dead data elements from pvrusb2 driverMike Isely
From: Mike Isely <isely@pobox.com> Signed-off-by: Mike Isely <isely@pobox.com>
2006-07-22Correctly handle sysfs error leg file removal in pvrusb2Mike Isely
From: Mike Isely <isely@pobox.com> Take note of which sysfs files / groups that the pvrusb2 successfully creates and only delete those specific items when tearing things down. (Previously we just blindly tore everything down every time.) Signed-off-by: Mike Isely <isely@pobox.com>
2006-07-19Removed the remaining config.h stuffMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Since kernel include autoconf.h via command line, those config.h inclusion can be removed. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2006-07-18pvrusb2: check the return value of class_device_create_fileMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> class_device_create_file is marked as __must_check, so its return value must be checked. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
2006-07-18pvrusb2: check the return value of class_device_registerMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> If an error occurs during class_device_register, print an error message, kfree(class_dev) and return. Signed-off-by: Michael Krufky <mkrufky@linuxtv.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-06-25Handle boolean controls in pvrusb2Mike Isely
From: Mike Isely <isely@pobox.com> Signed-off-by: Mike Isely <isely@pobox.com>
2006-06-25Increase the maximum number of controls that pvrusb2-sysfs.c can handle.Mike Isely
From: Mike Isely <isely@pobox.com> Signed-off-by: Mike Isely <isely@pobox.com>
2006-06-25Don't print empty enum values in pvrusb2-sysfs.cMike Isely
From: Mike Isely <isely@pobox.com> Signed-off-by: Mike Isely <isely@pobox.com>
2006-05-07bug-fix: pvrusb2 must #include <linux/config.h> for compile-time optionsMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> Added necessary header file in order for kconfig build options to be considered at compile time. Without this patch all options will always be disabled, regardless of whether they are selected or not. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Acked-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-03-30Make parts of pvrusb2 compile-time options (sysfs and debugifc)Mike Isely
From: Mike Isely <isely@pobox.com> Arrange things in pvrusb2 so that the sysfs-using component doesn't have to be compiled in. Control this with new CONFIG_VIDEO_PVRUSB2_SYSFS variable. This will allow the driver to still be used even if sysfs has not been compiled into the kernel. Also arrange things similarly in pvrusb2 for the debug interface, which is something that normally should not need to be built but is valuable for bug chasing. This is controlled now with CONFIG_VIDEO_PVRUSB2_DEBUGIFC. Signed-off-by: Mike Isely <isely@pobox.com>
2006-03-28Fix pvrusb2 kernel oopsMike Isely
From: Mike Isely <isely@pobox.com> This problem was introduced by the previous change. It appears that if you try to create to sysfs entries of the same name in one directory, then sysfs gets very angry and causes a kernel oops when you later try to tear down those nodes. By not allocating enough space to hold the name, we were inadvertently causing a sysfs control file name collision... Signed-off-by: Mike Isely <isely@pobox.com>
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-26Get rid of static PVR2_CID_COUNT in pvrusb2Mike Isely
From: Mike Isely <isely@pobox.com> Eliminate the need to track the number pvrusb2 CIDs at compile time from within the pvrusb2 driver. This is part of a control structure cleanup. Signed-off-by: Mike Isely <isely@pobox.com>
2006-03-25Fix screwed up indentation in pvrusb2-sysfs.cMike Isely
From: Mike Isely <isely@pobox.com> Signed-off-by: Mike Isely <isely@pobox.com>
2006-02-26moved pvrusb2 driver into the kernel treeMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>