struct mvebu_spi_platdata {
struct kwspi_registers *spireg;
+ bool is_errata_50mhz_ac;
};
struct mvebu_spi_priv {
{
struct mvebu_spi_platdata *plat = dev_get_platdata(bus);
struct kwspi_registers *reg = plat->spireg;
- const struct mvebu_spi_dev *drvdata;
u32 data = readl(®->cfg);
data &= ~(KWSPI_CPHA | KWSPI_CPOL | KWSPI_RXLSBF | KWSPI_TXLSBF);
writel(data, ®->cfg);
- drvdata = (struct mvebu_spi_dev *)dev_get_driver_data(bus);
- if (drvdata->is_errata_50mhz_ac)
+ if (plat->is_errata_50mhz_ac)
mvebu_spi_50mhz_ac_timing_erratum(bus, mode);
return 0;
static int mvebu_spi_ofdata_to_platdata(struct udevice *bus)
{
struct mvebu_spi_platdata *plat = dev_get_platdata(bus);
+ const struct mvebu_spi_dev *drvdata =
+ (struct mvebu_spi_dev *)dev_get_driver_data(bus);
plat->spireg = (struct kwspi_registers *)devfdt_get_addr(bus);
+ plat->is_errata_50mhz_ac = drvdata->is_errata_50mhz_ac;
return 0;
}