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" 
> Cc: Viresh Kumar 
> Cc: Mauro Carvalho Chehab 
> Cc: Zhang Rui 
> Cc: Eduardo Valentin 
> Cc: Greg Kroah-Hartman 
> 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 
> Signed-off-by: Kyungmin Park 
> ---
>  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_pl

[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 
---
 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 ");
 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 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 
---
 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 ");
 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 
---
 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 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 
---
 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_devic

[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/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 
---
 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 
+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 
+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 
 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 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  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 
> > > Cc: Eduardo Valentin 
> > > ---
> > > 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-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  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 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 
> Cc: Eduardo Valentin 

Acked-by: Eduardo Valentin 

> ---
>  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 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 
> Cc: Eduardo Valentin 
> ---
> 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 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -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 
>  #include 
>  #include 
> +#include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -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_r

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] 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 
> Cc: Eduardo Valentin 
> ---
>  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

2009-09-20 Thread Eduardo Valentin
Hello,

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

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

Acked-by: Eduardo Valentin 

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

Acked-by: Eduardo Valentin 

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


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



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


[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 
---
 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 
+ *
+ * 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 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* 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 ");
+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,
+   V4L2_CID_RDS_TX_PS_NAME,
+   V4L2_CID_RDS_TX_RADIO_TEXT,
+   V4L2_CID_AUDIO_LIMITER_

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

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

Signed-off-by: Eduardo Valentin 
---
 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


[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 
---
 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.
   Unfortunately, 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.
+
+  Even 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.
 
 
 
@@ -1815,6 +1821,215 @@ control must support read access and may support write 
access.
   
 
   
+
+
+  FM Transmitter Control Reference
+
+  The 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.
+
+  
+  FM_TX Control IDs
+
+  
+   
+   
+   
+   
+   
+   
+   
+ 
+   ID
+   Type
+ Description
+ 
+   
+   
+ 
+ 
+   V4L2_CID_FM_TX_CLASS 
+   class
+ The FM_TX class
+descriptor. Calling &VIDIOC-QUERYCTRL; for this control will return a
+description of this control class.
+ 
+ 
+   V4L2_CID_RDS_TX_DEVIATION 
+   integer
+ 
+ Configures RDS signal frequency 
deviation level in Hz.
+The range and step are driver-specific.
+ 
+ 
+   V4L2_CID_RDS_TX_PI 
+   integer
+ 
+ Sets the RDS Programme Identification 
field
+for transmission.
+ 
+ 
+   V4L2_CID_RDS_TX_PTY 
+   integer
+ 
+ Sets the RDS Programme Type field for 
transmission.
+This encodes up to 31 pre-defined programme types.
+ 
+ 
+   V4L2_CID_RDS_TX_PS_NAME 
+   string
+ 
+ Sets 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 , 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.
+ 
+ 
+   V4L2_CID_RDS_TX_RADIO_TEXT 
+   string
+ 
+ Sets 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
+V4L2_CID_RDS_TX_PS_NAME. The encoding for Radio Text 
strings is also fully described
+in Annex E of . The length of Radio Text strings 
depends on which RDS Block is being
+used to transmit it, either 32 (2A block) or 64 (2B block).  However, it is 
also possible
+to find receivers which can scroll strings sized as 32 x N or 64 x N 
characters. So, this control must be configured
+with steps of 32 or 64 characters. The result is it must always contain a 
string with size multiple of 32 or 64. 
+ 
+ 
+   V4L2_CID_AUDIO_LIMITER_ENABLED 
+   boolean
+ 
+ Enables 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.
+
+ 
+ 
+   V4L2_CID_AUDIO_LIMITER_RELEASE_TIME 
+   integer
+ 

[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 
---
 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 
+
+
+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 - Configures pilot tone frequ

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

[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 
---
 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 1/8] v4l2-subdev.h: Add g_modulator callbacks to subdev api

2009-08-08 Thread Eduardo Valentin
Signed-off-by: Eduardo Valentin 
---
 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 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


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
> 
> 
> 
> > +/* 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 
> 
> 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


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.

Ok. I've noticed that as well when you replied in the wrong series version.
But no problem.

> 
> 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
> 
> 
> 
> > +/* 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.
> 
> > +   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 
> 
> for the whole series.

I'll include only these three changes for v15 then:
- Ordering of RDS controls
- The null pointer problem pointed by Matti
- This ERANGE issue

BR

> 
> 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: [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 02:38:53PM +0200, Aaltonen Matti.J (Nokia-D/Tampere) 
wrote:
> Hi.
> 
> On Mon, 2009-07-27 at 17:12 +0200, Valentin Eduardo (Nokia-D/Helsinki)
> wrote:
> > This patch adds files to control si4713 devices.
> > Internal functions to control device properties
> 
> 
> 
> > + */
> > +/* si4713_probe - probe for the device */
> > +static int si4713_probe(struct i2c_client *client,
> > +   const struct i2c_device_id *id)
> > +{
> > +   struct si4713_device *sdev;
> > +   int rval;
> > +
> > +   sdev = kzalloc(sizeof *sdev, GFP_KERNEL);
> > +   if (!sdev) {
> > +   v4l2_err(&sdev->sd, "Failed to alloc video device.\n");
>^^
> > +   rval = -ENOMEM;
> > +   goto exit;
> > +   }
> 
> ....
> 
> You shouldn't do sdev->sd if sdev is NULL.

Ok! Thanks for pointing this Matti!


> 
> Cheers,
> Matti
> 
> 
> 
> 
> 
> 

-- 
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-08-08 Thread Eduardo Valentin
On Fri, Aug 07, 2009 at 04:33:53PM +0200, ext Hans Verkuil wrote:
> On Friday 07 August 2009 16:13:46 Mauro Carvalho Chehab wrote:
> > Em Thu, 6 Aug 2009 13:22:18 +0200
> > "Hans Verkuil"  escreveu:
> > 
> > > 
> > > > Em Sun, 2 Aug 2009 12:10:04 +0200
> > > > Hans Verkuil  escreveu:
> > > >
> > > >> Hi Mauro,
> > > >>
> > > >> Please pull from http://www.linuxtv.org/hg/~hverkuil/v4l-dvb for the
> > > >> following:
> > > >>
> > > >> - v4l: introduce string control support.
> 
> 
> 
> > > > Why do you need two routines that will always return zero? Why to 
> > > > create a
> > > > code
> > > > that will never be used? v4l2-compat-ioctl32.c is already complex enough
> > > > without adding any bogus code.
> > > 
> > > When the RDS encoder driver from Eduardo is added, then he will add the
> > > string controls to ctrl_is_pointer() since his driver is the first to
> > > actually implement string controls.
> > 
> > It is better to add this together with his patch, since, currently, the code
> > makes no sense to anyone that are analyzing it. Btw, as this kind of 
> > controls
> > will be used firstly on his driver, please add his patches on your tree. 
> > This
> > will make easier to analyze the required core changes.
> 
> Eduardo, can you make a final patch series against my tree? I'll merge in your
> patches and make a new pull request containing everything.

Sure. I'll do it today. That will include that ordering change you request.

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


[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 
---
 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 
+
+
+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 - Configures pilot tone frequ

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

2009-07-27 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 
---
 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 
+ *
+ * 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 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* 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 ");
+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,
+   V4L2_CID_RDS_TX_PS_NAME,
+   V4L2_CID_RDS_TX_RADIO_TEXT,
+   V4L2_CID_AUDIO_LIMITER_

[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 
---
 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.
   Unfortunately, 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.
+
+  Even 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.
 
 
 
@@ -1815,6 +1821,215 @@ control must support read access and may support write 
access.
   
 
   
+
+
+  FM Transmitter Control Reference
+
+  The 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.
+
+  
+  FM_TX Control IDs
+
+  
+   
+   
+   
+   
+   
+   
+   
+ 
+   ID
+   Type
+ Description
+ 
+   
+   
+ 
+ 
+   V4L2_CID_FM_TX_CLASS 
+   class
+ The FM_TX class
+descriptor. Calling &VIDIOC-QUERYCTRL; for this control will return a
+description of this control class.
+ 
+ 
+   V4L2_CID_RDS_TX_PI 
+   integer
+ 
+ Sets the RDS Programme Identification 
field
+for transmission.
+ 
+ 
+   V4L2_CID_RDS_TX_PTY 
+   integer
+ 
+ Sets the RDS Programme Type field for 
transmission.
+This encodes up to 31 pre-defined programme types.
+ 
+ 
+   V4L2_CID_RDS_TX_DEVIATION 
+   integer
+ 
+ Configures RDS signal frequency 
deviation level in Hz.
+The range and step are driver-specific.
+ 
+ 
+   V4L2_CID_RDS_TX_PS_NAME 
+   string
+ 
+ Sets 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 , 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.
+ 
+ 
+   V4L2_CID_RDS_TX_RADIO_TEXT 
+   string
+ 
+ Sets 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
+V4L2_CID_RDS_TX_PS_NAME. The encoding for Radio Text 
strings is also fully described
+in Annex E of . The length of Radio Text strings 
depends on which RDS Block is being
+used to transmit it, either 32 (2A block) or 64 (2B block).  However, it is 
also possible
+to find receivers which can scroll strings sized as 32 x N or 64 x N 
characters. So, this control must be configured
+with steps of 32 or 64 characters. The result is it must always contain a 
string with size multiple of 32 or 64. 
+ 
+ 
+   V4L2_CID_AUDIO_LIMITER_ENABLED 
+   boolean
+ 
+ Enables 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.
+
+ 
+ 
+   V4L2_CID_AUDIO_LIMITER_RELEASE_TIME 
+   integer
+ 
+ Sets the audio deviation limiter feature 
release time.
+Unit is in useconds. Step and range are d

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

2009-07-27 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 
---
 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..9e1ae23 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;
}
@@ -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_

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


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


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

2009-07-27 Thread Eduardo Valentin
Signed-off-by: Eduardo Valentin 
---
 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 0/8] FM Transmitter (si4713) and another changes

2009-07-27 Thread Eduardo Valentin
hello guys,

This is version 14 of this series.

More polishing this time: removal of few unused variables and
some reorganization to reduce stack size. A tiny fix on specs text as well.
Code looks nicer.

Comments, as usual, are appreciated.

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  | 2042 +++
 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 +++
 14 files changed, 3234 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


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

2009-07-27 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 
---
 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..9e1ae23 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;
}
@@ -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_

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

2009-07-27 Thread Eduardo Valentin
hello guys,

This is version 13 of this series.

A littler mistake was made on last one: wrong access to user
pointers was being performed during string control manipulation.
Also I forgot to update v4l2 specs.

Comments, as usual, are appreciated.

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  | 2065 +++
 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 +++
 14 files changed, 3257 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


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

2009-07-27 Thread Eduardo Valentin
Signed-off-by: Eduardo Valentin 
---
 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


[PATCHv13 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 
---
 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..da7b5f6 100644
--- a/v4l2-spec/controls.sgml
+++ b/v4l2-spec/controls.sgml
@@ -458,6 +458,12 @@ video is actually encoded into that format.
   Unfortunately, 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.
+
+  Even 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.
 
 
 
@@ -1815,6 +1821,215 @@ control must support read access and may support write 
access.
   
 
   
+
+
+  FM Transmitter Control Reference
+
+  The 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.
+
+  
+  FM_TX Control IDs
+
+  
+   
+   
+   
+   
+   
+   
+   
+ 
+   ID
+   Type
+ Description
+ 
+   
+   
+ 
+ 
+   V4L2_CID_FM_TX_CLASS 
+   class
+ The FM_TX class
+descriptor. Calling &VIDIOC-QUERYCTRL; for this control will return a
+description of this control class.
+ 
+ 
+   V4L2_CID_RDS_TX_PI 
+   integer
+ 
+ Sets the RDS Programme Identification 
field
+for transmission.
+ 
+ 
+   V4L2_CID_RDS_TX_PTY 
+   integer
+ 
+ Sets the RDS Programme Type field for 
transmission.
+This encodes up to 31 pre-defined programme types.
+ 
+ 
+   V4L2_CID_RDS_TX_DEVIATION 
+   integer
+ 
+ Configures RDS signal frequency 
deviation level in Hz.
+The range and step are driver-specific.
+ 
+ 
+   V4L2_CID_RDS_TX_PS_NAME 
+   string
+ 
+ Sets the Programme Service name 
(PS_NAME) for transmission.
+It is intended for static display on a receiver. It is the primary id to 
listeners in programme service
+identification and selection.  In Annex E of , 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 receiver 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.
+ 
+ 
+   V4L2_CID_RDS_TX_RADIO_TEXT 
+   string
+ 
+ Sets 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
+V4L2_CID_RDS_TX_PS_NAME. The encoding for Radio Text 
strings is also fully described
+in Annex E of . The length of Radio Text strings 
depends on which RDS Block is being
+used to transmit it, either 32 (2A block) or 64 (2B block).  However, it is 
also possible
+to find receiver which can scroll strings sized as 32 x N or 64 x N 
characters. So, this control must be configured
+with steps of 32 or 64 characters. The result is it must always contain a 
string with size multiple of 32 or 64. 
+ 
+ 
+   V4L2_CID_AUDIO_LIMITER_ENABLED 
+   boolean
+ 
+ Enables 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.
+
+ 
+ 
+   V4L2_CID_AUDIO_LIMITER_RELEASE_TIME 
+   integer
+ 
+ Sets the audio deviation limiter feature 
release time.
+Unit is in useconds. Step and range are d

[PATCHv13 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 
---
 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 
+
+
+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 - Configures pilot tone frequ

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

2009-07-27 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 
---
 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 
+ *
+ * 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 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* 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 ");
+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,
+   V4L2_CID_RDS_TX_PS_NAME,
+   V4L2_CID_RDS_TX_RADIO_TEXT,
+   V4L2_CID_AUDIO_LIMITER_

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


[PATCHv12 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 
---
 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.
   Unfortunately, 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.
+
+  Even 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.
 
 
 
@@ -1815,6 +1821,210 @@ control must support read access and may support write 
access.
   
 
   
+
+
+  FM Transmitter Control Reference
+
+  The 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.
+
+  
+  FM_TX Control IDs
+
+  
+   
+   
+   
+   
+   
+   
+   
+ 
+   ID
+   Type
+ Description
+ 
+   
+   
+ 
+ 
+   V4L2_CID_FM_TX_CLASS 
+   class
+ The FM_TX class
+descriptor. Calling &VIDIOC-QUERYCTRL; for this control will return a
+description of this control class.
+ 
+ 
+   V4L2_CID_RDS_TX_PI 
+   integer
+ 
+ Sets the RDS Programme Identification 
field
+for transmission.
+ 
+ 
+   V4L2_CID_RDS_TX_PTY 
+   integer
+ 
+ Sets the RDS Programme Type field for 
transmission.
+This encodes up to 31 pre-defined programme types.
+ 
+ 
+   V4L2_CID_RDS_TX_DEVIATION 
+   integer
+ 
+ Configures RDS signal frequency 
deviation level in Hz.
+The range and step are driver-specific.
+ 
+ 
+   V4L2_CID_RDS_TX_PS_NAME 
+   string
+ 
+ Sets 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 , the RDS specification,
+there is a full description of the correct character encoding for Programme 
Service name strings.
+ 
+ 
+   V4L2_CID_RDS_TX_RADIO_TEXT 
+   string
+ 
+ Sets 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
+V4L2_CID_RDS_TX_PS_NAME. The encoding for Radio Text 
strings is also fully described
+in Annex E of .
+ 
+ 
+   V4L2_CID_AUDIO_LIMITER_ENABLED 
+   boolean
+ 
+ Enables 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.
+
+ 
+ 
+   V4L2_CID_AUDIO_LIMITER_RELEASE_TIME 
+   integer
+ 
+ Sets the audio deviation limiter feature 
release time.
+Unit is in useconds. Step and range are driver-specific.
+ 
+ 
+   V4L2_CID_AUDIO_LIMITER_DEVIATION 
+   integer
+ 
+ Configures audio frequency deviation 
level in Hz.
+The range and step are driver-specific.
+ 
+ 
+   V4L2_CID_AUDIO_COMPRESSION_ENABLED 
+   boolean
+ 
+ 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).
+ 
+ 
+   V4L2_CID_AUDIO_COMPRESSION_GAIN 
+

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

2009-07-27 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 
---
 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 
+ *
+ * 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 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* 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 ");
+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,
+   V4L2_CID_RDS_TX_PS_NAME,
+   V4L2_CID_RDS_TX_RADIO_TEXT,
+   V4L2_CID_AUDIO_LIMITER_

[PATCHv12 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 
---
 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 
+
+
+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 - Configures pilot tone frequ

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

2009-07-27 Thread Eduardo Valentin
hello guys,

This is our version 12 of this series.

It has basically changes on string controls handling. Now
the driver follows the specs by using size instead of length.
Also steps is something which is properly reported by queryfill.
Some proper comments were writen through the code.
Just to emphasize here, queryfill is about string length, although
the control field is about memory size.

Also, I've written a way to clear string controls. That was missing
on previous version. I believe it is important to have it.

Comments, as usual, are appreciated.

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  | 2052 +++
 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 |  210 +++
 14 files changed, 3239 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


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

2009-07-27 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 
---
 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..9e1ae23 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;
}
@@ -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_

[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 
---
 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 1/8] v4l2-subdev.h: Add g_modulator callbacks to subdev api

2009-07-27 Thread Eduardo Valentin
Signed-off-by: Eduardo Valentin 
---
 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


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 Verkuil 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: [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


[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 
---
 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 
+
+
+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 - Configures pilot tone frequ

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


[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 
---
 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 
+
+
+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 (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 - Configures pilot tone frequ

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

2009-07-25 Thread Eduardo Valentin
Signed-off-by: Eduardo Valentin 
---
 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


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

2009-07-25 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 
---
 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 
+ *
+ * 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 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* 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 ");
+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,
+   V4L2_CID_RDS_TX_PS_NAME,
+   V4L2_CID_RDS_TX_RADIO_TEXT,
+   V4L2_CID_AUDIO_LIMITER_

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

2009-07-25 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 
---
 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


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

2009-07-25 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 
---
 linux/drivers/media/video/v4l2-common.c |   58 ++-
 1 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 bd13702..2811f5b 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,13 @@ EXPORT_SYMBOL(v4l2_ctrl_is_value64);
  * This information is used inside v4l2_compat_ioctl32. */
 int v4l2_ctrl_is_pointer(u32 id)
 {
-   return 0;
+   switch (id) {
+   case V4L2_CID_RDS_TX_PS_NAME:
+   case V4L2_CID_RDS_TX_RADIO_TEXT:
+   return 1;
+   default:
+   return 0;
+   }
 }
 EXPORT_SYMBOL(v4l2_ctrl_is_pointer);
 
@@ -530,6 +566,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 +597,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

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

2009-07-25 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 
---
 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.
   Unfortunately, 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.
+
+  Even 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.
 
 
 
@@ -1815,6 +1821,210 @@ control must support read access and may support write 
access.
   
 
   
+
+
+  FM Transmitter Control Reference
+
+  The 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.
+
+  
+  FM_TX Control IDs
+
+  
+   
+   
+   
+   
+   
+   
+   
+ 
+   ID
+   Type
+ Description
+ 
+   
+   
+ 
+ 
+   V4L2_CID_FM_TX_CLASS 
+   class
+ The FM_TX class
+descriptor. Calling &VIDIOC-QUERYCTRL; for this control will return a
+description of this control class.
+ 
+ 
+   V4L2_CID_RDS_TX_PI 
+   integer
+ 
+ Sets the RDS Programme Identification 
field
+for transmission.
+ 
+ 
+   V4L2_CID_RDS_TX_PTY 
+   integer
+ 
+ Sets the RDS Programme Type field for 
transmission.
+This encodes up to 31 pre-defined programme types.
+ 
+ 
+   V4L2_CID_RDS_TX_DEVIATION 
+   integer
+ 
+ Configures RDS signal frequency 
deviation level in Hz.
+The range and step are driver-specific.
+ 
+ 
+   V4L2_CID_RDS_TX_PS_NAME 
+   string
+ 
+ Sets 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 , the RDS specification,
+there is a full description of the correct character encoding for Programme 
Service name strings.
+ 
+ 
+   V4L2_CID_RDS_TX_RADIO_TEXT 
+   string
+ 
+ Sets 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
+V4L2_CID_RDS_TX_PS_NAME. The encoding for Radio Text 
strings is also fully described
+in Annex E of .
+ 
+ 
+   V4L2_CID_AUDIO_LIMITER_ENABLED 
+   boolean
+ 
+ Enables 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.
+
+ 
+ 
+   V4L2_CID_AUDIO_LIMITER_RELEASE_TIME 
+   integer
+ 
+ Sets the audio deviation limiter feature 
release time.
+Unit is in useconds. Step and range are driver-specific.
+ 
+ 
+   V4L2_CID_AUDIO_LIMITER_DEVIATION 
+   integer
+ 
+ Configures audio frequency deviation 
level in Hz.
+The range and step are driver-specific.
+ 
+ 
+   V4L2_CID_AUDIO_COMPRESSION_ENABLED 
+   boolean
+ 
+ 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).
+ 
+ 
+   V4L2_CID_AUDIO_COMPRESSION_GAIN 
+

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

2009-07-25 Thread Eduardo Valentin
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

--
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:44:27PM +0200, ext Hans Verkuil wrote:
> On Saturday 25 July 2009 16:23:51 Eduardo Valentin wrote:
> > On Sat, Jul 25, 2009 at 04:08:01PM +0200, Valentin Eduardo 
> > (Nokia-D/Helsinki) wrote:
> > > 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
> > 
> > Here is an output with you new version:
> > / # 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=97 value='Si4713  ' 
> > len=97
> >  rds_radio_text (str)  : min=0 max=385 value='Si4713  \r' 
> > len=385
> >   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
> > 
> > So far so good for G_MODULATOR and for String with escaped characters. 
> > I also tried S_MODULATOR. Looks good but there is a 

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 04:39:18PM +0200, ext Hans Verkuil wrote:
> On Saturday 25 July 2009 15:25:21 Eduardo Valentin wrote:
> > 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.
> 
> Another question: what happens if I give a string that's e.g. 10 characters
> long? What will happen then?

I believe receiver will still scroll, but may get confused. This case, it is 
better
to pad with spaces.

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

> 
> 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:08:01PM +0200, Valentin Eduardo (Nokia-D/Helsinki) 
wrote:
> 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

Here is an output with you new version:
/ # 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=97 value='Si4713  ' len=97
 rds_radio_text (str)  : min=0 max=385 value='Si4713  \r' 
len=385
  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

So far so good for G_MODULATOR and for String with escaped characters. 
I also tried S_MODULATOR. Looks good but there is a bug:
else if (!strcmp(optarg, "stereo-rds"))
txsubchans = V4L2_TUNER_SUB_MONO | 
V4L2_TUNER_SUB_RDS;
else if (!strcmp(optarg, "mono-rds"))
txsubchans = V4L2_TUNER_SUB_MONO | 
V4L2_TUNER_SUB_RDS;

As you can see, you cannot properly set stereo-rds, it will keep it mono. 
Otherwise it is fine to me.

BR,

> 
> > 
> > Regards,
> > 
> > Hans
> > 
> > > 
> > > Signed-off-by: Eduardo Valentin 
> > > ---
> > >  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

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


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

2009-07-25 Thread Eduardo Valentin
On Sat, Jul 25, 2009 at 03:17:05PM +0200, Valentin Eduardo (Nokia-D/Helsinki) 
wrote:
> On Sat, Jul 25, 2009 at 03:25:25PM +0200, ext Hans Verkuil wrote:
> > On Friday 24 July 2009 18:37:28 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 
> > > ---
> > >  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 
> > > +
> > > +
> > > +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 
> > > valu

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: [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 8/8] FMTx: si4713: Add document file

2009-07-25 Thread Eduardo Valentin
On Sat, Jul 25, 2009 at 03:25:25PM +0200, ext Hans Verkuil wrote:
> On Friday 24 July 2009 18:37:28 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 
> > ---
> >  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 
> > +
> > +
> > +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  
> 
> This doesn't look right. I think this output is from an old v4l2-ctl version.
> I'd like to see this output anyway using the latest v4l2-ctl version as I
> haven't been able to test it myself.

Yeah. My bad, forgot to update here. This is the output from the older version.

> 
> Based on this output it also looks as if the rds_radio_text string has a \r
> at the end. If so, is it supposed to be there?

Yeah, the \r it is required for Radio Text.



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


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


[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 
---
 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 
+
+
+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 is capable of applying audi

[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 
---
 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 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 
---
 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 
+ *
+ * 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 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* 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 ");
+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,
+   V4L2_CID_RDS_TX_PS_NAME,
+   V4L2_CID_RDS_TX_RADIO_TEXT,
+   V4L2_CID_AUDIO_LIMITER_

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

2009-07-24 Thread Eduardo Valentin
Signed-off-by: Eduardo Valentin 
---
 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_CTR

[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 
---
 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.
   Unfortunately, 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.
+
+  Even 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.
 
 
 
@@ -1815,6 +1821,210 @@ control must support read access and may support write 
access.
   
 
   
+
+
+  FM Transmitter Control Reference
+
+  The 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.
+
+  
+  FM_TX Control IDs
+
+  
+   
+   
+   
+   
+   
+   
+   
+ 
+   ID
+   Type
+ Description
+ 
+   
+   
+ 
+ 
+   V4L2_CID_FM_TX_CLASS 
+   class
+ The FM_TX class
+descriptor. Calling &VIDIOC-QUERYCTRL; for this control will return a
+description of this control class.
+ 
+ 
+   V4L2_CID_RDS_TX_PI 
+   integer
+ 
+ Sets the RDS Programme Identification 
field
+for transmission.
+ 
+ 
+   V4L2_CID_RDS_TX_PTY 
+   integer
+ 
+ Sets the RDS Programme Type field for 
transmission.
+This encodes up to 31 pre-defined programme types.
+ 
+ 
+   V4L2_CID_RDS_TX_DEVIATION 
+   integer
+ 
+ Configures RDS signal frequency 
deviation level in Hz.
+The range and step are driver-specific.
+ 
+ 
+   V4L2_CID_RDS_TX_PS_NAME 
+   string
+ 
+ Sets 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 , the RDS specification,
+there is a full description of the correct character encoding for Programme 
Service name strings.
+ 
+ 
+   V4L2_CID_RDS_TX_RADIO_TEXT 
+   string
+ 
+ Sets 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
+V4L2_CID_RDS_TX_PS_NAME. The encoding for Radio Text 
strings is also fully described
+in Annex E of .
+ 
+ 
+   V4L2_CID_AUDIO_LIMITER_ENABLED 
+   boolean
+ 
+ Enables 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.
+
+ 
+ 
+   V4L2_CID_AUDIO_LIMITER_RELEASE_TIME 
+   integer
+ 
+ Sets the audio deviation limiter feature 
release time.
+Unit is in useconds. Step and range are driver-specific.
+ 
+ 
+   V4L2_CID_AUDIO_LIMITER_DEVIATION 
+   integer
+ 
+ Configures audio frequency deviation 
level in Hz.
+The range and step are driver-specific.
+ 
+ 
+   V4L2_CID_AUDIO_COMPRESSION_ENABLED 
+   boolean
+ 
+ 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).
+ 
+ 
+   V4L2_CID_AUDIO_COMPRESSION_GAIN 
+

[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 
---
 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 1/8] v4l2-subdev.h: Add g_modulator callbacks to subdev api

2009-07-24 Thread Eduardo Valentin
Signed-off-by: Eduardo Valentin 
---
 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


[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


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


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

2009-06-22 Thread Eduardo Valentin
Signed-off-by: Eduardo Valentin 
---
 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_ATTA

[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 
---
 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 
+
+
+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 device is capable of applying audi

[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 
---
 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 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 
---
 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::vector 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::map 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 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 
---
 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.
   Unfortunately, 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.
+
+  Even 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.
 
 
 
@@ -1816,6 +1822,200 @@ control must support read access and may support write 
access.
   
 
   
+
+
+  FM Transmitter Control Reference
+
+  The 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.
+
+  
+  FM_TX Control IDs
+
+  
+   
+   
+   
+   
+   
+   
+   
+ 
+   ID
+   Type
+ Description
+ 
+   
+   
+ 
+ 
+   V4L2_CID_FM_TX_CLASS 
+   class
+ The FM_TX class
+descriptor. Calling &VIDIOC-QUERYCTRL; for this control will return a
+description of this control class.
+ 
+ 
+   V4L2_CID_RDS_TX_PI 
+   integer
+ 
+ Sets the RDS Programme Identification 
field
+for transmission.
+ 
+ 
+   V4L2_CID_RDS_TX_PTY 
+   integer
+ 
+ Sets the RDS Programme Type field for 
transmission.
+This encodes up to 31 pre-defined programme types.
+ 
+ 
+   V4L2_CID_RDS_TX_PS_NAME 
+   string
+ 
+ Sets 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.
+ 
+ 
+   V4L2_CID_RDS_TX_RADIO_TEXT 
+   string
+ 
+ Sets 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
+V4L2_CID_RDS_TX_PS_NAME.
+ 
+ 
+   V4L2_CID_AUDIO_LIMITER_ENABLED 
+   boolean
+ 
+ Enables 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.
+
+ 
+ 
+   V4L2_CID_AUDIO_LIMITER_RELEASE_TIME 
+   integer
+ 
+ Sets the audio deviation limiter feature 
release time.
+Unit is in useconds. Step and range are driver-specific.
+ 
+ 
+   V4L2_CID_AUDIO_LIMITER_DEVIATION 
+   integer
+ 
+ Configures audio frequency deviation 
level in Hz.
+The range and step are driver-specific.
+ 
+ 
+   V4L2_CID_AUDIO_COMPRESSION_ENABLED 
+   boolean
+ 
+ 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).
+ 
+ 
+   V4L2_CID_AUDIO_COMPRESSION_GAIN 
+   integer
+ 
+ Sets the gain for audio compression 
feature. It is
+a dB value. The range and step are driver-specific.
+ 
+ 
+   V4L2_CID_AUDIO_COMPRESSION_THRESHOLD 
+   integer
+ 
+ Sets the threshold level for audio 
compression freature.
+It is a dB value. The range and step are d

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

2009-06-22 Thread Eduardo Valentin
Signed-off-by: Eduardo Valentin 
---
 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 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 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 
---
 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 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 "
---
 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 
+ *
+ * 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 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* 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 ");
+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,
+   V4L2_CID_RDS_TX_RADIO_TEXT,
+   V4L2_CID_AUDIO_LIMITER_ENABLED,
+   V4L2_CID_AUDIO_LI

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


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

2009-06-20 Thread Eduardo Valentin
Hi Hans,

On Sat, Jun 20, 2009 at 03:27:09PM +0200, ext Hans Verkuil wrote:
> On Thursday 18 June 2009 15:55:49 Eduardo Valentin wrote:
> > This patch adds files to control si4713 devices.
> > Internal functions to control device properties
> > and initialization procedures are into these files.
> > Also, a v4l2 subdev interface is also exported.
> > This way other drivers can use this as v4l2 i2c subdevice.
> >
> > Signed-off-by: Eduardo Valentin 
> > ---
> >  linux/drivers/media/radio/si4713-i2c.c | 2015
> >  linux/drivers/media/radio/si4713-i2c.h |
> >  226 
> >  linux/include/media/si4713.h   |   40 +
> >  3 files changed, 2281 insertions(+), 0 deletions(-)
> >  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/si4713.h
> >
> 
> 
> 
> > diff --git a/linux/include/media/si4713.h b/linux/include/media/si4713.h
> > new file mode 100644
> > index 000..d0960e2
> > --- /dev/null
> > +++ b/linux/include/media/si4713.h
> > @@ -0,0 +1,40 @@
> > +/*
> > + * include/media/si4713.h
> > + *
> > + * Board related data definitions for Si4713 i2c device driver.
> > + *
> > + * Copyright (c) 2009 Nokia Corporation
> > + * Contact: Eduardo Valentin 
> > + *
> > + * This file is licensed under the terms of the GNU General Public
> > License + * version 2. This program is licensed "as is" without any
> > warranty of any + * kind, whether express or implied.
> > + *
> > + */
> > +
> > +#ifndef SI4713_H
> > +#define SI4713_H
> > +
> > +/* The SI4713 I2C sensor chip has a fixed slave address of 0xc6 or 0x22.
> > */ +#define SI4713_I2C_ADDR_BUSEN_HIGH  0x63
> > +#define SI4713_I2C_ADDR_BUSEN_LOW  0x11
> > +
> > +/*
> > + * Platform dependent definition
> > + */
> > +struct si4713_platform_data {
> > +   /* Set power state, zero is off, non-zero is on. */
> > +   int (*set_power)(int power);
> > +};
> > +
> > +/*
> > + * structure to query for RSSI.
> > + */
> > +struct si4713_rssi {
> > +   unsigned int frequency;
> > +   int rssi;
> > +};
> 
> I propose to change this struct a bit:
> 
> struct si4713_rssi {
>   __u32 index;/* modulator index */
>   __u32 frequency;/* frequency */
>   __s32 rssi; /* result */
>   __u32 reserved[4];  /* drivers and apps must init this to 0 */
> };
> 
> The idea is that in the future this might become a regular ioctl and in that 
> case it would be nice if we can just copy this struct to videodev2.h and 
> rename it. In that case the si4713 has to support both private and public 
> ioctls, but since the struct pointer passed to ioctl is the same for the 
> private and public ioctls it is very easy to implement that.
> 
> The rssi field needs to be documented better in this header: what is the 
> meaning of the returned value and what is the unit? Does it have to be a 
> signed value, or should it be unsigned instead?
> 

Re-thinking this struct as something that can be moved to videode2.h, then
I agree with you. I'll resend then with the proposed structure and more
description about it.

> > +#define SI4713_IO_MEASURE_RSSI _IOWR('V', BASE_VIDIOC_PRIVATE + 0, \
> > +       struct si4713_rssi)
> 
> This needs to be documented as well: what exactly does it do? It is 
> important to have that information in this header for future reference.
> 
> Can you also rename it to SI4713_IOC_MEASURE_RSSI? 'IOC' seems to be 
> preferred above 'IO'.

Yes, no problem.

> 
> Regards,
> 
>   Hans
> 
> > +
> > +#endif /* ifndef SI4713_H*/
> 
> 
> 
> -- 
> 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 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 
---
 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 
+
+
+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 tone feature.
+
+* The si4713 

[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 
---
 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::vector 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::map 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 3/9] v4l2: video device: Add FM_TX controls default configurations

2009-06-18 Thread Eduardo Valentin
Signed-off-by: Eduardo Valentin 
---
 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_C

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


  1   2   >