All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] cros_ec_spi: Work better with CS GPIO descriptors
@ 2020-12-03  1:16 Stephen Boyd
  2020-12-03  1:16 ` [PATCH 1/2] platform/chrome: cros_ec_spi: Don't overwrite spi::mode Stephen Boyd
  2020-12-03  1:16 ` [PATCH 2/2] platform/chrome: cros_ec_spi: Drop bits_per_word assignment Stephen Boyd
  0 siblings, 2 replies; 7+ messages in thread
From: Stephen Boyd @ 2020-12-03  1:16 UTC (permalink / raw)
  To: Benson Leung, Enric Balletbo i Serra
  Cc: linux-kernel, Simon Glass, Gwendal Grignou, Douglas Anderson,
	Alexandru M Stan

Two small patches to work better with the new CS GPIO descriptor logic.
The first one fixes a problem found while trying to enable that feature
and the second patch removes a line that I noticed while looking in the
same area.

Cc: Simon Glass <sjg@chromium.org>
Cc: Gwendal Grignou <gwendal@chromium.org>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Alexandru M Stan <amstan@chromium.org>

Stephen Boyd (2):
  platform/chrome: cros_ec_spi: Don't overwrite spi::mode
  platform/chrome: cros_ec_spi: Drop bits_per_word assignment

 drivers/platform/chrome/cros_ec_spi.c | 2 --
 1 file changed, 2 deletions(-)

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] platform/chrome: cros_ec_spi: Don't overwrite spi::mode
  2020-12-03  1:16 [PATCH 0/2] cros_ec_spi: Work better with CS GPIO descriptors Stephen Boyd
@ 2020-12-03  1:16 ` Stephen Boyd
  2020-12-03  1:17   ` Doug Anderson
  2020-12-04  9:15   ` Enric Balletbo i Serra
  2020-12-03  1:16 ` [PATCH 2/2] platform/chrome: cros_ec_spi: Drop bits_per_word assignment Stephen Boyd
  1 sibling, 2 replies; 7+ messages in thread
From: Stephen Boyd @ 2020-12-03  1:16 UTC (permalink / raw)
  To: Benson Leung, Enric Balletbo i Serra
  Cc: linux-kernel, Simon Glass, Gwendal Grignou, Douglas Anderson,
	Alexandru M Stan

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 <sjg@chromium.org>
Cc: Gwendal Grignou <gwendal@chromium.org>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Alexandru M Stan <amstan@chromium.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
---
 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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/2] platform/chrome: cros_ec_spi: Drop bits_per_word assignment
  2020-12-03  1:16 [PATCH 0/2] cros_ec_spi: Work better with CS GPIO descriptors Stephen Boyd
  2020-12-03  1:16 ` [PATCH 1/2] platform/chrome: cros_ec_spi: Don't overwrite spi::mode Stephen Boyd
@ 2020-12-03  1:16 ` Stephen Boyd
  2020-12-03  1:18   ` Doug Anderson
  2020-12-04  9:15   ` Enric Balletbo i Serra
  1 sibling, 2 replies; 7+ messages in thread
From: Stephen Boyd @ 2020-12-03  1:16 UTC (permalink / raw)
  To: Benson Leung, Enric Balletbo i Serra
  Cc: linux-kernel, Simon Glass, Gwendal Grignou, Douglas Anderson,
	Alexandru M Stan

This is already handed by default in spi_setup() if the bits_per_word is
0, so just drop it to shave off a line.

Cc: Simon Glass <sjg@chromium.org>
Cc: Gwendal Grignou <gwendal@chromium.org>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Alexandru M Stan <amstan@chromium.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
---
 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 f9df218fc2bb..14c4046fa04d 100644
--- a/drivers/platform/chrome/cros_ec_spi.c
+++ b/drivers/platform/chrome/cros_ec_spi.c
@@ -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)
-- 
https://chromeos.dev


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] platform/chrome: cros_ec_spi: Don't overwrite spi::mode
  2020-12-03  1:16 ` [PATCH 1/2] platform/chrome: cros_ec_spi: Don't overwrite spi::mode Stephen Boyd
@ 2020-12-03  1:17   ` Doug Anderson
  2020-12-04  9:15   ` Enric Balletbo i Serra
  1 sibling, 0 replies; 7+ messages in thread
From: Doug Anderson @ 2020-12-03  1:17 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Benson Leung, Enric Balletbo i Serra, LKML, Simon Glass,
	Gwendal Grignou, Alexandru M Stan

Hi,

On Wed, Dec 2, 2020 at 5:16 PM Stephen Boyd <swboyd@chromium.org> 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 <sjg@chromium.org>
> Cc: Gwendal Grignou <gwendal@chromium.org>
> Cc: Douglas Anderson <dianders@chromium.org>
> Cc: Alexandru M Stan <amstan@chromium.org>
> Signed-off-by: Stephen Boyd <swboyd@chromium.org>
> ---
>  drivers/platform/chrome/cros_ec_spi.c | 1 -

Reviewed-by: Douglas Anderson <dianders@chromium.org>
Tested-by: Douglas Anderson <dianders@chromium.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] platform/chrome: cros_ec_spi: Drop bits_per_word assignment
  2020-12-03  1:16 ` [PATCH 2/2] platform/chrome: cros_ec_spi: Drop bits_per_word assignment Stephen Boyd
