drivers/flash: restore previous calls directly to machine package until we implement SetClockSpeed()

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram
2020-12-13 09:56:59 +01:00
committed by Ron Evans
parent 42a907035b
commit cc7079b0cd
2 changed files with 29 additions and 10 deletions
+6 -6
View File
@@ -135,12 +135,12 @@ func (dev *Device) Configure(config *DeviceConfig) (err error) {
// Speed up to max device frequency
// I propose a check here for max frequency, but not put that functionality directly into the driver.
// Either that or we have to change the signature of the SPI interface in the machine package itself.
// if dev.attrs.MaxClockSpeedMHz > 0 {
// err := dev.trans.setClockSpeed(uint32(dev.attrs.MaxClockSpeedMHz) * 1e6)
// if err != nil {
// return err
// }
// }
if dev.attrs.MaxClockSpeedMHz > 0 {
err := dev.trans.setClockSpeed(uint32(dev.attrs.MaxClockSpeedMHz) * 1e6)
if err != nil {
return err
}
}
// Enable Quad Mode if available
if dev.trans.supportQuadMode() && dev.attrs.QuadEnableBitMask > 0 {