TI中文支持网
TI专业的中文技术问题搜集分享网站

请问 am335x LCD 显示屏 急急急!!!

大家好!

         AM335x LCD  ti-sdk-6.0    4.3寸屏加上补丁后 屏幕可以亮,但是鼠标用不了,屏幕的板子都没有问题,用的是BBB板子,触摸屏不能用? 请问是什么出问题了??

Index: .config
===================================================================
— .config    (revision 117)
+++ .config    (revision 127)
@@ -2428,9 +2428,16 @@
 CONFIG_EXT3_FS=y
 CONFIG_EXT3_DEFAULTS_TO_ORDERED=y
 # CONFIG_EXT3_FS_XATTR is not set
-# CONFIG_EXT4_FS is not set
+CONFIG_EXT4_FS=y
+CONFIG_EXT4_FS_XATTR=y
+CONFIG_EXT4_FS_POSIX_ACL=y
+CONFIG_EXT4_FS_SECURITY=y
+# CONFIG_EXT4_DEBUG is not set
 CONFIG_JBD=y
 # CONFIG_JBD_DEBUG is not set
+CONFIG_JBD2=y
+# CONFIG_JBD2_DEBUG is not set
+CONFIG_FS_MBCACHE=y
 # CONFIG_REISERFS_FS is not set
 # CONFIG_JFS_FS is not set
 # CONFIG_XFS_FS is not set
Index: arch/arm/mach-omap2/mux33xx.c
===================================================================
— arch/arm/mach-omap2/mux33xx.c    (revision 117)
+++ arch/arm/mach-omap2/mux33xx.c    (revision 127)
@@ -95,7 +95,7 @@
         NULL, NULL, NULL, "gpio1_17"),
     _AM33XX_MUXENTRY(GPMC_A2, 0,
         "gpmc_a2", "mii2_txd3", "rgmii2_td3", "mmc2_dat1",
–        NULL, NULL, NULL, "gpio1_18"),
+        NULL, NULL, "ehrpwm1A", "gpio1_18"),
     _AM33XX_MUXENTRY(GPMC_A3, 0,
         "gpmc_a3", "mii2_txd2", "rgmii2_td2", "mmc2_dat2",
         NULL, NULL, NULL, "gpio1_19"),
Index: arch/arm/mach-omap2/board-am335xevm.c
===================================================================
— arch/arm/mach-omap2/board-am335xevm.c    (revision 117)
+++ arch/arm/mach-omap2/board-am335xevm.c    (revision 127)
@@ -108,6 +108,15 @@
     .pwm_period_ns  = AM335X_PWM_PERIOD_NANO_SECONDS,
 };
 
+static struct platform_pwm_backlight_data am335x_backlight_data1 = {
+    .pwm_id         = "ehrpwm.1:0",
+    .ch             = -1,
+    .lth_brightness    = 1,
+    .max_brightness = AM335X_BACKLIGHT_MAX_BRIGHTNESS,
+    .dft_brightness = AM335X_BACKLIGHT_DEFAULT_BRIGHTNESS,
+    .pwm_period_ns  = 5 * 1000000,
+};
+
 static struct platform_pwm_backlight_data am335x_backlight_data2 = {
     .pwm_id         = "ecap.2",
     .ch             = -1,
@@ -146,6 +155,36 @@
     .type                   = "NHD-4.3-ATXI#-T-1",
 };
 
+struct da8xx_lcdc_platform_data am335x_lcd_pdata[] = {
+        {
+                .manu_name              = "InnoLux",
+                .controller_data        = &lcd_cfg,
+                .type                   = "4.3inch_LCD",
+        }, {
+                .manu_name              = "InnoLux",
+                .controller_data        = &lcd_cfg,
+                .type                   = "7inch_LCD",
+        }, {
+                .manu_name              = "InnoLux",
+                .controller_data        = &lcd_cfg,
+                .type                   = "VGA",
+        }, {
+                .manu_name              = "InnoLux",
+                .controller_data        = &lcd_cfg,
+                .type                   = "LVDS",
+        },
+};
+
+static char lcd_type[11];
+
+static int __init lcd_type_init(char* s) {
+
+        strncpy(lcd_type, s, 11);
+        return 0;
+}
+
+__setup("dispmode=", lcd_type_init);
+
 #include "common.h"
 
 #include <linux/lis3lv02d.h>
@@ -412,6 +451,11 @@
     {NULL, 0},
 };
 
