Skip to content

Commit

Permalink
spi: mxic: Provide a capability structure
Browse files Browse the repository at this point in the history
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 <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/linux-mtd/20220127091808.1043392-5-miquel.raynal@bootlin.com
  • Loading branch information
Miquel Raynal committed Feb 10, 2022
1 parent a9be454 commit 0e450c7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/spi/spi-mxic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 0e450c7

Please sign in to comment.