From: 蔡枫 Date: Tue, 28 Jun 2011 07:24:06 +0000 (+0800) Subject: add camera support and rtc for newton board X-Git-Tag: firefly_0821_release~10167 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f1838475184cd3fd94656ce23bc3b3e0bd02d866;p=firefly-linux-kernel-4.4.55.git add camera support and rtc for newton board --- diff --git a/arch/arm/configs/rk29_newton_defconfig b/arch/arm/configs/rk29_newton_defconfig index d98afca37bab..cfb9c1d944f6 100644 --- a/arch/arm/configs/rk29_newton_defconfig +++ b/arch/arm/configs/rk29_newton_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Linux kernel version: 2.6.32.27 -# Sat Jun 25 21:45:29 2011 +# Tue Jun 28 10:17:07 2011 # CONFIG_ARM=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y @@ -655,6 +655,7 @@ CONFIG_APANIC_PLABEL="kpanic" # CONFIG_MTK23D is not set # CONFIG_FM580X is not set # CONFIG_MU509 is not set +CONFIG_RK29_NEWTON=y # CONFIG_C2PORT is not set # @@ -664,8 +665,7 @@ CONFIG_APANIC_PLABEL="kpanic" # CONFIG_EEPROM_LEGACY is not set # CONFIG_EEPROM_MAX6875 is not set # CONFIG_EEPROM_93CX6 is not set -CONFIG_RK29_SUPPORT_MODEM=y -CONFIG_MODEM_ROCKCHIP_DEMO=y +# CONFIG_RK29_SUPPORT_MODEM is not set # CONFIG_RK29_GPS is not set # @@ -946,7 +946,8 @@ CONFIG_UART0_CTS_RTS_RK29=y CONFIG_UART1_RK29=y CONFIG_UART2_RK29=y CONFIG_UART2_CTS_RTS_RK29=y -# CONFIG_UART3_RK29 is not set +CONFIG_UART3_RK29=y +CONFIG_UART3_CTS_RTS_RK29=y CONFIG_SERIAL_RK29_CONSOLE=y CONFIG_UNIX98_PTYS=y # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set @@ -980,9 +981,6 @@ CONFIG_RK29_I2C1_CONTROLLER=y CONFIG_I2C2_RK29=y CONFIG_RK29_I2C2_CONTROLLER=y # CONFIG_RK29_I2C2_GPIO is not set -CONFIG_I2C3_RK29=y -CONFIG_RK29_I2C3_CONTROLLER=y -# CONFIG_RK29_I2C3_GPIO is not set CONFIG_I2C_DEV_RK29=y # @@ -1013,7 +1011,7 @@ CONFIG_RK_HEADSET_DET=y CONFIG_ARCH_REQUIRE_GPIOLIB=y CONFIG_GPIOLIB=y # CONFIG_DEBUG_GPIO is not set -# CONFIG_GPIO_SYSFS is not set +CONFIG_GPIO_SYSFS=y # # Memory mapped GPIO expanders: @@ -1157,9 +1155,9 @@ CONFIG_SOC_CAMERA=y # CONFIG_SOC_CAMERA_PLATFORM is not set # CONFIG_SOC_CAMERA_OV772X is not set # CONFIG_SOC_CAMERA_OV7675 is not set -# CONFIG_SOC_CAMERA_OV2655 is not set +CONFIG_SOC_CAMERA_OV2655=y # CONFIG_SOC_CAMERA_OV2659 is not set -CONFIG_SOC_CAMERA_OV9650=y +# CONFIG_SOC_CAMERA_OV9650 is not set # CONFIG_SOC_CAMERA_OV2640 is not set # CONFIG_SOC_CAMERA_OV3640 is not set # CONFIG_SOC_CAMERA_OV5642 is not set @@ -1682,7 +1680,7 @@ CONFIG_RTC_INTF_ALARM_DEV=y # I2C RTC drivers # # CONFIG_RTC_HYM8563 is not set -CONFIG_RTC_DRV_M41T66=y +CONFIG_RTC_M41T66=y # CONFIG_RTC_DRV_DS1307 is not set # CONFIG_RTC_DRV_DS1374 is not set # CONFIG_RTC_DRV_DS1672 is not set diff --git a/arch/arm/mach-rk29/board-rk29-newton.c b/arch/arm/mach-rk29/board-rk29-newton.c index e7a2e8256821..08304f2290f6 100755 --- a/arch/arm/mach-rk29/board-rk29-newton.c +++ b/arch/arm/mach-rk29/board-rk29-newton.c @@ -63,15 +63,15 @@ #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_PIN5_PD7 +#define CONFIG_SENSOR_POWERDN_PIN_0 INVALID_GPIO #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_1 RK29_CAM_SENSOR_OV2655 /* 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 @@ -396,7 +396,17 @@ static struct platform_device rk29_v4l2_output_devce = { .name = "rk29_vout", }; #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 @@ -1468,6 +1478,9 @@ static struct platform_device *devices[] __initdata = { #ifdef CONFIG_VIDEO_RK29XX_VOUT &rk29_v4l2_output_devce, #endif +#ifdef CONFIG_RK29_NEWTON + &rk29_device_newton, +#endif }; /***************************************************************************************** diff --git a/arch/arm/mach-rk29/include/mach/board.h b/arch/arm/mach-rk29/include/mach/board.h index 7f66850eb05d..e4b3d924b6ef 100755 --- a/arch/arm/mach-rk29/include/mach/board.h +++ b/arch/arm/mach-rk29/include/mach/board.h @@ -242,6 +242,8 @@ struct rk29_gpio_expander_info { unsigned int pin_type;//GPIO_IN or GPIO_OUT unsigned int pin_value;//GPIO_HIGH or GPIO_LOW }; +struct rk29_newton_data { +}; struct tca6424_platform_data { /* the first extern gpio number in all of gpio groups */ diff --git a/drivers/input/touchscreen/ft5406_ts.c b/drivers/input/touchscreen/ft5406_ts.c index 72ae097c9fb8..c262782ced79 100755 --- a/drivers/input/touchscreen/ft5406_ts.c +++ b/drivers/input/touchscreen/ft5406_ts.c @@ -491,8 +491,8 @@ static void ft5x0x_report_value(struct ft5x0x_ts_data *data ) input_report_abs(data->input_dev, ABS_Y, event->y1); input_report_abs(data->input_dev, ABS_PRESSURE, event->pressure); //} - //printk("x = %d,y = %d\n",event->x1,event->y1); - input_report_key(data->input_dev, BTN_TOUCH, 1); + printk("x = %d,y = %d\n",event->x1,event->y1); + //input_report_key(data->input_dev, BTN_TOUCH, 1); #endif /* CONFIG_FT5X0X_MULTITOUCH*/ input_sync(data->input_dev); diff --git a/drivers/media/video/ov2655.c b/drivers/media/video/ov2655.c index 3699deffa2c9..df7b8a8ab9eb 100755 --- a/drivers/media/video/ov2655.c +++ b/drivers/media/video/ov2655.c @@ -70,7 +70,7 @@ module_param(debug, int, S_IRUGO|S_IWUSR); #define CONFIG_SENSOR_I2C_SPEED 100000 /* Hz */ /* Sensor write register continues by preempt_disable/preempt_enable for current process not be scheduled */ -#define CONFIG_SENSOR_I2C_NOSCHED 1 +#define CONFIG_SENSOR_I2C_NOSCHED 0 #define CONFIG_SENSOR_I2C_RDWRCHK 1 #define SENSOR_BUS_PARAM (SOCAM_MASTER | SOCAM_PCLK_SAMPLE_RISING |\ diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig old mode 100644 new mode 100755 index b47b6b51cfde..0d3ad52ea80d --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -300,6 +300,10 @@ config MU509 bool "MU509 modem control driver" default n +config RK29_NEWTON + bool "RK29_NEWTON misc driver" + default n + source "drivers/misc/c2port/Kconfig" source "drivers/misc/eeprom/Kconfig" source "drivers/misc/cb710/Kconfig" diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile old mode 100644 new mode 100755 index 73819025e527..c3dc3cf11ce2 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile @@ -35,3 +35,5 @@ obj-$(CONFIG_STE) += ste.o obj-$(CONFIG_RK29_SUPPORT_MODEM) += rk29_modem/ obj-$(CONFIG_GPS_GNS7560) += gps/ obj-y += mpu3050/ +obj-$(CONFIG_RK29_NEWTON) += newton.o + diff --git a/drivers/misc/newton.c b/drivers/misc/newton.c new file mode 100755 index 000000000000..1099dd5fdd39 --- /dev/null +++ b/drivers/misc/newton.c @@ -0,0 +1,155 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + + +#if 1 +#define DBG(x...) printk(KERN_INFO x) +#else +#define DBG(x...) +#endif + + + + + + +int rk29_newton_open(struct inode *inode, struct file *filp) +{ + DBG("%s\n",__FUNCTION__); + + return 0; +} + +ssize_t rk29_newton_read(struct file *filp, char __user *ptr, size_t size, loff_t *pos) +{ + DBG("%s\n",__FUNCTION__); + return sizeof(int); +} + +int rk29_newton_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) +{ + int ret = 0; + struct rk29_newton_data *pdata ;//= pgps; + DBG("%s\n",__FUNCTION__); + return ret; +} + + +int rk29_newton_release(struct inode *inode, struct file *filp) +{ + DBG("%s\n",__FUNCTION__); + + return 0; +} + + +static struct file_operations rk29_newton_fops = { + .owner = THIS_MODULE, + .open = rk29_newton_open, + .read = rk29_newton_read, + .ioctl = rk29_newton_ioctl, + .release = rk29_newton_release, +}; + + +static struct miscdevice rk29_newton_dev = +{ + .minor = MISC_DYNAMIC_MINOR, + .name = "newton", + .fops = &rk29_newton_fops, +}; + + +static int rk29_newton_probe(struct platform_device *pdev) +{ + int ret = 0; + struct rk29_newton_data *pdata = pdev->dev.platform_data; + if(!pdata) + return -1; + DBG("%s",__FUNCTION__); + ret = misc_register(&rk29_newton_dev); + if (ret < 0){ + printk("rk29 newton register err!\n"); + return ret; + } + #if 0 + init_MUTEX(&pdata->power_sem); + pdata->wq = create_freezeable_workqueue("rk29_gps"); + INIT_WORK(&pdata->work, rk29_gps_delay_power_downup); + pdata->power_flag = 0; + + //gps power down + rk29_gps_uart_to_gpio(pdata->uart_id); + if (pdata->power_down) + pdata->power_down(); + if (pdata->reset) + pdata->reset(GPIO_LOW); + + pgps = pdata; +#endif + + DBG("%s:rk29 newton initialized\n",__FUNCTION__); + + return ret; +} + +static int rk29_newton_remove(struct platform_device *pdev) +{ + misc_deregister(&rk29_newton_dev); + return 0; +} + + +int rk29_newton_suspend(struct platform_device *pdev, pm_message_t state) +{ + return 0; +} + +int rk29_newton_resume(struct platform_device *pdev) +{ + return 0; +} + + +static struct platform_driver rk29_newton_driver = { + .probe = rk29_newton_probe, + .remove = rk29_newton_remove, + .suspend = rk29_newton_suspend, + .resume = rk29_newton_resume, + .driver = { + .name = "rk29_newton", + .owner = THIS_MODULE, + }, +}; + +static int __init rk29_newton_init(void) +{ + return platform_driver_register(&rk29_newton_driver); +} + +static void __exit rk29_newton_exit(void) +{ + platform_driver_unregister(&rk29_newton_driver); +} + +module_init(rk29_newton_init); +module_exit(rk29_newton_exit); +MODULE_DESCRIPTION ("rk29 newton misc driver"); +MODULE_LICENSE("GPL"); + diff --git a/drivers/rtc/rtc-m41t66.c b/drivers/rtc/rtc-m41t66.c index c233068971e1..f4dee44b7586 100755 --- a/drivers/rtc/rtc-m41t66.c +++ b/drivers/rtc/rtc-m41t66.c @@ -101,7 +101,7 @@ #define DRV_VERSION "0.05" -#define DRV_NAME "rtc-M41T62" +#define DRV_NAME "rtc-M41T66" #if 1 #define DBG printk//(x...) printk(KERN_INFO "rtc-M41T62:" x) #else