Re: [PATCH 27/28] ARM: EXYNOS: Remove CONFIG_SOC_EXYNOS4412

2013-06-15 Thread Eduardo Valentin
Tomasz,

On 14-06-2013 15:33, Tomasz Figa wrote:
 Exynos4212 and Exynos4412 SoCs differ only in number of ARM cores and
 there is no need to have separate Kconfig options for them, since they
 use the same code.
 
 This patch removes CONFIG_SOC_EXYNOS4412, leaving CONFIG_SOC_EXYNOS4212
 as the one supporting both SoCs from this series.
 
 Cc: Rafael J. Wysocki r...@sisk.pl
 Cc: Viresh Kumar viresh.ku...@linaro.org
 Cc: Mauro Carvalho Chehab mche...@redhat.com
 Cc: Zhang Rui rui.zh...@intel.com
 Cc: Eduardo Valentin eduardo.valen...@ti.com
 Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
 Cc: cpuf...@vger.kernel.org
 Cc: linux...@vger.kernel.org
 Cc: linux-media@vger.kernel.org
 Cc: linux-ser...@vger.kernel.org
 Signed-off-by: Tomasz Figa t.f...@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
 ---
  arch/arm/mach-exynos/Kconfig  | 11 +--
  arch/arm/plat-samsung/include/plat/cpu.h  |  6 +-
  drivers/cpufreq/Kconfig.arm   |  2 +-
  drivers/media/platform/exynos4-is/Kconfig |  2 +-
  drivers/thermal/exynos_thermal.c  |  2 +-
  drivers/tty/serial/samsung.c  |  3 +--
  6 files changed, 6 insertions(+), 20 deletions(-)


Not for the matter of the change itself, but just for simplicity while
merging when the change is agreed to be good, it is recommended that you
split your changes in different smaller patches, specially because you
are touching several parts of the kernel that belong to different trees.
If one merges your change the way it is, it is likely to create merge
conflicts.


 
 diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
 index 47d8d9e..fe75a65 100644
 --- a/arch/arm/mach-exynos/Kconfig
 +++ b/arch/arm/mach-exynos/Kconfig
 @@ -46,7 +46,7 @@ config CPU_EXYNOS4210
 Enable EXYNOS4210 CPU support
  
  config SOC_EXYNOS4212
 - bool SAMSUNG EXYNOS4212
 + bool SAMSUNG EXYNOS4212/4412
   default y
   depends on ARCH_EXYNOS4
   select PINCTRL_EXYNOS
 @@ -56,15 +56,6 @@ config SOC_EXYNOS4212
   help
 Enable EXYNOS4212 SoC support
  
 -config SOC_EXYNOS4412
 - bool SAMSUNG EXYNOS4412
 - default y
 - depends on ARCH_EXYNOS4
 - select PINCTRL_EXYNOS
 - select SAMSUNG_DMADEV
 - help
 -   Enable EXYNOS4412 SoC support
 -
  config SOC_EXYNOS5250
   bool SAMSUNG EXYNOS5250
   default y
 diff --git a/arch/arm/plat-samsung/include/plat/cpu.h 
 b/arch/arm/plat-samsung/include/plat/cpu.h
 index 989fefe..87b03bb 100644
 --- a/arch/arm/plat-samsung/include/plat/cpu.h
 +++ b/arch/arm/plat-samsung/include/plat/cpu.h
 @@ -122,13 +122,9 @@ IS_SAMSUNG_CPU(exynos5440, EXYNOS5440_SOC_ID, 
 EXYNOS5_SOC_MASK)
  
  #if defined(CONFIG_SOC_EXYNOS4212)
  # define soc_is_exynos4212() is_samsung_exynos4212()
 -#else
 -# define soc_is_exynos4212() 0
 -#endif
 -
 -#if defined(CONFIG_SOC_EXYNOS4412)
  # define soc_is_exynos4412() is_samsung_exynos4412()
  #else
 +# define soc_is_exynos4212() 0
  # define soc_is_exynos4412() 0
  #endif
  
 diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
 index a924408..b214ad6 100644
 --- a/drivers/cpufreq/Kconfig.arm
 +++ b/drivers/cpufreq/Kconfig.arm
 @@ -32,7 +32,7 @@ config ARM_EXYNOS4210_CPUFREQ
 SoC (S5PV310 or S5PC210).
  
  config ARM_EXYNOS4X12_CPUFREQ
 - def_bool (SOC_EXYNOS4212 || SOC_EXYNOS4412)
 + def_bool SOC_EXYNOS4212
   help
 This adds the CPUFreq driver for Samsung EXYNOS4X12
 SoC (EXYNOS4212 or EXYNOS4412).
 diff --git a/drivers/media/platform/exynos4-is/Kconfig 
 b/drivers/media/platform/exynos4-is/Kconfig
 index 6ff99b5..f483e11 100644
 --- a/drivers/media/platform/exynos4-is/Kconfig
 +++ b/drivers/media/platform/exynos4-is/Kconfig
 @@ -32,7 +32,7 @@ config VIDEO_S5P_MIPI_CSIS
 To compile this driver as a module, choose M here: the
 module will be called s5p-csis.
  
 -if SOC_EXYNOS4212 || SOC_EXYNOS4412 || SOC_EXYNOS5250
 +if SOC_EXYNOS4212 || SOC_EXYNOS5250
  
  config VIDEO_EXYNOS_FIMC_LITE
   tristate EXYNOS FIMC-LITE camera interface driver
 diff --git a/drivers/thermal/exynos_thermal.c 
 b/drivers/thermal/exynos_thermal.c
 index 788b1dd..f88a2ad 100644
 --- a/drivers/thermal/exynos_thermal.c
 +++ b/drivers/thermal/exynos_thermal.c
 @@ -817,7 +817,7 @@ static struct exynos_tmu_platform_data const 
 exynos4210_default_tmu_data = {
  #define EXYNOS4210_TMU_DRV_DATA (NULL)
  #endif
  
 -#if defined(CONFIG_SOC_EXYNOS5250) || defined(CONFIG_SOC_EXYNOS4412)
 +#if defined(CONFIG_SOC_EXYNOS5250) || defined(CONFIG_SOC_EXYNOS4212)
  static struct exynos_tmu_platform_data const exynos_default_tmu_data = {
   .threshold_falling = 10,
   .trigger_levels[0] = 85,
 diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
 index 0c8a9fa..eeb8ecb 100644
 --- a/drivers/tty/serial/samsung.c
 +++ b/drivers/tty/serial/samsung.c
 @@ -1714,8 +1714,7 @@ static struct s3c24xx_serial_drv_data 
 s5pv210_serial_drv_data

[PATCH 0/4] media: si4713: minor updates

2013-03-19 Thread Eduardo Valentin
Hello Mauro and Hans,

Here are a couple of minor changes for si4713 FM transmitter driver.

These changes are also available here:
https://git.gitorious.org/si4713/si4713.git

All best,

Eduardo Valentin (4):
  media: radio: CodingStyle changes on si4713
  media: radio: correct module license (== GPL v2)
  media: radio: add driver owner entry for radio-si4713
  media: radio: add module alias entry for radio-si4713

 drivers/media/radio/radio-si4713.c |   57 ++-
 1 files changed, 29 insertions(+), 28 deletions(-)

-- 
1.7.7.1.488.ge8e1c

--
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 1/4] media: radio: CodingStyle changes on si4713

2013-03-19 Thread Eduardo Valentin
Minor changes to make alignment match on open parenthesis.

Signed-off-by: Eduardo Valentin edubez...@gmail.com
---
 drivers/media/radio/radio-si4713.c |   53 +--
 1 files changed, 26 insertions(+), 27 deletions(-)

diff --git a/drivers/media/radio/radio-si4713.c 
b/drivers/media/radio/radio-si4713.c
index 1507c9d..5b5c42b 100644
--- a/drivers/media/radio/radio-si4713.c
+++ b/drivers/media/radio/radio-si4713.c
@@ -94,7 +94,7 @@ static int radio_si4713_querycap(struct file *file, void 
*priv,
 {
strlcpy(capability-driver, radio-si4713, sizeof(capability-driver));
strlcpy(capability-card, Silicon Labs Si4713 Modulator,
-   sizeof(capability-card));
+   sizeof(capability-card));
capability-capabilities = V4L2_CAP_MODULATOR | V4L2_CAP_RDS_OUTPUT;
 
return 0;
@@ -102,7 +102,7 @@ static int radio_si4713_querycap(struct file *file, void 
*priv,
 
 /* radio_si4713_queryctrl - enumerate control items */
 static int radio_si4713_queryctrl(struct file *file, void *priv,
-   struct v4l2_queryctrl *qc)
+ struct v4l2_queryctrl *qc)
 {
/* Must be sorted from low to high control ID! */
static const u32 user_ctrls[] = {
@@ -152,7 +152,7 @@ static int radio_si4713_queryctrl(struct file *file, void 
*priv,
return v4l2_ctrl_query_fill(qc, 0, 0, 0, 0);
 
return v4l2_device_call_until_err(rsdev-v4l2_dev, 0, core,
-   queryctrl, qc);
+ queryctrl, qc);
 }
 
 /*
@@ -165,66 +165,66 @@ static inline struct v4l2_device *get_v4l2_dev(struct 
file *file)
 }
 
 static int radio_si4713_g_ext_ctrls(struct file *file, void *p,
-   struct v4l2_ext_controls *vecs)
+   struct v4l2_ext_controls *vecs)
 {
return v4l2_device_call_until_err(get_v4l2_dev(file), 0, core,
-   g_ext_ctrls, vecs);
+ g_ext_ctrls, vecs);
 }
 
 static int radio_si4713_s_ext_ctrls(struct file *file, void *p,
-   struct v4l2_ext_controls *vecs)
+   struct v4l2_ext_controls *vecs)
 {
return v4l2_device_call_until_err(get_v4l2_dev(file), 0, core,
-   s_ext_ctrls, vecs);
+ s_ext_ctrls, vecs);
 }
 
 static int radio_si4713_g_ctrl(struct file *file, void *p,
-   struct v4l2_control *vc)
+  struct v4l2_control *vc)
 {
return v4l2_device_call_until_err(get_v4l2_dev(file), 0, core,
-   g_ctrl, vc);
+ g_ctrl, vc);
 }
 
 static int radio_si4713_s_ctrl(struct file *file, void *p,
-   struct v4l2_control *vc)
+  struct v4l2_control *vc)
 {
return v4l2_device_call_until_err(get_v4l2_dev(file), 0, core,
-   s_ctrl, vc);
+ s_ctrl, vc);
 }
 
 static int radio_si4713_g_modulator(struct file *file, void *p,
-   struct v4l2_modulator *vm)
+   struct v4l2_modulator *vm)
 {
return v4l2_device_call_until_err(get_v4l2_dev(file), 0, tuner,
-   g_modulator, vm);
+ g_modulator, vm);
 }
 
 static int radio_si4713_s_modulator(struct file *file, void *p,
-   const struct v4l2_modulator *vm)
+   const struct v4l2_modulator *vm)
 {
return v4l2_device_call_until_err(get_v4l2_dev(file), 0, tuner,
-   s_modulator, vm);
+ s_modulator, vm);
 }
 
 static int radio_si4713_g_frequency(struct file *file, void *p,
-   struct v4l2_frequency *vf)
+   struct v4l2_frequency *vf)
 {
return v4l2_device_call_until_err(get_v4l2_dev(file), 0, tuner,
-   g_frequency, vf);
+ g_frequency, vf);
 }
 
 static int radio_si4713_s_frequency(struct file *file, void *p,
-   struct v4l2_frequency *vf)
+   struct v4l2_frequency *vf)
 {
return v4l2_device_call_until_err(get_v4l2_dev(file), 0, tuner

[PATCH 2/4] media: radio: correct module license (== GPL v2)

2013-03-19 Thread Eduardo Valentin
As per code header comment, changing the driver license entry
to match the correct version.

Signed-off-by: Eduardo Valentin edubez...@gmail.com
---
 drivers/media/radio/radio-si4713.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/radio/radio-si4713.c 
b/drivers/media/radio/radio-si4713.c
index 5b5c42b..cd30a89 100644
--- a/drivers/media/radio/radio-si4713.c
+++ b/drivers/media/radio/radio-si4713.c
@@ -39,7 +39,7 @@ module_param(radio_nr, int, 0);
 MODULE_PARM_DESC(radio_nr,
 Minor number for radio device (-1 == auto assign));
 
-MODULE_LICENSE(GPL);
+MODULE_LICENSE(GPL v2);
 MODULE_AUTHOR(Eduardo Valentin eduardo.valen...@nokia.com);
 MODULE_DESCRIPTION(Platform driver for Si4713 FM Radio Transmitter);
 MODULE_VERSION(0.0.1);
-- 
1.7.7.1.488.ge8e1c

--
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 3/4] media: radio: add driver owner entry for radio-si4713

2013-03-19 Thread Eduardo Valentin
Simple addition of platform_driver-driver-owner for radio-si4713.

Signed-off-by: Eduardo Valentin edubez...@gmail.com
---
 drivers/media/radio/radio-si4713.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/media/radio/radio-si4713.c 
b/drivers/media/radio/radio-si4713.c
index cd30a89..ae70930 100644
--- a/drivers/media/radio/radio-si4713.c
+++ b/drivers/media/radio/radio-si4713.c
@@ -347,6 +347,7 @@ static int __exit radio_si4713_pdriver_remove(struct 
platform_device *pdev)
 static struct platform_driver radio_si4713_pdriver = {
.driver = {
.name   = radio-si4713,
+   .owner  = THIS_MODULE,
},
.probe  = radio_si4713_pdriver_probe,
.remove = __exit_p(radio_si4713_pdriver_remove),
-- 
1.7.7.1.488.ge8e1c

--
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 4/4] media: radio: add module alias entry for radio-si4713

2013-03-19 Thread Eduardo Valentin
Add MODULE_ALIAS entry for radio-si4713 platform driver.

Signed-off-by: Eduardo Valentin edubez...@gmail.com
---
 drivers/media/radio/radio-si4713.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/media/radio/radio-si4713.c 
b/drivers/media/radio/radio-si4713.c
index ae70930..9dda9c3 100644
--- a/drivers/media/radio/radio-si4713.c
+++ b/drivers/media/radio/radio-si4713.c
@@ -43,6 +43,7 @@ MODULE_LICENSE(GPL v2);
 MODULE_AUTHOR(Eduardo Valentin eduardo.valen...@nokia.com);
 MODULE_DESCRIPTION(Platform driver for Si4713 FM Radio Transmitter);
 MODULE_VERSION(0.0.1);
+MODULE_ALIAS(platform:radio-si4713);
 
 /* Driver state struct */
 struct radio_si4713_device {
-- 
1.7.7.1.488.ge8e1c

--
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 1/1] MAINTAINERS: Add maintainer entry for si4713 FM transmitter driver

2013-02-27 Thread Eduardo Valentin
Add maintainer entry for the files composing si4713 FM transmitter driver.

Signed-off-by: Eduardo Valentin edubez...@gmail.com
---
 MAINTAINERS |   16 
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 870ba56..fe5583e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7070,6 +7070,22 @@ F:   drivers/media/radio/si470x/radio-si470x-common.c
 F: drivers/media/radio/si470x/radio-si470x.h
 F: drivers/media/radio/si470x/radio-si470x-usb.c
 
+SI4713 FM RADIO TRANSMITTER I2C DRIVER
+M: Eduardo Valentin edubez...@gmail.com
+L: linux-media@vger.kernel.org
+T: git git://linuxtv.org/media_tree.git
+W: http://linuxtv.org
+S: Odd Fixes
+F: drivers/media/radio/si4713-i2c.?
+
+SI4713 FM RADIO TRANSMITTER PLATFORM DRIVER
+M: Eduardo Valentin edubez...@gmail.com
+L: linux-media@vger.kernel.org
+T: git git://linuxtv.org/media_tree.git
+W: http://linuxtv.org
+S: Odd Fixes
+F: drivers/media/radio/radio-si4713.h
+
 SH_VEU V4L2 MEM2MEM DRIVER
 M: Guennadi Liakhovetski g.liakhovet...@gmx.de
 L: linux-media@vger.kernel.org
-- 
1.7.7.1.488.ge8e1c

--
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


Re: [PATCH] Illuminators and status LED controls

2010-09-08 Thread Eduardo Valentin
Hello,

On Wed, Sep 08, 2010 at 04:16:48AM +0200, ext Eino-Ville Talvala wrote:
 
  This is probably a bit OT, but these sorts of indicator LEDs can get quite 
 complicated.
 
 As part of our FCamera sample program on the Nokia N900 (which uses V4L2 way 
 down there), we wanted to reprogram the front indicator LED to flash exactly 
 when a picture is taken.  The N900 front LED is quite a programmable beast 
 [1], with a dedicated microcontroller (the lp5521) that runs little programs 
 that define the blink patterns for the RGB LED.
 
 I'm not really suggesting that the V4L2 control should be able to handle this 
 sort of an LED, but as these sorts of things get cheaper, it may become a 
 case of 'why not?' for manufacturers putting in more complex RGB LEDs.   And 
 if you don't want to encapsulate all that in V4L2, it may be better to leave 
 it to other APIs at some point of complexity (the current lp5521 driver seems 
 to have a sysfs-only interface for now for the programmable patterns, and the 
 standard LED API otherwise)
 
 [1] http://wiki.maemo.org/LED_patterns

Well, that's exactly why duplicating API's is usually a bad idea. If the thing 
start to get complex, having only one place to hold
the mess is better than keeping it into two (or more) different places. This 
will become worst and worst. I mean, why do we want two
different APIs to control same stuff?

And yes, application developers must use the correct API to control stuff. Why 
should kernel duplicate interfaces just because
user land don't want to use two different interfaces? Doesn't this sound a bit 
... strange at least?

 
 Eino-Ville Talvala
 Computer Graphics Lab
 Stanford University
 
 On 9/7/2010 1:33 PM, Andy Walls wrote:
  It has already been discussed.  Please check the list archives for the past 
  few days.


OK, will search the logs. But you should probably add some sort of reasoning in 
your patch
description, explaining why you are duplicating interfaces.

 
  Do you know of any V4L2 application developer or development team that 
  prefers to use a separate API just to turn lights on and off, when all 
  other aspects of the incoming video are controlled with the V4L2 control 
  API?
 
  (That question is mostly rhetorical, but I'd still actually be interested 
  from video app developers.)
 
  Regards,
  Andy
 
  Eduardo Valentin eduardo.valen...@nokia.com wrote:
 
  Hello,
 
  On Mon, Sep 06, 2010 at 08:11:05PM +0200, ext Jean-Francois Moine wrote:
  Hi,
 
  This new proposal cancels the previous 'LED control' patch.
 
  Cheers.
 
  -- 
  Ken ar c'hentañ   | ** Breizh ha Linux atav! **
  Jef   |   http://moinejf.free.fr/
  Apologies if this has been already discussed but,
  doesn't this patch duplicates the same feature present
  nowadays under include/linux/leds.h ??
 
  I mean, if you want to control leds, I think we already have that API, no?
 
  BR,
 
  ---
  Eduardo Valentin
  --
  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
  N�r��y���b�X��ǧv�^�)޺{.n�+{���bj)���w*jg����ݢj/���z�ޖ��2�ޙ)ߡ�a�����G���h��j:+v���w�٥
 

-- 
---
Eduardo Valentin
--
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


Re: [PATCH 2/2] V4L/DVB: radio-si4713: Add regulator framework support

2010-09-08 Thread Eduardo Valentin
Hello,

On Wed, Sep 08, 2010 at 07:59:38AM +0200, Jarkko Nikula wrote:
 Hi
 
 On Tue, 7 Sep 2010 22:49:49 +0300
 Eduardo Valentin eduardo.valen...@nokia.com wrote:
 
  Hello Jarkko,
  
  On Sun, Jun 13, 2010 at 08:09:28PM +0200, Jarkko Nikula wrote:
   Convert the driver to use regulator framework instead of set_power 
   callback.
   This with gpio_reset platform data provide cleaner way to manage chip VIO,
   VDD and reset signal inside the driver.
   
   Signed-off-by: Jarkko Nikula jhnik...@gmail.com
   Cc: Eduardo Valentin eduardo.valen...@nokia.com
   ---
   I don't have specifications for this chip so I don't know how long the
   reset signal must be active after power-up. I used 50 us from Maemo
   kernel sources for Nokia N900 and I can successfully enable-disable
   transmitter on N900 with vdd power cycling.
   ---
drivers/media/radio/radio-si4713.c |   20 ++-
drivers/media/radio/si4713-i2c.c   |   48 
   ---
drivers/media/radio/si4713-i2c.h   |3 +-
include/media/si4713.h |3 +-
  
  Could you please elaborate a bit more on the fact that you have put vio on
  the platform driver and vdd on the i2c driver?
  
 This is good question and let me explain. The regulator management
 division between these two files were based on my assumption that only
 VIO is needed and must be on before probing the chip on I2C bus.
 
 Another assumption was that only VDD can realistically be managed
 runtime in si4713_powerup function. I think usually IO voltages cannot
 be shutdown even in suspend while the system is powered so I let the
 driver to keep the VIO enabled as long as the module is loaded.

OK. I kinda agree with you in this reasoning.

My concern here is that splitting the regulator usage into two entities
could cause some troubles.

The background here you are probably missing is that the split between
i2c and platform drivers. That has been done because we were thinking also
in the situation where the si4713 i2c driver could be used without the
platform driver. I mean, the i2c code could be re-used for instance by
other v4l2 driver, if that is driving a device which has also si4713.
So, in this sense, the current platform is essentially a wrapper.
And if you split the regulator usage in that way,
we would probably be loosing that.

And apart from that, it is also bad from the regfw point of view as well.
I believe the idea is that the driver itself must take care of all needed
regulators. The way you have done, looks like the platform driver needs only
VIO and the i2c needs only VDD. And to my understanding, the i2c needs both
in order to work. So, my suggestion is to move everything to the i2c driver.

 
 
 -- 
 Jarkko

---
Eduardo Valentin
--
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


Re: [PATCH] Illuminators and status LED controls

2010-09-07 Thread Eduardo Valentin
Hello,

On Mon, Sep 06, 2010 at 08:11:05PM +0200, ext Jean-Francois Moine wrote:
 Hi,
 
 This new proposal cancels the previous 'LED control' patch.
 
 Cheers.
 
 -- 
 Ken ar c'hentañ   | ** Breizh ha Linux atav! **
 Jef   |   http://moinejf.free.fr/

Apologies if this has been already discussed but,
doesn't this patch duplicates the same feature present
nowadays under include/linux/leds.h ??

I mean, if you want to control leds, I think we already have that API, no?

BR,

---
Eduardo Valentin
--
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


Re: [PATCH 2/2] V4L/DVB: radio-si4713: Add regulator framework support

2010-09-07 Thread Eduardo Valentin
Hello Jarkko,

On Sun, Jun 13, 2010 at 08:09:28PM +0200, Jarkko Nikula wrote:
 Convert the driver to use regulator framework instead of set_power callback.
 This with gpio_reset platform data provide cleaner way to manage chip VIO,
 VDD and reset signal inside the driver.
 
 Signed-off-by: Jarkko Nikula jhnik...@gmail.com
 Cc: Eduardo Valentin eduardo.valen...@nokia.com
 ---
 I don't have specifications for this chip so I don't know how long the
 reset signal must be active after power-up. I used 50 us from Maemo
 kernel sources for Nokia N900 and I can successfully enable-disable
 transmitter on N900 with vdd power cycling.
 ---
  drivers/media/radio/radio-si4713.c |   20 ++-
  drivers/media/radio/si4713-i2c.c   |   48 ---
  drivers/media/radio/si4713-i2c.h   |3 +-
  include/media/si4713.h |3 +-

Could you please elaborate a bit more on the fact that you have put vio on
the platform driver and vdd on the i2c driver?

  4 files changed, 60 insertions(+), 14 deletions(-)
 
 diff --git a/drivers/media/radio/radio-si4713.c 
 b/drivers/media/radio/radio-si4713.c
 index 0a9fc4d..c666012 100644
 --- a/drivers/media/radio/radio-si4713.c
 +++ b/drivers/media/radio/radio-si4713.c
 @@ -28,6 +28,7 @@
  #include linux/i2c.h
  #include linux/videodev2.h
  #include linux/slab.h
 +#include linux/regulator/consumer.h
  #include media/v4l2-device.h
  #include media/v4l2-common.h
  #include media/v4l2-ioctl.h
 @@ -48,6 +49,7 @@ MODULE_VERSION(0.0.1);
  struct radio_si4713_device {
   struct v4l2_device  v4l2_dev;
   struct video_device *radio_dev;
 + struct regulator*reg_vio;
  };
  
  /* radio_si4713_fops - file operations interface */
 @@ -283,12 +285,22 @@ static int radio_si4713_pdriver_probe(struct 
 platform_device *pdev)
   goto free_rsdev;
   }
  
 + rsdev-reg_vio = regulator_get(pdev-dev, vio);
 + if (IS_ERR(rsdev-reg_vio)) {
 + dev_err(pdev-dev, Cannot get vio regulator\n);
 + rval = PTR_ERR(rsdev-reg_vio);
 + goto unregister_v4l2_dev;
 + }
 + rval = regulator_enable(rsdev-reg_vio);
 + if (rval)
 + goto reg_put;
 +
   adapter = i2c_get_adapter(pdata-i2c_bus);
   if (!adapter) {
   dev_err(pdev-dev, Cannot get i2c adapter %d\n,
   pdata-i2c_bus);
   rval = -ENODEV;
 - goto unregister_v4l2_dev;
 + goto reg_disable;
   }
  
   sd = v4l2_i2c_new_subdev_board(rsdev-v4l2_dev, adapter, si4713_i2c,
 @@ -322,6 +334,10 @@ free_vdev:
   video_device_release(rsdev-radio_dev);
  put_adapter:
   i2c_put_adapter(adapter);
 +reg_disable:
 + regulator_disable(rsdev-reg_vio);
 +reg_put:
 + regulator_put(rsdev-reg_vio);
  unregister_v4l2_dev:
   v4l2_device_unregister(rsdev-v4l2_dev);
  free_rsdev:
 @@ -343,6 +359,8 @@ static int __exit radio_si4713_pdriver_remove(struct 
 platform_device *pdev)
  
   video_unregister_device(rsdev-radio_dev);
   i2c_put_adapter(client-adapter);
 + regulator_disable(rsdev-reg_vio);
 + regulator_put(rsdev-reg_vio);
   v4l2_device_unregister(rsdev-v4l2_dev);
   kfree(rsdev);
  
 diff --git a/drivers/media/radio/si4713-i2c.c 
 b/drivers/media/radio/si4713-i2c.c
 index ab63dd5..4b5470c 100644
 --- a/drivers/media/radio/si4713-i2c.c
 +++ b/drivers/media/radio/si4713-i2c.c
 @@ -27,6 +27,8 @@
  #include linux/interrupt.h
  #include linux/i2c.h
  #include linux/slab.h
 +#include linux/gpio.h
 +#include linux/regulator/consumer.h
  #include media/v4l2-device.h
  #include media/v4l2-ioctl.h
  #include media/v4l2-common.h
 @@ -369,7 +371,12 @@ static int si4713_powerup(struct si4713_device *sdev)
   if (sdev-power_state)
   return 0;
  
 - sdev-platform_data-set_power(1);
 + regulator_enable(sdev-reg_vdd);
 + if (gpio_is_valid(sdev-gpio_reset)) {
 + udelay(50);
 + gpio_set_value(sdev-gpio_reset, 1);
 + }
 +
   err = si4713_send_command(sdev, SI4713_CMD_POWER_UP,
   args, ARRAY_SIZE(args),
   resp, ARRAY_SIZE(resp),
 @@ -384,7 +391,9 @@ static int si4713_powerup(struct si4713_device *sdev)
   err = si4713_write_property(sdev, SI4713_GPO_IEN,
   SI4713_STC_INT | SI4713_CTS);
   } else {
 - sdev-platform_data-set_power(0);
 + if (gpio_is_valid(sdev-gpio_reset))
 + gpio_set_value(sdev-gpio_reset, 0);
 + regulator_disable(sdev-reg_vdd);
   }
  
   return err;
 @@ -411,7 +420,9 @@ static int si4713_powerdown(struct si4713_device *sdev)
   v4l2_dbg(1, debug, sdev-sd, Power down response: 0x%02x\n,
   resp[0]);
   v4l2_dbg(1, debug, sdev-sd, Device in reset mode

Re: [PATCH 1/2] V4L/DVB: radio-si4713: Release i2c adapter in driver cleanup paths

2010-09-07 Thread Eduardo Valentin
Jarkko and Mauro,

Apologies for the long delay.

On Sun, Jun 13, 2010 at 08:09:27PM +0200, Jarkko Nikula wrote:
 Call to i2c_put_adapter was missing in radio_si4713_pdriver_probe and
 radio_si4713_pdriver_remove.
 
 Signed-off-by: Jarkko Nikula jhnik...@gmail.com
 Cc: Eduardo Valentin eduardo.valen...@nokia.com

Acked-by: Eduardo Valentin eduardo.valen...@nokia.com

 ---
  drivers/media/radio/radio-si4713.c |   10 --
  1 files changed, 8 insertions(+), 2 deletions(-)
 
 diff --git a/drivers/media/radio/radio-si4713.c 
 b/drivers/media/radio/radio-si4713.c
 index 13554ab..0a9fc4d 100644
 --- a/drivers/media/radio/radio-si4713.c
 +++ b/drivers/media/radio/radio-si4713.c
 @@ -296,14 +296,14 @@ static int radio_si4713_pdriver_probe(struct 
 platform_device *pdev)
   if (!sd) {
   dev_err(pdev-dev, Cannot get v4l2 subdevice\n);
   rval = -ENODEV;
 - goto unregister_v4l2_dev;
 + goto put_adapter;
   }
  
   rsdev-radio_dev = video_device_alloc();
   if (!rsdev-radio_dev) {
   dev_err(pdev-dev, Failed to alloc video device.\n);
   rval = -ENOMEM;
 - goto unregister_v4l2_dev;
 + goto put_adapter;
   }
  
   memcpy(rsdev-radio_dev, radio_si4713_vdev_template,
 @@ -320,6 +320,8 @@ static int radio_si4713_pdriver_probe(struct 
 platform_device *pdev)
  
  free_vdev:
   video_device_release(rsdev-radio_dev);
 +put_adapter:
 + i2c_put_adapter(adapter);
  unregister_v4l2_dev:
   v4l2_device_unregister(rsdev-v4l2_dev);
  free_rsdev:
 @@ -335,8 +337,12 @@ static int __exit radio_si4713_pdriver_remove(struct 
 platform_device *pdev)
   struct radio_si4713_device *rsdev = container_of(v4l2_dev,
   struct radio_si4713_device,
   v4l2_dev);
 + struct v4l2_subdev *sd = list_entry(v4l2_dev-subdevs.next,
 + struct v4l2_subdev, list);
 + struct i2c_client *client = v4l2_get_subdevdata(sd);
  
   video_unregister_device(rsdev-radio_dev);
 + i2c_put_adapter(client-adapter);
   v4l2_device_unregister(rsdev-v4l2_dev);
   kfree(rsdev);
  
 -- 
 1.7.1

-- 
---
Eduardo Valentin
--
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


Re: [PATCH] si4713: Fix oops when si4713_platform_data is marked as __initdata

2010-05-18 Thread Eduardo Valentin
Hello,

On Sun, May 16, 2010 at 07:04:26PM +0200, Jarkko Nikula wrote:
 This driver can cause an oops if si4713_platform_data holding pointer to
 set_power function is marked as __initdata and when trying to power up the
 chip after booting e.g. with 'v4l2-ctl -d /dev/radio0 --set-ctrl=mute=0'.
 
 This happens because the sdev-platform_data doesn't point to valid data
 anymore after kernel is initialized.
 
 Fix this by taking local copy of si4713_platform_data-set_power. Add also
 NULL check for this function pointer.

I'm probably fine with this patch, and the driver must check for the pointer
before using it, indeed.

But, I'm a bit skeptic about marking its platform data as __initdata. Would it 
make sense?
What happens if driver is built as module and loaded / unload / loaded again?

Maybe the initdata flag does not apply in this case. Not sure (and not tested 
the above case).

BR,

 
 Signed-off-by: Jarkko Nikula jhnik...@gmail.com
 Cc: Eduardo Valentin eduardo.valen...@nokia.com
 ---
  drivers/media/radio/si4713-i2c.c |   15 +--
  drivers/media/radio/si4713-i2c.h |2 +-
  2 files changed, 10 insertions(+), 7 deletions(-)
 
 diff --git a/drivers/media/radio/si4713-i2c.c 
 b/drivers/media/radio/si4713-i2c.c
 index ab63dd5..cf9858d 100644
 --- a/drivers/media/radio/si4713-i2c.c
 +++ b/drivers/media/radio/si4713-i2c.c
 @@ -369,7 +369,8 @@ static int si4713_powerup(struct si4713_device *sdev)
   if (sdev-power_state)
   return 0;
  
 - sdev-platform_data-set_power(1);
 + if (sdev-set_power)
 + sdev-set_power(1);
   err = si4713_send_command(sdev, SI4713_CMD_POWER_UP,
   args, ARRAY_SIZE(args),
   resp, ARRAY_SIZE(resp),
 @@ -383,8 +384,8 @@ static int si4713_powerup(struct si4713_device *sdev)
  
   err = si4713_write_property(sdev, SI4713_GPO_IEN,
   SI4713_STC_INT | SI4713_CTS);
 - } else {
 - sdev-platform_data-set_power(0);
 + } else if (sdev-set_power) {
 + sdev-set_power(0);
   }
  
   return err;
 @@ -411,7 +412,8 @@ static int si4713_powerdown(struct si4713_device *sdev)
   v4l2_dbg(1, debug, sdev-sd, Power down response: 0x%02x\n,
   resp[0]);
   v4l2_dbg(1, debug, sdev-sd, Device in reset mode\n);
 - sdev-platform_data-set_power(0);
 + if (sdev-set_power)
 + sdev-set_power(0);
   sdev-power_state = POWER_OFF;
   }
  
 @@ -1959,6 +1961,7 @@ static int si4713_probe(struct i2c_client *client,
   const struct i2c_device_id *id)
  {
   struct si4713_device *sdev;
 + struct si4713_platform_data *pdata = client-dev.platform_data;
   int rval;
  
   sdev = kzalloc(sizeof *sdev, GFP_KERNEL);
 @@ -1968,12 +1971,12 @@ static int si4713_probe(struct i2c_client *client,
   goto exit;
   }
  
 - sdev-platform_data = client-dev.platform_data;
 - if (!sdev-platform_data) {
 + if (!pdata) {
   v4l2_err(sdev-sd, No platform data registered.\n);
   rval = -ENODEV;
   goto free_sdev;
   }
 + sdev-set_power = pdata-set_power;
  
   v4l2_i2c_subdev_init(sdev-sd, client, si4713_subdev_ops);
  
 diff --git a/drivers/media/radio/si4713-i2c.h 
 b/drivers/media/radio/si4713-i2c.h
 index faf8cff..d1af889 100644
 --- a/drivers/media/radio/si4713-i2c.h
 +++ b/drivers/media/radio/si4713-i2c.h
 @@ -220,7 +220,7 @@ struct si4713_device {
   /* private data structures */
   struct mutex mutex;
   struct completion work;
 - struct si4713_platform_data *platform_data;
 + int (*set_power)(int power);
   struct rds_info rds_info;
   struct limiter_info limiter_info;
   struct pilot_info pilot_info;
 -- 
 1.7.1
--
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


Re: [PATCH 2/9] V4L/DVB: si4713: remove unused #include linux/version.h

2009-09-21 Thread Eduardo Valentin
Hello,

On Wed, Sep 16, 2009 at 03:06:15PM +0200, ext Huang Weiyi wrote:
 Remove unused #include linux/version.h('s) in
   drivers/media/radio/radio-si4713.c
 
 Signed-off-by: Huang Weiyi weiyi.hu...@gmail.com

This might be late, but I'm add my ack here.

Acked-by: Eduardo Valentin eduardo.valen...@nokia.com

 ---
  drivers/media/radio/radio-si4713.c |1 -
  1 files changed, 0 insertions(+), 1 deletions(-)
 
 diff --git a/drivers/media/radio/radio-si4713.c 
 b/drivers/media/radio/radio-si4713.c
 index 65c14b7..170bbe5 100644
 --- a/drivers/media/radio/radio-si4713.c
 +++ b/drivers/media/radio/radio-si4713.c
 @@ -24,7 +24,6 @@
  #include linux/kernel.h
  #include linux/module.h
  #include linux/init.h
 -#include linux/version.h
  #include linux/platform_device.h
  #include linux/i2c.h
  #include linux/videodev2.h
 -- 
 1.6.1.3
 
 --
 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

-- 
Eduardo Valentin
--
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


Re: [PATCH 1/1] FM TX: si4713: Kconfig: Fixed two typos.

2009-09-11 Thread Eduardo Valentin
On Fri, Sep 11, 2009 at 09:38:04AM +0200, Aaltonen Matti.J (Nokia-D/Tampere) 
wrote:
 Fixed two typos.
 
 Signed-off-by: Matti J. Aaltonen matti.j.aalto...@nokia.com

Acked-by: Eduardo Valentin eduardo.valen...@nokia.com

 
 diff -r 5582a6427a41 -r ff80edccfe24 linux/drivers/media/radio/Kconfig
 --- a/linux/drivers/media/radio/Kconfig   Tue Sep 01 22:16:23 2009 +0200
 +++ b/linux/drivers/media/radio/Kconfig   Fri Sep 11 10:25:13 2009 +0300
 @@ -346,7 +346,7 @@
   ---help---
 Say Y here if you want support to Si4713 FM Radio Transmitter.
 This device can transmit audio through FM. It can transmit
 -   EDS and EBDS signals as well. This module is the v4l2 radio
 +   RDS and RBDS signals as well. This module is the v4l2 radio
 interface for the i2c driver of this device.
  
 To compile this driver as a module, choose M here: the
 

-- 
Eduardo Valentin
--
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


Re: [PULL] http://www.linuxtv.org/hg/~hverkuil/v4l-dvb

2009-09-01 Thread Eduardo Valentin
On Mon, Aug 31, 2009 at 10:59:14PM +0200, ext Hans Verkuil wrote:
 Hi Mauro,
 
 Please pull from http://www.linuxtv.org/hg/~hverkuil/v4l-dvb for the 
 following:
 
 - compat: don't build si4713 for kernels  2.6.26
 - compat: don't build soc-camera modules for kernels  2.6.28.
 - si4713: simplify the code to remove a compiler warning.
 - cx25840: fix determining the firmware name
 
 The last one fixes this bug: 
 https://bugzilla.redhat.com/show_bug.cgi?id=480728
 
 Thanks,
 
 Hans
 
 diffstat:
  linux/drivers/media/radio/si4713-i2c.c   |   17 ++---

On si4713-i2c.c behalf:

Acked-by: Eduardo Valentin eduardo.valen...@nokia.com


  linux/drivers/media/video/cx25840/cx25840-firmware.c |   35 
 +++
  v4l/versions.txt |   19 +++---
  3 files changed, 40 insertions(+), 31 deletions(-)
 
 -- 
 Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom

-- 
Eduardo Valentin
--
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


Re: [PATCHv15 2/8] v4l2: video device: Add V4L2_CTRL_CLASS_FM_TX controls

2009-08-16 Thread Eduardo Valentin
Hello Hans,

snip


 Hi Eduardo,

 I would like to make some small changes here: the control IDs do not have to
 be consecutive so I think it is better to leave some gaps between the various
 sections: e.g. let the AUDIO controls start at BASE + 64 (leaving more than
 enough room for additional RDS controls). Between PTY and PS_NAME we should
 skip one control since I'm sure at some time in the future a PTY_NAME will
 appear. A comment like '/* placeholder for future PTY_NAME control */' would
 be useful as well.

I think leaving room for following controls would be good. No problem to leave
some space left already in between these ID's.

About the comment for PTY_NAME, I also agree with you.


 The AUDIO_COMPRESSION controls can start at BASE + 80, the PILOT controls at
 BASE + 96 and the last set of controls at BASE + 112.

Right.


 BTW, wouldn't it be slightly more consistent if V4L2_CID_FM_TX_PREEMPHASIS is
 renamed to V4L2_CID_TUNE_PREEMPHASIS? It's a bit of an odd one out at the
 moment.

Right. Good. Better to aggregate it into the *_TUNE_* controls. Which
makes sense for me.


 Note that I've verified my compat32 implementation for strings: it's working
 correctly on my 64-bit machine (I hacked a string control into vivi.c to do
 the testing).

Right.


 If you agree with these proposed changes, then I can modify the patch myself,
 no need for a new patch series.

Ok then. You can proceed with these changes. No problem from my side.


 Regards,

        Hans


BR,

-- 
Eduardo Bezerra Valentin
--
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 1/1] si4713-i2c: Fix null pointer reference in probe

2009-08-10 Thread Eduardo Valentin
Remove reference to uninitialized v4l2_subdevice pointer
in fail path of probe function.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/drivers/media/radio/si4713-i2c.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/linux/drivers/media/radio/si4713-i2c.c 
b/linux/drivers/media/radio/si4713-i2c.c
index 116555c..e45d236 100644
--- a/linux/drivers/media/radio/si4713-i2c.c
+++ b/linux/drivers/media/radio/si4713-i2c.c
@@ -1976,7 +1976,7 @@ static int si4713_probe(struct i2c_client *client,
 
sdev-platform_data = client-dev.platform_data;
if (!sdev-platform_data) {
-   v4l2_err(sdev-sd, No platform data registered.\n);
+   dev_err(client-dev, No platform data registered.\n);
rval = -ENODEV;
goto free_sdev;
}
-- 
1.6.2.GIT

--
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


Re: [PATCHv14 6/8] FM TX: si4713: Add files to handle si4713 i2c device

2009-08-08 Thread Eduardo Valentin
On Fri, Aug 07, 2009 at 01:51:36PM +0200, ext Hans Verkuil wrote:
 Hi Eduardo,
 
 Douglas pointed out to me that I hadn't reviewed this series yet.
 
 That was mostly because it's pretty good as far as I'm concerned :-)
 
 I do think one small thing should change:
 
 On Monday 27 July 2009 17:12:08 Eduardo Valentin wrote:
  diff --git a/linux/drivers/media/radio/si4713-i2c.c 
  b/linux/drivers/media/radio/si4713-i2c.c
 
 snip
 
  +/* write string property */
  +static int si4713_write_econtrol_string(struct si4713_device *sdev,
  +   struct v4l2_ext_control *control)
  +{
  +   struct v4l2_queryctrl vqc;
  +   int len;
  +   s32 rval = 0;
  +
  +   vqc.id = control-id;
  +   rval = si4713_queryctrl(sdev-sd, vqc);
  +   if (rval  0)
  +   goto exit;
  +
  +   switch (control-id) {
  +   case V4L2_CID_RDS_TX_PS_NAME: {
  +   char ps_name[MAX_RDS_PS_NAME + 1];
  +
  +   len = control-size - 1;
  +   if (len  MAX_RDS_PS_NAME)
  +   len = MAX_RDS_PS_NAME;
  +   rval = copy_from_user(ps_name, control-string, len);
  +   if (rval  0)
  +   goto exit;
  +   ps_name[len] = '\0';
  +
  +   if (strlen(ps_name) % vqc.step) {
  +   rval = -EINVAL;
 
 I think we should return -ERANGE instead. It makes more sense than -EINVAL,
 since it is the string length that is out of bounds. -ERANGE is the expected
 error code when the control boundary checks fail.
 
 I know I said EINVAL before, but after thinking about it some more I've
 reconsidered.


Hans, just to make sure in this point. Here I am returning EINVAL because
the string length is not multiple of control step and not because it is greater
than it is supposed to be. As discussed earlier, during control write, if
the coming string value is larger than it was supposed to be, I'm shrinking it.
See above lines. So the question is: should I return ERANGE when string length
is not multiple of step?

BR,

 
  +   goto exit;
  +   }
  +
  +   rval = si4713_set_rds_ps_name(sdev, ps_name);
  +   }
  +   break;
  +
  +   case V4L2_CID_RDS_TX_RADIO_TEXT:{
  +   char radio_text[MAX_RDS_RADIO_TEXT + 1];
  +
  +   len = control-size - 1;
  +   if (len  MAX_RDS_RADIO_TEXT)
  +   len = MAX_RDS_RADIO_TEXT;
  +   rval = copy_from_user(radio_text, control-string, len);
  +   if (rval  0)
  +   goto exit;
  +   radio_text[len] = '\0';
  +
  +   if (strlen(radio_text) % vqc.step) {
  +   rval = -EINVAL;
 
 Ditto.
 
  +   goto exit;
  +   }
  +
  +   rval = si4713_set_rds_radio_text(sdev, radio_text);
  +   }
  +   break;
  +
  +   default:
  +   rval = -EINVAL;
  +   break;
  +   };
  +
  +exit:
  +   return rval;
  +}
 
 Just change this and you can add
 
 Reviewed-by: Hans Verkuil hverk...@xs4all.nl
 
 for the whole series.
 
 Regards,
 
   Hans
 
 -- 
 Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom

-- 
Eduardo Valentin
--
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


[PATCHv15 0/8] FM Transmitter (si4713) and another changes

2009-08-08 Thread Eduardo Valentin
Hello guys,

Here is v15 of first FM TX driver.

Changes from v14 are:
- Use proper errno in string control handling (change from EINVAL to ERANGE)
- Change ordering of RDS_TX controls. DEVIATION is now first control. This
was updated in videodev2.h, platform driver and documentation.
- Added FM TX class reference in vidioc-g-ext-ctrls.sgml
- Fixed a null pointer reference in I2C driver, in one of its error paths
inside probe function.
- Propagation of errno is now done properly for s/g_ext_ctrls

As usual, comments are wellcome !

Thanks you all for the good reviewing work.

BR,

Eduardo Valentin (8):
  v4l2-subdev.h: Add g_modulator callbacks to subdev api
  v4l2: video device: Add V4L2_CTRL_CLASS_FM_TX controls
  v4l2: video device: Add FM TX controls default configurations
  v4l2-spec: Add documentation description for FM TX extended control
class
  FM TX: si4713: Add files to add radio interface for si4713
  FM TX: si4713: Add files to handle si4713 i2c device
  FM TX: si4713: Add Kconfig and Makefile entries
  FM TX: si4713: Add document file

 linux/Documentation/video4linux/si4713.txt  |  176 ++
 linux/drivers/media/radio/Kconfig   |   22 +
 linux/drivers/media/radio/Makefile  |2 +
 linux/drivers/media/radio/radio-si4713.c|  367 
 linux/drivers/media/radio/si4713-i2c.c  | 2067 +++
 linux/drivers/media/radio/si4713-i2c.h  |  237 +++
 linux/drivers/media/video/v4l2-common.c |   50 +
 linux/drivers/media/video/v4l2-compat-ioctl32.c |8 +-
 linux/include/linux/videodev2.h |   34 +
 linux/include/media/radio-si4713.h  |   30 +
 linux/include/media/si4713.h|   49 +
 linux/include/media/v4l2-subdev.h   |2 +
 v4l2-spec/Makefile  |1 +
 v4l2-spec/controls.sgml |  215 +++
 v4l2-spec/vidioc-g-ext-ctrls.sgml   |7 +
 15 files changed, 3266 insertions(+), 1 deletions(-)
 create mode 100644 linux/Documentation/video4linux/si4713.txt
 create mode 100644 linux/drivers/media/radio/radio-si4713.c
 create mode 100644 linux/drivers/media/radio/si4713-i2c.c
 create mode 100644 linux/drivers/media/radio/si4713-i2c.h
 create mode 100644 linux/include/media/radio-si4713.h
 create mode 100644 linux/include/media/si4713.h

--
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


[PATCHv15 1/8] v4l2-subdev.h: Add g_modulator callbacks to subdev api

2009-08-08 Thread Eduardo Valentin
Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/include/media/v4l2-subdev.h |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/linux/include/media/v4l2-subdev.h 
b/linux/include/media/v4l2-subdev.h
index 89a39ce..d411345 100644
--- a/linux/include/media/v4l2-subdev.h
+++ b/linux/include/media/v4l2-subdev.h
@@ -137,6 +137,8 @@ struct v4l2_subdev_tuner_ops {
int (*g_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq);
int (*g_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
int (*s_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
+   int (*g_modulator)(struct v4l2_subdev *sd, struct v4l2_modulator *vm);
+   int (*s_modulator)(struct v4l2_subdev *sd, struct v4l2_modulator *vm);
int (*s_type_addr)(struct v4l2_subdev *sd, struct tuner_setup *type);
int (*s_config)(struct v4l2_subdev *sd, const struct 
v4l2_priv_tun_config *config);
int (*s_standby)(struct v4l2_subdev *sd);
-- 
1.6.2.GIT

--
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


[PATCHv15 2/8] v4l2: video device: Add V4L2_CTRL_CLASS_FM_TX controls

2009-08-08 Thread Eduardo Valentin
This patch adds a new class of extended controls. This class
is intended to support FM Radio Modulators properties such as:
rds, audio limiters, audio compression, pilot tone generation,
tuning power levels and preemphasis properties.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/include/linux/videodev2.h |   34 ++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h
index b17898c..a86a575 100644
--- a/linux/include/linux/videodev2.h
+++ b/linux/include/linux/videodev2.h
@@ -817,6 +817,7 @@ struct v4l2_ext_controls {
 #define V4L2_CTRL_CLASS_USER 0x0098/* Old-style 'user' controls */
 #define V4L2_CTRL_CLASS_MPEG 0x0099/* MPEG-compression controls */
 #define V4L2_CTRL_CLASS_CAMERA 0x009a  /* Camera class controls */
+#define V4L2_CTRL_CLASS_FM_TX 0x009b   /* FM Modulator control class */
 
 #define V4L2_CTRL_ID_MASK(0x0fff)
 #define V4L2_CTRL_ID2CLASS(id)((id)  0x0fffUL)
@@ -1156,6 +1157,39 @@ enum  v4l2_exposure_auto_type {
 
 #define V4L2_CID_PRIVACY   (V4L2_CID_CAMERA_CLASS_BASE+16)
 
+/* FM Modulator class control IDs */
+#define V4L2_CID_FM_TX_CLASS_BASE  (V4L2_CTRL_CLASS_FM_TX | 0x900)
+#define V4L2_CID_FM_TX_CLASS   (V4L2_CTRL_CLASS_FM_TX | 1)
+
+#define V4L2_CID_RDS_TX_DEVIATION  (V4L2_CID_FM_TX_CLASS_BASE + 1)
+#define V4L2_CID_RDS_TX_PI (V4L2_CID_FM_TX_CLASS_BASE + 2)
+#define V4L2_CID_RDS_TX_PTY(V4L2_CID_FM_TX_CLASS_BASE + 3)
+#define V4L2_CID_RDS_TX_PS_NAME
(V4L2_CID_FM_TX_CLASS_BASE + 4)
+#define V4L2_CID_RDS_TX_RADIO_TEXT (V4L2_CID_FM_TX_CLASS_BASE + 5)
+
+#define V4L2_CID_AUDIO_LIMITER_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 6)
+#define V4L2_CID_AUDIO_LIMITER_RELEASE_TIME(V4L2_CID_FM_TX_CLASS_BASE + 7)
+#define V4L2_CID_AUDIO_LIMITER_DEVIATION   (V4L2_CID_FM_TX_CLASS_BASE + 8)
+
+#define V4L2_CID_AUDIO_COMPRESSION_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 9)
+#define V4L2_CID_AUDIO_COMPRESSION_GAIN
(V4L2_CID_FM_TX_CLASS_BASE + 10)
+#define V4L2_CID_AUDIO_COMPRESSION_THRESHOLD   (V4L2_CID_FM_TX_CLASS_BASE + 11)
+#define V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME (V4L2_CID_FM_TX_CLASS_BASE + 12)
+#define V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME
(V4L2_CID_FM_TX_CLASS_BASE + 13)
+
+#define V4L2_CID_PILOT_TONE_ENABLED(V4L2_CID_FM_TX_CLASS_BASE + 14)
+#define V4L2_CID_PILOT_TONE_DEVIATION  (V4L2_CID_FM_TX_CLASS_BASE + 15)
+#define V4L2_CID_PILOT_TONE_FREQUENCY  (V4L2_CID_FM_TX_CLASS_BASE + 16)
+
+#define V4L2_CID_FM_TX_PREEMPHASIS (V4L2_CID_FM_TX_CLASS_BASE + 17)
+enum v4l2_preemphasis {
+   V4L2_PREEMPHASIS_DISABLED   = 0,
+   V4L2_PREEMPHASIS_50_uS  = 1,
+   V4L2_PREEMPHASIS_75_uS  = 2,
+};
+#define V4L2_CID_TUNE_POWER_LEVEL  (V4L2_CID_FM_TX_CLASS_BASE + 18)
+#define V4L2_CID_TUNE_ANTENNA_CAPACITOR
(V4L2_CID_FM_TX_CLASS_BASE + 19)
+
 /*
  * T U N I N G
  */
-- 
1.6.2.GIT

--
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


[PATCHv15 3/8] v4l2: video device: Add FM TX controls default configurations

2009-08-08 Thread Eduardo Valentin
This patch adds basic configurations for FM TX extended controls.
That includes controls names, menu strings, pointer identification,
type classification and flags configuration.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/drivers/media/video/v4l2-common.c |   50 +++
 linux/drivers/media/video/v4l2-compat-ioctl32.c |8 +++-
 2 files changed, 57 insertions(+), 1 deletions(-)

diff --git a/linux/drivers/media/video/v4l2-common.c 
b/linux/drivers/media/video/v4l2-common.c
index 870dc20..3e4737e 100644
--- a/linux/drivers/media/video/v4l2-common.c
+++ b/linux/drivers/media/video/v4l2-common.c
@@ -343,6 +343,12 @@ const char **v4l2_ctrl_get_menu(u32 id)
Sepia,
NULL
};
+   static const char *fm_tx_preemphasis[] = {
+   No preemphasis,
+   50 useconds,
+   75 useconds,
+   NULL,
+   };
 
switch (id) {
case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ:
@@ -381,6 +387,8 @@ const char **v4l2_ctrl_get_menu(u32 id)
return camera_exposure_auto;
case V4L2_CID_COLORFX:
return colorfx;
+   case V4L2_CID_FM_TX_PREEMPHASIS:
+   return fm_tx_preemphasis;
default:
return NULL;
}
@@ -479,6 +487,28 @@ const char *v4l2_ctrl_get_name(u32 id)
case V4L2_CID_ZOOM_CONTINUOUS:  return Zoom, Continuous;
case V4L2_CID_PRIVACY:  return Privacy;
 
+   /* FM Radio Modulator control */
+   case V4L2_CID_FM_TX_CLASS:  return FM Radio Modulator 
Controls;
+   case V4L2_CID_RDS_TX_DEVIATION: return RDS Signal Deviation;
+   case V4L2_CID_RDS_TX_PI:return RDS Program ID;
+   case V4L2_CID_RDS_TX_PTY:   return RDS Program Type;
+   case V4L2_CID_RDS_TX_PS_NAME:   return RDS PS Name;
+   case V4L2_CID_RDS_TX_RADIO_TEXT:return RDS Radio Text;
+   case V4L2_CID_AUDIO_LIMITER_ENABLED:return Audio Limiter Feature 
Enabled;
+   case V4L2_CID_AUDIO_LIMITER_RELEASE_TIME: return Audio Limiter Release 
Time;
+   case V4L2_CID_AUDIO_LIMITER_DEVIATION:  return Audio Limiter 
Deviation;
+   case V4L2_CID_AUDIO_COMPRESSION_ENABLED: return Audio Compression 
Feature Enabled;
+   case V4L2_CID_AUDIO_COMPRESSION_GAIN:   return Audio Compression Gain;
+   case V4L2_CID_AUDIO_COMPRESSION_THRESHOLD: return Audio Compression 
Threshold;
+   case V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME: return Audio Compression 
Attack Time;
+   case V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME: return Audio Compression 
Release Time;
+   case V4L2_CID_PILOT_TONE_ENABLED:   return Pilot Tone Feature 
Enabled;
+   case V4L2_CID_PILOT_TONE_DEVIATION: return Pilot Tone Deviation;
+   case V4L2_CID_PILOT_TONE_FREQUENCY: return Pilot Tone Frequency;
+   case V4L2_CID_FM_TX_PREEMPHASIS:return Pre-emphasis settings;
+   case V4L2_CID_TUNE_POWER_LEVEL: return Tune Power Level;
+   case V4L2_CID_TUNE_ANTENNA_CAPACITOR:   return Tune Antenna Capacitor;
+
default:
return NULL;
}
@@ -511,6 +541,9 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 
min, s32 max, s32 ste
case V4L2_CID_EXPOSURE_AUTO_PRIORITY:
case V4L2_CID_FOCUS_AUTO:
case V4L2_CID_PRIVACY:
+   case V4L2_CID_AUDIO_LIMITER_ENABLED:
+   case V4L2_CID_AUDIO_COMPRESSION_ENABLED:
+   case V4L2_CID_PILOT_TONE_ENABLED:
qctrl-type = V4L2_CTRL_TYPE_BOOLEAN;
min = 0;
max = step = 1;
@@ -539,12 +572,18 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, 
s32 min, s32 max, s32 ste
case V4L2_CID_MPEG_STREAM_VBI_FMT:
case V4L2_CID_EXPOSURE_AUTO:
case V4L2_CID_COLORFX:
+   case V4L2_CID_FM_TX_PREEMPHASIS:
qctrl-type = V4L2_CTRL_TYPE_MENU;
step = 1;
break;
+   case V4L2_CID_RDS_TX_PS_NAME:
+   case V4L2_CID_RDS_TX_RADIO_TEXT:
+   qctrl-type = V4L2_CTRL_TYPE_STRING;
+   break;
case V4L2_CID_USER_CLASS:
case V4L2_CID_CAMERA_CLASS:
case V4L2_CID_MPEG_CLASS:
+   case V4L2_CID_FM_TX_CLASS:
qctrl-type = V4L2_CTRL_TYPE_CTRL_CLASS;
qctrl-flags |= V4L2_CTRL_FLAG_READ_ONLY;
min = max = step = def = 0;
@@ -573,6 +612,17 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 
min, s32 max, s32 ste
case V4L2_CID_BLUE_BALANCE:
case V4L2_CID_GAMMA:
case V4L2_CID_SHARPNESS:
+   case V4L2_CID_RDS_TX_DEVIATION:
+   case V4L2_CID_AUDIO_LIMITER_RELEASE_TIME:
+   case V4L2_CID_AUDIO_LIMITER_DEVIATION:
+   case V4L2_CID_AUDIO_COMPRESSION_GAIN:
+   case V4L2_CID_AUDIO_COMPRESSION_THRESHOLD

[PATCHv15 8/8] FM TX: si4713: Add document file

2009-08-08 Thread Eduardo Valentin
This patch adds a document file for si4713 device driver.
It describes the driver interfaces and organization.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/Documentation/video4linux/si4713.txt |  176 
 1 files changed, 176 insertions(+), 0 deletions(-)
 create mode 100644 linux/Documentation/video4linux/si4713.txt

diff --git a/linux/Documentation/video4linux/si4713.txt 
b/linux/Documentation/video4linux/si4713.txt
new file mode 100644
index 000..93ee8b9
--- /dev/null
+++ b/linux/Documentation/video4linux/si4713.txt
@@ -0,0 +1,176 @@
+Driver for I2C radios for the Silicon Labs Si4713 FM Radio Transmitters
+
+Copyright (c) 2009 Nokia Corporation
+Contact: Eduardo Valentin eduardo.valen...@nokia.com
+
+
+Information about the Device
+
+This chip is a Silicon Labs product. It is a I2C device, currently on 0x63 
address.
+Basically, it has transmission and signal noise level measurement features.
+
+The Si4713 integrates transmit functions for FM broadcast stereo transmission.
+The chip also allows integrated receive power scanning to identify low signal
+power FM channels.
+
+The chip is programmed using commands and responses. There are also several
+properties which can change the behavior of this chip.
+
+Users must comply with local regulations on radio frequency (RF) transmission.
+
+Device driver description
+=
+There are two modules to handle this device. One is a I2C device driver
+and the other is a platform driver.
+
+The I2C device driver exports a v4l2-subdev interface to the kernel.
+All properties can also be accessed by v4l2 extended controls interface, by
+using the v4l2-subdev calls (g_ext_ctrls, s_ext_ctrls).
+
+The platform device driver exports a v4l2 radio device interface to user land.
+So, it uses the I2C device driver as a sub device in order to send the user
+commands to the actual device. Basically it is a wrapper to the I2C device 
driver.
+
+Applications can use v4l2 radio API to specify frequency of operation, mute 
state,
+etc. But mostly of its properties will be present in the extended controls.
+
+When the v4l2 mute property is set to 1 (true), the driver will turn the chip 
off.
+
+Properties description
+==
+
+The properties can be accessed using v4l2 extended controls.
+Here is an output from v4l2-ctl util:
+/ # v4l2-ctl -d /dev/radio0 --all -L
+Driver Info:
+Driver name   : radio-si4713
+Card type : Silicon Labs Si4713 Modulator
+Bus info  :
+Driver version: 0
+Capabilities  : 0x00080800
+RDS Output
+Modulator
+Audio output: 0 (FM Modulator Audio Out)
+Frequency: 1408000 (88.00 MHz)
+Video Standard = 0x
+Modulator:
+Name : FM Modulator
+Capabilities : 62.5 Hz stereo rds
+Frequency range  : 76.0 MHz - 108.0 MHz
+Subchannel modulation: stereo+rds
+
+User Controls
+
+   mute (bool) : default=1 value=0
+
+FM Radio Modulator Controls
+
+   rds_signal_deviation (int)  : min=0 max=9 step=10 default=200 
value=200 flags=slider
+ rds_program_id (int)  : min=0 max=65535 step=1 default=0 
value=0
+   rds_program_type (int)  : min=0 max=31 step=1 default=0 value=0
+rds_ps_name (str)  : min=0 max=96 step=8 value='si4713  '
+ rds_radio_text (str)  : min=0 max=384 step=32 value=''
+  audio_limiter_feature_enabled (bool) : default=1 value=1
+ audio_limiter_release_time (int)  : min=250 max=102390 step=50 
default=5010 value=5010 flags=slider
+audio_limiter_deviation (int)  : min=0 max=9 step=10 default=66250 
value=66250 flags=slider
+audio_compression_feature_enabl (bool) : default=1 value=1
+ audio_compression_gain (int)  : min=0 max=20 step=1 default=15 
value=15 flags=slider
+audio_compression_threshold (int)  : min=-40 max=0 step=1 default=-40 
value=-40 flags=slider
+  audio_compression_attack_time (int)  : min=0 max=5000 step=500 default=0 
value=0 flags=slider
+ audio_compression_release_time (int)  : min=10 max=100 step=10 
default=100 value=100 flags=slider
+ pilot_tone_feature_enabled (bool) : default=1 value=1
+   pilot_tone_deviation (int)  : min=0 max=9 step=10 default=6750 
value=6750 flags=slider
+   pilot_tone_frequency (int)  : min=0 max=19000 step=1 default=19000 
value=19000 flags=slider
+  pre_emphasis_settings (menu) : min=0 max=2 default=1 value=1
+   tune_power_level (int)  : min=0 max=120 step=1 default=88 
value=88 flags=slider
+ tune_antenna_capacitor (int)  : min=0 max=191 step=1 default=0 
value=110 flags=slider
+/ #
+
+Here is a summary of them:
+
+* Pilot is an audible tone sent by the device.
+
+pilot_frequency - Configures the frequency of the stereo pilot tone.
+pilot_deviation

[PATCHv15 4/8] v4l2-spec: Add documentation description for FM TX extended control class

2009-08-08 Thread Eduardo Valentin
This single patch adds documentation description for FM Modulator (FM TX)
Extended Control Class and its Control IDs. The text was added under
Extended Controls section. The vidioc-g-ext-ctrls.sgml file was
updated as well.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 v4l2-spec/Makefile|1 +
 v4l2-spec/controls.sgml   |  215 +
 v4l2-spec/vidioc-g-ext-ctrls.sgml |7 ++
 3 files changed, 223 insertions(+), 0 deletions(-)

diff --git a/v4l2-spec/Makefile b/v4l2-spec/Makefile
index 4f11745..7a8d161 100644
--- a/v4l2-spec/Makefile
+++ b/v4l2-spec/Makefile
@@ -243,6 +243,7 @@ ENUMS = \
v4l2_power_line_frequency \
v4l2_priority \
v4l2_tuner_type \
+   v4l2_preemphasis \
 
 STRUCTS = \
v4l2_audio \
diff --git a/v4l2-spec/controls.sgml b/v4l2-spec/controls.sgml
index 8e0e024..1e45b4b 100644
--- a/v4l2-spec/controls.sgml
+++ b/v4l2-spec/controls.sgml
@@ -458,6 +458,12 @@ video is actually encoded into that format./para
   paraUnfortunately, the original control API lacked some
 features needed for these new uses and so it was extended into the
 (not terribly originally named) extended control API./para
+
+  paraEven though the MPEG encoding API was the first effort
+to use the Extended Control API, nowadays there are also other classes
+of Extended Controls, such as Camera Controls and FM Transmitter Controls.
+The Extended Controls API as well as all Extended Controls classes are
+described in the following text./para
 /section
 
 section
@@ -1815,6 +1821,215 @@ control must support read access and may support write 
access./entry
   /tgroup
 /table
   /section
+
+section id=fm-tx-controls
+  titleFM Transmitter Control Reference/title
+
+  paraThe FM Transmitter (FM_TX) class includes controls for common 
features of
+FM transmissions capable devices. Currently this class includes parameters for 
audio
+compression, pilot tone generation, audio deviation limiter, RDS transmission 
and
+tuning power features./para
+
+  table pgwide=1 frame=none id=fm-tx-control-id
+  titleFM_TX Control IDs/title
+
+  tgroup cols=4
+   colspec colname=c1 colwidth=1*
+   colspec colname=c2 colwidth=6*
+   colspec colname=c3 colwidth=2*
+   colspec colname=c4 colwidth=6*
+   spanspec namest=c1 nameend=c2 spanname=id
+   spanspec namest=c2 nameend=c4 spanname=descr
+   thead
+ row
+   entry spanname=id align=leftID/entry
+   entry align=leftType/entry
+ /rowrow rowsep=1entry spanname=descr 
align=leftDescription/entry
+ /row
+   /thead
+   tbody valign=top
+ rowentry/entry/row
+ row
+   entry 
spanname=idconstantV4L2_CID_FM_TX_CLASS/constantnbsp;/entry
+   entryclass/entry
+ /rowrowentry spanname=descrThe FM_TX class
+descriptor. Calling VIDIOC-QUERYCTRL; for this control will return a
+description of this control class./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_DEVIATION/constantnbsp;/entry
+   entryinteger/entry
+ /row
+ rowentry spanname=descrConfigures RDS signal frequency 
deviation level in Hz.
+The range and step are driver-specific./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_PI/constantnbsp;/entry
+   entryinteger/entry
+ /row
+ rowentry spanname=descrSets the RDS Programme Identification 
field
+for transmission./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_PTY/constantnbsp;/entry
+   entryinteger/entry
+ /row
+ rowentry spanname=descrSets the RDS Programme Type field for 
transmission.
+This encodes up to 31 pre-defined programme types./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_PS_NAME/constantnbsp;/entry
+   entrystring/entry
+ /row
+ rowentry spanname=descrSets the Programme Service name 
(PS_NAME) for transmission.
+It is intended for static display on a receiver. It is the primary aid to 
listeners in programme service
+identification and selection.  In Annex E of xref linkend=en50067, the RDS 
specification,
+there is a full description of the correct character encoding for Programme 
Service name strings.
+Also from RDS specification, PS is usually a single eight character text. 
However, it is also possible
+to find receivers which can scroll strings sized as 8 x N characters. So, this 
control must be configured
+with steps of 8 characters. The result is it must always contain a string with 
size multiple of 8./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_RADIO_TEXT/constantnbsp;/entry
+   entrystring/entry
+ /row
+ rowentry spanname=descrSets the Radio Text info for 
transmission

[PATCHv15 5/8] FM TX: si4713: Add files to add radio interface for si4713

2009-08-08 Thread Eduardo Valentin
This patch adds files which creates the radio interface
for si4713 FM transmitter (modulator) devices.

In order to do the real access to device registers, this
driver uses the v4l2 subdev interface exported by si4713 i2c driver.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/drivers/media/radio/radio-si4713.c |  367 ++
 linux/include/media/radio-si4713.h   |   30 +++
 2 files changed, 397 insertions(+), 0 deletions(-)
 create mode 100644 linux/drivers/media/radio/radio-si4713.c
 create mode 100644 linux/include/media/radio-si4713.h

diff --git a/linux/drivers/media/radio/radio-si4713.c 
b/linux/drivers/media/radio/radio-si4713.c
new file mode 100644
index 000..6bc22cd
--- /dev/null
+++ b/linux/drivers/media/radio/radio-si4713.c
@@ -0,0 +1,367 @@
+/*
+ * drivers/media/radio/radio-si4713.c
+ *
+ * Platform Driver for Silicon Labs Si4713 FM Radio Transmitter:
+ *
+ * Copyright (c) 2008 Instituto Nokia de Tecnologia - INdT
+ * Contact: Eduardo Valentin eduardo.valen...@nokia.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include linux/kernel.h
+#include linux/module.h
+#include linux/init.h
+#include linux/version.h
+#include linux/platform_device.h
+#include linux/i2c.h
+#include linux/videodev2.h
+#include media/v4l2-device.h
+#include media/v4l2-common.h
+#include media/v4l2-ioctl.h
+#include media/radio-si4713.h
+
+/* module parameters */
+static int radio_nr = -1;  /* radio device minor (-1 == auto assign) */
+module_param(radio_nr, int, 0);
+MODULE_PARM_DESC(radio_nr,
+Minor number for radio device (-1 == auto assign));
+
+MODULE_LICENSE(GPL);
+MODULE_AUTHOR(Eduardo Valentin eduardo.valen...@nokia.com);
+MODULE_DESCRIPTION(Platform driver for Si4713 FM Radio Transmitter);
+MODULE_VERSION(0.0.1);
+
+/* Driver state struct */
+struct radio_si4713_device {
+   struct v4l2_device  v4l2_dev;
+   struct video_device *radio_dev;
+};
+
+/* radio_si4713_fops - file operations interface */
+static const struct v4l2_file_operations radio_si4713_fops = {
+   .owner  = THIS_MODULE,
+   .ioctl  = video_ioctl2,
+};
+
+/* Video4Linux Interface */
+static int radio_si4713_fill_audout(struct v4l2_audioout *vao)
+{
+   /* TODO: check presence of audio output */
+   strlcpy(vao-name, FM Modulator Audio Out, 32);
+
+   return 0;
+}
+
+static int radio_si4713_enumaudout(struct file *file, void *priv,
+   struct v4l2_audioout *vao)
+{
+   return radio_si4713_fill_audout(vao);
+}
+
+static int radio_si4713_g_audout(struct file *file, void *priv,
+   struct v4l2_audioout *vao)
+{
+   int rval = radio_si4713_fill_audout(vao);
+
+   vao-index = 0;
+
+   return rval;
+}
+
+static int radio_si4713_s_audout(struct file *file, void *priv,
+   struct v4l2_audioout *vao)
+{
+   return vao-index ? -EINVAL : 0;
+}
+
+/* radio_si4713_querycap - query device capabilities */
+static int radio_si4713_querycap(struct file *file, void *priv,
+   struct v4l2_capability *capability)
+{
+   struct radio_si4713_device *rsdev;
+
+   rsdev = video_get_drvdata(video_devdata(file));
+
+   strlcpy(capability-driver, radio-si4713, sizeof(capability-driver));
+   strlcpy(capability-card, Silicon Labs Si4713 Modulator,
+   sizeof(capability-card));
+   capability-capabilities = V4L2_CAP_MODULATOR | V4L2_CAP_RDS_OUTPUT;
+
+   return 0;
+}
+
+/* radio_si4713_queryctrl - enumerate control items */
+static int radio_si4713_queryctrl(struct file *file, void *priv,
+   struct v4l2_queryctrl *qc)
+{
+   /* Must be sorted from low to high control ID! */
+   static const u32 user_ctrls[] = {
+   V4L2_CID_USER_CLASS,
+   V4L2_CID_AUDIO_MUTE,
+   0
+   };
+
+   /* Must be sorted from low to high control ID! */
+   static const u32 fmtx_ctrls[] = {
+   V4L2_CID_FM_TX_CLASS,
+   V4L2_CID_RDS_TX_DEVIATION,
+   V4L2_CID_RDS_TX_PI,
+   V4L2_CID_RDS_TX_PTY

[PATCHv12 1/8] v4l2-subdev.h: Add g_modulator callbacks to subdev api

2009-07-27 Thread Eduardo Valentin
Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/include/media/v4l2-subdev.h |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/linux/include/media/v4l2-subdev.h 
b/linux/include/media/v4l2-subdev.h
index 89a39ce..d411345 100644
--- a/linux/include/media/v4l2-subdev.h
+++ b/linux/include/media/v4l2-subdev.h
@@ -137,6 +137,8 @@ struct v4l2_subdev_tuner_ops {
int (*g_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq);
int (*g_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
int (*s_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
+   int (*g_modulator)(struct v4l2_subdev *sd, struct v4l2_modulator *vm);
+   int (*s_modulator)(struct v4l2_subdev *sd, struct v4l2_modulator *vm);
int (*s_type_addr)(struct v4l2_subdev *sd, struct tuner_setup *type);
int (*s_config)(struct v4l2_subdev *sd, const struct 
v4l2_priv_tun_config *config);
int (*s_standby)(struct v4l2_subdev *sd);
-- 
1.6.2.GIT

--
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


[PATCHv12 2/8] v4l2: video device: Add V4L2_CTRL_CLASS_FM_TX controls

2009-07-27 Thread Eduardo Valentin
This patch adds a new class of extended controls. This class
is intended to support FM Radio Modulators properties such as:
rds, audio limiters, audio compression, pilot tone generation,
tuning power levels and preemphasis properties.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/include/linux/videodev2.h |   34 ++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h
index b17898c..c58d453 100644
--- a/linux/include/linux/videodev2.h
+++ b/linux/include/linux/videodev2.h
@@ -817,6 +817,7 @@ struct v4l2_ext_controls {
 #define V4L2_CTRL_CLASS_USER 0x0098/* Old-style 'user' controls */
 #define V4L2_CTRL_CLASS_MPEG 0x0099/* MPEG-compression controls */
 #define V4L2_CTRL_CLASS_CAMERA 0x009a  /* Camera class controls */
+#define V4L2_CTRL_CLASS_FM_TX 0x009b   /* FM Modulator control class */
 
 #define V4L2_CTRL_ID_MASK(0x0fff)
 #define V4L2_CTRL_ID2CLASS(id)((id)  0x0fffUL)
@@ -1156,6 +1157,39 @@ enum  v4l2_exposure_auto_type {
 
 #define V4L2_CID_PRIVACY   (V4L2_CID_CAMERA_CLASS_BASE+16)
 
+/* FM Modulator class control IDs */
+#define V4L2_CID_FM_TX_CLASS_BASE  (V4L2_CTRL_CLASS_FM_TX | 0x900)
+#define V4L2_CID_FM_TX_CLASS   (V4L2_CTRL_CLASS_FM_TX | 1)
+
+#define V4L2_CID_RDS_TX_PI (V4L2_CID_FM_TX_CLASS_BASE + 1)
+#define V4L2_CID_RDS_TX_PTY(V4L2_CID_FM_TX_CLASS_BASE + 2)
+#define V4L2_CID_RDS_TX_DEVIATION  (V4L2_CID_FM_TX_CLASS_BASE + 3)
+#define V4L2_CID_RDS_TX_PS_NAME
(V4L2_CID_FM_TX_CLASS_BASE + 4)
+#define V4L2_CID_RDS_TX_RADIO_TEXT (V4L2_CID_FM_TX_CLASS_BASE + 5)
+
+#define V4L2_CID_AUDIO_LIMITER_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 6)
+#define V4L2_CID_AUDIO_LIMITER_RELEASE_TIME(V4L2_CID_FM_TX_CLASS_BASE + 7)
+#define V4L2_CID_AUDIO_LIMITER_DEVIATION   (V4L2_CID_FM_TX_CLASS_BASE + 8)
+
+#define V4L2_CID_AUDIO_COMPRESSION_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 9)
+#define V4L2_CID_AUDIO_COMPRESSION_GAIN
(V4L2_CID_FM_TX_CLASS_BASE + 10)
+#define V4L2_CID_AUDIO_COMPRESSION_THRESHOLD   (V4L2_CID_FM_TX_CLASS_BASE + 11)
+#define V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME (V4L2_CID_FM_TX_CLASS_BASE + 12)
+#define V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME
(V4L2_CID_FM_TX_CLASS_BASE + 13)
+
+#define V4L2_CID_PILOT_TONE_ENABLED(V4L2_CID_FM_TX_CLASS_BASE + 14)
+#define V4L2_CID_PILOT_TONE_DEVIATION  (V4L2_CID_FM_TX_CLASS_BASE + 15)
+#define V4L2_CID_PILOT_TONE_FREQUENCY  (V4L2_CID_FM_TX_CLASS_BASE + 16)
+
+#define V4L2_CID_FM_TX_PREEMPHASIS (V4L2_CID_FM_TX_CLASS_BASE + 17)
+enum v4l2_preemphasis {
+   V4L2_PREEMPHASIS_DISABLED   = 0,
+   V4L2_PREEMPHASIS_50_uS  = 1,
+   V4L2_PREEMPHASIS_75_uS  = 2,
+};
+#define V4L2_CID_TUNE_POWER_LEVEL  (V4L2_CID_FM_TX_CLASS_BASE + 18)
+#define V4L2_CID_TUNE_ANTENNA_CAPACITOR
(V4L2_CID_FM_TX_CLASS_BASE + 19)
+
 /*
  * T U N I N G
  */
-- 
1.6.2.GIT

--
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


[PATCHv12 7/8] FM TX: si4713: Add Kconfig and Makefile entries

2009-07-27 Thread Eduardo Valentin
Simple add Makefile and Kconfig entries.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/drivers/media/radio/Kconfig  |   22 ++
 linux/drivers/media/radio/Makefile |2 ++
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/linux/drivers/media/radio/Kconfig 
b/linux/drivers/media/radio/Kconfig
index 3315cac..6c6a409 100644
--- a/linux/drivers/media/radio/Kconfig
+++ b/linux/drivers/media/radio/Kconfig
@@ -339,6 +339,28 @@ config RADIO_ZOLTRIX_PORT
help
  Enter the I/O port of your Zoltrix radio card.
 
+config I2C_SI4713
+   tristate I2C driver for Silicon Labs Si4713 device
+   depends on I2C  VIDEO_V4L2
+   ---help---
+ Say Y here if you want support to Si4713 I2C device.
+ This device driver supports only i2c bus.
+
+ To compile this driver as a module, choose M here: the
+ module will be called si4713.
+
+config RADIO_SI4713
+   tristate Silicon Labs Si4713 FM Radio Transmitter support
+   depends on I2C  VIDEO_V4L2
+   ---help---
+ Say Y here if you want support to Si4713 FM Radio Transmitter.
+ This device can transmit audio through FM. It can transmit
+ EDS and EBDS signals as well. This module is the v4l2 radio
+ interface for the i2c driver of this device.
+
+ To compile this driver as a module, choose M here: the
+ module will be called radio-si4713.
+
 config USB_DSBR
tristate D-Link/GemTek USB FM radio support
depends on USB  VIDEO_V4L2
diff --git a/linux/drivers/media/radio/Makefile 
b/linux/drivers/media/radio/Makefile
index 0f2b35b..34ae761 100644
--- a/linux/drivers/media/radio/Makefile
+++ b/linux/drivers/media/radio/Makefile
@@ -15,6 +15,8 @@ obj-$(CONFIG_RADIO_ZOLTRIX) += radio-zoltrix.o
 obj-$(CONFIG_RADIO_GEMTEK) += radio-gemtek.o
 obj-$(CONFIG_RADIO_GEMTEK_PCI) += radio-gemtek-pci.o
 obj-$(CONFIG_RADIO_TRUST) += radio-trust.o
+obj-$(CONFIG_I2C_SI4713) += si4713-i2c.o
+obj-$(CONFIG_RADIO_SI4713) += radio-si4713.o
 obj-$(CONFIG_RADIO_MAESTRO) += radio-maestro.o
 obj-$(CONFIG_USB_DSBR) += dsbr100.o
 obj-$(CONFIG_USB_SI470X) += radio-si470x.o
-- 
1.6.2.GIT

--
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


[PATCHv13 1/8] v4l2-subdev.h: Add g_modulator callbacks to subdev api

2009-07-27 Thread Eduardo Valentin
Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/include/media/v4l2-subdev.h |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/linux/include/media/v4l2-subdev.h 
b/linux/include/media/v4l2-subdev.h
index 89a39ce..d411345 100644
--- a/linux/include/media/v4l2-subdev.h
+++ b/linux/include/media/v4l2-subdev.h
@@ -137,6 +137,8 @@ struct v4l2_subdev_tuner_ops {
int (*g_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq);
int (*g_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
int (*s_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
+   int (*g_modulator)(struct v4l2_subdev *sd, struct v4l2_modulator *vm);
+   int (*s_modulator)(struct v4l2_subdev *sd, struct v4l2_modulator *vm);
int (*s_type_addr)(struct v4l2_subdev *sd, struct tuner_setup *type);
int (*s_config)(struct v4l2_subdev *sd, const struct 
v4l2_priv_tun_config *config);
int (*s_standby)(struct v4l2_subdev *sd);
-- 
1.6.2.GIT

--
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


[PATCHv14 8/8] FM TX: si4713: Add document file

2009-07-27 Thread Eduardo Valentin
This patch adds a document file for si4713 device driver.
It describes the driver interfaces and organization.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/Documentation/video4linux/si4713.txt |  176 
 1 files changed, 176 insertions(+), 0 deletions(-)
 create mode 100644 linux/Documentation/video4linux/si4713.txt

diff --git a/linux/Documentation/video4linux/si4713.txt 
b/linux/Documentation/video4linux/si4713.txt
new file mode 100644
index 000..68e3b0b
--- /dev/null
+++ b/linux/Documentation/video4linux/si4713.txt
@@ -0,0 +1,176 @@
+Driver for I2C radios for the Silicon Labs Si4713 FM Radio Transmitters
+
+Copyright (c) 2009 Nokia Corporation
+Contact: Eduardo Valentin eduardo.valen...@nokia.com
+
+
+Information about the Device
+
+This chip is a Silicon Labs product. It is a I2C device, currently on 0x63 
address.
+Basically, it has transmission and signal noise level measurement features.
+
+The Si4713 integrates transmit functions for FM broadcast stereo transmission.
+The chip also allows integrated receive power scanning to identify low signal
+power FM channels.
+
+The chip is programmed using commands and responses. There are also several
+properties which can change the behavior of this chip.
+
+Users must comply with local regulations on radio frequency (RF) transmission.
+
+Device driver description
+=
+There are two modules to handle this device. One is a I2C device driver
+and the other is a platform driver.
+
+The I2C device driver exports a v4l2-subdev interface to the kernel.
+All properties can also be accessed by v4l2 extended controls interface, by
+using the v4l2-subdev calls (g_ext_ctrls, s_ext_ctrls).
+
+The platform device driver exports a v4l2 radio device interface to user land.
+So, it uses the I2C device driver as a sub device in order to send the user
+commands to the actual device. Basically it is a wrapper to the I2C device 
driver.
+
+Applications can use v4l2 radio API to specify frequency of operation, mute 
state,
+etc. But mostly of its properties will be present in the extended controls.
+
+When the v4l2 mute property is set to 1 (true), the driver will turn the chip 
off.
+
+Properties description
+==
+
+The properties can be accessed using v4l2 extended controls.
+Here is an output from v4l2-ctl util:
+/ # v4l2-ctl -d /dev/radio0 --all -L
+Driver Info:
+Driver name   : radio-si4713
+Card type : Silicon Labs Si4713 Modulator
+Bus info  :
+Driver version: 0
+Capabilities  : 0x00080800
+RDS Output
+Modulator
+Audio output: 0 (FM Modulator Audio Out)
+Frequency: 1408000 (88.00 MHz)
+Video Standard = 0x
+Modulator:
+Name : FM Modulator
+Capabilities : 62.5 Hz stereo rds
+Frequency range  : 76.0 MHz - 108.0 MHz
+Subchannel modulation: stereo+rds
+
+User Controls
+
+   mute (bool) : default=1 value=0
+
+FM Radio Modulator Controls
+
+ rds_program_id (int)  : min=0 max=65535 step=1 default=0 
value=0
+   rds_program_type (int)  : min=0 max=31 step=1 default=0 value=0
+   rds_signal_deviation (int)  : min=0 max=9 step=10 default=200 
value=200 flags=slider
+rds_ps_name (str)  : min=0 max=96 step=8 value='si4713  '
+ rds_radio_text (str)  : min=0 max=384 step=32 value=''
+  audio_limiter_feature_enabled (bool) : default=1 value=1
+ audio_limiter_release_time (int)  : min=250 max=102390 step=50 
default=5010 value=5010 flags=slider
+audio_limiter_deviation (int)  : min=0 max=9 step=10 default=66250 
value=66250 flags=slider
+audio_compression_feature_enabl (bool) : default=1 value=1
+ audio_compression_gain (int)  : min=0 max=20 step=1 default=15 
value=15 flags=slider
+audio_compression_threshold (int)  : min=-40 max=0 step=1 default=-40 
value=-40 flags=slider
+  audio_compression_attack_time (int)  : min=0 max=5000 step=500 default=0 
value=0 flags=slider
+ audio_compression_release_time (int)  : min=10 max=100 step=10 
default=100 value=100 flags=slider
+ pilot_tone_feature_enabled (bool) : default=1 value=1
+   pilot_tone_deviation (int)  : min=0 max=9 step=10 default=6750 
value=6750 flags=slider
+   pilot_tone_frequency (int)  : min=0 max=19000 step=1 default=19000 
value=19000 flags=slider
+  pre_emphasis_settings (menu) : min=0 max=2 default=1 value=1
+   tune_power_level (int)  : min=0 max=120 step=1 default=88 
value=88 flags=slider
+ tune_antenna_capacitor (int)  : min=0 max=191 step=1 default=0 
value=74 flags=slider
+/ #
+
+Here is a summary of them:
+
+* Pilot is an audible tone sent by the device.
+
+pilot_frequency - Configures the frequency of the stereo pilot tone.
+pilot_deviation

[PATCHv14 4/8] v4l2-spec: Add documentation description for FM TX extended control class

2009-07-27 Thread Eduardo Valentin
This single patch adds documentation description for FM Modulator (FM TX)
Extended Control Class and its Control IDs. The text was added under
Extended Controls section.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 v4l2-spec/Makefile  |1 +
 v4l2-spec/controls.sgml |  215 +++
 2 files changed, 216 insertions(+), 0 deletions(-)

diff --git a/v4l2-spec/Makefile b/v4l2-spec/Makefile
index 4f11745..7a8d161 100644
--- a/v4l2-spec/Makefile
+++ b/v4l2-spec/Makefile
@@ -243,6 +243,7 @@ ENUMS = \
v4l2_power_line_frequency \
v4l2_priority \
v4l2_tuner_type \
+   v4l2_preemphasis \
 
 STRUCTS = \
v4l2_audio \
diff --git a/v4l2-spec/controls.sgml b/v4l2-spec/controls.sgml
index 8e0e024..502f84d 100644
--- a/v4l2-spec/controls.sgml
+++ b/v4l2-spec/controls.sgml
@@ -458,6 +458,12 @@ video is actually encoded into that format./para
   paraUnfortunately, the original control API lacked some
 features needed for these new uses and so it was extended into the
 (not terribly originally named) extended control API./para
+
+  paraEven though the MPEG encoding API was the first effort
+to use the Extended Control API, nowadays there are also other classes
+of Extended Controls, such as Camera Controls and FM Transmitter Controls.
+The Extended Controls API as well as all Extended Controls classes are
+described in the following text./para
 /section
 
 section
@@ -1815,6 +1821,215 @@ control must support read access and may support write 
access./entry
   /tgroup
 /table
   /section
+
+section id=fm-tx-controls
+  titleFM Transmitter Control Reference/title
+
+  paraThe FM Transmitter (FM_TX) class includes controls for common 
features of
+FM transmissions capable devices. Currently this class includes parameters for 
audio
+compression, pilot tone generation, audio deviation limiter, RDS transmission 
and
+tuning power features./para
+
+  table pgwide=1 frame=none id=fm-tx-control-id
+  titleFM_TX Control IDs/title
+
+  tgroup cols=4
+   colspec colname=c1 colwidth=1*
+   colspec colname=c2 colwidth=6*
+   colspec colname=c3 colwidth=2*
+   colspec colname=c4 colwidth=6*
+   spanspec namest=c1 nameend=c2 spanname=id
+   spanspec namest=c2 nameend=c4 spanname=descr
+   thead
+ row
+   entry spanname=id align=leftID/entry
+   entry align=leftType/entry
+ /rowrow rowsep=1entry spanname=descr 
align=leftDescription/entry
+ /row
+   /thead
+   tbody valign=top
+ rowentry/entry/row
+ row
+   entry 
spanname=idconstantV4L2_CID_FM_TX_CLASS/constantnbsp;/entry
+   entryclass/entry
+ /rowrowentry spanname=descrThe FM_TX class
+descriptor. Calling VIDIOC-QUERYCTRL; for this control will return a
+description of this control class./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_PI/constantnbsp;/entry
+   entryinteger/entry
+ /row
+ rowentry spanname=descrSets the RDS Programme Identification 
field
+for transmission./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_PTY/constantnbsp;/entry
+   entryinteger/entry
+ /row
+ rowentry spanname=descrSets the RDS Programme Type field for 
transmission.
+This encodes up to 31 pre-defined programme types./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_DEVIATION/constantnbsp;/entry
+   entryinteger/entry
+ /row
+ rowentry spanname=descrConfigures RDS signal frequency 
deviation level in Hz.
+The range and step are driver-specific./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_PS_NAME/constantnbsp;/entry
+   entrystring/entry
+ /row
+ rowentry spanname=descrSets the Programme Service name 
(PS_NAME) for transmission.
+It is intended for static display on a receiver. It is the primary aid to 
listeners in programme service
+identification and selection.  In Annex E of xref linkend=en50067, the RDS 
specification,
+there is a full description of the correct character encoding for Programme 
Service name strings.
+Also from RDS specification, PS is usually a single eight character text. 
However, it is also possible
+to find receivers which can scroll strings sized as 8 x N characters. So, this 
control must be configured
+with steps of 8 characters. The result is it must always contain a string with 
size multiple of 8./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_RADIO_TEXT/constantnbsp;/entry
+   entrystring/entry
+ /row
+ rowentry spanname=descrSets the Radio Text info for 
transmission. It is a textual description of
+what is being broadcasted. RDS Radio Text can be applied when broadcaster 
wishes

Re: [PATCHv10 3/8] v4l2: video device: Add FM_TX controls default configurations

2009-07-25 Thread Eduardo Valentin
On Sat, Jul 25, 2009 at 03:03:33PM +0200, ext Hans Verkuil wrote:
 On Friday 24 July 2009 18:37:23 Eduardo Valentin wrote:
  Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
  ---
   linux/drivers/media/video/v4l2-common.c |   63 
  ++-
   1 files changed, 62 insertions(+), 1 deletions(-)
  
  diff --git a/linux/drivers/media/video/v4l2-common.c 
  b/linux/drivers/media/video/v4l2-common.c
  index bd13702..6fc0559 100644
  --- a/linux/drivers/media/video/v4l2-common.c
  +++ b/linux/drivers/media/video/v4l2-common.c
  @@ -343,6 +343,12 @@ const char **v4l2_ctrl_get_menu(u32 id)
  Sepia,
  NULL
  };
  +   static const char *fm_tx_preemphasis[] = {
  +   No preemphasis,
  +   50 useconds,
  +   75 useconds,
  +   NULL,
  +   };
   
  switch (id) {
  case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ:
  @@ -381,6 +387,8 @@ const char **v4l2_ctrl_get_menu(u32 id)
  return camera_exposure_auto;
  case V4L2_CID_COLORFX:
  return colorfx;
  +   case V4L2_CID_FM_TX_PREEMPHASIS:
  +   return fm_tx_preemphasis;
  default:
  return NULL;
  }
  @@ -479,6 +487,28 @@ const char *v4l2_ctrl_get_name(u32 id)
  case V4L2_CID_ZOOM_CONTINUOUS:  return Zoom, Continuous;
  case V4L2_CID_PRIVACY:  return Privacy;
   
  +   /* FM Radio Modulator control */
  +   case V4L2_CID_FM_TX_CLASS:  return FM Radio Modulator 
  Controls;
  +   case V4L2_CID_RDS_TX_PI:return RDS Program ID;
  +   case V4L2_CID_RDS_TX_PTY:   return RDS Program Type;
  +   case V4L2_CID_RDS_TX_DEVIATION: return RDS Signal Deviation;
  +   case V4L2_CID_RDS_TX_PS_NAME:   return RDS PS Name;
  +   case V4L2_CID_RDS_TX_RADIO_TEXT:return RDS Radio Text;
  +   case V4L2_CID_AUDIO_LIMITER_ENABLED:return Audio Limiter Feature 
  Enabled;
  +   case V4L2_CID_AUDIO_LIMITER_RELEASE_TIME: return Audio Limiter Release 
  Time;
  +   case V4L2_CID_AUDIO_LIMITER_DEVIATION:  return Audio Limiter 
  Deviation;
  +   case V4L2_CID_AUDIO_COMPRESSION_ENABLED: return Audio Compression 
  Feature Enabled;
  +   case V4L2_CID_AUDIO_COMPRESSION_GAIN:   return Audio Compression Gain;
  +   case V4L2_CID_AUDIO_COMPRESSION_THRESHOLD: return Audio Compression 
  Threshold;
  +   case V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME: return Audio Compression 
  Attack Time;
  +   case V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME: return Audio Compression 
  Release Time;
  +   case V4L2_CID_PILOT_TONE_ENABLED:   return Pilot Tone Feature 
  Enabled;
  +   case V4L2_CID_PILOT_TONE_DEVIATION: return Pilot Tone Deviation;
  +   case V4L2_CID_PILOT_TONE_FREQUENCY: return Pilot Tone Frequency;
  +   case V4L2_CID_FM_TX_PREEMPHASIS:return Pre-emphasis settings;
  +   case V4L2_CID_TUNE_POWER_LEVEL: return Tune Power Level;
  +   case V4L2_CID_TUNE_ANTENNA_CAPACITOR:   return Tune Antenna Capacitor;
  +
  default:
  return NULL;
  }
  @@ -500,7 +530,18 @@ EXPORT_SYMBOL(v4l2_ctrl_is_value64);
* This information is used inside v4l2_compat_ioctl32. */
   int v4l2_ctrl_is_pointer(u32 id)
   {
  -   return 0;
  +   int is_pointer;
  +
  +   switch (id) {
  +   case V4L2_CID_RDS_TX_PS_NAME:
  +   case V4L2_CID_RDS_TX_RADIO_TEXT:
  +   is_pointer = 1;
  +   break;
  +   default:
  +   is_pointer = 0;
  +   }
  +
  +   return is_pointer;
   }
 
 There is no need for a temp variable. Just do this:
 
 int v4l2_ctrl_is_pointer(u32 id)
 {
   switch (id) {
   case V4L2_CID_RDS_TX_PS_NAME:
   case V4L2_CID_RDS_TX_RADIO_TEXT:
   return 1;
   default:
   return 0;
   }
 }
 
 Regards,
 
   Hans


Right, resending v11 with this minor change.

 
 
 -- 
 Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom

-- 
Eduardo Valentin
--
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


Re: [PATCHv10 6/8] FMTx: si4713: Add files to handle si4713 i2c device

2009-07-25 Thread Eduardo Valentin
On Sat, Jul 25, 2009 at 03:31:29PM +0200, ext Hans Verkuil wrote:
 On Saturday 25 July 2009 15:15:24 Eduardo Valentin wrote:
  On Sat, Jul 25, 2009 at 03:20:53PM +0200, ext Hans Verkuil wrote:
+ switch (control-id) {
+ case V4L2_CID_RDS_TX_PS_NAME:
+ if (strlen(sdev-rds_info.ps_name) + 1  control-length) 
{
+ control-length = strlen(sdev-rds_info.ps_name) 
+ 1;
   
   I recommend setting length to the actual maximum MAX_RDS_PS_NAME+1.
   
+ rval = -ENOSPC;
+ goto exit;
+ }
+ rval = copy_to_user(control-string, 
sdev-rds_info.ps_name,
+ strlen(sdev-rds_info.ps_name) + 
1);
+ break;
+
+ case V4L2_CID_RDS_TX_RADIO_TEXT:
+ if (strlen(sdev-rds_info.radio_text) + 1  
control-length) {
+ control-length = 
strlen(sdev-rds_info.radio_text) + 1;
   
   Ditto.
  
  Right, I think doing the way you are proposing is to avoid changes that may 
  generate
  failures in the following reads.
  
  I 'll change this in the v11 as well.
 
 OK.
 
+struct rds_info {
+ u32 pi;
+#define MAX_RDS_PTY  31
+ u32 pty;
+#define MAX_RDS_DEVIATION9
+ u32 deviation;
+#define MAX_RDS_PS_NAME  96
+ u8 ps_name[MAX_RDS_PS_NAME + 1];
+#define MAX_RDS_RADIO_TEXT   384
   
   I'm surprised at these MAX string lengths. Looking at the RDS standard it
   seems that the max length for the PS_NAME is 8 and for RADIO_TEXT it is
   either 32 (2A group) or 64 (2B group). I don't know which group the si4713
   uses.
   
   Can you clarify how this is used?
 
 Did you see this comment as well? I'm quite interested in this.

I missed this one. But is basically what Eero said. Receivers scroll it with 8xn
sized PS names.

 
   Hans
 
 -- 
 Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom

-- 
Eduardo Valentin
--
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


Re: [PATCHv10 6/8] FMTx: si4713: Add files to handle si4713 i2c device

2009-07-25 Thread Eduardo Valentin
On Sat, Jul 25, 2009 at 03:33:55PM +0200, ext Hans Verkuil wrote:
 On Saturday 25 July 2009 15:29:38 ext-eero.nurkk...@nokia.com wrote:
  
   I'm surprised at these MAX string lengths. Looking at the RDS standard it
   seems that the max length for the PS_NAME is 8 and for RADIO_TEXT it is
   either 32 (2A group) or 64 (2B group). I don't know which group the si4713
   uses.
   
   Can you clarify how this is used?
   
   Regards,
   
   Hans
  
  Well, PS_NAME can be 8 x n, but only 8 bytes are shown at once...
  so it keeps 'scrolling', or changes periodically. There's even commercial
  radio stations that do so.
 
 And I'm assuming that the same is true for radio text. However, this behavior
 contradicts the control description in the spec, so that should be clarified.

Yes, I'll add a comment explaining this for those defines.

 
 Regards,
 
   Hans
 
 -- 
 Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom

-- 
Eduardo Valentin
--
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


Re: [PATCH 1/1] v4l2-ctl: Add G_MODULATOR before set/get frequency

2009-07-25 Thread Eduardo Valentin
On Sat, Jul 25, 2009 at 04:10:53PM +0200, ext Hans Verkuil wrote:
 On Friday 24 July 2009 18:42:12 Eduardo Valentin wrote:
  As there can be modulator devices with get/set frequency
  callbacks, this patch adds support to them in v4l2-ctl utility.
 
 Thanks for this patch.
 
 I've implemented it somewhat differently (using the new V4L2_CAP_MODULATOR
 to decide whether to call G_TUNER or G_MODULATOR) and pushed it to my
 v4l-dvb-strctrl tree. I've also improved the string print function so things
 like newlines and carriage returns are printed as \r and \n.
 
 Can you mail me the output of 'v4l2-ctl --all -L' based on this updated
 version of v4l2-ctl? I'd like to check whether everything is now reported
 correctly.

Yes sure. But there is also the RDS output for txsubchannel. This is missing
now for G_MODULATOR. RDS is also missing in S_MODULATOR. S_MODULATOR is also
confusing to me. The strings can be set only with one value? I though I could
do something like:

v4l2-ctl -d /dev/radio0 --set-modulator=rds,stereo

 
 Regards,
 
   Hans
 
  
  Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
  ---
   v4l2-apps/util/v4l2-ctl.cpp |   10 +-
   1 files changed, 9 insertions(+), 1 deletions(-)
  
  diff --git a/v4l2-apps/util/v4l2-ctl.cpp b/v4l2-apps/util/v4l2-ctl.cpp
  index fc9e459..ff74177 100644
  --- a/v4l2-apps/util/v4l2-ctl.cpp
  +++ b/v4l2-apps/util/v4l2-ctl.cpp
  @@ -1962,12 +1962,16 @@ int main(int argc, char **argv)
   
  if (options[OptSetFreq]) {
  double fac = 16;
  +   struct v4l2_modulator mt;
   
  +   memset(mt, 0, sizeof(struct v4l2_modulator));
  if (doioctl(fd, VIDIOC_G_TUNER, tuner, VIDIOC_G_TUNER) == 0) 
  {
  fac = (tuner.capability  V4L2_TUNER_CAP_LOW) ? 16000 : 
  16;
  +   vf.type = tuner.type;
  +   } else if (doioctl(fd, VIDIOC_G_MODULATOR, mt, 
  VIDIOC_G_MODULATOR) == 0) {
  +   fac = (mt.capability  V4L2_TUNER_CAP_LOW) ? 16000 : 16;
  }
  vf.tuner = 0;
  -   vf.type = tuner.type;
  vf.frequency = __u32(freq * fac);
  if (doioctl(fd, VIDIOC_S_FREQUENCY, vf,
  VIDIOC_S_FREQUENCY) == 0)
  @@ -2418,9 +2422,13 @@ set_vid_fmt_error:
   
  if (options[OptGetFreq]) {
  double fac = 16;
  +   struct v4l2_modulator mt;
   
  +   memset(mt, 0, sizeof(struct v4l2_modulator));
  if (doioctl(fd, VIDIOC_G_TUNER, tuner, VIDIOC_G_TUNER) == 0) 
  {
  fac = (tuner.capability  V4L2_TUNER_CAP_LOW) ? 16000 : 
  16;
  +   } else if (doioctl(fd, VIDIOC_G_MODULATOR, mt, 
  VIDIOC_G_MODULATOR) == 0) {
  +   fac = (mt.capability  V4L2_TUNER_CAP_LOW) ? 16000 : 16;
  }
  vf.tuner = 0;
  if (doioctl(fd, VIDIOC_G_FREQUENCY, vf, VIDIOC_G_FREQUENCY) 
  == 0)
 
 
 
 -- 
 Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom

-- 
Eduardo Valentin
--
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


[PATCHv11 7/8] FM TX: si4713: Add Kconfig and Makefile entries

2009-07-25 Thread Eduardo Valentin
Simple add Makefile and Kconfig entries.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/drivers/media/radio/Kconfig  |   22 ++
 linux/drivers/media/radio/Makefile |2 ++
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/linux/drivers/media/radio/Kconfig 
b/linux/drivers/media/radio/Kconfig
index 3315cac..6c6a409 100644
--- a/linux/drivers/media/radio/Kconfig
+++ b/linux/drivers/media/radio/Kconfig
@@ -339,6 +339,28 @@ config RADIO_ZOLTRIX_PORT
help
  Enter the I/O port of your Zoltrix radio card.
 
+config I2C_SI4713
+   tristate I2C driver for Silicon Labs Si4713 device
+   depends on I2C  VIDEO_V4L2
+   ---help---
+ Say Y here if you want support to Si4713 I2C device.
+ This device driver supports only i2c bus.
+
+ To compile this driver as a module, choose M here: the
+ module will be called si4713.
+
+config RADIO_SI4713
+   tristate Silicon Labs Si4713 FM Radio Transmitter support
+   depends on I2C  VIDEO_V4L2
+   ---help---
+ Say Y here if you want support to Si4713 FM Radio Transmitter.
+ This device can transmit audio through FM. It can transmit
+ EDS and EBDS signals as well. This module is the v4l2 radio
+ interface for the i2c driver of this device.
+
+ To compile this driver as a module, choose M here: the
+ module will be called radio-si4713.
+
 config USB_DSBR
tristate D-Link/GemTek USB FM radio support
depends on USB  VIDEO_V4L2
diff --git a/linux/drivers/media/radio/Makefile 
b/linux/drivers/media/radio/Makefile
index 0f2b35b..34ae761 100644
--- a/linux/drivers/media/radio/Makefile
+++ b/linux/drivers/media/radio/Makefile
@@ -15,6 +15,8 @@ obj-$(CONFIG_RADIO_ZOLTRIX) += radio-zoltrix.o
 obj-$(CONFIG_RADIO_GEMTEK) += radio-gemtek.o
 obj-$(CONFIG_RADIO_GEMTEK_PCI) += radio-gemtek-pci.o
 obj-$(CONFIG_RADIO_TRUST) += radio-trust.o
+obj-$(CONFIG_I2C_SI4713) += si4713-i2c.o
+obj-$(CONFIG_RADIO_SI4713) += radio-si4713.o
 obj-$(CONFIG_RADIO_MAESTRO) += radio-maestro.o
 obj-$(CONFIG_USB_DSBR) += dsbr100.o
 obj-$(CONFIG_USB_SI470X) += radio-si470x.o
-- 
1.6.2.GIT

--
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


Re: [PATCHv11 8/8] FM TX: si4713: Add document file

2009-07-25 Thread Eduardo Valentin
On Sat, Jul 25, 2009 at 05:19:29PM +0200, ext Hans Verkuil wrote:
 On Saturday 25 July 2009 16:57:42 Eduardo Valentin wrote:
  This patch adds a document file for si4713 device driver.
  It describes the driver interfaces and organization.
  
  Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
  ---
   linux/Documentation/video4linux/si4713.txt |  176 
  
   1 files changed, 176 insertions(+), 0 deletions(-)
   create mode 100644 linux/Documentation/video4linux/si4713.txt
  
  diff --git a/linux/Documentation/video4linux/si4713.txt 
  b/linux/Documentation/video4linux/si4713.txt
  new file mode 100644
  index 000..8b97fb6
  --- /dev/null
  +++ b/linux/Documentation/video4linux/si4713.txt
  @@ -0,0 +1,176 @@
  +Driver for I2C radios for the Silicon Labs Si4713 FM Radio Transmitters
  +
  +Copyright (c) 2009 Nokia Corporation
  +Contact: Eduardo Valentin eduardo.valen...@nokia.com
  +
  +
  +Information about the Device
  +
  +This chip is a Silicon Labs product. It is a I2C device, currently on 
  0×63 address.
 
 Something went wrong here with the i2c address, it should probably be '0x63'.
 I don't know whether this is in your original text or whether it got messed
 up in some mailer.

It got messed during the mailing processes somehow. I'll resend only this one.

 
 Regards,
 
   Hans
 
 -- 
 Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom

-- 
Eduardo Valentin
--
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


[PATCHv11 8/8] FM TX: si4713: Add document file

2009-07-25 Thread Eduardo Valentin
This patch adds a document file for si4713 device driver.
It describes the driver interfaces and organization.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/Documentation/video4linux/si4713.txt |  176 
 1 files changed, 176 insertions(+), 0 deletions(-)
 create mode 100644 linux/Documentation/video4linux/si4713.txt

diff --git a/linux/Documentation/video4linux/si4713.txt 
b/linux/Documentation/video4linux/si4713.txt
new file mode 100644
index 000..8b97fb6
--- /dev/null
+++ b/linux/Documentation/video4linux/si4713.txt
@@ -0,0 +1,176 @@
+Driver for I2C radios for the Silicon Labs Si4713 FM Radio Transmitters
+
+Copyright (c) 2009 Nokia Corporation
+Contact: Eduardo Valentin eduardo.valen...@nokia.com
+
+
+Information about the Device
+
+This chip is a Silicon Labs product. It is a I2C device, currently on 0x63 
address.
+Basically, it has transmission and signal noise level measurement features.
+
+The Si4713 integrates transmit functions for FM broadcast stereo transmission.
+The chip also allows integrated receive power scanning to identify low signal
+power FM channels.
+
+The chip is programmed using commands and responses. There are also several
+properties which can change the behavior of this chip.
+
+Users must comply with local regulations on radio frequency (RF) transmission.
+
+Device driver description
+=
+There are two modules to handle this device. One is a I2C device driver
+and the other is a platform driver.
+
+The I2C device driver exports a v4l2-subdev interface to the kernel.
+All properties can also be accessed by v4l2 extended controls interface, by
+using the v4l2-subdev calls (g_ext_ctrls, s_ext_ctrls).
+
+The platform device driver exports a v4l2 radio device interface to user land.
+So, it uses the I2C device driver as a sub device in order to send the user
+commands to the actual device. Basically it is a wrapper to the I2C device 
driver.
+
+Applications can use v4l2 radio API to specify frequency of operation, mute 
state,
+etc. But mostly of its properties will be present in the extended controls.
+
+When the v4l2 mute property is set to 1 (true), the driver will turn the chip 
off.
+
+Properties description
+==
+
+The properties can be accessed using v4l2 extended controls.
+Here is an output from v4l2-ctl util:
+/ # v4l2-ctl -d /dev/radio0 --all -L
+Driver Info:
+Driver name   : radio-si4713
+Card type : Silicon Labs Si4713 Modulator
+Bus info  :
+Driver version: 0
+Capabilities  : 0x00080800
+RDS Output
+Modulator
+Audio output: 0 (FM Modulator Audio Out)
+Frequency: 1408000 (88.00 MHz)
+Video Standard = 0x
+Modulator:
+Name : FM Modulator
+Capabilities : 62.5 Hz stereo rds
+Frequency range  : 76.0 MHz - 108.0 MHz
+Subchannel modulation: mono+rds
+
+User Controls
+
+   mute (bool) : default=1 value=0
+
+FM Radio Modulator Controls
+
+ rds_program_id (int)  : min=0 max=65535 step=1 default=0 
value=0
+   rds_program_type (int)  : min=0 max=31 step=1 default=0 value=0
+   rds_signal_deviation (int)  : min=0 max=9 step=10 default=200 
value=200 flags=slider
+rds_ps_name (str)  : min=0 max=97 value='Si4713  '
+ rds_radio_text (str)  : min=0 max=385 value='Si4713  \r'
+  audio_limiter_feature_enabled (bool) : default=1 value=1
+ audio_limiter_release_time (int)  : min=250 max=102390 step=50 
default=5010 value=5010 flags=slider
+audio_limiter_deviation (int)  : min=0 max=9 step=10 default=66250 
value=66250 flags=slider
+audio_compression_feature_enabl (bool) : default=1 value=1
+ audio_compression_gain (int)  : min=0 max=20 step=1 default=15 
value=15 flags=slider
+audio_compression_threshold (int)  : min=-40 max=0 step=1 default=-40 
value=-40 flags=slider
+  audio_compression_attack_time (int)  : min=0 max=5000 step=500 default=0 
value=0 flags=slider
+ audio_compression_release_time (int)  : min=10 max=100 step=10 
default=100 value=100 flags=slider
+ pilot_tone_feature_enabled (bool) : default=1 value=1
+   pilot_tone_deviation (int)  : min=0 max=9 step=10 default=6750 
value=6750 flags=slider
+   pilot_tone_frequency (int)  : min=0 max=19000 step=1 default=19000 
value=19000 flags=slider
+  pre_emphasis_settings (menu) : min=0 max=2 default=1 value=1
+   tune_power_level (int)  : min=0 max=120 step=1 default=88 
value=88 flags=slider
+ tune_antenna_capacitor (int)  : min=0 max=191 step=1 default=0 
value=109 flags=slider
+/ #
+
+Here is a summary of them:
+
+* Pilot is an audible tone sent by the device.
+
+pilot_frequency - Configures the frequency of the stereo pilot tone.
+pilot_deviation

Re: [PATCHv11 0/8] FM Transmitter (si4713) and another changes

2009-07-25 Thread Eduardo Valentin
I'm sending a tarball with all patches due to some problems which may
be caused by my mail server. Just in case patches get messed, use this
tarball. Sorry for this inconvenience.

BR,

On Sat, Jul 25, 2009 at 04:57:34PM +0200, Valentin Eduardo (Nokia-D/Helsinki) 
wrote:
 Hello guys,
 
  Here is the version 11 of FM transmitter work. It is basically
 same thing of version 10 with minor fixes from previous comments,
 which are:
 - Do not use temp variable in v4l2_ctrl_is_pointer (v4l2-common.c).
 - Report a string length accordingly to maximum allowed size (si4713-i2c.c).
 - Add some comments explaining rds psname and radio text maximum sizes.
 - Update si4713.txt with latest v4l2-ctl output (which was proper updated
 for modulator devices).
 
 Besides that, every thing is the same.
 
  Again, this series is based only on
 http://www.linuxtv.org/hg/~hverkuil/v4l-dvb-strctrl,
 which contains the string support for our extended control api.
 
 The problems with v4l2-ctl were solved by Hans. Now it can
 properly set/get frequencies for modulators. Also the txsubchannels
 are properly handled for RDS capable devices.
 
 Thanks Hans.
 
 BR,
 
 
 Eduardo Valentin (8):
   v4l2-subdev.h: Add g_modulator callbacks to subdev api
   v4l2: video device: Add V4L2_CTRL_CLASS_FM_TX controls
   v4l2: video device: Add FM TX controls default configurations
   v4l2-spec: Add documentation description for FM TX extended control
 class
   FM TX: si4713: Add files to add radio interface for si4713
   FM TX: si4713: Add files to handle si4713 i2c device
   FM TX: si4713: Add Kconfig and Makefile entries
   FM TX: si4713: Add document file
 
  linux/Documentation/video4linux/si4713.txt |  176 +++
  linux/drivers/media/radio/Kconfig  |   22 +
  linux/drivers/media/radio/Makefile |2 +
  linux/drivers/media/radio/radio-si4713.c   |  367 +
  linux/drivers/media/radio/si4713-i2c.c | 2034 
 
  linux/drivers/media/radio/si4713-i2c.h |  237 
  linux/drivers/media/video/v4l2-common.c|   58 +-
  linux/include/linux/videodev2.h|   34 +
  linux/include/media/radio-si4713.h |   30 +
  linux/include/media/si4713.h   |   49 +
  linux/include/media/v4l2-subdev.h  |2 +
  v4l2-spec/Makefile |1 +
  v4l2-spec/controls.sgml|  210 +++
  13 files changed, 3221 insertions(+), 1 deletions(-)
  create mode 100644 linux/Documentation/video4linux/si4713.txt
  create mode 100644 linux/drivers/media/radio/radio-si4713.c
  create mode 100644 linux/drivers/media/radio/si4713-i2c.c
  create mode 100644 linux/drivers/media/radio/si4713-i2c.h
  create mode 100644 linux/include/media/radio-si4713.h
  create mode 100644 linux/include/media/si4713.h

-- 
Eduardo Valentin


patches-v11.tar.gz
Description: Binary data


Re: Changes to the string control handling

2009-07-25 Thread Eduardo Valentin
Hello Hans,

On Sat, Jul 25, 2009 at 7:44 PM, Hans Verkuilhverk...@xs4all.nl wrote:
 Hi Eduardo,

 On Saturday 25 July 2009 16:41:27 Eduardo Valentin wrote:
 On Sat, Jul 25, 2009 at 04:39:18PM +0200, ext Hans Verkuil wrote:
  If the string must be exactly 8 x n long, then I think that it is a good 
  idea
  to start using the 'step' value of v4l2_queryctrl: this can be used to tell
  the application that string lengths should be a multiple of the step value.
  I've toyed with that idea before but I couldn't think of a good use case,
  but this might be it.

 I think that would be good. It is a way to report to user land what can be
 done in these cases which strings can be chopped in small pieces. Of course,
 documenting this part it is appreciated.

 Ok, I've implemented this. While doing this I realized that I had to change
 a few things:

 1) the 'length' field in v4l2_ext_control has been renamed to 'size'. The
 name 'length' was too easy to confuse with 'string length' while in reality
 it referred to the memory size of the control payload. 'size' is more
 appropriate.

 2) the 'minimum' and 'maximum' fields of v4l2_queryctrl now return the min
 and max string lengths, i.e. *without* terminating zero. I realized that what
 VIDIOC_QUERYCTRL returns has nothing to do with how much memory to reserve
 for the string control. It is about the properties of the string itself
 and it is not normal to include the terminating zero when talking about a
 string length.

 I've incorporated everything in my v4l-dvb-strctrl tree. I apologize for the
 fact that you have to make yet another series of patches, but these changes
 are typical when you start implementing and documenting a new feature for
 the first time.

I believe now things about string handling are becoming much clear this way.
No worries about the fact that we need another (or even more) series for si4713.
As it is the first driver using the new API, it is better to forge it
properly, so people
can use it as example.

When I come back to office, I'll have the opportunity to test the new series.
Only after that I can send it again. But I will try to send it as soon
as possible.


 Regards,

        Hans

 --
 Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom
 --
 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




-- 
Eduardo Bezerra Valentin
--
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


Re: New tree with final (?) string control implementation

2009-07-24 Thread Eduardo Valentin
Hi Hans,

On Thu, Jul 23, 2009 at 11:54:46PM +0200, ext Hans Verkuil wrote:
 Hi Eduardo,
 
 I've prepared a new tree:
 
 http://www.linuxtv.org/hg/~hverkuil/v4l-dvb-strctrl

good.

 
 This contains the full string control implementation, including updates to 
 the v4l2-spec, based on the RFC that I posted on Monday.

Right.

 
 Can you prepare your si4713 patches against this tree and verify that 
 everything is working well?

Sure, I've been off work last two weeks. But now I'm back and will get this
task soon.

 
 If it is, then I can make a pull request for this tree and soon after that 
 you should be able to merge your si4713 driver as well. If I'm not mistaken 
 the string controls API is the only missing bit that prevents your driver 
 from being merged.

Yeah. There use to have three dependencies: subdev changes (i2c), modulator
capabilities and ext ctl string support. I recall now that subdev is already
merged. I'm not sure about the modulator support.

 
 Thanks,
 
   Hans
 
 -- 
 Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom

-- 
Eduardo Valentin
--
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


[PATCHv10 0/8] FM Transmitter (si4713) and another changes

2009-07-24 Thread Eduardo Valentin
Hello guys,

 Here is the version 10 of fm transmitter work.

 The difference between previous version is that now it is
based only on http://www.linuxtv.org/hg/~hverkuil/v4l-dvb-strctrl,
which contains the string support for our extended control api.

Also, I've added a new extended control on the fm tx class:
rds deviation. This control was missing from previous versions.
It used to be set to default value. But I believe it would be good
to have it configurable.

Another minor change is about s_frequency call back. In the
conversion from sysfs to extended control only interfaces,
I forgot to keep the range check. That was missing on version #9.
Now it is back.

I've removed the v4l2-ctl changes, as they are no longer needed
due to last re-factoring which happened there. All ext controls
seams to work with v4l2-ctl, including string ones.

I've also updated the documentation, including the new control
and the references for character encoding of ps name and radio text.

Besides that, every thing is the same.

There is a needed change in v4l2-ctl regarding set/get frequency.
Nowadays, v4l2-ctl queries only the tuner and forgets about modulators.
That I will send an initial proposal in a separated patch (I believe
it is not related to this series anymore).

BR,

Eduardo Valentin (8):
  v4l2-subdev.h: Add g_modulator callbacks to subdev api
  v4l2: video device: Add V4L2_CTRL_CLASS_FM_TX controls
  v4l2: video device: Add FM_TX controls default configurations
  v4l2-spec: Add documentation description for FM TX extended control
class
  FMTx: si4713: Add files to add radio interface for si4713
  FMTx: si4713: Add files to handle si4713 i2c device
  FMTx: si4713: Add Kconfig and Makefile entries
  FMTx: si4713: Add document file

 linux/Documentation/video4linux/si4713.txt |  175 +++
 linux/drivers/media/radio/Kconfig  |   22 +
 linux/drivers/media/radio/Makefile |2 +
 linux/drivers/media/radio/radio-si4713.c   |  367 +
 linux/drivers/media/radio/si4713-i2c.c | 2034 
 linux/drivers/media/radio/si4713-i2c.h |  228 
 linux/drivers/media/video/v4l2-common.c|   63 +-
 linux/include/linux/videodev2.h|   34 +
 linux/include/media/radio-si4713.h |   30 +
 linux/include/media/si4713.h   |   49 +
 linux/include/media/v4l2-subdev.h  |2 +
 v4l2-spec/Makefile |1 +
 v4l2-spec/controls.sgml|  210 +++
 13 files changed, 3216 insertions(+), 1 deletions(-)
 create mode 100644 linux/Documentation/video4linux/si4713.txt
 create mode 100644 linux/drivers/media/radio/radio-si4713.c
 create mode 100644 linux/drivers/media/radio/si4713-i2c.c
 create mode 100644 linux/drivers/media/radio/si4713-i2c.h
 create mode 100644 linux/include/media/radio-si4713.h
 create mode 100644 linux/include/media/si4713.h

--
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


[PATCHv10 2/8] v4l2: video device: Add V4L2_CTRL_CLASS_FM_TX controls

2009-07-24 Thread Eduardo Valentin
This patch adds a new class of extended controls. This class
is intended to support FM Radio Modulators properties such as:
rds, audio limiters, audio compression, pilot tone generation,
tuning power levels and preemphasis properties.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/include/linux/videodev2.h |   34 ++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h
index f68d3b1..2e84ec2 100644
--- a/linux/include/linux/videodev2.h
+++ b/linux/include/linux/videodev2.h
@@ -817,6 +817,7 @@ struct v4l2_ext_controls {
 #define V4L2_CTRL_CLASS_USER 0x0098/* Old-style 'user' controls */
 #define V4L2_CTRL_CLASS_MPEG 0x0099/* MPEG-compression controls */
 #define V4L2_CTRL_CLASS_CAMERA 0x009a  /* Camera class controls */
+#define V4L2_CTRL_CLASS_FM_TX 0x009b   /* FM Modulator control class */
 
 #define V4L2_CTRL_ID_MASK(0x0fff)
 #define V4L2_CTRL_ID2CLASS(id)((id)  0x0fffUL)
@@ -1156,6 +1157,39 @@ enum  v4l2_exposure_auto_type {
 
 #define V4L2_CID_PRIVACY   (V4L2_CID_CAMERA_CLASS_BASE+16)
 
+/* FM Modulator class control IDs */
+#define V4L2_CID_FM_TX_CLASS_BASE  (V4L2_CTRL_CLASS_FM_TX | 0x900)
+#define V4L2_CID_FM_TX_CLASS   (V4L2_CTRL_CLASS_FM_TX | 1)
+
+#define V4L2_CID_RDS_TX_PI (V4L2_CID_FM_TX_CLASS_BASE + 1)
+#define V4L2_CID_RDS_TX_PTY(V4L2_CID_FM_TX_CLASS_BASE + 2)
+#define V4L2_CID_RDS_TX_DEVIATION  (V4L2_CID_FM_TX_CLASS_BASE + 3)
+#define V4L2_CID_RDS_TX_PS_NAME
(V4L2_CID_FM_TX_CLASS_BASE + 4)
+#define V4L2_CID_RDS_TX_RADIO_TEXT (V4L2_CID_FM_TX_CLASS_BASE + 5)
+
+#define V4L2_CID_AUDIO_LIMITER_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 6)
+#define V4L2_CID_AUDIO_LIMITER_RELEASE_TIME(V4L2_CID_FM_TX_CLASS_BASE + 7)
+#define V4L2_CID_AUDIO_LIMITER_DEVIATION   (V4L2_CID_FM_TX_CLASS_BASE + 8)
+
+#define V4L2_CID_AUDIO_COMPRESSION_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 9)
+#define V4L2_CID_AUDIO_COMPRESSION_GAIN
(V4L2_CID_FM_TX_CLASS_BASE + 10)
+#define V4L2_CID_AUDIO_COMPRESSION_THRESHOLD   (V4L2_CID_FM_TX_CLASS_BASE + 11)
+#define V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME (V4L2_CID_FM_TX_CLASS_BASE + 12)
+#define V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME
(V4L2_CID_FM_TX_CLASS_BASE + 13)
+
+#define V4L2_CID_PILOT_TONE_ENABLED(V4L2_CID_FM_TX_CLASS_BASE + 14)
+#define V4L2_CID_PILOT_TONE_DEVIATION  (V4L2_CID_FM_TX_CLASS_BASE + 15)
+#define V4L2_CID_PILOT_TONE_FREQUENCY  (V4L2_CID_FM_TX_CLASS_BASE + 16)
+
+#define V4L2_CID_FM_TX_PREEMPHASIS (V4L2_CID_FM_TX_CLASS_BASE + 17)
+enum v4l2_preemphasis {
+   V4L2_PREEMPHASIS_DISABLED   = 0,
+   V4L2_PREEMPHASIS_50_uS  = 1,
+   V4L2_PREEMPHASIS_75_uS  = 2,
+};
+#define V4L2_CID_TUNE_POWER_LEVEL  (V4L2_CID_FM_TX_CLASS_BASE + 18)
+#define V4L2_CID_TUNE_ANTENNA_CAPACITOR
(V4L2_CID_FM_TX_CLASS_BASE + 19)
+
 /*
  * T U N I N G
  */
-- 
1.6.2.GIT

--
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


[PATCHv10 4/8] v4l2-spec: Add documentation description for FM TX extended control class

2009-07-24 Thread Eduardo Valentin
This single patch adds documentation description for FM Modulator (FM TX)
Extended Control Class and its Control IDs. The text was added under
Extended Controls section.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 v4l2-spec/Makefile  |1 +
 v4l2-spec/controls.sgml |  210 +++
 2 files changed, 211 insertions(+), 0 deletions(-)

diff --git a/v4l2-spec/Makefile b/v4l2-spec/Makefile
index 4f11745..7a8d161 100644
--- a/v4l2-spec/Makefile
+++ b/v4l2-spec/Makefile
@@ -243,6 +243,7 @@ ENUMS = \
v4l2_power_line_frequency \
v4l2_priority \
v4l2_tuner_type \
+   v4l2_preemphasis \
 
 STRUCTS = \
v4l2_audio \
diff --git a/v4l2-spec/controls.sgml b/v4l2-spec/controls.sgml
index 8e0e024..791df4d 100644
--- a/v4l2-spec/controls.sgml
+++ b/v4l2-spec/controls.sgml
@@ -458,6 +458,12 @@ video is actually encoded into that format./para
   paraUnfortunately, the original control API lacked some
 features needed for these new uses and so it was extended into the
 (not terribly originally named) extended control API./para
+
+  paraEven though the MPEG encoding API was the first effort
+to use the Extended Control API, nowadays there are also other classes
+of Extended Controls, such as Camera Controls and FM Transmitter Controls.
+The Extended Controls API as well as all Extended Controls classes are
+described in the following text./para
 /section
 
 section
@@ -1815,6 +1821,210 @@ control must support read access and may support write 
access./entry
   /tgroup
 /table
   /section
+
+section id=fm-tx-controls
+  titleFM Transmitter Control Reference/title
+
+  paraThe FM Transmitter (FM_TX) class includes controls for common 
features of
+FM transmissions capable devices. Currently this class includes parameters for 
audio
+compression, pilot tone generation, audio deviation limiter, RDS transmission 
and
+tuning power features./para
+
+  table pgwide=1 frame=none id=fm-tx-control-id
+  titleFM_TX Control IDs/title
+
+  tgroup cols=4
+   colspec colname=c1 colwidth=1*
+   colspec colname=c2 colwidth=6*
+   colspec colname=c3 colwidth=2*
+   colspec colname=c4 colwidth=6*
+   spanspec namest=c1 nameend=c2 spanname=id
+   spanspec namest=c2 nameend=c4 spanname=descr
+   thead
+ row
+   entry spanname=id align=leftID/entry
+   entry align=leftType/entry
+ /rowrow rowsep=1entry spanname=descr 
align=leftDescription/entry
+ /row
+   /thead
+   tbody valign=top
+ rowentry/entry/row
+ row
+   entry 
spanname=idconstantV4L2_CID_FM_TX_CLASS/constantnbsp;/entry
+   entryclass/entry
+ /rowrowentry spanname=descrThe FM_TX class
+descriptor. Calling VIDIOC-QUERYCTRL; for this control will return a
+description of this control class./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_PI/constantnbsp;/entry
+   entryinteger/entry
+ /row
+ rowentry spanname=descrSets the RDS Programme Identification 
field
+for transmission./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_PTY/constantnbsp;/entry
+   entryinteger/entry
+ /row
+ rowentry spanname=descrSets the RDS Programme Type field for 
transmission.
+This encodes up to 31 pre-defined programme types./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_DEVIATION/constantnbsp;/entry
+   entryinteger/entry
+ /row
+ rowentry spanname=descrConfigures RDS signal frequency 
deviation level in Hz.
+The range and step are driver-specific./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_PS_NAME/constantnbsp;/entry
+   entrystring/entry
+ /row
+ rowentry spanname=descrSets the Programme Service name 
(PS_NAME) for transmission.
+It is intended for static display on a receiver. It is the primary aid to 
listeners in programme service
+identification and selection. The use of PS to transmit text other than a 
single eight character name is
+not permitted.  In Annex E of xref linkend=en50067, the RDS specification,
+there is a full description of the correct character encoding for Programme 
Service name strings./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_RADIO_TEXT/constantnbsp;/entry
+   entrystring/entry
+ /row
+ rowentry spanname=descrSets the Radio Text info for 
transmission. It is a textual description of
+what is being broadcasted. RDS Radio Text can be applied when broadcaster 
wishes to transmit longer PS names,
+programme-related information or any other text. In these cases, RadioText 
should be used in addition to
+constantV4L2_CID_RDS_TX_PS_NAME/constant. The encoding for Radio Text 
strings is also fully

[PATCHv10 3/8] v4l2: video device: Add FM_TX controls default configurations

2009-07-24 Thread Eduardo Valentin
Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/drivers/media/video/v4l2-common.c |   63 ++-
 1 files changed, 62 insertions(+), 1 deletions(-)

diff --git a/linux/drivers/media/video/v4l2-common.c 
b/linux/drivers/media/video/v4l2-common.c
index bd13702..6fc0559 100644
--- a/linux/drivers/media/video/v4l2-common.c
+++ b/linux/drivers/media/video/v4l2-common.c
@@ -343,6 +343,12 @@ const char **v4l2_ctrl_get_menu(u32 id)
Sepia,
NULL
};
+   static const char *fm_tx_preemphasis[] = {
+   No preemphasis,
+   50 useconds,
+   75 useconds,
+   NULL,
+   };
 
switch (id) {
case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ:
@@ -381,6 +387,8 @@ const char **v4l2_ctrl_get_menu(u32 id)
return camera_exposure_auto;
case V4L2_CID_COLORFX:
return colorfx;
+   case V4L2_CID_FM_TX_PREEMPHASIS:
+   return fm_tx_preemphasis;
default:
return NULL;
}
@@ -479,6 +487,28 @@ const char *v4l2_ctrl_get_name(u32 id)
case V4L2_CID_ZOOM_CONTINUOUS:  return Zoom, Continuous;
case V4L2_CID_PRIVACY:  return Privacy;
 
+   /* FM Radio Modulator control */
+   case V4L2_CID_FM_TX_CLASS:  return FM Radio Modulator 
Controls;
+   case V4L2_CID_RDS_TX_PI:return RDS Program ID;
+   case V4L2_CID_RDS_TX_PTY:   return RDS Program Type;
+   case V4L2_CID_RDS_TX_DEVIATION: return RDS Signal Deviation;
+   case V4L2_CID_RDS_TX_PS_NAME:   return RDS PS Name;
+   case V4L2_CID_RDS_TX_RADIO_TEXT:return RDS Radio Text;
+   case V4L2_CID_AUDIO_LIMITER_ENABLED:return Audio Limiter Feature 
Enabled;
+   case V4L2_CID_AUDIO_LIMITER_RELEASE_TIME: return Audio Limiter Release 
Time;
+   case V4L2_CID_AUDIO_LIMITER_DEVIATION:  return Audio Limiter 
Deviation;
+   case V4L2_CID_AUDIO_COMPRESSION_ENABLED: return Audio Compression 
Feature Enabled;
+   case V4L2_CID_AUDIO_COMPRESSION_GAIN:   return Audio Compression Gain;
+   case V4L2_CID_AUDIO_COMPRESSION_THRESHOLD: return Audio Compression 
Threshold;
+   case V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME: return Audio Compression 
Attack Time;
+   case V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME: return Audio Compression 
Release Time;
+   case V4L2_CID_PILOT_TONE_ENABLED:   return Pilot Tone Feature 
Enabled;
+   case V4L2_CID_PILOT_TONE_DEVIATION: return Pilot Tone Deviation;
+   case V4L2_CID_PILOT_TONE_FREQUENCY: return Pilot Tone Frequency;
+   case V4L2_CID_FM_TX_PREEMPHASIS:return Pre-emphasis settings;
+   case V4L2_CID_TUNE_POWER_LEVEL: return Tune Power Level;
+   case V4L2_CID_TUNE_ANTENNA_CAPACITOR:   return Tune Antenna Capacitor;
+
default:
return NULL;
}
@@ -500,7 +530,18 @@ EXPORT_SYMBOL(v4l2_ctrl_is_value64);
  * This information is used inside v4l2_compat_ioctl32. */
 int v4l2_ctrl_is_pointer(u32 id)
 {
-   return 0;
+   int is_pointer;
+
+   switch (id) {
+   case V4L2_CID_RDS_TX_PS_NAME:
+   case V4L2_CID_RDS_TX_RADIO_TEXT:
+   is_pointer = 1;
+   break;
+   default:
+   is_pointer = 0;
+   }
+
+   return is_pointer;
 }
 EXPORT_SYMBOL(v4l2_ctrl_is_pointer);
 
@@ -530,6 +571,9 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 
min, s32 max, s32 ste
case V4L2_CID_EXPOSURE_AUTO_PRIORITY:
case V4L2_CID_FOCUS_AUTO:
case V4L2_CID_PRIVACY:
+   case V4L2_CID_AUDIO_LIMITER_ENABLED:
+   case V4L2_CID_AUDIO_COMPRESSION_ENABLED:
+   case V4L2_CID_PILOT_TONE_ENABLED:
qctrl-type = V4L2_CTRL_TYPE_BOOLEAN;
min = 0;
max = step = 1;
@@ -558,12 +602,18 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, 
s32 min, s32 max, s32 ste
case V4L2_CID_MPEG_STREAM_VBI_FMT:
case V4L2_CID_EXPOSURE_AUTO:
case V4L2_CID_COLORFX:
+   case V4L2_CID_FM_TX_PREEMPHASIS:
qctrl-type = V4L2_CTRL_TYPE_MENU;
step = 1;
break;
+   case V4L2_CID_RDS_TX_PS_NAME:
+   case V4L2_CID_RDS_TX_RADIO_TEXT:
+   qctrl-type = V4L2_CTRL_TYPE_STRING;
+   break;
case V4L2_CID_USER_CLASS:
case V4L2_CID_CAMERA_CLASS:
case V4L2_CID_MPEG_CLASS:
+   case V4L2_CID_FM_TX_CLASS:
qctrl-type = V4L2_CTRL_TYPE_CTRL_CLASS;
qctrl-flags |= V4L2_CTRL_FLAG_READ_ONLY;
min = max = step = def = 0;
@@ -592,6 +642,17 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 
min, s32 max, s32 ste
case V4L2_CID_BLUE_BALANCE:
case V4L2_CID_GAMMA:
case

[PATCHv10 5/8] FMTx: si4713: Add files to add radio interface for si4713

2009-07-24 Thread Eduardo Valentin
This patch adds files which creates the radio interface
for si4713 FM transmitter (modulator) devices.

In order to do the real access to device registers, this
driver uses the v4l2 subdev interface exported by si4713 i2c driver.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/drivers/media/radio/radio-si4713.c |  367 ++
 linux/include/media/radio-si4713.h   |   30 +++
 2 files changed, 397 insertions(+), 0 deletions(-)
 create mode 100644 linux/drivers/media/radio/radio-si4713.c
 create mode 100644 linux/include/media/radio-si4713.h

diff --git a/linux/drivers/media/radio/radio-si4713.c 
b/linux/drivers/media/radio/radio-si4713.c
new file mode 100644
index 000..34c26b7
--- /dev/null
+++ b/linux/drivers/media/radio/radio-si4713.c
@@ -0,0 +1,367 @@
+/*
+ * drivers/media/radio/radio-si4713.c
+ *
+ * Platform Driver for Silicon Labs Si4713 FM Radio Transmitter:
+ *
+ * Copyright (c) 2008 Instituto Nokia de Tecnologia - INdT
+ * Contact: Eduardo Valentin eduardo.valen...@nokia.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include linux/kernel.h
+#include linux/module.h
+#include linux/init.h
+#include linux/version.h
+#include linux/platform_device.h
+#include linux/i2c.h
+#include linux/videodev2.h
+#include media/v4l2-device.h
+#include media/v4l2-common.h
+#include media/v4l2-ioctl.h
+#include media/radio-si4713.h
+
+/* module parameters */
+static int radio_nr = -1;  /* radio device minor (-1 == auto assign) */
+module_param(radio_nr, int, 0);
+MODULE_PARM_DESC(radio_nr,
+Minor number for radio device (-1 == auto assign));
+
+MODULE_LICENSE(GPL);
+MODULE_AUTHOR(Eduardo Valentin eduardo.valen...@nokia.com);
+MODULE_DESCRIPTION(Platform driver for Si4713 FM Radio Transmitter);
+MODULE_VERSION(0.0.1);
+
+/* Driver state struct */
+struct radio_si4713_device {
+   struct v4l2_device  v4l2_dev;
+   struct video_device *radio_dev;
+};
+
+/* radio_si4713_fops - file operations interface */
+static const struct v4l2_file_operations radio_si4713_fops = {
+   .owner  = THIS_MODULE,
+   .ioctl  = video_ioctl2,
+};
+
+/* Video4Linux Interface */
+static int radio_si4713_fill_audout(struct v4l2_audioout *vao)
+{
+   /* TODO: check presence of audio output */
+   strlcpy(vao-name, FM Modulator Audio Out, 32);
+
+   return 0;
+}
+
+static int radio_si4713_enumaudout(struct file *file, void *priv,
+   struct v4l2_audioout *vao)
+{
+   return radio_si4713_fill_audout(vao);
+}
+
+static int radio_si4713_g_audout(struct file *file, void *priv,
+   struct v4l2_audioout *vao)
+{
+   int rval = radio_si4713_fill_audout(vao);
+
+   vao-index = 0;
+
+   return rval;
+}
+
+static int radio_si4713_s_audout(struct file *file, void *priv,
+   struct v4l2_audioout *vao)
+{
+   return vao-index ? -EINVAL : 0;
+}
+
+/* radio_si4713_querycap - query device capabilities */
+static int radio_si4713_querycap(struct file *file, void *priv,
+   struct v4l2_capability *capability)
+{
+   struct radio_si4713_device *rsdev;
+
+   rsdev = video_get_drvdata(video_devdata(file));
+
+   strlcpy(capability-driver, radio-si4713, sizeof(capability-driver));
+   strlcpy(capability-card, Silicon Labs Si4713 Modulator,
+   sizeof(capability-card));
+   capability-capabilities = V4L2_CAP_MODULATOR | V4L2_CAP_RDS_OUTPUT;
+
+   return 0;
+}
+
+/* radio_si4713_queryctrl - enumerate control items */
+static int radio_si4713_queryctrl(struct file *file, void *priv,
+   struct v4l2_queryctrl *qc)
+{
+   /* Must be sorted from low to high control ID! */
+   static const u32 user_ctrls[] = {
+   V4L2_CID_USER_CLASS,
+   V4L2_CID_AUDIO_MUTE,
+   0
+   };
+
+   /* Must be sorted from low to high control ID! */
+   static const u32 fmtx_ctrls[] = {
+   V4L2_CID_FM_TX_CLASS,
+   V4L2_CID_RDS_TX_PI,
+   V4L2_CID_RDS_TX_PTY,
+   V4L2_CID_RDS_TX_DEVIATION

[PATCHv10 7/8] FMTx: si4713: Add Kconfig and Makefile entries

2009-07-24 Thread Eduardo Valentin
Simple add Makefile and Kconfig entries.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/drivers/media/radio/Kconfig  |   22 ++
 linux/drivers/media/radio/Makefile |2 ++
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/linux/drivers/media/radio/Kconfig 
b/linux/drivers/media/radio/Kconfig
index 3315cac..6c6a409 100644
--- a/linux/drivers/media/radio/Kconfig
+++ b/linux/drivers/media/radio/Kconfig
@@ -339,6 +339,28 @@ config RADIO_ZOLTRIX_PORT
help
  Enter the I/O port of your Zoltrix radio card.
 
+config I2C_SI4713
+   tristate I2C driver for Silicon Labs Si4713 device
+   depends on I2C  VIDEO_V4L2
+   ---help---
+ Say Y here if you want support to Si4713 I2C device.
+ This device driver supports only i2c bus.
+
+ To compile this driver as a module, choose M here: the
+ module will be called si4713.
+
+config RADIO_SI4713
+   tristate Silicon Labs Si4713 FM Radio Transmitter support
+   depends on I2C  VIDEO_V4L2
+   ---help---
+ Say Y here if you want support to Si4713 FM Radio Transmitter.
+ This device can transmit audio through FM. It can transmit
+ EDS and EBDS signals as well. This module is the v4l2 radio
+ interface for the i2c driver of this device.
+
+ To compile this driver as a module, choose M here: the
+ module will be called radio-si4713.
+
 config USB_DSBR
tristate D-Link/GemTek USB FM radio support
depends on USB  VIDEO_V4L2
diff --git a/linux/drivers/media/radio/Makefile 
b/linux/drivers/media/radio/Makefile
index 0f2b35b..34ae761 100644
--- a/linux/drivers/media/radio/Makefile
+++ b/linux/drivers/media/radio/Makefile
@@ -15,6 +15,8 @@ obj-$(CONFIG_RADIO_ZOLTRIX) += radio-zoltrix.o
 obj-$(CONFIG_RADIO_GEMTEK) += radio-gemtek.o
 obj-$(CONFIG_RADIO_GEMTEK_PCI) += radio-gemtek-pci.o
 obj-$(CONFIG_RADIO_TRUST) += radio-trust.o
+obj-$(CONFIG_I2C_SI4713) += si4713-i2c.o
+obj-$(CONFIG_RADIO_SI4713) += radio-si4713.o
 obj-$(CONFIG_RADIO_MAESTRO) += radio-maestro.o
 obj-$(CONFIG_USB_DSBR) += dsbr100.o
 obj-$(CONFIG_USB_SI470X) += radio-si470x.o
-- 
1.6.2.GIT

--
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


[PATCHv10 8/8] FMTx: si4713: Add document file

2009-07-24 Thread Eduardo Valentin
This patch adds a document file for si4713 device driver.
It describes the driver interfaces and organization.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/Documentation/video4linux/si4713.txt |  175 
 1 files changed, 175 insertions(+), 0 deletions(-)
 create mode 100644 linux/Documentation/video4linux/si4713.txt

diff --git a/linux/Documentation/video4linux/si4713.txt 
b/linux/Documentation/video4linux/si4713.txt
new file mode 100644
index 000..3843af5
--- /dev/null
+++ b/linux/Documentation/video4linux/si4713.txt
@@ -0,0 +1,175 @@
+Driver for I2C radios for the Silicon Labs Si4713 FM Radio Transmitters
+
+Copyright (c) 2009 Nokia Corporation
+Contact: Eduardo Valentin eduardo.valen...@nokia.com
+
+
+Information about the Device
+
+This chip is a Silicon Labs product. It is a I2C device, currently on 0×63 
address.
+Basically, it has transmission and signal noise level measurement features.
+
+The Si4713 integrates transmit functions for FM broadcast stereo transmission.
+The chip also allows integrated receive power scanning to identify low signal
+power FM channels.
+
+The chip is programmed using commands and responses. There are also several
+properties which can change the behavior of this chip.
+
+Users must comply with local regulations on radio frequency (RF) transmission.
+
+Device driver description
+=
+There are two modules to handle this device. One is a I2C device driver
+and the other is a platform driver.
+
+The I2C device driver exports a v4l2-subdev interface to the kernel.
+All properties can also be accessed by v4l2 extended controls interface, by
+using the v4l2-subdev calls (g_ext_ctrls, s_ext_ctrls).
+
+The platform device driver exports a v4l2 radio device interface to user land.
+So, it uses the I2C device driver as a sub device in order to send the user
+commands to the actual device. Basically it is a wrapper to the I2C device 
driver.
+
+Applications can use v4l2 radio API to specify frequency of operation, mute 
state,
+etc. But mostly of its properties will be present in the extended controls.
+
+When the v4l2 mute property is set to 1 (true), the driver will turn the chip 
off.
+
+Properties description
+==
+
+The properties can be accessed using v4l2 extended controls.
+Here is an output from v4l2-ctl util:
+
+# v4l2-ctl -d /dev/radio0 --all -l
+Driver Info:
+Driver name   : radio-si4713
+Card type : Silicon Labs Si4713 Modulator
+Bus info  : 
+Driver version: 0
+Capabilities  : 0x00080800
+RDS Output
+Modulator
+Audio output: 0 (FM Modulator Audio Out)
+Frequency: 1545600 (96.60 MHz)
+Video Standard = 0x
+Modulator:
+Name : FM Modulator
+Capabilities : 62.5 Hz stereo rds 
+Frequency range  : 76.0 MHz - 108.0 MHz
+Available subchannels: mono rds 
+
+User Controls
+
+   mute (bool) : default=1 value=0
+
+FM Radio Modulator Controls
+
+ rds_program_id (int)  : min=0 max=65535 step=1 default=0 
value=0
+   rds_program_type (int)  : min=0 max=31 step=1 default=0 value=0
+rds_ps_name (str)  : value='Si4713  ' len=1024
+' len=1024   rds_radio_text (str)  : value='Si4713  
+  audio_limiter_feature_enabled (bool) : default=1 value=1
+ audio_limiter_release_time (int)  : min=250 max=102390 step=50 
default=5010 value=5010 flags=slider
+audio_limiter_deviation (int)  : min=0 max=9 step=10 default=66250 
value=1020 flags=slider
+audio_compression_feature_enabl (bool) : default=1 value=1
+ audio_compression_gain (int)  : min=0 max=20 step=1 default=15 
value=15 flags=slider
+audio_compression_threshold (int)  : min=-40 max=0 step=1 default=-40 
value=-40 flags=slider
+  audio_compression_attack_time (int)  : min=0 max=5000 step=500 default=0 
value=0 flags=slider
+ audio_compression_release_time (int)  : min=10 max=100 step=10 
default=100 value=100 flags=slider
+ pilot_tone_feature_enabled (bool) : default=1 value=1
+   pilot_tone_deviation (int)  : min=0 max=9 step=10 default=6750 
value=6750 flags=slider
+   pilot_tone_frequency (int)  : min=0 max=19000 step=1 default=19000 
value=19000 flags=slider
+  pre_emphasis_settings (menu) : min=0 max=2 default=1 value=1
+   tune_power_level (int)  : min=0 max=120 step=1 default=88 
value=120 flags=slider
+ tune_antenna_capacitor (int)  : min=0 max=191 step=1 default=0 
value=112 flags=slider
+
+Here is a summary of them:
+
+* Pilot is an audible tone sent by the device.
+
+pilot_frequency - Configures the frequency of the stereo pilot tone.
+pilot_deviation - Configures pilot tone frequency deviation level.
+pilot_enabled - Enables or disables the pilot tone feature.
+
+* The si4713 device

[PATCH 1/1] v4l2-ctl: Add G_MODULATOR before set/get frequency

2009-07-24 Thread Eduardo Valentin
As there can be modulator devices with get/set frequency
callbacks, this patch adds support to them in v4l2-ctl utility.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 v4l2-apps/util/v4l2-ctl.cpp |   10 +-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/v4l2-apps/util/v4l2-ctl.cpp b/v4l2-apps/util/v4l2-ctl.cpp
index fc9e459..ff74177 100644
--- a/v4l2-apps/util/v4l2-ctl.cpp
+++ b/v4l2-apps/util/v4l2-ctl.cpp
@@ -1962,12 +1962,16 @@ int main(int argc, char **argv)
 
if (options[OptSetFreq]) {
double fac = 16;
+   struct v4l2_modulator mt;
 
+   memset(mt, 0, sizeof(struct v4l2_modulator));
if (doioctl(fd, VIDIOC_G_TUNER, tuner, VIDIOC_G_TUNER) == 0) 
{
fac = (tuner.capability  V4L2_TUNER_CAP_LOW) ? 16000 : 
16;
+   vf.type = tuner.type;
+   } else if (doioctl(fd, VIDIOC_G_MODULATOR, mt, 
VIDIOC_G_MODULATOR) == 0) {
+   fac = (mt.capability  V4L2_TUNER_CAP_LOW) ? 16000 : 16;
}
vf.tuner = 0;
-   vf.type = tuner.type;
vf.frequency = __u32(freq * fac);
if (doioctl(fd, VIDIOC_S_FREQUENCY, vf,
VIDIOC_S_FREQUENCY) == 0)
@@ -2418,9 +2422,13 @@ set_vid_fmt_error:
 
if (options[OptGetFreq]) {
double fac = 16;
+   struct v4l2_modulator mt;
 
+   memset(mt, 0, sizeof(struct v4l2_modulator));
if (doioctl(fd, VIDIOC_G_TUNER, tuner, VIDIOC_G_TUNER) == 0) 
{
fac = (tuner.capability  V4L2_TUNER_CAP_LOW) ? 16000 : 
16;
+   } else if (doioctl(fd, VIDIOC_G_MODULATOR, mt, 
VIDIOC_G_MODULATOR) == 0) {
+   fac = (mt.capability  V4L2_TUNER_CAP_LOW) ? 16000 : 16;
}
vf.tuner = 0;
if (doioctl(fd, VIDIOC_G_FREQUENCY, vf, VIDIOC_G_FREQUENCY) 
== 0)
-- 
1.6.2.GIT

--
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


[PATCHv9 6/9] FMTx: si4713: Add files to add radio interface for si4713

2009-06-22 Thread Eduardo Valentin
This patch adds files which creates the radio interface
for si4713 FM transmitter (modulator) devices.

In order to do the real access to device registers, this
driver uses the v4l2 subdev interface exported by si4713 i2c driver.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/drivers/media/radio/radio-si4713.c |  366 ++
 linux/include/media/radio-si4713.h   |   30 +++
 2 files changed, 396 insertions(+), 0 deletions(-)
 create mode 100644 linux/drivers/media/radio/radio-si4713.c
 create mode 100644 linux/include/media/radio-si4713.h

diff --git a/linux/drivers/media/radio/radio-si4713.c 
b/linux/drivers/media/radio/radio-si4713.c
new file mode 100644
index 000..5d6eab3
--- /dev/null
+++ b/linux/drivers/media/radio/radio-si4713.c
@@ -0,0 +1,366 @@
+/*
+ * drivers/media/radio/radio-si4713.c
+ *
+ * Platform Driver for Silicon Labs Si4713 FM Radio Transmitter:
+ *
+ * Copyright (c) 2008 Instituto Nokia de Tecnologia - INdT
+ * Contact: Eduardo Valentin eduardo.valen...@nokia.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include linux/kernel.h
+#include linux/module.h
+#include linux/init.h
+#include linux/version.h
+#include linux/platform_device.h
+#include linux/i2c.h
+#include linux/videodev2.h
+#include media/v4l2-device.h
+#include media/v4l2-common.h
+#include media/v4l2-ioctl.h
+#include media/radio-si4713.h
+
+/* module parameters */
+static int radio_nr = -1;  /* radio device minor (-1 == auto assign) */
+module_param(radio_nr, int, 0);
+MODULE_PARM_DESC(radio_nr,
+Minor number for radio device (-1 == auto assign));
+
+MODULE_LICENSE(GPL);
+MODULE_AUTHOR(Eduardo Valentin eduardo.valen...@nokia.com);
+MODULE_DESCRIPTION(Platform driver for Si4713 FM Radio Transmitter);
+MODULE_VERSION(0.0.1);
+
+/* Driver state struct */
+struct radio_si4713_device {
+   struct v4l2_device  v4l2_dev;
+   struct video_device *radio_dev;
+};
+
+/* radio_si4713_fops - file operations interface */
+static const struct v4l2_file_operations radio_si4713_fops = {
+   .owner  = THIS_MODULE,
+   .ioctl  = video_ioctl2,
+};
+
+/* Video4Linux Interface */
+static int radio_si4713_fill_audout(struct v4l2_audioout *vao)
+{
+   /* TODO: check presence of audio output */
+   strlcpy(vao-name, FM Modulator Audio Out, 32);
+
+   return 0;
+}
+
+static int radio_si4713_enumaudout(struct file *file, void *priv,
+   struct v4l2_audioout *vao)
+{
+   return radio_si4713_fill_audout(vao);
+}
+
+static int radio_si4713_g_audout(struct file *file, void *priv,
+   struct v4l2_audioout *vao)
+{
+   int rval = radio_si4713_fill_audout(vao);
+
+   vao-index = 0;
+
+   return rval;
+}
+
+static int radio_si4713_s_audout(struct file *file, void *priv,
+   struct v4l2_audioout *vao)
+{
+   return vao-index ? -EINVAL : 0;
+}
+
+/* radio_si4713_querycap - query device capabilities */
+static int radio_si4713_querycap(struct file *file, void *priv,
+   struct v4l2_capability *capability)
+{
+   struct radio_si4713_device *rsdev;
+
+   rsdev = video_get_drvdata(video_devdata(file));
+
+   strlcpy(capability-driver, radio-si4713, sizeof(capability-driver));
+   strlcpy(capability-card, Silicon Labs Si4713 Modulator,
+   sizeof(capability-card));
+   capability-capabilities = V4L2_CAP_MODULATOR | V4L2_CAP_RDS_OUTPUT;
+
+   return 0;
+}
+
+/* radio_si4713_queryctrl - enumerate control items */
+static int radio_si4713_queryctrl(struct file *file, void *priv,
+   struct v4l2_queryctrl *qc)
+{
+   /* Must be sorted from low to high control ID! */
+   static const u32 user_ctrls[] = {
+   V4L2_CID_USER_CLASS,
+   V4L2_CID_AUDIO_MUTE,
+   0
+   };
+
+   /* Must be sorted from low to high control ID! */
+   static const u32 fmtx_ctrls[] = {
+   V4L2_CID_FM_TX_CLASS,
+   V4L2_CID_RDS_TX_PI,
+   V4L2_CID_RDS_TX_PTY,
+   V4L2_CID_RDS_TX_PS_NAME

[PATCHv9 8/9] FMTx: si4713: Add Kconfig and Makefile entries

2009-06-22 Thread Eduardo Valentin
Simple add Makefile and Kconfig entries.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/drivers/media/radio/Kconfig  |   22 ++
 linux/drivers/media/radio/Makefile |2 ++
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/linux/drivers/media/radio/Kconfig 
b/linux/drivers/media/radio/Kconfig
index 3315cac..6c6a409 100644
--- a/linux/drivers/media/radio/Kconfig
+++ b/linux/drivers/media/radio/Kconfig
@@ -339,6 +339,28 @@ config RADIO_ZOLTRIX_PORT
help
  Enter the I/O port of your Zoltrix radio card.
 
+config I2C_SI4713
+   tristate I2C driver for Silicon Labs Si4713 device
+   depends on I2C  VIDEO_V4L2
+   ---help---
+ Say Y here if you want support to Si4713 I2C device.
+ This device driver supports only i2c bus.
+
+ To compile this driver as a module, choose M here: the
+ module will be called si4713.
+
+config RADIO_SI4713
+   tristate Silicon Labs Si4713 FM Radio Transmitter support
+   depends on I2C  VIDEO_V4L2
+   ---help---
+ Say Y here if you want support to Si4713 FM Radio Transmitter.
+ This device can transmit audio through FM. It can transmit
+ EDS and EBDS signals as well. This module is the v4l2 radio
+ interface for the i2c driver of this device.
+
+ To compile this driver as a module, choose M here: the
+ module will be called radio-si4713.
+
 config USB_DSBR
tristate D-Link/GemTek USB FM radio support
depends on USB  VIDEO_V4L2
diff --git a/linux/drivers/media/radio/Makefile 
b/linux/drivers/media/radio/Makefile
index 0f2b35b..34ae761 100644
--- a/linux/drivers/media/radio/Makefile
+++ b/linux/drivers/media/radio/Makefile
@@ -15,6 +15,8 @@ obj-$(CONFIG_RADIO_ZOLTRIX) += radio-zoltrix.o
 obj-$(CONFIG_RADIO_GEMTEK) += radio-gemtek.o
 obj-$(CONFIG_RADIO_GEMTEK_PCI) += radio-gemtek-pci.o
 obj-$(CONFIG_RADIO_TRUST) += radio-trust.o
+obj-$(CONFIG_I2C_SI4713) += si4713-i2c.o
+obj-$(CONFIG_RADIO_SI4713) += radio-si4713.o
 obj-$(CONFIG_RADIO_MAESTRO) += radio-maestro.o
 obj-$(CONFIG_USB_DSBR) += dsbr100.o
 obj-$(CONFIG_USB_SI470X) += radio-si470x.o
-- 
1.6.2.GIT

--
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


[PATCHv9 1/9] v4l2-subdev.h: Add g_modulator callbacks to subdev api

2009-06-22 Thread Eduardo Valentin
Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/include/media/v4l2-subdev.h |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/linux/include/media/v4l2-subdev.h 
b/linux/include/media/v4l2-subdev.h
index 5dcb367..4dc3788 100644
--- a/linux/include/media/v4l2-subdev.h
+++ b/linux/include/media/v4l2-subdev.h
@@ -137,6 +137,8 @@ struct v4l2_subdev_tuner_ops {
int (*g_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq);
int (*g_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
int (*s_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
+   int (*g_modulator)(struct v4l2_subdev *sd, struct v4l2_modulator *vm);
+   int (*s_modulator)(struct v4l2_subdev *sd, struct v4l2_modulator *vm);
int (*s_type_addr)(struct v4l2_subdev *sd, struct tuner_setup *type);
int (*s_config)(struct v4l2_subdev *sd, const struct 
v4l2_priv_tun_config *config);
int (*s_standby)(struct v4l2_subdev *sd);
-- 
1.6.2.GIT

--
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


[PATCHv9 5/9] v4l2-spec: Add documentation description for FM TX extended control class

2009-06-22 Thread Eduardo Valentin
This single patch adds documentation description for FM Modulator (FM_TX)
Extended Control Class and its Control IDs. The text was added under
Extended Controls section.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 v4l2-spec/Makefile  |1 +
 v4l2-spec/controls.sgml |  200 +++
 2 files changed, 201 insertions(+), 0 deletions(-)

diff --git a/v4l2-spec/Makefile b/v4l2-spec/Makefile
index 7a19924..6b46433 100644
--- a/v4l2-spec/Makefile
+++ b/v4l2-spec/Makefile
@@ -242,6 +242,7 @@ ENUMS = \
v4l2_power_line_frequency \
v4l2_priority \
v4l2_tuner_type \
+   v4l2_preemphasis \
 
 STRUCTS = \
v4l2_audio \
diff --git a/v4l2-spec/controls.sgml b/v4l2-spec/controls.sgml
index 477a970..205a7a6 100644
--- a/v4l2-spec/controls.sgml
+++ b/v4l2-spec/controls.sgml
@@ -458,6 +458,12 @@ video is actually encoded into that format./para
   paraUnfortunately, the original control API lacked some
 features needed for these new uses and so it was extended into the
 (not terribly originally named) extended control API./para
+
+  paraEven though the MPEG encoding API was the first effort
+to use the Extended Control API, nowadays there are also other classes
+of Extended Controls, such as Camera Controls and FM Transmitter Controls.
+The Extended Controls API as well as all Extended Controls classes are
+described in the following text./para
 /section
 
 section
@@ -1816,6 +1822,200 @@ control must support read access and may support write 
access./entry
   /tgroup
 /table
   /section
+
+section id=fm-tx-controls
+  titleFM Transmitter Control Reference/title
+
+  paraThe FM Transmitter (FM_TX) class includes controls for common 
features of
+FM transmissions capable devices. Currently this class include parameters for 
audio
+compression, pilot tone generation, audio deviation limiter, RDS transmission 
and
+tuning power features./para
+
+  table pgwide=1 frame=none id=fm-tx-control-id
+  titleFM_TX Control IDs/title
+
+  tgroup cols=4
+   colspec colname=c1 colwidth=1*
+   colspec colname=c2 colwidth=6*
+   colspec colname=c3 colwidth=2*
+   colspec colname=c4 colwidth=6*
+   spanspec namest=c1 nameend=c2 spanname=id
+   spanspec namest=c2 nameend=c4 spanname=descr
+   thead
+ row
+   entry spanname=id align=leftID/entry
+   entry align=leftType/entry
+ /rowrow rowsep=1entry spanname=descr 
align=leftDescription/entry
+ /row
+   /thead
+   tbody valign=top
+ rowentry/entry/row
+ row
+   entry 
spanname=idconstantV4L2_CID_FM_TX_CLASS/constantnbsp;/entry
+   entryclass/entry
+ /rowrowentry spanname=descrThe FM_TX class
+descriptor. Calling VIDIOC-QUERYCTRL; for this control will return a
+description of this control class./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_PI/constantnbsp;/entry
+   entryinteger/entry
+ /row
+ rowentry spanname=descrSets the RDS Programme Identification 
field
+for transmission./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_PTY/constantnbsp;/entry
+   entryinteger/entry
+ /row
+ rowentry spanname=descrSets the RDS Programme Type field for 
transmission.
+This encodes up to 31 pre-defined programme types./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_PS_NAME/constantnbsp;/entry
+   entrystring/entry
+ /row
+ rowentry spanname=descrSets the Programme Service name 
(PS_NAME) for transmission.
+It is intended for static display on a receiver. It is the primary aid to 
listeners in programme service
+identification and selection. The use of PS to transmit text other than a 
single eight character name is not permitted./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_RADIO_TEXT/constantnbsp;/entry
+   entrystring/entry
+ /row
+ rowentry spanname=descrSets the Radio Text info for 
transmission. It is a textual description of
+what is being broadcasted. RDS Radio Text can be applied when broadcaster 
wishes to transmit longer PS names,
+programme-related information or any other text. In these cases, RadioText 
should be used in addition to
+constantV4L2_CID_RDS_TX_PS_NAME/constant./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_AUDIO_LIMITER_ENABLED/constantnbsp;/entry
+   entryboolean/entry
+ /row
+ rowentry spanname=descrEnables or disables the audio deviation 
limiter feature.
+The limiter is useful when trying to maximize the audio volume, minimize 
receiver-generated
+distortion and prevent overmodulation.
+/entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_AUDIO_LIMITER_RELEASE_TIME

[PATCHv9 0/9] FM Transmitter (si4713) and another changes

2009-06-22 Thread Eduardo Valentin
Hello all,

  First of all, I'd like to thank you for the good review. The driver
is getting better and better. With this new API change, si4713 is looking
like a fm transmitter driver.

  So, I'm resending the FM transmitter driver and the proposed changes in
v4l2 api files in order to cover the fmtx extended controls class.

  Differences from version #8 are:
- Use of new modulator Capabilities
- Use of new RDS modulator Capabilities and usage of txsubchannel
- Proper definition of struct si4713_rssi. It was renamed also to si4713_rnl
  (which stands to received noise level)
- Updates for documentation

  Now this series is based on *three* of Hans' trees:
http://www.linuxtv.org/hg/~hverkuil/v4l-dvb-subdev2.
http://www.linuxtv.org/hg/~hverkuil/v4l-dvb-str.
http://www.linuxtv.org/hg/~hverkuil/v4l-dvb-rds-enc.

  The first tree has refactoring of v4l2 i2c helper functions. The second
one has string support for extended controls, which is used in this driver.
And the last one is the proposed changes for RDS capable modulators/receivers.
As the ~hverkuil/v4l-dvb-rds-enc has already reference for EN50067, I didn't
touch the v4l2-spec/biblio.sgml.

  Here is simplified list of things included in this series:
- support for g/s_modulator into subdev api
- addition of fm tx extended controls and their proper documentation
- addition of fm tx extended controls in v4l2-ctl util
- addition of si4713: platform and i2c drivers and its documentation

BR,


Eduardo Valentin (9):
  v4l2-subdev.h: Add g_modulator callbacks to subdev api
  v4l2: video device: Add V4L2_CTRL_CLASS_FM_TX controls
  v4l2: video device: Add FM_TX controls default configurations
  v4l2-ctl: Add support for FM TX controls
  v4l2-spec: Add documentation description for FM TX extended control
class
  FMTx: si4713: Add files to add radio interface for si4713
  FMTx: si4713: Add files to handle si4713 i2c device
  FMTx: si4713: Add Kconfig and Makefile entries
  FMTx: si4713: Add document file

 linux/Documentation/video4linux/si4713.txt |  175 +++
 linux/drivers/media/radio/Kconfig  |   22 +
 linux/drivers/media/radio/Makefile |2 +
 linux/drivers/media/radio/radio-si4713.c   |  366 +
 linux/drivers/media/radio/si4713-i2c.c | 2011 
 linux/drivers/media/radio/si4713-i2c.h |  226 
 linux/drivers/media/video/v4l2-common.c|   48 +
 linux/include/linux/videodev2.h|   33 +
 linux/include/media/radio-si4713.h |   30 +
 linux/include/media/si4713.h   |   49 +
 linux/include/media/v4l2-subdev.h  |2 +
 v4l2-apps/util/v4l2-ctl.cpp|   36 +
 v4l2-spec/Makefile |1 +
 v4l2-spec/controls.sgml|  200 +++
 14 files changed, 3201 insertions(+), 0 deletions(-)
 create mode 100644 linux/Documentation/video4linux/si4713.txt
 create mode 100644 linux/drivers/media/radio/radio-si4713.c
 create mode 100644 linux/drivers/media/radio/si4713-i2c.c
 create mode 100644 linux/drivers/media/radio/si4713-i2c.h
 create mode 100644 linux/include/media/radio-si4713.h
 create mode 100644 linux/include/media/si4713.h

--
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


[PATCHv9 4/9] v4l2-ctl: Add support for FM TX controls

2009-06-22 Thread Eduardo Valentin
This patch adds simple support for FM TX extended controls
on v4l2-ctl utility.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 v4l2-apps/util/v4l2-ctl.cpp |   36 
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/v4l2-apps/util/v4l2-ctl.cpp b/v4l2-apps/util/v4l2-ctl.cpp
index 7a4cf0e..0399eb1 100644
--- a/v4l2-apps/util/v4l2-ctl.cpp
+++ b/v4l2-apps/util/v4l2-ctl.cpp
@@ -148,6 +148,7 @@ typedef std::vectorstruct v4l2_ext_control ctrl_list;
 static ctrl_list user_ctrls;
 static ctrl_list mpeg_ctrls;
 static ctrl_list camera_ctrls;
+static ctrl_list fm_tx_ctrls;
 
 typedef std::mapstd::string, unsigned ctrl_strmap;
 static ctrl_strmap ctrl_str2id;
@@ -2181,6 +2182,8 @@ set_vid_fmt_error:
mpeg_ctrls.push_back(ctrl);
else if (V4L2_CTRL_ID2CLASS(ctrl.id) == 
V4L2_CTRL_CLASS_CAMERA)
camera_ctrls.push_back(ctrl);
+   else if (V4L2_CTRL_ID2CLASS(ctrl.id) == 
V4L2_CTRL_CLASS_FM_TX)
+   fm_tx_ctrls.push_back(ctrl);
else
user_ctrls.push_back(ctrl);
}
@@ -2227,6 +2230,22 @@ set_vid_fmt_error:
}
}
}
+   if (fm_tx_ctrls.size()) {
+   ctrls.ctrl_class = V4L2_CTRL_CLASS_FM_TX;
+   ctrls.count = fm_tx_ctrls.size();
+   ctrls.controls = fm_tx_ctrls[0];
+   if (doioctl(fd, VIDIOC_S_EXT_CTRLS, ctrls, 
VIDIOC_S_EXT_CTRLS)) {
+   if (ctrls.error_idx = ctrls.count) {
+   fprintf(stderr, Error setting FM 
Modulator controls: %s\n,
+   strerror(errno));
+   }
+   else {
+   fprintf(stderr, %s: %s\n,
+   
ctrl_id2str[fm_tx_ctrls[ctrls.error_idx].id].c_str(),
+   strerror(errno));
+   }
+   }
+   }
}
 
/* Get options */
@@ -2444,6 +2463,7 @@ set_vid_fmt_error:
mpeg_ctrls.clear();
camera_ctrls.clear();
user_ctrls.clear();
+   fm_tx_ctrls.clear();
for (ctrl_get_list::iterator iter = get_ctrls.begin();
iter != get_ctrls.end(); ++iter) {
struct v4l2_ext_control ctrl = { 0 };
@@ -2458,6 +2478,8 @@ set_vid_fmt_error:
mpeg_ctrls.push_back(ctrl);
else if (V4L2_CTRL_ID2CLASS(ctrl.id) == 
V4L2_CTRL_CLASS_CAMERA)
camera_ctrls.push_back(ctrl);
+   else if (V4L2_CTRL_ID2CLASS(ctrl.id) == 
V4L2_CTRL_CLASS_FM_TX)
+   fm_tx_ctrls.push_back(ctrl);
else
user_ctrls.push_back(ctrl);
}
@@ -2496,6 +2518,20 @@ set_vid_fmt_error:
printf(%s: %d\n, 
ctrl_id2str[ctrl.id].c_str(), ctrl.value);
}
}
+   if (fm_tx_ctrls.size()) {
+   ctrls.ctrl_class = V4L2_CTRL_CLASS_FM_TX;
+   ctrls.count = fm_tx_ctrls.size();
+   ctrls.controls = fm_tx_ctrls[0];
+   doioctl(fd, VIDIOC_G_EXT_CTRLS, ctrls, 
VIDIOC_G_EXT_CTRLS);
+   for (unsigned i = 0; i  fm_tx_ctrls.size(); i++) {
+   struct v4l2_ext_control ctrl = fm_tx_ctrls[i];
+
+   if (ctrl_id2type[ctrl.id] == 
V4L2_CTRL_TYPE_STRING)
+   printf(%s: '%s'\n, 
ctrl_id2str[ctrl.id].c_str(), ctrl.string);
+   else
+   printf(%s: %d\n, 
ctrl_id2str[ctrl.id].c_str(), ctrl.value);
+   }
+   }
}
 
if (options[OptGetTuner]) {
-- 
1.6.2.GIT

--
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


[PATCHv9 2/9] v4l2: video device: Add V4L2_CTRL_CLASS_FM_TX controls

2009-06-22 Thread Eduardo Valentin
This patch adds a new class of extended controls. This class
is intended to support FM Radio Modulators properties such as:
rds, audio limiters, audio compression, pilot tone generation,
tuning power levels and preemphasis properties.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/include/linux/videodev2.h |   33 +
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h
index 50aa92b..8bd7810 100644
--- a/linux/include/linux/videodev2.h
+++ b/linux/include/linux/videodev2.h
@@ -809,6 +809,7 @@ struct v4l2_ext_controls {
 #define V4L2_CTRL_CLASS_USER 0x0098/* Old-style 'user' controls */
 #define V4L2_CTRL_CLASS_MPEG 0x0099/* MPEG-compression controls */
 #define V4L2_CTRL_CLASS_CAMERA 0x009a  /* Camera class controls */
+#define V4L2_CTRL_CLASS_FM_TX 0x009b   /* FM Modulator control class */
 
 #define V4L2_CTRL_ID_MASK(0x0fff)
 #define V4L2_CTRL_ID2CLASS(id)((id)  0x0fffUL)
@@ -1148,6 +1149,38 @@ enum  v4l2_exposure_auto_type {
 
 #define V4L2_CID_PRIVACY   (V4L2_CID_CAMERA_CLASS_BASE+16)
 
+/* FM Modulator class control IDs */
+#define V4L2_CID_FM_TX_CLASS_BASE  (V4L2_CTRL_CLASS_FM_TX | 0x900)
+#define V4L2_CID_FM_TX_CLASS   (V4L2_CTRL_CLASS_FM_TX | 1)
+
+#define V4L2_CID_RDS_TX_PI (V4L2_CID_FM_TX_CLASS_BASE + 1)
+#define V4L2_CID_RDS_TX_PTY(V4L2_CID_FM_TX_CLASS_BASE + 2)
+#define V4L2_CID_RDS_TX_PS_NAME
(V4L2_CID_FM_TX_CLASS_BASE + 3)
+#define V4L2_CID_RDS_TX_RADIO_TEXT (V4L2_CID_FM_TX_CLASS_BASE + 4)
+
+#define V4L2_CID_AUDIO_LIMITER_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 5)
+#define V4L2_CID_AUDIO_LIMITER_RELEASE_TIME(V4L2_CID_FM_TX_CLASS_BASE + 6)
+#define V4L2_CID_AUDIO_LIMITER_DEVIATION   (V4L2_CID_FM_TX_CLASS_BASE + 7)
+
+#define V4L2_CID_AUDIO_COMPRESSION_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 8)
+#define V4L2_CID_AUDIO_COMPRESSION_GAIN
(V4L2_CID_FM_TX_CLASS_BASE + 9)
+#define V4L2_CID_AUDIO_COMPRESSION_THRESHOLD   (V4L2_CID_FM_TX_CLASS_BASE + 10)
+#define V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME (V4L2_CID_FM_TX_CLASS_BASE + 11)
+#define V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME
(V4L2_CID_FM_TX_CLASS_BASE + 12)
+
+#define V4L2_CID_PILOT_TONE_ENABLED(V4L2_CID_FM_TX_CLASS_BASE + 13)
+#define V4L2_CID_PILOT_TONE_DEVIATION  (V4L2_CID_FM_TX_CLASS_BASE + 14)
+#define V4L2_CID_PILOT_TONE_FREQUENCY  (V4L2_CID_FM_TX_CLASS_BASE + 15)
+
+#define V4L2_CID_FM_TX_PREEMPHASIS (V4L2_CID_FM_TX_CLASS_BASE + 16)
+enum v4l2_preemphasis {
+   V4L2_PREEMPHASIS_DISABLED   = 0,
+   V4L2_PREEMPHASIS_50_uS  = 1,
+   V4L2_PREEMPHASIS_75_uS  = 2,
+};
+#define V4L2_CID_TUNE_POWER_LEVEL  (V4L2_CID_FM_TX_CLASS_BASE + 17)
+#define V4L2_CID_TUNE_ANTENNA_CAPACITOR
(V4L2_CID_FM_TX_CLASS_BASE + 18)
+
 /*
  * T U N I N G
  */
-- 
1.6.2.GIT

--
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


[PATCHv9 9/9] FMTx: si4713: Add document file

2009-06-22 Thread Eduardo Valentin
This patch adds a document file for si4713 device driver.
It describes the driver interfaces and organization.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/Documentation/video4linux/si4713.txt |  175 
 1 files changed, 175 insertions(+), 0 deletions(-)
 create mode 100644 linux/Documentation/video4linux/si4713.txt

diff --git a/linux/Documentation/video4linux/si4713.txt 
b/linux/Documentation/video4linux/si4713.txt
new file mode 100644
index 000..2bc219a
--- /dev/null
+++ b/linux/Documentation/video4linux/si4713.txt
@@ -0,0 +1,175 @@
+Driver for I2C radios for the Silicon Labs Si4713 FM Radio Transmitters
+
+Copyright (c) 2009 Nokia Corporation
+Contact: Eduardo Valentin eduardo.valen...@nokia.com
+
+
+Information about the Device
+
+This chip is a Silicon Labs product. It is a I2C device, currently on 0×63 
address.
+Basically, it has transmission and signal noise level measurement features.
+
+The Si4713 integrates transmit functions for FM broadcast stereo transmission.
+The chip also allows integrated receive power scanning to identify low signal
+power FM channels.
+
+The chip is programmed using commands and responses. There are also several
+properties which can change the behavior of this chip.
+
+Users must comply with local regulations on radio frequency (RF) transmission.
+
+Device driver description
+=
+There are two modules to handle this device. One is a I2C device driver
+and the other is a platform driver.
+
+The I2C device driver exports a v4l2-subdev interface to the kernel.
+All properties can also be accessed by v4l2 extended controls interface, by
+using the v4l2-subdev calls (g_ext_ctrls, s_ext_ctrls).
+
+The platform device driver exports a v4l2 radio device interface to user land.
+So, it uses the I2C device driver as a sub device in order to send the user
+commands to the actual device. Basically it is a wrapper to the I2C device 
driver.
+
+Applications can use v4l2 radio API to specify frequency of operation, mute 
state,
+etc. But mostly of its properties will be present in the extended controls.
+
+When the v4l2 mute property is set to 1 (true), the driver will turn the chip 
off.
+
+Properties description
+==
+
+The properties can be accessed using v4l2 extended controls.
+Here is an output from v4l2-ctl util:
+
+# v4l2-ctl -d /dev/radio0 --all -l
+Driver Info:
+Driver name   : radio-si4713
+Card type : Silicon Labs Si4713 Modulator
+Bus info  : 
+Driver version: 0
+Capabilities  : 0x00080800
+RDS Output
+Modulator
+Audio output: 0 (FM Modulator Audio Out)
+Frequency: 1408000 (88000.00 MHz)
+Video Standard = 0x
+Modulator:
+Name : FM Modulator
+Capabilities : 62.5 Hz stereo rds 
+Frequency range  : 76.0 MHz - 108.0 MHz
+Available subchannels: mono rds 
+
+User Controls
+
+   mute (bool) : default=1 value=0
+
+FM Radio Modulator Controls
+
+ rds_program_id (int)  : min=0 max=65535 step=1 default=0 
value=0
+   rds_program_type (int)  : min=0 max=31 step=1 default=0 value=0
+rds_ps_name (str)  : value='Si4713  ' len=1024
+' len=1024   rds_radio_text (str)  : value='Si4713  
+  audio_limiter_feature_enabled (bool) : default=1 value=1
+ audio_limiter_release_time (int)  : min=250 max=102390 step=50 
default=5010 value=5010 flags=slider
+audio_limiter_deviation (int)  : min=0 max=9 step=10 default=66250 
value=1020 flags=slider
+audio_compression_feature_enabl (bool) : default=1 value=1
+ audio_compression_gain (int)  : min=0 max=20 step=1 default=15 
value=15 flags=slider
+audio_compression_threshold (int)  : min=-40 max=0 step=1 default=-40 
value=-40 flags=slider
+  audio_compression_attack_time (int)  : min=0 max=5000 step=500 default=0 
value=0 flags=slider
+ audio_compression_release_time (int)  : min=10 max=100 step=10 
default=100 value=100 flags=slider
+ pilot_tone_feature_enabled (bool) : default=1 value=1
+   pilot_tone_deviation (int)  : min=0 max=9 step=10 default=6750 
value=6750 flags=slider
+   pilot_tone_frequency (int)  : min=0 max=19000 step=1 default=19000 
value=19000 flags=slider
+  pre_emphasis_settings (menu) : min=0 max=2 default=1 value=1
+   tune_power_level (int)  : min=0 max=120 step=1 default=88 
value=120 flags=slider
+ tune_antenna_capacitor (int)  : min=0 max=191 step=1 default=0 
value=112 flags=slider
+
+Here is a summary of them:
+
+* Pilot is an audible tone sent by the device.
+
+pilot_frequency - Configures the frequency of the stereo pilot tone.
+pilot_deviation - Configures pilot tone frequency deviation level.
+pilot_enabled - Enables or disables the pilot tone feature.
+
+* The si4713

[PATCHv9 3/9] v4l2: video device: Add FM_TX controls default configurations

2009-06-22 Thread Eduardo Valentin
Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/drivers/media/video/v4l2-common.c |   48 +++
 1 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/linux/drivers/media/video/v4l2-common.c 
b/linux/drivers/media/video/v4l2-common.c
index 1f0b8ef..e5b3f6e 100644
--- a/linux/drivers/media/video/v4l2-common.c
+++ b/linux/drivers/media/video/v4l2-common.c
@@ -345,6 +345,12 @@ const char **v4l2_ctrl_get_menu(u32 id)
Sepia,
NULL
};
+   static const char *fm_tx_preemphasis[] = {
+   No preemphasis,
+   50 useconds,
+   75 useconds,
+   NULL,
+   };
 
switch (id) {
case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ:
@@ -383,6 +389,8 @@ const char **v4l2_ctrl_get_menu(u32 id)
return camera_exposure_auto;
case V4L2_CID_COLORFX:
return colorfx;
+   case V4L2_CID_FM_TX_PREEMPHASIS:
+   return fm_tx_preemphasis;
default:
return NULL;
}
@@ -481,6 +489,27 @@ const char *v4l2_ctrl_get_name(u32 id)
case V4L2_CID_ZOOM_CONTINUOUS:  return Zoom, Continuous;
case V4L2_CID_PRIVACY:  return Privacy;
 
+   /* FM Radio Modulator control */
+   case V4L2_CID_FM_TX_CLASS:  return FM Radio Modulator 
Controls;
+   case V4L2_CID_RDS_TX_PI:return RDS Program ID;
+   case V4L2_CID_RDS_TX_PTY:   return RDS Program Type;
+   case V4L2_CID_RDS_TX_PS_NAME:   return RDS PS Name;
+   case V4L2_CID_RDS_TX_RADIO_TEXT:return RDS Radio Text;
+   case V4L2_CID_AUDIO_LIMITER_ENABLED:return Audio Limiter Feature 
Enabled;
+   case V4L2_CID_AUDIO_LIMITER_RELEASE_TIME: return Audio Limiter Release 
Time;
+   case V4L2_CID_AUDIO_LIMITER_DEVIATION:  return Audio Limiter 
Deviation;
+   case V4L2_CID_AUDIO_COMPRESSION_ENABLED: return Audio Compression 
Feature Enabled;
+   case V4L2_CID_AUDIO_COMPRESSION_GAIN:   return Audio Compression Gain;
+   case V4L2_CID_AUDIO_COMPRESSION_THRESHOLD: return Audio Compression 
Threshold;
+   case V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME: return Audio Compression 
Attack Time;
+   case V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME: return Audio Compression 
Release Time;
+   case V4L2_CID_PILOT_TONE_ENABLED:   return Pilot Tone Feature 
Enabled;
+   case V4L2_CID_PILOT_TONE_DEVIATION: return Pilot Tone Deviation;
+   case V4L2_CID_PILOT_TONE_FREQUENCY: return Pilot Tone Frequency;
+   case V4L2_CID_FM_TX_PREEMPHASIS:return Pre-emphasis settings;
+   case V4L2_CID_TUNE_POWER_LEVEL: return Tune Power Level;
+   case V4L2_CID_TUNE_ANTENNA_CAPACITOR:   return Tune Antenna Capacitor;
+
default:
return NULL;
}
@@ -513,6 +542,9 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 
min, s32 max, s32 ste
case V4L2_CID_EXPOSURE_AUTO_PRIORITY:
case V4L2_CID_FOCUS_AUTO:
case V4L2_CID_PRIVACY:
+   case V4L2_CID_AUDIO_LIMITER_ENABLED:
+   case V4L2_CID_AUDIO_COMPRESSION_ENABLED:
+   case V4L2_CID_PILOT_TONE_ENABLED:
qctrl-type = V4L2_CTRL_TYPE_BOOLEAN;
min = 0;
max = step = 1;
@@ -541,12 +573,18 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, 
s32 min, s32 max, s32 ste
case V4L2_CID_MPEG_STREAM_VBI_FMT:
case V4L2_CID_EXPOSURE_AUTO:
case V4L2_CID_COLORFX:
+   case V4L2_CID_FM_TX_PREEMPHASIS:
qctrl-type = V4L2_CTRL_TYPE_MENU;
step = 1;
break;
+   case V4L2_CID_RDS_TX_PS_NAME:
+   case V4L2_CID_RDS_TX_RADIO_TEXT:
+   qctrl-type = V4L2_CTRL_TYPE_STRING;
+   break;
case V4L2_CID_USER_CLASS:
case V4L2_CID_CAMERA_CLASS:
case V4L2_CID_MPEG_CLASS:
+   case V4L2_CID_FM_TX_CLASS:
qctrl-type = V4L2_CTRL_TYPE_CTRL_CLASS;
qctrl-flags |= V4L2_CTRL_FLAG_READ_ONLY;
min = max = step = def = 0;
@@ -575,6 +613,16 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 
min, s32 max, s32 ste
case V4L2_CID_BLUE_BALANCE:
case V4L2_CID_GAMMA:
case V4L2_CID_SHARPNESS:
+   case V4L2_CID_AUDIO_LIMITER_RELEASE_TIME:
+   case V4L2_CID_AUDIO_LIMITER_DEVIATION:
+   case V4L2_CID_AUDIO_COMPRESSION_GAIN:
+   case V4L2_CID_AUDIO_COMPRESSION_THRESHOLD:
+   case V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME:
+   case V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME:
+   case V4L2_CID_PILOT_TONE_DEVIATION:
+   case V4L2_CID_PILOT_TONE_FREQUENCY:
+   case V4L2_CID_TUNE_POWER_LEVEL:
+   case V4L2_CID_TUNE_ANTENNA_CAPACITOR:
qctrl-flags |= V4L2_CTRL_FLAG_SLIDER;
break

Re: RFC: FM modulator and RDS encoder V4L2 API additions

2009-06-20 Thread Eduardo Valentin
Hi Hans,

On Sat, Jun 20, 2009 at 03:05:24PM +0200, ext Hans Verkuil wrote:
 Hi all,
 
 Besides the new RDS controls implemented by Eduardo we also need a few 
 additions to the V4L2 API.
 
 First of all we need two new capabilities for struct v4l2_capability:
 
 #define V4L2_CAP_RDS_OUTPUT 0x800 /* Is an RDS encoder */
 #define V4L2_CAP_MODULATOR0x0008000 /* has a modulator */
 
 The current V4L2 spec says in section 1.6.2 that you should set 
 V4L2_CAP_TUNER when you have a modulator. I see absolutely no reason why we 
 shouldn't add a proper CAP_MODULATOR instead. Almost all caps already come 
 in an input and output variant, so it also makes sense to have a tuner and 
 a separate modulator capability. Since Eduardo's FM transmitter is the 
 first driver with a modulator that will go into the tree we do not have to 
 worry about backwards compatibility, so I think we should fix this weird 
 rule.
 
 For the same reason we should add an RDS_OUTPUT capability since not all FM 
 transmitters might have a RDS encoder. Again, this is also consistent with 
 the V4L2_CAP_RDS_CAPTURE capability that we already have.
 
 The RDS decoder API adds a new v4l2_tuner RDS capability and RDS subchannel 
 flag. These are reused in v4l2_modulator. If the RDS capability is set, 
 then the modulator can encode RDS. If the V4L2_TUNER_SUB_RDS channel is 
 specified in txsubchans, then the transmitter will turn on the RDS encoder, 
 otherwise it is turned off. This is consistent with the way txsubchans is 
 used for the audio modulation.
 
 Eduardo, this will replace the RDS_TX_ENABLED control, so if this goes in 
 then that control has to be removed.

I like this approach. Looks cleaner. How about moving some of the *_ENABLED 
features
from FM TX class to a CAP flag? As you are proposing for RDS? I mean, some of 
them
are consistent with audio modulation (copying from my patch):

+#define V4L2_CID_RDS_TX_ENABLED
(V4L2_CID_FM_TX_CLASS_BASE + 1)

This one you are already proposing to move to a CAP flag.

+#define V4L2_CID_AUDIO_LIMITER_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 6)
This is relevant to modulators which apply some sort of dynamic audio control to
maximize audio volume and minimize receiver-generated distortion. Also important
to prevent audio over-modulation.

+#define V4L2_CID_AUDIO_COMPRESSION_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 9)
Enables or disables the audio compression feature.
This feature amplifies signals below the threshold by a fixed gain and 
compresses audio
signals above the threshold by the ratio of Threshold/(Gain + Threshold).

+
+#define V4L2_CID_PILOT_TONE_ENABLED(V4L2_CID_FM_TX_CLASS_BASE + 14)
Some modulator generates pilot tone in audio channel.

I mean, what do you think to have those as a flag in txsubchans instead of
a separated ext control ?

 
 I've made a first implementation of these changes in this tree: 
 http://linuxtv.org/hg/~hverkuil/v4l-dvb-rds-enc
 
 This tree also contains the RDS decoder changes from my v4l-dvb-rds tree 
 since it needs to build on those.
 
 Comments?
 
 Regards,
 
   Hans
 
 -- 
 Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom

-- 
Eduardo Valentin
--
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


[PATCHv8 2/9] v4l2: video device: Add V4L2_CTRL_CLASS_FM_TX controls

2009-06-18 Thread Eduardo Valentin
This patch adds a new class of extended controls. This class
is intended to support FM Radio Modulators properties such as:
rds, audio limiters, audio compression, pilot tone generation,
tuning power levels and preemphasis properties.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/include/linux/videodev2.h |   34 ++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h
index b8cffc9..7e584ff 100644
--- a/linux/include/linux/videodev2.h
+++ b/linux/include/linux/videodev2.h
@@ -806,6 +806,7 @@ struct v4l2_ext_controls {
 #define V4L2_CTRL_CLASS_USER 0x0098/* Old-style 'user' controls */
 #define V4L2_CTRL_CLASS_MPEG 0x0099/* MPEG-compression controls */
 #define V4L2_CTRL_CLASS_CAMERA 0x009a  /* Camera class controls */
+#define V4L2_CTRL_CLASS_FM_TX 0x009b   /* FM Modulator control class */
 
 #define V4L2_CTRL_ID_MASK(0x0fff)
 #define V4L2_CTRL_ID2CLASS(id)((id)  0x0fffUL)
@@ -1144,6 +1145,39 @@ enum  v4l2_exposure_auto_type {
 
 #define V4L2_CID_PRIVACY   (V4L2_CID_CAMERA_CLASS_BASE+16)
 
+/* FM Modulator class control IDs */
+#define V4L2_CID_FM_TX_CLASS_BASE  (V4L2_CTRL_CLASS_FM_TX | 0x900)
+#define V4L2_CID_FM_TX_CLASS   (V4L2_CTRL_CLASS_FM_TX | 1)
+
+#define V4L2_CID_RDS_TX_ENABLED
(V4L2_CID_FM_TX_CLASS_BASE + 1)
+#define V4L2_CID_RDS_TX_PI (V4L2_CID_FM_TX_CLASS_BASE + 2)
+#define V4L2_CID_RDS_TX_PTY(V4L2_CID_FM_TX_CLASS_BASE + 3)
+#define V4L2_CID_RDS_TX_PS_NAME
(V4L2_CID_FM_TX_CLASS_BASE + 4)
+#define V4L2_CID_RDS_TX_RADIO_TEXT (V4L2_CID_FM_TX_CLASS_BASE + 5)
+
+#define V4L2_CID_AUDIO_LIMITER_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 6)
+#define V4L2_CID_AUDIO_LIMITER_RELEASE_TIME(V4L2_CID_FM_TX_CLASS_BASE + 7)
+#define V4L2_CID_AUDIO_LIMITER_DEVIATION   (V4L2_CID_FM_TX_CLASS_BASE + 8)
+
+#define V4L2_CID_AUDIO_COMPRESSION_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 9)
+#define V4L2_CID_AUDIO_COMPRESSION_GAIN
(V4L2_CID_FM_TX_CLASS_BASE + 10)
+#define V4L2_CID_AUDIO_COMPRESSION_THRESHOLD   (V4L2_CID_FM_TX_CLASS_BASE + 11)
+#define V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME (V4L2_CID_FM_TX_CLASS_BASE + 12)
+#define V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME
(V4L2_CID_FM_TX_CLASS_BASE + 13)
+
+#define V4L2_CID_PILOT_TONE_ENABLED(V4L2_CID_FM_TX_CLASS_BASE + 14)
+#define V4L2_CID_PILOT_TONE_DEVIATION  (V4L2_CID_FM_TX_CLASS_BASE + 15)
+#define V4L2_CID_PILOT_TONE_FREQUENCY  (V4L2_CID_FM_TX_CLASS_BASE + 16)
+
+#define V4L2_CID_FM_TX_PREEMPHASIS (V4L2_CID_FM_TX_CLASS_BASE + 17)
+enum v4l2_preemphasis {
+   V4L2_PREEMPHASIS_DISABLED   = 0,
+   V4L2_PREEMPHASIS_50_uS  = 1,
+   V4L2_PREEMPHASIS_75_uS  = 2,
+};
+#define V4L2_CID_TUNE_POWER_LEVEL  (V4L2_CID_FM_TX_CLASS_BASE + 18)
+#define V4L2_CID_TUNE_ANTENNA_CAPACITOR
(V4L2_CID_FM_TX_CLASS_BASE + 19)
+
 /*
  * T U N I N G
  */
-- 
1.6.2.GIT

--
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


[PATCHv8 5/9] v4l2-spec: Add documentation description for FM TX extended control class

2009-06-18 Thread Eduardo Valentin
This single patch adds documentation description for FM Modulator (FM_TX)
Extended Control Class and its Control IDs. The text was added under
Extended Controls section.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 v4l2-spec/Makefile  |1 +
 v4l2-spec/biblio.sgml   |   10 +++
 v4l2-spec/controls.sgml |  206 +++
 3 files changed, 217 insertions(+), 0 deletions(-)

diff --git a/v4l2-spec/Makefile b/v4l2-spec/Makefile
index 7a19924..6b46433 100644
--- a/v4l2-spec/Makefile
+++ b/v4l2-spec/Makefile
@@ -242,6 +242,7 @@ ENUMS = \
v4l2_power_line_frequency \
v4l2_priority \
v4l2_tuner_type \
+   v4l2_preemphasis \
 
 STRUCTS = \
v4l2_audio \
diff --git a/v4l2-spec/biblio.sgml b/v4l2-spec/biblio.sgml
index b013ece..0921849 100644
--- a/v4l2-spec/biblio.sgml
+++ b/v4l2-spec/biblio.sgml
@@ -11,6 +11,16 @@ 
url=http://www.eia.org;http://www.eia.org/ulink)/corpauthor
 Service/title
 /biblioentry
 
+biblioentry id=en50067
+  abbrevENnbsp;50067/abbrev
+  authorgroup
+   corpauthorCENELEC European Committee for Electrotechnical 
Standardization
+(ulink url=http://www.cenelec.eu;http://www.cenelec.eu/ulink)/corpauthor
+  /authorgroup
+  titleEN 50067 Specification of the radio data system (RDS) for
+VHF/FM sound broadcasting in the frequency range from 87,5 to 108,0 
MHz/title
+/biblioentry
+
 biblioentry id=en300294
   abbrevENnbsp;300nbsp;294/abbrev
   authorgroup
diff --git a/v4l2-spec/controls.sgml b/v4l2-spec/controls.sgml
index 477a970..060e7c9 100644
--- a/v4l2-spec/controls.sgml
+++ b/v4l2-spec/controls.sgml
@@ -458,6 +458,12 @@ video is actually encoded into that format./para
   paraUnfortunately, the original control API lacked some
 features needed for these new uses and so it was extended into the
 (not terribly originally named) extended control API./para
+
+  paraEven though the MPEG encoding API was the first effort
+to use the Extended Control API, nowadays there are also other classes
+of Extended Controls, such as Camera Controls and FM Transmitter Controls.
+The Extended Controls API as well as all Extended Controls classes are
+described in the following text./para
 /section
 
 section
@@ -1816,6 +1822,206 @@ control must support read access and may support write 
access./entry
   /tgroup
 /table
   /section
+
+section id=fm-tx-controls
+  titleFM Transmitter Control Reference/title
+
+  paraThe FM Transmitter (FM_TX) class includes controls for common 
features of
+FM transmissions capable devices. Currently this class include parameters for 
audio
+compression, pilot tone generation, audio deviation limiter, RDS transmission 
and
+tuning power features./para
+
+  table pgwide=1 frame=none id=fm-tx-control-id
+  titleFM_TX Control IDs/title
+
+  tgroup cols=4
+   colspec colname=c1 colwidth=1*
+   colspec colname=c2 colwidth=6*
+   colspec colname=c3 colwidth=2*
+   colspec colname=c4 colwidth=6*
+   spanspec namest=c1 nameend=c2 spanname=id
+   spanspec namest=c2 nameend=c4 spanname=descr
+   thead
+ row
+   entry spanname=id align=leftID/entry
+   entry align=leftType/entry
+ /rowrow rowsep=1entry spanname=descr 
align=leftDescription/entry
+ /row
+   /thead
+   tbody valign=top
+ rowentry/entry/row
+ row
+   entry 
spanname=idconstantV4L2_CID_FM_TX_CLASS/constantnbsp;/entry
+   entryclass/entry
+ /rowrowentry spanname=descrThe FM_TX class
+descriptor. Calling VIDIOC-QUERYCTRL; for this control will return a
+description of this control class./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_ENABLED/constantnbsp;/entry
+   entryboolean/entry
+ /row
+ rowentry spanname=descrEnables or disables the RDS transmission 
feature./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_PI/constantnbsp;/entry
+   entryinteger/entry
+ /row
+ rowentry spanname=descrSets the RDS Programme Identification 
field
+for transmission./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_PTY/constantnbsp;/entry
+   entryinteger/entry
+ /row
+ rowentry spanname=descrSets the RDS Programme Type field for 
transmission.
+This encodes up to 31 pre-defined programme types./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_TX_PS_NAME/constantnbsp;/entry
+   entrystring/entry
+ /row
+ rowentry spanname=descrSets the Programme Service name 
(PS_NAME) for transmission.
+It is intended for static display on a receiver. It is the primary aid to 
listeners in programme service
+identification and selection. The use of PS to transmit text other than a 
single eight character name

[PATCHv8 0/9] FM Transmitter (si4713) and another changes

2009-06-18 Thread Eduardo Valentin
Hello all,

  First of all, I'd like to thank you for the good review. The driver
is getting better and better. With this new API change, si4713 is looking
like a fm transmitter driver.

  So, I'm resending the FM transmitter driver and the proposed changes in
v4l2 api files in order to cover the fmtx extended controls class.

  Difference from version #7 is that now I've added added lots of comments
made by Hans. Here is a list of changes:
- A few renames of constant definitions
- Updates in proposed documentation
- Split of platform data info into 2 header, one for platform driver and
  other to i2c driver
- Use of v4l2_* family of logging/debugging instead of dev_*
- Improvement of debug messages
- Fix in the use of string controls
- Fix in the use of txsubchans
- Creation of private ioctl to read rssi
- Minor fixes all around the code
- Remotion of get/set style of function, previously used for the sysfs interface

As before, this series is based on two of Hans' trees:
http://www.linuxtv.org/hg/~hverkuil/v4l-dvb-subdev2.
http://www.linuxtv.org/hg/~hverkuil/v4l-dvb-str.

The first tree has refactoring of v4l2 i2c helper functions. The second
one has string support for extended controls, which is used in this driver.

  So, now the series includes changes to add the new v4l2
FMTX extended controls (and its documetation) and si4713 i2c and platform
drivers (and its documentation as well). Besides that, there is also
a patch to add g_modulator to v4l2-subdev and a patch to add support
for fm tx class in v4l2-ctl util.

BR,

Eduardo Valentin (9):
  v4l2-subdev.h: Add g_modulator callbacks to subdev api
  v4l2: video device: Add V4L2_CTRL_CLASS_FM_TX controls
  v4l2: video device: Add FM_TX controls default configurations
  v4l2-ctl: Add support for FM TX controls
  v4l2-spec: Add documentation description for FM TX extended control
class
  FMTx: si4713: Add files to add radio interface for si4713
  FMTx: si4713: Add files to handle si4713 i2c device
  FMTx: si4713: Add Kconfig and Makefile entries
  FMTx: si4713: Add document file

 linux/Documentation/video4linux/si4713.txt |  169 +++
 linux/drivers/media/radio/Kconfig  |   22 +
 linux/drivers/media/radio/Makefile |2 +
 linux/drivers/media/radio/radio-si4713.c   |  367 +
 linux/drivers/media/radio/si4713-i2c.c | 2015 
 linux/drivers/media/radio/si4713-i2c.h |  226 
 linux/drivers/media/video/v4l2-common.c|   50 +
 linux/include/linux/videodev2.h|   34 +
 linux/include/media/radio-si4713.h |   30 +
 linux/include/media/si4713.h   |   40 +
 linux/include/media/v4l2-subdev.h  |2 +
 v4l2-apps/util/v4l2-ctl.cpp|   36 +
 v4l2-spec/Makefile |1 +
 v4l2-spec/biblio.sgml  |   10 +
 v4l2-spec/controls.sgml|  206 +++
 15 files changed, 3210 insertions(+), 0 deletions(-)
 create mode 100644 linux/Documentation/video4linux/si4713.txt
 create mode 100644 linux/drivers/media/radio/radio-si4713.c
 create mode 100644 linux/drivers/media/radio/si4713-i2c.c
 create mode 100644 linux/drivers/media/radio/si4713-i2c.h
 create mode 100644 linux/include/media/radio-si4713.h
 create mode 100644 linux/include/media/si4713.h

--
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


[PATCHv8 6/9] FMTx: si4713: Add files to add radio interface for si4713

2009-06-18 Thread Eduardo Valentin
This patch adds files which creates the radio interface
for si4713 FM transmitter (modulator) devices.

In order to do the real access to device registers, this
driver uses the v4l2 subdev interface exported by si4713 i2c driver.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/drivers/media/radio/radio-si4713.c |  367 ++
 linux/include/media/radio-si4713.h   |   30 +++
 2 files changed, 397 insertions(+), 0 deletions(-)
 create mode 100644 linux/drivers/media/radio/radio-si4713.c
 create mode 100644 linux/include/media/radio-si4713.h

diff --git a/linux/drivers/media/radio/radio-si4713.c 
b/linux/drivers/media/radio/radio-si4713.c
new file mode 100644
index 000..7b3b665
--- /dev/null
+++ b/linux/drivers/media/radio/radio-si4713.c
@@ -0,0 +1,367 @@
+/*
+ * drivers/media/radio/radio-si4713.c
+ *
+ * Platform Driver for Silicon Labs Si4713 FM Radio Transmitter:
+ *
+ * Copyright (c) 2008 Instituto Nokia de Tecnologia - INdT
+ * Contact: Eduardo Valentin eduardo.valen...@nokia.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include linux/kernel.h
+#include linux/module.h
+#include linux/init.h
+#include linux/version.h
+#include linux/platform_device.h
+#include linux/i2c.h
+#include linux/videodev2.h
+#include media/v4l2-device.h
+#include media/v4l2-common.h
+#include media/v4l2-ioctl.h
+#include media/radio-si4713.h
+
+/* module parameters */
+static int radio_nr = -1;  /* radio device minor (-1 == auto assign) */
+module_param(radio_nr, int, 0);
+MODULE_PARM_DESC(radio_nr,
+Minor number for radio device (-1 == auto assign));
+
+MODULE_LICENSE(GPL);
+MODULE_AUTHOR(Eduardo Valentin eduardo.valen...@nokia.com);
+MODULE_DESCRIPTION(Platform driver for Si4713 FM Radio Transmitter);
+MODULE_VERSION(0.0.1);
+
+/* Driver state struct */
+struct radio_si4713_device {
+   struct v4l2_device  v4l2_dev;
+   struct video_device *radio_dev;
+};
+
+/* radio_si4713_fops - file operations interface */
+static const struct v4l2_file_operations radio_si4713_fops = {
+   .owner  = THIS_MODULE,
+   .ioctl  = video_ioctl2,
+};
+
+/* Video4Linux Interface */
+static int radio_si4713_fill_audout(struct v4l2_audioout *vao)
+{
+   /* TODO: check presence of audio output */
+   strlcpy(vao-name, FM Modulator Audio Out, 32);
+
+   return 0;
+}
+
+static int radio_si4713_enumaudout(struct file *file, void *priv,
+   struct v4l2_audioout *vao)
+{
+   return radio_si4713_fill_audout(vao);
+}
+
+static int radio_si4713_g_audout(struct file *file, void *priv,
+   struct v4l2_audioout *vao)
+{
+   int rval = radio_si4713_fill_audout(vao);
+
+   vao-index = 0;
+
+   return rval;
+}
+
+static int radio_si4713_s_audout(struct file *file, void *priv,
+   struct v4l2_audioout *vao)
+{
+   return vao-index ? -EINVAL : 0;
+}
+
+/* radio_si4713_querycap - query device capabilities */
+static int radio_si4713_querycap(struct file *file, void *priv,
+   struct v4l2_capability *capability)
+{
+   struct radio_si4713_device *rsdev;
+
+   rsdev = video_get_drvdata(video_devdata(file));
+
+   strlcpy(capability-driver, radio-si4713, sizeof(capability-driver));
+   strlcpy(capability-card, Silicon Labs Si4713 Modulator,
+   sizeof(capability-card));
+   capability-capabilities = V4L2_CAP_MODULATOR;
+
+   return 0;
+}
+
+/* radio_si4713_queryctrl - enumerate control items */
+static int radio_si4713_queryctrl(struct file *file, void *priv,
+   struct v4l2_queryctrl *qc)
+{
+   /* Must be sorted from low to high control ID! */
+   static const u32 user_ctrls[] = {
+   V4L2_CID_USER_CLASS,
+   V4L2_CID_AUDIO_MUTE,
+   0
+   };
+
+   /* Must be sorted from low to high control ID! */
+   static const u32 fmtx_ctrls[] = {
+   V4L2_CID_FM_TX_CLASS,
+   V4L2_CID_RDS_TX_ENABLED,
+   V4L2_CID_RDS_TX_PI,
+   V4L2_CID_RDS_TX_PTY,
+   V4L2_CID_RDS_TX_PS_NAME

[PATCHv8 8/9] FMTx: si4713: Add Kconfig and Makefile entries

2009-06-18 Thread Eduardo Valentin
Simple add Makefile and Kconfig entries.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/drivers/media/radio/Kconfig  |   22 ++
 linux/drivers/media/radio/Makefile |2 ++
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/linux/drivers/media/radio/Kconfig 
b/linux/drivers/media/radio/Kconfig
index 3315cac..6c6a409 100644
--- a/linux/drivers/media/radio/Kconfig
+++ b/linux/drivers/media/radio/Kconfig
@@ -339,6 +339,28 @@ config RADIO_ZOLTRIX_PORT
help
  Enter the I/O port of your Zoltrix radio card.
 
+config I2C_SI4713
+   tristate I2C driver for Silicon Labs Si4713 device
+   depends on I2C  VIDEO_V4L2
+   ---help---
+ Say Y here if you want support to Si4713 I2C device.
+ This device driver supports only i2c bus.
+
+ To compile this driver as a module, choose M here: the
+ module will be called si4713.
+
+config RADIO_SI4713
+   tristate Silicon Labs Si4713 FM Radio Transmitter support
+   depends on I2C  VIDEO_V4L2
+   ---help---
+ Say Y here if you want support to Si4713 FM Radio Transmitter.
+ This device can transmit audio through FM. It can transmit
+ EDS and EBDS signals as well. This module is the v4l2 radio
+ interface for the i2c driver of this device.
+
+ To compile this driver as a module, choose M here: the
+ module will be called radio-si4713.
+
 config USB_DSBR
tristate D-Link/GemTek USB FM radio support
depends on USB  VIDEO_V4L2
diff --git a/linux/drivers/media/radio/Makefile 
b/linux/drivers/media/radio/Makefile
index 0f2b35b..34ae761 100644
--- a/linux/drivers/media/radio/Makefile
+++ b/linux/drivers/media/radio/Makefile
@@ -15,6 +15,8 @@ obj-$(CONFIG_RADIO_ZOLTRIX) += radio-zoltrix.o
 obj-$(CONFIG_RADIO_GEMTEK) += radio-gemtek.o
 obj-$(CONFIG_RADIO_GEMTEK_PCI) += radio-gemtek-pci.o
 obj-$(CONFIG_RADIO_TRUST) += radio-trust.o
+obj-$(CONFIG_I2C_SI4713) += si4713-i2c.o
+obj-$(CONFIG_RADIO_SI4713) += radio-si4713.o
 obj-$(CONFIG_RADIO_MAESTRO) += radio-maestro.o
 obj-$(CONFIG_USB_DSBR) += dsbr100.o
 obj-$(CONFIG_USB_SI470X) += radio-si470x.o
-- 
1.6.2.GIT

--
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


[PATCHv8 3/9] v4l2: video device: Add FM_TX controls default configurations

2009-06-18 Thread Eduardo Valentin
Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/drivers/media/video/v4l2-common.c |   50 +++
 1 files changed, 50 insertions(+), 0 deletions(-)

diff --git a/linux/drivers/media/video/v4l2-common.c 
b/linux/drivers/media/video/v4l2-common.c
index 5cfd727..fc4d7a8 100644
--- a/linux/drivers/media/video/v4l2-common.c
+++ b/linux/drivers/media/video/v4l2-common.c
@@ -345,6 +345,12 @@ const char **v4l2_ctrl_get_menu(u32 id)
Sepia,
NULL
};
+   static const char *fm_tx_preemphasis[] = {
+   No preemphasis,
+   50 useconds,
+   75 useconds,
+   NULL,
+   };
 
switch (id) {
case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ:
@@ -383,6 +389,8 @@ const char **v4l2_ctrl_get_menu(u32 id)
return camera_exposure_auto;
case V4L2_CID_COLORFX:
return colorfx;
+   case V4L2_CID_FM_TX_PREEMPHASIS:
+   return fm_tx_preemphasis;
default:
return NULL;
}
@@ -481,6 +489,28 @@ const char *v4l2_ctrl_get_name(u32 id)
case V4L2_CID_ZOOM_CONTINUOUS:  return Zoom, Continuous;
case V4L2_CID_PRIVACY:  return Privacy;
 
+   /* FM Radio Modulator control */
+   case V4L2_CID_FM_TX_CLASS:  return FM Radio Modulator 
Controls;
+   case V4L2_CID_RDS_TX_ENABLED:   return RDS Feature Enabled;
+   case V4L2_CID_RDS_TX_PI:return RDS Program ID;
+   case V4L2_CID_RDS_TX_PTY:   return RDS Program Type;
+   case V4L2_CID_RDS_TX_PS_NAME:   return RDS PS Name;
+   case V4L2_CID_RDS_TX_RADIO_TEXT:return RDS Radio Text;
+   case V4L2_CID_AUDIO_LIMITER_ENABLED:return Audio Limiter Feature 
Enabled;
+   case V4L2_CID_AUDIO_LIMITER_RELEASE_TIME: return Audio Limiter Release 
Time;
+   case V4L2_CID_AUDIO_LIMITER_DEVIATION:  return Audio Limiter 
Deviation;
+   case V4L2_CID_AUDIO_COMPRESSION_ENABLED: return Audio Compression 
Feature Enabled;
+   case V4L2_CID_AUDIO_COMPRESSION_GAIN:   return Audio Compression Gain;
+   case V4L2_CID_AUDIO_COMPRESSION_THRESHOLD: return Audio Compression 
Threshold;
+   case V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME: return Audio Compression 
Attack Time;
+   case V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME: return Audio Compression 
Release Time;
+   case V4L2_CID_PILOT_TONE_ENABLED:   return Pilot Tone Feature 
Enabled;
+   case V4L2_CID_PILOT_TONE_DEVIATION: return Pilot Tone Deviation;
+   case V4L2_CID_PILOT_TONE_FREQUENCY: return Pilot Tone Frequency;
+   case V4L2_CID_FM_TX_PREEMPHASIS:return Pre-emphasis settings;
+   case V4L2_CID_TUNE_POWER_LEVEL: return Tune Power Level;
+   case V4L2_CID_TUNE_ANTENNA_CAPACITOR:   return Tune Antenna Capacitor;
+
default:
return NULL;
}
@@ -513,6 +543,10 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 
min, s32 max, s32 ste
case V4L2_CID_EXPOSURE_AUTO_PRIORITY:
case V4L2_CID_FOCUS_AUTO:
case V4L2_CID_PRIVACY:
+   case V4L2_CID_RDS_TX_ENABLED:
+   case V4L2_CID_AUDIO_LIMITER_ENABLED:
+   case V4L2_CID_AUDIO_COMPRESSION_ENABLED:
+   case V4L2_CID_PILOT_TONE_ENABLED:
qctrl-type = V4L2_CTRL_TYPE_BOOLEAN;
min = 0;
max = step = 1;
@@ -541,12 +575,18 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, 
s32 min, s32 max, s32 ste
case V4L2_CID_MPEG_STREAM_VBI_FMT:
case V4L2_CID_EXPOSURE_AUTO:
case V4L2_CID_COLORFX:
+   case V4L2_CID_FM_TX_PREEMPHASIS:
qctrl-type = V4L2_CTRL_TYPE_MENU;
step = 1;
break;
+   case V4L2_CID_RDS_TX_PS_NAME:
+   case V4L2_CID_RDS_TX_RADIO_TEXT:
+   qctrl-type = V4L2_CTRL_TYPE_STRING;
+   break;
case V4L2_CID_USER_CLASS:
case V4L2_CID_CAMERA_CLASS:
case V4L2_CID_MPEG_CLASS:
+   case V4L2_CID_FM_TX_CLASS:
qctrl-type = V4L2_CTRL_TYPE_CTRL_CLASS;
qctrl-flags |= V4L2_CTRL_FLAG_READ_ONLY;
min = max = step = def = 0;
@@ -575,6 +615,16 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 
min, s32 max, s32 ste
case V4L2_CID_BLUE_BALANCE:
case V4L2_CID_GAMMA:
case V4L2_CID_SHARPNESS:
+   case V4L2_CID_AUDIO_LIMITER_RELEASE_TIME:
+   case V4L2_CID_AUDIO_LIMITER_DEVIATION:
+   case V4L2_CID_AUDIO_COMPRESSION_GAIN:
+   case V4L2_CID_AUDIO_COMPRESSION_THRESHOLD:
+   case V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME:
+   case V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME:
+   case V4L2_CID_PILOT_TONE_DEVIATION:
+   case V4L2_CID_PILOT_TONE_FREQUENCY:
+   case V4L2_CID_TUNE_POWER_LEVEL

[PATCHv8 4/9] v4l2-ctl: Add support for FM TX controls

2009-06-18 Thread Eduardo Valentin
This patch adds simple support for FM TX extended controls
on v4l2-ctl utility.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 v4l2-apps/util/v4l2-ctl.cpp |   36 
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/v4l2-apps/util/v4l2-ctl.cpp b/v4l2-apps/util/v4l2-ctl.cpp
index 2c7290f..45a2310 100644
--- a/v4l2-apps/util/v4l2-ctl.cpp
+++ b/v4l2-apps/util/v4l2-ctl.cpp
@@ -148,6 +148,7 @@ typedef std::vectorstruct v4l2_ext_control ctrl_list;
 static ctrl_list user_ctrls;
 static ctrl_list mpeg_ctrls;
 static ctrl_list camera_ctrls;
+static ctrl_list fm_tx_ctrls;
 
 typedef std::mapstd::string, unsigned ctrl_strmap;
 static ctrl_strmap ctrl_str2id;
@@ -2166,6 +2167,8 @@ set_vid_fmt_error:
mpeg_ctrls.push_back(ctrl);
else if (V4L2_CTRL_ID2CLASS(ctrl.id) == 
V4L2_CTRL_CLASS_CAMERA)
camera_ctrls.push_back(ctrl);
+   else if (V4L2_CTRL_ID2CLASS(ctrl.id) == 
V4L2_CTRL_CLASS_FM_TX)
+   fm_tx_ctrls.push_back(ctrl);
else
user_ctrls.push_back(ctrl);
}
@@ -2212,6 +2215,22 @@ set_vid_fmt_error:
}
}
}
+   if (fm_tx_ctrls.size()) {
+   ctrls.ctrl_class = V4L2_CTRL_CLASS_FM_TX;
+   ctrls.count = fm_tx_ctrls.size();
+   ctrls.controls = fm_tx_ctrls[0];
+   if (doioctl(fd, VIDIOC_S_EXT_CTRLS, ctrls, 
VIDIOC_S_EXT_CTRLS)) {
+   if (ctrls.error_idx = ctrls.count) {
+   fprintf(stderr, Error setting FM 
Modulator controls: %s\n,
+   strerror(errno));
+   }
+   else {
+   fprintf(stderr, %s: %s\n,
+   
ctrl_id2str[fm_tx_ctrls[ctrls.error_idx].id].c_str(),
+   strerror(errno));
+   }
+   }
+   }
}
 
/* Get options */
@@ -2429,6 +2448,7 @@ set_vid_fmt_error:
mpeg_ctrls.clear();
camera_ctrls.clear();
user_ctrls.clear();
+   fm_tx_ctrls.clear();
for (ctrl_get_list::iterator iter = get_ctrls.begin();
iter != get_ctrls.end(); ++iter) {
struct v4l2_ext_control ctrl = { 0 };
@@ -2443,6 +2463,8 @@ set_vid_fmt_error:
mpeg_ctrls.push_back(ctrl);
else if (V4L2_CTRL_ID2CLASS(ctrl.id) == 
V4L2_CTRL_CLASS_CAMERA)
camera_ctrls.push_back(ctrl);
+   else if (V4L2_CTRL_ID2CLASS(ctrl.id) == 
V4L2_CTRL_CLASS_FM_TX)
+   fm_tx_ctrls.push_back(ctrl);
else
user_ctrls.push_back(ctrl);
}
@@ -2481,6 +2503,20 @@ set_vid_fmt_error:
printf(%s: %d\n, 
ctrl_id2str[ctrl.id].c_str(), ctrl.value);
}
}
+   if (fm_tx_ctrls.size()) {
+   ctrls.ctrl_class = V4L2_CTRL_CLASS_FM_TX;
+   ctrls.count = fm_tx_ctrls.size();
+   ctrls.controls = fm_tx_ctrls[0];
+   doioctl(fd, VIDIOC_G_EXT_CTRLS, ctrls, 
VIDIOC_G_EXT_CTRLS);
+   for (unsigned i = 0; i  fm_tx_ctrls.size(); i++) {
+   struct v4l2_ext_control ctrl = fm_tx_ctrls[i];
+
+   if (ctrl_id2type[ctrl.id] == 
V4L2_CTRL_TYPE_STRING)
+   printf(%s: '%s'\n, 
ctrl_id2str[ctrl.id].c_str(), ctrl.string);
+   else
+   printf(%s: %d\n, 
ctrl_id2str[ctrl.id].c_str(), ctrl.value);
+   }
+   }
}
 
if (options[OptGetTuner]) {
-- 
1.6.2.GIT

--
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


[PATCHv8 9/9] FMTx: si4713: Add document file

2009-06-18 Thread Eduardo Valentin
This patch adds a document file for si4713 device driver.
It describes the driver interfaces and organization.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/Documentation/video4linux/si4713.txt |  169 
 1 files changed, 169 insertions(+), 0 deletions(-)
 create mode 100644 linux/Documentation/video4linux/si4713.txt

diff --git a/linux/Documentation/video4linux/si4713.txt 
b/linux/Documentation/video4linux/si4713.txt
new file mode 100644
index 000..8944abe
--- /dev/null
+++ b/linux/Documentation/video4linux/si4713.txt
@@ -0,0 +1,169 @@
+Driver for I2C radios for the Silicon Labs Si4713 FM Radio Transmitters
+
+Copyright (c) 2009 Nokia Corporation
+Contact: Eduardo Valentin eduardo.valen...@nokia.com
+
+
+Information about the Device
+
+This chip is a Silicon Labs product. It is a I2C device, currently on 0×63 
address.
+Basically, it has transmission and signal noise level measurement features.
+
+The Si4713 integrates transmit functions for FM broadcast stereo transmission.
+The chip also allows integrated receive power scanning to identify low signal
+power FM channels.
+
+The chip is programmed using commands and responses. There are also several
+properties which can change the behavior of this chip.
+
+Users must comply with local regulations on radio frequency (RF) transmission.
+
+Device driver description
+=
+There are two modules to handle this device. One is a I2C device driver
+and the other is a platform driver.
+
+The I2C device driver exports a v4l2-subdev interface to the kernel.
+All properties can also be accessed by v4l2 extended controls interface, by
+using the v4l2-subdev calls (g_ext_ctrls, s_ext_ctrls).
+
+The platform device driver exports a v4l2 radio device interface to user land.
+So, it uses the I2C device driver as a sub device in order to send the user
+commands to the actual device. Basically it is a wrapper to the I2C device 
driver.
+
+Applications can use v4l2 radio API to specify frequency of operation, mute 
state,
+etc. But mostly of its properties will be present in the extended controls.
+
+When the v4l2 mute property is set to 1 (true), the driver will turn the chip 
off.
+
+Properties description
+==
+
+The properties can be accessed using v4l2 extended controls.
+Here is an output from v4l2-ctl util:
+
+# v4l2-ctl -d /dev/radio0 -l --all
+Driver Info:
+Driver name   : radio-si4713
+Card type : Silicon Labs Si4713 Modulator
+Bus info  : 
+Driver version: 0
+Capabilities  : 0x0008
+Modulator
+Audio output: 0 (FM Modulator Audio Out)
+Frequency: 1408000 (88000.00 MHz)
+Video Standard = 0x
+Modulator:
+Name : FM Modulator
+Capabilities : 62.5 Hz stereo 
+Frequency range  : 76.0 MHz - 108.0 MHz
+Available subchannels: mono stereo 
+
+User Controls
+
+   mute (bool) : default=1 value=0
+
+FM Radio Modulator Controls
+
+rds_feature_enabled (bool) : default=1 value=1
+ rds_program_id (int)  : min=0 max=65535 step=1 default=0 
value=0
+   rds_program_type (int)  : min=0 max=31 step=1 default=0 value=0
+rds_ps_name (str)  : value='Si4713  ' len=8
+' len=9  rds_radio_text (str)  : value='Si4713  
+  audio_limiter_feature_enabled (bool) : default=1 value=1
+ audio_limiter_release_time (int)  : min=250 max=102390 step=50 
default=5010 value=5010 flags=slider
+audio_limiter_deviation (int)  : min=0 max=9 step=10 default=66250 
value=66250 flags=slider
+audio_compression_feature_enabl (bool) : default=1 value=1
+ audio_compression_gain (int)  : min=0 max=20 step=1 default=15 
value=15 flags=slider
+audio_compression_threshold (int)  : min=-40 max=0 step=1 default=-40 
value=-40 flags=slider
+  audio_compression_attack_time (int)  : min=0 max=5000 step=500 default=0 
value=2000 flags=slider
+ audio_compression_release_time (int)  : min=10 max=100 step=10 
default=100 value=100 flags=slider
+ pilot_tone_feature_enabled (bool) : default=1 value=1
+   pilot_tone_deviation (int)  : min=0 max=9 step=10 default=6750 
value=6750 flags=slider
+   pilot_tone_frequency (int)  : min=0 max=19000 step=1 default=19000 
value=19000 flags=slider
+  pre_emphasis_settings (menu) : min=0 max=2 default=1 value=2
+   tune_power_level (int)  : min=0 max=120 step=1 default=88 
value=88 flags=slider
+ tune_antenna_capacitor (int)  : min=0 max=191 step=1 default=0 
value=110 flags=slider
+
+Here is a summary of them:
+
+* Pilot is an audible tone sent by the device.
+
+pilot_frequency - Configures the frequency of the stereo pilot tone.
+pilot_deviation - Configures pilot tone frequency deviation level.
+pilot_enabled - Enables or disables the pilot

Re: [PATCHv7 0/9] FM Transmitter (si4713) and another changes

2009-06-16 Thread Eduardo Valentin
Hi Hans,

On Sun, Jun 14, 2009 at 01:37:20PM +0200, ext Hans Verkuil wrote:
 On Friday 12 June 2009 19:30:31 Eduardo Valentin wrote:
  Hello all,
  
I'm resending the FM transmitter driver and the proposed changes in
  v4l2 api files in order to cover the fmtx extended controls class.
  
Difference from version #6 is that now I've added added lots of comments
  made by Hans. Here is a list of changes:
  - Reduce card type string
  - Remove unused ext controls
  - Remove s/g_audio and add s/g_audout and enumaudout
  - remove g/s_input
  - remove s/g_tuner and add s/g_modulator on subdev and platform driver
  - reduce function names
  - Update documentation
  - remove a few unused and empty lines
  - remove sysfs interface
  - rename dev_to_v4l2 to si4713_to_v4l2 (and vice-versa) macros
  - Remove disabled controls
  - Add string support
  - remove v4l2_i2c_driver_data
  - Join si4713.c with si4713-subdev.c
  - move platform data to include/media
  - update documentation
  
  And now this series is based on two of Hans' trees:
  http://www.linuxtv.org/hg/~hverkuil/v4l-dvb-subdev2.
  http://www.linuxtv.org/hg/~hverkuil/v4l-dvb-str.
  
  The first tree has refactoring of v4l2 i2c helper functions. The second
  one has string support for extended controls, which is used in this driver.
  
So, now the series includes changes to add the new v4l2
  FMTX extended controls (and its documetation) and si4713 i2c and platform
  drivers (and its documentation as well). Besides that, there is also
  a patch to add g_modulator to v4l2-subdev and a patch to add support
  for fm tx class in v4l2-ctl util.
  
In the TODO list there are two things:
  i. the signal level measurement property is missing.
  ii. Re-factor the driver so all that get/set internal functions are removed.
  
I believe those TODO's can be done later on, if there is still time to get
  this driver merged into this window. But of course, this is my opinion,
  I will understand also if you ask to do them before merge it.
 
 I think the refactoring should be done first. I don't believe it is that much
 work and experience shows that it is better to do this right away while you 
 are
 still motivated :-)

hehehe.. Yes, that's what I was expecting :-). No problem. I've started it.
I will resend the series once I've completed the re-factoring and
I 've made some testing after that. I hope tomorrow or so.

 
 The string control support should not go into 2.6.31. I would like to do that
 only in the v4l-dvb tree (so it will appear in 2.6.32) since I want to give 
 that
 a bit more time to mature. I implemented it very quickly and I do not feel
 comfortable queueing this for 2.6.31.
 

Right. Yes, better to test the stuff a bit more.

 In addition it is still unclear if Mauro will merge my v4l-dvb-subdev2 tree 
 for
 2.6.31. I hope so, since otherwise it will hamper the development of this and
 other embedded platforms.

Ok.

 
 I also need to add a new V4L2_CAP_MODULATOR (which needs a review as well).
 
 And finally I realized that we need to add some v4l2_modulator capabilities
 for the RDS encoder similar to the upcoming v4l2_tuner RDS capabilities as
 is described in this RFC:
 
 http://www.mail-archive.com/linux-media%40vger.kernel.org/msg02498.html
 
 I haven't had time to implement this RFC and I know that is not going to make
 2.6.31. It's now almost at the top of my TODO list, so it should go in soon
 (pending unforeseen circumstances).

Ok. I'll take a look at it.

 
 As a result of rereading this RFC I also started to wonder about whether
 the si4713 supports the MMBS functionality. Do you know anything about that?

No. Not that I know. Can you point some link?

 
 Taken all together I think that 2.6.31 is probably not feasible. If it was
 another two weeks until the merge window, then it would. But the merge window
 is already open, and there are just too many little TODOs for this driver. And
 it's also a new API, so we need to be more careful than usual.

Yes. Sure.

 
 Regards,
 
   Hans
 
  
With these series, the driver is now functional through the v4l2 extended
  controls changes. Here is an output of v4l2-ctl:
   # v4l2-ctl -d /dev/radio0 -l --all
  Driver Info:
  Driver name   : radio-si4713
  Card type : Silicon Labs Si4713 Modulator
  Bus info  : 
  Driver version: 0
  Capabilities  : 0x0008
  Modulator
  Audio output: 0 (FM Modulator Audio Out)
  Frequency: 1552000 (97000.00 MHz)
  Video Standard = 0x
  Modulator:
  Name : FM Modulator
  Capabilities : 62.5 Hz stereo 
  Frequency range  : 76.0 MHz - 108.0 MHz
  Available subchannels: mono stereo 
  
  User Controls
  
 mute (bool) : default=1 value=0
  
  FM Radio Modulator Controls
  
  rds_feature_enabled (bool) : default=1 value=1
   rds_program_id (int)  : min=0

Re: [PATCHv7 2/9] v4l2: video device: Add V4L2_CTRL_CLASS_FM_TX controls

2009-06-16 Thread Eduardo Valentin
On Sun, Jun 14, 2009 at 06:59:13PM +0200, ext Hans Verkuil wrote:
 On Sunday 14 June 2009 18:23:41 Trent Piepho wrote:
  On Sun, 14 Jun 2009, Eduardo Valentin wrote:
+/* FM Modulator class control IDs */
+#define V4L2_CID_FM_TX_CLASS_BASE  (V4L2_CTRL_CLASS_FM_TX | 0x900)
+#define V4L2_CID_FM_TX_CLASS                 (V4L2_CTRL_CLASS_FM_TX | 
1)
+
+#define V4L2_CID_RDS_ENABLED                 
(V4L2_CID_FM_TX_CLASS_BASE + 1)
+#define V4L2_CID_RDS_PI                              
(V4L2_CID_FM_TX_CLASS_BASE + 2)
+#define V4L2_CID_RDS_PTY                     
(V4L2_CID_FM_TX_CLASS_BASE + 3)
+#define V4L2_CID_RDS_PS_NAME                 
(V4L2_CID_FM_TX_CLASS_BASE + 4)
+#define V4L2_CID_RDS_RADIO_TEXT                      
(V4L2_CID_FM_TX_CLASS_BASE + 5)
   
I think these RDS controls should be renamed to V4L2_CID_RDS_TX_. This 
makes
it clear that these controls relate to the RDS transmitter instead of a
receiver. I would not be surprised to see similar controls appear for 
an RDS
receiver in the future.
  
  So there should there be different controls to set the same thing, one set
  for tx and another for rx?
 
 Sure. Say some RDS decoder stores the PI in a register. I can imagine that
 we add a V4L2_CID_RDS_RX_PI control for that. Whereas a V4L2_CID_RDS_TX_PI
 control will return the PI sent out by the encoder.
 
 Currently no such controls exist (or are needed) for an RDS decoder, but I
 wouldn't be surprised at all if we need them at some point in the future.
 
  
+#define V4L2_CID_PREEMPHASIS                 
(V4L2_CID_FM_TX_CLASS_BASE + 17)
+enum v4l2_fm_tx_preemphasis {
+     V4L2_FM_TX_PREEMPHASIS_DISABLED         = 0,
+     V4L2_FM_TX_PREEMPHASIS_50_uS            = 1,
+     V4L2_FM_TX_PREEMPHASIS_75_uS            = 2,
+};
   
I suggest renaming this to V4L2_CID_FM_TX_PREEMPHASIS. There is already 
a
similar V4L2_CID_MPEG_EMPHASIS control and others might well appear in 
the
future, so I think this name should be more specific to the FM_TX API.
  
  The cx88 driver could get support for setting the fm preemphasis via a
  control.  I added support via a module option, but a control would be
  better.  You're saying it shouldn't use this fm preemphasis control?
 
 Correct. This set the pre-emphasis when transmitting. For receiving you want
 a separate control. Although the enum should be made generic. So FM_TX can be
 removed from the enum.
 
 Why should we have one rx and one tx control for this? Because you can have
 both receivers and transmitters in one device and you want independent control
 of the two.

Yes, agreed here. There is the possibility to have receiver and transmitter
both in the same device. So, I think it is better to have separated controls.

 
 It is my believe that the other fm_tx controls are unambiguously transmitter
 related, so I don't think they need a TX prefix. It doesn't hurt if someone
 can double check that, though.

hmm.. I see no problem removing the fmtx prefix of the preemphasis
enum. But, if it is becoming a generic enum, better to check if its
meaning is the same of existing emphasis enum for mpeg.

 
 Regards,
 
   Hans
 
 -- 
 Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom
 --
 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

-- 
Eduardo Valentin
--
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


Re: [PATCHv7 0/9] FM Transmitter (si4713) and another changes

2009-06-16 Thread Eduardo Valentin
On Tue, Jun 16, 2009 at 01:01:51PM +0200, ext Hans Verkuil wrote:
 On Tuesday 16 June 2009 12:47:14 Eduardo Valentin wrote:
  Hi Hans,
 
  On Sun, Jun 14, 2009 at 01:37:20PM +0200, ext Hans Verkuil wrote:
 
 snip
 
   I think the refactoring should be done first. I don't believe it is
   that much work and experience shows that it is better to do this right
   away while you are still motivated :-)
 
  hehehe.. Yes, that's what I was expecting :-). No problem. I've started
  it. I will resend the series once I've completed the re-factoring and I
  've made some testing after that. I hope tomorrow or so.
 
   The string control support should not go into 2.6.31. I would like to
   do that only in the v4l-dvb tree (so it will appear in 2.6.32) since I
   want to give that a bit more time to mature. I implemented it very
   quickly and I do not feel comfortable queueing this for 2.6.31.
 
  Right. Yes, better to test the stuff a bit more.
 
   In addition it is still unclear if Mauro will merge my v4l-dvb-subdev2
   tree for 2.6.31. I hope so, since otherwise it will hamper the
   development of this and other embedded platforms.
 
  Ok.
 
   I also need to add a new V4L2_CAP_MODULATOR (which needs a review as
   well).
  
   And finally I realized that we need to add some v4l2_modulator
   capabilities for the RDS encoder similar to the upcoming v4l2_tuner RDS
   capabilities as is described in this RFC:
  
   http://www.mail-archive.com/linux-media%40vger.kernel.org/msg02498.html
  
   I haven't had time to implement this RFC and I know that is not going
   to make 2.6.31. It's now almost at the top of my TODO list, so it
   should go in soon (pending unforeseen circumstances).
 
  Ok. I'll take a look at it.
 
 I've worked on this yesterday. You can take a look at my v4l-dvb-rds tree. 
 Both the API and the documentation of it in the v4l2-spec is in there. I 
 started work on updating the few RDS decoders that we have, but that is not 
 yet in that tree.
 
   As a result of rereading this RFC I also started to wonder about
   whether the si4713 supports the MMBS functionality. Do you know
   anything about that?
 
  No. Not that I know. Can you point some link?
 
 http://www.rds.org.uk/rdsfrdsrbds.html
 
 But I've just read here:
 
 http://www.rds.org.uk/rds98/pdf/rdsForum_standards_090414_8.pdf
 
 that MMBS is discontinued. I'll need to investigate this further, but if 
 this is indeed true then this can be removed completely from our RDS 
 decoder and encoder APIs.

Yes, better to double check. At least with si4713, I haven't heard anything 
about this.

 
 Regards,
 
   Hans
 
 
 
 -- 
 Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom

-- 
Eduardo Valentin
--
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


Re: [PATCHv7 7/9] FMTx: si4713: Add files to handle si4713 i2c device

2009-06-16 Thread Eduardo Valentin
On Tue, Jun 16, 2009 at 01:30:08PM +0200, Nurkkala Eero.An (EXT-Offcode/Oulu) 
wrote:
 On Tue, 2009-06-16 at 13:22 +0200, ext Hans Verkuil wrote:
  On Tuesday 16 June 2009 13:06:09 Eduardo Valentin wrote:
   On Sun, Jun 14, 2009 at 02:31:55PM +0200, ext Hans Verkuil wrote:
 + if (rval  0)
 + goto exit;
 +
 + /* TODO: How to set frequency to measure current signal length
 */
   
Huh? I don't understand this TODO.
  
   The todo is about the property this device had, to report signal length
  
  'signal length' or 'signal strength'? If it is the former, then I don't 
  understand what you mean with that term.
  
   of a freq. It used to work like: user echoes the freq on sysfs entry.
   when reading the same entry, it reports the signal noise there.
  
   This is something which I still don't know the proper place to put.
  
   I thought in another ext control. But I don't know if this fix into
   the fm tx controls. Maybe I should use a private one ?
  
  I need to understand this better first.
  
  Regards,
  
  Hans
  
 
 Transmitter turns into a receiver and measures the RSSI level of
 the frequency. If it's high ( -90 -100dB), it's probably not a good
 idea to transmit any on such frequency as the interference is too great.

Yes, sorry I've made some really bad phrasing. It is Strength. It is a
feature to measure Received Signal Strength Indication (RSSI). As mentioned
by Eero, it's not a good idea to transmit any on freq which the measurement is 
being done.

 
 - Eero

-- 
Eduardo Valentin
--
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


Re: [PATCHv7 2/9] v4l2: video device: Add V4L2_CTRL_CLASS_FM_TX controls

2009-06-16 Thread Eduardo Valentin
On Tue, Jun 16, 2009 at 01:18:57PM +0200, ext Hans Verkuil wrote:
 On Tuesday 16 June 2009 12:52:34 Eduardo Valentin wrote:
   It is my believe that the other fm_tx controls are unambiguously
   transmitter related, so I don't think they need a TX prefix. It doesn't
   hurt if someone can double check that, though.
 
  hmm.. I see no problem removing the fmtx prefix of the preemphasis
  enum. But, if it is becoming a generic enum, better to check if its
  meaning is the same of existing emphasis enum for mpeg.
 
 It has the same meaning, but unfortunately the mpeg enum is already a public 
 API and so cannot be changed. I never realized at the time that that enum 
 is more generic than I thought.
 
 But at least this enum can be made generic.

Yes, sure.

 
 Regards,
 
   Hans
 
 -- 
 Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom
 --
 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

-- 
Eduardo Valentin
--
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


Re: [PATCHv7 2/9] v4l2: video device: Add V4L2_CTRL_CLASS_FM_TX controls

2009-06-14 Thread Eduardo Valentin
Hi Hans,

On Sun, Jun 14, 2009 at 1:46 PM, Hans Verkuilhverk...@xs4all.nl wrote:
 On Friday 12 June 2009 19:30:33 Eduardo Valentin wrote:
 This patch adds a new class of extended controls. This class
 is intended to support FM Radio Modulators properties such as:
 rds, audio limiters, audio compression, pilot tone generation,
 tuning power levels and preemphasis properties.

 Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
 ---
  linux/include/linux/videodev2.h |   34 ++
  1 files changed, 34 insertions(+), 0 deletions(-)

 diff --git a/linux/include/linux/videodev2.h 
 b/linux/include/linux/videodev2.h
 index b8cffc9..9733435 100644
 --- a/linux/include/linux/videodev2.h
 +++ b/linux/include/linux/videodev2.h
 @@ -806,6 +806,7 @@ struct v4l2_ext_controls {
  #define V4L2_CTRL_CLASS_USER 0x0098      /* Old-style 'user' controls */
  #define V4L2_CTRL_CLASS_MPEG 0x0099      /* MPEG-compression controls */
  #define V4L2_CTRL_CLASS_CAMERA 0x009a    /* Camera class controls */
 +#define V4L2_CTRL_CLASS_FM_TX 0x009b     /* FM Modulator control class 
 */

  #define V4L2_CTRL_ID_MASK              (0x0fff)
  #define V4L2_CTRL_ID2CLASS(id)    ((id)  0x0fffUL)
 @@ -1144,6 +1145,39 @@ enum  v4l2_exposure_auto_type {

  #define V4L2_CID_PRIVACY                     (V4L2_CID_CAMERA_CLASS_BASE+16)

 +/* FM Modulator class control IDs */
 +#define V4L2_CID_FM_TX_CLASS_BASE            (V4L2_CTRL_CLASS_FM_TX | 0x900)
 +#define V4L2_CID_FM_TX_CLASS                 (V4L2_CTRL_CLASS_FM_TX | 1)
 +
 +#define V4L2_CID_RDS_ENABLED                 (V4L2_CID_FM_TX_CLASS_BASE + 1)
 +#define V4L2_CID_RDS_PI                              
 (V4L2_CID_FM_TX_CLASS_BASE + 2)
 +#define V4L2_CID_RDS_PTY                     (V4L2_CID_FM_TX_CLASS_BASE + 3)
 +#define V4L2_CID_RDS_PS_NAME                 (V4L2_CID_FM_TX_CLASS_BASE + 4)
 +#define V4L2_CID_RDS_RADIO_TEXT                      
 (V4L2_CID_FM_TX_CLASS_BASE + 5)

 I think these RDS controls should be renamed to V4L2_CID_RDS_TX_. This makes
 it clear that these controls relate to the RDS transmitter instead of a
 receiver. I would not be surprised to see similar controls appear for an RDS
 receiver in the future.

 +
 +#define V4L2_CID_AUDIO_LIMITER_ENABLED               
 (V4L2_CID_FM_TX_CLASS_BASE + 6)
 +#define V4L2_CID_AUDIO_LIMITER_RELEASE_TIME  (V4L2_CID_FM_TX_CLASS_BASE + 7)
 +#define V4L2_CID_AUDIO_LIMITER_DEVIATION     (V4L2_CID_FM_TX_CLASS_BASE + 8)
 +
 +#define V4L2_CID_AUDIO_COMPRESSION_ENABLED   (V4L2_CID_FM_TX_CLASS_BASE + 9)
 +#define V4L2_CID_AUDIO_COMPRESSION_GAIN              
 (V4L2_CID_FM_TX_CLASS_BASE + 10)
 +#define V4L2_CID_AUDIO_COMPRESSION_THRESHOLD (V4L2_CID_FM_TX_CLASS_BASE + 
 11)
 +#define V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME       
 (V4L2_CID_FM_TX_CLASS_BASE + 12)
 +#define V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME      
 (V4L2_CID_FM_TX_CLASS_BASE + 13)
 +
 +#define V4L2_CID_PILOT_TONE_ENABLED          (V4L2_CID_FM_TX_CLASS_BASE + 
 14)
 +#define V4L2_CID_PILOT_TONE_DEVIATION                
 (V4L2_CID_FM_TX_CLASS_BASE + 15)
 +#define V4L2_CID_PILOT_TONE_FREQUENCY                
 (V4L2_CID_FM_TX_CLASS_BASE + 16)
 +
 +#define V4L2_CID_PREEMPHASIS                 (V4L2_CID_FM_TX_CLASS_BASE + 
 17)
 +enum v4l2_fm_tx_preemphasis {
 +     V4L2_FM_TX_PREEMPHASIS_DISABLED         = 0,
 +     V4L2_FM_TX_PREEMPHASIS_50_uS            = 1,
 +     V4L2_FM_TX_PREEMPHASIS_75_uS            = 2,
 +};

 I suggest renaming this to V4L2_CID_FM_TX_PREEMPHASIS. There is already a
 similar V4L2_CID_MPEG_EMPHASIS control and others might well appear in the
 future, so I think this name should be more specific to the FM_TX API.

Right. Agreed for both suggestions.


 +#define V4L2_CID_TUNE_POWER_LEVEL            (V4L2_CID_FM_TX_CLASS_BASE + 
 18)
 +#define V4L2_CID_TUNE_ANTENNA_CAPACITOR              
 (V4L2_CID_FM_TX_CLASS_BASE + 19)
 +
  /*
   *   T U N I N G
   */

 Regards,

        Hans

 --
 Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom
 --
 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




-- 
Eduardo Bezerra Valentin
--
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


Re: [PATCHv7 5/9] v4l2-spec: Add documentation description for FM TX extended control class

2009-06-14 Thread Eduardo Valentin
Hi Hans,

On Sun, Jun 14, 2009 at 1:41 PM, Hans Verkuilhverk...@xs4all.nl wrote:
 On Friday 12 June 2009 19:30:36 Eduardo Valentin wrote:
 This single patch adds documentation description for FM Modulator (FM_TX)
 Extended Control Class and its Control IDs. The text was added under
 Extended Controls section.

 Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
 ---
  v4l2-spec/Makefile      |    1 +
  v4l2-spec/biblio.sgml   |   10 +++
  v4l2-spec/controls.sgml |  205 
 +++
  3 files changed, 216 insertions(+), 0 deletions(-)

 diff --git a/v4l2-spec/Makefile b/v4l2-spec/Makefile
 index 7a19924..bfe2965 100644
 --- a/v4l2-spec/Makefile
 +++ b/v4l2-spec/Makefile
 @@ -242,6 +242,7 @@ ENUMS = \
       v4l2_power_line_frequency \
       v4l2_priority \
       v4l2_tuner_type \
 +     v4l2_fm_tx_preemphasis \

  STRUCTS = \
       v4l2_audio \
 diff --git a/v4l2-spec/biblio.sgml b/v4l2-spec/biblio.sgml
 index b013ece..0921849 100644
 --- a/v4l2-spec/biblio.sgml
 +++ b/v4l2-spec/biblio.sgml
 @@ -11,6 +11,16 @@ 
 url=http://www.eia.org;http://www.eia.org/ulink)/corpauthor
  Service/title
      /biblioentry

 +    biblioentry id=en50067
 +      abbrevENnbsp;50067/abbrev
 +      authorgroup
 +     corpauthorCENELEC European Committee for Electrotechnical 
 Standardization
 +(ulink 
 url=http://www.cenelec.eu;http://www.cenelec.eu/ulink)/corpauthor
 +      /authorgroup
 +      titleEN 50067 Specification of the radio data system (RDS) for
 +VHF/FM sound broadcasting in the frequency range from 87,5 to 108,0 
 MHz/title
 +    /biblioentry
 +
      biblioentry id=en300294
        abbrevENnbsp;300nbsp;294/abbrev
        authorgroup
 diff --git a/v4l2-spec/controls.sgml b/v4l2-spec/controls.sgml
 index 477a970..0bb6f00 100644
 --- a/v4l2-spec/controls.sgml
 +++ b/v4l2-spec/controls.sgml
 @@ -458,6 +458,12 @@ video is actually encoded into that format./para
        paraUnfortunately, the original control API lacked some
  features needed for these new uses and so it was extended into the
  (not terribly originally named) extended control API./para
 +
 +      paraEven though the MPEG encoding API was the first effort
 +to use the Extended Control API, nowadays there are also other classes
 +of Extended Controls, such as Camera Controls and FM Transmitter Controls.
 +The Extended Controls API as well as all Extended Controls classes are
 +described in the following text./para
      /section

      section
 @@ -1816,6 +1822,205 @@ control must support read access and may support 
 write access./entry
        /tgroup
      /table
    /section
 +
 +    section id=fm-tx-controls
 +      titleFM Transmitter Control Reference/title
 +
 +      paraThe FM Transmitter (FM_TX) class includes controls for common 
 features of
 +FM transmissions capable devices. Currently this class include parameters 
 for audio
 +compression, pilot tone generation, audio deviation limiter, RDS 
 transmission and
 +tuning power features./para
 +
 +      table pgwide=1 frame=none id=fm-tx-control-id
 +      titleFM_TX Control IDs/title
 +
 +      tgroup cols=4
 +     colspec colname=c1 colwidth=1*
 +     colspec colname=c2 colwidth=6*
 +     colspec colname=c3 colwidth=2*
 +     colspec colname=c4 colwidth=6*
 +     spanspec namest=c1 nameend=c2 spanname=id
 +     spanspec namest=c2 nameend=c4 spanname=descr
 +     thead
 +       row
 +         entry spanname=id align=leftID/entry
 +         entry align=leftType/entry
 +       /rowrow rowsep=1entry spanname=descr 
 align=leftDescription/entry
 +       /row
 +     /thead
 +     tbody valign=top
 +       rowentry/entry/row
 +       row
 +         entry 
 spanname=idconstantV4L2_CID_FM_TX_CLASS/constantnbsp;/entry
 +         entryclass/entry
 +       /rowrowentry spanname=descrThe FM_TX class
 +descriptor. Calling VIDIOC-QUERYCTRL; for this control will return a
 +description of this control class./entry
 +       /row
 +       row
 +         entry 
 spanname=idconstantV4L2_CID_RDS_ENABLED/constantnbsp;/entry
 +         entryboolean/entry
 +       /row
 +       rowentry spanname=descrEnables or disables the RDS 
 transmission feature./entry
 +       /row
 +       row
 +         entry 
 spanname=idconstantV4L2_CID_RDS_PI/constantnbsp;/entry
 +         entryinteger/entry
 +       /row
 +       rowentry spanname=descrSets the RDS Programme Identification 
 field
 +for transmission./entry
 +       /row
 +       row
 +         entry 
 spanname=idconstantV4L2_CID_RDS_PTY/constantnbsp;/entry
 +         entryinteger/entry
 +       /row
 +       rowentry spanname=descrSets the RDS Programme Type field for 
 transmission.
 +This coding of up to 31 pre-defined programme types./entry

 coding - encodes

Right.


 +       /row
 +       row
 +         entry 
 spanname=idconstantV4L2_CID_RDS_PS_NAME/constantnbsp;/entry
 +         entrystring/entry
 +       /row
 +       rowentry spanname=descrSets the Programme Service name 
 (PS_NAME) for transmission

[PATCHv7 1/9] v4l2-subdev.h: Add g_modulator callbacks to subdev api

2009-06-12 Thread Eduardo Valentin
Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/include/media/v4l2-subdev.h |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/linux/include/media/v4l2-subdev.h 
b/linux/include/media/v4l2-subdev.h
index 5dcb367..4dc3788 100644
--- a/linux/include/media/v4l2-subdev.h
+++ b/linux/include/media/v4l2-subdev.h
@@ -137,6 +137,8 @@ struct v4l2_subdev_tuner_ops {
int (*g_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq);
int (*g_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
int (*s_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
+   int (*g_modulator)(struct v4l2_subdev *sd, struct v4l2_modulator *vm);
+   int (*s_modulator)(struct v4l2_subdev *sd, struct v4l2_modulator *vm);
int (*s_type_addr)(struct v4l2_subdev *sd, struct tuner_setup *type);
int (*s_config)(struct v4l2_subdev *sd, const struct 
v4l2_priv_tun_config *config);
int (*s_standby)(struct v4l2_subdev *sd);
-- 
1.6.2.GIT

--
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


[PATCHv7 2/9] v4l2: video device: Add V4L2_CTRL_CLASS_FM_TX controls

2009-06-12 Thread Eduardo Valentin
This patch adds a new class of extended controls. This class
is intended to support FM Radio Modulators properties such as:
rds, audio limiters, audio compression, pilot tone generation,
tuning power levels and preemphasis properties.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/include/linux/videodev2.h |   34 ++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h
index b8cffc9..9733435 100644
--- a/linux/include/linux/videodev2.h
+++ b/linux/include/linux/videodev2.h
@@ -806,6 +806,7 @@ struct v4l2_ext_controls {
 #define V4L2_CTRL_CLASS_USER 0x0098/* Old-style 'user' controls */
 #define V4L2_CTRL_CLASS_MPEG 0x0099/* MPEG-compression controls */
 #define V4L2_CTRL_CLASS_CAMERA 0x009a  /* Camera class controls */
+#define V4L2_CTRL_CLASS_FM_TX 0x009b   /* FM Modulator control class */
 
 #define V4L2_CTRL_ID_MASK(0x0fff)
 #define V4L2_CTRL_ID2CLASS(id)((id)  0x0fffUL)
@@ -1144,6 +1145,39 @@ enum  v4l2_exposure_auto_type {
 
 #define V4L2_CID_PRIVACY   (V4L2_CID_CAMERA_CLASS_BASE+16)
 
+/* FM Modulator class control IDs */
+#define V4L2_CID_FM_TX_CLASS_BASE  (V4L2_CTRL_CLASS_FM_TX | 0x900)
+#define V4L2_CID_FM_TX_CLASS   (V4L2_CTRL_CLASS_FM_TX | 1)
+
+#define V4L2_CID_RDS_ENABLED   (V4L2_CID_FM_TX_CLASS_BASE + 1)
+#define V4L2_CID_RDS_PI
(V4L2_CID_FM_TX_CLASS_BASE + 2)
+#define V4L2_CID_RDS_PTY   (V4L2_CID_FM_TX_CLASS_BASE + 3)
+#define V4L2_CID_RDS_PS_NAME   (V4L2_CID_FM_TX_CLASS_BASE + 4)
+#define V4L2_CID_RDS_RADIO_TEXT
(V4L2_CID_FM_TX_CLASS_BASE + 5)
+
+#define V4L2_CID_AUDIO_LIMITER_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 6)
+#define V4L2_CID_AUDIO_LIMITER_RELEASE_TIME(V4L2_CID_FM_TX_CLASS_BASE + 7)
+#define V4L2_CID_AUDIO_LIMITER_DEVIATION   (V4L2_CID_FM_TX_CLASS_BASE + 8)
+
+#define V4L2_CID_AUDIO_COMPRESSION_ENABLED (V4L2_CID_FM_TX_CLASS_BASE + 9)
+#define V4L2_CID_AUDIO_COMPRESSION_GAIN
(V4L2_CID_FM_TX_CLASS_BASE + 10)
+#define V4L2_CID_AUDIO_COMPRESSION_THRESHOLD   (V4L2_CID_FM_TX_CLASS_BASE + 11)
+#define V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME (V4L2_CID_FM_TX_CLASS_BASE + 12)
+#define V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME
(V4L2_CID_FM_TX_CLASS_BASE + 13)
+
+#define V4L2_CID_PILOT_TONE_ENABLED(V4L2_CID_FM_TX_CLASS_BASE + 14)
+#define V4L2_CID_PILOT_TONE_DEVIATION  (V4L2_CID_FM_TX_CLASS_BASE + 15)
+#define V4L2_CID_PILOT_TONE_FREQUENCY  (V4L2_CID_FM_TX_CLASS_BASE + 16)
+
+#define V4L2_CID_PREEMPHASIS   (V4L2_CID_FM_TX_CLASS_BASE + 17)
+enum v4l2_fm_tx_preemphasis {
+   V4L2_FM_TX_PREEMPHASIS_DISABLED = 0,
+   V4L2_FM_TX_PREEMPHASIS_50_uS= 1,
+   V4L2_FM_TX_PREEMPHASIS_75_uS= 2,
+};
+#define V4L2_CID_TUNE_POWER_LEVEL  (V4L2_CID_FM_TX_CLASS_BASE + 18)
+#define V4L2_CID_TUNE_ANTENNA_CAPACITOR
(V4L2_CID_FM_TX_CLASS_BASE + 19)
+
 /*
  * T U N I N G
  */
-- 
1.6.2.GIT

--
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


[PATCHv7 8/9] FMTx: si4713: Add Kconfig and Makefile entries

2009-06-12 Thread Eduardo Valentin
Simple add Makefile and Kconfig entries.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/drivers/media/radio/Kconfig  |   22 ++
 linux/drivers/media/radio/Makefile |2 ++
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/linux/drivers/media/radio/Kconfig 
b/linux/drivers/media/radio/Kconfig
index 3315cac..6c6a409 100644
--- a/linux/drivers/media/radio/Kconfig
+++ b/linux/drivers/media/radio/Kconfig
@@ -339,6 +339,28 @@ config RADIO_ZOLTRIX_PORT
help
  Enter the I/O port of your Zoltrix radio card.
 
+config I2C_SI4713
+   tristate I2C driver for Silicon Labs Si4713 device
+   depends on I2C  VIDEO_V4L2
+   ---help---
+ Say Y here if you want support to Si4713 I2C device.
+ This device driver supports only i2c bus.
+
+ To compile this driver as a module, choose M here: the
+ module will be called si4713.
+
+config RADIO_SI4713
+   tristate Silicon Labs Si4713 FM Radio Transmitter support
+   depends on I2C  VIDEO_V4L2
+   ---help---
+ Say Y here if you want support to Si4713 FM Radio Transmitter.
+ This device can transmit audio through FM. It can transmit
+ EDS and EBDS signals as well. This module is the v4l2 radio
+ interface for the i2c driver of this device.
+
+ To compile this driver as a module, choose M here: the
+ module will be called radio-si4713.
+
 config USB_DSBR
tristate D-Link/GemTek USB FM radio support
depends on USB  VIDEO_V4L2
diff --git a/linux/drivers/media/radio/Makefile 
b/linux/drivers/media/radio/Makefile
index 0f2b35b..34ae761 100644
--- a/linux/drivers/media/radio/Makefile
+++ b/linux/drivers/media/radio/Makefile
@@ -15,6 +15,8 @@ obj-$(CONFIG_RADIO_ZOLTRIX) += radio-zoltrix.o
 obj-$(CONFIG_RADIO_GEMTEK) += radio-gemtek.o
 obj-$(CONFIG_RADIO_GEMTEK_PCI) += radio-gemtek-pci.o
 obj-$(CONFIG_RADIO_TRUST) += radio-trust.o
+obj-$(CONFIG_I2C_SI4713) += si4713-i2c.o
+obj-$(CONFIG_RADIO_SI4713) += radio-si4713.o
 obj-$(CONFIG_RADIO_MAESTRO) += radio-maestro.o
 obj-$(CONFIG_USB_DSBR) += dsbr100.o
 obj-$(CONFIG_USB_SI470X) += radio-si470x.o
-- 
1.6.2.GIT

--
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


[PATCHv7 4/9] v4l2-ctl: Add support for FM TX controls

2009-06-12 Thread Eduardo Valentin
This patch adds simple support for FM TX extended controls
on v4l2-ctl utility.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 v4l2-apps/util/v4l2-ctl.cpp |   36 
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/v4l2-apps/util/v4l2-ctl.cpp b/v4l2-apps/util/v4l2-ctl.cpp
index 2c7290f..45a2310 100644
--- a/v4l2-apps/util/v4l2-ctl.cpp
+++ b/v4l2-apps/util/v4l2-ctl.cpp
@@ -148,6 +148,7 @@ typedef std::vectorstruct v4l2_ext_control ctrl_list;
 static ctrl_list user_ctrls;
 static ctrl_list mpeg_ctrls;
 static ctrl_list camera_ctrls;
+static ctrl_list fm_tx_ctrls;
 
 typedef std::mapstd::string, unsigned ctrl_strmap;
 static ctrl_strmap ctrl_str2id;
@@ -2166,6 +2167,8 @@ set_vid_fmt_error:
mpeg_ctrls.push_back(ctrl);
else if (V4L2_CTRL_ID2CLASS(ctrl.id) == 
V4L2_CTRL_CLASS_CAMERA)
camera_ctrls.push_back(ctrl);
+   else if (V4L2_CTRL_ID2CLASS(ctrl.id) == 
V4L2_CTRL_CLASS_FM_TX)
+   fm_tx_ctrls.push_back(ctrl);
else
user_ctrls.push_back(ctrl);
}
@@ -2212,6 +2215,22 @@ set_vid_fmt_error:
}
}
}
+   if (fm_tx_ctrls.size()) {
+   ctrls.ctrl_class = V4L2_CTRL_CLASS_FM_TX;
+   ctrls.count = fm_tx_ctrls.size();
+   ctrls.controls = fm_tx_ctrls[0];
+   if (doioctl(fd, VIDIOC_S_EXT_CTRLS, ctrls, 
VIDIOC_S_EXT_CTRLS)) {
+   if (ctrls.error_idx = ctrls.count) {
+   fprintf(stderr, Error setting FM 
Modulator controls: %s\n,
+   strerror(errno));
+   }
+   else {
+   fprintf(stderr, %s: %s\n,
+   
ctrl_id2str[fm_tx_ctrls[ctrls.error_idx].id].c_str(),
+   strerror(errno));
+   }
+   }
+   }
}
 
/* Get options */
@@ -2429,6 +2448,7 @@ set_vid_fmt_error:
mpeg_ctrls.clear();
camera_ctrls.clear();
user_ctrls.clear();
+   fm_tx_ctrls.clear();
for (ctrl_get_list::iterator iter = get_ctrls.begin();
iter != get_ctrls.end(); ++iter) {
struct v4l2_ext_control ctrl = { 0 };
@@ -2443,6 +2463,8 @@ set_vid_fmt_error:
mpeg_ctrls.push_back(ctrl);
else if (V4L2_CTRL_ID2CLASS(ctrl.id) == 
V4L2_CTRL_CLASS_CAMERA)
camera_ctrls.push_back(ctrl);
+   else if (V4L2_CTRL_ID2CLASS(ctrl.id) == 
V4L2_CTRL_CLASS_FM_TX)
+   fm_tx_ctrls.push_back(ctrl);
else
user_ctrls.push_back(ctrl);
}
@@ -2481,6 +2503,20 @@ set_vid_fmt_error:
printf(%s: %d\n, 
ctrl_id2str[ctrl.id].c_str(), ctrl.value);
}
}
+   if (fm_tx_ctrls.size()) {
+   ctrls.ctrl_class = V4L2_CTRL_CLASS_FM_TX;
+   ctrls.count = fm_tx_ctrls.size();
+   ctrls.controls = fm_tx_ctrls[0];
+   doioctl(fd, VIDIOC_G_EXT_CTRLS, ctrls, 
VIDIOC_G_EXT_CTRLS);
+   for (unsigned i = 0; i  fm_tx_ctrls.size(); i++) {
+   struct v4l2_ext_control ctrl = fm_tx_ctrls[i];
+
+   if (ctrl_id2type[ctrl.id] == 
V4L2_CTRL_TYPE_STRING)
+   printf(%s: '%s'\n, 
ctrl_id2str[ctrl.id].c_str(), ctrl.string);
+   else
+   printf(%s: %d\n, 
ctrl_id2str[ctrl.id].c_str(), ctrl.value);
+   }
+   }
}
 
if (options[OptGetTuner]) {
-- 
1.6.2.GIT

--
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


[PATCHv7 9/9] FMTx: si4713: Add document file

2009-06-12 Thread Eduardo Valentin
This patch adds a document file for si4713 device driver.
It describes the driver interfaces and organization.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/Documentation/video4linux/si4713.txt |  137 
 1 files changed, 137 insertions(+), 0 deletions(-)
 create mode 100644 linux/Documentation/video4linux/si4713.txt

diff --git a/linux/Documentation/video4linux/si4713.txt 
b/linux/Documentation/video4linux/si4713.txt
new file mode 100644
index 000..46e5e58
--- /dev/null
+++ b/linux/Documentation/video4linux/si4713.txt
@@ -0,0 +1,137 @@
+Driver for I2C radios for the Silicon Labs Si4713 FM Radio Transmitters
+
+Copyright (c) 2009 Nokia Corporation
+Contact: Eduardo Valentin eduardo.valen...@nokia.com
+
+
+Information about the Device
+
+This chip is a Silicon Labs product. It is a I2C device, currently on 0×63 
address.
+Basically, it has transmission and signal noise level measurement features.
+
+The Si4713 integrates transmit functions for FM broadcast stereo transmission.
+The chip also allows integrated receive power scanning to identify low signal
+power FM channels.
+
+The chip is programmed using commands and responses. There are also several
+properties which can change the behavior of this chip.
+
+Users must comply with local regulations on radio frequency (RF) transmission.
+
+Device driver description
+=
+There are two modules to handle this device. One is a I2C device driver
+and the other is a platform driver.
+
+The I2C device driver exports a v4l2-subdev interface to the kernel.
+All properties can also be accessed by v4l2 extended controls interface, by
+using the v4l2-subdev calls (g_ext_ctrls, s_ext_ctrls).
+
+The platform device driver exports a v4l2 radio device interface to user land.
+So, it uses the I2C device driver as a sub device in order to send the user
+commands to the actual device. Basically it is a wrapper to the I2C device 
driver.
+
+Applications can use v4l2 radio API to specify frequency of operation, mute 
state,
+etc. But mostly of its properties will be present in the extended controls.
+
+When the v4l2 mute property is set to 1 (true), the driver will turn the chip 
off.
+
+Properties description
+==
+
+The properties can be accessed using v4l2 extended controls.
+Here is an output from v4l2-ctl util:
+
+# v4l2-ctl -d /dev/radio0 -l --all
+Driver Info:
+Driver name   : radio-si4713
+Card type : Silicon Labs Si4713 Modulator
+Bus info  : 
+Driver version: 0
+Capabilities  : 0x0008
+Modulator
+Audio output: 0 (FM Modulator Audio Out)
+Frequency: 1408000 (88000.00 MHz)
+Video Standard = 0x
+Modulator:
+Name : FM Modulator
+Capabilities : 62.5 Hz stereo 
+Frequency range  : 76.0 MHz - 108.0 MHz
+Available subchannels: mono stereo 
+
+User Controls
+
+   mute (bool) : default=1 value=0
+
+FM Radio Modulator Controls
+
+rds_feature_enabled (bool) : default=1 value=1
+ rds_program_id (int)  : min=0 max=65535 step=1 default=0 
value=0
+   rds_program_type (int)  : min=0 max=31 step=1 default=0 value=0
+rds_ps_name (str)  : value='Si4713  ' len=8
+' len=9  rds_radio_text (str)  : value='Si4713  
+  audio_limiter_feature_enabled (bool) : default=1 value=1
+ audio_limiter_release_time (int)  : min=250 max=102390 step=50 
default=5010 value=5010 flags=slider
+audio_limiter_deviation (int)  : min=0 max=9 step=10 default=66250 
value=66250 flags=slider
+audio_compression_feature_enabl (bool) : default=1 value=1
+ audio_compression_gain (int)  : min=0 max=20 step=1 default=15 
value=15 flags=slider
+audio_compression_threshold (int)  : min=-40 max=0 step=1 default=-40 
value=-40 flags=slider
+  audio_compression_attack_time (int)  : min=0 max=5000 step=500 default=0 
value=2000 flags=slider
+ audio_compression_release_time (int)  : min=10 max=100 step=10 
default=100 value=100 flags=slider
+ pilot_tone_feature_enabled (bool) : default=1 value=1
+   pilot_tone_deviation (int)  : min=0 max=9 step=10 default=6750 
value=6750 flags=slider
+   pilot_tone_frequency (int)  : min=0 max=19000 step=1 default=19000 
value=19000 flags=slider
+  pre_emphasis_settings (menu) : min=0 max=2 default=1 value=2
+   tune_power_level (int)  : min=0 max=120 step=1 default=88 
value=88 flags=slider
+ tune_antenna_capacitor (int)  : min=0 max=191 step=1 default=0 
value=110 flags=slider
+
+Here is a summary of them:
+
+* Pilot is an audible tone sent by the device.
+
+pilot_frequency - Configures the frequency of the stereo pilot tone.
+pilot_deviation - Configures pilot tone frequency deviation level.
+pilot_enabled - Enables or disables the pilot

[PATCHv7 6/9] FMTx: si4713: Add files to add radio interface for si4713

2009-06-12 Thread Eduardo Valentin
This patch adds files which creates the radio interface
for si4713 FM transmitter (modulator) devices.

In order to do the real access to device registers, this
driver uses the v4l2 subdev interface exported by si4713 i2c driver.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/drivers/media/radio/radio-si4713.c |  325 ++
 linux/include/media/si4713.h |   40 
 2 files changed, 365 insertions(+), 0 deletions(-)
 create mode 100644 linux/drivers/media/radio/radio-si4713.c
 create mode 100644 linux/include/media/si4713.h

diff --git a/linux/drivers/media/radio/radio-si4713.c 
b/linux/drivers/media/radio/radio-si4713.c
new file mode 100644
index 000..4c23120
--- /dev/null
+++ b/linux/drivers/media/radio/radio-si4713.c
@@ -0,0 +1,325 @@
+/*
+ * drivers/media/radio/radio-si4713.c
+ *
+ * Platform Driver for Silicon Labs Si4713 FM Radio Transmitter:
+ *
+ * Copyright (c) 2008 Instituto Nokia de Tecnologia - INdT
+ * Contact: Eduardo Valentin eduardo.valen...@nokia.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include linux/kernel.h
+#include linux/module.h
+#include linux/init.h
+#include linux/version.h
+#include linux/platform_device.h
+#include linux/i2c.h
+#include linux/videodev2.h
+#include media/v4l2-device.h
+#include media/v4l2-common.h
+#include media/v4l2-ioctl.h
+#include media/si4713.h
+
+/* Driver state struct */
+struct radio_si4713_device {
+   struct v4l2_device  v4l2_dev;
+   struct video_device *radio_dev;
+};
+
+/* module parameters */
+static int radio_nr = -1;  /* radio device minor (-1 == auto assign) */
+
+/* radio_si4713_fops - file operations interface */
+static const struct v4l2_file_operations radio_si4713_fops = {
+   .owner  = THIS_MODULE,
+   .ioctl  = video_ioctl2,
+};
+
+/* Video4Linux Interface */
+static int radio_si4713_fill_audout(struct v4l2_audioout *vao)
+{
+   /* TODO: check presence of audio output */
+   memset(vao, 0, sizeof(*vao));
+   strlcpy(vao-name, FM Modulator Audio Out, 32);
+
+   return 0;
+}
+
+static int radio_si4713_enumaudout(struct file *file, void *priv,
+   struct v4l2_audioout *vao)
+{
+   return radio_si4713_fill_audout(vao);
+}
+
+static int radio_si4713_g_audout(struct file *file, void *priv,
+   struct v4l2_audioout *vao)
+{
+   int rval = radio_si4713_fill_audout(vao);
+
+   vao-index = 0;
+
+   return rval;
+}
+
+static int radio_si4713_s_audout(struct file *file, void *priv,
+   struct v4l2_audioout *vao)
+{
+   if (vao-index != 0)
+   return -EINVAL;
+
+   return radio_si4713_fill_audout(vao);
+}
+
+/* radio_si4713_querycap - query device capabilities */
+static int radio_si4713_querycap(struct file *file, void *priv,
+   struct v4l2_capability *capability)
+{
+   struct radio_si4713_device *rsdev;
+
+   rsdev = video_get_drvdata(video_devdata(file));
+
+   strlcpy(capability-driver, radio-si4713, sizeof(capability-driver));
+   strlcpy(capability-card, Silicon Labs Si4713 Modulator,
+   sizeof(capability-card));
+   capability-capabilities = V4L2_CAP_MODULATOR;
+
+   return 0;
+}
+
+/* radio_si4713_queryctrl - enumerate control items */
+static int radio_si4713_queryctrl(struct file *file, void *priv,
+   struct v4l2_queryctrl *qc)
+{
+
+   /* Must be sorted from low to high control ID! */
+   static const u32 user_ctrls[] = {
+   V4L2_CID_USER_CLASS,
+   V4L2_CID_AUDIO_MUTE,
+   0
+   };
+
+   /* Must be sorted from low to high control ID! */
+   static const u32 fmtx_ctrls[] = {
+   V4L2_CID_FM_TX_CLASS,
+   V4L2_CID_RDS_ENABLED,
+   V4L2_CID_RDS_PI,
+   V4L2_CID_RDS_PTY,
+   V4L2_CID_RDS_PS_NAME,
+   V4L2_CID_RDS_RADIO_TEXT,
+   V4L2_CID_AUDIO_LIMITER_ENABLED,
+   V4L2_CID_AUDIO_LIMITER_RELEASE_TIME,
+   V4L2_CID_AUDIO_LIMITER_DEVIATION

[PATCHv7 3/9] v4l2: video device: Add FM_TX controls default configurations

2009-06-12 Thread Eduardo Valentin
Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 linux/drivers/media/video/v4l2-common.c |   50 +++
 1 files changed, 50 insertions(+), 0 deletions(-)

diff --git a/linux/drivers/media/video/v4l2-common.c 
b/linux/drivers/media/video/v4l2-common.c
index 5cfd727..9b6cf9f 100644
--- a/linux/drivers/media/video/v4l2-common.c
+++ b/linux/drivers/media/video/v4l2-common.c
@@ -345,6 +345,12 @@ const char **v4l2_ctrl_get_menu(u32 id)
Sepia,
NULL
};
+   static const char *fm_tx_preemphasis[] = {
+   No preemphasis,
+   50 useconds,
+   75 useconds,
+   NULL,
+   };
 
switch (id) {
case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ:
@@ -383,6 +389,8 @@ const char **v4l2_ctrl_get_menu(u32 id)
return camera_exposure_auto;
case V4L2_CID_COLORFX:
return colorfx;
+   case V4L2_CID_PREEMPHASIS:
+   return fm_tx_preemphasis;
default:
return NULL;
}
@@ -481,6 +489,28 @@ const char *v4l2_ctrl_get_name(u32 id)
case V4L2_CID_ZOOM_CONTINUOUS:  return Zoom, Continuous;
case V4L2_CID_PRIVACY:  return Privacy;
 
+   /* FM Radio Modulator control */
+   case V4L2_CID_FM_TX_CLASS:  return FM Radio Modulator 
Controls;
+   case V4L2_CID_RDS_ENABLED:  return RDS Feature Enabled;
+   case V4L2_CID_RDS_PI:   return RDS Program ID;
+   case V4L2_CID_RDS_PTY:  return RDS Program Type;
+   case V4L2_CID_RDS_PS_NAME:  return RDS PS Name;
+   case V4L2_CID_RDS_RADIO_TEXT:   return RDS Radio Text;
+   case V4L2_CID_AUDIO_LIMITER_ENABLED:return Audio Limiter Feature 
Enabled;
+   case V4L2_CID_AUDIO_LIMITER_RELEASE_TIME: return Audio Limiter Release 
Time;
+   case V4L2_CID_AUDIO_LIMITER_DEVIATION:  return Audio Limiter 
Deviation;
+   case V4L2_CID_AUDIO_COMPRESSION_ENABLED: return Audio Compression 
Feature Enabled;
+   case V4L2_CID_AUDIO_COMPRESSION_GAIN:   return Audio Compression Gain;
+   case V4L2_CID_AUDIO_COMPRESSION_THRESHOLD: return Audio Compression 
Threshold;
+   case V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME: return Audio Compression 
Attack Time;
+   case V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME: return Audio Compression 
Release Time;
+   case V4L2_CID_PILOT_TONE_ENABLED:   return Pilot Tone Feature 
Enabled;
+   case V4L2_CID_PILOT_TONE_DEVIATION: return Pilot Tone Deviation;
+   case V4L2_CID_PILOT_TONE_FREQUENCY: return Pilot Tone Frequency;
+   case V4L2_CID_PREEMPHASIS:  return Pre-emphasis settings;
+   case V4L2_CID_TUNE_POWER_LEVEL: return Tune Power Level;
+   case V4L2_CID_TUNE_ANTENNA_CAPACITOR:   return Tune Antenna Capacitor;
+
default:
return NULL;
}
@@ -513,6 +543,10 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 
min, s32 max, s32 ste
case V4L2_CID_EXPOSURE_AUTO_PRIORITY:
case V4L2_CID_FOCUS_AUTO:
case V4L2_CID_PRIVACY:
+   case V4L2_CID_RDS_ENABLED:
+   case V4L2_CID_AUDIO_LIMITER_ENABLED:
+   case V4L2_CID_AUDIO_COMPRESSION_ENABLED:
+   case V4L2_CID_PILOT_TONE_ENABLED:
qctrl-type = V4L2_CTRL_TYPE_BOOLEAN;
min = 0;
max = step = 1;
@@ -541,12 +575,18 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, 
s32 min, s32 max, s32 ste
case V4L2_CID_MPEG_STREAM_VBI_FMT:
case V4L2_CID_EXPOSURE_AUTO:
case V4L2_CID_COLORFX:
+   case V4L2_CID_PREEMPHASIS:
qctrl-type = V4L2_CTRL_TYPE_MENU;
step = 1;
break;
+   case V4L2_CID_RDS_PS_NAME:
+   case V4L2_CID_RDS_RADIO_TEXT:
+   qctrl-type = V4L2_CTRL_TYPE_STRING;
+   break;
case V4L2_CID_USER_CLASS:
case V4L2_CID_CAMERA_CLASS:
case V4L2_CID_MPEG_CLASS:
+   case V4L2_CID_FM_TX_CLASS:
qctrl-type = V4L2_CTRL_TYPE_CTRL_CLASS;
qctrl-flags |= V4L2_CTRL_FLAG_READ_ONLY;
min = max = step = def = 0;
@@ -575,6 +615,16 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 
min, s32 max, s32 ste
case V4L2_CID_BLUE_BALANCE:
case V4L2_CID_GAMMA:
case V4L2_CID_SHARPNESS:
+   case V4L2_CID_AUDIO_LIMITER_RELEASE_TIME:
+   case V4L2_CID_AUDIO_LIMITER_DEVIATION:
+   case V4L2_CID_AUDIO_COMPRESSION_GAIN:
+   case V4L2_CID_AUDIO_COMPRESSION_THRESHOLD:
+   case V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME:
+   case V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME:
+   case V4L2_CID_PILOT_TONE_DEVIATION:
+   case V4L2_CID_PILOT_TONE_FREQUENCY:
+   case V4L2_CID_TUNE_POWER_LEVEL:
+   case

[PATCHv7 5/9] v4l2-spec: Add documentation description for FM TX extended control class

2009-06-12 Thread Eduardo Valentin
This single patch adds documentation description for FM Modulator (FM_TX)
Extended Control Class and its Control IDs. The text was added under
Extended Controls section.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 v4l2-spec/Makefile  |1 +
 v4l2-spec/biblio.sgml   |   10 +++
 v4l2-spec/controls.sgml |  205 +++
 3 files changed, 216 insertions(+), 0 deletions(-)

diff --git a/v4l2-spec/Makefile b/v4l2-spec/Makefile
index 7a19924..bfe2965 100644
--- a/v4l2-spec/Makefile
+++ b/v4l2-spec/Makefile
@@ -242,6 +242,7 @@ ENUMS = \
v4l2_power_line_frequency \
v4l2_priority \
v4l2_tuner_type \
+   v4l2_fm_tx_preemphasis \
 
 STRUCTS = \
v4l2_audio \
diff --git a/v4l2-spec/biblio.sgml b/v4l2-spec/biblio.sgml
index b013ece..0921849 100644
--- a/v4l2-spec/biblio.sgml
+++ b/v4l2-spec/biblio.sgml
@@ -11,6 +11,16 @@ 
url=http://www.eia.org;http://www.eia.org/ulink)/corpauthor
 Service/title
 /biblioentry
 
+biblioentry id=en50067
+  abbrevENnbsp;50067/abbrev
+  authorgroup
+   corpauthorCENELEC European Committee for Electrotechnical 
Standardization
+(ulink url=http://www.cenelec.eu;http://www.cenelec.eu/ulink)/corpauthor
+  /authorgroup
+  titleEN 50067 Specification of the radio data system (RDS) for
+VHF/FM sound broadcasting in the frequency range from 87,5 to 108,0 
MHz/title
+/biblioentry
+
 biblioentry id=en300294
   abbrevENnbsp;300nbsp;294/abbrev
   authorgroup
diff --git a/v4l2-spec/controls.sgml b/v4l2-spec/controls.sgml
index 477a970..0bb6f00 100644
--- a/v4l2-spec/controls.sgml
+++ b/v4l2-spec/controls.sgml
@@ -458,6 +458,12 @@ video is actually encoded into that format./para
   paraUnfortunately, the original control API lacked some
 features needed for these new uses and so it was extended into the
 (not terribly originally named) extended control API./para
+
+  paraEven though the MPEG encoding API was the first effort
+to use the Extended Control API, nowadays there are also other classes
+of Extended Controls, such as Camera Controls and FM Transmitter Controls.
+The Extended Controls API as well as all Extended Controls classes are
+described in the following text./para
 /section
 
 section
@@ -1816,6 +1822,205 @@ control must support read access and may support write 
access./entry
   /tgroup
 /table
   /section
+
+section id=fm-tx-controls
+  titleFM Transmitter Control Reference/title
+
+  paraThe FM Transmitter (FM_TX) class includes controls for common 
features of
+FM transmissions capable devices. Currently this class include parameters for 
audio
+compression, pilot tone generation, audio deviation limiter, RDS transmission 
and
+tuning power features./para
+
+  table pgwide=1 frame=none id=fm-tx-control-id
+  titleFM_TX Control IDs/title
+
+  tgroup cols=4
+   colspec colname=c1 colwidth=1*
+   colspec colname=c2 colwidth=6*
+   colspec colname=c3 colwidth=2*
+   colspec colname=c4 colwidth=6*
+   spanspec namest=c1 nameend=c2 spanname=id
+   spanspec namest=c2 nameend=c4 spanname=descr
+   thead
+ row
+   entry spanname=id align=leftID/entry
+   entry align=leftType/entry
+ /rowrow rowsep=1entry spanname=descr 
align=leftDescription/entry
+ /row
+   /thead
+   tbody valign=top
+ rowentry/entry/row
+ row
+   entry 
spanname=idconstantV4L2_CID_FM_TX_CLASS/constantnbsp;/entry
+   entryclass/entry
+ /rowrowentry spanname=descrThe FM_TX class
+descriptor. Calling VIDIOC-QUERYCTRL; for this control will return a
+description of this control class./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_ENABLED/constantnbsp;/entry
+   entryboolean/entry
+ /row
+ rowentry spanname=descrEnables or disables the RDS transmission 
feature./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_PI/constantnbsp;/entry
+   entryinteger/entry
+ /row
+ rowentry spanname=descrSets the RDS Programme Identification 
field
+for transmission./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_PTY/constantnbsp;/entry
+   entryinteger/entry
+ /row
+ rowentry spanname=descrSets the RDS Programme Type field for 
transmission.
+This coding of up to 31 pre-defined programme types./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_PS_NAME/constantnbsp;/entry
+   entrystring/entry
+ /row
+ rowentry spanname=descrSets the Programme Service name 
(PS_NAME) for transmission.
+It is intended for static display on a receiver. It is the primary aid to 
listeners in programme service
+identification and selection. The use of PS to transmit text other than a 
single eight character name

Re: [PATCHv6 5 of 7] FMTx: si4713: Add files to add radio interface for si4713

2009-06-09 Thread Eduardo Valentin
Hi Hans,

On Tue, Jun 09, 2009 at 12:41:38PM +0200, ext Hans Verkuil wrote:
 On Monday 08 June 2009 10:18:05 Eduardo Valentin wrote:
  From: Eduardo Valentin eduardo.valen...@nokia.com
 
  # HG changeset patch
  # User Eduardo Valentin eduardo.valen...@nokia.com
  # Date 126611 -10800
  # Node ID 92ec243dd1882c136a588898dd5b7a1913ca0f4b
  # Parent  2456c8fc506ecf928d2e95da36d611d094c0ec55
  This patch adds files which creates the radio interface
  for si4713 FM transmitter devices.
 
  Priority: normal
 
  Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
 
  diff -r 2456c8fc506e -r 92ec243dd188 
  linux/drivers/media/radio/radio-si4713.c
  --- /dev/null Thu Jan 01 00:00:00 1970 +
  +++ b/linux/drivers/media/radio/radio-si4713.cMon Jun 08 10:36:51 
  2009 +0300
  @@ -0,0 +1,332 @@
  +/*
  + * drivers/media/radio/radio-si4713.c
  + *
  + * Platform Driver for Silicon Labs Si4713 FM Radio Transmitter:
  + *
  + * Copyright (c) 2008 Instituto Nokia de Tecnologia - INdT
  + * Contact: Eduardo Valentin eduardo.valen...@nokia.com
  + *
  + * This program is free software; you can redistribute it and/or modify
  + * it under the terms of the GNU General Public License as published by
  + * the Free Software Foundation; either version 2 of the License, or
  + * (at your option) any later version.
  + *
  + * This program is distributed in the hope that it will be useful,
  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  + * GNU General Public License for more details.
  + *
  + * You should have received a copy of the GNU General Public License
  + * along with this program; if not, write to the Free Software
  + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  + */
  +
  +#include linux/kernel.h
  +#include linux/module.h
  +#include linux/init.h
  +#include linux/version.h
  +#include linux/platform_device.h
  +#include linux/i2c.h
  +#include linux/videodev2.h
  +#include media/v4l2-device.h
  +#include media/v4l2-common.h
  +#include media/v4l2-ioctl.h
  +
  +#include radio-si4713.h
  +#include si4713.h
  +
  +/* module parameters */
  +static int radio_nr = -1;/* radio device minor (-1 == auto assign) */
  +
  +/* radio_si4713_fops - file operations interface */
  +static const struct v4l2_file_operations radio_si4713_fops = {
  + .owner  = THIS_MODULE,
  + .ioctl  = video_ioctl2,
  +};
  +
  +/* Video4Linux Interface */
  +static int radio_si4713_vidioc_g_audio(struct file *file, void *priv,
  + struct v4l2_audio *audio)
  +{
  + if (audio-index  1)
  + return -EINVAL;
  +
  + strncpy(audio-name, Radio, 32);
  + audio-capability = V4L2_AUDCAP_STEREO;
  +
  + return 0;
  +}
  +
  +static int radio_si4713_vidioc_s_audio(struct file *file, void *priv,
  + struct v4l2_audio *audio)
  +{
  + if (audio-index != 0)
  + return -EINVAL;
  +
  + return 0;
  +}
 
 This is a transmitter (aka modulator) device, so it should implement g_audout,
 s_audout and enumaudout rather than s_audio and g_audio.
 
  +
  +static int radio_si4713_vidioc_g_input(struct file *file, void *priv,
  + unsigned int *i)
  +{
  + *i = 0;
  +
  + return 0;
  +}
  +
  +static int radio_si4713_vidioc_s_input(struct file *file, void *priv,
  + unsigned int i)
  +{
  + if (i != 0)
  + return -EINVAL;
  +
  + return 0;
  +}
 
 These are not needed: it is an audio only device, so no video. Since g/s_input
 deals with video inputs these are not relevant. And even if it was, then it
 would have to be g/s_output :-)
 
  +
  +/* radio_si4713_vidioc_querycap - query device capabilities */
  +static int radio_si4713_vidioc_querycap(struct file *file, void *priv,
  + struct v4l2_capability *capability)
  +{
  + struct radio_si4713_device *rsdev;
  +
  + rsdev = video_get_drvdata(video_devdata(file));
  +
  + strlcpy(capability-driver, radio-si4713, 
  sizeof(capability-driver));
  + strlcpy(capability-card, Silicon Labs Si4713 FM Radio Transmitter,
  + sizeof(capability-card));
  + capability-capabilities = V4L2_CAP_TUNER;
  +
  + return 0;
  +}
  +
  +/* radio_si4713_vidioc_queryctrl - enumerate control items */
  +static int radio_si4713_vidioc_queryctrl(struct file *file, void *priv,
  + struct v4l2_queryctrl *qc)
  +{
  +
  + /* Must be sorted from low to high control ID! */
  + static const u32 user_ctrls[] = {
  + V4L2_CID_USER_CLASS,
  + V4L2_CID_AUDIO_VOLUME,
  + V4L2_CID_AUDIO_BALANCE,
  + V4L2_CID_AUDIO_BASS,
  + V4L2_CID_AUDIO_TREBLE

Re: [PATCHv5 1 of 8] v4l2_subdev i2c: Add v4l2_i2c_new_subdev_board i2c helper function

2009-06-08 Thread Eduardo Valentin
Hi guys,

On Mon, Jun 08, 2009 at 05:19:22AM +0200, ext Douglas Schilling Landgraf wrote:
 Hi,
 
 On Sun, 7 Jun 2009 22:29:14 -0300
 Mauro Carvalho Chehab mche...@infradead.org wrote:
 
  Em Sun, 7 Jun 2009 08:40:08 +0200
  Hans Verkuil hverk...@xs4all.nl escreveu:
  
   On Saturday 06 June 2009 22:40:21 Eduardo Valentin wrote:
Hi Hans,
   
On Sat, Jun 6, 2009 at 8:09 PM, Hans Verkuil hverk...@xs4all.nl
wrote:
 On Saturday 06 June 2009 14:49:46 Hans Verkuil wrote:
  On Saturday 06 June 2009 13:59:19 Hans Verkuil wrote:

snip

  
  No please. We did already lots of change due to the i2c changes, and
  there are still some occasional complaints at ML about regressions
  that might be due to i2c changes.
  
  Let's keep 2.6.31 clean, as previously agreed, without new KABI
  changes. We should focus 2.6.31 on fixing any core issues that may
  still have. Only with 2.6.30 we'll start to have feedbacks from
  normal users.

snip

   
I've cloned your tree and took a look at your code. Well, looks
like the proper way to do this change.
I didn't take this approach because it touchs other drivers.
However, concentrating the code  in only one
function is better. I also saw that you have fixed the kernel
version check in the v4l2_device_unregister
function. Great!
   
I will resend my series without this patch. I will rebase it on
top of your subdev tree so the new api
can be used straight. Is that ok?
   
   Yes, sure. Just be aware that there may be some small changes to my
   patch based on feedback I get. But it is a good test anyway of this
   API to see if it works well for you.
  
  Eduardo,
  
  Let's analyze and merge your changes using the current development
  tree. If you think that Hans approach is better (I haven't analyzed
  it yet), then it can later be converted to the new approach
  
 
 I have talked with Eduardo during last week and if there is no
 objections, I am ready to request a pull from the current/last
 patches series.

Yes, my series is already in one of Douglas' trees and we have tested it.
However, in that series there is one patch which does partially what Hans is
proposing. Which is: add a way to pass platform info to i2c drivers, using
v4l2 i2c helper functions. They way it is done in this patch it does not affect
any other driver. Hans did also some re-factoring in existing i2c helper 
function,
besides adding new way to pass platform data.

If you agree we can use it for now and in next window we
change things to have them using the way Hans did (which is more complete).

What do you think?

 
 Cheers,
 Douglas


Cheers,

-- 
Eduardo Valentin
--
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


Re: [PATCHv5 1 of 8] v4l2_subdev i2c: Add v4l2_i2c_new_subdev_board i2c helper function

2009-06-08 Thread Eduardo Valentin
On Mon, Jun 08, 2009 at 08:38:32AM +0200, ext Hans Verkuil wrote:
 On Monday 08 June 2009 08:11:32 Eduardo Valentin wrote:
  Hi guys,
 
  On Mon, Jun 08, 2009 at 05:19:22AM +0200, ext Douglas Schilling Landgraf 
 wrote:
   Hi,
  
   On Sun, 7 Jun 2009 22:29:14 -0300
  
   Mauro Carvalho Chehab mche...@infradead.org wrote:
Em Sun, 7 Jun 2009 08:40:08 +0200
   
Hans Verkuil hverk...@xs4all.nl escreveu:
 On Saturday 06 June 2009 22:40:21 Eduardo Valentin wrote:
  Hi Hans,
 
  On Sat, Jun 6, 2009 at 8:09 PM, Hans Verkuil hverk...@xs4all.nl
 
  wrote:
   On Saturday 06 June 2009 14:49:46 Hans Verkuil wrote:
On Saturday 06 June 2009 13:59:19 Hans Verkuil wrote:
 
  snip
 
No please. We did already lots of change due to the i2c changes, and
there are still some occasional complaints at ML about regressions
that might be due to i2c changes.
   
Let's keep 2.6.31 clean, as previously agreed, without new KABI
changes. We should focus 2.6.31 on fixing any core issues that may
still have. Only with 2.6.30 we'll start to have feedbacks from
normal users.
 
  snip
 
  I've cloned your tree and took a look at your code. Well, looks
  like the proper way to do this change.
  I didn't take this approach because it touchs other drivers.
  However, concentrating the code  in only one
  function is better. I also saw that you have fixed the kernel
  version check in the v4l2_device_unregister
  function. Great!
 
  I will resend my series without this patch. I will rebase it on
  top of your subdev tree so the new api
  can be used straight. Is that ok?

 Yes, sure. Just be aware that there may be some small changes to my
 patch based on feedback I get. But it is a good test anyway of this
 API to see if it works well for you.
   
Eduardo,
   
Let's analyze and merge your changes using the current development
tree. If you think that Hans approach is better (I haven't analyzed
it yet), then it can later be converted to the new approach
  
   I have talked with Eduardo during last week and if there is no
   objections, I am ready to request a pull from the current/last
   patches series.
 
  Yes, my series is already in one of Douglas' trees and we have tested it.
  However, in that series there is one patch which does partially what Hans
  is proposing. Which is: add a way to pass platform info to i2c drivers,
  using v4l2 i2c helper functions. They way it is done in this patch it
  does not affect any other driver. Hans did also some re-factoring in
  existing i2c helper function, besides adding new way to pass platform
  data.
 
 No, I don't agree with that. Your patch has some issues: no cleanup after 
 s_config returns an error, and if we introduce s_config then it should be 
 called by *all* v4l2_new_subdev* functions. That way i2c drivers that 
 implement this can use it reliably for their initialization.
 
 I see no point in doing the same work twice. We have one clean solution into 
 which I put quite a bit of time, and one that hacks new functionality into 
 an already flawed API.

Agreed. No point in doing the same work.

 
 This was also the reason why I didn't just sign off on Eduardo's patch. I 
 strongly suspected I needed to do some proper refactoring first and when I 
 finally had the time to look into this last Saturday I discovered it did 
 indeed needed refactoring.
 
 
  If you agree we can use it for now and in next window we
  change things to have them using the way Hans did (which is more
  complete).
 
 Going with a suboptimal solution when a proper clean one is available is a 
 really bad idea IMHO.

As I already said, I really liked your approach because it re-factors the
API. No problem for me to rebase the patches on top of that.

 
 Regards,
 
   Hans
 
 
  What do you think?
 
   Cheers,
   Douglas
 
  Cheers,
 
 
 
 -- 
 Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom

-- 
Eduardo Valentin
--
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


[PATCHv6 0 of 7] FM Transmitter (si4713) and another changes

2009-06-08 Thread Eduardo Valentin
Hello all,

  I'm resending the FM transmitter driver and the proposed changes in
v4l2 api files in order to cover the fmtx extended controls class.

  Difference from version #5 is that now I've dropped the patch which
adds a new i2c helper function. And now this series is based on Hans
tree: http://www.linuxtv.org/hg/~hverkuil/v4l-dvb-subdev. That tree
has the proper refactoring of v4l2 i2c helper functions. The work
done before in the patch dropped here, now was done by Hans.

  So, now the series includes only changes to add the new v4l2
FMTX extended controls (and its documetation) and si4713 i2c and platform
drivers (and its documentation as well).

  Again, comments are welcome.

BR,

---
Eduardo Valentin
--
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


[PATCHv6 1 of 7] v4l2: video device: Add V4L2_CTRL_CLASS_FMTX controls

2009-06-08 Thread Eduardo Valentin
From: Eduardo Valentin eduardo.valen...@nokia.com

# HG changeset patch
# User Eduardo Valentin eduardo.valen...@nokia.com
# Date 1243414606 -10800
# Node ID 44d477eb96bd219a16b7430937a9b14ae1f9d607
# Parent  c8e571f41aa55740bee6095aa1526f5aadce3ec9
This patch adds a new class of extended controls. This class
is intended to support Radio Modulators properties such as:
rds, audio limiters, audio compression, pilot tone generation,
tuning power levels and region related properties.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 include/linux/videodev2.h |   34 ++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff -r c8e571f41aa5 -r 44d477eb96bd linux/include/linux/videodev2.h
--- a/linux/include/linux/videodev2.h   Sat Jun 06 19:05:35 2009 +0200
+++ b/linux/include/linux/videodev2.h   Wed May 27 11:56:46 2009 +0300
@@ -803,6 +803,7 @@
 #define V4L2_CTRL_CLASS_USER 0x0098/* Old-style 'user' controls */
 #define V4L2_CTRL_CLASS_MPEG 0x0099/* MPEG-compression controls */
 #define V4L2_CTRL_CLASS_CAMERA 0x009a  /* Camera class controls */
+#define V4L2_CTRL_CLASS_FMTX 0x009b/* FM Radio Modulator class 
controls */
 
 #define V4L2_CTRL_ID_MASK(0x0fff)
 #define V4L2_CTRL_ID2CLASS(id)((id)  0x0fffUL)
@@ -1141,6 +1142,39 @@
 
 #define V4L2_CID_PRIVACY   (V4L2_CID_CAMERA_CLASS_BASE+16)
 
+/* FM Radio Modulator class control IDs */
+#define V4L2_CID_FMTX_CLASS_BASE   (V4L2_CTRL_CLASS_FMTX | 0x900)
+#define V4L2_CID_FMTX_CLASS(V4L2_CTRL_CLASS_FMTX | 1)
+
+#define V4L2_CID_RDS_ENABLED   (V4L2_CID_FMTX_CLASS_BASE + 1)
+#define V4L2_CID_RDS_PI
(V4L2_CID_FMTX_CLASS_BASE + 2)
+#define V4L2_CID_RDS_PTY   (V4L2_CID_FMTX_CLASS_BASE + 3)
+#define V4L2_CID_RDS_PS_NAME   (V4L2_CID_FMTX_CLASS_BASE + 4)
+#define V4L2_CID_RDS_RADIO_TEXT
(V4L2_CID_FMTX_CLASS_BASE + 5)
+
+#define V4L2_CID_AUDIO_LIMITER_ENABLED (V4L2_CID_FMTX_CLASS_BASE + 6)
+#define V4L2_CID_AUDIO_LIMITER_RELEASE_TIME(V4L2_CID_FMTX_CLASS_BASE + 7)
+#define V4L2_CID_AUDIO_LIMITER_DEVIATION   (V4L2_CID_FMTX_CLASS_BASE + 8)
+
+#define V4L2_CID_AUDIO_COMPRESSION_ENABLED (V4L2_CID_FMTX_CLASS_BASE + 9)
+#define V4L2_CID_AUDIO_COMPRESSION_GAIN
(V4L2_CID_FMTX_CLASS_BASE + 10)
+#define V4L2_CID_AUDIO_COMPRESSION_THRESHOLD   (V4L2_CID_FMTX_CLASS_BASE + 11)
+#define V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME (V4L2_CID_FMTX_CLASS_BASE + 12)
+#define V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME
(V4L2_CID_FMTX_CLASS_BASE + 13)
+
+#define V4L2_CID_PILOT_TONE_ENABLED(V4L2_CID_FMTX_CLASS_BASE + 14)
+#define V4L2_CID_PILOT_TONE_DEVIATION  (V4L2_CID_FMTX_CLASS_BASE + 15)
+#define V4L2_CID_PILOT_TONE_FREQUENCY  (V4L2_CID_FMTX_CLASS_BASE + 16)
+
+#define V4L2_CID_PREEMPHASIS   (V4L2_CID_FMTX_CLASS_BASE + 17)
+enum v4l2_fmtx_preemphasis {
+   V4L2_FMTX_PREEMPHASIS_DISABLED  = 0,
+   V4L2_FMTX_PREEMPHASIS_50_uS = 1,
+   V4L2_FMTX_PREEMPHASIS_75_uS = 2,
+};
+#define V4L2_CID_TUNE_POWER_LEVEL  (V4L2_CID_FMTX_CLASS_BASE + 18)
+#define V4L2_CID_TUNE_ANTENNA_CAPACITOR
(V4L2_CID_FMTX_CLASS_BASE + 19)
+
 /*
  * T U N I N G
  */
--
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


[PATCHv6 7 of 7] FMTx: si4713: Add document file

2009-06-08 Thread Eduardo Valentin
From: Eduardo Valentin eduardo.valen...@nokia.com

# HG changeset patch
# User Eduardo Valentin eduardo.valen...@nokia.com
# Date 1243414607 -10800
# Node ID 2456c8fc506ecf928d2e95da36d611d094c0ec55
# Parent  fbdd1a2a4fd099a98b1a48f3853a78c0a544632d
Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 Documentation/video4linux/si4713.txt |  133 ++
 1 files changed, 133 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/video4linux/si4713.txt

diff -r fbdd1a2a4fd0 -r 2456c8fc506e linux/Documentation/video4linux/si4713.txt
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/linux/Documentation/video4linux/si4713.txtWed May 27 11:56:47 
2009 +0300
@@ -0,0 +1,133 @@
+Driver for I2C radios for the Silicon Labs Si4713 FM Radio Transmitters
+
+Copyright (c) 2009 Nokia Corporation
+Contact: Eduardo Valentin eduardo.valen...@nokia.com
+
+
+Information about the Device
+
+This chip is a Silicon Labs product. It is a I2C device, currently on 0×63 
address.
+Basically, it has transmission and signal noise level measurement features.
+
+The Si4713 integrates transmit functions for FM broadcast stereo transmission.
+The chip also allows integrated receive power scanning to identify low signal
+power FM channels.
+
+The chip is programmed using commands and responses. There are also several
+properties which can change the behavior of this chip.
+
+Users must comply with local regulations on radio frequency (RF) transmission.
+
+Device driver description
+=
+There are two modules to handle this device. One is a I2C device driver
+and the other is a platform driver.
+
+The I2C device driver exports a v4l2-subdev interface to the kernel. Also
+it exports several device properties through sysfs interface to the user land.
+All properties can also be accessed by v4l2 extended controls interface, by
+using the v4l2-subdev calls (g_ext_ctrls, s_ext_ctrls).
+
+The platform device driver exports a v4l2 radio device interface to user land.
+So, it uses the I2C device driver as a sub device in order to send the user
+commands to the actual device. Basically it is a wrapper to the I2C device 
driver.
+
+So, in summary, the device driver has two interfaces to the user space.
+
+Applications can use v4l2 radio API to specify frequency of operation, mute 
state,
+etc. But mostly of its properties will be present in the extended controls.
+However, the device properties can also be accessed through its sysfs 
directory.
+
+When the v4l2 mute property is set to 1 (true), the driver will turn the chip 
off.
+
+Properties description
+==
+
+The properties can be accessed in sysfs device directory. Using v4l2 extended
+controls as well.
+
+# ls
+acomp_attack_timemodalias rds_radio_text
+acomp_enabledname region
+acomp_gain   pilot_deviation  region_bottom_frequency
+acomp_release_time   pilot_enabledregion_channel_spacing
+acomp_threshold  pilot_frequency  region_preemphasis
+antenna_capacitorpowerregion_top_frequency
+bus  power_level  stereo_enabled
+driver   rds_enabled  subsystem
+limiter_deviationrds_pi   tune_measure
+limiter_enabled  rds_ps_name  uevent
+limiter_release_time rds_pty
+
+Here is a summary of them:
+
+* Pilot is an audible tone sent by the device.
+
+pilot_frequency - Configures the frequency of the stereo pilot tone.
+pilot_deviation - Configures pilot tone frequency deviation level.
+pilot_enabled - Enables or disables the pilot tone feature.
+
+* The si4713 device is capable of applying audio compression to the 
transmitted signal.
+
+acomp_enabled - Enables or disables the audio dynamic range control feature.
+acomp_gain - Sets the gain for audio dynamic range control.
+acomp_threshold - Sets the threshold level for audio dynamic range control.
+acomp_attack_time - Sets the attack time for audio dynamic range control.
+acomp_release_time - Sets the release time for audio dynamic range control.
+
+* Limiter setups audio deviation limiter feature. Once a over deviation occurs,
+it is possible to adjust the front-end gain of the audio input and always
+prevent over deviation.
+
+limiter_enabled - Enables or disables the limiter feature.
+limiter_deviation - Configures audio frequency deviation level.
+limiter_release_time - Sets the limiter release time.
+
+* Tuning power
+
+power_level - Sets the output power level for signal transmission.
+antenna_capacitor - This selects the value of antenna tuning capacitor manually
+or automatically if set to zero.
+tune_measure - With this you can get the value of signal length of a specific 
frequency.
+
+* RDS related
+
+rds_enabled - Enables or disables the RDS feature.
+rds_ps_name - Sets the RDS ps

[PATCHv6 3 of 7] Add documentation description for FM Transmitter Extended Control Class

2009-06-08 Thread Eduardo Valentin
From: Eduardo Valentin eduardo.valen...@nokia.com

# HG changeset patch
# User Eduardo Valentin eduardo.valen...@nokia.com
# Date 1242209424 -10800
# Node ID ccae4c3150d272235cc2b19af8e9adb2e8b2e5f5
# Parent  6220548f4843ce4d19868dfcf5316d6b58a77824

This single patch adds documentation description for FM Transmitter (FMTX)
Extended Control Class and its Control IDs. The text was added under
Extended Controls section.

Priority: normal

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com

diff -r 6220548f4843 -r ccae4c3150d2 v4l2-spec/controls.sgml
--- a/v4l2-spec/controls.sgml   Wed May 27 11:56:46 2009 +0300
+++ b/v4l2-spec/controls.sgml   Wed May 13 13:10:24 2009 +0300
@@ -458,6 +458,12 @@
   paraUnfortunately, the original control API lacked some
 features needed for these new uses and so it was extended into the
 (not terribly originally named) extended control API./para
+
+  paraEven though the MPEG encoding API was the first effort
+to use the Extended Control API, nowadays there are also other classes
+of Extended Controls, such as Camera Controls and FM Transmitter Controls.
+The Extended Controls API as well as all Extended Controls classes are
+described in the following text./para
 /section
 
 section
@@ -1816,6 +1822,200 @@
   /tgroup
 /table
   /section
+
+section id=fmtx-controls
+  titleFM Transmitter Control Reference/title
+
+  paraThe FM Transmitter (FMTX) class includes controls for common 
features of
+FM transmissions capable devices. Currently this class include parameters for 
audio
+compression, pilot tone generation, audio deviation limiter, RDS transmission 
and
+tuning power features./para
+
+  table pgwide=1 frame=none id=fmtx-control-id
+  titleFMTX Control IDs/title
+
+  tgroup cols=4
+   colspec colname=c1 colwidth=1*
+   colspec colname=c2 colwidth=6*
+   colspec colname=c3 colwidth=2*
+   colspec colname=c4 colwidth=6*
+   spanspec namest=c1 nameend=c2 spanname=id
+   spanspec namest=c2 nameend=c4 spanname=descr
+   thead
+ row
+   entry spanname=id align=leftID/entry
+   entry align=leftType/entry
+ /rowrow rowsep=1entry spanname=descr 
align=leftDescription/entry
+ /row
+   /thead
+   tbody valign=top
+ rowentry/entry/row
+ row
+   entry 
spanname=idconstantV4L2_CID_FMTX_CLASS/constantnbsp;/entry
+   entryclass/entry
+ /rowrowentry spanname=descrThe FMTX class
+descriptor. Calling VIDIOC-QUERYCTRL; for this control will return a
+description of this control class./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_ENABLED/constantnbsp;/entry
+   entryboolean/entry
+ /row
+ rowentry spanname=descrEnables or disables the RDS transmission 
feature./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_PI/constantnbsp;/entry
+   entryinteger/entry
+ /row
+ rowentry spanname=descrSets the RDS Programme Identification 
field
+for transmission./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_PTY/constantnbsp;/entry
+   entryinteger/entry
+ /row
+ rowentry spanname=descrSets the RDS Programme Type field for 
transmission.
+This coding of up to 31 pre-defined programme types./entry
+ /row
+!--
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_PS_NAME/constantnbsp;/entry
+   entryinteger/entry
+ /row
+ rowentry spanname=descr./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_RDS_RADIO_TEXT/constantnbsp;/entry
+   entryinteger/entry
+ /row
+ rowentry spanname=descr./entry
+ /row
+--
+ row
+   entry 
spanname=idconstantV4L2_CID_AUDIO_LIMITER_ENABLED/constantnbsp;/entry
+   entryboolean/entry
+ /row
+ rowentry spanname=descrEnables or disables the audio deviation 
limiter feature.
+The limiter is useful when trying to maximize the audio volume, minimize 
receiver-generated
+distortion and prevent overmodulation.
+/entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_AUDIO_LIMITER_RELEASE_TIME/constantnbsp;/entry
+   entryinteger/entry
+ /row
+ rowentry spanname=descrSets the audio deviation limiter feature 
release time.
+The unit, step and range are driver-specific./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_AUDIO_LIMITER_DEVIATION/constantnbsp;/entry
+   entryinteger/entry
+ /row
+ rowentry spanname=descrConfigures audio frequency deviation 
level in Hz.
+The range and step are driver-specific./entry
+ /row
+ row
+   entry 
spanname=idconstantV4L2_CID_AUDIO_COMPRESSION_ENABLED/constantnbsp;/entry
+   entryboolean/entry
+ /row

[PATCHv6 6 of 7] FMTx: si4713: Add Kconfig and Makefile entries

2009-06-08 Thread Eduardo Valentin
From: Eduardo Valentin eduardo.valen...@nokia.com

# HG changeset patch
# User Eduardo Valentin eduardo.valen...@nokia.com
# Date 1243414607 -10800
# Node ID fbdd1a2a4fd099a98b1a48f3853a78c0a544632d
# Parent  786afca68fc9fd35b18ee5cb4166b491613b13a5
Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 drivers/media/radio/Kconfig  |   22 ++
 drivers/media/radio/Makefile |3 +++
 2 files changed, 25 insertions(+), 0 deletions(-)

diff -r 786afca68fc9 -r fbdd1a2a4fd0 linux/drivers/media/radio/Kconfig
--- a/linux/drivers/media/radio/Kconfig Wed May 27 11:56:46 2009 +0300
+++ b/linux/drivers/media/radio/Kconfig Wed May 27 11:56:47 2009 +0300
@@ -339,6 +339,28 @@
help
  Enter the I/O port of your Zoltrix radio card.
 
+config I2C_SI4713
+   tristate I2C driver for Silicon Labs Si4713 device
+   depends on I2C  VIDEO_V4L2
+   ---help---
+ Say Y here if you want support to Si4713 I2C device.
+ This device driver supports only i2c bus.
+
+ To compile this driver as a module, choose M here: the
+ module will be called si4713.
+
+config RADIO_SI4713
+   tristate Silicon Labs Si4713 FM Radio Transmitter support
+   depends on I2C  VIDEO_V4L2
+   ---help---
+ Say Y here if you want support to Si4713 FM Radio Transmitter.
+ This device can transmit audio through FM. It can transmit
+ EDS and EBDS signals as well. This module is the v4l2 radio
+ interface for the i2c driver of this device.
+
+ To compile this driver as a module, choose M here: the
+ module will be called radio-si4713.
+
 config USB_DSBR
tristate D-Link/GemTek USB FM radio support
depends on USB  VIDEO_V4L2
diff -r 786afca68fc9 -r fbdd1a2a4fd0 linux/drivers/media/radio/Makefile
--- a/linux/drivers/media/radio/MakefileWed May 27 11:56:46 2009 +0300
+++ b/linux/drivers/media/radio/MakefileWed May 27 11:56:47 2009 +0300
@@ -15,6 +15,9 @@
 obj-$(CONFIG_RADIO_GEMTEK) += radio-gemtek.o
 obj-$(CONFIG_RADIO_GEMTEK_PCI) += radio-gemtek-pci.o
 obj-$(CONFIG_RADIO_TRUST) += radio-trust.o
+obj-$(CONFIG_I2C_SI4713) += si4713-i2c.o
+si4713-i2c-objs := si4713.o si4713-subdev.o
+obj-$(CONFIG_RADIO_SI4713) += radio-si4713.o
 obj-$(CONFIG_RADIO_MAESTRO) += radio-maestro.o
 obj-$(CONFIG_USB_DSBR) += dsbr100.o
 obj-$(CONFIG_USB_SI470X) += radio-si470x.o
--
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


Re: [PATCHv6 3 of 7] Add documentation description for FM Transmitter Extended Control Class

2009-06-08 Thread Eduardo Valentin
Hi Hans,

On Mon, Jun 08, 2009 at 01:47:10PM +0200, ext Hans Verkuil wrote:
 OK, I had some time, so here are a few comments:
 
  From: Eduardo Valentin eduardo.valen...@nokia.com
 
  # HG changeset patch
  # User Eduardo Valentin eduardo.valen...@nokia.com
  # Date 1242209424 -10800
  # Node ID ccae4c3150d272235cc2b19af8e9adb2e8b2e5f5
  # Parent  6220548f4843ce4d19868dfcf5316d6b58a77824
 
  This single patch adds documentation description for FM Transmitter (FMTX)
 
 Am I the only one who consistently reads this as FMT-X instead of FM-TX? I
 wonder if it is just me or if it wouldn't be better to put an underscore
 between FM and TX.

Well, at first time I did put the underscore, but I realized the macro names
became long. I don't see too many difference putting a underscore there.

 
  Extended Control Class and its Control IDs. The text was added under
  Extended Controls section.
 
  Priority: normal
 
  Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
 
  diff -r 6220548f4843 -r ccae4c3150d2 v4l2-spec/controls.sgml
  --- a/v4l2-spec/controls.sgml   Wed May 27 11:56:46 2009 +0300
  +++ b/v4l2-spec/controls.sgml   Wed May 13 13:10:24 2009 +0300
  @@ -458,6 +458,12 @@
 paraUnfortunately, the original control API lacked some
   features needed for these new uses and so it was extended into the
   (not terribly originally named) extended control API./para
  +
  +  paraEven though the MPEG encoding API was the first effort
  +to use the Extended Control API, nowadays there are also other classes
  +of Extended Controls, such as Camera Controls and FM Transmitter
  Controls.
  +The Extended Controls API as well as all Extended Controls classes are
  +described in the following text./para
   /section
 
   section
  @@ -1816,6 +1822,200 @@
 /tgroup
   /table
 /section
  +
  +section id=fmtx-controls
  +  titleFM Transmitter Control Reference/title
  +
  +  paraThe FM Transmitter (FMTX) class includes controls for common
  features of
  +FM transmissions capable devices. Currently this class include parameters
  for audio
  +compression, pilot tone generation, audio deviation limiter, RDS
  transmission and
  +tuning power features./para
  +
  +  table pgwide=1 frame=none id=fmtx-control-id
  +  titleFMTX Control IDs/title
  +
  +  tgroup cols=4
  +   colspec colname=c1 colwidth=1*
  +   colspec colname=c2 colwidth=6*
  +   colspec colname=c3 colwidth=2*
  +   colspec colname=c4 colwidth=6*
  +   spanspec namest=c1 nameend=c2 spanname=id
  +   spanspec namest=c2 nameend=c4 spanname=descr
  +   thead
  + row
  +   entry spanname=id align=leftID/entry
  +   entry align=leftType/entry
  + /rowrow rowsep=1entry spanname=descr
  align=leftDescription/entry
  + /row
  +   /thead
  +   tbody valign=top
  + rowentry/entry/row
  + row
  +   entry
  spanname=idconstantV4L2_CID_FMTX_CLASS/constantnbsp;/entry
  +   entryclass/entry
  + /rowrowentry spanname=descrThe FMTX class
  +descriptor. Calling VIDIOC-QUERYCTRL; for this control will return a
  +description of this control class./entry
  + /row
  + row
  +   entry
  spanname=idconstantV4L2_CID_RDS_ENABLED/constantnbsp;/entry
  +   entryboolean/entry
  + /row
  + rowentry spanname=descrEnables or disables the RDS transmission
  feature./entry
  + /row
  + row
  +   entry
  spanname=idconstantV4L2_CID_RDS_PI/constantnbsp;/entry
  +   entryinteger/entry
  + /row
 
 It might be a good idea to add references to the specs used in these RDS
 descriptions.

right. I think the rds specification is on EN 50067 EUROPEAN STANDARD.


 
  + rowentry spanname=descrSets the RDS Programme Identification
  field
  +for transmission./entry
  + /row
  + row
  +   entry
  spanname=idconstantV4L2_CID_RDS_PTY/constantnbsp;/entry
  +   entryinteger/entry
  + /row
  + rowentry spanname=descrSets the RDS Programme Type field for
  transmission.
  +This coding of up to 31 pre-defined programme types./entry
  + /row
  +!--
  + row
  +   entry
  spanname=idconstantV4L2_CID_RDS_PS_NAME/constantnbsp;/entry
  +   entryinteger/entry
  + /row
 
 How can this be an integer? Shouldn't this be a string? If so, then we
 first need to add string support to the extended controls.
 
  + rowentry spanname=descr./entry
  + /row
  + row
  +   entry
  spanname=idconstantV4L2_CID_RDS_RADIO_TEXT/constantnbsp;/entry
  +   entryinteger/entry
 
 Ditto.
 

Yes, both are string. And yes, this is something incomplete. I didn't
write the string manipulation for the ext controls. That's why in the
code it is not filled correctly and here, the docs are in comments.

 Also, is there no support for the Programme Type Name?
 

No. Well, not in this driver. As I said previously, the proposed
extended controls are huge based on si4713 properties.

  + /row
  + rowentry spanname=descr./entry

Re: [PATCHv5 1 of 8] v4l2_subdev i2c: Add v4l2_i2c_new_subdev_board i2c helper function

2009-06-06 Thread Eduardo Valentin
Hi Hans,

On Sat, Jun 6, 2009 at 8:09 PM, Hans Verkuil hverk...@xs4all.nl wrote:

 On Saturday 06 June 2009 14:49:46 Hans Verkuil wrote:
  On Saturday 06 June 2009 13:59:19 Hans Verkuil wrote:
   On Friday 29 May 2009 09:33:21 Eduardo Valentin wrote:
# HG changeset patch
# User Eduardo Valentin eduardo.valen...@nokia.com
# Date 1243414605 -10800
# Branch export
# Node ID 4fb354645426f8b187c2c90cd8528b2518461005
# Parent  142fd6020df3b4d543068155e49a2618140efa49
Device drivers of v4l2_subdev devices may want to have
board specific data. This patch adds an helper function
to allow bridge drivers to pass board specific data to
v4l2_subdev drivers.
   
For those drivers which need to support kernel versions
bellow 2.6.26, a .s_config callback was added. The
idea of this callback is to pass board configuration
as well. In that case, subdev driver should set .s_config
properly, because v4l2_i2c_new_subdev_board will call
the .s_config directly. Of course, if we are = 2.6.26,
the same data will be passed through i2c board info as well.
  
   Hi Eduardo,
  
   I finally had some time to look at this. After some thought I realized
   that the main problem is really that the API is becoming quite messy.
   Basically there are 9 different ways of loading and initializing a
   subdev:
  
   First there are three basic initialization calls: no initialization,
   passing irq and platform_data, and passing the i2c_board_info struct
   directly (preferred for drivers that don't need pre-2.6.26
   compatibility).
  
   And for each flavor you would like to see three different versions as
   well: one with a fixed known i2c address, one where you probe for a
   list of addresses, and one where you can probe for a single i2c
   address.
  
   I propose to change the API as follows:
  
   #define V4L2_I2C_ADDRS(addr, addrs...) \
       ((const unsigned short []){ addr, ## addrs, I2C_CLIENT_END })
  
   struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev,
                   struct i2c_adapter *adapter,
                   const char *module_name, const char *client_type,
               u8 addr, const unsigned short *addrs);
  
   struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device
   *v4l2_dev, struct i2c_adapter *adapter,
                   const char *module_name, const char *client_type,
                   int irq, void *platform_data,
                   u8 addr, const unsigned short *addrs);
  
   /* Only available for kernels = 2.6.26 */
   struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device
   *v4l2_dev, struct i2c_adapter *adapter, const char *module_name, struct
   i2c_board_info *info, const unsigned short *addrs);
  
   If you use a fixed address, then only set addr (or info.addr) and set
   addrs to NULL. If you want to probe for a list of addrs, then set addrs
   to the list of addrs. If you want to probe for a single addr, then use
   V4L2_I2C_ADDRS(addr) as the addrs argument. This constructs an array
   with just two entries. Actually, this macro can also create arrays with
   more entries.
  
   Note that v4l2_i2c_new_subdev will be an inline that calls
   v4l2_i2c_new_subdev_cfg with 0, NULL for the irq and platform_data.
  
   And for kernels = 2.6.26 v4l2_i2c_new_subdev_cfg can be an inline
   calling v4l2_i2c_new_subdev_board.
  
   This approach reduces the number of functions to just one (not counting
   the inlines) and simplifies things all around. It does mean that all
   sources need to be changed, but if we go this route, then now is the
   time before the 2.6.31 window is closed. And I would also like to
   remove the '_new' from these function names. I never thought it added
   anything useful.
  
   Comments? If we decide to go this way, then I need to know soon so that
   I can make the changes before the 2.6.31 window closes.
  
   BTW, if the new s_config subdev call is present, then it should always
   be called. That way the subdev driver can safely do all of its
   initialization in s_config, no matter how it was initialized.
  
   Sorry about the long delay in replying to this: it's been very hectic
   lately at the expense of my v4l-dvb work.
 
  I've done the initial conversion to the new API (no _cfg or _board
  version yet) in my ~hverkuil/v4l-dvb-subdev tree. It really simplifies
  things and if nobody objects then I'd like to get this in before 2.6.31.

 I've added the new _cfg and _board fucntions as well in this tree. It needs
 a bit of a cleanup before I can do a pull request (the last two patches
 should be merged to one), but otherwise this is the code as I think it
 should be:

 /* Construct an I2C_CLIENT_END-terminated array of i2c addresses on the fly
 */
 #define V4L2_I2C_ADDRS(addr, addrs...) \
        ((const unsigned short []){ addr, ## addrs, I2C_CLIENT_END })

 /* Load an i2c module and return an initialized v4l2_subdev struct.
   Only call request_module

Re: [PATCHv4 0 of 8] FM Transmitter (si4713) and another changes

2009-05-29 Thread Eduardo Valentin
Hi Douglas,

On Fri, May 29, 2009 at 07:36:20AM +0200, ext Douglas Schilling Landgraf wrote:
 Hello Eduardo,
 
 On Wed, 27 May 2009 12:35:47 +0300
 Eduardo Valentin eduardo.valen...@nokia.com wrote:
 
  Hello all,
  
I'm resending the FM transmitter driver and the proposed changes in
  v4l2 api files in order to cover the fmtx extended controls class.
  
It is basically the same series of version #3. However I rewrote it
  to add the following comments:
  
* Check kernel version for i2c helper function. Now the board data
  is passed not using i2c_board_info. This way all supported kernel
  versions can use the api. Besides that, the .s_config callback was
  added in core ops.
  
* All patches are against v4l-dvb hg repository.
  
Again, comments are welcome.
 
 
 I have a comment, please check some headers to avoid errors. 
 
 Instead of:
 
 patch 05:
 
 #include media/linux/v4l2-device.h
 #include media/linux/v4l2-ioctl.h
 #include media/linux/v4l2-i2c-drv.h
 #include media/linux/v4l2-subdev.h
 
 patch 06:
 
 #include media/linux/v4l2-device.h
 #include media/linux/v4l2-common.h
 #include media/linux/v4l2-ioctl.h
 
 Please use:
 
 #include media/v4l2-device.h
 #include media/v4l2-ioctl.h
 #include media/v4l2-i2c-drv.h
 #include media/v4l2-subdev.h
 
 and
 
 #include media/v4l2-device.h
 #include media/v4l2-common.h
 #include media/v4l2-ioctl.h

Right, I'll re send it.

Thanks for reviewing.

 
 Cheers,
 Douglas

-- 
Eduardo Valentin
--
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


Re: [PATCHv4 0 of 8] FM Transmitter (si4713) and another changes

2009-05-29 Thread Eduardo Valentin
On Fri, May 29, 2009 at 08:03:59AM +0200, Valentin Eduardo (Nokia-D/Helsinki) 
wrote:
 Hi Douglas,
 
 On Fri, May 29, 2009 at 07:36:20AM +0200, ext Douglas Schilling Landgraf 
 wrote:
  Hello Eduardo,
  
  On Wed, 27 May 2009 12:35:47 +0300
  Eduardo Valentin eduardo.valen...@nokia.com wrote:
  
   Hello all,
   
 I'm resending the FM transmitter driver and the proposed changes in
   v4l2 api files in order to cover the fmtx extended controls class.
   
 It is basically the same series of version #3. However I rewrote it
   to add the following comments:
   
 * Check kernel version for i2c helper function. Now the board data
   is passed not using i2c_board_info. This way all supported kernel
   versions can use the api. Besides that, the .s_config callback was
   added in core ops.
   
 * All patches are against v4l-dvb hg repository.
   
 Again, comments are welcome.
  
  
  I have a comment, please check some headers to avoid errors. 
  
  Instead of:
  
  patch 05:
  
  #include media/linux/v4l2-device.h
  #include media/linux/v4l2-ioctl.h
  #include media/linux/v4l2-i2c-drv.h
  #include media/linux/v4l2-subdev.h
  
  patch 06:
  
  #include media/linux/v4l2-device.h
  #include media/linux/v4l2-common.h
  #include media/linux/v4l2-ioctl.h
  
  Please use:
  
  #include media/v4l2-device.h
  #include media/v4l2-ioctl.h
  #include media/v4l2-i2c-drv.h
  #include media/v4l2-subdev.h
  
  and
  
  #include media/v4l2-device.h
  #include media/v4l2-common.h
  #include media/v4l2-ioctl.h
 
 Right, I'll re send it.
 
 Thanks for reviewing.

Actually this series is messed up. Sorry for that.
Resending.

 
  
  Cheers,
  Douglas
 
 -- 
 Eduardo Valentin

-- 
Eduardo Valentin
--
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


[PATCHv5 0 of 8] FM Transmitter (si4713) and another changes

2009-05-29 Thread Eduardo Valentin
Hello all,

  I'm resending the FM transmitter driver and the proposed changes in
v4l2 api files in order to cover the fmtx extended controls class.

  Difference from version #4 is that now I'm sending the correct patches.
The last patch series was messed up with wrong paths names.

  It is basically the same series of version #3. However I rewrote it
to add the following comments:

  * Check kernel version for i2c helper function. Now the board data
is passed not using i2c_board_info. This way all supported kernel
versions can use the api. Besides that, the .s_config callback was
added in core ops.

  * All patches are against v4l-dvb hg repository.

  Again, comments are welcome.

BR,

---
Eduardo Valentin
--
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


[PATCHv5 1 of 8] v4l2_subdev i2c: Add v4l2_i2c_new_subdev_board i2c helper function

2009-05-29 Thread Eduardo Valentin
# HG changeset patch
# User Eduardo Valentin eduardo.valen...@nokia.com
# Date 1243414605 -10800
# Branch export
# Node ID 4fb354645426f8b187c2c90cd8528b2518461005
# Parent  142fd6020df3b4d543068155e49a2618140efa49
Device drivers of v4l2_subdev devices may want to have
board specific data. This patch adds an helper function
to allow bridge drivers to pass board specific data to
v4l2_subdev drivers.

For those drivers which need to support kernel versions
bellow 2.6.26, a .s_config callback was added. The
idea of this callback is to pass board configuration
as well. In that case, subdev driver should set .s_config
properly, because v4l2_i2c_new_subdev_board will call
the .s_config directly. Of course, if we are = 2.6.26,
the same data will be passed through i2c board info as well.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 drivers/media/video/v4l2-common.c |   37 +++--
 include/linux/v4l2-common.h   |8 
 include/linux/v4l2-subdev.h   |1 +
 3 files changed, 44 insertions(+), 2 deletions(-)

diff -r 142fd6020df3 -r 4fb354645426 linux/drivers/media/video/v4l2-common.c
--- a/linux/drivers/media/video/v4l2-common.c   Mon May 18 02:31:55 2009 +
+++ b/linux/drivers/media/video/v4l2-common.c   Wed May 27 11:56:45 2009 +0300
@@ -819,9 +819,10 @@
 
 
 /* Load an i2c sub-device. */
-struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev,
+static struct v4l2_subdev *__v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev,
struct i2c_adapter *adapter,
-   const char *module_name, const char *client_type, u8 addr)
+   const char *module_name, const char *client_type, u8 addr,
+   int irq, void *platform_data)
 {
struct v4l2_subdev *sd = NULL;
struct i2c_client *client;
@@ -840,6 +841,8 @@
memset(info, 0, sizeof(info));
strlcpy(info.type, client_type, sizeof(info.type));
info.addr = addr;
+   info.irq = irq;
+   info.platform_data = platform_data;
 
/* Create the i2c client */
client = i2c_new_device(adapter, info);
@@ -877,8 +880,38 @@
 #endif
return sd;
 }
+
+struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev,
+   struct i2c_adapter *adapter,
+   const char *module_name, const char *client_type, u8 addr)
+{
+   return __v4l2_i2c_new_subdev(v4l2_dev, adapter, module_name,
+   client_type, addr, 0, NULL);
+}
 EXPORT_SYMBOL_GPL(v4l2_i2c_new_subdev);
 
+struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev,
+   struct i2c_adapter *adapter,
+   const char *module_name, const char *client_type, u8 addr,
+   int irq, void *platform_data)
+{
+   struct v4l2_subdev *sd;
+   int err = 0;
+
+   sd = __v4l2_i2c_new_subdev(v4l2_dev, adapter, module_name, client_type,
+   addr, irq, platform_data);
+
+   /*
+* We return errors from v4l2_subdev_call only if we have the callback
+* as the .s_config is not mandatory
+*/
+   if (sd  sd-ops  sd-ops-core  sd-ops-core-s_config)
+   err = sd-ops-core-s_config(sd, irq, platform_data);
+
+   return err  0 ? NULL : sd;
+}
+EXPORT_SYMBOL_GPL(v4l2_i2c_new_subdev_board);
+
 /* Probe and load an i2c sub-device. */
 struct v4l2_subdev *v4l2_i2c_new_probed_subdev(struct v4l2_device *v4l2_dev,
struct i2c_adapter *adapter,
diff -r 142fd6020df3 -r 4fb354645426 linux/include/media/v4l2-common.h
--- a/linux/include/media/v4l2-common.h Mon May 18 02:31:55 2009 +
+++ b/linux/include/media/v4l2-common.h Wed May 27 11:56:45 2009 +0300
@@ -147,6 +147,14 @@
 struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev,
struct i2c_adapter *adapter,
const char *module_name, const char *client_type, u8 addr);
+/*
+ * Same as v4l2_i2c_new_subdev, but with the opportunity to configure
+ * subdevice with board specific data (irq and platform_data).
+ */
+struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev,
+   struct i2c_adapter *adapter,
+   const char *module_name, const char *client_type, u8 addr,
+   int irq, void *platform_data);
 /* Probe and load an i2c module and return an initialized v4l2_subdev struct.
Only call request_module if module_name != NULL.
The client_type argument is the name of the chip that's on the adapter. */
diff -r 142fd6020df3 -r 4fb354645426 linux/include/media/v4l2-subdev.h
--- a/linux/include/media/v4l2-subdev.h Mon May 18 02:31:55 2009 +
+++ b/linux/include/media/v4l2-subdev.h Wed May 27 11:56:45 2009 +0300
@@ -96,6 +96,7 @@
 struct v4l2_subdev_core_ops {
int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident 
*chip);
int (*log_status)(struct v4l2_subdev *sd);
+   int (*s_config)(struct v4l2_subdev *sd, int irq

[PATCHv5 2 of 8] v4l2: video device: Add V4L2_CTRL_CLASS_FMTX controls

2009-05-29 Thread Eduardo Valentin
# HG changeset patch
# User Eduardo Valentin eduardo.valen...@nokia.com
# Date 1243414606 -10800
# Branch export
# Node ID ebb409d7a258df2bc7a6dcd72113584b4c0e7ce2
# Parent  4fb354645426f8b187c2c90cd8528b2518461005
This patch adds a new class of extended controls. This class
is intended to support Radio Modulators properties such as:
rds, audio limiters, audio compression, pilot tone generation,
tuning power levels and region related properties.

Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 include/linux/videodev2.h |   34 ++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff -r 4fb354645426 -r ebb409d7a258 linux/include/linux/videodev2.h
--- a/linux/include/linux/videodev2.h   Wed May 27 11:56:45 2009 +0300
+++ b/linux/include/linux/videodev2.h   Wed May 27 11:56:46 2009 +0300
@@ -803,6 +803,7 @@
 #define V4L2_CTRL_CLASS_USER 0x0098/* Old-style 'user' controls */
 #define V4L2_CTRL_CLASS_MPEG 0x0099/* MPEG-compression controls */
 #define V4L2_CTRL_CLASS_CAMERA 0x009a  /* Camera class controls */
+#define V4L2_CTRL_CLASS_FMTX 0x009b/* FM Radio Modulator class 
controls */
 
 #define V4L2_CTRL_ID_MASK(0x0fff)
 #define V4L2_CTRL_ID2CLASS(id)((id)  0x0fffUL)
@@ -1141,6 +1142,39 @@
 
 #define V4L2_CID_PRIVACY   (V4L2_CID_CAMERA_CLASS_BASE+16)
 
+/* FM Radio Modulator class control IDs */
+#define V4L2_CID_FMTX_CLASS_BASE   (V4L2_CTRL_CLASS_FMTX | 0x900)
+#define V4L2_CID_FMTX_CLASS(V4L2_CTRL_CLASS_FMTX | 1)
+
+#define V4L2_CID_RDS_ENABLED   (V4L2_CID_FMTX_CLASS_BASE + 1)
+#define V4L2_CID_RDS_PI
(V4L2_CID_FMTX_CLASS_BASE + 2)
+#define V4L2_CID_RDS_PTY   (V4L2_CID_FMTX_CLASS_BASE + 3)
+#define V4L2_CID_RDS_PS_NAME   (V4L2_CID_FMTX_CLASS_BASE + 4)
+#define V4L2_CID_RDS_RADIO_TEXT
(V4L2_CID_FMTX_CLASS_BASE + 5)
+
+#define V4L2_CID_AUDIO_LIMITER_ENABLED (V4L2_CID_FMTX_CLASS_BASE + 6)
+#define V4L2_CID_AUDIO_LIMITER_RELEASE_TIME(V4L2_CID_FMTX_CLASS_BASE + 7)
+#define V4L2_CID_AUDIO_LIMITER_DEVIATION   (V4L2_CID_FMTX_CLASS_BASE + 8)
+
+#define V4L2_CID_AUDIO_COMPRESSION_ENABLED (V4L2_CID_FMTX_CLASS_BASE + 9)
+#define V4L2_CID_AUDIO_COMPRESSION_GAIN
(V4L2_CID_FMTX_CLASS_BASE + 10)
+#define V4L2_CID_AUDIO_COMPRESSION_THRESHOLD   (V4L2_CID_FMTX_CLASS_BASE + 11)
+#define V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME (V4L2_CID_FMTX_CLASS_BASE + 12)
+#define V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME
(V4L2_CID_FMTX_CLASS_BASE + 13)
+
+#define V4L2_CID_PILOT_TONE_ENABLED(V4L2_CID_FMTX_CLASS_BASE + 14)
+#define V4L2_CID_PILOT_TONE_DEVIATION  (V4L2_CID_FMTX_CLASS_BASE + 15)
+#define V4L2_CID_PILOT_TONE_FREQUENCY  (V4L2_CID_FMTX_CLASS_BASE + 16)
+
+#define V4L2_CID_PREEMPHASIS   (V4L2_CID_FMTX_CLASS_BASE + 17)
+enum v4l2_fmtx_preemphasis {
+   V4L2_FMTX_PREEMPHASIS_DISABLED  = 0,
+   V4L2_FMTX_PREEMPHASIS_50_uS = 1,
+   V4L2_FMTX_PREEMPHASIS_75_uS = 2,
+};
+#define V4L2_CID_TUNE_POWER_LEVEL  (V4L2_CID_FMTX_CLASS_BASE + 18)
+#define V4L2_CID_TUNE_ANTENNA_CAPACITOR
(V4L2_CID_FMTX_CLASS_BASE + 19)
+
 /*
  * T U N I N G
  */
--
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


[PATCHv5 3 of 8] v4l2: video device: Add FMTX controls default configurations

2009-05-29 Thread Eduardo Valentin
# HG changeset patch
# User Eduardo Valentin eduardo.valen...@nokia.com
# Date 1243414606 -10800
# Branch export
# Node ID 85b64a6cc67c0c0d6a795388f8ca02dad2ff9da7
# Parent  ebb409d7a258df2bc7a6dcd72113584b4c0e7ce2
Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 drivers/media/video/v4l2-common.c |   46 +
 1 files changed, 46 insertions(+), 0 deletions(-)

diff -r ebb409d7a258 -r 85b64a6cc67c linux/drivers/media/video/v4l2-common.c
--- a/linux/drivers/media/video/v4l2-common.c   Wed May 27 11:56:46 2009 +0300
+++ b/linux/drivers/media/video/v4l2-common.c   Wed May 27 11:56:46 2009 +0300
@@ -341,6 +341,12 @@
Sepia,
NULL
};
+   static const char *fmtx_preemphasis[] = {
+   No preemphasis,
+   50 useconds,
+   75 useconds,
+   NULL,
+   };
 
switch (id) {
case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ:
@@ -379,6 +385,8 @@
return camera_exposure_auto;
case V4L2_CID_COLORFX:
return colorfx;
+   case V4L2_CID_PREEMPHASIS:
+   return fmtx_preemphasis;
default:
return NULL;
}
@@ -477,6 +485,28 @@
case V4L2_CID_ZOOM_CONTINUOUS:  return Zoom, Continuous;
case V4L2_CID_PRIVACY:  return Privacy;
 
+   /* FM Radio Modulator control */
+   case V4L2_CID_FMTX_CLASS:   return FM Radio Modulator 
Controls;
+   case V4L2_CID_RDS_ENABLED:  return RDS Feature Enabled;
+   case V4L2_CID_RDS_PI:   return RDS Program ID;
+   case V4L2_CID_RDS_PTY:  return RDS Program Type;
+   case V4L2_CID_RDS_PS_NAME:  return RDS PS Name;
+   case V4L2_CID_RDS_RADIO_TEXT:   return RDS Radio Text;
+   case V4L2_CID_AUDIO_LIMITER_ENABLED:return Audio Limiter Feature 
Enabled;
+   case V4L2_CID_AUDIO_LIMITER_RELEASE_TIME: return Audio Limiter Release 
Time;
+   case V4L2_CID_AUDIO_LIMITER_DEVIATION:  return Audio Limiter 
Deviation;
+   case V4L2_CID_AUDIO_COMPRESSION_ENABLED: return Audio Compression 
Feature Enabled;
+   case V4L2_CID_AUDIO_COMPRESSION_GAIN:   return Audio Compression Gain;
+   case V4L2_CID_AUDIO_COMPRESSION_THRESHOLD: return Audio Compression 
Threshold;
+   case V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME: return Audio Compression 
Attack Time;
+   case V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME: return Audio Compression 
Release Time;
+   case V4L2_CID_PILOT_TONE_ENABLED:   return Pilot Tone Feature 
Enabled;
+   case V4L2_CID_PILOT_TONE_DEVIATION: return Pilot Tone Deviation;
+   case V4L2_CID_PILOT_TONE_FREQUENCY: return Pilot Tone Frequency;
+   case V4L2_CID_PREEMPHASIS:  return Pre-emphasis settings;
+   case V4L2_CID_TUNE_POWER_LEVEL: return Tune Power Level;
+   case V4L2_CID_TUNE_ANTENNA_CAPACITOR:   return Tune Antenna Capacitor;
+
default:
return NULL;
}
@@ -509,6 +539,10 @@
case V4L2_CID_EXPOSURE_AUTO_PRIORITY:
case V4L2_CID_FOCUS_AUTO:
case V4L2_CID_PRIVACY:
+   case V4L2_CID_RDS_ENABLED:
+   case V4L2_CID_AUDIO_LIMITER_ENABLED:
+   case V4L2_CID_AUDIO_COMPRESSION_ENABLED:
+   case V4L2_CID_PILOT_TONE_ENABLED:
qctrl-type = V4L2_CTRL_TYPE_BOOLEAN;
min = 0;
max = step = 1;
@@ -537,12 +571,14 @@
case V4L2_CID_MPEG_STREAM_VBI_FMT:
case V4L2_CID_EXPOSURE_AUTO:
case V4L2_CID_COLORFX:
+   case V4L2_CID_PREEMPHASIS:
qctrl-type = V4L2_CTRL_TYPE_MENU;
step = 1;
break;
case V4L2_CID_USER_CLASS:
case V4L2_CID_CAMERA_CLASS:
case V4L2_CID_MPEG_CLASS:
+   case V4L2_CID_FMTX_CLASS:
qctrl-type = V4L2_CTRL_TYPE_CTRL_CLASS;
qctrl-flags |= V4L2_CTRL_FLAG_READ_ONLY;
min = max = step = def = 0;
@@ -571,6 +607,16 @@
case V4L2_CID_BLUE_BALANCE:
case V4L2_CID_GAMMA:
case V4L2_CID_SHARPNESS:
+   case V4L2_CID_AUDIO_LIMITER_RELEASE_TIME:
+   case V4L2_CID_AUDIO_LIMITER_DEVIATION:
+   case V4L2_CID_AUDIO_COMPRESSION_GAIN:
+   case V4L2_CID_AUDIO_COMPRESSION_THRESHOLD:
+   case V4L2_CID_AUDIO_COMPRESSION_ATTACK_TIME:
+   case V4L2_CID_AUDIO_COMPRESSION_RELEASE_TIME:
+   case V4L2_CID_PILOT_TONE_DEVIATION:
+   case V4L2_CID_PILOT_TONE_FREQUENCY:
+   case V4L2_CID_TUNE_POWER_LEVEL:
+   case V4L2_CID_TUNE_ANTENNA_CAPACITOR:
qctrl-flags |= V4L2_CTRL_FLAG_SLIDER;
break;
case V4L2_CID_PAN_RELATIVE:
--
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

[PATCHv5 8 of 8] FMTx: si4713: Add document file

2009-05-29 Thread Eduardo Valentin
# HG changeset patch
# User Eduardo Valentin eduardo.valen...@nokia.com
# Date 1243414607 -10800
# Branch export
# Node ID fadf1cddf504609cdb4889f4aa3305ca8d15323a
# Parent  b1d98e675a3c4e9e6d247701c9ac18239e3dcc1c
Signed-off-by: Eduardo Valentin eduardo.valen...@nokia.com
---
 Documentation/video4linux/si4713.txt |  133 ++
 1 files changed, 133 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/video4linux/si4713.txt

diff -r b1d98e675a3c -r fadf1cddf504 linux/Documentation/video4linux/si4713.txt
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/linux/Documentation/video4linux/si4713.txtWed May 27 11:56:47 
2009 +0300
@@ -0,0 +1,133 @@
+Driver for I2C radios for the Silicon Labs Si4713 FM Radio Transmitters
+
+Copyright (c) 2009 Nokia Corporation
+Contact: Eduardo Valentin eduardo.valen...@nokia.com
+
+
+Information about the Device
+
+This chip is a Silicon Labs product. It is a I2C device, currently on 0×63 
address.
+Basically, it has transmission and signal noise level measurement features.
+
+The Si4713 integrates transmit functions for FM broadcast stereo transmission.
+The chip also allows integrated receive power scanning to identify low signal
+power FM channels.
+
+The chip is programmed using commands and responses. There are also several
+properties which can change the behavior of this chip.
+
+Users must comply with local regulations on radio frequency (RF) transmission.
+
+Device driver description
+=
+There are two modules to handle this device. One is a I2C device driver
+and the other is a platform driver.
+
+The I2C device driver exports a v4l2-subdev interface to the kernel. Also
+it exports several device properties through sysfs interface to the user land.
+All properties can also be accessed by v4l2 extended controls interface, by
+using the v4l2-subdev calls (g_ext_ctrls, s_ext_ctrls).
+
+The platform device driver exports a v4l2 radio device interface to user land.
+So, it uses the I2C device driver as a sub device in order to send the user
+commands to the actual device. Basically it is a wrapper to the I2C device 
driver.
+
+So, in summary, the device driver has two interfaces to the user space.
+
+Applications can use v4l2 radio API to specify frequency of operation, mute 
state,
+etc. But mostly of its properties will be present in the extended controls.
+However, the device properties can also be accessed through its sysfs 
directory.
+
+When the v4l2 mute property is set to 1 (true), the driver will turn the chip 
off.
+
+Properties description
+==
+
+The properties can be accessed in sysfs device directory. Using v4l2 extended
+controls as well.
+
+# ls
+acomp_attack_timemodalias rds_radio_text
+acomp_enabledname region
+acomp_gain   pilot_deviation  region_bottom_frequency
+acomp_release_time   pilot_enabledregion_channel_spacing
+acomp_threshold  pilot_frequency  region_preemphasis
+antenna_capacitorpowerregion_top_frequency
+bus  power_level  stereo_enabled
+driver   rds_enabled  subsystem
+limiter_deviationrds_pi   tune_measure
+limiter_enabled  rds_ps_name  uevent
+limiter_release_time rds_pty
+
+Here is a summary of them:
+
+* Pilot is an audible tone sent by the device.
+
+pilot_frequency - Configures the frequency of the stereo pilot tone.
+pilot_deviation - Configures pilot tone frequency deviation level.
+pilot_enabled - Enables or disables the pilot tone feature.
+
+* The si4713 device is capable of applying audio compression to the 
transmitted signal.
+
+acomp_enabled - Enables or disables the audio dynamic range control feature.
+acomp_gain - Sets the gain for audio dynamic range control.
+acomp_threshold - Sets the threshold level for audio dynamic range control.
+acomp_attack_time - Sets the attack time for audio dynamic range control.
+acomp_release_time - Sets the release time for audio dynamic range control.
+
+* Limiter setups audio deviation limiter feature. Once a over deviation occurs,
+it is possible to adjust the front-end gain of the audio input and always
+prevent over deviation.
+
+limiter_enabled - Enables or disables the limiter feature.
+limiter_deviation - Configures audio frequency deviation level.
+limiter_release_time - Sets the limiter release time.
+
+* Tuning power
+
+power_level - Sets the output power level for signal transmission.
+antenna_capacitor - This selects the value of antenna tuning capacitor manually
+or automatically if set to zero.
+tune_measure - With this you can get the value of signal length of a specific 
frequency.
+
+* RDS related
+
+rds_enabled - Enables or disables the RDS feature.
+rds_ps_name - Sets the RDS ps name field for transmission

  1   2   >