From patchwork Wed Apr 3 01:18:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ray Jui X-Patchwork-Id: 10882513 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B5B2A17E0 for ; Wed, 3 Apr 2019 01:19:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93831289DC for ; Wed, 3 Apr 2019 01:19:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 83AF6289E2; Wed, 3 Apr 2019 01:19:25 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2592C289DC for ; Wed, 3 Apr 2019 01:19:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=i8k/4cCkZ9mqueIFBO2YgOweIOVP3KBihbxvMZICV2I=; b=hdaPDc9X3nyNBHi5pcS2uHhfgM SQM68kdErB9np2kbgBlVnydF21RFkLG0yFt77PRol8Myzs2XmCY8U1WhfR/hfh8k3+BQMDeJeIrJ4 zhQH6trAG860x0I6s8CWda2/PVpiM4KoQes96WFUib3yirGjGqv6xnDVqyjk7w0PIdyV3R19vhlzw QI4ZcqQJfMUQ6ZUW48qCyWHIuLFCf93Z4yhJLw2SLaC3VQRI/I9Efh6KFVoOTgbDyAFx/s1AfxoT/ Ow/HLblKmNTq4SCPJcPMm5yMpn5Xko826BQhVf7+FsPTKQiLrzpGyw/4+mDIJYwrtMUvo1TFllc50 yQDO2G8A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBUYk-0000VV-N2; Wed, 03 Apr 2019 01:19:22 +0000 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBUYM-0008Oi-Ee for linux-arm-kernel@lists.infradead.org; Wed, 03 Apr 2019 01:19:03 +0000 Received: by mail-pl1-x644.google.com with SMTP id w24so754935plp.2 for ; Tue, 02 Apr 2019 18:18:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CZ2aCugsmc8waDJuDEPimClTRC9P2krhZEU6lVq0VZs=; b=E1PpikXxHNMNjnGc38TSD0hpJcMItN1CtSdVANbrhgXH1OD+ksvXNFNkl73oKt6IA7 /Hxl4EMqOk0w3Z22X9oHxUv8CTHCWwSE8gG6I40Fgx0mXlqNE4tRazSAjaU7BrxFUBag +ReE+vTi4llDkze6WkrA1ha3DhjLUehEHJlP4= 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=CZ2aCugsmc8waDJuDEPimClTRC9P2krhZEU6lVq0VZs=; b=K1Rl3mk6nVpMU7qV4iJCXZeLuDc7JU9af8Dd0RFizVuyzaGBEKeiUb3o7hg6SaZvW8 Prz9hm00GWB22V9NoXiHX3RJrJ9sgGuOtTJrMimdG9Wiqp5DY+EGH/OO9vvQqX875ZU7 L/dW1F325m+F5Nv8bYw95RQ5hLIvC+zUKSBpd/NNA6qspESItXdTJx+n4aQYbn/MyEYO XTvrmRGJ0uTV06R1dsHKv5ZgVp9lhwRYAiSPNZlnP8iQtUNDAxouRBVcTM1/ZG9mqgxz wW2S7C79aZBjtrZ+R0y90yvxUBmFZtsgCJMmMkAkE21cLcBWIGktmqIYwC4shaEwJyQ5 Fvjw== X-Gm-Message-State: APjAAAV9q6b9qKZK9/gH5SjE1OHCW15Sh66gUdpQLDxHBs6ynmJLRKX7 OWPV+qTrQf43foYFhajneOI/GQ== X-Google-Smtp-Source: APXvYqxYCSpyhtVwlrgQESOuG4wMefqUWVN9VSgsuupHVfqXbtK0YHpmCTl6JW+nwzeFdPvX98glpg== X-Received: by 2002:a17:902:b717:: with SMTP id d23mr54927144pls.260.1554254337761; Tue, 02 Apr 2019 18:18:57 -0700 (PDT) Received: from rj-aorus.ric.broadcom.com ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id 4sm19589046pfn.159.2019.04.02.18.18.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Apr 2019 18:18:57 -0700 (PDT) From: Ray Jui To: Wolfram Sang , Rob Herring , Mark Rutland Subject: [PATCH v6 3/9] i2c: iproc: Add support for more master error status Date: Tue, 2 Apr 2019 18:18:24 -0700 Message-Id: <20190403011830.3254-4-ray.jui@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190403011830.3254-1-ray.jui@broadcom.com> References: <20190403011830.3254-1-ray.jui@broadcom.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190402_181858_881830_39815B59 X-CRM114-Status: GOOD ( 12.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Rayagonda Kokatanur , linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-i2c@vger.kernel.org, Michael Cheng , Ray Jui , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Michael Cheng Add support for more master error status including FIFO underrun and RX FIFO full Signed-off-by: Michael Cheng Signed-off-by: Ray Jui --- drivers/i2c/busses/i2c-bcm-iproc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c index 915c1b5aafd8..d64876cfa11c 100644 --- a/drivers/i2c/busses/i2c-bcm-iproc.c +++ b/drivers/i2c/busses/i2c-bcm-iproc.c @@ -73,6 +73,8 @@ #define M_CMD_STATUS_NACK_ADDR 0x2 #define M_CMD_STATUS_NACK_DATA 0x3 #define M_CMD_STATUS_TIMEOUT 0x4 +#define M_CMD_STATUS_FIFO_UNDERRUN 0x5 +#define M_CMD_STATUS_RX_FIFO_FULL 0x6 #define M_CMD_PROTOCOL_SHIFT 9 #define M_CMD_PROTOCOL_MASK 0xf #define M_CMD_PROTOCOL_BLK_WR 0x7 @@ -536,6 +538,14 @@ static int bcm_iproc_i2c_check_status(struct bcm_iproc_i2c_dev *iproc_i2c, dev_dbg(iproc_i2c->device, "bus timeout\n"); return -ETIMEDOUT; + case M_CMD_STATUS_FIFO_UNDERRUN: + dev_dbg(iproc_i2c->device, "FIFO under-run\n"); + return -ENXIO; + + case M_CMD_STATUS_RX_FIFO_FULL: + dev_dbg(iproc_i2c->device, "RX FIFO full\n"); + return -ETIMEDOUT; + default: dev_dbg(iproc_i2c->device, "unknown error code=%d\n", val);