From patchwork Sun Aug 7 19:47:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9266543 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D65BB60754 for ; Sun, 7 Aug 2016 19:49:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C799225D99 for ; Sun, 7 Aug 2016 19:49:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BAD5127D0E; Sun, 7 Aug 2016 19:49:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6615325D99 for ; Sun, 7 Aug 2016 19:49:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751971AbcHGTtm (ORCPT ); Sun, 7 Aug 2016 15:49:42 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:34668 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751947AbcHGTtm (ORCPT ); Sun, 7 Aug 2016 15:49:42 -0400 Received: by mail-wm0-f67.google.com with SMTP id q128so11988856wma.1 for ; Sun, 07 Aug 2016 12:49:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:subject:to:cc:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=2kkNg7M9DKA0Aa+P6ti7hMP4QOR0vcV0BqjYWSll7xQ=; b=gm5ENg6TX0P39NlRpe2H4FhFduPEU2wnrPQjrNZpzaXoWd6WYYSB2LFnXvdmCRYTN5 s0GC1S3uzBXR2cYdQXVWXm6dP6dhj4C6guxtB+NTmef3K9l5TWfrZ9YC/Qw9G2VJI2C5 Y47Pi143LBvvAwf769fS+acUBGo6WArGIiddZM6HYr0tQATUzLnMKkf5wQexntIk2EIf hc3uY8Pp1+FdDUq671kTku0Nf0p77aew6sRZjijM7nv9UjAhgqvH69v2B+jP/ZnWGdN4 Br1V7YrZp+s+iayGYuGz90W+lxV8U1JNXPIGVEGtA3wJdnfUwxTzKKnRal02AXXCt9Hq 6VNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:cc:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=2kkNg7M9DKA0Aa+P6ti7hMP4QOR0vcV0BqjYWSll7xQ=; b=AQgdIscLEUdYlj3p8wn/gk6TcDS5oazZiSZhcW37W1TJcJH6xOJiY4oolIUWXukYTN 6zY8bu3P2C9Z2240hK5emojNES+wA2kKfCDJlnio5WdHxAdXQJI/odkAFSuVueBBdcdR b/WZEBZUIelgW6OPzWtGNdPk354nHlbEO9Jl1JzdePDwpQhq5w7KpiolG0gZV9fmkgrI VvewLXdNcN+ctXCmSmIMIf2nPv6IMmZd3WRAWRuNLLgLrGap1+W7P5Fgry0602bTigfe Lzw3ktN7aFV1tlMH5+pSTfhdL7p4fw9ZjTik73C9gUiV3RAPqzgpyfwlHI7ups2OsHin IbvA== X-Gm-Message-State: AEkoouu7pjhH/01HgqGYqijIV+MD02382rK/k3+l9dpJ0IPUwI+bcnxbqF30lqSnSEmEsw== X-Received: by 10.28.1.23 with SMTP id 23mr12863470wmb.22.1470599380753; Sun, 07 Aug 2016 12:49:40 -0700 (PDT) Received: from ?IPv6:2003:62:5f01:4400:19c4:bee6:ba17:e190? (p200300625F01440019C4BEE6BA17E190.dip0.t-ipconnect.de. [2003:62:5f01:4400:19c4:bee6:ba17:e190]) by smtp.googlemail.com with ESMTPSA id a9sm29191453wjf.16.2016.08.07.12.49.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 07 Aug 2016 12:49:40 -0700 (PDT) From: Heiner Kallweit Subject: [PATCH 1/3] spi: introduce max message size flag in spi_master To: Mark Brown , Brian Norris Cc: "linux-spi@vger.kernel.org" , MTD Maling List Message-ID: <6c95366c-7fcc-ef4c-033a-f9f6e152a669@gmail.com> Date: Sun, 7 Aug 2016 21:47:18 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Recently a maximum transfer size was was introduced in struct spi_master. However there are also spi controllers with a maximum message size, e.g. fsl-espi has a max message size of 64KB. As there are no (known) spi controller with differing size limits for transfer and message, introduce a flag in spi_master to indicate that the max transfer size is also the maximum message size. Signed-off-by: Heiner Kallweit --- include/linux/spi/spi.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 072cb2a..cadb1de 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -312,6 +312,8 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) * @flags: other constraints relevant to this driver * @max_transfer_size: function that returns the max transfer size for * a &spi_device; may be %NULL, so the default %SIZE_MAX will be used. + * @max_message_size_flag: indicates that max transfer size is also + * max message size * @io_mutex: mutex for physical bus access * @bus_lock_spinlock: spinlock for SPI bus locking * @bus_lock_mutex: mutex for exclusion of multiple callers @@ -446,6 +448,8 @@ struct spi_master { * the limit may depend on device transfer settings */ size_t (*max_transfer_size)(struct spi_device *spi); + /* flag indicating that max transfer size is also max message size */ + bool max_message_size_flag; /* I/O mutex */ struct mutex io_mutex;