当前位置:   article > 正文

展讯驱动入门_config_fb_lcd_jd9161_fwvga

config_fb_lcd_jd9161_fwvga

展讯驱动入门

fastboot download cmd:

   fastboot flash uboot u-boot.bin

   fastboot flash boot boot.img

LCM

基础知识:http://blog.chinaunix.net/uid-28454895-id-4216124.html

code path: kernel/drivers/video/sprdfb/lcd

kernel/drivers/video/backlight

u-boot64/drivers/video/sprdfb/lcd

porting:

U-boot:

u-boot64/include/configs/sp7731ceb.h +#define CONFIG_FB_LCD_ILI9806E_MIPI   u已在sprocomm中添加 

 

u-boot64/drivers/video/sprdfb/lcd/Makefile

+obj-$(CONFIG_FB_LCD_ILI9806E_MIPI)  += lcd_ili9806e_mipi.o  u本来就有

 

u-boot64/drivers/video/sprdfb/sprdfb_panel.c u本来就有

加extern struct panel_spec lcd_ili9806e_mipi_spec;

panel_cfg里面加

#ifdef CONFIG_FB_LCD_ILI9806E_MIPI

{

    .lcd_id = 0x4,

    .panel = &lcd_ili9806e_mipi_spec,

},

#endif

panel_info   =================没加

u-boot64/drivers/video/sprdfb/lcd

+lcd_ili9806e_mipi.c     u在sprocomm中添加

 

根据id脚兼容模组:

u-boot64/drivers/video/sprdfb/sprdfb_main.c

+static uint32_t lcd_id_vol_to_kernel = 0;

 

+int get_lcd_id_value(unsigned int gpio)

+{

+    int lcd_id_value; 

+    sprd_gpio_request(NULL,gpio); 

+    sprd_gpio_direction_input(NULL,gpio); 

+    lcd_id_value = sprd_gpio_get(NULL,gpio); 

+

+    return lcd_id_value?1:0; 

+}

+void save_lcd_id_vol_to_kernel(uint32_t id_vol)

+{ 

+    lcd_id_vol_to_kernel = id_vol;

+}

+

+uint32_t load_lcd_id_vol_to_kernel(void)

+{

+    return lcd_id_vol_to_kernel;

+}

 

u-boot64/common/loader/sprd_fdt_support.c

+extern uint32_t load_lcd_id_vol_to_kernel();

+

+int fdt_fixup_lcdid_vol(void *fdt)

+{

+       char buf[16];

+       extern uint32_t load_lcd_id_vol_to_kernel();

+       uint32_t lcd_id_vol = 0;

+       int str_len;

+       int ret;

+

+       lcd_id_vol = load_lcd_id_vol_to_kernel();

+       memset(buf, 0, 16);

+

+       sprintf(buf, "lcd_id_vol=");

+       str_len = strlen(buf);

+       sprintf(&buf[str_len], "%x",lcd_id_vol);

+       str_len = strlen(buf);

+       buf[str_len] = '\0';

+

+       ret = fdt_chosen_bootargs_append(fdt, buf, 1);

+       return ret;

+}

+

+

 

u-boot64/common/loader/loader_common.c

 

@@ -88,6 +88,7 @@ void fdt_fixup_all(void)

        fdt_initrd_norsvmem(fdt_blob, RAMDISK_ADR, RAMDISK_ADR + hdr->ramdisk_size, 1);

 #ifdef CONFIG_SPLASH_SCREEN

        fdt_fixup_lcdid(fdt_blob);

+       fdt_fixup_lcdid_vol(fdt_blob);

        fdt_fixup_lcdbase(fdt_blob);

 #endif

 

 

Kernel:

sprocomm_proj\X5099I\kernel\arch\arm\configs\sp7731ceb_dt_defconfig

加CONFIG_FB_LCD_JD9161_MIPI=y

kernel/drivers/video/sprdfb/lcd/Makefile

加obj-$(CONFIG_FB_LCD_JD9161_MIPI) += lcd_jd9161_mipi.o

kernel/drivers/video/sprdfb/Kconfig

加config FB_LCD_ST7701_MIPI

       boolean "support ST7701 mipi panel"

       default n

 

sprocomm_proj\kernel/drivers/video/sprdfb/lcd\

加驱动文件

 

重要code: adapt_panel_from_readid()

Lcm:idh.code\kernel\drivers\video\sprdfb\lcd

背光:idh.code/kernel/drivers/video/backlight/sprd_pwm_bl.c

 

Code流程 http://www.xuebuyuan.com/1023151.html

 

背光:

Uboot: set_backlight

