Skip to contentSkip to conversation

pci: Add support for DVB PCIe cards from Prospero Technologies Ltd.

RFC PATCH In review Philip Downer 4 participants 12 messages Feb 16, 2015 – Feb 19, 2015 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

cover pci: Add support for DVB PCIe cards from Prospero Technologies Ltd.

The Vortex PCIe card by Prospero Technologies Ltd is a modular DVB card with a hardware demux, the card can support up to 8 modules which are fixed to the board at assembly time. Currently we only offer one configuration, 8 x Dibcom 7090p DVB-t tuners, but we will soon be releasing other configurations. There is also a connector for an infra-red receiver dongle on the board which supports RAW IR.

The driver has been in testing on our systems (ARM Cortex-A9, Marvell Sheva, x86, x86-64) for longer than 6 months, so I'm confident that it works. However as this is the first Linux driver I've written, I'm sure there are some things that I've got wrong. One thing in particular which has been raised by one of our early testers is that we currently register all of our frontends as being attached to one adapter. This means the device is enumerated in /dev like this:

/dev/dvb/adapter0/frontend0
/dev/dvb/adapter0/dvr0
/dev/dvb/adapter0/demux0

/dev/dvb/adapter0/frontend1
/dev/dvb/adapter0/dvr1
/dev/dvb/adapter0/demux1

/dev/dvb/adapter0/frontend2
/dev/dvb/adapter0/dvr2
/dev/dvb/adapter0/demux2

etc.

Whilst I think this is ok according to the spec, our tester has complained that it's incompatible with their software which expects to find just one frontend per adapter. So I'm wondering if someone could confirm if what I've done with regards to this is correct.

I've tested this patch by applying it to current media-master and it applies cleanly and builds without issue for me.

More information on the card can be found at:
http://prospero-tech.com/vortex-1-dvb-t-pcie-card/

Regards,

Philip Downer

Philip Downer (1):
[media] pci: Add support for DVB PCIe cards from Prospero Technologies
Ltd.

 drivers/media/pci/Kconfig                     |    1 +
 drivers/media/pci/Makefile                    |    2 +
 drivers/media/pci/prospero/Kconfig            |    7 +
 drivers/media/pci/prospero/Makefile           |    7 +
 drivers/media/pci/prospero/prospero_common.h  |  264 ++++
 drivers/media/pci/prospero/prospero_fe.h      |    5 +
 drivers/media/pci/prospero/prospero_fe_main.c |  466 ++++++
 drivers/media/pci/prospero/prospero_i2c.c     |  449 ++++++
 drivers/media/pci/prospero/prospero_i2c.h     |    3 +
 drivers/media/pci/prospero/prospero_ir.c      |  150 ++
 drivers/media/pci/prospero/prospero_ir.h      |    4 +
 drivers/media/pci/prospero/prospero_main.c    | 2086 +++++++++++++++++++++++++
 12 files changed, 3444 insertions(+)
 create mode 100644 drivers/media/pci/prospero/Kconfig
 create mode 100644 drivers/media/pci/prospero/Makefile
 create mode 100644 drivers/media/pci/prospero/prospero_common.h
 create mode 100644 drivers/media/pci/prospero/prospero_fe.h
 create mode 100644 drivers/media/pci/prospero/prospero_fe_main.c
 create mode 100644 drivers/media/pci/prospero/prospero_i2c.c
 create mode 100644 drivers/media/pci/prospero/prospero_i2c.h
 create mode 100644 drivers/media/pci/prospero/prospero_ir.c
 create mode 100644 drivers/media/pci/prospero/prospero_ir.h
 create mode 100644 drivers/media/pci/prospero/prospero_main.c
Signature · 1 line
2.1.4
#1 lore raw

RFC PATCH 1/1 pci: Add support for DVB PCIe cards from Prospero Technologies Ltd.

This patch adds support for the Vortex 1 PCIe card from Prospero Technologies Ltd. The Vortex 1 supports up to 8 tuner modules and currently ships with 8xDibcom 7090p tuners. The card also has raw infra-red support and a hardware demuxer.

---
 drivers/media/pci/Kconfig                     |    1 +
 drivers/media/pci/Makefile                    |    2 +
 drivers/media/pci/prospero/Kconfig            |    7 +
 drivers/media/pci/prospero/Makefile           |    7 +
 drivers/media/pci/prospero/prospero_common.h  |  264 ++++
 drivers/media/pci/prospero/prospero_fe.h      |    5 +
 drivers/media/pci/prospero/prospero_fe_main.c |  466 ++++++
 drivers/media/pci/prospero/prospero_i2c.c     |  449 ++++++
 drivers/media/pci/prospero/prospero_i2c.h     |    3 +
 drivers/media/pci/prospero/prospero_ir.c      |  150 ++
 drivers/media/pci/prospero/prospero_ir.h      |    4 +
 drivers/media/pci/prospero/prospero_main.c    | 2086 +++++++++++++++++++++++++
 12 files changed, 3444 insertions(+)
 create mode 100644 drivers/media/pci/prospero/Kconfig
 create mode 100644 drivers/media/pci/prospero/Makefile
 create mode 100644 drivers/media/pci/prospero/prospero_common.h
 create mode 100644 drivers/media/pci/prospero/prospero_fe.h
 create mode 100644 drivers/media/pci/prospero/prospero_fe_main.c
 create mode 100644 drivers/media/pci/prospero/prospero_i2c.c
 create mode 100644 drivers/media/pci/prospero/prospero_i2c.h
 create mode 100644 drivers/media/pci/prospero/prospero_ir.c
 create mode 100644 drivers/media/pci/prospero/prospero_ir.h
 create mode 100644 drivers/media/pci/prospero/prospero_main.c
