From patchwork Mon Jul 6 22:48:36 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 34350 Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n66MoRpH028212 for ; Mon, 6 Jul 2009 22:50:27 GMT Received: from dlep35.itg.ti.com ([157.170.170.118]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id n66Mmujo019641; Mon, 6 Jul 2009 17:49:01 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep35.itg.ti.com (8.13.7/8.13.7) with ESMTP id n66Mmtq9012984; Mon, 6 Jul 2009 17:48:55 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 4012A80627; Mon, 6 Jul 2009 17:48:55 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp51.itg.ti.com (dflp51.itg.ti.com [128.247.22.94]) by linux.omap.com (Postfix) with ESMTP id 4A73A8062D for ; Mon, 6 Jul 2009 17:48:52 -0500 (CDT) Received: from red.ext.ti.com (localhost [127.0.0.1]) by dflp51.itg.ti.com (8.13.7/8.13.7) with ESMTP id n66MmpVX007496 for ; Mon, 6 Jul 2009 17:48:51 -0500 (CDT) Received: from mail63-tx2-R.bigfish.com (mail-tx2.bigfish.com [65.55.88.112]) by red.ext.ti.com (8.13.7/8.13.7) with ESMTP id n66MmkrN003324 for ; Mon, 6 Jul 2009 17:48:51 -0500 Received: from mail63-tx2 (localhost.localdomain [127.0.0.1]) by mail63-tx2-R.bigfish.com (Postfix) with ESMTP id AB568B019B for ; Mon, 6 Jul 2009 22:48:46 +0000 (UTC) X-SpamScore: 0 X-BigFish: vps0(zzzz1202hzzz2dh66h) X-Spam-TCS-SCL: 5:0 X-FB-SS: 5, X-MS-Exchange-Organization-Antispam-Report: OrigIP: 209.85.216.201; Service: EHS Received: by mail63-tx2 (MessageSwitch) id 124692052543367_13886; Mon, 6 Jul 2009 22:48:45 +0000 (UCT) Received: from mail-px0-f201.google.com (mail-px0-f201.google.com [209.85.216.201]) by mail63-tx2.bigfish.com (Postfix) with ESMTP id C2C9DDF8053 for ; Mon, 6 Jul 2009 22:48:44 +0000 (UTC) Received: by pxi39 with SMTP id 39so1187628pxi.4 for ; Mon, 06 Jul 2009 15:48:44 -0700 (PDT) Received: by 10.142.185.21 with SMTP id i21mr1547110wff.82.1246920524228; Mon, 06 Jul 2009 15:48:44 -0700 (PDT) Received: from localhost ([216.254.16.51]) by mx.google.com with ESMTPS id 24sm7008458wfc.37.2009.07.06.15.48.42 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 06 Jul 2009 15:48:42 -0700 (PDT) From: Kevin Hilman To: ben-linux@fluff.org, linux-i2c@vger.kernel.org Date: Mon, 6 Jul 2009 15:48:36 -0700 Message-Id: <1246920516-31462-3-git-send-email-khilman@deeprootsystems.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1246920516-31462-2-git-send-email-khilman@deeprootsystems.com> References: <1246920516-31462-1-git-send-email-khilman@deeprootsystems.com> <1246920516-31462-2-git-send-email-khilman@deeprootsystems.com> Cc: davinci-linux-open-source@linux.davincidsp.com, David Brownell Subject: [PATCH 2/2] i2c-davinci: behave with i2cdetect X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.4 Precedence: list List-Id: davinci-linux-open-source.linux.davincidsp.com List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com From: David Brownell Make i2c-davinci cope properly with "i2cdetect": don't spew syslog spam on perfectly normal behaviors, or respond to any address other than the one reserved for the SMBus host. Signed-off-by: David Brownell Signed-off-by: Kevin Hilman --- drivers/i2c/busses/i2c-davinci.c | 18 ++++++++++++++---- 1 files changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c index ee3fbb8..1f3d89c 100644 --- a/drivers/i2c/busses/i2c-davinci.c +++ b/drivers/i2c/busses/i2c-davinci.c @@ -187,6 +187,11 @@ static int i2c_davinci_init(struct davinci_i2c_dev *dev) davinci_i2c_write_reg(dev, DAVINCI_I2C_CLKH_REG, clkh); davinci_i2c_write_reg(dev, DAVINCI_I2C_CLKL_REG, clkl); + /* Respond at reserved "SMBus Host" slave address" (and zero); + * we seem to have no option to not respond... + */ + davinci_i2c_write_reg(dev, DAVINCI_I2C_OAR_REG, 0x08); + dev_dbg(dev->dev, "input_clock = %d, CLK = %d\n", input_clock, clk); dev_dbg(dev->dev, "PSC = %d\n", davinci_i2c_read_reg(dev, DAVINCI_I2C_PSC_REG)); @@ -387,7 +392,7 @@ static void terminate_write(struct davinci_i2c_dev *dev) davinci_i2c_write_reg(dev, DAVINCI_I2C_MDR_REG, w); if (!dev->terminate) - dev_err(dev->dev, "TDR IRQ while no data to send\n"); + dev_dbg(dev->dev, "TDR IRQ while no data to send\n"); } /* @@ -473,9 +478,14 @@ static irqreturn_t i2c_davinci_isr(int this_irq, void *dev_id) break; case DAVINCI_I2C_IVR_AAS: - dev_warn(dev->dev, "Address as slave interrupt\n"); - }/* switch */ - }/* while */ + dev_dbg(dev->dev, "Address as slave interrupt\n"); + break; + + default: + dev_warn(dev->dev, "Unrecognized irq stat %d\n", stat); + break; + } + } return count ? IRQ_HANDLED : IRQ_NONE; }