Skip to contentSkip to conversation

af9015: backported to kernel < 2.6.22

linuxtv-commits Antti Palosaari 1 participant 1 message Feb 11, 2010 1 message not in the archive Media (V4L/DVB)

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Terve,
Short question, would it be easier to add GOLDEN_RATIO_PRIME_32 to compat.h ?

regards
Antti

Quoted 138 lines · Patch from Douglas Schilling Landgraf

The patch number 14160 was added via Douglas Schilling Landgraf<[email protected]> to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward compatible with older kernels. Compatibility modifications will be removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
Linux Media Mailing List<[email protected]>

------

From: Douglas Schilling Landgraf<[email protected]>
af9015: backported to kernel< 2.6.22

backport for hash - kernel< 2.6.22

Priority: normal

---

  linux/drivers/media/dvb/dvb-usb/af9015.c |   37 +++++++++++++++++++++++
  1 file changed, 37 insertions(+)

diff -r 7d09c32065a4 -r 8c0dbfae05ff linux/drivers/media/dvb/dvb-usb/af9015.c

linux/drivers/media/dvb/dvb-usb/af9015.c +37 -1
@@ -20,9 +20,11 @@
   *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   *
   */
+#if LINUX_VERSION_CODE>= KERNEL_VERSION(2, 6, 22)
 
  #include<linux/hash.h>
 
+#endif
  #include "af9015.h"
  #include "af9013.h"
  #include "mt2060.h"
@@ -558,15 +560,37 @@
  	return ret;
  }
 
+#if LINUX_VERSION_CODE<  KERNEL_VERSION(2, 6, 22)
+static int af9015_eeprom_dump(struct dvb_usb_device *d)
+#else
  /* hash (and dump) eeprom */
  static int af9015_eeprom_hash(struct usb_device *udev)
+#endif
  {
+#if LINUX_VERSION_CODE<  KERNEL_VERSION(2, 6, 22)
+	u8 reg, val;
+#else
  	static const unsigned int eeprom_size = 256;
  	unsigned int reg;
  	int ret;
  	u8 val, *eeprom;
  	struct req_t req = {READ_I2C, AF9015_I2C_EEPROM, 0, 0, 1, 1,&val};
+#endif
 
+#if LINUX_VERSION_CODE<  KERNEL_VERSION(2, 6, 22)
+	for (reg = 0; ; reg++) {
+		if (reg % 16 == 0) {
+			if (reg)
+				deb_info(KERN_CONT "\n");
+			deb_info(KERN_DEBUG "%02x:", reg);
+		}
+		if (af9015_read_reg_i2c(d, AF9015_I2C_EEPROM, reg,&val) == 0)
+			deb_info(KERN_CONT " %02x", val);
+		else
+			deb_info(KERN_CONT " --");
+		if (reg == 0xff)
+			break;
+#else
  	eeprom = kmalloc(eeprom_size, GFP_KERNEL);
  	if (eeprom == NULL)
  		return -ENOMEM;
@@ -577,8 +601,13 @@
  		if (ret)
  			goto free;
  		eeprom[reg] = val;
+#endif
  	}
 
+#if LINUX_VERSION_CODE<  KERNEL_VERSION(2, 6, 22)
+	deb_info(KERN_CONT "\n");
+	return 0;
+#else
  	if (dvb_usb_af9015_debug&  0x01)
  		print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, eeprom,
  				eeprom_size);
@@ -597,6 +626,7 @@
  free:
  	kfree(eeprom);
  	return ret;
+#endif
  }
 
  static int af9015_download_ir_table(struct dvb_usb_device *d)
@@ -873,10 +903,12 @@
  	if (ret)
  		goto error;
 
+#if LINUX_VERSION_CODE>= KERNEL_VERSION(2, 6, 22)
  	ret = af9015_eeprom_hash(udev);
  	if (ret)
  		goto error;
 
+#endif
  	deb_info("%s: IR mode:%d\n", __func__, val);
  	for (i = 0; i<  af9015_properties_count; i++) {
  		if (val == AF9015_IR_MODE_DISABLED) {
@@ -1129,6 +1161,11 @@
 
  		deb_info("%s: init I2C\n", __func__);
  		ret = af9015_i2c_init(adap->dev);
+#if LINUX_VERSION_CODE<  KERNEL_VERSION(2, 6, 22)
+		ret = af9015_eeprom_dump(adap->dev);
+		if (ret)
+			return ret;
+#endif
  	} else {
  		/* select I2C adapter */
  		i2c_adap =&state->i2c_adap;
 
 
---

Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/8c0dbfae05fff3ee3ddacb0c9f1799b6f1815c2b

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Signature · 1 line
http://palosaari.fi/