Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1161275lqo; Sat, 11 May 2024 09:51:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXDiHX0FQ2qtuAm4nmppp/ichkDGw+ROkeMVQsiBnhZLeDRzymXTd6F0UUVqwUB9opjNsnFKQ4vEL2dFdSDkpEjvaTSjYep8eZtfoLwyA== X-Google-Smtp-Source: AGHT+IF3yaKu+li5Sh7OMHH5qyBpjbcAzz7RYx9lSQFsqOckLTfgRTmJmVFiByVdJSIXO9WwRxET X-Received: by 2002:a05:622a:1921:b0:43b:dd9:18a3 with SMTP id d75a77b69052e-43dfdb43bc8mr63300641cf.52.1715446293145; Sat, 11 May 2024 09:51:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715446293; cv=pass; d=google.com; s=arc-20160816; b=kxr09yP5a9jXnSlMeLIew4EOfe1CysPpP1e4Vy9b/VgQwv2uL3iQZCH5fNS9TotoMm Z1/010amZG7vqUC1ZPdChS0Vw9mvZErK+PLDg07tPdgMS1jPgkrbhejBGVKUBeDGHuS+ 6qqqbezYFLVLUV7Y8syDGQNn/Lm90OdQ6bozNzUM24uysK2z1JC/YmUR03+19xc3VNdZ xjgiL4Zzn7PqH7BRZx3wmTJ7uqfzjBD67jdJ1/T7azkQ8uB0v/z8nWy5vRn5vRUaJV3z JfEmBwY6Ez0U6GYaO586NiruSxqPQhDqL0IsDzO2dmQFE3IJmM02S4/NHC8njPBVRME7 QoQA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=mEMHtxOS9xYidrMqIbKxrkQSO7SX5CfWuISzhK7lOQ8=; fh=umBukFLBwggQWQZfF8rpFNd6EMyG4M6lZodq+hUknt4=; b=wDSxQgCvoQpFrXzkcl4sXUPam3RYKgczcWmtPSTUV9D0SLqF7sycEAX5jFUtGWV01J w8Y67xd/SPbVW7y62+lj8vGSa0sfaK4g6vQN6OP48gYyFrTB/1oiSG9U67/ZXaCm0zui o9fEChmQ1EFWc9X1GUCI1fy5aCSBwXeCc8Nt6asZEXzpnOYOcxZoBgKFOrMIWngNoeHe lvlMMJOlP929PF/RuwcbvWEEjMNiwwXY7f2+AnczdBWz8ualvdQqPcv/YKs/eJ/YgSSy iQgyhWpxxa8zeMvXvPOvDaaQ7z9va9yt56uXwvdF2KFRl+bPc4xo3DANrzsnKGhfe2Tx LlWg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ho2aMbOo; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-176649-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176649-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43df54b62c8si61560281cf.200.2024.05.11.09.51.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 May 2024 09:51:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176649-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ho2aMbOo; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-176649-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176649-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id D9F351C20CF4 for ; Sat, 11 May 2024 16:51:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 05EF31B966; Sat, 11 May 2024 16:51:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ho2aMbOo" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 1D5467F; Sat, 11 May 2024 16:51:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715446281; cv=none; b=AVIFdRMMVT3yo7iqRFrGf4FHLVPCTHCQHW8op6hGf8sR/W7Y2r2hFUf4QGacLP2qhyzn4MxE4WVV/CItTcrcM5C6k0tiuk5lXFjehEcVDzw9KxoU9iO7Jpp493gChk+yFXGTclZSAhG3zpajiz71uBmX8Rbgg96IwvwO2AqHAtg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715446281; c=relaxed/simple; bh=VbOQwKp39EvEMHtEb152t547M0kAfy9Sqb88nc56TIM=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=eJ0FVgSFrs+cWfua61jLUSdDwKm1J/EcLgRuCVb9APIRROV63uo+7lbS5+hdIf1SyJ2xiEThPdTpdYnQXF9fsIx5G2MvftEppYi86RV1CkthrnroU44hKW1lwWJdRJz2uhhsU8hnSLY8vOtYP1vUKnUhVgtcpSdMwFwkZxDdC3I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ho2aMbOo; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28649C2BBFC; Sat, 11 May 2024 16:51:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715446280; bh=VbOQwKp39EvEMHtEb152t547M0kAfy9Sqb88nc56TIM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ho2aMbOojOrK2H82OaYrPukTh5D+Hb8/pe+WvpWXYK3mK7EnCkWVljE/YDyFRzo4/ Vnf21ZnIq0L65FzMvx8Br4ohQFWKAvJ17IHVRWdT+vnOJvo+KnXQLNjl/k1jtqPhMg PUxgYNNLIEgj9Eql0/YrsYtYsijbM+ba6fTkMAyqRqxsockzcEXMgJSJVVqqAj6StJ 9wzqtF6wuaoIENABRh02+EoWmmBrnWuNOMluwpsAmhBvWsvAaMizXf6bYjxIEZApN8 S2prjfU0ldHrTyDp+bN9TRBuHY1zXNfHLPBHQTlSoj8dW3ebNSXZ592wOasmX0fN1q 2mwFTsqYv3QnQ== Date: Sat, 11 May 2024 17:51:08 +0100 From: Jonathan Cameron To: David Lechner Cc: Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nuno =?UTF-8?B?U8Oh?= , Michael Hennerich , Lars-Peter Clausen , David Jander , Martin Sperl , linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org Subject: Re: [PATCH RFC v2 3/8] spi: add support for hardware triggered offload Message-ID: <20240511175108.5ce34c9c@jic23-huawei> In-Reply-To: <20240510-dlech-mainline-spi-engine-offload-2-v2-3-8707a870c435@baylibre.com> References: <20240510-dlech-mainline-spi-engine-offload-2-v2-0-8707a870c435@baylibre.com> <20240510-dlech-mainline-spi-engine-offload-2-v2-3-8707a870c435@baylibre.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Drive by comment inline. > diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h > index a8fc16c6bf37..ec8d875d31ff 100644 > --- a/include/linux/spi/spi.h > +++ b/include/linux/spi/spi.h > @@ -632,6 +632,9 @@ struct spi_controller { > /* Flag indicating that the SPI bus is locked for exclusive use */ > bool bus_lock_flag; > > + /* Flag indicating the bus is reserved for use by hardware trigger */ > + bool offload_hw_trigger_enabled; > + > /* > * Setup mode and clock, etc (SPI driver may call many times). > * > @@ -1594,12 +1597,26 @@ struct spi_controller_offload_ops { > * @unprepare: Callback to release any resources used by prepare(). > */ > void (*unprepare)(struct spi_device *spi, unsigned int id); > + > + /** > + * @hw_trigger_enable: Callback to enable the hardware trigger for the > + * given offload instance. > + */ > + Blank line in odd place.. > + int (*hw_trigger_enable)(struct spi_device *spi, unsigned int id); > + /** > + * @hw_trigger_disable: Callback to disable the hardware trigger for the > + * given offload instance. > + */ > + void (*hw_trigger_disable)(struct spi_device *spi, unsigned int id); > }; > > extern int spi_offload_prepare(struct spi_device *spi, unsigned int id, > struct spi_message *msg); > extern void spi_offload_unprepare(struct spi_device *spi, unsigned int id, > struct spi_message *msg); > +extern int spi_offload_hw_trigger_enable(struct spi_device *spi, unsigned int id); > +extern void spi_offload_hw_trigger_disable(struct spi_device *spi, unsigned int id); > > /*---------------------------------------------------------------------------*/ > >