drivers/media/pci/Kconfig +1 -0
index 218144a..5c7c356 100644
@@ -46,6 +46,7 @@ source "drivers/media/pci/pt3/Kconfig"
 source "drivers/media/pci/mantis/Kconfig"
 source "drivers/media/pci/ngene/Kconfig"
 source "drivers/media/pci/ddbridge/Kconfig"
+source "drivers/media/pci/prospero/Kconfig"
 source "drivers/media/pci/smipcie/Kconfig"
 endif
 
drivers/media/pci/Makefile +2 -0
index 0baf0d2..d792604 100644
@@ -11,6 +11,7 @@ obj-y        +=	ttpci/		\
 		mantis/		\
 		ngene/		\
 		ddbridge/	\
+		prospero/	\
 		saa7146/	\
 		smipcie/
 
@@ -26,4 +27,5 @@ obj-$(CONFIG_VIDEO_SAA7164) += saa7164/
 obj-$(CONFIG_VIDEO_TW68) += tw68/
 obj-$(CONFIG_VIDEO_MEYE) += meye/
 obj-$(CONFIG_STA2X11_VIP) += sta2x11/
+obj-$(CONFIG_PROSPERO) += prospero/
 obj-$(CONFIG_VIDEO_SOLO6X10) += solo6x10/
drivers/media/pci/prospero/Kconfig new file +7 -0
new file mode 100644
index 0000000..960f370
@@ -0,0 +1,7 @@
+config DVB_PROSPERO
+	tristate "Prospero cards"
+	depends on DVB_CORE && PCI
+	help
+      Support for PCIe DVB-T cards from Prospero Technologies Ltd.
+
+	  Say Y or M if you own such a device and want to use it.
drivers/media/pci/prospero/Makefile new file +7 -0
new file mode 100644
index 0000000..ea35912
@@ -0,0 +1,7 @@
+obj-m := prospero.o
+prospero-objs := prospero_main.o prospero_fe_main.o prospero_i2c.o prospero_ir.o
+
+ccflags-y += -Idrivers/media/common/tuners
+ccflags-y += -Idrivers/media/dvb-core
+ccflags-y += -Idrivers/media/dvb-frontends
+ccflags-y += -Idrivers/media/pci/prospero
drivers/media/pci/prospero/prospero_common.h new file +264 -0

264 lines not on this page · raw message

drivers/media/pci/prospero/prospero_fe.h new file +5 -0
new file mode 100644
index 0000000..c2aefa3
@@ -0,0 +1,5 @@
+
+#include <linux/dvb/frontend.h>
+#include "dvb_frontend.h"
+
+extern int prospero_frontend_init(struct prospero_device *p);
drivers/media/pci/prospero/prospero_fe_main.c new file +466 -0

466 lines not on this page · raw message

drivers/media/pci/prospero/prospero_i2c.c new file +449 -0

449 lines not on this page · raw message

drivers/media/pci/prospero/prospero_i2c.h new file +3 -0
new file mode 100644
index 0000000..19f65d2
@@ -0,0 +1,3 @@
+#include "prospero_common.h"
+
+int prospero_i2c_init(struct prospero_device *p);
drivers/media/pci/prospero/prospero_ir.c new file +150 -0

150 lines not on this page · raw message

drivers/media/pci/prospero/prospero_ir.h new file +4 -0
new file mode 100644
index 0000000..fa8cee3
@@ -0,0 +1,4 @@
+#include "prospero_common.h"
+
+void ir_interrupt(struct prospero_pci *p_pci);
+int prospero_ir_init(struct prospero_device *p);
drivers/media/pci/prospero/prospero_main.c new file +2086 -0

1,626 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.1.4

Part of the diff is not shown here. View the raw message.

#2 lore raw
Quoted 5 lines · Philip Downer

This patch adds support for the Vortex 1 PCIe card from Prospero Technologies Ltd. The Vortex 1 supports up to 8 tuner modules and currently ships with 8xDibcom 7090p tuners. The card also has raw infra-red support and a hardware demuxer.

-snip-

Quoted 30 lines
drivers/media/pci/prospero/prospero_ir.c new file +24 -0
new file mode 100644
index 0000000..01e5204
@@ -0,0 +1,150 @@
+/*
+ *  Infra-red driver for PCIe DVB cards from Prospero Technology Ltd.
+ *
+ *  Copyright Prospero Technology Ltd. 2014
+ *  Written/Maintained by Philip Downer
+ *  Contact: [email protected]
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ */
+
+#include <media/rc-core.h>
+#include "prospero_ir.h"
+
+#define DURATION_MASK 0x7FFFF
+#define PULSE_MASK 0x1000000

drivers/media/pci/prospero/prospero_ir.c line 34

