Hi Torstein,
On Mon, 1 Apr 2013, Torstein Hegge wrote:
On Sun, Mar 31, 2013 at 17:52:32 +0200, Eldad Zack wrote:
Some clocks might be read-only, e.g., external clocks (see also UAC2 4.7.2.1).
In this case, setting the sample frequency will always fail (even if the rate is equal to the current clock rate), therefore do not write, but read the value and compare to the requested rate.
If it doesn't match, return -ENXIO since the clock is invalid for this configuration.
I think could be more readable if it was built on top of [1]. Then it could check the target rate against the prev_rate reported by the device and return before the sample rate set, something like:
Thanks, I think it's a good idea. I'll wait with this patch until you get your change to Takashi's tree to save some work for everyone.
@@ -279,6 +275,20 @@ static int set_sample_rate_v2(struct snd_usb_audio *chip, int iface, prev_rate = data[0] | (data[1] << 8) | (data[2] << 16) | (data[3] << 24);
You might also want to convert this into le32_to_cpu, etc. like in patch #5 of this series -- note that as Clemens said, the type should should be __le32 (and not u32).
http://mailman.alsa-project.org/pipermail/alsa-devel/2013-March/060738.html
Thanks for pointing out the formatting issues, I'll fix these before reposting.
Cheers, Eldad