diff options
author | Tobias Lorenz <tobias.lorenz@gmx.net> | 2009-08-09 19:23:35 +0200 |
---|---|---|
committer | Tobias Lorenz <tobias.lorenz@gmx.net> | 2009-08-09 19:23:35 +0200 |
commit | b17608ffc4ff53dbf7bab4bbcdb1d3ad808e9ff0 (patch) | |
tree | 113affb031fb92429cba09a253e9ba50f6ac99d4 /linux/drivers/media/radio/si470x/radio-si470x-common.c | |
parent | edce5773436aeaa6d195d1db0cc80f4c10a7acf1 (diff) | |
download | mediapointer-dvb-s2-b17608ffc4ff53dbf7bab4bbcdb1d3ad808e9ff0.tar.gz mediapointer-dvb-s2-b17608ffc4ff53dbf7bab4bbcdb1d3ad808e9ff0.tar.bz2 |
radio-si470x: add i2c driver for si470x
This patch supports i2c interface of si470x. The i2c specific part
exists in radio-si470x-i2c.c file and the common part uses
radio-si470x-common.c file. The '#if defined' is inserted inevitably
because of parts used only si470x usb in the common file.
The current driver version doesn't support the RDS.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Acked-by: Tobias Lorenz <tobias.lorenz@gmx.net>
---
linux/drivers/media/radio/si470x/Kconfig | 13 +
linux/drivers/media/radio/si470x/Makefile | 2 +
.../media/radio/si470x/radio-si470x-common.c | 6 +
.../drivers/media/radio/si470x/radio-si470x-i2c.c | 254 ++++++++++++++++++++
linux/drivers/media/radio/si470x/radio-si470x.h | 6 +
5 files changed, 281 insertions(+), 0 deletions(-)
create mode 100644 linux/drivers/media/radio/si470x/radio-si470x-i2c.c
Diffstat (limited to 'linux/drivers/media/radio/si470x/radio-si470x-common.c')
-rw-r--r-- | linux/drivers/media/radio/si470x/radio-si470x-common.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/linux/drivers/media/radio/si470x/radio-si470x-common.c b/linux/drivers/media/radio/si470x/radio-si470x-common.c index 9f9a417ca..f33315f2c 100644 --- a/linux/drivers/media/radio/si470x/radio-si470x-common.c +++ b/linux/drivers/media/radio/si470x/radio-si470x-common.c @@ -581,8 +581,12 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv, /* driver constants */ strcpy(tuner->name, "FM"); tuner->type = V4L2_TUNER_RADIO; +#if defined(CONFIG_USB_SI470X) || defined(CONFIG_USB_SI470X_MODULE) tuner->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO | V4L2_TUNER_CAP_RDS; +#else + tuner->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO; +#endif /* range limits */ switch ((radio->registers[SYSCONFIG2] & SYSCONFIG2_BAND) >> 6) { @@ -608,10 +612,12 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv, tuner->rxsubchans = V4L2_TUNER_SUB_MONO; else tuner->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO; +#if defined(CONFIG_USB_SI470X) || defined(CONFIG_USB_SI470X_MODULE) /* If there is a reliable method of detecting an RDS channel, then this code should check for that before setting this RDS subchannel. */ tuner->rxsubchans |= V4L2_TUNER_SUB_RDS; +#endif /* mono/stereo selector */ if ((radio->registers[POWERCFG] & POWERCFG_MONO) == 0) |