Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2416586imm; Sat, 12 May 2018 11:28:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpXME8G6yQY6AMUJeIY94n2+SNkXJNBK4nsWhERFFCjp/x4sRYRS5ZsQPHP5fvzAv4ib+iy X-Received: by 2002:a65:5bcc:: with SMTP id o12-v6mr3349384pgr.449.1526149682075; Sat, 12 May 2018 11:28:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526149682; cv=none; d=google.com; s=arc-20160816; b=HizHOHwjvxuYvjGLoUWnr2+2iEgXc+TYO20SFWipNwERMysw+KREWzl6nIw5/i0tPk ubyGghBs0HZKsUAsKJDcwVl29ANzz6w/rZdqtHh+84iHVFYuvsilTA80XorNS/duJi/J nXjBu7y92KdvT4Dezxl52nG2qHE/Zlo3sUtyCnRmbIMXU43QRd+qPKiPqXhkVqYjRvm3 qGCIhALRzC2NyOI/TWMBwTXg0A78EtjZwE2ATKn/X7C+u+cLB8jaV9WdJRI0lhrd5uKD Sa07zkMiOsRNYnE/oCqwL1FFdWb/3jZEqTEJUmbw3pbbAQpQwjgfIb9PDhWtSdiDt248 jMLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=5Lf2eSVxOofcs6nM0dTWLP2jUdKN+rrk8hVK9p3o9TU=; b=aa54GD6xRgEsF0N6nXsHw+4tjbqsFCGrSEYwYpS1CUYxp6UsmrmHdv6MzU7Figr/TF Xz/rhnf02Ww7RiyPE6JC8jFsVVZnsgVLB8F5L2SFNrGux0HY+62F+eVxyta7ZbNbLnQ3 bk4mByaJCx39s/aCo+Y1NNutL0BhdIbjQFcSR2svyKP3TvzfkAKhcXrGIVOvTYC4LtgT G/MERyBfJwNVmM2IJ6sVB95ZZ2GSe2cf6+yYhZ935XHGtFQlhWz4QOKHkbQvtXstLbgv XDSlojuwtlFhzkOsgCCM0o4nkmth0qIyORui7tBqm4gPovGTA/XrP5sR2jWEOP3jXReT EJrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hPb9qfwv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z3-v6si5695169plb.246.2018.05.12.11.27.47; Sat, 12 May 2018 11:28:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hPb9qfwv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751937AbeELSZf (ORCPT + 99 others); Sat, 12 May 2018 14:25:35 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:37316 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751805AbeELSZe (ORCPT ); Sat, 12 May 2018 14:25:34 -0400 Received: by mail-wm0-f68.google.com with SMTP id l1-v6so8423359wmb.2; Sat, 12 May 2018 11:25:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5Lf2eSVxOofcs6nM0dTWLP2jUdKN+rrk8hVK9p3o9TU=; b=hPb9qfwvsT5KQSpsNTd26thjE2RLs6sGf0fS+bGejInmcGqhIgRSep6MM9xq+FhZ6C 2diKyXprspSb0rVsqdV+Wa0H/ow3fMWy+OjggVrdf4mtMPNdhCW9WKqmKgLViKiYK5sR LiJlLDNRxahJY6vs7w7FqvOkPt34dnr5Rqm6nNh1A5rZwVV/co3/dD/oLX9re5iS3/US fuW0FTK/0j2un9j68PqrymZOf8bn0EV3EW7yyAMg+BZqI7KGwqHey1oZxHqdCZ1dhCLz NektosPVNdteMuFQ6iF/CxhBmVz69o+H8jzIwMN0vkNsha76fne2fmEBlOv70m6HcmEm QjbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5Lf2eSVxOofcs6nM0dTWLP2jUdKN+rrk8hVK9p3o9TU=; b=RRrud4WyPr8xLmjWQnbUr+D3mh5HgXDfr16WWFTrtuu3y3Reeyg7Lissjn8EXJjCKn eC9k64sta+RUL4ndaTBaBGl2p1wn8avMaE5Iw4mO6reFkdIBM69Ak+GGeAqMpr1My/tU BTY8nflOzTkMjPyYn1PPJdnjn2WpPHE8ezlbHd6NvQFO3ybEpV3axxUyhxTB0AJAYwRG GZzZvZoPLX3NQtEO+2paH+jMgMd+fuCoeTFNb+gq9MH+8p07+zEeHWkbIvJjsREo0sV1 /TkDid1JJNSlpkj6bZ5sIQOXVy5o+nSHcNIYG/pkPXtxJiNfEdX4Aa0xBWvK21+7etrA wgag== X-Gm-Message-State: ALKqPwdEle/yZaLRLJ3wGqcUm4Xxa4jMY3kv6nOE6FcdvgUprlsoVQNX mLyYSGfUbGls+EVxaBCYK3JRiH1ekTU= X-Received: by 2002:a1c:a906:: with SMTP id s6-v6mr1551218wme.116.1526149532256; Sat, 12 May 2018 11:25:32 -0700 (PDT) Received: from x1.local (p200300E55F2109000000000000000281.dip0.t-ipconnect.de. [2003:e5:5f21:900::281]) by smtp.googlemail.com with ESMTPSA id j9-v6sm6196011wri.55.2018.05.12.11.25.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 12 May 2018 11:25:31 -0700 (PDT) From: Thomas Hollstegge To: linux-media@vger.kernel.org Cc: thomas.hollstegge@gmail.com, =?UTF-8?q?Stefan=20Br=C3=BCns?= , Mauro Carvalho Chehab , Sean Young , Hans Verkuil , linux-kernel@vger.kernel.org Subject: [PATCH v3 2/2] dvbsky: Add support for MyGica T230C v2 Date: Sat, 12 May 2018 20:25:19 +0200 Message-Id: <1526149521-9401-1-git-send-email-thomas.hollstegge@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Support for newer revisions of the MyGica T230C, shipping with a different USB pid. Although sometimes referred to as T230C2, the device is sold under its original name T230C. Besides a slightly different PCB layout and some different minor components, it utilizes the same bridge, demodulator and tuner as the older revision. However, it requires a fixed TS clock frequency of 10 MHz to tune to some muxes. Tested with various DVB-T2 HEVC and DVB-C channels. Signed-off-by: Thomas Hollstegge Cc: Stefan BrĂ¼ns --- drivers/media/usb/dvb-usb-v2/dvbsky.c | 90 +++++++++++++++++++++++++++++++++++ include/media/dvb-usb-ids.h | 1 + 2 files changed, 91 insertions(+) diff --git a/drivers/media/usb/dvb-usb-v2/dvbsky.c b/drivers/media/usb/dvb-usb-v2/dvbsky.c index 1aa88d9..a6d3c08 100644 --- a/drivers/media/usb/dvb-usb-v2/dvbsky.c +++ b/drivers/media/usb/dvb-usb-v2/dvbsky.c @@ -581,6 +581,66 @@ static int dvbsky_mygica_t230c_attach(struct dvb_usb_adapter *adap) return 0; } +static int dvbsky_mygica_t230c_v2_attach(struct dvb_usb_adapter *adap) +{ + struct dvbsky_state *state = adap_to_priv(adap); + struct dvb_usb_device *d = adap_to_d(adap); + struct i2c_adapter *i2c_adapter; + struct i2c_client *client_demod, *client_tuner; + struct i2c_board_info info; + struct si2168_config si2168_config; + struct si2157_config si2157_config; + + /* attach demod */ + memset(&si2168_config, 0, sizeof(si2168_config)); + si2168_config.i2c_adapter = &i2c_adapter; + si2168_config.fe = &adap->fe[0]; + si2168_config.ts_mode = SI2168_TS_PARALLEL; + si2168_config.ts_clock_inv = 1; + si2168_config.ts_clock_mode = SI2168_TS_CLOCK_MODE_MANUAL; + si2168_config.ts_clock_freq = 10000000; + memset(&info, 0, sizeof(struct i2c_board_info)); + strlcpy(info.type, "si2168", sizeof(info.type)); + info.addr = 0x64; + info.platform_data = &si2168_config; + + request_module("si2168"); + client_demod = i2c_new_device(&d->i2c_adap, &info); + if (!client_demod || !client_demod->dev.driver) + goto fail_demod_device; + if (!try_module_get(client_demod->dev.driver->owner)) + goto fail_demod_module; + + /* attach tuner */ + memset(&si2157_config, 0, sizeof(si2157_config)); + si2157_config.fe = adap->fe[0]; + si2157_config.if_port = 0; + memset(&info, 0, sizeof(struct i2c_board_info)); + strlcpy(info.type, "si2141", sizeof(info.type)); + info.addr = 0x60; + info.platform_data = &si2157_config; + + request_module("si2157"); + client_tuner = i2c_new_device(i2c_adapter, &info); + if (!client_tuner || !client_tuner->dev.driver) + goto fail_tuner_device; + if (!try_module_get(client_tuner->dev.driver->owner)) + goto fail_tuner_module; + + state->i2c_client_demod = client_demod; + state->i2c_client_tuner = client_tuner; + return 0; + +fail_tuner_module: + i2c_unregister_device(client_tuner); +fail_tuner_device: + module_put(client_demod->dev.driver->owner); +fail_demod_module: + i2c_unregister_device(client_demod); +fail_demod_device: + return -ENODEV; +} + static int dvbsky_identify_state(struct dvb_usb_device *d, const char **name) { @@ -758,6 +818,33 @@ static struct dvb_usb_device_properties mygica_t230c_props = { } }; +static struct dvb_usb_device_properties mygica_t230c_v2_props = { + .driver_name = KBUILD_MODNAME, + .owner = THIS_MODULE, + .adapter_nr = adapter_nr, + .size_of_priv = sizeof(struct dvbsky_state), + + .generic_bulk_ctrl_endpoint = 0x01, + .generic_bulk_ctrl_endpoint_response = 0x81, + .generic_bulk_ctrl_delay = DVBSKY_MSG_DELAY, + + .i2c_algo = &dvbsky_i2c_algo, + .frontend_attach = dvbsky_mygica_t230c_v2_attach, + .init = dvbsky_init, + .get_rc_config = dvbsky_get_rc_config, + .streaming_ctrl = dvbsky_streaming_ctrl, + .identify_state = dvbsky_identify_state, + .exit = dvbsky_exit, + + .num_adapters = 1, + .adapter = { + { + .stream = DVB_USB_STREAM_BULK(0x82, 8, 4096), + } + } +}; + + static const struct usb_device_id dvbsky_id_table[] = { { DVB_USB_DEVICE(0x0572, 0x6831, &dvbsky_s960_props, "DVBSky S960/S860", RC_MAP_DVBSKY) }, @@ -793,6 +880,9 @@ static const struct usb_device_id dvbsky_id_table[] = { { DVB_USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230C, &mygica_t230c_props, "MyGica Mini DVB-T2 USB Stick T230C", RC_MAP_TOTAL_MEDIA_IN_HAND_02) }, + { DVB_USB_DEVICE(USB_VID_CONEXANT, USB_PID_MYGICA_T230C_V2, + &mygica_t230c_v2_props, "MyGica Mini DVB-T2 USB Stick T230C v2", + RC_MAP_TOTAL_MEDIA_IN_HAND_02) }, { } }; MODULE_DEVICE_TABLE(usb, dvbsky_id_table); diff --git a/include/media/dvb-usb-ids.h b/include/media/dvb-usb-ids.h index f9e73b4..d606248 100644 --- a/include/media/dvb-usb-ids.h +++ b/include/media/dvb-usb-ids.h @@ -387,6 +387,7 @@ #define USB_PID_MYGICA_D689 0xd811 #define USB_PID_MYGICA_T230 0xc688 #define USB_PID_MYGICA_T230C 0xc689 +#define USB_PID_MYGICA_T230C_V2 0xc68a #define USB_PID_ELGATO_EYETV_DIVERSITY 0x0011 #define USB_PID_ELGATO_EYETV_DTT 0x0021 #define USB_PID_ELGATO_EYETV_DTT_2 0x003f -- 2.7.4