提交 088962c2 编写于 作者: A Andrew de Quincey 提交者: Tony Lindgren

ARM: OMAP1: Make 770 LCD work

Make 770 LCD work by adding clk_add_alias().
Also remove the old unused functions.

Note that the clk_add_alias() could probably be moved
to arch/arm/clkdev.c later on.

Cc: linux-fbdev-devel@lists.sourceforge.net
Signed-off-by: NAndrew de Quincey <adq_dvb@lidskialf.net>
Signed-off-by: NImre Deak <imre.deak@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com
上级 f5525786
...@@ -33,9 +33,11 @@ ...@@ -33,9 +33,11 @@
#include <mach/common.h> #include <mach/common.h>
#include <mach/dsp_common.h> #include <mach/dsp_common.h>
#include <mach/omapfb.h> #include <mach/omapfb.h>
#include <mach/hwa742.h>
#include <mach/lcd_mipid.h> #include <mach/lcd_mipid.h>
#include <mach/mmc.h> #include <mach/mmc.h>
#include <mach/usb.h> #include <mach/usb.h>
#include <mach/clock.h>
#define ADS7846_PENDOWN_GPIO 15 #define ADS7846_PENDOWN_GPIO 15
...@@ -163,6 +165,15 @@ static struct spi_board_info nokia770_spi_board_info[] __initdata = { ...@@ -163,6 +165,15 @@ static struct spi_board_info nokia770_spi_board_info[] __initdata = {
}, },
}; };
static struct hwa742_platform_data nokia770_hwa742_platform_data = {
.te_connected = 1,
};
static void hwa742_dev_init(void)
{
clk_add_alias("hwa_sys_ck", NULL, "bclk", NULL);
omapfb_set_ctrl_platform_data(&nokia770_hwa742_platform_data);
}
/* assume no Mini-AB port */ /* assume no Mini-AB port */
...@@ -371,6 +382,7 @@ static void __init omap_nokia770_init(void) ...@@ -371,6 +382,7 @@ static void __init omap_nokia770_init(void)
omap_serial_init(); omap_serial_init();
omap_register_i2c_bus(1, 100, NULL, 0); omap_register_i2c_bus(1, 100, NULL, 0);
omap_dsp_init(); omap_dsp_init();
hwa742_dev_init();
ads7846_dev_init(); ads7846_dev_init();
mipid_dev_init(); mipid_dev_init();
omap_usb_init(&nokia770_usb_config); omap_usb_init(&nokia770_usb_config);
......
...@@ -2,10 +2,6 @@ ...@@ -2,10 +2,6 @@
#define _HWA742_H #define _HWA742_H
struct hwa742_platform_data { struct hwa742_platform_data {
void (*power_up)(struct device *dev);
void (*power_down)(struct device *dev);
unsigned long (*get_clock_rate)(struct device *dev);
unsigned te_connected:1; unsigned te_connected:1;
}; };
......
...@@ -133,8 +133,7 @@ struct { ...@@ -133,8 +133,7 @@ struct {
struct lcd_ctrl_extif *extif; struct lcd_ctrl_extif *extif;
struct lcd_ctrl *int_ctrl; struct lcd_ctrl *int_ctrl;
void (*power_up)(struct device *dev); struct clk *sys_ck;
void (*power_down)(struct device *dev);
} hwa742; } hwa742;
struct lcd_ctrl hwa742_ctrl; struct lcd_ctrl hwa742_ctrl;
...@@ -915,14 +914,13 @@ static void hwa742_suspend(void) ...@@ -915,14 +914,13 @@ static void hwa742_suspend(void)
hwa742_set_update_mode(OMAPFB_UPDATE_DISABLED); hwa742_set_update_mode(OMAPFB_UPDATE_DISABLED);
/* Enable sleep mode */ /* Enable sleep mode */
hwa742_write_reg(HWA742_POWER_SAVE, 1 << 1); hwa742_write_reg(HWA742_POWER_SAVE, 1 << 1);
if (hwa742.power_down != NULL) clk_disable(hwa742.sys_ck);
hwa742.power_down(hwa742.fbdev->dev);
} }
static void hwa742_resume(void) static void hwa742_resume(void)
{ {
if (hwa742.power_up != NULL) clk_enable(hwa742.sys_ck);
hwa742.power_up(hwa742.fbdev->dev);
/* Disable sleep mode */ /* Disable sleep mode */
hwa742_write_reg(HWA742_POWER_SAVE, 0); hwa742_write_reg(HWA742_POWER_SAVE, 0);
while (1) { while (1) {
...@@ -955,14 +953,13 @@ static int hwa742_init(struct omapfb_device *fbdev, int ext_mode, ...@@ -955,14 +953,13 @@ static int hwa742_init(struct omapfb_device *fbdev, int ext_mode,
omapfb_conf = fbdev->dev->platform_data; omapfb_conf = fbdev->dev->platform_data;
ctrl_conf = omapfb_conf->ctrl_platform_data; ctrl_conf = omapfb_conf->ctrl_platform_data;
if (ctrl_conf == NULL || ctrl_conf->get_clock_rate == NULL) { if (ctrl_conf == NULL) {
dev_err(fbdev->dev, "HWA742: missing platform data\n"); dev_err(fbdev->dev, "HWA742: missing platform data\n");
r = -ENOENT; r = -ENOENT;
goto err1; goto err1;
} }
hwa742.power_down = ctrl_conf->power_down; hwa742.sys_ck = clk_get(NULL, "hwa_sys_ck");
hwa742.power_up = ctrl_conf->power_up;
spin_lock_init(&hwa742.req_lock); spin_lock_init(&hwa742.req_lock);
...@@ -972,12 +969,11 @@ static int hwa742_init(struct omapfb_device *fbdev, int ext_mode, ...@@ -972,12 +969,11 @@ static int hwa742_init(struct omapfb_device *fbdev, int ext_mode,
if ((r = hwa742.extif->init(fbdev)) < 0) if ((r = hwa742.extif->init(fbdev)) < 0)
goto err2; goto err2;
ext_clk = ctrl_conf->get_clock_rate(fbdev->dev); ext_clk = clk_get_rate(hwa742.sys_ck);
if ((r = calc_extif_timings(ext_clk, &extif_mem_div)) < 0) if ((r = calc_extif_timings(ext_clk, &extif_mem_div)) < 0)
goto err3; goto err3;
hwa742.extif->set_timings(&hwa742.reg_timings); hwa742.extif->set_timings(&hwa742.reg_timings);
if (hwa742.power_up != NULL) clk_enable(hwa742.sys_ck);
hwa742.power_up(fbdev->dev);
calc_hwa742_clk_rates(ext_clk, &sys_clk, &pix_clk); calc_hwa742_clk_rates(ext_clk, &sys_clk, &pix_clk);
if ((r = calc_extif_timings(sys_clk, &extif_mem_div)) < 0) if ((r = calc_extif_timings(sys_clk, &extif_mem_div)) < 0)
...@@ -1040,8 +1036,7 @@ static int hwa742_init(struct omapfb_device *fbdev, int ext_mode, ...@@ -1040,8 +1036,7 @@ static int hwa742_init(struct omapfb_device *fbdev, int ext_mode,
return 0; return 0;
err4: err4:
if (hwa742.power_down != NULL) clk_disable(hwa742.sys_ck);
hwa742.power_down(fbdev->dev);
err3: err3:
hwa742.extif->cleanup(); hwa742.extif->cleanup();
err2: err2:
...@@ -1055,8 +1050,7 @@ static void hwa742_cleanup(void) ...@@ -1055,8 +1050,7 @@ static void hwa742_cleanup(void)
hwa742_set_update_mode(OMAPFB_UPDATE_DISABLED); hwa742_set_update_mode(OMAPFB_UPDATE_DISABLED);
hwa742.extif->cleanup(); hwa742.extif->cleanup();
hwa742.int_ctrl->cleanup(); hwa742.int_ctrl->cleanup();
if (hwa742.power_down != NULL) clk_disable(hwa742.sys_ck);
hwa742.power_down(hwa742.fbdev->dev);
} }
struct lcd_ctrl hwa742_ctrl = { struct lcd_ctrl hwa742_ctrl = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册