2013년 6월 27일 목요일


http://cafe.naver.com/embeddedcrazyboys
http://www.mangoboard.com/


망고310 ) 7” LCD FT5x06터치 드라이버 포팅
이번에 새로나온 7" LCD 1024x600 정전식 LCD에 대한 드라이버 포팅 가이드 입니다. 
상품 성명 : 

망고210도 수정하면 됩니다. 

수정 파일은

arch/arm/mach-exynos/mach-smdkv310.c:#if!defined(CONFIG_MANGO_TOUCH_HX8526_7INCH) &&!defined(CONFIG_MANGO_TOUCH_FT5x06_101INCH) &&!defined(CONFIG_MANGO_TOUCH_HX8526_7INCH)//CRZ Fix
arch/arm/mach-exynos/mach-smdkv310.c:#ifdefCONFIG_MANGO_TOUCH_FT5x06_101INCH
config.sav:#CONFIG_MANGO_TOUCH_FT5x06_101INCH is not set
drivers/input/touchscreen/Kconfig:configMANGO_TOUCH_FT5x06_101INCH
drivers/input/touchscreen/Makefile:obj-$(CONFIG_MANGO_TOUCH_FT5x06_101INCH)+= mango_ft5x06_ts.o s5pc210_ts_gpio_i2c.o
drivers/input/touchscreen/mango_ft5x06_ts.c:#elifdefined(CONFIG_MANGO_TOUCH_FT5x06_101INCH)
drivers/input/touchscreen/mango_ft5x06_ts.c:#ifndefCONFIG_MANGO_TOUCH_FT5x06_101INCH   /* bycrazyboy */
drivers/input/touchscreen/mango_ft5x06_ts.c:#ifndefCONFIG_MANGO_TOUCH_FT5x06_101INCH   /* bycrazyboy */
drivers/input/touchscreen/mango_ft5x06_ts.c:#ifdefined(CFG_SUPPORT_TOUCH_KEY) ||defined(CONFIG_MANGO_TOUCH_FT5x06_101INCH)      /* by crazyboy */
drivers/input/touchscreen/mango_ft5x06_ts.h:#elifdefined(CONFIG_MANGO_TOUCH_FT5x06_101INCH)
drivers/video/logo/Kconfig:        depends on FB_S5P_LTN101AL03 ||MANGO_TOUCH_FT5x06_101INCH
drivers/video/logo/Kconfig:        depends on FB_S5P_LTN101AL03 ||MANGO_TOUCH_FT5x06_101INCH

이다.

CONFIG_MANGO_TOUCH_FT5x06_7INCH

으로 검색하면 됩니다.
“arch/arm/mach-exynos/mach-smdkv310.c” 파일에서수정

