From patchwork Sat Jun 24 16:02:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scheller X-Patchwork-Id: 9807817 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 7957D6038C for ; Sat, 24 Jun 2017 16:03:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B10828773 for ; Sat, 24 Jun 2017 16:03:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6014D28776; Sat, 24 Jun 2017 16:03:26 +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 122B028773 for ; Sat, 24 Jun 2017 16:03:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751384AbdFXQDY (ORCPT ); Sat, 24 Jun 2017 12:03:24 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:35109 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754739AbdFXQDN (ORCPT ); Sat, 24 Jun 2017 12:03:13 -0400 Received: by mail-wr0-f194.google.com with SMTP id z45so20075898wrb.2 for ; Sat, 24 Jun 2017 09:03:12 -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=pSyqmhf9D5GWReZclivCaYoTrC8KwS7En2mdItbkuM4=; b=sgEBBgkEIxuLpLtHGqCQybP3CeKT7xc7WsUOgKVV+Zx+guV96vGa8gDQBOjq5n6wxb oYJWR14M9R969ppI5tdj2+xVBU0o10bCmd0fz2wwAC39QqgPvtjrEmKJlmiaHBHp8KFt zIwNlwX2vcmAk8MvIkBJ3fbGdcBCKG7O+O5HCzh2Uyid+BPVODXncpklY4a2SJr5z1M7 J1o7MXnzwjS6qMSzfdnpNfJwVvJob17nPxOsr1kGLtPMV3D6xh1RfgK140mJFIXUGXZ/ MxSMSWg9Rn/Tp0dSZ0iXrv/2IzKU3tmMeeB6i0oUqIh1noIPqgF/j0Gxg3FXp/FZSJmb iiyA== 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=pSyqmhf9D5GWReZclivCaYoTrC8KwS7En2mdItbkuM4=; b=bIWw/KhVlbz29S+xNBRtWT6vm2xxZhohgs4T+juVrsXJz9jZ0FKQnamCwfa8rPQRG5 Htktfbf3tF7hOFbjWWbBMYlTujNuYaC7mx88l0sYWcSI6ifmVwL8k9RCQk5hYGCJsMvb l0LSPU6uO/kTGo/8qaOSRms9KZBbrJh/cwDo/lUzpryDEUe3fcIN3MCLdvqFFxoWOAp4 hd2KnJdcKhV0kTP51dsNplao5+5U4MZjuQlxmvNRFYqaHU22LQmcLE09uU1YduazKzCl GOQQgxNZhSlH0381HSF+dvnoqVlOKf3EZGC8VBgF0Bky8PMD6pKa4UtYcrEFx1qxPXs9 FN9g== X-Gm-Message-State: AKS2vOyKiopccvRSwW6rL3g2znZEZnSisU17yZ70DlsTrcU203Cj48O+ 9F8kWNSMdmfRfvPw X-Received: by 10.223.135.185 with SMTP id b54mr9085233wrb.170.1498320191827; Sat, 24 Jun 2017 09:03:11 -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 n31sm9935301wrn.59.2017.06.24.09.03.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 24 Jun 2017 09:03:11 -0700 (PDT) From: Daniel Scheller To: linux-media@vger.kernel.org, mchehab@kernel.org, mchehab@s-opensource.com Cc: rjkm@metzlerbros.de, jasmin@anw.at Subject: [PATCH 7/9] [media] ddbridge: return stv09xx id in port_has_stv0900_aa() Date: Sat, 24 Jun 2017 18:02:59 +0200 Message-Id: <20170624160301.17710-8-d.scheller.oss@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170624160301.17710-1-d.scheller.oss@gmail.com> References: <20170624160301.17710-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 --- 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 9420479bee9a..8c8cea9602de 100644 --- a/drivers/media/pci/ddbridge/ddbridge-core.c +++ b/drivers/media/pci/ddbridge/ddbridge-core.c @@ -1452,10 +1452,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; } @@ -1502,7 +1501,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; @@ -1594,7 +1593,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;