Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

radio: rda5807: fix tuning issues #15

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions drivers/media/radio/radio-rda5807.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,13 +423,15 @@ static int rda5807_vidioc_s_frequency(struct file *file, void *fh,
if (err)
return err;

/* select 25 kHz channel spacing */
/* select 50 kHz channel spacing because 25kHz can't
* cover the whole 76-108 MHz range */
mask |= RDA5807_CHAN_SPACE;
val |= FIELD_PREP(RDA5807_CHAN_SPACE, 0x3);
val |= FIELD_PREP(RDA5807_CHAN_SPACE, 0x2);

/* select frequency */
mask |= RDA5807_CHAN_WRCHAN;
val |= FIELD_PREP(RDA5807_CHAN_WRCHAN, (a->frequency + 200) / 400);
val |= FIELD_PREP(RDA5807_CHAN_WRCHAN,
(a->frequency - band->rangelow + 400) / 800);

err = regmap_update_bits(radio->map, RDA5807_REG_CHAN, mask, val);
if (err)
Expand Down