From 0cd0b6e36ef740a9cf4759439537d36928a57133 Mon Sep 17 00:00:00 2001 From: Hemant Gupta Date: Fri, 9 Sep 2011 16:16:22 +0530 Subject: CG2900 FM Radio: Adapt to kernel 3.0 This patch adapts the FM driver to kernel 3.0 ST-Ericsson Linux next: NA ST-Ericsson ID: 352334 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I93b6a1f8251709cfe36eeaa41fc5cdfc4350a5e5 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/30532 Reviewed-by: Hemant GUPTA Reviewed-by: Johan PALMAEUS Reviewed-by: Virupax SADASHIVPETIMATH Tested-by: Virupax SADASHIVPETIMATH --- drivers/media/radio/CG2900/Makefile | 12 ++++++++++++ drivers/media/radio/CG2900/cg2900_fm_driver.c | 2 +- drivers/media/radio/CG2900/cg2900_fm_driver.h | 1 - drivers/media/radio/CG2900/radio-cg2900.c | 13 ++++++++----- drivers/media/radio/Kconfig | 16 ++++++++++++++++ drivers/media/radio/Makefile | 1 + 6 files changed, 38 insertions(+), 7 deletions(-) create mode 100755 drivers/media/radio/CG2900/Makefile diff --git a/drivers/media/radio/CG2900/Makefile b/drivers/media/radio/CG2900/Makefile new file mode 100755 index 00000000000..60b12dd9c35 --- /dev/null +++ b/drivers/media/radio/CG2900/Makefile @@ -0,0 +1,12 @@ +# +# Makefile for the CG2900 FM Radio Driver +# + +radio_cg2900-objs := radio-cg2900.o cg2900_fm_api.o cg2900_fm_driver.o + +obj-$(CONFIG_RADIO_CG2900) += radio_cg2900.o + +ccflags-y := \ + -Idrivers/staging/cg2900/include \ + + diff --git a/drivers/media/radio/CG2900/cg2900_fm_driver.c b/drivers/media/radio/CG2900/cg2900_fm_driver.c index ad04705cc55..acbdf63de0a 100644 --- a/drivers/media/radio/CG2900/cg2900_fm_driver.c +++ b/drivers/media/radio/CG2900/cg2900_fm_driver.c @@ -10,10 +10,10 @@ #include #include -#include #include #include #include +#include "cg2900.h" #include "cg2900_fm_driver.h" /* diff --git a/drivers/media/radio/CG2900/cg2900_fm_driver.h b/drivers/media/radio/CG2900/cg2900_fm_driver.h index aa908a5f14d..0c04bbaae23 100644 --- a/drivers/media/radio/CG2900/cg2900_fm_driver.h +++ b/drivers/media/radio/CG2900/cg2900_fm_driver.h @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/media/radio/CG2900/radio-cg2900.c b/drivers/media/radio/CG2900/radio-cg2900.c index 6a74c0ac257..0bc06adedb5 100644 --- a/drivers/media/radio/CG2900/radio-cg2900.c +++ b/drivers/media/radio/CG2900/radio-cg2900.c @@ -10,14 +10,13 @@ #include #include -#include"linux/videodev.h" #include #include #include #include #include #include -#include +#include"cg2900.h" #include"cg2900_fm_driver.h" #define RADIO_CG2900_VERSION KERNEL_VERSION(1, 1, 0) @@ -267,7 +266,6 @@ static const struct v4l2_ioctl_ops cg2900_ioctl_ops = { /* V4L2 Video Device Structure */ static struct video_device cg2900_video_device = { .name = "STE CG2900 FM Rx/Tx Radio", - .vfl_type = VID_TYPE_TUNER | VID_TYPE_CAPTURE, .fops = &cg2900_fops, .ioctl_ops = &cg2900_ioctl_ops, .release = video_device_release_empty, @@ -1663,6 +1661,11 @@ static int vidioc_get_ext_ctrls( "failed with reason = %d", (*fm_interrupt_buffer), (*(fm_interrupt_buffer + 1))); + /* + * Update return value, so that application + * can read the event failure reason. + */ + ret_val = 0; break; } @@ -2530,7 +2533,7 @@ static int cg2900_open( int ret_val = -EINVAL; struct video_device *vdev = video_devdata(file); - lock_kernel(); + mutex_lock(&fm_mutex); users++; FM_INFO_REPORT("cg2900_open: users = %d", users); @@ -2572,7 +2575,7 @@ switch_on_error: init_error: users--; done: - unlock_kernel(); + mutex_unlock(&fm_mutex); FM_DEBUG_REPORT("cg2900_open: returning %d", ret_val); return ret_val; } diff --git a/drivers/media/radio/Kconfig b/drivers/media/radio/Kconfig index 8db2d7f4b52..3fadf6aff35 100644 --- a/drivers/media/radio/Kconfig +++ b/drivers/media/radio/Kconfig @@ -161,6 +161,22 @@ config RADIO_WL1273 To compile this driver as a module, choose M here: the module will be called radio-wl1273. +config RADIO_CG2900 + tristate "ST-Ericsson CG2900 FM Radio support" + depends on CG2900 && VIDEO_V4L2 + ---help--- + Choose Y here if you have one of these FM radio cards. This is a BT, + FM and GPS combo chip controlled via HCI. + + In order to control your radio card, you will need to use programs + that are compatible with the Video For Linux API. Information on + this API and pointers to "v4l" programs may be found at + . + + To compile this driver as a module, choose M here: the + module will be called radio-CG2900. + + # TI's ST based wl128x FM radio source "drivers/media/radio/wl128x/Kconfig" diff --git a/drivers/media/radio/Makefile b/drivers/media/radio/Makefile index ca8c7d134b9..8435dabcb3c 100644 --- a/drivers/media/radio/Makefile +++ b/drivers/media/radio/Makefile @@ -28,5 +28,6 @@ obj-$(CONFIG_RADIO_TEF6862) += tef6862.o obj-$(CONFIG_RADIO_TIMBERDALE) += radio-timb.o obj-$(CONFIG_RADIO_WL1273) += radio-wl1273.o obj-$(CONFIG_RADIO_WL128X) += wl128x/ +obj-$(CONFIG_RADIO_CG2900) += CG2900/ ccflags-y += -Isound -- cgit v1.2.3