Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 161510
b: refs/heads/master
c: 3c7cc8d
h: refs/heads/master
v: v3
  • Loading branch information
Joonyoung Shim authored and Mauro Carvalho Chehab committed Sep 12, 2009
1 parent d698df9 commit 9d1334b
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 22 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: a9d6fd5e316f1bbed08278c88cb984a2616a0278
refs/heads/master: 3c7cc8d52c0bd60d214aca22772aa3602a2b3198
40 changes: 19 additions & 21 deletions trunk/drivers/media/radio/si470x/radio-si470x-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,10 +475,9 @@ static int si470x_vidioc_g_ctrl(struct file *file, void *priv,
int retval = 0;

/* safety checks */
if (radio->disconnected) {
retval = -EIO;
retval = si470x_disconnect_check(radio);
if (retval)
goto done;
}

switch (ctrl->id) {
case V4L2_CID_AUDIO_VOLUME:
Expand Down Expand Up @@ -511,10 +510,9 @@ static int si470x_vidioc_s_ctrl(struct file *file, void *priv,
int retval = 0;

/* safety checks */
if (radio->disconnected) {
retval = -EIO;
retval = si470x_disconnect_check(radio);
if (retval)
goto done;
}

switch (ctrl->id) {
case V4L2_CID_AUDIO_VOLUME:
Expand Down Expand Up @@ -567,10 +565,10 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv,
int retval = 0;

/* safety checks */
if (radio->disconnected) {
retval = -EIO;
retval = si470x_disconnect_check(radio);
if (retval)
goto done;
}

if (tuner->index != 0) {
retval = -EINVAL;
goto done;
Expand Down Expand Up @@ -649,10 +647,10 @@ static int si470x_vidioc_s_tuner(struct file *file, void *priv,
int retval = -EINVAL;

/* safety checks */
if (radio->disconnected) {
retval = -EIO;
retval = si470x_disconnect_check(radio);
if (retval)
goto done;
}

if (tuner->index != 0)
goto done;

Expand Down Expand Up @@ -688,10 +686,10 @@ static int si470x_vidioc_g_frequency(struct file *file, void *priv,
int retval = 0;

/* safety checks */
if (radio->disconnected) {
retval = -EIO;
retval = si470x_disconnect_check(radio);
if (retval)
goto done;
}

if (freq->tuner != 0) {
retval = -EINVAL;
goto done;
Expand All @@ -718,10 +716,10 @@ static int si470x_vidioc_s_frequency(struct file *file, void *priv,
int retval = 0;

/* safety checks */
if (radio->disconnected) {
retval = -EIO;
retval = si470x_disconnect_check(radio);
if (retval)
goto done;
}

if (freq->tuner != 0) {
retval = -EINVAL;
goto done;
Expand All @@ -747,10 +745,10 @@ static int si470x_vidioc_s_hw_freq_seek(struct file *file, void *priv,
int retval = 0;

/* safety checks */
if (radio->disconnected) {
retval = -EIO;
retval = si470x_disconnect_check(radio);
if (retval)
goto done;
}

if (seek->tuner != 0) {
retval = -EINVAL;
goto done;
Expand Down
17 changes: 17 additions & 0 deletions trunk/drivers/media/radio/si470x/radio-si470x-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,23 @@ static int si470x_get_scratch_page_versions(struct si470x_device *radio)



/**************************************************************************
* General Driver Functions - DISCONNECT_CHECK
**************************************************************************/

/*
* si470x_disconnect_check - check whether radio disconnects
*/
int si470x_disconnect_check(struct si470x_device *radio)
{
if (radio->disconnected)
return -EIO;
else
return 0;
}



/**************************************************************************
* RDS Driver Functions
**************************************************************************/
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 @@ -193,6 +193,7 @@ extern const struct v4l2_file_operations si470x_fops;
extern struct video_device si470x_viddev_template;
int si470x_get_register(struct si470x_device *radio, int regnr);
int si470x_set_register(struct si470x_device *radio, int regnr);
int si470x_disconnect_check(struct si470x_device *radio);
int si470x_set_freq(struct si470x_device *radio, unsigned int freq);
int si470x_start(struct si470x_device *radio);
int si470x_stop(struct si470x_device *radio);
Expand Down

0 comments on commit 9d1334b

Please sign in to comment.