summaryrefslogtreecommitdiff
path: root/linux/drivers/media/radio/radio-si470x.c
AgeCommit message (Collapse)Author
2009-03-14v4l-dvb: replace remaining references to the old mailinglist.Mauro Carvalho Chehab
From: Hans Verkuil <hverkuil@xs4all.nl> Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-03-03compat: rename struct delayed_work to work_struct on pre-2.6.20Trent Piepho
From: Trent Piepho <xyzzy@speakeasy.org> In v2.6.19-rc6-118-g52bad64 struct work_struct was changed to be only for non-delayed work and struct delayed_work was created for delayed work. Instead of putting ifdefs in the drivers, we use compat.h to rename delayed_work to work_struct on pre-2.6.20 kernels. This will only be a problem if some driver decides to create identifiers named both work_struct and delayed_work in the same scope. There is one driver that has something named work_struct and none with anything named delayed_work, so I don't think will be a problem for as long as this compat code sticks around. Priority: normal Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
2009-02-12Output HW/SW version from scratchpadTobias Lorenz
From: Tobias Lorenz <tobias.lorenz@gmx.net> This patch adds functions to access the scratchpad. For it is this good for? In the first two bytes, the developers stored the HW/PCB version and the software release of the firmware. This is now written to syslog, so debugging get's easier. Also knowing the versions is the key for flash upgrades later on. There are also some cleanups of the flash report sizes. Altogether this should justify the new version number 1.0.9. Thanks to Rick Bronson <rick@efn.org> Priority: normal Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net>
2009-02-12LED status outputTobias Lorenz
From: Tobias Lorenz <tobias.lorenz@gmx.net> This patch closes one of my todos that was since long on my list. Some people reported clicks and glitches in the audio stream, correlated to the LED color changing cycle. Thanks to Rick Bronson <rick@efn.org>. Priority: normal Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net>
2009-02-12Correction of Stereo detection/setting and signal strength indicationTobias Lorenz
From: Tobias Lorenz <tobias.lorenz@gmx.net> Thanks to Bob Ross <pigiron@gmx.com> - correction of stereo detection/setting - correction of signal strength indicator scaling Priority: normal Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net>
2009-02-12Code rearrangements in preparation for other report typesTobias Lorenz
From: Tobias Lorenz <tobias.lorenz@gmx.net> LED_REPORT and all flash REPORTs are on it's way. This code rearrangement cleans up the code for proper integration later on. Priority: normal Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net>
2009-02-12Documentation and code cleanupsTobias Lorenz
From: Tobias Lorenz <tobias.lorenz@gmx.net> - "DealExtreme" sells the "PCear" radio and that comes from "Sanei Electric". - MPlayer is also usable as radio application. - Consistent usage of tabulators and blanks in the code. Priority: normal Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net>
2009-02-05radio-si470x: use usb_make_path in usb-radio driversDouglas Schilling Landgraf
From: Alexey Klimov <klimov.linux@gmail.com> Place usb_make_path in radio-si470x.c that used when reporting bus_info information in vidioc_querycap. Priority: normal Acked-by: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Alexey Klimov <klimov.linux@gmail.com> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
2008-12-31merge: http://linuxtv.org/hg/~tlorenz/v4l-dvbMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-12-03Add USB ID for the Sil4701 radio from DealExtreme.Tobias Lorenz
Signed-off-by: Mark Lord <mlord@pobox.com> Cc: Tobias Lorenz <tobias.lorenz@gmx.net> Cc: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Code beautifications and documentation added. Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net>
2008-12-30v4l2: introduce v4l2_file_operations.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Introduce a struct v4l2_file_operations for v4l2 drivers. Remove the unnecessary inode argument. Move compat32 handling (and llseek) into the v4l2-dev core: this is now handled in the v4l2 core and no longer in the drivers themselves. Note that this changeset reverts an earlier patch that changed the return type of__video_ioctl2 from int to long. This change will be reinstated later in a much improved version. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-10-28Documentation, especially regarding audio and informational linksTobias Lorenz
From: Tobias Lorenz <tobias.lorenz@gmx.net> This patch adds a recommendation to select SND_USB_AUDIO for listing and adds a documentation file for si470x. Priority: normal Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net>
2008-10-23radio-si470x: add support for kworld usb radioMauro Carvalho Chehab
From: Alexey Klimov <klimov.linux@gmail.com> This patch add support for new device named KWorld USB FM Radio SnapMusic Mobile 700 (FM700). And changes few lines in comments. Signed-off-by: Alexey Klimov <klimov.linux@gmail.com> Acked-By: Tobias Lorenz <tobias.lorenz@gmx.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-09-25si470x: removement of get/set input/audioTobias Lorenz
From: Tobias Lorenz <tobias.lorenz@gmx.net> Hi Mauro, 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. Bye, Toby Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net>
2008-09-25si470x: correction of mono/stereo handlingTobias Lorenz
From: Tobias Lorenz <tobias.lorenz@gmx.net> Hi Mauro, this patch corrects the behavior of mono/stereo indication and selection. These functions now work conform to what's defined in the V4L2 specification. Bye, Toby Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net>
2008-09-25si470x: tuner->type handlingTobias Lorenz
From: Tobias Lorenz <tobias.lorenz@gmx.net> Hi Mauro, 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. Bye, Toby Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net>
2008-09-25si470x: improvement of unsupported base controlsTobias Lorenz
From: Tobias Lorenz <tobias.lorenz@gmx.net> Hi Mauro, 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. Bye, Toby Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net>
2008-09-25si470x: improvement of module device supportTobias Lorenz
From: Tobias Lorenz <tobias.lorenz@gmx.net> Hi Mauro, 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. Best regards, Toby Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net>
2008-09-25si470x: module_param access rightsTobias Lorenz
From: Tobias Lorenz <tobias.lorenz@gmx.net> Hi Mauro, 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. Best regards, Toby Signed-off-by: Tobias Lorenz <tobias.lorenz@gmx.net>
2008-08-23v4l: replace video_get_drvdata(video_devdata(filp)) with video_drvdata(filp)Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Use the new video_drvdata(filp) function where it is safe to do so. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-08-23radio: fix incorrect video_register_device result checkHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2008-07-30v4l: move BKL down to the driver level.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> 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>
2008-07-26v4l2-dev: remove unused type and type2 field from video_deviceHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> 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>
2008-07-21Remove obsolete owner field from video_device struct.Hans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> 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>
2008-07-21videodev: move all ioctl callbacks to a new v4l2_ioctl_ops structHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> 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>
2008-07-20videodev: move some functions from v4l2-dev.h to v4l2-common.h or v4l2-ioctl.hHans Verkuil
From: Hans Verkuil <hverkuil@xs4all.nl> 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>
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-31 si470x: hardware frequency seek supportMauro Carvalho Chehab
From: Tobias Lorenz <tobias.lorenz@gmx.net> 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>
2008-05-31 si470x: afc indicationMauro Carvalho Chehab
From: Tobias Lorenz <tobias.lorenz@gmx.net> 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>
2008-05-31 si470x: a lot of small code cleanupsMauro Carvalho Chehab
From: Tobias Lorenz <tobias.lorenz@gmx.net> 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>
2008-05-31 si470x: let si470x_get_freq return errnoMauro Carvalho Chehab
From: Tobias Lorenz <tobias.lorenz@gmx.net> Hi Mauro, 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>
2008-05-31 si470x: move global lock to device structureMauro Carvalho Chehab
From: Tobias Lorenz <tobias.lorenz@gmx.net> 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>
2008-04-15 radio: use get/put_unaligned_* helpersMauro Carvalho Chehab
From: Harvey Harrison <harvey.harrison@gmail.com> 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>
2008-03-27Fix blank lines to match in-kernel versionMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> kernel-sync: Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-03-24merge: http://linuxtv.org/hg/~dougsland/v4l-compat/Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-03-23[PATCH] add macro validation for v4l_compat_ioctl32.Douglas Schilling Landgraf
From: Douglas Schilling Landgraf <dougsland@gmail.com> Added macro CONFIG_COMPAT for v4l_compat_ioctl32. Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
2008-03-23 radio-si470x: unplugging fixedMauro Carvalho Chehab
From: Tobias Lorenz <tobias.lorenz@gmx.net> 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>
2008-02-14radio-si470x: Add kernel validation to work queueDouglas Schilling Landgraf
From: Douglas Schilling Landgraf <dougsland@gmail.com> Added kernel validation to support work_struct/delayed_work. (kernel < 2.6.20) Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
2008-02-13radio-si470x: Add kernel validation to mutexDouglas Schilling Landgraf
From: Douglas Schilling Landgraf <dougsland@gmail.com> Added kernel validation to support mutex/semaphore. (kernel < 2.6.16) Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
2008-02-09 autosuspend supportMauro Carvalho Chehab
From: Tobias Lorenz <tobias.lorenz@gmx.net> 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>
2008-02-04 radio-si470x version 1.0.6Mauro Carvalho Chehab
From: Tobias Lorenz <tobias.lorenz@gmx.net> 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>
2008-02-10radio-si470x: fix build warningMichael Krufky
From: Michael Krufky <mkrufky@linuxtv.org> 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>
2008-01-28 Trivial printf warning fix (radio-si470)Mauro Carvalho Chehab
From: Tobias Lorenz <tobias.lorenz@gmx.net> 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>
2008-01-28 radio-si470x.c: check-after-useMauro Carvalho Chehab
From: Tobias Lorenz <tobias.lorenz@gmx.net> 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>
2008-01-27 radio-si470x improvements and seldom problem fixed in tuning functionsMauro Carvalho Chehab
From: Tobias Lorenz <tobias.lorenz@gmx.net> 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>
2008-01-25radio-si570x: Some fixes and new USB ID additionMauro Carvalho Chehab
From: Tobias Lorenz <tobias.lorenz@gmx.net> - 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>
2008-01-25radio-si470x: Some cleanupsMauro Carvalho Chehab
From: Tobias Lorenz <tobias.lorenz@gmx.net> - 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>
2008-01-15Adds the proper compatibility code for radio-si470x and stk-webcamMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@infradead.org> Make radio-si470x and stk-webcam backward compatible with older kernels. This patch adds compat.h header for those files, reorder include order and adds USB_DEVICE_AND_INTERFACE_INFO macro. Thiw way, stk-webcam is backward compatible with 2.6.22, and radio-si470x with kernel 2.6.20. The backports weren't tested, but compile fine. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-01-14USB radio driver for Silicon Labs Si470x FM Radio ReceiversMauro Carvalho Chehab
From: Tobias Lorenz <tobias.lorenz@gmx.net> 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>