@ 2020-12-03  1:18   ` Doug Anderson
  2020-12-04  9:15   ` Enric Balletbo i Serra
  1 sibling, 0 replies; 7+ messages in thread
From: Doug Anderson @ 2020-12-03  1:18 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Benson Leung, Enric Balletbo i Serra, LKML, Simon Glass,
	Gwendal Grignou, Alexandru M Stan

Hi,

On Wed, Dec 2, 2020 at 5:16 PM Stephen Boyd <swboyd@chromium.org> wrote:
>
> This is already handed by default in spi_setup() if the bits_per_word is
> 0, so just drop it to shave off a line.
>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Gwendal Grignou <gwendal@chromium.org>
> Cc: Douglas Anderson <dianders@chromium.org>
> Cc: Alexandru M Stan <amstan@chromium.org>
> Signed-off-by: Stephen Boyd <swboyd@chromium.org>
> ---
>  drivers/platform/chrome/cros_ec_spi.c | 1 -
>  1 file changed, 1 deletion(-)

Reviewed-by: Douglas Anderson <dianders@chromium.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] platform/chrome: cros_ec_spi: Don't overwrite spi::mode
  2020-12-03  1:16 ` [PATCH 1/2] platform/chrome: cros_ec_spi: Don't overwrite spi::mode Stephen Boyd
  2020-12-03  1:17   ` Doug Anderson
@ 2020-12-04  9:15   ` Enric Balletbo i Serra
  1 sibling, 0 replies; 7+ messages in thread
From: Enric Balletbo i Serra @ 2020-12-04  9:15 UTC (permalink / raw)
  To: Stephen Boyd, Benson Leung
  Cc: linux-kernel, Simon Glass, Gwendal Grignou, Douglas Anderson,
	Alexandru M Stan

Hi Stephen,

Thank you for your patch.

On 3/12/20 2:16, Stephen Boyd 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 <sjg@chromium.org>
> Cc: Gwendal Grignou <gwendal@chromium.org>
> Cc: Douglas Anderson <dianders@chromium.org>
> Cc: Alexandru M Stan <amstan@chromium.org>
> Signed-off-by: Stephen Boyd <swboyd@chromium.org>
> ---

Acked-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>

>  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)
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] platform/chrome: cros_ec_spi: Drop bits_per_word assignment
  2020-12-03  1:16 ` [PATCH 2/2] platform/chrome: cros_ec_spi: Drop bits_per_word assignment Stephen Boyd
  2020-12-03  1:18   ` Doug Anderson
@ 2020-12-04  9:15   ` Enric Balletbo i Serra
  1 sibling, 0 replies; 7+ messages in thread
From: Enric Balletbo i Serra @ 2020-12-04  9:15 UTC (permalink / raw)
  To: Stephen Boyd, Benson Leung
  Cc: linux-kernel, Simon Glass, Gwendal Grignou, Douglas Anderson,
	Alexandru M Stan

Hi Stephen,

Thank you for your patch.

On 3/12/20 2:16, Stephen Boyd wrote:
> This is already handed by default in spi_setup() if the bits_per_word is
> 0, so just drop it to shave off a line.
> 
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Gwendal Grignou <gwendal@chromium.org>
> Cc: Douglas Anderson <dianders@chromium.org>
> Cc: Alexandru M Stan <amstan@chromium.org>
> Signed-off-by: Stephen Boyd <swboyd@chromium.org>

Acked-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>

> ---
>  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 f9df218fc2bb..14c4046fa04d 100644
> --- a/drivers/platform/chrome/cros_ec_spi.c
> +++ b/drivers/platform/chrome/cros_ec_spi.c
> @@ -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)
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-12-04  9:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03  1:16 [PATCH 0/2] cros_ec_spi: Work better with CS GPIO descriptors Stephen Boyd
2020-12-03  1:16 ` [PATCH 1/2] platform/chrome: cros_ec_spi: Don't overwrite spi::mode Stephen Boyd
2020-12-03  1:17   ` Doug Anderson
2020-12-04  9:15   ` Enric Balletbo i Serra
2020-12-03  1:16 ` [PATCH 2/2] platform/chrome: cros_ec_spi: Drop bits_per_word assignment Stephen Boyd
2020-12-03  1:18   ` Doug Anderson
2020-12-04  9:15   ` Enric Balletbo i Serra

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.