From patchwork Fri Jun 30 20:51:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scheller X-Patchwork-Id: 9820475 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 36F02603F3 for ; Fri, 30 Jun 2017 20:51:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2AA4328456 for ; Fri, 30 Jun 2017 20:51:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1F88E2845D; Fri, 30 Jun 2017 20:51:23 +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 B9E2F28511 for ; Fri, 30 Jun 2017 20:51:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752980AbdF3UvV (ORCPT ); Fri, 30 Jun 2017 16:51:21 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34185 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752965AbdF3UvS (ORCPT ); Fri, 30 Jun 2017 16:51:18 -0400 Received: by mail-wm0-f68.google.com with SMTP id p204so9893407wmg.1 for ; Fri, 30 Jun 2017 13:51:17 -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=T8Aoqe1WkHhK/cvn1Zu1FxoqINFImH+9gays8yhsgoU=; b=KtLErUEGKY9KCteF9o1V00rCausOrcbMCPNadffp82UiLxHkvBYwQeiOzwjf9kGq5B y+LsJmOwjX/4CUsK1QEH2vgDkLpC/hTDZSKG+ir8eIaIr0v3vOpN0J1QYRSESMk3wHqy KGK3ZccQpqcfbhD97Cj3kPaSayalt4339181NcFiyHqEkAFaJDFuXqLVJ1kQjeDqSgwk ngTUMnkdNj1Z/yZB9rohFg/1HJL94PhW+Abw9YVlQkl6u7XVeTv55GwufLwLDbVyG23G npJOag1dOIOPlb6RGzst+IjkVUM/sURDN2qyTc218WTVdWusPobmEVw9O9/paxLaAUqt vfdA== 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=T8Aoqe1WkHhK/cvn1Zu1FxoqINFImH+9gays8yhsgoU=; b=lUQSkO6sxCEPWNZz/Hvq/5rMSS/LMgWfSQ3YvX2cFE4Har8nD9d6YMYc9SZxkPebGu /Ama3zeDPGnkzC9UQyKVa8UPhLlpKDzuPRJvZ6PnJyfRnuuAe0/dEP685qu5cGN6Ss1H i4zhMeuzSdbl+43aLqbWFSohiet+y2UvYYCd3UDXIUjSggqjN9kgjiKvmaVfkIIhTtMQ bN27gzesRr7rukW32140jfhOjgqvaAjAQAPUmkTInjOu77t/ROhI0tzXhmCoT6getURQ R9pOmG3grk4cGZa2AZlmUJblNKhmQcwtgrGpGGSkwjSd9nhctlauTbOz6MCYLtieOX/w accw== X-Gm-Message-State: AIVw111gM71u4Gka4ixLQR0TpUeGcvedVPir2/HVPgEJhaeshpigoc/S kkNSQLYKZcMuV/4A X-Received: by 10.28.24.81 with SMTP id 78mr1361489wmy.112.1498855876938; Fri, 30 Jun 2017 13:51:16 -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 e24sm6420051wrc.35.2017.06.30.13.51.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 30 Jun 2017 13:51:16 -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 v2 07/10] [media] ddbridge: return stv09xx id in port_has_stv0900_aa() Date: Fri, 30 Jun 2017 22:51:03 +0200 Message-Id: <20170630205106.1268-8-d.scheller.oss@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170630205106.1268-1-d.scheller.oss@gmail.com> References: <20170630205106.1268-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 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;