Quoted 10 lines
drivers/media/pci/prospero/prospero_ir.c new file +10 -0
+#define FIFO_FILL_MASK 0xFF
+
+#define FIFO_FILL 0x60
+#define FIFO 0x64
+
+struct prospero_IR {
+	struct prospero_device *pdev;
+	struct rc_dev *dev;
+
+	int users;

The users field is never used.

Quoted 11 lines
drivers/media/pci/prospero/prospero_ir.c new file +11 -0
+
+	char name[32];
+	char phys[32];
+};
+
+static int prospero_ir_open(struct rc_dev *rc)
+{
+	struct prospero_device *p = rc->priv;
+
+	p->ir->users++;
+	return 0;

drivers/media/pci/prospero/prospero_ir.c line 55

Quoted 10 lines
drivers/media/pci/prospero/prospero_ir.c new file +10 -0
+
+}
+
+static void prospero_ir_close(struct rc_dev *rc)
+{
+	struct prospero_device *p = rc->priv;
+
+	p->ir->users--;
+
+}

Since the users field is never read these functions are unnecessary and can be removed.

Quoted 66 lines
drivers/media/pci/prospero/prospero_ir.c new file +66 -0
+
+void ir_interrupt(struct prospero_pci *p_pci)
+{
+
+	struct prospero_device *p = p_pci->p_dev;
+	struct prospero_IR *ir = p->ir;
+	struct ir_raw_event ev;
+	int tmp = 0;
+	int fill = 0;
+	int pulse = 0;
+	int duration = 0;
+
+	pr_debug("Infra: Interrupt!\n");
+
+	tmp = ioread32(p_pci->io_mem + FIFO_FILL);
+	fill = tmp & FIFO_FILL_MASK;
+
+	init_ir_raw_event(&ev);
+
+	while (fill > 0) {
+
+		pr_debug("Infra: fifo fill = %d\n", fill);
+
+		tmp = ioread32(p_pci->io_mem + FIFO);
+		pr_debug("Infra: raw dump = 0x%x\n", tmp);
+		pulse = (tmp & PULSE_MASK) >> 24;
+		duration = (tmp & DURATION_MASK) * 1000;	/* Convert uS to nS */
+
+		pr_debug("Infra: pulse = %d; duration = %d\n", pulse, duration);
+
+		ev.pulse = pulse;
+		ev.duration = duration;
+		ir_raw_event_store_with_filter(ir->dev, &ev);
+		fill--;
+	}
+	ir_raw_event_handle(ir->dev);
+
+}
+
+int prospero_ir_init(struct prospero_device *p)
+{
+
+	struct prospero_pci *p_pci = p->bus_specific;
+	struct pci_dev *pci = p_pci->pcidev;
+	struct prospero_IR *ir;
+	struct rc_dev *dev;
+	int err = -ENOMEM;
+
+	ir = kzalloc(sizeof(*ir), GFP_KERNEL);
+
+	dev = rc_allocate_device();
+
+	if (!ir || !dev)
+		goto err_out_free;
+
+	ir->dev = dev;
+
+	snprintf(ir->name, sizeof(ir->name), "prospero IR");
+	snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", pci_name(pci));
+
+	dev->input_name = ir->name;
+	dev->input_phys = ir->phys;
+	dev->input_id.bustype = BUS_PCI;
+	dev->input_id.version = 1;
+	dev->input_id.vendor = pci->vendor;
+	dev->input_id.product = pci->device;

drivers/media/pci/prospero/prospero_ir.c line 131

Quoted 10 lines
drivers/media/pci/prospero/prospero_ir.c new file +10 -0
+
+	dev->dev.parent = &pci->dev;
+	dev->map_name = RC_MAP_LIRC;
+
+	dev->driver_name = "prospero";
+	dev->priv = p;
+	dev->open = prospero_ir_open;
+	dev->close = prospero_ir_close;
+	dev->driver_type = RC_DRIVER_IR_RAW;
+	dev->timeout = 10 * 1000 * 1000;

If you know the rx_resolution, please provide it. The lirc interface can query it.

Quoted 9 lines
drivers/media/pci/prospero/prospero_ir.c new file +9 -0
+
+	iowrite32(0x12000, p_pci->io_mem + FIFO_FILL);
+
+	ir->pdev = p;
+	p->ir = ir;
+
+	err = rc_register_device(dev);
+	if (err)
+		goto err_out_free;

drivers/media/pci/prospero/prospero_ir.c line 150

Quoted 10 lines
drivers/media/pci/prospero/prospero_ir.c new file +10 -0
+
+	return 0;
+
+ err_out_free:
+	rc_free_device(dev);
+	p->ir = NULL;
+	kfree(ir);
+	return -ENOMEM;
+
+}

Thanks

Sean

#3 lore raw
Quoted 166 lines · Sean Young
Quoted 5 lines · Philip Downer

This patch adds support for the Vortex 1 PCIe card from Prospero Technologies Ltd. The Vortex 1 supports up to 8 tuner modules and currently ships with 8xDibcom 7090p tuners. The card also has raw infra-red support and a hardware demuxer.

-snip-

