From patchwork Thu Jan 27 09:17:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 12726464 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 017D0C433F5 for ; Thu, 27 Jan 2022 09:18:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232851AbiA0JSU (ORCPT ); Thu, 27 Jan 2022 04:18:20 -0500 Received: from relay11.mail.gandi.net ([217.70.178.231]:49377 "EHLO relay11.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234997AbiA0JSU (ORCPT ); Thu, 27 Jan 2022 04:18:20 -0500 Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 9857C100012; Thu, 27 Jan 2022 09:18:17 +0000 (UTC) From: Miquel Raynal To: Mark Brown , Cc: Richard Weinberger , Vignesh Raghavendra , Tudor Ambarus , Pratyush Yadav , Michael Walle , , Boris Brezillon , Thomas Petazzoni , Julien Su , Jaime Liao , Miquel Raynal Subject: [PATCH v10 04/13] spi: mxic: Provide a capability structure Date: Thu, 27 Jan 2022 10:17:59 +0100 Message-Id: <20220127091808.1043392-5-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220127091808.1043392-1-miquel.raynal@bootlin.com> References: <20220127091808.1043392-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org This controller has DTR support, so advertize it with a capability now that the spi-controller structure contains this new field. This will later be used by the core to discriminate whether an operation is supported or not, in a more generic way than having different helpers. Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon Link: https://lore.kernel.org/linux-mtd/20220104083631.40776-5-miquel.raynal@bootlin.com --- drivers/spi/spi-mxic.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/spi/spi-mxic.c b/drivers/spi/spi-mxic.c index 45889947afed..9952fcdf3627 100644 --- a/drivers/spi/spi-mxic.c +++ b/drivers/spi/spi-mxic.c @@ -448,6 +448,10 @@ static const struct spi_controller_mem_ops mxic_spi_mem_ops = { .exec_op = mxic_spi_mem_exec_op, }; +static const struct spi_controller_mem_caps mxic_spi_mem_caps = { + .dtr = true, +}; + static void mxic_spi_set_cs(struct spi_device *spi, bool lvl) { struct mxic_spi *mxic = spi_master_get_devdata(spi->master); @@ -580,6 +584,7 @@ static int mxic_spi_probe(struct platform_device *pdev) master->num_chipselect = 1; master->mem_ops = &mxic_spi_mem_ops; + master->mem_caps = &mxic_spi_mem_caps; master->set_cs = mxic_spi_set_cs; master->transfer_one = mxic_spi_transfer_one;