From patchwork Thu Jul 30 17:08:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 6905451 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CAED5C05AC for ; Thu, 30 Jul 2015 17:13:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ED3632056C for ; Thu, 30 Jul 2015 17:13:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 13F8C204D6 for ; Thu, 30 Jul 2015 17:13:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753418AbbG3RNh (ORCPT ); Thu, 30 Jul 2015 13:13:37 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:37549 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753432AbbG3RJI (ORCPT ); Thu, 30 Jul 2015 13:09:08 -0400 Received: by wibud3 with SMTP id ud3so637466wib.0 for ; Thu, 30 Jul 2015 10:09:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CBakowhApjLX0wLGI/Oy6fA3843Ut/nackW9Vmo9+pE=; b=cynlHxMyQsmYcPKR3onpqAQ09bq4CmMVEM7d0GRd5iVi5BUNQff7fPxamuJa/Qx6Fx UdtZUMdns2T5yHWSTVlRvLrzmHqqF2vcN75rbW4ddvnggBHLlQiHu7H1u9j01Qbj/vc2 BZ4Z9ZXvizNypG6L8Xt8ONBYN15db4Lqa6cPRdPxODDJpcIEkZwS2j/I7TdYkNjUo0L4 0cAq1uvBKoEfopqeUQuiUOmD0YTuQj/6UFVxgr60raXNVgH5VjuI7ld/2yacsvzdcNGW wJv5CkZy5jL/Anl4OqycQuVOG1L0eY6O2sQvfGzwezVzT/n2LyiXRdRMkCwm7wya1UOP z63w== X-Gm-Message-State: ALoCoQmXvGZ+7JN3CxyEMh4GoEx7jTONuyV6r2QHT9QZnvXtOsZcerQRgnUKMHaeokHVMrVCtMtm X-Received: by 10.194.172.130 with SMTP id bc2mr98774767wjc.85.1438276147559; Thu, 30 Jul 2015 10:09:07 -0700 (PDT) Received: from localhost.localdomain (cpc14-aztw22-2-0-cust189.18-1.cable.virginm.net. [82.45.1.190]) by smtp.gmail.com with ESMTPSA id lm16sm82853wic.18.2015.07.30.10.09.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Jul 2015 10:09:06 -0700 (PDT) From: Peter Griffin To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, srinivas.kandagatla@gmail.com, maxime.coquelin@st.com, patrice.chotard@st.com, mchehab@osg.samsung.com, m.krufky@samsung.com Cc: peter.griffin@linaro.org, lee.jones@linaro.org, hugues.fruchet@st.com, linux-media@vger.kernel.org, devicetree@vger.kernel.org, joe@perches.com Subject: [PATCH v2 01/11] [media] stv0367: Refine i2c error trace to include i2c address Date: Thu, 30 Jul 2015 18:08:51 +0100 Message-Id: <1438276141-16902-2-git-send-email-peter.griffin@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1438276141-16902-1-git-send-email-peter.griffin@linaro.org> References: <1438276141-16902-1-git-send-email-peter.griffin@linaro.org> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When using stv0367 demodulator with STi STB platforms, we can have easily have four or more stv0367 demods running in the system at one time. As typically the b2120 reference design ships with a b2004a daughter board, which can accept two dvb NIM cards, and each b2100A NIM has 2x stv0367 demods and 2x NXPs tuner on it. In such circumstances it is useful to print the i2c address on error messages to know which one is failing due to I2C issues. Signed-off-by: Peter Griffin --- drivers/media/dvb-frontends/stv0367.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/media/dvb-frontends/stv0367.c b/drivers/media/dvb-frontends/stv0367.c index ec3e18e..9a49db1 100644 --- a/drivers/media/dvb-frontends/stv0367.c +++ b/drivers/media/dvb-frontends/stv0367.c @@ -791,11 +791,13 @@ int stv0367_writeregs(struct stv0367_state *state, u16 reg, u8 *data, int len) memcpy(buf + 2, data, len); if (i2cdebug) - printk(KERN_DEBUG "%s: %02x: %02x\n", __func__, reg, buf[2]); + printk(KERN_DEBUG "%s: [%02x] %02x: %02x\n", __func__, + state->config->demod_address, reg, buf[2]); ret = i2c_transfer(state->i2c, &msg, 1); if (ret != 1) - printk(KERN_ERR "%s: i2c write error!\n", __func__); + printk(KERN_ERR "%s: i2c write error! ([%02x] %02x: %02x)\n", + __func__, state->config->demod_address, reg, buf[2]); return (ret != 1) ? -EREMOTEIO : 0; } @@ -829,10 +831,12 @@ static u8 stv0367_readreg(struct stv0367_state *state, u16 reg) ret = i2c_transfer(state->i2c, msg, 2); if (ret != 2) - printk(KERN_ERR "%s: i2c read error\n", __func__); + printk(KERN_ERR "%s: i2c read error ([%02x] %02x: %02x)\n", + __func__, state->config->demod_address, reg, b1[0]); if (i2cdebug) - printk(KERN_DEBUG "%s: %02x: %02x\n", __func__, reg, b1[0]); + printk(KERN_DEBUG "%s: [%02x] %02x: %02x\n", __func__, + state->config->demod_address, reg, b1[0]); return b1[0]; }