AMLOGIC G12A X2 U211 buildroot dts
M: wenbiao zhang <wenbiao.zhang@amlogic.com>
F: arch/arm64/boot/dts/amlogic/g12a_s905y2_u221_buildroot.dts
+
+AMLOGIC LCD ADD TVCONFIG SUPPORT
+M: Evoke Zhang <evoke.zhang@amlogic.com>
+F: drivers/amlogic/media/vout/lcd/lcd_tv/lcd_tv.dts
+F: drivers/amlogic/media/vout/lcd/lcd_tablet/aml_lcd.dts
case BL_PWM_F:
pwm_period = 1000000000 / bl_pwm->pwm_freq;
pwm_duty = (pwm_period * bl_pwm->pwm_duty) / 100;
+ if (bl_debug_print_flag) {
+ pr_info("pwm=0x%p, port_index=%d, meson_index=%d\n",
+ bl_pwm->pwm_data.pwm, bl_pwm->pwm_data.port_index,
+ bl_pwm->pwm_data.meson_index);
+ }
if ((!IS_ERR_OR_NULL(bl_pwm->pwm_data.pwm)) &&
((bl_pwm->pwm_data.port_index % 2) ==
bl_pwm->pwm_data.meson_index) &&
- (bl_pwm->pwm_data.port_index ==
- bl_pwm->pwm_port)) {
+ (bl_pwm->pwm_data.port_index == bl_pwm->pwm_port)) {
bl_pwm->pwm_data.state.polarity = pol;
bl_pwm->pwm_data.state.duty_cycle = pwm_duty;
bl_pwm->pwm_data.state.period = pwm_period;
return 0;
}
-static int pwm_channel_conf(struct bl_config_s *bconf,
+static int aml_bl_pwm_channel_register(struct bl_config_s *bconf,
struct platform_device *pdev)
{
int ret = 0;
if (ret) {
BLERR("invalid %d meson_pwm_index\n", index1);
return ret;
- }
+ }
if (index0 >= BL_PWM_VS)
continue;
+ bl_pwm = NULL;
switch (bconf->method) {
case BL_CTRL_PWM:
if ((index0 == bconf->bl_pwm->pwm_port) &&
break;
default:
break;
- }
+ }
if (bl_pwm == NULL)
continue;
+
bl_pwm->pwm_data.port_index = index0;
bl_pwm->pwm_data.meson_index = index1;
bl_pwm->pwm_data.pwm = devm_of_pwm_get(
bl_pwm->pwm_data.meson = to_meson_pwm(
bl_pwm->pwm_data.pwm->chip);
pwm_init_state(bl_pwm->pwm_data.pwm, &(bl_pwm->pwm_data.state));
+ BLPR("register pwm_ch(%d) 0x%p\n",
+ bl_pwm->pwm_data.port_index, bl_pwm->pwm_data.pwm);
}
- BLPR(" bl pwm config ok\n");
+ BLPR("%s ok\n", __func__);
return ret;
switch (bconf->method) {
case BL_CTRL_PWM:
case BL_CTRL_PWM_COMBO:
- ret = pwm_channel_conf(bconf, pdev);
+ ret = aml_bl_pwm_channel_register(bconf, pdev);
bl_pwm_pinmux_set(bconf);
break;
#ifdef CONFIG_AMLOGIC_BL_EXTERN
/* 20170905: fix coverity errors */
/* 20180122: support txlx, optimize lcd noitfier event */
/* 20180226: g12a support */
-#define LCD_DRV_VERSION "20180321"
+/* 20180425: tvconfig suuport */
+#define LCD_DRV_VERSION "20180425"
#define VPP_OUT_SATURATE (1 << 0)
extern void lcd_tv_vout_server_init(void);
extern void lcd_tv_vout_server_remove(void);
extern void lcd_vbyone_interrupt_enable(int flag);
+extern void lcd_tv_clk_config_change(struct lcd_config_s *pconf);
extern void lcd_tv_clk_update(struct lcd_config_s *pconf);
extern int lcd_tv_probe(struct device *dev);
extern int lcd_tv_remove(struct device *dev);
#ifdef CONFIG_AMLOGIC_LCD_TABLET
extern void lcd_tablet_vout_server_init(void);
extern void lcd_tablet_vout_server_remove(void);
+extern void lcd_tablet_clk_config_change(struct lcd_config_s *pconf);
extern void lcd_tablet_clk_update(struct lcd_config_s *pconf);
extern int lcd_tablet_probe(struct device *dev);
extern int lcd_tablet_remove(struct device *dev);
pconf->lcd_timing.sync_duration_den = 100;
switch (lcd_drv->lcd_mode) {
-#ifdef CONFIG_AML_LCD_TV
+#ifdef CONFIG_AMLOGIC_LCD_TV
case LCD_MODE_TV:
lcd_tv_clk_config_change(pconf);
break;
#endif
-#ifdef CONFIG_AML_LCD_TABLET
+#ifdef CONFIG_AMLOGIC_LCD_TABLET
case LCD_MODE_TABLET:
lcd_tablet_clk_config_change(pconf);
break;
+++ /dev/null
-/*
- * drivers/amlogic/media/vout/lcd/lcd_tablet/aml_lcd.dts
- *
- * Copyright (C) 2017 Amlogic, Inc. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- */
-
-lcd{
- compatible = "amlogic, lcd";
- dev_name = "lcd";
- mode = "tablet";
- status = "okay";
- resets = <&clock GCLK_IDX_VCLK2_ENCL &clock GCLK_IDX_VCLK2_VENCL>;
- reset-names = "encl","vencl";
- pinctrl-names = "ttl_6bit_hvsync_de_on","ttl_6bit_hvsync_on",
- "ttl_6bit_de_on","ttl_8bit_hvsync_de_on",
- "ttl_8bit_hvsync_on","ttl_8bit_de_on",
- "ttl_6bit_hvsync_de_off","ttl_8bit_hvsync_de_off";
- pinctrl-0 = <&lcd_ttl_rgb_6bit_pins_on &lcd_ttl_de_hvsync_on_pins>;
- pinctrl-1 = <&lcd_ttl_rgb_6bit_pins_on &lcd_ttl_hvsync_on_pins>;
- pinctrl-2 = <&lcd_ttl_rgb_6bit_pins_on &lcd_ttl_de_on_pins>;
- pinctrl-3 = <&lcd_ttl_rgb_8bit_pins_on &lcd_ttl_de_hvsync_on_pins>;
- pinctrl-4 = <&lcd_ttl_rgb_8bit_pins_on &lcd_ttl_hvsync_on_pins>;
- pinctrl-5 = <&lcd_ttl_rgb_8bit_pins_on &lcd_ttl_de_on_pins>;
- pinctrl-6 = <&lcd_ttl_rgb_6bit_pins_off &lcd_ttl_de_hvsync_off_pins>;
- pinctrl-7 = <&lcd_ttl_rgb_8bit_pins_off &lcd_ttl_de_hvsync_off_pins>;
-
- /* power type:(0=cpu_gpio, 1=pmu_gpio,
- * 2=signal, 3=extern, 0xff=ending)
- */
- /* power index:(point gpios_index, or extern_index, 0xff=invalid) */
- /* power value:(0=output low, 1=output high, 2=input) */
- /* power delay:(unit in ms) */
- lcd_cpu-gpios = <&gpio GPIOX_3 GPIO_ACTIVE_HIGH>;
- lcd_cpu_gpio_names = "GPIOX_3";
-
- lcd_0{
- model_name = "LCD720P";
- interface = "ttl"; /* lcd_interface(ttl, lvds, mipi, edp) */
- basic_setting = <1280 720 1650 750 8 16 9>;
- /* h_active, v_active, h_period, v_period, lcd_bits,
- * screen_widht, screen_height
- */
- lcd_timing = <40 220 1 5 20 1>;
- /* hs_width, hs_bp, hs_pol, vs_width, vs_bp, vs_pol */
- clk_attr = <0 0 1 74250000>;
- /* fr_adj_type(0=clock, 1=htotal, 2=vtotal),
- * clk_ss_level, clk_auto_generate,
- * pixel_clk(unit in Hz)
- */
- ttl_attr = <0 1 1 0 0>;
- /* clk_pol, de_valid, hvsync_valid,
- * rb_swap, bit_swap
- */
- power_on_step = <0 0 1 50
- 2 0 0 0
- 0xff 0 0 0>; /* type, index, value, delay */
- power_off_step = <2 0 0 50
- 0 0 0 100
- 0xff 0 0 0>; /* type, index, value, delay */
- backlight_index = <0>;
- };
-
- lcd_1{
- model_name = "HJ080IA";
- interface = "lvds"; /* lcd_interface(ttl, lvds, mipi, edp) */
- basic_setting = <1024 768 1344 806 8 162 122>;
- /* h_active, v_active, h_period, v_period, lcd_bits,
- * screen_widht, screen_height
- */
- lcd_timing = <10 60 0 2 18 0>;
- /* hs_width, hs_bp, hs_pol, vs_width, vs_bp, vs_pol */
- clk_attr = <0 0 1 65000000>;
- /* fr_adj_type(0=clock, 1=htotal, 2=vtotal),
- * clk_ss_level, clk_auto_generate,
- * pixel_clk(unit in Hz)
- */
- lvds_attr = <1 0 0 0>;
- /* lvds_repack, dual_port, pn_swap, port_swap */
- power_on_step = <0 0 1 50
- 2 0 0 0
- 0xff 0 0 0>; /* type, index, value, delay */
- power_off_step = <2 0 0 50
- 0 0 0 100
- 0xff 0 0 0>; /* type, index, value, delay */
- backlight_index = <0>;
- };
-
- /* operation_mode:(bit[0] for init, bit[1] for display.
- *0=video mode, 1=command mode)
- */
- /* lp_clk_continuous:(0=disable, 1=enable) */
- /* transfer_switch:(0=auto, 1=standard, 2=slow) */
- /* clk_factor:(special adjust between pixel_clk
- * & lanebyte_clk, default 0)
- */
- /* mipi-dsi command:(data_type, num, data....).
- * data_type=0xff, num=0xff means ending
- * num<0xff means delay num(unit: ms)
- */
- lcd_2{
- model_name = "B080XAN01";
- interface = "mipi"; /* lcd_interface(ttl, lvds, mipi, edp) */
- basic_setting = <768 1024 948 1140 8 119 159>;
- /* h_active, v_active, h_period, v_period, lcd_bits,
- * screen_widht, screen_height
- */
- lcd_timing = <64 56 0 50 30 0>;
- /* hs_width, hs_bp, hs_pol, vs_width, vs_bp, vs_pol */
- clk_attr = <0 0 1 64843200>;
- /* fr_adj_type(0=clock, 1=htotal, 2=vtotal),
- * clk_ss_level, clk_auto_generate,
- * pixel_clk(unit in Hz)
- */
- mipi_attr = <4 0x1 1 0 1 1 550>;
- /* lane_count, operation_mode, lp_clk_continuous,
- * transfer_switch, factor_denominator,
- * factor_numerator, dsi_bit_rate_max (MHz)
- */
- dsi_cmd_init_on = <0x05 1 0x11 /* sleep out */
- 0xff 20 /* delay 20ms */
- 0x05 1 0x29 /* display on */
- 0xff 20 /* delay 20ms */
- 0xff 0xff>; /* ending flag */
- dsi_cmd_init_off = <0x05 1 0x28 /* display off */
- 0xff 10 /* delay 10ms */
- 0x05 1 0x10 /* sleep in */
- 0xff 10 /* delay 10ms */
- 0xff 0xff>; /* ending flag */
- power_on_step = <0 0 1 50
- 2 0 0 0
- 0xff 0 0 0>; /* type, index, value, delay */
- power_off_step = <2 0 0 50
- 0 0 0 100
- 0xff 0 0 0>; /* type, index, value, delay */
- backlight_index = <0>;
- };
-
- /* link_rate:(0=1.62G, 1=2.7G, 0xff=auto setting) */
- /* lane_count:(support 1,2,4, 0xff=auto setting) */
- /* link_vswing:(support level 0,1,2,3, 0xff=adaptive) */
- /* sync_clk_mode:(0=asyncronous clock,
- * 1=synchronous clock. default 1)
- */
- /* edid_timing_used:(0=no use, 1=use) */
- lcd_3{
- model_name = "LP097QX1";
- interface = "edp"; /* lcd_interface(ttl, lvds, mipi, edp) */
- basic_setting = <2048 1536 2219 1560 8 197 147>;
- /* h_active, v_active, h_period, v_period, lcd_bits,
- * screen_widht, screen_height
- */
- lcd_timing = <5 115 0 1 21 0>;
- /* hs_width, hs_bp, hs_pol, vs_width, vs_bp, vs_pol */
- clk_attr = <0 0 1 207700000>;
- /* fr_adj_type(0=clock, 1=htotal, 2=vtotal),
- * clk_ss_level, clk_auto_generate,
- * pixel_clk(unit in Hz)
- */
- edp_attr = <4 1 2 0 1 0>;
- /* max_lane_count, link_rate, lane_count, link_vswing,
- * sync_clk_mode, edid_timing_used
- */
- power_on_step = <0 0 1 50
- 2 0 0 0
- 0xff 0 0 0>; /* type, index, value, delay */
- power_off_step = <2 0 0 50
- 0 0 0 100
- 0xff 0 0 0>; /* type, index, value, delay */
- backlight_index = <0>;
- };
-};
__func__, vswing);
vswing = LVDS_PHY_VSWING_DFT;
}
+ channel_on = lcd_lvds_channel_on_value(pconf);
+
if (preem > 7) {
- LCDERR("%s: wrong preem_level=0x%x, use default\n",
+ LCDERR("%s: wrong preem=%d, use default\n",
__func__, preem);
preem = LVDS_PHY_PREEM_DFT;
}
- if (clk_vswing > 7) {
- LCDERR("%s: wrong clk_vswing_level=0x%x, use default\n",
+ if (clk_vswing > 3) {
+ LCDERR("%s: wrong clk_vswing=%d, use default\n",
__func__, clk_vswing);
clk_vswing = LVDS_PHY_CLK_VSWING_DFT;
}
if (clk_preem > 7) {
- LCDERR("%s: wrong clk_preem_level=0x%x, use default\n",
+ LCDERR("%s: wrong clk_preem=%d, use default\n",
__func__, clk_preem);
clk_preem = LVDS_PHY_CLK_PREEM_DFT;
}
- channel_on = lcd_lvds_channel_on_value(pconf);
- data32 = 0x606cca80 | (vswing << 26) | (preem << 0);
+ data32 = LVDS_PHY_CNTL1_G9TV |
+ (vswing << 26) | (preem << 0);
lcd_hiu_write(HHI_DIF_CSI_PHY_CNTL1, data32);
- /*lcd_hiu_write(HHI_DIF_CSI_PHY_CNTL1, 0x6c6cca80);*/
- lcd_hiu_write(HHI_DIF_CSI_PHY_CNTL2, 0x0000006c);
- data32 = (channel_on << 16) | 0x0800 | /* DIF_TX_CTL5 */
- (clk_vswing << 8) | (clk_preem << 5); /* DIF_TX_CTL4 */
+ data32 = LVDS_PHY_CNTL2_G9TV;
+ lcd_hiu_write(HHI_DIF_CSI_PHY_CNTL2, data32);
+ data32 = LVDS_PHY_CNTL3_G9TV |
+ (channel_on << 16) |
+ (clk_vswing << 8) | (clk_preem << 5);
lcd_hiu_write(HHI_DIF_CSI_PHY_CNTL3, data32);
- /*lcd_hiu_write(HHI_DIF_CSI_PHY_CNTL3, 0x0fff0800);*/
} else {
lcd_hiu_write(HHI_DIF_CSI_PHY_CNTL1, 0x0);
lcd_hiu_write(HHI_DIF_CSI_PHY_CNTL2, 0x0);
}
}
-static void lcd_tcon_set(struct lcd_config_s *pconf)
+static void lcd_encl_tcon_set(struct lcd_config_s *pconf)
{
struct lcd_timing_s *tcon_adr = &pconf->lcd_timing;
lcd_vcbus_read(VPP_MISC) & ~(VPP_OUT_SATURATE));
}
+static void lcd_venc_set(struct lcd_config_s *pconf)
+{
+ unsigned int h_active, v_active;
+ unsigned int video_on_pixel, video_on_line;
+
+ if (lcd_debug_print_flag)
+ LCDPR("%s\n", __func__);
+ h_active = pconf->lcd_basic.h_active;
+ v_active = pconf->lcd_basic.v_active;
+ video_on_pixel = pconf->lcd_timing.video_on_pixel;
+ video_on_line = pconf->lcd_timing.video_on_line;
+
+ lcd_vcbus_write(ENCL_VIDEO_EN, 0);
+
+ lcd_vcbus_write(ENCL_VIDEO_MODE, 0x8000);/*bit[15] shadown en*/
+ lcd_vcbus_write(ENCL_VIDEO_MODE_ADV, 0x0418); /* Sampling rate: 1 */
+
+ lcd_vcbus_write(ENCL_VIDEO_FILT_CTRL, 0x1000); /* bypass filter */
+ lcd_vcbus_write(ENCL_VIDEO_MAX_PXCNT, pconf->lcd_basic.h_period - 1);
+ lcd_vcbus_write(ENCL_VIDEO_MAX_LNCNT, pconf->lcd_basic.v_period - 1);
+ lcd_vcbus_write(ENCL_VIDEO_HAVON_BEGIN, video_on_pixel);
+ lcd_vcbus_write(ENCL_VIDEO_HAVON_END, h_active - 1 + video_on_pixel);
+ lcd_vcbus_write(ENCL_VIDEO_VAVON_BLINE, video_on_line);
+ lcd_vcbus_write(ENCL_VIDEO_VAVON_ELINE, v_active - 1 + video_on_line);
+
+ lcd_vcbus_write(ENCL_VIDEO_HSO_BEGIN, pconf->lcd_timing.hs_hs_addr);
+ lcd_vcbus_write(ENCL_VIDEO_HSO_END, pconf->lcd_timing.hs_he_addr);
+ lcd_vcbus_write(ENCL_VIDEO_VSO_BEGIN, pconf->lcd_timing.vs_hs_addr);
+ lcd_vcbus_write(ENCL_VIDEO_VSO_END, pconf->lcd_timing.vs_he_addr);
+ lcd_vcbus_write(ENCL_VIDEO_VSO_BLINE, pconf->lcd_timing.vs_vs_addr);
+ lcd_vcbus_write(ENCL_VIDEO_VSO_ELINE, pconf->lcd_timing.vs_ve_addr);
+ lcd_vcbus_write(ENCL_VIDEO_RGBIN_CTRL, 3);
+
+ lcd_vcbus_write(ENCL_VIDEO_EN, 1);
+
+ aml_lcd_notifier_call_chain(LCD_EVENT_BACKLIGHT_UPDATE, NULL);
+}
+
static void lcd_ttl_control_set(struct lcd_config_s *pconf)
{
unsigned int clk_pol, rb_swap, bit_swap;
lcd_vcbus_setb(LVDS_GEN_CNTL, 0, 3, 1); /* disable lvds fifo */
}
-static void lcd_venc_set(struct lcd_config_s *pconf)
-{
- unsigned int h_active, v_active;
- unsigned int video_on_pixel, video_on_line;
-
- if (lcd_debug_print_flag)
- LCDPR("%s\n", __func__);
- h_active = pconf->lcd_basic.h_active;
- v_active = pconf->lcd_basic.v_active;
- video_on_pixel = pconf->lcd_timing.video_on_pixel;
- video_on_line = pconf->lcd_timing.video_on_line;
-
- lcd_vcbus_write(ENCL_VIDEO_EN, 0);
-
- lcd_vcbus_write(ENCL_VIDEO_MODE, 0x8000);/*bit[15] shadown en*/
- lcd_vcbus_write(ENCL_VIDEO_MODE_ADV, 0x0418); /* Sampling rate: 1 */
-
- lcd_vcbus_write(ENCL_VIDEO_FILT_CTRL, 0x1000); /* bypass filter */
- lcd_vcbus_write(ENCL_VIDEO_MAX_PXCNT, pconf->lcd_basic.h_period - 1);
- lcd_vcbus_write(ENCL_VIDEO_MAX_LNCNT, pconf->lcd_basic.v_period - 1);
- lcd_vcbus_write(ENCL_VIDEO_HAVON_BEGIN, video_on_pixel);
- lcd_vcbus_write(ENCL_VIDEO_HAVON_END, h_active - 1 + video_on_pixel);
- lcd_vcbus_write(ENCL_VIDEO_VAVON_BLINE, video_on_line);
- lcd_vcbus_write(ENCL_VIDEO_VAVON_ELINE, v_active - 1 + video_on_line);
-
- lcd_vcbus_write(ENCL_VIDEO_HSO_BEGIN, pconf->lcd_timing.hs_hs_addr);
- lcd_vcbus_write(ENCL_VIDEO_HSO_END, pconf->lcd_timing.hs_he_addr);
- lcd_vcbus_write(ENCL_VIDEO_VSO_BEGIN, pconf->lcd_timing.vs_hs_addr);
- lcd_vcbus_write(ENCL_VIDEO_VSO_END, pconf->lcd_timing.vs_he_addr);
- lcd_vcbus_write(ENCL_VIDEO_VSO_BLINE, pconf->lcd_timing.vs_vs_addr);
- lcd_vcbus_write(ENCL_VIDEO_VSO_ELINE, pconf->lcd_timing.vs_ve_addr);
- lcd_vcbus_write(ENCL_VIDEO_RGBIN_CTRL, 3);
-
- lcd_vcbus_write(ENCL_VIDEO_EN, 1);
-
- aml_lcd_notifier_call_chain(LCD_EVENT_BACKLIGHT_UPDATE, NULL);
-}
-
static void lcd_vbyone_sync_pol(int hsync_pol, int vsync_pol)
{
lcd_vcbus_setb(VBO_VIN_CTRL, hsync_pol, 4, 1);
}
}
-void lcd_tablet_clk_update(struct lcd_config_s *pconf)
+void lcd_tablet_clk_config_change(struct lcd_config_s *pconf)
{
#ifdef CONFIG_AMLOGIC_VPU
request_vpu_clk_vmod(pconf->lcd_timing.lcd_clk, VPU_VENCL);
}
lcd_clk_generate_parameter(pconf);
+}
+
+void lcd_tablet_clk_update(struct lcd_config_s *pconf)
+{
+ lcd_tablet_clk_config_change(pconf);
+
lcd_clk_set(pconf);
if (pconf->lcd_basic.lcd_type == LCD_VBYONE)
lcd_tablet_vbyone_wait_stable();
/* update clk & timing config */
lcd_vmode_change(pconf);
info->video_clk = pconf->lcd_timing.lcd_clk;
+ info->htotal = pconf->lcd_basic.h_period;
+ info->vtotal = pconf->lcd_basic.v_period;
/* update interface timing */
switch (pconf->lcd_basic.lcd_type) {
case LCD_VBYONE:
void lcd_tablet_config_post_update(struct lcd_config_s *pconf)
{
- struct aml_lcd_drv_s *lcd_drv = aml_lcd_get_driver();
-
/* update interface timing */
- switch (lcd_drv->lcd_config->lcd_basic.lcd_type) {
+ switch (pconf->lcd_basic.lcd_type) {
case LCD_MIPI:
- lcd_mipi_dsi_config_post(lcd_drv->lcd_config);
+ lcd_mipi_dsi_config_post(pconf);
break;
default:
break;
lcd_clk_set(pconf);
lcd_venc_set(pconf);
- lcd_tcon_set(pconf);
+ lcd_encl_tcon_set(pconf);
lcd_vcbus_write(VENC_INTCTRL, 0x200);
}
ret = of_property_read_u32_array(child, "range_setting", ¶[0], 6);
if (ret) {
+ LCDPR("no range_setting\n");
pconf->lcd_basic.h_period_min = pconf->lcd_basic.h_period;
pconf->lcd_basic.h_period_max = pconf->lcd_basic.h_period;
pconf->lcd_basic.v_period_min = pconf->lcd_basic.v_period;
clk_vswing = pconf->lcd_control.lvds_config->phy_clk_vswing;
clk_preem = pconf->lcd_control.lvds_config->phy_clk_preem;
if (vswing > 7) {
- LCDERR("%s: wrong vswing_level=%d, use default\n",
+ LCDERR("%s: wrong vswing=%d, use default\n",
__func__, vswing);
vswing = LVDS_PHY_VSWING_DFT;
}
+ channel_on = lcd_lvds_channel_on_value(pconf);
+
if (preem > 7) {
- LCDERR("%s: wrong preem_level=%d, use default\n",
+ LCDERR("%s: wrong preem=%d, use default\n",
__func__, preem);
preem = LVDS_PHY_PREEM_DFT;
}
if (clk_vswing > 3) {
- LCDERR("%s: wrong clk_vswing_level=%d, use default\n",
+ LCDERR("%s: wrong clk_vswing=%d, use default\n",
__func__, clk_vswing);
clk_vswing = LVDS_PHY_CLK_VSWING_DFT;
}
if (clk_preem > 7) {
- LCDERR("%s: wrong clk_preem_level=%d, use default\n",
+ LCDERR("%s: wrong clk_preem=%d, use default\n",
__func__, clk_preem);
clk_preem = LVDS_PHY_CLK_PREEM_DFT;
}
- channel_on = lcd_lvds_channel_on_value(pconf);
- data32 = 0x606cca80 | (vswing << 26) | (preem << 0);
+ data32 = LVDS_PHY_CNTL1_G9TV |
+ (vswing << 26) | (preem << 0);
lcd_hiu_write(HHI_DIF_CSI_PHY_CNTL1, data32);
- /*lcd_hiu_write(HHI_DIF_CSI_PHY_CNTL1, 0x6c6cca80);*/
- lcd_hiu_write(HHI_DIF_CSI_PHY_CNTL2, 0x0000006c);
- data32 = (channel_on << 16) | 0x0800 | /* DIF_TX_CTL5 */
- (clk_vswing << 8) | (clk_preem << 5); /* DIF_TX_CTL4 */
+ data32 = LVDS_PHY_CNTL2_G9TV;
+ lcd_hiu_write(HHI_DIF_CSI_PHY_CNTL2, data32);
+ data32 = LVDS_PHY_CNTL3_G9TV |
+ (channel_on << 16) |
+ (clk_vswing << 8) | (clk_preem << 5);
lcd_hiu_write(HHI_DIF_CSI_PHY_CNTL3, data32);
- /*lcd_hiu_write(HHI_DIF_CSI_PHY_CNTL3, 0x0fff0800);*/
} else {
lcd_hiu_write(HHI_DIF_CSI_PHY_CNTL1, 0x0);
lcd_hiu_write(HHI_DIF_CSI_PHY_CNTL2, 0x0);
}
}
-static void lcd_tcon_set(struct lcd_config_s *pconf)
+static void lcd_encl_tcon_set(struct lcd_config_s *pconf)
{
lcd_vcbus_write(L_RGB_BASE_ADDR, 0);
lcd_vcbus_write(L_RGB_COEFF_ADDR, 0x400);
lcd_vcbus_read(VPP_MISC) & ~(VPP_OUT_SATURATE));
}
+static void lcd_venc_set(struct lcd_config_s *pconf)
+{
+ unsigned int h_active, v_active;
+ unsigned int video_on_pixel, video_on_line;
+
+ if (lcd_debug_print_flag)
+ LCDPR("%s\n", __func__);
+
+ h_active = pconf->lcd_basic.h_active;
+ v_active = pconf->lcd_basic.v_active;
+ video_on_pixel = pconf->lcd_timing.video_on_pixel;
+ video_on_line = pconf->lcd_timing.video_on_line;
+
+ lcd_vcbus_write(ENCL_VIDEO_EN, 0);
+
+ /* Enable Hsync and equalization pulse switch in center;
+ * bit[14] cfg_de_v = 1
+ */
+ lcd_vcbus_write(ENCL_VIDEO_MODE, 0x8000);/*bit[15] shadown en*/
+ lcd_vcbus_write(ENCL_VIDEO_MODE_ADV, 0x18); /* Sampling rate: 1 */
+
+ /* bypass filter */
+ lcd_vcbus_write(ENCL_VIDEO_FILT_CTRL, 0x1000);
+ lcd_vcbus_write(ENCL_VIDEO_MAX_PXCNT, pconf->lcd_basic.h_period - 1);
+ lcd_vcbus_write(ENCL_VIDEO_MAX_LNCNT, pconf->lcd_basic.v_period - 1);
+
+ lcd_vcbus_write(ENCL_VIDEO_HAVON_BEGIN, video_on_pixel);
+ lcd_vcbus_write(ENCL_VIDEO_HAVON_END, h_active - 1 + video_on_pixel);
+ lcd_vcbus_write(ENCL_VIDEO_VAVON_BLINE, video_on_line);
+ lcd_vcbus_write(ENCL_VIDEO_VAVON_ELINE, v_active - 1 + video_on_line);
+
+ lcd_vcbus_write(ENCL_VIDEO_HSO_BEGIN, pconf->lcd_timing.hs_hs_addr);
+ lcd_vcbus_write(ENCL_VIDEO_HSO_END, pconf->lcd_timing.hs_he_addr);
+ lcd_vcbus_write(ENCL_VIDEO_VSO_BEGIN, pconf->lcd_timing.vs_hs_addr);
+ lcd_vcbus_write(ENCL_VIDEO_VSO_END, pconf->lcd_timing.vs_he_addr);
+ lcd_vcbus_write(ENCL_VIDEO_VSO_BLINE, pconf->lcd_timing.vs_vs_addr);
+ lcd_vcbus_write(ENCL_VIDEO_VSO_ELINE, pconf->lcd_timing.vs_ve_addr);
+
+ lcd_vcbus_write(ENCL_VIDEO_RGBIN_CTRL, 3);
+
+ lcd_vcbus_write(ENCL_VIDEO_EN, 1);
+
+ aml_lcd_notifier_call_chain(LCD_EVENT_BACKLIGHT_UPDATE, NULL);
+}
+
static void lcd_lvds_clk_util_set(struct lcd_config_s *pconf)
{
unsigned int phy_div;
if (vx1_conf->vsync_intr_en == 3)
lcd_vcbus_setb(VBO_FSM_HOLDER_L, 0, 0, 16);
else
- lcd_vcbus_setb(VBO_FSM_HOLDER_L, 0xffff, 0, 16);
+ lcd_vcbus_setb(VBO_FSM_HOLDER_L, 0xffff, 0, 16);
/* enable interrupt */
lcd_vcbus_setb(VBO_INTR_UNMASK,
VBYONE_INTR_UNMASK, 0, 15);
int pclk, pclk_min, pclk_max;
#endif
- if (lcd_drv->lcd_status == 0)
+ if ((lcd_drv->lcd_status & LCD_STATUS_ENCL_ON) == 0)
goto vx1_hpll_timer_end;
#if 0
lcd_vcbus_setb(VBO_INTR_STATE_CTRL, data32_1, 0, 9);
lcd_vcbus_setb(VBO_INTR_STATE_CTRL, 0, 0, 9);
if (lcd_debug_print_flag) {
- LCDPR("vx1 intr status = 0x%04x, encl_clkmsr = %d",
- data32, encl_clk);
+ LCDPR("vx1 intr status = 0x%04x, encl_clkmsr = %d",
+ data32, encl_clk);
}
if (vx1_conf->vsync_intr_en == 3) {
}
}
} else {
- if (data32 & 0x200) {
- LCDPR("vx1 htpdn fall occurred\n");
- vx1_fsm_acq_st = 0;
- lcd_vcbus_setb(VBO_INTR_STATE_CTRL, 0, 15, 1);
- }
+ if (data32 & 0x200) {
+ LCDPR("vx1 htpdn fall occurred\n");
+ vx1_fsm_acq_st = 0;
+ lcd_vcbus_setb(VBO_INTR_STATE_CTRL, 0, 15, 1);
+ }
if (data32 & 0x800) {
if (lcd_debug_print_flag)
LCDPR("vx1 lockn fall occurred\n");
- vx1_fsm_acq_st = 0;
- lcd_vcbus_setb(VBO_INTR_STATE_CTRL, 0, 15, 1);
+ vx1_fsm_acq_st = 0;
+ lcd_vcbus_setb(VBO_INTR_STATE_CTRL, 0, 15, 1);
if (vx1_lockn_wait_cnt++ > VX1_LOCKN_WAIT_CNT_MAX) {
if (vx1_timeout_reset_flag == 0) {
vx1_timeout_reset_flag = 1;
&lcd_vx1_reset_tasklet);
vx1_lockn_wait_cnt = 0;
return IRQ_HANDLED;
- }
+ }
}
}
if (data32 & 0x2000) {
if (data32 & 0x1ff) {
if (lcd_debug_print_flag)
LCDPR("vx1 reset for timing err\n");
- vx1_fsm_acq_st = 0;
+ vx1_fsm_acq_st = 0;
/* force PHY to 0 */
lcd_hiu_setb(HHI_LVDS_TX_PHY_CNTL0, 3, 8, 2);
lcd_vcbus_write(VBO_SOFT_RST, 0x1ff);
lcd_vcbus_write(VBO_SOFT_RST, 0);
}
- udelay(20);
- if ((lcd_vcbus_read(VBO_STATUS_L) & 0x3f) == 0x20) {
- vx1_lockn_wait_cnt = 0;
- /* vx1_training_wait_cnt = 0; */
+ udelay(20);
+ if ((lcd_vcbus_read(VBO_STATUS_L) & 0x3f) == 0x20) {
+ vx1_lockn_wait_cnt = 0;
+ /* vx1_training_wait_cnt = 0; */
#if (VX1_FSM_ACQ_NEXT == VX1_FSM_ACQ_NEXT_RELEASE_HOLDER)
- lcd_vcbus_setb(VBO_FSM_HOLDER_L, 0xffff, 0, 16);
+ lcd_vcbus_setb(VBO_FSM_HOLDER_L, 0xffff, 0, 16);
#endif
- LCDPR("vx1 fsm stable\n");
- }
+ LCDPR("vx1 fsm stable\n");
+ }
}
/* enable interrupt */
lcd_vcbus_setb(VBO_INTR_UNMASK, VBYONE_INTR_UNMASK, 0, 15);
return IRQ_HANDLED;
}
-static void lcd_venc_set(struct lcd_config_s *pconf)
-{
- unsigned int h_active, v_active;
- unsigned int video_on_pixel, video_on_line;
-
- if (lcd_debug_print_flag)
- LCDPR("%s\n", __func__);
-
- h_active = pconf->lcd_basic.h_active;
- v_active = pconf->lcd_basic.v_active;
- video_on_pixel = pconf->lcd_timing.video_on_pixel;
- video_on_line = pconf->lcd_timing.video_on_line;
-
- lcd_vcbus_write(ENCL_VIDEO_EN, 0);
-
- /* Enable Hsync and equalization pulse switch in center;
- * bit[14] cfg_de_v = 1
- */
- lcd_vcbus_write(ENCL_VIDEO_MODE, 0x8000);/*bit[15] shadown en*/
- lcd_vcbus_write(ENCL_VIDEO_MODE_ADV, 0x18); /* Sampling rate: 1 */
-
- /* bypass filter */
- lcd_vcbus_write(ENCL_VIDEO_FILT_CTRL, 0x1000);
- lcd_vcbus_write(ENCL_VIDEO_MAX_PXCNT, pconf->lcd_basic.h_period - 1);
- lcd_vcbus_write(ENCL_VIDEO_MAX_LNCNT, pconf->lcd_basic.v_period - 1);
-
- lcd_vcbus_write(ENCL_VIDEO_HAVON_BEGIN, video_on_pixel);
- lcd_vcbus_write(ENCL_VIDEO_HAVON_END, h_active - 1 + video_on_pixel);
- lcd_vcbus_write(ENCL_VIDEO_VAVON_BLINE, video_on_line);
- lcd_vcbus_write(ENCL_VIDEO_VAVON_ELINE, v_active - 1 + video_on_line);
-
- lcd_vcbus_write(ENCL_VIDEO_HSO_BEGIN, pconf->lcd_timing.hs_hs_addr);
- lcd_vcbus_write(ENCL_VIDEO_HSO_END, pconf->lcd_timing.hs_he_addr);
- lcd_vcbus_write(ENCL_VIDEO_VSO_BEGIN, pconf->lcd_timing.vs_hs_addr);
- lcd_vcbus_write(ENCL_VIDEO_VSO_END, pconf->lcd_timing.vs_he_addr);
- lcd_vcbus_write(ENCL_VIDEO_VSO_BLINE, pconf->lcd_timing.vs_vs_addr);
- lcd_vcbus_write(ENCL_VIDEO_VSO_ELINE, pconf->lcd_timing.vs_ve_addr);
-
- lcd_vcbus_write(ENCL_VIDEO_RGBIN_CTRL, 3);
-
- lcd_vcbus_write(ENCL_VIDEO_EN, 1);
-
- aml_lcd_notifier_call_chain(LCD_EVENT_BACKLIGHT_UPDATE, NULL);
-}
static unsigned int vbyone_lane_num[] = {
1,
}
}
-void lcd_tv_clk_update(struct lcd_config_s *pconf)
+void lcd_tv_clk_config_change(struct lcd_config_s *pconf)
{
#ifdef CONFIG_AMLOGIC_VPU
request_vpu_clk_vmod(pconf->lcd_timing.lcd_clk, VPU_VENCL);
switch (pconf->lcd_basic.lcd_type) {
case LCD_VBYONE:
lcd_vbyone_config_set(pconf);
- lcd_vbyone_interrupt_enable(0);
break;
default:
break;
}
lcd_clk_generate_parameter(pconf);
+}
+
+void lcd_tv_clk_update(struct lcd_config_s *pconf)
+{
+ lcd_tv_clk_config_change(pconf);
+
+ if (pconf->lcd_basic.lcd_type == LCD_VBYONE)
+ lcd_vbyone_interrupt_enable(0);
lcd_clk_set(pconf);
if (pconf->lcd_basic.lcd_type == LCD_VBYONE)
lcd_vbyone_wait_stable();
/* update clk & timing config */
lcd_vmode_change(pconf);
info->video_clk = pconf->lcd_timing.lcd_clk;
+ info->htotal = pconf->lcd_basic.h_period;
+ info->vtotal = pconf->lcd_basic.v_period;
/* update interface timing */
switch (pconf->lcd_basic.lcd_type) {
case LCD_VBYONE:
lcd_clk_set(pconf);
lcd_venc_set(pconf);
- lcd_tcon_set(pconf);
+ lcd_encl_tcon_set(pconf);
lcd_vcbus_write(VENC_INTCTRL, 0x200);
}
ret = of_property_read_u32_array(child, "range_setting", ¶[0], 6);
if (ret) {
- LCDERR("no range_setting\n");
+ LCDPR("no range_setting\n");
pconf->lcd_basic.h_period_min = pconf->lcd_basic.h_period;
pconf->lcd_basic.h_period_max = pconf->lcd_basic.h_period;
pconf->lcd_basic.v_period_min = pconf->lcd_basic.v_period;
lvdsconf->port_swap = para[3];
}
} else {
- lvdsconf->lvds_repack = para[0];
- lvdsconf->dual_port = para[1];
- lvdsconf->pn_swap = para[2];
- lvdsconf->port_swap = para[3];
- lvdsconf->lane_reverse = para[4];
+ lvdsconf->lvds_repack = para[0];
+ lvdsconf->dual_port = para[1];
+ lvdsconf->pn_swap = para[2];
+ lvdsconf->port_swap = para[3];
+ lvdsconf->lane_reverse = para[4];
}
ret = of_property_read_u32_array(child, "phy_attr",
¶[0], 4);
lvdsconf->phy_clk_preem = 0;
if (lcd_debug_print_flag) {
LCDPR("phy vswing=0x%x, preem=0x%x\n",
- lvdsconf->phy_vswing,
- lvdsconf->phy_preem);
+ lvdsconf->phy_vswing,
+ lvdsconf->phy_preem);
}
}
} else {
if (vx1_conf->ctrl_flag & 0x7) {
ret = of_property_read_u32_array(child,
"vbyone_ctrl_timing", ¶[0], 3);
- if (ret)
+ if (ret) {
LCDPR("failed to get vbyone_ctrl_timing\n");
- else {
+ } else {
vx1_conf->power_on_reset_delay = para[0];
vx1_conf->hpd_data_delay = para[1];
vx1_conf->cdr_training_hold = para[2];
if ((event & LCD_EVENT_FRAME_RATE_ADJUST) == 0)
return NOTIFY_DONE;
+ if (data == NULL) {
+ LCDERR("%s: data is NULL\n", __func__);
+ return NOTIFY_DONE;
+ }
sync_duration = (unsigned int *)data;
lcd_set_vinfo(*sync_duration);
+++ /dev/null
-/*
- * drivers/amlogic/media/vout/lcd/lcd_tv/lcd_tv.dts
- *
- * Copyright (C) 2017 Amlogic, Inc. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- */
-
-lcd{
- compatible = "amlogic, lcd";
- dev_name = "lcd";
- mode = "tv";
- status = "okay";
- resets = <&clock GCLK_IDX_VCLK2_ENCL &clock GCLK_IDX_VCLK2_VENCL>;
- reset-names = "encl","vencl";
- interrupts = <0 78 1 0 3 1>;
- interrupt-names = "vbyone","vbyone_vsync";
- pinctrl-names = "vbyone";
- pinctrl-0 = <&lcd_vbyone_pins>;
-
- /* power type:(0=cpu, 1=pmu, 2=signal, 3=extern, 0xff=ending) */
- /* power index:(point gpios_index, or extern_index, 0xff=invalid) */
- /* power value:(0=output low, 1=output high, 2=input) */
- /* power delay:(unit in ms) */
- lcd_cpu-gpios = <&gpio GPIOX_3 GPIO_ACTIVE_HIGH>;
- lcd_cpu_gpio_names = "GPIOX_3";
-
- lvds_0{
- model_name = "public";
- interface = "lvds"; /* lcd_interface(lvds, vbyone) */
- basic_setting = <1920 1080 2200 1125 8 16 9>;
- /* h_active, v_active, h_period, v_period, lcd_bits,
- * screen_widht, screen_height
- */
- lcd_timing = <44 148 0 5 30 0>;
- /* hs_width, hs_bp, hs_pol, vs_width, vs_bp, vs_pol */
- clk_attr = <0 0 1>;
- /* fr_adj_type(0=clock, 1=htotal, 2=vtotal),
- * clk_ss_level, clk_auto_generate
- */
- lvds_attr = <1 1 0 0>;
- /** lvds_repack, dual_port, pn_swap, port_swap */
- power_on_step = <0 0 1 50
- 2 0 0 0
- 0xff 0 0 0>; /* type, index, value, delay */
- power_off_step = <2 0 0 50
- 0 0 0 100
- 0xff 0 0 0>; /* type, index, value, delay */
- backlight_index = <0>;
- };
-
- vbyone_0{
- model_name = "BOE_HV550QU2";
- interface = "vbyone"; /* lcd_interface(lvds, vbyone) */
- basic_setting = <3840 2160 4400 2250 10 16 9>;
- /* h_active, v_active, h_period, v_period, lcd_bits,
- * screen_widht, screen_height
- */
- lcd_timing = <33 477 0 6 65 0>;
- /* hs_width, hs_bp, hs_pol, vs_width, vs_bp, vs_pol */
- clk_attr = <0 0 1>;
- /* fr_adj_type(0=clock, 1=htotal, 2=vtotal),
- * clk_ss_level, clk_auto_generate
- */
- vbyone_attr = <8 2 4 4>;
- /** lane_count, region_num, byte_mode, color_fmt */
- power_on_step = <0 0 1 50
- 2 0 0 0
- 0xff 0 0 0>; /* type, index, value, delay */
- power_off_step = <2 0 0 50
- 0 0 0 100
- 0xff 0 0 0>; /* type, index, value, delay */
- backlight_index = <0>;
- };
-
- vbyone_1{
- model_name = "LG_RDL550WY";
- interface = "vbyone"; /* lcd_interface(lvds, vbyone) */
- basic_setting = <3840 2160 4400 2250 10 16 9>;
- /* h_active, v_active, h_period, v_period, lcd_bits,
- * screen_widht, screen_height
- */
- lcd_timing = <33 477 0 6 65 0>;
- /* hs_width, hs_bp, hs_pol, vs_width, vs_bp, vs_pol */
- clk_attr = <2 0 1>;
- /* fr_adj_type(0=clock, 1=htotal, 2=vtotal),
- * clk_ss_level, clk_auto_generate
- */
- vbyone_attr = <8 2 4 4>;
- /** lane_count, region_num, byte_mode, color_fmt */
- power_on_step = <0 0 1 50
- 2 0 0 0
- 0xff 0 0 0>; /* type, index, value, delay */
- power_off_step = <2 0 0 50
- 0 0 0 100
- 0xff 0 0 0>; /* type, index, value, delay */
- backlight_index = <0>;
- };
-
- vbyone_2{
- model_name = "INL_V580DJ2";
- interface = "vbyone"; /* lcd_interface(lvds, vbyone) */
- basic_setting = <3840 2160 4400 2250 10 16 9>;
- /* h_active, v_active, h_period, v_period, lcd_bits,
- * screen_widht, screen_height
- */
- lcd_timing = <33 477 0 6 65 0>;
- /* hs_width, hs_bp, hs_pol, vs_width, vs_bp, vs_pol */
- clk_attr = <2 0 1>;
- /* fr_adj_type(0=clock, 1=htotal, 2=vtotal),
- * clk_ss_level, clk_auto_generate
- */
- vbyone_attr = <8 1 4 4>;
- /** lane_count, region_num, byte_mode, color_fmt */
- power_on_step = <0 0 1 50
- 2 0 0 0
- 0xff 0 0 0>; /* type, index, value, delay */
- power_off_step = <2 0 0 50
- 0 0 0 100
- 0xff 0 0 0>; /* type, index, value, delay */
- backlight_index = <0>;
- };
-};
#define LCDUKEY(fmt, args...) pr_info("lcd ukey: "fmt"", ## args)
#define LCDUKEYERR(fmt, args...) pr_info("lcd ukey err: error: "fmt"", ## args)
-#ifdef CONFIG_KEY_MANAGE
+#ifdef CONFIG_AMLOGIC_UNIFYKEY
static unsigned int cal_crc32(unsigned int crc, const unsigned char *buf,
int buf_len) {
unsigned int s_crc32[16] = {
unsigned int key_crc32;
int ret;
+ if (key_name == NULL) {
+ LCDUKEYERR("%s: key_name is null\n", __func__);
+ return -1;
+ }
+
key_exist = 0;
key_len = 0;
- ret = key_unify_query(key_name, &key_exist, &keypermit);
+ ret = key_unify_query(get_ukdev(), key_name, &key_exist, &keypermit);
if (ret < 0) {
if (lcd_debug_print_flag)
LCDUKEYERR("%s query exist error\n", key_name);
return -1;
}
- ret = key_unify_size(key_name, &key_len);
+ ret = key_unify_size(get_ukdev(), key_name, &key_len);
if (ret < 0) {
LCDUKEYERR("%s query size error\n", key_name);
return -1;
LCDUKEYERR("%s: Not enough memory\n", __func__);
return -1;
}
- ret = key_unify_read(key_name, buf, key_len, &key_len);
+ ret = key_unify_read(get_ukdev(), key_name, buf, key_len, &key_len);
if (ret < 0) {
LCDUKEYERR("%s unify read error\n", key_name);
return -1;
ret = lcd_unifykey_check(key_name);
if (ret < 0)
return -1;
- ret = key_unify_size(key_name, &key_len);
+ ret = key_unify_size(get_ukdev(), key_name, &key_len);
if (key_len > *len) {
LCDUKEYERR("%s size(%d) is bigger than buf_size(%d)\n",
key_name, key_len, *len);
}
*len = key_len;
- ret = key_unify_read(key_name, buf, key_len, &key_len);
+ ret = key_unify_read(get_ukdev(), key_name, buf, key_len, &key_len);
if (ret < 0) {
LCDUKEYERR("%s unify read error\n", key_name);
return -1;
};
static struct lvds_config_s lcd_lvds_config = {
- .lvds_vswing = 1,
.lvds_repack = 1,
.dual_port = 0,
.pn_swap = 0,
.port_sel = 0,
.phy_vswing = LVDS_PHY_VSWING_DFT,
.phy_preem = LVDS_PHY_PREEM_DFT,
+ .phy_clk_vswing = LVDS_PHY_CLK_VSWING_DFT,
+ .phy_clk_preem = LVDS_PHY_CLK_PREEM_DFT,
};
static struct vbyone_config_s lcd_vbyone_config = {
.dsi_init_on = &dsi_init_on_table[0],
.dsi_init_off = &dsi_init_off_table[0],
.extern_init = 0xff,
- /* ext_index if needed, must match ext_config index;
- * 0xff for invalid
- */
+ /* ext_index if needed, 0xff for invalid */
.check_en = 0,
.check_reg = 0,
.check_cnt = 0,
#define LCD_UNIFYKEY_WAIT_TIMEOUT 300
/* declare external unifykey function */
-extern int key_unify_read(char *keyname, unsigned char *keydata,
+extern void *get_ukdev(void);
+extern int key_unify_read(void *ukdev, char *keyname, unsigned char *keydata,
unsigned int datalen, unsigned int *reallen);
-extern int key_unify_size(char *keyname, unsigned int *reallen);
-extern int key_unify_query(char *keyname, unsigned int *keystate,
- unsigned int *keypermit);
+extern int key_unify_size(void *ukdev, char *keyname, unsigned int *reallen);
+extern int key_unify_query(void *ukdev, char *keyname,
+ unsigned int *keystate, unsigned int *keypermit);
extern int key_unify_get_init_flag(void);