From patchwork Fri Feb 23 09:32:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Louis Chauvet X-Patchwork-Id: 20850 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp474998dyb; Fri, 23 Feb 2024 01:33:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX1CosTYqVxMOk3DfYZwLF1wNhMSZ8sIlBSSsU8QrHPOE3tfSxG58GNhWszQJFTwVJr/gMyf3FhkcwYnfcnCm50zF6CAQ== X-Google-Smtp-Source: AGHT+IFv6agifiQ9bNcmITjotMyUfZhjwLIPOj4szMK+mwA7AzSagFTjeYgkmJyS/BH5WWY9fVOB X-Received: by 2002:a05:6a20:bc95:b0:19e:c34a:6fa8 with SMTP id fx21-20020a056a20bc9500b0019ec34a6fa8mr1208723pzb.45.1708680819263; Fri, 23 Feb 2024 01:33:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708680819; cv=pass; d=google.com; s=arc-20160816; b=c4XEreGtVNWE4ZswdvC+6a2oUgp6osEdSZ5rvkaAv076cnohg5zCvFMOr/9j3X6com 09JhYBcL37qASWawtvk7enuzDGSc91g/5chmi4tNXyUoxGAaQJ1XvaMk4qAvSNc6mIdi eURttUw6GtQ38G4GqN2nT+wd6UrsGyVJzZK4vLk1eMxgrCpDEmCSOllGcUYeUzZL6AiU T01Z0XiAlSWGz9KDLNNLr+0X24B64kmz1IQ/wuXbNdPKS/ct87IVOw9QQ8joPzb/+HK5 DGw/vHBnar1kHDJ3a+Faput+sKHeOz0ANRej5DyXRv3KDfLd/gVpXs2p0OiiDpaspofV niZQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:from :dkim-signature; bh=hnXzPpHTj+T9YeQJru+i3t1PG7BaiX5w87lRUOTBO18=; fh=eI8HjExr0WsH9IWVPxvbaDTOw70phhIumkj8bsjnk/U=; b=OThzCseT90Bvf4yd//n2P/0pvKzPOHV9/sALKnrEGrvWE4wbSLOXLPdhlcSsWGb15T xvxHQBZbzyAuPjLvuhjjDmfKZI0ox2wckELcDToitPTbalXTMZ/+Ee8IgD6zwbKzxpbi fUvy1Ey9lbyOwnE2KH37VUsp/DeO2mfXfgRojRuBnM4SdU3gFfHzn4l3F/Boiv6f8nrB qQtf2BVDVP/852Ix4nu2gJga7/rCHxj98QtrfEnDVC1a7uV2pzGpk1gwCNCHO2hzV867 An2nKiPQNAisS55+05XvbfVfJ0Uc2n4YdM3DB4NbJxXpwWWoS+V9mIvpYJU8gfiEkwbK OlFA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=c+CIh3+7; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-78017-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78017-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id bw14-20020a056a00408e00b006e0dd4e9306si12212390pfb.24.2024.02.23.01.33.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 01:33:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78017-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=c+CIh3+7; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-78017-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78017-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1686E2864A0 for ; Fri, 23 Feb 2024 09:33:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1BB145D464; Fri, 23 Feb 2024 09:33:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="c+CIh3+7" Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A0EFE5C8F8; Fri, 23 Feb 2024 09:32:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.200 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708680777; cv=none; b=g5etB6sgDj1bLhFQLLKWODzTaI25NPgiiO2EJLqRr5dHmQ5pJqEgrxuCXjkpNe6MEx4ZysL9yhK3Hb9ujSjt3bSF6rE4MirNYKO0EqXa/c7OiYovhbWD5t6sP8HIX9RKus3SIhlG06ULiRmE5ZBcjr6Gl79BSsCOBGSfeymFWx0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708680777; c=relaxed/simple; bh=mEvL7/gYsYZ1cJJ7RW2LMAVRTvamARtEVGX5pY48Ceo=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=bU61i3jr6P188iEDLqJeJJ6H+oRj9VjkFoXMlcSXwJYWktuKnPcLGhf7e6sW495nkDdoe7AHGFfVQv5f3xL3lAbd3RV+1Gql2EgkAVmjQ2VKdTUaOqoVFs+d2ZogIiBFAF2yPjvPHHwtt5NtG75vGk8G8utxxobudjeLNp2o/0g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=c+CIh3+7; arc=none smtp.client-ip=217.70.183.200 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id ADADF20009; Fri, 23 Feb 2024 09:32:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708680767; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hnXzPpHTj+T9YeQJru+i3t1PG7BaiX5w87lRUOTBO18=; b=c+CIh3+7NW7eYmh/AVp/oGIxz9WJ7KyJyUocnGE+Gkxf10/lI8uzylg887LV0uL9K9VG70 Nm5ma4fr++lr1eFGov7xZAJKpfudcgKIBHYl//L+F0HNGyXVNQRnWH4Nqcwn2XgRosJvWU e5XHF4vjmlFVIZl5+BqKDvJKDWWqidH9KQXUs716NUOdqA5QCvFdMU56qXuSdLSParGfJo 88vZsljcKkJKNQCtQrBLuic8PBUMZfalyECZGVMsRK0+tfwZrzIGBn7plLJ1WkZWxNyyHf 6kg75lpGELxPov3Xh0+UuryoWn43VzU+dhig8171yPZyNL7kbJCxK4Uw0Y1KwQ== From: Louis Chauvet Subject: [PATCH v2 0/3] Add multi mode support for omap-mcspi Date: Fri, 23 Feb 2024 10:32:10 +0100 Message-Id: <20240223-spi-omap2-mcspi-multi-mode-v2-0-afe94476b9c3@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIABtm2GUC/42OOQ6DMBBFr4Jcx5EXAiRV7hFReBkHS16QDSgR4 u4xdOloRv//4r1ZUYZkIaNHtaIEi802hlLYpUJqEOEN2OrSESOsJpQ1OI8WRy9Ghr3as5/dVG7 UgKFhpulk2wnNUQFIkQHLJIIaCiLMzpVxTGDs5zC++tIHm6eYvscDC93XU66FYoINvZmatUrfR feUMU7OhquKfpefhmhac825IQbIH6Tftu0HjCZc3iABAAA= To: Mark Brown Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Miquel Raynal , yen-mei.goh@keysight.com, koon-kee.lie@keysight.com, jeremie.dautheribes@bootlin.com, Louis Chauvet X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1903; i=louis.chauvet@bootlin.com; h=from:subject:message-id; bh=mEvL7/gYsYZ1cJJ7RW2LMAVRTvamARtEVGX5pY48Ceo=; b=owEBbQKS/ZANAwAIASCtLsZbECziAcsmYgBl2GYtkgipQhcSQ6jGnKMzjV2Id3VvGxSRzKlVc5WG 7PWbSOuJAjMEAAEIAB0WIQRPj7g/vng8MQxQWQQgrS7GWxAs4gUCZdhmLQAKCRAgrS7GWxAs4jqUEA Cygcn/3ypJxayMGlmEuFiN1yYm2cn9RgmxBaoa1wMO3px6TpBhp8vPDMXmvT2WYt6wgHxUYixf2Mml 2j6mUKjA/1YHxoHzSdhzIil/hylyqnBQ8mwLMD0RyPd4eHz3gEB+7zcZKIkHKMcYg93y+bY3BnC0cJ mlFrQXwF5T0SsT3WgY8dLAcBAaBYhYQHzO9xQfP0rr6aAaPxFztwNuM7CTg+9dChp6rCu1n5RCp+ae 8t4a1V35WmArc1TOafki4CYydxenOix3Vqj9+HD4qtM2E9blt6K858QS97Rm/7Ez7oTXQEvjhA1eGG W0nE3PZiME/CrXbMg3dZjWxI91rZL0HtvAXf/W4o5VZ40B3rZ/+jHttvB1fv4Vww6PJm3lqQL5Us5m DEJRqPqp00Krb94QerLGzFoIgU9ARgoWhh3JXf3RrNNuaMo2sEn1I7QFnZJikdtj7/4FBG5bKUT2r/ ty/hm3Rp/I96jyj5NEQ2CTA6MtJ/9+g5cnL1ovUTeQAgmjI+0OzblWGHOF+kYDYJeE2ARXf8XgcxIC YZLqaqEOQMvSaNtS+jj1LFhHm7msKWDauvplpYnEHM4ujGiGy49bHZYjHTjjGwnrl7NUJz5GAA9zAG 5A27b5qfF8mwGt+W7UsofB21Wva4lMWgPMV9mfVKGMVwW1ttdk2yD9xsyYFQ== X-Developer-Key: i=louis.chauvet@bootlin.com; a=openpgp; fpr=8B7104AE9A272D6693F527F2EC1883F55E0B40A5 X-GND-Sasl: louis.chauvet@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791681698897796813 X-GMAIL-MSGID: 1791681698897796813 This series adds the support for the omap-mcspi multi mode which allows sending SPI messages with a shorter delay between CS and the message. One drawback of the multi-mode is that the CS is raised between each word, so it can only be used with messages containing 1 word transfers and asking for cs_change. Few devices, like FPGAs, may easily workaround this limitation. The first patch removes the current implementation, which is working, but don't comply with what is asked in the spi transfer (The CS is raised by the hardware regardless of cs_change state). No drivers or board file use this implementation upstream. The second patch adds the implementation of the multi-mode, which complies with what is asked in the SPI message. The third patch is the suggested optimization for using MULTI mode in more situations. Signed-off-by: Louis Chauvet --- Changes in v2: - Updated the commit line for the first patch to use the correct format; - Updated the commit message for the second patch, adding precision on how the controler works; - Added the suggestion from Mark Brown to merge multiple transfers word into one when applicable; - Link to v1: https://lore.kernel.org/r/20240126-spi-omap2-mcspi-multi-mode-v1-0-d143d33f0fe0@bootlin.com --- Louis Chauvet (3): spi: spi-omap2-mcspi.c: revert "Toggle CS after each word" spi: omap2-mcspi: Add support for MULTI-mode spi: omap2-mcpsi: Enable MULTI-mode in more situations drivers/spi/spi-omap2-mcspi.c | 96 +++++++++++++++++++++------ include/linux/platform_data/spi-omap2-mcspi.h | 3 - 2 files changed, 75 insertions(+), 24 deletions(-) --- base-commit: 41bccc98fb7931d63d03f326a746ac4d429c1dd3 change-id: 20240126-spi-omap2-mcspi-multi-mode-e62f68b78ad3 Best regards,