diff --git a/.config b/.config deleted file mode 100644 index 293af05..0000000 --- a/.config +++ /dev/null @@ -1,3849 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# Linux/arm 3.10.40 Kernel Configuration -# -CONFIG_ARM=y -CONFIG_ARM_HAS_SG_CHAIN=y -CONFIG_MIGHT_HAVE_PCI=y -CONFIG_SYS_SUPPORTS_APM_EMULATION=y -CONFIG_HAVE_PROC_CPU=y -CONFIG_STACKTRACE_SUPPORT=y -CONFIG_LOCKDEP_SUPPORT=y -CONFIG_TRACE_IRQFLAGS_SUPPORT=y -CONFIG_RWSEM_GENERIC_SPINLOCK=y -CONFIG_ARCH_HAS_CPUFREQ=y -CONFIG_GENERIC_HWEIGHT=y -CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_NEED_DMA_MAP_STATE=y -CONFIG_ARCH_WANT_KMAP_ATOMIC_FLUSH=y -CONFIG_VECTORS_BASE=0xffff0000 -# CONFIG_ARM_PATCH_PHYS_VIRT is not set -CONFIG_NEED_MACH_GPIO_H=y -CONFIG_NEED_MACH_IO_H=y -CONFIG_NEED_MACH_MEMORY_H=y -CONFIG_PHYS_OFFSET=0x00000000 -CONFIG_GENERIC_BUG=y -CONFIG_BOOTINFO=y -# CONFIG_ARCH_RANDOM is not set -CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" -CONFIG_IRQ_WORK=y -CONFIG_BUILDTIME_EXTABLE_SORT=y - -# -# General setup -# -CONFIG_INIT_ENV_ARG_LIMIT=32 -CONFIG_CROSS_COMPILE="" -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_HAVE_KERNEL_GZIP=y -CONFIG_HAVE_KERNEL_LZMA=y -CONFIG_HAVE_KERNEL_XZ=y -CONFIG_HAVE_KERNEL_LZO=y -CONFIG_KERNEL_GZIP=y -# CONFIG_KERNEL_LZMA is not set -# CONFIG_KERNEL_XZ is not set -# CONFIG_KERNEL_LZO is not set -CONFIG_DEFAULT_HOSTNAME="(none)" -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -CONFIG_SYSVIPC_SYSCTL=y -# CONFIG_POSIX_MQUEUE is not set -# CONFIG_FHANDLE is not set -CONFIG_AUDIT=y -# CONFIG_AUDITSYSCALL is not set -# CONFIG_AUDIT_LOGINUID_IMMUTABLE is not set -CONFIG_HAVE_GENERIC_HARDIRQS=y - -# -# IRQ subsystem -# -CONFIG_GENERIC_HARDIRQS=y -CONFIG_GENERIC_IRQ_PROBE=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_HARDIRQS_SW_RESEND=y -CONFIG_IRQ_DOMAIN=y -# CONFIG_IRQ_DOMAIN_DEBUG is not set -CONFIG_SPARSE_IRQ=y -CONFIG_KTIME_SCALAR=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CLOCKEVENTS_BUILD=y -CONFIG_ARCH_HAS_TICK_BROADCAST=y -CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y - -# -# Timers subsystem -# -CONFIG_TICK_ONESHOT=y -CONFIG_NO_HZ_COMMON=y -# CONFIG_HZ_PERIODIC is not set -CONFIG_NO_HZ_IDLE=y -CONFIG_NO_HZ=y -CONFIG_HIGH_RES_TIMERS=y - -# -# CPU/Task time and stats accounting -# -CONFIG_TICK_CPU_ACCOUNTING=y -# CONFIG_IRQ_TIME_ACCOUNTING is not set -# CONFIG_BSD_PROCESS_ACCT is not set -# CONFIG_TASKSTATS is not set - -# -# RCU Subsystem -# -CONFIG_TREE_PREEMPT_RCU=y -CONFIG_PREEMPT_RCU=y -CONFIG_RCU_STALL_COMMON=y -# CONFIG_RCU_USER_QS is not set -CONFIG_RCU_FANOUT=32 -CONFIG_RCU_FANOUT_LEAF=16 -# CONFIG_RCU_FANOUT_EXACT is not set -CONFIG_RCU_FAST_NO_HZ=y -# CONFIG_TREE_RCU_TRACE is not set -# CONFIG_RCU_BOOST is not set -# CONFIG_RCU_NOCB_CPU is not set -# CONFIG_IKCONFIG is not set -CONFIG_LOG_BUF_SHIFT=20 -CONFIG_CGROUPS=y -# CONFIG_CGROUP_DEBUG is not set -CONFIG_CGROUP_FREEZER=y -# CONFIG_CGROUP_DEVICE is not set -# CONFIG_CPUSETS is not set -CONFIG_CGROUP_CPUACCT=y -CONFIG_RESOURCE_COUNTERS=y -# CONFIG_MEMCG is not set -# CONFIG_CGROUP_PERF is not set -CONFIG_CGROUP_SCHED=y -CONFIG_FAIR_GROUP_SCHED=y -# CONFIG_CFS_BANDWIDTH is not set -CONFIG_RT_GROUP_SCHED=y -# CONFIG_BLK_CGROUP is not set -# CONFIG_CHECKPOINT_RESTORE is not set -CONFIG_NAMESPACES=y -# CONFIG_UTS_NS is not set -# CONFIG_IPC_NS is not set -# CONFIG_USER_NS is not set -# CONFIG_PID_NS is not set -CONFIG_NET_NS=y -CONFIG_UIDGID_CONVERTED=y -# CONFIG_UIDGID_STRICT_TYPE_CHECKS is not set -# CONFIG_SCHED_AUTOGROUP is not set -# CONFIG_SYSFS_DEPRECATED is not set -CONFIG_RELAY=y -CONFIG_BLK_DEV_INITRD=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_RD_GZIP=y -CONFIG_RD_BZIP2=y -CONFIG_RD_LZMA=y -# 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_HAVE_UID16=y -CONFIG_HOTPLUG=y -CONFIG_PANIC_TIMEOUT=1 -CONFIG_EXPERT=y -CONFIG_UID16=y -# CONFIG_SYSCTL_SYSCALL is not set -CONFIG_KALLSYMS=y -CONFIG_KALLSYMS_ALL=y -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_ELF_CORE=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -CONFIG_SIGNALFD=y -CONFIG_TIMERFD=y -CONFIG_EVENTFD=y -CONFIG_SHMEM=y -CONFIG_AIO=y -CONFIG_PCI_QUIRKS=y -CONFIG_EMBEDDED=y -CONFIG_HAVE_PERF_EVENTS=y -CONFIG_PERF_USE_VMALLOC=y - -# -# Kernel Performance Events And Counters -# -CONFIG_PERF_EVENTS=y -# CONFIG_DEBUG_PERF_USE_VMALLOC is not set -CONFIG_VM_EVENT_COUNTERS=y -CONFIG_SLUB_DEBUG=y -CONFIG_COMPAT_BRK=y -# CONFIG_SLAB is not set -CONFIG_SLUB=y -# CONFIG_SLOB is not set -CONFIG_PROFILING=y -CONFIG_TRACEPOINTS=y -# CONFIG_OPROFILE is not set -CONFIG_HAVE_OPROFILE=y -# CONFIG_JUMP_LABEL is not set -# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set -CONFIG_HAVE_KPROBES=y -CONFIG_HAVE_KRETPROBES=y -CONFIG_HAVE_ARCH_TRACEHOOK=y -CONFIG_HAVE_DMA_ATTRS=y -CONFIG_HAVE_DMA_CONTIGUOUS=y -CONFIG_USE_GENERIC_SMP_HELPERS=y -CONFIG_GENERIC_SMP_IDLE_THREAD=y -CONFIG_GENERIC_IDLE_POLL_SETUP=y -CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y -CONFIG_HAVE_CLK=y -CONFIG_HAVE_DMA_API_DEBUG=y -CONFIG_HAVE_HW_BREAKPOINT=y -CONFIG_HAVE_ARCH_JUMP_LABEL=y -CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y -CONFIG_HAVE_ARCH_SECCOMP_FILTER=y -CONFIG_SECCOMP_FILTER=y -CONFIG_HAVE_CONTEXT_TRACKING=y -CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y -CONFIG_HAVE_MOD_ARCH_SPECIFIC=y -CONFIG_MODULES_USE_ELF_REL=y -CONFIG_CLONE_BACKWARDS=y -CONFIG_OLD_SIGSUSPEND3=y -CONFIG_OLD_SIGACTION=y - -# -# GCOV-based kernel profiling -# -# CONFIG_GCOV_KERNEL is not set -CONFIG_HAVE_GENERIC_DMA_COHERENT=y -CONFIG_SLABINFO=y -CONFIG_RT_MUTEXES=y -CONFIG_BASE_SMALL=0 -# CONFIG_MODULES is not set -CONFIG_STOP_MACHINE=y -CONFIG_BLOCK=y -CONFIG_LBDAF=y -CONFIG_BLK_DEV_BSG=y -# CONFIG_BLK_DEV_BSGLIB is not set -# CONFIG_BLK_DEV_INTEGRITY is not set - -# -# Partition Types -# -CONFIG_PARTITION_ADVANCED=y -# CONFIG_ACORN_PARTITION is not set -# CONFIG_OSF_PARTITION is not set -# CONFIG_AMIGA_PARTITION is not set -# CONFIG_ATARI_PARTITION is not set -# CONFIG_MAC_PARTITION is not set -CONFIG_MSDOS_PARTITION=y -# CONFIG_BSD_DISKLABEL is not set -# CONFIG_MINIX_SUBPARTITION is not set -# CONFIG_SOLARIS_X86_PARTITION is not set -# CONFIG_UNIXWARE_DISKLABEL is not set -# CONFIG_LDM_PARTITION is not set -# CONFIG_SGI_PARTITION is not set -# CONFIG_ULTRIX_PARTITION is not set -# CONFIG_SUN_PARTITION is not set -# CONFIG_KARMA_PARTITION is not set -CONFIG_EFI_PARTITION=y -# CONFIG_SYSV68_PARTITION is not set - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_TEST=y -CONFIG_IOSCHED_DEADLINE=y -# CONFIG_IOSCHED_ROW is not set -CONFIG_IOSCHED_CFQ=y -# CONFIG_DEFAULT_DEADLINE is not set -CONFIG_DEFAULT_CFQ=y -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="cfq" -CONFIG_UNINLINE_SPIN_UNLOCK=y -CONFIG_MUTEX_SPIN_ON_OWNER=y -CONFIG_FREEZER=y - -# -# System Type -# -CONFIG_MMU=y -# CONFIG_ARCH_MULTIPLATFORM is not set -# CONFIG_ARCH_INTEGRATOR is not set -# CONFIG_ARCH_REALVIEW is not set -# CONFIG_ARCH_VERSATILE is not set -# CONFIG_ARCH_AT91 is not set -# CONFIG_ARCH_CLPS711X 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_NETX is not set -# CONFIG_ARCH_IOP13XX is not set -# CONFIG_ARCH_IOP32X is not set -# CONFIG_ARCH_IOP33X is not set -# CONFIG_ARCH_IXP4XX is not set -# CONFIG_ARCH_DOVE is not set -# CONFIG_ARCH_KIRKWOOD 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_LPC32XX is not set -# CONFIG_ARCH_PXA is not set -CONFIG_ARCH_MSM=y -# CONFIG_ARCH_SHMOBILE is not set -# CONFIG_ARCH_RPC is not set -# CONFIG_ARCH_SA1100 is not set -# CONFIG_ARCH_S3C24XX 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_EXYNOS is not set -# CONFIG_ARCH_SHARK is not set -# CONFIG_ARCH_U300 is not set -# CONFIG_ARCH_DAVINCI is not set -# CONFIG_ARCH_OMAP1 is not set -# CONFIG_GPIO_PCA953X is not set -# CONFIG_KEYBOARD_GPIO_POLLED is not set - -# -# MSM SoC Type -# -# CONFIG_ARCH_MSM8974 is not set -CONFIG_ARCH_APQ8084=y -# CONFIG_ARCH_MPQ8092 is not set -# CONFIG_ARCH_MSM8916 is not set -# CONFIG_ARCH_FSM9900 is not set -# CONFIG_ARCH_MDM9630 is not set -# CONFIG_ARCH_MSM8610 is not set -# CONFIG_ARCH_MSM8226 is not set -# CONFIG_ARCH_MSMSAMARIUM is not set -CONFIG_MSM_KRAIT_TBB_ABORT_HANDLER=y -CONFIG_ARCH_MSM_KRAIT=y -CONFIG_MSM_SMP=y -CONFIG_ARCH_MSM_KRAITMP=y -CONFIG_MSM_RPM_SMD=y -CONFIG_MSM_MPM_OF=y -# CONFIG_MSM_LPM_TEST is not set -# CONFIG_MSM_STACKED_MEMORY is not set -CONFIG_MSM_AMSS_VERSION=6225 -# CONFIG_MSM_AMSS_VERSION_6210 is not set -# CONFIG_MSM_AMSS_VERSION_6220 is not set -CONFIG_MSM_AMSS_VERSION_6225=y -CONFIG_MSM7X00A_USE_GP_TIMER=y -# CONFIG_MSM7X00A_USE_DG_TIMER is not set -CONFIG_MSM7X00A_SLEEP_MODE_POWER_COLLAPSE_SUSPEND=y -# CONFIG_MSM7X00A_SLEEP_MODE_POWER_COLLAPSE is not set -# CONFIG_MSM7X00A_SLEEP_MODE_APPS_SLEEP is not set -# CONFIG_MSM7X00A_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT is not set -# CONFIG_MSM7X00A_SLEEP_WAIT_FOR_INTERRUPT is not set -CONFIG_MSM7X00A_SLEEP_MODE=0 -# CONFIG_MSM7X00A_IDLE_SLEEP_MODE_POWER_COLLAPSE_SUSPEND is not set -CONFIG_MSM7X00A_IDLE_SLEEP_MODE_POWER_COLLAPSE=y -# CONFIG_MSM7X00A_IDLE_SLEEP_MODE_APPS_SLEEP is not set -# CONFIG_MSM7X00A_IDLE_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT is not set -# CONFIG_MSM7X00A_IDLE_SLEEP_WAIT_FOR_INTERRUPT is not set -CONFIG_MSM7X00A_IDLE_SLEEP_MODE=1 -CONFIG_MSM7X00A_IDLE_SLEEP_MIN_TIME=20000000 -CONFIG_MSM7X00A_IDLE_SPIN_TIME=80000 -CONFIG_MSM_IDLE_STATS=y -CONFIG_MSM_IDLE_STATS_FIRST_BUCKET=62500 -CONFIG_MSM_IDLE_STATS_BUCKET_SHIFT=2 -CONFIG_MSM_IDLE_STATS_BUCKET_COUNT=10 -CONFIG_MSM_SUSPEND_STATS_FIRST_BUCKET=1000000000 -CONFIG_CPU_HAS_L2_PMU=y -CONFIG_MSM_SMD=y -CONFIG_MSM_PCIE=y -CONFIG_MSM_SMD_DEBUG=y -CONFIG_MSM_SMP2P=y -CONFIG_MSM_SMP2P_TEST=y -# CONFIG_MSM_TEST_QMI_CLIENT is not set -# CONFIG_MSM_CPU_FREQ_SET_MIN_MAX is not set -CONFIG_MSM_DEVFREQ_CPUBW=y -# CONFIG_MSM_AVS_HW is not set -CONFIG_RTAC=y -# CONFIG_MSM_VREG_SWITCH_INVERTED is not set -CONFIG_MSM_DMA_TEST=y -# CONFIG_WIFI_CONTROL_FUNC is not set -CONFIG_SURF_FFA_GPIO_KEYPAD=y -CONFIG_MSM_SLEEP_TIME_OVERRIDE=y -# CONFIG_MSM_MEMORY_LOW_POWER_MODE is not set -CONFIG_MSM_PM_TIMEOUT_HALT=y -# CONFIG_MSM_PM_TIMEOUT_RESET_MODEM is not set -# CONFIG_MSM_PM_TIMEOUT_RESET_CHIP is not set -CONFIG_MSM_IDLE_WAIT_ON_MODEM=0 -# CONFIG_MSM_SPM_REGULATOR is not set -# CONFIG_MSM_SMCMOD is not set -CONFIG_MSM_SUBSYSTEM_RESTART=y -CONFIG_MSM_SYSMON_COMM=y -CONFIG_MSM_PIL=y -CONFIG_MSM_PIL_SSR_GENERIC=y -# CONFIG_MSM_PIL_MSS_QDSP6V5 is not set -# CONFIG_MSM_PIL_PRONTO is not set -CONFIG_MSM_SCM=y -CONFIG_MSM_BUSPM_DEV=y -CONFIG_MSM_TZ_LOG=y -CONFIG_MSM_TZ_LOG_WDOG_DUMP=y -CONFIG_MSM_RPM_LOG=y -CONFIG_MSM_RPM_STATS_LOG=y -# CONFIG_MSM_RPM_RBCPR_STATS_V2_LOG is not set -CONFIG_MSM_DIRECT_SCLK_ACCESS=y -CONFIG_IOMMU_API=y -CONFIG_MSM_GPIOMUX=y -CONFIG_MSM_NATIVE_RESTART=y -CONFIG_MSM_PM=y -CONFIG_MSM_EVENT_TIMER=y -CONFIG_MSM_BUS_SCALING=y -# CONFIG_MSM_BUS_RPM_MULTI_TIER_ENABLED is not set -CONFIG_MSM_DLOAD_MODE=y -CONFIG_MSM_JTAG=y -# CONFIG_MSM_JTAG_MM is not set -CONFIG_MSM_RUN_QUEUE_STATS=y -# CONFIG_MSM_STANDALONE_POWER_COLLAPSE is not set -# CONFIG_MSM_GSBI9_UART is not set -CONFIG_MSM_ULTRASOUND_B=y -CONFIG_MSM_SPM_V2=y -CONFIG_MSM_L2_SPM=y -CONFIG_MSM_OCMEM=y -CONFIG_MSM_OCMEM_LOCAL_POWER_CTRL=y -# CONFIG_MSM_OCMEM_DEBUG is not set -# CONFIG_MSM_OCMEM_POWER_DISABLE is not set -# CONFIG_SENSORS_ADSP is not set -CONFIG_MSM_CACHE_ERP=y -CONFIG_MSM_L1_ERR_PANIC=y -# CONFIG_MSM_L1_RECOV_ERR_PANIC is not set -CONFIG_MSM_L1_ERR_LOG=y -CONFIG_MSM_L2_ERP_PRINT_ACCESS_ERRORS=y -# CONFIG_MSM_L2_ERP_PORT_PANIC is not set -# CONFIG_MSM_L2_ERP_1BIT_PANIC is not set -CONFIG_MSM_L2_ERP_2BIT_PANIC=y -# CONFIG_MSM_CPR is not set -CONFIG_HAVE_ARCH_HAS_CURRENT_TIMER=y -# CONFIG_MSM_CACHE_DUMP is not set -CONFIG_MSM_HSIC_SYSMON=y -# CONFIG_MSM_HSIC_SYSMON_TEST is not set -CONFIG_MSM_ENABLE_WDOG_DEBUG_CONTROL=y -# CONFIG_MSM_UARTDM_Core_v14 is not set -CONFIG_MSM_BOOT_STATS=y -CONFIG_MSM_XPU_ERR_FATAL=y -# CONFIG_MSM_CPR_REGULATOR is not set -CONFIG_KRAIT_REGULATOR=y -CONFIG_MMI_DEVICE_DTBS=y -CONFIG_MMI_UNIT_INFO=y -CONFIG_MMI_SOC_INFO=y -CONFIG_HAS_MACH_MEMUTILS=y -# CONFIG_PLAT_SPEAR is not set - -# -# 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_LPAE is not set -# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set -CONFIG_ARM_THUMB=y -# CONFIG_ARM_THUMBEE is not set -CONFIG_ARM_VIRT_EXT=y -CONFIG_SWP_EMULATE=y -# CONFIG_CPU_ICACHE_DISABLE is not set -# CONFIG_CPU_DCACHE_DISABLE is not set -# CONFIG_CPU_BPREDICT_DISABLE is not set -CONFIG_KUSER_HELPERS=y -# CONFIG_CACHE_L2X0 is not set -CONFIG_ARM_L1_CACHE_SHIFT_6=y -CONFIG_ARM_L1_CACHE_SHIFT=6 -CONFIG_ARM_DMA_MEM_BUFFERABLE=y -# CONFIG_STRICT_MEMORY_RWX is not set -CONFIG_ARM_NR_BANKS=8 -# CONFIG_RESERVE_FIRST_PAGE is not set -CONFIG_MULTI_IRQ_HANDLER=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_742230 is not set -# CONFIG_ARM_ERRATA_742231 is not set -# CONFIG_ARM_ERRATA_643719 is not set -# CONFIG_ARM_ERRATA_720789 is not set -# CONFIG_ARM_ERRATA_743622 is not set -# CONFIG_ARM_ERRATA_751472 is not set -# CONFIG_ARM_ERRATA_754322 is not set -# CONFIG_ARM_ERRATA_754327 is not set -# CONFIG_ARM_ERRATA_764369 is not set -# CONFIG_ARM_ERRATA_775420 is not set -# CONFIG_ARM_ERRATA_798181 is not set -# CONFIG_PERFMAP is not set -# CONFIG_FIQ_DEBUGGER is not set - -# -# Bus support -# -CONFIG_PCI=y -CONFIG_PCI_DOMAINS=y -CONFIG_PCI_SYSCALL=y -CONFIG_ARCH_SUPPORTS_MSI=y -CONFIG_PCI_MSI=y -# CONFIG_PCI_DEBUG is not set -# CONFIG_PCI_REALLOC_ENABLE_AUTO is not set -# CONFIG_PCI_STUB is not set -# CONFIG_PCI_IOV is not set -# CONFIG_PCI_PRI is not set -# CONFIG_PCI_PASID is not set -# CONFIG_PCCARD is not set - -# -# Kernel Features -# -CONFIG_HAVE_SMP=y -CONFIG_SMP=y -# CONFIG_SMP_ON_UP is not set -CONFIG_ARM_CPU_TOPOLOGY=y -CONFIG_SCHED_MC=y -# CONFIG_SCHED_SMT is not set -CONFIG_HAVE_ARM_ARCH_TIMER=y -# CONFIG_MCPM is not set -CONFIG_VMSPLIT_3G=y -# CONFIG_VMSPLIT_2G is not set -# CONFIG_VMSPLIT_1G is not set -CONFIG_PAGE_OFFSET=0xC0000000 -CONFIG_NR_CPUS=4 -CONFIG_HOTPLUG_CPU=y -# CONFIG_ARM_PSCI is not set -CONFIG_LOCAL_TIMERS=y -CONFIG_ARCH_NR_GPIO=0 -# CONFIG_PREEMPT_NONE is not set -# CONFIG_PREEMPT_VOLUNTARY is not set -CONFIG_PREEMPT=y -CONFIG_PREEMPT_COUNT=y -CONFIG_HZ=100 -CONFIG_SCHED_HRTICK=y -# 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_HW_PERF_EVENTS=y -CONFIG_FLATMEM=y -CONFIG_FLAT_NODE_MEM_MAP=y -CONFIG_HAVE_MEMBLOCK=y -CONFIG_MEMORY_ISOLATION=y -# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set -CONFIG_PAGEFLAGS_EXTENDED=y -CONFIG_SPLIT_PTLOCK_CPUS=4 -CONFIG_COMPACTION=y -CONFIG_MIGRATION=y -# CONFIG_PHYS_ADDR_T_64BIT is not set -CONFIG_ZONE_DMA_FLAG=0 -CONFIG_BOUNCE=y -# CONFIG_KSM is not set -CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 -CONFIG_CROSS_MEMORY_ATTACH=y -# CONFIG_CLEANCACHE is not set -# CONFIG_FRONTSWAP is not set -CONFIG_MEMORY_HOLE_CARVEOUT=y -# CONFIG_USE_USER_ACCESSIBLE_TIMERS is not set -# CONFIG_ZBUD is not set -# CONFIG_ARCH_MEMORY_PROBE is not set -# CONFIG_ARCH_MEMORY_REMOVE is not set -# CONFIG_ENABLE_DMM is not set -CONFIG_ENABLE_VMALLOC_SAVING=y -# CONFIG_NO_VM_RECLAIM is not set -CONFIG_FORCE_MAX_ZONEORDER=11 -CONFIG_ALIGNMENT_TRAP=y -# CONFIG_UACCESS_WITH_MEMCPY is not set -CONFIG_SECCOMP=y -CONFIG_CC_STACKPROTECTOR=y -# CONFIG_XEN is not set -CONFIG_CP_ACCESS=y -# CONFIG_ARM_FLUSH_CONSOLE_ON_RESTART is not set - -# -# Boot options -# -CONFIG_USE_OF=y -CONFIG_ATAGS=y -# CONFIG_DEPRECATED_PARAM_STRUCT is not set -CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE=y -CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES="" -CONFIG_ZBOOT_ROM_TEXT=0 -CONFIG_ZBOOT_ROM_BSS=0 -# CONFIG_ARM_APPENDED_DTB is not set -CONFIG_CMDLINE="" -# CONFIG_XIP_KERNEL is not set -# CONFIG_KEXEC is not set -# 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_GOV_COMMON=y -CONFIG_CPU_FREQ_STAT=y -# CONFIG_CPU_FREQ_STAT_DETAILS is not set -CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y -# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set -# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set -# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set -# 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=y -CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y -CONFIG_CPU_BOOST=y - -# -# ARM CPU frequency scaling drivers -# -# CONFIG_ARM_EXYNOS4210_CPUFREQ is not set -# CONFIG_ARM_EXYNOS4X12_CPUFREQ is not set -# CONFIG_ARM_EXYNOS5250_CPUFREQ is not set -# CONFIG_ARM_KIRKWOOD_CPUFREQ is not set -CONFIG_CPU_IDLE=y -# CONFIG_CPU_IDLE_MULTIPLE_DRIVERS is not set -CONFIG_CPU_IDLE_GOV_LADDER=y -CONFIG_CPU_IDLE_GOV_MENU=y -# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set -CONFIG_CPU_FREQ_MSM=y - -# -# 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_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y -# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set -CONFIG_BINFMT_SCRIPT=y -# CONFIG_HAVE_AOUT is not set -# CONFIG_BINFMT_MISC is not set -CONFIG_COREDUMP=y - -# -# Power management options -# -CONFIG_SUSPEND=y -CONFIG_SUSPEND_FREEZER=y -CONFIG_HAS_WAKELOCK=y -CONFIG_WAKELOCK=y -CONFIG_PM_SLEEP=y -CONFIG_PM_SLEEP_SMP=y -CONFIG_PM_AUTOSLEEP=y -CONFIG_PM_WAKELOCKS=y -CONFIG_PM_WAKELOCKS_LIMIT=0 -# CONFIG_PM_WAKELOCKS_GC is not set -CONFIG_PM_RUNTIME=y -CONFIG_PM=y -CONFIG_PM_DEBUG=y -# CONFIG_PM_ADVANCED_DEBUG is not set -# CONFIG_PM_TEST_SUSPEND is not set -CONFIG_PM_SLEEP_DEBUG=y -# CONFIG_APM_EMULATION is not set -CONFIG_PM_CLK=y -CONFIG_CPU_PM=y -CONFIG_SUSPEND_TIME=y -CONFIG_ARCH_SUSPEND_POSSIBLE=y -CONFIG_ARM_CPU_SUSPEND=y -CONFIG_NET=y - -# -# Networking options -# -CONFIG_PACKET=y -# CONFIG_PACKET_DIAG is not set -CONFIG_UNIX=y -# CONFIG_UNIX_DIAG is not set -CONFIG_XFRM=y -CONFIG_XFRM_ALGO=y -CONFIG_XFRM_USER=y -CONFIG_XFRM_SUB_POLICY=y -CONFIG_XFRM_MIGRATE=y -CONFIG_XFRM_STATISTICS=y -CONFIG_XFRM_IPCOMP=y -CONFIG_NET_KEY=y -CONFIG_NET_KEY_MIGRATE=y -CONFIG_INET=y -CONFIG_IP_MULTICAST=y -CONFIG_IP_ADVANCED_ROUTER=y -# CONFIG_IP_FIB_TRIE_STATS is not set -CONFIG_IP_MULTIPLE_TABLES=y -# CONFIG_IP_ROUTE_MULTIPATH is not set -CONFIG_IP_ROUTE_VERBOSE=y -CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y -# CONFIG_IP_PNP_BOOTP is not set -# CONFIG_IP_PNP_RARP is not set -# CONFIG_NET_IPIP is not set -# CONFIG_NET_IPGRE_DEMUX is not set -CONFIG_NET_IP_TUNNEL=y -CONFIG_IP_MROUTE=y -# CONFIG_IP_MROUTE_MULTIPLE_TABLES is not set -# CONFIG_IP_PIMSM_V1 is not set -CONFIG_IP_PIMSM_V2=y -# CONFIG_ARPD is not set -# CONFIG_SYN_COOKIES is not set -# CONFIG_NET_IPVTI is not set -CONFIG_INET_AH=y -CONFIG_INET_ESP=y -CONFIG_INET_IPCOMP=y -CONFIG_INET_XFRM_TUNNEL=y -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=y -CONFIG_INET_DIAG=y -CONFIG_INET_TCP_DIAG=y -# CONFIG_INET_UDP_DIAG is not set -# 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=y -CONFIG_IPV6_ROUTER_PREF=y -CONFIG_IPV6_ROUTE_INFO=y -CONFIG_IPV6_OPTIMISTIC_DAD=y -CONFIG_INET6_AH=y -CONFIG_INET6_ESP=y -CONFIG_INET6_IPCOMP=y -CONFIG_IPV6_MIP6=y -CONFIG_INET6_XFRM_TUNNEL=y -CONFIG_INET6_TUNNEL=y -CONFIG_INET6_XFRM_MODE_TRANSPORT=y -CONFIG_INET6_XFRM_MODE_TUNNEL=y -CONFIG_INET6_XFRM_MODE_BEET=y -# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set -CONFIG_IPV6_SIT=y -# CONFIG_IPV6_SIT_6RD is not set -CONFIG_IPV6_NDISC_NODETYPE=y -# CONFIG_IPV6_TUNNEL is not set -# CONFIG_IPV6_GRE is not set -CONFIG_IPV6_MULTIPLE_TABLES=y -CONFIG_IPV6_SUBTREES=y -# CONFIG_IPV6_MROUTE is not set -# CONFIG_NETLABEL is not set -CONFIG_ANDROID_PARANOID_NETWORK=y -CONFIG_NET_ACTIVITY_STATS=y -CONFIG_NETWORK_SECMARK=y -# CONFIG_NETWORK_PHY_TIMESTAMPING is not set -CONFIG_NETFILTER=y -# CONFIG_NETFILTER_DEBUG is not set -CONFIG_NETFILTER_ADVANCED=y -CONFIG_BRIDGE_NETFILTER=y - -# -# Core Netfilter Configuration -# -CONFIG_NETFILTER_NETLINK=y -# CONFIG_NETFILTER_NETLINK_ACCT is not set -CONFIG_NETFILTER_NETLINK_QUEUE=y -CONFIG_NETFILTER_NETLINK_LOG=y -CONFIG_NF_CONNTRACK=y -CONFIG_NF_CONNTRACK_MARK=y -# CONFIG_NF_CONNTRACK_SECMARK is not set -# CONFIG_NF_CONNTRACK_ZONES is not set -CONFIG_NF_CONNTRACK_PROCFS=y -CONFIG_NF_CONNTRACK_EVENTS=y -# CONFIG_NF_CONNTRACK_TIMEOUT is not set -# 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 is not set -CONFIG_NF_CONNTRACK_TFTP=y -CONFIG_NF_CT_NETLINK=y -# CONFIG_NF_CT_NETLINK_TIMEOUT is not set -# CONFIG_NETFILTER_NETLINK_QUEUE_CT is not set -CONFIG_NF_NAT=y -CONFIG_NF_NAT_NEEDED=y -CONFIG_NF_NAT_PROTO_DCCP=y -CONFIG_NF_NAT_PROTO_UDPLITE=y -CONFIG_NF_NAT_PROTO_SCTP=y -CONFIG_NF_NAT_AMANDA=y -CONFIG_NF_NAT_FTP=y -CONFIG_NF_NAT_IRC=y -# CONFIG_NF_NAT_SIP is not set -CONFIG_NF_NAT_TFTP=y -CONFIG_NETFILTER_TPROXY=y -CONFIG_NETFILTER_XTABLES=y - -# -# Xtables combined modules -# -CONFIG_NETFILTER_XT_MARK=y -CONFIG_NETFILTER_XT_CONNMARK=y - -# -# Xtables targets -# -# CONFIG_NETFILTER_XT_TARGET_AUDIT is not set -# CONFIG_NETFILTER_XT_TARGET_CHECKSUM is not set -CONFIG_NETFILTER_XT_TARGET_CLASSIFY=y -CONFIG_NETFILTER_XT_TARGET_CONNMARK=y -CONFIG_NETFILTER_XT_TARGET_CT=y -# CONFIG_NETFILTER_XT_TARGET_DSCP is not set -# CONFIG_NETFILTER_XT_TARGET_HL is not set -# CONFIG_NETFILTER_XT_TARGET_HMARK is not set -CONFIG_NETFILTER_XT_TARGET_IDLETIMER=y -# CONFIG_NETFILTER_XT_TARGET_LED is not set -CONFIG_NETFILTER_XT_TARGET_LOG=y -CONFIG_NETFILTER_XT_TARGET_MARK=y -CONFIG_NETFILTER_XT_TARGET_NETMAP=y -CONFIG_NETFILTER_XT_TARGET_NFLOG=y -CONFIG_NETFILTER_XT_TARGET_NFQUEUE=y -CONFIG_NETFILTER_XT_TARGET_NOTRACK=y -# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set -CONFIG_NETFILTER_XT_TARGET_REDIRECT=y -# CONFIG_NETFILTER_XT_TARGET_TEE is not set -CONFIG_NETFILTER_XT_TARGET_TPROXY=y -CONFIG_NETFILTER_XT_TARGET_TRACE=y -# CONFIG_NETFILTER_XT_TARGET_SECMARK is not set -CONFIG_NETFILTER_XT_TARGET_TCPMSS=y -# CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP is not set - -# -# Xtables matches -# -# CONFIG_NETFILTER_XT_MATCH_ADDRTYPE is not set -# CONFIG_NETFILTER_XT_MATCH_BPF is not set -# CONFIG_NETFILTER_XT_MATCH_CLUSTER is not set -CONFIG_NETFILTER_XT_MATCH_COMMENT=y -# CONFIG_NETFILTER_XT_MATCH_CONNBYTES is not set -# CONFIG_NETFILTER_XT_MATCH_CONNLABEL is not set -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=y -CONFIG_NETFILTER_XT_MATCH_ECN=y -# CONFIG_NETFILTER_XT_MATCH_ESP is not set -CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=y -CONFIG_NETFILTER_XT_MATCH_HELPER=y -CONFIG_NETFILTER_XT_MATCH_HL=y -CONFIG_NETFILTER_XT_MATCH_IPRANGE=y -CONFIG_NETFILTER_XT_MATCH_LENGTH=y -CONFIG_NETFILTER_XT_MATCH_LIMIT=y -CONFIG_NETFILTER_XT_MATCH_MAC=y -CONFIG_NETFILTER_XT_MATCH_MARK=y -CONFIG_NETFILTER_XT_MATCH_MULTIPORT=y -# CONFIG_NETFILTER_XT_MATCH_NFACCT is not set -# CONFIG_NETFILTER_XT_MATCH_OSF is not set -# CONFIG_NETFILTER_XT_MATCH_OWNER is not set -CONFIG_NETFILTER_XT_MATCH_POLICY=y -# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set -CONFIG_NETFILTER_XT_MATCH_PKTTYPE=y -CONFIG_NETFILTER_XT_MATCH_QTAGUID=y -CONFIG_NETFILTER_XT_MATCH_QUOTA=y -CONFIG_NETFILTER_XT_MATCH_QUOTA2=y -CONFIG_NETFILTER_XT_MATCH_QUOTA2_LOG=y -# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set -# CONFIG_NETFILTER_XT_MATCH_REALM is not set -# CONFIG_NETFILTER_XT_MATCH_RECENT is not set -# CONFIG_NETFILTER_XT_MATCH_SCTP is not set -CONFIG_NETFILTER_XT_MATCH_SOCKET=y -CONFIG_NETFILTER_XT_MATCH_STATE=y -CONFIG_NETFILTER_XT_MATCH_STATISTIC=y -CONFIG_NETFILTER_XT_MATCH_STRING=y -CONFIG_NETFILTER_XT_MATCH_TCPMSS=y -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_IPTABLES=y -CONFIG_IP_NF_MATCH_AH=y -CONFIG_IP_NF_MATCH_ECN=y -# CONFIG_IP_NF_MATCH_RPFILTER is not set -CONFIG_IP_NF_MATCH_TTL=y -CONFIG_IP_NF_FILTER=y -CONFIG_IP_NF_TARGET_REJECT=y -CONFIG_IP_NF_TARGET_REJECT_SKERR=y -# CONFIG_IP_NF_TARGET_ULOG is not set -CONFIG_NF_NAT_IPV4=y -CONFIG_IP_NF_TARGET_MASQUERADE=y -# CONFIG_IP_NF_TARGET_NATTYPE_MODULE is not set -CONFIG_IP_NF_TARGET_NETMAP=y -CONFIG_IP_NF_TARGET_REDIRECT=y -CONFIG_NF_NAT_PROTO_GRE=y -CONFIG_NF_NAT_PPTP=y -CONFIG_NF_NAT_H323=y -CONFIG_IP_NF_MANGLE=y -# CONFIG_IP_NF_TARGET_CLUSTERIP is not set -# CONFIG_IP_NF_TARGET_ECN is not set -# CONFIG_IP_NF_TARGET_TTL is not set -CONFIG_IP_NF_RAW=y -CONFIG_IP_NF_SECURITY=y -CONFIG_IP_NF_ARPTABLES=y -CONFIG_IP_NF_ARPFILTER=y -CONFIG_IP_NF_ARP_MANGLE=y - -# -# IPv6: Netfilter Configuration -# -CONFIG_NF_DEFRAG_IPV6=y -CONFIG_NF_CONNTRACK_IPV6=y -CONFIG_IP6_NF_IPTABLES=y -# CONFIG_IP6_NF_MATCH_AH is not set -# CONFIG_IP6_NF_MATCH_EUI64 is not set -# CONFIG_IP6_NF_MATCH_FRAG is not set -# CONFIG_IP6_NF_MATCH_OPTS is not set -# CONFIG_IP6_NF_MATCH_HL is not set -# CONFIG_IP6_NF_MATCH_IPV6HEADER is not set -# CONFIG_IP6_NF_MATCH_MH is not set -# CONFIG_IP6_NF_MATCH_RPFILTER is not set -# CONFIG_IP6_NF_MATCH_RT is not set -# CONFIG_IP6_NF_TARGET_HL is not set -CONFIG_IP6_NF_FILTER=y -CONFIG_IP6_NF_TARGET_REJECT=y -CONFIG_IP6_NF_TARGET_REJECT_SKERR=y -CONFIG_IP6_NF_MANGLE=y -CONFIG_IP6_NF_RAW=y -# CONFIG_IP6_NF_SECURITY is not set -# CONFIG_NF_NAT_IPV6 is not set -CONFIG_BRIDGE_NF_EBTABLES=y -CONFIG_BRIDGE_EBT_BROUTE=y -# CONFIG_BRIDGE_EBT_T_FILTER is not set -# CONFIG_BRIDGE_EBT_T_NAT is not set -# CONFIG_BRIDGE_EBT_802_3 is not set -# CONFIG_BRIDGE_EBT_AMONG is not set -# CONFIG_BRIDGE_EBT_ARP is not set -# CONFIG_BRIDGE_EBT_IP is not set -# CONFIG_BRIDGE_EBT_IP6 is not set -# CONFIG_BRIDGE_EBT_LIMIT is not set -# CONFIG_BRIDGE_EBT_MARK is not set -# CONFIG_BRIDGE_EBT_PKTTYPE is not set -# CONFIG_BRIDGE_EBT_STP is not set -# CONFIG_BRIDGE_EBT_VLAN is not set -# CONFIG_BRIDGE_EBT_ARPREPLY is not set -# CONFIG_BRIDGE_EBT_DNAT is not set -# CONFIG_BRIDGE_EBT_MARK_T is not set -# CONFIG_BRIDGE_EBT_REDIRECT is not set -# CONFIG_BRIDGE_EBT_SNAT is not set -# CONFIG_BRIDGE_EBT_LOG is not set -# CONFIG_BRIDGE_EBT_ULOG is not set -# CONFIG_BRIDGE_EBT_NFLOG 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=y -CONFIG_L2TP_DEBUGFS=y -CONFIG_L2TP_V3=y -# CONFIG_L2TP_IP is not set -# CONFIG_L2TP_ETH is not set -CONFIG_STP=y -CONFIG_BRIDGE=y -CONFIG_BRIDGE_IGMP_SNOOPING=y -CONFIG_HAVE_NET_DSA=y -# CONFIG_VLAN_8021Q is not set -# CONFIG_DECNET is not set -CONFIG_LLC=y -# 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_PHONET is not set -# CONFIG_IEEE802154 is not set -CONFIG_NET_SCHED=y - -# -# Queueing/Scheduling -# -# CONFIG_NET_SCH_CBQ is not set -CONFIG_NET_SCH_HTB=y -# CONFIG_NET_SCH_HFSC is not set -CONFIG_NET_SCH_PRIO=y -# CONFIG_NET_SCH_MULTIQ is not set -# CONFIG_NET_SCH_RED is not set -# CONFIG_NET_SCH_SFB is not set -# CONFIG_NET_SCH_SFQ is not set -# CONFIG_NET_SCH_TEQL is not set -# CONFIG_NET_SCH_TBF is not set -# CONFIG_NET_SCH_GRED is not set -# CONFIG_NET_SCH_DSMARK is not set -# CONFIG_NET_SCH_NETEM is not set -# CONFIG_NET_SCH_DRR is not set -# CONFIG_NET_SCH_MQPRIO is not set -# CONFIG_NET_SCH_CHOKE is not set -# CONFIG_NET_SCH_QFQ is not set -# CONFIG_NET_SCH_CODEL is not set -# CONFIG_NET_SCH_FQ_CODEL is not set -# CONFIG_NET_SCH_INGRESS is not set -# CONFIG_NET_SCH_PLUG is not set - -# -# Classification -# -CONFIG_NET_CLS=y -# CONFIG_NET_CLS_BASIC is not set -# CONFIG_NET_CLS_TCINDEX is not set -# CONFIG_NET_CLS_ROUTE4 is not set -CONFIG_NET_CLS_FW=y -CONFIG_NET_CLS_U32=y -# CONFIG_CLS_U32_PERF is not set -CONFIG_CLS_U32_MARK=y -# CONFIG_NET_CLS_RSVP is not set -# CONFIG_NET_CLS_RSVP6 is not set -CONFIG_NET_CLS_FLOW=y -# CONFIG_NET_CLS_CGROUP is not set -CONFIG_NET_EMATCH=y -CONFIG_NET_EMATCH_STACK=32 -CONFIG_NET_EMATCH_CMP=y -CONFIG_NET_EMATCH_NBYTE=y -CONFIG_NET_EMATCH_U32=y -CONFIG_NET_EMATCH_META=y -CONFIG_NET_EMATCH_TEXT=y -CONFIG_NET_CLS_ACT=y -# CONFIG_NET_ACT_POLICE is not set -# CONFIG_NET_ACT_GACT is not set -# CONFIG_NET_ACT_MIRRED is not set -# CONFIG_NET_ACT_IPT is not set -# CONFIG_NET_ACT_NAT is not set -# CONFIG_NET_ACT_PEDIT is not set -# CONFIG_NET_ACT_SIMP is not set -# CONFIG_NET_ACT_SKBEDIT is not set -# CONFIG_NET_ACT_CSUM is not set -# CONFIG_NET_CLS_IND is not set -CONFIG_NET_SCH_FIFO=y -# CONFIG_DCB is not set -# CONFIG_DNS_RESOLVER is not set -# CONFIG_BATMAN_ADV is not set -# CONFIG_OPENVSWITCH is not set -# CONFIG_VSOCKETS is not set -# CONFIG_NETLINK_MMAP is not set -# CONFIG_NETLINK_DIAG is not set -CONFIG_RMNET_DATA=y -CONFIG_RMNET_DATA_FC=y -CONFIG_RMNET_DATA_DEBUG_PKT=y -CONFIG_RPS=y -CONFIG_RFS_ACCEL=y -CONFIG_XPS=y -# CONFIG_NETPRIO_CGROUP is not set -CONFIG_BQL=y - -# -# Network testing -# -# CONFIG_NET_PKTGEN is not set -# CONFIG_NET_DROP_MONITOR is not set -# CONFIG_HAMRADIO is not set -# CONFIG_CAN is not set -# CONFIG_IRDA is not set -CONFIG_BT=y -# CONFIG_BT_RFCOMM is not set -# 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 is not set -# CONFIG_BT_HCIBCM203X is not set -# CONFIG_BT_HCIBPA10X is not set -CONFIG_BT_MSM_SLEEP=y -# CONFIG_BT_HCIBFUSB is not set -# CONFIG_BT_HCIVHCI is not set -# CONFIG_BT_MRVL is not set -CONFIG_MSM_BT_POWER=y -# CONFIG_AF_RXRPC is not set -CONFIG_FIB_RULES=y -CONFIG_WIRELESS=y -CONFIG_CFG80211=y -CONFIG_NL80211_TESTMODE=y -# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set -# CONFIG_CFG80211_REG_DEBUG is not set -# CONFIG_CFG80211_CERTIFICATION_ONUS is not set -CONFIG_CFG80211_DEFAULT_PS=y -# CONFIG_CFG80211_DEBUGFS is not set -# CONFIG_CFG80211_INTERNAL_REGDB is not set -# CONFIG_CFG80211_WEXT is not set -# CONFIG_LIB80211 is not set -# CONFIG_CFG80211_ALLOW_RECONNECT is not set -# CONFIG_MAC80211 is not set -# CONFIG_WIMAX is not set -CONFIG_RFKILL=y -CONFIG_RFKILL_PM=y -CONFIG_RFKILL_LEDS=y -# 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 -# CONFIG_NFC is not set -# CONFIG_NFC_QNCI is not set -CONFIG_BCM2079X=y -CONFIG_IPC_ROUTER=y -CONFIG_IPC_ROUTER_SECURITY=y -CONFIG_HAVE_BPF_JIT=y - -# -# Device Drivers -# - -# -# Generic Driver Options -# -CONFIG_UEVENT_HELPER_PATH="" -# CONFIG_DEVTMPFS is not set -CONFIG_STANDALONE=y -CONFIG_PREVENT_FIRMWARE_BUILD=y -CONFIG_FW_LOADER=y -CONFIG_FIRMWARE_IN_KERNEL=y -CONFIG_EXTRA_FIRMWARE="" -CONFIG_FW_LOADER_USER_HELPER=y -# CONFIG_DEBUG_DRIVER is not set -# CONFIG_DEBUG_DEVRES is not set -# CONFIG_SYS_HYPERVISOR is not set -# CONFIG_GENERIC_CPU_DEVICES is not set -CONFIG_SOC_BUS=y -CONFIG_REGMAP=y -CONFIG_REGMAP_I2C=y -CONFIG_REGMAP_SPI=y -CONFIG_DMA_SHARED_BUFFER=y -CONFIG_CMA=y -# CONFIG_CMA_DEBUG is not set - -# -# Default contiguous memory area size: -# -CONFIG_CMA_SIZE_MBYTES=16 -CONFIG_CMA_SIZE_SEL_MBYTES=y -# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set -# CONFIG_CMA_SIZE_SEL_MIN is not set -# CONFIG_CMA_SIZE_SEL_MAX is not set -CONFIG_CMA_ALIGNMENT=8 -CONFIG_CMA_AREAS=7 -# CONFIG_CMA_RESERVE_DEFAULT_AREA is not set - -# -# Bus devices -# -# CONFIG_CONNECTOR is not set -# CONFIG_MTD is not set -CONFIG_DTC=y -CONFIG_OF=y - -# -# Device Tree and Open Firmware support -# -CONFIG_PROC_DEVICETREE=y -# CONFIG_OF_SELFTEST is not set -CONFIG_OF_FLATTREE=y -CONFIG_OF_EARLY_FLATTREE=y -CONFIG_OF_ADDRESS=y -CONFIG_OF_IRQ=y -CONFIG_OF_DEVICE=y -CONFIG_OF_I2C=y -CONFIG_OF_NET=y -CONFIG_OF_MDIO=y -CONFIG_OF_PCI=y -CONFIG_OF_PCI_IRQ=y -CONFIG_OF_SPMI=y -CONFIG_OF_SLIMBUS=y -CONFIG_OF_BATTERYDATA=y -# CONFIG_PARPORT is not set -CONFIG_BLK_DEV=y -# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set -# CONFIG_BLK_CPQ_CISS_DA is not set -# CONFIG_BLK_DEV_DAC960 is not set -# CONFIG_BLK_DEV_UMEM is not set -# CONFIG_BLK_DEV_COW_COMMON is not set -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 -# CONFIG_BLK_DEV_CRYPTOLOOP is not set -# CONFIG_BLK_DEV_DRBD is not set -# CONFIG_BLK_DEV_NBD is not set -# CONFIG_BLK_DEV_NVME is not set -# CONFIG_BLK_DEV_SX8 is not set -CONFIG_BLK_DEV_RAM=y -CONFIG_BLK_DEV_RAM_COUNT=16 -CONFIG_BLK_DEV_RAM_SIZE=8192 -# CONFIG_BLK_DEV_XIP 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_BLK_DEV_RSXX is not set - -# -# Misc devices -# -# CONFIG_SENSORS_LIS3LV02D is not set -# CONFIG_AD525X_DPOT is not set -# CONFIG_ATMEL_PWM is not set -# CONFIG_DUMMY_IRQ is not set -# CONFIG_PHANTOM is not set -# CONFIG_INTEL_MID_PTI is not set -# CONFIG_SGI_IOC4 is not set -# CONFIG_TIFM_CORE is not set -# CONFIG_ICS932S401 is not set -# CONFIG_ATMEL_SSC is not set -# CONFIG_ENCLOSURE_SERVICES is not set -# CONFIG_HP_ILO 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_DS1682 is not set -# CONFIG_TI_DAC7512 is not set -CONFIG_UID_STAT=y -# CONFIG_BMP085_I2C is not set -# CONFIG_BMP085_SPI is not set -# CONFIG_PCH_PHUB is not set -# CONFIG_USB_SWITCH_FSA9480 is not set -# CONFIG_LATTICE_ECP3_CONFIG is not set -# CONFIG_SRAM is not set -# CONFIG_HAPTIC_ISA1200 is not set -CONFIG_QSEECOM=y -# CONFIG_QFP_FUSE is not set -CONFIG_QPNP_MISC=y -CONFIG_TI_DRV2667=y -CONFIG_APQ8084_DOCKING_STATION=y -CONFIG_HAPTIC_DRV2605=y -CONFIG_C55_CTRL=y -CONFIG_MMI_FACTORY=y -CONFIG_MMI_SAR=y -CONFIG_ALSA_TO_H2W=y -# CONFIG_C2PORT is not set - -# -# EEPROM support -# -# CONFIG_EEPROM_AT24 is not set -# CONFIG_EEPROM_AT25 is not set -# CONFIG_EEPROM_LEGACY is not set -# CONFIG_EEPROM_MAX6875 is not set -# CONFIG_EEPROM_93CX6 is not set -# CONFIG_EEPROM_93XX46 is not set -# CONFIG_CB710_CORE is not set - -# -# Texas Instruments shared transport line discipline -# -# CONFIG_TI_ST is not set -# CONFIG_SENSORS_LIS3_SPI is not set -# CONFIG_SENSORS_LIS3_I2C is not set - -# -# Altera FPGA firmware download module -# -# CONFIG_ALTERA_STAPL is not set -CONFIG_MSM_QDSP6V2_CODECS=y -CONFIG_CYPRESS_CAPSENSE_PROGRAMMING=y -# CONFIG_SENSORS_STM401 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=y -# 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=y -CONFIG_CHR_DEV_SCH=y -CONFIG_SCSI_MULTI_LUN=y -CONFIG_SCSI_CONSTANTS=y -CONFIG_SCSI_LOGGING=y -CONFIG_SCSI_SCAN_ASYNC=y - -# -# 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_SCSI_CXGB3_ISCSI is not set -# CONFIG_SCSI_CXGB4_ISCSI is not set -# CONFIG_SCSI_BNX2_ISCSI is not set -# CONFIG_SCSI_BNX2X_FCOE is not set -# CONFIG_BE2ISCSI is not set -# CONFIG_BLK_DEV_3W_XXXX_RAID is not set -# CONFIG_SCSI_HPSA is not set -# CONFIG_SCSI_3W_9XXX is not set -# CONFIG_SCSI_3W_SAS is not set -# CONFIG_SCSI_ACARD is not set -# CONFIG_SCSI_AACRAID is not set -# CONFIG_SCSI_AIC7XXX is not set -# CONFIG_SCSI_AIC7XXX_OLD is not set -# CONFIG_SCSI_AIC79XX is not set -# CONFIG_SCSI_AIC94XX is not set -# CONFIG_SCSI_MVSAS is not set -# CONFIG_SCSI_MVUMI is not set -# CONFIG_SCSI_ARCMSR is not set -# CONFIG_MEGARAID_NEWGEN is not set -# CONFIG_MEGARAID_LEGACY is not set -# CONFIG_MEGARAID_SAS is not set -# CONFIG_SCSI_MPT2SAS is not set -# CONFIG_SCSI_MPT3SAS is not set -# CONFIG_SCSI_UFSHCD is not set -# CONFIG_SCSI_HPTIOP is not set -# CONFIG_LIBFC is not set -# CONFIG_LIBFCOE is not set -# CONFIG_FCOE is not set -# CONFIG_SCSI_DMX3191D is not set -# CONFIG_SCSI_FUTURE_DOMAIN is not set -# CONFIG_SCSI_IPS is not set -# CONFIG_SCSI_INITIO is not set -# CONFIG_SCSI_INIA100 is not set -# CONFIG_SCSI_STEX is not set -# CONFIG_SCSI_SYM53C8XX_2 is not set -# CONFIG_SCSI_QLOGIC_1280 is not set -# CONFIG_SCSI_QLA_FC is not set -# CONFIG_SCSI_QLA_ISCSI is not set -# CONFIG_SCSI_LPFC is not set -# CONFIG_SCSI_DC395x is not set -# CONFIG_SCSI_DC390T is not set -# CONFIG_SCSI_NSP32 is not set -# CONFIG_SCSI_DEBUG is not set -# CONFIG_SCSI_PMCRAID is not set -# CONFIG_SCSI_PM8001 is not set -# CONFIG_SCSI_SRP is not set -# CONFIG_SCSI_BFA_FC is not set -# CONFIG_SCSI_CHELSIO_FCOE 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_BCACHE is not set -CONFIG_BLK_DEV_DM_BUILTIN=y -CONFIG_BLK_DEV_DM=y -# CONFIG_DM_DEBUG is not set -CONFIG_DM_BUFIO=y -CONFIG_DM_CRYPT=y -CONFIG_DM_REQ_CRYPT=y -# CONFIG_DM_SNAPSHOT is not set -# CONFIG_DM_THIN_PROVISIONING is not set -# CONFIG_DM_CACHE 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_DM_VERITY=y -# CONFIG_TARGET_CORE is not set -# CONFIG_FUSION is not set - -# -# IEEE 1394 (FireWire) support -# -# CONFIG_FIREWIRE is not set -# CONFIG_FIREWIRE_NOSY is not set -# CONFIG_I2O is not set -CONFIG_NETDEVICES=y -CONFIG_NET_CORE=y -# CONFIG_BONDING is not set -CONFIG_DUMMY=y -# CONFIG_EQUALIZER is not set -# CONFIG_NET_FC is not set -CONFIG_MII=y -# CONFIG_IFB is not set -# CONFIG_NET_TEAM is not set -# CONFIG_MACVLAN is not set -# CONFIG_VXLAN is not set -# CONFIG_NETCONSOLE is not set -# CONFIG_NETPOLL is not set -# CONFIG_NET_POLL_CONTROLLER is not set -CONFIG_TUN=y -# CONFIG_VETH is not set -# CONFIG_ARCNET is not set - -# -# CAIF transport drivers -# - -# -# Distributed Switch Architecture drivers -# -# CONFIG_NET_DSA_MV88E6XXX is not set -# CONFIG_NET_DSA_MV88E6060 is not set -# CONFIG_NET_DSA_MV88E6XXX_NEED_PPU is not set -# CONFIG_NET_DSA_MV88E6131 is not set -# CONFIG_NET_DSA_MV88E6123_61_65 is not set -# CONFIG_ETHERNET is not set -# CONFIG_FDDI is not set -# CONFIG_HIPPI is not set -CONFIG_PHYLIB=y - -# -# MII PHY device drivers -# -# CONFIG_AT803X_PHY is not set -# CONFIG_AMD_PHY is not set -# 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_BCM87XX_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_MDIO_BUS_MUX_GPIO is not set -# CONFIG_MDIO_BUS_MUX_MMIOREG is not set -# CONFIG_MICREL_KS8995MA is not set -CONFIG_PPP=y -CONFIG_PPP_BSDCOMP=y -CONFIG_PPP_DEFLATE=y -CONFIG_PPP_FILTER=y -CONFIG_PPP_MPPE=y -CONFIG_PPP_MULTILINK=y -CONFIG_PPPOE=y -CONFIG_PPPOL2TP=y -CONFIG_PPPOLAC=y -CONFIG_PPPOPNS=y -CONFIG_PPP_ASYNC=y -CONFIG_PPP_SYNC_TTY=y -# CONFIG_SLIP is not set -CONFIG_SLHC=y - -# -# USB Network Adapters -# -# CONFIG_USB_CATC is not set -# CONFIG_USB_KAWETH is not set -# CONFIG_USB_PEGASUS is not set -CONFIG_USB_RTL8150=y -CONFIG_USB_RTL8152=y -CONFIG_USB_USBNET=y -CONFIG_USB_NET_AX8817X=y -CONFIG_USB_NET_AX88179_178A=y -CONFIG_USB_NET_CDCETHER=y -# CONFIG_USB_NET_CDC_EEM is not set -CONFIG_USB_NET_CDC_NCM=y -# CONFIG_USB_NET_CDC_MBIM is not set -# CONFIG_USB_NET_DM9601 is not set -# CONFIG_USB_NET_SMSC75XX is not set -# CONFIG_USB_NET_SMSC95XX is not set -# CONFIG_USB_NET_GL620A is not set -# CONFIG_USB_NET_NET1080 is not set -# CONFIG_USB_NET_PLUSB is not set -# CONFIG_USB_NET_MCS7830 is not set -# CONFIG_USB_NET_RNDIS_HOST is not set -# CONFIG_USB_NET_CDC_SUBSET is not set -# CONFIG_USB_NET_ZAURUS is not set -# CONFIG_USB_NET_CX82310_ETH is not set -# CONFIG_USB_NET_KALMIA is not set -# CONFIG_USB_NET_QMI_WWAN is not set -# CONFIG_USB_HSO is not set -# CONFIG_USB_NET_INT51X1 is not set -# CONFIG_USB_IPHETH is not set -# CONFIG_USB_SIERRA_NET is not set -# CONFIG_USB_VL600 is not set -CONFIG_MSM_RMNET_USB=y -CONFIG_WLAN=y -# CONFIG_ATMEL is not set -# CONFIG_PRISM54 is not set -# CONFIG_USB_ZD1201 is not set -# CONFIG_USB_NET_RNDIS_WLAN is not set -# CONFIG_LIBRA_SDIOIF is not set -# CONFIG_ATH6K_LEGACY_EXT is not set -# CONFIG_WCNSS_CORE is not set -# CONFIG_CNSS is not set -# CONFIG_WCNSS_MEM_PRE_ALLOC is not set -# CONFIG_CLD_LL_CORE is not set -# CONFIG_ATH_CARDS is not set -# CONFIG_BRCMFMAC is not set -# CONFIG_HOSTAP is not set -# CONFIG_IPW2100 is not set -# CONFIG_LIBERTAS is not set -# CONFIG_WL_TI is not set -# CONFIG_MWIFIEX is not set -CONFIG_BCMDHD=y -# CONFIG_BCMDHD_SDIO is not set -CONFIG_BCMDHD_PCIE=y -# CONFIG_BCM4354 is not set -CONFIG_BCM4356=y -CONFIG_BCMDHD_FW_PATH="/vendor/firmware/fw_bcmdhd.bin" -CONFIG_BCMDHD_NVRAM_PATH="/etc/wifi/bcmdhd.cal" -# CONFIG_DHD_USE_STATIC_BUF is not set -CONFIG_DHD_USE_SCHED_SCAN=y -CONFIG_DHD_SET_RANDOM_MAC_VAL=0x9068C3 - -# -# Enable WiMAX (Networking options) to see the WiMAX drivers -# -# CONFIG_WAN is not set -# CONFIG_VMXNET3 is not set -# CONFIG_ISDN is not set - -# -# Input device support -# -CONFIG_INPUT=y -CONFIG_INPUT_FF_MEMLESS=y -# CONFIG_INPUT_POLLDEV is not set -# CONFIG_INPUT_SPARSEKMAP is not set -# CONFIG_INPUT_MATRIXKMAP is not set - -# -# Userland interfaces -# -CONFIG_INPUT_MOUSEDEV=y -# CONFIG_INPUT_MOUSEDEV_PSAUX is not set -CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 -CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 -# 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_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=y -# CONFIG_KEYBOARD_TCA6416 is not set -# CONFIG_KEYBOARD_TCA8418 is not set -# CONFIG_KEYBOARD_MATRIX is not set -# CONFIG_KEYBOARD_LM8323 is not set -# CONFIG_KEYBOARD_LM8333 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_QPNP is not set -# CONFIG_KEYBOARD_SAMSUNG 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=y -# CONFIG_JOYSTICK_ANALOG is not set -# CONFIG_JOYSTICK_A3D is not set -# CONFIG_JOYSTICK_ADI is not set -# CONFIG_JOYSTICK_COBRA is not set -# CONFIG_JOYSTICK_GF2K is not set -# CONFIG_JOYSTICK_GRIP is not set -# CONFIG_JOYSTICK_GRIP_MP is not set -# CONFIG_JOYSTICK_GUILLEMOT is not set -# CONFIG_JOYSTICK_INTERACT is not set -# CONFIG_JOYSTICK_SIDEWINDER is not set -# CONFIG_JOYSTICK_TMDC is not set -# CONFIG_JOYSTICK_IFORCE is not set -# CONFIG_JOYSTICK_WARRIOR is not set -# CONFIG_JOYSTICK_MAGELLAN is not set -# CONFIG_JOYSTICK_SPACEORB is not set -# CONFIG_JOYSTICK_SPACEBALL is not set -# CONFIG_JOYSTICK_STINGER is not set -# CONFIG_JOYSTICK_TWIDJOY is not set -# CONFIG_JOYSTICK_ZHENHUA is not set -# CONFIG_JOYSTICK_AS5011 is not set -# CONFIG_JOYSTICK_JOYDUMP is not set -CONFIG_JOYSTICK_XPAD=y -CONFIG_JOYSTICK_XPAD_FF=y -CONFIG_JOYSTICK_XPAD_LEDS=y -CONFIG_INPUT_TABLET=y -CONFIG_TABLET_USB_ACECAD=y -CONFIG_TABLET_USB_AIPTEK=y -CONFIG_TABLET_USB_GTCO=y -CONFIG_TABLET_USB_HANWANG=y -CONFIG_TABLET_USB_KBTAB=y -CONFIG_TABLET_USB_WACOM=y -CONFIG_INPUT_TOUCHSCREEN=y -# CONFIG_TOUCHSCREEN_ADS7846 is not set -# CONFIG_TOUCHSCREEN_AD7877 is not set -# CONFIG_TOUCHSCREEN_AD7879 is not set -# CONFIG_TOUCHSCREEN_ATMEL_MXT is not set -CONFIG_TOUCHSCREEN_ATMEL_MXT_MMI=y -# CONFIG_TOUCHSCREEN_ATMEL_MAXTOUCH_TS is not set -# CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set -# CONFIG_TOUCHSCREEN_BU21013 is not set -# CONFIG_TOUCHSCREEN_CY8CTMG110 is not set -# CONFIG_TOUCHSCREEN_CYTTSP_CORE is not set -# CONFIG_TOUCHSCREEN_DYNAPRO is not set -# CONFIG_TOUCHSCREEN_HAMPSHIRE is not set -# CONFIG_TOUCHSCREEN_EETI is not set -# CONFIG_TOUCHSCREEN_EGALAX is not set -# CONFIG_TOUCHSCREEN_FUJITSU is not set -# CONFIG_TOUCHSCREEN_ILI210X is not set -# CONFIG_TOUCHSCREEN_GUNZE is not set -# CONFIG_TOUCHSCREEN_ELO is not set -# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set -# CONFIG_TOUCHSCREEN_WACOM_I2C is not set -# CONFIG_TOUCHSCREEN_MAX11801 is not set -# CONFIG_TOUCHSCREEN_MCS5000 is not set -# CONFIG_TOUCHSCREEN_MMS114 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_EDT_FT5X06 is not set -# CONFIG_TOUCHSCREEN_SYNAPTICS_RMI4_I2C is not set -# CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_I2C is not set -# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set -# CONFIG_TOUCHSCREEN_TOUCHWIN is not set -# CONFIG_TOUCHSCREEN_PIXCIR is not set -# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set -# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set -# CONFIG_TOUCHSCREEN_TSC_SERIO is not set -# CONFIG_TOUCHSCREEN_TSC2005 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_TOUCHSCREEN_FT5X06 is not set -CONFIG_TOUCHSCREEN_GEN_VKEYS=y -# CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set -# CONFIG_TOUCHSCREEN_GT9XX is not set -CONFIG_INPUT_MISC=y -# CONFIG_INPUT_AD714X is not set -# CONFIG_INPUT_BMA150 is not set -# CONFIG_INPUT_MMA8450 is not set -# CONFIG_INPUT_MPU3050 is not set -# CONFIG_INPUT_GP2A is not set -# CONFIG_INPUT_GPIO_TILT_POLLED is not set -# CONFIG_INPUT_ATI_REMOTE2 is not set -CONFIG_INPUT_KEYCHORD=y -# CONFIG_INPUT_KEYSPAN_REMOTE is not set -# CONFIG_INPUT_KXTJ9 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=y -# CONFIG_INPUT_ISA1200_FF_MEMLESS is not set -# CONFIG_INPUT_PCF8574 is not set -# CONFIG_INPUT_PWM_BEEPER is not set -# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set -# CONFIG_INPUT_ADXL34X is not set -# CONFIG_INPUT_IMS_PCU is not set -# CONFIG_INPUT_CMA3000 is not set -# CONFIG_BMP18X is not set -# CONFIG_SENSORS_MMA8X5X is not set -# CONFIG_SENSORS_STK3X1X is not set -# CONFIG_SENSORS_CAPELLA_CM36283 is not set -# CONFIG_INPUT_VALIDITY_METALLICA is not set - -# -# Hardware I/O ports -# -CONFIG_SERIO=y -CONFIG_SERIO_SERPORT=y -# CONFIG_SERIO_PCIPS2 is not set -# CONFIG_SERIO_LIBPS2 is not set -# CONFIG_SERIO_RAW is not set -# CONFIG_SERIO_ALTERA_PS2 is not set -# CONFIG_SERIO_PS2MULT is not set -# CONFIG_SERIO_ARC_PS2 is not set -# CONFIG_SERIO_APBPS2 is not set -# CONFIG_GAMEPORT is not set - -# -# Character devices -# -CONFIG_TTY=y -# CONFIG_VT 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_NOZOMI is not set -# CONFIG_N_GSM is not set -# CONFIG_N_SMUX 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_KGDB_NMI is not set -# CONFIG_SERIAL_MAX3100 is not set -# CONFIG_SERIAL_MAX310X is not set -# CONFIG_SERIAL_MFD_HSU is not set -CONFIG_SERIAL_CORE=y -CONFIG_SERIAL_CORE_CONSOLE=y -CONFIG_CONSOLE_POLL=y -# CONFIG_SERIAL_JSM is not set -# CONFIG_SERIAL_MSM is not set -CONFIG_SERIAL_MSM_HS=y -CONFIG_SERIAL_MSM_HSL=y -CONFIG_SERIAL_MSM_HSL_CONSOLE=y -# CONFIG_SERIAL_BCM_BT_LPM is not set -# CONFIG_SERIAL_SCCNXP is not set -# CONFIG_SERIAL_TIMBERDALE is not set -# CONFIG_SERIAL_ALTERA_JTAGUART is not set -# CONFIG_SERIAL_ALTERA_UART is not set -# CONFIG_SERIAL_IFX6X60 is not set -# CONFIG_SERIAL_PCH_UART is not set -CONFIG_SERIAL_MSM_SMD=y -# CONFIG_SERIAL_XILINX_PS_UART is not set -# CONFIG_SERIAL_ARC is not set -# CONFIG_SERIAL_RP2 is not set - -# -# Diag Support -# -CONFIG_DIAG_CHAR=y - -# -# DIAG traffic over USB -# -CONFIG_DIAG_OVER_USB=y - -# -# DIAG traffic over TTY -# -CONFIG_DIAG_OVER_TTY=y - -# -# SDIO support for DIAG -# - -# -# HSIC/SMUX support for DIAG -# -CONFIG_DIAGFWD_BRIDGE_CODE=y - -# -# DIAG EXTENSION -# -# CONFIG_DIAG_EXTENSION is not set - -# -# DIAG EXTENSION - Slate -# -# CONFIG_DIAG_EXTENSION_SLATE is not set -# CONFIG_TTY_PRINTK is not set -# CONFIG_HVC_DCC is not set -# CONFIG_IPMI_HANDLER is not set -CONFIG_HW_RANDOM=y -# CONFIG_HW_RANDOM_TIMERIOMEM is not set -# CONFIG_HW_RANDOM_ATMEL is not set -# CONFIG_HW_RANDOM_EXYNOS is not set -CONFIG_HW_RANDOM_MSM=y -# CONFIG_R3964 is not set -# CONFIG_APPLICOM is not set -# CONFIG_RAW_DRIVER is not set -# CONFIG_TCG_TPM is not set -CONFIG_DEVPORT=y -CONFIG_MSM_SMD_PKT=y -CONFIG_MSM_ADSPRPC=y -# CONFIG_MSM_RDBG is not set -CONFIG_I2C=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_COMPAT=y -CONFIG_I2C_CHARDEV=y -# CONFIG_I2C_MUX is not set -CONFIG_I2C_HELPER_AUTO=y - -# -# I2C Hardware Bus support -# - -# -# PC SMBus host controller drivers -# -# CONFIG_I2C_ALI1535 is not set -# CONFIG_I2C_ALI1563 is not set -# CONFIG_I2C_ALI15X3 is not set -# CONFIG_I2C_AMD756 is not set -# CONFIG_I2C_AMD8111 is not set -# CONFIG_I2C_I801 is not set -# CONFIG_I2C_ISCH is not set -# CONFIG_I2C_PIIX4 is not set -# CONFIG_I2C_NFORCE2 is not set -# CONFIG_I2C_SIS5595 is not set -# CONFIG_I2C_SIS630 is not set -# CONFIG_I2C_SIS96X is not set -# CONFIG_I2C_VIA is not set -# CONFIG_I2C_VIAPRO is not set - -# -# I2C system bus drivers (mostly embedded / system-on-chip) -# -# CONFIG_I2C_CBUS_GPIO is not set -# CONFIG_I2C_DESIGNWARE_PLATFORM is not set -# CONFIG_I2C_DESIGNWARE_PCI is not set -# CONFIG_I2C_EG20T is not set -# CONFIG_I2C_GPIO is not set -# CONFIG_I2C_INTEL_MID is not set -CONFIG_I2C_QUP=y -# CONFIG_I2C_MSM_V2 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_DEBUG_CORE is not set -# CONFIG_I2C_DEBUG_ALGO is not set -# CONFIG_I2C_DEBUG_BUS is not set -CONFIG_SLIMBUS=y -# CONFIG_SLIMBUS_MSM_CTRL is not set -CONFIG_SLIMBUS_MSM_NGD=y -CONFIG_SPI=y -# CONFIG_SPI_DEBUG is not set -CONFIG_SPI_MASTER=y - -# -# SPI Master Controller Drivers -# -# CONFIG_SPI_ALTERA is not set -# CONFIG_SPI_BITBANG is not set -# CONFIG_SPI_GPIO is not set -# CONFIG_SPI_FSL_SPI is not set -# CONFIG_SPI_OC_TINY is not set -# CONFIG_SPI_PXA2XX is not set -# CONFIG_SPI_PXA2XX_PCI is not set -# CONFIG_SPI_SC18IS602 is not set -# CONFIG_SPI_TOPCLIFF_PCH is not set -# CONFIG_SPI_XCOMM is not set -# CONFIG_SPI_XILINX is not set -CONFIG_SPI_QUP=y -# CONFIG_SPI_DESIGNWARE is not set - -# -# SPI Protocol Masters -# -CONFIG_SPI_SPIDEV=y -# CONFIG_SPI_TLE62X0 is not set -CONFIG_SPMI=y -CONFIG_SPMI_MSM_PMIC_ARB=y -CONFIG_MSM_QPNP_INT=y - -# -# Qualcomm MSM SSBI bus support -# -# CONFIG_SSBI is not set -# CONFIG_HSI is not set - -# -# PPS support -# -# CONFIG_PPS is not set - -# -# PPS generators support -# - -# -# PTP clock support -# -# CONFIG_PTP_1588_CLOCK is not set - -# -# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks. -# -# CONFIG_PTP_1588_CLOCK_PCH is not set -CONFIG_PINCTRL=y - -# -# Pin controllers -# -CONFIG_PINMUX=y -CONFIG_PINCONF=y -CONFIG_GENERIC_PINCONF=y -# CONFIG_DEBUG_PINCTRL is not set -# CONFIG_PINCTRL_SINGLE is not set -# CONFIG_USE_PINCTRL_IRQ is not set -CONFIG_PINCTRL_MSM_TLMM_V3=y -# CONFIG_PINCTRL_MSM_TLMM_V4 is not set -# CONFIG_PINCTRL_EXYNOS is not set -# CONFIG_PINCTRL_EXYNOS5440 is not set -CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y -CONFIG_ARCH_REQUIRE_GPIOLIB=y -CONFIG_GPIO_DEVRES=y -CONFIG_GPIOLIB=y -CONFIG_OF_GPIO=y -CONFIG_DEBUG_GPIO=y -CONFIG_GPIO_SYSFS=y - -# -# Memory mapped GPIO drivers: -# -# CONFIG_GPIO_GENERIC_PLATFORM is not set -# CONFIG_GPIO_EM is not set -CONFIG_GPIO_MSM_V3=y -# CONFIG_GPIO_RCAR is not set -# CONFIG_GPIO_TS5500 is not set -# CONFIG_GPIO_VX855 is not set -# CONFIG_GPIO_GRGPIO 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 -# CONFIG_GPIO_ADNP is not set - -# -# PCI GPIO expanders: -# -# CONFIG_GPIO_BT8XX is not set -# CONFIG_GPIO_AMD8111 is not set -# CONFIG_GPIO_ML_IOH is not set -# CONFIG_GPIO_RDC321X is not set - -# -# SPI GPIO expanders: -# -# CONFIG_GPIO_MAX7301 is not set -# CONFIG_GPIO_MCP23S08 is not set -# CONFIG_GPIO_MC33880 is not set -# CONFIG_GPIO_74X164 is not set - -# -# AC97 GPIO expanders: -# - -# -# MODULbus GPIO expanders: -# -CONFIG_GPIO_QPNP_PIN=y -CONFIG_GPIO_QPNP_PIN_DEBUG=y - -# -# USB 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_DS2781 is not set -# CONFIG_BATTERY_DS2782 is not set -# CONFIG_BATTERY_SBS is not set -# CONFIG_BATTERY_BQ27x00 is not set -# CONFIG_BATTERY_MAX17040 is not set -CONFIG_BATTERY_MAX17042=y -CONFIG_BATTERY_ANDROID=y -CONFIG_BATTERY_MAX17042_DEBUGFS=y -# CONFIG_CHARGER_ISP1704 is not set -# CONFIG_CHARGER_MAX8903 is not set -# CONFIG_CHARGER_LP8727 is not set -# CONFIG_CHARGER_GPIO is not set -# CONFIG_CHARGER_MANAGER is not set -# CONFIG_CHARGER_BQ2415X is not set -# CONFIG_SMB137C_CHARGER is not set -CONFIG_SMB349_USB_CHARGER=y -CONFIG_SMB350_CHARGER=y -CONFIG_SMB135X_CHARGER=y -CONFIG_MMI_WLS_CHARGER=y -CONFIG_BATTERY_BQ28400=y -# CONFIG_QPNP_CHARGER is not set -CONFIG_BATTERY_BCL=y -# CONFIG_CHARGER_SMB347 is not set -# CONFIG_BATTERY_GOLDFISH is not set -# CONFIG_QPNP_VM_BMS is not set -# CONFIG_QPNP_BMS is not set -# CONFIG_QPNP_LINEAR_CHARGER is not set -# CONFIG_POWER_RESET is not set -# CONFIG_POWER_RESET_RESTART is not set -# CONFIG_POWER_AVS is not set -CONFIG_HWMON=y -# CONFIG_HWMON_VID is not set -# CONFIG_HWMON_DEBUG_CHIP is not set - -# -# Native drivers -# -# CONFIG_SENSORS_AD7314 is not set -# CONFIG_SENSORS_AD7414 is not set -# CONFIG_SENSORS_AD7418 is not set -# CONFIG_SENSORS_ADCXX is not set -# CONFIG_SENSORS_ADM1021 is not set -# CONFIG_SENSORS_ADM1025 is not set -# CONFIG_SENSORS_ADM1026 is not set -# CONFIG_SENSORS_ADM1029 is not set -# CONFIG_SENSORS_ADM1031 is not set -# CONFIG_SENSORS_ADM9240 is not set -# CONFIG_SENSORS_ADT7310 is not set -# CONFIG_SENSORS_ADT7410 is not set -# CONFIG_SENSORS_ADT7411 is not set -# CONFIG_SENSORS_ADT7462 is not set -# CONFIG_SENSORS_ADT7470 is not set -# CONFIG_SENSORS_ADT7475 is not set -# CONFIG_SENSORS_ASC7621 is not set -# CONFIG_SENSORS_ATXP1 is not set -# CONFIG_SENSORS_DS620 is not set -# CONFIG_SENSORS_DS1621 is not set -# CONFIG_SENSORS_I5K_AMB is not set -# CONFIG_SENSORS_F71805F is not set -# CONFIG_SENSORS_F71882FG is not set -# CONFIG_SENSORS_F75375S is not set -# CONFIG_SENSORS_G760A is not set -# CONFIG_SENSORS_GL518SM is not set -# CONFIG_SENSORS_GL520SM is not set -# CONFIG_SENSORS_GPIO_FAN is not set -# CONFIG_SENSORS_HIH6130 is not set -# CONFIG_SENSORS_IT87 is not set -# CONFIG_SENSORS_JC42 is not set -# CONFIG_SENSORS_LINEAGE is not set -# CONFIG_SENSORS_LM63 is not set -# CONFIG_SENSORS_LM70 is not set -# CONFIG_SENSORS_LM73 is not set -CONFIG_SENSORS_LM75=y -# CONFIG_SENSORS_LM77 is not set -# CONFIG_SENSORS_LM78 is not set -# CONFIG_SENSORS_LM80 is not set -# CONFIG_SENSORS_LM83 is not set -# CONFIG_SENSORS_LM85 is not set -# CONFIG_SENSORS_LM87 is not set -# CONFIG_SENSORS_LM90 is not set -# CONFIG_SENSORS_LM92 is not set -# CONFIG_SENSORS_LM93 is not set -# CONFIG_SENSORS_LTC4151 is not set -# CONFIG_SENSORS_LTC4215 is not set -# CONFIG_SENSORS_LTC4245 is not set -# CONFIG_SENSORS_LTC4261 is not set -# CONFIG_SENSORS_LM95234 is not set -# CONFIG_SENSORS_LM95241 is not set -# CONFIG_SENSORS_LM95245 is not set -# CONFIG_SENSORS_MAX1111 is not set -# CONFIG_SENSORS_MAX16065 is not set -# CONFIG_SENSORS_MAX1619 is not set -# CONFIG_SENSORS_MAX1668 is not set -# CONFIG_SENSORS_MAX197 is not set -# CONFIG_SENSORS_MAX6639 is not set -# CONFIG_SENSORS_MAX6642 is not set -# CONFIG_SENSORS_MAX6650 is not set -# CONFIG_SENSORS_MAX6697 is not set -# CONFIG_SENSORS_MCP3021 is not set -# CONFIG_SENSORS_NCT6775 is not set -CONFIG_SENSORS_EPM_ADC=y -CONFIG_SENSORS_QPNP_ADC_VOLTAGE=y -CONFIG_SENSORS_QPNP_ADC_CURRENT=y -# CONFIG_SENSORS_PC87360 is not set -# CONFIG_SENSORS_PC87427 is not set -# CONFIG_SENSORS_PCF8591 is not set -# CONFIG_PMBUS is not set -# CONFIG_SENSORS_SHT15 is not set -# CONFIG_SENSORS_SHT21 is not set -# CONFIG_SENSORS_SIS5595 is not set -# CONFIG_SENSORS_SMM665 is not set -# CONFIG_SENSORS_DME1737 is not set -# CONFIG_SENSORS_EMC1403 is not set -# CONFIG_SENSORS_EMC2103 is not set -# CONFIG_SENSORS_EMC6W201 is not set -# CONFIG_SENSORS_SMSC47M1 is not set -# CONFIG_SENSORS_SMSC47M192 is not set -# CONFIG_SENSORS_SMSC47B397 is not set -# CONFIG_SENSORS_SCH56XX_COMMON is not set -# CONFIG_SENSORS_ADS1015 is not set -# CONFIG_SENSORS_ADS7828 is not set -# CONFIG_SENSORS_ADS7871 is not set -# CONFIG_SENSORS_AMC6821 is not set -# CONFIG_SENSORS_INA209 is not set -# CONFIG_SENSORS_INA2XX is not set -# CONFIG_SENSORS_THMC50 is not set -# CONFIG_SENSORS_TMP102 is not set -# CONFIG_SENSORS_TMP401 is not set -# CONFIG_SENSORS_TMP421 is not set -# CONFIG_SENSORS_VIA686A is not set -# CONFIG_SENSORS_VT1211 is not set -# CONFIG_SENSORS_VT8231 is not set -# CONFIG_SENSORS_W83781D is not set -# CONFIG_SENSORS_W83791D is not set -# CONFIG_SENSORS_W83792D is not set -# CONFIG_SENSORS_W83793 is not set -# CONFIG_SENSORS_W83795 is not set -# CONFIG_SENSORS_W83L785TS is not set -# CONFIG_SENSORS_W83L786NG is not set -# CONFIG_SENSORS_W83627HF is not set -# CONFIG_SENSORS_W83627EHF is not set -CONFIG_THERMAL=y -CONFIG_THERMAL_HWMON=y -CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y -# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set -# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set -# CONFIG_THERMAL_GOV_FAIR_SHARE is not set -CONFIG_THERMAL_GOV_STEP_WISE=y -# CONFIG_THERMAL_GOV_USER_SPACE is not set -# CONFIG_CPU_THERMAL is not set -# CONFIG_THERMAL_EMULATION is not set -CONFIG_THERMAL_TSENS8974=y -CONFIG_THERMAL_MONITOR=y -CONFIG_THERMAL_QPNP=y -CONFIG_THERMAL_QPNP_ADC_TM=y -# 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 - -# -# Multifunction device drivers -# -CONFIG_MFD_CORE=y -# CONFIG_MFD_AS3711 is not set -# CONFIG_PMIC_ADP5520 is not set -# CONFIG_MFD_AAT2870_CORE is not set -# CONFIG_MFD_CROS_EC is not set -# CONFIG_MFD_ASIC3 is not set -# CONFIG_PMIC_DA903X is not set -# CONFIG_MFD_DA9052_SPI is not set -# CONFIG_MFD_DA9052_I2C is not set -# CONFIG_MFD_DA9055 is not set -# CONFIG_MFD_MC13XXX_SPI is not set -# CONFIG_MFD_MC13XXX_I2C is not set -# CONFIG_HTC_EGPIO is not set -# CONFIG_HTC_PASIC3 is not set -# CONFIG_HTC_I2CPLD is not set -# CONFIG_LPC_ICH is not set -# CONFIG_LPC_SCH is not set -# CONFIG_MFD_JANZ_CMODIO is not set -# CONFIG_MFD_88PM800 is not set -# CONFIG_MFD_88PM805 is not set -# CONFIG_MFD_88PM860X is not set -# CONFIG_MFD_MAX77686 is not set -# CONFIG_MFD_MAX77693 is not set -# CONFIG_MFD_MAX8907 is not set -# CONFIG_MFD_MAX8925 is not set -# CONFIG_MFD_MAX8997 is not set -# CONFIG_MFD_MAX8998 is not set -# CONFIG_EZX_PCAP is not set -# CONFIG_MFD_VIPERBOARD is not set -# CONFIG_MFD_RETU is not set -# CONFIG_MFD_PCF50633 is not set -# CONFIG_MFD_RDC321X is not set -# CONFIG_MFD_RTSX_PCI is not set -# CONFIG_MFD_RC5T583 is not set -# CONFIG_MFD_SEC_CORE is not set -# CONFIG_MFD_SI476X_CORE is not set -# CONFIG_MFD_SM501 is not set -# CONFIG_MFD_SMSC is not set -# CONFIG_ABX500_CORE is not set -# CONFIG_MFD_STMPE is not set -# CONFIG_MFD_SYSCON is not set -# CONFIG_MFD_TI_AM335X_TSCADC is not set -# CONFIG_MFD_LP8788 is not set -# CONFIG_MFD_PALMAS is not set -# CONFIG_TPS6105X is not set -# CONFIG_TPS65010 is not set -# CONFIG_TPS6507X is not set -# CONFIG_MFD_TPS65090 is not set -# CONFIG_MFD_TPS65217 is not set -# CONFIG_MFD_TPS6586X is not set -# CONFIG_MFD_TPS65910 is not set -# CONFIG_MFD_TPS65912 is not set -# CONFIG_MFD_TPS65912_I2C is not set -# CONFIG_MFD_TPS65912_SPI is not set -# CONFIG_MFD_TPS80031 is not set -# CONFIG_TWL4030_CORE is not set -# CONFIG_TWL6040_CORE is not set -# CONFIG_MFD_WL1273_CORE is not set -# CONFIG_MFD_LM3533 is not set -# CONFIG_MFD_TIMBERDALE 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_MFD_VX855 is not set -# CONFIG_MFD_ARIZONA_I2C is not set -# CONFIG_MFD_ARIZONA_SPI is not set -# CONFIG_MFD_WM8400 is not set -# CONFIG_MFD_WM831X_I2C is not set -# CONFIG_MFD_WM831X_SPI is not set -# CONFIG_MFD_WM8350_I2C is not set -# CONFIG_MFD_WM8994 is not set -# CONFIG_WCD9304_CODEC is not set -# CONFIG_WCD9310_CODEC is not set -CONFIG_WCD9320_CODEC=y -# CONFIG_WCD9306_CODEC is not set -CONFIG_REGULATOR=y -# CONFIG_REGULATOR_DEBUG is not set -# CONFIG_REGULATOR_DUMMY is not set -CONFIG_REGULATOR_FIXED_VOLTAGE=y -# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set -# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set -CONFIG_REGULATOR_PROXY_CONSUMER=y -# CONFIG_REGULATOR_GPIO is not set -# CONFIG_REGULATOR_AD5398 is not set -# CONFIG_REGULATOR_FAN53555 is not set -# CONFIG_REGULATOR_ISL6271A 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_MAX8973 is not set -# CONFIG_REGULATOR_ONSEMI_NCP6335D is not set -# CONFIG_REGULATOR_LP3971 is not set -# CONFIG_REGULATOR_LP3972 is not set -# CONFIG_REGULATOR_LP872X is not set -# CONFIG_REGULATOR_LP8755 is not set -# CONFIG_REGULATOR_TPS51632 is not set -# CONFIG_REGULATOR_TPS62360 is not set -# CONFIG_REGULATOR_TPS65023 is not set -# CONFIG_REGULATOR_TPS6507X is not set -# CONFIG_REGULATOR_TPS6524X is not set -CONFIG_REGULATOR_STUB=y -CONFIG_REGULATOR_RPM_SMD=y -CONFIG_REGULATOR_QPNP=y -CONFIG_MEDIA_SUPPORT=y - -# -# Multimedia core support -# -CONFIG_MEDIA_CAMERA_SUPPORT=y -# CONFIG_MEDIA_ANALOG_TV_SUPPORT is not set -# CONFIG_MEDIA_DIGITAL_TV_SUPPORT is not set -# CONFIG_MEDIA_RADIO_SUPPORT is not set -# CONFIG_MEDIA_RC_SUPPORT is not set -CONFIG_MEDIA_CONTROLLER=y -CONFIG_VIDEO_DEV=y -CONFIG_VIDEO_V4L2_SUBDEV_API=y -CONFIG_VIDEO_V4L2=y -# CONFIG_VIDEO_ADV_DEBUG is not set -# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set -CONFIG_VIDEOBUF2_CORE=y -CONFIG_VIDEOBUF2_MEMOPS=y -CONFIG_VIDEOBUF2_DMA_CONTIG=y -CONFIG_VIDEOBUF2_VMALLOC=y -CONFIG_VIDEOBUF2_DMA_SG=y -CONFIG_VIDEOBUF2_MSM_MEM=y -# CONFIG_VIDEO_V4L2_INT_DEVICE is not set -# CONFIG_TTPCI_EEPROM is not set - -# -# Media drivers -# -# CONFIG_MEDIA_USB_SUPPORT is not set -# CONFIG_MEDIA_PCI_SUPPORT is not set -CONFIG_V4L_PLATFORM_DRIVERS=y -# CONFIG_VIDEO_CAFE_CCIC is not set -# CONFIG_SOC_CAMERA is not set -# CONFIG_V4L_MEM2MEM_DRIVERS is not set -# CONFIG_V4L_TEST_DRIVERS is not set - -# -# Qualcomm MSM Camera And Video -# -# CONFIG_MSM_CAMERA is not set -CONFIG_MSMB_CAMERA=y -# CONFIG_MSMB_CAMERA_DEBUG is not set -CONFIG_MSM_CAMERA_SENSOR=y -CONFIG_MSM_CPP=y -CONFIG_MSM_CCI=y -# CONFIG_MSM_CSI20_HEADER is not set -# CONFIG_MSM_CSI22_HEADER is not set -# CONFIG_MSM_CSI30_HEADER is not set -CONFIG_MSM_CSI31_HEADER=y -CONFIG_MSM_CSIPHY=y -CONFIG_MSM_CSID=y -CONFIG_MSM_EEPROM=y -CONFIG_MSM_ISPIF=y -# CONFIG_MSM_ISPIF_V1 is not set -# CONFIG_S5K3L1YX is not set -# CONFIG_IMX135 is not set -# CONFIG_IMX134 is not set -# CONFIG_IMX132 is not set -# CONFIG_OV2720 is not set -# CONFIG_OV9724 is not set -# CONFIG_HI256 is not set -# CONFIG_OV5648 is not set -# CONFIG_MT9M114 is not set -# CONFIG_SP1628 is not set -# CONFIG_GC0339 is not set -# CONFIG_OV8825 is not set -# CONFIG_OV8865 is not set -# CONFIG_s5k4e1 is not set -# CONFIG_OV12830 is not set -CONFIG_LEDS_LM3646=y -# CONFIG_MSM_V4L2_VIDEO_OVERLAY_DEVICE is not set -CONFIG_MSMB_JPEG=y -# CONFIG_MSM_FD is not set -CONFIG_MSM_VIDC_V4L2=y -CONFIG_MSM_WFD=y -# CONFIG_MSM_WFD_DEBUG is not set -# CONFIG_TSPP is not set -# CONFIG_CI_BRIDGE_SPI is not set -CONFIG_MSM_VPU=y - -# -# Supported MMC/SDIO adapters -# -# CONFIG_CYPRESS_FIRMWARE is not set - -# -# Media ancillary drivers (tuners, sensors, i2c, frontends) -# -CONFIG_MEDIA_SUBDRV_AUTOSELECT=y - -# -# Audio decoders, processors and mixers -# - -# -# RDS decoders -# - -# -# Video decoders -# - -# -# Video and audio decoders -# - -# -# Video encoders -# - -# -# Camera sensor devices -# - -# -# Flash devices -# - -# -# Video improvement chips -# - -# -# Miscelaneous helper chips -# - -# -# Sensors used on soc_camera driver -# - -# -# Tools to develop new frontends -# -# CONFIG_DVB_DUMMY_FE is not set - -# -# Graphics support -# -# CONFIG_VGA_ARB is not set -# CONFIG_DRM is not set -CONFIG_MSM_KGSL=y -# CONFIG_MSM_KGSL_CFF_DUMP is not set -CONFIG_MSM_ADRENO_DEFAULT_GOVERNOR="msm-adreno-tz" -CONFIG_KGSL_PER_PROCESS_PAGE_TABLE=y -# 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=y -CONFIG_FB_SYS_COPYAREA=y -CONFIG_FB_SYS_IMAGEBLIT=y -# CONFIG_FB_FOREIGN_ENDIAN is not set -CONFIG_FB_SYS_FOPS=y -# CONFIG_FB_SVGALIB is not set -# CONFIG_FB_MACMODES is not set -# CONFIG_FB_MODE_HELPERS is not set -# CONFIG_FB_TILEBLITTING is not set - -# -# Frame buffer hardware drivers -# -# CONFIG_FB_CIRRUS is not set -# CONFIG_FB_PM2 is not set -# CONFIG_FB_CYBER2000 is not set -# CONFIG_FB_ASILIANT is not set -# CONFIG_FB_IMSTT is not set -# CONFIG_FB_S1D13XXX is not set -# CONFIG_FB_NVIDIA is not set -# CONFIG_FB_RIVA is not set -# CONFIG_FB_I740 is not set -# CONFIG_FB_MATROX is not set -# CONFIG_FB_RADEON is not set -# CONFIG_FB_ATY128 is not set -# CONFIG_FB_ATY is not set -# CONFIG_FB_S3 is not set -# CONFIG_FB_SAVAGE is not set -# CONFIG_FB_SIS is not set -# CONFIG_FB_NEOMAGIC is not set -# CONFIG_FB_KYRO is not set -# CONFIG_FB_3DFX is not set -# CONFIG_FB_VOODOO1 is not set -# CONFIG_FB_VT8623 is not set -# CONFIG_FB_TRIDENT is not set -# CONFIG_FB_ARK is not set -# CONFIG_FB_PM3 is not set -# CONFIG_FB_CARMINE is not set -# CONFIG_FB_TMIO is not set -# CONFIG_FB_SMSCUFX is not set -# CONFIG_FB_UDL is not set -# CONFIG_FB_GOLDFISH is not set -CONFIG_FB_VIRTUAL=y -# CONFIG_FB_METRONOME is not set -# CONFIG_FB_MB862XX is not set -# CONFIG_FB_BROADSHEET is not set -# CONFIG_FB_AUO_K190X is not set -# CONFIG_FB_SIMPLE is not set -# CONFIG_MSM_VIDC_CONTENT_PROTECTION is not set -CONFIG_FB_MSM=y -# CONFIG_FB_MSM_BACKLIGHT is not set -# CONFIG_FB_MSM_LCDC_HW is not set -# CONFIG_FB_MSM_TRIPLE_BUFFER is not set -# CONFIG_FB_MSM_MDP_HW is not set -CONFIG_FB_MSM_MDSS_COMMON=y -# CONFIG_FB_MSM_MDP22 is not set -# CONFIG_FB_MSM_MDP30 is not set -# CONFIG_FB_MSM_MDP31 is not set -# CONFIG_FB_MSM_MDP40 is not set -CONFIG_FB_MSM_MDSS=y -# CONFIG_FB_MSM_MDP_NONE is not set -# CONFIG_FB_MSM_MDDI is not set -# CONFIG_FB_MSM_MIPI_DSI is not set -# CONFIG_FB_MSM_EXTMDDI is not set -# CONFIG_FB_MSM_MDDI_AUTO_DETECT is not set -# CONFIG_FB_MSM_LCDC_AUTO_DETECT is not set -CONFIG_FB_MSM_LVDS_CHIMEI_WXGA_PANEL=y -# CONFIG_FB_MSM_LVDS_FRC_FHD_PANEL is not set -# CONFIG_FB_MSM_MIPI_PANEL_DETECT is not set -# CONFIG_FB_MSM_MDDI_PANEL_AUTO_DETECT is not set -# CONFIG_FB_MSM_LCDC_PANEL_AUTO_DETECT is not set -# CONFIG_FB_MSM_LCDC_MIPI_PANEL_AUTO_DETECT is not set -# CONFIG_FB_MSM_LVDS_MIPI_PANEL_DETECT is not set -# CONFIG_FB_MSM_MDDI_TOSHIBA_VGA is not set -# CONFIG_FB_MSM_MIPI_TOSHIBA_VIDEO_WVGA_PT_PANEL is not set -# CONFIG_FB_MSM_MIPI_TOSHIBA_VIDEO_WSVGA_PT_PANEL is not set -# CONFIG_FB_MSM_MIPI_TOSHIBA_VIDEO_WUXGA_PANEL is not set -# CONFIG_FB_MSM_MIPI_NOVATEK_VIDEO_QHD_PT_PANEL is not set -# CONFIG_FB_MSM_MIPI_NOVATEK_CMD_QHD_PT_PANEL is not set -# CONFIG_FB_MSM_MIPI_ORISE_VIDEO_720P_PT_PANEL is not set -# CONFIG_FB_MSM_MIPI_ORISE_CMD_720P_PT_PANEL is not set -# CONFIG_FB_MSM_MIPI_RENESAS_VIDEO_FWVGA_PT_PANEL is not set -# CONFIG_FB_MSM_MIPI_RENESAS_CMD_FWVGA_PT_PANEL is not set -# CONFIG_FB_MSM_MIPI_CHIMEI_WXGA_PANEL is not set -# CONFIG_FB_MSM_MIPI_CHIMEI_WUXGA_PANEL is not set -# CONFIG_FB_MSM_MIPI_TRULY_VIDEO_WVGA_PT_PANEL is not set -# CONFIG_FB_MSM_MIPI_NT35510_VIDEO_WVGA_PT_PANEL is not set -# CONFIG_FB_MSM_MIPI_NT35510_CMD_WVGA_PT_PANEL is not set -# CONFIG_FB_MSM_MIPI_NT35516_VIDEO_QHD_PT_PANEL is not set -# CONFIG_FB_MSM_MIPI_NT35516_CMD_QHD_PT_PANEL is not set -# CONFIG_FB_MSM_MIPI_SIMULATOR_VIDEO_PANEL is not set -# CONFIG_FB_MSM_PANEL_NONE is not set -# CONFIG_FB_MSM_HDMI_COMMON is not set -# CONFIG_FB_MSM_HDMI_3D is not set -# CONFIG_FB_MSM_EBI2_PANEL_DETECT is not set -# CONFIG_FB_MSM_QPIC_ILI_QVGA_PANEL is not set -# CONFIG_FB_MSM_QPIC_PANEL_DETECT is not set -CONFIG_FB_MSM_MDSS_WRITEBACK=y -CONFIG_FB_MSM_MDSS_HDMI_PANEL=y -CONFIG_FB_MSM_MDSS_HDMI_MHL_SII8334=y -CONFIG_FB_MSM_MDSS_DSI_CTRL_STATUS=y -# CONFIG_FB_MSM_MDSS_EDP_PANEL is not set -# CONFIG_FB_MSM_MDSS_MDP3 is not set -# CONFIG_EXYNOS_VIDEO 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_PWM is not set -# CONFIG_BACKLIGHT_ADP8860 is not set -# CONFIG_BACKLIGHT_ADP8870 is not set -# CONFIG_BACKLIGHT_LM3630 is not set -# CONFIG_BACKLIGHT_LM3639 is not set -# CONFIG_BACKLIGHT_LP855X is not set -# CONFIG_LOGO is not set -# CONFIG_FB_SSD1307 is not set -CONFIG_SOUND=y -# CONFIG_SOUND_OSS_CORE is not set -CONFIG_SND=y -CONFIG_SND_TIMER=y -CONFIG_SND_PCM=y -CONFIG_SND_HWDEP=y -CONFIG_SND_RAWMIDI=y -CONFIG_SND_COMPRESS_OFFLOAD=y -CONFIG_SND_JACK=y -# CONFIG_SND_SEQUENCER is not set -# CONFIG_SND_MIXER_OSS is not set -# CONFIG_SND_PCM_OSS is not set -# CONFIG_SND_HRTIMER is not set -CONFIG_SND_DYNAMIC_MINORS=y -CONFIG_SND_SUPPORT_OLD_API=y -CONFIG_SND_VERBOSE_PROCFS=y -# CONFIG_SND_VERBOSE_PRINTK is not set -# CONFIG_SND_DEBUG is not set -# CONFIG_SND_RAWMIDI_SEQ is not set -# CONFIG_SND_OPL3_LIB_SEQ is not set -# CONFIG_SND_OPL4_LIB_SEQ is not set -# CONFIG_SND_SBAWE_SEQ is not set -# CONFIG_SND_EMU10K1_SEQ is not set -CONFIG_SND_DRIVERS=y -# CONFIG_SND_DUMMY is not set -# CONFIG_SND_ALOOP is not set -# CONFIG_SND_MTPAV is not set -# CONFIG_SND_SERIAL_U16550 is not set -# CONFIG_SND_MPU401 is not set -# CONFIG_SND_PCI is not set -CONFIG_SND_ARM=y -# CONFIG_SND_SPI is not set -CONFIG_SND_USB=y -CONFIG_SND_USB_AUDIO=y -# CONFIG_SND_USB_UA101 is not set -# CONFIG_SND_USB_CAIAQ is not set -# CONFIG_SND_USB_6FIRE is not set -CONFIG_SND_SOC=y -# CONFIG_SND_ATMEL_SOC is not set -# CONFIG_SND_DESIGNWARE_I2S is not set - -# -# MSM SoC Audio support -# -CONFIG_SND_SOC_MSM_HOSTLESS_PCM=y -CONFIG_SND_SOC_MSM_QDSP6V2_INTF=y -# CONFIG_SND_SOC_QDSP6 is not set -CONFIG_SND_SOC_QDSP6V2=y -CONFIG_AUDIO_OCMEM=y -CONFIG_DOLBY_DAP=y -CONFIG_DOLBY_DS2=y -CONFIG_DTS_SRS_TM=y -CONFIG_QTI_PP=y -CONFIG_SND_SOC_CPE=y -CONFIG_SND_SOC_APQ8084=y -CONFIG_SND_SOC_I2C_AND_SPI=y -# CONFIG_SND_SOC_ALL_CODECS is not set -CONFIG_SND_SOC_WCD9320=y -CONFIG_SND_SOC_WCD9330=y -CONFIG_SND_SOC_WCD9XXX=y -CONFIG_SND_SOC_WCD_CPE=y -CONFIG_SND_SOC_TFA9890=y -CONFIG_SND_SOC_MSM_STUB=y -CONFIG_SND_SOC_MSM_HDMI_CODEC_RX=y -CONFIG_SND_SOC_TPA6165A2=y -CONFIG_SND_SOC_FSA8500=y -# CONFIG_SND_SIMPLE_CARD is not set -# CONFIG_SOUND_PRIME is not set - -# -# HID support -# -CONFIG_HID=y -# CONFIG_HID_BATTERY_STRENGTH is not set -# CONFIG_HIDRAW is not set -CONFIG_UHID=y -CONFIG_HID_GENERIC=y - -# -# Special HID drivers -# -CONFIG_HID_A4TECH=y -CONFIG_HID_ACRUX=y -CONFIG_HID_ACRUX_FF=y -CONFIG_HID_APPLE=y -# CONFIG_HID_APPLEIR is not set -# CONFIG_HID_AUREAL is not set -CONFIG_HID_BELKIN=y -CONFIG_HID_CHERRY=y -CONFIG_HID_CHICONY=y -CONFIG_HID_PRODIKEYS=y -CONFIG_HID_CYPRESS=y -CONFIG_HID_DRAGONRISE=y -CONFIG_DRAGONRISE_FF=y -CONFIG_HID_EMS_FF=y -CONFIG_HID_ELECOM=y -CONFIG_HID_EZKEY=y -CONFIG_HID_HOLTEK=y -# CONFIG_HOLTEK_FF is not set -CONFIG_HID_KEYTOUCH=y -CONFIG_HID_KYE=y -CONFIG_HID_UCLOGIC=y -CONFIG_HID_WALTOP=y -CONFIG_HID_GYRATION=y -# CONFIG_HID_ICADE is not set -CONFIG_HID_TWINHAN=y -CONFIG_HID_KENSINGTON=y -CONFIG_HID_LCPOWER=y -# CONFIG_HID_LENOVO_TPKBD is not set -CONFIG_HID_LOGITECH=y -CONFIG_HID_LOGITECH_DJ=y -CONFIG_LOGITECH_FF=y -CONFIG_LOGIRUMBLEPAD2_FF=y -CONFIG_LOGIG940_FF=y -CONFIG_LOGIWHEELS_FF=y -CONFIG_HID_MAGICMOUSE=y -CONFIG_HID_MICROSOFT=y -CONFIG_HID_MONTEREY=y -CONFIG_HID_MULTITOUCH=y -# CONFIG_HID_NTRIG is not set -CONFIG_HID_ORTEK=y -CONFIG_HID_PANTHERLORD=y -CONFIG_PANTHERLORD_FF=y -CONFIG_HID_PETALYNX=y -CONFIG_HID_PICOLCD=y -# CONFIG_HID_PICOLCD_FB is not set -# CONFIG_HID_PICOLCD_BACKLIGHT is not set -# CONFIG_HID_PICOLCD_LEDS is not set -CONFIG_HID_PRIMAX=y -# CONFIG_HID_PS3REMOTE is not set -CONFIG_HID_ROCCAT=y -CONFIG_HID_SAITEK=y -CONFIG_HID_SAMSUNG=y -CONFIG_HID_SONY=y -CONFIG_HID_SPEEDLINK=y -# CONFIG_HID_STEELSERIES is not set -CONFIG_HID_SUNPLUS=y -CONFIG_HID_GREENASIA=y -CONFIG_GREENASIA_FF=y -CONFIG_HID_SMARTJOYPLUS=y -CONFIG_SMARTJOYPLUS_FF=y -CONFIG_HID_TIVO=y -CONFIG_HID_TOPSEED=y -# CONFIG_HID_THINGM is not set -CONFIG_HID_THRUSTMASTER=y -# CONFIG_THRUSTMASTER_FF is not set -CONFIG_HID_WACOM=y -CONFIG_HID_WIIMOTE=y -CONFIG_HID_WIIMOTE_EXT=y -CONFIG_HID_ZEROPLUS=y -# CONFIG_ZEROPLUS_FF is not set -CONFIG_HID_ZYDACRON=y -# CONFIG_HID_SENSOR_HUB is not set - -# -# USB HID support -# -CONFIG_USB_HID=y -# CONFIG_HID_PID is not set -CONFIG_USB_HIDDEV=y - -# -# I2C HID support -# -# CONFIG_I2C_HID is not set -CONFIG_USB_ARCH_HAS_OHCI=y -CONFIG_USB_ARCH_HAS_EHCI=y -CONFIG_USB_ARCH_HAS_XHCI=y -CONFIG_USB_SUPPORT=y -CONFIG_USB_COMMON=y -CONFIG_USB_ARCH_HAS_HCD=y -CONFIG_USB=y -# CONFIG_USB_DEBUG is not set -CONFIG_USB_ANNOUNCE_NEW_DEVICES=y - -# -# Miscellaneous USB options -# -CONFIG_USB_DEFAULT_PERSIST=y -# CONFIG_USB_DYNAMIC_MINORS is not set -# CONFIG_USB_OTG is not set -# CONFIG_USB_OTG_WHITELIST is not set -# CONFIG_USB_OTG_BLACKLIST_HUB is not set -# CONFIG_USB_MON is not set -# CONFIG_USB_WUSB_CBAF is not set - -# -# USB Host Controller Drivers -# -# CONFIG_USB_C67X00_HCD is not set -CONFIG_USB_XHCI_HCD=y -CONFIG_USB_XHCI_PLATFORM=y -CONFIG_USB_XHCI_MSM_HSIC=y -# CONFIG_USB_XHCI_HCD_DEBUGGING is not set -CONFIG_USB_EHCI_HCD=y -CONFIG_USB_EHCI_EHSET=y -# CONFIG_USB_EHCI_ROOT_HUB_TT is not set -CONFIG_USB_EHCI_TT_NEWSCHED=y -CONFIG_USB_EHCI_PCI=y -# CONFIG_USB_EHCI_MSM is not set -# CONFIG_USB_EHCI_MSM_HSIC is not set -# CONFIG_USB_EHCI_HCD_PLATFORM 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_OHCI_HCD is not set -# CONFIG_USB_UHCI_HCD is not set -# CONFIG_USB_SL811_HCD is not set -# CONFIG_USB_R8A66597_HCD is not set -# CONFIG_USB_MUSB_HDRC is not set -# CONFIG_USB_RENESAS_USBHS is not set - -# -# USB Device Class drivers -# -CONFIG_USB_ACM=y -# CONFIG_USB_PRINTER is not set -# CONFIG_USB_WDM is not set -# CONFIG_USB_TMC is not set -# CONFIG_USB_CCID_BRIDGE 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=y -CONFIG_USB_STORAGE_FREECOM=y -CONFIG_USB_STORAGE_ISD200=y -CONFIG_USB_STORAGE_USBAT=y -CONFIG_USB_STORAGE_SDDR09=y -CONFIG_USB_STORAGE_SDDR55=y -CONFIG_USB_STORAGE_JUMPSHOT=y -CONFIG_USB_STORAGE_ALAUDA=y -CONFIG_USB_STORAGE_ONETOUCH=y -CONFIG_USB_STORAGE_KARMA=y -CONFIG_USB_STORAGE_CYPRESS_ATACB=y -CONFIG_USB_STORAGE_ENE_UB6250=y - -# -# USB Imaging devices -# -# CONFIG_USB_MDC800 is not set -# CONFIG_USB_MICROTEK is not set -CONFIG_USB_DWC3=y -# CONFIG_USB_DWC3_HOST is not set -# CONFIG_USB_DWC3_GADGET is not set -CONFIG_USB_DWC3_DUAL_ROLE=y -# CONFIG_USB_DWC3_DEBUG is not set -# CONFIG_USB_CHIPIDEA is not set - -# -# USB port drivers -# -CONFIG_USB_SERIAL=y -# CONFIG_USB_SERIAL_CONSOLE is not set -# CONFIG_USB_SERIAL_GENERIC is not set -# 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_F81232 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_METRO 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_OPTION is not set -# 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_XSENS_MT is not set -# CONFIG_USB_SERIAL_ZIO is not set -# CONFIG_USB_SERIAL_WISHBONE is not set -# CONFIG_USB_SERIAL_ZTE is not set -# CONFIG_USB_SERIAL_SSU100 is not set -# CONFIG_USB_SERIAL_QT2 is not set -# CONFIG_USB_SERIAL_CSVT 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_SISUSBVGA 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_EHSET_TEST_FIXTURE=y -# CONFIG_USB_ISIGHTFW is not set -# CONFIG_USB_YUREX is not set -# CONFIG_USB_EZUSB_FX2 is not set -# CONFIG_USB_HSIC_USB3503 is not set -CONFIG_USB_QCOM_DIAG_BRIDGE=y -CONFIG_USB_QCOM_MDM_BRIDGE=y -CONFIG_USB_QCOM_KS_BRIDGE=y -CONFIG_USB_QCOM_IPC_BRIDGE=y -CONFIG_USB_PHY=y -# CONFIG_USB_OTG_WAKELOCK is not set -# CONFIG_NOP_USB_XCEIV is not set -# CONFIG_OMAP_CONTROL_USB is not set -# CONFIG_OMAP_USB3 is not set -# CONFIG_SAMSUNG_USBPHY is not set -# CONFIG_SAMSUNG_USB2PHY is not set -# CONFIG_SAMSUNG_USB3PHY is not set -# CONFIG_USB_MSM_OTG_72K is not set -# CONFIG_USB_GPIO_VBUS is not set -# CONFIG_USB_ISP1301 is not set -CONFIG_USB_MSM_OTG=y -# CONFIG_USB_MSM_ACA is not set -CONFIG_USB_MSM_HSPHY=y -CONFIG_USB_MSM_SSPHY=y -# CONFIG_USB_MSM_SSPHY_QMP is not set -# CONFIG_USB_RCAR_PHY is not set -# CONFIG_USB_ULPI is not set -CONFIG_USB_GADGET=y -# CONFIG_USB_GADGET_DEBUG is not set -CONFIG_USB_GADGET_DEBUG_FILES=y -# CONFIG_USB_GADGET_DEBUG_FS is not set -CONFIG_USB_GADGET_VBUS_DRAW=500 -CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2 - -# -# USB Peripheral Controller -# -# CONFIG_USB_FUSB300 is not set -# CONFIG_USB_R8A66597 is not set -# CONFIG_USB_PXA27X is not set -# CONFIG_USB_MV_UDC is not set -# CONFIG_USB_MV_U3D is not set -# CONFIG_USB_M66592 is not set -# CONFIG_USB_AMD5536UDC is not set -# CONFIG_USB_NET2272 is not set -# CONFIG_USB_NET2280 is not set -# CONFIG_USB_GOKU is not set -# CONFIG_USB_EG20T is not set -CONFIG_USB_CI13XXX_MSM=y -# CONFIG_USB_CI13XXX_MSM_HSIC is not set -CONFIG_USB_DWC3_MSM=y -# CONFIG_USB_DUMMY_HCD is not set -CONFIG_USB_LIBCOMPOSITE=y -CONFIG_USB_F_ACM=y -CONFIG_USB_U_SERIAL=y -CONFIG_USB_F_SERIAL=y -# CONFIG_USB_ZERO is not set -# CONFIG_USB_AUDIO 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_MASS_STORAGE is not set -# CONFIG_USB_G_SERIAL is not set -# CONFIG_USB_MIDI_GADGET is not set -# CONFIG_USB_G_PRINTER is not set -CONFIG_USB_G_ANDROID=y -# CONFIG_USB_ANDROID_RNDIS_DWORD_ALIGNED is not set -# CONFIG_USB_CDC_COMPOSITE is not set -# CONFIG_USB_G_ACM_MS 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 -CONFIG_USB_CSW_HACK=y -# CONFIG_USB_MSC_PROFILING is not set -CONFIG_MODEM_SUPPORT=y -CONFIG_RMNET_SMD_CTL_CHANNEL="" -CONFIG_RMNET_SMD_DATA_CHANNEL="" -# CONFIG_UWB is not set -CONFIG_MMC=y -# CONFIG_MMC_DEBUG is not set -CONFIG_MMC_PERF_PROFILING=y -CONFIG_MMC_UNSAFE_RESUME=y -CONFIG_MMC_CLKGATE=y -# CONFIG_MMC_EMBEDDED_SDIO is not set -CONFIG_MMC_PARANOID_SD_INIT=y - -# -# MMC/SD/SDIO Card Drivers -# -CONFIG_MMC_BLOCK=y -CONFIG_MMC_BLOCK_MINORS=32 -# CONFIG_MMC_BLOCK_BOUNCE is not set -# CONFIG_MMC_BLOCK_DEFERRED_RESUME is not set -# CONFIG_SDIO_UART is not set -CONFIG_MMC_TEST=y -CONFIG_MMC_BLOCK_TEST=y - -# -# MMC/SD/SDIO Host Controller Drivers -# -CONFIG_MMC_SDHCI=y -# CONFIG_MMC_SDHCI_PCI is not set -CONFIG_MMC_SDHCI_PLTFM=y -# CONFIG_MMC_SDHCI_PXAV3 is not set -# CONFIG_MMC_SDHCI_PXAV2 is not set -CONFIG_MMC_MSM=y -# CONFIG_MMC_TIFM_SD is not set -CONFIG_MMC_SDHCI_MSM=y -# CONFIG_MMC_SDHCI_MSM_DEBUG is not set -CONFIG_MMC_MSM_SDC1_SUPPORT=y -# CONFIG_MMC_MSM_SDC1_8_BIT_SUPPORT is not set -CONFIG_MMC_MSM_SDC2_SUPPORT=y -# CONFIG_MMC_MSM_SDC2_8_BIT_SUPPORT is not set -# CONFIG_MMC_MSM_SDC3_SUPPORT is not set -# CONFIG_MMC_MSM_SDC3_POLLING is not set -# CONFIG_MMC_MSM_SDC4_SUPPORT is not set -# CONFIG_MMC_MSM_SDC5_SUPPORT is not set -# CONFIG_MMC_MSM_SPS_SUPPORT is not set -# CONFIG_MMC_CB710 is not set -# CONFIG_MMC_VIA_SDMMC 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=y -CONFIG_LEDS_CLASS=y - -# -# LED drivers -# -# CONFIG_LEDS_LM3530 is not set -# CONFIG_LEDS_LM3642 is not set -# CONFIG_LEDS_PCA9532 is not set -# CONFIG_LEDS_GPIO is not set -# CONFIG_LEDS_LP3944 is not set -# CONFIG_LEDS_LP5521 is not set -# CONFIG_LEDS_LP5523 is not set -# CONFIG_LEDS_LP5562 is not set -# CONFIG_LEDS_PCA955X is not set -# CONFIG_LEDS_PCA9633 is not set -CONFIG_LEDS_QPNP=y -# CONFIG_LEDS_MSM_GPIO_FLASH is not set -# CONFIG_LEDS_DAC124S085 is not set -# CONFIG_LEDS_PWM is not set -# CONFIG_LEDS_REGULATOR is not set -# CONFIG_LEDS_BD2802 is not set -# CONFIG_LEDS_LT3593 is not set -# CONFIG_LEDS_RENESAS_TPU is not set -# CONFIG_LEDS_TCA6507 is not set -# CONFIG_LEDS_LM355x is not set -# CONFIG_LEDS_OT200 is not set -# CONFIG_LEDS_BLINKM is not set - -# -# LED Triggers -# -CONFIG_LEDS_TRIGGERS=y -# CONFIG_LEDS_TRIGGER_TIMER is not set -# CONFIG_LEDS_TRIGGER_ONESHOT is not set -# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set -CONFIG_LEDS_TRIGGER_BACKLIGHT=y -# CONFIG_LEDS_TRIGGER_CPU is not set -# CONFIG_LEDS_TRIGGER_GPIO is not set -CONFIG_LEDS_TRIGGER_DEFAULT_ON=y - -# -# iptables trigger is under Netfilter config (LED target) -# -# CONFIG_LEDS_TRIGGER_TRANSIENT is not set -# CONFIG_LEDS_TRIGGER_CAMERA is not set -CONFIG_SWITCH=y -# CONFIG_SWITCH_GPIO is not set -# CONFIG_ACCESSIBILITY is not set -# CONFIG_INFINIBAND is not set -# CONFIG_EDAC is not set -CONFIG_RTC_LIB=y -CONFIG_RTC_CLASS=y -CONFIG_RTC_HCTOSYS=y -CONFIG_RTC_SYSTOHC=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_DRV_TEST is not set - -# -# I2C RTC drivers -# -# 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_PCF8523 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_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 -# -# CONFIG_RTC_DRV_M41T93 is not set -# CONFIG_RTC_DRV_M41T94 is not set -# CONFIG_RTC_DRV_DS1305 is not set -# CONFIG_RTC_DRV_DS1390 is not set -# CONFIG_RTC_DRV_MAX6902 is not set -# CONFIG_RTC_DRV_R9701 is not set -# CONFIG_RTC_DRV_RS5C348 is not set -# CONFIG_RTC_DRV_DS3234 is not set -# CONFIG_RTC_DRV_PCF2123 is not set -# CONFIG_RTC_DRV_RX4581 is not set - -# -# 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 -# CONFIG_RTC_DRV_DS2404 is not set - -# -# on-CPU RTC drivers -# -# CONFIG_RTC_DRV_SNVS is not set -CONFIG_RTC_DRV_QPNP=y - -# -# HID Sensor RTC drivers -# -# CONFIG_RTC_DRV_HID_SENSOR_TIME is not set -CONFIG_ESOC=y -CONFIG_ESOC_DEV=y -CONFIG_ESOC_CLIENT=y -# CONFIG_ESOC_DEBUG is not set -CONFIG_ESOC_MDM_4x=y -CONFIG_ESOC_MDM_DRV=y -# CONFIG_DMADEVICES is not set -# CONFIG_AUXDISPLAY is not set -CONFIG_UIO=y -# CONFIG_UIO_CIF is not set -# CONFIG_UIO_PDRV is not set -# CONFIG_UIO_PDRV_GENIRQ is not set -# CONFIG_UIO_DMEM_GENIRQ is not set -# CONFIG_UIO_AEC is not set -# CONFIG_UIO_SERCOS3 is not set -# CONFIG_UIO_PCI_GENERIC is not set -# CONFIG_UIO_NETX is not set -CONFIG_UIO_MSM_SHAREDMEM=y -# CONFIG_VFIO is not set -# CONFIG_VIRT_DRIVERS is not set - -# -# Virtio drivers -# -# CONFIG_VIRTIO_PCI is not set -# CONFIG_VIRTIO_MMIO is not set - -# -# Microsoft Hyper-V guest support -# -CONFIG_STAGING=y -# CONFIG_ET131X is not set -# CONFIG_USBIP_CORE is not set -# CONFIG_PRISM2_USB is not set -# CONFIG_ECHO is not set -# CONFIG_ASUS_OLED is not set -# CONFIG_R8712U is not set -# CONFIG_RTS5139 is not set -# CONFIG_TRANZPORT is not set -# CONFIG_LINE6_USB is not set -# CONFIG_USB_SERIAL_QUATECH2 is not set -# CONFIG_DX_SEP is not set -# CONFIG_ZSMALLOC is not set -# CONFIG_FB_SM7XX is not set -# CONFIG_CRYSTALHD is not set -# CONFIG_FB_XGI is not set -# CONFIG_BCM_WIMAX is not set -# CONFIG_FT1000 is not set - -# -# Speakup console speech -# -# CONFIG_TOUCHSCREEN_CLEARPAD_TM1217 is not set -# CONFIG_STAGING_MEDIA is not set - -# -# Android -# -CONFIG_ANDROID=y -CONFIG_ANDROID_BINDER_IPC=y -CONFIG_ANDROID_BINDER_IPC_32BIT=y -CONFIG_ASHMEM=y -CONFIG_ANDROID_LOGGER=y -CONFIG_LOGCAT_SIZE=256 -CONFIG_ANDROID_TIMED_OUTPUT=y -CONFIG_ANDROID_TIMED_GPIO=y -CONFIG_ANDROID_LOW_MEMORY_KILLER=y -CONFIG_ANDROID_LOW_MEMORY_KILLER_AUTODETECT_OOM_ADJ_VALUES=y -CONFIG_ANDROID_INTF_ALARM_DEV=y -CONFIG_SYNC=y -CONFIG_SW_SYNC=y -# CONFIG_SW_SYNC_USER is not set -CONFIG_ION=y -# CONFIG_ION_TEST is not set -CONFIG_ION_MSM=y -# CONFIG_USB_WPAN_HCD is not set -# CONFIG_WIMAX_GDM72XX is not set -# CONFIG_NET_VENDOR_SILICOM is not set -# CONFIG_CED1401 is not set -# CONFIG_DGRP is not set - -# -# Qualcomm MSM specific device drivers -# -CONFIG_MSM_SSBI=y -CONFIG_SPS=y -CONFIG_USB_BAM=y -CONFIG_SPS_SUPPORT_BAMDMA=y -CONFIG_SPS_SUPPORT_NDP_BAM=y -# CONFIG_SPS_SUPPORT_4K_GROUP is not set -CONFIG_QPNP_POWER_ON=y -CONFIG_QPNP_CLKDIV=y -# CONFIG_QPNP_VIBRATOR is not set -# CONFIG_QPNP_REVID is not set -# CONFIG_QPNP_COINCELL is not set -CONFIG_QPNP_USB_DETECT=y -# CONFIG_IPA is not set -# CONFIG_KLM is not set -# CONFIG_MSM_AVTIMER is not set -# CONFIG_SSM is not set -CONFIG_QCA1530=y -# CONFIG_MSM_SPSS is not set -CONFIG_CLKDEV_LOOKUP=y -CONFIG_HAVE_CLK_PREPARE=y -# CONFIG_MSM_MDSS_PLL is not set -CONFIG_HWSPINLOCK=y - -# -# Hardware Spinlock drivers -# -CONFIG_REMOTE_SPINLOCK_MSM=y -CONFIG_CLKSRC_OF=y -CONFIG_ARM_ARCH_TIMER=y -# CONFIG_MAILBOX is not set -CONFIG_IOMMU_SUPPORT=y -CONFIG_OF_IOMMU=y -CONFIG_MSM_IOMMU=y -CONFIG_MSM_IOMMU_V1=y -# CONFIG_MSM_IOMMU_PMON is not set -CONFIG_IOMMU_PGTABLES_L2=y -CONFIG_IOMMU_LPAE=y -# CONFIG_IOMMU_NON_SECURE is not set - -# -# Remoteproc drivers -# -# CONFIG_STE_MODEM_RPROC is not set - -# -# Rpmsg drivers -# -CONFIG_PM_DEVFREQ=y - -# -# DEVFREQ Governors -# -CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y -CONFIG_DEVFREQ_GOV_PERFORMANCE=y -CONFIG_DEVFREQ_GOV_POWERSAVE=y -CONFIG_DEVFREQ_GOV_USERSPACE=y -CONFIG_DEVFREQ_GOV_MSM_ADRENO_TZ=y -CONFIG_DEVFREQ_GOV_MSM_CPUFREQ=y -CONFIG_DEVFREQ_GOV_MSM_BW_HWMON=y -CONFIG_DEVFREQ_GOV_MSM_CACHE_HWMON=y - -# -# DEVFREQ Drivers -# -# CONFIG_EXTCON is not set -# CONFIG_MEMORY is not set -# CONFIG_IIO is not set -# CONFIG_VME_BUS is not set -CONFIG_PWM=y -CONFIG_PWM_QPNP=y -CONFIG_IRQCHIP=y -CONFIG_ARM_GIC=y -CONFIG_MSM_SHOW_RESUME_IRQ=y -CONFIG_MSM_IRQ=y -# CONFIG_IPACK_BUS is not set -# CONFIG_MOBICORE_SUPPORT is not set -# CONFIG_RESET_CONTROLLER is not set -# CONFIG_CORESIGHT is not set -# CONFIG_BIF is not set -# CONFIG_SENSORS is not set -CONFIG_SENSORS_SSC=y - -# -# PHY Subsystem -# -CONFIG_GENERIC_PHY=y -CONFIG_PHY_MSM_SATA=y -# CONFIG_MSM_BAM_DMUX is not set -CONFIG_MSM_IPC_ROUTER_SMD_XPRT=y -CONFIG_MSM_IPC_ROUTER_HSIC_XPRT=y -CONFIG_MSM_QMI_INTERFACE=y -CONFIG_MSM_SMEM=y -CONFIG_MSM_SMEM_LOGGING=y -CONFIG_MSM_QDSP6_APRV2=y -# CONFIG_MSM_QDSP6_APRV3 is not set -CONFIG_MSM_ADSP_LOADER=y -CONFIG_MSM_MEMORY_DUMP=y -# CONFIG_MSM_WATCHDOG_V2 is not set -CONFIG_MAXIMUM_CURRENT_THROTTLING=y -# CONFIG_MEM_SHARE_QMI_SERVICE is not set - -# -# File systems -# -CONFIG_DCACHE_WORD_ACCESS=y -CONFIG_EXT2_FS=y -CONFIG_EXT2_FS_XATTR=y -# CONFIG_EXT2_FS_POSIX_ACL is not set -# CONFIG_EXT2_FS_SECURITY is not set -# CONFIG_EXT2_FS_XIP is not set -CONFIG_EXT3_FS=y -# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set -CONFIG_EXT3_FS_XATTR=y -# CONFIG_EXT3_FS_POSIX_ACL is not set -# CONFIG_EXT3_FS_SECURITY is not set -CONFIG_EXT4_FS=y -# CONFIG_EXT4_FS_POSIX_ACL is not set -CONFIG_EXT4_FS_SECURITY=y -# CONFIG_EXT4_DEBUG is not set -CONFIG_JBD=y -# CONFIG_JBD_DEBUG is not set -CONFIG_JBD2=y -# CONFIG_JBD2_DEBUG is not set -CONFIG_FS_MBCACHE=y -# CONFIG_REISERFS_FS is not set -# CONFIG_JFS_FS is not set -# CONFIG_XFS_FS is not set -# CONFIG_GFS2_FS is not set -# CONFIG_OCFS2_FS is not set -# CONFIG_BTRFS_FS is not set -# CONFIG_NILFS2_FS is not set -CONFIG_FS_POSIX_ACL=y -CONFIG_FILE_LOCKING=y -CONFIG_FSNOTIFY=y -CONFIG_DNOTIFY=y -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 -CONFIG_GENERIC_ACL=y - -# -# 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=y -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=y -CONFIG_TMPFS_XATTR=y -# CONFIG_HUGETLB_PAGE is not set -CONFIG_CONFIGFS_FS=y -CONFIG_MISC_FILESYSTEMS=y -# CONFIG_ADFS_FS is not set -# CONFIG_AFFS_FS is not set -# CONFIG_ECRYPT_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_LOGFS is not set -# CONFIG_CRAMFS is not set -# 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_QNX6FS_FS is not set -# CONFIG_ROMFS_FS is not set -CONFIG_PSTORE=y -CONFIG_PSTORE_CONSOLE=y -CONFIG_PSTORE_RAM=y -CONFIG_PSTORE_RAM_ANNOTATION_APPEND=y -# CONFIG_SYSV_FS is not set -# CONFIG_UFS_FS is not set -CONFIG_F2FS_FS=y -CONFIG_F2FS_STAT_FS=y -CONFIG_F2FS_FS_XATTR=y -CONFIG_F2FS_FS_POSIX_ACL=y -CONFIG_NETWORK_FILESYSTEMS=y -# CONFIG_NFS_FS is not set -# CONFIG_NFSD is not set -# CONFIG_CEPH_FS is not set -# CONFIG_CIFS is not set -# CONFIG_NCP_FS is not set -# CONFIG_CODA_FS is not set -# CONFIG_AFS_FS is not set -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 is not set -# 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 is not set -# 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=y -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 is not set -# CONFIG_NLS_KOI8_R is not set -# CONFIG_NLS_KOI8_U is not set -# CONFIG_NLS_MAC_ROMAN is not set -# CONFIG_NLS_MAC_CELTIC is not set -# CONFIG_NLS_MAC_CENTEURO is not set -# CONFIG_NLS_MAC_CROATIAN is not set -# CONFIG_NLS_MAC_CYRILLIC is not set -# CONFIG_NLS_MAC_GAELIC is not set -# CONFIG_NLS_MAC_GREEK is not set -# CONFIG_NLS_MAC_ICELAND is not set -# CONFIG_NLS_MAC_INUIT is not set -# CONFIG_NLS_MAC_ROMANIAN is not set -# CONFIG_NLS_MAC_TURKISH is not set -# CONFIG_NLS_UTF8 is not set -# CONFIG_DLM is not set - -# -# 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_READABLE_ASM is not set -# CONFIG_UNUSED_SYMBOLS is not set -# CONFIG_PAGE_OWNER is not set -CONFIG_DEBUG_FS=y -# 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_PANIC_ON_OOPS is not set -CONFIG_PANIC_ON_OOPS_VALUE=0 -# CONFIG_DETECT_HUNG_TASK is not set -CONFIG_SCHED_DEBUG=y -# CONFIG_SYSRQ_SCHED_DEBUG is not set -CONFIG_SCHEDSTATS=y -CONFIG_TIMER_STATS=y -# CONFIG_DEBUG_OBJECTS is not set -# CONFIG_SLUB_DEBUG_ON is not set -# CONFIG_SLUB_STATS is not set -CONFIG_HAVE_DEBUG_KMEMLEAK=y -# CONFIG_DEBUG_KMEMLEAK is not set -CONFIG_DEBUG_PREEMPT=y -# 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_LOCK_STAT is not set -# CONFIG_DEBUG_ATOMIC_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=y -# CONFIG_DEBUG_INFO_REDUCED 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 - -# -# RCU Debugging -# -# CONFIG_PROVE_RCU_DELAY is not set -# CONFIG_SPARSE_RCU_POINTER is not set -# CONFIG_RCU_TORTURE_TEST is not set -CONFIG_RCU_CPU_STALL_TIMEOUT=21 -CONFIG_RCU_CPU_STALL_VERBOSE=y -# CONFIG_RCU_CPU_STALL_INFO is not set -# CONFIG_RCU_TRACE is not set -# 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_DEBUG_PER_CPU_MAPS is not set -# CONFIG_LKDTM is not set -# CONFIG_NOTIFIER_ERROR_INJECTION is not set -# CONFIG_FAULT_INJECTION is not set -# CONFIG_DEBUG_PAGEALLOC is not set -CONFIG_NOP_TRACER=y -CONFIG_HAVE_FUNCTION_TRACER=y -CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y -CONFIG_HAVE_DYNAMIC_FTRACE=y -CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y -CONFIG_HAVE_SYSCALL_TRACEPOINTS=y -CONFIG_HAVE_C_RECORDMCOUNT=y -CONFIG_TRACER_MAX_TRACE=y -CONFIG_TRACE_CLOCK=y -CONFIG_RING_BUFFER=y -CONFIG_EVENT_TRACING=y -CONFIG_CONTEXT_SWITCH_TRACER=y -# CONFIG_MSM_RTB is not set -CONFIG_IPC_LOGGING=y -CONFIG_TRACING=y -CONFIG_GENERIC_TRACER=y -CONFIG_TRACING_SUPPORT=y -CONFIG_FTRACE=y -# CONFIG_FUNCTION_TRACER is not set -# CONFIG_IRQSOFF_TRACER is not set -# CONFIG_PREEMPT_TRACER is not set -CONFIG_SCHED_TRACER=y -# CONFIG_FTRACE_SYSCALLS is not set -CONFIG_TRACER_SNAPSHOT=y -# CONFIG_TRACER_SNAPSHOT_PER_CPU_SWAP is not set -CONFIG_BRANCH_PROFILE_NONE=y -# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set -# CONFIG_PROFILE_ALL_BRANCHES is not set -# CONFIG_STACK_TRACER is not set -# CONFIG_BLK_DEV_IO_TRACE is not set -# CONFIG_PROBE_EVENTS is not set -CONFIG_CPU_FREQ_SWITCH_PROFILER=y -# CONFIG_FTRACE_STARTUP_TEST is not set -# CONFIG_RING_BUFFER_BENCHMARK is not set -# CONFIG_RING_BUFFER_STARTUP_TEST is not set -CONFIG_DYNAMIC_DEBUG=y -# CONFIG_DMA_API_DEBUG is not set -# CONFIG_ATOMIC64_SELFTEST is not set -# CONFIG_PANIC_ON_DATA_CORRUPTION is not set -# CONFIG_SAMPLES is not set -CONFIG_HAVE_ARCH_KGDB=y -CONFIG_KGDB=y -CONFIG_KGDB_SERIAL_CONSOLE=y -# CONFIG_KGDB_TESTS is not set -# CONFIG_KGDB_KDB is not set -# CONFIG_TEST_STRING_HELPERS is not set -# CONFIG_TEST_KSTRTOX is not set -# CONFIG_STRICT_DEVMEM is not set -CONFIG_ARM_UNWIND=y -CONFIG_DEBUG_USER=y -# CONFIG_FORCE_PAGES is not set -# CONFIG_FREE_PAGES_RDONLY is not set -# CONFIG_DEBUG_LL is not set -CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" -CONFIG_UNCOMPRESS_INCLUDE="mach/uncompress.h" -CONFIG_PID_IN_CONTEXTIDR=y - -# -# Security options -# -CONFIG_KEYS=y -# CONFIG_ENCRYPTED_KEYS is not set -# CONFIG_KEYS_DEBUG_PROC_KEYS is not set -# CONFIG_SECURITY_DMESG_RESTRICT is not set -CONFIG_SECURITY=y -# CONFIG_SECURITYFS is not set -CONFIG_SECURITY_NETWORK=y -# CONFIG_SECURITY_NETWORK_XFRM is not set -# CONFIG_SECURITY_PATH is not set -CONFIG_LSM_MMAP_MIN_ADDR=32768 -CONFIG_SECURITY_SELINUX=y -# CONFIG_SECURITY_SELINUX_BOOTPARAM is not set -# CONFIG_SECURITY_SELINUX_DISABLE is not set -CONFIG_SECURITY_SELINUX_DEVELOP=y -CONFIG_SECURITY_SELINUX_AVC_STATS=y -CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1 -# CONFIG_SECURITY_SELINUX_POLICYDB_VERSION_MAX is not set -# CONFIG_SECURITY_SMACK is not set -# CONFIG_SECURITY_TOMOYO is not set -# CONFIG_SECURITY_APPARMOR is not set -# CONFIG_SECURITY_YAMA is not set -# CONFIG_IMA is not set -# CONFIG_EVM is not set -CONFIG_DEFAULT_SECURITY_SELINUX=y -# CONFIG_DEFAULT_SECURITY_DAC is not set -CONFIG_DEFAULT_SECURITY="selinux" -CONFIG_CRYPTO=y - -# -# Crypto core or helper -# -CONFIG_CRYPTO_ALGAPI=y -CONFIG_CRYPTO_ALGAPI2=y -CONFIG_CRYPTO_AEAD=y -CONFIG_CRYPTO_AEAD2=y -CONFIG_CRYPTO_BLKCIPHER=y -CONFIG_CRYPTO_BLKCIPHER2=y -CONFIG_CRYPTO_HASH=y -CONFIG_CRYPTO_HASH2=y -CONFIG_CRYPTO_RNG=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_PCOMP2=y -CONFIG_CRYPTO_MANAGER=y -CONFIG_CRYPTO_MANAGER2=y -# CONFIG_CRYPTO_USER is not set -CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y -CONFIG_CRYPTO_GF128MUL=y -CONFIG_CRYPTO_NULL=y -# CONFIG_CRYPTO_PCRYPT is not set -CONFIG_CRYPTO_WORKQUEUE=y -# CONFIG_CRYPTO_CRYPTD is not set -CONFIG_CRYPTO_AUTHENC=y - -# -# 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=y - -# -# Hash modes -# -# CONFIG_CRYPTO_CMAC is not set -CONFIG_CRYPTO_HMAC=y -CONFIG_CRYPTO_XCBC=y -# CONFIG_CRYPTO_VMAC is not set - -# -# Digest -# -CONFIG_CRYPTO_CRC32C=y -# CONFIG_CRYPTO_CRC32 is not set -# CONFIG_CRYPTO_GHASH is not set -CONFIG_CRYPTO_MD4=y -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_SHA1_ARM is not set -CONFIG_CRYPTO_SHA256=y -# 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_AES_ARM is not set -# 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=y -# CONFIG_CRYPTO_ZLIB is not set -# CONFIG_CRYPTO_LZO is not set - -# -# Random Number Generation -# -CONFIG_CRYPTO_ANSI_CPRNG=y -# CONFIG_CRYPTO_USER_API_HASH is not set -# CONFIG_CRYPTO_USER_API_SKCIPHER is not set -CONFIG_CRYPTO_HW=y -# CONFIG_CRYPTO_DEV_HIFN_795X is not set -CONFIG_CRYPTO_DEV_QCE50=y -# CONFIG_FIPS_ENABLE is not set -CONFIG_CRYPTO_DEV_QCRYPTO=y -CONFIG_CRYPTO_DEV_QCE=y -CONFIG_CRYPTO_DEV_QCEDEV=y -# CONFIG_CRYPTO_DEV_OTA_CRYPTO is not set -# CONFIG_ASYMMETRIC_KEY_TYPE is not set -CONFIG_BINARY_PRINTF=y - -# -# Library routines -# -CONFIG_BITREVERSE=y -CONFIG_GENERIC_STRNCPY_FROM_USER=y -CONFIG_GENERIC_STRNLEN_USER=y -CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_GENERIC_IO=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_CRC32_SELFTEST is not set -CONFIG_CRC32_SLICEBY8=y -# CONFIG_CRC32_SLICEBY4 is not set -# CONFIG_CRC32_SARWATE is not set -# CONFIG_CRC32_BIT is not set -# CONFIG_CRC7 is not set -CONFIG_LIBCRC32C=y -# CONFIG_CRC8 is not set -CONFIG_AUDIT_GENERIC=y -CONFIG_ZLIB_INFLATE=y -CONFIG_ZLIB_DEFLATE=y -CONFIG_LZO_COMPRESS=y -CONFIG_LZO_DECOMPRESS=y -# CONFIG_XZ_DEC is not set -# CONFIG_XZ_DEC_BCJ is not set -CONFIG_DECOMPRESS_GZIP=y -CONFIG_DECOMPRESS_BZIP2=y -CONFIG_DECOMPRESS_LZMA=y -CONFIG_GENERIC_ALLOCATOR=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_CPU_RMAP=y -CONFIG_DQL=y -CONFIG_NLATTR=y -CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y -# CONFIG_AVERAGE is not set -# CONFIG_CORDIC is not set -# CONFIG_DDR is not set -CONFIG_QMI_ENCDEC=y -# CONFIG_QMI_ENCDEC_DEBUG is not set -# CONFIG_VIRTUALIZATION is not set diff --git a/README.md b/README.md index eacb72e..6933a28 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,54 @@ # kgdb-android -Kernel patches to get KGDB working on the Nexus 6. +Kernel patches to get KGDB working on the Nexus 6 and Nexus 5x. For background, please see associated blog post at http://www.contextis.com/resources/blog/kgdb-android-debugging-kernel-boss -0. Root your Nexus 6! -1. Download and build the stock Nexus 6 kernel (kernel/msm) using instructions from https://source.android.com/source/building.html -2. Download this directory structure into the root of your kernel source (kernel/msm/) including the .config file. -3. Re-build your kernel source. -4. Create your boot image, passing console arguments e.g. to update a stock image I used: ```abootimg -u boot.img -k zImage-dtb -c 'cmdline=console=ttyHSL0,115200,n8 kgdboc=ttyHSL0,115200 kgdbretry=4'``` -5. Boot your phone into the bootloader (adb reboot bootloader) and on your host run: +1. Root your Nexus +2. Clone the MSM kernel [from AOSP](https://android.googlesource.com/kernel/msm.git). Checkout to version that you need. + _Hint: stock kernels have a commit hash in their version string, like "3.10.73-gdc40906c97ae". Whole string after 'g' is a commit hash. So, you can checkout it with easy:_ + ``` + git checkout dc40906c97ae + ``` +3. Go to root of your kernel source (kernel/msm/) and apply the patches: + ``` + patch -bp 1 < "kgdboc.c-patch" + patch -bp 1 < "msm_serial_hs_lite.c-patch" + ``` +4. Configure the kernel to enable kernel-debug feature. + At this step you need to edit '...config' files. There are 2 ways to do. + a) build the kernel one time, and change kbuild-generated '.config' file at the root of kernel source. Build kernel again, to reuse this configuration. + b) change config file, that correspond to your device. For example "kernel/msm/arch/armv8/bullhead_defconfig", then just build kernel. [How to select device](https://source.android.com/setup/build/running#selecting-device-build) + - Lookup and remove (or set to ="n"): + ``` + CONFIG_MSM_WATCHDOG_V2 + CONFIG_STRICT_MEMORY_RWX + CONFIG_MSM_WATCHDOG_CTX_PRINT + ```` + - Lookup and set to ="y" (or add if not exist): + ``` + CONFIG_CONSOLE_POLL + CONFIG_KGDB_SERIAL_CONSOLE + CONFIG_KGDB + ``` +5. Deprecated compiler. + You may fail with a freshly installed package of the old compiler, for example GCC4.9, which was going to your kernel. Check toolchain gcc content. If there is python wrapper, turn off deprecation-info printing, kbuild does not understand it's output. + +6. Create your boot image, passing console arguments e.g. to update a stock image I used: + ```abootimg -u boot.img -k zImage-dtb -c 'cmdline=console=ttyHSL0,115200,n8 kgdboc=ttyHSL0,115200 kgdbretry=4'``` +7. Boot your phone into the bootloader (adb reboot bootloader) and on your host run: ```fastboot oem config console enable``` -6. Reboot into bootloader again -7. Plug in your debug cable (see blog) -8. Boot your image e.g. ```fastboot boot boot.img``` -9. Open a shell (adb shell), su to root, then type: - - - ```echo -n g > /proc/sysrq-trigger``` - - -10. Hit enter -11. On your host machine fire up GDB (you'll need a working version of GDB cross-compiled for ARM): +8. Reboot into bootloader again +9. Plug in your debug cable (see blog) +10. Boot your image e.g. ```fastboot boot boot.img``` +11. Open a shell (adb shell), su to root, then type: + ``` + echo -n g > /proc/sysrq-trigger + ``` +12. Hit enter +13. On your host machine fire up GDB (you'll need a working version of GDB cross-compiled for ARM): ``` arm-eabi-gdb ./vmlinux diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c deleted file mode 100644 index 3cc7dcb..0000000 --- a/drivers/tty/serial/kgdboc.c +++ /dev/null @@ -1,372 +0,0 @@ -/* - * Based on the same principle as kgdboe using the NETPOLL api, this - * driver uses a console polling api to implement a gdb serial inteface - * which is multiplexed on a console port. - * - * Maintainer: Jason Wessel - * - * 2007-2008 (c) Jason Wessel - Wind River Systems, Inc. - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without any - * warranty of any kind, whether express or implied. - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define MAX_CONFIG_LEN 40 - -static struct kgdb_io kgdboc_io_ops; - -/* -1 = init not run yet, 0 = unconfigured, 1 = configured. */ -static int configured = -1; - -static char config[MAX_CONFIG_LEN]; -static int config_retry_time = 0; -static struct kparam_string kps = { - .string = config, - .maxlen = MAX_CONFIG_LEN, -}; - -static int kgdboc_use_kms; /* 1 if we use kernel mode switching */ -static struct tty_driver *kgdb_tty_driver; -static int kgdb_tty_line; - -#ifdef CONFIG_KDB_KEYBOARD -static int kgdboc_reset_connect(struct input_handler *handler, - struct input_dev *dev, - const struct input_device_id *id) -{ - input_reset_device(dev); - - /* Retrun an error - we do not want to bind, just to reset */ - return -ENODEV; -} - -static void kgdboc_reset_disconnect(struct input_handle *handle) -{ - /* We do not expect anyone to actually bind to us */ - BUG(); -} - -static const struct input_device_id kgdboc_reset_ids[] = { - { - .flags = INPUT_DEVICE_ID_MATCH_EVBIT, - .evbit = { BIT_MASK(EV_KEY) }, - }, - { } -}; - -static struct input_handler kgdboc_reset_handler = { - .connect = kgdboc_reset_connect, - .disconnect = kgdboc_reset_disconnect, - .name = "kgdboc_reset", - .id_table = kgdboc_reset_ids, -}; - -static DEFINE_MUTEX(kgdboc_reset_mutex); - -static void kgdboc_restore_input_helper(struct work_struct *dummy) -{ - /* - * We need to take a mutex to prevent several instances of - * this work running on different CPUs so they don't try - * to register again already registered handler. - */ - mutex_lock(&kgdboc_reset_mutex); - - if (input_register_handler(&kgdboc_reset_handler) == 0) - input_unregister_handler(&kgdboc_reset_handler); - - mutex_unlock(&kgdboc_reset_mutex); -} - -static DECLARE_WORK(kgdboc_restore_input_work, kgdboc_restore_input_helper); - -static void kgdboc_restore_input(void) -{ - if (likely(system_state == SYSTEM_RUNNING)) - schedule_work(&kgdboc_restore_input_work); -} - -static int kgdboc_register_kbd(char **cptr) -{ - if (strncmp(*cptr, "kbd", 3) == 0 || - strncmp(*cptr, "kdb", 3) == 0) { - if (kdb_poll_idx < KDB_POLL_FUNC_MAX) { - kdb_poll_funcs[kdb_poll_idx] = kdb_get_kbd_char; - kdb_poll_idx++; - if (cptr[0][3] == ',') - *cptr += 4; - else - return 1; - } - } - return 0; -} - -static void kgdboc_unregister_kbd(void) -{ - int i; - - for (i = 0; i < kdb_poll_idx; i++) { - if (kdb_poll_funcs[i] == kdb_get_kbd_char) { - kdb_poll_idx--; - kdb_poll_funcs[i] = kdb_poll_funcs[kdb_poll_idx]; - kdb_poll_funcs[kdb_poll_idx] = NULL; - i--; - } - } - flush_work(&kgdboc_restore_input_work); -} -#else /* ! CONFIG_KDB_KEYBOARD */ -#define kgdboc_register_kbd(x) 0 -#define kgdboc_unregister_kbd() -#define kgdboc_restore_input() -#endif /* ! CONFIG_KDB_KEYBOARD */ - -static int kgdboc_option_setup(char *opt) -{ - if (strlen(opt) >= MAX_CONFIG_LEN) { - printk(KERN_ERR "kgdboc: config string too long\n"); - return -ENOSPC; - } - strcpy(config, opt); - - return 0; -} - -__setup("kgdboc=", kgdboc_option_setup); - -static void cleanup_kgdboc(void) -{ - if (kgdb_unregister_nmi_console()) - return; - kgdboc_unregister_kbd(); - if (configured == 1) - kgdb_unregister_io_module(&kgdboc_io_ops); -} - -static int kgdbretry_option_setup(char *opt) -{ - if (strlen(opt) > MAX_CONFIG_LEN) { - printk(KERN_ERR "kgdbretry: config string too long\n"); - return -ENOSPC; - } - config_retry_time = simple_strtoul(opt, NULL, 10); - - return 0; -} - -__setup("kgdbretry=", kgdbretry_option_setup); - -static int configure_kgdboc(void); -static void ttycheck_func(struct work_struct *work) -{ - config_retry_time = 0; - configure_kgdboc(); -} - -static DECLARE_DELAYED_WORK(ttycheck_work, ttycheck_func); - -static int configure_kgdboc(void) -{ - struct tty_driver *p; - int tty_line = 0; - int err; - char *cptr = config; - struct console *cons; - - err = kgdboc_option_setup(config); - if (err || !strlen(config) || isspace(config[0])) - goto noconfig; - - err = -ENODEV; - kgdboc_io_ops.is_console = 0; - kgdb_tty_driver = NULL; - - kgdboc_use_kms = 0; - if (strncmp(cptr, "kms,", 4) == 0) { - cptr += 4; - kgdboc_use_kms = 1; - } - - if (kgdboc_register_kbd(&cptr)) - goto do_register; - - p = tty_find_polling_driver(cptr, &tty_line); - if (!p) { - printk(KERN_INFO "kgdb will retry in %d secs\n", config_retry_time); - if (config_retry_time > 0) { - INIT_DELAYED_WORK(&ttycheck_work, ttycheck_func); - schedule_delayed_work(&ttycheck_work, config_retry_time * HZ); - return -ENODEV; - } - goto noconfig; - } - - cons = console_drivers; - while (cons) { - int idx; - if (cons->device && cons->device(cons, &idx) == p && - idx == tty_line) { - kgdboc_io_ops.is_console = 1; - break; - } - cons = cons->next; - } - - kgdb_tty_driver = p; - kgdb_tty_line = tty_line; - -do_register: - err = kgdb_register_io_module(&kgdboc_io_ops); - if (err) - goto noconfig; - - err = kgdb_register_nmi_console(); - - if (err) - goto nmi_con_failed; - - configured = 1; - - return 0; - -nmi_con_failed: - kgdb_unregister_io_module(&kgdboc_io_ops); -noconfig: - printk(KERN_ERR "kgdb failed to initialise\n"); - kgdboc_unregister_kbd(); - config[0] = 0; - configured = 0; - cleanup_kgdboc(); - - return err; -} - -static int __init init_kgdboc(void) -{ - /* Already configured? */ - if (configured == 1) - return 0; - - return configure_kgdboc(); -} - -static int kgdboc_get_char(void) -{ - if (!kgdb_tty_driver) - return -1; - return kgdb_tty_driver->ops->poll_get_char(kgdb_tty_driver, - kgdb_tty_line); -} - -static void kgdboc_put_char(u8 chr) -{ - if (!kgdb_tty_driver) - return; - kgdb_tty_driver->ops->poll_put_char(kgdb_tty_driver, - kgdb_tty_line, chr); -} - -static int param_set_kgdboc_var(const char *kmessage, struct kernel_param *kp) -{ - int len = strlen(kmessage); - - if (len >= MAX_CONFIG_LEN) { - printk(KERN_ERR "kgdboc: config string too long\n"); - return -ENOSPC; - } - - /* Only copy in the string if the init function has not run yet */ - if (configured < 0) { - strcpy(config, kmessage); - return 0; - } - - if (kgdb_connected) { - printk(KERN_ERR - "kgdboc: Cannot reconfigure while KGDB is connected.\n"); - - return -EBUSY; - } - - strcpy(config, kmessage); - /* Chop out \n char as a result of echo */ - if (config[len - 1] == '\n') - config[len - 1] = '\0'; - - if (configured == 1) - cleanup_kgdboc(); - - /* Go and configure with the new params. */ - return configure_kgdboc(); -} - -static int dbg_restore_graphics; - -static void kgdboc_pre_exp_handler(void) -{ - if (!dbg_restore_graphics && kgdboc_use_kms) { - dbg_restore_graphics = 1; - con_debug_enter(vc_cons[fg_console].d); - } - /* Increment the module count when the debugger is active */ - if (!kgdb_connected) - try_module_get(THIS_MODULE); -} - -static void kgdboc_post_exp_handler(void) -{ - /* decrement the module count when the debugger detaches */ - if (!kgdb_connected) - module_put(THIS_MODULE); - if (kgdboc_use_kms && dbg_restore_graphics) { - dbg_restore_graphics = 0; - con_debug_leave(); - } - kgdboc_restore_input(); -} - -static struct kgdb_io kgdboc_io_ops = { - .name = "kgdboc", - .read_char = kgdboc_get_char, - .write_char = kgdboc_put_char, - .pre_exception = kgdboc_pre_exp_handler, - .post_exception = kgdboc_post_exp_handler, -}; - -#ifdef CONFIG_KGDB_SERIAL_CONSOLE -/* This is only available if kgdboc is a built in for early debugging */ -static int __init kgdboc_early_init(char *opt) -{ - /* save the first character of the config string because the - * init routine can destroy it. - */ - char save_ch; - - kgdboc_option_setup(opt); - save_ch = config[0]; - init_kgdboc(); - config[0] = save_ch; - return 0; -} - -early_param("ekgdboc", kgdboc_early_init); -#endif /* CONFIG_KGDB_SERIAL_CONSOLE */ - -module_init(init_kgdboc); -module_exit(cleanup_kgdboc); -module_param_call(kgdboc, param_set_kgdboc_var, param_get_string, &kps, 0644); -MODULE_PARM_DESC(kgdboc, "[,baud]"); -MODULE_PARM_DESC(kgdbretry, " before retrying tty"); -MODULE_DESCRIPTION("KGDB Console TTY Driver"); -MODULE_LICENSE("GPL"); diff --git a/drivers/tty/serial/msm_serial_hs_lite.c b/drivers/tty/serial/msm_serial_hs_lite.c deleted file mode 100644 index 79f4f85..0000000 --- a/drivers/tty/serial/msm_serial_hs_lite.c +++ /dev/null @@ -1,2147 +0,0 @@ -/* - * drivers/serial/msm_serial.c - driver for msm7k serial device and console - * - * Copyright (C) 2007 Google, Inc. - * Copyright (c) 2010-2014, The Linux Foundation. All rights reserved. - * - * 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. - */ - -/* Acknowledgements: - * This file is based on msm_serial.c, originally - * Written by Robert Love */ - -#define pr_fmt(fmt) "%s: " fmt, __func__ - -#if defined(CONFIG_SERIAL_MSM_HSL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) -#define SUPPORT_SYSRQ -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "msm_serial_hs_hwreg.h" - -/* - * There are 3 different kind of UART Core available on MSM. - * High Speed UART (i.e. Legacy HSUART), GSBI based HSUART - * and BSLP based HSUART. - */ -enum uart_core_type { - LEGACY_HSUART, - GSBI_HSUART, - BLSP_HSUART, -}; - -/* - * UART can be used in 2-wire or 4-wire mode. - * Use uart_func_mode to set 2-wire or 4-wire mode. - */ -enum uart_func_mode { - UART_TWO_WIRE, /* can't support HW Flow control. */ - UART_FOUR_WIRE,/* can support HW Flow control. */ -}; - -struct msm_hsl_port { - struct uart_port uart; - char name[16]; - struct clk *clk; - struct clk *pclk; - struct dentry *loopback_dir; - unsigned int imr; - unsigned int *uart_csr_code; - unsigned int *gsbi_mapbase; - unsigned int *mapped_gsbi; - unsigned int old_snap_state; - unsigned int ver_id; - int tx_timeout; - struct mutex clk_mutex; - enum uart_core_type uart_type; - enum uart_func_mode func_mode; - struct wake_lock port_open_wake_lock; - int clk_enable_count; - u32 bus_perf_client; - /* BLSP UART required BUS Scaling data */ - struct msm_bus_scale_pdata *bus_scale_table; -}; - -#define UARTDM_VERSION_11_13 0 -#define UARTDM_VERSION_14 1 - -#define UART_TO_MSM(uart_port) ((struct msm_hsl_port *) uart_port) -#define is_console(port) ((port)->cons && \ - (port)->cons->index == (port)->line) - -static const unsigned int regmap[][UARTDM_LAST] = { - [UARTDM_VERSION_11_13] = { - [UARTDM_MR1] = UARTDM_MR1_ADDR, - [UARTDM_MR2] = UARTDM_MR2_ADDR, - [UARTDM_IMR] = UARTDM_IMR_ADDR, - [UARTDM_SR] = UARTDM_SR_ADDR, - [UARTDM_CR] = UARTDM_CR_ADDR, - [UARTDM_CSR] = UARTDM_CSR_ADDR, - [UARTDM_IPR] = UARTDM_IPR_ADDR, - [UARTDM_ISR] = UARTDM_ISR_ADDR, - [UARTDM_RX_TOTAL_SNAP] = UARTDM_RX_TOTAL_SNAP_ADDR, - [UARTDM_TFWR] = UARTDM_TFWR_ADDR, - [UARTDM_RFWR] = UARTDM_RFWR_ADDR, - [UARTDM_RF] = UARTDM_RF_ADDR, - [UARTDM_TF] = UARTDM_TF_ADDR, - [UARTDM_MISR] = UARTDM_MISR_ADDR, - [UARTDM_DMRX] = UARTDM_DMRX_ADDR, - [UARTDM_NCF_TX] = UARTDM_NCF_TX_ADDR, - [UARTDM_DMEN] = UARTDM_DMEN_ADDR, - [UARTDM_TXFS] = UARTDM_TXFS_ADDR, - [UARTDM_RXFS] = UARTDM_RXFS_ADDR, - }, - [UARTDM_VERSION_14] = { - [UARTDM_MR1] = 0x0, - [UARTDM_MR2] = 0x4, - [UARTDM_IMR] = 0xb0, - [UARTDM_SR] = 0xa4, - [UARTDM_CR] = 0xa8, - [UARTDM_CSR] = 0xa0, - [UARTDM_IPR] = 0x18, - [UARTDM_ISR] = 0xb4, - [UARTDM_RX_TOTAL_SNAP] = 0xbc, - [UARTDM_TFWR] = 0x1c, - [UARTDM_RFWR] = 0x20, - [UARTDM_RF] = 0x140, - [UARTDM_TF] = 0x100, - [UARTDM_MISR] = 0xac, - [UARTDM_DMRX] = 0x34, - [UARTDM_NCF_TX] = 0x40, - [UARTDM_DMEN] = 0x3c, - [UARTDM_TXFS] = 0x4c, - [UARTDM_RXFS] = 0x50, - }, -}; - -static struct of_device_id msm_hsl_match_table[] = { - { .compatible = "qcom,msm-lsuart-v14", - .data = (void *)UARTDM_VERSION_14 - }, - {} -}; - -#ifdef CONFIG_SERIAL_MSM_HSL_CONSOLE -static int get_console_state(struct uart_port *port); -#else -static inline int get_console_state(struct uart_port *port) { return -ENODEV; }; -#endif - -static struct dentry *debug_base; -static inline void wait_for_xmitr(struct uart_port *port); -static inline void msm_hsl_write(struct uart_port *port, - unsigned int val, unsigned int off) -{ - __iowmb(); - __raw_writel_no_log((__force __u32)cpu_to_le32(val), - port->membase + off); -} -static inline unsigned int msm_hsl_read(struct uart_port *port, - unsigned int off) -{ - unsigned int v = le32_to_cpu((__force __le32)__raw_readl_no_log( - port->membase + off)); - __iormb(); - return v; -} - -static unsigned int msm_serial_hsl_has_gsbi(struct uart_port *port) -{ - return (UART_TO_MSM(port)->uart_type == GSBI_HSUART); -} - -/** - * set_gsbi_uart_func_mode: Check the currently used GSBI UART mode - * and set the new required GSBI UART Mode if it is different. - * @port: uart port - */ -static void set_gsbi_uart_func_mode(struct uart_port *port) -{ - struct msm_hsl_port *msm_hsl_port = UART_TO_MSM(port); - unsigned int set_gsbi_uart_mode = GSBI_PROTOCOL_I2C_UART; - unsigned int cur_gsbi_uart_mode; - - if (msm_hsl_port->func_mode == UART_FOUR_WIRE) - set_gsbi_uart_mode = GSBI_PROTOCOL_UART; - - if (msm_hsl_port->pclk) - clk_prepare_enable(msm_hsl_port->pclk); - - /* Read current used GSBI UART Mode and set only if it is different. */ - cur_gsbi_uart_mode = ioread32(msm_hsl_port->mapped_gsbi + - GSBI_CONTROL_ADDR); - if ((cur_gsbi_uart_mode & set_gsbi_uart_mode) != set_gsbi_uart_mode) - /* - * Programmed GSBI based UART protocol mode i.e. I2C/UART - * Shared Mode or UART Mode. - */ - iowrite32(set_gsbi_uart_mode, - msm_hsl_port->mapped_gsbi + GSBI_CONTROL_ADDR); - - if (msm_hsl_port->pclk) - clk_disable_unprepare(msm_hsl_port->pclk); -} - -/** - * msm_hsl_config_uart_tx_rx_gpios - Configures UART Tx and RX GPIOs - * @port: uart port - */ -static int msm_hsl_config_uart_tx_rx_gpios(struct uart_port *port) -{ - struct platform_device *pdev = to_platform_device(port->dev); - const struct msm_serial_hslite_platform_data *pdata = - pdev->dev.platform_data; - int ret; - - if (pdata) { - ret = gpio_request(pdata->uart_tx_gpio, - "UART_TX_GPIO"); - if (unlikely(ret)) { - pr_err("gpio request failed for:%d\n", - pdata->uart_tx_gpio); - goto exit_uart_config; - } - - ret = gpio_request(pdata->uart_rx_gpio, "UART_RX_GPIO"); - if (unlikely(ret)) { - pr_err("gpio request failed for:%d\n", - pdata->uart_rx_gpio); - gpio_free(pdata->uart_tx_gpio); - goto exit_uart_config; - } - } else { - pr_err("Pdata is NULL.\n"); - ret = -EINVAL; - } - -exit_uart_config: - return ret; -} - -/** - * msm_hsl_unconfig_uart_tx_rx_gpios: Unconfigures UART Tx and RX GPIOs - * @port: uart port - */ -static void msm_hsl_unconfig_uart_tx_rx_gpios(struct uart_port *port) -{ - struct platform_device *pdev = to_platform_device(port->dev); - const struct msm_serial_hslite_platform_data *pdata = - pdev->dev.platform_data; - - if (pdata) { - gpio_free(pdata->uart_tx_gpio); - gpio_free(pdata->uart_rx_gpio); - } else { - pr_err("Error:Pdata is NULL.\n"); - } -} - -/** - * msm_hsl_config_uart_hwflow_gpios: Configures UART HWFlow GPIOs - * @port: uart port - */ -static int msm_hsl_config_uart_hwflow_gpios(struct uart_port *port) -{ - struct platform_device *pdev = to_platform_device(port->dev); - const struct msm_serial_hslite_platform_data *pdata = - pdev->dev.platform_data; - int ret = -EINVAL; - - if (pdata) { - ret = gpio_request(pdata->uart_cts_gpio, - "UART_CTS_GPIO"); - if (unlikely(ret)) { - pr_err("gpio request failed for:%d\n", - pdata->uart_cts_gpio); - goto exit_config_uart; - } - - ret = gpio_request(pdata->uart_rfr_gpio, - "UART_RFR_GPIO"); - if (unlikely(ret)) { - pr_err("gpio request failed for:%d\n", - pdata->uart_rfr_gpio); - gpio_free(pdata->uart_cts_gpio); - goto exit_config_uart; - } - } else { - pr_err("Error: Pdata is NULL.\n"); - } - -exit_config_uart: - return ret; -} - -/** - * msm_hsl_unconfig_uart_hwflow_gpios: Unonfigures UART HWFlow GPIOs - * @port: uart port - */ -static void msm_hsl_unconfig_uart_hwflow_gpios(struct uart_port *port) -{ - struct platform_device *pdev = to_platform_device(port->dev); - const struct msm_serial_hslite_platform_data *pdata = - pdev->dev.platform_data; - - if (pdata) { - gpio_free(pdata->uart_cts_gpio); - gpio_free(pdata->uart_rfr_gpio); - } else { - pr_err("Error: Pdata is NULL.\n"); - } - -} - -/** - * msm_hsl_config_uart_gpios: Configures UART GPIOs and returns success or - * Failure - * @port: uart port - */ -static int msm_hsl_config_uart_gpios(struct uart_port *port) -{ - struct msm_hsl_port *msm_hsl_port = UART_TO_MSM(port); - int ret; - - /* Configure UART Tx and Rx GPIOs */ - ret = msm_hsl_config_uart_tx_rx_gpios(port); - if (!ret) { - if (msm_hsl_port->func_mode == UART_FOUR_WIRE) { - /*if 4-wire uart, configure CTS and RFR GPIOs */ - ret = msm_hsl_config_uart_hwflow_gpios(port); - if (ret) - msm_hsl_unconfig_uart_tx_rx_gpios(port); - } - } else { - msm_hsl_unconfig_uart_tx_rx_gpios(port); - } - - return ret; -} - -/** - * msm_hsl_unconfig_uart_gpios: Unconfigures UART GPIOs - * @port: uart port - */ -static void msm_hsl_unconfig_uart_gpios(struct uart_port *port) -{ - struct msm_hsl_port *msm_hsl_port = UART_TO_MSM(port); - - msm_hsl_unconfig_uart_tx_rx_gpios(port); - if (msm_hsl_port->func_mode == UART_FOUR_WIRE) - msm_hsl_unconfig_uart_hwflow_gpios(port); -} -static int get_line(struct platform_device *pdev) -{ - struct msm_hsl_port *msm_hsl_port = platform_get_drvdata(pdev); - return msm_hsl_port->uart.line; -} - -static int bus_vote(uint32_t client, int vector) -{ - int ret = 0; - - if (!client) - return ret; - - pr_debug("Voting for bus scaling:%d\n", vector); - - ret = msm_bus_scale_client_update_request(client, vector); - if (ret) - pr_err("Failed to request bus bw vector %d\n", vector); - - return ret; -} - -static int clk_en(struct uart_port *port, int enable) -{ - struct msm_hsl_port *msm_hsl_port = UART_TO_MSM(port); - int ret = 0; - - if (enable) { - - msm_hsl_port->clk_enable_count++; - ret = bus_vote(msm_hsl_port->bus_perf_client, - !!msm_hsl_port->clk_enable_count); - if (ret) - goto err; - ret = clk_prepare_enable(msm_hsl_port->clk); - if (ret) - goto err_bus; - if (msm_hsl_port->pclk) { - ret = clk_prepare_enable(msm_hsl_port->pclk); - if (ret) - goto err_clk_disable; - } - } else { - - msm_hsl_port->clk_enable_count--; - clk_disable_unprepare(msm_hsl_port->clk); - if (msm_hsl_port->pclk) - clk_disable_unprepare(msm_hsl_port->pclk); - ret = bus_vote(msm_hsl_port->bus_perf_client, - !!msm_hsl_port->clk_enable_count); - } - - return ret; - -err_clk_disable: - clk_disable_unprepare(msm_hsl_port->clk); -err_bus: - bus_vote(msm_hsl_port->bus_perf_client, - !!(msm_hsl_port->clk_enable_count - 1)); -err: - msm_hsl_port->clk_enable_count--; - return ret; -} -static int msm_hsl_loopback_enable_set(void *data, u64 val) -{ - struct msm_hsl_port *msm_hsl_port = data; - struct uart_port *port = &(msm_hsl_port->uart); - unsigned int vid; - unsigned long flags; - int ret = 0; - - ret = clk_set_rate(msm_hsl_port->clk, port->uartclk); - if (!ret) { - clk_en(port, 1); - } else { - pr_err("Error: setting uartclk rate as %u\n", - port->uartclk); - return -EINVAL; - } - - vid = msm_hsl_port->ver_id; - if (val) { - spin_lock_irqsave(&port->lock, flags); - ret = msm_hsl_read(port, regmap[vid][UARTDM_MR2]); - ret |= UARTDM_MR2_LOOP_MODE_BMSK; - msm_hsl_write(port, ret, regmap[vid][UARTDM_MR2]); - spin_unlock_irqrestore(&port->lock, flags); - } else { - spin_lock_irqsave(&port->lock, flags); - ret = msm_hsl_read(port, regmap[vid][UARTDM_MR2]); - ret &= ~UARTDM_MR2_LOOP_MODE_BMSK; - msm_hsl_write(port, ret, regmap[vid][UARTDM_MR2]); - spin_unlock_irqrestore(&port->lock, flags); - } - - clk_en(port, 0); - return 0; -} -static int msm_hsl_loopback_enable_get(void *data, u64 *val) -{ - struct msm_hsl_port *msm_hsl_port = data; - struct uart_port *port = &(msm_hsl_port->uart); - unsigned long flags; - int ret = 0; - - ret = clk_set_rate(msm_hsl_port->clk, port->uartclk); - if (!ret) { - clk_en(port, 1); - } else { - pr_err("Error setting uartclk rate as %u\n", - port->uartclk); - return -EINVAL; - } - - spin_lock_irqsave(&port->lock, flags); - ret = msm_hsl_read(port, regmap[msm_hsl_port->ver_id][UARTDM_MR2]); - spin_unlock_irqrestore(&port->lock, flags); - clk_en(port, 0); - - *val = (ret & UARTDM_MR2_LOOP_MODE_BMSK) ? 1 : 0; - return 0; -} -DEFINE_SIMPLE_ATTRIBUTE(loopback_enable_fops, msm_hsl_loopback_enable_get, - msm_hsl_loopback_enable_set, "%llu\n"); -/* - * msm_serial_hsl debugfs node: /msm_serial_hsl/loopback. - * writing 1 turns on internal loopback mode in HW. Useful for automation - * test scripts. - * writing 0 disables the internal loopback mode. Default is disabled. - */ -static void msm_hsl_debugfs_init(struct msm_hsl_port *msm_uport, - int id) -{ - char node_name[15]; - - snprintf(node_name, sizeof(node_name), "loopback.%d", id); - msm_uport->loopback_dir = debugfs_create_file(node_name, - S_IRUGO | S_IWUSR, - debug_base, - msm_uport, - &loopback_enable_fops); - - if (IS_ERR_OR_NULL(msm_uport->loopback_dir)) - pr_err("Cannot create loopback.%d debug entry", id); -} -static void msm_hsl_stop_tx(struct uart_port *port) -{ - struct msm_hsl_port *msm_hsl_port = UART_TO_MSM(port); - - msm_hsl_port->imr &= ~UARTDM_ISR_TXLEV_BMSK; - msm_hsl_write(port, msm_hsl_port->imr, - regmap[msm_hsl_port->ver_id][UARTDM_IMR]); -} - -static void msm_hsl_start_tx(struct uart_port *port) -{ - struct msm_hsl_port *msm_hsl_port = UART_TO_MSM(port); - - if (port->suspended) { - pr_err("%s: System is in Suspend state\n", __func__); - return; - } - msm_hsl_port->imr |= UARTDM_ISR_TXLEV_BMSK; - msm_hsl_write(port, msm_hsl_port->imr, - regmap[msm_hsl_port->ver_id][UARTDM_IMR]); -} - -static void msm_hsl_stop_rx(struct uart_port *port) -{ - struct msm_hsl_port *msm_hsl_port = UART_TO_MSM(port); - - msm_hsl_port->imr &= ~(UARTDM_ISR_RXLEV_BMSK | - UARTDM_ISR_RXSTALE_BMSK); - msm_hsl_write(port, msm_hsl_port->imr, - regmap[msm_hsl_port->ver_id][UARTDM_IMR]); -} - -static void msm_hsl_enable_ms(struct uart_port *port) -{ - struct msm_hsl_port *msm_hsl_port = UART_TO_MSM(port); - - msm_hsl_port->imr |= UARTDM_ISR_DELTA_CTS_BMSK; - msm_hsl_write(port, msm_hsl_port->imr, - regmap[msm_hsl_port->ver_id][UARTDM_IMR]); -} - -static void handle_rx(struct uart_port *port, unsigned int misr) -{ - struct tty_struct *tty = port->state->port.tty; - unsigned int vid; - unsigned int sr; - int count = 0; - struct msm_hsl_port *msm_hsl_port = UART_TO_MSM(port); - - vid = msm_hsl_port->ver_id; - /* - * Handle overrun. My understanding of the hardware is that overrun - * is not tied to the RX buffer, so we handle the case out of band. - */ - if ((msm_hsl_read(port, regmap[vid][UARTDM_SR]) & - UARTDM_SR_OVERRUN_BMSK)) { - port->icount.overrun++; - tty_insert_flip_char(tty->port, 0, TTY_OVERRUN); - msm_hsl_write(port, RESET_ERROR_STATUS, - regmap[vid][UARTDM_CR]); - } - - if (misr & UARTDM_ISR_RXSTALE_BMSK) { - count = msm_hsl_read(port, - regmap[vid][UARTDM_RX_TOTAL_SNAP]) - - msm_hsl_port->old_snap_state; - msm_hsl_port->old_snap_state = 0; - } else { - count = 4 * (msm_hsl_read(port, regmap[vid][UARTDM_RFWR])); - msm_hsl_port->old_snap_state += count; - } - - /* and now the main RX loop */ - while (count > 0) { - unsigned int c; - char flag = TTY_NORMAL; - - sr = msm_hsl_read(port, regmap[vid][UARTDM_SR]); - if ((sr & UARTDM_SR_RXRDY_BMSK) == 0) { - msm_hsl_port->old_snap_state -= count; - break; - } - c = msm_hsl_read(port, regmap[vid][UARTDM_RF]); - if (sr & UARTDM_SR_RX_BREAK_BMSK) { - port->icount.brk++; - if (uart_handle_break(port)) - continue; - } else if (sr & UARTDM_SR_PAR_FRAME_BMSK) { - port->icount.frame++; - } else { - port->icount.rx++; - } - - /* Mask conditions we're ignorning. */ - sr &= port->read_status_mask; - if (sr & UARTDM_SR_RX_BREAK_BMSK) - flag = TTY_BREAK; - else if (sr & UARTDM_SR_PAR_FRAME_BMSK) - flag = TTY_FRAME; - - /* TODO: handle sysrq */ - /* if (!uart_handle_sysrq_char(port, c)) */ - tty_insert_flip_string(tty->port, (char *) &c, - (count > 4) ? 4 : count); - count -= 4; - } - - tty_flip_buffer_push(tty->port); -} - -static void handle_tx(struct uart_port *port) -{ - struct circ_buf *xmit = &port->state->xmit; - int sent_tx; - int tx_count; - int x; - unsigned int tf_pointer = 0; - unsigned int vid; - - vid = UART_TO_MSM(port)->ver_id; - tx_count = uart_circ_chars_pending(xmit); - - if (tx_count > (UART_XMIT_SIZE - xmit->tail)) - tx_count = UART_XMIT_SIZE - xmit->tail; - if (tx_count >= port->fifosize) - tx_count = port->fifosize; - - /* Handle x_char */ - if (port->x_char) { - wait_for_xmitr(port); - msm_hsl_write(port, tx_count + 1, regmap[vid][UARTDM_NCF_TX]); - msm_hsl_read(port, regmap[vid][UARTDM_NCF_TX]); - msm_hsl_write(port, port->x_char, regmap[vid][UARTDM_TF]); - port->icount.tx++; - port->x_char = 0; - } else if (tx_count) { - wait_for_xmitr(port); - msm_hsl_write(port, tx_count, regmap[vid][UARTDM_NCF_TX]); - msm_hsl_read(port, regmap[vid][UARTDM_NCF_TX]); - } - if (!tx_count) { - msm_hsl_stop_tx(port); - return; - } - - while (tf_pointer < tx_count) { - if (unlikely(!(msm_hsl_read(port, regmap[vid][UARTDM_SR]) & - UARTDM_SR_TXRDY_BMSK))) - continue; - switch (tx_count - tf_pointer) { - case 1: { - x = xmit->buf[xmit->tail]; - port->icount.tx++; - break; - } - case 2: { - x = xmit->buf[xmit->tail] - | xmit->buf[xmit->tail+1] << 8; - port->icount.tx += 2; - break; - } - case 3: { - x = xmit->buf[xmit->tail] - | xmit->buf[xmit->tail+1] << 8 - | xmit->buf[xmit->tail + 2] << 16; - port->icount.tx += 3; - break; - } - default: { - x = *((int *)&(xmit->buf[xmit->tail])); - port->icount.tx += 4; - break; - } - } - msm_hsl_write(port, x, regmap[vid][UARTDM_TF]); - xmit->tail = ((tx_count - tf_pointer < 4) ? - (tx_count - tf_pointer + xmit->tail) : - (xmit->tail + 4)) & (UART_XMIT_SIZE - 1); - tf_pointer += 4; - sent_tx = 1; - } - - if (uart_circ_empty(xmit)) - msm_hsl_stop_tx(port); - - if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) - uart_write_wakeup(port); - -} - -static void handle_delta_cts(struct uart_port *port) -{ - unsigned int vid = UART_TO_MSM(port)->ver_id; - - msm_hsl_write(port, RESET_CTS, regmap[vid][UARTDM_CR]); - port->icount.cts++; - wake_up_interruptible(&port->state->port.delta_msr_wait); -} - -static irqreturn_t msm_hsl_irq(int irq, void *dev_id) -{ - struct uart_port *port = dev_id; - struct msm_hsl_port *msm_hsl_port = UART_TO_MSM(port); - unsigned int vid; - unsigned int misr; - unsigned long flags; - - spin_lock_irqsave(&port->lock, flags); - vid = msm_hsl_port->ver_id; - misr = msm_hsl_read(port, regmap[vid][UARTDM_MISR]); - /* disable interrupt */ - msm_hsl_write(port, 0, regmap[vid][UARTDM_IMR]); - - if (misr & (UARTDM_ISR_RXSTALE_BMSK | UARTDM_ISR_RXLEV_BMSK)) { - handle_rx(port, misr); - if (misr & (UARTDM_ISR_RXSTALE_BMSK)) - msm_hsl_write(port, RESET_STALE_INT, - regmap[vid][UARTDM_CR]); - msm_hsl_write(port, 6500, regmap[vid][UARTDM_DMRX]); - msm_hsl_write(port, STALE_EVENT_ENABLE, regmap[vid][UARTDM_CR]); - } - if (misr & UARTDM_ISR_TXLEV_BMSK) - handle_tx(port); - - if (misr & UARTDM_ISR_DELTA_CTS_BMSK) - handle_delta_cts(port); - - /* restore interrupt */ - msm_hsl_write(port, msm_hsl_port->imr, regmap[vid][UARTDM_IMR]); - spin_unlock_irqrestore(&port->lock, flags); - - return IRQ_HANDLED; -} - -static unsigned int msm_hsl_tx_empty(struct uart_port *port) -{ - unsigned int ret; - unsigned int vid = UART_TO_MSM(port)->ver_id; - - ret = (msm_hsl_read(port, regmap[vid][UARTDM_SR]) & - UARTDM_SR_TXEMT_BMSK) ? TIOCSER_TEMT : 0; - return ret; -} - -static void msm_hsl_reset(struct uart_port *port) -{ - unsigned int vid = UART_TO_MSM(port)->ver_id; - - /* reset everything */ - msm_hsl_write(port, RESET_RX, regmap[vid][UARTDM_CR]); - msm_hsl_write(port, RESET_TX, regmap[vid][UARTDM_CR]); - msm_hsl_write(port, RESET_ERROR_STATUS, regmap[vid][UARTDM_CR]); - msm_hsl_write(port, RESET_BREAK_INT, regmap[vid][UARTDM_CR]); - msm_hsl_write(port, RESET_CTS, regmap[vid][UARTDM_CR]); - msm_hsl_write(port, RFR_LOW, regmap[vid][UARTDM_CR]); - - /* Disable DM modes */ - msm_hsl_write(port, 0, regmap[vid][UARTDM_DMEN]); - -} - -static unsigned int msm_hsl_get_mctrl(struct uart_port *port) -{ - return TIOCM_CAR | TIOCM_CTS | TIOCM_DSR | TIOCM_RTS; -} - -static void msm_hsl_set_mctrl(struct uart_port *port, unsigned int mctrl) -{ - unsigned int vid = UART_TO_MSM(port)->ver_id; - unsigned int mr; - unsigned int loop_mode; - - mr = msm_hsl_read(port, regmap[vid][UARTDM_MR1]); - - if (!(mctrl & TIOCM_RTS)) { - mr &= ~UARTDM_MR1_RX_RDY_CTL_BMSK; - msm_hsl_write(port, mr, regmap[vid][UARTDM_MR1]); - msm_hsl_write(port, RFR_HIGH, regmap[vid][UARTDM_CR]); - } else { - mr |= UARTDM_MR1_RX_RDY_CTL_BMSK; - msm_hsl_write(port, mr, regmap[vid][UARTDM_MR1]); - } - - loop_mode = TIOCM_LOOP & mctrl; - if (loop_mode) { - mr = msm_hsl_read(port, regmap[vid][UARTDM_MR2]); - mr |= UARTDM_MR2_LOOP_MODE_BMSK; - msm_hsl_write(port, mr, regmap[vid][UARTDM_MR2]); - - /* Reset TX */ - msm_hsl_reset(port); - - /* Turn on Uart Receiver & Transmitter*/ - msm_hsl_write(port, UARTDM_CR_RX_EN_BMSK - | UARTDM_CR_TX_EN_BMSK, regmap[vid][UARTDM_CR]); - } -} - -static void msm_hsl_break_ctl(struct uart_port *port, int break_ctl) -{ - unsigned int vid = UART_TO_MSM(port)->ver_id; - - if (break_ctl) - msm_hsl_write(port, START_BREAK, regmap[vid][UARTDM_CR]); - else - msm_hsl_write(port, STOP_BREAK, regmap[vid][UARTDM_CR]); -} - -/** - * msm_hsl_set_baud_rate: set requested baud rate - * @port: uart port - * @baud: baud rate to set (in bps) - */ -static void msm_hsl_set_baud_rate(struct uart_port *port, - unsigned int baud) -{ - unsigned int baud_code, rxstale, watermark; - unsigned int data; - unsigned int vid; - struct msm_hsl_port *msm_hsl_port = UART_TO_MSM(port); - - switch (baud) { - case 300: - baud_code = UARTDM_CSR_75; - rxstale = 1; - break; - case 600: - baud_code = UARTDM_CSR_150; - rxstale = 1; - break; - case 1200: - baud_code = UARTDM_CSR_300; - rxstale = 1; - break; - case 2400: - baud_code = UARTDM_CSR_600; - rxstale = 1; - break; - case 4800: - baud_code = UARTDM_CSR_1200; - rxstale = 1; - break; - case 9600: - baud_code = UARTDM_CSR_2400; - rxstale = 2; - break; - case 14400: - baud_code = UARTDM_CSR_3600; - rxstale = 3; - break; - case 19200: - baud_code = UARTDM_CSR_4800; - rxstale = 4; - break; - case 28800: - baud_code = UARTDM_CSR_7200; - rxstale = 6; - break; - case 38400: - baud_code = UARTDM_CSR_9600; - rxstale = 8; - break; - case 57600: - baud_code = UARTDM_CSR_14400; - rxstale = 16; - break; - case 115200: - baud_code = UARTDM_CSR_28800; - rxstale = 31; - break; - case 230400: - baud_code = UARTDM_CSR_57600; - rxstale = 31; - break; - case 460800: - baud_code = UARTDM_CSR_115200; - rxstale = 31; - break; - case 4000000: - case 3686400: - case 3200000: - case 3500000: - case 3000000: - case 2500000: - case 1500000: - case 1152000: - case 1000000: - case 921600: - baud_code = 0xff; - rxstale = 31; - break; - default: /*115200 baud rate */ - baud_code = UARTDM_CSR_28800; - rxstale = 31; - break; - } - - vid = msm_hsl_port->ver_id; - msm_hsl_write(port, baud_code, regmap[vid][UARTDM_CSR]); - - /* - * uart baud rate depends on CSR and MND Values - * we are updating CSR before and then calling - * clk_set_rate which updates MND Values. Hence - * dsb requires here. - */ - mb(); - - /* - * Check requested baud rate and for higher baud rate than 460800, - * calculate required uart clock frequency and set the same. - */ - if (baud > 460800) - port->uartclk = baud * 16; - else - port->uartclk = 7372800; - - if (clk_set_rate(msm_hsl_port->clk, port->uartclk)) { - pr_err("Error: setting uartclk rate %u\n", port->uartclk); - WARN_ON(1); - return; - } - - /* Set timeout to be ~600x the character transmit time */ - msm_hsl_port->tx_timeout = (1000000000 / baud) * 6; - - /* RX stale watermark */ - watermark = UARTDM_IPR_STALE_LSB_BMSK & rxstale; - watermark |= UARTDM_IPR_STALE_TIMEOUT_MSB_BMSK & (rxstale << 2); - msm_hsl_write(port, watermark, regmap[vid][UARTDM_IPR]); - - /* Set RX watermark - * Configure Rx Watermark as 3/4 size of Rx FIFO. - * RFWR register takes value in Words for UARTDM Core - * whereas it is consider to be in Bytes for UART Core. - * Hence configuring Rx Watermark as 48 Words. - */ - watermark = (port->fifosize * 3) / 4; - msm_hsl_write(port, watermark, regmap[vid][UARTDM_RFWR]); - - /* set TX watermark */ - msm_hsl_write(port, 0, regmap[vid][UARTDM_TFWR]); - - msm_hsl_write(port, CR_PROTECTION_EN, regmap[vid][UARTDM_CR]); - msm_hsl_reset(port); - - data = UARTDM_CR_TX_EN_BMSK; - data |= UARTDM_CR_RX_EN_BMSK; - /* enable TX & RX */ - msm_hsl_write(port, data, regmap[vid][UARTDM_CR]); - - msm_hsl_write(port, RESET_STALE_INT, regmap[vid][UARTDM_CR]); - /* turn on RX and CTS interrupts */ - msm_hsl_port->imr = UARTDM_ISR_RXSTALE_BMSK - | UARTDM_ISR_DELTA_CTS_BMSK | UARTDM_ISR_RXLEV_BMSK; - msm_hsl_write(port, msm_hsl_port->imr, regmap[vid][UARTDM_IMR]); - msm_hsl_write(port, 6500, regmap[vid][UARTDM_DMRX]); - msm_hsl_write(port, STALE_EVENT_ENABLE, regmap[vid][UARTDM_CR]); -} - -static void msm_hsl_init_clock(struct uart_port *port) -{ - clk_en(port, 1); -} - -static void msm_hsl_deinit_clock(struct uart_port *port) -{ - clk_en(port, 0); -} - -static int msm_hsl_startup(struct uart_port *port) -{ - struct msm_hsl_port *msm_hsl_port = UART_TO_MSM(port); - struct platform_device *pdev = to_platform_device(port->dev); - const struct msm_serial_hslite_platform_data *pdata = - pdev->dev.platform_data; - unsigned int data, rfr_level; - unsigned int vid; - int ret; - unsigned long flags; - - snprintf(msm_hsl_port->name, sizeof(msm_hsl_port->name), - "msm_serial_hsl%d", port->line); - - if (!(is_console(port)) || (!port->cons) || - (port->cons && (!(port->cons->flags & CON_ENABLED)))) { - - if (msm_serial_hsl_has_gsbi(port)) - set_gsbi_uart_func_mode(port); - - if (pdata && pdata->use_pm) - wake_lock(&msm_hsl_port->port_open_wake_lock); - - if (pdata && pdata->config_gpio) { - ret = msm_hsl_config_uart_gpios(port); - if (ret) { - msm_hsl_unconfig_uart_gpios(port); - goto release_wakelock; - } - } - } - - /* - * Set RFR Level as 3/4 of UARTDM FIFO Size - * i.e. 48 Words = 192 bytes as Rx FIFO is 64 words ( 256 bytes). - */ - if (likely(port->fifosize > 48)) - rfr_level = port->fifosize - 16; - else - rfr_level = port->fifosize; - - spin_lock_irqsave(&port->lock, flags); - - vid = msm_hsl_port->ver_id; - /* set automatic RFR level */ - data = msm_hsl_read(port, regmap[vid][UARTDM_MR1]); - data &= ~UARTDM_MR1_AUTO_RFR_LEVEL1_BMSK; - data &= ~UARTDM_MR1_AUTO_RFR_LEVEL0_BMSK; - data |= UARTDM_MR1_AUTO_RFR_LEVEL1_BMSK & (rfr_level << 2); - data |= UARTDM_MR1_AUTO_RFR_LEVEL0_BMSK & rfr_level; - msm_hsl_write(port, data, regmap[vid][UARTDM_MR1]); - spin_unlock_irqrestore(&port->lock, flags); - - ret = request_irq(port->irq, msm_hsl_irq, IRQF_TRIGGER_HIGH, - msm_hsl_port->name, port); - if (unlikely(ret)) { - pr_err("failed to request_irq\n"); - msm_hsl_unconfig_uart_gpios(port); - goto release_wakelock; - } - - return ret; - -release_wakelock: - if (pdata && pdata->use_pm) - wake_unlock(&msm_hsl_port->port_open_wake_lock); - - return ret; -} - -static void msm_hsl_shutdown(struct uart_port *port) -{ - struct msm_hsl_port *msm_hsl_port = UART_TO_MSM(port); - struct platform_device *pdev = to_platform_device(port->dev); - const struct msm_serial_hslite_platform_data *pdata = - pdev->dev.platform_data; - - msm_hsl_port->imr = 0; - /* disable interrupts */ - msm_hsl_write(port, 0, regmap[msm_hsl_port->ver_id][UARTDM_IMR]); - - free_irq(port->irq, port); - - if (!(is_console(port)) || (!port->cons) || - (port->cons && (!(port->cons->flags & CON_ENABLED)))) { - /* Free UART GPIOs */ - if (pdata && pdata->config_gpio) - msm_hsl_unconfig_uart_gpios(port); - - if (pdata && pdata->use_pm) - wake_unlock(&msm_hsl_port->port_open_wake_lock); - } -} - -static void msm_hsl_set_termios(struct uart_port *port, - struct ktermios *termios, - struct ktermios *old) -{ - unsigned int baud, mr; - unsigned int vid; - struct msm_hsl_port *msm_hsl_port = UART_TO_MSM(port); - - if (!termios->c_cflag) - return; - - mutex_lock(&msm_hsl_port->clk_mutex); - - /* - * Calculate and set baud rate - * 300 is the minimum and 4 Mbps is the maximum baud rate - * supported by driver. - */ - baud = uart_get_baud_rate(port, termios, old, 200, 4000000); - - /* - * Due to non-availability of 3.2 Mbps baud rate as standard baud rate - * with TTY/serial core. Map 200 BAUD to 3.2 Mbps - */ - if (baud == 200) - baud = 3200000; - - msm_hsl_set_baud_rate(port, baud); - - vid = UART_TO_MSM(port)->ver_id; - /* calculate parity */ - mr = msm_hsl_read(port, regmap[vid][UARTDM_MR2]); - mr &= ~UARTDM_MR2_PARITY_MODE_BMSK; - if (termios->c_cflag & PARENB) { - if (termios->c_cflag & PARODD) - mr |= ODD_PARITY; - else if (termios->c_cflag & CMSPAR) - mr |= SPACE_PARITY; - else - mr |= EVEN_PARITY; - } - - /* calculate bits per char */ - mr &= ~UARTDM_MR2_BITS_PER_CHAR_BMSK; - switch (termios->c_cflag & CSIZE) { - case CS5: - mr |= FIVE_BPC; - break; - case CS6: - mr |= SIX_BPC; - break; - case CS7: - mr |= SEVEN_BPC; - break; - case CS8: - default: - mr |= EIGHT_BPC; - break; - } - - /* calculate stop bits */ - mr &= ~(STOP_BIT_ONE | STOP_BIT_TWO); - if (termios->c_cflag & CSTOPB) - mr |= STOP_BIT_TWO; - else - mr |= STOP_BIT_ONE; - - /* set parity, bits per char, and stop bit */ - msm_hsl_write(port, mr, regmap[vid][UARTDM_MR2]); - - /* calculate and set hardware flow control */ - mr = msm_hsl_read(port, regmap[vid][UARTDM_MR1]); - mr &= ~(UARTDM_MR1_CTS_CTL_BMSK | UARTDM_MR1_RX_RDY_CTL_BMSK); - if (termios->c_cflag & CRTSCTS) { - mr |= UARTDM_MR1_CTS_CTL_BMSK; - mr |= UARTDM_MR1_RX_RDY_CTL_BMSK; - } - msm_hsl_write(port, mr, regmap[vid][UARTDM_MR1]); - - /* Configure status bits to ignore based on termio flags. */ - port->read_status_mask = 0; - if (termios->c_iflag & INPCK) - port->read_status_mask |= UARTDM_SR_PAR_FRAME_BMSK; - if (termios->c_iflag & (BRKINT | PARMRK)) - port->read_status_mask |= UARTDM_SR_RX_BREAK_BMSK; - - uart_update_timeout(port, termios->c_cflag, baud); - - mutex_unlock(&msm_hsl_port->clk_mutex); -} - -static const char *msm_hsl_type(struct uart_port *port) -{ - return "MSM"; -} - -static void msm_hsl_release_port(struct uart_port *port) -{ - struct msm_hsl_port *msm_hsl_port = UART_TO_MSM(port); - struct platform_device *pdev = to_platform_device(port->dev); - struct resource *uart_resource; - resource_size_t size; - - uart_resource = platform_get_resource_byname(pdev, IORESOURCE_MEM, - "uartdm_resource"); - if (!uart_resource) - uart_resource = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (unlikely(!uart_resource)) - return; - size = uart_resource->end - uart_resource->start + 1; - - release_mem_region(port->mapbase, size); - iounmap(port->membase); - port->membase = NULL; - - if (msm_serial_hsl_has_gsbi(port)) { - iowrite32(GSBI_PROTOCOL_IDLE, msm_hsl_port->mapped_gsbi + - GSBI_CONTROL_ADDR); - iounmap(msm_hsl_port->mapped_gsbi); - msm_hsl_port->mapped_gsbi = NULL; - } -} - -static int msm_hsl_request_port(struct uart_port *port) -{ - struct msm_hsl_port *msm_hsl_port = UART_TO_MSM(port); - struct platform_device *pdev = to_platform_device(port->dev); - struct resource *uart_resource; - struct resource *gsbi_resource; - resource_size_t size; - - uart_resource = platform_get_resource_byname(pdev, IORESOURCE_MEM, - "uartdm_resource"); - if (!uart_resource) - uart_resource = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (unlikely(!uart_resource)) { - pr_err("can't get uartdm resource\n"); - return -ENXIO; - } - size = uart_resource->end - uart_resource->start + 1; - - if (unlikely(!request_mem_region(port->mapbase, size, - "msm_serial_hsl"))) { - pr_err("can't get mem region for uartdm\n"); - return -EBUSY; - } - - port->membase = ioremap(port->mapbase, size); - if (!port->membase) { - release_mem_region(port->mapbase, size); - return -EBUSY; - } - - if (msm_serial_hsl_has_gsbi(port)) { - gsbi_resource = platform_get_resource_byname(pdev, - IORESOURCE_MEM, - "gsbi_resource"); - if (!gsbi_resource) - gsbi_resource = platform_get_resource(pdev, - IORESOURCE_MEM, 1); - if (unlikely(!gsbi_resource)) { - pr_err("can't get gsbi resource\n"); - return -ENXIO; - } - - size = gsbi_resource->end - gsbi_resource->start + 1; - msm_hsl_port->mapped_gsbi = ioremap(gsbi_resource->start, - size); - if (!msm_hsl_port->mapped_gsbi) { - return -EBUSY; - } - } - - return 0; -} - -static void msm_hsl_config_port(struct uart_port *port, int flags) -{ - if (flags & UART_CONFIG_TYPE) { - port->type = PORT_MSM; - if (msm_hsl_request_port(port)) - return; - } - - /* Configure required GSBI based UART protocol. */ - if (msm_serial_hsl_has_gsbi(port)) - set_gsbi_uart_func_mode(port); -} - -static int msm_hsl_verify_port(struct uart_port *port, - struct serial_struct *ser) -{ - if (unlikely(ser->type != PORT_UNKNOWN && ser->type != PORT_MSM)) - return -EINVAL; - if (unlikely(port->irq != ser->irq)) - return -EINVAL; - return 0; -} - -static void msm_hsl_power(struct uart_port *port, unsigned int state, - unsigned int oldstate) -{ - int ret; - struct msm_hsl_port *msm_hsl_port = UART_TO_MSM(port); - struct platform_device *pdev = to_platform_device(port->dev); - const struct msm_serial_hslite_platform_data *pdata = - pdev->dev.platform_data; - - switch (state) { - case 0: - ret = clk_set_rate(msm_hsl_port->clk, port->uartclk); - if (ret) - pr_err("Error setting UART clock rate to %u\n", - port->uartclk); - clk_en(port, 1); - break; - case 3: - clk_en(port, 0); - if (pdata && pdata->set_uart_clk_zero) { - ret = clk_set_rate(msm_hsl_port->clk, 0); - if (ret) - pr_err("Error setting UART clock rate to zero.\n"); - } - break; - default: - pr_err("Unknown PM state %d\n", state); - } -} - - - - - - -#ifdef CONFIG_CONSOLE_POLL - -/* defines from msm_serial.h */ -#define UARTDM_DMEN_RX_SC_ENABLE BIT(5) -#define UARTDM_DMEN_TX_SC_ENABLE BIT(4) - -#define UARTDM_RXFS_BUF_SHIFT 0x7 -#define UARTDM_RXFS_BUF_MASK 0x7 - -static int msm_poll_init(struct uart_port *port) -{ - unsigned int vid; - - vid = UART_TO_MSM(port)->ver_id; - - /* Enable single character mode on RX FIFO */ - /* A later patch from David Boyd suggests this causes problems... */ - /*msm_hsl_write(port, UARTDM_DMEN_RX_SC_ENABLE, regmap[vid][UARTDM_DMEN]);*/ - - return 0; -} - -static int msm_poll_get_char_dm(struct uart_port *port) -{ - int c; - static u32 slop; - static int count; - unsigned char *sp = (unsigned char *)&slop; - unsigned int vid; - - vid = UART_TO_MSM(port)->ver_id; - - /* Check if a previous read had more than one char */ - if (count) { - c = sp[sizeof(slop) - count]; - count--; - /* Or if FIFO is empty */ - } else if (!(msm_hsl_read(port, regmap[vid][UARTDM_SR]) & UARTDM_SR_RXRDY_BMSK)) { /* bit 0 */ - /* - * If RX packing buffer has less than a word, force stale to - * push contents into RX FIFO - */ - count = msm_hsl_read(port, regmap[vid][UARTDM_RXFS]); - - count = (count >> UARTDM_RXFS_BUF_SHIFT) & UARTDM_RXFS_BUF_MASK; - if (count) { - msm_hsl_write(port, FORCE_STALE_EVENT, regmap[vid][UARTDM_CR]); - slop = msm_hsl_read(port, regmap[vid][UARTDM_RF]); - c = sp[0]; - count--; - - msm_hsl_write(port, RESET_STALE_INT, regmap[vid][UARTDM_CR]); - msm_hsl_write(port, 0xFF, regmap[vid][UARTDM_DMRX]); - msm_hsl_write(port, STALE_EVENT_ENABLE, regmap[vid][UARTDM_CR]); - - } else { - c = NO_POLL_CHAR; - } - /* FIFO has a word */ - } else { - slop = msm_hsl_read(port, regmap[vid][UARTDM_RF]); - c = sp[0]; - count = sizeof(slop) - 1; - } - - return c; -} - - -static int msm_poll_get_char(struct uart_port *port) -{ - u32 imr; - int c; - unsigned int vid; - - vid = UART_TO_MSM(port)->ver_id; - - /* Disable all interrupts */ - imr = msm_hsl_read(port, regmap[vid][UARTDM_IMR]); - msm_hsl_write(port, 0, regmap[vid][UARTDM_IMR]); - - - c = msm_poll_get_char_dm(port); - - - /* Enable interrupts */ - msm_hsl_write(port, imr, regmap[vid][UARTDM_IMR]); - - return c; -} - -static void reset_dm_count(struct uart_port *port, int count) -{ - unsigned int vid; - - vid = UART_TO_MSM(port)->ver_id; - - wait_for_xmitr(port); - msm_hsl_write(port, count, regmap[vid][UARTDM_NCF_TX]); - msm_hsl_read(port, regmap[vid][UARTDM_NCF_TX]); -} - -static void msm_poll_put_char(struct uart_port *port, unsigned char c) -{ - u32 imr; - unsigned int vid; - - vid = UART_TO_MSM(port)->ver_id; - - /* Disable all interrupts */ - imr = msm_hsl_read(port, regmap[vid][UARTDM_IMR]); - msm_hsl_write(port, 0, regmap[vid][UARTDM_IMR]); - - /*if (msm_port->is_uartdm)*/ - reset_dm_count(port, 1); - - /* Wait until FIFO is empty */ - while (!(msm_hsl_read(port, regmap[vid][UARTDM_SR]) & UARTDM_SR_TXRDY_BMSK)) - cpu_relax(); - - /* Write a character */ - msm_hsl_write(port, c, regmap[vid][UARTDM_TF]); - - /* Wait until FIFO is empty */ - while (!(msm_hsl_read(port, regmap[vid][UARTDM_SR]) & UARTDM_SR_TXRDY_BMSK)) - cpu_relax(); - - /* Enable interrupts */ - msm_hsl_write(port, imr, regmap[vid][UARTDM_IMR]); - - return; -} -#endif - - -static struct uart_ops msm_hsl_uart_pops = { - .tx_empty = msm_hsl_tx_empty, - .set_mctrl = msm_hsl_set_mctrl, - .get_mctrl = msm_hsl_get_mctrl, - .stop_tx = msm_hsl_stop_tx, - .start_tx = msm_hsl_start_tx, - .stop_rx = msm_hsl_stop_rx, - .enable_ms = msm_hsl_enable_ms, - .break_ctl = msm_hsl_break_ctl, - .startup = msm_hsl_startup, - .shutdown = msm_hsl_shutdown, - .set_termios = msm_hsl_set_termios, - .type = msm_hsl_type, - .release_port = msm_hsl_release_port, - .request_port = msm_hsl_request_port, - .config_port = msm_hsl_config_port, - .verify_port = msm_hsl_verify_port, - .pm = msm_hsl_power, -#ifdef CONFIG_CONSOLE_POLL - .poll_init = msm_poll_init, - .poll_get_char = msm_poll_get_char, - .poll_put_char = msm_poll_put_char, -#endif -}; - -static struct msm_hsl_port msm_hsl_uart_ports[] = { - { - .uart = { - .iotype = UPIO_MEM, - .ops = &msm_hsl_uart_pops, - .flags = UPF_BOOT_AUTOCONF, - .fifosize = 64, - .line = 0, - }, - }, - { - .uart = { - .iotype = UPIO_MEM, - .ops = &msm_hsl_uart_pops, - .flags = UPF_BOOT_AUTOCONF, - .fifosize = 64, - .line = 1, - }, - }, - { - .uart = { - .iotype = UPIO_MEM, - .ops = &msm_hsl_uart_pops, - .flags = UPF_BOOT_AUTOCONF, - .fifosize = 64, - .line = 2, - }, - }, -}; - -#define UART_NR ARRAY_SIZE(msm_hsl_uart_ports) - -static inline struct uart_port *get_port_from_line(unsigned int line) -{ - return &msm_hsl_uart_ports[line].uart; -} - -static unsigned int msm_hsl_console_state[8]; - -static void dump_hsl_regs(struct uart_port *port) -{ - struct msm_hsl_port *msm_hsl_port = UART_TO_MSM(port); - unsigned int vid = msm_hsl_port->ver_id; - unsigned int sr, isr, mr1, mr2, ncf, txfs, rxfs, con_state; - - sr = msm_hsl_read(port, regmap[vid][UARTDM_SR]); - isr = msm_hsl_read(port, regmap[vid][UARTDM_ISR]); - mr1 = msm_hsl_read(port, regmap[vid][UARTDM_MR1]); - mr2 = msm_hsl_read(port, regmap[vid][UARTDM_MR2]); - ncf = msm_hsl_read(port, regmap[vid][UARTDM_NCF_TX]); - txfs = msm_hsl_read(port, regmap[vid][UARTDM_TXFS]); - rxfs = msm_hsl_read(port, regmap[vid][UARTDM_RXFS]); - con_state = get_console_state(port); - - msm_hsl_console_state[0] = sr; - msm_hsl_console_state[1] = isr; - msm_hsl_console_state[2] = mr1; - msm_hsl_console_state[3] = mr2; - msm_hsl_console_state[4] = ncf; - msm_hsl_console_state[5] = txfs; - msm_hsl_console_state[6] = rxfs; - msm_hsl_console_state[7] = con_state; - - pr_info("Timeout: %d uS\n", msm_hsl_port->tx_timeout); - pr_info("SR: %08x\n", sr); - pr_info("ISR: %08x\n", isr); - pr_info("MR1: %08x\n", mr1); - pr_info("MR2: %08x\n", mr2); - pr_info("NCF: %08x\n", ncf); - pr_info("TXFS: %08x\n", txfs); - pr_info("RXFS: %08x\n", rxfs); - pr_info("Console state: %d\n", con_state); -} - -/* - * Wait for transmitter & holding register to empty - * Derived from wait_for_xmitr in 8250 serial driver by Russell King */ -static inline void wait_for_xmitr(struct uart_port *port) -{ - struct msm_hsl_port *msm_hsl_port = UART_TO_MSM(port); - unsigned int vid = msm_hsl_port->ver_id; - int count = 0; - - if (!(msm_hsl_read(port, regmap[vid][UARTDM_SR]) & - UARTDM_SR_TXEMT_BMSK)) { - while (!(msm_hsl_read(port, regmap[vid][UARTDM_ISR]) & - UARTDM_ISR_TX_READY_BMSK) && - !(msm_hsl_read(port, regmap[vid][UARTDM_SR]) & - UARTDM_SR_TXEMT_BMSK)) { - udelay(1); - touch_nmi_watchdog(); - cpu_relax(); - if (++count == msm_hsl_port->tx_timeout) { - pr_info("%s: UART TX Stuck, Resetting TX\n", - __func__); - msm_hsl_write(port, RESET_TX, - regmap[vid][UARTDM_CR]); - mb(); - dump_hsl_regs(port); - break; - } - } - msm_hsl_write(port, CLEAR_TX_READY, regmap[vid][UARTDM_CR]); - } -} - -#ifdef CONFIG_SERIAL_MSM_HSL_CONSOLE -static void msm_hsl_console_putchar(struct uart_port *port, int ch) -{ - unsigned int vid = UART_TO_MSM(port)->ver_id; - - wait_for_xmitr(port); - msm_hsl_write(port, 1, regmap[vid][UARTDM_NCF_TX]); - /* - * Dummy read to add 1 AHB clock delay to fix UART hardware bug. - * Bug: Delay required on TX-transfer-init. after writing to - * NO_CHARS_FOR_TX register. - */ - msm_hsl_read(port, regmap[vid][UARTDM_SR]); - msm_hsl_write(port, ch, regmap[vid][UARTDM_TF]); -} - -static void msm_hsl_console_write(struct console *co, const char *s, - unsigned int count) -{ - struct uart_port *port; - struct msm_hsl_port *msm_hsl_port; - unsigned int vid; - int locked; - - BUG_ON(co->index < 0 || co->index >= UART_NR); - - port = get_port_from_line(co->index); - msm_hsl_port = UART_TO_MSM(port); - vid = msm_hsl_port->ver_id; - - /* not pretty, but we can end up here via various convoluted paths */ - if (port->sysrq || oops_in_progress) - locked = spin_trylock(&port->lock); - else { - locked = 1; - spin_lock(&port->lock); - } - msm_hsl_write(port, 0, regmap[vid][UARTDM_IMR]); - uart_console_write(port, s, count, msm_hsl_console_putchar); - msm_hsl_write(port, msm_hsl_port->imr, regmap[vid][UARTDM_IMR]); - if (locked == 1) - spin_unlock(&port->lock); -} - -static int msm_hsl_console_setup(struct console *co, char *options) -{ - struct uart_port *port; - unsigned int vid; - int baud = 0, flow, bits, parity, mr2; - int ret; - - if (unlikely(co->index >= UART_NR || co->index < 0)) - return -ENXIO; - - port = get_port_from_line(co->index); - vid = UART_TO_MSM(port)->ver_id; - - if (unlikely(!port->membase)) - return -ENXIO; - - port->cons = co; - - console_lock(); - pm_runtime_get_noresume(port->dev); - -#ifndef CONFIG_PM_RUNTIME - msm_hsl_init_clock(port); -#endif - pm_runtime_resume(port->dev); - - if (options) - uart_parse_options(options, &baud, &parity, &bits, &flow); - - bits = 8; - parity = 'n'; - flow = 'n'; - msm_hsl_write(port, UARTDM_MR2_BITS_PER_CHAR_8 | STOP_BIT_ONE, - regmap[vid][UARTDM_MR2]); /* 8N1 */ - - msm_hsl_set_baud_rate(port, baud); - - ret = uart_set_options(port, co, baud, parity, bits, flow); - - mr2 = msm_hsl_read(port, regmap[vid][UARTDM_MR2]); - mr2 |= UARTDM_MR2_RX_ERROR_CHAR_OFF; - mr2 |= UARTDM_MR2_RX_BREAK_ZERO_CHAR_OFF; - msm_hsl_write(port, mr2, regmap[vid][UARTDM_MR2]); - - msm_hsl_reset(port); - /* Enable transmitter */ - msm_hsl_write(port, CR_PROTECTION_EN, regmap[vid][UARTDM_CR]); - msm_hsl_write(port, UARTDM_CR_TX_EN_BMSK, regmap[vid][UARTDM_CR]); - - msm_hsl_write(port, 1, regmap[vid][UARTDM_NCF_TX]); - msm_hsl_read(port, regmap[vid][UARTDM_NCF_TX]); - - console_unlock(); - pr_info("console setup on port #%d\n", port->line); - - return ret; -} - -static struct uart_driver msm_hsl_uart_driver; - -static struct console msm_hsl_console = { - .name = "ttyHSL", - .write = msm_hsl_console_write, - .device = uart_console_device, - .setup = msm_hsl_console_setup, - .flags = CON_PRINTBUFFER, - .index = -1, - .data = &msm_hsl_uart_driver, -}; - -#define MSM_HSL_CONSOLE (&msm_hsl_console) -/* - * get_console_state - check the per-port serial console state. - * @port: uart_port structure describing the port - * - * Return the state of serial console availability on port. - * return 1: If serial console is enabled on particular UART port. - * return 0: If serial console is disabled on particular UART port. - */ -static int get_console_state(struct uart_port *port) -{ - if (is_console(port) && (port->cons->flags & CON_ENABLED)) - return 1; - else - return 0; -} - -/* show_msm_console - provide per-port serial console state. */ -static ssize_t show_msm_console(struct device *dev, - struct device_attribute *attr, char *buf) -{ - int enable; - struct uart_port *port; - - struct platform_device *pdev = to_platform_device(dev); - port = get_port_from_line(get_line(pdev)); - - enable = get_console_state(port); - - return snprintf(buf, sizeof(enable), "%d\n", enable); -} - -/* - * set_msm_console - allow to enable/disable serial console on port. - * - * writing 1 enables serial console on UART port. - * writing 0 disables serial console on UART port. - */ -static ssize_t set_msm_console(struct device *dev, - struct device_attribute *attr, - const char *buf, size_t count) -{ - int enable, cur_state; - struct uart_port *port; - - struct platform_device *pdev = to_platform_device(dev); - port = get_port_from_line(get_line(pdev)); - - cur_state = get_console_state(port); - enable = buf[0] - '0'; - - if (enable == cur_state) - return count; - - switch (enable) { - case 0: - pr_debug("Calling stop_console\n"); - console_stop(port->cons); - pr_debug("Calling unregister_console\n"); - unregister_console(port->cons); - pm_runtime_put_sync(&pdev->dev); - pm_runtime_disable(&pdev->dev); - /* - * Disable UART Core clk - * 3 - to disable the UART clock - * Thid parameter is not used here, but used in serial core. - */ - msm_hsl_power(port, 3, 1); - break; - case 1: - pr_debug("Calling register_console\n"); - /* - * Disable UART Core clk - * 0 - to enable the UART clock - * Thid parameter is not used here, but used in serial core. - */ - msm_hsl_power(port, 0, 1); - pm_runtime_enable(&pdev->dev); - register_console(port->cons); - break; - default: - return -EINVAL; - } - - return count; -} -static DEVICE_ATTR(console, S_IWUSR | S_IRUGO, show_msm_console, - set_msm_console); -#else -#define MSM_HSL_CONSOLE NULL -#endif - -static struct uart_driver msm_hsl_uart_driver = { - .owner = THIS_MODULE, - .driver_name = "msm_serial_hsl", - .dev_name = "ttyHSL", - .nr = UART_NR, - .cons = MSM_HSL_CONSOLE, -}; - -static struct msm_serial_hslite_platform_data - *msm_hsl_dt_to_pdata(struct platform_device *pdev) -{ - int ret; - struct device_node *node = pdev->dev.of_node; - struct msm_serial_hslite_platform_data *pdata; - - pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); - if (!pdata) { - pr_err("unable to allocate memory for platform data\n"); - return ERR_PTR(-ENOMEM); - } - - ret = of_property_read_u32(node, "qcom,config-gpio", - &pdata->config_gpio); - if (ret && ret != -EINVAL) { - pr_err("Error with config_gpio property.\n"); - return ERR_PTR(ret); - } - - if (pdata->config_gpio) { - pdata->uart_tx_gpio = of_get_named_gpio(node, - "qcom,tx-gpio", 0); - if (pdata->uart_tx_gpio < 0) - return ERR_PTR(pdata->uart_tx_gpio); - - pdata->uart_rx_gpio = of_get_named_gpio(node, - "qcom,rx-gpio", 0); - if (pdata->uart_rx_gpio < 0) - return ERR_PTR(pdata->uart_rx_gpio); - - /* check if 4-wire UART, then get cts/rfr GPIOs. */ - if (pdata->config_gpio == 4) { - pdata->uart_cts_gpio = of_get_named_gpio(node, - "qcom,cts-gpio", 0); - if (pdata->uart_cts_gpio < 0) - return ERR_PTR(pdata->uart_cts_gpio); - - pdata->uart_rfr_gpio = of_get_named_gpio(node, - "qcom,rfr-gpio", 0); - if (pdata->uart_rfr_gpio < 0) - return ERR_PTR(pdata->uart_rfr_gpio); - } - } - - pdata->use_pm = of_property_read_bool(node, "qcom,use-pm"); - - return pdata; -} - -static atomic_t msm_serial_hsl_next_id = ATOMIC_INIT(0); - -static int msm_serial_hsl_probe(struct platform_device *pdev) -{ - struct msm_hsl_port *msm_hsl_port; - struct resource *uart_resource; - struct resource *gsbi_resource; - struct uart_port *port; - struct msm_serial_hslite_platform_data *pdata; - const struct of_device_id *match; - u32 line; - int ret; - - if (pdev->id == -1) - pdev->id = atomic_inc_return(&msm_serial_hsl_next_id) - 1; - - /* Use line (ttyHSLx) number from pdata or device tree if specified */ - pdata = pdev->dev.platform_data; - if (pdata) - line = pdata->line; - else - line = pdev->id; - - /* Use line number from device tree alias if present */ - if (pdev->dev.of_node) { - dev_dbg(&pdev->dev, "device tree enabled\n"); - ret = of_alias_get_id(pdev->dev.of_node, "serial"); - if (ret >= 0) - line = ret; - - pdata = msm_hsl_dt_to_pdata(pdev); - if (IS_ERR(pdata)) - return PTR_ERR(pdata); - - pdev->dev.platform_data = pdata; - } - - if (unlikely(line < 0 || line >= UART_NR)) - return -ENXIO; - - pr_info("detected port #%d (ttyHSL%d)\n", pdev->id, line); - - port = get_port_from_line(line); - port->dev = &pdev->dev; - port->uartclk = 7372800; - msm_hsl_port = UART_TO_MSM(port); - - msm_hsl_port->clk = clk_get(&pdev->dev, "core_clk"); - if (unlikely(IS_ERR(msm_hsl_port->clk))) { - ret = PTR_ERR(msm_hsl_port->clk); - if (ret != -EPROBE_DEFER) - pr_err("Error getting clk\n"); - return ret; - } - - /* Interface clock is not required by all UART configurations. - * GSBI UART and BLSP UART needs interface clock but Legacy UART - * do not require interface clock. Hence, do not fail probe with - * iface clk_get failure. - */ - msm_hsl_port->pclk = clk_get(&pdev->dev, "iface_clk"); - if (unlikely(IS_ERR(msm_hsl_port->pclk))) { - ret = PTR_ERR(msm_hsl_port->pclk); - if (ret == -EPROBE_DEFER) { - clk_put(msm_hsl_port->clk); - return ret; - } else { - msm_hsl_port->pclk = NULL; - } - } - - /* Identify UART functional mode as 2-wire or 4-wire. */ - if (pdata && pdata->config_gpio == 4) - msm_hsl_port->func_mode = UART_FOUR_WIRE; - else - msm_hsl_port->func_mode = UART_TWO_WIRE; - - match = of_match_device(msm_hsl_match_table, &pdev->dev); - if (!match) { - msm_hsl_port->ver_id = UARTDM_VERSION_11_13; - } else { - msm_hsl_port->ver_id = (unsigned int)match->data; - /* - * BLSP based UART configuration is available with - * UARTDM v14 Revision. Hence set uart_type as UART_BLSP. - */ - msm_hsl_port->uart_type = BLSP_HSUART; - - msm_hsl_port->bus_scale_table = msm_bus_cl_get_pdata(pdev); - if (!msm_hsl_port->bus_scale_table) { - pr_err("Bus scaling is disabled\n"); - } else { - msm_hsl_port->bus_perf_client = - msm_bus_scale_register_client( - msm_hsl_port->bus_scale_table); - if (IS_ERR(&msm_hsl_port->bus_perf_client)) { - pr_err("Bus client register failed.\n"); - ret = -EINVAL; - goto err; - } - } - } - - gsbi_resource = platform_get_resource_byname(pdev, - IORESOURCE_MEM, - "gsbi_resource"); - if (!gsbi_resource) - gsbi_resource = platform_get_resource(pdev, IORESOURCE_MEM, 1); - - if (gsbi_resource) - msm_hsl_port->uart_type = GSBI_HSUART; - else - msm_hsl_port->uart_type = LEGACY_HSUART; - - - uart_resource = platform_get_resource_byname(pdev, - IORESOURCE_MEM, - "uartdm_resource"); - if (!uart_resource) - uart_resource = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (unlikely(!uart_resource)) { - pr_err("getting uartdm_resource failed\n"); - return -ENXIO; - } - port->mapbase = uart_resource->start; - - port->irq = platform_get_irq(pdev, 0); - if (unlikely((int)port->irq < 0)) { - pr_err("getting irq failed\n"); - return -ENXIO; - } - - device_set_wakeup_capable(&pdev->dev, 1); - platform_set_drvdata(pdev, port); - pm_runtime_enable(port->dev); -#ifdef CONFIG_SERIAL_MSM_HSL_CONSOLE - ret = device_create_file(&pdev->dev, &dev_attr_console); - if (unlikely(ret)) - pr_err("Can't create console attribute\n"); -#endif - msm_hsl_debugfs_init(msm_hsl_port, get_line(pdev)); - mutex_init(&msm_hsl_port->clk_mutex); - if (pdata && pdata->use_pm) - wake_lock_init(&msm_hsl_port->port_open_wake_lock, - WAKE_LOCK_SUSPEND, - "msm_serial_hslite_port_open"); - - /* Temporarily increase the refcount on the GSBI clock to avoid a race - * condition with the earlyprintk handover mechanism. - */ - if (msm_hsl_port->pclk) - clk_prepare_enable(msm_hsl_port->pclk); - ret = uart_add_one_port(&msm_hsl_uart_driver, port); - if (msm_hsl_port->pclk) - clk_disable_unprepare(msm_hsl_port->pclk); - -err: - return ret; -} - -static int msm_serial_hsl_remove(struct platform_device *pdev) -{ - struct msm_hsl_port *msm_hsl_port = platform_get_drvdata(pdev); - const struct msm_serial_hslite_platform_data *pdata = - pdev->dev.platform_data; - struct uart_port *port; - - port = get_port_from_line(get_line(pdev)); -#ifdef CONFIG_SERIAL_MSM_HSL_CONSOLE - device_remove_file(&pdev->dev, &dev_attr_console); -#endif - pm_runtime_put_sync(&pdev->dev); - pm_runtime_disable(&pdev->dev); - - if (pdata && pdata->use_pm) - wake_lock_destroy(&msm_hsl_port->port_open_wake_lock); - - device_set_wakeup_capable(&pdev->dev, 0); - platform_set_drvdata(pdev, NULL); - mutex_destroy(&msm_hsl_port->clk_mutex); - uart_remove_one_port(&msm_hsl_uart_driver, port); - - clk_put(msm_hsl_port->pclk); - clk_put(msm_hsl_port->clk); - debugfs_remove(msm_hsl_port->loopback_dir); - - return 0; -} - -#ifdef CONFIG_PM -static int msm_serial_hsl_suspend(struct device *dev) -{ - struct platform_device *pdev = to_platform_device(dev); - struct uart_port *port; - port = get_port_from_line(get_line(pdev)); - - if (port) { - - if (is_console(port)) - msm_hsl_deinit_clock(port); - - uart_suspend_port(&msm_hsl_uart_driver, port); - if (device_may_wakeup(dev)) - enable_irq_wake(port->irq); - } - - return 0; -} - -static int msm_serial_hsl_resume(struct device *dev) -{ - struct platform_device *pdev = to_platform_device(dev); - struct uart_port *port; - port = get_port_from_line(get_line(pdev)); - - if (port) { - - uart_resume_port(&msm_hsl_uart_driver, port); - if (device_may_wakeup(dev)) - disable_irq_wake(port->irq); - - if (is_console(port)) - msm_hsl_init_clock(port); - } - - return 0; -} -#else -#define msm_serial_hsl_suspend NULL -#define msm_serial_hsl_resume NULL -#endif - -static int msm_hsl_runtime_suspend(struct device *dev) -{ - struct platform_device *pdev = to_platform_device(dev); - struct uart_port *port; - port = get_port_from_line(get_line(pdev)); - - dev_dbg(dev, "pm_runtime: suspending\n"); - msm_hsl_deinit_clock(port); - return 0; -} - -static int msm_hsl_runtime_resume(struct device *dev) -{ - struct platform_device *pdev = to_platform_device(dev); - struct uart_port *port; - port = get_port_from_line(get_line(pdev)); - - dev_dbg(dev, "pm_runtime: resuming\n"); - msm_hsl_init_clock(port); - return 0; -} - -static struct dev_pm_ops msm_hsl_dev_pm_ops = { - .suspend = msm_serial_hsl_suspend, - .resume = msm_serial_hsl_resume, - .runtime_suspend = msm_hsl_runtime_suspend, - .runtime_resume = msm_hsl_runtime_resume, -}; - -static struct platform_driver msm_hsl_platform_driver = { - .probe = msm_serial_hsl_probe, - .remove = msm_serial_hsl_remove, - .driver = { - .name = "msm_serial_hsl", - .owner = THIS_MODULE, - .pm = &msm_hsl_dev_pm_ops, - .of_match_table = msm_hsl_match_table, - }, -}; - -static int __init msm_serial_hsl_init(void) -{ - int ret; - - ret = uart_register_driver(&msm_hsl_uart_driver); - if (unlikely(ret)) - return ret; - - debug_base = debugfs_create_dir("msm_serial_hsl", NULL); - if (IS_ERR_OR_NULL(debug_base)) - pr_err("Cannot create debugfs dir\n"); - - ret = platform_driver_register(&msm_hsl_platform_driver); - if (unlikely(ret)) - uart_unregister_driver(&msm_hsl_uart_driver); - - pr_info("driver initialized\n"); - - return ret; -} - -static void __exit msm_serial_hsl_exit(void) -{ - debugfs_remove_recursive(debug_base); -#ifdef CONFIG_SERIAL_MSM_HSL_CONSOLE - unregister_console(&msm_hsl_console); -#endif - platform_driver_unregister(&msm_hsl_platform_driver); - uart_unregister_driver(&msm_hsl_uart_driver); -} - -module_init(msm_serial_hsl_init); -module_exit(msm_serial_hsl_exit); - -MODULE_DESCRIPTION("Driver for msm HSUART serial device"); -MODULE_LICENSE("GPL v2"); diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c deleted file mode 100644 index 53d9fb7..0000000 --- a/drivers/tty/tty_io.c +++ /dev/null @@ -1,3600 +0,0 @@ -/* - * Copyright (C) 1991, 1992 Linus Torvalds - */ - -/* - * 'tty_io.c' gives an orthogonal feeling to tty's, be they consoles - * or rs-channels. It also implements echoing, cooked mode etc. - * - * Kill-line thanks to John T Kohl, who also corrected VMIN = VTIME = 0. - * - * Modified by Theodore Ts'o, 9/14/92, to dynamically allocate the - * tty_struct and tty_queue structures. Previously there was an array - * of 256 tty_struct's which was statically allocated, and the - * tty_queue structures were allocated at boot time. Both are now - * dynamically allocated only when the tty is open. - * - * Also restructured routines so that there is more of a separation - * between the high-level tty routines (tty_io.c and tty_ioctl.c) and - * the low-level tty routines (serial.c, pty.c, console.c). This - * makes for cleaner and more compact code. -TYT, 9/17/92 - * - * Modified by Fred N. van Kempen, 01/29/93, to add line disciplines - * which can be dynamically activated and de-activated by the line - * discipline handling modules (like SLIP). - * - * NOTE: pay no attention to the line discipline code (yet); its - * interface is still subject to change in this version... - * -- TYT, 1/31/92 - * - * Added functionality to the OPOST tty handling. No delays, but all - * other bits should be there. - * -- Nick Holloway , 27th May 1993. - * - * Rewrote canonical mode and added more termios flags. - * -- julian@uhunix.uhcc.hawaii.edu (J. Cowley), 13Jan94 - * - * Reorganized FASYNC support so mouse code can share it. - * -- ctm@ardi.com, 9Sep95 - * - * New TIOCLINUX variants added. - * -- mj@k332.feld.cvut.cz, 19-Nov-95 - * - * Restrict vt switching via ioctl() - * -- grif@cs.ucr.edu, 5-Dec-95 - * - * Move console and virtual terminal code to more appropriate files, - * implement CONFIG_VT and generalize console device interface. - * -- Marko Kohtala , March 97 - * - * Rewrote tty_init_dev and tty_release_dev to eliminate races. - * -- Bill Hawes , June 97 - * - * Added devfs support. - * -- C. Scott Ananian , 13-Jan-1998 - * - * Added support for a Unix98-style ptmx device. - * -- C. Scott Ananian , 14-Jan-1998 - * - * Reduced memory usage for older ARM systems - * -- Russell King - * - * Move do_SAK() into process context. Less stack use in devfs functions. - * alloc_tty_struct() always uses kmalloc() - * -- Andrew Morton 17Mar01 - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include -#include - -#undef TTY_DEBUG_HANGUP - -#define TTY_PARANOIA_CHECK 1 -#define CHECK_TTY_COUNT 1 - -struct ktermios tty_std_termios = { /* for the benefit of tty drivers */ - .c_iflag = ICRNL | IXON, - .c_oflag = OPOST | ONLCR, - .c_cflag = B38400 | CS8 | CREAD | HUPCL, - .c_lflag = ISIG | ICANON | ECHO | ECHOE | ECHOK | - ECHOCTL | ECHOKE | IEXTEN, - .c_cc = INIT_C_CC, - .c_ispeed = 38400, - .c_ospeed = 38400 -}; - -EXPORT_SYMBOL(tty_std_termios); - -/* This list gets poked at by procfs and various bits of boot up code. This - could do with some rationalisation such as pulling the tty proc function - into this file */ - -LIST_HEAD(tty_drivers); /* linked list of tty drivers */ - -/* Mutex to protect creating and releasing a tty. This is shared with - vt.c for deeply disgusting hack reasons */ -DEFINE_MUTEX(tty_mutex); -EXPORT_SYMBOL(tty_mutex); - -/* Spinlock to protect the tty->tty_files list */ -DEFINE_SPINLOCK(tty_files_lock); - -static ssize_t tty_read(struct file *, char __user *, size_t, loff_t *); -static ssize_t tty_write(struct file *, const char __user *, size_t, loff_t *); -ssize_t redirected_tty_write(struct file *, const char __user *, - size_t, loff_t *); -static unsigned int tty_poll(struct file *, poll_table *); -static int tty_open(struct inode *, struct file *); -long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg); -#ifdef CONFIG_COMPAT -static long tty_compat_ioctl(struct file *file, unsigned int cmd, - unsigned long arg); -#else -#define tty_compat_ioctl NULL -#endif -static int __tty_fasync(int fd, struct file *filp, int on); -static int tty_fasync(int fd, struct file *filp, int on); -static void release_tty(struct tty_struct *tty, int idx); -static void __proc_set_tty(struct task_struct *tsk, struct tty_struct *tty); -static void proc_set_tty(struct task_struct *tsk, struct tty_struct *tty); - -/** - * alloc_tty_struct - allocate a tty object - * - * Return a new empty tty structure. The data fields have not - * been initialized in any way but has been zeroed - * - * Locking: none - */ - -struct tty_struct *alloc_tty_struct(void) -{ - return kzalloc(sizeof(struct tty_struct), GFP_KERNEL); -} - -/** - * free_tty_struct - free a disused tty - * @tty: tty struct to free - * - * Free the write buffers, tty queue and tty memory itself. - * - * Locking: none. Must be called after tty is definitely unused - */ - -void free_tty_struct(struct tty_struct *tty) -{ - if (!tty) - return; - if (tty->dev) - put_device(tty->dev); - kfree(tty->write_buf); - tty->magic = 0xDEADDEAD; - kfree(tty); -} - -static inline struct tty_struct *file_tty(struct file *file) -{ - return ((struct tty_file_private *)file->private_data)->tty; -} - -int tty_alloc_file(struct file *file) -{ - struct tty_file_private *priv; - - priv = kmalloc(sizeof(*priv), GFP_KERNEL); - if (!priv) - return -ENOMEM; - - file->private_data = priv; - - return 0; -} - -/* Associate a new file with the tty structure */ -void tty_add_file(struct tty_struct *tty, struct file *file) -{ - struct tty_file_private *priv = file->private_data; - - priv->tty = tty; - priv->file = file; - - spin_lock(&tty_files_lock); - list_add(&priv->list, &tty->tty_files); - spin_unlock(&tty_files_lock); -} - -/** - * tty_free_file - free file->private_data - * - * This shall be used only for fail path handling when tty_add_file was not - * called yet. - */ -void tty_free_file(struct file *file) -{ - struct tty_file_private *priv = file->private_data; - - file->private_data = NULL; - kfree(priv); -} - -/* Delete file from its tty */ -static void tty_del_file(struct file *file) -{ - struct tty_file_private *priv = file->private_data; - - spin_lock(&tty_files_lock); - list_del(&priv->list); - spin_unlock(&tty_files_lock); - tty_free_file(file); -} - - -#define TTY_NUMBER(tty) ((tty)->index + (tty)->driver->name_base) - -/** - * tty_name - return tty naming - * @tty: tty structure - * @buf: buffer for output - * - * Convert a tty structure into a name. The name reflects the kernel - * naming policy and if udev is in use may not reflect user space - * - * Locking: none - */ - -char *tty_name(struct tty_struct *tty, char *buf) -{ - if (!tty) /* Hmm. NULL pointer. That's fun. */ - strcpy(buf, "NULL tty"); - else - strcpy(buf, tty->name); - return buf; -} - -EXPORT_SYMBOL(tty_name); - -int tty_paranoia_check(struct tty_struct *tty, struct inode *inode, - const char *routine) -{ -#ifdef TTY_PARANOIA_CHECK - if (!tty) { - printk(KERN_WARNING - "null TTY for (%d:%d) in %s\n", - imajor(inode), iminor(inode), routine); - return 1; - } - if (tty->magic != TTY_MAGIC) { - printk(KERN_WARNING - "bad magic number for tty struct (%d:%d) in %s\n", - imajor(inode), iminor(inode), routine); - return 1; - } -#endif - return 0; -} - -static int check_tty_count(struct tty_struct *tty, const char *routine) -{ -#ifdef CHECK_TTY_COUNT - struct list_head *p; - int count = 0; - - spin_lock(&tty_files_lock); - list_for_each(p, &tty->tty_files) { - count++; - } - spin_unlock(&tty_files_lock); - if (tty->driver->type == TTY_DRIVER_TYPE_PTY && - tty->driver->subtype == PTY_TYPE_SLAVE && - tty->link && tty->link->count) - count++; - if (tty->count != count) { - printk(KERN_WARNING "Warning: dev (%s) tty->count(%d) " - "!= #fd's(%d) in %s\n", - tty->name, tty->count, count, routine); - return count; - } -#endif - return 0; -} - -/** - * get_tty_driver - find device of a tty - * @dev_t: device identifier - * @index: returns the index of the tty - * - * This routine returns a tty driver structure, given a device number - * and also passes back the index number. - * - * Locking: caller must hold tty_mutex - */ - -static struct tty_driver *get_tty_driver(dev_t device, int *index) -{ - struct tty_driver *p; - - list_for_each_entry(p, &tty_drivers, tty_drivers) { - dev_t base = MKDEV(p->major, p->minor_start); - if (device < base || device >= base + p->num) - continue; - *index = device - base; - return tty_driver_kref_get(p); - } - return NULL; -} - -#ifdef CONFIG_CONSOLE_POLL - -/** - * tty_find_polling_driver - find device of a polled tty - * @name: name string to match - * @line: pointer to resulting tty line nr - * - * This routine returns a tty driver structure, given a name - * and the condition that the tty driver is capable of polled - * operation. - */ -struct tty_driver *tty_find_polling_driver(char *name, int *line) -{ - struct tty_driver *p, *res = NULL; - int tty_line = 0; - int len; - char *str, *stp; - - for (str = name; *str; str++) - if ((*str >= '0' && *str <= '9') || *str == ',') - break; - if (!*str) - return NULL; - - len = str - name; - tty_line = simple_strtoul(str, &str, 10); - - mutex_lock(&tty_mutex); - /* Search through the tty devices to look for a match */ - list_for_each_entry(p, &tty_drivers, tty_drivers) { - pr_info("name: %s p->name: %s p->driver_name: %s\n", name, p->name, p->driver_name); - if (strncmp(name, p->name, len) != 0) - continue; - stp = str; - if (*stp == ',') - stp++; - if (*stp == '\0') - stp = NULL; - - if (tty_line >= 0 && tty_line < p->num && p->ops && - p->ops->poll_init && !p->ops->poll_init(p, tty_line, stp)) { - res = tty_driver_kref_get(p); - *line = tty_line; - break; - } - } - mutex_unlock(&tty_mutex); - - return res; -} -EXPORT_SYMBOL_GPL(tty_find_polling_driver); -#endif - -/** - * tty_check_change - check for POSIX terminal changes - * @tty: tty to check - * - * If we try to write to, or set the state of, a terminal and we're - * not in the foreground, send a SIGTTOU. If the signal is blocked or - * ignored, go ahead and perform the operation. (POSIX 7.2) - * - * Locking: ctrl_lock - */ - -int tty_check_change(struct tty_struct *tty) -{ - unsigned long flags; - int ret = 0; - - if (current->signal->tty != tty) - return 0; - - spin_lock_irqsave(&tty->ctrl_lock, flags); - - if (!tty->pgrp) { - printk(KERN_WARNING "tty_check_change: tty->pgrp == NULL!\n"); - goto out_unlock; - } - if (task_pgrp(current) == tty->pgrp) - goto out_unlock; - spin_unlock_irqrestore(&tty->ctrl_lock, flags); - if (is_ignored(SIGTTOU)) - goto out; - if (is_current_pgrp_orphaned()) { - ret = -EIO; - goto out; - } - kill_pgrp(task_pgrp(current), SIGTTOU, 1); - set_thread_flag(TIF_SIGPENDING); - ret = -ERESTARTSYS; -out: - return ret; -out_unlock: - spin_unlock_irqrestore(&tty->ctrl_lock, flags); - return ret; -} - -EXPORT_SYMBOL(tty_check_change); - -static ssize_t hung_up_tty_read(struct file *file, char __user *buf, - size_t count, loff_t *ppos) -{ - return 0; -} - -static ssize_t hung_up_tty_write(struct file *file, const char __user *buf, - size_t count, loff_t *ppos) -{ - return -EIO; -} - -/* No kernel lock held - none needed ;) */ -static unsigned int hung_up_tty_poll(struct file *filp, poll_table *wait) -{ - return POLLIN | POLLOUT | POLLERR | POLLHUP | POLLRDNORM | POLLWRNORM; -} - -static long hung_up_tty_ioctl(struct file *file, unsigned int cmd, - unsigned long arg) -{ - return cmd == TIOCSPGRP ? -ENOTTY : -EIO; -} - -static long hung_up_tty_compat_ioctl(struct file *file, - unsigned int cmd, unsigned long arg) -{ - return cmd == TIOCSPGRP ? -ENOTTY : -EIO; -} - -static const struct file_operations tty_fops = { - .llseek = no_llseek, - .read = tty_read, - .write = tty_write, - .poll = tty_poll, - .unlocked_ioctl = tty_ioctl, - .compat_ioctl = tty_compat_ioctl, - .open = tty_open, - .release = tty_release, - .fasync = tty_fasync, -}; - -static const struct file_operations console_fops = { - .llseek = no_llseek, - .read = tty_read, - .write = redirected_tty_write, - .poll = tty_poll, - .unlocked_ioctl = tty_ioctl, - .compat_ioctl = tty_compat_ioctl, - .open = tty_open, - .release = tty_release, - .fasync = tty_fasync, -}; - -static const struct file_operations hung_up_tty_fops = { - .llseek = no_llseek, - .read = hung_up_tty_read, - .write = hung_up_tty_write, - .poll = hung_up_tty_poll, - .unlocked_ioctl = hung_up_tty_ioctl, - .compat_ioctl = hung_up_tty_compat_ioctl, - .release = tty_release, -}; - -static DEFINE_SPINLOCK(redirect_lock); -static struct file *redirect; - -/** - * tty_wakeup - request more data - * @tty: terminal - * - * Internal and external helper for wakeups of tty. This function - * informs the line discipline if present that the driver is ready - * to receive more output data. - */ - -void tty_wakeup(struct tty_struct *tty) -{ - struct tty_ldisc *ld; - - if (test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags)) { - ld = tty_ldisc_ref(tty); - if (ld) { - if (ld->ops->write_wakeup) - ld->ops->write_wakeup(tty); - tty_ldisc_deref(ld); - } - } - wake_up_interruptible_poll(&tty->write_wait, POLLOUT); -} - -EXPORT_SYMBOL_GPL(tty_wakeup); - -/** - * tty_signal_session_leader - sends SIGHUP to session leader - * @tty controlling tty - * @exit_session if non-zero, signal all foreground group processes - * - * Send SIGHUP and SIGCONT to the session leader and its process group. - * Optionally, signal all processes in the foreground process group. - * - * Returns the number of processes in the session with this tty - * as their controlling terminal. This value is used to drop - * tty references for those processes. - */ -static int tty_signal_session_leader(struct tty_struct *tty, int exit_session) -{ - struct task_struct *p; - int refs = 0; - struct pid *tty_pgrp = NULL; - - read_lock(&tasklist_lock); - if (tty->session) { - do_each_pid_task(tty->session, PIDTYPE_SID, p) { - spin_lock_irq(&p->sighand->siglock); - if (p->signal->tty == tty) { - p->signal->tty = NULL; - /* We defer the dereferences outside fo - the tasklist lock */ - refs++; - } - if (!p->signal->leader) { - spin_unlock_irq(&p->sighand->siglock); - continue; - } - __group_send_sig_info(SIGHUP, SEND_SIG_PRIV, p); - __group_send_sig_info(SIGCONT, SEND_SIG_PRIV, p); - put_pid(p->signal->tty_old_pgrp); /* A noop */ - spin_lock(&tty->ctrl_lock); - tty_pgrp = get_pid(tty->pgrp); - if (tty->pgrp) - p->signal->tty_old_pgrp = get_pid(tty->pgrp); - spin_unlock(&tty->ctrl_lock); - spin_unlock_irq(&p->sighand->siglock); - } while_each_pid_task(tty->session, PIDTYPE_SID, p); - } - read_unlock(&tasklist_lock); - - if (tty_pgrp) { - if (exit_session) - kill_pgrp(tty_pgrp, SIGHUP, exit_session); - put_pid(tty_pgrp); - } - - return refs; -} - -/** - * __tty_hangup - actual handler for hangup events - * @work: tty device - * - * This can be called by a "kworker" kernel thread. That is process - * synchronous but doesn't hold any locks, so we need to make sure we - * have the appropriate locks for what we're doing. - * - * The hangup event clears any pending redirections onto the hung up - * device. It ensures future writes will error and it does the needed - * line discipline hangup and signal delivery. The tty object itself - * remains intact. - * - * Locking: - * BTM - * redirect lock for undoing redirection - * file list lock for manipulating list of ttys - * tty_ldiscs_lock from called functions - * termios_mutex resetting termios data - * tasklist_lock to walk task list for hangup event - * ->siglock to protect ->signal/->sighand - */ -static void __tty_hangup(struct tty_struct *tty, int exit_session) -{ - struct file *cons_filp = NULL; - struct file *filp, *f = NULL; - struct tty_file_private *priv; - int closecount = 0, n; - int refs; - - if (!tty) - return; - - - spin_lock(&redirect_lock); - if (redirect && file_tty(redirect) == tty) { - f = redirect; - redirect = NULL; - } - spin_unlock(&redirect_lock); - - tty_lock(tty); - - /* some functions below drop BTM, so we need this bit */ - set_bit(TTY_HUPPING, &tty->flags); - - /* inuse_filps is protected by the single tty lock, - this really needs to change if we want to flush the - workqueue with the lock held */ - check_tty_count(tty, "tty_hangup"); - - spin_lock(&tty_files_lock); - /* This breaks for file handles being sent over AF_UNIX sockets ? */ - list_for_each_entry(priv, &tty->tty_files, list) { - filp = priv->file; - if (filp->f_op->write == redirected_tty_write) - cons_filp = filp; - if (filp->f_op->write != tty_write) - continue; - closecount++; - __tty_fasync(-1, filp, 0); /* can't block */ - filp->f_op = &hung_up_tty_fops; - } - spin_unlock(&tty_files_lock); - - refs = tty_signal_session_leader(tty, exit_session); - /* Account for the p->signal references we killed */ - while (refs--) - tty_kref_put(tty); - - /* - * it drops BTM and thus races with reopen - * we protect the race by TTY_HUPPING - */ - tty_ldisc_hangup(tty); - - spin_lock_irq(&tty->ctrl_lock); - clear_bit(TTY_THROTTLED, &tty->flags); - clear_bit(TTY_PUSH, &tty->flags); - clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); - put_pid(tty->session); - put_pid(tty->pgrp); - tty->session = NULL; - tty->pgrp = NULL; - tty->ctrl_status = 0; - spin_unlock_irq(&tty->ctrl_lock); - - /* - * If one of the devices matches a console pointer, we - * cannot just call hangup() because that will cause - * tty->count and state->count to go out of sync. - * So we just call close() the right number of times. - */ - if (cons_filp) { - if (tty->ops->close) - for (n = 0; n < closecount; n++) - tty->ops->close(tty, cons_filp); - } else if (tty->ops->hangup) - (tty->ops->hangup)(tty); - /* - * We don't want to have driver/ldisc interactions beyond - * the ones we did here. The driver layer expects no - * calls after ->hangup() from the ldisc side. However we - * can't yet guarantee all that. - */ - set_bit(TTY_HUPPED, &tty->flags); - clear_bit(TTY_HUPPING, &tty->flags); - - tty_unlock(tty); - - if (f) - fput(f); -} - -static void do_tty_hangup(struct work_struct *work) -{ - struct tty_struct *tty = - container_of(work, struct tty_struct, hangup_work); - - __tty_hangup(tty, 0); -} - -/** - * tty_hangup - trigger a hangup event - * @tty: tty to hangup - * - * A carrier loss (virtual or otherwise) has occurred on this like - * schedule a hangup sequence to run after this event. - */ - -void tty_hangup(struct tty_struct *tty) -{ -#ifdef TTY_DEBUG_HANGUP - char buf[64]; - printk(KERN_DEBUG "%s hangup...\n", tty_name(tty, buf)); -#endif - schedule_work(&tty->hangup_work); -} - -EXPORT_SYMBOL(tty_hangup); - -/** - * tty_vhangup - process vhangup - * @tty: tty to hangup - * - * The user has asked via system call for the terminal to be hung up. - * We do this synchronously so that when the syscall returns the process - * is complete. That guarantee is necessary for security reasons. - */ - -void tty_vhangup(struct tty_struct *tty) -{ -#ifdef TTY_DEBUG_HANGUP - char buf[64]; - - printk(KERN_DEBUG "%s vhangup...\n", tty_name(tty, buf)); -#endif - __tty_hangup(tty, 0); -} - -EXPORT_SYMBOL(tty_vhangup); - - -/** - * tty_vhangup_self - process vhangup for own ctty - * - * Perform a vhangup on the current controlling tty - */ - -void tty_vhangup_self(void) -{ - struct tty_struct *tty; - - tty = get_current_tty(); - if (tty) { - tty_vhangup(tty); - tty_kref_put(tty); - } -} - -/** - * tty_vhangup_session - hangup session leader exit - * @tty: tty to hangup - * - * The session leader is exiting and hanging up its controlling terminal. - * Every process in the foreground process group is signalled SIGHUP. - * - * We do this synchronously so that when the syscall returns the process - * is complete. That guarantee is necessary for security reasons. - */ - -static void tty_vhangup_session(struct tty_struct *tty) -{ -#ifdef TTY_DEBUG_HANGUP - char buf[64]; - - printk(KERN_DEBUG "%s vhangup session...\n", tty_name(tty, buf)); -#endif - __tty_hangup(tty, 1); -} - -/** - * tty_hung_up_p - was tty hung up - * @filp: file pointer of tty - * - * Return true if the tty has been subject to a vhangup or a carrier - * loss - */ - -int tty_hung_up_p(struct file *filp) -{ - return (filp->f_op == &hung_up_tty_fops); -} - -EXPORT_SYMBOL(tty_hung_up_p); - -static void session_clear_tty(struct pid *session) -{ - struct task_struct *p; - do_each_pid_task(session, PIDTYPE_SID, p) { - proc_clear_tty(p); - } while_each_pid_task(session, PIDTYPE_SID, p); -} - -/** - * disassociate_ctty - disconnect controlling tty - * @on_exit: true if exiting so need to "hang up" the session - * - * This function is typically called only by the session leader, when - * it wants to disassociate itself from its controlling tty. - * - * It performs the following functions: - * (1) Sends a SIGHUP and SIGCONT to the foreground process group - * (2) Clears the tty from being controlling the session - * (3) Clears the controlling tty for all processes in the - * session group. - * - * The argument on_exit is set to 1 if called when a process is - * exiting; it is 0 if called by the ioctl TIOCNOTTY. - * - * Locking: - * BTM is taken for hysterical raisins, and held when - * called from no_tty(). - * tty_mutex is taken to protect tty - * ->siglock is taken to protect ->signal/->sighand - * tasklist_lock is taken to walk process list for sessions - * ->siglock is taken to protect ->signal/->sighand - */ - -void disassociate_ctty(int on_exit) -{ - struct tty_struct *tty; - - if (!current->signal->leader) - return; - - tty = get_current_tty(); - if (tty) { - if (on_exit && tty->driver->type != TTY_DRIVER_TYPE_PTY) { - tty_vhangup_session(tty); - } else { - struct pid *tty_pgrp = tty_get_pgrp(tty); - if (tty_pgrp) { - kill_pgrp(tty_pgrp, SIGHUP, on_exit); - if (!on_exit) - kill_pgrp(tty_pgrp, SIGCONT, on_exit); - put_pid(tty_pgrp); - } - } - tty_kref_put(tty); - - } else if (on_exit) { - struct pid *old_pgrp; - spin_lock_irq(¤t->sighand->siglock); - old_pgrp = current->signal->tty_old_pgrp; - current->signal->tty_old_pgrp = NULL; - spin_unlock_irq(¤t->sighand->siglock); - if (old_pgrp) { - kill_pgrp(old_pgrp, SIGHUP, on_exit); - kill_pgrp(old_pgrp, SIGCONT, on_exit); - put_pid(old_pgrp); - } - return; - } - - spin_lock_irq(¤t->sighand->siglock); - put_pid(current->signal->tty_old_pgrp); - current->signal->tty_old_pgrp = NULL; - spin_unlock_irq(¤t->sighand->siglock); - - tty = get_current_tty(); - if (tty) { - unsigned long flags; - spin_lock_irqsave(&tty->ctrl_lock, flags); - put_pid(tty->session); - put_pid(tty->pgrp); - tty->session = NULL; - tty->pgrp = NULL; - spin_unlock_irqrestore(&tty->ctrl_lock, flags); - tty_kref_put(tty); - } else { -#ifdef TTY_DEBUG_HANGUP - printk(KERN_DEBUG "error attempted to write to tty [0x%p]" - " = NULL", tty); -#endif - } - - /* Now clear signal->tty under the lock */ - read_lock(&tasklist_lock); - session_clear_tty(task_session(current)); - read_unlock(&tasklist_lock); -} - -/** - * - * no_tty - Ensure the current process does not have a controlling tty - */ -void no_tty(void) -{ - /* FIXME: Review locking here. The tty_lock never covered any race - between a new association and proc_clear_tty but possible we need - to protect against this anyway */ - struct task_struct *tsk = current; - disassociate_ctty(0); - proc_clear_tty(tsk); -} - - -/** - * stop_tty - propagate flow control - * @tty: tty to stop - * - * Perform flow control to the driver. For PTY/TTY pairs we - * must also propagate the TIOCKPKT status. May be called - * on an already stopped device and will not re-call the driver - * method. - * - * This functionality is used by both the line disciplines for - * halting incoming flow and by the driver. It may therefore be - * called from any context, may be under the tty atomic_write_lock - * but not always. - * - * Locking: - * Uses the tty control lock internally - */ - -void stop_tty(struct tty_struct *tty) -{ - unsigned long flags; - spin_lock_irqsave(&tty->ctrl_lock, flags); - if (tty->stopped) { - spin_unlock_irqrestore(&tty->ctrl_lock, flags); - return; - } - tty->stopped = 1; - if (tty->link && tty->link->packet) { - tty->ctrl_status &= ~TIOCPKT_START; - tty->ctrl_status |= TIOCPKT_STOP; - wake_up_interruptible_poll(&tty->link->read_wait, POLLIN); - } - spin_unlock_irqrestore(&tty->ctrl_lock, flags); - if (tty->ops->stop) - (tty->ops->stop)(tty); -} - -EXPORT_SYMBOL(stop_tty); - -/** - * start_tty - propagate flow control - * @tty: tty to start - * - * Start a tty that has been stopped if at all possible. Perform - * any necessary wakeups and propagate the TIOCPKT status. If this - * is the tty was previous stopped and is being started then the - * driver start method is invoked and the line discipline woken. - * - * Locking: - * ctrl_lock - */ - -void start_tty(struct tty_struct *tty) -{ - unsigned long flags; - spin_lock_irqsave(&tty->ctrl_lock, flags); - if (!tty->stopped || tty->flow_stopped) { - spin_unlock_irqrestore(&tty->ctrl_lock, flags); - return; - } - tty->stopped = 0; - if (tty->link && tty->link->packet) { - tty->ctrl_status &= ~TIOCPKT_STOP; - tty->ctrl_status |= TIOCPKT_START; - wake_up_interruptible_poll(&tty->link->read_wait, POLLIN); - } - spin_unlock_irqrestore(&tty->ctrl_lock, flags); - if (tty->ops->start) - (tty->ops->start)(tty); - /* If we have a running line discipline it may need kicking */ - tty_wakeup(tty); -} - -EXPORT_SYMBOL(start_tty); - -/* We limit tty time update visibility to every 8 seconds or so. */ -static void tty_update_time(struct timespec *time) -{ - unsigned long sec = get_seconds() & ~7; - if ((long)(sec - time->tv_sec) > 0) - time->tv_sec = sec; -} - -/** - * tty_read - read method for tty device files - * @file: pointer to tty file - * @buf: user buffer - * @count: size of user buffer - * @ppos: unused - * - * Perform the read system call function on this terminal device. Checks - * for hung up devices before calling the line discipline method. - * - * Locking: - * Locks the line discipline internally while needed. Multiple - * read calls may be outstanding in parallel. - */ - -static ssize_t tty_read(struct file *file, char __user *buf, size_t count, - loff_t *ppos) -{ - int i; - struct inode *inode = file_inode(file); - struct tty_struct *tty = file_tty(file); - struct tty_ldisc *ld; - - if (tty_paranoia_check(tty, inode, "tty_read")) - return -EIO; - if (!tty || (test_bit(TTY_IO_ERROR, &tty->flags))) - return -EIO; - - /* We want to wait for the line discipline to sort out in this - situation */ - ld = tty_ldisc_ref_wait(tty); - if (ld->ops->read) - i = (ld->ops->read)(tty, file, buf, count); - else - i = -EIO; - tty_ldisc_deref(ld); - - if (i > 0) - tty_update_time(&inode->i_atime); - - return i; -} - -void tty_write_unlock(struct tty_struct *tty) - __releases(&tty->atomic_write_lock) -{ - mutex_unlock(&tty->atomic_write_lock); - wake_up_interruptible_poll(&tty->write_wait, POLLOUT); -} - -int tty_write_lock(struct tty_struct *tty, int ndelay) - __acquires(&tty->atomic_write_lock) -{ - if (!mutex_trylock(&tty->atomic_write_lock)) { - if (ndelay) - return -EAGAIN; - if (mutex_lock_interruptible(&tty->atomic_write_lock)) - return -ERESTARTSYS; - } - return 0; -} - -/* - * Split writes up in sane blocksizes to avoid - * denial-of-service type attacks - */ -static inline ssize_t do_tty_write( - ssize_t (*write)(struct tty_struct *, struct file *, const unsigned char *, size_t), - struct tty_struct *tty, - struct file *file, - const char __user *buf, - size_t count) -{ - ssize_t ret, written = 0; - unsigned int chunk; - - ret = tty_write_lock(tty, file->f_flags & O_NDELAY); - if (ret < 0) - return ret; - - /* - * We chunk up writes into a temporary buffer. This - * simplifies low-level drivers immensely, since they - * don't have locking issues and user mode accesses. - * - * But if TTY_NO_WRITE_SPLIT is set, we should use a - * big chunk-size.. - * - * The default chunk-size is 2kB, because the NTTY - * layer has problems with bigger chunks. It will - * claim to be able to handle more characters than - * it actually does. - * - * FIXME: This can probably go away now except that 64K chunks - * are too likely to fail unless switched to vmalloc... - */ - chunk = 2048; - if (test_bit(TTY_NO_WRITE_SPLIT, &tty->flags)) - chunk = 65536; - if (count < chunk) - chunk = count; - - /* write_buf/write_cnt is protected by the atomic_write_lock mutex */ - if (tty->write_cnt < chunk) { - unsigned char *buf_chunk; - - if (chunk < 1024) - chunk = 1024; - - buf_chunk = kmalloc(chunk, GFP_KERNEL); - if (!buf_chunk) { - ret = -ENOMEM; - goto out; - } - kfree(tty->write_buf); - tty->write_cnt = chunk; - tty->write_buf = buf_chunk; - } - - /* Do the write .. */ - for (;;) { - size_t size = count; - if (size > chunk) - size = chunk; - ret = -EFAULT; - if (copy_from_user(tty->write_buf, buf, size)) - break; - ret = write(tty, file, tty->write_buf, size); - if (ret <= 0) - break; - written += ret; - buf += ret; - count -= ret; - if (!count) - break; - ret = -ERESTARTSYS; - if (signal_pending(current)) - break; - cond_resched(); - } - if (written) { - tty_update_time(&file_inode(file)->i_mtime); - ret = written; - } -out: - tty_write_unlock(tty); - return ret; -} - -/** - * tty_write_message - write a message to a certain tty, not just the console. - * @tty: the destination tty_struct - * @msg: the message to write - * - * This is used for messages that need to be redirected to a specific tty. - * We don't put it into the syslog queue right now maybe in the future if - * really needed. - * - * We must still hold the BTM and test the CLOSING flag for the moment. - */ - -void tty_write_message(struct tty_struct *tty, char *msg) -{ - if (tty) { - mutex_lock(&tty->atomic_write_lock); - tty_lock(tty); - if (tty->ops->write && !test_bit(TTY_CLOSING, &tty->flags)) { - tty_unlock(tty); - tty->ops->write(tty, msg, strlen(msg)); - } else - tty_unlock(tty); - tty_write_unlock(tty); - } - return; -} - - -/** - * tty_write - write method for tty device file - * @file: tty file pointer - * @buf: user data to write - * @count: bytes to write - * @ppos: unused - * - * Write data to a tty device via the line discipline. - * - * Locking: - * Locks the line discipline as required - * Writes to the tty driver are serialized by the atomic_write_lock - * and are then processed in chunks to the device. The line discipline - * write method will not be invoked in parallel for each device. - */ - -static ssize_t tty_write(struct file *file, const char __user *buf, - size_t count, loff_t *ppos) -{ - struct tty_struct *tty = file_tty(file); - struct tty_ldisc *ld; - ssize_t ret; - - if (tty_paranoia_check(tty, file_inode(file), "tty_write")) - return -EIO; - if (!tty || !tty->ops->write || - (test_bit(TTY_IO_ERROR, &tty->flags))) - return -EIO; - /* Short term debug to catch buggy drivers */ - if (tty->ops->write_room == NULL) - printk(KERN_ERR "tty driver %s lacks a write_room method.\n", - tty->driver->name); - ld = tty_ldisc_ref_wait(tty); - if (!ld->ops->write) - ret = -EIO; - else - ret = do_tty_write(ld->ops->write, tty, file, buf, count); - tty_ldisc_deref(ld); - return ret; -} - -ssize_t redirected_tty_write(struct file *file, const char __user *buf, - size_t count, loff_t *ppos) -{ - struct file *p = NULL; - - spin_lock(&redirect_lock); - if (redirect) - p = get_file(redirect); - spin_unlock(&redirect_lock); - - if (p) { - ssize_t res; - res = vfs_write(p, buf, count, &p->f_pos); - fput(p); - return res; - } - return tty_write(file, buf, count, ppos); -} - -static char ptychar[] = "pqrstuvwxyzabcde"; - -/** - * pty_line_name - generate name for a pty - * @driver: the tty driver in use - * @index: the minor number - * @p: output buffer of at least 6 bytes - * - * Generate a name from a driver reference and write it to the output - * buffer. - * - * Locking: None - */ -static void pty_line_name(struct tty_driver *driver, int index, char *p) -{ - int i = index + driver->name_base; - /* ->name is initialized to "ttyp", but "tty" is expected */ - sprintf(p, "%s%c%x", - driver->subtype == PTY_TYPE_SLAVE ? "tty" : driver->name, - ptychar[i >> 4 & 0xf], i & 0xf); -} - -/** - * tty_line_name - generate name for a tty - * @driver: the tty driver in use - * @index: the minor number - * @p: output buffer of at least 7 bytes - * - * Generate a name from a driver reference and write it to the output - * buffer. - * - * Locking: None - */ -static ssize_t tty_line_name(struct tty_driver *driver, int index, char *p) -{ - if (driver->flags & TTY_DRIVER_UNNUMBERED_NODE) - return sprintf(p, "%s", driver->name); - else - return sprintf(p, "%s%d", driver->name, - index + driver->name_base); -} - -/** - * tty_driver_lookup_tty() - find an existing tty, if any - * @driver: the driver for the tty - * @idx: the minor number - * - * Return the tty, if found or ERR_PTR() otherwise. - * - * Locking: tty_mutex must be held. If tty is found, the mutex must - * be held until the 'fast-open' is also done. Will change once we - * have refcounting in the driver and per driver locking - */ -static struct tty_struct *tty_driver_lookup_tty(struct tty_driver *driver, - struct inode *inode, int idx) -{ - if (driver->ops->lookup) - return driver->ops->lookup(driver, inode, idx); - - return driver->ttys[idx]; -} - -/** - * tty_init_termios - helper for termios setup - * @tty: the tty to set up - * - * Initialise the termios structures for this tty. Thus runs under - * the tty_mutex currently so we can be relaxed about ordering. - */ - -int tty_init_termios(struct tty_struct *tty) -{ - struct ktermios *tp; - int idx = tty->index; - - if (tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) - tty->termios = tty->driver->init_termios; - else { - /* Check for lazy saved data */ - tp = tty->driver->termios[idx]; - if (tp != NULL) - tty->termios = *tp; - else - tty->termios = tty->driver->init_termios; - } - /* Compatibility until drivers always set this */ - tty->termios.c_ispeed = tty_termios_input_baud_rate(&tty->termios); - tty->termios.c_ospeed = tty_termios_baud_rate(&tty->termios); - return 0; -} -EXPORT_SYMBOL_GPL(tty_init_termios); - -int tty_standard_install(struct tty_driver *driver, struct tty_struct *tty) -{ - int ret = tty_init_termios(tty); - if (ret) - return ret; - - tty_driver_kref_get(driver); - tty->count++; - driver->ttys[tty->index] = tty; - return 0; -} -EXPORT_SYMBOL_GPL(tty_standard_install); - -/** - * tty_driver_install_tty() - install a tty entry in the driver - * @driver: the driver for the tty - * @tty: the tty - * - * Install a tty object into the driver tables. The tty->index field - * will be set by the time this is called. This method is responsible - * for ensuring any need additional structures are allocated and - * configured. - * - * Locking: tty_mutex for now - */ -static int tty_driver_install_tty(struct tty_driver *driver, - struct tty_struct *tty) -{ - return driver->ops->install ? driver->ops->install(driver, tty) : - tty_standard_install(driver, tty); -} - -/** - * tty_driver_remove_tty() - remove a tty from the driver tables - * @driver: the driver for the tty - * @idx: the minor number - * - * Remvoe a tty object from the driver tables. The tty->index field - * will be set by the time this is called. - * - * Locking: tty_mutex for now - */ -void tty_driver_remove_tty(struct tty_driver *driver, struct tty_struct *tty) -{ - if (driver->ops->remove) - driver->ops->remove(driver, tty); - else - driver->ttys[tty->index] = NULL; -} - -/* - * tty_reopen() - fast re-open of an open tty - * @tty - the tty to open - * - * Return 0 on success, -errno on error. - * - * Locking: tty_mutex must be held from the time the tty was found - * till this open completes. - */ -static int tty_reopen(struct tty_struct *tty) -{ - struct tty_driver *driver = tty->driver; - - if (test_bit(TTY_CLOSING, &tty->flags) || - test_bit(TTY_HUPPING, &tty->flags)) - return -EIO; - - if (driver->type == TTY_DRIVER_TYPE_PTY && - driver->subtype == PTY_TYPE_MASTER) { - /* - * special case for PTY masters: only one open permitted, - * and the slave side open count is incremented as well. - */ - if (tty->count) - return -EIO; - - tty->link->count++; - } - tty->count++; - - WARN_ON(!tty->ldisc); - - return 0; -} - -/** - * tty_init_dev - initialise a tty device - * @driver: tty driver we are opening a device on - * @idx: device index - * @ret_tty: returned tty structure - * - * Prepare a tty device. This may not be a "new" clean device but - * could also be an active device. The pty drivers require special - * handling because of this. - * - * Locking: - * The function is called under the tty_mutex, which - * protects us from the tty struct or driver itself going away. - * - * On exit the tty device has the line discipline attached and - * a reference count of 1. If a pair was created for pty/tty use - * and the other was a pty master then it too has a reference count of 1. - * - * WSH 06/09/97: Rewritten to remove races and properly clean up after a - * failed open. The new code protects the open with a mutex, so it's - * really quite straightforward. The mutex locking can probably be - * relaxed for the (most common) case of reopening a tty. - */ - -struct tty_struct *tty_init_dev(struct tty_driver *driver, int idx) -{ - struct tty_struct *tty; - int retval; - - /* - * First time open is complex, especially for PTY devices. - * This code guarantees that either everything succeeds and the - * TTY is ready for operation, or else the table slots are vacated - * and the allocated memory released. (Except that the termios - * and locked termios may be retained.) - */ - - if (!try_module_get(driver->owner)) - return ERR_PTR(-ENODEV); - - tty = alloc_tty_struct(); - if (!tty) { - retval = -ENOMEM; - goto err_module_put; - } - initialize_tty_struct(tty, driver, idx); - - tty_lock(tty); - retval = tty_driver_install_tty(driver, tty); - if (retval < 0) - goto err_deinit_tty; - - if (!tty->port) - tty->port = driver->ports[idx]; - - WARN_RATELIMIT(!tty->port, - "%s: %s driver does not set tty->port. This will crash the kernel later. Fix the driver!\n", - __func__, tty->driver->name); - - tty->port->itty = tty; - - /* - * Structures all installed ... call the ldisc open routines. - * If we fail here just call release_tty to clean up. No need - * to decrement the use counts, as release_tty doesn't care. - */ - retval = tty_ldisc_setup(tty, tty->link); - if (retval) - goto err_release_tty; - /* Return the tty locked so that it cannot vanish under the caller */ - return tty; - -err_deinit_tty: - tty_unlock(tty); - deinitialize_tty_struct(tty); - free_tty_struct(tty); -err_module_put: - module_put(driver->owner); - return ERR_PTR(retval); - - /* call the tty release_tty routine to clean out this slot */ -err_release_tty: - tty_unlock(tty); - printk_ratelimited(KERN_INFO "tty_init_dev: ldisc open failed, " - "clearing slot %d\n", idx); - release_tty(tty, idx); - return ERR_PTR(retval); -} - -void tty_free_termios(struct tty_struct *tty) -{ - struct ktermios *tp; - int idx = tty->index; - - /* If the port is going to reset then it has no termios to save */ - if (tty->driver->flags & TTY_DRIVER_RESET_TERMIOS) - return; - - /* Stash the termios data */ - tp = tty->driver->termios[idx]; - if (tp == NULL) { - tp = kmalloc(sizeof(struct ktermios), GFP_KERNEL); - if (tp == NULL) { - pr_warn("tty: no memory to save termios state.\n"); - return; - } - tty->driver->termios[idx] = tp; - } - *tp = tty->termios; -} -EXPORT_SYMBOL(tty_free_termios); - -/** - * tty_flush_works - flush all works of a tty - * @tty: tty device to flush works for - * - * Sync flush all works belonging to @tty. - */ -static void tty_flush_works(struct tty_struct *tty) -{ - flush_work(&tty->SAK_work); - flush_work(&tty->hangup_work); -} - -/** - * release_one_tty - release tty structure memory - * @kref: kref of tty we are obliterating - * - * Releases memory associated with a tty structure, and clears out the - * driver table slots. This function is called when a device is no longer - * in use. It also gets called when setup of a device fails. - * - * Locking: - * takes the file list lock internally when working on the list - * of ttys that the driver keeps. - * - * This method gets called from a work queue so that the driver private - * cleanup ops can sleep (needed for USB at least) - */ -static void release_one_tty(struct work_struct *work) -{ - struct tty_struct *tty = - container_of(work, struct tty_struct, hangup_work); - struct tty_driver *driver = tty->driver; - - if (tty->ops->cleanup) - tty->ops->cleanup(tty); - - tty->magic = 0; - tty_driver_kref_put(driver); - module_put(driver->owner); - - spin_lock(&tty_files_lock); - list_del_init(&tty->tty_files); - spin_unlock(&tty_files_lock); - - put_pid(tty->pgrp); - put_pid(tty->session); - free_tty_struct(tty); -} - -static void queue_release_one_tty(struct kref *kref) -{ - struct tty_struct *tty = container_of(kref, struct tty_struct, kref); - - /* The hangup queue is now free so we can reuse it rather than - waste a chunk of memory for each port */ - INIT_WORK(&tty->hangup_work, release_one_tty); - schedule_work(&tty->hangup_work); -} - -/** - * tty_kref_put - release a tty kref - * @tty: tty device - * - * Release a reference to a tty device and if need be let the kref - * layer destruct the object for us - */ - -void tty_kref_put(struct tty_struct *tty) -{ - if (tty) - kref_put(&tty->kref, queue_release_one_tty); -} -EXPORT_SYMBOL(tty_kref_put); - -/** - * release_tty - release tty structure memory - * - * Release both @tty and a possible linked partner (think pty pair), - * and decrement the refcount of the backing module. - * - * Locking: - * tty_mutex - * takes the file list lock internally when working on the list - * of ttys that the driver keeps. - * - */ -static void release_tty(struct tty_struct *tty, int idx) -{ - /* This should always be true but check for the moment */ - WARN_ON(tty->index != idx); - WARN_ON(!mutex_is_locked(&tty_mutex)); - if (tty->ops->shutdown) - tty->ops->shutdown(tty); - tty_free_termios(tty); - tty_driver_remove_tty(tty->driver, tty); - tty->port->itty = NULL; - if (tty->link) - tty->link->port->itty = NULL; - cancel_work_sync(&tty->port->buf.work); - - if (tty->link) - tty_kref_put(tty->link); - tty_kref_put(tty); -} - -/** - * tty_release_checks - check a tty before real release - * @tty: tty to check - * @o_tty: link of @tty (if any) - * @idx: index of the tty - * - * Performs some paranoid checking before true release of the @tty. - * This is a no-op unless TTY_PARANOIA_CHECK is defined. - */ -static int tty_release_checks(struct tty_struct *tty, struct tty_struct *o_tty, - int idx) -{ -#ifdef TTY_PARANOIA_CHECK - if (idx < 0 || idx >= tty->driver->num) { - printk(KERN_DEBUG "%s: bad idx when trying to free (%s)\n", - __func__, tty->name); - return -1; - } - - /* not much to check for devpts */ - if (tty->driver->flags & TTY_DRIVER_DEVPTS_MEM) - return 0; - - if (tty != tty->driver->ttys[idx]) { - printk(KERN_DEBUG "%s: driver.table[%d] not tty for (%s)\n", - __func__, idx, tty->name); - return -1; - } - if (tty->driver->other) { - if (o_tty != tty->driver->other->ttys[idx]) { - printk(KERN_DEBUG "%s: other->table[%d] not o_tty for (%s)\n", - __func__, idx, tty->name); - return -1; - } - if (o_tty->link != tty) { - printk(KERN_DEBUG "%s: bad pty pointers\n", __func__); - return -1; - } - } -#endif - return 0; -} - -/** - * tty_release - vfs callback for close - * @inode: inode of tty - * @filp: file pointer for handle to tty - * - * Called the last time each file handle is closed that references - * this tty. There may however be several such references. - * - * Locking: - * Takes bkl. See tty_release_dev - * - * Even releasing the tty structures is a tricky business.. We have - * to be very careful that the structures are all released at the - * same time, as interrupts might otherwise get the wrong pointers. - * - * WSH 09/09/97: rewritten to avoid some nasty race conditions that could - * lead to double frees or releasing memory still in use. - */ - -int tty_release(struct inode *inode, struct file *filp) -{ - struct tty_struct *tty = file_tty(filp); - struct tty_struct *o_tty; - int pty_master, tty_closing, o_tty_closing, do_sleep; - int idx; - char buf[64]; - - if (tty_paranoia_check(tty, inode, __func__)) - return 0; - - tty_lock(tty); - check_tty_count(tty, __func__); - - __tty_fasync(-1, filp, 0); - - idx = tty->index; - pty_master = (tty->driver->type == TTY_DRIVER_TYPE_PTY && - tty->driver->subtype == PTY_TYPE_MASTER); - /* Review: parallel close */ - o_tty = tty->link; - - if (tty_release_checks(tty, o_tty, idx)) { - tty_unlock(tty); - return 0; - } - -#ifdef TTY_DEBUG_HANGUP - printk(KERN_DEBUG "%s: %s (tty count=%d)...\n", __func__, - tty_name(tty, buf), tty->count); -#endif - - if (tty->ops->close) - tty->ops->close(tty, filp); - - tty_unlock(tty); - /* - * Sanity check: if tty->count is going to zero, there shouldn't be - * any waiters on tty->read_wait or tty->write_wait. We test the - * wait queues and kick everyone out _before_ actually starting to - * close. This ensures that we won't block while releasing the tty - * structure. - * - * The test for the o_tty closing is necessary, since the master and - * slave sides may close in any order. If the slave side closes out - * first, its count will be one, since the master side holds an open. - * Thus this test wouldn't be triggered at the time the slave closes, - * so we do it now. - * - * Note that it's possible for the tty to be opened again while we're - * flushing out waiters. By recalculating the closing flags before - * each iteration we avoid any problems. - */ - while (1) { - /* Guard against races with tty->count changes elsewhere and - opens on /dev/tty */ - - mutex_lock(&tty_mutex); - tty_lock_pair(tty, o_tty); - tty_closing = tty->count <= 1; - o_tty_closing = o_tty && - (o_tty->count <= (pty_master ? 1 : 0)); - do_sleep = 0; - - if (tty_closing) { - if (waitqueue_active(&tty->read_wait)) { - wake_up_poll(&tty->read_wait, POLLIN); - do_sleep++; - } - if (waitqueue_active(&tty->write_wait)) { - wake_up_poll(&tty->write_wait, POLLOUT); - do_sleep++; - } - } - if (o_tty_closing) { - if (waitqueue_active(&o_tty->read_wait)) { - wake_up_poll(&o_tty->read_wait, POLLIN); - do_sleep++; - } - if (waitqueue_active(&o_tty->write_wait)) { - wake_up_poll(&o_tty->write_wait, POLLOUT); - do_sleep++; - } - } - if (!do_sleep) - break; - - printk(KERN_WARNING "%s: %s: read/write wait queue active!\n", - __func__, tty_name(tty, buf)); - tty_unlock_pair(tty, o_tty); - mutex_unlock(&tty_mutex); - schedule(); - } - - /* - * The closing flags are now consistent with the open counts on - * both sides, and we've completed the last operation that could - * block, so it's safe to proceed with closing. - * - * We must *not* drop the tty_mutex until we ensure that a further - * entry into tty_open can not pick up this tty. - */ - if (pty_master) { - if (--o_tty->count < 0) { - printk(KERN_WARNING "%s: bad pty slave count (%d) for %s\n", - __func__, o_tty->count, tty_name(o_tty, buf)); - o_tty->count = 0; - } - } - if (--tty->count < 0) { - printk(KERN_WARNING "%s: bad tty->count (%d) for %s\n", - __func__, tty->count, tty_name(tty, buf)); - tty->count = 0; - } - - /* - * We've decremented tty->count, so we need to remove this file - * descriptor off the tty->tty_files list; this serves two - * purposes: - * - check_tty_count sees the correct number of file descriptors - * associated with this tty. - * - do_tty_hangup no longer sees this file descriptor as - * something that needs to be handled for hangups. - */ - tty_del_file(filp); - - /* - * Perform some housekeeping before deciding whether to return. - * - * Set the TTY_CLOSING flag if this was the last open. In the - * case of a pty we may have to wait around for the other side - * to close, and TTY_CLOSING makes sure we can't be reopened. - */ - if (tty_closing) - set_bit(TTY_CLOSING, &tty->flags); - if (o_tty_closing) - set_bit(TTY_CLOSING, &o_tty->flags); - - /* - * If _either_ side is closing, make sure there aren't any - * processes that still think tty or o_tty is their controlling - * tty. - */ - if (tty_closing || o_tty_closing) { - read_lock(&tasklist_lock); - session_clear_tty(tty->session); - if (o_tty) - session_clear_tty(o_tty->session); - read_unlock(&tasklist_lock); - } - - mutex_unlock(&tty_mutex); - tty_unlock_pair(tty, o_tty); - /* At this point the TTY_CLOSING flag should ensure a dead tty - cannot be re-opened by a racing opener */ - - /* check whether both sides are closing ... */ - if (!tty_closing || (o_tty && !o_tty_closing)) - return 0; - -#ifdef TTY_DEBUG_HANGUP - printk(KERN_DEBUG "%s: %s: final close\n", __func__, tty_name(tty, buf)); -#endif - /* - * Ask the line discipline code to release its structures - */ - tty_ldisc_release(tty, o_tty); - - /* Wait for pending work before tty destruction commmences */ - tty_flush_works(tty); - if (o_tty) - tty_flush_works(o_tty); - -#ifdef TTY_DEBUG_HANGUP - printk(KERN_DEBUG "%s: %s: freeing structure...\n", __func__, tty_name(tty, buf)); -#endif - /* - * The release_tty function takes care of the details of clearing - * the slots and preserving the termios structure. The tty_unlock_pair - * should be safe as we keep a kref while the tty is locked (so the - * unlock never unlocks a freed tty). - */ - mutex_lock(&tty_mutex); - release_tty(tty, idx); - mutex_unlock(&tty_mutex); - - return 0; -} - -/** - * tty_open_current_tty - get tty of current task for open - * @device: device number - * @filp: file pointer to tty - * @return: tty of the current task iff @device is /dev/tty - * - * We cannot return driver and index like for the other nodes because - * devpts will not work then. It expects inodes to be from devpts FS. - * - * We need to move to returning a refcounted object from all the lookup - * paths including this one. - */ -static struct tty_struct *tty_open_current_tty(dev_t device, struct file *filp) -{ - struct tty_struct *tty; - - if (device != MKDEV(TTYAUX_MAJOR, 0)) - return NULL; - - tty = get_current_tty(); - if (!tty) - return ERR_PTR(-ENXIO); - - filp->f_flags |= O_NONBLOCK; /* Don't let /dev/tty block */ - /* noctty = 1; */ - tty_kref_put(tty); - /* FIXME: we put a reference and return a TTY! */ - /* This is only safe because the caller holds tty_mutex */ - return tty; -} - -/** - * tty_lookup_driver - lookup a tty driver for a given device file - * @device: device number - * @filp: file pointer to tty - * @noctty: set if the device should not become a controlling tty - * @index: index for the device in the @return driver - * @return: driver for this inode (with increased refcount) - * - * If @return is not erroneous, the caller is responsible to decrement the - * refcount by tty_driver_kref_put. - * - * Locking: tty_mutex protects get_tty_driver - */ -static struct tty_driver *tty_lookup_driver(dev_t device, struct file *filp, - int *noctty, int *index) -{ - struct tty_driver *driver; - - switch (device) { -#ifdef CONFIG_VT - case MKDEV(TTY_MAJOR, 0): { - extern struct tty_driver *console_driver; - driver = tty_driver_kref_get(console_driver); - *index = fg_console; - *noctty = 1; - break; - } -#endif - case MKDEV(TTYAUX_MAJOR, 1): { - struct tty_driver *console_driver = console_device(index); - if (console_driver) { - driver = tty_driver_kref_get(console_driver); - if (driver) { - /* Don't let /dev/console block */ - filp->f_flags |= O_NONBLOCK; - *noctty = 1; - break; - } - } - return ERR_PTR(-ENODEV); - } - default: - driver = get_tty_driver(device, index); - if (!driver) - return ERR_PTR(-ENODEV); - break; - } - return driver; -} - -/** - * tty_open - open a tty device - * @inode: inode of device file - * @filp: file pointer to tty - * - * tty_open and tty_release keep up the tty count that contains the - * number of opens done on a tty. We cannot use the inode-count, as - * different inodes might point to the same tty. - * - * Open-counting is needed for pty masters, as well as for keeping - * track of serial lines: DTR is dropped when the last close happens. - * (This is not done solely through tty->count, now. - Ted 1/27/92) - * - * The termios state of a pty is reset on first open so that - * settings don't persist across reuse. - * - * Locking: tty_mutex protects tty, tty_lookup_driver and tty_init_dev. - * tty->count should protect the rest. - * ->siglock protects ->signal/->sighand - * - * Note: the tty_unlock/lock cases without a ref are only safe due to - * tty_mutex - */ - -static int tty_open(struct inode *inode, struct file *filp) -{ - struct tty_struct *tty; - int noctty, retval; - struct tty_driver *driver = NULL; - int index; - dev_t device = inode->i_rdev; - unsigned saved_flags = filp->f_flags; - - nonseekable_open(inode, filp); - -retry_open: - retval = tty_alloc_file(filp); - if (retval) - return -ENOMEM; - - noctty = filp->f_flags & O_NOCTTY; - index = -1; - retval = 0; - - mutex_lock(&tty_mutex); - /* This is protected by the tty_mutex */ - tty = tty_open_current_tty(device, filp); - if (IS_ERR(tty)) { - retval = PTR_ERR(tty); - goto err_unlock; - } else if (!tty) { - driver = tty_lookup_driver(device, filp, &noctty, &index); - if (IS_ERR(driver)) { - retval = PTR_ERR(driver); - goto err_unlock; - } - - /* check whether we're reopening an existing tty */ - tty = tty_driver_lookup_tty(driver, inode, index); - if (IS_ERR(tty)) { - retval = PTR_ERR(tty); - goto err_unlock; - } - } - - if (tty) { - tty_lock(tty); - retval = tty_reopen(tty); - if (retval < 0) { - tty_unlock(tty); - tty = ERR_PTR(retval); - } - } else /* Returns with the tty_lock held for now */ - tty = tty_init_dev(driver, index); - - mutex_unlock(&tty_mutex); - if (driver) - tty_driver_kref_put(driver); - if (IS_ERR(tty)) { - retval = PTR_ERR(tty); - goto err_file; - } - - tty_add_file(tty, filp); - - check_tty_count(tty, __func__); - if (tty->driver->type == TTY_DRIVER_TYPE_PTY && - tty->driver->subtype == PTY_TYPE_MASTER) - noctty = 1; -#ifdef TTY_DEBUG_HANGUP - printk(KERN_DEBUG "%s: opening %s...\n", __func__, tty->name); -#endif - if (tty->ops->open) - retval = tty->ops->open(tty, filp); - else - retval = -ENODEV; - filp->f_flags = saved_flags; - - if (!retval && test_bit(TTY_EXCLUSIVE, &tty->flags) && - !capable(CAP_SYS_ADMIN)) - retval = -EBUSY; - - if (retval) { -#ifdef TTY_DEBUG_HANGUP - printk(KERN_DEBUG "%s: error %d in opening %s...\n", __func__, - retval, tty->name); -#endif - tty_unlock(tty); /* need to call tty_release without BTM */ - tty_release(inode, filp); - if (retval != -ERESTARTSYS) - return retval; - - if (signal_pending(current)) - return retval; - - schedule(); - /* - * Need to reset f_op in case a hangup happened. - */ - if (filp->f_op == &hung_up_tty_fops) - filp->f_op = &tty_fops; - goto retry_open; - } - tty_unlock(tty); - - - mutex_lock(&tty_mutex); - tty_lock(tty); - spin_lock_irq(¤t->sighand->siglock); - if (!noctty && - current->signal->leader && - !current->signal->tty && - tty->session == NULL) - __proc_set_tty(current, tty); - spin_unlock_irq(¤t->sighand->siglock); - tty_unlock(tty); - mutex_unlock(&tty_mutex); - return 0; -err_unlock: - mutex_unlock(&tty_mutex); - /* after locks to avoid deadlock */ - if (!IS_ERR_OR_NULL(driver)) - tty_driver_kref_put(driver); -err_file: - tty_free_file(filp); - return retval; -} - - - -/** - * tty_poll - check tty status - * @filp: file being polled - * @wait: poll wait structures to update - * - * Call the line discipline polling method to obtain the poll - * status of the device. - * - * Locking: locks called line discipline but ldisc poll method - * may be re-entered freely by other callers. - */ - -static unsigned int tty_poll(struct file *filp, poll_table *wait) -{ - struct tty_struct *tty = file_tty(filp); - struct tty_ldisc *ld; - int ret = 0; - - if (tty_paranoia_check(tty, file_inode(filp), "tty_poll")) - return 0; - - ld = tty_ldisc_ref_wait(tty); - if (ld->ops->poll) - ret = (ld->ops->poll)(tty, filp, wait); - tty_ldisc_deref(ld); - return ret; -} - -static int __tty_fasync(int fd, struct file *filp, int on) -{ - struct tty_struct *tty = file_tty(filp); - unsigned long flags; - int retval = 0; - - if (tty_paranoia_check(tty, file_inode(filp), "tty_fasync")) - goto out; - - retval = fasync_helper(fd, filp, on, &tty->fasync); - if (retval <= 0) - goto out; - - if (on) { - enum pid_type type; - struct pid *pid; - if (!waitqueue_active(&tty->read_wait)) - tty->minimum_to_wake = 1; - spin_lock_irqsave(&tty->ctrl_lock, flags); - if (tty->pgrp) { - pid = tty->pgrp; - type = PIDTYPE_PGID; - } else { - pid = task_pid(current); - type = PIDTYPE_PID; - } - get_pid(pid); - spin_unlock_irqrestore(&tty->ctrl_lock, flags); - retval = __f_setown(filp, pid, type, 0); - put_pid(pid); - if (retval) - goto out; - } else { - if (!tty->fasync && !waitqueue_active(&tty->read_wait)) - tty->minimum_to_wake = N_TTY_BUF_SIZE; - } - retval = 0; -out: - return retval; -} - -static int tty_fasync(int fd, struct file *filp, int on) -{ - struct tty_struct *tty = file_tty(filp); - int retval; - - tty_lock(tty); - retval = __tty_fasync(fd, filp, on); - tty_unlock(tty); - - return retval; -} - -/** - * tiocsti - fake input character - * @tty: tty to fake input into - * @p: pointer to character - * - * Fake input to a tty device. Does the necessary locking and - * input management. - * - * FIXME: does not honour flow control ?? - * - * Locking: - * Called functions take tty_ldiscs_lock - * current->signal->tty check is safe without locks - * - * FIXME: may race normal receive processing - */ - -static int tiocsti(struct tty_struct *tty, char __user *p) -{ - char ch, mbz = 0; - struct tty_ldisc *ld; - - if ((current->signal->tty != tty) && !capable(CAP_SYS_ADMIN)) - return -EPERM; - if (get_user(ch, p)) - return -EFAULT; - tty_audit_tiocsti(tty, ch); - ld = tty_ldisc_ref_wait(tty); - ld->ops->receive_buf(tty, &ch, &mbz, 1); - tty_ldisc_deref(ld); - return 0; -} - -/** - * tiocgwinsz - implement window query ioctl - * @tty; tty - * @arg: user buffer for result - * - * Copies the kernel idea of the window size into the user buffer. - * - * Locking: tty->termios_mutex is taken to ensure the winsize data - * is consistent. - */ - -static int tiocgwinsz(struct tty_struct *tty, struct winsize __user *arg) -{ - int err; - - mutex_lock(&tty->termios_mutex); - err = copy_to_user(arg, &tty->winsize, sizeof(*arg)); - mutex_unlock(&tty->termios_mutex); - - return err ? -EFAULT: 0; -} - -/** - * tty_do_resize - resize event - * @tty: tty being resized - * @rows: rows (character) - * @cols: cols (character) - * - * Update the termios variables and send the necessary signals to - * peform a terminal resize correctly - */ - -int tty_do_resize(struct tty_struct *tty, struct winsize *ws) -{ - struct pid *pgrp; - unsigned long flags; - - /* Lock the tty */ - mutex_lock(&tty->termios_mutex); - if (!memcmp(ws, &tty->winsize, sizeof(*ws))) - goto done; - /* Get the PID values and reference them so we can - avoid holding the tty ctrl lock while sending signals */ - spin_lock_irqsave(&tty->ctrl_lock, flags); - pgrp = get_pid(tty->pgrp); - spin_unlock_irqrestore(&tty->ctrl_lock, flags); - - if (pgrp) - kill_pgrp(pgrp, SIGWINCH, 1); - put_pid(pgrp); - - tty->winsize = *ws; -done: - mutex_unlock(&tty->termios_mutex); - return 0; -} -EXPORT_SYMBOL(tty_do_resize); - -/** - * tiocswinsz - implement window size set ioctl - * @tty; tty side of tty - * @arg: user buffer for result - * - * Copies the user idea of the window size to the kernel. Traditionally - * this is just advisory information but for the Linux console it - * actually has driver level meaning and triggers a VC resize. - * - * Locking: - * Driver dependent. The default do_resize method takes the - * tty termios mutex and ctrl_lock. The console takes its own lock - * then calls into the default method. - */ - -static int tiocswinsz(struct tty_struct *tty, struct winsize __user *arg) -{ - struct winsize tmp_ws; - if (copy_from_user(&tmp_ws, arg, sizeof(*arg))) - return -EFAULT; - - if (tty->ops->resize) - return tty->ops->resize(tty, &tmp_ws); - else - return tty_do_resize(tty, &tmp_ws); -} - -/** - * tioccons - allow admin to move logical console - * @file: the file to become console - * - * Allow the administrator to move the redirected console device - * - * Locking: uses redirect_lock to guard the redirect information - */ - -static int tioccons(struct file *file) -{ - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - if (file->f_op->write == redirected_tty_write) { - struct file *f; - spin_lock(&redirect_lock); - f = redirect; - redirect = NULL; - spin_unlock(&redirect_lock); - if (f) - fput(f); - return 0; - } - spin_lock(&redirect_lock); - if (redirect) { - spin_unlock(&redirect_lock); - return -EBUSY; - } - redirect = get_file(file); - spin_unlock(&redirect_lock); - return 0; -} - -/** - * fionbio - non blocking ioctl - * @file: file to set blocking value - * @p: user parameter - * - * Historical tty interfaces had a blocking control ioctl before - * the generic functionality existed. This piece of history is preserved - * in the expected tty API of posix OS's. - * - * Locking: none, the open file handle ensures it won't go away. - */ - -static int fionbio(struct file *file, int __user *p) -{ - int nonblock; - - if (get_user(nonblock, p)) - return -EFAULT; - - spin_lock(&file->f_lock); - if (nonblock) - file->f_flags |= O_NONBLOCK; - else - file->f_flags &= ~O_NONBLOCK; - spin_unlock(&file->f_lock); - return 0; -} - -/** - * tiocsctty - set controlling tty - * @tty: tty structure - * @arg: user argument - * - * This ioctl is used to manage job control. It permits a session - * leader to set this tty as the controlling tty for the session. - * - * Locking: - * Takes tty_mutex() to protect tty instance - * Takes tasklist_lock internally to walk sessions - * Takes ->siglock() when updating signal->tty - */ - -static int tiocsctty(struct tty_struct *tty, int arg) -{ - int ret = 0; - if (current->signal->leader && (task_session(current) == tty->session)) - return ret; - - mutex_lock(&tty_mutex); - /* - * The process must be a session leader and - * not have a controlling tty already. - */ - if (!current->signal->leader || current->signal->tty) { - ret = -EPERM; - goto unlock; - } - - if (tty->session) { - /* - * This tty is already the controlling - * tty for another session group! - */ - if (arg == 1 && capable(CAP_SYS_ADMIN)) { - /* - * Steal it away - */ - read_lock(&tasklist_lock); - session_clear_tty(tty->session); - read_unlock(&tasklist_lock); - } else { - ret = -EPERM; - goto unlock; - } - } - proc_set_tty(current, tty); -unlock: - mutex_unlock(&tty_mutex); - return ret; -} - -/** - * tty_get_pgrp - return a ref counted pgrp pid - * @tty: tty to read - * - * Returns a refcounted instance of the pid struct for the process - * group controlling the tty. - */ - -struct pid *tty_get_pgrp(struct tty_struct *tty) -{ - unsigned long flags; - struct pid *pgrp; - - spin_lock_irqsave(&tty->ctrl_lock, flags); - pgrp = get_pid(tty->pgrp); - spin_unlock_irqrestore(&tty->ctrl_lock, flags); - - return pgrp; -} -EXPORT_SYMBOL_GPL(tty_get_pgrp); - -/** - * tiocgpgrp - get process group - * @tty: tty passed by user - * @real_tty: tty side of the tty passed by the user if a pty else the tty - * @p: returned pid - * - * Obtain the process group of the tty. If there is no process group - * return an error. - * - * Locking: none. Reference to current->signal->tty is safe. - */ - -static int tiocgpgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t __user *p) -{ - struct pid *pid; - int ret; - /* - * (tty == real_tty) is a cheap way of - * testing if the tty is NOT a master pty. - */ - if (tty == real_tty && current->signal->tty != real_tty) - return -ENOTTY; - pid = tty_get_pgrp(real_tty); - ret = put_user(pid_vnr(pid), p); - put_pid(pid); - return ret; -} - -/** - * tiocspgrp - attempt to set process group - * @tty: tty passed by user - * @real_tty: tty side device matching tty passed by user - * @p: pid pointer - * - * Set the process group of the tty to the session passed. Only - * permitted where the tty session is our session. - * - * Locking: RCU, ctrl lock - */ - -static int tiocspgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t __user *p) -{ - struct pid *pgrp; - pid_t pgrp_nr; - int retval = tty_check_change(real_tty); - unsigned long flags; - - if (retval == -EIO) - return -ENOTTY; - if (retval) - return retval; - if (!current->signal->tty || - (current->signal->tty != real_tty) || - (real_tty->session != task_session(current))) - return -ENOTTY; - if (get_user(pgrp_nr, p)) - return -EFAULT; - if (pgrp_nr < 0) - return -EINVAL; - rcu_read_lock(); - pgrp = find_vpid(pgrp_nr); - retval = -ESRCH; - if (!pgrp) - goto out_unlock; - retval = -EPERM; - if (session_of_pgrp(pgrp) != task_session(current)) - goto out_unlock; - retval = 0; - spin_lock_irqsave(&tty->ctrl_lock, flags); - put_pid(real_tty->pgrp); - real_tty->pgrp = get_pid(pgrp); - spin_unlock_irqrestore(&tty->ctrl_lock, flags); -out_unlock: - rcu_read_unlock(); - return retval; -} - -/** - * tiocgsid - get session id - * @tty: tty passed by user - * @real_tty: tty side of the tty passed by the user if a pty else the tty - * @p: pointer to returned session id - * - * Obtain the session id of the tty. If there is no session - * return an error. - * - * Locking: none. Reference to current->signal->tty is safe. - */ - -static int tiocgsid(struct tty_struct *tty, struct tty_struct *real_tty, pid_t __user *p) -{ - /* - * (tty == real_tty) is a cheap way of - * testing if the tty is NOT a master pty. - */ - if (tty == real_tty && current->signal->tty != real_tty) - return -ENOTTY; - if (!real_tty->session) - return -ENOTTY; - return put_user(pid_vnr(real_tty->session), p); -} - -/** - * tiocsetd - set line discipline - * @tty: tty device - * @p: pointer to user data - * - * Set the line discipline according to user request. - * - * Locking: see tty_set_ldisc, this function is just a helper - */ - -static int tiocsetd(struct tty_struct *tty, int __user *p) -{ - int ldisc; - int ret; - - if (get_user(ldisc, p)) - return -EFAULT; - - ret = tty_set_ldisc(tty, ldisc); - - return ret; -} - -/** - * send_break - performed time break - * @tty: device to break on - * @duration: timeout in mS - * - * Perform a timed break on hardware that lacks its own driver level - * timed break functionality. - * - * Locking: - * atomic_write_lock serializes - * - */ - -static int send_break(struct tty_struct *tty, unsigned int duration) -{ - int retval; - - if (tty->ops->break_ctl == NULL) - return 0; - - if (tty->driver->flags & TTY_DRIVER_HARDWARE_BREAK) - retval = tty->ops->break_ctl(tty, duration); - else { - /* Do the work ourselves */ - if (tty_write_lock(tty, 0) < 0) - return -EINTR; - retval = tty->ops->break_ctl(tty, -1); - if (retval) - goto out; - if (!signal_pending(current)) - msleep_interruptible(duration); - retval = tty->ops->break_ctl(tty, 0); -out: - tty_write_unlock(tty); - if (signal_pending(current)) - retval = -EINTR; - } - return retval; -} - -/** - * tty_tiocmget - get modem status - * @tty: tty device - * @file: user file pointer - * @p: pointer to result - * - * Obtain the modem status bits from the tty driver if the feature - * is supported. Return -EINVAL if it is not available. - * - * Locking: none (up to the driver) - */ - -static int tty_tiocmget(struct tty_struct *tty, int __user *p) -{ - int retval = -EINVAL; - - if (tty->ops->tiocmget) { - retval = tty->ops->tiocmget(tty); - - if (retval >= 0) - retval = put_user(retval, p); - } - return retval; -} - -/** - * tty_tiocmset - set modem status - * @tty: tty device - * @cmd: command - clear bits, set bits or set all - * @p: pointer to desired bits - * - * Set the modem status bits from the tty driver if the feature - * is supported. Return -EINVAL if it is not available. - * - * Locking: none (up to the driver) - */ - -static int tty_tiocmset(struct tty_struct *tty, unsigned int cmd, - unsigned __user *p) -{ - int retval; - unsigned int set, clear, val; - - if (tty->ops->tiocmset == NULL) - return -EINVAL; - - retval = get_user(val, p); - if (retval) - return retval; - set = clear = 0; - switch (cmd) { - case TIOCMBIS: - set = val; - break; - case TIOCMBIC: - clear = val; - break; - case TIOCMSET: - set = val; - clear = ~val; - break; - } - - set &= TIOCM_DTR|TIOCM_RTS|TIOCM_OUT1|TIOCM_OUT2|TIOCM_LOOP|TIOCM_CD| - TIOCM_RI|TIOCM_DSR|TIOCM_CTS; - clear &= TIOCM_DTR|TIOCM_RTS|TIOCM_OUT1|TIOCM_OUT2|TIOCM_LOOP|TIOCM_CD| - TIOCM_RI|TIOCM_DSR|TIOCM_CTS; - return tty->ops->tiocmset(tty, set, clear); -} - -static int tty_tiocgicount(struct tty_struct *tty, void __user *arg) -{ - int retval = -EINVAL; - struct serial_icounter_struct icount; - memset(&icount, 0, sizeof(icount)); - if (tty->ops->get_icount) - retval = tty->ops->get_icount(tty, &icount); - if (retval != 0) - return retval; - if (copy_to_user(arg, &icount, sizeof(icount))) - return -EFAULT; - return 0; -} - -struct tty_struct *tty_pair_get_tty(struct tty_struct *tty) -{ - if (tty->driver->type == TTY_DRIVER_TYPE_PTY && - tty->driver->subtype == PTY_TYPE_MASTER) - tty = tty->link; - return tty; -} -EXPORT_SYMBOL(tty_pair_get_tty); - -struct tty_struct *tty_pair_get_pty(struct tty_struct *tty) -{ - if (tty->driver->type == TTY_DRIVER_TYPE_PTY && - tty->driver->subtype == PTY_TYPE_MASTER) - return tty; - return tty->link; -} -EXPORT_SYMBOL(tty_pair_get_pty); - -/* - * Split this up, as gcc can choke on it otherwise.. - */ -long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg) -{ - struct tty_struct *tty = file_tty(file); - struct tty_struct *real_tty; - void __user *p = (void __user *)arg; - int retval; - struct tty_ldisc *ld; - - if (tty_paranoia_check(tty, file_inode(file), "tty_ioctl")) - return -EINVAL; - - real_tty = tty_pair_get_tty(tty); - - /* - * Factor out some common prep work - */ - switch (cmd) { - case TIOCSETD: - case TIOCSBRK: - case TIOCCBRK: - case TCSBRK: - case TCSBRKP: - retval = tty_check_change(tty); - if (retval) - return retval; - if (cmd != TIOCCBRK) { - tty_wait_until_sent(tty, 0); - if (signal_pending(current)) - return -EINTR; - } - break; - } - - /* - * Now do the stuff. - */ - switch (cmd) { - case TIOCSTI: - return tiocsti(tty, p); - case TIOCGWINSZ: - return tiocgwinsz(real_tty, p); - case TIOCSWINSZ: - return tiocswinsz(real_tty, p); - case TIOCCONS: - return real_tty != tty ? -EINVAL : tioccons(file); - case FIONBIO: - return fionbio(file, p); - case TIOCEXCL: - set_bit(TTY_EXCLUSIVE, &tty->flags); - return 0; - case TIOCNXCL: - clear_bit(TTY_EXCLUSIVE, &tty->flags); - return 0; - case TIOCGEXCL: - { - int excl = test_bit(TTY_EXCLUSIVE, &tty->flags); - return put_user(excl, (int __user *)p); - } - case TIOCNOTTY: - if (current->signal->tty != tty) - return -ENOTTY; - no_tty(); - return 0; - case TIOCSCTTY: - return tiocsctty(tty, arg); - case TIOCGPGRP: - return tiocgpgrp(tty, real_tty, p); - case TIOCSPGRP: - return tiocspgrp(tty, real_tty, p); - case TIOCGSID: - return tiocgsid(tty, real_tty, p); - case TIOCGETD: - return put_user(tty->ldisc->ops->num, (int __user *)p); - case TIOCSETD: - return tiocsetd(tty, p); - case TIOCVHANGUP: - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - tty_vhangup(tty); - return 0; - case TIOCGDEV: - { - unsigned int ret = new_encode_dev(tty_devnum(real_tty)); - return put_user(ret, (unsigned int __user *)p); - } - /* - * Break handling - */ - case TIOCSBRK: /* Turn break on, unconditionally */ - if (tty->ops->break_ctl) - return tty->ops->break_ctl(tty, -1); - return 0; - case TIOCCBRK: /* Turn break off, unconditionally */ - if (tty->ops->break_ctl) - return tty->ops->break_ctl(tty, 0); - return 0; - case TCSBRK: /* SVID version: non-zero arg --> no break */ - /* non-zero arg means wait for all output data - * to be sent (performed above) but don't send break. - * This is used by the tcdrain() termios function. - */ - if (!arg) - return send_break(tty, 250); - return 0; - case TCSBRKP: /* support for POSIX tcsendbreak() */ - return send_break(tty, arg ? arg*100 : 250); - - case TIOCMGET: - return tty_tiocmget(tty, p); - case TIOCMSET: - case TIOCMBIC: - case TIOCMBIS: - return tty_tiocmset(tty, cmd, p); - case TIOCGICOUNT: - retval = tty_tiocgicount(tty, p); - /* For the moment allow fall through to the old method */ - if (retval != -EINVAL) - return retval; - break; - case TCFLSH: - switch (arg) { - case TCIFLUSH: - case TCIOFLUSH: - /* flush tty buffer and allow ldisc to process ioctl */ - tty_buffer_flush(tty); - break; - } - break; - } - if (tty->ops->ioctl) { - retval = (tty->ops->ioctl)(tty, cmd, arg); - if (retval != -ENOIOCTLCMD) - return retval; - } - ld = tty_ldisc_ref_wait(tty); - retval = -EINVAL; - if (ld->ops->ioctl) { - retval = ld->ops->ioctl(tty, file, cmd, arg); - if (retval == -ENOIOCTLCMD) - retval = -ENOTTY; - } - tty_ldisc_deref(ld); - return retval; -} - -#ifdef CONFIG_COMPAT -static long tty_compat_ioctl(struct file *file, unsigned int cmd, - unsigned long arg) -{ - struct tty_struct *tty = file_tty(file); - struct tty_ldisc *ld; - int retval = -ENOIOCTLCMD; - - if (tty_paranoia_check(tty, file_inode(file), "tty_ioctl")) - return -EINVAL; - - if (tty->ops->compat_ioctl) { - retval = (tty->ops->compat_ioctl)(tty, cmd, arg); - if (retval != -ENOIOCTLCMD) - return retval; - } - - ld = tty_ldisc_ref_wait(tty); - if (ld->ops->compat_ioctl) - retval = ld->ops->compat_ioctl(tty, file, cmd, arg); - else - retval = n_tty_compat_ioctl_helper(tty, file, cmd, arg); - tty_ldisc_deref(ld); - - return retval; -} -#endif - -static int this_tty(const void *t, struct file *file, unsigned fd) -{ - if (likely(file->f_op->read != tty_read)) - return 0; - return file_tty(file) != t ? 0 : fd + 1; -} - -/* - * This implements the "Secure Attention Key" --- the idea is to - * prevent trojan horses by killing all processes associated with this - * tty when the user hits the "Secure Attention Key". Required for - * super-paranoid applications --- see the Orange Book for more details. - * - * This code could be nicer; ideally it should send a HUP, wait a few - * seconds, then send a INT, and then a KILL signal. But you then - * have to coordinate with the init process, since all processes associated - * with the current tty must be dead before the new getty is allowed - * to spawn. - * - * Now, if it would be correct ;-/ The current code has a nasty hole - - * it doesn't catch files in flight. We may send the descriptor to ourselves - * via AF_UNIX socket, close it and later fetch from socket. FIXME. - * - * Nasty bug: do_SAK is being called in interrupt context. This can - * deadlock. We punt it up to process context. AKPM - 16Mar2001 - */ -void __do_SAK(struct tty_struct *tty) -{ -#ifdef TTY_SOFT_SAK - tty_hangup(tty); -#else - struct task_struct *g, *p; - struct pid *session; - int i; - - if (!tty) - return; - session = tty->session; - - tty_ldisc_flush(tty); - - tty_driver_flush_buffer(tty); - - read_lock(&tasklist_lock); - /* Kill the entire session */ - do_each_pid_task(session, PIDTYPE_SID, p) { - printk(KERN_NOTICE "SAK: killed process %d" - " (%s): task_session(p)==tty->session\n", - task_pid_nr(p), p->comm); - send_sig(SIGKILL, p, 1); - } while_each_pid_task(session, PIDTYPE_SID, p); - /* Now kill any processes that happen to have the - * tty open. - */ - do_each_thread(g, p) { - if (p->signal->tty == tty) { - printk(KERN_NOTICE "SAK: killed process %d" - " (%s): task_session(p)==tty->session\n", - task_pid_nr(p), p->comm); - send_sig(SIGKILL, p, 1); - continue; - } - task_lock(p); - i = iterate_fd(p->files, 0, this_tty, tty); - if (i != 0) { - printk(KERN_NOTICE "SAK: killed process %d" - " (%s): fd#%d opened to the tty\n", - task_pid_nr(p), p->comm, i - 1); - force_sig(SIGKILL, p); - } - task_unlock(p); - } while_each_thread(g, p); - read_unlock(&tasklist_lock); -#endif -} - -static void do_SAK_work(struct work_struct *work) -{ - struct tty_struct *tty = - container_of(work, struct tty_struct, SAK_work); - __do_SAK(tty); -} - -/* - * The tq handling here is a little racy - tty->SAK_work may already be queued. - * Fortunately we don't need to worry, because if ->SAK_work is already queued, - * the values which we write to it will be identical to the values which it - * already has. --akpm - */ -void do_SAK(struct tty_struct *tty) -{ - if (!tty) - return; - schedule_work(&tty->SAK_work); -} - -EXPORT_SYMBOL(do_SAK); - -static int dev_match_devt(struct device *dev, const void *data) -{ - const dev_t *devt = data; - return dev->devt == *devt; -} - -/* Must put_device() after it's unused! */ -static struct device *tty_get_device(struct tty_struct *tty) -{ - dev_t devt = tty_devnum(tty); - return class_find_device(tty_class, NULL, &devt, dev_match_devt); -} - - -/** - * initialize_tty_struct - * @tty: tty to initialize - * - * This subroutine initializes a tty structure that has been newly - * allocated. - * - * Locking: none - tty in question must not be exposed at this point - */ - -void initialize_tty_struct(struct tty_struct *tty, - struct tty_driver *driver, int idx) -{ - memset(tty, 0, sizeof(struct tty_struct)); - kref_init(&tty->kref); - tty->magic = TTY_MAGIC; - tty_ldisc_init(tty); - tty->session = NULL; - tty->pgrp = NULL; - mutex_init(&tty->legacy_mutex); - mutex_init(&tty->termios_mutex); - init_ldsem(&tty->ldisc_sem); - init_waitqueue_head(&tty->write_wait); - init_waitqueue_head(&tty->read_wait); - INIT_WORK(&tty->hangup_work, do_tty_hangup); - mutex_init(&tty->atomic_write_lock); - spin_lock_init(&tty->ctrl_lock); - INIT_LIST_HEAD(&tty->tty_files); - INIT_WORK(&tty->SAK_work, do_SAK_work); - - tty->driver = driver; - tty->ops = driver->ops; - tty->index = idx; - tty_line_name(driver, idx, tty->name); - tty->dev = tty_get_device(tty); -} - -/** - * deinitialize_tty_struct - * @tty: tty to deinitialize - * - * This subroutine deinitializes a tty structure that has been newly - * allocated but tty_release cannot be called on that yet. - * - * Locking: none - tty in question must not be exposed at this point - */ -void deinitialize_tty_struct(struct tty_struct *tty) -{ - tty_ldisc_deinit(tty); -} - -/** - * tty_put_char - write one character to a tty - * @tty: tty - * @ch: character - * - * Write one byte to the tty using the provided put_char method - * if present. Returns the number of characters successfully output. - * - * Note: the specific put_char operation in the driver layer may go - * away soon. Don't call it directly, use this method - */ - -int tty_put_char(struct tty_struct *tty, unsigned char ch) -{ - if (tty->ops->put_char) - return tty->ops->put_char(tty, ch); - return tty->ops->write(tty, &ch, 1); -} -EXPORT_SYMBOL_GPL(tty_put_char); - -struct class *tty_class; - -static int tty_cdev_add(struct tty_driver *driver, dev_t dev, - unsigned int index, unsigned int count) -{ - /* init here, since reused cdevs cause crashes */ - cdev_init(&driver->cdevs[index], &tty_fops); - driver->cdevs[index].owner = driver->owner; - return cdev_add(&driver->cdevs[index], dev, count); -} - -/** - * tty_register_device - register a tty device - * @driver: the tty driver that describes the tty device - * @index: the index in the tty driver for this tty device - * @device: a struct device that is associated with this tty device. - * This field is optional, if there is no known struct device - * for this tty device it can be set to NULL safely. - * - * Returns a pointer to the struct device for this tty device - * (or ERR_PTR(-EFOO) on error). - * - * This call is required to be made to register an individual tty device - * if the tty driver's flags have the TTY_DRIVER_DYNAMIC_DEV bit set. If - * that bit is not set, this function should not be called by a tty - * driver. - * - * Locking: ?? - */ - -struct device *tty_register_device(struct tty_driver *driver, unsigned index, - struct device *device) -{ - return tty_register_device_attr(driver, index, device, NULL, NULL); -} -EXPORT_SYMBOL(tty_register_device); - -static void tty_device_create_release(struct device *dev) -{ - pr_debug("device: '%s': %s\n", dev_name(dev), __func__); - kfree(dev); -} - -/** - * tty_register_device_attr - register a tty device - * @driver: the tty driver that describes the tty device - * @index: the index in the tty driver for this tty device - * @device: a struct device that is associated with this tty device. - * This field is optional, if there is no known struct device - * for this tty device it can be set to NULL safely. - * @drvdata: Driver data to be set to device. - * @attr_grp: Attribute group to be set on device. - * - * Returns a pointer to the struct device for this tty device - * (or ERR_PTR(-EFOO) on error). - * - * This call is required to be made to register an individual tty device - * if the tty driver's flags have the TTY_DRIVER_DYNAMIC_DEV bit set. If - * that bit is not set, this function should not be called by a tty - * driver. - * - * Locking: ?? - */ -struct device *tty_register_device_attr(struct tty_driver *driver, - unsigned index, struct device *device, - void *drvdata, - const struct attribute_group **attr_grp) -{ - char name[64]; - dev_t devt = MKDEV(driver->major, driver->minor_start) + index; - struct device *dev = NULL; - int retval = -ENODEV; - bool cdev = false; - - if (index >= driver->num) { - printk(KERN_ERR "Attempt to register invalid tty line number " - " (%d).\n", index); - return ERR_PTR(-EINVAL); - } - - if (driver->type == TTY_DRIVER_TYPE_PTY) - pty_line_name(driver, index, name); - else - tty_line_name(driver, index, name); - - if (!(driver->flags & TTY_DRIVER_DYNAMIC_ALLOC)) { - retval = tty_cdev_add(driver, devt, index, 1); - if (retval) - goto error; - cdev = true; - } - - dev = kzalloc(sizeof(*dev), GFP_KERNEL); - if (!dev) { - retval = -ENOMEM; - goto error; - } - - dev->devt = devt; - dev->class = tty_class; - dev->parent = device; - dev->release = tty_device_create_release; - dev_set_name(dev, "%s", name); - dev->groups = attr_grp; - dev_set_drvdata(dev, drvdata); - - retval = device_register(dev); - if (retval) - goto error; - - return dev; - -error: - put_device(dev); - if (cdev) - cdev_del(&driver->cdevs[index]); - return ERR_PTR(retval); -} -EXPORT_SYMBOL_GPL(tty_register_device_attr); - -/** - * tty_unregister_device - unregister a tty device - * @driver: the tty driver that describes the tty device - * @index: the index in the tty driver for this tty device - * - * If a tty device is registered with a call to tty_register_device() then - * this function must be called when the tty device is gone. - * - * Locking: ?? - */ - -void tty_unregister_device(struct tty_driver *driver, unsigned index) -{ - device_destroy(tty_class, - MKDEV(driver->major, driver->minor_start) + index); - if (!(driver->flags & TTY_DRIVER_DYNAMIC_ALLOC)) - cdev_del(&driver->cdevs[index]); -} -EXPORT_SYMBOL(tty_unregister_device); - -/** - * __tty_alloc_driver -- allocate tty driver - * @lines: count of lines this driver can handle at most - * @owner: module which is repsonsible for this driver - * @flags: some of TTY_DRIVER_* flags, will be set in driver->flags - * - * This should not be called directly, some of the provided macros should be - * used instead. Use IS_ERR and friends on @retval. - */ -struct tty_driver *__tty_alloc_driver(unsigned int lines, struct module *owner, - unsigned long flags) -{ - struct tty_driver *driver; - unsigned int cdevs = 1; - int err; - - if (!lines || (flags & TTY_DRIVER_UNNUMBERED_NODE && lines > 1)) - return ERR_PTR(-EINVAL); - - driver = kzalloc(sizeof(struct tty_driver), GFP_KERNEL); - if (!driver) - return ERR_PTR(-ENOMEM); - - kref_init(&driver->kref); - driver->magic = TTY_DRIVER_MAGIC; - driver->num = lines; - driver->owner = owner; - driver->flags = flags; - - if (!(flags & TTY_DRIVER_DEVPTS_MEM)) { - driver->ttys = kcalloc(lines, sizeof(*driver->ttys), - GFP_KERNEL); - driver->termios = kcalloc(lines, sizeof(*driver->termios), - GFP_KERNEL); - if (!driver->ttys || !driver->termios) { - err = -ENOMEM; - goto err_free_all; - } - } - - if (!(flags & TTY_DRIVER_DYNAMIC_ALLOC)) { - driver->ports = kcalloc(lines, sizeof(*driver->ports), - GFP_KERNEL); - if (!driver->ports) { - err = -ENOMEM; - goto err_free_all; - } - cdevs = lines; - } - - driver->cdevs = kcalloc(cdevs, sizeof(*driver->cdevs), GFP_KERNEL); - if (!driver->cdevs) { - err = -ENOMEM; - goto err_free_all; - } - - return driver; -err_free_all: - kfree(driver->ports); - kfree(driver->ttys); - kfree(driver->termios); - kfree(driver); - return ERR_PTR(err); -} -EXPORT_SYMBOL(__tty_alloc_driver); - -static void destruct_tty_driver(struct kref *kref) -{ - struct tty_driver *driver = container_of(kref, struct tty_driver, kref); - int i; - struct ktermios *tp; - - if (driver->flags & TTY_DRIVER_INSTALLED) { - /* - * Free the termios and termios_locked structures because - * we don't want to get memory leaks when modular tty - * drivers are removed from the kernel. - */ - for (i = 0; i < driver->num; i++) { - tp = driver->termios[i]; - if (tp) { - driver->termios[i] = NULL; - kfree(tp); - } - if (!(driver->flags & TTY_DRIVER_DYNAMIC_DEV)) - tty_unregister_device(driver, i); - } - proc_tty_unregister_driver(driver); - if (driver->flags & TTY_DRIVER_DYNAMIC_ALLOC) - cdev_del(&driver->cdevs[0]); - } - kfree(driver->cdevs); - kfree(driver->ports); - kfree(driver->termios); - kfree(driver->ttys); - kfree(driver); -} - -void tty_driver_kref_put(struct tty_driver *driver) -{ - kref_put(&driver->kref, destruct_tty_driver); -} -EXPORT_SYMBOL(tty_driver_kref_put); - -void tty_set_operations(struct tty_driver *driver, - const struct tty_operations *op) -{ - driver->ops = op; -}; -EXPORT_SYMBOL(tty_set_operations); - -void put_tty_driver(struct tty_driver *d) -{ - tty_driver_kref_put(d); -} -EXPORT_SYMBOL(put_tty_driver); - -/* - * Called by a tty driver to register itself. - */ -int tty_register_driver(struct tty_driver *driver) -{ - int error; - int i; - dev_t dev; - struct device *d; - - if (!driver->major) { - error = alloc_chrdev_region(&dev, driver->minor_start, - driver->num, driver->name); - if (!error) { - driver->major = MAJOR(dev); - driver->minor_start = MINOR(dev); - } - } else { - dev = MKDEV(driver->major, driver->minor_start); - error = register_chrdev_region(dev, driver->num, driver->name); - } - if (error < 0) - goto err; - - if (driver->flags & TTY_DRIVER_DYNAMIC_ALLOC) { - error = tty_cdev_add(driver, dev, 0, driver->num); - if (error) - goto err_unreg_char; - } - - mutex_lock(&tty_mutex); - list_add(&driver->tty_drivers, &tty_drivers); - mutex_unlock(&tty_mutex); - - if (!(driver->flags & TTY_DRIVER_DYNAMIC_DEV)) { - for (i = 0; i < driver->num; i++) { - d = tty_register_device(driver, i, NULL); - if (IS_ERR(d)) { - error = PTR_ERR(d); - goto err_unreg_devs; - } - } - } - proc_tty_register_driver(driver); - driver->flags |= TTY_DRIVER_INSTALLED; - return 0; - -err_unreg_devs: - for (i--; i >= 0; i--) - tty_unregister_device(driver, i); - - mutex_lock(&tty_mutex); - list_del(&driver->tty_drivers); - mutex_unlock(&tty_mutex); - -err_unreg_char: - unregister_chrdev_region(dev, driver->num); -err: - return error; -} -EXPORT_SYMBOL(tty_register_driver); - -/* - * Called by a tty driver to unregister itself. - */ -int tty_unregister_driver(struct tty_driver *driver) -{ -#if 0 - /* FIXME */ - if (driver->refcount) - return -EBUSY; -#endif - unregister_chrdev_region(MKDEV(driver->major, driver->minor_start), - driver->num); - mutex_lock(&tty_mutex); - list_del(&driver->tty_drivers); - mutex_unlock(&tty_mutex); - return 0; -} - -EXPORT_SYMBOL(tty_unregister_driver); - -dev_t tty_devnum(struct tty_struct *tty) -{ - return MKDEV(tty->driver->major, tty->driver->minor_start) + tty->index; -} -EXPORT_SYMBOL(tty_devnum); - -void proc_clear_tty(struct task_struct *p) -{ - unsigned long flags; - struct tty_struct *tty; - spin_lock_irqsave(&p->sighand->siglock, flags); - tty = p->signal->tty; - p->signal->tty = NULL; - spin_unlock_irqrestore(&p->sighand->siglock, flags); - tty_kref_put(tty); -} - -/* Called under the sighand lock */ - -static void __proc_set_tty(struct task_struct *tsk, struct tty_struct *tty) -{ - if (tty) { - unsigned long flags; - /* We should not have a session or pgrp to put here but.... */ - spin_lock_irqsave(&tty->ctrl_lock, flags); - put_pid(tty->session); - put_pid(tty->pgrp); - tty->pgrp = get_pid(task_pgrp(tsk)); - spin_unlock_irqrestore(&tty->ctrl_lock, flags); - tty->session = get_pid(task_session(tsk)); - if (tsk->signal->tty) { - printk(KERN_DEBUG "tty not NULL!!\n"); - tty_kref_put(tsk->signal->tty); - } - } - put_pid(tsk->signal->tty_old_pgrp); - tsk->signal->tty = tty_kref_get(tty); - tsk->signal->tty_old_pgrp = NULL; -} - -static void proc_set_tty(struct task_struct *tsk, struct tty_struct *tty) -{ - spin_lock_irq(&tsk->sighand->siglock); - __proc_set_tty(tsk, tty); - spin_unlock_irq(&tsk->sighand->siglock); -} - -struct tty_struct *get_current_tty(void) -{ - struct tty_struct *tty; - unsigned long flags; - - spin_lock_irqsave(¤t->sighand->siglock, flags); - tty = tty_kref_get(current->signal->tty); - spin_unlock_irqrestore(¤t->sighand->siglock, flags); - return tty; -} -EXPORT_SYMBOL_GPL(get_current_tty); - -void tty_default_fops(struct file_operations *fops) -{ - *fops = tty_fops; -} - -/* - * Initialize the console device. This is called *early*, so - * we can't necessarily depend on lots of kernel help here. - * Just do some early initializations, and do the complex setup - * later. - */ -void __init console_init(void) -{ - initcall_t *call; - - /* Setup the default TTY line discipline. */ - tty_ldisc_begin(); - - /* - * set up the console device so that later boot sequences can - * inform about problems etc.. - */ - call = __con_initcall_start; - while (call < __con_initcall_end) { - (*call)(); - call++; - } -} - -static char *tty_devnode(struct device *dev, umode_t *mode) -{ - if (!mode) - return NULL; - if (dev->devt == MKDEV(TTYAUX_MAJOR, 0) || - dev->devt == MKDEV(TTYAUX_MAJOR, 2)) - *mode = 0666; - return NULL; -} - -static int __init tty_class_init(void) -{ - tty_class = class_create(THIS_MODULE, "tty"); - if (IS_ERR(tty_class)) - return PTR_ERR(tty_class); - tty_class->devnode = tty_devnode; - return 0; -} - -postcore_initcall(tty_class_init); - -/* 3/2004 jmc: why do these devices exist? */ -static struct cdev tty_cdev, console_cdev; - -static ssize_t show_cons_active(struct device *dev, - struct device_attribute *attr, char *buf) -{ - struct console *cs[16]; - int i = 0; - struct console *c; - ssize_t count = 0; - - console_lock(); - for_each_console(c) { - if (!c->device) - continue; - if (!c->write) - continue; - if ((c->flags & CON_ENABLED) == 0) - continue; - cs[i++] = c; - if (i >= ARRAY_SIZE(cs)) - break; - } - while (i--) { - int index = cs[i]->index; - struct tty_driver *drv = cs[i]->device(cs[i], &index); - - /* don't resolve tty0 as some programs depend on it */ - if (drv && (cs[i]->index > 0 || drv->major != TTY_MAJOR)) - count += tty_line_name(drv, index, buf + count); - else - count += sprintf(buf + count, "%s%d", - cs[i]->name, cs[i]->index); - - count += sprintf(buf + count, "%c", i ? ' ':'\n'); - } - console_unlock(); - - return count; -} -static DEVICE_ATTR(active, S_IRUGO, show_cons_active, NULL); - -static struct device *consdev; - -void console_sysfs_notify(void) -{ - if (consdev) - sysfs_notify(&consdev->kobj, NULL, "active"); -} - -/* - * Ok, now we can initialize the rest of the tty devices and can count - * on memory allocations, interrupts etc.. - */ -int __init tty_init(void) -{ - cdev_init(&tty_cdev, &tty_fops); - if (cdev_add(&tty_cdev, MKDEV(TTYAUX_MAJOR, 0), 1) || - register_chrdev_region(MKDEV(TTYAUX_MAJOR, 0), 1, "/dev/tty") < 0) - panic("Couldn't register /dev/tty driver\n"); - device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 0), NULL, "tty"); - - cdev_init(&console_cdev, &console_fops); - if (cdev_add(&console_cdev, MKDEV(TTYAUX_MAJOR, 1), 1) || - register_chrdev_region(MKDEV(TTYAUX_MAJOR, 1), 1, "/dev/console") < 0) - panic("Couldn't register /dev/console driver\n"); - consdev = device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 1), NULL, - "console"); - if (IS_ERR(consdev)) - consdev = NULL; - else - WARN_ON(device_create_file(consdev, &dev_attr_active) < 0); - -#ifdef CONFIG_VT - vty_init(&console_fops); -#endif - return 0; -} - diff --git a/patches/kgdboc.c-patch b/patches/kgdboc.c-patch new file mode 100644 index 0000000..0d31d0d --- /dev/null +++ b/patches/kgdboc.c-patch @@ -0,0 +1,81 @@ +diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c +index 10020547c60b..3cc7dcb58e97 100644 +--- a/drivers/tty/serial/kgdboc.c ++++ b/drivers/tty/serial/kgdboc.c +@@ -29,6 +29,7 @@ static struct kgdb_io kgdboc_io_ops; + static int configured = -1; + + static char config[MAX_CONFIG_LEN]; ++static int config_retry_time = 0; + static struct kparam_string kps = { + .string = config, + .maxlen = MAX_CONFIG_LEN, +@@ -153,6 +154,28 @@ static void cleanup_kgdboc(void) + kgdb_unregister_io_module(&kgdboc_io_ops); + } + ++static int kgdbretry_option_setup(char *opt) ++{ ++ if (strlen(opt) > MAX_CONFIG_LEN) { ++ printk(KERN_ERR "kgdbretry: config string too long\n"); ++ return -ENOSPC; ++ } ++ config_retry_time = simple_strtoul(opt, NULL, 10); ++ ++ return 0; ++} ++ ++__setup("kgdbretry=", kgdbretry_option_setup); ++ ++static int configure_kgdboc(void); ++static void ttycheck_func(struct work_struct *work) ++{ ++ config_retry_time = 0; ++ configure_kgdboc(); ++} ++ ++static DECLARE_DELAYED_WORK(ttycheck_work, ttycheck_func); ++ + static int configure_kgdboc(void) + { + struct tty_driver *p; +@@ -179,8 +202,15 @@ static int configure_kgdboc(void) + goto do_register; + + p = tty_find_polling_driver(cptr, &tty_line); +- if (!p) ++ if (!p) { ++ printk(KERN_INFO "kgdb will retry in %d secs\n", config_retry_time); ++ if (config_retry_time > 0) { ++ INIT_DELAYED_WORK(&ttycheck_work, ttycheck_func); ++ schedule_delayed_work(&ttycheck_work, config_retry_time * HZ); ++ return -ENODEV; ++ } + goto noconfig; ++ } + + cons = console_drivers; + while (cons) { +@@ -202,6 +232,7 @@ do_register: + goto noconfig; + + err = kgdb_register_nmi_console(); ++ + if (err) + goto nmi_con_failed; + +@@ -212,6 +243,7 @@ do_register: + nmi_con_failed: + kgdb_unregister_io_module(&kgdboc_io_ops); + noconfig: ++ printk(KERN_ERR "kgdb failed to initialise\n"); + kgdboc_unregister_kbd(); + config[0] = 0; + configured = 0; +@@ -335,5 +367,6 @@ module_init(init_kgdboc); + module_exit(cleanup_kgdboc); + module_param_call(kgdboc, param_set_kgdboc_var, param_get_string, &kps, 0644); + MODULE_PARM_DESC(kgdboc, "[,baud]"); ++MODULE_PARM_DESC(kgdbretry, " before retrying tty"); + MODULE_DESCRIPTION("KGDB Console TTY Driver"); + MODULE_LICENSE("GPL"); diff --git a/patches/msm_serial_hs_lite.c-patch b/patches/msm_serial_hs_lite.c-patch new file mode 100644 index 0000000..1d2a3d9 --- /dev/null +++ b/patches/msm_serial_hs_lite.c-patch @@ -0,0 +1,185 @@ +diff --git a/drivers/tty/serial/msm_serial_hs_lite.c b/drivers/tty/serial/msm_serial_hs_lite.c +index b0fd7957196d..79f4f85c9060 100644 +--- a/drivers/tty/serial/msm_serial_hs_lite.c ++++ b/drivers/tty/serial/msm_serial_hs_lite.c +@@ -764,6 +764,10 @@ static void msm_hsl_reset(struct uart_port *port) + msm_hsl_write(port, RESET_BREAK_INT, regmap[vid][UARTDM_CR]); + msm_hsl_write(port, RESET_CTS, regmap[vid][UARTDM_CR]); + msm_hsl_write(port, RFR_LOW, regmap[vid][UARTDM_CR]); ++ ++ /* Disable DM modes */ ++ msm_hsl_write(port, 0, regmap[vid][UARTDM_DMEN]); ++ + } + + static unsigned int msm_hsl_get_mctrl(struct uart_port *port) +@@ -992,8 +996,8 @@ static int msm_hsl_startup(struct uart_port *port) + if (!(is_console(port)) || (!port->cons) || + (port->cons && (!(port->cons->flags & CON_ENABLED)))) { + +- if (msm_serial_hsl_has_gsbi(port)) +- set_gsbi_uart_func_mode(port); ++ if (msm_serial_hsl_has_gsbi(port)) ++ set_gsbi_uart_func_mode(port); + + if (pdata && pdata->use_pm) + wake_lock(&msm_hsl_port->port_open_wake_lock); +@@ -1298,6 +1302,146 @@ static void msm_hsl_power(struct uart_port *port, unsigned int state, + } + } + ++ ++ ++ ++ ++ ++#ifdef CONFIG_CONSOLE_POLL ++ ++/* defines from msm_serial.h */ ++#define UARTDM_DMEN_RX_SC_ENABLE BIT(5) ++#define UARTDM_DMEN_TX_SC_ENABLE BIT(4) ++ ++#define UARTDM_RXFS_BUF_SHIFT 0x7 ++#define UARTDM_RXFS_BUF_MASK 0x7 ++ ++static int msm_poll_init(struct uart_port *port) ++{ ++ unsigned int vid; ++ ++ vid = UART_TO_MSM(port)->ver_id; ++ ++ /* Enable single character mode on RX FIFO */ ++ /* A later patch from David Boyd suggests this causes problems... */ ++ /*msm_hsl_write(port, UARTDM_DMEN_RX_SC_ENABLE, regmap[vid][UARTDM_DMEN]);*/ ++ ++ return 0; ++} ++ ++static int msm_poll_get_char_dm(struct uart_port *port) ++{ ++ int c; ++ static u32 slop; ++ static int count; ++ unsigned char *sp = (unsigned char *)&slop; ++ unsigned int vid; ++ ++ vid = UART_TO_MSM(port)->ver_id; ++ ++ /* Check if a previous read had more than one char */ ++ if (count) { ++ c = sp[sizeof(slop) - count]; ++ count--; ++ /* Or if FIFO is empty */ ++ } else if (!(msm_hsl_read(port, regmap[vid][UARTDM_SR]) & UARTDM_SR_RXRDY_BMSK)) { /* bit 0 */ ++ /* ++ * If RX packing buffer has less than a word, force stale to ++ * push contents into RX FIFO ++ */ ++ count = msm_hsl_read(port, regmap[vid][UARTDM_RXFS]); ++ ++ count = (count >> UARTDM_RXFS_BUF_SHIFT) & UARTDM_RXFS_BUF_MASK; ++ if (count) { ++ msm_hsl_write(port, FORCE_STALE_EVENT, regmap[vid][UARTDM_CR]); ++ slop = msm_hsl_read(port, regmap[vid][UARTDM_RF]); ++ c = sp[0]; ++ count--; ++ ++ msm_hsl_write(port, RESET_STALE_INT, regmap[vid][UARTDM_CR]); ++ msm_hsl_write(port, 0xFF, regmap[vid][UARTDM_DMRX]); ++ msm_hsl_write(port, STALE_EVENT_ENABLE, regmap[vid][UARTDM_CR]); ++ ++ } else { ++ c = NO_POLL_CHAR; ++ } ++ /* FIFO has a word */ ++ } else { ++ slop = msm_hsl_read(port, regmap[vid][UARTDM_RF]); ++ c = sp[0]; ++ count = sizeof(slop) - 1; ++ } ++ ++ return c; ++} ++ ++ ++static int msm_poll_get_char(struct uart_port *port) ++{ ++ u32 imr; ++ int c; ++ unsigned int vid; ++ ++ vid = UART_TO_MSM(port)->ver_id; ++ ++ /* Disable all interrupts */ ++ imr = msm_hsl_read(port, regmap[vid][UARTDM_IMR]); ++ msm_hsl_write(port, 0, regmap[vid][UARTDM_IMR]); ++ ++ ++ c = msm_poll_get_char_dm(port); ++ ++ ++ /* Enable interrupts */ ++ msm_hsl_write(port, imr, regmap[vid][UARTDM_IMR]); ++ ++ return c; ++} ++ ++static void reset_dm_count(struct uart_port *port, int count) ++{ ++ unsigned int vid; ++ ++ vid = UART_TO_MSM(port)->ver_id; ++ ++ wait_for_xmitr(port); ++ msm_hsl_write(port, count, regmap[vid][UARTDM_NCF_TX]); ++ msm_hsl_read(port, regmap[vid][UARTDM_NCF_TX]); ++} ++ ++static void msm_poll_put_char(struct uart_port *port, unsigned char c) ++{ ++ u32 imr; ++ unsigned int vid; ++ ++ vid = UART_TO_MSM(port)->ver_id; ++ ++ /* Disable all interrupts */ ++ imr = msm_hsl_read(port, regmap[vid][UARTDM_IMR]); ++ msm_hsl_write(port, 0, regmap[vid][UARTDM_IMR]); ++ ++ /*if (msm_port->is_uartdm)*/ ++ reset_dm_count(port, 1); ++ ++ /* Wait until FIFO is empty */ ++ while (!(msm_hsl_read(port, regmap[vid][UARTDM_SR]) & UARTDM_SR_TXRDY_BMSK)) ++ cpu_relax(); ++ ++ /* Write a character */ ++ msm_hsl_write(port, c, regmap[vid][UARTDM_TF]); ++ ++ /* Wait until FIFO is empty */ ++ while (!(msm_hsl_read(port, regmap[vid][UARTDM_SR]) & UARTDM_SR_TXRDY_BMSK)) ++ cpu_relax(); ++ ++ /* Enable interrupts */ ++ msm_hsl_write(port, imr, regmap[vid][UARTDM_IMR]); ++ ++ return; ++} ++#endif ++ ++ + static struct uart_ops msm_hsl_uart_pops = { + .tx_empty = msm_hsl_tx_empty, + .set_mctrl = msm_hsl_set_mctrl, +@@ -1316,6 +1460,11 @@ static struct uart_ops msm_hsl_uart_pops = { + .config_port = msm_hsl_config_port, + .verify_port = msm_hsl_verify_port, + .pm = msm_hsl_power, ++#ifdef CONFIG_CONSOLE_POLL ++ .poll_init = msm_poll_init, ++ .poll_get_char = msm_poll_get_char, ++ .poll_put_char = msm_poll_put_char, ++#endif + }; + + static struct msm_hsl_port msm_hsl_uart_ports[] = {