Re: [PATCH v4 0/7] Driver for Si476x series of chips

2013-02-18 Thread Hans Verkuil
On Monday, February 18, 2013 19:59:28 Andrey Smirnov wrote:
> This is a fourth version of the patchset originaly posted here:
> https://lkml.org/lkml/2012/9/13/590
> 
> Second version of the patch was posted here:
> https://lkml.org/lkml/2012/10/5/598
> 
> Third version of the patch was posted here:
> https://lkml.org/lkml/2012/10/23/510
> 
> To save everyone's time I'll repost the original description of it:
> 
> This patchset contains a driver for a Silicon Laboratories 476x series
> of radio tuners. The driver itself is implemented as an MFD devices
> comprised of three parts: 
>  1. Core device that provides all the other devices with basic
> functionality and locking scheme.
>  2. Radio device that translates between V4L2 subsystem requests into
> Core device commands.
>  3. Codec device that does similar to the earlier described task, but
> for ALSA SoC subsystem.
> 
> v4 of this driver has following changes:
>  - All of the adjustable timeouts(expose via sysfs) are gone
>  - Names of the controls are changes as was requested
>  - Added documentation for exposed debugfs files 
>  - Minor fix in si476x_radio_fops_poll
>  - DBG_BUFFER is removed
>  - Tested for compilation w/o debugfs enabled
> 
> This version still has all the radio controls being private. The
> reason for that is because I am not sure how that should be handled.
> 
> Hans, do you want me to move all the controls to be standard, that is
> exted V4L's with the needed controls? Should I pick up the parts of
> http://lists-archives.com/linux-kernel/27641304-radio-fixes-and-new-features-for-fm.html
>  and take relevants bits and pieces of it?

Yes, please do that. It's too bad that never made it into the kernel, so let's
do it now.

So take the controls that you can use from that patch and leave out those that
do not apply to your driver. From the remaining controls not covered by that
patch you will have to decide which are truly chip-specific and which are
valid for any advanced radio receiver.

The really chip(set) specific controls should be put in their own header,
but add the base control ID to v4l2-controls.h (see for example the way that
is done for the MEYE controls).

If you can do that quickly and post a v5, then I will do my best to review
it this week or Monday at the latest. Let's finish this driver asap.

Regards,

Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v4 0/7] Driver for Si476x series of chips

2013-02-18 Thread Andrey Smirnov
This is a fourth version of the patchset originaly posted here:
https://lkml.org/lkml/2012/9/13/590

Second version of the patch was posted here:
https://lkml.org/lkml/2012/10/5/598

Third version of the patch was posted here:
https://lkml.org/lkml/2012/10/23/510

To save everyone's time I'll repost the original description of it:

This patchset contains a driver for a Silicon Laboratories 476x series
of radio tuners. The driver itself is implemented as an MFD devices
comprised of three parts: 
 1. Core device that provides all the other devices with basic
functionality and locking scheme.
 2. Radio device that translates between V4L2 subsystem requests into
Core device commands.
 3. Codec device that does similar to the earlier described task, but
for ALSA SoC subsystem.

v4 of this driver has following changes:
 - All of the adjustable timeouts(expose via sysfs) are gone
 - Names of the controls are changes as was requested
 - Added documentation for exposed debugfs files 
 - Minor fix in si476x_radio_fops_poll
 - DBG_BUFFER is removed
 - Tested for compilation w/o debugfs enabled

This version still has all the radio controls being private. The
reason for that is because I am not sure how that should be handled.

Hans, do you want me to move all the controls to be standard, that is
exted V4L's with the needed controls? Should I pick up the parts of
http://lists-archives.com/linux-kernel/27641304-radio-fixes-and-new-features-for-fm.html
 and take relevants bits and pieces of it?

How do you want that to be handled?



Here is v4l2-compliance output for one of the tuners:
sudo v4l2-compliance -r /dev/radio0
is radio
Driver Info:
Driver name   : si476x-radio0
Card type : SI476x AM/FM Receiver
Bus info  : platform:si476x-radio0
Driver version: 3.1.0
Capabilities  : 0x81050500
RDS Capture
Tuner
Radio
Read/Write
Device Capabilities
Device Caps   : 0x01050500
RDS Capture
Tuner
Radio
Read/Write

Compliance test for device /dev/radio0 (not using libv4l2):

Required ioctls:
test VIDIOC_QUERYCAP: OK

Allow for multiple opens:
test second radio open: OK
test VIDIOC_QUERYCAP: OK
test VIDIOC_G/S_PRIORITY: OK

Debug ioctls:
test VIDIOC_DBG_G_CHIP_IDENT: OK
test VIDIOC_DBG_G/S_REGISTER: OK
test VIDIOC_LOG_STATUS: OK (Not Supported)

Input ioctls:
test VIDIOC_G/S_TUNER: OK
test VIDIOC_G/S_FREQUENCY: OK
test VIDIOC_S_HW_FREQ_SEEK: OK
test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 0 Audio Inputs: 0 Tuners: 1

Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK
test VIDIOC_ENUMAUDOUT: OK (Not Supported)
test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0

Control ioctls:
test VIDIOC_QUERYCTRL/MENU: OK
test VIDIOC_G/S_CTRL: OK
test VIDIOC_G/S/TRY_EXT_CTRLS: OK
test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
Standard Controls: 2 Private Controls: 8

Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
test VIDIOC_ENUM/G/S/QUERY_DV_PRESETS: OK (Not Supported)
test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)

Format ioctls:
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK (Not Supported)
test VIDIOC_G/S_PARM: OK (Not Supported)
test VIDIOC_G_FBUF: OK (Not Supported)
test VIDIOC_G_FMT: OK (Not Supported)
test VIDIOC_TRY_FMT: OK (Not Supported)
test VIDIOC_S_FMT: OK (Not Supported)
test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)

Codec ioctls:
test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
test VIDIOC_G_ENC_INDEX: OK (Not Supported)
test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)

Buffer ioctls:
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK (Not Supported)

Total: 38, Succeeded: 38, Failed: 0, Warnings: 0

Andrey Smirnov (7):
  mfd: Add header files and Kbuild plumbing for SI476x MFD core
  mfd: Add commands abstraction layer for SI476X MFD
  mfd: Add the main bulk of core driver for SI476x code
  mfd: Add chip properties handling code for SI476X MFD
  v4l2: Add a V4L2 driver for SI476X MFD
  sound/soc/codecs: Convert SI476X codec to use regmap
  sound/soc/codecs: Cosmetic changes to SI476X codec driver

 Documentation/video4linux/si476x.txt |  187 
 drivers/media/radio/Kconfig  |   17 +
 drivers/media/radio/Makefile |1 +
 drivers/media/radio/radi