Quoted 30 lines
drivers/media/pci/prospero/prospero_ir.c new file +24 -0
new file mode 100644
index 0000000..01e5204
@@ -0,0 +1,150 @@
+/*
+ *  Infra-red driver for PCIe DVB cards from Prospero Technology Ltd.
+ *
+ *  Copyright Prospero Technology Ltd. 2014
+ *  Written/Maintained by Philip Downer
+ *  Contact: [email protected]
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ */
+
+#include <media/rc-core.h>
+#include "prospero_ir.h"
+
+#define DURATION_MASK 0x7FFFF
+#define PULSE_MASK 0x1000000

drivers/media/pci/prospero/prospero_ir.c line 34

Quoted 10 lines
drivers/media/pci/prospero/prospero_ir.c new file +10 -0
+#define FIFO_FILL_MASK 0xFF
+
+#define FIFO_FILL 0x60
+#define FIFO 0x64
+
+struct prospero_IR {
+     struct prospero_device *pdev;
+     struct rc_dev *dev;
+
+     int users;

The users field is never used.

Quoted 11 lines
drivers/media/pci/prospero/prospero_ir.c new file +11 -0
+
+     char name[32];
+     char phys[32];
+};
+
+static int prospero_ir_open(struct rc_dev *rc)
+{
+     struct prospero_device *p = rc->priv;
+
+     p->ir->users++;
+     return 0;

drivers/media/pci/prospero/prospero_ir.c line 55

Quoted 10 lines
drivers/media/pci/prospero/prospero_ir.c new file +10 -0
+
+}
+
+static void prospero_ir_close(struct rc_dev *rc)
+{
+     struct prospero_device *p = rc->priv;
+
+     p->ir->users--;
+
+}

Since the users field is never read these functions are unnecessary and can be removed.

Quoted 66 lines
drivers/media/pci/prospero/prospero_ir.c new file +66 -0
+
+void ir_interrupt(struct prospero_pci *p_pci)
+{
+
+     struct prospero_device *p = p_pci->p_dev;
+     struct prospero_IR *ir = p->ir;
+     struct ir_raw_event ev;
+     int tmp = 0;
+     int fill = 0;
+     int pulse = 0;
+     int duration = 0;
+
+     pr_debug("Infra: Interrupt!\n");
+
+     tmp = ioread32(p_pci->io_mem + FIFO_FILL);
+     fill = tmp & FIFO_FILL_MASK;
+
+     init_ir_raw_event(&ev);
+
+     while (fill > 0) {
+
+             pr_debug("Infra: fifo fill = %d\n", fill);
+
+             tmp = ioread32(p_pci->io_mem + FIFO);
+             pr_debug("Infra: raw dump = 0x%x\n", tmp);
+             pulse = (tmp & PULSE_MASK) >> 24;
+             duration = (tmp & DURATION_MASK) * 1000;        /* Convert uS to nS */
+
+             pr_debug("Infra: pulse = %d; duration = %d\n", pulse, duration);
+
+             ev.pulse = pulse;
+             ev.duration = duration;
+             ir_raw_event_store_with_filter(ir->dev, &ev);
+             fill--;
+     }
+     ir_raw_event_handle(ir->dev);
+
+}
+
+int prospero_ir_init(struct prospero_device *p)
+{
+
+     struct prospero_pci *p_pci = p->bus_specific;
+     struct pci_dev *pci = p_pci->pcidev;
+     struct prospero_IR *ir;
+     struct rc_dev *dev;
+     int err = -ENOMEM;
+
+     ir = kzalloc(sizeof(*ir), GFP_KERNEL);
+
+     dev = rc_allocate_device();
+
+     if (!ir || !dev)
+             goto err_out_free;
+
+     ir->dev = dev;
+
+     snprintf(ir->name, sizeof(ir->name), "prospero IR");
+     snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", pci_name(pci));
+
+     dev->input_name = ir->name;
+     dev->input_phys = ir->phys;
+     dev->input_id.bustype = BUS_PCI;
+     dev->input_id.version = 1;
+     dev->input_id.vendor = pci->vendor;
+     dev->input_id.product = pci->device;

drivers/media/pci/prospero/prospero_ir.c line 131

Quoted 10 lines
drivers/media/pci/prospero/prospero_ir.c new file +10 -0
+
+     dev->dev.parent = &pci->dev;
+     dev->map_name = RC_MAP_LIRC;
+
+     dev->driver_name = "prospero";
+     dev->priv = p;
+     dev->open = prospero_ir_open;
+     dev->close = prospero_ir_close;
+     dev->driver_type = RC_DRIVER_IR_RAW;
+     dev->timeout = 10 * 1000 * 1000;

If you know the rx_resolution, please provide it. The lirc interface can query it.

Quoted 11 lines
drivers/media/pci/prospero/prospero_ir.c new file +11 -0
+
+     iowrite32(0x12000, p_pci->io_mem + FIFO_FILL);
+
+     ir->pdev = p;
+     p->ir = ir;
+
+     err = rc_register_device(dev);
+     if (err)
+             goto err_out_free;
+
+     return 0;
Quoted 8 lines

drivers/media/pci/prospero/prospero_ir.c line 150

Quoted 8 lines
drivers/media/pci/prospero/prospero_ir.c new file +8 -0
+
+ err_out_free:
+     rc_free_device(dev);
+     p->ir = NULL;
+     kfree(ir);
+     return -ENOMEM;
+
+}

