spi: spi-geni-qcom: Use gpio descriptors for CS
cover 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]
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
Signature · 1 line
https://chromeos.dev
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.
--- drivers/platform/chrome/cros_ec_spi.c | 1 - 1 file changed, 1 deletion(-)
drivers/platform/chrome/cros_ec_spi.c +0 -1
@@ -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 )
Signature · 1 line
https://chromeos.dev
Re: [PATCH 1/3] platform/chrome: cros_ec_spi: Don't overwrite spi::mode
Quoted 18 lines · Stephen Boyd
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_0where it already containsSPI_MODE_0and more importantlySPI_CS_HIGH. Clearing theSPI_CS_HIGHbit 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]>Cc Alexandru M Stan <[email protected]>Signed-off-by Stephen Boyd <[email protected]>
Quoted 3 lines
--- drivers/platform/chrome/cros_ec_spi.c | 1 - 1 file changed, 1 deletion(-)
Quoted 17 lines
drivers/platform/chrome/cros_ec_spi.c +0
-2@@ -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 ) --
PATCH 2/3 platform/chrome: cros_ec_spi: Drop bits_per_word assignment
In reply to Stephen BoydThis is already handed by default in spi_setup() if the bits_per_word is 0, so just drop it to shave off a line.
--- drivers/platform/chrome/cros_ec_spi.c | 1 - 1 file changed, 1 deletion(-)
drivers/platform/chrome/cros_ec_spi.c +0 -1
@@ -741,7 +741,6 @@ static int cros_ec_spi_probe(struct spi_device *spi)struct cros_ec_spi *ec_spi;int err; - spi->bits_per_word =8 ; spi->rt = true; err =spi_setup (spi);if (err <0 )
Signature · 1 line
https://chromeos.dev
Re: [PATCH 2/3] platform/chrome: cros_ec_spi: Drop bits_per_word assignment
Quoted 11 lines · Stephen Boyd
This is already handed by default in
spi_setup()if thebits_per_wordis 0, so just drop it to shave off a line.Cc Simon Glass <[email protected]>Cc Gwendal Grignou <[email protected]>Reviewed-by Douglas Anderson <[email protected]>Tested-by Douglas Anderson <[email protected]>Cc Alexandru M Stan <[email protected]>Signed-off-by Stephen Boyd <[email protected]>
Quoted 3 lines
--- drivers/platform/chrome/cros_ec_spi.c | 1 - 1 file changed, 1 deletion(-)
Quoted 16 lines
drivers/platform/chrome/cros_ec_spi.c +0
-2@@ -741,7 +741,6 @@ static int cros_ec_spi_probe(struct spi_device *spi)struct cros_ec_spi *ec_spi;int err; - spi->bits_per_word =8 ; spi->rt = true; err =spi_setup (spi);if (err <0 ) --
PATCH 3/3 spi: spi-geni-qcom: Use the new method of gpio CS control
In reply to Stephen BoydLet'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.
--- drivers/spi/spi-geni-qcom.c | 1 + 1 file changed, 1 insertion(+)
drivers/spi/spi-geni-qcom.c +1 -0
@@ -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);
Signature · 1 line
https://chromeos.dev
Mark Brown
maintainerQuoted 6 lines · Stephen Boyd
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]
Quoted 7 lines
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: 3b25f337929e73232f0aa990cd68a129f53652e2All 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
This series was applied to qcom/linux.git (refs/heads/for-next):
Hello:
This series was applied to qcom/linux.git (refs/heads/for-next):
Quoted 6 lines · On Fri, 4 Dec 2020 11:35:37 -0800 you 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]
Quoted 7 lines
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]>[...]
Here is the summary with links:
- [1/3] platform/chrome: cros_ec_spi: Don't overwrite spi::mode
https://git.kernel.org/qcom/c/74639cbf51d7 - [2/3] platform/chrome: cros_ec_spi: Drop bits_per_word assignment https://git.kernel.org/qcom/c/7a5172b7990d - [3/3] spi: spi-geni-qcom: Use the new method of gpio CS control https://git.kernel.org/qcom/c/3b25f337929e
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html