All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brad Love <brad@nextdimension.cc>
To: linux-media@vger.kernel.org, mchehab@s-opensource.com
Cc: Brad Love <brad@nextdimension.cc>
Subject: [PATCH 6/9] cx231xx: Update 955Q from dvb attach to i2c device
Date: Tue, 17 Apr 2018 11:39:52 -0500	[thread overview]
Message-ID: <1523983195-28691-7-git-send-email-brad@nextdimension.cc> (raw)
In-Reply-To: <1523983195-28691-1-git-send-email-brad@nextdimension.cc>

Trim out some unused config params. Use the i2c mux
adapter returned by frontend with the tuner.

Signed-off-by: Brad Love <brad@nextdimension.cc>
---
 drivers/media/usb/cx231xx/cx231xx-dvb.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/media/usb/cx231xx/cx231xx-dvb.c b/drivers/media/usb/cx231xx/cx231xx-dvb.c
index f5903e6..ac1d8e6 100644
--- a/drivers/media/usb/cx231xx/cx231xx-dvb.c
+++ b/drivers/media/usb/cx231xx/cx231xx-dvb.c
@@ -156,10 +156,8 @@ static struct tda18271_config pv_tda18271_config = {
 };
 
 static struct lgdt3306a_config hauppauge_955q_lgdt3306a_config = {
-	.i2c_addr           = 0x59,
 	.qam_if_khz         = 4000,
 	.vsb_if_khz         = 3250,
-	.deny_i2c_rptr      = 1,
 	.spectral_inversion = 1,
 	.mpeg_mode          = LGDT3306A_MPEG_SERIAL,
 	.tpclk_edge         = LGDT3306A_TPCLK_RISING_EDGE,
@@ -860,18 +858,22 @@ static int dvb_init(struct cx231xx *dev)
 	case CX231XX_BOARD_HAUPPAUGE_955Q:
 	{
 		struct si2157_config si2157_config = {};
+		struct lgdt3306a_config lgdt3306a_config = {};
 
-		dev->dvb->frontend[0] = dvb_attach(lgdt3306a_attach,
-			&hauppauge_955q_lgdt3306a_config,
-			demod_i2c
-			);
+		/* attach first demodulator chip */
+		lgdt3306a_config = hauppauge_955q_lgdt3306a_config;
+		lgdt3306a_config.fe = &dev->dvb->frontend[0];
+		lgdt3306a_config.i2c_adapter = &adapter;
 
-		if (!dev->dvb->frontend[0]) {
-			dev_err(dev->dev,
-				"Failed to attach LGDT3306A frontend.\n");
-			result = -EINVAL;
+		/* perform tuner probe/init/attach */
+		client = dvb_module_probe("lgdt3306a", NULL, demod_i2c,
+						dev->board.demod_addr,
+						&lgdt3306a_config);
+		if (!client) {
+			result = -ENODEV;
 			goto out_free;
 		}
+		dvb->i2c_client_demod[0] = client;
 
 		dev->dvb->frontend[0]->ops.i2c_gate_ctrl = NULL;
 
-- 
2.7.4

  parent reply	other threads:[~2018-04-17 16:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-17 16:39 [PATCH 0/9] cx231xx: House cleaning Brad Love
2018-04-17 16:39 ` [PATCH 1/9] cx231xx: Fix several incorrect demod addresses Brad Love
2018-04-17 16:39 ` [PATCH 2/9] cx231xx: Use board profile values for addresses Brad Love
2018-04-19 18:10   ` Matthias Schwarzott
2018-04-23 17:50     ` Brad Love
2018-05-03 16:24       ` Brad Love
2018-04-17 16:39 ` [PATCH 3/9] cx231xx: Style fix for struct zero init Brad Love
2018-04-17 16:39 ` [PATCH 4/9] [bug] cx231xx: Ignore an i2c mux adapter Brad Love
2018-04-17 16:39 ` [PATCH 5/9] cx231xx: Switch to using new dvb i2c helpers Brad Love
2018-04-19 18:09   ` Matthias Schwarzott
2018-04-23 17:26     ` Brad Love
2018-04-17 16:39 ` Brad Love [this message]
2018-04-17 16:39 ` [PATCH 7/8] cx231xx: Remove unnecessary parameter clear Brad Love
2018-04-17 16:39 ` [PATCH 8/9] cx231xx: Remove RC_CORE dependency Brad Love
2018-04-17 16:39 ` [PATCH 9/9] cx231xx: Add I2C_MUX dependency Brad Love

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=1523983195-28691-7-git-send-email-brad@nextdimension.cc \
    --to=brad@nextdimension.cc \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@s-opensource.com \
    /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.