Thanks For your feedback Sean, I'll make those changes.

regards,

Signature · 2 lines
Philip Downer
[email protected]
#4 lore raw
In reply to Philip Downer

On Mon, Feb 16, 2015 at 07:48:46PM +0000, Philip Downer wrote:
-snip-

Quoted 9 lines
drivers/media/pci/prospero/prospero_ir.c new file +9 -0
+	dev = rc_allocate_device();
+
+	if (!ir || !dev)
+		goto err_out_free;
+
+	ir->dev = dev;
+
+	snprintf(ir->name, sizeof(ir->name), "prospero IR");
+	snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", pci_name(pci));

drivers/media/pci/prospero/prospero_ir.c line 124

Quoted 10 lines
drivers/media/pci/prospero/prospero_ir.c new file +10 -0
+
+	dev->input_name = ir->name;
+	dev->input_phys = ir->phys;
+	dev->input_id.bustype = BUS_PCI;
+	dev->input_id.version = 1;
+	dev->input_id.vendor = pci->vendor;
+	dev->input_id.product = pci->device;
+
+	dev->dev.parent = &pci->dev;
+	dev->map_name = RC_MAP_LIRC;

RC_MAP_LIRC isn't really a useful default; no remote will work with that. Other drivers default to RC_MAP_RC6_MCE if no remote was provided with the product. I don't know if this is good choice, but at least it is consistent.

drivers/media/pci/prospero/prospero_ir.c line 131

Quoted 7 lines
drivers/media/pci/prospero/prospero_ir.c new file +7 -0
+
+	dev->driver_name = "prospero";
+	dev->priv = p;
+	dev->open = prospero_ir_open;
+	dev->close = prospero_ir_close;
+	dev->driver_type = RC_DRIVER_IR_RAW;
+	dev->timeout = 10 * 1000 * 1000;

There is a MS_TO_NS() macro for this.

Sean

#5 lore raw
Quoted 35 lines · Sean Young

On Mon, Feb 16, 2015 at 07:48:46PM +0000, Philip Downer wrote:
-snip-

Quoted 9 lines
drivers/media/pci/prospero/prospero_ir.c new file +9 -0
+     dev = rc_allocate_device();
+
+     if (!ir || !dev)
+             goto err_out_free;
+
+     ir->dev = dev;
+
+     snprintf(ir->name, sizeof(ir->name), "prospero IR");
+     snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", pci_name(pci));

drivers/media/pci/prospero/prospero_ir.c line 124

Quoted 10 lines
drivers/media/pci/prospero/prospero_ir.c new file +10 -0
+
+     dev->input_name = ir->name;
+     dev->input_phys = ir->phys;
+     dev->input_id.bustype = BUS_PCI;
+     dev->input_id.version = 1;
+     dev->input_id.vendor = pci->vendor;
+     dev->input_id.product = pci->device;
+
+     dev->dev.parent = &pci->dev;
+     dev->map_name = RC_MAP_LIRC;

RC_MAP_LIRC isn't really a useful default; no remote will work with that. Other drivers default to RC_MAP_RC6_MCE if no remote was provided with the product. I don't know if this is good choice, but at least it is consistent.

drivers/media/pci/prospero/prospero_ir.c line 131

Quoted 7 lines
drivers/media/pci/prospero/prospero_ir.c new file +7 -0
+
+     dev->driver_name = "prospero";
+     dev->priv = p;
+     dev->open = prospero_ir_open;
+     dev->close = prospero_ir_close;
+     dev->driver_type = RC_DRIVER_IR_RAW;
+     dev->timeout = 10 * 1000 * 1000;
Quoted 1 line

There is a MS_TO_NS() macro for this.

Ok, thanks Sean, those changes have been made and will be included when I submit the next RFC patch.

Thanks again,

Signature · 3 lines
Philip Downer
+44 (0)7879 470 969
[email protected]
#6 lore raw
In reply to Philip Downer

Moikka!

Quoted 27 lines · Philip Downer

The Vortex PCIe card by Prospero Technologies Ltd is a modular DVB card with a hardware demux, the card can support up to 8 modules which are fixed to the board at assembly time. Currently we only offer one configuration, 8 x Dibcom 7090p DVB-t tuners, but we will soon be releasing other configurations. There is also a connector for an infra-red receiver dongle on the board which supports RAW IR.

The driver has been in testing on our systems (ARM Cortex-A9, Marvell Sheva, x86, x86-64) for longer than 6 months, so I'm confident that it works. However as this is the first Linux driver I've written, I'm sure there are some things that I've got wrong. One thing in particular which has been raised by one of our early testers is that we currently register all of our frontends as being attached to one adapter. This means the device is enumerated in /dev like this:

/dev/dvb/adapter0/frontend0
/dev/dvb/adapter0/dvr0
/dev/dvb/adapter0/demux0

/dev/dvb/adapter0/frontend1
/dev/dvb/adapter0/dvr1
/dev/dvb/adapter0/demux1

/dev/dvb/adapter0/frontend2
/dev/dvb/adapter0/dvr2
/dev/dvb/adapter0/demux2

Quoted 6 lines

etc.

