- /*
- * FIXME
- * Right now, mvebu does not have a clock infrastructure in U-Boot
- * which should be used to query the input clock to the SPI
- * controller. Once this clock driver is integrated into U-Boot
- * it should be used to read the input clock and the DT property
- * can be removed.
- */
- plat->clock = fdtdec_get_int(gd->fdt_blob, bus->of_offset,
- "clock-frequency", 160000);
- plat->frequency = fdtdec_get_int(gd->fdt_blob, bus->of_offset,
- "spi-max-frequency", 40000);
+ ret = clk_get_by_index(bus, 0, &plat->clk);
+ if (ret) {
+ dev_err(bus, "cannot get clock\n");
+ return ret;
+ }
+
+ return 0;
+}
+
+static int mvebu_spi_remove(struct udevice *bus)
+{
+ struct mvebu_spi_platdata *plat = dev_get_platdata(bus);
+
+ clk_free(&plat->clk);