aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hansverk@cisco.com>2016-03-20 22:14:48 +0100
committerHans Verkuil <hansverk@cisco.com>2016-03-20 22:14:48 +0100
commit111c3db43dc39ab10701a0a137eccba4ce641bb1 (patch)
treea760007678072f8fddf1761256dd6100aa5ff862
parentfc78afed8708ce7d2a123d239099fa18420a81f5 (diff)
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
-rw-r--r--drivers/media/radio/radio-pcimax3000.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/drivers/media/radio/radio-pcimax3000.c b/drivers/media/radio/radio-pcimax3000.c
index b854c4b2da85..b1f9e1be2231 100644
--- a/drivers/media/radio/radio-pcimax3000.c
+++ b/drivers/media/radio/radio-pcimax3000.c
@@ -174,6 +174,8 @@ static int pm3000_s_ctrl(struct v4l2_ctrl *ctrl)
{
struct pm3000 *pm3000 =
container_of(ctrl->handler, struct pm3000, hdl);
+ unsigned int n;
+ unsigned int i;
u8 buf[4] = {};
switch (ctrl->id) {
@@ -234,7 +236,27 @@ static int pm3000_s_ctrl(struct v4l2_ctrl *ctrl)
return 0;
case V4L2_CID_RDS_TX_ALT_FREQS:
- break;
+ for (i = n = 0; i < 7; i++)
+ if (ctrl->p_new.p_u32[i] >= 87500)
+ n++;
+ buf[0] = n + 224 + 4;
+ pm3000_send(pm3000->serio, "AF0", buf, 1);
+ for (i = n = 0; i < 7; i++) {
+ char cmd[4] = "AF0";
+
+ if (ctrl->p_new.p_u32[i] < 87500)
+ continue;
+ cmd[2] = '1' + n++;
+ buf[0] = (ctrl->p_new.p_u32[i] - 87500) / 100 + 4;
+ pm3000_send(pm3000->serio, cmd, buf, 1);
+ }
+ for (; n < 7; n++) {
+ char cmd[4] = "AF0";
+
+ cmd[2] = '1' + n;
+ pm3000_send(pm3000->serio, cmd, "0", 1);
+ }
+ return 0;
}
return -EINVAL;
}
@@ -246,10 +268,9 @@ static const struct v4l2_ctrl_ops pm3000_ctrl_ops = {
static const struct v4l2_ctrl_config pm3000_alt_freqs_ctrl = {
.id = V4L2_CID_RDS_TX_ALT_FREQS,
.type = V4L2_CTRL_TYPE_U32,
- .min = 87600,
- .max = 107900,
+ .min = 0,
+ .max = 108000,
.step = 100,
- .def = 87600,
.dims = { 7 },
.elem_size = sizeof(u32),
};
@@ -326,8 +347,6 @@ static int pm3000_connect(struct serio *serio, struct serio_driver *drv)
V4L2_CID_RDS_TX_MUSIC_SPEECH, 0, 1, 1, 1);
v4l2_ctrl_new_std(hdl, &pm3000_ctrl_ops,
V4L2_CID_RDS_TX_DYNAMIC_PTY, 0, 1, 1, 0);
- v4l2_ctrl_new_std(hdl, &pm3000_ctrl_ops,
- V4L2_CID_RDS_TX_ALT_FREQS_ENABLE, 0, 1, 1, 0);
v4l2_ctrl_new_custom(hdl, &pm3000_alt_freqs_ctrl, NULL);
v4l2_ctrl_new_std(hdl, &pm3000_ctrl_ops,
V4L2_CID_RDS_TX_PS_NAME, MAX_RDS_PS_NAME,

Privacy Policy