Skip to contentSkip to conversation

MxL5xx demodulator-tuner driver, DD MaxS8 support

PATCH In review Daniel Scheller 2 participants 10 messages Jul 9, 2017 – Aug 20, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover MxL5xx demodulator-tuner driver, DD MaxS8 support

From: Daniel Scheller <[email protected]>

Target: 4.14 seems unrealistic, so: 4.14+

Hard-dependency on the STV0910/STV6111 driver+DD support series and the DD driver bump.

This adds a driver for the MaxLinear MxL5xx tuner-demodulator series (a DVB-S/S2/DSS demodulator-tuner combo frontend) as being found on Digital Devices MaxS8 4/8 tunerport cards.

These patches conclude the tuner hardware support for all Digital Devices hardware as of dddvb-0.9.29 and gets mainline on par with the vendor driver.

Cleanup notes:

The driver was in no way submittable in it's original form: It had some very scary construct in that #define's carried multiple function para- meters (comma-separated things), which were passed to another #define, which then in turn referenced a function, like this pseudocode:

  #define REGDEF1     0x1234,2,3
  #define FNCALL      real_fn(othervar,regdef)
  function real_fn(var,reg,var1,var2,val)

  real_fn(state,REGDEF1,1);

Not only checkpatch didn't like this, but it looked heavily confusing. During cleanup, all of this obfuscation was expanded. Also, _defs.h carried all of the enums and structs as typedef's. All of this has been cleaned, together with the usual CamelCase things, whitespace and so on,
results: 55 "line len > 80 chars" in _defs.h and _regs.h (which I'd like to keep to retain readability), everything else clean. Everything else (e.g. overall code design) should be ok, but this should be judged by reviewers.

The resulting driver has been tested and works fine.

The glue code in ddbridge was added into a new object ddbridge-maxs8 to keep -core clean. It was added mostly as-is, and a little fixup commit is put ontop. LNB control is done by the bridge card in case of these cards, so that lives in the bridge driver (and is the majority of the additional object).

Thanks in advance for reviewing this.

Daniel Scheller (4):
[media] dvb-frontends: MaxLinear MxL5xx DVB-S/S2 tuner-demodulator
driver
[media] ddbridge: support MaxLinear MXL5xx based cards (MaxS4/8) [media] ddbridge: fix buffer overflow in max_set_input_unlocked() [media] MAINTAINERS: add entry for mxl5xx

 MAINTAINERS                                 |    8 +
 drivers/media/dvb-frontends/Kconfig         |    9 +
 drivers/media/dvb-frontends/Makefile        |    1 +
 drivers/media/dvb-frontends/mxl5xx.c        | 1873 +++++++++++++++++++++++++++
 drivers/media/dvb-frontends/mxl5xx.h        |   41 +
 drivers/media/dvb-frontends/mxl5xx_defs.h   |  731 +++++++++++
 drivers/media/dvb-frontends/mxl5xx_regs.h   |  367 ++++++
 drivers/media/pci/ddbridge/Kconfig          |    2 +
 drivers/media/pci/ddbridge/Makefile         |    2 +-
 drivers/media/pci/ddbridge/ddbridge-core.c  |   67 +-
 drivers/media/pci/ddbridge/ddbridge-hw.c    |   12 +
 drivers/media/pci/ddbridge/ddbridge-hw.h    |    4 +
 drivers/media/pci/ddbridge/ddbridge-main.c  |    1 +
 drivers/media/pci/ddbridge/ddbridge-maxs8.c |  444 +++++++
 drivers/media/pci/ddbridge/ddbridge-maxs8.h |   29 +
 drivers/media/pci/ddbridge/ddbridge-regs.h  |   21 +
 drivers/media/pci/ddbridge/ddbridge.h       |   11 +
 17 files changed, 3619 insertions(+), 4 deletions(-)
 create mode 100644 drivers/media/dvb-frontends/mxl5xx.c
 create mode 100644 drivers/media/dvb-frontends/mxl5xx.h
 create mode 100644 drivers/media/dvb-frontends/mxl5xx_defs.h
 create mode 100644 drivers/media/dvb-frontends/mxl5xx_regs.h
 create mode 100644 drivers/media/pci/ddbridge/ddbridge-maxs8.c
 create mode 100644 drivers/media/pci/ddbridge/ddbridge-maxs8.h
Signature · 1 line
2.13.0
#1 lore raw

PATCH 1/4 dvb-frontends: MaxLinear MxL5xx DVB-S/S2 tuner-demodulator driver

From: Daniel Scheller <[email protected]>

This adds the frontend driver for the MaxLinear MxL5xx family of tuner- demodulators, as used on Digital Devices MaxS4/8 four/eight-tuner cards.

The driver was picked from the dddvb vendor driver package and - judging solely from the diff - has undergone a 100% rework:

- Silly #define's used to pass multiple values to functions were expanded. This resulted in macro/register names not being usable anymore for such occurences, but makes the code WAY more read-, understand- and maintainable.
- CamelCase was changed to kernel_case
- All typedef were removed
- Overall code style was fixed, besides >80char lines in _defs.h and _regs.h, checkpatch is happy.
- Also, signal stat acquisition was made to comply with the DVB API ways to do these things.

Permission to reuse and mainline the driver code was formally granted by Ralph Metzler <[email protected]>.

---
 drivers/media/dvb-frontends/Kconfig       |    9 +
 drivers/media/dvb-frontends/Makefile      |    1 +
 drivers/media/dvb-frontends/mxl5xx.c      | 1873 +++++++++++++++++++++++++++++
 drivers/media/dvb-frontends/mxl5xx.h      |   41 +
 drivers/media/dvb-frontends/mxl5xx_defs.h |  731 +++++++++++
 drivers/media/dvb-frontends/mxl5xx_regs.h |  367 ++++++
 6 files changed, 3022 insertions(+)
 create mode 100644 drivers/media/dvb-frontends/mxl5xx.c
 create mode 100644 drivers/media/dvb-frontends/mxl5xx.h
 create mode 100644 drivers/media/dvb-frontends/mxl5xx_defs.h
 create mode 100644 drivers/media/dvb-frontends/mxl5xx_regs.h
drivers/media/dvb-frontends/Kconfig +9 -0
index d2d3160abdf7..2631d0e0a024 100644
@@ -53,6 +53,15 @@ config DVB_STV6111
 
 	  Say Y when you want to support these frontends.
 
+config DVB_MXL5XX
+	tristate "MaxLinear MxL5xx based tuner-demodulators"
+	depends on DVB_CORE && I2C
+	default m if !MEDIA_SUBDRV_AUTOSELECT
+	help
+	  MaxLinear MxL5xx family of DVB-S/S2 tuners/demodulators.
+
+	  Say Y when you want to support these frontends.
+
 config DVB_M88DS3103
 	tristate "Montage Technology M88DS3103"
 	depends on DVB_CORE && I2C && I2C_MUX
drivers/media/dvb-frontends/Makefile +1 -0
index e8bf1d873485..f45f6a4a4371 100644
@@ -112,6 +112,7 @@ obj-$(CONFIG_DVB_DRXK) += drxk.o
 obj-$(CONFIG_DVB_TDA18271C2DD) += tda18271c2dd.o
 obj-$(CONFIG_DVB_STV0910) += stv0910.o
 obj-$(CONFIG_DVB_STV6111) += stv6111.o
+obj-$(CONFIG_DVB_MXL5XX) += mxl5xx.o
 obj-$(CONFIG_DVB_SI2165) += si2165.o
 obj-$(CONFIG_DVB_A8293) += a8293.o
 obj-$(CONFIG_DVB_SP2) += sp2.o
drivers/media/dvb-frontends/mxl5xx.c new file +1873 -0

1,873 lines not on this page · raw message

drivers/media/dvb-frontends/mxl5xx.h new file +41 -0

41 lines not on this page · raw message

drivers/media/dvb-frontends/mxl5xx_defs.h new file +731 -0

731 lines not on this page · raw message

drivers/media/dvb-frontends/mxl5xx_regs.h new file +367 -0

333 lines not on this page · raw message

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

Signature · 1 line
2.13.0

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

#4 lore raw

PATCH 2/4 ddbridge: support MaxLinear MXL5xx based cards (MaxS4/8)

In reply to Daniel Scheller

From: Daniel Scheller <[email protected]>

This enables MaxS4/S8 and Octopus Max card support in ddbridge by adding glue code into ddbridge-core, having another PCI ID, and have the LNB IC control code (and all other MaxS4/8 related code) in ddbridge-maxs8.c (rather than another ~400 LoC in ddbridge-core.c like it's done in the original vendor driver package).

---
 drivers/media/pci/ddbridge/Kconfig          |   2 +
 drivers/media/pci/ddbridge/Makefile         |   2 +-
 drivers/media/pci/ddbridge/ddbridge-core.c  |  67 ++++-
 drivers/media/pci/ddbridge/ddbridge-hw.c    |  12 +
 drivers/media/pci/ddbridge/ddbridge-hw.h    |   4 +
 drivers/media/pci/ddbridge/ddbridge-main.c  |   1 +
 drivers/media/pci/ddbridge/ddbridge-maxs8.c | 443 ++++++++++++++++++++++++++++
 drivers/media/pci/ddbridge/ddbridge-maxs8.h |  29 ++
 drivers/media/pci/ddbridge/ddbridge-regs.h  |  21 ++
 drivers/media/pci/ddbridge/ddbridge.h       |  11 +
 10 files changed, 588 insertions(+), 4 deletions(-)
 create mode 100644 drivers/media/pci/ddbridge/ddbridge-maxs8.c
 create mode 100644 drivers/media/pci/ddbridge/ddbridge-maxs8.h
drivers/media/pci/ddbridge/Kconfig +2 -0
index 1330b2ecc72a..f43d0b83fc0c 100644
@@ -12,6 +12,7 @@ config DVB_DDBRIDGE
 	select DVB_STV6111 if MEDIA_SUBDRV_AUTOSELECT
 	select DVB_LNBH25 if MEDIA_SUBDRV_AUTOSELECT
 	select MEDIA_TUNER_TDA18212 if MEDIA_SUBDRV_AUTOSELECT
+	select DVB_MXL5XX if MEDIA_SUBDRV_AUTOSELECT
 	---help---
 	  Support for cards with the Digital Devices PCI express bridge:
 	  - Octopus PCIe Bridge
@@ -24,6 +25,7 @@ config DVB_DDBRIDGE
 	  - CineCTv7 and DuoFlex CT2/C2T2/C2T2I (Sony CXD28xx-based)
 	  - MaxA8 series
 	  - CineS2 V7/V7A and DuoFlex S2 V4 (ST STV0910-based)
+	  - Max S4/8
 
 	  Say Y if you own such a card and want to use it.
 
drivers/media/pci/ddbridge/Makefile +1 -1
index c4d8d6261243..caf03a82f6b1 100644
@@ -3,7 +3,7 @@
 #
 
 ddbridge-objs := ddbridge-main.o ddbridge-core.o ddbridge-hw.o \
-		ddbridge-i2c.o ddbridge-irq.o
+		ddbridge-i2c.o ddbridge-irq.o ddbridge-maxs8.o
 
 obj-$(CONFIG_DVB_DDBRIDGE) += ddbridge.o
 
drivers/media/pci/ddbridge/ddbridge-core.c +64 -3

127 lines not on this page · raw message

drivers/media/pci/ddbridge/ddbridge-hw.c +12 -0
index e35b41e8d860..317dc865e99c 100644
@@ -297,3 +297,15 @@ const struct ddb_info ddb_c2t2i_8 = {
 	.ts_quirks = TS_QUIRK_SERIAL,
 	.tempmon_irq = 24,
 };
+
+/****************************************************************************/
+
+const struct ddb_info ddb_s2_48 = {
+	.type     = DDB_OCTOPUS_MAX,
+	.name     = "Digital Devices MAX S8 4/8",
+	.regmap   = &octopus_map,
+	.port_num = 4,
+	.i2c_mask = 0x01,
+	.board_control = 1,
+	.tempmon_irq = 24,
+};
drivers/media/pci/ddbridge/ddbridge-hw.h +4 -0
index bd52c083c4a5..d26cd9c977d8 100644
@@ -49,4 +49,8 @@ extern const struct ddb_info ddb_isdbt_8;
 extern const struct ddb_info ddb_c2t2i_v0_8;
 extern const struct ddb_info ddb_c2t2i_8;
 
+/****************************************************************************/
+
+extern const struct ddb_info ddb_s2_48;
+
 #endif /* _DDBRIDGE_HW_H */
drivers/media/pci/ddbridge/ddbridge-main.c +1 -0
index 83643bc21d09..4bb238ba6339 100644
@@ -312,6 +312,7 @@ static const struct pci_device_id ddb_id_table[] = {
 	DDB_DEVICE(0x0006, 0x0031, ddb_ctv7),
 	DDB_DEVICE(0x0006, 0x0032, ddb_ctv7),
 	DDB_DEVICE(0x0006, 0x0033, ddb_ctv7),
+	DDB_DEVICE(0x0007, 0x0023, ddb_s2_48),
 	DDB_DEVICE(0x0008, 0x0034, ddb_ct2_8),
 	DDB_DEVICE(0x0008, 0x0035, ddb_c2t2_8),
 	DDB_DEVICE(0x0008, 0x0036, ddb_isdbt_8),
drivers/media/pci/ddbridge/ddbridge-maxs8.c new file +443 -0

443 lines not on this page · raw message

drivers/media/pci/ddbridge/ddbridge-maxs8.h new file +29 -0
new file mode 100644
index 000000000000..bb8884811a46
@@ -0,0 +1,29 @@
+/*
+ * ddbridge-maxs8.h: Digital Devices bridge MaxS4/8 support
+ *
+ * Copyright (C) 2010-2017 Digital Devices GmbH
+ *                         Ralph Metzler <[email protected]>
+ *                         Marcus Metzler <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 only, as published by the Free Software Foundation.
+ *
+ * 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.
+ *
+ */
+
+#ifndef _DDBRIDGE_MAXS8_H_
+#define _DDBRIDGE_MAXS8_H_
+
+#include "ddbridge.h"
+
+/******************************************************************************/
+
+int lnb_init_fmode(struct ddb *dev, struct ddb_link *link, u32 fm);
+int fe_attach_mxl5xx(struct ddb_input *input);
+
+#endif /* _DDBRIDGE_MAXS8_H */
drivers/media/pci/ddbridge/ddbridge-regs.h +21 -0
index 73a40f847318..391e601ac78f 100644
@@ -133,3 +133,24 @@
 #define CI_BUFFER_SIZE                  (0x0800)
 
 #define CI_BUFFER(i)                  (CI_BUFFER_BASE + (i) * CI_BUFFER_SIZE)
+
+/* ------------------------------------------------------------------------- */
+/* LNB commands (mxl5xx / Max S8) */
+
+#define LNB_BASE			(0x400)
+#define LNB_CONTROL(i)			(LNB_BASE + (i) * 0x20 + 0x00)
+
+#define LNB_CMD				(7ULL <<  0)
+#define LNB_CMD_NOP			0
+#define LNB_CMD_INIT			1
+#define LNB_CMD_LOW			3
+#define LNB_CMD_HIGH			4
+#define LNB_CMD_OFF			5
+#define LNB_CMD_DISEQC			6
+
+#define LNB_BUSY			(1ULL <<  4)
+#define LNB_TONE			(1ULL << 15)
+
+#define LNB_BUF_LEVEL(i)		(LNB_BASE + (i) * 0x20 + 0x10)
+#define LNB_BUF_WRITE(i)		(LNB_BASE + (i) * 0x20 + 0x14)
+
drivers/media/pci/ddbridge/ddbridge.h +11 -0
index 96a904516627..038ecae3fd18 100644
@@ -115,6 +115,7 @@ struct ddb_info {
 #define DDB_NONE         0
 #define DDB_OCTOPUS      1
 #define DDB_OCTOPUS_CI   2
+#define DDB_OCTOPUS_MAX  5
 #define DDB_OCTOPUS_MAX_CT  6
 	char *name;
 	u32   i2c_mask;
@@ -295,6 +296,15 @@ struct ddb_port {
 
 #define TS_CAPTURE_LEN  (4096)
 
+struct ddb_lnb {
+	struct mutex           lock;
+	u32                    tone;
+	enum fe_sec_voltage    oldvoltage[4];
+	u32                    voltage[4];
+	u32                    voltages;
+	u32                    fmode;
+};
+
 struct ddb_link {
 	struct ddb            *dev;
 	struct ddb_info       *info;
@@ -302,6 +312,7 @@ struct ddb_link {
 	u32                    regs;
 	spinlock_t             lock;
 	struct mutex           flash_mutex;
+	struct ddb_lnb         lnb;
 	struct tasklet_struct  tasklet;
 	struct ddb_ids         ids;
 
Signature · 1 line
2.13.0
#5 lore raw

PATCH 3/4 ddbridge: fix buffer overflow in max_set_input_unlocked()

In reply to Daniel Scheller

From: Daniel Scheller <[email protected]>

Picked up code parts introduced one smatch error:

drivers/media/pci/ddbridge/ddbridge-maxs8.c:163 max_set_input_unlocked() error: buffer overflow 'dev->link[port->lnr].lnb.voltage' 4 <= 255

Fix this by clamping the .lnb.voltage array access to 0-3 by "& 3"'ing dvb->input.

---
 drivers/media/pci/ddbridge/ddbridge-maxs8.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/media/pci/ddbridge/ddbridge-maxs8.c +4 -3
index a9dc5f9754da..10716ee8cf59 100644
@@ -187,11 +187,12 @@ static int max_set_input_unlocked(struct dvb_frontend *fe, int in)
 		return -EINVAL;
 	if (dvb->input != in) {
 		u32 bit = (1ULL << input->nr);
-		u32 obit = dev->link[port->lnr].lnb.voltage[dvb->input] & bit;
+		u32 obit =
+			dev->link[port->lnr].lnb.voltage[dvb->input & 3] & bit;
 
-		dev->link[port->lnr].lnb.voltage[dvb->input] &= ~bit;
+		dev->link[port->lnr].lnb.voltage[dvb->input & 3] &= ~bit;
 		dvb->input = in;
-		dev->link[port->lnr].lnb.voltage[dvb->input] |= obit;
+		dev->link[port->lnr].lnb.voltage[dvb->input & 3] |= obit;
 	}
 	res = dvb->set_input(fe, in);
 	return res;
Signature · 1 line
2.13.0
#8 lore raw

PATCH 4/4 MAINTAINERS: add entry for mxl5xx

In reply to Daniel Scheller

From: Daniel Scheller <[email protected]>

---
 MAINTAINERS | 8 ++++++++
 1 file changed, 8 insertions(+)
MAINTAINERS +8 -0
index 6abb534c69c7..685886472d8a 100644
@@ -8236,6 +8236,14 @@ T:	git git://linuxtv.org/media_tree.git
 S:	Supported
 F:	drivers/media/dvb-frontends/lnbh25*
 
+MEDIA DRIVERS FOR MXL5XX TUNER DEMODULATORS
+M:	Daniel Scheller <[email protected]>
+L:	[email protected]
+W:	https://linuxtv.org
+T:	git git://linuxtv.org/media_tree.git
+S:	Maintained
+F:	drivers/media/dvb-frontends/mxl5xx*
+
 MEDIA DRIVERS FOR NETUP PCI UNIVERSAL DVB devices
 M:	Sergey Kozlov <[email protected]>
 M:	Abylay Ospan <[email protected]>
Signature · 1 line
2.13.0
#6 lore raw

PATCH 3/4 ddbridge: fix buffer overflow in max_set_input_unlocked()

In reply to Daniel Scheller
Quoted 37 lines · Daniel Scheller

From: Daniel Scheller <[email protected]>

Picked up code parts introduced one smatch error:

drivers/media/pci/ddbridge/ddbridge-maxs8.c:163 max_set_input_unlocked() error: buffer overflow 'dev->link[port->lnr].lnb.voltage' 4 <= 255

Fix this by clamping the .lnb.voltage array access to 0-3 by "& 3"'ing dvb->input.

---
 drivers/media/pci/ddbridge/ddbridge-maxs8.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/media/pci/ddbridge/ddbridge-maxs8.c +4 -3
index a9dc5f9754da..10716ee8cf59 100644
@@ -187,11 +187,12 @@ static int max_set_input_unlocked(struct dvb_frontend *fe, int in)
 		return -EINVAL;
 	if (dvb->input != in) {
 		u32 bit = (1ULL << input->nr);
-		u32 obit = dev->link[port->lnr].lnb.voltage[dvb->input] & bit;
+		u32 obit =
+			dev->link[port->lnr].lnb.voltage[dvb->input & 3] & bit;
 
-		dev->link[port->lnr].lnb.voltage[dvb->input] &= ~bit;
+		dev->link[port->lnr].lnb.voltage[dvb->input & 3] &= ~bit;
 		dvb->input = in;
-		dev->link[port->lnr].lnb.voltage[dvb->input] |= obit;
+		dev->link[port->lnr].lnb.voltage[dvb->input & 3] |= obit;
 	}
 	res = dvb->set_input(fe, in);
 	return res;
Signature · 1 line
2.13.0

dvb->input cannot become > 3.
If it does, it would be caused by some other error, data corruption, etc.

"& 3" just turns one arbitrarily wrong value into another.

#2 lore raw

PATCH 1/4 dvb-frontends: MaxLinear MxL5xx DVB-S/S2 tuner-demodulator driver

In reply to Daniel Scheller
Quoted 5 lines · Daniel Scheller

From: Daniel Scheller <[email protected]>

This adds the frontend driver for the MaxLinear MxL5xx family of tuner- demodulators, as used on Digital Devices MaxS4/8 four/eight-tuner cards.

Quoted 7 lines

The driver was picked from the dddvb vendor driver package and - judging solely from the diff - has undergone a 100% rework:

- Silly #define's used to pass multiple values to functions were expanded. This resulted in macro/register names not being usable anymore for such occurences, but makes the code WAY more read-, understand- and maintainable.

OK, but why did you also replace all kinds of register value defines with numerical values? This makes the driver much less comprehensible.

#3 lore raw

Re: [PATCH 1/4] [media] dvb-frontends: MaxLinear MxL5xx DVB-S/S2 tuner-demodulator driver

Am Mon, 10 Jul 2017 10:41:03 +0200
schrieb Ralph Metzler <[email protected]>:

Quoted 10 lines
Quoted 9 lines · Daniel Scheller

From: Daniel Scheller <[email protected]>

This adds the frontend driver for the MaxLinear MxL5xx family of tuner- demodulators, as used on Digital Devices MaxS4/8 four/eight-tuner cards.

The driver was picked from the dddvb vendor driver package and - judging solely from the diff - has undergone a 100% rework:

Quoted 7 lines
Quoted 4 lines

- Silly #define's used to pass multiple values to functions were expanded. This resulted in macro/register names not being usable anymore for such occurences, but makes the code WAY more read-, understand- and maintainable.

OK, but why did you also replace all kinds of register value defines with numerical values? This makes the driver much less comprehensible.

I actually tried to put named identifiers back in as I don't feel very comfortable with just plain hex numbers, there aren't even that many registers that get accessed. But as I tried to do (based on the original _regs.h), I quickly found out that one register can belong to many identifiers, with the only difference being the bitshift and bitcount, so without knowing the correct names this ends up in lottery style, which isn't good either. If you have some documentation on this and can provide that, we can put names back in place of course.

Best regards,
Daniel Scheller

Signature · 1 line
https://github.com/herrnst
#7 lore raw

Re: [PATCH 3/4] [media] ddbridge: fix buffer overflow in max_set_input_unlocked()

In reply to Ralph Metzler

Am Mon, 10 Jul 2017 10:12:24 +0200
schrieb Ralph Metzler <[email protected]>:

Quoted 37 lines
Quoted 36 lines · Daniel Scheller

From: Daniel Scheller <[email protected]>

Picked up code parts introduced one smatch error:

drivers/media/pci/ddbridge/ddbridge-maxs8.c:163
max_set_input_unlocked() error: buffer overflow
'dev->link[port->lnr].lnb.voltage' 4 <= 255

Fix this by clamping the .lnb.voltage array access to 0-3 by "& 3"'ing dvb->input.

---
 drivers/media/pci/ddbridge/ddbridge-maxs8.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
(quoted diff) +0 -0

b/drivers/media/pci/ddbridge/ddbridge-maxs8.c index a9dc5f9754da..10716ee8cf59 100644 --- a/drivers/media/pci/ddbridge/ddbridge-maxs8.c +++ b/drivers/media/pci/ddbridge/ddbridge-maxs8.c @@ -187,11 +187,12 @@ static int max_set_input_unlocked(struct dvb_frontend *fe, int in) return -EINVAL; if (dvb->input != in) {

(quoted diff) +0 -1
 		u32 bit = (1ULL << input->nr);
-		u32 obit =

dev->link[port->lnr].lnb.voltage[dvb->input] & bit;

(quoted diff) +2 -0
+		u32 obit =
+

dev->link[port->lnr].lnb.voltage[dvb->input & 3] & bit;

(quoted diff) +0 -1
-		dev->link[port->lnr].lnb.voltage[dvb->input] &=

~bit;

(quoted diff) +1 -0
+		dev->link[port->lnr].lnb.voltage[dvb->input & 3]

&= ~bit; dvb->input = in;

(quoted diff) +0 -1
-		dev->link[port->lnr].lnb.voltage[dvb->input] |=

obit;

Quoted 8 lines
Quoted 6 lines
(quoted diff) +1 -0
+		dev->link[port->lnr].lnb.voltage[dvb->input & 3]

|= obit; }

drivers/media/pci/ddbridge/ddbridge-maxs8.c +0 -0
 	res = dvb->set_input(fe, in);
 	return res;
Signature · 1 line
2.13.0  

dvb->input cannot become > 3.

Sure, guess else you'd have received quite some OOPS reports due to this :-)

Same reason as for the other patch applies - if we don't fix this warning now then someone else will. OTOH, if Mauro is comfortable with this, then lets just keep it as it is and drop this (and also the other) patch.

Best regards,
Daniel Scheller

Signature · 1 line
https://github.com/herrnst
#9 lore raw
In reply to Daniel Scheller

Am Sun, 9 Jul 2017 21:42:42 +0200
schrieb Daniel Scheller <[email protected]>:

Quoted 6 lines

Hard-dependency on the STV0910/STV6111 driver+DD support series and the DD driver bump.

This adds a driver for the MaxLinear MxL5xx tuner-demodulator series (a DVB-S/S2/DSS demodulator-tuner combo frontend) as being found on Digital Devices MaxS8 4/8 tunerport cards.

The stv0910/6111 dependency is fulfilled already, but the DD driver bump is still required. So, ddbridge-0.9.29-v4 as of [1] needs to go in first. After that, this series works "standalone".

Since in the DD bump series the -irq.c split has been removed, patch #2 may conflict in the Makefile (ddbridge-irq.c is gone).

Best regards,
Daniel Scheller

Signature · 1 line
https://github.com/herrnst