u-boot64/board/spreadtrum/sp7731ceb/sprd_bl.c中set_backlight

Kernel:sprd_pwm_bl_update_status,默认是在probe函数中设置的

NTC

1.基础知识:http://blog.csdn.net/xubin341719/article/details/8497830

 

2.内部文档文档:

 

3.代码路径:

idh.code/kernel/drivers/power/sprd_2713_power.c

Dts:idh.code/kernel/arch/arm/boot/dts/sprd-battery.dtsi

电量百分比和内阻

sprdfgu_get_cur_rint

温度和电流

sprdbat_charge_works

电量百分比和电压

ocv-tab-vol = <4150 4100 4059 4024 3986 3946 3911 3881 3856 3833 3813 3797 3783 3769 3757 3742 3723 3695 3660 3620 3400>;

ocv-tab-cap = <100  95   90   85   80   75   70   65   60   55   50   45   40   35   30   25   20   15   10   5    0>;

记得chg-end-vol-l = <4150 >;和100%电压同步,0%电压用3400

 

库仑计相关:

fgu-mode = <0>; 库仑计模式

cnom = <1500>; 电池电量单位mAh

rint = <200>;    电池内阻 毫欧

 

Camera

 

(1)根据摄像头模组厂打样时的摄像头摆放方向,配置好device\sprd\scx35\BoardConfigCommon.mk文件内的前/后摄像头方向。

 

若模组厂打样时摄像头拍照方向为横屏,则TARGET_BOARD_BACK_CAMERA_ROTATION及TARGET_BOARD_FRONT_CAMERA_ROTATION设置为false,否则设置为true。

 

 

 

(2)idh.code/device/sprd/scx35_sp7731geaplus_pad_qhd/BoardConfig.mk文件中CAMERA_SUPPORT_SIZE配置摄像头的分辨率(可比实际值大,可插值)、摄像头通讯接口等

 

(3)    根据电路原理图,在kernel/arch/arm/boot/dts/sprd-scx35_sp7731geaplus_pad_qhd.dts文件中sprd_sensor处配置好前后摄像头的pwdn、reset脚。

(4)       vendor/sprd/open-source/libs/libcamera/sensor内添加具体的摄像头驱动。

(5) vendor/sprd/open-source/libs/libcamera/sc8830/src/sensor_cfg.c内设置前后摄像头

 

调试摄像头时,要尤其注意VDDCAMA(2.8V)、VDDCAMIO(1.8V)、VDDCAMMOT(3.0V)这三个LDO的输出电压大小区别。客户的模组厂在打样时经常会忽视VDDCAMA、VDDCAMIO这两个LDO的供电电压输出区别,从而造成摄像头点不亮。因此在调试时,如果出现摄像头点不亮,可以尝试跳线短接VDDCAMA(2.8V)、VDDCAMIO(1.8V),确认是否是这个问题。

 

项目中如果有前后摄像头,在调试时如果点不亮,也可以尝试对调前后摄像头的pwdn设置脚。在实际调试中也时常出现模组厂将这连个引脚对调的问题。

 

Kernel/drivers/media/sprd_dcam/

Kernel/drivers/media/sprd_sensor /

Kernel/drivers/media/sprd_isp/

 

Dts修改:

Kernel 注册的platform device  ,配置上电,reset相关引脚

