From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.172 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796107956; b=Ke9ue9qUAYI2JBftDzw5yxneKKULlNi+m2AeYojA/KrDHDdtoqZBJrjBcTK5F1+eQdlp nA1U8lX8jasH0i3vBceNyiSwB01IclCSN32Q6RwAWv4jOhPFSD7gidcMpO3Lgw3HzlLLR rEMvFqtVxL20PG0dzBQ6wFc6SGDxszACihAAJJp6XJANsyR6kf5q7repv9fvcuenJSXXQ soS+6ULEzVYcS8wSronbg+c9b5ub6o9VkL0ug+8zzjfRtOU79q6gLQaJ+ZAvQhR2kHuzT 3j4aqCsJ0lRu+ywkQoAg/O3pVgMCx+e9vr4DrESb/LoqVaT8w9SMVUzpESRrT4vsSzQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796107956; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:X-Google-Original-From:Received:To:Cc:Subject:Date:Message-Id: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=m+U5cWCJUIVKYCbZ7f9frGv22lJpZ1FSkHbQki+Cg0U=; b=pWnQN9VibawZUZTfJqfBHM/OLY23mlgSkC/BzkGPfsnKC2LpeI7JhxRlmHGeNCWM/wTL XFycm88xXPRgcBL0kF93vlr9brcVgsgMkvSUnqTy9SW77H8GBb1JmOnqXtTiIK/76QEGA jbMKDDTzhsecey5OVEvbSfAa9svsphqh42gpJUjVvm4xJ1/X/H4IMk3vFNmpwnhLjTZq+ xbIfc2wE5vVEPUVa3elgu9SQvRgCOER8KAVADw52trRAT8IZvHMVmycEunnlqLEcX6NW8 t/+HrT06QxMGWTw/MwCiQGj3FgvS2oW3kBnA+bIKZcg+8S8K1F5b34pswWNzB4fGMdg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=alw2LhCU; arc=none smtp.remote-ip=209.85.214.172 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B8C2606A693 for ; Tue, 1 Dec 2026 06:52:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3B8C2606A693 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=alw2LhCU Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-2f04fab527eso85314145ad.0 for ; Mon, 30 Nov 2026 22:52:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796107954; x=1796712754; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=m+U5cWCJUIVKYCbZ7f9frGv22lJpZ1FSkHbQki+Cg0U=; b=alw2LhCUFkmk//KGuoYvWWOatYF3+pvW/TT8mSsaClukyQT66H5PFTr2ptdoRMl2cc cMItsHy7ytT0UetfckHFgd4yFIqVLunKVyi0zcwcPm4RoSoM0Bqt+NJgc83ULEWXGiPX 8CP74PyvIXcS7/mFpyHBv3QvOPvt1m818cHMzAGl4Vl9fVnQThzXpQ2hvRueyMrak50N cf01RMKLJv0D0WWQwQ5DLMpvKaBFhOwUGTquz06Os0Yv/yCq17UNTszLcOT1X4k2qZXN zcjj2fhOKNB1tzHEqmBxEuZysM4B9DFdTfosbv6UbyclfWbLaUG7N4fmFmiy6OKkqUwv ZDmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796107954; x=1796712754; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=m+U5cWCJUIVKYCbZ7f9frGv22lJpZ1FSkHbQki+Cg0U=; b=z2HKUE+B5ioenb8WU4bZ21qZWdHhLKLz+6KgnjO3HAyuhuMKBpvuNyxMHqnb+CN7/B AmCSR44zw/1f4PKSfbqLYwFNQRVLlKhzQlhSOkh1bfkNylXBbfu9nWZu8nzDxrwUJ3DH t4+fHJYA0OmK0DzFfcbcP8DCoeiNkKteyU4ODyhMrBuOkFpfzmj/eNaQRRNiRgYaTKHx AAWAiZ6+k/+fRiXjnYwptmOEnEQflWCaSM3a3oxmuKVPi/fo7GHhb0dtmY06LpbTDEdL U9toactGuY8wcryELij/MVKYO+7Ja82VwxvOMNxy2wrrSe/RLhsqih9QDobKG4q/PJFx Y+CA== X-Forwarded-Encrypted: i=1; AL+hErE4kI+FKgi0wMFNOrlF7OZOpoYFLuo5Lbd9FO2D/Gj7R6tXQzoCx8MDm2fW1kCOXNXCiEu6Bg8a+W4=@vger.kernel.org X-Gm-Message-State: APuU4Z9RXDPqvUtN1izHcycPgqlUE00HnHAwxHmVRSQWA3af7ID34qS6 bJK02ywcPTP0J7AQ1eYkKNyAoYMV8uhlwhPV80SibbxEqjQepal1L2+l X-Gm-Gg: AZFdTZdd6veLupP+wwtcVyWIjwE/9+5TXJ6ENiWGvHxc+dUY4eyZFbM380FVHYdZIXC UXnv50uw4aF3TrKJSM2bxkPn95w40DpZXmEP6t15x+k1Ou9yw7IqWszGktP2O63pNKTcwdcdl8Z 5r1Wjxj4L82aoXA2F4LWddo3xrjaPmXB1Mj9/DVY4ZAYaqWPRTHzW+2U9nW3MLWv4Bw5krUdukp Kq0Np02prHoCRtO+GeZo6cHSYPDq9+XAcA75JsrwVcdlkpw99E4MGVNXwvmNtr6VFF/GvIRb5hw 8yvgSGeMBn8HofmBrdrCqd9W0An7ErleThfLNKs5sbgEJAPPSC5+VZ2h2VbHU7Rf+ExC5G5UxE/ rtmmjq/ENgH3TwKSKzt6EzbsbcOAasMXH6WAR6ffYnk+f5NJrNaXPUZK1aH9DsbyoeQxtPcCD6y JpcMN2G/DwghhKueBmSlMnEYklWe8N5tWroEeydFBVfzAShagmYICLTw81mXll5PqISSdqmC4LG pv+Gw293RU6RF8NAKihREcYv4Y+SB0NtrJRAwfopsEFI8RFnjk+crg9kxQaTiS399YDNeKA0SVg 4xqezZeWBJ8XMfmwxBdo9fmlpGbtUCPV4q15GO/o5fyPiRHOzA== X-Received: by 2002:a17:902:ea01:b0:2e5:98d7:8202 with SMTP id d9443c01a7336-2f03f1cf4f1mr383216995ad.13.1796107954270; Mon, 30 Nov 2026 22:52:34 -0800 (PST) Received: from twhmp6px (mxsmtp211.mxic.com.tw. [211.75.127.162]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f0c1430b9bsm120801615ad.0.2026.11.30.22.52.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 22:52:33 -0800 (PST) From: Cheng Ming Lin X-Google-Original-From: Cheng Ming Lin Received: from hqs-appsw-a2o.mp600.macronix.com (unknown [172.17.236.67]) by twhmp6px (Postfix) with ESMTPS id CF7324168D44; Tue, 1 Dec 2026 14:52:30 +0800 (CST) To: Mark Brown Cc: linux-spi@vger.kernel.org, linux-api@vger.kernel.org, Miquel Raynal , alvinzhou@mxic.com.tw Subject: [PATCH v2 3/3] spi: spidev: Document SPI_IOC_MESSAGE_FLAGS Date: Tue, 1 Dec 2026 14:52:02 +0800 Message-Id: <20261201065202.2667609-4-chengminglin@mxic.com.tw> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20261201065202.2667609-1-chengminglin@mxic.com.tw> References: <20261201065202.2667609-1-chengminglin@mxic.com.tw> X-Mailing-List: linux-api@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Describe the flags field of struct spi_ioc_transfer, SPI_IOC_XFER_DTR and the SPI_IOC_MESSAGE_FLAGS request, including how it differs from SPI_IOC_MESSAGE and how it fails on unsupported controllers and older kernels. Signed-off-by: Cheng Ming Lin --- Documentation/spi/spidev.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Documentation/spi/spidev.rst b/Documentation/spi/spidev.rst index e08b301ad..5595629c2 100644 --- a/Documentation/spi/spidev.rst +++ b/Documentation/spi/spidev.rst @@ -112,7 +112,7 @@ would expect. Standard read() and write() operations are obviously only half-duplex, and the chipselect is deactivated between those operations. Full-duplex access, and composite operation without chipselect de-activation, is available using -the SPI_IOC_MESSAGE(N) request. +the SPI_IOC_MESSAGE(N) and SPI_IOC_MESSAGE_FLAGS(N) requests. Several ioctl() requests let your driver read or override the device's current settings for data transfer parameters: @@ -189,3 +189,11 @@ and bitrate for each transfer segment.) To make a full duplex request, provide both rx_buf and tx_buf for the same transfer. It's even OK if those are the same buffer. + +Each transfer can also request a Double Transfer Rate (DTR) transfer by +setting SPI_IOC_XFER_DTR in the flags field of struct spi_ioc_transfer. +The flags field is only honoured by the SPI_IOC_MESSAGE_FLAGS(N) request, +which otherwise behaves like SPI_IOC_MESSAGE(N); SPI_IOC_MESSAGE(N) ignores +it. SPI_IOC_MESSAGE_FLAGS(N) fails with EINVAL if a transfer sets an +unknown flag or requests DTR from a controller that does not support it, +and with ENOTTY on kernels that do not support the request. -- 2.25.1