htcherald: Add default kernel configuration for Herald
Subsystems (8)
PATCH 3/3 htcherald: Add default kernel configuration for Herald
This adds a new defconfig for the HTC Herald series of devices.
--- arch/arm/configs/htcherald_defconfig | 1142 ++++++++++++++++++++++++++++++++++ 1 files changed, 1142 insertions(+), 0 deletions(-) create mode 100644 arch/arm/configs/htcherald_defconfig
arch/arm/configs/htcherald_defconfig new file +1142 -0
@@ -0,0 +1,1142 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.32-rc6 +# Sat Nov 14 10:56:01 2009 +# +CONFIG_ARM=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_GENERIC_GPIO=y +CONFIG_GENERIC_TIME=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_HARDIRQS=y +CONFIG_STACKTRACE_SUPPORT=y +CONFIG_HAVE_LATENCYTOP_SUPPORT=y +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_ARCH_HAS_CPUFREQ=y +CONFIG_GENERIC_HWEIGHT=y +CONFIG_GENERIC_CALIBRATE_DELAY=y +CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y +CONFIG_VECTORS_BASE=0xffff0000 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" +CONFIG_CONSTRUCTORS=y + +# +# General setup +# +CONFIG_EXPERIMENTAL=y +CONFIG_BROKEN_ON_SMP=y +CONFIG_LOCK_KERNEL=y +CONFIG_INIT_ENV_ARG_LIMIT=32 +CONFIG_LOCALVERSION="" +CONFIG_LOCALVERSION_AUTO=y +CONFIG_SWAP=y +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +# CONFIG_POSIX_MQUEUE is not set +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_TASKSTATS is not set +# CONFIG_AUDIT is not set + +# +# RCU Subsystem +# +CONFIG_TREE_RCU=y +# CONFIG_TREE_PREEMPT_RCU is not set +# CONFIG_RCU_TRACE is not set +CONFIG_RCU_FANOUT=32 +# CONFIG_RCU_FANOUT_EXACT is not set +# CONFIG_TREE_RCU_TRACE is not set +# CONFIG_IKCONFIG is not set +CONFIG_LOG_BUF_SHIFT=14 +# CONFIG_GROUP_SCHED is not set +# CONFIG_CGROUPS is not set +# CONFIG_SYSFS_DEPRECATED_V2 is not set +# CONFIG_RELAY is not set +CONFIG_NAMESPACES=y +# CONFIG_UTS_NS is not set +# CONFIG_IPC_NS is not set +# CONFIG_USER_NS is not set +# CONFIG_PID_NS is not set +# CONFIG_NET_NS is not set +CONFIG_BLK_DEV_INITRD=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_RD_GZIP=y +CONFIG_RD_BZIP2=y +CONFIG_RD_LZMA=y +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_SYSCTL=y +CONFIG_ANON_INODES=y +# CONFIG_EMBEDDED is not set +CONFIG_UID16=y +CONFIG_SYSCTL_SYSCALL=y +CONFIG_KALLSYMS=y +# CONFIG_KALLSYMS_EXTRA_PASS is not set +CONFIG_HOTPLUG=y +CONFIG_PRINTK=y +CONFIG_BUG=y +CONFIG_ELF_CORE=y +CONFIG_BASE_FULL=y +CONFIG_FUTEX=y +CONFIG_EPOLL=y +CONFIG_SIGNALFD=y +CONFIG_TIMERFD=y +CONFIG_EVENTFD=y +CONFIG_SHMEM=y +CONFIG_AIO=y + +# +# Kernel Performance Events And Counters +# +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_COMPAT_BRK=y +CONFIG_SLAB=y +# CONFIG_SLUB is not set +# CONFIG_SLOB is not set +# CONFIG_PROFILING is not set +CONFIG_HAVE_OPROFILE=y +# CONFIG_KPROBES is not set +CONFIG_HAVE_KPROBES=y +CONFIG_HAVE_KRETPROBES=y +CONFIG_HAVE_CLK=y + +# +# GCOV-based kernel profiling +# +# CONFIG_SLOW_WORK 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 is not set +# CONFIG_MODVERSIONS is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_BLOCK=y +CONFIG_LBDAF=y +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_BLK_DEV_INTEGRITY is not set + +# +# IO Schedulers +# +CONFIG_IOSCHED_NOOP=y +CONFIG_IOSCHED_AS=y +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_CFQ=y +# CONFIG_DEFAULT_AS is not set +# CONFIG_DEFAULT_DEADLINE is not set +CONFIG_DEFAULT_CFQ=y +# CONFIG_DEFAULT_NOOP is not set +CONFIG_DEFAULT_IOSCHED="cfq" +CONFIG_FREEZER=y + +# +# System Type +# +CONFIG_MMU=y +# CONFIG_ARCH_AAEC2000 is not set +# CONFIG_ARCH_INTEGRATOR is not set +# CONFIG_ARCH_REALVIEW is not set +# CONFIG_ARCH_VERSATILE is not set +# CONFIG_ARCH_AT91 is not set +# CONFIG_ARCH_CLPS711X is not set +# CONFIG_ARCH_GEMINI is not set +# CONFIG_ARCH_EBSA110 is not set +# CONFIG_ARCH_EP93XX is not set +# CONFIG_ARCH_FOOTBRIDGE is not set +# CONFIG_ARCH_MXC is not set +# CONFIG_ARCH_STMP3XXX is not set +# CONFIG_ARCH_NETX is not set +# CONFIG_ARCH_H720X is not set +# CONFIG_ARCH_NOMADIK is not set +# CONFIG_ARCH_IOP13XX is not set +# CONFIG_ARCH_IOP32X is not set +# CONFIG_ARCH_IOP33X is not set +# CONFIG_ARCH_IXP23XX is not set +# CONFIG_ARCH_IXP2000 is not set +# CONFIG_ARCH_IXP4XX is not set +# CONFIG_ARCH_L7200 is not set +# CONFIG_ARCH_KIRKWOOD is not set +# CONFIG_ARCH_LOKI is not set +# CONFIG_ARCH_MV78XX0 is not set +# CONFIG_ARCH_ORION5X is not set +# CONFIG_ARCH_MMP is not set +# CONFIG_ARCH_KS8695 is not set +# CONFIG_ARCH_NS9XXX is not set +# CONFIG_ARCH_W90X900 is not set +# CONFIG_ARCH_PNX4008 is not set +# CONFIG_ARCH_PXA is not set +# CONFIG_ARCH_MSM is not set +# CONFIG_ARCH_RPC is not set +# CONFIG_ARCH_SA1100 is not set +# CONFIG_ARCH_S3C2410 is not set +# CONFIG_ARCH_S3C64XX is not set +# CONFIG_ARCH_S5PC1XX is not set +# CONFIG_ARCH_SHARK is not set +# CONFIG_ARCH_LH7A40X is not set +# CONFIG_ARCH_U300 is not set +# CONFIG_ARCH_DAVINCI is not set +CONFIG_ARCH_OMAP=y +# CONFIG_ARCH_BCMRING is not set + +# +# TI OMAP Implementations +# +CONFIG_ARCH_OMAP_OTG=y +CONFIG_ARCH_OMAP1=y +# CONFIG_ARCH_OMAP2 is not set +# CONFIG_ARCH_OMAP3 is not set +# CONFIG_ARCH_OMAP4 is not set + +# +# OMAP Feature Selections +# +# CONFIG_OMAP_RESET_CLOCKS is not set +# CONFIG_OMAP_MUX is not set +CONFIG_OMAP_MCBSP=y +# CONFIG_OMAP_MBOX_FWK is not set +CONFIG_OMAP_MPU_TIMER=y +# CONFIG_OMAP_32K_TIMER is not set +CONFIG_OMAP_LL_DEBUG_UART1=y +# CONFIG_OMAP_LL_DEBUG_UART2 is not set +# CONFIG_OMAP_LL_DEBUG_UART3 is not set +# CONFIG_OMAP_LL_DEBUG_NONE is not set +# CONFIG_OMAP_PM_NONE is not set +CONFIG_OMAP_PM_NOOP=y + +# +# OMAP Core Type +# +# CONFIG_ARCH_OMAP730 is not set +CONFIG_ARCH_OMAP850=y +# CONFIG_ARCH_OMAP15XX is not set +# CONFIG_ARCH_OMAP16XX is not set + +# +# OMAP Board Type +# +# CONFIG_MACH_OMAP_HTCWIZARD is not set +CONFIG_MACH_HERALD=y + +# +# OMAP CPU Speed +# +# CONFIG_OMAP_CLOCKS_SET_BY_BOOTLOADER is not set +CONFIG_OMAP_ARM_195MHZ=y +# CONFIG_OMAP_ARM_182MHZ is not set +# CONFIG_OMAP_ARM_168MHZ is not set +# CONFIG_OMAP_ARM_120MHZ is not set +# CONFIG_OMAP_ARM_60MHZ is not set +# CONFIG_OMAP_ARM_30MHZ is not set + +# +# Processor Type +# +CONFIG_CPU_32=y +CONFIG_CPU_ARM925T=y +CONFIG_CPU_ARM926T=y +CONFIG_CPU_32v4T=y +CONFIG_CPU_32v5=y +CONFIG_CPU_ABRT_EV4T=y +CONFIG_CPU_ABRT_EV5TJ=y +CONFIG_CPU_PABRT_LEGACY=y +CONFIG_CPU_CACHE_V4WT=y +CONFIG_CPU_CACHE_VIVT=y +CONFIG_CPU_COPY_V4WB=y +CONFIG_CPU_TLB_V4WBI=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y + +# +# Processor Features +# +CONFIG_ARM_THUMB=y +# CONFIG_CPU_ICACHE_DISABLE is not set +# CONFIG_CPU_DCACHE_DISABLE is not set +CONFIG_CPU_DCACHE_WRITETHROUGH=y +# CONFIG_CPU_CACHE_ROUND_ROBIN is not set +CONFIG_ARM_L1_CACHE_SHIFT=5 +CONFIG_COMMON_CLKDEV=y + +# +# Bus support +# +# CONFIG_PCI_SYSCALL is not set +# CONFIG_ARCH_SUPPORTS_MSI is not set +# CONFIG_PCCARD is not set + +# +# Kernel Features +# +# CONFIG_NO_HZ is not set +# CONFIG_HIGH_RES_TIMERS is not set +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y +CONFIG_VMSPLIT_3G=y +# CONFIG_VMSPLIT_2G is not set +# CONFIG_VMSPLIT_1G is not set +CONFIG_PAGE_OFFSET=0xC0000000 +# CONFIG_PREEMPT_NONE is not set +# CONFIG_PREEMPT_VOLUNTARY is not set +CONFIG_PREEMPT=y +CONFIG_HZ=100 +CONFIG_AEABI=y +CONFIG_OABI_COMPAT=y +# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set +# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set +# CONFIG_HIGHMEM is not set +CONFIG_SELECT_MEMORY_MODEL=y +CONFIG_FLATMEM_MANUAL=y +# CONFIG_DISCONTIGMEM_MANUAL is not set +# CONFIG_SPARSEMEM_MANUAL is not set +CONFIG_FLATMEM=y +CONFIG_FLAT_NODE_MEM_MAP=y +CONFIG_PAGEFLAGS_EXTENDED=y +CONFIG_SPLIT_PTLOCK_CPUS=4096 +# CONFIG_PHYS_ADDR_T_64BIT is not set +CONFIG_ZONE_DMA_FLAG=0 +CONFIG_VIRT_TO_BUS=y +CONFIG_HAVE_MLOCK=y +CONFIG_HAVE_MLOCKED_PAGE_BIT=y +# CONFIG_KSM is not set +CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 +CONFIG_LEDS=y +CONFIG_ALIGNMENT_TRAP=y +# CONFIG_UACCESS_WITH_MEMCPY is not set + +# +# Boot options +# +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_CMDLINE="mem=32M console=ttyS0,115200 ip=dhcp" +# CONFIG_XIP_KERNEL is not set +# CONFIG_KEXEC is not set + +# +# CPU Power Management +# +# CONFIG_CPU_FREQ is not set +# CONFIG_CPU_IDLE is not set + +# +# Floating point emulation +# + +# +# At least one emulation must be selected +# +CONFIG_FPE_NWFPE=y +# CONFIG_FPE_NWFPE_XP is not set +# CONFIG_FPE_FASTFPE is not set +# CONFIG_VFP is not set + +# +# Userspace binary formats +# +CONFIG_BINFMT_ELF=y +# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set +CONFIG_HAVE_AOUT=y +# CONFIG_BINFMT_AOUT is not set +# CONFIG_BINFMT_MISC is not set + +# +# Power management options +# +CONFIG_PM=y +# CONFIG_PM_DEBUG is not set +CONFIG_PM_SLEEP=y +CONFIG_SUSPEND=y +CONFIG_SUSPEND_FREEZER=y +# CONFIG_APM_EMULATION is not set +# CONFIG_PM_RUNTIME is not set +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_NET=y + +# +# Networking options +# +CONFIG_PACKET=y +# CONFIG_PACKET_MMAP is not set +CONFIG_UNIX=y +CONFIG_XFRM=y +# CONFIG_XFRM_USER is not set +# CONFIG_XFRM_SUB_POLICY is not set +# CONFIG_XFRM_MIGRATE is not set +# CONFIG_XFRM_STATISTICS is not set +# CONFIG_NET_KEY is not set +CONFIG_INET=y +CONFIG_IP_MULTICAST=y +# CONFIG_IP_ADVANCED_ROUTER is not set +CONFIG_IP_FIB_HASH=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_IP_PNP_BOOTP=y +# CONFIG_IP_PNP_RARP is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPGRE is not set +# CONFIG_IP_MROUTE is not set +# CONFIG_ARPD is not set +# CONFIG_SYN_COOKIES is not set +# CONFIG_INET_AH is not set +# CONFIG_INET_ESP is not set +# CONFIG_INET_IPCOMP is not set +# CONFIG_INET_XFRM_TUNNEL is not set +# CONFIG_INET_TUNNEL is not set +CONFIG_INET_XFRM_MODE_TRANSPORT=y +CONFIG_INET_XFRM_MODE_TUNNEL=y +CONFIG_INET_XFRM_MODE_BEET=y +CONFIG_INET_LRO=y +CONFIG_INET_DIAG=y +CONFIG_INET_TCP_DIAG=y +# CONFIG_TCP_CONG_ADVANCED is not set +CONFIG_TCP_CONG_CUBIC=y +CONFIG_DEFAULT_TCP_CONG="cubic" +# CONFIG_TCP_MD5SIG is not set +# CONFIG_IPV6 is not set +# CONFIG_NETWORK_SECMARK is not set +# CONFIG_NETFILTER 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_BRIDGE is not set +# CONFIG_NET_DSA is not set +# CONFIG_VLAN_8021Q is not set +# CONFIG_DECNET is not set +# CONFIG_LLC2 is not set +# CONFIG_IPX is not set +# CONFIG_ATALK is not set +# CONFIG_X25 is not set +# CONFIG_LAPB is not set +# CONFIG_ECONET is not set +# CONFIG_WAN_ROUTER is not set +# CONFIG_PHONET is not set +# CONFIG_IEEE802154 is not set +# CONFIG_NET_SCHED is not set +# CONFIG_DCB is not set + +# +# Network testing +# +# CONFIG_NET_PKTGEN is not set +# CONFIG_HAMRADIO is not set +# CONFIG_CAN is not set +# CONFIG_IRDA is not set +# CONFIG_BT is not set +# CONFIG_AF_RXRPC is not set +CONFIG_WIRELESS=y +# CONFIG_CFG80211 is not set +CONFIG_CFG80211_DEFAULT_PS_VALUE=0 +# CONFIG_WIRELESS_OLD_REGULATORY is not set +# CONFIG_WIRELESS_EXT is not set +# CONFIG_LIB80211 is not set + +# +# CFG80211 needs to be enabled for MAC80211 +# +# CONFIG_WIMAX is not set +# CONFIG_RFKILL is not set +# CONFIG_NET_9P 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_SYS_HYPERVISOR is not set +# CONFIG_CONNECTOR is not set +# CONFIG_MTD is not set +# CONFIG_PARPORT is not set +CONFIG_BLK_DEV=y +# CONFIG_BLK_DEV_COW_COMMON is not set +CONFIG_BLK_DEV_LOOP=y +# CONFIG_BLK_DEV_CRYPTOLOOP is not set +# CONFIG_BLK_DEV_NBD is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=8192 +# CONFIG_BLK_DEV_XIP is not set +# CONFIG_CDROM_PKTCDVD is not set +# CONFIG_ATA_OVER_ETH is not set +# CONFIG_MG_DISK is not set +CONFIG_MISC_DEVICES=y +# CONFIG_ENCLOSURE_SERVICES is not set +# CONFIG_C2PORT is not set + +# +# EEPROM support +# +# CONFIG_EEPROM_93CX6 is not set +CONFIG_HAVE_IDE=y +# CONFIG_IDE is not set + +# +# SCSI device support +# +# CONFIG_RAID_ATTRS is not set +# CONFIG_SCSI is not set +# CONFIG_SCSI_DMA is not set +# CONFIG_SCSI_NETLINK is not set +# CONFIG_ATA is not set +# CONFIG_MD is not set +CONFIG_NETDEVICES=y +# CONFIG_DUMMY is not set +# CONFIG_BONDING is not set +# CONFIG_MACVLAN is not set +# CONFIG_EQUALIZER is not set +# CONFIG_TUN is not set +# CONFIG_VETH is not set +# CONFIG_PHYLIB is not set +CONFIG_NET_ETHERNET=y +CONFIG_MII=y +# CONFIG_AX88796 is not set +CONFIG_SMC91X=y +# CONFIG_DM9000 is not set +# CONFIG_ETHOC is not set +# CONFIG_SMC911X is not set +# CONFIG_SMSC911X is not set +# CONFIG_DNET is not set +# CONFIG_IBM_NEW_EMAC_ZMII is not set +# CONFIG_IBM_NEW_EMAC_RGMII is not set +# CONFIG_IBM_NEW_EMAC_TAH is not set +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set +# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set +# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set +# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set +# CONFIG_B44 is not set +# CONFIG_KS8842 is not set +# CONFIG_KS8851_MLL is not set +CONFIG_NETDEV_1000=y +CONFIG_NETDEV_10000=y +CONFIG_WLAN=y +# CONFIG_WLAN_PRE80211 is not set +# CONFIG_WLAN_80211 is not set + +# +# Enable WiMAX (Networking options) to see the WiMAX drivers +# +# CONFIG_WAN is not set +# CONFIG_PPP is not set +# CONFIG_SLIP is not set +# CONFIG_NETCONSOLE is not set +# CONFIG_NETPOLL is not set +# CONFIG_NET_POLL_CONTROLLER is not set +# CONFIG_ISDN is not set +# CONFIG_PHONE is not set + +# +# Input device support +# +CONFIG_INPUT=y +# CONFIG_INPUT_FF_MEMLESS is not set +# CONFIG_INPUT_POLLDEV is not set + +# +# Userland interfaces +# +CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_MOUSEDEV_PSAUX=y +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_EVDEV is not set +# CONFIG_INPUT_EVBUG is not set + +# +# Input Device Drivers +# +CONFIG_INPUT_KEYBOARD=y +# CONFIG_KEYBOARD_ATKBD is not set +# CONFIG_KEYBOARD_LKKBD is not set +# CONFIG_KEYBOARD_GPIO is not set +# CONFIG_KEYBOARD_MATRIX 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_OMAP=y +# CONFIG_KEYBOARD_XTKBD is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_TABLET is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_MISC is not set + +# +# Hardware I/O ports +# +CONFIG_SERIO=y +CONFIG_SERIO_SERPORT=y +# CONFIG_SERIO_RAW is not set +# CONFIG_GAMEPORT is not set + +# +# Character devices +# +CONFIG_VT=y +CONFIG_CONSOLE_TRANSLATIONS=y +CONFIG_VT_CONSOLE=y +CONFIG_HW_CONSOLE=y +# CONFIG_VT_HW_CONSOLE_BINDING is not set +CONFIG_DEVKMEM=y +# CONFIG_SERIAL_NONSTANDARD is not set + +# +# Serial drivers +# +CONFIG_SERIAL_8250=m +CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +# CONFIG_SERIAL_8250_EXTENDED is not set + +# +# Non-8250 serial port support +# +CONFIG_SERIAL_CORE=m +CONFIG_UNIX98_PTYS=y +# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set +# CONFIG_LEGACY_PTYS is not set +# CONFIG_IPMI_HANDLER is not set +CONFIG_HW_RANDOM=m +# CONFIG_HW_RANDOM_TIMERIOMEM is not set +# CONFIG_R3964 is not set +# CONFIG_RAW_DRIVER is not set +# CONFIG_TCG_TPM is not set +# CONFIG_I2C is not set +# CONFIG_SPI is not set + +# +# PPS support +# +# CONFIG_PPS is not set +CONFIG_ARCH_REQUIRE_GPIOLIB=y +CONFIG_GPIOLIB=y +# CONFIG_GPIO_SYSFS is not set + +# +# Memory mapped GPIO expanders: +# + +# +# I2C GPIO expanders: +# + +# +# PCI GPIO expanders: +# + +# +# SPI GPIO expanders: +# + +# +# AC97 GPIO expanders: +# +# CONFIG_W1 is not set +# CONFIG_POWER_SUPPLY is not set +CONFIG_HWMON=y +# CONFIG_HWMON_VID is not set +# CONFIG_HWMON_DEBUG_CHIP is not set + +# +# Native drivers +# +# CONFIG_SENSORS_F71805F is not set +# CONFIG_SENSORS_F71882FG is not set +# CONFIG_SENSORS_IT87 is not set +# CONFIG_SENSORS_PC87360 is not set +# CONFIG_SENSORS_PC87427 is not set +# CONFIG_SENSORS_SHT15 is not set +# CONFIG_SENSORS_SMSC47M1 is not set +# CONFIG_SENSORS_SMSC47B397 is not set +# CONFIG_SENSORS_VT1211 is not set +# CONFIG_SENSORS_W83627HF is not set +# CONFIG_SENSORS_W83627EHF is not set +# CONFIG_THERMAL is not set +# CONFIG_WATCHDOG is not set +CONFIG_SSB_POSSIBLE=y + +# +# Sonics Silicon Backplane +# +# CONFIG_SSB is not set + +# +# Multifunction device drivers +# +# CONFIG_MFD_CORE is not set +# CONFIG_MFD_SM501 is not set +# CONFIG_MFD_ASIC3 is not set +# CONFIG_HTC_EGPIO is not set +# CONFIG_HTC_PASIC3 is not set +# CONFIG_MFD_TMIO is not set +# CONFIG_MFD_T7L66XB is not set +# CONFIG_MFD_TC6387XB is not set +# CONFIG_MFD_TC6393XB is not set +# CONFIG_REGULATOR is not set +# CONFIG_MEDIA_SUPPORT is not set + +# +# Graphics support +# +# CONFIG_VGASTATE is not set +CONFIG_VIDEO_OUTPUT_CONTROL=m +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_SVGALIB is not set +# CONFIG_FB_MACMODES is not set +# CONFIG_FB_BACKLIGHT is not set +CONFIG_FB_MODE_HELPERS=y +# CONFIG_FB_TILEBLITTING is not set + +# +# Frame buffer hardware drivers +# +# CONFIG_FB_S1D13XXX 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_FB_OMAP=y +# CONFIG_FB_OMAP_LCDC_EXTERNAL is not set +# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set +CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=2 +# CONFIG_FB_OMAP_DMA_TUNE is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set + +# +# Display device support +# +# CONFIG_DISPLAY_SUPPORT is not set + +# +# Console display driver support +# +# CONFIG_VGA_CONSOLE is not set +CONFIG_DUMMY_CONSOLE=y +CONFIG_FRAMEBUFFER_CONSOLE=y +# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set +CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y +CONFIG_FONTS=y +# CONFIG_FONT_8x8 is not set +# CONFIG_FONT_8x16 is not set +# CONFIG_FONT_6x11 is not set +# CONFIG_FONT_7x14 is not set +# CONFIG_FONT_PEARL_8x8 is not set +# CONFIG_FONT_ACORN_8x8 is not set +CONFIG_FONT_MINI_4x6=y +# CONFIG_FONT_SUN8x16 is not set +# CONFIG_FONT_SUN12x22 is not set +# CONFIG_FONT_10x18 is not set +# CONFIG_LOGO is not set +# CONFIG_SOUND is not set +CONFIG_HID_SUPPORT=y +CONFIG_HID=y +# CONFIG_HIDRAW is not set +# CONFIG_HID_PID is not set + +# +# Special HID drivers +# +CONFIG_USB_SUPPORT=y +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARCH_HAS_OHCI=y +# CONFIG_USB_ARCH_HAS_EHCI is not set +# CONFIG_USB is not set +# CONFIG_USB_MUSB_HDRC is not set +# CONFIG_USB_GADGET_MUSB_HDRC is not set + +# +# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may +# +CONFIG_USB_GADGET=y +# CONFIG_USB_GADGET_DEBUG_FILES is not set +CONFIG_USB_GADGET_VBUS_DRAW=2 +CONFIG_USB_GADGET_SELECTED=y +# CONFIG_USB_GADGET_AT91 is not set +# CONFIG_USB_GADGET_ATMEL_USBA is not set +# CONFIG_USB_GADGET_FSL_USB2 is not set +# CONFIG_USB_GADGET_LH7A40X is not set +CONFIG_USB_GADGET_OMAP=y +CONFIG_USB_OMAP=y +# CONFIG_USB_GADGET_PXA25X is not set +# CONFIG_USB_GADGET_R8A66597 is not set +# CONFIG_USB_GADGET_PXA27X is not set +# CONFIG_USB_GADGET_S3C_HSOTG is not set +# CONFIG_USB_GADGET_IMX is not set +# CONFIG_USB_GADGET_S3C2410 is not set +# CONFIG_USB_GADGET_M66592 is not set +# CONFIG_USB_GADGET_AMD5536UDC is not set +# CONFIG_USB_GADGET_FSL_QE is not set +# CONFIG_USB_GADGET_CI13XXX is not set +# CONFIG_USB_GADGET_NET2280 is not set +# CONFIG_USB_GADGET_GOKU is not set +# CONFIG_USB_GADGET_LANGWELL is not set +# CONFIG_USB_GADGET_DUMMY_HCD is not set +# CONFIG_USB_GADGET_DUALSPEED is not set +# CONFIG_USB_ZERO is not set +# CONFIG_USB_AUDIO is not set +CONFIG_USB_ETH=y +# CONFIG_USB_ETH_RNDIS is not set +# CONFIG_USB_ETH_EEM is not set +# CONFIG_USB_GADGETFS is not set +# CONFIG_USB_FILE_STORAGE is not set +# CONFIG_USB_G_SERIAL is not set +# CONFIG_USB_MIDI_GADGET is not set +# CONFIG_USB_G_PRINTER is not set +# CONFIG_USB_CDC_COMPOSITE is not set + +# +# OTG and related infrastructure +# +CONFIG_USB_OTG_UTILS=y +# CONFIG_USB_GPIO_VBUS is not set +# CONFIG_NOP_USB_XCEIV is not set +CONFIG_MMC=y +# CONFIG_MMC_DEBUG is not set +# CONFIG_MMC_UNSAFE_RESUME is not set + +# +# MMC/SD/SDIO Card Drivers +# +CONFIG_MMC_BLOCK=y +CONFIG_MMC_BLOCK_BOUNCE=y +# CONFIG_SDIO_UART is not set +# CONFIG_MMC_TEST is not set + +# +# MMC/SD/SDIO Host Controller Drivers +# +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_PLTFM=y +CONFIG_MMC_OMAP=y +# CONFIG_MMC_AT91 is not set +# CONFIG_MMC_ATMELMCI is not set +# CONFIG_MEMSTICK is not set +# CONFIG_NEW_LEDS is not set +# CONFIG_ACCESSIBILITY is not set +CONFIG_RTC_LIB=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_HCTOSYS=y +CONFIG_RTC_HCTOSYS_DEVICE="rtc0" +# CONFIG_RTC_DEBUG is not set + +# +# RTC interfaces +# +CONFIG_RTC_INTF_SYSFS=y +CONFIG_RTC_INTF_PROC=y +CONFIG_RTC_INTF_DEV=y +# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set +# CONFIG_RTC_DRV_TEST is not set + +# +# SPI RTC drivers +# + +# +# Platform RTC drivers +# +# CONFIG_RTC_DRV_CMOS is not set +# CONFIG_RTC_DRV_DS1286 is not set +# CONFIG_RTC_DRV_DS1511 is not set +# CONFIG_RTC_DRV_DS1553 is not set +# CONFIG_RTC_DRV_DS1742 is not set +# CONFIG_RTC_DRV_STK17TA8 is not set +# CONFIG_RTC_DRV_M48T86 is not set +# CONFIG_RTC_DRV_M48T35 is not set +# CONFIG_RTC_DRV_M48T59 is not set +# CONFIG_RTC_DRV_BQ4802 is not set +# CONFIG_RTC_DRV_V3020 is not set + +# +# on-CPU RTC drivers +# +# CONFIG_DMADEVICES is not set +# CONFIG_AUXDISPLAY is not set +# CONFIG_UIO is not set + +# +# TI VLYNQ +# +# CONFIG_STAGING is not set + +# +# File systems +# +CONFIG_EXT2_FS=y +# CONFIG_EXT2_FS_XATTR is not set +# CONFIG_EXT2_FS_XIP is not set +CONFIG_EXT3_FS=y +# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set +CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_POSIX_ACL is not set +# CONFIG_EXT3_FS_SECURITY is not set +# CONFIG_EXT4_FS is not set +CONFIG_JBD=y +CONFIG_FS_MBCACHE=y +# CONFIG_REISERFS_FS is not set +# CONFIG_JFS_FS is not set +# CONFIG_FS_POSIX_ACL is not set +# CONFIG_XFS_FS is not set +# CONFIG_GFS2_FS is not set +# CONFIG_OCFS2_FS is not set +# CONFIG_BTRFS_FS is not set +# CONFIG_NILFS2_FS is not set +CONFIG_FILE_LOCKING=y +CONFIG_FSNOTIFY=y +CONFIG_DNOTIFY=y +CONFIG_INOTIFY=y +CONFIG_INOTIFY_USER=y +# CONFIG_QUOTA is not set +# CONFIG_AUTOFS_FS is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_FUSE_FS is not set + +# +# Caches +# +# CONFIG_FSCACHE is not set + +# +# CD-ROM/DVD Filesystems +# +# CONFIG_ISO9660_FS is not set +# CONFIG_UDF_FS is not set + +# +# DOS/FAT/NT Filesystems +# +# CONFIG_MSDOS_FS is not set +# CONFIG_VFAT_FS is not set +# CONFIG_NTFS_FS is not set + +# +# Pseudo filesystems +# +CONFIG_PROC_FS=y +CONFIG_PROC_SYSCTL=y +CONFIG_PROC_PAGE_MONITOR=y +CONFIG_SYSFS=y +CONFIG_TMPFS=y +# CONFIG_TMPFS_POSIX_ACL is not set +# CONFIG_HUGETLB_PAGE is not set +# CONFIG_CONFIGFS_FS is not set +CONFIG_MISC_FILESYSTEMS=y +# CONFIG_ADFS_FS is not set +# CONFIG_AFFS_FS is not set +# CONFIG_HFS_FS is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_EFS_FS is not set +# CONFIG_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_ROMFS_FS 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 is not set +# CONFIG_NFS_V4 is not set +CONFIG_ROOT_NFS=y +# CONFIG_NFSD is not set +CONFIG_LOCKD=y +CONFIG_NFS_COMMON=y +CONFIG_SUNRPC=y +# CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPCSEC_GSS_SPKM3 is not set +# CONFIG_SMB_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 + +# +# Partition Types +# +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_NLS is not set +# CONFIG_DLM is not set + +# +# Kernel hacking +# +# CONFIG_PRINTK_TIME is not set +CONFIG_ENABLE_WARN_DEPRECATED=y +CONFIG_ENABLE_MUST_CHECK=y +CONFIG_FRAME_WARN=1024 +# CONFIG_MAGIC_SYSRQ is not set +# CONFIG_STRIP_ASM_SYMS is not set +# CONFIG_UNUSED_SYMBOLS is not set +# CONFIG_DEBUG_FS is not set +# CONFIG_HEADERS_CHECK is not set +# CONFIG_DEBUG_KERNEL is not set +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_MEMORY_INIT=y +# CONFIG_RCU_CPU_STALL_DETECTOR is not set +# CONFIG_LATENCYTOP is not set +# CONFIG_SYSCTL_SYSCALL_CHECK is not set +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_TRACING_SUPPORT=y +# CONFIG_FTRACE is not set +# CONFIG_SAMPLES is not set +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_ARM_UNWIND=y +# CONFIG_DEBUG_USER is not set + +# +# Security options +# +# CONFIG_KEYS is not set +# CONFIG_SECURITY is not set +# CONFIG_SECURITYFS is not set +# CONFIG_SECURITY_FILE_CAPABILITIES is not set +CONFIG_CRYPTO=y + +# +# Crypto core or helper +# +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_ALGAPI2=y +CONFIG_CRYPTO_PCOMP=y +# CONFIG_CRYPTO_MANAGER is not set +# CONFIG_CRYPTO_MANAGER2 is not set +# CONFIG_CRYPTO_GF128MUL is not set +# CONFIG_CRYPTO_NULL is not set +# CONFIG_CRYPTO_CRYPTD is not set +# CONFIG_CRYPTO_AUTHENC is not set +# CONFIG_CRYPTO_TEST is not set + +# +# Authenticated Encryption with Associated Data +# +# CONFIG_CRYPTO_CCM is not set +# CONFIG_CRYPTO_GCM is not set +# CONFIG_CRYPTO_SEQIV is not set + +# +# Block modes +# +# CONFIG_CRYPTO_CBC is not set +# 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 is not set +# CONFIG_CRYPTO_XCBC is not set +# CONFIG_CRYPTO_VMAC is not set + +# +# Digest +# +# CONFIG_CRYPTO_CRC32C is not set +# CONFIG_CRYPTO_GHASH is not set +# CONFIG_CRYPTO_MD4 is not set +# CONFIG_CRYPTO_MD5 is not set +# 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 is not set +# 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 is not set +# CONFIG_CRYPTO_ANUBIS is not set +# CONFIG_CRYPTO_ARC4 is not set +# 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 is not set +# CONFIG_CRYPTO_FCRYPT is not set +# CONFIG_CRYPTO_KHAZAD is not set +# CONFIG_CRYPTO_SALSA20 is not set +# CONFIG_CRYPTO_SEED is not set +# CONFIG_CRYPTO_SERPENT is not set +# CONFIG_CRYPTO_TEA is not set +# CONFIG_CRYPTO_TWOFISH is not set + +# +# Compression +# +CONFIG_CRYPTO_DEFLATE=y +CONFIG_CRYPTO_ZLIB=y +CONFIG_CRYPTO_LZO=y + +# +# Random Number Generation +# +# CONFIG_CRYPTO_ANSI_CPRNG is not set +CONFIG_CRYPTO_HW=y +# CONFIG_BINARY_PRINTF is not set + +# +# Library routines +# +CONFIG_BITREVERSE=y +CONFIG_GENERIC_FIND_LAST_BIT=y +# CONFIG_CRC_CCITT is not set +# CONFIG_CRC16 is not set +# CONFIG_CRC_T10DIF is not set +# CONFIG_CRC_ITU_T is not set +CONFIG_CRC32=y +# CONFIG_CRC7 is not set +# CONFIG_LIBCRC32C is not set +CONFIG_ZLIB_INFLATE=y +CONFIG_ZLIB_DEFLATE=y +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +CONFIG_DECOMPRESS_GZIP=y +CONFIG_DECOMPRESS_BZIP2=y +CONFIG_DECOMPRESS_LZMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT=y +CONFIG_HAS_DMA=y +CONFIG_NLATTR=y
Signature · 1 line
1.6.3.3
cover AI TB: Always Innovating OMAP3-based Touch Book
This series adds support for the Always Innovating OMAP3-based Touch Book,
Grégoire Gentil
Gregoire Gentil (5):
Defconfig file of the Always Innovating OMAP3-based Touch Book. Board file of the Always Innovating OMAP3-based Touch Book. Driver for the Freescale MMA7455L accelerometer Driver for the Always Innovating Touch Book keyboard. Additional modifications for the Always Innovating OMAP3-based
arch/arm/configs/omap3_touchbook_defconfig | 2441
++++++++++++++++++++++++++++
arch/arm/mach-omap2/Kconfig | 5 + arch/arm/mach-omap2/Makefile | 2 + arch/arm/mach-omap2/board-omap3touchbook.c | 683 ++++++++ drivers/hid/Kconfig | 7 + drivers/hid/Makefile | 1 + drivers/hid/hid-alwaysinnovating.c | 262 +++ drivers/hid/hid-core.c | 1 + drivers/hid/hid-ids.h | 3 + drivers/input/misc/Kconfig | 9 + drivers/input/misc/Makefile | 2 +- drivers/input/misc/mma7455l.c | 625 +++++++ drivers/video/omap/lcd_omap3touchbook.c | 130 ++ include/linux/mma7455l.h | 11 + sound/soc/omap/Kconfig | 8 + sound/soc/omap/Makefile | 2 + sound/soc/omap/omap3touchbook.c | 211 +++ 17 files changed, 4402 insertions(+), 1 deletions(-)
create mode 100644 arch/arm/configs/omap3_touchbook_defconfig create mode 100644 arch/arm/mach-omap2/board-omap3touchbook.c create mode 100644 drivers/hid/hid-alwaysinnovating.c create mode 100644 drivers/input/misc/mma7455l.c create mode 100644 drivers/video/omap/lcd_omap3touchbook.c create mode 100644 include/linux/mma7455l.h
create mode 100644 sound/soc/omap/omap3touchbook.c
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/5 AI TB: Defconfig file of the Always Innovating OMAP3-based Touch Book.
In reply to Cory MaccarroneDefconfig file of the Always Innovating OMAP3-based Touch Book.
---arch/arm/configs/omap3_touchbook_defconfig | 2441
++++++++++++++++++++++++++++
1 files changed, 2441 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/configs/omap3_touchbook_defconfig
(quoted diff) +0 -0
b/arch/arm/configs/omap3_touchbook_defconfig
new file mode 100644
index 0000000..aa67460
arch/arm/configs/omap3_touchbook_defconfig new file +2441 -0
2,441 lines not on this page · raw message
Signature · 1 line
1.6.0.4
PATCH 2/5 AI TB: Board file of the Always Innovating OMAP3-based Touch Book.
In reply to Cory MaccarroneBoard file of the Always Innovating OMAP3-based Touch Book.
---arch/arm/mach-omap2/board-omap3touchbook.c | 683
++++++++++++++++++++++++++++
1 files changed, 683 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/mach-omap2/board-omap3touchbook.c
(quoted diff) +0 -0
b/arch/arm/mach-omap2/board-omap3touchbook.c
new file mode 100644
index 0000000..ad3ef6e
arch/arm/mach-omap2/board-omap3touchbook.c new file +212 -0
212 lines not on this page · raw message
220 mA) */
+static struct regulator_init_data touchbook_vmmc1 = {
+ .constraints = {
+ .min_uV = 1850000,
+ .max_uV = 3150000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
+ | REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = 1,
+ .consumer_supplies = &touchbook_vmmc1_supply,
+};
+
+/* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */ +static struct regulator_init_data touchbook_vsim = {
+ .constraints = {
+ .min_uV = 1800000,
+ .max_uV = 3000000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
+ | REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = 1,
+ .consumer_supplies = &touchbook_vsim_supply,
+};
+
+/* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */ +static struct regulator_init_data touchbook_vdac = {
+ .constraints = {
+ .min_uV = 1800000,
+ .max_uV = 1800000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = 1,
+ .consumer_supplies = &touchbook_vdac_supply,
+};
+
+/* VPLL2 for digital video outputs */
+static struct regulator_init_data touchbook_vpll2 = {
+ .constraints = {
+ .name = "VDVI",
+ .min_uV = 1800000,
+ .max_uV = 1800000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = 1,
+ .consumer_supplies = &touchbook_vdvi_supply,
+};
+
+static struct twl4030_usb_data touchbook_usb_data = {
+ .usb_mode = T2_USB_MODE_ULPI,
+};
+
+static struct twl4030_codec_audio_data touchbook_audio_data = {
+ .audio_mclk = 26000000,
+};
+
+static struct twl4030_codec_data touchbook_codec_data = {
+ .audio_mclk = 26000000,
+ .audio = &touchbook_audio_data,
+};
+
+static struct twl4030_platform_data touchbook_twldata = {
+ .irq_base = TWL4030_IRQ_BASE,
+ .irq_end = TWL4030_IRQ_END,
+
+ /* platform_data for children goes here */
+ .usb = &touchbook_usb_data,
+ .gpio = &touchbook_gpio_data,
+ .codec = &touchbook_codec_data,
+ .vmmc1 = &touchbook_vmmc1,
+ .vsim = &touchbook_vsim,
+ .vdac = &touchbook_vdac,
+ .vpll2 = &touchbook_vpll2,
+};
+
+static struct i2c_board_info __initdata touchbook_i2c_boardinfo[] = {
+ {
+ I2C_BOARD_INFO("twl4030", 0x48),
+ .flags = I2C_CLIENT_WAKE,
+ .irq = INT_34XX_SYS_NIRQ,
+ .platform_data = &touchbook_twldata,
+ },
+};
+
+static struct i2c_board_info __initdata touchBook_i2c_boardinfo[] = {
+ {
+ I2C_BOARD_INFO("bq27200", 0x55),
+ },
+};
+
+static int __init omap3_touchbook_i2c_init(void)
+{
+ /* Standard TouchBook bus */
+ omap_register_i2c_bus(1, 2600, touchbook_i2c_boardinfo,
+ ARRAY_SIZE(touchbook_i2c_boardinfo));
+
+ /* Additional TouchBook bus */
+ omap_register_i2c_bus(3, 100, touchBook_i2c_boardinfo,
+ ARRAY_SIZE(touchBook_i2c_boardinfo));
+
+ return 0;
+}
+
+static void __init omap3_ads7846_init(void)
+{
+ if (gpio_request(OMAP3_TS_GPIO, "ads7846_pen_down")) {
+ printk(KERN_ERR "Failed to request GPIO %d for "
+ "ads7846 pen down IRQ\n", OMAP3_TS_GPIO);
+ return;
+ }
+
+ gpio_direction_input(OMAP3_TS_GPIO);
+ omap_set_gpio_debounce(OMAP3_TS_GPIO, 1);
+ omap_set_gpio_debounce_time(OMAP3_TS_GPIO, 0xa);
+}
+
+static struct ads7846_platform_data ads7846_config = {
+ .x_min = 100,
+ .y_min = 265,
+ .x_max = 3950,
+ .y_max = 3750,
+ .x_plate_ohms = 40,
+ .pressure_max = 255,
+ .debounce_max = 10,
+ .debounce_tol = 5,
+ .debounce_rep = 1,
+ .gpio_pendown = OMAP3_TS_GPIO,
+ .keep_vref_on = 1,
+};
+
+static struct omap2_mcspi_device_config ads7846_mcspi_config = {
+ .turbo_mode = 0,
+ .single_channel = 1, /* 0: slave, 1: master */
+};
+
+static struct spi_board_info omap3_ads7846_spi_board_info[] __initdata = {
+ {
+ .modalias = "ads7846",
+ .bus_num = 4,
+ .chip_select = 0,
+ .max_speed_hz = 1500000,
+ .controller_data = &ads7846_mcspi_config,
+ .irq = OMAP_GPIO_IRQ(OMAP3_TS_GPIO),
+ .platform_data = &ads7846_config,
+ }
+};
+
+static struct gpio_led gpio_leds[] = {
+ {
+ .name = "touchbook::usr0",
+ .default_trigger = "heartbeat",
+ .gpio = 150,
+ },
+ {
+ .name = "touchbook::usr1",
+ .default_trigger = "mmc0",
+ .gpio = 149,
+ },
+ {
+ .name = "touchbook::pmu_stat",
+ .gpio = -EINVAL, /* gets replaced */
+ .active_low = true,
+ },
+};
+
+static struct gpio_led_platform_data gpio_led_info = {
+ .leds = gpio_leds,
+ .num_leds = ARRAY_SIZE(gpio_leds),
+};
+
+static struct platform_device leds_gpio = {
+ .name = "leds-gpio",
+ .id = -1,
+ .dev = {
+ .platform_data = &gpio_led_info,
+ },
+};
+
+static struct gpio_keys_button gpio_buttons[] = {
+ {
+ .code = BTN_EXTRA,
+ .gpio = 7,
+ .desc = "user",
+ .wakeup = 1,
+ },
+ {
+ .code = KEY_POWER,
+ .gpio = 183,
+ .desc = "power",
+ .wakeup = 1,
+ },
+};
+
+static struct gpio_keys_platform_data gpio_key_info = {
+ .buttons = gpio_buttons,
+ .nbuttons = ARRAY_SIZE(gpio_buttons),
+};
+
+static struct platform_device keys_gpio = {
+ .name = "gpio-keys",
+ .id = -1,
+ .dev = {
+ .platform_data = &gpio_key_info,
+ },
+};
+
+static struct omap_board_config_kernel omap3_touchbook_config[] __initdata = {
+ { OMAP_TAG_LCD, &omap3_touchbook_lcd_config },
+};
+
+static void __init omap3_touchbook_init_irq(void)
+{
+ omap_board_config = omap3_touchbook_config;
+ omap_board_config_size = ARRAY_SIZE(omap3_touchbook_config);
+ omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
+ mt46h32m32lf6_sdrc_params);
+ omap_init_irq();
+#ifdef CONFIG_OMAP_32K_TIMER
+ omap2_gp_clockevent_set_gptimer(12);
+#endif
+ omap_gpio_init();
+}
+
+static struct platform_device *omap3_touchbook_devices[] __initdata = {
+ &omap3_touchbook_lcd_device,
+ &leds_gpio,
+ &keys_gpio,
+};
+
+static void __init omap3touchbook_flash_init(void)
+{
+ u8 cs = 0;
+ u8 nandcs = GPMC_CS_NUM + 1;
+
+ u32 gpmc_base_add = OMAP34XX_GPMC_VIRT;
+
+ /* find out the chip-select on which NAND exists */
+ while (cs < GPMC_CS_NUM) {
+ u32 ret = 0;
+ ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
+
+ if ((ret & 0xC00) == 0x800) {
+ printk(KERN_INFO "Found NAND on CS%d\n", cs);
+ if (nandcs > GPMC_CS_NUM)
+ nandcs = cs;
+ }
+ cs++;
+ }
+
+ if (nandcs > GPMC_CS_NUM) {
+ printk(KERN_INFO "NAND: Unable to find configuration "
+ "in GPMC\n ");
+ return;
+ }
+
+ if (nandcs < GPMC_CS_NUM) {
+ omap3touchbook_nand_data.cs = nandcs;
+ omap3touchbook_nand_data.gpmc_cs_baseaddr = (void *)
+ (gpmc_base_add + GPMC_CS0_BASE + nandcs * GPMC_CS_SIZE);
+ omap3touchbook_nand_data.gpmc_baseaddr =
+ (void *) (gpmc_base_add);
+
+ printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
+ if (platform_device_register(&omap3touchbook_nand_device) < 0)
+ printk(KERN_ERR "Unable to register NAND device\n");
+ }
+}
+
+static void __init omap3_mma7455l_init(void)
+{
+ int ret;
+
+ ret = gpio_request(OMAP3_AC_GPIO, "mma7455l");
+ if (ret < 0) {
+ printk(KERN_ERR "Failed to request GPIO %d for mma7455l IRQ\n",
+ OMAP3_AC_GPIO);
+ return;
+ }
+
+ gpio_direction_input(OMAP3_AC_GPIO);
+}
+
+static struct mma7455l_platform_data mma7455l_config = {
+ .calibration_x = -4,
+ .calibration_y = 28,
+ .calibration_z = -28,
+};
+
+static struct omap2_mcspi_device_config mma7455l_mcspi_config = {
+ .turbo_mode = 0,
+ .single_channel = 1, /* 0: slave, 1: master */
+};
+
+static struct spi_board_info omap3_mma7455l_spi_board_info[] __initdata = {
+ {
+ .modalias = "mma7455l",
+ .bus_num = 3,
+ .chip_select = 0,
+ .max_speed_hz = 200000,
+ .irq = OMAP_GPIO_IRQ(OMAP3_AC_GPIO),
+ .controller_data = &mma7455l_mcspi_config,
+ .platform_data = &mma7455l_config,
+ }
+};
+
+static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { +
+ .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
+ .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
+ .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
+
+ .phy_reset = true,
+ .reset_gpio_port[0] = -EINVAL, + .reset_gpio_port[1] = 147, + .reset_gpio_port[2] = -EINVAL
+};
+
+static int touchbook_backlight_brightness = 50;
+static struct omap_dm_timer *touchbook_backlight_pwm;
+
+static int touchbook_backlight_read(struct backlight_device *bd) +{
+ return touchbook_backlight_brightness;
+}
+
+static int touchbook_backlight_update(struct backlight_device *bd) +{
+ int value = bd->props.brightness;
+ touchbook_backlight_brightness = value;
+
+ /* Frequency calculation:
+ - For 200Hz PWM, you want to load -164 (=> -32768Hz / 200Hz). + - Minimum duty cycle for the backlight is 15%. + - You have (164*0.85) => ~140 levels of brightness.
+ */
+
+ /* For maximum brightness, just stop the timer... */
+ if (value != bd->props.max_brightness) {
+ /* Load the appropriate value for 200Hz PWM */
+ u32 period = clk_get_rate(omap_dm_timer_get_fclk(
+ touchbook_backlight_pwm)) / 200;
+
+ /* Minimum duty cycle is 15% */
+ u32 minimum = (period * 3) / 20;
+ u32 maximum = (period * 17) / 20;
+
+ /* Work out match value */
+ u32 match = (maximum * value) / 100;
+
+ /* Start... */
+ omap_dm_timer_set_load(touchbook_backlight_pwm,
+ 1, 0xFFFFFFFF - period - 1);
+ omap_dm_timer_set_match(touchbook_backlight_pwm,
+ 1, 0xFFFFFFFF - minimum - match);
+ omap_dm_timer_write_counter(touchbook_backlight_pwm, -1);
+ omap_dm_timer_start(touchbook_backlight_pwm);
+ } else
+ omap_dm_timer_stop(touchbook_backlight_pwm);
+
+
+ return 0;
+}
+
+static struct backlight_ops touchbook_backlight_properties = {
+ .get_brightness = touchbook_backlight_read,
+ .update_status = touchbook_backlight_update,
+};
+
+static void __init omap3_touchbook_backlight_init(void) +{
+ static struct backlight_device *bd;
+ bd = backlight_device_register("touchbook", NULL, NULL,
+ &touchbook_backlight_properties);
+
+ if (bd) {
+ touchbook_backlight_pwm = omap_dm_timer_request_specific(
+ TB_BL_PWM_TIMER);
+ omap_dm_timer_enable(touchbook_backlight_pwm);
+ omap_dm_timer_set_source(touchbook_backlight_pwm,
+ OMAP_TIMER_SRC_SYS_CLK);
+ omap_dm_timer_set_pwm(touchbook_backlight_pwm,
+ 1, 1, OMAP_TIMER_TRIGGER_OVERFLOW_AND_COMPARE);
+
+ bd->props.max_brightness = 100;
+ bd->props.brightness = touchbook_backlight_brightness;
+ }
+
+ touchbook_backlight_update(bd);
+}
+
+static void omap3_touchbook_poweroff(void)
+{
+ int r;
+
+ r = gpio_request(TB_KILL_POWER_GPIO, "DVI reset");
+ if (r < 0) {
+ printk(KERN_ERR "Unable to get kill power GPIO\n");
+ return;
+ }
+
+ gpio_direction_output(TB_KILL_POWER_GPIO, 0);
+}
+
+static void __init early_touchbook_revision(char **p)
+{
+ if (!*p)
+ return;
+
+ strict_strtoul(*p, 10, &touchbook_revision);
+}
+__early_param("tbr=", early_touchbook_revision);
+
+static void __init omap3_touchbook_init(void)
+{
+ pm_power_off = omap3_touchbook_poweroff;
+
+ omap3_touchbook_i2c_init();
+ platform_add_devices(omap3_touchbook_devices,
+ ARRAY_SIZE(omap3_touchbook_devices));
+ omap_serial_init();
+
+ omap_cfg_reg(J25_34XX_GPIO170);
+ gpio_request(176, "DVI_nPD");
+ /* REVISIT leave DVI powered down until it's needed ... */
+ gpio_direction_output(176, true);
+
+ /* Touchscreen and accelerometer */
+ spi_register_board_info(omap3_ads7846_spi_board_info,
+ ARRAY_SIZE(omap3_ads7846_spi_board_info));
+ spi_register_board_info(omap3_mma7455l_spi_board_info,
+ ARRAY_SIZE(omap3_mma7455l_spi_board_info));
+ omap3_ads7846_init();
+ omap3_mma7455l_init();
+
+ omap3_touchbook_backlight_init();
+
+ usb_musb_init();
+ usb_ehci_init(&ehci_pdata);
+ omap3touchbook_flash_init();
+
+ /* Ensure SDRC pins are mux'd for self-refresh */
+ omap_cfg_reg(H16_34XX_SDRC_CKE0);
+ omap_cfg_reg(H17_34XX_SDRC_CKE1);
+}
+
+static void __init omap3_touchbook_map_io(void)
+{
+ omap2_set_globals_343x();
+ omap2_map_common_io();
+}
+
+MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board")
+ /* Maintainer: Gregoire Gentil - http://www.alwaysinnovating.com */
+ .phys_io = 0x48000000,
+ .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
+ .boot_params = 0x80000100,
+ .map_io = omap3_touchbook_map_io,
+ .init_irq = omap3_touchbook_init_irq,
+ .init_machine = omap3_touchbook_init,
+ .timer = &omap_timer,
+MACHINE_END
Signature · 8 lines
1.6.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Tony Lindgren
maintainerRe: [PATCH 2/5] AI TB: Board file of the Always Innovating OMAP3-based Touch Book.
Quoted 1 line · Gregoire Gentil
Board file of the Always Innovating OMAP3-based Touch Book.
Cool. Looks like the patch needs to be formatted with tabs, see Documentation/Submit* files.
Then run scripts/checkpatch.pl --strict /path/to/your/patch on each of them to check for obvious issues :)
Then resend the patches to the related mailing lists:
To linux-omap list:
1. This patch reformatted
2. Defconfig
To linux-input list with linux-omap Cc'd:
3. ...
4. ...
To alsa-devel list with linux-omap Cc'd:
5. ...
Please see the MAINTAINERS file for the file paths of the maintainers and mailing lists.
Regards,
Tony
Quoted 710 lines
Signed-off-by Gregoire Gentil <[email protected]>---
arch/arm/mach-omap2/board-omap3touchbook.c| 683
++++++++++++++++++++++++++++1 files changed, 683 insertions(+), 0 deletions(-)create mode 100644
arch/arm/mach-omap2/board-omap3touchbook.carch/arm/mach-omap2/board-omap3touchbook.c new file +212
-0@@ -0,0 +1,683 @@ +/* +* linux/arch/arm/mach-omap2/board-omap3touchbook.c +* +* Copyright (C) 2009 Always Innovating +* +* Modified from mach-omap2/board-omap3beagleboard.c +* +* Initial code: Grégoire Gentil, Tim Yamin +* +* 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/init.h> +#include <linux/platform_device.h> +#include <linux/delay.h> +#include <linux/err.h> +#include <linux/clk.h> +#include <linux/io.h> +#include <linux/leds.h> +#include <linux/gpio.h> +#include <linux/input.h> +#include <linux/gpio_keys.h> + +#include <linux/mtd/mtd.h> +#include <linux/mtd/partitions.h> +#include <linux/mtd/nand.h> + +#include <plat/mcspi.h> +#include <linux/spi/spi.h> + +#include <linux/spi/ads7846.h> +#include <linux/mma7455l.h> + +#include <plat/dmtimer.h> +#include <linux/backlight.h> + +#include <linux/regulator/machine.h> +#include <linux/i2c/twl4030.h> + +#include <mach/hardware.h> +#include <asm/mach-types.h> +#include <asm/mach/arch.h> +#include <asm/mach/map.h> +#include <asm/mach/flash.h> + +#include <plat/board.h> +#include <plat/common.h> +#include <plat/gpmc.h> +#include <plat/nand.h> +#include <plat/mux.h> +#include <plat/usb.h> +#include <plat/timer-gp.h> + +#include "mmc-twl4030.h" + +#include <asm/setup.h> + +#define GPMC_CS0_BASE 0x60 +#define GPMC_CS_SIZE 0x30 + +#define NAND_BLOCK_SIZE SZ_128K + +#define OMAP3_AC_GPIO 136 +#define OMAP3_TS_GPIO 162 +#define TB_BL_PWM_TIMER 9 +#define TB_KILL_POWER_GPIO 168 + +unsigned long touchbook_revision; + +static struct mtd_partition omap3touchbook_nand_partitions[] = { +/* All the partition sizes are listed in terms of NAND block size */ + { + .name ="X-Loader" , + .offset =0 , + .size =4 *NAND_BLOCK_SIZE , + .mask_flags =MTD_WRITEABLE ,/* force read-only */ + }, + { + .name ="U-Boot" , + .offset =MTDPART_OFS_APPEND ,/* Offset = 0x80000 */ + .size =15 *NAND_BLOCK_SIZE , + .mask_flags =MTD_WRITEABLE ,/* force read-only */ + }, + { + .name ="U-Boot Env" , + .offset =MTDPART_OFS_APPEND ,/* Offset = 0x260000 */ + .size =1 *NAND_BLOCK_SIZE , + }, + { + .name ="Kernel" , + .offset =MTDPART_OFS_APPEND ,/* Offset = 0x280000 */ + .size =32 *NAND_BLOCK_SIZE , + }, + { + .name ="File System" , + .offset =MTDPART_OFS_APPEND ,/* Offset = 0x680000 */ + .size =MTDPART_SIZ_FULL , + }, +}; + +static struct omap_nand_platform_data omap3touchbook_nand_data = { + .options =NAND_BUSWIDTH_16 , + .parts = omap3touchbook_nand_partitions, + .nr_parts =ARRAY_SIZE (omap3touchbook_nand_partitions), + .dma_channel =-1 ,/* disable DMA in OMAP NAND driver */ + .nand_setup =NULL , + .dev_ready =NULL , +}; + +static struct resource omap3touchbook_nand_resource = { + .flags =IORESOURCE_MEM , +}; + +static struct platform_device omap3touchbook_nand_device = { + .name ="omap2-nand" , + .id =-1 , + .dev = { + .platform_data = &omap3touchbook_nand_data, + }, + .num_resources =1 , + .resource = &omap3touchbook_nand_resource, +}; + +#include "sdram-micron-mt46h32m32lf-6.h" + +static struct twl4030_hsmmc_info mmc[] = { + { + .mmc =1 , + .wires =8 , + .gpio_wp =29 , + }, + {}/* Terminator */ +}; + +static struct platform_device omap3_touchbook_lcd_device = { + .name ="omap3touchbook_lcd" , + .id =-1 , +}; + +static struct omap_lcd_config omap3_touchbook_lcd_config__initdata = { + .ctrl_name ="internal" , +}; + +static struct regulator_consumer_supply touchbook_vmmc1_supply = { + .supply ="vmmc" , +}; + +static struct regulator_consumer_supply touchbook_vsim_supply = { + .supply ="vmmc_aux" , +}; + +static struct gpio_led gpio_leds[]; + +static int touchbook_twl_gpio_setup (struct device *dev, +unsigned gpio,unsigned ngpio) +{ +if (system_rev >=0x20 && system_rev <=0x34301000 ) { +omap_cfg_reg (AG9_34XX_GPIO23 ); + mmc[0 ].gpio_wp =23 ; + }else { +omap_cfg_reg (AH8_34XX_GPIO29 ); + } +/* gpio + 0 is "mmc0_cd" (input/IRQ) */ + mmc[0 ].gpio_cd = gpio +0 ; +twl4030_mmc_init (mmc); + +/* link regulators to MMC adapters */ + touchbook_vmmc1_supply.dev = mmc[0 ].dev; + touchbook_vsim_supply.dev = mmc[0 ].dev; + +/* REVISIT: need ehci-omap hooks for external VBUS +* power switch and overcurrent detect +*/ + +gpio_request (gpio +1 ,"EHCI_nOC" ); +gpio_direction_input (gpio +1 ); + +/* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */ +gpio_request (gpio +TWL4030_GPIO_MAX ,"nEN_USB_PWR" ); +gpio_direction_output (gpio +TWL4030_GPIO_MAX ,0 ); + +/* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ + gpio_leds[2 ].gpio = gpio +TWL4030_GPIO_MAX +1 ; + +return 0 ; +} + +static struct twl4030_gpio_platform_data touchbook_gpio_data = { + .gpio_base =OMAP_MAX_GPIO_LINES , + .irq_base =TWL4030_GPIO_IRQ_BASE , + .irq_end =TWL4030_GPIO_IRQ_END , + .use_leds = true, + .pullups =BIT (1 ), + .pulldowns =BIT (2 ) |BIT (6 ) |BIT (7 ) |BIT (8 ) |BIT (13 ) + |BIT (15 ) |BIT (16 ) |BIT (17 ), + .setup = touchbook_twl_gpio_setup, +}; + +static struct regulator_consumer_supply touchbook_vdac_supply = { + .supply ="vdac" , + .dev = &omap3_touchbook_lcd_device.dev, +}; + +static struct regulator_consumer_supply touchbook_vdvi_supply = { + .supply ="vdvi" , + .dev = &omap3_touchbook_lcd_device.dev, +}; + +/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
arch/arm/mach-omap2/board-omap3touchbook.c new file +146
-0+static struct regulator_init_data touchbook_vmmc1 = { + .constraints = { + .min_uV =1850000 , + .max_uV =3150000 , + .valid_modes_mask =REGULATOR_MODE_NORMAL + |REGULATOR_MODE_STANDBY , + .valid_ops_mask =REGULATOR_CHANGE_VOLTAGE + |REGULATOR_CHANGE_MODE + |REGULATOR_CHANGE_STATUS , + }, + .num_consumer_supplies =1 , + .consumer_supplies = &touchbook_vmmc1_supply, +}; + +/* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */ +static struct regulator_init_data touchbook_vsim = { + .constraints = { + .min_uV =1800000 , + .max_uV =3000000 , + .valid_modes_mask =REGULATOR_MODE_NORMAL + |REGULATOR_MODE_STANDBY , + .valid_ops_mask =REGULATOR_CHANGE_VOLTAGE + |REGULATOR_CHANGE_MODE + |REGULATOR_CHANGE_STATUS , + }, + .num_consumer_supplies =1 , + .consumer_supplies = &touchbook_vsim_supply, +}; + +/* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */ +static struct regulator_init_data touchbook_vdac = { + .constraints = { + .min_uV =1800000 , + .max_uV =1800000 , + .valid_modes_mask =REGULATOR_MODE_NORMAL + |REGULATOR_MODE_STANDBY , + .valid_ops_mask =REGULATOR_CHANGE_MODE + |REGULATOR_CHANGE_STATUS , + }, + .num_consumer_supplies =1 , + .consumer_supplies = &touchbook_vdac_supply, +}; + +/* VPLL2 for digital video outputs */ +static struct regulator_init_data touchbook_vpll2 = { + .constraints = { + .name ="VDVI" , + .min_uV =1800000 , + .max_uV =1800000 , + .valid_modes_mask =REGULATOR_MODE_NORMAL + |REGULATOR_MODE_STANDBY , + .valid_ops_mask =REGULATOR_CHANGE_MODE + |REGULATOR_CHANGE_STATUS , + }, + .num_consumer_supplies =1 , + .consumer_supplies = &touchbook_vdvi_supply, +}; + +static struct twl4030_usb_data touchbook_usb_data = { + .usb_mode =T2_USB_MODE_ULPI , +}; + +static struct twl4030_codec_audio_data touchbook_audio_data = { + .audio_mclk =26000000 , +}; + +static struct twl4030_codec_data touchbook_codec_data = { + .audio_mclk =26000000 , + .audio = &touchbook_audio_data, +}; + +static struct twl4030_platform_data touchbook_twldata = { + .irq_base =TWL4030_IRQ_BASE , + .irq_end =TWL4030_IRQ_END , + +/* platform_data for children goes here */ + .usb = &touchbook_usb_data, + .gpio = &touchbook_gpio_data, + .codec = &touchbook_codec_data, + .vmmc1 = &touchbook_vmmc1, + .vsim = &touchbook_vsim, + .vdac = &touchbook_vdac, + .vpll2 = &touchbook_vpll2, +}; + +static struct i2c_board_info __initdata touchbook_i2c_boardinfo[] = { + { +I2C_BOARD_INFO ("twl4030" ,0x48 ), + .flags =I2C_CLIENT_WAKE , + .irq =INT_34XX_SYS_NIRQ , + .platform_data = &touchbook_twldata, + }, +}; + +static struct i2c_board_info __initdata touchBook_i2c_boardinfo[] = { + { +I2C_BOARD_INFO ("bq27200" ,0x55 ), + }, +}; + +static int __init omap3_touchbook_i2c_init (void ) +{ +/* Standard TouchBook bus */ +omap_register_i2c_bus (1 ,2600 , touchbook_i2c_boardinfo, +ARRAY_SIZE (touchbook_i2c_boardinfo)); + +/* Additional TouchBook bus */ +omap_register_i2c_bus (3 ,100 , touchBook_i2c_boardinfo, +ARRAY_SIZE (touchBook_i2c_boardinfo)); + +return 0 ; +} + +static void __init omap3_ads7846_init (void ) +{ +if (gpio_request (OMAP3_TS_GPIO ,"ads7846_pen_down" )) { +printk (KERN_ERR "Failed to request GPIO %d for " +"ads7846 pen down IRQ\n" ,OMAP3_TS_GPIO ); +return ; + } + +gpio_direction_input (OMAP3_TS_GPIO ); +omap_set_gpio_debounce (OMAP3_TS_GPIO ,1 ); +omap_set_gpio_debounce_time (OMAP3_TS_GPIO ,0xa ); +} + +static struct ads7846_platform_data ads7846_config = { + .x_min =100 , + .y_min =265 , + .x_max =3950 , + .y_max =3750 , + .x_plate_ohms =40 , + .pressure_max =255 , + .debounce_max =10 , + .debounce_tol =5 , + .debounce_rep =1 , + .gpio_pendown =OMAP3_TS_GPIO , + .keep_vref_on =1 , +}; + +static struct omap2_mcspi_device_config ads7846_mcspi_config = { + .turbo_mode =0 , + .single_channel =1 ,/* 0: slave, 1: master */ +}; + +static struct spi_board_info omap3_ads7846_spi_board_info[]__initdata = {
+ {
+ .modalias = "ads7846",
+ .bus_num = 4,
+ .chip_select = 0,
+ .max_speed_hz = 1500000,
+ .controller_data =&ads7846_mcspi_config,
+ .irq =OMAP_GPIO_IRQ(OMAP3_TS_GPIO),
+ .platform_data =&ads7846_config,
+ }arch/arm/mach-omap2/board-omap3touchbook.c new file +62
-0+}; + +static struct gpio_led gpio_leds[] = { + { + .name ="touchbook::usr0" , + .default_trigger ="heartbeat" , + .gpio =150 , + }, + { + .name ="touchbook::usr1" , + .default_trigger ="mmc0" , + .gpio =149 , + }, + { + .name ="touchbook::pmu_stat" , + .gpio = -EINVAL ,/* gets replaced */ + .active_low = true, + }, +}; + +static struct gpio_led_platform_data gpio_led_info = { + .leds = gpio_leds, + .num_leds =ARRAY_SIZE (gpio_leds), +}; + +static struct platform_device leds_gpio = { + .name ="leds-gpio" , + .id =-1 , + .dev = { + .platform_data = &gpio_led_info, + }, +}; + +static struct gpio_keys_button gpio_buttons[] = { + { + .code =BTN_EXTRA , + .gpio =7 , + .desc ="user" , + .wakeup =1 , + }, + { + .code =KEY_POWER , + .gpio =183 , + .desc ="power" , + .wakeup =1 , + }, +}; + +static struct gpio_keys_platform_data gpio_key_info = { + .buttons = gpio_buttons, + .nbuttons =ARRAY_SIZE (gpio_buttons), +}; + +static struct platform_device keys_gpio = { + .name ="gpio-keys" , + .id =-1 , + .dev = { + .platform_data = &gpio_key_info, + }, +}; + +static struct omap_board_config_kernel omap3_touchbook_config[]
__initdata= {
+ {OMAP_TAG_LCD,&omap3_touchbook_lcd_config},arch/arm/mach-omap2/board-omap3touchbook.c new file +86
-0+}; + +static void __init omap3_touchbook_init_irq (void ) +{ + omap_board_config = omap3_touchbook_config; + omap_board_config_size =ARRAY_SIZE (omap3_touchbook_config); +omap2_init_common_hw (mt46h32m32lf6_sdrc_params, + mt46h32m32lf6_sdrc_params); +omap_init_irq (); +#ifdef CONFIG_OMAP_32K_TIMER +omap2_gp_clockevent_set_gptimer (12 ); +#endif +omap_gpio_init (); +} + +static struct platform_device *omap3_touchbook_devices[]__initdata = { + &omap3_touchbook_lcd_device, + &leds_gpio, + &keys_gpio, +}; + +static void __init omap3touchbook_flash_init (void ) +{ +u8 cs =0 ; +u8 nandcs =GPMC_CS_NUM +1 ; + +u32 gpmc_base_add =OMAP34XX_GPMC_VIRT ; + +/* find out the chip-select on which NAND exists */ +while (cs <GPMC_CS_NUM ) { +u32 ret =0 ; + ret =gpmc_cs_read_reg (cs,GPMC_CS_CONFIG1 ); + +if ((ret &0xC00 ) ==0x800 ) { +printk (KERN_INFO "Found NAND on CS%d\n" , cs); +if (nandcs >GPMC_CS_NUM ) + nandcs = cs; + } + cs++; + } + +if (nandcs >GPMC_CS_NUM ) { +printk (KERN_INFO "NAND: Unable to find configuration " +"in GPMC\n " ); +return ; + } + +if (nandcs <GPMC_CS_NUM ) { + omap3touchbook_nand_data.cs = nandcs; + omap3touchbook_nand_data.gpmc_cs_baseaddr = (void *) + (gpmc_base_add +GPMC_CS0_BASE + nandcs *GPMC_CS_SIZE ); + omap3touchbook_nand_data.gpmc_baseaddr = + (void *) (gpmc_base_add); + +printk (KERN_INFO "Registering NAND on CS%d\n" , nandcs); +if (platform_device_register (&omap3touchbook_nand_device) <0 ) +printk (KERN_ERR "Unable to register NAND device\n" ); + } +} + +static void __init omap3_mma7455l_init (void ) +{ +int ret; + + ret =gpio_request (OMAP3_AC_GPIO ,"mma7455l" ); +if (ret <0 ) { +printk (KERN_ERR "Failed to request GPIO %d for mma7455l IRQ\n" , +OMAP3_AC_GPIO ); +return ; + } + +gpio_direction_input (OMAP3_AC_GPIO ); +} + +static struct mma7455l_platform_data mma7455l_config = { + .calibration_x =-4 , + .calibration_y =28 , + .calibration_z =-28 , +}; + +static struct omap2_mcspi_device_config mma7455l_mcspi_config = { + .turbo_mode =0 , + .single_channel =1 ,/* 0: slave, 1: master */ +}; + +static struct spi_board_info omap3_mma7455l_spi_board_info[]__initdata = {
+ {
+ .modalias = "mma7455l",
+ .bus_num = 3,
+ .chip_select = 0,
+ .max_speed_hz = 200000,
+ .irq =OMAP_GPIO_IRQ(OMAP3_AC_GPIO),
+ .controller_data =&mma7455l_mcspi_config,
+ .platform_data =&mma7455l_config,
+ }arch/arm/mach-omap2/board-omap3touchbook.c new file +158
-0+}; + +static struct ehci_hcd_omap_platform_data ehci_pdata__initconst = { + + .port_mode[0 ] =EHCI_HCD_OMAP_MODE_PHY , + .port_mode[1 ] =EHCI_HCD_OMAP_MODE_PHY , + .port_mode[2 ] =EHCI_HCD_OMAP_MODE_UNKNOWN , + + .phy_reset = true, + .reset_gpio_port[0 ] = -EINVAL , + .reset_gpio_port[1 ] =147 , + .reset_gpio_port[2 ] = -EINVAL +}; + +static int touchbook_backlight_brightness =50 ; +static struct omap_dm_timer *touchbook_backlight_pwm; + +static int touchbook_backlight_read (struct backlight_device *bd) +{ +return touchbook_backlight_brightness; +} + +static int touchbook_backlight_update (struct backlight_device *bd) +{ +int value = bd->props.brightness; + touchbook_backlight_brightness = value; + +/* Frequency calculation: +- For 200Hz PWM, you want to load -164 (=> -32768Hz / 200Hz). +- Minimum duty cycle for the backlight is 15%. +- You have (164*0.85) => ~140 levels of brightness. +*/ + +/* For maximum brightness, just stop the timer... */ +if (value != bd->props.max_brightness) { +/* Load the appropriate value for 200Hz PWM */ +u32 period =clk_get_rate (omap_dm_timer_get_fclk ( + touchbook_backlight_pwm)) /200 ; + +/* Minimum duty cycle is 15% */ +u32 minimum = (period *3 ) /20 ; +u32 maximum = (period *17 ) /20 ; + +/* Work out match value */ +u32 match = (maximum * value) /100 ; + +/* Start... */ +omap_dm_timer_set_load (touchbook_backlight_pwm, +1 ,0xFFFFFFFF - period -1 ); +omap_dm_timer_set_match (touchbook_backlight_pwm, +1 ,0xFFFFFFFF - minimum - match); +omap_dm_timer_write_counter (touchbook_backlight_pwm,-1 ); +omap_dm_timer_start (touchbook_backlight_pwm); + }else +omap_dm_timer_stop (touchbook_backlight_pwm); + + +return 0 ; +} + +static struct backlight_ops touchbook_backlight_properties = { + .get_brightness = touchbook_backlight_read, + .update_status = touchbook_backlight_update, +}; + +static void __init omap3_touchbook_backlight_init (void ) +{ +static struct backlight_device *bd; + bd =backlight_device_register ("touchbook" ,NULL ,NULL , + &touchbook_backlight_properties); + +if (bd) { + touchbook_backlight_pwm =omap_dm_timer_request_specific ( +TB_BL_PWM_TIMER ); +omap_dm_timer_enable (touchbook_backlight_pwm); +omap_dm_timer_set_source (touchbook_backlight_pwm, +OMAP_TIMER_SRC_SYS_CLK ); +omap_dm_timer_set_pwm (touchbook_backlight_pwm, +1 ,1 ,OMAP_TIMER_TRIGGER_OVERFLOW_AND_COMPARE ); + + bd->props.max_brightness =100 ; + bd->props.brightness = touchbook_backlight_brightness; + } + +touchbook_backlight_update (bd); +} + +static void omap3_touchbook_poweroff (void ) +{ +int r; + + r =gpio_request (TB_KILL_POWER_GPIO ,"DVI reset" ); +if (r <0 ) { +printk (KERN_ERR "Unable to get kill power GPIO\n" ); +return ; + } + +gpio_direction_output (TB_KILL_POWER_GPIO ,0 ); +} + +static void __init early_touchbook_revision (char **p) +{ +if (!*p) +return ; + +strict_strtoul (*p,10 , &touchbook_revision); +} +__early_param ("tbr=" , early_touchbook_revision); + +static void __init omap3_touchbook_init (void ) +{ + pm_power_off = omap3_touchbook_poweroff; + +omap3_touchbook_i2c_init (); +platform_add_devices (omap3_touchbook_devices, +ARRAY_SIZE (omap3_touchbook_devices)); +omap_serial_init (); + +omap_cfg_reg (J25_34XX_GPIO170 ); +gpio_request (176 ,"DVI_nPD" ); +/* REVISIT leave DVI powered down until it's needed ... */ +gpio_direction_output (176 , true); + +/* Touchscreen and accelerometer */ +spi_register_board_info (omap3_ads7846_spi_board_info, +ARRAY_SIZE (omap3_ads7846_spi_board_info)); +spi_register_board_info (omap3_mma7455l_spi_board_info, +ARRAY_SIZE (omap3_mma7455l_spi_board_info)); +omap3_ads7846_init (); +omap3_mma7455l_init (); + +omap3_touchbook_backlight_init (); + +usb_musb_init (); +usb_ehci_init (&ehci_pdata); +omap3touchbook_flash_init (); + +/* Ensure SDRC pins are mux'd for self-refresh */ +omap_cfg_reg (H16_34XX_SDRC_CKE0 ); +omap_cfg_reg (H17_34XX_SDRC_CKE1 ); +} + +static void __init omap3_touchbook_map_io (void ) +{ +omap2_set_globals_343x (); +omap2_map_common_io (); +} + +MACHINE_START (TOUCHBOOK ,"OMAP3 touchbook Board" ) +/* Maintainer: Gregoire Gentil - http://www.alwaysinnovating.com */ + .phys_io = 0x48000000, + .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc, + .boot_params = 0x80000100, + .map_io = omap3_touchbook_map_io, + .init_irq = omap3_touchbook_init_irq, + .init_machine = omap3_touchbook_init, + .timer = &omap_timer, +MACHINE_END Signature · 1 line
1.6.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 3/5 AI TB: Driver for the Freescale MMA7455L accelerometer
In reply to Cory MaccarroneDriver for the Freescale MMA7455L accelerometer
---
drivers/input/misc/Kconfig | 9 + drivers/input/misc/Makefile | 2 +- drivers/input/misc/mma7455l.c | 625 +++++++++++++++++++++++++++++++++++++++++ include/linux/mma7455l.h | 11 + 4 files changed, 646 insertions(+), 1 deletions(-)
create mode 100644 drivers/input/misc/mma7455l.c
create mode 100644 include/linux/mma7455l.h
drivers/input/misc/Kconfig +9 -0
@@ -317,4 +317,13 @@ config INPUT_PCAP To compile this driver as a module, choose M here: the module will be called pcap_keys. +config INPUT_MMA7455L + tristate "Freescale MMA7455L 3-axis accelerometer" + depends on SPI_MASTER + help + SPI driver for the Freescale MMA7455L 3-axis accelerometer. + + The userspace interface is a 3-axis (X/Y/Z) relative movement + Linux input device, reporting REL_[XYZ] events. +
endif
drivers/input/misc/Makefile +0 -0
@@ -30,4 +30,4 @@ obj-$(CONFIG_INPUT_WINBOND_CIR) += winbond-cir.o
obj-$(CONFIG_INPUT_WISTRON_BTNS) += wistron_btns.o obj-$(CONFIG_INPUT_WM831X_ON) += wm831x-on.o obj-$(CONFIG_INPUT_YEALINK) += yealink.o
-
+obj-$(CONFIG_INPUT_MMA7455L) += mma7455l.o
(quoted diff) +0 -0
b/drivers/input/misc/mma7455l.c
new file mode 100644
index 0000000..771d4b7
drivers/input/misc/mma7455l.c new file +128 -0
128 lines not on this page · raw message
reg)
+{
+ int rc;
+ u_int8_t cmd;
+
+ cmd = ((reg & 0x3f) << ADDR_SHIFT);
+ rc = spi_w8r8(mma->spi_dev, cmd);
+
+ return rc;
+}
+
+static u_int8_t reg_read(struct mma7455l_info *mma, u_int8_t reg) +{
+ u_int8_t ret;
+
+ mutex_lock(&mma->lock);
+ ret = __reg_read(mma, reg);
+ mutex_unlock(&mma->lock);
+
+ return ret;
+}
+
+static s16 __reg_read_10(struct mma7455l_info *mma, u8 reg1, u8 reg2) +{
+ u8 v1, v2;
+
+ v1 = __reg_read(mma, reg1);
+ v2 = __reg_read(mma, reg2);
+
+ return (v2 & 0x4) << 13 | (v2 & 0x3) << 8 | v1;
+}
+
+static inline int __reg_write(struct mma7455l_info *mma,
+ u_int8_t reg, u_int8_t val)
+{
+ u_int8_t buf[2];
+
+ buf[0] = ((reg & 0x3f) << ADDR_SHIFT) | WRITE_BIT;
+ buf[1] = val;
+
+ return spi_write(mma->spi_dev, buf, sizeof(buf));
+}
+
+static int reg_write(struct mma7455l_info *mma, u_int8_t reg, u_int8_t val)
+{
+ int ret;
+
+ mutex_lock(&mma->lock);
+ ret = __reg_write(mma, reg, val);
+ mutex_unlock(&mma->lock);
+
+ return ret;
+}
+
+static s16 __reg_write_10(struct mma7455l_info *mma,
+ u8 reg1, u8 reg2, s16 value)
+{
+ int ret;
+ u8 v1, v2;
+
+ v1 = value & 0xFF;
+ if (value < 0)
+ v2 = ((value >> 8) & 0x3) | 0x4;
+ else
+ v2 = 0;
+
+ ret = __reg_write(mma, reg1, v1);
+ ret = __reg_write(mma, reg2, v2);
+ return ret;
+}
+
+static void mma7455l_work(struct work_struct *work)
+{
+ struct mma7455l_info *mma =
+ container_of(work, struct mma7455l_info, work.work);
+
+ s8 val;
+ mma->working = 1;
+
+ /* FIXME: 10 bit accuracy? */
+ if (!(mma->flags & MMA7455L_STATUS_XDA)) {
+ val = reg_read(mma, MMA7455L_REG_XOUT8);
+ input_report_abs(mma->input_dev, ABS_X, val);
+ }
+ if (!(mma->flags & MMA7455L_STATUS_YDA)) {
+ val = reg_read(mma, MMA7455L_REG_YOUT8);
+ input_report_abs(mma->input_dev, ABS_Y, val);
+ }
+ if (!(mma->flags & MMA7455L_STATUS_ZDA)) {
+ val = reg_read(mma, MMA7455L_REG_ZOUT8);
+ input_report_abs(mma->input_dev, ABS_Z, val);
+ }
+
+ mma->working = 0;
+ input_sync(mma->input_dev);
+ put_device(&mma->spi_dev->dev);
+
+ /* Enable IRQ and clear out interrupt */
+ reg_write(mma, MMA7455L_REG_INTRST, 0x3);
+ reg_write(mma, MMA7455L_REG_INTRST, 0x0);
+ enable_irq(mma->spi_dev->irq);
+}
+
+static void mma7455l_schedule_work(struct mma7455l_info *mma) +{
+ int status;
+
+ get_device(&mma->spi_dev->dev);
+ status = schedule_delayed_work(&mma->work, HZ / 10);
+}
+
+static irqreturn_t mma7455l_interrupt(int irq, void *_mma) +{
+ struct mma7455l_info *mma = _mma;
+ mma7455l_schedule_work(mma);
+
+ /* Disable any further interrupts until we have processed
+ * the current one */
+ disable_irq(mma->spi_dev->irq);
+ return IRQ_HANDLED;
+}
+
+/* sysfs */
+
+static void get_mode(struct mma7455l_info *mma, u8 *mode, u8 *gSelect) +{
+ u8 tmp = reg_read(mma, MMA7455L_REG_MCTL);
+
+ *mode = tmp & MMA7455L_MODE_MASK;
+ *gSelect = tmp & MMA7455L_GSELECT_MASK;
+}
+
+static void set_mode(struct mma7455l_info *mma, u8 mode, u8 gSelect) +{
+ reg_write(mma, MMA7455L_REG_MCTL, mode | gSelect);
+}
+
+static void update_mode(struct mma7455l_info *mma, u8 mode, u8 gSelect) +{
+ mma->mode = mode;
+ mma->gSelect = gSelect;
+
+ reg_write(mma, MMA7455L_REG_MCTL, mma->mode | mma->gSelect); +}
+
+static ssize_t show_measure(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct mma7455l_info *mma = dev_get_drvdata(dev);
+ s8 x, y, z;
+ u8 old_Mode, old_gSelect;
+
+ get_mode(mma, &old_Mode, &old_gSelect);
+ set_mode(mma, MMA7455L_MODE_MEASUREMENT, MMA7455L_GSELECT_2); +
+ while (reg_read(mma, MMA7455L_REG_STATUS) == 0)
+ msleep(10);
+
+ x = reg_read(mma, MMA7455L_REG_XOUT8);
+ y = reg_read(mma, MMA7455L_REG_YOUT8);
+ z = reg_read(mma, MMA7455L_REG_ZOUT8);
+
+ set_mode(mma, old_Mode, old_gSelect);
+ return sprintf(buf, "%d %d %d\n", x, y, z);
+}
+
+static ssize_t show_mode(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct mma7455l_info *mma = dev_get_drvdata(dev);
+
+ switch (mma->mode) {
+ case MMA7455L_MODE_STANDBY:
+ return sprintf(buf, "Standby\n");
+ break;
+ case MMA7455L_MODE_MEASUREMENT:
+ return sprintf(buf, "Measurement\n");
+ break;
+ case MMA7455L_MODE_LEVELDETECTION:
+ return sprintf(buf, "Level Detection\n");
+ break;
+ case MMA7455L_MODE_PULSEDETECTION:
+ return sprintf(buf, "Pulse Detection\n");
+ break;
+ }
+
+ return sprintf(buf, "Unknown mode!\n");
+}
+
+static ssize_t show_gSelect(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct mma7455l_info *mma = dev_get_drvdata(dev);
+
+ switch (mma->gSelect) {
+ case MMA7455L_GSELECT_8:
+ return sprintf(buf, "8\n");
+ break;
+ case MMA7455L_GSELECT_4:
+ return sprintf(buf, "4\n");
+ break;
+ case MMA7455L_GSELECT_2:
+ return sprintf(buf, "2\n");
+ break;
+ }
+
+ return sprintf(buf, "Unknown gSelect!\n");
+}
+
+static ssize_t show_level_threshold(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct mma7455l_info *mma = dev_get_drvdata(dev);
+ return sprintf(buf, "%u\n", reg_read(mma, MMA7455L_REG_LDTH)); +}
+
+static ssize_t show_calibration(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ s16 x, y, z;
+ struct mma7455l_info *mma = dev_get_drvdata(dev);
+
+ mutex_lock(&mma->lock);
+ x = __reg_read_10(mma, MMA7455L_REG_XOFFL, MMA7455L_REG_XOFFH);
+ y = __reg_read_10(mma, MMA7455L_REG_YOFFL, MMA7455L_REG_YOFFH);
+ z = __reg_read_10(mma, MMA7455L_REG_ZOFFL, MMA7455L_REG_ZOFFH);
+ mutex_unlock(&mma->lock);
+
+ return sprintf(buf, "%d %d %d\n", x, y, z);
+}
+
+static ssize_t write_mode(struct device *dev,
+ struct device_attribute *attr, const char *buf, size_t count) +{
+ struct mma7455l_info *mma = dev_get_drvdata(dev);
+
+ if (!strncmp(buf, "Standby", count))
+ update_mode(mma, MMA7455L_MODE_STANDBY, mma->gSelect);
+ else if (!strncmp(buf, "Measurement", count))
+ update_mode(mma, MMA7455L_MODE_MEASUREMENT, mma->gSelect);
+ else if (!strncmp(buf, "Level Detection", count))
+ update_mode(mma, MMA7455L_MODE_LEVELDETECTION, mma->gSelect);
+ else if (!strncmp(buf, "Pulse Detection", count))
+ update_mode(mma, MMA7455L_MODE_PULSEDETECTION, mma->gSelect); +
+ return count;
+}
+
+static ssize_t write_gSelect(struct device *dev,
+ struct device_attribute *attr, const char *buf, size_t count) +{
+ unsigned long v;
+ struct mma7455l_info *mma = dev_get_drvdata(dev);
+
+ if (strict_strtoul(buf, 10, &v) == 0) {
+ switch (v) {
+ case 8:
+ update_mode(mma, mma->mode, MMA7455L_GSELECT_8);
+ break;
+ case 4:
+ update_mode(mma, mma->mode, MMA7455L_GSELECT_4);
+ break;
+ case 2:
+ update_mode(mma, mma->mode, MMA7455L_GSELECT_2);
+ break;
+ default:
+ return -EINVAL;
+ break;
+ }
+ return count;
+ }
+
+ return -EINVAL;
+}
+
+static ssize_t write_level_threshold(struct device *dev,
+ struct device_attribute *attr, const char *buf, size_t count) +{
+ unsigned long v;
+ struct mma7455l_info *mma = dev_get_drvdata(dev);
+
+ if (strict_strtoul(buf, 10, &v) == 0) {
+ if (v <= 0xFF) {
+ reg_write(mma, MMA7455L_REG_LDTH, v);
+ return count;
+ } else
+ return -EINVAL;
+ }
+
+ return -EINVAL;
+}
+
+static ssize_t write_calibration(struct device *dev,
+ struct device_attribute *attr, const char *buf, size_t count) +{
+ int x, y, z;
+ struct mma7455l_info *mma = dev_get_drvdata(dev);
+
+ if (sscanf(buf, "%d %d %d", &x, &y, &z) == 3) {
+ mutex_lock(&mma->lock);
+ __reg_write_10(mma, MMA7455L_REG_XOFFL, MMA7455L_REG_XOFFH, x);
+ __reg_write_10(mma, MMA7455L_REG_YOFFL, MMA7455L_REG_YOFFH, y);
+ __reg_write_10(mma, MMA7455L_REG_ZOFFL, MMA7455L_REG_ZOFFH, z);
+ mutex_unlock(&mma->lock);
+
+ return count;
+ }
+
+ return -EINVAL;
+}
+
+static DEVICE_ATTR(measure, S_IRUGO, show_measure, NULL); +static DEVICE_ATTR(mode, S_IRUGO | S_IWUGO, show_mode, write_mode); +static DEVICE_ATTR(gSelect, S_IRUGO | S_IWUGO, show_gSelect, write_gSelect);
+static DEVICE_ATTR(level_threshold, S_IRUGO | S_IWUGO, show_level_threshold,
+ write_level_threshold);
+static DEVICE_ATTR(calibration, S_IRUGO | S_IWUGO, show_calibration,
+ write_calibration);
+
+static struct attribute *mma7455l_sysfs_entries[] = {
+ &dev_attr_measure.attr,
+ &dev_attr_mode.attr,
+ &dev_attr_gSelect.attr,
+ &dev_attr_level_threshold.attr,
+ &dev_attr_calibration.attr,
+ NULL
+};
+
+static struct attribute_group mma7455l_attr_group = {
+ .attrs = mma7455l_sysfs_entries,
+};
+
+/* input device handling and driver core interaction */ +static int mma7455l_input_open(struct input_dev *inp)
+{
+ struct mma7455l_info *mma = input_get_drvdata(inp);
+ if (mma->mode == MMA7455L_MODE_STANDBY)
+ update_mode(mma, MMA7455L_MODE_MEASUREMENT, mma->gSelect); +
+ return 0;
+}
+
+static void mma7455l_input_close(struct input_dev *inp)
+{
+ struct mma7455l_info *mma = input_get_drvdata(inp);
+ update_mode(mma, MMA7455L_MODE_STANDBY, MMA7455L_GSELECT_2); +}
+
+static int __devinit mma7455l_probe(struct spi_device *spi) +{
+ int rc;
+ struct mma7455l_info *mma;
+ struct mma7455l_platform_data *pdata = spi->dev.platform_data;
+ u_int8_t wai;
+
+ mma = kzalloc(sizeof(*mma), GFP_KERNEL);
+ if (!mma)
+ return -ENOMEM;
+
+ mutex_init(&mma->lock);
+ INIT_DELAYED_WORK(&mma->work, mma7455l_work);
+ mma->spi_dev = spi;
+ mma->flags = mma->working = 0;
+
+ spi_set_drvdata(spi, mma);
+
+ rc = spi_setup(spi);
+ if (rc < 0) {
+ printk(KERN_ERR
+ "mma7455l error durign spi_setup of mma7455l driver\n");
+ dev_set_drvdata(&spi->dev, NULL);
+ kfree(mma);
+ return rc;
+ }
+
+ wai = reg_read(mma, MMA7455L_REG_WHOAMI);
+ if (wai != MMA7455L_WHOAMI_MAGIC) {
+ printk(KERN_ERR
+ "mma7455l unknown whoami signature 0x%02x\n", wai);
+ dev_set_drvdata(&spi->dev, NULL);
+ kfree(mma);
+ return -ENODEV;
+ }
+
+ rc = request_irq(mma->spi_dev->irq, mma7455l_interrupt,
+ IRQF_TRIGGER_HIGH, "mma7455l", mma);
+ if (rc < 0) {
+ dev_err(&spi->dev, "mma7455l error requesting IRQ %d\n",
+ mma->spi_dev->irq);
+ /* FIXME */
+ return rc;
+ }
+
+ rc = sysfs_create_group(&spi->dev.kobj, &mma7455l_attr_group);
+ if (rc) {
+ dev_err(&spi->dev, "error creating sysfs group\n");
+ return rc;
+ }
+
+ /* initialize input layer details */
+ mma->input_dev = input_allocate_device();
+ if (!mma->input_dev) {
+ dev_err(&spi->dev,
+ "mma7455l Unable to allocate input device\n");
+ /* FIXME */
+ }
+
+ set_bit(EV_ABS, mma->input_dev->evbit);
+ set_bit(ABS_X, mma->input_dev->absbit);
+ set_bit(ABS_Y, mma->input_dev->absbit);
+ set_bit(ABS_Z, mma->input_dev->absbit);
+
+ input_set_drvdata(mma->input_dev, mma);
+ mma->input_dev->name = "MMA7455L";
+ mma->input_dev->open = mma7455l_input_open;
+ mma->input_dev->close = mma7455l_input_close;
+
+ rc = input_register_device(mma->input_dev);
+ if (!rc) {
+ update_mode(mma, MMA7455L_MODE_STANDBY, MMA7455L_GSELECT_2); +
+ mutex_lock(&mma->lock);
+ __reg_write_10(mma, MMA7455L_REG_XOFFL,
+ MMA7455L_REG_XOFFH, pdata->calibration_x);
+ __reg_write_10(mma, MMA7455L_REG_YOFFL,
+ MMA7455L_REG_YOFFH, pdata->calibration_y);
+ __reg_write_10(mma, MMA7455L_REG_ZOFFL,
+ MMA7455L_REG_ZOFFH, pdata->calibration_z);
+ mutex_unlock(&mma->lock);
+
+ return 0;
+ }
+
+ input_free_device(mma->input_dev);
+ return rc;
+}
+
+static int __devexit mma7455l_remove(struct spi_device *spi) +{
+ struct mma7455l_info *mma = dev_get_drvdata(&spi->dev);
+
+ sysfs_remove_group(&spi->dev.kobj, &mma7455l_attr_group);
+ input_unregister_device(mma->input_dev);
+ dev_set_drvdata(&spi->dev, NULL);
+ kfree(mma);
+
+ return 0;
+}
+
+#ifdef CONFIG_PM
+static int mma7455l_suspend(struct spi_device *spi, pm_message_t message)
+{
+ struct mma7455l_info *mma = dev_get_drvdata(&spi->dev);
+ get_mode(mma, &mma->mode, &mma->gSelect);
+ set_mode(mma, MMA7455L_MODE_STANDBY, MMA7455L_GSELECT_2); +
+ return 0;
+}
+
+static int mma7455l_resume(struct spi_device *spi)
+{
+ struct mma7455l_info *mma = dev_get_drvdata(&spi->dev);
+ update_mode(mma, mma->mode, mma->gSelect);
+
+ return 0;
+}
+#else
+#define mma7455l_suspend NULL
+#define mma7455l_resume NULL
+#endif
+
+static struct spi_driver mma7455l_driver = {
+ .driver = {
+ .name = "mma7455l",
+ .owner = THIS_MODULE,
+ },
+
+ .probe = mma7455l_probe,
+ .remove = __devexit_p(mma7455l_remove),
+ .suspend = mma7455l_suspend,
+ .resume = mma7455l_resume,
+};
+
+static int __init mma7455l_init(void)
+{
+ return spi_register_driver(&mma7455l_driver);
+}
+
+static void __exit mma7455l_exit(void)
+{
+ spi_unregister_driver(&mma7455l_driver);
+}
+
+MODULE_AUTHOR("Gregoire Gentil <[email protected]>"); +MODULE_LICENSE("GPL");
+
+module_init(mma7455l_init);
+module_exit(mma7455l_exit);
include/linux/mma7455l.h new file +11 -0
@@ -0,0 +1,11 @@ +#ifndef _LINUX_MMA7455L_H +#define _LINUX_MMA7455L_H + +struct mma7455l_platform_data { +/* Calibration offsets */ +s16 calibration_x; +s16 calibration_y; +s16 calibration_z; +}; + +#endif /* _LINUX_MMA7455L_H */
Signature · 1 line
1.6.0.4
PATCH 4/5 AI TB: Driver for the Always Innovating Touch Book keyboard.
In reply to Cory MaccarroneDriver for the Always Innovating Touch Book keyboard.
---
drivers/hid/Kconfig | 7 + drivers/hid/Makefile | 1 + drivers/hid/hid-alwaysinnovating.c | 262 ++++++++++++++++++++++++++++++++++++ drivers/hid/hid-core.c | 1 + drivers/hid/hid-ids.h | 3 + 5 files changed, 274 insertions(+), 0 deletions(-)
create mode 100644 drivers/hid/hid-alwaysinnovating.c
drivers/hid/Kconfig +0 -1
@@ -62,6 +62,13 @@ config HID_A4TECH ---help---
Support for A4 tech X5 and WOP-35 / Trust 450L mice.
+config HID_ALWAYSINNOVATING
+ tristate "Always Innovating" if EMBEDDED
+ depends on USB_HID
+ default !EMBEDDED
+ ---help---
+ Support for Always Innovating Touch Book.
+
config HID_APPLE
tristate "Apple" if EMBEDDED
depends on (USB_HID || BT_HIDP)
drivers/hid/Makefile +0 -0
@@ -20,6 +20,7 @@ ifdef CONFIG_LOGIRUMBLEPAD2_FF
endif
obj-$(CONFIG_HID_A4TECH) += hid-a4tech.o +obj-$(CONFIG_HID_ALWAYSINNOVATING) += hid-alwaysinnovating.o obj-$(CONFIG_HID_APPLE) += hid-apple.o obj-$(CONFIG_HID_BELKIN) += hid-belkin.o obj-$(CONFIG_HID_CHERRY) += hid-cherry.o
(quoted diff) +0 -0
b/drivers/hid/hid-alwaysinnovating.c
new file mode 100644
index 0000000..a7bb0fd
drivers/hid/hid-alwaysinnovating.c new file +10 -0
@@ -0,0 +1,262 @@ +/* +* USB HID quirks support for the Always Innovating Touch Book +* Code borrowed from hid-apple.c +* +* Copyright (c) 2009 Gregoire Gentil <[email protected]> +* Copyright (c) 2009 Tim Yamin <[email protected]> +*/ + +/* +* 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.
+ */
+
+#include <linux/device.h>
+#include <linux/hid.h>
+#include <linux/module.h>
+#include <linux/usb.h>
+
+#include "hid-ids.h"
+
+struct touchbook_sc {
+ unsigned long quirks;
+ unsigned int fn_on;
+ DECLARE_BITMAP(pressed_fn, KEY_CNT);
+};
+
+struct touchbook_key_translation {
+ u16 from;
+ u16 to;
+ u8 flags;
+};
+
+static struct touchbook_key_translation touchbook_fn_keys[] = {
+ { KEY_F6, KEY_BRIGHTNESSDOWN },
+ { KEY_F7, KEY_BRIGHTNESSUP },
+
+ { KEY_F8, KEY_MUTE },
+ { KEY_F9, KEY_VOLUMEDOWN },
+ { KEY_F10, KEY_VOLUMEUP },
+
+ { KEY_UP, KEY_PAGEUP },
+ { KEY_DOWN, KEY_PAGEDOWN },
+ { }
+};
+
+extern unsigned long touchbook_revision;
+unsigned long swap_key;
+
+static struct touchbook_key_translation *touchbook_find_translation(
+ struct touchbook_key_translation *table, u16 from)
+{
+ struct touchbook_key_translation *trans;
+
+ /* Look for the translation */
+ for (trans = table; trans->from; trans++)
+ if (trans->from == from)
+ return trans;
+
+ return NULL;
+}
+
+static int touchbook_event(struct hid_device *hid, struct hid_field *field,
+ struct hid_usage *usage, __s32 value)
+{
+ int do_translate;
+
+ struct input_dev *input = field->hidinput->input;
+ struct touchbook_sc *asc = hid_get_drvdata(hid);
+ struct touchbook_key_translation *trans;
+
+ if (swap_key && usage->code == KEY_RIGHTSHIFT) {
+ input_event(input, usage->type, KEY_END, value);
+ return 1;
+ }
+
+ if (swap_key && usage->code == KEY_END) {
+ input_event(input, usage->type, KEY_RIGHTSHIFT, value);
+ return 1;
+ }
+
+ if (usage->code == KEY_POWER) {
+ asc->fn_on = !!value;
+ input_event(input, usage->type, usage->code, value);
+ return 1;
+ }
+
+ trans = touchbook_find_translation(touchbook_fn_keys, usage->code);
+ if (trans) {
+ if (test_bit(usage->code, asc->pressed_fn))
+ do_translate = 1;
+ else
+ do_translate = asc->fn_on;
+
+ if (do_translate) {
+ if (value)
+ set_bit(usage->code, asc->pressed_fn);
+ else
+ clear_bit(usage->code, asc->pressed_fn);
+
+ input_event(input, usage->type, trans->to,
+ value);
+
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+static int touchbook_input_mapping(struct hid_device *hdev,
+ struct hid_input *hi,
+ struct hid_field *field, struct hid_usage *usage,
+ unsigned long **bit, int *max)
+{
+ struct touchbook_key_translation *trans;
+
+ /* Enable all other keys */
+ for (trans = touchbook_fn_keys; trans->from; trans++)
+ set_bit(trans->to, hi->input->keybit);
+
+ return 0;
+}
+
+static ssize_t show_swap_key(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ return snprintf(buf, PAGE_SIZE, "%lu\n", swap_key);
+}
+
+static ssize_t store_swap_key(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ strict_strtoul(buf, 10, &swap_key);
+
+ if (swap_key != 0 && swap_key != 1) {
+ swap_key = 0;
+ return -EINVAL;
+ }
+
+ return count;
+}
+
+static struct device_attribute touchbook_hid_attrs[] = {
+ __ATTR(swap_key, S_IRUGO | S_IWUGO, show_swap_key, store_swap_key), +};
+
+int touchbook_create_sysfs(struct hid_device *hdev)
+{
+ int i;
+ int r;
+
+ for (i = 0; i < ARRAY_SIZE(touchbook_hid_attrs); i++) {
+ r = device_create_file(&hdev->dev,
+ &touchbook_hid_attrs[i]);
+
+ if (r) {
+ dev_err(&hdev->dev, "failed to create sysfs file\n");
+ return r;
+ }
+ }
+
+ return 0;
+}
+
+void touchbook_remove_sysfs(struct hid_device *hdev)
+{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(touchbook_hid_attrs); i++)
+ device_remove_file(&hdev->dev,
+ &touchbook_hid_attrs[i]);
+}
+
+static int touchbook_probe(struct hid_device *hdev,
+ const struct hid_device_id *id)
+{
+ unsigned long quirks = id->driver_data;
+ struct touchbook_sc *asc;
+ unsigned int connect_mask = HID_CONNECT_DEFAULT;
+ int ret;
+
+ asc = kzalloc(sizeof(*asc), GFP_KERNEL);
+ if (asc == NULL) {
+ dev_err(&hdev->dev, "can't alloc touchbook descriptor\n");
+ return -ENOMEM;
+ }
+
+ asc->quirks = quirks;
+ hid_set_drvdata(hdev, asc);
+
+ ret = hid_parse(hdev);
+ if (ret) {
+ dev_err(&hdev->dev, "parse failed\n");
+ goto err_free;
+ }
+
+ ret = touchbook_create_sysfs(hdev);
+ if (ret) {
+ dev_err(&hdev->dev, "failed to create sysfs entries\n");
+ goto err_free;
+ }
+
+ swap_key = (touchbook_revision >= 4) ? 1 : 0;
+
+ ret = hid_hw_start(hdev, connect_mask);
+ if (ret) {
+ dev_err(&hdev->dev, "hw start failed\n");
+ goto err_free;
+ }
+
+ return 0;
+err_free:
+ kfree(asc);
+ return ret;
+}
+
+static void touchbook_remove(struct hid_device *hdev)
+{
+ hid_hw_stop(hdev);
+ kfree(hid_get_drvdata(hdev));
+ touchbook_remove_sysfs(hdev);
+}
+
+static const struct hid_device_id touchbook_devices[] = {
+ { HID_USB_DEVICE(USB_VENDOR_ID_ALWAYSINNOVATING,
+ USB_DEVICE_ID_ALWAYSINNOVATING_TOUCH_BOOK) },
+ { }
+};
+
+MODULE_DEVICE_TABLE(hid, touchbook_devices);
+
+static struct hid_driver touchbook_driver = {
+ .name = "touchbook",
+ .id_table = touchbook_devices,
+ .probe = touchbook_probe,
+ .remove = touchbook_remove,
+ .event = touchbook_event,
+ .input_mapping = touchbook_input_mapping,
+};
+
+static int touchbook_init(void)
+{
+ int ret;
+
+ ret = hid_register_driver(&touchbook_driver);
+ if (ret)
+ printk(KERN_ERR "can't register touchbook driver\n");
+
+ return ret;
+}
+
+static void touchbook_exit(void)
+{
+ hid_unregister_driver(&touchbook_driver);
+}
+
+module_init(touchbook_init); +module_exit(touchbook_exit);
+MODULE_LICENSE("GPL");
drivers/hid/hid-core.c +0 -0
@@ -1252,6 +1252,7 @@ EXPORT_SYMBOL_GPL(hid_disconnect);
static const struct hid_device_id hid_blacklist[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU) }, { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_X5_005D) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_ALWAYSINNOVATING, USB_DEVICE_ID_ALWAYSINNOVATING_TOUCH_BOOK) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ATV_IRCONTROL) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL4) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE) },
drivers/hid/hid-ids.h +0 -0
@@ -54,6 +54,9 @@
#define USB_VENDOR_ID_ALPS 0x0433
#define USB_DEVICE_ID_IBM_GAMEPAD 0x1101
+#define USB_VENDOR_ID_ALWAYSINNOVATING 0xa110 +#define USB_DEVICE_ID_ALWAYSINNOVATING_TOUCH_BOOK 0x0002 +
#define USB_VENDOR_ID_APPLE 0x05ac
#define USB_DEVICE_ID_APPLE_MIGHTYMOUSE 0x0304 #define USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI 0x020e
Signature · 1 line
1.6.0.4
PATCH 5/5 AI TB: Additional modifications for the Always Innovating OMAP3-based Touch Book, including video and sound.
In reply to Cory MaccarroneAdditional modifications for the Always Innovating OMAP3-based Touch Book, including video and sound.
---
arch/arm/mach-omap2/Kconfig | 5 + arch/arm/mach-omap2/Makefile | 2 + drivers/video/omap/lcd_omap3touchbook.c | 130 +++++++++++++++++++ sound/soc/omap/Kconfig | 8 ++ sound/soc/omap/Makefile | 2 + sound/soc/omap/omap3touchbook.c | 211 +++++++++++++++++++++++++++++++ 6 files changed, 358 insertions(+), 0 deletions(-)
create mode 100644 drivers/video/omap/lcd_omap3touchbook.c create mode 100644 sound/soc/omap/omap3touchbook.c
arch/arm/mach-omap2/Kconfig +0 -0
@@ -73,6 +73,11 @@ config MACH_OMAP3_PANDORA
bool "OMAP3 Pandora"
depends on ARCH_OMAP3 && ARCH_OMAP34XX
+config MACH_OMAP3_TOUCHBOOK
+ bool "OMAP3 Touch Book"
+ depends on ARCH_OMAP3 && ARCH_OMAP34XX
+ select BACKLIGHT_CLASS_DEVICE
+
config MACH_OMAP_3430SDP
bool "OMAP 3430 SDP board"
depends on ARCH_OMAP3 && ARCH_OMAP34XX
arch/arm/mach-omap2/Makefile +0 -0
@@ -90,6 +90,8 @@ obj-$(CONFIG_MACH_CM_T35) += board-cm-t35.o \ mmc-twl4030.o
obj-$(CONFIG_MACH_IGEP0020) += board-igep0020.o \
mmc-twl4030.o
+obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK) += board-omap3touchbook.o \
+ mmc-twl4030.o
obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o
(quoted diff) +0 -0
b/drivers/video/omap/lcd_omap3touchbook.c
new file mode 100644
index 0000000..5b58703
drivers/video/omap/lcd_omap3touchbook.c new file +8 -0
@@ -0,0 +1,130 @@ +/* +* LCD panel support for the Touch Book +* +* Author: Gregoire Gentil <[email protected]> +* +* Derived from drivers/video/omap/lcd-omap3beagle.c +* +* 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.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/gpio.h>
+#include <linux/i2c/twl4030.h>
+
+#include <plat/mux.h>
+#include <plat/omapfb.h>
+#include <asm/mach-types.h>
+
+#define LCD_PANEL_ENABLE_GPIO 176
+
+static int omap3beagle_panel_init(struct lcd_panel *panel,
+ struct omapfb_device *fbdev)
+{
+ gpio_request(LCD_PANEL_ENABLE_GPIO, "LCD enable");
+ return 0;
+}
+
+static void omap3beagle_panel_cleanup(struct lcd_panel *panel) +{
+ gpio_free(LCD_PANEL_ENABLE_GPIO);
+}
+
+static int omap3beagle_panel_enable(struct lcd_panel *panel) +{
+ gpio_set_value(LCD_PANEL_ENABLE_GPIO, 1);
+ return 0;
+}
+
+static void omap3beagle_panel_disable(struct lcd_panel *panel) +{
+ gpio_set_value(LCD_PANEL_ENABLE_GPIO, 0);
+}
+
+static unsigned long omap3beagle_panel_get_caps(struct lcd_panel *panel)
+{
+ return 0;
+}
+
+struct lcd_panel omap3beagle_panel = {
+ .name = "omap3beagle",
+ .config = OMAP_LCDC_PANEL_TFT,
+
+ .bpp = 16,
+ .data_lines = 24,
+ .x_res = 1024,
+ .y_res = 600,
+ .hsw = 3,
+ .hfp = 3,
+ .hbp = 39,
+ .vsw = 1,
+ .vfp = 2,
+ .vbp = 7,
+
+ .pixel_clock = 64000,
+
+ .init = omap3touchbook_panel_init,
+ .cleanup = omap3touchbook_panel_cleanup,
+ .enable = omap3touchbook_panel_enable,
+ .disable = omap3touchbook_panel_disable,
+ .get_caps = omap3touchbook_panel_get_caps,
+};
+
+static int omap3touchbook_panel_probe(struct platform_device *pdev) +{
+ omapfb_register_panel(&omap3beagle_panel);
+ return 0;
+}
+
+static int omap3touchbook_panel_remove(struct platform_device *pdev) +{
+ return 0;
+}
+
+static int omap3touchbook_panel_suspend(struct platform_device *pdev,
+ pm_message_t mesg)
+{
+ return 0;
+}
+
+static int omap3touchbook_panel_resume(struct platform_device *pdev) +{
+ return 0;
+}
+
+struct platform_driver omap3touchbook_panel_driver = {
+ .probe = omap3touchbook_panel_probe,
+ .remove = omap3touchbook_panel_remove,
+ .suspend = omap3touchbook_panel_suspend,
+ .resume = omap3touchbook_panel_resume,
+ .driver = {
+ .name = "omap3touchbook_lcd",
+ .owner = THIS_MODULE,
+ },
+};
+
+static int __init omap3touchbook_panel_drv_init(void)
+{
+ return platform_driver_register(&omap3beagle_panel_driver); +}
+
+static void __exit omap3touchbook_panel_drv_exit(void)
+{
+ platform_driver_unregister(&omap3touchbook_panel_driver); +}
+
+module_init(omap3touchbook_panel_drv_init); +module_exit(omap3touchbook_panel_drv_exit);
sound/soc/omap/Kconfig +0 -0
@@ -83,6 +83,14 @@ config SND_OMAP_SOC_OMAP3_PANDORA
help
Say Y if you want to add support for SoC audio on the OMAP3 Pandora.
+config SND_OMAP_SOC_OMAP3_TOUCHBOOK
+ tristate "SoC Audio support for OMAP3 Touch Book"
+ depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP3_TOUCHBOOK
+ select SND_OMAP_SOC_MCBSP
+ select SND_SOC_TWL4030
+ help
+ Say Y if you want to add support for SoC audio on the OMAP3 Touch
Book.
+
config SND_OMAP_SOC_OMAP3_BEAGLE
tristate "SoC Audio support for OMAP3 Beagle"
depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP3_BEAGLE
sound/soc/omap/Makefile +0 -0
@@ -15,6 +15,7 @@ snd-soc-omap3evm-objs := omap3evm.o
snd-soc-sdp3430-objs := sdp3430.o
snd-soc-omap3pandora-objs := omap3pandora.o
snd-soc-omap3beagle-objs := omap3beagle.o
+snd-soc-omap3touchbook-objs := omap3touchbook.o
snd-soc-zoom2-objs := zoom2.o
obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o
@@ -26,4 +27,5 @@ obj-$(CONFIG_MACH_OMAP3EVM) += snd-soc-omap3evm.o obj-$(CONFIG_SND_OMAP_SOC_SDP3430) += snd-soc-sdp3430.o obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o obj-$(CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE) += snd-soc-omap3beagle.o +obj-$(CONFIG_SND_OMAP_SOC_OMAP3_TOUCHBOOK) += snd-soc-omap3touchbook.o obj-$(CONFIG_SND_OMAP_SOC_ZOOM2) += snd-soc-zoom2.o
(quoted diff) +0 -0
b/sound/soc/omap/omap3touchbook.c
new file mode 100644
index 0000000..584f07d
sound/soc/omap/omap3touchbook.c new file +46 -0
46 lines not on this page · raw message
*substream,
+ struct snd_pcm_hw_params *params)
+{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
+ struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+ unsigned int fmt;
+ int ret;
+
+ switch (params_channels(params)) {
+ case 2: /* Stereo I2S mode */
+ fmt = SND_SOC_DAIFMT_I2S |
+ SND_SOC_DAIFMT_NB_NF |
+ SND_SOC_DAIFMT_CBM_CFM;
+ break;
+ case 4: /* Four channel TDM mode */
+ fmt = SND_SOC_DAIFMT_DSP_A |
+ SND_SOC_DAIFMT_IB_NF |
+ SND_SOC_DAIFMT_CBM_CFM;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ /* Set codec DAI configuration */
+ ret = snd_soc_dai_set_fmt(codec_dai, fmt);
+ if (ret < 0) {
+ printk(KERN_ERR "can't set codec DAI configuration\n");
+ return ret;
+ }
+
+ /* Set cpu DAI configuration */
+ ret = snd_soc_dai_set_fmt(cpu_dai, fmt);
+ if (ret < 0) {
+ printk(KERN_ERR "can't set cpu DAI configuration\n");
+ return ret;
+ }
+
+ /* Set the codec system clock for DAC and ADC */
+ ret = snd_soc_dai_set_sysclk(codec_dai, 0, 26000000,
+ SND_SOC_CLOCK_IN);
+ if (ret < 0) {
+ printk(KERN_ERR "can't set codec system clock\n");
+ return ret;
+ }
+
+ return 0;
+}
+
+static struct snd_soc_ops omap3touchbook_ops = {
+ .hw_params = omap3touchbook_hw_params,
+};
+
+/* Digital audio interface glue - connects codec <--> CPU */ +static struct snd_soc_dai_link omap3touchbook_dai = {
+ .name = "TWL4030",
+ .stream_name = "TWL4030",
+ .cpu_dai = &omap_mcbsp_dai[0],
+ .codec_dai = &twl4030_dai[TWL4030_DAI_HIFI],
+ .ops = &omap3touchbook_ops,
+};
+
+/* Audio machine driver */
+static struct snd_soc_card snd_soc_omap3touchbook = {
+ .name = "omap3touchbook",
+ .platform = &omap_soc_platform,
+ .dai_link = &omap3touchbook_dai,
+ .num_links = 1,
+};
+
+/* Audio subsystem */
+static struct snd_soc_device omap3touchbook_snd_devdata = {
+ .card = &snd_soc_omap3touchbook,
+ .codec_dev = &soc_codec_dev_twl4030,
+};
+
+static struct platform_device *omap3touchbook_snd_device; +
+static void jack_work_func(struct work_struct *wq)
+{
+ struct snd_soc_device *socdev = platform_get_drvdata(
+ omap3touchbook_snd_device);
+ struct snd_soc_codec *codec = socdev->card->codec;
+
+ snd_soc_dapm_sync(codec);
+}
+DECLARE_WORK(jack_work, jack_work_func);
+
+static irqreturn_t touchbook_headphone_event(int irq, void *snd) +{
+ int status = gpio_get_value(TB_HEADPHONE_GPIO);
+ struct snd_soc_device *socdev = platform_get_drvdata(
+ omap3touchbook_snd_device);
+ struct snd_soc_codec *codec = socdev->card->codec;
+
+ if (status) {
+ snd_soc_dapm_disable_pin(codec, "HFL");
+ snd_soc_dapm_disable_pin(codec, "HFR");
+ } else {
+ snd_soc_dapm_enable_pin(codec, "HFL");
+ snd_soc_dapm_enable_pin(codec, "HFR");
+ }
+
+ schedule_work(&jack_work);
+ return IRQ_HANDLED;
+}
+
+static int __init omap3touchbook_soc_init(void)
+{
+ int ret;
+
+ if (!machine_is_touchbook()) {
+ pr_debug("Not OMAP3 Touch Book!\n");
+ return -ENODEV;
+ }
+ pr_info("OMAP3 Touch Book SoC init\n");
+
+ omap3touchbook_snd_device = platform_device_alloc("soc-audio", -1);
+ if (!omap3touchbook_snd_device) {
+ printk(KERN_ERR "Platform device allocation failed\n");
+ return -ENOMEM;
+ }
+
+ platform_set_drvdata(omap3touchbook_snd_device,
+ &omap3touchbook_snd_devdata);
+ omap3touchbook_snd_devdata.dev = &omap3touchbook_snd_device->dev;
+ *(unsigned int *)omap3touchbook_dai.cpu_dai->private_data = 1; +
+ /* Touch Book -- headphone jack sensor */
+ omap_set_gpio_debounce(TB_HEADPHONE_GPIO, 1);
+ omap_set_gpio_debounce_time(TB_HEADPHONE_GPIO, 0xff);
+
+ ret = request_irq(TB_HEADPHONE_IRQ, touchbook_headphone_event,
+ IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
+ "touchbook_headphone",
+ omap3touchbook_snd_device);
+ if (ret < 0)
+ goto err1;
+
+ ret = platform_device_add(omap3touchbook_snd_device);
+ if (ret)
+ goto err1;
+
+ /* Detect headphone status */
+ touchbook_headphone_event(0, omap3touchbook_snd_device); +
+ return 0;
+
+err1:
+ printk(KERN_ERR "Unable to add platform device\n");
+ platform_device_put(omap3touchbook_snd_device);
+
+ return ret;
+}
+
+static void __exit omap3touchbook_soc_exit(void)
+{
+ platform_device_unregister(omap3touchbook_snd_device); +}
+
+module_init(omap3touchbook_soc_init); +module_exit(omap3touchbook_soc_exit);
+
+MODULE_AUTHOR("Gregoire Gentil <[email protected]>"); +MODULE_DESCRIPTION("ALSA SoC OMAP3 Touch Book"); +MODULE_LICENSE("GPL");
Signature · 1 line
1.6.0.4
PATCH 2/8 AI TB: Board file of Always Innovating OMAP3-based Touch Book
---arch/arm/mach-omap2/board-omap3touchbook.c | 683
++++++++++++++++++++++++++++
1 files changed, 683 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/mach-omap2/board-omap3touchbook.c
(quoted diff) +0 -0
b/arch/arm/mach-omap2/board-omap3touchbook.c
new file mode 100644
index 0000000..ad3ef6e
arch/arm/mach-omap2/board-omap3touchbook.c new file +212 -0
212 lines not on this page · raw message
220 mA) */
+static struct regulator_init_data touchbook_vmmc1 = {
+ .constraints = {
+ .min_uV = 1850000,
+ .max_uV = 3150000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
+ | REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = 1,
+ .consumer_supplies = &touchbook_vmmc1_supply,
+};
+
+/* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */ +static struct regulator_init_data touchbook_vsim = {
+ .constraints = {
+ .min_uV = 1800000,
+ .max_uV = 3000000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
+ | REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = 1,
+ .consumer_supplies = &touchbook_vsim_supply,
+};
+
+/* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */ +static struct regulator_init_data touchbook_vdac = {
+ .constraints = {
+ .min_uV = 1800000,
+ .max_uV = 1800000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = 1,
+ .consumer_supplies = &touchbook_vdac_supply,
+};
+
+/* VPLL2 for digital video outputs */
+static struct regulator_init_data touchbook_vpll2 = {
+ .constraints = {
+ .name = "VDVI",
+ .min_uV = 1800000,
+ .max_uV = 1800000,
+ .valid_modes_mask = REGULATOR_MODE_NORMAL
+ | REGULATOR_MODE_STANDBY,
+ .valid_ops_mask = REGULATOR_CHANGE_MODE
+ | REGULATOR_CHANGE_STATUS,
+ },
+ .num_consumer_supplies = 1,
+ .consumer_supplies = &touchbook_vdvi_supply,
+};
+
+static struct twl4030_usb_data touchbook_usb_data = {
+ .usb_mode = T2_USB_MODE_ULPI,
+};
+
+static struct twl4030_codec_audio_data touchbook_audio_data = {
+ .audio_mclk = 26000000,
+};
+
+static struct twl4030_codec_data touchbook_codec_data = {
+ .audio_mclk = 26000000,
+ .audio = &touchbook_audio_data,
+};
+
+static struct twl4030_platform_data touchbook_twldata = {
+ .irq_base = TWL4030_IRQ_BASE,
+ .irq_end = TWL4030_IRQ_END,
+
+ /* platform_data for children goes here */
+ .usb = &touchbook_usb_data,
+ .gpio = &touchbook_gpio_data,
+ .codec = &touchbook_codec_data,
+ .vmmc1 = &touchbook_vmmc1,
+ .vsim = &touchbook_vsim,
+ .vdac = &touchbook_vdac,
+ .vpll2 = &touchbook_vpll2,
+};
+
+static struct i2c_board_info __initdata touchbook_i2c_boardinfo[] = {
+ {
+ I2C_BOARD_INFO("twl4030", 0x48),
+ .flags = I2C_CLIENT_WAKE,
+ .irq = INT_34XX_SYS_NIRQ,
+ .platform_data = &touchbook_twldata,
+ },
+};
+
+static struct i2c_board_info __initdata touchBook_i2c_boardinfo[] = {
+ {
+ I2C_BOARD_INFO("bq27200", 0x55),
+ },
+};
+
+static int __init omap3_touchbook_i2c_init(void)
+{
+ /* Standard TouchBook bus */
+ omap_register_i2c_bus(1, 2600, touchbook_i2c_boardinfo,
+ ARRAY_SIZE(touchbook_i2c_boardinfo));
+
+ /* Additional TouchBook bus */
+ omap_register_i2c_bus(3, 100, touchBook_i2c_boardinfo,
+ ARRAY_SIZE(touchBook_i2c_boardinfo));
+
+ return 0;
+}
+
+static void __init omap3_ads7846_init(void)
+{
+ if (gpio_request(OMAP3_TS_GPIO, "ads7846_pen_down")) {
+ printk(KERN_ERR "Failed to request GPIO %d for "
+ "ads7846 pen down IRQ\n", OMAP3_TS_GPIO);
+ return;
+ }
+
+ gpio_direction_input(OMAP3_TS_GPIO);
+ omap_set_gpio_debounce(OMAP3_TS_GPIO, 1);
+ omap_set_gpio_debounce_time(OMAP3_TS_GPIO, 0xa);
+}
+
+static struct ads7846_platform_data ads7846_config = {
+ .x_min = 100,
+ .y_min = 265,
+ .x_max = 3950,
+ .y_max = 3750,
+ .x_plate_ohms = 40,
+ .pressure_max = 255,
+ .debounce_max = 10,
+ .debounce_tol = 5,
+ .debounce_rep = 1,
+ .gpio_pendown = OMAP3_TS_GPIO,
+ .keep_vref_on = 1,
+};
+
+static struct omap2_mcspi_device_config ads7846_mcspi_config = {
+ .turbo_mode = 0,
+ .single_channel = 1, /* 0: slave, 1: master */
+};
+
+static struct spi_board_info omap3_ads7846_spi_board_info[] __initdata = {
+ {
+ .modalias = "ads7846",
+ .bus_num = 4,
+ .chip_select = 0,
+ .max_speed_hz = 1500000,
+ .controller_data = &ads7846_mcspi_config,
+ .irq = OMAP_GPIO_IRQ(OMAP3_TS_GPIO),
+ .platform_data = &ads7846_config,
+ }
+};
+
+static struct gpio_led gpio_leds[] = {
+ {
+ .name = "touchbook::usr0",
+ .default_trigger = "heartbeat",
+ .gpio = 150,
+ },
+ {
+ .name = "touchbook::usr1",
+ .default_trigger = "mmc0",
+ .gpio = 149,
+ },
+ {
+ .name = "touchbook::pmu_stat",
+ .gpio = -EINVAL, /* gets replaced */
+ .active_low = true,
+ },
+};
+
+static struct gpio_led_platform_data gpio_led_info = {
+ .leds = gpio_leds,
+ .num_leds = ARRAY_SIZE(gpio_leds),
+};
+
+static struct platform_device leds_gpio = {
+ .name = "leds-gpio",
+ .id = -1,
+ .dev = {
+ .platform_data = &gpio_led_info,
+ },
+};
+
+static struct gpio_keys_button gpio_buttons[] = {
+ {
+ .code = BTN_EXTRA,
+ .gpio = 7,
+ .desc = "user",
+ .wakeup = 1,
+ },
+ {
+ .code = KEY_POWER,
+ .gpio = 183,
+ .desc = "power",
+ .wakeup = 1,
+ },
+};
+
+static struct gpio_keys_platform_data gpio_key_info = {
+ .buttons = gpio_buttons,
+ .nbuttons = ARRAY_SIZE(gpio_buttons),
+};
+
+static struct platform_device keys_gpio = {
+ .name = "gpio-keys",
+ .id = -1,
+ .dev = {
+ .platform_data = &gpio_key_info,
+ },
+};
+
+static struct omap_board_config_kernel omap3_touchbook_config[] __initdata = {
+ { OMAP_TAG_LCD, &omap3_touchbook_lcd_config },
+};
+
+static void __init omap3_touchbook_init_irq(void)
+{
+ omap_board_config = omap3_touchbook_config;
+ omap_board_config_size = ARRAY_SIZE(omap3_touchbook_config);
+ omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
+ mt46h32m32lf6_sdrc_params);
+ omap_init_irq();
+#ifdef CONFIG_OMAP_32K_TIMER
+ omap2_gp_clockevent_set_gptimer(12);
+#endif
+ omap_gpio_init();
+}
+
+static struct platform_device *omap3_touchbook_devices[] __initdata = {
+ &omap3_touchbook_lcd_device,
+ &leds_gpio,
+ &keys_gpio,
+};
+
+static void __init omap3touchbook_flash_init(void)
+{
+ u8 cs = 0;
+ u8 nandcs = GPMC_CS_NUM + 1;
+
+ u32 gpmc_base_add = OMAP34XX_GPMC_VIRT;
+
+ /* find out the chip-select on which NAND exists */
+ while (cs < GPMC_CS_NUM) {
+ u32 ret = 0;
+ ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
+
+ if ((ret & 0xC00) == 0x800) {
+ printk(KERN_INFO "Found NAND on CS%d\n", cs);
+ if (nandcs > GPMC_CS_NUM)
+ nandcs = cs;
+ }
+ cs++;
+ }
+
+ if (nandcs > GPMC_CS_NUM) {
+ printk(KERN_INFO "NAND: Unable to find configuration "
+ "in GPMC\n ");
+ return;
+ }
+
+ if (nandcs < GPMC_CS_NUM) {
+ omap3touchbook_nand_data.cs = nandcs;
+ omap3touchbook_nand_data.gpmc_cs_baseaddr = (void *)
+ (gpmc_base_add + GPMC_CS0_BASE + nandcs * GPMC_CS_SIZE);
+ omap3touchbook_nand_data.gpmc_baseaddr =
+ (void *) (gpmc_base_add);
+
+ printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
+ if (platform_device_register(&omap3touchbook_nand_device) < 0)
+ printk(KERN_ERR "Unable to register NAND device\n");
+ }
+}
+
+static void __init omap3_mma7455l_init(void)
+{
+ int ret;
+
+ ret = gpio_request(OMAP3_AC_GPIO, "mma7455l");
+ if (ret < 0) {
+ printk(KERN_ERR "Failed to request GPIO %d for mma7455l IRQ\n",
+ OMAP3_AC_GPIO);
+ return;
+ }
+
+ gpio_direction_input(OMAP3_AC_GPIO);
+}
+
+static struct mma7455l_platform_data mma7455l_config = {
+ .calibration_x = -4,
+ .calibration_y = 28,
+ .calibration_z = -28,
+};
+
+static struct omap2_mcspi_device_config mma7455l_mcspi_config = {
+ .turbo_mode = 0,
+ .single_channel = 1, /* 0: slave, 1: master */
+};
+
+static struct spi_board_info omap3_mma7455l_spi_board_info[] __initdata = {
+ {
+ .modalias = "mma7455l",
+ .bus_num = 3,
+ .chip_select = 0,
+ .max_speed_hz = 200000,
+ .irq = OMAP_GPIO_IRQ(OMAP3_AC_GPIO),
+ .controller_data = &mma7455l_mcspi_config,
+ .platform_data = &mma7455l_config,
+ }
+};
+
+static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { +
+ .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
+ .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
+ .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
+
+ .phy_reset = true,
+ .reset_gpio_port[0] = -EINVAL, + .reset_gpio_port[1] = 147, + .reset_gpio_port[2] = -EINVAL
+};
+
+static int touchbook_backlight_brightness = 50;
+static struct omap_dm_timer *touchbook_backlight_pwm;
+
+static int touchbook_backlight_read(struct backlight_device *bd) +{
+ return touchbook_backlight_brightness;
+}
+
+static int touchbook_backlight_update(struct backlight_device *bd) +{
+ int value = bd->props.brightness;
+ touchbook_backlight_brightness = value;
+
+ /* Frequency calculation:
+ - For 200Hz PWM, you want to load -164 (=> -32768Hz / 200Hz). + - Minimum duty cycle for the backlight is 15%. + - You have (164*0.85) => ~140 levels of brightness.
+ */
+
+ /* For maximum brightness, just stop the timer... */
+ if (value != bd->props.max_brightness) {
+ /* Load the appropriate value for 200Hz PWM */
+ u32 period = clk_get_rate(omap_dm_timer_get_fclk(
+ touchbook_backlight_pwm)) / 200;
+
+ /* Minimum duty cycle is 15% */
+ u32 minimum = (period * 3) / 20;
+ u32 maximum = (period * 17) / 20;
+
+ /* Work out match value */
+ u32 match = (maximum * value) / 100;
+
+ /* Start... */
+ omap_dm_timer_set_load(touchbook_backlight_pwm,
+ 1, 0xFFFFFFFF - period - 1);
+ omap_dm_timer_set_match(touchbook_backlight_pwm,
+ 1, 0xFFFFFFFF - minimum - match);
+ omap_dm_timer_write_counter(touchbook_backlight_pwm, -1);
+ omap_dm_timer_start(touchbook_backlight_pwm);
+ } else
+ omap_dm_timer_stop(touchbook_backlight_pwm);
+
+
+ return 0;
+}
+
+static struct backlight_ops touchbook_backlight_properties = {
+ .get_brightness = touchbook_backlight_read,
+ .update_status = touchbook_backlight_update,
+};
+
+static void __init omap3_touchbook_backlight_init(void) +{
+ static struct backlight_device *bd;
+ bd = backlight_device_register("touchbook", NULL, NULL,
+ &touchbook_backlight_properties);
+
+ if (bd) {
+ touchbook_backlight_pwm = omap_dm_timer_request_specific(
+ TB_BL_PWM_TIMER);
+ omap_dm_timer_enable(touchbook_backlight_pwm);
+ omap_dm_timer_set_source(touchbook_backlight_pwm,
+ OMAP_TIMER_SRC_SYS_CLK);
+ omap_dm_timer_set_pwm(touchbook_backlight_pwm,
+ 1, 1, OMAP_TIMER_TRIGGER_OVERFLOW_AND_COMPARE);
+
+ bd->props.max_brightness = 100;
+ bd->props.brightness = touchbook_backlight_brightness;
+ }
+
+ touchbook_backlight_update(bd);
+}
+
+static void omap3_touchbook_poweroff(void)
+{
+ int r;
+
+ r = gpio_request(TB_KILL_POWER_GPIO, "DVI reset");
+ if (r < 0) {
+ printk(KERN_ERR "Unable to get kill power GPIO\n");
+ return;
+ }
+
+ gpio_direction_output(TB_KILL_POWER_GPIO, 0);
+}
+
+static void __init early_touchbook_revision(char **p)
+{
+ if (!*p)
+ return;
+
+ strict_strtoul(*p, 10, &touchbook_revision);
+}
+__early_param("tbr=", early_touchbook_revision);
+
+static void __init omap3_touchbook_init(void)
+{
+ pm_power_off = omap3_touchbook_poweroff;
+
+ omap3_touchbook_i2c_init();
+ platform_add_devices(omap3_touchbook_devices,
+ ARRAY_SIZE(omap3_touchbook_devices));
+ omap_serial_init();
+
+ omap_cfg_reg(J25_34XX_GPIO170);
+ gpio_request(176, "DVI_nPD");
+ /* REVISIT leave DVI powered down until it's needed ... */
+ gpio_direction_output(176, true);
+
+ /* Touchscreen and accelerometer */
+ spi_register_board_info(omap3_ads7846_spi_board_info,
+ ARRAY_SIZE(omap3_ads7846_spi_board_info));
+ spi_register_board_info(omap3_mma7455l_spi_board_info,
+ ARRAY_SIZE(omap3_mma7455l_spi_board_info));
+ omap3_ads7846_init();
+ omap3_mma7455l_init();
+
+ omap3_touchbook_backlight_init();
+
+ usb_musb_init();
+ usb_ehci_init(&ehci_pdata);
+ omap3touchbook_flash_init();
+
+ /* Ensure SDRC pins are mux'd for self-refresh */
+ omap_cfg_reg(H16_34XX_SDRC_CKE0);
+ omap_cfg_reg(H17_34XX_SDRC_CKE1);
+}
+
+static void __init omap3_touchbook_map_io(void)
+{
+ omap2_set_globals_343x();
+ omap2_map_common_io();
+}
+
+MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board")
+ /* Maintainer: Gregoire Gentil - http://www.alwaysinnovating.com */
+ .phys_io = 0x48000000,
+ .io_pg_offst = ((0xd8000000) >> 18) & 0xfffc,
+ .boot_params = 0x80000100,
+ .map_io = omap3_touchbook_map_io,
+ .init_irq = omap3_touchbook_init_irq,
+ .init_machine = omap3_touchbook_init,
+ .timer = &omap_timer,
+MACHINE_END
Signature · 1 line
1.6.0.4
Quoted 1 line
From
795fb3714e9bbb3ed358fb13d282bd80da3c5f9cMon Sep 17 00:00:00 2001
From: Gregoire Gentil <[email protected]>
Date: Wed, 18 Nov 2009 18:30:39 -0800
Subject: [PATCH] Board file of Always Innovating OMAP3-based Touch Book
--- arch/arm/mach-omap2/board-omap3touchbook.c | 683 ++++++++++++++++++++++++++++ 1 files changed, 683 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-omap2/board-omap3touchbook.c
arch/arm/mach-omap2/board-omap3touchbook.c new file +683 -0
683 lines not on this page · raw message
Signature · 1 line
1.6.0.4
PATCH 4/8 AI TB: Driver for Always Innovating OMAP3-based Touch Book keyboard
In reply to Gregoire Gentil---
drivers/hid/Kconfig | 7 +++++++ drivers/hid/Makefile | 1 + drivers/hid/hid-core.c | 1 + drivers/hid/hid-ids.h | 3 +++ 4 files changed, 12 insertions(+), 0 deletions(-)
drivers/hid/Kconfig +0 -1
@@ -62,6 +62,13 @@ config HID_A4TECH ---help---
Support for A4 tech X5 and WOP-35 / Trust 450L mice.
+config HID_ALWAYSINNOVATING
+ tristate "Always Innovating" if EMBEDDED
+ depends on USB_HID
+ default !EMBEDDED
+ ---help---
+ Support for Always Innovating Touch Book. +
config HID_APPLE
tristate "Apple" if EMBEDDED
depends on (USB_HID || BT_HIDP)
drivers/hid/Makefile +0 -0
@@ -20,6 +20,7 @@ ifdef CONFIG_LOGIRUMBLEPAD2_FF
endif
obj-$(CONFIG_HID_A4TECH) += hid-a4tech.o +obj-$(CONFIG_HID_ALWAYSINNOVATING) += hid-alwaysinnovating.o obj-$(CONFIG_HID_APPLE) += hid-apple.o obj-$(CONFIG_HID_BELKIN) += hid-belkin.o obj-$(CONFIG_HID_CHERRY) += hid-cherry.o
drivers/hid/hid-core.c +0 -0
@@ -1252,6 +1252,7 @@ EXPORT_SYMBOL_GPL(hid_disconnect);
static const struct hid_device_id hid_blacklist[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU) }, { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_X5_005D) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_ALWAYSINNOVATING, USB_DEVICE_ID_ALWAYSINNOVATING_TOUCH_BOOK) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ATV_IRCONTROL) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL4) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE) },
drivers/hid/hid-ids.h +0 -0
@@ -54,6 +54,9 @@
#define USB_VENDOR_ID_ALPS 0x0433 #define USB_DEVICE_ID_IBM_GAMEPAD 0x1101
+#define USB_VENDOR_ID_ALWAYSINNOVATING 0xa110 +#define USB_DEVICE_ID_ALWAYSINNOVATING_TOUCH_BOOK 0x0002 +
#define USB_VENDOR_ID_APPLE 0x05ac
#define USB_DEVICE_ID_APPLE_MIGHTYMOUSE 0x0304 #define USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI 0x020e
Signature · 1 line
1.6.0.4
Quoted 1 line
From
0eaf7bd7a3ece14751708728ebcb25dab588c172Mon Sep 17 00:00:00 2001
From: Gregoire Gentil <[email protected]>
Date: Wed, 18 Nov 2009 18:32:15 -0800
Subject: [PATCH] Driver for Always Innovating OMAP3-based Touch Book keyboard
--- drivers/hid/Kconfig | 7 +++++++ drivers/hid/Makefile | 1 + drivers/hid/hid-core.c | 1 + drivers/hid/hid-ids.h | 3 +++ 4 files changed, 12 insertions(+), 0 deletions(-)
drivers/hid/Kconfig +7 -0
@@ -62,6 +62,13 @@ config HID_A4TECH ---help--- Support for A4 tech X5 and WOP-35 / Trust 450L mice. +config HID_ALWAYSINNOVATING + tristate "Always Innovating" if EMBEDDED + depends on USB_HID + default !EMBEDDED + ---help--- + Support for Always Innovating Touch Book. + config HID_APPLE tristate "Apple" if EMBEDDED depends on (USB_HID || BT_HIDP)
drivers/hid/Makefile +1 -0
@@ -20,6 +20,7 @@ ifdef CONFIG_LOGIRUMBLEPAD2_FF endif obj-$(CONFIG_HID_A4TECH) += hid-a4tech.o +obj-$(CONFIG_HID_ALWAYSINNOVATING) += hid-alwaysinnovating.o obj-$(CONFIG_HID_APPLE) += hid-apple.o obj-$(CONFIG_HID_BELKIN) += hid-belkin.o obj-$(CONFIG_HID_CHERRY) += hid-cherry.o
drivers/hid/hid-core.c +1 -0
@@ -1252,6 +1252,7 @@ EXPORT_SYMBOL_GPL(hid_disconnect);static const struct hid_device_id hid_blacklist[] = { {HID_USB_DEVICE (USB_VENDOR_ID_A4TECH ,USB_DEVICE_ID_A4TECH_WCP32PU ) }, {HID_USB_DEVICE (USB_VENDOR_ID_A4TECH ,USB_DEVICE_ID_A4TECH_X5_005D ) }, + {HID_USB_DEVICE (USB_VENDOR_ID_ALWAYSINNOVATING ,USB_DEVICE_ID_ALWAYSINNOVATING_TOUCH_BOOK ) }, {HID_USB_DEVICE (USB_VENDOR_ID_APPLE ,USB_DEVICE_ID_APPLE_ATV_IRCONTROL ) }, {HID_USB_DEVICE (USB_VENDOR_ID_APPLE ,USB_DEVICE_ID_APPLE_IRCONTROL4 ) }, {HID_USB_DEVICE (USB_VENDOR_ID_APPLE ,USB_DEVICE_ID_APPLE_MIGHTYMOUSE ) },
drivers/hid/hid-ids.h +3 -0
@@ -54,6 +54,9 @@#define USB_VENDOR_ID_ALPS 0x0433#define USB_DEVICE_ID_IBM_GAMEPAD 0x1101 +#define USB_VENDOR_ID_ALWAYSINNOVATING 0xa110 +#define USB_DEVICE_ID_ALWAYSINNOVATING_TOUCH_BOOK 0x0002 +#define USB_VENDOR_ID_APPLE 0x05ac#define USB_DEVICE_ID_APPLE_MIGHTYMOUSE 0x0304#define USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI 0x020e
Signature · 1 line
1.6.0.4
PATCH 5/8 AI TB: HID file for Always Innovating OMAP3-based Touch Book keyboard
In reply to Gregoire Gentil---drivers/hid/hid-alwaysinnovating.c | 262
++++++++++++++++++++++++++++++++++++
1 files changed, 262 insertions(+), 0 deletions(-)
create mode 100644 drivers/hid/hid-alwaysinnovating.c
(quoted diff) +0 -0
b/drivers/hid/hid-alwaysinnovating.c
new file mode 100644
index 0000000..a7bb0fd
drivers/hid/hid-alwaysinnovating.c new file +10 -0
@@ -0,0 +1,262 @@ +/* +* USB HID quirks support for the Always Innovating Touch Book +* Code borrowed from hid-apple.c +* +* Copyright (c) 2009 Gregoire Gentil <[email protected]> +* Copyright (c) 2009 Tim Yamin <[email protected]> +*/ + +/* +* 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.
+ */
+
+#include <linux/device.h>
+#include <linux/hid.h>
+#include <linux/module.h>
+#include <linux/usb.h>
+
+#include "hid-ids.h"
+
+struct touchbook_sc {
+ unsigned long quirks;
+ unsigned int fn_on;
+ DECLARE_BITMAP(pressed_fn, KEY_CNT);
+};
+
+struct touchbook_key_translation {
+ u16 from;
+ u16 to;
+ u8 flags;
+};
+
+static struct touchbook_key_translation touchbook_fn_keys[] = {
+ { KEY_F6, KEY_BRIGHTNESSDOWN },
+ { KEY_F7, KEY_BRIGHTNESSUP },
+
+ { KEY_F8, KEY_MUTE },
+ { KEY_F9, KEY_VOLUMEDOWN },
+ { KEY_F10, KEY_VOLUMEUP },
+
+ { KEY_UP, KEY_PAGEUP },
+ { KEY_DOWN, KEY_PAGEDOWN },
+ { }
+};
+
+extern unsigned long touchbook_revision;
+unsigned long swap_key;
+
+static struct touchbook_key_translation *touchbook_find_translation(
+ struct touchbook_key_translation *table, u16 from)
+{
+ struct touchbook_key_translation *trans;
+
+ /* Look for the translation */
+ for (trans = table; trans->from; trans++)
+ if (trans->from == from)
+ return trans;
+
+ return NULL;
+}
+
+static int touchbook_event(struct hid_device *hid, struct hid_field *field,
+ struct hid_usage *usage, __s32 value)
+{
+ int do_translate;
+
+ struct input_dev *input = field->hidinput->input;
+ struct touchbook_sc *asc = hid_get_drvdata(hid);
+ struct touchbook_key_translation *trans;
+
+ if (swap_key && usage->code == KEY_RIGHTSHIFT) {
+ input_event(input, usage->type, KEY_END, value);
+ return 1;
+ }
+
+ if (swap_key && usage->code == KEY_END) {
+ input_event(input, usage->type, KEY_RIGHTSHIFT, value);
+ return 1;
+ }
+
+ if (usage->code == KEY_POWER) {
+ asc->fn_on = !!value;
+ input_event(input, usage->type, usage->code, value);
+ return 1;
+ }
+
+ trans = touchbook_find_translation(touchbook_fn_keys, usage->code);
+ if (trans) {
+ if (test_bit(usage->code, asc->pressed_fn))
+ do_translate = 1;
+ else
+ do_translate = asc->fn_on;
+
+ if (do_translate) {
+ if (value)
+ set_bit(usage->code, asc->pressed_fn);
+ else
+ clear_bit(usage->code, asc->pressed_fn);
+
+ input_event(input, usage->type, trans->to,
+ value);
+
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+static int touchbook_input_mapping(struct hid_device *hdev,
+ struct hid_input *hi,
+ struct hid_field *field, struct hid_usage *usage,
+ unsigned long **bit, int *max)
+{
+ struct touchbook_key_translation *trans;
+
+ /* Enable all other keys */
+ for (trans = touchbook_fn_keys; trans->from; trans++)
+ set_bit(trans->to, hi->input->keybit);
+
+ return 0;
+}
+
+static ssize_t show_swap_key(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ return snprintf(buf, PAGE_SIZE, "%lu\n", swap_key);
+}
+
+static ssize_t store_swap_key(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ strict_strtoul(buf, 10, &swap_key);
+
+ if (swap_key != 0 && swap_key != 1) {
+ swap_key = 0;
+ return -EINVAL;
+ }
+
+ return count;
+}
+
+static struct device_attribute touchbook_hid_attrs[] = {
+ __ATTR(swap_key, S_IRUGO | S_IWUGO, show_swap_key, store_swap_key), +};
+
+int touchbook_create_sysfs(struct hid_device *hdev)
+{
+ int i;
+ int r;
+
+ for (i = 0; i < ARRAY_SIZE(touchbook_hid_attrs); i++) {
+ r = device_create_file(&hdev->dev,
+ &touchbook_hid_attrs[i]);
+
+ if (r) {
+ dev_err(&hdev->dev, "failed to create sysfs file\n");
+ return r;
+ }
+ }
+
+ return 0;
+}
+
+void touchbook_remove_sysfs(struct hid_device *hdev)
+{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(touchbook_hid_attrs); i++)
+ device_remove_file(&hdev->dev,
+ &touchbook_hid_attrs[i]);
+}
+
+static int touchbook_probe(struct hid_device *hdev,
+ const struct hid_device_id *id)
+{
+ unsigned long quirks = id->driver_data;
+ struct touchbook_sc *asc;
+ unsigned int connect_mask = HID_CONNECT_DEFAULT;
+ int ret;
+
+ asc = kzalloc(sizeof(*asc), GFP_KERNEL);
+ if (asc == NULL) {
+ dev_err(&hdev->dev, "can't alloc touchbook descriptor\n");
+ return -ENOMEM;
+ }
+
+ asc->quirks = quirks;
+ hid_set_drvdata(hdev, asc);
+
+ ret = hid_parse(hdev);
+ if (ret) {
+ dev_err(&hdev->dev, "parse failed\n");
+ goto err_free;
+ }
+
+ ret = touchbook_create_sysfs(hdev);
+ if (ret) {
+ dev_err(&hdev->dev, "failed to create sysfs entries\n");
+ goto err_free;
+ }
+
+ swap_key = (touchbook_revision >= 4) ? 1 : 0;
+
+ ret = hid_hw_start(hdev, connect_mask);
+ if (ret) {
+ dev_err(&hdev->dev, "hw start failed\n");
+ goto err_free;
+ }
+
+ return 0;
+err_free:
+ kfree(asc);
+ return ret;
+}
+
+static void touchbook_remove(struct hid_device *hdev)
+{
+ hid_hw_stop(hdev);
+ kfree(hid_get_drvdata(hdev));
+ touchbook_remove_sysfs(hdev);
+}
+
+static const struct hid_device_id touchbook_devices[] = {
+ { HID_USB_DEVICE(USB_VENDOR_ID_ALWAYSINNOVATING,
+ USB_DEVICE_ID_ALWAYSINNOVATING_TOUCH_BOOK) },
+ { }
+};
+
+MODULE_DEVICE_TABLE(hid, touchbook_devices);
+
+static struct hid_driver touchbook_driver = {
+ .name = "touchbook",
+ .id_table = touchbook_devices,
+ .probe = touchbook_probe,
+ .remove = touchbook_remove,
+ .event = touchbook_event,
+ .input_mapping = touchbook_input_mapping,
+};
+
+static int touchbook_init(void)
+{
+ int ret;
+
+ ret = hid_register_driver(&touchbook_driver);
+ if (ret)
+ printk(KERN_ERR "can't register touchbook driver\n");
+
+ return ret;
+}
+
+static void touchbook_exit(void)
+{
+ hid_unregister_driver(&touchbook_driver);
+}
+
+module_init(touchbook_init); +module_exit(touchbook_exit);
+MODULE_LICENSE("GPL");
Signature · 1 line
1.6.0.4
Quoted 1 line
From
436ef715c4c097b0a9577d3eddefeb6220ecebebMon Sep 17 00:00:00 2001
From: Gregoire Gentil <[email protected]>
Date: Wed, 18 Nov 2009 18:33:15 -0800
Subject: [PATCH] HID file for Always Innovating OMAP3-based Touch Book keyboard
--- drivers/hid/hid-alwaysinnovating.c | 262 ++++++++++++++++++++++++++++++++++++ 1 files changed, 262 insertions(+), 0 deletions(-) create mode 100644 drivers/hid/hid-alwaysinnovating.c
drivers/hid/hid-alwaysinnovating.c new file +262 -0
262 lines not on this page · raw message
Signature · 1 line
1.6.0.4
Dmitry Torokhov
maintainerRe: [PATCH 5/8] AI TB: HID file for Always Innovating OMAP3-based Touch Book keyboard
Hi Gregoire,
Quoted 6 lines · Gregoire Gentil
drivers/hid/hid-alwaysinnovating.c new file +6
-0+ +int touchbook_create_sysfs (struct hid_device *hdev) +{ +int i; +int r; +
drivers/hid/hid-alwaysinnovating.c line 164
Quoted 10 lines
drivers/hid/hid-alwaysinnovating.c new file +10
-0+for (i =0 ; i <ARRAY_SIZE (touchbook_hid_attrs); i++) { + r =device_create_file (&hdev->dev, + &touchbook_hid_attrs[i]); + +if (r) { +dev_err (&hdev->dev,"failed to create sysfs file\n" ); +return r; + } + } +
You just reimplemented sysfs attribute group.
Signature · 1 line
Dmitry
PATCH 6/8 AI TB: Audio driver of Always Innovating OMAP3-based Touch Book
In reply to Gregoire Gentil---
sound/soc/omap/Kconfig | 8 ++ sound/soc/omap/Makefile | 2 + sound/soc/omap/omap3touchbook.c | 211 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 221 insertions(+), 0 deletions(-)
create mode 100644 sound/soc/omap/omap3touchbook.c
sound/soc/omap/Kconfig +0 -0
@@ -83,6 +83,14 @@ config SND_OMAP_SOC_OMAP3_PANDORA
help
Say Y if you want to add support for SoC audio on the OMAP3 Pandora.
+config SND_OMAP_SOC_OMAP3_TOUCHBOOK
+ tristate "SoC Audio support for OMAP3 Touch Book"
+ depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP3_TOUCHBOOK
+ select SND_OMAP_SOC_MCBSP
+ select SND_SOC_TWL4030
+ help
+ Say Y if you want to add support for SoC audio on the OMAP3 Touch
Book.
+
config SND_OMAP_SOC_OMAP3_BEAGLE
tristate "SoC Audio support for OMAP3 Beagle"
depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP3_BEAGLE
sound/soc/omap/Makefile +0 -0
@@ -15,6 +15,7 @@ snd-soc-omap3evm-objs := omap3evm.o
snd-soc-sdp3430-objs := sdp3430.o
snd-soc-omap3pandora-objs := omap3pandora.o
snd-soc-omap3beagle-objs := omap3beagle.o
+snd-soc-omap3touchbook-objs := omap3touchbook.o
snd-soc-zoom2-objs := zoom2.o
obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o
@@ -26,4 +27,5 @@ obj-$(CONFIG_MACH_OMAP3EVM) += snd-soc-omap3evm.o obj-$(CONFIG_SND_OMAP_SOC_SDP3430) += snd-soc-sdp3430.o obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o obj-$(CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE) += snd-soc-omap3beagle.o +obj-$(CONFIG_SND_OMAP_SOC_OMAP3_TOUCHBOOK) += snd-soc-omap3touchbook.o obj-$(CONFIG_SND_OMAP_SOC_ZOOM2) += snd-soc-zoom2.o
(quoted diff) +0 -0
b/sound/soc/omap/omap3touchbook.c
new file mode 100644
index 0000000..584f07d
sound/soc/omap/omap3touchbook.c new file +46 -0
46 lines not on this page · raw message
*substream,
+ struct snd_pcm_hw_params *params)
+{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
+ struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+ unsigned int fmt;
+ int ret;
+
+ switch (params_channels(params)) {
+ case 2: /* Stereo I2S mode */
+ fmt = SND_SOC_DAIFMT_I2S |
+ SND_SOC_DAIFMT_NB_NF |
+ SND_SOC_DAIFMT_CBM_CFM;
+ break;
+ case 4: /* Four channel TDM mode */
+ fmt = SND_SOC_DAIFMT_DSP_A |
+ SND_SOC_DAIFMT_IB_NF |
+ SND_SOC_DAIFMT_CBM_CFM;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ /* Set codec DAI configuration */
+ ret = snd_soc_dai_set_fmt(codec_dai, fmt);
+ if (ret < 0) {
+ printk(KERN_ERR "can't set codec DAI configuration\n");
+ return ret;
+ }
+
+ /* Set cpu DAI configuration */
+ ret = snd_soc_dai_set_fmt(cpu_dai, fmt);
+ if (ret < 0) {
+ printk(KERN_ERR "can't set cpu DAI configuration\n");
+ return ret;
+ }
+
+ /* Set the codec system clock for DAC and ADC */
+ ret = snd_soc_dai_set_sysclk(codec_dai, 0, 26000000,
+ SND_SOC_CLOCK_IN);
+ if (ret < 0) {
+ printk(KERN_ERR "can't set codec system clock\n");
+ return ret;
+ }
+
+ return 0;
+}
+
+static struct snd_soc_ops omap3touchbook_ops = {
+ .hw_params = omap3touchbook_hw_params,
+};
+
+/* Digital audio interface glue - connects codec <--> CPU */ +static struct snd_soc_dai_link omap3touchbook_dai = {
+ .name = "TWL4030",
+ .stream_name = "TWL4030",
+ .cpu_dai = &omap_mcbsp_dai[0],
+ .codec_dai = &twl4030_dai[TWL4030_DAI_HIFI],
+ .ops = &omap3touchbook_ops,
+};
+
+/* Audio machine driver */
+static struct snd_soc_card snd_soc_omap3touchbook = {
+ .name = "omap3touchbook",
+ .platform = &omap_soc_platform,
+ .dai_link = &omap3touchbook_dai,
+ .num_links = 1,
+};
+
+/* Audio subsystem */
+static struct snd_soc_device omap3touchbook_snd_devdata = {
+ .card = &snd_soc_omap3touchbook,
+ .codec_dev = &soc_codec_dev_twl4030,
+};
+
+static struct platform_device *omap3touchbook_snd_device; +
+static void jack_work_func(struct work_struct *wq)
+{
+ struct snd_soc_device *socdev = platform_get_drvdata(
+ omap3touchbook_snd_device);
+ struct snd_soc_codec *codec = socdev->card->codec;
+
+ snd_soc_dapm_sync(codec);
+}
+DECLARE_WORK(jack_work, jack_work_func);
+
+static irqreturn_t touchbook_headphone_event(int irq, void *snd) +{
+ int status = gpio_get_value(TB_HEADPHONE_GPIO);
+ struct snd_soc_device *socdev = platform_get_drvdata(
+ omap3touchbook_snd_device);
+ struct snd_soc_codec *codec = socdev->card->codec;
+
+ if (status) {
+ snd_soc_dapm_disable_pin(codec, "HFL");
+ snd_soc_dapm_disable_pin(codec, "HFR");
+ } else {
+ snd_soc_dapm_enable_pin(codec, "HFL");
+ snd_soc_dapm_enable_pin(codec, "HFR");
+ }
+
+ schedule_work(&jack_work);
+ return IRQ_HANDLED;
+}
+
+static int __init omap3touchbook_soc_init(void)
+{
+ int ret;
+
+ if (!machine_is_touchbook()) {
+ pr_debug("Not OMAP3 Touch Book!\n");
+ return -ENODEV;
+ }
+ pr_info("OMAP3 Touch Book SoC init\n");
+
+ omap3touchbook_snd_device = platform_device_alloc("soc-audio", -1);
+ if (!omap3touchbook_snd_device) {
+ printk(KERN_ERR "Platform device allocation failed\n");
+ return -ENOMEM;
+ }
+
+ platform_set_drvdata(omap3touchbook_snd_device,
+ &omap3touchbook_snd_devdata);
+ omap3touchbook_snd_devdata.dev = &omap3touchbook_snd_device->dev;
+ *(unsigned int *)omap3touchbook_dai.cpu_dai->private_data = 1; +
+ /* Touch Book -- headphone jack sensor */
+ omap_set_gpio_debounce(TB_HEADPHONE_GPIO, 1);
+ omap_set_gpio_debounce_time(TB_HEADPHONE_GPIO, 0xff);
+
+ ret = request_irq(TB_HEADPHONE_IRQ, touchbook_headphone_event,
+ IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
+ "touchbook_headphone",
+ omap3touchbook_snd_device);
+ if (ret < 0)
+ goto err1;
+
+ ret = platform_device_add(omap3touchbook_snd_device);
+ if (ret)
+ goto err1;
+
+ /* Detect headphone status */
+ touchbook_headphone_event(0, omap3touchbook_snd_device); +
+ return 0;
+
+err1:
+ printk(KERN_ERR "Unable to add platform device\n");
+ platform_device_put(omap3touchbook_snd_device);
+
+ return ret;
+}
+
+static void __exit omap3touchbook_soc_exit(void)
+{
+ platform_device_unregister(omap3touchbook_snd_device); +}
+
+module_init(omap3touchbook_soc_init); +module_exit(omap3touchbook_soc_exit);
+
+MODULE_AUTHOR("Gregoire Gentil <[email protected]>"); +MODULE_DESCRIPTION("ALSA SoC OMAP3 Touch Book"); +MODULE_LICENSE("GPL");
Signature · 1 line
1.6.0.4
Quoted 1 line
From
6fdbeddabe5d368071fbc0c272302afe98580f55Mon Sep 17 00:00:00 2001
From: Gregoire Gentil <[email protected]>
Date: Wed, 18 Nov 2009 18:33:55 -0800
Subject: [PATCH] Audio driver of Always Innovating OMAP3-based Touch Book
--- sound/soc/omap/Kconfig | 8 ++ sound/soc/omap/Makefile | 2 + sound/soc/omap/omap3touchbook.c | 211 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 221 insertions(+), 0 deletions(-) create mode 100644 sound/soc/omap/omap3touchbook.c
sound/soc/omap/Kconfig +8 -0
@@ -83,6 +83,14 @@ config SND_OMAP_SOC_OMAP3_PANDORA help Say Y if you want to add support for SoC audio on the OMAP3 Pandora. +config SND_OMAP_SOC_OMAP3_TOUCHBOOK + tristate "SoC Audio support for OMAP3 Touch Book" + depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP3_TOUCHBOOK + select SND_OMAP_SOC_MCBSP + select SND_SOC_TWL4030 + help + Say Y if you want to add support for SoC audio on the OMAP3 Touch Book. + config SND_OMAP_SOC_OMAP3_BEAGLE tristate "SoC Audio support for OMAP3 Beagle" depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP3_BEAGLE
sound/soc/omap/Makefile +2 -0
@@ -15,6 +15,7 @@ snd-soc-omap3evm-objs := omap3evm.o snd-soc-sdp3430-objs := sdp3430.o snd-soc-omap3pandora-objs := omap3pandora.o snd-soc-omap3beagle-objs := omap3beagle.o +snd-soc-omap3touchbook-objs := omap3touchbook.o snd-soc-zoom2-objs := zoom2.o obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o
@@ -26,4 +27,5 @@ obj-$(CONFIG_MACH_OMAP3EVM) += snd-soc-omap3evm.o obj-$(CONFIG_SND_OMAP_SOC_SDP3430) += snd-soc-sdp3430.o obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o obj-$(CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE) += snd-soc-omap3beagle.o +obj-$(CONFIG_SND_OMAP_SOC_OMAP3_TOUCHBOOK) += snd-soc-omap3touchbook.o obj-$(CONFIG_SND_OMAP_SOC_ZOOM2) += snd-soc-zoom2.o
sound/soc/omap/omap3touchbook.c new file +211 -0
211 lines not on this page · raw message
Signature · 1 line
1.6.0.4
Re: [alsa-devel] [PATCH 6/8] AI TB: Audio driver of Always Innovating OMAP3-based Touch Book
Quoted 6 lines · Gregoire Gentil
Signed-off-by Gregoire Gentil <[email protected]>---
sound/soc/omap/Kconfig | 8 ++ sound/soc/omap/Makefile | 2 + sound/soc/omap/omap3touchbook.c | 211+++++++++++++++++++++++++++++++++++++++
Your MUA has word wrapped this patch so it can't be applied. It's also removed all the indentation so I skipped reviewing it due to the resulting legibility issues.
PATCH 7/8 AI TB: Video driver of Always Innovating OMAP3-based Touch Book
In reply to Gregoire Gentil---drivers/video/omap/lcd_omap3touchbook.c | 130
+++++++++++++++++++++++++++++++
1 files changed, 130 insertions(+), 0 deletions(-)
create mode 100644 drivers/video/omap/lcd_omap3touchbook.c
(quoted diff) +0 -0
b/drivers/video/omap/lcd_omap3touchbook.c
new file mode 100644
index 0000000..5b58703
drivers/video/omap/lcd_omap3touchbook.c new file +8 -0
@@ -0,0 +1,130 @@ +/* +* LCD panel support for the Touch Book +* +* Author: Gregoire Gentil <[email protected]> +* +* Derived from drivers/video/omap/lcd-omap3beagle.c +* +* 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.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/gpio.h>
+#include <linux/i2c/twl4030.h>
+
+#include <plat/mux.h>
+#include <plat/omapfb.h>
+#include <asm/mach-types.h>
+
+#define LCD_PANEL_ENABLE_GPIO 176
+
+static int omap3beagle_panel_init(struct lcd_panel *panel,
+ struct omapfb_device *fbdev)
+{
+ gpio_request(LCD_PANEL_ENABLE_GPIO, "LCD enable");
+ return 0;
+}
+
+static void omap3beagle_panel_cleanup(struct lcd_panel *panel) +{
+ gpio_free(LCD_PANEL_ENABLE_GPIO);
+}
+
+static int omap3beagle_panel_enable(struct lcd_panel *panel) +{
+ gpio_set_value(LCD_PANEL_ENABLE_GPIO, 1);
+ return 0;
+}
+
+static void omap3beagle_panel_disable(struct lcd_panel *panel) +{
+ gpio_set_value(LCD_PANEL_ENABLE_GPIO, 0);
+}
+
+static unsigned long omap3beagle_panel_get_caps(struct lcd_panel *panel)
+{
+ return 0;
+}
+
+struct lcd_panel omap3beagle_panel = {
+ .name = "omap3beagle",
+ .config = OMAP_LCDC_PANEL_TFT,
+
+ .bpp = 16,
+ .data_lines = 24,
+ .x_res = 1024,
+ .y_res = 600,
+ .hsw = 3,
+ .hfp = 3,
+ .hbp = 39,
+ .vsw = 1,
+ .vfp = 2,
+ .vbp = 7,
+
+ .pixel_clock = 64000,
+
+ .init = omap3touchbook_panel_init,
+ .cleanup = omap3touchbook_panel_cleanup,
+ .enable = omap3touchbook_panel_enable,
+ .disable = omap3touchbook_panel_disable,
+ .get_caps = omap3touchbook_panel_get_caps,
+};
+
+static int omap3touchbook_panel_probe(struct platform_device *pdev) +{
+ omapfb_register_panel(&omap3beagle_panel);
+ return 0;
+}
+
+static int omap3touchbook_panel_remove(struct platform_device *pdev) +{
+ return 0;
+}
+
+static int omap3touchbook_panel_suspend(struct platform_device *pdev,
+ pm_message_t mesg)
+{
+ return 0;
+}
+
+static int omap3touchbook_panel_resume(struct platform_device *pdev) +{
+ return 0;
+}
+
+struct platform_driver omap3touchbook_panel_driver = {
+ .probe = omap3touchbook_panel_probe,
+ .remove = omap3touchbook_panel_remove,
+ .suspend = omap3touchbook_panel_suspend,
+ .resume = omap3touchbook_panel_resume,
+ .driver = {
+ .name = "omap3touchbook_lcd",
+ .owner = THIS_MODULE,
+ },
+};
+
+static int __init omap3touchbook_panel_drv_init(void)
+{
+ return platform_driver_register(&omap3beagle_panel_driver); +}
+
+static void __exit omap3touchbook_panel_drv_exit(void)
+{
+ platform_driver_unregister(&omap3touchbook_panel_driver); +}
+
+module_init(omap3touchbook_panel_drv_init); +module_exit(omap3touchbook_panel_drv_exit);
Signature · 1 line
1.6.0.4
Quoted 1 line
From
f5576d74460c00bf82707fc9a2d4db12227b55e0Mon Sep 17 00:00:00 2001
From: Gregoire Gentil <[email protected]>
Date: Wed, 18 Nov 2009 18:34:14 -0800
Subject: [PATCH] Video driver of Always Innovating OMAP3-based Touch Book
--- drivers/video/omap/lcd_omap3touchbook.c | 130 +++++++++++++++++++++++++++++++ 1 files changed, 130 insertions(+), 0 deletions(-) create mode 100644 drivers/video/omap/lcd_omap3touchbook.c
drivers/video/omap/lcd_omap3touchbook.c new file +130 -0
130 lines not on this page · raw message
Signature · 1 line
1.6.0.4
PATCH 8/8 AI TB: Additional files for Always Innovating OMAP3-based Touch Book
In reply to Gregoire GentilQuoted 1 line
From
64919217ca10bd1954f4a4b07c9de72a1a60a0e8Mon Sep 17 00:00:00 2001
From: Gregoire Gentil <[email protected]>
Date: Wed, 18 Nov 2009 18:34:39 -0800
Subject: [PATCH] Additional file for Always Innovating OMAP3-based Touch Book
---
arch/arm/mach-omap2/Kconfig | 5 +++++ arch/arm/mach-omap2/Makefile | 2 ++ 2 files changed, 7 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/Kconfig +0 -0
@@ -73,6 +73,11 @@ config MACH_OMAP3_PANDORA
bool "OMAP3 Pandora"
depends on ARCH_OMAP3 && ARCH_OMAP34XX
+config MACH_OMAP3_TOUCHBOOK
+ bool "OMAP3 Touch Book"
+ depends on ARCH_OMAP3 && ARCH_OMAP34XX
+ select BACKLIGHT_CLASS_DEVICE
+
config MACH_OMAP_3430SDP
bool "OMAP 3430 SDP board"
depends on ARCH_OMAP3 && ARCH_OMAP34XX
arch/arm/mach-omap2/Makefile +0 -0
@@ -90,6 +90,8 @@ obj-$(CONFIG_MACH_CM_T35) += board-cm-t35.o \ mmc-twl4030.o
obj-$(CONFIG_MACH_IGEP0020) += board-igep0020.o \
mmc-twl4030.o
+obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK) += board-omap3touchbook.o \
+ mmc-twl4030.o
obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o
Signature · 1 line
1.6.0.4
Quoted 1 line
From
64919217ca10bd1954f4a4b07c9de72a1a60a0e8Mon Sep 17 00:00:00 2001
From: Gregoire Gentil <[email protected]>
Date: Wed, 18 Nov 2009 18:34:39 -0800
Subject: [PATCH] Additional file for Always Innovating OMAP3-based Touch Book
--- arch/arm/mach-omap2/Kconfig | 5 +++++ arch/arm/mach-omap2/Makefile | 2 ++ 2 files changed, 7 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/Kconfig +5 -0
@@ -73,6 +73,11 @@ config MACH_OMAP3_PANDORA bool "OMAP3 Pandora" depends on ARCH_OMAP3 && ARCH_OMAP34XX +config MACH_OMAP3_TOUCHBOOK + bool "OMAP3 Touch Book" + depends on ARCH_OMAP3 && ARCH_OMAP34XX + select BACKLIGHT_CLASS_DEVICE + config MACH_OMAP_3430SDP bool "OMAP 3430 SDP board" depends on ARCH_OMAP3 && ARCH_OMAP34XX
arch/arm/mach-omap2/Makefile +2 -0
@@ -90,6 +90,8 @@ obj-$(CONFIG_MACH_CM_T35) += board-cm-t35.o \ mmc-twl4030.o obj-$(CONFIG_MACH_IGEP0020) += board-igep0020.o \ mmc-twl4030.o +obj-$(CONFIG_MACH_OMAP3_TOUCHBOOK) += board-omap3touchbook.o \ + mmc-twl4030.o obj-$(CONFIG_MACH_OMAP_4430SDP) += board-4430sdp.o
Signature · 1 line
1.6.0.4
Tony Lindgren
maintainerPATCH 3/3 htcherald: Add default kernel configuration for Herald
In reply to Cory MaccarroneThis patch has been applied to the linux-omap
by youw fwiendly patch wobot.
Branch in linux-omap: for-next
Initial commit ID (Likely to change): cb0c84c058503993a2ef954430d217b484354c8c
PatchWorks
http://patchwork.kernel.org/patch/60055/
Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=cb0c84c058503993a2ef954430d217b484354c8c