summaryrefslogtreecommitdiffstats
path: root/drivers/media/radio/radio-si470x.c
Commit message (Collapse)AuthorAgeFilesLines
* V4L/DVB (9218): si470x: removement of get/set input/audioTobias Lorenz2008-10-171-68/+4
| | | | | | | | | | | | | | | | This patch removes the unnecessary get/set input/audio functions. The reason is, that the V4L2 specification says, that if input or audio cannot be switched anyway, the functions doesn't need to be implemented. I've tested the new driver with all current radio programs in Debian/testing and found no problems with that. In my opinion, the driver is much cleaner by removing these unnecessary functions. Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (9217): si470x: correction of mono/stereo handlingTobias Lorenz2008-10-171-6/+18
| | | | | | | | | | | This patch corrects the behavior of mono/stereo indication and selection. These functions now work conform to what's defined in the V4L2 specification. Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (9216): si470x: tuner->type handlingTobias Lorenz2008-10-171-9/+12
| | | | | | | | | | | The V4L2 specification says, when to check and when to return tuner->type as constant value. This patch corrects exactly this behavior, so that it is now conform to the V4L2 specification. Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (9215): si470x: improvement of unsupported base controlsTobias Lorenz2008-10-171-21/+12
| | | | | | | | | | | | | | | This patch changes the handling of unsupported base controls. In the former version, specific unsupported base controls were listed in the queryctrl table and were flagged as disabled controls. This was done for all base controls used by the applications. The patch now removes the specific base controls and instead lets queryctrl automatically return unsupported base controls flagged as disabled. Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (9214): si470x: improvement of module device supportTobias Lorenz2008-10-171-17/+30
| | | | | | | | | | | | | This patch improves support for multiple radio devices. In previous versions all region relevant settings were derived from one module parameter. As in future versions, the region and other configuration should be configurable per device from the user space, this patch already retrieves all relevant information from the actual device specific settings. Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (9213): si470x: module_param access rightsTobias Lorenz2008-10-171-17/+22
| | | | | | | | | This patch mainly adds correct module_param access rights. Also there are a lot of small coding style enhancements and some corrections of the variable references in module_param. Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (8788): v4l: replace video_get_drvdata(video_devdata(filp)) with ↵Hans Verkuil2008-10-121-11/+11
| | | | | | | | | video_drvdata(filp) Use the new video_drvdata(filp) function where it is safe to do so. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (8613): v4l: move BKL down to the driver level.Hans Verkuil2008-10-121-0/+2
| | | | | | | | | | | The BKL is now moved from the video_open function in v4l2-dev.c to the various drivers. It seems about a third of the drivers already has a lock of some sort protecting the open(), another third uses video_exclusive_open (yuck!) and the last third required adding the BKL in their open function. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (8778): radio: fix incorrect video_register_device result checkHans Verkuil2008-09-031-2/+2
| | | | | Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* V4L/DVB (8523): v4l2-dev: remove unused type and type2 field from video_deviceHans Verkuil2008-07-271-1/+0
| | | | | | | | | The type and type2 fields were unused and so could be removed. Instead add a vfl_type field that contains the type of the video device. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (8483): Remove obsolete owner field from video_device struct.Hans Verkuil2008-07-261-1/+0
| | | | | | | | According to an old comment this should have been removed in 2.6.15. Better late than never... Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (8482): videodev: move all ioctl callbacks to a new v4l2_ioctl_ops ↵Hans Verkuil2008-07-261-9/+12
| | | | | | | | | | | | | struct All ioctl callbacks are now stored in a new v4l2_ioctl_ops struct. Drivers fill in a const struct v4l2_ioctl_ops and video_device just contains a const pointer to it. This ensures a clean separation between the const ops struct and the non-const video_device struct. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (8430): videodev: move some functions from v4l2-dev.h to ↵Hans Verkuil2008-07-231-0/+1
| | | | | | | | | | | | | v4l2-common.h or v4l2-ioctl.h The functions in a header should not belong to another module. The prio functions belong to v4l2-common.c, so move them to v4l2-common.h. The ioctl functions belong to v4l2-ioctl.c, so create a new v4l2-ioctl.h header and move those functions to it. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7997): si470x: hardware frequency seek supportTobias Lorenz2008-07-201-2/+95
| | | | | | | | This patch brings the following changes: - this now finally adds hardware frequency seek support Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7996): si470x: afc indicationTobias Lorenz2008-07-201-1/+3
| | | | | | | | | | This patch brings the following changes: - afc indication: device has no indication whether freq is too low or too high therefore afc always return 1, when freq is wrong Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7995): si470x: a lot of small code cleanupsTobias Lorenz2008-07-201-90/+196
| | | | | | | | | | This patch brings the following changes: - comment on how to listen to an usb audio device   (i get so many questions about that...) - code cleanup (error handling, more warnings, spacing, ...) Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7994): si470x: let si470x_get_freq return errnoTobias Lorenz2008-07-201-11/+23
| | | | | | | | | This patch brings the following changes: - version bumped to 1.0.8 for all the following patches - si470x_get_freq now returns errno Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7993): si470x: move global lock to device structureTobias Lorenz2008-07-201-43/+41
| | | | | | | | | this patch brings the following changes: - move the global disconnect lock into the device structure - code cleanup (spaces to tabs, long line splits, ...) Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7586): radio: use get/put_unaligned_* helpersHarvey Harrison2008-07-201-10/+6
| | | | | | Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7402): add macro validation for v4l_compat_ioctl32Douglas Schilling Landgraf2008-04-241-0/+2
| | | | | | | Added macro CONFIG_COMPAT for v4l_compat_ioctl32. Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7401): radio-si470x: unplugging fixedTobias Lorenz2008-04-241-9/+48
| | | | | | | | | | | | | | | | | | This patch fixes several kernel oops, when unplugging device while it is in use: Basically the patch delays freeing of the internal variables in si470x_usb_driver_disconnect, until the the last user closed the device in si470x_fops_release. This was implemented a while ago with the help of Oliver Neukum. I tested the patch five times (unplugging while in use) without oops coming from the radio-si470x driver anymore. A remaining oops was coming from the usbaudio driver, but this is someone else task. Hopefully this fixed all unplugging issues. Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7189): autosuspend supportTobias Lorenz2008-02-181-8/+75
| | | | | | | Together with Oliver Neukum from Novell, USB autosuspend support was added. Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7188): radio-si470x version 1.0.6Tobias Lorenz2008-02-181-163/+167
| | | | | | | | | | | | | | | | | | | | | | | | | This patch combines all the finished discussions and its resulting patches from the mailing list. The version 1.0.6 is mainly influenced by Oliver Neukum. He found a lot of small issues, that are fixed with this patch now. For me the most interesting thing is, that it's now safer to use it on other architectures. The history for version 1.0.6 is: - fixed coverity checker warnings in *_usb_driver_disconnect - probe()/open() race by correct ordering in probe() - DMA coherency rules by separate allocation of all buffers - use of endianness macros - abuse of spinlock, replaced by mutex - racy handling of timer in disconnect, replaced by delayed_work - racy interruptible_sleep_on(), replaced with wait_event_interruptible() - handle signals in read() The driver is tested with all Debian/testing radio programs and rdsd. The patch is tested against checkpatch.pl v1.12. Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7183): radio-si470x: fix build warningMichael Krufky2008-02-181-1/+1
| | | | | | | | | | | fix the following build warning: radio-si470x.c: In function 'si470x_get_rds_registers': radio-si470x.c:562: warning: format '%ld' expects type 'long int', but argument 3 has type 'unsigned int' Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7110): Trivial printf warning fix (radio-si470)Tobias Lorenz2008-02-181-1/+1
| | | | | | | | Thanks to Darren Salt <linux@youmustbejoking.demon.co.uk> for pointing this issue. Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7108): radio-si470x.c: check-after-useTobias Lorenz2008-02-181-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adrian used the coverity checker against radio-si470x and found this: > The Coverity checker spotted the following check-after-use in > drivers/media/radio/radio-si470x.c: > > <-- snip --> > static void si470x_usb_driver_disconnect(struct usb_interface *intf) > { > struct si470x_device *radio = usb_get_intfdata(intf); > > del_timer_sync(&radio->timer); <------------------ > flush_scheduled_work(); > > usb_set_intfdata(intf, NULL); > if (radio) { <------------------ > video_unregister_device(radio->videodev); > kfree(radio->buffer); > kfree(radio); > } > } > <-- snip --> > > Either "radio" can be NULL and this case has to be properly handled or > the NULL check is not required. These two lines should indeed better be inside the if statement. Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7091): radio-si470x improvements and seldom problem fixed in tuning ↵Tobias Lorenz2008-02-181-80/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | functions I updated the radio-si470x driver another time. Here are the commented history entries: - number of seek_retries changed to tune_timeout The last versions checked for the end of frequency tuning by polling a si470x register. Therefore polling depended on the usb utilization. This was changed to have a constant timeout now. - fixed problem with incomplete tune operations by own buffers The last version used a shared buffer to assembly the USB HID reports. It sometimes happened, that multiple functions were modifing this buffer simultanuously. When sending such reports, the hardware returned USB stalls (-EPIPE). Now buffers of the correct size (smaller than before) are allocated as local variables. - optimization of variables The size of some variables has been reduced to allow the compiler to generate more optimized code. - improved error logging At some important location, error checking was improved. Especially the usb transfers to access si470x registers and the tuning functions were modified. Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7062): radio-si570x: Some fixes and new USB ID additionTobias Lorenz2008-01-251-135/+156
| | | | | | | | | | | - avoid poss. locking when doing copy_to_user which may sleep - RDS is automatically activated on read now - code cleaned of unnecessary rds_commands - USB Vendor/Product ID for ADS/Tech FM Radio Receiver verified (thanks to Guillaume RAMOUSSE) Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7061): radio-si470x: Some cleanupsTobias Lorenz2008-01-251-436/+407
| | | | | | | | | | | | - code reordered to avoid function prototypes - switch/case defaults are now more user-friendly - unified comment style - applied all checkpatch.pl v1.12 suggestions except the warning about the too long lines with bit comments - renamed FMRADIO to RADIO to cut line length (checkpatch.pl) Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7039): Reorder headersMauro Carvalho Chehab2008-01-251-2/+2
| | | | | | The backports weren't tested, but compile fine. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
* V4L/DVB (7038): USB radio driver for Silicon Labs Si470x FM Radio ReceiversTobias Lorenz2008-01-251-0/+1440
this patch adds a new driver for the Silicon Labs Si470x FM Radio Receiver. It should also work for the identical ADS/Tech FM Radio Receiver (formerly Instant FM Music) as soon as I find out the USB Vendor and Product ID. The driver is inspired by several other USB and radio drivers, but mainly from the D-Link DSB-R100 USB radio (dsbr100.c). The USB stick currently has an Si4701 FM RDS radio receiver. But the other Si470x devices are pin and register compatible, so that in the future the driver can easily be patched to support these too. Therefore I named the driver radio-si470x and the configuration option usb-si470x. The driver itself just provides the control function over the radio. For getting audio back, the device support the USB audio class, which is implemented in the already existing driver. I tested the driver in the last days, until it now satisfies all my functionality and robustness requirements. The application I used for testing was kradio. Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
OpenPOWER on IntegriCloud