万利达c1014:增加GT8110 触摸驱动和hj101na lcd 驱动

[modifled-files]
arch/arm/mach-rk30/board-rk30-phonepad.c
drivers/input/touchscreen/Kconfig
drivers/input/touchscreen/Makefile
drivers/input/touchscreen/gt8110_ts.c
drivers/video/display/screen/Kconfig
drivers/video/display/screen/Makefile
drivers/video/display/screen/lcd_hj101na.c
include/linux/gt8110.h
This commit is contained in:
wdc 2012-09-24 16:45:22 +08:00
parent b3016dad2f
commit 256b72a787
8 changed files with 2055 additions and 1 deletions

View File

@ -83,6 +83,9 @@
#if defined(CONFIG_ANDROID_TIMED_GPIO)
#include "../../../drivers/staging/android/timed_gpio.h"
#endif
#if defined(CONFIG_TOUCHSCREEN_GT8110)
#include <linux/gt8110.h>
#endif
#if defined(CONFIG_MT6620)
#include <linux/gps.h>
@ -782,6 +785,7 @@ static struct rmi_device_platform_data s3202_platformdata = {
#if defined(CONFIG_TOUCHSCREEN_GT8XX)
#define TOUCH_RESET_PIN RK30_PIN4_PD0
#define TOUCH_PWR_PIN INVALID_GPIO
int goodix_init_platform_hw(void)
{
int ret;
@ -952,6 +956,59 @@ static struct ct360_platform_data ct360_info = {
#endif
#ifdef CONFIG_TOUCHSCREEN_GT8110
#define TOUCH_ENABLE_PIN INVALID_GPIO
#define TOUCH_INT_PIN RK30_PIN4_PC2
#define TOUCH_RESET_PIN RK30_PIN4_PD0
int goodix_init_platform_hw(void)
{
int ret;
rk30_mux_api_set(GPIO4D0_SMCDATA8_TRACEDATA8_NAME, GPIO4D_GPIO4D0);
rk30_mux_api_set(GPIO4C2_SMCDATA2_TRACEDATA2_NAME, GPIO4C_GPIO4C2);
printk("%s:0x%x,0x%x\n",__func__,rk30_mux_api_get(GPIO4D0_SMCDATA8_TRACEDATA8_NAME),rk30_mux_api_get(GPIO4C2_SMCDATA2_TRACEDATA2_NAME));
if (TOUCH_ENABLE_PIN != INVALID_GPIO) {
ret = gpio_request(TOUCH_ENABLE_PIN, "goodix power pin");
if (ret != 0) {
gpio_free(TOUCH_ENABLE_PIN);
printk("goodix power error\n");
return -EIO;
}
gpio_direction_output(TOUCH_ENABLE_PIN, 0);
gpio_set_value(TOUCH_ENABLE_PIN, GPIO_LOW);
msleep(100);
}
if (TOUCH_RESET_PIN != INVALID_GPIO) {
ret = gpio_request(TOUCH_RESET_PIN, "goodix reset pin");
if (ret != 0) {
gpio_free(TOUCH_RESET_PIN);
printk("goodix gpio_request error\n");
return -EIO;
}
gpio_direction_output(TOUCH_RESET_PIN, 0);
//msleep(100);
gpio_set_value(TOUCH_RESET_PIN, GPIO_LOW);
msleep(100);
//gpio_set_value(TOUCH_RESET_PIN, GPIO_HIGH);
//msleep(500);
}
return 0;
}
int goodix_exit_platform_hw(void)
{
return 0;
}
struct goodix_8110_platform_data goodix_info = {
.irq_pin = TOUCH_INT_PIN,
.reset= TOUCH_RESET_PIN,
.hw_init = goodix_init_platform_hw,
.hw_exit = goodix_exit_platform_hw,
};
#endif
static struct spi_board_info board_spi_devices[] = {
};
@ -2503,7 +2560,15 @@ static struct i2c_board_info __initdata i2c2_info[] = {
},
#endif
#if defined(CONFIG_TOUCHSCREEN_GT8110)
{
.type = "Goodix-TS",
.addr = 0x5c,
.flags = 0,
.irq = TOUCH_INT_PIN,
.platform_data = &goodix_info,
},
#endif
};
#endif

View File

@ -999,6 +999,11 @@ config TOUCHSCREEN_GT819
tristate "GT819 based touchscreens"
depends on I2C2_RK29
config TOUCHSCREEN_GT8110
tristate "GT8110 based touchscreens"
depends on I2C2_RK29 || I2C_RK30
config TOUCHSCREEN_CT360_IIC
tristate "CT360 based touchscreens"
depends on I2C_RK29 || I2C_RK30

View File

@ -77,6 +77,7 @@ obj-$(CONFIG_ATMEL_MXT1386) += atmel_mxt1386.o
obj-$(CONFIG_TOUCHSCREEN_GT801_IIC) += gt801_ts.o
obj-$(CONFIG_TOUCHSCREEN_GT82X_IIC) += goodix_touch_82x.o
obj-$(CONFIG_TOUCHSCREEN_GT818_IIC) += gt818_ts.o
obj-$(CONFIG_TOUCHSCREEN_GT8110) += gt8110_ts.o
obj-$(CONFIG_TOUCHSCREEN_CT360_IIC) += ct360_ts.o
obj-$(CONFIG_TOUCHSCREEN_ILI2102_IIC) += ili2102_ts.o
obj-$(CONFIG_D70_L3188A) += goodix_touch.o

File diff suppressed because it is too large Load Diff

View File

@ -96,6 +96,10 @@ config LCD_RK2928_A720
bool "RK2928 A720 panel 800x480"
config LCD_HJ080NA
bool "HJ080NA_4J 1024X768"
config LCD_HJ101NA
bool "HJ101NA_4J 1280X800"
config LCD_HSD07PFW1
depends on MFD_RK610
bool "RGB lcd panel HSD07PFW1"

View File

@ -45,3 +45,4 @@ obj-$(CONFIG_LCD_COMMON) += lcd_common.o
obj-$(CONFIG_LCD_RK2928_A720) += lcd_YQ70CPT9160.o
obj-$(CONFIG_LCD_HSD07PFW1) += lcd_hsd07pfw1.o
obj-$(CONFIG_LCD_HJ080NA) += lcd_hj080na.o
obj-$(CONFIG_LCD_HJ101NA) += lcd_hj101na.o

View File

@ -0,0 +1,106 @@
/*
* This Lcd Driver is for BYD 5' LCD BM800480-8545FTGE.
* written by Michael Lin, 2010-06-18
*/
#include <linux/fb.h>
#include <linux/delay.h>
#include "../../rk29_fb.h"
#include <mach/gpio.h>
#include <mach/iomux.h>
#include <mach/board.h>
#include "screen.h"
/* Base */
#define OUT_TYPE SCREEN_RGB
#define OUT_FACE OUT_P888
#define OUT_CLK 71000000
#define LCDC_ACLK 300000000 //29 lcdc axi DMA ƵÂÊ
/* Timing */
#define H_PW 10
#define H_BP 160
#define H_VD 1280
#define H_FP 16
#define V_PW 3
#define V_BP 23
#define V_VD 800
#define V_FP 12
/* Other */
#define DCLK_POL 0
#define SWAP_RB 0
#define LCD_WIDTH 216 //need modify
#define LCD_HEIGHT 135
static struct rk29lcd_info *gLcd_info = NULL;
#define DRVDelayUs(i) udelay(i*2)
static int init(void);
static int standby(u8 enable);
void set_lcd_info(struct rk29fb_screen *screen, struct rk29lcd_info *lcd_info )
{
/* screen type & face */
screen->type = OUT_TYPE;
screen->face = OUT_FACE;
/* Screen size */
screen->x_res = H_VD;
screen->y_res = V_VD;
screen->width = LCD_WIDTH;
screen->height = LCD_HEIGHT;
/* Timing */
screen->lcdc_aclk = LCDC_ACLK;
screen->pixclock = OUT_CLK;
screen->left_margin = H_BP;
screen->right_margin = H_FP;
screen->hsync_len = H_PW;
screen->upper_margin = V_BP;
screen->lower_margin = V_FP;
screen->vsync_len = V_PW;
/* Pin polarity */
screen->pin_hsync = 0;
screen->pin_vsync = 0;
screen->pin_den = 0;
screen->pin_dclk = DCLK_POL;
/* Swap rule */
screen->swap_rb = SWAP_RB;
screen->swap_rg = 0;
screen->swap_gb = 0;
screen->swap_delta = 0;
screen->swap_dumy = 0;
/* Operation function*/
/*screen->init = init;*/
screen->init = NULL;
screen->standby = standby;
}
static int standby(u8 enable)
{
printk(KERN_INFO "byd1024x600 lcd standby, enable=%d\n", enable);
if (enable)
{
//rockchip_mux_api_set(LED_CON_IOMUX_PINNAME, LED_CON_IOMUX_PINDIR);
//GPIOSetPinDirection(LED_CON_IOPIN,GPIO_OUT);
//GPIOSetPinLevel(LED_CON_IOPIN,GPIO_HIGH);
// gpio_set_value(LCD_DISP_ON_IOPIN, GPIO_LOW);
}
else
{
//rockchip_mux_api_set(LED_CON_IOMUX_PINNAME, 1);
// gpio_set_value(LCD_DISP_ON_IOPIN, GPIO_HIGH);
}
return 0;
}

30
include/linux/gt8110.h Executable file
View File

@ -0,0 +1,30 @@
/*
* Copyright (C) 2010 - 2011 Goodix, Inc.
*
* 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.
*
*/
#ifndef _LINUX_GOODIX_GT8110_TOUCH_H
#define _LINUX_GOODIX_GT8110_TOUCH_H
struct goodix_8110_platform_data {
uint32_t version; /* Use this entry for panels with */
int reset;
int irq_pin;
int power_control;
int mode_check_pin;
int (*hw_init) (void);
int (*hw_exit) (void);
};
#endif /* _LINUX_GOODIX_TOUCH_H */