Re: PATCH: New driver for Zarlink ZL10313 based Compro S350/S300

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Samstag, 29. Dezember 2007, Jan D. Louw wrote:
> Hi List,
>
> Attached is a new driver for the Zarlink ZL10313/ZL10039 based Compro
> S350/S300 budget DVB-S cards. Everything except 2 way diseqc should work.
>

The attached patch changes your zl10313 driver to give a nicer register access 
log.
It adds the register number additionally to the register name.
The driver does no longer crash when doing diseqc command (that use a set bit7 
to not use auto-incrementing of register number).

Greetings
Matthias

-- 
Matthias Schwarzott (zzam)
Index: v4l-dvb/linux/drivers/media/dvb/frontends/zl10313.c
===================================================================
--- v4l-dvb.orig/linux/drivers/media/dvb/frontends/zl10313.c
+++ v4l-dvb/linux/drivers/media/dvb/frontends/zl10313.c
@@ -55,22 +55,28 @@ static int zl10313_read(const struct zl1
 		return -EREMOTEIO;
 	}
 	for (i = 0; i < count; i++) {
-		io_printk("R[%s] = 0x%x\n", zl10313_reg_names[reg + i], buf[i]);
+		io_printk("R[%d,%s]: 0x%02x\n", reg+i, zl10313_reg_names[reg + i], buf[i]);
 	}
 	return 0;
 }
 
 static int zl10313_write(struct zl10313_state *state,
-			const enum zl10313_reg_addr reg, const void *src,
+			const enum zl10313_reg_addr reg, const u8 *src,
 			const size_t count)
 {
 	u8 buf[count + 1];
 	struct i2c_msg msg;
 	int i;
+	u8 reg_out;
 
 	io_printk("%s\n", __FUNCTION__);
 	for (i = 0; i < count; i++) {
-		io_printk("R[%s] = 0x%x\n", zl10313_reg_names[reg + i], buf[i]);
+		if ((reg & 0x80) == 0)
+			reg_out = reg + i;
+		else
+			reg_out = reg & ~0x80;
+
+		io_printk("W[%d,%s]: 0x%02x\n", reg_out, zl10313_reg_names[reg_out], src[i]);
 	}
 	buf[0] = reg;
 	memcpy(&buf[1], src, count);
_______________________________________________
linux-dvb mailing list
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux