diff options
-rw-r--r-- | arch/arm/mach-omap1/board-nokia770.c | 12 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/mach/hwa742.h | 4 | ||||
-rw-r--r-- | drivers/video/omap/hwa742.c | 26 |
3 files changed, 22 insertions, 20 deletions
diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c index 8780ca666398..e70fc7c66bbb 100644 --- a/arch/arm/mach-omap1/board-nokia770.c +++ b/arch/arm/mach-omap1/board-nokia770.c | |||
@@ -33,9 +33,11 @@ | |||
33 | #include <mach/common.h> | 33 | #include <mach/common.h> |
34 | #include <mach/dsp_common.h> | 34 | #include <mach/dsp_common.h> |
35 | #include <mach/omapfb.h> | 35 | #include <mach/omapfb.h> |
36 | #include <mach/hwa742.h> | ||
36 | #include <mach/lcd_mipid.h> | 37 | #include <mach/lcd_mipid.h> |
37 | #include <mach/mmc.h> | 38 | #include <mach/mmc.h> |
38 | #include <mach/usb.h> | 39 | #include <mach/usb.h> |
40 | #include <mach/clock.h> | ||
39 | 41 | ||
40 | #define ADS7846_PENDOWN_GPIO 15 | 42 | #define ADS7846_PENDOWN_GPIO 15 |
41 | 43 | ||
@@ -163,6 +165,15 @@ static struct spi_board_info nokia770_spi_board_info[] __initdata = { | |||
163 | }, | 165 | }, |
164 | }; | 166 | }; |
165 | 167 | ||
168 | static struct hwa742_platform_data nokia770_hwa742_platform_data = { | ||
169 | .te_connected = 1, | ||
170 | }; | ||
171 | |||
172 | static void hwa742_dev_init(void) | ||
173 | { | ||
174 | clk_add_alias("hwa_sys_ck", NULL, "bclk", NULL); | ||
175 | omapfb_set_ctrl_platform_data(&nokia770_hwa742_platform_data); | ||
176 | } | ||
166 | 177 | ||
167 | /* assume no Mini-AB port */ | 178 | /* assume no Mini-AB port */ |
168 | 179 | ||
@@ -371,6 +382,7 @@ static void __init omap_nokia770_init(void) | |||
371 | omap_serial_init(); | 382 | omap_serial_init(); |
372 | omap_register_i2c_bus(1, 100, NULL, 0); | 383 | omap_register_i2c_bus(1, 100, NULL, 0); |
373 | omap_dsp_init(); | 384 | omap_dsp_init(); |
385 | hwa742_dev_init(); | ||
374 | ads7846_dev_init(); | 386 | ads7846_dev_init(); |
375 | mipid_dev_init(); | 387 | mipid_dev_init(); |
376 | omap_usb_init(&nokia770_usb_config); | 388 | omap_usb_init(&nokia770_usb_config); |
diff --git a/arch/arm/plat-omap/include/mach/hwa742.h b/arch/arm/plat-omap/include/mach/hwa742.h index 577f492f2d3c..886248d32b49 100644 --- a/arch/arm/plat-omap/include/mach/hwa742.h +++ b/arch/arm/plat-omap/include/mach/hwa742.h | |||
@@ -2,10 +2,6 @@ | |||
2 | #define _HWA742_H | 2 | #define _HWA742_H |
3 | 3 | ||
4 | struct hwa742_platform_data { | 4 | struct hwa742_platform_data { |
5 | void (*power_up)(struct device *dev); | ||
6 | void (*power_down)(struct device *dev); | ||
7 | unsigned long (*get_clock_rate)(struct device *dev); | ||
8 | |||
9 | unsigned te_connected:1; | 5 | unsigned te_connected:1; |
10 | }; | 6 | }; |
11 | 7 | ||
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 | ||
140 | struct lcd_ctrl hwa742_ctrl; | 139 | struct 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 | ||
922 | static void hwa742_resume(void) | 920 | static 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; |
1042 | err4: | 1038 | err4: |
1043 | if (hwa742.power_down != NULL) | 1039 | clk_disable(hwa742.sys_ck); |
1044 | hwa742.power_down(fbdev->dev); | ||
1045 | err3: | 1040 | err3: |
1046 | hwa742.extif->cleanup(); | 1041 | hwa742.extif->cleanup(); |
1047 | err2: | 1042 | err2: |
@@ -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 | ||
1062 | struct lcd_ctrl hwa742_ctrl = { | 1056 | struct lcd_ctrl hwa742_ctrl = { |