All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Scheller <d.scheller.oss@gmail.com>
To: aospan@netup.ru, serjk@netup.ru, mchehab@kernel.org,
	linux-media@vger.kernel.org
Cc: rjkm@metzlerbros.de
Subject: [PATCH 16/19] [media] ddbridge: board control setup, ts quirk flags
Date: Sun,  9 Apr 2017 21:38:25 +0200	[thread overview]
Message-ID: <20170409193828.18458-17-d.scheller.oss@gmail.com> (raw)
In-Reply-To: <20170409193828.18458-1-d.scheller.oss@gmail.com>

From: Daniel Scheller <d.scheller@gmx.net>

This is a backport of the board control setup from the vendor provided
dddvb driver package, which does additional device initialisation based
on the board_control device info values. Also backports the TS quirk
flags which is used to control setup and usage of the tuner modules
soldered on the bridge cards (e.g. CineCTv7, CineS2 V7, MaxA8 and the
likes).

Functionality originates from ddbridge vendor driver. Permission for
reuse and kernel inclusion was formally granted by Ralph Metzler
<rjkm@metzlerbros.de>.

Cc: Ralph Metzler <rjkm@metzlerbros.de>
Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
---
 drivers/media/pci/ddbridge/ddbridge-core.c | 13 +++++++++++++
 drivers/media/pci/ddbridge/ddbridge-regs.h |  4 ++++
 drivers/media/pci/ddbridge/ddbridge.h      | 10 ++++++++++
 3 files changed, 27 insertions(+)

diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c
index 12f5aa3..6b49fa9 100644
--- a/drivers/media/pci/ddbridge/ddbridge-core.c
+++ b/drivers/media/pci/ddbridge/ddbridge-core.c
@@ -1763,6 +1763,19 @@ static int ddb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	ddbwritel(0xfff0f, INTERRUPT_ENABLE);
 	ddbwritel(0, MSI1_ENABLE);
 
+	/* board control */
+	if (dev->info->board_control) {
+		ddbwritel(0, DDB_LINK_TAG(0) | BOARD_CONTROL);
+		msleep(100);
+		ddbwritel(dev->info->board_control_2,
+			DDB_LINK_TAG(0) | BOARD_CONTROL);
+		usleep_range(2000, 3000);
+		ddbwritel(dev->info->board_control_2
+			| dev->info->board_control,
+			DDB_LINK_TAG(0) | BOARD_CONTROL);
+		usleep_range(2000, 3000);
+	}
+
 	if (ddb_i2c_init(dev) < 0)
 		goto fail1;
 	ddb_ports_init(dev);
diff --git a/drivers/media/pci/ddbridge/ddbridge-regs.h b/drivers/media/pci/ddbridge/ddbridge-regs.h
index 6ae8103..98cebb9 100644
--- a/drivers/media/pci/ddbridge/ddbridge-regs.h
+++ b/drivers/media/pci/ddbridge/ddbridge-regs.h
@@ -34,6 +34,10 @@
 
 /* ------------------------------------------------------------------------- */
 
+#define BOARD_CONTROL    0x30
+
+/* ------------------------------------------------------------------------- */
+
 /* Interrupt controller                                     */
 /* How many MSI's are available depends on HW (Min 2 max 8) */
 /* How many are usable also depends on Host platform        */
diff --git a/drivers/media/pci/ddbridge/ddbridge.h b/drivers/media/pci/ddbridge/ddbridge.h
index 0898f60..734e18e 100644
--- a/drivers/media/pci/ddbridge/ddbridge.h
+++ b/drivers/media/pci/ddbridge/ddbridge.h
@@ -43,6 +43,10 @@
 #define DDB_MAX_PORT    4
 #define DDB_MAX_INPUT   8
 #define DDB_MAX_OUTPUT  4
