Skip to contentSkip to conversation

spi: imx: Implement set_speed

PATCH Superseded Marek Vasut 2 participants 3 messages Jan 27, 2021 – Feb 3, 2021

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spi: imx: Implement set_speed

The set_speed() callback should configure the bus speed, make it so.

Cc Jagan Teki <[email protected]>
Cc Stefano Babic <[email protected]>
---
 drivers/spi/mxc_spi.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/spi/mxc_spi.c +4 -1
index 553a0315df5..47100d89aef 100644
@@ -661,7 +661,10 @@ static int mxc_spi_release_bus(struct udevice *dev)
 
 static int mxc_spi_set_speed(struct udevice *bus, uint speed)
 {
-	/* Nothing to do */
+	struct mxc_spi_slave *mxcs = dev_get_platdata(bus);
+
+	mxcs->max_hz = speed;
+
 	return 0;
 }
 
Signature · 1 line
2.29.2
#1 lore raw

PATCH 1/1 spi: imx: Implement set_speed

Quoted 15 lines · Marek Vasut

The set_speed() callback should configure the bus speed, make it so.

Cc Jagan Teki <[email protected]>
Cc Stefano Babic <[email protected]>
---
 drivers/spi/mxc_spi.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/spi/mxc_spi.c +0 -0
index 553a0315df5..47100d89aef 100644

drivers/spi/mxc_spi.c static int mxc_spi_release_bus(struct udevice *dev) · line 664

Quoted 5 lines
drivers/spi/mxc_spi.c +1 -1
@@ -661,7 +661,10 @@ static int mxc_spi_release_bus(struct udevice *dev)
 
 static int mxc_spi_set_speed(struct udevice *bus, uint speed)
 {
-       /* Nothing to do */
+       struct mxc_spi_slave *mxcs = dev_get_platdata(bus);

This is now renamed to dev_get_plat()

drivers/spi/mxc_spi.c static int mxc_spi_release_bus(struct udevice *dev) · line 670

Quoted 6 lines
drivers/spi/mxc_spi.c +3 -0
+
+       mxcs->max_hz = speed;
+
        return 0;
 }
 

Otherwise,

#2 lore raw

PATCH 1/1 spi: imx: Implement set_speed

Quoted 17 lines · Bin Meng
Quoted 16 lines · Marek Vasut

The set_speed() callback should configure the bus speed, make it so.

Cc Jagan Teki <[email protected]>
Cc Stefano Babic <[email protected]>
---
  drivers/spi/mxc_spi.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
drivers/spi/mxc_spi.c +0 -0
index 553a0315df5..47100d89aef 100644
@@ -661,7 +661,10 @@ static int mxc_spi_release_bus(struct udevice *dev)
 
Quoted 6 lines

drivers/spi/mxc_spi.c static int mxc_spi_release_bus(struct udevice *dev) · line 664

Quoted 4 lines
drivers/spi/mxc_spi.c +1 -1
  static int mxc_spi_set_speed(struct udevice *bus, uint speed)
  {
-       /* Nothing to do */
+       struct mxc_spi_slave *mxcs = dev_get_platdata(bus);

This is now renamed to dev_get_plat()

Fixed in V2, thanks.