summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnupam Roy <anupam.roy@stericsson.com>2012-02-22 20:53:56 +0530
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 11:06:03 +0200
commit23d54cde0b436343684f76141daa3b0dd6710f57 (patch)
tree4a797eeff8160886db1fc35b575170d7ea21b16a
parent7433881f47bafb6cb765a8e3b1e422449ac9d2ea (diff)
G2900 FM Radio: Disable RDS Group rejectioncg2900-fm
This implementation disables RDS group rejection in FM IP. ST-Ericsson Linux next: NA ST-Ericsson ID: 400212 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: Ia313c10b06cb64f2b66497d8bccf9fc707292e2d Signed-off-by: Anupam Roy <anupam.roy@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/50030 Reviewed-by: QATOOLS Reviewed-by: Hemant GUPTA <hemant.gupta@stericsson.com>
-rw-r--r--drivers/media/radio/CG2900/cg2900_fm_api.c11
-rw-r--r--drivers/media/radio/CG2900/cg2900_fm_driver.c41
-rw-r--r--drivers/media/radio/CG2900/cg2900_fm_driver.h35
3 files changed, 86 insertions, 1 deletions
diff --git a/drivers/media/radio/CG2900/cg2900_fm_api.c b/drivers/media/radio/CG2900/cg2900_fm_api.c
index f755ad371cc..f73f3ef39ee 100644
--- a/drivers/media/radio/CG2900/cg2900_fm_api.c
+++ b/drivers/media/radio/CG2900/cg2900_fm_api.c
@@ -1353,6 +1353,17 @@ int cg2900_fm_set_rx_default_settings(
goto error;
}
+ /* Set RDS Group rejection Off */
+ result = fmd_rx_set_rds_group_rejection(
+ FMD_RDS_GROUP_REJECTION_OFF);
+ if (0 != result) {
+ FM_ERR_REPORT("cg2900_fm_set_rx_default_settings: "
+ "fmd_rx_set_rds_group_rejection "
+ "failed %d", (unsigned int)result);
+ result = -EINVAL;
+ goto error;
+ }
+
/* Remove all Interrupt from the queue */
skb_queue_purge(&fm_interrupt_queue);
diff --git a/drivers/media/radio/CG2900/cg2900_fm_driver.c b/drivers/media/radio/CG2900/cg2900_fm_driver.c
index 95680534e11..627d0f2d674 100644
--- a/drivers/media/radio/CG2900/cg2900_fm_driver.c
+++ b/drivers/media/radio/CG2900/cg2900_fm_driver.c
@@ -3259,6 +3259,47 @@ error:
return err;
}
+int fmd_rx_set_rds_group_rejection(
+ u8 on_off_state
+ )
+{
+ int err;
+ int io_result;
+ u16 parameters[CMD_DP_SET_GROUP_REJECTION_PARAM_LEN];
+
+ if (fmd_go_cmd_busy()) {
+ err = -EBUSY;
+ goto error;
+ }
+
+ if (!fmd_state_info.fmd_initialized) {
+ err = -ENOEXEC;
+ goto error;
+ }
+
+ if (on_off_state == FMD_RDS_GROUP_REJECTION_ON)
+ parameters[0] = 0x0001;
+ else if (on_off_state == FMD_RDS_GROUP_REJECTION_OFF)
+ parameters[0] = 0x0000;
+
+ io_result = fmd_send_cmd_and_read_resp(
+ CMD_FMR_DP_SET_GROUP_REJECTION,
+ CMD_DP_SET_GROUP_REJECTION_PARAM_LEN,
+ parameters,
+ NULL,
+ NULL);
+
+ if (io_result != 0) {
+ err = io_result;
+ goto error;
+ }
+
+ err = 0;
+
+error:
+ return err;
+}
+
int fmd_rx_get_low_level_rds_groups(
u8 index,
u16 *block1,
diff --git a/drivers/media/radio/CG2900/cg2900_fm_driver.h b/drivers/media/radio/CG2900/cg2900_fm_driver.h
index 55ff60035c9..62703fa4690 100644
--- a/drivers/media/radio/CG2900/cg2900_fm_driver.h
+++ b/drivers/media/radio/CG2900/cg2900_fm_driver.h
@@ -189,6 +189,7 @@ enum fmd_debug_levels {
#define CMD_FMR_DP_BUFFER_SET_SIZE 0x0343
#define CMD_FMR_DP_BUFFER_SET_THRESHOLD 0x06C3
#define CMD_FMR_DP_SET_CONTROL 0x02A3
+#define CMD_FMR_DP_SET_GROUP_REJECTION 0x0543
#define CMD_FMR_RP_GET_RSSI 0x0083
#define CMD_FMR_RP_GET_STATE 0x0063
#define CMD_FMR_RP_STEREO_SET_MODE 0x0123
@@ -273,6 +274,7 @@ enum fmd_debug_levels {
#define CMD_DP_BUFFER_SET_SIZE_PARAM_LEN 1
#define CMD_DP_BUFFER_SET_THRESHOLD_PARAM_LEN 1
#define CMD_DP_SET_CONTROL_PARAM_LEN 1
+#define CMD_DP_SET_GROUP_REJECTION_PARAM_LEN 1
#define CMD_PA_SET_MODE_PARAM_LEN 1
#define CMD_PA_SET_CONTROL_PARAM_LEN 1
#define CMD_RP_SET_PREEMPHASIS_PARAM_LEN 1
@@ -539,6 +541,20 @@ enum fmd_rds_mode {
};
/**
+ * enum fmd_rds_group_rejection_mode - RDS Group Rejection
+ * to be selected for FM Rx.
+ *
+ * @FMD_RDS_GROUP_REJECTION_ON: Group rejection is enabled in FM Chip.
+ * @FMD_RDS_GROUP_REJECTION_OFF: Group rejection is disabled in FM Chip.
+ *
+ * RDS Group rejection to be selected for FM Rx.
+ */
+enum fmd_rds_group_rejection_mode {
+ FMD_RDS_GROUP_REJECTION_ON,
+ FMD_RDS_GROUP_REJECTION_OFF
+};
+
+/**
* enum fmd_tst_tone_status - Test Tone Generator Status.
*
* @FMD_TST_TONE_OFF: Test Tone Generator is off.
@@ -1136,7 +1152,7 @@ int fmd_rx_buffer_set_threshold(
/**
* fmd_rx_set_rds() - Enables or disables demodulation of RDS data.
*
- * @on_off_state : Rx Set ON /OFF control
+ * @on_off_state : Rx Set ON/OFF control
*
* Returns:
* 0, if no error.
@@ -1149,6 +1165,23 @@ int fmd_rx_set_rds(
);
/**
+ * fmd_rx_set_rds_group_rejection() - Enables or disables group rejection
+ * in case groups with erroneous blocks are received.
+ *
+ * @on_off_state : Rx Group Rejection ON /OFF control
+ *
+ * Returns:
+ * 0, if no error.
+ * -ENOEXEC, if preconditions are violated.
+ * -EBUSY, if FM Driver is not in idle state.
+ * -EINVAL, if wrong response received from chip.
+ */
+
+int fmd_rx_set_rds_group_rejection(
+ u8 on_off_state
+ );
+
+/**
* fmd_rx_get_low_level_rds_groups() - Gets Low level RDS group data.
*
* @index: RDS group index