From patchwork Mon Jul 3 17:21:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scheller X-Patchwork-Id: 9823765 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3AD6E608B8 for ; Mon, 3 Jul 2017 17:21:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2251A2856A for ; Mon, 3 Jul 2017 17:21:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 176A92856D; Mon, 3 Jul 2017 17:21:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A3DDD285EC for ; Mon, 3 Jul 2017 17:21:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755536AbdGCRVV (ORCPT ); Mon, 3 Jul 2017 13:21:21 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:33165 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755496AbdGCRVQ (ORCPT ); Mon, 3 Jul 2017 13:21:16 -0400 Received: by mail-wm0-f66.google.com with SMTP id j85so21729440wmj.0 for ; Mon, 03 Jul 2017 10:21:15 -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:in-reply-to:references; bh=9trn18JYCp/EyeiG+urRwVIQhSk/UiWX2H22pCwCCxQ=; b=Mz3K6c8bKEVGLJY8LGI23S07zGq/ZkwjNRz98vdmjPhZfNZ54PX6bGiwnriuIEzo84 9onMQDz360Ci5KTGMqbZnN7ZceF1/juyI+3sU0JiLwSs0D14nRdRPY6zpE38uKU9VtVL DnefD1V2UKoVdKmEDJ+rGkTE9HvzNP/8CIuI5Lega9hIGeszDDZ8emG7FnFtFC5YvSxc xNbDi7rvy0j+WgGNt42WvzK3r+vhg2Vmyd4h6fmI3WmWFLem35l+8gpIYnCrkTx7br+5 5anrx/9jC0hwo/ecTRMw09k8Yg5cw+lhIyZzorQaqGUUiTqoBO/V4MY0xqJgZMNI9TAz Awzw== 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:in-reply-to :references; bh=9trn18JYCp/EyeiG+urRwVIQhSk/UiWX2H22pCwCCxQ=; b=EsmGlLvff+dlExOhwsgUgSZUmvh8pKUhWr7+5gJo2i0XFTJHIhE/he0RE/3M85hqp/ aIgUGf0nmNP9t+u4tVjq+sd7vR1iE9Wlv4gN/C6vjxdPQHPk7RDsZ9GVSlI2+Yx+Bb4S jH3wCvgO7+zYval4E3Au9uwHlzXMWOC0pJS1MK2j5t9f5IL+h95hcjdS/zhMoL7QwXwM so3kYJLmSgrz+QfsdupVJh30c1UYoFTFmbJXzfHku/n6vJIecEd/MOrYAmdGi9xsXcww +CfzKcACZlBhSzbS8/MyPM7yWZx4gxwXoLxzfrYCk24HYO9zdFsNCVO82Anh/c9pZvgH vy+g== X-Gm-Message-State: AKS2vOyHmNHFsWTQ3gPrZgDjpS9MY7uzOdh/fldF4hSfU344/MUT8VBN raBSCzFrMRmNtQxl X-Received: by 10.28.234.193 with SMTP id g62mr26746962wmi.24.1499102474922; Mon, 03 Jul 2017 10:21:14 -0700 (PDT) Received: from dvbdev.wuest.de (ip-37-24-178-151.hsi14.unitymediagroup.de. [37.24.178.151]) by smtp.gmail.com with ESMTPSA id x21sm17350309wme.24.2017.07.03.10.21.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Jul 2017 10:21:14 -0700 (PDT) From: Daniel Scheller To: linux-media@vger.kernel.org, mchehab@kernel.org, mchehab@s-opensource.com Cc: jasmin@anw.at, rjkm@metzlerbros.de Subject: [PATCH v3 07/10] [media] ddbridge: return stv09xx id in port_has_stv0900_aa() Date: Mon, 3 Jul 2017 19:21:00 +0200 Message-Id: <20170703172104.27283-8-d.scheller.oss@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170703172104.27283-1-d.scheller.oss@gmail.com> References: <20170703172104.27283-1-d.scheller.oss@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Daniel Scheller The returned value is required for further evaluation of the exact demodulator chip (stv090x or stv0910). Signed-off-by: Daniel Scheller Tested-by: Richard Scobie --- drivers/media/pci/ddbridge/ddbridge-core.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c index cd1723e79a07..3fbac7bee2d4 100644 --- a/drivers/media/pci/ddbridge/ddbridge-core.c +++ b/drivers/media/pci/ddbridge/ddbridge-core.c @@ -1480,10 +1480,9 @@ static int port_has_stv0900(struct ddb_port *port) return 1; } -static int port_has_stv0900_aa(struct ddb_port *port) +static int port_has_stv0900_aa(struct ddb_port *port, u8 *id) { - u8 val; - if (i2c_read_reg16(&port->i2c->adap, 0x68, 0xf100, &val) < 0) + if (i2c_read_reg16(&port->i2c->adap, 0x68, 0xf100, id) < 0) return 0; return 1; } @@ -1530,7 +1529,7 @@ static void ddb_port_probe(struct ddb_port *port) { struct ddb *dev = port->dev; char *modname = "NO MODULE"; - u8 xo2_type, xo2_id, cxd_id; + u8 xo2_type, xo2_id, cxd_id, stv_id; port->class = DDB_PORT_NONE; @@ -1622,7 +1621,7 @@ static void ddb_port_probe(struct ddb_port *port) port->class = DDB_PORT_TUNER; port->type = DDB_TUNER_DVBS_ST; ddbwritel(I2C_SPEED_100, port->i2c->regs + I2C_TIMING); - } else if (port_has_stv0900_aa(port)) { + } else if (port_has_stv0900_aa(port, &stv_id)) { modname = "DUAL DVB-S2"; port->class = DDB_PORT_TUNER; port->type = DDB_TUNER_DVBS_ST_AA;