Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 367015
b: refs/heads/master
c: b387754
h: refs/heads/master
i:
  367013: 3818079
  367011: 42b4067
  367007: b182f3f
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Apr 14, 2013
1 parent 7154488 commit 875936b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 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: 55b2a312c29695520f813e61d668318169895ba7
refs/heads/master: b387754d7256b1fa3610ed8a85f9274df49d1178
10 changes: 7 additions & 3 deletions trunk/drivers/media/radio/si4713-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -1261,6 +1261,7 @@ static int si4713_setup(struct si4713_device *sdev)
rval |= si4713_set_rds_radio_text(sdev, tmp->rds_info.radio_text);

/* Device procedure needs to set frequency first */
f.tuner = 0;
f.frequency = tmp->frequency ? tmp->frequency : DEFAULT_FREQUENCY;
f.frequency = si4713_to_v4l2(f.frequency);
rval |= si4713_s_frequency(&sdev->sd, &f);
Expand Down Expand Up @@ -1852,7 +1853,8 @@ static int si4713_g_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f)
struct si4713_device *sdev = to_si4713_device(sd);
int rval = 0;

f->type = V4L2_TUNER_RADIO;
if (f->tuner)
return -EINVAL;

if (sdev->power_state) {
u16 freq;
Expand All @@ -1877,9 +1879,11 @@ static int si4713_s_frequency(struct v4l2_subdev *sd, const struct v4l2_frequenc
int rval = 0;
u16 frequency = v4l2_to_si4713(f->frequency);

if (f->tuner)
return -EINVAL;

/* Check frequency range */
if (frequency < FREQ_RANGE_LOW || frequency > FREQ_RANGE_HIGH)
return -EDOM;
frequency = clamp_t(u16, frequency, FREQ_RANGE_LOW, FREQ_RANGE_HIGH);

if (sdev->power_state) {
rval = si4713_tx_tune_freq(sdev, frequency);
Expand Down

0 comments on commit 875936b

Please sign in to comment.