#include "../../../drivers/video/rockchip/hdmi/rk_hdmi.h"
#endif
+#define TPS65910_HOST_IRQ RK30_PIN6_PA4
+#ifdef CONFIG_TOUCHSCREEN_GT82X_IIC
+#include <linux/goodix_touch_82x.h>
+#endif
+
#if defined(CONFIG_SPIM_RK29)
#include "../../../drivers/spi/rk29_spim.h"
#endif
#else
#define RK30_FB0_MEM_SIZE 8*SZ_1M
#endif
+int PMIC_IS_WM831X = 0;
#ifdef CONFIG_VIDEO_RK29
/*---------------- Camera Sensor Macro Define Begin ------------------------*/
#endif /* CONFIG_VIDEO_RK29 */
+#ifdef CONFIG_TOUCHSCREEN_GT82X_IIC
+#define TOUCH_ENABLE_PIN INVALID_GPIO
+#define TOUCH_RESET_PIN RK30_PIN4_PD0
+#define TOUCH_INT_PIN RK30_PIN4_PC2
+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);
+ gpio_set_value(TOUCH_RESET_PIN, GPIO_LOW);
+ msleep(10);
+ gpio_set_value(TOUCH_RESET_PIN, GPIO_HIGH);
+ msleep(500);
+ }
+ return 0;
+}
+u8 ts82x_config_data[] = {
+ // æ·»å\8a å\9bºä»¶ä¿®æ\94¹å·¥å\85·å\90\8eæ¤æ\95°ç»\84æ\97 æ\95\88ï¼\8cå\8fªç\94¨äº\8eè\8e·å\8f\96æ\95°ç»\84é\95¿åº¦ä½¿ç\94¨
+ 0x65,0x00,0x04,0x00,0x03,0x00,0x0A,0x0D,0x1E,0xE7,
+ 0x32,0x03,0x08,0x10,0x48,0x42,0x42,0x20,0x00,0x01,
+ 0x60,0x60,0x4B,0x6E,0x0E,0x0D,0x0C,0x0B,0x0A,0x09,
+ 0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01,0x00,0x1D,
+ 0x1C,0x1B,0x1A,0x19,0x18,0x17,0x16,0x15,0x14,0x13,
+ 0x12,0x11,0x10,0x0F,0x50,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2B,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00
+};
+static struct goodix_i2c_rmi_platform_data ts82x_pdata = {
+ .gpio_shutdown = TOUCH_ENABLE_PIN,
+ .gpio_irq = TOUCH_INT_PIN,
+ .gpio_reset = TOUCH_RESET_PIN,
+ .irq_edge = 1, /* 0:rising edge, 1:falling edge */
+
+ .ypol = 1,
+ .swap_xy = 1,
+ .xpol = 0,
+ .xmax = 1024,
+ .ymax = 600,
+ .config_info_len =ARRAY_SIZE(ts82x_config_data),
+ .config_info = ts82x_config_data,
+ .init_platform_hw= goodix_init_platform_hw,
+};
+#endif
+
#if defined(CONFIG_TOUCHSCREEN_GT8XX)
#define TOUCH_RESET_PIN RK30_PIN4_PD0
#define TOUCH_PWR_PIN INVALID_GPIO
static int rk29_backlight_io_init(void)
{
int ret = 0;
+ rk30_mux_api_set(GPIO0D6_PWM2_NAME, GPIO0D_GPIO0D6);
+ gpio_request(RK30_PIN0_PD6, NULL);
+ gpio_direction_output(RK30_PIN0_PD6, GPIO_HIGH);
+
+ //rk30_mux_api_set(GPIO0D6_PWM2_NAME, GPIO0D_PWM2);
rk30_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE);
#ifdef LCD_DISP_ON_PIN
// rk30_mux_api_set(BL_EN_MUX_NAME, BL_EN_MUX_MODE);
gpio_free(BL_EN_PIN);
}
- gpio_direction_output(BL_EN_PIN, 0);
+ gpio_direction_output(BL_EN_PIN, BL_EN_VALUE);
gpio_set_value(BL_EN_PIN, BL_EN_VALUE);
#endif
return ret;
},
};
#endif
+#if CONFIG_RK30_PWM_REGULATOR
+struct pwm_platform_data {
+ int pwm_id;
+ int pwm_gpio;
+ //char pwm_iomux_name[50];
+ char* pwm_iomux_name;
+ unsigned int pwm_iomux_pwm;
+ int pwm_iomux_gpio;
+ int pwm_voltage;
+ struct regulator_init_data *init_data;
+};
+
+static struct regulator_consumer_supply pwm_dcdc1_consumers[] = {
+ {
+ .supply = "vdd_core",
+ }
+};
+
+struct regulator_init_data pwm_regulator_init_dcdc[1] =
+{
+ {
+ .constraints = {
+ .name = "PWM_DCDC1",
+ .min_uV = 600000,
+ .max_uV = 1800000, //0.6-1.8V
+ .apply_uV = true,
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(pwm_dcdc1_consumers),
+ .consumer_supplies = pwm_dcdc1_consumers,
+ },
+};
+
+static struct pwm_platform_data pwm_regulator_info[1] = {
+ {
+ .pwm_id = 3,
+ .pwm_gpio = RK30_PIN0_PD7,
+ .pwm_iomux_name = GPIO0D7_PWM3_NAME,
+ .pwm_iomux_pwm = GPIO0D_PWM3,
+ .pwm_iomux_gpio = GPIO0D_GPIO0D6,
+ .pwm_voltage = 1100000,
+ .init_data = &pwm_regulator_init_dcdc[0],
+ },
+};
+
+struct platform_device pwm_regulator_device[1] = {
+ {
+ .name = "pwm-voltage-regulator",
+ .id = 0,
+ .dev = {
+ .platform_data = &pwm_regulator_info[0],
+ }
+ },
+};
+#endif
#ifdef CONFIG_RK29_VMAC
#define PHY_PWR_EN_GPIO RK30_PIN1_PD6
#endif
#ifdef CONFIG_I2C1_RK30
+#ifdef CONFIG_MFD_WM831X_I2C
#include "board-rk30-sdk-wm8326.c"
+#endif
+#ifdef CONFIG_MFD_TPS65910
+#include "board-rk30-sdk-tps65910.c"
+#endif
static struct i2c_board_info __initdata i2c1_info[] = {
#if defined (CONFIG_MFD_WM831X_I2C)
.platform_data = &wm831x_platdata,
},
#endif
+#if defined (CONFIG_MFD_TPS65910)
+ {
+ .type = "tps659102",
+ .addr = TPS65910_I2C_ID0,
+ .flags = 0,
+ .irq = TPS65910_HOST_IRQ,
+ .platform_data = &tps65910_data,
+ },
+#endif
};
#endif
.platform_data = &goodix_info,
},
#endif
+#if defined(CONFIG_TOUCHSCREEN_GT82X_IIC)
+ {
+ .type = "Goodix-TS-82X",
+ .addr = 0x5D,
+ .flags = 0,
+ .irq = RK30_PIN4_PC2,
+ .platform_data = &ts82x_pdata,
+ },
+#endif
#if defined (CONFIG_LS_CM3217)
{
.type = "lightsensor",
}
//end of i2c
+static void dcr_en_low(void)
+{
+ int ret;
+ ret=gpio_request(RK30_PIN4_PB7,"dcr_en");
+ if(ret<0){
+ printk("dcr_en_low request io error");
+ gpio_free(RK30_PIN4_PB7);
+ return;
+ }
+ gpio_direction_output(RK30_PIN4_PB7, GPIO_LOW);
+}
+
#define POWER_ON_PIN RK30_PIN6_PB0 //power_hold
-static void rk30_pm_power_off(void)
+void rk30_pm_power_off(void)
{
+ int pwr_cnt;
+
printk(KERN_ERR "rk30_pm_power_off start...\n");
- gpio_direction_output(POWER_ON_PIN, GPIO_LOW);
+
+#if 0
+ //²å×ųäµçÆ÷£¬Ñ»·²»¿ª»ú£¬Ö±µ½°´POWER¼ü»òÕ߰εô³äµçÆ÷
+ if(gpio_get_value (rk30_adc_battery_platdata.dc_det_pin) == rk30_adc_battery_platdata.dc_det_level){
+ pwr_cnt=0;
+ while(1){
+ if(gpio_get_value (rk30_adc_battery_platdata.dc_det_pin) != rk30_adc_battery_platdata.dc_det_level){
+ break;
+ }
+ if((gpio_get_value(RK30_PIN6_PA2)==GPIO_LOW)){
+ if(pwr_cnt++>40)
+ break;
+ }else{
+ //printk("0\n");
+ pwr_cnt=0;
+ }
+ mdelay(50);
+ }
+ arm_pm_restart(0, NULL);
+ }
+#endif
+#if PMIC_IS_WM831X
#if defined(CONFIG_MFD_WM831X)
wm831x_set_bits(Wm831x,WM831X_GPIO_LEVEL,0x0001,0x0000); //set sys_pwr 0
wm831x_device_shutdown(Wm831x);//wm8326 shutdown
#endif
- while (1);
+#else
+#if defined(CONFIG_MFD_TPS65910)
+ tps65910_device_shutdown();//tps65910 shutdown
+#endif
+#endif
+ gpio_direction_output(POWER_ON_PIN, GPIO_LOW);
+ while(1);
}
-
+EXPORT_SYMBOL_GPL(rk30_pm_power_off);
static void __init machine_rk30_board_init(void)
{
avs_init();
#ifdef CONFIG_WIFI_CONTROL_FUNC
rk29sdk_wifi_bt_gpio_control_init();
#endif
+ dcr_en_low();
}
static void __init rk30_reserve(void)
*/
static struct dvfs_arm_table dvfs_cpu_logic_table[] = {
{.frequency = 252 * 1000, .cpu_volt = 1075 * 1000, .logic_volt = 1125 * 1000},//0.975V/1.000V
- {.frequency = 504 * 1000, .cpu_volt = 1100 * 1000, .logic_volt = 1125 * 1000},//0.975V/1.000V
- {.frequency = 816 * 1000, .cpu_volt = 1125 * 1000, .logic_volt = 1150 * 1000},//1.000V/1.025V
+ {.frequency = 504 * 1000, .cpu_volt = 1075 * 1000, .logic_volt = 1125* 1000},//0.975V/1.000V
+ {.frequency = 816 * 1000, .cpu_volt = 1100 * 1000, .logic_volt = 1150 * 1000},//1.000V/1.025V
{.frequency = 1008 * 1000, .cpu_volt = 1125 * 1000, .logic_volt = 1150 * 1000},//1.025V/1.050V
{.frequency = 1200 * 1000, .cpu_volt = 1175 * 1000, .logic_volt = 1200 * 1000},//1.100V/1.050V
- {.frequency = 1272 * 1000, .cpu_volt = 1225 * 1000, .logic_volt = 1200 * 1000},//1.150V/1.100V
- {.frequency = 1416 * 1000, .cpu_volt = 1300 * 1000, .logic_volt = 1200 * 1000},//1.225V/1.100V
- {.frequency = 1512 * 1000, .cpu_volt = 1350 * 1000, .logic_volt = 1250 * 1000},//1.300V/1.150V
- {.frequency = 1608 * 1000, .cpu_volt = 1425 * 1000, .logic_volt = 1300 * 1000},//1.325V/1.175V
+ //{.frequency = 1272 * 1000, .cpu_volt = 1225 * 1000, .logic_volt = 1200 * 1000},//1.150V/1.100V
+ //{.frequency = 1416 * 1000, .cpu_volt = 1300 * 1000, .logic_volt = 1200 * 1000},//1.225V/1.100V
+ //{.frequency = 1512 * 1000, .cpu_volt = 1350 * 1000, .logic_volt = 1250 * 1000},//1.300V/1.150V
+ //{.frequency = 1608 * 1000, .cpu_volt = 1375 * 1000, .logic_volt = 1275 * 1000},//1.325V/1.175V
{.frequency = CPUFREQ_TABLE_END},
};
--- /dev/null
+/*
+ *
+ * Copyright (C) 2011 Goodix, Inc.
+ *
+ * Author: Scott
+ * Date: 2012.01.05
+ */
+
+#ifndef _LINUX_GOODIX_TOUCH_H
+#define _LINUX_GOODIX_TOUCH_H
+
+#include <linux/earlysuspend.h>
+#include <linux/hrtimer.h>
+#include <linux/i2c.h>
+#include <linux/input.h>
+
+#define fail 0
+#define success 1
+
+#define false 0
+#define true 1
+
+#define FLAG_UP 0
+#define FLAG_DOWN 1
+
+#define RELEASE_DATE "2012-02-07"
+
+#define GOODIX_I2C_NAME "Goodix-TS-82X"
+#define GOODIX_I2C_ADDR 0X5D
+
+#if 1
+#define GTDEBUG(fmt, arg...) printk("<--GT-DEBUG-->"fmt, ##arg)
+#else
+#define DEBUG(fmt, arg...)
+#endif
+
+#if 1
+#define GTNOTICE(fmt, arg...) printk("<--GT-NOTICE-->"fmt, ##arg)
+#else
+#define NOTICE(fmt, arg...)
+#endif
+
+#if 1
+#define GTWARNING(fmt, arg...) printk("<--GT-WARNING-->"fmt, ##arg)
+#else
+#define WARNING(fmt, arg...)
+#endif
+
+#if 1
+#define GTDEBUG_MSG(fmt, arg...) printk("<--GT msg-->"fmt, ##arg)
+#else
+#define DEBUG_MSG(fmt, arg...)
+#endif
+
+#if 1
+#define GTDEBUG_UPDATE(fmt, arg...) printk("<--GT update-->"fmt, ##arg)
+#else
+#define DEBUG_UPDATE(fmt, arg...)
+#endif
+
+#if 0 //w++
+#define GTDEBUG_COOR(fmt, arg...) printk(fmt, ##arg)
+#define GTDEBUG_COORD
+#else
+#define GTDEBUG_COOR(fmt, arg...)
+#define DEBUG_COOR(fmt, arg...)
+#endif
+
+#if 1
+#define GTDEBUG_ARRAY(array, num) do{\
+ int i;\
+ u8* a = array;\
+ for (i = 0; i < (num); i++)\
+ {\
+ printk("%02x ", (a)[i]);\
+ if ((i + 1 ) %10 == 0)\
+ {\
+ printk("\n");\
+ }\
+ }\
+ printk("\n");\
+ }while(0)
+#else
+#define DEBUG_ARRAY(array, num)
+#endif
+
+#define ADDR_MAX_LENGTH 2
+#define ADDR_LENGTH ADDR_MAX_LENGTH
+
+//#define CREATE_WR_NODE
+//#define AUTO_UPDATE_GUITAR //Èç¹û¶¨ÒåÁËÔòÉϵç»á×Ô¶¯ÅжÏÊÇ·ñÐèÒªÉý¼¶
+
+//--------------------------For user redefine-----------------------------//
+//-------------------------GPIO REDEFINE START----------------------------//
+#define GPIO_DIRECTION_INPUT(port) gpio_direction_input(port)
+#define GPIO_DIRECTION_OUTPUT(port, val) gpio_direction_output(port, val)
+#define GPIO_SET_VALUE(port, val) gpio_set_value(port, val)
+#define GPIO_FREE(port) gpio_free(port)
+#define GPIO_REQUEST(port, name) gpio_request(port, name)
+#define GPIO_PULL_UPDOWN(port, val) gpio_pull_updown(port,val) // s3c_gpio_setpull(port, val)
+#define GPIO_CFG_PIN(port, cfg) //s3c_gpio_cfgpin(port, cfg)
+//-------------------------GPIO REDEFINE END------------------------------//
+
+
+//*************************TouchScreen Work Part Start**************************
+
+#define RESET_PORT S3C64XX_GPF(3) //RESET¹Ü½ÅºÅ
+#define INT_PORT S3C64XX_GPL(10) //Int IO port
+#ifdef INT_PORT
+ #define TS_INT gpio_to_irq(INT_PORT) //Interrupt Number,EINT18(119)
+ #define INT_CFG S3C_GPIO_SFN(3) //IO configer as EINT
+#else
+ #define TS_INT 0
+#endif
+
+
+#define GT_IRQ_RISING IRQ_TYPE_EDGE_RISING
+#define GT_IRQ_FALLING IRQ_TYPE_EDGE_FALLING
+#define INT_TRIGGER GT_IRQ_FALLING
+#define POLL_TIME 10 //actual query spacing interval:POLL_TIME+6
+
+#define GOODIX_MULTI_TOUCH
+#ifdef GOODIX_MULTI_TOUCH
+ #define MAX_FINGER_NUM 5
+#else
+ #define MAX_FINGER_NUM 1
+#endif
+
+#define gtswap(x, y) do { typeof(x) z = x; x = y; y = z; } while (0)
+
+struct goodix_i2c_rmi_platform_data {
+ /* u8 bad_data;
+ u8 irq_is_disable;
+ u16 addr;
+ s32 use_reset; //use RESET flag
+ s32 use_irq; //use EINT flag
+ u32 version;
+ s32 (*power)(struct goodix_ts_data * ts, s32 on);
+ struct i2c_client *client;
+ struct input_dev *input_dev;
+ struct hrtimer timer;
+ struct work_struct work;
+ struct early_suspend early_suspend;
+ s8 phys[32];
+*/
+ uint32_t version; /* Use this entry for panels with */
+ unsigned gpio_shutdown;
+ unsigned gpio_irq;
+ unsigned gpio_reset;
+ bool irq_edge; /* 0:rising edge, 1:falling edge */
+ bool swap_xy;
+ bool xpol;
+ bool ypol;
+ int xmax;
+ int ymax;
+ int config_info_len;
+ u8 *config_info;
+ int (*init_platform_hw)(void);
+
+};
+//*************************TouchScreen Work Part End****************************
+
+#endif /* _LINUX_GOODIX_TOUCH_H */