From acdebccd13dccabb9103bb7ced38c5e89bb78417 Mon Sep 17 00:00:00 2001 From: Srinivasa Rao Uppala Date: Fri, 23 Dec 2011 14:31:38 +0530 Subject: [PATCH] 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 --- drivers/media/radio/radio-iris.c | 28 ++++++++++++++++++++++++---- include/media/radio-iris.h | 5 ++++- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/drivers/media/radio/radio-iris.c b/drivers/media/radio/radio-iris.c index 59f915e4b0a..7e72391cb13 100644 --- a/drivers/media/radio/radio-iris.c +++ b/drivers/media/radio/radio-iris.c @@ -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"); diff --git a/include/media/radio-iris.h b/include/media/radio-iris.h index 489c2484464..536679f7ef7 100644 --- a/include/media/radio-iris.h +++ b/include/media/radio-iris.h @@ -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,