Whilst I think this is ok according to the spec, our tester has complained that it's incompatible with their software which expects to find just one frontend per adapter. So I'm wondering if someone could confirm if what I've done with regards to this is correct.

As I understand all those tuners are independent (could be used same time) you should register those as a 8 adapters, each having single frontend, dvr and demux.

regards
Antti

Quoted 38 lines

I've tested this patch by applying it to current media-master and it applies cleanly and builds without issue for me.

More information on the card can be found at:
http://prospero-tech.com/vortex-1-dvb-t-pcie-card/

Regards,

Philip Downer

Philip Downer (1):
[media] pci: Add support for DVB PCIe cards from Prospero Technologies
Ltd.

  drivers/media/pci/Kconfig                     |    1 +
  drivers/media/pci/Makefile                    |    2 +
  drivers/media/pci/prospero/Kconfig            |    7 +
  drivers/media/pci/prospero/Makefile           |    7 +
  drivers/media/pci/prospero/prospero_common.h  |  264 ++++
  drivers/media/pci/prospero/prospero_fe.h      |    5 +
  drivers/media/pci/prospero/prospero_fe_main.c |  466 ++++++
  drivers/media/pci/prospero/prospero_i2c.c     |  449 ++++++
  drivers/media/pci/prospero/prospero_i2c.h     |    3 +
  drivers/media/pci/prospero/prospero_ir.c      |  150 ++
  drivers/media/pci/prospero/prospero_ir.h      |    4 +
  drivers/media/pci/prospero/prospero_main.c    | 2086 +++++++++++++++++++++++++
  12 files changed, 3444 insertions(+)

create mode 100644 drivers/media/pci/prospero/Kconfig create mode 100644 drivers/media/pci/prospero/Makefile create mode 100644 drivers/media/pci/prospero/prospero_common.h create mode 100644 drivers/media/pci/prospero/prospero_fe.h create mode 100644 drivers/media/pci/prospero/prospero_fe_main.c create mode 100644 drivers/media/pci/prospero/prospero_i2c.c create mode 100644 drivers/media/pci/prospero/prospero_i2c.h create mode 100644 drivers/media/pci/prospero/prospero_ir.c create mode 100644 drivers/media/pci/prospero/prospero_ir.h create mode 100644 drivers/media/pci/prospero/prospero_main.c

Signature · 1 line
http://palosaari.fi/
#7 lore raw

Hi Antti,

Quoted 42 lines · Antti Palosaari

Moikka!

Quoted 30 lines · Philip Downer

The Vortex PCIe card by Prospero Technologies Ltd is a modular DVB card with a hardware demux, the card can support up to 8 modules which are fixed to the board at assembly time. Currently we only offer one configuration, 8 x Dibcom 7090p DVB-t tuners, but we will soon be releasing
other configurations. There is also a connector for an infra-red receiver dongle on the board which supports RAW IR.

The driver has been in testing on our systems (ARM Cortex-A9, Marvell Sheva,
x86, x86-64) for longer than 6 months, so I'm confident that it works. However as this is the first Linux driver I've written, I'm sure there are some things that I've got wrong. One thing in particular which has been raised by one of our early testers is that we currently register all of our frontends as being attached to one adapter. This means the device is enumerated in /dev like this:

/dev/dvb/adapter0/frontend0
/dev/dvb/adapter0/dvr0
/dev/dvb/adapter0/demux0

/dev/dvb/adapter0/frontend1
/dev/dvb/adapter0/dvr1
/dev/dvb/adapter0/demux1

/dev/dvb/adapter0/frontend2
/dev/dvb/adapter0/dvr2
/dev/dvb/adapter0/demux2

Quoted 6 lines

etc.

Whilst I think this is ok according to the spec, our tester has complained that it's incompatible with their software which expects to find just one frontend per adapter. So I'm wondering if someone could confirm if what I've done with regards to this is correct.

Quoted 3 lines

As I understand all those tuners are independent (could be used same time) you should register those as a 8 adapters, each having single frontend, dvr and demux.

Yes, all those tuners can be operated independently. So would I be correct in saying that in Linux an adapter is an independent tuner?

In that case the only time you would have frontend0, frontend1 etc is when there is a single dvb source that is switched between tuners?

Signature · 3 lines
Philip Downer
+44 (0)7879 470 969
[email protected]
#8 lore raw
In reply to Antti Palosaari

Em Mon, 16 Feb 2015 22:01:07 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 32 lines

Moikka!

Quoted 29 lines · Philip Downer

The Vortex PCIe card by Prospero Technologies Ltd is a modular DVB card with a hardware demux, the card can support up to 8 modules which are fixed to the board at assembly time. Currently we only offer one configuration, 8 x Dibcom 7090p DVB-t tuners, but we will soon be releasing other configurations. There is also a connector for an infra-red receiver dongle on the board which supports RAW IR.

The driver has been in testing on our systems (ARM Cortex-A9, Marvell Sheva, x86, x86-64) for longer than 6 months, so I'm confident that it works. However as this is the first Linux driver I've written, I'm sure there are some things that I've got wrong. One thing in particular which has been raised by one of our early testers is that we currently register all of our frontends as being attached to one adapter. This means the device is enumerated in /dev like this:

/dev/dvb/adapter0/frontend0
/dev/dvb/adapter0/dvr0
/dev/dvb/adapter0/demux0

