--- /dev/null
+#
+# Automatically generated file; DO NOT EDIT.
+# Linux/i386 3.4.0 Kernel Configuration
+#
+# CONFIG_64BIT is not set
+CONFIG_X86_32=y
+# CONFIG_X86_64 is not set
+CONFIG_X86=y
+CONFIG_INSTRUCTION_DECODER=y
+CONFIG_OUTPUT_FORMAT="elf32-i386"
+CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig"
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_CLOCKSOURCE_WATCHDOG=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_HAVE_LATENCYTOP_SUPPORT=y
+CONFIG_MMU=y
+# CONFIG_NEED_DMA_MAP_STATE is not set
+CONFIG_NEED_SG_DMA_LENGTH=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_GENERIC_BUG=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+# CONFIG_RWSEM_GENERIC_SPINLOCK is not set
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+# CONFIG_GENERIC_TIME_VSYSCALL is not set
+CONFIG_ARCH_HAS_CPU_RELAX=y
+CONFIG_ARCH_HAS_DEFAULT_IDLE=y
+CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
+CONFIG_ARCH_HAS_CPU_AUTOPROBE=y
+CONFIG_HAVE_SETUP_PER_CPU_AREA=y
+CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
+CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+# CONFIG_ZONE_DMA32 is not set
+# CONFIG_AUDIT_ARCH is not set
+CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
+CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
+CONFIG_X86_32_LAZY_GS=y
+CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-ecx -fcall-saved-edx"
+CONFIG_KTIME_SCALAR=y
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+CONFIG_HAVE_IRQ_WORK=y
+CONFIG_IRQ_WORK=y
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_CROSS_COMPILE=""
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_HAVE_KERNEL_GZIP=y
+CONFIG_HAVE_KERNEL_BZIP2=y
+CONFIG_HAVE_KERNEL_LZMA=y
+CONFIG_HAVE_KERNEL_XZ=y
+CONFIG_HAVE_KERNEL_LZO=y
+CONFIG_KERNEL_GZIP=y
+# CONFIG_KERNEL_BZIP2 is not set
+# 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=y
+CONFIG_POSIX_MQUEUE_SYSCTL=y
+CONFIG_BSD_PROCESS_ACCT=y
+# CONFIG_BSD_PROCESS_ACCT_V3 is not set
+# CONFIG_FHANDLE is not set
+CONFIG_TASKSTATS=y
+CONFIG_TASK_DELAY_ACCT=y
+CONFIG_TASK_XACCT=y
+CONFIG_TASK_IO_ACCOUNTING=y
+CONFIG_AUDIT=y
+CONFIG_AUDITSYSCALL=y
+CONFIG_AUDIT_WATCH=y
+CONFIG_AUDIT_TREE=y
+# 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_IRQ_FORCED_THREADING=y
+CONFIG_SPARSE_IRQ=y
+
+#
+# RCU Subsystem
+#
+CONFIG_TINY_PREEMPT_RCU=y
+CONFIG_PREEMPT_RCU=y
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_RCU_BOOST is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=18
+CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
+CONFIG_CGROUPS=y
+# CONFIG_CGROUP_DEBUG is not set
+CONFIG_CGROUP_FREEZER=y
+# CONFIG_CGROUP_DEVICE is not set
+CONFIG_CPUSETS=y
+CONFIG_PROC_PID_CPUSET=y
+CONFIG_CGROUP_CPUACCT=y
+CONFIG_RESOURCE_COUNTERS=y
+# CONFIG_CGROUP_MEM_RES_CTLR 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 is not set
+# CONFIG_BLK_CGROUP is not set
+# CONFIG_CHECKPOINT_RESTORE is not set
+CONFIG_NAMESPACES=y
+CONFIG_UTS_NS=y
+CONFIG_IPC_NS=y
+CONFIG_USER_NS=y
+CONFIG_PID_NS=y
+CONFIG_NET_NS=y
+# CONFIG_SCHED_AUTOGROUP is not set
+# CONFIG_SYSFS_DEPRECATED is not set
+CONFIG_RELAY=y
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE="ramfs/initramfs"
+CONFIG_INITRAMFS_ROOT_UID=0
+CONFIG_INITRAMFS_ROOT_GID=0
+CONFIG_RD_GZIP=y
+CONFIG_RD_BZIP2=y
+CONFIG_RD_LZMA=y
+CONFIG_RD_XZ=y
+CONFIG_RD_LZO=y
+CONFIG_INITRAMFS_COMPRESSION_NONE=y
+# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set
+# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set
+# CONFIG_INITRAMFS_COMPRESSION_LZMA is not set
+# CONFIG_INITRAMFS_COMPRESSION_XZ is not set
+# CONFIG_INITRAMFS_COMPRESSION_LZO is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+# CONFIG_EXPERT is not set
+CONFIG_UID16=y
+# CONFIG_SYSCTL_SYSCALL is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_PCSPKR_PLATFORM=y
+CONFIG_HAVE_PCSPKR_PLATFORM=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_EMBEDDED is not set
+CONFIG_HAVE_PERF_EVENTS=y
+
+#
+# Kernel Performance Events And Counters
+#
+CONFIG_PERF_EVENTS=y
+# CONFIG_PERF_COUNTERS is not set
+# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_PCI_QUIRKS=y
+CONFIG_SLUB_DEBUG=y
+# CONFIG_COMPAT_BRK is not set
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+CONFIG_PROFILING=y
+CONFIG_TRACEPOINTS=y
+CONFIG_OPROFILE=y
+# CONFIG_OPROFILE_EVENT_MULTIPLEX is not set
+CONFIG_HAVE_OPROFILE=y
+CONFIG_OPROFILE_NMI_TIMER=y
+CONFIG_KPROBES=y
+# CONFIG_JUMP_LABEL is not set
+CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
+CONFIG_KRETPROBES=y
+CONFIG_HAVE_IOREMAP_PROT=y
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_OPTPROBES=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+CONFIG_HAVE_DMA_ATTRS=y
+CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
+CONFIG_HAVE_DMA_API_DEBUG=y
+CONFIG_HAVE_HW_BREAKPOINT=y
+CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y
+CONFIG_HAVE_USER_RETURN_NOTIFIER=y
+CONFIG_HAVE_PERF_EVENTS_NMI=y
+CONFIG_HAVE_ARCH_JUMP_LABEL=y
+CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
+CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y
+CONFIG_HAVE_CMPXCHG_LOCAL=y
+CONFIG_HAVE_CMPXCHG_DOUBLE=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=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_BLOCK=y
+CONFIG_LBDAF=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=y
+CONFIG_AMIGA_PARTITION=y
+# CONFIG_ATARI_PARTITION is not set
+CONFIG_MAC_PARTITION=y
+CONFIG_MSDOS_PARTITION=y
+CONFIG_BSD_DISKLABEL=y
+CONFIG_MINIX_SUBPARTITION=y
+CONFIG_SOLARIS_X86_PARTITION=y
+CONFIG_UNIXWARE_DISKLABEL=y
+# CONFIG_LDM_PARTITION is not set
+CONFIG_SGI_PARTITION=y
+# CONFIG_ULTRIX_PARTITION is not set
+CONFIG_SUN_PARTITION=y
+CONFIG_KARMA_PARTITION=y
+CONFIG_EFI_PARTITION=y
+# CONFIG_SYSV68_PARTITION is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_DEADLINE=y
+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_INLINE_SPIN_TRYLOCK is not set
+# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set
+# CONFIG_INLINE_SPIN_LOCK is not set
+# CONFIG_INLINE_SPIN_LOCK_BH is not set
+# CONFIG_INLINE_SPIN_LOCK_IRQ is not set
+# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
+CONFIG_UNINLINE_SPIN_UNLOCK=y
+# CONFIG_INLINE_SPIN_UNLOCK_BH is not set
+# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
+# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
+# CONFIG_INLINE_READ_TRYLOCK is not set
+# CONFIG_INLINE_READ_LOCK is not set
+# CONFIG_INLINE_READ_LOCK_BH is not set
+# CONFIG_INLINE_READ_LOCK_IRQ is not set
+# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set
+# CONFIG_INLINE_READ_UNLOCK is not set
+# CONFIG_INLINE_READ_UNLOCK_BH is not set
+# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
+# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set
+# CONFIG_INLINE_WRITE_TRYLOCK is not set
+# CONFIG_INLINE_WRITE_LOCK is not set
+# CONFIG_INLINE_WRITE_LOCK_BH is not set
+# CONFIG_INLINE_WRITE_LOCK_IRQ is not set
+# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set
+# CONFIG_INLINE_WRITE_UNLOCK is not set
+# CONFIG_INLINE_WRITE_UNLOCK_BH is not set
+# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
+# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
+# CONFIG_MUTEX_SPIN_ON_OWNER is not set
+CONFIG_FREEZER=y
+
+#
+# Processor type and features
+#
+CONFIG_ZONE_DMA=y
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
+# CONFIG_SMP is not set
+CONFIG_X86_EXTENDED_PLATFORM=y
+# CONFIG_X86_WANT_INTEL_MID is not set
+# CONFIG_X86_RDC321X is not set
+CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y
+# CONFIG_X86_32_IRIS is not set
+CONFIG_SCHED_OMIT_FRAME_POINTER=y
+# CONFIG_PARAVIRT_GUEST is not set
+CONFIG_NO_BOOTMEM=y
+# CONFIG_MEMTEST is not set
+# CONFIG_M386 is not set
+# CONFIG_M486 is not set
+# CONFIG_M586 is not set
+# CONFIG_M586TSC is not set
+# CONFIG_M586MMX is not set
+CONFIG_M686=y
+# CONFIG_MPENTIUMII is not set
+# CONFIG_MPENTIUMIII is not set
+# CONFIG_MPENTIUMM is not set
+# CONFIG_MPENTIUM4 is not set
+# CONFIG_MK6 is not set
+# CONFIG_MK7 is not set
+# CONFIG_MK8 is not set
+# CONFIG_MCRUSOE is not set
+# CONFIG_MEFFICEON is not set
+# CONFIG_MWINCHIPC6 is not set
+# CONFIG_MWINCHIP3D is not set
+# CONFIG_MELAN is not set
+# CONFIG_MGEODEGX1 is not set
+# CONFIG_MGEODE_LX is not set
+# CONFIG_MCYRIXIII is not set
+# CONFIG_MVIAC3_2 is not set
+# CONFIG_MVIAC7 is not set
+# CONFIG_MCORE2 is not set
+# CONFIG_MATOM is not set
+CONFIG_X86_GENERIC=y
+CONFIG_X86_INTERNODE_CACHE_SHIFT=6
+CONFIG_X86_CMPXCHG=y
+CONFIG_X86_L1_CACHE_SHIFT=6
+CONFIG_X86_XADD=y
+# CONFIG_X86_PPRO_FENCE is not set
+CONFIG_X86_WP_WORKS_OK=y
+CONFIG_X86_INVLPG=y
+CONFIG_X86_BSWAP=y
+CONFIG_X86_POPAD_OK=y
+CONFIG_X86_INTEL_USERCOPY=y
+CONFIG_X86_USE_PPRO_CHECKSUM=y
+CONFIG_X86_TSC=y
+CONFIG_X86_CMPXCHG64=y
+CONFIG_X86_CMOV=y
+CONFIG_X86_MINIMUM_CPU_FAMILY=5
+CONFIG_X86_DEBUGCTLMSR=y
+CONFIG_CPU_SUP_INTEL=y
+CONFIG_CPU_SUP_AMD=y
+CONFIG_CPU_SUP_CENTAUR=y
+CONFIG_CPU_SUP_TRANSMETA_32=y
+# CONFIG_HPET_TIMER is not set
+CONFIG_DMI=y
+# CONFIG_IOMMU_HELPER is not set
+CONFIG_NR_CPUS=1
+# CONFIG_IRQ_TIME_ACCOUNTING is not set
+# CONFIG_PREEMPT_NONE is not set
+# CONFIG_PREEMPT_VOLUNTARY is not set
+CONFIG_PREEMPT=y
+CONFIG_PREEMPT_COUNT=y
+# CONFIG_X86_UP_APIC is not set
+CONFIG_X86_MCE=y
+# CONFIG_X86_ANCIENT_MCE is not set
+# CONFIG_X86_MCE_INJECT is not set
+CONFIG_VM86=y
+# CONFIG_TOSHIBA is not set
+# CONFIG_I8K is not set
+CONFIG_X86_REBOOTFIXUPS=y
+CONFIG_MICROCODE=y
+CONFIG_MICROCODE_INTEL=y
+CONFIG_MICROCODE_AMD=y
+CONFIG_MICROCODE_OLD_INTERFACE=y
+CONFIG_X86_MSR=y
+CONFIG_X86_CPUID=y
+# CONFIG_NOHIGHMEM is not set
+CONFIG_HIGHMEM4G=y
+# CONFIG_HIGHMEM64G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+CONFIG_HIGHMEM=y
+# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set
+# CONFIG_ARCH_DMA_ADDR_T_64BIT is not set
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_ILLEGAL_POINTER_VALUE=0
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_SPARSEMEM_STATIC=y
+CONFIG_HAVE_MEMBLOCK=y
+CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
+CONFIG_ARCH_DISCARD_MEMBLOCK=y
+CONFIG_PAGEFLAGS_EXTENDED=y
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_COMPACTION is not set
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+# CONFIG_KSM is not set
+CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
+CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y
+# CONFIG_MEMORY_FAILURE is not set
+# CONFIG_TRANSPARENT_HUGEPAGE is not set
+CONFIG_NEED_PER_CPU_KM=y
+# CONFIG_CLEANCACHE is not set
+CONFIG_HIGHPTE=y
+CONFIG_X86_CHECK_BIOS_CORRUPTION=y
+CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK=y
+CONFIG_X86_RESERVE_LOW=64
+# CONFIG_MATH_EMULATION is not set
+CONFIG_MTRR=y
+# CONFIG_MTRR_SANITIZER is not set
+CONFIG_X86_PAT=y
+CONFIG_ARCH_USES_PG_UNCACHED=y
+CONFIG_ARCH_RANDOM=y
+CONFIG_EFI=y
+# CONFIG_EFI_STUB is not set
+CONFIG_SECCOMP=y
+# CONFIG_CC_STACKPROTECTOR is not set
+CONFIG_HZ_100=y
+# CONFIG_HZ_250 is not set
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=100
+CONFIG_SCHED_HRTICK=y
+CONFIG_KEXEC=y
+CONFIG_CRASH_DUMP=y
+# CONFIG_KEXEC_JUMP is not set
+CONFIG_PHYSICAL_START=0x1000000
+CONFIG_RELOCATABLE=y
+CONFIG_X86_NEED_RELOCS=y
+CONFIG_PHYSICAL_ALIGN=0x1000000
+# CONFIG_COMPAT_VDSO is not set
+# CONFIG_CMDLINE_BOOL is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+
+#
+# Power management and ACPI options
+#
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+CONFIG_HIBERNATE_CALLBACKS=y
+CONFIG_HIBERNATION=y
+CONFIG_PM_STD_PARTITION=""
+CONFIG_PM_SLEEP=y
+# CONFIG_PM_RUNTIME is not set
+CONFIG_PM=y
+CONFIG_PM_DEBUG=y
+# CONFIG_PM_ADVANCED_DEBUG is not set
+# CONFIG_PM_TEST_SUSPEND is not set
+CONFIG_CAN_PM_TRACE=y
+CONFIG_PM_TRACE=y
+CONFIG_PM_TRACE_RTC=y
+CONFIG_ACPI=y
+CONFIG_ACPI_SLEEP=y
+CONFIG_ACPI_PROCFS=y
+# CONFIG_ACPI_PROCFS_POWER is not set
+# CONFIG_ACPI_EC_DEBUGFS is not set
+CONFIG_ACPI_PROC_EVENT=y
+# CONFIG_ACPI_AC is not set
+# CONFIG_ACPI_BATTERY is not set
+CONFIG_ACPI_BUTTON=y
+CONFIG_ACPI_VIDEO=y
+CONFIG_ACPI_FAN=y
+CONFIG_ACPI_DOCK=y
+CONFIG_ACPI_PROCESSOR=y
+# CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set
+CONFIG_ACPI_THERMAL=y
+# CONFIG_ACPI_CUSTOM_DSDT is not set
+CONFIG_ACPI_BLACKLIST_YEAR=0
+# CONFIG_ACPI_DEBUG is not set
+# CONFIG_ACPI_PCI_SLOT is not set
+CONFIG_X86_PM_TIMER=y
+CONFIG_ACPI_CONTAINER=y
+# CONFIG_ACPI_SBS is not set
+# CONFIG_ACPI_HED is not set
+# CONFIG_ACPI_CUSTOM_METHOD is not set
+# CONFIG_ACPI_BGRT is not set
+# CONFIG_ACPI_APEI is not set
+# CONFIG_SFI is not set
+# CONFIG_APM is not set
+
+#
+# CPU Frequency scaling
+#
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_TABLE=y
+# CONFIG_CPU_FREQ_STAT is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
+
+#
+# x86 CPU frequency scaling drivers
+#
+# CONFIG_X86_PCC_CPUFREQ is not set
+CONFIG_X86_ACPI_CPUFREQ=y
+# CONFIG_X86_POWERNOW_K6 is not set
+# CONFIG_X86_POWERNOW_K7 is not set
+# CONFIG_X86_POWERNOW_K8 is not set
+# CONFIG_X86_GX_SUSPMOD is not set
+# CONFIG_X86_SPEEDSTEP_CENTRINO is not set
+# CONFIG_X86_SPEEDSTEP_ICH is not set
+# CONFIG_X86_SPEEDSTEP_SMI is not set
+# CONFIG_X86_P4_CLOCKMOD is not set
+# CONFIG_X86_CPUFREQ_NFORCE2 is not set
+# CONFIG_X86_LONGRUN is not set
+# CONFIG_X86_LONGHAUL is not set
+# CONFIG_X86_E_POWERSAVER is not set
+
+#
+# shared options
+#
+# CONFIG_X86_SPEEDSTEP_LIB is not set
+CONFIG_CPU_IDLE=y
+CONFIG_CPU_IDLE_GOV_LADDER=y
+CONFIG_CPU_IDLE_GOV_MENU=y
+# CONFIG_INTEL_IDLE is not set
+
+#
+# Bus options (PCI etc.)
+#
+CONFIG_PCI=y
+# CONFIG_PCI_GOBIOS is not set
+# CONFIG_PCI_GOMMCONFIG is not set
+# CONFIG_PCI_GODIRECT is not set
+CONFIG_PCI_GOANY=y
+CONFIG_PCI_BIOS=y
+CONFIG_PCI_DIRECT=y
+CONFIG_PCI_MMCONFIG=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_PCI_CNB20LE_QUIRK is not set
+CONFIG_PCIEPORTBUS=y
+# CONFIG_HOTPLUG_PCI_PCIE is not set
+CONFIG_PCIEAER=y
+# CONFIG_PCIE_ECRC is not set
+# CONFIG_PCIEAER_INJECT is not set
+CONFIG_PCIEASPM=y
+# CONFIG_PCIEASPM_DEBUG is not set
+CONFIG_PCIEASPM_DEFAULT=y
+# CONFIG_PCIEASPM_POWERSAVE is not set
+# CONFIG_PCIEASPM_PERFORMANCE is not set
+# CONFIG_ARCH_SUPPORTS_MSI is not set
+# 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_PCI_IOAPIC is not set
+CONFIG_PCI_LABEL=y
+CONFIG_ISA_DMA_API=y
+# CONFIG_ISA is not set
+# CONFIG_MCA is not set
+# CONFIG_SCx200 is not set
+# CONFIG_OLPC is not set
+# CONFIG_ALIX is not set
+# CONFIG_NET5501 is not set
+# CONFIG_GEOS is not set
+CONFIG_AMD_NB=y
+CONFIG_PCCARD=y
+CONFIG_PCMCIA=y
+CONFIG_PCMCIA_LOAD_CIS=y
+CONFIG_CARDBUS=y
+
+#
+# PC-card bridges
+#
+CONFIG_YENTA=y
+CONFIG_YENTA_O2=y
+CONFIG_YENTA_RICOH=y
+CONFIG_YENTA_TI=y
+CONFIG_YENTA_ENE_TUNE=y
+CONFIG_YENTA_TOSHIBA=y
+# CONFIG_PD6729 is not set
+# CONFIG_I82092 is not set
+CONFIG_PCCARD_NONSTATIC=y
+CONFIG_HOTPLUG_PCI=y
+# CONFIG_HOTPLUG_PCI_FAKE is not set
+# CONFIG_HOTPLUG_PCI_COMPAQ is not set
+# CONFIG_HOTPLUG_PCI_ACPI is not set
+# CONFIG_HOTPLUG_PCI_CPCI is not set
+# CONFIG_HOTPLUG_PCI_SHPC is not set
+# CONFIG_RAPIDIO is not set
+
+#
+# Executable file formats / Emulations
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
+CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
+CONFIG_HAVE_AOUT=y
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_MISC=y
+CONFIG_HAVE_ATOMIC_IOMAP=y
+CONFIG_HAVE_TEXT_POKE_SMP=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+# CONFIG_UNIX_DIAG is not set
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=y
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_XFRM_STATISTICS is not set
+# CONFIG_NET_KEY is not set
+CONFIG_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=y
+CONFIG_IP_ROUTE_VERBOSE=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+CONFIG_IP_PNP_RARP=y
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE_DEMUX is not set
+CONFIG_IP_MROUTE=y
+# CONFIG_IP_MROUTE_MULTIPLE_TABLES is not set
+CONFIG_IP_PIMSM_V1=y
+CONFIG_IP_PIMSM_V2=y
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+CONFIG_INET_TUNNEL=y
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+CONFIG_INET_LRO=y
+# CONFIG_INET_DIAG is not set
+CONFIG_TCP_CONG_ADVANCED=y
+# CONFIG_TCP_CONG_BIC is not set
+CONFIG_TCP_CONG_CUBIC=y
+# CONFIG_TCP_CONG_WESTWOOD is not set
+# CONFIG_TCP_CONG_HTCP is not set
+# CONFIG_TCP_CONG_HSTCP is not set
+# CONFIG_TCP_CONG_HYBLA is not set
+# CONFIG_TCP_CONG_VEGAS is not set
+# CONFIG_TCP_CONG_SCALABLE is not set
+# CONFIG_TCP_CONG_LP is not set
+# CONFIG_TCP_CONG_VENO is not set
+# CONFIG_TCP_CONG_YEAH is not set
+# CONFIG_TCP_CONG_ILLINOIS is not set
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
+CONFIG_TCP_MD5SIG=y
+CONFIG_IPV6=y
+# CONFIG_IPV6_PRIVACY is not set
+# CONFIG_IPV6_ROUTER_PREF is not set
+# CONFIG_IPV6_OPTIMISTIC_DAD is not set
+CONFIG_INET6_AH=y
+CONFIG_INET6_ESP=y
+# CONFIG_INET6_IPCOMP is not set
+# CONFIG_IPV6_MIP6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+CONFIG_INET6_XFRM_MODE_TRANSPORT=y
+CONFIG_INET6_XFRM_MODE_TUNNEL=y
+CONFIG_INET6_XFRM_MODE_BEET=y
+# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set
+CONFIG_IPV6_SIT=y
+# CONFIG_IPV6_SIT_6RD is not set
+CONFIG_IPV6_NDISC_NODETYPE=y
+# CONFIG_IPV6_TUNNEL is not set
+# CONFIG_IPV6_MULTIPLE_TABLES is not set
+# CONFIG_IPV6_MROUTE is not set
+CONFIG_NETLABEL=y
+CONFIG_NETWORK_SECMARK=y
+# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+# CONFIG_NETFILTER_ADVANCED is not set
+
+#
+# Core Netfilter Configuration
+#
+CONFIG_NETFILTER_NETLINK=y
+CONFIG_NETFILTER_NETLINK_LOG=y
+CONFIG_NF_CONNTRACK=y
+CONFIG_NF_CONNTRACK_SECMARK=y
+CONFIG_NF_CONNTRACK_PROCFS=y
+CONFIG_NF_CONNTRACK_FTP=y
+CONFIG_NF_CONNTRACK_IRC=y
+# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set
+CONFIG_NF_CONNTRACK_SIP=y
+CONFIG_NF_CT_NETLINK=y
+CONFIG_NETFILTER_XTABLES=y
+
+#
+# Xtables combined modules
+#
+CONFIG_NETFILTER_XT_MARK=m
+
+#
+# Xtables targets
+#
+CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=y
+CONFIG_NETFILTER_XT_TARGET_LOG=m
+CONFIG_NETFILTER_XT_TARGET_NFLOG=y
+CONFIG_NETFILTER_XT_TARGET_SECMARK=y
+CONFIG_NETFILTER_XT_TARGET_TCPMSS=y
+
+#
+# Xtables matches
+#
+CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y
+CONFIG_NETFILTER_XT_MATCH_POLICY=y
+CONFIG_NETFILTER_XT_MATCH_STATE=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_FILTER=y
+CONFIG_IP_NF_TARGET_REJECT=y
+CONFIG_IP_NF_TARGET_ULOG=y
+CONFIG_NF_NAT=y
+CONFIG_NF_NAT_NEEDED=y
+CONFIG_IP_NF_TARGET_MASQUERADE=y
+CONFIG_NF_NAT_FTP=y
+CONFIG_NF_NAT_IRC=y
+# CONFIG_NF_NAT_TFTP is not set
+# CONFIG_NF_NAT_AMANDA is not set
+# CONFIG_NF_NAT_PPTP is not set
+# CONFIG_NF_NAT_H323 is not set
+CONFIG_NF_NAT_SIP=y
+CONFIG_IP_NF_MANGLE=y
+# CONFIG_IP_NF_RAW is not set
+
+#
+# IPv6: Netfilter Configuration
+#
+CONFIG_NF_DEFRAG_IPV6=y
+CONFIG_NF_CONNTRACK_IPV6=y
+CONFIG_IP6_NF_IPTABLES=y
+CONFIG_IP6_NF_MATCH_IPV6HEADER=y
+CONFIG_IP6_NF_FILTER=y
+CONFIG_IP6_NF_TARGET_REJECT=y
+CONFIG_IP6_NF_MANGLE=y
+# CONFIG_IP6_NF_RAW is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_RDS is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_L2TP is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_NET_DSA is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_PHONET is not set
+# CONFIG_IEEE802154 is not set
+CONFIG_NET_SCHED=y
+
+#
+# Queueing/Scheduling
+#
+# CONFIG_NET_SCH_CBQ is not set
+# CONFIG_NET_SCH_HTB is not set
+# CONFIG_NET_SCH_HFSC is not set
+# CONFIG_NET_SCH_PRIO is not set
+# CONFIG_NET_SCH_MULTIQ is not set
+# CONFIG_NET_SCH_RED is not set
+# CONFIG_NET_SCH_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_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 is not set
+# CONFIG_NET_CLS_U32 is not set
+# CONFIG_NET_CLS_RSVP is not set
+# CONFIG_NET_CLS_RSVP6 is not set
+# CONFIG_NET_CLS_FLOW is not set
+# CONFIG_NET_CLS_CGROUP is not set
+CONFIG_NET_EMATCH=y
+CONFIG_NET_EMATCH_STACK=32
+# CONFIG_NET_EMATCH_CMP is not set
+# CONFIG_NET_EMATCH_NBYTE is not set
+# CONFIG_NET_EMATCH_U32 is not set
+# CONFIG_NET_EMATCH_META is not set
+# CONFIG_NET_EMATCH_TEXT is not set
+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_SCH_FIFO=y
+# CONFIG_DCB is not set
+CONFIG_DNS_RESOLVER=y
+# CONFIG_BATMAN_ADV is not set
+# CONFIG_OPENVSWITCH is not set
+# CONFIG_NETPRIO_CGROUP is not set
+CONFIG_BQL=y
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_NET_TCPPROBE is not set
+# CONFIG_NET_DROP_MONITOR is not set
+CONFIG_HAMRADIO=y
+
+#
+# Packet Radio protocols
+#
+# CONFIG_AX25 is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+CONFIG_FIB_RULES=y
+CONFIG_WIRELESS=y
+CONFIG_WEXT_CORE=y
+CONFIG_WEXT_PROC=y
+CONFIG_CFG80211=y
+# CONFIG_NL80211_TESTMODE is not set
+# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
+# CONFIG_CFG80211_REG_DEBUG is not set
+CONFIG_CFG80211_DEFAULT_PS=y
+# CONFIG_CFG80211_DEBUGFS is not set
+# CONFIG_CFG80211_INTERNAL_REGDB is not set
+CONFIG_CFG80211_WEXT=y
+# CONFIG_WIRELESS_EXT_SYSFS is not set
+# CONFIG_LIB80211 is not set
+CONFIG_MAC80211=y
+CONFIG_MAC80211_HAS_RC=y
+CONFIG_MAC80211_RC_MINSTREL=y
+CONFIG_MAC80211_RC_MINSTREL_HT=y
+CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
+CONFIG_MAC80211_RC_DEFAULT="minstrel_ht"
+# CONFIG_MAC80211_MESH is not set
+CONFIG_MAC80211_LEDS=y
+# CONFIG_MAC80211_DEBUGFS is not set
+# CONFIG_MAC80211_DEBUG_MENU is not set
+# CONFIG_WIMAX is not set
+CONFIG_RFKILL=y
+CONFIG_RFKILL_LEDS=y
+CONFIG_RFKILL_INPUT=y
+# CONFIG_NET_9P is not set
+# CONFIG_CAIF is not set
+# CONFIG_CEPH_LIB is not set
+# CONFIG_NFC is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+# 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_DEBUG_DRIVER is not set
+CONFIG_DEBUG_DEVRES=y
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_GENERIC_CPU_DEVICES is not set
+CONFIG_DMA_SHARED_BUFFER=y
+CONFIG_CONNECTOR=y
+CONFIG_PROC_EVENTS=y
+# CONFIG_MTD is not set
+# CONFIG_PARPORT is not set
+CONFIG_PNP=y
+CONFIG_PNP_DEBUG_MESSAGES=y
+
+#
+# Protocols
+#
+CONFIG_PNPACPI=y
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set
+# CONFIG_BLK_CPQ_DA 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_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=16384
+# CONFIG_BLK_DEV_XIP is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+CONFIG_VIRTIO_BLK=y
+# CONFIG_BLK_DEV_HD is not set
+# CONFIG_BLK_DEV_RBD is not set
+
+#
+# Misc devices
+#
+# CONFIG_SENSORS_LIS3LV02D is not set
+# CONFIG_AD525X_DPOT is not set
+# CONFIG_IBM_ASM 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_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_VMWARE_BALLOON is not set
+# CONFIG_BMP085 is not set
+# CONFIG_PCH_PHUB is not set
+# CONFIG_USB_SWITCH_FSA9480 is not set
+# CONFIG_C2PORT is not set
+
+#
+# EEPROM support
+#
+# CONFIG_EEPROM_AT24 is not set
+# CONFIG_EEPROM_LEGACY is not set
+# CONFIG_EEPROM_MAX6875 is not set
+# CONFIG_EEPROM_93CX6 is not set
+# CONFIG_CB710_CORE is not set
+
+#
+# Texas Instruments shared transport line discipline
+#
+# CONFIG_SENSORS_LIS3_I2C is not set
+
+#
+# Altera FPGA firmware download module
+#
+# CONFIG_ALTERA_STAPL is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+CONFIG_SCSI_MOD=y
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+# CONFIG_SCSI_TGT is not set
+# CONFIG_SCSI_NETLINK is not set
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+CONFIG_BLK_DEV_SR=y
+CONFIG_BLK_DEV_SR_VENDOR=y
+CONFIG_CHR_DEV_SG=y
+# CONFIG_CHR_DEV_SCH is not set
+# CONFIG_SCSI_MULTI_LUN is not set
+CONFIG_SCSI_CONSTANTS=y
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+CONFIG_SCSI_WAIT_SCAN=m
+
+#
+# SCSI Transports
+#
+CONFIG_SCSI_SPI_ATTRS=y
+# 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 is not set
+# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set
+# CONFIG_SCSI_DH is not set
+# CONFIG_SCSI_OSD_INITIATOR is not set
+CONFIG_ATA=y
+# CONFIG_ATA_NONSTANDARD is not set
+CONFIG_ATA_VERBOSE_ERROR=y
+CONFIG_ATA_ACPI=y
+CONFIG_SATA_PMP=y
+
+#
+# Controllers with non-SFF native interface
+#
+CONFIG_SATA_AHCI=y
+# CONFIG_SATA_AHCI_PLATFORM is not set
+# CONFIG_SATA_INIC162X is not set
+# CONFIG_SATA_ACARD_AHCI is not set
+# CONFIG_SATA_SIL24 is not set
+CONFIG_ATA_SFF=y
+
+#
+# SFF controllers with custom DMA interface
+#
+# CONFIG_PDC_ADMA is not set
+# CONFIG_SATA_QSTOR is not set
+# CONFIG_SATA_SX4 is not set
+CONFIG_ATA_BMDMA=y
+
+#
+# SATA SFF controllers with BMDMA
+#
+CONFIG_ATA_PIIX=y
+# CONFIG_SATA_MV is not set
+# CONFIG_SATA_NV is not set
+# CONFIG_SATA_PROMISE is not set
+# CONFIG_SATA_SIL is not set
+# CONFIG_SATA_SIS is not set
+# CONFIG_SATA_SVW is not set
+# CONFIG_SATA_ULI is not set
+# CONFIG_SATA_VIA is not set
+# CONFIG_SATA_VITESSE is not set
+
+#
+# PATA SFF controllers with BMDMA
+#
+# CONFIG_PATA_ALI is not set
+CONFIG_PATA_AMD=y
+# CONFIG_PATA_ARASAN_CF is not set
+# CONFIG_PATA_ARTOP is not set
+# CONFIG_PATA_ATIIXP is not set
+# CONFIG_PATA_ATP867X is not set
+# CONFIG_PATA_CMD64X is not set
+# CONFIG_PATA_CS5520 is not set
+# CONFIG_PATA_CS5530 is not set
+# CONFIG_PATA_CS5535 is not set
+# CONFIG_PATA_CS5536 is not set
+# CONFIG_PATA_CYPRESS is not set
+# CONFIG_PATA_EFAR is not set
+# CONFIG_PATA_HPT366 is not set
+# CONFIG_PATA_HPT37X is not set
+# CONFIG_PATA_HPT3X2N is not set
+# CONFIG_PATA_HPT3X3 is not set
+# CONFIG_PATA_IT8213 is not set
+# CONFIG_PATA_IT821X is not set
+# CONFIG_PATA_JMICRON is not set
+# CONFIG_PATA_MARVELL is not set
+# CONFIG_PATA_NETCELL is not set
+# CONFIG_PATA_NINJA32 is not set
+# CONFIG_PATA_NS87415 is not set
+CONFIG_PATA_OLDPIIX=y
+# CONFIG_PATA_OPTIDMA is not set
+# CONFIG_PATA_PDC2027X is not set
+# CONFIG_PATA_PDC_OLD is not set
+# CONFIG_PATA_RADISYS is not set
+# CONFIG_PATA_RDC is not set
+# CONFIG_PATA_SC1200 is not set
+CONFIG_PATA_SCH=y
+# CONFIG_PATA_SERVERWORKS is not set
+# CONFIG_PATA_SIL680 is not set
+# CONFIG_PATA_SIS is not set
+# CONFIG_PATA_TOSHIBA is not set
+# CONFIG_PATA_TRIFLEX is not set
+# CONFIG_PATA_VIA is not set
+# CONFIG_PATA_WINBOND is not set
+
+#
+# PIO-only SFF controllers
+#
+# CONFIG_PATA_CMD640_PCI is not set
+CONFIG_PATA_MPIIX=y
+# CONFIG_PATA_NS87410 is not set
+# CONFIG_PATA_OPTI is not set
+# CONFIG_PATA_PCMCIA is not set
+# CONFIG_PATA_RZ1000 is not set
+
+#
+# Generic fallback / legacy drivers
+#
+# CONFIG_PATA_ACPI is not set
+CONFIG_ATA_GENERIC=y
+# CONFIG_PATA_LEGACY is not set
+# CONFIG_MD is not set
+# 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_MACINTOSH_DRIVERS=y
+CONFIG_MAC_EMUMOUSEBTN=y
+CONFIG_NETDEVICES=y
+CONFIG_NET_CORE=y
+# CONFIG_BONDING is not set
+# CONFIG_DUMMY is not set
+# 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_NETCONSOLE=y
+CONFIG_NETPOLL=y
+# CONFIG_NETPOLL_TRAP is not set
+CONFIG_NET_POLL_CONTROLLER=y
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+CONFIG_VIRTIO_NET=y
+# CONFIG_ARCNET is not set
+
+#
+# CAIF transport drivers
+#
+CONFIG_ETHERNET=y
+CONFIG_NET_VENDOR_3COM=y
+# CONFIG_PCMCIA_3C574 is not set
+# CONFIG_PCMCIA_3C589 is not set
+# CONFIG_VORTEX is not set
+# CONFIG_TYPHOON is not set
+CONFIG_NET_VENDOR_ADAPTEC=y
+# CONFIG_ADAPTEC_STARFIRE is not set
+CONFIG_NET_VENDOR_ALTEON=y
+# CONFIG_ACENIC is not set
+CONFIG_NET_VENDOR_AMD=y
+# CONFIG_AMD8111_ETH is not set
+# CONFIG_PCNET32 is not set
+# CONFIG_PCMCIA_NMCLAN is not set
+CONFIG_NET_VENDOR_ATHEROS=y
+# CONFIG_ATL2 is not set
+# CONFIG_ATL1 is not set
+# CONFIG_ATL1E is not set
+# CONFIG_ATL1C is not set
+CONFIG_NET_VENDOR_BROADCOM=y
+# CONFIG_B44 is not set
+CONFIG_BNX2=y
+# CONFIG_CNIC is not set
+CONFIG_TIGON3=y
+# CONFIG_BNX2X is not set
+CONFIG_NET_VENDOR_BROCADE=y
+# CONFIG_BNA is not set
+# CONFIG_NET_CALXEDA_XGMAC is not set
+CONFIG_NET_VENDOR_CHELSIO=y
+# CONFIG_CHELSIO_T1 is not set
+# CONFIG_CHELSIO_T3 is not set
+# CONFIG_CHELSIO_T4 is not set
+# CONFIG_CHELSIO_T4VF is not set
+CONFIG_NET_VENDOR_CISCO=y
+# CONFIG_ENIC is not set
+# CONFIG_DNET is not set
+CONFIG_NET_VENDOR_DEC=y
+CONFIG_NET_TULIP=y
+# CONFIG_DE2104X is not set
+# CONFIG_TULIP is not set
+# CONFIG_DE4X5 is not set
+# CONFIG_WINBOND_840 is not set
+# CONFIG_DM9102 is not set
+# CONFIG_ULI526X is not set
+# CONFIG_PCMCIA_XIRCOM is not set
+CONFIG_NET_VENDOR_DLINK=y
+# CONFIG_DL2K is not set
+# CONFIG_SUNDANCE is not set
+CONFIG_NET_VENDOR_EMULEX=y
+# CONFIG_BE2NET is not set
+CONFIG_NET_VENDOR_EXAR=y
+# CONFIG_S2IO is not set
+# CONFIG_VXGE is not set
+CONFIG_NET_VENDOR_FUJITSU=y
+# CONFIG_PCMCIA_FMVJ18X is not set
+CONFIG_NET_VENDOR_HP=y
+# CONFIG_HP100 is not set
+CONFIG_NET_VENDOR_INTEL=y
+CONFIG_E100=y
+CONFIG_E1000=y
+CONFIG_E1000E=y
+# CONFIG_IGB is not set
+# CONFIG_IGBVF is not set
+# CONFIG_IXGB is not set
+# CONFIG_IXGBE is not set
+CONFIG_NET_VENDOR_I825XX=y
+# CONFIG_ZNET is not set
+# CONFIG_IP1000 is not set
+# CONFIG_JME is not set
+CONFIG_NET_VENDOR_MARVELL=y
+# CONFIG_SKGE is not set
+CONFIG_SKY2=y
+# CONFIG_SKY2_DEBUG is not set
+CONFIG_NET_VENDOR_MELLANOX=y
+# CONFIG_MLX4_EN is not set
+# CONFIG_MLX4_CORE is not set
+CONFIG_NET_VENDOR_MICREL=y
+# CONFIG_KS8851_MLL is not set
+# CONFIG_KSZ884X_PCI is not set
+CONFIG_NET_VENDOR_MYRI=y
+# CONFIG_MYRI10GE is not set
+# CONFIG_FEALNX is not set
+CONFIG_NET_VENDOR_NATSEMI=y
+# CONFIG_NATSEMI is not set
+# CONFIG_NS83820 is not set
+CONFIG_NET_VENDOR_8390=y
+# CONFIG_PCMCIA_AXNET is not set
+CONFIG_NE2K_PCI=y
+# CONFIG_PCMCIA_PCNET is not set
+CONFIG_NET_VENDOR_NVIDIA=y
+CONFIG_FORCEDETH=y
+CONFIG_NET_VENDOR_OKI=y
+# CONFIG_PCH_GBE is not set
+# CONFIG_ETHOC is not set
+CONFIG_NET_PACKET_ENGINE=y
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+CONFIG_NET_VENDOR_QLOGIC=y
+# CONFIG_QLA3XXX is not set
+# CONFIG_QLCNIC is not set
+# CONFIG_QLGE is not set
+# CONFIG_NETXEN_NIC is not set
+CONFIG_NET_VENDOR_REALTEK=y
+# CONFIG_8139CP is not set
+CONFIG_8139TOO=y
+# CONFIG_8139TOO_PIO is not set
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+# CONFIG_8139TOO_8129 is not set
+# CONFIG_8139_OLD_RX_RESET is not set
+CONFIG_R8169=y
+CONFIG_NET_VENDOR_RDC=y
+# CONFIG_R6040 is not set
+CONFIG_NET_VENDOR_SEEQ=y
+# CONFIG_SEEQ8005 is not set
+CONFIG_NET_VENDOR_SILAN=y
+# CONFIG_SC92031 is not set
+CONFIG_NET_VENDOR_SIS=y
+# CONFIG_SIS900 is not set
+# CONFIG_SIS190 is not set
+# CONFIG_SFC is not set
+CONFIG_NET_VENDOR_SMSC=y
+# CONFIG_PCMCIA_SMC91C92 is not set
+# CONFIG_EPIC100 is not set
+# CONFIG_SMSC9420 is not set
+CONFIG_NET_VENDOR_STMICRO=y
+# CONFIG_STMMAC_ETH is not set
+CONFIG_NET_VENDOR_SUN=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NIU is not set
+CONFIG_NET_VENDOR_TEHUTI=y
+# CONFIG_TEHUTI is not set
+CONFIG_NET_VENDOR_TI=y
+# CONFIG_TLAN is not set
+CONFIG_NET_VENDOR_VIA=y
+# CONFIG_VIA_RHINE is not set
+# CONFIG_VIA_VELOCITY is not set
+CONFIG_NET_VENDOR_XIRCOM=y
+# CONFIG_PCMCIA_XIRC2PS is not set
+CONFIG_FDDI=y
+# CONFIG_DEFXX is not set
+# CONFIG_SKFP is not set
+# CONFIG_HIPPI is not set
+# CONFIG_NET_SB1000 is not set
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# 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_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_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_TR is not set
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+# CONFIG_USB_HSO is not set
+# CONFIG_USB_IPHETH is not set
+CONFIG_WLAN=y
+# CONFIG_PCMCIA_RAYCS is not set
+# CONFIG_LIBERTAS_THINFIRM is not set
+# CONFIG_AIRO is not set
+# CONFIG_ATMEL is not set
+# CONFIG_AT76C50X_USB is not set
+# CONFIG_AIRO_CS is not set
+# CONFIG_PCMCIA_WL3501 is not set
+# CONFIG_PRISM54 is not set
+# CONFIG_USB_ZD1201 is not set
+# CONFIG_USB_NET_RNDIS_WLAN is not set
+# CONFIG_RTL8180 is not set
+# CONFIG_RTL8187 is not set
+# CONFIG_ADM8211 is not set
+# CONFIG_MAC80211_HWSIM is not set
+# CONFIG_MWL8K is not set
+# CONFIG_ATH_COMMON is not set
+# CONFIG_B43 is not set
+# CONFIG_B43LEGACY is not set
+# CONFIG_BRCMFMAC is not set
+# CONFIG_HOSTAP is not set
+# CONFIG_IPW2100 is not set
+# CONFIG_IPW2200 is not set
+# CONFIG_IWLWIFI is not set
+# CONFIG_IWL4965 is not set
+# CONFIG_IWL3945 is not set
+# CONFIG_LIBERTAS is not set
+# CONFIG_HERMES is not set
+# CONFIG_P54_COMMON is not set
+# CONFIG_RT2X00 is not set
+# CONFIG_RTL8192CE is not set
+# CONFIG_RTL8192SE is not set
+# CONFIG_RTL8192DE is not set
+# CONFIG_RTL8192CU is not set
+# CONFIG_WL1251 is not set
+# CONFIG_WL12XX_MENU is not set
+# CONFIG_ZD1211RW is not set
+# CONFIG_MWIFIEX is not set
+
+#
+# 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=y
+CONFIG_INPUT_SPARSEKMAP=y
+
+#
+# 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_SECBRIDGE=y
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ADP5588 is not set
+# CONFIG_KEYBOARD_ADP5589 is not set
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_QT1070 is not set
+# CONFIG_KEYBOARD_QT2160 is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_TCA6416 is not set
+# CONFIG_KEYBOARD_TCA8418 is not set
+# CONFIG_KEYBOARD_LM8323 is not set
+# CONFIG_KEYBOARD_MAX7359 is not set
+# CONFIG_KEYBOARD_MCS is not set
+# CONFIG_KEYBOARD_MPR121 is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_OPENCORES is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_OMAP4 is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_LIFEBOOK=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
+# CONFIG_MOUSE_PS2_SENTELIC is not set
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_BCM5974 is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_MOUSE_SYNAPTICS_I2C is not set
+# CONFIG_MOUSE_SYNAPTICS_USB 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 is not set
+CONFIG_INPUT_TABLET=y
+# CONFIG_TABLET_USB_ACECAD is not set
+# CONFIG_TABLET_USB_AIPTEK is not set
+# CONFIG_TABLET_USB_GTCO is not set
+# CONFIG_TABLET_USB_HANWANG is not set
+# CONFIG_TABLET_USB_KBTAB is not set
+# CONFIG_TABLET_USB_WACOM is not set
+CONFIG_INPUT_TOUCHSCREEN=y
+# CONFIG_TOUCHSCREEN_AD7879 is not set
+# CONFIG_TOUCHSCREEN_ATMEL_MXT is not set
+# CONFIG_TOUCHSCREEN_BU21013 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_MAX11801 is not set
+# CONFIG_TOUCHSCREEN_MCS5000 is not set
+# CONFIG_TOUCHSCREEN_MTOUCH is not set
+# CONFIG_TOUCHSCREEN_INEXIO is not set
+# CONFIG_TOUCHSCREEN_MK712 is not set
+# CONFIG_TOUCHSCREEN_PENMOUNT is not set
+# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
+# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
+# CONFIG_TOUCHSCREEN_PIXCIR is not set
+# CONFIG_TOUCHSCREEN_WM97XX 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_TSC2007 is not set
+# CONFIG_TOUCHSCREEN_ST1232 is not set
+# CONFIG_TOUCHSCREEN_TPS6507X is not set
+CONFIG_INPUT_MISC=y
+# CONFIG_INPUT_AD714X is not set
+# CONFIG_INPUT_BMA150 is not set
+# CONFIG_INPUT_PCSPKR is not set
+# CONFIG_INPUT_MMA8450 is not set
+# CONFIG_INPUT_MPU3050 is not set
+# CONFIG_INPUT_APANEL is not set
+# CONFIG_INPUT_WISTRON_BTNS is not set
+# CONFIG_INPUT_ATLAS_BTNS is not set
+# CONFIG_INPUT_ATI_REMOTE2 is not set
+# 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 is not set
+# CONFIG_INPUT_PCF8574 is not set
+# CONFIG_INPUT_ADXL34X is not set
+# CONFIG_INPUT_CMA3000 is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_I8042=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_CT82C710 is not set
+# CONFIG_SERIO_PCIPS2 is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_SERIO_ALTERA_PS2 is not set
+# CONFIG_SERIO_PS2MULT is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_VT_CONSOLE_SLEEP=y
+CONFIG_HW_CONSOLE=y
+CONFIG_VT_HW_CONSOLE_BINDING=y
+CONFIG_UNIX98_PTYS=y
+# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
+# CONFIG_LEGACY_PTYS is not set
+CONFIG_SERIAL_NONSTANDARD=y
+# CONFIG_ROCKETPORT is not set
+# CONFIG_CYCLADES is not set
+# CONFIG_MOXA_INTELLIO is not set
+# CONFIG_MOXA_SMARTIO is not set
+# CONFIG_SYNCLINK is not set
+# CONFIG_SYNCLINKMP is not set
+# CONFIG_SYNCLINK_GT is not set
+# CONFIG_NOZOMI is not set
+# CONFIG_ISI is not set
+# CONFIG_N_HDLC is not set
+# CONFIG_N_GSM is not set
+# CONFIG_TRACE_SINK is not set
+CONFIG_DEVKMEM=y
+# CONFIG_STALDRV is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_FIX_EARLYCON_MEM=y
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_PNP=y
+# CONFIG_SERIAL_8250_CS is not set
+CONFIG_SERIAL_8250_NR_UARTS=32
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_8250_DETECT_IRQ=y
+CONFIG_SERIAL_8250_RSA=y
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_MFD_HSU is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM 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_PCH_UART is not set
+# CONFIG_SERIAL_XILINX_PS_UART is not set
+# CONFIG_VIRTIO_CONSOLE is not set
+# CONFIG_IPMI_HANDLER is not set
+CONFIG_HW_RANDOM=y
+# CONFIG_HW_RANDOM_TIMERIOMEM is not set
+CONFIG_HW_RANDOM_INTEL=y
+CONFIG_HW_RANDOM_AMD=y
+CONFIG_HW_RANDOM_GEODE=y
+CONFIG_HW_RANDOM_VIA=y
+# CONFIG_HW_RANDOM_VIRTIO is not set
+CONFIG_NVRAM=y
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_SONYPI is not set
+
+#
+# PCMCIA character devices
+#
+# CONFIG_SYNCLINK_CS is not set
+# CONFIG_CARDMAN_4000 is not set
+# CONFIG_CARDMAN_4040 is not set
+# CONFIG_IPWIRELESS is not set
+# CONFIG_MWAVE is not set
+# CONFIG_PC8736x_GPIO is not set
+# CONFIG_NSC_GPIO is not set
+# CONFIG_RAW_DRIVER is not set
+CONFIG_HPET=y
+# CONFIG_HPET_MMAP is not set
+# CONFIG_HANGCHECK_TIMER is not set
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+CONFIG_DEVPORT=y
+# CONFIG_RAMOOPS is not set
+# CONFIG_VDPRAM_DEVICE is not set
+CONFIG_VIRTIOGL=y
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_COMPAT=y
+# CONFIG_I2C_CHARDEV is not set
+# CONFIG_I2C_MUX is not set
+CONFIG_I2C_HELPER_AUTO=y
+CONFIG_I2C_ALGOBIT=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=y
+# 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
+
+#
+# ACPI drivers
+#
+# CONFIG_I2C_SCMI is not set
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+# CONFIG_I2C_DESIGNWARE_PCI is not set
+# CONFIG_I2C_EG20T is not set
+# CONFIG_I2C_INTEL_MID is not set
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_PXA_PCI is not set
+# CONFIG_I2C_SIMTEC is not set
+# CONFIG_I2C_XILINX is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_DIOLAN_U2C is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_TINY_USB is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+# CONFIG_I2C_STUB is not set
+# CONFIG_SCx200_ACB is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_SPI is not set
+# CONFIG_HSI is not set
+
+#
+# PPS support
+#
+# CONFIG_PPS is not set
+
+#
+# PPS generators support
+#
+
+#
+# PTP clock support
+#
+
+#
+# Enable Device Drivers -> PPS to see the PTP clock options.
+#
+CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
+# CONFIG_GPIOLIB is not set
+# 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 is not set
+# CONFIG_CHARGER_MAX8903 is not set
+# CONFIG_CHARGER_LP8727 is not set
+# CONFIG_CHARGER_SMB347 is not set
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Native drivers
+#
+# CONFIG_SENSORS_ABITUGURU is not set
+# CONFIG_SENSORS_ABITUGURU3 is not set
+# CONFIG_SENSORS_AD7414 is not set
+# CONFIG_SENSORS_AD7418 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_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_K8TEMP is not set
+# CONFIG_SENSORS_K10TEMP is not set
+# CONFIG_SENSORS_FAM15H_POWER is not set
+# CONFIG_SENSORS_ASB100 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_FSCHMD is not set
+# CONFIG_SENSORS_G760A is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_CORETEMP 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_LM73 is not set
+# CONFIG_SENSORS_LM75 is not set
+# 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_LM95241 is not set
+# CONFIG_SENSORS_LM95245 is not set
+# CONFIG_SENSORS_MAX16065 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_MAX1668 is not set
+# CONFIG_SENSORS_MAX6639 is not set
+# CONFIG_SENSORS_MAX6642 is not set
+# CONFIG_SENSORS_MAX6650 is not set
+# CONFIG_SENSORS_MCP3021 is not set
+# CONFIG_SENSORS_NTC_THERMISTOR is not set
+# 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_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_SCH5627 is not set
+# CONFIG_SENSORS_SCH5636 is not set
+# CONFIG_SENSORS_ADS1015 is not set
+# CONFIG_SENSORS_ADS7828 is not set
+# CONFIG_SENSORS_AMC6821 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_VIA_CPUTEMP 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_SENSORS_APPLESMC is not set
+
+#
+# ACPI drivers
+#
+# CONFIG_SENSORS_ACPI_POWER is not set
+# CONFIG_SENSORS_ATK0110 is not set
+CONFIG_THERMAL=y
+CONFIG_THERMAL_HWMON=y
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_CORE is not set
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+
+#
+# Watchdog Device Drivers
+#
+# CONFIG_SOFT_WATCHDOG is not set
+# CONFIG_ACQUIRE_WDT is not set
+# CONFIG_ADVANTECH_WDT is not set
+# CONFIG_ALIM1535_WDT is not set
+# CONFIG_ALIM7101_WDT is not set
+# CONFIG_F71808E_WDT is not set
+# CONFIG_SP5100_TCO is not set
+# CONFIG_SC520_WDT is not set
+# CONFIG_SBC_FITPC2_WATCHDOG is not set
+# CONFIG_EUROTECH_WDT is not set
+# CONFIG_IB700_WDT is not set
+# CONFIG_IBMASR is not set
+# CONFIG_WAFER_WDT is not set
+# CONFIG_I6300ESB_WDT is not set
+# CONFIG_ITCO_WDT is not set
+# CONFIG_IT8712F_WDT is not set
+# CONFIG_IT87_WDT is not set
+# CONFIG_HP_WATCHDOG is not set
+# CONFIG_SC1200_WDT is not set
+# CONFIG_PC87413_WDT is not set
+# CONFIG_NV_TCO is not set
+# CONFIG_60XX_WDT is not set
+# CONFIG_SBC8360_WDT is not set
+# CONFIG_SBC7240_WDT is not set
+# CONFIG_CPU5_WDT is not set
+# CONFIG_SMSC_SCH311X_WDT is not set
+# CONFIG_SMSC37B787_WDT is not set
+# CONFIG_VIA_WDT is not set
+# CONFIG_W83627HF_WDT is not set
+# CONFIG_W83697HF_WDT is not set
+# CONFIG_W83697UG_WDT is not set
+# CONFIG_W83877F_WDT is not set
+# CONFIG_W83977F_WDT is not set
+# CONFIG_MACHZ_WDT is not set
+# CONFIG_SBC_EPX_C3_WATCHDOG is not set
+
+#
+# PCI-based Watchdog Cards
+#
+# CONFIG_PCIPCWATCHDOG is not set
+# CONFIG_WDTPCI is not set
+
+#
+# USB-based Watchdog Cards
+#
+# CONFIG_USBPCWATCHDOG 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 is not set
+# CONFIG_MFD_88PM860X is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_TPS6105X is not set
+# CONFIG_TPS6507X is not set
+# CONFIG_MFD_TPS65217 is not set
+# CONFIG_TWL4030_CORE is not set
+# CONFIG_TWL6040_CORE is not set
+# CONFIG_MFD_STMPE is not set
+# CONFIG_MFD_TC3589X is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_MFD_DA9052_I2C is not set
+# CONFIG_PMIC_ADP5520 is not set
+# CONFIG_MFD_MAX8925 is not set
+# CONFIG_MFD_MAX8997 is not set
+# CONFIG_MFD_MAX8998 is not set
+# CONFIG_MFD_S5M_CORE is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM831X_I2C is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_WM8994 is not set
+# CONFIG_MFD_PCF50633 is not set
+# CONFIG_ABX500_CORE is not set
+# CONFIG_MFD_CS5535 is not set
+# CONFIG_LPC_SCH is not set
+# CONFIG_MFD_RDC321X is not set
+# CONFIG_MFD_JANZ_CMODIO is not set
+# CONFIG_MFD_VX855 is not set
+# CONFIG_MFD_WL1273_CORE is not set
+# CONFIG_MFD_TPS65090 is not set
+# CONFIG_MFD_RC5T583 is not set
+# CONFIG_REGULATOR is not set
+CONFIG_MEDIA_SUPPORT=y
+
+#
+# Multimedia core support
+#
+# CONFIG_MEDIA_CONTROLLER is not set
+CONFIG_VIDEO_DEV=y
+CONFIG_VIDEO_V4L2_COMMON=y
+# CONFIG_DVB_CORE is not set
+CONFIG_VIDEO_MEDIA=y
+
+#
+# Multimedia drivers
+#
+# CONFIG_RC_CORE is not set
+# CONFIG_MEDIA_ATTACH is not set
+CONFIG_MEDIA_TUNER=y
+# CONFIG_MEDIA_TUNER_CUSTOMISE is not set
+CONFIG_MEDIA_TUNER_SIMPLE=y
+CONFIG_MEDIA_TUNER_TDA8290=y
+CONFIG_MEDIA_TUNER_TDA827X=y
+CONFIG_MEDIA_TUNER_TDA18271=y
+CONFIG_MEDIA_TUNER_TDA9887=y
+CONFIG_MEDIA_TUNER_TEA5761=y
+CONFIG_MEDIA_TUNER_TEA5767=y
+CONFIG_MEDIA_TUNER_MT20XX=y
+CONFIG_MEDIA_TUNER_XC2028=y
+CONFIG_MEDIA_TUNER_XC5000=y
+CONFIG_MEDIA_TUNER_XC4000=y
+CONFIG_MEDIA_TUNER_MC44S803=y
+CONFIG_VIDEO_V4L2=y
+CONFIG_VIDEO_CAPTURE_DRIVERS=y
+# CONFIG_VIDEO_ADV_DEBUG is not set
+# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set
+CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
+
+#
+# Audio decoders, processors and mixers
+#
+
+#
+# RDS decoders
+#
+
+#
+# Video decoders
+#
+
+#
+# Video and audio decoders
+#
+
+#
+# MPEG video encoders
+#
+
+#
+# Video encoders
+#
+
+#
+# Camera sensor devices
+#
+
+#
+# Flash devices
+#
+
+#
+# Video improvement chips
+#
+
+#
+# Miscelaneous helper chips
+#
+# CONFIG_VIDEO_VIVI is not set
+CONFIG_V4L_USB_DRIVERS=y
+# CONFIG_USB_VIDEO_CLASS is not set
+CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
+CONFIG_USB_GSPCA=m
+# CONFIG_USB_M5602 is not set
+# CONFIG_USB_STV06XX is not set
+# CONFIG_USB_GL860 is not set
+# CONFIG_USB_GSPCA_BENQ is not set
+# CONFIG_USB_GSPCA_CONEX is not set
+# CONFIG_USB_GSPCA_CPIA1 is not set
+# CONFIG_USB_GSPCA_ETOMS is not set
+# CONFIG_USB_GSPCA_FINEPIX is not set
+# CONFIG_USB_GSPCA_JEILINJ is not set
+# CONFIG_USB_GSPCA_JL2005BCD is not set
+# CONFIG_USB_GSPCA_KINECT is not set
+# CONFIG_USB_GSPCA_KONICA is not set
+# CONFIG_USB_GSPCA_MARS is not set
+# CONFIG_USB_GSPCA_MR97310A is not set
+# CONFIG_USB_GSPCA_NW80X is not set
+# CONFIG_USB_GSPCA_OV519 is not set
+# CONFIG_USB_GSPCA_OV534 is not set
+# CONFIG_USB_GSPCA_OV534_9 is not set
+# CONFIG_USB_GSPCA_PAC207 is not set
+# CONFIG_USB_GSPCA_PAC7302 is not set
+# CONFIG_USB_GSPCA_PAC7311 is not set
+# CONFIG_USB_GSPCA_SE401 is not set
+# CONFIG_USB_GSPCA_SN9C2028 is not set
+# CONFIG_USB_GSPCA_SN9C20X is not set
+# CONFIG_USB_GSPCA_SONIXB is not set
+# CONFIG_USB_GSPCA_SONIXJ is not set
+# CONFIG_USB_GSPCA_SPCA500 is not set
+# CONFIG_USB_GSPCA_SPCA501 is not set
+# CONFIG_USB_GSPCA_SPCA505 is not set
+# CONFIG_USB_GSPCA_SPCA506 is not set
+# CONFIG_USB_GSPCA_SPCA508 is not set
+# CONFIG_USB_GSPCA_SPCA561 is not set
+# CONFIG_USB_GSPCA_SPCA1528 is not set
+# CONFIG_USB_GSPCA_SQ905 is not set
+# CONFIG_USB_GSPCA_SQ905C is not set
+# CONFIG_USB_GSPCA_SQ930X is not set
+# CONFIG_USB_GSPCA_STK014 is not set
+# CONFIG_USB_GSPCA_STV0680 is not set
+# CONFIG_USB_GSPCA_SUNPLUS is not set
+# CONFIG_USB_GSPCA_T613 is not set
+# CONFIG_USB_GSPCA_TOPRO is not set
+# CONFIG_USB_GSPCA_TV8532 is not set
+# CONFIG_USB_GSPCA_VC032X is not set
+# CONFIG_USB_GSPCA_VICAM is not set
+# CONFIG_USB_GSPCA_XIRLINK_CIT is not set
+# CONFIG_USB_GSPCA_ZC3XX is not set
+# CONFIG_VIDEO_PVRUSB2 is not set
+# CONFIG_VIDEO_HDPVR is not set
+# CONFIG_VIDEO_EM28XX is not set
+# CONFIG_VIDEO_USBVISION is not set
+# CONFIG_USB_ET61X251 is not set
+# CONFIG_USB_SN9C102 is not set
+# CONFIG_USB_PWC is not set
+# CONFIG_VIDEO_CPIA2 is not set
+# CONFIG_USB_ZR364XX is not set
+# CONFIG_USB_STKWEBCAM is not set
+# CONFIG_USB_S2255 is not set
+CONFIG_V4L_PCI_DRIVERS=y
+# CONFIG_VIDEO_HEXIUM_GEMINI is not set
+# CONFIG_VIDEO_HEXIUM_ORION is not set
+# CONFIG_VIDEO_MXB is not set
+# CONFIG_VIDEO_SAA7134 is not set
+# CONFIG_VIDEO_ZORAN is not set
+# CONFIG_V4L_PLATFORM_DRIVERS is not set
+# CONFIG_V4L_MEM2MEM_DRIVERS is not set
+# CONFIG_RADIO_ADAPTERS is not set
+
+#
+# Graphics support
+#
+CONFIG_AGP=y
+# CONFIG_AGP_ALI is not set
+# CONFIG_AGP_ATI is not set
+# CONFIG_AGP_AMD is not set
+CONFIG_AGP_AMD64=y
+CONFIG_AGP_INTEL=y
+# CONFIG_AGP_NVIDIA is not set
+# CONFIG_AGP_SIS is not set
+# CONFIG_AGP_SWORKS is not set
+# CONFIG_AGP_VIA is not set
+# CONFIG_AGP_EFFICEON is not set
+CONFIG_VGA_ARB=y
+CONFIG_VGA_ARB_MAX_GPUS=16
+# CONFIG_VGA_SWITCHEROO is not set
+CONFIG_DRM=y
+CONFIG_DRM_KMS_HELPER=y
+# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set
+# CONFIG_DRM_TDFX is not set
+# CONFIG_DRM_R128 is not set
+# CONFIG_DRM_RADEON is not set
+# CONFIG_DRM_NOUVEAU is not set
+
+#
+# I2C encoder or helper chips
+#
+# CONFIG_DRM_I2C_CH7006 is not set
+# CONFIG_DRM_I2C_SIL164 is not set
+CONFIG_DRM_I915=y
+# CONFIG_DRM_I915_KMS is not set
+# CONFIG_DRM_MGA is not set
+# CONFIG_DRM_SIS is not set
+# CONFIG_DRM_VIA is not set
+# CONFIG_DRM_SAVAGE is not set
+# CONFIG_DRM_VMWGFX is not set
+# CONFIG_DRM_GMA500 is not set
+# CONFIG_DRM_UDL is not set
+# CONFIG_STUB_POULSBO is not set
+# CONFIG_VGASTATE is not set
+CONFIG_VIDEO_OUTPUT_CONTROL=y
+CONFIG_FB=y
+# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+# CONFIG_FB_SYS_FOPS is not set
+# CONFIG_FB_WMT_GE_ROPS is not set
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+CONFIG_FB_MODE_HELPERS=y
+CONFIG_FB_TILEBLITTING=y
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_CIRRUS is not set
+# CONFIG_FB_PM2 is not set
+# CONFIG_FB_CYBER2000 is not set
+# CONFIG_FB_ARC is not set
+# CONFIG_FB_ASILIANT is not set
+# CONFIG_FB_IMSTT is not set
+# CONFIG_FB_VGA16 is not set
+# CONFIG_FB_UVESA is not set
+# CONFIG_FB_VESA is not set
+# CONFIG_FB_EFI is not set
+# CONFIG_FB_N411 is not set
+# CONFIG_FB_HGA 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_I810 is not set
+# CONFIG_FB_LE80578 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_VIA 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_GEODE is not set
+# CONFIG_FB_SMSCUFX is not set
+# CONFIG_FB_UDL is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
+# CONFIG_FB_BROADSHEET 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=y
+# CONFIG_BACKLIGHT_PROGEAR is not set
+# CONFIG_BACKLIGHT_APPLE is not set
+# CONFIG_BACKLIGHT_SAHARA is not set
+# CONFIG_BACKLIGHT_ADP8860 is not set
+# CONFIG_BACKLIGHT_ADP8870 is not set
+# CONFIG_BACKLIGHT_LP855X is not set
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+CONFIG_VGACON_SOFT_SCROLLBACK=y
+CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
+# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+# CONFIG_LOGO is not set
+CONFIG_SOUND=y
+CONFIG_SOUND_OSS_CORE=y
+CONFIG_SOUND_OSS_CORE_PRECLAIM=y
+CONFIG_SND=y
+CONFIG_SND_TIMER=y
+CONFIG_SND_PCM=y
+CONFIG_SND_HWDEP=y
+CONFIG_SND_SEQUENCER=y
+CONFIG_SND_SEQ_DUMMY=y
+CONFIG_SND_OSSEMUL=y
+CONFIG_SND_MIXER_OSS=y
+CONFIG_SND_PCM_OSS=y
+CONFIG_SND_PCM_OSS_PLUGINS=y
+CONFIG_SND_SEQUENCER_OSS=y
+CONFIG_SND_HRTIMER=y
+CONFIG_SND_SEQ_HRTIMER_DEFAULT=y
+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_VMASTER=y
+CONFIG_SND_KCTL_JACK=y
+CONFIG_SND_DMA_SGBUF=y
+# 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_AC97_CODEC=y
+CONFIG_SND_DRIVERS=y
+# CONFIG_SND_PCSP is not set
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_ALOOP is not set
+# CONFIG_SND_VIRMIDI is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+# CONFIG_SND_AC97_POWER_SAVE is not set
+CONFIG_SND_PCI=y
+# CONFIG_SND_AD1889 is not set
+# CONFIG_SND_ALS300 is not set
+# CONFIG_SND_ALS4000 is not set
+# CONFIG_SND_ALI5451 is not set
+# CONFIG_SND_ASIHPI is not set
+# CONFIG_SND_ATIIXP is not set
+# CONFIG_SND_ATIIXP_MODEM is not set
+# CONFIG_SND_AU8810 is not set
+# CONFIG_SND_AU8820 is not set
+# CONFIG_SND_AU8830 is not set
+# CONFIG_SND_AW2 is not set
+# CONFIG_SND_AZT3328 is not set
+# CONFIG_SND_BT87X is not set
+# CONFIG_SND_CA0106 is not set
+# CONFIG_SND_CMIPCI is not set
+# CONFIG_SND_OXYGEN is not set
+# CONFIG_SND_CS4281 is not set
+# CONFIG_SND_CS46XX is not set
+# CONFIG_SND_CS5530 is not set
+# CONFIG_SND_CS5535AUDIO is not set
+# CONFIG_SND_CTXFI is not set
+# CONFIG_SND_DARLA20 is not set
+# CONFIG_SND_GINA20 is not set
+# CONFIG_SND_LAYLA20 is not set
+# CONFIG_SND_DARLA24 is not set
+# CONFIG_SND_GINA24 is not set
+# CONFIG_SND_LAYLA24 is not set
+# CONFIG_SND_MONA is not set
+# CONFIG_SND_MIA is not set
+# CONFIG_SND_ECHO3G is not set
+# CONFIG_SND_INDIGO is not set
+# CONFIG_SND_INDIGOIO is not set
+# CONFIG_SND_INDIGODJ is not set
+# CONFIG_SND_INDIGOIOX is not set
+# CONFIG_SND_INDIGODJX is not set
+# CONFIG_SND_EMU10K1 is not set
+# CONFIG_SND_EMU10K1X is not set
+# CONFIG_SND_ENS1370 is not set
+# CONFIG_SND_ENS1371 is not set
+# CONFIG_SND_ES1938 is not set
+# CONFIG_SND_ES1968 is not set
+# CONFIG_SND_FM801 is not set
+CONFIG_SND_HDA_INTEL=y
+CONFIG_SND_HDA_PREALLOC_SIZE=64
+CONFIG_SND_HDA_HWDEP=y
+# CONFIG_SND_HDA_RECONFIG is not set
+# CONFIG_SND_HDA_INPUT_BEEP is not set
+# CONFIG_SND_HDA_INPUT_JACK is not set
+# CONFIG_SND_HDA_PATCH_LOADER is not set
+CONFIG_SND_HDA_CODEC_REALTEK=y
+CONFIG_SND_HDA_ENABLE_REALTEK_QUIRKS=y
+CONFIG_SND_HDA_CODEC_ANALOG=y
+CONFIG_SND_HDA_CODEC_SIGMATEL=y
+CONFIG_SND_HDA_CODEC_VIA=y
+CONFIG_SND_HDA_CODEC_HDMI=y
+CONFIG_SND_HDA_CODEC_CIRRUS=y
+CONFIG_SND_HDA_CODEC_CONEXANT=y
+CONFIG_SND_HDA_CODEC_CA0110=y
+CONFIG_SND_HDA_CODEC_CA0132=y
+CONFIG_SND_HDA_CODEC_CMEDIA=y
+CONFIG_SND_HDA_CODEC_SI3054=y
+CONFIG_SND_HDA_GENERIC=y
+# CONFIG_SND_HDA_POWER_SAVE is not set
+# CONFIG_SND_HDSP is not set
+# CONFIG_SND_HDSPM is not set
+# CONFIG_SND_ICE1712 is not set
+# CONFIG_SND_ICE1724 is not set
+CONFIG_SND_INTEL8X0=y
+# CONFIG_SND_INTEL8X0M is not set
+# CONFIG_SND_KORG1212 is not set
+# CONFIG_SND_LOLA is not set
+# CONFIG_SND_LX6464ES is not set
+# CONFIG_SND_MAESTRO3 is not set
+# CONFIG_SND_MIXART is not set
+# CONFIG_SND_NM256 is not set
+# CONFIG_SND_PCXHR is not set
+# CONFIG_SND_RIPTIDE is not set
+# CONFIG_SND_RME32 is not set
+# CONFIG_SND_RME96 is not set
+# CONFIG_SND_RME9652 is not set
+# CONFIG_SND_SIS7019 is not set
+# CONFIG_SND_SONICVIBES is not set
+# CONFIG_SND_TRIDENT is not set
+# CONFIG_SND_VIA82XX is not set
+# CONFIG_SND_VIA82XX_MODEM is not set
+# CONFIG_SND_VIRTUOSO is not set
+# CONFIG_SND_VX222 is not set
+# CONFIG_SND_YMFPCI is not set
+CONFIG_SND_USB=y
+# CONFIG_SND_USB_AUDIO is not set
+# CONFIG_SND_USB_UA101 is not set
+# CONFIG_SND_USB_USX2Y is not set
+# CONFIG_SND_USB_CAIAQ is not set
+# CONFIG_SND_USB_US122L is not set
+# CONFIG_SND_USB_6FIRE is not set
+CONFIG_SND_PCMCIA=y
+# CONFIG_SND_VXPOCKET is not set
+# CONFIG_SND_PDAUDIOCF is not set
+# CONFIG_SND_SOC is not set
+# CONFIG_SOUND_PRIME is not set
+CONFIG_AC97_BUS=y
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_BATTERY_STRENGTH is not set
+CONFIG_HIDRAW=y
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=y
+CONFIG_HID_PID=y
+CONFIG_USB_HIDDEV=y
+
+#
+# Special HID drivers
+#
+CONFIG_HID_A4TECH=y
+# CONFIG_HID_ACRUX is not set
+CONFIG_HID_APPLE=y
+CONFIG_HID_BELKIN=y
+CONFIG_HID_CHERRY=y
+CONFIG_HID_CHICONY=y
+# CONFIG_HID_PRODIKEYS is not set
+CONFIG_HID_CYPRESS=y
+# CONFIG_HID_DRAGONRISE is not set
+# CONFIG_HID_EMS_FF is not set
+CONFIG_HID_EZKEY=y
+# CONFIG_HID_HOLTEK is not set
+# CONFIG_HID_KEYTOUCH is not set
+# CONFIG_HID_KYE is not set
+# CONFIG_HID_UCLOGIC is not set
+# CONFIG_HID_WALTOP is not set
+CONFIG_HID_GYRATION=y
+# CONFIG_HID_TWINHAN is not set
+CONFIG_HID_KENSINGTON=y
+# CONFIG_HID_LCPOWER is not set
+CONFIG_HID_LOGITECH=y
+CONFIG_HID_LOGITECH_DJ=m
+CONFIG_LOGITECH_FF=y
+# CONFIG_LOGIRUMBLEPAD2_FF is not set
+# CONFIG_LOGIG940_FF is not set
+CONFIG_LOGIWHEELS_FF=y
+CONFIG_HID_MICROSOFT=y
+CONFIG_HID_MONTEREY=y
+# CONFIG_HID_MULTITOUCH is not set
+CONFIG_HID_NTRIG=y
+# CONFIG_HID_ORTEK is not set
+CONFIG_HID_PANTHERLORD=y
+CONFIG_PANTHERLORD_FF=y
+CONFIG_HID_PETALYNX=y
+# CONFIG_HID_PICOLCD is not set
+# CONFIG_HID_PRIMAX is not set
+# CONFIG_HID_ROCCAT is not set
+# CONFIG_HID_SAITEK is not set
+CONFIG_HID_SAMSUNG=y
+CONFIG_HID_SONY=y
+# CONFIG_HID_SPEEDLINK is not set
+CONFIG_HID_SUNPLUS=y
+# CONFIG_HID_GREENASIA is not set
+# CONFIG_HID_SMARTJOYPLUS is not set
+# CONFIG_HID_TIVO is not set
+CONFIG_HID_TOPSEED=y
+# CONFIG_HID_THRUSTMASTER is not set
+# CONFIG_HID_ZEROPLUS is not set
+# CONFIG_HID_ZYDACRON 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=y
+CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_DEVICE_CLASS is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+CONFIG_USB_MON=y
+# CONFIG_USB_WUSB_CBAF is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+# CONFIG_USB_XHCI_HCD is not set
+CONFIG_USB_EHCI_HCD=y
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+# CONFIG_USB_EHCI_TT_NEWSCHED 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=y
+# CONFIG_USB_OHCI_HCD_PLATFORM is not set
+# CONFIG_USB_EHCI_HCD_PLATFORM is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_UHCI_HCD=y
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+CONFIG_USB_PRINTER=y
+# CONFIG_USB_WDM is not set
+# CONFIG_USB_TMC is not set
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
+#
+
+#
+# also be needed; see USB_STORAGE Help for more info
+#
+CONFIG_USB_STORAGE=y
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_REALTEK is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_ONETOUCH is not set
+# CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
+# CONFIG_USB_STORAGE_ENE_UB6250 is not set
+# CONFIG_USB_UAS is not set
+CONFIG_USB_LIBUSUAL=y
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_SERIAL 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_ISIGHTFW is not set
+# CONFIG_USB_YUREX is not set
+# CONFIG_USB_GADGET is not set
+
+#
+# OTG and related infrastructure
+#
+# CONFIG_NOP_USB_XCEIV is not set
+# CONFIG_UWB is not set
+# CONFIG_MMC 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_PCA9532 is not set
+# CONFIG_LEDS_LP3944 is not set
+# CONFIG_LEDS_LP5521 is not set
+# CONFIG_LEDS_LP5523 is not set
+# CONFIG_LEDS_CLEVO_MAIL is not set
+# CONFIG_LEDS_PCA955X is not set
+# CONFIG_LEDS_PCA9633 is not set
+# CONFIG_LEDS_BD2802 is not set
+# CONFIG_LEDS_INTEL_SS4200 is not set
+# CONFIG_LEDS_TCA6507 is not set
+# CONFIG_LEDS_OT200 is not set
+CONFIG_LEDS_TRIGGERS=y
+
+#
+# LED Triggers
+#
+# CONFIG_LEDS_TRIGGER_TIMER is not set
+# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
+# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set
+# CONFIG_LEDS_TRIGGER_DEFAULT_ON is not set
+
+#
+# iptables trigger is under Netfilter config (LED target)
+#
+# CONFIG_ACCESSIBILITY is not set
+# CONFIG_INFINIBAND is not set
+CONFIG_EDAC=y
+
+#
+# Reporting subsystems
+#
+# CONFIG_EDAC_DEBUG is not set
+# CONFIG_EDAC_MM_EDAC is not set
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+# CONFIG_RTC_HCTOSYS is not set
+# 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_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
+#
+
+#
+# Platform RTC drivers
+#
+CONFIG_RTC_DRV_CMOS=y
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_MSM6242 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_RP5C01 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+CONFIG_DMADEVICES=y
+# CONFIG_DMADEVICES_DEBUG is not set
+
+#
+# DMA Devices
+#
+# CONFIG_INTEL_MID_DMAC is not set
+# CONFIG_INTEL_IOATDMA is not set
+# CONFIG_TIMB_DMA is not set
+# CONFIG_PCH_DMA is not set
+# CONFIG_AUXDISPLAY is not set
+# CONFIG_UIO is not set
+CONFIG_VIRTIO=y
+CONFIG_VIRTIO_RING=y
+
+#
+# Virtio drivers
+#
+CONFIG_VIRTIO_PCI=y
+CONFIG_VIRTIO_BALLOON=y
+CONFIG_VIRTIO_MMIO=y
+
+#
+# Microsoft Hyper-V guest support
+#
+# CONFIG_HYPERV is not set
+CONFIG_STAGING=y
+# CONFIG_ET131X is not set
+# CONFIG_SLICOSS is not set
+# CONFIG_USBIP_CORE is not set
+# CONFIG_W35UND is not set
+# CONFIG_PRISM2_USB is not set
+# CONFIG_ECHO is not set
+# CONFIG_COMEDI is not set
+# CONFIG_ASUS_OLED is not set
+# CONFIG_R8187SE is not set
+# CONFIG_RTL8192U is not set
+# CONFIG_RTLLIB is not set
+# CONFIG_R8712U is not set
+# CONFIG_RTS_PSTOR is not set
+# CONFIG_RTS5139 is not set
+# CONFIG_TRANZPORT is not set
+# CONFIG_IDE_PHISON is not set
+# CONFIG_LINE6_USB is not set
+# CONFIG_VT6655 is not set
+# CONFIG_VT6656 is not set
+# CONFIG_VME_BUS is not set
+# CONFIG_DX_SEP is not set
+# CONFIG_IIO is not set
+# CONFIG_ZRAM is not set
+# CONFIG_ZSMALLOC is not set
+# CONFIG_WLAGS49_H2 is not set
+# CONFIG_WLAGS49_H25 is not set
+# CONFIG_FB_SM7XX is not set
+# CONFIG_CRYSTALHD is not set
+# CONFIG_FB_XGI is not set
+# CONFIG_ACPI_QUICKSTART is not set
+# CONFIG_USB_ENESTORAGE is not set
+# CONFIG_BCM_WIMAX is not set
+# CONFIG_FT1000 is not set
+
+#
+# Speakup console speech
+#
+# CONFIG_SPEAKUP is not set
+# CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set
+# CONFIG_STAGING_MEDIA is not set
+
+#
+# Android
+#
+CONFIG_ANDROID=y
+# CONFIG_ANDROID_BINDER_IPC is not set
+# CONFIG_ASHMEM is not set
+CONFIG_ANDROID_LOGGER=y
+# CONFIG_ANDROID_RAM_CONSOLE is not set
+CONFIG_ANDROID_TIMED_OUTPUT=y
+# CONFIG_ANDROID_LOW_MEMORY_KILLER is not set
+# CONFIG_ANDROID_SWITCH is not set
+# CONFIG_ANDROID_INTF_ALARM is not set
+# CONFIG_PHONE is not set
+# CONFIG_USB_WPAN_HCD is not set
+CONFIG_X86_PLATFORM_DEVICES=y
+# CONFIG_ACERHDF is not set
+# CONFIG_ASUS_LAPTOP is not set
+# CONFIG_FUJITSU_LAPTOP is not set
+# CONFIG_FUJITSU_TABLET is not set
+# CONFIG_AMILO_RFKILL is not set
+# CONFIG_HP_ACCEL is not set
+# CONFIG_MSI_LAPTOP is not set
+# CONFIG_PANASONIC_LAPTOP is not set
+# CONFIG_COMPAL_LAPTOP is not set
+# CONFIG_SONY_LAPTOP is not set
+# CONFIG_IDEAPAD_LAPTOP is not set
+# CONFIG_THINKPAD_ACPI is not set
+# CONFIG_SENSORS_HDAPS is not set
+# CONFIG_INTEL_MENLOW is not set
+CONFIG_EEEPC_LAPTOP=y
+# CONFIG_ACPI_WMI is not set
+# CONFIG_TOPSTAR_LAPTOP is not set
+# CONFIG_TOSHIBA_BT_RFKILL is not set
+# CONFIG_ACPI_CMPC is not set
+# CONFIG_INTEL_IPS is not set
+# CONFIG_IBM_RTL is not set
+# CONFIG_XO15_EBOOK is not set
+# CONFIG_SAMSUNG_LAPTOP is not set
+# CONFIG_INTEL_OAKTRAIL is not set
+# CONFIG_SAMSUNG_Q10 is not set
+# CONFIG_APPLE_GMUX is not set
+
+#
+# Hardware Spinlock drivers
+#
+CONFIG_CLKSRC_I8253=y
+CONFIG_CLKEVT_I8253=y
+CONFIG_I8253_LOCK=y
+CONFIG_CLKBLD_I8253=y
+CONFIG_IOMMU_SUPPORT=y
+
+#
+# Remoteproc drivers (EXPERIMENTAL)
+#
+
+#
+# Rpmsg drivers (EXPERIMENTAL)
+#
+# CONFIG_VIRT_DRIVERS is not set
+# CONFIG_PM_DEVFREQ is not set
+CONFIG_MARU=y
+CONFIG_MARU_LCD=y
+CONFIG_MARU_CODEC=y
+CONFIG_MARU_TOUCHSCREEN=y
+CONFIG_MARU_FB=y
+# CONFIG_MARU_CAMERA is not set
+# CONFIG_MARU_BACKLIGHT is not set
+CONFIG_MARU_OVERLAY=y
+CONFIG_MARU_JACK=y
+CONFIG_MARU_POWER_SUPPLY=y
+CONFIG_MARU_USB_MASS_STORAGE=y
+CONFIG_MARU_USB_MODE=y
+
+#
+# Firmware Drivers
+#
+# CONFIG_EDD is not set
+CONFIG_FIRMWARE_MEMMAP=y
+CONFIG_EFI_VARS=y
+# CONFIG_DELL_RBU is not set
+# CONFIG_DCDBAS is not set
+CONFIG_DMIID=y
+# CONFIG_DMI_SYSFS is not set
+# CONFIG_ISCSI_IBFT_FIND is not set
+# CONFIG_GOOGLE_FIRMWARE is not set
+
+#
+# File systems
+#
+CONFIG_DCACHE_WORD_ACCESS=y
+# CONFIG_EXT2_FS 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=y
+CONFIG_EXT3_FS_SECURITY=y
+# CONFIG_EXT4_FS is not set
+CONFIG_JBD=y
+# CONFIG_JBD_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_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=y
+CONFIG_QUOTA_NETLINK_INTERFACE=y
+# CONFIG_PRINT_QUOTA_WARNING is not set
+# CONFIG_QUOTA_DEBUG is not set
+CONFIG_QUOTA_TREE=y
+# CONFIG_QFMT_V1 is not set
+CONFIG_QFMT_V2=y
+CONFIG_QUOTACTL=y
+CONFIG_AUTOFS4_FS=y
+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=y
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+# 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_KCORE=y
+CONFIG_PROC_VMCORE=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_HUGETLBFS=y
+CONFIG_HUGETLB_PAGE=y
+# CONFIG_CONFIGFS_FS is not set
+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 is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+# CONFIG_NFS_V4_1 is not set
+CONFIG_ROOT_NFS=y
+# CONFIG_NFS_USE_LEGACY_DNS is not set
+CONFIG_NFS_USE_KERNEL_DNS=y
+# CONFIG_NFSD is not set
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_ACL_SUPPORT=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_DEBUG 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="utf8"
+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=y
+# 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_UTF8=y
+
+#
+# Kernel hacking
+#
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_PRINTK_TIME=y
+CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FRAME_WARN=2048
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_STRIP_ASM_SYMS is not set
+# CONFIG_UNUSED_SYMBOLS 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_HARDLOCKUP_DETECTOR is not set
+# CONFIG_DETECT_HUNG_TASK is not set
+# CONFIG_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_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_SPARSE_RCU_POINTER 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=y
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_HIGHMEM is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_DEBUG_VIRTUAL is not set
+# CONFIG_DEBUG_WRITECOUNT is not set
+CONFIG_DEBUG_MEMORY_INIT=y
+# 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_ARCH_WANT_FRAME_POINTERS=y
+CONFIG_FRAME_POINTER=y
+# CONFIG_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_RCU_TRACE is not set
+# CONFIG_KPROBES_SANITY_TEST 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_LKDTM is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_LATENCYTOP is not set
+# CONFIG_DEBUG_PAGEALLOC is not set
+CONFIG_USER_STACKTRACE_SUPPORT=y
+CONFIG_NOP_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST=y
+CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
+CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_RING_BUFFER=y
+CONFIG_EVENT_TRACING=y
+CONFIG_EVENT_POWER_TRACING_DEPRECATED=y
+CONFIG_CONTEXT_SWITCH_TRACER=y
+CONFIG_RING_BUFFER_ALLOW_SWAP=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 is not set
+# CONFIG_FTRACE_SYSCALLS 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=y
+CONFIG_KPROBE_EVENT=y
+# CONFIG_FTRACE_STARTUP_TEST is not set
+# CONFIG_MMIOTRACE is not set
+# CONFIG_RING_BUFFER_BENCHMARK is not set
+CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
+# CONFIG_DYNAMIC_DEBUG is not set
+# CONFIG_DMA_API_DEBUG is not set
+# CONFIG_ATOMIC64_SELFTEST is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
+CONFIG_HAVE_ARCH_KMEMCHECK=y
+# CONFIG_TEST_KSTRTOX is not set
+# CONFIG_STRICT_DEVMEM is not set
+CONFIG_X86_VERBOSE_BOOTUP=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_EARLY_PRINTK_DBGP=y
+CONFIG_DEBUG_STACKOVERFLOW=y
+# CONFIG_X86_PTDUMP is not set
+CONFIG_DEBUG_RODATA=y
+# CONFIG_DEBUG_RODATA_TEST is not set
+# CONFIG_DEBUG_SET_MODULE_RONX is not set
+CONFIG_DEBUG_NX_TEST=m
+CONFIG_DOUBLEFAULT=y
+# CONFIG_IOMMU_STRESS is not set
+CONFIG_HAVE_MMIOTRACE_SUPPORT=y
+# CONFIG_X86_DECODER_SELFTEST is not set
+CONFIG_IO_DELAY_TYPE_0X80=0
+CONFIG_IO_DELAY_TYPE_0XED=1
+CONFIG_IO_DELAY_TYPE_UDELAY=2
+CONFIG_IO_DELAY_TYPE_NONE=3
+CONFIG_IO_DELAY_0X80=y
+# CONFIG_IO_DELAY_0XED is not set
+# CONFIG_IO_DELAY_UDELAY is not set
+# CONFIG_IO_DELAY_NONE is not set
+CONFIG_DEFAULT_IO_DELAY_TYPE=0
+CONFIG_DEBUG_BOOT_PARAMS=y
+# CONFIG_CPA_DEBUG is not set
+CONFIG_OPTIMIZE_INLINING=y
+# CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set
+
+#
+# Security options
+#
+CONFIG_KEYS=y
+# CONFIG_ENCRYPTED_KEYS is not set
+CONFIG_KEYS_DEBUG_PROC_KEYS=y
+# 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_SECURITY_SELINUX is not set
+CONFIG_SECURITY_SMACK=y
+# 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_SMACK=y
+# CONFIG_DEFAULT_SECURITY_DAC is not set
+CONFIG_DEFAULT_SECURITY="smack"
+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_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 is not set
+# CONFIG_CRYPTO_NULL is not set
+CONFIG_CRYPTO_WORKQUEUE=y
+# CONFIG_CRYPTO_CRYPTD is not set
+CONFIG_CRYPTO_AUTHENC=y
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+# CONFIG_CRYPTO_CCM is not set
+# CONFIG_CRYPTO_GCM is not set
+# CONFIG_CRYPTO_SEQIV is not set
+
+#
+# Block modes
+#
+CONFIG_CRYPTO_CBC=y
+# CONFIG_CRYPTO_CTR is not set
+# CONFIG_CRYPTO_CTS is not set
+# CONFIG_CRYPTO_ECB is not set
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_XTS is not set
+
+#
+# Hash modes
+#
+CONFIG_CRYPTO_HMAC=y
+# CONFIG_CRYPTO_XCBC is not set
+# CONFIG_CRYPTO_VMAC is not set
+
+#
+# Digest
+#
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_CRC32C_INTEL is not set
+# CONFIG_CRYPTO_GHASH is not set
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+CONFIG_CRYPTO_SHA1=y
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+CONFIG_CRYPTO_AES=y
+CONFIG_CRYPTO_AES_586=y
+# CONFIG_CRYPTO_AES_NI_INTEL 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_SALSA20_586 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_SERPENT_SSE2_586 is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+# CONFIG_CRYPTO_TWOFISH_586 is not set
+
+#
+# Compression
+#
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_ZLIB is not set
+# CONFIG_CRYPTO_LZO is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+# CONFIG_CRYPTO_USER_API_HASH is not set
+# CONFIG_CRYPTO_USER_API_SKCIPHER is not set
+CONFIG_CRYPTO_HW=y
+# CONFIG_CRYPTO_DEV_PADLOCK is not set
+# CONFIG_CRYPTO_DEV_GEODE is not set
+# CONFIG_CRYPTO_DEV_HIFN_795X is not set
+CONFIG_HAVE_KVM=y
+CONFIG_VIRTUALIZATION=y
+# CONFIG_KVM is not set
+# CONFIG_VHOST_NET is not set
+# CONFIG_LGUEST is not set
+CONFIG_BINARY_PRINTF=y
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_GENERIC_FIND_FIRST_BIT=y
+CONFIG_GENERIC_PCI_IOMAP=y
+CONFIG_GENERIC_IOMAP=y
+CONFIG_GENERIC_IO=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+CONFIG_CRC_T10DIF=y
+# 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 is not set
+# CONFIG_CRC8 is not set
+CONFIG_AUDIT_GENERIC=y
+CONFIG_ZLIB_INFLATE=y
+CONFIG_LZO_COMPRESS=y
+CONFIG_LZO_DECOMPRESS=y
+CONFIG_XZ_DEC=y
+CONFIG_XZ_DEC_X86=y
+CONFIG_XZ_DEC_POWERPC=y
+CONFIG_XZ_DEC_IA64=y
+CONFIG_XZ_DEC_ARM=y
+CONFIG_XZ_DEC_ARMTHUMB=y
+CONFIG_XZ_DEC_SPARC=y
+CONFIG_XZ_DEC_BCJ=y
+# CONFIG_XZ_DEC_TEST is not set
+CONFIG_DECOMPRESS_GZIP=y
+CONFIG_DECOMPRESS_BZIP2=y
+CONFIG_DECOMPRESS_LZMA=y
+CONFIG_DECOMPRESS_XZ=y
+CONFIG_DECOMPRESS_LZO=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
+CONFIG_CHECK_SIGNATURE=y
+CONFIG_DQL=y
+CONFIG_NLATTR=y
+CONFIG_AVERAGE=y
+# CONFIG_CORDIC is not set
--- /dev/null
+#!/bin/sh
+# Build x86 emulator kernel image
+
+make i386_emul_defconfig
+make -j4
source "drivers/devfreq/Kconfig"
+source "drivers/maru/Kconfig"
+
endmenu
obj-$(CONFIG_PPS) += pps/
obj-$(CONFIG_PTP_1588_CLOCK) += ptp/
obj-$(CONFIG_W1) += w1/
-obj-$(CONFIG_POWER_SUPPLY) += power/
+#obj-$(CONFIG_POWER_SUPPLY) += power/
obj-$(CONFIG_HWMON) += hwmon/
obj-$(CONFIG_THERMAL) += thermal/
obj-$(CONFIG_WATCHDOG) += watchdog/
obj-$(CONFIG_HYPERV) += hv/
obj-$(CONFIG_PM_DEVFREQ) += devfreq/
+
+obj-$(CONFIG_MARU) += maru/
device appear much like a simple EEPROM, and knows
how to partition a single ROM for multiple purposes.
+config VDPRAM_DEVICE
+ tristate "vdpram kernel driver for Telephony simulation"
+ help
+ vdpram is telephony simulator works with the event injector.
+
+config VIRTIOGL
+ tristate "Virtio userspace memory transport"
+ depends on VIRTIO_PCI
+ default n
+ help
+ A Driver to facilitate transferring data from userspace to a
+ hypervisor (eg. qemu)
+
endmenu
js-rtc-y = rtc.o
obj-$(CONFIG_TILE_SROM) += tile-srom.o
+
+obj-$(CONFIG_VIRTIOGL) += virtio-gl.o
+obj-$(CONFIG_VDPRAM_DEVICE) += vdpram.o
\ No newline at end of file
--- /dev/null
+/*
+ * Virtual DPRAM for emulator
+ *
+ * Copyright (c) 2009 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * DongKyun Yun <dk77.yun@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+
+#include <linux/kernel.h> /* printk(), min() */
+#include <linux/slab.h> /* kmalloc() */
+#include <linux/fs.h> /* everything... */
+#include <linux/proc_fs.h>
+#include <linux/errno.h> /* error codes */
+#include <linux/types.h> /* size_t */
+#include <linux/fcntl.h>
+#include <linux/poll.h>
+#include <linux/cdev.h>
+#include <linux/sched.h>
+#include <asm/uaccess.h>
+
+#define VDPRAM_MAJOR 249 /* 240 */
+#define VDPRAM_NR_DEVS 2
+#define VDPRAM_BUFFER (16*1024)
+#define VDPRAM_SEM_UNLOCK 100
+#define VDPRAM_SEM_LOCK 200
+#define VDPRAM_STATUS 300
+#define VDPRAM_LOCK_ENABLE
+
+
+/* #if 1
+#define printk(...)
+#endif
+*/
+
+MODULE_LICENSE("GPL");
+
+struct buffer_t {
+ char *begin;
+ char *end;
+ int buffersize;
+ struct semaphore sem;
+};
+
+struct queue_t {
+ wait_queue_head_t inq;
+ wait_queue_head_t outq;
+};
+
+struct vdpram_dev {
+ int flag;
+ struct vdpram_dev *adj;
+ char *rp, *wp; /* where to read, where to write */
+ int nreaders, nwriters; /* number of openings for r/w */
+ struct fasync_struct *async_queue; /* asynchronous readers */
+ struct cdev cdev; /* Char device structure */
+ int index;
+ int adj_index;
+};
+
+struct vdpram_status_dev {
+ int index;
+ char *rp, *wp; /* where to read, where to write */
+ int rp_cnt;
+ int wp_cnt;
+
+ int adj_index;
+ char *adj_rp, *adj_wp; /* where to read, where to write */
+ int adj_rp_cnt;
+ int adj_wp_cnt;
+};
+
+
+/* parameters */
+static int vdpram_nr_devs = VDPRAM_NR_DEVS; /* number of devices */
+int vdpram_buffer = VDPRAM_BUFFER; /* buffer size */
+dev_t vdpram_devno; /* Our first device number */
+int vdpram_major = VDPRAM_MAJOR;
+
+module_param(vdpram_nr_devs, int, 0); /* FIXME check perms */
+module_param(vdpram_buffer, int, 0);
+
+static struct vdpram_dev *vdpram_devices;
+static struct buffer_t *buffer;
+static struct queue_t *queue;
+
+static int vdpram_fasync(int fd, struct file *filp, int mode);
+static int spacefree(struct vdpram_dev *dev);
+
+int vdpram_ioctl(struct inode *inode, struct file *filp,
+ unsigned int cmd, unsigned long arg);
+
+/* Open and close */
+static int vdpram_open(struct inode *inode, struct file *filp)
+{
+ struct vdpram_dev *dev;
+ int index;
+
+
+
+ dev = container_of(inode->i_cdev, struct vdpram_dev, cdev);
+ filp->private_data = dev;
+ index = dev->index ;
+
+// printk("%s:%d:index:%d\n", __FUNCTION__,current->pid,index);
+
+#ifdef VDPRAM_LOCK_ENABLE
+ if (down_interruptible(&buffer[index].sem))
+ return -ERESTARTSYS;
+#endif //VDPRAM_LOCK_ENABLE
+
+ dev->wp = dev->adj->rp = buffer[index].begin; /* rd and wr from the beginning */
+
+ /* use f_mode,not f_flags: it's cleaner (fs/open.c tells why) */
+ if (filp->f_mode & FMODE_READ)
+ dev->nreaders++;
+ if (filp->f_mode & FMODE_WRITE)
+ dev->nwriters++;
+#ifdef VDPRAM_LOCK_ENABLE
+ up(&buffer[index].sem);
+#endif //VDPRAM_LOCK_ENABLE
+
+ return nonseekable_open(inode, filp);
+}
+
+
+
+static int vdpram_release(struct inode *inode, struct file *filp)
+{
+ struct vdpram_dev *dev = filp->private_data;
+ int index = dev->index ;
+
+// printk("%s:%d\n", __FUNCTION__,current->pid);
+
+ /* remove this filp from the asynchronously notified filp's */
+ vdpram_fasync(-1, filp, 0);
+#ifdef VDPRAM_LOCK_ENABLE
+ down(&buffer[index].sem);
+#endif //VDPRAM_LOCK_ENABLE
+ if (filp->f_mode & FMODE_READ)
+ dev->nreaders--;
+ if (filp->f_mode & FMODE_WRITE)
+ dev->nwriters--;
+ if (dev->nreaders + dev->nwriters == 0) {
+ //kfree(dev->buffer);
+ //dev->buffer = NULL; /* the other fields are not checked on open */
+ }
+#ifdef VDPRAM_LOCK_ENABLE
+ up(&buffer[index].sem);
+#endif //VDPRAM_LOCK_ENABLE
+ return 0;
+}
+
+
+/*
+ * Data management: read and write
+ */
+
+static ssize_t vdpram_read (struct file *filp, char __user *buf, size_t count,
+ loff_t *f_pos)
+{
+ struct vdpram_dev *dev = filp->private_data;
+ int index = dev->adj_index ;
+ char *curr_rp, *curr_adj_wp;
+#if 0
+ int i = 0; /* for debug */
+#endif
+// printk("%s:%d start rp=%x adj_wp=%x \n", __FUNCTION__,current->pid, dev->rp, dev->adj->wp);
+
+#ifdef VDPRAM_LOCK_ENABLE
+ if (down_interruptible(&buffer[index].sem))
+ return -ERESTARTSYS;
+#endif //VDPRAM_LOCK_ENABLE
+ curr_rp = dev->rp;
+ curr_adj_wp = dev->adj->wp ;
+#ifdef VDPRAM_LOCK_ENABLE
+ up(&buffer[index].sem); /* release the lock */
+#endif //VDPRAM_LOCK_ENABLE
+
+ while (curr_rp == curr_adj_wp) { /* nothing to read */
+ if (filp->f_flags & O_NONBLOCK)
+ return -EAGAIN;
+ if (wait_event_interruptible(queue[index].inq, (dev->adj->wp != dev->rp)))
+ return -ERESTARTSYS; /* signal: tell the fs layer to handle it */
+ /* otherwise loop, but first reacquire the lock */
+#ifdef VDPRAM_LOCK_ENABLE
+ if (down_interruptible(&buffer[index].sem))
+ return -ERESTARTSYS;
+#endif //VDPRAM_LOCK_ENABLE
+ curr_rp = dev->rp;
+ curr_adj_wp = dev->adj->wp ;
+#ifdef VDPRAM_LOCK_ENABLE
+ up(&buffer[index].sem); /* release the lock */
+#endif //VDPRAM_LOCK_ENABLE
+ }
+ /* ok, data is there, return something */
+#ifdef VDPRAM_LOCK_ENABLE
+ if (down_interruptible(&buffer[index].sem))
+ return -ERESTARTSYS;
+#endif //VDPRAM_LOCK_ENABLE
+
+ if (dev->adj->wp > dev->rp)
+ {
+ count = min(count, (size_t)(dev->adj->wp - dev->rp));
+ if (copy_to_user(buf, dev->rp, count)) {
+#ifdef VDPRAM_LOCK_ENABLE
+ up (&buffer[index].sem);
+#endif //VDPRAM_LOCK_ENABLE
+ return -EFAULT;
+ }
+
+ dev->rp += count;
+ if (dev->rp >= buffer[index].end)
+ dev->rp = buffer[index].begin; /* wrapped */
+ }
+ else /* the write pointer has wrapped, return data up to dev->end */
+ {
+ int tmp_count ;
+
+ tmp_count = min(count, (size_t)(buffer[index].end - dev->rp + 1));
+ if (copy_to_user(buf, dev->rp,tmp_count)) {
+#ifdef VDPRAM_LOCK_ENABLE
+ up (&buffer[index].sem);
+#endif //VDPRAM_LOCK_ENABLE
+ return -EFAULT;
+ }
+
+ dev->rp += tmp_count;
+
+ if ( count - tmp_count > 0)
+ {
+ tmp_count = min ( count - tmp_count, sizeof(dev->adj->wp - buffer[index].begin));
+ if (copy_to_user(buf,dev->rp,tmp_count)) {
+#ifdef VDPRAM_LOCK_ENABLE
+ up (&buffer[index].sem);
+#endif //VDPRAM_LOCK_ENABLE
+ return -EFAULT;
+ }
+ dev->rp += tmp_count;
+
+ if (dev->rp != dev->adj->wp)
+ dev->rp = buffer[index].begin; /* wrapped */
+ }
+ }
+
+#ifdef VDPRAM_LOCK_ENABLE
+ up (&buffer[index].sem);
+#endif //VDPRAM_LOCK_ENABLE
+
+#ifdef NOT_CIRCLE_QUEUE // hwjang del for circular queue
+ if (copy_to_user(buf, dev->rp, count)) {
+#ifdef VDPRAM_LOCK_ENABLE
+ up (&buffer[index].sem);
+#endif //VDPRAM_LOCK_ENABLE
+ return -EFAULT;
+ }
+
+ dev->rp += count;
+ if(dev->rp >= buffer[index].end)
+ dev->rp = buffer[index].begin; /* wrapped */
+#ifdef VDPRAM_LOCK_ENABLE
+ up (&buffer[index].sem);
+#endif //VDPRAM_LOCK_ENABLE
+#endif //NOT_CIRCLE_QUEUE
+
+// printk("%s:%d rp[%d]=%d cnt=%d \n", __FUNCTION__,current->pid,dev->index, dev->rp-buffer[index].begin,count);
+ /* finally, awake any writers and return */
+ wake_up_interruptible(&queue[index].outq);
+ return count;
+}
+
+/* Wait for space for writing; caller must hold device semaphore. On
+ * error the semaphore will be released before returning. */
+static int vdpram_getwritespace(struct vdpram_dev *dev, struct file *filp)
+{
+ int ret ;
+ int index = dev->index ;
+
+ while (spacefree(dev) == 0) { /* full */
+ DEFINE_WAIT(wait);
+
+#ifdef VDPRAM_LOCK_ENABLE
+ up(&buffer[index].sem);
+#endif //VDPRAM_LOCK_ENABLE
+ if (filp->f_flags & O_NONBLOCK)
+ return -EAGAIN;
+ prepare_to_wait(&queue[index].outq, &wait, TASK_INTERRUPTIBLE);
+#ifdef VDPRAM_LOCK_ENABLE
+ if (down_interruptible(&buffer[index].sem))
+ return -ERESTARTSYS;
+#endif //VDPRAM_LOCK_ENABLE
+ ret = spacefree(dev) ;
+#ifdef VDPRAM_LOCK_ENABLE
+ up(&buffer[index].sem);
+#endif //VDPRAM_LOCK_ENABLE
+ if (ret == 0)
+ schedule();
+ finish_wait(&queue[index].outq, &wait);
+ if (signal_pending(current))
+ return -ERESTARTSYS; /* signal: tell the fs layer to handle it */
+#ifdef VDPRAM_LOCK_ENABLE
+ if (down_interruptible(&buffer[index].sem))
+ return -ERESTARTSYS;
+#endif //VDPRAM_LOCK_ENABLE
+ }
+ return 0;
+}
+
+/* How much space is free? */
+static int spacefree(struct vdpram_dev *dev)
+{
+ int index = dev->index;
+ if (dev->wp == dev->adj->rp)
+ return buffer[index].buffersize - 1;
+ return ((dev->adj->rp + buffer[index].buffersize - dev->wp) % buffer[index].buffersize) - 1;
+}
+
+static ssize_t vdpram_write(struct file *filp, const char __user *buf, size_t count,
+ loff_t *f_pos)
+{
+ struct vdpram_dev *dev = filp->private_data;
+ int result;
+ int index = dev->index ;
+
+#ifdef VDPRAM_LOCK_ENABLE
+ if (down_interruptible(&buffer[index].sem))
+ return -ERESTARTSYS;
+#endif //VDPRAM_LOCK_ENABLE
+
+ /* Make sure there's space to write */
+ result = vdpram_getwritespace(dev, filp);
+ if (result)
+ return result; /* vdpram_getwritespace called up(&dev->sem) */
+
+ /* ok, space is there, accept something */
+ count = min(count, (size_t)spacefree(dev));
+ // hwjang need to be fixed for full circular queue
+ if ( count > 0 )
+ {
+ if (dev->wp >= dev->adj->rp)
+ {
+ int tmp_count ;
+ tmp_count = min(count, (size_t)(buffer[index].end - dev->wp)); /* to end-of-buf */
+
+ if (tmp_count != 0 && copy_from_user(dev->wp, buf, tmp_count))
+ {
+#ifdef VDPRAM_LOCK_ENABLE
+ up (&buffer[index].sem);
+#endif //VDPRAM_LOCK_ENABLE
+ return -EFAULT;
+ }
+
+ dev->wp += tmp_count;
+ if (dev->wp > buffer[index].end )
+ {
+// printk("%s: back 0 !! \n",__FUNCTION__);
+ dev->wp = buffer[index].begin; /* wrapped */
+ }
+
+ if (count-tmp_count > 0 )
+ {
+ tmp_count = min ( count - tmp_count, sizeof(dev->adj->rp - buffer[index].begin));
+ if(copy_from_user(dev->wp, buf + tmp_count, tmp_count))
+ {
+#ifdef VDPRAM_LOCK_ENABLE
+ up (&buffer[index].sem);
+#endif //VDPRAM_LOCK_ENABLE
+ return -EFAULT;
+ }
+ }
+ }
+ else /* the write pointer has wrapped, fill up to rp-1 */
+ {
+ count = min(count, (size_t)(dev->adj->rp - dev->wp - 1));
+
+ if (copy_from_user(dev->wp, buf, count)) {
+#ifdef VDPRAM_LOCK_ENABLE
+ up (&buffer[index].sem);
+#endif //VDPRAM_LOCK_ENABLE
+ return -EFAULT;
+ }
+
+ dev->wp += count;
+ if (dev->wp > buffer[index].end)
+ {
+// printk("%s: back 0 !! \n",__FUNCTION__);
+ dev->wp = buffer[index].begin; /* wrapped */
+ }
+
+ }
+ }
+ /* for debug */
+#if 0
+ printk("write[%d]: ", index);
+ for(i=0; i<count; ++i) {
+ printk("%x ", *(dev->wp+i));
+ }
+ printk("\n");
+#endif
+
+#ifdef NOT_CIRCLE_QUEUE // hwjang del for circular queue
+ if (copy_from_user(dev->wp, buf, count)) {
+#ifdef VDPRAM_LOCK_ENABLE
+ up (&buffer[index].sem);
+#endif //VDPRAM_LOCK_ENABLE
+ return -EFAULT;
+ }
+ dev->wp += count;
+ if (dev->wp == buffer[index].end)
+ dev->wp = buffer[index].begin; /* wrapped */
+#endif // NOT_CIRCLE_QUEUE
+
+
+#ifdef VDPRAM_LOCK_ENABLE
+ up(&buffer[index].sem);
+#endif //VDPRAM_LOCK_ENABLE
+
+// printk("%s:%d wp[%d]=%d, cnt=%d \n", __FUNCTION__,current->pid,dev->index, dev->wp -buffer[index].begin, count);
+ /* finally, awake any reader */
+ wake_up_interruptible(&queue[index].inq); /* blocked in read() and select() */
+
+ /* and signal asynchronous readers, explained late in chapter 5 */
+ if (dev->async_queue)
+ kill_fasync(&dev->async_queue, SIGIO, POLL_IN);
+ return count;
+}
+
+static unsigned int vdpram_poll(struct file *filp, poll_table *wait)
+{
+ struct vdpram_dev *dev = filp->private_data;
+ unsigned int mask = 0;
+
+// printk("%s:%d:index:%d\n", __FUNCTION__,current->pid,dev->index);
+ /*
+ * The buffer is circular; it is considered full
+ * if "wp" is right behind "rp" and empty if the
+ * two are equal.
+ */
+ poll_wait(filp, &queue[dev->adj_index].inq, wait);
+ poll_wait(filp, &queue[dev->index].outq, wait);
+
+#ifdef VDPRAM_LOCK_ENABLE
+ down(&buffer[dev->adj_index].sem);
+#endif //VDPRAM_LOCK_ENABLE
+ if (dev->rp && dev->adj->wp && (dev->rp != dev->adj->wp))
+ mask |= POLLIN | POLLRDNORM; /* readable */
+#ifdef VDPRAM_LOCK_ENABLE
+ up(&buffer[dev->adj_index].sem);
+#endif //VDPRAM_LOCK_ENABLE
+
+#ifdef VDPRAM_LOCK_ENABLE
+ down(&buffer[dev->index].sem);
+#endif //VDPRAM_LOCK_ENABLE
+ if (spacefree(dev))
+ mask |= POLLOUT | POLLWRNORM; /* writable */
+#ifdef VDPRAM_LOCK_ENABLE
+ up(&buffer[dev->index].sem);
+#endif //VDPRAM_LOCK_ENABLE
+// printk("%s:%d:index:%d:end!!\n", __FUNCTION__,current->pid,index);
+ return mask;
+}
+
+
+static int vdpram_fasync(int fd, struct file *filp, int mode)
+{
+ struct vdpram_dev *dev = filp->private_data;
+
+ return fasync_helper(fd, filp, mode, &dev->async_queue);
+}
+
+
+/*
+ * The file operations for the vdpram device
+ */
+struct file_operations vdpram_even_fops = {
+ .owner = THIS_MODULE,
+ .llseek = no_llseek,
+ .read = vdpram_read,
+ .write = vdpram_write,
+ .poll = vdpram_poll,
+ .open = vdpram_open,
+ .release = vdpram_release,
+ .fasync = vdpram_fasync,
+ .ioctl = vdpram_ioctl,
+};
+
+struct file_operations vdpram_odd_fops = {
+ .owner = THIS_MODULE,
+ .llseek = no_llseek,
+ .read = vdpram_read,
+ .write = vdpram_write,
+ .poll = vdpram_poll,
+ .open = vdpram_open,
+ .release = vdpram_release,
+ .fasync = vdpram_fasync,
+ .ioctl = vdpram_ioctl,
+};
+
+int vdpram_ioctl(struct inode *inode, struct file *filp,
+ unsigned int cmd, unsigned long arg)
+{
+ struct vdpram_dev *dev;
+ struct vdpram_status_dev dev_status;
+ int index;
+
+ dev = container_of(inode->i_cdev, struct vdpram_dev, cdev);
+ filp->private_data = dev;
+ index = dev->index ;
+
+ memset( &dev_status, 0, sizeof(struct vdpram_status_dev));
+
+ switch( cmd )
+ {
+ case VDPRAM_SEM_UNLOCK :
+#ifdef VDPRAM_LOCK_ENABLE
+ up (&buffer[index].sem);
+#endif //VDPRAM_LOCK_ENABLE
+ break;
+ case VDPRAM_STATUS :
+ dev_status.index = dev->index;
+ dev_status.adj_index = dev->adj_index;
+
+ dev_status.rp = dev->rp;
+ dev_status.wp = dev->wp;
+ dev_status.adj_rp = dev->rp;
+ dev_status.adj_wp = dev->wp;
+
+ if ( dev_status.rp != 0 )
+ dev_status.rp_cnt = dev->rp-buffer[index].begin;
+
+ if ( dev_status.wp != 0 )
+ dev_status.wp_cnt = dev->wp-buffer[index].begin;
+
+ dev_status.adj_rp = dev->adj->rp;
+ dev_status.adj_wp = dev->adj->wp;
+
+ if ( dev_status.adj_rp != 0 )
+ dev_status.adj_rp_cnt = dev->adj->rp-buffer[dev->adj_index].begin;
+ if ( dev_status.adj_wp != 0 )
+ dev_status.adj_wp_cnt = dev->adj->wp-buffer[dev->adj_index].begin;
+
+
+ if (copy_to_user((char*)arg, &dev_status, sizeof(struct vdpram_status_dev))) {
+ return -EFAULT;
+ }
+ default :
+// printk("%s[%d]:p=%d:cmd=%d\n", __FUNCTION__,index,current->pid,cmd);
+ break;
+
+ }
+ return 0;
+}
+
+/*
+ * Set up a cdev entry.
+ */
+static void vdpram_setup_cdev(struct vdpram_dev *dev, int index)
+{
+ int err, devno = vdpram_devno + index;
+
+ if (index % 2 ==0) {
+ dev->flag = 1;
+ cdev_init(&dev->cdev, &vdpram_even_fops);
+ dev->cdev.owner = THIS_MODULE;
+ err = cdev_add (&dev->cdev, devno, 1);
+ dev->index = index;
+ }
+ else {
+ dev->flag = 0;
+ cdev_init(&dev->cdev, &vdpram_odd_fops);
+ dev->cdev.owner = THIS_MODULE;
+ err = cdev_add (&dev->cdev, devno, 1);
+ dev->index = index;
+ }
+
+ /* Fail gracefully if need be */
+ if (err)
+ printk(KERN_NOTICE "Error %d adding deive%d\n", err, index);
+}
+
+
+
+/* Initialize the devs; return how many we did */
+int vdpram_init(void)
+{
+ int i, result;
+// dev_t dev;
+ dev_t dev = MKDEV(vdpram_major, 0);
+
+// printk("Initializing vdpram device driver ...\n");
+ result = register_chrdev_region(dev, vdpram_nr_devs, "vdpram");
+// result = alloc_chrdev_region(&dev, 0, vdpram_nr_devs, "vdpram");
+ if (result < 0) {
+ printk("Unable to get vdpram region, error %d\n", result);
+ return 0;
+ }
+// vdpram_major = MAJOR( dev );
+ printk( " vdpram device major num = %d \n", vdpram_major );
+ vdpram_devno = dev;
+ vdpram_devices = kmalloc(vdpram_nr_devs * sizeof(struct vdpram_dev), GFP_KERNEL);
+ if (vdpram_devices == NULL) {
+ unregister_chrdev_region(dev, vdpram_nr_devs);
+ return 0;
+ }
+ memset(vdpram_devices, 0, vdpram_nr_devs * sizeof(struct vdpram_dev));
+ for (i = 0; i < vdpram_nr_devs; i++) {
+ if (i% 2 ==1) {
+ vdpram_devices[i].adj = &vdpram_devices[i-1];
+ vdpram_devices[i-1].adj = &vdpram_devices[i];
+// hwjang
+ vdpram_devices[i].adj->adj_index=i;
+ vdpram_devices[i-1].adj->adj_index=i-1;
+ }
+ vdpram_setup_cdev(vdpram_devices + i, i);
+ }
+
+ buffer = kmalloc(vdpram_nr_devs * sizeof(struct buffer_t) , GFP_KERNEL);
+ memset(buffer, 0, vdpram_nr_devs * sizeof(struct buffer_t));
+ queue = kmalloc(vdpram_nr_devs * sizeof(struct queue_t) , GFP_KERNEL);
+ // hwjang fix buffer -> queue
+ memset(queue, 0, vdpram_nr_devs * sizeof(struct queue_t));
+ for (i = 0; i < vdpram_nr_devs; i++) {
+#ifdef VDPRAM_LOCK_ENABLE
+ init_MUTEX(&buffer[i].sem);
+#endif //VDPRAM_LOCK_ENABLE
+ buffer[i].begin = kmalloc(vdpram_buffer, GFP_KERNEL);
+ buffer[i].buffersize = vdpram_buffer;
+ buffer[i].end = buffer[i].begin + buffer[i].buffersize;
+
+ init_waitqueue_head(&queue[i].inq);
+ init_waitqueue_head(&queue[i].outq);
+//printk("%s buffer[%x].begin =%x\n", __FUNCTION__, i, buffer[i].begin );
+//printk("%s buffer[%x].buffersize =%x\n", __FUNCTION__, i, buffer[i].buffersize );
+//printk("%s buffer[%x].end =%x\n", __FUNCTION__, i, buffer[i].end );
+ }
+
+ return 0;
+}
+
+/*
+ * This is called by cleanup_module or on failure.
+ * It is required to never fail, even if nothing was initialized first
+ */
+void vdpram_cleanup(void)
+{
+ int i;
+
+// printk("%s:%d\n", __FUNCTION__,current->pid);
+
+ if (!vdpram_devices)
+ return; /* nothing else to release */
+
+ for (i = 0; i < vdpram_nr_devs; i++) {
+ cdev_del(&vdpram_devices[i].cdev);
+ }
+ kfree(vdpram_devices);
+
+ for (i= 0;i < vdpram_nr_devs ; i++) {
+ kfree(buffer[i].begin);
+ }
+ kfree(buffer);
+
+ unregister_chrdev_region(vdpram_devno, vdpram_nr_devs);
+ vdpram_devices = NULL; /* pedantic */
+}
+
+module_init(vdpram_init);
+module_exit(vdpram_cleanup);
--- /dev/null
+/*\r
+ * Copyright (C) 2010 Intel Corporation\r
+ *\r
+ * Author: Ian Molton <ian.molton@collabora.co.uk>\r
+ *\r
+ * This program is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; version 2 of the License.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+ */\r
+\r
+#include <linux/kernel.h>\r
+#include <linux/module.h>\r
+#include <linux/fs.h>\r
+#include <linux/dma-mapping.h>\r
+#include <linux/sched.h>\r
+#include <linux/slab.h>\r
+#include <linux/miscdevice.h>\r
+#include <linux/virtio.h>\r
+#include <linux/virtio_ids.h>\r
+#include <linux/virtio_config.h>\r
+\r
+#define VIRTIO_ID_GL 6\r
+#define DEVICE_NAME "glmem"\r
+\r
+/* Define to use debugging checksums on transfers */\r
+#undef DEBUG_GLIO\r
+\r
+struct virtio_gl_data {\r
+ char *buffer;\r
+ int pages;\r
+ unsigned int pid;\r
+};\r
+\r
+struct virtio_gl_header {\r
+ int pid;\r
+ int buf_size;\r
+ int r_buf_size;\r
+#ifdef DEBUG_GLIO\r
+ int sum;\r
+#endif\r
+ char buffer;\r
+} __packed;\r
+\r
+#define to_virtio_gl_data(a) ((struct virtio_gl_data *)(a)->private_data)\r
+\r
+#ifdef DEBUG_GLIO\r
+#define SIZE_OUT_HEADER (sizeof(int)*4)\r
+#define SIZE_IN_HEADER (sizeof(int)*2)\r
+#else\r
+#define SIZE_OUT_HEADER (sizeof(int)*3)\r
+#define SIZE_IN_HEADER sizeof(int)\r
+#endif\r
+\r
+static struct virtqueue *vq;\r
+\r
+\r
+/* This is videobuf_vmalloc_to_sg() from videobuf-dma-sg.c with\r
+ * some modifications\r
+ */\r
+static struct scatterlist *vmalloc_to_sg(struct scatterlist *sg_list,\r
+ unsigned char *virt, unsigned int pages)\r
+{\r
+ struct page *pg;\r
+\r
+ /* unaligned */\r
+ BUG_ON((ulong)virt & ~PAGE_MASK);\r
+\r
+ /* Fill with elements for the data */\r
+ while (pages) {\r
+ pg = vmalloc_to_page(virt);\r
+ if (!pg)\r
+ goto err;\r
+\r
+ sg_set_page(sg_list, pg, PAGE_SIZE, 0);\r
+ virt += PAGE_SIZE;\r
+ sg_list++;\r
+ pages--;\r
+ }\r
+\r
+ return sg_list;\r
+\r
+err:\r
+ kfree(sg_list);\r
+ return NULL;\r
+}\r
+\r
+static int put_data(struct virtio_gl_data *gldata)\r
+{\r
+ struct scatterlist *sg, *sg_list;\r
+ unsigned int count, ret, o_page, i_page, sg_entries;\r
+ struct virtio_gl_header *header =\r
+ (struct virtio_gl_header *)gldata->buffer;\r
+\r
+ ret = header->buf_size;\r
+\r
+ o_page = (header->buf_size + PAGE_SIZE-1) >> PAGE_SHIFT;\r
+ i_page = (header->r_buf_size + PAGE_SIZE-1) >> PAGE_SHIFT;\r
+\r
+ header->pid = gldata->pid;\r
+\r
+ if ((o_page && i_page) &&\r
+ (o_page > gldata->pages || i_page > gldata->pages)) {\r
+ i_page = 0;\r
+ }\r
+\r
+ if (o_page > gldata->pages)\r
+ o_page = gldata->pages;\r
+\r
+ if (i_page > gldata->pages)\r
+ i_page = gldata->pages;\r
+\r
+ if (!o_page)\r
+ o_page = 1;\r
+\r
+ sg_entries = o_page + i_page;\r
+\r
+ sg_list = kcalloc(sg_entries, sizeof(struct scatterlist), GFP_KERNEL);\r
+\r
+ if (!sg_list) {\r
+ ret = -EIO;\r
+ goto out;\r
+ }\r
+\r
+ sg_init_table(sg_list, sg_entries);\r
+\r
+ sg = vmalloc_to_sg(sg_list, gldata->buffer, o_page);\r
+ sg = vmalloc_to_sg(sg, gldata->buffer, i_page);\r
+\r
+ if (!sg) {\r
+ ret = -EIO;\r
+ goto out_free;\r
+ }\r
+\r
+#if 0\r
+ /* Transfer data */\r
+ if (vq->vq_ops->add_buf(vq, sg_list, o_page, i_page, (void *)1) >= 0) {\r
+ vq->vq_ops->kick(vq);\r
+ /* Chill out until it's done with the buffer. */\r
+ while (!vq->vq_ops->get_buf(vq, &count))\r
+ cpu_relax();\r
+ }\r
+#else\r
+ /* The fifth parameter of virtqueue_add_buf : FIX ME */\r
+ /* Transfer data */\r
+ if (virtqueue_add_buf(vq, sg_list, o_page, i_page, (void *)1, GFP_ATOMIC) >= 0) {\r
+ virtqueue_kick(vq);\r
+ /* Chill out until it's done with the buffer. */\r
+ while (!virtqueue_get_buf(vq, &count))\r
+ cpu_relax();\r
+ }\r
+#endif\r
+\r
+out_free:\r
+ kfree(sg_list);\r
+out:\r
+ return ret;\r
+}\r
+\r
+static void free_buffer(struct virtio_gl_data *gldata)\r
+{\r
+ if (gldata->buffer) {\r
+ vfree(gldata->buffer);\r
+ gldata->buffer = NULL;\r
+ }\r
+}\r
+\r
+static int glmem_open(struct inode *inode, struct file *file)\r
+{\r
+ struct virtio_gl_data *gldata = kzalloc(sizeof(struct virtio_gl_data),\r
+ GFP_KERNEL);\r
+\r
+ if (!gldata)\r
+ return -ENXIO;\r
+\r
+ gldata->pid = pid_nr(task_pid(current));\r
+\r
+ file->private_data = gldata;\r
+\r
+ return 0;\r
+}\r
+\r
+static int glmem_mmap(struct file *filp, struct vm_area_struct *vma)\r
+{\r
+ struct virtio_gl_data *gldata = to_virtio_gl_data(filp);\r
+ int pages = (vma->vm_end - vma->vm_start) / PAGE_SIZE;\r
+\r
+ /* Set a reasonable limit */\r
+ if (pages > 16)\r
+ return -ENOMEM;\r
+\r
+ /* for now, just allow one buffer to be mmap()ed. */\r
+ if (gldata->buffer)\r
+ return -EIO;\r
+\r
+ gldata->buffer = vmalloc_user(pages*PAGE_SIZE);\r
+\r
+ if (!gldata->buffer)\r
+ return -ENOMEM;\r
+\r
+ gldata->pages = pages;\r
+\r
+ if (remap_vmalloc_range(vma, gldata->buffer, 0) < 0) {\r
+ vfree(gldata->buffer);\r
+ return -EIO;\r
+ }\r
+\r
+ vma->vm_flags |= VM_DONTEXPAND;\r
+\r
+ return 0;\r
+}\r
+\r
+// FIX ME : fsync parameter 2,3 parameter missing\r
+static int glmem_fsync(struct file *filp, int datasync)\r
+{\r
+ struct virtio_gl_data *gldata = to_virtio_gl_data(filp);\r
+\r
+ put_data(gldata);\r
+\r
+ return 0;\r
+}\r
+\r
+static int glmem_release(struct inode *inode, struct file *file)\r
+{\r
+ struct virtio_gl_data *gldata = to_virtio_gl_data(file);\r
+\r
+ if (gldata && gldata->buffer) {\r
+ struct virtio_gl_header *header =\r
+ (struct virtio_gl_header *)gldata->buffer;\r
+\r
+ /* Make sure the host hears about the process ending / dying */\r
+ header->pid = gldata->pid;\r
+ header->buf_size = SIZE_OUT_HEADER + 2;\r
+ header->r_buf_size = SIZE_IN_HEADER;\r
+ *(short *)(&header->buffer) = -1;\r
+\r
+ put_data(gldata);\r
+ free_buffer(gldata);\r
+ }\r
+\r
+ kfree(gldata);\r
+\r
+ return 0;\r
+}\r
+\r
+static const struct file_operations glmem_fops = {\r
+ .owner = THIS_MODULE,\r
+ .open = glmem_open,\r
+ .mmap = glmem_mmap,\r
+ .fsync = glmem_fsync,\r
+ .release = glmem_release,\r
+};\r
+\r
+static struct miscdevice glmem_dev = {\r
+ MISC_DYNAMIC_MINOR,\r
+ DEVICE_NAME,\r
+ &glmem_fops\r
+};\r
+\r
+static int glmem_probe(struct virtio_device *vdev)\r
+{\r
+ int ret;\r
+\r
+ /* We expect a single virtqueue. */\r
+ vq = virtio_find_single_vq(vdev, NULL, "output");\r
+ if (IS_ERR(vq))\r
+ return PTR_ERR(vq);\r
+\r
+ ret = misc_register(&glmem_dev);\r
+ if (ret) {\r
+ printk(KERN_ERR "glmem: cannot register glmem_dev as misc");\r
+ return -ENODEV;\r
+ }\r
+\r
+ return 0;\r
+}\r
+\r
+static void __devexit glmem_remove(struct virtio_device *vdev)\r
+{\r
+ vdev->config->reset(vdev);\r
+ misc_deregister(&glmem_dev);\r
+ vdev->config->del_vqs(vdev);\r
+}\r
+\r
+static struct virtio_device_id id_table[] = {\r
+ { VIRTIO_ID_GL, VIRTIO_DEV_ANY_ID },\r
+ { 0 },\r
+};\r
+\r
+static struct virtio_driver virtio_gl_driver = {\r
+ .driver = {\r
+ .name = KBUILD_MODNAME,\r
+ .owner = THIS_MODULE,\r
+ },\r
+ .id_table = id_table,\r
+ .probe = glmem_probe,\r
+ .remove = __devexit_p(glmem_remove),\r
+};\r
+\r
+static int __init glmem_init(void)\r
+{\r
+ return register_virtio_driver(&virtio_gl_driver);\r
+}\r
+\r
+static void __exit glmem_exit(void)\r
+{\r
+ unregister_virtio_driver(&virtio_gl_driver);\r
+}\r
+\r
+module_init(glmem_init);\r
+module_exit(glmem_exit);\r
+\r
+MODULE_DEVICE_TABLE(virtio, id_table);\r
+MODULE_DESCRIPTION("Virtio gl passthrough driver");\r
+MODULE_LICENSE("GPL v2");\r
+\r
To compile this driver as a module, choose M here: the
module will be called apm-power.
+config INPUT_SECBRIDGE
+ bool "Specific input event handler for Samsung"
+ depends on INPUT
+ default n
+ help
+ This driver implements the sec-input-bridge
+
comment "Input Device Drivers"
source "drivers/input/keyboard/Kconfig"
obj-$(CONFIG_INPUT_APMPOWER) += apm-power.o
obj-$(CONFIG_INPUT_OF_MATRIX_KEYMAP) += of_keymap.o
+
+obj-$(CONFIG_INPUT_SECBRIDGE) += sec-input-bridge.o
#include "hpps2atkbd.h" /* include the keyboard scancodes */
+#else
+
+/* conversion scancode for Tizen emulator */
+#ifndef MARU_SCANCODE
+ 0, 67, 65, 63, 61, 59, 60, 88, 169, 68, 66, 64, 62, 15, 41,117,
+ 132, 56, 42, 93, 29, 16, 2, 0, 174, 0, 44, 31, 30, 17, 3, 0,
+ 116, 46, 45, 32, 18, 5, 4, 95, 217, 57, 47, 33, 20, 19, 6,183,
+ 356, 49, 48, 35, 34, 21, 7,184, 0, 114, 50, 36, 22, 8, 9,185,
+ 0, 51, 37, 23, 24, 11, 10, 0, 0, 52, 53, 38, 39, 25, 12, 0,
+ 0, 115, 40, 0, 26, 13, 0, 0, 58, 54, 28, 27, 0, 43, 0, 85,
+ 0, 86, 91, 90, 92, 0, 14, 94, 0, 79,124, 75, 71,121, 0, 0,
+ 82, 83, 80, 76, 77, 72, 1, 69, 87, 78, 81, 74, 55, 73, 70, 99,
+
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 217,100,255, 0, 97,165, 0, 0,156, 0, 0, 0, 0, 0, 0,125,
+ 173,114, 0,113, 0, 0, 0,126,128, 0, 0,140, 0, 0, 0,127,
+ 159, 0,115, 0,164, 0, 0,116,158, 0,172,166, 0, 0, 0,142,
+ 157, 0, 0, 0, 0, 0, 0, 0,155, 0, 98, 0, 0,163, 0, 0,
+ 226, 0, 0, 0, 0, 0, 0, 0, 0,255, 96, 0, 0, 0,143, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0,107, 0,105,102, 0, 0,112,
+ 110,111,108,112,106,103, 0,119, 0,118,109, 0, 99,104,119, 0,
+
+ 0, 0, 0, 65, 99,
#else
0, 67, 65, 63, 61, 59, 60, 88, 0, 68, 66, 64, 62, 15, 41,117,
0, 56, 42, 93, 29, 16, 2, 0, 0, 0, 44, 31, 30, 17, 3, 0,
0, 0, 0, 65, 99,
#endif
+
+#endif
};
static const unsigned short atkbd_set3_keycode[ATKBD_KEYMAP_SIZE] = {
keycode = atkbd->keycode[code];
+/* conversion scancode for Tizen emulator */
+#ifndef MARU_SCANCODE
+ if (code == 100) code = 169;
+ else if (code == 101) code = 132;
+ else if (code == 102) code = 174;
+ else if (code == 103) code = 116;
+ else if (code == 104) code = 217;
+ else if (code == 105) code = 356;
+#endif
+
if (keycode != ATKBD_KEY_NULL)
input_event(dev, EV_MSC, MSC_SCAN, code);
atkbd->time = jiffies + msecs_to_jiffies(dev->rep[REP_DELAY]) / 2;
}
+#ifndef MARU_SCANCODE
+ dev_dbg(&serio->dev, "atkbd.c: Conversion Received code = (%d)%03x, keycode = (%d)%03x\n",
+ code, code, keycode, keycode);
+#endif
input_event(dev, EV_KEY, keycode, value);
input_sync(dev);
"AT Set 2 Extra keyboard");
else
snprintf(atkbd->name, sizeof(atkbd->name),
+#ifndef MARU_SCANCODE
+ "AT %s Set %d hardkeys",
+#else
"AT %s Set %d keyboard",
+#endif
atkbd->translated ? "Translated" : "Raw", atkbd->set);
snprintf(atkbd->phys, sizeof(atkbd->phys),
--- /dev/null
+/*
+ * sec-input-bridge.c - Specific control inpt event bridge for Samsung Electronics
+ *
+ * Copyright (C) 2010 Samsung Electronics
+ * Yongsul Oh <yongsul96.oh@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/input.h>
+#include <linux/slab.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/platform_device.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+
+#include <linux/workqueue.h>
+#include <linux/mutex.h>
+
+
+#include <linux/input/sec-input-bridge.h>
+
+extern int bkl_warning_operation(int on_off, int gamma);
+
+#ifdef CONFIG_KERNEL_LOGGING
+int rb_dump_ram_log_extract_to_file(char* file_path);
+#ifdef CONFIG_RB_DUMP_USE_NAND
+int rb_dump_nand_log_extract_to_file(char* file_path);
+#endif
+#endif // CONFIG_RB_DUMP_USE_NAND
+
+struct sec_input_bridge {
+ struct sec_input_bridge_platform_data *pdata;
+ struct work_struct work;
+ struct mutex lock;
+ struct platform_device *dev;
+
+ u8 check_index;
+};
+
+static void input_bridge_set_ids(struct input_device_id *ids, unsigned int type, unsigned int code)
+{
+ switch (type) {
+ case EV_KEY:
+ ids->flags = INPUT_DEVICE_ID_MATCH_KEYBIT;
+ __set_bit(code, ids->keybit);
+ break;
+
+ case EV_REL:
+ ids->flags = INPUT_DEVICE_ID_MATCH_RELBIT;
+ __set_bit(code, ids->relbit);
+ break;
+
+ case EV_ABS:
+ ids->flags = INPUT_DEVICE_ID_MATCH_ABSBIT;
+ __set_bit(code, ids->absbit);
+ break;
+
+ case EV_MSC:
+ ids->flags = INPUT_DEVICE_ID_MATCH_MSCIT;
+ __set_bit(code, ids->mscbit);
+ break;
+
+ case EV_SW:
+ ids->flags = INPUT_DEVICE_ID_MATCH_SWBIT;
+ __set_bit(code, ids->swbit);
+ break;
+
+ case EV_LED:
+ ids->flags = INPUT_DEVICE_ID_MATCH_LEDBIT;
+ __set_bit(code, ids->ledbit);
+ break;
+
+ case EV_SND:
+ ids->flags = INPUT_DEVICE_ID_MATCH_SNDBIT;
+ __set_bit(code, ids->sndbit);
+ break;
+
+ case EV_FF:
+ ids->flags = INPUT_DEVICE_ID_MATCH_FFBIT;
+ __set_bit(code, ids->ffbit);
+ break;
+
+ case EV_PWR:
+ /* do nothing */
+ break;
+
+ default:
+ printk(KERN_ERR
+ "input_bridge_set_ids: unknown type %u (code %u)\n",
+ type, code);
+ return;
+ }
+
+ ids->flags |= INPUT_DEVICE_ID_MATCH_EVBIT;
+ __set_bit(type, ids->evbit);
+}
+
+static void input_bridge_work(struct work_struct *work) {
+ struct sec_input_bridge *bridge = container_of(work,
+ struct sec_input_bridge, work);
+ int state = -EINVAL;
+ char env_str[16];
+ char *envp[] = { env_str, NULL };
+
+#ifdef CONFIG_KERNEL_LOGGING
+ rb_dump_ram_log_extract_to_file(NULL);
+#ifdef CONFIG_RB_DUMP_USE_NAND
+ rb_dump_nand_log_extract_to_file(NULL);
+#endif
+#endif
+
+ mutex_lock(&bridge->lock);
+
+ if (bridge->pdata->send_uevent) {
+ sprintf(env_str, "%s=%s", bridge->pdata->uevent_env_str , bridge->pdata->uevent_env_value);
+ state = kobject_uevent_env(&bridge->dev->dev.kobj, bridge->pdata->uevent_action, envp);
+// state = kobject_uevent(&bridge->dev->dev.kobj, bridge->pdata->uevent_action);
+ if (state != 0)
+ printk(KERN_ERR
+ "<error , kobject_uevent_env fail> with action : %d\n",bridge->pdata->uevent_action);
+ }
+
+ if (bridge->pdata->pre_event_func && (state == 0)) {
+ bridge->pdata->pre_event_func(bridge->pdata->event_data);
+ }
+
+ /* LCD on/off to confirm action*/
+#if 0 // emulator
+ ssleep(2);
+
+ for (i=0 ; i<8 ; i++) {
+ bkl_warning_operation(1, 0);
+ msleep(500);
+
+ bkl_warning_operation(1, 10);
+ msleep(500);
+ }
+
+ /* recovery first state*/
+ bkl_warning_operation(0, 0);
+#endif
+
+ mutex_unlock(&bridge->lock);
+}
+
+static void input_bridge_event(struct input_handle *handle, unsigned int type,
+ unsigned int code, int value)
+{
+ int rep_check;
+
+ struct input_handler *sec_bridge_handler = handle->handler;
+ struct sec_input_bridge *sec_bridge = sec_bridge_handler->private;
+
+ rep_check = test_bit(EV_REP,sec_bridge_handler->id_table->evbit);
+ rep_check = (rep_check << 1) | 1;
+
+ switch (type) {
+ case EV_KEY:
+ if ( value & rep_check ) {
+ printk(KERN_INFO
+ "sec-input-bridge: KEY input intercepted, type : %d , code : %d , value %d, index : %d, mkey_max : %d \n",
+ type,code,value, sec_bridge->check_index, sec_bridge->pdata->num_mkey);
+ if ( sec_bridge->pdata->mkey_map[sec_bridge->check_index].code == code) {
+ sec_bridge->check_index++;
+ printk(KERN_INFO "sec-input-bridge: code ok!\n");
+ if ( (sec_bridge->check_index) >= (sec_bridge->pdata->num_mkey) ) {
+ printk(KERN_INFO "sec-input-bridge: index is max \n");
+ schedule_work(&sec_bridge->work);
+ sec_bridge->check_index = 0;
+ }
+ } else {
+ sec_bridge->check_index = 0;
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+
+}
+
+static int input_bridge_connect(struct input_handler *handler,
+ struct input_dev *dev,
+ const struct input_device_id *id)
+{
+ struct input_handle *handle;
+ int error;
+
+ handle = kzalloc(sizeof(struct input_handle), GFP_KERNEL);
+ if (!handle)
+ return -ENOMEM;
+
+ handle->dev = dev;
+ handle->handler = handler;
+ handle->name = "sec-input-bridge";
+
+ error = input_register_handle(handle);
+ if (error) {
+ printk(KERN_ERR
+ "sec-input-bridge: Failed to register input bridge handler, "
+ "error %d\n", error);
+ kfree(handle);
+ return error;
+ }
+
+ error = input_open_device(handle);
+ if (error) {
+ printk(KERN_ERR
+ "sec-input-bridge: Failed to open input bridge device, "
+ "error %d\n", error);
+ input_unregister_handle(handle);
+ kfree(handle);
+ return error;
+ }
+
+ return 0;
+}
+
+static void input_bridge_disconnect(struct input_handle *handle)
+{
+ input_close_device(handle);
+ input_unregister_handle(handle);
+ kfree(handle);
+}
+
+static struct input_handler input_bridge_handler = {
+ .event = input_bridge_event,
+ .connect = input_bridge_connect,
+ .disconnect = input_bridge_disconnect,
+ .name = "sec-input-bridge",
+};
+
+static int __devinit sec_input_bridge_probe(struct platform_device *dev)
+{
+ struct sec_input_bridge_platform_data *pdata;
+ struct sec_input_bridge *bridge;
+ struct input_device_id *input_bridge_ids;
+
+ int state;
+ int i;
+
+ pdata = dev->dev.platform_data;
+ if (!pdata) {
+ dev_err(&dev->dev, "No samsung input bridge platform data.\n");
+ return -EINVAL;
+ }
+
+ if (pdata->num_mkey == 0) {
+ dev_err(&dev->dev, "No samsung input bridge platform data. num_mkey == 0\n");
+ return -EINVAL;
+ }
+
+ bridge = kzalloc(sizeof(struct sec_input_bridge), GFP_KERNEL);
+ if (!bridge)
+ return -ENOMEM;
+
+ input_bridge_ids = kzalloc(sizeof(struct input_device_id[(pdata->num_mkey +1)]), GFP_KERNEL);
+ if(!input_bridge_ids) {
+ kfree(bridge);
+ return -ENOMEM;
+ }
+ memset(input_bridge_ids, 0x00, sizeof(input_bridge_ids));
+
+ for( i=0 ; i < pdata->num_mkey ; i++ ) {
+ input_bridge_set_ids(&input_bridge_ids[i], pdata->mkey_map[i].type, pdata->mkey_map[i].code);
+ }
+
+ input_bridge_handler.private = bridge;
+ input_bridge_handler.id_table = input_bridge_ids;
+
+ state = input_register_handler(&input_bridge_handler);
+ if (state)
+ goto input_register_fail;
+
+ bridge->dev = dev;
+ bridge->pdata = pdata;
+
+ INIT_WORK(&bridge->work, input_bridge_work);
+ mutex_init(&bridge->lock);
+
+ platform_set_drvdata(dev, bridge);
+
+ return 0;
+
+input_register_fail:
+ cancel_work_sync(&bridge->work);
+ mutex_destroy(&bridge->lock);
+ kfree(bridge);
+ kfree(input_bridge_ids);
+
+ return state;
+
+}
+
+static int __devexit sec_input_bridge_remove(struct platform_device *dev)
+{
+ struct sec_input_bridge *bridge = platform_get_drvdata(dev);
+
+ cancel_work_sync(&bridge->work);
+ mutex_destroy(&bridge->lock);
+ kfree(input_bridge_handler.id_table);
+ input_unregister_handler(&input_bridge_handler);
+ kfree(bridge);
+ platform_set_drvdata(dev, NULL);
+
+ return 0;
+}
+
+
+#ifdef CONFIG_PM
+static int sec_input_bridge_suspend(struct platform_device *dev, pm_message_t state)
+{
+ return 0;
+}
+
+static int sec_input_bridge_resume(struct platform_device *dev)
+{
+ return 0;
+}
+#else
+#define sec_input_bridge_suspend NULL
+#define sec_input_bridge_resume NULL
+#endif
+
+static struct platform_driver sec_input_bridge_driver = {
+ .probe = sec_input_bridge_probe,
+ .remove = __devexit_p(sec_input_bridge_remove),
+ .suspend = sec_input_bridge_suspend,
+ .resume = sec_input_bridge_resume,
+ .driver = {
+ .name = "samsung_input_bridge",
+ },
+};
+
+static const struct sec_input_bridge_mkey emul_mkey_map[] = {
+ { .type = EV_KEY , .code = KEY_VOLUMEUP },
+ { .type = EV_KEY , .code = KEY_VOLUMEDOWN },
+ { .type = EV_KEY , .code = KEY_FRONT },
+ { .type = EV_KEY , .code = KEY_FRONT },
+ { .type = EV_KEY , .code = KEY_VOLUMEUP },
+ { .type = EV_KEY , .code = KEY_VOLUMEDOWN },
+ { .type = EV_KEY , .code = KEY_VOLUMEUP },
+ { .type = EV_KEY , .code = KEY_FRONT },
+};
+
+static struct sec_input_bridge_platform_data emul_input_bridge_data = {
+
+ .mkey_map = emul_mkey_map ,
+ .num_mkey = ARRAY_SIZE(emul_mkey_map),
+
+ .send_uevent = 1,
+ .uevent_action = KOBJ_CHANGE,
+ .uevent_env_str = "RB_DUMP",
+ .uevent_env_value = "ON",
+};
+
+static struct platform_device emul_input_bridge = {
+ .name = "samsung_input_bridge",
+ .id = -1,
+ .dev = {
+ .platform_data = &emul_input_bridge_data,
+ },
+};
+
+//static struct platform_device *sec_input_bridge_device;
+
+static int __init sec_input_bridge_init(void)
+{
+ int err = 0;
+
+ platform_device_register(&emul_input_bridge);
+
+ err = platform_driver_register(&sec_input_bridge_driver);
+
+ /*
+ if (!err) {
+ sec_input_bridge_device = platform_device_alloc("samsung_input_bridge", 0);
+ if (sec_input_bridge_device)
+ err = platform_device_add(sec_input_bridge_device);
+ else
+ err = -ENOMEM;
+
+ if (err) {
+ platform_device_put(sec_input_bridge_device);
+ platform_driver_unregister(&sec_input_bridge_driver);
+ return err;
+ }
+ }
+ */
+ return err;
+}
+
+static void __exit sec_input_bridge_exit(void)
+{
+ platform_driver_unregister(&sec_input_bridge_driver);
+}
+
+
+module_init(sec_input_bridge_init);
+
+#ifdef CONFIG_CHARGER_DETECT_BOOT
+charger_module_init(sec_input_bridge_init);
+#endif
+
+module_exit(sec_input_bridge_exit);
+
+MODULE_AUTHOR("Yongsul Oh <yongsul96.oh@samsung.com>");
+MODULE_DESCRIPTION("Input Event -> Specific Control Bridge");
+MODULE_LICENSE("GPL");
--- /dev/null
+menuconfig MARU
+ tristate "MARU virtual device drivers for emulator"
+ default n
+
+config MARU_LCD
+ tristate "MARU LCD driver"
+ depends on MARU != n
+
+config MARU_CODEC
+ tristate "MARU codec driver"
+ depends on MARU != n
+
+config MARU_TOUCHSCREEN
+ tristate "MARU touchscreen driver"
+ depends on MARU != n
+
+config MARU_FB
+ tristate "MARU framebuffer driver"
+ depends on MARU != n
+
+config MARU_CAMERA
+ tristate "MARU Camera Driver"
+ depends on MARU != n && VIDEO_DEV && VIDEO_V4L2
+ select VIDEOBUF_VMALLOC
+ ---help---
+ Enables a MARU Virtual Camera driver.
+
+config MARU_BACKLIGHT
+ tristate "MARU Backlight Driver"
+ depends on MARU && BACKLIGHT_CLASS_DEVICE
+ default y
+ help
+ Say Y to enable the backlight driver of MARU.
+
+config MARU_OVERLAY
+ tristate "MARU overlay Driver"
+ depends on MARU != n && VIDEO_DEV && VIDEO_V4L2 && !SPARC32 && !SPARC64
+
+config MARU_JACK
+ tristate "MARU Jack Driver"
+ depends on MARU != n
+
+config MARU_POWER_SUPPLY
+ tristate "MARU Power supply Driver"
+ depends on MARU != n
+
+config MARU_USB_MASS_STORAGE
+ tristate "MARU Usb mass storage Driver"
+ depends on MARU != n
+
+config MARU_USB_MODE
+ tristate "MARU Usb mode Driver"
+ depends on MARU != n
--- /dev/null
+obj-$(CONFIG_MARU_LCD) += maru_lcd.o
+obj-$(CONFIG_MARU_CODEC) += maru_codec.o
+obj-$(CONFIG_MARU_TOUCHSCREEN) += maru_touchscreen.o
+obj-$(CONFIG_MARU_FB) += maru_fb.o
+obj-$(CONFIG_MARU_CAMERA) += maru_camera.o
+obj-$(CONFIG_MARU_BACKLIGHT) += maru_bl.o
+obj-$(CONFIG_MARU_OVERLAY) += maru_overlay.o
+obj-$(CONFIG_MARU_JACK) += maru_jack.o
+obj-$(CONFIG_MARU_POWER_SUPPLY) += maru_power_supply.o
+obj-$(CONFIG_MARU_USB_MASS_STORAGE) += maru_usb_mass_storage.o
+obj-$(CONFIG_MARU_USB_MODE) += maru_usb_mode.o
--- /dev/null
+/*
+ * MARU Virtual Backlight Driver
+ *
+ * Copyright (c) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Dohyung Hong <don.hong@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/pci.h>
+#include <linux/device.h>
+#include <linux/notifier.h>
+#include <linux/ctype.h>
+#include <linux/err.h>
+#include <linux/fb.h>
+#include <linux/backlight.h>
+
+#include <asm/uaccess.h>
+
+#define MARUBL_DRIVER_NAME "svb"
+#define PCI_DEVICE_ID_VIRTUAL_BRIGHTNESS 0x1014
+
+static struct pci_device_id marubl_pci_table[] __devinitdata =
+{
+ {
+ .vendor = PCI_VENDOR_ID_TIZEN,
+ .device = PCI_DEVICE_ID_VIRTUAL_BRIGHTNESS,
+ .subvendor = PCI_ANY_ID,
+ .subdevice = PCI_ANY_ID,
+ }
+};
+MODULE_DEVICE_TABLE(pci, marubl_pci_table);
+
+/* MARU virtual brightness(backlight) device structure */
+struct marubl {
+ struct backlight_device *bl_dev;
+ unsigned int brightness;
+ resource_size_t reg_start, reg_size;
+ unsigned char __iomem *marubl_mmreg; /* marubl: memory mapped registers */
+};
+
+/* ============================================================================== */
+static struct marubl *marubl_device;
+/* ============================================================================== */
+
+static int max_brightness = 24;
+
+static int marubl_get_intensity(struct backlight_device *bd)
+{
+ return marubl_device->brightness;
+ // return marubl_device->brightness = (unsigned int)readl(marubl_device->marubl_mmreg);
+}
+
+static int marubl_send_intensity(struct backlight_device *bd)
+{
+ int intensity = bd->props.brightness;
+ unsigned int off = 0;
+
+ if (bd->props.power != FB_BLANK_UNBLANK) {
+ intensity = 0;
+ off = 1;
+ }
+ if (bd->props.state & BL_CORE_FBBLANK) {
+ intensity = 0;
+ off = 1;
+ }
+ if (bd->props.state & BL_CORE_SUSPENDED) {
+ intensity = 0;
+ off = 1;
+ }
+// if (bd->props.state & GENERICBL_BATTLOW)
+// intensity &= bl_machinfo->limit_mask;
+
+ writel(intensity, marubl_device->marubl_mmreg);
+ writel(off, marubl_device->marubl_mmreg + 0x04);
+ marubl_device->brightness = intensity;
+
+ return 0;
+}
+
+static struct backlight_ops marubl_ops = {
+ .options = BL_CORE_SUSPENDRESUME,
+ .get_brightness = marubl_get_intensity,
+ .update_status = marubl_send_intensity,
+};
+
+/* pci probe function
+*/
+static int __devinit marubl_probe(struct pci_dev *pci_dev,
+ const struct pci_device_id *ent)
+{
+ int ret;
+ struct backlight_device *bd;
+
+ marubl_device = kmalloc(sizeof(struct marubl), GFP_KERNEL);
+ if (marubl_device == NULL) {
+ printk(KERN_ERR "marubl: kmalloc() is failed.\n");
+ return -1;
+ }
+
+ memset(marubl_device, 0, sizeof(struct marubl));
+
+ if ((ret = pci_enable_device(pci_dev)) < 0) {
+ printk(KERN_ERR "marubl: pci_enable_device is failed.\n");
+ goto outnotdev;
+ }
+
+ ret = -EIO;
+
+ /* 1 : IORESOURCE_MEM */
+ if (!request_mem_region(marubl_device->reg_start = pci_resource_start(pci_dev, 1),
+ marubl_device->reg_size = pci_resource_len(pci_dev, 1),
+ MARUBL_DRIVER_NAME)) {
+ goto outnotdev;
+ }
+
+ /* memory areas mapped kernel space */
+ marubl_device->marubl_mmreg = ioremap(marubl_device->reg_start, marubl_device->reg_size);
+ if (!marubl_device->marubl_mmreg) {
+ goto outnotdev;
+ }
+
+ //pci_write_config_byte(pci_dev, PCI_CACHE_LINE_SIZE, 8);
+ pci_write_config_byte(pci_dev, PCI_LATENCY_TIMER, 64);
+ pci_set_master(pci_dev);
+
+ /*
+ * register backlight device
+ */
+ bd = backlight_device_register ("emulator", &pci_dev->dev, NULL, &marubl_ops);
+ if (IS_ERR (bd)) {
+ ret = PTR_ERR (bd);
+ goto outnotdev;
+ }
+
+ bd->props.brightness = (unsigned int)readl(marubl_device->marubl_mmreg);;
+ bd->props.max_brightness = max_brightness;
+ bd->props.power = FB_BLANK_UNBLANK;
+ backlight_update_status(bd);
+
+ marubl_device->bl_dev = bd;
+
+ printk(KERN_INFO "marubl: MARU Virtual Backlight driver.\n");
+ return 0;
+
+outnotdev:
+ if (marubl_device->marubl_mmreg)
+ iounmap(marubl_device->marubl_mmreg);
+ kfree(marubl_device);
+ return ret;
+}
+
+static void __devexit marubl_exit(struct pci_dev *pcidev)
+{
+ /*
+ * Unregister backlight device
+ */
+ struct backlight_device *bd = marubl_device->bl_dev;
+
+ bd->props.power = 0;
+ bd->props.brightness = 0;
+ backlight_update_status(bd);
+
+ backlight_device_unregister(bd);
+
+ /*
+ * Unregister pci device & delete device
+ */
+ iounmap(marubl_device->marubl_mmreg);
+ pci_disable_device(pcidev);
+ kfree(marubl_device);
+}
+
+/*
+ * register pci driver
+ */
+static struct pci_driver marubl_pci_driver = {
+ .name = MARUBL_DRIVER_NAME,
+ .id_table = marubl_pci_table,
+ .probe = marubl_probe,
+ .remove = __devexit_p(marubl_exit),
+#ifdef CONFIG_PM
+ //.suspend = marubl_suspend,
+ //.resume = marubl_resume,
+#endif
+};
+
+static int __init marubl_module_init(void)
+{
+ return pci_register_driver(&marubl_pci_driver);
+}
+
+static void __exit marubl_module_exit(void)
+{
+ pci_unregister_driver(&marubl_pci_driver);
+}
+
+/*
+ * if this is compiled into the kernel, we need to ensure that the
+ * class is registered before users of the class try to register lcd's
+ */
+module_init(marubl_module_init);
+module_exit(marubl_module_exit);
+
+MODULE_LICENSE("GPL2");
+MODULE_AUTHOR("Dohyung Hong <don.hong@samsung.com>");
+MODULE_DESCRIPTION("MARU Virtual Backlight Driver for x86");
--- /dev/null
+/*
+ * MARU Virtual Camera Driver
+ *
+ * Copyright (c) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * DongKyun Yun <dk77.yun@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+/*
+ * Some code based on vivi driver or videobuf_vmalloc.
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/errno.h>
+#include <linux/slab.h>
+#include <linux/fs.h>
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <linux/init.h>
+#include <linux/pci.h>
+#include <linux/version.h>
+#include <linux/mutex.h>
+#include <linux/pagemap.h>
+#include <asm/page.h>
+#include <asm/pgtable.h>
+#include <linux/interrupt.h>
+#include <linux/videodev2.h>
+#include <media/videobuf-core.h>
+#include <media/v4l2-device.h>
+#include <media/v4l2-ioctl.h>
+
+static unsigned debug = 1;
+
+#define marucam_err(fmt, arg...) \
+ printk(KERN_ERR "marucam[%s] : " fmt, __func__, ##arg)
+
+#define marucam_warn(fmt, arg...) \
+ printk(KERN_WARNING "marucam[%s] : " fmt, __func__, ##arg)
+
+#define marucam_info(fmt, arg...) \
+ printk(KERN_INFO "marucam[%s] : " fmt, __func__, ##arg)
+
+#define marucam_dbg(level, fmt, arg...) \
+ do { \
+ if (debug >= (level)) \
+ printk(KERN_DEBUG "marucam[%s] : " fmt, __func__, ##arg); \
+ } while (0)
+
+#define MARUCAM_MODULE_NAME "marucam"
+
+#define MARUCAM_MAJOR_VERSION 0
+#define MARUCAM_MINOR_VERSION 20
+#define MARUCAM_RELEASE 1
+#define MARUCAM_VERSION \
+ KERNEL_VERSION(MARUCAM_MAJOR_VERSION, MARUCAM_MINOR_VERSION, MARUCAM_RELEASE)
+
+MODULE_DESCRIPTION("MARU Virtual Camera Driver");
+MODULE_AUTHOR("Jinhyung Jo <jinhyung.jo@samsung.com>");
+MODULE_LICENSE("GPL2");
+
+#define DFL_WIDTH 320
+#define DFL_HEIGHT 240
+
+/* ------------------------------------------------------------------
+ Basic structures
+ ------------------------------------------------------------------*/
+#define MARUCAM_INIT 0x00
+#define MARUCAM_OPEN 0x04
+#define MARUCAM_CLOSE 0x08
+#define MARUCAM_ISSTREAM 0x0C
+#define MARUCAM_START_PREVIEW 0x10
+#define MARUCAM_STOP_PREVIEW 0x14
+#define MARUCAM_S_PARAM 0x18
+#define MARUCAM_G_PARAM 0x1C
+#define MARUCAM_ENUM_FMT 0x20
+#define MARUCAM_TRY_FMT 0x24
+#define MARUCAM_S_FMT 0x28
+#define MARUCAM_G_FMT 0x2C
+#define MARUCAM_QCTRL 0x30
+#define MARUCAM_S_CTRL 0x34
+#define MARUCAM_G_CTRL 0x38
+#define MARUCAM_ENUM_FSIZES 0x3C
+#define MARUCAM_ENUM_FINTV 0x40
+#define MARUCAM_S_DATA 0x44
+#define MARUCAM_G_DATA 0x48
+#define MARUCAM_CLRIRQ 0x4C
+#define MARUCAM_DTC 0x50
+#define MARUCAM_REQFRAME 0x54
+
+struct marucam_device {
+ struct v4l2_device v4l2_dev;
+
+ spinlock_t slock;
+
+ struct video_device *vfd;
+ struct pci_dev *pdev;
+
+ void __iomem *mmregs;
+ resource_size_t io_base;
+ resource_size_t io_size;
+ resource_size_t mem_base;
+ resource_size_t mem_size;
+
+ enum v4l2_buf_type type;
+ unsigned int width;
+ unsigned int height;
+ unsigned int pixelformat;
+ struct videobuf_queue vb_vidq;
+
+ struct list_head active;
+};
+
+/*
+ * The code below has been modified from 'videobuf_vmalloc.c'.
+ */
+
+#define MAGIC_MARUCAM_MEM 0x18221223
+
+#define MAGIC_CHECK(is,should) if (unlikely((is) != (should))) \
+ { marucam_err("magic mismatch: %x (expected %x)\n",is,should); BUG(); }
+
+struct videobuf_marucam_memory
+{
+ u32 magic;
+ u32 mapped;
+};
+
+static void
+videobuf_vm_open(struct vm_area_struct *vma)
+{
+ struct videobuf_mapping *map = vma->vm_private_data;
+
+ map->count++;
+}
+
+static void videobuf_vm_close(struct vm_area_struct *vma)
+{
+ struct videobuf_mapping *map = vma->vm_private_data;
+ struct videobuf_queue *q = map->q;
+ int i;
+
+ map->count--;
+ if (0 == map->count) {
+ struct videobuf_marucam_memory *mem;
+
+ mutex_lock(&q->vb_lock);
+
+ if (q->streaming)
+ videobuf_queue_cancel(q);
+
+ for (i = 0; i < VIDEO_MAX_FRAME; i++) {
+ if (NULL == q->bufs[i])
+ continue;
+
+ if (q->bufs[i]->map != map)
+ continue;
+
+ mem = q->bufs[i]->priv;
+ if (mem) {
+ MAGIC_CHECK(mem->magic, MAGIC_MARUCAM_MEM);
+
+ mem->mapped = 0;
+ }
+
+ q->bufs[i]->map = NULL;
+ q->bufs[i]->baddr = 0;
+ }
+
+ kfree(map);
+
+ mutex_unlock(&q->vb_lock);
+ }
+
+ return;
+}
+
+static const struct vm_operations_struct videobuf_vm_ops =
+{
+ .open = videobuf_vm_open,
+ .close = videobuf_vm_close,
+};
+
+static void *__videobuf_alloc(size_t size)
+{
+ struct videobuf_marucam_memory *mem;
+ struct videobuf_buffer *vb;
+
+ vb = kzalloc(size+sizeof(*mem),GFP_KERNEL);
+
+ mem = vb->priv = ((char *)vb)+size;
+ mem->magic = MAGIC_MARUCAM_MEM;
+
+ return vb;
+}
+
+static int __videobuf_iolock (struct videobuf_queue* q,
+ struct videobuf_buffer *vb,
+ struct v4l2_framebuffer *fbuf)
+{
+ struct videobuf_marucam_memory *mem = vb->priv;
+
+ BUG_ON(!mem);
+
+ MAGIC_CHECK(mem->magic, MAGIC_MARUCAM_MEM);
+
+ switch (vb->memory) {
+ case V4L2_MEMORY_MMAP:
+ if (!mem->mapped) {
+ marucam_err("memory is not mmapped.\n");
+ return -EINVAL;
+ }
+ break;
+ default:
+ marucam_err("Memory method currently unsupported.\n");
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+static int __videobuf_sync(struct videobuf_queue *q,
+ struct videobuf_buffer *buf)
+{
+ return 0;
+}
+
+static int __videobuf_mmap_free(struct videobuf_queue *q)
+{
+ unsigned int i;
+
+ for (i = 0; i < VIDEO_MAX_FRAME; i++) {
+ if (q->bufs[i]) {
+ if (q->bufs[i]->map)
+ return -EBUSY;
+ }
+ }
+
+ return 0;
+}
+
+static int __videobuf_mmap_mapper(struct videobuf_queue *q,
+ struct vm_area_struct *vma)
+{
+ struct videobuf_marucam_memory *mem;
+ struct videobuf_mapping *map;
+ unsigned int first;
+ int retval, pages;
+ unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
+
+ if (!(vma->vm_flags & VM_WRITE) || !(vma->vm_flags & VM_SHARED))
+ return -EINVAL;
+
+ for (first = 0; first < VIDEO_MAX_FRAME; first++) {
+ if (NULL == q->bufs[first])
+ continue;
+
+ if (V4L2_MEMORY_MMAP != q->bufs[first]->memory)
+ continue;
+ if (q->bufs[first]->boff == offset)
+ break;
+ }
+ if (VIDEO_MAX_FRAME == first) {
+ return -EINVAL;
+ }
+
+ map = kzalloc(sizeof(struct videobuf_mapping), GFP_KERNEL);
+ if (NULL == map)
+ return -ENOMEM;
+
+ q->bufs[first]->map = map;
+ map->start = vma->vm_start;
+ map->end = vma->vm_end;
+ map->q = q;
+
+ q->bufs[first]->baddr = vma->vm_start;
+
+ mem = q->bufs[first]->priv;
+ BUG_ON(!mem);
+ mem->mapped = 1;
+ MAGIC_CHECK(mem->magic, MAGIC_MARUCAM_MEM);
+
+ pages = PAGE_ALIGN(vma->vm_end - vma->vm_start);
+
+ vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
+ retval = remap_pfn_range(vma, vma->vm_start,
+ (((struct marucam_device*)q->priv_data)->mem_base + vma->vm_pgoff) >> PAGE_SHIFT,
+ pages, vma->vm_page_prot);
+ if (retval < 0) {
+ marucam_err("remap failed with error %d. ", retval);
+ mem->mapped = 0;
+ goto error;
+ }
+
+ vma->vm_ops = &videobuf_vm_ops;
+ vma->vm_flags |= VM_DONTEXPAND | VM_RESERVED;
+ vma->vm_private_data = map;
+
+ videobuf_vm_open(vma);
+
+ return 0;
+
+error:
+ mem = NULL;
+ kfree(map);
+ return -ENOMEM;
+}
+
+static struct videobuf_qtype_ops qops = {
+ .magic = MAGIC_QTYPE_OPS,
+
+ .alloc = __videobuf_alloc,
+ .iolock = __videobuf_iolock,
+ .sync = __videobuf_sync,
+ .mmap_free = __videobuf_mmap_free,
+ .mmap_mapper = __videobuf_mmap_mapper,
+};
+
+void videobuf_queue_marucam_init(struct videobuf_queue* q,
+ struct videobuf_queue_ops *ops,
+ void *dev,
+ spinlock_t *irqlock,
+ enum v4l2_buf_type type,
+ enum v4l2_field field,
+ unsigned int msize,
+ void *priv)
+{
+ videobuf_queue_core_init(q, ops, dev, irqlock, type, field, msize,
+ priv, &qops);
+}
+
+
+/* ------------------------------------------------------------------
+ interrupt handling
+ ------------------------------------------------------------------*/
+
+static int get_image_size(struct marucam_device *dev)
+{
+ int size;
+
+ switch (dev->pixelformat) {
+ case V4L2_PIX_FMT_RGB24:
+ case V4L2_PIX_FMT_BGR24:
+ size = dev->width * dev->height * 3;
+ break;
+ case V4L2_PIX_FMT_YUV420:
+ case V4L2_PIX_FMT_YVU420:
+ case V4L2_PIX_FMT_NV12:
+ size = (dev->width * dev->height * 3) /2;
+ break;
+ case V4L2_PIX_FMT_YUYV:
+ default:
+ size = dev->width * dev->height * 2;
+ break;
+ }
+
+ return size;
+}
+
+static void marucam_fillbuf(struct marucam_device *dev)
+{
+ struct videobuf_queue *q = &dev->vb_vidq;
+ struct videobuf_buffer *buf = NULL;
+ unsigned long flags = 0;
+
+ spin_lock_irqsave(q->irqlock, flags);
+ if (list_empty(&dev->active)) {
+ goto done;
+ }
+
+ buf = list_entry(dev->active.next, struct videobuf_buffer, queue);
+ if (!waitqueue_active(&buf->done)) {
+ goto done;
+ }
+ list_del(&buf->queue);
+
+ buf->state = VIDEOBUF_DONE;
+ do_gettimeofday(&buf->ts);
+ buf->field_count++;
+ wake_up_interruptible(&buf->done);
+
+done:
+ spin_unlock_irqrestore(q->irqlock, flags);
+}
+
+static irqreturn_t marucam_irq_handler(int irq, void *dev_id)
+{
+ struct marucam_device *dev = dev_id;
+
+ if (!ioread32(dev->mmregs + MARUCAM_ISSTREAM))
+ return IRQ_NONE;
+
+ iowrite32(0, dev->mmregs + MARUCAM_CLRIRQ);
+ marucam_fillbuf(dev);
+ return IRQ_HANDLED;
+}
+
+/* ------------------------------------------------------------------
+ IOCTL vidioc handling
+ ------------------------------------------------------------------*/
+static int vidioc_querycap(struct file *file, void *priv,
+ struct v4l2_capability *cap)
+{
+ struct marucam_device *dev = priv;
+
+ strcpy(cap->driver, MARUCAM_MODULE_NAME);
+ strcpy(cap->card, MARUCAM_MODULE_NAME);
+ strlcpy(cap->bus_info, dev->v4l2_dev.name, sizeof(cap->bus_info));
+ cap->version = MARUCAM_VERSION;
+ cap->capabilities = V4L2_CAP_VIDEO_CAPTURE |
+ V4L2_CAP_STREAMING;
+ return 0;
+}
+
+static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
+ struct v4l2_fmtdesc *f)
+{
+ struct marucam_device *dev = priv;
+ uint32_t ret;
+
+ if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
+ return -EINVAL;
+
+ iowrite32(0, dev->mmregs + MARUCAM_DTC);
+ iowrite32(f->index, dev->mmregs + MARUCAM_S_DATA);
+
+ iowrite32(0, dev->mmregs + MARUCAM_ENUM_FMT);
+ ret = ioread32(dev->mmregs + MARUCAM_ENUM_FMT);
+ if (ret > 0)
+ return -(ret);
+
+ f->index = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ f->flags = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ f->pixelformat = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ ioread32_rep(dev->mmregs + MARUCAM_G_DATA, f->description, 8);
+
+ return 0;
+}
+
+static int vidioc_g_fmt_vid_cap(struct file *file, void *priv,
+ struct v4l2_format *f)
+{
+ struct marucam_device *dev = priv;
+ uint32_t ret;
+
+ iowrite32(0, dev->mmregs + MARUCAM_DTC);
+ iowrite32(0, dev->mmregs + MARUCAM_G_FMT);
+ ret = ioread32(dev->mmregs + MARUCAM_G_FMT);
+ if (ret > 0)
+ return -(ret);
+
+ f->fmt.pix.width = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ f->fmt.pix.height = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ f->fmt.pix.field = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ f->fmt.pix.pixelformat = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ f->fmt.pix.bytesperline = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ f->fmt.pix.sizeimage = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ f->fmt.pix.colorspace = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ f->fmt.pix.priv = ioread32(dev->mmregs + MARUCAM_G_DATA);
+
+ dev->pixelformat = f->fmt.pix.pixelformat;
+ dev->width = f->fmt.pix.width;
+ dev->height = f->fmt.pix.height;
+ dev->vb_vidq.field = f->fmt.pix.field;
+ dev->type = f->type;
+
+ return 0;
+}
+
+static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
+ struct v4l2_format *f)
+{
+ struct marucam_device *dev = priv;
+ uint32_t ret;
+
+ iowrite32(0, dev->mmregs + MARUCAM_DTC);
+ iowrite32(f->fmt.pix.width, dev->mmregs + MARUCAM_S_DATA);
+ iowrite32(f->fmt.pix.height, dev->mmregs + MARUCAM_S_DATA);
+ iowrite32(f->fmt.pix.pixelformat, dev->mmregs + MARUCAM_S_DATA);
+ iowrite32(f->fmt.pix.field, dev->mmregs + MARUCAM_S_DATA);
+
+ iowrite32(0, dev->mmregs + MARUCAM_TRY_FMT);
+ ret = ioread32(dev->mmregs + MARUCAM_TRY_FMT);
+
+ if (ret > 0)
+ return -(ret);
+
+ f->fmt.pix.width = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ f->fmt.pix.height = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ f->fmt.pix.field = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ f->fmt.pix.pixelformat = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ f->fmt.pix.bytesperline = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ f->fmt.pix.sizeimage = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ f->fmt.pix.colorspace = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ f->fmt.pix.priv = ioread32(dev->mmregs + MARUCAM_G_DATA);
+
+ return 0;
+}
+
+static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
+ struct v4l2_format *f)
+{
+ struct marucam_device *dev = priv;
+ struct videobuf_queue *q = &dev->vb_vidq;
+ uint32_t ret;
+
+ mutex_lock(&q->vb_lock);
+ if (videobuf_queue_is_busy(&dev->vb_vidq)) {
+ marucam_dbg(1, "queue busy\n");
+ mutex_unlock(&q->vb_lock);
+ return -EBUSY;
+ }
+ iowrite32(0, dev->mmregs + MARUCAM_DTC);
+ iowrite32(f->fmt.pix.width, dev->mmregs + MARUCAM_S_DATA);
+ iowrite32(f->fmt.pix.height, dev->mmregs + MARUCAM_S_DATA);
+ iowrite32(f->fmt.pix.pixelformat, dev->mmregs + MARUCAM_S_DATA);
+ iowrite32(f->fmt.pix.field, dev->mmregs + MARUCAM_S_DATA);
+
+ iowrite32(0, dev->mmregs + MARUCAM_S_FMT);
+ ret = ioread32(dev->mmregs + MARUCAM_S_FMT);
+ mutex_unlock(&q->vb_lock);
+
+ if (ret > 0) {
+ marucam_err("MARUCAM_S_FMT failed\n");
+ return -(ret);
+ }
+
+ f->fmt.pix.width = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ f->fmt.pix.height = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ f->fmt.pix.field = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ f->fmt.pix.pixelformat = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ f->fmt.pix.bytesperline = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ f->fmt.pix.sizeimage = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ f->fmt.pix.colorspace = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ f->fmt.pix.priv = ioread32(dev->mmregs + MARUCAM_G_DATA);
+
+ dev->pixelformat = f->fmt.pix.pixelformat;
+ dev->width = f->fmt.pix.width;
+ dev->height = f->fmt.pix.height;
+ dev->vb_vidq.field = f->fmt.pix.field;
+ dev->type = f->type;
+
+ return 0;
+}
+
+static int vidioc_reqbufs(struct file *file, void *priv,
+ struct v4l2_requestbuffers *p)
+{
+ struct marucam_device *dev = priv;
+
+ dev->type = p->type;
+
+ return (videobuf_reqbufs(&dev->vb_vidq, p));
+}
+
+static int vidioc_querybuf(struct file *file, void *priv, struct v4l2_buffer *p)
+{
+ struct marucam_device *dev = priv;
+
+ return (videobuf_querybuf(&dev->vb_vidq, p));
+}
+
+static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *p)
+{
+ struct marucam_device *dev = priv;
+
+ return (videobuf_qbuf(&dev->vb_vidq, p));
+}
+
+static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *p)
+{
+ struct marucam_device *dev = priv;
+
+ return (videobuf_dqbuf(&dev->vb_vidq, p, file->f_flags & O_NONBLOCK));
+}
+
+static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)
+{
+ int ret = 0;
+ struct marucam_device *dev = priv;
+
+ if (dev->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
+ return -EINVAL;
+ if (i != dev->type)
+ return -EINVAL;
+
+ iowrite32(1, dev->mmregs + MARUCAM_START_PREVIEW);
+ ret = (int)ioread32(dev->mmregs + MARUCAM_START_PREVIEW);
+ if (ret) {
+ marucam_err("device streamon failed!\n");
+ return -(ret);
+ }
+
+ ret = videobuf_streamon(&dev->vb_vidq);
+ if (ret < 0) {
+ marucam_err("videobuf_streamon failed!, ret = %d\n", ret);
+ }
+ return ret;
+}
+
+static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
+{
+ int ret = 0;
+ struct marucam_device *dev = priv;
+
+ if (dev->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
+ return -EINVAL;
+ if (i != dev->type)
+ return -EINVAL;
+
+ iowrite32(1, dev->mmregs + MARUCAM_STOP_PREVIEW);
+ ret = (int)ioread32(dev->mmregs + MARUCAM_STOP_PREVIEW);
+ if (ret > 0) {
+ marucam_err("device streamoff failed!\n");
+ return -(ret);
+ }
+
+ ret = videobuf_streamoff(&dev->vb_vidq);
+ if (ret < 0) {
+ marucam_err("videobuf_streamoff failed!\n");
+ }
+
+ return ret;
+}
+
+static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *i)
+{
+ return 0;
+}
+
+static int vidioc_enum_input(struct file *file, void *priv,
+ struct v4l2_input *inp)
+{
+ if (inp->index != 0)
+ return -EINVAL;
+
+ inp->type = V4L2_INPUT_TYPE_CAMERA;
+ sprintf(inp->name, "MARU Virtual Camera %u", inp->index);
+
+ return (0);
+}
+
+static int vidioc_g_input(struct file *file, void *priv, unsigned int *i)
+{
+ *i = 0;
+
+ return (0);
+}
+static int vidioc_s_input(struct file *file, void *priv, unsigned int i)
+{
+ return (0);
+}
+
+/* --- controls ---------------------------------------------- */
+static int vidioc_queryctrl(struct file *file, void *priv,
+ struct v4l2_queryctrl *qc)
+{
+ struct marucam_device *dev = priv;
+ uint32_t ret;
+
+ iowrite32(0, dev->mmregs + MARUCAM_DTC);
+ iowrite32(qc->id, dev->mmregs + MARUCAM_S_DATA);
+
+ iowrite32(0, dev->mmregs + MARUCAM_QCTRL);
+ ret = ioread32(dev->mmregs + MARUCAM_QCTRL);
+
+ if (ret > 0)
+ return -(ret);
+
+ qc->id = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ qc->minimum = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ qc->maximum = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ qc->step = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ qc->default_value = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ qc->flags = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ ioread32_rep(dev->mmregs + MARUCAM_G_DATA, qc->name, 8);
+
+ return 0;
+}
+
+static int vidioc_g_ctrl(struct file *file, void *priv,
+ struct v4l2_control *ctrl)
+{
+ struct marucam_device *dev = priv;
+ uint32_t ret;
+
+ iowrite32(0, dev->mmregs + MARUCAM_DTC);
+ iowrite32(ctrl->id, dev->mmregs + MARUCAM_S_DATA);
+
+ iowrite32(0, dev->mmregs + MARUCAM_G_CTRL);
+ ret = ioread32(dev->mmregs + MARUCAM_G_CTRL);
+
+ if (ret > 0)
+ return -(ret);
+
+ ctrl->value = ioread32(dev->mmregs + MARUCAM_G_DATA);
+
+ return 0;
+}
+
+static int vidioc_s_ctrl(struct file *file, void *priv,
+ struct v4l2_control *ctrl)
+{
+ struct marucam_device *dev = priv;
+ uint32_t ret;
+
+ iowrite32(0, dev->mmregs + MARUCAM_DTC);
+ iowrite32(ctrl->id, dev->mmregs + MARUCAM_S_DATA);
+ iowrite32(ctrl->value, dev->mmregs + MARUCAM_S_DATA);
+
+ iowrite32(0, dev->mmregs + MARUCAM_S_CTRL);
+ ret = ioread32(dev->mmregs + MARUCAM_S_CTRL);
+
+ if (ret > 0)
+ return -(ret);
+
+ return 0;
+}
+
+static int vidioc_s_parm(struct file *file, void *priv,
+ struct v4l2_streamparm *parm)
+{
+ struct marucam_device *dev = priv;
+ struct v4l2_captureparm *cp = &parm->parm.capture;
+ uint32_t ret;
+
+ if (parm->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
+ return -EINVAL;
+
+ iowrite32(0, dev->mmregs + MARUCAM_DTC);
+ iowrite32(cp->timeperframe.numerator, dev->mmregs + MARUCAM_S_DATA);
+ iowrite32(cp->timeperframe.denominator, dev->mmregs + MARUCAM_S_DATA);
+
+ iowrite32(0, dev->mmregs + MARUCAM_S_PARAM);
+ ret = ioread32(dev->mmregs + MARUCAM_S_PARAM);
+
+ if (ret > 0)
+ return -(ret);
+
+ return 0;
+}
+
+static int vidioc_g_parm(struct file *file, void *priv,
+ struct v4l2_streamparm *parm)
+{
+ struct marucam_device *dev = priv;
+ struct v4l2_captureparm *cp = &parm->parm.capture;
+ uint32_t ret;
+
+ if (parm->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
+ return -EINVAL;
+
+ iowrite32(0, dev->mmregs + MARUCAM_DTC);
+ iowrite32(0, dev->mmregs + MARUCAM_G_PARAM);
+ ret = ioread32(dev->mmregs + MARUCAM_G_PARAM);
+ if (ret > 0)
+ return -(ret);
+
+ cp->capability = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ cp->timeperframe.numerator = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ cp->timeperframe.denominator = ioread32(dev->mmregs + MARUCAM_G_DATA);
+
+ return 0;
+}
+
+static int vidioc_enum_framesizes(struct file *file, void *priv,
+ struct v4l2_frmsizeenum *fsize)
+{
+ struct marucam_device *dev = priv;
+ uint32_t ret;
+
+ iowrite32(0, dev->mmregs + MARUCAM_DTC);
+ iowrite32(fsize->index, dev->mmregs + MARUCAM_S_DATA);
+ iowrite32(fsize->pixel_format, dev->mmregs + MARUCAM_S_DATA);
+
+ iowrite32(0, dev->mmregs + MARUCAM_ENUM_FSIZES);
+ ret = ioread32(dev->mmregs + MARUCAM_ENUM_FSIZES);
+ if (ret > 0)
+ return -(ret);
+
+ fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE;
+ fsize->discrete.width = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ fsize->discrete.height = ioread32(dev->mmregs + MARUCAM_G_DATA);
+
+ return 0;
+}
+
+static int vidioc_enum_frameintervals(struct file *file, void *priv,
+ struct v4l2_frmivalenum *fival)
+{
+ struct marucam_device *dev = priv;
+ uint32_t ret;
+
+ iowrite32(0, dev->mmregs + MARUCAM_DTC);
+ iowrite32(fival->index, dev->mmregs + MARUCAM_S_DATA);
+ iowrite32(fival->pixel_format, dev->mmregs + MARUCAM_S_DATA);
+ iowrite32(fival->width, dev->mmregs + MARUCAM_S_DATA);
+ iowrite32(fival->height, dev->mmregs + MARUCAM_S_DATA);
+
+ iowrite32(0, dev->mmregs + MARUCAM_ENUM_FINTV);
+ ret = ioread32(dev->mmregs + MARUCAM_ENUM_FINTV);
+ if (ret > 0)
+ return -(ret);
+
+ fival->type = V4L2_FRMIVAL_TYPE_DISCRETE;
+ fival->discrete.numerator = ioread32(dev->mmregs + MARUCAM_G_DATA);
+ fival->discrete.denominator = ioread32(dev->mmregs + MARUCAM_G_DATA);
+
+ return 0;
+}
+
+/* ------------------------------------------------------------------
+ Videobuf operations
+ ------------------------------------------------------------------*/
+static int
+buffer_setup(struct videobuf_queue *vq, unsigned int *count, unsigned int *size)
+{
+ struct marucam_device *dev = vq->priv_data;
+
+ *size = get_image_size(dev);
+
+ if (*count > 2)
+ *count = 2;
+ if (0 == *count)
+ *count = 2;
+
+ marucam_dbg(1, "count=%d, size=%d\n", *count, *size);
+
+ return 0;
+}
+
+static int
+buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
+ enum v4l2_field field)
+{
+ int rc;
+ struct marucam_device *dev = vq->priv_data;
+
+ marucam_dbg(1, "field=%d\n", field);
+
+ vb->size = get_image_size(dev);
+
+ if (0 != vb->baddr && vb->bsize < vb->size)
+ return -EINVAL;
+
+ if (vb->state == VIDEOBUF_NEEDS_INIT) {
+ rc = videobuf_iolock(vq, vb, NULL);
+ if (rc < 0)
+ goto fail;
+ }
+
+ vb->width = dev->width;
+ vb->height = dev->height;
+ vb->field = field;
+ vb->state = VIDEOBUF_PREPARED;
+
+ return 0;
+
+fail:
+ vb->state = VIDEOBUF_NEEDS_INIT;
+ return rc;
+}
+
+static void
+buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
+{
+ struct marucam_device *dev = vq->priv_data;
+
+ marucam_dbg(1, "\n");
+
+ vb->state = VIDEOBUF_QUEUED;
+ list_add_tail(&vb->queue, &dev->active);
+}
+
+static void buffer_release(struct videobuf_queue *vq,
+ struct videobuf_buffer *vb)
+{
+ marucam_dbg(1, "buffer freed\n");
+ vb->state = VIDEOBUF_NEEDS_INIT;
+}
+
+static struct videobuf_queue_ops marucam_video_qops = {
+ .buf_setup = buffer_setup,
+ .buf_prepare = buffer_prepare,
+ .buf_queue = buffer_queue,
+ .buf_release = buffer_release,
+};
+
+/* ------------------------------------------------------------------
+ File operations for the device
+ ------------------------------------------------------------------*/
+
+static int marucam_open(struct file *file)
+{
+ struct marucam_device *dev = video_drvdata(file);
+ int ret;
+
+ file->private_data = dev;
+ dev->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ dev->pixelformat = V4L2_PIX_FMT_YUYV;
+ dev->width = DFL_WIDTH;
+ dev->height = DFL_HEIGHT;
+
+ ret = request_irq(dev->pdev->irq, marucam_irq_handler,
+ IRQF_SHARED, MARUCAM_MODULE_NAME, dev);
+ if (ret) {
+ marucam_err("request_irq failed!!! irq num : %d\n", dev->pdev->irq);
+ return ret;
+ }
+
+ videobuf_queue_marucam_init(&dev->vb_vidq, &marucam_video_qops,
+ &dev->pdev->dev, &dev->slock, dev->type, V4L2_FIELD_NONE,
+ sizeof(struct videobuf_buffer), dev);
+
+ iowrite32(0, dev->mmregs + MARUCAM_OPEN);
+ ret = (int)ioread32(dev->mmregs + MARUCAM_OPEN);
+
+ if (ret > 0) {
+ marucam_err("device open failed\n");
+ return -ret;
+ }
+
+ return 0;
+}
+
+static int marucam_close(struct file *file)
+{
+ struct marucam_device *dev = file->private_data;
+ uint32_t ret;
+
+ int minor = video_devdata(file)->minor;
+
+ videobuf_stop(&dev->vb_vidq);
+ videobuf_mmap_free(&dev->vb_vidq);
+
+ free_irq(dev->pdev->irq, dev);
+
+ iowrite32(0, dev->mmregs + MARUCAM_CLOSE);
+ ret = ioread32(dev->mmregs + MARUCAM_CLOSE);
+ if (ret > 0) {
+ marucam_err("device close failed\n");
+ return -(ret);
+ }
+
+ marucam_dbg(1, "close called (minor=%d)\n", minor);
+
+ return 0;
+}
+
+static unsigned int
+marucam_poll(struct file *file, struct poll_table_struct *wait)
+{
+ struct marucam_device *dev = file->private_data;
+ struct videobuf_queue *q = &dev->vb_vidq;
+ unsigned int ret = 0;
+ struct videobuf_buffer *buf = NULL;
+
+ if (q->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
+ return POLLERR;
+
+ mutex_lock(&q->vb_lock);
+ if (q->streaming) {
+ if (!list_empty(&q->stream))
+ buf = list_entry(q->stream.next, struct videobuf_buffer, stream);
+ }
+ if (!buf)
+ ret = POLLERR;
+
+ if (ret == 0) {
+ poll_wait(file, &buf->done, wait);
+ if (buf->state == VIDEOBUF_DONE || buf->state == VIDEOBUF_ERROR) {
+ ret = POLLIN | POLLRDNORM;
+ } else {
+ iowrite32(buf->i, dev->mmregs + MARUCAM_REQFRAME);
+ }
+ }
+ mutex_unlock(&q->vb_lock);
+ return ret;
+}
+
+static int marucam_mmap(struct file *file, struct vm_area_struct *vma)
+{
+ struct marucam_device *dev = file->private_data;
+ int ret;
+
+ marucam_dbg(1, "mmap called, vma=0x%08lx\n", (unsigned long)vma);
+
+ ret = videobuf_mmap_mapper(&dev->vb_vidq, vma);
+
+ marucam_dbg(1, "vma start=0x%08lx, size=%ld, ret=%d\n",
+ (unsigned long)vma->vm_start,
+ (unsigned long)vma->vm_end-(unsigned long)vma->vm_start,
+ ret);
+
+ return ret;
+}
+
+static const struct v4l2_ioctl_ops marucam_ioctl_ops = {
+ .vidioc_querycap = vidioc_querycap,
+ .vidioc_enum_fmt_vid_cap = vidioc_enum_fmt_vid_cap,
+ .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap,
+ .vidioc_try_fmt_vid_cap = vidioc_try_fmt_vid_cap,
+ .vidioc_s_fmt_vid_cap = vidioc_s_fmt_vid_cap,
+ .vidioc_reqbufs = vidioc_reqbufs,
+ .vidioc_querybuf = vidioc_querybuf,
+ .vidioc_qbuf = vidioc_qbuf,
+ .vidioc_dqbuf = vidioc_dqbuf,
+ .vidioc_s_std = vidioc_s_std,
+ .vidioc_enum_input = vidioc_enum_input,
+ .vidioc_g_input = vidioc_g_input,
+ .vidioc_s_input = vidioc_s_input,
+ .vidioc_queryctrl = vidioc_queryctrl,
+ .vidioc_g_ctrl = vidioc_g_ctrl,
+ .vidioc_s_ctrl = vidioc_s_ctrl,
+ .vidioc_streamon = vidioc_streamon,
+ .vidioc_streamoff = vidioc_streamoff,
+ .vidioc_g_parm = vidioc_g_parm,
+ .vidioc_s_parm = vidioc_s_parm,
+ .vidioc_enum_framesizes = vidioc_enum_framesizes,
+ .vidioc_enum_frameintervals = vidioc_enum_frameintervals,
+};
+
+static const struct v4l2_file_operations marucam_fops = {
+ .owner = THIS_MODULE,
+ .open = marucam_open,
+ .release = marucam_close,
+ .poll = marucam_poll,
+ .mmap = marucam_mmap,
+ .ioctl = video_ioctl2,
+};
+
+static struct video_device marucam_video_dev = {
+ .name = MARUCAM_MODULE_NAME,
+ .fops = &marucam_fops,
+ .ioctl_ops = &marucam_ioctl_ops,
+ .minor = -1,
+ .release = video_device_release,
+};
+
+/* -----------------------------------------------------------------
+ Initialization and module stuff
+ ------------------------------------------------------------------*/
+
+static struct pci_device_id marucam_pci_id_tbl[] = {
+ {
+ .vendor = PCI_VENDOR_ID_TIZEN,
+ .device = PCI_DEVICE_ID_VIRTUAL_CAMERA,
+ .subvendor = PCI_ANY_ID,
+ .subdevice = PCI_ANY_ID,
+ }
+};
+
+MODULE_DEVICE_TABLE(pci, marucam_pci_id_tbl);
+
+static int marucam_pci_initdev(struct pci_dev *pdev, const struct pci_device_id *id)
+{
+ int ret;
+ struct marucam_device *dev;
+
+ dev = kzalloc(sizeof(struct marucam_device), GFP_KERNEL);
+ if (!dev)
+ return -ENOMEM;
+
+ ret = v4l2_device_register(&pdev->dev, &dev->v4l2_dev);
+ if (ret)
+ goto out_free;
+
+ INIT_LIST_HEAD(&dev->active);
+ spin_lock_init(&dev->slock);
+
+ dev->pdev = pdev;
+
+ ret = -ENOMEM;
+ dev->vfd = video_device_alloc();
+ if (!dev->vfd) {
+ marucam_err("video_device_alloc() failed!!\n");
+ goto out_unreg;
+ }
+
+ memcpy(dev->vfd, &marucam_video_dev, sizeof(marucam_video_dev));
+
+ dev->vfd->parent = &dev->pdev->dev;
+ dev->vfd->v4l2_dev = &dev->v4l2_dev;
+
+ ret = pci_enable_device(dev->pdev);
+ if (ret)
+ goto rel_vdev;
+ pci_set_master(dev->pdev);
+
+ ret = -EIO;
+ dev->mem_base = pci_resource_start(dev->pdev, 0);
+ dev->mem_size = pci_resource_len(dev->pdev, 0);
+
+ if (!dev->mem_base) {
+ marucam_err("pci_resource_start failed!!\n");
+ goto out_disable;
+ }
+
+ if (!request_mem_region(dev->mem_base, dev->mem_size, MARUCAM_MODULE_NAME)) {
+ marucam_err("request_mem_region(mem) failed!!\n");
+ goto out_disable;
+ }
+
+ dev->io_base = pci_resource_start(dev->pdev, 1);
+ dev->io_size = pci_resource_len(dev->pdev, 1);
+
+ if (!dev->io_base) {
+ marucam_err("pci_resource_start failed!!\n");
+ goto out_rel_mem_region;
+ }
+
+ if (!request_mem_region(dev->io_base, dev->io_size, MARUCAM_MODULE_NAME)) {
+ marucam_err("request_mem_region(io) failed!!\n");
+ goto out_disable;
+ }
+
+ dev->mmregs = ioremap(dev->io_base, dev->io_size);
+ if (!dev->mmregs) {
+ marucam_err("ioremap failed!!\n");
+ goto out_rel_io_region;
+ }
+
+ ret = video_register_device(dev->vfd, VFL_TYPE_GRABBER, 0);
+ if (ret < 0) {
+ marucam_err("video_register_device failed!!\n");
+ goto out_iounmap;
+ }
+ video_set_drvdata(dev->vfd, dev);
+ pci_set_drvdata(pdev, dev);
+
+ snprintf(dev->vfd->name, sizeof(dev->vfd->name), "%s (%i)",
+ marucam_video_dev.name, dev->vfd->num);
+
+ v4l2_info(&dev->v4l2_dev, "V4L2 device registerd as /dev/video%d\n",
+ dev->vfd->num);
+
+ return 0;
+
+out_iounmap:
+ iounmap(dev->mmregs);
+out_rel_io_region:
+ release_mem_region(dev->io_base, dev->io_size);
+out_rel_mem_region:
+ release_mem_region(dev->mem_base, dev->mem_size);
+out_disable:
+ pci_disable_device(dev->pdev);
+rel_vdev:
+ video_device_release(dev->vfd);
+out_unreg:
+ v4l2_device_unregister(&dev->v4l2_dev);
+out_free:
+ kfree(dev);
+
+ return ret;
+}
+
+static void marucam_pci_removedev(struct pci_dev *pdev)
+{
+ struct marucam_device *dev = pci_get_drvdata(pdev);
+
+ if (dev == NULL) {
+ marucam_warn("pci_remove on unknown pdev %p.\n", pdev);
+ return ;
+ }
+
+ video_unregister_device(dev->vfd);
+
+ if (dev->mmregs) {
+ iounmap(dev->mmregs);
+ dev->mmregs = 0;
+ }
+
+ if (dev->io_base) {
+ release_mem_region(dev->io_base, dev->io_size);
+ dev->io_base = 0;
+ }
+ if (dev->mem_base) {
+ release_mem_region(dev->mem_base, dev->mem_size);
+ dev->mem_base = 0;
+ }
+ pci_disable_device(dev->pdev);
+ v4l2_device_unregister(&dev->v4l2_dev);
+ kfree(dev);
+}
+
+static struct pci_driver marucam_pci_driver = {
+ .name = MARUCAM_MODULE_NAME,
+ .id_table = marucam_pci_id_tbl,
+ .probe = marucam_pci_initdev,
+ .remove = marucam_pci_removedev,
+};
+
+static int __init marucam_init(void)
+{
+ int ret = 0;
+
+ ret = pci_register_driver(&marucam_pci_driver);
+ if (ret < 0) {
+ marucam_info("Error %d while loading marucam driver\n", ret);
+ return ret;
+ }
+
+ marucam_info("MARU Virtual Camera Driver ver %u.%u.%u successfully loaded.\n",
+ (MARUCAM_VERSION >> 16) & 0xFF, (MARUCAM_VERSION >> 8) & 0xFF,
+ MARUCAM_VERSION & 0xFF);
+
+ return ret;
+}
+
+static void __exit marucam_exit(void)
+{
+ pci_unregister_driver(&marucam_pci_driver);
+}
+
+module_init(marucam_init);
+module_exit(marucam_exit);
--- /dev/null
+/*
+ * Virtual Codec PCI device driver
+ *
+ * Copyright (c) 2011-2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Kitae KIM <kt920.kim@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ * DongKyun Yun <dk77.yun@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/device.h>
+#include <linux/pci.h>
+#include <linux/fs.h>
+#include <linux/err.h>
+#include <linux/types.h>
+#include <linux/ioport.h>
+#include <linux/interrupt.h>
+#include <linux/semaphore.h>
+#include <linux/workqueue.h>
+#include <linux/wait.h>
+#include <asm/uaccess.h>
+#include <asm/io.h>
+
+#define DRIVER_NAME "codec"
+#define CODEC_MAJOR 240
+
+MODULE_DESCRIPTION("Virtual Codec Device Driver");
+MODULE_AUTHOR("Kitae KIM <kt920.kim@samsung.com");
+MODULE_LICENSE("GPL2");
+
+#ifdef CODEC_DEBUG
+#define MARU_CODEC_LOG(fmt, ...) \
+ printk(KERN_INFO "[%s][%s][%d]" fmt, DRIVER_NAME, __func__, __LINE__, ##__VA_ARGS__)
+#else
+#define MARU_CODEC_LOG(fmt, ...) ((void)0)
+#endif
+
+#define USABLE_MMAP_MAX_SIZE 4
+#define CODEC_MAX_CONTEXT 10
+
+struct _param {
+ uint32_t apiIndex;
+ uint32_t ctxIndex;
+ uint32_t mmapOffset;
+ uint32_t inArgsNum;
+ uint32_t inArgs[20];
+ uint32_t ret;
+};
+
+enum svodec_param_offset {
+ CODEC_API_INDEX = 0,
+ CODEC_IN_PARAM,
+ CODEC_RETURN_VALUE,
+ CODEC_CONTEXT_INDEX,
+ CODEC_MMAP_OFFSET,
+ CODEC_FILE_INDEX,
+ CODEC_CLOSED,
+};
+
+enum svcodec_param_apiindex {
+ EMUL_AV_REGISTER_ALL = 1,
+ EMUL_AVCODEC_ALLOC_CONTEXT,
+ EMUL_AVCODEC_ALLOC_FRAME,
+ EMUL_AVCODEC_OPEN,
+ EMUL_AVCODEC_CLOSE,
+ EMUL_AV_FREE_CONTEXT,
+ EMUL_AV_FREE_PICTURE,
+ EMUL_AV_FREE_PALCTRL,
+ EMUL_AV_FREE_EXTRADATA,
+ EMUL_AVCODEC_FLUSH_BUFFERS,
+ EMUL_AVCODEC_DECODE_VIDEO,
+ EMUL_AVCODEC_ENCODE_VIDEO,
+ EMUL_AVCODEC_DECODE_AUDIO,
+ EMUL_AVCODEC_ENCODE_AUDIO,
+ EMUL_AV_PICTURE_COPY,
+ EMUL_AV_PARSER_INIT,
+ EMUL_AV_PARSER_PARSE,
+ EMUL_AV_PARSER_CLOSE,
+ EMUL_GET_MMAP_INDEX,
+ EMUL_GET_CODEC_VER = 50,
+};
+
+typedef struct _svcodec_dev {
+ struct pci_dev *dev;
+
+ volatile unsigned int *ioaddr;
+ volatile unsigned int *memaddr;
+
+ resource_size_t io_start;
+ resource_size_t io_size;
+ resource_size_t mem_start;
+ resource_size_t mem_size;
+
+ uint8_t useMmap[USABLE_MMAP_MAX_SIZE + 1];
+} svcodec_dev;
+
+static svcodec_dev *svcodec;
+DEFINE_MUTEX(codec_mutex);
+
+static struct pci_device_id svcodec_pci_table[] __devinitdata = {
+ {
+ .vendor = PCI_VENDOR_ID_TIZEN,
+ .device = PCI_DEVICE_ID_VIRTUAL_CODEC,
+ .subvendor = PCI_ANY_ID,
+ .subdevice = PCI_ANY_ID,
+ },
+};
+MODULE_DEVICE_TABLE(pci, svcodec_pci_table);
+
+/* Another way to copy data between guest and host. */
+/* Copy data between guest and host using mmap operation. */
+static ssize_t svcodec_write (struct file *file, const char __user *buf,
+ size_t count, loff_t *fops)
+{
+ struct _param paramInfo;
+
+ mutex_lock(&codec_mutex);
+
+ if (!svcodec) {
+ printk(KERN_ERR "[%s]:Fail to get codec device info\n", __func__);
+ return -EINVAL;
+ }
+
+ if (copy_from_user(¶mInfo, buf, sizeof(struct _param))) {
+ printk(KERN_ERR "[%s]:Fail to get codec parameter info from user\n", __func__);
+ }
+
+ if (paramInfo.apiIndex == EMUL_GET_MMAP_INDEX) {
+ int i;
+ int *mmapIndex;
+
+ mmapIndex = (int*)paramInfo.ret;
+
+ printk(KERN_DEBUG "[%s] before available useMmap count:%d\n",
+ __func__, (USABLE_MMAP_MAX_SIZE - svcodec->useMmap[USABLE_MMAP_MAX_SIZE]));
+ for (i = 0; i < USABLE_MMAP_MAX_SIZE; i++) {
+ printk(KERN_DEBUG "useMmap[%d]=%d\n", i, svcodec->useMmap[i]);
+ if (svcodec->useMmap[i] == 1) {
+ svcodec->useMmap[i] = 0;
+ printk(KERN_DEBUG "useMmap[%d]=%d\n", i, svcodec->useMmap[i]);
+ (svcodec->useMmap[USABLE_MMAP_MAX_SIZE])++;
+ file->private_data = &svcodec->useMmap[i];
+ printk(KERN_DEBUG "[%s] after available useMmap count:%d\n",
+ __func__, (USABLE_MMAP_MAX_SIZE - svcodec->useMmap[USABLE_MMAP_MAX_SIZE]));
+ printk(KERN_DEBUG "[%s] return %d as the index of mmap\n", __func__, i);
+ break;
+ }
+ }
+
+ if (i == USABLE_MMAP_MAX_SIZE) {
+ printk(KERN_INFO "[%s] Usable mmap is none\n", __func__);
+ i = -1;
+ }
+
+ if (copy_to_user((void*)mmapIndex, &i, sizeof(int))) {
+ printk(KERN_ERR "[%s]:Fail to copy_to_user\n", __func__);
+ }
+ mutex_unlock(&codec_mutex);
+
+ return 0;
+ }
+
+ if (paramInfo.apiIndex == EMUL_AVCODEC_ALLOC_CONTEXT) {
+ writel((uint32_t)file, svcodec->ioaddr + CODEC_FILE_INDEX);
+ }
+
+ writel((uint32_t)paramInfo.ctxIndex, svcodec->ioaddr + CODEC_CONTEXT_INDEX);
+ writel((uint32_t)paramInfo.mmapOffset, svcodec->ioaddr + CODEC_MMAP_OFFSET);
+ writel((uint32_t)paramInfo.apiIndex, svcodec->ioaddr + CODEC_API_INDEX);
+
+ mutex_unlock(&codec_mutex);
+
+ return 0;
+}
+
+static ssize_t svcodec_read (struct file *file, char __user *buf,
+ size_t count, loff_t *fops)
+{
+ if (!svcodec) {
+ printk(KERN_ERR "[%s] : Fail to get codec device info\n", __func__);
+ }
+ return 0;
+}
+
+static int svcodec_mmap (struct file *file, struct vm_area_struct *vm)
+{
+ unsigned long off;
+ unsigned long phys_addr;
+ unsigned long size;
+ int ret = -1;
+
+ off = vm->vm_pgoff << PAGE_SHIFT;
+ phys_addr = (PAGE_ALIGN(svcodec->mem_start) + off) >> PAGE_SHIFT;
+ size = vm->vm_end - vm->vm_start;
+ printk(KERN_DEBUG "svcodec_mmap\n");
+
+ if (size > svcodec->mem_size) {
+ printk(KERN_ERR "Over mapping size\n");
+ return -EINVAL;
+ }
+
+ ret = remap_pfn_range(vm, vm->vm_start, phys_addr, size, vm->vm_page_prot);
+ if (ret < 0) {
+ printk(KERN_ERR "Failed to remap page range\n");
+ return -EAGAIN;
+ }
+
+ vm->vm_flags |= VM_IO;
+ vm->vm_flags |= VM_RESERVED;
+
+ return 0;
+}
+
+static int svcodec_open (struct inode *inode, struct file *file)
+{
+ int i;
+
+ mutex_lock(&codec_mutex);
+
+ printk(KERN_DEBUG "[%s]\n", __func__);
+ printk(KERN_DEBUG "[%s] struct file :%p\n", __func__, file);
+
+ if (svcodec->useMmap[USABLE_MMAP_MAX_SIZE] == 0) {
+ for (i = 0; i < USABLE_MMAP_MAX_SIZE; i++) {
+ svcodec->useMmap[i] = 1;
+ printk(KERN_DEBUG "Reset useMmap[%d]=%d\n", i, svcodec->useMmap[i]);
+ }
+ }
+
+ try_module_get(THIS_MODULE);
+ mutex_unlock(&codec_mutex);
+
+ return 0;
+}
+
+static int svcodec_release (struct inode *inode, struct file *file)
+{
+ int max_size = USABLE_MMAP_MAX_SIZE;
+
+ mutex_lock(&codec_mutex);
+
+ printk(KERN_DEBUG "[%s] close %s\n", __func__, DRIVER_NAME);
+
+ (svcodec->useMmap[max_size])--;
+ *(uint8_t*)file->private_data = 1;
+ printk(KERN_DEBUG "[%s] available useMmap count:%d\n",
+ __func__, (max_size - svcodec->useMmap[max_size]));
+
+ /* notify qemu of closing codec device. */
+ printk(KERN_DEBUG "[%s] struct file : %p\n", __func__, file);
+ writel((uint32_t)file, svcodec->ioaddr + CODEC_CLOSED);
+
+#ifdef CODEC_DEBUG
+ int i;
+ for (i = 0; i < max_size; i++) {
+ printk(KERN_DEBUG "useMmap[%d]=%d\n", i, svcodec->useMmap[i]);
+ }
+#endif
+ module_put(THIS_MODULE);
+ mutex_unlock(&codec_mutex);
+
+ return 0;
+}
+
+struct file_operations svcodec_fops = {
+ .owner = THIS_MODULE,
+ .read = svcodec_read,
+ .write = svcodec_write,
+ .open = svcodec_open,
+ .mmap = svcodec_mmap,
+ .release = svcodec_release,
+};
+
+static void __devinit svcodec_remove (struct pci_dev *pci_dev)
+{
+ if (svcodec) {
+ if (svcodec->ioaddr) {
+ iounmap(svcodec->ioaddr);
+ svcodec->ioaddr = 0;
+ }
+
+#if 0
+ if (svcodec->memaddr) {
+ iounmap(svcodec->memaddr);
+ svcodec->memaddr = 0;
+ }
+#endif
+
+ if (svcodec->io_start) {
+ release_mem_region(svcodec->io_start, svcodec->io_size);
+ svcodec->io_start = 0;
+ }
+
+ if (svcodec->mem_start) {
+ release_mem_region(svcodec->mem_start, svcodec->mem_size);
+ svcodec->mem_start = 0;
+ }
+
+ kfree(svcodec);
+ }
+ pci_disable_device(pci_dev);
+}
+
+static int __devinit svcodec_probe (struct pci_dev *pci_dev,
+ const struct pci_device_id *pci_id)
+{
+ int ret;
+
+ svcodec = (svcodec_dev*)kmalloc(sizeof(svcodec_dev), GFP_KERNEL);
+ memset(svcodec, 0x00, sizeof(svcodec_dev));
+
+ svcodec->dev = pci_dev;
+
+ if (pci_enable_device(pci_dev)) {
+ printk(KERN_ERR "[%s] : pci_enable_device failed\n", __func__);
+ goto err_rel;
+ }
+
+ pci_set_master(pci_dev);
+
+ ret = -EIO;
+
+ svcodec->mem_start = pci_resource_start(pci_dev, 0);
+ svcodec->mem_size = pci_resource_len(pci_dev, 0);
+
+ if (!svcodec->mem_start) {
+ printk(KERN_ERR "[%s] : pci_resource_start failed\n", __func__);
+ goto err_out;
+ }
+
+ if (!request_mem_region(svcodec->mem_start, svcodec->mem_size, DRIVER_NAME)) {
+ printk(KERN_ERR "[%s] : request_mem_region failed\n", __func__);
+ goto err_out;
+ }
+
+ svcodec->io_start = pci_resource_start(pci_dev, 1);
+ svcodec->io_size = pci_resource_len(pci_dev, 1);
+
+ if (!svcodec->io_start) {
+ printk(KERN_ERR "[%s] : pci_resource_start failed\n", __func__);
+ goto err_mem_region;
+ }
+
+ if (!request_mem_region(svcodec->io_start, svcodec->io_size, DRIVER_NAME)) {
+ printk(KERN_ERR "[%s] : request_io_region failed\n", __func__);
+ goto err_mem_region;
+ }
+
+#if 0
+ svcodec->memaddr = ioremap(svcodec->mem_start, svcodec->mem_size);
+ if (!svcodec->memaddr) {
+ printk(KERN_ERR "[%s] : ioremap failed\n", __func__);
+ goto err_io_region;
+ }
+#endif
+
+ svcodec->ioaddr = ioremap_nocache(svcodec->io_start, svcodec->io_size);
+ if (!svcodec->ioaddr) {
+ printk(KERN_ERR "[%s] : ioremap failed\n", __func__);
+ goto err_io_region;
+ }
+ if (register_chrdev(CODEC_MAJOR, DRIVER_NAME, &svcodec_fops)) {
+ printk(KERN_ERR "[%s] : register_chrdev failed\n", __func__);
+ goto err_io_unmap;
+ }
+
+ return 0;
+
+err_io_unmap:
+ iounmap(svcodec->ioaddr);
+#if 0
+err_mem_unmap:
+ iounmap(svcodec->memaddr);
+#endif
+err_io_region:
+ release_mem_region(svcodec->io_start, svcodec->io_size);
+err_mem_region:
+ release_mem_region(svcodec->mem_start, svcodec->mem_size);
+err_out:
+ pci_disable_device(pci_dev);
+err_rel:
+ return ret;
+}
+
+static struct pci_driver driver = {
+ .name = DRIVER_NAME,
+ .id_table = svcodec_pci_table,
+ .probe = svcodec_probe,
+ .remove = svcodec_remove,
+};
+
+static int __init svcodec_init (void)
+{
+ printk(KERN_INFO "marucodec device is initialized.\n");
+ return pci_register_driver(&driver);
+}
+
+static void __exit svcodec_exit (void)
+{
+ pci_unregister_driver(&driver);
+}
+module_init(svcodec_init);
+module_exit(svcodec_exit);
--- /dev/null
+/*
+ * Maru framebuffer device driver
+ * Based on drivers/video/uvesafb.c:
+ *
+ * Copyright (C) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjun Son <hj79.son@samsung.com>
+ * GiWoong Kim <giwoong.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/skbuff.h>
+#include <linux/timer.h>
+#include <linux/completion.h>
+#include <linux/connector.h>
+#include <linux/random.h>
+#include <linux/platform_device.h>
+#include <linux/limits.h>
+#include <linux/fb.h>
+#include <linux/io.h>
+#include <linux/mutex.h>
+#include <linux/slab.h>
+#include <video/edid.h>
+#ifdef CONFIG_X86
+#include <video/vga.h>
+#endif
+#ifdef CONFIG_MTRR
+#include <asm/mtrr.h>
+#endif
+#include "../video/edid.h"
+#include "maru_fb.h"
+
+static struct cb_id uvesafb_cn_id = {
+ .idx = CN_IDX_V86D,
+ .val = CN_VAL_V86D_UVESAFB
+};
+static char v86d_path[PATH_MAX] = "/sbin/v86d";
+static char v86d_started; /* has v86d been started by uvesafb? */
+
+static struct fb_fix_screeninfo uvesafb_fix __devinitdata = {
+ .id = "VESA VGA",
+ .type = FB_TYPE_PACKED_PIXELS,
+ .accel = FB_ACCEL_NONE,
+ .visual = FB_VISUAL_TRUECOLOR,
+};
+
+static int mtrr __devinitdata = 3; /* enable mtrr by default */
+static bool blank = 1; /* enable blanking by default */
+static int ypan = 1; /* 0: scroll, 1: ypan, 2: ywrap */
+static bool pmi_setpal __devinitdata = true; /* use PMI for palette changes */
+static bool nocrtc __devinitdata; /* ignore CRTC settings */
+static bool noedid __devinitdata; /* don't try DDC transfers */
+static int vram_remap __devinitdata; /* set amt. of memory to be used */
+static int vram_total __devinitdata; /* set total amount of memory */
+static u16 maxclk __devinitdata; /* maximum pixel clock */
+static u16 maxvf __devinitdata; /* maximum vertical frequency */
+static u16 maxhf __devinitdata; /* maximum horizontal frequency */
+static u16 vbemode __devinitdata; /* force use of a specific VBE mode */
+static char *mode_option __devinitdata;
+static u8 dac_width = 6;
+
+static struct uvesafb_ktask *uvfb_tasks[UVESAFB_TASKS_MAX];
+static DEFINE_MUTEX(uvfb_lock);
+
+/*
+ * A handler for replies from userspace.
+ *
+ * Make sure each message passes consistency checks and if it does,
+ * find the kernel part of the task struct, copy the registers and
+ * the buffer contents and then complete the task.
+ */
+static void uvesafb_cn_callback(struct cn_msg *msg, struct netlink_skb_parms *nsp)
+{
+ struct uvesafb_task *utask;
+ struct uvesafb_ktask *task;
+
+ if (!capable(CAP_SYS_ADMIN))
+ return;
+
+ if (msg->seq >= UVESAFB_TASKS_MAX)
+ return;
+
+ mutex_lock(&uvfb_lock);
+ task = uvfb_tasks[msg->seq];
+
+ if (!task || msg->ack != task->ack) {
+ mutex_unlock(&uvfb_lock);
+ return;
+ }
+
+ utask = (struct uvesafb_task *)msg->data;
+
+ /* Sanity checks for the buffer length. */
+ if (task->t.buf_len < utask->buf_len ||
+ utask->buf_len > msg->len - sizeof(*utask)) {
+ mutex_unlock(&uvfb_lock);
+ return;
+ }
+
+ uvfb_tasks[msg->seq] = NULL;
+ mutex_unlock(&uvfb_lock);
+
+ memcpy(&task->t, utask, sizeof(*utask));
+
+ if (task->t.buf_len && task->buf)
+ memcpy(task->buf, utask + 1, task->t.buf_len);
+
+ complete(task->done);
+ return;
+}
+
+static int uvesafb_helper_start(void)
+{
+ char *envp[] = {
+ "HOME=/",
+ "PATH=/sbin:/bin",
+ NULL,
+ };
+
+ char *argv[] = {
+ v86d_path,
+ NULL,
+ };
+
+ return call_usermodehelper(v86d_path, argv, envp, UMH_WAIT_PROC);
+}
+
+/*
+ * Execute a uvesafb task.
+ *
+ * Returns 0 if the task is executed successfully.
+ *
+ * A message sent to the userspace consists of the uvesafb_task
+ * struct and (optionally) a buffer. The uvesafb_task struct is
+ * a simplified version of uvesafb_ktask (its kernel counterpart)
+ * containing only the register values, flags and the length of
+ * the buffer.
+ *
+ * Each message is assigned a sequence number (increased linearly)
+ * and a random ack number. The sequence number is used as a key
+ * for the uvfb_tasks array which holds pointers to uvesafb_ktask
+ * structs for all requests.
+ */
+static int uvesafb_exec(struct uvesafb_ktask *task)
+{
+ static int seq;
+ struct cn_msg *m;
+ int err;
+ int len = sizeof(task->t) + task->t.buf_len;
+
+ /*
+ * Check whether the message isn't longer than the maximum
+ * allowed by connector.
+ */
+ if (sizeof(*m) + len > CONNECTOR_MAX_MSG_SIZE) {
+ printk(KERN_WARNING "uvesafb: message too long (%d), "
+ "can't execute task\n", (int)(sizeof(*m) + len));
+ return -E2BIG;
+ }
+
+ m = kzalloc(sizeof(*m) + len, GFP_KERNEL);
+ if (!m)
+ return -ENOMEM;
+
+ init_completion(task->done);
+
+ memcpy(&m->id, &uvesafb_cn_id, sizeof(m->id));
+ m->seq = seq;
+ m->len = len;
+ m->ack = random32();
+
+ /* uvesafb_task structure */
+ memcpy(m + 1, &task->t, sizeof(task->t));
+
+ /* Buffer */
+ memcpy((u8 *)(m + 1) + sizeof(task->t), task->buf, task->t.buf_len);
+
+ /*
+ * Save the message ack number so that we can find the kernel
+ * part of this task when a reply is received from userspace.
+ */
+ task->ack = m->ack;
+
+ mutex_lock(&uvfb_lock);
+
+ /* If all slots are taken -- bail out. */
+ if (uvfb_tasks[seq]) {
+ mutex_unlock(&uvfb_lock);
+ err = -EBUSY;
+ goto out;
+ }
+
+ /* Save a pointer to the kernel part of the task struct. */
+ uvfb_tasks[seq] = task;
+ mutex_unlock(&uvfb_lock);
+
+ err = cn_netlink_send(m, 0, GFP_KERNEL);
+ if (err == -ESRCH) {
+ /*
+ * Try to start the userspace helper if sending
+ * the request failed the first time.
+ */
+ err = uvesafb_helper_start();
+ if (err) {
+ printk(KERN_ERR "uvesafb: failed to execute %s\n",
+ v86d_path);
+ printk(KERN_ERR "uvesafb: make sure that the v86d "
+ "helper is installed and executable\n");
+ } else {
+ v86d_started = 1;
+ err = cn_netlink_send(m, 0, gfp_any());
+ if (err == -ENOBUFS)
+ err = 0;
+ }
+ } else if (err == -ENOBUFS)
+ err = 0;
+
+ if (!err && !(task->t.flags & TF_EXIT))
+ err = !wait_for_completion_timeout(task->done,
+ msecs_to_jiffies(UVESAFB_TIMEOUT));
+
+ mutex_lock(&uvfb_lock);
+ uvfb_tasks[seq] = NULL;
+ mutex_unlock(&uvfb_lock);
+
+ seq++;
+ if (seq >= UVESAFB_TASKS_MAX)
+ seq = 0;
+out:
+ kfree(m);
+ return err;
+}
+
+/*
+ * Free a uvesafb_ktask struct.
+ */
+static void uvesafb_free(struct uvesafb_ktask *task)
+{
+ if (task) {
+ if (task->done)
+ kfree(task->done);
+ kfree(task);
+ }
+}
+
+/*
+ * Prepare a uvesafb_ktask struct to be used again.
+ */
+static void uvesafb_reset(struct uvesafb_ktask *task)
+{
+ struct completion *cpl = task->done;
+
+ memset(task, 0, sizeof(*task));
+ task->done = cpl;
+}
+
+/*
+ * Allocate and prepare a uvesafb_ktask struct.
+ */
+static struct uvesafb_ktask *uvesafb_prep(void)
+{
+ struct uvesafb_ktask *task;
+
+ task = kzalloc(sizeof(*task), GFP_KERNEL);
+ if (task) {
+ task->done = kzalloc(sizeof(*task->done), GFP_KERNEL);
+ if (!task->done) {
+ kfree(task);
+ task = NULL;
+ }
+ }
+ return task;
+}
+
+static int my_atoi(const char *name)
+{
+ int val = 0;
+
+ for (;; name++) {
+ switch (*name) {
+ case '0' ... '9':
+ val = 10*val+(*name-'0');
+ break;
+ default:
+ return val;
+ }
+ }
+}
+
+extern char *saved_command_line;
+#define DPI_DEF_VALUE 3160
+#define DPI_MIN_VALUE 1000
+#define DPI_MAX_VALUE 4800
+
+static void uvesafb_setup_var(struct fb_var_screeninfo *var,
+ struct fb_info *info, struct vbe_mode_ib *mode)
+{
+ struct uvesafb_par *par = info->par;
+ char *ps;
+ char dpi_info[16];
+ int dpi = DPI_DEF_VALUE; /* default value */
+
+ var->vmode = FB_VMODE_NONINTERLACED;
+ var->sync = FB_SYNC_VERT_HIGH_ACT;
+
+ var->xres = mode->x_res;
+ var->yres = mode->y_res;
+
+ /* panel physical width/height(mm) */
+ ps = strstr(saved_command_line, "dpi=");
+ if (ps != NULL) {
+ ps += 4;
+ strncpy(dpi_info, ps, 4);
+ dpi = my_atoi(dpi_info);
+ if (dpi < DPI_MIN_VALUE || dpi > DPI_MAX_VALUE)
+ dpi = DPI_DEF_VALUE;
+ }
+ /* round up */
+ var->height = ((var->yres * 2540 / dpi) + 5) / 10;
+ var->width = ((var->xres * 2540 / dpi)+ 5) / 10;
+// printk(KERN_INFO "dpi value = %d\n", dpi);
+// printk(KERN_INFO "var->yres = %d, var->xres = %d\n", var->yres, var->xres);
+// printk(KERN_INFO "var->height = %d, var->width = %d\n", var->height, var->width);
+
+ var->xres_virtual = mode->x_res;
+ var->yres_virtual = (par->ypan) ?
+ info->fix.smem_len / mode->bytes_per_scan_line :
+ mode->y_res;
+ var->xoffset = 0;
+ var->yoffset = 0;
+ var->bits_per_pixel = mode->bits_per_pixel;
+
+ if (var->bits_per_pixel == 15)
+ var->bits_per_pixel = 16;
+
+ if (var->bits_per_pixel > 8) {
+ var->red.offset = mode->red_off;
+ var->red.length = mode->red_len;
+ var->green.offset = mode->green_off;
+ var->green.length = mode->green_len;
+ var->blue.offset = mode->blue_off;
+ var->blue.length = mode->blue_len;
+ var->transp.offset = mode->rsvd_off;
+ var->transp.length = mode->rsvd_len;
+ } else {
+ var->red.offset = 0;
+ var->green.offset = 0;
+ var->blue.offset = 0;
+ var->transp.offset = 0;
+
+ var->red.length = 8;
+ var->green.length = 8;
+ var->blue.length = 8;
+ var->transp.length = 0;
+ }
+}
+
+static int uvesafb_vbe_find_mode(struct uvesafb_par *par,
+ int xres, int yres, int depth, unsigned char flags)
+{
+ int i, match = -1, h = 0, d = 0x7fffffff;
+
+ for (i = 0; i < par->vbe_modes_cnt; i++) {
+ h = abs(par->vbe_modes[i].x_res - xres) +
+ abs(par->vbe_modes[i].y_res - yres) +
+ abs(depth - par->vbe_modes[i].depth);
+
+ /*
+ * We have an exact match in terms of resolution
+ * and depth.
+ */
+ if (h == 0)
+ return i;
+
+ if (h < d || (h == d && par->vbe_modes[i].depth > depth)) {
+ d = h;
+ match = i;
+ }
+ }
+ i = 1;
+
+ if (flags & UVESAFB_EXACT_DEPTH &&
+ par->vbe_modes[match].depth != depth)
+ i = 0;
+
+ if (flags & UVESAFB_EXACT_RES && d > 24)
+ i = 0;
+
+ if (i != 0)
+ return match;
+ else
+ return -1;
+}
+
+static u8 *uvesafb_vbe_state_save(struct uvesafb_par *par)
+{
+ struct uvesafb_ktask *task;
+ u8 *state;
+ int err;
+
+ if (!par->vbe_state_size)
+ return NULL;
+
+ state = kmalloc(par->vbe_state_size, GFP_KERNEL);
+ if (!state)
+ return ERR_PTR(-ENOMEM);
+
+ task = uvesafb_prep();
+ if (!task) {
+ kfree(state);
+ return NULL;
+ }
+
+ task->t.regs.eax = 0x4f04;
+ task->t.regs.ecx = 0x000f;
+ task->t.regs.edx = 0x0001;
+ task->t.flags = TF_BUF_RET | TF_BUF_ESBX;
+ task->t.buf_len = par->vbe_state_size;
+ task->buf = state;
+ err = uvesafb_exec(task);
+
+ if (err || (task->t.regs.eax & 0xffff) != 0x004f) {
+ printk(KERN_WARNING "uvesafb: VBE get state call "
+ "failed (eax=0x%x, err=%d)\n",
+ task->t.regs.eax, err);
+ kfree(state);
+ state = NULL;
+ }
+
+ uvesafb_free(task);
+ return state;
+}
+
+static void uvesafb_vbe_state_restore(struct uvesafb_par *par, u8 *state_buf)
+{
+ struct uvesafb_ktask *task;
+ int err;
+
+ if (!state_buf)
+ return;
+
+ task = uvesafb_prep();
+ if (!task)
+ return;
+
+ task->t.regs.eax = 0x4f04;
+ task->t.regs.ecx = 0x000f;
+ task->t.regs.edx = 0x0002;
+ task->t.buf_len = par->vbe_state_size;
+ task->t.flags = TF_BUF_ESBX;
+ task->buf = state_buf;
+
+ err = uvesafb_exec(task);
+ if (err || (task->t.regs.eax & 0xffff) != 0x004f)
+ printk(KERN_WARNING "uvesafb: VBE state restore call "
+ "failed (eax=0x%x, err=%d)\n",
+ task->t.regs.eax, err);
+
+ uvesafb_free(task);
+}
+
+static int __devinit uvesafb_vbe_getinfo(struct uvesafb_ktask *task,
+ struct uvesafb_par *par)
+{
+ int err;
+
+ task->t.regs.eax = 0x4f00;
+ task->t.flags = TF_VBEIB;
+ task->t.buf_len = sizeof(struct vbe_ib);
+ task->buf = &par->vbe_ib;
+ strncpy(par->vbe_ib.vbe_signature, "VBE2", 4);
+
+ err = uvesafb_exec(task);
+ if (err || (task->t.regs.eax & 0xffff) != 0x004f) {
+ printk(KERN_ERR "uvesafb: Getting VBE info block failed "
+ "(eax=0x%x, err=%d)\n", (u32)task->t.regs.eax,
+ err);
+ return -EINVAL;
+ }
+
+ if (par->vbe_ib.vbe_version < 0x0200) {
+ printk(KERN_ERR "uvesafb: Sorry, pre-VBE 2.0 cards are "
+ "not supported.\n");
+ return -EINVAL;
+ }
+
+ if (!par->vbe_ib.mode_list_ptr) {
+ printk(KERN_ERR "uvesafb: Missing mode list!\n");
+ return -EINVAL;
+ }
+
+ printk(KERN_INFO "uvesafb: ");
+
+ /*
+ * Convert string pointers and the mode list pointer into
+ * usable addresses. Print informational messages about the
+ * video adapter and its vendor.
+ */
+ if (par->vbe_ib.oem_vendor_name_ptr)
+ printk("%s, ",
+ ((char *)task->buf) + par->vbe_ib.oem_vendor_name_ptr);
+
+ if (par->vbe_ib.oem_product_name_ptr)
+ printk("%s, ",
+ ((char *)task->buf) + par->vbe_ib.oem_product_name_ptr);
+
+ if (par->vbe_ib.oem_product_rev_ptr)
+ printk("%s, ",
+ ((char *)task->buf) + par->vbe_ib.oem_product_rev_ptr);
+
+ if (par->vbe_ib.oem_string_ptr)
+ printk("OEM: %s, ",
+ ((char *)task->buf) + par->vbe_ib.oem_string_ptr);
+
+ printk("VBE v%d.%d\n", ((par->vbe_ib.vbe_version & 0xff00) >> 8),
+ par->vbe_ib.vbe_version & 0xff);
+
+ return 0;
+}
+
+static int __devinit uvesafb_vbe_getmodes(struct uvesafb_ktask *task,
+ struct uvesafb_par *par)
+{
+ int off = 0, err;
+ u16 *mode;
+
+ par->vbe_modes_cnt = 0;
+
+ /* Count available modes. */
+ mode = (u16 *) (((u8 *)&par->vbe_ib) + par->vbe_ib.mode_list_ptr);
+ while (*mode != 0xffff) {
+ par->vbe_modes_cnt++;
+ mode++;
+ }
+
+ par->vbe_modes = kzalloc(sizeof(struct vbe_mode_ib) *
+ par->vbe_modes_cnt, GFP_KERNEL);
+ if (!par->vbe_modes)
+ return -ENOMEM;
+
+ /* Get info about all available modes. */
+ mode = (u16 *) (((u8 *)&par->vbe_ib) + par->vbe_ib.mode_list_ptr);
+ while (*mode != 0xffff) {
+ struct vbe_mode_ib *mib;
+
+ uvesafb_reset(task);
+ task->t.regs.eax = 0x4f01;
+ task->t.regs.ecx = (u32) *mode;
+ task->t.flags = TF_BUF_RET | TF_BUF_ESDI;
+ task->t.buf_len = sizeof(struct vbe_mode_ib);
+ task->buf = par->vbe_modes + off;
+
+ err = uvesafb_exec(task);
+ if (err || (task->t.regs.eax & 0xffff) != 0x004f) {
+ printk(KERN_WARNING "uvesafb: Getting mode info block "
+ "for mode 0x%x failed (eax=0x%x, err=%d)\n",
+ *mode, (u32)task->t.regs.eax, err);
+ mode++;
+ par->vbe_modes_cnt--;
+ continue;
+ }
+
+ mib = task->buf;
+ mib->mode_id = *mode;
+
+ /*
+ * We only want modes that are supported with the current
+ * hardware configuration, color, graphics and that have
+ * support for the LFB.
+ */
+ if ((mib->mode_attr & VBE_MODE_MASK) == VBE_MODE_MASK &&
+ mib->bits_per_pixel >= 8)
+ off++;
+ else
+ par->vbe_modes_cnt--;
+
+ mode++;
+ mib->depth = mib->red_len + mib->green_len + mib->blue_len;
+
+ /*
+ * Handle 8bpp modes and modes with broken color component
+ * lengths.
+ */
+ if (mib->depth == 0 || (mib->depth == 24 &&
+ mib->bits_per_pixel == 32))
+ mib->depth = mib->bits_per_pixel;
+ }
+
+ if (par->vbe_modes_cnt > 0)
+ return 0;
+ else
+ return -EINVAL;
+}
+
+/*
+ * The Protected Mode Interface is 32-bit x86 code, so we only run it on
+ * x86 and not x86_64.
+ */
+#ifdef CONFIG_X86_32
+static int __devinit uvesafb_vbe_getpmi(struct uvesafb_ktask *task,
+ struct uvesafb_par *par)
+{
+ int i, err;
+
+ uvesafb_reset(task);
+ task->t.regs.eax = 0x4f0a;
+ task->t.regs.ebx = 0x0;
+ err = uvesafb_exec(task);
+
+ if ((task->t.regs.eax & 0xffff) != 0x4f || task->t.regs.es < 0xc000) {
+ par->pmi_setpal = par->ypan = 0;
+ } else {
+ par->pmi_base = (u16 *)phys_to_virt(((u32)task->t.regs.es << 4)
+ + task->t.regs.edi);
+ par->pmi_start = (u8 *)par->pmi_base + par->pmi_base[1];
+ par->pmi_pal = (u8 *)par->pmi_base + par->pmi_base[2];
+ printk(KERN_INFO "uvesafb: protected mode interface info at "
+ "%04x:%04x\n",
+ (u16)task->t.regs.es, (u16)task->t.regs.edi);
+ printk(KERN_INFO "uvesafb: pmi: set display start = %p, "
+ "set palette = %p\n", par->pmi_start,
+ par->pmi_pal);
+
+ if (par->pmi_base[3]) {
+ printk(KERN_INFO "uvesafb: pmi: ports = ");
+ for (i = par->pmi_base[3]/2;
+ par->pmi_base[i] != 0xffff; i++)
+ printk("%x ", par->pmi_base[i]);
+ printk("\n");
+
+ if (par->pmi_base[i] != 0xffff) {
+ printk(KERN_INFO "uvesafb: can't handle memory"
+ " requests, pmi disabled\n");
+ par->ypan = par->pmi_setpal = 0;
+ }
+ }
+ }
+ return 0;
+}
+#endif /* CONFIG_X86_32 */
+
+/*
+ * Check whether a video mode is supported by the Video BIOS and is
+ * compatible with the monitor limits.
+ */
+static int __devinit uvesafb_is_valid_mode(struct fb_videomode *mode,
+ struct fb_info *info)
+{
+ if (info->monspecs.gtf) {
+ fb_videomode_to_var(&info->var, mode);
+ if (fb_validate_mode(&info->var, info))
+ return 0;
+ }
+
+ if (uvesafb_vbe_find_mode(info->par, mode->xres, mode->yres, 8,
+ UVESAFB_EXACT_RES) == -1)
+ return 0;
+
+ return 1;
+}
+
+static int __devinit uvesafb_vbe_getedid(struct uvesafb_ktask *task,
+ struct fb_info *info)
+{
+ struct uvesafb_par *par = info->par;
+ int err = 0;
+
+ if (noedid || par->vbe_ib.vbe_version < 0x0300)
+ return -EINVAL;
+
+ task->t.regs.eax = 0x4f15;
+ task->t.regs.ebx = 0;
+ task->t.regs.ecx = 0;
+ task->t.buf_len = 0;
+ task->t.flags = 0;
+
+ err = uvesafb_exec(task);
+
+ if ((task->t.regs.eax & 0xffff) != 0x004f || err)
+ return -EINVAL;
+
+ if ((task->t.regs.ebx & 0x3) == 3) {
+ printk(KERN_INFO "uvesafb: VBIOS/hardware supports both "
+ "DDC1 and DDC2 transfers\n");
+ } else if ((task->t.regs.ebx & 0x3) == 2) {
+ printk(KERN_INFO "uvesafb: VBIOS/hardware supports DDC2 "
+ "transfers\n");
+ } else if ((task->t.regs.ebx & 0x3) == 1) {
+ printk(KERN_INFO "uvesafb: VBIOS/hardware supports DDC1 "
+ "transfers\n");
+ } else {
+ printk(KERN_INFO "uvesafb: VBIOS/hardware doesn't support "
+ "DDC transfers\n");
+ return -EINVAL;
+ }
+
+ task->t.regs.eax = 0x4f15;
+ task->t.regs.ebx = 1;
+ task->t.regs.ecx = task->t.regs.edx = 0;
+ task->t.flags = TF_BUF_RET | TF_BUF_ESDI;
+ task->t.buf_len = EDID_LENGTH;
+ task->buf = kzalloc(EDID_LENGTH, GFP_KERNEL);
+
+ err = uvesafb_exec(task);
+
+ if ((task->t.regs.eax & 0xffff) == 0x004f && !err) {
+ fb_edid_to_monspecs(task->buf, &info->monspecs);
+
+ if (info->monspecs.vfmax && info->monspecs.hfmax) {
+ /*
+ * If the maximum pixel clock wasn't specified in
+ * the EDID block, set it to 300 MHz.
+ */
+ if (info->monspecs.dclkmax == 0)
+ info->monspecs.dclkmax = 300 * 1000000;
+ info->monspecs.gtf = 1;
+ }
+ } else {
+ err = -EINVAL;
+ }
+
+ kfree(task->buf);
+ return err;
+}
+
+static void __devinit uvesafb_vbe_getmonspecs(struct uvesafb_ktask *task,
+ struct fb_info *info)
+{
+ struct uvesafb_par *par = info->par;
+ int i;
+
+ memset(&info->monspecs, 0, sizeof(info->monspecs));
+
+ /*
+ * If we don't get all necessary data from the EDID block,
+ * mark it as incompatible with the GTF and set nocrtc so
+ * that we always use the default BIOS refresh rate.
+ */
+ if (uvesafb_vbe_getedid(task, info)) {
+ info->monspecs.gtf = 0;
+ par->nocrtc = 1;
+ }
+
+ /* Kernel command line overrides. */
+ if (maxclk)
+ info->monspecs.dclkmax = maxclk * 1000000;
+ if (maxvf)
+ info->monspecs.vfmax = maxvf;
+ if (maxhf)
+ info->monspecs.hfmax = maxhf * 1000;
+
+ /*
+ * In case DDC transfers are not supported, the user can provide
+ * monitor limits manually. Lower limits are set to "safe" values.
+ */
+ if (info->monspecs.gtf == 0 && maxclk && maxvf && maxhf) {
+ info->monspecs.dclkmin = 0;
+ info->monspecs.vfmin = 60;
+ info->monspecs.hfmin = 29000;
+ info->monspecs.gtf = 1;
+ par->nocrtc = 0;
+ }
+
+ if (info->monspecs.gtf)
+ printk(KERN_INFO
+ "uvesafb: monitor limits: vf = %d Hz, hf = %d kHz, "
+ "clk = %d MHz\n", info->monspecs.vfmax,
+ (int)(info->monspecs.hfmax / 1000),
+ (int)(info->monspecs.dclkmax / 1000000));
+ else
+ printk(KERN_INFO "uvesafb: no monitor limits have been set, "
+ "default refresh rate will be used\n");
+
+ /* Add VBE modes to the modelist. */
+ for (i = 0; i < par->vbe_modes_cnt; i++) {
+ struct fb_var_screeninfo var;
+ struct vbe_mode_ib *mode;
+ struct fb_videomode vmode;
+
+ mode = &par->vbe_modes[i];
+ memset(&var, 0, sizeof(var));
+
+ var.xres = mode->x_res;
+ var.yres = mode->y_res;
+
+ fb_get_mode(FB_VSYNCTIMINGS | FB_IGNOREMON, 60, &var, info);
+ fb_var_to_videomode(&vmode, &var);
+ fb_add_videomode(&vmode, &info->modelist);
+ }
+
+ /* Add valid VESA modes to our modelist. */
+ for (i = 0; i < VESA_MODEDB_SIZE; i++) {
+ if (uvesafb_is_valid_mode((struct fb_videomode *)
+ &vesa_modes[i], info))
+ fb_add_videomode(&vesa_modes[i], &info->modelist);
+ }
+
+ for (i = 0; i < info->monspecs.modedb_len; i++) {
+ if (uvesafb_is_valid_mode(&info->monspecs.modedb[i], info))
+ fb_add_videomode(&info->monspecs.modedb[i],
+ &info->modelist);
+ }
+
+ return;
+}
+
+static void __devinit uvesafb_vbe_getstatesize(struct uvesafb_ktask *task,
+ struct uvesafb_par *par)
+{
+ int err;
+
+ uvesafb_reset(task);
+
+ /*
+ * Get the VBE state buffer size. We want all available
+ * hardware state data (CL = 0x0f).
+ */
+ task->t.regs.eax = 0x4f04;
+ task->t.regs.ecx = 0x000f;
+ task->t.regs.edx = 0x0000;
+ task->t.flags = 0;
+
+ err = uvesafb_exec(task);
+
+ if (err || (task->t.regs.eax & 0xffff) != 0x004f) {
+ printk(KERN_WARNING "uvesafb: VBE state buffer size "
+ "cannot be determined (eax=0x%x, err=%d)\n",
+ task->t.regs.eax, err);
+ par->vbe_state_size = 0;
+ return;
+ }
+
+ par->vbe_state_size = 64 * (task->t.regs.ebx & 0xffff);
+}
+
+static int __devinit uvesafb_vbe_init(struct fb_info *info)
+{
+ struct uvesafb_ktask *task = NULL;
+ struct uvesafb_par *par = info->par;
+ int err;
+
+ task = uvesafb_prep();
+ if (!task)
+ return -ENOMEM;
+
+ err = uvesafb_vbe_getinfo(task, par);
+ if (err)
+ goto out;
+
+ err = uvesafb_vbe_getmodes(task, par);
+ if (err)
+ goto out;
+
+ par->nocrtc = nocrtc;
+#ifdef CONFIG_X86_32
+ par->pmi_setpal = pmi_setpal;
+ par->ypan = ypan;
+
+ if (par->pmi_setpal || par->ypan) {
+ if (__supported_pte_mask & _PAGE_NX) {
+ par->pmi_setpal = par->ypan = 0;
+ printk(KERN_WARNING "uvesafb: NX protection is actively."
+ "We have better not to use the PMI.\n");
+ } else {
+ uvesafb_vbe_getpmi(task, par);
+ }
+ }
+#else
+ /* The protected mode interface is not available on non-x86. */
+ par->pmi_setpal = par->ypan = 0;
+#endif
+
+ INIT_LIST_HEAD(&info->modelist);
+ uvesafb_vbe_getmonspecs(task, info);
+ uvesafb_vbe_getstatesize(task, par);
+
+out: uvesafb_free(task);
+ return err;
+}
+
+static int __devinit uvesafb_vbe_init_mode(struct fb_info *info)
+{
+ struct list_head *pos;
+ struct fb_modelist *modelist;
+ struct fb_videomode *mode;
+ struct uvesafb_par *par = info->par;
+ int i, modeid;
+
+ /* Has the user requested a specific VESA mode? */
+ if (vbemode) {
+ for (i = 0; i < par->vbe_modes_cnt; i++) {
+ if (par->vbe_modes[i].mode_id == vbemode) {
+ modeid = i;
+ uvesafb_setup_var(&info->var, info,
+ &par->vbe_modes[modeid]);
+ fb_get_mode(FB_VSYNCTIMINGS | FB_IGNOREMON, 60,
+ &info->var, info);
+ /*
+ * With pixclock set to 0, the default BIOS
+ * timings will be used in set_par().
+ */
+ info->var.pixclock = 0;
+ goto gotmode;
+ }
+ }
+ printk(KERN_INFO "uvesafb: requested VBE mode 0x%x is "
+ "unavailable\n", vbemode);
+ vbemode = 0;
+ }
+
+ /* Count the modes in the modelist */
+ i = 0;
+ list_for_each(pos, &info->modelist)
+ i++;
+
+ /*
+ * Convert the modelist into a modedb so that we can use it with
+ * fb_find_mode().
+ */
+ mode = kzalloc(i * sizeof(*mode), GFP_KERNEL);
+ if (mode) {
+ i = 0;
+ list_for_each(pos, &info->modelist) {
+ modelist = list_entry(pos, struct fb_modelist, list);
+ mode[i] = modelist->mode;
+ i++;
+ }
+
+ if (!mode_option)
+ mode_option = UVESAFB_DEFAULT_MODE;
+
+ i = fb_find_mode(&info->var, info, mode_option, mode, i,
+ NULL, 8);
+
+ kfree(mode);
+ }
+
+ /* fb_find_mode() failed */
+ if (i == 0) {
+ info->var.xres = 640;
+ info->var.yres = 480;
+ mode = (struct fb_videomode *)
+ fb_find_best_mode(&info->var, &info->modelist);
+
+ if (mode) {
+ fb_videomode_to_var(&info->var, mode);
+ } else {
+ modeid = par->vbe_modes[0].mode_id;
+ uvesafb_setup_var(&info->var, info,
+ &par->vbe_modes[modeid]);
+ fb_get_mode(FB_VSYNCTIMINGS | FB_IGNOREMON, 60,
+ &info->var, info);
+
+ goto gotmode;
+ }
+ }
+
+ /* Look for a matching VBE mode. */
+ modeid = uvesafb_vbe_find_mode(par, info->var.xres, info->var.yres,
+ info->var.bits_per_pixel, UVESAFB_EXACT_RES);
+
+ if (modeid == -1)
+ return -EINVAL;
+
+ uvesafb_setup_var(&info->var, info, &par->vbe_modes[modeid]);
+
+gotmode:
+ /*
+ * If we are not VBE3.0+ compliant, we're done -- the BIOS will
+ * ignore our timings anyway.
+ */
+ if (par->vbe_ib.vbe_version < 0x0300 || par->nocrtc)
+ fb_get_mode(FB_VSYNCTIMINGS | FB_IGNOREMON, 60,
+ &info->var, info);
+
+ return modeid;
+}
+
+static int uvesafb_setpalette(struct uvesafb_pal_entry *entries, int count,
+ int start, struct fb_info *info)
+{
+ struct uvesafb_ktask *task;
+#ifdef CONFIG_X86
+ struct uvesafb_par *par = info->par;
+ int i = par->mode_idx;
+#endif
+ int err = 0;
+
+ /*
+ * We support palette modifications for 8 bpp modes only, so
+ * there can never be more than 256 entries.
+ */
+ if (start + count > 256)
+ return -EINVAL;
+
+#ifdef CONFIG_X86
+ /* Use VGA registers if mode is VGA-compatible. */
+ if (i >= 0 && i < par->vbe_modes_cnt &&
+ par->vbe_modes[i].mode_attr & VBE_MODE_VGACOMPAT) {
+ for (i = 0; i < count; i++) {
+ outb_p(start + i, dac_reg);
+ outb_p(entries[i].red, dac_val);
+ outb_p(entries[i].green, dac_val);
+ outb_p(entries[i].blue, dac_val);
+ }
+ }
+#ifdef CONFIG_X86_32
+ else if (par->pmi_setpal) {
+ __asm__ __volatile__(
+ "call *(%%esi)"
+ : /* no return value */
+ : "a" (0x4f09), /* EAX */
+ "b" (0), /* EBX */
+ "c" (count), /* ECX */
+ "d" (start), /* EDX */
+ "D" (entries), /* EDI */
+ "S" (&par->pmi_pal)); /* ESI */
+ }
+#endif /* CONFIG_X86_32 */
+ else
+#endif /* CONFIG_X86 */
+ {
+ task = uvesafb_prep();
+ if (!task)
+ return -ENOMEM;
+
+ task->t.regs.eax = 0x4f09;
+ task->t.regs.ebx = 0x0;
+ task->t.regs.ecx = count;
+ task->t.regs.edx = start;
+ task->t.flags = TF_BUF_ESDI;
+ task->t.buf_len = sizeof(struct uvesafb_pal_entry) * count;
+ task->buf = entries;
+
+ err = uvesafb_exec(task);
+ if ((task->t.regs.eax & 0xffff) != 0x004f)
+ err = 1;
+
+ uvesafb_free(task);
+ }
+ return err;
+}
+
+static int uvesafb_setcolreg(unsigned regno, unsigned red, unsigned green,
+ unsigned blue, unsigned transp,
+ struct fb_info *info)
+{
+ struct uvesafb_pal_entry entry;
+ int shift = 16 - dac_width;
+ int err = 0;
+
+ if (regno >= info->cmap.len)
+ return -EINVAL;
+
+ if (info->var.bits_per_pixel == 8) {
+ entry.red = red >> shift;
+ entry.green = green >> shift;
+ entry.blue = blue >> shift;
+ entry.pad = 0;
+
+ err = uvesafb_setpalette(&entry, 1, regno, info);
+ } else if (regno < 16) {
+ switch (info->var.bits_per_pixel) {
+ case 16:
+ if (info->var.red.offset == 10) {
+ /* 1:5:5:5 */
+ ((u32 *) (info->pseudo_palette))[regno] =
+ ((red & 0xf800) >> 1) |
+ ((green & 0xf800) >> 6) |
+ ((blue & 0xf800) >> 11);
+ } else {
+ /* 0:5:6:5 */
+ ((u32 *) (info->pseudo_palette))[regno] =
+ ((red & 0xf800) ) |
+ ((green & 0xfc00) >> 5) |
+ ((blue & 0xf800) >> 11);
+ }
+ break;
+
+ case 24:
+ case 32:
+ red >>= 8;
+ green >>= 8;
+ blue >>= 8;
+ ((u32 *)(info->pseudo_palette))[regno] =
+ (red << info->var.red.offset) |
+ (green << info->var.green.offset) |
+ (blue << info->var.blue.offset);
+ break;
+ }
+ }
+ return err;
+}
+
+static int uvesafb_setcmap(struct fb_cmap *cmap, struct fb_info *info)
+{
+ struct uvesafb_pal_entry *entries;
+ int shift = 16 - dac_width;
+ int i, err = 0;
+
+ if (info->var.bits_per_pixel == 8) {
+ if (cmap->start + cmap->len > info->cmap.start +
+ info->cmap.len || cmap->start < info->cmap.start)
+ return -EINVAL;
+
+ entries = kmalloc(sizeof(*entries) * cmap->len, GFP_KERNEL);
+ if (!entries)
+ return -ENOMEM;
+
+ for (i = 0; i < cmap->len; i++) {
+ entries[i].red = cmap->red[i] >> shift;
+ entries[i].green = cmap->green[i] >> shift;
+ entries[i].blue = cmap->blue[i] >> shift;
+ entries[i].pad = 0;
+ }
+ err = uvesafb_setpalette(entries, cmap->len, cmap->start, info);
+ kfree(entries);
+ } else {
+ /*
+ * For modes with bpp > 8, we only set the pseudo palette in
+ * the fb_info struct. We rely on uvesafb_setcolreg to do all
+ * sanity checking.
+ */
+ for (i = 0; i < cmap->len; i++) {
+ err |= uvesafb_setcolreg(cmap->start + i, cmap->red[i],
+ cmap->green[i], cmap->blue[i],
+ 0, info);
+ }
+ }
+ return err;
+}
+
+static int uvesafb_pan_display(struct fb_var_screeninfo *var,
+ struct fb_info *info)
+{
+#ifdef CONFIG_X86_32
+ int offset;
+ struct uvesafb_par *par = info->par;
+
+ offset = (var->yoffset * info->fix.line_length + var->xoffset) / 4;
+
+ /*
+ * It turns out it's not the best idea to do panning via vm86,
+ * so we only allow it if we have a PMI.
+ */
+ if (par->pmi_start) {
+ __asm__ __volatile__(
+ "call *(%%edi)"
+ : /* no return value */
+ : "a" (0x4f07), /* EAX */
+ "b" (0), /* EBX */
+ "c" (offset), /* ECX */
+ "d" (offset >> 16), /* EDX */
+ "D" (&par->pmi_start)); /* EDI */
+ }
+#endif
+ return 0;
+}
+
+static int uvesafb_blank(int blank, struct fb_info *info)
+{
+ struct uvesafb_ktask *task;
+ int err = 1;
+#ifdef CONFIG_X86
+ struct uvesafb_par *par = info->par;
+
+ if (par->vbe_ib.capabilities & VBE_CAP_VGACOMPAT) {
+ int loop = 10000;
+ u8 seq = 0, crtc17 = 0;
+
+ if (blank == FB_BLANK_POWERDOWN) {
+ seq = 0x20;
+ crtc17 = 0x00;
+ err = 0;
+ } else {
+ seq = 0x00;
+ crtc17 = 0x80;
+ err = (blank == FB_BLANK_UNBLANK) ? 0 : -EINVAL;
+ }
+
+ vga_wseq(NULL, 0x00, 0x01);
+ seq |= vga_rseq(NULL, 0x01) & ~0x20;
+ vga_wseq(NULL, 0x00, seq);
+
+ crtc17 |= vga_rcrt(NULL, 0x17) & ~0x80;
+ while (loop--);
+ vga_wcrt(NULL, 0x17, crtc17);
+ vga_wseq(NULL, 0x00, 0x03);
+ } else
+#endif /* CONFIG_X86 */
+ {
+ task = uvesafb_prep();
+ if (!task)
+ return -ENOMEM;
+
+ task->t.regs.eax = 0x4f10;
+ switch (blank) {
+ case FB_BLANK_UNBLANK:
+#if 0 // do nothing in emulator
+ task->t.regs.ebx = 0x0001;
+ break;
+#else
+ return 0;
+#endif
+ case FB_BLANK_NORMAL:
+#if 0 // do nothing in emulator
+ task->t.regs.ebx = 0x0101; /* standby */
+ break;
+#else
+ return 0;
+#endif
+ case FB_BLANK_POWERDOWN:
+#if 0 // do nothing in emulator
+ task->t.regs.ebx = 0x0401; /* powerdown */
+ break;
+#else
+ return 0;
+#endif
+ default:
+ goto out;
+ }
+
+ err = uvesafb_exec(task);
+ if (err || (task->t.regs.eax & 0xffff) != 0x004f)
+ err = 1;
+out: uvesafb_free(task);
+ }
+ return err;
+}
+
+static int uvesafb_open(struct fb_info *info, int user)
+{
+ struct uvesafb_par *par = info->par;
+ int cnt = atomic_read(&par->ref_count);
+ u8 *buf = NULL;
+
+ if (!cnt && par->vbe_state_size) {
+ buf = uvesafb_vbe_state_save(par);
+ if (IS_ERR(buf)) {
+ printk(KERN_WARNING "uvesafb: save hardware state"
+ "failed, error code is %ld!\n", PTR_ERR(buf));
+ } else {
+ par->vbe_state_orig = buf;
+ }
+ }
+
+ atomic_inc(&par->ref_count);
+ return 0;
+}
+
+static int uvesafb_release(struct fb_info *info, int user)
+{
+ struct uvesafb_ktask *task = NULL;
+ struct uvesafb_par *par = info->par;
+ int cnt = atomic_read(&par->ref_count);
+
+ if (!cnt)
+ return -EINVAL;
+
+ if (cnt != 1)
+ goto out;
+
+ task = uvesafb_prep();
+ if (!task)
+ goto out;
+
+ /* First, try to set the standard 80x25 text mode. */
+ task->t.regs.eax = 0x0003;
+ uvesafb_exec(task);
+
+ /*
+ * Now try to restore whatever hardware state we might have
+ * saved when the fb device was first opened.
+ */
+ uvesafb_vbe_state_restore(par, par->vbe_state_orig);
+out:
+ atomic_dec(&par->ref_count);
+ if (task)
+ uvesafb_free(task);
+ return 0;
+}
+
+static int uvesafb_set_par(struct fb_info *info)
+{
+ struct uvesafb_par *par = info->par;
+ struct uvesafb_ktask *task = NULL;
+ struct vbe_crtc_ib *crtc = NULL;
+ struct vbe_mode_ib *mode = NULL;
+ int i, err = 0, depth = info->var.bits_per_pixel;
+
+ if (depth > 8 && depth != 32)
+ depth = info->var.red.length + info->var.green.length +
+ info->var.blue.length;
+
+ i = uvesafb_vbe_find_mode(par, info->var.xres, info->var.yres, depth,
+ UVESAFB_EXACT_RES | UVESAFB_EXACT_DEPTH);
+ if (i >= 0)
+ mode = &par->vbe_modes[i];
+ else
+ return -EINVAL;
+
+ task = uvesafb_prep();
+ if (!task)
+ return -ENOMEM;
+setmode:
+ task->t.regs.eax = 0x4f02;
+ task->t.regs.ebx = mode->mode_id | 0x4000; /* use LFB */
+
+ if (par->vbe_ib.vbe_version >= 0x0300 && !par->nocrtc &&
+ info->var.pixclock != 0) {
+ task->t.regs.ebx |= 0x0800; /* use CRTC data */
+ task->t.flags = TF_BUF_ESDI;
+ crtc = kzalloc(sizeof(struct vbe_crtc_ib), GFP_KERNEL);
+ if (!crtc) {
+ err = -ENOMEM;
+ goto out;
+ }
+ crtc->horiz_start = info->var.xres + info->var.right_margin;
+ crtc->horiz_end = crtc->horiz_start + info->var.hsync_len;
+ crtc->horiz_total = crtc->horiz_end + info->var.left_margin;
+
+ crtc->vert_start = info->var.yres + info->var.lower_margin;
+ crtc->vert_end = crtc->vert_start + info->var.vsync_len;
+ crtc->vert_total = crtc->vert_end + info->var.upper_margin;
+
+ crtc->pixel_clock = PICOS2KHZ(info->var.pixclock) * 1000;
+ crtc->refresh_rate = (u16)(100 * (crtc->pixel_clock /
+ (crtc->vert_total * crtc->horiz_total)));
+
+ if (info->var.vmode & FB_VMODE_DOUBLE)
+ crtc->flags |= 0x1;
+ if (info->var.vmode & FB_VMODE_INTERLACED)
+ crtc->flags |= 0x2;
+ if (!(info->var.sync & FB_SYNC_HOR_HIGH_ACT))
+ crtc->flags |= 0x4;
+ if (!(info->var.sync & FB_SYNC_VERT_HIGH_ACT))
+ crtc->flags |= 0x8;
+ memcpy(&par->crtc, crtc, sizeof(*crtc));
+ } else {
+ memset(&par->crtc, 0, sizeof(*crtc));
+ }
+
+ task->t.buf_len = sizeof(struct vbe_crtc_ib);
+ task->buf = &par->crtc;
+
+ err = uvesafb_exec(task);
+ if (err || (task->t.regs.eax & 0xffff) != 0x004f) {
+ /*
+ * The mode switch might have failed because we tried to
+ * use our own timings. Try again with the default timings.
+ */
+ if (crtc != NULL) {
+ printk(KERN_WARNING "uvesafb: mode switch failed "
+ "(eax=0x%x, err=%d). Trying again with "
+ "default timings.\n", task->t.regs.eax, err);
+ uvesafb_reset(task);
+ kfree(crtc);
+ crtc = NULL;
+ info->var.pixclock = 0;
+ goto setmode;
+ } else {
+ printk(KERN_ERR "uvesafb: mode switch failed (eax="
+ "0x%x, err=%d)\n", task->t.regs.eax, err);
+ err = -EINVAL;
+ goto out;
+ }
+ }
+ par->mode_idx = i;
+
+ /* For 8bpp modes, always try to set the DAC to 8 bits. */
+ if (par->vbe_ib.capabilities & VBE_CAP_CAN_SWITCH_DAC &&
+ mode->bits_per_pixel <= 8) {
+ uvesafb_reset(task);
+ task->t.regs.eax = 0x4f08;
+ task->t.regs.ebx = 0x0800;
+
+ err = uvesafb_exec(task);
+ if (err || (task->t.regs.eax & 0xffff) != 0x004f ||
+ ((task->t.regs.ebx & 0xff00) >> 8) != 8) {
+ dac_width = 6;
+ } else {
+ dac_width = 8;
+ }
+ }
+
+ info->fix.visual = (info->var.bits_per_pixel == 8) ?
+ FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_TRUECOLOR;
+ info->fix.line_length = mode->bytes_per_scan_line;
+
+out: if (crtc != NULL)
+ kfree(crtc);
+ uvesafb_free(task);
+
+ return err;
+}
+
+static void uvesafb_check_limits(struct fb_var_screeninfo *var,
+ struct fb_info *info)
+{
+ const struct fb_videomode *mode;
+ struct uvesafb_par *par = info->par;
+
+ /*
+ * If pixclock is set to 0, then we're using default BIOS timings
+ * and thus don't have to perform any checks here.
+ */
+ if (!var->pixclock)
+ return;
+
+ if (par->vbe_ib.vbe_version < 0x0300) {
+ fb_get_mode(FB_VSYNCTIMINGS | FB_IGNOREMON, 60, var, info);
+ return;
+ }
+
+ if (!fb_validate_mode(var, info))
+ return;
+
+ mode = fb_find_best_mode(var, &info->modelist);
+ if (mode) {
+ if (mode->xres == var->xres && mode->yres == var->yres &&
+ !(mode->vmode & (FB_VMODE_INTERLACED | FB_VMODE_DOUBLE))) {
+ fb_videomode_to_var(var, mode);
+ return;
+ }
+ }
+
+ if (info->monspecs.gtf && !fb_get_mode(FB_MAXTIMINGS, 0, var, info))
+ return;
+ /* Use default refresh rate */
+ var->pixclock = 0;
+}
+
+static int uvesafb_check_var(struct fb_var_screeninfo *var,
+ struct fb_info *info)
+{
+ struct uvesafb_par *par = info->par;
+ struct vbe_mode_ib *mode = NULL;
+ int match = -1;
+ int depth = var->red.length + var->green.length + var->blue.length;
+
+ /*
+ * Various apps will use bits_per_pixel to set the color depth,
+ * which is theoretically incorrect, but which we'll try to handle
+ * here.
+ */
+ if (depth == 0 || abs(depth - var->bits_per_pixel) >= 8)
+ depth = var->bits_per_pixel;
+
+ match = uvesafb_vbe_find_mode(par, var->xres, var->yres, depth,
+ UVESAFB_EXACT_RES);
+ if (match == -1)
+ return -EINVAL;
+
+ mode = &par->vbe_modes[match];
+ uvesafb_setup_var(var, info, mode);
+
+ /*
+ * Check whether we have remapped enough memory for this mode.
+ * We might be called at an early stage, when we haven't remapped
+ * any memory yet, in which case we simply skip the check.
+ */
+ if (var->yres * mode->bytes_per_scan_line > info->fix.smem_len
+ && info->fix.smem_len)
+ return -EINVAL;
+
+ if ((var->vmode & FB_VMODE_DOUBLE) &&
+ !(par->vbe_modes[match].mode_attr & 0x100))
+ var->vmode &= ~FB_VMODE_DOUBLE;
+
+ if ((var->vmode & FB_VMODE_INTERLACED) &&
+ !(par->vbe_modes[match].mode_attr & 0x200))
+ var->vmode &= ~FB_VMODE_INTERLACED;
+
+ uvesafb_check_limits(var, info);
+
+ var->xres_virtual = var->xres;
+ var->yres_virtual = (par->ypan) ?
+ info->fix.smem_len / mode->bytes_per_scan_line :
+ var->yres;
+ return 0;
+}
+
+static struct fb_ops uvesafb_ops = {
+ .owner = THIS_MODULE,
+ .fb_open = uvesafb_open,
+ .fb_release = uvesafb_release,
+ .fb_setcolreg = uvesafb_setcolreg,
+ .fb_setcmap = uvesafb_setcmap,
+ .fb_pan_display = uvesafb_pan_display,
+ .fb_blank = uvesafb_blank,
+ .fb_fillrect = cfb_fillrect,
+ .fb_copyarea = cfb_copyarea,
+ .fb_imageblit = cfb_imageblit,
+ .fb_check_var = uvesafb_check_var,
+ .fb_set_par = uvesafb_set_par,
+};
+
+static void __devinit uvesafb_init_info(struct fb_info *info,
+ struct vbe_mode_ib *mode)
+{
+ unsigned int size_vmode;
+ unsigned int size_remap;
+ unsigned int size_total;
+ struct uvesafb_par *par = info->par;
+ int i, h;
+
+ info->pseudo_palette = ((u8 *)info->par + sizeof(struct uvesafb_par));
+ info->fix = uvesafb_fix;
+ info->fix.ypanstep = par->ypan ? 1 : 0;
+ info->fix.ywrapstep = (par->ypan > 1) ? 1 : 0;
+
+ /* Disable blanking if the user requested so. */
+ if (!blank)
+ info->fbops->fb_blank = NULL;
+
+ /*
+ * Find out how much IO memory is required for the mode with
+ * the highest resolution.
+ */
+ size_remap = 0;
+ for (i = 0; i < par->vbe_modes_cnt; i++) {
+ h = par->vbe_modes[i].bytes_per_scan_line *
+ par->vbe_modes[i].y_res;
+ if (h > size_remap)
+ size_remap = h;
+ }
+ size_remap *= 2;
+
+ /*
+ * size_vmode -- that is the amount of memory needed for the
+ * used video mode, i.e. the minimum amount of
+ * memory we need.
+ */
+ if (mode != NULL) {
+ size_vmode = info->var.yres * mode->bytes_per_scan_line;
+ } else {
+ size_vmode = info->var.yres * info->var.xres *
+ ((info->var.bits_per_pixel + 7) >> 3);
+ }
+
+ /*
+ * size_total -- all video memory we have. Used for mtrr
+ * entries, resource allocation and bounds
+ * checking.
+ */
+ size_total = par->vbe_ib.total_memory * 65536;
+ if (vram_total)
+ size_total = vram_total * 1024 * 1024;
+ if (size_total < size_vmode)
+ size_total = size_vmode;
+
+ /*
+ * size_remap -- the amount of video memory we are going to
+ * use for vesafb. With modern cards it is no
+ * option to simply use size_total as th
+ * wastes plenty of kernel address space.
+ */
+ if (vram_remap)
+ size_remap = vram_remap * 1024 * 1024;
+ if (size_remap < size_vmode)
+ size_remap = size_vmode;
+ if (size_remap > size_total)
+ size_remap = size_total;
+
+ info->fix.smem_len = size_remap;
+ info->fix.smem_start = mode->phys_base_ptr;
+
+ /*
+ * We have to set yres_virtual here because when setup_var() was
+ * called, smem_len wasn't defined yet.
+ */
+ info->var.yres_virtual = info->fix.smem_len /
+ mode->bytes_per_scan_line;
+
+ if (par->ypan && info->var.yres_virtual > info->var.yres) {
+ printk(KERN_INFO "uvesafb: scrolling: %s "
+ "using protected mode interface, "
+ "yres_virtual=%d\n",
+ (par->ypan > 1) ? "ywrap" : "ypan",
+ info->var.yres_virtual);
+ } else {
+ printk(KERN_INFO "uvesafb: scrolling: redraw\n");
+ info->var.yres_virtual = info->var.yres;
+ par->ypan = 0;
+ }
+
+ info->flags = FBINFO_FLAG_DEFAULT |
+ (par->ypan ? FBINFO_HWACCEL_YPAN : 0);
+
+ if (!par->ypan)
+ info->fbops->fb_pan_display = NULL;
+}
+
+static void __devinit uvesafb_init_mtrr(struct fb_info *info)
+{
+#ifdef CONFIG_MTRR
+ if (mtrr && !(info->fix.smem_start & (PAGE_SIZE - 1))) {
+ int temp_size = info->fix.smem_len;
+ unsigned int type = 0;
+
+ switch (mtrr) {
+ case 1:
+ type = MTRR_TYPE_UNCACHABLE;
+ break;
+ case 2:
+ type = MTRR_TYPE_WRBACK;
+ break;
+ case 3:
+ type = MTRR_TYPE_WRCOMB;
+ break;
+ case 4:
+ type = MTRR_TYPE_WRTHROUGH;
+ break;
+ default:
+ type = 0;
+ break;
+ }
+
+ if (type) {
+ int rc;
+
+ /* Find the largest power-of-two */
+ temp_size = roundup_pow_of_two(temp_size);
+
+ /* Try and find a power of two to add */
+ do {
+ rc = mtrr_add(info->fix.smem_start,
+ temp_size, type, 1);
+ temp_size >>= 1;
+ } while (temp_size >= PAGE_SIZE && rc == -EINVAL);
+ }
+ }
+#endif /* CONFIG_MTRR */
+}
+
+static void __devinit uvesafb_ioremap(struct fb_info *info)
+{
+#ifdef CONFIG_X86
+ switch (mtrr) {
+ case 1: /* uncachable */
+ info->screen_base = ioremap_nocache(info->fix.smem_start, info->fix.smem_len);
+ break;
+ case 2: /* write-back */
+ info->screen_base = ioremap_cache(info->fix.smem_start, info->fix.smem_len);
+ break;
+ case 3: /* write-combining */
+ info->screen_base = ioremap_wc(info->fix.smem_start, info->fix.smem_len);
+ break;
+ case 4: /* write-through */
+ default:
+ info->screen_base = ioremap(info->fix.smem_start, info->fix.smem_len);
+ break;
+ }
+#else
+ info->screen_base = ioremap(info->fix.smem_start, info->fix.smem_len);
+#endif /* CONFIG_X86 */
+}
+
+static ssize_t uvesafb_show_vbe_ver(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct fb_info *info = platform_get_drvdata(to_platform_device(dev));
+ struct uvesafb_par *par = info->par;
+
+ return snprintf(buf, PAGE_SIZE, "%.4x\n", par->vbe_ib.vbe_version);
+}
+
+static DEVICE_ATTR(vbe_version, S_IRUGO, uvesafb_show_vbe_ver, NULL);
+
+static ssize_t uvesafb_show_vbe_modes(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct fb_info *info = platform_get_drvdata(to_platform_device(dev));
+ struct uvesafb_par *par = info->par;
+ int ret = 0, i;
+
+ for (i = 0; i < par->vbe_modes_cnt && ret < PAGE_SIZE; i++) {
+ ret += snprintf(buf + ret, PAGE_SIZE - ret,
+ "%dx%d-%d, 0x%.4x\n",
+ par->vbe_modes[i].x_res, par->vbe_modes[i].y_res,
+ par->vbe_modes[i].depth, par->vbe_modes[i].mode_id);
+ }
+
+ return ret;
+}
+
+static DEVICE_ATTR(vbe_modes, S_IRUGO, uvesafb_show_vbe_modes, NULL);
+
+static ssize_t uvesafb_show_vendor(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct fb_info *info = platform_get_drvdata(to_platform_device(dev));
+ struct uvesafb_par *par = info->par;
+
+ if (par->vbe_ib.oem_vendor_name_ptr)
+ return snprintf(buf, PAGE_SIZE, "%s\n", (char *)
+ (&par->vbe_ib) + par->vbe_ib.oem_vendor_name_ptr);
+ else
+ return 0;
+}
+
+static DEVICE_ATTR(oem_vendor, S_IRUGO, uvesafb_show_vendor, NULL);
+
+static ssize_t uvesafb_show_product_name(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct fb_info *info = platform_get_drvdata(to_platform_device(dev));
+ struct uvesafb_par *par = info->par;
+
+ if (par->vbe_ib.oem_product_name_ptr)
+ return snprintf(buf, PAGE_SIZE, "%s\n", (char *)
+ (&par->vbe_ib) + par->vbe_ib.oem_product_name_ptr);
+ else
+ return 0;
+}
+
+static DEVICE_ATTR(oem_product_name, S_IRUGO, uvesafb_show_product_name, NULL);
+
+static ssize_t uvesafb_show_product_rev(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct fb_info *info = platform_get_drvdata(to_platform_device(dev));
+ struct uvesafb_par *par = info->par;
+
+ if (par->vbe_ib.oem_product_rev_ptr)
+ return snprintf(buf, PAGE_SIZE, "%s\n", (char *)
+ (&par->vbe_ib) + par->vbe_ib.oem_product_rev_ptr);
+ else
+ return 0;
+}
+
+static DEVICE_ATTR(oem_product_rev, S_IRUGO, uvesafb_show_product_rev, NULL);
+
+static ssize_t uvesafb_show_oem_string(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct fb_info *info = platform_get_drvdata(to_platform_device(dev));
+ struct uvesafb_par *par = info->par;
+
+ if (par->vbe_ib.oem_string_ptr)
+ return snprintf(buf, PAGE_SIZE, "%s\n",
+ (char *)(&par->vbe_ib) + par->vbe_ib.oem_string_ptr);
+ else
+ return 0;
+}
+
+static DEVICE_ATTR(oem_string, S_IRUGO, uvesafb_show_oem_string, NULL);
+
+static ssize_t uvesafb_show_nocrtc(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct fb_info *info = platform_get_drvdata(to_platform_device(dev));
+ struct uvesafb_par *par = info->par;
+
+ return snprintf(buf, PAGE_SIZE, "%d\n", par->nocrtc);
+}
+
+static ssize_t uvesafb_store_nocrtc(struct device *dev,
+ struct device_attribute *attr, const char *buf, size_t count)
+{
+ struct fb_info *info = platform_get_drvdata(to_platform_device(dev));
+ struct uvesafb_par *par = info->par;
+
+ if (count > 0) {
+ if (buf[0] == '0')
+ par->nocrtc = 0;
+ else
+ par->nocrtc = 1;
+ }
+ return count;
+}
+
+static DEVICE_ATTR(nocrtc, S_IRUGO | S_IWUSR, uvesafb_show_nocrtc,
+ uvesafb_store_nocrtc);
+
+static struct attribute *uvesafb_dev_attrs[] = {
+ &dev_attr_vbe_version.attr,
+ &dev_attr_vbe_modes.attr,
+ &dev_attr_oem_vendor.attr,
+ &dev_attr_oem_product_name.attr,
+ &dev_attr_oem_product_rev.attr,
+ &dev_attr_oem_string.attr,
+ &dev_attr_nocrtc.attr,
+ NULL,
+};
+
+static struct attribute_group uvesafb_dev_attgrp = {
+ .name = NULL,
+ .attrs = uvesafb_dev_attrs,
+};
+
+static int __devinit uvesafb_probe(struct platform_device *dev)
+{
+ struct fb_info *info;
+ struct vbe_mode_ib *mode = NULL;
+ struct uvesafb_par *par;
+ int err = 0, i;
+
+ info = framebuffer_alloc(sizeof(*par) + sizeof(u32) * 256, &dev->dev);
+ if (!info)
+ return -ENOMEM;
+
+ par = info->par;
+
+ err = uvesafb_vbe_init(info);
+ if (err) {
+ printk(KERN_ERR "uvesafb: vbe_init() failed with %d\n", err);
+ goto out;
+ }
+
+ info->fbops = &uvesafb_ops;
+
+ i = uvesafb_vbe_init_mode(info);
+ if (i < 0) {
+ err = -EINVAL;
+ goto out;
+ } else {
+ mode = &par->vbe_modes[i];
+ }
+
+ if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) {
+ err = -ENXIO;
+ goto out;
+ }
+
+ uvesafb_init_info(info, mode);
+
+ if (!request_region(0x3c0, 32, "uvesafb")) {
+ printk(KERN_ERR "uvesafb: request region 0x3c0-0x3e0 failed\n");
+ err = -EIO;
+ goto out_mode;
+ }
+
+ if (!request_mem_region(info->fix.smem_start, info->fix.smem_len,
+ "uvesafb")) {
+ printk(KERN_ERR "uvesafb: cannot reserve video memory at "
+ "0x%lx\n", info->fix.smem_start);
+ err = -EIO;
+ goto out_reg;
+ }
+
+ uvesafb_init_mtrr(info);
+ uvesafb_ioremap(info);
+
+ if (!info->screen_base) {
+ printk(KERN_ERR
+ "uvesafb: abort, cannot ioremap 0x%x bytes of video "
+ "memory at 0x%lx\n",
+ info->fix.smem_len, info->fix.smem_start);
+ err = -EIO;
+ goto out_mem;
+ }
+
+ platform_set_drvdata(dev, info);
+
+ if (register_framebuffer(info) < 0) {
+ printk(KERN_ERR
+ "uvesafb: failed to register framebuffer device\n");
+ err = -EINVAL;
+ goto out_unmap;
+ }
+
+ printk(KERN_INFO "uvesafb: framebuffer at 0x%lx, mapped to 0x%p, "
+ "using %dk, total %dk\n", info->fix.smem_start,
+ info->screen_base, info->fix.smem_len/1024,
+ par->vbe_ib.total_memory * 64);
+ printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node,
+ info->fix.id);
+
+ err = sysfs_create_group(&dev->dev.kobj, &uvesafb_dev_attgrp);
+ if (err != 0)
+ printk(KERN_WARNING "fb%d: failed to register attributes\n",
+ info->node);
+
+ return 0;
+
+out_unmap:
+ iounmap(info->screen_base);
+out_mem:
+ release_mem_region(info->fix.smem_start, info->fix.smem_len);
+out_reg:
+ release_region(0x3c0, 32);
+out_mode:
+ if (!list_empty(&info->modelist))
+ fb_destroy_modelist(&info->modelist);
+ fb_destroy_modedb(info->monspecs.modedb);
+ fb_dealloc_cmap(&info->cmap);
+out:
+ if (par->vbe_modes)
+ kfree(par->vbe_modes);
+
+ framebuffer_release(info);
+ return err;
+}
+
+static int uvesafb_remove(struct platform_device *dev)
+{
+ struct fb_info *info = platform_get_drvdata(dev);
+
+ if (info) {
+ struct uvesafb_par *par = info->par;
+
+ sysfs_remove_group(&dev->dev.kobj, &uvesafb_dev_attgrp);
+ unregister_framebuffer(info);
+ release_region(0x3c0, 32);
+ iounmap(info->screen_base);
+ release_mem_region(info->fix.smem_start, info->fix.smem_len);
+ fb_destroy_modedb(info->monspecs.modedb);
+ fb_dealloc_cmap(&info->cmap);
+
+ if (par) {
+ if (par->vbe_modes)
+ kfree(par->vbe_modes);
+ if (par->vbe_state_orig)
+ kfree(par->vbe_state_orig);
+ if (par->vbe_state_saved)
+ kfree(par->vbe_state_saved);
+ }
+
+ framebuffer_release(info);
+ }
+ return 0;
+}
+
+static struct platform_driver uvesafb_driver = {
+ .probe = uvesafb_probe,
+ .remove = uvesafb_remove,
+ .driver = {
+ .name = "uvesafb",
+ },
+};
+
+static struct platform_device *uvesafb_device;
+
+#ifndef MODULE
+static int __devinit uvesafb_setup(char *options)
+{
+ char *this_opt;
+
+ if (!options || !*options)
+ return 0;
+
+ while ((this_opt = strsep(&options, ",")) != NULL) {
+ if (!*this_opt) continue;
+
+ if (!strcmp(this_opt, "redraw"))
+ ypan = 0;
+ else if (!strcmp(this_opt, "ypan"))
+ ypan = 1;
+ else if (!strcmp(this_opt, "ywrap"))
+ ypan = 2;
+ else if (!strcmp(this_opt, "vgapal"))
+ pmi_setpal = 0;
+ else if (!strcmp(this_opt, "pmipal"))
+ pmi_setpal = 1;
+ else if (!strncmp(this_opt, "mtrr:", 5))
+ mtrr = simple_strtoul(this_opt+5, NULL, 0);
+ else if (!strcmp(this_opt, "nomtrr"))
+ mtrr = 0;
+ else if (!strcmp(this_opt, "nocrtc"))
+ nocrtc = 1;
+ else if (!strcmp(this_opt, "noedid"))
+ noedid = 1;
+ else if (!strcmp(this_opt, "noblank"))
+ blank = 0;
+ else if (!strncmp(this_opt, "vtotal:", 7))
+ vram_total = simple_strtoul(this_opt + 7, NULL, 0);
+ else if (!strncmp(this_opt, "vremap:", 7))
+ vram_remap = simple_strtoul(this_opt + 7, NULL, 0);
+ else if (!strncmp(this_opt, "maxhf:", 6))
+ maxhf = simple_strtoul(this_opt + 6, NULL, 0);
+ else if (!strncmp(this_opt, "maxvf:", 6))
+ maxvf = simple_strtoul(this_opt + 6, NULL, 0);
+ else if (!strncmp(this_opt, "maxclk:", 7))
+ maxclk = simple_strtoul(this_opt + 7, NULL, 0);
+ else if (!strncmp(this_opt, "vbemode:", 8))
+ vbemode = simple_strtoul(this_opt + 8, NULL, 0);
+ else if (this_opt[0] >= '0' && this_opt[0] <= '9') {
+ mode_option = this_opt;
+ } else {
+ printk(KERN_WARNING
+ "uvesafb: unrecognized option %s\n", this_opt);
+ }
+ }
+
+ return 0;
+}
+#endif /* !MODULE */
+
+static ssize_t show_v86d(struct device_driver *dev, char *buf)
+{
+ return snprintf(buf, PAGE_SIZE, "%s\n", v86d_path);
+}
+
+static ssize_t store_v86d(struct device_driver *dev, const char *buf,
+ size_t count)
+{
+ strncpy(v86d_path, buf, PATH_MAX);
+ return count;
+}
+
+static DRIVER_ATTR(v86d, S_IRUGO | S_IWUSR, show_v86d, store_v86d);
+
+static int __devinit uvesafb_init(void)
+{
+ int err;
+
+#ifndef MODULE
+ char *option = NULL;
+
+ if (fb_get_options("uvesafb", &option))
+ return -ENODEV;
+ uvesafb_setup(option);
+#endif
+ err = cn_add_callback(&uvesafb_cn_id, "uvesafb", uvesafb_cn_callback);
+ if (err)
+ return err;
+
+ err = platform_driver_register(&uvesafb_driver);
+
+ if (!err) {
+ uvesafb_device = platform_device_alloc("uvesafb", 0);
+ if (uvesafb_device)
+ err = platform_device_add(uvesafb_device);
+ else
+ err = -ENOMEM;
+
+ if (err) {
+ platform_device_put(uvesafb_device);
+ platform_driver_unregister(&uvesafb_driver);
+ cn_del_callback(&uvesafb_cn_id);
+ return err;
+ }
+
+ err = driver_create_file(&uvesafb_driver.driver,
+ &driver_attr_v86d);
+ if (err) {
+ printk(KERN_WARNING "uvesafb: failed to register "
+ "attributes\n");
+ err = 0;
+ }
+ }
+ return err;
+}
+
+module_init(uvesafb_init);
+
+static void __devexit uvesafb_exit(void)
+{
+ struct uvesafb_ktask *task;
+
+ if (v86d_started) {
+ task = uvesafb_prep();
+ if (task) {
+ task->t.flags = TF_EXIT;
+ uvesafb_exec(task);
+ uvesafb_free(task);
+ }
+ }
+
+ cn_del_callback(&uvesafb_cn_id);
+ driver_remove_file(&uvesafb_driver.driver, &driver_attr_v86d);
+ platform_device_unregister(uvesafb_device);
+ platform_driver_unregister(&uvesafb_driver);
+}
+
+module_exit(uvesafb_exit);
+
+static int param_set_scroll(const char *val, const struct kernel_param *kp)
+{
+ ypan = 0;
+
+ if (!strcmp(val, "redraw"))
+ ypan = 0;
+ else if (!strcmp(val, "ypan"))
+ ypan = 1;
+ else if (!strcmp(val, "ywrap"))
+ ypan = 2;
+ else
+ return -EINVAL;
+
+ return 0;
+}
+static struct kernel_param_ops param_ops_scroll = {
+ .set = param_set_scroll,
+};
+#define param_check_scroll(name, p) __param_check(name, p, void)
+
+module_param_named(scroll, ypan, scroll, 0);
+MODULE_PARM_DESC(scroll,
+ "Scrolling mode, set to 'redraw', 'ypan', or 'ywrap'");
+module_param_named(vgapal, pmi_setpal, invbool, 0);
+MODULE_PARM_DESC(vgapal, "Set palette using VGA registers");
+module_param_named(pmipal, pmi_setpal, bool, 0);
+MODULE_PARM_DESC(pmipal, "Set palette using PMI calls");
+module_param(mtrr, uint, 0);
+MODULE_PARM_DESC(mtrr,
+ "Memory Type Range Registers setting. Use 0 to disable.");
+module_param(blank, bool, 0);
+MODULE_PARM_DESC(blank, "Enable hardware blanking");
+module_param(nocrtc, bool, 0);
+MODULE_PARM_DESC(nocrtc, "Ignore CRTC timings when setting modes");
+module_param(noedid, bool, 0);
+MODULE_PARM_DESC(noedid,
+ "Ignore EDID-provided monitor limits when setting modes");
+module_param(vram_remap, uint, 0);
+MODULE_PARM_DESC(vram_remap, "Set amount of video memory to be used [MiB]");
+module_param(vram_total, uint, 0);
+MODULE_PARM_DESC(vram_total, "Set total amount of video memoery [MiB]");
+module_param(maxclk, ushort, 0);
+MODULE_PARM_DESC(maxclk, "Maximum pixelclock [MHz], overrides EDID data");
+module_param(maxhf, ushort, 0);
+MODULE_PARM_DESC(maxhf,
+ "Maximum horizontal frequency [kHz], overrides EDID data");
+module_param(maxvf, ushort, 0);
+MODULE_PARM_DESC(maxvf,
+ "Maximum vertical frequency [Hz], overrides EDID data");
+module_param(mode_option, charp, 0);
+MODULE_PARM_DESC(mode_option,
+ "Specify initial video mode as \"<xres>x<yres>[-<bpp>][@<refresh>]\"");
+module_param(vbemode, ushort, 0);
+MODULE_PARM_DESC(vbemode,
+ "VBE mode number to set, overrides the 'mode' option");
+module_param_string(v86d, v86d_path, PATH_MAX, 0660);
+MODULE_PARM_DESC(v86d, "Path to the v86d userspace helper.");
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Michal Januszewski <spock@gentoo.org>");
+MODULE_DESCRIPTION("Framebuffer driver for VBE2.0+ compliant graphics boards");
+
--- /dev/null
+/*
+ * Maru framebuffer device driver
+ * Based on drivers/video/uvesafb.h:
+ *
+ * Copyright (C) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjun Son <hj79.son@samsung.com>
+ * GiWoong Kim <giwoong.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _UVESAFB_H
+#define _UVESAFB_H
+
+#include <linux/types.h>
+
+struct v86_regs {
+ __u32 ebx;
+ __u32 ecx;
+ __u32 edx;
+ __u32 esi;
+ __u32 edi;
+ __u32 ebp;
+ __u32 eax;
+ __u32 eip;
+ __u32 eflags;
+ __u32 esp;
+ __u16 cs;
+ __u16 ss;
+ __u16 es;
+ __u16 ds;
+ __u16 fs;
+ __u16 gs;
+};
+
+/* Task flags */
+#define TF_VBEIB 0x01
+#define TF_BUF_ESDI 0x02
+#define TF_BUF_ESBX 0x04
+#define TF_BUF_RET 0x08
+#define TF_EXIT 0x10
+
+struct uvesafb_task {
+ __u8 flags;
+ int buf_len;
+ struct v86_regs regs;
+};
+
+/* Constants for the capabilities field
+ * in vbe_ib */
+#define VBE_CAP_CAN_SWITCH_DAC 0x01
+#define VBE_CAP_VGACOMPAT 0x02
+
+/* The VBE Info Block */
+struct vbe_ib {
+ char vbe_signature[4];
+ __u16 vbe_version;
+ __u32 oem_string_ptr;
+ __u32 capabilities;
+ __u32 mode_list_ptr;
+ __u16 total_memory;
+ __u16 oem_software_rev;
+ __u32 oem_vendor_name_ptr;
+ __u32 oem_product_name_ptr;
+ __u32 oem_product_rev_ptr;
+ __u8 reserved[222];
+ char oem_data[256];
+ char misc_data[512];
+} __attribute__ ((packed));
+
+#ifdef __KERNEL__
+
+/* VBE CRTC Info Block */
+struct vbe_crtc_ib {
+ u16 horiz_total;
+ u16 horiz_start;
+ u16 horiz_end;
+ u16 vert_total;
+ u16 vert_start;
+ u16 vert_end;
+ u8 flags;
+ u32 pixel_clock;
+ u16 refresh_rate;
+ u8 reserved[40];
+} __attribute__ ((packed));
+
+#define VBE_MODE_VGACOMPAT 0x20
+#define VBE_MODE_COLOR 0x08
+#define VBE_MODE_SUPPORTEDHW 0x01
+#define VBE_MODE_GRAPHICS 0x10
+#define VBE_MODE_LFB 0x80
+
+#define VBE_MODE_MASK (VBE_MODE_COLOR | VBE_MODE_SUPPORTEDHW | \
+ VBE_MODE_GRAPHICS | VBE_MODE_LFB)
+
+/* VBE Mode Info Block */
+struct vbe_mode_ib {
+ /* for all VBE revisions */
+ u16 mode_attr;
+ u8 winA_attr;
+ u8 winB_attr;
+ u16 win_granularity;
+ u16 win_size;
+ u16 winA_seg;
+ u16 winB_seg;
+ u32 win_func_ptr;
+ u16 bytes_per_scan_line;
+
+ /* for VBE 1.2+ */
+ u16 x_res;
+ u16 y_res;
+ u8 x_char_size;
+ u8 y_char_size;
+ u8 planes;
+ u8 bits_per_pixel;
+ u8 banks;
+ u8 memory_model;
+ u8 bank_size;
+ u8 image_pages;
+ u8 reserved1;
+
+ /* Direct color fields for direct/6 and YUV/7 memory models. */
+ /* Offsets are bit positions of lsb in the mask. */
+ u8 red_len;
+ u8 red_off;
+ u8 green_len;
+ u8 green_off;
+ u8 blue_len;
+ u8 blue_off;
+ u8 rsvd_len;
+ u8 rsvd_off;
+ u8 direct_color_info; /* direct color mode attributes */
+
+ /* for VBE 2.0+ */
+ u32 phys_base_ptr;
+ u8 reserved2[6];
+
+ /* for VBE 3.0+ */
+ u16 lin_bytes_per_scan_line;
+ u8 bnk_image_pages;
+ u8 lin_image_pages;
+ u8 lin_red_len;
+ u8 lin_red_off;
+ u8 lin_green_len;
+ u8 lin_green_off;
+ u8 lin_blue_len;
+ u8 lin_blue_off;
+ u8 lin_rsvd_len;
+ u8 lin_rsvd_off;
+ u32 max_pixel_clock;
+ u16 mode_id;
+ u8 depth;
+} __attribute__ ((packed));
+
+#define UVESAFB_DEFAULT_MODE "640x480-16"
+
+/* How long to wait for a reply from userspace [ms] */
+#define UVESAFB_TIMEOUT 5000
+
+/* Max number of concurrent tasks */
+#define UVESAFB_TASKS_MAX 16
+
+#define dac_reg (0x3c8)
+#define dac_val (0x3c9)
+
+struct uvesafb_pal_entry {
+ u_char blue, green, red, pad;
+} __attribute__ ((packed));
+
+struct uvesafb_ktask {
+ struct uvesafb_task t;
+ void *buf;
+ struct completion *done;
+ u32 ack;
+};
+
+static int uvesafb_exec(struct uvesafb_ktask *tsk);
+
+#define UVESAFB_EXACT_RES 1
+#define UVESAFB_EXACT_DEPTH 2
+
+struct uvesafb_par {
+ struct vbe_ib vbe_ib; /* VBE Info Block */
+ struct vbe_mode_ib *vbe_modes; /* list of supported VBE modes */
+ int vbe_modes_cnt;
+
+ u8 nocrtc;
+ u8 ypan; /* 0 - nothing, 1 - ypan, 2 - ywrap */
+ u8 pmi_setpal; /* PMI for palette changes */
+ u16 *pmi_base; /* protected mode interface location */
+ void *pmi_start;
+ void *pmi_pal;
+ u8 *vbe_state_orig; /*
+ * original hardware state, before the
+ * driver was loaded
+ */
+ u8 *vbe_state_saved; /* state saved by fb_save_state */
+ int vbe_state_size;
+ atomic_t ref_count;
+
+ int mode_idx;
+ struct vbe_crtc_ib crtc;
+};
+
+#endif /* __KERNEL__ */
+#endif /* _UVESAFB_H */
--- /dev/null
+/*\r
+ * Virtual device node for event injector of emulator\r
+ *\r
+ * Copyright (c) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact:\r
+ * Sungmin Ha <sungmin82.ha@samsung.com>\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\r
+ *\r
+ * Contributors:\r
+ * - S-Core Co., Ltd\r
+ */\r
+\r
+#include <linux/kernel.h>\r
+#include <linux/module.h>\r
+#include <linux/device.h>\r
+#include <linux/platform_device.h>\r
+#include <linux/slab.h>\r
+\r
+int charger_online = 0;\r
+int earjack_online = 0;\r
+int earkey_online = 0;\r
+int hdmi_online = 0;\r
+int usb_online = 0;\r
+\r
+struct my_data {\r
+ int no;\r
+ char test[50];\r
+};\r
+\r
+static ssize_t show_charger_online(struct device *dev, \r
+ struct device_attribute *attr, char *buf) \r
+{\r
+ printk("[%s] \n", __FUNCTION__);\r
+ return snprintf(buf, PAGE_SIZE, "%d", charger_online);\r
+}\r
+\r
+static ssize_t store_charger_online(struct device *dev, \r
+ struct device_attribute *attr, const char *buf, size_t count) \r
+{\r
+ printk("[%s] \n", __FUNCTION__);\r
+ sscanf(buf, "%d", &charger_online);\r
+ return strnlen(buf, PAGE_SIZE);\r
+}\r
+\r
+static ssize_t show_earjack_online(struct device *dev, \r
+ struct device_attribute *attr, char *buf) \r
+{\r
+ printk("[%s] \n", __FUNCTION__);\r
+ return snprintf(buf, PAGE_SIZE, "%d", earjack_online);\r
+}\r
+\r
+static ssize_t store_earjack_online(struct device *dev, \r
+ struct device_attribute *attr, const char *buf, size_t count) \r
+{\r
+ printk("[%s] \n", __FUNCTION__);\r
+ sscanf(buf, "%d", &earjack_online);\r
+ return strnlen(buf, PAGE_SIZE);\r
+}\r
+\r
+static ssize_t show_earkey_online(struct device *dev, \r
+ struct device_attribute *attr, char *buf) \r
+{\r
+ printk("[%s] \n", __FUNCTION__);\r
+ return snprintf(buf, PAGE_SIZE, "%d", earkey_online);\r
+}\r
+\r
+static ssize_t store_earkey_online(struct device *dev, \r
+ struct device_attribute *attr, const char *buf, size_t count) \r
+{\r
+ printk("[%s] \n", __FUNCTION__);\r
+ sscanf(buf, "%d", &earkey_online);\r
+ return strnlen(buf, PAGE_SIZE);\r
+}\r
+\r
+static ssize_t show_hdmi_online(struct device *dev, \r
+ struct device_attribute *attr, char *buf) \r
+{\r
+ printk("[%s] \n", __FUNCTION__);\r
+ return snprintf(buf, PAGE_SIZE, "%d", hdmi_online);\r
+}\r
+\r
+static ssize_t store_hdmi_online(struct device *dev, \r
+ struct device_attribute *attr, const char *buf, size_t count) \r
+{\r
+ printk("[%s] \n", __FUNCTION__);\r
+ sscanf(buf, "%d", &hdmi_online);\r
+ return strnlen(buf, PAGE_SIZE);\r
+}\r
+\r
+static ssize_t show_usb_online(struct device *dev, \r
+ struct device_attribute *attr, char *buf) \r
+{\r
+ printk("[%s] \n", __FUNCTION__);\r
+ return snprintf(buf, PAGE_SIZE, "%d", usb_online);\r
+}\r
+\r
+static ssize_t store_usb_online(struct device *dev, \r
+ struct device_attribute *attr, const char *buf, size_t count) \r
+{\r
+ printk("[%s] \n", __FUNCTION__);\r
+ sscanf(buf, "%d", &usb_online);\r
+ return strnlen(buf, PAGE_SIZE);\r
+}\r
+static DEVICE_ATTR(charger_online, S_IRUGO | S_IWUSR, show_charger_online, store_charger_online);\r
+static DEVICE_ATTR(earjack_online, S_IRUGO | S_IWUSR, show_earjack_online, store_earjack_online);\r
+static DEVICE_ATTR(earkey_online, S_IRUGO | S_IWUSR, show_earkey_online, store_earkey_online);\r
+static DEVICE_ATTR(hdmi_online, S_IRUGO | S_IWUSR, show_hdmi_online, store_hdmi_online);\r
+static DEVICE_ATTR(usb_online, S_IRUGO | S_IWUSR, show_usb_online, store_usb_online);\r
+\r
+static int sysfs_test_create_file(struct device *dev) \r
+{\r
+ int result = 0;\r
+\r
+ printk("[%d] [%s] \n", __LINE__, __FUNCTION__);\r
+\r
+ result = device_create_file(dev, &dev_attr_charger_online);\r
+ if (result){\r
+ printk("[%d] [%s] error \n", __LINE__, __FUNCTION__);\r
+ return result;\r
+ }\r
+\r
+ result = device_create_file(dev, &dev_attr_earjack_online);\r
+ if (result){\r
+ printk("[%d] [%s] error \n", __LINE__, __FUNCTION__);\r
+ return result;\r
+ }\r
+\r
+ result = device_create_file(dev, &dev_attr_earkey_online);\r
+ if (result){\r
+ printk("[%d] [%s] error \n", __LINE__, __FUNCTION__);\r
+ return result;\r
+ }\r
+\r
+ result = device_create_file(dev, &dev_attr_hdmi_online);\r
+ if (result){\r
+ printk("[%d] [%s] error \n", __LINE__, __FUNCTION__);\r
+ return result;\r
+ }\r
+\r
+ result = device_create_file(dev, &dev_attr_usb_online);\r
+ if (result){\r
+ printk("[%d] [%s] error \n", __LINE__, __FUNCTION__);\r
+ return result;\r
+ }\r
+\r
+ return 0;\r
+}\r
+\r
+\r
+static void sysfs_test_remove_file(struct device *dev) \r
+{\r
+ printk("[%s] \n", __FUNCTION__);\r
+ device_remove_file(dev, &dev_attr_charger_online);\r
+ device_remove_file(dev, &dev_attr_earjack_online);\r
+ device_remove_file(dev, &dev_attr_earkey_online);\r
+ device_remove_file(dev, &dev_attr_hdmi_online);\r
+ device_remove_file(dev, &dev_attr_usb_online);\r
+}\r
+\r
+static void sysfs_test_dev_release(struct device *dev) {}\r
+\r
+static struct platform_device the_pdev = {\r
+ .name = "jack",\r
+ .id = -1,\r
+ .dev = {\r
+ .release = sysfs_test_dev_release,\r
+ }\r
+};\r
+\r
+static int __init sysfs_test_init(void) \r
+{\r
+ int err = 0;\r
+ struct my_data *data;\r
+\r
+ printk("[%s] \n", __FUNCTION__);\r
+\r
+ err = platform_device_register(&the_pdev);\r
+ if (err) {\r
+ printk("platform_device_register error\n");\r
+ return err;\r
+ }\r
+\r
+ data = kzalloc(sizeof(struct my_data), GFP_KERNEL);\r
+ if (!data) {\r
+ printk("[%s] kzalloc error\n", __FUNCTION__);\r
+ err = -ENOMEM;\r
+ goto alloc_err;\r
+ }\r
+\r
+ dev_set_drvdata(&the_pdev.dev, (void*)data);\r
+\r
+ err = sysfs_test_create_file(&the_pdev.dev);\r
+ if (err) {\r
+ printk("sysfs_create_file error\n");\r
+ goto sysfs_err;\r
+ }\r
+\r
+ return 0;\r
+\r
+sysfs_err:\r
+ kfree(data);\r
+\r
+alloc_err:\r
+ platform_device_unregister(&the_pdev);\r
+ return err;\r
+}\r
+\r
+static void __exit sysfs_test_exit(void) \r
+{\r
+ void *data = dev_get_drvdata(&the_pdev.dev);\r
+\r
+ printk("[%s] \n", __FUNCTION__);\r
+\r
+ kfree(data);\r
+ sysfs_test_remove_file(&the_pdev.dev);\r
+ platform_device_unregister(&the_pdev);\r
+}\r
+\r
+module_init(sysfs_test_init);\r
+module_exit(sysfs_test_exit);\r
+\r
+\r
+MODULE_LICENSE("GPL");\r
+\r
+\r
--- /dev/null
+/*
+ * Virtual LCD sysfs node
+ *
+ * Copyright (c) 2011-2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjun Son <hj79.son@samsung.com>
+ * DongKyun Yun <dk77.yun@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/device.h>
+#include <linux/notifier.h>
+#include <linux/ctype.h>
+#include <linux/err.h>
+
+#include <asm/uaccess.h>
+
+static struct class *emul_lcd_class;
+static struct device *emul_lcd_dev;
+static int lcd_power = 0;
+
+static ssize_t lcd_power_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ printk(KERN_INFO "lcd_power = %d\n", lcd_power);
+ return sprintf(buf, "%d\n", lcd_power);
+}
+
+static DEVICE_ATTR(lcd_power, 0664, lcd_power_show, NULL);
+static struct device_attribute *emul_lcd_device_attrib[] = {
+ &dev_attr_lcd_power,
+};
+
+static int __init emul_lcd_class_init(void)
+{
+ int i, ret;
+
+ emul_lcd_class = class_create(THIS_MODULE, "lcd");
+ if (IS_ERR(emul_lcd_class)) {
+ printk(KERN_WARNING "Unable to create backlight class; errno = %ld\n",
+ PTR_ERR(emul_lcd_class));
+ return PTR_ERR(emul_lcd_class);
+ }
+
+ emul_lcd_dev = device_create(emul_lcd_class, NULL, 0, NULL, "emulator");
+
+ for (i=0; i < ARRAY_SIZE(emul_lcd_device_attrib); i++) {
+ ret = device_create_file(emul_lcd_dev, emul_lcd_device_attrib[i]);
+ if (ret != 0) {
+ printk(KERN_ERR "emul_lcd: Failed to create attr %d: %d\n", i, ret);
+ return ret;
+ }
+ }
+
+ return 0;
+}
+
+static void __exit emul_lcd_class_exit(void)
+{
+ class_destroy(emul_lcd_class);
+}
+
+/*
+ * if this is compiled into the kernel, we need to ensure that the
+ * class is registered before users of the class try to register lcd's
+ */
+module_init(emul_lcd_class_init);
+module_exit(emul_lcd_class_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("s-core");
+MODULE_DESCRIPTION("Emulator LCD driver for x86");
--- /dev/null
+/*
+ * Maru Virtual Overlay Driver
+ *
+ * Copyright (c) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunjun Son <hj79.son@samsung.com>
+ * GiWoong Kim <giwoong.kim@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include <linux/init.h>
+#include <linux/pci.h>
+#include <linux/module.h>
+#include <media/v4l2-common.h>
+#include <media/v4l2-ioctl.h>
+
+#define SVO_DRIVER_MAJORVERSION 0
+#define SVO_DRIVER_MINORVERSION 1
+
+enum {
+ OVERLAY_POWER = 0x00,
+ OVERLAY_POSITION = 0x04, // left top position
+ OVERLAY_SIZE = 0x08, // width and height
+};
+
+static struct pci_device_id svo_pci_tbl[] = {
+ {
+ .vendor = PCI_VENDOR_ID_TIZEN,
+ .device = 0x1010,
+ .subvendor = PCI_ANY_ID,
+ .subdevice = PCI_ANY_ID,
+ }
+};
+
+struct svo {
+ struct pci_dev *pci_dev; /* pci device */
+
+ struct video_device *video_dev0; /* video device parameters */
+ struct video_device *video_dev1; /* video device parameters */
+
+ resource_size_t mem_start;
+ resource_size_t reg_start;
+
+ resource_size_t mem_size;
+ resource_size_t reg_size;
+
+ unsigned char __iomem *svo_mmreg; /* svo: memory mapped registers */
+
+ unsigned long in_use0; /* set to 1 if the device is in use */
+ unsigned long in_use1; /* set to 1 if the device is in use */
+
+ struct v4l2_rect w0, w1; /* overlaid rect */
+};
+
+/* driver structure - only one possible */
+static struct svo svo;
+
+/****************************************************************************/
+/* virtual register access helper */
+/****************************************************************************/
+
+static void overlay_power(int num, int onoff) {
+ writel(onoff, svo.svo_mmreg + num * svo.reg_size / 2 + OVERLAY_POWER);
+}
+
+/****************************************************************************/
+/* svo ioctls */
+/****************************************************************************/
+
+static int svo_querycap(struct file *file, void *fh,
+ struct v4l2_capability *cap)
+{
+ strcpy(cap->driver, "svo");
+ strcpy(cap->card, "svo");
+ sprintf(cap->bus_info, "PCI:%s", pci_name(svo.pci_dev));
+
+ cap->version = (SVO_DRIVER_MAJORVERSION << 8) +
+ SVO_DRIVER_MINORVERSION;
+
+ cap->capabilities = V4L2_CAP_VIDEO_OVERLAY;
+
+ return 0;
+}
+
+static int svo0_g_fmt_vid_overlay(struct file *file, void *priv,
+ struct v4l2_format *f)
+{
+ if (f->type != V4L2_BUF_TYPE_VIDEO_OVERLAY)
+ return -EINVAL;
+
+ f->fmt.win.w.left = svo.w0.left;
+ f->fmt.win.w.top = svo.w0.top;
+ f->fmt.win.w.width = svo.w0.width;
+ f->fmt.win.w.height = svo.w0.height;
+
+ return 0;
+}
+
+static int svo1_g_fmt_vid_overlay(struct file *file, void *priv,
+ struct v4l2_format *f)
+{
+ if (f->type != V4L2_BUF_TYPE_VIDEO_OVERLAY)
+ return -EINVAL;
+
+ f->fmt.win.w.left = svo.w1.left;
+ f->fmt.win.w.top = svo.w1.top;
+ f->fmt.win.w.width = svo.w1.width;
+ f->fmt.win.w.height = svo.w1.height;
+
+ return 0;
+}
+
+static int svo0_s_fmt_vid_overlay(struct file *file, void *priv,
+ struct v4l2_format *f)
+{
+ if (f->type != V4L2_BUF_TYPE_VIDEO_OVERLAY)
+ return -EINVAL;
+
+ if (f->fmt.win.w.left < 0)
+ return -EINVAL;
+ if (f->fmt.win.w.top < 0)
+ return -EINVAL;
+
+ if (f->fmt.win.w.width < 0)
+ return -EINVAL;
+ if (f->fmt.win.w.height < 0)
+ return -EINVAL;
+
+ svo.w0.left = f->fmt.win.w.left;
+ svo.w0.top = f->fmt.win.w.top;
+ svo.w0.width = f->fmt.win.w.width;
+ svo.w0.height = f->fmt.win.w.height;
+
+ writel(svo.w0.left | svo.w0.top << 16, svo.svo_mmreg + OVERLAY_POSITION);
+ writel(svo.w0.width | svo.w0.height << 16, svo.svo_mmreg + OVERLAY_SIZE);
+
+ return 0;
+}
+
+static int svo1_s_fmt_vid_overlay(struct file *file, void *priv,
+ struct v4l2_format *f)
+{
+ if (f->type != V4L2_BUF_TYPE_VIDEO_OVERLAY)
+ return -EINVAL;
+
+ if (f->fmt.win.w.left < 0)
+ return -EINVAL;
+ if (f->fmt.win.w.top < 0)
+ return -EINVAL;
+
+ if (f->fmt.win.w.width < 0)
+ return -EINVAL;
+ if (f->fmt.win.w.height < 0)
+ return -EINVAL;
+
+ svo.w1.left = f->fmt.win.w.left;
+ svo.w1.top = f->fmt.win.w.top;
+ svo.w1.width = f->fmt.win.w.width;
+ svo.w1.height = f->fmt.win.w.height;
+
+ writel(svo.w1.left | svo.w1.top << 16, svo.svo_mmreg + svo.reg_size / 2 + OVERLAY_POSITION);
+ writel(svo.w1.width | svo.w1.height << 16, svo.svo_mmreg + svo.reg_size / 2 + OVERLAY_SIZE);
+
+ return 0;
+}
+
+static int svo_reqbufs(struct file *file, void *priv,
+ struct v4l2_requestbuffers *p)
+{
+ if (p->type != V4L2_BUF_TYPE_VIDEO_OVERLAY)
+ return -EINVAL;
+
+ if (p->count > 1)
+ return -EINVAL;
+
+ if (p->memory != V4L2_MEMORY_MMAP)
+ return -EINVAL;
+
+ return 0;
+}
+
+static int svo0_querybuf(struct file *file, void *priv, struct v4l2_buffer *p)
+{
+ if (p->type != V4L2_BUF_TYPE_VIDEO_OVERLAY)
+ return -EINVAL;
+
+ if (p->index)
+ return -EINVAL;
+
+ p->length = svo.mem_size / 2;
+ p->m.offset = svo.mem_start;
+
+ return 0;
+}
+
+static int svo1_querybuf(struct file *file, void *priv, struct v4l2_buffer *p)
+{
+ if (p->type != V4L2_BUF_TYPE_VIDEO_OVERLAY)
+ return -EINVAL;
+
+ if (p->index)
+ return -EINVAL;
+
+ p->length = svo.mem_size / 2;
+ p->m.offset = svo.mem_start + p->length;
+
+ return 0;
+}
+
+static int svo0_overlay (struct file *file, void *fh, unsigned int i)
+{
+ overlay_power(0, i);
+
+ return 0;
+}
+
+static int svo1_overlay (struct file *file, void *fh, unsigned int i)
+{
+ overlay_power(1, i);
+
+ return 0;
+}
+
+/****************************************************************************/
+/* File operations */
+/****************************************************************************/
+
+static int svo0_open(struct file *file)
+{
+ if (test_and_set_bit(0, &svo.in_use0))
+ return -EBUSY;
+
+ return 0;
+}
+
+static int svo1_open(struct file *file)
+{
+ if (test_and_set_bit(0, &svo.in_use1))
+ return -EBUSY;
+
+ return 0;
+}
+
+static void svo_vm_open(struct vm_area_struct *vma)
+{
+}
+
+static void svo_vm_close(struct vm_area_struct *vma)
+{
+}
+
+static const struct vm_operations_struct svo_vm_ops = {
+ .open = svo_vm_open,
+ .close = svo_vm_close,
+};
+
+static int svo_mmap(struct file *file, struct vm_area_struct *vma)
+{
+ unsigned long size = vma->vm_end - vma->vm_start;
+
+ if (size > svo.mem_size)
+ return -EINVAL;
+
+ if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, size, PAGE_SHARED))
+ return -EAGAIN;
+
+ vma->vm_ops = &svo_vm_ops;
+ vma->vm_flags &= ~VM_IO; /* not I/O memory */
+ vma->vm_flags |= VM_RESERVED; /* avoid to swap out this VMA */
+
+ return 0;
+}
+
+static int svo0_release(struct file *file)
+{
+ clear_bit(0, &svo.in_use0);
+ overlay_power(0, 0);
+
+ return 0;
+}
+
+static int svo1_release(struct file *file)
+{
+ clear_bit(0, &svo.in_use1);
+ overlay_power(1, 0);
+
+ return 0;
+}
+
+static const struct v4l2_ioctl_ops svo0_ioctl_ops = {
+ .vidioc_querycap = svo_querycap,
+ .vidioc_g_fmt_vid_overlay = svo0_g_fmt_vid_overlay,
+ .vidioc_s_fmt_vid_overlay = svo0_s_fmt_vid_overlay,
+ .vidioc_reqbufs = svo_reqbufs,
+ .vidioc_querybuf = svo0_querybuf,
+ .vidioc_overlay = svo0_overlay,
+};
+
+static const struct v4l2_ioctl_ops svo1_ioctl_ops = {
+ .vidioc_querycap = svo_querycap,
+ .vidioc_g_fmt_vid_overlay = svo1_g_fmt_vid_overlay,
+ .vidioc_s_fmt_vid_overlay = svo1_s_fmt_vid_overlay,
+ .vidioc_reqbufs = svo_reqbufs,
+ .vidioc_querybuf = svo1_querybuf,
+ .vidioc_overlay = svo1_overlay,
+};
+
+static const struct v4l2_file_operations svo0_fops = {
+ .owner = THIS_MODULE,
+ .open = svo0_open,
+ .release = svo0_release,
+ .mmap = svo_mmap,
+ .ioctl = video_ioctl2,
+};
+
+static const struct v4l2_file_operations svo1_fops = {
+ .owner = THIS_MODULE,
+ .open = svo1_open,
+ .release = svo1_release,
+ .mmap = svo_mmap,
+ .ioctl = video_ioctl2,
+};
+
+static struct video_device svo0_template = {
+ .name = "svo0",
+ .fops = &svo0_fops,
+ .ioctl_ops = &svo0_ioctl_ops,
+ .release = video_device_release,
+ .minor = -1,
+};
+
+static struct video_device svo1_template = {
+ .name = "svo1",
+ .fops = &svo1_fops,
+ .ioctl_ops = &svo1_ioctl_ops,
+ .release = video_device_release,
+ .minor = -1,
+};
+
+/* /dev/videoX registration number */
+static int video_nr = -1;
+module_param(video_nr, int, 0444);
+MODULE_PARM_DESC(video_nr, "video device to register (0=/dev/video0, etc)");
+
+static int __devinit svo_initdev(struct pci_dev *pci_dev,
+ const struct pci_device_id *ent)
+{
+ int ret = -EBUSY;
+
+ if (svo.pci_dev != NULL) {
+ printk(KERN_ERR "svo: only one device allowed!\n");
+ goto outnotdev;
+ }
+
+ ret = -ENOMEM;
+ svo.pci_dev = pci_dev;
+ svo.video_dev0 = video_device_alloc();
+ if (!svo.video_dev0) {
+ printk(KERN_ERR "svo0: video_device_alloc() failed!\n");
+ goto outnotdev;
+ }
+
+ svo.video_dev1 = video_device_alloc();
+ if (!svo.video_dev1) {
+ printk(KERN_ERR "svo1: video_device_alloc() failed!\n");
+ goto outnotdev;
+ }
+
+ memcpy(svo.video_dev0, &svo0_template, sizeof(svo0_template));
+ svo.video_dev0->parent = &svo.pci_dev->dev;
+ memcpy(svo.video_dev1, &svo1_template, sizeof(svo1_template));
+ svo.video_dev1->parent = &svo.pci_dev->dev;
+
+ ret = -EIO;
+
+ if ((ret = pci_enable_device(svo.pci_dev))) {
+ printk(KERN_ERR "svo: pci_enable_device failed\n");
+ goto outnotdev;
+ }
+
+ svo.mem_start = pci_resource_start(svo.pci_dev,0);
+ svo.mem_size = pci_resource_len(svo.pci_dev, 0);
+ if (!svo.mem_start) {
+ printk(KERN_ERR "svo: svo has no device base address\n");
+ goto outregions;
+ }
+ if (!request_mem_region(pci_resource_start(svo.pci_dev, 0),
+ pci_resource_len(svo.pci_dev, 0),
+ "svo")) {
+ printk(KERN_ERR "svo: request_mem_region failed\n");
+ goto outregions;
+ }
+
+ svo.reg_start = pci_resource_start(svo.pci_dev,1);
+ svo.reg_size = pci_resource_len(svo.pci_dev, 1);
+ if (!svo.reg_start) {
+ printk(KERN_ERR "svo: svo has no device base address\n");
+ goto outregions;
+ }
+ if (!request_mem_region(pci_resource_start(svo.pci_dev, 1),
+ pci_resource_len(svo.pci_dev, 1),
+ "svo")) {
+ printk(KERN_ERR "svo: request_mem_region failed\n");
+ goto outregions;
+ }
+
+ svo.svo_mmreg = ioremap(svo.reg_start, svo.reg_size);
+ if (!svo.svo_mmreg) {
+ printk(KERN_ERR "svo: ioremap failed\n");
+ goto outremap;
+ }
+
+ pci_write_config_byte(svo.pci_dev, PCI_CACHE_LINE_SIZE, 8);
+ pci_write_config_byte(svo.pci_dev, PCI_LATENCY_TIMER, 64);
+
+ pci_set_master(svo.pci_dev);
+
+ if (video_register_device(svo.video_dev0, VFL_TYPE_GRABBER,
+ video_nr) < 0) {
+ printk(KERN_ERR "svo: video_register_device failed\n");
+ goto outreqirq;
+ }
+ if (video_register_device(svo.video_dev1, VFL_TYPE_GRABBER,
+ video_nr) < 0) {
+ printk(KERN_ERR "svo: video_register_device failed\n");
+ goto outreqirq;
+ }
+
+ printk(KERN_INFO "svo: Tizen Virtual Overlay Driver v%d.%d\n",
+ SVO_DRIVER_MAJORVERSION, SVO_DRIVER_MINORVERSION);
+
+ return 0;
+
+outreqirq:
+ iounmap(svo.svo_mmreg);
+outremap:
+ release_mem_region(pci_resource_start(svo.pci_dev, 0),
+ pci_resource_len(svo.pci_dev, 0));
+ release_mem_region(pci_resource_start(svo.pci_dev, 1),
+ pci_resource_len(svo.pci_dev, 1));
+outregions:
+ pci_disable_device(svo.pci_dev);
+ video_device_release(svo.video_dev0);
+ video_device_release(svo.video_dev1);
+outnotdev:
+ return ret;
+}
+
+static struct pci_driver svo_pci_driver = {
+ .name = "svo",
+ .id_table = svo_pci_tbl,
+ .probe = svo_initdev,
+// .remove = __devexit_p(cx8800_finidev),
+#ifdef CONFIG_PM
+// .suspend = cx8800_suspend,
+// .resume = cx8800_resume,
+#endif
+};
+
+static int __init svo_init(void)
+{
+ printk(KERN_INFO "svo: Tizen virtual overlay driver version %d.%d loaded\n",
+ SVO_DRIVER_MAJORVERSION, SVO_DRIVER_MINORVERSION);
+
+ return pci_register_driver(&svo_pci_driver);
+}
+
+static void __exit svo_fini(void)
+{
+ pci_unregister_driver(&svo_pci_driver);
+}
+
+module_init(svo_init);
+module_exit(svo_fini);
--- /dev/null
+/*\r
+ * Virtual device node for event injector of emulator\r
+ *\r
+ * Copyright (c) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact:\r
+ * Sungmin Ha <sungmin82.ha@samsung.com>\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\r
+ *\r
+ * Contributors:\r
+ * - S-Core Co., Ltd\r
+ */\r
+\r
+#include <linux/kernel.h>\r
+#include <linux/module.h>\r
+#include <linux/device.h>\r
+#include <linux/platform_device.h>\r
+\r
+static struct class *mtd_class;\r
+static struct device* mtd_device;\r
+\r
+static int capacity = 100;\r
+static int charge_full = 1;\r
+static int charge_now = 0;\r
+\r
+//#define DEBUG_MARU_POWER_SUPPLY
+
+static ssize_t show_capacity(struct device *dev, struct device_attribute *attr, char *buf) \r
+{\r
+#ifdef DEBUG_MARU_POWER_SUPPLY
+ printk("[%s] \n", __FUNCTION__);\r
+#endif
+ return snprintf(buf, PAGE_SIZE, "%d", capacity);\r
+}\r
+\r
+static ssize_t store_capacity(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \r
+{\r
+#ifdef DEBUG_MARU_POWER_SUPPLY
+ printk("[%s] \n", __FUNCTION__);\r
+#endif
+ sscanf(buf, "%d", &capacity);\r
+ return strnlen(buf, PAGE_SIZE);\r
+}\r
+\r
+static ssize_t show_charge_full(struct device *dev, struct device_attribute *attr, char *buf) \r
+{\r
+#ifdef DEBUG_MARU_POWER_SUPPLY
+ printk("[%s] \n", __FUNCTION__);\r
+#endif
+ return snprintf(buf, PAGE_SIZE, "%d", charge_full);\r
+}\r
+\r
+static ssize_t store_charge_full(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \r
+{\r
+#ifdef DEBUG_MARU_POWER_SUPPLY
+ printk("[%s] \n", __FUNCTION__);\r
+#endif
+ sscanf(buf, "%d", &charge_full);\r
+ return strnlen(buf, PAGE_SIZE);\r
+}\r
+\r
+static ssize_t show_charge_now(struct device *dev, struct device_attribute *attr, char *buf) \r
+{\r
+#ifdef DEBUG_MARU_POWER_SUPPLY
+ printk("[%s] \n", __FUNCTION__);\r
+#endif
+ return snprintf(buf, PAGE_SIZE, "%d", charge_now);\r
+}\r
+\r
+static ssize_t store_charge_now(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \r
+{\r
+#ifdef DEBUG_MARU_POWER_SUPPLY
+ printk("[%s] \n", __FUNCTION__);\r
+#endif
+ sscanf(buf, "%d", &charge_now);\r
+ return strnlen(buf, PAGE_SIZE);\r
+}\r
+\r
+static struct device_attribute ps_device_attributes[] = {\r
+ __ATTR(capacity, 0644, show_capacity, store_capacity),\r
+ __ATTR(charge_full, 0644, show_charge_full, store_charge_full),\r
+ __ATTR(charge_now, 0644, show_charge_now, store_charge_now),\r
+};\r
+\r
+struct device new_device_dev;\r
+\r
+static int __init sysfs_test_init(void) \r
+{\r
+ int err;\r
+ printk("[%s] \n", __FUNCTION__);\r
+\r
+ mtd_class = class_create(THIS_MODULE, "power_supply");\r
+ mtd_device = device_create(mtd_class, NULL, (dev_t)NULL, NULL, "battery");\r
+ \r
+ err = device_create_file(mtd_device, &ps_device_attributes[0]);\r
+ err = device_create_file(mtd_device, &ps_device_attributes[1]);\r
+ err = device_create_file(mtd_device, &ps_device_attributes[2]);\r
+\r
+ return 0;\r
+}\r
+\r
+static void __exit sysfs_test_exit(void) \r
+{\r
+ printk("[%s] \n", __FUNCTION__);\r
+ class_destroy(mtd_class);\r
+}\r
+\r
+module_init(sysfs_test_init);\r
+module_exit(sysfs_test_exit);\r
+\r
+\r
+MODULE_LICENSE("GPL");\r
+\r
+\r
--- /dev/null
+/*
+ * Maru Virtual USB Touchscreen device driver
+ * Based on drivers/input/tablet/wacom_sys.c:
+ *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * GiWoong Kim <giwoong.kim@samsung.com>\r
+ * Hyunjun Son <hj79.son@samsung.com>\r
+ * DongKyun Yun <dk77.yun@samsung.com>\r
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/usb/input.h>
+#include <linux/slab.h>
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("s-core");
+MODULE_DESCRIPTION("Emulator Touchscreen driver for x86");
+
+/* touchscreen device features */
+#define EMUL_TOUCHSCREEN_PACKET_LEN 7
+#define TOUCHSCREEN_RESOLUTION_X 5040
+#define TOUCHSCREEN_RESOLUTION_Y 3780
+#define ABS_PRESSURE_MAX 255
+
+struct emul_touchscreen {
+ dma_addr_t data_dma;
+ struct input_dev *emuldev;
+ struct usb_device *usbdev;
+ struct usb_interface *intf;
+ struct urb *irq;
+ unsigned char *data;
+ struct mutex lock;
+ unsigned int open:1;
+ char phys[32];
+};
+
+/* This structure must match the qemu definitions */
+typedef struct USBEmulTouchscreenPacket {
+ uint16_t x, y, z;
+ uint8_t state;
+} USBEmulTouchscreenPacket;
+
+
+static void emul_touchscreen_sys_irq(struct urb *urb)
+{
+ struct emul_touchscreen *usb_ts = urb->context;
+ struct input_dev *input_dev = usb_ts->emuldev;
+ USBEmulTouchscreenPacket *packet = (USBEmulTouchscreenPacket *)usb_ts->data;
+ int retval;
+
+ switch (urb->status) {
+ case 0:
+ /* success */
+ break;
+ case -ECONNRESET:
+ case -ENOENT:
+ case -ESHUTDOWN:
+ /* this urb is terminated, clean up */
+ dbg("%s - urb shutting down with status: %d", __func__, urb->status);
+ return;
+ default:
+ dbg("%s - nonzero urb status received: %d", __func__, urb->status);
+ goto exit;
+ }
+
+ if (packet->state != 0) { //pressed
+ input_report_abs(input_dev, ABS_MT_TRACKING_ID, packet->z);
+ input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, 5);
+ input_report_abs(input_dev, ABS_MT_POSITION_X, packet->x);
+ input_report_abs(input_dev, ABS_MT_POSITION_Y, packet->y);
+ input_mt_sync(input_dev);
+ } else { //release
+ if (packet->z == 1) {
+ input_report_abs(input_dev, ABS_MT_TRACKING_ID, 1);
+ input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, 0);
+ input_mt_sync(input_dev);
+ }
+ input_report_abs(input_dev, ABS_MT_TRACKING_ID, 0);
+ input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, 0);
+ input_mt_sync(input_dev);
+ }
+
+ input_sync(input_dev);
+
+ exit:
+ usb_mark_last_busy(usb_ts->usbdev);
+ retval = usb_submit_urb(urb, GFP_ATOMIC);
+ if (retval) {
+ err("%s - usb_submit_urb failed with result %d", __func__, retval);
+ }
+}
+
+static int emul_touchscreen_open(struct input_dev *dev)
+{
+ struct emul_touchscreen *usb_ts = input_get_drvdata(dev);
+
+ mutex_lock(&usb_ts->lock);
+ usb_ts->irq->dev = usb_ts->usbdev;
+
+ if (usb_autopm_get_interface(usb_ts->intf) < 0) {
+ mutex_unlock(&usb_ts->lock);
+ return -EIO;
+ }
+
+ if (usb_submit_urb(usb_ts->irq, GFP_KERNEL)) {
+ usb_autopm_put_interface(usb_ts->intf);
+ mutex_unlock(&usb_ts->lock);
+ return -EIO;
+ }
+
+ usb_ts->open = 1;
+ usb_ts->intf->needs_remote_wakeup = 1;
+
+ mutex_unlock(&usb_ts->lock);
+ return 0;
+}
+
+static void emul_touchscreen_close(struct input_dev *dev)
+{
+ struct emul_touchscreen *usb_ts = input_get_drvdata(dev);
+
+ mutex_lock(&usb_ts->lock);
+ usb_kill_urb(usb_ts->irq);
+ usb_ts->open = 0;
+ usb_ts->intf->needs_remote_wakeup = 0;
+ mutex_unlock(&usb_ts->lock);
+}
+
+static int emul_touchscreen_probe(struct usb_interface *intf, const struct usb_device_id *id)
+{
+ struct usb_endpoint_descriptor *endpoint;
+ struct emul_touchscreen *usb_ts;
+ int error = -ENOMEM;
+
+ usb_ts = kzalloc(sizeof(struct emul_touchscreen), GFP_KERNEL);
+ if (!usb_ts) {
+ goto fail1;
+ }
+
+ usb_ts->usbdev = interface_to_usbdev(intf);
+ usb_ts->data = usb_alloc_coherent(usb_ts->usbdev, 10, GFP_KERNEL, &usb_ts->data_dma);
+ if (!usb_ts->data) {
+ goto fail1;
+ }
+
+ usb_ts->irq = usb_alloc_urb(0, GFP_KERNEL);
+ if (!usb_ts->irq) {
+ goto fail2;
+ }
+
+ usb_ts->emuldev = input_allocate_device();
+ if (!usb_ts->emuldev) {
+ goto fail1;
+ }
+
+ usb_ts->intf = intf;
+
+ mutex_init(&usb_ts->lock);
+ usb_make_path(usb_ts->usbdev, usb_ts->phys, sizeof(usb_ts->phys));
+ strlcat(usb_ts->phys, "/input0", sizeof(usb_ts->phys));
+
+ usb_ts->emuldev->name = "Maru Virtual Touchscreen";
+ usb_to_input_id(usb_ts->usbdev, &usb_ts->emuldev->id);
+
+ usb_ts->emuldev->dev.parent = &intf->dev;
+
+ input_set_drvdata(usb_ts->emuldev, usb_ts);
+
+ usb_ts->emuldev->open = emul_touchscreen_open;
+ usb_ts->emuldev->close = emul_touchscreen_close;
+
+ endpoint = &intf->cur_altsetting->endpoint[0].desc;
+
+ usb_ts->emuldev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+ usb_ts->emuldev->absbit[BIT_WORD(ABS_MISC)] |= BIT_MASK(ABS_MISC);
+ usb_ts->emuldev->keybit[BIT_WORD(BTN_TOUCH)] |= BIT_MASK(BTN_TOUCH);
+
+ input_set_abs_params(usb_ts->emuldev, ABS_X, 0, TOUCHSCREEN_RESOLUTION_X, 4, 0);
+ input_set_abs_params(usb_ts->emuldev, ABS_Y, 0, TOUCHSCREEN_RESOLUTION_Y, 4, 0);
+
+ /* for multitouch */
+ input_set_abs_params(usb_ts->emuldev, ABS_MT_TRACKING_ID, 0, 1, 0, 0);
+ input_set_abs_params(usb_ts->emuldev, ABS_MT_TOUCH_MAJOR, 0, ABS_PRESSURE_MAX, 0, 0);
+ input_set_abs_params(usb_ts->emuldev, ABS_MT_POSITION_X, 0, TOUCHSCREEN_RESOLUTION_X, 0, 0);
+ input_set_abs_params(usb_ts->emuldev, ABS_MT_POSITION_Y, 0, TOUCHSCREEN_RESOLUTION_Y, 0, 0);
+
+ usb_fill_int_urb(usb_ts->irq, usb_ts->usbdev,
+ usb_rcvintpipe(usb_ts->usbdev, endpoint->bEndpointAddress),
+ usb_ts->data, EMUL_TOUCHSCREEN_PACKET_LEN,
+ emul_touchscreen_sys_irq, usb_ts, endpoint->bInterval);
+ usb_ts->irq->transfer_dma = usb_ts->data_dma;
+ usb_ts->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
+
+ error = input_register_device(usb_ts->emuldev);
+ if (error) {
+ goto fail3;
+ }
+
+ usb_set_intfdata(intf, usb_ts);
+ return 0;
+
+ fail3: usb_free_urb(usb_ts->irq);
+ fail2: usb_free_coherent(usb_ts->usbdev, 10, usb_ts->data, usb_ts->data_dma);
+ fail1: input_free_device(usb_ts->emuldev);
+ kfree(usb_ts);
+ return error;
+}
+
+static void emul_touchscreen_disconnect(struct usb_interface *intf)
+{
+ struct emul_touchscreen *usb_ts = usb_get_intfdata(intf);
+
+ usb_set_intfdata(intf, NULL);
+ if (usb_ts) {
+ usb_kill_urb(usb_ts->irq);
+ input_unregister_device(usb_ts->emuldev);
+ usb_free_urb(usb_ts->irq);
+ usb_free_coherent(interface_to_usbdev(intf), 10, usb_ts->data, usb_ts->data_dma);
+ kfree(usb_ts);
+ }
+}
+
+static int emul_touchscreen_suspend(struct usb_interface *intf, pm_message_t message)
+{
+ struct emul_touchscreen *usb_ts = usb_get_intfdata(intf);
+
+ mutex_lock(&usb_ts->lock);
+ usb_kill_urb(usb_ts->irq);
+ mutex_unlock(&usb_ts->lock);
+
+ return 0;
+}
+
+static int emul_touchscreen_resume(struct usb_interface *intf)
+{
+ struct emul_touchscreen *usb_ts = usb_get_intfdata(intf);
+ int rv;
+
+ mutex_lock(&usb_ts->lock);
+ if (usb_ts->open) {
+ rv = usb_submit_urb(usb_ts->irq, GFP_NOIO);
+ } else {
+ rv = 0;
+ }
+ mutex_unlock(&usb_ts->lock);
+
+ return rv;
+}
+
+static struct usb_device_id emul_usb_touchscreen_table[] = {
+ { USB_DEVICE(0x056a, 0x00) },
+ { } /* Terminating entry */
+};
+
+MODULE_DEVICE_TABLE(usb, emul_usb_touchscreen_table);
+
+static struct usb_driver emul_touchscreen_driver = {
+ .name = "usb-emul-touchscreen",
+ .id_table = emul_usb_touchscreen_table,
+ .probe = emul_touchscreen_probe,
+ .disconnect = emul_touchscreen_disconnect,
+ .suspend = emul_touchscreen_suspend,
+ .resume = emul_touchscreen_resume,
+ .reset_resume = emul_touchscreen_resume,
+ .supports_autosuspend = 1,
+};
+
+static int __init emul_touchscreen_init(void)
+{
+ int result = usb_register(&emul_touchscreen_driver);
+ if (result == 0) {
+ printk(KERN_ERR "emul_touchscreen_init: usb_register=%d\n", result);
+ }
+
+ return result;
+}
+
+static void __exit emul_touchscreen_exit(void)
+{
+ usb_deregister(&emul_touchscreen_driver);
+}
+
+module_init(emul_touchscreen_init);
+module_exit(emul_touchscreen_exit);
--- /dev/null
+/*\r
+ * Virtual device node for event injector of emulator\r
+ *\r
+ * Copyright (c) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact:\r
+ * Sungmin Ha <sungmin82.ha@samsung.com>\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\r
+ *\r
+ * Contributors:\r
+ * - S-Core Co., Ltd\r
+ */\r
+\r
+#include <linux/kernel.h>\r
+#include <linux/module.h>\r
+#include <linux/device.h>\r
+#include <linux/platform_device.h>\r
+#include <linux/slab.h>\r
+\r
+static char mode[1024];\r
+static char file0[1024];\r
+static char file1[1024];\r
+\r
+u64 file0_mask = 0x0000000000000000;\r
+u64 file1_mask = 0x0000000000000001;\r
+\r
+struct my_data {\r
+ int no;\r
+ char test[50];\r
+};\r
+\r
+static ssize_t show_mode(struct device *dev, \r
+ struct device_attribute *attr, char *buf) \r
+{\r
+ printk("[%s] \n", __FUNCTION__);\r
+ return snprintf(buf, PAGE_SIZE, "%s", mode);\r
+}\r
+\r
+static ssize_t store_mode(struct device *dev, \r
+ struct device_attribute *attr, const char *buf, size_t count) \r
+{\r
+ printk("[%s] \n", __FUNCTION__);\r
+ sscanf(buf, "%s", mode);\r
+ return strnlen(buf, PAGE_SIZE);\r
+}\r
+\r
+static ssize_t show_file(struct device *dev, \r
+ struct device_attribute *attr, char *buf) \r
+{\r
+ ssize_t ret = 0;\r
+ printk("[%s] \n", __FUNCTION__);\r
+ if(*(dev->dma_mask) == file0_mask)\r
+ ret = snprintf(buf, PAGE_SIZE, "%s", file0);\r
+ else\r
+ ret = snprintf(buf, PAGE_SIZE, "%s", file1);\r
+\r
+ return ret;\r
+}\r
+\r
+static ssize_t store_file(struct device *dev, \r
+ struct device_attribute *attr, const char *buf, size_t count) \r
+{\r
+ size_t ret;\r
+ printk("[%s]\n", __FUNCTION__);\r
+ if(*(dev->dma_mask) == file0_mask)\r
+ sscanf(buf, "%s", file0);\r
+ else\r
+ sscanf(buf, "%s", file1);\r
+ \r
+ ret = strnlen(buf, PAGE_SIZE);\r
+ if(ret == 0)\r
+ return 1;\r
+ else\r
+ return strnlen(buf, PAGE_SIZE);\r
+}\r
+\r
+static DEVICE_ATTR(mode, S_IRUGO | S_IWUSR, show_mode, store_mode);\r
+static DEVICE_ATTR(file, S_IRUGO | S_IWUSR, show_file, store_file);\r
+\r
+static int sysfs_lun0_create_file(struct device *dev) \r
+{\r
+ int result = 0;\r
+\r
+ printk("[%d] [%s] \n", __LINE__, __FUNCTION__);\r
+\r
+ result = device_create_file(dev, &dev_attr_mode);\r
+ if (result){\r
+ printk("[%d] [%s] error \n", __LINE__, __FUNCTION__);\r
+ return result;\r
+ }\r
+\r
+ result = device_create_file(dev, &dev_attr_file);\r
+ if (result){\r
+ printk("[%d] [%s] error \n", __LINE__, __FUNCTION__);\r
+ return result;\r
+ }\r
+\r
+ return 0;\r
+}\r
+\r
+static int sysfs_lun1_create_file(struct device *dev) \r
+{\r
+ int result = 0;\r
+\r
+ printk("[%d] [%s] \n", __LINE__, __FUNCTION__);\r
+\r
+ result = device_create_file(dev, &dev_attr_file);\r
+ if (result){\r
+ printk("[%d] [%s] error \n", __LINE__, __FUNCTION__);\r
+ return result;\r
+ }\r
+\r
+ return 0;\r
+}\r
+\r
+static void sysfs_test_dev_release(struct device *dev) {}\r
+static void sysfs_test_dev_release_lun0(struct device *dev) {}\r
+\r
+static struct platform_device the_pdev = {\r
+ .name = "usb_mass_storage",\r
+ .id = -1,\r
+ .dev = {\r
+ .release = sysfs_test_dev_release,\r
+ }\r
+};\r
+\r
+static struct platform_device the_pdev_sub1 = {\r
+ .name = "lun0",\r
+ .id = -1, \r
+ .dev = {\r
+ .release = sysfs_test_dev_release_lun0,\r
+ .parent = &the_pdev.dev,\r
+ .dma_mask = &file0_mask,\r
+ }\r
+};\r
+\r
+static struct platform_device the_pdev_sub2 = {\r
+ .name = "lun1",\r
+ .id = -1, \r
+ .dev = {\r
+ .release = sysfs_test_dev_release_lun0,\r
+ .parent = &the_pdev.dev,\r
+ .dma_mask = &file1_mask,\r
+ }\r
+};\r
+\r
+static int __init sysfs_test_init(void) \r
+{\r
+ int err = 0;\r
+ struct my_data *data;\r
+\r
+ printk("[%s] \n", __FUNCTION__);\r
+\r
+ memset(mode, 0, sizeof(mode));\r
+ memset(file0, 0, sizeof(file0));\r
+ memset(file1, 0, sizeof(file1));\r
+\r
+ err = platform_device_register(&the_pdev);\r
+ if (err) {\r
+ printk("platform_device_register error\n");\r
+ return err;\r
+ }\r
+\r
+ err = platform_device_register(&the_pdev_sub1);\r
+ if (err) {\r
+ printk("platform_device_register error\n");\r
+ return err;\r
+ }\r
+\r
+ err = platform_device_register(&the_pdev_sub2);\r
+ if (err) {\r
+ printk("platform_device_register error\n");\r
+ return err;\r
+ }\r
+\r
+ data = kzalloc(sizeof(struct my_data), GFP_KERNEL);\r
+ if (!data) {\r
+ printk("[%s] kzalloc error\n", __FUNCTION__);\r
+ err = -ENOMEM;\r
+ goto alloc_err;\r
+ }\r
+\r
+ dev_set_drvdata(&the_pdev.dev, (void*)data);\r
+ dev_set_drvdata(&the_pdev_sub1.dev, (void*)data);\r
+ dev_set_drvdata(&the_pdev_sub2.dev, (void*)data);\r
+\r
+ err = sysfs_lun0_create_file(&the_pdev_sub1.dev);\r
+ if (err) {\r
+ printk("sysfs_create_file error\n");\r
+ goto sysfs_err;\r
+ }\r
+ \r
+ err = sysfs_lun1_create_file(&the_pdev_sub2.dev);\r
+ if (err) {\r
+ printk("sysfs_create_file error\n");\r
+ goto sysfs_err;\r
+ }\r
+\r
+ return 0;\r
+\r
+sysfs_err:\r
+ kfree(data);\r
+\r
+alloc_err:\r
+ platform_device_unregister(&the_pdev);\r
+ return err;\r
+}\r
+\r
+static void __exit sysfs_test_exit(void) \r
+{\r
+ void *data = dev_get_drvdata(&the_pdev.dev);\r
+\r
+ printk("[%s] \n", __FUNCTION__);\r
+\r
+ kfree(data);\r
+ platform_device_unregister(&the_pdev_sub2);\r
+ platform_device_unregister(&the_pdev_sub1);\r
+ platform_device_unregister(&the_pdev);\r
+}\r
+\r
+module_init(sysfs_test_init);\r
+module_exit(sysfs_test_exit);\r
+\r
+\r
+MODULE_LICENSE("GPL");\r
+\r
+\r
--- /dev/null
+/*\r
+ * Virtual device node for event injector of emulator\r
+ *\r
+ * Copyright (c) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved.\r
+ *\r
+ * Contact:\r
+ * Sungmin Ha <sungmin82.ha@samsung.com>\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\r
+ *\r
+ * Contributors:\r
+ * - S-Core Co., Ltd\r
+ */\r
+\r
+#include <linux/kernel.h>\r
+#include <linux/module.h>\r
+#include <linux/device.h>\r
+#include <linux/platform_device.h>\r
+#include <linux/slab.h>\r
+\r
+int UsbMenuSel = 0;\r
+\r
+struct my_data {\r
+ int no;\r
+ char test[50];\r
+};\r
+\r
+static ssize_t show_UsbMenuSel(struct device *dev, \r
+ struct device_attribute *attr, char *buf) \r
+{\r
+ printk("[%s] \n", __FUNCTION__);\r
+ return snprintf(buf, PAGE_SIZE, "%d", UsbMenuSel);\r
+}\r
+\r
+static ssize_t store_UsbMenuSel(struct device *dev, \r
+ struct device_attribute *attr, const char *buf, size_t count) \r
+{\r
+ printk("[%s] \n", __FUNCTION__);\r
+ sscanf(buf, "%d", &UsbMenuSel);\r
+ return strnlen(buf, PAGE_SIZE);\r
+}\r
+\r
+static DEVICE_ATTR(UsbMenuSel, S_IRUGO | S_IWUSR, show_UsbMenuSel, store_UsbMenuSel);\r
+\r
+static int sysfs_test_create_file(struct device *dev) \r
+{\r
+ int result = 0;\r
+\r
+ printk("[%d] [%s] \n", __LINE__, __FUNCTION__);\r
+\r
+ result = device_create_file(dev, &dev_attr_UsbMenuSel);\r
+ if (result){\r
+ printk("[%d] [%s] error \n", __LINE__, __FUNCTION__);\r
+ return result;\r
+ }\r
+\r
+ return 0;\r
+}\r
+\r
+\r
+static void sysfs_test_remove_file(struct device *dev) \r
+{\r
+ printk("[%s] \n", __FUNCTION__);\r
+ device_remove_file(dev, &dev_attr_UsbMenuSel);\r
+}\r
+\r
+static void sysfs_test_dev_release(struct device *dev) {}\r
+\r
+static struct platform_device the_pdev = {\r
+ .name = "usb_mode",\r
+ .id = -1,\r
+ .dev = {\r
+ .release = sysfs_test_dev_release,\r
+ }\r
+};\r
+\r
+static int __init sysfs_test_init(void) \r
+{\r
+ int err = 0;\r
+ struct my_data *data;\r
+\r
+ printk("[%s] \n", __FUNCTION__);\r
+\r
+ err = platform_device_register(&the_pdev);\r
+ if (err) {\r
+ printk("platform_device_register error\n");\r
+ return err;\r
+ }\r
+\r
+ data = kzalloc(sizeof(struct my_data), GFP_KERNEL);\r
+ if (!data) {\r
+ printk("[%s] kzalloc error\n", __FUNCTION__);\r
+ err = -ENOMEM;\r
+ goto alloc_err;\r
+ }\r
+\r
+ dev_set_drvdata(&the_pdev.dev, (void*)data);\r
+\r
+ err = sysfs_test_create_file(&the_pdev.dev);\r
+ if (err) {\r
+ printk("sysfs_create_file error\n");\r
+ goto sysfs_err;\r
+ }\r
+\r
+ return 0;\r
+\r
+sysfs_err:\r
+ kfree(data);\r
+\r
+alloc_err:\r
+ platform_device_unregister(&the_pdev);\r
+ return err;\r
+}\r
+\r
+static void __exit sysfs_test_exit(void) \r
+{\r
+ void *data = dev_get_drvdata(&the_pdev.dev);\r
+\r
+ printk("[%s] \n", __FUNCTION__);\r
+\r
+ kfree(data);\r
+ sysfs_test_remove_file(&the_pdev.dev);\r
+ platform_device_unregister(&the_pdev);\r
+}\r
+\r
+module_init(sysfs_test_init);\r
+module_exit(sysfs_test_exit);\r
+\r
+\r
+MODULE_LICENSE("GPL");\r
+\r
+\r
static struct scsi_driver sd_template = {
.owner = THIS_MODULE,
.gendrv = {
- .name = "sd",
+// .name = "sd",
+ .name = "mmcblk",
.probe = sd_probe,
.remove = sd_remove,
.suspend = sd_suspend,
* unknown amount of data was transferred so treat it as an
* error.
*/
- scsi_print_sense("sd", SCpnt);
+// scsi_print_sense("sd", SCpnt);
+ scsi_print_sense("mmcblk", SCpnt);
SCpnt->result = 0;
memset(SCpnt->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
break;
*/
static int sd_format_disk_name(char *prefix, int index, char *buf, int buflen)
{
- const int base = 'z' - 'a' + 1;
+// const int base = 'z' - 'a' + 1;
+ const int base = '9' - '0' + 1;
char *begin = buf + strlen(prefix);
char *end = buf + buflen;
char *p;
do {
if (p == begin)
return -EINVAL;
- *--p = 'a' + (index % unit);
+// *--p = 'a' + (index % unit);
+ *--p = '0' + (index % unit);
index = (index / unit) - 1;
} while (index >= 0);
goto out_put;
}
- error = sd_format_disk_name("sd", index, gd->disk_name, DISK_NAME_LEN);
+// error = sd_format_disk_name("sd", index, gd->disk_name, DISK_NAME_LEN);
+ error = sd_format_disk_name("mmcblk", index, gd->disk_name, DISK_NAME_LEN);
if (error) {
sdev_printk(KERN_WARNING, sdp, "SCSI disk (sd) name length exceeded.\n");
goto out_free_index;
SCSI_LOG_HLQUEUE(3, printk("init_sd: sd driver entry point\n"));
for (i = 0; i < SD_MAJORS; i++)
- if (register_blkdev(sd_major(i), "sd") == 0)
+// if (register_blkdev(sd_major(i), "sd") == 0)
+ if (register_blkdev(sd_major(i), "mmcblk") == 0)
majors++;
if (!majors)
class_unregister(&sd_disk_class);
err_out:
for (i = 0; i < SD_MAJORS; i++)
- unregister_blkdev(sd_major(i), "sd");
+// unregister_blkdev(sd_major(i), "sd");
+ unregister_blkdev(sd_major(i), "mmcblk");
return err;
}
class_unregister(&sd_disk_class);
for (i = 0; i < SD_MAJORS; i++)
- unregister_blkdev(sd_major(i), "sd");
+// unregister_blkdev(sd_major(i), "sd");
+ unregister_blkdev(sd_major(i), "mmcblk");
}
module_init(init_sd);
group_info = cred->group_info;
task_unlock(p);
- for (g = 0; g < min(group_info->ngroups, NGROUPS_SMALL); g++)
+// for (g = 0; g < min(group_info->ngroups, NGROUPS_SMALL); g++)
+ for (g = 0; g < group_info->ngroups; g++)
seq_printf(m, "%d ", GROUP_AT(group_info, g));
put_cred(cred);
--- /dev/null
+#ifndef LINUX_INPUT_SEC_INPUT_BRIDGE_H
+#define LINUX_INPUT_SEC_INPUT_BRIDGE_H
+
+#include <linux/kobject.h>
+
+enum mkey_check_option {
+ MKEY_CHECK_AUTO,
+ MKEY_CHECK_AWAYS
+};
+
+struct sec_input_bridge_mkey {
+ unsigned int type;
+ unsigned int code;
+ enum mkey_check_option option;
+};
+
+struct sec_input_bridge_platform_data {
+ void (*pre_event_func)(void *event_data);
+ void *event_data;
+
+ const struct sec_input_bridge_mkey *mkey_map;
+ unsigned int num_mkey;
+
+ unsigned char send_uevent;
+ enum kobject_action uevent_action;
+ const char *uevent_env_str;
+ const char *uevent_env_value;
+};
+
+#endif /* LINUX_INPUT_SEC_INPUT_BRIDGE_H */
+
#define PCI_VENDOR_ID_SAMSUNG 0x144d
+#define PCI_VENDOR_ID_TIZEN 0xC9B5
+#define PCI_DEVICE_ID_VIRTUAL_OVERLAY 0x1010
+#define PCI_DEVICE_ID_VIRTUAL_BRIGHTNESS 0x1014
+#define PCI_DEVICE_ID_VIRTUAL_CAMERA 0x1018
+#define PCI_DEVICE_ID_VIRTUAL_CODEC 0x101C
+
#define PCI_VENDOR_ID_GIGABYTE 0x1458
#define PCI_VENDOR_ID_AMBIT 0x1468
#define VIRTIO_ID_CONSOLE 3 /* virtio console */
#define VIRTIO_ID_RNG 4 /* virtio ring */
#define VIRTIO_ID_BALLOON 5 /* virtio balloon */
+#define VIRTIO_ID_GL 6 /* virtio usermem */
#define VIRTIO_ID_RPMSG 7 /* virtio remote processor messaging */
#define VIRTIO_ID_SCSI 8 /* virtio scsi */
#define VIRTIO_ID_9P 9 /* 9p virtio console */
static ssize_t state_store(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t n)
{
+#if 0 // do not allow suspend in emulator
+
#ifdef CONFIG_SUSPEND
suspend_state_t state = PM_SUSPEND_STANDBY;
const char * const *s;
Exit:
return error ? error : n;
+#else
+
+ return n;
+#endif // do not allow suspend in emulator
}
power_attr(state);
SYSCALL_DEFINE1(newuname, struct new_utsname __user *, name)
{
int errno = 0;
+#ifdef CONFIG_MARU
+ struct new_utsname u;
+ down_read(&uts_sem);
+ memcpy(&u, utsname(), sizeof *name);
+ up_read(&uts_sem);
+
+ strcat(u.machine, "_emulated");
+
+ if (copy_to_user(name, &u, sizeof *name))
+ errno = -EFAULT;
+#else
down_read(&uts_sem);
if (copy_to_user(name, utsname(), sizeof *name))
errno = -EFAULT;
up_read(&uts_sem);
-
+#endif
if (!errno && override_release(name->release, sizeof(name->release)))
errno = -EFAULT;
if (!errno && override_architecture(name))
/*
* Periodic tick
*/
+#define UNDER_HYPERVISOR
static void tick_periodic(int cpu)
{
if (tick_do_timer_cpu == cpu) {
/* Keep track of the next tick event */
tick_next_period = ktime_add(tick_next_period, tick_period);
+ #ifdef UNDER_HYPERVISOR
+ { /* Compensate slow timer tick under hypervisor */
+ static __kernel_time_t rt_sec;
+ static unsigned short rt_jiffies_sec = HZ;
+ static unsigned short rt_ticks_sec = HZ;
+ static unsigned short rt_jiffies = 0;
+ static unsigned short rt_ticks = 0;
+ static unsigned short rt_count = 1;
+// static unsigned short rt_log[11] = {0};
+
+ unsigned long tick = rt_jiffies_sec * ++rt_ticks / rt_ticks_sec - rt_jiffies;
+ if (rt_jiffies + tick > rt_jiffies_sec + (HZ/4) )
+ tick = (rt_jiffies + tick > rt_jiffies_sec + HZ) ? 0 : 1;
+
+ rt_jiffies += tick;
+ do_timer(tick);
+
+ if (0 == --rt_count) {
+ static int first = 2;
+
+ struct timespec ts;
+ read_persistent_clock(&ts);
+
+ if (rt_sec != ts.tv_sec) {
+/* rt_log[++rt_log[0]] = rt_ticks;
+ if (rt_log[0] == 10) {
+ rt_log[0] = 0;
+ printk(KERN_ERR "tick_count : %d %d %d %d %d %d %d %d %d %d\n",
+ rt_log[1], rt_log[2], rt_log[3], rt_log[4], rt_log[5],
+ rt_log[6], rt_log[7], rt_log[8], rt_log[9], rt_log[10]);
+ }
+*/
+ if (!first) {
+ rt_jiffies_sec = HZ + rt_jiffies_sec - rt_jiffies;
+ rt_ticks_sec = rt_ticks ;
+ } else {
+ first--;
+ }
+
+ rt_sec = ts.tv_sec;
+ rt_ticks = rt_jiffies = 0;
+ }
+
+ rt_count = (!first && rt_ticks_sec > rt_ticks + 3) ? (rt_ticks_sec - rt_ticks) >> 2 : 1;
+ }
+ }
+ #else
do_timer(1);
+ #endif /* End of UNDER_HYPERVISOR */
+
write_sequnlock(&xtime_lock);
}
--- /dev/null
+#!/bin/sh -xe
+# clean
+clean()
+{
+ echo "$SRCDIR"
+ make clean
+ rm -rf $SRCDIR/*.zip
+ rm -rf $SRCDIR/*.tar.gz
+}
+
+# build
+build()
+{
+ make i386_emul_defconfig
+ make
+}
+
+# install
+install()
+{
+ if [ "$BUILD_TARGET_OS" = "linux" ]
+ then
+ BIN_DIR=$SRCDIR/package/emulator-kernel.package.linux/data/Emulator/x86/data/kernel-img
+ else
+ BIN_DIR=$SRCDIR/package/emulator-kernel.package.windows/data/Emulator/x86/data/kernel-img
+ fi
+ mkdir -p $BIN_DIR
+
+ cp arch/x86/boot/bzImage $BIN_DIR
+}
+
+[ "$1" = "clean" ] && clean
+[ "$1" = "build" ] && build
+[ "$1" = "install" ] && install
+
+echo "success"
--- /dev/null
+Package: emulator-kernel
+Version: 1.1.15
+OS: linux
+Build-host-os: linux
+Maintainer: Yeong-Kyoon, Lee <yeongkyoon.lee@samsung.com>
+Source: emulator-kernel
+Description: Tizen Emulator Kernel
+
+Package: emulator-kernel
+Version: 1.1.15
+OS: windows
+Build-host-os: linux
+Maintainer: Yeong-Kyoon, Lee <yeongkyoon.lee@samsung.com>
+Source: emulator-kernel
+Description: Tizen Emulator Kernel
--- /dev/null
+#!/bin/sh
+
+#
+# Copyright (C) 2010 Samsung Electronics
+# Kyungmin Park <kyungmin.park@samsung.com>
+#
+NEW_ROOT=/new_root
+NEW_INIT="/sbin/init"
+CONSOLE="/dev/console"
+
+mount -t proc proc /proc
+cmdline=`/bin/cat /proc/cmdline`
+
+echo
+echo "Kernel command line is: $cmdline"
+echo
+
+for element in $cmdline
+do
+ case "$element" in
+ nfsroot=*)
+ nfsroot=${element#nfsroot=}
+ ;;
+ ip=*)
+ ip=${element#ip=}
+ ;;
+ root=*)
+ root=${element#root=}
+ ;;
+ esac
+done
+
+# mount nfs root if necessary
+if test "x$nfsroot" != "x"
+then
+ nfsopt="${nfsroot#*,}"
+ nfsroot="${nfsroot%%,*}"
+ if test "x$nfsroot" != "x"; then
+ nfsopt="-o $nfsopt"
+ fi
+ echo "Mounting root $nfsroot port $nfsport"
+ echo /bin/nfsmount $nfsopt "$nfsroot" /new_root
+ /bin/nfsmount $nfsopt "$nfsroot" /new_root
+else
+ echo "Image mount"
+ mount -o rw /dev/vda /new_root
+fi
+
+echo "create device filesystem"
+
+# create device filesystem
+/bin/mkdir -p /new_root/dev
+/bin/mount -t ramfs ramfs /new_root/dev
+
+/bin/mknod /new_root/dev/ram0 c 1 0
+/bin/mknod /new_root/dev/mem c 1 1
+/bin/mknod /new_root/dev/kmem c 1 2
+/bin/mknod /new_root/dev/null c 1 3
+/bin/mknod /new_root/dev/zero c 1 5
+/bin/mknod /new_root/dev/random c 1 8
+/bin/mknod /new_root/dev/urandom c 1 9
+
+#/bin/mknod /new_root/dev/hda b 3 0
+#/bin/mknod /new_root/dev/hdb b 3 64
+
+#filesystem in userspace
+/bin/mknod /new_root/dev/fuse c 10 229
+
+/bin/mknod /new_root/dev/tty0 c 4 0
+/bin/mknod /new_root/dev/tty1 c 4 1
+/bin/mknod /new_root/dev/tty2 c 4 2
+/bin/mknod /new_root/dev/tty3 c 4 3
+/bin/mknod /new_root/dev/tty4 c 4 4
+/bin/mknod /new_root/dev/tty5 c 4 5
+/bin/mknod /new_root/dev/tty6 c 4 6
+/bin/mknod /new_root/dev/tty7 c 4 7
+
+/bin/mknod /new_root/dev/ttyS0 c 4 64
+/bin/mknod /new_root/dev/ttyS1 c 4 65
+/bin/mknod /new_root/dev/ttyS2 c 4 66
+
+/bin/mknod /new_root/dev/tty c 5 0
+/bin/mknod /new_root/dev/console c 5 1
+/bin/mknod /new_root/dev/ptmx c 5 2
+
+/bin/mknod /new_root/dev/sda b 8 0
+/bin/mknod /new_root/dev/sda1 b 8 1
+
+#/bin/mknod /new_root/dev/log_radio c 10 60
+#/bin/mknod /new_root/dev/log_events c 10 61
+#/bin/mknod /new_root/dev/log_main c 10 62
+#/bin/mknod /new_root/dev/log_system c 10 59
+
+/bin/mkdir -p /new_root/dev/input
+/bin/mknod /new_root/dev/input/mouse0 c 13 32
+/bin/mknod /new_root/dev/input/mouse1 c 13 33
+/bin/mknod /new_root/dev/input/event0 c 13 64
+/bin/mknod /new_root/dev/input/event1 c 13 65
+/bin/mknod /new_root/dev/input/event2 c 13 66
+/bin/mknod /new_root/dev/input/event3 c 13 67
+/bin/mknod /new_root/dev/input/event4 c 13 68
+(cd /new_root/dev/input && /bin/ln -s event1 touchscreen0)
+(cd /new_root/dev/input && /bin/ln -s event2 keyboard0)
+(cd /new_root/dev && /bin/ln -s input/event3 smotion)
+
+/bin/mknod /new_root/dev/mixer c 14 0
+/bin/mknod /new_root/dev/sequencer c 14 1
+/bin/mknod /new_root/dev/midi00 c 14 2
+/bin/mknod /new_root/dev/dsp c 14 3
+/bin/mknod /new_root/dev/sndstat c 14 6
+/bin/mknod /new_root/dev/mixer1 c 14 16
+/bin/mknod /new_root/dev/midi01 c 14 18
+/bin/mknod /new_root/dev/dsp1 c 14 19
+/bin/mknod /new_root/dev/mixer2 c 14 32
+/bin/mknod /new_root/dev/midi02 c 14 34
+/bin/mknod /new_root/dev/dsp2 c 14 35
+/bin/mknod /new_root/dev/mixer3 c 14 48
+/bin/mknod /new_root/dev/midi03 c 14 50
+/bin/mknod /new_root/dev/dsp3 c 14 51
+
+/bin/mknod /new_root/dev/hdc b 22 0
+/bin/mknod /new_root/dev/hdd b 22 64
+
+/bin/mknod /new_root/dev/fb0 c 29 0
+/bin/mknod /new_root/dev/fb1 c 29 1
+/bin/mknod /new_root/dev/fb2 c 29 2
+/bin/mknod /new_root/dev/fb3 c 29 3
+
+/bin/mknod /new_root/dev/mtdblock0 b 31 0
+/bin/mknod /new_root/dev/mtdblock1 b 31 1
+/bin/mknod /new_root/dev/mtdblock2 b 31 2
+/bin/mknod /new_root/dev/mtdblock3 b 31 3
+/bin/mknod /new_root/dev/mtdblock4 b 31 4
+
+/bin/mknod /new_root/dev/video0 c 81 0
+/bin/mknod /new_root/dev/video1 c 81 1
+/bin/mknod /new_root/dev/video2 c 81 2
+
+/bin/mknod /new_root/dev/mtd0 b 90 0
+/bin/mknod /new_root/dev/mtd1 b 90 2
+/bin/mknod /new_root/dev/mtd2 b 90 4
+/bin/mknod /new_root/dev/mtd3 b 90 6
+/bin/mknod /new_root/dev/mtd4 b 90 8
+
+/bin/mknod /new_root/dev/ttygs c 127 0
+
+/bin/mkdir -p /new_root/dev/pts
+/bin/mknod /new_root/dev/pts/0 c 136 0
+/bin/mknod /new_root/dev/pts/1 c 136 1
+/bin/mknod /new_root/dev/pts/2 c 136 2
+/bin/mknod /new_root/dev/pts/3 c 136 3
+/bin/mknod /new_root/dev/pts/4 c 136 4
+
+/bin/mkdir -p /new_root/dev/dpram
+/bin/mknod /new_root/dev/dpram/0 c 249 0
+/bin/mknod /new_root/dev/vdpram1 c 249 1
+
+/bin/mkdir -p /new_root/dev/input
+
+# commented out by caramis...
+#/bin/mkdir -p /new_root/dev/snd
+#/bin/mknod -m 660 /new_root/dev/snd/controlC0 c 116 7
+#/bin/mknod -m 660 /new_root/dev/snd/pcmC0D0c c 116 6
+#/bin/mknod -m 660 /new_root/dev/snd/pcmC0D0p c 116 5
+#/bin/mknod -m 660 /new_root/dev/snd/pcmC0D1p c 116 4
+#/bin/mknod -m 660 /new_root/dev/snd/timer c 116 2
+
+/bin/mknod /new_root/dev/vda b 254 0
+/bin/mknod /new_root/dev/vdb b 254 16
+(cd /new_root/dev && /bin/ln -sf vdb mmcblk0)
+(cd /new_root/dev && /bin/ln -sf vdb1 mmcblk0p1)
+(cd /new_root/dev && /bin/ln -sf vdb2 mmcblk0p2)
+(cd /new_root/dev && /bin/ln -sf vdb3 mmcblk0p3)
+
+#echo "Create sys"
+/bin/mkdir -p /new_root/sys
+
+#/bin/mknod /new_root/dev/opengl c 240 0
+/bin/mknod -m 666 /new_root/dev/codec c 240 0
+
+
+>${CONSOLE} <${CONSOLE} 2>&1
+
+echo "Switching root"
+exec switch_root -c ${CONSOLE} ${NEW_ROOT} ${NEW_INIT}
--- /dev/null
+dir /dev 0755 0 0
+nod /dev/console 0600 0 0 c 5 1
+nod /dev/tty1 0600 0 0 c 4 1
+nod /dev/zero 0600 0 0 c 1 5
+nod /dev/mem 0600 0 0 c 1 1
+nod /dev/vda 0600 0 0 b 254 0
+dir /root 0700 0 0
+dir /sbin 0755 0 0
+file /sbin/v86d ramfs/v86d 0755 0 0
+
+dir /bin 0755 0 0
+dir /new_root 0755 0 0
+dir /proc 0755 0 0
+
+
+file /bin/busybox ramfs/busybox 0755 0 0
+file /init ramfs/init 0755 0 0
+file /bin/nfsmount ramfs/nfsmount 0755 0 0
+slink /sbin/init /bin/busybox 0755 0 0
+slink /bin/sh /bin/busybox 0755 0 0
+slink /bin/mount /bin/busybox 0755 0 0
+slink /bin/insmod /bin/busybox 0755 0 0
+slink /bin/cat /bin/busybox 0755 0 0
+slink /bin/cp /bin/busybox 0755 0 0
+slink /bin/switch_root /bin/busybox 0755 0 0
+slink /bin/mknod /bin/busybox 0755 0 0
+slink /bin/mkdir /bin/busybox 0755 0 0
+slink /bin/ln /bin/busybox 0755 0 0
+