From patchwork Mon May 31 13:19:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Raviteja Narayanam X-Patchwork-Id: 12289379 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07C11C47082 for ; Mon, 31 May 2021 13:22:59 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C5CC961420 for ; Mon, 31 May 2021 13:22:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C5CC961420 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=I9eCr+5tZgzyfoJJ7mbWJFiWto9kdiQAiYlPd6mmGs0=; b=bbwffFspdHZBX8 mtIycTeZ5e6a7He6JP86vx/Wyvw7eOYG7pgw/+AaoHAnAkCIfPkAJX/UDfnJixydpnz8AKeL+rSSg 2/y7v9VWK5MZlUY5XsLoT4XjQJDG+b+9MpsU/50yi4pLXMkw01kIkIlXNJX6S/B4bitK+bFX+myci IFtjr77Y1yJimPuCFUg5X2+JdqfBm56qjN+9uqYBzFSlASgD70F46aDgFEgM+Tl55h5sI6hATVTBp 9gHBQpXte5nsIaq5C6m9USdPxLowvPTHH8FyUvLU8+1B1/rUwiJ1czdZZTiF/wJ3Pn9C7t02+PWnl ITx+Vfvvtpydhi5SUfvQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnhqs-00CI9j-M8; Mon, 31 May 2021 13:21:06 +0000 Received: from mail-dm6nam08on2080.outbound.protection.outlook.com ([40.107.102.80] helo=NAM04-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnhqf-00CI75-MM for linux-arm-kernel@lists.infradead.org; Mon, 31 May 2021 13:20:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hE8jwsFGa47Rbvi0dl3e1GyPlmziZiOyyy+toJhDbPBb0mdC61dod/GWtW3C8pfdjJcNR6EkotwE9jLqU1Y8jG2X1s2Q+3bHUAOK6i7dJYD00YJyVxdlzObCp8/uWwRijY0rYB6UFE8RBAeL8rKvQ/mtvE3IJwTrJv45xVVO1FBG0x/IbkImXGh4+38XgDtjWCQcqDYkKDkQ3Omc0RngsXpK2kvBVfaAR7EV6ogSXWewq2GhOCM1CxV6VA2aMFQZs5H5pFqqN0X5ZbUyIdyFLEKWsbPaCfqM2sCWHi/3Xx4QYKxHbZbQqTO7NGrMUJShdQkB/9kqM6HBzdfUbykAug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LC4+zpcf0ZbBUTbWy21dXn/vwcKYYP23odGRQdGCAK8=; b=NqDnDpOq7HLxYah+yNlYqBAw/wf46I3AjCAmWGqcaTisQOJiOxu8MXequRRJ1UM4g5Dqklz5/C8Qs8ra24NymXFa65Vw9yEqrZWb06gxbHSIi4NX7AmDhGhodZhQg+qJNB/fgrMFk9gsCB6OnwjTFxrXi11bD5H4nTNuH+9P6sM4kLb08kjHKqqEfnyxHvwQK9Hs15BasRRmMLzSDwlrQBzNVzyp6vqlBUKcVUEH62B+qaczAWwP+fY/Pt89mMJFXyhUWYnFHIVlIwgBk8u1sgHjWV4ZFTFlKWpm1iAzTeRHDR5x4f1j69D2R9ZE7GjYpVFV+MYbQcb5Zq1ahrCzHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LC4+zpcf0ZbBUTbWy21dXn/vwcKYYP23odGRQdGCAK8=; b=ZQjGAQswUhk2KkZBdCfEnGwbfLw2zXMOmGkT+Fwbs6zI2u38Lu6vjtwCfdsExRWIdTjZ1jRrgz2cBMUo8vrInKtdQXRvr00Hw6NvGl6Ch56EzGcAbu20/MuGCav3G73PlZOUImGXzPmdMTjaGCF3wbdk0xxzO1IJdLSpoav4O1k= Received: from SN6PR2101CA0018.namprd21.prod.outlook.com (2603:10b6:805:106::28) by MW4PR02MB7330.namprd02.prod.outlook.com (2603:10b6:303:7b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.21; Mon, 31 May 2021 13:20:46 +0000 Received: from SN1NAM02FT0060.eop-nam02.prod.protection.outlook.com (2603:10b6:805:106:cafe::8d) by SN6PR2101CA0018.outlook.office365.com (2603:10b6:805:106::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.3 via Frontend Transport; Mon, 31 May 2021 13:20:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by SN1NAM02FT0060.mail.protection.outlook.com (10.97.4.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4150.30 via Frontend Transport; Mon, 31 May 2021 13:20:46 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 31 May 2021 06:20:26 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Mon, 31 May 2021 06:20:26 -0700 Received: from [10.140.6.25] (port=53014 helo=xhdnagasure40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lnhqC-0004GE-OM; Mon, 31 May 2021 06:20:25 -0700 From: Raviteja Narayanam To: , CC: , , , , Raviteja Narayanam Subject: [PATCH 01/10] i2c: xiic: Fix Tx Interrupt path for grouped messages Date: Mon, 31 May 2021 07:19:39 -0600 Message-ID: <20210531131948.19477-2-raviteja.narayanam@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210531131948.19477-1-raviteja.narayanam@xilinx.com> References: <20210531131948.19477-1-raviteja.narayanam@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b458ab11-c663-4512-4b19-08d92436e668 X-MS-TrafficTypeDiagnostic: MW4PR02MB7330: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h9zrsRT0kmDdmPUrdC5aCVjndtOERDTWuhQoGx+czKT04Tqt9D8hOK5YNf0WHPQ296inXyiTVWjqj093XzZ4JRxXIO4VhrdFt496PHQ/a1ifmlu/UluT9frOVNNvAb7BKn1TLDT2+7AXu63LqfOB9ghmn/MoauizaWDBlRONlNQrV3ZsXQlOV1bR5k8tq1/um8SfCUxzb0xf672ATrSnj/oxrNsYrzXuu6ytv2CmbNUbdfar+7/j+OgE+tbqfJCL0UYLx7I5p3s85BitAZthedNQVteisBrcZlzCGjXeHjHdjICbRhbRj4KTHvoCE72h0zushVMR6rCAAHAZt7sLvRhhHyjP/lIu/fSDmDQEfmB5Qo8wDdUlVXNMDbe2k6vapokseg8kqck4NbeROEmRSoFKmuewmOmu/kZMvZYK9kQUzwVHXwbWx7j2h+oqMCo7l7Y7A/qwG9wVqD0Yos0CcochbH5AACL+B1HDB2Ypk+aozcfsddLjbxLI9RP4Pf99xsPNzT2FX4SWNcAEJeuFMYRM8gqZxbqCdEEdFacHhyClHwaycbrv5krAMnp356BCArYMxco2Vel9NgLH5rWaLLZB4vZOzPbDM7f/MJ7QeKL55aF4/9T8MgllOVD9l8IC/eNJTSqlgGJ82CpNhP+wvatred3fiJTvJNTa2MPG8olNJKKTj2KKu7GCDi6w3h/v X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(396003)(346002)(376002)(136003)(39860400002)(36840700001)(46966006)(7696005)(5660300002)(36860700001)(26005)(8936002)(478600001)(107886003)(6666004)(1076003)(2906002)(47076005)(186003)(8676002)(82310400003)(6636002)(4326008)(70206006)(54906003)(2616005)(70586007)(82740400003)(7636003)(44832011)(36756003)(83380400001)(356005)(9786002)(336012)(15650500001)(316002)(110136005)(426003)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2021 13:20:46.1264 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b458ab11-c663-4512-4b19-08d92436e668 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0060.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR02MB7330 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210531_062053_762609_577BD4C3 X-CRM114-Status: GOOD ( 14.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When a group of messages are sent from user space as a set, if the last message has less than Tx FIFO DEPTH number of bytes to transfer, Tx half empty interrupt is triggered continuously from the hardware. It is due to Bus not busy interrupt coming along with Tx half empty and tx empty. Hence, service the Tx interrupts before Bus not busy interrupt to update the i2c message status correctly. Signed-off-by: Raviteja Narayanam --- drivers/i2c/busses/i2c-xiic.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 2a8568b97c14..b0cfd9d15467 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -453,22 +453,6 @@ static irqreturn_t xiic_process(int irq, void *dev_id) } } } - if (pend & XIIC_INTR_BNB_MASK) { - /* IIC bus has transitioned to not busy */ - clr |= XIIC_INTR_BNB_MASK; - - /* The bus is not busy, disable BusNotBusy interrupt */ - xiic_irq_dis(i2c, XIIC_INTR_BNB_MASK); - - if (!i2c->tx_msg) - goto out; - - if ((i2c->nmsgs == 1) && !i2c->rx_msg && - xiic_tx_space(i2c) == 0) - xiic_wakeup(i2c, STATE_DONE); - else - xiic_wakeup(i2c, STATE_ERROR); - } if (pend & (XIIC_INTR_TX_EMPTY_MASK | XIIC_INTR_TX_HALF_MASK)) { /* Transmit register/FIFO is empty or ½ empty */ @@ -505,6 +489,24 @@ static irqreturn_t xiic_process(int irq, void *dev_id) */ xiic_irq_dis(i2c, XIIC_INTR_TX_HALF_MASK); } + + if (pend & XIIC_INTR_BNB_MASK) { + /* IIC bus has transitioned to not busy */ + clr |= XIIC_INTR_BNB_MASK; + + /* The bus is not busy, disable BusNotBusy interrupt */ + xiic_irq_dis(i2c, XIIC_INTR_BNB_MASK); + + if (!i2c->tx_msg) + goto out; + + if (i2c->nmsgs == 1 && !i2c->rx_msg && + xiic_tx_space(i2c) == 0) + xiic_wakeup(i2c, STATE_DONE); + else + xiic_wakeup(i2c, STATE_ERROR); + } + out: dev_dbg(i2c->adap.dev.parent, "%s clr: 0x%x\n", __func__, clr); From patchwork Mon May 31 13:19:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raviteja Narayanam X-Patchwork-Id: 12289381 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F6AFC47082 for ; Mon, 31 May 2021 13:23:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 551E1613B6 for ; Mon, 31 May 2021 13:23:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 551E1613B6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eIVMMMMilf6dRPiKY1YLzhW9Y6gxsMOKsPa/YxIHXKA=; b=ZG3WfLpJelLgXK Jv8AVUT63uJx9wuhBLgVJKWqVtGZYdDySXybW17b7BMf56HxruxRVY8wQiKDnNm425Y4An+7I8oi1 jnXtZOsB5DdtLJhdBSJoI2Ys//wzQ9QDxq+Tw6q4ViTW7wRNAiyo61hlfuwrO9RXBp5B14zlWgNZq nFzGsOC9P3IG+q6mS+iOm4KUO6czQGbIAKGakIomliBjEbNbbGypSb8iY5D3XG3t093Wx3vN9eXZO 1Z65+0OKhsv6EBh9SRRZdZ8CW/OU8/vdJAQTPfPONG1lOROVgYejL+QXrYv2w+jbWsO196afmceJ3 qMtZUMqjcF5OdSnP/SNw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnhr5-00CIBJ-PT; Mon, 31 May 2021 13:21:20 +0000 Received: from mail-bn8nam11on2072.outbound.protection.outlook.com ([40.107.236.72] helo=NAM11-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnhqh-00CI7f-Eg for linux-arm-kernel@lists.infradead.org; Mon, 31 May 2021 13:20:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J/jYxuSIYXfqfSX36YCdmjJPfshOEaaeBiXClrypT2syVRkLjXAh72NIw7i+X9TLmscbYP/4jF4pM/m/bHrPI++qvtQ1lC6hvXllhoPbJr63PlmPneqKEeuSP9r2Es57kuzs3FSGfwYMWbUCPIsUeG1WKrgC/xuNNDGKpH6O1EvzUIs9tVMxwf0CcEPaEgecGspwKes4BTlETM+ApXSvc5uKJuNVMLVP06u0uWoMb/4HcJqkvlSMKswSd30UOR3zg6lSvcUtxRuzKp9JhArSDj9wfKv0QcEfmBSE1Kx93yIP8FuNhZEGlaVko6KkuqH9+aUAiTB8ZdQQxWUdkAddGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jxNuL0P9T2L9KMIk59oDrl7+ZpGxbGt8ik5LshPLkpQ=; b=DJyUZYGYpBgUFHWXC08fJkOuDnpE+rburRGVoC3Wd9IjNSVQqJGaKa7+L3/bWdRQGiH10xDnOEzDl0GOZWabVlNzkarxV47n1gTJPFTsMKSaBdQEag1U72HRe5s90ESNKe5h18xoWV2J9yLxZ81awzGBXwb/bzSN3Mm+TrEPu5Br5lguGxXLiji3xe/iN7jXY4/oA3fddModtjvCeWno8bvfKLc8AbveaSHJSO+7GPm6VFA+hB12HEM0z4msb4S+aP1OT1/IcjAx5E0u5zorSF0phey3BCiUnWw3ZUOe+PzOEfuLebeEZ/72mNprfeOWj+5fEzrbD3FLekkBPUynug== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jxNuL0P9T2L9KMIk59oDrl7+ZpGxbGt8ik5LshPLkpQ=; b=K6EWCggYiORgwn2oHO+GD78rdtTH+w1+Uu/IPymLeHYzWzjk9uuaD4fXfWZ7wYYPUeJcD9R5mM01jsBVlK90vaulsTjTCtnd1kSHjo9IzOvBJkDlKwuF3iPS/2buvJxoEplcIxTegmD4xWhS7SyLUQO/LyjRnavloKL73k6RiSY= Received: from SN7PR04CA0193.namprd04.prod.outlook.com (2603:10b6:806:126::18) by MWHPR02MB2750.namprd02.prod.outlook.com (2603:10b6:300:110::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.22; Mon, 31 May 2021 13:20:48 +0000 Received: from SN1NAM02FT0034.eop-nam02.prod.protection.outlook.com (2603:10b6:806:126:cafe::1b) by SN7PR04CA0193.outlook.office365.com (2603:10b6:806:126::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.22 via Frontend Transport; Mon, 31 May 2021 13:20:48 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by SN1NAM02FT0034.mail.protection.outlook.com (10.97.5.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4150.30 via Frontend Transport; Mon, 31 May 2021 13:20:48 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 31 May 2021 06:20:30 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Mon, 31 May 2021 06:20:30 -0700 Received: from [10.140.6.25] (port=53014 helo=xhdnagasure40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lnhqH-0004GE-1S; Mon, 31 May 2021 06:20:29 -0700 From: Raviteja Narayanam To: , CC: , , , , Raviteja Narayanam Subject: [PATCH 02/10] i2c: xiic: Add standard mode support for > 255 byte read transfers Date: Mon, 31 May 2021 07:19:40 -0600 Message-ID: <20210531131948.19477-3-raviteja.narayanam@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210531131948.19477-1-raviteja.narayanam@xilinx.com> References: <20210531131948.19477-1-raviteja.narayanam@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cfc95f72-ce2e-4213-cb95-08d92436e78f X-MS-TrafficTypeDiagnostic: MWHPR02MB2750: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:232; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VG1ZjKuxTE/IsVzCets9gFp8a9Nl5vKm06R/3+5EvU9vaDVygIAj7AC3cQiGRvag5N7eSMjSRB3U+BGcdUyuBIf8dbArlVSCYwjHGV45WPYCgjDivhUKe11Q1wK18lxmkK3wb9qCwKDMgKTJAdcclSzb650GfPCYZIPMldLgBXniMYy6JeqixZZWUpCPucmoo7JwVvkS90DEyIBmPyOLgnNPOruAJE+nl34g5ANwNgndI7IE/rcSX0vCuJKS/WKY83LlonAgSA46vKjNwl3QkTXFH/XbZREkIisFWtYsXcAhF4ikBz43eEQGLz6hMKqjgovvGm+OVJF8uD71jVCttl1AXsiQAC7SaGsth+JRYDrFNfcAq0p/zHJZKIu2Q4dMGvkcdUxJRxp3GAc6WdQ1pHVtQofsSb3jCncGfJctsCXrg128pF5kb34FVBortfGu1IAryfIDohWQbB5+lGB53CFtSUkG7G7mZxzQeaQU5hhjSx5zcI/VKt+CWkB6Zyzk/BnY+ph7xBq+nB2Tb0+9cwG9GPoSkEfAyl6x7Fo6OVimmoOEl+jC+C1nfSQJiCdQPHh7ZxkN8UBWHFPzAzY6ZjYr14ZkuEhiXuCMI+0qT5ggVoB5+mIoSZRfTlFgTYq09ZJElS6e9hq4liTDbYp3DQZx2P1tRtYaEqNgLMLWD+YcUgZzy3sRnEEsuRZmlZ9I X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(136003)(396003)(346002)(39860400002)(376002)(36840700001)(46966006)(1076003)(2616005)(5660300002)(6636002)(478600001)(4326008)(70206006)(7636003)(7696005)(356005)(9786002)(336012)(2906002)(186003)(70586007)(110136005)(107886003)(44832011)(82740400003)(36756003)(8936002)(6666004)(82310400003)(54906003)(26005)(8676002)(426003)(83380400001)(47076005)(30864003)(36860700001)(316002)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2021 13:20:48.0620 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cfc95f72-ce2e-4213-cb95-08d92436e78f X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0034.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB2750 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210531_062055_635163_240B7364 X-CRM114-Status: GOOD ( 35.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In the current driver implementation, there is a limit of read transfer size to 255 bytes as it is using AXI I2C dynamic mode. But the IP supports this transfer through standard mode. So added AXI I2C standard mode support to enable read transfers of size more than 255 bytes. The driver scans through the message request from user space and selects AXI I2C standard mode if there is a read request of more than 255 bytes. Then the whole message goes through standard mode Tx and Rx paths. Signed-off-by: Raviteja Narayanam --- drivers/i2c/busses/i2c-xiic.c | 367 +++++++++++++++++++++++++++++----- 1 file changed, 319 insertions(+), 48 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index b0cfd9d15467..004103267e9c 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -60,6 +60,8 @@ enum xiic_endian { * @clk: Pointer to AXI4-lite input clock * @state: See STATE_ * @singlemaster: Indicates bus is single master + * @dynamic: Mode of controller + * @prev_msg_tx: Previous message is Tx */ struct xiic_i2c { struct device *dev; @@ -76,6 +78,8 @@ struct xiic_i2c { struct clk *clk; enum xilinx_i2c_state state; bool singlemaster; + bool dynamic; + bool prev_msg_tx; }; @@ -144,6 +148,9 @@ struct xiic_i2c { #define XIIC_TX_DYN_START_MASK 0x0100 /* 1 = Set dynamic start */ #define XIIC_TX_DYN_STOP_MASK 0x0200 /* 1 = Set dynamic stop */ +/* Dynamic mode constants */ +#define MAX_READ_LENGTH_DYNAMIC 255 /* Max length for dynamic read */ + /* * The following constants define the register offsets for the Interrupt * registers. There are some holes in the memory map for reserved addresses @@ -270,6 +277,24 @@ static int xiic_clear_rx_fifo(struct xiic_i2c *i2c) return 0; } +static int xiic_wait_tx_empty(struct xiic_i2c *i2c) +{ + u8 isr; + unsigned long timeout; + + timeout = jiffies + XIIC_I2C_TIMEOUT; + for (isr = xiic_getreg32(i2c, XIIC_IISR_OFFSET); + !(isr & XIIC_INTR_TX_EMPTY_MASK); + isr = xiic_getreg32(i2c, XIIC_IISR_OFFSET)) { + if (time_after(jiffies, timeout)) { + dev_err(i2c->dev, "Timeout waiting at Tx empty\n"); + return -ETIMEDOUT; + } + } + + return 0; +} + static int xiic_reinit(struct xiic_i2c *i2c) { int ret; @@ -311,13 +336,14 @@ static void xiic_deinit(struct xiic_i2c *i2c) static void xiic_read_rx(struct xiic_i2c *i2c) { - u8 bytes_in_fifo; + u8 bytes_in_fifo, cr = 0, bytes_to_read = 0; + u32 bytes_rem = 0; int i; bytes_in_fifo = xiic_getreg8(i2c, XIIC_RFO_REG_OFFSET) + 1; dev_dbg(i2c->adap.dev.parent, - "%s entry, bytes in fifo: %d, msg: %d, SR: 0x%x, CR: 0x%x\n", + "%s entry, bytes in fifo: %d, rem: %d, SR: 0x%x, CR: 0x%x\n", __func__, bytes_in_fifo, xiic_rx_space(i2c), xiic_getreg8(i2c, XIIC_SR_REG_OFFSET), xiic_getreg8(i2c, XIIC_CR_REG_OFFSET)); @@ -325,13 +351,53 @@ static void xiic_read_rx(struct xiic_i2c *i2c) if (bytes_in_fifo > xiic_rx_space(i2c)) bytes_in_fifo = xiic_rx_space(i2c); - for (i = 0; i < bytes_in_fifo; i++) + bytes_to_read = bytes_in_fifo; + + if (!i2c->dynamic) { + bytes_rem = xiic_rx_space(i2c) - bytes_in_fifo; + + if (bytes_rem > IIC_RX_FIFO_DEPTH) { + bytes_to_read = bytes_in_fifo; + } else if (bytes_rem > 1) { + bytes_to_read = bytes_rem - 1; + } else if (bytes_rem == 1) { + bytes_to_read = 1; + /* Set NACK in CR to indicate slave transmitter */ + cr = xiic_getreg8(i2c, XIIC_CR_REG_OFFSET); + xiic_setreg8(i2c, XIIC_CR_REG_OFFSET, cr | + XIIC_CR_NO_ACK_MASK); + } else if (bytes_rem == 0) { + bytes_to_read = bytes_in_fifo; + + /* Generate stop on the bus if it is last message */ + if (i2c->nmsgs == 1) { + cr = xiic_getreg8(i2c, XIIC_CR_REG_OFFSET); + xiic_setreg8(i2c, XIIC_CR_REG_OFFSET, cr & + ~XIIC_CR_MSMS_MASK); + } + + /* Make TXACK=0, clean up for next transaction */ + cr = xiic_getreg8(i2c, XIIC_CR_REG_OFFSET); + xiic_setreg8(i2c, XIIC_CR_REG_OFFSET, cr & + ~XIIC_CR_NO_ACK_MASK); + } + } + + /* Read the fifo */ + for (i = 0; i < bytes_to_read; i++) { i2c->rx_msg->buf[i2c->rx_pos++] = xiic_getreg8(i2c, XIIC_DRR_REG_OFFSET); + } - xiic_setreg8(i2c, XIIC_RFD_REG_OFFSET, - (xiic_rx_space(i2c) > IIC_RX_FIFO_DEPTH) ? - IIC_RX_FIFO_DEPTH - 1 : xiic_rx_space(i2c) - 1); + if (i2c->dynamic) { + u8 bytes; + + /* Receive remaining bytes if less than fifo depth */ + bytes = min_t(u8, xiic_rx_space(i2c), IIC_RX_FIFO_DEPTH); + bytes--; + + xiic_setreg8(i2c, XIIC_RFD_REG_OFFSET, bytes); + } } static int xiic_tx_fifo_space(struct xiic_i2c *i2c) @@ -361,6 +427,62 @@ static void xiic_fill_tx_fifo(struct xiic_i2c *i2c) } } +static void xiic_std_fill_tx_fifo(struct xiic_i2c *i2c) +{ + u8 fifo_space = xiic_tx_fifo_space(i2c); + u16 data = 0; + int len = xiic_tx_space(i2c); + + dev_dbg(i2c->adap.dev.parent, "%s entry, len: %d, fifo space: %d\n", + __func__, len, fifo_space); + + if (len > fifo_space) + len = fifo_space; + else if (len && !(i2c->nmsgs > 1)) + len--; + + while (len--) { + data = i2c->tx_msg->buf[i2c->tx_pos++]; + xiic_setreg16(i2c, XIIC_DTR_REG_OFFSET, data); + } +} + +static void xiic_send_tx(struct xiic_i2c *i2c) +{ + dev_dbg(i2c->adap.dev.parent, + "%s entry, rem: %d, SR: 0x%x, CR: 0x%x\n", + __func__, xiic_tx_space(i2c), + xiic_getreg8(i2c, XIIC_SR_REG_OFFSET), + xiic_getreg8(i2c, XIIC_CR_REG_OFFSET)); + + if (xiic_tx_space(i2c) > 1) { + xiic_std_fill_tx_fifo(i2c); + return; + } + + if ((xiic_tx_space(i2c) == 1)) { + u16 data; + + if (i2c->nmsgs == 1) { + u8 cr; + int status; + + /* Wait till FIFO is empty so STOP is sent last */ + status = xiic_wait_tx_empty(i2c); + if (status) + return; + + /* Write to CR to stop */ + cr = xiic_getreg8(i2c, XIIC_CR_REG_OFFSET); + xiic_setreg8(i2c, XIIC_CR_REG_OFFSET, cr & + ~XIIC_CR_MSMS_MASK); + } + /* Send last byte */ + data = i2c->tx_msg->buf[i2c->tx_pos++]; + xiic_setreg16(i2c, XIIC_DTR_REG_OFFSET, data); + } +} + static void xiic_wakeup(struct xiic_i2c *i2c, int code) { i2c->tx_msg = NULL; @@ -391,7 +513,9 @@ static irqreturn_t xiic_process(int irq, void *dev_id) dev_dbg(i2c->adap.dev.parent, "%s: SR: 0x%x, msg: %p, nmsgs: %d\n", __func__, xiic_getreg8(i2c, XIIC_SR_REG_OFFSET), i2c->tx_msg, i2c->nmsgs); - + dev_dbg(i2c->adap.dev.parent, "%s, ISR: 0x%x, CR: 0x%x\n", + __func__, xiic_getreg32(i2c, XIIC_IISR_OFFSET), + xiic_getreg8(i2c, XIIC_CR_REG_OFFSET)); /* Service requesting interrupt */ if ((pend & XIIC_INTR_ARB_LOST_MASK) || @@ -465,7 +589,10 @@ static irqreturn_t xiic_process(int irq, void *dev_id) goto out; } - xiic_fill_tx_fifo(i2c); + if (i2c->dynamic) + xiic_fill_tx_fifo(i2c); + else + xiic_send_tx(i2c); /* current message sent and there is space in the fifo */ if (!xiic_tx_space(i2c) && xiic_tx_fifo_space(i2c) >= 2) { @@ -554,35 +681,113 @@ static int xiic_busy(struct xiic_i2c *i2c) static void xiic_start_recv(struct xiic_i2c *i2c) { - u8 rx_watermark; + u16 rx_watermark; + u8 cr = 0, rfd_set = 0; struct i2c_msg *msg = i2c->rx_msg = i2c->tx_msg; unsigned long flags; - /* Clear and enable Rx full interrupt. */ - xiic_irq_clr_en(i2c, XIIC_INTR_RX_FULL_MASK | XIIC_INTR_TX_ERROR_MASK); + dev_dbg(i2c->adap.dev.parent, "%s entry, ISR: 0x%x, CR: 0x%x\n", + __func__, xiic_getreg32(i2c, XIIC_IISR_OFFSET), + xiic_getreg8(i2c, XIIC_CR_REG_OFFSET)); + + /* Disable Tx interrupts */ + xiic_irq_dis(i2c, XIIC_INTR_TX_HALF_MASK | XIIC_INTR_TX_EMPTY_MASK); - /* we want to get all but last byte, because the TX_ERROR IRQ is used - * to inidicate error ACK on the address, and negative ack on the last - * received byte, so to not mix them receive all but last. - * In the case where there is only one byte to receive - * we can check if ERROR and RX full is set at the same time - */ - rx_watermark = msg->len; - if (rx_watermark > IIC_RX_FIFO_DEPTH) - rx_watermark = IIC_RX_FIFO_DEPTH; - xiic_setreg8(i2c, XIIC_RFD_REG_OFFSET, rx_watermark - 1); - - local_irq_save(flags); - if (!(msg->flags & I2C_M_NOSTART)) - /* write the address */ + if (i2c->dynamic) { + u8 bytes; + u16 val; + + /* Clear and enable Rx full interrupt. */ + xiic_irq_clr_en(i2c, XIIC_INTR_RX_FULL_MASK | + XIIC_INTR_TX_ERROR_MASK); + + /* + * We want to get all but last byte, because the TX_ERROR IRQ + * is used to indicate error ACK on the address, and + * negative ack on the last received byte, so to not mix + * them receive all but last. + * In the case where there is only one byte to receive + * we can check if ERROR and RX full is set at the same time + */ + rx_watermark = msg->len; + bytes = min_t(u8, rx_watermark, IIC_RX_FIFO_DEPTH); + bytes--; + + xiic_setreg8(i2c, XIIC_RFD_REG_OFFSET, bytes); + + local_irq_save(flags); + if (!(msg->flags & I2C_M_NOSTART)) + /* write the address */ + xiic_setreg16(i2c, XIIC_DTR_REG_OFFSET, + i2c_8bit_addr_from_msg(msg) | + XIIC_TX_DYN_START_MASK); + + xiic_irq_clr_en(i2c, XIIC_INTR_BNB_MASK); + + /* If last message, include dynamic stop bit with length */ + val = (i2c->nmsgs == 1) ? XIIC_TX_DYN_STOP_MASK : 0; + val |= msg->len; + + xiic_setreg16(i2c, XIIC_DTR_REG_OFFSET, val); + local_irq_restore(flags); + } else { + /* + * If previous message is Tx, make sure that Tx FIFO is empty + * before starting a new transfer as the repeated start in + * standard mode can corrupt the transaction if there are + * still bytes to be transmitted in FIFO + */ + if (i2c->prev_msg_tx) { + int status; + + status = xiic_wait_tx_empty(i2c); + if (status) + return; + } + + cr = xiic_getreg8(i2c, XIIC_CR_REG_OFFSET); + + /* Set Receive fifo depth */ + rx_watermark = msg->len; + if (rx_watermark > IIC_RX_FIFO_DEPTH) { + rfd_set = IIC_RX_FIFO_DEPTH - 1; + } else if ((rx_watermark == 1) || (rx_watermark == 0)) { + rfd_set = rx_watermark - 1; + /* Handle single byte transfer separately */ + cr |= XIIC_CR_NO_ACK_MASK; + } else { + rfd_set = rx_watermark - 2; + } + + /* Check if RSTA should be set */ + if (cr & XIIC_CR_MSMS_MASK) { + /* Already a master, RSTA should be set */ + xiic_setreg8(i2c, XIIC_CR_REG_OFFSET, (cr | + XIIC_CR_REPEATED_START_MASK) & + ~(XIIC_CR_DIR_IS_TX_MASK)); + } + + xiic_setreg8(i2c, XIIC_RFD_REG_OFFSET, rfd_set); + + /* Clear and enable Rx full and transmit complete interrupts */ + xiic_irq_clr_en(i2c, XIIC_INTR_RX_FULL_MASK | + XIIC_INTR_TX_ERROR_MASK); + + /* Write the address */ xiic_setreg16(i2c, XIIC_DTR_REG_OFFSET, - i2c_8bit_addr_from_msg(msg) | XIIC_TX_DYN_START_MASK); + i2c_8bit_addr_from_msg(msg)); - xiic_irq_clr_en(i2c, XIIC_INTR_BNB_MASK); + /* Write to Control Register,to start transaction in Rx mode */ + if ((cr & XIIC_CR_MSMS_MASK) == 0) { + xiic_setreg8(i2c, XIIC_CR_REG_OFFSET, (cr | + XIIC_CR_MSMS_MASK) + & ~(XIIC_CR_DIR_IS_TX_MASK)); + } - xiic_setreg16(i2c, XIIC_DTR_REG_OFFSET, - msg->len | ((i2c->nmsgs == 1) ? XIIC_TX_DYN_STOP_MASK : 0)); - local_irq_restore(flags); + dev_dbg(i2c->adap.dev.parent, "%s end, ISR: 0x%x, CR: 0x%x\n", + __func__, xiic_getreg32(i2c, XIIC_IISR_OFFSET), + xiic_getreg8(i2c, XIIC_CR_REG_OFFSET)); + } if (i2c->nmsgs == 1) /* very last, enable bus not busy as well */ @@ -590,10 +795,17 @@ static void xiic_start_recv(struct xiic_i2c *i2c) /* the message is tx:ed */ i2c->tx_pos = msg->len; + + /* Enable interrupts */ + xiic_setreg32(i2c, XIIC_DGIER_OFFSET, XIIC_GINTR_ENABLE_MASK); + + i2c->prev_msg_tx = false; } static void xiic_start_send(struct xiic_i2c *i2c) { + u8 cr = 0; + u16 data; struct i2c_msg *msg = i2c->tx_msg; xiic_irq_clr(i2c, XIIC_INTR_TX_ERROR_MASK); @@ -604,22 +816,71 @@ static void xiic_start_send(struct xiic_i2c *i2c) __func__, xiic_getreg32(i2c, XIIC_IISR_OFFSET), xiic_getreg8(i2c, XIIC_CR_REG_OFFSET)); - if (!(msg->flags & I2C_M_NOSTART)) { - /* write the address */ - u16 data = i2c_8bit_addr_from_msg(msg) | - XIIC_TX_DYN_START_MASK; - if ((i2c->nmsgs == 1) && msg->len == 0) - /* no data and last message -> add STOP */ - data |= XIIC_TX_DYN_STOP_MASK; + if (i2c->dynamic) { + if (!(msg->flags & I2C_M_NOSTART)) { + /* write the address */ + data = i2c_8bit_addr_from_msg(msg) | + XIIC_TX_DYN_START_MASK; + + if (i2c->nmsgs == 1 && msg->len == 0) + /* no data and last message -> add STOP */ + data |= XIIC_TX_DYN_STOP_MASK; + + xiic_setreg16(i2c, XIIC_DTR_REG_OFFSET, data); + } + + xiic_fill_tx_fifo(i2c); + + /* Clear any pending Tx empty, Tx Error and then enable them */ + xiic_irq_clr_en(i2c, (XIIC_INTR_TX_EMPTY_MASK | + XIIC_INTR_TX_ERROR_MASK | + XIIC_INTR_BNB_MASK)); + } else { + /* + * If previous message is Tx, make sure that Tx FIFO is empty + * before starting a new transfer as the repeated start in + * standard mode can corrupt the transaction if there are + * still bytes to be transmitted in FIFO + */ + if (i2c->prev_msg_tx) { + int status; + + status = xiic_wait_tx_empty(i2c); + if (status) + return; + } + /* Check if RSTA should be set */ + cr = xiic_getreg8(i2c, XIIC_CR_REG_OFFSET); + if (cr & XIIC_CR_MSMS_MASK) { + /* Already a master, RSTA should be set */ + xiic_setreg8(i2c, XIIC_CR_REG_OFFSET, (cr | + XIIC_CR_REPEATED_START_MASK | + XIIC_CR_DIR_IS_TX_MASK) & + ~(XIIC_CR_NO_ACK_MASK)); + } + + /* Write address to FIFO */ + data = i2c_8bit_addr_from_msg(msg); xiic_setreg16(i2c, XIIC_DTR_REG_OFFSET, data); - } + /* Fill fifo */ + xiic_std_fill_tx_fifo(i2c); - xiic_fill_tx_fifo(i2c); + if ((cr & XIIC_CR_MSMS_MASK) == 0) { - /* Clear any pending Tx empty, Tx Error and then enable them. */ - xiic_irq_clr_en(i2c, XIIC_INTR_TX_EMPTY_MASK | XIIC_INTR_TX_ERROR_MASK | - XIIC_INTR_BNB_MASK); + /* Start Tx by writing to CR */ + cr = xiic_getreg8(i2c, XIIC_CR_REG_OFFSET); + xiic_setreg8(i2c, XIIC_CR_REG_OFFSET, cr | + XIIC_CR_MSMS_MASK | + XIIC_CR_DIR_IS_TX_MASK); + } + + /* Clear any pending Tx empty, Tx Error and then enable them */ + xiic_irq_clr_en(i2c, XIIC_INTR_TX_EMPTY_MASK | + XIIC_INTR_TX_ERROR_MASK | + XIIC_INTR_BNB_MASK); + } + i2c->prev_msg_tx = true; } static irqreturn_t xiic_isr(int irq, void *dev_id) @@ -703,7 +964,7 @@ static int xiic_start_xfer(struct xiic_i2c *i2c) static int xiic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) { struct xiic_i2c *i2c = i2c_get_adapdata(adap); - int err; + int err, count; dev_dbg(adap->dev.parent, "%s entry SR: 0x%x\n", __func__, xiic_getreg8(i2c, XIIC_SR_REG_OFFSET)); @@ -719,6 +980,21 @@ static int xiic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) i2c->tx_msg = msgs; i2c->nmsgs = num; + /* Decide standard mode or Dynamic mode */ + i2c->dynamic = true; + + /* Initialize prev message type */ + i2c->prev_msg_tx = false; + + /* Enter standard mode only when read length is > 255 bytes */ + for (count = 0; count < i2c->nmsgs; count++) { + if ((i2c->tx_msg[count].flags & I2C_M_RD) && + i2c->tx_msg[count].len > MAX_READ_LENGTH_DYNAMIC) { + i2c->dynamic = false; + break; + } + } + err = xiic_start_xfer(i2c); if (err < 0) { dev_err(adap->dev.parent, "Error xiic_start_xfer\n"); @@ -752,16 +1028,11 @@ static const struct i2c_algorithm xiic_algorithm = { .functionality = xiic_func, }; -static const struct i2c_adapter_quirks xiic_quirks = { - .max_read_len = 255, -}; - static const struct i2c_adapter xiic_adapter = { .owner = THIS_MODULE, .name = DRIVER_NAME, .class = I2C_CLASS_DEPRECATED, .algo = &xiic_algorithm, - .quirks = &xiic_quirks, }; From patchwork Mon May 31 13:19:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raviteja Narayanam X-Patchwork-Id: 12289383 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96ACEC47082 for ; Mon, 31 May 2021 13:24:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 56A596143C for ; Mon, 31 May 2021 13:24:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 56A596143C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EBwHjE5DBjECq+e6DOYvER1SeSABZN6N5o2JiITmqJg=; b=23QMw4yDC3JdIu Hngx79SON2c1PY5Ca+SE8peRlJw0dPh92nJWTDyrog8oENB92224shw80HTcoHQdZ4aB9jt9a7ryF WYty/J7sfg8wVkOBwgqaC8CPyqvqQlmi7gIHj40jYlq2KOPbfm6+7CqsMi3lmNy8KY9VABvygqWDU 5PH/4fRej1DhTYtVUF952y1Wvm+kXcwqYIDjSEZTDYnWw8aw5CdNLH9GT+bxjFc6UjKbwbVvMlkow /Y1a94wGT0fvEjHOvdVzPRI+UqcKKWVsySS5fP+ixjs9qqQ4PSYa3Tg2xpZDkbCYPNZOMKrcnqBDy rQZfO28PpJlrZwWDz+jw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnhrs-00CIO4-Bs; Mon, 31 May 2021 13:22:09 +0000 Received: from mail-mw2nam10on2085.outbound.protection.outlook.com ([40.107.94.85] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnhqs-00CI9h-9C for linux-arm-kernel@lists.infradead.org; Mon, 31 May 2021 13:21:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dKK+Jl0txPi8qItH6O3tcjhicbt+exx1L94bscoTXuegjKquQB9aKLN/byYVaGKNrzSTgFiHbMZ3gqFDXyrJWrMQ+7Ayexc8z16J0QZgRbIUpdbgN1SrWN+pgOGqGBRCOsKka9ooOQxuPISiwOsJvxczbv9ogEUCo8z3i092YvACmGy75voLX4k/QXRCFX7pA4H4oWvH6cJcDp6pcj2VckxFPiS1j+hgclZRgVqEVFH0nPmerZ2aS7IjMn+uHM2Yq8cSg+D6GLDwA9U2ZaTsZvR4t144y+PpBvQZ5yTYGw80UMdg+p7PmpZP/Dk45TAFD62ViGnHLOno+1Fnp/NkcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=373GpPjz4g+kjhHnXEviX5o+TUs9c11/a2JtL2KfzAo=; b=IdkOo/3CySOiS6+/rgvZEXPYPZYPtvvgjjen+mIwORaH0rl/j5OANr/e9CroIZcNAIAN65AyYferaY0qYSSuDzf9pvXJcPmcLvWvbO7RDUqfXuoJGCsLX/vdSrKEqvpRelPQxOZkjcL7elaoiP49fUEPvqkAZnZhP2UABP6YWpAgSfIDjBA+hL05uFSHBQUYOTqHDl4jI1iGDjt18yuHG4pXUpFcW5CVoD/KJ6Ik6ub6gL0t2Mf2WoU1ZaUdFV3LSH5tYVPcv/67Qo1qQykg/lC7fqF7z6duIUveWD6tozVzPxiX2vaWJ/r5kqEUqIykQcsFqQB8LbpTlnYR7IH6fQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=373GpPjz4g+kjhHnXEviX5o+TUs9c11/a2JtL2KfzAo=; b=DD/rZaG2rrEmHSVUPyL0Jbf3J22qE3V9NLLh624waKAx80h6RFrD5y7mUtsNMVJddwWZDMp51XgS+oozpM3F7tjShASmOyQsqxhEGsqFNun5vOmgII7piVJDtfds7q1wvQzbyxKIR+dMdTpIDg0Hlhy+rL+nI0j3p5C04PNzWhg= Received: from SN6PR2101CA0012.namprd21.prod.outlook.com (2603:10b6:805:106::22) by BN6PR02MB2660.namprd02.prod.outlook.com (2603:10b6:404:fd::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.24; Mon, 31 May 2021 13:20:54 +0000 Received: from SN1NAM02FT0060.eop-nam02.prod.protection.outlook.com (2603:10b6:805:106:cafe::10) by SN6PR2101CA0012.outlook.office365.com (2603:10b6:805:106::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.3 via Frontend Transport; Mon, 31 May 2021 13:20:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by SN1NAM02FT0060.mail.protection.outlook.com (10.97.4.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4150.30 via Frontend Transport; Mon, 31 May 2021 13:20:53 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 31 May 2021 06:20:37 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Mon, 31 May 2021 06:20:37 -0700 Received: from [10.140.6.25] (port=53014 helo=xhdnagasure40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lnhqN-0004GE-C6; Mon, 31 May 2021 06:20:35 -0700 From: Raviteja Narayanam To: , CC: , , , , Raviteja Narayanam Subject: [PATCH 03/10] i2c: xiic: Fix coding style issues Date: Mon, 31 May 2021 07:19:41 -0600 Message-ID: <20210531131948.19477-4-raviteja.narayanam@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210531131948.19477-1-raviteja.narayanam@xilinx.com> References: <20210531131948.19477-1-raviteja.narayanam@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3a7227ed-ec0a-480d-cd18-08d92436eb0d X-MS-TrafficTypeDiagnostic: BN6PR02MB2660: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:133; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: V1XjK7SsJX1edCaSwYHGoWLk9aG+B1l/DQ7kxjmPyRFTwzU3O+zSFZglFeI2MsuguK5UoZ1UE4iipUiD4qNxjM5cswqXzCfWu3oyDDCqg6PyJFfOb/kYEv94JYiUmwsXTNgr15bixx5rL0txZFUbzhgUzwavV4rL/R+dEKJ3fFrqjRWw0+bfbsyZ0F9eGWjiGuKDwXhbaDRMTJB5O6uoyqyhT47iGljrRgiRmu5ncAL9QhZ6dt/xXh03tfTeGj5lF3FiLVLH6gQhcRoXZIcRO0e0Bm0NHQqymW1J5odE1MCyxsVZ9ljUNsgBFmlEeYVbRMm0jqcO1v782+Se4iYhJd0afYmY/0aV97eyIf6iAf9B7tLVxSssdE3NY3jj0eRE/7DLUJd/uP/Ip2YnYAkjgkszS9lnixB1PviEs4L4mEpEbpGMbuTWibIflbpKr6W12XbZ4x3QDqPYXxZUzKTRRoR5hDSh/HNV9LItYdmYHMp92e83v/YGBbWfkx0UmhuzXFJ7jIg5kzze99yGQEianZsdkJwW0TZQ7ln76ZNYkNKpfRuFfxXpF3EKdND/3dHb/rXbyC1jmj58OJYpqfe6WcpQRLI/zIbqsBnkFN6m5oNkgQLUttozs8GuaeSNunThLbcxekoVpJfC6ULgbK1EjnH1ZpXnvqrsslV+ONs7cmx6cEBygddNN5iCQA1JLxvY X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(39860400002)(376002)(396003)(136003)(346002)(36840700001)(46966006)(4326008)(186003)(44832011)(1076003)(6636002)(2906002)(47076005)(36756003)(478600001)(82310400003)(36860700001)(5660300002)(107886003)(2616005)(426003)(336012)(83380400001)(7696005)(110136005)(356005)(316002)(7636003)(9786002)(26005)(70206006)(8676002)(8936002)(82740400003)(70586007)(6666004)(54906003)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2021 13:20:53.9220 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3a7227ed-ec0a-480d-cd18-08d92436eb0d X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0060.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR02MB2660 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210531_062106_390538_F3183546 X-CRM114-Status: GOOD ( 25.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Michal Simek Most of these stuff are reported by checkpatch. But fixes are: - Incorrect indetation - Missing blank line after variable declaration - Additional () - Missing spaces around + - Else after if with return - Missing parenthesis when if has them - Newlines - Remove MODULE_ALIAS - none is really using it - Changing msleep to usleep_range - Other trivial fixes Signed-off-by: Michal Simek Signed-off-by: Raviteja Narayanam --- drivers/i2c/busses/i2c-xiic.c | 69 +++++++++++++++++------------------ 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 004103267e9c..fa2eef9e622f 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -69,7 +69,7 @@ struct xiic_i2c { wait_queue_head_t wait; struct i2c_adapter adap; struct i2c_msg *tx_msg; - struct mutex lock; + struct mutex lock; /* Locking between isr and new xfer */ unsigned int tx_pos; unsigned int nmsgs; struct i2c_msg *rx_msg; @@ -82,24 +82,23 @@ struct xiic_i2c { bool prev_msg_tx; }; - #define XIIC_MSB_OFFSET 0 -#define XIIC_REG_OFFSET (0x100+XIIC_MSB_OFFSET) +#define XIIC_REG_OFFSET (0x100 + XIIC_MSB_OFFSET) /* * Register offsets in bytes from RegisterBase. Three is added to the * base offset to access LSB (IBM style) of the word */ -#define XIIC_CR_REG_OFFSET (0x00+XIIC_REG_OFFSET) /* Control Register */ -#define XIIC_SR_REG_OFFSET (0x04+XIIC_REG_OFFSET) /* Status Register */ -#define XIIC_DTR_REG_OFFSET (0x08+XIIC_REG_OFFSET) /* Data Tx Register */ -#define XIIC_DRR_REG_OFFSET (0x0C+XIIC_REG_OFFSET) /* Data Rx Register */ -#define XIIC_ADR_REG_OFFSET (0x10+XIIC_REG_OFFSET) /* Address Register */ -#define XIIC_TFO_REG_OFFSET (0x14+XIIC_REG_OFFSET) /* Tx FIFO Occupancy */ -#define XIIC_RFO_REG_OFFSET (0x18+XIIC_REG_OFFSET) /* Rx FIFO Occupancy */ -#define XIIC_TBA_REG_OFFSET (0x1C+XIIC_REG_OFFSET) /* 10 Bit Address reg */ -#define XIIC_RFD_REG_OFFSET (0x20+XIIC_REG_OFFSET) /* Rx FIFO Depth reg */ -#define XIIC_GPO_REG_OFFSET (0x24+XIIC_REG_OFFSET) /* Output Register */ +#define XIIC_CR_REG_OFFSET (0x00 + XIIC_REG_OFFSET) /* Control Register */ +#define XIIC_SR_REG_OFFSET (0x04 + XIIC_REG_OFFSET) /* Status Register */ +#define XIIC_DTR_REG_OFFSET (0x08 + XIIC_REG_OFFSET) /* Data Tx Register */ +#define XIIC_DRR_REG_OFFSET (0x0C + XIIC_REG_OFFSET) /* Data Rx Register */ +#define XIIC_ADR_REG_OFFSET (0x10 + XIIC_REG_OFFSET) /* Address Register */ +#define XIIC_TFO_REG_OFFSET (0x14 + XIIC_REG_OFFSET) /* Tx FIFO Occupancy */ +#define XIIC_RFO_REG_OFFSET (0x18 + XIIC_REG_OFFSET) /* Rx FIFO Occupancy */ +#define XIIC_TBA_REG_OFFSET (0x1C + XIIC_REG_OFFSET) /* 10 Bit Address reg */ +#define XIIC_RFD_REG_OFFSET (0x20 + XIIC_REG_OFFSET) /* Rx FIFO Depth reg */ +#define XIIC_GPO_REG_OFFSET (0x24 + XIIC_REG_OFFSET) /* Output Register */ /* Control Register masks */ #define XIIC_CR_ENABLE_DEVICE_MASK 0x01 /* Device enable = 1 */ @@ -237,18 +236,21 @@ static inline int xiic_getreg32(struct xiic_i2c *i2c, int reg) static inline void xiic_irq_dis(struct xiic_i2c *i2c, u32 mask) { u32 ier = xiic_getreg32(i2c, XIIC_IIER_OFFSET); + xiic_setreg32(i2c, XIIC_IIER_OFFSET, ier & ~mask); } static inline void xiic_irq_en(struct xiic_i2c *i2c, u32 mask) { u32 ier = xiic_getreg32(i2c, XIIC_IIER_OFFSET); + xiic_setreg32(i2c, XIIC_IIER_OFFSET, ier | mask); } static inline void xiic_irq_clr(struct xiic_i2c *i2c, u32 mask) { u32 isr = xiic_getreg32(i2c, XIIC_IISR_OFFSET); + xiic_setreg32(i2c, XIIC_IISR_OFFSET, isr & mask); } @@ -418,7 +420,8 @@ static void xiic_fill_tx_fifo(struct xiic_i2c *i2c) while (len--) { u16 data = i2c->tx_msg->buf[i2c->tx_pos++]; - if ((xiic_tx_space(i2c) == 0) && (i2c->nmsgs == 1)) { + + if (!xiic_tx_space(i2c) && i2c->nmsgs == 1) { /* last message in transfer -> STOP */ data |= XIIC_TX_DYN_STOP_MASK; dev_dbg(i2c->adap.dev.parent, "%s TX STOP\n", __func__); @@ -519,8 +522,8 @@ static irqreturn_t xiic_process(int irq, void *dev_id) /* Service requesting interrupt */ if ((pend & XIIC_INTR_ARB_LOST_MASK) || - ((pend & XIIC_INTR_TX_ERROR_MASK) && - !(pend & XIIC_INTR_RX_FULL_MASK))) { + ((pend & XIIC_INTR_TX_ERROR_MASK) && + !(pend & XIIC_INTR_RX_FULL_MASK))) { /* bus arbritration lost, or... * Transmit error _OR_ RX completed * if this happens when RX_FULL is not set @@ -662,9 +665,8 @@ static int xiic_busy(struct xiic_i2c *i2c) * should ignore it, since bus will never be released and i2c will be * stuck forever. */ - if (i2c->singlemaster) { + if (i2c->singlemaster) return 0; - } /* for instance if previous transfer was terminated due to TX error * it might be that the bus is on it's way to become available @@ -672,7 +674,7 @@ static int xiic_busy(struct xiic_i2c *i2c) */ err = xiic_bus_busy(i2c); while (err && tries--) { - msleep(1); + usleep_range(1000, 2000); err = xiic_bus_busy(i2c); } @@ -867,7 +869,6 @@ static void xiic_start_send(struct xiic_i2c *i2c) xiic_std_fill_tx_fifo(i2c); if ((cr & XIIC_CR_MSMS_MASK) == 0) { - /* Start Tx by writing to CR */ cr = xiic_getreg8(i2c, XIIC_CR_REG_OFFSET); xiic_setreg8(i2c, XIIC_CR_REG_OFFSET, cr | @@ -891,9 +892,6 @@ static irqreturn_t xiic_isr(int irq, void *dev_id) /* Do not processes a devices interrupts if the device has no * interrupts pending */ - - dev_dbg(i2c->adap.dev.parent, "%s entry\n", __func__); - isr = xiic_getreg32(i2c, XIIC_IISR_OFFSET); ier = xiic_getreg32(i2c, XIIC_IIER_OFFSET); pend = isr & ier; @@ -907,6 +905,7 @@ static void __xiic_start_xfer(struct xiic_i2c *i2c) { int first = 1; int fifo_space = xiic_tx_fifo_space(i2c); + dev_dbg(i2c->adap.dev.parent, "%s entry, msg: %p, fifos space: %d\n", __func__, i2c->tx_msg, fifo_space); @@ -921,19 +920,20 @@ static void __xiic_start_xfer(struct xiic_i2c *i2c) i2c->nmsgs--; i2c->tx_msg++; i2c->tx_pos = 0; - } else + } else { first = 0; + } if (i2c->tx_msg->flags & I2C_M_RD) { /* we dont date putting several reads in the FIFO */ xiic_start_recv(i2c); return; - } else { - xiic_start_send(i2c); - if (xiic_tx_space(i2c) != 0) { - /* the message could not be completely sent */ - break; - } + } + + xiic_start_send(i2c); + if (xiic_tx_space(i2c) != 0) { + /* the message could not be completely sent */ + break; } fifo_space = xiic_tx_fifo_space(i2c); @@ -944,12 +944,12 @@ static void __xiic_start_xfer(struct xiic_i2c *i2c) */ if (i2c->nmsgs > 1 || xiic_tx_space(i2c)) xiic_irq_clr_en(i2c, XIIC_INTR_TX_HALF_MASK); - } static int xiic_start_xfer(struct xiic_i2c *i2c) { int ret; + mutex_lock(&i2c->lock); ret = xiic_reinit(i2c); @@ -1001,8 +1001,8 @@ static int xiic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) goto out; } - if (wait_event_timeout(i2c->wait, (i2c->state == STATE_ERROR) || - (i2c->state == STATE_DONE), HZ)) { + if (wait_event_timeout(i2c->wait, i2c->state == STATE_ERROR || + i2c->state == STATE_DONE, HZ)) { err = (i2c->state == STATE_DONE) ? num : -EIO; goto out; } else { @@ -1035,7 +1035,6 @@ static const struct i2c_adapter xiic_adapter = { .algo = &xiic_algorithm, }; - static int xiic_i2c_probe(struct platform_device *pdev) { struct xiic_i2c *i2c; @@ -1195,6 +1194,7 @@ static const struct dev_pm_ops xiic_dev_pm_ops = { SET_RUNTIME_PM_OPS(xiic_i2c_runtime_suspend, xiic_i2c_runtime_resume, NULL) }; + static struct platform_driver xiic_i2c_driver = { .probe = xiic_i2c_probe, .remove = xiic_i2c_remove, @@ -1210,4 +1210,3 @@ module_platform_driver(xiic_i2c_driver); MODULE_AUTHOR("info@mocean-labs.com"); MODULE_DESCRIPTION("Xilinx I2C bus driver"); MODULE_LICENSE("GPL v2"); -MODULE_ALIAS("platform:"DRIVER_NAME); From patchwork Mon May 31 13:19:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raviteja Narayanam X-Patchwork-Id: 12289385 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0CE5C47080 for ; Mon, 31 May 2021 13:24:40 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 866F961437 for ; Mon, 31 May 2021 13:24:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 866F961437 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eoZUK6+lGgqobV3l1G5d2pd6BJbKZRrfz34kd04l/M4=; b=40yqzHRrCkVZLg 4y3FI7xgjWyGF00UsukmYEql0XIpmZz2631IKGwPvNJqZmJaRge+gPQeCM0GVl+BLPvRZXX9cvMVu nQAlJeXHvUt1+zeYcC/xGRd1WMQBEmkHz/RfNg7FniUvZnnCKQp4g3nzPGjOBorf7scxcBKu3jCcp G6JRQnykl+Rf5WeZUlZpjfAQyaPz1dokWjjQrdw/DjWyV6YBaPBzpzehy3KAgvLJent0XC/HYeTGK zf9IucZgIr9hKgY7wyGz7uj1mqXMzfJXM2lrFpOSJe7uA2J1l+JJ+hQfvb+K7AFr6U7S9B8E74RpE gfyC7IbqLUCQCJU9Gbiw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnhsK-00CIWe-OR; Mon, 31 May 2021 13:22:37 +0000 Received: from mail-mw2nam10on2069.outbound.protection.outlook.com ([40.107.94.69] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnhr4-00CIBF-KE for linux-arm-kernel@lists.infradead.org; Mon, 31 May 2021 13:21:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ko4BbthXis4HWXsTW2mvkWFZGoQBp0P2aAseMPfEXTHcdvr/eheGxKD7emD5RjBHZ8T9gQEtm4aNLw/U4ge9jXivEu+p/7znFNhZQ2NuxuG+8XqatWTa0ZgGnOlFZcv+27gAPbEMuHVZ99gu8kAv2ZdPA5IZarzKz6wNkC3S8B5zWhiCy7dRtDMGNjyCcw7AGOwUuQY9Zd320xA37RBGzHVIP/N8WOWAfoLHriRECqMpbzgJSy5gWcx6WdQuEueWL7nCfB/Uw6wgwguofsL5XpmCDa2IsK+/BfFNTAMCggQ0KJ0rHJJZLjqGTBErjBJe4vDgtcDDVgIslg0cXf0AjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iumiq/0C8WuU8ugMFid/jCCxE70N8/gFak5ZMoT9yNM=; b=nBbapYqiYohd3LXh020cxPftfMSkjyVX8DOBWjxkPsB2eEcwi7/nJ1xkZsYcPedZpGTNZgJmexI8TltgvfDSiU+VxjLZPqO7iqndu3MBNDEyi4Y5VlLoVZHRszA+ZR+oQ+63/WRx4Wc1R2E+TNpxA8HzGHM0UIvDSfidhazg+uUlRuKFixY0tONEAVWrJ6jrscUSOCi60vcHcssqjH0ZLm80Zw4MvxXgr+aGichxDx2Q3ufZo+JphBGV15ON/UFe/x8D27TfcMsdOw+OWPgTOHEJ6n+N6UT/mtB+b3gdtmbLnQWG17cQpjPY4sRpvOZaAhO6H5RHRLGIwj6VX/R/rg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iumiq/0C8WuU8ugMFid/jCCxE70N8/gFak5ZMoT9yNM=; b=K6FI9Qxg3o/x9CjJfCjlcz6Ms+VxsMyHctqAkWnwyhqWDM6ywulVEvtcMtyRDcHOUwEL+ys526YaMXgSLZOtxTKlFDYYorVN6z5r9K+6q61FLkW5UctNLaZhQCmgVs1Y5dZZYstHPcXtCkBlEkYN+LJNJrmshUCKfrUBr9pU1G4= Received: from SN2PR01CA0067.prod.exchangelabs.com (2603:10b6:800::35) by BN8PR02MB5730.namprd02.prod.outlook.com (2603:10b6:408:ae::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.21; Mon, 31 May 2021 13:21:16 +0000 Received: from SN1NAM02FT0013.eop-nam02.prod.protection.outlook.com (2603:10b6:800:0:cafe::91) by SN2PR01CA0067.outlook.office365.com (2603:10b6:800::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.21 via Frontend Transport; Mon, 31 May 2021 13:21:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by SN1NAM02FT0013.mail.protection.outlook.com (10.97.4.188) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4150.30 via Frontend Transport; Mon, 31 May 2021 13:21:15 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 31 May 2021 06:20:42 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Mon, 31 May 2021 06:20:42 -0700 Received: from [10.140.6.25] (port=53014 helo=xhdnagasure40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lnhqS-0004GE-MU; Mon, 31 May 2021 06:20:41 -0700 From: Raviteja Narayanam To: , CC: , , , , Raviteja Narayanam Subject: [PATCH 04/10] i2c: xiic: Add smbus_block_read functionality Date: Mon, 31 May 2021 07:19:42 -0600 Message-ID: <20210531131948.19477-5-raviteja.narayanam@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210531131948.19477-1-raviteja.narayanam@xilinx.com> References: <20210531131948.19477-1-raviteja.narayanam@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a7d5f4b0-0d31-4f2e-a3cd-08d92436f7e7 X-MS-TrafficTypeDiagnostic: BN8PR02MB5730: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZG8lS9U15VKQOyn8HcOouHdDg0LQE51APXRUGz7vy3toitYSKELMsUNBvE/9AIWFJpBKos2CjbJvf9rtBHWkMfxwGkVaunDU4k/g9lBLGIkCWJwwgN1q5Uta75NjzqMd2uX/hiGVsIGdd+LektqWafEwzi1KTNLpZt27aKJ7t0pDA9RSZ5tm08KP21g+ehqhOo09soC6+/E+QYyxqUJKTpNvyJRQ6Rv+Y5yVgMdbXlv0EUKOjHvTgPWprDzUYiyzqwEMAEY6uTQYSAKuZ41qbkdcUca++QJN/JsRqciNxjKFdKkDR5fLi4Jag4JkUljX1L+9C12w7YvbMS8lQrAjZFEm+BAi6N7k5qMwdvBiFAwMTJ4dP5631yA5WEBQEErwS6T0gJ0ExBR/1VG5r/oH/4ajmPafJPJTtfWR2jr22jg72Pea/NXkcz+2cr2pf8hDWnoWeSM9WHhHGtNTCkBVEHXHQDH0m8YSQTQ3dS67kqsCMLkD0u5jrQg5/IOOfFNEc5P2gHHSkqHRFUbrb23aSnUqFrJZtRgT9ImxluaoDm9ucFtbRZkrHQjPw7HPICtXVBdk+l/D/GqxB43zJX31yM9G5W57D/zaIy1aFFrtyGT4W4StMZAGyWjUfkf8I7QAGLNqt3nXUMp/ucgAL+wK1P1IKB7w3Pv4jNxRTCKhXlzWw6UDEpfXeGESsdrB+I9hyIv8XYEhE2GB1NBlntsg6A== X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(396003)(39860400002)(376002)(346002)(136003)(36840700001)(46966006)(7696005)(5660300002)(36860700001)(26005)(426003)(110136005)(186003)(1076003)(2906002)(316002)(8676002)(478600001)(47076005)(8936002)(82310400003)(70206006)(4326008)(6636002)(2616005)(70586007)(43170500006)(82740400003)(7636003)(44832011)(36756003)(83380400001)(356005)(336012)(54906003)(107886003)(9786002)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2021 13:21:15.4823 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a7d5f4b0-0d31-4f2e-a3cd-08d92436f7e7 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0013.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR02MB5730 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210531_062118_713002_F2DD18FC X-CRM114-Status: GOOD ( 24.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org smbus_block_read is added to xiic driver to read from few sensors which support this command. Since the number of bytes to read is not known prior to transfer, we are using xiic standard mode for low level control of IP. Signed-off-by: Raviteja Narayanam --- drivers/i2c/busses/i2c-xiic.c | 82 ++++++++++++++++++++++++++++++++--- 1 file changed, 76 insertions(+), 6 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index fa2eef9e622f..51b5fd5768db 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -62,6 +62,7 @@ enum xiic_endian { * @singlemaster: Indicates bus is single master * @dynamic: Mode of controller * @prev_msg_tx: Previous message is Tx + * @smbus_block_read: Flag to handle block read */ struct xiic_i2c { struct device *dev; @@ -80,6 +81,7 @@ struct xiic_i2c { bool singlemaster; bool dynamic; bool prev_msg_tx; + bool smbus_block_read; }; #define XIIC_MSB_OFFSET 0 @@ -336,6 +338,54 @@ static void xiic_deinit(struct xiic_i2c *i2c) xiic_setreg8(i2c, XIIC_CR_REG_OFFSET, cr & ~XIIC_CR_ENABLE_DEVICE_MASK); } +static void xiic_smbus_block_read_setup(struct xiic_i2c *i2c) +{ + u8 rxmsg_len; + u8 rfd_set = 0; + + /* + * Clear the I2C_M_RECV_LEN flag to avoid setting + * message length again + */ + i2c->rx_msg->flags &= ~I2C_M_RECV_LEN; + + /* Set smbus_block_read flag to identify in isr */ + i2c->smbus_block_read = true; + + /* Read byte from rx fifo and set message length */ + rxmsg_len = xiic_getreg8(i2c, XIIC_DRR_REG_OFFSET); + + i2c->rx_msg->buf[i2c->rx_pos++] = rxmsg_len; + + /* Check if received length is valid */ + if (rxmsg_len <= I2C_SMBUS_BLOCK_MAX) { + /* Set Receive fifo depth */ + if (rxmsg_len > IIC_RX_FIFO_DEPTH) { + rfd_set = IIC_RX_FIFO_DEPTH - 1; + i2c->rx_msg->len = rxmsg_len + 1; + } else if ((rxmsg_len == 1) || + (rxmsg_len == 0)) { + /* + * Minimum of 3 bytes required to exit cleanly. 1 byte + * already received, Second byte is being received. Have + * to set NACK in read_rx before receiving the last byte + */ + i2c->rx_msg->len = 3; + } else { + rfd_set = rxmsg_len - 2; + i2c->rx_msg->len = rxmsg_len + 1; + } + xiic_setreg8(i2c, XIIC_RFD_REG_OFFSET, rfd_set); + + return; + } + + /* Invalid message length, trigger STATE_ERROR with tx_msg_len in ISR */ + i2c->tx_msg->len = 3; + i2c->smbus_block_read = false; + dev_err(i2c->adap.dev.parent, "smbus_block_read Invalid msg length\n"); +} + static void xiic_read_rx(struct xiic_i2c *i2c) { u8 bytes_in_fifo, cr = 0, bytes_to_read = 0; @@ -358,6 +408,12 @@ static void xiic_read_rx(struct xiic_i2c *i2c) if (!i2c->dynamic) { bytes_rem = xiic_rx_space(i2c) - bytes_in_fifo; + /* Set msg length if smbus_block_read */ + if (i2c->rx_msg->flags & I2C_M_RECV_LEN) { + xiic_smbus_block_read_setup(i2c); + return; + } + if (bytes_rem > IIC_RX_FIFO_DEPTH) { bytes_to_read = bytes_in_fifo; } else if (bytes_rem > 1) { @@ -627,6 +683,12 @@ static irqreturn_t xiic_process(int irq, void *dev_id) /* The bus is not busy, disable BusNotBusy interrupt */ xiic_irq_dis(i2c, XIIC_INTR_BNB_MASK); + if (i2c->tx_msg && i2c->smbus_block_read) { + i2c->smbus_block_read = false; + /* Set requested message len=1 to indicate STATE_DONE */ + i2c->tx_msg->len = 1; + } + if (!i2c->tx_msg) goto out; @@ -755,8 +817,12 @@ static void xiic_start_recv(struct xiic_i2c *i2c) rfd_set = IIC_RX_FIFO_DEPTH - 1; } else if ((rx_watermark == 1) || (rx_watermark == 0)) { rfd_set = rx_watermark - 1; - /* Handle single byte transfer separately */ - cr |= XIIC_CR_NO_ACK_MASK; + + /* Set No_ACK, except for smbus_block_read */ + if (!(i2c->rx_msg->flags & I2C_M_RECV_LEN)) { + /* Handle single byte transfer separately */ + cr |= XIIC_CR_NO_ACK_MASK; + } } else { rfd_set = rx_watermark - 2; } @@ -986,10 +1052,14 @@ static int xiic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) /* Initialize prev message type */ i2c->prev_msg_tx = false; - /* Enter standard mode only when read length is > 255 bytes */ + /* + * Enter standard mode only when read length is > 255 bytes or + * for smbus_block_read transaction + */ for (count = 0; count < i2c->nmsgs; count++) { - if ((i2c->tx_msg[count].flags & I2C_M_RD) && - i2c->tx_msg[count].len > MAX_READ_LENGTH_DYNAMIC) { + if (((i2c->tx_msg[count].flags & I2C_M_RD) && + i2c->tx_msg[count].len > MAX_READ_LENGTH_DYNAMIC) || + (i2c->tx_msg[count].flags & I2C_M_RECV_LEN)) { i2c->dynamic = false; break; } @@ -1020,7 +1090,7 @@ static int xiic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) static u32 xiic_func(struct i2c_adapter *adap) { - return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; + return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL | I2C_FUNC_SMBUS_BLOCK_DATA; } static const struct i2c_algorithm xiic_algorithm = { From patchwork Mon May 31 13:19:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raviteja Narayanam X-Patchwork-Id: 12289387 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8744C47080 for ; Mon, 31 May 2021 13:25:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8F20D61443 for ; Mon, 31 May 2021 13:25:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F20D61443 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xCknq5YR6AdQppuzJlBh+JzGjKWq2nVvnM0xtZr0Afg=; b=0RjScfIT7LWZ32 5gD+jwUu9jnHZ0FUbnQFAyWJgaadauZXr3SmHsV6Gb/c1Jv6lc/QIWbAukMPe05Pg/jg4eeSmAjqF G/Ic4A4jeQYhcsK8Mbd0BNSzoLB5eI1ASM+pyfjkkcBkxOFr10qhuXzYHYPwIDo8aT/RQXNVGFZNC WFjjFsDIYdmfFoG1a4hiKWPwDCMpyeD/kqrmSzmdcQMUXzUA1X/tFFrbBZsZPXhiG5+N1TSta6AgS aXIUkMy6UO92/bDcX1DEjBoD54dQne8mbRjZPMFHvJ4xSwBBoAW1M3UZiEhrjijBVVFCPAWHE5khv 1Sl/n3vlNatQBB54pUqQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnhsp-00CIi4-Aq; Mon, 31 May 2021 13:23:08 +0000 Received: from mail-co1nam11on2051.outbound.protection.outlook.com ([40.107.220.51] helo=NAM11-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnhr8-00CICK-3g for linux-arm-kernel@lists.infradead.org; Mon, 31 May 2021 13:21:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KuyNRAIbmVAFdwl8d4e5upihZK78q2GDvJL9mb96BVZZ2dcrKrWXr8ryuXXuJmK9RaIbV61CD82OrHWZJmHlCjE5XD0Y5b0mA0ZKQ5Q5MDfw6UyvJxXRulj5lEemEIlRgE2lAZq0PR7ug5uutEPaRb2kdzywnrUG6JTd45M3/zTod9AHfZGoVdFWPwPmVNvizlFGgEhRwAkk0fL7/NVto5jNCCkoeKDQ9qV+PEZ7M6GIefjm/82RSlTnEJ5Di6zljpRX9tmriB3e26mqstBuefPdJ94f2ec4QncAZeBQFphxZ9bOpLKPY5wMy3BGkLWYB1VPo7jFqVYZkDJDGzYpQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ClKogobnQcNSwgLE99C4BZTqFyy1HYLlq1HIx6KRyvA=; b=LW8asUwBcP1ij5TvXz7D0MMMNTSkFoS6s60y+/emTWSNxauEyXSzCjYi/gLvKa/ougxiK9vYumCsOUoDYsCInBE7psyrLnIpNXrer3JI5EnkFq4yNfiNV84MnuKANqHNjc45mSCEyR7mdmbtccICIrmaKcVmpfSeEJyVQwDQCKjbHpbawd3uQMtLQQPV0WDBc6IvtA2Loh4xqgFSJKvpxa+QONGD9NCmn55L4GxHmvHOD75A4m7mklFL8Jqem9GIGxRP2JKV0/iBjlJOfM+KBYurRnxw9xd6qQ+H+NpVRHnVvaFfIDqro5WJJNKk0QE3FoiZCDZt6cYJJ0RuXWphMw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ClKogobnQcNSwgLE99C4BZTqFyy1HYLlq1HIx6KRyvA=; b=gQ5CxCMg558eZZQK4SUeWoWID/LxRkEcc1EI0xxpRlpE+ozSGdfrkn8aUFmQ5o8aHBYjD//b4amSmdY9VxHttF81LZw60wh7Zp+JjFm1FtiWwSnWqzE/BsWYSsM8qN7r7OEcq+YDY05FpeO+hjmljFGDyhyhukCyShI5McixNyU= Received: from SN6PR04CA0089.namprd04.prod.outlook.com (2603:10b6:805:f2::30) by MN2PR02MB6766.namprd02.prod.outlook.com (2603:10b6:208:1dc::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.20; Mon, 31 May 2021 13:21:19 +0000 Received: from SN1NAM02FT0018.eop-nam02.prod.protection.outlook.com (2603:10b6:805:f2:cafe::db) by SN6PR04CA0089.outlook.office365.com (2603:10b6:805:f2::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.20 via Frontend Transport; Mon, 31 May 2021 13:21:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by SN1NAM02FT0018.mail.protection.outlook.com (10.97.5.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4150.30 via Frontend Transport; Mon, 31 May 2021 13:21:19 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 31 May 2021 06:20:47 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Mon, 31 May 2021 06:20:47 -0700 Received: from [10.140.6.25] (port=53014 helo=xhdnagasure40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lnhqX-0004GE-Ne; Mon, 31 May 2021 06:20:46 -0700 From: Raviteja Narayanam To: , CC: , , , , Shubhrajyoti Datta , Raviteja Narayanam Subject: [PATCH 05/10] i2c: xiic: Return value of xiic_reinit Date: Mon, 31 May 2021 07:19:43 -0600 Message-ID: <20210531131948.19477-6-raviteja.narayanam@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210531131948.19477-1-raviteja.narayanam@xilinx.com> References: <20210531131948.19477-1-raviteja.narayanam@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5b2e8fb6-728f-4cdc-140b-08d92436fa0d X-MS-TrafficTypeDiagnostic: MN2PR02MB6766: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:2399; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: E3vUVEp3RjPrwZu/Xw84nU1ahOl8HfqiJD8zYnr4UiO3EPiCJxqHJaEjNjpUaDlpBOAuO+n9PEfX79/0STL9GYAb/9mRIYFr6mZ9oL1g9D6r3oIQHoqvuMt0iNKyHNgrMaL5oYKeyP91K5ArZQd3cOEDzNFa3He4noICxBDHhA+G1A0/MSu7fBF/3HcvkwdYXLSB6Mm+pnzdjJK69S8M7vBH7OhmnyNhdOjo25mjd1E59A5pqP3oQAT8WA+O63kdZe4k/fWQVipEKdgKjiBXlNfJvozb7PEx9mA5VvghwIEh28HsBYH/wh0e1AWVnxRr7vmmIeA2YkSCr7UptEslNSMl+euFtrDot+Y4P+z0pr2U107ik7wqt4jev8ybkR7LRREaTb0NGxPjnPivGiepZx9VTlEHWMz5C5B/Z32uTN3GeG3XQ1MhY8fbvFsHQXWURF7IRvLDSe0WAa59bXDJTJRWWyCa+RxntbhxYXiF4WkHLft5HJdzzVMGXXo9dmYiszGx538pywYj4BgSocs2k6j4snviKeRKXhTigNm4EOeEorBN0hULunQJ+EK6sSqrnMJg9ihcoKWxoJF0RVadqcnSd5b6BQSFdbZ/6oEcEtvwJQi9UZuGEPaUL2qNeY1SHeEWxnw/cQDyfGQLpr1oFaU1znSzU4FZnELZUjkFmi8sX3YbobNqJdYfE3Fwr3vX X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(136003)(346002)(396003)(39860400002)(376002)(36840700001)(46966006)(7696005)(2616005)(44832011)(5660300002)(26005)(36756003)(336012)(478600001)(426003)(9786002)(6636002)(70206006)(110136005)(47076005)(54906003)(8676002)(4326008)(2906002)(82310400003)(83380400001)(82740400003)(1076003)(8936002)(186003)(36906005)(70586007)(316002)(107886003)(36860700001)(7636003)(6666004)(356005)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2021 13:21:19.0831 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5b2e8fb6-728f-4cdc-140b-08d92436fa0d X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0018.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6766 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210531_062122_200149_02A2A336 X-CRM114-Status: GOOD ( 13.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Shubhrajyoti Datta Check the return value of xiic_reinit. Signed-off-by: Shubhrajyoti Datta Signed-off-by: Raviteja Narayanam --- drivers/i2c/busses/i2c-xiic.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 51b5fd5768db..b2ac76d94212 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -556,6 +556,7 @@ static irqreturn_t xiic_process(int irq, void *dev_id) struct xiic_i2c *i2c = dev_id; u32 pend, isr, ier; u32 clr = 0; + int ret; /* Get the interrupt Status from the IPIF. There is no clearing of * interrupts in the IPIF. Interrupts must be cleared at the source. @@ -592,7 +593,9 @@ static irqreturn_t xiic_process(int irq, void *dev_id) * fifos and the next message is a TX with len 0 (only addr) * reset the IP instead of just flush fifos */ - xiic_reinit(i2c); + ret = xiic_reinit(i2c); + if (!ret) + dev_dbg(i2c->adap.dev.parent, "reinit failed\n"); if (i2c->rx_msg) xiic_wakeup(i2c, STATE_ERROR); From patchwork Mon May 31 13:19:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raviteja Narayanam X-Patchwork-Id: 12289389 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73997C47096 for ; Mon, 31 May 2021 13:26:05 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3B9596135C for ; Mon, 31 May 2021 13:26:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3B9596135C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=v2udLv556vkEbdj8vhXLxiiwwMzeAC8RvcFE6Yz5ODo=; b=WVm+yP74HCsFRS k0mo7EltNLN8fzQZm/KfT1aRw3l3IJECSYUoYrshl2BTNWHxBWuHvJvybuMT+RXHdIv9bw8zcB2rq s4nZWh45/RNP8t6CwopiwVUkjbHYhB18CkkE8+9POFrhz+XF1Cec9t7AMmeMdaWTCMzCUVYyWtKRp pQk1OBUnxDIXBuTV0LuJeNUnLWI1bx3765u7YBY88uOL6I/i4BNY60YR65bTuVD6lfMGRaXtYjbhp Dq8KWElsZDrW8l2PKhHktboYgK1vFRRI963Vx56dc8ZdvqBBHwVXwDyfGboXntDmiXeh+VTV0RoAk ztoRlgzetd6ayCFsJ3Dg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnhtc-00CIzK-CT; Mon, 31 May 2021 13:23:57 +0000 Received: from mail-mw2nam08on2071.outbound.protection.outlook.com ([40.107.101.71] helo=NAM04-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnhr9-00CID0-J2 for linux-arm-kernel@lists.infradead.org; Mon, 31 May 2021 13:21:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MCLjOS6/3YUfFPwISAjxcewjZ18mOkO0YvDVASpTGTM+KFL9qWoo6HX1ICOHHDUhyLGmJAgYDON25Ahq3RT1XQod/LBPxyTurWmCTh9P3XaUQzChN9IxFOg4pqA4skla76kKwZQwOvGxsDxhkEBYMA7FDYbeBFiO+sA2j4KJ3aZ0/PO3xIZN4Oysx1G5wFOaBStArMvkUVLiaSa4cRWMjBuc8wCkb6yRbjQ1mwaV4PbvlhDTwq7IuWuqzFZi+j8diOf3hDiO3V5ygzWqWNygR51Ji5oH0IoGVpcf5P4/puZOWlEFRtLB/d7QFMeJhNq9kC0CsEX7qUH24IDMhSDkuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=olQ1kIRSGkHH5KiXTQs67sKPfMcfsrDpvuJOb37YkVI=; b=N9h8Z4DeAqpc05joslNh/D622yboy+nU851fCOgncGyW7LFkBpGpZ93YgqT47f6g3HHeRYsdv0HzJ24uvUolsygIRkgqO/MBmkC5lXYe/z36Qe9jbZSBhntqEVXgbY7+6YHoCT957UNtfxLYf42Gr0caZlBOXD320t4rN/R9Fb5lh/KT73Ah5ID08daD8Ln+H+mrlVswa2ICzZfcU0r15uxjtmt+DueL3O+EkTYjtCqpEWWj3Qhx91a6sKW9+kIybWOniw8RbodZQqKpes2rqLLFhW+kkWoEEnunsynHGF7o/e60/tkKw3Twj8d7svICVCko2LNGCseWUX0xeEP/iw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=olQ1kIRSGkHH5KiXTQs67sKPfMcfsrDpvuJOb37YkVI=; b=eRX1TydGLle8PpDGExHFDLUKDallDxJa3qVU+FG8uIvZoZjPWhQcfMr+/mTIRIelBtuoepC3eHxIOdLbf2FZpOptgFbk7ukSfcwwhJyAqxVjHvhjGXs4U5h96Goo4UHaIXDSxVO7tS+NIXx3ciCBwFINelBsizx/3wDLQBvvSb8= Received: from SN6PR04CA0099.namprd04.prod.outlook.com (2603:10b6:805:f2::40) by SA2PR02MB7836.namprd02.prod.outlook.com (2603:10b6:806:140::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.24; Mon, 31 May 2021 13:21:20 +0000 Received: from SN1NAM02FT0018.eop-nam02.prod.protection.outlook.com (2603:10b6:805:f2::4) by SN6PR04CA0099.outlook.office365.com (2603:10b6:805:f2::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.20 via Frontend Transport; Mon, 31 May 2021 13:21:20 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by SN1NAM02FT0018.mail.protection.outlook.com (10.97.5.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4150.30 via Frontend Transport; Mon, 31 May 2021 13:21:20 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 31 May 2021 06:20:50 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Mon, 31 May 2021 06:20:50 -0700 Received: from [10.140.6.25] (port=53014 helo=xhdnagasure40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lnhqb-0004GE-Me; Mon, 31 May 2021 06:20:50 -0700 From: Raviteja Narayanam To: , CC: , , , , Shubhrajyoti Datta , Raviteja Narayanam Subject: [PATCH 06/10] i2c: xiic: Fix the type check for xiic_wakeup Date: Mon, 31 May 2021 07:19:44 -0600 Message-ID: <20210531131948.19477-7-raviteja.narayanam@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210531131948.19477-1-raviteja.narayanam@xilinx.com> References: <20210531131948.19477-1-raviteja.narayanam@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3651d3a2-b365-4d4f-b4bf-08d92436fb0c X-MS-TrafficTypeDiagnostic: SA2PR02MB7836: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: i3oNDlnIPX7v64pkvEwZxYLaIUTjMo/4qWJhYev0ge5OhdVPVjszTkkf5GPdZqpGZ1E3MmSwFImxKoV/WescTjX/327laPOldKZHTDEEr1Up72p3m7/CXM5/Z0Hr427FX7PdR1I8BDTgypbh/1ZjljwhiPQGTvx4J4IiYnnGvg2S9XzkUCISPbIsVW5rAhhL6NAn44y7oUZRf036Ky6FtXJSdcIGynTyxBC9VZrCcvTFI/ANybzEPFhWixBAoC/+mIkjN5OCZfcE4QFV5ofsy/wu8dpUK5CsHQyZGo5pd7rcPGOyhVgabR3ydHpPYj+57WyjCH42VZ9T15k0xviffNaEatHazgMhe2uxMnOFVw+Q0P02pra7kJx7ICOXQdVEGgS+Vh7tprkB4Rwm0hs/xevNs2L8To9UxI/SYjUPcJyHHgW/p5SCH8o1bzFf5FP4fob1ulmTuNg5hMMdFWP1Eazu1ngE3WByyonTfOMMLWVB3EZZHC8H1wsJsCH6TycEf6VjtCFM7RP2h/9hVY+tcs2aZ0RJOTlGXBwh97ttzBuP3vGD8h7YzP9S0ooDtaEOQ4s20NB4u1cjMnlEm4GN5yOLvjfKskz54n1u9dQdA5TM6AJoUJeGb01U8N2dOQHGKTXB5+TijxWTJqlda91QdQxn7DK5nVKUAbWhcUZ2GsNYO/iNq2wahOm+ZBKfcReK X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(39860400002)(376002)(396003)(346002)(136003)(36840700001)(46966006)(6636002)(336012)(1076003)(316002)(36906005)(478600001)(110136005)(82740400003)(2906002)(54906003)(426003)(47076005)(4326008)(36860700001)(7696005)(186003)(107886003)(7636003)(36756003)(5660300002)(82310400003)(44832011)(83380400001)(2616005)(26005)(356005)(8936002)(70586007)(8676002)(70206006)(6666004)(9786002)(4744005)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2021 13:21:20.7584 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3651d3a2-b365-4d4f-b4bf-08d92436fb0c X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0018.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR02MB7836 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210531_062123_670278_37378B52 X-CRM114-Status: GOOD ( 11.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Shubhrajyoti Datta Fix the coverity warning mixed_enum_type: enumerated type mixed with another type We are passing an enum in the xiic_wakeup lets change the function parameters to reflect that. Signed-off-by: Shubhrajyoti Datta Signed-off-by: Raviteja Narayanam --- drivers/i2c/busses/i2c-xiic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index b2ac76d94212..1a26e5ebfc6c 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -542,7 +542,7 @@ static void xiic_send_tx(struct xiic_i2c *i2c) } } -static void xiic_wakeup(struct xiic_i2c *i2c, int code) +static void xiic_wakeup(struct xiic_i2c *i2c, enum xilinx_i2c_state code) { i2c->tx_msg = NULL; i2c->rx_msg = NULL; From patchwork Mon May 31 13:19:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raviteja Narayanam X-Patchwork-Id: 12289391 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F802C47082 for ; Mon, 31 May 2021 13:26:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F01D86140A for ; Mon, 31 May 2021 13:26:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F01D86140A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iGXrD0ERpp7DciXiKn8eglwE/Vw9/NTYD17xlz8t2ag=; b=C+GRhH4JmS8hCK FfgM7vPCCMQ5NyXRFOnqADZpVldzdEb/hjMMH0K1bdZaojWtI2VCi9luzJ8HO6Te9/vrGI/ER3kFc ikxJcgBwKMGOHDWJb0z5jVPt9etuE8qIU93VJkQLHVyoj9V0sD37A2TInI9dCE4sgsVVtO0yUye93 oP3vkVhfY3DX6d5WSV2qgrpk65I+hC1dESCk4YPTcdoVwoHbrVOmCs8zFYBZOa3bNjVQefaEI9mXu vj23ojNmaYEFuou46l7rfgmrNatXWLw045NSW5OBynCIt2elkyK7PsEty+9jBybsaIgvSXBYyArJL g1RZdPXR6YEykXtS9ANg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnhuR-00CJI6-PY; Mon, 31 May 2021 13:24:49 +0000 Received: from mail-mw2nam10on2084.outbound.protection.outlook.com ([40.107.94.84] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnhr9-00CID1-NK for linux-arm-kernel@lists.infradead.org; Mon, 31 May 2021 13:21:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bqXOoskScU7DL1myMJ/FJDIGDjEnSE3lR73o8ovqLkPtxayAqO54mdwNcO0jOX0ITmYVLWnavPyGlWa2TGYwg85MuI8gm8+YnZ16gEJvdp0wbWDOXFZh93DHgh1Z4bvoorljn8RJxFriAKYRgoN6LJqz2QhjJwyOg0TTD+BocEYG3GHlIM4MoouauA9fnWA+P6cUcHX3MOF3ngGDtkmDgXHp7u/jBUNdGLWRGdIvLaZuoRkwi7CAUyYGw6VXJI1h4Rv7hffEQg/c5WguiQfy2FGWFiClsF5QVsdgyjDSg27d+RL3Ttci4fGJQDkqcjHaNyK+Db++NZjVSAPMqL8l6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FwntOM4arWjrrTTBU/PsgkpjojDk5S2QwRFtIJeaNXQ=; b=DeQdG04n2n13rrZNlV4Sru1dGFIVr0rHoBngYEm4r+AwE1H7gZKRft5Usex3ik52SiE/SY9JUXiNJ6y0mRthSBcs6Y7YyOGztzQPA0Hte7jsHWwEz1nX2SIOTASo2eCannrtIFBtUPwIGaT0oULU0BhGeA8dbFi+E/0JCnDWpAAXvlMXRRx8yj4oKCti8/kagYW1ScBIvljSTXtcNNeI5o0v1BoZSwwFBG6j5b9jGvaeTYvanslAPk8zYDP8fTu/nD+7nZq3B1z0WXPDXWEXQH2wvnfIVjtGhQ85+awMz2CjvqUt8UZYQWZPzjQn+KUa/ADW4lxOQdNDdFML8N7ctA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FwntOM4arWjrrTTBU/PsgkpjojDk5S2QwRFtIJeaNXQ=; b=XHIGJ95S5WKgShKxpmb2pmQWWXE+bKvBHl9TIxeZ3TXjpOv5Aa1Jw980q8I4tGsf9VcsRPFc4HKDOJDjjeZs8NkC7jgPR2gV8IPKQ7OFKJdO7C6QtfWKau1EcWowkD/c3TsfkpMaa32oEz7zSBrpK0rr03Y2CmRYoSMZNbOCKqk= Received: from SN6PR2101CA0022.namprd21.prod.outlook.com (2603:10b6:805:106::32) by DM6PR02MB5627.namprd02.prod.outlook.com (2603:10b6:5:36::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.22; Mon, 31 May 2021 13:21:21 +0000 Received: from SN1NAM02FT0060.eop-nam02.prod.protection.outlook.com (2603:10b6:805:106:cafe::77) by SN6PR2101CA0022.outlook.office365.com (2603:10b6:805:106::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.3 via Frontend Transport; Mon, 31 May 2021 13:21:20 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by SN1NAM02FT0060.mail.protection.outlook.com (10.97.4.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4150.30 via Frontend Transport; Mon, 31 May 2021 13:21:20 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 31 May 2021 06:20:55 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Mon, 31 May 2021 06:20:55 -0700 Received: from [10.140.6.25] (port=53014 helo=xhdnagasure40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lnhqf-0004GE-Nq; Mon, 31 May 2021 06:20:54 -0700 From: Raviteja Narayanam To: , CC: , , , , Raviteja Narayanam Subject: [PATCH 07/10] i2c: xiic: Switch to Xiic standard mode for i2c-read Date: Mon, 31 May 2021 07:19:45 -0600 Message-ID: <20210531131948.19477-8-raviteja.narayanam@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210531131948.19477-1-raviteja.narayanam@xilinx.com> References: <20210531131948.19477-1-raviteja.narayanam@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: db401ed1-4153-43b8-dfe4-08d92436fb18 X-MS-TrafficTypeDiagnostic: DM6PR02MB5627: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TvjS478+vhI5KVnf0FqTwiHnlS7SOzm7CyPLRg1A6jy6PJQ2hsFUYOWxwGSFDSLWxDPw78X5MGMptzlLMRRR0aC6bJUrwrE28yLzcaIe44BKiQNcuGD6/MlRRJZUwS+w1G4XFDarr3dCotCBoqd8nIa7JRPthepfSOLvniHwKpAXDARE4P9Q9G1NB+txFoba0cAqsVboPxKLLJ4qTtY7ARLV5i4Lt0EglWQFj7OJNf7ma4PI3ay3ctKIen4r3unzObuIe/D7yyrDBAK8I7BfTfXWROPTN8vOi49X0Rxe4UjhlI26zBOihon/SxqtwxumJnhyryqmv+ieaRaiRz6fx9WJgVWxBgK0mOsf2NfvNJvRhMiSy96n0yV7RGQYDZvfQDbmK5HnOPlcQ2nfZMwmpF2ZnFm/m2BQtUMnYowHhI8XE7h44wpDbVohFUvKUuw/jElmvydEn64hoWnQ+fWZ6GRZhUsHMTIbxh/zNNqt4nOJZCEFqOcK0LicWA295xTAQ93Y+ifpkc7+vWjLdaaiI8KAdKRYwmqhl425iJSetLd0PO4nw8nEKxQxVs/Q0sFjV3TIe50lbC4vL40jjXrGdahcGeVL7ILWfloiH6p3s1OCaCYopWoYKxbaupvF79ft1o8d0rx7/fD4p1MxNysR6viEbE0x20RPFNA2KTUuK7ckXzeKKGkyo/ErZlIYtrPd X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(376002)(346002)(136003)(39860400002)(396003)(36840700001)(46966006)(478600001)(7636003)(9786002)(83380400001)(4326008)(54906003)(110136005)(36756003)(336012)(356005)(1076003)(2906002)(2616005)(5660300002)(6636002)(36906005)(426003)(44832011)(70206006)(70586007)(6666004)(82310400003)(47076005)(107886003)(7696005)(36860700001)(82740400003)(26005)(316002)(8936002)(186003)(8676002)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2021 13:21:20.8381 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: db401ed1-4153-43b8-dfe4-08d92436fb18 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0060.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB5627 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210531_062123_837257_8D071DD3 X-CRM114-Status: GOOD ( 19.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Xilinx I2C IP has two modes of operation, both of which implement I2C transactions. The only difference from sw perspective is the programming sequence for these modes. Dynamic mode -> Simple to program, less number of steps in sequence. Standard mode -> Gives flexibility, more number of steps in sequence. In dynamic mode, during the i2c-read transactions, if there is a delay(> 200us) between the register writes (address & byte count), read transaction fails. On a system with load, this scenario is occurring frequently. To avoid this, switch to standard mode if there is a read request. Added a quirk to identify the IP version effected by this and follow the standard mode. Signed-off-by: Raviteja Narayanam --- drivers/i2c/busses/i2c-xiic.c | 58 +++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 13 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 1a26e5ebfc6c..2f0808249ceb 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -33,6 +33,8 @@ #define DRIVER_NAME "xiic-i2c" +#define DYNAMIC_MODE_READ_BROKEN_BIT BIT(0) + enum xilinx_i2c_state { STATE_DONE, STATE_ERROR, @@ -63,6 +65,7 @@ enum xiic_endian { * @dynamic: Mode of controller * @prev_msg_tx: Previous message is Tx * @smbus_block_read: Flag to handle block read + * @quirks: To hold platform specific bug info */ struct xiic_i2c { struct device *dev; @@ -82,6 +85,11 @@ struct xiic_i2c { bool dynamic; bool prev_msg_tx; bool smbus_block_read; + u32 quirks; +}; + +struct xiic_version_data { + u32 quirks; }; #define XIIC_MSB_OFFSET 0 @@ -1032,6 +1040,7 @@ static int xiic_start_xfer(struct xiic_i2c *i2c) static int xiic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) { + bool broken_read, max_read_len, smbus_blk_read; struct xiic_i2c *i2c = i2c_get_adapdata(adap); int err, count; @@ -1056,13 +1065,22 @@ static int xiic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) i2c->prev_msg_tx = false; /* - * Enter standard mode only when read length is > 255 bytes or - * for smbus_block_read transaction + * Scan through nmsgs, use dynamic mode when none of the below three + * conditions occur. We need standard mode even if one condition holds + * true in the entire array of messages in a single transfer. + * If read transaction as dynamic mode is broken for delayed reads + * in xlnx,axi-iic-2.0 / xlnx,xps-iic-2.00.a IP versions. + * If read length is > 255 bytes. + * If smbus_block_read transaction. */ for (count = 0; count < i2c->nmsgs; count++) { - if (((i2c->tx_msg[count].flags & I2C_M_RD) && - i2c->tx_msg[count].len > MAX_READ_LENGTH_DYNAMIC) || - (i2c->tx_msg[count].flags & I2C_M_RECV_LEN)) { + broken_read = (i2c->quirks & DYNAMIC_MODE_READ_BROKEN_BIT) && + (i2c->tx_msg[count].flags & I2C_M_RD); + max_read_len = (i2c->tx_msg[count].flags & I2C_M_RD) && + (i2c->tx_msg[count].len > MAX_READ_LENGTH_DYNAMIC); + smbus_blk_read = (i2c->tx_msg[count].flags & I2C_M_RECV_LEN); + + if (broken_read || max_read_len || smbus_blk_read) { i2c->dynamic = false; break; } @@ -1108,10 +1126,23 @@ static const struct i2c_adapter xiic_adapter = { .algo = &xiic_algorithm, }; +static const struct xiic_version_data xiic_2_00 = { + .quirks = DYNAMIC_MODE_READ_BROKEN_BIT, +}; + +#if defined(CONFIG_OF) +static const struct of_device_id xiic_of_match[] = { + { .compatible = "xlnx,xps-iic-2.00.a", .data = &xiic_2_00 }, + {}, +}; +MODULE_DEVICE_TABLE(of, xiic_of_match); +#endif + static int xiic_i2c_probe(struct platform_device *pdev) { struct xiic_i2c *i2c; struct xiic_i2c_platform_data *pdata; + const struct of_device_id *match; struct resource *res; int ret, irq; u8 i; @@ -1121,6 +1152,13 @@ static int xiic_i2c_probe(struct platform_device *pdev) if (!i2c) return -ENOMEM; + match = of_match_node(xiic_of_match, pdev->dev.of_node); + if (match && match->data) { + const struct xiic_version_data *data = match->data; + + i2c->quirks = data->quirks; + } + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); i2c->base = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(i2c->base)) @@ -1201,6 +1239,8 @@ static int xiic_i2c_probe(struct platform_device *pdev) i2c_new_client_device(&i2c->adap, pdata->devices + i); } + dev_info(&pdev->dev, "mmio %08lx irq %d\n", (unsigned long)res->start, irq); + return 0; err_clk_dis: @@ -1232,14 +1272,6 @@ static int xiic_i2c_remove(struct platform_device *pdev) return 0; } -#if defined(CONFIG_OF) -static const struct of_device_id xiic_of_match[] = { - { .compatible = "xlnx,xps-iic-2.00.a", }, - {}, -}; -MODULE_DEVICE_TABLE(of, xiic_of_match); -#endif - static int __maybe_unused xiic_i2c_runtime_suspend(struct device *dev) { struct xiic_i2c *i2c = dev_get_drvdata(dev); From patchwork Mon May 31 13:19:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raviteja Narayanam X-Patchwork-Id: 12289397 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7A13C47082 for ; Mon, 31 May 2021 13:28:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 94FBA61465 for ; Mon, 31 May 2021 13:28:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 94FBA61465 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ofezA8bHs4xlsmNepBMMuKbf02uxscPQuQbQxNVmZfo=; b=fEzvKGVlqKBlXL kvkTnWW2ET2d4NqmvGdETvoSKbdErkhFtbfXGC+obW+UD3M0OVET7E8GEGdygUNkYpE82VHRyfhVN alw0a3lMVZYcQFy/tVOf17UBZO5uI4ApEE8CGmToaTMIrLlcLop2DiDq/f+wPdl0UfihQLF2UesHA mh/iXgHbIzmt9m6eRfVxeNSjIV5Hc6BOAemOj79Ch06/2xoBPj8hNJZwJQQPPNRj9kk8SQTZAUlwc 2s++23xpBnXAaywenrnVSVq4gsJdGWoSCA8zVoCDbSkSgAlARLx37xzIZD+2zpZlodLOnBkwcEkfh e/97NXZ4WhM6xPSIz2vw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnhvM-00CJcD-MX; Mon, 31 May 2021 13:25:46 +0000 Received: from mail-mw2nam12on2059.outbound.protection.outlook.com ([40.107.244.59] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnhrE-00CIFA-A8 for linux-arm-kernel@lists.infradead.org; Mon, 31 May 2021 13:21:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CD0lrV4k0VTEC5lZcjzOvw3IdKbKaWRvd8tJljZc5EAe1FiMRPFOzVsmTNL1GVtrKV0ZN04JSoH1TAavaJuf31CGkLU4a4ZEni8OGIPuU9lOciwwUGasQb9aOvo3w8L7WiOjQR5YgEqfYa/cm9Flz333/Qzvxxql5OG15uV5lofn0HZb094iDkH/mbZErvTICaU655+mGuRLMFPed24KNNnaaDo0USW3oAz/i+DltTNx1RxnQLvf/y9abFqN8ZcSZLcXJhjmpBHuL25VYINAy57T4Bj9wHRPRqlbdo2w2Q2swsqpjy2I1ElkTgi0Lyws2Y3nu7ll0XIM08/KxBn1og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U1mSY4xjMpvJiPHE0Kng2VNRZf7RmIpdHKpS2KRDKlg=; b=KcW7k75B5H42tURfgyBxDXumgbDX5GaitZUPPVcCCS2SWjXQQJ0nDGYqZJQG5q1zLf9xD86vyY9rZWuT7/2pOE5ARUtbbISZvVglYgRQMKOMjVpTtB9YWgyrjlMSOQo+zrxmLZu3qyg72MoBftn0ywL0GaXZ50HUQYIJQzjRaEIFG8O35VCoYXLHliQY5WRU0IU3Aso+1Uae0vSQAgxQ6vNFQo3uYws24IjmXwYqmCHkWCLrLoy8EvM6cptCLoJXj15bP9iW2HKKM/h0bYx6F6JSylOlWEn1MNFJcHH7eWbpp66N0A7t3oWtwCmSebupo0qR8/8DPYirS6lc4LxaFQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U1mSY4xjMpvJiPHE0Kng2VNRZf7RmIpdHKpS2KRDKlg=; b=D3znCu5vYep9IQemri29xXvFkn79XDJ034MGKD0lkYpVkQOlxtOsVn/y6LNvbd0RkgkutqdWLSq9npOrSLedaxcw+iSy3hFt7yWtOAOoXhvYFXTWt1C3Yos0WVWb5NceW8+kNWBK77sqzfad2GPOAdpY6ZxBNBQjVQzHxzBCNEo= Received: from SN6PR04CA0099.namprd04.prod.outlook.com (2603:10b6:805:f2::40) by BN0PR02MB8286.namprd02.prod.outlook.com (2603:10b6:408:159::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.24; Mon, 31 May 2021 13:21:22 +0000 Received: from SN1NAM02FT0018.eop-nam02.prod.protection.outlook.com (2603:10b6:805:f2::4) by SN6PR04CA0099.outlook.office365.com (2603:10b6:805:f2::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.20 via Frontend Transport; Mon, 31 May 2021 13:21:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by SN1NAM02FT0018.mail.protection.outlook.com (10.97.5.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4150.30 via Frontend Transport; Mon, 31 May 2021 13:21:22 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 31 May 2021 06:21:02 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Mon, 31 May 2021 06:21:02 -0700 Received: from [10.140.6.25] (port=53014 helo=xhdnagasure40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lnhqn-0004GE-02; Mon, 31 May 2021 06:21:01 -0700 From: Raviteja Narayanam To: , CC: , , , , Raviteja Narayanam Subject: [PATCH 08/10] i2c: xiic: Remove interrupt enable/disable in Rx path Date: Mon, 31 May 2021 07:19:46 -0600 Message-ID: <20210531131948.19477-9-raviteja.narayanam@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210531131948.19477-1-raviteja.narayanam@xilinx.com> References: <20210531131948.19477-1-raviteja.narayanam@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d752382e-51d6-481e-7163-08d92436fbd3 X-MS-TrafficTypeDiagnostic: BN0PR02MB8286: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Jmx0wRlpWuKOptUNSWP9hfoYp3HmFilP3yacePR5gP3ItnLvNXSce3VQ+6ErlMECUtKWCnNmQsMXJWikRB7j8E7GRi0M3a8DXs6zJlTwIeb0yO4vSbfIxdWSToQCb4wNmkmlrXmLu16us17HAbS+sYGpVJPN7ZSC839xmTR9TP2E2x97vViH6969UDbr9peQjeHpcT1kLk4zyAVdVmzn/u1+pJVXEMsg0E/acNINOIWxfKKrRR0+rFYOuqgSij0XSbga7zNgedUfBoJKbpWtpY0Bf56i8IkUjgyRAr/WrVJ2MIMfIuNMYYLu09DP/8HrEicuShJV7/jfTD/HoLviwb3gtNKNIfSNIndy3e+OdJZRYbl9yH3rxSM5nz3bQOuAYPnNnRIc/7YAoXdJubKdve0BcCW/3DL/P60o1hDWoUaW28vtOHuhoRD6Hjscr2dgWLDUSK4jH0N0qR9TDIbQVY2dp63CIl5z7oWQLyiQepDD9dKe9uSfLFJnL4hhhU736pHdxQt/b+KEFsKpXnui4yszl1kVhomxNXOwKwUPYZsEZZ6b107YQxhSzi6jVupPN2QDNt7zynCUK65Rdy8JGMuBEkCRp2l7MRAwyDAkPKXTUU/ZVsd5QIA6htN7uth3kffaXgvIe96MWDAIFeyToa52pH9zTLlhcXcXgTQp46RNROjHwXUvjsj/OqBJKFD+ X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch01.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(396003)(346002)(136003)(39860400002)(376002)(46966006)(36840700001)(4326008)(107886003)(8676002)(8936002)(6666004)(6636002)(478600001)(7696005)(110136005)(47076005)(2616005)(9786002)(44832011)(2906002)(70206006)(1076003)(70586007)(7636003)(36860700001)(5660300002)(36906005)(316002)(426003)(36756003)(54906003)(336012)(83380400001)(356005)(82740400003)(26005)(186003)(82310400003)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2021 13:21:22.0588 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d752382e-51d6-481e-7163-08d92436fbd3 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0018.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR02MB8286 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210531_062128_432945_2843F149 X-CRM114-Status: UNSURE ( 9.92 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org As the 'DYNAMIC_MODE_READ_BROKEN_BIT' quirk is added in the driver, we no longer enter dynamic mode for the effected IP versions. So, remove local_irq_save/local_irq_restore APIs from driver. Signed-off-by: Raviteja Narayanam --- drivers/i2c/busses/i2c-xiic.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 2f0808249ceb..f022a1885b6a 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -759,7 +759,6 @@ static void xiic_start_recv(struct xiic_i2c *i2c) u16 rx_watermark; u8 cr = 0, rfd_set = 0; struct i2c_msg *msg = i2c->rx_msg = i2c->tx_msg; - unsigned long flags; dev_dbg(i2c->adap.dev.parent, "%s entry, ISR: 0x%x, CR: 0x%x\n", __func__, xiic_getreg32(i2c, XIIC_IISR_OFFSET), @@ -790,7 +789,6 @@ static void xiic_start_recv(struct xiic_i2c *i2c) xiic_setreg8(i2c, XIIC_RFD_REG_OFFSET, bytes); - local_irq_save(flags); if (!(msg->flags & I2C_M_NOSTART)) /* write the address */ xiic_setreg16(i2c, XIIC_DTR_REG_OFFSET, @@ -804,7 +802,6 @@ static void xiic_start_recv(struct xiic_i2c *i2c) val |= msg->len; xiic_setreg16(i2c, XIIC_DTR_REG_OFFSET, val); - local_irq_restore(flags); } else { /* * If previous message is Tx, make sure that Tx FIFO is empty From patchwork Mon May 31 13:19:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raviteja Narayanam X-Patchwork-Id: 12289399 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA0A4C47080 for ; Mon, 31 May 2021 13:29:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B672F61582 for ; Mon, 31 May 2021 13:29:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B672F61582 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ES/Ej5XFxbIOsWVZgpn8+3N+aEOF7+HpvxaBakLB6OU=; b=L0htGHf1Ud8nPu ZqdJ5+TcmhmR8+Kmj2ibdrzorq7zNPFkSP/Y9LaBN6k2Pq3o1Sy9Mbs6O3puqdnrP32i9tpgY8dI4 wN9rNUbWdT2FgFsHIzwJBYjTCIKw3MBUoOKyvsYc/9Un2Uuc48PqNf/WFsVvLplNM3sd4ZVFaCAj8 c5K81E6pwUBiwFrwlCk82Y17hONO++NYA74dCEtUPcbzNEMZUv4Bnmms6Bt/yoNE9gwcL5JHJ8vGn f41VLUNEyO0SZUOGsuU0eELjsMoYoIkuLN49fW9LY0cljU+ISyx9o2/lObzfUz/0poOwdk3eB0psT z3qEOJqtSp+hTbTal0Ig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnhwj-00CK5w-P2; Mon, 31 May 2021 13:27:11 +0000 Received: from mail-dm6nam12on2065.outbound.protection.outlook.com ([40.107.243.65] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnhrE-00CIFD-Oe for linux-arm-kernel@lists.infradead.org; Mon, 31 May 2021 13:21:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PaAfmkZSr9Vh6wHAWLxmjAhR4lCTBj62mlPX++EHGiLmObRexsQf0kzJNRitEjCFsMn/wMoG45fiQouI2qL5JKT2lAa1rbV/xqdphemRk9q/wHIDwiPdHc6jhxEFE5wocDecK9O25m68TcBtn9xMz7ju8IDLkemvUaRFo/rzxZ6UpDNy0+EDHZP9Xo4cCfI2ygfNx/NWHugB92oR+IKJ+mVd7DOxALBgTVuQEaQt3/0qChrfwdX/mN3p/WNhyvjq3a7Gv/XVE99KnOWRMRC8S4+QuUKI8BrIIuqyVJDVzlYtc4Ek6dd+tPjxAUeOb2pV0sO+9pBd34LX6PShYCv5IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kIQMAFeWEOlVva/AMbTzk+yzrBYHtq1g9I5dQBHLscA=; b=GzlDxpvwNnRpDipsDP9+N5HM9M1hptfCT6A5TWXKVbeRUzZjCQKN4AGFhe+8rDGBlkTl0gbXSmBX/y1g47R5m/tOEQGWBNur4PQLLOYugz+B0KnsZ1xuZvdNT+mZ3oyry2b1Orxp+EuLCF4iYgi3sw9DWOI26ahUktj77iWrHm/i9IcLemPuzpfPjI9ijbmP/X2uTaQPRnRJK+j5nnobCcnoRQ3V6U9pD/WUGiwiW4ooQragw99weXZOPKMXmdzMktCu1L9YdO2xVjwGEcjgnMJdKqI8fA+nNqrCsgVTeO4L0E8QSnG7DJGkSe3WbcXOfDWSv25thmsWpgTgR0jSiQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kIQMAFeWEOlVva/AMbTzk+yzrBYHtq1g9I5dQBHLscA=; b=Av+jImbane9tQkmXDT+8sAchwlKkP3oBi/NeMd9p0HQRxz5SQcMida50joMIfvmYKoUk1rtgcBv1AlVA14bsMYMVL6rD7NuL3YDoqrIm7hAQ/IBrdcpDhgKYKZGahRCMTiI3erYJtQ30nVTk+9bEA46Mg4tabSxsfFFqjjqcfvg= Received: from SN6PR2101CA0021.namprd21.prod.outlook.com (2603:10b6:805:106::31) by SN6PR02MB4335.namprd02.prod.outlook.com (2603:10b6:805:a7::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.24; Mon, 31 May 2021 13:21:23 +0000 Received: from SN1NAM02FT0060.eop-nam02.prod.protection.outlook.com (2603:10b6:805:106:cafe::76) by SN6PR2101CA0021.outlook.office365.com (2603:10b6:805:106::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.3 via Frontend Transport; Mon, 31 May 2021 13:21:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by SN1NAM02FT0060.mail.protection.outlook.com (10.97.4.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4150.30 via Frontend Transport; Mon, 31 May 2021 13:21:23 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 31 May 2021 06:21:10 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Mon, 31 May 2021 06:21:10 -0700 Received: from [10.140.6.25] (port=53014 helo=xhdnagasure40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lnhqv-0004GE-Cx; Mon, 31 May 2021 06:21:09 -0700 From: Raviteja Narayanam To: , CC: , , , , Raviteja Narayanam Subject: [PATCH 09/10] dt-bindings: i2c: xiic: Add 'xlnx, axi-iic-2.1' to compatible Date: Mon, 31 May 2021 07:19:47 -0600 Message-ID: <20210531131948.19477-10-raviteja.narayanam@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210531131948.19477-1-raviteja.narayanam@xilinx.com> References: <20210531131948.19477-1-raviteja.narayanam@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f91f9e37-3c72-4cca-2a14-08d92436fce7 X-MS-TrafficTypeDiagnostic: SN6PR02MB4335: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:849; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /O1fMdWu7dDXcisKNNMpuKw3Yy5Ks0eJCvT7CV+2po/Tt6wc3rZPswxnJwA9f1ggyOHgeiJ7Qmg/f6F6AJJxhyqVXCYKn16fahKHue/90433qVrL9430SBE9H4I1GPCxOFTNZWI9jEJfDURvmO+2UgWdvATEBJ/zKDgnGWg8I0GLeZ73+huvx4XmGlF1AdfG7LjqPoeM+c7dWkDZxqw67Gil0lQv2rhgSE/NwG1eoQ2PNRcns6XpdfCpBsA9WXkGUBxURHAkeWO90c7gfVDqXtDzYDkSFB1UrrYPJc2Eay970D1ZFtcenQTNRyn8W/vwdCD2JTbayBtgxdkVgeBuiqFnuwDcWBl3MlgFaOCxc0yTBq5N5l/Z8SBHWEXNmcRhUlHBXpQnt8Nz7iQUzWMmr7cEaVv043Pha/Mv3PCOQZCV7+jCovQ67M2Yp57jHY64m5gRFqApwQExNUJRGMhREo1701aRun+d1zPLravNlrVOkC7ps1Y4a6/I6o2bK7XY/3rB+jpg1Su8w6+RJapJnp2/da0hC6sBI2hLTKjC42HuMeNjuAlLRxgZlMwl16NIfN467ILVhVVIyyDBL/ylDT84mwBxCiSrWe928xOusS0iCI7aNXWu4XNfpDTxvEV4RthsCYCf5gglxObRaBa4NheUDTtsKPNC7x6vwAw88QEuplAxq03qrDbeA/B/hU1q X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(346002)(136003)(376002)(396003)(39860400002)(46966006)(36840700001)(36906005)(6636002)(316002)(9786002)(1076003)(36756003)(54906003)(6666004)(110136005)(82310400003)(8936002)(83380400001)(26005)(4326008)(36860700001)(4744005)(356005)(7696005)(107886003)(186003)(7636003)(44832011)(5660300002)(336012)(70206006)(8676002)(478600001)(82740400003)(70586007)(2616005)(426003)(47076005)(2906002)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2021 13:21:23.8638 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f91f9e37-3c72-4cca-2a14-08d92436fce7 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0060.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR02MB4335 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210531_062128_874345_CA6493B3 X-CRM114-Status: UNSURE ( 9.27 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Added the xilinx I2C new version 'xlnx,axi-iic-2.1' string to compatible Signed-off-by: Raviteja Narayanam --- .../devicetree/bindings/i2c/xlnx,xps-iic-2.00.a.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/i2c/xlnx,xps-iic-2.00.a.yaml b/Documentation/devicetree/bindings/i2c/xlnx,xps-iic-2.00.a.yaml index 715dcfa5a922..e516c1ed358c 100644 --- a/Documentation/devicetree/bindings/i2c/xlnx,xps-iic-2.00.a.yaml +++ b/Documentation/devicetree/bindings/i2c/xlnx,xps-iic-2.00.a.yaml @@ -14,7 +14,9 @@ allOf: properties: compatible: - const: xlnx,xps-iic-2.00.a + enum: + - xlnx,xps-iic-2.00.a + - xlnx,axi-iic-2.1 reg: maxItems: 1 From patchwork Mon May 31 13:19:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raviteja Narayanam X-Patchwork-Id: 12289401 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07426C47082 for ; Mon, 31 May 2021 13:30:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BCA0061585 for ; Mon, 31 May 2021 13:30:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BCA0061585 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lhiCPyiStx7ePCbsff/LYo0QzwMcUVSrSoVG8kiGH34=; b=nvqR2e4acAM3Xc IBNTxOlFDXv54ponrf7Vboumrmdi2uWo34Dp51alGFhD65+JcZ85vLLRqxRhRBReqXJeOl3plEgsa DJA/mVI9gldWf+euC1ewWwtWO1wGehFaisYBW7RBEdZMlzCA/Ecgo6mTfov2ksqnADt62BY3au3eQ 8OyRs3KXqKoPfmbwRJR+b3KBC3Y4CJMQcCx9eW/kgGZH21hzRKaMNN8boSofD24Y7pRiJiTKkEghb k10c4ecwAYFq7qv0lf/zD/GFNmKIwznT24kbVsmx+vDjGdldVi0scE88WNqDwO0EAq7mAF3jrUgcE 4Bf8VZI6CAr05QvL3WtQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnhxz-00CKZZ-HF; Mon, 31 May 2021 13:28:28 +0000 Received: from mail-mw2nam08on2075.outbound.protection.outlook.com ([40.107.101.75] helo=NAM04-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lnhrT-00CIIp-VG for linux-arm-kernel@lists.infradead.org; Mon, 31 May 2021 13:21:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m/geMpUFZiXO1whXdsjF+N/OwKHs4MwRAFpJh+wKOAX54rz7eQd7sfB/aTEaSyFGTXYhP47RVEotT5gcLbgs54q+nPbftAdPn/lA4j3A+1/juWsaZ1+x54rq7+fFJrpWEUwA56I2Qjok/CXx1mShzT9vgHOG2Kje6j0h6ukaOvSxQKA/UfE/BLHhq70vNa8oEj9gso++vdR5RQsCbzi9+z5/Q1PzoKrN3Kcye/+pG4qhOftRU3YF5WaeKh2tzp3yqu37GwNcsdWTyQI2BUxpQUmVr3sh++lzCE20/8lVP+t19N6QqsMG8VvvLCP1sxCk4qpK9tPta6kzJBS/TWyk8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fceQhCbbjjHjSbwTjg3JBB4MQnsiiMuBzljwTv3hnx0=; b=ca46etrM12Z91G5U/OBzX1d68oLouZvVl/cSqB+1/rN8NSrfI10Q+tcurOAc0h9Tc23DFMHKTKbCAyHzHqRZpYG9npfWgGRYhk39Kf0K3r6cROAr+SY+AWskEFWKOlaJP4hPDsOuJ8AUqYG8ID5xBAULTs0XuN0vNO+GQmi/D5LKGKRbNy1u9c7p1QqvS0yNmam+mnd4jkqc8iR91FUyoFH0h0HJ1gg8PdS+a/k770t5XPrGpDp2ipRol6N93pPJEGyPfwYIVk7WlgJ76HuSXKldx4y2B9ETRxYBVqQNaTk/yVoM6Bq4vIcmppJARC5h38AhCRTzSUuRGD1tTt6gew== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fceQhCbbjjHjSbwTjg3JBB4MQnsiiMuBzljwTv3hnx0=; b=qSDECWIoHr9kU1ipLipT9j4dT7+EF62Lfo9m2swsIDEfn0uhdQ19O8RynVCn54fj+LdTEO1hIEW9KF2Bp4TR39TF4VwlMA8ZG+As6RrpksKlxrQpgc3zt8eSmEbZy7W9BzAUKrU0Tuk0bgF/LMsJERx+xpKQp8z0h9DoN0WD7A0= Received: from BN9PR03CA0367.namprd03.prod.outlook.com (2603:10b6:408:f7::12) by BN7PR02MB5123.namprd02.prod.outlook.com (2603:10b6:408:22::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.20; Mon, 31 May 2021 13:21:39 +0000 Received: from BN1NAM02FT051.eop-nam02.prod.protection.outlook.com (2603:10b6:408:f7:cafe::b6) by BN9PR03CA0367.outlook.office365.com (2603:10b6:408:f7::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.22 via Frontend Transport; Mon, 31 May 2021 13:21:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by BN1NAM02FT051.mail.protection.outlook.com (10.13.2.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4150.30 via Frontend Transport; Mon, 31 May 2021 13:21:39 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 31 May 2021 06:21:18 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Mon, 31 May 2021 06:21:18 -0700 Received: from [10.140.6.25] (port=53014 helo=xhdnagasure40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lnhr2-0004GE-OO; Mon, 31 May 2021 06:21:17 -0700 From: Raviteja Narayanam To: , CC: , , , , Raviteja Narayanam Subject: [PATCH 10/10] i2c: xiic: Update compatible with new IP version Date: Mon, 31 May 2021 07:19:48 -0600 Message-ID: <20210531131948.19477-11-raviteja.narayanam@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210531131948.19477-1-raviteja.narayanam@xilinx.com> References: <20210531131948.19477-1-raviteja.narayanam@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 603eb692-12d7-4846-4488-08d924370638 X-MS-TrafficTypeDiagnostic: BN7PR02MB5123: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:1122; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vfIqXX1XVFhDp+vCjLBhFkcwAUYXwYMR6qMAnxaX/vaBYUU3mjjndYqUshw7wb9Rz8fHnCu9CnZ3ZlPPZaAVq/HtU6fuc/CE9YU8SF6yD6Ay7Nx97G9xnBfeilRrnyb5mwTVkXiRy8Lgk/+AcPebuVt99mX8XvYEFUDmtnqSV4YEh5J4JqAKV/AAahs+0j86oJTloHudtO9AQi5upHaxdqUF5WLCHeDRFgVOqJaFfFbuvq+BJQismpyYsup3etxRj7kimv2bNaU1HMhSCr4LJCj8bXEBBBoL3kAV60woD0Yz6MKenSQDXAYlBCTLyCzsq2YJfIUrd5quw4lgGkIMjl8p5+0ZljCGZNiutThxlGZCOLlisTRo45HP8yBFLlPVYgb4R6gBnF7/8CGBzQ0/0jqgeLG54IILC6vZtwLdEFV+eFJpX3EW1uLfif2IqifqWudvVnqRlakOpCRdaN2aGysYHqQ5KTWgFGx0AOBAexKUMUtEvRKjHRCqbAPg78T3iNEDoUHZSC0V9bwcgjaovuLQdprL/F7Qodog+kiSnhdqqplDme8lLevbFLrIVagxK4f9JGGQJrIwL8IgeG5LzRChEFLc/54xQneb6dyw5Rx2ql25l8WI1iiek+pGL2szDzZ+LkdqyD9Kl8iyOg3gB2G4VSZTwBG/3x1ptEZbUS0Q2LRejCoDy2WMzm0G+5SQ X-Forefront-Antispam-Report: CIP:149.199.62.198; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:xsj-pvapexch02.xlnx.xilinx.com; PTR:unknown-62-198.xilinx.com; CAT:NONE; SFS:(4636009)(346002)(396003)(39860400002)(136003)(376002)(46966006)(36840700001)(356005)(82740400003)(47076005)(7636003)(2616005)(82310400003)(478600001)(5660300002)(83380400001)(26005)(1076003)(2906002)(186003)(6636002)(70206006)(6666004)(336012)(8676002)(44832011)(70586007)(9786002)(426003)(7696005)(110136005)(54906003)(4744005)(107886003)(36756003)(316002)(8936002)(36860700001)(15650500001)(4326008)(102446001); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2021 13:21:39.4228 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 603eb692-12d7-4846-4488-08d924370638 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.62.198]; Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: BN1NAM02FT051.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR02MB5123 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210531_062144_077742_FE7534BB X-CRM114-Status: GOOD ( 10.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Xilinx AXI I2C IP is updated with a bug fix for dynamic mode reads. Older IPs are handled with a workaround in which they are using xiic standard mode for all these effected use cases. Added the new IP version to compatible. Signed-off-by: Raviteja Narayanam --- drivers/i2c/busses/i2c-xiic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index f022a1885b6a..45bd3b1a4c22 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -1130,6 +1130,7 @@ static const struct xiic_version_data xiic_2_00 = { #if defined(CONFIG_OF) static const struct of_device_id xiic_of_match[] = { { .compatible = "xlnx,xps-iic-2.00.a", .data = &xiic_2_00 }, + { .compatible = "xlnx,axi-iic-2.1", }, {}, }; MODULE_DEVICE_TABLE(of, xiic_of_match);