V4L/DVB: media: dvb/af9015, implement eeprom hashing
authorJiri Slaby <jslaby@suse.cz>
Fri, 22 Jan 2010 15:10:52 +0000 (12:10 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 26 Feb 2010 18:10:52 +0000 (15:10 -0300)
commit6c614044ff00bf3e7403ac6c4ed4e53db8c349f3
tree52ea3e4cdeae03ae444cd155ab96cf87e94c04c4
parent0b32d65cd7938d31eebd9c62aab6a59a3c4cf0f8
V4L/DVB: media: dvb/af9015, implement eeprom hashing

This will be useful for matching of IR tables later.

We read the eeprom anyway for dumping. Switch the dumping to
print_hex_dump_bytes and compute hash above that by
hash = 0;
for (u32 VAL) in (eeprom):
  hash *= GOLDEN_RATIO_PRIME_32
  hash += VAL; // while preserving endinaness

The computation is moved earlier to the flow, namely from
af9015_af9013_frontend_attach to af9015_read_config, so that
we can access the sum in af9015_read_config already.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/dvb-usb/af9015.c
drivers/media/dvb/dvb-usb/af9015.h