From patchwork Sat Nov 21 23:01:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 7675021 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1BB599F1D3 for ; Sat, 21 Nov 2015 23:12:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2E19B206B8 for ; Sat, 21 Nov 2015 23:12:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4FD42206BA for ; Sat, 21 Nov 2015 23:12:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756500AbbKUXMs (ORCPT ); Sat, 21 Nov 2015 18:12:48 -0500 Received: from mail-wm0-f54.google.com ([74.125.82.54]:34413 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754781AbbKUXMr (ORCPT ); Sat, 21 Nov 2015 18:12:47 -0500 Received: by wmvv187 with SMTP id v187so116032734wmv.1 for ; Sat, 21 Nov 2015 15:12:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:subject:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=49itOHipx5j9QtvHedOM0KddJ9WqwttV7sJ63hJyvxI=; b=Wg54rAUNOg/U1OErV81Xrir7e/81vITZTrs8Sd/WS8k1gajPkaFZUirBzDxrou71ru j+n/+peIsaT2rvtO48WZopiDD0/o5oFbCHafccDHs6CQ8+0di4exhuF/V80xA2BakRBG b7KsOfBXDXA05aCl00w9eBCeuxHeULyNtPrGU46RLyDzHRUwIJMC/vfYDRyPQ7JhEXqp IColQCSJgMFIknmLwJW0r7RwVGhsIddIQLycQRYS78zrUyIk+tzdnKrESDmdKug4A+Hg 51KRUY61cThftSDVqMPabCKbrsNeZsm1kQasGfFM7vNNPG1g9h4SI4RSn7vNoKG8MTSH 5XBA== X-Received: by 10.194.90.50 with SMTP id bt18mr22303364wjb.118.1448147566267; Sat, 21 Nov 2015 15:12:46 -0800 (PST) Received: from ?IPv6:2003:62:5f55:ba00:681b:1517:83c2:9e4a? (p200300625F55BA00681B151783C29E4A.dip0.t-ipconnect.de. [2003:62:5f55:ba00:681b:1517:83c2:9e4a]) by smtp.googlemail.com with ESMTPSA id q141sm6059527wmg.3.2015.11.21.15.12.45 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 21 Nov 2015 15:12:45 -0800 (PST) From: Heiner Kallweit Subject: [PATCH 1/3] spi: core: add max_msg_size to spi_master To: Mark Brown , Brian Norris References: <564CEB61.2000601@gmail.com> <20151118215755.GL31303@sirena.org.uk> <564D0098.4030107@gmail.com> <20151119114057.GN31303@sirena.org.uk> <20151119171538.GO31303@sirena.org.uk> <9CDADBED-FD18-4635-82A9-5AB14C9ABCAE@sperl.org> <20151120120502.GT31303@sirena.org.uk> <08871ECD-52DF-4CBF-AF3D-4C3A442C008A@sperl.org> <20151121134946.GI26072@sirena.org.uk> <56507B3B.4080608@gmail.com> Cc: Michal Suchanek , Martin Sperl , MTD Maling List , "linux-spi@vger.kernel.org" Message-ID: <5650F7D4.1090209@gmail.com> Date: Sun, 22 Nov 2015 00:01:40 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a member to spi_master allowing to better handle SPI chips with a message size HW limit. 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 cce80e6..23e259b 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -302,6 +302,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) * and it's up to the individual driver to perform any validation. * @min_speed_hz: Lowest supported transfer speed * @max_speed_hz: Highest supported transfer speed + * @max_msg_size: maximum message size * @flags: other constraints relevant to this driver * @bus_lock_spinlock: spinlock for SPI bus locking * @bus_lock_mutex: mutex for SPI bus locking @@ -417,6 +418,9 @@ struct spi_master { u32 min_speed_hz; u32 max_speed_hz; + /* maximum message size */ + size_t max_msg_size; + /* other constraints relevant to this driver */ u16 flags; #define SPI_MASTER_HALF_DUPLEX BIT(0) /* can't do full duplex */