Merge mainline v2.6.27-rc2 tree into linux-omap tree
[pandora-kernel.git] / arch / arm / mach-omap1 / board-nokia770.c
index 3f39e0e..33a9877 100644 (file)
@@ -34,6 +34,7 @@
 #include <asm/arch/dsp_common.h>
 #include <asm/arch/aic23.h>
 #include <asm/arch/omapfb.h>
+#include <asm/arch/hwa742.h>
 #include <asm/arch/lcd_mipid.h>
 
 #define ADS7846_PENDOWN_GPIO   15
@@ -162,6 +163,47 @@ static struct spi_board_info nokia770_spi_board_info[] __initdata = {
        },
 };
 
+static struct {
+       struct clk *sys_ck;
+} hwa742;
+
+static int hwa742_get_clocks(void)
+{
+       hwa742.sys_ck = clk_get(NULL, "bclk");
+       if (IS_ERR(hwa742.sys_ck)) {
+               printk(KERN_ERR "can't get HWA742 clock\n");
+               return PTR_ERR(hwa742.sys_ck);
+       }
+       return 0;
+}
+
+static unsigned long hwa742_get_clock_rate(struct device *dev)
+{
+       return clk_get_rate(hwa742.sys_ck);
+}
+
+static void hwa742_power_up(struct device *dev)
+{
+       clk_enable(hwa742.sys_ck);
+}
+
+static void hwa742_power_down(struct device *dev)
+{
+       clk_disable(hwa742.sys_ck);
+}
+
+static struct hwa742_platform_data nokia770_hwa742_platform_data = {
+       .get_clock_rate = hwa742_get_clock_rate,
+       .power_up       = hwa742_power_up,
+       .power_down     = hwa742_power_down,
+       .te_connected   = 1,
+};
+
+static void hwa742_dev_init(void)
+{
+       hwa742_get_clocks();
+       omapfb_set_ctrl_platform_data(&nokia770_hwa742_platform_data);
+}
 
 /* assume no Mini-AB port */
 
@@ -333,6 +375,7 @@ static void __init omap_nokia770_init(void)
        omap_serial_init();
        omap_register_i2c_bus(1, 100, NULL, 0);
        omap_dsp_init();
+       hwa742_dev_init();
        ads7846_dev_init();
        mipid_dev_init();
 }