Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp157163pxk; Wed, 16 Sep 2020 22:24:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweLXRkX6LYUphPQuVd++py8aj+Kq7dtrtpB9sH+fJlUAOmNzdERn4iGiYzlBH/uIwvcIV7 X-Received: by 2002:a17:906:819:: with SMTP id e25mr29796316ejd.211.1600320295257; Wed, 16 Sep 2020 22:24:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600320295; cv=none; d=google.com; s=arc-20160816; b=cWlNVTeXEx2emLKkFeTb0BVYklKlKqyeK6Nu4qPDYE9cT5vo5tX1OgPYo1u6mLJgKP ZJUm323HmJegX2U81PvyIVGPGmfWR/vyybppOkpnI+zWFreY/DGHllX0AljlD18F904E 2GqTS3M1z/vHWayd6h2M3mqlGunvt0X73TmIg9oC2+OdriiFUsq0khfQBuZeftoGaT8W gAWG7FNLt6lIpMvpBtHZWYuKhR0eKCdC3DnYBif7PZohq0oS8IBlql7EsEXccSvjssuN LK4NRfREmwj4l6VsIK20vUpJQrMfj8yfTJmuxf+qcO2Byu3QsyzTx6a+UP2srfzF72gb IItA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WDZd8tsRsFWv5ihYfraNwY2+UbRPuk2ibJ4Vl5wi/pY=; b=Ea1gYXHM3YMSUQv11LKkY6oWJnSjCtlIJJHxNXod+WTBlB0fO5I364qVMD9URUTlCw 0YpCTVDy657kwTtIDJgIunPxlutUYZdldX/3Uh4qM7PA2MByjhRR/aLqSN6SaPxTV8di 5uWR9xb0uM4APzmewvrWOHxom0JXe/3/DDfwBrHm2AzzaqvWXKoN84hQ6jxIjsMPc1M4 su4Kt3GWP1r6uxgXOcgsMvp9pLIvKsJiKohMCcqcggjwUS7tnjP4ZvkPsWM+XQqPqwWC P7PLf+sumvmzjGzyjX6HcdMvv9lY7rMt8tgSksKPK3q4SDydxz1PagXHLNPLejl6MYlU 3BIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=teYJl6x5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id co12si13936778edb.104.2020.09.16.22.24.31; Wed, 16 Sep 2020 22:24:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=teYJl6x5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726244AbgIQFXR (ORCPT + 99 others); Thu, 17 Sep 2020 01:23:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726180AbgIQFXE (ORCPT ); Thu, 17 Sep 2020 01:23:04 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5817FC061756; Wed, 16 Sep 2020 22:23:03 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id z19so475171pfn.8; Wed, 16 Sep 2020 22:23:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WDZd8tsRsFWv5ihYfraNwY2+UbRPuk2ibJ4Vl5wi/pY=; b=teYJl6x5RIDP4Alc+XCeMh7yCiyF2cARRceeq+i17641JSN7U0OU5n93u8IZZtVpJi V2T8CjpZl28JlqCE/md0a60Fc4F1MUqdbbOd8RyT9Fjb3iInQaQ+nP2PGD3DFov4eQgm szNGCpEZP9y2rz/kQYi4+zO8MtYmsa46IejNRPhHEonc5QafOS7lMBNXddTMN4XuG3TG DicSWOAGXyj26lPRmeeWAdwUK7ju/GZIBSVnl4pqIK2Uy/Q8mJnjo+EFWeMSCgEVVoVt M8O44yIcPN4YWe+Ag1eNNQOepmbttBhMPdFOm0SKY4syLzTEisqvHcHqWo+Komajk2cP dEog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=WDZd8tsRsFWv5ihYfraNwY2+UbRPuk2ibJ4Vl5wi/pY=; b=gCxElnuDQ2Ua8QBQQ0xMi7w+vBMFuvWAbdZN/0+oHLNyCzUwIWBiNnmOPuIp7IbbGg kI2aM3kU+5TVCAtQzC05Wi92e5fZ86nOLVxgGn7ckyaSn9+oQ7ePcd6mG/BrkzizfFdc kc9rbNEZLtY4X4FyJNRNKZGPQAD69jAmdBUSGIiwmSbesPGKu0wXSJFzyaf/KYkrwG1z pBPGdG5qd4dKGSZCBgOBxIuRmuqgAFFTFmHkWMeRfs/qJeQItWUkfizF05WiWooXUDt8 GR0AxXyipknN4tH1053bDFzlh7ge1fcegV7m8n6ZAyT+71yjEW8XFAMXfc39ozyOA5gw tFzw== X-Gm-Message-State: AOAM530fJiuwp/EZx9CrfweUPSUTSXq3pUSquXyW2D1gwWVa7wiZIXZp s4tw5TECTAI6N7gjVjvJ8v03tSwtxT6xsg== X-Received: by 2002:a63:516:: with SMTP id 22mr21793976pgf.316.1600320182593; Wed, 16 Sep 2020 22:23:02 -0700 (PDT) Received: from sultan-book.localdomain ([104.200.129.212]) by smtp.gmail.com with ESMTPSA id i62sm18705619pfe.140.2020.09.16.22.23.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 22:23:02 -0700 (PDT) From: Sultan Alsawaf X-Google-Original-From: Sultan Alsawaf To: linux-i2c@vger.kernel.org Cc: jikos@kernel.org, aaron.ma@canonical.com, admin@kryma.net, andriy.shevchenko@linux.intel.com, benjamin.tissoires@redhat.com, hdegoede@redhat.com, hn.chen@weidahitech.com, jarkko.nikula@linux.intel.com, kai.heng.feng@canonical.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, mika.westerberg@linux.intel.com, vicamo.yang@canonical.com, wsa@kernel.org, Sultan Alsawaf Subject: [PATCH v2 3/4] i2c: designware: Allow SMBus block reads up to 255 bytes in length Date: Wed, 16 Sep 2020 22:22:55 -0700 Message-Id: <20200917052256.5770-4-sultan@kerneltoast.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200917052256.5770-1-sultan@kerneltoast.com> References: <20200917052256.5770-1-sultan@kerneltoast.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sultan Alsawaf According to the SMBus 3.0 protocol specification, block transfer limits were increased from 32 bytes to 255 bytes. Remove the obsolete 32-byte limitation. Signed-off-by: Sultan Alsawaf --- drivers/i2c/busses/i2c-designware-master.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-designware-master.c b/drivers/i2c/busses/i2c-designware-master.c index 22f28516bca7..5bd64bd17d94 100644 --- a/drivers/i2c/busses/i2c-designware-master.c +++ b/drivers/i2c/busses/i2c-designware-master.c @@ -433,7 +433,7 @@ i2c_dw_read(struct dw_i2c_dev *dev) regmap_read(dev->map, DW_IC_DATA_CMD, &tmp); if (flags & I2C_M_RECV_LEN) { /* Ensure length byte is a valid value */ - if (tmp <= I2C_SMBUS_BLOCK_MAX && tmp > 0) + if (tmp > 0) len = i2c_dw_recv_len(dev, tmp); else len = i2c_dw_recv_len(dev, len); -- 2.28.0