/dev/dvb/adapter0/frontend1
/dev/dvb/adapter0/dvr1
/dev/dvb/adapter0/demux1

/dev/dvb/adapter0/frontend2
/dev/dvb/adapter0/dvr2
/dev/dvb/adapter0/demux2

etc.

Quoted 8 lines
Quoted 4 lines

Whilst I think this is ok according to the spec, our tester has complained that it's incompatible with their software which expects to find just one frontend per adapter. So I'm wondering if someone could confirm if what I've done with regards to this is correct.

As I understand all those tuners are independent (could be used same time) you should register those as a 8 adapters, each having single frontend, dvr and demux.

Yeah, creating one adapter per device is the best solution, if you can't do things like:

	frontend0 -> demux2 -> dvr5

If such configuration is allowed, then the best is to use the media controller API. The patches for it were just added. Yet, userspace programs are not aware, as this will be merged upstream only for Kernel 3.21. For now, the media controller API is still experimental.

Regards,
Mauro

Quoted 43 lines

regards
Antti

Quoted 38 lines

I've tested this patch by applying it to current media-master and it applies cleanly and builds without issue for me.

More information on the card can be found at:
http://prospero-tech.com/vortex-1-dvb-t-pcie-card/

Regards,

Philip Downer

Philip Downer (1):
[media] pci: Add support for DVB PCIe cards from Prospero Technologies
Ltd.

  drivers/media/pci/Kconfig                     |    1 +
  drivers/media/pci/Makefile                    |    2 +
  drivers/media/pci/prospero/Kconfig            |    7 +
  drivers/media/pci/prospero/Makefile           |    7 +
  drivers/media/pci/prospero/prospero_common.h  |  264 ++++
  drivers/media/pci/prospero/prospero_fe.h      |    5 +
  drivers/media/pci/prospero/prospero_fe_main.c |  466 ++++++
  drivers/media/pci/prospero/prospero_i2c.c     |  449 ++++++
  drivers/media/pci/prospero/prospero_i2c.h     |    3 +
  drivers/media/pci/prospero/prospero_ir.c      |  150 ++
  drivers/media/pci/prospero/prospero_ir.h      |    4 +
  drivers/media/pci/prospero/prospero_main.c    | 2086 +++++++++++++++++++++++++
  12 files changed, 3444 insertions(+)

create mode 100644 drivers/media/pci/prospero/Kconfig create mode 100644 drivers/media/pci/prospero/Makefile create mode 100644 drivers/media/pci/prospero/prospero_common.h create mode 100644 drivers/media/pci/prospero/prospero_fe.h create mode 100644 drivers/media/pci/prospero/prospero_fe_main.c create mode 100644 drivers/media/pci/prospero/prospero_i2c.c create mode 100644 drivers/media/pci/prospero/prospero_i2c.h create mode 100644 drivers/media/pci/prospero/prospero_ir.c create mode 100644 drivers/media/pci/prospero/prospero_ir.h create mode 100644 drivers/media/pci/prospero/prospero_main.c

#9 lore raw

Hi Mauro,

Quoted 40 lines · Mauro Carvalho Chehab

Em Mon, 16 Feb 2015 22:01:07 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 37 lines

Moikka!

Quoted 33 lines · Philip Downer

The Vortex PCIe card by Prospero Technologies Ltd is a modular DVB card with a hardware demux, the card can support up to 8 modules which are fixed to the board at assembly time. Currently we only offer one configuration, 8 x Dibcom 7090p DVB-t tuners, but we will soon be releasing other configurations. There is also a connector for an infra-red receiver dongle on the board which supports RAW IR.

The driver has been in testing on our systems (ARM Cortex-A9, Marvell Sheva, x86, x86-64) for longer than 6 months, so I'm confident that it works. However as this is the first Linux driver I've written, I'm sure there are some things that I've got wrong. One thing in particular which has been raised by one of our early testers is that we currently register all of our frontends as being attached to one adapter. This means the device is enumerated in /dev like this:

/dev/dvb/adapter0/frontend0
/dev/dvb/adapter0/dvr0
/dev/dvb/adapter0/demux0

/dev/dvb/adapter0/frontend1
/dev/dvb/adapter0/dvr1
/dev/dvb/adapter0/demux1

/dev/dvb/adapter0/frontend2
/dev/dvb/adapter0/dvr2
/dev/dvb/adapter0/demux2

etc.

Whilst I think this is ok according to the spec, our tester has complained that it's incompatible with their software which expects to find just one frontend per adapter. So I'm wondering if someone could confirm if what I've done with regards to this is correct.

Quoted 8 lines
Quoted 3 lines

As I understand all those tuners are independent (could be used same time) you should register those as a 8 adapters, each having single frontend, dvr and demux.

Yeah, creating one adapter per device is the best solution, if you can't do things like:

        frontend0 -> demux2 -> dvr5

Thanks for confirming what Antti said, I'll change the driver and resubmit it.

Quoted 4 lines

If such configuration is allowed, then the best is to use the media controller API. The patches for it were just added. Yet, userspace programs are not aware, as this will be merged upstream only for Kernel 3.21. For now, the media controller API is still experimental.

