From patchwork Sat Jan 9 12:43:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 12008231 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=-12.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 9A2EBC433E0 for ; Sat, 9 Jan 2021 12:45:54 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 56D8123A04 for ; Sat, 9 Jan 2021 12:45:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 56D8123A04 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sang-engineering.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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=/BgKoaPwDF8m5HkcGYJhclsHBonrQXBP9QLMNZag3tY=; b=JErrdX/yJPob9F5jSsjjpNOgZx MjCBz/jkILyLWWyB5JQNWLhpDC4GgpcyRacbbaNUcUiC97wV6XTYJp/fpMnqZAyw8PQj26+dtXPh2 whAWC5PLUwGaDc/AxkF2QApB+htI8vl542L6vPwK+tQEsrCXDmzWkc+PySS4A6w7Ez7iabnzJREXZ r7UunjsGfs/X/UjwLpyGZ+TfM1+SNHoh2CBM/sdLqFHKenSbU7hpEJos34USfgezGOBuVXAHZ0jbO 2VUzUfRa0IGwAVtAFBkqLM732lKiQfDLRMV1ibeQkp4HEbwdx70RrRVVLwFkvYfUn4FXDHahoJi+H 0KFEtlzw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kyDao-00056N-FV; Sat, 09 Jan 2021 12:43:42 +0000 Received: from www.zeus03.de ([194.117.254.33] helo=mail.zeus03.de) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kyDak-00054d-CM for linux-arm-kernel@lists.infradead.org; Sat, 09 Jan 2021 12:43:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=k1; bh=zD9cPRZyEaGEmq3k0za/7gpfIJU vc5uCoXoOde/5/F4=; b=e2VeYFuS0iXUn9uQpg26v+5ScyE7HsCtvjVv2rqjCgc ERgSCZBLj9PGIPt2NLFgBvaLT9c9oxpYpr60CVtZWmbwalZU2I+8TpwvoDJ0lsFS pPWdjHtjX8BVKLgcb9opPYW+hBdgfmWUnnVROyb20JiqL5r3qmldnPyrZNyB7aT0 = Received: (qmail 1724998 invoked from network); 9 Jan 2021 13:43:28 +0100 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 9 Jan 2021 13:43:28 +0100 X-UD-Smtp-Session: l3s3148p1@EOH5BHe4RpYgAwDPXyBeAD+yeC5KBZLe From: Wolfram Sang To: linux-i2c@vger.kernel.org Subject: [PATCH 0/8] i2c: improve RECV_LEN documentation & usage Date: Sat, 9 Jan 2021 13:43:04 +0100 Message-Id: <20210109124314.27466-1-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210109_074339_048880_94916363 X-CRM114-Status: UNSURE ( 9.03 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Wolfram Sang , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Because I want to clarify I2C_M_RECV len usage, this series updates the documentation and some of its users. Patch 1 refactors the whole documentation of 'i2c_msg', so all usage of I2C_M_* flags and their conditions hopefully become clearer. Patch 2+3 remove some obvious boilerplate in the UAPI headers while here. Patch 4 is a driver fix I found while working on this series. Patch 5 introduces a new convenience macro to enable SMBus transfers which need I2C_M_RECV_LEN. Then, some drivers use the new macro, sometimes to remove boilerplate, sometimes because these SMBus transfers have been forgotten before. This series is the first part of a larger work to extend I2C_M_RECV_LEN to allow larger transfer sizes (as specified in the SMBus 3.0 standard) and to enable this on Renesas R-Car hardware. Looking forward to comments and/or reviews; the driver patches are only build-tested. Happy hacking, Wolfram Wolfram Sang (8): i2c: refactor documentation of struct i2c_msg i2c: remove licence boilerplate from main UAPI header i2c: remove licence boilerplate from i2c-dev UAPI header i2c: octeon: check correct size of maximum RECV_LEN packet i2c: uapi: add macro to describe support for all SMBus transfers i2c: algo: bit: use new macro to specifiy capabilities i2c: qup: advertise SMBus transfers using RECV_LEN i2c: s3c2410: advertise SMBus transfers using RECV_LEN drivers/i2c/algos/i2c-algo-bit.c | 4 +- drivers/i2c/busses/i2c-octeon-core.c | 2 +- drivers/i2c/busses/i2c-qup.c | 2 +- drivers/i2c/busses/i2c-s3c2410.c | 2 +- include/uapi/linux/i2c-dev.h | 25 ++---- include/uapi/linux/i2c.h | 128 ++++++++++++++------------- 6 files changed, 76 insertions(+), 87 deletions(-)