#include <media/soc_camera.h> /* ddl@rock-chips.com : camera support */
#include <mach/vpu_mem.h>
#include <mach/sram.h>
+#include <mach/ddr.h>
+#include <mach/cpufreq.h>
+#include <mach/rk29_smc.h>
#include <linux/regulator/rk29-pwm-regulator.h>
#include <linux/regulator/machine.h>
+#include <linux/regulator/act8891.h>
+
#include <linux/mtd/nand.h>
#include <linux/mtd/partitions.h>
+#include <linux/i2c-gpio.h>
#include "devices.h"
#include "../../../drivers/input/touchscreen/xpt2046_cbn_ts.h"
+#ifdef CONFIG_BU92747GUW_CIR
+#include "../../../drivers/cir/bu92747guw_cir.h"
+#endif
+#ifdef CONFIG_VIDEO_RK29
+/*---------------- Camera Sensor Macro Define Begin ------------------------*/
+/*---------------- Camera Sensor Configuration Macro Begin ------------------------*/
+#define CONFIG_SENSOR_0 RK29_CAM_SENSOR_OV5642 /* back camera sensor */
+#define CONFIG_SENSOR_IIC_ADDR_0 0x78
+#define CONFIG_SENSOR_IIC_ADAPTER_ID_0 1
+#define CONFIG_SENSOR_POWER_PIN_0 INVALID_GPIO
+#define CONFIG_SENSOR_RESET_PIN_0 INVALID_GPIO
+#define CONFIG_SENSOR_POWERDN_PIN_0 RK29_PIN6_PB7
+#define CONFIG_SENSOR_FALSH_PIN_0 INVALID_GPIO
+#define CONFIG_SENSOR_POWERACTIVE_LEVEL_0 RK29_CAM_POWERACTIVE_L
+#define CONFIG_SENSOR_RESETACTIVE_LEVEL_0 RK29_CAM_RESETACTIVE_L
+#define CONFIG_SENSOR_POWERDNACTIVE_LEVEL_0 RK29_CAM_POWERDNACTIVE_H
+#define CONFIG_SENSOR_FLASHACTIVE_LEVEL_0 RK29_CAM_FLASHACTIVE_L
+
+#define CONFIG_SENSOR_1 RK29_CAM_SENSOR_OV2659 /* front camera sensor */
+#define CONFIG_SENSOR_IIC_ADDR_1 0x60
+#define CONFIG_SENSOR_IIC_ADAPTER_ID_1 1
+#define CONFIG_SENSOR_POWER_PIN_1 INVALID_GPIO
+#define CONFIG_SENSOR_RESET_PIN_1 INVALID_GPIO
+#define CONFIG_SENSOR_POWERDN_PIN_1 RK29_PIN5_PD7
+#define CONFIG_SENSOR_FALSH_PIN_1 INVALID_GPIO
+#define CONFIG_SENSOR_POWERACTIVE_LEVEL_1 RK29_CAM_POWERACTIVE_L
+#define CONFIG_SENSOR_RESETACTIVE_LEVEL_1 RK29_CAM_RESETACTIVE_L
+#define CONFIG_SENSOR_POWERDNACTIVE_LEVEL_1 RK29_CAM_POWERDNACTIVE_H
+#define CONFIG_SENSOR_FLASHACTIVE_LEVEL_1 RK29_CAM_FLASHACTIVE_L
+#endif //#ifdef CONFIG_VIDEO_RK29
+/*---------------- Camera Sensor Configuration Macro End------------------------*/
+#include "../../../drivers/media/video/rk29_camera.c"
+/*---------------- Camera Sensor Macro Define End ------------------------*/
+
/* Set memory size of pmem */
#ifdef CONFIG_RK29_MEM_SIZE_M
#else
#define SDRAM_SIZE SZ_512M
#endif
-#define PMEM_GPU_SIZE SZ_64M
-#define PMEM_UI_SIZE SZ_32M
+#define PMEM_GPU_SIZE SZ_16M
+#define PMEM_UI_SIZE (48 * SZ_1M) /* 1280x800: 64M 1024x768: 48M ... */
#define PMEM_VPU_SIZE SZ_64M
-#define PMEM_CAM_SIZE 0x01300000
+#define PMEM_SKYPE_SIZE 0
+#define PMEM_CAM_SIZE PMEM_CAM_NECESSARY
#ifdef CONFIG_VIDEO_RK29_WORK_IPP
#define MEM_CAMIPP_SIZE SZ_4M
#else
#define MEM_CAMIPP_SIZE 0
#endif
-#define MEM_FB_SIZE (3*SZ_2M)
+#define MEM_FB_SIZE (9*SZ_1M)
#ifdef CONFIG_FB_WORK_IPP
#define MEM_FBIPP_SIZE SZ_8M //1920 x 1080 x 2 x 2 //RGB565 = x2;RGB888 = x4
#else
#define MEM_FBIPP_SIZE 0
#endif
-#define PMEM_GPU_BASE ((u32)RK29_SDRAM_PHYS + SDRAM_SIZE - PMEM_GPU_SIZE)
+#if SDRAM_SIZE > SZ_512M
+#define PMEM_GPU_BASE (RK29_SDRAM_PHYS + SZ_512M - PMEM_GPU_SIZE)
+#else
+#define PMEM_GPU_BASE (RK29_SDRAM_PHYS + SDRAM_SIZE - PMEM_GPU_SIZE)
+#endif
#define PMEM_UI_BASE (PMEM_GPU_BASE - PMEM_UI_SIZE)
#define PMEM_VPU_BASE (PMEM_UI_BASE - PMEM_VPU_SIZE)
#define PMEM_CAM_BASE (PMEM_VPU_BASE - PMEM_CAM_SIZE)
#define MEM_CAMIPP_BASE (PMEM_CAM_BASE - MEM_CAMIPP_SIZE)
#define MEM_FB_BASE (MEM_CAMIPP_BASE - MEM_FB_SIZE)
#define MEM_FBIPP_BASE (MEM_FB_BASE - MEM_FBIPP_SIZE)
-#define LINUX_SIZE (MEM_FBIPP_BASE - RK29_SDRAM_PHYS)
+#define PMEM_SKYPE_BASE (MEM_FBIPP_BASE - PMEM_SKYPE_SIZE)
+#define LINUX_SIZE (PMEM_SKYPE_BASE - RK29_SDRAM_PHYS)
#define PREALLOC_WLAN_SEC_NUM 4
#define PREALLOC_WLAN_BUF_NUM 160
.io_init = rk29_nand_io_init,
};
+#define TOUCH_SCREEN_STANDBY_PIN RK29_PIN6_PD1
+#define TOUCH_SCREEN_STANDBY_VALUE GPIO_HIGH
+#define TOUCH_SCREEN_DISPLAY_PIN INVALID_GPIO
+#define TOUCH_SCREEN_DISPLAY_VALUE GPIO_HIGH
+
#ifdef CONFIG_FB_RK29
/*****************************************************************************************
* lcd devices
* author: zyw@rock-chips.com
*****************************************************************************************/
#define FB_ID 0
-#define FB_DISPLAY_ON_PIN RK29_PIN6_PD0
+#define FB_DISPLAY_ON_PIN INVALID_GPIO// RK29_PIN6_PD0
#define FB_LCD_STANDBY_PIN INVALID_GPIO
#define FB_LCD_CABC_EN_PIN RK29_PIN6_PD2
#define FB_MCU_FMK_PIN INVALID_GPIO
#define FB_DISPLAY_ON_VALUE GPIO_HIGH
#define FB_LCD_STANDBY_VALUE GPIO_HIGH
-//#endif
-/*****************************************************************************************
-* touch screen devices
-* author: cf@rock-chips.com
-*****************************************************************************************/
-#define TOUCH_SCREEN_STANDBY_PIN RK29_PIN6_PD1
-#define TOUCH_SCREEN_STANDBY_VALUE GPIO_HIGH
-#define TOUCH_SCREEN_DISPLAY_PIN INVALID_GPIO
-#define TOUCH_SCREEN_DISPLAY_VALUE GPIO_HIGH
-
static int rk29_lcd_io_init(void)
{
int ret = 0;
.io_deinit = rk29_lcd_io_deinit,
};
+int rk29_fb_io_enable(void)
+{
+ if(FB_DISPLAY_ON_PIN != INVALID_GPIO)
+ {
+ gpio_direction_output(FB_DISPLAY_ON_PIN, 0);
+ gpio_set_value(FB_DISPLAY_ON_PIN, FB_DISPLAY_ON_VALUE);
+ }
+ if(FB_LCD_STANDBY_PIN != INVALID_GPIO)
+ {
+ gpio_direction_output(FB_LCD_STANDBY_PIN, 0);
+ gpio_set_value(FB_LCD_STANDBY_PIN, FB_LCD_STANDBY_VALUE);
+ }
+ return 0;
+}
+
+int rk29_fb_io_disable(void)
+{
+ if(FB_DISPLAY_ON_PIN != INVALID_GPIO)
+ {
+ gpio_direction_output(FB_DISPLAY_ON_PIN, 0);
+ gpio_set_value(FB_DISPLAY_ON_PIN, !FB_DISPLAY_ON_VALUE);
+ }
+ if(FB_LCD_STANDBY_PIN != INVALID_GPIO)
+ {
+ gpio_direction_output(FB_LCD_STANDBY_PIN, 0);
+ gpio_set_value(FB_LCD_STANDBY_PIN, !FB_LCD_STANDBY_VALUE);
+ }
+ return 0;
+}
static int rk29_fb_io_init(struct rk29_fb_setting_info *fb_setting)
{
printk(">>>>>> FB_DISPLAY_ON_PIN gpio_request err \n ");
}
}
- else
+ else if (TOUCH_SCREEN_DISPLAY_PIN != INVALID_GPIO)
{
ret = gpio_request(TOUCH_SCREEN_DISPLAY_PIN, NULL);
if(ret != 0)
printk(">>>>>> FB_LCD_STANDBY_PIN gpio_request err \n ");
}
}
- else
+ else if (TOUCH_SCREEN_STANDBY_PIN != INVALID_GPIO)
{
ret = gpio_request(TOUCH_SCREEN_STANDBY_PIN, NULL);
if(ret != 0)
gpio_direction_output(FB_LCD_CABC_EN_PIN, 0);
gpio_set_value(FB_LCD_CABC_EN_PIN, GPIO_LOW);
}
+
+ rk29_fb_io_enable(); //enable it
return ret;
}
+
static struct rk29fb_info rk29_fb_info = {
.fb_id = FB_ID,
- .disp_on_pin = FB_DISPLAY_ON_PIN,
- .disp_on_value = FB_DISPLAY_ON_VALUE,
- .standby_pin = FB_LCD_STANDBY_PIN,
- .standby_value = FB_LCD_STANDBY_VALUE,
.mcu_fmk_pin = FB_MCU_FMK_PIN,
.lcd_info = &rk29_lcd_info,
.io_init = rk29_fb_io_init,
+ .io_enable = rk29_fb_io_enable,
+ .io_disable = rk29_fb_io_disable,
};
/* rk29 fb resource */
#endif
+#if defined(CONFIG_RK29_GPIO_SUSPEND)
+void key_gpio_pullupdown_enable(void)
+{ gpio_pull_updown(RK29_PIN6_PA0, 0);
+ gpio_pull_updown(RK29_PIN6_PA1, 0);
+ gpio_pull_updown(RK29_PIN6_PA2, 0);
+ gpio_pull_updown(RK29_PIN6_PA3, 0);
+ gpio_pull_updown(RK29_PIN6_PA4, 0);
+ gpio_pull_updown(RK29_PIN6_PA5, 0);
+ gpio_pull_updown(RK29_PIN6_PA6, 0);
+
+}
+void key_gpio_pullupdown_disable(void)
+{
+ gpio_pull_updown(RK29_PIN6_PA0, 1);
+ gpio_pull_updown(RK29_PIN6_PA1, 1);
+ gpio_pull_updown(RK29_PIN6_PA2, 1);
+ gpio_pull_updown(RK29_PIN6_PA3, 1);
+ gpio_pull_updown(RK29_PIN6_PA4, 1);
+ gpio_pull_updown(RK29_PIN6_PA5, 1);
+ gpio_pull_updown(RK29_PIN6_PA6, 1);
+}
+void rk29_setgpio_suspend_board(void)
+{
+
+ key_gpio_pullupdown_enable();
+
+}
+
+void rk29_setgpio_resume_board(void)
+{
+
+ key_gpio_pullupdown_disable();
+
+ }
+#else
+void rk29_setgpio_suspend_board(void)
+{}
+void rk29_setgpio_resume_board(void)
+{}
+#endif
+
+#if defined(CONFIG_RK_IRDA) || defined(CONFIG_BU92747GUW_CIR)
+#define BU92747GUW_RESET_PIN RK29_PIN3_PD4// INVALID_GPIO //
+#define BU92747GUW_RESET_MUX_NAME GPIO3D4_HOSTWRN_NAME//NULL //
+#define BU92747GUW_RESET_MUX_MODE GPIO3H_GPIO3D4//NULL //
+
+#define BU92747GUW_PWDN_PIN RK29_PIN3_PD3//RK29_PIN5_PA7 //
+#define BU92747GUW_PWDN_MUX_NAME GPIO3D3_HOSTRDN_NAME//GPIO5A7_HSADCDATA2_NAME //
+#define BU92747GUW_PWDN_MUX_MODE GPIO3H_GPIO3D3//GPIO5L_GPIO5A7 //
+
+static int bu92747guw_io_init(void)
+{
+ int ret;
+
+ //reset pin
+ if(BU92747GUW_RESET_MUX_NAME != NULL)
+ {
+ rk29_mux_api_set(BU92747GUW_RESET_MUX_NAME, BU92747GUW_RESET_MUX_MODE);
+ }
+ ret = gpio_request(BU92747GUW_RESET_PIN, NULL);
+ if(ret != 0)
+ {
+ gpio_free(BU92747GUW_RESET_PIN);
+ printk(">>>>>> BU92747GUW_RESET_PIN gpio_request err \n ");
+ }
+ gpio_direction_output(BU92747GUW_RESET_PIN, GPIO_HIGH);
+
+ //power down pin
+ if(BU92747GUW_PWDN_MUX_NAME != NULL)
+ {
+ rk29_mux_api_set(BU92747GUW_PWDN_MUX_NAME, BU92747GUW_PWDN_MUX_MODE);
+ }
+ ret = gpio_request(BU92747GUW_PWDN_PIN, NULL);
+ if(ret != 0)
+ {
+ gpio_free(BU92747GUW_PWDN_PIN);
+ printk(">>>>>> BU92747GUW_PWDN_PIN gpio_request err \n ");
+ }
+
+ //power down as default
+ gpio_direction_output(BU92747GUW_PWDN_PIN, GPIO_LOW);
+
+ return 0;
+}
+
+
+static int bu92747guw_io_deinit(void)
+{
+ gpio_free(BU92747GUW_PWDN_PIN);
+ gpio_free(BU92747GUW_RESET_PIN);
+ return 0;
+}
+
+//power ctl func is share with irda and remote
+static int nPowerOnCount = 0;
+static DEFINE_MUTEX(bu92747_power_mutex);
+
+//1---power on; 0---power off
+static int bu92747guw_power_ctl(int enable)
+{
+ printk("%s \n",__FUNCTION__);
+
+ mutex_lock(&bu92747_power_mutex);
+ if (enable) {
+ nPowerOnCount++;
+ if (nPowerOnCount == 1) {//power on first
+ //smc0_init(NULL);
+ gpio_set_value(BU92747GUW_PWDN_PIN, GPIO_HIGH);
+ gpio_set_value(BU92747GUW_RESET_PIN, GPIO_LOW);
+ mdelay(5);
+ gpio_set_value(BU92747GUW_RESET_PIN, GPIO_HIGH);
+ mdelay(5);
+ }
+ }
+ else {
+ nPowerOnCount--;
+ if (nPowerOnCount <= 0) {//power down final
+ nPowerOnCount = 0;
+ //smc0_exit();
+ gpio_set_value(BU92747GUW_PWDN_PIN, GPIO_LOW);
+ }
+ }
+ mutex_unlock(&bu92747_power_mutex);
+ return 0;
+}
+#endif
+
+#ifdef CONFIG_RK_IRDA
+#define IRDA_IRQ_PIN RK29_PIN5_PB2
+#define IRDA_IRQ_MUX_NAME GPIO5B2_HSADCDATA5_NAME
+#define IRDA_IRQ_MUX_MODE GPIO5L_GPIO5B2
+
+int irda_iomux_init(void)
+{
+ int ret = 0;
+
+ //irda irq pin
+ if(IRDA_IRQ_MUX_NAME != NULL)
+ {
+ rk29_mux_api_set(IRDA_IRQ_MUX_NAME, IRDA_IRQ_MUX_MODE);
+ }
+ ret = gpio_request(IRDA_IRQ_PIN, NULL);
+ if(ret != 0)
+ {
+ gpio_free(IRDA_IRQ_PIN);
+ printk(">>>>>> IRDA_IRQ_PIN gpio_request err \n ");
+ }
+ gpio_pull_updown(IRDA_IRQ_PIN, GPIO_HIGH);
+ gpio_direction_input(IRDA_IRQ_PIN);
+
+ return 0;
+}
+
+int irda_iomux_deinit(void)
+{
+ gpio_free(IRDA_IRQ_PIN);
+ return 0;
+}
+
+static struct irda_info rk29_irda_info = {
+ .intr_pin = IRDA_IRQ_PIN,
+ .iomux_init = irda_iomux_init,
+ .iomux_deinit = irda_iomux_deinit,
+ .irda_pwr_ctl = bu92747guw_power_ctl,
+};
+
+static struct platform_device irda_device = {
+#ifdef CONFIG_RK_IRDA_NET
+ .name = "rk_irda",
+#else
+ .name = "bu92747_irda",
+#endif
+ .id = -1,
+ .dev = {
+ .platform_data = &rk29_irda_info,
+ }
+};
+#endif
+
+#ifdef CONFIG_BU92747GUW_CIR
+#define BU92747_CIR_IRQ_PIN RK29_PIN5_PB0
+#define CIR_IRQ_PIN_IOMUX_NAME GPIO5B0_HSADCDATA3_NAME
+#define CIR_IRQ_PIN_IOMUX_VALUE GPIO5L_GPIO5B0
+static int cir_iomux_init(void)
+{
+ if (CIR_IRQ_PIN_IOMUX_NAME)
+ rk29_mux_api_set(CIR_IRQ_PIN_IOMUX_NAME, CIR_IRQ_PIN_IOMUX_VALUE);
+ rk29_mux_api_set(GPIO5A7_HSADCDATA2_NAME, GPIO5L_GPIO5A7);
+ return 0;
+}
+
+static struct bu92747guw_platform_data bu92747guw_pdata = {
+ .intr_pin = BU92747_CIR_IRQ_PIN,
+ .iomux_init = cir_iomux_init,
+ .iomux_deinit = NULL,
+ .cir_pwr_ctl = bu92747guw_power_ctl,
+};
+#endif
+#ifdef CONFIG_RK29_NEWTON
+struct rk29_newton_data rk29_newton_info = {
+};
+struct platform_device rk29_device_newton = {
+ .name = "rk29_newton",
+ .id = -1,
+ .dev = {
+ .platform_data = &rk29_newton_info,
+ }
+ };
+#endif
+#if defined (CONFIG_TOUCHSCREEN_FT5406)
+#define TOUCH_RESET_PIN RK29_PIN6_PC3
+#define TOUCH_INT_PIN RK29_PIN0_PA2
+int ft5406_init_platform_hw(void)
+{
+ printk("ft5406_init_platform_hw\n");
+ if(gpio_request(TOUCH_RESET_PIN,NULL) != 0){
+ gpio_free(TOUCH_RESET_PIN);
+ printk("ft5406_init_platform_hw gpio_request error\n");
+ return -EIO;
+ }
+
+ if(gpio_request(TOUCH_INT_PIN,NULL) != 0){
+ gpio_free(TOUCH_INT_PIN);
+ printk("ift5406_init_platform_hw gpio_request error\n");
+ return -EIO;
+ }
+
+ gpio_direction_output(TOUCH_RESET_PIN, 0);
+ gpio_set_value(TOUCH_RESET_PIN,GPIO_LOW);
+ mdelay(10);
+ gpio_direction_input(TOUCH_INT_PIN);
+ mdelay(10);
+ gpio_set_value(TOUCH_RESET_PIN,GPIO_HIGH);
+ msleep(300);
+ return 0;
+}
+
+void ft5406_exit_platform_hw(void)
+{
+ printk("ft5406_exit_platform_hw\n");
+ gpio_free(TOUCH_RESET_PIN);
+ gpio_free(TOUCH_INT_PIN);
+}
+
+int ft5406_platform_sleep(void)
+{
+ printk("ft5406_platform_sleep\n");
+ gpio_set_value(TOUCH_RESET_PIN,GPIO_LOW);
+ return 0;
+}
+
+int ft5406_platform_wakeup(void)
+{
+ printk("ft5406_platform_wakeup\n");
+ gpio_set_value(TOUCH_RESET_PIN,GPIO_HIGH);
+ msleep(300);
+ return 0;
+}
+
+struct ft5406_platform_data ft5406_info = {
+
+ .init_platform_hw= ft5406_init_platform_hw,
+ .exit_platform_hw= ft5406_exit_platform_hw,
+ .platform_sleep = ft5406_platform_sleep,
+ .platform_wakeup = ft5406_platform_wakeup,
+
+};
+#endif
+
+#if defined(CONFIG_TOUCHSCREEN_GT819)
+#define TOUCH_RESET_PIN RK29_PIN6_PC3
+#define TOUCH_INT_PIN RK29_PIN0_PA2
+int gt819_init_platform_hw(void)
+{
+ printk("gt819_init_platform_hw\n");
+ if(gpio_request(TOUCH_RESET_PIN,NULL) != 0){
+ gpio_free(TOUCH_RESET_PIN);
+ printk("gt819_init_platform_hw gpio_request error\n");
+ return -EIO;
+ }
+
+ if(gpio_request(TOUCH_INT_PIN,NULL) != 0){
+ gpio_free(TOUCH_INT_PIN);
+ printk("gt819_init_platform_hw gpio_request error\n");
+ return -EIO;
+ }
+ gpio_direction_output(TOUCH_RESET_PIN, 0);
+ gpio_set_value(TOUCH_RESET_PIN,GPIO_LOW);
+ mdelay(10);
+// gpio_set_value(TOUCH_RESET_PIN,GPIO_HIGH);
+// mdelay(10);
+// gpio_set_value(TOUCH_RESET_PIN,GPIO_LOW);
+ gpio_direction_input(TOUCH_INT_PIN);
+// mdelay(10);
+ gpio_set_value(TOUCH_RESET_PIN,GPIO_HIGH);
+ msleep(300);
+ return 0;
+}
+
+
+void gt819_exit_platform_hw(void)
+{
+ printk("gt819_exit_platform_hw\n");
+ gpio_free(TOUCH_RESET_PIN);
+ gpio_free(TOUCH_INT_PIN);
+}
+
+int gt819_platform_sleep(void)
+{
+ printk("gt819_platform_sleep\n");
+ gpio_set_value(TOUCH_RESET_PIN,GPIO_LOW);
+ return 0;
+}
+
+int gt819_platform_wakeup(void)
+{
+ printk("gt819_platform_wakeup\n");
+ gpio_set_value(TOUCH_RESET_PIN,GPIO_HIGH);
+ //msleep(5);
+ //gpio_set_value(TOUCH_INT_PIN, GPIO_LOW);
+ //msleep(20);
+ //gpio_set_value(TOUCH_INT_PIN, GPIO_HIGH);
+ return 0;
+}
+struct goodix_platform_data goodix_info = {
+
+ .init_platform_hw= gt819_init_platform_hw,
+ .exit_platform_hw= gt819_exit_platform_hw,
+ .platform_sleep = gt819_platform_sleep,
+ .platform_wakeup = gt819_platform_wakeup,
+
+};
+#endif
+
+
+#if defined (CONFIG_SND_SOC_CS42L52)
+
+int cs42l52_init_platform_hw()
+{
+ printk("cs42l52_init_platform_hw\n");
+ if(gpio_request(RK29_PIN6_PB6,NULL) != 0){
+ gpio_free(RK29_PIN6_PB6);
+ printk("cs42l52_init_platform_hw gpio_request error\n");
+ return -EIO;
+ }
+ gpio_direction_output(RK29_PIN6_PB6, 0);
+ gpio_set_value(RK29_PIN6_PB6,GPIO_HIGH);
+ return 0;
+}
+struct cs42l52_platform_data cs42l52_info = {
+
+ .init_platform_hw= cs42l52_init_platform_hw,
+
+};
+#endif
+#if defined (CONFIG_BATTERY_BQ27541)
+#define DC_CHECK_PIN RK29_PIN4_PA1
+#define LI_LION_BAT_NUM 1
+#define CHG_OK RK29_PIN4_PA3
+#define BAT_LOW RK29_PIN4_PA2
+
+static int bq27541_init_dc_check_pin(void){
+ if(gpio_request(DC_CHECK_PIN,"dc_check") != 0){
+ gpio_free(DC_CHECK_PIN);
+ printk("bq27541 init dc check pin request error\n");
+ return -EIO;
+ }
+ gpio_direction_input(DC_CHECK_PIN);
+ return 0;
+}
+
+struct bq27541_platform_data bq27541_info = {
+ .init_dc_check_pin = bq27541_init_dc_check_pin,
+ .dc_check_pin = DC_CHECK_PIN,
+ .bat_num = LI_LION_BAT_NUM,
+ .chgok_check_pin = CHG_OK,
+ .bat_check_pin = BAT_LOW,
+};
+#endif
static struct android_pmem_platform_data android_pmem_pdata = {
.name = "pmem",
.start = PMEM_UI_BASE,
.size = PMEM_UI_SIZE,
- .no_allocator = 0,
+ .no_allocator = 1,
.cached = 1,
};
};
-static struct android_pmem_platform_data android_pmem_cam_pdata = {
- .name = "pmem_cam",
- .start = PMEM_CAM_BASE,
- .size = PMEM_CAM_SIZE,
- .no_allocator = 1,
- .cached = 1,
-};
-
-static struct platform_device android_pmem_cam_device = {
- .name = "android_pmem",
- .id = 1,
- .dev = {
- .platform_data = &android_pmem_cam_pdata,
- },
-};
-
-
static struct vpu_mem_platform_data vpu_mem_pdata = {
.name = "vpu_mem",
.start = PMEM_VPU_BASE,
},
};
+#if PMEM_SKYPE_SIZE > 0
+static struct android_pmem_platform_data android_pmem_skype_pdata = {
+ .name = "pmem_skype",
+ .start = PMEM_SKYPE_BASE,
+ .size = PMEM_SKYPE_SIZE,
+ .no_allocator = 0,
+ .cached = 0,
+};
+
+static struct platform_device android_pmem_skype_device = {
+ .name = "android_pmem",
+ .id = 3,
+ .dev = {
+ .platform_data = &android_pmem_skype_pdata,
+ },
+};
+#endif
+
+#ifdef CONFIG_VIDEO_RK29XX_VOUT
static struct platform_device rk29_v4l2_output_devce = {
.name = "rk29_vout",
};
-
+#endif
/*HANNSTAR_P1003 touch*/
#if defined (CONFIG_HANNSTAR_P1003)
#define TOUCH_RESET_PIN RK29_PIN6_PC3
.disp_on_value = TOUCH_SCREEN_DISPLAY_VALUE,
};
#endif
+
+#ifdef CONFIG_GS_KXTF9
+#include <linux/kxtf9.h>
+#define KXTF9_DEVICE_MAP 1
+#define KXTF9_MAP_X (KXTF9_DEVICE_MAP-1)%2
+#define KXTF9_MAP_Y KXTF9_DEVICE_MAP%2
+#define KXTF9_NEG_X (KXTF9_DEVICE_MAP/2)%2
+#define KXTF9_NEG_Y (KXTF9_DEVICE_MAP+1)/4
+#define KXTF9_NEG_Z (KXTF9_DEVICE_MAP-1)/4
+struct kxtf9_platform_data kxtf9_pdata = {
+ .min_interval = 1,
+ .poll_interval = 20,
+ .g_range = KXTF9_G_2G,
+ .axis_map_x = KXTF9_MAP_X,
+ .axis_map_y = KXTF9_MAP_Y,
+ .axis_map_z = 2,
+ .negate_x = KXTF9_NEG_X,
+ .negate_y = KXTF9_NEG_Y,
+ .negate_z = KXTF9_NEG_Z,
+ //.ctrl_regc_init = KXTF9_G_2G | ODR50F,
+ //.ctrl_regb_init = ENABLE,
+};
+#endif /* CONFIG_GS_KXTF9 */
+
+
/*MMA8452 gsensor*/
#if defined (CONFIG_GS_MMA8452)
#define MMA8452_INT_PIN RK29_PIN0_PA3
.orientation = { 0, 1, 0, -1, 0, 0, 0, 0, 1 },
},
};
-#endif
-#endif
-#if defined (CONFIG_BATTERY_BQ27510)
-#define DC_CHECK_PIN RK29_PIN4_PA1
-#define LI_LION_BAT_NUM 2
-static int bq27510_init_dc_check_pin(void){
- if(gpio_request(DC_CHECK_PIN,"dc_check") != 0){
- gpio_free(DC_CHECK_PIN);
- printk("bq27510 init dc check pin request error\n");
- return -EIO;
- }
- gpio_direction_input(DC_CHECK_PIN);
- return 0;
-}
+#endif
+#endif
+#if defined (CONFIG_BATTERY_BQ27510)
+#define DC_CHECK_PIN RK29_PIN4_PA1
+#define LI_LION_BAT_NUM 2
+static int bq27510_init_dc_check_pin(void){
+ if(gpio_request(DC_CHECK_PIN,"dc_check") != 0){
+ gpio_free(DC_CHECK_PIN);
+ printk("bq27510 init dc check pin request error\n");
+ return -EIO;
+ }
+ gpio_direction_input(DC_CHECK_PIN);
+ return 0;
+}
+
+struct bq27510_platform_data bq27510_info = {
+ .init_dc_check_pin = bq27510_init_dc_check_pin,
+ .dc_check_pin = DC_CHECK_PIN,
+ .bat_num = LI_LION_BAT_NUM,
+};
+#endif
+
+/*************************************PMU ACT8891****************************************/
+
+#if defined (CONFIG_REGULATOR_ACT8891)
+ /*dcdc mode*/
+/*act8891 in REGULATOR_MODE_STANDBY mode is said DCDC is in PMF mode is can save power,when in REGULATOR_MODE_NORMAL
+mode is said DCDC is in PWM mode , General default is in REGULATOR_MODE_STANDBY mode*/
+ /*ldo mode */
+/*act8891 in REGULATOR_MODE_STANDBY mode is said LDO is in low power mode is can save power,when in REGULATOR_MODE_NORMAL
+mode is said DCDC is in nomal mode , General default is in REGULATOR_MODE_STANDBY mode*/
+/*set dcdc and ldo voltage by regulator_set_voltage()*/
+static struct act8891 *act8891;
+int act8891_set_init(struct act8891 *act8891)
+{
+ int tmp = 0;
+ struct regulator *act_ldo1,*act_ldo2,*act_ldo3,*act_ldo4;
+ struct regulator *act_dcdc1,*act_dcdc2,*act_dcdc3;
+
+ /*init ldo1*/
+ act_ldo1 = regulator_get(NULL, "act_ldo1");
+ regulator_enable(act_ldo1);
+ regulator_set_voltage(act_ldo1,1800000,1800000);
+ tmp = regulator_get_voltage(act_ldo1);
+ regulator_set_mode(act_ldo1,REGULATOR_MODE_STANDBY);
+ //regulator_set_mode(act_ldo1,REGULATOR_MODE_NORMAL);
+ printk("***regulator_set_init: ldo1 vcc =%d\n",tmp);
+ regulator_put(act_ldo1);
+
+ /*init ldo2*/
+ act_ldo2 = regulator_get(NULL, "act_ldo2");
+ regulator_enable(act_ldo2);
+ regulator_set_voltage(act_ldo2,1200000,1200000);
+ tmp = regulator_get_voltage(act_ldo2);
+ regulator_set_mode(act_ldo2,REGULATOR_MODE_STANDBY);
+ //regulator_set_mode(act_ldo2,REGULATOR_MODE_NORMAL);
+ printk("***regulator_set_init: ldo2 vcc =%d\n",tmp);
+ regulator_put(act_ldo2);
+
+ /*init ldo3*/
+ act_ldo3 = regulator_get(NULL, "act_ldo3");
+ regulator_enable(act_ldo3);
+ regulator_set_voltage(act_ldo3,3300000,3300000);
+ tmp = regulator_get_voltage(act_ldo3);
+ regulator_set_mode(act_ldo3,REGULATOR_MODE_STANDBY);
+ //regulator_set_mode(act_ldo3,REGULATOR_MODE_NORMAL);
+ printk("***regulator_set_init: ldo3 vcc =%d\n",tmp);
+ regulator_put(act_ldo3);
+
+ /*init ldo4*/
+ act_ldo4 = regulator_get(NULL, "act_ldo4");
+ regulator_enable(act_ldo4);
+ regulator_set_voltage(act_ldo4,2500000,2500000);
+ tmp = regulator_get_voltage(act_ldo4);
+ regulator_set_mode(act_ldo4,REGULATOR_MODE_STANDBY);
+ //regulator_set_mode(act_ldo4,REGULATOR_MODE_NORMAL);
+ printk("***regulator_set_init: ldo4 vcc =%d\n",tmp);
+ regulator_put(act_ldo4);
+
+ /*init dcdc1*/
+ act_dcdc1 = regulator_get(NULL, "act_dcdc1");
+ regulator_enable(act_dcdc1);
+ regulator_set_voltage(act_dcdc1,3000000,3000000);
+ tmp = regulator_get_voltage(act_dcdc1);
+ regulator_set_mode(act_dcdc1,REGULATOR_MODE_STANDBY);
+ //regulator_set_mode(act_dcdc1,REGULATOR_MODE_NORMAL);
+ printk("***regulator_set_init: dcdc1 vcc =%d\n",tmp);
+ regulator_put(act_dcdc1);
+
+ /*init dcdc2*/
+ act_dcdc2 = regulator_get(NULL, "act_dcdc2");
+ regulator_enable(act_dcdc2);
+ regulator_set_voltage(act_dcdc2,1500000,1500000);
+ tmp = regulator_get_voltage(act_dcdc2);
+ regulator_set_mode(act_dcdc2,REGULATOR_MODE_STANDBY);
+ //regulator_set_mode(act_dcdc2,REGULATOR_MODE_NORMAL);
+ printk("***regulator_set_init: dcdc2 vcc =%d\n",tmp);
+ regulator_put(act_dcdc2);
+
+ /*init dcdc3*/
+ act_dcdc3 = regulator_get(NULL, "act_dcdc3");
+ regulator_enable(act_dcdc3);
+ regulator_set_voltage(act_dcdc3,1200000,1200000);
+ tmp = regulator_get_voltage(act_dcdc3);
+ regulator_set_mode(act_dcdc3,REGULATOR_MODE_STANDBY);
+ //regulator_set_mode(act_dcdc3,REGULATOR_MODE_NORMAL);
+ printk("***regulator_set_init: dcdc3 vcc =%d\n",tmp);
+ regulator_put(act_dcdc3);
+
+ return(0);
+}
+
+static struct regulator_consumer_supply act8891_ldo1_consumers[] = {
+ {
+ .supply = "act_ldo1",
+ }
+};
+
+static struct regulator_init_data act8891_ldo1_data = {
+ .constraints = {
+ .name = "ACT_LDO1",
+ .min_uV = 600000,
+ .max_uV = 3900000,
+ .apply_uV = 1,
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE,
+ .valid_modes_mask = REGULATOR_MODE_STANDBY | REGULATOR_MODE_NORMAL,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(act8891_ldo1_consumers),
+ .consumer_supplies = act8891_ldo1_consumers,
+};
+
+/**/
+static struct regulator_consumer_supply act8891_ldo2_consumers[] = {
+ {
+ .supply = "act_ldo2",
+ }
+};
+
+static struct regulator_init_data act8891_ldo2_data = {
+ .constraints = {
+ .name = "ACT_LDO2",
+ .min_uV = 600000,
+ .max_uV = 3900000,
+ .apply_uV = 1,
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE,
+ .valid_modes_mask = REGULATOR_MODE_STANDBY | REGULATOR_MODE_NORMAL,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(act8891_ldo2_consumers),
+ .consumer_supplies = act8891_ldo2_consumers,
+};
+
+/*ldo3 VCC_NAND WIFI/BT/FM_BCM4325*/
+static struct regulator_consumer_supply act8891_ldo3_consumers[] = {
+ {
+ .supply = "act_ldo3",
+ }
+};
+
+static struct regulator_init_data act8891_ldo3_data = {
+ .constraints = {
+ .name = "ACT_LDO3",
+ .min_uV = 600000,
+ .max_uV = 3900000,
+ .apply_uV = 1,
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE,
+ .valid_modes_mask = REGULATOR_MODE_STANDBY | REGULATOR_MODE_NORMAL,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(act8891_ldo3_consumers),
+ .consumer_supplies = act8891_ldo3_consumers,
+};
+
+/*ldo4 VCCA CODEC_WM8994*/
+static struct regulator_consumer_supply act8891_ldo4_consumers[] = {
+ {
+ .supply = "act_ldo4",
+ }
+};
+
+static struct regulator_init_data act8891_ldo4_data = {
+ .constraints = {
+ .name = "ACT_LDO4",
+ .min_uV = 600000,
+ .max_uV = 3900000,
+ .apply_uV = 1,
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE,
+ .valid_modes_mask = REGULATOR_MODE_STANDBY | REGULATOR_MODE_NORMAL,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(act8891_ldo4_consumers),
+ .consumer_supplies = act8891_ldo4_consumers,
+};
+/*buck1 vcc Core*/
+static struct regulator_consumer_supply act8891_dcdc1_consumers[] = {
+ {
+ .supply = "act_dcdc1",
+ }
+};
+
+static struct regulator_init_data act8891_dcdc1_data = {
+ .constraints = {
+ .name = "ACT_DCDC1",
+ .min_uV = 600000,
+ .max_uV = 3900000,
+ .apply_uV = 1,
+ //.always_on = 1,
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE,
+ .valid_modes_mask = REGULATOR_MODE_STANDBY | REGULATOR_MODE_NORMAL,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(act8891_dcdc1_consumers),
+ .consumer_supplies = act8891_dcdc1_consumers
+};
+
+/*buck2 VDDDR MobileDDR VCC*/
+static struct regulator_consumer_supply act8891_dcdc2_consumers[] = {
+ {
+ .supply = "act_dcdc2",
+ }
+};
+
+static struct regulator_init_data act8891_dcdc2_data = {
+ .constraints = {
+ .name = "ACT_DCDC2",
+ .min_uV = 600000,
+ .max_uV = 3900000,
+ .apply_uV = 1,
+ //.always_on = 1,
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE,
+ .valid_modes_mask = REGULATOR_MODE_STANDBY | REGULATOR_MODE_NORMAL,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(act8891_dcdc2_consumers),
+ .consumer_supplies = act8891_dcdc2_consumers
+};
+
+/*buck3 vdd Core*/
+static struct regulator_consumer_supply act8891_dcdc3_consumers[] = {
+ {
+ .supply = "act_dcdc3",
+ }
+};
-struct bq27510_platform_data bq27510_info = {
- .init_dc_check_pin = bq27510_init_dc_check_pin,
- .dc_check_pin = DC_CHECK_PIN,
- .bat_num = LI_LION_BAT_NUM,
+static struct regulator_init_data act8891_dcdc3_data = {
+ .constraints = {
+ .name = "ACT_DCDC3",
+ .min_uV = 600000,
+ .max_uV = 3900000,
+ .apply_uV = 1,
+ //.always_on = 1,
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE,
+ .valid_modes_mask = REGULATOR_MODE_STANDBY | REGULATOR_MODE_NORMAL,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(act8891_dcdc3_consumers),
+ .consumer_supplies = act8891_dcdc3_consumers
};
-#endif
+struct act8891_regulator_subdev act8891_regulator_subdev_id[] = {
+ {
+ .id=0,
+ .initdata=&act8891_ldo1_data,
+ },
+
+ {
+ .id=1,
+ .initdata=&act8891_ldo2_data,
+ },
+
+ {
+ .id=2,
+ .initdata=&act8891_ldo3_data,
+ },
+
+ {
+ .id=3,
+ .initdata=&act8891_ldo4_data,
+ },
+
+ {
+ .id=4,
+ .initdata=&act8891_dcdc1_data,
+ },
+
+ {
+ .id=5,
+ .initdata=&act8891_dcdc2_data,
+ },
+ {
+ .id=6,
+ .initdata=&act8891_dcdc3_data,
+ },
+
+};
+
+struct act8891_platform_data act8891_data={
+ .set_init=act8891_set_init,
+ .num_regulators=7,
+ .regulators=act8891_regulator_subdev_id,
+
+};
+#endif
/*****************************************************************************************
* i2c devices
*****************************************************************************************/
static int rk29_i2c0_io_init(void)
{
+#ifdef CONFIG_RK29_I2C0_CONTROLLER
rk29_mux_api_set(GPIO2B7_I2C0SCL_NAME, GPIO2L_I2C0_SCL);
rk29_mux_api_set(GPIO2B6_I2C0SDA_NAME, GPIO2L_I2C0_SDA);
+#else
+ rk29_mux_api_set(GPIO2B7_I2C0SCL_NAME, GPIO2L_GPIO2B7);
+ rk29_mux_api_set(GPIO2B6_I2C0SDA_NAME, GPIO2L_GPIO2B6);
+#endif
return 0;
}
static int rk29_i2c1_io_init(void)
{
+#ifdef CONFIG_RK29_I2C1_CONTROLLER
rk29_mux_api_set(GPIO1A7_I2C1SCL_NAME, GPIO1L_I2C1_SCL);
rk29_mux_api_set(GPIO1A6_I2C1SDA_NAME, GPIO1L_I2C1_SDA);
+#else
+ rk29_mux_api_set(GPIO1A7_I2C1SCL_NAME, GPIO1L_GPIO1A7);
+ rk29_mux_api_set(GPIO1A6_I2C1SDA_NAME, GPIO1L_GPIO1A6);
+#endif
return 0;
}
static int rk29_i2c2_io_init(void)
{
+#ifdef CONFIG_RK29_I2C2_CONTROLLER
rk29_mux_api_set(GPIO5D4_I2C2SCL_NAME, GPIO5H_I2C2_SCL);
rk29_mux_api_set(GPIO5D3_I2C2SDA_NAME, GPIO5H_I2C2_SDA);
+#else
+ rk29_mux_api_set(GPIO5D4_I2C2SCL_NAME, GPIO5H_GPIO5D4);
+ rk29_mux_api_set(GPIO5D3_I2C2SDA_NAME, GPIO5H_GPIO5D3);
+#endif
return 0;
}
static int rk29_i2c3_io_init(void)
{
+#ifdef CONFIG_RK29_I2C3_CONTROLLER
rk29_mux_api_set(GPIO2B5_UART3RTSN_I2C3SCL_NAME, GPIO2L_I2C3_SCL);
rk29_mux_api_set(GPIO2B4_UART3CTSN_I2C3SDA_NAME, GPIO2L_I2C3_SDA);
+#else
+ rk29_mux_api_set(GPIO2B5_UART3RTSN_I2C3SCL_NAME, GPIO2L_GPIO2B5);
+ rk29_mux_api_set(GPIO2B4_UART3CTSN_I2C3SDA_NAME, GPIO2L_GPIO2B4);
+#endif
return 0;
}
-
+#ifdef CONFIG_RK29_I2C0_CONTROLLER
struct rk29_i2c_platform_data default_i2c0_data = {
.bus_num = 0,
.flags = 0,
.mode = I2C_MODE_IRQ,
.io_init = rk29_i2c0_io_init,
};
-
+#else
+struct i2c_gpio_platform_data default_i2c0_data = {
+ .sda_pin = RK29_PIN2_PB6,
+ .scl_pin = RK29_PIN2_PB7,
+ .udelay = 5, // clk = 500/udelay = 100Khz
+ .timeout = 100,//msecs_to_jiffies(200),
+ .bus_num = 0,
+ .io_init = rk29_i2c0_io_init,
+};
+#endif
+#ifdef CONFIG_RK29_I2C1_CONTROLLER
struct rk29_i2c_platform_data default_i2c1_data = {
.bus_num = 1,
.flags = 0,
.slave_addr = 0xff,
.scl_rate = 400*1000,
- .mode = I2C_MODE_POLL,
+ .mode = I2C_MODE_IRQ,
.io_init = rk29_i2c1_io_init,
};
-
+#else
+struct i2c_gpio_platform_data default_i2c1_data = {
+ .sda_pin = RK29_PIN1_PA6,
+ .scl_pin = RK29_PIN1_PA7,
+ .udelay = 5, // clk = 500/udelay = 100Khz
+ .timeout = 100,//msecs_to_jiffies(200),
+ .bus_num = 1,
+ .io_init = rk29_i2c1_io_init,
+};
+#endif
+#ifdef CONFIG_RK29_I2C2_CONTROLLER
struct rk29_i2c_platform_data default_i2c2_data = {
.bus_num = 2,
.flags = 0,
.mode = I2C_MODE_IRQ,
.io_init = rk29_i2c2_io_init,
};
-
+#else
+struct i2c_gpio_platform_data default_i2c2_data = {
+ .sda_pin = RK29_PIN5_PD3,
+ .scl_pin = RK29_PIN5_PD4,
+ .udelay = 5, // clk = 500/udelay = 100Khz
+ .timeout = 100,//msecs_to_jiffies(200),
+ .bus_num = 2,
+ .io_init = rk29_i2c2_io_init,
+};
+#endif
+#ifdef CONFIG_RK29_I2C3_CONTROLLER
struct rk29_i2c_platform_data default_i2c3_data = {
.bus_num = 3,
.flags = 0,
.slave_addr = 0xff,
.scl_rate = 400*1000,
- .mode = I2C_MODE_POLL,
+ .mode = I2C_MODE_IRQ,
.io_init = rk29_i2c3_io_init,
};
-
+#else
+struct i2c_gpio_platform_data default_i2c3_data = {
+ .sda_pin = RK29_PIN5_PB5,
+ .scl_pin = RK29_PIN5_PB4,
+ .udelay = 5, // clk = 500/udelay = 100Khz
+ .timeout = 100,//msecs_to_jiffies(200),
+ .bus_num = 3,
+ .io_init = rk29_i2c3_io_init,
+};
+#endif
#ifdef CONFIG_I2C0_RK29
static struct i2c_board_info __initdata board_i2c0_devices[] = {
#if defined (CONFIG_RK1000_CONTROL)
.irq = RK29_PIN0_PA4,
},
#endif
+/*mpu3050*/
#if defined (CONFIG_MPU_SENSORS_MPU3050)
{
.type = "mpu3050",
.platform_data = &mpu3050_data,
},
#endif
+#if defined (CONFIG_SND_SOC_CS42L52)
+ {
+ .type = "cs42l52",
+ .addr = 0x4A,
+ .flags = 0,
+ .platform_data = &cs42l52_info,
+ },
+#endif
+#if defined (CONFIG_RTC_M41T66)
+ {
+ .type = "rtc-M41T66",
+ .addr = 0x68,
+ .flags = 0,
+ .irq = RK29_PIN0_PA1,
+ },
+#endif
};
#endif
#if defined (CONFIG_ANX7150)
-struct hdmi_platform_data anx7150_data = {
- //.io_init = anx7150_io_init,
+struct hdmi_platform_data anx7150_data = {
+ //.io_init = anx7150_io_init,
};
#endif
-
#ifdef CONFIG_I2C1_RK29
static struct i2c_board_info __initdata board_i2c1_devices[] = {
#if defined (CONFIG_RK1000_CONTROL1)
.platform_data = &anx7150_data,
},
#endif
+#ifdef CONFIG_BU92747GUW_CIR
+ {
+ .type ="bu92747_cir",
+ .addr = 0x77,
+ .flags =0,
+ .irq = BU92747_CIR_IRQ_PIN,
+ .platform_data = &bu92747guw_pdata,
+ },
+#endif
};
#endif
.platform_data = &eeti_egalax_info,
},
#endif
+#if defined (CONFIG_TOUCHSCREEN_GT819)
+ {
+ .type = "Goodix-TS",
+ .addr = 0x55,
+ .flags =0,
+ .irq =RK29_PIN0_PA2,
+ .platform_data = &goodix_info,
+ },
+#endif
+#if defined (CONFIG_TOUCHSCREEN_FT5406)
+ {
+ .type ="ft5x0x_ts",
+ .addr = 0x38, //0x70,
+ .flags =0,
+ .irq =RK29_PIN0_PA2, // support goodix tp detect, 20110706
+ .platform_data = &ft5406_info,
+ },
+#endif
};
#endif
#ifdef CONFIG_I2C3_RK29
static struct i2c_board_info __initdata board_i2c3_devices[] = {
+#if defined (CONFIG_BATTERY_BQ27541)
+ {
+ .type = "bq27541",
+ .addr = 0x55,
+ .flags = 0,
+ .platform_data = &bq27541_info,
+ },
+#endif
+#if defined (CONFIG_REGULATOR_ACT8891)
+ {
+ .type = "act8891",
+ .addr = 0x5b,
+ .flags = 0,
+ .platform_data=&act8891_data,
+ },
+#endif
+
};
#endif
* author: ddl@rock-chips.com
*****************************************************************************************/
#ifdef CONFIG_VIDEO_RK29
-#define SENSOR_NAME_0 RK29_CAM_SENSOR_NAME_OV5642 /* back camera sensor */
-#define SENSOR_IIC_ADDR_0 0x78
-#define SENSOR_IIC_ADAPTER_ID_0 1
-#define SENSOR_POWER_PIN_0 INVALID_GPIO
-#define SENSOR_RESET_PIN_0 INVALID_GPIO
-#define SENSOR_POWERDN_PIN_0 RK29_PIN6_PB7
-#define SENSOR_FALSH_PIN_0 INVALID_GPIO
-#define SENSOR_POWERACTIVE_LEVEL_0 RK29_CAM_POWERACTIVE_L
-#define SENSOR_RESETACTIVE_LEVEL_0 RK29_CAM_RESETACTIVE_L
-#define SENSOR_POWERDNACTIVE_LEVEL_0 RK29_CAM_POWERDNACTIVE_H
-#define SENSOR_FLASHACTIVE_LEVEL_0 RK29_CAM_FLASHACTIVE_L
-
-#define SENSOR_NAME_1 RK29_CAM_SENSOR_NAME_OV2659 /* front camera sensor */
-#define SENSOR_IIC_ADDR_1 0x60
-#define SENSOR_IIC_ADAPTER_ID_1 1
-#define SENSOR_POWER_PIN_1 INVALID_GPIO
-#define SENSOR_RESET_PIN_1 INVALID_GPIO
-#define SENSOR_POWERDN_PIN_1 RK29_PIN5_PD7
-#define SENSOR_FALSH_PIN_1 INVALID_GPIO
-#define SENSOR_POWERACTIVE_LEVEL_1 RK29_CAM_POWERACTIVE_L
-#define SENSOR_RESETACTIVE_LEVEL_1 RK29_CAM_RESETACTIVE_L
-#define SENSOR_POWERDNACTIVE_LEVEL_1 RK29_CAM_POWERDNACTIVE_H
-#define SENSOR_FLASHACTIVE_LEVEL_1 RK29_CAM_FLASHACTIVE_L
-
-static int rk29_sensor_io_init(void);
-static int rk29_sensor_io_deinit(int sensor);
-static int rk29_sensor_ioctrl(struct device *dev,enum rk29camera_ioctrl_cmd cmd,int on);
-
-static struct rk29camera_platform_data rk29_camera_platform_data = {
- .io_init = rk29_sensor_io_init,
- .io_deinit = rk29_sensor_io_deinit,
- .sensor_ioctrl = rk29_sensor_ioctrl,
- .gpio_res = {
- {
- .gpio_reset = SENSOR_RESET_PIN_0,
- .gpio_power = SENSOR_POWER_PIN_0,
- .gpio_powerdown = SENSOR_POWERDN_PIN_0,
- .gpio_flash = SENSOR_FALSH_PIN_0,
- .gpio_flag = (SENSOR_POWERACTIVE_LEVEL_0|SENSOR_RESETACTIVE_LEVEL_0|SENSOR_POWERDNACTIVE_LEVEL_0|SENSOR_FLASHACTIVE_LEVEL_0),
- .gpio_init = 0,
- .dev_name = SENSOR_NAME_0,
- }, {
- .gpio_reset = SENSOR_RESET_PIN_1,
- .gpio_power = SENSOR_POWER_PIN_1,
- .gpio_powerdown = SENSOR_POWERDN_PIN_1,
- .gpio_flash = SENSOR_FALSH_PIN_1,
- .gpio_flag = (SENSOR_POWERACTIVE_LEVEL_1|SENSOR_RESETACTIVE_LEVEL_1|SENSOR_POWERDNACTIVE_LEVEL_1|SENSOR_FLASHACTIVE_LEVEL_1),
- .gpio_init = 0,
- .dev_name = SENSOR_NAME_1,
- }
- },
- #ifdef CONFIG_VIDEO_RK29_WORK_IPP
- .meminfo = {
- .name = "camera_ipp_mem",
- .start = MEM_CAMIPP_BASE,
- .size = MEM_CAMIPP_SIZE,
- }
- #endif
-};
+#define CONFIG_SENSOR_POWER_IOCTL_USR 0
+#define CONFIG_SENSOR_RESET_IOCTL_USR 0
+#define CONFIG_SENSOR_POWERDOWN_IOCTL_USR 0
+#define CONFIG_SENSOR_FLASH_IOCTL_USR 0
-static int rk29_sensor_io_init(void)
+#if CONFIG_SENSOR_POWER_IOCTL_USR
+static int sensor_power_usr_cb (struct rk29camera_gpio_res *res,int on)
{
- int ret = 0, i;
- unsigned int camera_reset = INVALID_GPIO, camera_power = INVALID_GPIO;
- unsigned int camera_powerdown = INVALID_GPIO, camera_flash = INVALID_GPIO;
- unsigned int camera_ioflag;
-
- for (i=0; i<2; i++) {
- camera_reset = rk29_camera_platform_data.gpio_res[i].gpio_reset;
- camera_power = rk29_camera_platform_data.gpio_res[i].gpio_power;
- camera_powerdown = rk29_camera_platform_data.gpio_res[i].gpio_powerdown;
- camera_flash = rk29_camera_platform_data.gpio_res[i].gpio_flash;
- camera_ioflag = rk29_camera_platform_data.gpio_res[i].gpio_flag;
- rk29_camera_platform_data.gpio_res[i].gpio_init = 0;
-
- if (camera_power != INVALID_GPIO) {
- ret = gpio_request(camera_power, "camera power");
- if (ret)
- goto sensor_io_int_loop_end;
- rk29_camera_platform_data.gpio_res[i].gpio_init |= RK29_CAM_POWERACTIVE_MASK;
- gpio_set_value(camera_reset, (((~camera_ioflag)&RK29_CAM_POWERACTIVE_MASK)>>RK29_CAM_POWERACTIVE_BITPOS));
- gpio_direction_output(camera_power, (((~camera_ioflag)&RK29_CAM_POWERACTIVE_MASK)>>RK29_CAM_POWERACTIVE_BITPOS));
-
- //printk("\n%s....power pin(%d) init success(0x%x) \n",__FUNCTION__,camera_power,(((~camera_ioflag)&RK29_CAM_POWERACTIVE_MASK)>>RK29_CAM_POWERACTIVE_BITPOS));
-
- }
-
- if (camera_reset != INVALID_GPIO) {
- ret = gpio_request(camera_reset, "camera reset");
- if (ret)
- goto sensor_io_int_loop_end;
- rk29_camera_platform_data.gpio_res[i].gpio_init |= RK29_CAM_RESETACTIVE_MASK;
- gpio_set_value(camera_reset, ((camera_ioflag&RK29_CAM_RESETACTIVE_MASK)>>RK29_CAM_RESETACTIVE_BITPOS));
- gpio_direction_output(camera_reset, ((camera_ioflag&RK29_CAM_RESETACTIVE_MASK)>>RK29_CAM_RESETACTIVE_BITPOS));
-
- //printk("\n%s....reset pin(%d) init success(0x%x)\n",__FUNCTION__,camera_reset,((camera_ioflag&RK29_CAM_RESETACTIVE_MASK)>>RK29_CAM_RESETACTIVE_BITPOS));
-
- }
-
- if (camera_powerdown != INVALID_GPIO) {
- ret = gpio_request(camera_powerdown, "camera powerdown");
- if (ret)
- goto sensor_io_int_loop_end;
- rk29_camera_platform_data.gpio_res[i].gpio_init |= RK29_CAM_POWERDNACTIVE_MASK;
- gpio_set_value(camera_powerdown, ((camera_ioflag&RK29_CAM_POWERDNACTIVE_MASK)>>RK29_CAM_POWERDNACTIVE_BITPOS));
- gpio_direction_output(camera_powerdown, ((camera_ioflag&RK29_CAM_POWERDNACTIVE_MASK)>>RK29_CAM_POWERDNACTIVE_BITPOS));
-
- //printk("\n%s....powerdown pin(%d) init success(0x%x) \n",__FUNCTION__,camera_powerdown,((camera_ioflag&RK29_CAM_POWERDNACTIVE_BITPOS)>>RK29_CAM_POWERDNACTIVE_BITPOS));
-
- }
-
- if (camera_flash != INVALID_GPIO) {
- ret = gpio_request(camera_flash, "camera flash");
- if (ret)
- goto sensor_io_int_loop_end;
- rk29_camera_platform_data.gpio_res[i].gpio_init |= RK29_CAM_FLASHACTIVE_MASK;
- gpio_set_value(camera_flash, ((camera_ioflag&RK29_CAM_FLASHACTIVE_MASK)>>RK29_CAM_FLASHACTIVE_BITPOS));
- gpio_direction_output(camera_flash, ((camera_ioflag&RK29_CAM_FLASHACTIVE_MASK)>>RK29_CAM_FLASHACTIVE_BITPOS));
-
- //printk("\n%s....flash pin(%d) init success(0x%x) \n",__FUNCTION__,camera_flash,((camera_ioflag&RK29_CAM_FLASHACTIVE_MASK)>>RK29_CAM_FLASHACTIVE_BITPOS));
-
- }
- continue;
-sensor_io_int_loop_end:
- rk29_sensor_io_deinit(i);
- continue;
- }
-
- return 0;
+ #error "CONFIG_SENSOR_POWER_IOCTL_USR is 1, sensor_power_usr_cb function must be writed!!";
}
+#endif
-static int rk29_sensor_io_deinit(int sensor)
+#if CONFIG_SENSOR_RESET_IOCTL_USR
+static int sensor_reset_usr_cb (struct rk29camera_gpio_res *res,int on)
{
- unsigned int camera_reset = INVALID_GPIO, camera_power = INVALID_GPIO;
- unsigned int camera_powerdown = INVALID_GPIO, camera_flash = INVALID_GPIO;
-
- camera_reset = rk29_camera_platform_data.gpio_res[sensor].gpio_reset;
- camera_power = rk29_camera_platform_data.gpio_res[sensor].gpio_power;
- camera_powerdown = rk29_camera_platform_data.gpio_res[sensor].gpio_powerdown;
- camera_flash = rk29_camera_platform_data.gpio_res[sensor].gpio_flash;
-
- if (rk29_camera_platform_data.gpio_res[sensor].gpio_init & RK29_CAM_POWERACTIVE_MASK) {
- if (camera_power != INVALID_GPIO) {
- gpio_direction_input(camera_power);
- gpio_free(camera_power);
- }
- }
-
- if (rk29_camera_platform_data.gpio_res[sensor].gpio_init & RK29_CAM_RESETACTIVE_MASK) {
- if (camera_reset != INVALID_GPIO) {
- gpio_direction_input(camera_reset);
- gpio_free(camera_reset);
- }
- }
-
- if (rk29_camera_platform_data.gpio_res[sensor].gpio_init & RK29_CAM_POWERDNACTIVE_MASK) {
- if (camera_powerdown != INVALID_GPIO) {
- gpio_direction_input(camera_powerdown);
- gpio_free(camera_powerdown);
- }
- }
-
- if (rk29_camera_platform_data.gpio_res[sensor].gpio_init & RK29_CAM_FLASHACTIVE_MASK) {
- if (camera_flash != INVALID_GPIO) {
- gpio_direction_input(camera_flash);
- gpio_free(camera_flash);
- }
- }
-
- rk29_camera_platform_data.gpio_res[sensor].gpio_init = 0;
- return 0;
+ #error "CONFIG_SENSOR_RESET_IOCTL_USR is 1, sensor_reset_usr_cb function must be writed!!";
}
-static int rk29_sensor_ioctrl(struct device *dev,enum rk29camera_ioctrl_cmd cmd, int on)
-{
- unsigned int camera_power=INVALID_GPIO,camera_reset=INVALID_GPIO, camera_powerdown=INVALID_GPIO,camera_flash = INVALID_GPIO;
- unsigned int camera_ioflag,camera_io_init;
- int ret = RK29_CAM_IO_SUCCESS;
-
- if(rk29_camera_platform_data.gpio_res[0].dev_name && (strcmp(rk29_camera_platform_data.gpio_res[0].dev_name, dev_name(dev)) == 0)) {
- camera_power = rk29_camera_platform_data.gpio_res[0].gpio_power;
- camera_reset = rk29_camera_platform_data.gpio_res[0].gpio_reset;
- camera_powerdown = rk29_camera_platform_data.gpio_res[0].gpio_powerdown;
- camera_flash = rk29_camera_platform_data.gpio_res[0].gpio_flash;
- camera_ioflag = rk29_camera_platform_data.gpio_res[0].gpio_flag;
- camera_io_init = rk29_camera_platform_data.gpio_res[0].gpio_init;
- } else if (rk29_camera_platform_data.gpio_res[1].dev_name && (strcmp(rk29_camera_platform_data.gpio_res[1].dev_name, dev_name(dev)) == 0)) {
- camera_power = rk29_camera_platform_data.gpio_res[1].gpio_power;
- camera_reset = rk29_camera_platform_data.gpio_res[1].gpio_reset;
- camera_powerdown = rk29_camera_platform_data.gpio_res[1].gpio_powerdown;
- camera_flash = rk29_camera_platform_data.gpio_res[1].gpio_flash;
- camera_ioflag = rk29_camera_platform_data.gpio_res[1].gpio_flag;
- camera_io_init = rk29_camera_platform_data.gpio_res[1].gpio_init;
- }
-
- switch (cmd)
- {
- case Cam_Power:
- {
- if (camera_power != INVALID_GPIO) {
- if (camera_io_init & RK29_CAM_POWERACTIVE_MASK) {
- if (on) {
- gpio_set_value(camera_power, ((camera_ioflag&RK29_CAM_POWERACTIVE_MASK)>>RK29_CAM_POWERACTIVE_BITPOS));
- //printk("\n%s..%s..PowerPin=%d ..PinLevel = %x \n",__FUNCTION__,dev_name(dev), camera_power, ((camera_ioflag&RK29_CAM_POWERACTIVE_MASK)>>RK29_CAM_POWERACTIVE_BITPOS));
- msleep(10);
- } else {
- gpio_set_value(camera_power, (((~camera_ioflag)&RK29_CAM_POWERACTIVE_MASK)>>RK29_CAM_POWERACTIVE_BITPOS));
- //printk("\n%s..%s..PowerPin=%d ..PinLevel = %x \n",__FUNCTION__,dev_name(dev), camera_power, (((~camera_ioflag)&RK29_CAM_POWERACTIVE_MASK)>>RK29_CAM_POWERACTIVE_BITPOS));
- }
- } else {
- ret = RK29_CAM_EIO_REQUESTFAIL;
- printk("\n%s..%s..PowerPin=%d request failed!\n",__FUNCTION__,dev_name(dev),camera_reset);
- }
- } else {
- ret = RK29_CAM_EIO_INVALID;
- }
- break;
- }
- case Cam_Reset:
- {
- if (camera_reset != INVALID_GPIO) {
- if (camera_io_init & RK29_CAM_RESETACTIVE_MASK) {
- if (on) {
- gpio_set_value(camera_reset, ((camera_ioflag&RK29_CAM_RESETACTIVE_MASK)>>RK29_CAM_RESETACTIVE_BITPOS));
- //printk("\n%s..%s..ResetPin=%d ..PinLevel = %x \n",__FUNCTION__,dev_name(dev),camera_reset, ((camera_ioflag&RK29_CAM_RESETACTIVE_MASK)>>RK29_CAM_RESETACTIVE_BITPOS));
- } else {
- gpio_set_value(camera_reset,(((~camera_ioflag)&RK29_CAM_RESETACTIVE_MASK)>>RK29_CAM_RESETACTIVE_BITPOS));
- //printk("\n%s..%s..ResetPin= %d..PinLevel = %x \n",__FUNCTION__,dev_name(dev), camera_reset, (((~camera_ioflag)&RK29_CAM_RESETACTIVE_MASK)>>RK29_CAM_RESETACTIVE_BITPOS));
- }
- } else {
- ret = RK29_CAM_EIO_REQUESTFAIL;
- printk("\n%s..%s..ResetPin=%d request failed!\n",__FUNCTION__,dev_name(dev),camera_reset);
- }
- } else {
- ret = RK29_CAM_EIO_INVALID;
- }
- break;
- }
-
- case Cam_PowerDown:
- {
- if (camera_powerdown != INVALID_GPIO) {
- if (camera_io_init & RK29_CAM_POWERDNACTIVE_MASK) {
- if (on) {
- gpio_set_value(camera_powerdown, ((camera_ioflag&RK29_CAM_POWERDNACTIVE_MASK)>>RK29_CAM_POWERDNACTIVE_BITPOS));
- //printk("\n%s..%s..PowerDownPin=%d ..PinLevel = %x \n",__FUNCTION__,dev_name(dev),camera_powerdown, ((camera_ioflag&RK29_CAM_POWERDNACTIVE_MASK)>>RK29_CAM_POWERDNACTIVE_BITPOS));
- } else {
- gpio_set_value(camera_powerdown,(((~camera_ioflag)&RK29_CAM_POWERDNACTIVE_MASK)>>RK29_CAM_POWERDNACTIVE_BITPOS));
- //printk("\n%s..%s..PowerDownPin= %d..PinLevel = %x \n",__FUNCTION__,dev_name(dev), camera_powerdown, (((~camera_ioflag)&RK29_CAM_POWERDNACTIVE_MASK)>>RK29_CAM_POWERDNACTIVE_BITPOS));
- }
- } else {
- ret = RK29_CAM_EIO_REQUESTFAIL;
- printk("\n%s..%s..PowerDownPin=%d request failed!\n",__FUNCTION__,dev_name(dev),camera_powerdown);
- }
- } else {
- ret = RK29_CAM_EIO_INVALID;
- }
- break;
- }
-
- case Cam_Flash:
- {
- if (camera_flash != INVALID_GPIO) {
- if (camera_io_init & RK29_CAM_FLASHACTIVE_MASK) {
- switch (on)
- {
- case Flash_Off:
- {
- gpio_set_value(camera_flash,(((~camera_ioflag)&RK29_CAM_FLASHACTIVE_MASK)>>RK29_CAM_FLASHACTIVE_BITPOS));
- //printk("\n%s..%s..FlashPin= %d..PinLevel = %x \n",__FUNCTION__,dev_name(dev), camera_flash, (((~camera_ioflag)&RK29_CAM_FLASHACTIVE_MASK)>>RK29_CAM_FLASHACTIVE_BITPOS));
- break;
- }
-
- case Flash_On:
- {
- gpio_set_value(camera_flash, ((camera_ioflag&RK29_CAM_FLASHACTIVE_MASK)>>RK29_CAM_FLASHACTIVE_BITPOS));
- //printk("\n%s..%s..FlashPin=%d ..PinLevel = %x \n",__FUNCTION__,dev_name(dev),camera_flash, ((camera_ioflag&RK29_CAM_FLASHACTIVE_MASK)>>RK29_CAM_FLASHACTIVE_BITPOS));
- break;
- }
-
- case Flash_Torch:
- {
- gpio_set_value(camera_flash, ((camera_ioflag&RK29_CAM_FLASHACTIVE_MASK)>>RK29_CAM_FLASHACTIVE_BITPOS));
- //printk("\n%s..%s..FlashPin=%d ..PinLevel = %x \n",__FUNCTION__,dev_name(dev),camera_flash, ((camera_ioflag&RK29_CAM_FLASHACTIVE_MASK)>>RK29_CAM_FLASHACTIVE_BITPOS));
- break;
- }
-
- default:
- {
- printk("\n%s..%s..Flash command(%d) is invalidate \n",__FUNCTION__,dev_name(dev),on);
- break;
- }
- }
- } else {
- ret = RK29_CAM_EIO_REQUESTFAIL;
- printk("\n%s..%s..FlashPin=%d request failed!\n",__FUNCTION__,dev_name(dev),camera_flash);
- }
- } else {
- ret = RK29_CAM_EIO_INVALID;
- }
- break;
- }
+#endif
- default:
- {
- printk("%s cmd(0x%x) is unknown!\n",__FUNCTION__, cmd);
- break;
- }
- }
- return ret;
-}
-static int rk29_sensor_power(struct device *dev, int on)
-{
- rk29_sensor_ioctrl(dev,Cam_Power,on);
- return 0;
-}
-static int rk29_sensor_reset(struct device *dev)
+#if CONFIG_SENSOR_POWERDOWN_IOCTL_USR
+static int sensor_powerdown_usr_cb (struct rk29camera_gpio_res *res,int on)
{
- rk29_sensor_ioctrl(dev,Cam_Reset,1);
- msleep(2);
- rk29_sensor_ioctrl(dev,Cam_Reset,0);
- return 0;
+ #error "CONFIG_SENSOR_POWERDOWN_IOCTL_USR is 1, sensor_powerdown_usr_cb function must be writed!!";
}
-static int rk29_sensor_powerdown(struct device *dev, int on)
+#endif
+
+#if CONFIG_SENSOR_FLASH_IOCTL_USR
+static int sensor_flash_usr_cb (struct rk29camera_gpio_res *res,int on)
{
- return rk29_sensor_ioctrl(dev,Cam_PowerDown,on);
+ #error "CONFIG_SENSOR_FLASH_IOCTL_USR is 1, sensor_flash_usr_cb function must be writed!!";
}
-#if (SENSOR_IIC_ADDR_0 != 0x00)
-static struct i2c_board_info rk29_i2c_cam_info_0[] = {
- {
- I2C_BOARD_INFO(SENSOR_NAME_0, SENSOR_IIC_ADDR_0>>1)
- },
-};
-
-static struct soc_camera_link rk29_iclink_0 = {
- .bus_id = RK29_CAM_PLATFORM_DEV_ID,
- .power = rk29_sensor_power,
- .powerdown = rk29_sensor_powerdown,
- .board_info = &rk29_i2c_cam_info_0[0],
- .i2c_adapter_id = SENSOR_IIC_ADAPTER_ID_0,
- .module_name = SENSOR_NAME_0,
-};
-
-/*platform_device : soc-camera need */
-static struct platform_device rk29_soc_camera_pdrv_0 = {
- .name = "soc-camera-pdrv",
- .id = 0,
- .dev = {
- .init_name = SENSOR_NAME_0,
- .platform_data = &rk29_iclink_0,
- },
-};
#endif
-static struct i2c_board_info rk29_i2c_cam_info_1[] = {
- {
- I2C_BOARD_INFO(SENSOR_NAME_1, SENSOR_IIC_ADDR_1>>1)
- },
-};
-
-static struct soc_camera_link rk29_iclink_1 = {
- .bus_id = RK29_CAM_PLATFORM_DEV_ID,
- .power = rk29_sensor_power,
- .powerdown = rk29_sensor_powerdown,
- .board_info = &rk29_i2c_cam_info_1[0],
- .i2c_adapter_id = SENSOR_IIC_ADAPTER_ID_1,
- .module_name = SENSOR_NAME_1,
-};
-/*platform_device : soc-camera need */
-static struct platform_device rk29_soc_camera_pdrv_1 = {
- .name = "soc-camera-pdrv",
- .id = 1,
- .dev = {
- .init_name = SENSOR_NAME_1,
- .platform_data = &rk29_iclink_1,
- },
-};
+static struct rk29camera_platform_ioctl_cb sensor_ioctl_cb = {
+ #if CONFIG_SENSOR_POWER_IOCTL_USR
+ .sensor_power_cb = sensor_power_usr_cb,
+ #else
+ .sensor_power_cb = NULL,
+ #endif
+ #if CONFIG_SENSOR_RESET_IOCTL_USR
+ .sensor_reset_cb = sensor_reset_usr_cb,
+ #else
+ .sensor_reset_cb = NULL,
+ #endif
-static u64 rockchip_device_camera_dmamask = 0xffffffffUL;
-static struct resource rk29_camera_resource[] = {
- [0] = {
- .start = RK29_VIP_PHYS,
- .end = RK29_VIP_PHYS + RK29_VIP_SIZE - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = IRQ_VIP,
- .end = IRQ_VIP,
- .flags = IORESOURCE_IRQ,
- }
-};
+ #if CONFIG_SENSOR_POWERDOWN_IOCTL_USR
+ .sensor_powerdown_cb = sensor_powerdown_usr_cb,
+ #else
+ .sensor_powerdown_cb = NULL,
+ #endif
-/*platform_device : */
-static struct platform_device rk29_device_camera = {
- .name = RK29_CAM_DRV_NAME,
- .id = RK29_CAM_PLATFORM_DEV_ID, /* This is used to put cameras on this interface */
- .num_resources = ARRAY_SIZE(rk29_camera_resource),
- .resource = rk29_camera_resource,
- .dev = {
- .dma_mask = &rockchip_device_camera_dmamask,
- .coherent_dma_mask = 0xffffffffUL,
- .platform_data = &rk29_camera_platform_data,
- }
+ #if CONFIG_SENSOR_FLASH_IOCTL_USR
+ .sensor_flash_cb = sensor_flash_usr_cb,
+ #else
+ .sensor_flash_cb = NULL,
+ #endif
};
+#include "../../../drivers/media/video/rk29_camera.c"
#endif
/*****************************************************************************************
* backlight devices
#define PWM_GPIO RK29_PIN1_PB5
#define PWM_EFFECT_VALUE 1
-//#define LCD_DISP_ON_PIN
+#define LCD_DISP_ON_PIN
#ifdef LCD_DISP_ON_PIN
-#define BL_EN_MUX_NAME GPIOF34_UART3_SEL_NAME
-#define BL_EN_MUX_MODE IOMUXB_GPIO1_B34
+//#define BL_EN_MUX_NAME GPIOF34_UART3_SEL_NAME
+//#define BL_EN_MUX_MODE IOMUXB_GPIO1_B34
-#define BL_EN_PIN GPIO0L_GPIO0A5
+#define BL_EN_PIN RK29_PIN6_PD0
#define BL_EN_VALUE GPIO_HIGH
#endif
static int rk29_backlight_io_init(void)
rk29_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE);
#ifdef LCD_DISP_ON_PIN
- rk29_mux_api_set(BL_EN_MUX_NAME, BL_EN_MUX_MODE);
+ // rk29_mux_api_set(BL_EN_MUX_NAME, BL_EN_MUX_MODE);
ret = gpio_request(BL_EN_PIN, NULL);
if(ret != 0)
gpio_free(BL_EN_PIN);
#endif
rk29_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE_GPIO);
+
return ret;
}
{
int ret = 0;
rk29_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE_GPIO);
- if (ret = gpio_request(PWM_GPIO, NULL)) {
+ if (gpio_request(PWM_GPIO, NULL)) {
printk("func %s, line %d: request gpio fail\n", __FUNCTION__, __LINE__);
return -1;
}
gpio_direction_output(PWM_GPIO, GPIO_LOW);
+ #ifdef LCD_DISP_ON_PIN
+ gpio_direction_output(BL_EN_PIN, 0);
+ gpio_set_value(BL_EN_PIN, !BL_EN_VALUE);
+ #endif
return ret;
}
{
gpio_free(PWM_GPIO);
rk29_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE);
+
+ #ifdef LCD_DISP_ON_PIN
+ msleep(30);
+ gpio_direction_output(BL_EN_PIN, 1);
+ gpio_set_value(BL_EN_PIN, BL_EN_VALUE);
+ #endif
return 0;
}
#endif
+#if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT)
+#define SDMMC0_WRITE_PROTECT_PIN RK29_PIN6_PB0 //According to your own project to set the value of write-protect-pin.
+#endif
+
+
+#if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT)
+#define SDMMC1_WRITE_PROTECT_PIN RK29_PIN6_PB0 //According to your own project to set the value of write-protect-pin.
+#endif
+
/*****************************************************************************************
* SDMMC devices
*****************************************************************************************/
rk29_mux_api_set(GPIO1D3_SDMMC0DATA1_NAME, GPIO1H_SDMMC0_DATA1);
rk29_mux_api_set(GPIO1D4_SDMMC0DATA2_NAME, GPIO1H_SDMMC0_DATA2);
rk29_mux_api_set(GPIO1D5_SDMMC0DATA3_NAME, GPIO1H_SDMMC0_DATA3);
+
+#ifdef CONFIG_SDMMC_RK29_OLD
rk29_mux_api_set(GPIO2A2_SDMMC0DETECTN_NAME, GPIO2L_GPIO2A2);
+#else
+ rk29_mux_api_set(GPIO2A2_SDMMC0DETECTN_NAME, GPIO2L_SDMMC0_DETECT_N);//Modifyed by xbw.
+#endif
+
rk29_mux_api_set(GPIO5D5_SDMMC0PWREN_NAME, GPIO5H_GPIO5D5); ///GPIO5H_SDMMC0_PWR_EN); ///GPIO5H_GPIO5D5);
gpio_request(RK29_PIN5_PD5,"sdmmc");
#if 0
#else
gpio_direction_output(RK29_PIN5_PD5,GPIO_LOW);
#endif
+
+#if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT)
+ gpio_request(SDMMC0_WRITE_PROTECT_PIN,"sdmmc-wp");
+ gpio_direction_input(SDMMC0_WRITE_PROTECT_PIN);
+#endif
+
return 0;
}
#endif
.detect_irq = RK29_PIN2_PA2, // INVALID_GPIO
.enable_sd_wakeup = 0,
+
+#if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT)
+ .write_prt = SDMMC0_WRITE_PROTECT_PIN,
+#else
+ .write_prt = INVALID_GPIO,
+#endif
};
#endif
#ifdef CONFIG_SDMMC1_RK29
rk29_mux_api_set(GPIO1C5_SDMMC1DATA2_NAME, GPIO1H_SDMMC1_DATA2);
rk29_mux_api_set(GPIO1C6_SDMMC1DATA3_NAME, GPIO1H_SDMMC1_DATA3);
//rk29_mux_api_set(GPIO1C0_UART0CTSN_SDMMC1DETECTN_NAME, GPIO1H_SDMMC1_DETECT_N);
+
+#if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT)
+ gpio_request(SDMMC1_WRITE_PROTECT_PIN,"sdio-wp");
+ gpio_direction_input(SDMMC1_WRITE_PROTECT_PIN);
+#endif
return 0;
}
#if 0
.detect_irq = RK29SDK_WIFI_SDIO_CARD_DETECT_N,
#endif
+
+#if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT)
+ .write_prt = SDMMC1_WRITE_PROTECT_PIN,
+#else
+ .write_prt = INVALID_GPIO,
+#endif
+
};
#endif
#ifdef CONFIG_VIVANTE
+#define GPU_HIGH_CLOCK 552
+#define GPU_LOW_CLOCK (periph_pll_default / 1000000) /* same as general pll clock rate below */
static struct resource resources_gpu[] = {
[0] = {
.name = "gpu_irq",
.flags = IORESOURCE_IRQ,
},
[1] = {
- .name = "gpu_base",
+ .name = "gpu_base",
.start = RK29_GPU_PHYS,
- .end = RK29_GPU_PHYS + RK29_GPU_SIZE,
+ .end = RK29_GPU_PHYS + RK29_GPU_SIZE - 1,
.flags = IORESOURCE_MEM,
},
[2] = {
- .name = "gpu_mem",
+ .name = "gpu_mem",
.start = PMEM_GPU_BASE,
- .end = PMEM_GPU_BASE + PMEM_GPU_SIZE,
+ .end = PMEM_GPU_BASE + PMEM_GPU_SIZE - 1,
.flags = IORESOURCE_MEM,
},
+ [3] = {
+ .name = "gpu_clk",
+ .start = GPU_LOW_CLOCK,
+ .end = GPU_HIGH_CLOCK,
+ .flags = IORESOURCE_IO,
+ },
};
static struct platform_device rk29_device_gpu = {
.name = "galcore",
.resource = resources_gpu,
};
#endif
+
#ifdef CONFIG_KEYS_RK29
extern struct rk29_keys_platform_data rk29_keys_pdata;
static struct platform_device rk29_device_keys = {
};
#endif
+#ifdef CONFIG_LEDS_GPIO_PLATFORM
+struct gpio_led rk29_leds[] = {
+ {
+ .name = "rk29_red_led",
+ .gpio = RK29_PIN4_PB2,
+ .default_trigger = "timer",
+ .active_low = 0,
+ .retain_state_suspended = 1,
+ .default_state = LEDS_GPIO_DEFSTATE_OFF,
+ },
+ {
+ .name = "rk29_green_led",
+ .gpio = RK29_PIN4_PB1,
+ .default_trigger = "timer",
+ .active_low = 0,
+ .retain_state_suspended = 1,
+ .default_state = LEDS_GPIO_DEFSTATE_OFF,
+ },
+ {
+ .name = "rk29_blue_led",
+ .gpio = RK29_PIN4_PB0,
+ .default_trigger = "timer",
+ .active_low = 0,
+ .retain_state_suspended = 1,
+ .default_state = LEDS_GPIO_DEFSTATE_OFF,
+ },
+};
+
+struct gpio_led_platform_data rk29_leds_pdata = {
+ .leds = &rk29_leds,
+ .num_leds = ARRAY_SIZE(rk29_leds),
+};
+
+struct platform_device rk29_device_gpio_leds = {
+ .name = "leds-gpio",
+ .id = -1,
+ .dev = {
+ .platform_data = &rk29_leds_pdata,
+ },
+};
+#endif
+
+#ifdef CONFIG_LEDS_NEWTON_PWM
+static struct led_newton_pwm rk29_pwm_leds[] = {
+ {
+ .name = "power_led",
+ .pwm_id = 1,
+ .pwm_gpio = RK29_PIN5_PD2,
+ .pwm_iomux_name = GPIO5D2_PWM1_UART1SIRIN_NAME,
+ .pwm_iomux_pwm = GPIO5H_PWM1,
+ .pwm_iomux_gpio = GPIO5H_GPIO5D2,
+ .freq = 1000,
+ .period = 255,
+ },
+};
+
+static struct led_newton_pwm_platform_data rk29_pwm_leds_pdata = {
+ .leds = &rk29_pwm_leds,
+ .num_leds = ARRAY_SIZE(rk29_pwm_leds),
+};
+
+static struct platform_device rk29_device_pwm_leds = {
+ .name = "leds_newton_pwm",
+ .id = -1,
+ .dev = {
+ .platform_data = &rk29_pwm_leds_pdata,
+ },
+};
+
+#endif
static void __init rk29_board_iomux_init(void)
{
#ifdef CONFIG_RK29_PWM_REGULATOR
}
static struct platform_device *devices[] __initdata = {
+
+#ifdef CONFIG_RK29_WATCHDOG
+ &rk29_device_wdt,
+#endif
+
#ifdef CONFIG_UART1_RK29
&rk29_device_uart1,
#endif
#ifdef CONFIG_KEYS_RK29
&rk29_device_keys,
#endif
+#ifdef CONFIG_KEYS_RK29_NEWTON
+ &rk29_device_keys,
+#endif
#ifdef CONFIG_SDMMC0_RK29
&rk29_device_sdmmc0,
#endif
#ifdef CONFIG_BACKLIGHT_RK29_BL
&rk29_device_backlight,
#endif
+#ifdef CONFIG_BACKLIGHT_RK29_NEWTON_BL
+ &rk29_device_backlight,
+#endif
#ifdef CONFIG_RK29_VMAC
&rk29_device_vmac,
#endif
#endif
#ifdef CONFIG_VIDEO_RK29
&rk29_device_camera, /* ddl@rock-chips.com : camera support */
- #if (SENSOR_IIC_ADDR_0 != 0x00)
+ #if (CONFIG_SENSOR_IIC_ADDR_0 != 0x00)
&rk29_soc_camera_pdrv_0,
#endif
&rk29_soc_camera_pdrv_1,
&android_pmem_cam_device,
+#endif
+#if PMEM_SKYPE_SIZE > 0
+ &android_pmem_skype_device,
#endif
&android_pmem_device,
&rk29_vpu_mem_device,
&android_usb_device,
&usb_mass_storage_device,
#endif
+#ifdef CONFIG_USB_ANDROID_RNDIS
+ &rk29_device_rndis,
+#endif
#ifdef CONFIG_RK29_IPP
&rk29_device_ipp,
#endif
#ifdef CONFIG_VIDEO_RK29XX_VOUT
&rk29_v4l2_output_devce,
#endif
+#ifdef CONFIG_RK29_NEWTON
+ &rk29_device_newton,
+#endif
+#ifdef CONFIG_RK_IRDA
+ &irda_device,
+#endif
+#ifdef CONFIG_LEDS_GPIO_PLATFORM
+ &rk29_device_gpio_leds,
+#endif
+#ifdef CONFIG_LEDS_NEWTON_PWM
+ &rk29_device_pwm_leds,
+#endif
+#ifdef CONFIG_SND_RK29_SOC_CS42L52
+ &rk29_cs42l52_device,
+#endif
};
/*****************************************************************************************
rk29_gpio_init();
}
+static struct cpufreq_frequency_table freq_table[] = {
+ { .index = 1200000, .frequency = 408000 },
+ { .index = 1200000, .frequency = 816000 },
+ { .index = 1300000, .frequency = 1008000 },
+ { .frequency = CPUFREQ_TABLE_END },
+};
+
static void __init machine_rk29_board_init(void)
{
rk29_board_iomux_init();
board_power_init();
+ board_update_cpufreq_table(freq_table);
platform_add_devices(devices, ARRAY_SIZE(devices));
#ifdef CONFIG_I2C0_RK29
#endif
board_usb_detect_init(RK29_PIN0_PA0);
+#if defined(CONFIG_RK_IRDA) || defined(CONFIG_BU92747GUW_CIR)
+ smc0_init(NULL);
+ bu92747guw_io_init();
+#endif
+
}
static void __init machine_rk29_fixup(struct machine_desc *desc, struct tag *tags,
mi->bank[0].start = RK29_SDRAM_PHYS;
mi->bank[0].node = PHYS_TO_NID(RK29_SDRAM_PHYS);
mi->bank[0].size = LINUX_SIZE;
+#if SDRAM_SIZE > SZ_512M
+ mi->nr_banks = 2;
+ mi->bank[1].start = RK29_SDRAM_PHYS + SZ_512M;
+ mi->bank[1].size = SDRAM_SIZE - SZ_512M;
+#endif
}
static void __init machine_rk29_mapio(void)
rk29_map_common_io();
rk29_setup_early_printk();
rk29_sram_init();
- rk29_clock_init(periph_pll_288mhz);
+ rk29_clock_init(periph_pll_default);
rk29_iomux_init();
+ ddr_init(DDR_TYPE, DDR_FREQ);
}
MACHINE_START(RK29, "RK29board")
/* UART for LL DEBUG */
- .phys_io = RK29_UART1_PHYS,
+ .phys_io = RK29_UART1_PHYS & 0xfff00000,
.io_pg_offst = ((RK29_UART1_BASE) >> 18) & 0xfffc,
.boot_params = RK29_SDRAM_PHYS + 0x88000,
.fixup = machine_rk29_fixup,