aboutsummaryrefslogtreecommitdiff
path: root/board/lge/sniper/hub_dpi.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/lge/sniper/hub_dpi.c')
-rwxr-xr-xboard/lge/sniper/hub_dpi.c242
1 files changed, 0 insertions, 242 deletions
diff --git a/board/lge/sniper/hub_dpi.c b/board/lge/sniper/hub_dpi.c
index ad7c75db648..568a8736fa2 100755
--- a/board/lge/sniper/hub_dpi.c
+++ b/board/lge/sniper/hub_dpi.c
@@ -20,144 +20,6 @@
#include <asm/arch/sys_proto.h>
#include "hub_dss.h"
-
-#define LCD_XRES 480
-#define LCD_YRES 800
-
-/* [skykrkrk@lge.com] 2010-01-14, optimized clock speed : 26.585MHz. if 24700 is selected, pixel-clock will be 24.686MHz */
-#define LCD_PIXCLOCK_OPT 26583
-#define LCD_PIXCLOCK_MIN 24700 /* NEC MIN PIX Clock is 21.8MHz */
-#define LCD_PIXCLOCK_TYP 26000 /* Typical PIX clock is 23.8MHz */
-#define LCD_PIXCLOCK_MAX 27300 /* Maximum is 25.7MHz */
-
-/* Current Pixel clock */
-#define LCD_PIXEL_CLOCK LCD_PIXCLOCK_OPT
-
-//PAULK: not used
-static struct omap_video_timings hub_panel_timings = {
- /* LGE_CHANGE_S [HEAVEN:FW:tosungmin@lge.com] 2009-09-07, lcd drivers */
- .x_res = LCD_XRES,
- .y_res = LCD_YRES,
- .pixel_clock = LCD_PIXEL_CLOCK,
- .hfp = 1, //right_margin - 1
- .hsw = 1, //hsync_len - 1
- .hbp = 1, //left_margin - 1
- .vfp = 0, //lower_margin
- .vsw = 1, //vsync_len - 1
- .vbp = 0, //upper_margin
-
-};
-
-static u32 hub_config = (OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |OMAP_DSS_LCD_IHS);
-static u8 data_lines = 24;
-static int hub_acbi = 0; /* ac-bias pin transitions per interrupt */
-/* Unit: line clocks */
-static int hub_acb = 0; /* ac-bias pin frequency */
-static int dss_state = OMAP_DSS_DISPLAY_DISABLED;
-
-static int dpi_set_dsi_clk(bool is_tft, unsigned long pck_req,
- unsigned long *fck, int *lck_div, int *pck_div)
-{
- struct dsi_clock_info cinfo;
- int r;
-
- r = dsi_pll_calc_pck(is_tft, pck_req, &cinfo);
- if (r)
- return r;
-
- r = dsi_pll_program(&cinfo);
- if (r)
- return r;
-
- dss_select_clk_source(0, 1);
-
- dispc_set_lcd_divisor(cinfo.lck_div, cinfo.pck_div);
-
- *fck = cinfo.dsi1_pll_fclk;
- *lck_div = cinfo.lck_div;
- *pck_div = cinfo.pck_div;
-
- return 0;
-}
-
-static int dpi_set_dispc_clk(bool is_tft, unsigned long pck_req,
- unsigned long *fck, int *lck_div, int *pck_div)
-{
- struct dispc_clock_info cinfo;
- int r;
-
- r = dispc_calc_clock_div(is_tft, pck_req, &cinfo);
- if (r)
- return r;
-
- r = dispc_set_clock_div(&cinfo);
- if (r)
- return r;
-
- *fck = cinfo.fck;
- *lck_div = cinfo.lck_div;
- *pck_div = cinfo.pck_div;
-
- return 0;
-}
-
-//PAULK: Not called
-static int dpi_set_mode(void)
-{
- int lck_div, pck_div;
- unsigned long fck;
- unsigned long pck;
- bool is_tft;
- int r = 0;
-
- //dss_clk_enable(1);
-
- dispc_set_pol_freq(hub_config, hub_acbi, hub_acb);
-
- is_tft = (hub_config & OMAP_DSS_LCD_TFT) != 0;
-
- r = dpi_set_dsi_clk(is_tft, hub_panel_timings.pixel_clock * 1000,
- &fck, &lck_div, &pck_div);
- //r = dpi_set_dispc_clk(is_tft, hub_panel_timings.pixel_clock * 1000,
- // &fck, &lck_div, &pck_div);
- if (r)
- goto err0;
-
- pck = fck / lck_div / pck_div / 1000;
-
- if (pck != hub_panel_timings.pixel_clock) {
-#if 0
- DSSWARN("Could not find exact pixel clock. "
- "Requested %d kHz, got %lu kHz\n",
- t->pixel_clock, pck);
-#endif
- hub_panel_timings.pixel_clock = pck;
- }
-
- dispc_set_lcd_timings(&hub_panel_timings);
- return 0;
-
-err0:
- //dss_clk_enable(0);
- printf("dpi_set_mode_err0\n");
- return r;
-}
-
-// PAULK: NOT ACTUALLY CALLED
-static int dpi_basic_init(void)
-{
- bool is_tft;
-
- is_tft = (hub_config & OMAP_DSS_LCD_TFT) != 0;
-
- dispc_set_parallel_interface_mode(OMAP_DSS_PARALLELMODE_BYPASS);
- dispc_set_lcd_display_type(is_tft ? OMAP_DSS_LCD_DISPLAY_TFT :
- OMAP_DSS_LCD_DISPLAY_STN);
- dispc_set_tft_data_lines(data_lines);
-
- return 0;
-}
-
int dss_clk_enable(bool enable)
{
//#define FCK_DSS_ON 0x00000005 /* tv+dss1 (not dss2) */
@@ -179,107 +41,3 @@ int dss_clk_enable(bool enable)
return 0;
}
-
-// PAULK: NOT ACTUALLY CALLED
-static int dpi_display_enable(void)
-{
- static int r;
-
- //dss_clk_enable(1);
-
- r = dpi_basic_init();
- if (r)
- goto err0;
-
- //dss_clk_enable(1);
-
- r = dsi_pll_init(1, 1);
-
- //r = dpi_set_mode();
- //if (r)
- // goto err0;
-
- mdelay(2);
-
- //dispc_enable_lcd_out(1);
-
- //dss_state = OMAP_DSS_DISPLAY_ACTIVE;
-
- return 0;
-
-err0:
- //dispc_enable_lcd_out(0);
- //dss_clk_enable(0);
- printf("kyungtae_dpi_display_enable_err0");
- return r;
-}
-
-//PAULK: never called
-static void dpi_set_timings(struct omap_video_timings *timings)
-{
- if (dss_state == OMAP_DSS_DISPLAY_ACTIVE) {
- dpi_set_mode();
- dispc_go(OMAP_DSS_CHANNEL_LCD);
- }
-}
-
-static int dpi_check_timings(struct omap_video_timings *timings)
-{
- bool is_tft;
- int r;
- int lck_div, pck_div;
- unsigned long fck;
- unsigned long pck;
-
- if (!dispc_lcd_timings_ok(timings))
- return -EINVAL;
-
- if (timings->pixel_clock == 0)
- return -EINVAL;
-
- is_tft = (hub_config & OMAP_DSS_LCD_TFT) != 0;
- {
- struct dsi_clock_info cinfo;
- r = dsi_pll_calc_pck(is_tft, timings->pixel_clock * 1000,
- &cinfo);
-
- if (r)
- return r;
-
- fck = cinfo.dsi1_pll_fclk;
- lck_div = cinfo.lck_div;
- pck_div = cinfo.pck_div;
- }
-#if 0
- {
- struct dispc_clock_info cinfo;
- r = dispc_calc_clock_div(is_tft, timings->pixel_clock * 1000,
- &cinfo);
-
- if (r)
- return r;
-
- fck = cinfo.fck;
- lck_div = cinfo.lck_div;
- pck_div = cinfo.pck_div;
- }
-#endif
- pck = fck / lck_div / pck_div / 1000;
-
- timings->pixel_clock = pck;
-
- return 0;
-}
-
-static void dpi_get_timings(struct omap_video_timings *timings)
-{
- *timings = hub_panel_timings;
-}
-
-//PAULK: not actually called
-int dpi_init(void)
-{
- dpi_display_enable();
- return 0;
-}
-