--- /dev/null
+#
+# Automatically generated make config: don't edit
+# Linux/arm 3.0.8 Kernel Configuration
+#
+CONFIG_ARM=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_HAVE_SCHED_CLOCK=y
+CONFIG_GENERIC_GPIO=y
+# CONFIG_ARCH_USES_GETTIMEOFFSET is not set
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_KTIME_SCALAR=y
+CONFIG_HAVE_PROC_CPU=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_HAVE_LATENCYTOP_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+CONFIG_ARCH_HAS_CPUFREQ=y
+CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_ZONE_DMA=y
+CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_VECTORS_BASE=0xffff0000
+# CONFIG_ARM_PATCH_PHYS_VIRT is not set
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+CONFIG_HAVE_IRQ_WORK=y
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_CROSS_COMPILE=""
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_HAVE_KERNEL_GZIP=y
+CONFIG_HAVE_KERNEL_LZMA=y
+CONFIG_HAVE_KERNEL_LZO=y
+# CONFIG_KERNEL_GZIP is not set
+# CONFIG_KERNEL_LZMA is not set
+CONFIG_KERNEL_LZO=y
+CONFIG_DEFAULT_HOSTNAME="(none)"
+# CONFIG_SWAP is not set
+# CONFIG_SYSVIPC is not set
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_FHANDLE is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_AUDIT is not set
+CONFIG_HAVE_GENERIC_HARDIRQS=y
+
+#
+# IRQ subsystem
+#
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_HAVE_SPARSE_IRQ=y
+CONFIG_GENERIC_IRQ_SHOW=y
+# CONFIG_SPARSE_IRQ is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_TREE_PREEMPT_RCU=y
+# CONFIG_TINY_RCU is not set
+# CONFIG_TINY_PREEMPT_RCU is not set
+CONFIG_PREEMPT_RCU=y
+# CONFIG_RCU_TRACE is not set
+CONFIG_RCU_FANOUT=32
+# CONFIG_RCU_FANOUT_EXACT is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_RCU_BOOST is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=19
+CONFIG_CGROUPS=y
+CONFIG_CGROUP_DEBUG=y
+CONFIG_CGROUP_FREEZER=y
+# CONFIG_CGROUP_DEVICE is not set
+# CONFIG_CPUSETS is not set
+CONFIG_CGROUP_CPUACCT=y
+CONFIG_RESOURCE_COUNTERS=y
+# CONFIG_CGROUP_MEM_RES_CTLR is not set
+CONFIG_CGROUP_SCHED=y
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_RT_GROUP_SCHED=y
+# CONFIG_BLK_CGROUP is not set
+# CONFIG_NAMESPACES is not set
+# CONFIG_SCHED_AUTOGROUP is not set
+# CONFIG_SYSFS_DEPRECATED is not set
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_RD_GZIP=y
+# CONFIG_RD_BZIP2 is not set
+# CONFIG_RD_LZMA is not set
+# CONFIG_RD_XZ is not set
+# CONFIG_RD_LZO is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_PANIC_TIMEOUT=5
+CONFIG_EXPERT=y
+CONFIG_UID16=y
+# CONFIG_SYSCTL_SYSCALL is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+# CONFIG_ELF_CORE is not set
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_ASHMEM=y
+CONFIG_AIO=y
+CONFIG_EMBEDDED=y
+CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_PERF_USE_VMALLOC=y
+
+#
+# Kernel Performance Events And Counters
+#
+# CONFIG_PERF_EVENTS is not set
+# CONFIG_PERF_COUNTERS is not set
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_COMPAT_BRK=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
+CONFIG_HAVE_CLK=y
+CONFIG_HAVE_DMA_API_DEBUG=y
+
+#
+# GCOV-based kernel profiling
+#
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_BLOCK=y
+# CONFIG_LBDAF is not set
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+# CONFIG_IOSCHED_DEADLINE is not set
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_CFQ=y
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="cfq"
+# CONFIG_INLINE_SPIN_TRYLOCK is not set
+# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
+# CONFIG_INLINE_SPIN_LOCK is not set
+# CONFIG_INLINE_SPIN_LOCK_BH is not set
+# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
+# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
+# CONFIG_INLINE_SPIN_UNLOCK is not set
+# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
+# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
+# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
+# CONFIG_INLINE_READ_TRYLOCK is not set
+# CONFIG_INLINE_READ_LOCK is not set
+# CONFIG_INLINE_READ_LOCK_BH is not set
+# CONFIG_INLINE_READ_LOCK_IRQ is not set
+# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
+# CONFIG_INLINE_READ_UNLOCK is not set
+# CONFIG_INLINE_READ_UNLOCK_BH is not set
+# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
+# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
+# CONFIG_INLINE_WRITE_TRYLOCK is not set
+# CONFIG_INLINE_WRITE_LOCK is not set
+# CONFIG_INLINE_WRITE_LOCK_BH is not set
+# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
+# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
+# CONFIG_INLINE_WRITE_UNLOCK is not set
+# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
+# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
+# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
+# CONFIG_MUTEX_SPIN_ON_OWNER is not set
+CONFIG_FREEZER=y
+
+#
+# System Type
+#
+CONFIG_MMU=y
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_VERSATILE is not set
+# CONFIG_ARCH_VEXPRESS is not set
+# CONFIG_ARCH_AT91 is not set
+# CONFIG_ARCH_BCMRING is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_CNS3XXX is not set
+# CONFIG_ARCH_GEMINI is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_MXS is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_H720X is not set
+# CONFIG_ARCH_IOP13XX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IXP23XX is not set
+# CONFIG_ARCH_IXP2000 is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_DOVE is not set
+# CONFIG_ARCH_KIRKWOOD is not set
+# CONFIG_ARCH_LOKI is not set
+# CONFIG_ARCH_LPC32XX is not set
+# CONFIG_ARCH_MV78XX0 is not set
+# CONFIG_ARCH_ORION5X is not set
+# CONFIG_ARCH_MMP is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_W90X900 is not set
+# CONFIG_ARCH_NUC93X is not set
+# CONFIG_ARCH_TEGRA is not set
+# CONFIG_ARCH_PNX4008 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_MSM is not set
+# CONFIG_ARCH_SHMOBILE is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_S3C64XX is not set
+# CONFIG_ARCH_S5P64X0 is not set
+# CONFIG_ARCH_S5PC100 is not set
+# CONFIG_ARCH_S5PV210 is not set
+# CONFIG_ARCH_EXYNOS4 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_TCC_926 is not set
+# CONFIG_ARCH_U300 is not set
+# CONFIG_ARCH_U8500 is not set
+# CONFIG_ARCH_NOMADIK is not set
+# CONFIG_ARCH_DAVINCI is not set
+# CONFIG_ARCH_OMAP is not set
+CONFIG_ARCH_RK29=y
+# CONFIG_PLAT_SPEAR is not set
+# CONFIG_ARCH_VT8500 is not set
+# CONFIG_GPIO_PCA953X is not set
+# CONFIG_KEYBOARD_GPIO_POLLED is not set
+# CONFIG_MACH_RK29SDK is not set
+# CONFIG_MACH_RK29SDK_DDR3 is not set
+# CONFIG_MACH_RK29WINACCORD is not set
+CONFIG_MACH_RK29_K97=y
+# CONFIG_MACH_RK29FIH is not set
+# CONFIG_MACH_RK29_MALATA is not set
+# CONFIG_MACH_RK29_PHONESDK is not set
+# CONFIG_MACH_RK29_A22 is not set
+# CONFIG_MACH_RK29_PHONEPADSDK is not set
+# CONFIG_MACH_RK29_newton is not set
+# CONFIG_MACH_RK29_P91 is not set
+# CONFIG_DDR_TYPE_DDRII is not set
+# CONFIG_DDR_TYPE_LPDDR is not set
+# CONFIG_DDR_TYPE_DDR3_800D is not set
+# CONFIG_DDR_TYPE_DDR3_800E is not set
+# CONFIG_DDR_TYPE_DDR3_1066E is not set
+# CONFIG_DDR_TYPE_DDR3_1066F is not set
+# CONFIG_DDR_TYPE_DDR3_1066G is not set
+# CONFIG_DDR_TYPE_DDR3_1333F is not set
+# CONFIG_DDR_TYPE_DDR3_1333G is not set
+# CONFIG_DDR_TYPE_DDR3_1333H is not set
+# CONFIG_DDR_TYPE_DDR3_1333J is not set
+# CONFIG_DDR_TYPE_DDR3_1600G is not set
+# CONFIG_DDR_TYPE_DDR3_1600H is not set
+# CONFIG_DDR_TYPE_DDR3_1600J is not set
+# CONFIG_DDR_TYPE_DDR3_1600K is not set
+# CONFIG_DDR_TYPE_DDR3_1866J is not set
+# CONFIG_DDR_TYPE_DDR3_1866K is not set
+# CONFIG_DDR_TYPE_DDR3_1866L is not set
+# CONFIG_DDR_TYPE_DDR3_1866M is not set
+# CONFIG_DDR_TYPE_DDR3_2133K is not set
+# CONFIG_DDR_TYPE_DDR3_2133L is not set
+# CONFIG_DDR_TYPE_DDR3_2133M is not set
+# 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_FREQ=y
+# CONFIG_DDR_RECONFIG is not set
+CONFIG_WIFI_CONTROL_FUNC=y
+
+#
+# RK29 VPU (Video Processing Unit) support
+#
+CONFIG_RK29_VPU=y
+# CONFIG_RK29_VPU_DEBUG is not set
+CONFIG_RK29_JTAG=y
+CONFIG_RK29_LAST_LOG=y
+
+#
+# support for RK29 power manage
+#
+# CONFIG_RK29_WORKING_POWER_MANAGEMENT is not set
+# CONFIG_RK29_CLK_SWITCH_TO_32K is not set
+# CONFIG_RK29_GPIO_SUSPEND is not set
+# CONFIG_RK29_NEON_POWERDOMAIN_SET is not set
+CONFIG_RK29_PWM_INSRAM=y
+
+#
+# System MMU
+#
+
+#
+# Processor Type
+#
+CONFIG_CPU_V7=y
+CONFIG_CPU_32v6K=y
+CONFIG_CPU_32v7=y
+CONFIG_CPU_ABRT_EV7=y
+CONFIG_CPU_PABRT_V7=y
+CONFIG_CPU_CACHE_V7=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_TLB_V7=y
+CONFIG_CPU_HAS_ASID=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMB=y
+CONFIG_ARM_THUMBEE=y
+# CONFIG_SWP_EMULATE is not set
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_BPREDICT_DISABLE is not set
+CONFIG_ARM_L1_CACHE_SHIFT_6=y
+CONFIG_ARM_L1_CACHE_SHIFT=6
+CONFIG_ARM_DMA_MEM_BUFFERABLE=y
+CONFIG_CPU_HAS_PMU=y
+# CONFIG_ARM_ERRATA_430973 is not set
+# CONFIG_ARM_ERRATA_458693 is not set
+# CONFIG_ARM_ERRATA_460075 is not set
+# CONFIG_ARM_ERRATA_743622 is not set
+# CONFIG_ARM_ERRATA_754322 is not set
+CONFIG_ARM_GIC=y
+CONFIG_PL330=y
+# CONFIG_FIQ_DEBUGGER is not set
+
+#
+# Bus support
+#
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+# CONFIG_PREEMPT_NONE is not set
+# CONFIG_PREEMPT_VOLUNTARY is not set
+CONFIG_PREEMPT=y
+CONFIG_HZ=100
+# CONFIG_THUMB2_KERNEL is not set
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
+CONFIG_HAVE_ARCH_PFN_VALID=y
+CONFIG_HIGHMEM=y
+# CONFIG_HIGHPTE is not set
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_HAVE_MEMBLOCK=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_COMPACTION is not set
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+# CONFIG_KSM is not set
+CONFIG_DEFAULT_MMAP_MIN_ADDR=32768
+CONFIG_NEED_PER_CPU_KM=y
+# CONFIG_CLEANCACHE is not set
+CONFIG_FORCE_MAX_ZONEORDER=11
+CONFIG_ALIGNMENT_TRAP=y
+# CONFIG_UACCESS_WITH_MEMCPY is not set
+# CONFIG_SECCOMP is not set
+# CONFIG_CC_STACKPROTECTOR is not set
+# CONFIG_DEPRECATED_PARAM_STRUCT is not set
+# CONFIG_ARM_FLUSH_CONSOLE_ON_RESTART is not set
+
+#
+# Boot options
+#
+# CONFIG_USE_OF is not set
+CONFIG_ZBOOT_ROM_TEXT=0
+CONFIG_ZBOOT_ROM_BSS=0
+CONFIG_CMDLINE=""
+# CONFIG_XIP_KERNEL is not set
+CONFIG_KEXEC=y
+CONFIG_ATAGS_PROC=y
+# CONFIG_CRASH_DUMP is not set
+# CONFIG_AUTO_ZRELADDR is not set
+
+#
+# CPU Power Management
+#
+
+#
+# CPU Frequency scaling
+#
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_TABLE=y
+CONFIG_CPU_FREQ_STAT=y
+CONFIG_CPU_FREQ_STAT_DETAILS=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_INTERACTIVE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=y
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+# CONFIG_CPU_FREQ_GOV_INTERACTIVE is not set
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
+# CONFIG_CPU_IDLE is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_VFP=y
+CONFIG_VFPv3=y
+CONFIG_NEON=y
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_HAVE_AOUT=y
+# CONFIG_BINFMT_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+
+#
+# Power management options
+#
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+CONFIG_HAS_WAKELOCK=y
+CONFIG_HAS_EARLYSUSPEND=y
+CONFIG_WAKELOCK=y
+CONFIG_WAKELOCK_STAT=y
+CONFIG_USER_WAKELOCK=y
+CONFIG_EARLYSUSPEND=y
+# CONFIG_NO_USER_SPACE_SCREEN_ACCESS_CONTROL is not set
+# CONFIG_CONSOLE_EARLYSUSPEND is not set
+CONFIG_FB_EARLYSUSPEND=y
+CONFIG_PM_SLEEP=y
+# CONFIG_PM_RUNTIME is not set
+CONFIG_PM=y
+# CONFIG_PM_DEBUG is not set
+# CONFIG_APM_EMULATION is not set
+# CONFIG_SUSPEND_TIME is not set
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+# CONFIG_XFRM_USER is not set
+# 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_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_IP_PNP_RARP=y
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE_DEMUX is not set
+# 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_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+CONFIG_INET_TUNNEL=y
+CONFIG_INET_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+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_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_SIT_6RD is not set
+CONFIG_IPV6_NDISC_NODETYPE=y
+# CONFIG_IPV6_TUNNEL is not set
+# CONFIG_IPV6_MULTIPLE_TABLES is not set
+# CONFIG_IPV6_MROUTE is not set
+CONFIG_ANDROID_PARANOID_NETWORK=y
+CONFIG_NET_ACTIVITY_STATS=y
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETWORK_PHY_TIMESTAMPING 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_CONNTRACK_MARK=y
+CONFIG_NF_CONNTRACK_EVENTS=y
+# CONFIG_NF_CONNTRACK_TIMESTAMP is not set
+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_BROADCAST=y
+CONFIG_NF_CONNTRACK_NETBIOS_NS=y
+# CONFIG_NF_CONNTRACK_SNMP is not set
+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
+
+#
+# Xtables combined modules
+#
+CONFIG_NETFILTER_XT_MARK=y
+CONFIG_NETFILTER_XT_CONNMARK=y
+
+#
+# Xtables targets
+#
+CONFIG_NETFILTER_XT_TARGET_CLASSIFY=y
+CONFIG_NETFILTER_XT_TARGET_CONNMARK=y
+# CONFIG_NETFILTER_XT_TARGET_IDLETIMER 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_TEE is not set
+# CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set
+
+#
+# Xtables matches
+#
+# CONFIG_NETFILTER_XT_MATCH_ADDRTYPE 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_CPU is not set
+# CONFIG_NETFILTER_XT_MATCH_DCCP is not set
+# CONFIG_NETFILTER_XT_MATCH_DEVGROUP 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 is not set
+# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set
+# CONFIG_NETFILTER_XT_MATCH_LIMIT is not set
+# CONFIG_NETFILTER_XT_MATCH_MAC is not set
+# CONFIG_NETFILTER_XT_MATCH_MARK is not set
+# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set
+# CONFIG_NETFILTER_XT_MATCH_OSF is not set
+# CONFIG_NETFILTER_XT_MATCH_OWNER is not set
+# CONFIG_NETFILTER_XT_MATCH_POLICY is not set
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=y
+CONFIG_NETFILTER_XT_MATCH_QUOTA=y
+# CONFIG_NETFILTER_XT_MATCH_QUOTA2 is not set
+# 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_IP_SET 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_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_REJECT_SKERR is not set
+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_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_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_DEFRAG_IPV6 is not set
+# 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
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_L2TP is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_PHONET is not set
+# CONFIG_IEEE802154 is not set
+# CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
+# CONFIG_BATMAN_ADV is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+CONFIG_BT=y
+CONFIG_BT_L2CAP=y
+CONFIG_BT_SCO=y
+CONFIG_BT_RFCOMM=y
+CONFIG_BT_RFCOMM_TTY=y
+# CONFIG_BT_BNEP is not set
+# CONFIG_BT_HIDP is not set
+
+#
+# Bluetooth device drivers
+#
+# CONFIG_BT_HCIBTUSB is not set
+# CONFIG_BT_HCIBTSDIO is not set
+CONFIG_BT_HCIUART=y
+CONFIG_BT_HCIUART_H4=y
+# CONFIG_BT_HCIUART_BCSP is not set
+# CONFIG_BT_HCIUART_ATH3K is not set
+# CONFIG_BT_HCIUART_LL is not set
+# CONFIG_BT_HCIBCM203X is not set
+# CONFIG_BT_HCIBPA10X is not set
+# CONFIG_BT_HCIBFUSB is not set
+# CONFIG_BT_HCIVHCI is not set
+# CONFIG_BT_MRVL is not set
+CONFIG_BT_HCIBCM4325=y
+CONFIG_IDBLOCK=y
+# CONFIG_WIFI_MAC is not set
+# CONFIG_AF_RXRPC is not set
+CONFIG_WIRELESS=y
+CONFIG_WIRELESS_EXT=y
+CONFIG_WEXT_CORE=y
+CONFIG_WEXT_PROC=y
+CONFIG_WEXT_PRIV=y
+# CONFIG_CFG80211 is not set
+CONFIG_WIRELESS_EXT_SYSFS=y
+# CONFIG_LIB80211 is not set
+
+#
+# CFG80211 needs to be enabled for MAC80211
+#
+# CONFIG_WIMAX is not set
+CONFIG_RFKILL=y
+# CONFIG_RFKILL_PM is not set
+# CONFIG_RFKILL_INPUT is not set
+# CONFIG_RFKILL_REGULATOR is not set
+# CONFIG_RFKILL_GPIO is not set
+# CONFIG_NET_9P is not set
+# CONFIG_CAIF is not set
+# CONFIG_CEPH_LIB is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH=""
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=y
+# CONFIG_FIRMWARE_IN_KERNEL is not set
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+# CONFIG_MTD_TESTS is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AFS_PARTS is not set
+# CONFIG_MTD_AR7_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_SM_FTL is not set
+# CONFIG_MTD_OOPS is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND is not set
+CONFIG_MTD_RKNAND=y
+CONFIG_MTD_NAND_RK29XX=y
+CONFIG_MTD_RKNAND_BUFFER=y
+# CONFIG_MTD_EMMC_CLK_POWER_SAVE is not set
+# CONFIG_MTD_NAND_RK29XX_DEBUG is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# LPDDR flash memory drivers
+#
+# CONFIG_MTD_LPDDR is not set
+# CONFIG_MTD_UBI is not set
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+
+#
+# DRBD disabled because PROC_FS, INET or CONNECTOR not selected
+#
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_UB is not set
+# CONFIG_BLK_DEV_RAM is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_MG_DISK is not set
+# CONFIG_BLK_DEV_RBD is not set
+# CONFIG_SENSORS_LIS3LV02D is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_AD525X_DPOT is not set
+CONFIG_ANDROID_PMEM=y
+# CONFIG_INTEL_MID_PTI is not set
+# CONFIG_ICS932S401 is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_KERNEL_DEBUGGER_CORE is not set
+# CONFIG_APDS9802ALS is not set
+# CONFIG_ISL29003 is not set
+# CONFIG_ISL29020 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_SENSORS_BH1780 is not set
+# CONFIG_SENSORS_BH1770 is not set
+# CONFIG_SENSORS_APDS990X is not set
+# CONFIG_HMC6352 is not set
+# CONFIG_SENSORS_AK8975 is not set
+# CONFIG_DS1682 is not set
+CONFIG_UID_STAT=y
+# CONFIG_BMP085 is not set
+# CONFIG_WL127X_RFKILL is not set
+CONFIG_APANIC=y
+CONFIG_APANIC_PLABEL="kpanic"
+# CONFIG_STE is not set
+# CONFIG_MTK23D is not set
+# CONFIG_FM580X is not set
+# CONFIG_MU509 is not set
+# CONFIG_MW100 is not set
+# CONFIG_RK29_NEWTON is not set
+# CONFIG_C2PORT is not set
+
+#
+# EEPROM support
+#
+# CONFIG_EEPROM_AT24 is not set
+# CONFIG_EEPROM_LEGACY is not set
+# CONFIG_EEPROM_MAX6875 is not set
+# CONFIG_EEPROM_93CX6 is not set
+CONFIG_RK29_SUPPORT_MODEM=y
+CONFIG_MODEM_ROCKCHIP_DEMO=y
+# CONFIG_MODEM_LONGCHEER_U6300V is not set
+# CONFIG_MODEM_THINKWILL_MW100G is not set
+# CONFIG_RK29_GPS is not set
+
+#
+# Motion Sensors Support
+#
+# CONFIG_MPU_SENSORS_MPU3050 is not set
+# CONFIG_MPU_SENSORS_MPU6000 is not set
+# CONFIG_MPU_SENSORS_TIMERIRQ is not set
+# CONFIG_IWMC3200TOP is not set
+
+#
+# Texas Instruments shared transport line discipline
+#
+# CONFIG_TI_ST is not set
+# CONFIG_SENSORS_LIS3_I2C is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+CONFIG_SCSI_MOD=y
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+# CONFIG_SCSI_TGT is not set
+# CONFIG_SCSI_NETLINK is not set
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
+# CONFIG_CHR_DEV_SCH is not set
+CONFIG_SCSI_MULTI_LUN=y
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+CONFIG_SCSI_WAIT_SCAN=m
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_ISCSI_BOOT_SYSFS is not set
+# CONFIG_LIBFC is not set
+# CONFIG_LIBFCOE is not set
+# CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_DH is not set
+# CONFIG_SCSI_OSD_INITIATOR is not set
+# CONFIG_ATA is not set
+CONFIG_MD=y
+# CONFIG_BLK_DEV_MD is not set
+CONFIG_BLK_DEV_DM=y
+# CONFIG_DM_DEBUG is not set
+CONFIG_DM_CRYPT=y
+# CONFIG_DM_SNAPSHOT is not set
+# CONFIG_DM_MIRROR is not set
+# CONFIG_DM_RAID is not set
+# CONFIG_DM_ZERO is not set
+# CONFIG_DM_MULTIPATH is not set
+# CONFIG_DM_DELAY is not set
+CONFIG_DM_UEVENT=y
+# CONFIG_DM_FLAKEY is not set
+# CONFIG_TARGET_CORE is not set
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+CONFIG_MII=y
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+# CONFIG_MICREL_PHY is not set
+# CONFIG_FIXED_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
+CONFIG_NET_ETHERNET=y
+# CONFIG_AX88796 is not set
+CONFIG_RK29_VMAC=y
+# CONFIG_SMC91X is not set
+# CONFIG_DM9000 is not set
+# CONFIG_ETHOC is not set
+# CONFIG_SMC911X is not set
+# CONFIG_SMSC911X is not set
+# CONFIG_DNET is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
+# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
+# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
+# CONFIG_B44 is not set
+# CONFIG_KS8851_MLL is not set
+# CONFIG_FTMAC100 is not set
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+CONFIG_WLAN=y
+CONFIG_WLAN_80211=y
+# CONFIG_WIFI_NONE is not set
+CONFIG_BCM4329=y
+# CONFIG_MV8686 is not set
+# CONFIG_BCM4319 is not set
+# CONFIG_RTL8192CU is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+# CONFIG_USB_HSO is not set
+# CONFIG_USB_IPHETH is not set
+# CONFIG_WAN is not set
+
+#
+# CAIF transport drivers
+#
+CONFIG_PPP=y
+CONFIG_PPP_MULTILINK=y
+CONFIG_PPP_FILTER=y
+CONFIG_PPP_ASYNC=y
+CONFIG_PPP_SYNC_TTY=y
+CONFIG_PPP_DEFLATE=y
+CONFIG_PPP_BSDCOMP=y
+# CONFIG_PPP_MPPE is not set
+# CONFIG_PPPOE is not set
+# CONFIG_PPPOLAC is not set
+# CONFIG_PPPOPNS is not set
+# CONFIG_SLIP is not set
+CONFIG_SLHC=y
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+CONFIG_INPUT_POLLDEV=y
+# CONFIG_INPUT_SPARSEKMAP is not set
+
+#
+# Userland interfaces
+#
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+CONFIG_INPUT_KEYRESET=y
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_KEYS_RK29=y
+# CONFIG_KEYS_RK29_NEWTON is not set
+# CONFIG_SYNAPTICS_SO340010 is not set
+# CONFIG_KEYBOARD_ADP5588 is not set
+# CONFIG_KEYBOARD_ADP5589 is not set
+# CONFIG_KEYBOARD_ATKBD is not set
+# CONFIG_KEYBOARD_QT1070 is not set
+# CONFIG_KEYBOARD_QT2160 is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_GPIO is not set
+# CONFIG_KEYBOARD_WM831X_GPIO is not set
+# CONFIG_KEYBOARD_TCA6416 is not set
+# CONFIG_KEYBOARD_MATRIX is not set
+# CONFIG_KEYBOARD_MAX7359 is not set
+# CONFIG_KEYBOARD_MCS is not set
+# CONFIG_KEYBOARD_MPR121 is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_OPENCORES is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+# CONFIG_TOUCHSCREEN_ILI2102_IIC is not set
+CONFIG_TOUCHSCREEN_GT8XX=y
+# CONFIG_TOUCHSCREEN_IT7250 is not set
+# CONFIG_TOUCHSCREEN_AD7879 is not set
+# CONFIG_TOUCHSCREEN_ATMEL_MXT is not set
+# CONFIG_TOUCHSCREEN_BU21013 is not set
+# CONFIG_TOUCHSCREEN_CY8CTMG110 is not set
+# CONFIG_TOUCHSCREEN_DYNAPRO is not set
+# CONFIG_TOUCHSCREEN_HAMPSHIRE is not set
+# CONFIG_TOUCHSCREEN_EETI is not set
+# CONFIG_TOUCHSCREEN_FUJITSU is not set
+# CONFIG_TOUCHSCREEN_GUNZE is not set
+# CONFIG_TOUCHSCREEN_ELO is not set
+# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
+# CONFIG_TOUCHSCREEN_MAX11801 is not set
+# CONFIG_TOUCHSCREEN_MCS5000 is not set
+# CONFIG_TOUCHSCREEN_MTOUCH is not set
+# CONFIG_TOUCHSCREEN_INEXIO is not set
+# CONFIG_TOUCHSCREEN_MK712 is not set
+# CONFIG_TOUCHSCREEN_PENMOUNT is not set
+# CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI is not set
+# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
+# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
+# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
+# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
+# CONFIG_TOUCHSCREEN_TSC2007 is not set
+# CONFIG_TOUCHSCREEN_W90X900 is not set
+# CONFIG_TOUCHSCREEN_ST1232 is not set
+# CONFIG_TOUCHSCREEN_TPS6507X is not set
+# CONFIG_HANNSTAR_P1003 is not set
+# CONFIG_ATMEL_MXT224 is not set
+# CONFIG_SINTEK_3FA16 is not set
+# CONFIG_EETI_EGALAX is not set
+# CONFIG_TOUCHSCREEN_IT7260 is not set
+# CONFIG_TOUCHSCREEN_IT7260_I2C is not set
+# CONFIG_TOUCHSCREEN_NAS is not set
+# CONFIG_LAIBAO_TS is not set
+# CONFIG_TOUCHSCREEN_GT801_IIC is not set
+# CONFIG_TOUCHSCREEN_GT818_IIC is not set
+# CONFIG_D70_L3188A is not set
+# CONFIG_TOUCHSCREEN_GT819 is not set
+# CONFIG_TOUCHSCREEN_FT5406 is not set
+# CONFIG_ATMEL_MXT1386 is not set
+CONFIG_INPUT_MISC=y
+# CONFIG_INPUT_LPSENSOR_ISL29028 is not set
+# CONFIG_INPUT_LPSENSOR_CM3602 is not set
+# CONFIG_INPUT_AD714X is not set
+# CONFIG_INPUT_ATI_REMOTE is not set
+# CONFIG_INPUT_ATI_REMOTE2 is not set
+# CONFIG_INPUT_KEYCHORD is not set
+# CONFIG_INPUT_KEYSPAN_REMOTE is not set
+# CONFIG_INPUT_POWERMATE is not set
+# CONFIG_INPUT_YEALINK is not set
+# CONFIG_INPUT_CM109 is not set
+CONFIG_INPUT_UINPUT=y
+# CONFIG_INPUT_GPIO is not set
+# CONFIG_INPUT_PCF8574 is not set
+# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
+# CONFIG_INPUT_ADXL34X is not set
+# CONFIG_INPUT_CMA3000 is not set
+# CONFIG_MAG_SENSORS is not set
+CONFIG_G_SENSOR_DEVICE=y
+# CONFIG_GS_MMA7660 is not set
+CONFIG_GS_MMA8452=y
+# CONFIG_GS_KXTF9 is not set
+# CONFIG_GS_LIS3DH is not set
+# CONFIG_GS_L3G4200D is not set
+# CONFIG_GYRO_SENSOR_DEVICE is not set
+# CONFIG_INPUT_JOGBALL is not set
+# CONFIG_LIGHT_SENSOR_DEVICE is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+# CONFIG_CONSOLE_TRANSLATIONS is not set
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_N_GSM is not set
+# CONFIG_TRACE_SINK is not set
+CONFIG_DEVMEM=y
+CONFIG_DEVKMEM=y
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_TIMBERDALE is not set
+CONFIG_SERIAL_RK29=y
+CONFIG_UART0_RK29=y
+CONFIG_UART0_CTS_RTS_RK29=y
+# CONFIG_UART0_DMA_RK29 is not set
+CONFIG_UART1_RK29=y
+CONFIG_UART2_RK29=y
+CONFIG_UART2_CTS_RTS_RK29=y
+# CONFIG_UART2_DMA_RK29 is not set
+# CONFIG_UART3_RK29 is not set
+CONFIG_SERIAL_RK29_CONSOLE=y
+# CONFIG_SERIAL_ALTERA_JTAGUART is not set
+# CONFIG_SERIAL_ALTERA_UART is not set
+# CONFIG_SERIAL_XILINX_PS_UART is not set
+# CONFIG_TTY_PRINTK is not set
+# CONFIG_HVC_DCC is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+# CONFIG_DCC_TTY is not set
+# CONFIG_RAMOOPS is not set
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_COMPAT=y
+# CONFIG_I2C_CHARDEV is not set
+# CONFIG_I2C_MUX is not set
+CONFIG_I2C_HELPER_AUTO=y
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+# CONFIG_I2C_DESIGNWARE is not set
+# CONFIG_I2C_GPIO is not set
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_PXA_PCI is not set
+# CONFIG_I2C_SIMTEC is not set
+# CONFIG_I2C_XILINX is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_DIOLAN_U2C is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_TINY_USB is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+# CONFIG_I2C_STUB is not set
+CONFIG_I2C_RK29=y
+
+#
+# Now, there are four I2C interfaces selected by developer.
+#
+CONFIG_I2C0_RK29=y
+CONFIG_RK29_I2C0_CONTROLLER=y
+# CONFIG_RK29_I2C0_GPIO is not set
+CONFIG_I2C1_RK29=y
+CONFIG_RK29_I2C1_CONTROLLER=y
+# CONFIG_RK29_I2C1_GPIO is not set
+CONFIG_I2C2_RK29=y
+CONFIG_RK29_I2C2_CONTROLLER=y
+# CONFIG_RK29_I2C2_GPIO is not set
+CONFIG_I2C3_RK29=y
+CONFIG_RK29_I2C3_CONTROLLER=y
+# CONFIG_RK29_I2C3_GPIO is not set
+CONFIG_I2C_DEV_RK29=y
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_SPI is not set
+CONFIG_ADC=y
+# CONFIG_ADC_RK28 is not set
+CONFIG_ADC_RK29=y
+
+#
+# Headset device support
+#
+# CONFIG_RK_HEADSET_DET is not set
+
+#
+# PPS support
+#
+# CONFIG_PPS is not set
+
+#
+# PPS generators support
+#
+
+#
+# PTP clock support
+#
+
+#
+# Enable Device Drivers -> PPS to see the PTP clock options.
+#
+CONFIG_ARCH_REQUIRE_GPIOLIB=y
+CONFIG_GPIOLIB=y
+# CONFIG_DEBUG_GPIO is not set
+# CONFIG_GPIO_SYSFS is not set
+
+#
+# Memory mapped GPIO drivers:
+#
+# CONFIG_GPIO_BASIC_MMIO is not set
+# CONFIG_GPIO_IT8761E is not set
+
+#
+# I2C GPIO expanders:
+#
+# CONFIG_GPIO_MAX7300 is not set
+# CONFIG_GPIO_MAX732X is not set
+# CONFIG_GPIO_PCF857X is not set
+# CONFIG_GPIO_SX150X is not set
+# CONFIG_GPIO_ADP5588 is not set
+
+#
+# PCI GPIO expanders:
+#
+
+#
+# SPI GPIO expanders:
+#
+
+#
+# AC97 GPIO expanders:
+#
+# CONFIG_GPIO_PCA9554 is not set
+# CONFIG_IOEXTEND_TCA6424 is not set
+CONFIG_EXPANDED_GPIO_NUM=0
+CONFIG_EXPANDED_GPIO_IRQ_NUM=0
+# CONFIG_EXPAND_GPIO_SOFT_INTERRUPT is not set
+CONFIG_SPI_FPGA_GPIO_NUM=96
+CONFIG_SPI_FPGA_GPIO_IRQ_NUM=16
+
+#
+# MODULbus GPIO expanders:
+#
+# CONFIG_W1 is not set
+CONFIG_POWER_SUPPLY=y
+# CONFIG_POWER_SUPPLY_DEBUG is not set
+# CONFIG_PDA_POWER is not set
+# CONFIG_TEST_POWER is not set
+# CONFIG_BATTERY_DS2780 is not set
+# CONFIG_BATTERY_DS2782 is not set
+# CONFIG_BATTERY_BQ20Z75 is not set
+# CONFIG_BATTERY_BQ27x00 is not set
+# CONFIG_BATTERY_MAX17040 is not set
+# CONFIG_BATTERY_MAX17042 is not set
+# CONFIG_BATTERY_STC3100 is not set
+CONFIG_BATTERY_BQ27510=y
+# CONFIG_BATTERY_BQ27541 is not set
+# CONFIG_BATTERY_BQ3060 is not set
+# CONFIG_CHECK_BATT_CAPACITY is not set
+CONFIG_NO_BATTERY_IC=y
+# CONFIG_CHARGER_MAX8903 is not set
+# CONFIG_CHARGER_GPIO is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+CONFIG_BCMA_POSSIBLE=y
+
+#
+# Broadcom specific AMBA
+#
+# CONFIG_BCMA is not set
+CONFIG_MFD_SUPPORT=y
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_88PM860X is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_MFD_ASIC3 is not set
+# CONFIG_HTC_EGPIO is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_HTC_I2CPLD is not set
+# CONFIG_TPS6105X is not set
+# CONFIG_TPS65010 is not set
+# CONFIG_TPS6507X is not set
+# CONFIG_MFD_TPS6586X is not set
+# CONFIG_TWL4030_CORE is not set
+# CONFIG_MFD_STMPE is not set
+# CONFIG_MFD_TC3589X is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_MFD_T7L66XB is not set
+# CONFIG_MFD_TC6387XB is not set
+# CONFIG_MFD_TC6393XB is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_PMIC_ADP5520 is not set
+# CONFIG_MFD_MAX8925 is not set
+# CONFIG_MFD_MAX8997 is not set
+# CONFIG_MFD_MAX8998 is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM831X_I2C is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_WM8994 is not set
+# CONFIG_MFD_PCF50633 is not set
+# CONFIG_ABX500_CORE is not set
+# CONFIG_MFD_WL1273_CORE is not set
+# CONFIG_MFD_TPS65910 is not set
+CONFIG_REGULATOR=y
+# CONFIG_REGULATOR_DEBUG is not set
+# CONFIG_REGULATOR_DUMMY is not set
+# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
+# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
+# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
+# CONFIG_REGULATOR_BQ24022 is not set
+# CONFIG_REGULATOR_MAX1586 is not set
+# CONFIG_REGULATOR_MAX8649 is not set
+# CONFIG_REGULATOR_MAX8660 is not set
+# CONFIG_REGULATOR_MAX8952 is not set
+# CONFIG_REGULATOR_LP3971 is not set
+# CONFIG_REGULATOR_LP3972 is not set
+# CONFIG_REGULATOR_TPS65023 is not set
+# CONFIG_REGULATOR_TPS6507X is not set
+# CONFIG_RK2818_REGULATOR_CHARGE is not set
+# CONFIG_RK2818_REGULATOR_LP8725 is not set
+# CONFIG_REGULATOR_ACT8891 is not set
+CONFIG_RK29_PWM_REGULATOR=y
+# CONFIG_REGULATOR_ISL6271A is not set
+# CONFIG_REGULATOR_AD5398 is not set
+CONFIG_MEDIA_SUPPORT=y
+
+#
+# Multimedia core support
+#
+# CONFIG_MEDIA_CONTROLLER is not set
+CONFIG_VIDEO_DEV=y
+CONFIG_VIDEO_V4L2_COMMON=y
+# CONFIG_DVB_CORE is not set
+CONFIG_VIDEO_MEDIA=y
+
+#
+# Multimedia drivers
+#
+CONFIG_RC_CORE=y
+CONFIG_LIRC=y
+CONFIG_RC_MAP=y
+CONFIG_IR_NEC_DECODER=y
+CONFIG_IR_RC5_DECODER=y
+CONFIG_IR_RC6_DECODER=y
+CONFIG_IR_JVC_DECODER=y
+CONFIG_IR_SONY_DECODER=y
+CONFIG_IR_RC5_SZ_DECODER=y
+CONFIG_IR_LIRC_CODEC=y
+# CONFIG_IR_IMON is not set
+# CONFIG_IR_MCEUSB is not set
+# CONFIG_IR_REDRAT3 is not set
+# CONFIG_IR_STREAMZAP is not set
+# CONFIG_RC_LOOPBACK is not set
+# CONFIG_MEDIA_ATTACH is not set
+CONFIG_MEDIA_TUNER=y
+# CONFIG_MEDIA_TUNER_CUSTOMISE is not set
+CONFIG_MEDIA_TUNER_SIMPLE=y
+CONFIG_MEDIA_TUNER_TDA8290=y
+CONFIG_MEDIA_TUNER_TDA827X=y
+CONFIG_MEDIA_TUNER_TDA18271=y
+CONFIG_MEDIA_TUNER_TDA9887=y
+CONFIG_MEDIA_TUNER_TEA5761=y
+CONFIG_MEDIA_TUNER_TEA5767=y
+CONFIG_MEDIA_TUNER_MT20XX=y
+CONFIG_MEDIA_TUNER_XC2028=y
+CONFIG_MEDIA_TUNER_XC5000=y
+CONFIG_MEDIA_TUNER_MC44S803=y
+CONFIG_VIDEO_V4L2=y
+CONFIG_VIDEOBUF_GEN=y
+CONFIG_VIDEOBUF_DMA_CONTIG=y
+CONFIG_VIDEOBUF2_CORE=y
+# CONFIG_VIDEO_RK29XX_VOUT is not set
+CONFIG_VIDEO_CAPTURE_DRIVERS=y
+# CONFIG_VIDEO_ADV_DEBUG is not set
+# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
+CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
+CONFIG_VIDEO_IR_I2C=y
+
+#
+# Audio decoders, processors and mixers
+#
+
+#
+# RDS decoders
+#
+
+#
+# Video decoders
+#
+
+#
+# Video and audio decoders
+#
+
+#
+# MPEG video encoders
+#
+
+#
+# Video encoders
+#
+
+#
+# Camera sensor devices
+#
+
+#
+# Video improvement chips
+#
+
+#
+# Miscelaneous helper chips
+#
+# CONFIG_VIDEO_CPIA2 is not set
+# CONFIG_VIDEO_SR030PC30 is not set
+# CONFIG_VIDEO_NOON010PC30 is not set
+CONFIG_SOC_CAMERA=y
+# CONFIG_SOC_CAMERA_IMX074 is not set
+# CONFIG_SOC_CAMERA_MT9M001 is not set
+# CONFIG_SOC_CAMERA_MT9M111 is not set
+# CONFIG_SOC_CAMERA_MT9M112 is not set
+# CONFIG_SOC_CAMERA_MT9T031 is not set
+# CONFIG_SOC_CAMERA_MT9T111 is not set
+# CONFIG_SOC_CAMERA_MT9P111 is not set
+# CONFIG_SOC_CAMERA_MT9D112 is not set
+# CONFIG_SOC_CAMERA_MT9D113 is not set
+# CONFIG_SOC_CAMERA_MT9T112 is not set
+# CONFIG_SOC_CAMERA_MT9V022 is not set
+# CONFIG_SOC_CAMERA_RJ54N1 is not set
+# CONFIG_SOC_CAMERA_TW9910 is not set
+# CONFIG_SOC_CAMERA_PLATFORM is not set
+# CONFIG_SOC_CAMERA_OV2640 is not set
+# CONFIG_SOC_CAMERA_OV6650 is not set
+# CONFIG_SOC_CAMERA_OV772X is not set
+# CONFIG_SOC_CAMERA_OV7675 is not set
+# CONFIG_SOC_CAMERA_OV2655 is not set
+CONFIG_SOC_CAMERA_OV2659=y
+# CONFIG_SOC_CAMERA_OV9650 is not set
+# CONFIG_SOC_CAMERA_OV3640 is not set
+CONFIG_SOC_CAMERA_OV5642=y
+CONFIG_OV5642_AUTOFOCUS=y
+# 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
+# CONFIG_SOC_CAMERA_GC0307 is not set
+# CONFIG_SOC_CAMERA_GC0308 is not set
+# CONFIG_SOC_CAMERA_GC0309 is not set
+# CONFIG_SOC_CAMERA_GC2015 is not set
+# CONFIG_SOC_CAMERA_HI253 is not set
+# CONFIG_SOC_CAMERA_HI704 is not set
+# CONFIG_SOC_CAMERA_SIV120B is not set
+# CONFIG_SOC_CAMERA_SID130B is not set
+# CONFIG_SOC_CAMERA_NT99250 is not set
+# CONFIG_SOC_CAMERA_OV9640 is not set
+# CONFIG_SOC_CAMERA_OV9740 is not set
+# CONFIG_VIDEO_SH_MOBILE_CSI2 is not set
+# CONFIG_VIDEO_SH_MOBILE_CEU is not set
+CONFIG_VIDEO_RK29=y
+CONFIG_VIDEO_RK29_WORK_ONEFRAME=y
+# CONFIG_VIDEO_RK29_WORK_PINGPONG is not set
+CONFIG_VIDEO_RK29_WORK_IPP=y
+# CONFIG_VIDEO_RK29_WORK_NOT_IPP is not set
+CONFIG_VIDEO_RK29_DIGITALZOOM_IPP_ON=y
+# CONFIG_VIDEO_RK29_DIGITALZOOM_IPP_OFF is not set
+CONFIG_V4L_USB_DRIVERS=y
+# CONFIG_USB_VIDEO_CLASS is not set
+CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
+CONFIG_USB_GSPCA=m
+# CONFIG_USB_M5602 is not set
+# CONFIG_USB_STV06XX is not set
+# CONFIG_USB_GL860 is not set
+# CONFIG_USB_GSPCA_BENQ is not set
+# CONFIG_USB_GSPCA_CONEX is not set
+# CONFIG_USB_GSPCA_CPIA1 is not set
+# CONFIG_USB_GSPCA_ETOMS is not set
+# CONFIG_USB_GSPCA_FINEPIX is not set
+# CONFIG_USB_GSPCA_JEILINJ is not set
+# CONFIG_USB_GSPCA_KINECT is not set
+# CONFIG_USB_GSPCA_KONICA is not set
+# CONFIG_USB_GSPCA_MARS is not set
+# CONFIG_USB_GSPCA_MR97310A is not set
+# CONFIG_USB_GSPCA_NW80X is not set
+# CONFIG_USB_GSPCA_OV519 is not set
+# CONFIG_USB_GSPCA_OV534 is not set
+# CONFIG_USB_GSPCA_OV534_9 is not set
+# CONFIG_USB_GSPCA_PAC207 is not set
+# CONFIG_USB_GSPCA_PAC7302 is not set
+# CONFIG_USB_GSPCA_PAC7311 is not set
+# CONFIG_USB_GSPCA_SN9C2028 is not set
+# CONFIG_USB_GSPCA_SN9C20X is not set
+# CONFIG_USB_GSPCA_SONIXB is not set
+# CONFIG_USB_GSPCA_SONIXJ is not set
+# CONFIG_USB_GSPCA_SPCA500 is not set
+# CONFIG_USB_GSPCA_SPCA501 is not set
+# CONFIG_USB_GSPCA_SPCA505 is not set
+# CONFIG_USB_GSPCA_SPCA506 is not set
+# CONFIG_USB_GSPCA_SPCA508 is not set
+# CONFIG_USB_GSPCA_SPCA561 is not set
+# CONFIG_USB_GSPCA_SPCA1528 is not set
+# CONFIG_USB_GSPCA_SQ905 is not set
+# CONFIG_USB_GSPCA_SQ905C is not set
+# CONFIG_USB_GSPCA_SQ930X is not set
+# CONFIG_USB_GSPCA_STK014 is not set
+# CONFIG_USB_GSPCA_STV0680 is not set
+# CONFIG_USB_GSPCA_SUNPLUS is not set
+# CONFIG_USB_GSPCA_T613 is not set
+# CONFIG_USB_GSPCA_TV8532 is not set
+# CONFIG_USB_GSPCA_VC032X is not set
+# CONFIG_USB_GSPCA_VICAM is not set
+# CONFIG_USB_GSPCA_XIRLINK_CIT is not set
+# CONFIG_USB_GSPCA_ZC3XX is not set
+# CONFIG_VIDEO_PVRUSB2 is not set
+# CONFIG_VIDEO_HDPVR is not set
+# CONFIG_VIDEO_EM28XX is not set
+# CONFIG_VIDEO_CX231XX is not set
+# CONFIG_VIDEO_USBVISION is not set
+# CONFIG_USB_ET61X251 is not set
+# CONFIG_USB_SN9C102 is not set
+# CONFIG_USB_PWC is not set
+# CONFIG_USB_ZR364XX is not set
+# CONFIG_USB_STKWEBCAM is not set
+# CONFIG_USB_S2255 is not set
+# CONFIG_V4L_MEM2MEM_DRIVERS is not set
+CONFIG_RADIO_ADAPTERS=y
+# CONFIG_I2C_SI4713 is not set
+# CONFIG_RADIO_SI4713 is not set
+# CONFIG_USB_DSBR is not set
+# CONFIG_RADIO_SI470X is not set
+# CONFIG_USB_MR800 is not set
+# CONFIG_RADIO_TEA5764 is not set
+# CONFIG_RADIO_SAA7706H is not set
+# CONFIG_RADIO_TEF6862 is not set
+# CONFIG_RADIO_WL1273 is not set
+
+#
+# Texas Instruments WL128x FM driver (ST based)
+#
+# CONFIG_RADIO_WL128X is not set
+# CONFIG_SMS_SIANO_MDTV is not set
+
+#
+# Graphics support
+#
+# CONFIG_DRM is not set
+# CONFIG_ION is not set
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+CONFIG_FB=y
+# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+# CONFIG_FB_SYS_FOPS is not set
+# CONFIG_FB_WMT_GE_ROPS is not set
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_S1D13XXX is not set
+CONFIG_FB_RK29=y
+CONFIG_FB_WORK_IPP=y
+CONFIG_FB_SCALING_OSD=y
+# CONFIG_FB_SCALING_OSD_1080P is not set
+# CONFIG_FB_ROTATE_VIDEO is not set
+CONFIG_CLOSE_WIN1_DYNAMIC=y
+# CONFIG_FB_UDL is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_BROADSHEET is not set
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+# CONFIG_LCD_CLASS_DEVICE is not set
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+# CONFIG_BACKLIGHT_GENERIC is not set
+CONFIG_BACKLIGHT_RK29_BL=y
+# CONFIG_BACKLIGHT_RK29_NEWTON_BL is not set
+# CONFIG_FIH_TOUCHKEY_LED is not set
+# CONFIG_BACKLIGHT_AW9364 is not set
+# CONFIG_BUTTON_LIGHT is not set
+# CONFIG_BACKLIGHT_ADP8860 is not set
+# CONFIG_BACKLIGHT_ADP8870 is not set
+
+#
+# Display device support
+#
+CONFIG_DISPLAY_SUPPORT=y
+
+#
+# Display hardware drivers
+#
+# CONFIG_LCD_NULL is not set
+# CONFIG_LCD_TD043MGEA1 is not set
+# CONFIG_LCD_HX8357 is not set
+# CONFIG_LCD_TJ048NC01CA is not set
+# CONFIG_LCD_HL070VM4AU is not set
+# CONFIG_LCD_HSD070IDW1 is not set
+# CONFIG_LCD_RGB_TFT480800_25_E is not set
+CONFIG_LCD_HSD100PXN=y
+# CONFIG_LCD_HSD07PFW1 is not set
+# CONFIG_LCD_BYD8688FTGF is not set
+# CONFIG_LCD_B101AW06 is not set
+# CONFIG_LCD_LS035Y8DX02A is not set
+# CONFIG_LCD_CPTCLAA038LA31XE is not set
+# CONFIG_LCD_A060SE02 is not set
+# CONFIG_LCD_S1D13521 is not set
+# CONFIG_LCD_NT35582 is not set
+# CONFIG_LCD_NT35580 is not set
+# CONFIG_LCD_IPS1P5680_V1_E is not set
+# CONFIG_LCD_MCU_TFT480800_25_E is not set
+# CONFIG_LCD_NT35510 is not set
+# CONFIG_LCD_ILI9803_CPT4_3 is not set
+# CONFIG_DEFAULT_OUT_HDMI is not set
+# CONFIG_LCD_AT070TNA2 is not set
+# CONFIG_LCD_AT070TN93 is not set
+# CONFIG_LCD_TX23D88VM is not set
+
+#
+# HDMI
+#
+CONFIG_HDMI=y
+CONFIG_ANX7150=y
+# CONFIG_ANX9030 is not set
+
+#
+# Console display driver support
+#
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE is not set
+CONFIG_LOGO=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+CONFIG_LOGO_LINUX_CLUT224=y
+# CONFIG_LOGO_CHARGER_CLUT224 is not set
+CONFIG_SOUND=y
+# CONFIG_SOUND_OSS_CORE is not set
+# CONFIG_SND is not set
+# CONFIG_SOUND_PRIME is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HIDRAW is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=y
+# CONFIG_HID_PID is not set
+# CONFIG_USB_HIDDEV is not set
+
+#
+# Special HID drivers
+#
+# CONFIG_HID_A4TECH is not set
+# CONFIG_HID_ACRUX is not set
+# CONFIG_HID_APPLE is not set
+# CONFIG_HID_BELKIN is not set
+# CONFIG_HID_CHERRY is not set
+# CONFIG_HID_CHICONY is not set
+# CONFIG_HID_CYPRESS is not set
+# CONFIG_HID_DRAGONRISE is not set
+# CONFIG_HID_EMS_FF is not set
+# CONFIG_HID_EZKEY is not set
+# CONFIG_HID_KEYTOUCH is not set
+# CONFIG_HID_KYE is not set
+# CONFIG_HID_UCLOGIC is not set
+# CONFIG_HID_WALTOP is not set
+# CONFIG_HID_GYRATION is not set
+# CONFIG_HID_TWINHAN is not set
+# CONFIG_HID_KENSINGTON is not set
+# CONFIG_HID_LCPOWER is not set
+# CONFIG_HID_LOGITECH is not set
+# CONFIG_HID_MICROSOFT is not set
+# CONFIG_HID_MONTEREY is not set
+# CONFIG_HID_MULTITOUCH is not set
+# CONFIG_HID_NTRIG is not set
+# CONFIG_HID_ORTEK is not set
+# CONFIG_HID_PANTHERLORD is not set
+# CONFIG_HID_PETALYNX is not set
+# CONFIG_HID_PICOLCD is not set
+# CONFIG_HID_QUANTA is not set
+# CONFIG_HID_ROCCAT is not set
+# CONFIG_HID_ROCCAT_ARVO is not set
+# CONFIG_HID_ROCCAT_KONE is not set
+# CONFIG_HID_ROCCAT_KONEPLUS is not set
+# CONFIG_HID_ROCCAT_KOVAPLUS is not set
+# CONFIG_HID_ROCCAT_PYRA is not set
+# CONFIG_HID_SAMSUNG is not set
+# CONFIG_HID_SONY is not set
+# CONFIG_HID_SUNPLUS is not set
+# CONFIG_HID_GREENASIA is not set
+# CONFIG_HID_SMARTJOYPLUS is not set
+# CONFIG_HID_TOPSEED is not set
+# CONFIG_HID_THRUSTMASTER is not set
+# CONFIG_HID_ZEROPLUS is not set
+# CONFIG_HID_ZYDACRON is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+# CONFIG_USB_ARCH_HAS_OHCI is not set
+# CONFIG_USB_ARCH_HAS_EHCI is not set
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+
+#
+# Miscellaneous USB options
+#
+# CONFIG_USB_DEVICEFS is not set
+CONFIG_USB_DEVICE_CLASS=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+CONFIG_USB_OTG_BLACKLIST_HUB=y
+# CONFIG_USB_MON is not set
+# CONFIG_USB_WUSB is not set
+# CONFIG_USB_WUSB_CBAF is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+# CONFIG_USB_OXU210HP_HCD is not set
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_ISP1760_HCD is not set
+# CONFIG_USB_ISP1362_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+# CONFIG_USB_HWA_HCD is not set
+# CONFIG_USB_MUSB_HDRC is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+# CONFIG_USB_WDM is not set
+# CONFIG_USB_TMC is not set
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
+#
+
+#
+# also be needed; see USB_STORAGE Help for more info
+#
+CONFIG_USB_STORAGE=y
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_REALTEK is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_ONETOUCH is not set
+# CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
+# CONFIG_USB_STORAGE_ENE_UB6250 is not set
+# CONFIG_USB_UAS is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB port drivers
+#
+CONFIG_USB_SERIAL=y
+# CONFIG_USB_SERIAL_CONSOLE is not set
+# CONFIG_USB_EZUSB is not set
+CONFIG_USB_SERIAL_GENERIC=y
+# CONFIG_USB_SERIAL_AIRCABLE is not set
+# CONFIG_USB_SERIAL_ARK3116 is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_CH341 is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_CP210X is not set
+# CONFIG_USB_SERIAL_CYPRESS_M8 is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_FUNSOFT is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_IPAQ is not set
+# CONFIG_USB_SERIAL_IR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
+# CONFIG_USB_SERIAL_GARMIN is not set
+# CONFIG_USB_SERIAL_IPW is not set
+# CONFIG_USB_SERIAL_IUU is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KLSI is not set
+# CONFIG_USB_SERIAL_KOBIL_SCT is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_MOS7720 is not set
+# CONFIG_USB_SERIAL_MOS7840 is not set
+# CONFIG_USB_SERIAL_MOTOROLA is not set
+# CONFIG_USB_SERIAL_NAVMAN is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_OTI6858 is not set
+# CONFIG_USB_SERIAL_QCAUX is not set
+# CONFIG_USB_SERIAL_QUALCOMM is not set
+# CONFIG_USB_SERIAL_SPCP8X5 is not set
+# CONFIG_USB_SERIAL_HP4X is not set
+# CONFIG_USB_SERIAL_SAFE is not set
+# CONFIG_USB_SERIAL_SIEMENS_MPI is not set
+# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set
+# CONFIG_USB_SERIAL_SYMBOL is not set
+# CONFIG_USB_SERIAL_TI is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_XIRCOM is not set
+CONFIG_USB_SERIAL_WWAN=y
+CONFIG_USB_SERIAL_OPTION=y
+# CONFIG_USB_SERIAL_OMNINET is not set
+# CONFIG_USB_SERIAL_OPTICON is not set
+# CONFIG_USB_SERIAL_VIVOPAY_SERIAL is not set
+# CONFIG_USB_SERIAL_ZIO is not set
+# CONFIG_USB_SERIAL_SSU100 is not set
+# CONFIG_USB_SERIAL_DEBUG is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_SEVSEG is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
+# CONFIG_USB_TEST is not set
+# CONFIG_USB_ISIGHTFW is not set
+# CONFIG_USB_YUREX is not set
+CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG is not set
+# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_VBUS_DRAW=2
+CONFIG_USB_GADGET_SELECTED=y
+# CONFIG_USB_GADGET_FUSB300 is not set
+# CONFIG_USB_GADGET_R8A66597 is not set
+# CONFIG_USB_GADGET_PXA_U2O is not set
+# CONFIG_USB_GADGET_M66592 is not set
+CONFIG_USB_GADGET_DWC_OTG=y
+CONFIG_USB_DWC_OTG=y
+# CONFIG_USB_GADGET_DUMMY_HCD is not set
+CONFIG_USB_GADGET_DUALSPEED=y
+# CONFIG_USB_ZERO is not set
+# CONFIG_USB_ETH is not set
+# CONFIG_USB_G_NCM is not set
+# CONFIG_USB_GADGETFS is not set
+# CONFIG_USB_FUNCTIONFS is not set
+# CONFIG_USB_FILE_STORAGE is not set
+# CONFIG_USB_MASS_STORAGE is not set
+# CONFIG_USB_G_SERIAL is not set
+# CONFIG_USB_G_PRINTER is not set
+CONFIG_USB_G_ANDROID=y
+# CONFIG_USB_CDC_COMPOSITE is not set
+# CONFIG_USB_G_MULTI is not set
+# CONFIG_USB_G_HID is not set
+# CONFIG_USB_G_DBGP is not set
+# CONFIG_USB_G_WEBCAM is not set
+
+#
+# OTG and related infrastructure
+#
+# CONFIG_USB_OTG_WAKELOCK is not set
+# CONFIG_USB_GPIO_VBUS is not set
+# CONFIG_USB_ULPI is not set
+# CONFIG_NOP_USB_XCEIV is not set
+CONFIG_USB11_HOST=y
+CONFIG_USB11_HOST_EN=y
+CONFIG_USB20_HOST=y
+CONFIG_USB20_HOST_EN=y
+CONFIG_USB20_OTG=y
+# CONFIG_DWC_OTG_HOST_ONLY is not set
+CONFIG_DWC_OTG_DEVICE_ONLY=y
+# CONFIG_DWC_OTG_BOTH_HOST_SLAVE is not set
+CONFIG_DWC_CONN_EN=y
+# CONFIG_DWC_OTG_DEBUG is not set
+# CONFIG_DWC_REMOTE_WAKEUP is not set
+CONFIG_DWC_OTG=y
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+CONFIG_MMC_UNSAFE_RESUME=y
+# CONFIG_MMC_CLKGATE is not set
+CONFIG_MMC_EMBEDDED_SDIO=y
+CONFIG_MMC_PARANOID_SD_INIT=y
+
+#
+# MMC/SD/SDIO Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_MINORS=8
+CONFIG_MMC_BLOCK_BOUNCE=y
+# CONFIG_MMC_BLOCK_DEFERRED_RESUME is not set
+# CONFIG_SDIO_UART is not set
+# CONFIG_MMC_TEST is not set
+
+#
+# MMC/SD/SDIO Host Controller Drivers
+#
+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_SDMMC0_RK29_WRITE_PROTECT is not set
+CONFIG_SDMMC1_RK29=y
+# CONFIG_SDMMC1_RK29_WRITE_PROTECT is not set
+# CONFIG_MMC_SDHCI is not set
+# CONFIG_MMC_DW is not set
+# CONFIG_MMC_VUB300 is not set
+# CONFIG_MMC_USHC is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_NFC_DEVICES is not set
+CONFIG_SWITCH=y
+CONFIG_SWITCH_GPIO=y
+# CONFIG_ACCESSIBILITY is not set
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+CONFIG_RTC_INTF_ALARM=y
+CONFIG_RTC_INTF_ALARM_DEV=y
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+CONFIG_RTC_HYM8563=y
+# CONFIG_RTC_M41T66 is not set
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_DS3232 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# CONFIG_RTC_DRV_ISL12022 is not set
+# CONFIG_RTC_DRV_X1205 is not set
+# CONFIG_RTC_DRV_PCF8563 is not set
+# CONFIG_RTC_DRV_PCF8583 is not set
+# CONFIG_RTC_DRV_M41T80 is not set
+# CONFIG_RTC_DRV_BQ32K is not set
+# CONFIG_RTC_DRV_S35390A is not set
+# CONFIG_RTC_DRV_S35392A is not set
+# CONFIG_RTC_DRV_FM3130 is not set
+# CONFIG_RTC_DRV_RX8581 is not set
+# CONFIG_RTC_DRV_RX8025 is not set
+# CONFIG_RTC_DRV_EM3027 is not set
+# CONFIG_RTC_DRV_RV3029C2 is not set
+
+#
+# SPI RTC drivers
+#
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_MSM6242 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_RP5C01 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+# CONFIG_DMADEVICES is not set
+# CONFIG_AUXDISPLAY is not set
+# CONFIG_UIO is not set
+CONFIG_STAGING=y
+# CONFIG_VIDEO_TM6000 is not set
+# CONFIG_USBIP_CORE is not set
+# CONFIG_ECHO is not set
+# CONFIG_BRCMUTIL is not set
+# CONFIG_ASUS_OLED is not set
+# CONFIG_R8712U is not set
+# CONFIG_TRANZPORT is not set
+
+#
+# Android
+#
+CONFIG_ANDROID=y
+CONFIG_ANDROID_BINDER_IPC=y
+CONFIG_ANDROID_LOGGER=y
+CONFIG_ANDROID_RAM_CONSOLE=y
+CONFIG_ANDROID_RAM_CONSOLE_ENABLE_VERBOSE=y
+CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION=y
+CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION_DATA_SIZE=128
+CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION_ECC_SIZE=16
+CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION_SYMBOL_SIZE=8
+CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION_POLYNOMIAL=0x11d
+# CONFIG_ANDROID_RAM_CONSOLE_EARLY_INIT is not set
+CONFIG_ANDROID_TIMED_OUTPUT=y
+CONFIG_ANDROID_TIMED_GPIO=y
+CONFIG_ANDROID_LOW_MEMORY_KILLER=y
+# CONFIG_POHMELFS is not set
+# CONFIG_USB_SERIAL_QUATECH2 is not set
+# CONFIG_USB_SERIAL_QUATECH_USB2 is not set
+# CONFIG_VT6656 is not set
+# CONFIG_IIO is not set
+
+#
+# GPU Vivante
+#
+CONFIG_VIVANTE=y
+
+#
+# IPP
+#
+CONFIG_RK29_IPP=y
+CONFIG_DEINTERLACE=y
+# CONFIG_XVMALLOC is not set
+# CONFIG_ZRAM is not set
+# CONFIG_FB_SM7XX is not set
+# CONFIG_LIRC_STAGING is not set
+CONFIG_MACH_NO_WESTBRIDGE=y
+# CONFIG_USB_ENESTORAGE is not set
+# CONFIG_BCM_WIMAX is not set
+# CONFIG_FT1000 is not set
+
+#
+# Speakup console speech
+#
+# CONFIG_SPEAKUP is not set
+# CONFIG_TOUCHSCREEN_CLEARPAD_TM1217 is not set
+# CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set
+
+#
+# Altera FPGA firmware download module
+#
+# CONFIG_ALTERA_STAPL is not set
+CONFIG_CLKDEV_LOOKUP=y
+
+#
+# CMMB
+#
+# CONFIG_CMMB is not set
+# CONFIG_TEST_CODE is not set
+# CONFIG_RK29_SMC is not set
+
+#
+# CIR support
+#
+# CONFIG_RK_CIR is not set
+
+#
+# File systems
+#
+# CONFIG_EXT2_FS is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_DEFAULTS_TO_ORDERED=y
+# CONFIG_EXT3_FS_XATTR is not set
+CONFIG_EXT4_FS=y
+CONFIG_EXT4_USE_FOR_EXT23=y
+# CONFIG_EXT4_FS_XATTR is not set
+# CONFIG_EXT4_DEBUG is not set
+CONFIG_JBD=y
+CONFIG_JBD2=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_BTRFS_FS is not set
+# CONFIG_NILFS2_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+CONFIG_FILE_LOCKING=y
+CONFIG_FSNOTIFY=y
+# CONFIG_DNOTIFY is not set
+CONFIG_INOTIFY_USER=y
+# CONFIG_FANOTIFY is not set
+# CONFIG_QUOTA is not set
+# CONFIG_QUOTACTL is not set
+# CONFIG_AUTOFS4_FS is not set
+CONFIG_FUSE_FS=y
+# CONFIG_CUSE is not set
+
+#
+# Caches
+#
+# CONFIG_FSCACHE is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+# CONFIG_MSDOS_FS is not set
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_TMPFS_XATTR is not set
+# CONFIG_HUGETLB_PAGE is not set
+# CONFIG_CONFIGFS_FS is not set
+CONFIG_MISC_FILESYSTEMS=y
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_YAFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
+# CONFIG_LOGFS is not set
+CONFIG_CRAMFS=y
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_PSTORE is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_NETWORK_FILESYSTEMS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+CONFIG_NLS_CODEPAGE_850=y
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+CONFIG_NLS_CODEPAGE_936=y
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
+CONFIG_NLS_ISO8859_1=y
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+CONFIG_NLS_ISO8859_15=y
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+CONFIG_NLS_UTF8=y
+
+#
+# Kernel hacking
+#
+CONFIG_PRINTK_TIME=y
+CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=1024
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_STRIP_ASM_SYMS is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_SECTION_MISMATCH is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+# CONFIG_LOCKUP_DETECTOR is not set
+# CONFIG_HARDLOCKUP_DETECTOR is not set
+CONFIG_DETECT_HUNG_TASK=y
+CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120
+# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
+CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0
+# CONFIG_SCHED_DEBUG is not set
+CONFIG_SCHEDSTATS=y
+CONFIG_TIMER_STATS=y
+# CONFIG_DEBUG_OBJECTS is not set
+# CONFIG_DEBUG_SLAB is not set
+# CONFIG_DEBUG_KMEMLEAK is not set
+# CONFIG_DEBUG_PREEMPT is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_SPARSE_RCU_POINTER is not set
+# CONFIG_LOCK_STAT is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+CONFIG_STACKTRACE=y
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_HIGHMEM is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
+# CONFIG_DEBUG_MEMORY_INIT is not set
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_TEST_LIST_SORT is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
+# CONFIG_DEBUG_CREDENTIALS is not set
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+CONFIG_RCU_CPU_STALL_TIMEOUT=60
+CONFIG_RCU_CPU_STALL_VERBOSE=y
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_LATENCYTOP is not set
+# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+# CONFIG_DEBUG_PAGEALLOC is not set
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_TRACING_SUPPORT=y
+# CONFIG_FTRACE is not set
+# CONFIG_DMA_API_DEBUG is not set
+# CONFIG_ATOMIC64_SELFTEST is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
+# CONFIG_TEST_KSTRTOX is not set
+# CONFIG_STRICT_DEVMEM is not set
+CONFIG_ARM_UNWIND=y
+# CONFIG_DEBUG_USER is not set
+# CONFIG_DEBUG_LL is not set
+# CONFIG_OC_ETM is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY_DMESG_RESTRICT is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+CONFIG_DEFAULT_SECURITY_DAC=y
+CONFIG_DEFAULT_SECURITY=""
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_PCOMP2=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
+# CONFIG_CRYPTO_GF128MUL is not set
+# CONFIG_CRYPTO_NULL is not set
+CONFIG_CRYPTO_WORKQUEUE=y
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+CONFIG_CRYPTO_ECB=y
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_XCBC is not set
+# CONFIG_CRYPTO_VMAC is not set
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=y
+# CONFIG_CRYPTO_GHASH is not set
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+CONFIG_CRYPTO_SHA1=y
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+CONFIG_CRYPTO_AES=y
+# CONFIG_CRYPTO_ANUBIS is not set
+CONFIG_CRYPTO_ARC4=y
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+CONFIG_CRYPTO_DES=y
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+CONFIG_CRYPTO_TWOFISH=y
+CONFIG_CRYPTO_TWOFISH_COMMON=y
+
+#
+# Compression
+#
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_ZLIB is not set
+# CONFIG_CRYPTO_LZO is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+# CONFIG_CRYPTO_USER_API_HASH is not set
+# CONFIG_CRYPTO_USER_API_SKCIPHER is not set
+CONFIG_CRYPTO_HW=y
+# CONFIG_BINARY_PRINTF is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_CRC_CCITT=y
+CONFIG_CRC16=y
+# CONFIG_CRC_T10DIF is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+CONFIG_LIBCRC32C=y
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+# CONFIG_XZ_DEC is not set
+# CONFIG_XZ_DEC_BCJ is not set
+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
+CONFIG_NLATTR=y
+# CONFIG_AVERAGE is not set
help
Support for the ROCKCHIP Board For Rk29 Winaccord.
+config MACH_RK29_K97
+ depends on ARCH_RK29
+ bool "ROCKCHIP Board Rk29 For K97"
+ help
+ Support for the ROCKCHIP Board For Rk29 K97.
+
config MACH_RK29FIH
depends on ARCH_RK29
bool "ROCKCHIP Board Rk29 For FIH"
obj-$(CONFIG_MACH_RK29_A22) += board-rk29-a22.o board-rk29-a22-key.o board-rk29-a22-rfkill.o
obj-$(CONFIG_MACH_RK29_PHONEPADSDK) += board-rk29phonepadsdk.o board-rk29phonepadsdk-key.o board-rk29phonepadsdk-rfkill.o board-rk29phonepadsdk-power.o
obj-$(CONFIG_MACH_RK29_newton) += board-rk29-newton.o board-rk29-newton-key.o board-newton-rfkill.o board-rk29sdk-power.o
+obj-$(CONFIG_MACH_RK29_K97) += board-rk29-k97.o board-rk29k97-key.o board-rk29sdk-rfkill.o board-rk29sdk-power.o
--- /dev/null
+/* arch/arm/mach-rk29/board-rk29.c
+ *
+ * Copyright (C) 2010 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.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/input.h>
+#include <linux/io.h>
+#include <linux/delay.h>
+#include <linux/i2c.h>
+#include <linux/skbuff.h>
+#include <linux/spi/spi.h>
+#include <linux/mmc/host.h>
+#include <linux/android_pmem.h>
+#ifdef CONFIG_USB_ANDROID
+#include <linux/usb/android_composite.h>
+#endif
+
+#include <mach/hardware.h>
+#include <asm/setup.h>
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/mach/flash.h>
+#include <asm/hardware/gic.h>
+
+#include <mach/iomux.h>
+#include <mach/gpio.h>
+#include <mach/irqs.h>
+#include <mach/rk29_iomap.h>
+#include <mach/board.h>
+#include <mach/rk29_nand.h>
+#include <mach/rk29_camera.h> /* ddl@rock-chips.com : camera support */
+#include <media/soc_camera.h> /* ddl@rock-chips.com : camera support */
+#include <mach/vpu_mem.h>
+#include <mach/sram.h>
+#include <mach/ddr.h>
+#include <mach/cpufreq.h>
+#include <mach/rk29_smc.h>
+
+#include <linux/regulator/rk29-pwm-regulator.h>
+#include <linux/regulator/machine.h>
+
+#include <linux/regulator/act8891.h>
+
+#include <linux/mtd/nand.h>
+#include <linux/mtd/partitions.h>
+#include <linux/i2c-gpio.h>
+
+#include "devices.h"
+#include "../../../drivers/input/touchscreen/xpt2046_cbn_ts.h"
+
+#ifdef CONFIG_BU92747GUW_CIR
+#include "../../../drivers/cir/bu92747guw_cir.h"
+#endif
+#ifdef CONFIG_VIDEO_RK29
+/*---------------- Camera Sensor Macro Define Begin ------------------------*/
+/*---------------- Camera Sensor Configuration Macro Begin ------------------------*/
+#define CONFIG_SENSOR_0 RK29_CAM_SENSOR_OV5642 /* back camera sensor */
+#define CONFIG_SENSOR_IIC_ADDR_0 0x78
+#define CONFIG_SENSOR_IIC_ADAPTER_ID_0 1
+#define CONFIG_SENSOR_POWER_PIN_0 INVALID_GPIO
+#define CONFIG_SENSOR_RESET_PIN_0 INVALID_GPIO
+#define CONFIG_SENSOR_POWERDN_PIN_0 RK29_PIN6_PB7
+#define CONFIG_SENSOR_FALSH_PIN_0 INVALID_GPIO
+#define CONFIG_SENSOR_POWERACTIVE_LEVEL_0 RK29_CAM_POWERACTIVE_L
+#define CONFIG_SENSOR_RESETACTIVE_LEVEL_0 RK29_CAM_RESETACTIVE_L
+#define CONFIG_SENSOR_POWERDNACTIVE_LEVEL_0 RK29_CAM_POWERDNACTIVE_H
+#define CONFIG_SENSOR_FLASHACTIVE_LEVEL_0 RK29_CAM_FLASHACTIVE_L
+
+#define CONFIG_SENSOR_1 RK29_CAM_SENSOR_OV2659 /* front camera sensor */
+#define CONFIG_SENSOR_IIC_ADDR_1 0x60
+#define CONFIG_SENSOR_IIC_ADAPTER_ID_1 1
+#define CONFIG_SENSOR_POWER_PIN_1 INVALID_GPIO
+#define CONFIG_SENSOR_RESET_PIN_1 INVALID_GPIO
+#define CONFIG_SENSOR_POWERDN_PIN_1 RK29_PIN5_PD7
+#define CONFIG_SENSOR_FALSH_PIN_1 INVALID_GPIO
+#define CONFIG_SENSOR_POWERACTIVE_LEVEL_1 RK29_CAM_POWERACTIVE_L
+#define CONFIG_SENSOR_RESETACTIVE_LEVEL_1 RK29_CAM_RESETACTIVE_L
+#define CONFIG_SENSOR_POWERDNACTIVE_LEVEL_1 RK29_CAM_POWERDNACTIVE_H
+#define CONFIG_SENSOR_FLASHACTIVE_LEVEL_1 RK29_CAM_FLASHACTIVE_L
+#endif //#ifdef CONFIG_VIDEO_RK29
+/*---------------- Camera Sensor Configuration Macro End------------------------*/
+#include "../../../drivers/media/video/rk29_camera.c"
+/*---------------- Camera Sensor Macro Define End ------------------------*/
+
+
+/* Set memory size of pmem */
+#ifdef CONFIG_RK29_MEM_SIZE_M
+#define SDRAM_SIZE (CONFIG_RK29_MEM_SIZE_M * SZ_1M)
+#else
+#define SDRAM_SIZE SZ_512M
+#endif
+#define PMEM_GPU_SIZE SZ_16M
+#define PMEM_UI_SIZE (48 * SZ_1M) /* 1280x800: 64M 1024x768: 48M ... */
+#define PMEM_VPU_SIZE SZ_64M
+#define PMEM_SKYPE_SIZE 0
+#define PMEM_CAM_SIZE PMEM_CAM_NECESSARY
+#ifdef CONFIG_VIDEO_RK29_WORK_IPP
+#define MEM_CAMIPP_SIZE PMEM_CAMIPP_NECESSARY
+#else
+#define MEM_CAMIPP_SIZE 0
+#endif
+#define MEM_FB_SIZE (9*SZ_1M)
+#ifdef CONFIG_FB_WORK_IPP
+#ifdef CONFIG_FB_SCALING_OSD_1080P
+#define MEM_FBIPP_SIZE SZ_16M //1920 x 1080 x 2 x 2 //RGB565 = x2;RGB888 = x4
+#else
+#define MEM_FBIPP_SIZE SZ_8M //1920 x 1080 x 2 x 2 //RGB565 = x2;RGB888 = x4
+#endif
+#else
+#define MEM_FBIPP_SIZE 0
+#endif
+#if SDRAM_SIZE > SZ_512M
+#define PMEM_GPU_BASE (RK29_SDRAM_PHYS + SZ_512M - PMEM_GPU_SIZE)
+#else
+#define PMEM_GPU_BASE (RK29_SDRAM_PHYS + SDRAM_SIZE - PMEM_GPU_SIZE)
+#endif
+#define PMEM_UI_BASE (PMEM_GPU_BASE - PMEM_UI_SIZE)
+#define PMEM_VPU_BASE (PMEM_UI_BASE - PMEM_VPU_SIZE)
+#define PMEM_CAM_BASE (PMEM_VPU_BASE - PMEM_CAM_SIZE)
+#define MEM_CAMIPP_BASE (PMEM_CAM_BASE - MEM_CAMIPP_SIZE)
+#define MEM_FB_BASE (MEM_CAMIPP_BASE - MEM_FB_SIZE)
+#define MEM_FBIPP_BASE (MEM_FB_BASE - MEM_FBIPP_SIZE)
+#define PMEM_SKYPE_BASE (MEM_FBIPP_BASE - PMEM_SKYPE_SIZE)
+#define LINUX_SIZE (PMEM_SKYPE_BASE - RK29_SDRAM_PHYS)
+
+#define PREALLOC_WLAN_SEC_NUM 4
+#define PREALLOC_WLAN_BUF_NUM 160
+#define PREALLOC_WLAN_SECTION_HEADER 24
+
+#define WLAN_SECTION_SIZE_0 (PREALLOC_WLAN_BUF_NUM * 128)
+#define WLAN_SECTION_SIZE_1 (PREALLOC_WLAN_BUF_NUM * 128)
+#define WLAN_SECTION_SIZE_2 (PREALLOC_WLAN_BUF_NUM * 512)
+#define WLAN_SECTION_SIZE_3 (PREALLOC_WLAN_BUF_NUM * 1024)
+
+#define WLAN_SKB_BUF_NUM 16
+
+static struct sk_buff *wlan_static_skb[WLAN_SKB_BUF_NUM];
+
+struct wifi_mem_prealloc {
+ void *mem_ptr;
+ unsigned long size;
+};
+
+extern struct sys_timer rk29_timer;
+
+static int rk29_nand_io_init(void)
+{
+ return 0;
+}
+
+struct rk29_nand_platform_data rk29_nand_data = {
+ .width = 1, /* data bus width in bytes */
+ .hw_ecc = 1, /* hw ecc 0: soft ecc */
+ .num_flash = 1,
+ .io_init = rk29_nand_io_init,
+};
+
+#define TOUCH_SCREEN_STANDBY_PIN RK29_PIN6_PD1
+#define TOUCH_SCREEN_STANDBY_VALUE GPIO_HIGH
+#define TOUCH_SCREEN_DISPLAY_PIN INVALID_GPIO
+#define TOUCH_SCREEN_DISPLAY_VALUE GPIO_HIGH
+
+#ifdef CONFIG_FB_RK29
+/*****************************************************************************************
+ * lcd devices
+ * author: zyw@rock-chips.com
+ *****************************************************************************************/
+//#ifdef CONFIG_LCD_TD043MGEA1
+#define LCD_TXD_PIN INVALID_GPIO
+#define LCD_CLK_PIN INVALID_GPIO
+#define LCD_CS_PIN INVALID_GPIO
+/*****************************************************************************************
+* frame buffe devices
+* 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_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
+
+static int rk29_lcd_io_init(void)
+{
+ int ret = 0;
+ return ret;
+}
+
+static int rk29_lcd_io_deinit(void)
+{
+ int ret = 0;
+ return ret;
+}
+
+static struct rk29lcd_info rk29_lcd_info = {
+ .txd_pin = LCD_TXD_PIN,
+ .clk_pin = LCD_CLK_PIN,
+ .cs_pin = LCD_CS_PIN,
+ .io_init = rk29_lcd_io_init,
+ .io_deinit = rk29_lcd_io_deinit,
+};
+
+int rk29_fb_io_enable(void)
+{
+ if(FB_DISPLAY_ON_PIN != INVALID_GPIO)
+ {
+ gpio_direction_output(FB_DISPLAY_ON_PIN, 0);
+ gpio_set_value(FB_DISPLAY_ON_PIN, FB_DISPLAY_ON_VALUE);
+ }
+ if(FB_LCD_STANDBY_PIN != INVALID_GPIO)
+ {
+ gpio_direction_output(FB_LCD_STANDBY_PIN, 0);
+ gpio_set_value(FB_LCD_STANDBY_PIN, FB_LCD_STANDBY_VALUE);
+ }
+ return 0;
+}
+
+int rk29_fb_io_disable(void)
+{
+ if(FB_DISPLAY_ON_PIN != INVALID_GPIO)
+ {
+ gpio_direction_output(FB_DISPLAY_ON_PIN, 0);
+ gpio_set_value(FB_DISPLAY_ON_PIN, !FB_DISPLAY_ON_VALUE);
+ }
+ if(FB_LCD_STANDBY_PIN != INVALID_GPIO)
+ {
+ gpio_direction_output(FB_LCD_STANDBY_PIN, 0);
+ gpio_set_value(FB_LCD_STANDBY_PIN, !FB_LCD_STANDBY_VALUE);
+ }
+ return 0;
+}
+
+static int rk29_fb_io_init(struct rk29_fb_setting_info *fb_setting)
+{
+ int ret = 0;
+ if(fb_setting->mcu_fmk_en && (FB_MCU_FMK_PIN != INVALID_GPIO))
+ {
+ ret = gpio_request(FB_MCU_FMK_PIN, NULL);
+ if(ret != 0)
+ {
+ gpio_free(FB_MCU_FMK_PIN);
+ printk(">>>>>> FB_MCU_FMK_PIN gpio_request err \n ");
+ }
+ gpio_direction_input(FB_MCU_FMK_PIN);
+ }
+ if(fb_setting->disp_on_en)
+ {
+ if(FB_DISPLAY_ON_PIN != INVALID_GPIO)
+ {
+ ret = gpio_request(FB_DISPLAY_ON_PIN, NULL);
+ if(ret != 0)
+ {
+ gpio_free(FB_DISPLAY_ON_PIN);
+ printk(">>>>>> FB_DISPLAY_ON_PIN gpio_request err \n ");
+ }
+ }
+ else if (TOUCH_SCREEN_DISPLAY_PIN != INVALID_GPIO)
+ {
+ ret = gpio_request(TOUCH_SCREEN_DISPLAY_PIN, NULL);
+ if(ret != 0)
+ {
+ gpio_free(TOUCH_SCREEN_DISPLAY_PIN);
+ printk(">>>>>> TOUCH_SCREEN_DISPLAY_PIN gpio_request err \n ");
+ }
+ gpio_direction_output(TOUCH_SCREEN_DISPLAY_PIN, 0);
+ gpio_set_value(TOUCH_SCREEN_DISPLAY_PIN, TOUCH_SCREEN_DISPLAY_VALUE);
+ }
+ }
+
+ if(fb_setting->disp_on_en)
+ {
+ if(FB_LCD_STANDBY_PIN != INVALID_GPIO)
+ {
+ ret = gpio_request(FB_LCD_STANDBY_PIN, NULL);
+ if(ret != 0)
+ {
+ gpio_free(FB_LCD_STANDBY_PIN);
+ printk(">>>>>> FB_LCD_STANDBY_PIN gpio_request err \n ");
+ }
+ }
+ else if (TOUCH_SCREEN_STANDBY_PIN != INVALID_GPIO)
+ {
+ ret = gpio_request(TOUCH_SCREEN_STANDBY_PIN, NULL);
+ if(ret != 0)
+ {
+ gpio_free(TOUCH_SCREEN_STANDBY_PIN);
+ printk(">>>>>> TOUCH_SCREEN_STANDBY_PIN gpio_request err \n ");
+ }
+ gpio_direction_output(TOUCH_SCREEN_STANDBY_PIN, 0);
+ gpio_set_value(TOUCH_SCREEN_STANDBY_PIN, TOUCH_SCREEN_STANDBY_VALUE);
+ }
+ }
+
+ if(FB_LCD_CABC_EN_PIN != INVALID_GPIO)
+ {
+ ret = gpio_request(FB_LCD_CABC_EN_PIN, NULL);
+ if(ret != 0)
+ {
+ gpio_free(FB_LCD_CABC_EN_PIN);
+ printk(">>>>>> FB_LCD_CABC_EN_PIN gpio_request err \n ");
+ }
+ gpio_direction_output(FB_LCD_CABC_EN_PIN, 0);
+ gpio_set_value(FB_LCD_CABC_EN_PIN, GPIO_LOW);
+ }
+
+ rk29_fb_io_enable(); //enable it
+
+ return ret;
+}
+
+
+static struct rk29fb_info rk29_fb_info = {
+ .fb_id = FB_ID,
+ .mcu_fmk_pin = FB_MCU_FMK_PIN,
+ .lcd_info = &rk29_lcd_info,
+ .io_init = rk29_fb_io_init,
+ .io_enable = rk29_fb_io_enable,
+ .io_disable = rk29_fb_io_disable,
+};
+
+/* rk29 fb resource */
+static struct resource rk29_fb_resource[] = {
+ [0] = {
+ .name = "lcdc reg",
+ .start = RK29_LCDC_PHYS,
+ .end = RK29_LCDC_PHYS + RK29_LCDC_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .name = "lcdc irq",
+ .start = IRQ_LCDC,
+ .end = IRQ_LCDC,
+ .flags = IORESOURCE_IRQ,
+ },
+ [2] = {
+ .name = "win1 buf",
+ .start = MEM_FB_BASE,
+ .end = MEM_FB_BASE + MEM_FB_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ #ifdef CONFIG_FB_WORK_IPP
+ [3] = {
+ .name = "win1 ipp buf",
+ .start = MEM_FBIPP_BASE,
+ .end = MEM_FBIPP_BASE + MEM_FBIPP_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ #endif
+};
+
+/*platform_device*/
+struct platform_device rk29_device_fb = {
+ .name = "rk29-fb",
+ .id = 4,
+ .num_resources = ARRAY_SIZE(rk29_fb_resource),
+ .resource = rk29_fb_resource,
+ .dev = {
+ .platform_data = &rk29_fb_info,
+ }
+};
+
+struct platform_device rk29_device_dma_cpy = {
+ .name = "dma_memcpy",
+ .id = 4,
+
+};
+
+#endif
+
+#if defined(CONFIG_RK29_GPIO_SUSPEND)
+static void key_gpio_pullupdown_enable(void)
+{
+ gpio_pull_updown(RK29_PIN6_PA0, 0);
+ gpio_pull_updown(RK29_PIN6_PA1, 0);
+ gpio_pull_updown(RK29_PIN6_PA2, 0);
+ gpio_pull_updown(RK29_PIN6_PA3, 0);
+ gpio_pull_updown(RK29_PIN6_PA4, 0);
+ gpio_pull_updown(RK29_PIN6_PA5, 0);
+ gpio_pull_updown(RK29_PIN6_PA6, 0);
+}
+
+static void key_gpio_pullupdown_disable(void)
+{
+ gpio_pull_updown(RK29_PIN6_PA0, 1);
+ gpio_pull_updown(RK29_PIN6_PA1, 1);
+ gpio_pull_updown(RK29_PIN6_PA2, 1);
+ gpio_pull_updown(RK29_PIN6_PA3, 1);
+ gpio_pull_updown(RK29_PIN6_PA4, 1);
+ gpio_pull_updown(RK29_PIN6_PA5, 1);
+ gpio_pull_updown(RK29_PIN6_PA6, 1);
+}
+
+void rk29_setgpio_suspend_board(void)
+{
+ key_gpio_pullupdown_enable();
+}
+
+void rk29_setgpio_resume_board(void)
+{
+ key_gpio_pullupdown_disable();
+}
+#endif
+
+#if defined(CONFIG_RK_IRDA) || defined(CONFIG_BU92747GUW_CIR)
+#define BU92747GUW_RESET_PIN RK29_PIN3_PD4// INVALID_GPIO //
+#define BU92747GUW_RESET_MUX_NAME GPIO3D4_HOSTWRN_NAME//NULL //
+#define BU92747GUW_RESET_MUX_MODE GPIO3H_GPIO3D4//NULL //
+
+#define BU92747GUW_PWDN_PIN RK29_PIN3_PD3//RK29_PIN5_PA7 //
+#define BU92747GUW_PWDN_MUX_NAME GPIO3D3_HOSTRDN_NAME//GPIO5A7_HSADCDATA2_NAME //
+#define BU92747GUW_PWDN_MUX_MODE GPIO3H_GPIO3D3//GPIO5L_GPIO5A7 //
+
+static int bu92747guw_io_init(void)
+{
+ int ret;
+
+ //reset pin
+ if(BU92747GUW_RESET_MUX_NAME != NULL)
+ {
+ rk29_mux_api_set(BU92747GUW_RESET_MUX_NAME, BU92747GUW_RESET_MUX_MODE);
+ }
+ ret = gpio_request(BU92747GUW_RESET_PIN, NULL);
+ if(ret != 0)
+ {
+ gpio_free(BU92747GUW_RESET_PIN);
+ printk(">>>>>> BU92747GUW_RESET_PIN gpio_request err \n ");
+ }
+ gpio_direction_output(BU92747GUW_RESET_PIN, GPIO_HIGH);
+
+ //power down pin
+ if(BU92747GUW_PWDN_MUX_NAME != NULL)
+ {
+ rk29_mux_api_set(BU92747GUW_PWDN_MUX_NAME, BU92747GUW_PWDN_MUX_MODE);
+ }
+ ret = gpio_request(BU92747GUW_PWDN_PIN, NULL);
+ if(ret != 0)
+ {
+ gpio_free(BU92747GUW_PWDN_PIN);
+ printk(">>>>>> BU92747GUW_PWDN_PIN gpio_request err \n ");
+ }
+
+ //power down as default
+ gpio_direction_output(BU92747GUW_PWDN_PIN, GPIO_LOW);
+
+ return 0;
+}
+
+
+static int bu92747guw_io_deinit(void)
+{
+ gpio_free(BU92747GUW_PWDN_PIN);
+ gpio_free(BU92747GUW_RESET_PIN);
+ return 0;
+}
+
+//power ctl func is share with irda and remote
+static int nPowerOnCount = 0;
+static DEFINE_MUTEX(bu92747_power_mutex);
+
+//1---power on; 0---power off
+static int bu92747guw_power_ctl(int enable)
+{
+ printk("%s \n",__FUNCTION__);
+
+ mutex_lock(&bu92747_power_mutex);
+ if (enable) {
+ nPowerOnCount++;
+ if (nPowerOnCount == 1) {//power on first
+ //smc0_init(NULL);
+ gpio_set_value(BU92747GUW_PWDN_PIN, GPIO_HIGH);
+ gpio_set_value(BU92747GUW_RESET_PIN, GPIO_LOW);
+ mdelay(5);
+ gpio_set_value(BU92747GUW_RESET_PIN, GPIO_HIGH);
+ mdelay(5);
+ }
+ }
+ else {
+ nPowerOnCount--;
+ if (nPowerOnCount <= 0) {//power down final
+ nPowerOnCount = 0;
+ //smc0_exit();
+ gpio_set_value(BU92747GUW_PWDN_PIN, GPIO_LOW);
+ }
+ }
+ mutex_unlock(&bu92747_power_mutex);
+ return 0;
+}
+#endif
+
+#ifdef CONFIG_RK_IRDA
+#define IRDA_IRQ_PIN RK29_PIN5_PB2
+#define IRDA_IRQ_MUX_NAME GPIO5B2_HSADCDATA5_NAME
+#define IRDA_IRQ_MUX_MODE GPIO5L_GPIO5B2
+
+int irda_iomux_init(void)
+{
+ int ret = 0;
+
+ //irda irq pin
+ if(IRDA_IRQ_MUX_NAME != NULL)
+ {
+ rk29_mux_api_set(IRDA_IRQ_MUX_NAME, IRDA_IRQ_MUX_MODE);
+ }
+ ret = gpio_request(IRDA_IRQ_PIN, NULL);
+ if(ret != 0)
+ {
+ gpio_free(IRDA_IRQ_PIN);
+ printk(">>>>>> IRDA_IRQ_PIN gpio_request err \n ");
+ }
+ gpio_pull_updown(IRDA_IRQ_PIN, GPIO_HIGH);
+ gpio_direction_input(IRDA_IRQ_PIN);
+
+ return 0;
+}
+
+int irda_iomux_deinit(void)
+{
+ gpio_free(IRDA_IRQ_PIN);
+ return 0;
+}
+
+static struct irda_info rk29_irda_info = {
+ .intr_pin = IRDA_IRQ_PIN,
+ .iomux_init = irda_iomux_init,
+ .iomux_deinit = irda_iomux_deinit,
+ .irda_pwr_ctl = bu92747guw_power_ctl,
+};
+
+static struct platform_device irda_device = {
+#ifdef CONFIG_RK_IRDA_NET
+ .name = "rk_irda",
+#else
+ .name = "bu92747_irda",
+#endif
+ .id = -1,
+ .dev = {
+ .platform_data = &rk29_irda_info,
+ }
+};
+#endif
+
+#ifdef CONFIG_BU92747GUW_CIR
+#define BU92747_CIR_IRQ_PIN RK29_PIN5_PB0
+#define CIR_IRQ_PIN_IOMUX_NAME GPIO5B0_HSADCDATA3_NAME
+#define CIR_IRQ_PIN_IOMUX_VALUE GPIO5L_GPIO5B0
+static int cir_iomux_init(void)
+{
+ if (CIR_IRQ_PIN_IOMUX_NAME)
+ rk29_mux_api_set(CIR_IRQ_PIN_IOMUX_NAME, CIR_IRQ_PIN_IOMUX_VALUE);
+ rk29_mux_api_set(GPIO5A7_HSADCDATA2_NAME, GPIO5L_GPIO5A7);
+ return 0;
+}
+
+static struct bu92747guw_platform_data bu92747guw_pdata = {
+ .intr_pin = BU92747_CIR_IRQ_PIN,
+ .iomux_init = cir_iomux_init,
+ .iomux_deinit = NULL,
+ .cir_pwr_ctl = bu92747guw_power_ctl,
+};
+#endif
+#ifdef CONFIG_RK29_NEWTON
+struct rk29_newton_data rk29_newton_info = {
+};
+struct platform_device rk29_device_newton = {
+ .name = "rk29_newton",
+ .id = -1,
+ .dev = {
+ .platform_data = &rk29_newton_info,
+ }
+ };
+#endif
+#if defined (CONFIG_TOUCHSCREEN_FT5406)
+#define TOUCH_RESET_PIN RK29_PIN6_PC3
+#define TOUCH_INT_PIN RK29_PIN0_PA2
+int ft5406_init_platform_hw(void)
+{
+ printk("ft5406_init_platform_hw\n");
+ if(gpio_request(TOUCH_RESET_PIN,NULL) != 0){
+ gpio_free(TOUCH_RESET_PIN);
+ printk("ft5406_init_platform_hw gpio_request error\n");
+ return -EIO;
+ }
+
+ if(gpio_request(TOUCH_INT_PIN,NULL) != 0){
+ gpio_free(TOUCH_INT_PIN);
+ printk("ift5406_init_platform_hw gpio_request error\n");
+ return -EIO;
+ }
+
+ gpio_direction_output(TOUCH_RESET_PIN, 0);
+ gpio_set_value(TOUCH_RESET_PIN,GPIO_LOW);
+ mdelay(10);
+ gpio_direction_input(TOUCH_INT_PIN);
+ mdelay(10);
+ gpio_set_value(TOUCH_RESET_PIN,GPIO_HIGH);
+ msleep(300);
+ return 0;
+}
+
+void ft5406_exit_platform_hw(void)
+{
+ printk("ft5406_exit_platform_hw\n");
+ gpio_free(TOUCH_RESET_PIN);
+ gpio_free(TOUCH_INT_PIN);
+}
+
+int ft5406_platform_sleep(void)
+{
+ printk("ft5406_platform_sleep\n");
+ gpio_set_value(TOUCH_RESET_PIN,GPIO_LOW);
+ return 0;
+}
+
+int ft5406_platform_wakeup(void)
+{
+ printk("ft5406_platform_wakeup\n");
+ gpio_set_value(TOUCH_RESET_PIN,GPIO_HIGH);
+ msleep(300);
+ return 0;
+}
+
+struct ft5406_platform_data ft5406_info = {
+
+ .init_platform_hw= ft5406_init_platform_hw,
+ .exit_platform_hw= ft5406_exit_platform_hw,
+ .platform_sleep = ft5406_platform_sleep,
+ .platform_wakeup = ft5406_platform_wakeup,
+
+};
+#endif
+
+#if defined(CONFIG_TOUCHSCREEN_GT819)
+#define TOUCH_RESET_PIN RK29_PIN6_PC3
+#define TOUCH_INT_PIN RK29_PIN0_PA2
+int gt819_init_platform_hw(void)
+{
+ printk("gt819_init_platform_hw\n");
+ if(gpio_request(TOUCH_RESET_PIN,NULL) != 0){
+ gpio_free(TOUCH_RESET_PIN);
+ printk("gt819_init_platform_hw gpio_request error\n");
+ return -EIO;
+ }
+
+ if(gpio_request(TOUCH_INT_PIN,NULL) != 0){
+ gpio_free(TOUCH_INT_PIN);
+ printk("gt819_init_platform_hw gpio_request error\n");
+ return -EIO;
+ }
+ gpio_direction_output(TOUCH_RESET_PIN, 0);
+ gpio_set_value(TOUCH_RESET_PIN,GPIO_LOW);
+ mdelay(10);
+// gpio_set_value(TOUCH_RESET_PIN,GPIO_HIGH);
+// mdelay(10);
+// gpio_set_value(TOUCH_RESET_PIN,GPIO_LOW);
+ gpio_direction_input(TOUCH_INT_PIN);
+// mdelay(10);
+ gpio_set_value(TOUCH_RESET_PIN,GPIO_HIGH);
+ msleep(300);
+ return 0;
+}
+
+
+void gt819_exit_platform_hw(void)
+{
+ printk("gt819_exit_platform_hw\n");
+ gpio_free(TOUCH_RESET_PIN);
+ gpio_free(TOUCH_INT_PIN);
+}
+
+int gt819_platform_sleep(void)
+{
+ printk("gt819_platform_sleep\n");
+ gpio_set_value(TOUCH_RESET_PIN,GPIO_LOW);
+ return 0;
+}
+
+int gt819_platform_wakeup(void)
+{
+ printk("gt819_platform_wakeup\n");
+ gpio_set_value(TOUCH_RESET_PIN,GPIO_HIGH);
+ //msleep(5);
+ //gpio_set_value(TOUCH_INT_PIN, GPIO_LOW);
+ //msleep(20);
+ //gpio_set_value(TOUCH_INT_PIN, GPIO_HIGH);
+ return 0;
+}
+struct goodix_platform_data goodix_info = {
+
+ .init_platform_hw= gt819_init_platform_hw,
+ .exit_platform_hw= gt819_exit_platform_hw,
+ .platform_sleep = gt819_platform_sleep,
+ .platform_wakeup = gt819_platform_wakeup,
+
+};
+#endif
+
+/*goodix touch*/
+#if defined(CONFIG_TOUCHSCREEN_GT8XX)
+#define TOUCH_RESET_PIN RK29_PIN6_PC3
+#define TOUCH_PWR_PIN RK29_PIN5_PA1
+int goodix_init_platform_hw(void)
+{
+ int ret;
+ printk("goodix_init_platform_hw\n");
+ ret = gpio_request(TOUCH_PWR_PIN, "goodix power pin");
+ if(ret != 0){
+ gpio_free(TOUCH_PWR_PIN);
+ printk("goodix power error\n");
+ return -EIO;
+ }
+ gpio_direction_output(TOUCH_PWR_PIN, 0);
+ gpio_set_value(TOUCH_PWR_PIN,GPIO_LOW);
+ msleep(100);
+ ret = gpio_request(TOUCH_RESET_PIN, "goodix reset pin");
+ if(ret != 0){
+ gpio_free(TOUCH_RESET_PIN);
+ printk("goodix gpio_request error\n");
+ return -EIO;
+ }
+ gpio_direction_output(TOUCH_RESET_PIN, 0);
+ gpio_set_value(TOUCH_RESET_PIN,GPIO_LOW);
+ msleep(10);
+ gpio_set_value(TOUCH_RESET_PIN,GPIO_HIGH);
+ msleep(500);
+ return 0;
+}
+
+struct goodix_platform_data goodix_info = {
+ .model= 8105,
+ .rest_pin = TOUCH_RESET_PIN,
+ .init_platform_hw = goodix_init_platform_hw,
+};
+#endif
+
+#if defined (CONFIG_SND_SOC_CS42L52)
+
+int cs42l52_init_platform_hw()
+{
+ printk("cs42l52_init_platform_hw\n");
+ if(gpio_request(RK29_PIN6_PB6,NULL) != 0){
+ gpio_free(RK29_PIN6_PB6);
+ printk("cs42l52_init_platform_hw gpio_request error\n");
+ return -EIO;
+ }
+ gpio_direction_output(RK29_PIN6_PB6, 0);
+ gpio_set_value(RK29_PIN6_PB6,GPIO_HIGH);
+ return 0;
+}
+struct cs42l52_platform_data cs42l52_info = {
+
+ .init_platform_hw= cs42l52_init_platform_hw,
+
+};
+#endif
+#if defined (CONFIG_BATTERY_BQ27541)
+#define DC_CHECK_PIN RK29_PIN4_PA1
+#define LI_LION_BAT_NUM 1
+#define CHG_OK RK29_PIN4_PA3
+#define BAT_LOW RK29_PIN4_PA2
+
+static int bq27541_init_dc_check_pin(void){
+ if(gpio_request(DC_CHECK_PIN,"dc_check") != 0){
+ gpio_free(DC_CHECK_PIN);
+ printk("bq27541 init dc check pin request error\n");
+ return -EIO;
+ }
+ gpio_direction_input(DC_CHECK_PIN);
+ return 0;
+}
+
+struct bq27541_platform_data bq27541_info = {
+ .init_dc_check_pin = bq27541_init_dc_check_pin,
+ .dc_check_pin = DC_CHECK_PIN,
+ .bat_num = LI_LION_BAT_NUM,
+ .chgok_check_pin = CHG_OK,
+ .bat_check_pin = BAT_LOW,
+};
+#endif
+static struct android_pmem_platform_data android_pmem_pdata = {
+ .name = "pmem",
+ .start = PMEM_UI_BASE,
+ .size = PMEM_UI_SIZE,
+ .no_allocator = 1,
+ .cached = 1,
+};
+
+static struct platform_device android_pmem_device = {
+ .name = "android_pmem",
+ .id = 0,
+ .dev = {
+ .platform_data = &android_pmem_pdata,
+ },
+};
+
+
+static struct vpu_mem_platform_data vpu_mem_pdata = {
+ .name = "vpu_mem",
+ .start = PMEM_VPU_BASE,
+ .size = PMEM_VPU_SIZE,
+ .cached = 1,
+};
+
+static struct platform_device rk29_vpu_mem_device = {
+ .name = "vpu_mem",
+ .id = 2,
+ .dev = {
+ .platform_data = &vpu_mem_pdata,
+ },
+};
+
+#if PMEM_SKYPE_SIZE > 0
+static struct android_pmem_platform_data android_pmem_skype_pdata = {
+ .name = "pmem_skype",
+ .start = PMEM_SKYPE_BASE,
+ .size = PMEM_SKYPE_SIZE,
+ .no_allocator = 0,
+ .cached = 0,
+};
+
+static struct platform_device android_pmem_skype_device = {
+ .name = "android_pmem",
+ .id = 3,
+ .dev = {
+ .platform_data = &android_pmem_skype_pdata,
+ },
+};
+#endif
+
+#ifdef CONFIG_VIDEO_RK29XX_VOUT
+static struct platform_device rk29_v4l2_output_devce = {
+ .name = "rk29_vout",
+};
+#endif
+/*HANNSTAR_P1003 touch*/
+#if defined (CONFIG_HANNSTAR_P1003)
+#define TOUCH_RESET_PIN RK29_PIN6_PC3
+#define TOUCH_INT_PIN RK29_PIN0_PA2
+
+int p1003_init_platform_hw(void)
+{
+ if(gpio_request(TOUCH_RESET_PIN,NULL) != 0){
+ gpio_free(TOUCH_RESET_PIN);
+ printk("p1003_init_platform_hw gpio_request error\n");
+ return -EIO;
+ }
+
+ if(gpio_request(TOUCH_INT_PIN,NULL) != 0){
+ gpio_free(TOUCH_INT_PIN);
+ printk("p1003_init_platform_hw gpio_request error\n");
+ return -EIO;
+ }
+ gpio_pull_updown(TOUCH_INT_PIN, 1);
+ gpio_direction_output(TOUCH_RESET_PIN, 0);
+ msleep(500);
+ gpio_set_value(TOUCH_RESET_PIN,GPIO_LOW);
+ msleep(500);
+ gpio_set_value(TOUCH_RESET_PIN,GPIO_HIGH);
+
+ return 0;
+}
+
+
+struct p1003_platform_data p1003_info = {
+ .model= 1003,
+ .init_platform_hw= p1003_init_platform_hw,
+
+};
+#endif
+#if defined (CONFIG_EETI_EGALAX)
+#define TOUCH_RESET_PIN RK29_PIN6_PC3
+#define TOUCH_INT_PIN RK29_PIN0_PA2
+
+static int EETI_EGALAX_init_platform_hw(void)
+{
+ if(gpio_request(TOUCH_RESET_PIN,NULL) != 0){
+ gpio_free(TOUCH_RESET_PIN);
+ printk("p1003_init_platform_hw gpio_request error\n");
+ return -EIO;
+ }
+
+ if(gpio_request(TOUCH_INT_PIN,NULL) != 0){
+ gpio_free(TOUCH_INT_PIN);
+ printk("p1003_init_platform_hw gpio_request error\n");
+ return -EIO;
+ }
+ gpio_pull_updown(TOUCH_INT_PIN, 1);
+ gpio_direction_output(TOUCH_RESET_PIN, 0);
+ msleep(500);
+ gpio_set_value(TOUCH_RESET_PIN,GPIO_LOW);
+ msleep(500);
+ gpio_set_value(TOUCH_RESET_PIN,GPIO_HIGH);
+
+ return 0;
+}
+
+
+static struct eeti_egalax_platform_data eeti_egalax_info = {
+ .model= 1003,
+ .init_platform_hw= EETI_EGALAX_init_platform_hw,
+ .standby_pin = TOUCH_SCREEN_STANDBY_PIN,
+ .standby_value = TOUCH_SCREEN_STANDBY_VALUE,
+ .disp_on_pin = TOUCH_SCREEN_DISPLAY_PIN,
+ .disp_on_value = TOUCH_SCREEN_DISPLAY_VALUE,
+};
+#endif
+
+#ifdef CONFIG_GS_KXTF9
+#include <linux/kxtf9.h>
+#define KXTF9_DEVICE_MAP 1
+#define KXTF9_MAP_X (KXTF9_DEVICE_MAP-1)%2
+#define KXTF9_MAP_Y KXTF9_DEVICE_MAP%2
+#define KXTF9_NEG_X (KXTF9_DEVICE_MAP/2)%2
+#define KXTF9_NEG_Y (KXTF9_DEVICE_MAP+1)/4
+#define KXTF9_NEG_Z (KXTF9_DEVICE_MAP-1)/4
+struct kxtf9_platform_data kxtf9_pdata = {
+ .min_interval = 1,
+ .poll_interval = 20,
+ .g_range = KXTF9_G_2G,
+ .axis_map_x = KXTF9_MAP_X,
+ .axis_map_y = KXTF9_MAP_Y,
+ .axis_map_z = 2,
+ .negate_x = KXTF9_NEG_X,
+ .negate_y = KXTF9_NEG_Y,
+ .negate_z = KXTF9_NEG_Z,
+ //.ctrl_regc_init = KXTF9_G_2G | ODR50F,
+ //.ctrl_regb_init = ENABLE,
+};
+#endif /* CONFIG_GS_KXTF9 */
+
+
+/*MMA8452 gsensor*/
+#if defined (CONFIG_GS_MMA8452)
+#define MMA8452_INT_PIN RK29_PIN0_PA3
+
+static int mma8452_init_platform_hw(void)
+{
+
+ if(gpio_request(MMA8452_INT_PIN,NULL) != 0){
+ gpio_free(MMA8452_INT_PIN);
+ printk("mma8452_init_platform_hw gpio_request error\n");
+ return -EIO;
+ }
+ gpio_pull_updown(MMA8452_INT_PIN, 1);
+ return 0;
+}
+
+
+static struct mma8452_platform_data mma8452_info = {
+ .model= 8452,
+ .swap_xy = 1,
+ .init_platform_hw= mma8452_init_platform_hw,
+
+};
+#endif
+#if defined (CONFIG_MPU_SENSORS_MPU3050)
+/*mpu3050*/
+static struct mpu3050_platform_data mpu3050_data = {
+ .int_config = 0x10,
+ //.orientation = { 1, 0, 0,0, -1, 0,0, 0, 1 },
+ //.orientation = { 0, 1, 0,-1, 0, 0,0, 0, -1 },
+ //.orientation = { -1, 0, 0,0, -1, 0,0, 0, -1 },
+ .orientation = { 0, 1, 0, -1, 0, 0, 0, 0, 1 },
+ .level_shifter = 0,
+#if defined (CONFIG_MPU_SENSORS_KXTF9)
+ .accel = {
+#ifdef CONFIG_MPU_SENSORS_MPU3050_MODULE
+ .get_slave_descr = NULL ,
+#else
+ .get_slave_descr = get_accel_slave_descr ,
+#endif
+ .adapt_num = 0, // The i2c bus to which the mpu device is
+ // connected
+ //.irq = RK29_PIN0_PA3,
+ .bus = EXT_SLAVE_BUS_SECONDARY, //The secondary I2C of MPU
+ .address = 0x0f,
+ //.orientation = { 1, 0, 0,0, 1, 0,0, 0, 1 },
+ //.orientation = { 0, -1, 0,-1, 0, 0,0, 0, -1 },
+ //.orientation = { 0, 1, 0,1, 0, 0,0, 0, -1 },
+ .orientation = { 0, 1 ,0, -1 ,0, 0, 0, 0, 1 },
+ },
+#endif
+#if defined (CONFIG_MPU_SENSORS_AK8975)
+ .compass = {
+#ifdef CONFIG_MPU_SENSORS_MPU3050_MODULE
+ .get_slave_descr = NULL,/*ak5883_get_slave_descr,*/
+#else
+ .get_slave_descr = get_compass_slave_descr,
+#endif
+ .adapt_num = 0, // The i2c bus to which the compass device is.
+ // It can be difference with mpu
+ // connected
+ //.irq = RK29_PIN0_PA4,
+ .bus = EXT_SLAVE_BUS_PRIMARY,
+ .address = 0x0d,
+ //.orientation = { -1, 0, 0,0, -1, 0,0, 0, 1 },
+ //.orientation = { 0, -1, 0,-1, 0, 0,0, 0, -1 },
+ //.orientation = { 0, 1, 0,1, 0, 0,0, 0, -1 },
+ //.orientation = { 0, -1, 0, 1, 0, 0, 0, 0, 1 },
+ .orientation = { 0, 1, 0, -1, 0, 0, 0, 0, 1 },
+ },
+};
+#endif
+#endif
+#if defined (CONFIG_BATTERY_BQ27510)
+#define DC_CHECK_PIN RK29_PIN4_PA1
+#define LI_LION_BAT_NUM 2
+static int bq27510_init_dc_check_pin(void){
+ if(gpio_request(DC_CHECK_PIN,"dc_check") != 0){
+ gpio_free(DC_CHECK_PIN);
+ printk("bq27510 init dc check pin request error\n");
+ return -EIO;
+ }
+ gpio_direction_input(DC_CHECK_PIN);
+ return 0;
+}
+
+struct bq27510_platform_data bq27510_info = {
+ .init_dc_check_pin = bq27510_init_dc_check_pin,
+ .dc_check_pin = DC_CHECK_PIN,
+ .bat_num = LI_LION_BAT_NUM,
+};
+#endif
+
+/*************************************PMU ACT8891****************************************/
+
+#if defined (CONFIG_REGULATOR_ACT8891)
+ /*dcdc mode*/
+/*act8891 in REGULATOR_MODE_STANDBY mode is said DCDC is in PMF mode is can save power,when in REGULATOR_MODE_NORMAL
+mode is said DCDC is in PWM mode , General default is in REGULATOR_MODE_STANDBY mode*/
+ /*ldo mode */
+/*act8891 in REGULATOR_MODE_STANDBY mode is said LDO is in low power mode is can save power,when in REGULATOR_MODE_NORMAL
+mode is said DCDC is in nomal mode , General default is in REGULATOR_MODE_STANDBY mode*/
+/*set dcdc and ldo voltage by regulator_set_voltage()*/
+static struct act8891 *act8891;
+int act8891_set_init(struct act8891 *act8891)
+{
+ int tmp = 0;
+ struct regulator *act_ldo1,*act_ldo2,*act_ldo3,*act_ldo4;
+ struct regulator *act_dcdc1,*act_dcdc2,*act_dcdc3;
+
+ /*init ldo1*/
+ act_ldo1 = regulator_get(NULL, "act_ldo1");
+ regulator_enable(act_ldo1);
+ regulator_set_voltage(act_ldo1,1800000,1800000);
+ tmp = regulator_get_voltage(act_ldo1);
+ regulator_set_mode(act_ldo1,REGULATOR_MODE_STANDBY);
+ //regulator_set_mode(act_ldo1,REGULATOR_MODE_NORMAL);
+ printk("***regulator_set_init: ldo1 vcc =%d\n",tmp);
+ regulator_put(act_ldo1);
+
+ /*init ldo2*/
+ act_ldo2 = regulator_get(NULL, "act_ldo2");
+ regulator_enable(act_ldo2);
+ regulator_set_voltage(act_ldo2,1200000,1200000);
+ tmp = regulator_get_voltage(act_ldo2);
+ regulator_set_mode(act_ldo2,REGULATOR_MODE_STANDBY);
+ //regulator_set_mode(act_ldo2,REGULATOR_MODE_NORMAL);
+ printk("***regulator_set_init: ldo2 vcc =%d\n",tmp);
+ regulator_put(act_ldo2);
+
+ /*init ldo3*/
+ act_ldo3 = regulator_get(NULL, "act_ldo3");
+ regulator_enable(act_ldo3);
+ regulator_set_voltage(act_ldo3,3300000,3300000);
+ tmp = regulator_get_voltage(act_ldo3);
+ regulator_set_mode(act_ldo3,REGULATOR_MODE_STANDBY);
+ //regulator_set_mode(act_ldo3,REGULATOR_MODE_NORMAL);
+ printk("***regulator_set_init: ldo3 vcc =%d\n",tmp);
+ regulator_put(act_ldo3);
+
+ /*init ldo4*/
+ act_ldo4 = regulator_get(NULL, "act_ldo4");
+ regulator_enable(act_ldo4);
+ regulator_set_voltage(act_ldo4,2500000,2500000);
+ tmp = regulator_get_voltage(act_ldo4);
+ regulator_set_mode(act_ldo4,REGULATOR_MODE_STANDBY);
+ //regulator_set_mode(act_ldo4,REGULATOR_MODE_NORMAL);
+ printk("***regulator_set_init: ldo4 vcc =%d\n",tmp);
+ regulator_put(act_ldo4);
+
+ /*init dcdc1*/
+ act_dcdc1 = regulator_get(NULL, "act_dcdc1");
+ regulator_enable(act_dcdc1);
+ regulator_set_voltage(act_dcdc1,3000000,3000000);
+ tmp = regulator_get_voltage(act_dcdc1);
+ regulator_set_mode(act_dcdc1,REGULATOR_MODE_STANDBY);
+ //regulator_set_mode(act_dcdc1,REGULATOR_MODE_NORMAL);
+ printk("***regulator_set_init: dcdc1 vcc =%d\n",tmp);
+ regulator_put(act_dcdc1);
+
+ /*init dcdc2*/
+ act_dcdc2 = regulator_get(NULL, "act_dcdc2");
+ regulator_enable(act_dcdc2);
+ regulator_set_voltage(act_dcdc2,1500000,1500000);
+ tmp = regulator_get_voltage(act_dcdc2);
+ regulator_set_mode(act_dcdc2,REGULATOR_MODE_STANDBY);
+ //regulator_set_mode(act_dcdc2,REGULATOR_MODE_NORMAL);
+ printk("***regulator_set_init: dcdc2 vcc =%d\n",tmp);
+ regulator_put(act_dcdc2);
+
+ /*init dcdc3*/
+ act_dcdc3 = regulator_get(NULL, "act_dcdc3");
+ regulator_enable(act_dcdc3);
+ regulator_set_voltage(act_dcdc3,1200000,1200000);
+ tmp = regulator_get_voltage(act_dcdc3);
+ regulator_set_mode(act_dcdc3,REGULATOR_MODE_STANDBY);
+ //regulator_set_mode(act_dcdc3,REGULATOR_MODE_NORMAL);
+ printk("***regulator_set_init: dcdc3 vcc =%d\n",tmp);
+ regulator_put(act_dcdc3);
+
+ return(0);
+}
+
+static struct regulator_consumer_supply act8891_ldo1_consumers[] = {
+ {
+ .supply = "act_ldo1",
+ }
+};
+
+static struct regulator_init_data act8891_ldo1_data = {
+ .constraints = {
+ .name = "ACT_LDO1",
+ .min_uV = 600000,
+ .max_uV = 3900000,
+ .apply_uV = 1,
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE,
+ .valid_modes_mask = REGULATOR_MODE_STANDBY | REGULATOR_MODE_NORMAL,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(act8891_ldo1_consumers),
+ .consumer_supplies = act8891_ldo1_consumers,
+};
+
+/**/
+static struct regulator_consumer_supply act8891_ldo2_consumers[] = {
+ {
+ .supply = "act_ldo2",
+ }
+};
+
+static struct regulator_init_data act8891_ldo2_data = {
+ .constraints = {
+ .name = "ACT_LDO2",
+ .min_uV = 600000,
+ .max_uV = 3900000,
+ .apply_uV = 1,
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE,
+ .valid_modes_mask = REGULATOR_MODE_STANDBY | REGULATOR_MODE_NORMAL,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(act8891_ldo2_consumers),
+ .consumer_supplies = act8891_ldo2_consumers,
+};
+
+/*ldo3 VCC_NAND WIFI/BT/FM_BCM4325*/
+static struct regulator_consumer_supply act8891_ldo3_consumers[] = {
+ {
+ .supply = "act_ldo3",
+ }
+};
+
+static struct regulator_init_data act8891_ldo3_data = {
+ .constraints = {
+ .name = "ACT_LDO3",
+ .min_uV = 600000,
+ .max_uV = 3900000,
+ .apply_uV = 1,
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE,
+ .valid_modes_mask = REGULATOR_MODE_STANDBY | REGULATOR_MODE_NORMAL,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(act8891_ldo3_consumers),
+ .consumer_supplies = act8891_ldo3_consumers,
+};
+
+/*ldo4 VCCA CODEC_WM8994*/
+static struct regulator_consumer_supply act8891_ldo4_consumers[] = {
+ {
+ .supply = "act_ldo4",
+ }
+};
+
+static struct regulator_init_data act8891_ldo4_data = {
+ .constraints = {
+ .name = "ACT_LDO4",
+ .min_uV = 600000,
+ .max_uV = 3900000,
+ .apply_uV = 1,
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE,
+ .valid_modes_mask = REGULATOR_MODE_STANDBY | REGULATOR_MODE_NORMAL,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(act8891_ldo4_consumers),
+ .consumer_supplies = act8891_ldo4_consumers,
+};
+/*buck1 vcc Core*/
+static struct regulator_consumer_supply act8891_dcdc1_consumers[] = {
+ {
+ .supply = "act_dcdc1",
+ }
+};
+
+static struct regulator_init_data act8891_dcdc1_data = {
+ .constraints = {
+ .name = "ACT_DCDC1",
+ .min_uV = 600000,
+ .max_uV = 3900000,
+ .apply_uV = 1,
+ //.always_on = 1,
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE,
+ .valid_modes_mask = REGULATOR_MODE_STANDBY | REGULATOR_MODE_NORMAL,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(act8891_dcdc1_consumers),
+ .consumer_supplies = act8891_dcdc1_consumers
+};
+
+/*buck2 VDDDR MobileDDR VCC*/
+static struct regulator_consumer_supply act8891_dcdc2_consumers[] = {
+ {
+ .supply = "act_dcdc2",
+ }
+};
+
+static struct regulator_init_data act8891_dcdc2_data = {
+ .constraints = {
+ .name = "ACT_DCDC2",
+ .min_uV = 600000,
+ .max_uV = 3900000,
+ .apply_uV = 1,
+ //.always_on = 1,
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE,
+ .valid_modes_mask = REGULATOR_MODE_STANDBY | REGULATOR_MODE_NORMAL,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(act8891_dcdc2_consumers),
+ .consumer_supplies = act8891_dcdc2_consumers
+};
+
+/*buck3 vdd Core*/
+static struct regulator_consumer_supply act8891_dcdc3_consumers[] = {
+ {
+ .supply = "act_dcdc3",
+ }
+};
+
+static struct regulator_init_data act8891_dcdc3_data = {
+ .constraints = {
+ .name = "ACT_DCDC3",
+ .min_uV = 600000,
+ .max_uV = 3900000,
+ .apply_uV = 1,
+ //.always_on = 1,
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE,
+ .valid_modes_mask = REGULATOR_MODE_STANDBY | REGULATOR_MODE_NORMAL,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(act8891_dcdc3_consumers),
+ .consumer_supplies = act8891_dcdc3_consumers
+};
+
+struct act8891_regulator_subdev act8891_regulator_subdev_id[] = {
+ {
+ .id=0,
+ .initdata=&act8891_ldo1_data,
+ },
+
+ {
+ .id=1,
+ .initdata=&act8891_ldo2_data,
+ },
+
+ {
+ .id=2,
+ .initdata=&act8891_ldo3_data,
+ },
+
+ {
+ .id=3,
+ .initdata=&act8891_ldo4_data,
+ },
+
+ {
+ .id=4,
+ .initdata=&act8891_dcdc1_data,
+ },
+
+ {
+ .id=5,
+ .initdata=&act8891_dcdc2_data,
+ },
+ {
+ .id=6,
+ .initdata=&act8891_dcdc3_data,
+ },
+
+};
+
+struct act8891_platform_data act8891_data={
+ .set_init=act8891_set_init,
+ .num_regulators=7,
+ .regulators=act8891_regulator_subdev_id,
+
+};
+#endif
+
+/*****************************************************************************************
+ * i2c devices
+ * author: kfx@rock-chips.com
+*****************************************************************************************/
+static int rk29_i2c0_io_init(void)
+{
+#ifdef CONFIG_RK29_I2C0_CONTROLLER
+ rk29_mux_api_set(GPIO2B7_I2C0SCL_NAME, GPIO2L_I2C0_SCL);
+ rk29_mux_api_set(GPIO2B6_I2C0SDA_NAME, GPIO2L_I2C0_SDA);
+#else
+ rk29_mux_api_set(GPIO2B7_I2C0SCL_NAME, GPIO2L_GPIO2B7);
+ rk29_mux_api_set(GPIO2B6_I2C0SDA_NAME, GPIO2L_GPIO2B6);
+#endif
+ return 0;
+}
+
+static int rk29_i2c1_io_init(void)
+{
+#ifdef CONFIG_RK29_I2C1_CONTROLLER
+ rk29_mux_api_set(GPIO1A7_I2C1SCL_NAME, GPIO1L_I2C1_SCL);
+ rk29_mux_api_set(GPIO1A6_I2C1SDA_NAME, GPIO1L_I2C1_SDA);
+#else
+ rk29_mux_api_set(GPIO1A7_I2C1SCL_NAME, GPIO1L_GPIO1A7);
+ rk29_mux_api_set(GPIO1A6_I2C1SDA_NAME, GPIO1L_GPIO1A6);
+#endif
+ return 0;
+}
+static int rk29_i2c2_io_init(void)
+{
+#ifdef CONFIG_RK29_I2C2_CONTROLLER
+ rk29_mux_api_set(GPIO5D4_I2C2SCL_NAME, GPIO5H_I2C2_SCL);
+ rk29_mux_api_set(GPIO5D3_I2C2SDA_NAME, GPIO5H_I2C2_SDA);
+#else
+ rk29_mux_api_set(GPIO5D4_I2C2SCL_NAME, GPIO5H_GPIO5D4);
+ rk29_mux_api_set(GPIO5D3_I2C2SDA_NAME, GPIO5H_GPIO5D3);
+#endif
+ return 0;
+}
+
+static int rk29_i2c3_io_init(void)
+{
+#ifdef CONFIG_RK29_I2C3_CONTROLLER
+ rk29_mux_api_set(GPIO2B5_UART3RTSN_I2C3SCL_NAME, GPIO2L_I2C3_SCL);
+ rk29_mux_api_set(GPIO2B4_UART3CTSN_I2C3SDA_NAME, GPIO2L_I2C3_SDA);
+#else
+ rk29_mux_api_set(GPIO2B5_UART3RTSN_I2C3SCL_NAME, GPIO2L_GPIO2B5);
+ rk29_mux_api_set(GPIO2B4_UART3CTSN_I2C3SDA_NAME, GPIO2L_GPIO2B4);
+#endif
+ return 0;
+}
+#ifdef CONFIG_RK29_I2C0_CONTROLLER
+struct rk29_i2c_platform_data default_i2c0_data = {
+ .bus_num = 0,
+ .flags = 0,
+ .slave_addr = 0xff,
+ .scl_rate = 400*1000,
+ .mode = I2C_MODE_IRQ,
+ .io_init = rk29_i2c0_io_init,
+};
+#else
+struct i2c_gpio_platform_data default_i2c0_data = {
+ .sda_pin = RK29_PIN2_PB6,
+ .scl_pin = RK29_PIN2_PB7,
+ .udelay = 5, // clk = 500/udelay = 100Khz
+ .timeout = 100,//msecs_to_jiffies(200),
+ .bus_num = 0,
+ .io_init = rk29_i2c0_io_init,
+};
+#endif
+#ifdef CONFIG_RK29_I2C1_CONTROLLER
+struct rk29_i2c_platform_data default_i2c1_data = {
+ .bus_num = 1,
+ .flags = 0,
+ .slave_addr = 0xff,
+ .scl_rate = 400*1000,
+ .mode = I2C_MODE_IRQ,
+ .io_init = rk29_i2c1_io_init,
+};
+#else
+struct i2c_gpio_platform_data default_i2c1_data = {
+ .sda_pin = RK29_PIN1_PA6,
+ .scl_pin = RK29_PIN1_PA7,
+ .udelay = 5, // clk = 500/udelay = 100Khz
+ .timeout = 100,//msecs_to_jiffies(200),
+ .bus_num = 1,
+ .io_init = rk29_i2c1_io_init,
+};
+#endif
+#ifdef CONFIG_RK29_I2C2_CONTROLLER
+struct rk29_i2c_platform_data default_i2c2_data = {
+ .bus_num = 2,
+ .flags = 0,
+ .slave_addr = 0xff,
+ .scl_rate = 400*1000,
+ .mode = I2C_MODE_IRQ,
+ .io_init = rk29_i2c2_io_init,
+};
+#else
+struct i2c_gpio_platform_data default_i2c2_data = {
+ .sda_pin = RK29_PIN5_PD3,
+ .scl_pin = RK29_PIN5_PD4,
+ .udelay = 5, // clk = 500/udelay = 100Khz
+ .timeout = 100,//msecs_to_jiffies(200),
+ .bus_num = 2,
+ .io_init = rk29_i2c2_io_init,
+};
+#endif
+#ifdef CONFIG_RK29_I2C3_CONTROLLER
+struct rk29_i2c_platform_data default_i2c3_data = {
+ .bus_num = 3,
+ .flags = 0,
+ .slave_addr = 0xff,
+ .scl_rate = 400*1000,
+ .mode = I2C_MODE_IRQ,
+ .io_init = rk29_i2c3_io_init,
+};
+#else
+struct i2c_gpio_platform_data default_i2c3_data = {
+ .sda_pin = RK29_PIN5_PB5,
+ .scl_pin = RK29_PIN5_PB4,
+ .udelay = 5, // clk = 500/udelay = 100Khz
+ .timeout = 100,//msecs_to_jiffies(200),
+ .bus_num = 3,
+ .io_init = rk29_i2c3_io_init,
+};
+#endif
+#ifdef CONFIG_I2C0_RK29
+static struct i2c_board_info __initdata board_i2c0_devices[] = {
+#if defined (CONFIG_RK1000_CONTROL)
+ {
+ .type = "rk1000_control",
+ .addr = 0x40,
+ .flags = 0,
+ },
+#endif
+#if defined (CONFIG_SND_SOC_alc5621)
+ {
+ .type = "ALC5621",
+ .addr = 0x1a,
+ .flags = 0,
+ },
+#endif
+#if defined (CONFIG_SND_SOC_alc5631)
+ {
+ .type = "rt5631",
+ .addr = 0x1a,
+ .flags = 0,
+ },
+#endif
+#if defined (CONFIG_SND_SOC_RK1000)
+ {
+ .type = "rk1000_i2c_codec",
+ .addr = 0x60,
+ .flags = 0,
+ },
+#endif
+#if defined (CONFIG_SND_SOC_WM8900)
+ {
+ .type = "wm8900",
+ .addr = 0x1A,
+ .flags = 0,
+ },
+#endif
+#if defined (CONFIG_BATTERY_STC3100)
+ {
+ .type = "stc3100",
+ .addr = 0x70,
+ .flags = 0,
+ },
+#endif
+#if defined (CONFIG_BATTERY_BQ27510)
+ {
+ .type = "bq27510",
+ .addr = 0x55,
+ .flags = 0,
+ .platform_data = &bq27510_info,
+ },
+#endif
+#if defined (CONFIG_RTC_HYM8563)
+ {
+ .type = "rtc_hym8563",
+ .addr = 0x51,
+ .flags = 0,
+ .irq = RK29_PIN0_PA1,
+ },
+#endif
+#if defined (CONFIG_GS_MMA8452)
+ {
+ .type = "gs_mma8452",
+ .addr = 0x1c,
+ .flags = 0,
+ .irq = MMA8452_INT_PIN,
+ .platform_data = &mma8452_info,
+ },
+#endif
+#if defined (CONFIG_COMPASS_AK8973)
+ {
+ .type = "ak8973",
+ .addr = 0x1d,
+ .flags = 0,
+ .irq = RK29_PIN0_PA4,
+ },
+#endif
+#if defined (CONFIG_COMPASS_AK8975)
+ {
+ .type = "ak8975",
+ .addr = 0x0d,
+ .flags = 0,
+ .irq = RK29_PIN0_PA4,
+ },
+#endif
+/*mpu3050*/
+#if defined (CONFIG_MPU_SENSORS_MPU3050)
+ {
+ .type = "mpu3050",
+ .addr = 0x68,
+ .flags = 0,
+ .irq = RK29_PIN5_PA3,
+ .platform_data = &mpu3050_data,
+ },
+#endif
+#if defined (CONFIG_SND_SOC_CS42L52)
+ {
+ .type = "cs42l52",
+ .addr = 0x4A,
+ .flags = 0,
+ .platform_data = &cs42l52_info,
+ },
+#endif
+#if defined (CONFIG_RTC_M41T66)
+ {
+ .type = "rtc-M41T66",
+ .addr = 0x68,
+ .flags = 0,
+ .irq = RK29_PIN0_PA1,
+ },
+#endif
+};
+#endif
+#if defined (CONFIG_ANX7150)
+struct hdmi_platform_data anx7150_data = {
+ //.io_init = anx7150_io_init,
+};
+#endif
+#ifdef CONFIG_I2C1_RK29
+static struct i2c_board_info __initdata board_i2c1_devices[] = {
+#if defined (CONFIG_RK1000_CONTROL1)
+ {
+ .type = "rk1000_control",
+ .addr = 0x40,
+ .flags = 0,
+ },
+#endif
+#if defined (CONFIG_ANX7150)
+ {
+ .type = "anx7150",
+ .addr = 0x39, //0x39, 0x3d
+ .flags = 0,
+ .irq = RK29_PIN1_PD7,
+ .platform_data = &anx7150_data,
+ },
+#endif
+#ifdef CONFIG_BU92747GUW_CIR
+ {
+ .type ="bu92747_cir",
+ .addr = 0x77,
+ .flags =0,
+ .irq = BU92747_CIR_IRQ_PIN,
+ .platform_data = &bu92747guw_pdata,
+ },
+#endif
+
+};
+#endif
+
+#ifdef CONFIG_I2C2_RK29
+static struct i2c_board_info __initdata board_i2c2_devices[] = {
+#if defined (CONFIG_HANNSTAR_P1003)
+ {
+ .type = "p1003_touch",
+ .addr = 0x04,
+ .flags = 0, //I2C_M_NEED_DELAY
+ .irq = RK29_PIN0_PA2,
+ .platform_data = &p1003_info,
+ //.udelay = 100
+ },
+#endif
+#if defined (CONFIG_EETI_EGALAX)
+ {
+ .type = "egalax_i2c",
+ .addr = 0x04,
+ .flags = 0,
+ .irq = RK29_PIN0_PA2,
+ .platform_data = &eeti_egalax_info,
+ },
+#endif
+#if defined (CONFIG_TOUCHSCREEN_GT8XX)
+ {
+ .type = "Goodix-TS",
+ .addr = 0x55,
+ .flags =0,
+ .irq =RK29_PIN0_PA2,
+ .platform_data = &goodix_info,
+ },
+#endif
+#if defined (CONFIG_TOUCHSCREEN_FT5406)
+ {
+ .type ="ft5x0x_ts",
+ .addr = 0x38, //0x70,
+ .flags =0,
+ .irq =RK29_PIN0_PA2, // support goodix tp detect, 20110706
+ .platform_data = &ft5406_info,
+ },
+#endif
+};
+#endif
+
+#ifdef CONFIG_I2C3_RK29
+static struct i2c_board_info __initdata board_i2c3_devices[] = {
+#if defined (CONFIG_BATTERY_BQ27541)
+ {
+ .type = "bq27541",
+ .addr = 0x55,
+ .flags = 0,
+ .platform_data = &bq27541_info,
+ },
+#endif
+#if defined (CONFIG_REGULATOR_ACT8891)
+ {
+ .type = "act8891",
+ .addr = 0x5b,
+ .flags = 0,
+ .platform_data=&act8891_data,
+ },
+#endif
+
+};
+#endif
+
+/*****************************************************************************************
+ * camera devices
+ * author: ddl@rock-chips.com
+ *****************************************************************************************/
+#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
+#define CONFIG_SENSOR_FLASH_IOCTL_USR 0
+
+#if CONFIG_SENSOR_POWER_IOCTL_USR
+static int sensor_power_usr_cb (struct rk29camera_gpio_res *res,int on)
+{
+ #error "CONFIG_SENSOR_POWER_IOCTL_USR is 1, sensor_power_usr_cb function must be writed!!";
+}
+#endif
+
+#if CONFIG_SENSOR_RESET_IOCTL_USR
+static int sensor_reset_usr_cb (struct rk29camera_gpio_res *res,int on)
+{
+ #error "CONFIG_SENSOR_RESET_IOCTL_USR is 1, sensor_reset_usr_cb function must be writed!!";
+}
+#endif
+
+#if CONFIG_SENSOR_POWERDOWN_IOCTL_USR
+static int sensor_powerdown_usr_cb (struct rk29camera_gpio_res *res,int on)
+{
+ #error "CONFIG_SENSOR_POWERDOWN_IOCTL_USR is 1, sensor_powerdown_usr_cb function must be writed!!";
+}
+#endif
+
+#if CONFIG_SENSOR_FLASH_IOCTL_USR
+static int sensor_flash_usr_cb (struct rk29camera_gpio_res *res,int on)
+{
+ #error "CONFIG_SENSOR_FLASH_IOCTL_USR is 1, sensor_flash_usr_cb function must be writed!!";
+}
+#endif
+
+static struct rk29camera_platform_ioctl_cb sensor_ioctl_cb = {
+ #if CONFIG_SENSOR_POWER_IOCTL_USR
+ .sensor_power_cb = sensor_power_usr_cb,
+ #else
+ .sensor_power_cb = NULL,
+ #endif
+
+ #if CONFIG_SENSOR_RESET_IOCTL_USR
+ .sensor_reset_cb = sensor_reset_usr_cb,
+ #else
+ .sensor_reset_cb = NULL,
+ #endif
+
+ #if CONFIG_SENSOR_POWERDOWN_IOCTL_USR
+ .sensor_powerdown_cb = sensor_powerdown_usr_cb,
+ #else
+ .sensor_powerdown_cb = NULL,
+ #endif
+
+ #if CONFIG_SENSOR_FLASH_IOCTL_USR
+ .sensor_flash_cb = sensor_flash_usr_cb,
+ #else
+ .sensor_flash_cb = NULL,
+ #endif
+};
+#include "../../../drivers/media/video/rk29_camera.c"
+#endif
+/*****************************************************************************************
+ * backlight devices
+ * author: nzy@rock-chips.com
+ *****************************************************************************************/
+#ifdef CONFIG_BACKLIGHT_RK29_BL
+ /*
+ GPIO1B5_PWM0_NAME, GPIO1L_PWM0
+ GPIO5D2_PWM1_UART1SIRIN_NAME, GPIO5H_PWM1
+ GPIO2A3_SDMMC0WRITEPRT_PWM2_NAME, GPIO2L_PWM2
+ GPIO1A5_EMMCPWREN_PWM3_NAME, GPIO1L_PWM3
+ */
+
+#define PWM_ID 0
+#define PWM_MUX_NAME GPIO1B5_PWM0_NAME
+#define PWM_MUX_MODE GPIO1L_PWM0
+#define PWM_MUX_MODE_GPIO GPIO1L_GPIO1B5
+#define PWM_GPIO RK29_PIN1_PB5
+#define PWM_EFFECT_VALUE 1
+
+#define LCD_DISP_ON_PIN
+
+#ifdef LCD_DISP_ON_PIN
+//#define BL_EN_MUX_NAME GPIOF34_UART3_SEL_NAME
+//#define BL_EN_MUX_MODE IOMUXB_GPIO1_B34
+
+#define BL_EN_PIN RK29_PIN6_PD0
+#define BL_EN_VALUE GPIO_HIGH
+#endif
+static int rk29_backlight_io_init(void)
+{
+ int ret = 0;
+
+ rk29_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE);
+ #ifdef LCD_DISP_ON_PIN
+ // rk29_mux_api_set(BL_EN_MUX_NAME, BL_EN_MUX_MODE);
+
+ ret = gpio_request(BL_EN_PIN, NULL);
+ if(ret != 0)
+ {
+ gpio_free(BL_EN_PIN);
+ }
+
+ gpio_direction_output(BL_EN_PIN, 0);
+ gpio_set_value(BL_EN_PIN, BL_EN_VALUE);
+ #endif
+ return ret;
+}
+
+static int rk29_backlight_io_deinit(void)
+{
+ int ret = 0;
+ #ifdef LCD_DISP_ON_PIN
+ gpio_free(BL_EN_PIN);
+ #endif
+ rk29_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE_GPIO);
+
+ return ret;
+}
+
+static int rk29_backlight_pwm_suspend(void)
+{
+ int ret = 0;
+ rk29_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE_GPIO);
+ if (gpio_request(PWM_GPIO, NULL)) {
+ printk("func %s, line %d: request gpio fail\n", __FUNCTION__, __LINE__);
+ return -1;
+ }
+ gpio_direction_output(PWM_GPIO, GPIO_LOW);
+ #ifdef LCD_DISP_ON_PIN
+ gpio_direction_output(BL_EN_PIN, 0);
+ gpio_set_value(BL_EN_PIN, !BL_EN_VALUE);
+ #endif
+ return ret;
+}
+
+static int rk29_backlight_pwm_resume(void)
+{
+ gpio_free(PWM_GPIO);
+ rk29_mux_api_set(PWM_MUX_NAME, PWM_MUX_MODE);
+
+ #ifdef LCD_DISP_ON_PIN
+ msleep(30);
+ gpio_direction_output(BL_EN_PIN, 1);
+ gpio_set_value(BL_EN_PIN, BL_EN_VALUE);
+ #endif
+ return 0;
+}
+
+struct rk29_bl_info rk29_bl_info = {
+ .pwm_id = PWM_ID,
+ .bl_ref = PWM_EFFECT_VALUE,
+ .io_init = rk29_backlight_io_init,
+ .io_deinit = rk29_backlight_io_deinit,
+ .pwm_suspend = rk29_backlight_pwm_suspend,
+ .pwm_resume = rk29_backlight_pwm_resume,
+};
+#endif
+/*****************************************************************************************
+* pwm voltage regulator devices
+******************************************************************************************/
+#if defined (CONFIG_RK29_PWM_REGULATOR)
+
+#define REGULATOR_PWM_ID 2
+#define REGULATOR_PWM_MUX_NAME GPIO2A3_SDMMC0WRITEPRT_PWM2_NAME
+#define REGULATOR_PWM_MUX_MODE GPIO2L_PWM2
+#define REGULATOR_PWM_MUX_MODE_GPIO GPIO2L_GPIO2A3
+#define REGULATOR_PWM_GPIO RK29_PIN2_PA3
+
+static struct regulator_consumer_supply pwm_consumers[] = {
+ {
+ .supply = "vcore",
+ }
+};
+
+static struct regulator_init_data rk29_pwm_regulator_data = {
+ .constraints = {
+ .name = "PWM2",
+ .min_uV = 950000,
+ .max_uV = 1400000,
+ .apply_uV = 1,
+ .valid_ops_mask = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_VOLTAGE,
+ },
+ .num_consumer_supplies = ARRAY_SIZE(pwm_consumers),
+ .consumer_supplies = pwm_consumers,
+};
+
+static struct pwm_platform_data rk29_regulator_pwm_platform_data = {
+ .pwm_id = REGULATOR_PWM_ID,
+ .pwm_gpio = REGULATOR_PWM_GPIO,
+ //.pwm_iomux_name[] = REGULATOR_PWM_MUX_NAME;
+ .pwm_iomux_name = REGULATOR_PWM_MUX_NAME,
+ .pwm_iomux_pwm = REGULATOR_PWM_MUX_MODE,
+ .pwm_iomux_gpio = REGULATOR_PWM_MUX_MODE_GPIO,
+ .init_data = &rk29_pwm_regulator_data,
+};
+
+static struct platform_device rk29_device_pwm_regulator = {
+ .name = "pwm-voltage-regulator",
+ .id = -1,
+ .dev = {
+ .platform_data = &rk29_regulator_pwm_platform_data,
+ },
+};
+
+#endif
+
+#if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT)
+#define SDMMC0_WRITE_PROTECT_PIN RK29_PIN6_PB0 //According to your own project to set the value of write-protect-pin.
+#endif
+
+
+#if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT)
+#define SDMMC1_WRITE_PROTECT_PIN RK29_PIN6_PB0 //According to your own project to set the value of write-protect-pin.
+#endif
+
+/*****************************************************************************************
+ * SDMMC devices
+*****************************************************************************************/
+#if !defined(CONFIG_SDMMC_RK29_OLD)
+static void rk29_sdmmc_gpio_open(int device_id, int on)
+{
+ switch(device_id)
+ {
+ case 0://mmc0
+ {
+ #ifdef CONFIG_SDMMC0_RK29
+ if(on)
+ {
+ gpio_direction_output(RK29_PIN1_PD0,GPIO_HIGH);//set mmc0-clk to high
+ gpio_direction_output(RK29_PIN1_PD1,GPIO_HIGH);//set mmc0-cmd to high.
+ gpio_direction_output(RK29_PIN1_PD2,GPIO_HIGH);//set mmc0-data0 to high.
+ gpio_direction_output(RK29_PIN1_PD3,GPIO_HIGH);//set mmc0-data1 to high.
+ gpio_direction_output(RK29_PIN1_PD4,GPIO_HIGH);//set mmc0-data2 to high.
+ gpio_direction_output(RK29_PIN1_PD5,GPIO_HIGH);//set mmc0-data3 to high.
+
+ mdelay(30);
+ }
+ else
+ {
+ rk29_mux_api_set(GPIO1D0_SDMMC0CLKOUT_NAME, GPIO1H_GPIO1_D0);
+ gpio_request(RK29_PIN1_PD0, "mmc0-clk");
+ gpio_direction_output(RK29_PIN1_PD0,GPIO_LOW);//set mmc0-clk to low.
+
+ rk29_mux_api_set(GPIO1D1_SDMMC0CMD_NAME, GPIO1H_GPIO1_D1);
+ gpio_request(RK29_PIN1_PD1, "mmc0-cmd");
+ gpio_direction_output(RK29_PIN1_PD1,GPIO_LOW);//set mmc0-cmd to low.
+
+ rk29_mux_api_set(GPIO1D2_SDMMC0DATA0_NAME, GPIO1H_GPIO1D2);
+ gpio_request(RK29_PIN1_PD2, "mmc0-data0");
+ gpio_direction_output(RK29_PIN1_PD2,GPIO_LOW);//set mmc0-data0 to low.
+
+ rk29_mux_api_set(GPIO1D3_SDMMC0DATA1_NAME, GPIO1H_GPIO1D3);
+ gpio_request(RK29_PIN1_PD3, "mmc0-data1");
+ gpio_direction_output(RK29_PIN1_PD3,GPIO_LOW);//set mmc0-data1 to low.
+
+ rk29_mux_api_set(GPIO1D4_SDMMC0DATA2_NAME, GPIO1H_GPIO1D4);
+ gpio_request(RK29_PIN1_PD4, "mmc0-data2");
+ gpio_direction_output(RK29_PIN1_PD4,GPIO_LOW);//set mmc0-data2 to low.
+
+ rk29_mux_api_set(GPIO1D5_SDMMC0DATA3_NAME, GPIO1H_GPIO1D5);
+ gpio_request(RK29_PIN1_PD5, "mmc0-data3");
+ gpio_direction_output(RK29_PIN1_PD5,GPIO_LOW);//set mmc0-data3 to low.
+
+ mdelay(30);
+ }
+ #endif
+ }
+ break;
+
+ case 1://mmc1
+ {
+ #ifdef CONFIG_SDMMC1_RK29
+ if(on)
+ {
+ gpio_direction_output(RK29_PIN1_PC7,GPIO_HIGH);//set mmc1-clk to high
+ gpio_direction_output(RK29_PIN1_PC2,GPIO_HIGH);//set mmc1-cmd to high.
+ gpio_direction_output(RK29_PIN1_PC3,GPIO_HIGH);//set mmc1-data0 to high.
+ gpio_direction_output(RK29_PIN1_PC4,GPIO_HIGH);//set mmc1-data1 to high.
+ gpio_direction_output(RK29_PIN1_PC5,GPIO_HIGH);//set mmc1-data2 to high.
+ gpio_direction_output(RK29_PIN1_PC6,GPIO_HIGH);//set mmc1-data3 to high.
+ mdelay(100);
+ }
+ else
+ {
+ rk29_mux_api_set(GPIO1C7_SDMMC1CLKOUT_NAME, GPIO1H_GPIO1C7);
+ gpio_request(RK29_PIN1_PC7, "mmc1-clk");
+ gpio_direction_output(RK29_PIN1_PC7,GPIO_LOW);//set mmc1-clk to low.
+
+ rk29_mux_api_set(GPIO1C2_SDMMC1CMD_NAME, GPIO1H_GPIO1C2);
+ gpio_request(RK29_PIN1_PC2, "mmc1-cmd");
+ gpio_direction_output(RK29_PIN1_PC2,GPIO_LOW);//set mmc1-cmd to low.
+
+ rk29_mux_api_set(GPIO1C3_SDMMC1DATA0_NAME, GPIO1H_GPIO1C3);
+ gpio_request(RK29_PIN1_PC3, "mmc1-data0");
+ gpio_direction_output(RK29_PIN1_PC3,GPIO_LOW);//set mmc1-data0 to low.
+
+ mdelay(100);
+ }
+ #endif
+ }
+ break;
+
+ case 2: //mmc2
+ break;
+
+ default:
+ break;
+ }
+}
+
+static void rk29_sdmmc_set_iomux_mmc0(unsigned int bus_width)
+{
+ switch (bus_width)
+ {
+
+ case 1://SDMMC_CTYPE_4BIT:
+ {
+ rk29_mux_api_set(GPIO1D3_SDMMC0DATA1_NAME, GPIO1H_SDMMC0_DATA1);
+ rk29_mux_api_set(GPIO1D4_SDMMC0DATA2_NAME, GPIO1H_SDMMC0_DATA2);
+ rk29_mux_api_set(GPIO1D5_SDMMC0DATA3_NAME, GPIO1H_SDMMC0_DATA3);
+ }
+ break;
+
+ case 0x10000://SDMMC_CTYPE_8BIT:
+ break;
+ case 0xFFFF: //gpio_reset
+ {
+ rk29_mux_api_set(GPIO5D5_SDMMC0PWREN_NAME, GPIO5H_GPIO5D5);
+ gpio_request(RK29_PIN5_PD5,"sdmmc-power");
+ gpio_direction_output(RK29_PIN5_PD5,GPIO_HIGH); //power-off
+
+ rk29_sdmmc_gpio_open(0, 0);
+
+ gpio_direction_output(RK29_PIN5_PD5,GPIO_LOW); //power-on
+
+ rk29_sdmmc_gpio_open(0, 1);
+ }
+ break;
+
+ default: //case 0://SDMMC_CTYPE_1BIT:
+ {
+ rk29_mux_api_set(GPIO1D1_SDMMC0CMD_NAME, GPIO1H_SDMMC0_CMD);
+ rk29_mux_api_set(GPIO1D0_SDMMC0CLKOUT_NAME, GPIO1H_SDMMC0_CLKOUT);
+ rk29_mux_api_set(GPIO1D2_SDMMC0DATA0_NAME, GPIO1H_SDMMC0_DATA0);
+
+ rk29_mux_api_set(GPIO1D3_SDMMC0DATA1_NAME, GPIO1H_GPIO1D3);
+ gpio_request(RK29_PIN1_PD3, "mmc0-data1");
+ gpio_direction_output(RK29_PIN1_PD3,GPIO_HIGH);
+
+ rk29_mux_api_set(GPIO1D4_SDMMC0DATA2_NAME, GPIO1H_GPIO1D4);
+ gpio_request(RK29_PIN1_PD4, "mmc0-data2");
+ gpio_direction_output(RK29_PIN1_PD4,GPIO_HIGH);
+
+ rk29_mux_api_set(GPIO1D5_SDMMC0DATA3_NAME, GPIO1H_GPIO1D5);
+ gpio_request(RK29_PIN1_PD5, "mmc0-data3");
+ gpio_direction_output(RK29_PIN1_PD5,GPIO_HIGH);
+ }
+ break;
+ }
+}
+
+static void rk29_sdmmc_set_iomux_mmc1(unsigned int bus_width)
+{
+#if 0
+ switch (bus_width)
+ {
+
+ case 1://SDMMC_CTYPE_4BIT:
+ {
+ rk29_mux_api_set(GPIO1C2_SDMMC1CMD_NAME, GPIO1H_SDMMC1_CMD);
+ rk29_mux_api_set(GPIO1C7_SDMMC1CLKOUT_NAME, GPIO1H_SDMMC1_CLKOUT);
+ rk29_mux_api_set(GPIO1C3_SDMMC1DATA0_NAME, GPIO1H_SDMMC1_DATA0);
+ rk29_mux_api_set(GPIO1C4_SDMMC1DATA1_NAME, GPIO1H_SDMMC1_DATA1);
+ rk29_mux_api_set(GPIO1C5_SDMMC1DATA2_NAME, GPIO1H_SDMMC1_DATA2);
+ rk29_mux_api_set(GPIO1C6_SDMMC1DATA3_NAME, GPIO1H_SDMMC1_DATA3);
+ }
+ break;
+
+ case 0x10000://SDMMC_CTYPE_8BIT:
+ break;
+ case 0xFFFF:
+ {
+ rk29_sdmmc_gpio_open(1, 0);
+ rk29_sdmmc_gpio_open(1, 1);
+ }
+ break;
+
+ default: //case 0://SDMMC_CTYPE_1BIT:
+ {
+ rk29_mux_api_set(GPIO1C2_SDMMC1CMD_NAME, GPIO1H_SDMMC1_CMD);
+ rk29_mux_api_set(GPIO1C7_SDMMC1CLKOUT_NAME, GPIO1H_SDMMC1_CLKOUT);
+ rk29_mux_api_set(GPIO1C3_SDMMC1DATA0_NAME, GPIO1H_SDMMC1_DATA0);
+
+ rk29_mux_api_set(GPIO1C4_SDMMC1DATA1_NAME, GPIO1H_GPIO1C4);
+ gpio_request(RK29_PIN1_PC4, "mmc1-data1");
+ gpio_direction_output(RK29_PIN1_PC4,GPIO_HIGH);
+
+ rk29_mux_api_set(GPIO1C5_SDMMC1DATA2_NAME, GPIO1H_GPIO1C5);
+ gpio_request(RK29_PIN1_PC5, "mmc1-data2");
+ gpio_direction_output(RK29_PIN1_PC5,GPIO_HIGH);
+
+ rk29_mux_api_set(GPIO1C6_SDMMC1DATA3_NAME, GPIO1H_GPIO1C6);
+ gpio_request(RK29_PIN1_PC6, "mmc1-data3");
+ gpio_direction_output(RK29_PIN1_PC6,GPIO_HIGH);
+
+ }
+ break;
+ }
+#else
+ rk29_mux_api_set(GPIO1C2_SDMMC1CMD_NAME, GPIO1H_SDMMC1_CMD);
+ rk29_mux_api_set(GPIO1C7_SDMMC1CLKOUT_NAME, GPIO1H_SDMMC1_CLKOUT);
+ rk29_mux_api_set(GPIO1C3_SDMMC1DATA0_NAME, GPIO1H_SDMMC1_DATA0);
+ rk29_mux_api_set(GPIO1C4_SDMMC1DATA1_NAME, GPIO1H_SDMMC1_DATA1);
+ rk29_mux_api_set(GPIO1C5_SDMMC1DATA2_NAME, GPIO1H_SDMMC1_DATA2);
+ rk29_mux_api_set(GPIO1C6_SDMMC1DATA3_NAME, GPIO1H_SDMMC1_DATA3);
+
+#endif
+}
+
+static void rk29_sdmmc_set_iomux_mmc2(unsigned int bus_width)
+{
+ ;//
+}
+
+
+static void rk29_sdmmc_set_iomux(int device_id, unsigned int bus_width)
+{
+ switch(device_id)
+ {
+ case 0:
+ #ifdef CONFIG_SDMMC0_RK29
+ rk29_sdmmc_set_iomux_mmc0(bus_width);
+ #endif
+ break;
+ case 1:
+ #ifdef CONFIG_SDMMC1_RK29
+ rk29_sdmmc_set_iomux_mmc1(bus_width);
+ #endif
+ break;
+ case 2:
+ rk29_sdmmc_set_iomux_mmc2(bus_width);
+ break;
+ default:
+ break;
+ }
+}
+
+#endif
+
+#ifdef CONFIG_WIFI_CONTROL_FUNC
+static int rk29sdk_wifi_status(struct device *dev);
+static int rk29sdk_wifi_status_register(void (*callback)(int card_presend, void *dev_id), void *dev_id);
+#endif
+
+#ifdef CONFIG_SDMMC0_RK29
+static int rk29_sdmmc0_cfg_gpio(void)
+{
+#ifdef CONFIG_SDMMC_RK29_OLD
+ rk29_mux_api_set(GPIO1D1_SDMMC0CMD_NAME, GPIO1H_SDMMC0_CMD);
+ rk29_mux_api_set(GPIO1D0_SDMMC0CLKOUT_NAME, GPIO1H_SDMMC0_CLKOUT);
+ rk29_mux_api_set(GPIO1D2_SDMMC0DATA0_NAME, GPIO1H_SDMMC0_DATA0);
+ rk29_mux_api_set(GPIO1D3_SDMMC0DATA1_NAME, GPIO1H_SDMMC0_DATA1);
+ rk29_mux_api_set(GPIO1D4_SDMMC0DATA2_NAME, GPIO1H_SDMMC0_DATA2);
+ rk29_mux_api_set(GPIO1D5_SDMMC0DATA3_NAME, GPIO1H_SDMMC0_DATA3);
+
+ rk29_mux_api_set(GPIO2A2_SDMMC0DETECTN_NAME, GPIO2L_GPIO2A2);
+
+ rk29_mux_api_set(GPIO5D5_SDMMC0PWREN_NAME, GPIO5H_GPIO5D5); ///GPIO5H_SDMMC0_PWR_EN); ///GPIO5H_GPIO5D5);
+ gpio_request(RK29_PIN5_PD5,"sdmmc");
+#if 0
+ gpio_set_value(RK29_PIN5_PD5,GPIO_HIGH);
+ mdelay(100);
+ gpio_set_value(RK29_PIN5_PD5,GPIO_LOW);
+#else
+ gpio_direction_output(RK29_PIN5_PD5,GPIO_LOW);
+#endif
+
+#else
+ rk29_sdmmc_set_iomux(0, 0xFFFF);
+
+ rk29_mux_api_set(GPIO2A2_SDMMC0DETECTN_NAME, GPIO2L_SDMMC0_DETECT_N);//Modifyed by xbw.
+
+ #if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT)
+ gpio_request(SDMMC0_WRITE_PROTECT_PIN,"sdmmc-wp");
+ gpio_direction_input(SDMMC0_WRITE_PROTECT_PIN);
+ #endif
+
+#endif
+
+ return 0;
+}
+
+#define CONFIG_SDMMC0_USE_DMA
+struct rk29_sdmmc_platform_data default_sdmmc0_data = {
+ .host_ocr_avail = (MMC_VDD_25_26|MMC_VDD_26_27|MMC_VDD_27_28|MMC_VDD_28_29|MMC_VDD_29_30|
+ MMC_VDD_30_31|MMC_VDD_31_32|MMC_VDD_32_33|
+ MMC_VDD_33_34|MMC_VDD_34_35| MMC_VDD_35_36),
+ .host_caps = (MMC_CAP_4_BIT_DATA|MMC_CAP_MMC_HIGHSPEED|MMC_CAP_SD_HIGHSPEED),
+ .io_init = rk29_sdmmc0_cfg_gpio,
+
+#if !defined(CONFIG_SDMMC_RK29_OLD)
+ .set_iomux = rk29_sdmmc_set_iomux,
+#endif
+
+ .dma_name = "sd_mmc",
+#ifdef CONFIG_SDMMC0_USE_DMA
+ .use_dma = 1,
+#else
+ .use_dma = 0,
+#endif
+ .detect_irq = RK29_PIN2_PA2, // INVALID_GPIO
+ .enable_sd_wakeup = 0,
+
+#if defined(CONFIG_SDMMC0_RK29_WRITE_PROTECT)
+ .write_prt = SDMMC0_WRITE_PROTECT_PIN,
+#else
+ .write_prt = INVALID_GPIO,
+#endif
+};
+#endif
+#ifdef CONFIG_SDMMC1_RK29
+#define CONFIG_SDMMC1_USE_DMA
+static int rk29_sdmmc1_cfg_gpio(void)
+{
+#if defined(CONFIG_SDMMC_RK29_OLD)
+ rk29_mux_api_set(GPIO1C2_SDMMC1CMD_NAME, GPIO1H_SDMMC1_CMD);
+ rk29_mux_api_set(GPIO1C7_SDMMC1CLKOUT_NAME, GPIO1H_SDMMC1_CLKOUT);
+ rk29_mux_api_set(GPIO1C3_SDMMC1DATA0_NAME, GPIO1H_SDMMC1_DATA0);
+ rk29_mux_api_set(GPIO1C4_SDMMC1DATA1_NAME, GPIO1H_SDMMC1_DATA1);
+ rk29_mux_api_set(GPIO1C5_SDMMC1DATA2_NAME, GPIO1H_SDMMC1_DATA2);
+ rk29_mux_api_set(GPIO1C6_SDMMC1DATA3_NAME, GPIO1H_SDMMC1_DATA3);
+ //rk29_mux_api_set(GPIO1C0_UART0CTSN_SDMMC1DETECTN_NAME, GPIO1H_SDMMC1_DETECT_N);
+
+#else
+
+#if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT)
+ gpio_request(SDMMC1_WRITE_PROTECT_PIN,"sdio-wp");
+ gpio_direction_input(SDMMC1_WRITE_PROTECT_PIN);
+#endif
+
+#endif
+
+ return 0;
+}
+
+
+
+#define RK29SDK_WIFI_SDIO_CARD_DETECT_N RK29_PIN1_PD6
+
+struct rk29_sdmmc_platform_data default_sdmmc1_data = {
+ .host_ocr_avail = (MMC_VDD_25_26|MMC_VDD_26_27|MMC_VDD_27_28|MMC_VDD_28_29|
+ MMC_VDD_29_30|MMC_VDD_30_31|MMC_VDD_31_32|
+ MMC_VDD_32_33|MMC_VDD_33_34),
+
+#if !defined(CONFIG_USE_SDMMC1_FOR_WIFI_DEVELOP_BOARD)
+ .host_caps = (MMC_CAP_4_BIT_DATA|MMC_CAP_SDIO_IRQ|
+ MMC_CAP_MMC_HIGHSPEED|MMC_CAP_SD_HIGHSPEED),
+#else
+ .host_caps = (MMC_CAP_4_BIT_DATA|MMC_CAP_MMC_HIGHSPEED|MMC_CAP_SD_HIGHSPEED),
+#endif
+
+ .io_init = rk29_sdmmc1_cfg_gpio,
+
+#if !defined(CONFIG_SDMMC_RK29_OLD)
+ .set_iomux = rk29_sdmmc_set_iomux,
+#endif
+
+ .dma_name = "sdio",
+#ifdef CONFIG_SDMMC1_USE_DMA
+ .use_dma = 1,
+#else
+ .use_dma = 0,
+#endif
+
+#if !defined(CONFIG_USE_SDMMC1_FOR_WIFI_DEVELOP_BOARD)
+#ifdef CONFIG_WIFI_CONTROL_FUNC
+ .status = rk29sdk_wifi_status,
+ .register_status_notify = rk29sdk_wifi_status_register,
+#endif
+#if 0
+ .detect_irq = RK29SDK_WIFI_SDIO_CARD_DETECT_N,
+#endif
+
+#if defined(CONFIG_SDMMC1_RK29_WRITE_PROTECT)
+ .write_prt = SDMMC1_WRITE_PROTECT_PIN,
+#else
+ .write_prt = INVALID_GPIO,
+#endif
+
+#else
+//for wifi develop board
+ .detect_irq = INVALID_GPIO,
+ .enable_sd_wakeup = 0,
+#endif
+
+};
+#endif ////endif--#ifdef CONFIG_SDMMC1_RK29
+
+
+int rk29sdk_wifi_power_state = 0;
+int rk29sdk_bt_power_state = 0;
+
+#ifdef CONFIG_WIFI_CONTROL_FUNC
+#define RK29SDK_WIFI_BT_GPIO_POWER_N RK29_PIN5_PD6
+#define RK29SDK_WIFI_GPIO_RESET_N RK29_PIN6_PC0
+#define RK29SDK_BT_GPIO_RESET_N RK29_PIN6_PC4
+
+static int rk29sdk_wifi_cd = 0; /* wifi virtual 'card detect' status */
+static void (*wifi_status_cb)(int card_present, void *dev_id);
+static void *wifi_status_cb_devid;
+
+static int rk29sdk_wifi_status(struct device *dev)
+{
+ return rk29sdk_wifi_cd;
+}
+
+static int rk29sdk_wifi_status_register(void (*callback)(int card_present, void *dev_id), void *dev_id)
+{
+ if(wifi_status_cb)
+ return -EAGAIN;
+ wifi_status_cb = callback;
+ wifi_status_cb_devid = dev_id;
+ return 0;
+}
+
+static int rk29sdk_wifi_bt_gpio_control_init(void)
+{
+ if (gpio_request(RK29SDK_WIFI_BT_GPIO_POWER_N, "wifi_bt_power")) {
+ pr_info("%s: request wifi_bt power gpio failed\n", __func__);
+ return -1;
+ }
+
+ if (gpio_request(RK29SDK_WIFI_GPIO_RESET_N, "wifi reset")) {
+ pr_info("%s: request wifi reset gpio failed\n", __func__);
+ gpio_free(RK29SDK_WIFI_BT_GPIO_POWER_N);
+ return -1;
+ }
+
+ if (gpio_request(RK29SDK_BT_GPIO_RESET_N, "bt reset")) {
+ pr_info("%s: request bt reset gpio failed\n", __func__);
+ gpio_free(RK29SDK_WIFI_GPIO_RESET_N);
+ return -1;
+ }
+
+ gpio_direction_output(RK29SDK_WIFI_BT_GPIO_POWER_N, GPIO_LOW);
+ gpio_direction_output(RK29SDK_WIFI_GPIO_RESET_N, GPIO_LOW);
+ gpio_direction_output(RK29SDK_BT_GPIO_RESET_N, GPIO_LOW);
+
+ #if defined(CONFIG_SDMMC1_RK29) && !defined(CONFIG_SDMMC_RK29_OLD)
+
+ rk29_mux_api_set(GPIO1C4_SDMMC1DATA1_NAME, GPIO1H_GPIO1C4);
+ gpio_request(RK29_PIN1_PC4, "mmc1-data1");
+ gpio_direction_output(RK29_PIN1_PC4,GPIO_LOW);//set mmc1-data1 to low.
+
+ rk29_mux_api_set(GPIO1C5_SDMMC1DATA2_NAME, GPIO1H_GPIO1C5);
+ gpio_request(RK29_PIN1_PC5, "mmc1-data2");
+ gpio_direction_output(RK29_PIN1_PC5,GPIO_LOW);//set mmc1-data2 to low.
+
+ rk29_mux_api_set(GPIO1C6_SDMMC1DATA3_NAME, GPIO1H_GPIO1C6);
+ gpio_request(RK29_PIN1_PC6, "mmc1-data3");
+ gpio_direction_output(RK29_PIN1_PC6,GPIO_LOW);//set mmc1-data3 to low.
+
+ rk29_sdmmc_gpio_open(1, 0); //added by xbw at 2011-10-13
+ #endif
+ pr_info("%s: init finished\n",__func__);
+
+ return 0;
+}
+
+static int rk29sdk_wifi_power(int on)
+{
+ pr_info("%s: %d\n", __func__, on);
+ if (on){
+ gpio_set_value(RK29SDK_WIFI_BT_GPIO_POWER_N, GPIO_HIGH);
+
+ #if defined(CONFIG_SDMMC1_RK29) && !defined(CONFIG_SDMMC_RK29_OLD)
+ rk29_sdmmc_gpio_open(1, 1); //added by xbw at 2011-10-13
+ #endif
+
+ gpio_set_value(RK29SDK_WIFI_GPIO_RESET_N, GPIO_HIGH);
+ mdelay(100);
+ pr_info("wifi turn on power\n");
+ }else{
+ if (!rk29sdk_bt_power_state){
+ gpio_set_value(RK29SDK_WIFI_BT_GPIO_POWER_N, GPIO_LOW);
+
+ #if defined(CONFIG_SDMMC1_RK29) && !defined(CONFIG_SDMMC_RK29_OLD)
+ rk29_sdmmc_gpio_open(1, 0); //added by xbw at 2011-10-13
+ #endif
+
+ mdelay(100);
+ pr_info("wifi shut off power\n");
+ }else
+ {
+ pr_info("wifi shouldn't shut off power, bt is using it!\n");
+ }
+ gpio_set_value(RK29SDK_WIFI_GPIO_RESET_N, GPIO_LOW);
+
+ }
+
+ rk29sdk_wifi_power_state = on;
+ return 0;
+}
+
+static int rk29sdk_wifi_reset_state;
+static int rk29sdk_wifi_reset(int on)
+{
+ pr_info("%s: %d\n", __func__, on);
+ gpio_set_value(RK29SDK_WIFI_GPIO_RESET_N, on);
+ mdelay(100);
+ rk29sdk_wifi_reset_state = on;
+ return 0;
+}
+
+int rk29sdk_wifi_set_carddetect(int val)
+{
+ pr_info("%s:%d\n", __func__, val);
+ rk29sdk_wifi_cd = val;
+ if (wifi_status_cb){
+ wifi_status_cb(val, wifi_status_cb_devid);
+ }else {
+ pr_warning("%s, nobody to notify\n", __func__);
+ }
+ return 0;
+}
+EXPORT_SYMBOL(rk29sdk_wifi_set_carddetect);
+
+static struct wifi_mem_prealloc wifi_mem_array[PREALLOC_WLAN_SEC_NUM] = {
+ {NULL, (WLAN_SECTION_SIZE_0 + PREALLOC_WLAN_SECTION_HEADER)},
+ {NULL, (WLAN_SECTION_SIZE_1 + PREALLOC_WLAN_SECTION_HEADER)},
+ {NULL, (WLAN_SECTION_SIZE_2 + PREALLOC_WLAN_SECTION_HEADER)},
+ {NULL, (WLAN_SECTION_SIZE_3 + PREALLOC_WLAN_SECTION_HEADER)}
+};
+
+static void *rk29sdk_mem_prealloc(int section, unsigned long size)
+{
+ if (section == PREALLOC_WLAN_SEC_NUM)
+ return wlan_static_skb;
+
+ if ((section < 0) || (section > PREALLOC_WLAN_SEC_NUM))
+ return NULL;
+
+ if (wifi_mem_array[section].size < size)
+ return NULL;
+
+ return wifi_mem_array[section].mem_ptr;
+}
+
+int __init rk29sdk_init_wifi_mem(void)
+{
+ int i;
+ int j;
+
+ for (i = 0 ; i < WLAN_SKB_BUF_NUM ; i++) {
+ wlan_static_skb[i] = dev_alloc_skb(
+ ((i < (WLAN_SKB_BUF_NUM / 2)) ? 4096 : 8192));
+
+ if (!wlan_static_skb[i])
+ goto err_skb_alloc;
+ }
+
+ for (i = 0 ; i < PREALLOC_WLAN_SEC_NUM ; i++) {
+ wifi_mem_array[i].mem_ptr =
+ kmalloc(wifi_mem_array[i].size, GFP_KERNEL);
+
+ if (!wifi_mem_array[i].mem_ptr)
+ goto err_mem_alloc;
+ }
+ return 0;
+
+err_mem_alloc:
+ pr_err("Failed to mem_alloc for WLAN\n");
+ for (j = 0 ; j < i ; j++)
+ kfree(wifi_mem_array[j].mem_ptr);
+
+ i = WLAN_SKB_BUF_NUM;
+
+err_skb_alloc:
+ pr_err("Failed to skb_alloc for WLAN\n");
+ for (j = 0 ; j < i ; j++)
+ dev_kfree_skb(wlan_static_skb[j]);
+
+ return -ENOMEM;
+}
+
+static struct wifi_platform_data rk29sdk_wifi_control = {
+ .set_power = rk29sdk_wifi_power,
+ .set_reset = rk29sdk_wifi_reset,
+ .set_carddetect = rk29sdk_wifi_set_carddetect,
+ .mem_prealloc = rk29sdk_mem_prealloc,
+};
+static struct platform_device rk29sdk_wifi_device = {
+ .name = "bcm4329_wlan",
+ .id = 1,
+ .dev = {
+ .platform_data = &rk29sdk_wifi_control,
+ },
+};
+#endif
+
+
+/* bluetooth rfkill device */
+static struct platform_device rk29sdk_rfkill = {
+ .name = "rk29sdk_rfkill",
+ .id = -1,
+};
+
+
+#ifdef CONFIG_VIVANTE
+#define GPU_HIGH_CLOCK 552
+#define GPU_LOW_CLOCK (periph_pll_default / 1000000) /* same as general pll clock rate below */
+static struct resource resources_gpu[] = {
+ [0] = {
+ .name = "gpu_irq",
+ .start = IRQ_GPU,
+ .end = IRQ_GPU,
+ .flags = IORESOURCE_IRQ,
+ },
+ [1] = {
+ .name = "gpu_base",
+ .start = RK29_GPU_PHYS,
+ .end = RK29_GPU_PHYS + RK29_GPU_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ [2] = {
+ .name = "gpu_mem",
+ .start = PMEM_GPU_BASE,
+ .end = PMEM_GPU_BASE + PMEM_GPU_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ [3] = {
+ .name = "gpu_clk",
+ .start = GPU_LOW_CLOCK,
+ .end = GPU_HIGH_CLOCK,
+ .flags = IORESOURCE_IO,
+ },
+};
+static struct platform_device rk29_device_gpu = {
+ .name = "galcore",
+ .id = 0,
+ .num_resources = ARRAY_SIZE(resources_gpu),
+ .resource = resources_gpu,
+};
+#endif
+
+#ifdef CONFIG_KEYS_RK29
+extern struct rk29_keys_platform_data rk29_keys_pdata;
+static struct platform_device rk29_device_keys = {
+ .name = "rk29-keypad",
+ .id = -1,
+ .dev = {
+ .platform_data = &rk29_keys_pdata,
+ },
+};
+#endif
+
+#ifdef CONFIG_LEDS_GPIO_PLATFORM
+struct gpio_led rk29_leds[] = {
+ {
+ .name = "rk29_red_led",
+ .gpio = RK29_PIN4_PB2,
+ .default_trigger = "timer",
+ .active_low = 0,
+ .retain_state_suspended = 1,
+ .default_state = LEDS_GPIO_DEFSTATE_OFF,
+ },
+ {
+ .name = "rk29_green_led",
+ .gpio = RK29_PIN4_PB1,
+ .default_trigger = "timer",
+ .active_low = 0,
+ .retain_state_suspended = 1,
+ .default_state = LEDS_GPIO_DEFSTATE_OFF,
+ },
+ {
+ .name = "rk29_blue_led",
+ .gpio = RK29_PIN4_PB0,
+ .default_trigger = "timer",
+ .active_low = 0,
+ .retain_state_suspended = 1,
+ .default_state = LEDS_GPIO_DEFSTATE_OFF,
+ },
+};
+
+struct gpio_led_platform_data rk29_leds_pdata = {
+ .leds = &rk29_leds,
+ .num_leds = ARRAY_SIZE(rk29_leds),
+};
+
+struct platform_device rk29_device_gpio_leds = {
+ .name = "leds-gpio",
+ .id = -1,
+ .dev = {
+ .platform_data = &rk29_leds_pdata,
+ },
+};
+#endif
+
+#ifdef CONFIG_LEDS_NEWTON_PWM
+static struct led_newton_pwm rk29_pwm_leds[] = {
+ {
+ .name = "power_led",
+ .pwm_id = 1,
+ .pwm_gpio = RK29_PIN5_PD2,
+ .pwm_iomux_name = GPIO5D2_PWM1_UART1SIRIN_NAME,
+ .pwm_iomux_pwm = GPIO5H_PWM1,
+ .pwm_iomux_gpio = GPIO5H_GPIO5D2,
+ .freq = 1000,
+ .period = 255,
+ },
+};
+
+static struct led_newton_pwm_platform_data rk29_pwm_leds_pdata = {
+ .leds = &rk29_pwm_leds,
+ .num_leds = ARRAY_SIZE(rk29_pwm_leds),
+};
+
+static struct platform_device rk29_device_pwm_leds = {
+ .name = "leds_newton_pwm",
+ .id = -1,
+ .dev = {
+ .platform_data = &rk29_pwm_leds_pdata,
+ },
+};
+
+#endif
+static void __init rk29_board_iomux_init(void)
+{
+ #ifdef CONFIG_RK29_PWM_REGULATOR
+ rk29_mux_api_set(REGULATOR_PWM_MUX_NAME,REGULATOR_PWM_MUX_MODE);
+ #endif
+}
+
+static struct platform_device *devices[] __initdata = {
+
+#ifdef CONFIG_RK29_WATCHDOG
+ &rk29_device_wdt,
+#endif
+
+#ifdef CONFIG_UART1_RK29
+ &rk29_device_uart1,
+#endif
+#ifdef CONFIG_UART0_RK29
+ &rk29_device_uart0,
+#endif
+#ifdef CONFIG_UART2_RK29
+ &rk29_device_uart2,
+#endif
+#ifdef CONFIG_UART3_RK29
+ &rk29_device_uart3,
+#endif
+
+#ifdef CONFIG_RK29_PWM_REGULATOR
+ &rk29_device_pwm_regulator,
+#endif
+#ifdef CONFIG_SPIM0_RK29
+ &rk29xx_device_spi0m,
+#endif
+#ifdef CONFIG_SPIM1_RK29
+ &rk29xx_device_spi1m,
+#endif
+#ifdef CONFIG_ADC_RK29
+ &rk29_device_adc,
+#endif
+#ifdef CONFIG_I2C0_RK29
+ &rk29_device_i2c0,
+#endif
+#ifdef CONFIG_I2C1_RK29
+ &rk29_device_i2c1,
+#endif
+#ifdef CONFIG_I2C2_RK29
+ &rk29_device_i2c2,
+#endif
+#ifdef CONFIG_I2C3_RK29
+ &rk29_device_i2c3,
+#endif
+
+#ifdef CONFIG_SND_RK29_SOC_I2S_2CH
+ &rk29_device_iis_2ch,
+#endif
+#ifdef CONFIG_SND_RK29_SOC_I2S_8CH
+ &rk29_device_iis_8ch,
+#endif
+
+#ifdef CONFIG_KEYS_RK29
+ &rk29_device_keys,
+#endif
+#ifdef CONFIG_KEYS_RK29_NEWTON
+ &rk29_device_keys,
+#endif
+#ifdef CONFIG_SDMMC0_RK29
+ &rk29_device_sdmmc0,
+#endif
+#ifdef CONFIG_SDMMC1_RK29
+ &rk29_device_sdmmc1,
+#endif
+
+#ifdef CONFIG_MTD_NAND_RK29XX
+ &rk29xx_device_nand,
+#endif
+
+#ifdef CONFIG_WIFI_CONTROL_FUNC
+ &rk29sdk_wifi_device,
+#endif
+
+#ifdef CONFIG_BT
+ &rk29sdk_rfkill,
+#endif
+
+#ifdef CONFIG_MTD_NAND_RK29
+ &rk29_device_nand,
+#endif
+
+#ifdef CONFIG_FB_RK29
+ &rk29_device_fb,
+ &rk29_device_dma_cpy,
+#endif
+#ifdef CONFIG_BACKLIGHT_RK29_BL
+ &rk29_device_backlight,
+#endif
+#ifdef CONFIG_BACKLIGHT_RK29_NEWTON_BL
+ &rk29_device_backlight,
+#endif
+#ifdef CONFIG_RK29_VMAC
+ &rk29_device_vmac,
+#endif
+#ifdef CONFIG_VIVANTE
+ &rk29_device_gpu,
+#endif
+#ifdef CONFIG_VIDEO_RK29
+ &rk29_device_camera, /* ddl@rock-chips.com : camera support */
+ #if (CONFIG_SENSOR_IIC_ADDR_0 != 0x00)
+ &rk29_soc_camera_pdrv_0,
+ #endif
+ &rk29_soc_camera_pdrv_1,
+ &android_pmem_cam_device,
+#endif
+#if PMEM_SKYPE_SIZE > 0
+ &android_pmem_skype_device,
+#endif
+ &android_pmem_device,
+ &rk29_vpu_mem_device,
+#ifdef CONFIG_USB20_OTG
+ &rk29_device_usb20_otg,
+#endif
+#ifdef CONFIG_USB20_HOST
+ &rk29_device_usb20_host,
+#endif
+#ifdef CONFIG_USB11_HOST
+ &rk29_device_usb11_host,
+#endif
+#ifdef CONFIG_USB_ANDROID
+ &android_usb_device,
+ &usb_mass_storage_device,
+#endif
+#ifdef CONFIG_USB_ANDROID_RNDIS
+ &rk29_device_rndis,
+#endif
+#ifdef CONFIG_RK29_IPP
+ &rk29_device_ipp,
+#endif
+#ifdef CONFIG_VIDEO_RK29XX_VOUT
+ &rk29_v4l2_output_devce,
+#endif
+#ifdef CONFIG_RK29_NEWTON
+ &rk29_device_newton,
+#endif
+#ifdef CONFIG_RK_IRDA
+ &irda_device,
+#endif
+#ifdef CONFIG_LEDS_GPIO_PLATFORM
+ &rk29_device_gpio_leds,
+#endif
+#ifdef CONFIG_LEDS_NEWTON_PWM
+ &rk29_device_pwm_leds,
+#endif
+#ifdef CONFIG_SND_RK29_SOC_CS42L52
+ &rk29_cs42l52_device,
+#endif
+};
+
+/*****************************************************************************************
+ * spi devices
+ * author: cmc@rock-chips.com
+ *****************************************************************************************/
+static int rk29_vmac_register_set(void)
+{
+ //config rk29 vmac as rmii, 100MHz
+ u32 value= readl(RK29_GRF_BASE + 0xbc);
+ value = (value & 0xfff7ff) | (0x400);
+ writel(value, RK29_GRF_BASE + 0xbc);
+ return 0;
+}
+
+static int rk29_rmii_io_init(void)
+{
+ int err;
+
+ //phy power gpio
+ err = gpio_request(RK29_PIN6_PB0, "phy_power_en");
+ if (err) {
+ gpio_free(RK29_PIN6_PB0);
+ printk("-------request RK29_PIN6_PB0 fail--------\n");
+ return -1;
+ }
+ //phy power down
+ gpio_direction_output(RK29_PIN6_PB0, GPIO_LOW);
+ gpio_set_value(RK29_PIN6_PB0, GPIO_LOW);
+
+ return 0;
+}
+
+static int rk29_rmii_io_deinit(void)
+{
+ //phy power down
+ gpio_direction_output(RK29_PIN6_PB0, GPIO_LOW);
+ gpio_set_value(RK29_PIN6_PB0, GPIO_LOW);
+ //free
+ gpio_free(RK29_PIN6_PB0);
+ return 0;
+}
+
+static int rk29_rmii_power_control(int enable)
+{
+ if (enable) {
+ //enable phy power
+ gpio_direction_output(RK29_PIN6_PB0, GPIO_HIGH);
+ gpio_set_value(RK29_PIN6_PB0, GPIO_HIGH);
+ }
+ else {
+ gpio_direction_output(RK29_PIN6_PB0, GPIO_LOW);
+ gpio_set_value(RK29_PIN6_PB0, GPIO_LOW);
+ }
+ return 0;
+}
+
+struct rk29_vmac_platform_data rk29_vmac_pdata = {
+ .vmac_register_set = rk29_vmac_register_set,
+ .rmii_io_init = rk29_rmii_io_init,
+ .rmii_io_deinit = rk29_rmii_io_deinit,
+ .rmii_power_control = rk29_rmii_power_control,
+};
+
+/*****************************************************************************************
+ * spi devices
+ * author: cmc@rock-chips.com
+ *****************************************************************************************/
+#define SPI_CHIPSELECT_NUM 2
+static struct spi_cs_gpio rk29xx_spi0_cs_gpios[SPI_CHIPSELECT_NUM] = {
+ {
+ .name = "spi0 cs0",
+ .cs_gpio = RK29_PIN2_PC1,
+ .cs_iomux_name = GPIO2C1_SPI0CSN0_NAME,
+ .cs_iomux_mode = GPIO2H_SPI0_CSN0,
+ },
+ {
+ .name = "spi0 cs1",
+ .cs_gpio = RK29_PIN1_PA4,
+ .cs_iomux_name = GPIO1A4_EMMCWRITEPRT_SPI0CS1_NAME,//if no iomux,set it NULL
+ .cs_iomux_mode = GPIO1L_SPI0_CSN1,
+ }
+};
+
+static struct spi_cs_gpio rk29xx_spi1_cs_gpios[SPI_CHIPSELECT_NUM] = {
+ {
+ .name = "spi1 cs0",
+ .cs_gpio = RK29_PIN2_PC5,
+ .cs_iomux_name = GPIO2C5_SPI1CSN0_NAME,
+ .cs_iomux_mode = GPIO2H_SPI1_CSN0,
+ },
+ {
+ .name = "spi1 cs1",
+ .cs_gpio = RK29_PIN1_PA3,
+ .cs_iomux_name = GPIO1A3_EMMCDETECTN_SPI1CS1_NAME,//if no iomux,set it NULL
+ .cs_iomux_mode = GPIO1L_SPI1_CSN1,
+ }
+};
+
+static int spi_io_init(struct spi_cs_gpio *cs_gpios, int cs_num)
+{
+#if 1
+ int i;
+ if (cs_gpios) {
+ for (i=0; i<cs_num; i++) {
+ rk29_mux_api_set(cs_gpios[i].cs_iomux_name, cs_gpios[i].cs_iomux_mode);
+ }
+ }
+#endif
+ return 0;
+}
+
+static int spi_io_deinit(struct spi_cs_gpio *cs_gpios, int cs_num)
+{
+ return 0;
+}
+
+static int spi_io_fix_leakage_bug(void)
+{
+#if 0
+ gpio_direction_output(RK29_PIN2_PC1, GPIO_LOW);
+#endif
+ return 0;
+}
+
+static int spi_io_resume_leakage_bug(void)
+{
+#if 0
+ gpio_direction_output(RK29_PIN2_PC1, GPIO_HIGH);
+#endif
+ return 0;
+}
+
+struct rk29xx_spi_platform_data rk29xx_spi0_platdata = {
+ .num_chipselect = SPI_CHIPSELECT_NUM,
+ .chipselect_gpios = rk29xx_spi0_cs_gpios,
+ .io_init = spi_io_init,
+ .io_deinit = spi_io_deinit,
+ .io_fix_leakage_bug = spi_io_fix_leakage_bug,
+ .io_resume_leakage_bug = spi_io_resume_leakage_bug,
+};
+
+struct rk29xx_spi_platform_data rk29xx_spi1_platdata = {
+ .num_chipselect = SPI_CHIPSELECT_NUM,
+ .chipselect_gpios = rk29xx_spi1_cs_gpios,
+ .io_init = spi_io_init,
+ .io_deinit = spi_io_deinit,
+ .io_fix_leakage_bug = spi_io_fix_leakage_bug,
+ .io_resume_leakage_bug = spi_io_resume_leakage_bug,
+};
+
+/*****************************************************************************************
+ * xpt2046 touch panel
+ * author: cmc@rock-chips.com
+ *****************************************************************************************/
+#define XPT2046_GPIO_INT RK29_PIN0_PA3
+#define DEBOUNCE_REPTIME 3
+
+#if defined(CONFIG_TOUCHSCREEN_XPT2046_320X480_SPI)
+static struct xpt2046_platform_data xpt2046_info = {
+ .model = 2046,
+ .keep_vref_on = 1,
+ .swap_xy = 0,
+ .x_min = 0,
+ .x_max = 320,
+ .y_min = 0,
+ .y_max = 480,
+ .debounce_max = 7,
+ .debounce_rep = DEBOUNCE_REPTIME,
+ .debounce_tol = 20,
+ .gpio_pendown = XPT2046_GPIO_INT,
+ .penirq_recheck_delay_usecs = 1,
+};
+#elif defined(CONFIG_TOUCHSCREEN_XPT2046_320X480_CBN_SPI)
+static struct xpt2046_platform_data xpt2046_info = {
+ .model = 2046,
+ .keep_vref_on = 1,
+ .swap_xy = 0,
+ .x_min = 0,
+ .x_max = 320,
+ .y_min = 0,
+ .y_max = 480,
+ .debounce_max = 7,
+ .debounce_rep = DEBOUNCE_REPTIME,
+ .debounce_tol = 20,
+ .gpio_pendown = XPT2046_GPIO_INT,
+ .penirq_recheck_delay_usecs = 1,
+};
+#elif defined(CONFIG_TOUCHSCREEN_XPT2046_SPI)
+static struct xpt2046_platform_data xpt2046_info = {
+ .model = 2046,
+ .keep_vref_on = 1,
+ .swap_xy = 1,
+ .x_min = 0,
+ .x_max = 800,
+ .y_min = 0,
+ .y_max = 480,
+ .debounce_max = 7,
+ .debounce_rep = DEBOUNCE_REPTIME,
+ .debounce_tol = 20,
+ .gpio_pendown = XPT2046_GPIO_INT,
+
+ .penirq_recheck_delay_usecs = 1,
+};
+#elif defined(CONFIG_TOUCHSCREEN_XPT2046_CBN_SPI)
+static struct xpt2046_platform_data xpt2046_info = {
+ .model = 2046,
+ .keep_vref_on = 1,
+ .swap_xy = 1,
+ .x_min = 0,
+ .x_max = 800,
+ .y_min = 0,
+ .y_max = 480,
+ .debounce_max = 7,
+ .debounce_rep = DEBOUNCE_REPTIME,
+ .debounce_tol = 20,
+ .gpio_pendown = XPT2046_GPIO_INT,
+
+ .penirq_recheck_delay_usecs = 1,
+};
+#endif
+
+static struct spi_board_info board_spi_devices[] = {
+#if defined(CONFIG_TOUCHSCREEN_XPT2046_320X480_SPI) || defined(CONFIG_TOUCHSCREEN_XPT2046_320X480_CBN_SPI)\
+ ||defined(CONFIG_TOUCHSCREEN_XPT2046_SPI) || defined(CONFIG_TOUCHSCREEN_XPT2046_CBN_SPI)
+ {
+ .modalias = "xpt2046_ts",
+ .chip_select = 0,
+ .max_speed_hz = 125 * 1000 * 26,/* (max sample rate @ 3V) * (cmd + data + overhead) */
+ .bus_num = 0,
+ .irq = XPT2046_GPIO_INT,
+ .platform_data = &xpt2046_info,
+ },
+#endif
+};
+
+
+static void __init rk29_gic_init_irq(void)
+{
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38))
+ gic_init(0, 32, (void __iomem *)RK29_GICPERI_BASE, (void __iomem *)RK29_GICCPU_BASE);
+#else
+ gic_dist_init(0, (void __iomem *)RK29_GICPERI_BASE, 32);
+ gic_cpu_init(0, (void __iomem *)RK29_GICCPU_BASE);
+#endif
+}
+
+static void __init machine_rk29_init_irq(void)
+{
+ rk29_gic_init_irq();
+ rk29_gpio_init();
+}
+
+static struct cpufreq_frequency_table freq_table[] = {
+ { .index = 1200000, .frequency = 408000 },
+ { .index = 1200000, .frequency = 816000 },
+ { .index = 1300000, .frequency = 1008000 },
+ { .frequency = CPUFREQ_TABLE_END },
+};
+
+static void __init machine_rk29_board_init(void)
+{
+ rk29_board_iomux_init();
+
+ board_power_init();
+ board_update_cpufreq_table(freq_table);
+
+ platform_add_devices(devices, ARRAY_SIZE(devices));
+#ifdef CONFIG_I2C0_RK29
+ i2c_register_board_info(default_i2c0_data.bus_num, board_i2c0_devices,
+ ARRAY_SIZE(board_i2c0_devices));
+#endif
+#ifdef CONFIG_I2C1_RK29
+ i2c_register_board_info(default_i2c1_data.bus_num, board_i2c1_devices,
+ ARRAY_SIZE(board_i2c1_devices));
+#endif
+#ifdef CONFIG_I2C2_RK29
+ i2c_register_board_info(default_i2c2_data.bus_num, board_i2c2_devices,
+ ARRAY_SIZE(board_i2c2_devices));
+#endif
+#ifdef CONFIG_I2C3_RK29
+ i2c_register_board_info(default_i2c3_data.bus_num, board_i2c3_devices,
+ ARRAY_SIZE(board_i2c3_devices));
+#endif
+
+ spi_register_board_info(board_spi_devices, ARRAY_SIZE(board_spi_devices));
+
+#ifdef CONFIG_WIFI_CONTROL_FUNC
+ rk29sdk_wifi_bt_gpio_control_init();
+ rk29sdk_init_wifi_mem();
+#endif
+
+ board_usb_detect_init(RK29_PIN0_PA0);
+#if defined(CONFIG_RK_IRDA) || defined(CONFIG_BU92747GUW_CIR)
+ smc0_init(NULL);
+ bu92747guw_io_init();
+#endif
+
+}
+
+static void __init machine_rk29_fixup(struct machine_desc *desc, struct tag *tags,
+ char **cmdline, struct meminfo *mi)
+{
+ mi->nr_banks = 1;
+ mi->bank[0].start = RK29_SDRAM_PHYS;
+ mi->bank[0].size = LINUX_SIZE;
+#if SDRAM_SIZE > SZ_512M
+ mi->nr_banks = 2;
+ mi->bank[1].start = RK29_SDRAM_PHYS + SZ_512M;
+ mi->bank[1].size = SDRAM_SIZE - SZ_512M;
+#endif
+}
+
+static void __init machine_rk29_mapio(void)
+{
+ rk29_map_common_io();
+ rk29_setup_early_printk();
+ rk29_sram_init();
+ rk29_clock_init(periph_pll_default);
+ rk29_iomux_init();
+ ddr_init(DDR_TYPE, DDR_FREQ);
+}
+
+MACHINE_START(RK29, "RK29board")
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37))
+ /* UART for LL DEBUG */
+ .phys_io = RK29_UART1_PHYS & 0xfff00000,
+ .io_pg_offst = ((RK29_UART1_BASE) >> 18) & 0xfffc,
+#endif
+ .boot_params = RK29_SDRAM_PHYS + 0x88000,
+ .fixup = machine_rk29_fixup,
+ .map_io = machine_rk29_mapio,
+ .init_irq = machine_rk29_init_irq,
+ .init_machine = machine_rk29_board_init,
+ .timer = &rk29_timer,
+MACHINE_END
--- /dev/null
+#include <mach/key.h>
+#include <mach/gpio.h>
+#include <mach/board.h>
+
+#define EV_ENCALL KEY_F4
+#define EV_MENU KEY_F1
+
+#define PRESS_LEV_LOW 1
+#define PRESS_LEV_HIGH 0
+
+static struct rk29_keys_button key_button[] = {
+ {
+ .desc = "menu",
+ .code = EV_MENU,
+ .gpio = RK29_PIN6_PA0,
+ .active_low = PRESS_LEV_LOW,
+ },
+ {
+ .desc = "vol+",
+ .code = KEY_VOLUMEUP,
+ .gpio = RK29_PIN6_PA1,
+ .active_low = PRESS_LEV_LOW,
+ },
+ {
+ .desc = "vol-",
+ .code = KEY_VOLUMEDOWN,
+ .gpio = RK29_PIN6_PA2,
+ .active_low = PRESS_LEV_LOW,
+ },
+ {
+ .desc = "home",
+ .code = KEY_HOME,
+ .gpio = RK29_PIN6_PA3,
+ .active_low = PRESS_LEV_LOW,
+ },
+ {
+ .desc = "search",
+ .code = KEY_SEARCH,
+ .gpio = RK29_PIN6_PA4,
+ .active_low = PRESS_LEV_LOW,
+ },
+ {
+ .desc = "esc",
+ .code = KEY_BACK,
+ .gpio = RK29_PIN6_PA5,
+ .active_low = PRESS_LEV_LOW,
+ },
+ {
+ .desc = "sensor",
+ .code = KEY_CAMERA,
+ .gpio = RK29_PIN6_PA6,
+ .active_low = PRESS_LEV_LOW,
+ },
+ {
+ .desc = "play",
+ .code = KEY_POWER,
+ .gpio = RK29_PIN6_PA7,
+ .active_low = PRESS_LEV_LOW,
+ //.code_long_press = EV_ENCALL,
+ .wakeup = 1,
+ },
+#if 0
+ {
+ .desc = "vol+",
+ .code = KEY_VOLUMEDOWN,
+ .adc_value = 95,
+ .gpio = INVALID_GPIO,
+ .active_low = PRESS_LEV_LOW,
+ },
+ {
+ .desc = "vol-",
+ .code = KEY_VOLUMEUP,
+ .adc_value = 249,
+ .gpio = INVALID_GPIO,
+ .active_low = PRESS_LEV_LOW,
+ },
+ {
+ .desc = "menu",
+ .code = EV_MENU,
+ .adc_value = 406,
+ .gpio = INVALID_GPIO,
+ .active_low = PRESS_LEV_LOW,
+ },
+ {
+ .desc = "home",
+ .code = KEY_HOME,
+ .code_long_press = KEY_F4,
+ .adc_value = 561,
+ .gpio = INVALID_GPIO,
+ .active_low = PRESS_LEV_LOW,
+ },
+ {
+ .desc = "esc",
+ .code = KEY_ESC,
+ .adc_value = 726,
+ .gpio = INVALID_GPIO,
+ .active_low = PRESS_LEV_LOW,
+ },
+ {
+ .desc = "adkey6",
+ .code = KEY_BACK,
+ .code_long_press = EV_ENCALL,
+ .adc_value = 899,
+ .gpio = INVALID_GPIO,
+ .active_low = PRESS_LEV_LOW,
+ },
+#endif
+};
+struct rk29_keys_platform_data rk29_keys_pdata = {
+ .buttons = key_button,
+ .nbuttons = ARRAY_SIZE(key_button),
+ .chn = -1, //chn: 0-7, if do not use ADC,set 'chn' -1
+};
+
};
struct goodix_platform_data {
+ int model ;
+ int rest_pin;
int (*get_pendown_state)(void);
int (*init_platform_hw)(void);
int (*platform_sleep)(void);
code includes that in its table of IIC devices.
If unsure, say N (but it's safe to say "Y").
+config TOUCHSCREEN_GT8XX
+ tristate "Goodix touch screen gt8xx support for rk29"
+ help
+ Say Y here if you have a touchscreen interface using the
+ goodix gt8xx , and your board-specific initialization
+ code includes that in its table of IIC devices.
+ If unsure, say N (but it's safe to say "Y").
config RK28_I2C_TS_NTP070
tristate "NTP070 based touchscreens: NTP070 Interface"
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_GT8XX) += rk29_i2c_goodix.o
obj-$(CONFIG_TOUCHSCREEN_FT5406) += ft5406_ts.o
obj-$(CONFIG_TOUCHSCREEN_GT819) += gt819.o
obj-$(CONFIG_TOUCHSCREEN_NAS) += nas_ts.o
--- /dev/null
+/* drivers/input/touchscreen/goodix_touch.c\r
+ *\r
+ * Copyright (C) 2010 - 2011 Goodix, Inc.\r
+ * \r
+ * This program is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful, but WITHOUT\r
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\r
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\r
+ * more details.\r
+ *\r
+ */\r
+#include <linux/kernel.h>\r
+#include <linux/module.h>\r
+#include <linux/time.h>\r
+#include <linux/delay.h>\r
+#include <linux/device.h>\r
+#include <linux/earlysuspend.h>\r
+#include <linux/hrtimer.h>\r
+#include <linux/i2c.h>\r
+#include <linux/input.h>\r
+#include <linux/interrupt.h>\r
+#include <linux/io.h>\r
+#include <linux/platform_device.h>\r
+#include <mach/gpio.h>\r
+//#include <plat/gpio-cfg.h>\r
+//#include <plat/gpio-bank-l.h>\r
+//#include <plat/gpio-bank-f.h>\r
+#include <linux/irq.h>\r
+#include <linux/syscalls.h>\r
+#include <linux/reboot.h>\r
+#include <linux/proc_fs.h>\r
+#include "rk29_i2c_goodix.h"\r
+//#include <linux/goodix_queue.h>\r
+\r
+#include <linux/vmalloc.h>\r
+#include <linux/fs.h>\r
+#include <linux/string.h>\r
+#include <linux/completion.h>\r
+#include <asm/uaccess.h>\r
+#include <mach/board.h>\r
+\r
+#define PEN_DOWN 1\r
+#define PEN_RELEASE 0\r
+\r
+//#define fjp_debug\r
+/******************************************************* \r
+Description:\r
+ Read data from the i2c slave device;\r
+ This operation consisted of 2 i2c_msgs,the first msg used\r
+ to write the operate address,the second msg used to read data.\r
+\r
+Parameter:\r
+ client: i2c device.\r
+ buf[0]:operate address.\r
+ buf[1]~buf[len]:read data buffer.\r
+ len:operate length.\r
+ \r
+return:\r
+ numbers of i2c_msgs to transfer\r
+*********************************************************/\r
+static int i2c_read_bytes(struct i2c_client *client, uint8_t *buf, int len)\r
+{\r
+ struct i2c_msg msgs[2];\r
+ int ret=-1;\r
+ int retries = 0;\r
+\r
+ msgs[0].flags = client->flags;\r
+ msgs[0].addr=client->addr;\r
+ msgs[0].len=1;\r
+ msgs[0].buf=&buf[0];\r
+ msgs[0].udelay = client->udelay;\r
+ msgs[0].scl_rate=200 * 1000;\r
+\r
+ msgs[1].flags = client->flags | I2C_M_RD;\r
+ msgs[1].addr=client->addr;\r
+ msgs[1].len=len-1;\r
+ msgs[1].buf=&buf[1];\r
+ msgs[1].udelay = client->udelay;\r
+ msgs[1].scl_rate=200 * 1000;\r
+\r
+ disable_irq(client->irq);\r
+ while(retries<5)\r
+ {\r
+ ret=i2c_transfer(client->adapter,msgs, 2);\r
+ if(ret == 2)break;\r
+ retries++;\r
+ }\r
+ enable_irq(client->irq);\r
+ return ret;\r
+}\r
+\r
+/******************************************************* \r
+Description:\r
+ write data to the i2c slave device.\r
+\r
+Parameter:\r
+ client: i2c device.\r
+ buf[0]:operate address.\r
+ buf[1]~buf[len]:write data buffer.\r
+ len:operate length.\r
+ \r
+return:\r
+ numbers of i2c_msgs to transfer.\r
+*********************************************************/\r
+static int i2c_write_bytes(struct i2c_client *client,uint8_t *data,int len)\r
+{\r
+ struct i2c_msg msg;\r
+ int ret=-1;\r
+ int retries = 0;\r
+\r
+ msg.flags=!I2C_M_RD;\r
+ msg.addr=client->addr;\r
+ msg.len=len;\r
+ msg.buf=data; \r
+ msg.udelay = client->udelay;\r
+ msg.scl_rate=200 * 1000;\r
+ \r
+ disable_irq(client->irq);\r
+ while(retries<5)\r
+ {\r
+ ret=i2c_transfer(client->adapter,&msg, 1);\r
+ if(ret == 1)break;\r
+ retries++;\r
+ }\r
+ enable_irq(client->irq);\r
+ return ret;\r
+}\r
+\r
+/*******************************************************\r
+Description:\r
+ Goodix touchscreen initialize function.\r
+\r
+Parameter:\r
+ ts: i2c client private struct.\r
+ \r
+return:\r
+ Executive outcomes.0---succeed.\r
+*******************************************************/\r
+static int goodix_init_panel(struct goodix_ts_data *ts)\r
+{\r
+ int ret=-1;\r
+ uint8_t rd_cfg_buf[7] = {0x66,};\r
+\r
+#ifdef GOODIX_1024X768 //for malata 10.1\r
+ uint8_t config_info[] = {\r
+ 0x65,0x02,0x04,0x00,0x03,0x00,0x0A,0x22,0x1E,0xE7,0x32,0x05,0x08,0x10,0x4C,\r
+ 0x41,0x41,0x20,0x09,0x00,0xA0,0xA0,0x3C,0x64,0x0E,0x0D,0x0C,0x0B,0x0A,0x09,\r
+ 0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01,0x00,0x1D,0x1C,0x1B,0x1A,0x19,0x18,\r
+ 0x17,0x16,0x15,0x14,0x13,0x12,0x11,0x10,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,\r
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\r
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00\r
+ };\r
+ /* uint8_t config_info[] = {\r
+ 0x65,0x02,0x04,0x00,0x03,0x00,0x0a,0x22,0x1E,0xE7,0x32,0x05,0x08,0x10,0x4C,\r
+ 0x40,0x41,0x20,0x00,0x00,0x8B,0x8B,0x3C,0x64,0x0E,0x0D,0x0C,0x0B,\r
+ 0x0A,0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01,0x00,0x1D,0x1C,\r
+ 0x1B,0x1A,0x19,0x18,0x17,0x16,0x15,0x14,0x13,0x12,0x11,0x10,0x0F,\r
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\r
+ 0x2B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\r
+ 0x00,0x00,0x00,0x00\r
+ }; */ \r
+#else\r
+ /*uint8_t config_info[] = {\r
+ 0x65,0x02,0x05,0x00,0x03,0x20,0x05,0x20,0x1E,0xE7,0x32,0x05,0x08,0x10,0x4C,\r
+ 0x40,0x41,0x20,0x00,0x00,0x89,0x89,0x5A,0x96,0x0E,0x0D,0x0C,0x0B,0x0A,0x09,\r
+ 0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01,0x00,0x1D,0x1C,0x1B,0x1A,0x19,0x18,\r
+ 0x17,0x15,0x15,0x14,0x13,0x12,0x11,0x10,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,\r
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\r
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0D,0x00\r
+ };*/\r
+ uint8_t config_info[] = {\r
+ 0x65,0x02,0x05,0x00,0x03,0x20,0x0A,0x22,0x1E,0xE7,0x32,0x05,0x08,0x10,0x4C,\r
+ 0x42,0x42,0x20,0x00,0x00,0x89,0x89,0x3C,0x64,0x0E,0x0D,0x0C,0x0B,\r
+ 0x0A,0x09,0x08,0x07,0x06,0x05,0x04,0x03,0x02,0x01,0x00,0x1D,0x1C,\r
+ 0x1B,0x1A,0x19,0x18,0x17,0x16,0x15,0x14,0x13,0x12,0x11,0x10,0x0F,\r
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\r
+ 0x2B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,\r
+ 0x00,0x00,0x00,0x00\r
+ };\r
+#endif\r
+ ret=i2c_write_bytes(ts->client,config_info, (sizeof(config_info)/sizeof(config_info[0])));\r
+ if (ret < 0) {\r
+ printk("goodix write cfg info err");\r
+ return ret;\r
+ }\r
+ ret=i2c_read_bytes(ts->client, rd_cfg_buf, 7);\r
+ if(ret != 2)\r
+ {\r
+ dev_info(&ts->client->dev, "Read resolution & max_touch_num failed, use default value!\n");\r
+ ts->abs_x_max = TOUCH_MAX_HEIGHT;\r
+ ts->abs_y_max = TOUCH_MAX_WIDTH;\r
+ ts->max_touch_num = MAX_FINGER_NUM;\r
+ ts->int_trigger_type = INT_TRIGGER;\r
+ return 0;\r
+ }\r
+ ts->abs_x_max = (rd_cfg_buf[1]<<8) + rd_cfg_buf[2];\r
+ ts->abs_y_max = (rd_cfg_buf[3]<<8) + rd_cfg_buf[4];\r
+ ts->max_touch_num = rd_cfg_buf[5];\r
+ ts->int_trigger_type = rd_cfg_buf[6]&0x03;\r
+ if((!ts->abs_x_max)||(!ts->abs_y_max)||(!ts->max_touch_num))\r
+ {\r
+ dev_info(&ts->client->dev, "Read invalid resolution & max_touch_num, use default value!\n");\r
+ ts->abs_x_max = TOUCH_MAX_HEIGHT;\r
+ ts->abs_y_max = TOUCH_MAX_WIDTH;\r
+ ts->max_touch_num = MAX_FINGER_NUM;\r
+ }\r
+\r
+ dev_info(&ts->client->dev,"X_MAX = %d,Y_MAX = %d,MAX_TOUCH_NUM = %d\n",ts->abs_x_max,ts->abs_y_max,ts->max_touch_num);\r
+ dev_info(&ts->client->dev,"int_trigger type is %d\n",rd_cfg_buf[6]);\r
+ //test\r
+ rd_cfg_buf[0] = 0x6e;\r
+ rd_cfg_buf[1] = 0x00;\r
+ i2c_read_bytes(ts->client, rd_cfg_buf, 2);\r
+ if((rd_cfg_buf[1]&0x0f)==0x0f)\r
+ {\r
+ dev_info(&ts->client->dev, "Need int wake up from green mode!\n");\r
+ }\r
+\r
+ msleep(10);\r
+ return 0;\r
+\r
+}\r
+\r
+/*******************************************************\r
+Description:\r
+ Read goodix touchscreen version function.\r
+\r
+Parameter:\r
+ ts: i2c client private struct.\r
+ \r
+return:\r
+ Executive outcomes.0---succeed.\r
+*******************************************************/\r
+static int goodix_read_version(struct goodix_ts_data *ts, char **version)\r
+{\r
+ int ret = -1, count = 0;\r
+ char *version_data;\r
+ char *p;\r
+ \r
+ *version = (char *)vmalloc(18);\r
+ version_data = *version;\r
+ if(!version_data)\r
+ return -ENOMEM;\r
+ p = version_data;\r
+ memset(version_data, 0, sizeof(version_data));\r
+ version_data[0]=240; \r
+ ret=i2c_read_bytes(ts->client,version_data, 17);\r
+ if (ret < 0) \r
+ return ret;\r
+ version_data[17]='\0';\r
+ \r
+ if(*p == '\0')\r
+ return 0; \r
+ do \r
+ {\r
+ if((*p > 122) || (*p < 48 && *p != 32) || (*p >57 && *p < 65) \r
+ ||(*p > 90 && *p < 97 && *p != '_')) //check illeqal character\r
+ count++;\r
+ }while(*++p != '\0' );\r
+ if(count > 2)\r
+ return 0;\r
+ else \r
+ return 1; \r
+}\r
+\r
+/*******************************************************\r
+Description:\r
+ Goodix touchscreen work function.\r
+\r
+Parameter:\r
+ ts: i2c client private struct.\r
+ \r
+return:\r
+ Executive outcomes.0---succeed.\r
+*******************************************************/\r
+static void goodix_ts_work_func(struct work_struct *work)\r
+{ \r
+ int ret=-1;\r
+ int tmp = 0;\r
+ uint8_t point_data[(1-READ_COOR_ADDR)+1+2+5*MAX_FINGER_NUM+1]={ 0 }; //read address(1byte)+key index(1byte)+point mask(2bytes)+5bytes*MAX_FINGER_NUM+coor checksum(1byte)\r
+ uint8_t check_sum = 0;\r
+ uint16_t finger_current = 0;\r
+ uint16_t finger_bit = 0;\r
+ unsigned int count = 0, point_count = 0;\r
+ unsigned int position = 0; \r
+ uint8_t track_id[MAX_FINGER_NUM] = {0};\r
+ unsigned int input_x = 0;\r
+ unsigned int input_y = 0;\r
+ unsigned int input_w = 0;\r
+ unsigned char index = 0;\r
+ unsigned char touch_num = 0;\r
+ uint8_t current_num =0;\r
+ uint8_t chksum_err = 0;\r
+\r
+\r
+ unsigned int i;\r
+ struct goodix_ts_data *ts = container_of(work, struct goodix_ts_data, work);\r
+\r
+ //printk("enter the goodix_ts_timer_func!\n");\r
+// if(g_enter_isp)return;\r
+#if defined(INT_PORT)\r
+COORDINATE_POLL:\r
+ if(gpio_get_value(INT_PORT) != GPIO_LOW)\r
+ {\r
+ #ifdef fjp_debug\r
+ printk("NO_ACTION--NO_ACTION--NO_ACTION\n"); //add by fjp 2010-9-28\r
+ #endif\r
+ goto NO_ACTION;\r
+ } \r
+#endif \r
+\r
+\r
+ if( tmp > 9) {\r
+ printk("XFER_ERROR--XFER_ERROR--XFER_ERROR\n");\r
+ dev_info(&(ts->client->dev), "I2C transfer error,touchscreen stop working.\n");\r
+ goto XFER_ERROR ;\r
+ }\r
+ \r
+ if(ts->bad_data) \r
+ msleep(20);\r
+read_one_more_time: \r
+ \r
+ //printk("prepare for I2C transfer!\n");\r
+ point_data[0] = READ_COOR_ADDR; //read coor address\r
+ ret=i2c_read_bytes(ts->client, point_data, sizeof(point_data)/sizeof(point_data[0]));\r
+ if(ret != 2) \r
+ {\r
+ printk("I2C transfer error--I2C transfer error--I2C transfer error\n");\r
+ dev_err(&(ts->client->dev),"I2C transfer error. Number:%d\n ", ret);\r
+ ts->bad_data = 1;\r
+ tmp ++;\r
+ ts->retry++;\r
+ #if defined(INT_PORT)\r
+ if(ts->int_trigger_type> 2)\r
+ goto COORDINATE_POLL;\r
+ else\r
+ goto XFER_ERROR;\r
+ #endif\r
+ } \r
+ /* \r
+ for( i=0;i<sizeof(point_data)/sizeof(point_data[0]);i++)\r
+ {\r
+ printk("point_data[%d] ===%d\n", i,point_data[i]);\r
+ }*/\r
+ ts->bad_data = 0; \r
+ finger_current = (point_data[3 - READ_COOR_ADDR]<<8) + point_data[2 - READ_COOR_ADDR];\r
+ #ifdef fjp_debug\r
+ printk("finger_current ====%d\n", finger_current);//add by fjp 2010-9-28\r
+ #endif\r
+ //===add by fjp===============\r
+ /* if(0x200&finger_current)\r
+ current_num =0xa;\r
+ else if(0x100&finger_current)\r
+ current_num =0x9;\r
+ else if (0x80&finger_current)\r
+ current_num =0x8;\r
+ else if (0x40&finger_current)\r
+ current_num =0x7;\r
+ else if (0x20&finger_current)\r
+ current_num =0x6;\r
+ else if (0x10&finger_current)\r
+ current_num =0x5;\r
+ else if (0x8&finger_current)\r
+ current_num =0x4;\r
+ else if (0x4&finger_current)\r
+ current_num =0x3;\r
+ else if (0x2&finger_current)\r
+ current_num =0x2;\r
+ else if (0x1&finger_current)\r
+ current_num =0x1;\r
+ #ifdef fjp_debug\r
+ printk("current_num ====%d\n", current_num);\r
+ #endif\r
+ point_data[0] = READ_COOR_ADDR;\r
+ ret=i2c_read_bytes(ts->client, point_data, ((1-READ_COOR_ADDR)+1+2+5*current_num+1));\r
+ if(ret != 2) \r
+ {\r
+ #ifdef fjp_debug\r
+ printk("I2C transfer error--I2C transfer error--I2C transfer error\n");\r
+ #endif \r
+ dev_err(&(ts->client->dev),"I2C transfer error. Number:%d\n ", ret);\r
+ ts->bad_data = 1;\r
+ tmp ++;\r
+ ts->retry++;\r
+ goto XFER_ERROR;\r
+ \r
+ } \r
+ ts->bad_data = 0; */\r
+ //==================================\r
+ if(finger_current)\r
+ { \r
+ point_count = 0, finger_bit = finger_current;\r
+ for(count = 0; (finger_bit != 0) && (count < ts->max_touch_num); count++)//cal how many point touch currntly\r
+ {\r
+ if(finger_bit & 0x01)\r
+ {\r
+ track_id[point_count] = count;\r
+ point_count++;\r
+ }\r
+ finger_bit >>= 1;\r
+ }\r
+ touch_num = point_count;\r
+\r
+ check_sum = point_data[2 - READ_COOR_ADDR] + point_data[3 - READ_COOR_ADDR]; //cal coor checksum\r
+ count = 4 - READ_COOR_ADDR;\r
+ for(point_count *= 5; point_count > 0; point_count--)\r
+ check_sum += point_data[count++];\r
+ check_sum += point_data[count];\r
+ if(check_sum != 0) //checksum verify error\r
+ {\r
+ #if 0 \r
+ dev_info(&ts->client->dev, "Check_sum:%d, Data:%d\n", check_sum, point_data[count]); \r
+ printk(KERN_INFO "Finger Bit:%d\n",finger_current);\r
+ for( ; count > 0; count--)\r
+ printk(KERN_INFO "count=%d:%d ",count, point_data[count]);\r
+ printk(KERN_INFO "\n");\r
+ #endif\r
+ #ifdef fjp_debug\r
+ printk("coor checksum error!\n");\r
+ #endif\r
+ if(!chksum_err)\r
+ {\r
+ chksum_err = 1;\r
+ goto read_one_more_time;\r
+ }\r
+ #if defined(INT_PORT)\r
+ if(ts->int_trigger_type> 2)\r
+ goto COORDINATE_POLL;\r
+ else \r
+ goto XFER_ERROR;\r
+ #endif\r
+ }\r
+ else\r
+ {\r
+ chksum_err = 0;\r
+ }\r
+ }\r
+\r
+ if(touch_num)\r
+ {\r
+ for(index=0; index<touch_num; index++)\r
+ {\r
+ position = 4 - READ_COOR_ADDR + 5*index;\r
+ input_x = (unsigned int) (point_data[position]<<8) + (unsigned int)( point_data[position+1]);\r
+ input_y = (unsigned int)(point_data[position+2]<<8) + (unsigned int) (point_data[position+3]);\r
+ input_w =(unsigned int) (point_data[position+4]); \r
+\r
+ if((input_x > ts->abs_x_max)||(input_y > ts->abs_y_max))continue;\r
+ \r
+ input_report_abs(ts->input_dev, ABS_MT_POSITION_X, (input_x));\r
+ input_report_abs(ts->input_dev, ABS_MT_POSITION_Y, input_y); \r
+ input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, input_w);\r
+ input_report_abs(ts->input_dev, ABS_MT_WIDTH_MAJOR, input_w);\r
+ input_report_abs(ts->input_dev, ABS_MT_TRACKING_ID, track_id[index]);\r
+ input_mt_sync(ts->input_dev);\r
+ #ifdef fjp_debug\r
+ printk("input_x = %d,input_y = %d,input_w=%d, index = %d\n", (input_x), input_y, input_w,track_id[index]);//add by fjp 2010-9-28\r
+ #endif\r
+ \r
+ }\r
+ ts->pendown =PEN_DOWN;\r
+ input_sync(ts->input_dev);\r
+ }\r
+ \r
+\r
+ #ifdef HAVE_TOUCH_KEY\r
+ //printk(KERN_INFO"HAVE KEY DOWN!0x%x\n",point_data[1]);\r
+ for(count = 0; count < MAX_KEY_NUM; count++)\r
+ {\r
+ input_report_key(ts->input_dev, touch_key_array[count], !!(point_data[1]&(0x01<<count))); \r
+ } \r
+ #endif\r
+ \r
+\r
+#if defined(INT_PORT)\r
+ if(ts->int_trigger_type> 2)\r
+ {\r
+ msleep(POLL_TIME);\r
+ goto COORDINATE_POLL;\r
+ }\r
+#endif\r
+ goto END_WORK_FUNC;\r
+\r
+NO_ACTION: \r
+\r
+#ifdef HAVE_TOUCH_KEY\r
+ //printk(KERN_INFO"HAVE KEY DOWN!0x%x\n",point_data[1]);\r
+ for(count = 0; count < MAX_KEY_NUM; count++)\r
+ {\r
+ input_report_key(ts->input_dev, touch_key_array[count], !!(point_data[1]&(0x01<<count))); \r
+ }\r
+ input_sync(ts->input_dev); \r
+#endif\r
+END_WORK_FUNC:\r
+XFER_ERROR:\r
+ //=========add by fjp send last up touchkey==============\r
+ if(gpio_get_value(INT_PORT) == GPIO_LOW)\r
+ {\r
+ #ifdef fjp_debug\r
+ printk("touch down .............\n");//add by fjp 2010-9-28\r
+ #endif\r
+ queue_delayed_work(goodix_wq, &ts->work,msecs_to_jiffies(30));\r
+ }\r
+ else\r
+ {\r
+ if((ts->pendown))\r
+ {\r
+ input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, 0);\r
+ input_report_abs(ts->input_dev, ABS_MT_WIDTH_MAJOR, 0);\r
+ input_mt_sync(ts->input_dev);\r
+ input_sync(ts->input_dev);\r
+ ts->pendown =PEN_RELEASE;\r
+ #ifdef fjp_debug\r
+ printk("touch finish finsih\n");//add by fjp 2010-9-28\r
+ #endif \r
+ }\r
+ if(ts->use_irq)\r
+ enable_irq(ts->client->irq);\r
+ }\r
+ \r
+ //============================================\r
+ \r
+}\r
+\r
+/*******************************************************\r
+Description:\r
+ Timer interrupt service routine.\r
+\r
+Parameter:\r
+ timer: timer struct pointer.\r
+ \r
+return:\r
+ Timer work mode. HRTIMER_NORESTART---not restart mode\r
+*******************************************************/\r
+static enum hrtimer_restart goodix_ts_timer_func(struct hrtimer *timer)\r
+{\r
+ struct goodix_ts_data *ts = container_of(timer, struct goodix_ts_data, timer);\r
+ queue_work(goodix_wq, &ts->work);\r
+ hrtimer_start(&ts->timer, ktime_set(0, (POLL_TIME+6)*1000000), HRTIMER_MODE_REL);\r
+ return HRTIMER_NORESTART;\r
+}\r
+\r
+/*******************************************************\r
+Description:\r
+ External interrupt service routine.\r
+\r
+Parameter:\r
+ irq: interrupt number.\r
+ dev_id: private data pointer.\r
+ \r
+return:\r
+ irq execute status.\r
+*******************************************************/\r
+static irqreturn_t goodix_ts_irq_handler(int irq, void *dev_id)\r
+{\r
+\r
+ struct goodix_ts_data *ts = dev_id;\r
+#ifdef fjp_debug\r
+ printk("entry goodix_ts_irq_handler\n");//add by fjp 2010-9-28\r
+ #endif\r
+ disable_irq_nosync(ts->client->irq);\r
+ queue_delayed_work(goodix_wq, &ts->work,0);\r
+ \r
+ return IRQ_HANDLED;\r
+}\r
+\r
+/*******************************************************\r
+Description:\r
+ Goodix touchscreen power manage function.\r
+\r
+Parameter:\r
+ on: power status.0---suspend;1---resume.\r
+ \r
+return:\r
+ Executive outcomes.-1---i2c transfer error;0---succeed.\r
+*******************************************************/\r
+static int goodix_ts_power(struct goodix_ts_data * ts, int on)\r
+{\r
+ int ret = -1;\r
+ unsigned char i2c_control_buf[2] = {80, 1}; //suspend cmd\r
+ int retry = 0;\r
+ if(on != 0 && on !=1)\r
+ {\r
+ printk(KERN_DEBUG "%s: Cant't support this command.", goodix_ts_name);\r
+ return -EINVAL;\r
+ }\r
+ \r
+ if(ts != NULL && !ts->use_irq)\r
+ return -2;\r
+ \r
+ if(on == 0) //suspend\r
+ { \r
+ while(retry<5)\r
+ {\r
+ ret = i2c_write_bytes(ts->client, i2c_control_buf, 2);\r
+ if(ret == 1)\r
+ {\r
+ printk(KERN_INFO"Send suspend cmd\n");\r
+ break;\r
+ }\r
+ retry++;\r
+ msleep(10);\r
+ }\r
+ if(ret > 0)\r
+ ret = 0;\r
+ }\r
+ else if(on == 1) //resume\r
+ {\r
+ printk(KERN_INFO"Int resume\n");\r
+ gpio_set_value(RK29_PIN6_PC3,GPIO_LOW); \r
+ msleep(20);\r
+ gpio_set_value(RK29_PIN6_PC3,GPIO_HIGH);\r
+ ret = 0;\r
+ } \r
+ return ret;\r
+}\r
+\r
+#if 0\r
+/*******************************************************\r
+Description:\r
+ Goodix debug sysfs cat version function.\r
+\r
+Parameter:\r
+ standard sysfs show param.\r
+ \r
+return:\r
+ Executive outcomes. 0---failed.\r
+*******************************************************/\r
+static ssize_t goodix_debug_version_show(struct device *dev,\r
+ struct device_attribute *attr, char *buf)\r
+{\r
+ int ret = 0;\r
+ char *version_info = NULL;\r
+ struct goodix_ts_data *ts;\r
+ \r
+ ts = i2c_get_clientdata(i2c_connect_client);\r
+ if(ts==NULL)\r
+ return 0;\r
+ \r
+ ret = goodix_read_version(ts, &version_info);\r
+ if(ret <= 0)\r
+ {\r
+ printk(KERN_INFO"Read version data failed!\n");\r
+ vfree(version_info);\r
+ return 0;\r
+ }\r
+\r
+ printk(KERN_INFO"Goodix TouchScreen Version:%s\n", (version_info+1));\r
+ sprintf(buf,"Goodix TouchScreen Version:%s\n",(version_info+1));\r
+ vfree(version_info);\r
+ ret = strlen(buf);\r
+ return ret;\r
+}\r
+\r
+/*******************************************************\r
+Description:\r
+ Goodix debug sysfs cat resolution function.\r
+\r
+Parameter:\r
+ standard sysfs show param.\r
+ \r
+return:\r
+ Executive outcomes. 0---failed.\r
+*******************************************************/\r
+static ssize_t goodix_debug_resolution_show(struct device *dev,\r
+ struct device_attribute *attr, char *buf)\r
+{\r
+ struct goodix_ts_data *ts;\r
+ ts = i2c_get_clientdata(i2c_connect_client);\r
+ dev_info(&ts->client->dev,"ABS_X_MAX = %d,ABS_Y_MAX = %d\n",ts->abs_x_max,ts->abs_y_max);\r
+ sprintf(buf,"ABS_X_MAX = %d,ABS_Y_MAX = %d\n",ts->abs_x_max,ts->abs_y_max);\r
+\r
+ return strlen(buf);\r
+}\r
+/*******************************************************\r
+Description:\r
+ Goodix debug sysfs cat version function.\r
+\r
+Parameter:\r
+ standard sysfs show param.\r
+ \r
+return:\r
+ Executive outcomes. 0---failed.\r
+*******************************************************/\r
+static ssize_t goodix_debug_diffdata_show(struct device *dev,\r
+ struct device_attribute *attr, char *buf)\r
+{\r
+ //char diff_data[300];\r
+ unsigned char diff_data[2241] = {00,};\r
+ int ret = -1;\r
+ char diff_data_cmd[2] = {80, 202};\r
+ int i;\r
+ int short_tmp;\r
+ struct goodix_ts_data *ts;\r
+\r
+ disable_irq(TS_INT);\r
+ \r
+ ts = i2c_get_clientdata(i2c_connect_client);\r
+ //memset(diff_data, 0, sizeof(diff_data));\r
+ ret = i2c_write_bytes(ts->client, diff_data_cmd, 2);\r
+ if(ret != 1)\r
+ {\r
+ dev_info(&ts->client->dev, "Write diff data cmd failed!\n");\r
+ enable_irq(TS_INT);\r
+ return 0;\r
+ }\r
+\r
+ while(gpio_get_value(INT_PORT));\r
+ ret = i2c_read_bytes(ts->client, diff_data, sizeof(diff_data));\r
+ if(ret != 2)\r
+ {\r
+ dev_info(&ts->client->dev, "Read diff data failed!\n");\r
+ enable_irq(TS_INT);\r
+ return 0;\r
+ }\r
+ for(i=1; i<sizeof(diff_data); i+=2)\r
+ {\r
+ short_tmp = diff_data[i] + (diff_data[i+1]<<8);\r
+ if(short_tmp&0x8000)\r
+ short_tmp -= 65535;\r
+ if(short_tmp == 512)continue;\r
+ sprintf(buf+strlen(buf)," %d",short_tmp);\r
+ //printk(" %d\n", short_tmp);\r
+ }\r
+ \r
+ diff_data_cmd[1] = 0;\r
+ ret = i2c_write_bytes(ts->client, diff_data_cmd, 2);\r
+ if(ret != 1)\r
+ {\r
+ dev_info(&ts->client->dev, "Write diff data cmd failed!\n");\r
+ enable_irq(TS_INT);\r
+ return 0;\r
+ }\r
+ enable_irq(TS_INT);\r
+ /*for (i=0; i<1024; i++)\r
+ {\r
+ sprintf(buf+strlen(buf)," %d",i);\r
+ }*/\r
+ \r
+ return strlen(buf);\r
+}\r
+\r
+\r
+/*******************************************************\r
+Description:\r
+ Goodix debug sysfs echo calibration function.\r
+\r
+Parameter:\r
+ standard sysfs store param.\r
+ \r
+return:\r
+ Executive outcomes..\r
+*******************************************************/\r
+static ssize_t goodix_debug_calibration_store(struct device *dev,\r
+ struct device_attribute *attr, const char *buf, ssize_t count)\r
+{\r
+ int ret = -1;\r
+ char cal_cmd_buf[] = {110,1};\r
+ struct goodix_ts_data *ts;\r
+\r
+ ts = i2c_get_clientdata(i2c_connect_client);\r
+ dev_info(&ts->client->dev,"Begin calibration......\n");\r
+ if((*buf == 10)||(*buf == 49))\r
+ {\r
+ ret = i2c_write_bytes(ts->client,cal_cmd_buf,2);\r
+ if(ret!=1)\r
+ {\r
+ dev_info(&ts->client->dev,"Calibration failed!\n");\r
+ return count;\r
+ }\r
+ else\r
+ {\r
+ dev_info(&ts->client->dev,"Calibration succeed!\n");\r
+ }\r
+ }\r
+ return count;\r
+}\r
+\r
+static DEVICE_ATTR(version, S_IRUGO, goodix_debug_version_show, NULL);\r
+static DEVICE_ATTR(resolution, S_IRUGO, goodix_debug_resolution_show, NULL);\r
+static DEVICE_ATTR(diffdata, S_IRUGO, goodix_debug_diffdata_show, NULL);\r
+static DEVICE_ATTR(calibration, S_IWUSR , NULL, goodix_debug_calibration_store); \r
+\r
+\r
+/*******************************************************\r
+Description:\r
+ Goodix debug sysfs init function.\r
+\r
+Parameter:\r
+ none.\r
+ \r
+return:\r
+ Executive outcomes. 0---succeed.\r
+*******************************************************/\r
+static int goodix_debug_sysfs_init(void)\r
+{\r
+ int ret ;\r
+ struct goodix_ts_data *ts;\r
+ ts = i2c_get_clientdata(i2c_connect_client);\r
+\r
+ goodix_debug_kobj = kobject_create_and_add("goodix_debug", NULL) ;\r
+ if (goodix_debug_kobj == NULL) {\r
+ printk(KERN_ERR "%s: subsystem_register failed\n", __func__);\r
+ ret = -ENOMEM;\r
+ return ret;\r
+ }\r
+ ret = sysfs_create_file(goodix_debug_kobj, &dev_attr_version.attr);\r
+ if (ret) {\r
+ printk(KERN_ERR "%s: sysfs_create_version_file failed\n", __func__);\r
+ return ret;\r
+ }\r
+ ret = sysfs_create_file(goodix_debug_kobj, &dev_attr_calibration.attr);\r
+ if (ret) {\r
+ printk(KERN_ERR "%s: sysfs_create_calibration_file failed\n", __func__);\r
+ return ret;\r
+ }\r
+ ret = sysfs_create_file(goodix_debug_kobj, &dev_attr_diffdata.attr);\r
+ if (ret) \r
+ {\r
+ printk(KERN_ERR "%s: sysfs_create_diffdata_file failed\n", __func__);\r
+ return ret;\r
+ }\r
+ ret = sysfs_create_file(goodix_debug_kobj, &dev_attr_resolution.attr);\r
+ if (ret) {\r
+ printk(KERN_ERR "%s: sysfs_create_resolution_file failed\n", __func__);\r
+ return ret;\r
+ }\r
+ dev_info(&ts->client->dev,"Goodix debug sysfs create success!\n");\r
+ return 0 ;\r
+}\r
+\r
+static void goodix_debug_sysfs_deinit(void)\r
+{\r
+ sysfs_remove_file(goodix_debug_kobj, &dev_attr_version.attr);\r
+ sysfs_remove_file(goodix_debug_kobj, &dev_attr_resolution.attr);\r
+ sysfs_remove_file(goodix_debug_kobj, &dev_attr_diffdata.attr);\r
+ sysfs_remove_file(goodix_debug_kobj, &dev_attr_calibration.attr);\r
+ kobject_del(goodix_debug_kobj);\r
+}\r
+#endif\r
+/*******************************************************\r
+Description:\r
+ Goodix touchscreen probe function.\r
+\r
+Parameter:\r
+ client: i2c device struct.\r
+ id:device id.\r
+ \r
+return:\r
+ Executive outcomes. 0---succeed.\r
+*******************************************************/\r
+static int goodix_ts_probe(struct i2c_client *client, const struct i2c_device_id *id)\r
+{\r
+ int ret = 0;\r
+ int retry=0;\r
+ struct goodix_ts_data *ts;\r
+ char *version_info = NULL;\r
+ char test_data = 1;\r
+ const char irq_table[4] = {IRQ_TYPE_EDGE_RISING,\r
+ IRQ_TYPE_LEVEL_LOW,\r
+ IRQ_TYPE_EDGE_FALLING,\r
+ IRQ_TYPE_LEVEL_HIGH};\r
+\r
+ struct goodix_platform_data *pdata = pdata = client->dev.platform_data;\r
+ dev_dbg(&client->dev,"Install touch driver.\n");\r
+\r
+\r
+ if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) \r
+ {\r
+ dev_err(&client->dev, "Must have I2C_FUNC_I2C.\n");\r
+ ret = -ENODEV;\r
+ goto err_check_functionality_failed;\r
+ }\r
+\r
+ ts = kzalloc(sizeof(*ts), GFP_KERNEL);\r
+ if (ts == NULL) {\r
+ ret = -ENOMEM;\r
+ goto err_alloc_data_failed;\r
+ }\r
+\r
+ if (pdata->init_platform_hw)\r
+ {\r
+ pdata->init_platform_hw();\r
+ }\r
+\r
+ i2c_connect_client = client;\r
+ for(retry=0;retry < 30; retry++)\r
+ {\r
+ ret =i2c_write_bytes(client, &test_data, 1);\r
+ if (ret > 0)\r
+ break;\r
+ printk("GOODiX i2c test failed!\n");\r
+ }\r
+\r
+ if(ret <= 0)\r
+ {\r
+ dev_err(&client->dev, "I2C communication ERROR!Goodix touchscreen driver become invalid\n");\r
+ goto err_i2c_failed;\r
+ } \r
+ \r
+ INIT_DELAYED_WORK(&ts->work, goodix_ts_work_func);\r
+ ts->client = client;\r
+ i2c_set_clientdata(client, ts);\r
+ pdata = client->dev.platform_data;\r
+ \r
+ ts->input_dev = input_allocate_device();\r
+ if (ts->input_dev == NULL) {\r
+ ret = -ENOMEM;\r
+ dev_dbg(&client->dev,"Failed to allocate input device\n");\r
+ goto err_input_dev_alloc_failed;\r
+ }\r
+#if 1 \r
+ for(retry=0; retry<3; retry++)\r
+ {\r
+ ret=goodix_init_panel(ts);\r
+ msleep(2);\r
+ if(ret != 0)\r
+ continue;\r
+ else\r
+ break;\r
+ }\r
+ if(ret != 0) {\r
+ ts->bad_data=1;\r
+ goto err_init_godix_ts;\r
+ }\r
+\r
+#endif\r
+ ts->input_dev->evbit[0] = BIT_MASK(EV_SYN) | BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS) ;\r
+ ts->input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);\r
+ ts->input_dev->absbit[0] = BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_PRESSURE); // absolute coor (x,y)\r
+#if 0\r
+#ifdef HAVE_TOUCH_KEY\r
+ for(retry = 0; retry < MAX_KEY_NUM; retry++)\r
+ {\r
+ input_set_capability(ts->input_dev,EV_KEY,touch_key_array[retry]); \r
+ }\r
+#endif\r
+#endif\r
+\r
+ input_set_abs_params(ts->input_dev, ABS_X, 0, ts->abs_x_max, 0, 0);\r
+ input_set_abs_params(ts->input_dev, ABS_Y, 0, ts->abs_y_max, 0, 0);\r
+ input_set_abs_params(ts->input_dev, ABS_PRESSURE, 0, 255, 0, 0);\r
+\r
+#ifdef GOODIX_MULTI_TOUCH\r
+ input_set_abs_params(ts->input_dev, ABS_MT_WIDTH_MAJOR, 0, 255, 0, 0);\r
+ input_set_abs_params(ts->input_dev, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0);\r
+ input_set_abs_params(ts->input_dev, ABS_MT_POSITION_X, 0, ts->abs_x_max, 0, 0);\r
+ input_set_abs_params(ts->input_dev, ABS_MT_POSITION_Y, 0, ts->abs_y_max, 0, 0);\r
+ input_set_abs_params(ts->input_dev, ABS_MT_TRACKING_ID, 0, ts->max_touch_num, 0, 0);\r
+#endif \r
+\r
+ sprintf(ts->phys, "input/ts");\r
+ ts->input_dev->name = goodix_ts_name;\r
+ ts->input_dev->phys = ts->phys;\r
+ ts->input_dev->id.bustype = BUS_I2C;\r
+ ts->input_dev->id.vendor = 0xDEAD;\r
+ ts->input_dev->id.product = 0xBEEF;\r
+ ts->input_dev->id.version = 10427; //screen firmware version\r
+ \r
+ ret = input_register_device(ts->input_dev);\r
+ if (ret) {\r
+ dev_err(&client->dev,"Probe: Unable to register %s input device\n", ts->input_dev->name);\r
+ goto err_input_register_device_failed;\r
+ }\r
+ ts->bad_data = 0;\r
+ \r
+#ifdef INT_PORT \r
+ client->irq=TS_INT; //If not defined in client\r
+ if (client->irq)\r
+ {\r
+ ret = gpio_request(INT_PORT, "TS_INT"); //Request IO\r
+ if (ret < 0) \r
+ {\r
+ dev_err(&client->dev, "Failed to request GPIO:%d, ERRNO:%d\n",(int)INT_PORT,ret);\r
+ goto err_gpio_request_failed;\r
+ }\r
+ // s3c_gpio_setpull(INT_PORT, S3C_GPIO_PULL_UP); //ret > 0 ?\r
+ // s3c_gpio_cfgpin(INT_PORT, INT_CFG); //Set IO port function \r
+ // printk("irq is %d\n",irq_table[ts->int_trigger_type]);//add by fjp 2010-9-28\r
+ ret = request_irq(client->irq, goodix_ts_irq_handler , /* irq_table[ts->int_trigger_type]*/IRQ_TYPE_LEVEL_LOW,\r
+ client->name, ts);\r
+ if (ret != 0) {\r
+ dev_err(&client->dev,"Cannot allocate ts INT!ERRNO:%d\n", ret);\r
+ gpio_direction_input(INT_PORT);\r
+ gpio_free(INT_PORT);\r
+ goto err_gpio_request_failed;\r
+ }\r
+ else \r
+ { \r
+ disable_irq(client->irq);\r
+ ts->use_irq = 1;\r
+ dev_dbg(&client->dev,"Reques EIRQ %d succesd on GPIO:%d\n",TS_INT,INT_PORT);\r
+ } \r
+ }\r
+#endif \r
+ if (!ts->use_irq) \r
+ {\r
+ hrtimer_init(&ts->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);\r
+ ts->timer.function = goodix_ts_timer_func;\r
+ hrtimer_start(&ts->timer, ktime_set(1, 0), HRTIMER_MODE_REL);\r
+ }\r
+\r
+#if defined(INT_PORT)\r
+ if(ts->use_irq) \r
+ ts->power = goodix_ts_power;\r
+#endif\r
+\r
+#if 1\r
+ ret = goodix_read_version(ts, &version_info);\r
+ if(ret <= 0)\r
+ {\r
+ printk(KERN_INFO"Read version data failed!\n");\r
+ }\r
+ else\r
+ {\r
+ printk(KERN_INFO"Goodix TouchScreen Version:%s\n", (version_info+1));\r
+ }\r
+ vfree(version_info);\r
+#endif\r
+ \r
+#ifdef CONFIG_HAS_EARLYSUSPEND\r
+ ts->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 1;\r
+ ts->early_suspend.suspend = goodix_ts_early_suspend;\r
+ ts->early_suspend.resume = goodix_ts_late_resume;\r
+ register_early_suspend(&ts->early_suspend);\r
+#endif\r
+#ifdef CONFIG_TOUCHSCREEN_GOODIX_IAP\r
+ goodix_proc_entry = create_proc_entry("goodix-update", 0666, NULL);\r
+ if(goodix_proc_entry == NULL)\r
+ {\r
+ dev_info(&client->dev, "Couldn't create proc entry!\n");\r
+ ret = -ENOMEM;\r
+ goto err_create_proc_entry;\r
+ }\r
+ else\r
+ {\r
+ dev_info(&client->dev, "Create proc entry success!\n");\r
+ printk("Create proc entry success!\n");\r
+ goodix_proc_entry->write_proc = goodix_update_write;\r
+ goodix_proc_entry->read_proc = goodix_update_read;\r
+ //goodix_proc_entry->owner = THIS_MODULE;\r
+ }\r
+#endif\r
+ ts->pendown =PEN_RELEASE;\r
+#if 0\r
+ goodix_debug_sysfs_init();\r
+ dev_info(&client->dev,"Start %s in %s mode\n", \r
+ ts->input_dev->name, ts->use_irq ? "interrupt" : "polling");\r
+ dev_info(&client->dev, "Driver Modify Date:2011-06-13\n");\r
+#endif\r
+ \r
+ if(ts->use_irq)\r
+ enable_irq(client->irq);\r
+ printk("Goodix TS probe successfully!\n");\r
+ return 0;\r
+err_init_godix_ts:\r
+ if(ts->use_irq)\r
+ {\r
+ ts->use_irq = 0;\r
+ free_irq(client->irq,ts);\r
+ #ifdef INT_PORT \r
+ gpio_direction_input(INT_PORT);\r
+ gpio_free(INT_PORT);\r
+ #endif \r
+ }\r
+ else \r
+ hrtimer_cancel(&ts->timer);\r
+\r
+err_gpio_request_failed: \r
+err_input_register_device_failed:\r
+ input_free_device(ts->input_dev);\r
+\r
+err_input_dev_alloc_failed:\r
+ i2c_set_clientdata(client, NULL);\r
+err_i2c_failed: \r
+ kfree(ts);\r
+err_alloc_data_failed:\r
+err_check_functionality_failed:\r
+err_create_proc_entry:\r
+ return ret;\r
+}\r
+\r
+\r
+/*******************************************************\r
+Description:\r
+ Goodix touchscreen driver release function.\r
+\r
+Parameter:\r
+ client: i2c device struct.\r
+ \r
+return:\r
+ Executive outcomes. 0---succeed.\r
+*******************************************************/\r
+static int goodix_ts_remove(struct i2c_client *client)\r
+{\r
+ struct goodix_ts_data *ts = i2c_get_clientdata(client);\r
+#ifdef CONFIG_HAS_EARLYSUSPEND\r
+ unregister_early_suspend(&ts->early_suspend);\r
+#endif\r
+#ifdef CONFIG_TOUCHSCREEN_GOODIX_IAP\r
+ remove_proc_entry("goodix-update", NULL);\r
+#endif\r
+ //goodix_debug_sysfs_deinit();\r
+ if (ts && ts->use_irq) \r
+ {\r
+ #ifdef INT_PORT\r
+ gpio_direction_input(INT_PORT);\r
+ gpio_free(INT_PORT);\r
+ #endif \r
+ free_irq(client->irq, ts);\r
+ } \r
+ else if(ts)\r
+ hrtimer_cancel(&ts->timer);\r
+ \r
+ dev_notice(&client->dev,"The driver is removing...\n");\r
+ i2c_set_clientdata(client, NULL);\r
+ input_unregister_device(ts->input_dev);\r
+ kfree(ts);\r
+ return 0;\r
+}\r
+\r
+static int goodix_ts_suspend(struct i2c_client *client, pm_message_t mesg)\r
+{\r
+ int ret;\r
+ struct goodix_ts_data *ts = i2c_get_clientdata(client);\r
+\r
+ \r
+ if (ts->use_irq)\r
+ disable_irq(client->irq);\r
+ else\r
+ hrtimer_cancel(&ts->timer);\r
+#if 1\r
+ if (ts->power) {\r
+ ret = ts->power(ts, 0);\r
+ if (ret < 0)\r
+ printk(KERN_ERR "goodix_ts_resume power off failed\n");\r
+ }\r
+#endif\r
+ return 0;\r
+}\r
+\r
+static int goodix_ts_resume(struct i2c_client *client)\r
+{\r
+ int ret;\r
+ struct goodix_ts_data *ts = i2c_get_clientdata(client);\r
+ \r
+#if 1\r
+ if (ts->power) {\r
+ ret = ts->power(ts, 1);\r
+ if (ret < 0)\r
+ printk(KERN_ERR "goodix_ts_resume power on failed\n");\r
+ }\r
+#endif\r
+ if (ts->use_irq)\r
+ enable_irq(client->irq);\r
+ else\r
+ hrtimer_start(&ts->timer, ktime_set(1, 0), HRTIMER_MODE_REL);\r
+ //gpio_set_value(RK29_PIN6_PC3,GPIO_HIGH);\r
+\r
+ return 0;\r
+}\r
+\r
+#ifdef CONFIG_HAS_EARLYSUSPEND\r
+static void goodix_ts_early_suspend(struct early_suspend *h)\r
+{\r
+ struct goodix_ts_data *ts;\r
+ ts = container_of(h, struct goodix_ts_data, early_suspend);\r
+ goodix_ts_suspend(ts->client, PMSG_SUSPEND);\r
+}\r
+\r
+static void goodix_ts_late_resume(struct early_suspend *h)\r
+{\r
+ struct goodix_ts_data *ts;\r
+ ts = container_of(h, struct goodix_ts_data, early_suspend);\r
+ goodix_ts_resume(ts->client);\r
+}\r
+#endif\r
+\r
+//******************************Begin of firmware update surpport*******************************\r
+#ifdef CONFIG_TOUCHSCREEN_GOODIX_IAP\r
+/**\r
+@brief CRC cal proc,include : Reflect,init_crc32_table,GenerateCRC32\r
+@param global var oldcrc32\r
+@return states\r
+*/\r
+static unsigned int Reflect(unsigned long int ref, char ch)\r
+{\r
+ unsigned int value=0;\r
+ int i;\r
+ for(i = 1; i < (ch + 1); i++)\r
+ {\r
+ if(ref & 1)\r
+ value |= 1 << (ch - i);\r
+ ref >>= 1;\r
+ }\r
+ return value;\r
+}\r
+/*---------------------------------------------------------------------------------------------------------*/\r
+/* CRC Check Program INIT */\r
+/*---------------------------------------------------------------------------------------------------------*/\r
+static void init_crc32_table(void)\r
+{\r
+ unsigned int temp;\r
+ unsigned int t1,t2;\r
+ unsigned int flag;\r
+ int i,j;\r
+ for(i = 0; i <= 0xFF; i++)\r
+ {\r
+ temp=Reflect(i, 8);\r
+ crc32_table[i]= temp<< 24;\r
+ for (j = 0; j < 8; j++)\r
+ {\r
+\r
+ flag=crc32_table[i]&0x80000000;\r
+ t1=(crc32_table[i] << 1);\r
+ if(flag==0)\r
+ t2=0;\r
+ else\r
+ t2=ulPolynomial;\r
+ crc32_table[i] =t1^t2 ;\r
+\r
+ }\r
+ crc32_table[i] = Reflect(crc32_table[i], 32);\r
+ }\r
+}\r
+/*---------------------------------------------------------------------------------------------------------*/\r
+/* CRC main Program */\r
+/*---------------------------------------------------------------------------------------------------------*/\r
+static void GenerateCRC32(unsigned char * buf, unsigned int len)\r
+{\r
+ unsigned int i;\r
+ unsigned int t;\r
+\r
+ for (i = 0; i != len; ++i)\r
+ {\r
+ t = (oldcrc32 ^ buf[i]) & 0xFF;\r
+ oldcrc32 = ((oldcrc32 >> 8) & 0xFFFFFF) ^ crc32_table[t];\r
+ }\r
+}\r
+\r
+static struct file * update_file_open(char * path, mm_segment_t * old_fs_p)\r
+{\r
+ struct file * filp = NULL;\r
+ int errno = -1;\r
+ \r
+ filp = filp_open(path, O_RDONLY, 0644);\r
+ \r
+ if(!filp || IS_ERR(filp))\r
+ {\r
+ if(!filp)\r
+ errno = -ENOENT;\r
+ else \r
+ errno = PTR_ERR(filp); \r
+ printk(KERN_ERR "The update file for Guitar open error.\n");\r
+ return NULL;\r
+ }\r
+ *old_fs_p = get_fs();\r
+ set_fs(get_ds());\r
+\r
+ filp->f_op->llseek(filp,0,0);\r
+ return filp ;\r
+}\r
+\r
+static void update_file_close(struct file * filp, mm_segment_t old_fs)\r
+{\r
+ set_fs(old_fs);\r
+ if(filp)\r
+ filp_close(filp, NULL);\r
+}\r
+static int update_get_flen(char * path)\r
+{\r
+ struct file * file_ck = NULL;\r
+ mm_segment_t old_fs;\r
+ int length ;\r
+ \r
+ file_ck = update_file_open(path, &old_fs);\r
+ if(file_ck == NULL)\r
+ return 0;\r
+\r
+ length = file_ck->f_op->llseek(file_ck, 0, SEEK_END);\r
+ //printk("File length: %d\n", length);\r
+ if(length < 0)\r
+ length = 0;\r
+ update_file_close(file_ck, old_fs);\r
+ return length; \r
+}\r
+static int update_file_check(char * path)\r
+{\r
+ unsigned char buffer[64] = { 0 } ;\r
+ struct file * file_ck = NULL;\r
+ mm_segment_t old_fs;\r
+ int count, ret, length ;\r
+ \r
+ file_ck = update_file_open(path, &old_fs);\r
+ \r
+ if(path != NULL)\r
+ printk("File Path:%s\n", path);\r
+ \r
+ if(file_ck == NULL)\r
+ return -ERROR_NO_FILE;\r
+\r
+ length = file_ck->f_op->llseek(file_ck, 0, SEEK_END);\r
+#ifdef GUITAR_MESSAGE\r
+ printk(KERN_INFO "gt801 update: File length: %d\n",length);\r
+#endif \r
+ if(length <= 0 || (length%4) != 0)\r
+ {\r
+ update_file_close(file_ck, old_fs);\r
+ return -ERROR_FILE_TYPE;\r
+ }\r
+ \r
+ //set file point to the begining of the file\r
+ file_ck->f_op->llseek(file_ck, 0, SEEK_SET); \r
+ oldcrc32 = 0xFFFFFFFF;\r
+ init_crc32_table();\r
+ while(length > 0)\r
+ {\r
+ ret = file_ck->f_op->read(file_ck, buffer, sizeof(buffer), &file_ck->f_pos);\r
+ if(ret > 0)\r
+ {\r
+ for(count = 0; count < ret; count++) \r
+ GenerateCRC32(&buffer[count],1); \r
+ }\r
+ else \r
+ {\r
+ update_file_close(file_ck, old_fs);\r
+ return -ERROR_FILE_READ;\r
+ }\r
+ length -= ret;\r
+ }\r
+ oldcrc32 = ~oldcrc32;\r
+#ifdef GUITAR_MESSAGE \r
+ printk("CRC_Check: %u\n", oldcrc32);\r
+#endif \r
+ update_file_close(file_ck, old_fs);\r
+ return 1; \r
+}\r
+\r
+unsigned char wait_slave_ready(struct goodix_ts_data *ts, unsigned short *timeout)\r
+{\r
+ unsigned char i2c_state_buf[2] = {ADDR_STA, UNKNOWN_ERROR};\r
+ int ret;\r
+ while(*timeout < MAX_TIMEOUT)\r
+ {\r
+ ret = i2c_read_bytes(ts->client, i2c_state_buf, 2);\r
+ if(ret <= 0)\r
+ return ERROR_I2C_TRANSFER;\r
+ if(i2c_state_buf[1] & SLAVE_READY)\r
+ {\r
+ return i2c_state_buf[1];\r
+ //return 1;\r
+ }\r
+ msleep(10);\r
+ *timeout += 5;\r
+ }\r
+ return 0;\r
+}\r
+\r
+static int goodix_update_write(struct file *filp, const char __user *buff, unsigned long len, void *data)\r
+{\r
+ unsigned char cmd[220];\r
+ int ret = -1;\r
+\r
+ static unsigned char update_path[100];\r
+ static unsigned short time_count = 0;\r
+ static unsigned int file_len = 0;\r
+ \r
+ unsigned char i2c_control_buf[2] = {ADDR_CMD, 0};\r
+ unsigned char i2c_states_buf[2] = {ADDR_STA, 0};\r
+ unsigned char i2c_data_buf[PACK_SIZE+1+8] = {ADDR_DAT,};\r
+ //unsigned char i2c_rd_buf[1+4+PACK_SIZE+4];\r
+ unsigned char i2c_rd_buf[160];\r
+ unsigned char retries = 0;\r
+ unsigned int rd_len;\r
+ unsigned char i = 0;\r
+ static unsigned char update_need_config = 0;\r
+\r
+ unsigned char checksum_error_times = 0;\r
+#ifdef UPDATE_NEW_PROTOCOL\r
+ unsigned int frame_checksum = 0;\r
+ unsigned int frame_number = 0;\r
+#else\r
+ unsigned char send_crc = 0;\r
+#endif\r
+\r
+ struct file * file_data = NULL;\r
+ mm_segment_t old_fs;\r
+ struct goodix_ts_data *ts;\r
+ \r
+ ts = i2c_get_clientdata(i2c_connect_client);\r
+ if(ts==NULL)\r
+ return 0;\r
+ \r
+ if(copy_from_user(&cmd, buff, len))\r
+ {\r
+ return -EFAULT;\r
+ }\r
+ switch(cmd[0])\r
+ {\r
+ case STEP_SET_PATH:\r
+ printk(KERN_INFO"Write cmd is:%d,cmd arg is:%s,write len is:%ld\n",cmd[0], &cmd[1], len);\r
+ memset(update_path, 0, 100);\r
+ strncpy(update_path, cmd+1, 100);\r
+ if(update_path[0] == 0)\r
+ return 0;\r
+ else\r
+ return 1;\r
+ case STEP_CHECK_FILE:\r
+ printk(KERN_INFO"Begin to firmware update ......\n");\r
+ ret = update_file_check(update_path);\r
+ if(ret <= 0)\r
+ {\r
+ printk(KERN_INFO"fialed to check update file!\n");\r
+ return ret;\r
+ }\r
+ msleep(500);\r
+ printk(KERN_INFO"Update check file success!\n");\r
+ return 1;\r
+ case STEP_WRITE_SYN:\r
+ printk(KERN_INFO"STEP1:Write synchronization signal!\n");\r
+ i2c_control_buf[1] = UPDATE_START;\r
+ ret = i2c_write_bytes(ts->client, i2c_control_buf, 2);\r
+ if(ret <= 0)\r
+ {\r
+ ret = ERROR_I2C_TRANSFER;\r
+ return ret;\r
+ }\r
+ //the time include time(APROM -> LDROM) and time(LDROM init)\r
+ msleep(1000);\r
+ return 1;\r
+ case STEP_WAIT_SYN:\r
+ printk(KERN_INFO"STEP2:Wait synchronization signal!\n");\r
+ while(retries < MAX_I2C_RETRIES)\r
+ {\r
+ i2c_states_buf[1] = UNKNOWN_ERROR;\r
+ ret = i2c_read_bytes(ts->client, i2c_states_buf, 2);\r
+ printk(KERN_INFO"The read byte is:%d\n", i2c_states_buf[1]);\r
+ if(i2c_states_buf[1] & UPDATE_START)\r
+ {\r
+ if(i2c_states_buf[1] & NEW_UPDATE_START)\r
+ {\r
+ #ifdef UPDATE_NEW_PROTOCOL\r
+ update_need_config = 1;\r
+ return 2;\r
+ #else\r
+ return 1;\r
+ #endif\r
+ }\r
+ break;\r
+ }\r
+ msleep(5);\r
+ retries++;\r
+ time_count += 10;\r
+ }\r
+ if((retries >= MAX_I2C_RETRIES) && (!(i2c_states_buf[1] & UPDATE_START)))\r
+ {\r
+ if(ret <= 0)\r
+ return 0;\r
+ else\r
+ return -1;\r
+ }\r
+ return 1;\r
+ case STEP_WRITE_LENGTH:\r
+ printk(KERN_INFO"STEP3:Write total update file length!\n");\r
+ file_len = update_get_flen(update_path);\r
+ if(file_len <= 0)\r
+ {\r
+ printk(KERN_INFO"get update file length failed!\n");\r
+ return -1;\r
+ }\r
+ file_len += 4;\r
+ i2c_data_buf[1] = (file_len>>24) & 0xff;\r
+ i2c_data_buf[2] = (file_len>>16) & 0xff;\r
+ i2c_data_buf[3] = (file_len>>8) & 0xff;\r
+ i2c_data_buf[4] = file_len & 0xff;\r
+ file_len -= 4;\r
+ ret = i2c_write_bytes(ts->client, i2c_data_buf, 5);\r
+ if(ret <= 0)\r
+ {\r
+ ret = ERROR_I2C_TRANSFER;\r
+ return 0;\r
+ }\r
+ return 1;\r
+ case STEP_WAIT_READY:\r
+ printk(KERN_INFO"STEP4:Wait slave ready!\n");\r
+ ret = wait_slave_ready(ts, &time_count);\r
+ if(ret == ERROR_I2C_TRANSFER)\r
+ return 0;\r
+ if(!ret)\r
+ {\r
+ return -1;\r
+ }\r
+ printk(KERN_INFO"Slave ready!\n");\r
+ return 1;\r
+ case STEP_WRITE_DATA:\r
+#ifdef UPDATE_NEW_PROTOCOL\r
+ printk(KERN_INFO"STEP5:Begin to send file data use NEW protocol!\n");\r
+ file_data = update_file_open(update_path, &old_fs);\r
+ if(file_data == NULL)\r
+ {\r
+ return -1;\r
+ }\r
+ frame_number = 0;\r
+ while(file_len >= 0)\r
+ {\r
+ i2c_data_buf[0] = ADDR_DAT;\r
+ rd_len = (file_len >= PACK_SIZE) ? PACK_SIZE : file_len;\r
+ frame_checksum = 0;\r
+ if(file_len)\r
+ {\r
+ ret = file_data->f_op->read(file_data, i2c_data_buf+1+4, rd_len, &file_data->f_pos);\r
+ if(ret <= 0)\r
+ {\r
+ printk("[GOODiX_ISP_NEW]:Read File Data Failed!\n");\r
+ return -1;\r
+ }\r
+ i2c_data_buf[1] = (frame_number>>24)&0xff;\r
+ i2c_data_buf[2] = (frame_number>>16)&0xff;\r
+ i2c_data_buf[3] = (frame_number>>8)&0xff;\r
+ i2c_data_buf[4] = frame_number&0xff;\r
+ frame_number++;\r
+ frame_checksum = 0;\r
+ for(i=0; i<rd_len; i++)\r
+ {\r
+ frame_checksum += i2c_data_buf[5+i];\r
+ }\r
+ frame_checksum = 0 - frame_checksum;\r
+ i2c_data_buf[5+rd_len+0] = frame_checksum&0xff;\r
+ i2c_data_buf[5+rd_len+1] = (frame_checksum>>8)&0xff;\r
+ i2c_data_buf[5+rd_len+2] = (frame_checksum>>16)&0xff;\r
+ i2c_data_buf[5+rd_len+3] = (frame_checksum>>24)&0xff;\r
+ }\r
+rewrite:\r
+ printk(KERN_INFO"[GOODiX_ISP_NEW]:%d\n", file_len); \r
+ ret = i2c_write_bytes(ts->client, i2c_data_buf, 1+4+rd_len+4);\r
+ //if(ret <= 0)\r
+ if(ret != 1)\r
+ {\r
+ printk("[GOODiX_ISP_NEW]:Write File Data Failed!Return:%d\n", ret);\r
+ return 0;\r
+ }\r
+\r
+ memset(i2c_rd_buf, 0x00, 1+4+rd_len+4);\r
+ ret = i2c_read_bytes(ts->client, i2c_rd_buf, 1+4+rd_len+4);\r
+ if(ret != 2)\r
+ {\r
+ printk("[GOODiX_ISP_NEW]:Read File Data Failed!Return:%d\n", ret);\r
+ return 0;\r
+ }\r
+ for(i=1; i<(1+4+rd_len+4); i++) //check communication\r
+ {\r
+ if(i2c_rd_buf[i] != i2c_data_buf[i])\r
+ {\r
+ i = 0;\r
+ break;\r
+ }\r
+ }\r
+ if(!i)\r
+ {\r
+ i2c_control_buf[0] = ADDR_CMD;\r
+ i2c_control_buf[1] = 0x03;\r
+ i2c_write_bytes(ts->client, i2c_control_buf, 2); //communication error\r
+ printk("[GOODiX_ISP_NEW]:File Data Frame readback check Error!\n");\r
+ }\r
+ else\r
+ {\r
+ i2c_control_buf[1] = 0x04; //let LDROM write flash\r
+ i2c_write_bytes(ts->client, i2c_control_buf, 2);\r
+ }\r
+ \r
+ //Wait for slave ready signal.and read the checksum\r
+ ret = wait_slave_ready(ts, &time_count);\r
+ if((ret & CHECKSUM_ERROR)||(!i))\r
+ {\r
+ if(i)\r
+ {\r
+ printk("[GOODiX_ISP_NEW]:File Data Frame checksum Error!\n");\r
+ }\r
+ checksum_error_times++;\r
+ msleep(20);\r
+ if(checksum_error_times > 20) //max retry times.\r
+ return 0;\r
+ goto rewrite;\r
+ }\r
+ checksum_error_times = 0;\r
+ if(ret & (FRAME_ERROR))\r
+ {\r
+ printk("[GOODiX_ISP_NEW]:File Data Frame Miss!\n");\r
+ return 0;\r
+ }\r
+ if(ret == ERROR_I2C_TRANSFER)\r
+ return 0;\r
+ if(!ret)\r
+ {\r
+ return -1;\r
+ }\r
+ if(file_len < PACK_SIZE)\r
+ {\r
+ update_file_close(file_data, old_fs);\r
+ break;\r
+ }\r
+ file_len -= rd_len;\r
+ }//end of while((file_len >= 0))\r
+ return 1;\r
+#else\r
+ printk(KERN_INFO"STEP5:Begin to send file data use OLD protocol!\n");\r
+ file_data = update_file_open(update_path, &old_fs);\r
+ if(file_data == NULL) //file_data has been opened at the last time\r
+ {\r
+ return -1;\r
+ }\r
+ while((file_len >= 0) && (!send_crc))\r
+ {\r
+ printk(KERN_INFO"[GOODiX_ISP_OLD]:%d\n", file_len);\r
+ i2c_data_buf[0] = ADDR_DAT;\r
+ rd_len = (file_len >= PACK_SIZE) ? PACK_SIZE : file_len;\r
+ if(file_len)\r
+ {\r
+ ret = file_data->f_op->read(file_data, i2c_data_buf+1, rd_len, &file_data->f_pos);\r
+ if(ret <= 0)\r
+ {\r
+ return -1;\r
+ }\r
+ }\r
+ if(file_len < PACK_SIZE)\r
+ {\r
+ send_crc = 1;\r
+ update_file_close(file_data, old_fs);\r
+ i2c_data_buf[file_len+1] = oldcrc32&0xff;\r
+ i2c_data_buf[file_len+2] = (oldcrc32>>8)&0xff;\r
+ i2c_data_buf[file_len+3] = (oldcrc32>>16)&0xff;\r
+ i2c_data_buf[file_len+4] = (oldcrc32>>24)&0xff;\r
+ ret = i2c_write_bytes(ts->client, i2c_data_buf, (file_len+1+4));\r
+ //if(ret <= 0)\r
+ if(ret != 1)\r
+ {\r
+ printk("[GOODiX_ISP_OLD]:Write File Data Failed!Return:%d\n", ret);\r
+ return 0;\r
+ }\r
+ break;\r
+ }\r
+ else\r
+ {\r
+ ret = i2c_write_bytes(ts->client, i2c_data_buf, PACK_SIZE+1);\r
+ //if(ret <= 0)\r
+ if(ret != 1)\r
+ {\r
+ printk("[GOODiX_ISP_OLD]:Write File Data Failed!Return:%d\n", ret);\r
+ return 0;\r
+ }\r
+ }\r
+ file_len -= rd_len;\r
+ \r
+ //Wait for slave ready signal.\r
+ ret = wait_slave_ready(ts, &time_count);\r
+ if(ret == ERROR_I2C_TRANSFER)\r
+ return 0;\r
+ if(!ret)\r
+ {\r
+ return -1;\r
+ }\r
+ //Slave is ready.\r
+ }//end of while((file_len >= 0) && (!send_crc))\r
+ return 1;\r
+#endif\r
+ case STEP_READ_STATUS:\r
+ printk(KERN_INFO"STEP6:Read update status!\n");\r
+ while(time_count < MAX_TIMEOUT)\r
+ {\r
+ ret = i2c_read_bytes(ts->client, i2c_states_buf, 2);\r
+ if(ret <= 0)\r
+ {\r
+ return 0;\r
+ }\r
+ if(i2c_states_buf[1] & SLAVE_READY)\r
+ {\r
+ if(!(i2c_states_buf[1] &0xf0))\r
+ {\r
+ printk(KERN_INFO"The firmware updating succeed!update state:0x%x\n",i2c_states_buf[1]);\r
+ return 1;\r
+ }\r
+ else\r
+ {\r
+ printk(KERN_INFO"The firmware updating failed!update state:0x%x\n",i2c_states_buf[1]);\r
+ return 0;\r
+\r
+ }\r
+ }\r
+ msleep(1);\r
+ time_count += 5;\r
+ }\r
+ return -1;\r
+ case FUN_CLR_VAL: //clear the static val\r
+ time_count = 0;\r
+ file_len = 0;\r
+ update_need_config = 0;\r
+ return 1;\r
+ case FUN_CMD: //functional command\r
+ if(cmd[1] == CMD_DISABLE_TP)\r
+ {\r
+ printk(KERN_INFO"Disable TS int!\n");\r
+ g_enter_isp = 1;\r
+ if(ts->use_irq)\r
+ disable_irq(TS_INT);\r
+ }\r
+ else if(cmd[1] == CMD_ENABLE_TP)\r
+ {\r
+ printk(KERN_INFO"Enable TS int!\n");\r
+ g_enter_isp = 0;\r
+ if(ts->use_irq)\r
+ enable_irq(TS_INT);\r
+ }\r
+ else if(cmd[1] == CMD_READ_VER)\r
+ {\r
+ printk(KERN_INFO"Read version!\n");\r
+ ts->read_mode = MODE_RD_VER;\r
+ }\r
+ else if(cmd[1] == CMD_READ_RAW)\r
+ {\r
+ printk(KERN_INFO"Read raw data!\n");\r
+ ts->read_mode = MODE_RD_RAW;\r
+ i2c_control_buf[1] = 201;\r
+ ret = i2c_write_bytes(ts->client, i2c_control_buf, 2); //read raw data cmd\r
+ if(ret <= 0)\r
+ {\r
+ printk(KERN_INFO"Write read raw data cmd failed!\n");\r
+ return 0;\r
+ }\r
+ msleep(200);\r
+ }\r
+ else if(cmd[1] == CMD_READ_DIF)\r
+ {\r
+ printk(KERN_INFO"Read diff data!\n");\r
+ ts->read_mode = MODE_RD_DIF;\r
+ i2c_control_buf[1] = 202;\r
+ ret = i2c_write_bytes(ts->client, i2c_control_buf, 2); //read diff data cmd\r
+ if(ret <= 0)\r
+ {\r
+ printk(KERN_INFO"Write read raw data cmd failed!\n");\r
+ return 0;\r
+ }\r
+ msleep(200);\r
+ }\r
+ else if(cmd[1] == CMD_READ_CFG)\r
+ {\r
+ printk(KERN_INFO"Read config info!\n");\r
+ ts->read_mode = MODE_RD_CFG;\r
+ rd_cfg_addr = cmd[2];\r
+ rd_cfg_len = cmd[3];\r
+ }\r
+ else if(cmd[1] == CMD_SYS_REBOOT)\r
+ {\r
+ printk(KERN_INFO"System reboot!\n");\r
+ sys_sync();\r
+ msleep(200);\r
+ kernel_restart(NULL);\r
+ }\r
+ return 1;\r
+ case FUN_WRITE_CONFIG:\r
+ \r
+ printk(KERN_INFO"Begin write config info!Config length:%d\n",cmd[1]);\r
+ for(i=3; i<cmd[1];i++)\r
+ {\r
+ //if((i-3)%5 == 0)printk("\n");\r
+ printk("(%d):0x%x ", i-3, cmd[i]);\r
+ }\r
+ printk("\n");\r
+\r
+ if((cmd[2]>83)&&(cmd[2]<240)&&cmd[1])\r
+ {\r
+ checksum_error_times = 0;\r
+reconfig:\r
+ ret = i2c_write_bytes(ts->client, cmd+2, cmd[1]); \r
+ if(ret != 1)\r
+ {\r
+ printk("Write Config failed!return:%d\n",ret);\r
+ return -1;\r
+ }\r
+ if(!update_need_config)return 1;\r
+ \r
+ i2c_rd_buf[0] = cmd[2];\r
+ ret = i2c_read_bytes(ts->client, i2c_rd_buf, cmd[1]);\r
+ if(ret != 2)\r
+ {\r
+ printk("Read Config failed!return:%d\n",ret);\r
+ return -1;\r
+ }\r
+ for(i=0; i<cmd[1]; i++)\r
+ {\r
+ if(i2c_rd_buf[i] != cmd[i+2])\r
+ {\r
+ printk("Config readback check failed!\n");\r
+ i = 0;\r
+ break;\r
+ }\r
+ }\r
+ if(!i)\r
+ {\r
+ i2c_control_buf[0] = ADDR_CMD;\r
+ i2c_control_buf[1] = 0x03;\r
+ i2c_write_bytes(ts->client, i2c_control_buf, 2); //communication error\r
+ checksum_error_times++;\r
+ msleep(20);\r
+ if(checksum_error_times > 20) //max retry times.\r
+ return 0;\r
+ goto reconfig;\r
+ }\r
+ else\r
+ {\r
+ i2c_control_buf[0] = ADDR_CMD;\r
+ i2c_control_buf[1] = 0x04; //let LDROM write flash\r
+ i2c_write_bytes(ts->client, i2c_control_buf, 2);\r
+ return 1;\r
+ }\r
+ \r
+ }\r
+ else\r
+ {\r
+ printk(KERN_INFO"Invalid config addr!\n");\r
+ return -1;\r
+ }\r
+ default:\r
+ return -ENOSYS;\r
+ }\r
+ return 0;\r
+}\r
+\r
+static int goodix_update_read( char *page, char **start, off_t off, int count, int *eof, void *data )\r
+{\r
+ int ret = -1;\r
+ struct goodix_ts_data *ts;\r
+ int len = 0;\r
+ char *version_info = NULL;\r
+ unsigned char read_data[1201] = {80, };\r
+\r
+ ts = i2c_get_clientdata(i2c_connect_client);\r
+ if(ts==NULL)\r
+ return 0;\r
+\r
+ if(ts->read_mode == MODE_RD_VER) //read version data\r
+ {\r
+ ret = goodix_read_version(ts, &version_info);\r
+ if(ret <= 0)\r
+ {\r
+ printk(KERN_INFO"Read version data failed!\n");\r
+ vfree(version_info);\r
+ return 0;\r
+ }\r
+\r
+ for(len=0;len<100;len++)\r
+ {\r
+ if(*(version_info + len) == '\0')\r
+ break;\r
+ }\r
+ printk(KERN_INFO"GOODiX Touchscreen Version is:%s\n", (version_info+1));\r
+ strncpy(page, version_info+1, len + 1);\r
+ vfree(version_info);\r
+ *eof = 1;\r
+ return len+1;\r
+ }\r
+ else if((ts->read_mode == MODE_RD_RAW)||(ts->read_mode == MODE_RD_DIF)) //read raw data or diff\r
+ {\r
+ //printk(KERN_INFO"Read raw data\n");\r
+ ret = i2c_read_bytes(ts->client, read_data, 1201);\r
+ if(ret <= 0)\r
+ {\r
+ if(ts->read_mode == 2)\r
+ printk(KERN_INFO"Read raw data failed!\n");\r
+ if(ts->read_mode == 3)\r
+ printk(KERN_INFO"Read diff data failed!\n");\r
+ return 0;\r
+ }\r
+ memcpy(page, read_data+1, 1200);\r
+ *eof = 1;\r
+ *start = NULL;\r
+ return 1200;\r
+ }\r
+ else if(ts->read_mode == MODE_RD_CFG)\r
+ {\r
+ if((rd_cfg_addr>83)&&(rd_cfg_addr<240))\r
+ {\r
+ read_data[0] = rd_cfg_addr;\r
+ printk("read config addr is:%d\n", rd_cfg_addr);\r
+ }\r
+ else\r
+ {\r
+ read_data[0] = 101;\r
+ printk("invalid read config addr,use default!\n");\r
+ }\r
+ if((rd_cfg_len<0)||(rd_cfg_len>156))\r
+ {\r
+ printk("invalid read config length,use default!\n");\r
+ rd_cfg_len = 239 - read_data[0];\r
+ }\r
+ printk("read config length is:%d\n", rd_cfg_len);\r
+ ret = i2c_read_bytes(ts->client, read_data, rd_cfg_len);\r
+ if(ret <= 0)\r
+ {\r
+ printk(KERN_INFO"Read config info failed!\n");\r
+ return 0;\r
+ }\r
+ memcpy(page, read_data+1, rd_cfg_len);\r
+ return rd_cfg_len;\r
+ }\r
+ return len;\r
+}\r
+ \r
+#endif\r
+//******************************End of firmware update surpport*******************************\r
+static const struct i2c_device_id goodix_ts_id[] = {\r
+ { "Goodix-TS", 0 },\r
+ { }\r
+};\r
+\r
+static struct i2c_driver goodix_ts_driver = {\r
+ .probe = goodix_ts_probe,\r
+ .remove = goodix_ts_remove,\r
+#ifndef CONFIG_HAS_EARLYSUSPEND\r
+ .suspend = goodix_ts_suspend,\r
+ .resume = goodix_ts_resume,\r
+#endif\r
+ .id_table = goodix_ts_id,\r
+ .driver = {\r
+ .name = "Goodix-TS",\r
+ .owner = THIS_MODULE,\r
+ },\r
+};\r
+\r
+/******************************************************* \r
+Description:\r
+ Driver Install function.\r
+return:\r
+ Executive Outcomes. 0---succeed.\r
+********************************************************/\r
+static int __devinit goodix_ts_init(void)\r
+{\r
+ int ret;\r
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)\r
+ goodix_wq = create_rt_workqueue("goodix_wq"); //create a work queue and worker thread\r
+#else\r
+ goodix_wq = create_workqueue("goodix_touch_wq"); \r
+#endif\r
+ if (!goodix_wq) {\r
+ printk(KERN_ALERT "creat workqueue faiked\n");\r
+ return -ENOMEM;\r
+ \r
+ }\r
+ ret=i2c_add_driver(&goodix_ts_driver);\r
+ return ret; \r
+}\r
+\r
+/******************************************************* \r
+Description:\r
+ Driver uninstall function.\r
+return:\r
+ Executive Outcomes. 0---succeed.\r
+********************************************************/\r
+static void __exit goodix_ts_exit(void)\r
+{\r
+ printk(KERN_ALERT "Touchscreen driver of guitar exited.\n");\r
+ i2c_del_driver(&goodix_ts_driver);\r
+ if (goodix_wq)\r
+ destroy_workqueue(goodix_wq); //release our work queue\r
+}\r
+\r
+module_init(goodix_ts_init);\r
+module_exit(goodix_ts_exit);\r
+\r
+MODULE_DESCRIPTION("Goodix Touchscreen Driver");\r
+MODULE_LICENSE("GPL");\r
--- /dev/null
+/*
+ * include/linux/goodix_touch.h
+ *
+ * Copyright (C) 2010 - 2011 Goodix, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ */
+
+#ifndef _LINUX_GOODIX_TOUCH_H
+#define _LINUX_GOODIX_TOUCH_H
+
+#include <linux/earlysuspend.h>
+#include <linux/hrtimer.h>
+#include <linux/i2c.h>
+#include <linux/input.h>
+
+//*************************TouchScreen Work Part*****************************
+
+#define GOODIX_I2C_NAME "Goodix-TS"
+#define GOODIX_1024X768
+#ifdef GOODIX_1024X768
+#define TOUCH_MAX_HEIGHT 1024
+#define TOUCH_MAX_WIDTH 768
+#else
+//define resolution of the touchscreen
+#define TOUCH_MAX_HEIGHT 1280
+#define TOUCH_MAX_WIDTH 800
+#endif
+#if 1
+#define INT_PORT RK29_PIN0_PA2
+#ifdef INT_PORT
+ #define TS_INT gpio_to_irq(INT_PORT)
+// #define INT_CFG S3C_GPIO_SFN(2) //IO configer as EINT
+#else
+ #define TS_INT 0
+#endif
+
+//whether need send cfg?
+//#define DRIVER_SEND_CFG
+
+//set trigger mode
+#define INT_TRIGGER 0
+
+#endif
+
+#define POLL_TIME 10 //actual query spacing interval:POLL_TIME+6
+
+#define GOODIX_MULTI_TOUCH
+#ifdef GOODIX_MULTI_TOUCH
+ #define MAX_FINGER_NUM 10
+#else
+ #define MAX_FINGER_NUM 1
+#endif
+
+//#define swap(x, y) do { typeof(x) z = x; x = y; y = z; } while (0)
+
+struct goodix_ts_data {
+ uint16_t addr;
+ uint8_t bad_data;
+ struct i2c_client *client;
+ struct input_dev *input_dev;
+ int use_reset; //use RESET flag
+ int use_irq; //use EINT flag
+ int read_mode; //read moudle mode,20110221 by andrew
+ struct hrtimer timer;
+ struct delayed_work work;
+ char phys[32];
+ int retry;
+ struct early_suspend early_suspend;
+ int (*power)(struct goodix_ts_data * ts, int on);
+ uint16_t abs_x_max;
+ uint16_t abs_y_max;
+ uint8_t max_touch_num;
+ uint8_t int_trigger_type;
+ bool pendown;
+};
+
+static const char *goodix_ts_name = "Goodix Capacitive TouchScreen";
+static struct workqueue_struct *goodix_wq;
+struct i2c_client * i2c_connect_client = NULL;
+static struct proc_dir_entry *goodix_proc_entry;
+static struct kobject *goodix_debug_kobj;
+
+#ifdef CONFIG_HAS_EARLYSUSPEND
+static void goodix_ts_early_suspend(struct early_suspend *h);
+static void goodix_ts_late_resume(struct early_suspend *h);
+#endif
+
+#define READ_COOR_ADDR 0x01
+
+//*****************************End of Part I *********************************
+
+//*************************Touchkey Surpport Part*****************************
+//#define HAVE_TOUCH_KEY
+#ifdef HAVE_TOUCH_KEY
+ #define READ_COOR_ADDR 0x00
+ const uint16_t touch_key_array[]={
+ KEY_MENU, //MENU
+ KEY_HOME, //HOME
+ KEY_SEND //CALL
+ };
+ #define MAX_KEY_NUM (sizeof(touch_key_array)/sizeof(touch_key_array[0]))
+#else
+ #define READ_COOR_ADDR 0x01
+#endif
+//*****************************End of Part II*********************************
+#if 1
+//*************************Firmware Update part*******************************
+#define CONFIG_TOUCHSCREEN_GOODIX_IAP
+#ifdef CONFIG_TOUCHSCREEN_GOODIX_IAP
+#define UPDATE_NEW_PROTOCOL
+
+unsigned int oldcrc32 = 0xFFFFFFFF;
+unsigned int crc32_table[256];
+unsigned int ulPolynomial = 0x04c11db7;
+unsigned char rd_cfg_addr;
+unsigned char rd_cfg_len;
+unsigned char g_enter_isp = 0;
+
+static int goodix_update_write(struct file *filp, const char __user *buff, unsigned long len, void *data);
+static int goodix_update_read( char *page, char **start, off_t off, int count, int *eof, void *data );
+
+#define PACK_SIZE 64 //update file package size
+#define MAX_TIMEOUT 60000 //update time out conut
+#define MAX_I2C_RETRIES 20 //i2c retry times
+
+//I2C buf address
+#define ADDR_CMD 80
+#define ADDR_STA 81
+#ifdef UPDATE_NEW_PROTOCOL
+ #define ADDR_DAT 0
+#else
+ #define ADDR_DAT 82
+#endif
+
+//moudle state
+#define NEW_UPDATE_START 0x01
+#define UPDATE_START 0x02
+#define SLAVE_READY 0x08
+#define UNKNOWN_ERROR 0x00
+#define FRAME_ERROR 0x10
+#define CHECKSUM_ERROR 0x20
+#define TRANSLATE_ERROR 0x40
+#define FLASH_ERROR 0X80
+
+//error no
+#define ERROR_NO_FILE 2 //ENOENT
+#define ERROR_FILE_READ 23 //ENFILE
+#define ERROR_FILE_TYPE 21 //EISDIR
+#define ERROR_GPIO_REQUEST 4 //EINTR
+#define ERROR_I2C_TRANSFER 5 //EIO
+#define ERROR_NO_RESPONSE 16 //EBUSY
+#define ERROR_TIMEOUT 110 //ETIMEDOUT
+
+//update steps
+#define STEP_SET_PATH 1
+#define STEP_CHECK_FILE 2
+#define STEP_WRITE_SYN 3
+#define STEP_WAIT_SYN 4
+#define STEP_WRITE_LENGTH 5
+#define STEP_WAIT_READY 6
+#define STEP_WRITE_DATA 7
+#define STEP_READ_STATUS 8
+#define FUN_CLR_VAL 9
+#define FUN_CMD 10
+#define FUN_WRITE_CONFIG 11
+
+//fun cmd
+#define CMD_DISABLE_TP 0
+#define CMD_ENABLE_TP 1
+#define CMD_READ_VER 2
+#define CMD_READ_RAW 3
+#define CMD_READ_DIF 4
+#define CMD_READ_CFG 5
+#define CMD_SYS_REBOOT 101
+
+//read mode
+#define MODE_RD_VER 1
+#define MODE_RD_RAW 2
+#define MODE_RD_DIF 3
+#define MODE_RD_CFG 4
+
+
+#endif
+//*****************************End of Part III********************************
+#endif
+struct goodix_i2c_platform_data {
+ uint32_t version; /* Use this entry for panels with */
+ //reservation
+};
+
+#endif /* _LINUX_GOODIX_TOUCH_H */