tbsdtv / linux_media

TBS linux open source drivers
https://github.com/tbsdtv/linux_media/wiki
Other
174 stars 80 forks source link

mxl58x improve rfsource to select any combination of modulator/inputs #222

Open malakudi opened 3 years ago

malakudi commented 3 years ago

With this patch we can use rfsource mxl58x module parameter to configure any arbitrary configuration of demods/inputs. We might want 7 demods to input 3 and 1 to input 2, or 5 to input 0, 2 to input 1 and 1 to input 2. All these setups can now be configured.

We use two bits to select input for each demod. demod 0 uses the two less significant bits and demod 7 the two most significant bits of a 16bit value. Value of 1455 (binary 0000010110101111) is the same as default without using rfsource. Example usage: a. 0-6 demods to input 3, 7th demod to input 2 1011111111111111 => 49151 b. 0-4 demods to input 0, 5-6 demods to input 1, 7th demod to input 2 1001010000000000 => 37888 This has been tested in production and works well.

Only issue is that you can not reconfigure on the fly, you need to unload and reload modules with new value.

malakudi commented 3 years ago

To setup all demods to input 0 you have to use value 65536 because 0 does nothing.