Linux MIPS Architecture development
 help / color / mirror / Atom feed
* SNR calculation in stv0299 driver
@ 2005-07-19 16:08 Gill Robles-Thome
  2005-07-19 16:08 ` Gill Robles-Thome
  2005-07-19 16:28 ` Ralf Baechle
  0 siblings, 2 replies; 3+ messages in thread
From: Gill Robles-Thome @ 2005-07-19 16:08 UTC (permalink / raw)
  To: linux-mips

Hi -

Can anyone explain the algorithm used to calculate the SNR for the
stv0299 driver? Ie


	case FE_READ_SNR:
	{
		s32 snr = 0xffff - ((stv0299_readreg (i2c, 0x24) << 8)
				   | stv0299_readreg (i2c, 0x25));
		snr = 3 * (snr - 0xa100);
		*((u16*) arg) = (snr > 0xffff) ? 0xffff :
				(snr < 0) ? 0 : snr;
		break;
	}
 

I don't understand where the 0xa100 value comes from, or why the result
is them multiplied by 3!  Registers 0x24 and 0x25 are apparently "Noise
Indicator" registers, but the stv0299 specification doesn't explain very
well how these registers should be used.

Thanks for your help,
Gill

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-07-19 16:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-19 16:08 SNR calculation in stv0299 driver Gill Robles-Thome
2005-07-19 16:08 ` Gill Robles-Thome
2005-07-19 16:28 ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox