Merge remote-tracking branch 'kernel-2.6.32/develop' into develop-2.6.36

Conflicts:
	drivers/input/touchscreen/Makefile
	drivers/media/video/rk29_camera.c
	sound/soc/codecs/wm8994.c
This commit is contained in:
黄涛
2011-08-09 10:06:42 +08:00
46 changed files with 6929 additions and 5111 deletions

View File

@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.32.27
# Fri Jul 29 16:43:33 2011
# Tue Aug 2 19:48:07 2011
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -58,7 +58,7 @@ CONFIG_RCU_FANOUT=32
# CONFIG_RCU_FANOUT_EXACT is not set
# CONFIG_TREE_RCU_TRACE is not set
# CONFIG_IKCONFIG is not set
CONFIG_LOG_BUF_SHIFT=17
CONFIG_LOG_BUF_SHIFT=19
CONFIG_CGROUPS=y
CONFIG_CGROUP_DEBUG=y
# CONFIG_CGROUP_NS is not set
@@ -234,7 +234,7 @@ CONFIG_MACH_RK29_newton=y
# CONFIG_DDR_TYPE_DDR3_2133N is not set
CONFIG_DDR_TYPE_DDR3_DEFAULT=y
CONFIG_RK29_MEM_SIZE_M=512
CONFIG_DDR_SDRAM_FREQ=456
CONFIG_DDR_SDRAM_FREQ=400
# CONFIG_DDR_RECONFIG is not set
CONFIG_WIFI_CONTROL_FUNC=y
@@ -419,7 +419,9 @@ CONFIG_XFRM=y
# CONFIG_XFRM_SUB_POLICY is not set
# CONFIG_XFRM_MIGRATE is not set
# CONFIG_XFRM_STATISTICS is not set
# CONFIG_NET_KEY is not set
CONFIG_XFRM_IPCOMP=y
CONFIG_NET_KEY=y
# CONFIG_NET_KEY_MIGRATE is not set
CONFIG_INET=y
# CONFIG_IP_MULTICAST is not set
# CONFIG_IP_ADVANCED_ROUTER is not set
@@ -433,7 +435,7 @@ CONFIG_IP_PNP_RARP=y
# CONFIG_ARPD is not set
# CONFIG_SYN_COOKIES is not set
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
CONFIG_INET_ESP=y
# CONFIG_INET_IPCOMP is not set
# CONFIG_INET_XFRM_TUNNEL is not set
CONFIG_INET_TUNNEL=y
@@ -448,27 +450,146 @@ CONFIG_TCP_CONG_CUBIC=y
CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_TCP_MD5SIG is not set
CONFIG_IPV6=y
# CONFIG_IPV6_PRIVACY is not set
# CONFIG_IPV6_ROUTER_PREF is not set
# CONFIG_IPV6_OPTIMISTIC_DAD is not set
# CONFIG_INET6_AH is not set
# CONFIG_INET6_ESP is not set
# CONFIG_INET6_IPCOMP is not set
# CONFIG_IPV6_MIP6 is not set
# CONFIG_INET6_XFRM_TUNNEL is not set
# CONFIG_INET6_TUNNEL is not set
CONFIG_IPV6_PRIVACY=y
CONFIG_IPV6_ROUTER_PREF=y
# CONFIG_IPV6_ROUTE_INFO is not set
CONFIG_IPV6_OPTIMISTIC_DAD=y
CONFIG_INET6_AH=y
CONFIG_INET6_ESP=y
CONFIG_INET6_IPCOMP=y
CONFIG_IPV6_MIP6=y
CONFIG_INET6_XFRM_TUNNEL=y
CONFIG_INET6_TUNNEL=y
CONFIG_INET6_XFRM_MODE_TRANSPORT=y
CONFIG_INET6_XFRM_MODE_TUNNEL=y
CONFIG_INET6_XFRM_MODE_BEET=y
# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
CONFIG_IPV6_SIT=y
CONFIG_IPV6_NDISC_NODETYPE=y
# CONFIG_IPV6_TUNNEL is not set
# CONFIG_IPV6_MULTIPLE_TABLES is not set
CONFIG_IPV6_TUNNEL=y
CONFIG_IPV6_MULTIPLE_TABLES=y
# CONFIG_IPV6_SUBTREES is not set
# CONFIG_IPV6_MROUTE is not set
CONFIG_ANDROID_PARANOID_NETWORK=y
# CONFIG_NETWORK_SECMARK is not set
# CONFIG_NETFILTER is not set
CONFIG_NETFILTER=y
CONFIG_NETFILTER_DEBUG=y
CONFIG_NETFILTER_ADVANCED=y
#
# Core Netfilter Configuration
#
CONFIG_NETFILTER_NETLINK=y
CONFIG_NETFILTER_NETLINK_QUEUE=y
CONFIG_NETFILTER_NETLINK_LOG=y
CONFIG_NF_CONNTRACK=y
CONFIG_NF_CT_ACCT=y
CONFIG_NF_CONNTRACK_MARK=y
CONFIG_NF_CONNTRACK_EVENTS=y
CONFIG_NF_CT_PROTO_DCCP=y
CONFIG_NF_CT_PROTO_GRE=y
CONFIG_NF_CT_PROTO_SCTP=y
CONFIG_NF_CT_PROTO_UDPLITE=y
CONFIG_NF_CONNTRACK_AMANDA=y
CONFIG_NF_CONNTRACK_FTP=y
CONFIG_NF_CONNTRACK_H323=y
CONFIG_NF_CONNTRACK_IRC=y
CONFIG_NF_CONNTRACK_NETBIOS_NS=y
CONFIG_NF_CONNTRACK_PPTP=y
CONFIG_NF_CONNTRACK_SANE=y
CONFIG_NF_CONNTRACK_SIP=y
CONFIG_NF_CONNTRACK_TFTP=y
CONFIG_NF_CT_NETLINK=y
CONFIG_NETFILTER_XTABLES=y
CONFIG_NETFILTER_XT_TARGET_CLASSIFY=y
CONFIG_NETFILTER_XT_TARGET_CONNMARK=y
# CONFIG_NETFILTER_XT_TARGET_LED is not set
CONFIG_NETFILTER_XT_TARGET_MARK=y
# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set
CONFIG_NETFILTER_XT_TARGET_NFQUEUE=y
# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set
# CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set
# CONFIG_NETFILTER_XT_MATCH_CLUSTER is not set
CONFIG_NETFILTER_XT_MATCH_COMMENT=y
CONFIG_NETFILTER_XT_MATCH_CONNBYTES=y
CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=y
CONFIG_NETFILTER_XT_MATCH_CONNMARK=y
CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y
# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
# CONFIG_NETFILTER_XT_MATCH_DSCP is not set
# CONFIG_NETFILTER_XT_MATCH_ESP is not set
CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=y
CONFIG_NETFILTER_XT_MATCH_HELPER=y
CONFIG_NETFILTER_XT_MATCH_HL=y
CONFIG_NETFILTER_XT_MATCH_IPRANGE=y
CONFIG_NETFILTER_XT_MATCH_LENGTH=y
CONFIG_NETFILTER_XT_MATCH_LIMIT=y
CONFIG_NETFILTER_XT_MATCH_MAC=y
CONFIG_NETFILTER_XT_MATCH_MARK=y
# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set
CONFIG_NETFILTER_XT_MATCH_OWNER=y
CONFIG_NETFILTER_XT_MATCH_POLICY=y
CONFIG_NETFILTER_XT_MATCH_PKTTYPE=y
CONFIG_NETFILTER_XT_MATCH_QUOTA=y
# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set
# CONFIG_NETFILTER_XT_MATCH_REALM is not set
# CONFIG_NETFILTER_XT_MATCH_RECENT is not set
# CONFIG_NETFILTER_XT_MATCH_SCTP is not set
CONFIG_NETFILTER_XT_MATCH_STATE=y
CONFIG_NETFILTER_XT_MATCH_STATISTIC=y
CONFIG_NETFILTER_XT_MATCH_STRING=y
# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set
CONFIG_NETFILTER_XT_MATCH_TIME=y
CONFIG_NETFILTER_XT_MATCH_U32=y
# CONFIG_NETFILTER_XT_MATCH_OSF is not set
# CONFIG_IP_VS is not set
#
# IP: Netfilter Configuration
#
CONFIG_NF_DEFRAG_IPV4=y
CONFIG_NF_CONNTRACK_IPV4=y
CONFIG_NF_CONNTRACK_PROC_COMPAT=y
# CONFIG_IP_NF_QUEUE is not set
CONFIG_IP_NF_IPTABLES=y
CONFIG_IP_NF_MATCH_ADDRTYPE=y
CONFIG_IP_NF_MATCH_AH=y
CONFIG_IP_NF_MATCH_ECN=y
CONFIG_IP_NF_MATCH_TTL=y
CONFIG_IP_NF_FILTER=y
CONFIG_IP_NF_TARGET_REJECT=y
CONFIG_IP_NF_TARGET_LOG=y
# CONFIG_IP_NF_TARGET_ULOG is not set
CONFIG_NF_NAT=y
CONFIG_NF_NAT_NEEDED=y
CONFIG_IP_NF_TARGET_MASQUERADE=y
CONFIG_IP_NF_TARGET_NETMAP=y
CONFIG_IP_NF_TARGET_REDIRECT=y
# CONFIG_NF_NAT_SNMP_BASIC is not set
CONFIG_NF_NAT_PROTO_DCCP=y
CONFIG_NF_NAT_PROTO_GRE=y
CONFIG_NF_NAT_PROTO_UDPLITE=y
CONFIG_NF_NAT_PROTO_SCTP=y
CONFIG_NF_NAT_FTP=y
CONFIG_NF_NAT_IRC=y
CONFIG_NF_NAT_TFTP=y
CONFIG_NF_NAT_AMANDA=y
CONFIG_NF_NAT_PPTP=y
CONFIG_NF_NAT_H323=y
CONFIG_NF_NAT_SIP=y
# CONFIG_IP_NF_MANGLE is not set
# CONFIG_IP_NF_TARGET_TTL is not set
# CONFIG_IP_NF_RAW is not set
CONFIG_IP_NF_ARPTABLES=y
CONFIG_IP_NF_ARPFILTER=y
CONFIG_IP_NF_ARP_MANGLE=y
#
# IPv6: Netfilter Configuration
#
# CONFIG_NF_CONNTRACK_IPV6 is not set
# CONFIG_IP6_NF_QUEUE is not set
# CONFIG_IP6_NF_IPTABLES is not set
# CONFIG_IP_DCCP is not set
# CONFIG_IP_SCTP is not set
# CONFIG_RDS is not set
@@ -487,7 +608,60 @@ CONFIG_ANDROID_PARANOID_NETWORK=y
# CONFIG_WAN_ROUTER is not set
# CONFIG_PHONET is not set
# CONFIG_IEEE802154 is not set
# CONFIG_NET_SCHED is not set
CONFIG_NET_SCHED=y
#
# Queueing/Scheduling
#
# CONFIG_NET_SCH_CBQ is not set
CONFIG_NET_SCH_HTB=y
# CONFIG_NET_SCH_HFSC is not set
# CONFIG_NET_SCH_PRIO is not set
# CONFIG_NET_SCH_MULTIQ is not set
# CONFIG_NET_SCH_RED is not set
# CONFIG_NET_SCH_SFQ is not set
# CONFIG_NET_SCH_TEQL is not set
# CONFIG_NET_SCH_TBF is not set
# CONFIG_NET_SCH_GRED is not set
# CONFIG_NET_SCH_DSMARK is not set
# CONFIG_NET_SCH_NETEM is not set
# CONFIG_NET_SCH_DRR is not set
CONFIG_NET_SCH_INGRESS=y
#
# Classification
#
CONFIG_NET_CLS=y
# CONFIG_NET_CLS_BASIC is not set
# CONFIG_NET_CLS_TCINDEX is not set
# CONFIG_NET_CLS_ROUTE4 is not set
# CONFIG_NET_CLS_FW is not set
CONFIG_NET_CLS_U32=y
# CONFIG_CLS_U32_PERF is not set
# CONFIG_CLS_U32_MARK is not set
# CONFIG_NET_CLS_RSVP is not set
# CONFIG_NET_CLS_RSVP6 is not set
# CONFIG_NET_CLS_FLOW is not set
# CONFIG_NET_CLS_CGROUP is not set
CONFIG_NET_EMATCH=y
CONFIG_NET_EMATCH_STACK=32
# CONFIG_NET_EMATCH_CMP is not set
# CONFIG_NET_EMATCH_NBYTE is not set
CONFIG_NET_EMATCH_U32=y
# CONFIG_NET_EMATCH_META is not set
# CONFIG_NET_EMATCH_TEXT is not set
CONFIG_NET_CLS_ACT=y
CONFIG_NET_ACT_POLICE=y
CONFIG_NET_ACT_GACT=y
# CONFIG_GACT_PROB is not set
CONFIG_NET_ACT_MIRRED=y
# CONFIG_NET_ACT_IPT is not set
# CONFIG_NET_ACT_NAT is not set
# CONFIG_NET_ACT_PEDIT is not set
# CONFIG_NET_ACT_SIMP is not set
# CONFIG_NET_ACT_SKBEDIT is not set
# CONFIG_NET_CLS_IND is not set
CONFIG_NET_SCH_FIFO=y
# CONFIG_DCB is not set
#
@@ -565,6 +739,7 @@ CONFIG_BT_HCIBCM4325=y
CONFIG_IDBLOCK=y
# CONFIG_WIFI_MAC is not set
# CONFIG_AF_RXRPC is not set
CONFIG_FIB_RULES=y
CONFIG_WIRELESS=y
# CONFIG_CFG80211 is not set
CONFIG_CFG80211_DEFAULT_PS_VALUE=0
@@ -722,6 +897,9 @@ CONFIG_RK29_NEWTON=y
# CONFIG_EEPROM_MAX6875 is not set
# CONFIG_EEPROM_93CX6 is not set
# CONFIG_RK29_SUPPORT_MODEM is not set
# CONFIG_MODEM_ROCKCHIP_DEMO is not set
# CONFIG_MODEM_LONGCHEER_U6300V is not set
# CONFIG_MODEM_THINKWILL_MW100G is not set
# CONFIG_RK29_GPS is not set
#
@@ -786,6 +964,7 @@ CONFIG_DM_CRYPT=y
# CONFIG_DM_DELAY is not set
CONFIG_DM_UEVENT=y
CONFIG_NETDEVICES=y
# CONFIG_IFB is not set
# CONFIG_DUMMY is not set
# CONFIG_BONDING is not set
# CONFIG_MACVLAN is not set
@@ -1185,6 +1364,8 @@ CONFIG_SOC_CAMERA_OV2655=y
# CONFIG_SOC_CAMERA_OV2640 is not set
# CONFIG_SOC_CAMERA_OV3640 is not set
# CONFIG_SOC_CAMERA_OV5642 is not set
# CONFIG_OV5642_AUTOFOCUS is not set
# CONFIG_OV5642_FIXEDFOCUS is not set
# CONFIG_SOC_CAMERA_OV5640 is not set
# CONFIG_SOC_CAMERA_S5K6AA is not set
# CONFIG_SOC_CAMERA_GT2005 is not set
@@ -1349,6 +1530,8 @@ CONFIG_LCD_AT070TN93=y
# HDMI
#
# CONFIG_HDMI is not set
# CONFIG_ANX7150 is not set
# CONFIG_ANX9030 is not set
#
# Console display driver support
@@ -2055,6 +2238,7 @@ CONFIG_CRYPTO=y
#
CONFIG_CRYPTO_ALGAPI=y
CONFIG_CRYPTO_ALGAPI2=y
CONFIG_CRYPTO_AEAD=y
CONFIG_CRYPTO_AEAD2=y
CONFIG_CRYPTO_BLKCIPHER=y
CONFIG_CRYPTO_BLKCIPHER2=y
@@ -2068,7 +2252,7 @@ CONFIG_CRYPTO_MANAGER2=y
# CONFIG_CRYPTO_NULL is not set
CONFIG_CRYPTO_WORKQUEUE=y
# CONFIG_CRYPTO_CRYPTD is not set
# CONFIG_CRYPTO_AUTHENC is not set
CONFIG_CRYPTO_AUTHENC=y
# CONFIG_CRYPTO_TEST is not set
#
@@ -2092,14 +2276,14 @@ CONFIG_CRYPTO_ECB=y
#
# Hash modes
#
# CONFIG_CRYPTO_HMAC is not set
CONFIG_CRYPTO_HMAC=y
# CONFIG_CRYPTO_XCBC is not set
# CONFIG_CRYPTO_VMAC is not set
#
# Digest
#
# CONFIG_CRYPTO_CRC32C is not set
CONFIG_CRYPTO_CRC32C=y
# CONFIG_CRYPTO_GHASH is not set
# CONFIG_CRYPTO_MD4 is not set
CONFIG_CRYPTO_MD5=y
@@ -2137,7 +2321,7 @@ CONFIG_CRYPTO_TWOFISH_COMMON=y
#
# Compression
#
# CONFIG_CRYPTO_DEFLATE is not set
CONFIG_CRYPTO_DEFLATE=y
# CONFIG_CRYPTO_ZLIB is not set
# CONFIG_CRYPTO_LZO is not set
@@ -2159,13 +2343,17 @@ CONFIG_CRC16=y
# CONFIG_CRC_ITU_T is not set
CONFIG_CRC32=y
# CONFIG_CRC7 is not set
# CONFIG_LIBCRC32C is not set
CONFIG_LIBCRC32C=y
CONFIG_ZLIB_INFLATE=y
CONFIG_ZLIB_DEFLATE=y
CONFIG_DECOMPRESS_GZIP=y
CONFIG_REED_SOLOMON=y
CONFIG_REED_SOLOMON_ENC8=y
CONFIG_REED_SOLOMON_DEC8=y
CONFIG_TEXTSEARCH=y
CONFIG_TEXTSEARCH_KMP=y
CONFIG_TEXTSEARCH_BM=y
CONFIG_TEXTSEARCH_FSM=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_DMA=y

34
arch/arm/configs/rk29_phonepadsdk_defconfig Executable file → Normal file
View File

@@ -1053,7 +1053,8 @@ CONFIG_INPUT_TOUCHSCREEN=y
# CONFIG_EETI_EGALAX is not set
# CONFIG_TOUCHSCREEN_IT7260 is not set
# CONFIG_TOUCHSCREEN_GT801_IIC is not set
CONFIG_D70_L3188A=y
CONFIG_TOUCHSCREEN_NAS=y
#CONFIG_D70_L3188A is not set
CONFIG_INPUT_MISC=y
CONFIG_INPUT_UINPUT=y
# CONFIG_INPUT_GPIO is not set
@@ -1154,7 +1155,7 @@ CONFIG_ADC_RK29=y
#
# Headset device support
#
# CONFIG_RK_HEADSET_DET is not set
CONFIG_RK_HEADSET_DET=y
#
# PPS support
@@ -1504,15 +1505,31 @@ CONFIG_SND_RK29_SOC_I2S=y
# CONFIG_SND_RK29_SOC_I2S_2CH is not set
CONFIG_SND_RK29_SOC_I2S_8CH=y
# CONFIG_SND_RK29_SOC_WM8988 is not set
CONFIG_SND_RK29_SOC_WM8900=y
# CONFIG_SND_RK29_SOC_WM8900 is not set
# CONFIG_SND_RK29_SOC_alc5621 is not set
# CONFIG_SND_RK29_SOC_alc5631 is not set
# CONFIG_SND_RK29_SOC_WM8994 is not set
# CONFIG_SND_RK29_SOC_RT5625 is not set
CONFIG_SND_RK29_SOC_WM8994=y
# CONFIG_SND_INSIDE_EARPIECE is not set
# CONFIG_SND_OUTSIDE_EARPIECE is not set
CONFIG_SND_NO_EARPIECE=y
CONFIG_SND_BB_NORMAL_INPUT=y
# CONFIG_SND_BB_DIFFERENTIAL_INPUT is not set
CONFIG_WM8994_SPEAKER_INCALL_VOL=15
CONFIG_WM8994_SPEAKER_INCALL_MIC_VOL=15
CONFIG_WM8994_SPEAKER_NORMAL_VOL=15
CONFIG_WM8994_HEADSET_INCALL_VOL=6
CONFIG_WM8994_HEADSET_INCALL_MIC_VOL=30
CONFIG_WM8994_HEADSET_NORMAL_VOL=15
CONFIG_WM8994_BT_INCALL_VOL=30
CONFIG_WM8994_BT_INCALL_MIC_VOL=-20
CONFIG_WM8994_RECORDER_VOL=40
# CONFIG_SND_RK29_SOC_CS42L52 is not set
# CONFIG_SND_RK29_CODEC_SOC_MASTER is not set
CONFIG_SND_RK29_CODEC_SOC_SLAVE=y
CONFIG_SND_SOC_I2C_AND_SPI=y
# CONFIG_SND_SOC_ALL_CODECS is not set
CONFIG_SND_SOC_WM8900=y
CONFIG_SND_SOC_WM8994=y
# CONFIG_SOUND_PRIME is not set
CONFIG_HID_SUPPORT=y
CONFIG_HID=y
@@ -1761,14 +1778,13 @@ CONFIG_MMC=y
# CONFIG_MMC_DEBUG is not set
CONFIG_MMC_UNSAFE_RESUME=y
CONFIG_MMC_EMBEDDED_SDIO=y
# CONFIG_MMC_PARANOID_SD_INIT is not set
CONFIG_MMC_PARANOID_SD_INIT=y
#
# MMC/SD/SDIO Card Drivers
#
CONFIG_MMC_BLOCK=y
CONFIG_MMC_BLOCK_BOUNCE=y
CONFIG_MMC_BLOCK_DEFERRED_RESUME=y
# CONFIG_MMC_BLOCK_DEFERRED_RESUME is not set
# CONFIG_SDIO_UART is not set
# CONFIG_MMC_TEST is not set
@@ -1780,8 +1796,8 @@ CONFIG_SDMMC_RK29=y
#
# Now, there are two SDMMC controllers selected, SDMMC0 and SDMMC1.
#
# CONFIG_SDMMC_RK29_OLD is not set
CONFIG_SDMMC0_RK29=y
# CONFIG_EMMC_RK29 is not set
CONFIG_SDMMC1_RK29=y
# CONFIG_MMC_SDHCI is not set
# CONFIG_MMC_AT91 is not set

View File

@@ -905,7 +905,7 @@ CONFIG_TOUCHSCREEN_GT818_IIC=y
# CONFIG_D70_L3188A is not set
# CONFIG_TOUCHSCREEN_FT5406 is not set
CONFIG_INPUT_MISC=y
# CONFIG_INPUT_LPSENSOR_ISL29028 is not set
CONFIG_INPUT_LPSENSOR_ISL29028=y
# CONFIG_INPUT_LPSENSOR_CM3602 is not set
# CONFIG_INPUT_ATI_REMOTE is not set
# CONFIG_INPUT_ATI_REMOTE2 is not set

View File

@@ -50,6 +50,11 @@ struct bt_ctrl
#define BT_GPIO_WAKE_UP_HOST RK29_PIN4_PD4
#define IOMUX_BT_GPIO_WAKE_UP_HOST() rk29_mux_api_set(GPIO4D4_CPUTRACECLK_NAME,GPIO4H_GPIO4D4);
//bt cts paired to uart rts
#define UART_RTS RK29_PIN2_PA7
#define IOMUX_UART_RTS_GPIO rk29_mux_api_set(GPIO2A7_UART2RTSN_NAME, GPIO2L_GPIO2A7);
#define IOMUX_UART_RTS rk29_mux_api_set(GPIO2A7_UART2RTSN_NAME, GPIO2L_UART2_RTS_N);
#define BT_WAKE_LOCK_TIMEOUT 10 //s
static const char bt_name[] = "bcm4329";
@@ -64,17 +69,11 @@ void resetBtHostSleepTimer(void)
mod_timer(&(gBtCtrl.tl),jiffies + BT_WAKE_LOCK_TIMEOUT*HZ);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ó<EFBFBD>ʱֵ<CAB1><D6B5>
}
void btWakeupHostLock(bool bt_irq_wake)
void btWakeupHostLock(void)
{
if(gBtCtrl.b_HostWake == false){
DBG("*************************Lock\n");
if(bt_irq_wake)
{
printk("BT wakeup hostLock by send wakeup key\n");
rk28_send_wakeup_key();
}
wake_lock(&(gBtCtrl.bt_wakelock));
gBtCtrl.b_HostWake = true;
}
@@ -101,10 +100,11 @@ static int bcm4329_rfkill_suspend(struct platform_device *pdev, pm_message_t sta
{
DBG("%s\n",__FUNCTION__);
rk29_mux_api_set(GPIO2A7_UART2RTSN_NAME, GPIO2L_GPIO2A7);
gpio_request(RK29_PIN2_PA7, "uart2_rts");
gpio_direction_output(RK29_PIN2_PA7, 0);
gpio_set_value(RK29_PIN2_PA7, GPIO_HIGH);
//To prevent uart to receive bt data when suspended
IOMUX_UART_RTS_GPIO;
gpio_request(UART_RTS, "uart_rts");
gpio_direction_output(UART_RTS, 0);
gpio_set_value(UART_RTS, GPIO_HIGH);
return 0;
}
@@ -113,11 +113,11 @@ static int bcm4329_rfkill_resume(struct platform_device *pdev)
{
DBG("%s\n",__FUNCTION__);
btWakeupHostLock(false);
btWakeupHostLock();
resetBtHostSleepTimer();
gpio_set_value(RK29_PIN2_PA7, GPIO_LOW);
rk29_mux_api_set(GPIO2A7_UART2RTSN_NAME, GPIO2L_UART2_RTS_N);
gpio_set_value(UART_RTS, GPIO_LOW);
IOMUX_UART_RTS;
return 0;
}
@@ -130,7 +130,7 @@ static irqreturn_t bcm4329_wake_host_irq(int irq, void *dev)
{
DBG("%s\n",__FUNCTION__);
btWakeupHostLock(true);
btWakeupHostLock();
resetBtHostSleepTimer();
return IRQ_HANDLED;
}
@@ -163,7 +163,7 @@ static int bcm4329_set_block(void *data, bool blocked)
mdelay(200);
#if BT_WAKE_HOST_SUPPORT
btWakeupHostLock(false);
btWakeupHostLock();
#endif
pr_info("bt turn on power\n");
}

4
arch/arm/mach-rk29/board-rk29-a22.c Executable file → Normal file
View File

@@ -87,11 +87,11 @@
#define CONFIG_SENSOR_0 RK29_CAM_SENSOR_MT9T111 /* 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_POWER_PIN_0 RK29_PIN5_PA0 //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 RK29_PIN5_PD2 // RK29_PIN1_PA5
#define CONFIG_SENSOR_POWERACTIVE_LEVEL_0 RK29_CAM_POWERACTIVE_L
#define CONFIG_SENSOR_POWERACTIVE_LEVEL_0 RK29_CAM_POWERACTIVE_H //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_H

View File

@@ -176,15 +176,14 @@ struct rk29_nand_platform_data rk29_nand_data = {
* author: zyw@rock-chips.com
*****************************************************************************************/
#define FB_ID 0
#define FB_DISPLAY_ON_PIN INVALID_GPIO// RK29_PIN6_PD0
//#define FB_LCD_STANDBY_PIN INVALID_GPIO
#define FB_LCD_STANDBY_PIN RK29_PIN6_PD1
#define FB_DISPLAY_ON_PIN RK29_PIN6_PD1
#define FB_LCD_STANDBY_PIN RK29_PIN1_PD6
#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
#define FB_LCD_STANDBY_VALUE GPIO_LOW
#define FB_LCD_STANDBY_VALUE GPIO_HIGH
//#define FB_LCD_STANDBY_VALUE GPIO_LOW
static int rk29_lcd_io_init(void)
{
@@ -314,6 +313,7 @@ static int rk29_fb_io_init(struct rk29_fb_setting_info *fb_setting)
return ret;
}
static struct rk29fb_info rk29_fb_info = {
.fb_id = FB_ID,
.mcu_fmk_pin = FB_MCU_FMK_PIN,
@@ -559,10 +559,12 @@ int ft5406_init_platform_hw(void)
}
gpio_direction_output(TOUCH_RESET_PIN, 0);
gpio_direction_output(TOUCH_INT_PIN, 0);
gpio_set_value(TOUCH_INT_PIN,GPIO_HIGH);
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);
gpio_pull_updown(TOUCH_INT_PIN, 0);
msleep(300);
return 0;
}
@@ -616,15 +618,11 @@ int gt819_init_platform_hw(void)
}
gpio_direction_output(TOUCH_RESET_PIN, 0);
gpio_set_value(TOUCH_RESET_PIN,GPIO_LOW);
msleep(100);
gpio_direction_output(TOUCH_INT_PIN, 0);
gpio_set_value(TOUCH_INT_PIN,GPIO_LOW);
mdelay(10);
msleep(50);
gpio_direction_input(TOUCH_INT_PIN);
mdelay(10);
gpio_set_value(TOUCH_RESET_PIN,GPIO_HIGH);
msleep(100);
gpio_direction_output(TOUCH_INT_PIN, 1);
gpio_pull_updown(TOUCH_INT_PIN, 0);
msleep(300);
return 0;
}
@@ -647,10 +645,10 @@ 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);
//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 = {
@@ -684,7 +682,25 @@ struct cs42l52_platform_data cs42l52_info = {
};
#endif
#if defined (CONFIG_BATTERY_BQ27541)
#define DC_CHECK_PIN RK29_PIN4_PA1
#define LI_LION_BAT_NUM 1
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,
};
#endif
static struct android_pmem_platform_data android_pmem_pdata = {
.name = "pmem",
.start = PMEM_UI_BASE,
@@ -838,25 +854,6 @@ struct bq27510_platform_data bq27510_info = {
};
#endif
#if defined (CONFIG_BATTERY_BQ27541)
#define DC_CHECK_PIN RK29_PIN4_PA1
#define LI_LION_BAT_NUM 1
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,
};
#endif
/*****************************************************************************************
* i2c devices
@@ -1177,7 +1174,7 @@ static struct i2c_board_info __initdata board_i2c3_devices[] = {
* camera devices
* author: ddl@rock-chips.com
*****************************************************************************************/
#ifdef CONFIG_VIDEO_RK29
#ifdef CONFIG_VIDEO_RK29
#define CONFIG_SENSOR_POWER_IOCTL_USR 0
#define CONFIG_SENSOR_RESET_IOCTL_USR 0
#define CONFIG_SENSOR_POWERDOWN_IOCTL_USR 0
@@ -1236,7 +1233,6 @@ static struct rk29camera_platform_ioctl_cb sensor_ioctl_cb = {
.sensor_flash_cb = NULL,
#endif
};
#include "../../../drivers/media/video/rk29_camera.c"
#endif
/*****************************************************************************************
@@ -1294,6 +1290,7 @@ static int rk29_backlight_io_deinit(void)
gpio_free(BL_EN_PIN);
#endif
rk29_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE_GPIO);
return ret;
}
@@ -1924,6 +1921,9 @@ static struct platform_device *devices[] __initdata = {
#ifdef CONFIG_USB_ANDROID
&android_usb_device,
&newton_usb_mass_storage_device,
#endif
#ifdef CONFIG_USB_ANDROID_RNDIS
&rk29_device_rndis,
#endif
#ifdef CONFIG_RK29_IPP
&rk29_device_ipp,
@@ -2260,7 +2260,7 @@ static void __init machine_rk29_mapio(void)
rk29_setup_early_printk();
rk29_sram_init();
rk29_clock_init(periph_pll_default);
rk29_iomux_init();
rk29_iomux_init();
ddr_init(DDR_TYPE,DDR_FREQ); // DDR3_1333H, 400
}

View File

@@ -50,6 +50,11 @@ struct bt_ctrl
#define BT_GPIO_WAKE_UP_HOST RK29_PIN4_PD4
#define IOMUX_BT_GPIO_WAKE_UP_HOST() rk29_mux_api_set(GPIO4D4_CPUTRACECLK_NAME,GPIO4H_GPIO4D4);
//bt cts paired to uart rts
#define UART_RTS RK29_PIN2_PA7
#define IOMUX_UART_RTS_GPIO rk29_mux_api_set(GPIO2A7_UART2RTSN_NAME, GPIO2L_GPIO2A7);
#define IOMUX_UART_RTS rk29_mux_api_set(GPIO2A7_UART2RTSN_NAME, GPIO2L_UART2_RTS_N);
#define BT_WAKE_LOCK_TIMEOUT 10 //s
static const char bt_name[] = "bcm4329";
@@ -64,17 +69,11 @@ void resetBtHostSleepTimer(void)
mod_timer(&(gBtCtrl.tl),jiffies + BT_WAKE_LOCK_TIMEOUT*HZ);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ó<EFBFBD>ʱֵ<CAB1><D6B5>
}
void btWakeupHostLock(bool bt_irq_wake)
void btWakeupHostLock(void)
{
if(gBtCtrl.b_HostWake == false){
DBG("*************************Lock\n");
if(bt_irq_wake)
{
printk("BT wakeup hostLock by send wakeup key\n");
rk28_send_wakeup_key();
}
wake_lock(&(gBtCtrl.bt_wakelock));
gBtCtrl.b_HostWake = true;
}
@@ -101,10 +100,11 @@ static int bcm4329_rfkill_suspend(struct platform_device *pdev, pm_message_t sta
{
DBG("%s\n",__FUNCTION__);
rk29_mux_api_set(GPIO2A7_UART2RTSN_NAME, GPIO2L_GPIO2A7);
gpio_request(RK29_PIN2_PA7, "uart2_rts");
gpio_direction_output(RK29_PIN2_PA7, 0);
gpio_set_value(RK29_PIN2_PA7, GPIO_HIGH);
//To prevent uart to receive bt data when suspended
IOMUX_UART_RTS_GPIO;
gpio_request(UART_RTS, "uart_rts");
gpio_direction_output(UART_RTS, 0);
gpio_set_value(UART_RTS, GPIO_HIGH);
return 0;
}
@@ -113,11 +113,11 @@ static int bcm4329_rfkill_resume(struct platform_device *pdev)
{
DBG("%s\n",__FUNCTION__);
btWakeupHostLock(false);
btWakeupHostLock();
resetBtHostSleepTimer();
gpio_set_value(RK29_PIN2_PA7, GPIO_LOW);
rk29_mux_api_set(GPIO2A7_UART2RTSN_NAME, GPIO2L_UART2_RTS_N);
gpio_set_value(UART_RTS, GPIO_LOW);
IOMUX_UART_RTS;
return 0;
}
@@ -130,7 +130,7 @@ static irqreturn_t bcm4329_wake_host_irq(int irq, void *dev)
{
DBG("%s\n",__FUNCTION__);
btWakeupHostLock(true);
btWakeupHostLock();
resetBtHostSleepTimer();
return IRQ_HANDLED;
}
@@ -163,7 +163,7 @@ static int bcm4329_set_block(void *data, bool blocked)
mdelay(200);
#if BT_WAKE_HOST_SUPPORT
btWakeupHostLock(false);
btWakeupHostLock();
#endif
pr_info("bt turn on power\n");
}

View File

@@ -3093,10 +3093,10 @@ static void rk29_pm_power_off(void)
static struct cpufreq_frequency_table freq_table[] =
{
{ .index = 1050000, .frequency = 408000 },
{ .index = 1100000, .frequency = 600000 },
{ .index = 1150000, .frequency = 816000 },
{ .index = 1300000, .frequency = 1008000 },
{ .index = 1200000, .frequency = 408000 },
{ .index = 1200000, .frequency = 600000 },
{ .index = 1200000, .frequency = 816000 },
{ .index = 1350000, .frequency = 1008000 },
{ .frequency = CPUFREQ_TABLE_END },
};

75
arch/arm/mach-rk29/board-rk29phonepadsdk.c Normal file → Executable file
View File

@@ -446,6 +446,7 @@ struct p1003_platform_data p1003_info = {
};
#endif
#if defined (CONFIG_EETI_EGALAX)
#define TOUCH_RESET_PIN RK29_PIN6_PC3
#define TOUCH_INT_PIN RK29_PIN0_PA2
@@ -481,7 +482,62 @@ static struct eeti_egalax_platform_data eeti_egalax_info = {
.disp_on_pin = TOUCH_SCREEN_DISPLAY_PIN,
.disp_on_value = TOUCH_SCREEN_DISPLAY_VALUE,
};
#endif
//tcl miaozh add
/*Nas touch*/
#if defined (CONFIG_TOUCHSCREEN_NAS)
#define TOUCH_RESET_PIN RK29_PIN6_PC3
#define TOUCH_INT_PIN RK29_PIN0_PA2
void nas_reset(void)
{
msleep(5);
gpio_pull_updown(TOUCH_INT_PIN, 1);
gpio_direction_output(TOUCH_RESET_PIN, 0);
msleep(5);
gpio_set_value(TOUCH_RESET_PIN,GPIO_LOW);
msleep(200);
gpio_set_value(TOUCH_RESET_PIN,GPIO_HIGH);
}
void nas_hold(void)
{
printk("nas_hold()\n");
gpio_direction_output(TOUCH_RESET_PIN, 0);
msleep(5);
gpio_set_value(TOUCH_RESET_PIN,GPIO_LOW);
msleep(30);
}
void nas_request_io(void)
{
if(gpio_request(TOUCH_RESET_PIN,NULL) != 0){
gpio_free(TOUCH_RESET_PIN);
printk("nas_init_platform_hw gpio_request error\n");
return -EIO;
}
if(gpio_request(TOUCH_INT_PIN,NULL) != 0){
gpio_free(TOUCH_INT_PIN);
printk("nas_init_platform_hw gpio_request error\n");
return -EIO;
}
}
int nas_init_platform_hw(void)
{
printk("enter %s()\n", __FUNCTION__);
//nas_request_io();
//nas_reset();
return 0;
}
struct nas_platform_data nas_info = {
.model= 1003,
.init_platform_hw= nas_init_platform_hw,
};
#endif
#if defined (CONFIG_D70_L3188A)
struct goodix_i2c_rmi_platform_data d70_l3188a_info = {
@@ -708,6 +764,13 @@ static struct i2c_board_info __initdata board_i2c0_devices[] = {
.flags = 0,
},
#endif
#if defined (CONFIG_SND_SOC_WM8994)
{
.type = "wm8994",
.addr = 0x1A,
.flags = 0,
},
#endif
#if defined (CONFIG_BATTERY_STC3100)
{
.type = "stc3100",
@@ -801,6 +864,18 @@ static struct i2c_board_info __initdata board_i2c2_devices[] = {
.platform_data = &eeti_egalax_info,
},
#endif
//tcl miaozh add
#if defined (CONFIG_TOUCHSCREEN_NAS)
{
.type = "nas_touch",
.addr = (0x70>>1),
.flags = 0, //I2C_M_NEED_DELAY
.irq = RK29_PIN0_PA2,
.platform_data = &nas_info,
//.udelay = 100
},
#endif
#if defined (CONFIG_D70_L3188A)
{
.type = "goodix-ts",

View File

@@ -25,6 +25,7 @@
#include <mach/rk29-dma-pl330.h>
#include <mach/rk29_camera.h> /* ddl@rock-chips.com : camera support */
#include <mach/board.h>
#include <mach/loader.h>
#include "devices.h"
#ifdef CONFIG_ADC_RK29
static struct resource rk29_adc_resource[] = {
@@ -839,6 +840,18 @@ static int __init boot_mode_init(char *s)
}
__setup("androidboot.mode=", boot_mode_init);
void rk29_boot_mode_init_by_register(void)
{
u32 flag = readl(RK29_TIMER0_BASE);
if (flag == (SYS_KERNRL_REBOOT_FLAG | BOOT_RECOVER)) {
boot_mode = BOOT_MODE_RECOVERY;
} else {
boot_mode = readl(RK29_GRF_BASE + 0xdc); // GRF_OS_REG3
}
if (boot_mode)
printk("Boot mode: %d\n", boot_mode);
}
int board_boot_mode(void)
{
return boot_mode;

View File

@@ -267,6 +267,18 @@ struct cs42l52_platform_data {
void (*exit_platform_hw)(void);
};
//tcl miaozh add
/*nas touch */
struct nas_platform_data {
u16 model;
int (*get_pendown_state)(void);
int (*init_platform_hw)(void);
int (*nas_platform_sleep)(void);
int (*nas_platform_wakeup)(void);
void (*exit_platform_hw)(void);
};
struct akm8975_platform_data {
char layouts[3][3];
@@ -318,6 +330,8 @@ void __init board_power_init(void);
#define BOOT_MODE_CHARGE 3
#define BOOT_MODE_POWER_TEST 4
#define BOOT_MODE_OFFMODE_CHARGING 5
#define BOOT_MODE_REBOOT 6
#define BOOT_MODE_PANIC 7
int board_boot_mode(void);
enum periph_pll {

View File

@@ -0,0 +1,35 @@
/* arch/arm/mach-rk29/include/mach/loader.h
*
* Copyright (C) 2011 ROCKCHIP, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* 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 __ASM_ARCH_RK29_LOADER_H
#define __ASM_ARCH_RK29_LOADER_H
#define SYS_LOADER_ERR_FLAG 0x1888AAFF
#define SYS_LOADER_REBOOT_FLAG 0x5242C300 //high 24 bits is tag, low 8 bits is type
#define SYS_KERNRL_REBOOT_FLAG 0xC3524200 //high 24 bits is tag, low 8 bits is type
enum {
BOOT_NORMAL = 0,
BOOT_LOADER, /* enter loader rockusb mode */
BOOT_MASKROM, /* enter maskrom rockusb mode*/
BOOT_RECOVER, /* enter recover */
BOOT_NORECOVER, /* do not enter recover */
BOOT_WINCE, /* FOR OTHER SYSTEM */
BOOT_WIPEDATA, /* enter recover and wipe data. */
BOOT_WIPEALL, /* enter recover and wipe all data. */
BOOT_CHECKIMG, /* check firmware img with backup part(in loader mode)*/
BOOT_MAX /* MAX VALID BOOT TYPE.*/
};
#endif

View File

@@ -20,12 +20,19 @@ struct rk29_ipp_image
struct rk29_ipp_req {
struct rk29_ipp_image src0; // source0 image
struct rk29_ipp_image dst0; // destination0 image
struct rk29_ipp_image src1; // source1 image
struct rk29_ipp_image dst1; // destination1 image
//struct rk29_ipp_image src1; // source1 image
//struct rk29_ipp_image dst1; // destination1 image
uint32_t src_vir_w;
uint32_t dst_vir_w;
uint32_t timeout;
uint32_t flag; //rotate
/*store_clip_mode
0:when src width is not 64-bits aligned,use dummy data make it 64-bits aligned 1:packed
we usually set to 0
*/
uint8_t store_clip_mode;
//deinterlace_enable 1:enable 0:disable
uint8_t deinterlace_enable;
@@ -105,6 +112,7 @@ typedef enum
#define IPP_PROCESS_ST (0x50)
/*ipp config*/
#define STORE_CLIP_MODE (1<<26)
#define DEINTERLACE_ENABLE (1<<24)
#define ROT_ENABLE (1<<8)
#define PRE_SCALE (1<<4)

View File

@@ -64,7 +64,9 @@ static struct map_desc rk29_io_desc[] __initdata = {
#endif
};
extern void rk29_boot_mode_init_by_register(void);
void __init rk29_map_common_io(void)
{
iotable_init(rk29_io_desc, ARRAY_SIZE(rk29_io_desc));
rk29_boot_mode_init_by_register();
}

View File

@@ -16,6 +16,8 @@
#include <mach/memory.h>
#include <mach/sram.h>
#include <mach/pmu.h>
#include <mach/loader.h>
#include <mach/board.h>
#include <asm/delay.h>
#include <asm/tlbflush.h>
@@ -36,7 +38,7 @@ static void pwm2gpiodefault(void)
memset((void *)RK29_PWM_BASE, 0, 0x40);
}
#if 0
extern void __rb( void* );
static void rb( void )
{
@@ -51,6 +53,7 @@ static void rb( void )
//while(testflag);
cb( uart_base );
}
#endif
static volatile u32 __sramdata reboot_reason = 0;
static void __sramfunc __noreturn rk29_rb_with_softreset(void)
@@ -116,13 +119,22 @@ static void __sramfunc __noreturn rk29_rb_with_softreset(void)
void rk29_arch_reset(int mode, const char *cmd)
{
void (*rb2)(void);
u32 boot_mode = BOOT_MODE_REBOOT;
if (cmd) {
if (!strcmp(cmd, "loader") || !strcmp(cmd, "bootloader"))
reboot_reason = 0x1888AAFF;
else if (!strcmp(cmd, "recovery"))
reboot_reason = 0x5242C303;
if (!strcmp(cmd, "loader") || !strcmp(cmd, "bootloader")) {
reboot_reason = SYS_LOADER_ERR_FLAG;
} else if (!strcmp(cmd, "recovery")) {
reboot_reason = SYS_LOADER_REBOOT_FLAG + BOOT_RECOVER;
boot_mode = BOOT_MODE_RECOVERY;
} else if (!strcmp(cmd, "charge")) {
boot_mode = BOOT_MODE_CHARGE;
}
} else {
if (system_state != SYSTEM_RESTART)
boot_mode = BOOT_MODE_PANIC;
}
writel(boot_mode, RK29_GRF_BASE + 0xdc); // GRF_OS_REG3
rb2 = (void(*)(void))((u32)rk29_rb_with_softreset - SRAM_CODE_OFFSET + 0x10130000);

View File

@@ -52,9 +52,6 @@ struct bu92747_data_info {
int base_clock;
int sys_clock;
struct delayed_work dwork;
u8 inv;
u16 head_space_time;
u16 head_burst_time;
};
static struct miscdevice bu92747guw_device;
@@ -103,7 +100,7 @@ static int bu92747_stop(struct i2c_client *client)
reg_value[0] = reg_value[0]&0xfe;
reg_value[1] = reg_value[1]&0xf1;
bu92747_cir_i2c_set_regs(client, REG_SETTING0, reg_value, 2);
start_flag = 0;
repeat_flag = -1;
BU92747_DBG("line %d: exit %s\n", __LINE__, __FUNCTION__);
@@ -117,13 +114,12 @@ static void bu92747_dwork_handler(struct work_struct *work)
BU92747_DBG("------- sss enter %s\n", __func__);
if ( !start_flag && (repeat_flag <= -1)){
if ((repeat_flag != -10) && (repeat_flag <= -1)){
bu92747_stop(bu92747->client);
BU92747_DBG("----------exit %s\n", __func__);
return ;
}
start_flag = 0;
//set repeat=0
bu92747_cir_i2c_read_regs(bu92747->client, REG_SETTING1, reg_value, 1);
reg_value[0] &= 0xf0;
@@ -143,6 +139,7 @@ static void bu92747_dwork_handler(struct work_struct *work)
return;
}
static irqreturn_t bu92747_cir_irq(int irq, void *dev_id)
{
// u8 reg_value[2];
@@ -150,12 +147,18 @@ static irqreturn_t bu92747_cir_irq(int irq, void *dev_id)
struct bu92747_data_info *bu92747 = (struct bu92747_data_info *)i2c_get_clientdata(client);
BU92747_DBG("----------enter %s repeat_flag = %d\n", __func__, repeat_flag);
if (((--repeat_flag%16) == 0) || (repeat_flag < 0)){
schedule_delayed_work(&bu92747->dwork, msecs_to_jiffies(0));
if (start_flag == 1){
if (repeat_flag == -10){
if ((bu92747->state++)%10 == 0){
schedule_delayed_work(&bu92747->dwork, msecs_to_jiffies(0));
bu92747->state = 0;
}
}else if (((--repeat_flag%16) == 0) || (repeat_flag < 0)){
schedule_delayed_work(&bu92747->dwork, msecs_to_jiffies(0));
}
}
return IRQ_HANDLED;
}
@@ -277,7 +280,10 @@ static int bu92747_set_format(struct i2c_client *client, struct rk29_cir_struct_
repeat_flag = cir->repeat;
printk("repeat 11111 =%d\n", repeat_flag);
if (repeat_flag > 16){
if (repeat_flag == -1){
repeat_flag = -10;
repeat = 0;
}else if (repeat_flag > 16){
repeat = 16;
}else{
repeat = repeat_flag;
@@ -307,8 +313,7 @@ static int bu92747_set_format(struct i2c_client *client, struct rk29_cir_struct_
reg_value[9] = hhi>>8;
reg_value[10] = hhi&0xff;
BU92747_DBG("hlo = 0x%x, hhi = 0x%x\n", hlo, hhi);
bu92747->head_space_time = cir->head_space_time;
bu92747->head_burst_time = cir->head_burst_time;
//data0
d0lo = (cir->logic_low_space_time*sys_clock)/1000;
@@ -357,7 +362,7 @@ static int bu92747_set_format(struct i2c_client *client, struct rk29_cir_struct_
BU92747_DBG("reg_value[%d] = %d\n", 24+i, reg_value[24+i]);
}
bu92747_cir_i2c_set_regs(client, REG_SETTING0, reg_value, 23+i);
bu92747_cir_i2c_set_regs(client, REG_SETTING0, reg_value, 24+i);
BU92747_DBG("line %d: exit %s\n", __LINE__, __FUNCTION__);
@@ -496,7 +501,7 @@ static int bu92747_set_pulse(struct i2c_client *client, struct rk29_cir_struct_i
reg_value[0] = reg_value[0] | (inv0<<1) | (inv1<<2);
bu92747_cir_i2c_set_regs(client, REG_SETTING0, reg_value, 1);
BU92747_DBG("inv0 = %d, inv1 = %d\n", inv0, inv1);
bu92747->inv = cir->inv;
//data0
@@ -548,8 +553,6 @@ static int bu92747_set_parameter(struct i2c_client *client, struct rk29_cir_stru
reg_value[2] = hhi>>8;
reg_value[3] = hhi&0xff;
BU92747_DBG("hlo = 0x%x, hhi = 0x%x\n", hlo, hhi);
bu92747->head_space_time = cir->head_space_time;
bu92747->head_burst_time = cir->head_burst_time;
bu92747_cir_i2c_set_regs(client, REG_HLO1, reg_value, 4);
//end
@@ -575,15 +578,20 @@ static int bu92747_set_repeat(struct i2c_client *client, struct rk29_cir_struct_
BU92747_DBG("line %d: enter %s\n", __LINE__, __FUNCTION__);
repeat_flag = cir->repeat;
repeat_flag = cir->repeat;
printk("repeat 11111 =%d\n", repeat_flag);
if (repeat_flag > 16){
if (repeat_flag == -1){
repeat_flag = -10;
repeat = 0;
}else if (repeat_flag > 16){
repeat = 16;
}else{
repeat = repeat_flag;
}
repeat = repeat % 16;
bu92747_cir_i2c_read_regs(client, REG_SETTING1, reg_value, 1);
@@ -750,6 +758,7 @@ static int bu92747_open(struct inode *inode, struct file *file)
BU92747_DBG("line %d: enter %s\n", __LINE__, __FUNCTION__);
printk("bu92747_open\n");
bu92747->state = 0;
// if (BU92747_OPEN == bu92747->state)
// return -EBUSY;
// bu92747->state = BU92747_OPEN;
@@ -767,7 +776,7 @@ static int bu92747_open(struct inode *inode, struct file *file)
//register init
bu92747_cir_init_device(client, bu92747);
start_flag = 0;
start_flag = -1;
BU92747_DBG("line %d: exit %s\n", __LINE__, __FUNCTION__);
return 0;

View File

@@ -105,7 +105,7 @@ struct rk29_cir_struct_info {
u16 carry_high; // carry_high
u16 carry_low; // carry_low
u16 repeat; // <20>Ƿ<EFBFBD><C7B7><EFBFBD> <20>ظ<EFBFBD>֡
s32 repeat; // <20>Ƿ<EFBFBD><C7B7><EFBFBD> <20>ظ<EFBFBD>֡
u8 inv; //00 01 10 11 Lsb->inv0
u8 frame_bit_len; // <20><><EFBFBD><EFBFBD>֡<EFBFBD><D6A1>Чλ<D0A7><CEBB>

View File

@@ -701,7 +701,30 @@ static void akm8975_early_resume(struct early_suspend *handler)
AKMDBG("resumed with flag=%d",
atomic_read(&reserve_open_flag));
}
static int akm8975_suspend(struct i2c_client *client, pm_message_t mesg)
{
AKMFUNC("akm8975_early_suspend");
atomic_set(&suspend_flag, 1);
atomic_set(&reserve_open_flag, atomic_read(&open_flag));
atomic_set(&open_flag, 0);
wake_up(&open_wq);
disable_irq(this_client->irq);
AKMDBG("suspended with flag=%d",
atomic_read(&reserve_open_flag));
return 0;
}
static int akm8975_resume(struct i2c_client *client)
{
AKMFUNC("akm8975_early_resume");
enable_irq(this_client->irq);
atomic_set(&suspend_flag, 0);
atomic_set(&open_flag, atomic_read(&reserve_open_flag));
wake_up(&open_wq);
AKMDBG("resumed with flag=%d",
atomic_read(&reserve_open_flag));
return 0;
}
/*********************************************/
static struct file_operations akmd_fops = {
.owner = THIS_MODULE,
@@ -864,9 +887,9 @@ int akm8975_probe(struct i2c_client *client, const struct i2c_device_id *id)
atomic_set(&a_flag, 1);
atomic_set(&mv_flag, 1);
akm->akm_early_suspend.suspend = akm8975_early_suspend;
akm->akm_early_suspend.resume = akm8975_early_resume;
register_early_suspend(&akm->akm_early_suspend);
//akm->akm_early_suspend.suspend = akm8975_early_suspend;
//akm->akm_early_suspend.resume = akm8975_early_resume;
//register_early_suspend(&akm->akm_early_suspend);
AKMDBG("successfully probed.");
return 0;
@@ -910,6 +933,8 @@ static const struct i2c_device_id akm8975_id[] = {
static struct i2c_driver akm8975_driver = {
.probe = akm8975_probe,
.remove = akm8975_remove,
.suspend = akm8975_suspend,
.resume = akm8975_resume,
.id_table = akm8975_id,
.driver = {
.name = AKM8975_I2C_NAME,

View File

@@ -71,6 +71,11 @@
#define ISL_REG_ALSIR_LDATA (0x09)
#define ISL_REG_ALSIR_HDATA (0x0a)
#define ISL_REG_ALSIR_TH1 (0x05)
#define ISL_REG_ALSIR_TH2 (0x06)
#define ISL_REG_ALSIR_TH3 (0x07)
struct isl29028_data {
struct input_dev *psensor_input_dev;
struct input_dev *lsensor_input_dev;
@@ -707,6 +712,24 @@ static int isl29028_config(struct i2c_client *client)
printk("%s: config isl29028 PROX_HT(0x04) reg %#x \n", __FUNCTION__, value);
#endif
buf[0] = ISL_REG_ALSIR_TH1;
buf[1] = 0x0;
if ((ret = i2c_master_send(client, buf, 2)) < 2) {
printk("%s: config isl29028 register %#x err %d\n", __FUNCTION__, buf[0], ret);
}
buf[0] = ISL_REG_ALSIR_TH2;
buf[1] = 0xF0;
if ((ret = i2c_master_send(client, buf, 2)) < 2) {
printk("%s: config isl29028 register %#x err %d\n", __FUNCTION__, buf[0], ret);
}
buf[0] = ISL_REG_ALSIR_TH3;
buf[1] = 0xFF;
if ((ret = i2c_master_send(client, buf, 2)) < 2) {
printk("%s: config isl29028 register %#x err %d\n", __FUNCTION__, buf[0], ret);
}
mutex_unlock(&isl->lock);
return 0;

View File

@@ -823,6 +823,16 @@ config TOUCHSCREEN_IT7260
If unsure, say N (but it's safe to say "Y").
config TOUCHSCREEN_NAS
tristate "NAS based touchscreens: NAS Interface"
depends on I2C2_RK29
help
Say Y here if you have a touchscreen interface using the
nas controller, and your board-specific initialization
code includes that in its table of I2C devices.
If unsure, say N (but it's safe to say "Y").
config TOUCHSCREEN_GT801_IIC
tristate "GT801_IIC based touchscreens"
depends on I2C2_RK29

5
drivers/input/touchscreen/Makefile Executable file → Normal file
View File

@@ -54,6 +54,7 @@ obj-$(CONFIG_TOUCHSCREEN_WM97XX_ATMEL) += atmel-wm97xx.o
obj-$(CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE) += mainstone-wm97xx.o
obj-$(CONFIG_TOUCHSCREEN_WM97XX_ZYLONITE) += zylonite-wm97xx.o
obj-$(CONFIG_TOUCHSCREEN_W90X900) += w90p910_ts.o
obj-$(CONFIG_TOUCHSCREEN_TPS6507X) += tps6507x-ts.o
obj-$(CONFIG_TOUCHSCREEN_PCAP) += pcap_ts.o
obj-$(CONFIG_TOUCHSCREEN_XPT2046_NORMAL_SPI) += xpt2046_ts.o
obj-$(CONFIG_TOUCHSCREEN_XPT2046_TSLIB_SPI) += xpt2046_tslib_ts.o ts_lib/
@@ -69,6 +70,6 @@ obj-$(CONFIG_TOUCHSCREEN_GT801_IIC) += gt801_ts.o
obj-$(CONFIG_TOUCHSCREEN_GT818_IIC) += gt818_ts.o
obj-$(CONFIG_TOUCHSCREEN_ILI2102_IIC) += ili2102_ts.o
obj-$(CONFIG_D70_L3188A) += goodix_touch.o
obj-$(CONFIG_TOUCHSCREEN_FT5406) += ft5406_ts.o
obj-$(CONFIG_TOUCHSCREEN_FT5406) += ft5406_ts.o
obj-$(CONFIG_TOUCHSCREEN_GT819) += gt819.o
obj-$(CONFIG_TOUCHSCREEN_TPS6507X) += tps6507x-ts.o
obj-$(CONFIG_TOUCHSCREEN_NAS) += nas_ts.o

View File

@@ -360,6 +360,7 @@ static bool fts_register_read(u8 reg_name, u8* rx_buf, int rx_length)
E_UPGRADE_ERR_TYPE fts_ctpm_fw_upgrade(u8* pbt_buf, int dw_lenth)
{
u8 cmd,reg_val[2] = {0};
u8 buffer[2] = {0};
u8 packet_buf[FTS_PACKET_LENGTH + 6];
u8 auc_i2c_write_buf[10];
u8 bt_ecc;
@@ -502,7 +503,19 @@ E_UPGRADE_ERR_TYPE fts_ctpm_fw_upgrade(u8* pbt_buf, int dw_lenth)
/*******Step 7: reset the new FW**********/
cmd_write(0x07,0x00,0x00,0x00,1);
mdelay(100);//100ms
fts_register_read(0xfc, buffer, 1);
if (buffer[0] == 1)
{
cmd=4;
fts_register_write(0xfc, &cmd);
mdelay(2500);//2500ms
do
{
fts_register_read(0xfc, buffer, 1);
mdelay(100);//100ms
}while (buffer[0] != 1);
}
return ERR_OK;
}
@@ -568,6 +581,7 @@ static void ft5406_queue_work(struct work_struct *work)
#endif
if (ret < 0) {
dev_err(&data->client->dev, "ft5406_read_regs fail:%d!\n",ret);
enable_irq(data->irq);
return;
}
#if 0

View File

@@ -125,6 +125,15 @@ static int gt819_read_regs(struct i2c_client *client, u8 reg, u8 buf[], unsigned
if(ret>0)
return ret;
ret = i2c_master_reg8_recv(client, reg, buf, len, GT819_IIC_SPEED);
if(ret>0)
return ret;
ret = i2c_master_reg8_recv(client, reg, buf, len, GT819_IIC_SPEED);
if(ret>0)
return ret;
ret = i2c_master_reg8_recv(client, reg, buf, len, GT819_IIC_SPEED);
if(ret>0)
return ret;
ret = i2c_master_reg8_recv(client, reg, buf, len, GT819_IIC_SPEED);
return ret;
}
@@ -136,6 +145,15 @@ static int gt819_set_regs(struct i2c_client *client, u8 reg, u8 const buf[], uns
if(ret>0)
return ret;
ret = i2c_master_reg8_send(client, reg, buf, (int)len, GT819_IIC_SPEED);
if(ret>0)
return ret;
ret = i2c_master_reg8_send(client, reg, buf, (int)len, GT819_IIC_SPEED);
if(ret>0)
return ret;
ret = i2c_master_reg8_send(client, reg, buf, (int)len, GT819_IIC_SPEED);
if(ret>0)
return ret;
ret = i2c_master_reg8_send(client, reg, buf, (int)len, GT819_IIC_SPEED);
return ret;
}
@@ -155,39 +173,64 @@ int gt819_printf(char *buf, int len)
return 0;
}
int gt189_wait_for_slave(struct i2c_client *client)
int gt189_wait_for_slave(struct i2c_client *client, u8 status)
{
unsigned char i2c_state_buf[2];
int ret,i = 0;
while(i < MAX_I2C_RETRIES)
{
ret = gt819_read_regs(client,ADDR_STA, i2c_state_buf, 1);
printk("i2c read state byte:0x%x\n",i2c_state_buf[0]);
if(ret < 0)
return ERROR_I2C_TRANSFER;
if((i2c_state_buf[0] & SLAVE_READY) || (i2c_state_buf[0] & UPDATE_START))
if(i2c_state_buf[0] & status)
return i2c_state_buf[0];
msleep(10);
i++;
}
return ERROR_TIMEOUT;
return -ERROR_TIMEOUT;
}
int gt819_update_write_config(struct i2c_client *client)
{
int i,ret,len = sizeof(config_info);
ret = gt819_set_regs(client, 101, config_info, len);
if(ret < 0)
return ret;
for (i=0; i<len; i++) {
//printk("buf[%d] = 0x%x \n", i, config_info[i]);
{
int ret,len = sizeof(config_info)-1; //byte[0] is the reg addr in the gt819.cfg
u8 cfg_rd_buf[len];
u8 cfg_cmd_buf = 0x03;
u8 retries = 0;
reconfig:
ret = gt819_set_regs(client, 101, &config_info[1], len);
if(ret < 0)
return ret;
gt819_printf(config_info, len);
ret = gt819_read_regs(client, 101, cfg_rd_buf, len);
if(ret < 0)
return ret;
if(memcmp(cfg_rd_buf, &config_info[1], len))
{
dev_info(&client->dev, "config info check error!\n");
if(retries < 5)
{
retries++;
ret = gt819_set_regs(client, ADDR_CMD, &cfg_cmd_buf, 1);
if(ret < 0)
return ret;
goto reconfig;
}
return -1;
}
cfg_cmd_buf = 0x04;
ret = gt819_set_regs(client, ADDR_CMD, &cfg_cmd_buf, 1);
if(ret < 0)
return ret;
return 0;
}
return 0;
}
static int gt819_read_version(struct i2c_client *client)
static int gt819_read_version(struct i2c_client *client,char *version)
{
int ret, count = 0;
char version[17],*p;
char *p;
ret = gt819_read_regs(client,240, version, 16);
if (ret < 0)
@@ -210,15 +253,21 @@ int gt819_update_write_fw(struct i2c_client *client, char *fw_buf, int len)
{
int ret,data_len,i,check_len,frame_checksum,frame_number = 0;
unsigned char *p,i2c_data_buf[PACK_SIZE+8];
u8 i2c_rd_buf[PACK_SIZE+8];
u8 retries = 0;
u8 check_state = 0;
if(!client || !fw_buf)
return -1;
while(len){
frame_checksum = 0;
retries = 0;
check_len = (len >= PACK_SIZE) ? PACK_SIZE : len;
data_len = check_len+8;
dev_info(&client->dev, "PACK[%d]:prepare data,len = %d\n",frame_number,check_len);
p = fw_buf;
dev_info(&client->dev, "PACK[%d]:prepare data,remained len = %d\n",frame_number,len);
p = &fw_buf[frame_number*PACK_SIZE];
for(i=0; i<check_len; i++)
frame_checksum += *p++;
frame_checksum = 0 - frame_checksum;
@@ -227,38 +276,63 @@ int gt819_update_write_fw(struct i2c_client *client, char *fw_buf, int len)
*p++ = (frame_number>>16)&0xff;
*p++ = (frame_number>>8)&0xff;
*p++ = frame_number&0xff;
memcpy(p,fw_buf,check_len);
memcpy(p, &fw_buf[frame_number*PACK_SIZE],check_len);
p += check_len;
*p++ = frame_checksum&0xff;
*p++ = (frame_checksum>>8)&0xff;
*p++ = (frame_checksum>>16)&0xff;
*p++ = (frame_checksum>>24)&0xff;
gt819_printf(i2c_data_buf, data_len);
//gt819_printf(i2c_data_buf, data_len);
dev_info(&client->dev, "PACK[%d]:write to slave\n",frame_number);
resend:
ret = gt819_set_regs(client,ADDR_DAT, i2c_data_buf, data_len);
if(ret < 0)
return ret;
gt819_printf(i2c_data_buf, data_len);
//gt819_printf(i2c_data_buf, data_len);
dev_info(&client->dev, "PACK[%d]:read data\n",frame_number);
memset(i2c_data_buf, 0, sizeof(i2c_data_buf));
ret = gt819_read_regs(client,ADDR_DAT, i2c_data_buf, data_len);
memset(i2c_rd_buf, 0, sizeof(i2c_rd_buf));
ret = gt819_read_regs(client,ADDR_DAT, i2c_rd_buf, data_len);
if(ret < 0)
return ret;
gt819_printf(i2c_data_buf, data_len);
//gt819_printf(i2c_data_buf, data_len);
dev_info(&client->dev, "PACK[%d]:check data\n",frame_number);
if(memcmp(&i2c_data_buf[4],&fw_buf[frame_number*PACK_SIZE],data_len))
return -1;
//if(frame_number != (*((int*)i2c_data_buf)))
// return -1;
dev_info(&client->dev, "PACK[%d]:tell slave check data pass\n",frame_number);
i2c_data_buf[0] = 0x04;
ret = gt819_set_regs(client,ADDR_CMD, i2c_data_buf, 1);
if(ret < 0)
return ret;
dev_info(&client->dev, "PACK[%d]:wait for slave to start next frame\n",frame_number);
ret = gt189_wait_for_slave(client);
if((ret & CHECKSUM_ERROR) || (ret & FRAME_ERROR) || (ret & ERROR_I2C_TRANSFER) || (ret & ERROR_TIMEOUT))
if(memcmp(&i2c_rd_buf[4],&fw_buf[frame_number*PACK_SIZE],check_len))
{
dev_info(&client->dev, "PACK[%d]:File Data Frame readback check Error!\n",frame_number);
i2c_rd_buf[0] = 0x03;
ret = gt819_set_regs(client, ADDR_CMD, i2c_rd_buf, 1);
if(ret < 0)
return ret;
check_state = 0x01;
}
else
{
dev_info(&client->dev, "PACK[%d]:tell slave check data pass\n",frame_number);
i2c_rd_buf[0] = 0x04;
ret = gt819_set_regs(client,ADDR_CMD, i2c_rd_buf, 1);
if(ret < 0)
return ret;
dev_info(&client->dev, "PACK[%d]:wait for slave to start next frame\n",frame_number);
}
ret = gt189_wait_for_slave(client, SLAVE_READY);
if((ret & CHECKSUM_ERROR) || (ret & FRAME_ERROR) || (ret == ERROR_I2C_TRANSFER) || (ret < 0) || (check_state == 0x01))
{
if(((ret & CHECKSUM_ERROR) || (ret & FRAME_ERROR) || (check_state == 0x01))&&(retries < 5))
{
if(check_state != 0x01)
{
printk("checksum error or miss frame error!\n");
}
check_state = 0x00;
retries++;
msleep(20);
goto resend;
}
printk("wait slave return state:%d\n", ret);
return ret;
}
dev_info(&client->dev, "PACK[%d]:frame transfer finished\n",frame_number);
if(len < PACK_SIZE)
return 0;
@@ -272,10 +346,11 @@ int gt819_update_fw(struct i2c_client *client)
{
int ret,file_len,update_need_config;
unsigned char i2c_control_buf[10];
char version[17];
dev_info(&client->dev, "gt819 firmware update start...\n");
dev_info(&client->dev, "step 1:read version...\n");
ret = gt819_read_version(client);
ret = gt819_read_version(client,version);
if (ret < 0)
return ret;
dev_info(&client->dev, "done!\n");
@@ -291,7 +366,7 @@ int gt819_update_fw(struct i2c_client *client)
msleep(1000);
dev_info(&client->dev, "done!\n");
dev_info(&client->dev, "step 4:wait for slave start...\n");
ret = gt189_wait_for_slave(client);
ret = gt189_wait_for_slave(client, UPDATE_START);
if(ret < 0)
return ret;
if(!(ret & UPDATE_START))
@@ -301,6 +376,7 @@ int gt819_update_fw(struct i2c_client *client)
dev_info(&client->dev, "done!\n");
dev_info(&client->dev, "step 5:write the fw length...\n");
file_len = sizeof(gt819_fw) + 4;
dev_info(&client->dev, "file length is:%d\n", file_len);
i2c_control_buf[0] = (file_len>>24) & 0xff;
i2c_control_buf[1] = (file_len>>16) & 0xff;
i2c_control_buf[2] = (file_len>>8) & 0xff;
@@ -310,7 +386,7 @@ int gt819_update_fw(struct i2c_client *client)
return ret;
dev_info(&client->dev, "done!\n");
dev_info(&client->dev, "step 6:wait for slave ready\n");
ret = gt189_wait_for_slave(client);
ret = gt189_wait_for_slave(client, SLAVE_READY);
if(ret < 0)
return ret;
dev_info(&client->dev, "done!\n");
@@ -325,7 +401,7 @@ int gt819_update_fw(struct i2c_client *client)
return ret;
dev_info(&client->dev, "done!\n");
dev_info(&client->dev, "step 9:wait for slave ready\n");
ret = gt189_wait_for_slave(client);
ret = gt189_wait_for_slave(client,SLAVE_READY);
if(ret < 0)
return ret;
if(ret & SLAVE_READY)
@@ -333,8 +409,9 @@ int gt819_update_fw(struct i2c_client *client)
dev_info(&client->dev, "step 10:enable irq...\n");
enable_irq(client->irq);
dev_info(&client->dev, "done!\n");
msleep(1000); //wait slave reset
dev_info(&client->dev, "step 11:read version...\n");
ret = gt819_read_version(client);
ret = gt819_read_version(client,version);
if (ret < 0)
return ret;
dev_info(&client->dev, "done!\n");
@@ -347,13 +424,18 @@ static void gt819_queue_work(struct work_struct *work)
struct goodix_ts_data *ts = container_of(work, struct goodix_ts_data, work);
uint8_t point_data[53]={ 0 };
int ret,i,offset,points;
int points_chect;
int x,y,w;
unsigned int count = 0;
uint8_t check_sum = 0;
ret = gt819_read_regs(ts->client,1, point_data, 1);
ret = gt819_read_regs(ts->client,1, point_data, 2);
if (ret < 0) {
dev_err(&ts->client->dev, "i2c_read_bytes fail:%d!\n",ret);
enable_irq(ts->irq);
return;
}
check_sum =point_data[0]+point_data[1];
points = point_data[0] & 0x1f;
//dev_info(&ts->client->dev, "points = %d\n",points);
@@ -369,11 +451,26 @@ static void gt819_queue_work(struct work_struct *work)
for(i=0;0!=points;i++)
points>>=1;
points = i;
ret = gt819_read_regs(ts->client,3, point_data, points*5);
points_chect = points;
ret = gt819_read_regs(ts->client,3, point_data, points*5+1);
if (ret < 0) {
dev_err(&ts->client->dev, "i2c_read_bytes fail:%d!\n",ret);
enable_irq(ts->irq);
return;
}
//add by Nitiion
for(points_chect *= 5; points_chect > 0; points_chect--)
{
check_sum += point_data[count++];
}
check_sum += point_data[count];
if(check_sum != 0) //checksum verify error
{
printk("coor checksum error!\n");
enable_irq(ts->irq);
return;
}
for(i=0;i<points;i++){
offset = i*5;
x = (((s16)(point_data[offset+0]))<<8) | ((s16)point_data[offset+1]);
@@ -517,6 +614,8 @@ return:
static int gt819_probe(struct i2c_client *client, const struct i2c_device_id *id)
{
int ret = 0;
char version[17];
char version_base[17]={"GT81XNI_1R05TEST"};
struct goodix_ts_data *ts;
struct goodix_platform_data *pdata = client->dev.platform_data;
const char irq_table[4] = {IRQ_TYPE_EDGE_RISING,
@@ -550,7 +649,12 @@ static int gt819_probe(struct i2c_client *client, const struct i2c_device_id *id
dev_err(&client->dev,"init panel fail,ret = %d\n",ret);
goto err_init_panel_fail;
}
//gt819_update_fw(client);
ret = gt819_read_version(client,version);
if((ret>=0) && (strcmp(version ,version_base)!=0)){
gt819_update_fw(client);
}
if (!client->irq){
dev_err(&client->dev,"no irq fail\n");
ret = -ENODEV;

File diff suppressed because it is too large Load Diff

View File

@@ -344,14 +344,14 @@ static void ili2102_ts_work_func(struct work_struct *work)
msg[0].flags = ts->client->flags;
msg[0].len = 1;
msg[0].buf = &start_reg;
msg[0].scl_rate = 400*1000;
msg[0].udelay = 250;
msg[0].scl_rate = 200*1000;
msg[0].udelay = 200;
msg[1].addr = ts->client->addr;
msg[1].flags = ts->client->flags | I2C_M_RD;
msg[1].len = 9;
msg[1].buf = buf;
msg[1].scl_rate = 400*1000;
msg[1].scl_rate = 200*1000;
msg[1].udelay = 0;
ret = i2c_transfer(ts->client->adapter, msg, 2);
@@ -419,7 +419,7 @@ static void ili2102_ts_work_func(struct work_struct *work)
if(syn_flag)
input_sync(ts->input_dev);
out:
#if 1
#if 0
if(ts->pendown)
{
schedule_delayed_work(&ts->work, msecs_to_jiffies(12));

View File

@@ -0,0 +1,993 @@
/****************************************************************************************
* driver/input/touchscreen/hannstar_nas.c
*Copyright :ROCKCHIP Inc
*Author : sfm
*Date : 2010.2.5
*This driver use for rk28 chip extern touchscreen. Use i2c IF ,the chip is Hannstar
*description??
********************************************************************************************/
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/earlysuspend.h>
#include <linux/hrtimer.h>
#include <linux/i2c.h>
#include <linux/input.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/platform_device.h>
#include <linux/async.h>
#include <mach/gpio.h>
#include <linux/irq.h>
#include <mach/board.h>
#include <linux/proc_fs.h>
#include <asm/uaccess.h>
#include <linux/earlysuspend.h>
#define MAX_SUPPORT_POINT 2// // 4
#define PACKGE_BUFLEN 10
#define CHECK_STATUS 1
//#define TP_ERROR_RESTART_POWER 1
//#define Singltouch_Mode
//#define NAS_TP_DEBUG 0
#define SAKURA_DBG 0
#if SAKURA_DBG
#define sakura_dbg_msg(fmt,...) do { \
printk("sakura dbg msg------>" \
" (func-->%s ; line-->%d) " fmt, __func__, __LINE__ , ##__VA_ARGS__); \
} while(0)
#define sakura_dbg_report_key_msg(fmt,...) do{ \
printk("sakura report " fmt,##__VA_ARGS__); \
}while(0)
#else
#define sakura_dbg_msg(fmt,...) do {} while(0)
#define sakura_dbg_report_key_msg(fmt,...) do{}while(0)
#endif
#define SWAP_Y_POS
#define TOUCH_REPORT_X_MAX 1280//(1255) //(1280 - 1)//(0xfff)
#define TOUCH_REPORT_Y_MAX 768//(700) //(768 - 1)//(0xfff)
#define RECORD_PREVIOUS_VALUES
#define FILTER_SAME_POINTS
#define NASTECH_ZERO_TOUCH 0
#define NASTECH_ONE_TOUCH 1
#define NASTECH_TWO_TOUCH 2
#define NASTECH_PENUP_RECHECK 3
#define NASTECH_DeltaX 100
#define NASTECH_DeltaY 80
#define NASTECH_R_Threshold 4000
/*delay used to check the touch panel current status.*/
#define TS_RELEASE_CHECK_DELAY (100)
#define TS_CUR_STATUS_PUSH 1
#define TS_CUR_STATUS_RELEASE 0
#define TS_POLL_DELAY_DOWN (2) /* ms delay before the first sample */
#define TS_POLL_DELAY_UP (10) /* ms delay after pen up, to double check the pen up event */
#define TS_POLL_PERIOD (30) /* ms delay between samples */
#define PENUP_DETECT_MAX (4) /* How many times we should detect for a penup event. */
#define INT_TEST_TIMES 40
struct touch_point {
int count;
int curX;
int curY;
int unCalX;
int unCalY;
int prevX;
int prevY;
#ifdef RECORD_PREVIOUS_VALUES
int sample_time;
int last_finger;
int x[2];
int y[2];
#endif
};
struct point_data {
short status;
short x;
short y;
short z;
};
struct multitouch_event{
struct point_data point_data[MAX_SUPPORT_POINT];
int contactid;
int validtouch;
};
struct ts_nas {
struct input_dev *input;
char phys[32];
struct delayed_work work;
struct workqueue_struct *wq;
struct i2c_client *client;
struct multitouch_event mt_event;
u16 model;
bool pendown;
bool status;
int irq;
int has_relative_report;
//add from nas
bool sleepstatus;
bool pendown_sent; /* Whether we've sent out a pendown event */
bool pendown_ignore; /* Sample two points and send out only one point */
int penup_recheck; /* Pen up re-check times, when it reaches PENUP_DETECTE_MAX, pen up is reported. */
int release_check_time; /* Debounse time for pen down, ms */
int pendown_debounce_time; /* Debounse time for pen down, ms */
int penup_debounce_time; /* Debounce time for pen up, ms */
int repeat_time; /* Time between samples, ms */
struct touch_point point;
struct timer_list status_check_timer;
int reported_finger_count;
int touch_cur_status;
int (*get_pendown_state)(void);
void (*clear_penirq)(void);
#ifdef CHECK_STATUS
struct delayed_work work1;
struct workqueue_struct *wq1;
#endif
};
//mg gamma
unsigned short y_gamma[]={
0 , 0 , 1 , 1 ,
2 , 3 , 3 , 4 , 5 , 6 , 6 , 7 ,
8 , 9 , 10 , 10 , 11 , 12 , 13 , 14 ,
15 , 15 , 16 , 17 , 18 , 19 , 20 , 21 ,
21 , 22 , 23 , 24 , 25 , 26 , 27 , 28 ,
28 , 29 , 30 , 31 , 32 , 33 , 34 , 35 ,
36 , 37 , 38 , 38 , 39 , 40 , 41 , 42 ,
43 , 44 , 45 , 46 , 47 , 48 , 49 , 50 ,
51 , 52 , 52 , 53 , 54 , 55 , 56 , 57 ,
58 , 59 , 60 , 61 , 62 , 63 , 64 , 65 ,
66 , 67 , 68 , 69 , 70 , 71 , 72 , 73 ,
74 , 75 , 76 , 77 , 78 , 79 , 80 , 81 ,
82 , 83 , 84 , 85 , 86 , 87 , 88 , 89 ,
90 , 91 , 92 , 93 , 94 , 95 , 96 , 97 ,
98 , 99 , 100 , 101 , 102 , 103 , 104 , 105 ,
106 , 107 , 108 , 109 , 110 , 111 , 112 , 113 ,
114 , 115 , 116 , 117 , 118 , 119 , 120 , 121 ,
122 , 123 , 124 , 125 , 126 , 127 , 128 , 129 ,
130 , 132 , 133 , 134 , 135 , 136 , 137 , 138 ,
139 , 140 , 141 , 142 , 143 , 144 , 145 , 146 ,
147 , 148 , 149 , 150 , 151 , 152 , 154 , 155 ,
156 , 157 , 158 , 159 , 160 , 161 , 162 , 163 ,
164 , 165 , 166 , 167 , 168 , 169 , 171 , 172 ,
173 , 174 , 175 , 176 , 177 , 178 , 179 , 180 ,
181 , 182 , 183 , 184 , 186 , 187 , 188 , 189 ,
190 , 191 , 192 , 193 , 194 , 195 , 196 , 197 ,
199 , 200 , 201 , 202 , 203 , 204 , 205 , 206 ,
207 , 208 , 209 , 210 , 212 , 213 , 214 , 215 ,
216 , 217 , 218 , 219 , 220 , 221 , 222 , 224 ,
225 , 226 , 227 , 228 , 229 , 230 , 231 , 232 ,
233 , 235 , 236 , 237 };
unsigned short y_gamma900[]={
0 , 0 , 1 , 2 ,
3 , 4 , 4 , 5 , 6 , 7 , 8 , 9 ,
10 , 11 , 12 , 12 , 13 , 14 , 15 , 16 ,
17 , 18 , 19 , 20 , 21 , 22 , 23 , 23 ,
24 , 25 , 26 , 27 , 28 , 29 , 30 , 31 ,
32 , 33 , 34 , 35 , 36 , 37 , 38 , 39 ,
40 , 41 , 42 , 42 , 43 , 44 , 45 , 46 ,
47 , 48 , 49 , 50 , 51 , 52 , 53 , 54 ,
55 , 56 , 57 , 58 , 59 , 60 , 61 , 62 ,
63 , 64 , 65 , 66 , 67 , 68 , 69 , 70 ,
71 , 72 , 73 , 74 , 75 , 76 , 77 , 78 ,
79 , 80 , 81 , 82 , 83 , 84 , 85 , 86 ,
87 , 88 , 89 , 90 , 91 , 92 , 93 , 94 ,
95 , 96 , 97 , 98 , 99 , 100 , 101 , 102 ,
103 , 104 , 105 , 106 , 107 , 108 , 109 , 110 ,
111 , 112 , 113 , 114 , 115 , 116 , 117 , 118 ,
119 , 120 , 121 , 122 , 123 , 124 , 125 , 126 ,
127 , 128 , 129 , 130 , 131 , 132 , 133 , 134 ,
135 , 136 , 137 , 138 , 139 , 140 , 141 , 142 ,
143 , 144 , 145 , 146 , 147 , 148 , 149 , 150 ,
152 , 153 , 154 , 155 , 156 , 157 , 158 , 159 ,
160 , 161 , 162 , 163 , 164 , 165 , 166 , 167 ,
168 , 169 , 170 , 171 , 172 , 173 , 174 , 175 ,
176 , 177 , 178 , 179 , 180 , 181 , 182 , 183 ,
185 , 186 , 187 , 188 , 189 , 190 , 191 , 192 ,
193 , 194 , 195 , 196 , 197 , 198 , 199 , 200 ,
201 , 202 , 203 , 204 , 205 , 206 , 207 , 208 ,
209 , 210 , 212 , 213 , 214 , 215 , 216 , 217 ,
218 , 219 , 220 , 221 , 222 , 223 , 224 , 225 ,
226 , 227 , 228 , 229 , 230 , 231 , 232 , 233 ,
235 , 236 , 237 , 238 };
unsigned short y_gamma800[]={
0 , 0 , 0 , 0 , 1 , 1 ,
2 , 2 , 3 , 3 , 4 , 5 , 5 , 6 ,
6 , 7 , 8 , 8 , 9 , 9 , 10 , 11 ,
11 , 12 , 13 , 13 , 14 , 15 , 16 , 16 ,
17 , 18 , 19 , 19 , 20 , 21 , 22 , 22 ,
23 , 24 , 25 , 25 , 26 , 27 , 28 , 29 ,
29 , 30 , 31 , 32 , 33 , 34 , 34 , 35 ,
36 , 37 , 38 , 39 , 40 , 40 , 41 , 42 ,
43 , 44 , 45 , 46 , 47 , 47 , 48 , 49 ,
50 , 51 , 52 , 53 , 54 , 55 , 56 , 57 ,
58 , 58 , 59 , 60 , 61 , 62 , 63 , 64 ,
65 , 66 , 67 , 68 , 69 , 70 , 71 , 72 ,
73 , 74 , 75 , 76 , 77 , 78 , 79 , 80 ,
81 , 82 , 83 , 84 , 85 , 86 , 87 , 88 ,
89 , 90 , 91 , 92 , 93 , 94 , 95 , 96 ,
97 , 98 , 99 , 100 , 101 , 102 , 103 , 104 ,
105 , 106 , 107 , 108 , 109 , 110 , 111 , 113 ,
114 , 115 , 116 , 117 , 118 , 119 , 120 , 121 ,
122 , 123 , 124 , 125 , 127 , 128 , 129 , 130 ,
131 , 132 , 133 , 134 , 135 , 136 , 137 , 139 ,
140 , 141 , 142 , 143 , 144 , 145 , 146 , 147 ,
149 , 150 , 151 , 152 , 153 , 154 , 155 , 157 ,
158 , 159 , 160 , 161 , 162 , 163 , 164 , 166 ,
167 , 168 , 169 , 170 , 171 , 173 , 174 , 175 ,
176 , 177 , 178 , 180 , 181 , 182 , 183 , 184 ,
185 , 187 , 188 , 189 , 190 , 191 , 192 , 194 ,
195 , 196 , 197 , 198 , 200 , 201 , 202 , 203 ,
204 , 206 , 207 , 208 , 209 , 210 , 212 , 213 ,
214 , 215 , 216 , 218 , 219 , 220 , 221 , 222 ,
224 , 225 , 226 , 227 , 229 , 230 , 231 , 232 ,
233 , 235 , 236 , 237 , 238 , 240 , 241 , 242 ,
243 , 245 , 246 , 247 , 248 , 250 , 251 , 252 ,
253 , 255 , 256 , 257 , 258 , 260 , 261 , 262
};
static struct proc_dir_entry *nas_tp_debug_ctl_entry;
static char nas_tp_debug_flag = 0;
extern void nas_reset(void);
static void nas_early_resume(struct early_suspend *h)
{
//nas_reset();
}
static struct early_suspend nastech_early_suspend =
{
.resume = nas_early_resume
};
#ifdef CHECK_STATUS
static void nas_status_check_timer(unsigned long data)
{
unsigned char buf[4]={0};
struct ts_nas *ts_dev = (struct ts_nas *)data;
int ret=0;
//printk("nas_status_check_timer ...\n");
queue_delayed_work(ts_dev->wq1, &ts_dev->work1, 0);
ts_dev->status_check_timer.expires = jiffies + msecs_to_jiffies(1000);
add_timer(&ts_dev->status_check_timer);
}
#define FB_DISPLAY_ON_PIN RK29_PIN6_PD0
extern void rk29_lcd_reset(void);
static void nas_status_check_work(struct work_struct *work1)
{
unsigned char buf[4]={0};
struct ts_nas *ts_dev =
container_of(to_delayed_work(work1), struct ts_nas, work1);
int ret=0;
if (GPIO_LOW == gpio_get_value(FB_DISPLAY_ON_PIN))
return;
//printk("nas_status_check_work ...");
ret = i2c_master_reg8_recv( ts_dev->client, 0xFC, buf, 1, 200*1000);
//printk(" ret = %d\n", ret);
if( ret <0)
{
printk("nas status error, ret=%d \nnas_reset()\n", ret);
#ifdef TP_ERROR_RESTART_POWER
rk29_lcd_reset();
msleep(100);
#endif
nas_reset();
}
}
#endif
/** Get point from touch pannel */
static int nastech_ts_get_point(struct ts_nas *ts_dev, unsigned short *pX, unsigned short *pY)
{
unsigned short xpos, ypos;
unsigned short xpos0, ypos0;
unsigned char event;
unsigned char Finger, hwFinger;
unsigned char buf[26];
//unsigned char buf[13]; // for 2 finger touch, only used the first 13 bytes
int ret;
int nTouch = 0;
struct i2c_client *client = ts_dev->client;
struct input_dev *input = ts_dev->input;
memset(buf, 0xff, sizeof(buf));
//ret = nastech_read_regs(client, NASTECH_READ_POS, buf, sizeof(buf));
ret = i2c_master_reg8_recv( ts_dev->client, 0xF9, buf, 26, 200*1000);
hwFinger=buf[3];
//-------------------------------------------------------------------------------------------
//xpos=(unsigned short)(buf[7]*0x100);
xpos=(unsigned short)((buf[7]&0x0f)<<8 );
xpos=xpos|buf[8];
//ypos=(unsigned short)(buf[5]*0x100);
ypos=(unsigned short)((buf[5]&0x0f)<<8 );
ypos=ypos|buf[6];
//xpos0=(unsigned short)(buf[11]*0x100);
xpos0=(unsigned short)((buf[11]&0x0f)<<8 );
xpos0=xpos0|buf[12];
//ypos0=(unsigned short)(buf[9]*0x100);
ypos0=(unsigned short)((buf[9]&0x0f)<<8 );
ypos0=ypos0|buf[10];
//-------------------------------------------------------------------------------------------
//#ifdef NAS_TP_DEBUG
if (nas_tp_debug_flag == 1)
printk(KERN_INFO "read from TP: (%d,%d), (%d,%d)\n", xpos, ypos, xpos0, ypos0);
//#endif
unsigned short ypos_pre,ratio;
*pX = xpos;
*pY = ypos;
#ifdef TOUCH_REPORT_ONLY_ONE_POINT
if(xpos==0x0FFF || ypos==0x0FFF)
{
Finger = NASTECH_ZERO_TOUCH;
}
else
{
Finger = NASTECH_ONE_TOUCH;
}
#else
if(xpos==0x0FFF || ypos==0x0FFF)
{
Finger = NASTECH_ZERO_TOUCH;
}
else
{
Finger = NASTECH_ONE_TOUCH;
}
if(xpos0!=0x0FFF && ypos0!=0x0FFF)
{
Finger = NASTECH_TWO_TOUCH;
}
#ifdef SWAP_Y_POS
ypos = TOUCH_REPORT_Y_MAX - ypos;
if(ypos < 0)
ypos = 0;
if (ypos<262)
{
ratio=ypos;
ypos= y_gamma800[ratio];
}
if (ypos>506)
{
ratio= 767-ypos ;
ypos=767-y_gamma800[ratio];
}
if (xpos<262)
{
ratio=xpos;
xpos= y_gamma800[ratio];
}
if (xpos>1017)
{
ratio=1279-xpos;
xpos= 1279-y_gamma800[ratio];
}
//ypos=report_y_correction(y_pre); //mg for coorection
ypos0 = TOUCH_REPORT_Y_MAX - ypos0;
if(ypos0 < 0)
ypos0 = 0;
if (ypos0<262)
{
ratio=ypos0;
ypos0= y_gamma800[ratio];
}
if (ypos0>506)
{
ratio= 767-ypos0 ;
ypos0=767-y_gamma800[ratio];
}
if (xpos0<262)
{
ratio=xpos0;
xpos0= y_gamma800[ratio];
}
if (xpos>1017)
{
ratio=1279-xpos0;
xpos0= 1279-y_gamma800[ratio];
}
#endif
//#ifdef NAS_TP_DEBUG
if (nas_tp_debug_flag == 1) {
if (NASTECH_TWO_TOUCH == Finger) {
printk(KERN_INFO "original: (%d,%d), (%d,%d)\n", xpos, ypos, xpos0, ypos0);
} else if (NASTECH_ONE_TOUCH == Finger) {
printk(KERN_INFO "original: (%d,%d)\n", xpos, ypos);
}
}
//#endif
//printk("nastech_ts_get_point: Finger = %d!\n",Finger);
#ifdef RECORD_PREVIOUS_VALUES
if (ts_dev->point.last_finger == Finger)
{
switch(Finger)
{
case NASTECH_ZERO_TOUCH:
break;
case NASTECH_ONE_TOUCH:
if (ts_dev->point.x[0] == xpos && ts_dev->point.y[0] == ypos)
return Finger;
break;
case NASTECH_TWO_TOUCH:
if ((ts_dev->point.x[0] == xpos && ts_dev->point.y[0] == ypos)
&& (ts_dev->point.x[1] == xpos0 && ts_dev->point.y[1] == ypos0))
return Finger;
break;
}
ts_dev->point.x[0] = xpos;
ts_dev->point.y[0] = ypos;
ts_dev->point.x[1] = xpos0;
ts_dev->point.y[1] = ypos0;
}
else
{
ts_dev->point.last_finger = Finger;
ts_dev->point.x[0] = xpos;
ts_dev->point.y[0] = ypos;
ts_dev->point.x[1] = xpos0;
ts_dev->point.y[1] = ypos0;
}
#endif
{
int z,w;
if(!Finger)
{
z=0;
w=0;
}
else
{
z=255;
w=15;
}
ts_dev->touch_cur_status = TS_CUR_STATUS_PUSH;
if(Finger>1)
{
input_report_abs(input, ABS_MT_TOUCH_MAJOR, z);
input_report_abs(input, ABS_MT_WIDTH_MAJOR, w);
input_report_abs(input, ABS_MT_POSITION_X, xpos);
input_report_abs(input, ABS_MT_POSITION_Y, ypos);
input_report_key(ts_dev->input, BTN_TOUCH, 1);
input_mt_sync(input);
input_report_abs(input, ABS_MT_TOUCH_MAJOR, z);
input_report_abs(input, ABS_MT_WIDTH_MAJOR, w);
input_report_abs(input, ABS_MT_POSITION_X, xpos0);
input_report_abs(input, ABS_MT_POSITION_Y, ypos0);
input_report_key(ts_dev->input, BTN_2, 1);
input_mt_sync(input);
}
else
{
if (1 == Finger)
{
input_report_abs(input, ABS_MT_POSITION_X, xpos);
input_report_abs(input, ABS_MT_POSITION_Y, ypos);
input_report_abs(input, ABS_MT_TOUCH_MAJOR, z);
input_report_abs(input, ABS_MT_WIDTH_MAJOR, w);
input_report_key(ts_dev->input, BTN_TOUCH, 1);
input_mt_sync(input);
//printk("pen press (x,y):(%d,%d)\n",xpos,ypos);
}
else
{
// printk("nastech_ts_get_point: released......!\n");
input_report_abs(input, ABS_MT_POSITION_X, xpos);
input_report_abs(input, ABS_MT_POSITION_Y, ypos);
input_report_abs(input, ABS_MT_TOUCH_MAJOR, z);
input_report_abs(input, ABS_MT_WIDTH_MAJOR, w);
input_report_key(ts_dev->input, BTN_TOUCH, 0);
input_mt_sync(input);
ts_dev->touch_cur_status = TS_CUR_STATUS_RELEASE;
}
if(ts_dev->reported_finger_count > 1)
{
input_report_abs(input, ABS_MT_POSITION_X, xpos);
input_report_abs(input, ABS_MT_POSITION_Y, ypos);
input_report_abs(input, ABS_MT_TOUCH_MAJOR, 0);
input_report_abs(input, ABS_MT_WIDTH_MAJOR, 0);
input_report_key(ts_dev->input, BTN_2, 0);
input_mt_sync(input);
}
}
ts_dev->reported_finger_count = Finger;
}
input_sync(input);
#endif
return (int)Finger;
}
static int nastech_sample_new_point(struct ts_nas *ts_dev)
{
unsigned short x, y;
unsigned int nTouch = 0;
struct i2c_client *client = ts_dev->client;
struct touch_point *point = &ts_dev->point;
nTouch = nastech_ts_get_point(ts_dev, &x, &y);
point->unCalX = x;
point->unCalY = y;
if (unlikely(NASTECH_ZERO_TOUCH == nTouch)) {
//printk(KERN_INFO "<======Pen released at (%d, %d)\n", point->prevX, point->prevY);
point->curX = point->curY = 0;
point->count = 0;
} else {
point->curX = x;
point->curY = y;
#ifdef TOUCHPANEL_SWAP_XY
{
int temp = point->curX;
point->curX = point->curY;
point->curY = temp;
}
#endif
if(nTouch == NASTECH_ONE_TOUCH) {
if( !ts_dev->pendown_sent || (abs(point->curX-point->prevX) < NASTECH_DeltaX)
&& (abs(point->curY - point->prevY) < NASTECH_DeltaY) ){ // is it a movement ?
// update pX, pY and send new point
point->prevX = point->curX;
point->prevY = point->curY;
} else {
printk(KERN_INFO "use the old touch: prev=(%d,%d), cur=(%d,%d)\n",
point->prevX, point->prevY, point->curX, point->curY);
// use old one
point->curX = point->prevX;
point->curY = point->prevY;
}
}
}
return nTouch;
}
int nas_get_pendown_state(void)
{
return 0;
}
static void nas_report_event(struct ts_nas *ts,struct multitouch_event *tc)
{
struct input_dev *input = ts->input;
int i,pandown = 0;
dev_dbg(&ts->client->dev, "UP\n");
for(i=0; i<MAX_SUPPORT_POINT;i++){
if(tc->point_data[i].status >= 0){
pandown |= tc->point_data[i].status;
input_report_abs(input, ABS_MT_TRACKING_ID, i);
input_report_abs(input, ABS_MT_TOUCH_MAJOR, tc->point_data[i].status);
input_report_abs(input, ABS_MT_WIDTH_MAJOR, 0);
input_report_abs(input, ABS_MT_POSITION_X, tc->point_data[i].x);
input_report_abs(input, ABS_MT_POSITION_Y, tc->point_data[i].y);
input_mt_sync(input);
sakura_dbg_report_key_msg("ABS_MT_TRACKING_ID = %x, ABS_MT_TOUCH_MAJOR = %x\n ABS_MT_POSITION_X = %x, ABS_MT_POSITION_Y = %x\n",i,tc->point_data[i].status,tc->point_data[i].x,tc->point_data[i].y);
#if defined(CONFIG_HANNSTAR_DEBUG)
printk("hannstar nas Px = [%d],Py = [%d] \n",tc->point_data[i].x,tc->point_data[i].y);
#endif
if(tc->point_data[i].status == 0)
tc->point_data[i].status--;
}
}
ts->pendown = pandown;
input_sync(input);
}
static inline int nas_check_firmwork(struct ts_nas *ts)
{
int data;
int len = 10;
char buf[10] = {0x03 , 0x03 , 0x0a , 0x01 , 'D' , 0x00 , 0x00 , 0x00 , 0x00 , 0x00};
int i;
short contactid=0;
data = i2c_master_normal_send(ts->client, buf,len, 200*1000);
if(data < 0){
dev_err(&ts->client->dev, "i2c io error %d \n", data);
return data;
}
data = i2c_master_normal_recv(ts->client, buf,len, 200*1000);
if(data < 0){
dev_err(&ts->client->dev, "i2c io error %d \n", data);
return data;
}
printk("nas reg[5] = %c ,reg[6] = %c, reg[7] = %c, reg[8] = %c\n" , buf[5],buf[6],buf[7],buf[8]);
printk("nas reg[5] = %x ,reg[6] = %x, reg[7] = %x, reg[8] = %x\n" , buf[5],buf[6],buf[7],buf[8]);
return data;
}
static inline int nas_read_values(struct ts_nas *ts, struct multitouch_event *tc)
{
int data, j;
int len = 10;
char buff[26];
int ret;
int i;
unsigned short xpos, ypos, xpos0, ypos0;
memset(buff, 0xff, sizeof(buff));
ret = i2c_master_reg8_recv( ts->client, 0xF9, buff, 26, 200*1000);
/*
printk("ret = %d, buff[]=\n", ret);
for(i=0; i<26; i++)
{
if(i %8 == 0)
printk("\n");
printk("0x%02x ", buff[i]);
}
*/
//-------------------------------------------------------------------------------------------
//xpos=(unsigned short)(buf[7]*0x100);
xpos=(unsigned short)((buff[7]&0x0f)<<8 );
xpos=xpos|buff[8];
//ypos=(unsigned short)(buf[5]*0x100);
ypos=(unsigned short)((buff[5]&0x0f)<<8 );
ypos=ypos|buff[6];
//xpos0=(unsigned short)(buf[11]*0x100);
xpos0=(unsigned short)((buff[11]&0x0f)<<8 );
xpos0=xpos0|buff[12];
//ypos0=(unsigned short)(buf[9]*0x100);
ypos0=(unsigned short)((buff[9]&0x0f)<<8 );
ypos0=ypos0|buff[10];
//-------------------------------------------------------------------------------------------
// printk("read from TP: (%d,%d), (%d,%d)\n", xpos, ypos, xpos0, ypos0);
return 10;
}
static void nas_work(struct work_struct *work)
{
struct ts_nas *ts =
container_of(to_delayed_work(work), struct ts_nas, work);
struct multitouch_event *tc = &ts->mt_event;
int rt;
#if 0
rt = nas_read_values(ts,tc);
if(rt < 0)
goto out;
#if defined (Singltouch_Mode)
nas_report_single_event(ts,tc);
#else
nas_report_event(ts,tc);
#endif
#endif
// if (ts->sleepstatus == 1)
// return;
switch(nastech_sample_new_point(ts)) {
case NASTECH_ZERO_TOUCH:
break;
case NASTECH_ONE_TOUCH:
case NASTECH_TWO_TOUCH:
#if 0
{
/* periodly sample the next points */
del_timer(&ts->repeat_timer);
ts->repeat_timer.expires = jiffies + msecs_to_jiffies(ts->repeat_time);
add_timer(&ts->repeat_timer);
}
#endif
break;
default:
break;
}
out:
#if 1
enable_irq(ts->irq);
#else
if (ts->pendown){
queue_delayed_work(ts->wq, &ts->work, msecs_to_jiffies(10));
ts->pendown = 0;
}
else{
enable_irq(ts->irq);
}
#endif
}
static irqreturn_t nas_irq(int irq, void *handle)
{
struct ts_nas *ts = handle;
//printk("enter nas_irq()\n");
#if 1
if (!ts->get_pendown_state || likely(ts->get_pendown_state())) {
//printk("disable_irq_nosync()\n");
disable_irq_nosync(ts->irq);
queue_delayed_work(ts->wq, &ts->work, 0);
}
#endif
return IRQ_HANDLED;
}
static void nas_free_irq(struct ts_nas *ts)
{
free_irq(ts->irq, ts);
if (cancel_delayed_work_sync(&ts->work)) {
/*
* Work was pending, therefore we need to enable
* IRQ here to balance the disable_irq() done in the
* interrupt handler.
*/
enable_irq(ts->irq);
}
}
static ssize_t nas_tp_debug_ctl(struct file *file, const char __user *buffer, size_t count, loff_t *data)
{
char val;
if (copy_from_user(&val, buffer, 1))
return -EFAULT;
if (val != '0' && val != '1')
return -EINVAL;
nas_tp_debug_flag = val - '0';
return count;
}
static int __devinit nas_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct ts_nas *ts;
struct nas_platform_data *pdata = pdata = client->dev.platform_data;
struct input_dev *input_dev;
int err;
if (!pdata) {
dev_err(&client->dev, "platform data is required!\n");
return -EINVAL;
}
if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
return -EIO;
ts = kzalloc(sizeof(struct ts_nas), GFP_KERNEL);
input_dev = input_allocate_device();
if (!ts || !input_dev) {
err = -ENOMEM;
goto err_free_mem;
}
ts->client = client;
ts->irq = client->irq;
ts->input = input_dev;
ts->status =0 ;// fjp add by 2010-9-30
ts->pendown = 0; // fjp add by 2010-10-06
ts->wq = create_rt_workqueue("nas_wq");
INIT_DELAYED_WORK(&ts->work, nas_work);
#ifdef CHECK_STATUS
ts->wq1 = create_rt_workqueue("nas_wq1");
INIT_DELAYED_WORK(&ts->work1, nas_status_check_work);
#endif
ts->model = pdata->model;
snprintf(ts->phys, sizeof(ts->phys),
"%s/input0", dev_name(&client->dev));
input_dev->name = "nas Touchscreen";
input_dev->phys = ts->phys;
input_dev->id.bustype = BUS_I2C;
ts->has_relative_report = 0;
input_dev->evbit[0] = BIT_MASK(EV_ABS)|BIT_MASK(EV_KEY)|BIT_MASK(EV_SYN);
input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
input_dev->keybit[BIT_WORD(BTN_2)] = BIT_MASK(BTN_2); //jaocbchen for dual
#if 0
input_set_abs_params(input_dev, ABS_X, 0, CONFIG_HANNSTAR_MAX_X, 0, 0);
input_set_abs_params(input_dev, ABS_Y, 0, CONFIG_HANNSTAR_MAX_Y, 0, 0);
input_set_abs_params(input_dev, ABS_PRESSURE, 0, 255, 0, 0);
input_set_abs_params(input_dev, ABS_TOOL_WIDTH, 0, 15, 0, 0);
input_set_abs_params(input_dev, ABS_HAT0X, 0, CONFIG_HANNSTAR_MAX_X, 0, 0);
input_set_abs_params(input_dev, ABS_HAT0Y, 0, CONFIG_HANNSTAR_MAX_Y, 0, 0);
input_set_abs_params(input_dev, ABS_MT_POSITION_X,0, CONFIG_HANNSTAR_MAX_X, 0, 0);
input_set_abs_params(input_dev, ABS_MT_POSITION_Y, 0, CONFIG_HANNSTAR_MAX_Y, 0, 0);
input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0);
input_set_abs_params(input_dev, ABS_MT_WIDTH_MAJOR, 0, 255, 0, 0);
input_set_abs_params(input_dev, ABS_MT_TRACKING_ID, 0, 10, 0, 0);
#else
input_set_abs_params(input_dev, ABS_X, 0, TOUCH_REPORT_X_MAX, 0, 0);
input_set_abs_params(input_dev, ABS_Y, 0, TOUCH_REPORT_Y_MAX, 0, 0);
input_set_abs_params(input_dev, ABS_PRESSURE, 0, 1, 0, 0);
input_set_abs_params(input_dev, ABS_HAT0X, 0, TOUCH_REPORT_X_MAX, 0, 0);
input_set_abs_params(input_dev, ABS_HAT0Y, 0, TOUCH_REPORT_Y_MAX, 0, 0);
input_set_abs_params(input_dev, ABS_MT_POSITION_X, 0, TOUCH_REPORT_X_MAX, 0, 0);
input_set_abs_params(input_dev, ABS_MT_POSITION_Y, 0, TOUCH_REPORT_Y_MAX, 0, 0);
input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0);
input_set_abs_params(input_dev, ABS_MT_WIDTH_MAJOR, 0, 15, 0, 0);
#endif
if (pdata->init_platform_hw)
pdata->init_platform_hw();
if (!ts->irq) {
dev_dbg(&ts->client->dev, "no IRQ?\n");
return -ENODEV;
}else{
ts->irq = gpio_to_irq(ts->irq);
}
//miaozh modify
err = request_irq(ts->irq, nas_irq, GPIOEdgelFalling,
client->dev.driver->name, ts);
// err = request_irq(ts->irq, nas_irq, 0,
// client->dev.driver->name, ts);
if (err < 0) {
dev_err(&client->dev, "irq %d busy?\n", ts->irq);
goto err_free_mem;
}
if (err < 0)
goto err_free_irq;
#if 0
err = set_irq_type(ts->irq,IRQ_TYPE_LEVEL_LOW);
if (err < 0) {
dev_err(&client->dev, "irq %d busy?\n", ts->irq);
goto err_free_mem;
}
if (err < 0)
goto err_free_irq;
#endif
err = input_register_device(input_dev);
if (err)
goto err_free_irq;
i2c_set_clientdata(client, ts);
nas_check_firmwork(ts);
nas_tp_debug_ctl_entry = create_proc_entry("nas_tp_debug_ctl", 0644, NULL);
if (nas_tp_debug_ctl_entry) {
nas_tp_debug_ctl_entry->read_proc = NULL;
nas_tp_debug_ctl_entry->write_proc = nas_tp_debug_ctl;
}
#ifdef CONFIG_HAS_EARLYSUSPEND
register_early_suspend(&nastech_early_suspend);
#endif
#ifdef CHECK_STATUS
setup_timer(&ts->status_check_timer, nas_status_check_timer, (unsigned long)ts);
ts->status_check_timer.expires = jiffies + msecs_to_jiffies(1000);
add_timer(&ts->status_check_timer);
#endif
return 0;
err_free_irq:
nas_free_irq(ts);
if (pdata->exit_platform_hw)
pdata->exit_platform_hw();
err_free_mem:
input_free_device(input_dev);
kfree(ts);
return err;
}
static int __devexit nas_remove(struct i2c_client *client)
{
struct ts_nas *ts = i2c_get_clientdata(client);
struct nas_platform_data *pdata = client->dev.platform_data;
nas_free_irq(ts);
if (pdata->exit_platform_hw)
pdata->exit_platform_hw();
input_unregister_device(ts->input);
kfree(ts);
if (nas_tp_debug_ctl_entry)
remove_proc_entry("nas_tp_debug_ctl", NULL);
return 0;
}
static struct i2c_device_id nas_idtable[] = {
{ "nas_touch", 0 },
{ }
};
MODULE_DEVICE_TABLE(i2c, nas_idtable);
static struct i2c_driver nas_driver = {
.driver = {
.owner = THIS_MODULE,
.name = "nas_touch"
},
.id_table = nas_idtable,
.probe = nas_probe,
.remove = __devexit_p(nas_remove),
};
static void __init nas_init_async(void *unused, async_cookie_t cookie)
{
printk("--------> %s <-------------\n",__func__);
i2c_add_driver(&nas_driver);
}
static int __init nas_init(void)
{
async_schedule(nas_init_async, NULL);
return 0;
}
static void __exit nas_exit(void)
{
return i2c_del_driver(&nas_driver);
}
module_init(nas_init);
module_exit(nas_exit);
MODULE_LICENSE("GPL");

209
drivers/media/video/mt9t111.c Executable file → Normal file
View File

@@ -1816,8 +1816,10 @@ static struct reginfo sensor_init_data[] =
{0x0014, 0x2046, WORD_LEN, 0 }, // PLL_CONTROL
{0x0022, 0x01E0, WORD_LEN, 0 }, // VDD_DIS_COUNTER//208
{0x001E, 0x0777, WORD_LEN, 0 }, // PAD_SLEW_PAD_CONFIG
//{0x001E, 0x0700, WORD_LEN, 0 }, // PAD_SLEW_PAD_CONFIG
{0x0016, 0x0400, WORD_LEN, 0 }, // CLOCKS_CONTROL
{0x001E, 0x0777, WORD_LEN, 0 }, // PAD_SLEW_PAD_CONFIG
//{0x001E, 0x0700, WORD_LEN, 0 }, // PAD_SLEW_PAD_CONFIG
{0x0018, 0x402D, WORD_LEN, 0 }, // STANDBY_CONTROL_AND_STATUS
{0x0018, 0x402C, WORD_LEN, 0 }, // STANDBY_CONTROL_AND_STATUS
@@ -1863,10 +1865,12 @@ static struct reginfo sensor_init_data[] =
//{0x0990, 0x0408, WORD_LEN, 0 }, // MCU_DATA_0//
//{0x098E, 0x482D, WORD_LEN, 0 }, // MCU_ADDRESS//
//{0x0990, 0x0308, WORD_LEN, 0 }, // MCU_DATA_0//
/*300w capture*/
{0x098E, 0x6C00, WORD_LEN, 0 }, // MCU_ADDRESS
{0x0990, 0x0800, WORD_LEN, 0 }, // MCU_DATA_0
{0x098E, 0x6C02, WORD_LEN, 0 }, // MCU_ADDRESS
{0x0990, 0x0600, WORD_LEN, 0 }, // MCU_DATA_0
{0x098E, 0xEC8E, WORD_LEN, 0 }, // MCU_ADDRESS
{0x0990, 0x0000, WORD_LEN, 0 }, // MCU_DATA_0
{0x098E, 0x6CA0, WORD_LEN, 0 }, // MCU_ADDRESS
@@ -5159,26 +5163,7 @@ static struct reginfo sensor_init_data[] =
static struct reginfo sensor_720p[]=
{
//{SEQUENCE_END, 0x00},
/*{0x098E, 0x843C, WORD_LEN, 0}, // LOGICAL_ADDRESS_ACCESS [CAM_CORE_A_Y_ADDR_START]
{0x843C, 0x01, BYTE_LEN, 0 }, // SEQ_STATE_CFG_5_MAX_FRAME_CNT
{0x8404, 0x01, BYTE_LEN, 0 }, // SEQ_CMD
{0x0016, 0x0447, WORD_LEN, 0}, // CLOCKS_CONTROL
{0xC83A, 0x0106, WORD_LEN, 0}, // CAM_CORE_A_Y_ADDR_START
{0xC83C, 0x0018, WORD_LEN, 0}, // CAM_CORE_A_X_ADDR_START
{0xC83E, 0x06B7, WORD_LEN, 0}, // CAM_CORE_A_Y_ADDR_END
{0xC840, 0x0A45, WORD_LEN, 0}, // CAM_CORE_A_X_ADDR_END
{0xC86C, 0x0518, WORD_LEN, 0}, // CAM_CORE_A_OUTPUT_SIZE_WIDTH
{0xC86E, 0x02D8, WORD_LEN, 0}, // CAM_CORE_A_OUTPUT_SIZE_HEIGHT
{0xC870, 0x0014, WORD_LEN, 0}, // CAM_CORE_A_RX_FIFO_TRIGGER_MARK
{0xC858, 0x0003, WORD_LEN, 0}, // CAM_CORE_A_COARSE_ITMIN
{0xC8B8, 0x0004, WORD_LEN, 0}, // CAM_OUTPUT_0_JPEG_CONTROL
{0xC8AA, 0x0500, WORD_LEN, 0}, // CAM_OUTPUT_0_IMAGE_WIDTH
{0xC8AC, 0x02D0, WORD_LEN, 0}, // CAM_OUTPUT_0_IMAGE_HEIGHT
{0xC8AE, 0x0001, WORD_LEN, 0}, // CAM_OUTPUT_0_OUTPUT_FORMAT
{0x8404, 0x06, BYTE_LEN, 0 }, // SEQ_CMD
{SEQUENCE_WAIT_MS,100, WORD_LEN, 0},*/
{SEQUENCE_PROPERTY,SEQUENCE_CAPTURE},
{SEQUENCE_END, 0x00}
};
@@ -5196,6 +5181,12 @@ static struct reginfo sensor_1080p[]=
static struct reginfo sensor_qxga[] =
{
{SEQUENCE_PROPERTY,SEQUENCE_CAPTURE},
{0x098E, 0x6C00, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_IMAGE_WIDTH]
{0x0990, 0x0800, WORD_LEN, 0}, // MCU_DATA_0
{0x098E, 0x6C02, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_IMAGE_HEIGHT]
{0x0990, 0x0600, WORD_LEN, 0}, // MCU_DATA_0
{SEQUENCE_WAIT_MS,100, WORD_LEN, 0},
{SEQUENCE_END, 0x00}
};
@@ -5203,6 +5194,12 @@ static struct reginfo sensor_qxga[] =
static struct reginfo sensor_uxga[] =
{
{SEQUENCE_PROPERTY,SEQUENCE_CAPTURE},
{0x098E, 0x6C00, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_IMAGE_WIDTH]
{0x0990, 0x0640, WORD_LEN, 0}, // MCU_DATA_0
{0x098E, 0x6C02, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_IMAGE_HEIGHT]
{0x0990, 0x04B0, WORD_LEN, 0}, // MCU_DATA_0
{SEQUENCE_WAIT_MS,100, WORD_LEN, 0},
//{SEQUENCE_PROPERTY,SEQUENCE_CAPTURE},
{SEQUENCE_END, 0x00}
};
/* 1280X1024 SXGA */
@@ -5215,6 +5212,12 @@ static struct reginfo sensor_sxga[] =
static struct reginfo sensor_xga[] =
{
{SEQUENCE_PROPERTY,SEQUENCE_CAPTURE},
{0x098E, 0x6C00, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_IMAGE_WIDTH]
{0x0990, 0x0500, WORD_LEN, 0}, // MCU_DATA_0
{0x098E, 0x6C02, WORD_LEN, 0}, // MCU_ADDRESS [PRI_B_IMAGE_HEIGHT]
{0x0990, 0x03C0, WORD_LEN, 0}, // MCU_DATA_0
{SEQUENCE_WAIT_MS,100, WORD_LEN, 0},
//{SEQUENCE_PROPERTY,SEQUENCE_CAPTURE},
{SEQUENCE_END, 0x00}
};
@@ -5228,25 +5231,14 @@ static struct reginfo sensor_svga[] =
/* 640X480 VGA */
static struct reginfo sensor_vga[] =
{
//720p2vga
{0xC83A, 0x000C, WORD_LEN, 0}, // CAM_CORE_A_Y_ADDR_START
{0xC83C, 0x0018, WORD_LEN, 0}, // CAM_CORE_A_X_ADDR_START
{0xC83E, 0x07B1, WORD_LEN, 0 }, // CAM_CORE_A_Y_ADDR_END
{0xC840, 0x0A45, WORD_LEN, 0}, // CAM_CORE_A_X_ADDR_END
{0xC868, 0x0423, WORD_LEN, 0}, // CAM_CORE_A_FRAME_LENGTH_LINES
{0xC86A, 0x1194, WORD_LEN, 0}, // CAM_CORE_A_LINE_LENGTH_PCK
{0xC86C, 0x0518, WORD_LEN, 0}, // CAM_CORE_A_OUTPUT_SIZE_WIDTH
{0xC86E, 0x03D4, WORD_LEN, 0}, // CAM_CORE_A_OUTPUT_SIZE_HEIGHT
{0xC870, 0x0014, WORD_LEN, 0}, // CAM_CORE_A_RX_FIFO_TRIGGER_MARK
{0xC858, 0x0003, WORD_LEN, 0}, // CAM_CORE_A_COARSE_ITMIN
{0xC8A4, 0x0A28, WORD_LEN, 0}, // CAM_CORE_B_OUTPUT_SIZE_WIDTH
{0xC8A6, 0x07A0, WORD_LEN, 0 }, // CAM_CORE_B_OUTPUT_SIZE_HEIGHT
{0xC8AA, 0x0280, WORD_LEN, 0 }, // CAM_OUTPUT_0_IMAGE_WIDTH
{0xC8AC, 0x01E0, WORD_LEN, 0 }, // CAM_OUTPUT_0_IMAGE_HEIGHT
{0xC8AE, 0x0001, WORD_LEN, 0 }, // CAM_OUTPUT_0_OUTPUT_FORMAT
{0x8404, 0x06, BYTE_LEN, 0 }, // SEQ_CMD
{SEQUENCE_WAIT_MS,100, WORD_LEN, 0},
{SEQUENCE_END, 0x00}
{0x098E, 0x6800, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_IMAGE_WIDTH]
{0x0990, 0x0280, WORD_LEN, 0}, // MCU_DATA_0
{0x098E, 0x6802, WORD_LEN, 0}, // MCU_ADDRESS [PRI_A_IMAGE_HEIGHT]
{0x0990, 0x01E0, WORD_LEN, 0}, // MCU_DATA_0
{0x098E, 0x8400, WORD_LEN, 0}, // MCU_ADDRESS [SEQ_CMD]
{0x0990, 0x0006, WORD_LEN, 0}, // MCU_DATA_0
{SEQUENCE_WAIT_MS,100, WORD_LEN, 0},
{SEQUENCE_END, 0x00}
};
/* 352X288 CIF */
@@ -5258,6 +5250,7 @@ static struct reginfo sensor_cif[] =
/* 320*240 QVGA */
static struct reginfo sensor_qvga[] =
{
//{SEQUENCE_PROPERTY,SEQUENCE_CAPTURE},
{SEQUENCE_END, 0x00}
};
@@ -5266,90 +5259,7 @@ static struct reginfo sensor_qcif[] =
{
{SEQUENCE_END, 0x00}
};
#if 0
/* 160X120 QQVGA*/
static struct reginfo ov2655_qqvga[] =
{
{0x300E, 0x34},
{0x3011, 0x01},
{0x3012, 0x10},
{0x302a, 0x02},
{0x302b, 0xE6},
{0x306f, 0x14},
{0x3362, 0x90},
{0x3070, 0x5d},
{0x3072, 0x5d},
{0x301c, 0x07},
{0x301d, 0x07},
{0x3020, 0x01},
{0x3021, 0x18},
{0x3022, 0x00},
{0x3023, 0x06},
{0x3024, 0x06},
{0x3025, 0x58},
{0x3026, 0x02},
{0x3027, 0x61},
{0x3088, 0x00},
{0x3089, 0xa0},
{0x308a, 0x00},
{0x308b, 0x78},
{0x3316, 0x64},
{0x3317, 0x25},
{0x3318, 0x80},
{0x3319, 0x08},
{0x331a, 0x0a},
{0x331b, 0x07},
{0x331c, 0x80},
{0x331d, 0x38},
{0x3100, 0x00},
{0x3302, 0x11},
{0x0, 0x0},
};
static struct reginfo ov2655_Sharpness_auto[] =
{
{0x3306, 0x00},
};
static struct reginfo ov2655_Sharpness1[] =
{
{0x3306, 0x08},
{0x3371, 0x00},
};
static struct reginfo ov2655_Sharpness2[][3] =
{
//Sharpness 2
{0x3306, 0x08},
{0x3371, 0x01},
};
static struct reginfo ov2655_Sharpness3[] =
{
//default
{0x3306, 0x08},
{0x332d, 0x02},
};
static struct reginfo ov2655_Sharpness4[]=
{
//Sharpness 4
{0x3306, 0x08},
{0x332d, 0x03},
};
static struct reginfo ov2655_Sharpness5[] =
{
//Sharpness 5
{0x3306, 0x08},
{0x332d, 0x04},
};
#endif
static struct reginfo sensor_Preview2Capture[]=
{
//capture2preview
@@ -5364,11 +5274,6 @@ static struct reginfo sensor_Preview2Capture[]=
static struct reginfo sensor_Capture2Preview[]=
{
//snap2preview
/*{0x098E, 0x843C, WORD_LEN, 0}, // LOGICAL_ADDRESS_ACCESS [SEQ_STATE_CFG_5_MAX_FRAME_CNT]
{0x843C, 0x01, BYTE_LEN, 0 }, // SEQ_STATE_CFG_5_MAX_FRAME_CNT
{0x8404, 0x01, BYTE_LEN, 0 }, // SEQ_CMD
{0x0016, 0x0447, WORD_LEN, 0}, // CLOCKS_CONTRO*/
{0x098E, 0xEC05, WORD_LEN, 0},
{0x0990, 0x0005, WORD_LEN, 0},
{0x098E, 0x8400, WORD_LEN, 0},
@@ -6481,6 +6386,7 @@ static int sensor_read(struct i2c_client *client, u16 reg, u16 *val)
{
int err,cnt;
u8 buf[2];
u16 temp_val;
struct i2c_msg msg[2];
buf[0] = reg >> 8;
@@ -6506,7 +6412,10 @@ static int sensor_read(struct i2c_client *client, u16 reg, u16 *val)
err = i2c_transfer(client->adapter, msg, 2);
if (err >= 0) {
*val = buf[0];
temp_val = buf[0];
temp_val = temp_val << 8;
temp_val = temp_val |buf[1];
*val = temp_val;
return 0;
} else {
SENSOR_TR("\n %s read reg(0x%x val:0x%x) failed, try to read again! \n",SENSOR_NAME_STRING(),reg, *val);
@@ -7012,11 +6921,11 @@ static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_format *f)
{
bool ret = false;
if ((f->fmt.pix.width == 1280) && (f->fmt.pix.height == 720)) {
/*if ((f->fmt.pix.width == 1280) && (f->fmt.pix.height == 720)) {
ret = true;
} else if ((f->fmt.pix.width == 1920) && (f->fmt.pix.height == 1080)) {
ret = true;
}
}*/
if (ret == true)
SENSOR_DG("%s %dx%d is video format\n", __FUNCTION__, f->fmt.pix.width, f->fmt.pix.height);
@@ -7025,8 +6934,8 @@ static bool sensor_fmt_videochk(struct v4l2_subdev *sd, struct v4l2_format *f)
static struct reginfo* sensor_fmt_catch(int set_w, int set_h, int *ret_w, int *ret_h)
{
struct reginfo *winseqe_set_addr = NULL;
if (set_w*240 == set_h*320) {
if (set_w*240 == set_h*320) {
if (((set_w >= 320) && (set_h >= 240)) && (sensor_qvga[0].reg!=SEQUENCE_END)) {
winseqe_set_addr = sensor_qvga;
*ret_w = 320;
@@ -7062,7 +6971,7 @@ static struct reginfo* sensor_fmt_catch(int set_w, int set_h, int *ret_w, int *r
*ret_w = 2048;
*ret_h = 1536;
}
if (winseqe_set_addr == NULL) {
if (((set_w <= 176) && (set_h <= 144)) && (sensor_qcif[0].reg!=SEQUENCE_END)) {
winseqe_set_addr = sensor_qcif;
@@ -7074,7 +6983,11 @@ static struct reginfo* sensor_fmt_catch(int set_w, int set_h, int *ret_w, int *r
*ret_h = 288;
}
if (((set_w <= 1280) && (set_h <= 720)) && (sensor_720p[0].reg!=SEQUENCE_END)) {
if (((set_w <= 640) && (set_h <= 480)) && (sensor_vga[0].reg!=SEQUENCE_END)) {
winseqe_set_addr = sensor_vga;
*ret_w = 640;
*ret_h = 480;
} else if (((set_w <= 1280) && (set_h <= 720)) && (sensor_720p[0].reg!=SEQUENCE_END)) {
winseqe_set_addr = sensor_720p;
*ret_w = 1280;
*ret_h = 720;
@@ -7289,22 +7202,23 @@ static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f)
SENSOR_TR("%s set format capability failed\n", SENSOR_NAME_STRING());
goto sensor_s_fmt_end;
}
sensor->info_priv.winseqe_cur_addr = winseqe_set_addr;
if ((winseqe_set_addr[0].reg==SEQUENCE_PROPERTY) && (winseqe_set_addr[0].val==SEQUENCE_CAPTURE)) {
} else {
sensor->info_priv.preview_w = pix->width;
sensor->info_priv.preview_h = pix->height;
}
}
}
if (winseqe_set_addr && (winseqe_set_addr[0].reg==SEQUENCE_PROPERTY) && (winseqe_set_addr[0].val==SEQUENCE_CAPTURE)) {
#if CONFIG_SENSOR_Flash
/*#if CONFIG_SENSOR_Flash
if( (sensor->info_priv.flash == 1)|| (sensor->info_priv.flash == 2)) {
sensor_ioctrl(icd, Sensor_Flash, Flash_On);
//sensor_ioctrl(icd, Sensor_Flash, Flash_Torch);
}
#endif
#endif */
ret |= sensor_write_array(client, sensor_Preview2Capture);
@@ -7316,19 +7230,24 @@ static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f)
SENSOR_TR("-----------%s : %s : %d Preview 2 Capture success!\n", SENSOR_NAME_STRING(),__FUNCTION__,__LINE__);
/*#if CONFIG_SENSOR_Flash
#if CONFIG_SENSOR_Flash
if( (sensor->info_priv.flash == 1)|| (sensor->info_priv.flash == 2)) {
sensor_ioctrl(icd, Sensor_Flash, Flash_On);
//sensor_ioctrl(icd, Sensor_Flash, Flash_Torch);
SENSOR_DG("----flash-------%s sensor->info_priv.flash = %d ,flash on in capture!\n", SENSOR_NAME_STRING(),sensor->info_priv.flash);
//SENSOR_DG("----flash-------%s sensor->info_priv.flash = %d ,flash on in capture!\n", SENSOR_NAME_STRING(),sensor->info_priv.flash);
}
#endif
*/
sensor->info_priv.capture_w = set_w;
sensor->info_priv.capture_h = set_h;
sensor->info_priv.snap2preview = true;
} else if (sensor->info_priv.snap2preview == true) {
if (winseqe_set_addr || ((sensor->info_priv.preview_w == pix->width) && (sensor->info_priv.preview_h == pix->height))) {
#if CONFIG_SENSOR_Flash
if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) {
sensor_ioctrl(icd, Sensor_Flash, Flash_Off);
}
#endif
ret |= sensor_write_array(client, sensor_Capture2Preview);
if (ret != 0) {
SENSOR_TR("%s Capture 2 Preview failed !!\n", SENSOR_NAME_STRING());
@@ -7337,11 +7256,11 @@ static int sensor_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *f)
SENSOR_TR("%s Capture 2 Preview success\n", SENSOR_NAME_STRING());
#if CONFIG_SENSOR_Flash
/* #if CONFIG_SENSOR_Flash
if ((sensor->info_priv.flash == 1) || (sensor->info_priv.flash == 2)) {
sensor_ioctrl(icd, Sensor_Flash, Flash_Off);
}
#endif
#endif */
sensor->info_priv.preview_w = pix->width;
sensor->info_priv.preview_h = pix->height;
sensor->info_priv.snap2preview = false;
@@ -7857,7 +7776,7 @@ static int sensor_s_control(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
SENSOR_TR("\n %s ioctrl id = 0x%x is invalidate \n", SENSOR_NAME_STRING(), ctrl->id);
return -EINVAL;
}
switch (ctrl->id)
{
#if CONFIG_SENSOR_Brightness
@@ -8148,7 +8067,7 @@ static int sensor_s_ext_control(struct soc_camera_device *icd, struct v4l2_ext_c
return -EINVAL;
sensor->info_priv.flash = ext_ctrl->value;
SENSOR_DG("%s flash is %x %d\n",SENSOR_NAME_STRING(), sensor->info_priv.flash,__LINE__);
SENSOR_DG("--------flash------------%s flash is %x %d\n",SENSOR_NAME_STRING(), sensor->info_priv.flash,__LINE__);
break;
}
#endif
@@ -8192,7 +8111,7 @@ static int sensor_s_ext_controls(struct v4l2_subdev *sd, struct v4l2_ext_control
struct soc_camera_device *icd = client->dev.platform_data;
int i, error_cnt=0, error_idx=-1;
SENSOR_DG("\n%s..%s.. \n",__FUNCTION__,SENSOR_NAME_STRING());
SENSOR_DG("\n%s..%s.. ext_ctrl->count = %d\n",__FUNCTION__,SENSOR_NAME_STRING(),ext_ctrl->count);
for (i=0; i<ext_ctrl->count; i++) {
if (sensor_s_ext_control(icd, &ext_ctrl->controls[i]) != 0) {

View File

@@ -446,7 +446,7 @@ static struct reginfo sensor_720p[]=
{0x3c07,0x07},
{0x3803,0xfa},
{0x3806,0x06},
{0x3806,0x06},////
{0x3807,0xa9},
{0x3808,0x05},
{0x3809,0x00},
@@ -459,18 +459,18 @@ static struct reginfo sensor_720p[]=
{0x3813,0x04},
{0x3a02,0x02},
{0x3a03,0xe4},
{0x3a08,0x01},
{0x3a09,0xbc},
{0x3a0a,0x01},
{0x3a0b,0x72},
{0x3a08,0x01},///
{0x3a09,0xbc},////
{0x3a0a,0x01},///
{0x3a0b,0x72},////
{0x3a0e,0x01},
{0x3a0d,0x02},
{0x3a14,0x02},
{0x3a15,0xe4},
{0x3002,0x00},
{0x4713,0x02},
{0x3002,0x00},///
{0x4713,0x02},///
{0x4837,0x16},
{0x3824,0x04},
{0x3824,0x04},///
{0x5001,0x83},
{0x3035,0x21},
{0x3036,0x46},
@@ -705,6 +705,7 @@ static struct reginfo sensor_svga[] =
{0x3814, 0x31},
{0x3815, 0x31},
{0x3803, 0x04},
{0x3806, 0x07},///
{0x3807, 0x9b},
{0x3808, 0x03},
{0x3809, 0x20},
@@ -2655,7 +2656,16 @@ static int sensor_s_fmt(struct v4l2_subdev *sd,struct v4l2_mbus_framefmt *mf)
qctrl = soc_camera_find_qctrl(&sensor_ops, V4L2_CID_DO_WHITE_BALANCE);
sensor_set_whiteBalance(icd, qctrl,sensor->info_priv.whiteBalance);
}
msleep(600);
#if CONFIG_SENSOR_Focus
if (sensor->info_priv.auto_focus == SENSOR_AF_MODE_AUTO) {
sensor_af_idlechk(client);
msleep(200);
} else {
msleep(500);
}
#else
msleep(500);
#endif
sensor->info_priv.video2preview = false;
sensor->info_priv.snap2preview = false;
}

View File

@@ -270,9 +270,9 @@ static int rk29_sensor_io_init(void)
if (camera_power != INVALID_GPIO) {
ret = gpio_request(camera_power, "camera power");
if (ret) {
if (ret) {
if (i == 0) {
goto sensor_io_int_loop_end;
goto sensor_io_int_loop_end;
} else {
if (camera_power != rk29_camera_platform_data.gpio_res[0].gpio_power)
goto sensor_io_int_loop_end;
@@ -555,4 +555,4 @@ static struct platform_device android_pmem_cam_device = {
#endif
#endif //#ifdef CONFIG_VIDEO_RK29
#endif //#ifdef CONFIG_VIDEO_RK29

View File

@@ -30,6 +30,8 @@
#define NEWTON_GPIO_B RK29_PIN4_PB2
#define NEWTON_GPIO_AC_DETEC RK29_PIN4_PA1
#define NEWTON_GPIO_GPS_PWR RK29_PIN6_PB2
#define NEWTON_IDBDATA_SIZE 512
#define NEWTON_GET_IDBDATA 0x600F
#define NEWTON_GET_UID 0x6001
#define NEWTON_AC_DETEC 0x6002
#define NEWTON_GPS_CTRL 0x6003
@@ -121,16 +123,29 @@ int rk29_newton_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
switch(cmd)
{
case NEWTON_GET_UID:
{
IdbSector3 sn;
DBG("%s:NEWTON_GET_UID\n",__FUNCTION__);
memset(&sn,0,sizeof(IdbSector3));
GetSNSectorInfo((char*)&sn);
//newton_print_buf(&sn.UID_Data, sizeof(sn.UID_Data));
case NEWTON_GET_UID:
{
IdbSector3 sn;
DBG("%s:NEWTON_GET_UID\n",__FUNCTION__);
memset(&sn,0,sizeof(IdbSector3));
GetSNSectorInfo((char*)&sn);
//newton_print_buf(&sn.UID_Data, sizeof(sn.UID_Data));
if(copy_to_user(argp, &sn.UID_Data, sizeof(sn.UID_Data))) return -EFAULT;
}
break;
}
break;
case NEWTON_GET_IDBDATA:
{
char data[NEWTON_IDBDATA_SIZE];
memset(data, 0, NEWTON_IDBDATA_SIZE);
GetSNSectorInfo(data);
if(copy_to_user(argp, data, NEWTON_IDBDATA_SIZE))
return -EFAULT;
}
break;
/*
case NEWTON_AC_DETEC:
{

165
drivers/mmc/host/rk29_sdmmc.c Normal file → Executable file
View File

@@ -69,12 +69,12 @@ int debug_level = 7;
#define RK29_SDMMC_INTMASK_USEIO (SDMMC_INT_CMD_DONE | SDMMC_INT_DTO | RK29_SDMMC_ERROR_FLAGS | SDMMC_INT_CD| SDMMC_INT_TXDR | SDMMC_INT_RXDR )
#define RK29_SDMMC_SEND_START_TIMEOUT 5000 //The time interval from the time SEND_CMD to START_CMD_BIT cleared.
#define RK29_SDMMC_SEND_START_TIMEOUT 2000 //The time interval from the time SEND_CMD to START_CMD_BIT cleared.
#define RK29_ERROR_PRINTK_INTERVAL 200 //The time interval between the two printk for the same error.
#define RK29_SDMMC_WAIT_DTO_INTERNVAL 1500 //The time interval from the CMD_DONE_INT to DTO_INT
#define RK29_SDMMC_REMOVAL_DELAY 2000 //The time interval from the CD_INT to detect_timer react.
#define RK29_SDMMC_VERSION "Ver.1.15. The last modify date is 2011-07-16,modifyed by XBW."
#define RK29_SDMMC_VERSION "Ver.1.17 The last modify date is 2011-08-08,modifyed by XBW."
#define RK29_CTRL_SDMMC_ID 0 //mainly used by SDMMC
#define RK29_CTRL_SDIO1_ID 1 //mainly used by sdio-wifi
@@ -83,6 +83,8 @@ int debug_level = 7;
#define RK29_SDMMC_NOTIFY_REMOVE_INSERTION /* use sysfs to notify the removal or insertion of sd-card*/
//#define RK29_SDMMC_LIST_QUEUE /* use list-queue for multi-card*/
#define RK29_SDMMC_DEFAULT_SDIO_FREQ 0 // 1--run in default frequency(50Mhz); 0---run in 25Mhz,
#define RK29_MAX_SDIO_FREQ 25000000 //set max-sdio-frequency 25Mhz at the present time<6D><65>
enum {
EVENT_CMD_COMPLETE = 0,
@@ -263,6 +265,7 @@ ssize_t rk29_sdmmc_progress_store(struct kobject *kobj, struct kobj_attribute *a
const char *buf, size_t count)
{
struct rk29_sdmmc *host = NULL;
static u32 unmounting_times = 0;
if( !strncmp(buf,"version" , strlen("version")))
{
@@ -317,16 +320,23 @@ ssize_t rk29_sdmmc_progress_store(struct kobject *kobj, struct kobj_attribute *a
{
if(!strncmp(buf, "sd-Unmounting", strlen("sd-Unmounting")))
{
printk(".%d.. MMC0 receive the message State_Unmounting from VOLD.====xbw[%s]====\n", __LINE__, host->dma_name);
host->mmc->re_initialized_flags = 0;
mod_timer(&host->detect_timer, jiffies + msecs_to_jiffies(RK29_SDMMC_REMOVAL_DELAY));
if(unmounting_times++%10 == 0)
{
printk(".%d.. MMC0 receive the message Unmounting(waitTimes=%d) from VOLD.====xbw[%s]====\n", \
__LINE__, unmounting_times, host->dma_name);
}
host->mmc->re_initialized_flags = 0;
mod_timer(&host->detect_timer, jiffies + msecs_to_jiffies(RK29_SDMMC_REMOVAL_DELAY));
}
else if( !strncmp(buf, "sd-No-Media", strlen("sd-No-Media")))
{
printk(".%d.. MMC0 receive the message No-Media from VOLD.====xbw[%s]====\n" ,__LINE__, host->dma_name);
printk(".%d.. MMC0 receive the message No-Media from VOLD. waitTimes=%d ====xbw[%s]====\n" ,\
__LINE__,unmounting_times, host->dma_name);
del_timer_sync(&host->detect_timer);
host->mmc->re_initialized_flags = 1;
unmounting_times = 0;
if(test_bit(RK29_SDMMC_CARD_PRESENT, &host->flags))
{
mmc_detect_change(host->mmc, 0);
@@ -334,14 +344,14 @@ ssize_t rk29_sdmmc_progress_store(struct kobject *kobj, struct kobj_attribute *a
}
else if( !strncmp(buf, "sd-Ready", strlen("sd-Ready")))
{
printk(".%d.. MMC0 receive the message State_Ready(ReInitFlag=%d) from VOLD.====xbw[%s]====\n" ,\
__LINE__, host->mmc->re_initialized_flags, host->dma_name);
if(0==host->mmc->re_initialized_flags)
{
host->mmc->re_initialized_flags = 1;
//del_timer_sync(&host->detect_timer);
}
printk(".%d.. MMC0 receive the message Ready(ReInitFlag=%d) from VOLD. waitTimes=%d====xbw[%s]====\n" ,\
__LINE__, host->mmc->re_initialized_flags, unmounting_times, host->dma_name);
unmounting_times = 0;
if(0==host->mmc->re_initialized_flags)
{
host->mmc->re_initialized_flags = 1;
}
}
else if( !strncmp(buf,"sd-reset" , strlen("sd-reset")) )
{
@@ -633,7 +643,7 @@ static u32 rk29_sdmmc_prepare_command(struct mmc_command *cmd)
static int rk29_sdmmc_start_command(struct rk29_sdmmc *host, struct mmc_command *cmd, u32 cmd_flags)
{
int tmo = RK29_SDMMC_SEND_START_TIMEOUT;
int tmo = RK29_SDMMC_SEND_START_TIMEOUT*2;
host->cmd = cmd;
host->old_cmd = cmd->opcode;
@@ -648,13 +658,13 @@ static int rk29_sdmmc_start_command(struct rk29_sdmmc *host, struct mmc_command
/* wait until CIU accepts the command */
while (--tmo && (rk29_sdmmc_read(host->regs, SDMMC_CMD) & SDMMC_CMD_START))
{
cpu_relax();
udelay(2);//cpu_relax();
}
if(!tmo)
{
printk("%s..%d.. wait for CMD_START timeout!!!!!======xbw[%s]======\n",\
__FUNCTION__,__LINE__, host->dma_name);
printk("%s..%d.. CMD_START timeout! CMD%d(arg=0x%x, retries=%d) ======xbw[%s]======\n",\
__FUNCTION__,__LINE__, cmd->opcode, cmd->arg, cmd->retries,host->dma_name);
cmd->error = -ETIMEDOUT;
host->mrq->cmd->error = -ETIMEDOUT;
@@ -718,7 +728,7 @@ static int rk29_sdmmc_wait_unbusy(struct rk29_sdmmc *host)
static void send_stop_cmd(struct rk29_sdmmc *host)
{
mod_timer(&host->request_timer, jiffies + msecs_to_jiffies(RK29_SDMMC_SEND_START_TIMEOUT+2500));
mod_timer(&host->request_timer, jiffies + msecs_to_jiffies(RK29_SDMMC_SEND_START_TIMEOUT+250));
host->stopcmd.opcode = MMC_STOP_TRANSMISSION;
host->stopcmd.flags = MMC_RSP_SPI_R1B | MMC_RSP_R1B | MMC_CMD_AC;;
@@ -927,7 +937,7 @@ static int rk29_sdmmc_prepare_write_data(struct rk29_sdmmc *host, struct mmc_dat
if(0)//(host->intInfo.desLen <= 512 )
{
//ʹ<EFBFBD><EFBFBD>pioģʽ
//use pio-mode
return SDM_SUCCESS;
}
else
@@ -981,7 +991,7 @@ static int rk29_sdmmc_prepare_read_data(struct rk29_sdmmc *host, struct mmc_data
{
if(0) //(host->intInfo.desLen <= 512 )
{
//ʹ<EFBFBD><EFBFBD>pioģʽ
//use pio-mode
return SDM_SUCCESS;
}
else
@@ -1267,7 +1277,7 @@ int rk29_sdmmc_reset_controller(struct rk29_sdmmc *host)
if(host->use_dma)
{
if(0 == host->pdev->id)
if(RK29_CTRL_SDMMC_ID == host->pdev->id)
{
rk29_sdmmc_write(host->regs, SDMMC_INTMASK,RK29_SDMMC_INTMASK_USEDMA);
}
@@ -1278,7 +1288,7 @@ int rk29_sdmmc_reset_controller(struct rk29_sdmmc *host)
}
else
{
if(0 == host->pdev->id)
if(RK29_CTRL_SDMMC_ID == host->pdev->id)
{
rk29_sdmmc_write(host->regs, SDMMC_INTMASK,RK29_SDMMC_INTMASK_USEIO);
}
@@ -1636,7 +1646,7 @@ static void rk29_sdmmc_INT_DTO_timeout(unsigned long host_data)
{
if(0==host->cmd->retries)
{
printk("%s..%d... cmd=%d INT_DTO timeout,cmdr=0x%x, host->errorStep=0x%x, Hoststate=%x===xbw[%s]===\n", \
printk("%s..%d...cmd=%d DTO_timeout,cmdr=0x%x, errorStep=0x%x, Hoststate=%x===xbw[%s]===\n", \
__FUNCTION__, __LINE__,host->cmd->opcode,host->cmdr ,host->errorstep,host->state,host->dma_name);
}
@@ -1658,8 +1668,7 @@ static int rk29_sdmmc_start_request(struct mmc_host *mmc )
spin_lock_irqsave(&host->lock, iflags);
//host->mrq = host->new_mrq;
mrq = host->new_mrq;//mrq = host->mrq;
mrq = host->new_mrq;
cmd = mrq->cmd;
cmd->error = 0;
@@ -1738,8 +1747,8 @@ static int rk29_sdmmc_start_request(struct mmc_host *mmc )
if(SDM_SUCCESS != ret)
{
cmd->error = -ETIMEDOUT;
printk("%s..%d... start_command(CMD%d, arg=%x) fail !!!!!!! ret=%d =========xbw=[%s]===\n",\
__FUNCTION__, __LINE__ , cmd->opcode,cmd->arg,ret, host->dma_name);
printk("%s..%d... start_command(CMD%d, arg=%x, retries=%d) fail! ret=%d =========xbw=[%s]===\n",\
__FUNCTION__, __LINE__ , cmd->opcode,cmd->arg, cmd->retries,ret, host->dma_name);
host->errorstep = 0x11;
del_timer_sync(&host->request_timer);
@@ -1756,9 +1765,12 @@ static int rk29_sdmmc_start_request(struct mmc_host *mmc )
start_request_Err:
rk29_sdmmc_start_error(host);
printk("%s: CMD%d fail to call sdmmc_start_command() err=%d, Errorstep=0x%x ====xbw[%s]===\n\n",\
__FUNCTION__, cmd->opcode,ret,host->errorstep,host->dma_name);
if(0 == cmd->retries)
{
printk("%s: CMD%d(arg=%x) fail to start request. err=%d, Errorstep=0x%x ===xbw[%s]==\n\n",\
__FUNCTION__, cmd->opcode, cmd->arg,ret,host->errorstep,host->dma_name);
}
spin_unlock_irqrestore(&host->lock, iflags);
@@ -1772,23 +1784,27 @@ start_request_Err:
static void rk29_sdmmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
{
unsigned long iflags;
struct rk29_sdmmc *host = mmc_priv(mmc);
spin_lock_irqsave(&host->lock, iflags);
#if 0
//set 1 to close the controller for Debug.
if(RK29_CTRL_SDMMC_ID==host->pdev->id)//if(RK29_CTRL_SDIO_ID==host->pdev->id)
if(RK29_CTRL_SDIO1_ID==host->pdev->id)//if(RK29_CTRL_SDMMC_ID==host->pdev->id)//
{
mrq->cmd->error = -ENOMEDIUM;
printk("%s..%d.. ==== The %s had been closed by myself for the experiment. ====xbw[%s]===\n",\
__FUNCTION__, __LINE__, host->dma_name, host->dma_name);
spin_unlock_irqrestore(&host->lock, iflags);
mmc_request_done(mmc, mrq);
return;
}
#endif
xbwprintk(5, "\n\n%s..%d...Begin a new cmd=%2d. ====@@@@@@@@==== host->flags=0x%lu, state=0x%x ===xbw[%s]====\n", \
__FUNCTION__, __LINE__,mrq->cmd->opcode, host->flags,host->state, host->dma_name);
xbwprintk(3, "\n%s..%d..New cmd=%2d(arg=0x%8x)=== cardPresent=0x%lu, state=0x%x ==xbw[%s]==\n", \
__FUNCTION__, __LINE__,mrq->cmd->opcode, mrq->cmd->arg,host->flags,host->state, host->dma_name);
if(RK29_CTRL_SDMMC_ID == host->pdev->id)
{
@@ -1815,12 +1831,12 @@ static void rk29_sdmmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
host->old_cmd = mrq->cmd->opcode;
host->error_times = 0;
printk("%s: Refuse to run CMD%2d(arg=0x%8x) due to the removal of card. 2==xbw[%s]==\n", \
__FUNCTION__, mrq->cmd->opcode, mrq->cmd->arg, host->dma_name);
__FUNCTION__, mrq->cmd->opcode, mrq->cmd->arg, host->dma_name);
}
}
else
{
if(host->error_times++ %RK29_ERROR_PRINTK_INTERVAL ==0)
if(host->error_times++ % (RK29_ERROR_PRINTK_INTERVAL*2) ==0)
{
printk("%s: Refuse to run CMD%2d(arg=0x%8x) due to the removal of card. 3==xbw[%s]==\n", \
__FUNCTION__, mrq->cmd->opcode, mrq->cmd->arg, host->dma_name);
@@ -1828,6 +1844,7 @@ static void rk29_sdmmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
}
}
spin_unlock_irqrestore(&host->lock, iflags);
mmc_request_done(mmc, mrq);
return;
}
@@ -1846,11 +1863,11 @@ static void rk29_sdmmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
host->error_times = 0;
}
//host->mrq = mrq; //replaced by xbw
host->new_mrq = mrq;
if (host->state == STATE_IDLE)
{
//host->state = STATE_SENDING_CMD; //replaced by xbw
spin_unlock_irqrestore(&host->lock, iflags);
rk29_sdmmc_start_request(mmc);
}
else
@@ -1862,11 +1879,13 @@ static void rk29_sdmmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
list_add_tail(&host->queue_node, &host->queue);
#else
printk("%s..%d...host state Error! old_state=%d, NewCMD%2d,arg=0x%x ====xbw[%s]======\n", \
__FUNCTION__, __LINE__, host->state, mrq->cmd->opcode,mrq->cmd->arg, host->dma_name);
printk("%s..%d..state Error! ,old_state=%d, OldCMD=%d ,NewCMD%2d,arg=0x%x ===xbw[%s]===\n", \
__FUNCTION__, __LINE__, host->state, host->cmd->opcode,mrq->cmd->opcode,mrq->cmd->arg, host->dma_name);
mrq->cmd->error = -ENOMEDIUM;
spin_unlock_irqrestore(&host->lock, iflags);
mmc_request_done(mmc, mrq);
return;
@@ -1900,8 +1919,8 @@ static void rk29_sdmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
}
if (timeout <= 0)
{
printk("%s..%d...Waiting for SDIO controller to be IDLE timeout.==xbw[%s]===\n", \
__FUNCTION__, __LINE__, host->dma_name);
printk("%s..%d...Waiting for SDMMC%d controller to be IDLE timeout.==xbw[%s]===\n", \
__FUNCTION__, __LINE__, host->pdev->id, host->dma_name);
goto out;
}
@@ -2192,7 +2211,9 @@ static int rk29_sdmmc_command_complete(struct rk29_sdmmc *host,
output = rk29_sdmmc_reset_fifo(host);
if (SDM_SUCCESS != output)
{
printk("%s..%d......reset fifo fail!!! =======xbw[%s]=====\n",__FUNCTION__, __LINE__, host->dma_name);
printk("%s..%d......reset fifo fail! CMD%d(arg=0x%x, Retries=%d) =======xbw[%s]=====\n",__FUNCTION__, __LINE__, \
cmd->opcode, cmd->arg, cmd->retries,host->dma_name);
cmd->error = -ETIMEDOUT;
host->mrq->cmd->error = cmd->error;
output = SDM_ERROR;
@@ -2233,7 +2254,8 @@ static int rk29_sdmmc_command_complete(struct rk29_sdmmc *host,
{
output = SDM_FALSE;
host->errorstep = 0x1D;
printk("%s..%d......reset CTRL fail!!! =======xbw[%s]=====\n",__FUNCTION__, __LINE__, host->dma_name);
printk("%s..%d......reset CTRL fail! CMD%d(arg=0x%x, Retries=%d) ===xbw[%s]===\n",\
__FUNCTION__, __LINE__, cmd->opcode, cmd->arg, cmd->retries,host->dma_name);
goto CMD_Errror;
}
@@ -2283,7 +2305,7 @@ CMD_Errror:
if((0==cmd->retries) && (host->error_times++%RK29_ERROR_PRINTK_INTERVAL == 0))
{
printk("%s..%d......command_complete(CMD=%d, arg=%x) error=%d =======xbw[%s]=====\n",\
printk("%s..%d....command_complete(CMD=%d, arg=%x) error=%d =======xbw[%s]=====\n",\
__FUNCTION__, __LINE__, host->cmd->opcode,host->cmd->arg, output, host->dma_name);
}
@@ -2446,12 +2468,18 @@ unlock:
static inline void rk29_sdmmc_cmd_interrupt(struct rk29_sdmmc *host, u32 status)
{
u32 multi, unit;
if(!host->cmd_status)
host->cmd_status = status;
if((MMC_STOP_TRANSMISSION != host->cmd->opcode) && (host->cmdr & SDMMC_CMD_DAT_EXP))
{
mod_timer(&host->DTO_timer, jiffies + msecs_to_jiffies(RK29_SDMMC_WAIT_DTO_INTERNVAL));
unit = 5*1024*1024;
multi = rk29_sdmmc_read(host->regs, SDMMC_BYTCNT)/unit;
multi += ((rk29_sdmmc_read(host->regs, SDMMC_BYTCNT)%unit) ? 1 :0 );
multi = (multi>0) ? multi : 1;
mod_timer(&host->DTO_timer, jiffies + msecs_to_jiffies(RK29_SDMMC_WAIT_DTO_INTERNVAL*multi));
}
smp_wmb();
@@ -2565,8 +2593,8 @@ static irqreturn_t rk29_sdmmc_interrupt(int irq, void *dev_id)
if(pending & SDMMC_INT_HLE)
{
printk("%s: write error due to hardware locked. Please check your hardware. ==xbw[%s]==\n",\
__FUNCTION__, host->dma_name);
printk("%s: Error due to hardware locked. Please check your hardware. INT=0x%x, CMD%d(arg=0x%x, retries=%d)==xbw[%s]==\n",\
__FUNCTION__, pending,host->cmd->opcode, host->cmd->arg, host->cmd->retries, host->dma_name);
rk29_sdmmc_write(host->regs, SDMMC_RINTSTS,SDMMC_INT_HLE);
spin_unlock_irqrestore(&host->lock, iflags);
@@ -2597,8 +2625,8 @@ static irqreturn_t rk29_sdmmc_interrupt(int irq, void *dev_id)
if (pending & SDMMC_INT_FRUN)
{
printk("%s: INT=0x%x Oh!My God,let me see!What happened?Why?Where? ==xbw[%s]==\n", \
__FUNCTION__, pending,host->dma_name);
printk("%s: INT=0x%x Oh!My God,let me see!What happened?Why?Where? CMD%d(arg=0x%x, retries=%d) ==xbw[%s]==\n", \
__FUNCTION__, pending, host->cmd->opcode, host->cmd->arg, host->cmd->retries,host->dma_name);
rk29_sdmmc_write(host->regs, SDMMC_RINTSTS,SDMMC_INT_FRUN);
spin_unlock_irqrestore(&host->lock, iflags);
@@ -2744,7 +2772,17 @@ static int rk29_sdmmc_probe(struct platform_device *pdev)
#endif
host->clk = clk_get(&pdev->dev, "mmc");
clk_set_rate(host->clk,SDHC_FPP_FREQ);
#if RK29_SDMMC_DEFAULT_SDIO_FREQ
clk_set_rate(host->clk,SDHC_FPP_FREQ);
#else
if(RK29_CTRL_SDMMC_ID== host->pdev->id)
clk_set_rate(host->clk,SDHC_FPP_FREQ);
else
clk_set_rate(host->clk,RK29_MAX_SDIO_FREQ);
#endif
clk_enable(host->clk);
clk_enable(clk_get(&pdev->dev, "hclk_mmc"));
@@ -2759,7 +2797,8 @@ static int rk29_sdmmc_probe(struct platform_device *pdev)
mmc->ops = &rk29_sdmmc_ops[pdev->id];
mmc->pm_flags |= MMC_PM_IGNORE_PM_NOTIFY;
mmc->f_min = FOD_FREQ;
#if 0
#if RK29_SDMMC_DEFAULT_SDIO_FREQ
mmc->f_max = SDHC_FPP_FREQ;
#else
if(RK29_CTRL_SDMMC_ID== host->pdev->id)
@@ -2768,7 +2807,7 @@ static int rk29_sdmmc_probe(struct platform_device *pdev)
}
else
{
mmc->f_max = SDHC_FPP_FREQ / 2;
mmc->f_max = RK29_MAX_SDIO_FREQ;//SDHC_FPP_FREQ / 2;
}
#endif
@@ -2831,10 +2870,18 @@ static int rk29_sdmmc_probe(struct platform_device *pdev)
host->errorstep = 0x97;
goto err_freemap;
}
#if 0
#if 0 //deal with the old API of DMA-module
ret = rk29_dma_config(host->dma_info.chn, 4);
#else
ret = rk29_dma_config(host->dma_info.chn, 4, 1);
#else //deal with the new API of DMA-module
if(RK29_CTRL_SDMMC_ID== host->pdev->id)
{
ret = rk29_dma_config(host->dma_info.chn, 4, 16);
}
else
{
ret = rk29_dma_config(host->dma_info.chn, 4, 1);
}
#endif
if(ret < 0)
{

View File

@@ -95,6 +95,7 @@ struct wm831x_power {
struct work_struct batt_work;
struct timer_list timer;
struct wm_batt_priv_data batt_info;
struct wake_lock syslo_wake;
int interval;
};
@@ -699,7 +700,8 @@ static irqreturn_t wm831x_syslo_irq(int irq, void *data)
/* Not much we can actually *do* but tell people for
* posterity, we're probably about to run out of power. */
dev_crit(wm831x->dev, "SYSVDD under voltage\n");
dev_crit(wm831x->dev, "SYSVDD under voltage and wake lock 60s\n");
wake_lock_timeout(&wm831x_power->syslo_wake,60*HZ);//wait for android closing system
return IRQ_HANDLED;
}
@@ -730,9 +732,11 @@ void wm831x_batt_vol_level(struct wm831x_power *wm831x_power, int batt_vol, int
{
int i, ret, status;
static int count = 0;
static int disp_plus = 100;
static int disp_minus = 100;
static int disp_plus = 1000;
static int disp_minus = 1000;
static int disp_curr = 0;
static int disp_num = 50;
*level = wm831x_power->batt_info.level;
ret = wm831x_bat_check_status(wm831x_power->wm831x, &status);
@@ -789,7 +793,7 @@ void wm831x_batt_vol_level(struct wm831x_power *wm831x_power, int batt_vol, int
*level = 100;
// <20><>ʼ״̬
if ((disp_plus == 100) && (disp_minus == 100))
if ((disp_plus == 1000) && (disp_minus == 1000))
{
*level = *level;
disp_plus = 0;
@@ -797,16 +801,23 @@ void wm831x_batt_vol_level(struct wm831x_power *wm831x_power, int batt_vol, int
disp_curr = 0;
}
else
{
if (*level <= (wm831x_power->batt_info.level-3))
{
if (*level <= (wm831x_power->batt_info.level-1))
{
disp_plus = 0;
disp_curr = 0;
if (++disp_minus > 4)
if (++disp_minus > disp_num)
{
*level = wm831x_power->batt_info.level - 3;
*level = wm831x_power->batt_info.level - 1;
disp_minus = 0;
if((*level < 17) || (*level > 85))
disp_num = 10;
else
disp_num = 50;
}
else
{
@@ -818,7 +829,7 @@ void wm831x_batt_vol_level(struct wm831x_power *wm831x_power, int batt_vol, int
disp_plus = 0;
disp_minus = 0;
if (++disp_curr > 4)
if (++disp_curr > disp_num)
{
*level = *level;
disp_curr = 0;
@@ -828,15 +839,19 @@ void wm831x_batt_vol_level(struct wm831x_power *wm831x_power, int batt_vol, int
*level = wm831x_power->batt_info.level;
}
}
else if (*level >= (wm831x_power->batt_info.level+3))
else if (*level >= (wm831x_power->batt_info.level+1))
{
disp_minus = 0;
disp_curr = 0;
if (++disp_plus > 10)
if (++disp_plus > (disp_num<<1))
{
*level = wm831x_power->batt_info.level + 3;
*level = wm831x_power->batt_info.level + 1;
disp_plus = 0;
if((*level < 17) || (*level > 85))
disp_num = 10;
else
disp_num = 50;
}
else
{
@@ -1003,6 +1018,7 @@ static __devinit int wm831x_power_probe(struct platform_device *pdev)
power->batt_info.status = POWER_SUPPLY_STATUS_DISCHARGING;
power->batt_info.health = POWER_SUPPLY_HEALTH_GOOD;
wake_lock_init(&power->syslo_wake, WAKE_LOCK_SUSPEND, "wm831x_syslo_wake");
INIT_WORK(&power->batt_work, wm831x_batt_work);
setup_timer(&power->timer, wm831x_batt_timer_handler, (unsigned long)power);
power->timer.expires = jiffies + msecs_to_jiffies(1000);

View File

@@ -101,7 +101,7 @@ static int pwm_set_rate(struct pwm_platform_data *pdata,int nHz,u32 rate)
return -1;
}
msleep(10);
usleep_range(10*1000, 10*1000);
return (0);

View File

@@ -54,6 +54,7 @@
#define PORT_RK 90
#define UART_USR 0x1F /* UART Status Register */
#define UART_USR_BUSY (1)
#define UART_IER_PTIME 0x80 /* Programmable THRE Interrupt Mode Enable */
#define RX_TIMEOUT (3000*10) //uint ms
@@ -244,8 +245,11 @@ static void serial_lcr_write(struct uart_rk_port *up, unsigned char value)
/* Read the USR to clear any busy interrupts */
serial_in(up, UART_USR);
serial_in(up, UART_RX);
if (--tmout == 0)
if (--tmout == 0){
dev_info(up->port.dev, "set lcr timeout\n");
break;
}
udelay(1);
}
}
@@ -491,7 +495,6 @@ err_out:
/*RX*/
static void serial_rk_dma_rxcb(void *buf, int size, enum rk29_dma_buffresult result) {
// printk("^\n");
}
@@ -931,11 +934,13 @@ static irqreturn_t serial_rk_interrupt(int irq, void *dev_id)
* interrupt meaning an LCR write attempt occured while the
* UART was busy. The interrupt must be cleared by reading
* the UART status register (USR) and the LCR re-written. */
serial_in(up, UART_USR);
serial_out(up, UART_LCR, up->lcr);
if(!(serial_in(up, UART_USR) & UART_USR_BUSY)){
serial_out(up, UART_LCR, up->lcr);
}
handled = 1;
DEBUG_INTR("busy ");
dev_info(up->port.dev, "the serial is busy\n");
}
DEBUG_INTR("end(%d).\n", handled);
@@ -1286,8 +1291,8 @@ serial_rk_set_termios(struct uart_port *port, struct ktermios *termios,
quot = uart_get_divisor(port, baud);
dev_info(up->port.dev, "*****baud:%d*******\n", baud);
dev_info(up->port.dev, "*****quot:%d*******\n", quot);
// dev_info(up->port.dev, "*****baud:%d*******\n", baud);
// dev_info(up->port.dev, "*****quot:%d*******\n", quot);
if (baud < 2400){
fcr = UART_FCR_ENABLE_FIFO | UART_FCR_TRIGGER_1;
@@ -1296,19 +1301,6 @@ serial_rk_set_termios(struct uart_port *port, struct ktermios *termios,
//added by hhb@rock-chips.com
if(up->prk29_uart_dma_t->use_timer == 1){
fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_00 | UART_FCR_T_TRIG_01;
//set time out value according to the baud rate
/*
up->prk29_uart_dma_t->rx_timeout = bits*1000*1024/baud + 1;
if(up->prk29_uart_dma_t->rx_timeout < 10){
up->prk29_uart_dma_t->rx_timeout = 10;
}
if(up->prk29_uart_dma_t->rx_timeout > 25){
up->prk29_uart_dma_t->rx_timeout = 25;
}
printk("%s:time:%d, bits:%d, baud:%d\n", __func__, up->prk29_uart_dma_t->rx_timeout, bits, baud);
up->prk29_uart_dma_t->rx_timeout = 7;
*/
}
else{
fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10 | UART_FCR_T_TRIG_01;
@@ -1326,7 +1318,6 @@ serial_rk_set_termios(struct uart_port *port, struct ktermios *termios,
up->mcr &= ~UART_MCR_AFE;
if (termios->c_cflag & CRTSCTS){
up->mcr |= UART_MCR_AFE;
//dev_info(up->port.dev, "*****UART_MCR_AFE*******\n");
}
@@ -1388,8 +1379,7 @@ serial_rk_set_termios(struct uart_port *port, struct ktermios *termios,
up->lcr = cval; /* Save LCR */
serial_out(up, UART_FCR, fcr); /* set fcr */
// fcr |= UART_FCR_DMA_SELECT;
// serial_out(up, UART_FCR, fcr); /* set fcr */
serial_rk_set_mctrl(&up->port, up->port.mctrl);
spin_unlock_irqrestore(&up->port.lock, flags);

View File

@@ -249,25 +249,25 @@ int ipp_check_param(const struct rk29_ipp_req *req)
/*IPP can support up to 8191*8191 resolution in RGB format,but we limit the image size to 8190*8190 here*/
//check src width and height
if (unlikely((req->src0.w <16) || (req->src0.w > 8190) || (req->src0.h < 16) || (req->src0.h > 8190))) {
ERR("invalid source resolution\n");
printk("ipp invalid source resolution\n");
return -EINVAL;
}
//check dst width and height
if (unlikely((req->dst0.w <16) || (req->dst0.w > 2047) || (req->dst0.h < 16) || (req->dst0.h > 2047))) {
ERR("invalid destination resolution\n");
printk("ipp invalid destination resolution\n");
return -EINVAL;
}
//check src_vir_w
if(unlikely(req->src_vir_w < req->src0.w)){
ERR("invalid src_vir_w\n");
printk("ipp invalid src_vir_w\n");
return -EINVAL;
}
//check dst_vir_w
if(unlikely(req->dst_vir_w < req->dst0.w)){
ERR("invalid dst_vir_w\n");
printk("ipp invalid dst_vir_w\n");
return -EINVAL;
}
@@ -288,7 +288,7 @@ int ipp_check_param(const struct rk29_ipp_req *req)
//check rotate degree
if(req->flag >= IPP_ROT_LIMIT)
{
ERR("rk29_ipp is not surpport rot degree!!!!\n");
printk("rk29_ipp does not surpport rot degree!!!!\n");
return -EINVAL;
}
return 0;
@@ -862,12 +862,18 @@ int ipp_blit(const struct rk29_ipp_req *req)
/*Configure other*/
ipp_write((req->dst_vir_w<<16)|req->src_vir_w, IPP_IMG_VIR);
//store clip mode always set to 1 now
ipp_write(ipp_read(IPP_CONFIG)|(1<<26), IPP_CONFIG);//store clip mode
//store clip mode
if(req->store_clip_mode == 1)
{
ipp_write(ipp_read(IPP_CONFIG)|STORE_CLIP_MODE, IPP_CONFIG);
}
else
{
ipp_write(ipp_read(IPP_CONFIG)&(~STORE_CLIP_MODE), IPP_CONFIG);
}
/* Start the operation */
ipp_write(8, IPP_INT);//
ipp_write(8, IPP_INT);//
dsb();
ipp_write(1, IPP_PROCESS_ST);

View File

@@ -42,6 +42,8 @@ struct aw9364_backlight_data {
int suspend_flag;
int shutdown_flag;
#endif
spinlock_t bl_lock;
};
#ifdef CONFIG_HAS_EARLYSUSPEND
@@ -49,54 +51,40 @@ static struct backlight_device *g_aw9364_bl;
static struct aw9364_backlight_data *g_aw9364_data;
#endif
int rk29_backlight_ctrl(int open)
{
if(open)
gpio_direction_output(g_aw9364_data->pin_en, GPIO_HIGH);
else
gpio_direction_output(g_aw9364_data->pin_en, GPIO_LOW);
mdelay(3);
return 0;
}
static int aw9364_backlight_set(struct backlight_device *bl, int brightness)
{
struct aw9364_backlight_data *data = bl_get_data(bl);
int i,num_clk, num_clk_to, num_clk_from;
if(data && data->pin_en)
gpio_request(data->pin_en, NULL);
else
return -1;
unsigned long flags;
brightness = brightness & 0xff; //0-256
num_clk_from = 16 -(data->current_brightness>>4);
num_clk_to = 16 -(brightness>>4);
num_clk = (16 + num_clk_to - num_clk_from)%16;
num_clk = (16 + num_clk_to - num_clk_from)%16;
if(brightness < 16)
{
gpio_direction_output(data->pin_en, GPIO_LOW);
mdelay(3);
}
else {
for(i=0; i<num_clk; i++)
spin_lock_irqsave(&data->bl_lock, flags);
for(i=0; i<num_clk; i++) //the wave should not be intterupted
{
gpio_direction_output(data->pin_en, GPIO_LOW);
udelay(5);
gpio_direction_output(data->pin_en, GPIO_HIGH);
gpio_set_value(data->pin_en, GPIO_LOW);
gpio_set_value(data->pin_en, GPIO_HIGH);
if(i==0)
udelay(50);
else
udelay(2);
udelay(30);
}
spin_unlock_irqrestore(&data->bl_lock, flags);
}
DBG("%s:current_bl=%d,bl=%d,num_clk_to=%d,num_clk_from=%d,num_clk=%d\n",__FUNCTION__,
data->current_brightness,brightness,num_clk_to,num_clk_from,num_clk);
if(num_clk)
if((num_clk) || (brightness < 16))
data->current_brightness = brightness;
return 0;
@@ -163,11 +151,25 @@ static void aw9364_bl_resume(struct early_suspend *h)
struct aw9364_backlight_data *aw9364_data;
aw9364_data = container_of(h, struct aw9364_backlight_data, early_suspend);
aw9364_data->suspend_flag = 0;
schedule_delayed_work(&aw9364_data->work, msecs_to_jiffies(0));
schedule_delayed_work(&aw9364_data->work, msecs_to_jiffies(100));
}
#endif
int rk29_backlight_ctrl(int open)
{
if(open)
g_aw9364_data->suspend_flag = 0;
else
g_aw9364_data->suspend_flag = 1;
backlight_update_status(g_aw9364_bl);
return 0;
}
static int aw9364_backlight_probe(struct platform_device *pdev)
{
struct aw9364_backlight_data *data;
@@ -193,6 +195,13 @@ static int aw9364_backlight_probe(struct platform_device *pdev)
bl->props.brightness = BL_INIT_VALUE;
bl->props.max_brightness= BL_SET;
if(data && data->pin_en)
gpio_request(data->pin_en, NULL);
else
return -1;
spin_lock_init(&data->bl_lock);
platform_set_drvdata(pdev, bl);
#ifdef CONFIG_HAS_EARLYSUSPEND
@@ -205,6 +214,9 @@ static int aw9364_backlight_probe(struct platform_device *pdev)
g_aw9364_data = data;
#endif
gpio_direction_output(data->pin_en, GPIO_LOW);
mdelay(3);
backlight_update_status(bl);
schedule_delayed_work(&data->work, msecs_to_jiffies(100));

View File

@@ -19,6 +19,8 @@ config LCD_HSD100PXN
bool "RGB Hannstar HSD100PXN(1024X768)"
config LCD_HSD07PFW1
bool "RGB Hannstar HSD07PFW1(1024X600)"
config LCD_BYD8688FTGF
bool "RGB BYD 1024X600 8688FTGF"
config LCD_B101AW06
bool "RGB Hannstar B101AW06(1024X600)"
config LCD_RGB_TFT480800_25_E

View File

@@ -4,7 +4,7 @@ obj-$(CONFIG_LCD_NULL) += lcd_null.o
obj-$(CONFIG_LCD_TD043MGEA1) += lcd_td043mgea1.o
obj-$(CONFIG_LCD_HSD070IDW1) += lcd_hsd800x480.o
obj-$(CONFIG_LCD_HL070VM4AU) += lcd_hl070vm4.o
obj-$(CONFIG_LCD_BYD8688FTGF) += lcd_byd1024x600.o
obj-$(CONFIG_LCD_TJ048NC01CA) += lcd_tj048nc01ca.o
obj-$(CONFIG_LCD_A060SE02) += lcd_a060se02.o

View File

@@ -0,0 +1,111 @@
/*
* 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
//tcl miaozh modify
//#define OUT_CLK 50000000
#define OUT_CLK 47000000
//#define OUT_CLK 42000000
#define LCDC_ACLK 150000000 //29 lcdc axi DMA Ƶ<><C6B5>
/* Timing */
#define H_PW 10
#define H_BP 160
#define H_VD 1024
#define H_FP 119
#define V_PW 3
#define V_BP 23
#define V_VD 600
#define V_FP 9
/* Other */
#define DCLK_POL 0
#define SWAP_RB 0
//tcl miaozh modify
//#define LCD_WIDTH 1024 //need modify
//#define LCD_HEIGHT 600
#define LCD_WIDTH 153 //need modify
#define LCD_HEIGHT 90
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;
}

View File

@@ -317,7 +317,7 @@ void WriteParameter(char DH)
void init_nt35510(void)
{
WriteCommand(0X1100);
msleep(120);
msleep(10);
WriteCommand(0X1300);

View File

@@ -158,6 +158,7 @@ void hdmi_unregister(struct hdmi *hdmi)
if(!hdmi)
return;
id = hdmi->id;
del_timer(&hdmi->timer);
flush_scheduled_work();
hdmi_remove_attrs(hdmi);
device_unregister(hdmi->dev);

View File

@@ -49,7 +49,7 @@
#undef AUTO_DETECT_DISABLE
#endif
#define DEBUG
//#define DEBUG
#ifdef DEBUG
#define SOCDBG(fmt, arg...) printk(KERN_ERR "%s: %s() " fmt, SOC_CS42L52_NAME, __FUNCTION__, ##arg)
#else
@@ -770,13 +770,15 @@ static int soc_cs42l52_add_widgets(struct snd_soc_codec *soc_codec)
snd_soc_dapm_new_widgets(soc_codec);
return 0;
}
#if 0
#define SOC_CS42L52_RATES ( SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 | \
SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | \
SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \
SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | \
SNDRV_PCM_RATE_96000 )
#else
#define SOC_CS42L52_RATES SNDRV_PCM_RATE_44100
#endif
#define SOC_CS42L52_FORMATS ( SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE | \
SNDRV_PCM_FMTBIT_S18_3LE | SNDRV_PCM_FMTBIT_U18_3LE | \
SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_U20_3LE | \

File diff suppressed because it is too large Load Diff

View File

@@ -14,6 +14,8 @@
#ifndef _WM8994_H
#define _WM8994_H
#define WM8994_NUM_REG 0x44
/* WM8994 register space */
#define WM8994_RESET 0x00
#define wm8994_SYSCLK_3072M 0

View File

@@ -75,6 +75,94 @@ config SND_RK29_SOC_WM8994
Say Y if you want to add support for SoC audio on rockchip
with the WM8994.
if SND_SOC_WM8994
choice
prompt "Chose earpiece type"
config SND_INSIDE_EARPIECE
tristate "Inside earpiece"
config SND_OUTSIDE_EARPIECE
tristate "Outside earpiece"
config SND_NO_EARPIECE
tristate "No earpiece"
endchoice
choice
prompt "Chose BB input signal type"
config SND_BB_NORMAL_INPUT
tristate "BB normal singnal input"
config SND_BB_DIFFERENTIAL_INPUT
tristate "BB differential singnal input"
endchoice
config WM8994_SPEAKER_INCALL_VOL
default 15
int "Setting the wm8994 speaker incall vol"
help
-21dB to 12dB
config WM8994_SPEAKER_INCALL_MIC_VOL
default 15
int "Setting the wm8994 speaker incall mic vol"
help
-22dB to 30dB
config WM8994_SPEAKER_NORMAL_VOL
default 15
int "Setting the wm8994 speaker normal vol"
help
-57dB to 18dB
if SND_INSIDE_EARPIECE||SND_OUTSIDE_EARPIECE
config WM8994_EARPIECE_INCALL_VOL
default 0
int "Setting the wm8994 earpiece incall vol(normal)"
help
-27dB to 30dB
endif
config WM8994_HEADSET_INCALL_VOL
default 6
int "Setting the wm8994 headset incall vol"
help
-12dB to 6dB
config WM8994_HEADSET_INCALL_MIC_VOL
default 30
int "Setting the wm8994 headset incall mic vol"
help
-22dB to 30dB
config WM8994_HEADSET_NORMAL_VOL
default 15
int "Setting the wm8994 headset normal vol"
help
-57dB to 6dB
config WM8994_BT_INCALL_VOL
default 30
int "Setting the wm8994 BT incall vol"
help
0dB or 30dB
config WM8994_BT_INCALL_MIC_VOL
default -20
int "Setting the wm8994 BT incall mic vol"
help
-57dB to 6dB
config WM8994_RECORDER_VOL
default 40
int "Setting the wm8994 recorder vol"
help
-16dB to 60dB
endif
config SND_RK29_SOC_CS42L52
tristate "SoC I2S Audio support for rockchip - CS42L52"
depends on SND_RK29_SOC && I2C_RK29

View File

@@ -25,7 +25,7 @@
#include "rk29_pcm.h"
#include "rk29_i2s.h"
#if 1
#if 0
#define DBG(x...) printk(KERN_INFO x)
#else
#define DBG(x...)