ASoC: Ensure we delay long enough for WM8994 FLL to lock when starting
Subsystems (3)
PATCH 1/1 ASoC: Ensure we delay long enough for WM8994 FLL to lock when starting
This delay is very conservative.
--- sound/soc/codecs/wm8994.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
sound/soc/codecs/wm8994.c +2 -0
@@ -1725,6 +1725,8 @@ static int _wm8994_set_fll(struct snd_soc_codec *codec, int id, int src,snd_soc_update_bits (codec,WM8994_FLL1_CONTROL_1 + reg_offset,WM8994_FLL1_ENA |WM8994_FLL1_FRAC , reg); + +msleep (5 ); } wm8994->fll[id].in = freq_in;
Signature · 1 line
1.7.5.4
Hi, Mark
Quoted 1 line · Mark Brown
This delay is very conservative.
What's the meaning of conservative?
It means 5ms delay long enough?
or at least, FLL lock time should be ensured 5ms?
Thanks,
SB Kim
Quoted 5 lines · Sangbeom Kim
Quoted 1 line · Mark Brown
This delay is very conservative.
What's the meaning of conservative?
In this context it means safe.
Quoted 2 lines
It means 5ms delay long enough?
or at least, FLL lock time should be ensured 5ms?
Yes, the 5ms should be more than enough time for the FLL to lock - in most situations the time taken to do the register writes surrounding enabling and then using the FLL are sufficient to cover the startup time.
Quoted 6 lines · Mark Brown
Quoted 3 lines
Quoted 1 line
This delay is very conservative.
What's the meaning of conservative?
In this context it means safe.
Quoted 7 lines
Quoted 2 lines
It means 5ms delay long enough?
or at least, FLL lock time should be ensured 5ms?Yes, the 5ms should be more than enough time for the FLL to lock - in most situations the time taken to do the register writes surrounding enabling and then using the FLL are sufficient to cover the startup time.
OK,
I have a one more question.
Is there any checking method for locking FLL? (ex. Checking register bit for FLL lock)
Just using msleep looks not enough to ensure FLL lock.
Thanks,
SB Kim
Quoted 2 lines · Sangbeom Kim
Is there any checking method for locking FLL?
(ex. Checking register bit for FLL lock)
There is an interrupt which I've got a patch to use (it's in need of a bit more testing so not yet published). You can also poll the status bits but on a lot of systems that works out as being too expensive due to I/O costs.
Quoted 1 line
Just using msleep looks not enough to ensure FLL lock.
Practically speaking it's fine; the FLL lock time is specified performance characteristic of the device. If we can't lock when we expect to then the system is in trouble and it's not clear what we can do about usefully.
Quoted 12 lines · Mark Brown
This delay is very conservative.
Signed-off-by Mark Brown <[email protected]>--- sound/soc/codecs/wm8994.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)sound/soc/codecs/wm8994.c +0
-0
sound/soc/codecs/wm8994.c static int _wm8994_set_fll(struct snd_soc_codec *codec, int id, int src, · line 1732
Quoted 8 lines
sound/soc/codecs/wm8994.c +2
-0@@ -1725,6 +1725,8 @@ static int _wm8994_set_fll(struct snd_soc_codec *codec, int id, int src,snd_soc_update_bits (codec,WM8994_FLL1_CONTROL_1 + reg_offset,WM8994_FLL1_ENA |WM8994_FLL1_FRAC , reg); + +msleep (5 ); } wm8994->fll[id].in = freq_in;