+static struct pinmux_config haptics_bb_view_pin_mux[] = {
+    {"gpmc_a2.ehrpwm1A",        OMAP_MUX_MODE6 | AM33XX_PIN_OUTPUT_PULLUP},
+    {NULL, 0},
+};
+
 /* Module pin mux for LCDC */
 static struct pinmux_config lcdc_pin_mux[] = {
     {"lcd_data0.lcd_data0",        OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
@@ -704,6 +748,26 @@
     {NULL, 0},
 };
 
+/* pinmux for bb-view gpio based key */
+static struct pinmux_config bb_view_keys_mux[] = {
+    {"gpmc_a3.gpio1_19", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT},
+    {"uart1_txd.gpio0_15", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT},
+    {"gpmc_a1.gpio1_17", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT},
+    {"gpmc_wait0.gpio0_30", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT},
+    {NULL, 0},
+};
+
+/* pinmux for bb-view led device */
+static struct pinmux_config bb_view_led_mux[] = {
+    {"gpmc_be1n.gpio1_28", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT},
+    {"uart1_ctsn.gpio0_12", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT},
+    {"gpmc_a5.gpio1_21",  OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT},
+    {"gpmc_a6.gpio1_22",  OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT},
+    {"gpmc_a7.gpio1_23",  OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT},
+    {"gpmc_a8.gpio1_24",  OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT},
+    {NULL, 0},
+};
+
 static struct pinmux_config gpio_ddr_vtt_enb_pin_mux[] = {
     {"ecap0_in_pwm0_out.gpio0_7", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT},
     {NULL, 0},
@@ -968,6 +1032,11 @@
     setup_pin_mux(ecap0_pin_mux);
 }
 
+static void enable_ecap1(int evm_id, int profile)
+{
+    backlight_enable = true;
+}
+
 static void enable_ecap2(int evm_id, int profile)
 {
     backlight_enable = true;
@@ -1003,6 +1072,12 @@
         int ecap_index = 0;
 
         switch (am335x_evm_get_id()) {
+        case BEAGLE_BONE_OLD:
+        case BEAGLE_BONE_A3:
+        case BEAGLE_BONE_BLACK:
+            ecap_index = 1;
+            am335x_backlight.dev.platform_data = &am335x_backlight_data1;
+            break;
         case GEN_PURP_EVM:
         case GEN_PURP_DDR3_EVM:
             ecap_index = 0;
@@ -1058,6 +1133,25 @@
         return;
     }
     switch (evm_id) {
+    case BEAGLE_BONE_OLD:
+    case BEAGLE_BONE_A3:
+    case BEAGLE_BONE_BLACK: {
+        int i;
+
+        lcdc_pdata = NULL;
+        for (i = 0; i < ARRAY_SIZE(am335x_lcd_pdata); i++) {
+            if (!strcmp(lcd_type, am335x_lcd_pdata[i].type)) {
+                lcdc_pdata = &am335x_lcd_pdata[i];
+                break;
+            }
+        }
+
+        if(!lcdc_pdata) {
+            pr_err("Invalid type of lcd, set to default!\n");
+            lcdc_pdata = &am335x_lcd_pdata[0];
+        }
+        break;
+    }
     case GEN_PURP_EVM:
     case GEN_PURP_DDR3_EVM:
         lcdc_pdata = &TFC_S9700RTWV35TR_01B_pdata;
@@ -1152,6 +1246,12 @@
 #define HAPTICS_MAX_FREQ 250
 static void haptics_init(int evm_id, int profile)
 {
+    if (evm_id == BEAGLE_BONE_BLACK || evm_id == BEAGLE_BONE_OLD || evm_id == BEAGLE_BONE_A3) {
+        setup_pin_mux(haptics_bb_view_pin_mux);
+        pwm_pdata[2].chan_attrib[1].max_freq = HAPTICS_MAX_FREQ;
+        am33xx_register_ehrpwm(1, &pwm_pdata[2]);
+        return;
+    }
     setup_pin_mux(haptics_pin_mux);
     pwm_pdata[2].chan_attrib[1].max_freq = HAPTICS_MAX_FREQ;
     am33xx_register_ehrpwm(2, &pwm_pdata[2]);
@@ -1981,6 +2081,106 @@
         pr_err("failed to register gpio led device\n");
 }
 
+/* Configure GPIOs for GPIO Keys on bb-view */
+static struct gpio_keys_button bb_view_gpio_buttons[] = {
+    {
+        .code           = BTN_0,
+        .gpio           = GPIO_TO_PIN(1, 19),
+        .desc           = "USR0",
+    },
+    {
+        .code           = BTN_1,
+        .gpio           = GPIO_TO_PIN(0, 15),
+        .desc           = "USR1",
+    },
+    {
+        .code           = BTN_2,
+        .gpio           = GPIO_TO_PIN(1, 17),
+        .desc           = "USR2",
+        .wakeup         = 1,
+    },
+    {
+        .code           = BTN_3,
+        .gpio           = GPIO_TO_PIN(0, 30),
+        .desc           = "USR3",
+    },
+};
+
+static struct gpio_keys_platform_data bb_view_gpio_key_info = {
+    .buttons    = bb_view_gpio_buttons,
+    .nbuttons       = ARRAY_SIZE(bb_view_gpio_buttons),
+};
+
+static struct platform_device bb_view_gpio_keys = {
+    .name   = "gpio-keys",
+    .id     = -1,
+    .dev    = {
+        .platform_data  = &bb_view_gpio_key_info,
+    },
+};
+
+static void bb_view_keys_init(int evm_id, int profile)
+{
+    int err;
+
+    setup_pin_mux(bb_view_keys_mux);
+    err = platform_device_register(&bb_view_gpio_keys);
+    if (err)
+        pr_err("failed to register gpio key device\n");
+}
+
+static struct gpio_led bb_view_gpio_leds[] = {
+    {
+        .name            = "LED0",
+        .gpio            = GPIO_TO_PIN(1, 28),
+        .default_trigger    = "heartbeat",
+    },
+    {
+        .name            = "LED1",
+        .gpio            = GPIO_TO_PIN(0, 12),
+    },
+    {
+        .name            = "USR0",
+        .gpio            = GPIO_TO_PIN(1, 21),
+    },
+    {
+        .name            = "USR1",
+        .gpio            = GPIO_TO_PIN(1, 22),
+    },
+    {
+        .name            = "USR2",
+        .gpio            = GPIO_TO_PIN(1, 23),
+    },
+    {
+        .name            = "USR3",
+        .gpio            = GPIO_TO_PIN(1, 24),
+        .default_trigger    = "mmc0",
+    },
+};
+
+static struct gpio_led_platform_data bb_view_led_info = {
+    .leds        = bb_view_gpio_leds,
+    .num_leds    = ARRAY_SIZE(bb_view_gpio_leds),
+};
+
+static struct platform_device bb_view_leds = {
+    .name    = "leds-gpio",
+    .id    = -1,
+    .dev    = {
+        .platform_data    = &bb_view_led_info,
+    },
+};
+
+static void bb_view_leds_init(int evm_id, int profile)
+{
+    int err;
+
+    setup_pin_mux(bb_view_led_mux);
+    err = platform_device_register(&bb_view_leds);
+    if (err)
+        pr_err("failed to register gpio led device\n");
+}
+
 /* setup spi0 */
 static void spi0_init(int evm_id, int profile)
 {
@@ -2174,7 +2374,12 @@
     {usb1_init,    DEV_ON_BASEBOARD, PROFILE_NONE},
     {mmc0_init,    DEV_ON_BASEBOARD, PROFILE_NONE},
     {i2c2_init,    DEV_ON_BASEBOARD, PROFILE_NONE},
–    {sgx_init,    DEV_ON_BASEBOARD, PROFILE_NONE},
+    {enable_ecap1,    DEV_ON_BASEBOARD, PROFILE_NONE},
+    {lcdc_init,    DEV_ON_BASEBOARD, PROFILE_NONE},
+    {mfd_tscadc_init,DEV_ON_BASEBOARD, PROFILE_NONE},
+    {haptics_init,    DEV_ON_BASEBOARD, PROFILE_NONE},
+    {bb_view_keys_init, DEV_ON_BASEBOARD, PROFILE_NONE},
+    {bb_view_leds_init, DEV_ON_BASEBOARD, PROFILE_NONE},
     {NULL, 0, 0},
 };
 
@@ -2188,7 +2393,12 @@
     {usb1_init,    DEV_ON_BASEBOARD, PROFILE_NONE},
     {mmc0_init,    DEV_ON_BASEBOARD, PROFILE_NONE},
     {i2c2_init,    DEV_ON_BASEBOARD, PROFILE_NONE},
–    {sgx_init,    DEV_ON_BASEBOARD, PROFILE_NONE},
+    {enable_ecap1,    DEV_ON_BASEBOARD, PROFILE_NONE},
+    {lcdc_init,    DEV_ON_BASEBOARD, PROFILE_NONE},
+    {mfd_tscadc_init,DEV_ON_BASEBOARD, PROFILE_NONE},
+    {haptics_init,    DEV_ON_BASEBOARD, PROFILE_NONE},
+    {bb_view_keys_init, DEV_ON_BASEBOARD, PROFILE_NONE},
+    {bb_view_leds_init, DEV_ON_BASEBOARD, PROFILE_NONE},
     {NULL, 0, 0},
 };
 
@@ -2202,8 +2412,13 @@
     {usb1_init,    DEV_ON_BASEBOARD, PROFILE_NONE},
     {mmc1_emmc_init,    DEV_ON_BASEBOARD, PROFILE_NONE},
     {mmc0_init,    DEV_ON_BASEBOARD, PROFILE_NONE},
–    {i2c2_init,    DEV_ON_BASEBOARD, PROFILE_NONE},
–    {sgx_init,    DEV_ON_BASEBOARD, PROFILE_NONE},
+    //{i2c2_init,    DEV_ON_BASEBOARD, PROFILE_NONE},
+    {enable_ecap1,    DEV_ON_BASEBOARD, PROFILE_NONE},
+    {lcdc_init,    DEV_ON_BASEBOARD, PROFILE_NONE},
+    {mfd_tscadc_init,DEV_ON_BASEBOARD, PROFILE_NONE},
+    {haptics_init,    DEV_ON_BASEBOARD, PROFILE_NONE},
+    {bb_view_keys_init, DEV_ON_BASEBOARD, PROFILE_NONE},
+    {bb_view_leds_init, DEV_ON_BASEBOARD, PROFILE_NONE},
     {NULL, 0, 0},
 };
 
Index: drivers/video/da8xx-fb.c
===================================================================
— drivers/video/da8xx-fb.c    (revision 117)
+++ drivers/video/da8xx-fb.c    (revision 127)
@@ -290,6 +290,71 @@
         .pxl_clk = 9000000,
         .invert_pxl_clk = 0,
     },
