2020-12-04 19:39:42

by Stephen Boyd

[permalink] [raw]
Subject: [PATCH 0/3] spi: spi-geni-qcom: Use gpio descriptors for CS

Collected patches from the two series below and associated tags so they
can be merged in one pile through the spi tree. Merry December!

SPI: https://lore.kernel.org/r/[email protected]
cros-ec: https://lore.kernel.org/r/[email protected]

Cc: Akash Asthana <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Gwendal Grignou <[email protected]>
Cc: Douglas Anderson <[email protected]>
Cc: Alexandru M Stan <[email protected]>

Stephen Boyd (3):
platform/chrome: cros_ec_spi: Don't overwrite spi::mode
platform/chrome: cros_ec_spi: Drop bits_per_word assignment
spi: spi-geni-qcom: Use the new method of gpio CS control

drivers/platform/chrome/cros_ec_spi.c | 2 --
drivers/spi/spi-geni-qcom.c | 1 +
2 files changed, 1 insertion(+), 2 deletions(-)


base-commit: b65054597872ce3aefbc6a666385eabdf9e288da
--
https://chromeos.dev


2020-12-04 19:39:56

by Stephen Boyd

[permalink] [raw]
Subject: [PATCH 1/3] platform/chrome: cros_ec_spi: Don't overwrite spi::mode

There isn't any need to overwrite the mode here in the driver with what
has been detected by the firmware, such as DT or ACPI. In fact, if we
use the SPI CS gpio descriptor feature we will overwrite the mode with
SPI_MODE_0 where it already contains SPI_MODE_0 and more importantly
SPI_CS_HIGH. Clearing the SPI_CS_HIGH bit causes the CS line to toggle
when the device is probed when it shouldn't change, confusing the driver
and making it fail to probe. Drop the assignment and let the spi core
take care of it.

Fixes: a17d94f0b6e1 ("mfd: Add ChromeOS EC SPI driver")
Cc: Simon Glass <[email protected]>
Cc: Gwendal Grignou <[email protected]>
Reviewed-by: Douglas Anderson <[email protected]>
Tested-by: Douglas Anderson <[email protected]>
Acked-by: Enric Balletbo i Serra <[email protected]>
Cc: Alexandru M Stan <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
---
drivers/platform/chrome/cros_ec_spi.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/platform/chrome/cros_ec_spi.c b/drivers/platform/chrome/cros_ec_spi.c
index dfa1f816a45f..f9df218fc2bb 100644
--- a/drivers/platform/chrome/cros_ec_spi.c
+++ b/drivers/platform/chrome/cros_ec_spi.c
@@ -742,7 +742,6 @@ static int cros_ec_spi_probe(struct spi_device *spi)
int err;

spi->bits_per_word = 8;
- spi->mode = SPI_MODE_0;
spi->rt = true;
err = spi_setup(spi);
if (err < 0)
--
https://chromeos.dev

2020-12-04 19:42:09

by Stephen Boyd

[permalink] [raw]
Subject: [PATCH 3/3] spi: spi-geni-qcom: Use the new method of gpio CS control

Let's set the 'use_gpio_descriptors' field so that we use the new way of
requesting the CS GPIOs in the core. This allows us to avoid having to
configure the CS pins in "output" mode with an 'output-enable' pinctrl
setting.

Cc: Akash Asthana <[email protected]>
Cc: Bjorn Andersson <[email protected]>
Reviewed-by: Douglas Anderson <[email protected]>
Cc: Alexandru M Stan <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
---
drivers/spi/spi-geni-qcom.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
index 25810a7eef10..c4c88984abc9 100644
--- a/drivers/spi/spi-geni-qcom.c
+++ b/drivers/spi/spi-geni-qcom.c
@@ -636,6 +636,7 @@ static int spi_geni_probe(struct platform_device *pdev)
spi->auto_runtime_pm = true;
spi->handle_err = handle_fifo_timeout;
spi->set_cs = spi_geni_set_cs;
+ spi->use_gpio_descriptors = true;

init_completion(&mas->cs_done);
init_completion(&mas->cancel_done);
--
https://chromeos.dev

2020-12-09 16:46:55

by Simon Glass

[permalink] [raw]
Subject: Re: [PATCH 1/3] platform/chrome: cros_ec_spi: Don't overwrite spi::mode

On Fri, 4 Dec 2020 at 12:35, Stephen Boyd <[email protected]> wrote:
>
> There isn't any need to overwrite the mode here in the driver with what
> has been detected by the firmware, such as DT or ACPI. In fact, if we
> use the SPI CS gpio descriptor feature we will overwrite the mode with
> SPI_MODE_0 where it already contains SPI_MODE_0 and more importantly
> SPI_CS_HIGH. Clearing the SPI_CS_HIGH bit causes the CS line to toggle
> when the device is probed when it shouldn't change, confusing the driver
> and making it fail to probe. Drop the assignment and let the spi core
> take care of it.
>
> Fixes: a17d94f0b6e1 ("mfd: Add ChromeOS EC SPI driver")
> Cc: Simon Glass <[email protected]>
> Cc: Gwendal Grignou <[email protected]>
> Reviewed-by: Douglas Anderson <[email protected]>
> Tested-by: Douglas Anderson <[email protected]>
> Acked-by: Enric Balletbo i Serra <[email protected]>
> Cc: Alexandru M Stan <[email protected]>
> Signed-off-by: Stephen Boyd <[email protected]>
> ---
> drivers/platform/chrome/cros_ec_spi.c | 1 -
> 1 file changed, 1 deletion(-)


Reviewed-by: Simon Glass <[email protected]>


>
>
> diff --git a/drivers/platform/chrome/cros_ec_spi.c b/drivers/platform/chrome/cros_ec_spi.c
> index dfa1f816a45f..f9df218fc2bb 100644
> --- a/drivers/platform/chrome/cros_ec_spi.c
> +++ b/drivers/platform/chrome/cros_ec_spi.c
> @@ -742,7 +742,6 @@ static int cros_ec_spi_probe(struct spi_device *spi)
> int err;
>
> spi->bits_per_word = 8;
> - spi->mode = SPI_MODE_0;
> spi->rt = true;
> err = spi_setup(spi);
> if (err < 0)
> --
> https://chromeos.dev
>

2020-12-11 19:06:00

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 0/3] spi: spi-geni-qcom: Use gpio descriptors for CS

On Fri, 4 Dec 2020 11:35:37 -0800, Stephen Boyd wrote:
> Collected patches from the two series below and associated tags so they
> can be merged in one pile through the spi tree. Merry December!
>
> SPI: https://lore.kernel.org/r/[email protected]
> cros-ec: https://lore.kernel.org/r/[email protected]
>
> Cc: Akash Asthana <[email protected]>
> Cc: Simon Glass <[email protected]>
> Cc: Gwendal Grignou <[email protected]>
> Cc: Douglas Anderson <[email protected]>
> Cc: Alexandru M Stan <[email protected]>
>
> [...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/3] platform/chrome: cros_ec_spi: Don't overwrite spi::mode
commit: 74639cbf51d7c0304342544a83dfda354a6bd208
[2/3] platform/chrome: cros_ec_spi: Drop bits_per_word assignment
commit: 7a5172b7990d97ab9ef64e6d9063aa68099ea023
[3/3] spi: spi-geni-qcom: Use the new method of gpio CS control
commit: 3b25f337929e73232f0aa990cd68a129f53652e2

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark