Commit 36d6bf89 authored by Douglas Fischer's avatar Douglas Fischer Committed by Mauro Carvalho Chehab

media: radio: Tuning bugfix for si470x over i2c

Fixed si470x_set_channel() trying to tune before chip is turned
on, which causes warnings in dmesg and when probing, makes driver
wait for 3s for tuning timeout. This issue did not affect USB
devices because they have a different probing sequence.
Signed-off-by: default avatarDouglas Fischer <fischerdouglasc@gmail.com>
[hans.verkuil@cisco.com: fixed space-after-( checkpatch warning]
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 3e187c81
...@@ -207,6 +207,15 @@ static int si470x_set_chan(struct si470x_device *radio, unsigned short chan) ...@@ -207,6 +207,15 @@ static int si470x_set_chan(struct si470x_device *radio, unsigned short chan)
unsigned long time_left; unsigned long time_left;
bool timed_out = false; bool timed_out = false;
retval = si470x_get_register(radio, POWERCFG);
if (retval)
return retval;
if ((radio->registers[POWERCFG] & (POWERCFG_ENABLE|POWERCFG_DMUTE))
!= (POWERCFG_ENABLE|POWERCFG_DMUTE)) {
return 0;
}
/* start tuning */ /* start tuning */
radio->registers[CHANNEL] &= ~CHANNEL_CHAN; radio->registers[CHANNEL] &= ~CHANNEL_CHAN;
radio->registers[CHANNEL] |= CHANNEL_TUNE | chan; radio->registers[CHANNEL] |= CHANNEL_TUNE | chan;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment