Skip to contentSkip to conversation

DM1105: could not attach frontend 195d:1105

DISCUSSION Igor M. Liplianin 6 participants 28 messages Feb 20, 2010 – May 3, 2011 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
Quoted 8 lines · On 18 февраля 2010, [email protected] wrote:

I also got the unbranded dm1105 card. I tried the four possible i2c addresses, just i case. Noen worked of course. Then I traced the i2c pins on the tuner to pins 100 and 101 on the DM1105.
These are GPIO pins, so bit-banging i2c on these pins seems to be the solution.

scl = p101 = gpio14
sda = p100 = gpio13

Here is the patch to test. Use option card=4.

	modprobe dm1105 card=4
Signature · 2 lines
Igor M. Liplianin
Microsoft Windows Free Zone - Linux used for all Computing Tasks
linux/drivers/media/dvb/dm1105/dm1105.c +189 -9
@@ -20,6 +20,7 @@
  */
 
 #include <linux/i2c.h>
+#include <linux/i2c-algo-bit.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -47,11 +48,12 @@
 
 #define UNSET (-1U)
 
-#define DM1105_BOARD_NOAUTO		UNSET
-#define DM1105_BOARD_UNKNOWN		0
-#define DM1105_BOARD_DVBWORLD_2002	1
-#define DM1105_BOARD_DVBWORLD_2004	2
-#define DM1105_BOARD_AXESS_DM05		3
+#define DM1105_BOARD_NOAUTO			UNSET
+#define DM1105_BOARD_UNKNOWN			0
+#define DM1105_BOARD_DVBWORLD_2002		1
+#define DM1105_BOARD_DVBWORLD_2004		2
+#define DM1105_BOARD_AXESS_DM05			3
+#define DM1105_BOARD_UNBRANDED_I2C_ON_GPIO	4
 
 /* ----------------------------------------------- */
 /*
@@ -155,23 +157,27 @@
 #define DM1105_MAX				0x04
 
 #define DRIVER_NAME				"dm1105"
+#define DM1105_I2C_GPIO_NAME			"dm1105-gpio"
 
 #define DM1105_DMA_PACKETS			47
 #define DM1105_DMA_PACKET_LENGTH		(128*4)
 #define DM1105_DMA_BYTES			(128 * 4 * DM1105_DMA_PACKETS)
 
 /* GPIO's for LNB power control */
-#define DM1105_LNB_MASK				0x00000000
+#define DM1105_LNB_MASK				0x00006000
 #define DM1105_LNB_OFF				0x00020000
 #define DM1105_LNB_13V				0x00010100
 #define DM1105_LNB_18V				0x00000100
 
 /* GPIO's for LNB power control for Axess DM05 */
-#define DM05_LNB_MASK				0x00000000
+#define DM05_LNB_MASK				0x00006000
 #define DM05_LNB_OFF				0x00020000/* actually 13v */
 #define DM05_LNB_13V				0x00020000
 #define DM05_LNB_18V				0x00030000
 
+#define GPIO13					(1 << 13)
+#define GPIO14					(1 << 14)
+
 static unsigned int card[]  = {[0 ... 3] = UNSET };
 module_param_array(card,  int, NULL, 0444);
 MODULE_PARM_DESC(card, "card type");
@@ -185,7 +191,9 @@
 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
 
 struct dm1105_board {
-	char                    *name;
+	char		*name;
+	int		i2c_on_gpio;
+	u32		gpio_scl, gpio_sda;
 };
 
 struct dm1105_subid {
@@ -207,6 +215,12 @@
 	[DM1105_BOARD_AXESS_DM05] = {
 		.name		= "Axess/EasyTv DM05",
 	},
+	[DM1105_BOARD_UNBRANDED_I2C_ON_GPIO] = {
+		.name		= "Unbranded DM1105 with i2c on GPIOs",
+		.i2c_on_gpio	= 1,
+		.gpio_scl	= GPIO14,
+		.gpio_sda	= GPIO13,
+	},
 };
 
 static const struct dm1105_subid dm1105_subids[] = {
@@ -292,6 +306,8 @@
 
 	/* i2c */
 	struct i2c_adapter i2c_adap;
+	struct i2c_adapter i2c_bb_adap;
+	struct i2c_algo_bit_data i2c_bit;
 
 	/* irq */
 	struct work_struct work;
@@ -327,6 +343,97 @@
 #define dm_setl(reg, bit)	dm_andorl((reg), (bit), (bit))
 #define dm_clearl(reg, bit)	dm_andorl((reg), (bit), 0)
 
+/* The chip has 18 GPIOs. In HOST mode GPIO's used as 15 bit address lines,
+ so we can use only 3 GPIO's from GPIO15 to GPIO17.
+ Here I don't check whether HOST is enebled as it is not implemented yet.
+ */
+void dm1105_gpio_set(struct dm1105_dev *dev, u32 mask)
+{
+	if (mask & 0xfffc0000)
+		printk(KERN_ERR "%s: Only 18 GPIO's are allowed\n", __func__);
+
+	if (mask & 0x0003ffff)
+		dm_setl(DM1105_GPIOVAL, mask & 0x0003ffff);
+
+}
+
+void dm1105_gpio_clear(struct dm1105_dev *dev, u32 mask)
+{
+	if (mask & 0xfffc0000)
+		printk(KERN_ERR "%s: Only 18 GPIO's are allowed\n", __func__);
+
+	if (mask & 0x0003ffff)
+		dm_clearl(DM1105_GPIOVAL, mask & 0x0003ffff);
+
+}
+
+u32 dm1105_gpio_get(struct dm1105_dev *dev, u32 mask)
+{
+	if (mask & 0xfffc0000)
+		printk(KERN_ERR "%s: Only 18 GPIO's are allowed\n", __func__);
+
+	if (mask & 0x0003ffff)
+		return dm_readl(DM1105_GPIOVAL);
+
+	return 0;
+}
+
+void dm1105_gpio_enable(struct dm1105_dev *dev, u32 mask, int asoutput)
+{
+	if (mask & 0xfffc0000)
+		printk(KERN_ERR "%s: Only 18 GPIO's are allowed\n", __func__);
+
+	if ((mask & 0x0003ffff) && asoutput)
+		dm_clearl(DM1105_GPIOCTR, mask & 0x0003ffff);
+	else if ((mask & 0x0003ffff) && !asoutput)
+		dm_setl(DM1105_GPIOCTR, mask & 0x0003ffff);
+
+}
+
+static void dm1105_setline(struct dm1105_dev *dev, u32 line, int state)
+{
+	if (state)
+		dm1105_gpio_enable(dev, line, 0);
+	else {
+		dm1105_gpio_enable(dev, line, 1);
+		dm1105_gpio_clear(dev, line);
+	}
+}
+
+static void dm1105_setsda(void *data, int state)
+{
+	struct dm1105_dev *dev = data;
+
+	dm1105_setline(dev, dm1105_boards[dev->boardnr].gpio_sda, state);
+}
+
+static void dm1105_setscl(void *data, int state)
+{
+	struct dm1105_dev *dev = data;
+
+	dm1105_setline(dev, dm1105_boards[dev->boardnr].gpio_scl, state);
+}
+
+static int dm1105_getsda(void *data)
+{
+	struct dm1105_dev *dev = data;
+
+	return dm1105_gpio_get(dev, dm1105_boards[dev->boardnr].gpio_sda);
+}
+
+static int dm1105_getscl(void *data)
+{
+	struct dm1105_dev *dev = data;
+
+	return dm1105_gpio_get(dev, dm1105_boards[dev->boardnr].gpio_scl);
+}
+
+//static int dm1105_i2c_bb_xfer(struct i2c_adapter *i2c_adap,
+//			    struct i2c_msg *msgs, int num)
+//{
+//	return num;
+//}
+
 static int dm1105_i2c_xfer(struct i2c_adapter *i2c_adap,
 			    struct i2c_msg *msgs, int num)
 {
@@ -425,6 +532,14 @@
 #endif
 };
 
+//static struct i2c_algorithm dm1105_bb_algo = {
+//	.master_xfer   = dm1105_i2c_bb_xfer,
+//	.functionality = functionality,
+//#ifdef NEED_ALGO_CONTROL
+//	.algo_control = dummy_algo_control,
+//#endif
+//};
+
 static inline struct dm1105_dev *feed_to_dm1105_dev(struct dvb_demux_feed *feed)
 {
 	return container_of(feed->demux, struct dm1105_dev, demux);
@@ -742,6 +857,33 @@
 	int ret;
 
 	switch (dev->boardnr) {
+	case DM1105_BOARD_UNBRANDED_I2C_ON_GPIO:
+		dev->fe = dvb_attach(
+			stv0299_attach, &sharp_z0194a_config,
+			&dev->i2c_bb_adap);
+		if (dev->fe) {
+			dev->fe->ops.set_voltage = dm1105_set_voltage;
+			dvb_attach(dvb_pll_attach, dev->fe, 0x60,
+					&dev->i2c_bb_adap, DVB_PLL_OPERA1);
+			break;
+		}
+
+		dev->fe = dvb_attach(
+			stv0288_attach, &earda_config,
+			&dev->i2c_bb_adap);
+		if (dev->fe) {
+			dev->fe->ops.set_voltage = dm1105_set_voltage;
+			dvb_attach(stb6000_attach, dev->fe, 0x61,
+					&dev->i2c_bb_adap);
+			break;
+		}
+
+		dev->fe = dvb_attach(
+			si21xx_attach, &serit_config,
+			&dev->i2c_bb_adap);
+		if (dev->fe)
+			dev->fe->ops.set_voltage = dm1105_set_voltage;
+		break;
 	case DM1105_BOARD_DVBWORLD_2004:
 		dev->fe = dvb_attach(
 			cx24116_attach, &serit_sp2633_config,
@@ -904,12 +1046,48 @@
 
 	if (ret < 0)
 		goto err_dm1105_hw_exit;
+#if 0
+	/* second i2c for GPIO connected devices */
+	i2c_set_adapdata(&dev->i2c_bb_adap, dev);
+	strcpy(dev->i2c_bb_adap.name, DM1105_I2C_GPIO_NAME);
+	dev->i2c_bb_adap.owner = THIS_MODULE;
+	dev->i2c_bb_adap.class = I2C_CLASS_TV_DIGITAL;
+	dev->i2c_bb_adap.dev.parent = &pdev->dev;
+	dev->i2c_bb_adap.algo = &dm1105_bb_algo;
+	dev->i2c_bb_adap.algo_data = dev;
+	ret = i2c_add_adapter(&dev->i2c_bb_adap);
 
+	if (ret < 0)
+		goto err_i2c_del_adapter;
+#else
+	/* i2c */
+	i2c_set_adapdata(&dev->i2c_adap, dev);
+	strcpy(dev->i2c_bb_adap.name, DM1105_I2C_GPIO_NAME);
+	dev->i2c_bb_adap.owner = THIS_MODULE;
+	dev->i2c_bb_adap.class = I2C_CLASS_TV_DIGITAL;
+	dev->i2c_bb_adap.dev.parent = &pdev->dev;
+	dev->i2c_bb_adap.algo_data = &dev->i2c_bit;
+	dev->i2c_bit.data = dev;
+	dev->i2c_bit.setsda = dm1105_setsda;
+	dev->i2c_bit.setscl = dm1105_setscl;
+	dev->i2c_bit.getsda = dm1105_getsda;
+	dev->i2c_bit.getscl = dm1105_getscl;
+	dev->i2c_bit.udelay = 10;
+	dev->i2c_bit.timeout = 10;
+
+	/* Raise SCL and SDA */
+	dm1105_setsda(dev, 1);
+	dm1105_setscl(dev, 1);
+
+	ret = i2c_bit_add_bus(&dev->i2c_bb_adap);
+	if (ret < 0)
+		goto err_i2c_del_adapter;
+#endif
 	/* dvb */
 	ret = dvb_register_adapter(&dev->dvb_adapter, DRIVER_NAME,
 					THIS_MODULE, &pdev->dev, adapter_nr);
 	if (ret < 0)
-		goto err_i2c_del_adapter;
+		goto err_i2c_del_adapters;
 
 	dvb_adapter = &dev->dvb_adapter;
 
@@ -991,6 +1169,8 @@
 	dvb_dmx_release(dvbdemux);
 err_dvb_unregister_adapter:
 	dvb_unregister_adapter(dvb_adapter);
+err_i2c_del_adapters:
+	i2c_del_adapter(&dev->i2c_bb_adap);
 err_i2c_del_adapter:
 	i2c_del_adapter(&dev->i2c_adap);
 err_dm1105_hw_exit:
#2 lore raw

Hey Igor,
I'm getting the same error:
dm1105 0000:04:0b.0: could not attach frontend

Did you get your one to work.

Thanks
Nameer

Quoted 14 lines · Igor M. Liplianin
Quoted 9 lines · On 18 февраля 2010, [email protected] wrote:

I also got the unbranded dm1105 card. I tried the four possible i2c addresses, just i case. Noen worked of course. Then I traced the i2c pins on the tuner to pins 100 and 101 on the DM1105.
These are GPIO pins, so bit-banging i2c on these pins seems to be the solution.

scl = p101 = gpio14
sda = p100 = gpio13

Here is the patch to test. Use option card=4.

	modprobe dm1105 card=4
#3 lore raw

No luck here either, still working on it.
My plan is to solder som wires on strategic points on the board and debug i2c and other activity with an oscilloscope. Will probably start next week.

Quoted 27 lines · Nameer Kazzaz

Hey Igor,
I'm getting the same error:
dm1105 0000:04:0b.0: could not attach frontend

Did you get your one to work.

Thanks
Nameer

Quoted 14 lines · Igor M. Liplianin
Quoted 9 lines · On 18 февраля 2010, [email protected] wrote:

I also got the unbranded dm1105 card. I tried the four possible i2c addresses, just i case. Noen worked of course. Then I traced the i2c pins on the tuner to pins 100 and 101 on the DM1105.
These are GPIO pins, so bit-banging i2c on these pins seems to be the solution.

scl = p101 = gpio14
sda = p100 = gpio13

Here is the patch to test. Use option card=4.

    modprobe dm1105 card=4
#4 lore raw

Sounds cool, let me know if I can help you with anything.

Thanks
Nameer

Quoted 32 lines · Hendrik Skarpeid

No luck here either, still working on it.
My plan is to solder som wires on strategic points on the board and debug i2c and other activity with an oscilloscope. Will probably start next week.

Quoted 27 lines · Nameer Kazzaz

Hey Igor,
I'm getting the same error:
dm1105 0000:04:0b.0: could not attach frontend

Did you get your one to work.

Thanks
Nameer

Quoted 14 lines · Igor M. Liplianin
Quoted 9 lines · On 18 февраля 2010, [email protected] wrote:

I also got the unbranded dm1105 card. I tried the four possible i2c addresses, just i case. Noen worked of course. Then I traced the i2c pins on the tuner to pins 100 and 101 on the DM1105.
These are GPIO pins, so bit-banging i2c on these pins seems to be the solution.

scl = p101 = gpio14
sda = p100 = gpio13

Here is the patch to test. Use option card=4.

    modprobe dm1105 card=4
#5 lore raw
Quoted 34 lines · On 23 февраля 2010 15:12:05 Nameer Kazzaz wrote:

Sounds cool, let me know if I can help you with anything.

Thanks
Nameer

Quoted 28 lines · Hendrik Skarpeid

No luck here either, still working on it.
My plan is to solder som wires on strategic points on the board and debug i2c and other activity with an oscilloscope. Will probably start next week.

Quoted 22 lines · Nameer Kazzaz

Hey Igor,
I'm getting the same error:
dm1105 0000:04:0b.0: could not attach frontend

Did you get your one to work.

Thanks
Nameer

Quoted 12 lines · Igor M. Liplianin
Quoted 8 lines · On 18 февраля 2010, [email protected] wrote:

I also got the unbranded dm1105 card. I tried the four possible i2c addresses, just i case. Noen worked of course. Then I traced the i2c pins on the tuner to pins 100 and 101 on the DM1105.
These are GPIO pins, so bit-banging i2c on these pins seems to be the solution.

scl = p101 = gpio14
sda = p100 = gpio13

Here is the patch to test. Use option card=4.

    modprobe dm1105 card=4

I didn't test patch in real hardware.
But I can connect GPIO14 and GPIO13 to SCL and SDA in any dm1105 card and test whether it works. Then I will ask you to test also.

Signature · 2 lines
Igor M. Liplianin
Microsoft Windows Free Zone - Linux used for all Computing Tasks
#6 lore raw

Ok, no problem happy to help.

Nameer

Quoted 46 lines · Igor M. Liplianin
Quoted 39 lines · On 23 февраля 2010 15:12:05 Nameer Kazzaz wrote:

Sounds cool, let me know if I can help you with anything.

Thanks
Nameer

Quoted 32 lines · Hendrik Skarpeid

No luck here either, still working on it.
My plan is to solder som wires on strategic points on the board and debug i2c and other activity with an oscilloscope. Will probably start next week.

Quoted 25 lines · Nameer Kazzaz

Hey Igor,
I'm getting the same error:
dm1105 0000:04:0b.0: could not attach frontend

Did you get your one to work.

Thanks
Nameer

Quoted 14 lines · Igor M. Liplianin
Quoted 9 lines · On 18 февраля 2010, [email protected] wrote:

I also got the unbranded dm1105 card. I tried the four possible i2c addresses, just i case. Noen worked of course. Then I traced the i2c pins on the tuner to pins 100 and 101 on the DM1105.
These are GPIO pins, so bit-banging i2c on these pins seems to be the solution.

scl = p101 = gpio14
sda = p100 = gpio13

Here is the patch to test. Use option card=4.

    modprobe dm1105 card=4

I didn't test patch in real hardware.
But I can connect GPIO14 and GPIO13 to SCL and SDA in any dm1105 card and test whether it works. Then I will ask you to test also.

#7 lore raw
In reply to Igor M. Liplianin

Igor M. Liplianin skrev:

Quoted 38 lines · On 23 февраля 2010 15:12:05 Nameer Kazzaz wrote:
Quoted 37 lines

Sounds cool, let me know if I can help you with anything.

Thanks
Nameer

Quoted 29 lines · Hendrik Skarpeid

No luck here either, still working on it.
My plan is to solder som wires on strategic points on the board and debug i2c and other activity with an oscilloscope. Will probably start next week.

Quoted 22 lines · Nameer Kazzaz

Hey Igor,
I'm getting the same error:
dm1105 0000:04:0b.0: could not attach frontend

Did you get your one to work.

Thanks
Nameer

Quoted 11 lines · Igor M. Liplianin
Quoted 9 lines · On 18 февраля 2010, [email protected] wrote:

I also got the unbranded dm1105 card. I tried the four possible i2c addresses, just i case. Noen worked of course. Then I traced the i2c pins on the tuner to pins 100 and 101 on the DM1105.
These are GPIO pins, so bit-banging i2c on these pins seems to be the solution.

scl = p101 = gpio14
sda = p100 = gpio13

Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Here is the patch to test. Use option card=4.

    modprobe dm1105 card=4

I didn't test patch in real hardware.
But I can connect GPIO14 and GPIO13 to SCL and SDA in any dm1105 card and test whether it works. Then I will ask you to test also.

A little progress update.
A modded card with connections made between the dm1105 i2c pins and the gpio pins is detected as a dm05 and seems to work, at least with kernel 2.6.33 and liplianin modules. This suggests that the i2c bitbanging is not working properly.

#8 lore raw
In reply to Igor M. Liplianin

Igor M. Liplianin skrev:

Quoted 46 lines · On 23 февраля 2010 15:12:05 Nameer Kazzaz wrote:
Quoted 40 lines

Sounds cool, let me know if I can help you with anything.

Thanks
Nameer

Quoted 32 lines · Hendrik Skarpeid

No luck here either, still working on it.
My plan is to solder som wires on strategic points on the board and debug i2c and other activity with an oscilloscope. Will probably start next week.

Quoted 25 lines · Nameer Kazzaz

Hey Igor,
I'm getting the same error:
dm1105 0000:04:0b.0: could not attach frontend

Did you get your one to work.

Thanks
Nameer

Quoted 14 lines · Igor M. Liplianin
Quoted 9 lines · On 18 февраля 2010, [email protected] wrote:

I also got the unbranded dm1105 card. I tried the four possible i2c addresses, just i case. Noen worked of course. Then I traced the i2c pins on the tuner to pins 100 and 101 on the DM1105.
These are GPIO pins, so bit-banging i2c on these pins seems to be the solution.

scl = p101 = gpio14
sda = p100 = gpio13

Here is the patch to test. Use option card=4.

    modprobe dm1105 card=4

I didn't test patch in real hardware.
But I can connect GPIO14 and GPIO13 to SCL and SDA in any dm1105 card and test whether it works. Then I will ask you to test also.

Quoted 7 lines

------------------------------------------------------------------------

No virus found in this incoming message.
Checked by AVG - www.avg.com Version: 9.0.733 / Virus Database: 271.1.1/2708 - Release Date: 02/24/10 20:34:00

Think I solved it.
The dm1105_getsda and dm1105_getscl functions need to mask out the other GPIO bits.
I hacked the code to return 1 if corresponding GPIO set, and 0 if not set. That did the trick. Now the frontend registers and /dev/dvb is populated. :) Haven't done any tuning yet.

#9 lore raw
Quoted 50 lines · Igor M. Liplianin

Igor M. Liplianin skrev:

Quoted 41 lines · On 23 февраля 2010 15:12:05 Nameer Kazzaz wrote:
Quoted 34 lines

Sounds cool, let me know if I can help you with anything.

Thanks
Nameer

Quoted 28 lines · Hendrik Skarpeid

No luck here either, still working on it.
My plan is to solder som wires on strategic points on the board and debug i2c and other activity with an oscilloscope. Will probably start next week.

Quoted 22 lines · Nameer Kazzaz

Hey Igor,
I'm getting the same error:
dm1105 0000:04:0b.0: could not attach frontend

Did you get your one to work.

Thanks
Nameer

Quoted 12 lines · Igor M. Liplianin
Quoted 8 lines · On 18 февраля 2010, [email protected] wrote:

I also got the unbranded dm1105 card. I tried the four possible i2c addresses, just i case. Noen worked of course. Then I traced the i2c pins on the tuner to pins 100 and 101 on the DM1105. These are GPIO pins, so bit-banging i2c on these pins seems to be the solution.

scl = p101 = gpio14
sda = p100 = gpio13

Here is the patch to test. Use option card=4.

    modprobe dm1105 card=4

I didn't test patch in real hardware.
But I can connect GPIO14 and GPIO13 to SCL and SDA in any dm1105 card and test whether it works. Then I will ask you to test also.

Quoted 7 lines

------------------------------------------------------------------------

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.733 / Virus Database: 271.1.1/2708 - Release Date: 02/24/10 20:34:00

Quoted 7 lines

Think I solved it.
The dm1105_getsda and dm1105_getscl functions need to mask out the other GPIO bits.
I hacked the code to return 1 if corresponding GPIO set, and 0 if not set. That did the trick. Now the frontend registers and /dev/dvb is populated. :)
Haven't done any tuning yet.

Do you cut connections between dm1105 i2c pins and the gpio pins you make earlier?

Signature · 2 lines
Igor M. Liplianin
Microsoft Windows Free Zone - Linux used for all Computing Tasks
linux/drivers/media/dvb/dm1105/dm1105.c +159 -9
@@ -20,6 +20,7 @@
  */
 
 #include <linux/i2c.h>
+#include <linux/i2c-algo-bit.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -47,11 +48,12 @@
 
 #define UNSET (-1U)
 
-#define DM1105_BOARD_NOAUTO		UNSET
-#define DM1105_BOARD_UNKNOWN		0
-#define DM1105_BOARD_DVBWORLD_2002	1
-#define DM1105_BOARD_DVBWORLD_2004	2
-#define DM1105_BOARD_AXESS_DM05		3
+#define DM1105_BOARD_NOAUTO			UNSET
+#define DM1105_BOARD_UNKNOWN			0
+#define DM1105_BOARD_DVBWORLD_2002		1
+#define DM1105_BOARD_DVBWORLD_2004		2
+#define DM1105_BOARD_AXESS_DM05			3
+#define DM1105_BOARD_UNBRANDED_I2C_ON_GPIO	4
 
 /* ----------------------------------------------- */
 /*
@@ -155,23 +157,27 @@
 #define DM1105_MAX				0x04
 
 #define DRIVER_NAME				"dm1105"
+#define DM1105_I2C_GPIO_NAME			"dm1105-gpio"
 
 #define DM1105_DMA_PACKETS			47
 #define DM1105_DMA_PACKET_LENGTH		(128*4)
 #define DM1105_DMA_BYTES			(128 * 4 * DM1105_DMA_PACKETS)
 
 /* GPIO's for LNB power control */
-#define DM1105_LNB_MASK				0x00000000
+#define DM1105_LNB_MASK				0x00006000
 #define DM1105_LNB_OFF				0x00020000
 #define DM1105_LNB_13V				0x00010100
 #define DM1105_LNB_18V				0x00000100
 
 /* GPIO's for LNB power control for Axess DM05 */
-#define DM05_LNB_MASK				0x00000000
+#define DM05_LNB_MASK				0x00006000
 #define DM05_LNB_OFF				0x00020000/* actually 13v */
 #define DM05_LNB_13V				0x00020000
 #define DM05_LNB_18V				0x00030000
 
+#define GPIO13					(1 << 13)
+#define GPIO14					(1 << 14)
+
 static unsigned int card[]  = {[0 ... 3] = UNSET };
 module_param_array(card,  int, NULL, 0444);
 MODULE_PARM_DESC(card, "card type");
@@ -185,7 +191,8 @@
 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
 
 struct dm1105_board {
-	char                    *name;
+	char		*name;
+	u32		gpio_scl, gpio_sda;
 };
 
 struct dm1105_subid {
@@ -207,6 +214,11 @@
 	[DM1105_BOARD_AXESS_DM05] = {
 		.name		= "Axess/EasyTv DM05",
 	},
+	[DM1105_BOARD_UNBRANDED_I2C_ON_GPIO] = {
+		.name		= "Unbranded DM1105 with i2c on GPIOs",
+		.gpio_scl	= GPIO14,
+		.gpio_sda	= GPIO13,
+	},
 };
 
 static const struct dm1105_subid dm1105_subids[] = {
@@ -292,6 +304,8 @@
 
 	/* i2c */
 	struct i2c_adapter i2c_adap;
+	struct i2c_adapter i2c_bb_adap;
+	struct i2c_algo_bit_data i2c_bit;
 
 	/* irq */
 	struct work_struct work;
@@ -327,6 +341,91 @@
 #define dm_setl(reg, bit)	dm_andorl((reg), (bit), (bit))
 #define dm_clearl(reg, bit)	dm_andorl((reg), (bit), 0)
 
+/* The chip has 18 GPIOs. In HOST mode GPIO's used as 15 bit address lines,
+ so we can use only 3 GPIO's from GPIO15 to GPIO17.
+ Here I don't check whether HOST is enebled as it is not implemented yet.
+ */
+void dm1105_gpio_set(struct dm1105_dev *dev, u32 mask)
+{
+	if (mask & 0xfffc0000)
+		printk(KERN_ERR "%s: Only 18 GPIO's are allowed\n", __func__);
+
+	if (mask & 0x0003ffff)
+		dm_setl(DM1105_GPIOVAL, mask & 0x0003ffff);
+
+}
+
+void dm1105_gpio_clear(struct dm1105_dev *dev, u32 mask)
+{
+	if (mask & 0xfffc0000)
+		printk(KERN_ERR "%s: Only 18 GPIO's are allowed\n", __func__);
+
+	if (mask & 0x0003ffff)
+		dm_clearl(DM1105_GPIOVAL, mask & 0x0003ffff);
+
+}
+
+u32 dm1105_gpio_get(struct dm1105_dev *dev, u32 mask)
+{
+	if (mask & 0xfffc0000)
+		printk(KERN_ERR "%s: Only 18 GPIO's are allowed\n", __func__);
+
+	if (mask & 0x0003ffff)
+		return (dm_readl(DM1105_GPIOVAL) & mask & 0x0003ffff);
+
+	return 0;
+}
+
+void dm1105_gpio_enable(struct dm1105_dev *dev, u32 mask, int asoutput)
+{
+	if (mask & 0xfffc0000)
+		printk(KERN_ERR "%s: Only 18 GPIO's are allowed\n", __func__);
+
+	if ((mask & 0x0003ffff) && asoutput)
+		dm_clearl(DM1105_GPIOCTR, mask & 0x0003ffff);
+	else if ((mask & 0x0003ffff) && !asoutput)
+		dm_setl(DM1105_GPIOCTR, mask & 0x0003ffff);
+
+}
+
+static void dm1105_setline(struct dm1105_dev *dev, u32 line, int state)
+{
+	if (state)
+		dm1105_gpio_enable(dev, line, 0);
+	else {
+		dm1105_gpio_enable(dev, line, 1);
+		dm1105_gpio_clear(dev, line);
+	}
+}
+
+static void dm1105_setsda(void *data, int state)
+{
+	struct dm1105_dev *dev = data;
+
+	dm1105_setline(dev, dm1105_boards[dev->boardnr].gpio_sda, state);
+}
+
+static void dm1105_setscl(void *data, int state)
+{
+	struct dm1105_dev *dev = data;
+
+	dm1105_setline(dev, dm1105_boards[dev->boardnr].gpio_scl, state);
+}
+
+static int dm1105_getsda(void *data)
+{
+	struct dm1105_dev *dev = data;
+
+	return dm1105_gpio_get(dev, dm1105_boards[dev->boardnr].gpio_sda) ? 1 : 0;
+}
+
+static int dm1105_getscl(void *data)
+{
+	struct dm1105_dev *dev = data;
+
+	return dm1105_gpio_get(dev, dm1105_boards[dev->boardnr].gpio_scl) ? 1 : 0;
+}
+
 static int dm1105_i2c_xfer(struct i2c_adapter *i2c_adap,
 			    struct i2c_msg *msgs, int num)
 {
@@ -742,6 +841,33 @@
 	int ret;
 
 	switch (dev->boardnr) {
+	case DM1105_BOARD_UNBRANDED_I2C_ON_GPIO:
+		dev->fe = dvb_attach(
+			stv0299_attach, &sharp_z0194a_config,
+			&dev->i2c_bb_adap);
+		if (dev->fe) {
+			dev->fe->ops.set_voltage = dm1105_set_voltage;
+			dvb_attach(dvb_pll_attach, dev->fe, 0x60,
+					&dev->i2c_bb_adap, DVB_PLL_OPERA1);
+			break;
+		}
+
+		dev->fe = dvb_attach(
+			stv0288_attach, &earda_config,
+			&dev->i2c_bb_adap);
+		if (dev->fe) {
+			dev->fe->ops.set_voltage = dm1105_set_voltage;
+			dvb_attach(stb6000_attach, dev->fe, 0x61,
+					&dev->i2c_bb_adap);
+			break;
+		}
+
+		dev->fe = dvb_attach(
+			si21xx_attach, &serit_config,
+			&dev->i2c_bb_adap);
+		if (dev->fe)
+			dev->fe->ops.set_voltage = dm1105_set_voltage;
+		break;
 	case DM1105_BOARD_DVBWORLD_2004:
 		dev->fe = dvb_attach(
 			cx24116_attach, &serit_sp2633_config,
@@ -905,11 +1031,33 @@
 	if (ret < 0)
 		goto err_dm1105_hw_exit;
 
+	i2c_set_adapdata(&dev->i2c_bb_adap, dev);
+	strcpy(dev->i2c_bb_adap.name, DM1105_I2C_GPIO_NAME);
+	dev->i2c_bb_adap.owner = THIS_MODULE;
+	dev->i2c_bb_adap.class = I2C_CLASS_TV_DIGITAL;
+	dev->i2c_bb_adap.dev.parent = &pdev->dev;
+	dev->i2c_bb_adap.algo_data = &dev->i2c_bit;
+	dev->i2c_bit.data = dev;
+	dev->i2c_bit.setsda = dm1105_setsda;
+	dev->i2c_bit.setscl = dm1105_setscl;
+	dev->i2c_bit.getsda = dm1105_getsda;
+	dev->i2c_bit.getscl = dm1105_getscl;
+	dev->i2c_bit.udelay = 10;
+	dev->i2c_bit.timeout = 10;
+
+	/* Raise SCL and SDA */
+	dm1105_setsda(dev, 1);
+	dm1105_setscl(dev, 1);
+
+	ret = i2c_bit_add_bus(&dev->i2c_bb_adap);
+	if (ret < 0)
+		goto err_i2c_del_adapter;
+
 	/* dvb */
 	ret = dvb_register_adapter(&dev->dvb_adapter, DRIVER_NAME,
 					THIS_MODULE, &pdev->dev, adapter_nr);
 	if (ret < 0)
-		goto err_i2c_del_adapter;
+		goto err_i2c_del_adapters;
 
 	dvb_adapter = &dev->dvb_adapter;
 
@@ -991,6 +1139,8 @@
 	dvb_dmx_release(dvbdemux);
 err_dvb_unregister_adapter:
 	dvb_unregister_adapter(dvb_adapter);
+err_i2c_del_adapters:
+	i2c_del_adapter(&dev->i2c_bb_adap);
 err_i2c_del_adapter:
 	i2c_del_adapter(&dev->i2c_adap);
 err_dm1105_hw_exit:
#10 lore raw

Igor M. Liplianin skrev:

Quoted 67 lines · Igor M. Liplianin
Quoted 57 lines

Igor M. Liplianin skrev:

Quoted 46 lines · On 23 февраля 2010 15:12:05 Nameer Kazzaz wrote:
Quoted 40 lines

Sounds cool, let me know if I can help you with anything.

Thanks
Nameer

Quoted 32 lines · Hendrik Skarpeid

No luck here either, still working on it.
My plan is to solder som wires on strategic points on the board and debug i2c and other activity with an oscilloscope. Will probably start next week.

Quoted 25 lines · Nameer Kazzaz

Hey Igor,
I'm getting the same error:
dm1105 0000:04:0b.0: could not attach frontend

Did you get your one to work.

Thanks
Nameer

Quoted 14 lines · Igor M. Liplianin
Quoted 9 lines · On 18 февраля 2010, [email protected] wrote:

I also got the unbranded dm1105 card. I tried the four possible i2c addresses, just i case. Noen worked of course. Then I traced the i2c pins on the tuner to pins 100 and 101 on the DM1105. These are GPIO pins, so bit-banging i2c on these pins seems to be the solution.

scl = p101 = gpio14
sda = p100 = gpio13

Here is the patch to test. Use option card=4.

    modprobe dm1105 card=4

I didn't test patch in real hardware.
But I can connect GPIO14 and GPIO13 to SCL and SDA in any dm1105 card and test whether it works. Then I will ask you to test also.

Quoted 8 lines

------------------------------------------------------------------------

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.733 / Virus Database: 271.1.1/2708 - Release Date: 02/24/10 20:34:00

Quoted 8 lines

Think I solved it.
The dm1105_getsda and dm1105_getscl functions need to mask out the other GPIO bits.
I hacked the code to return 1 if corresponding GPIO set, and 0 if not set. That did the trick. Now the frontend registers and /dev/dvb is populated. :)
Haven't done any tuning yet.

Quoted 3 lines

Do you cut connections between dm1105 i2c pins and the gpio pins you make earlier?

Success!

[ 4354.673688] dm1105 0000:03:01.0: PCI INT A -> GSI 19 (level, low) -> IRQ 19
[ 4354.673806] DVB: registering new adapter (dm1105)
[ 4354.921866] dm1105 0000:03:01.0: MAC 00:00:00:00:00:00
[ 4355.533170] DVB: registering adapter 0 frontend 0 (SL SI21XX DVB-S)...
[ 4355.533327] input: DVB on-card IR receiver as /devices/pci0000:00/0000:00:1e.0/0000:03:01.0/input/input7
[ 4355.533377] Creating IR device irrcv0
#11 lore raw
Quoted 61 lines · On 3 марта 2010 10:38:09 Hendrik Skarpeid wrote:

Igor M. Liplianin skrev:

Quoted 60 lines · Igor M. Liplianin
Quoted 58 lines

Igor M. Liplianin skrev:

Quoted 41 lines · On 23 февраля 2010 15:12:05 Nameer Kazzaz wrote:
Quoted 34 lines

Sounds cool, let me know if I can help you with anything.

Thanks
Nameer

Quoted 28 lines · Hendrik Skarpeid

No luck here either, still working on it.
My plan is to solder som wires on strategic points on the board and debug i2c and other activity with an oscilloscope. Will probably start next week.

Quoted 22 lines · Nameer Kazzaz

Hey Igor,
I'm getting the same error:
dm1105 0000:04:0b.0: could not attach frontend

Did you get your one to work.

Thanks
Nameer

Quoted 12 lines · Igor M. Liplianin
Quoted 8 lines · On 18 февраля 2010, [email protected] wrote:

I also got the unbranded dm1105 card. I tried the four possible i2c addresses, just i case. Noen worked of course. Then I traced the i2c pins on the tuner to pins 100 and 101 on the DM1105. These are GPIO pins, so bit-banging i2c on these pins seems to be the solution.

scl = p101 = gpio14
sda = p100 = gpio13

Here is the patch to test. Use option card=4.

    modprobe dm1105 card=4

I didn't test patch in real hardware.
But I can connect GPIO14 and GPIO13 to SCL and SDA in any dm1105 card and test whether it works. Then I will ask you to test also.

Quoted 8 lines

-----------------------------------------------------------------------
-

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.733 / Virus Database: 271.1.1/2708 - Release Date:
02/24/10 20:34:00

Think I solved it.
The dm1105_getsda and dm1105_getscl functions need to mask out the other GPIO bits.
I hacked the code to return 1 if corresponding GPIO set, and 0 if not set. That did the trick. Now the frontend registers and /dev/dvb is populated. :)
Haven't done any tuning yet.

Quoted 4 lines
Quoted 2 lines

Do you cut connections between dm1105 i2c pins and the gpio pins you make earlier?

Success!

Glad to hear.
Now to find GPIO's for LNB power control and ... watch TV :)

Quoted 9 lines
[ 4354.673688] dm1105 0000:03:01.0: PCI INT A -> GSI 19 (level, low) ->
IRQ 19
[ 4354.673806] DVB: registering new adapter (dm1105)
[ 4354.921866] dm1105 0000:03:01.0: MAC 00:00:00:00:00:00
[ 4355.533170] DVB: registering adapter 0 frontend 0 (SL SI21XX DVB-S)...
[ 4355.533327] input: DVB on-card IR receiver as
/devices/pci0000:00/0000:00:1e.0/0000:03:01.0/input/input7
[ 4355.533377] Creating IR device irrcv0
Signature · 2 lines
Igor M. Liplianin
Microsoft Windows Free Zone - Linux used for all Computing Tasks
#12 lore raw
Quoted 4 lines · Igor M. Liplianin

Now to find GPIO's for LNB power control and ... watch TV :)

Yep. No succesful tuning at the moment. There might also be an issue with the reset signal and writing to GPIOCTR, as the module at the moment loads succesfully only once. As far as I can make out, the LNB power control is probably GPIO 16 and 17, not sure which is which, and how they work.
GPIO15 is wired to tuner #reset

#13 lore raw
Quoted 9 lines · On 3 марта 2010 18:42:42 Hendrik Skarpeid wrote:
Quoted 1 line · Igor M. Liplianin

Now to find GPIO's for LNB power control and ... watch TV :)

Yep. No succesful tuning at the moment. There might also be an issue with the reset signal and writing to GPIOCTR, as the module at the moment loads succesfully only once.
As far as I can make out, the LNB power control is probably GPIO 16 and 17, not sure which is which, and how they work.
GPIO15 is wired to tuner #reset

New patch to test

Signature · 2 lines
Igor M. Liplianin
Microsoft Windows Free Zone - Linux used for all Computing Tasks
linux/drivers/media/dvb/dm1105/dm1105.c +197 -9
@@ -20,6 +20,7 @@
  */
 
 #include <linux/i2c.h>
+#include <linux/i2c-algo-bit.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -47,11 +48,12 @@
 
 #define UNSET (-1U)
 
-#define DM1105_BOARD_NOAUTO		UNSET
-#define DM1105_BOARD_UNKNOWN		0
-#define DM1105_BOARD_DVBWORLD_2002	1
-#define DM1105_BOARD_DVBWORLD_2004	2
-#define DM1105_BOARD_AXESS_DM05		3
+#define DM1105_BOARD_NOAUTO			UNSET
+#define DM1105_BOARD_UNKNOWN			0
+#define DM1105_BOARD_DVBWORLD_2002		1
+#define DM1105_BOARD_DVBWORLD_2004		2
+#define DM1105_BOARD_AXESS_DM05			3
+#define DM1105_BOARD_UNBRANDED_I2C_ON_GPIO	4
 
 /* ----------------------------------------------- */
 /*
@@ -155,23 +157,30 @@
 #define DM1105_MAX				0x04
 
 #define DRIVER_NAME				"dm1105"
+#define DM1105_I2C_GPIO_NAME			"dm1105-gpio"
 
 #define DM1105_DMA_PACKETS			47
 #define DM1105_DMA_PACKET_LENGTH		(128*4)
 #define DM1105_DMA_BYTES			(128 * 4 * DM1105_DMA_PACKETS)
 
 /* GPIO's for LNB power control */
-#define DM1105_LNB_MASK				0x00000000
+#define DM1105_LNB_MASK				0x00006000
 #define DM1105_LNB_OFF				0x00020000
 #define DM1105_LNB_13V				0x00010100
 #define DM1105_LNB_18V				0x00000100
 
 /* GPIO's for LNB power control for Axess DM05 */
-#define DM05_LNB_MASK				0x00000000
+#define DM05_LNB_MASK				0x00006000
 #define DM05_LNB_OFF				0x00020000/* actually 13v */
 #define DM05_LNB_13V				0x00020000
 #define DM05_LNB_18V				0x00030000
 
+#define GPIO13					(1 << 13)
+#define GPIO14					(1 << 14)
+#define GPIO15					(1 << 15)
+#define GPIO16					(1 << 16)
+#define GPIO17					(1 << 17)
+
 static unsigned int card[]  = {[0 ... 3] = UNSET };
 module_param_array(card,  int, NULL, 0444);
 MODULE_PARM_DESC(card, "card type");
@@ -185,7 +194,8 @@
 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
 
 struct dm1105_board {
-	char                    *name;
+	char		*name;
+	u32		gpio_scl, gpio_sda;
 };
 
 struct dm1105_subid {
@@ -207,6 +217,11 @@
 	[DM1105_BOARD_AXESS_DM05] = {
 		.name		= "Axess/EasyTv DM05",
 	},
+	[DM1105_BOARD_UNBRANDED_I2C_ON_GPIO] = {
+		.name		= "Unbranded DM1105 with i2c on GPIOs",
+		.gpio_scl	= GPIO14,
+		.gpio_sda	= GPIO13,
+	},
 };
 
 static const struct dm1105_subid dm1105_subids[] = {
@@ -292,6 +307,8 @@
 
 	/* i2c */
 	struct i2c_adapter i2c_adap;
+	struct i2c_adapter i2c_bb_adap;
+	struct i2c_algo_bit_data i2c_bit;
 
 	/* irq */
 	struct work_struct work;
@@ -327,6 +344,101 @@
 #define dm_setl(reg, bit)	dm_andorl((reg), (bit), (bit))
 #define dm_clearl(reg, bit)	dm_andorl((reg), (bit), 0)
 
+/* The chip has 18 GPIOs. In HOST mode GPIO's used as 15 bit address lines,
+ so we can use only 3 GPIO's from GPIO15 to GPIO17.
+ Here I don't check whether HOST is enebled as it is not implemented yet.
+ */
+static void dm1105_gpio_set(struct dm1105_dev *dev, u32 mask)
+{
+	if (mask & 0xfffc0000)
+		printk(KERN_ERR "%s: Only 18 GPIO's are allowed\n", __func__);
+
+	if (mask & 0x0003ffff)
+		dm_setl(DM1105_GPIOVAL, mask & 0x0003ffff);
+
+}
+
+static void dm1105_gpio_clear(struct dm1105_dev *dev, u32 mask)
+{
+	if (mask & 0xfffc0000)
+		printk(KERN_ERR "%s: Only 18 GPIO's are allowed\n", __func__);
+
+	if (mask & 0x0003ffff)
+		dm_clearl(DM1105_GPIOVAL, mask & 0x0003ffff);
+
+}
+
+static void dm1105_gpio_andor(struct dm1105_dev *dev, u32 mask, u32 val)
+{
+	if (mask & 0xfffc0000)
+		printk(KERN_ERR "%s: Only 18 GPIO's are allowed\n", __func__);
+
+	if (mask & 0x0003ffff)
+		dm_andorl(DM1105_GPIOVAL, mask & 0x0003ffff, val);
+
+}
+
+static u32 dm1105_gpio_get(struct dm1105_dev *dev, u32 mask)
+{
+	if (mask & 0xfffc0000)
+		printk(KERN_ERR "%s: Only 18 GPIO's are allowed\n", __func__);
+
+	if (mask & 0x0003ffff)
+		return (dm_readl(DM1105_GPIOVAL) & mask & 0x0003ffff);
+
+	return 0;
+}
+
+static void dm1105_gpio_enable(struct dm1105_dev *dev, u32 mask, int asoutput)
+{
+	if (mask & 0xfffc0000)
+		printk(KERN_ERR "%s: Only 18 GPIO's are allowed\n", __func__);
+
+	if ((mask & 0x0003ffff) && asoutput)
+		dm_clearl(DM1105_GPIOCTR, mask & 0x0003ffff);
+	else if ((mask & 0x0003ffff) && !asoutput)
+		dm_setl(DM1105_GPIOCTR, mask & 0x0003ffff);
+
+}
+
+static void dm1105_setline(struct dm1105_dev *dev, u32 line, int state)
+{
+	if (state)
+		dm1105_gpio_enable(dev, line, 0);
+	else {
+		dm1105_gpio_enable(dev, line, 1);
+		dm1105_gpio_clear(dev, line);
+	}
+}
+
+static void dm1105_setsda(void *data, int state)
+{
+	struct dm1105_dev *dev = data;
+
+	dm1105_setline(dev, dm1105_boards[dev->boardnr].gpio_sda, state);
+}
+
+static void dm1105_setscl(void *data, int state)
+{
+	struct dm1105_dev *dev = data;
+
+	dm1105_setline(dev, dm1105_boards[dev->boardnr].gpio_scl, state);
+}
+
+static int dm1105_getsda(void *data)
+{
+	struct dm1105_dev *dev = data;
+
+	return dm1105_gpio_get(dev, dm1105_boards[dev->boardnr].gpio_sda) ? 1 : 0;
+}
+
+static int dm1105_getscl(void *data)
+{
+	struct dm1105_dev *dev = data;
+
+	return dm1105_gpio_get(dev, dm1105_boards[dev->boardnr].gpio_scl) ? 1 : 0;
+}
+
 static int dm1105_i2c_xfer(struct i2c_adapter *i2c_adap,
 			    struct i2c_msg *msgs, int num)
 {
@@ -467,6 +579,26 @@
 	return 0;
 }
 
+static int dm1105_set_voltage1(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
+{
+	struct dm1105_dev *dev = frontend_to_dm1105_dev(fe);
+
+	dm1105_gpio_enable(dev, GPIO16 | GPIO17, 1);
+	switch (voltage) {
+	case SEC_VOLTAGE_18:
+		dm1105_gpio_andor(dev, GPIO16 | GPIO17, 0);
+		break;
+	case SEC_VOLTAGE_13:
+		dm1105_gpio_andor(dev, GPIO16 | GPIO17, GPIO16);
+		break;
+	default:
+		dm1105_gpio_set(dev, GPIO16 | GPIO17);
+		break;
+	}
+
+	return 0;
+}
+
 static void dm1105_set_dma_addr(struct dm1105_dev *dev)
 {
 	dm_writel(DM1105_STADR, cpu_to_le32(dev->dma_addr));
@@ -742,6 +874,38 @@
 	int ret;
 
 	switch (dev->boardnr) {
+	case DM1105_BOARD_UNBRANDED_I2C_ON_GPIO:
+		dm1105_gpio_enable(dev, GPIO15, 1);
+		dm1105_gpio_clear(dev, GPIO15);
+		msleep(100);
+		dm1105_gpio_set(dev, GPIO15);
+		msleep(200);
+		dev->fe = dvb_attach(
+			stv0299_attach, &sharp_z0194a_config,
+			&dev->i2c_bb_adap);
+		if (dev->fe) {
+			dev->fe->ops.set_voltage = dm1105_set_voltage1;
+			dvb_attach(dvb_pll_attach, dev->fe, 0x60,
+					&dev->i2c_bb_adap, DVB_PLL_OPERA1);
+			break;
+		}
+
+		dev->fe = dvb_attach(
+			stv0288_attach, &earda_config,
+			&dev->i2c_bb_adap);
+		if (dev->fe) {
+			dev->fe->ops.set_voltage = dm1105_set_voltage1;
+			dvb_attach(stb6000_attach, dev->fe, 0x61,
+					&dev->i2c_bb_adap);
+			break;
+		}
+
+		dev->fe = dvb_attach(
+			si21xx_attach, &serit_config,
+			&dev->i2c_bb_adap);
+		if (dev->fe)
+			dev->fe->ops.set_voltage = dm1105_set_voltage1;
+		break;
 	case DM1105_BOARD_DVBWORLD_2004:
 		dev->fe = dvb_attach(
 			cx24116_attach, &serit_sp2633_config,
@@ -905,11 +1069,33 @@
 	if (ret < 0)
 		goto err_dm1105_hw_exit;
 
+	i2c_set_adapdata(&dev->i2c_bb_adap, dev);
+	strcpy(dev->i2c_bb_adap.name, DM1105_I2C_GPIO_NAME);
+	dev->i2c_bb_adap.owner = THIS_MODULE;
+	dev->i2c_bb_adap.class = I2C_CLASS_TV_DIGITAL;
+	dev->i2c_bb_adap.dev.parent = &pdev->dev;
+	dev->i2c_bb_adap.algo_data = &dev->i2c_bit;
+	dev->i2c_bit.data = dev;
+	dev->i2c_bit.setsda = dm1105_setsda;
+	dev->i2c_bit.setscl = dm1105_setscl;
+	dev->i2c_bit.getsda = dm1105_getsda;
+	dev->i2c_bit.getscl = dm1105_getscl;
+	dev->i2c_bit.udelay = 10;
+	dev->i2c_bit.timeout = 10;
+
+	/* Raise SCL and SDA */
+	dm1105_setsda(dev, 1);
+	dm1105_setscl(dev, 1);
+
+	ret = i2c_bit_add_bus(&dev->i2c_bb_adap);
+	if (ret < 0)
+		goto err_i2c_del_adapter;
+
 	/* dvb */
 	ret = dvb_register_adapter(&dev->dvb_adapter, DRIVER_NAME,
 					THIS_MODULE, &pdev->dev, adapter_nr);
 	if (ret < 0)
-		goto err_i2c_del_adapter;
+		goto err_i2c_del_adapters;
 
 	dvb_adapter = &dev->dvb_adapter;
 
@@ -991,6 +1177,8 @@
 	dvb_dmx_release(dvbdemux);
 err_dvb_unregister_adapter:
 	dvb_unregister_adapter(dvb_adapter);
+err_i2c_del_adapters:
+	i2c_del_adapter(&dev->i2c_bb_adap);
 err_i2c_del_adapter:
 	i2c_del_adapter(&dev->i2c_adap);
 err_dm1105_hw_exit:
#14 lore raw

Igor M. Liplianin skrev:

Quoted 13 lines · On 3 марта 2010 18:42:42 Hendrik Skarpeid wrote:
Quoted 12 lines
Quoted 2 lines · Igor M. Liplianin

Now to find GPIO's for LNB power control and ... watch TV :)

Yep. No succesful tuning at the moment. There might also be an issue with the reset signal and writing to GPIOCTR, as the module at the moment loads succesfully only once.
As far as I can make out, the LNB power control is probably GPIO 16 and 17, not sure which is which, and how they work.
GPIO15 is wired to tuner #reset

Quoted 8 lines

New patch to test

------------------------------------------------------------------------

No virus found in this incoming message.
Checked by AVG - www.avg.com Version: 9.0.733 / Virus Database: 271.1.1/2721 - Release Date: 03/03/10 20:34:00

A little tweaking produced the required voltages for the LNB:

switch (voltage) {
case SEC_VOLTAGE_18:
dm1105_gpio_set(dev, GPIO16 | GPIO17);
break;
case SEC_VOLTAGE_13:
dm1105_gpio_andor(dev, GPIO16 | GPIO17, GPIO17);
break;
default:
dm1105_gpio_clear(dev, GPIO16 | GPIO17);
break;
}

But unfortunately tuning is still failing. Could it be an issue with the 21xx driver? I will read up on the Si2109.

#15 lore raw
In reply to Igor M. Liplianin

Igor M. Liplianin skrev:

Quoted 13 lines · On 3 марта 2010 18:42:42 Hendrik Skarpeid wrote:
Quoted 12 lines
Quoted 2 lines · Igor M. Liplianin

Now to find GPIO's for LNB power control and ... watch TV :)

Yep. No succesful tuning at the moment. There might also be an issue with the reset signal and writing to GPIOCTR, as the module at the moment loads succesfully only once.
As far as I can make out, the LNB power control is probably GPIO 16 and 17, not sure which is which, and how they work.
GPIO15 is wired to tuner #reset

Quoted 8 lines

New patch to test

------------------------------------------------------------------------

No virus found in this incoming message.
Checked by AVG - www.avg.com Version: 9.0.733 / Virus Database: 271.1.1/2721 - Release Date: 03/03/10 20:34:00

modprobe si21xx debug=1 produces this output when scanning.

[ 2187.998349] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x02
[ 2187.998353] si21xx: si21xx_set_frontend : FE_SET_FRONTEND
[ 2187.999881] si21xx: si21xx_setacquire
[ 2187.999884] si21xx: si21xx_set_symbolrate : srate = 27500000
[ 2188.022645] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x01
[ 2188.054350] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x02
[ 2188.054355] si21xx: si21xx_set_frontend : FE_SET_FRONTEND
[ 2188.055875] si21xx: si21xx_setacquire
[ 2188.055879] si21xx: si21xx_set_symbolrate : srate = 27500000
[ 2188.110359] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x02
[ 2188.110366] si21xx: si21xx_set_frontend : FE_SET_FRONTEND
[ 2188.111885] si21xx: si21xx_setacquire
[ 2188.111889] si21xx: si21xx_set_symbolrate : srate = 27500000
[ 2188.166350] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x02
[ 2188.166354] si21xx: si21xx_set_frontend : FE_SET_FRONTEND

Since the tuner at hand uses a Si2109 chip, VSTATUS 0x01 and 0x02 would indicate that blind scanning is used. Blind scanning is a 2109/2110 specific function, and may not very usable since we always use initial tuning files anyway. 2109/10 also supports the legacy scanning method which is supported by Si2107708.

Is the use of blind scanning intentional?

#16 lore raw

Hendrik Skarpeid skrev:

Quoted 41 lines

Igor M. Liplianin skrev:

Quoted 13 lines · On 3 марта 2010 18:42:42 Hendrik Skarpeid wrote:
Quoted 12 lines
Quoted 2 lines · Igor M. Liplianin

Now to find GPIO's for LNB power control and ... watch TV :)

Yep. No succesful tuning at the moment. There might also be an issue with the reset signal and writing to GPIOCTR, as the module at the moment loads succesfully only once.
As far as I can make out, the LNB power control is probably GPIO 16 and 17, not sure which is which, and how they work.
GPIO15 is wired to tuner #reset

Quoted 8 lines

New patch to test

------------------------------------------------------------------------

No virus found in this incoming message.
Checked by AVG - www.avg.com Version: 9.0.733 / Virus Database: 271.1.1/2721 - Release Date: 03/03/10 20:34:00

modprobe si21xx debug=1 produces this output when scanning.

[ 2187.998349] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x02
[ 2187.998353] si21xx: si21xx_set_frontend : FE_SET_FRONTEND
[ 2187.999881] si21xx: si21xx_setacquire
[ 2187.999884] si21xx: si21xx_set_symbolrate : srate = 27500000
[ 2188.022645] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x01
[ 2188.054350] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x02
[ 2188.054355] si21xx: si21xx_set_frontend : FE_SET_FRONTEND
[ 2188.055875] si21xx: si21xx_setacquire
[ 2188.055879] si21xx: si21xx_set_symbolrate : srate = 27500000
[ 2188.110359] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x02
[ 2188.110366] si21xx: si21xx_set_frontend : FE_SET_FRONTEND
[ 2188.111885] si21xx: si21xx_setacquire
[ 2188.111889] si21xx: si21xx_set_symbolrate : srate = 27500000
[ 2188.166350] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x02
[ 2188.166354] si21xx: si21xx_set_frontend : FE_SET_FRONTEND
Quoted 4 lines

Since the tuner at hand uses a Si2109 chip, VSTATUS 0x01 and 0x02 would indicate that blind scanning is used. Blind scanning is a 2109/2110 specific function, and may not very usable since we always use initial tuning files anyway. 2109/10 also supports the legacy scanning method which is supported by Si2107708.

Is the use of blind scanning intentional?

Sorry, my bad. Mixed up the registers.
Got a VSTATUS: 0x0b once. Mostly I'm getting 0x01 and 0x02. Sometimes 0x00 and 0x03

#17 lore raw
In reply to Hendrik Skarpeid
Quoted 40 lines · On 5 марта 2010 00:16:07 Hendrik Skarpeid wrote:

Igor M. Liplianin skrev:

Quoted 13 lines · On 3 марта 2010 18:42:42 Hendrik Skarpeid wrote:
Quoted 9 lines
Quoted 1 line · Igor M. Liplianin

Now to find GPIO's for LNB power control and ... watch TV :)

Yep. No succesful tuning at the moment. There might also be an issue with the reset signal and writing to GPIOCTR, as the module at the moment loads succesfully only once.
As far as I can make out, the LNB power control is probably GPIO 16 and 17, not sure which is which, and how they work.
GPIO15 is wired to tuner #reset

New patch to test

Quoted 7 lines

------------------------------------------------------------------------

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.733 / Virus Database: 271.1.1/2721 - Release Date: 03/03/10 20:34:00

modprobe si21xx debug=1 produces this output when scanning.

[ 2187.998349] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x02
[ 2187.998353] si21xx: si21xx_set_frontend : FE_SET_FRONTEND
[ 2187.999881] si21xx: si21xx_setacquire
[ 2187.999884] si21xx: si21xx_set_symbolrate : srate = 27500000
[ 2188.022645] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x01
[ 2188.054350] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x02
[ 2188.054355] si21xx: si21xx_set_frontend : FE_SET_FRONTEND
[ 2188.055875] si21xx: si21xx_setacquire
[ 2188.055879] si21xx: si21xx_set_symbolrate : srate = 27500000
[ 2188.110359] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x02
[ 2188.110366] si21xx: si21xx_set_frontend : FE_SET_FRONTEND
[ 2188.111885] si21xx: si21xx_setacquire
[ 2188.111889] si21xx: si21xx_set_symbolrate : srate = 27500000
[ 2188.166350] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x02
[ 2188.166354] si21xx: si21xx_set_frontend : FE_SET_FRONTEND
Quoted 7 lines

Since the tuner at hand uses a Si2109 chip, VSTATUS 0x01 and 0x02 would indicate that blind scanning is used. Blind scanning is a 2109/2110 specific function, and may not very usable since we always use initial tuning files anyway. 2109/10 also supports the legacy scanning method which is supported by Si2107708.

Is the use of blind scanning intentional?

Yes, of course, it's intentional. Why not?
User has freedom to make little errors in channels.conf file. Also the chip didn't support DVB-S2. And last, has who si2107/08 ? My chip is si2109.

Signature · 2 lines
Igor M. Liplianin
Microsoft Windows Free Zone - Linux used for all Computing Tasks
#18 lore raw

Igor M. Liplianin skrev:

Quoted 51 lines · On 5 марта 2010 00:16:07 Hendrik Skarpeid wrote:
Quoted 50 lines

Igor M. Liplianin skrev:

Quoted 15 lines · On 3 марта 2010 18:42:42 Hendrik Skarpeid wrote:
Quoted 12 lines
Quoted 2 lines · Igor M. Liplianin

Now to find GPIO's for LNB power control and ... watch TV :)

Yep. No succesful tuning at the moment. There might also be an issue with the reset signal and writing to GPIOCTR, as the module at the moment loads succesfully only once.
As far as I can make out, the LNB power control is probably GPIO 16 and 17, not sure which is which, and how they work.
GPIO15 is wired to tuner #reset

New patch to test

Quoted 8 lines

------------------------------------------------------------------------

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.733 / Virus Database: 271.1.1/2721 - Release Date: 03/03/10 20:34:00

modprobe si21xx debug=1 produces this output when scanning.

[ 2187.998349] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x02
[ 2187.998353] si21xx: si21xx_set_frontend : FE_SET_FRONTEND
[ 2187.999881] si21xx: si21xx_setacquire
[ 2187.999884] si21xx: si21xx_set_symbolrate : srate = 27500000
[ 2188.022645] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x01
[ 2188.054350] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x02
[ 2188.054355] si21xx: si21xx_set_frontend : FE_SET_FRONTEND
[ 2188.055875] si21xx: si21xx_setacquire
[ 2188.055879] si21xx: si21xx_set_symbolrate : srate = 27500000
[ 2188.110359] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x02
[ 2188.110366] si21xx: si21xx_set_frontend : FE_SET_FRONTEND
[ 2188.111885] si21xx: si21xx_setacquire
[ 2188.111889] si21xx: si21xx_set_symbolrate : srate = 27500000
[ 2188.166350] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x02
[ 2188.166354] si21xx: si21xx_set_frontend : FE_SET_FRONTEND

Since the tuner at hand uses a Si2109 chip, VSTATUS 0x01 and 0x02 would indicate that blind scanning is used. Blind scanning is a 2109/2110 specific function, and may not very usable since we always use initial tuning files anyway. 2109/10 also supports the legacy scanning method which is supported by Si2107708.

Quoted 7 lines
Quoted 2 lines

Is the use of blind scanning intentional?

Yes, of course, it's intentional. Why not?
User has freedom to make little errors in channels.conf file. Also the chip didn't support DVB-S2. And last, has who si2107/08 ? My chip is si2109.

I agree, it's best to use the hardware features. I was worried that I may be getting bad i2c data. If I understand you correctly, you have a working Si2109 frontend driver?
Here's what I'm getting:
Added a few printouts to si21xx.c

       u8 signal = si21_readreg(state, ANALOG_AGC_POWER_LEVEL_REG);
       dprintk("%s : FE_READ_STATUS : AGC_POWER: 0x%02x\n", __func__, 

signal);

       si21_readregs(state, LOCK_STATUS_REG_1, regs_read, 0x02);

       reg_read = 0;

       for (i = 0; i < 7; ++i)
               reg_read |= ((regs_read[0] >> i) & 0x01) << (6 - i);

       lock = ((reg_read & 0x7f) | (regs_read[1] & 0x80));

       dprintk("%s : FE_READ_STATUS : VSTATUS: 0x%02x\n", __func__, lock);
       dprintk("%s : FE_READ_REGS : REGS[0]: 0x%02x\n", __func__, 
regs_read[0]);
       dprintk("%s : FE_READ_REGS : REGS[1]: 0x%02x\n", __func__, 

regs_read[1]);

hendrik@iptv:~$ scan -a 1 Sirius-5.0E
[72933.818871] si21xx: si21xx_set_symbolrate : srate = 27500000
[72933.900276] si21xx: si21_read_status : FE_READ_STATUS : AGC_POWER: 0x20
[72933.908807] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x02
[72933.908812] si21xx: si21_read_status : FE_READ_REGS : REGS[0]: 0x20
[72933.908815] si21xx: si21_read_status : FE_READ_REGS : REGS[1]: 0x00
[72933.908827] si21xx: si21xx_set_frontend : FE_SET_FRONTEND
[72933.914962] si21xx: si21xx_setacquire
[72933.914967] si21xx: si21xx_set_symbolrate : srate = 27500000
[72933.949370] si21xx: si21_read_status : FE_READ_STATUS : AGC_POWER: 0x21
[72933.957877] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x01
[72933.957882] si21xx: si21_read_status : FE_READ_REGS : REGS[0]: 0xc0
[72933.957885] si21xx: si21_read_status : FE_READ_REGS : REGS[1]: 0x60
[72933.996316] si21xx: si21_read_status : FE_READ_STATUS : AGC_POWER: 0x20
[72934.004959] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x02
[72934.004964] si21xx: si21_read_status : FE_READ_REGS : REGS[0]: 0x20
[72934.004968] si21xx: si21_read_status : FE_READ_REGS : REGS[1]: 0x00

So, we have signal and sometimes we are getting carrier also.
What worries me most is the FE_READ_REGS : REGS[1]: 0x60
According to the datasheet this register 0x10 Lock status 2, is RCVL 0 0 0 0 0 BSDA BSDO so 0x60 would seem meaningless.

Same results using szap.

hendrik@iptv:~$ szap -a 1 -r -n 170
reading channels from file '/home/hendrik/.szap/channels.conf'
zapping to 170 'NRK1;NRK':
sat 0, frequency = 12015 MHz V, symbolrate 27500000, vpid = 0x0200, apid = 0x0280 sid = 0x0240
using '/dev/dvb/adapter1/frontend0' and '/dev/dvb/adapter1/demux0'
status 01 | signal c600 | snr 0000 | ber 000000b1 | unc 00000000 |
status 01 | signal c600 | snr 0000 | ber 0000000f | unc 00000000 |
status 01 | signal c000 | snr 0000 | ber 0000980f | unc 00000000 |
status 03 | signal c600 | snr 0000 | ber 000098a3 | unc 00000000 |
status 03 | signal c000 | snr 0000 | ber 000098c7 | unc 00000000 |

Signal but no lock.
Any ideas?

#19 lore raw
Quoted 51 lines · On 6 марта 2010 21:18:28 Hendrik Skarpeid wrote:

Igor M. Liplianin skrev:

Quoted 50 lines · On 5 марта 2010 00:16:07 Hendrik Skarpeid wrote:
Quoted 48 lines

Igor M. Liplianin skrev:

Quoted 13 lines · On 3 марта 2010 18:42:42 Hendrik Skarpeid wrote:
Quoted 9 lines
Quoted 1 line · Igor M. Liplianin

Now to find GPIO's for LNB power control and ... watch TV :)

Yep. No succesful tuning at the moment. There might also be an issue with the reset signal and writing to GPIOCTR, as the module at the moment loads succesfully only once.
As far as I can make out, the LNB power control is probably GPIO 16 and 17, not sure which is which, and how they work. GPIO15 is wired to tuner #reset

New patch to test

Quoted 8 lines

-----------------------------------------------------------------------
-

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.733 / Virus Database: 271.1.1/2721 - Release Date:
03/03/10 20:34:00

modprobe si21xx debug=1 produces this output when scanning.

[ 2187.998349] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x02
[ 2187.998353] si21xx: si21xx_set_frontend : FE_SET_FRONTEND
[ 2187.999881] si21xx: si21xx_setacquire
[ 2187.999884] si21xx: si21xx_set_symbolrate : srate = 27500000
[ 2188.022645] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x01
[ 2188.054350] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x02
[ 2188.054355] si21xx: si21xx_set_frontend : FE_SET_FRONTEND
[ 2188.055875] si21xx: si21xx_setacquire
[ 2188.055879] si21xx: si21xx_set_symbolrate : srate = 27500000
[ 2188.110359] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x02
[ 2188.110366] si21xx: si21xx_set_frontend : FE_SET_FRONTEND
[ 2188.111885] si21xx: si21xx_setacquire
[ 2188.111889] si21xx: si21xx_set_symbolrate : srate = 27500000
[ 2188.166350] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x02
[ 2188.166354] si21xx: si21xx_set_frontend : FE_SET_FRONTEND

Since the tuner at hand uses a Si2109 chip, VSTATUS 0x01 and 0x02 would indicate that blind scanning is used. Blind scanning is a 2109/2110 specific function, and may not very usable since we always use initial tuning files anyway. 2109/10 also supports the legacy scanning method which is supported by Si2107708.

Is the use of blind scanning intentional?

Quoted 7 lines
Quoted 4 lines

Yes, of course, it's intentional. Why not?
User has freedom to make little errors in channels.conf file. Also the chip didn't support DVB-S2. And last, has who si2107/08 ? My chip is si2109.

I agree, it's best to use the hardware features. I was worried that I may be getting bad i2c data.

It is likely. In that case try different delays like that

	dev->i2c_bit.udelay = 16;
	dev->i2c_bit.timeout = 200;
Quoted 1 line

If I understand you correctly, you have a working Si2109 frontend driver?

The driver is working. It's for shure. I tested PCI and USB cards with this chip.

Quoted 59 lines

Here's what I'm getting:
Added a few printouts to si21xx.c

        u8 signal = si21_readreg(state, ANALOG_AGC_POWER_LEVEL_REG);
        dprintk("%s : FE_READ_STATUS : AGC_POWER: 0x%02x\n", __func__,

signal);

        si21_readregs(state, LOCK_STATUS_REG_1, regs_read, 0x02);

        reg_read = 0;

        for (i = 0; i < 7; ++i)
                reg_read |= ((regs_read[0] >> i) & 0x01) << (6 - i);

        lock = ((reg_read & 0x7f) | (regs_read[1] & 0x80));

        dprintk("%s : FE_READ_STATUS : VSTATUS: 0x%02x\n", __func__, lock);
        dprintk("%s : FE_READ_REGS : REGS[0]: 0x%02x\n", __func__,
regs_read[0]);
        dprintk("%s : FE_READ_REGS : REGS[1]: 0x%02x\n", __func__,

regs_read[1]);

hendrik@iptv:~$ scan -a 1 Sirius-5.0E
[72933.818871] si21xx: si21xx_set_symbolrate : srate = 27500000
[72933.900276] si21xx: si21_read_status : FE_READ_STATUS : AGC_POWER: 0x20
[72933.908807] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x02
[72933.908812] si21xx: si21_read_status : FE_READ_REGS : REGS[0]: 0x20
[72933.908815] si21xx: si21_read_status : FE_READ_REGS : REGS[1]: 0x00
[72933.908827] si21xx: si21xx_set_frontend : FE_SET_FRONTEND
[72933.914962] si21xx: si21xx_setacquire
[72933.914967] si21xx: si21xx_set_symbolrate : srate = 27500000
[72933.949370] si21xx: si21_read_status : FE_READ_STATUS : AGC_POWER: 0x21
[72933.957877] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x01
[72933.957882] si21xx: si21_read_status : FE_READ_REGS : REGS[0]: 0xc0
[72933.957885] si21xx: si21_read_status : FE_READ_REGS : REGS[1]: 0x60
[72933.996316] si21xx: si21_read_status : FE_READ_STATUS : AGC_POWER: 0x20
[72934.004959] si21xx: si21_read_status : FE_READ_STATUS : VSTATUS: 0x02
[72934.004964] si21xx: si21_read_status : FE_READ_REGS : REGS[0]: 0x20
[72934.004968] si21xx: si21_read_status : FE_READ_REGS : REGS[1]: 0x00

So, we have signal and sometimes we are getting carrier also. What worries me most is the FE_READ_REGS : REGS[1]: 0x60 According to the datasheet this register 0x10 Lock status 2, is RCVL 0 0 0 0 0 BSDA BSDO so 0x60 would seem meaningless.

Same results using szap.

hendrik@iptv:~$ szap -a 1 -r -n 170
reading channels from file '/home/hendrik/.szap/channels.conf'
zapping to 170 'NRK1;NRK':
sat 0, frequency = 12015 MHz V, symbolrate 27500000, vpid = 0x0200, apid
= 0x0280 sid = 0x0240
using '/dev/dvb/adapter1/frontend0' and '/dev/dvb/adapter1/demux0'
status 01 | signal c600 | snr 0000 | ber 000000b1 | unc 00000000 |
status 01 | signal c600 | snr 0000 | ber 0000000f | unc 00000000 |
status 01 | signal c000 | snr 0000 | ber 0000980f | unc 00000000 |
status 03 | signal c600 | snr 0000 | ber 000098a3 | unc 00000000 |
status 03 | signal c000 | snr 0000 | ber 000098c7 | unc 00000000 |
Quoted 2 lines

Signal but no lock.
Any ideas?

For me it's like no signal or wrong LNB configuration, but ...

Signature · 2 lines
Igor M. Liplianin
Microsoft Windows Free Zone - Linux used for all Computing Tasks
#20 lore raw
In reply to Igor M. Liplianin

Igor M. Liplianin skrev:

Quoted 6 lines · On 3 марта 2010 18:42:42 Hendrik Skarpeid wrote:
Quoted 5 lines
Quoted 2 lines · Igor M. Liplianin

Now to find GPIO's for LNB power control and ... watch TV :)

Quoted 9 lines
Quoted 7 lines

Yep. No succesful tuning at the moment. There might also be an issue with the reset signal and writing to GPIOCTR, as the module at the moment loads succesfully only once.
As far as I can make out, the LNB power control is probably GPIO 16 and 17, not sure which is which, and how they work.
GPIO15 is wired to tuner #reset

New patch to test

I think the LNB voltage may be a little to high on my card, 14.5V and 20V. I would be a little more happy if they were 14 and 19, 13 and 18 would be perfect.
Anyways, as Igor pointet out, I don't have any signal from the LNB, checked with another tuner card. It's a quad LNB, and the other outputs are fine. Maybe it's' toasted from to high supply voltage! I little word of warning then. Anyways, here's my tweaked driver.

linux/drivers/media/dvb/dm1105/dm1105.c +197 -9
diff -r 4dc29dc9ec91 linux/drivers/media/dvb/dm1105/dm1105.c
@@ -20,6 +20,7 @@
  */
 
 #include <linux/i2c.h>
+#include <linux/i2c-algo-bit.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -47,11 +48,12 @@
 
 #define UNSET (-1U)
 
-#define DM1105_BOARD_NOAUTO		UNSET
-#define DM1105_BOARD_UNKNOWN		0
-#define DM1105_BOARD_DVBWORLD_2002	1
-#define DM1105_BOARD_DVBWORLD_2004	2
-#define DM1105_BOARD_AXESS_DM05		3
+#define DM1105_BOARD_NOAUTO			UNSET
+#define DM1105_BOARD_UNKNOWN			0
+#define DM1105_BOARD_DVBWORLD_2002		1
+#define DM1105_BOARD_DVBWORLD_2004		2
+#define DM1105_BOARD_AXESS_DM05			3
+#define DM1105_BOARD_UNBRANDED_I2C_ON_GPIO	4
 
 /* ----------------------------------------------- */
 /*
@@ -155,23 +157,30 @@
 #define DM1105_MAX				0x04
 
 #define DRIVER_NAME				"dm1105"
+#define DM1105_I2C_GPIO_NAME			"dm1105-gpio"
 
 #define DM1105_DMA_PACKETS			47
 #define DM1105_DMA_PACKET_LENGTH		(128*4)
 #define DM1105_DMA_BYTES			(128 * 4 * DM1105_DMA_PACKETS)
 
 /* GPIO's for LNB power control */
-#define DM1105_LNB_MASK				0x00000000
+#define DM1105_LNB_MASK				0x00006000
 #define DM1105_LNB_OFF				0x00020000
 #define DM1105_LNB_13V				0x00010100
 #define DM1105_LNB_18V				0x00000100
 
 /* GPIO's for LNB power control for Axess DM05 */
-#define DM05_LNB_MASK				0x00000000
+#define DM05_LNB_MASK				0x00006000
 #define DM05_LNB_OFF				0x00020000/* actually 13v */
 #define DM05_LNB_13V				0x00020000
 #define DM05_LNB_18V				0x00030000
 
+#define GPIO13					(1 << 13)
+#define GPIO14					(1 << 14)
+#define GPIO15					(1 << 15)
+#define GPIO16					(1 << 16)
+#define GPIO17					(1 << 17)
+
 static unsigned int card[]  = {[0 ... 3] = UNSET };
 module_param_array(card,  int, NULL, 0444);
 MODULE_PARM_DESC(card, "card type");
@@ -185,7 +194,8 @@
 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
 
 struct dm1105_board {
-	char                    *name;
+	char		*name;
+	u32		gpio_scl, gpio_sda;
 };
 
 struct dm1105_subid {
@@ -207,6 +217,11 @@
 	[DM1105_BOARD_AXESS_DM05] = {
 		.name		= "Axess/EasyTv DM05",
 	},
+	[DM1105_BOARD_UNBRANDED_I2C_ON_GPIO] = {
+		.name		= "Unbranded DM1105 with i2c on GPIOs",
+		.gpio_scl	= GPIO14,
+		.gpio_sda	= GPIO13,
+	},
 };
 
 static const struct dm1105_subid dm1105_subids[] = {
@@ -292,6 +307,8 @@
 
 	/* i2c */
 	struct i2c_adapter i2c_adap;
+	struct i2c_adapter i2c_bb_adap;
+	struct i2c_algo_bit_data i2c_bit;
 
 	/* irq */
 	struct work_struct work;
@@ -327,6 +344,101 @@
 #define dm_setl(reg, bit)	dm_andorl((reg), (bit), (bit))
 #define dm_clearl(reg, bit)	dm_andorl((reg), (bit), 0)
 
+/* The chip has 18 GPIOs. In HOST mode GPIO's used as 15 bit address lines,
+ so we can use only 3 GPIO's from GPIO15 to GPIO17.
+ Here I don't check whether HOST is enebled as it is not implemented yet.
+ */
+static void dm1105_gpio_set(struct dm1105_dev *dev, u32 mask)
+{
+	if (mask & 0xfffc0000)
+		printk(KERN_ERR "%s: Only 18 GPIO's are allowed\n", __func__);
+
+	if (mask & 0x0003ffff)
+		dm_setl(DM1105_GPIOVAL, mask & 0x0003ffff);
+
+}
+
+static void dm1105_gpio_clear(struct dm1105_dev *dev, u32 mask)
+{
+	if (mask & 0xfffc0000)
+		printk(KERN_ERR "%s: Only 18 GPIO's are allowed\n", __func__);
+
+	if (mask & 0x0003ffff)
+		dm_clearl(DM1105_GPIOVAL, mask & 0x0003ffff);
+
+}
+
+static void dm1105_gpio_andor(struct dm1105_dev *dev, u32 mask, u32 val)
+{
+	if (mask & 0xfffc0000)
+		printk(KERN_ERR "%s: Only 18 GPIO's are allowed\n", __func__);
+
+	if (mask & 0x0003ffff)
+		dm_andorl(DM1105_GPIOVAL, mask & 0x0003ffff, val);
+
+}
+
+static u32 dm1105_gpio_get(struct dm1105_dev *dev, u32 mask)
+{
+	if (mask & 0xfffc0000)
+		printk(KERN_ERR "%s: Only 18 GPIO's are allowed\n", __func__);
+
+	if (mask & 0x0003ffff)
+		return (dm_readl(DM1105_GPIOVAL) & mask & 0x0003ffff);
+
+	return 0;
+}
+
+static void dm1105_gpio_enable(struct dm1105_dev *dev, u32 mask, int asoutput)
+{
+	if (mask & 0xfffc0000)
+		printk(KERN_ERR "%s: Only 18 GPIO's are allowed\n", __func__);
+
+	if ((mask & 0x0003ffff) && asoutput)
+		dm_clearl(DM1105_GPIOCTR, mask & 0x0003ffff);
+	else if ((mask & 0x0003ffff) && !asoutput)
+		dm_setl(DM1105_GPIOCTR, mask & 0x0003ffff);
+
+}
+
+static void dm1105_setline(struct dm1105_dev *dev, u32 line, int state)
+{
+	if (state)
+		dm1105_gpio_enable(dev, line, 0);
+	else {
+		dm1105_gpio_enable(dev, line, 1);
+		dm1105_gpio_clear(dev, line);
+	}
+}
+
+static void dm1105_setsda(void *data, int state)
+{
+	struct dm1105_dev *dev = data;
+
+	dm1105_setline(dev, dm1105_boards[dev->boardnr].gpio_sda, state);
+}
+
+static void dm1105_setscl(void *data, int state)
+{
+	struct dm1105_dev *dev = data;
+
+	dm1105_setline(dev, dm1105_boards[dev->boardnr].gpio_scl, state);
+}
+
+static int dm1105_getsda(void *data)
+{
+	struct dm1105_dev *dev = data;
+
+	return dm1105_gpio_get(dev, dm1105_boards[dev->boardnr].gpio_sda) ? 1 : 0;
+}
+
+static int dm1105_getscl(void *data)
+{
+	struct dm1105_dev *dev = data;
+
+	return dm1105_gpio_get(dev, dm1105_boards[dev->boardnr].gpio_scl) ? 1 : 0;
+}
+
 static int dm1105_i2c_xfer(struct i2c_adapter *i2c_adap,
 			    struct i2c_msg *msgs, int num)
 {
@@ -467,6 +579,26 @@
 	return 0;
 }
 
+static int dm1105_set_voltage1(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
+{
+	struct dm1105_dev *dev = frontend_to_dm1105_dev(fe);
+
+	dm1105_gpio_enable(dev, GPIO16 | GPIO17, 1);
+	switch (voltage) {
+	case SEC_VOLTAGE_18:
+		dm1105_gpio_set(dev, GPIO16 | GPIO17);
+		break;
+	case SEC_VOLTAGE_13:
+		dm1105_gpio_andor(dev, GPIO16 | GPIO17, GPIO17);
+		break;
+	default:
+		dm1105_gpio_clear(dev, GPIO16 | GPIO17);
+		break;
+	}
+
+	return 0;
+}
+
 static void dm1105_set_dma_addr(struct dm1105_dev *dev)
 {
 	dm_writel(DM1105_STADR, cpu_to_le32(dev->dma_addr));
@@ -742,6 +874,38 @@
 	int ret;
 
 	switch (dev->boardnr) {
+	case DM1105_BOARD_UNBRANDED_I2C_ON_GPIO:
+		dm1105_gpio_enable(dev, GPIO15, 1);
+		dm1105_gpio_clear(dev, GPIO15);
+		msleep(100);
+		dm1105_gpio_set(dev, GPIO15);
+		msleep(200);
+		dev->fe = dvb_attach(
+			stv0299_attach, &sharp_z0194a_config,
+			&dev->i2c_bb_adap);
+		if (dev->fe) {
+			dev->fe->ops.set_voltage = dm1105_set_voltage1;
+			dvb_attach(dvb_pll_attach, dev->fe, 0x60,
+					&dev->i2c_bb_adap, DVB_PLL_OPERA1);
+			break;
+		}
+
+		dev->fe = dvb_attach(
+			stv0288_attach, &earda_config,
+			&dev->i2c_bb_adap);
+		if (dev->fe) {
+			dev->fe->ops.set_voltage = dm1105_set_voltage1;
+			dvb_attach(stb6000_attach, dev->fe, 0x61,
+					&dev->i2c_bb_adap);
+			break;
+		}
+
+		dev->fe = dvb_attach(
+			si21xx_attach, &serit_config,
+			&dev->i2c_bb_adap);
+		if (dev->fe)
+			dev->fe->ops.set_voltage = dm1105_set_voltage1;
+		break;
 	case DM1105_BOARD_DVBWORLD_2004:
 		dev->fe = dvb_attach(
 			cx24116_attach, &serit_sp2633_config,
@@ -905,11 +1069,33 @@
 	if (ret < 0)
 		goto err_dm1105_hw_exit;
 
+	i2c_set_adapdata(&dev->i2c_bb_adap, dev);
+	strcpy(dev->i2c_bb_adap.name, DM1105_I2C_GPIO_NAME);
+	dev->i2c_bb_adap.owner = THIS_MODULE;
+	dev->i2c_bb_adap.class = I2C_CLASS_TV_DIGITAL;
+	dev->i2c_bb_adap.dev.parent = &pdev->dev;
+	dev->i2c_bb_adap.algo_data = &dev->i2c_bit;
+	dev->i2c_bit.data = dev;
+	dev->i2c_bit.setsda = dm1105_setsda;
+	dev->i2c_bit.setscl = dm1105_setscl;
+	dev->i2c_bit.getsda = dm1105_getsda;
+	dev->i2c_bit.getscl = dm1105_getscl;
+	dev->i2c_bit.udelay = 10;
+	dev->i2c_bit.timeout = 10;
+
+	/* Raise SCL and SDA */
+	dm1105_setsda(dev, 1);
+	dm1105_setscl(dev, 1);
+
+	ret = i2c_bit_add_bus(&dev->i2c_bb_adap);
+	if (ret < 0)
+		goto err_i2c_del_adapter;
+
 	/* dvb */
 	ret = dvb_register_adapter(&dev->dvb_adapter, DRIVER_NAME,
 					THIS_MODULE, &pdev->dev, adapter_nr);
 	if (ret < 0)
-		goto err_i2c_del_adapter;
+		goto err_i2c_del_adapters;
 
 	dvb_adapter = &dev->dvb_adapter;
 
@@ -991,6 +1177,8 @@
 	dvb_dmx_release(dvbdemux);
 err_dvb_unregister_adapter:
 	dvb_unregister_adapter(dvb_adapter);
+err_i2c_del_adapters:
+	i2c_del_adapter(&dev->i2c_bb_adap);
 err_i2c_del_adapter:
 	i2c_del_adapter(&dev->i2c_adap);
 err_dm1105_hw_exit:
#21 lore raw

A little update on the matter.

These cards are broken!

It seems that the card is designed for a different NIM than what is actually on the cards.
The worst problem is 3.3V power supply for the digital portion of the NIM. This powers the 3.3V IO on the Si2109, and it is unconnected! This effectively disables all the IO that is not open drain like i2c. That is why you will not get any 22khz tone from these cards.

Luckily, I think I have found a way to fix it. The card is now tuning, and the 22khz tone is working. The LNB voltage is a little high, but that can be fixed by adding or replacing a resistor.
I have not tried to watch TV yet, so I am not certain if it is at all possible to get these cards into working order.

I will try the fix on a couple of boards and test them, and if it is successful, I will post a howto on the v4l wiki. Be warned though, it will involve the use of a soldering iron.

Quoted 21 lines · Hendrik Skarpeid
Quoted 6 lines · Igor M. Liplianin
Quoted 4 lines · On 3 марта 2010 18:42:42 Hendrik Skarpeid wrote:
Quoted 2 lines · Igor M. Liplianin

Now to find GPIO's for LNB power control and ... watch TV :)

Quoted 9 lines
Quoted 7 lines

Yep. No succesful tuning at the moment. There might also be an issue with the reset signal and writing to GPIOCTR, as the module at the moment loads succesfully only once.
As far as I can make out, the LNB power control is probably GPIO 16 and 17, not sure which is which, and how they work.
GPIO15 is wired to tuner #reset

New patch to test

I think the LNB voltage may be a little to high on my card, 14.5V and 20V. I would be a little more happy if they were 14 and 19, 13 and 18 would be perfect.
Anyways, as Igor pointet out, I don't have any signal from the LNB, checked with another tuner card. It's a quad LNB, and the other outputs are fine. Maybe it's' toasted from to high supply voltage! I little word of warning then. Anyways, here's my tweaked driver.

#22 lore raw
In reply to Hendrik Skarpeid

В сообщении от 10 марта 2010 14:15:49 автор Hendrik Skarpeid написал:

Quoted 14 lines

Igor M. Liplianin skrev:

Quoted 12 lines · On 3 марта 2010 18:42:42 Hendrik Skarpeid wrote:
Quoted 9 lines
Quoted 1 line · Igor M. Liplianin

Now to find GPIO's for LNB power control and ... watch TV :)

Yep. No succesful tuning at the moment. There might also be an issue with the reset signal and writing to GPIOCTR, as the module at the moment loads succesfully only once.
As far as I can make out, the LNB power control is probably GPIO 16 and 17, not sure which is which, and how they work.
GPIO15 is wired to tuner #reset

New patch to test

Quoted 8 lines

I think the LNB voltage may be a little to high on my card, 14.5V and 20V. I would be a little more happy if they were 14 and 19, 13 and 18 would be perfect.
Anyways, as Igor pointet out, I don't have any signal from the LNB, checked with another tuner card. It's a quad LNB, and the other outputs are fine. Maybe it's' toasted from to high supply voltage! I little word of warning then.
Anyways, here's my tweaked driver.

Here is reworked patch for clear GPIO's handling.
It allows to support I2C on GPIO's and per board LNB control through GPIO's. Also incuded support for Hendrik's card.
I think it is clear how to change and test GPIO's for LNB and other stuff now. To Hendrik:
Not shure, but there is maybe GPIO for raise/down LNB voltage a little (~1v). It is used for long coaxial lines to compensate voltage dropping.

linux/drivers/media/dvb/dm1105/dm1105.c +237 -36
diff -r abd3aac6644e linux/drivers/media/dvb/dm1105/dm1105.c
@@ -20,6 +20,7 @@
  */
 
 #include <linux/i2c.h>
+#include <linux/i2c-algo-bit.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -50,11 +51,12 @@
 
 #define UNSET (-1U)
 
-#define DM1105_BOARD_NOAUTO		UNSET
-#define DM1105_BOARD_UNKNOWN		0
-#define DM1105_BOARD_DVBWORLD_2002	1
-#define DM1105_BOARD_DVBWORLD_2004	2
-#define DM1105_BOARD_AXESS_DM05		3
+#define DM1105_BOARD_NOAUTO			UNSET
+#define DM1105_BOARD_UNKNOWN			0
+#define DM1105_BOARD_DVBWORLD_2002		1
+#define DM1105_BOARD_DVBWORLD_2004		2
+#define DM1105_BOARD_AXESS_DM05			3
+#define DM1105_BOARD_UNBRANDED_I2C_ON_GPIO	4
 
 /* ----------------------------------------------- */
 /*
@@ -158,22 +160,38 @@
 #define DM1105_MAX				0x04
 
 #define DRIVER_NAME				"dm1105"
+#define DM1105_I2C_GPIO_NAME			"dm1105-gpio"
 
 #define DM1105_DMA_PACKETS			47
 #define DM1105_DMA_PACKET_LENGTH		(128*4)
 #define DM1105_DMA_BYTES			(128 * 4 * DM1105_DMA_PACKETS)
 
+/*  */
+#define GPIO08					(1 << 8)
+#define GPIO13					(1 << 13)
+#define GPIO14					(1 << 14)
+#define GPIO15					(1 << 15)
+#define GPIO16					(1 << 16)
+#define GPIO17					(1 << 17)
+#define GPIO_ALL				0x03ffff
+
 /* GPIO's for LNB power control */
-#define DM1105_LNB_MASK				0x00000000
-#define DM1105_LNB_OFF				0x00020000
-#define DM1105_LNB_13V				0x00010100
-#define DM1105_LNB_18V				0x00000100
+#define DM1105_LNB_MASK				(GPIO_ALL & ~(GPIO14 | GPIO13))
+#define DM1105_LNB_OFF				GPIO17
+#define DM1105_LNB_13V				(GPIO16 | GPIO08)
+#define DM1105_LNB_18V				GPIO08
 
 /* GPIO's for LNB power control for Axess DM05 */
-#define DM05_LNB_MASK				0x00000000
-#define DM05_LNB_OFF				0x00020000/* actually 13v */
-#define DM05_LNB_13V				0x00020000
-#define DM05_LNB_18V				0x00030000
+#define DM05_LNB_MASK				(GPIO_ALL & ~(GPIO14 | GPIO13))
+#define DM05_LNB_OFF				GPIO17/* actually 13v */
+#define DM05_LNB_13V				GPIO17
+#define DM05_LNB_18V				(GPIO17 | GPIO16)
+
+/* GPIO's for LNB power control for unbranded with I2C on GPIO */
+#define UNBR_LNB_MASK				(GPIO17 | GPIO16)
+#define UNBR_LNB_OFF				0
+#define UNBR_LNB_13V				GPIO17
+#define UNBR_LNB_18V				(GPIO17 | GPIO16)
 
 static unsigned int card[]  = {[0 ... 3] = UNSET };
 module_param_array(card,  int, NULL, 0444);
@@ -188,7 +206,11 @@
 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
 
 struct dm1105_board {
-	char                    *name;
+	char	*name;
+	struct	{
+		u32	mask, off, v13, v18;
+	} lnb;
+	u32	gpio_scl, gpio_sda;
 };
 
 struct dm1105_subid {
@@ -200,15 +222,50 @@
 static const struct dm1105_board dm1105_boards[] = {
 	[DM1105_BOARD_UNKNOWN] = {
 		.name		= "UNKNOWN/GENERIC",
+		.lnb = {
+			.mask = DM1105_LNB_MASK,
+			.off = DM1105_LNB_OFF,
+			.v13 = DM1105_LNB_13V,
+			.v18 = DM1105_LNB_18V,
+		},
 	},
 	[DM1105_BOARD_DVBWORLD_2002] = {
 		.name		= "DVBWorld PCI 2002",
+		.lnb = {
+			.mask = DM1105_LNB_MASK,
+			.off = DM1105_LNB_OFF,
+			.v13 = DM1105_LNB_13V,
+			.v18 = DM1105_LNB_18V,
+		},
 	},
 	[DM1105_BOARD_DVBWORLD_2004] = {
 		.name		= "DVBWorld PCI 2004",
+		.lnb = {
+			.mask = DM1105_LNB_MASK,
+			.off = DM1105_LNB_OFF,
+			.v13 = DM1105_LNB_13V,
+			.v18 = DM1105_LNB_18V,
+		},
 	},
 	[DM1105_BOARD_AXESS_DM05] = {
 		.name		= "Axess/EasyTv DM05",
+		.lnb = {
+			.mask = DM05_LNB_MASK,
+			.off = DM05_LNB_OFF,
+			.v13 = DM05_LNB_13V,
+			.v18 = DM05_LNB_18V,
+		},
+	},
+	[DM1105_BOARD_UNBRANDED_I2C_ON_GPIO] = {
+		.name		= "Unbranded DM1105 with i2c on GPIOs",
+		.lnb = {
+			.mask = UNBR_LNB_MASK,
+			.off = UNBR_LNB_OFF,
+			.v13 = UNBR_LNB_13V,
+			.v18 = UNBR_LNB_18V,
+		},
+		.gpio_scl	= GPIO14,
+		.gpio_sda	= GPIO13,
 	},
 };
 
@@ -294,6 +351,8 @@
 
 	/* i2c */
 	struct i2c_adapter i2c_adap;
+	struct i2c_adapter i2c_bb_adap;
+	struct i2c_algo_bit_data i2c_bit;
 
 	/* irq */
 	struct work_struct work;
@@ -329,6 +388,103 @@
 #define dm_setl(reg, bit)	dm_andorl((reg), (bit), (bit))
 #define dm_clearl(reg, bit)	dm_andorl((reg), (bit), 0)
 
+/* The chip has 18 GPIOs. In HOST mode GPIO's used as 15 bit address lines,
+ so we can use only 3 GPIO's from GPIO15 to GPIO17.
+ Here I don't check whether HOST is enebled as it is not implemented yet.
+ */
+static void dm1105_gpio_set(struct dm1105_dev *dev, u32 mask)
+{
+	if (mask & 0xfffc0000)
+		printk(KERN_ERR "%s: Only 18 GPIO's are allowed\n", __func__);
+
+	if (mask & 0x0003ffff)
+		dm_setl(DM1105_GPIOVAL, mask & 0x0003ffff);
+
+}
+
+static void dm1105_gpio_clear(struct dm1105_dev *dev, u32 mask)
+{
+	if (mask & 0xfffc0000)
+		printk(KERN_ERR "%s: Only 18 GPIO's are allowed\n", __func__);
+
+	if (mask & 0x0003ffff)
+		dm_clearl(DM1105_GPIOVAL, mask & 0x0003ffff);
+
+}
+
+static void dm1105_gpio_andor(struct dm1105_dev *dev, u32 mask, u32 val)
+{
+	if (mask & 0xfffc0000)
+		printk(KERN_ERR "%s: Only 18 GPIO's are allowed\n", __func__);
+
+	if (mask & 0x0003ffff)
+		dm_andorl(DM1105_GPIOVAL, mask & 0x0003ffff, val);
+
+}
+
+static u32 dm1105_gpio_get(struct dm1105_dev *dev, u32 mask)
+{
+	if (mask & 0xfffc0000)
+		printk(KERN_ERR "%s: Only 18 GPIO's are allowed\n", __func__);
+
+	if (mask & 0x0003ffff)
+		return dm_readl(DM1105_GPIOVAL) & mask & 0x0003ffff;
+
+	return 0;
+}
+
+static void dm1105_gpio_enable(struct dm1105_dev *dev, u32 mask, int asoutput)
+{
+	if (mask & 0xfffc0000)
+		printk(KERN_ERR "%s: Only 18 GPIO's are allowed\n", __func__);
+
+	if ((mask & 0x0003ffff) && asoutput)
+		dm_clearl(DM1105_GPIOCTR, mask & 0x0003ffff);
+	else if ((mask & 0x0003ffff) && !asoutput)
+		dm_setl(DM1105_GPIOCTR, mask & 0x0003ffff);
+
+}
+
+static void dm1105_setline(struct dm1105_dev *dev, u32 line, int state)
+{
+	if (state)
+		dm1105_gpio_enable(dev, line, 0);
+	else {
+		dm1105_gpio_enable(dev, line, 1);
+		dm1105_gpio_clear(dev, line);
+	}
+}
+
+static void dm1105_setsda(void *data, int state)
+{
+	struct dm1105_dev *dev = data;
+
+	dm1105_setline(dev, dm1105_boards[dev->boardnr].gpio_sda, state);
+}
+
+static void dm1105_setscl(void *data, int state)
+{
+	struct dm1105_dev *dev = data;
+
+	dm1105_setline(dev, dm1105_boards[dev->boardnr].gpio_scl, state);
+}
+
+static int dm1105_getsda(void *data)
+{
+	struct dm1105_dev *dev = data;
+
+	return dm1105_gpio_get(dev, dm1105_boards[dev->boardnr].gpio_sda)
+									? 1 : 0;
+}
+
+static int dm1105_getscl(void *data)
+{
+	struct dm1105_dev *dev = data;
+
+	return dm1105_gpio_get(dev, dm1105_boards[dev->boardnr].gpio_scl)
+									? 1 : 0;
+}
+
 static int dm1105_i2c_xfer(struct i2c_adapter *i2c_adap,
 			    struct i2c_msg *msgs, int num)
 {
@@ -440,31 +596,20 @@
 static int dm1105_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
 {
 	struct dm1105_dev *dev = frontend_to_dm1105_dev(fe);
-	u32 lnb_mask, lnb_13v, lnb_18v, lnb_off;
 
-	switch (dev->boardnr) {
-	case DM1105_BOARD_AXESS_DM05:
-		lnb_mask = DM05_LNB_MASK;
-		lnb_off = DM05_LNB_OFF;
-		lnb_13v = DM05_LNB_13V;
-		lnb_18v = DM05_LNB_18V;
-		break;
-	case DM1105_BOARD_DVBWORLD_2002:
-	case DM1105_BOARD_DVBWORLD_2004:
-	default:
-		lnb_mask = DM1105_LNB_MASK;
-		lnb_off = DM1105_LNB_OFF;
-		lnb_13v = DM1105_LNB_13V;
-		lnb_18v = DM1105_LNB_18V;
-	}
-
-	dm_writel(DM1105_GPIOCTR, lnb_mask);
+	dm1105_gpio_enable(dev, dm1105_boards[dev->boardnr].lnb.mask, 1);
 	if (voltage == SEC_VOLTAGE_18)
-		dm_writel(DM1105_GPIOVAL, lnb_18v);
+		dm1105_gpio_andor(dev,
+				dm1105_boards[dev->boardnr].lnb.mask,
+				dm1105_boards[dev->boardnr].lnb.v18);
 	else if (voltage == SEC_VOLTAGE_13)
-		dm_writel(DM1105_GPIOVAL, lnb_13v);
+		dm1105_gpio_andor(dev,
+				dm1105_boards[dev->boardnr].lnb.mask,
+				dm1105_boards[dev->boardnr].lnb.v13);
 	else
-		dm_writel(DM1105_GPIOVAL, lnb_off);
+		dm1105_gpio_andor(dev,
+				dm1105_boards[dev->boardnr].lnb.mask,
+				dm1105_boards[dev->boardnr].lnb.off);
 
 	return 0;
 }
@@ -740,6 +885,38 @@
 	int ret;
 
 	switch (dev->boardnr) {
+	case DM1105_BOARD_UNBRANDED_I2C_ON_GPIO:
+		dm1105_gpio_enable(dev, GPIO15, 1);
+		dm1105_gpio_clear(dev, GPIO15);
+		msleep(100);
+		dm1105_gpio_set(dev, GPIO15);
+		msleep(200);
+		dev->fe = dvb_attach(
+			stv0299_attach, &sharp_z0194a_config,
+			&dev->i2c_bb_adap);
+		if (dev->fe) {
+			dev->fe->ops.set_voltage = dm1105_set_voltage;
+			dvb_attach(dvb_pll_attach, dev->fe, 0x60,
+					&dev->i2c_bb_adap, DVB_PLL_OPERA1);
+			break;
+		}
+
+		dev->fe = dvb_attach(
+			stv0288_attach, &earda_config,
+			&dev->i2c_bb_adap);
+		if (dev->fe) {
+			dev->fe->ops.set_voltage = dm1105_set_voltage;
+			dvb_attach(stb6000_attach, dev->fe, 0x61,
+					&dev->i2c_bb_adap);
+			break;
+		}
+
+		dev->fe = dvb_attach(
+			si21xx_attach, &serit_config,
+			&dev->i2c_bb_adap);
+		if (dev->fe)
+			dev->fe->ops.set_voltage = dm1105_set_voltage;
+		break;
 	case DM1105_BOARD_DVBWORLD_2004:
 		dev->fe = dvb_attach(
 			cx24116_attach, &serit_sp2633_config,
@@ -903,11 +1080,33 @@
 	if (ret < 0)
 		goto err_dm1105_hw_exit;
 
+	i2c_set_adapdata(&dev->i2c_bb_adap, dev);
+	strcpy(dev->i2c_bb_adap.name, DM1105_I2C_GPIO_NAME);
+	dev->i2c_bb_adap.owner = THIS_MODULE;
+	dev->i2c_bb_adap.class = I2C_CLASS_TV_DIGITAL;
+	dev->i2c_bb_adap.dev.parent = &pdev->dev;
+	dev->i2c_bb_adap.algo_data = &dev->i2c_bit;
+	dev->i2c_bit.data = dev;
+	dev->i2c_bit.setsda = dm1105_setsda;
+	dev->i2c_bit.setscl = dm1105_setscl;
+	dev->i2c_bit.getsda = dm1105_getsda;
+	dev->i2c_bit.getscl = dm1105_getscl;
+	dev->i2c_bit.udelay = 10;
+	dev->i2c_bit.timeout = 10;
+
+	/* Raise SCL and SDA */
+	dm1105_setsda(dev, 1);
+	dm1105_setscl(dev, 1);
+
+	ret = i2c_bit_add_bus(&dev->i2c_bb_adap);
+	if (ret < 0)
+		goto err_i2c_del_adapter;
+
 	/* dvb */
 	ret = dvb_register_adapter(&dev->dvb_adapter, DRIVER_NAME,
 					THIS_MODULE, &pdev->dev, adapter_nr);
 	if (ret < 0)
-		goto err_i2c_del_adapter;
+		goto err_i2c_del_adapters;
 
 	dvb_adapter = &dev->dvb_adapter;
 
@@ -989,6 +1188,8 @@
 	dvb_dmx_release(dvbdemux);
 err_dvb_unregister_adapter:
 	dvb_unregister_adapter(dvb_adapter);
+err_i2c_del_adapters:
+	i2c_del_adapter(&dev->i2c_bb_adap);
 err_i2c_del_adapter:
 	i2c_del_adapter(&dev->i2c_adap);
 err_dm1105_hw_exit:
#23 lore raw
Quoted 32 lines · Igor M. Liplianin

В сообщении от 10 марта 2010 14:15:49 автор Hendrik Skarpeid написал:

Quoted 14 lines

Igor M. Liplianin skrev:

Quoted 12 lines · On 3 марта 2010 18:42:42 Hendrik Skarpeid wrote:
Quoted 9 lines
Quoted 1 line · Igor M. Liplianin

Now to find GPIO's for LNB power control and ... watch TV :)

Yep. No succesful tuning at the moment. There might also be an issue with the reset signal and writing to GPIOCTR, as the module at the moment loads succesfully only once.
As far as I can make out, the LNB power control is probably GPIO 16 and 17, not sure which is which, and how they work.
GPIO15 is wired to tuner #reset

New patch to test

Quoted 8 lines

I think the LNB voltage may be a little to high on my card, 14.5V and 20V. I would be a little more happy if they were 14 and 19, 13 and 18 would be perfect.
Anyways, as Igor pointet out, I don't have any signal from the LNB, checked with another tuner card. It's a quad LNB, and the other outputs are fine. Maybe it's' toasted from to high supply voltage! I little word of warning then.
Anyways, here's my tweaked driver.

Here is reworked patch for clear GPIO's handling.
It allows to support I2C on GPIO's and per board LNB control through GPIO's. Also incuded support for Hendrik's card.
I think it is clear how to change and test GPIO's for LNB and other stuff now. To Hendrik:
Not shure, but there is maybe GPIO for raise/down LNB voltage a little (~1v). It is used for long coaxial lines to compensate voltage dropping.

Quoted 1 line

Hi Igor,

I have a brandless DVB-S tv tuner card also, with a dm1105n chip. I was getting the "DM1105: could not attach frontend 195d:1105" message with the latest kernel also, but I applied this patch to the dm1105 module and now the card's being recognised (though is still listed as an ethernet controller with lspci)

My dmesg output is:

dm1105 0000:01:05.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
DVB: registering new adapter (dm1105)
dm1105 0000:01:05.0: MAC 00:00:00:00:00:00
DVB: registering adapter 0 frontend 0 (SL SI21XX DVB-S)...
Registered IR keymap rc-dm1105-nec
input: DVB on-card IR receiver as /devices/pci0000:00/0000:00:1e.0/0000:01:05.0/rc/rc0/input6
rc0: DVB on-card IR receiver as /devices/pci0000:00/0000:00:1e.0/0000:01:05.0/rc/rc0

The card is one of these:
http://www.hongsun.biz/ProView.asp?ID=90

Scanning doesn't appear to give me any results. Should this be working?
Anything I can do to test the card out for you?

Cheers,
Matt.

#24 lore raw

В сообщении от 31 января 2011 11:33:54 автор Matt Vickers написал:

Quoted 58 lines · Igor M. Liplianin
Quoted 30 lines

В сообщении от 10 марта 2010 14:15:49 автор Hendrik Skarpeid написал:

Quoted 14 lines

Igor M. Liplianin skrev:

Quoted 12 lines · On 3 марта 2010 18:42:42 Hendrik Skarpeid wrote:
Quoted 9 lines
Quoted 1 line · Igor M. Liplianin

Now to find GPIO's for LNB power control and ... watch TV :)

Yep. No succesful tuning at the moment. There might also be an issue with the reset signal and writing to GPIOCTR, as the module at the moment loads succesfully only once.
As far as I can make out, the LNB power control is probably GPIO 16 and 17, not sure which is which, and how they work. GPIO15 is wired to tuner #reset

New patch to test

Quoted 8 lines

I think the LNB voltage may be a little to high on my card, 14.5V and 20V. I would be a little more happy if they were 14 and 19, 13 and 18 would be perfect.
Anyways, as Igor pointet out, I don't have any signal from the LNB, checked with another tuner card. It's a quad LNB, and the other outputs are fine. Maybe it's' toasted from to high supply voltage! I little word of warning then.
Anyways, here's my tweaked driver.

Here is reworked patch for clear GPIO's handling.
It allows to support I2C on GPIO's and per board LNB control through GPIO's. Also incuded support for Hendrik's card.
I think it is clear how to change and test GPIO's for LNB and other stuff now.

Quoted 6 lines

To Hendrik:
Not shure, but there is maybe GPIO for raise/down LNB voltage a little (~1v). It is used for long coaxial lines to compensate voltage dropping.

Hi Igor,

I have a brandless DVB-S tv tuner card also, with a dm1105n chip. I was getting the "DM1105: could not attach frontend 195d:1105" message with the latest kernel also, but I applied this patch to the dm1105 module and now the card's being recognised (though is still listed as an ethernet controller with lspci)

My dmesg output is:

dm1105 0000:01:05.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
DVB: registering new adapter (dm1105)
dm1105 0000:01:05.0: MAC 00:00:00:00:00:00
DVB: registering adapter 0 frontend 0 (SL SI21XX DVB-S)... Registered IR keymap rc-dm1105-nec
input: DVB on-card IR receiver as /devices/pci0000:00/0000:00:1e.0/0000:01:05.0/rc/rc0/input6
rc0: DVB on-card IR receiver as /devices/pci0000:00/0000:00:1e.0/0000:01:05.0/rc/rc0

Quoted 8 lines

The card is one of these:
http://www.hongsun.biz/ProView.asp?ID=90

Scanning doesn't appear to give me any results. Should this be working?
Anything I can do to test the card out for you?

Cheers,
Matt.

Hi Matt,
Is there any label on tuner can?
Have you a close look picture of PCB ?

Cheers,
Igor.

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Igor M. Liplianin
Microsoft Windows Free Zone - Linux used for all Computing Tasks
#25 lore raw
Quoted 60 lines · Igor M. Liplianin

В сообщении от 31 января 2011 11:33:54 автор Matt Vickers написал:

Quoted 59 lines · Igor M. Liplianin
Quoted 26 lines

В сообщении от 10 марта 2010 14:15:49 автор Hendrik Skarpeid написал:

Quoted 11 lines

Igor M. Liplianin skrev:

Quoted 10 lines · On 3 марта 2010 18:42:42 Hendrik Skarpeid wrote:
Quoted 8 lines
Quoted 1 line · Igor M. Liplianin

Now to find GPIO's for LNB power control and ... watch TV :)

Yep. No succesful tuning at the moment. There might also be an issue with the reset signal and writing to GPIOCTR, as the module at the moment loads succesfully only once.
As far as I can make out, the LNB power control is probably GPIO 16 and 17, not sure which is which, and how they work. GPIO15 is wired to tuner #reset

New patch to test

Quoted 8 lines

I think the LNB voltage may be a little to high on my card, 14.5V and 20V. I would be a little more happy if they were 14 and 19, 13 and 18 would be perfect.
Anyways, as Igor pointet out, I don't have any signal from the LNB, checked with another tuner card. It's a quad LNB, and the other outputs are fine. Maybe it's' toasted from to high supply voltage! I little word of warning then.
Anyways, here's my tweaked driver.

Here is reworked patch for clear GPIO's handling.
It allows to support I2C on GPIO's and per board LNB control through GPIO's. Also incuded support for Hendrik's card.
I think it is clear how to change and test GPIO's for LNB and other stuff now.

Quoted 6 lines

To Hendrik:
Not shure, but there is maybe GPIO for raise/down LNB voltage a little (~1v). It is used for long coaxial lines to compensate voltage dropping.

Hi Igor,

I have a brandless DVB-S tv tuner card also, with a dm1105n chip. I was getting the "DM1105: could not attach frontend 195d:1105" message with the latest kernel also, but I applied this patch to the dm1105 module and now the card's being recognised (though is still listed as an ethernet controller with lspci)

My dmesg output is:

dm1105 0000:01:05.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
DVB: registering new adapter (dm1105)
dm1105 0000:01:05.0: MAC 00:00:00:00:00:00
DVB: registering adapter 0 frontend 0 (SL SI21XX DVB-S)... Registered IR keymap rc-dm1105-nec
input: DVB on-card IR receiver as /devices/pci0000:00/0000:00:1e.0/0000:01:05.0/rc/rc0/input6
rc0: DVB on-card IR receiver as /devices/pci0000:00/0000:00:1e.0/0000:01:05.0/rc/rc0

The card is one of these:
http://www.hongsun.biz/ProView.asp?ID=90

Scanning doesn't appear to give me any results. Should this be working?
Anything I can do to test the card out for you?

Quoted 8 lines
Quoted 2 lines

Cheers,
Matt.

Hi Matt,
Is there any label on tuner can?
Have you a close look picture of PCB ?

Cheers,
Igor.

Hi Igor,

The label on the tuner can is SP1514LHb S1009, so I'm guessing this is a near-identical card to the one that Paul was asking you about in January of last year, e.g:

Quoted 8 lines

1: DVB-S
5: 16cc
1: Unsure, but it has an LNB in and an LNB out, so I guess it does have loop through?
4: Si2109
L: Si labs
H: Horizontal
b: Lead free

Here are two images I took of the card:

A view of the entire board:

http://matt.vicke.rs/pics/pcb_full.jpg

And here is a closer view of the board between the tuner and the dm1105n chip.

http://matt.vicke.rs/pics/pcb_detail.jpg

With your patch and the card=4 parameter the card is recognised, and the dvb device created. Scanning will run (I'm attempting to locate channels on Optus D1, which I can successfully scan using a set top box, so the dish is correctly aligned), but the card reports tuning failed on all of the Optus D1 frequencies that I attempt. I also tried running w_scan but had no success.

Cheers,
Matt.

Quoted 4 lines
Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#26 lore raw

В сообщении от 1 февраля 2011 07:17:19 автор Matt Vickers написал:

Quoted 110 lines · Igor M. Liplianin
Quoted 69 lines

В сообщении от 31 января 2011 11:33:54 автор Matt Vickers написал:

Quoted 61 lines · Igor M. Liplianin
Quoted 30 lines

В сообщении от 10 марта 2010 14:15:49 автор Hendrik Skarpeid написал:

Quoted 14 lines

Igor M. Liplianin skrev:

Quoted 12 lines · On 3 марта 2010 18:42:42 Hendrik Skarpeid wrote:
Quoted 9 lines
Quoted 1 line · Igor M. Liplianin

Now to find GPIO's for LNB power control and ... watch TV :)

Yep. No succesful tuning at the moment. There might also be an issue with the reset signal and writing to GPIOCTR, as the module at the moment loads succesfully only once.
As far as I can make out, the LNB power control is probably GPIO 16 and 17, not sure which is which, and how they work. GPIO15 is wired to tuner #reset

New patch to test

Quoted 8 lines

I think the LNB voltage may be a little to high on my card, 14.5V and 20V. I would be a little more happy if they were 14 and 19, 13 and 18 would be perfect.
Anyways, as Igor pointet out, I don't have any signal from the LNB, checked with another tuner card. It's a quad LNB, and the other outputs are fine. Maybe it's' toasted from to high supply voltage! I little word of warning then.
Anyways, here's my tweaked driver.

Here is reworked patch for clear GPIO's handling.
It allows to support I2C on GPIO's and per board LNB control through GPIO's. Also incuded support for Hendrik's card.
I think it is clear how to change and test GPIO's for LNB and other stuff now.

Quoted 6 lines

To Hendrik:
Not shure, but there is maybe GPIO for raise/down LNB voltage a little (~1v). It is used for long coaxial lines to compensate voltage dropping.

Hi Igor,

I have a brandless DVB-S tv tuner card also, with a dm1105n chip. I was getting the "DM1105: could not attach frontend 195d:1105" message with the latest kernel also, but I applied this patch to the dm1105 module and now the card's being recognised (though is still listed as an ethernet controller with lspci)

My dmesg output is:

dm1105 0000:01:05.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
DVB: registering new adapter (dm1105)
dm1105 0000:01:05.0: MAC 00:00:00:00:00:00
DVB: registering adapter 0 frontend 0 (SL SI21XX DVB-S)... Registered IR keymap rc-dm1105-nec
input: DVB on-card IR receiver as /devices/pci0000:00/0000:00:1e.0/0000:01:05.0/rc/rc0/input6
rc0: DVB on-card IR receiver as /devices/pci0000:00/0000:00:1e.0/0000:01:05.0/rc/rc0

The card is one of these:
http://www.hongsun.biz/ProView.asp?ID=90

Quoted 6 lines

Scanning doesn't appear to give me any results. Should this be working?

Anything I can do to test the card out for you?

Cheers,
Matt.

Quoted 6 lines

Hi Matt,
Is there any label on tuner can?
Have you a close look picture of PCB ?

Cheers,
Igor.

Hi Igor,

The label on the tuner can is SP1514LHb S1009, so I'm guessing this is a near-identical card to the one that Paul was asking you about in January

of last year, e.g:

Quoted 8 lines

1: DVB-S
5: 16cc
1: Unsure, but it has an LNB in and an LNB out, so I guess it does have loop through?
4: Si2109
L: Si labs
H: Horizontal
b: Lead free

Here are two images I took of the card:

A view of the entire board:

http://matt.vicke.rs/pics/pcb_full.jpg

And here is a closer view of the board between the tuner and the dm1105n chip.

http://matt.vicke.rs/pics/pcb_detail.jpg

With your patch and the card=4 parameter the card is recognised, and the dvb device created. Scanning will run (I'm attempting to locate channels on Optus D1, which I can successfully scan using a set top box, so the dish is correctly aligned), but the card reports tuning failed on all of the Optus D1 frequencies that I attempt. I also tried running w_scan but had no success.

Quoted 2 lines

Cheers,
Matt.

Hi Matt,

Did you read this post?
http://www.mail-archive.com/[email protected]/msg17269.html
It seems the card needs some soldering :(

Cheers
Igor

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Igor M. Liplianin
Microsoft Windows Free Zone - Linux used for all Computing Tasks
#27 lore raw

В сообщении от 2 февраля 2011 20:39:33 автор Igor M. Liplianin написал:

Quoted 112 lines

В сообщении от 1 февраля 2011 07:17:19 автор Matt Vickers написал:

Quoted 111 lines · Igor M. Liplianin
Quoted 70 lines

В сообщении от 31 января 2011 11:33:54 автор Matt Vickers написал:

Quoted 61 lines · Igor M. Liplianin
Quoted 30 lines

В сообщении от 10 марта 2010 14:15:49 автор Hendrik Skarpeid написал:

Quoted 14 lines

Igor M. Liplianin skrev:

Quoted 12 lines · On 3 марта 2010 18:42:42 Hendrik Skarpeid wrote:
Quoted 9 lines
Quoted 1 line · Igor M. Liplianin

Now to find GPIO's for LNB power control and ... watch TV :)

Yep. No succesful tuning at the moment. There might also be an issue with the reset signal and writing to GPIOCTR, as the module at the moment loads succesfully only once.
As far as I can make out, the LNB power control is probably GPIO 16 and 17, not sure which is which, and how they work. GPIO15 is wired to tuner #reset

New patch to test

Quoted 8 lines

I think the LNB voltage may be a little to high on my card, 14.5V and 20V. I would be a little more happy if they were 14 and 19, 13 and 18 would be perfect.
Anyways, as Igor pointet out, I don't have any signal from the LNB, checked with another tuner card. It's a quad LNB, and the other outputs are fine. Maybe it's' toasted from to high supply voltage! I little word of warning then.
Anyways, here's my tweaked driver.

Here is reworked patch for clear GPIO's handling.
It allows to support I2C on GPIO's and per board LNB control through GPIO's. Also incuded support for Hendrik's card.
I think it is clear how to change and test GPIO's for LNB and other stuff now.

Quoted 6 lines

To Hendrik:
Not shure, but there is maybe GPIO for raise/down LNB voltage a little (~1v). It is used for long coaxial lines to compensate voltage dropping.

Hi Igor,

I have a brandless DVB-S tv tuner card also, with a dm1105n chip. I was getting the "DM1105: could not attach frontend 195d:1105" message with the latest kernel also, but I applied this patch to the dm1105 module and now the card's being recognised (though is still listed as an ethernet controller with lspci)

My dmesg output is:

dm1105 0000:01:05.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
DVB: registering new adapter (dm1105)
dm1105 0000:01:05.0: MAC 00:00:00:00:00:00
DVB: registering adapter 0 frontend 0 (SL SI21XX DVB-S)... Registered IR keymap rc-dm1105-nec
input: DVB on-card IR receiver as /devices/pci0000:00/0000:00:1e.0/0000:01:05.0/rc/rc0/input6
rc0: DVB on-card IR receiver as /devices/pci0000:00/0000:00:1e.0/0000:01:05.0/rc/rc0

The card is one of these:
http://www.hongsun.biz/ProView.asp?ID=90

Quoted 7 lines

Scanning doesn't appear to give me any results. Should this be working?

Anything I can do to test the card out for you?

Cheers,
Matt.

Quoted 6 lines

Hi Matt,
Is there any label on tuner can?
Have you a close look picture of PCB ?

Cheers,
Igor.

Hi Igor,

The label on the tuner can is SP1514LHb S1009, so I'm guessing this is a near-identical card to the one that Paul was asking you about in January

of last year, e.g:

Quoted 8 lines

1: DVB-S
5: 16cc
1: Unsure, but it has an LNB in and an LNB out, so I guess it does have loop through?
4: Si2109
L: Si labs
H: Horizontal
b: Lead free

Here are two images I took of the card:

A view of the entire board:

http://matt.vicke.rs/pics/pcb_full.jpg

And here is a closer view of the board between the tuner and the dm1105n chip.

http://matt.vicke.rs/pics/pcb_detail.jpg

With your patch and the card=4 parameter the card is recognised, and the dvb device created. Scanning will run (I'm attempting to locate channels on Optus D1, which I can successfully scan using a set top box, so the dish is correctly aligned), but the card reports tuning failed on all of the Optus D1 frequencies that I attempt. I also tried running w_scan but had no success.

Quoted 8 lines
Quoted 2 lines

Cheers,
Matt.

Hi Matt,

Did you read this post?
http://www.mail-archive.com/[email protected]/msg17269.html
It seems the card needs some soldering :(

or you can test the card using loop output from another STB/card.

Quoted 8 lines

Cheers
Igor

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Igor M. Liplianin
Microsoft Windows Free Zone - Linux used for all Computing Tasks
#28 lore raw
In reply to Igor M. Liplianin

Hi Igor,

Em 23-10-2010 07:20, Igor M. Liplianin escreveu:

Quoted 32 lines

В сообщении от 10 марта 2010 14:15:49 автор Hendrik Skarpeid написал:

Quoted 14 lines

Igor M. Liplianin skrev:

Quoted 12 lines · On 3 марта 2010 18:42:42 Hendrik Skarpeid wrote:
Quoted 9 lines
Quoted 1 line · Igor M. Liplianin

Now to find GPIO's for LNB power control and ... watch TV :)

Yep. No succesful tuning at the moment. There might also be an issue with the reset signal and writing to GPIOCTR, as the module at the moment loads succesfully only once.
As far as I can make out, the LNB power control is probably GPIO 16 and 17, not sure which is which, and how they work.
GPIO15 is wired to tuner #reset

New patch to test

Quoted 8 lines

I think the LNB voltage may be a little to high on my card, 14.5V and 20V. I would be a little more happy if they were 14 and 19, 13 and 18 would be perfect.
Anyways, as Igor pointet out, I don't have any signal from the LNB, checked with another tuner card. It's a quad LNB, and the other outputs are fine. Maybe it's' toasted from to high supply voltage! I little word of warning then.
Anyways, here's my tweaked driver.

Here is reworked patch for clear GPIO's handling.
It allows to support I2C on GPIO's and per board LNB control through GPIO's. Also incuded support for Hendrik's card.
I think it is clear how to change and test GPIO's for LNB and other stuff now. To Hendrik:
Not shure, but there is maybe GPIO for raise/down LNB voltage a little (~1v). It is used for long coaxial lines to compensate voltage dropping.

Quoted 1 line

I'm not sure if this patch is still valid or not, and if it should or not be applied, as there were several discussions around it. As a reference, it is stored at patchwork with:

	X-Patchwork-Id: 279091

And still applies fine (yet, patchwork lost patch history/comments and SOB).

Igor, could you please update me if I should apply this patch or if the patch got rejected/superseeded?

Thanks!
Mauro.