aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap
diff options
context:
space:
mode:
authorAndrew de Quincey <adq_dvb@lidskialf.net>2009-05-28 17:03:31 -0400
committerTony Lindgren <tony@atomide.com>2009-05-28 17:03:31 -0400
commit088962c243db42b9c608f30be3e3a05a5b696895 (patch)
tree9d3c15affc704ca6aeb3a06123205a02226154d8 /drivers/video/omap
parentf5525786b0c481a0000989f2603257ba3aaef8ba (diff)
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: Andrew de Quincey <adq_dvb@lidskialf.net> Signed-off-by: Imre Deak <imre.deak@nokia.com> Signed-off-by: Tony Lindgren <tony@atomide.com
Diffstat (limited to 'drivers/video/omap')
-rw-r--r--drivers/video/omap/hwa742.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/video/omap/hwa742.c b/drivers/video/omap/hwa742.c
index 8aa6e47202b9..5d4f34887a22 100644
--- a/drivers/video/omap/hwa742.c
+++ b/drivers/video/omap/hwa742.c
@@ -133,8 +133,7 @@ struct {
133 struct lcd_ctrl_extif *extif; 133 struct lcd_ctrl_extif *extif;
134 struct lcd_ctrl *int_ctrl; 134 struct lcd_ctrl *int_ctrl;
135 135
136 void (*power_up)(struct device *dev); 136 struct clk *sys_ck;
137 void (*power_down)(struct device *dev);
138} hwa742; 137} hwa742;
139 138
140struct lcd_ctrl hwa742_ctrl; 139struct lcd_ctrl hwa742_ctrl;
@@ -915,14 +914,13 @@ static void hwa742_suspend(void)
915 hwa742_set_update_mode(OMAPFB_UPDATE_DISABLED); 914 hwa742_set_update_mode(OMAPFB_UPDATE_DISABLED);
916 /* Enable sleep mode */ 915 /* Enable sleep mode */
917 hwa742_write_reg(HWA742_POWER_SAVE, 1 << 1); 916 hwa742_write_reg(HWA742_POWER_SAVE, 1 << 1);
918 if (hwa742.power_down != NULL) 917 clk_disable(hwa742.sys_ck);
919 hwa742.power_down(hwa742.fbdev->dev);
920} 918}
921 919
922static void hwa742_resume(void) 920static void hwa742_resume(void)
923{ 921{
924 if (hwa742.power_up != NULL) 922 clk_enable(hwa742.sys_ck);
925 hwa742.power_up(hwa742.fbdev->dev); 923
926 /* Disable sleep mode */ 924 /* Disable sleep mode */
927 hwa742_write_reg(HWA742_POWER_SAVE, 0); 925 hwa742_write_reg(HWA742_POWER_SAVE, 0);
928 while (1) { 926 while (1) {
@@ -955,14 +953,13 @@ static int hwa742_init(struct omapfb_device *fbdev, int ext_mode,
955 omapfb_conf = fbdev->dev->platform_data; 953 omapfb_conf = fbdev->dev->platform_data;
956 ctrl_conf = omapfb_conf->ctrl_platform_data; 954 ctrl_conf = omapfb_conf->ctrl_platform_data;
957 955
958 if (ctrl_conf == NULL || ctrl_conf->get_clock_rate == NULL) { 956 if (ctrl_conf == NULL) {
959 dev_err(fbdev->dev, "HWA742: missing platform data\n"); 957 dev_err(fbdev->dev, "HWA742: missing platform data\n");
960 r = -ENOENT; 958 r = -ENOENT;
961 goto err1; 959 goto err1;
962 } 960 }
963 961
964 hwa742.power_down = ctrl_conf->power_down; 962 hwa742.sys_ck = clk_get(NULL, "hwa_sys_ck");
965 hwa742.power_up = ctrl_conf->power_up;
966 963
967 spin_lock_init(&hwa742.req_lock); 964 spin_lock_init(&hwa742.req_lock);
968 965
@@ -972,12 +969,11 @@ static int hwa742_init(struct omapfb_device *fbdev, int ext_mode,
972 if ((r = hwa742.extif->init(fbdev)) < 0) 969 if ((r = hwa742.extif->init(fbdev)) < 0)
973 goto err2; 970 goto err2;
974 971
975 ext_clk = ctrl_conf->get_clock_rate(fbdev->dev); 972 ext_clk = clk_get_rate(hwa742.sys_ck);
976 if ((r = calc_extif_timings(ext_clk, &extif_mem_div)) < 0) 973 if ((r = calc_extif_timings(ext_clk, &extif_mem_div)) < 0)
977 goto err3; 974 goto err3;
978 hwa742.extif->set_timings(&hwa742.reg_timings); 975 hwa742.extif->set_timings(&hwa742.reg_timings);
979 if (hwa742.power_up != NULL) 976 clk_enable(hwa742.sys_ck);
980 hwa742.power_up(fbdev->dev);
981 977
982 calc_hwa742_clk_rates(ext_clk, &sys_clk, &pix_clk); 978 calc_hwa742_clk_rates(ext_clk, &sys_clk, &pix_clk);
983 if ((r = calc_extif_timings(sys_clk, &extif_mem_div)) < 0) 979 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 1036
1041 return 0; 1037 return 0;
1042err4: 1038err4:
1043 if (hwa742.power_down != NULL) 1039 clk_disable(hwa742.sys_ck);
1044 hwa742.power_down(fbdev->dev);
1045err3: 1040err3:
1046 hwa742.extif->cleanup(); 1041 hwa742.extif->cleanup();
1047err2: 1042err2:
@@ -1055,8 +1050,7 @@ static void hwa742_cleanup(void)
1055 hwa742_set_update_mode(OMAPFB_UPDATE_DISABLED); 1050 hwa742_set_update_mode(OMAPFB_UPDATE_DISABLED);
1056 hwa742.extif->cleanup(); 1051 hwa742.extif->cleanup();
1057 hwa742.int_ctrl->cleanup(); 1052 hwa742.int_ctrl->cleanup();
1058 if (hwa742.power_down != NULL) 1053 clk_disable(hwa742.sys_ck);
1059 hwa742.power_down(hwa742.fbdev->dev);
1060} 1054}
1061 1055
1062struct lcd_ctrl hwa742_ctrl = { 1056struct lcd_ctrl hwa742_ctrl = {