Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320554
b: refs/heads/master
c: 86ef3f7
h: refs/heads/master
v: v3
  • Loading branch information
Hans de Goede authored and Mauro Carvalho Chehab committed Jul 30, 2012
1 parent 7b99b86 commit 3cd79dc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8e2ce73e932b629c3e12546e5fffac7ee54d0093
refs/heads/master: 86ef3f78b8bae808f41f74c506762ac345fdf893
10 changes: 6 additions & 4 deletions trunk/drivers/media/radio/si470x/radio-si470x-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,14 +583,16 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv,
struct v4l2_tuner *tuner)
{
struct si470x_device *radio = video_drvdata(file);
int retval;
int retval = 0;

if (tuner->index != 0)
return -EINVAL;

retval = si470x_get_register(radio, STATUSRSSI);
if (retval < 0)
return retval;
if (!radio->status_rssi_auto_update) {
retval = si470x_get_register(radio, STATUSRSSI);
if (retval < 0)
return retval;
}

/* driver constants */
strcpy(tuner->name, "FM");
Expand Down
12 changes: 9 additions & 3 deletions trunk/drivers/media/radio/si470x/radio-si470x-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,12 +399,16 @@ static void si470x_int_in_callback(struct urb *urb)
}
}

if ((radio->registers[SYSCONFIG1] & SYSCONFIG1_RDS) == 0)
/* Sometimes the device returns len 0 packets */
if (urb->actual_length != RDS_REPORT_SIZE)
goto resubmit;

if (urb->actual_length > 0) {
radio->registers[STATUSRSSI] =
get_unaligned_be16(&radio->int_in_buffer[1]);

if ((radio->registers[SYSCONFIG1] & SYSCONFIG1_RDS)) {
/* Update RDS registers with URB data */
for (regnr = 0; regnr < RDS_REGISTER_NUM; regnr++)
for (regnr = 1; regnr < RDS_REGISTER_NUM; regnr++)
radio->registers[STATUSRSSI + regnr] =
get_unaligned_be16(&radio->int_in_buffer[
regnr * RADIO_REGISTER_SIZE + 1]);
Expand Down Expand Up @@ -480,6 +484,7 @@ static void si470x_int_in_callback(struct urb *urb)
radio->int_in_running = 0;
}
}
radio->status_rssi_auto_update = radio->int_in_running;
}


Expand Down Expand Up @@ -560,6 +565,7 @@ static int si470x_start_usb(struct si470x_device *radio)
"submitting int urb failed (%d)\n", retval);
radio->int_in_running = 0;
}
radio->status_rssi_auto_update = radio->int_in_running;
return retval;
}

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/media/radio/si470x/radio-si470x.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ struct si470x_device {

struct completion completion;
bool stci_enabled; /* Seek/Tune Complete Interrupt */
bool status_rssi_auto_update; /* Does RSSI get updated automatic? */

#if defined(CONFIG_USB_SI470X) || defined(CONFIG_USB_SI470X_MODULE)
/* reference to USB and video device */
Expand Down

0 comments on commit 3cd79dc

Please sign in to comment.