+        [4] = {
+                .name = "4.3inch_LCD",
+                .width = 480,
+                .height = 272,
+                .hfp = 2,
+                .hbp = 2,
+                .hsw = 41,
+                .vfp = 2,
+                .vbp = 2,
+                .vsw = 10,
+                .pxl_clk = 9600000,
+                .invert_pxl_clk = 0,
+        },
+        [5] = {
+                .name = "5inch_LCD",
+                .width = 800,
+                .height = 480,
+                .hfp = 40,
+                .hbp = 88,
+                .hsw = 48,
+                .vfp = 13,
+                .vbp = 32,
+                .vsw = 3,
+                .pxl_clk = 30000000,
+                .invert_pxl_clk = 0,
+        },
+        [6] = {
+                .name = "7inch_LCD",
+                .width = 800,
+                .height = 480,
+                .hfp = 1,
+                .hbp = 1,
+                .hsw = 48,
+                .vfp = 12,
+                .vbp = 25,
+                .vsw = 3,
+                .pxl_clk = 33000000,
+                .invert_pxl_clk = 0,
+        },
+        [7] = {
+                .name = "VGA",
+                .width = 1024,
+                .height = 768,
+                .hfp = 18,
+                .hbp = 1248,
+                .hsw = 53,
+                .vfp = 3,
+                .vbp = 29,
+                .vsw = 6,
+                .pxl_clk = 72000000,
+                .invert_pxl_clk = 0,
+        },
+        [8] = {
+                .name = "LVDS",
+                .width = 800,
+                .height = 600,
+                .hfp = 39,
+                .hbp = 151,
+                .hsw = 63,
+                .vfp = 1,
+                .vbp = 23,
+                .vsw = 3,
+                .pxl_clk = 36000000,
+                .invert_pxl_clk = 0,
+        },
 };
 
 static inline bool is_raster_enabled(void)

