|
@@ -24,6 +24,7 @@
|
|
|
#include <mach/common.h>
|
|
|
#include <mach/time.h>
|
|
|
#include <mach/da8xx.h>
|
|
|
+#include <mach/clock.h>
|
|
|
#include "cpuidle.h"
|
|
|
#include "sram.h"
|
|
|
|
|
@@ -1023,6 +1024,28 @@ int __init da8xx_register_spi_bus(int instance, unsigned num_chipselect)
|
|
|
}
|
|
|
|
|
|
#ifdef CONFIG_ARCH_DAVINCI_DA850
|
|
|
+static struct clk sata_refclk = {
|
|
|
+ .name = "sata_refclk",
|
|
|
+ .set_rate = davinci_simple_set_rate,
|
|
|
+};
|
|
|
+
|
|
|
+static struct clk_lookup sata_refclk_lookup =
|
|
|
+ CLK("ahci_da850", "refclk", &sata_refclk);
|
|
|
+
|
|
|
+int __init da850_register_sata_refclk(int rate)
|
|
|
+{
|
|
|
+ int ret;
|
|
|
+
|
|
|
+ sata_refclk.rate = rate;
|
|
|
+ ret = clk_register(&sata_refclk);
|
|
|
+ if (ret)
|
|
|
+ return ret;
|
|
|
+
|
|
|
+ clkdev_add(&sata_refclk_lookup);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
static struct resource da850_sata_resources[] = {
|
|
|
{
|
|
|
.start = DA850_SATA_BASE,
|
|
@@ -1055,9 +1078,15 @@ static struct platform_device da850_sata_device = {
|
|
|
|
|
|
int __init da850_register_sata(unsigned long refclkpn)
|
|
|
{
|
|
|
+ int ret;
|
|
|
+
|
|
|
/* please see comment in drivers/ata/ahci_da850.c */
|
|
|
BUG_ON(refclkpn != 100 * 1000 * 1000);
|
|
|
|
|
|
+ ret = da850_register_sata_refclk(refclkpn);
|
|
|
+ if (ret)
|
|
|
+ return ret;
|
|
|
+
|
|
|
return platform_device_register(&da850_sata_device);
|
|
|
}
|
|
|
#endif
|