radio: iris: Incorporate changes in tune status event

SINR and interference detection threshold parameters are added to the
tune status event. Update the driver to incorporate the changes.

CRs-Fixed: 322478
Change-Id: Ia883c85469ba4d4025d518b6ddba371c755f3763
Signed-off-by: Srinivasa Rao Uppala <uppalas@codeaurora.org>
This commit is contained in:
Srinivasa Rao Uppala
2011-12-23 14:31:38 +05:30
parent f5845c4578
commit acdebccd13
2 changed files with 28 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
/* Copyright (c) 2011, Code Aurora Forum. All rights reserved
/* Copyright (c) 2011-12, Code Aurora Forum. All rights reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -419,6 +419,13 @@ static struct v4l2_queryctrl iris_v4l2_queryctrl[] = {
.minimum = 0,
.maximum = 1,
},
{
.id = V4L2_CID_PRIVATE_IRIS_GET_SINR,
.type = V4L2_CTRL_TYPE_INTEGER,
.name = "GET SINR",
.minimum = -128,
.maximum = 127,
},
};
static void iris_q_event(struct iris_device *radio,
@@ -1908,7 +1915,7 @@ static inline void hci_ev_tune_status(struct radio_hci_dev *hdev,
if (i >= IRIS_BUF_RT_RDS)
kfifo_reset(&radio->data_buf[i]);
}
if (radio->fm_st_rsp.station_rsp.rssi)
if (radio->fm_st_rsp.station_rsp.serv_avble)
iris_q_event(radio, IRIS_EVT_ABOVE_TH);
else
iris_q_event(radio, IRIS_EVT_BELOW_TH);
@@ -2498,6 +2505,20 @@ static int iris_vidioc_g_ctrl(struct file *file, void *priv,
break;
case V4L2_CID_PRIVATE_IRIS_DO_CALIBRATION:
retval = iris_do_calibration(radio);
break;
case V4L2_CID_PRIVATE_IRIS_GET_SINR:
if (radio->mode == FM_RECV) {
retval = hci_cmd(HCI_FM_GET_STATION_PARAM_CMD,
radio->fm_hdev);
if (retval < 0) {
FMDERR("Get SINR Failed");
return retval;
}
ctrl->value = radio->fm_st_rsp.station_rsp.sinr;
} else
retval = -EINVAL;
break;
default:
retval = -EINVAL;
@@ -2609,9 +2630,8 @@ static int iris_vidioc_s_ext_ctrls(struct file *file, void *priv,
hci_fm_set_cal_req_proc,
(unsigned long)&proc_cal_req,
RADIO_HCI_TIMEOUT);
if (retval < 0) {
if (retval < 0)
FMDERR("Set Process calibration failed %d", retval);
}
break;
default:
FMDBG("Shouldn't reach here\n");

View File

@@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2011 Code Aurora Forum. All rights reserved.
* Copyright (c) 2011-2012 Code Aurora Forum. All rights reserved.
*
* This file is based on include/net/bluetooth/hci_core.h
*
@@ -354,6 +354,8 @@ struct hci_ev_tune_status {
__u8 stereo_prg;
__u8 rds_sync_status;
__u8 mute_mode;
char sinr;
__u8 intf_det_th;
} __packed;
struct hci_ev_rds_rx_data {
@@ -548,6 +550,7 @@ enum v4l2_cid_private_iris_t {
V4L2_CID_PRIVATE_IRIS_SET_AUDIO_PATH, /* TAVARUA specific command */
V4L2_CID_PRIVATE_IRIS_DO_CALIBRATION,
V4L2_CID_PRIVATE_IRIS_SRCH_ALGORITHM, /* TAVARUA specific command */
V4L2_CID_PRIVATE_IRIS_GET_SINR,
/*using private CIDs under userclass*/
V4L2_CID_PRIVATE_IRIS_READ_DEFAULT = 0x00980928,