linux icon indicating copy to clipboard operation
linux copied to clipboard

AD9361 driver does not update recalculated rf_bandwidth value

Open tfcollins opened this issue 6 years ago • 4 comments

The rf_bandwidth cannot be set to any value, and the driver correctly recalculates it based on the current BBPLL and available dividers. However, this is not written back to the actual struct which is read back for the attribute. So you have no idea what the actual value is. This is true for TX and RX.

tfcollins avatar Jan 14 '20 00:01 tfcollins

The real RX and TX RFBW is a composite of multiple filters. Which filter BW calculation would you use to report?

mhennerich avatar Jan 14 '20 07:01 mhennerich

I would say once the caldiv is determined here https://github.com/analogdevicesinc/linux/blob/master/drivers/iio/adc/ad9361.c#L2473 , use that and the BBPLL to update tx_bb_bw.

tfcollins avatar Jan 14 '20 18:01 tfcollins

Can you provide more details on how to derive the exact BW from the target using the caldiv? For RX which value would you use?

mhennerich avatar Jan 15 '20 10:01 mhennerich

For RX:

  1. Calculate caldiv with caldiv = ceil(BBPLL * ln(2) / (BWrequested * 2.8 * pi))
  2. Get the actual bandwidth with BWactual = BBPLL * ln(2)/(2.8*pi*caldiv)

For TX:

  1. Calculate caldiv with caldiv = ceil(BBPLL * ln(2) / (BWrequested * 3.2 * pi))
  2. Get the actual bandwidth with BWactual = BBPLL * ln(2)/(3.2*pi*caldiv)

tfcollins avatar Jan 15 '20 18:01 tfcollins