static struct gpio_keys_buttonmango310_gpio_keys_table[] = {
       {
                .code = KEY_MENU,
                .gpio = EXYNOS4_GPX3(3),
                .desc = "gpio-keys:KEY_MENU",
                .type = EV_KEY,
                .active_low = 1,
                .wakeup = 1,
                .debounce_interval = 1,
       },
#if!defined(CONFIG_MANGO_TOUCH_HX8526_7INCH) &&!defined(CONFIG_MANGO_TOUCH_FT5x06_101INCH) && !defined(CONFIG_MANGO_TOUCH_FT5x06_7INCH)//CRZ Fix
       {
                .code = KEY_HOME,
                .gpio = EXYNOS4_GPX3(4),
                .desc = "gpio-keys:KEY_HOME",
                .type = EV_KEY,
                .active_low = 1,
                .wakeup = 1,
                .debounce_interval = 1,
       },
#endif

static struct i2c_board_info i2c_devs0[] __initdata = {
#ifdef CONFIG_SND_SOC_SAMSUNG_SMDK_WM8960
    {
        I2C_BOARD_INFO("wm8960", 0x1a),
    },
#endif
#ifdef CONFIG_INPUT_BMA150
    {
        I2C_BOARD_INFO("bma150", 0x38),
    },
#endif
#ifdef CONFIG_MANGO_TOUCH_HX8526_7INCH
/* by crazyboy_edchoi, init mango_cap_touch_ts touch IC */
    {
        I2C_BOARD_INFO("mango_cap_touch_ts", 0x4A),
    .irq            = IRQ_EINT(28),
    },
#endif

#if  defined(CONFIG_MANGO_TOUCH_FT5x06_101INCH) || defined(CONFIG_MANGO_TOUCH_FT5x06_7INCH)
    {
        I2C_BOARD_INFO("s5pc210_ts", 0x40),
        .irq = IRQ_EINT(28),
    },
#endif
};
“drivers/input/touchscreen/Kconfig” 파일에추가

config MANGO_TOUCH_FT5x06_7INCH
    tristate "crztech mango 7 inch 1024x600 FT5x06 PCAP touch "
    depends on INPUT_TOUCHSCREEN
    default n
    help
      Say Y here to enable the driver for the 7" FT5x06 PCAP touchscreen on the Mango board.
      If unsure, say N. To compile this driver as a module, choose M here: the module will be called s3c_ts.

“drivers/input/touchscreen/Makefile”
추가
obj-$(CONFIG_MANGO_TOUCH_FT5x06_7INCH) += mango_ft5x06_ts.o s5pc210_ts_gpio_i2c.o

“drivers/input/touchscreen/mango_ft5x06_ts.c”
파일에서
/* by crazyboy */
#if defined(CONFIG_MANGO_TOUCH_FT5x06_7INCH)
#define FT5x0x_TX_NUM   38 //28
#define FT5x0x_RX_NUM   24 //16
#elif defined(CONFIG_MANGO_TOUCH_FT5x06_101INCH)
#define FT5x0x_TX_NUM   38
#define FT5x0x_RX_NUM   24
#else
#define FT5x0x_TX_NUM   32
#define FT5x0x_RX_NUM   24
#endif

static void ft5x0x_report_value(void)
{
    struct ft5x0x_ts_data *data = i2c_get_clientdata(this_client);
    struct ts_event *event = &data->event;
    int i;
    static int key_pressed = 0;

    MANGO_CAP_TOUCH_DBG1("%s: npoint = %d\n", __func__, event->touch_point);    /* REMOVEIT: by crazyboy */
    for (i  = 0; i < event->touch_point; i++)
    {
#if !defined(CONFIG_MANGO_TOUCH_FT5x06_101INCH) && !defined(CONFIG_MANGO_TOUCH_FT5x06_7INCH)    /* by crazyboy */
        event->au16_x[i] = SCREEN_MAX_X - event->au16_x[i];
        event->au16_y[i] = SCREEN_MAX_Y - event->au16_y[i];
        if (event->au16_x[i] == 1) {
            if (key_pressed)
                break;
            if (event->au16_y[i] == 1) {
                MANGO_CAP_TOUCH_DBG1("%s[MENU]: %d, %d\n", __func__, event->au16_x[i], event->au16_y[i]);
                input_report_key(data->input_dev, KEY_MENU, 1);
                key_pressed = 1;
            } else {
                MANGO_CAP_TOUCH_DBG1("%s[BACK]: %d, %d\n", __func__, event->au16_x[i], event->au16_y[i]);
                input_report_key(data->input_dev, KEY_BACK, 1);
                key_pressed = 2;
            }
            break;
        }
#endif

#if defined(CFG_SUPPORT_TOUCH_KEY) || defined(CONFIG_MANGO_TOUCH_FT5x06_101INCH) || defined(CONFIG_MANGO_TOUCH_FT5x06_7INCH)    /* by crazyboy */
    //setup key code area
    set_bit(EV_SYN, input_dev->evbit);
    set_bit(BTN_TOUCH, input_dev->keybit);
    input_dev->keycode = tsp_keycodes;
    for(i = 0; i < CFG_NUMOFKEYS; i++)
    {
        input_set_capability(input_dev, EV_KEY, ((int*)input_dev->keycode)[i]);
        tsp_keystatus[i] = KEY_RELEASE;
    }
#endif

“drivers/input/touchscreen/mango_ft5x06_ts.h”파일에서

// by crazyboy,
#ifdefined(CONFIG_MANGO_TOUCH_FT5x06_7INCH)
#defineSCREEN_MAX_X    1024
#defineSCREEN_MAX_Y    600
#define PRESS_MAX       255
#elifdefined(CONFIG_MANGO_TOUCH_FT5x06_101INCH)
#define SCREEN_MAX_X    1280  //1024
#define SCREEN_MAX_Y    800  //600
#define PRESS_MAX       255
#else

“drivers/video/logo/Kconfig” 파일에 추가

config LOGO_CRZ_1024_600
        bool "224-color 1024x600 CRZ Linux logo"
        depends on FB_MANGO_7INCH || MANGO_TOUCH_HX8526_7INCH || MANGO_TOUCH_FT5x06_7INCH
        default y

커널 configuration

CONFIG_MANGO_TOUCH_FT5x06_7INCH=y

댓글 없음:

댓글 쓰기