Yes, I saw your patches at the weekend, we're obviously quite interested in the media controller API for dvb so I'll be looking to add support for this to the driver when I can.

Thanks.

Signature · 3 lines
Philip Downer
+44 (0)7879 470 969
[email protected]
#10 lore raw
Quoted 48 lines · Philip Downer

Hi Mauro,

Quoted 44 lines · Mauro Carvalho Chehab

Em Mon, 16 Feb 2015 22:01:07 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 40 lines

Moikka!

Quoted 27 lines · Philip Downer

The Vortex PCIe card by Prospero Technologies Ltd is a modular DVB card with a hardware demux, the card can support up to 8 modules which are fixed to the board at assembly time. Currently we only offer one configuration, 8 x Dibcom 7090p DVB-t tuners, but we will soon be releasing other configurations. There is also a connector for an infra-red receiver dongle on the board which supports RAW IR.

The driver has been in testing on our systems (ARM Cortex-A9, Marvell Sheva, x86, x86-64) for longer than 6 months, so I'm confident that it works. However as this is the first Linux driver I've written, I'm sure there are some things that I've got wrong. One thing in particular which has been raised by one of our early testers is that we currently register all of our frontends as being attached to one adapter. This means the device is enumerated in /dev like this:

/dev/dvb/adapter0/frontend0
/dev/dvb/adapter0/dvr0
/dev/dvb/adapter0/demux0

/dev/dvb/adapter0/frontend1
/dev/dvb/adapter0/dvr1
/dev/dvb/adapter0/demux1

/dev/dvb/adapter0/frontend2
/dev/dvb/adapter0/dvr2
/dev/dvb/adapter0/demux2

Quoted 6 lines

etc.

Whilst I think this is ok according to the spec, our tester has complained that it's incompatible with their software which expects to find just one frontend per adapter. So I'm wondering if someone could confirm if what I've done with regards to this is correct.

As I understand all those tuners are independent (could be used same time) you should register those as a 8 adapters, each having single frontend, dvr and demux.

Quoted 6 lines
Quoted 4 lines

Yeah, creating one adapter per device is the best solution, if you can't do things like:

         frontend0 -> demux2 -> dvr5

Thanks for confirming what Antti said, I'll change the driver and resubmit it.

Also, take care to fix issues to meet Kernel coding style and checkpatch.pl requirements where possible.

Read file Documentation/CodingStyle from kernel tree.

There is script to check some common style issues and more, also in kernel tree ./scripts/checkpatch.pl --file drivers/media/pci/your_driver_file.c

regards
Antti

Signature · 1 line
http://palosaari.fi/
#11 lore raw

Hi Antti,

Quoted 67 lines · Antti Palosaari
Quoted 66 lines · Philip Downer

Hi Mauro,

Quoted 59 lines · Mauro Carvalho Chehab

Em Mon, 16 Feb 2015 22:01:07 +0200
Antti Palosaari <[email protected]> escreveu:

Quoted 46 lines

Moikka!

Quoted 33 lines · Philip Downer

The Vortex PCIe card by Prospero Technologies Ltd is a modular DVB card with a hardware demux, the card can support up to 8 modules which are fixed to the board at assembly time. Currently we only offer one configuration, 8 x Dibcom 7090p DVB-t tuners, but we will soon be releasing
other configurations. There is also a connector for an infra-red receiver
dongle on the board which supports RAW IR.

The driver has been in testing on our systems (ARM Cortex-A9, Marvell Sheva,
x86, x86-64) for longer than 6 months, so I'm confident that it works. However as this is the first Linux driver I've written, I'm sure there are
some things that I've got wrong. One thing in particular which has been raised by one of our early testers is that we currently register all of our frontends as being attached to one adapter. This means the device is
enumerated in /dev like this:

/dev/dvb/adapter0/frontend0
/dev/dvb/adapter0/dvr0
/dev/dvb/adapter0/demux0

/dev/dvb/adapter0/frontend1
/dev/dvb/adapter0/dvr1
/dev/dvb/adapter0/demux1

/dev/dvb/adapter0/frontend2
/dev/dvb/adapter0/dvr2
/dev/dvb/adapter0/demux2

Quoted 8 lines

etc.

Whilst I think this is ok according to the spec, our tester has complained
that it's incompatible with their software which expects to find just one
frontend per adapter. So I'm wondering if someone could confirm if what I've done with regards to this is correct.

Quoted 3 lines

As I understand all those tuners are independent (could be used same time) you should register those as a 8 adapters, each having single frontend, dvr and demux.

Yeah, creating one adapter per device is the best solution, if you can't do things like:

         frontend0 -> demux2 -> dvr5
Quoted 6 lines
Quoted 2 lines

Thanks for confirming what Antti said, I'll change the driver and resubmit it.

Also, take care to fix issues to meet Kernel coding style and checkpatch.pl requirements where possible.

Sure, I had pushed this patch through checkpatch and fixed most things, the only things I'm aware of that aren't fixed are line lengths and one section with too many nested statements. However I've read that line lengths are less of an issue these days in kernel code and the section with too many nested statements came from dibcom therefore I didn't want to refactor this, at least not without a lot of testing. Please let me know if I'm wrong in my assumptions or if I've missed something in generating this patch.

Signature · 2 lines
Philip Downer
[email protected]