The userspace interface is now what I'd expec tbut I'm still quite confused by this. Why is this not a normal bytes control? There's something going on with private data here but I'm not sure what it's supposed to do over writing to the device - a changelog might've helped...
We want to set the register table to the following struct byte-by-byte. struct rt5645_eq_param_s { unsigned short reg; unsigned short val; }; Due to the length and target registers of the table are variant, we allocate the maximum size of register settings to store the data, and they should be controlled by DAPM for following the sequence, so the settings will be applied to the hardware in the speaker event of DAPM.
There's a validation function below - we should be using it when the user supplies data so they can tell if their settings took effect.
We will add the validation function in the function "rt5645_hweq_put", if the settings are validated, it will be copied to the private data "eq_param".
Why is the hweq setting part of platform data (and why is the platform data for a specific system being set as part of this patch)? This is just a setting that can be set, there's nothing system specific about it and it's not like we're even passing in a system specific tuning here.
In the default, we want to disable the HW EQ function, and it is only enabled by the customers' request, so we set it in the platform data. The parameters of the HW EQ only can be passed by ALSA binary control.