From patchwork Mon Apr 20 18:37:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 462856 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 14DC01400A0 for ; Tue, 21 Apr 2015 04:38:45 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 90071A7434; Mon, 20 Apr 2015 20:38:40 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Jq6L4krs8z4e; Mon, 20 Apr 2015 20:38:40 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0C464A742D; Mon, 20 Apr 2015 20:38:39 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 26B29A7423 for ; Mon, 20 Apr 2015 20:38:37 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Mwa-blSn3xhx for ; Mon, 20 Apr 2015 20:38:37 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-ie0-f202.google.com (mail-ie0-f202.google.com [209.85.223.202]) by theia.denx.de (Postfix) with ESMTPS id B87D5A7422 for ; Mon, 20 Apr 2015 20:38:33 +0200 (CEST) Received: by iebtr6 with SMTP id tr6so8584652ieb.0 for ; Mon, 20 Apr 2015 11:38:32 -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=Dmm1x9ADbZFxfldXXl6yziXDoSoz9FZMHkM2bS5RSPY=; b=ZSeYL/z2qNUnuBFkCyZSuYBj6Fcb4zjcvd98NFgZfHQo72svhP3P7LSJpgYGNyCGZW wjeLIMut97gS24D5/jp+JjVUXGWspyzC8kEnOGCEn2+Oc2HGx0ApECZXZp+7/hz0BA5P L7nPBvWAcYl3dFHrri+WjC8pqXPff9Gm4ECelyh6au8zn2NkWC0noU+xcZEl0Dlmsr4D Fu/gNrMNsJPcyCFtioU37tZ79fYhZlFN0LPzbr7W6tnYW4aJwOzihR7A9qSUdUw4xXkh l0A9K1RiRZBDsYMl2ErKJM3ycry3vtwqkWGtq2LTcj7xee5JrKJ6JbpMUo0hdC8pvGxh L9jw== X-Gm-Message-State: ALoCoQlnO2BbBKqvxi6IPkSmzHSZ+Wq1Kbl4wCgyOpaEmtfcEBD1ZDCAFuBmyKzvo6TYSR9Bkfxe X-Received: by 10.182.24.38 with SMTP id r6mr24716863obf.20.1429555112062; Mon, 20 Apr 2015 11:38:32 -0700 (PDT) Received: from corpmail-nozzle1-1.hot.corp.google.com ([100.108.1.104]) by gmr-mx.google.com with ESMTPS id o5si764172yhd.5.2015.04.20.11.38.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Apr 2015 11:38:32 -0700 (PDT) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by corpmail-nozzle1-1.hot.corp.google.com with ESMTP id 3zA6pbhL.1; Mon, 20 Apr 2015 11:38:31 -0700 Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 54B1A220BB2; Mon, 20 Apr 2015 12:38:31 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Mon, 20 Apr 2015 12:37:13 -0600 Message-Id: <1429555051-22335-3-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c In-Reply-To: <1429555051-22335-1-git-send-email-sjg@chromium.org> References: <1429555051-22335-1-git-send-email-sjg@chromium.org> Cc: Tom Rini Subject: [U-Boot] [PATCH 02/20] dm: i2c: sandbox: Add debugging to the speed limit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Print a debug() message with the I2C speed is exceeded. Signed-off-by: Simon Glass Acked-by: Heiko Schocher --- drivers/i2c/sandbox_i2c.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/sandbox_i2c.c b/drivers/i2c/sandbox_i2c.c index d6adc0f..621caec 100644 --- a/drivers/i2c/sandbox_i2c.c +++ b/drivers/i2c/sandbox_i2c.c @@ -73,8 +73,10 @@ static int sandbox_i2c_xfer(struct udevice *bus, struct i2c_msg *msg, * 400KHz for reads */ is_read = nmsgs > 1; - if (i2c->speed_hz > (is_read ? 400000 : 100000)) + if (i2c->speed_hz > (is_read ? 400000 : 100000)) { + debug("%s: Max speed exceeded\n", __func__); return -EINVAL; + } return ops->xfer(emul, msg, nmsgs); }