sprd_sensor {

 compatible  = "sprd,sprd_sensor";

 

Kernel dts中i2c挂在,配置I2C地址

 sensor_main@0x3c{

        compatible = "sprd,sensor_main";

        reg = <0x3c>;

 };

 sensor_sub@0x21{

        compatible = "sprd,sensor_sub";

        reg = <0x21>;

 };

 

vendor/sprd/modules/libcamera/sensor

添加camera参数文件目录:

Eg:vendor/sprd/modules/libcamera/sensor/gc0409/

sensor_cfg.c中添加

extern SENSOR_INFO_T g_gc2355_mipi_raw_info;

camera参数到数组中,

 

\vendor\sprd\modules\libcamera\Camera.mk

LOCAL_SRC_FILES+= \处添加

sensor/gc2355/sensor_gc2355_mipi_raw.c \

vendor\sprd\modules\libcamera\hal3\SprdCamera3Setting.cpp

const sensor_fov_tab_t front_sensor_fov_tab[] =里添加

{"gc2355_mipi_raw", {2.828f, 2.156f}, 2.6865f},

 

hal3/SprdCamera3Setting.cpp添加到tab中

back_sensor_fov_tab

 

闪光灯:

\kernel\drivers\media\sprd_dcam\flash\flash_sgm3140.c

sprd_img_setflash

kernel\drivers\media\sprd_dcam\common\flash_test.c

int setflash(uint32_t flash_mode)

查看camera帧率 adb shell logcat -v time | grep “got one frame”

闪光灯:

kernel/drivers/media/sprd_dcam/common/flash_test.c

kernel/drivers/media/sprd_dcam/flash/flash_sgm3140.c

Thermal

1. Remove thirdpart apk

modified:   vendor/google/products/gms.mk

modified:   vendor/ThirdpartApp/X5088LV/install.mk

 

+++ b/idh.code/vendor/google/products/gms.mk

@@ -1,4 +1,4 @@

-ifeq ($(MODULES_FEATURE_GMS),yes)

+ifeq ($(MODULES_FEATURE_GMS),no)

 

+++ b/idh.code/vendor/ThirdpartApp/X5088LV/install.mk

@@ -15,23 +15,7 @@ $(shell mkdir -p $(PRELOAD_WALLPAPER_DIR))

 

 ################

 PRODUCT_PACKAGES += \

-       Torch \

-       AgingTest \

-    SprdAppBackup \

-    LavaUpdateClient \

        LQLauncher_OLauncher_X5088LV \

-    Quickoffice \

-       SettingsService \

-       Snapdeal \

-       Saavn \

-       OLX \

-       CleanMaster \

-       Hike \

-       UC_Browser \

-       MonsterTruckSaga \

-    TempleParadiseDash \

-       Activation_Tracker \

-    360MobileSecurityLite

 

2.降低lcd背光亮度

3.降低充电电流

4.修改wifi功率,具体文件射频胡巧提供

vendor\sprd\open-source\res\productinfo\scx20_sp7731ceb_connectivity_configure.ini

 

5.降低audio功率,具体文件由刘义华提供

\modem\X5088LV\nvitem.bin

\sprocomm_proj\X5088LV\device\sprd\scx20_sp7731ceb\audio_params\audio_para

 

6. 降低camera 帧率,具体文件由万飞提供,驱动也可以改

vendor/sprd/modules/libcamera/sensor/gc0409/sensor_gc0409_raw_param_v3.c

ivendor/sprd/modules/libcamera/sensor/ov5670/sensor_ov5670_raw_param_v3.c

 

 

New Procject

必须以X开头,因为编译脚本buildall_eng.sh会检查

                if [ ${first_ch} = "X" ] ; then

                        PROJECT=${newstr}

 

 cp sprocomm_proj/X5088LV/ sprocomm_proj/X4086M -R

 cp build/buildplus/buildspec/X5088LV.spec build/buildplus/buildspec/X4086M.spec 

 cp modem/X5088LV/  modem/X4086M -R

 

 

 

Key

Dts

compatible = "sprd,sci-keypad";

u-boot64/board/spreadtrum/sp7731ceb/key_map.h

 

 

Sensor

1.驱动

Kernel\driver\input\misc\

Sprocmm\X5088LV\device\sprd\scx20_sp7731ceb\BoardConfig.mk

2.Hal

vendor\sprd\open-source\libs\libsensors_sprd\

  添加CPP

  修改Android.mk

3.Init.rc

system/core/rootdir/项目对应的init.rc

4.Sepolicy

device\sprd\scx20\sepolicy\file_contexts

查看gpio状态Adb shell cat  /d/gpio

兼容:

device/sprd/scx20_sp7731ceb/BoardConfig.mk

+BOARD_ACC_COMPATIBLE := true

vendor/sprd/open-source/libs/libsensors_sprd/AccSensor.h

 

 

GPIO

根据S3121_GPIO配置_V1.0.xls中找到BAT_ID,然后在会看到PROX_INT,然后在

u-boot64/board/spreadtrum/sp7731ceb/pinmap-sp7731.c中找到PROX_INT,注释掉

 

 

PA:

device/sprd/scx20_sp7731ceb/audio_params/tiny_hw.xml

kernel/arch/arm/configs/sp7731ceb_dt_defconfig

kernel/arch/arm/mach-sc/Kconfig

kernel/arch/arm/mach-sc/board-sp7731ceb.c

u-boot64/board/spreadtrum/sp7731ceb/pinmap-sp7731.c

 

 

Copy 文件到系统相应目录sp7731cea_dt_common.mk

 

PRODUCT_COPY_FILES += 

 

夹具自动化测试:

kernel/drivers/autotst/

vendor/sprd/open-source/apps/autotest/

device/sprd/scx35/sepolicy/改权限

文章标签:  android 展讯 driver
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/192519
推荐阅读
相关标签
  

闽ICP备14008679号