Linux-SPI Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] spi: pl022: User more sensible defaults
@ 2021-03-28 12:15 Linus Walleij
  2021-03-29 19:58 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Linus Walleij @ 2021-03-28 12:15 UTC (permalink / raw)
  To: Mark Brown, linux-spi; +Cc: Linus Walleij

When using the device tree, which must be considered normal
these days, in order to get some kind of normal functionality
out of the PL022 users have to actively go into the device
tree and edit the SPI clients like this:

spi {
  compatible = "arm,pl022";
  num-cs = <1>;
  cs-gpios = <&gpio 0 GPIO_ACTIVE_LOW>;

  foo@0 {
    compatible = "foo";
    reg = <0>;
    pl022,interface = <0>;
    pl022,com-mode = <0>;
  };
};

Otherwise the PL022 will come up as a client (slave) and
using polling mode. This is quite unintuitive and many users
will get their device trees wrong.

Alter the defaults such that we come up in host mode
(master) and use interrupt mode.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/spi/spi-pl022.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index fd74ddfbb686..faaca7373b40 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -1820,9 +1820,9 @@ static int calculate_effective_freq(struct pl022 *pl022, int freq, struct
  * supplies it.
  */
 static const struct pl022_config_chip pl022_default_chip_info = {
-	.com_mode = POLLING_TRANSFER,
+	.com_mode = INTERRUPT_TRANSFER,
 	.iface = SSP_INTERFACE_MOTOROLA_SPI,
-	.hierarchy = SSP_SLAVE,
+	.hierarchy = SSP_MASTER,
 	.slave_tx_disable = DO_NOT_DRIVE_TX,
 	.rx_lev_trig = SSP_RX_1_OR_MORE_ELEM,
 	.tx_lev_trig = SSP_TX_1_OR_MORE_EMPTY_LOC,
-- 
2.29.2


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

* Re: [PATCH] spi: pl022: User more sensible defaults
  2021-03-28 12:15 [PATCH] spi: pl022: User more sensible defaults Linus Walleij
@ 2021-03-29 19:58 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2021-03-29 19:58 UTC (permalink / raw)
  To: linux-spi, Linus Walleij; +Cc: Mark Brown

On Sun, 28 Mar 2021 14:15:30 +0200, Linus Walleij wrote:
> When using the device tree, which must be considered normal
> these days, in order to get some kind of normal functionality
> out of the PL022 users have to actively go into the device
> tree and edit the SPI clients like this:
> 
> spi {
>   compatible = "arm,pl022";
>   num-cs = <1>;
>   cs-gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
> 
> [...]

Applied to

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

Thanks!

[1/1] spi: pl022: User more sensible defaults
      commit: 413c601e8fd0e4adab67e0775dd84e63be6d803e

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

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-28 12:15 [PATCH] spi: pl022: User more sensible defaults Linus Walleij
2021-03-29 19:58 ` Mark Brown

Linux-SPI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-spi/0 linux-spi/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-spi linux-spi/ https://lore.kernel.org/linux-spi \
		linux-spi@vger.kernel.org
	public-inbox-index linux-spi

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-spi


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git