From patchwork Sat Jun 23 15:36:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scheller X-Patchwork-Id: 10483709 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 2B2676023A for ; Sat, 23 Jun 2018 15:36:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EFB5288D1 for ; Sat, 23 Jun 2018 15:36:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23EA0289D1; Sat, 23 Jun 2018 15:36:30 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 D3CE3288D1 for ; Sat, 23 Jun 2018 15:36:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751610AbeFWPg1 (ORCPT ); Sat, 23 Jun 2018 11:36:27 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:37085 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751583AbeFWPgY (ORCPT ); Sat, 23 Jun 2018 11:36:24 -0400 Received: by mail-wr0-f195.google.com with SMTP id k6-v6so9412927wrp.4 for ; Sat, 23 Jun 2018 08:36:23 -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=/95ttqxI28C2CyWew88h6dFCU9P+8SqQCcFnYSOmRXU=; b=b75ITtzNIyq3m6eL7isMlHXRZBnGBr7tJEY8UwYCARWIiAiD3wv0tT0nG0AKC1yvZ5 0Hnvjb5MmujlfypftNn4UfbV0U2aiSn0Uj+jMEvLdTmYErZj5VVJXQMuQ/u3pWhJx43s a25+Rnd0StHCoGR0RZMrMvaFMPxDi3nZ8G7zfT/B9pp+okzjBg8hYkyWHLX8nm4AlHrD xjtxNR87S7DmM/vGKGH1yko/zzbnKAhkKa6m8QRZpGZowR9RSrx+c2CeptVGN52+CNu8 masV7LXM2cuQaNsFRjWZGKUEGzRTLadFk46Pa9JoGbenoPACCd4X2NTjVYI6ZjuT7sMl Adcg== 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=/95ttqxI28C2CyWew88h6dFCU9P+8SqQCcFnYSOmRXU=; b=sX3xt734quE+52KXcTNbNKlODzeQkZVZFv9ytIf8VDwyfE1LssiG4ocDYKEzLWofNM y66SYsr22Xm0RftyacISEnNcg2q9BSm/6gKz0sec1jWb9uNIDwpI9RCt2KBv2lxqD/IH tIju/gPpD3RfC7I4nUD1BhQJIFG4TN3jQgfh5SzIqoMXZNfiBH7JzvuCBnBZ0I7bO+vL 0w55tQIgEO0yGKwZFokUmYZJJZouy0xBIjHSRQ97S+PFEuM1BIWZcm0ac6TN4ioCSWR7 aVeSj+LFPAZH36PjpMuKLBKc22/AJMvkogMF1E+ew/Wsp6pRspJbYtnYw601q1cg6IfE btjQ== X-Gm-Message-State: APt69E2wW4FI86Mg/1HnUqHnSPs9yr9GD9acmerFM6gWQWjvVXdJktKh VOKA9ndRjBvn/KMsxjQAEBM= X-Google-Smtp-Source: AAOMgpdEFzCxUFRd8loljhQkmfZmX7E0POybo32m/3CSJF4lX6i86lRUPfjbT9Dp2yDYiWqMolLEag== X-Received: by 2002:adf:c646:: with SMTP id u6-v6mr4843216wrg.177.1529768183232; Sat, 23 Jun 2018 08:36:23 -0700 (PDT) Received: from dvbdev.wuest.de (ip-176-199-71-134.hsi06.unitymediagroup.de. [176.199.71.134]) by smtp.gmail.com with ESMTPSA id o15-v6sm3443156wrm.38.2018.06.23.08.36.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Jun 2018 08:36:22 -0700 (PDT) From: Daniel Scheller To: mchehab@kernel.org, mchehab@s-opensource.com Cc: linux-media@vger.kernel.org Subject: [PATCH 05/19] [media] ddbridge: report I2C bus errors Date: Sat, 23 Jun 2018 17:36:01 +0200 Message-Id: <20180623153615.27630-6-d.scheller.oss@gmail.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180623153615.27630-1-d.scheller.oss@gmail.com> References: <20180623153615.27630-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 I2C_COMMAND response reports an error in the I2C bus communication using bit 17. Evaluate the response more thoroughly and log an error if an I2C problem was detected. Picked up from the upstream dddvb GIT. Signed-off-by: Daniel Scheller --- drivers/media/pci/ddbridge/ddbridge-i2c.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/pci/ddbridge/ddbridge-i2c.c b/drivers/media/pci/ddbridge/ddbridge-i2c.c index 667340c86ea7..5a28d7611713 100644 --- a/drivers/media/pci/ddbridge/ddbridge-i2c.c +++ b/drivers/media/pci/ddbridge/ddbridge-i2c.c @@ -73,7 +73,10 @@ static int ddb_i2c_cmd(struct ddb_i2c *i2c, u32 adr, u32 cmd) } return -EIO; } - if (val & 0x70000) + val &= 0x70000; + if (val == 0x20000) + dev_err(dev->dev, "I2C bus error\n"); + if (val) return -EIO; return 0; }