Steven Liu1:

你的问题是touch screen pannel不能用,不是LCD屏的问题吧?

要使用touch screen pannel的话,需要使能,我们的ADC驱动driver,看你上面的补丁中貌似是有这部分的配置的,但需要确认生效了没有。你的bbb跑的是Linux吗,如果是的话,你在终端用ts_calibrate进行触屏校准,看看有没有用,就知道你的触屏有没有反应了。

kun huang2:

回复 Steven Liu1:

Steven Liu

      谢谢!我的BBB跑的是linux,以前跑的时候都会有校准的画面,现在直接没有了,什么都好这就是触摸屏点不了,没鼠标,触摸屏的初始化什么都有的,您的自己是让我看看ADC驱动吗?还有就是我在终端输ts_calibrate没有反应,没变化,我看看ADC驱动。

Steven Liu1:

回复 kun huang2:

你用的是四线电阻触摸屏吗?注意检查一下接入的线序不要出错。

BBB用什么启动的?如果是用SD卡启动的,在你的SD卡第一个FAT32分区里面应该会有个.pointer文件(忘了是不是隐藏属性),把这个删了,下一次进去就可以再次进行校准。主要检查的是电路上你有没有正确的接入,驱动上有没有使能。PS:如果使用示波器,能在触屏的信号线上检测到电压,就至少可以证明,你的TSC driver已经始能了。

kun huang2:

回复 Steven Liu1:

谢谢!你一直以来的支持啊!

            一语惊醒梦中人,看了一下board-am335xevm.c 对ADC的配置现在好了,谢谢

赞(0)
未经允许不得转载:TI中文支持网 » 请问 am335x LCD 显示屏 急急急!!!
分享到: 更多 (0)