+#define DDB_MAX_LINK    4
+#define DDB_LINK_SHIFT 28
+
+#define DDB_LINK_TAG(_x) (_x << DDB_LINK_SHIFT)
 
 struct ddb_info {
 	int   type;
@@ -51,6 +55,12 @@ struct ddb_info {
 	char *name;
 	int   port_num;
 	u32   port_type[DDB_MAX_PORT];
+	u32   board_control;
+	u32   board_control_2;
+	u8    ts_quirks;
+#define TS_QUIRK_SERIAL   1
+#define TS_QUIRK_REVERSED 2
+#define TS_QUIRK_ALT_OSC  8
 };
 
 /* DMA_SIZE MUST be divisible by 188 and 128 !!! */
-- 
2.10.2

  parent reply	other threads:[~2017-04-09 19:38 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-09 19:38 [PATCH 00/19] cxd2841er/ddbridge: support Sony CXD28xx hardware Daniel Scheller
2017-04-09 19:38 ` [PATCH 01/19] [media] dvb-frontends/cxd2841er: remove kernel log spam in non-debug levels Daniel Scheller
2017-05-30 14:45   ` Abylay Ospan
2017-04-09 19:38 ` [PATCH 02/19] [media] dvb-frontends/cxd2841er: do I2C reads in one go Daniel Scheller
2017-05-30 16:49   ` Abylay Ospan
2017-04-09 19:38 ` [PATCH 03/19] [media] dvb-frontends/cxd2841er: immediately unfreeze regs when done Daniel Scheller
2017-05-31  0:32   ` Abylay Ospan
2017-04-09 19:38 ` [PATCH 04/19] [media] dvb-frontends/cxd2841er: support CXD2837/38/43ER demods/Chip IDs Daniel Scheller
2017-05-31  2:48   ` Abylay Ospan
2017-04-09 19:38 ` [PATCH 05/19] [media] dvb-frontends/cxd2841er: replace IFFREQ calc macros into functions Daniel Scheller
2017-05-31 11:55   ` Abylay Ospan
2017-04-09 19:38 ` [PATCH 06/19] [media] dvb-frontends/cxd2841er: add variable for configuration flags Daniel Scheller
2017-05-31 11:57   ` Abylay Ospan
2017-04-09 19:38 ` [PATCH 07/19] [media] dvb-frontends/cxd2841er: make call to i2c_gate_ctrl optional Daniel Scheller
2017-05-31 11:59   ` Abylay Ospan
2017-04-09 19:38 ` [PATCH 08/19] [media] dvb-frontends/cxd2841er: support IF speed calc from tuner values Daniel Scheller
2017-05-31 12:03   ` Abylay Ospan
2017-04-09 19:38 ` [PATCH 09/19] [media] dvb-frontends/cxd2841er: TS_SERIAL config flag Daniel Scheller
2017-05-31 12:04   ` Abylay Ospan
2017-04-09 19:38 ` [PATCH 10/19] [media] dvb-frontends/cxd2841er: make ASCOT use optional Daniel Scheller
2017-05-31 12:16   ` Abylay Ospan
2017-04-09 19:38 ` [PATCH 11/19] [media] dvb-frontends/cxd2841er: optionally tune earlier in set_frontend() Daniel Scheller
2017-05-31 12:17   ` Abylay Ospan
2017-04-09 19:38 ` [PATCH 12/19] [media] dvb-frontends/cxd2841er: make lock wait in set_fe_tc() optional Daniel Scheller
2017-05-31 12:19   ` Abylay Ospan
2017-04-09 19:38 ` [PATCH 13/19] [media] dvb-frontends/cxd2841er: configurable IFAGCNEG Daniel Scheller
2017-05-31 12:19   ` Abylay Ospan
2017-04-09 19:38 ` [PATCH 14/19] [media] dvb-frontends/cxd2841er: more configurable TSBITS Daniel Scheller
2017-05-31 12:23   ` Abylay Ospan
2017-04-09 19:38 ` [PATCH 15/19] [media] dvb-frontends/cxd2841er: improved snr reporting Daniel Scheller
2017-05-31 12:23   ` Abylay Ospan
2017-04-09 19:38 ` Daniel Scheller [this message]
2017-05-31 12:26   ` [PATCH 16/19] [media] ddbridge: board control setup, ts quirk flags Abylay Ospan
2017-04-09 19:38 ` [PATCH 17/19] [media] ddbridge: add I2C functions, add XO2 module support Daniel Scheller
2017-05-31 12:28   ` Abylay Ospan
2017-04-09 19:38 ` [PATCH 18/19] [media] ddbridge: support for Sony CXD28xx C/C2/T/T2 tuner modules Daniel Scheller
2017-04-09 19:38 ` [PATCH 19/19] [media] ddbridge: hardware IDs for new C2T2 cards and other devices Daniel Scheller
2017-05-28 21:47 ` [PATCH 00/19] cxd2841er/ddbridge: support Sony CXD28xx hardware Daniel Scheller
     [not found]   ` <CAK3bHNW9sM0fZFqYEX-mEhv-Rax82u25KdgjQftGcoY6wV1O0A@mail.gmail.com>
2017-05-31 12:30     ` Abylay Ospan
2017-05-31 20:32       ` Daniel Scheller
2017-05-31 20:39         ` Abylay Ospan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170409193828.18458-17-d.scheller.oss@gmail.com \
    --to=d.scheller.oss@gmail.com \
    --cc=aospan@netup.ru \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=rjkm@metzlerbros.de \
    --cc=serjk@netup.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.