lkml.org 
[lkml]   [2022]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [RFC PATCH 1/2] spi: Add multiple CS support for a single SPI device
Date
Hello Mark,

> -----Original Message-----
> From: Mark Brown <broonie@kernel.org>
> Sent: Friday, July 15, 2022 9:24 PM
> To: Mahapatra, Amit Kumar <amit.kumar-mahapatra@amd.com>
> Cc: Amit Kumar Mahapatra <amit.kumar-mahapatra@xilinx.com>;
> p.yadav@ti.com; miquel.raynal@bootlin.com; richard@nod.at;
> vigneshr@ti.com; git@xilinx.com; michal.simek@xilinx.com; linux-
> spi@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linux-
> kernel@vger.kernel.org; michael@walle.cc; linux-mtd@lists.infradead.org;
> git (AMD-Xilinx) <git@amd.com>
> Subject: Re: [RFC PATCH 1/2] spi: Add multiple CS support for a single SPI
> device
>
> On Fri, Jul 15, 2022 at 03:35:49PM +0000, Mahapatra, Amit Kumar wrote:
>
> > > That doesn't address the issue, the issue is checking that the
> > > driver can support multiple chip selects.
>
> > To address this issue, in spi core we will check the number of items
> > in the "reg" property of the flash node(which is nothing but the
> > number of chip selects) against the "num-cs" property of the spi
> > controller(which is total number of chip selects supported by the
> > controller). If the number of items mentioned in the "reg" property is
> > greater than "num-cs" value then we error out.
>
> > For eg.,
>
> > rc = of_property_read_variable_u32_array(nc, "reg", &cs[0], 1,
> > SPI_CS_CNT_MAX);
> > if(rc > ctlr->num_chipselect) {
> > dev_err(&ctlr->dev, "%pOF has invalid 'reg' property (%d)\n",
> > nc, rc);
> > return -EINVAL;
> > }
>
> This would check that the controller has at least the number of chip selects
> specified but it would not check that the controller is actually capable of
> using more than one chip select at once. We should be validating both that

I agree, so for checking the controller multiple chip select capability(using
more than one chip select at once) we can define a new spi controller DT
property like "multi-cs-cap"(please suggest a better name).
The controller that can support multiple chip selects should have this property
in the spi controller DT node. The spi core will check ctlr->multi-cs-cap to
operate multiple chip select in parallel.

> the chip selects are available and that the controller can do something useful
> with them (and probably have an implementation in the core for doing so via
> GPIO).

Here are you referring to the usecase in which a controller implementing multi CS
support using GPIO?


Regards,
Amit

\
 
 \ /
  Last update: 2022-07-19 16:07    [W:0.176 / U:1.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site