conf/machine: Drop older machines with no recent updates

These are all moving to meta-extras. Ideally in the future machines
such as these will be maintained to topic specific layers as we move
to a more layer oriented model. If this causes a problem for anyone
please discuss it on the mailing list.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2011-02-18 15:32:57 +00:00
parent fed61beb31
commit 673abd92f9
499 changed files with 0 additions and 3142073 deletions

View File

@ -1,12 +0,0 @@
#@TYPE: Machine
#@NAME: Sharp Zaurus SL-C1000
#@DESCRIPTION: Machine configuration for the Sharp Zaurus SL-C1000 device
require conf/machine/include/zaurus-2.6.inc
require conf/machine/include/zaurus-clamshell.inc
MACHINE_FEATURES += "iwmmxt"
IMAGE_FSTYPES ?= "jffs2"
ROOT_FLASH_SIZE = "58"

View File

@ -1,14 +0,0 @@
#@TYPE: Machine
#@NAME: Sharp Zaurus SL-C7x0
#@DESCRIPTION: Machine configuration for the Sharp Zaurus SL-C700, Sharp Zaurus SL-C750, Sharp Zaurus SL-C760, Sharp Zaurus SL-C860 devices
require conf/machine/include/zaurus-2.6.inc
require conf/machine/include/zaurus-clamshell.inc
IMAGE_FSTYPES ?= "jffs2"
ROOT_FLASH_SIZE = "25"
# yes, we are aware that the husky (c760,c860) has 54MB rootfs, but we don't make a special image for it.
#XSERVER = "xserver-kdrive-imageon"

View File

@ -1,67 +0,0 @@
#@TYPE: Machine
#@Name: Compulab cm-x270
#@DESCRIPTION: Machine configuration for Compulab cm-x270 computer module
#OLDEST_KERNEL = "2.6.16"
TARGET_ARCH = "arm"
GUI_MACHINE_CLASS ?= "bigscreen"
PREFERRED_PROVIDER_virtual/kernel = "linux"
PREFERRED_VERSION_linux ?= "2.6.23"
require conf/machine/include/tune-xscale.inc
PACKAGE_EXTRA_ARCHS += "iwmmxt"
# Console serial port.
# If you have a W module, add the following line to your local.conf:
# the following line to your local.conf:
CMX270_CONSOLE_SERIAL_PORT ?= "ttyS0"
# the following is for the cm-x270 L module
#CMX270_CONSOLE_SERIAL_PORT ?= "ttyS1"
# NAND flash eraseblock size
# most of the older cm-x270 modules are populated with NAND flash
# that have 128KiB eraseblocks. Recently, a user encounted
# a device that has 16KiB eraseblocks. The following define
# can be overridden in local.conf if you have one of these devices.
CMX270_NAND_ERASEBLOCK_SIZE ?= "0x20000"
# used by sysvinit_2 package, so rebuild this
# package if you change the SERIAL_CONSOLE setting
# the following is the port for the cm-x270 L module
# I think the W module would use ttyS0, but has
# not been tested. This can be overwritten in
# local.conf
SERIAL_CONSOLE ?= "38400 ${CMX270_CONSOLE_SERIAL_PORT}"
# used by opie-collections.inc
ROOT_FLASH_SIZE ?= "32"
# for NAND flash.
EXTRA_IMAGECMD_jffs2 = "--little-endian --eraseblock=${CMX270_NAND_ERASEBLOCK_SIZE} --pad --no-cleanmarkers;\
sumtool -i ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \
-o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs-summary.jffs2 \
-e ${CMX270_NAND_ERASEBLOCK_SIZE} -p; \
cd ${DEPLOY_DIR_IMAGE}; \
rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.rootfs-summary.jffs2; \
ln -s ${IMAGE_NAME}.rootfs-summary.jffs2 ${IMAGE_LINK_NAME}.rootfs-summary.jffs2 \
"
MACHINE_FEATURES = "kernel26 pcmcia usbhost usbgadget pcmcia alsa iwmmxt"
# to program the compulab NAND flash, the following scheme is suggested. Create
# a small rootfs that can fit in NOR flash using the following config:
# - Angstrom distro
# - uclibc (set ANGSTROM_MODE = "uclibc" in local.conf)
# - angstrom-minimal-image-with-mtd-utils bitbake target
# - put the following in your local.conf
# - IMAGE_FSTYPES = "jffs2 tar cpio.gz"
# now, when you build the image, a cpio.gz will be generated
# that can be used as an initramfs. You can boot into this image and then
# program the main rootfs jffs2 image in NAND flash using mtd-utils
# you can select booting the initramfs, or the main nand rootfs by using
# the "ramdisk on", or "ramdisk off" commands in the bootloader
#

View File

@ -1,31 +0,0 @@
#@TYPE: Machine
#@NAME: Simtec BBD20EUROU + IM2440D20 (Combination known as: Depicture)
#@DESCRIPTION: Machine configuration for running an ARM 920t in the BBD20EUROU board.
TARGET_ARCH = "arm"
require conf/machine/include/qemu.inc
require conf/machine/include/tune-arm920t.inc
KERNEL_IMAGETYPE = "zImage"
SERIAL_CONSOLE = "115200 ttySAC0"
PREFERRED_PROVIDER_virtual/kernel = "linux-simtec"
PREFERRED_PROVIDER_virtual/xserver = "xserver-kdrive-fbdev"
MACHINE_FEATURES = "kernel26 alsa usbhost"
XSERVER = "xserver-kdrive-fbdev"
SERIAL_CONSOLE = "115200 ttySAC0"
# used by some images
ROOT_FLASH_SIZE = "28"
# Ensure the JFFS2 has summary nodes...
IMAGE_FSTYPES += " jffs2"
EXTRA_IMAGECMD_jffs2 = "--little-endian --eraseblock=0x20000 --pagesize=0x800 \
--no-cleanmarkers --pad -n -x lzo ; sumtool --eraseblock=0x20000 --no-cleanmarkers \
--littleendian --pad \
-i ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \
-o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2.summary"

View File

@ -1,64 +0,0 @@
#@TYPE: Machine
#@NAME: EM-X270
#@DESCRIPTION: Machine configuration for the CompuLab EM-X270 with a pxa27x CPU
#
# Hardware-based properties
#
TARGET_ARCH = "arm"
GUI_MACHINE_CLASS ?= "bigscreen"
PREFERRED_PROVIDER_virtual/kernel = "linux"
require conf/machine/include/tune-xscale.inc
# Uncomment this to use iwmmxt optimizations. Remove the above xscale stuff first
# require conf/machine/include/tune-iwmmxt.inc
IMAGE_DEPENDS_jffs2 += " genext2fs-native "
ROOT_FLASH_SIZE = "128"
IMAGE_CMD_jffs2 = " \
mkfs.jffs2 --root=${IMAGE_ROOTFS} \
--output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \
--eraseblock=0x20000 --pad --faketime -n; \
sumtool -i ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \
-o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs-summary.jffs2 \
-e 0x20000 -p; \
mkdir -p ${WORKDIR}/img; \
mkdir -p ${WORKDIR}/kern-img/; \
install -m 0644 `readlink -f ${DEPLOY_DIR_IMAGE}/uImage-em-x270.bin` ${WORKDIR}/kern-img/uImage; \
mkfs.jffs2 --root=${WORKDIR}/kern-img/ --eraseblock=0x20000 --pad \
--no-cleanmarkers --faketime --output=${WORKDIR}/img/em-x270-kernel.jffs2; \
cd ${DEPLOY_DIR_IMAGE}; \
ln -fs ${IMAGE_NAME}.rootfs-summary.jffs2 ${IMAGE_LINK_NAME}.rootfs-summary.jffs2; \
install -m 0644 ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.rootfs-summary.jffs2 \
${WORKDIR}/img/em-x270-angstrom.jffs2; \
size=`du -sk ${WORKDIR}/img | cut -f 1` ; ((size *= 120)) ; ((size /= 100)) ; \
genext2fs -d ${WORKDIR}/img -b $size ${DEPLOY_DIR_IMAGE}/updater-em-x270.ext2 \
"
#VOLATILE_STORAGE_SIZE = "128"
MACHINE_DISPLAY_WIDTH_PIXELS ?= "480"
MACHINE_DISPLAY_HEIGHT_PIXELS ?= "640"
MACHINE_FEATURES = "kernel26 touchscreen apm alsa bluetooth wifi usbhost usbgadget screen phone "
#
# Software/packages selection
#
PREFERRED_PROVIDER_xserver = "xserver-kdrive"
#
# Modules autoload and other boot properties
#
module_autoload_evdev = "evdev"
module_autoload_mmc_block = "mmc_block"
module_autoload_pxa27x_udc = "pxa27x_udc"
#FIXME: this should be controlled by a userspace utility later.
module_autoload_g_ether = "g_ether"
SERIAL_CONSOLE = "115200 ttyS0"
KERNEL_IMAGETYPE = "uImage"
UBOOT_ENTRYPOINT = "a0008000"

View File

@ -1,33 +0,0 @@
#@TYPE: Machine
#@NAME: HTC Universal
#@DESCRIPTION: Machine configuration for the HTC Universal smartphone
#include conf/machine/include/tune-iwmmxt.inc
include conf/machine/include/tune-xscale.inc
PACKAGE_EXTRA_ARCHS += "iwmmxt"
TARGET_ARCH = "arm"
PREFERRED_PROVIDER_virtual/kernel = "linux-rp"
MACHINE_FEATURES = "kernel26 apm alsa bluetooth irda screen touchscreen keyboard usbhost usbgadget wifi phone"
MACHINE_EXTRA_RDEPENDS = "zaurusd"
MACHINE_EXTRA_RRECOMMENDS = " \
kernel-module-htcuniversal-bt \
kernel-module-htcuniversal-phone \
kernel-module-i2c-pxa \
kernel-module-htcuniversal-acx \
kernel-module-acx \
kernel-module-usbserial \
"
module_autoload_acx = "acx"
module_autoload_htcuniversal_acx = "htcuniversal_acx"
IMAGE_FSTYPES ?= "tar.gz"
# Don't include kernels in standard images for Zaurus machines
RDEPENDS_kernel-base = ""
KERNEL_IMAGETYPE = "zImage"

View File

@ -1,49 +0,0 @@
#@TYPE: Machine
#@NAME: iPAQ hx2xxx
#@DESCRIPTION: Machine configuration for the hx2000 iPAQs with a pxa27x CPU
TARGET_ARCH = "arm"
PACKAGE_EXTRA_ARCHS += "iwmmxt"
PREFERRED_PROVIDER_virtual/kernel = "linux-rp"
PREFERRED_VERSION_orinoco-modules = "0.15rc1"
ROOT_FLASH_SIZE = "80"
EXTRA_IMAGECMD_jffs2 = "; sumtool -i ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 \
-o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs-summary.jffs2 \
-e 256KiB -p"
IMAGE_FSTYPES ?= "jffs2 tar.bz2"
MODUTILS = "26"
MACHINE_FEATURES = "kernel26 touchscreen apm alsa pcmcia bluetooth irda wifi usbgadget usbhost screen vfat"
PCMCIA_MANAGER = "pcmciautils"
SERIAL_CONSOLE = "115200 ttyS0"
MACHINE_GUI_CLASS = "smallscreen"
MACHINE_DISPLAY_WIDTH_PIXELS = "240"
MACHINE_DISPLAY_HEIGHT_PIXELS = "320"
require conf/machine/include/tune-xscale.inc
# Uncomment this to use iwmmxt optimizations. Remove the above xscale stuff first
#require conf/machine/include/tune-iwmmxt.inc
module_autoload_evdev = "evdev"
module_autoload_pcmcia = "pcmcia"
module_autoload_mmc_block = "mmc_block"
module_autoload_snd-pcm-oss = "snd-pcm-oss"
module_autoload_snd-mixer-oss = "snd-mixer-oss"
module_autoload_pxa27x_udc = "pxa27x_udc"
#FIXME: this should be controlled by a userspace utility later.
module_autoload_g_ether = "g_ether"
# Don't include kernels in standard images
RDEPENDS_kernel-base = ""
KERNEL_IMAGETYPE = "zImage"

View File

@ -1,40 +0,0 @@
#@TYPE: Machine
#@NAME: IGEP v2 machine
#@DESCRIPTION: Machine configuration for the IGEP v2 board (http://www.myigep.com)
TARGET_ARCH = "arm"
# Floating point option
TARGET_FPU_arm = "hard"
PREFERRED_PROVIDER_virtual/xserver = "xserver-xf86-lite"
XSERVER = "xserver-xf86-lite \
xf86-input-evdev \
xf86-input-mouse \
xf86-input-keyboard \
xf86-video-omapfb"
# Only has DVI connector for external screen
GUI_MACHINE_CLASS = "bigscreen"
#Ship all kernel modules till the board support has matured enough
MACHINE_EXTRA_RRECOMMENDS = " kernel-modules linux-firmware-sd8686"
include conf/machine/include/tune-cortexa8.inc
IMAGE_FSTYPES += "cpio ext3 jffs2"
EXTRA_IMAGECMD_jffs2 = "-lnp "
# Guesswork
SERIAL_CONSOLE = "115200 ttyS2"
PREFERRED_PROVIDER_virtual/kernel = "linux-igep"
KERNEL_IMAGETYPE = "uImage"
UBOOT_ENTRYPOINT = "0x80008000"
UBOOT_LOADADDRESS = "0x80008000"
MACHINE_FEATURES = "kernel26 apm alsa bluetooth usbgadget usbhost vfat wifi"
# EXTRA_IMAGEDEPENDS += "u-boot x-load"

View File

@ -1,40 +0,0 @@
#@TYPE: Machine
#@NAME: OMAP3 IGEP module
#@DESCRIPTION: Machine configuration for the OMAP3 IGEP module (http://www.myigep.com)
TARGET_ARCH = "arm"
# Floating point option
TARGET_FPU_arm = "hard"
PREFERRED_PROVIDER_virtual/xserver = "xserver-xf86-lite"
XSERVER = "xserver-xf86-lite \
xf86-input-evdev \
xf86-input-mouse \
xf86-input-keyboard \
xf86-video-omapfb"
# Only has DVI connector for external screen
GUI_MACHINE_CLASS = "bigscreen"
#Ship all kernel modules till the board support has matured enough
MACHINE_EXTRA_RRECOMMENDS = " kernel-modules linux-firmware-sd8686"
include conf/machine/include/tune-cortexa8.inc
IMAGE_FSTYPES += "cpio ext3 jffs2"
EXTRA_IMAGECMD_jffs2 = "-lnp "
# Guesswork
SERIAL_CONSOLE = "115200 ttyS2"
PREFERRED_PROVIDER_virtual/kernel = "linux-igep"
KERNEL_IMAGETYPE = "uImage"
UBOOT_ENTRYPOINT = "0x80008000"
UBOOT_LOADADDRESS = "0x80008000"
MACHINE_FEATURES = "kernel26 apm alsa bluetooth usbgadget usbhost vfat wifi"
# EXTRA_IMAGEDEPENDS += "u-boot x-load"

View File

@ -1,15 +0,0 @@
#@TYPE: Machine
#@NAME: Freescale imx31 ADS Board
#@DESCRIPTION: Machine configuration for the imx31 based Freescale ADS Board
TARGET_ARCH = "arm"
PREFERRED_PROVIDER_virtual/kernel = "linux-mx31"
MACHINE_FEATURES = "kernel26 apm alsa bluetooth irda screen touchscreen"
IMAGE_FSTYPES ?= "tar.gz jffs2"
SERIAL_CONSOLE = "-L 115200 ttymxc0"
EXTRA_IMAGECMD_jffs2_mx31ads = "--pad --little-endian --eraseblock=0x20000 -n"
require conf/machine/include/tune-arm1136jf-s.inc

View File

@ -1,16 +0,0 @@
#@TYPE: Machine
#@NAME: Phytec phyCORE-iMX31 Board
#@DESCRIPTION: Machine configuration for the imx31 based Phytec phyCORE-iMX31
TARGET_ARCH = "arm"
PREFERRED_PROVIDER_virtual/kernel = "linux-mx31"
MACHINE_FEATURES = "kernel26 apm alsa bluetooth irda screen touchscreen"
IMAGE_FSTYPES ?= "tar.gz jffs2"
KERNEL_IMAGETYPE = "uImage"
UBOOT_ENTRYPOINT = "80008000"
SERIAL_CONSOLE = "-L 115200 ttymxc0"
EXTRA_IMAGECMD_jffs2_mx31phy = "--pad --little-endian --eraseblock=0x20000 -n"
require conf/machine/include/tune-arm1136jf-s.inc

View File

@ -1,26 +0,0 @@
#@TYPE: Machine
#@NAME: TI OMAP 3430 LDP
#@DESCRIPTION: Machine configuration for the TI OMAP 3430 LDP (aka OMAP Zoom)
TARGET_ARCH = "arm"
PREFERRED_PROVIDER_virtual/kernel = "linux-omap"
MACHINE_FEATURES = "kernel26 apm alsa bluetooth screen touchscreen phone"
KERNEL_IMAGETYPE = "uImage"
IMAGE_FSTYPES ?= "tar.gz jffs2"
EXTRA_IMAGECMD_jffs2 = "--pad --little-endian --eraseblock=0x20000 -n"
SERIAL_CONSOLE = "-L 115200 ttyS2"
require conf/machine/include/tune-cortexa8.inc
#require conf/machine/include/tune-arm1136jf-s.inc
MACHINE_EXTRA_RRECOMMENDS = "\
kernel-module-ads7846 \
kernel-module-atkbd \
kernel-module-g-ether \
kernel-module-musb-hdrc \
kernel-module-omap24xxlib \
kernel-module-omap24xxvout \
kernel-module-omap-hsmmc \
kernel-module-snd-omap2-audio \
"

View File

@ -1,15 +0,0 @@
#@TYPE: Machine
#@NAME: TI OMAP 3430 SDP
#@DESCRIPTION: Machine configuration for the TI OMAP 3430 SDP
TARGET_ARCH = "arm"
PREFERRED_PROVIDER_virtual/kernel = "linux-omap"
MACHINE_FEATURES = "kernel26 apm alsa bluetooth irda screen touchscreen"
KERNEL_IMAGETYPE = "uImage"
IMAGE_FSTYPES ?= "tar.gz jffs2"
EXTRA_IMAGECMD_jffs2 = "--pad --little-endian --eraseblock=0x20000 -n"
SERIAL_CONSOLE = "-L 115200 ttyS0"
require conf/machine/include/tune-cortexa8.inc
#require conf/machine/include/tune-arm1136jf-s.inc

View File

@ -1,36 +0,0 @@
#@TYPE: Machine
#@NAME: overo machine
#@DESCRIPTION: Machine configuration for the overo
include conf/machine/include/tune-cortexa8.inc
TARGET_ARCH = "arm"
MACHINE_FEATURES = "kernel26 apm usbgadget usbhost vfat alsa"
PREFERRED_VERSION_u-boot = "git"
UBOOT_ENTRYPOINT = "0x80008000"
UBOOT_LOADADDRESS = "0x80008000"
PREFERRED_PROVIDER_virtual/kernel = "linux-omap3"
KERNEL_IMAGETYPE = "uImage"
MACHINE_EXTRA_RRECOMMENDS = " kernel-modules"
SERIAL_CONSOLE = "115200 ttyS2"
IMAGE_FSTYPES += "tar.bz2 jffs2"
EXTRA_IMAGECMD_jffs2 = "-lnp "
EXTRA_IMAGEDEPENDS += "u-boot x-load"
PREFERRED_PROVIDER_virtual/xserver = "xserver-kdrive"
#XSERVER = "xserver-xorg \
# xf86-input-evdev \
# xf86-input-mouse \
# xf86-video-fbdev \
# xf86-input-keyboard"
XSERVER = "xserver-kdrive-fbdev"
GUI_MACHINE_CLASS = "bigscreen"
ANGSTROM_URI = "http://www.gumstix.net"

View File

@ -1,15 +0,0 @@
#@TYPE: Machine
#@NAME: Sharp Zaurus SL-C3000
#@DESCRIPTION: Machine configuration for the Sharp Zaurus SL-C3000 device
require conf/machine/include/zaurus-2.6.inc
require conf/machine/include/zaurus-clamshell.inc
MACHINE_FEATURES += "iwmmxt"
PIVOTBOOT_EXTRA_RDEPENDS += "pivotinit ${PCMCIA_MANAGER}"
IMAGE_FSTYPES ?= "tar.gz ext3"
IMAGE_ROOTFS_SIZE_ext3 = "250000"
ROOT_FLASH_SIZE = "100"

View File

@ -1,19 +0,0 @@
#@TYPE: Machine
#@NAME: Logic PD Zoom2
#@DESCRIPTION: Machine configuration for the OMAP3-powered Logic PD Zoom2
TARGET_ARCH = "arm"
PREFERRED_PROVIDER_virtual/kernel = "linux-omap-zoomsync"
MACHINE_FEATURES = "kernel26 apm alsa usbgadget usbhost screen touchscreen"
KERNEL_IMAGETYPE = "uImage"
IMAGE_FSTYPES ?= "tar.gz jffs2 ext2"
UBOOT_ENTRYPOINT ="0x80008000"
UBOOT_LOADADDRESS ="0x80008000"
EXTRA_IMAGECMD_jffs2 = "--pad --little-endian --eraseblock=0x20000 -n"
SERIAL_CONSOLE = "-L 115200 ttyS3"
#MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS = "u-boot x-load"
require conf/machine/include/tune-cortexa8.inc

View File

@ -1,25 +0,0 @@
#@TYPE: Machine
#@NAME: Marvel PXA3xx Monahans Zylonite
#@DESCRIPTION: Machine configuration for the Zylonite Development board
require conf/machine/include/tune-xscale.inc
PACKAGE_EXTRA_ARCHS += "iwmmxt"
TARGET_ARCH = "arm"
EXTRA_IMAGECMD_jffs2 = "--little-endian --eraseblock=0x20000 -n -x lzo -p"
IMAGE_CMD_jffs2 = "mkdir -p ${DEPLOY_DIR_IMAGE}; \
mkfs.jffs2 --root=${IMAGE_ROOTFS} --faketime \
--output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 ${EXTRA_IMAGECMD}; "
IMAGE_FSTYPES ?= "tar.bz2 jffs2"
SERIAL_CONSOLE = "38400 ttyS0"
PREFERRED_PROVIDER_virtual/kernel = "linux-rp"
PREFERRED_PROVIDER_virtual/xserver = "xserver-kdrive"
XSERVER = "xserver-kdrive-fbdev"
MACHINE_FEATURES = "kernel26 apm usbgadget"

View File

@ -1,11 +0,0 @@
SECTION = "base"
SRC_URI = "file://header-c700.bin"
LICENSE = "sharp-binary-only"
COMPATIBLE_MACHINE = '(c7x0|spitz|akita)'
# Install into machine specific staging area so do_rootfs can find this
PACKAGE_ARCH = "${MACHINE_ARCH}"
do_install() {
install -d ${D}${libdir}/sharp-flash-header
install -m 0644 ${WORKDIR}/header-c700.bin ${D}${libdir}/sharp-flash-header/header-c700.bin
}

View File

@ -1,18 +0,0 @@
SECTION = "console/utils"
LICENSE = "GPL"
DESCRIPTION = "A tool to encode and decode the Sharp Zaurus updater.sh script"
SRC_URI = "file://encdec-updater.c"
COMPATIBLE_MACHINE = '(poodle|c7x0|spitz|akita|tosa)'
do_compile() {
${CC} -o encdec-updater ${WORKDIR}/encdec-updater.c
}
do_install() {
install -d ${D}${bindir}
install -m 0755 encdec-updater ${D}${bindir}/
}
BBCLASSEXTEND = "native"

View File

@ -1,80 +0,0 @@
//
//
// Sharp Zaurus SL-C7x0 updater.sh script encoder/decoder
//
// mailto:sash@cacko.biz
//
//
#include <stdio.h>
unsigned char enctab[] = {
0x4a,0xf7,0x77,0x62,0xb0,0xe3,0xd8,0xf6,0xd1,0x98,0x09,0x2e,0x19,0x0c,0x0d,0x7c,
0x04,0xe0,0x6b,0x22,0x10,0x08,0x15,0x16,0xb9,0x28,0x83,0x1f,0x91,0x06,0xfa,0xe8,
0xbd,0xc6,0x21,0x32,0x23,0x6f,0x01,0x26,0x5f,0x03,0x33,0xb6,0x35,0xac,0x2d,0x0a,
0x6e,0x6c,0xfc,0xc4,0x29,0x34,0x2b,0x42,0x25,0x66,0xc9,0x3e,0x87,0xb4,0x74,0xf2,
0x11,0x20,0x41,0xb3,0x27,0x14,0xc1,0xcd,0x3d,0x80,0xd5,0x7f,0xcf,0x4c,0x4d,0xca,
0x75,0x51,0xc8,0xa6,0x17,0xf0,0x55,0x82,0x79,0xdc,0x59,0x5a,0x5b,0xb8,0x5d,0x40,
0x64,0x58,0xff,0xc5,0xab,0xc0,0xae,0xeb,0xa3,0xad,0xea,0x6a,0x37,0x3b,0x73,0x9a,
0x88,0x3a,0xe1,0x68,0x0b,0xec,0xc7,0x76,0xf9,0x38,0x57,0xdd,0x49,0x96,0x95,0x7a,
0x50,0x2a,0x4e,0xdb,0x00,0x48,0xd7,0x86,0x47,0x94,0xa0,0x1c,0x8b,0x8c,0x8d,0x92,
0x45,0x90,0x7e,0x56,0x93,0xef,0x1a,0x52,0x97,0xbc,0x99,0xb5,0x7d,0x72,0x9d,0x9c,
0xfb,0x24,0xa1,0xa2,0x07,0x46,0xa5,0x02,0x69,0xe6,0xa9,0xd3,0x30,0xba,0xd6,0x84,
0x63,0x13,0x1b,0xb2,0x1d,0xaf,0x36,0x8e,0xb7,0x53,0x05,0xbb,0x12,0x78,0x8f,0xbe,
0x71,0xbf,0xe4,0x1e,0x9e,0xa4,0xe5,0x2f,0x9b,0x31,0x67,0x4b,0xcb,0x43,0xc3,0xce,
0x44,0x3c,0x0f,0xd2,0xaa,0xd4,0xed,0xa7,0x7b,0x18,0xd0,0xda,0x0e,0x54,0xf1,0xde,
0xdf,0xa8,0x3f,0xe2,0x6d,0xcc,0xf8,0x70,0xe7,0x61,0xe9,0x85,0x65,0x2c,0x39,0xee,
0x60,0x81,0x89,0xc2,0xf3,0xf4,0xf5,0x8a,0x5c,0x5e,0xd9,0x4f,0x9f,0xb1,0xfd,0xfe,
};
unsigned char decode_c(unsigned char c)
{
int i;
for (i = 0; i < 256; i++) {
if (c == enctab[i]) return i;
}
printf("Internal bug: encode_c()\n");
exit(1);
return 0;
}
unsigned char encode_c(unsigned char c)
{
int i;
return enctab[c];
}
int main(int argc, char *argv[])
{
int i, decode;
int c;
FILE *inf, *outf;
char name[256];
if (argc < 3) {
printf("Decode file:\n\tencsh -d file.sh\nEncode file:\n\tencsh -c file.sh\n");
exit(1);
}
if (strcmp(argv[1], "-d")) decode = 1;
else decode = 0;
strcpy(name, argv[2]);
strcat(name, ".$$$$");
inf = fopen(argv[2], "rb");
outf = fopen(name, "wb");
while ((c = fgetc(inf)) >= 0) {
if (decode) c = decode_c(c);
else c = encode_c(c);
fputc(c, outf);
}
fclose(inf);
fclose(outf);
rename(name, argv[2]);
return 0;
}

View File

@ -1,36 +0,0 @@
DESCRIPTION = "Encrypted shellscript for the Zaurus ROM update"
DEPENDS = "encdec-updater-native"
LICENSE = "zaurus-updater"
PR = "r20"
PACKAGES = ""
PACKAGE_ARCH = "${MACHINE_ARCH}"
COMPATIBLE_MACHINE = '(poodle|c7x0|spitz|akita|tosa)'
SRC_URI = "file://updater.sh \
file://gnu-tar.gz"
S = "${WORKDIR}"
inherit deploy
do_configure() {
sed -i "s/ZAURUS_UPDATER_VERSION/${PR}/" "${S}/updater.sh"
}
do_compile() {
encdec-updater -e updater.sh
}
do_deploy() {
install -m 0755 updater.sh ${DEPLOYDIR}/updater.sh.${MACHINE}
case ${MACHINE} in
spitz )
install -m 0755 gnu-tar ${DEPLOYDIR}/gnu-tar
;;
*)
;;
esac
}
addtask deploy before do_populate_sysroot after do_compile

View File

@ -1,481 +0,0 @@
#!/bin/sh
#
# One updater.sh to rule them all
#
# 2006.10.24 Marcin 'Hrw' Juszkiewicz
# - started work on common updater.sh
# - works on poodle, c760, spitz
# - breaks on tosa
#
# 2007.10.08 Marcin 'Hrw' Juszkiewicz
# - do not allow to flash files bigger then partition size
# - created functions for common stuff
#
# 2007.11.18 Dmitry 'Lumag' Baryshkov
# - fixes
# - tosa unbreak
#
# 2007.11.19 Marcin 'Hrw' Juszkiewicz
# - size check unbreak
# - c760/c860 has bigger rootfs - use it
#
# 2007.11.23 Koen Kooi
# - consistent error messages
# - fix flashing from case sensitive filesystem (e.g. ext2)
#
# 2007.11.23 Matthias 'CoreDump' Hentges
# - Always treat MTD_PART_SIZE as HEX when comparing sizes
# - Thanks to ZeroChaos for debugging
#
# 2007.12.04 Matthias 'CoreDump' Hentges
# - Unb0rk flashing of Akita kernels
#
# 2007.12.10 Marcin 'Hrw' Juszkiewicz
# - Reformatted file - please use spaces not tabs
# - "version check" is only on Tosa and Poodle - breaks other machines
#
# 2007.12.23 Matthias 'CoreDump' Hentges
# - Fix kernel install on spitz machines
# - Unify format of do_flashing()...
# - Display ${PR} of zaurus-updater.bb to the user
# - Polish HDD installer messages
#
# 2007.12.25 Matthias 'CoreDump' Hentges
# -Add support for installing / updating u-boot
# Set to "yes" to enable
ENABLE_UBOOT_UPDATER="no"
DATAPATH=$1
TMPPATH=/tmp/update
TMPDATA=$TMPPATH/tmpdata.bin
TMPHEAD=$TMPPATH/tmphead.bin
FLASHED_KERNEL=0
FLASHED_ROOTFS=0
UNPACKED_ROOTFS=0 # spitz only
RO_MTD_LINE=`cat /proc/mtd | grep "root" | tail -n 1`
if [ "$RO_MTD_LINE" = "" ]; then
RO_MTD_LINE=`cat /proc/mtd | grep "\<NAND\>.*\<2\>" | tail -n 1`
fi
RO_MTD_NO=`echo $RO_MTD_LINE | cut -d: -f1 | cut -dd -f2`
RO_MTD=/dev/mtd$RO_MTD_NO
ROOTFS_SIZE=`echo $RO_MTD_LINE | cut -d" " -f2`
LOGOCAL_MTD=/dev/mtd1
VERBLOCK=0x48000
MVRBLOCK=0x70000
RESULT=0
Cleanup()
{
rm -f $VTMPNAME > /dev/null 2>&1
rm -f $MTMPNAME > /dev/null 2>&1
exit $1
}
trap 'Cleanup 1' 1 15
trap '' 2 3
get_dev_pcmcia()
{
while read SOCKET CLASS DRIVER INSTANCE DEVS MAJOR MINOR;
do
echo $DEVS
done
}
get_dev_pcmcia_slot()
{
grep "^$1" /var/lib/pcmcia/stab | get_dev_pcmcia
}
check_for_hdd()
{
IDE1=`get_dev_pcmcia_slot 1`
if [ "$IDE1" = "" ]; then
echo "Error: There is no microdrive. Retrying..."
while [ "$IDE1" = "" ]; do
IDE1=`get_dev_pcmcia_slot 1`
done
echo "Microdrive found."
fi
LINUXFMT=ext3
MKE2FSOPT=-j
}
check_for_tar()
{
### Check that we have a valid tar
for TARNAME in gnu-tar GNU-TAR
do
if [ -e $DATAPATH/$TARNAME ]
then
TARBIN=$DATAPATH/$TARNAME
fi
done
if [ ! -e $TARBIN ]; then
echo 'Error: Please place a valid copy of tar as "gnu-tar" on your card.'
echo 'Please reset'
while true
do
done
fi
}
do_rootfs_extraction()
{
UNPACKED_ROOTFS=1
echo 'Installing HDD root file system'
if [ ! -f /hdd1/NotAvailable ]; then
umount /hdd1
fi
echo -n '* Now formatting...'
mke2fs $MKE2FSOPT /dev/${IDE1}1 > /dev/null 2>&1
e2fsck -p /dev/${IDE1}1 > /dev/null
if [ "$?" != "0" ]; then
echo "FAILED"
echo "Error: Unable to create filesystem on microdrive!"
exit "$?"
else
echo "Done"
fi
mount -t $LINUXFMT -o noatime /dev/${IDE1}1 /hdd1
if [ "$?" != "0" ]; then
echo "Error: Unable to mount microdrive!"
exit "$?"
fi
cd /hdd1
echo -n '* Now extracting (this can take over 5m)...'
gzip -dc $DATAPATH/$TARGETFILE | $TARBIN xf -
if [ "$?" != "0" ]; then
echo "FAILED"
echo "Error: Unable to extract root filesystem archive!"
exit "$?"
else
echo "Done"
fi
echo 'HDD Installation Finished.'
# remount as RO
cd /
umount /hdd1
mount -t $LINUXFMT -o ro,noatime /dev/${IDE1}1 /hdd1
}
do_flashing()
{
if [ $DATASIZE -gt `printf "%d" $MTD_PART_SIZE` ]
then
echo "Error: File is too big to flash!"
echo "$FLASH_TYPE: [$DATASIZE] > [`printf "%d" ${MTD_PART_SIZE}`]"
return
fi
if [ "$ZAURUS" = "tosa" ] || [ "$ZAURUS" = "poodle" ]
then
#check version
/sbin/bcut -s 6 -o $TMPDATA $TMPHEAD
if [ `cat $TMPDATA` != "SHARP!" ] > /dev/null 2>&1
then
#no version info...
rm -f $TMPHEAD > /dev/null 2>&1
DATAPOS=0
fi
fi
if [ $ISFORMATTED = 0 ]
then
/sbin/eraseall $TARGET_MTD > /dev/null 2>&1
ISFORMATTED=1
fi
if [ -e $TMPHEAD ]
then
VTMPNAME=$TMPPATH'/vtmp'`date '+%s'`'.tmp'
MTMPNAME=$TMPPATH'/mtmp'`date '+%s'`'.tmp'
/sbin/nandlogical $LOGOCAL_MTD READ $VERBLOCK 0x4000 $VTMPNAME > /dev/null 2>&1
/sbin/nandlogical $LOGOCAL_MTD READ $MVRBLOCK 0x4000 $MTMPNAME > /dev/null 2>&1
/sbin/verchg -v $VTMPNAME $TMPHEAD $MODULEID $MTD_PART_SIZE > /dev/null 2>&1
/sbin/verchg -m $MTMPNAME $TMPHEAD $MODULEID $MTD_PART_SIZE > /dev/null 2>&1
fi
# Looks like Akita and Spitz are unique when it comes to kernel flashing
if [ "$ZAURUS" = "akita" -o "$ZAURUS" = "c3x00" ] && [ "$FLASH_TYPE" = "kernel" ]
then
# echo $TARGETFILE':'$DATASIZE'bytes'
echo ""
echo -n "Installing SL-Cxx00 kernel..."
echo ' ' > /tmp/data
test "$ZAURUS" = "akita" && /sbin/nandlogical $LOGOCAL_MTD WRITE 0x60100 16 /tmp/data > /dev/null 2>&1
/sbin/nandlogical $LOGOCAL_MTD WRITE 0xe0000 $DATASIZE $TARGETFILE > /dev/null 2>&1
test "$ZAURUS" = "akita" && /sbin/nandlogical $LOGOCAL_MTD WRITE 0x21bff0 16 /tmp/data > /dev/null 2>&1
echo "Done"
else
echo ''
echo '0% 100%'
PROGSTEP=`expr $DATASIZE / $ONESIZE + 1`
PROGSTEP=`expr 25 / $PROGSTEP`
if [ $PROGSTEP = 0 ]
then
PROGSTEP=1
fi
#loop
while [ $DATAPOS -lt $DATASIZE ]
do
#data create
bcut -a $DATAPOS -s $ONESIZE -o $TMPDATA $TARGETFILE
TMPSIZE=`wc -c $TMPDATA`
TMPSIZE=`echo $TMPSIZE | cut -d' ' -f1`
DATAPOS=`expr $DATAPOS + $TMPSIZE`
#handle data file
if [ $ISLOGICAL = 0 ]
then
next_addr=`/sbin/nandcp -a $ADDR $TMPDATA $TARGET_MTD 2>/dev/null | fgrep "mtd address" | cut -d- -f2 | cut -d\( -f1`
if [ "$next_addr" = "" ]; then
echo "Error: flash write"
rm $TMPDATA > /dev/null 2>&1
RESULT=3
break;
fi
ADDR=$next_addr
else
/sbin/nandlogical $LOGOCAL_MTD WRITE $ADDR $DATASIZE $TMPDATA > /dev/null 2>&1
ADDR=`expr $ADDR + $TMPSIZE`
fi
rm $TMPDATA > /dev/null 2>&1
#progress
SPNUM=0
while [ $SPNUM -lt $PROGSTEP ]
do
echo -n '.'
SPNUM=`expr $SPNUM + 1`
done
done
fi
echo ''
#finish
rm -f $TMPPATH/*.bin > /dev/null 2>&1
if [ $RESULT = 0 ]
then
if [ -e $VTMPNAME ]
then
/sbin/nandlogical $LOGOCAL_MTD WRITE $VERBLOCK 0x4000 $VTMPNAME > /dev/null 2>&1
rm -f $VTMPNAME > /dev/null 2>&1
fi
if [ -e $MTMPNAME ]
then
/sbin/nandlogical $LOGOCAL_MTD WRITE $MVRBLOCK 0x4000 $MTMPNAME > /dev/null 2>&1
rm -f $MTMPNAME > /dev/null 2>&1
fi
[ "$FLASH_TYPE" != "kernel" ] && echo 'Done.'
else
echo 'Error!'
fi
}
update_uboot() {
# The flashing part of this function is based on pdaXrom's
# updater.sh
if test "$ENABLE_UBOOT_UPDATER" != "yes" -o -z "$1"
then
echo "u-boot updates not allowed."
return
fi
echo ""
echo "Installing u-boot bootloader:"
DATASIZE=`wc -c $TARGETFILE`
FSIZE=`echo $DATASIZE | cut -d' ' -f1`
echo -n "* Creating backup ($FSIZE Bytes)..."
if ( nandlogical /dev/mtd1 READ 0 $FSIZE /tmp/sharploader.bin ) > /dev/null 2>&1
then
echo "Ok"
echo -n "* Flashing u-boot..."
if ( nandlogical /dev/mtd1 WRITE 0 $FSIZE $1 ) > /dev/null 2>&1
then
echo "Success"
else
echo "FAILED"
echo "ERROR: Installation of u-boot failed!"
echo -n "* Trying to restore backup..."
if ( nandlogical /dev/mtd1 WRITE 0 $FSIZE /tmp/sharploader.bin ) > /dev/null 2>&1
then
echo "Success"
echo "Your old bootloader has been restored"
else
echo "FAILED"
echo "Sorry, it's NAND-Restore time for you =("
fi
fi
else
echo "FAILED"
echo "Could not create backup, aborting!"
echo "Your bootloader has not been altered in any way."
exit 1
fi
}
### Check model ###
/sbin/writerominfo
MODEL=`cat /proc/deviceinfo/product`
case "$MODEL" in
SL-B500|SL-5600)
ZAURUS='poodle'
;;
SL-6000)
ZAURUS='tosa'
;;
SL-C1000)
ZAURUS='akita'
;;
SL-C700|SL-C750|SL-7500|SL-C760|SL-C860)
ZAURUS='c7x0'
;;
SL-C3000|SL-C3100|SL-C3200)
ZAURUS='c3x00'
check_for_hdd
check_for_tar
;;
*)
echo 'MODEL: '$MODEL 'is unsupported'
echo ''
echo 'Please reset'
while true
do
done
;;
esac
clear
echo "---- Universal Zaurus Updater ZAURUS_UPDATER_VERSION ----"
echo 'MODEL: '$MODEL' ('$ZAURUS')'
mkdir -p $TMPPATH > /dev/null 2>&1
cd $DATAPATH/
for TARGETFILE in u-boot.bin U-BOOT.BIN zimage zImage zImage.bin zimage.bin ZIMAGE ZIMAGE.BIN initrd.bin INITRD.BIN hdimage1.tgz HDIMAGE1.TGZ
do
if [ ! -e $TARGETFILE ]
then
continue
fi
rm -f $TMPPATH/*.bin > /dev/null 2>&1
DATASIZE=`wc -c $TARGETFILE`
DATASIZE=`echo $DATASIZE | cut -d' ' -f1`
# make TARGETFILE lowercase
TARGETFILE_LC=`echo $TARGETFILE|tr A-Z a-z`
case "$TARGETFILE_LC" in
zimage|zimage.bin)
if [ $FLASHED_KERNEL != 0 ]
then
continue
fi
FLASHED_KERNEL=1
ISLOGICAL=1
MODULEID=5
MTD_PART_SIZE=0x13C000
ADDR=`dc 0xE0000`
ISFORMATTED=1
DATAPOS=0
ONESIZE=524288
HDTOP=`expr $DATASIZE - 16`
/sbin/bcut -a $HDTOP -s 16 -o $TMPHEAD $TARGETFILE
FLASH_TYPE="kernel"
do_flashing
FLASH_TYPE=""
;;
initrd.bin)
if [ $FLASHED_ROOTFS != 0 ]
then
continue
fi
echo 'root file system'
FLASHED_ROOTFS=1
ISLOGICAL=0
MODULEID=6
MTD_PART_SIZE="0x$ROOTFS_SIZE"
ADDR=0
ISFORMATTED=0
TARGET_MTD=$RO_MTD
DATAPOS=16
ONESIZE=1048576
/sbin/bcut -s 16 -o $TMPHEAD $TARGETFILE
FLASH_TYPE="rootfs"
do_flashing
FLASH_TYPE=""
;;
hdimage1.tgz)
if [ $UNPACKED_ROOTFS = 0 ]
then
do_rootfs_extraction
fi
;;
u-boot.bin)
if [ FLASHED_UBOOT != 1 ]
then
update_uboot "$TARGETFILE"
FLASHED_UBOOT="1"
fi
;;
*)
;;
esac
done
# reboot
exit 0
# bcut usage: bcut [OPTION] <input file>
# -a: start position
# -s: cut size
# -o: output file
# ModuleId informations used by verchg Sharp binary:
#
# 0 - master
# 1 - Maintaince
# 2 - Diagnostics
# 3 - rescue kernel
# 4 - rescue rootfs
# 5 - normal kernel
# 6 - normal rootfs
# 7 - /home/
# 8 - parameter (whatever it means)
#

View File

@ -1,16 +0,0 @@
Fix compilation of the sumversion "script"
http://bugs.gentoo.org/show_bug.cgi?format=multiple&id=226169
Index: linux-2.6.21/scripts/mod/sumversion.c
===================================================================
--- linux-2.6.21.orig/scripts/mod/sumversion.c 2007-04-26 04:08:32.000000000 +0100
+++ linux-2.6.21/scripts/mod/sumversion.c 2010-05-13 14:41:31.777882280 +0100
@@ -7,6 +7,7 @@
#include <ctype.h>
#include <errno.h>
#include <string.h>
+#include <limits.h>
#include "modpost.h"
/*

View File

@ -1,36 +0,0 @@
From 1a91088e389bd3bbf5d9ee1f3a15edd9edb84eb6 Mon Sep 17 00:00:00 2001
From: Enric Balletbo i Serra <eballetbo@iseebcn.com>
Date: Wed, 16 Jun 2010 17:41:26 +0200
Subject: [PATCH] omap3: init MUX for OMAP3 IGEP module.
Signed-off-by: Enric Balletbo i Serra <eballetbo@iseebcn.com>
---
arch/arm/mach-omap2/board-igep0030.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/board-igep0030.c b/arch/arm/mach-omap2/board-igep0030.c
index aa99236..425b2ec 100644
--- a/arch/arm/mach-omap2/board-igep0030.c
+++ b/arch/arm/mach-omap2/board-igep0030.c
@@ -420,8 +420,18 @@ static void __init igep3_init_wifi_bt(void)
pr_warning("IGEP: Could not obtain gpio GPIO_BT_NRESET\n");
}
+#ifdef CONFIG_OMAP_MUX
+static struct omap_board_mux board_mux[] __initdata = {
+ { .reg_offset = OMAP_MUX_TERMINATOR },
+};
+#else
+#define board_mux NULL
+#endif
+
static void __init igep3_init(void)
{
+ omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
+
omap_serial_init();
usb_musb_init(&musb_board_data);
usb_ehci_init(&ehci_pdata);
--
1.7.0.4

View File

@ -1,31 +0,0 @@
DESCRIPTION = "2.6 Linux Kernel for IGEP based platforms"
SECTION = "kernel"
LICENSE = "GPL"
LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7 "
DEFAULT_PREFERENCE = "-1"
DEFAULT_PREFERENCE_igep0020 = "1"
DEFAULT_PREFERENCE_igep0030 = "1"
COMPATIBLE_MACHINE = "(igep0020|igep0030)"
inherit kernel
KV = "${PV}-0"
SRC_URI = "http://downloads.igep.es/sources/linux-omap-${KV}.tar.gz \
file://0001-omap3-init-MUX-for-OMAP3-IGEP-module.patch;patch=1 \
file://defconfig-igep0020 \
file://defconfig-igep0030"
do_configure() {
rm -f ${S}/.config || true
cp ${WORKDIR}/defconfig-${MACHINE} ${S}/.config
yes '' | oe_runmake oldconfig
}
S = "${WORKDIR}/linux-omap-${KV}"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,42 +0,0 @@
---
arch/arm/boot/compressed/Makefile | 4 ++++
arch/arm/boot/compressed/head-mx3.S | 17 +++++++++++++++++
2 files changed, 21 insertions(+)
Index: linux-2.6.19.2/arch/arm/boot/compressed/Makefile
===================================================================
--- linux-2.6.19.2.orig/arch/arm/boot/compressed/Makefile 2007-01-10 20:10:37.000000000 +0100
+++ linux-2.6.19.2/arch/arm/boot/compressed/Makefile 2007-10-02 15:46:13.000000000 +0200
@@ -50,6 +50,10 @@
OBJS += head-at91rm9200.o
endif
+ifeq ($(CONFIG_ARCH_MX3),y)
+OBJS += head-mx3.o
+endif
+
ifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
ifeq ($(CONFIG_CPU_CP15),y)
OBJS += big-endian.o
Index: linux-2.6.19.2/arch/arm/boot/compressed/head-mx3.S
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6.19.2/arch/arm/boot/compressed/head-mx3.S 2007-10-02 16:00:13.000000000 +0200
@@ -0,0 +1,17 @@
+/*
+ * linux/arch/arm/boot/compressed/head-mx3.S
+ *
+ * MX3 specific hacks. This is merged into head.S by the linker.
+ *
+ */
+
+#include <linux/linkage.h>
+#include <asm/mach-types.h>
+
+ .section ".start", "ax"
+
+__MX3_start:
+#ifdef CONFIG_MACH_MX31LITE
+ mov r7, #(MACH_TYPE_MX31LITE & 0xff)
+ orr r7, r7, #(MACH_TYPE_MX31LITE & 0xff00)
+#endif

View File

@ -1,85 +0,0 @@
---
arch/arm/mach-mx3/mx31lite.c | 26 ++++++++++++++++++++++++++
drivers/video/mxc/mxcfb_modedb.c | 25 +++++++++++++++++++++++++
2 files changed, 51 insertions(+)
Index: linux-2.6.19.2/arch/arm/mach-mx3/mx31lite.c
===================================================================
--- linux-2.6.19.2.orig/arch/arm/mach-mx3/mx31lite.c 2007-10-03 19:37:43.000000000 +0200
+++ linux-2.6.19.2/arch/arm/mach-mx3/mx31lite.c 2007-10-03 19:43:09.000000000 +0200
@@ -280,6 +280,31 @@
}
#endif
+#if defined(CONFIG_FB_MXC_SYNC_PANEL) || defined(CONFIG_FB_MXC_SYNC_PANEL_MODULE)
+static const char fb_default_mode[] = "Sharpsix-VGA";
+
+/* mxc lcd driver */
+static struct platform_device mxc_fb_device = {
+ .name = "mxc_sdc_fb",
+ .id = 0,
+ .dev = {
+ .release = mxc_nop_release,
+ .platform_data = &fb_default_mode,
+ .coherent_dma_mask = 0xFFFFFFFF,
+ },
+};
+
+static void mxc_init_fb(void)
+{
+ (void)platform_device_register(&mxc_fb_device);
+}
+#else
+static inline void mxc_init_fb(void)
+{
+}
+#endif
+
+
/*!
* Board specific fixup function. It is called by \b setup_arch() in
* setup.c file very early on during kernel starts. It allows the user to
@@ -400,6 +425,7 @@
mxc_init_nor_mtd();
mxc_init_nand_mtd();
mxc_init_eth();
+ mxc_init_fb();
}
/*
Index: linux-2.6.19.2/drivers/video/mxc/mxcfb_modedb.c
===================================================================
--- linux-2.6.19.2.orig/drivers/video/mxc/mxcfb_modedb.c 2007-10-03 19:37:43.000000000 +0200
+++ linux-2.6.19.2/drivers/video/mxc/mxcfb_modedb.c 2007-10-03 19:43:02.000000000 +0200
@@ -55,6 +55,31 @@
"TV-VGA", 60, 640, 480, 40574, 35, 45, 9, 1, 46, 5,
0, FB_VMODE_NONINTERLACED, 0,
},
+ [5] = {
+ /* 640x480 @ 60 Hz, 6" */
+ "Sharpsix-VGA",
+ 60, 640, 480, // 60 Hz, 640x480
+ 35285, // 36.66 ns clock period
+ 128, 128, // left & right margin
+ 34, 10, // upper & lower margin
+ 2, 2, // hsync & vsync len
+ FB_SYNC_OE_ACT_HIGH,
+ FB_VMODE_NONINTERLACED,
+ 0,
+ },
+ [6] = {
+ /* 640x480 @ 60 Hz 10" */
+ "Sharpten-VGA",
+ 60, 640, 480, // 60 Hz, 640x480
+ 35285, // 35.285b ns clock period
+ 128, 128, // left & right margin
+ 34, 10, // upper & lower margin
+ 2, 2, // hsync & vsync len
+ FB_SYNC_OE_ACT_HIGH,
+ FB_VMODE_NONINTERLACED,
+ 0,
+ },
+
};
int mxcfb_modedb_sz = ARRAY_SIZE(mxcfb_modedb);

View File

@ -1,42 +0,0 @@
---
arch/arm/mach-mx3/mx31lite.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
Index: linux-2.6.19.2/arch/arm/mach-mx3/mx31lite.c
===================================================================
--- linux-2.6.19.2.orig/arch/arm/mach-mx3/mx31lite.c 2007-10-03 20:12:16.000000000 +0200
+++ linux-2.6.19.2/arch/arm/mach-mx3/mx31lite.c 2007-10-03 20:14:14.000000000 +0200
@@ -29,6 +29,7 @@
#include <linux/mtd/mtd.h>
#include <linux/mtd/map.h>
#include <linux/mtd/partitions.h>
+#include <linux/spi/spi.h>
#include <asm/mach/flash.h>
#endif
@@ -304,6 +305,16 @@
}
#endif
+static struct spi_board_info mxc_spi_board_info[] __initdata = {
+ {
+ .modalias = "pmic_spi",
+ .irq = IOMUX_TO_IRQ(MX31_PIN_GPIO1_3),
+ .max_speed_hz = 4000000,
+ .bus_num = 2,
+ .chip_select = 0,
+ },
+};
+
/*!
* Board specific fixup function. It is called by \b setup_arch() in
@@ -426,6 +437,8 @@
mxc_init_nand_mtd();
mxc_init_eth();
mxc_init_fb();
+ spi_register_board_info(mxc_spi_board_info,
+ ARRAY_SIZE(mxc_spi_board_info));
}
/*

View File

@ -1,13 +0,0 @@
Index: linux-2.6.19.2/drivers/mtd/chips/cfi_cmdset_0001.c
===================================================================
--- linux-2.6.19.2.orig/drivers/mtd/chips/cfi_cmdset_0001.c 2008-01-10 11:06:29.000000000 +0000
+++ linux-2.6.19.2/drivers/mtd/chips/cfi_cmdset_0001.c 2008-01-10 11:06:58.000000000 +0000
@@ -263,7 +263,7 @@
return NULL;
if (extp->MajorVersion != '1' ||
- (extp->MinorVersion < '0' || extp->MinorVersion > '4')) {
+ (extp->MinorVersion < '0' || extp->MinorVersion > '5')) {
printk(KERN_ERR " Unknown Intel/Sharp Extended Query "
"version %c.%c.\n", extp->MajorVersion,
extp->MinorVersion);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,38 +0,0 @@
SECTION = "kernel"
DESCRIPTION = "Linux kernel for imx31 devices"
LICENSE = "GPL"
KERNEL_OUTPUT = "arch/${ARCH}/boot/${KERNEL_IMAGETYPE}"
inherit kernel deploy
COMPATIBLE_MACHINE = "mx31litekit|mx31ads|mx31phy"
do_configure_prepend() {
rm -f ${S}/.config || true
if [ "${TARGET_OS}" = "linux-gnueabi" -o "${TARGET_OS}" = "linux-uclibcgnueabi" ]; then
echo "CONFIG_AEABI=y" >> ${S}/.config
echo "CONFIG_OABI_COMPAT=y" >> ${S}/.config
else
echo "# CONFIG_AEABI is not set" >> ${S}/.config
echo "# CONFIG_OABI_COMPAT is not set" >> ${S}/.config
fi
sed -e '/CONFIG_AEABI/d' \
-e '/CONFIG_OABI_COMPAT=/d' \
'${WORKDIR}/defconfig-${MACHINE}' >>'${S}/.config'
yes '' | oe_runmake oldconfig
}
do_deploy() {
install -m 0644 arch/${ARCH}/boot/${KERNEL_IMAGETYPE} ${DEPLOYDIR}/${KERNEL_IMAGETYPE}-${PV}-${MACHINE}-${DATETIME}.bin
cd ${DEPLOYDIR}
ln -sf ${KERNEL_IMAGETYPE}-${PV}-${MACHINE}-${DATETIME}.bin ${KERNEL_IMAGETYPE}-${MACHINE}.bin
tar -cvzf ${DEPLOYDIR}/modules-${KERNEL_RELEASE}-${MACHINE}.tgz -C ${D} lib
}
addtask deploy before do_populate_sysroot after do_install

View File

@ -1,227 +0,0 @@
require linux-mx31.inc
PR = "r8"
FILESDIR = "${WORKDIR}"
SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-2.6.19.2.tar.bz2 \
file://sumversion-fix.patch;patch=1 \
file://defconfig-mx31litekit \
file://defconfig-mx31ads \
file://defconfig-mx31phy \
"
SRC_URI_append_mx31litekit = " \
file://linux-2.6.19.2-mx3lite.patch.gz \
file://linux-2.6.19.2-mx3lite.patch;patch=1 \
file://mx31lite-boot.patch;patch=1 \
file://mx31lite-fb.patch;patch=1 \
file://mx31lite-spi.patch;patch=1 \
"
SRC_URI_append_mx31ads = " \
file://mx31ads-patches.tgz \
file://linux-2.6.19.2-mx-arch_arm.patch;patch=1 \
file://linux-2.6.19.2-mx-arm_oprofile.patch;patch=1 \
file://linux-2.6.19.2-mx-codetest.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_char.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_i2c.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_ide.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_input.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_media.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_mmc.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_mtd.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_mxc-2.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_net-2.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_pcmcia.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_serial.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_spi.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_usb.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_video-2.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_w1-2.patch;patch=1 \
file://linux-2.6.19.2-mx-include_mxc.patch;patch=1 \
file://linux-2.6.19.2-mx-mach_mx27-2.patch;patch=1 \
file://linux-2.6.19.2-mx-mach_mx31.patch;patch=1 \
file://linux-2.6.19.2-mx-plat_mxc.patch;patch=1 \
file://linux-2.6.19.2-mx-sound-2.patch;patch=1 \
file://linux-2.6.19.2-mx-irttp_reserve.patch;patch=1 \
file://linux-2.6.19.2-mx-porting-3.patch;patch=1 \
file://linux-2.6.19.2-mx-fsl_logos.patch;patch=1 \
file://linux-2.6.19.2-mx-remove_kfi.patch;patch=1 \
file://linux-2.6.19.2-mx-touchscreen_fix.patch;patch=1 \
file://linux-2.6.19.2-mx-xip_boot_with_nor.patch;patch=1 \
file://linux-2.6.19.2-mx-xip_with_nand.patch;patch=1 \
file://linux-2.6.19.2-mx-alsa_playback_ata_corruption.patch;patch=1 \
file://linux-2.6.19.2-mx-sdma_channel_priority.patch;patch=1 \
file://linux-2.6.19.2-mx-dpm.patch;patch=1 \
file://linux-2.6.19.2-mx-voice_codec_noise.patch;patch=1 \
file://linux-2.6.19.2-mx-mx27_hrt.patch;patch=1 \
file://linux-2.6.19.2-mx-ata_clk_fix.patch;patch=1 \
file://linux-2.6.19.2-mx-ts_suspend_fix.patch;patch=1 \
file://linux-2.6.19.2-mx-i2c_stop_fix.patch;patch=1 \
file://linux-2.6.19.2-mx-mc521da_camera.patch;patch=1 \
file://linux-2.6.19.2-mx-ipu_pm_sleep.patch;patch=1 \
file://linux-2.6.19.2-mx-warns_fix.patch;patch=1 \
file://linux-2.6.19.2-mx-vpu_buf_list.patch;patch=1 \
file://linux-2.6.19.2-mx-wdt_kconfig_fix.patch;patch=1 \
file://linux-2.6.19.2-mx-arm926_dcache_writethrough_flush_fix.patch;patch=1;pnum=0 \
file://linux-2.6.19.2-mx-ide_dma_fix.patch;patch=1 \
file://linux-2.6.19.2-mx-focus453_reset_fix.patch;patch=1 \
file://linux-2.6.19.2-mx-irda_mode_fix.patch;patch=1 \
file://linux-2.6.19.2-mx-watchdog_fix.patch;patch=1 \
file://linux-2.6.19.2-mx-fec_loadable_module.patch;patch=1 \
file://linux-2.6.19.2-mx-fb_loadable_module.patch;patch=1 \
file://linux-2.6.19.2-mx-mx27_warns_fix.patch;patch=1 \
file://linux-2.6.19.2-mx-add_rc_checking_on_copy_to_user.patch;patch=1 \
file://linux-2.6.19.2-mx-fix_nand_two-read_stats_cmd.patch;patch=1 \
file://linux-2.6.19.2-mx-fix_convity_multiple_open_mode.patch;patch=1 \
file://linux-2.6.19.2-mx-csi_dma_si_capture.patch;patch=1 \
file://linux-2.6.19.2-mx-new_mx27_dptc_table.patch;patch=1 \
file://linux-2.6.19.2-mx-8250_dropped_tx_chars-2.patch;patch=1 \
file://linux-2.6.19.2-mx-video_rotate_mirror.patch;patch=1 \
file://linux-2.6.19.2-mx-fix_audio_sequencing.patch;patch=1 \
file://linux-2.6.19.2-mx-rid_offset_asm_macros.patch;patch=1 \
file://linux-2.6.19.2-mx-remove_mxc_err_chk.patch;patch=1 \
file://linux-2.6.19.2-mx-v4l2_to_right_framebuffer.patch;patch=1 \
file://linux-2.6.19.2-mx-v4l2_tearing_fix.patch;patch=1 \
file://linux-2.6.19.2-mx-initialize_initdata_fix.patch;patch=1 \
file://linux-2.6.19.2-mx-fix_mx27_printks.patch;patch=1 \
file://linux-2.6.19.2-mx-fix_disconnect_event_with_pin_detect.patch;patch=1 \
file://linux-2.6.19.2-mx-fix_fec_dcache_range_args.patch;patch=1 \
file://linux-2.6.19.2-mx-i2c_plat_cleanup.patch;patch=1 \
file://linux-2.6.19.2-mx-fix_mono_output.patch;patch=1 \
file://linux-2.6.19.2-mx-add_12k_playback_support.patch;patch=1 \
file://linux-2.6.19.2-mx-fix_irqreturn_t_arguments.patch;patch=1 \
file://linux-2.6.19.2-mx-remove_erroneous_semicolons.patch;patch=1 \
file://linux-2.6.19.2-mx-port_ctswic_h.patch;patch=1 \
file://linux-2.6.19.2-mx-use_std_clk_api.patch;patch=1 \
file://linux-2.6.19.2-mx-mx31_4_step_dvfs_support.patch;patch=1 \
file://linux-2.6.19.2-mx-remove_mx31_wfi_workaround.patch;patch=1 \
file://linux-2.6.19.2-mx-fix_sdma_events_table.patch;patch=1 \
file://linux-2.6.19.2-mx-fix_vpu_debugging_printks.patch;patch=1 \
file://linux-2.6.19.2-mx-fix_vpu_dma_free_coherent.patch;patch=1 \
file://linux-2.6.19.2-mx-mxcuart_shutdown_cleanup.patch;patch=1 \
file://linux-2.6.19.2-mx-1wire_search_rom_accel.patch;patch=1 \
file://linux-2.6.19.2-mx-ss08_sdma_script_update.patch;patch=1 \
file://linux-2.6.19.2-mx-workaround_for_sdma_chn10_access.patch;patch=1 \
file://linux-2.6.19.2-mx-add_1wire_platform_data.patch;patch=1 \
file://linux-2.6.19.2-mx-fix_serial_core_dumping_mctl_status.patch;patch=1 \
file://linux-2.6.19.2-mx-mx31_vga_mpeg4_support-2.patch;patch=1 \
file://linux-2.6.19.2-mx-change_mmc_prescaler_calc.patch;patch=1 \
file://linux-2.6.19.2-mx-mc521da_camera_fix.patch;patch=1 \
file://linux-2.6.19.2-mx-fix_mx31_sr_mode_after_csi.patch;patch=1 \
file://linux-2.6.19.2-mx-mx31_sr_mode_broken_after_dma_access.patch;patch=1 \
file://linux-2.6.19.2-mx-unify_light_ioctl.patch;patch=1 \
file://linux-2.6.19.2-mx-use_wtg_srs_for_arch_reset.patch;patch=1 \
file://linux-2.6.19.2-mx-wfi_workaround.patch;patch=1 \
file://linux-2.6.19.2-mx-fix_mx27_gpio_sensor.patch;patch=1 \
file://linux-2.6.19.2-mx-audio_support_changes.patch;patch=1 \
file://linux-2.6.19.2-mx-add_rngc_support.patch;patch=1 \
file://linux-2.6.19.2-mx-mxc_ir_indent_fix.patch;patch=1 \
file://linux-2.6.19.2-mx-v4l_loopback_demo_fix.patch;patch=1 \
file://linux-2.6.19.2-mx-fix_security_debug_printks.patch;patch=1 \
file://linux-2.6.19.2-mx-update_copyrights-2.patch;patch=1 \
file://linux-2.6.19.2-mx-fix_rng_doxygen_warnings.patch;patch=1 \
file://linux-2.6.19.2-mx-remove_fir_tx_sdma_workaround.patch;patch=1 \
file://linux-2.6.19.2-mx-mxc_debug_leds.patch;patch=1 \
file://linux-2.6.19.2-mx-add_gpio_function_camera_resume.patch;patch=1 \
file://linux-2.6.19.2-mx-mxc_pf_prevent_multiple_opens.patch;patch=1 \
file://linux-2.6.19.2-mx-turn_off_unused_clocks_on_boot.patch;patch=1 \
file://linux-2.6.19.2-mx-fix_mx27_vpu_clock_enable_disable.patch;patch=1 \
file://linux-2.6.19.2-mx-usb_clk_off_on_ulpi.patch;patch=1 \
file://linux-2.6.19.2-mx-sdma_ipcv2.patch;patch=1 \
file://linux-2.6.19.2-mx-fix_csi_clk_calc_for_mx31.patch;patch=1 \
file://linux-2.6.19.2-mx-fix_gadget_dtd_allocation.patch;patch=1 \
file://linux-2.6.19.2-mx-fix_wfi_workaround.patch;patch=1 \
file://linux-2.6.19.2-mx-isp1301_i2c.patch;patch=1 \
file://linux-2.6.19.2-mx-mx31_enable_iim_clock.patch;patch=1 \
file://linux-2.6.19.2-mx-add_1wire_enable_disable.patch;patch=1 \
file://linux-2.6.19.2-mx-add_rng_clock_enable_disable.patch;patch=1 \
file://linux-2.6.19.2-mx-remove_wfi_workaround.patch;patch=1 \
file://linux-2.6.19.2-mx-fix_mx2fb_clock_for_tv_out.patch;patch=1 \
file://linux-2.6.19.2-mx-fix_hacc_clocking.patch;patch=1 \
file://linux-2.6.19.2-mx-1wire_boot_delay.patch;patch=1 \
file://linux-2.6.19.2-mx-fix_mxc_gettimeoffset_div0.patch;patch=1 \
file://linux-2.6.19.2-mx-fix_generation_of_csi_mclk.patch;patch=1 \
file://linux-2.6.19.2-mx-fix_rs232_cea936_handler_issue.patch;patch=1 \
file://linux-2.6.19.2-mx-fix_usb_invalid_printks.patch;patch=1 \
file://linux-2.6.19.2-mx-enable_mbx_clock_at_boot.patch;patch=1 \
file://linux-2.6.19.2-mx-clocking_update_pcmcia.patch;patch=1 \
file://linux-2.6.19.2-mx-combine_mx27_mx31_usb_headers-2.patch;patch=1 \
file://linux-2.6.19.2-mx-unified_doxygen.patch;patch=1 \
file://linux-2.6.19.2-mx-L2618-2_scrub.patch;patch=1 \
file://linux-2.6.19.2-mx-add_kern_info_to_printks-2.patch;patch=1 \
file://linux-2.6.19.2-mx-generic_clk_porting.patch;patch=1 \
file://linux-2.6.19.2-mx-code_review_fixes_following_L2618.2-4.patch;patch=1 \
file://linux-2.6.19.2-mx-yaffs2_filesystem.patch;patch=1;pnum=0 \
file://linux-2.6.19.2-mx-yaffs2_define_min_fix.patch;patch=1;pnum=0 \
file://linux-2.6.19.2-mx-add_mt9v111_camera_detection.patch;patch=1;pnum=0 \
file://linux-2.6.19.2-mx-fix_i2c_adapter_name.patch;patch=1;pnum=0 \
file://linux-2.6.19.2-mx-mx31_enable_2nd_mmc_slot.patch;patch=1 \
file://linux-2.6.19.2-mx-dvfs_compile_fixes.patch;patch=1 \
file://linux-2.6.19.2-mx-mmc_sdhc.patch;patch=1 \
file://linux-2.6.19.2-mx-spi_inactive.patch;patch=1 \
file://linux-2.6.19.2-mx-reserve_mx3_uart2_for_fir.patch;patch=1 \
file://linux-2.6.19.2-mx31_TO2_reg_swizzle_workaround.patch;patch=1 \
file://linux-2.6.19.2-mx31_suspend_resumes_on_eth_activity.patch;patch=1 \
"
SRC_URI_append_mx31phy = " \
file://mx31phy-patches.tgz \
file://linux-2.6.19.2-mx-arch_arm.patch;patch=1 \
file://linux-2.6.19.2-mx-arm_oprofile.patch;patch=1 \
file://linux-2.6.19.2-mx-codetest.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_char.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_i2c.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_ide.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_input.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_media.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_mmc.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_mtd.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_mxc.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_net.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_pcmcia.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_serial.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_spi.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_usb.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_video.patch;patch=1 \
file://linux-2.6.19.2-mx-drivers_w1.patch;patch=1 \
file://linux-2.6.19.2-mx-include_mxc.patch;patch=1 \
file://linux-2.6.19.2-mx-mach_mx27.patch;patch=1 \
file://linux-2.6.19.2-mx-mach_mx31.patch;patch=1 \
file://linux-2.6.19.2-mx-plat_mxc.patch;patch=1 \
file://linux-2.6.19.2-mx-sound.patch;patch=1 \
file://linux-2.6.19.2-mx-irttp_reserve.patch;patch=1 \
file://linux-2.6.19.2-mx-porting.patch;patch=1 \
file://linux-2.6.19.2-mx-fsl_logos.patch;patch=1 \
file://linux-2.6.19.2-mx-remove_kfi.patch;patch=1 \
file://linux-2.6.19.2-mx-touchscreen_fix.patch;patch=1 \
file://linux-2.6.19.2-mx-xip_boot_with_nor.patch;patch=1 \
file://linux-2.6.19.2-mx-xip_with_nand.patch;patch=1 \
file://linux-2.6.19.2-mx-alsa_playback_ata_corruption.patch;patch=1 \
file://linux-2.6.19.2-mx-sdma_channel_priority.patch;patch=1 \
file://linux-2.6.19.2-mx-dpm.patch;patch=1 \
file://linux-2.6.19.2-mx-voice_codec_noise.patch;patch=1 \
file://linux-2.6.19.2-mx-mx27_hrt.patch;patch=1 \
file://linux-2.6.19.2-mx-ata_clk_fix.patch;patch=1 \
file://linux-2.6.19.2-mx-ts_suspend_fix.patch;patch=1 \
file://linux-2.6.19.2-mx-i2c_stop_fix.patch;patch=1 \
file://linux-2.6.19.2-mx-mc521da_camera.patch;patch=1 \
file://linux-2.6.19.2-mx-ipu_pm_sleep.patch;patch=1 \
file://linux-2.6.19.2-mx-warns_fix.patch;patch=1 \
file://linux-2.6.19.2-can_base.diff;patch=1 \
file://linux-2.6.19.2-drivers_can_loopback.diff;patch=1 \
file://linux-2.6.19.2-drivers_can_ccan.diff;patch=1 \
file://linux-2.6.19.2-drivers_can_sja.diff;patch=1 \
file://linux-2.6.19.2-drivers_can_nios.diff;patch=1 \
file://linux-2.6.19.2-pcm037can.patch;patch=1 \
file://linux-2.6.19.2-smsc-lan921x.patch;patch=1 \
file://linux-2.6.19.2-phyCORE-i.MX31.patch;patch=1 \
file://linux-2.6.19.2-bootlogo.patch;patch=1 \
file://linux-2.6.19.2-mt9v111_bus_fix.patch;patch=1 \
file://linux-2.6.19.2-i2c_fix.patch;patch=1 \
file://linux-2.6.19.2-clock_fix.patch;patch=1 \
file://intel_cfi_version_1.5.patch;patch=1 \
"
S = "${WORKDIR}/linux-2.6.19.2"

View File

@ -1,299 +0,0 @@
require linux-mx31.inc
PR = "r5"
FILESDIR = "${WORKDIR}"
SRC_URI = " \
${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-2.6.22.6.tar.bz2 \
file://1300-fix-gcc-4.3-false-modulo-optimization.patch.patch;patch=1 \
file://defconfig-mx31ads \
file://defconfig-mx31phy \
"
COMPATIBLE_MACHINE = "(mx31ads|mx31phy)"
SRC_URI_append_mx31ads = " \
file://mx31ads-patches.tgz \
file://linux-2.6.22-mx-arch_arm.patch;patch=1 \
file://linux-2.6.22-mx-arm_oprofile.patch;patch=1 \
file://linux-2.6.22-mx-codetest.patch;patch=1 \
file://linux-2.6.22-mx-drivers_char.patch;patch=1 \
file://linux-2.6.22-mx-drivers_i2c.patch;patch=1 \
file://linux-2.6.22-mx-drivers_ide.patch;patch=1 \
file://linux-2.6.22-mx-drivers_input.patch;patch=1 \
file://linux-2.6.22-mx-drivers_media.patch;patch=1 \
file://linux-2.6.22-mx-drivers_mmc.patch;patch=1 \
file://linux-2.6.22-mx-drivers_mtd.patch;patch=1 \
file://linux-2.6.22-mx-drivers_mxc.patch;patch=1 \
file://linux-2.6.22-mx-drivers_mxc_pmic.patch;patch=1 \
file://linux-2.6.22-mx-drivers_mxc_security.patch;patch=1 \
file://linux-2.6.22-mx-drivers_net.patch;patch=1 \
file://linux-2.6.22-mx-drivers_pcmcia.patch;patch=1 \
file://linux-2.6.22-mx-drivers_rtc.patch;patch=1 \
file://linux-2.6.22-mx-drivers_serial.patch;patch=1 \
file://linux-2.6.22-mx-drivers_spi.patch;patch=1 \
file://linux-2.6.22-mx-drivers_usb.patch;patch=1 \
file://linux-2.6.22-mx-drivers_video.patch;patch=1 \
file://linux-2.6.22-mx-drivers_w1.patch;patch=1 \
file://linux-2.6.22-mx-include_mxc.patch;patch=1 \
file://linux-2.6.22-mx-mach_mx27.patch;patch=1 \
file://linux-2.6.22-mx-mach_mx3.patch;patch=1 \
file://linux-2.6.22-mx-plat_mxc.patch;patch=1 \
file://linux-2.6.22-mx-sound.patch;patch=1 \
file://linux-2.6.22-mx-Additional-porting-changes-as-a-result-of-.patch;patch=1 \
file://linux-2.6.22-mx-Add-MX27-MX31-and-MX32-splash-screens-to-2.patch;patch=1 \
file://linux-2.6.22-mx-Add-OV2640-camera-support.patch;patch=1 \
file://linux-2.6.22-mx-Sony-s-implementation-of-__mxc_ioremap-por.patch;patch=1 \
file://linux-2.6.22-mx-USB-disable-autosuspend.patch;patch=1 \
file://linux-2.6.22-mx-USB-port-to-2.6.22.patch;patch=1 \
file://linux-2.6.22-mx-USB-fix-OTGSC_IE_1ms_TIMER-bit-definition.patch;patch=1 \
file://linux-2.6.22-mx-USB-Miscellaneous-cleanup-porting.patch;patch=1 \
file://linux-2.6.22-mx-Fix-new-line-problems-on-printk-statements.patch;patch=1 \
file://linux-2.6.22-mx-Add-generic-clksource-and-clkevent-support.patch;patch=1 \
file://linux-2.6.22-mx-Bug-fix-of-Bugzilla-217-to-ensure-I2C-stop.patch;patch=1 \
file://linux-2.6.22-mx-Bug-fix-for-when-processor-enters-state-re.patch;patch=1 \
file://linux-2.6.22-mx-ARM926-MX27-D-cache-writethrough-bug-fix.patch;patch=1 \
file://linux-2.6.22-mx-Patch-to-fix-dma-errors-when-accessing-IDE.patch;patch=1 \
file://linux-2.6.22-mx-Patch-to-properly-reset-the-Focus-453-chip.patch;patch=1 \
file://linux-2.6.22-mx-Patch-to-fix-irda-mode-bug.patch;patch=1 \
file://linux-2.6.22-mx-Patch-to-enable-mxc-framebuffer-driver-to-.patch;patch=1 \
file://linux-2.6.22-mx-Add-interrogation-of-V4L2-or-Linux-udev-to.patch;patch=1 \
file://linux-2.6.22-mx-CR-SDCaa01608-I2C-uses-wrong-adapter-name.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-422-Enable-second-MMC-SD-slot-for.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-43-Fix-FIR-on-MX31.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-562-Suspend-resumes-on-eth-activi.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00037631-Add-handling-of-prp-overfl.patch;patch=1 \
file://linux-2.6.22-mx-CR-34440439-Under-heavy-load-v4l2-ioctls-s.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR37631-Adds-correct-signal-handling-.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00033520-Add-a-new-algorithm-to-the.patch;patch=1 \
file://linux-2.6.22-mx-CR-34439732-Camera-and-V4L2-improvements.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00038129-Add-vpu-latency-hiding-con.patch;patch=1 \
file://linux-2.6.22-mx-Fixed-coding-errors-in-the-mxc-v4l2-output.patch;patch=1 \
file://linux-2.6.22-mx-Make-the-latency-hiding-option-mx27-specif.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-630.-Allow-rng-registers-to-be-re.patch;patch=1 \
file://linux-2.6.22-mx-Add-yaffs2-filesystem.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-511-Redefine-the-min-macro-define.patch;patch=1 \
file://linux-2.6.22-mx-Port-MXC-FIR-driver-forward-to-2.6.22.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-627.-Prevent-DPM-from-calling-DVF.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00047179-fix-disable-console-on-mxc.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00043063-platform-device-for-scc-ad.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00049086-fix-scc-fail-fuse-not-blow.patch;patch=1 \
file://linux-2.6.22-mx-Backport-to-2.6.22.6-of-MMC-SD-SDIO-update.patch;patch=1 \
file://linux-2.6.22-mx-Community-MMC-SD-SDIO-support-from-Pierre-.patch;patch=1 \
file://linux-2.6.22-mx-Prototype-FSL-PATA-LIBATA-driver.patch;patch=1 \
file://linux-2.6.22-mx-Workaround-for-IAPI-sleep-issue-spin-in-ia.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-533-Fix-multi-times-message-and-p.patch;patch=1 \
file://linux-2.6.22-mx-Work-around-compile-breakage-for-mx27-on-o.patch;patch=1 \
file://linux-2.6.22-mx-Bug-fix-of-Bugzilla-363-to-enable-ATA-subs.patch;patch=1 \
file://linux-2.6.22-mx-Update-drivers-such-as-dpm-dvfs-ide-and-si.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-510-Update-to-code-review-fixes-f.patch;patch=1 \
file://linux-2.6.22-mx-MXC-MMC-Remove-custom-error-codes.patch;patch=1 \
file://linux-2.6.22-mx-ioremap-control-reaches-end-of-non-void-fu.patch;patch=1 \
file://linux-2.6.22-mx-USB-check-return-codes-from-gpio_request_m.patch;patch=1 \
file://linux-2.6.22-mx-USB-check-the-return-value-of-clk_enable-u.patch;patch=1 \
file://linux-2.6.22-mx-USB-cleanup-Kconfig-options.patch;patch=1 \
file://linux-2.6.22-mx-USB-cleanup-Kconfig-options2.patch;patch=1 \
file://linux-2.6.22-mx-USB-More-descriptive-device-registration-m.patch;patch=1 \
file://linux-2.6.22-mx-USB-More-descriptive-device-registration-2.patch;patch=1 \
file://linux-2.6.22-mx-Fixed-a-problem-where-time-ran-too-slow-by.patch;patch=1 \
file://linux-2.6.22-mx-USB-Even-more-descriptive-device-registrat.patch;patch=1 \
file://linux-2.6.22-mx-USB-Even-more-descriptive-device-registra2.patch;patch=1 \
file://linux-2.6.22-mx-USB-Remove-extra-call-to-gpio_usbotg_hs_ac.patch;patch=1 \
file://linux-2.6.22-mx-USB-Restore-mainline-core-Kconfig-contents.patch;patch=1 \
file://linux-2.6.22-mx-USB-Part-of-the-descriptive-registration-m.patch;patch=1 \
file://linux-2.6.22-mx-USB-cleanup-Kconfig-options-some-more.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-771-PATA_FSL-Remove-non-working-D.patch;patch=1 \
file://linux-2.6.22-mx-CR-DSPhl24421-Add-power-handlers-to-libata.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-766-PATA_FSL-probe-not-called-whe.patch;patch=1 \
file://linux-2.6.22-mx-Fix-l2x0-cache-invalidate-handling-of-unal.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-776-FS-001-XIP-from-cramfs-Commun.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-771-Fix-pata_fsl-libata-driver-DM.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00046932-Sahara-build-warnings-are-.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00048159-Add-L2-flush-for-all-mxc-P.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00011205-Move-linux-includes-before.patch;patch=1 \
file://linux-2.6.22-mx-USB-USBCV-1.3-HaltEndpointTest-fails.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00050502-add-custom-ioremap.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00049720-mxc_pf-add-frame_size-limi.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00047074-Fix-FIR-functionality-brea.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00039921-v4l2-support-L1-writeback-.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00048608-Work-around-untrustworthy-.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00048068-mxc-add-clocksource-and-cl.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00013463-IPU-wait-for-SDC-flips-to-.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00048072-oprofile-updates-to-suppor.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00047020-MX27TO2-MMC-card-removal-s.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-779-Fix-OV2460-camera-driver-oops.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-784-Fixed-MMC-SD-error-110.patch;patch=1 \
file://linux-2.6.22-mx-Remove-vestigial-printk.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00043959-Merging-mxc-nand-driver-ac.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00052514-refresh-of-ENGR0045732-to-.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00050116-Fix-flawed-implementation-.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00052743-Reset-CSPI-On-MX27.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00052918-fec-2.6.22-workqueue-chang.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00053136-fix-mx27-v4l2-rotation-cac.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00053173-Fix-SDMA-Mask-Value-In-Sus.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-802-Fix-MX3-DVFS-DPTC-table-initi.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-803-Fix-Suspend-to-RAM.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00053192-MXC-Sahara2-Use-CONFIG_OUT.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00053563-Fix-Sahara-Issue-For-MX27.patch;patch=1 \
"
SRC_URI_append_mx31phy = " \
file://mx31phy-patches.tgz \
file://linux-2.6.22-mx-arch_arm.patch;patch=1 \
file://linux-2.6.22-mx-arm_oprofile.patch;patch=1 \
file://linux-2.6.22-mx-codetest.patch;patch=1 \
file://linux-2.6.22-mx-drivers_char.patch;patch=1 \
file://linux-2.6.22-mx-drivers_i2c.patch;patch=1 \
file://linux-2.6.22-mx-drivers_ide.patch;patch=1 \
file://linux-2.6.22-mx-drivers_input.patch;patch=1 \
file://linux-2.6.22-mx-drivers_media.patch;patch=1 \
file://linux-2.6.22-mx-drivers_mmc.patch;patch=1 \
file://linux-2.6.22-mx-drivers_mtd.patch;patch=1 \
file://linux-2.6.22-mx-drivers_mxc.patch;patch=1 \
file://linux-2.6.22-mx-drivers_mxc_pmic.patch;patch=1 \
file://linux-2.6.22-mx-drivers_mxc_security.patch;patch=1 \
file://linux-2.6.22-mx-drivers_net.patch;patch=1 \
file://linux-2.6.22-mx-drivers_pcmcia.patch;patch=1 \
file://linux-2.6.22-mx-drivers_rtc.patch;patch=1 \
file://linux-2.6.22-mx-drivers_serial.patch;patch=1 \
file://linux-2.6.22-mx-drivers_spi.patch;patch=1 \
file://linux-2.6.22-mx-drivers_usb.patch;patch=1 \
file://linux-2.6.22-mx-drivers_video.patch;patch=1 \
file://linux-2.6.22-mx-drivers_w1.patch;patch=1 \
file://linux-2.6.22-mx-include_mxc.patch;patch=1 \
file://linux-2.6.22-mx-mach_mx27.patch;patch=1 \
file://linux-2.6.22-mx-mach_mx3.patch;patch=1 \
file://linux-2.6.22-mx-plat_mxc.patch;patch=1 \
file://linux-2.6.22-mx-sound.patch;patch=1 \
file://linux-2.6.22-mx-Additional-porting-changes-as-a-result-of-.patch;patch=1 \
file://linux-2.6.22-mx-Add-MX27-MX31-and-MX32-splash-screens-to-2.patch;patch=1 \
file://linux-2.6.22-mx-Add-OV2640-camera-support.patch;patch=1 \
file://linux-2.6.22-mx-Sony-s-implementation-of-__mxc_ioremap-por.patch;patch=1 \
file://linux-2.6.22-mx-USB-disable-autosuspend.patch;patch=1 \
file://linux-2.6.22-mx-USB-port-to-2.6.22.patch;patch=1 \
file://linux-2.6.22-mx-USB-fix-OTGSC_IE_1ms_TIMER-bit-definition.patch;patch=1 \
file://linux-2.6.22-mx-USB-Miscellaneous-cleanup-porting.patch;patch=1 \
file://linux-2.6.22-mx-Fix-new-line-problems-on-printk-statements.patch;patch=1 \
file://linux-2.6.22-mx-Add-generic-clksource-and-clkevent-support.patch;patch=1 \
file://linux-2.6.22-mx-Bug-fix-of-Bugzilla-217-to-ensure-I2C-stop.patch;patch=1 \
file://linux-2.6.22-mx-Bug-fix-for-when-processor-enters-state-re.patch;patch=1 \
file://linux-2.6.22-mx-ARM926-MX27-D-cache-writethrough-bug-fix.patch;patch=1 \
file://linux-2.6.22-mx-Patch-to-fix-dma-errors-when-accessing-IDE.patch;patch=1 \
file://linux-2.6.22-mx-Patch-to-properly-reset-the-Focus-453-chip.patch;patch=1 \
file://linux-2.6.22-mx-Patch-to-fix-irda-mode-bug.patch;patch=1 \
file://linux-2.6.22-mx-Patch-to-enable-mxc-framebuffer-driver-to-.patch;patch=1 \
file://linux-2.6.22-mx-Add-interrogation-of-V4L2-or-Linux-udev-to.patch;patch=1 \
file://linux-2.6.22-mx-CR-SDCaa01608-I2C-uses-wrong-adapter-name.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-422-Enable-second-MMC-SD-slot-for.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-43-Fix-FIR-on-MX31.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-562-Suspend-resumes-on-eth-activi.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00037631-Add-handling-of-prp-overfl.patch;patch=1 \
file://linux-2.6.22-mx-CR-34440439-Under-heavy-load-v4l2-ioctls-s.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR37631-Adds-correct-signal-handling-.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00033520-Add-a-new-algorithm-to-the.patch;patch=1 \
file://linux-2.6.22-mx-CR-34439732-Camera-and-V4L2-improvements.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00038129-Add-vpu-latency-hiding-con.patch;patch=1 \
file://linux-2.6.22-mx-Fixed-coding-errors-in-the-mxc-v4l2-output.patch;patch=1 \
file://linux-2.6.22-mx-Make-the-latency-hiding-option-mx27-specif.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-630.-Allow-rng-registers-to-be-re.patch;patch=1 \
file://linux-2.6.22-mx-Add-yaffs2-filesystem.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-511-Redefine-the-min-macro-define.patch;patch=1 \
file://linux-2.6.22-mx-Port-MXC-FIR-driver-forward-to-2.6.22.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-627.-Prevent-DPM-from-calling-DVF.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00047179-fix-disable-console-on-mxc.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00043063-platform-device-for-scc-ad.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00049086-fix-scc-fail-fuse-not-blow.patch;patch=1 \
file://linux-2.6.22-mx-Backport-to-2.6.22.6-of-MMC-SD-SDIO-update.patch;patch=1 \
file://linux-2.6.22-mx-Community-MMC-SD-SDIO-support-from-Pierre-.patch;patch=1 \
file://linux-2.6.22-mx-Prototype-FSL-PATA-LIBATA-driver.patch;patch=1 \
file://linux-2.6.22-mx-Workaround-for-IAPI-sleep-issue-spin-in-ia.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-533-Fix-multi-times-message-and-p.patch;patch=1 \
file://linux-2.6.22-mx-Work-around-compile-breakage-for-mx27-on-o.patch;patch=1 \
file://linux-2.6.22-mx-Bug-fix-of-Bugzilla-363-to-enable-ATA-subs.patch;patch=1 \
file://linux-2.6.22-mx-Update-drivers-such-as-dpm-dvfs-ide-and-si.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-510-Update-to-code-review-fixes-f.patch;patch=1 \
file://linux-2.6.22-mx-MXC-MMC-Remove-custom-error-codes.patch;patch=1 \
file://linux-2.6.22-mx-ioremap-control-reaches-end-of-non-void-fu.patch;patch=1 \
file://linux-2.6.22-mx-USB-check-return-codes-from-gpio_request_m.patch;patch=1 \
file://linux-2.6.22-mx-USB-check-the-return-value-of-clk_enable-u.patch;patch=1 \
file://linux-2.6.22-mx-USB-cleanup-Kconfig-options.patch;patch=1 \
file://linux-2.6.22-mx-USB-cleanup-Kconfig-options2.patch;patch=1 \
file://linux-2.6.22-mx-USB-More-descriptive-device-registration-m.patch;patch=1 \
file://linux-2.6.22-mx-USB-More-descriptive-device-registration-2.patch;patch=1 \
file://linux-2.6.22-mx-Fixed-a-problem-where-time-ran-too-slow-by.patch;patch=1 \
file://linux-2.6.22-mx-USB-Even-more-descriptive-device-registrat.patch;patch=1 \
file://linux-2.6.22-mx-USB-Even-more-descriptive-device-registra2.patch;patch=1 \
file://linux-2.6.22-mx-USB-Remove-extra-call-to-gpio_usbotg_hs_ac.patch;patch=1 \
file://linux-2.6.22-mx-USB-Restore-mainline-core-Kconfig-contents.patch;patch=1 \
file://linux-2.6.22-mx-USB-Part-of-the-descriptive-registration-m.patch;patch=1 \
file://linux-2.6.22-mx-USB-cleanup-Kconfig-options-some-more.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-771-PATA_FSL-Remove-non-working-D.patch;patch=1 \
file://linux-2.6.22-mx-CR-DSPhl24421-Add-power-handlers-to-libata.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-766-PATA_FSL-probe-not-called-whe.patch;patch=1 \
file://linux-2.6.22-mx-Fix-l2x0-cache-invalidate-handling-of-unal.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-776-FS-001-XIP-from-cramfs-Commun.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-771-Fix-pata_fsl-libata-driver-DM.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00046932-Sahara-build-warnings-are-.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00048159-Add-L2-flush-for-all-mxc-P.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00011205-Move-linux-includes-before.patch;patch=1 \
file://linux-2.6.22-mx-USB-USBCV-1.3-HaltEndpointTest-fails.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00050502-add-custom-ioremap.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00049720-mxc_pf-add-frame_size-limi.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00047074-Fix-FIR-functionality-brea.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00039921-v4l2-support-L1-writeback-.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00048608-Work-around-untrustworthy-.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00048068-mxc-add-clocksource-and-cl.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00013463-IPU-wait-for-SDC-flips-to-.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00048072-oprofile-updates-to-suppor.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00047020-MX27TO2-MMC-card-removal-s.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-779-Fix-OV2460-camera-driver-oops.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-784-Fixed-MMC-SD-error-110.patch;patch=1 \
file://linux-2.6.22-mx-Remove-vestigial-printk.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00043959-Merging-mxc-nand-driver-ac.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00052514-refresh-of-ENGR0045732-to-.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00050116-Fix-flawed-implementation-.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00052743-Reset-CSPI-On-MX27.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00052918-fec-2.6.22-workqueue-chang.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00053136-fix-mx27-v4l2-rotation-cac.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00053173-Fix-SDMA-Mask-Value-In-Sus.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-802-Fix-MX3-DVFS-DPTC-table-initi.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-803-Fix-Suspend-to-RAM.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00053192-MXC-Sahara2-Use-CONFIG_OUT.patch;patch=1 \
file://linux-2.6.22-mx-CR-ENGR00053563-Fix-Sahara-Issue-For-MX27.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-804-Fix-Suspend-Resume-to-mem.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-677.-Allow-FEC-MAC-address-overri.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-605.-Fix-tearing-when-VPU-rotates.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-833-MXC-Camera-flicker-control-io.patch;patch=1 \
file://linux-2.6.22-mx-Fix-Bugzilla-621-V4L2_CID_AUTO_WHITE_BALAN.patch;patch=1 \
file://linux-2.6.22-mx-CR-34813488-Bugzilla-647-Add-MX31-like-cro.patch;patch=1 \
file://linux-2.6.22-mx-CR-35009507-Support-V4L2-USERPTR-in-output.patch;patch=1 \
file://linux-2.6.22-mx-Fix-Bugzilla-857-2K-NAND-support-bug.patch;patch=1 \
file://linux-2.6.22-mx-CR-34813488-Bugzilla-647-MX31-like-crop-ca.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-1005-Increase-MXC_DMA_ZONE_SIZE-b.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-678-Add-gain-limitation-support-t.patch;patch=1 \
file://linux-2.6.22-mx-Fix-Bugzilla-1088-DVFS-DPM-is-broken.patch;patch=1 \
file://linux-2.6.22-mx-Fix-Bugzilla-1069-Resume-fails-if-key-held.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-1088-Remove-DVFS-DPTC-kernel-conf.patch;patch=1 \
file://linux-2.6.22-mx-Fix-Bugzilla-1083-Disabled-DVFS-says-DVFS.patch;patch=1 \
file://linux-2.6.22-mx-Fix-Bugzilla-1086-framebuffer-bad-after-su.patch;patch=1 \
file://linux-2.6.22-mx-Bugzilla-1088-Fix-freq-changes-via-DPM.patch;patch=1 \
file://phytec_linux-2.6.19.2-bootlogo.patch;patch=1 \
file://phytec_linux-2.6.19.2-can_base.diff;patch=1 \
file://phytec_linux-2.6.19.2-drivers_can_loopback.diff;patch=1 \
file://phytec_linux-2.6.19.2-drivers_can_ccan.diff;patch=1 \
file://phytec_linux-2.6.19.2-drivers_can_sja.diff;patch=1 \
file://phytec_linux-2.6.19.2-drivers_can_nios.diff;patch=1 \
file://phytec_linux-2.6.19.2-pcm037can.patch;patch=1 \
file://phytec_linux-2.6.19.2-smsc-lan921x.patch;patch=1 \
file://phytec_linux-2.6.19.2-phyCORE-i.MX31.patch;patch=1 \
file://phytec_linux-2.6.19.2-pcm037_defconfig;patch=1 \
file://phytec_linux-2.6.19.2-no_blank_lcd.patch;patch=1 \
file://phytec_linux-2.6.22-intel-cfi-version-1.5.patch;patch=1 \
file://phytec_linux-2.6.22_dptc_bug.patch;patch=1 \
file://phytec_linux-2.6.22-i2c_hwmon_class.patch;patch=1 \
file://drivers_i2c_device_st24cxx.diff;patch=1;pnum=0 \
file://debug_logo.patch;patch=1 \
file://debug_mxc_init_time;patch=1 \
file://phytec_linux-2.6.22-mmc-clock.patch;patch=1 \
file://phytec_linux-2.6.22.6-USBH2-ulpi-reset.patch;patch=1 \
"
S = "${WORKDIR}/linux-2.6.22.6"

View File

@ -1,147 +0,0 @@
From 8642463d981c93d188814b11fdc81e17719aab05 Mon Sep 17 00:00:00 2001
From: Yong Wang <yong.y.wang@intel.com>
Date: Fri, 5 Feb 2010 10:07:51 +0800
Subject: [PATCH] kbuild: add a "nonintconfig" option to the Makefile
Add a "nonintconfig" option to the Makefile needed for
unattended builds.
This patch is from Arjan ven de Ven <arjan@linux.intel.com>
Signed-off-by: Yong Wang <yong.y.wang@intel.com>
---
scripts/kconfig/Makefile | 5 +++++
scripts/kconfig/conf.c | 36 ++++++++++++++++++++++++++++++++----
2 files changed, 37 insertions(+), 4 deletions(-)
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 999e8a7..fb3cdee 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -30,6 +30,11 @@ silentoldconfig: $(obj)/conf
$(Q)mkdir -p include/generated
$< -s $(Kconfig)
+nonint_oldconfig: $(obj)/conf
+ $< -b $(Kconfig)
+loose_nonint_oldconfig: $(obj)/conf
+ $< -B $(Kconfig)
+
localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
$(Q)perl $< $(srctree) $(Kconfig) > .tmp.config
$(Q)if [ -f .config ]; then \
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 9960d1c..bf6a528 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -23,6 +23,8 @@ enum {
ask_all,
ask_new,
ask_silent,
+ dont_ask,
+ dont_ask_dont_tell,
set_default,
set_yes,
set_mod,
@@ -38,6 +40,8 @@ static int conf_cnt;
static char line[128];
static struct menu *rootEntry;
+static int return_value = 0;
+
static void print_help(struct menu *menu)
{
struct gstr help = str_new();
@@ -360,7 +364,10 @@ static void conf(struct menu *menu)
switch (prop->type) {
case P_MENU:
- if (input_mode == ask_silent && rootEntry != menu) {
+ if ((input_mode == ask_silent ||
+ input_mode == dont_ask ||
+ input_mode == dont_ask_dont_tell) &&
+ rootEntry != menu) {
check_conf(menu);
return;
}
@@ -418,12 +425,21 @@ static void check_conf(struct menu *menu)
if (sym && !sym_has_value(sym)) {
if (sym_is_changable(sym) ||
(sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) {
+ if (input_mode == dont_ask ||
+ input_mode == dont_ask_dont_tell) {
+ if (input_mode == dont_ask &&
+ sym->name && !sym_is_choice_value(sym)) {
+ fprintf(stderr,"CONFIG_%s\n",sym->name);
+ ++return_value;
+ }
+ } else {
if (!conf_cnt++)
printf(_("*\n* Restart config...\n*\n"));
rootEntry = menu_get_parent_menu(menu);
conf(rootEntry);
}
}
+ }
for (child = menu->list; child; child = child->next)
check_conf(child);
@@ -439,7 +455,7 @@ int main(int ac, char **av)
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
- while ((opt = getopt(ac, av, "osdD:nmyrh")) != -1) {
+ while ((opt = getopt(ac, av, "osbBdD:nmyrh")) != -1) {
switch (opt) {
case 'o':
input_mode = ask_silent;
@@ -448,6 +464,12 @@ int main(int ac, char **av)
input_mode = ask_silent;
sync_kconfig = 1;
break;
+ case 'b':
+ input_mode = dont_ask;
+ break;
+ case 'B':
+ input_mode = dont_ask_dont_tell;
+ break;
case 'd':
input_mode = set_default;
break;
@@ -525,6 +547,8 @@ int main(int ac, char **av)
case ask_silent:
case ask_all:
case ask_new:
+ case dont_ask:
+ case dont_ask_dont_tell:
conf_read(NULL);
break;
case set_no:
@@ -586,12 +610,16 @@ int main(int ac, char **av)
conf(&rootmenu);
input_mode = ask_silent;
/* fall through */
+ case dont_ask:
+ case dont_ask_dont_tell:
case ask_silent:
/* Update until a loop caused no more changes */
do {
conf_cnt = 0;
check_conf(&rootmenu);
- } while (conf_cnt);
+ } while (conf_cnt &&
+ (input_mode != dont_ask &&
+ input_mode != dont_ask_dont_tell));
break;
}
@@ -613,5 +641,5 @@ int main(int ac, char **av)
exit(1);
}
}
- return 0;
+ return return_value;
}
--
1.5.5.1

View File

@ -1,60 +0,0 @@
commit 0f592e33934bf6108e33e34f00b425f98ee833ef
Author: Matthew Garrett <mjg@redhat.com>
Date: Wed Jul 8 19:04:23 2009 +0100
usb: Allow drivers to enable USB autosuspend on a per-device basis
USB autosuspend is currently only enabled by default for hubs. On other
hardware the decision is made by userspace. This is unnecessary in cases
where we know that the hardware supports autosuspend, so this patch adds
a function to allow drivers to enable it at probe time.
Signed-off-by: Matthew Garrett <mjg@redhat.com>
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index 60a45f1..06d24df 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -1648,6 +1648,20 @@ void usb_autopm_put_interface_async(struct usb_interface *intf)
EXPORT_SYMBOL_GPL(usb_autopm_put_interface_async);
/**
+ * usb_device_autosuspend_enable - enable autosuspend on a device
+ * @udev: the usb_device to be autosuspended
+ *
+ * This routine should be called by an interface driver when it knows that
+ * the device in question supports USB autosuspend.
+ *
+ */
+void usb_device_autosuspend_enable(struct usb_device *udev)
+{
+ udev->autosuspend_disabled = 0;
+}
+EXPORT_SYMBOL_GPL(usb_device_autosuspend_enable);
+
+/**
* usb_autopm_get_interface - increment a USB interface's PM-usage counter
* @intf: the usb_interface whose counter should be incremented
*
diff --git a/include/linux/usb.h b/include/linux/usb.h
index e101a2d..dd47590 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -540,6 +540,7 @@ extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id);
/* USB autosuspend and autoresume */
#ifdef CONFIG_USB_SUSPEND
+extern void usb_device_autosuspend_enable(struct usb_device *udev);
extern int usb_autopm_get_interface(struct usb_interface *intf);
extern void usb_autopm_put_interface(struct usb_interface *intf);
extern int usb_autopm_get_interface_async(struct usb_interface *intf);
@@ -563,6 +564,9 @@ static inline void usb_mark_last_busy(struct usb_device *udev)
#else
+static inline void usb_device_autosuspend_enable(struct usb_device *udev)
+{ }
+
static inline int usb_autopm_get_interface(struct usb_interface *intf)
{ return 0; }
static inline int usb_autopm_get_interface_async(struct usb_interface *intf)

View File

@ -1,11 +0,0 @@
--- linux-2.6.33/drivers/bluetooth/btusb.c~ 2010-02-24 13:52:17.000000000 -0500
+++ linux-2.6.33/drivers/bluetooth/btusb.c 2010-03-23 14:36:48.301179380 -0400
@@ -1020,6 +1020,8 @@
return err;
}
+ usb_device_autosuspend_enable(data->udev);
+
usb_set_intfdata(intf, data);
return 0;

View File

@ -1,19 +0,0 @@
commit 9d4c919bcfa794c054cc33155c7e3c53ac2c5684
Author: Matthew Garrett <mjg@redhat.com>
Date: Sun Jul 19 02:24:49 2009 +0100
Enable autosuspend on UVC by default
diff --git a/drivers/media/video/uvc/uvc_driver.c b/drivers/media/video/uvc/uvc_driver.c
index 89927b7..8de516b 100644
--- a/drivers/media/video/uvc/uvc_driver.c
+++ b/drivers/media/video/uvc/uvc_driver.c
@@ -1647,6 +1647,8 @@ static int uvc_probe(struct usb_interface *intf,
"supported.\n", ret);
}
+ usb_device_autosuspend_enable(udev);
+
uvc_trace(UVC_TRACE_PROBE, "UVC device initialized.\n");
return 0;

View File

@ -1,47 +0,0 @@
From dce8113d033975f56630cf6d2a6a908cfb66059d Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <arjan@linux.intel.com>
Date: Sun, 20 Jul 2008 13:12:16 -0700
Subject: [PATCH] fastboot: remove "wait for all devices before mounting root" delay
In the non-initrd case, we wait for all devices to finish their
probing before we try to mount the rootfs.
In practice, this means that we end up waiting 2 extra seconds for
the PS/2 mouse probing even though the root holding device has been
ready since a long time.
The previous two patches in this series made the RAID autodetect code
do it's own "wait for probing to be done" code, and added
"wait and retry" functionality in case the root device isn't actually
available.
These two changes should make it safe to remove the delay itself,
and this patch does this. On my test laptop, this reduces the boot time
by 2 seconds (kernel time goes from 3.9 to 1.9 seconds).
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
---
---
init/do_mounts.c | 3 +++
1 file changed, 3 insertions(+)
Index: linux-2.6.29/init/do_mounts.c
===================================================================
--- linux-2.6.29.orig/init/do_mounts.c
+++ linux-2.6.29/init/do_mounts.c
@@ -370,6 +370,7 @@ void __init prepare_namespace(void)
ssleep(root_delay);
}
+#if 0
/*
* wait for the known devices to complete their probing
*
@@ -378,6 +379,8 @@ void __init prepare_namespace(void)
* for the touchpad of a laptop to initialize.
*/
wait_for_device_probe();
+#endif
+ async_synchronize_full();
md_run_setup();

View File

@ -1,50 +0,0 @@
From 5872557a54f440d8cf046714508898b173885399 Mon Sep 17 00:00:00 2001
From: Yong Wang <yong.y.wang@intel.com>
Date: Fri, 5 Feb 2010 11:19:36 +0800
Subject: [PATCH] linux-2.6.29-kms-after-sata.patch
This patch is from Arjan ven de Ven <arjan@linux.intel.com>
Signed-off-by: Yong Wang <yong.y.wang@intel.com>
---
drivers/Makefile | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/Makefile b/drivers/Makefile
index 6ee53c7..5dc6dd3 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -26,15 +26,8 @@ obj-$(CONFIG_REGULATOR) += regulator/
# default.
obj-y += char/
-# gpu/ comes after char for AGP vs DRM startup
-obj-y += gpu/
-
obj-$(CONFIG_CONNECTOR) += connector/
-# i810fb and intelfb depend on char/agp/
-obj-$(CONFIG_FB_I810) += video/i810/
-obj-$(CONFIG_FB_INTEL) += video/intelfb/
-
obj-y += serial/
obj-$(CONFIG_PARPORT) += parport/
obj-y += base/ block/ misc/ mfd/
@@ -46,6 +39,14 @@ obj-$(CONFIG_ATA) += ata/
obj-$(CONFIG_MTD) += mtd/
obj-$(CONFIG_SPI) += spi/
obj-y += net/
+
+# gpu/ comes after char for AGP vs DRM startup
+obj-y += gpu/
+
+# i810fb and intelfb depend on char/agp/
+obj-$(CONFIG_FB_I810) += video/i810/
+obj-$(CONFIG_FB_INTEL) += video/intelfb/
+
obj-$(CONFIG_ATM) += atm/
obj-$(CONFIG_FUSION) += message/
obj-$(CONFIG_FIREWIRE) += firewire/
--
1.5.5.1

View File

@ -1,58 +0,0 @@
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index a51573d..3dcf5cc 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -102,6 +102,7 @@ struct intel_output {
int type;
struct i2c_adapter *i2c_bus;
struct i2c_adapter *ddc_bus;
+ struct edid *edid;
bool load_detect_temp;
bool needs_tv_clock;
void *dev_priv;
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 3118ce2..fa0299e 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -716,6 +716,7 @@ static void intel_lvds_destroy(struct drm_connector *connector)
acpi_lid_notifier_unregister(&dev_priv->lid_notifier);
drm_sysfs_connector_remove(connector);
drm_connector_cleanup(connector);
+ kfree(intel_output->edid);
kfree(connector);
}
@@ -1189,5 +1190,6 @@ failed:
intel_i2c_destroy(intel_output->ddc_bus);
drm_connector_cleanup(connector);
drm_encoder_cleanup(encoder);
+ kfree(intel_output->edid);
kfree(intel_output);
}
diff --git a/drivers/gpu/drm/i915/intel_modes.c b/drivers/gpu/drm/i915/intel_modes.c
index 67e2f46..5ac537f 100644
--- a/drivers/gpu/drm/i915/intel_modes.c
+++ b/drivers/gpu/drm/i915/intel_modes.c
@@ -74,6 +74,10 @@ int intel_ddc_get_modes(struct intel_output *intel_output)
int ret = 0;
intel_i2c_quirk_set(intel_output->base.dev, true);
+ if (intel_output->edid && intel_output->type == INTEL_OUTPUT_LVDS) {
+ printk(KERN_INFO "Skipping EDID probe due to cached edid\n");
+ return ret;
+ }
edid = drm_get_edid(&intel_output->base, intel_output->ddc_bus);
intel_i2c_quirk_set(intel_output->base.dev, false);
if (edid) {
@@ -81,7 +85,10 @@ int intel_ddc_get_modes(struct intel_output *intel_output)
edid);
ret = drm_add_edid_modes(&intel_output->base, edid);
intel_output->base.display_info.raw_edid = NULL;
- kfree(edid);
+ if (intel_output->type == INTEL_OUTPUT_LVDS)
+ intel_output->edid = edid;
+ else
+ kfree(edid);
}
return ret;

View File

@ -1,137 +0,0 @@
From 5da92dfa0047f40221e96162c768cd12e063fa0c Mon Sep 17 00:00:00 2001
From: Yong Wang <yong.y.wang@intel.com>
Date: Fri, 5 Feb 2010 10:22:01 +0800
Subject: [PATCH] linux-2.6.29-kms-run-async.patch
This patch is from Arjan ven de Ven <arjan@linux.intel.com>
Signed-off-by: Yong Wang <yong.y.wang@intel.com>
---
drivers/gpu/drm/drm_crtc_helper.c | 22 ++++++++++++++++++++--
drivers/gpu/drm/drm_drv.c | 4 ++++
drivers/gpu/drm/i915/i915_dma.c | 2 +-
include/drm/drmP.h | 1 +
include/drm/drm_crtc_helper.h | 1 +
5 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index 7d0f00a..1f814b4 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -29,6 +29,8 @@
* Jesse Barnes <jesse.barnes@intel.com>
*/
+#include <linux/async.h>
+
#include "drmP.h"
#include "drm_crtc.h"
#include "drm_crtc_helper.h"
@@ -54,6 +56,8 @@ static void drm_mode_validate_flag(struct drm_connector *connector,
return;
}
+LIST_HEAD(drm_async_list);
+
/**
* drm_helper_probe_connector_modes - get complete set of display modes
* @dev: DRM device
@@ -1002,6 +1006,7 @@ bool drm_helper_plugged_event(struct drm_device *dev)
/* FIXME: send hotplug event */
return true;
}
+
/**
* drm_initial_config - setup a sane initial connector configuration
* @dev: DRM device
@@ -1037,13 +1042,26 @@ bool drm_helper_initial_config(struct drm_device *dev)
drm_setup_crtcs(dev);
- /* alert the driver fb layer */
dev->mode_config.funcs->fb_changed(dev);
-
return 0;
}
EXPORT_SYMBOL(drm_helper_initial_config);
+static void drm_helper_initial_config_helper(void *ptr, async_cookie_t cookie)
+{
+ struct drm_device *dev = ptr;
+ drm_helper_initial_config(dev);
+}
+
+void drm_helper_initial_config_async(struct drm_device *dev)
+{
+ async_schedule_domain(drm_helper_initial_config_helper,
+ dev, &drm_async_list);
+}
+EXPORT_SYMBOL(drm_helper_initial_config_async);
+
+
+
static int drm_helper_choose_encoder_dpms(struct drm_encoder *encoder)
{
int dpms = DRM_MODE_DPMS_OFF;
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 766c468..1a0bf76 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -49,6 +49,7 @@
#include <linux/debugfs.h>
#include "drmP.h"
#include "drm_core.h"
+#include <linux/async.h>
static int drm_version(struct drm_device *dev, void *data,
@@ -292,6 +293,9 @@ void drm_exit(struct drm_driver *driver)
struct drm_device *dev, *tmp;
DRM_DEBUG("\n");
+ /* make sure all async DRM operations are finished */
+ async_synchronize_full_domain(&drm_async_list);
+
if (driver->driver_features & DRIVER_MODESET) {
pci_unregister_driver(&driver->pci_driver);
} else {
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index e660ac0..3ffce27 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1274,7 +1274,7 @@ static int i915_load_modeset_init(struct drm_device *dev,
I915_WRITE(INSTPM, (1 << 5) | (1 << 21));
- drm_helper_initial_config(dev);
+ drm_helper_initial_config_async(dev);
return 0;
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index ffac157..4bbd7b5 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -323,6 +323,7 @@ struct drm_vma_entry {
pid_t pid;
};
+extern struct list_head drm_async_list;
/**
* DMA buffer.
*/
diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h
index b29e201..38ed420 100644
--- a/include/drm/drm_crtc_helper.h
+++ b/include/drm/drm_crtc_helper.h
@@ -98,6 +98,7 @@ extern int drm_helper_probe_single_connector_modes(struct drm_connector *connect
extern void drm_helper_disable_unused_functions(struct drm_device *dev);
extern int drm_helper_hotplug_stage_two(struct drm_device *dev);
extern bool drm_helper_initial_config(struct drm_device *dev);
+extern void drm_helper_initial_config_async(struct drm_device *dev);
extern int drm_crtc_helper_set_config(struct drm_mode_set *set);
extern bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
struct drm_display_mode *mode,
--
1.5.5.1

View File

@ -1,22 +0,0 @@
From: Arjan van de Ven <arjan@linux.intel.com>
Date: Fri, 23 Jan 2009
Small fix changing error msg to info msg in acer wmi driver
---
---
drivers/platform/x86/acer-wmi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux-2.6.29/drivers/platform/x86/acer-wmi.c
===================================================================
--- linux-2.6.29.orig/drivers/platform/x86/acer-wmi.c
+++ linux-2.6.29/drivers/platform/x86/acer-wmi.c
@@ -1290,7 +1290,7 @@ static int __init acer_wmi_init(void)
AMW0_find_mailled();
if (!interface) {
- printk(ACER_ERR "No or unsupported WMI interface, unable to "
+ printk(ACER_INFO "No or unsupported WMI interface, unable to "
"load\n");
return -ENODEV;
}

View File

@ -1,96 +0,0 @@
From 4d690855d6bdc15b753ac3c21bf507ad94d46aac Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <arjan@linux.intel.com>
Date: Sun, 21 Sep 2008 11:58:27 -0700
Subject: [PATCH] superreadahead patch
---
fs/ext3/ioctl.c | 3 +++
fs/ext3/super.c | 1 +
include/linux/ext3_fs.h | 1 +
include/linux/fs.h | 2 ++
4 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/fs/ext3/ioctl.c b/fs/ext3/ioctl.c
index 8897481..08f4854 100644
--- a/fs/ext3/ioctl.c
+++ b/fs/ext3/ioctl.c
@@ -276,6 +276,9 @@ group_add_out:
mnt_drop_write(filp->f_path.mnt);
return err;
}
+ case EXT3_IOC_INODE_JIFFIES: {
+ return inode->created_when;
+ }
default:
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 524b349..e6e8514 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -466,6 +466,7 @@ static struct inode *ext3_alloc_inode(struct super_block *sb)
return NULL;
ei->i_block_alloc_info = NULL;
ei->vfs_inode.i_version = 1;
+ ei->vfs_inode.created_when = jiffies;
atomic_set(&ei->i_datasync_tid, 0);
atomic_set(&ei->i_sync_tid, 0);
return &ei->vfs_inode;
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 634a5e5..84d5394 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -250,6 +250,7 @@ struct ext3_new_group_data {
#endif
#define EXT3_IOC_GETRSVSZ _IOR('f', 5, long)
#define EXT3_IOC_SETRSVSZ _IOW('f', 6, long)
+#define EXT3_IOC_INODE_JIFFIES _IOR('f', 19, long)
/*
* ioctl commands in 32 bit emulation
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 0872372..078e3fd 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -781,6 +781,8 @@ struct inode {
struct posix_acl *i_default_acl;
#endif
void *i_private; /* fs or device private pointer */
+
+ unsigned long created_when; /* jiffies of creation time */
};
/*
--
1.6.0.6
--- vanilla-2.6.32-rc7/fs/btrfs/inode.c~ 2009-11-13 11:15:48.000000000 -0800
+++ vanilla-2.6.32-rc7/fs/btrfs/inode.c 2009-11-13 11:15:48.000000000 -0800
@@ -5181,6 +5181,7 @@
ei->outstanding_extents = 0;
ei->reserved_extents = 0;
ei->root = NULL;
+ ei->vfs_inode.created_when = jiffies;
spin_lock_init(&ei->accounting_lock);
btrfs_ordered_inode_tree_init(&ei->ordered_tree);
INIT_LIST_HEAD(&ei->i_orphan);
--- vanilla-2.6.32-rc7/fs/btrfs/ioctl.c~ 2009-11-13 11:16:58.000000000 -0800
+++ vanilla-2.6.32-rc7/fs/btrfs/ioctl.c 2009-11-13 11:16:58.000000000 -0800
@@ -1298,6 +1298,8 @@
return 0;
}
+#define EXT3_IOC_INODE_JIFFIES _IOR('f', 19, long)
+
long btrfs_ioctl(struct file *file, unsigned int
cmd, unsigned long arg)
{
@@ -1337,6 +1338,8 @@
case BTRFS_IOC_SYNC:
btrfs_sync_fs(file->f_dentry->d_sb, 1);
return 0;
+ case EXT3_IOC_INODE_JIFFIES:
+ return fdentry(file)->d_inode->created_when;
}
return -ENOTTY;

View File

@ -1,14 +0,0 @@
KERN_ERR is not appropriate for a printk level of a successful operation
--- linux-2.6.30/drivers/hid/hid-wacom.c~ 2009-09-04 10:37:20.000000000 -0700
+++ linux-2.6.30/drivers/hid/hid-wacom.c 2009-09-04 10:37:20.000000000 -0700
@@ -244,7 +244,7 @@
ret = hid_register_driver(&wacom_driver);
if (ret)
printk(KERN_ERR "can't register wacom driver\n");
- printk(KERN_ERR "wacom driver registered\n");
+ printk(KERN_INFO "wacom driver registered\n");
return ret;
}

View File

@ -1,284 +0,0 @@
From f62ff8c98080b4a9e66f82f793145b863b4e183a Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <arjan@linux.intel.com>
Date: Fri, 13 Nov 2009 16:54:37 -0800
Subject: [PATCH] libata: Add ALPM power state accounting to the AHCI driver
PowerTOP wants to be able to show the user how effective the ALPM link
power management is for the user. ALPM is worth around 0.5W on a quiet
link; PowerTOP wants to be able to find cases where the "quiet link" isn't
actually quiet.
This patch adds state accounting functionality to the AHCI driver for
PowerTOP to use.
The parts of the patch are
1) the sysfs logic of exposing the stats for each state in sysfs
2) the basic accounting logic that gets update on link change interrupts
(or when the user accesses the info from sysfs)
3) a "accounting enable" flag; in order to get the accounting to work,
the driver needs to get phyrdy interrupts on link status changes.
Normally and currently this is disabled by the driver when ALPM is
on (to reduce overhead); when PowerTOP is running this will need
to be on to get usable statistics... hence the sysfs tunable.
The PowerTOP output currently looks like this:
Recent SATA AHCI link activity statistics
Active Partial Slumber Device name
0.5% 99.5% 0.0% host0
(work to resolve "host0" to a more human readable name is in progress)
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
---
drivers/ata/ahci.c | 175 +++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 173 insertions(+), 2 deletions(-)
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index a3241a1..448d684 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -72,6 +72,21 @@ MODULE_PARM_DESC(ignore_sss, "Ignore staggered spinup flag (0=don't ignore, 1=ig
static int ahci_enable_alpm(struct ata_port *ap,
enum link_pm policy);
static void ahci_disable_alpm(struct ata_port *ap);
+
+static ssize_t ahci_alpm_show_active(struct device *dev,
+ struct device_attribute *attr, char *buf);
+static ssize_t ahci_alpm_show_slumber(struct device *dev,
+ struct device_attribute *attr, char *buf);
+static ssize_t ahci_alpm_show_partial(struct device *dev,
+ struct device_attribute *attr, char *buf);
+
+static ssize_t ahci_alpm_show_accounting(struct device *dev,
+ struct device_attribute *attr, char *buf);
+
+static ssize_t ahci_alpm_set_accounting(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count);
+
static ssize_t ahci_led_show(struct ata_port *ap, char *buf);
static ssize_t ahci_led_store(struct ata_port *ap, const char *buf,
size_t size);
@@ -289,6 +304,13 @@ struct ahci_host_priv {
u32 em_loc; /* enclosure management location */
};
+enum ahci_port_states {
+ AHCI_PORT_NOLINK = 0,
+ AHCI_PORT_ACTIVE = 1,
+ AHCI_PORT_PARTIAL = 2,
+ AHCI_PORT_SLUMBER = 3
+};
+
struct ahci_port_priv {
struct ata_link *active_link;
struct ahci_cmd_hdr *cmd_slot;
@@ -304,6 +326,14 @@ struct ahci_port_priv {
u32 intr_mask; /* interrupts to enable */
/* enclosure management info per PM slot */
struct ahci_em_priv em_priv[EM_MAX_SLOTS];
+
+ /* ALPM accounting state and stats */
+ unsigned int accounting_active:1;
+ u64 active_jiffies;
+ u64 partial_jiffies;
+ u64 slumber_jiffies;
+ int previous_state;
+ int previous_jiffies;
};
static int ahci_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val);
@@ -359,6 +389,12 @@ DEVICE_ATTR(ahci_host_cap2, S_IRUGO, ahci_show_host_cap2, NULL);
DEVICE_ATTR(ahci_host_version, S_IRUGO, ahci_show_host_version, NULL);
DEVICE_ATTR(ahci_port_cmd, S_IRUGO, ahci_show_port_cmd, NULL);
+DEVICE_ATTR(ahci_alpm_active, S_IRUGO, ahci_alpm_show_active, NULL);
+DEVICE_ATTR(ahci_alpm_partial, S_IRUGO, ahci_alpm_show_partial, NULL);
+DEVICE_ATTR(ahci_alpm_slumber, S_IRUGO, ahci_alpm_show_slumber, NULL);
+DEVICE_ATTR(ahci_alpm_accounting, S_IRUGO | S_IWUSR,
+ ahci_alpm_show_accounting, ahci_alpm_set_accounting);
+
static struct device_attribute *ahci_shost_attrs[] = {
&dev_attr_link_power_management_policy,
&dev_attr_em_message_type,
@@ -367,6 +403,10 @@ static struct device_attribute *ahci_shost_attrs[] = {
&dev_attr_ahci_host_cap2,
&dev_attr_ahci_host_version,
&dev_attr_ahci_port_cmd,
+ &dev_attr_ahci_alpm_active,
+ &dev_attr_ahci_alpm_partial,
+ &dev_attr_ahci_alpm_slumber,
+ &dev_attr_ahci_alpm_accounting,
NULL
};
@@ -1165,9 +1205,14 @@ static int ahci_enable_alpm(struct ata_port *ap,
* getting woken up due to spurious phy ready interrupts
* TBD - Hot plug should be done via polling now, is
* that even supported?
+ *
+ * However, when accounting_active is set, we do want
+ * the interrupts for accounting purposes.
*/
- pp->intr_mask &= ~PORT_IRQ_PHYRDY;
- writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK);
+ if (!pp->accounting_active) {
+ pp->intr_mask &= ~PORT_IRQ_PHYRDY;
+ writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK);
+ }
/*
* Set a flag to indicate that we should ignore all PhyRdy
@@ -2157,6 +2202,141 @@ static void ahci_error_intr(struct ata_port *ap, u32 irq_stat)
ata_port_abort(ap);
}
+static int get_current_alpm_state(struct ata_port *ap)
+{
+ u32 status = 0;
+
+ ahci_scr_read(&ap->link, SCR_STATUS, &status);
+
+ /* link status is in bits 11-8 */
+ status = status >> 8;
+ status = status & 0x7;
+
+ if (status == 6)
+ return AHCI_PORT_SLUMBER;
+ if (status == 2)
+ return AHCI_PORT_PARTIAL;
+ if (status == 1)
+ return AHCI_PORT_ACTIVE;
+ return AHCI_PORT_NOLINK;
+}
+
+static void account_alpm_stats(struct ata_port *ap)
+{
+ struct ahci_port_priv *pp;
+
+ int new_state;
+ u64 new_jiffies, jiffies_delta;
+
+ if (ap == NULL)
+ return;
+ pp = ap->private_data;
+ if (!pp) return;
+
+ new_state = get_current_alpm_state(ap);
+ new_jiffies = jiffies;
+
+ jiffies_delta = new_jiffies - pp->previous_jiffies;
+
+ switch (pp->previous_state) {
+ case AHCI_PORT_NOLINK:
+ pp->active_jiffies = 0;
+ pp->partial_jiffies = 0;
+ pp->slumber_jiffies = 0;
+ break;
+ case AHCI_PORT_ACTIVE:
+ pp->active_jiffies += jiffies_delta;
+ break;
+ case AHCI_PORT_PARTIAL:
+ pp->partial_jiffies += jiffies_delta;
+ break;
+ case AHCI_PORT_SLUMBER:
+ pp->slumber_jiffies += jiffies_delta;
+ break;
+ default:
+ break;
+ }
+ pp->previous_state = new_state;
+ pp->previous_jiffies = new_jiffies;
+}
+
+static ssize_t ahci_alpm_show_active(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct Scsi_Host *shost = class_to_shost(dev);
+ struct ata_port *ap = ata_shost_to_port(shost);
+ struct ahci_port_priv *pp;
+
+ if (!ap)
+ return;
+ pp = ap->private_data;
+ account_alpm_stats(ap);
+
+ return sprintf(buf, "%u\n", jiffies_to_msecs(pp->active_jiffies));
+}
+
+static ssize_t ahci_alpm_show_partial(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct Scsi_Host *shost = class_to_shost(dev);
+ struct ata_port *ap = ata_shost_to_port(shost);
+ struct ahci_port_priv *pp = ap->private_data;
+
+ account_alpm_stats(ap);
+
+ return sprintf(buf, "%u\n", jiffies_to_msecs(pp->partial_jiffies));
+}
+
+static ssize_t ahci_alpm_show_slumber(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct Scsi_Host *shost = class_to_shost(dev);
+ struct ata_port *ap = ata_shost_to_port(shost);
+ struct ahci_port_priv *pp = ap->private_data;
+
+ account_alpm_stats(ap);
+
+ return sprintf(buf, "%u\n", jiffies_to_msecs(pp->slumber_jiffies));
+}
+
+
+static ssize_t ahci_alpm_show_accounting(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct Scsi_Host *shost = class_to_shost(dev);
+ struct ata_port *ap = ata_shost_to_port(shost);
+ struct ahci_port_priv *pp = ap->private_data;
+
+ return sprintf(buf, "%u\n", pp->accounting_active);
+}
+
+static ssize_t ahci_alpm_set_accounting(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ unsigned long flags;
+ struct Scsi_Host *shost = class_to_shost(dev);
+ struct ata_port *ap = ata_shost_to_port(shost);
+ struct ahci_port_priv *pp = ap->private_data;
+ void __iomem *port_mmio = ahci_port_base(ap);
+
+ if (!pp)
+ return 1;
+ if (buf[0] == '0')
+ pp->accounting_active = 0;
+ if (buf[0] == '1')
+ pp->accounting_active = 1;
+
+ /* we need to enable the PHYRDY interrupt when we want accounting */
+ if (pp->accounting_active) {
+ spin_lock_irqsave(ap->lock, flags);
+ pp->intr_mask |= PORT_IRQ_PHYRDY;
+ writel(pp->intr_mask, port_mmio + PORT_IRQ_MASK);
+ spin_unlock_irqrestore(ap->lock, flags);
+ }
+ return count;
+}
+
static void ahci_port_intr(struct ata_port *ap)
{
void __iomem *port_mmio = ahci_port_base(ap);
@@ -2182,6 +2352,7 @@ static void ahci_port_intr(struct ata_port *ap)
if ((hpriv->flags & AHCI_HFLAG_NO_HOTPLUG) &&
(status & PORT_IRQ_PHYRDY)) {
status &= ~PORT_IRQ_PHYRDY;
+ account_alpm_stats(ap);
ahci_scr_write(&ap->link, SCR_ERROR, ((1 << 16) | (1 << 18)));
}
--
1.6.0.6

View File

@ -1,53 +0,0 @@
From: Yong Wang <yong.y.wang@intel.com>
Date: Thu Mar 11 15:31:50 2010 +0800
Subject: [PATCH] ahci: Fix accounting oops on dummy port
Not all ports are implemented in AHCI mode on some machines.
If this is the case, it results in NULL pointer dereference
when doing alpm accounting. Skip such dummy ports.
Signed-off-by: Yong Wang <yong.y.wang@intel.com>
---
drivers/ata/ahci.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -2283,8 +2283,8 @@ static ssize_t ahci_alpm_show_active(str
struct ata_port *ap = ata_shost_to_port(shost);
struct ahci_port_priv *pp;
- if (!ap)
- return;
+ if (!ap || ata_port_is_dummy(ap))
+ return 0;
pp = ap->private_data;
account_alpm_stats(ap);
@@ -2298,6 +2298,8 @@ static ssize_t ahci_alpm_show_partial(st
struct ata_port *ap = ata_shost_to_port(shost);
struct ahci_port_priv *pp = ap->private_data;
+ if (!ap || ata_port_is_dummy(ap))
+ return 0;
account_alpm_stats(ap);
return sprintf(buf, "%u\n", jiffies_to_msecs(pp->partial_jiffies));
@@ -2310,6 +2312,8 @@ static ssize_t ahci_alpm_show_slumber(st
struct ata_port *ap = ata_shost_to_port(shost);
struct ahci_port_priv *pp = ap->private_data;
+ if (!ap || ata_port_is_dummy(ap))
+ return 0;
account_alpm_stats(ap);
return sprintf(buf, "%u\n", jiffies_to_msecs(pp->slumber_jiffies));
@@ -2323,6 +2327,8 @@ static ssize_t ahci_alpm_show_accounting
struct ata_port *ap = ata_shost_to_port(shost);
struct ahci_port_priv *pp = ap->private_data;
+ if (!ap || ata_port_is_dummy(ap))
+ return 0;
return sprintf(buf, "%u\n", pp->accounting_active);
}

View File

@ -1,41 +0,0 @@
From b766d59f044858ed3d149e97619a0bf5cc2873f3 Mon Sep 17 00:00:00 2001
From: Priya Vijayan <priya.vijayan@intel.com>
Date: Tue, 27 Apr 2010 13:23:28 -0700
Subject: [PATCH] workaround for aava KOSKI
Signed-off-by: Priya Vijayan <priya.vijayan@intel.com>
---
drivers/i2c/busses/i2c-mrst.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/i2c/busses/i2c-mrst.c b/drivers/i2c/busses/i2c-mrst.c
index e591a90..0737f42 100644
--- a/drivers/i2c/busses/i2c-mrst.c
+++ b/drivers/i2c/busses/i2c-mrst.c
@@ -217,6 +217,7 @@ static int mrst_i2c_disable(struct i2c_adapter *adap)
dev_dbg(&adap->dev, "i2c is busy, count is %d\n", count);
if (count++ > 10000)
return -EBUSY;
+ udelay(10);
}
/* Set IC_ENABLE to 0 */
@@ -468,6 +469,7 @@ static int xfer_read(struct i2c_adapter *adap, unsigned char *buf, int length)
reg_val = mrst_i2c_read(i2c->base + IC_STATUS);
if (count++ > MAX_T_POLL_COUNT)
goto read_loop;
+ udelay(10);
}
reg_val = mrst_i2c_read(i2c->base + IC_DATA_CMD);
@@ -522,6 +524,7 @@ static int xfer_write(struct i2c_adapter *adap,
while ((reg_val & bit_get) == 0) {
if (count++ > MAX_T_POLL_COUNT)
goto write_loop;
+ udelay(10);
reg_val = mrst_i2c_read(i2c->base + IC_STATUS);
}
--
1.6.2.2

View File

@ -1,48 +0,0 @@
We should only send SIOCGIWAP event to notify wpa_supplicant about a lost
link, not to tell it about our disassociation being done. If we send such
event in both cases, this driver will drag wpa_supplicant into an infinite
loop.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
drivers/staging/rt2860/sta/assoc.c | 6 ++++--
drivers/staging/rt2860/sta_ioctl.c | 6 ++++++
2 files changed, 10 insertions(+), 2 deletions(-)
--
Index: b/drivers/staging/rt2860/sta/assoc.c
===================================================================
--- a/drivers/staging/rt2860/sta/assoc.c 2010-01-05 11:25:22.000000000 +0100
+++ b/drivers/staging/rt2860/sta/assoc.c 2010-01-05 18:09:34.000000000 +0100
@@ -818,10 +818,11 @@ void MlmeDisassocReqAction(struct rt_rtm
COPY_MAC_ADDR(pAd->StaCfg.DisassocSta, pDisassocReq->Addr);
RTMPSetTimer(&pAd->MlmeAux.DisassocTimer, Timeout); /* in mSec */
- pAd->Mlme.AssocMachine.CurrState = DISASSOC_WAIT_RSP;
- RtmpOSWrielessEventSend(pAd, SIOCGIWAP, -1, NULL, NULL, 0);
+ pAd->Mlme.AssocMachine.CurrState = DISASSOC_WAIT_RSP;
+ if (INFRA_ON(pAd) || ADHOC_ON(pAd))
+ RtmpOSWrielessEventSend(pAd, SIOCGIWAP, -1, NULL, NULL, 0);
}
/*
Index: b/drivers/staging/rt2860/sta_ioctl.c
===================================================================
--- a/drivers/staging/rt2860/sta_ioctl.c 2010-01-05 11:25:22.000000000 +0100
+++ b/drivers/staging/rt2860/sta_ioctl.c 2010-01-05 12:55:16.000000000 +0100
@@ -602,6 +602,12 @@ int rt_ioctl_siwap(struct net_device *de
DBGPRINT(RT_DEBUG_TRACE,
("MLME busy, reset MLME state machine!\n"));
}
+
+ /* No need to set our BSSID if it's not changing */
+ if (!memcmp(pAdapter->CommonCfg.Bssid, ap_addr->sa_data, ETH_ALEN) ||
+ !memcmp(pAdapter->MlmeAux.Bssid, ap_addr->sa_data, ETH_ALEN))
+ return 0;
+
/* tell CNTL state machine to call NdisMSetInformationComplete() after completing */
/* this request, because this request is initiated by NDIS. */
pAdapter->MlmeAux.CurrReqIsFromNdis = FALSE;

View File

@ -1,24 +0,0 @@
When no SSID is set, the reconnect decision should entirely be left to
userspace. The driver should not decide which AP to associate with based on
arbitrary policies.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
drivers/staging/rt2860/common/mlme.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: b/drivers/staging/rt2860/common/mlme.c
===================================================================
--- a/drivers/staging/rt2860/common/mlme.c 2010-01-05 11:25:22.000000000 +0100
+++ b/drivers/staging/rt2860/common/mlme.c 2010-01-05 13:10:32.000000000 +0100
@@ -1554,7 +1554,8 @@ void MlmeAutoReconnectLastSSID(struct rt
else if ((pAd->Mlme.CntlMachine.CurrState == CNTL_IDLE) &&
(MlmeValidateSSID
(pAd->MlmeAux.AutoReconnectSsid,
- pAd->MlmeAux.AutoReconnectSsidLen) == TRUE)) {
+ pAd->MlmeAux.AutoReconnectSsidLen) == TRUE) &&
+ (pAd->MlmeAux.AutoReconnectSsidLen != 0)) {
struct rt_ndis_802_11_ssid OidSsid;
OidSsid.SsidLength = pAd->MlmeAux.AutoReconnectSsidLen;
NdisMoveMemory(OidSsid.Ssid, pAd->MlmeAux.AutoReconnectSsid,

View File

@ -1,23 +0,0 @@
diff -uNr linux-2.6.32.orig/sound/drivers/timbi2s.c linux-2.6.32.new/sound/drivers/timbi2s.c
--- linux-2.6.32.orig/sound/drivers/timbi2s.c 2010-02-10 10:48:58.000000000 -0800
+++ linux-2.6.32.new/sound/drivers/timbi2s.c 2010-02-10 10:51:46.000000000 -0800
@@ -30,6 +30,10 @@
#include <sound/initval.h>
#include <sound/timbi2s.h>
+static int index = SNDRV_DEFAULT_IDX1;
+module_param(index, int, 0444);
+MODULE_PARM_DESC(index, "Index value for Timberdale I2S.");
+
#define DRIVER_NAME "timb-i2s"
#define MAX_BUSSES 10
@@ -645,7 +649,7 @@
goto out;
}
- err = snd_card_create(SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1,
+ err = snd_card_create(index, SNDRV_DEFAULT_STR1,
THIS_MODULE, sizeof(struct timbi2s) +
sizeof(struct timbi2s_bus) * pdata->num_busses, &card);
if (err)

View File

@ -1,120 +0,0 @@
From f56c995174cf42d84fdad06beebacd56e700b05d Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <arjan@linux.intel.com>
Date: Sun, 25 Oct 2009 15:37:04 -0700
Subject: [PATCH] vfs: Add a trace point in the mark_inode_dirty function
PowerTOP would like to be able to show who is keeping the disk
busy by dirtying data. The most logical spot for this is in the vfs
in the mark_inode_dirty() function, doing this on the block level
is not possible because by the time the IO hits the block layer the
guilty party can no longer be found ("kjournald" and "pdflush" are not
useful answers to "who caused this file to be dirty).
The trace point follows the same logic/style as the block_dump code
and pretty much dumps the same data, just not to dmesg (and thus to
/var/log/messages) but via the trace events streams.
Signed-of-by: Arjan van de Ven <arjan@linux.intel.com>
---
fs/fs-writeback.c | 4 +++
fs/inode.c | 4 +++
include/trace/events/vfs.h | 53 ++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 61 insertions(+), 0 deletions(-)
create mode 100644 include/trace/events/vfs.h
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 9d5360c..af31caf 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -25,6 +25,7 @@
#include <linux/blkdev.h>
#include <linux/backing-dev.h>
#include <linux/buffer_head.h>
+#include <trace/events/vfs.h>
#include "internal.h"
#define inode_to_bdi(inode) ((inode)->i_mapping->backing_dev_info)
@@ -1061,6 +1062,9 @@ void __mark_inode_dirty(struct inode *inode, int flags)
sb->s_op->dirty_inode(inode);
}
+ if (flags & (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES))
+ trace_dirty_inode(inode, current);
+
/*
* make sure that changes are seen by all cpus before we test i_state
* -- mikulas
diff --git a/fs/inode.c b/fs/inode.c
index 4d8e3be..a61e8ba 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1624,3 +1624,7 @@ void init_special_inode(struct inode *inode, umode_t mode, dev_t rdev)
inode->i_ino);
}
EXPORT_SYMBOL(init_special_inode);
+
+#define CREATE_TRACE_POINTS
+#include <trace/events/vfs.h>
+
diff --git a/include/trace/events/vfs.h b/include/trace/events/vfs.h
new file mode 100644
index 0000000..21cf9fb
--- /dev/null
+++ b/include/trace/events/vfs.h
@@ -0,0 +1,53 @@
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM vfs
+
+#if !defined(_TRACE_VFS_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_VFS_H
+
+/*
+ * Tracepoint for dirtying an inode:
+ */
+TRACE_EVENT(dirty_inode,
+
+ TP_PROTO(struct inode *inode, struct task_struct *task),
+
+ TP_ARGS(inode, task),
+
+ TP_STRUCT__entry(
+ __array( char, comm, TASK_COMM_LEN )
+ __field( pid_t, pid )
+ __array( char, dev, 16 )
+ __array( char, file, 32 )
+ ),
+
+ TP_fast_assign(
+ if (inode->i_ino || strcmp(inode->i_sb->s_id, "bdev")) {
+ struct dentry *dentry;
+ const char *name = "?";
+
+ dentry = d_find_alias(inode);
+ if (dentry) {
+ spin_lock(&dentry->d_lock);
+ name = (const char *) dentry->d_name.name;
+ }
+
+ memcpy(__entry->comm, task->comm, TASK_COMM_LEN);
+ __entry->pid = task->pid;
+ strlcpy(__entry->file, name, 32);
+ strlcpy(__entry->dev, inode->i_sb->s_id, 16);
+
+ if (dentry) {
+ spin_unlock(&dentry->d_lock);
+ dput(dentry);
+ }
+ }
+ ),
+
+ TP_printk("task=%i (%s) file=%s dev=%s",
+ __entry->pid, __entry->comm, __entry->file, __entry->dev)
+);
+
+#endif /* _TRACE_VFS_H */
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>
--
1.6.0.6

View File

@ -1,218 +0,0 @@
From d0021b252eaf65ca07ed14f0d66425dd9ccab9a6 Mon Sep 17 00:00:00 2001
From: Neil Horman <nhorman@tuxdriver.com>
Date: Wed, 3 Mar 2010 08:31:23 +0000
Subject: [PATCH] tipc: Fix oops on send prior to entering networked mode (v3)
Patch-mainline: 2.6.34
Fix TIPC to disallow sending to remote addresses prior to entering NET_MODE
user programs can oops the kernel by sending datagrams via AF_TIPC prior to
entering networked mode. The following backtrace has been observed:
ID: 13459 TASK: ffff810014640040 CPU: 0 COMMAND: "tipc-client"
[exception RIP: tipc_node_select_next_hop+90]
RIP: ffffffff8869d3c3 RSP: ffff81002d9a5ab8 RFLAGS: 00010202
RAX: 0000000000000001 RBX: 0000000000000001 RCX: 0000000000000001
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000001001001
RBP: 0000000001001001 R8: 0074736575716552 R9: 0000000000000000
R10: ffff81003fbd0680 R11: 00000000000000c8 R12: 0000000000000008
R13: 0000000000000001 R14: 0000000000000001 R15: ffff810015c6ca00
ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018
RIP: 0000003cbd8d49a3 RSP: 00007fffc84e0be8 RFLAGS: 00010206
RAX: 000000000000002c RBX: ffffffff8005d116 RCX: 0000000000000000
RDX: 0000000000000008 RSI: 00007fffc84e0c00 RDI: 0000000000000003
RBP: 0000000000000000 R8: 00007fffc84e0c10 R9: 0000000000000010
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fffc84e0d10 R14: 0000000000000000 R15: 00007fffc84e0c30
ORIG_RAX: 000000000000002c CS: 0033 SS: 002b
What happens is that, when the tipc module in inserted it enters a standalone
node mode in which communication to its own address is allowed <0.0.0> but not
to other addresses, since the appropriate data structures have not been
allocated yet (specifically the tipc_net pointer). There is nothing stopping a
client from trying to send such a message however, and if that happens, we
attempt to dereference tipc_net.zones while the pointer is still NULL, and
explode. The fix is pretty straightforward. Since these oopses all arise from
the dereference of global pointers prior to their assignment to allocated
values, and since these allocations are small (about 2k total), lets convert
these pointers to static arrays of the appropriate size. All the accesses to
these bits consider 0/NULL to be a non match when searching, so all the lookups
still work properly, and there is no longer a chance of a bad dererence
anywhere. As a bonus, this lets us eliminate the setup/teardown routines for
those pointers, and elimnates the need to preform any locking around them to
prevent access while their being allocated/freed.
I've updated the tipc_net structure to behave this way to fix the exact reported
problem, and also fixed up the tipc_bearers and media_list arrays to fix an
obvious simmilar problem that arises from issuing tipc-config commands to
manipulate bearers/links prior to entering networked mode
I've tested this for a few hours by running the sanity tests and stress test
with the tipcutils suite, and nothing has fallen over. There have been a few
lockdep warnings, but those were there before, and can be addressed later, as
they didn't actually result in any deadlock.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Allan Stephens <allan.stephens@windriver.com>
CC: David S. Miller <davem@davemloft.net>
CC: tipc-discussion@lists.sourceforge.net
bearer.c | 37 ++++++-------------------------------
bearer.h | 2 +-
net.c | 25 ++++---------------------
3 files changed, 11 insertions(+), 53 deletions(-)
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Yong Wang <yong.y.wang@intel.com>
---
net/tipc/bearer.c | 37 ++++++-------------------------------
net/tipc/bearer.h | 2 +-
net/tipc/net.c | 25 ++++---------------------
3 files changed, 11 insertions(+), 53 deletions(-)
diff --git a/net/tipc/bearer.c b/net/tipc/bearer.c
index 327011f..7809137 100644
--- a/net/tipc/bearer.c
+++ b/net/tipc/bearer.c
@@ -45,10 +45,10 @@
#define MAX_ADDR_STR 32
-static struct media *media_list = NULL;
+static struct media media_list[MAX_MEDIA];
static u32 media_count = 0;
-struct bearer *tipc_bearers = NULL;
+struct bearer tipc_bearers[MAX_BEARERS];
/**
* media_name_valid - validate media name
@@ -108,9 +108,11 @@ int tipc_register_media(u32 media_type,
int res = -EINVAL;
write_lock_bh(&tipc_net_lock);
- if (!media_list)
- goto exit;
+ if (tipc_mode != TIPC_NET_MODE) {
+ warn("Media <%s> rejected, not in networked mode yet\n", name);
+ goto exit;
+ }
if (!media_name_valid(name)) {
warn("Media <%s> rejected, illegal name\n", name);
goto exit;
@@ -660,33 +662,10 @@ int tipc_disable_bearer(const char *name)
-int tipc_bearer_init(void)
-{
- int res;
-
- write_lock_bh(&tipc_net_lock);
- tipc_bearers = kcalloc(MAX_BEARERS, sizeof(struct bearer), GFP_ATOMIC);
- media_list = kcalloc(MAX_MEDIA, sizeof(struct media), GFP_ATOMIC);
- if (tipc_bearers && media_list) {
- res = 0;
- } else {
- kfree(tipc_bearers);
- kfree(media_list);
- tipc_bearers = NULL;
- media_list = NULL;
- res = -ENOMEM;
- }
- write_unlock_bh(&tipc_net_lock);
- return res;
-}
-
void tipc_bearer_stop(void)
{
u32 i;
- if (!tipc_bearers)
- return;
-
for (i = 0; i < MAX_BEARERS; i++) {
if (tipc_bearers[i].active)
tipc_bearers[i].publ.blocked = 1;
@@ -695,10 +674,6 @@ void tipc_bearer_stop(void)
if (tipc_bearers[i].active)
bearer_disable(tipc_bearers[i].publ.name);
}
- kfree(tipc_bearers);
- kfree(media_list);
- tipc_bearers = NULL;
- media_list = NULL;
media_count = 0;
}
diff --git a/net/tipc/bearer.h b/net/tipc/bearer.h
index ca57348..000228e 100644
--- a/net/tipc/bearer.h
+++ b/net/tipc/bearer.h
@@ -114,7 +114,7 @@ struct bearer_name {
struct link;
-extern struct bearer *tipc_bearers;
+extern struct bearer tipc_bearers[];
void tipc_media_addr_printf(struct print_buf *pb, struct tipc_media_addr *a);
struct sk_buff *tipc_media_get_names(void);
diff --git a/net/tipc/net.c b/net/tipc/net.c
index 7906608..f25b1cd 100644
--- a/net/tipc/net.c
+++ b/net/tipc/net.c
@@ -116,7 +116,8 @@
*/
DEFINE_RWLOCK(tipc_net_lock);
-struct network tipc_net = { NULL };
+struct _zone *tipc_zones[256] = { NULL, };
+struct network tipc_net = { tipc_zones };
struct tipc_node *tipc_net_select_remote_node(u32 addr, u32 ref)
{
@@ -158,28 +159,12 @@ void tipc_net_send_external_routes(u32 dest)
}
}
-static int net_init(void)
-{
- memset(&tipc_net, 0, sizeof(tipc_net));
- tipc_net.zones = kcalloc(tipc_max_zones + 1, sizeof(struct _zone *), GFP_ATOMIC);
- if (!tipc_net.zones) {
- return -ENOMEM;
- }
- return 0;
-}
-
static void net_stop(void)
{
u32 z_num;
- if (!tipc_net.zones)
- return;
-
- for (z_num = 1; z_num <= tipc_max_zones; z_num++) {
+ for (z_num = 1; z_num <= tipc_max_zones; z_num++)
tipc_zone_delete(tipc_net.zones[z_num]);
- }
- kfree(tipc_net.zones);
- tipc_net.zones = NULL;
}
static void net_route_named_msg(struct sk_buff *buf)
@@ -282,9 +267,7 @@ int tipc_net_start(u32 addr)
tipc_named_reinit();
tipc_port_reinit();
- if ((res = tipc_bearer_init()) ||
- (res = net_init()) ||
- (res = tipc_cltr_init()) ||
+ if ((res = tipc_cltr_init()) ||
(res = tipc_bclink_init())) {
return res;
}
--
1.5.5.1

View File

@ -1,320 +0,0 @@
From d96b241bd2ad42b6c49d5f6435c69b23818f001e Mon Sep 17 00:00:00 2001
From: Felipe Balbi <felipe.balbi@nokia.com>
Date: Tue, 5 Jan 2010 16:10:13 +0200
Subject: [PATCH 9/10] USB: gadget: introduce g_nokia gadget driver
Patch-mainline: 2.6.34
Git-commit: f358f5b40af67caf28b627889d007294614170b2
g_nokia is the gadget driver implementing
WMCDC Wireless Handset Control Model for the N900
device.
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/usb/gadget/Kconfig | 10 +
drivers/usb/gadget/Makefile | 2
drivers/usb/gadget/nokia.c | 259 ++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 271 insertions(+)
create mode 100644 drivers/usb/gadget/nokia.c
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -828,6 +828,16 @@
Say "y" to link the driver statically, or "m" to build a
dynamically linked module.
+config USB_G_NOKIA
+ tristate "Nokia composite gadget"
+ depends on PHONET
+ help
+ The Nokia composite gadget provides support for acm, obex
+ and phonet in only one composite gadget driver.
+
+ It's only really useful for N900 hardware. If you're building
+ a kernel for N900, say Y or M here. If unsure, say N.
+
config USB_G_MULTI
tristate "Multifunction Composite Gadget (EXPERIMENTAL)"
depends on BLOCK && NET
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -44,6 +44,7 @@
g_cdc-objs := cdc2.o
g_multi-objs := multi.o
g_still_image-objs := still_image.o
+g_nokia-objs := nokia.o
obj-$(CONFIG_USB_ZERO) += g_zero.o
obj-$(CONFIG_USB_AUDIO) += g_audio.o
@@ -57,6 +58,7 @@
obj-$(CONFIG_USB_CDC_COMPOSITE) += g_cdc.o
obj-$(CONFIG_USB_G_MULTI) += g_multi.o
obj-$(CONFIG_USB_STILL_IMAGE) += g_still_image.o
+obj-$(CONFIG_USB_G_NOKIA) += g_nokia.o
ifeq ($(CONFIG_USB_GADGET_DEBUG),y)
EXTRA_CFLAGS += -DDMA_PPB_MODE
--- /dev/null
+++ b/drivers/usb/gadget/nokia.c
@@ -0,0 +1,259 @@
+/*
+ * nokia.c -- Nokia Composite Gadget Driver
+ *
+ * Copyright (C) 2008-2010 Nokia Corporation
+ * Contact: Felipe Balbi <felipe.balbi@nokia.com>
+ *
+ * This gadget driver borrows from serial.c which is:
+ *
+ * Copyright (C) 2003 Al Borchers (alborchers@steinerpoint.com)
+ * Copyright (C) 2008 by David Brownell
+ * Copyright (C) 2008 by Nokia Corporation
+ *
+ * This software is distributed under the terms of the GNU General
+ * Public License ("GPL") as published by the Free Software Foundation,
+ * version 2 of that License.
+ */
+
+#include <linux/kernel.h>
+#include <linux/utsname.h>
+#include <linux/device.h>
+
+#include "u_serial.h"
+#include "u_ether.h"
+#include "u_phonet.h"
+#include "gadget_chips.h"
+
+/* Defines */
+
+#define NOKIA_VERSION_NUM 0x0211
+#define NOKIA_LONG_NAME "N900 (PC-Suite Mode)"
+
+/*-------------------------------------------------------------------------*/
+
+/*
+ * Kbuild is not very cooperative with respect to linking separately
+ * compiled library objects into one module. So for now we won't use
+ * separate compilation ... ensuring init/exit sections work to shrink
+ * the runtime footprint, and giving us at least some parts of what
+ * a "gcc --combine ... part1.c part2.c part3.c ... " build would.
+ */
+#include "composite.c"
+#include "usbstring.c"
+#include "config.c"
+#include "epautoconf.c"
+
+#include "u_serial.c"
+#include "f_acm.c"
+#include "f_ecm.c"
+#include "f_obex.c"
+#include "f_serial.c"
+#include "f_phonet.c"
+#include "u_ether.c"
+
+/*-------------------------------------------------------------------------*/
+
+#define NOKIA_VENDOR_ID 0x0421 /* Nokia */
+#define NOKIA_PRODUCT_ID 0x01c8 /* Nokia Gadget */
+
+/* string IDs are assigned dynamically */
+
+#define STRING_MANUFACTURER_IDX 0
+#define STRING_PRODUCT_IDX 1
+#define STRING_DESCRIPTION_IDX 2
+
+static char manufacturer_nokia[] = "Nokia";
+static const char product_nokia[] = NOKIA_LONG_NAME;
+static const char description_nokia[] = "PC-Suite Configuration";
+
+static struct usb_string strings_dev[] = {
+ [STRING_MANUFACTURER_IDX].s = manufacturer_nokia,
+ [STRING_PRODUCT_IDX].s = NOKIA_LONG_NAME,
+ [STRING_DESCRIPTION_IDX].s = description_nokia,
+ { } /* end of list */
+};
+
+static struct usb_gadget_strings stringtab_dev = {
+ .language = 0x0409, /* en-us */
+ .strings = strings_dev,
+};
+
+static struct usb_gadget_strings *dev_strings[] = {
+ &stringtab_dev,
+ NULL,
+};
+
+static struct usb_device_descriptor device_desc = {
+ .bLength = USB_DT_DEVICE_SIZE,
+ .bDescriptorType = USB_DT_DEVICE,
+ .bcdUSB = __constant_cpu_to_le16(0x0200),
+ .bDeviceClass = USB_CLASS_COMM,
+ .idVendor = __constant_cpu_to_le16(NOKIA_VENDOR_ID),
+ .idProduct = __constant_cpu_to_le16(NOKIA_PRODUCT_ID),
+ /* .iManufacturer = DYNAMIC */
+ /* .iProduct = DYNAMIC */
+ .bNumConfigurations = 1,
+};
+
+/*-------------------------------------------------------------------------*/
+
+/* Module */
+MODULE_DESCRIPTION("Nokia composite gadget driver for N900");
+MODULE_AUTHOR("Felipe Balbi");
+MODULE_LICENSE("GPL");
+
+/*-------------------------------------------------------------------------*/
+
+static u8 hostaddr[ETH_ALEN];
+
+static int __init nokia_bind_config(struct usb_configuration *c)
+{
+ int status = 0;
+
+ status = phonet_bind_config(c);
+ if (status)
+ printk(KERN_DEBUG "could not bind phonet config\n");
+
+ status = obex_bind_config(c, 0);
+ if (status)
+ printk(KERN_DEBUG "could not bind obex config %d\n", 0);
+
+ status = obex_bind_config(c, 1);
+ if (status)
+ printk(KERN_DEBUG "could not bind obex config %d\n", 0);
+
+ status = acm_bind_config(c, 2);
+ if (status)
+ printk(KERN_DEBUG "could not bind acm config\n");
+
+ status = ecm_bind_config(c, hostaddr);
+ if (status)
+ printk(KERN_DEBUG "could not bind ecm config\n");
+
+ return status;
+}
+
+static struct usb_configuration nokia_config_500ma_driver = {
+ .label = "Bus Powered",
+ .bind = nokia_bind_config,
+ .bConfigurationValue = 1,
+ /* .iConfiguration = DYNAMIC */
+ .bmAttributes = USB_CONFIG_ATT_ONE,
+ .bMaxPower = 250, /* 500mA */
+};
+
+static struct usb_configuration nokia_config_100ma_driver = {
+ .label = "Self Powered",
+ .bind = nokia_bind_config,
+ .bConfigurationValue = 2,
+ /* .iConfiguration = DYNAMIC */
+ .bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER,
+ .bMaxPower = 50, /* 100 mA */
+};
+
+static int __init nokia_bind(struct usb_composite_dev *cdev)
+{
+ int gcnum;
+ struct usb_gadget *gadget = cdev->gadget;
+ int status;
+
+ status = gphonet_setup(cdev->gadget);
+ if (status < 0)
+ goto err_phonet;
+
+ status = gserial_setup(cdev->gadget, 3);
+ if (status < 0)
+ goto err_serial;
+
+ status = gether_setup(cdev->gadget, hostaddr);
+ if (status < 0)
+ goto err_ether;
+
+ status = usb_string_id(cdev);
+ if (status < 0)
+ goto err_usb;
+ strings_dev[STRING_MANUFACTURER_IDX].id = status;
+
+ device_desc.iManufacturer = status;
+
+ status = usb_string_id(cdev);
+ if (status < 0)
+ goto err_usb;
+ strings_dev[STRING_PRODUCT_IDX].id = status;
+
+ device_desc.iProduct = status;
+
+ /* config description */
+ status = usb_string_id(cdev);
+ if (status < 0)
+ goto err_usb;
+ strings_dev[STRING_DESCRIPTION_IDX].id = status;
+
+ nokia_config_500ma_driver.iConfiguration = status;
+ nokia_config_100ma_driver.iConfiguration = status;
+
+ /* set up other descriptors */
+ gcnum = usb_gadget_controller_number(gadget);
+ if (gcnum >= 0)
+ device_desc.bcdDevice = cpu_to_le16(NOKIA_VERSION_NUM);
+ else {
+ /* this should only work with hw that supports altsettings
+ * and several endpoints, anything else, panic.
+ */
+ pr_err("nokia_bind: controller '%s' not recognized\n",
+ gadget->name);
+ goto err_usb;
+ }
+
+ /* finaly register the configuration */
+ status = usb_add_config(cdev, &nokia_config_500ma_driver);
+ if (status < 0)
+ goto err_usb;
+
+ status = usb_add_config(cdev, &nokia_config_100ma_driver);
+ if (status < 0)
+ goto err_usb;
+
+ dev_info(&gadget->dev, "%s\n", NOKIA_LONG_NAME);
+
+ return 0;
+
+err_usb:
+ gether_cleanup();
+err_ether:
+ gserial_cleanup();
+err_serial:
+ gphonet_cleanup();
+err_phonet:
+ return status;
+}
+
+static int __exit nokia_unbind(struct usb_composite_dev *cdev)
+{
+ gphonet_cleanup();
+ gserial_cleanup();
+ gether_cleanup();
+
+ return 0;
+}
+
+static struct usb_composite_driver nokia_driver = {
+ .name = "g_nokia",
+ .dev = &device_desc,
+ .strings = dev_strings,
+ .bind = nokia_bind,
+ .unbind = __exit_p(nokia_unbind),
+};
+
+static int __init nokia_init(void)
+{
+ return usb_composite_register(&nokia_driver);
+}
+module_init(nokia_init);
+
+static void __exit nokia_cleanup(void)
+{
+ usb_composite_unregister(&nokia_driver);
+}
+module_exit(nokia_cleanup);
+

View File

@ -1,85 +0,0 @@
From 76ca24d389a3f5eaf11d94efab15d5bef11a0a74 Mon Sep 17 00:00:00 2001
From: Felipe Balbi <felipe.balbi@nokia.com>
Date: Thu, 17 Dec 2009 13:01:36 +0200
Subject: [PATCH 10/10] USB: otg: add notifier support
Patch-mainline: 2.6.34
Git-commit: e9a20171dfa0aa134d2211126d1310f2daea52cf
The notifier will be used to communicate usb events
to other drivers like the charger chip.
This can be used as source of information to kick
usb charger detection as described by the USB
Battery Charging Specification 1.1 and/or to
pass bMaxPower field of selected usb_configuration
to charger chip in order to use that information
as input current on the charging profile
setup.
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
include/linux/usb/otg.h | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
index 52bb917..6c0b676 100644
--- a/include/linux/usb/otg.h
+++ b/include/linux/usb/otg.h
@@ -9,6 +9,8 @@
#ifndef __LINUX_USB_OTG_H
#define __LINUX_USB_OTG_H
+#include <linux/notifier.h>
+
/* OTG defines lots of enumeration states before device reset */
enum usb_otg_state {
OTG_STATE_UNDEFINED = 0,
@@ -33,6 +35,14 @@ enum usb_otg_state {
OTG_STATE_A_VBUS_ERR,
};
+enum usb_xceiv_events {
+ USB_EVENT_NONE, /* no events or cable disconnected */
+ USB_EVENT_VBUS, /* vbus valid event */
+ USB_EVENT_ID, /* id was grounded */
+ USB_EVENT_CHARGER, /* usb dedicated charger */
+ USB_EVENT_ENUMERATED, /* gadget driver enumerated */
+};
+
#define USB_OTG_PULLUP_ID (1 << 0)
#define USB_OTG_PULLDOWN_DP (1 << 1)
#define USB_OTG_PULLDOWN_DM (1 << 2)
@@ -70,6 +80,9 @@ struct otg_transceiver {
struct otg_io_access_ops *io_ops;
void __iomem *io_priv;
+ /* for notification of usb_xceiv_events */
+ struct blocking_notifier_head notifier;
+
/* to pass extra port status to the root hub */
u16 port_status;
u16 port_change;
@@ -203,6 +216,18 @@ otg_start_srp(struct otg_transceiver *otg)
return otg->start_srp(otg);
}
+/* notifiers */
+static inline int
+otg_register_notifier(struct otg_transceiver *otg, struct notifier_block *nb)
+{
+ return blocking_notifier_chain_register(&otg->notifier, nb);
+}
+
+static inline void
+otg_unregister_notifier(struct otg_transceiver *otg, struct notifier_block *nb)
+{
+ blocking_notifier_chain_unregister(&otg->notifier, nb);
+}
/* for OTG controller drivers (and maybe other stuff) */
extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num);
--
1.6.0.4

View File

@ -1,366 +0,0 @@
From ff4cd0510defa74c5b9b3c1bd5c5a02b8af53fd1 Mon Sep 17 00:00:00 2001
From: Priya Vijayan <priya.vijayan@intel.com>
Date: Tue, 27 Apr 2010 14:43:04 -0700
Subject: [PATCH] Touch driver and configs for Cando dual touch panels
Added support for the Cando dual touch panels, found in the Lenovo S10-3t.
Signed-off-by: Stephane Chatty <chatty@enac.fr>
Tested-by: Priya Vijayan <priya.vijayan@intel.com>
Tested-by: Florian Echtler <floe@butterbrot.org>
Signed-off-by: Priya Vijayan <priya.vijayan@intel.com>
---
drivers/hid/Kconfig | 6 +
drivers/hid/Makefile | 1 +
drivers/hid/hid-cando.c | 268 +++++++++++++++++++++++++++++++++++++++++++++++
drivers/hid/hid-core.c | 1 +
drivers/hid/hid-ids.h | 3 +
include/linux/hid.h | 2 +-
6 files changed, 280 insertions(+), 1 deletions(-)
create mode 100644 drivers/hid/hid-cando.c
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index 24d90ea..37fb241 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -80,6 +80,12 @@ config HID_BELKIN
---help---
Support for Belkin Flip KVM and Wireless keyboard.
+config HID_CANDO
+ tristate "Cando dual touch panel"
+ depends on USB_HID
+ ---help---
+ Support for Cando dual touch panel.
+
config HID_CHERRY
tristate "Cherry" if EMBEDDED
depends on USB_HID
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
index 0de2dff..b05f921 100644
--- a/drivers/hid/Makefile
+++ b/drivers/hid/Makefile
@@ -22,6 +22,7 @@ endif
obj-$(CONFIG_HID_A4TECH) += hid-a4tech.o
obj-$(CONFIG_HID_APPLE) += hid-apple.o
obj-$(CONFIG_HID_BELKIN) += hid-belkin.o
+obj-$(CONFIG_HID_CANDO) += hid-cando.o
obj-$(CONFIG_HID_CHERRY) += hid-cherry.o
obj-$(CONFIG_HID_CHICONY) += hid-chicony.o
obj-$(CONFIG_HID_CYPRESS) += hid-cypress.o
diff --git a/drivers/hid/hid-cando.c b/drivers/hid/hid-cando.c
new file mode 100644
index 0000000..ed8c093
--- /dev/null
+++ b/drivers/hid/hid-cando.c
@@ -0,0 +1,268 @@
+/*
+ * HID driver for Cando dual-touch panels
+ *
+ * Copyright (c) 2010 Stephane Chatty <chatty@enac.fr>
+ *
+ */
+
+/*
+ * 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>
+
+MODULE_AUTHOR("Stephane Chatty <chatty@enac.fr>");
+MODULE_DESCRIPTION("Cando dual-touch panel");
+MODULE_LICENSE("GPL");
+
+#include "hid-ids.h"
+
+struct cando_data {
+ __u16 x, y;
+ __u8 id;
+ __s8 oldest; /* id of the oldest finger in previous frame */
+ bool valid; /* valid finger data, or just placeholder? */
+ bool first; /* is this the first finger in this frame? */
+ __s8 firstid; /* id of the first finger in the frame */
+ __u16 firstx, firsty; /* (x, y) of the first finger in the frame */
+};
+
+static int cando_input_mapping(struct hid_device *hdev, struct hid_input *hi,
+ struct hid_field *field, struct hid_usage *usage,
+ unsigned long **bit, int *max)
+{
+ switch (usage->hid & HID_USAGE_PAGE) {
+
+ case HID_UP_GENDESK:
+ switch (usage->hid) {
+ case HID_GD_X:
+ hid_map_usage(hi, usage, bit, max,
+ EV_ABS, ABS_MT_POSITION_X);
+ /* touchscreen emulation */
+ input_set_abs_params(hi->input, ABS_X,
+ field->logical_minimum,
+ field->logical_maximum, 0, 0);
+ return 1;
+ case HID_GD_Y:
+ hid_map_usage(hi, usage, bit, max,
+ EV_ABS, ABS_MT_POSITION_Y);
+ /* touchscreen emulation */
+ input_set_abs_params(hi->input, ABS_Y,
+ field->logical_minimum,
+ field->logical_maximum, 0, 0);
+ return 1;
+ }
+ return 0;
+
+ case HID_UP_DIGITIZER:
+ switch (usage->hid) {
+ case HID_DG_TIPSWITCH:
+ case HID_DG_CONTACTMAX:
+ return -1;
+ case HID_DG_INRANGE:
+ /* touchscreen emulation */
+ hid_map_usage(hi, usage, bit, max, EV_KEY, BTN_TOUCH);
+ return 1;
+ case HID_DG_CONTACTID:
+ hid_map_usage(hi, usage, bit, max,
+ EV_ABS, ABS_MT_TRACKING_ID);
+ return 1;
+ }
+ return 0;
+ }
+
+ return 0;
+}
+
+static int cando_input_mapped(struct hid_device *hdev, struct hid_input *hi,
+ struct hid_field *field, struct hid_usage *usage,
+ unsigned long **bit, int *max)
+{
+ if (usage->type == EV_KEY || usage->type == EV_ABS)
+ clear_bit(usage->code, *bit);
+
+ return 0;
+}
+
+/*
+ * this function is called when a whole finger has been parsed,
+ * so that it can decide what to send to the input layer.
+ */
+static void cando_filter_event(struct cando_data *td, struct input_dev *input)
+{
+ td->first = !td->first; /* touchscreen emulation */
+
+ if (!td->valid) {
+ /*
+ * touchscreen emulation: if this is the second finger and
+ * the first was valid, the first was the oldest; if the
+ * first was not valid and there was a valid finger in the
+ * previous frame, this is a release.
+ */
+ if (td->first) {
+ td->firstid = -1;
+ } else if (td->firstid >= 0) {
+ input_event(input, EV_ABS, ABS_X, td->firstx);
+ input_event(input, EV_ABS, ABS_Y, td->firsty);
+ td->oldest = td->firstid;
+ } else if (td->oldest >= 0) {
+ input_event(input, EV_KEY, BTN_TOUCH, 0);
+ td->oldest = -1;
+ }
+
+ return;
+ }
+
+ input_event(input, EV_ABS, ABS_MT_TRACKING_ID, td->id);
+ input_event(input, EV_ABS, ABS_MT_POSITION_X, td->x);
+ input_event(input, EV_ABS, ABS_MT_POSITION_Y, td->y);
+
+ input_mt_sync(input);
+
+ /*
+ * touchscreen emulation: if there was no touching finger previously,
+ * emit touch event
+ */
+ if (td->oldest < 0) {
+ input_event(input, EV_KEY, BTN_TOUCH, 1);
+ td->oldest = td->id;
+ }
+
+ /*
+ * touchscreen emulation: if this is the first finger, wait for the
+ * second; the oldest is then the second if it was the oldest already
+ * or if there was no first, the first otherwise.
+ */
+ if (td->first) {
+ td->firstx = td->x;
+ td->firsty = td->y;
+ td->firstid = td->id;
+ } else {
+ int x, y, oldest;
+ if (td->id == td->oldest || td->firstid < 0) {
+ x = td->x;
+ y = td->y;
+ oldest = td->id;
+ } else {
+ x = td->firstx;
+ y = td->firsty;
+ oldest = td->firstid;
+ }
+ input_event(input, EV_ABS, ABS_X, x);
+ input_event(input, EV_ABS, ABS_Y, y);
+ td->oldest = oldest;
+ }
+}
+
+
+static int cando_event(struct hid_device *hid, struct hid_field *field,
+ struct hid_usage *usage, __s32 value)
+{
+ struct cando_data *td = hid_get_drvdata(hid);
+
+ if (hid->claimed & HID_CLAIMED_INPUT) {
+ struct input_dev *input = field->hidinput->input;
+
+ switch (usage->hid) {
+ case HID_DG_INRANGE:
+ td->valid = value;
+ break;
+ case HID_DG_CONTACTID:
+ td->id = value;
+ break;
+ case HID_GD_X:
+ td->x = value;
+ break;
+ case HID_GD_Y:
+ td->y = value;
+ cando_filter_event(td, input);
+ break;
+ case HID_DG_TIPSWITCH:
+ /* avoid interference from generic hidinput handling */
+ break;
+
+ default:
+ /* fallback to the generic hidinput handling */
+ return 0;
+ }
+ }
+
+ /* we have handled the hidinput part, now remains hiddev */
+ if (hid->claimed & HID_CLAIMED_HIDDEV && hid->hiddev_hid_event)
+ hid->hiddev_hid_event(hid, field, usage, value);
+
+ return 1;
+}
+
+static int cando_probe(struct hid_device *hdev, const struct hid_device_id *id)
+{
+ int ret;
+ struct cando_data *td;
+
+ td = kmalloc(sizeof(struct cando_data), GFP_KERNEL);
+ if (!td) {
+ dev_err(&hdev->dev, "cannot allocate Cando Touch data\n");
+ return -ENOMEM;
+ }
+ hid_set_drvdata(hdev, td);
+ td->first = false;
+ td->oldest = -1;
+ td->valid = false;
+
+ ret = hid_parse(hdev);
+ if (!ret)
+ ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
+
+ if (ret)
+ kfree(td);
+
+ return ret;
+}
+
+static void cando_remove(struct hid_device *hdev)
+{
+ hid_hw_stop(hdev);
+ kfree(hid_get_drvdata(hdev));
+ hid_set_drvdata(hdev, NULL);
+}
+
+static const struct hid_device_id cando_devices[] = {
+ { HID_USB_DEVICE(USB_VENDOR_ID_CANDO,
+ USB_DEVICE_ID_CANDO_MULTI_TOUCH) },
+ { }
+};
+MODULE_DEVICE_TABLE(hid, cando_devices);
+
+static const struct hid_usage_id cando_grabbed_usages[] = {
+ { HID_ANY_ID, HID_ANY_ID, HID_ANY_ID },
+ { HID_ANY_ID - 1, HID_ANY_ID - 1, HID_ANY_ID - 1}
+};
+
+static struct hid_driver cando_driver = {
+ .name = "cando-touch",
+ .id_table = cando_devices,
+ .probe = cando_probe,
+ .remove = cando_remove,
+ .input_mapping = cando_input_mapping,
+ .input_mapped = cando_input_mapped,
+ .usage_table = cando_grabbed_usages,
+ .event = cando_event,
+};
+
+static int __init cando_init(void)
+{
+ return hid_register_driver(&cando_driver);
+}
+
+static void __exit cando_exit(void)
+{
+ hid_unregister_driver(&cando_driver);
+}
+
+module_init(cando_init);
+module_exit(cando_exit);
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 8455f3d..b126102 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1291,6 +1291,7 @@ static const struct hid_device_id hid_blacklist[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },
{ HID_USB_DEVICE(USB_VENDOR_ID_BELKIN, USB_DEVICE_ID_FLIP_KVM) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_CANDO, USB_DEVICE_ID_CANDO_MULTI_TOUCH) },
{ HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION) },
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_TACTICAL_PAD) },
{ HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_1) },
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 793691f..6865ca2 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -116,6 +116,9 @@
#define USB_VENDOR_ID_BERKSHIRE 0x0c98
#define USB_DEVICE_ID_BERKSHIRE_PCWD 0x1140
+#define USB_VENDOR_ID_CANDO 0x2087
+#define USB_DEVICE_ID_CANDO_MULTI_TOUCH 0x0a01
+
#define USB_VENDOR_ID_CH 0x068e
#define USB_DEVICE_ID_CH_PRO_PEDALS 0x00f2
#define USB_DEVICE_ID_CH_COMBATSTICK 0x00f4
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 8709365..b978c1e 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -663,7 +663,7 @@ struct hid_ll_driver {
/* Applications from HID Usage Tables 4/8/99 Version 1.1 */
/* We ignore a few input applications that are not widely used */
-#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001) || (a == 0x000d0002))
+#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001) || ((a >= 0x000d0002) && (a <= 0x000d0006)))
/* HID core API */
--
1.6.2.2

View File

@ -1,870 +0,0 @@
From 03e11a278286392dc20de57a24cadbc16d9aac3a Mon Sep 17 00:00:00 2001
From: Priya Vijayan <priya.vijayan@intel.com>
Date: Tue, 27 Apr 2010 11:23:00 -0700
Subject: [PATCH] Touchscreen driver for Cypress panels
This driver is from aava
Signed-off-by: Priya Vijayan <priya.vijayan@intel.com>
---
drivers/input/touchscreen/Kconfig | 8 +
drivers/input/touchscreen/Makefile | 1 +
drivers/input/touchscreen/cy8ctmg110_ts.c | 815 +++++++++++++++++++++++++++++
3 files changed, 824 insertions(+), 0 deletions(-)
create mode 100644 drivers/input/touchscreen/cy8ctmg110_ts.c
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index 6dd2674..5ecf00d 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -103,6 +103,14 @@ config TOUCHSCREEN_CORGI
NOTE: this driver is deprecated, try enable SPI and generic
ADS7846-based touchscreen driver.
+config TOUCHSCREEN_CY8CTMG110
+ tristate "cy8ctmg110 touchscreen"
+ depends on I2C
+ default y
+ help
+ Say Y here if you have a cy8ctmg110 touchscreen capasitive touchscreen
+ If unsure, say N.
+
config TOUCHSCREEN_DA9034
tristate "Touchscreen support for Dialog Semiconductor DA9034"
depends on PMIC_DA903X
diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile
index 15ad257..e5b5fae 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -12,6 +12,7 @@ obj-$(CONFIG_TOUCHSCREEN_ADS7846) += ads7846.o
obj-$(CONFIG_TOUCHSCREEN_ATMEL_TSADCC) += atmel_tsadcc.o
obj-$(CONFIG_TOUCHSCREEN_BITSY) += h3600_ts_input.o
obj-$(CONFIG_TOUCHSCREEN_CORGI) += corgi_ts.o
+obj-$(CONFIG_TOUCHSCREEN_CY8CTMG110) += cy8ctmg110_ts.o
obj-$(CONFIG_TOUCHSCREEN_DYNAPRO) += dynapro.o
obj-$(CONFIG_TOUCHSCREEN_GUNZE) += gunze.o
obj-$(CONFIG_TOUCHSCREEN_EETI) += eeti_ts.o
diff --git a/drivers/input/touchscreen/cy8ctmg110_ts.c b/drivers/input/touchscreen/cy8ctmg110_ts.c
new file mode 100644
index 0000000..5587385
--- /dev/null
+++ b/drivers/input/touchscreen/cy8ctmg110_ts.c
@@ -0,0 +1,815 @@
+/*
+ * cy8ctmg110_ts.c Driver for cypress touch screen controller
+ * Copyright (c) 2009 Aava Mobile
+ *
+ * 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.
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/input.h>
+#include <linux/interrupt.h>
+#include <asm/io.h>
+#include <linux/i2c.h>
+#include <linux/timer.h>
+#include <linux/gpio.h>
+#include <linux/hrtimer.h>
+
+#include <linux/platform_device.h>
+#include <linux/delay.h>
+#include <linux/fs.h>
+#include <asm/ioctl.h>
+#include <asm/ipc_defs.h>
+#include <asm/uaccess.h>
+#include <linux/device.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/delay.h>
+#include <linux/fs.h>
+#include <asm/ioctl.h>
+#include <linux/fs.h>
+#include <linux/init.h>
+#include <linux/miscdevice.h>
+#include <linux/module.h>
+
+
+#define CY8CTMG110_DRIVER_NAME "cy8ctmg110"
+#define CY8CTMG110_DRIVER_NAME_EXT "cy8ctmg110 ext"
+/*#define MOORESTOWN_CDK*/
+/*#define CY8CTMG110_DEBUG_INFO*/
+/*#define POLL_TOUCH_EVENTS*/
+
+
+
+/*HW definations*/
+
+/*Main touch specific*/
+#define CY8CTMG110_I2C_ADDR 0x38
+#define CY8CTMG110_RESET_PIN_GPIO 43
+#define CY8CTMG110_IRQ_PIN_GPIO 59
+
+/*Extended specific*/
+#define CY8CTMG110_I2C_ADDR_EXT 0x39
+#define CY8CTMG110_RESET_PIN_GPIO_EXT 39
+#define CY8CTMG110_IRQ_PIN_GPIO_EXT 31
+
+
+#define CY8CTMG110_TOUCH_LENGHT 9787
+#define CY8CTMG110_SCREEN_LENGHT 8424
+
+
+/*Main Touch coordinates*/
+#define CY8CTMG110_X_MIN 0
+#define CY8CTMG110_Y_MIN 0
+#define CY8CTMG110_X_MAX 864
+#define CY8CTMG110_Y_MAX 480
+
+
+/*cy8ctmg110 registers defination*/
+#define CY8CTMG110_TOUCH_WAKEUP_TIME 0
+#define CY8CTMG110_TOUCH_SLEEP_TIME 2
+#define CY8CTMG110_TOUCH_X1 3
+#define CY8CTMG110_TOUCH_Y1 5
+#define CY8CTMG110_TOUCH_X2 7
+#define CY8CTMG110_TOUCH_Y2 9
+#define CY8CTMG110_FINGERS 11
+#define CY8CTMG110_GESTURE 12
+#define CY8CTMG110_VERSIONID 13 //not supported in touchpanel FW
+#define CY8CTMG110_REG_MAX 13
+
+#ifdef POLL_TOUCH_EVENTS
+ #define CY8CTMG110_POLL_TIMER_DELAY 1000*1000*100
+ #define TOUCH_MAX_I2C_FAILS 50
+#endif
+
+#define CY8CTMG110_POLL_TIMER_DELAY 1000*1000*100
+
+/* Scale factors for coordinates */
+#define X_SCALE_FACTOR 9387/8424
+#define Y_SCALE_FACTOR 97/100
+
+/* For tracing */
+static u16 g_y_trace_coord = 0;
+
+/*if soutcanyon*/
+static bool isSc = false;
+
+
+/*
+ * Touchtype
+ */
+enum touch_type {
+ TOUCH_KOSKI=1,
+ TOUCH_SC,
+ TOUCH_EXT,
+};
+
+/*
+ * The touch position structure.
+ */
+struct ts_event {
+ int x1;
+ int y1;
+ int x2;
+ int y2;
+ bool event_sended;
+};
+
+/*
+ * The touch driver structure.
+ */
+struct cy8ctmg110 {
+ struct input_dev *input;
+ char phys[32];
+ struct ts_event tc;
+ struct i2c_client *client;
+ bool pending;
+ spinlock_t lock;
+ bool initController;
+ bool sleepmode;
+ int irq_gpio;
+ int reset_gpio;
+ char driver_name[20];
+ struct delayed_work work;
+ enum touch_type version_id;
+#ifdef POLL_TOUCH_EVENTS
+ struct hrtimer timer;
+ int i2c_fail_count;
+#endif
+};
+
+/*
+ * cy8ctmg110_poweroff is the routine that is called when touch hardware
+ * will powered off
+ */
+static void cy8ctmg110_power(struct cy8ctmg110 *ts,bool poweron)
+{
+#ifdef CY8CTMG110_DEBUG_INFO
+ printk("%s power:%d\n",ts->driver_name,poweron);
+#endif
+ if (poweron)
+ gpio_direction_output(ts->reset_gpio, 0);
+ else
+ gpio_direction_output(ts->reset_gpio, 1);
+}
+/*
+ * cy8ctmg110_write_req write regs to the i2c devices
+ *
+ */
+static int cy8ctmg110_write_req(struct cy8ctmg110 *tsc,unsigned char reg,unsigned char len,unsigned char *value)
+{
+ struct i2c_client *client = tsc->client;
+ unsigned int ret;
+ unsigned char i2c_data[]={0,0,0,0,0,0};
+#ifdef CY8CTMG110_DEBUG_INFO
+ printk("cy8ctmg110_init_req:\n");
+#endif
+
+ i2c_data[0]=reg;
+ memcpy(i2c_data+1,value,len);
+
+ {
+ struct i2c_msg msg[] = {
+ { client->addr, 0, len+1, i2c_data },
+ };
+
+ ret = i2c_transfer(client->adapter, msg, 1);
+
+ if (ret != 1) {
+ printk("cy8ctmg110 touch : i2c write data cmd failed \n");
+ return ret;
+ }
+ }
+
+ return 0;
+}
+/*
+ * get_time
+ *
+ */
+#ifdef CY8CTMG110_DEBUG_INFO
+static inline long cy8ctmg110_get_time(void)
+{
+ struct timeval t;
+ do_gettimeofday(&t);
+ return t.tv_usec;
+}
+#endif
+/*
+ * cy8ctmg110_read_req read regs from i2c devise
+ *
+ */
+static int cy8ctmg110_read_req(struct cy8ctmg110 *tsc,unsigned char *i2c_data,unsigned char len ,unsigned char cmd)
+{
+ struct i2c_client *client = tsc->client;
+ unsigned int ret;
+ unsigned char regs_cmd[2]={0,0};
+#ifdef CY8CTMG110_DEBUG_INFO
+ long starttime = cy8ctmg110_get_time();
+#endif
+ regs_cmd[0]=cmd;
+
+
+ /* first write slave position to i2c devices*/
+ {
+ struct i2c_msg msg1[] = {
+ { client->addr, 0, 1, regs_cmd },
+ };
+
+ ret = i2c_transfer(client->adapter, msg1, 1);
+
+ if (ret != 1) {
+#ifdef POLL_TOUCH_EVENTS
+ tsc->i2c_fail_count++;
+#endif
+ return ret;
+ }
+ }
+
+
+ /* Second read data from position*/
+ {
+ struct i2c_msg msg2[] = {
+ { client->addr, I2C_M_RD, len, i2c_data },
+ };
+
+ ret = i2c_transfer(client->adapter, msg2, 1);
+
+
+ if (ret != 1) {
+#ifdef POLL_TOUCH_EVENTS
+ tsc->i2c_fail_count++;
+#endif
+ return ret;
+ }
+ }
+#ifdef CY8CTMG110_DEBUG_INFO
+ printk("%s time to get data bytes read:%d time:%d\n",tsc->driver_name,len,(cy8ctmg110_get_time()-starttime));
+#endif
+ return 0;
+}
+/*
+ * cy8ctmg110_send_event delevery touch event to the userpace
+ * function use normal input interface
+ */
+static void cy8ctmg110_send_event(void *tsc,int x,int y)
+{
+ struct cy8ctmg110 *ts = tsc;
+ struct input_dev *input = ts->input;
+ u16 x2, y2;
+#ifdef CY8CTMG110_DEBUG_INFO
+ printk("cy8ctmg110_send_event\n");
+#endif
+
+ if(ts->tc.event_sended == false){
+
+ if (ts->client->addr==CY8CTMG110_I2C_ADDR_EXT){
+ /*Extended touchpanel*/
+ input_report_key(input, BTN_TOUCH, 1);
+
+
+ if ( ts->pending == true){
+ input_report_rel(input, REL_Y, (ts->tc.x1-x)*2);
+ input_report_rel(input, REL_X, (y - ts->tc.y1)*3);
+ ts->tc.y1 = y;
+ ts->tc.x1 = x;
+ }
+ else{
+ ts->pending = true;
+ ts->tc.y1 = y;
+ ts->tc.x1 = x;
+ }
+
+
+ }
+ else{
+ /*Main touchpanel*/
+ ts->tc.y1 = y;
+ ts->tc.x1 = x;
+ ts->pending = true;
+ input_report_key(input, BTN_TOUCH, 1);
+
+ x2 = y;
+ y2 = x;
+
+ if (isSc == false){
+ /*Main touchpanel in koski*/
+ x2 = (u16)(y*X_SCALE_FACTOR);
+ y2 = (u16)(x*Y_SCALE_FACTOR);
+ }
+
+ input_report_abs(input, ABS_X, x2);
+ input_report_abs(input, ABS_Y, y2);
+ }
+
+ input_sync(input);
+ if(g_y_trace_coord)
+ printk("%s touch position X:%d (was = %d) Y:%d (was = %d)\n",ts->driver_name, x2, y, y2, x);
+ }
+
+}
+
+/*
+ * cy8ctmg110_touch_pos check touch position from i2c devices
+ *
+ */
+static int cy8ctmg110_touch_pos(struct cy8ctmg110 *tsc)
+{
+ unsigned char reg_p[CY8CTMG110_REG_MAX];
+
+ memset(reg_p,0,CY8CTMG110_REG_MAX);
+
+ /*Reading coordinates*/
+ if (cy8ctmg110_read_req(tsc,reg_p,1,CY8CTMG110_FINGERS)==0){
+
+ /*number of touch*/
+ if (reg_p[0]==0){
+ if (tsc->pending == true){
+ struct input_dev *input = tsc->input;
+
+ input_report_key(input, BTN_TOUCH, 0);
+
+ input_sync(input);
+ tsc->tc.event_sended = true;
+#ifdef CY8CTMG110_DEBUG_INFO
+ printk("cy8ctmg110_send_event ts->pending = true;\n");
+#endif
+ tsc->pending = false;
+ }
+ }
+ else {
+
+ if (cy8ctmg110_read_req(tsc,reg_p,4,CY8CTMG110_TOUCH_X1)==0){
+ int x = 0,y = 0;
+ y = reg_p[2]<<8 | reg_p[3];
+ x = reg_p[0]<<8 | reg_p[1];
+
+ if (tsc->tc.x1 != x || tsc->tc.y1 != y){
+ tsc->tc.event_sended = false;
+ cy8ctmg110_send_event(tsc,x,y);
+ }
+ }
+ }
+ }
+ else{
+#ifdef CY8CTMG110_DEBUG_INFO
+ printk("cy8ctmg110 i2c reading error\n");
+#endif
+ }
+
+ return 0;
+}
+/*
+ * cy8ctmg110_read_versionid delevery touch event to the userpace
+ * function use normal input interface
+ */
+static void cy8ctmg110_read_versionid(void *tsc)
+{
+ struct cy8ctmg110 *ts = tsc;
+ unsigned char reg_p[2];
+
+
+ if (cy8ctmg110_read_req(ts,reg_p,1,CY8CTMG110_VERSIONID)==0){
+ printk("%s id 0x%x\n",ts->driver_name,reg_p[0]);
+
+ /*Ugly hack solution if SC
+ */
+
+ if(ts->client->addr==CY8CTMG110_I2C_ADDR_EXT)
+ isSc = true;
+
+ switch (reg_p[0]){
+ case 0x01:
+ ts->version_id = TOUCH_EXT;
+ break;
+ case 0x02:
+ ts->version_id = TOUCH_SC;
+ break;
+ case 0x03:
+ ts->version_id = TOUCH_KOSKI;
+ break;
+ default:
+ ts->version_id = TOUCH_KOSKI;
+ break;
+ }
+ }
+}
+
+
+#ifdef POLL_TOUCH_EVENTS
+/*
+ * if interup is'n in use the touch positions can reads by polling
+ *
+ */
+static enum hrtimer_restart cy8ctmg110_timer(struct hrtimer *handle)
+{
+ struct cy8ctmg110 *ts = container_of(handle, struct cy8ctmg110, timer);
+ unsigned long flags;
+
+ spin_lock_irqsave(&ts->lock, flags);
+#ifdef CY8CTMG110_DEBUG_INFO
+ printk("cy8ctmg110_timer\n");
+#endif
+
+ cy8ctmg110_touch_pos(ts);
+
+ if (ts->i2c_fail_count<TOUCH_MAX_I2C_FAILS)
+ hrtimer_start(&ts->timer, ktime_set(0, CY8CTMG110_POLL_TIMER_DELAY),
+ HRTIMER_MODE_REL);
+
+ spin_unlock_irqrestore(&ts->lock, flags);
+
+ return HRTIMER_NORESTART;
+}
+#endif
+/*
+ * cy8ctmg110_init_controller set init value to touchcontroller
+ *
+ */
+static bool cy8ctmg110_set_sleepmode(struct cy8ctmg110 *ts)
+{
+ unsigned char reg_p[3];
+
+ if(ts->sleepmode==true){
+ reg_p[0] = 0x00; reg_p[1] =0xff; reg_p[2] =5;
+ }else{
+ reg_p[0] = 0x10;reg_p[1] =0xff;reg_p[2] =0;
+ }
+
+ if (cy8ctmg110_write_req(ts,CY8CTMG110_TOUCH_WAKEUP_TIME,3,reg_p)){
+ return false;
+ }
+ ts->initController = true;
+
+ return true;
+}
+
+
+
+static void cy8ctmg110_work(struct work_struct *work)
+{
+ struct cy8ctmg110 *ts =
+ container_of(to_delayed_work(work), struct cy8ctmg110, work);
+
+ cy8ctmg110_touch_pos(ts);
+}
+
+
+/*
+ * cy8ctmg110_irq_handler irq handling function
+ *
+ */
+static irqreturn_t cy8ctmg110_irq_handler(int irq, void *handle)
+{
+ struct cy8ctmg110 * tsc = (struct cy8ctmg110 *)handle;
+
+#ifdef CY8CTMG110_DEBUG_INFO
+ printk("%s cy8ctmg110_irq_handler\n",tsc->driver_name);
+#endif
+ if (tsc->initController == false){
+ if (cy8ctmg110_set_sleepmode(tsc) == true)
+ tsc->initController = true;
+ }
+ else
+ {
+ schedule_delayed_work(&tsc->work,
+ msecs_to_jiffies(1));
+ }
+
+#ifdef POLL_TOUCH_EVENTS
+ /*if interrupt supported in the touch controller
+ timer polling need to stop*/
+ tsc->i2c_fail_count = TOUCH_MAX_I2C_FAILS;
+#endif
+ return IRQ_HANDLED;
+}
+
+
+static int cy8ctmg110_probe(struct i2c_client *client,
+ const struct i2c_device_id *id)
+{
+ struct cy8ctmg110 *ts;
+ struct input_dev *input_dev;
+ int err;
+
+ if (!i2c_check_functionality(client->adapter,
+ I2C_FUNC_SMBUS_READ_WORD_DATA))
+ return -EIO;
+
+ ts = kzalloc(sizeof(struct cy8ctmg110), GFP_KERNEL);
+ input_dev = input_allocate_device();
+
+ if (!ts || !input_dev) {
+ err = -ENOMEM;
+ goto err_free_mem;
+ }
+
+ ts->client = client;
+ i2c_set_clientdata(client, ts);
+
+ ts->input = input_dev;
+ ts->pending = false;
+ ts->sleepmode = false;
+
+
+ if(client->addr==CY8CTMG110_I2C_ADDR){
+ ts->reset_gpio = CY8CTMG110_RESET_PIN_GPIO;
+ input_dev->name = CY8CTMG110_DRIVER_NAME" Touchscreen";
+ snprintf(ts->driver_name, sizeof(ts->driver_name),"%s", CY8CTMG110_DRIVER_NAME);
+ }
+ else if (client->addr==CY8CTMG110_I2C_ADDR_EXT){
+ ts->reset_gpio = CY8CTMG110_RESET_PIN_GPIO_EXT;
+ input_dev->name = CY8CTMG110_DRIVER_NAME_EXT" Touchscreen";
+ snprintf(ts->driver_name, sizeof(ts->driver_name),"%s", CY8CTMG110_DRIVER_NAME_EXT);
+ }
+
+ snprintf(ts->phys, sizeof(ts->phys),
+ "%s/input0", dev_name(&client->dev));
+
+ INIT_DELAYED_WORK(&ts->work, cy8ctmg110_work);
+
+ input_dev->phys = ts->phys;
+ input_dev->id.bustype = BUS_I2C;
+
+ spin_lock_init(&ts->lock);
+
+ input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) |
+ BIT_MASK(EV_REL) | BIT_MASK(EV_ABS);
+
+ input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
+
+ input_set_capability(input_dev, EV_KEY, KEY_F);
+
+
+ input_set_abs_params(input_dev, ABS_X, CY8CTMG110_X_MIN, CY8CTMG110_X_MAX, 0, 0);
+ input_set_abs_params(input_dev, ABS_Y, CY8CTMG110_Y_MIN, CY8CTMG110_Y_MAX, 0, 0);
+ input_dev->relbit[BIT_WORD(REL_X)] = BIT_MASK(REL_X)| BIT_MASK(REL_Y);
+
+ err = gpio_request(ts->reset_gpio, NULL);
+
+ if (err) {
+ printk("GPIO pin %d failed to request.\n", ts->reset_gpio);
+ goto err_free_thread;
+ }
+
+ cy8ctmg110_power(ts,true);
+
+ ts->initController = false;
+#ifdef POLL_TOUCH_EVENTS
+ ts->i2c_fail_count = 0;
+ hrtimer_init(&ts->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+ ts->timer.function = cy8ctmg110_timer;
+
+ hrtimer_start(&ts->timer, ktime_set(10, 0),
+ HRTIMER_MODE_REL);
+#endif
+ err = gpio_request(client->irq, "touch_irq_key");
+
+ if (err < 0) {
+ printk("%s gpio-keys: failed to request GPIO %d,"
+ " error %d\n",ts->driver_name,client->irq, err);
+ goto err_free_thread;
+ }
+
+ err= gpio_direction_input(client->irq);
+
+ if (err < 0) {
+ pr_err("%s gpio-keys: failed to configure input"
+ " direction for GPIO %d, error %d\n",ts->driver_name,client->irq, err);
+ gpio_free(client->irq);
+ goto err_free_thread;
+ }
+
+ ts->irq_gpio = gpio_to_irq(client->irq);
+
+ if (ts->irq_gpio < 0) {
+ err = ts->irq_gpio;
+ pr_err("cy8ctmg110 gpio-keys: Unable to get irq number"
+ " for GPIO %d, error %d\n",
+ ts->irq_gpio, err);
+ gpio_free(ts->irq_gpio);
+ goto err_free_thread;
+ }
+
+ if (client->addr!=CY8CTMG110_I2C_ADDR_EXT){
+ err = request_irq(ts->irq_gpio, cy8ctmg110_irq_handler,
+ IRQF_TRIGGER_RISING | IRQF_SHARED,
+ "touch_reset_key",
+ ts);
+ }
+
+ if (err < 0) {
+ dev_err(&client->dev, "cy8ctmg110 irq %d busy? error %d\n", ts->irq_gpio ,err);
+ goto err_free_thread;
+ }
+
+ err = input_register_device(input_dev);
+ cy8ctmg110_read_versionid(ts);
+
+ if (err)
+ goto err_free_irq;
+
+ return 0;
+
+ err_free_irq:
+ printk("%s err_free_irq\n",ts->driver_name);
+ free_irq(client->irq, ts);
+ err_free_thread:
+ printk("%s err_free_thread\n",ts->driver_name);
+ err_free_mem:
+ printk("%s err_free_mem\n",ts->driver_name);
+ input_free_device(input_dev);
+ kfree(ts);
+
+ return err;
+}
+/*
+ * cy8ctmg110_suspend
+ *
+ */
+static int cy8ctmg110_suspend(struct i2c_client *client, pm_message_t mesg)
+{
+ if (device_may_wakeup(&client->dev))
+ enable_irq_wake(client->irq);
+
+ return 0;
+}
+/*
+ * cy8ctmg110_resume
+ *
+ */
+static int cy8ctmg110_resume(struct i2c_client *client)
+{
+ if (device_may_wakeup(&client->dev))
+ disable_irq_wake(client->irq);
+
+ return 0;
+}
+/*
+ * cy8ctmg110_remove
+ *
+ */
+static int cy8ctmg110_remove(struct i2c_client *client)
+{
+ struct cy8ctmg110 *ts = i2c_get_clientdata(client);
+
+#ifdef CY8CTMG110_DEBUG_INFO
+ printk("cy8ctmg110_remove\n");
+#endif
+
+ cy8ctmg110_power(ts,false);
+#ifdef POLL_TOUCH_EVENTS
+ hrtimer_cancel(&ts->timer);
+#endif
+
+ free_irq(client->irq, ts);
+ input_unregister_device(ts->input);
+ kfree(ts);
+
+ return 0;
+}
+
+static struct i2c_device_id cy8ctmg110_idtable[] = {
+ { CY8CTMG110_DRIVER_NAME, 1 },
+ { CY8CTMG110_DRIVER_NAME_EXT, 1 },
+ { }
+};
+
+MODULE_DEVICE_TABLE(i2c, cy8ctmg110_idtable);
+
+static struct i2c_driver cy8ctmg110_driver = {
+ .driver = {
+ .owner = THIS_MODULE,
+ .name = CY8CTMG110_DRIVER_NAME,
+ .bus = &i2c_bus_type,
+ },
+ .id_table = cy8ctmg110_idtable,
+ .probe = cy8ctmg110_probe,
+ .remove = cy8ctmg110_remove,
+ .suspend = cy8ctmg110_suspend,
+ .resume = cy8ctmg110_resume,
+};
+
+
+static int __init cy8ctmg110_init(void)
+{
+ printk("cy8ctmg110_init\n");
+
+ return i2c_add_driver(&cy8ctmg110_driver);
+}
+
+static void __exit cy8ctmg110_exit(void)
+{
+#ifdef CY8CTMG110_DEBUG_INFO
+ printk("cy8ctmg110_exit\n");
+#endif
+ i2c_del_driver(&cy8ctmg110_driver);
+}
+
+module_init(cy8ctmg110_init);
+module_exit(cy8ctmg110_exit);
+
+
+struct i2c_board_info __initdata koski_i2c_board_info2[] = {
+ {
+ I2C_BOARD_INFO(CY8CTMG110_DRIVER_NAME, CY8CTMG110_I2C_ADDR),
+ .irq = CY8CTMG110_IRQ_PIN_GPIO
+ },
+ {
+ I2C_BOARD_INFO(CY8CTMG110_DRIVER_NAME_EXT, CY8CTMG110_I2C_ADDR_EXT),
+ .irq = CY8CTMG110_IRQ_PIN_GPIO_EXT
+ },
+};
+
+
+static int __init koski_i2c_init(void)
+{
+ printk("init koski board\n");
+
+#ifdef MOORESTOWN_CDK
+ /*init koski i2c*/
+ i2c_register_board_info(1, koski_i2c_board_info2,
+ ARRAY_SIZE(koski_i2c_board_info2));
+#else
+ /*init koski i2c*/
+ i2c_register_board_info(0, koski_i2c_board_info2,
+ ARRAY_SIZE(koski_i2c_board_info2));
+#endif
+ return 0;
+}
+
+module_init(koski_i2c_init);
+
+MODULE_AUTHOR("Samuli Konttila <samuli.konttila@aavamobile.com>");
+MODULE_DESCRIPTION("cy8ctmg110 TouchScreen Driver");
+MODULE_LICENSE("GPL v2");
+
+
+// Aava access from sysfs begin
+static ssize_t aava_query_fw_info_func(struct class *class, char *buf)
+{
+ ssize_t status;
+ int i = 0;
+ unsigned char mrst_fw_ver_info[16];
+
+ printk("!!! aava_query_fw_info_func() ENTER\n");
+
+ status = mrst_get_firmware_version(mrst_fw_ver_info);
+ for (i = 0; i < 16; i++){
+ printk("%x\n", mrst_fw_ver_info[i]);
+ buf[i] = mrst_fw_ver_info[i];
+ }
+
+ return 16;
+}
+
+static ssize_t aava_enable_touch_traces_func(struct class *class, \
+ const char *buf, size_t len)
+{
+ ssize_t status;
+ unsigned long value;
+
+ status = strict_strtoul(buf, 0, &value);
+ printk("!!! aava_enable_touch_traces_func() = %d\n", (int)value);
+
+ g_y_trace_coord = value;
+
+ return len;
+}
+
+static struct class_attribute aava_class_attrs[] = {
+ __ATTR(aava_query_fw_info, 0444, aava_query_fw_info_func, NULL),
+ __ATTR(aava_enable_touch_traces, 0200, NULL, aava_enable_touch_traces_func),
+ __ATTR_NULL,
+};
+
+static struct class aava_class = {
+ .name = "aava",
+ .owner = THIS_MODULE,
+
+ .class_attrs = aava_class_attrs,
+};
+
+static int __init aava_sysfs_init(void)
+{
+ int status;
+
+ status = class_register(&aava_class);
+ if (status < 0)
+ return status;
+
+ return status;
+}
+postcore_initcall(aava_sysfs_init);
+// Aava access from sysfs end
--
1.6.2.2

View File

@ -1,67 +0,0 @@
Subject: [3/3] drm/i915: Ignore LVDS EDID when it is unavailabe or invalid
Date: Thu, 04 Mar 2010 08:17:31 -0000
From: Zhenyu Wang <zhenyuw@linux.intel.com>
Patch-mainline: 2.6.34
References: https://patchwork.kernel.org/patch/83556/, BMC# 331
From: Zhao Yakui <yakui.zhao@intel.com>
In course of probing the display mode for LVDS, we will firstly try to
check the EDID for LVDS panel. But on some laptops the EDID is invalid for
the LVDS panel. In such case it will complain the invalida EDID warning
message and print the EDID raw data every time when probing the LVDS mode.
https://bugs.freedesktop.org/show_bug.cgi?id=23099
https://bugs.freedesktop.org/show_bug.cgi?id=26395
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Tested-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Acked-by: Yin Kangkai <kangkai.yin@intel.com>
---
drivers/gpu/drm/i915/i915_drv.h | 2 ++
drivers/gpu/drm/i915/intel_lvds.c | 13 +++++++++----
2 files changed, 11 insertions(+), 4 deletions(-)
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -581,6 +581,8 @@ typedef struct drm_i915_private {
/* Reclocking support */
bool render_reclock_avail;
bool lvds_downclock_avail;
+ /* indicate whether the LVDS EDID is OK */
+ bool lvds_edid_ok;
/* indicates the reduced downclock for LVDS*/
int lvds_downclock;
struct work_struct idle_work;
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -680,10 +680,13 @@ static int intel_lvds_get_modes(struct d
struct drm_i915_private *dev_priv = dev->dev_private;
int ret = 0;
- ret = intel_ddc_get_modes(intel_output);
+ if (dev_priv->lvds_edid_ok) {
+ ret = intel_ddc_get_modes(intel_output);
+ if (ret)
+ return ret;
- if (ret)
- return ret;
+ dev_priv->lvds_edid_ok = false;
+ }
/* Didn't get an EDID, so
* Set wide sync ranges so we get all modes
@@ -1097,7 +1100,9 @@ void intel_lvds_init(struct drm_device *
* Attempt to get the fixed panel mode from DDC. Assume that the
* preferred mode is the right one.
*/
- intel_ddc_get_modes(intel_output);
+ dev_priv->lvds_edid_ok = true;
+ if (!intel_ddc_get_modes(intel_output))
+ dev_priv->lvds_edid_ok = false;
list_for_each_entry(scan, &connector->probed_modes, head) {
mutex_lock(&dev->mode_config.mutex);

View File

@ -1,76 +0,0 @@
From 3589c3e0ec88c19c330b88f7d37c8092987866e6 Mon Sep 17 00:00:00 2001
From: Priya Vijayan <priya.vijayan@intel.com>
Date: Fri, 30 Apr 2010 11:11:10 -0700
Subject: [PATCH] Enable hid-dg-contactcount in stantum and cando touch drivers
Enable hid-dg-contact count in stantum and cando touch drivers to be able to use with mtdev driver
Patch-mainline: 2.6.34
Signed-off-by: Priya Vijayan <priya.vijayan@intel.com>
---
drivers/hid/hid-cando.c | 8 ++++++++
drivers/hid/hid-stantum.c | 11 ++++++++++-
2 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/drivers/hid/hid-cando.c b/drivers/hid/hid-cando.c
index ed8c093..42b9980 100644
--- a/drivers/hid/hid-cando.c
+++ b/drivers/hid/hid-cando.c
@@ -64,6 +64,10 @@ static int cando_input_mapping(struct hid_device *hdev, struct hid_input *hi,
case HID_DG_TIPSWITCH:
case HID_DG_CONTACTMAX:
return -1;
+ case HID_DG_CONTACTCOUNT:
+ hid_map_usage(hi, usage, bit, max,
+ EV_ABS, ABS_MT_CONTACT_COUNT);
+ return 1;
case HID_DG_INRANGE:
/* touchscreen emulation */
hid_map_usage(hi, usage, bit, max, EV_KEY, BTN_TOUCH);
@@ -169,6 +173,10 @@ static int cando_event(struct hid_device *hid, struct hid_field *field,
struct input_dev *input = field->hidinput->input;
switch (usage->hid) {
+ case HID_DG_CONTACTCOUNT:
+ input_event(input,EV_ABS,ABS_MT_CONTACT_COUNT,value);
+ //input_mt_sync(input);
+ break;
case HID_DG_INRANGE:
td->valid = value;
break;
diff --git a/drivers/hid/hid-stantum.c b/drivers/hid/hid-stantum.c
index bb4430f..ac3df05 100644
--- a/drivers/hid/hid-stantum.c
+++ b/drivers/hid/hid-stantum.c
@@ -64,10 +64,15 @@ static int stantum_input_mapping(struct hid_device *hdev, struct hid_input *hi,
case HID_DG_CONFIDENCE:
case HID_DG_INPUTMODE:
case HID_DG_DEVICEINDEX:
- case HID_DG_CONTACTCOUNT:
+ //case HID_DG_CONTACTCOUNT:
case HID_DG_CONTACTMAX:
return -1;
+ case HID_DG_CONTACTCOUNT:
+ hid_map_usage(hi, usage, bit, max,
+ EV_ABS, ABS_MT_CONTACT_COUNT);
+ return 1;
+
case HID_DG_TIPSWITCH:
/* touchscreen emulation */
hid_map_usage(hi, usage, bit, max, EV_KEY, BTN_TOUCH);
@@ -171,6 +176,10 @@ static int stantum_event(struct hid_device *hid, struct hid_field *field,
struct input_dev *input = field->hidinput->input;
switch (usage->hid) {
+ case HID_DG_CONTACTCOUNT:
+ input_event(input,EV_ABS,ABS_MT_CONTACT_COUNT,value);
+ //input_mt_sync(input);
+ break;
case HID_DG_INRANGE:
/* this is the last field in a finger */
stantum_filter_event(sd, input);
--
1.6.2.2

View File

@ -1,58 +0,0 @@
From dd75ba1aee79abfa6948cd3b82a7a7eb97599c91 Mon Sep 17 00:00:00 2001
From: Prajwal Mohan <prajwal.karur.mohan@intel.com>
Date: Fri, 9 Apr 2010 18:18:34 -0700
Subject: [PATCH 106/106] Fixing path for marvell firmware
Patch-mainline: Friday, 9 Apr 2010 18:18:34
---
drivers/net/wireless/libertas/if_sdio.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
index 7a73f62..055a581 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -83,28 +83,28 @@ static struct if_sdio_model if_sdio_models[] = {
{
/* 8385 */
.model = IF_SDIO_MODEL_8385,
- .helper = "sd8385_helper.bin",
- .firmware = "sd8385.bin",
+ .helper = "libertas/sd8385_helper.bin",
+ .firmware = "libertas/sd8385.bin",
},
{
/* 8686 */
.model = IF_SDIO_MODEL_8686,
- .helper = "sd8686_helper.bin",
- .firmware = "sd8686.bin",
+ .helper = "libertas/sd8686_helper.bin",
+ .firmware = "libertas/sd8686.bin",
},
{
/* 8688 */
.model = IF_SDIO_MODEL_8688,
- .helper = "sd8688_helper.bin",
- .firmware = "sd8688.bin",
+ .helper = "libertas/sd8688_helper.bin",
+ .firmware = "libertas/sd8688.bin",
},
};
-MODULE_FIRMWARE("sd8385_helper.bin");
-MODULE_FIRMWARE("sd8385.bin");
-MODULE_FIRMWARE("sd8686_helper.bin");
-MODULE_FIRMWARE("sd8686.bin");
-MODULE_FIRMWARE("sd8688_helper.bin");
-MODULE_FIRMWARE("sd8688.bin");
+MODULE_FIRMWARE("libertas/sd8385_helper.bin");
+MODULE_FIRMWARE("libertas/sd8385.bin");
+MODULE_FIRMWARE("libertas/sd8686_helper.bin");
+MODULE_FIRMWARE("libertas/sd8686.bin");
+MODULE_FIRMWARE("libertas/sd8688_helper.bin");
+MODULE_FIRMWARE("libertas/sd8688.bin");
struct if_sdio_packet {
struct if_sdio_packet *next;
--
1.6.2.5

View File

@ -1,30 +0,0 @@
From 67b3a2d6716bfa9d308b26729a2cdeeffb6e8218 Mon Sep 17 00:00:00 2001
From: Prajwal Mohan <prajwal.karur.mohan@intel.com>
Date: Thu, 13 May 2010 16:39:43 -0700
Subject: [PATCH] dirty hack to fix aava camera sensor issue
Signed-off-by: Prajwal Mohan <prajwal.karur.mohan@intel.com>
Patch-mainline: 2.6.34
---
drivers/media/video/mrstci/mrstov2650/mrstov2650.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/media/video/mrstci/mrstov2650/mrstov2650.c b/drivers/media/video/mrstci/mrstov2650/mrstov2650.c
index 7f0d478..ce24139 100644
--- a/drivers/media/video/mrstci/mrstov2650/mrstov2650.c
+++ b/drivers/media/video/mrstci/mrstov2650/mrstov2650.c
@@ -1111,7 +1111,11 @@ static int ov2650_detect(struct i2c_client *client)
ov2650_wakeup();
ov2650_read(client, OV2650_PID_L, &value);
+ #ifdef CONFIG_MRST_DRM_AAVA
+ if (value != 0x66)
+ #else
if (value != 0x52)
+ #endif
return -ENODEV;
return 0;
--
1.6.2.5

View File

@ -1,142 +0,0 @@
From 5f57d67da87332a9a1ba8fa7a33bf0680e1c76e7 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Mon, 19 Apr 2010 10:37:21 -0700
Subject: [PATCH 1/2] Input: Add support of Synaptics Clickpad device
Patch-mainline: 2.6.34
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git
Git-commit: 5f57d67da87332a9a1ba8fa7a33bf0680e1c76e7
References: BMC#99
The new type of touchpads can be detected via a new query command
0x0c. The clickpad flags are in cap[0]:4 and cap[1]:0 bits.
When the device is detected, the driver now reports only the left
button as the supported buttons so that X11 driver can detect that
the device is Clickpad. A Clickpad device gives the button events
only as the middle button. The kernel driver morphs to the left
button. The real handling of Clickpad is done rather in X driver
side.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Acked-by: Jian-feng Ding <jian-feng.ding@intel.com>
---
drivers/input/mouse/synaptics.c | 35 ++++++++++++++++++++++++++++++-----
drivers/input/mouse/synaptics.h | 4 ++++
2 files changed, 34 insertions(+), 5 deletions(-)
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index d3f5243..9ab9ff0 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -136,7 +136,8 @@ static int synaptics_capability(struct psmouse *psmouse)
if (synaptics_send_cmd(psmouse, SYN_QUE_CAPABILITIES, cap))
return -1;
priv->capabilities = (cap[0] << 16) | (cap[1] << 8) | cap[2];
- priv->ext_cap = 0;
+ priv->ext_cap = priv->ext_cap_0c = 0;
+
if (!SYN_CAP_VALID(priv->capabilities))
return -1;
@@ -149,7 +150,7 @@ static int synaptics_capability(struct psmouse *psmouse)
if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 1) {
if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_CAPAB, cap)) {
printk(KERN_ERR "Synaptics claims to have extended capabilities,"
- " but I'm not able to read them.");
+ " but I'm not able to read them.\n");
} else {
priv->ext_cap = (cap[0] << 16) | (cap[1] << 8) | cap[2];
@@ -161,6 +162,16 @@ static int synaptics_capability(struct psmouse *psmouse)
priv->ext_cap &= 0xff0fff;
}
}
+
+ if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 4) {
+ if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_CAPAB_0C, cap)) {
+ printk(KERN_ERR "Synaptics claims to have extended capability 0x0c,"
+ " but I'm not able to read it.\n");
+ } else {
+ priv->ext_cap_0c = (cap[0] << 16) | (cap[1] << 8) | cap[2];
+ }
+ }
+
return 0;
}
@@ -347,7 +358,15 @@ static void synaptics_parse_hw_state(unsigned char buf[], struct synaptics_data
hw->left = (buf[0] & 0x01) ? 1 : 0;
hw->right = (buf[0] & 0x02) ? 1 : 0;
- if (SYN_CAP_MIDDLE_BUTTON(priv->capabilities)) {
+ if (SYN_CAP_CLICKPAD(priv->ext_cap_0c)) {
+ /*
+ * Clickpad's button is transmitted as middle button,
+ * however, since it is primary button, we will report
+ * it as BTN_LEFT.
+ */
+ hw->left = ((buf[0] ^ buf[3]) & 0x01) ? 1 : 0;
+
+ } else if (SYN_CAP_MIDDLE_BUTTON(priv->capabilities)) {
hw->middle = ((buf[0] ^ buf[3]) & 0x01) ? 1 : 0;
if (hw->w == 2)
hw->scroll = (signed char)(buf[1]);
@@ -592,6 +611,12 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv)
dev->absres[ABS_X] = priv->x_res;
dev->absres[ABS_Y] = priv->y_res;
+
+ if (SYN_CAP_CLICKPAD(priv->ext_cap_0c)) {
+ /* Clickpads report only left button */
+ __clear_bit(BTN_RIGHT, dev->keybit);
+ __clear_bit(BTN_MIDDLE, dev->keybit);
+ }
}
static void synaptics_disconnect(struct psmouse *psmouse)
@@ -696,10 +721,10 @@ int synaptics_init(struct psmouse *psmouse)
priv->pkt_type = SYN_MODEL_NEWABS(priv->model_id) ? SYN_NEWABS : SYN_OLDABS;
- printk(KERN_INFO "Synaptics Touchpad, model: %ld, fw: %ld.%ld, id: %#lx, caps: %#lx/%#lx\n",
+ printk(KERN_INFO "Synaptics Touchpad, model: %ld, fw: %ld.%ld, id: %#lx, caps: %#lx/%#lx/%#lx\n",
SYN_ID_MODEL(priv->identity),
SYN_ID_MAJOR(priv->identity), SYN_ID_MINOR(priv->identity),
- priv->model_id, priv->capabilities, priv->ext_cap);
+ priv->model_id, priv->capabilities, priv->ext_cap, priv->ext_cap_0c);
set_input_params(psmouse->dev, priv);
diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h
index f0f40a3..ae37c5d 100644
--- a/drivers/input/mouse/synaptics.h
+++ b/drivers/input/mouse/synaptics.h
@@ -18,6 +18,7 @@
#define SYN_QUE_SERIAL_NUMBER_SUFFIX 0x07
#define SYN_QUE_RESOLUTION 0x08
#define SYN_QUE_EXT_CAPAB 0x09
+#define SYN_QUE_EXT_CAPAB_0C 0x0c
/* synatics modes */
#define SYN_BIT_ABSOLUTE_MODE (1 << 7)
@@ -48,6 +49,8 @@
#define SYN_CAP_VALID(c) ((((c) & 0x00ff00) >> 8) == 0x47)
#define SYN_EXT_CAP_REQUESTS(c) (((c) & 0x700000) >> 20)
#define SYN_CAP_MULTI_BUTTON_NO(ec) (((ec) & 0x00f000) >> 12)
+#define SYN_CAP_PRODUCT_ID(ec) (((ec) & 0xff0000) >> 16)
+#define SYN_CAP_CLICKPAD(ex0c) ((ex0c) & 0x100100)
/* synaptics modes query bits */
#define SYN_MODE_ABSOLUTE(m) ((m) & (1 << 7))
@@ -96,6 +99,7 @@ struct synaptics_data {
unsigned long int model_id; /* Model-ID */
unsigned long int capabilities; /* Capabilities */
unsigned long int ext_cap; /* Extended Capabilities */
+ unsigned long int ext_cap_0c; /* Ext Caps from 0x0c query */
unsigned long int identity; /* Identification */
int x_res; /* X resolution in units/mm */
int y_res; /* Y resolution in units/mm */
--
1.6.3.3

View File

@ -1,462 +0,0 @@
Index: linux-2.6.33/drivers/hwmon/Kconfig
===================================================================
--- linux-2.6.33.orig/drivers/hwmon/Kconfig
+++ linux-2.6.33/drivers/hwmon/Kconfig
@@ -63,6 +63,13 @@ config SENSORS_EMC1403
Threshold values can be configured using sysfs.
Data from the different diode are accessible via sysfs.
+config SENSORS_MRST_ANALOG_ACCEL
+ tristate "Moorestown Analog Accelerometer"
+ depends on LNW_IPC
+ help
+ If you say yes here you get support for the Analog Accelerometer Devices
+ x y Z data can be accessed via sysfs.
+
config HWMON_DEBUG_CHIP
bool "Hardware Monitoring Chip debugging messages"
default n
Index: linux-2.6.33/drivers/hwmon/Makefile
===================================================================
--- linux-2.6.33.orig/drivers/hwmon/Makefile
+++ linux-2.6.33/drivers/hwmon/Makefile
@@ -103,6 +103,7 @@ obj-$(CONFIG_SENSORS_ISL29020) += isl290
obj-$(CONFIG_SENSORS_HMC6352) += hmc6352.o
obj-$(CONFIG_SENSORS_LIS331DL) += lis331dl.o
obj-$(CONFIG_SENSORS_EMC1403) += emc1403.o
+obj-$(CONFIG_SENSORS_MRST_ANALOG_ACCEL) += mrst_analog_accel.o
ifeq ($(CONFIG_HWMON_DEBUG_CHIP),y)
EXTRA_CFLAGS += -DDEBUG
Index: linux-2.6.33/drivers/hwmon/mrst_analog_accel.c
===================================================================
--- /dev/null
+++ linux-2.6.33/drivers/hwmon/mrst_analog_accel.c
@@ -0,0 +1,381 @@
+/*
+ * mrst_analog_accel.c - Intel analog accelerometer driver for Moorestown
+ *
+ * Copyright (C) 2009 Intel Corp
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ * 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; version 2 of the License.
+ *
+ * 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/init.h>
+#include <linux/slab.h>
+#include <linux/i2c.h>
+#include <linux/hwmon.h>
+#include <linux/hwmon-sysfs.h>
+#include <linux/hwmon-vid.h>
+#include <linux/err.h>
+#include <linux/delay.h>
+#include <asm/ipc_defs.h>
+
+MODULE_AUTHOR("Ramesh Agarwal");
+MODULE_DESCRIPTION("Intel Moorestown Analog Accelerometer Driver");
+MODULE_LICENSE("GPL v2");
+
+/* PMIC ADC INTERRUPT REGISTERS */
+#define PMIC_ADC_ACC_REG_ADCINT 0x5F /*ADC interrupt register */
+#define PMIC_ADC_ACC_REG_MADCINT 0x60 /*ADC interrupt mask register */
+
+/* PMIC ADC CONTROL REGISTERS */
+#define PMIC_ADC_ACC_REG_ADCCNTL1 0x61 /*ADC control register */
+#define PMIC_ADC_ACC_REG_ADCCNTL2 0x62 /*ADC gain regs channel 10-17 */
+#define PMIC_ADC_ACC_REG_ADCCNTL3 0x63 /*ADC gain regs channel 18-21 */
+
+/* PMIC Data Register base */
+#define PMIC_ADC_DATA_REG_BASE 0x64
+
+/* PMIC Channel Mapping Register base */
+#define PMIC_ADC_MAPPING_BASE 0xA4
+
+/* Number of PMIC sample registers */
+#define PMIC_ADC_REG_MAX 32 /* Max no of available channel */
+
+#define PMIC_ADC_X_REG_HIGH(index) (PMIC_ADC_DATA_REG_BASE \
+ + (index * 2))
+#define PMIC_ADC_X_REG_LOW(index) (PMIC_ADC_DATA_REG_BASE \
+ + (index * 2) + 1)
+#define PMIC_ADC_Y_REG_HIGH(index) (PMIC_ADC_DATA_REG_BASE \
+ + (index * 2) + 2)
+#define PMIC_ADC_Y_REG_LOW(index) (PMIC_ADC_DATA_REG_BASE \
+ + (index * 2) + 3)
+#define PMIC_ADC_Z_REG_HIGH(index) (PMIC_ADC_DATA_REG_BASE \
+ + (index * 2) + 4)
+#define PMIC_ADC_Z_REG_LOW(index) (PMIC_ADC_DATA_REG_BASE \
+ + (index * 2) + 5)
+
+/* Number of registers to read at a time */
+#define REG_READ_PER_IPC 4 /* Read 4 at a time although the */
+ /* IPC will support max 5 */
+
+#define END_OF_CHANNEL_VALUE 0x1F /* Used to indicate the last */
+ /* channel being used */
+
+/* PMIC ADC channels for Accelero Meter */
+#define PMIC_ADC_ACC_ADC_ACC_CH14 0xE
+#define PMIC_ADC_ACC_ADC_ACC_CH15 0xF
+#define PMIC_ADC_ACC_ADC_ACC_CH16 0x10
+
+static unsigned int mrst_analog_reg_idx;
+
+/* Use IPC to read the value of the register and display
+ * X value
+ */
+static ssize_t
+mrst_analog_accel_x_axis_data_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ unsigned int ret_val;
+ struct ipc_pmic_reg_data ipc_data;
+
+ ipc_data.ioc = FALSE; /* No need to generate MSI */
+ ipc_data.num_entries = 2;
+ ipc_data.pmic_reg_data[0].register_address =
+ PMIC_ADC_X_REG_HIGH(mrst_analog_reg_idx); /* X Higher 8 bits */
+ ipc_data.pmic_reg_data[1].register_address =
+ PMIC_ADC_X_REG_LOW(mrst_analog_reg_idx); /* X lower 3 bits */
+ if (ipc_pmic_register_read(&ipc_data) != 0) {
+ printk(KERN_ALERT
+ "\nmrst_analog_accel:PMIC reg read using IPC failed\n");
+ return -1;
+ }
+ ret_val = ipc_data.pmic_reg_data[0].value << 3; /* X higher 8 bits */
+ /* lower 3 bits */
+ ret_val = ret_val | (ipc_data.pmic_reg_data[1].value & 0x07);
+ return sprintf(buf, "%d\n", ret_val);
+}
+
+/* Use IPC to read the value of the register and display
+ * Y value */
+static ssize_t
+mrst_analog_accel_y_axis_data_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ unsigned int ret_val;
+ struct ipc_pmic_reg_data ipc_data;
+
+ ipc_data.ioc = FALSE; /* No need to generate MSI */
+ ipc_data.num_entries = 2;
+ ipc_data.pmic_reg_data[0].register_address =
+ PMIC_ADC_Y_REG_HIGH(mrst_analog_reg_idx); /* Y higher 8 bits */
+ ipc_data.pmic_reg_data[1].register_address =
+ PMIC_ADC_Y_REG_LOW(mrst_analog_reg_idx); /* Y lower 3 bits */
+ if (ipc_pmic_register_read(&ipc_data) != 0) {
+ printk(KERN_ALERT
+ "\nmrst_analog_accel:PMIC reg read using IPC failed\n");
+ return -1;
+ }
+ ret_val = ipc_data.pmic_reg_data[0].value << 3; /* Y higher 8 bits */
+ /* Y lower 3 bits */
+ ret_val = ret_val | (ipc_data.pmic_reg_data[1].value & 0x07);
+ return sprintf(buf, "%d\n", ret_val);
+}
+
+/* Use IPC to read the value of the register and display
+ * Z value */
+static ssize_t
+mrst_analog_accel_z_axis_data_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ unsigned int ret_val;
+ struct ipc_pmic_reg_data ipc_data;
+
+ ipc_data.ioc = FALSE; /* No need to generate MSI */
+ ipc_data.num_entries = 2;
+ ipc_data.pmic_reg_data[0].register_address =
+ PMIC_ADC_Z_REG_HIGH(mrst_analog_reg_idx);
+ ipc_data.pmic_reg_data[1].register_address =
+ PMIC_ADC_Z_REG_LOW(mrst_analog_reg_idx); /* Z lower 3 bits */
+ if (ipc_pmic_register_read(&ipc_data) != 0) {
+ printk(KERN_ALERT
+ "\nmrst_analog_accel:PMIC reg read using IPC failed\n");
+ return -1;
+ }
+ ret_val = ipc_data.pmic_reg_data[0].value << 3; /* Z higher 8 bits */
+ /* Z lower 3 bits */
+ ret_val = ret_val | (ipc_data.pmic_reg_data[1].value & 0x07);
+ return sprintf(buf, "%d\n", ret_val);
+}
+
+
+static DEVICE_ATTR(acc_x_axis, S_IRUGO,
+ mrst_analog_accel_x_axis_data_show, NULL);
+static DEVICE_ATTR(acc_y_axis, S_IRUGO,
+ mrst_analog_accel_y_axis_data_show, NULL);
+static DEVICE_ATTR(acc_z_axis, S_IRUGO,
+ mrst_analog_accel_z_axis_data_show, NULL);
+
+static struct attribute *mid_att_acc[] = {
+ &dev_attr_acc_x_axis.attr,
+ &dev_attr_acc_y_axis.attr,
+ &dev_attr_acc_z_axis.attr,
+ NULL
+};
+
+static struct attribute_group m_analog_gr = {
+ .name = "mrst_analog_accel",
+ .attrs = mid_att_acc
+};
+
+static int
+mrst_analog_accel_initialize(void)
+{
+ struct ipc_pmic_mod_reg_data ipc_mod_data;
+ struct ipc_pmic_reg_data ipc_data;
+ u8 retval = 0;
+ u8 mad_cntrl = 0; /* MADCINT register value */
+ u8 adc_cntrl2 = 0; /* ADCCNTL2 register value */
+ int i, j;
+
+ /* Initialize the register index to use to be zero */
+ mrst_analog_reg_idx = 0;
+
+ /* check if the ADC is enabled or not
+ * Read ADCCNTL1 registers */
+ ipc_data.ioc = FALSE; /* No need to generate MSI */
+ ipc_data.num_entries = 1;
+ ipc_data.pmic_reg_data[0].register_address =
+ PMIC_ADC_ACC_REG_ADCCNTL1;
+ ipc_data.pmic_reg_data[0].value = 0;
+
+ retval = ipc_pmic_register_read(&ipc_data);
+ if (retval != 0) {
+ printk(KERN_ALERT
+ "\nmrst_analog_accel:PMIC register read failed\n");
+ return retval;
+ }
+
+ adc_cntrl2 = ipc_data.pmic_reg_data[0].value;
+
+ if ((adc_cntrl2 >> 7) & 0x1) {
+ /* If the ADC is enabled find the set of registers to use
+ ** Loop through the channel mapping register to find out the
+ ** first free one
+ */
+ for (i = 0;
+ (i < PMIC_ADC_REG_MAX) && (mrst_analog_reg_idx == 0);
+ i += REG_READ_PER_IPC) {
+
+ ipc_data.num_entries = REG_READ_PER_IPC;
+ ipc_data.ioc = FALSE; /* No need to generate MSI */
+
+ /* Reading 4 regs at a time instead of reading each
+ * reg one by one since IPC is an expensive operation
+ */
+ for (j = 0; j < REG_READ_PER_IPC; j++) {
+ ipc_data.pmic_reg_data[j].register_address =
+ PMIC_ADC_MAPPING_BASE + i + j;
+ ipc_data.pmic_reg_data[j].value = 0;
+ }
+ retval = ipc_pmic_register_read(&ipc_data);
+ if (retval != 0) {
+ printk(KERN_ALERT
+ "\nmrst_analog_accel:PMIC regs read failed\n");
+ return retval;
+ }
+ for (j = 0; j < REG_READ_PER_IPC; j++) {
+ if (ipc_data.pmic_reg_data[j].value
+ == END_OF_CHANNEL_VALUE) {
+ mrst_analog_reg_idx = i + j;
+ break;
+ }
+ }
+ }
+ }
+ /* Check to see if there are enough registers to map the channel */
+ if ((mrst_analog_reg_idx + 3) >= PMIC_ADC_REG_MAX) {
+ printk(KERN_ALERT
+ "\nmrst_analog_accel:Not enough regs to map the channels\n");
+ return -1;
+ }
+
+ /* Update the mapping registers for the accelerometer*/
+ ipc_data.num_entries = 4;
+ ipc_data.ioc = FALSE; /* No need to generate MSI */
+ ipc_data.pmic_reg_data[0].register_address =
+ PMIC_ADC_MAPPING_BASE + mrst_analog_reg_idx;
+ ipc_data.pmic_reg_data[0].value = PMIC_ADC_ACC_ADC_ACC_CH14;
+
+ ipc_data.pmic_reg_data[1].register_address =
+ PMIC_ADC_MAPPING_BASE + mrst_analog_reg_idx + 1;
+ ipc_data.pmic_reg_data[1].value = PMIC_ADC_ACC_ADC_ACC_CH15;
+
+ ipc_data.pmic_reg_data[2].register_address =
+ PMIC_ADC_MAPPING_BASE + mrst_analog_reg_idx + 2;
+ ipc_data.pmic_reg_data[2].value = PMIC_ADC_ACC_ADC_ACC_CH16;
+
+ ipc_data.pmic_reg_data[3].register_address =
+ PMIC_ADC_MAPPING_BASE + mrst_analog_reg_idx + 3 ;
+ ipc_data.pmic_reg_data[3].value = END_OF_CHANNEL_VALUE;
+
+ retval = ipc_pmic_register_write(&ipc_data, FALSE);
+ if (retval != 0) {
+ printk(KERN_ALERT
+ "\nmrst_analog_accel:PMIC reg write failed\n");
+ return retval;
+ }
+
+ /* If the ADC was not enabled, enable it now */
+ if (!(adc_cntrl2 >> 7) & 0x1) {
+ /* Mask the round robin completion interrupt */
+ ipc_mod_data.ioc = FALSE; /* No need to generate MSI */
+ ipc_mod_data.num_entries = 1;
+ mad_cntrl = 0x01;
+ ipc_mod_data.pmic_mod_reg_data[0].register_address =
+ PMIC_ADC_ACC_REG_MADCINT;
+ ipc_mod_data.pmic_mod_reg_data[0].value = mad_cntrl;
+ ipc_mod_data.pmic_mod_reg_data[0].bit_map = 0x01;
+
+ retval = ipc_pmic_register_read_modify(&ipc_mod_data);
+ if (retval != 0) {
+ printk(KERN_ALERT
+ "\nmrst_analog_accel:PMIC reg modify failed\n");
+ return retval;
+ }
+
+ adc_cntrl2 = 0xc6; /*27ms delay,start round robin,
+ enable full power */
+ ipc_data.ioc = FALSE; /* No need to generate MSI */
+ ipc_data.num_entries = 1;
+ ipc_data.pmic_reg_data[0].register_address =
+ PMIC_ADC_ACC_REG_ADCCNTL1;
+ ipc_data.pmic_reg_data[0].value = adc_cntrl2;
+ retval = ipc_pmic_register_write(&ipc_data, FALSE);
+ if (retval != 0)
+ return retval;
+ }
+ return retval;
+}
+
+static struct platform_device *mrst_analog_accel_pdev;
+static struct device *mrst_analog_accel_hwmon;
+
+static int
+mrst_analog_accel_unregister(void)
+{
+
+ printk(KERN_ALERT "\nStart Exit\n\n");
+ sysfs_remove_group(&mrst_analog_accel_hwmon->kobj, &m_analog_gr);
+ hwmon_device_unregister(mrst_analog_accel_hwmon);
+ platform_device_unregister(mrst_analog_accel_pdev);
+ printk(KERN_ALERT "\n\nEnd Exit\n");
+ return 0;
+}
+
+
+static int __init
+mrst_analog_accel_module_init(void)
+{
+ int retval = 0;
+
+ mrst_analog_accel_pdev =
+ platform_device_register_simple("mrst_analog_accel",
+ 0, NULL, 0);
+ if (IS_ERR(mrst_analog_accel_pdev)) {
+ retval = PTR_ERR(mrst_analog_accel_pdev);
+ printk(KERN_ALERT
+ "\nmrst_analog_accel:Registration with the platform failed\n");
+ goto accelero_reg_failed;
+ }
+ printk(KERN_ALERT
+ "\nmrst_analog_accel:Registered with the platform\n");
+
+ retval = mrst_analog_accel_initialize();
+ if (retval == 0) {
+ retval = sysfs_create_group(&mrst_analog_accel_pdev->dev.kobj,
+ &m_analog_gr);
+ if (retval) {
+ printk(KERN_ALERT
+ "\nmrst_analog_accel:device_create_file 1 failed\n");
+ goto accelero_reg_failed;
+ }
+ mrst_analog_accel_hwmon =
+ hwmon_device_register(&mrst_analog_accel_pdev->dev);
+ if (IS_ERR(mrst_analog_accel_hwmon)) {
+ retval = PTR_ERR(mrst_analog_accel_hwmon);
+ mrst_analog_accel_hwmon = NULL;
+ printk(KERN_ALERT
+ "\nmrst_analog_accel:Registration with hwmon failed\n");
+ }
+ } else {
+ printk(KERN_ALERT
+ "\nmrst_analog_accel:Initialization failed: %d\n", retval);
+ }
+
+accelero_reg_failed:
+ return retval;
+}
+
+static void __exit
+mrst_analog_accel_module_exit(void)
+{
+
+ mrst_analog_accel_unregister();
+}
+
+module_init(mrst_analog_accel_module_init);
+module_exit(mrst_analog_accel_module_exit);
Index: linux-2.6.33/drivers/hwmon/lis331dl.c
===================================================================
--- linux-2.6.33.orig/drivers/hwmon/lis331dl.c
+++ linux-2.6.33/drivers/hwmon/lis331dl.c
@@ -186,33 +186,10 @@ invarg:
return -EINVAL;
}
-static ssize_t reboot_mem_store(struct device *dev,
- struct device_attribute *attr, const char *buf, size_t count)
-{
- struct i2c_client *client = to_i2c_client(dev);
- struct acclero_data *data = i2c_get_clientdata(client);
- unsigned int ret_val, set_val;
- unsigned long val;
-
- if (strict_strtoul(buf, 10, &val))
- return -EINVAL;
- ret_val = i2c_smbus_read_byte_data(client, 0x21);
- if (val == ACCEL_MEMORY_REBOOT) {
- mutex_lock(&data->update_lock);
- set_val = (ret_val | (1 << 6)); /* setting the 6th bit */
- i2c_write_current_data(client, 0x21, set_val);
- mutex_unlock(&data->update_lock);
- } else
- return -EINVAL;
- return count;
-}
-
static DEVICE_ATTR(data_rate, S_IRUGO | S_IWUSR,
data_rate_show, data_rate_store);
static DEVICE_ATTR(power_state, S_IRUGO | S_IWUSR,
power_mode_show, power_mode_store);
-static DEVICE_ATTR(reboot_mem, S_IWUSR, NULL,
- reboot_mem_store);
static DEVICE_ATTR(x, S_IRUGO, x_pos_show, NULL);
static DEVICE_ATTR(y, S_IRUGO, y_pos_show, NULL);
static DEVICE_ATTR(z, S_IRUGO, z_pos_show, NULL);
@@ -221,7 +198,6 @@ static DEVICE_ATTR(curr_pos, S_IRUGO, xy
static struct attribute *mid_att_acclero[] = {
&dev_attr_data_rate.attr,
&dev_attr_power_state.attr,
- &dev_attr_reboot_mem.attr,
&dev_attr_x.attr,
&dev_attr_y.attr,
&dev_attr_z.attr,

View File

@ -1,900 +0,0 @@
From 4f7fcea7402d7d788fe959bc9b7ced86af72d806 Mon Sep 17 00:00:00 2001
From: R, Dharageswari <dharageswari.r@intel.com>
Date: Thu, 29 Apr 2010 20:20:22 +0530
Subject: [PATCH] ADR-Post-Beta-0.05.002.03-2/8-Adding Moorestown Audio Drivers: SST header files
This patch adds the common header files.
intel_sst_common.h - This header files is private to SST driver and contain the
common structures like SST ops, SST register offsets, debugging macro,
sst stream definitions, and Shim register definitions.
intel_sst_pvt.c - Utility functions used by SST driver and function
prototypes of common functions are implemented in this file
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
new file: sound/pci/sst/intel_sst_common.h
new file: sound/pci/sst/intel_sst_pvt.c
Patch-mainline: 2.6.35?
---
sound/pci/sst/intel_sst_common.h | 538 ++++++++++++++++++++++++++++++++++++++
sound/pci/sst/intel_sst_pvt.c | 323 +++++++++++++++++++++++
2 files changed, 861 insertions(+), 0 deletions(-)
create mode 100644 sound/pci/sst/intel_sst_common.h
create mode 100644 sound/pci/sst/intel_sst_pvt.c
diff --git a/sound/pci/sst/intel_sst_common.h b/sound/pci/sst/intel_sst_common.h
new file mode 100644
index 0000000..d9a720d
--- /dev/null
+++ b/sound/pci/sst/intel_sst_common.h
@@ -0,0 +1,538 @@
+#ifndef __INTEL_SST_COMMON_H__
+#define __INTEL_SST_COMMON_H__
+/*
+ * intel_sst_common.h - Intel SST Driver for audio engine
+ *
+ * Copyright (C) 2008-10 Intel Corporation
+ * Authors: Vinod Koul <vinod.koul@intel.com>
+ * Harsha Priya <priya.harsha@intel.com>
+ * Dharageswari R <dharageswari.r@intel.com>
+ * KP Jeeja <jeeja.kp@intel.com>
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * 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.
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ * Common private declarations for SST
+ */
+#include <linux/time.h>
+#ifdef CONFIG_MSTWN_POWER_MGMT
+#include <linux/intel_mid.h>
+#endif
+/* #define SND_LOOP_TEST */
+
+#define SST_DRIVER_VERSION "0.05.002.03"
+#define SST_VERSION_NUM 0x050203
+
+/* driver names */
+#define SST_DRV_NAME "intel_sst_driver"
+#define SST_FW_STD_FILENAME "fw_sst.bin"
+
+
+enum sst_states {
+ SST_FW_LOADED = 1,
+ SST_FW_RUNNING,
+ SST_UN_INIT,
+ SST_ERROR,
+};
+
+#define MAX_ACTIVE_STREAM 3
+#define MAX_ENC_STREAM 1
+#define MAX_AM_HANDLES 1
+#define ALLOC_TIMEOUT 5000
+/* SST numbers */
+#define SST_BLOCK_TIMEOUT 5000
+#define TARGET_DEV_BLOCK_TIMEOUT 5000
+
+/* FIXME */
+#define INTEL_SST_MAJOR 255
+#define BLOCK_UNINIT -1
+#define RX_TIMESLOT_UNINIT -1
+/* Chip revision ID */
+
+/*
+#define CHIP_A1_50 0x01
+#define CHIP_A2_50 0x02
+#define CHIP_A2_100 0x03
+*/
+
+/*
+#define DSP_CLOCK_SPEED 100 */ /* 50: 50MHz, 100: 100MHz */
+
+/* SST register map */
+#define SST_CSR 0x00
+#define SST_PISR 0x08
+#define SST_PIMR 0x10
+#define SST_ISRX 0x18
+#define SST_IMRX 0x28
+#define SST_IPCX 0x38 /* IPC IA-SST */
+#define SST_IPCD 0x40 /* IPC SST-IA */
+#define SST_ISRD 0x20 /* dummy register for shim workaround */
+#define SST_SHIM_SIZE 0X44
+
+#define SPI_MODE_ENABLE_BASE_ADDR 0xffae4000
+#define FW_SIGNATURE_SIZE 4
+
+/* PMIC and SST hardware states */
+enum sst_mad_states {
+ SND_MAD_UN_INIT = 0,
+ SND_MAD_INIT_DONE,
+};
+
+/* stream states */
+enum sst_stream_states {
+ STREAM_UN_INIT = 0, /* Freed/Not used stream */
+ STREAM_RUNNING = 1, /* Running */
+ STREAM_PAUSED = 2, /* Paused stream */
+ STREAM_DECODE = 4, /* stream is in decoding only state */
+ STREAM_INIT = 5, /* stream init, waiting for data */
+};
+
+
+enum sst_ram_type{
+ SST_IRAM = 1,
+ SST_DRAM = 2,
+};
+/* SST shim registers to structure mapping */
+union config_status_reg {
+ struct {
+ u32 rsvd0:1;
+ u32 sst_reset:1;
+ u32 hw_rsvd:3;
+ u32 sst_clk:2;
+ u32 bypass:3;
+ u32 run_stall:1;
+ u32 rsvd1:2;
+ u32 strb_cntr_rst:1;
+ u32 rsvd:18;
+ } part;
+ u32 full;
+};
+
+union interrupt_reg {
+ struct {
+ u32 done_interrupt:1;
+ u32 busy_interrupt:1;
+ u32 rsvd:30;
+ } part;
+ u32 full;
+};
+
+union sst_pisr_reg {
+ struct {
+ u32 pssp0:1;
+ u32 pssp1:1;
+ u32 rsvd0:3;
+ u32 dmac:1;
+ u32 rsvd1:26;
+ } part;
+ u32 full;
+};
+
+union sst_pimr_reg {
+ struct {
+ u32 ssp0:1;
+ u32 ssp1:1;
+ u32 rsvd0:3;
+ u32 dmac:1;
+ u32 rsvd1:10;
+ u32 ssp0_sc:1;
+ u32 ssp1_sc:1;
+ u32 rsvd2:3;
+ u32 dmac_sc:1;
+ u32 rsvd3:10;
+ } part;
+ u32 full;
+};
+
+
+struct sst_stream_bufs {
+ struct list_head node;
+ u32 size;
+ const char *addr;
+ u32 data_copied;
+ bool in_use;
+ u32 offset;
+};
+
+struct snd_sst_user_cap_list {
+ unsigned int iov_index; /* index of iov */
+ unsigned long iov_offset; /* offset in iov */
+ unsigned long offset; /* offset in kmem */
+ unsigned long size; /* size copied */
+ struct list_head node;
+};
+/*
+This structure is used to block a user/fw data call to another
+fw/user call
+*/
+struct sst_block {
+ bool condition; /* condition for blocking check */
+ int ret_code; /* ret code when block is released */
+ void *data; /* data to be appsed for block if any */
+ bool on;
+};
+
+enum snd_sst_buf_type {
+ SST_BUF_USER_STATIC = 1,
+ SST_BUF_USER_DYNAMIC,
+ SST_BUF_MMAP_STATIC,
+ SST_BUF_MMAP_DYNAMIC,
+};
+enum snd_src {
+ SST_DRV = 1,
+ MAD_DRV = 2
+};
+/*
+structure that holds the stream information
+*/
+struct stream_info {
+ unsigned int status;
+ unsigned int prev;
+ u8 codec;
+ unsigned int sst_id;
+ unsigned int ops;
+ struct list_head bufs;
+ struct mutex lock; /* mutex */
+ spinlock_t pcm_lock;
+ bool mmapped;
+ unsigned int sg_index; /* current buf Index */
+ unsigned char *cur_ptr; /* Current static bufs */
+ struct snd_sst_buf_entry *buf_entry;
+ struct sst_block data_blk; /* stream ops block */
+ struct sst_block ctrl_blk; /* stream control cmd block */
+ enum snd_sst_buf_type buf_type;
+ void *pcm_substream;
+ void (*period_elapsed) (void *pcm_substream);
+ unsigned int sfreq;
+ void *decode_ibuf, *decode_obuf;
+ unsigned int decode_isize, decode_osize;
+ u8 decode_ibuf_type, decode_obuf_type;
+ unsigned int idecode_alloc;
+ unsigned int need_draining;
+ unsigned int str_type;
+ u32 curr_bytes;
+ u32 cumm_bytes;
+ u32 src; /* hack to remove */
+};
+
+
+
+/*
+this structure is used for blocking the user's alloc calls to
+fw's response to alloc calls
+*/
+struct stream_alloc_block {
+ int sst_id; /* session id of blocked stream */
+ struct sst_block ops_block; /* ops block struture */
+};
+
+#define SST_FW_SIGN "$SST"
+#define SST_FW_LIB_SIGN "$LIB"
+
+/* FW file headers */
+struct fw_header {
+ unsigned char signature[FW_SIGNATURE_SIZE]; /* FW signature */
+ u32 file_size; /* size of fw minus this header */
+ u32 modules; /* # of modules */
+ u32 file_format; /* version of header format */
+ u32 reserved[4];
+};
+
+struct fw_module_header {
+ unsigned char signature[FW_SIGNATURE_SIZE]; /* module signature */
+ u32 mod_size; /* size of module */
+ u32 blocks; /* # of blocks */
+ u32 type; /* codec type, pp lib */
+ u32 entry_point;
+};
+
+struct dma_block_info {
+ enum sst_ram_type type; /* IRAM/DRAM */
+ u32 size; /* Bytes */
+ u32 ram_offset; /* Offset in I/DRAM */
+ u32 rsvd; /* Reserved field */
+};
+
+struct ioctl_pvt_data {
+ int str_id;
+ int pvt_id;
+};
+
+struct sst_ipc_msg_wq {
+ union ipc_header header;
+ char mailbox[SST_MAILBOX_SIZE];
+ struct work_struct wq;
+};
+
+struct mad_ops_wq {
+ int stream_id;
+ enum sst_controls control_op;
+ struct work_struct wq;
+
+};
+
+#define SST_MMAP_PAGES (640*1024 / PAGE_SIZE)
+#define SST_MMAP_STEP (40*1024 / PAGE_SIZE)
+
+/* driver ops */
+struct intel_sst_drv {
+ bool pmic_state;
+ int pmic_vendor;
+ int sst_state;
+/* int chip_rev_id; */
+ void __iomem *shim;
+ void __iomem *mailbox;
+ void __iomem *iram;
+ void __iomem *dram;
+ unsigned int shim_phy_add;
+ struct list_head ipc_dispatch_list;
+ struct work_struct ipc_post_msg_wq;
+ struct sst_ipc_msg_wq ipc_process_msg;
+ struct sst_ipc_msg_wq ipc_process_reply;
+ struct sst_ipc_msg_wq ipc_post_msg;
+ struct mad_ops_wq mad_ops;
+ wait_queue_head_t wait_queue;
+ struct workqueue_struct *mad_wq;
+ struct workqueue_struct *post_msg_wq;
+ struct workqueue_struct *process_msg_wq;
+ struct workqueue_struct *process_reply_wq;
+
+ struct stream_info streams[MAX_NUM_STREAMS];
+ struct stream_alloc_block alloc_block[MAX_ACTIVE_STREAM];
+ struct sst_block tgt_dev_blk, fw_info_blk,
+ vol_info_blk, mute_info_blk, hs_info_blk;
+ struct mutex list_lock;/* mutex for IPC list locking */
+ struct snd_pmic_ops *scard_ops;
+ struct pci_dev *pci;
+ int active_streams[MAX_NUM_STREAMS];
+ void *mmap_mem;
+ struct mutex stream_cnt_lock;
+ unsigned int mmap_len;
+ unsigned int unique_id;
+ unsigned int stream_cnt; /* total streams */
+ unsigned int encoded_cnt; /* enocded streams only */
+ unsigned int am_cnt;
+ unsigned int pb_streams; /* pb streams active */
+ unsigned int cp_streams; /* cp streams active */
+ unsigned int lpe_stalled; /* LPE is stalled or not */
+ unsigned int pmic_port_instance; /*pmic port instance enabled*/
+ int rx_time_slot_status;
+ unsigned int lpaudio_start; /* 1 - LPA stream(MP3 pb) in progress*/
+ unsigned int audio_start; /* 1 - LPA stream(Non-MP3 pb) in progress*/
+};
+
+extern struct intel_sst_drv *sst_drv_ctx;
+
+/* register definitions */
+/*SCU FW Changes*/
+/*#define AUD_CLK_ADDR 0xff11d83c
+#define AUD_CLK_DISABLE 0x80008008
+#define AUD_CLK_50MHZ 0x80008301
+#define AUD_CLK_RATIO_1_2 0x80000301
+#define AUD_CLK_RATIO_8008 0x80008008
+#define AUD_CLK_RATIO_8101 0x80008101
+#define AUD_CLK_RATIO_0101 0x80000101
+#define AUD_SYS_ADDR 0xff11d118
+#define AUD_SYS_RESET 0x7ffffcff
+#define AUD_SYS_SET 0x7fffffff
+#define AUD_SHIM_BASE_ADDR 0xffae8000 */
+/*
+#define AUD_SHIM_RATIO_1_1 0x382
+#define AUD_SHIM_RATIO 0x3a2
+*/
+/*SCU FW Changes*/
+/*#define AUD_CLK_200 0xff11d200
+#define AUD_CLK_204 0xff11d204
+#define AUD_INIT_VAL 0x0*/
+#define CHIP_REV_REG 0xff108000
+#define CHIP_REV_ADDR 0x78
+/*
+#define CHIP_REV_A1 0x0
+#define CHIP_REV_A2 0x3
+#define CLK_50MHZ 50
+#define CLK_100MHZ 100
+*/
+/* misc definitions */
+#define FW_DWNL_ID 0xFF
+#define LOOP1 0x11111111
+#define LOOP2 0x22222222
+#define LOOP3 0x33333333
+#define LOOP4 0x44444444
+
+#define SST_DEFAULT_PMIC_PORT 1 /*audio port*/
+/* NOTE: status will +ve for good cases and -ve for error ones */
+#define MAX_STREAM_FIELD 255
+
+int sst_alloc_stream(char *params, unsigned int stream_ops, u8 codec,
+ unsigned int session_id);
+int sst_alloc_stream_response(unsigned int str_id,
+ struct snd_sst_str_type *type);
+int sst_stalled(void);
+int sst_pause_stream(int id);
+int sst_resume_stream(int id);
+int sst_enable_rx_timeslot(int status);
+int sst_drop_stream(int id);
+int sst_free_stream(int id);
+int sst_play_frame(int streamID);
+int sst_capture_frame(int streamID);
+int sst_set_stream_param(int streamID, struct snd_sst_params *str_param);
+int sst_target_device_select(struct snd_sst_target_device *target_device);
+int sst_decode(int str_id, struct snd_sst_dbufs *dbufs);
+int sst_get_decoded_bytes(int str_id, unsigned long long *bytes);
+int sst_get_fw_info(struct snd_sst_fw_info *info);
+int sst_get_stream_params(int str_id,
+ struct snd_sst_get_stream_params *get_params);
+int sst_drain_stream(int str_id);
+int sst_get_vol(struct snd_sst_vol *set_vol);
+int sst_set_vol(struct snd_sst_vol *set_vol);
+int sst_set_mute(struct snd_sst_mute *set_mute);
+
+
+void sst_post_message(struct work_struct *work);
+void sst_process_message(struct work_struct *work);
+void sst_process_reply(struct work_struct *work);
+void sst_process_mad_ops(struct work_struct *work);
+void sst_process_mad_jack_detection(struct work_struct *work);
+
+int intel_sst_ioctl(struct inode *i_node, struct file *file_ptr,
+ unsigned int cmd, unsigned long arg);
+int intel_sst_open(struct inode *i_node, struct file *file_ptr);
+int intel_sst_release(struct inode *i_node, struct file *file_ptr);
+int intel_sst_read(struct file *file_ptr, char __user *buf,
+ size_t count, loff_t *ppos);
+int intel_sst_write(struct file *file_ptr, const char __user *buf,
+ size_t count, loff_t *ppos);
+int intel_sst_mmap(struct file *fp, struct vm_area_struct *vma);
+ssize_t intel_sst_aio_write(struct kiocb *kiocb, const struct iovec *iov,
+ unsigned long nr_segs, loff_t offset);
+ssize_t intel_sst_aio_read(struct kiocb *kiocb, const struct iovec *iov,
+ unsigned long nr_segs, loff_t offset);
+
+int sst_load_fw(const struct firmware *fw, void *context);
+int sst_load_library(struct snd_sst_lib_download *lib, u8 ops, u32 pvt_id);
+int sst_spi_mode_enable(void);
+int sst_get_block_stream(struct intel_sst_drv *sst_drv_ctx);
+
+void sst_print_hex(unsigned char *buf, unsigned int size);
+int sst_wait_interruptible(struct intel_sst_drv *sst_drv_ctx,
+ struct sst_block *block);
+int sst_wait_interruptible_timeout(struct intel_sst_drv *sst_drv_ctx,
+ struct sst_block *block, int timeout);
+int sst_wait_timeout(struct intel_sst_drv *sst_drv_ctx,
+ struct stream_alloc_block *block);
+int sst_create_large_msg(struct ipc_post **arg);
+int sst_create_short_msg(struct ipc_post **arg);
+void sst_print_params(struct snd_sst_params *str_params);
+void sst_wake_up_alloc_block(struct intel_sst_drv *sst_drv_ctx,
+ u8 sst_id, int status, void *data);
+void sst_clear_interrupt(void);
+
+/**
+* this function is an inline function that sets the headers before
+* sending a message
+*/
+static inline void sst_fill_header(union ipc_header *header,
+ int msg, int large, int strID)
+{
+ header->part.msg_id = msg;
+ header->part.str_id = strID;
+ header->part.large = large;
+ header->part.done = 0;
+ header->part.busy = 1;
+ header->part.data = 0;
+}
+
+/**
+* this inline function assigns a private id for calls that dont have stream
+* context yet
+*/
+static inline unsigned int sst_assign_pvt_id(struct intel_sst_drv *sst_drv_ctx)
+{
+ sst_drv_ctx->unique_id++;
+ if (sst_drv_ctx->unique_id >= MAX_NUM_STREAMS)
+ sst_drv_ctx->unique_id = 1;
+ return sst_drv_ctx->unique_id;
+}
+
+/**
+* this function initialzes stream context
+*/
+static inline void sst_init_stream(struct stream_info *stream,
+ int codec, int str_type, int sst_id, int ops)
+{
+ stream->status = STREAM_INIT;
+ stream->prev = STREAM_UN_INIT;
+ stream->codec = codec;
+ stream->sst_id = sst_id;
+ stream->str_type = str_type;
+ stream->ops = ops;
+ stream->data_blk.on = false;
+ stream->data_blk.condition = false;
+ stream->data_blk.ret_code = 0;
+ stream->data_blk.data = NULL;
+ stream->ctrl_blk.on = false;
+ stream->ctrl_blk.condition = false;
+ stream->ctrl_blk.ret_code = 0;
+ stream->ctrl_blk.data = NULL;
+ stream->need_draining = false;
+ stream->decode_ibuf = NULL;
+ stream->decode_isize = 0;
+ stream->mmapped = false;
+}
+
+/**
+* this function resets the stream contexts
+*/
+static inline void sst_clean_stream(struct stream_info *stream)
+{
+ struct sst_stream_bufs *bufs = NULL, *_bufs;
+ stream->status = STREAM_UN_INIT;
+ stream->prev = STREAM_UN_INIT;
+ mutex_lock(&stream->lock);
+ list_for_each_entry_safe(bufs, _bufs, &stream->bufs, node) {
+ list_del(&bufs->node);
+ kfree(bufs);
+ }
+ mutex_unlock(&stream->lock);
+
+ if (stream->ops != STREAM_OPS_PLAYBACK_DRM)
+ kfree(stream->decode_ibuf);
+}
+
+/**
+* this function generates events for OSPM
+*/
+static inline int sst_ospm_send_event(int event)
+{
+#ifdef CONFIG_MSTWN_POWER_MGMT
+ return ospm_generate_netlink_event(AUDIO_SUBSYTEM_ID, event);
+#else
+ return 0;
+#endif
+}
+
+/**
+* this function validates the stream id
+*/
+static inline int sst_validate_strid(int str_id)
+{
+ if (str_id <= 0 || str_id >= MAX_NUM_STREAMS)
+ return -EINVAL;
+ else
+ return 0;
+}
+
+#endif /* __INTEL_SST_COMMON_H__ */
diff --git a/sound/pci/sst/intel_sst_pvt.c b/sound/pci/sst/intel_sst_pvt.c
new file mode 100644
index 0000000..95d79be
--- /dev/null
+++ b/sound/pci/sst/intel_sst_pvt.c
@@ -0,0 +1,323 @@
+/*
+ * intel_sst_pvt.c - Intel SST Driver for audio engine
+ *
+ * Copyright (C) 2008-10 Intel Corp
+ * Authors: Vinod Koul <vinod.koul@intel.com>
+ * Harsha Priya <priya.harsha@intel.com>
+ * Dharageswari R <dharageswari.r@intel.com>
+ * KP Jeeja <jeeja.kp@intel.com>
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * 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.
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ * This driver exposes the audio engine functionalities to the ALSA
+ * and middleware.
+ *
+ * This file contains all private functions
+ */
+
+#include <linux/cdev.h>
+#include <linux/pci.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/syscalls.h>
+#include <linux/fs.h>
+#include <linux/file.h>
+#include <linux/interrupt.h>
+#include <linux/list.h>
+#include <linux/workqueue.h>
+#include <linux/firmware.h>
+#include <linux/mutex.h>
+#include <linux/delay.h>
+#include <linux/sched.h>
+#include <sound/intel_lpe.h>
+#include <sound/intel_sst_ioctl.h>
+#include "intel_sst_fw_ipc.h"
+#include "intel_sst_common.h"
+
+/**
+* this function assigns a block for the calls that dont have stream context yet
+* the blocks are used for waiting on Firmware's response for any operation
+*/
+int sst_get_block_stream(struct intel_sst_drv *sst_drv_ctx)
+{
+ int i;
+
+ for (i = 0; i < MAX_ACTIVE_STREAM; i++) {
+ if (sst_drv_ctx->alloc_block[i].sst_id == BLOCK_UNINIT) {
+ sst_drv_ctx->alloc_block[i].ops_block.condition = false;
+ sst_drv_ctx->alloc_block[i].ops_block.ret_code = 0;
+ sst_drv_ctx->alloc_block[i].sst_id = 0;
+ break;
+ }
+ }
+ if (i == MAX_ACTIVE_STREAM) {
+ printk(KERN_ERR
+ "SST ERR: max alloc_stream reached");
+ i = -EBUSY; /* active stream limit reached */
+ }
+ return i;
+}
+
+/**
+* this function is a debug function that is used to print contents of a buffer
+*/
+void sst_print_hex(unsigned char *buf, unsigned int size)
+{
+ unsigned int i;
+
+ for (i = 0; i < size; i++) {
+ printk(KERN_DEBUG "SST DBG:%02x ", buf[i]);
+ if ((i != 0) && ((i % 8) == 0))
+ printk(KERN_DEBUG "SST DBG:\n");
+ }
+}
+/**
+* this function waits without a timeout (and is interruptable) for a
+* given block event
+*/
+int sst_wait_interruptible(struct intel_sst_drv *sst_drv_ctx,
+ struct sst_block *block)
+{
+ int retval = 0;
+
+ if (!wait_event_interruptible(sst_drv_ctx->wait_queue,
+ block->condition)) {
+ /* event wake */
+ if (block->ret_code < 0) {
+ printk(KERN_ERR
+ "SST ERR: stream failed %d\n"\
+ , block->ret_code);
+ retval = -EBUSY;
+ } else {
+ printk(KERN_DEBUG "SST DBG:event up\n");
+ retval = 0;
+ }
+ } else {
+ printk(KERN_ERR
+ "SST ERR: signal interrupted\n");
+ retval = -EINTR;
+ }
+ return retval;
+
+}
+
+/**
+* this function waits with a timeout value (and is interruptle) on a
+* given block event
+*/
+int sst_wait_interruptible_timeout(
+ struct intel_sst_drv *sst_drv_ctx,
+ struct sst_block *block, int timeout)
+{
+ int retval = 0;
+
+ printk(KERN_DEBUG "SST DBG:waiting....\n");
+ if (wait_event_interruptible_timeout(sst_drv_ctx->wait_queue,
+ block->condition,
+ msecs_to_jiffies(timeout))) {
+ if (block->ret_code < 0) {
+ printk(KERN_ERR
+ "SST ERR: stream failed %d\n"\
+ , block->ret_code);
+ } else
+ printk(KERN_DEBUG "SST DBG:event up\n");
+ retval = block->ret_code;
+ } else {
+ block->on = false;
+ printk(KERN_ERR
+ "SST ERR: timeout occured...\n");
+ /* settign firmware state as uninit so that the
+ firmware will get redownloaded on next request
+ this is because firmare not responding for 5 sec
+ is equalant to some unrecoverable error of FW
+ sst_drv_ctx->sst_state = SST_UN_INIT;*/
+ retval = -EBUSY;
+ }
+ return retval;
+
+}
+
+/**
+* this function waits with on a given block event
+*/
+int sst_wait_timeout(struct intel_sst_drv *sst_drv_ctx,
+ struct stream_alloc_block *block)
+{
+ int retval = 0;
+
+ /* NOTE:
+ Observed that FW processes the alloc msg and replies even
+ before the alloc thread has finished execution */
+ printk(KERN_DEBUG "SST DBG:waiting for %x, +\
+ condition %x \n", block->sst_id,
+ block->ops_block.condition);
+ if (wait_event_interruptible_timeout(sst_drv_ctx->wait_queue,
+ block->ops_block.condition,
+ msecs_to_jiffies(SST_BLOCK_TIMEOUT))) {
+ /* event wake */
+ printk(KERN_DEBUG "SST DBG:Event wake +\
+ ... %x \n", block->ops_block.condition);
+ printk(KERN_DEBUG "SST DBG:message +\
+ ret: %d\n", block->ops_block.ret_code);
+ retval = block->ops_block.ret_code;
+ } else {
+ block->ops_block.on = false;
+ printk(KERN_ERR
+ "SST ERR: Wait timed-out %x \n",\
+ block->ops_block.condition);
+ /* settign firmware state as uninit so that the
+ firmware will get redownloaded on next request
+ this is because firmare not responding for 5 sec
+ is equalant to some unrecoverable error of FW
+ sst_drv_ctx->sst_state = SST_UN_INIT;*/
+ retval = -EBUSY;
+ }
+ return retval;
+
+}
+
+/**
+* this function allocats structures to send a large message to the firmware
+*/
+int sst_create_large_msg(struct ipc_post **arg)
+{
+ struct ipc_post *msg;
+
+ msg = kzalloc(sizeof(struct ipc_post), GFP_ATOMIC);
+ if (!msg) {
+ printk(KERN_ERR
+ "SST ERR: kzalloc msg failed \n");
+ return -ENOMEM;
+ }
+
+ msg->mailbox_data = kzalloc(SST_MAILBOX_SIZE, GFP_ATOMIC);
+ if (!msg->mailbox_data) {
+ kfree(msg);
+ printk(KERN_ERR
+ "SST ERR: kzalloc mailbox_data failed");
+ return -ENOMEM;
+ };
+ *arg = msg;
+ return 0;
+}
+
+/**
+* this function allocats structures to send a short message to the firmware
+*/
+int sst_create_short_msg(struct ipc_post **arg)
+{
+ struct ipc_post *msg;
+
+ msg = kzalloc(sizeof(*msg), GFP_ATOMIC);
+ if (!msg) {
+ printk(KERN_ERR
+ "SST ERR: kzalloc msg failed \n");
+ return -ENOMEM;
+ }
+ msg->mailbox_data = NULL;
+ *arg = msg;
+ return 0;
+}
+
+/**
+* this function is a debug funtion to print the stream parameters
+*/
+void sst_print_params(struct snd_sst_params *str_params)
+{
+ switch (str_params->codec) {
+ case SST_CODEC_TYPE_PCM:
+ printk(KERN_DEBUG "SST DBG:pcm \n");
+ printk(KERN_DEBUG "SST DBG:chan=%d, sfreq = %d, wd_sz = %d \
+ brate = %d buffer_size= 0x%d\
+ period_cnt = %d\n",
+ str_params->sparams.uc.pcm_params.num_chan,
+ str_params->sparams.uc.pcm_params.sfreq,
+ str_params->sparams.uc.pcm_params.pcm_wd_sz,
+ str_params->sparams.uc.pcm_params.brate,
+ // str_params->sparams.uc.pcm_params.frame_size,
+ // str_params->sparams.uc.pcm_params.samples_per_frame,
+ str_params->sparams.uc.pcm_params.buffer_size,
+ str_params->sparams.uc.pcm_params.period_count);
+ break;
+
+ case SST_CODEC_TYPE_MP3:
+ printk(KERN_DEBUG "SST DBG:mp3 \n");
+ printk(KERN_DEBUG "SST DBG:chan=%d, brate=%d, sfreq = %d, wd_sz = %d\n",
+ str_params->sparams.uc.mp3_params.num_chan,
+ str_params->sparams.uc.mp3_params.brate,
+ str_params->sparams.uc.mp3_params.sfreq,
+ str_params->sparams.uc.mp3_params.pcm_wd_sz);
+ break;
+
+ case SST_CODEC_TYPE_AAC:
+ printk(KERN_DEBUG "SST DBG:aac \n");
+ printk(KERN_DEBUG "SST DBG:chan=%d, brate=%d, sfreq = %d, wd_sz = %d,asrate=%d\n",
+ str_params->sparams. uc.aac_params.num_chan,
+ str_params->sparams.uc.aac_params.brate,
+ str_params->sparams.uc.aac_params.sfreq,
+ str_params->sparams.uc.aac_params.pcm_wd_sz,
+ str_params->sparams.uc.aac_params.aac_srate);
+ printk(KERN_DEBUG "SST DBG:mpgid=%d profile=%d, aot = %d\n",
+ str_params->sparams.uc.aac_params.mpg_id,
+ str_params->sparams.uc.aac_params.aac_profile,
+ str_params->sparams.uc.aac_params.aot);
+ break;
+ case SST_CODEC_TYPE_WMA9:
+ printk(KERN_DEBUG "SST DBG:wma type \n");
+ printk(KERN_DEBUG "SST DBG:chan=%d, brate=%d, sfreq = %d, wd_sz = %d, tag=%d\n",
+ str_params->sparams. uc.wma_params.num_chan,
+ str_params->sparams.uc.wma_params.brate,
+ str_params->sparams.uc.wma_params.sfreq,
+ str_params->sparams.uc.wma_params.pcm_wd_sz,
+ str_params->sparams.uc.wma_params.format_tag);
+ printk(KERN_DEBUG "SST DBG:mask=%d, +\
+ b align=%d, enc opt =%d, op align =%d\n",
+ str_params->sparams.uc.wma_params.channel_mask,
+ str_params->sparams.uc.wma_params.block_align,
+ str_params->sparams.uc.wma_params.wma_encode_opt,
+ str_params->sparams.uc.wma_params.op_align);
+ break;
+ default:
+ printk(KERN_DEBUG "SST DBG:other +\
+ codec 0x%x\n", str_params->codec);
+ }
+}
+
+/**
+* this function wakes up a sleeping block event based on the response
+*/
+void sst_wake_up_alloc_block(struct intel_sst_drv *sst_drv_ctx,
+ u8 sst_id, int status, void *data)
+{
+ int i;
+
+ /* Unblock with retval code */
+ for (i = 0; i < MAX_ACTIVE_STREAM; i++) {
+ if (sst_id == sst_drv_ctx->alloc_block[i].sst_id) {
+ sst_drv_ctx->alloc_block[i].ops_block.condition = true;
+ sst_drv_ctx->alloc_block[i].ops_block.ret_code = status;
+ sst_drv_ctx->alloc_block[i].ops_block.data = data;
+ printk(KERN_DEBUG "SST DBG:wake id %d, +\
+ sst_id %d condition %x\n", i,
+ sst_drv_ctx->alloc_block[i].sst_id,
+ sst_drv_ctx->alloc_block[i].ops_block.condition);
+ wake_up(&sst_drv_ctx->wait_queue);
+ break;
+ }
+ }
+}
--
1.6.2.2

View File

@ -1,85 +0,0 @@
From e17c41ab9c34ea8715c2655fcb623b0bb92eaab1 Mon Sep 17 00:00:00 2001
From: R, Dharageswari <dharageswari.r@intel.com>
Date: Thu, 29 Apr 2010 20:30:16 +0530
Subject: [PATCH] ADR-Post-Beta-0.05.002.03-8/8-Moorestown Audio Drivers: Config files
This patch adds the makefiles and Kconfig changes for both SST and MAD drivers
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
modified: sound/pci/Kconfig
modified: sound/pci/Makefile
new file: sound/pci/sst/Makefile
Patch-mainline: 2.6.35?
---
sound/pci/Kconfig | 25 +++++++++++++++++++++++++
sound/pci/Makefile | 3 ++-
sound/pci/sst/Makefile | 9 +++++++++
3 files changed, 36 insertions(+), 1 deletions(-)
create mode 100644 sound/pci/sst/Makefile
diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig
index 1513d72..e41380d 100644
--- a/sound/pci/Kconfig
+++ b/sound/pci/Kconfig
@@ -8,6 +8,30 @@ menuconfig SND_PCI
Support for sound devices connected via the PCI bus.
if SND_PCI
+config SND_INTEL_SST
+ bool "Moorestown SST (LPE) Driver"
+ depends on X86 && LNW_IPC
+ default y
+ help
+ Say Y here to include support for the Moorestown SST DSP driver
+ On other PC platforms if you are unsure answer 'N'
+
+config SND_INTELMID
+ bool "Moorestown sound card driver"
+ select SND_JACK
+ depends on SND_INTEL_SST && SPI_MRST
+ default y
+ help
+ Say Y here to include support for the Moorestown sound driver.
+ On other PC platforms if you are unsure answer 'N'
+
+config SND_AUDIO_DBG_PRINT
+ bool "Moorestown Audio driver debug printk calls"
+ depends on SND_INTELMID
+ default n
+ help
+ Say Y here to include debug printks calls in the Intel MID driver.
+ If you are unsure say 'N'
config SND_AD1889
tristate "Analog Devices AD1889"
select SND_AC97_CODEC
diff --git a/sound/pci/Makefile b/sound/pci/Makefile
index 5665c1e..541057b 100644
--- a/sound/pci/Makefile
+++ b/sound/pci/Makefile
@@ -77,4 +77,5 @@ obj-$(CONFIG_SND) += \
rme9652/ \
trident/ \
ymfpci/ \
- vx222/
+ vx222/ \
+ sst/
diff --git a/sound/pci/sst/Makefile b/sound/pci/sst/Makefile
new file mode 100644
index 0000000..cf96b11
--- /dev/null
+++ b/sound/pci/sst/Makefile
@@ -0,0 +1,9 @@
+#
+# Makefile for Intel MID Audio drivers
+#
+EXTRA_CFLAGS=-g -DCONFIG_MRST_RAR_HANDLER
+snd-intel-sst-objs := intel_sst.o intel_sst_ipc.o intel_sst_stream.o intel_sst_interface.o intel_sst_dsp.o intel_sst_pvt.o
+snd-intelmid-objs := intelmid.o intelmid_v0_control.o intelmid_v1_control.o intelmid_v2_control.o intelmid_ctrl.o intelmid_pvt.o
+# Toplevel Module Dependency
+obj-$(CONFIG_SND_INTEL_SST) += snd-intel-sst.o
+obj-$(CONFIG_SND_INTELMID) += snd-intelmid.o
--
1.6.2.2

View File

@ -1,465 +0,0 @@
From b9a664ffe791221bd2d7bc625f8b288d7dc8549a Mon Sep 17 00:00:00 2001
From: Jacob Pan <jacob.jun.pan@intel.com>
Date: Mon, 4 Jan 2010 11:04:34 -0800
Subject: [PATCH 057/104] Ericsson MBM Driver
Signed-off-by: Jacob Pan <jacob.jun.pan@intel.com>
---
drivers/net/usb/Kconfig | 17 ++
drivers/net/usb/Makefile | 1 +
drivers/net/usb/mbm.c | 375 ++++++++++++++++++++++++++++++++++++++++++++
drivers/net/usb/usbnet.c | 3 +
include/linux/usb/usbnet.h | 1 +
5 files changed, 397 insertions(+), 0 deletions(-)
create mode 100644 drivers/net/usb/mbm.c
diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig
index 32d9356..adb6d4c 100644
--- a/drivers/net/usb/Kconfig
+++ b/drivers/net/usb/Kconfig
@@ -361,6 +361,23 @@ config USB_HSO
To compile this driver as a module, choose M here: the
module will be called hso.
+config USB_NET_MBM
+ tristate "Ericsson Mobile Broadband Module"
+ depends on USB_USBNET
+ select USB_NET_CDCETHER
+ default y
+ help
+ Choose this option to support Mobile Broadband devices from
+ Ericsson MBM, Mobile Broadband Module.
+ This driver should work with at least the following devices:
+ * Ericsson Mobile Broadband Minicard
+ * Ericsson F3507g Wireless Module
+ * Ericsson F3607gw Broadband Module
+ * Dell Wireless 5530 HSPA
+ * Toshiba F3507g
+ * Sony Ericsson EC400
+ * Sony Ericsson MD400
+
config USB_NET_INT51X1
tristate "Intellon PLC based usb adapter"
depends on USB_USBNET
diff --git a/drivers/net/usb/Makefile b/drivers/net/usb/Makefile
index e17afb7..82d5f60 100644
--- a/drivers/net/usb/Makefile
+++ b/drivers/net/usb/Makefile
@@ -18,6 +18,7 @@ obj-$(CONFIG_USB_NET_PLUSB) += plusb.o
obj-$(CONFIG_USB_NET_RNDIS_HOST) += rndis_host.o
obj-$(CONFIG_USB_NET_CDC_SUBSET) += cdc_subset.o
obj-$(CONFIG_USB_NET_ZAURUS) += zaurus.o
+obj-$(CONFIG_USB_NET_MBM) += mbm.o
obj-$(CONFIG_USB_NET_MCS7830) += mcs7830.o
obj-$(CONFIG_USB_USBNET) += usbnet.o
obj-$(CONFIG_USB_NET_INT51X1) += int51x1.o
diff --git a/drivers/net/usb/mbm.c b/drivers/net/usb/mbm.c
new file mode 100644
index 0000000..4bb909b
--- /dev/null
+++ b/drivers/net/usb/mbm.c
@@ -0,0 +1,375 @@
+/* -*- linux-c -*-
+ * Copyright (C) 2008 Carl Nordbeck <Carl.Nordbeck@ericsson.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/netdevice.h>
+#include <linux/ctype.h>
+#include <linux/ethtool.h>
+#include <linux/workqueue.h>
+#include <linux/mii.h>
+#include <linux/crc32.h>
+#include <linux/usb.h>
+#include <linux/usb/cdc.h>
+#include <linux/usb/usbnet.h>
+
+#define DRIVER_VERSION "0.03"
+
+/* Bogus speed for bugy HSPA modems */
+#define TX_LINK_SPEED 0x001E8480 /* 2.0 Mbps */
+#define RX_LINK_SPEED 0x006DDD00 /* 7.2 Mbps */
+#define FIX_SPEED 0x00989680 /* 10.0 Mbps */
+
+struct mbm_data {
+ unsigned int rx_speed;
+ unsigned int tx_speed;
+ unsigned int connect;
+};
+
+static const u8 mbm_guid[16] = {
+ 0xa3, 0x17, 0xa8, 0x8b, 0x04, 0x5e, 0x4f, 0x01,
+ 0xa6, 0x07, 0xc0, 0xff, 0xcb, 0x7e, 0x39, 0x2a,
+};
+static void dumpspeed(struct usbnet *dev, __le32 *speeds)
+{
+ struct mbm_data *data = (void *)&dev->data;
+
+ data->rx_speed = __le32_to_cpu(speeds[0]);
+ data->tx_speed = __le32_to_cpu(speeds[1]);
+
+ if (data->rx_speed == FIX_SPEED && data->tx_speed == FIX_SPEED) {
+/* Bogus speed for buggy HSPA modems */
+ dev_info(&dev->udev->dev,
+ "link speeds: %u kbps RX, %u kbps TX\n",
+ RX_LINK_SPEED / 1000, TX_LINK_SPEED / 1000);
+
+ data->rx_speed = RX_LINK_SPEED;
+ data->tx_speed = TX_LINK_SPEED;
+ } else
+ dev_info(&dev->udev->dev,
+ "link speeds: %u kbps RX, %u kbps TX\n",
+ __le32_to_cpu(speeds[0]) / 1000,
+ __le32_to_cpu(speeds[1]) / 1000);
+}
+
+static void mbm_status(struct usbnet *dev, struct urb *urb)
+{
+ struct mbm_data *data = (void *)&dev->data;
+ struct usb_cdc_notification *event;
+
+ if (urb->actual_length < sizeof(*event))
+ return;
+
+ /* SPEED_CHANGE can get split into two 8-byte packets */
+ if (test_and_clear_bit(EVENT_STS_SPLIT, &dev->flags)) {
+ dumpspeed(dev, (__le32 *) urb->transfer_buffer);
+ return;
+ }
+
+ event = urb->transfer_buffer;
+ switch (event->bNotificationType) {
+ case USB_CDC_NOTIFY_NETWORK_CONNECTION:
+ data->connect = event->wValue;
+ if (netif_msg_timer(dev))
+ dev_dbg(&dev->udev->dev, "CDC: carrier %s\n",
+ data->connect ? "on" : "off");
+ if (event->wValue)
+ netif_carrier_on(dev->net);
+ else
+ netif_carrier_off(dev->net);
+ break;
+ case USB_CDC_NOTIFY_SPEED_CHANGE: /* tx/rx rates */
+ if (netif_msg_timer(dev))
+ dev_dbg(&dev->udev->dev, "CDC: speed change (len %d)\n",
+ urb->actual_length);
+ if (urb->actual_length != (sizeof(*event) + 8))
+ set_bit(EVENT_STS_SPLIT, &dev->flags);
+ else
+ dumpspeed(dev, (__le32 *) &event[1]);
+ break;
+ default:
+ dev_err(&dev->udev->dev, "CDC: unexpected notification %02x!\n",
+ event->bNotificationType);
+ break;
+ }
+}
+
+static u8 nibble(unsigned char c)
+{
+ if (likely(isdigit(c)))
+ return c - '0';
+ c = toupper(c);
+ if (likely(isxdigit(c)))
+ return 10 + c - 'A';
+ return 0;
+}
+
+static inline int
+get_ethernet_addr(struct usbnet *dev, struct usb_cdc_ether_desc *e)
+{
+ int tmp, i;
+ unsigned char buf[13];
+
+ tmp = usb_string(dev->udev, e->iMACAddress, buf, sizeof(buf));
+ if (tmp != 12) {
+ dev_dbg(&dev->udev->dev,
+ "bad MAC string %d fetch, %d\n", e->iMACAddress, tmp);
+ if (tmp >= 0)
+ tmp = -EINVAL;
+ return tmp;
+ }
+ for (i = tmp = 0; i < 6; i++, tmp += 2)
+ dev->net->dev_addr[i] =
+ (nibble(buf[tmp]) << 4) + nibble(buf[tmp + 1]);
+ return 0;
+}
+
+static void mbm_get_drvinfo(struct net_device *net,
+ struct ethtool_drvinfo *info)
+{
+ struct usbnet *dev = netdev_priv(net);
+
+ strncpy(info->driver, dev->driver_name, sizeof(info->driver));
+ strncpy(info->version, DRIVER_VERSION, sizeof(info->version));
+ strncpy(info->fw_version, dev->driver_info->description,
+ sizeof(info->fw_version));
+ usb_make_path(dev->udev, info->bus_info, sizeof(info->bus_info));
+}
+
+static struct ethtool_ops mbm_ethtool_ops = {
+ .get_drvinfo = mbm_get_drvinfo,
+ .get_link = usbnet_get_link,
+ .get_msglevel = usbnet_get_msglevel,
+ .set_msglevel = usbnet_set_msglevel,
+ .get_settings = usbnet_get_settings,
+ .set_settings = usbnet_set_settings,
+ .nway_reset = usbnet_nway_reset,
+};
+
+static int mbm_check_connect(struct usbnet *dev)
+{
+ struct mbm_data *data = (void *)&dev->data;
+
+ return !data->connect;
+}
+
+static int mbm_bind(struct usbnet *dev, struct usb_interface *intf)
+{
+ struct cdc_state *info = (void *)&dev->data;
+ struct usb_driver *driver = driver_of(intf);
+ struct usb_interface_descriptor *d = NULL;
+ struct usb_cdc_mdlm_desc *desc = NULL;
+ struct usb_cdc_mdlm_detail_desc *detail = NULL;
+ struct mbm_data *data = NULL;
+
+ u8 *buf = intf->cur_altsetting->extra;
+ int len = intf->cur_altsetting->extralen;
+ int status;
+
+ memset(info, 0, sizeof(*info));
+ info->control = intf;
+ while (len > 3) {
+ if (buf[1] != USB_DT_CS_INTERFACE)
+ goto next_desc;
+
+ switch (buf[2]) {
+ case USB_CDC_MDLM_TYPE:
+ if (info->header)
+ goto bad_desc;
+
+ desc = (void *)buf;
+
+ if (desc->bLength != sizeof(*desc))
+ goto bad_desc;
+
+ if (memcmp(&desc->bGUID, mbm_guid, 16))
+ goto bad_desc;
+ break;
+ case USB_CDC_MDLM_DETAIL_TYPE:
+ if (detail)
+ goto bad_desc;
+
+ detail = (void *)buf;
+
+ if (detail->bGuidDescriptorType == 0) {
+ if (detail->bLength < (sizeof(*detail) + 1))
+ goto bad_desc;
+ }
+ break;
+ case USB_CDC_UNION_TYPE:
+ if (info->u)
+ goto bad_desc;
+
+ info->u = (void *)buf;
+
+ if (info->u->bLength != sizeof(*info->u))
+ goto bad_desc;
+
+ info->control = usb_ifnum_to_if(dev->udev,
+ info->u->
+ bMasterInterface0);
+ info->data =
+ usb_ifnum_to_if(dev->udev,
+ info->u->bSlaveInterface0);
+ if (!info->control || !info->data) {
+ dev_dbg(&intf->dev,
+ "master #%u/%p slave #%u/%p\n",
+ info->u->bMasterInterface0,
+ info->control,
+ info->u->bSlaveInterface0, info->data);
+ goto bad_desc;
+ }
+
+ /* a data interface altsetting does the real i/o */
+ d = &info->data->cur_altsetting->desc;
+ if (d->bInterfaceClass != USB_CLASS_CDC_DATA)
+ goto bad_desc;
+ break;
+ case USB_CDC_ETHERNET_TYPE:
+ if (info->ether)
+ goto bad_desc;
+
+ info->ether = (void *)buf;
+ if (info->ether->bLength != sizeof(*info->ether))
+ goto bad_desc;
+ dev->hard_mtu =
+ le16_to_cpu(info->ether->wMaxSegmentSize);
+ break;
+ }
+next_desc:
+ len -= buf[0]; /* bLength */
+ buf += buf[0];
+ }
+
+ if (!desc || !detail) {
+ dev_dbg(&intf->dev, "missing cdc mdlm %s%sdescriptor\n",
+ desc ? "" : "func ", detail ? "" : "detail ");
+ goto bad_desc;
+ }
+
+ if (!info->u || (!info->ether)) {
+ dev_dbg(&intf->dev, "missing cdc %s%s%sdescriptor\n",
+ info->header ? "" : "header ",
+ info->u ? "" : "union ", info->ether ? "" : "ether ");
+ goto bad_desc;
+ }
+
+ status = usb_driver_claim_interface(driver, info->data, dev);
+ if (status < 0) {
+ dev_dbg(&intf->dev, "Failed claimin interface\n");
+ return status;
+ }
+ status = usbnet_get_endpoints(dev, info->data);
+ if (status < 0) {
+ dev_dbg(&intf->dev, "Failed get endpoints\n");
+ usb_set_intfdata(info->data, NULL);
+ usb_driver_release_interface(driver, info->data);
+ return status;
+ }
+
+ dev->status = NULL;
+ if (info->control->cur_altsetting->desc.bNumEndpoints == 1) {
+ struct usb_endpoint_descriptor *desc;
+
+ dev->status = &info->control->cur_altsetting->endpoint[0];
+ desc = &dev->status->desc;
+ if (!usb_endpoint_is_int_in(desc)
+ || (le16_to_cpu(desc->wMaxPacketSize)
+ < sizeof(struct usb_cdc_notification))
+ || !desc->bInterval) {
+ dev_dbg(&intf->dev, "bad notification endpoint\n");
+ dev->status = NULL;
+ }
+ }
+ usb_set_intfdata(intf, data);
+ dev->net->ethtool_ops = &mbm_ethtool_ops;
+
+ status = get_ethernet_addr(dev, info->ether);
+ if (status < 0) {
+ usb_set_intfdata(info->data, NULL);
+ usb_driver_release_interface(driver_of(intf), info->data);
+ return status;
+ }
+
+ return 0;
+
+bad_desc:
+ dev_info(&dev->udev->dev, "unsupported MDLM descriptors\n");
+ return -ENODEV;
+}
+
+static const struct driver_info mbm_info = {
+ .description = "Mobile Broadband Network Device",
+ .flags = FLAG_MBN,
+ .check_connect = mbm_check_connect,
+ .bind = mbm_bind,
+ .unbind = usbnet_cdc_unbind,
+ .status = mbm_status,
+};
+
+static const struct usb_device_id products[] = {
+ {
+ USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MDLM,
+ USB_CDC_PROTO_NONE),
+ .driver_info = (unsigned long)&mbm_info,
+ },
+
+ {}, /* END */
+};
+
+MODULE_DEVICE_TABLE(usb, products);
+
+int mbm_suspend(struct usb_interface *intf, pm_message_t message)
+{
+ dev_dbg(&intf->dev, "mbm%d_suspend\n", intf->minor);
+ return usbnet_suspend(intf, message);
+}
+
+int mbm_resume(struct usb_interface *intf)
+{
+ dev_dbg(&intf->dev, "mbm%d_resume\n", intf->minor);
+ return usbnet_resume(intf);
+}
+
+static struct usb_driver usbmbm_driver = {
+ .name = "mbm",
+ .id_table = products,
+ .probe = usbnet_probe,
+ .disconnect = usbnet_disconnect,
+ .suspend = mbm_suspend,
+ .resume = mbm_resume,
+ .supports_autosuspend = 1,
+};
+
+static int __init usbmbm_init(void)
+{
+ return usb_register(&usbmbm_driver);
+}
+
+module_init(usbmbm_init);
+
+static void __exit usbmbm_exit(void)
+{
+ usb_deregister(&usbmbm_driver);
+}
+
+module_exit(usbmbm_exit);
+
+MODULE_AUTHOR("Carl Nordbeck");
+MODULE_DESCRIPTION("Ericsson Mobile Broadband");
+MODULE_LICENSE("GPL");
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 035fab0..4733b73 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1371,6 +1371,9 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
/* WWAN devices should always be named "wwan%d" */
if ((dev->driver_info->flags & FLAG_WWAN) != 0)
strcpy(net->name, "wwan%d");
+ /* MB devices should always be named "mb%d" */
+ if (dev->driver_info->flags & FLAG_MBN)
+ strcpy (net->name, "mb%d");
/* maybe the remote can't receive an Ethernet MTU */
if (net->mtu > (dev->hard_mtu - net->hard_header_len))
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
index 8ce6135..e47afbf 100644
--- a/include/linux/usb/usbnet.h
+++ b/include/linux/usb/usbnet.h
@@ -94,6 +94,7 @@ struct driver_info {
#define FLAG_AVOID_UNLINK_URBS 0x0100 /* don't unlink urbs at usbnet_stop() */
#define FLAG_SEND_ZLP 0x0200 /* hw requires ZLPs are sent */
#define FLAG_WWAN 0x0400 /* use "wwan%d" names */
+#define FLAG_MBN 0x0800 /* use "mb%d" names */
#define FLAG_LINK_INTR 0x0800 /* updates link (carrier) status */
--
1.6.2.5

View File

@ -1,25 +0,0 @@
From: Alek Du <alek.du@intel.com>
Date: Mon, 19 Apr 2010 12:39:37 -0800
Subject: [PATCH] ehci: Only enable QH prefetch on Moorestown
Patch-mainline: when mrst code is merged?
Hardware QH prefetch feature is found to be buggy on some none-moorestown
platforms. Disable this feature on other platforms at the moment.
Signed-off-by: Alek Du <alek.du@intel.com>
---
drivers/usb/host/ehci-hcd.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -595,7 +595,9 @@ static int ehci_init(struct usb_hcd *hcd
}
if (HCC_HW_PREFETCH(hcc_params)) {
ehci_dbg(ehci, "HW prefetch capable %d\n", park);
+#ifdef CONFIG_X86_MRST
temp |= (CMD_ASPE | CMD_PSPE);
+#endif
}
if (HCC_CANPARK(hcc_params)) {

View File

@ -1,85 +0,0 @@
From 39fd545bb198f6e17e7e8f730535e3976088cd9f Mon Sep 17 00:00:00 2001
From: Alan Olsen <alan.r.olsen@intel.com>
Date: Fri, 26 Mar 2010 11:59:00 -0700
Subject: [PATCH] GPE fix for sensors
Patch-mainline: 2.6.35?
Signed-off-by: Alan Olsen <alan.r.olsen@intel.com>
---
drivers/hwmon/emc1403.c | 53 ++++++++--------------------------------------
1 files changed, 10 insertions(+), 43 deletions(-)
diff --git a/drivers/hwmon/emc1403.c b/drivers/hwmon/emc1403.c
index 75e3b15..c94d933 100644
--- a/drivers/hwmon/emc1403.c
+++ b/drivers/hwmon/emc1403.c
@@ -33,7 +33,6 @@
#include <linux/delay.h>
#include <linux/mutex.h>
#include <linux/sysfs.h>
-#include <linux/gpe.h>
#include <linux/intel_mid.h>
@@ -624,48 +623,16 @@ static int emc1403_probe(struct i2c_client *new_client,
data->therm_irq = t_irq & ~IRQ_TYPE_MASK;
data->alert_irq = a_irq & ~IRQ_TYPE_MASK;
/* interpret irq field */
- if (data->therm_irq == 0x113) {
- if (t_irq & IRQ_TYPE_MASK) {
- /* irq -> GPE_ID */
- res = request_gpe(data->therm_irq,
- (gpio_function_t)therm_interrupt_handler,
- data, DETECT_LEVEL_LOW);
- if (res)
- dev_crit(&new_client->dev, "%s(): cannot \
- register therm gpe \n", __func__);
- } else {
- res = request_irq(data->therm_irq,
- therm_interrupt_handler,
- DETECT_LEVEL_LOW, "emc1403", data);
- if (res)
- dev_crit(&new_client->dev, "%s(): \
- cannot get therm IRQ\n", __func__);
- }
- } else {
- printk(KERN_WARNING"emc1403: IRQ mismatch \
- sent for therm registration");
- }
- if (data->alert_irq == 0x114) {
- if (a_irq & IRQ_TYPE_MASK) {
- /* irq -> GPE_ID */
- res = request_gpe(data->alert_irq,
- (gpio_function_t)alert_interrupt_handler,
- data, DETECT_LEVEL_LOW);
- if (res)
- dev_crit(&new_client->dev, "%s(): \
- cannot register alert gpe \n", __func__);
- } else {
- res = request_irq(data->alert_irq,
- alert_interrupt_handler, DETECT_LEVEL_LOW,
- "emc1403", data);
- if (res)
- dev_crit(&new_client->dev, "%s(): cannot \
+ res = request_irq(data->therm_irq, therm_interrupt_handler,
+ IRQ_TYPE_EDGE_FALLING, "emc1403_therm", data);
+ if (res)
+ dev_crit(&new_client->dev, "%s(): \
+ cannot get therm IRQ\n", __func__);
+ res = request_irq(data->alert_irq, alert_interrupt_handler,
+ IRQ_TYPE_EDGE_FALLING, "emc1403_alert", data);
+ if (res)
+ dev_crit(&new_client->dev, "%s(): cannot \
get alert IRQ\n", __func__);
- }
- } else {
- printk(KERN_WARNING"emc1403: IRQ mismatch \
- sent for alert registration");
- }
#endif
emc1403_set_default_config(new_client);
dev_info(&new_client->dev, "%s EMC1403 Thermal chip found \n",
--
1.6.0.6

View File

@ -1,268 +0,0 @@
From 60bb8e915a1e55c5a562e59e694d37559d62de92 Mon Sep 17 00:00:00 2001
From: Sreenidhi Gurudatt <sreenidhi.b.gurudatt@intel.com>
Date: Mon, 3 Aug 2009 14:46:37 +0530
Subject: [PATCH 073/104] IPC Host driver for MRSTN. It is disabled by default. This driver implements basic ioctls to support testing of IPC driver from user space. It supports Device firmware upgrade feature to be invoked by user-space application.
modified: drivers/misc/Kconfig
modified: drivers/misc/Makefile
new file: drivers/misc/mrst_test_ipc/Makefile
new file: drivers/misc/mrst_test_ipc/ipc_module.c
Signed-off-by: Sreenidhi Gurudatt <sreenidhi.b.gurudatt@intel.com>
---
drivers/misc/Kconfig | 9 ++
drivers/misc/Makefile | 1 +
drivers/misc/mrst_test_ipc/Makefile | 5 +
drivers/misc/mrst_test_ipc/ipc_module.c | 196 +++++++++++++++++++++++++++++++
4 files changed, 211 insertions(+), 0 deletions(-)
create mode 100644 drivers/misc/mrst_test_ipc/Makefile
create mode 100644 drivers/misc/mrst_test_ipc/ipc_module.c
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index feb9cd9..5a7c342 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -260,6 +260,15 @@ config MRST_RAR_HANDLER
If unsure, say N.
+config MRST_IPC_TEST
+ tristate "IPC driver for testing IPC on Moorestown platform"
+ depends on X86
+ ---help---
+ IPC test driver for Intel Moorestown platform
+ Intel Moorestown platform.
+
+ If unsure, say N.
+
config MRST_VIB
tristate "vibrator driver for Intel Moorestown platform"
help
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index 0c24f0f..bce8396 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -14,6 +14,7 @@ obj-$(CONFIG_TIFM_CORE) += tifm_core.o
obj-$(CONFIG_TIFM_7XX1) += tifm_7xx1.o
obj-$(CONFIG_PHANTOM) += phantom.o
obj-$(CONFIG_SGI_IOC4) += ioc4.o
+obj-$(CONFIG_MRST_IPC_TEST) += mrst_test_ipc/
obj-$(CONFIG_ENCLOSURE_SERVICES) += enclosure.o
obj-$(CONFIG_KGDB_TESTS) += kgdbts.o
obj-$(CONFIG_SGI_XP) += sgi-xp/
diff --git a/drivers/misc/mrst_test_ipc/Makefile b/drivers/misc/mrst_test_ipc/Makefile
new file mode 100644
index 0000000..047d7db
--- /dev/null
+++ b/drivers/misc/mrst_test_ipc/Makefile
@@ -0,0 +1,5 @@
+
+obj-$(CONFIG_MRST_IPC_TEST) := test_ipc_mrst.o
+
+test_ipc_mrst-y := ipc_module.o \
+
diff --git a/drivers/misc/mrst_test_ipc/ipc_module.c b/drivers/misc/mrst_test_ipc/ipc_module.c
new file mode 100644
index 0000000..51ef8de
--- /dev/null
+++ b/drivers/misc/mrst_test_ipc/ipc_module.c
@@ -0,0 +1,196 @@
+/*
+ * ipc_module.c - Interface for IPC driver funtions exported by IPC driver
+ * interfaces for Moorsetown platform.
+ *
+ * Copyright (C) 2009 Intel Corp
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ * 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; version 2 of the License.
+ *
+ * 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.
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ * This driver provides IOCTL interfaces to call IPC driver module for
+ * Moorestown platform.
+ *
+ * Author: Sreenidhi Gurudatt <sreenidhi.b.gurudatt@intel.com>
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+
+#include <linux/slab.h>
+#include <linux/fs.h>
+#include <linux/errno.h>
+#include <linux/types.h>
+#include <linux/proc_fs.h>
+#include <linux/fcntl.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/sched.h>
+#include <linux/ioport.h>
+
+#include <linux/io.h>
+#include <linux/uaccess.h>
+#include <linux/time.h>
+
+#include <asm/ipc_defs.h>
+
+static u32 major;
+#define MAX_FW_SIZE 264192
+
+int init_ipc_driver(void);
+int ipc_ioctl(struct inode *inode, struct file *filp, u32 cmd,
+ unsigned long arg);
+const struct file_operations ipc_fops = {
+ioctl:ipc_ioctl,
+};
+
+
+int ipc_ioctl(struct inode *inode, struct file *filp, u32 cmd,
+ unsigned long arg)
+{
+ u32 upper = 0;
+ struct ipc_pmic_reg_data p_read_reg_data = { 0 };
+ struct ipc_pmic_mod_reg_data p_read_mod_reg_data = { 0 };
+ struct ipc_pmic_reg_data p_write_reg_data = { 0 };
+ u8 ipc_blocking_flag = TRUE;
+
+ int ret_val;
+ /*Device FW upgrade support*/
+ u8 *fw_buf = NULL ;
+
+ switch (cmd) {
+ case IPC_PMIC_REGISTER_READ:
+ {
+ printk(KERN_INFO
+ "ipc_driver IPC_PMIC_REGISTER_READ received\n");
+ ret_val =
+ copy_from_user(&p_read_reg_data,
+ (struct ipc_pmic_reg_data *)arg,
+ sizeof(struct ipc_pmic_reg_data));
+ if (ret_val < 0) {
+ printk(KERN_DEBUG
+ "copy_from_user FAILED!! <%s> function\
+ in <%s> file at <%d> line no\n",\
+ __func__, __FILE__, __LINE__);
+ return E_READ_USER_DATA;
+ }
+
+ ipc_pmic_register_read(&p_read_reg_data);
+ ret_val =
+ copy_to_user((struct ipc_pmic_reg_data *)arg,
+ &p_read_reg_data,
+ sizeof(struct ipc_pmic_reg_data));
+ break;
+ }
+ case IPC_PMIC_REGISTER_READ_MODIFY:
+ {
+ printk(KERN_INFO "ioctl\
+ IPC_PMIC_REGISTER_READ_MODIFY received\n");
+ ret_val =
+ copy_from_user(&p_read_mod_reg_data,
+ (struct ipc_pmic_mod_reg_data *)arg,
+ sizeof(struct ipc_pmic_mod_reg_data));
+ if (ret_val < 0) {
+ printk(KERN_DEBUG
+ "copy_from_user FAILED!! <%s> function\
+ in <%s> file at <%d> line no\n",\
+ __func__, __FILE__, __LINE__);
+ return E_READ_USER_DATA;
+ }
+ ipc_pmic_register_read_modify(&p_read_mod_reg_data);
+ ret_val =
+ copy_to_user((struct ipc_pmic_mod_reg_data *)arg,
+ &p_read_mod_reg_data,
+ sizeof(struct ipc_pmic_mod_reg_data));
+ break;
+ }
+ case IPC_PMIC_REGISTER_WRITE:
+ {
+ ret_val =
+ copy_from_user(&p_write_reg_data,
+ (struct ipc_pmic_reg_data *)arg,
+ sizeof(struct ipc_pmic_reg_data));
+ if (ret_val < 0) {
+ printk(KERN_DEBUG
+ "copy_from_user FAILED!! <%s> function\
+ in <%s> file at <%d> line no\n",\
+ __func__, __FILE__, __LINE__);
+ return E_WRITE_USER_DATA;
+ }
+ ipc_pmic_register_write(&p_write_reg_data,
+ ipc_blocking_flag);
+ ret_val =
+ copy_to_user((struct ipc_pmic_reg_data *)arg,
+ &p_write_reg_data,
+ sizeof(struct ipc_pmic_reg_data));
+ break;
+ }
+ case DEVICE_FW_UPGRADE:
+ {
+ printk(KERN_INFO "ioctl DEVICE_FW_UPGRADE received\n");
+ fw_buf = kmalloc(MAX_FW_SIZE, GFP_KERNEL);
+ if (fw_buf == NULL) {
+ printk(KERN_ERR "ipc_test: kmalloc failed! \n");
+ return -EBUSY;
+ }
+ ret_val = copy_from_user(fw_buf, (u8 *)arg,
+ MAX_FW_SIZE);
+ if (ret_val < 0) {
+ printk(KERN_DEBUG
+ "copy_from_user FAILED!! <%s> function\
+ in <%s> file at <%d> line no\n",\
+ __func__, __FILE__, __LINE__);
+ return -EINVAL;
+ }
+ ipc_device_fw_upgrade(fw_buf, MAX_FW_SIZE);
+ break;
+ }
+ default:
+ {
+ printk(KERN_INFO
+ "ioctl <UNRECOGNIZED> received\n");
+ break;
+ }
+ }
+ return upper;
+}
+
+static int __init ipc_module_init(void)
+{
+ printk(KERN_INFO "Init ipc_module\n");
+
+ major = register_chrdev(0, "mid_ipc", &ipc_fops);
+ if (major < 0) {
+ printk(KERN_ERR "ipc_test : failed to get major\n");
+ return major;
+ }
+
+ init_ipc_driver ( ) ;
+ return SUCCESS;
+
+}
+
+static void __exit ipc_module_exit(void)
+{
+ unregister_chrdev(major, "mid_ipc");
+}
+
+module_init(ipc_module_init);
+module_exit(ipc_module_exit);
+
+MODULE_LICENSE("GPL V2");
+MODULE_DESCRIPTION("Test Driver for MRST IPC driver");
+MODULE_AUTHOR("Sreenidhi Gurudatt")
+
--
1.6.2.5

View File

@ -1,839 +0,0 @@
From 3e65e5210bc3c81a58c60e365ee044f2e6044efc Mon Sep 17 00:00:00 2001
From: Zheng Ba <zheng.ba@intel.com>
Date: Sun, 22 Nov 2009 16:22:31 +0800
Subject: [PATCH 047/104] Full keypad controller driver patch for Beta
This patch adds the keypad support for Moorestown platform.
Changes from Alpha2: solved "CRITICAL" issues marked by Klocwork
HSD sighting 3469242
Signed-off-by: Zheng Ba <zheng.ba@intel.com>
---
drivers/input/keyboard/Kconfig | 7 +
drivers/input/keyboard/Makefile | 1 +
drivers/input/keyboard/mrst_keypad.c | 782 ++++++++++++++++++++++++++++++++++
3 files changed, 790 insertions(+), 0 deletions(-)
create mode 100644 drivers/input/keyboard/mrst_keypad.c
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index f7a4497..4c2bdaf 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -292,6 +292,13 @@ config KEYBOARD_MAX7359
To compile this driver as a module, choose M here: the
module will be called max7359_keypad.
+config KEYBOARD_MRST
+ tristate "MRST keypad support"
+ depends on GPIO_LANGWELL
+ help
+ Say Y if you want to use the mrst keypad
+ depends on GPIO_LANGWELL
+
config KEYBOARD_NEWTON
tristate "Newton keyboard"
select SERIO
diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile
index 78654ef..0337f76 100644
--- a/drivers/input/keyboard/Makefile
+++ b/drivers/input/keyboard/Makefile
@@ -14,6 +14,7 @@ obj-$(CONFIG_KEYBOARD_BFIN) += bf54x-keys.o
obj-$(CONFIG_KEYBOARD_CORGI) += corgikbd.o
obj-$(CONFIG_KEYBOARD_DAVINCI) += davinci_keyscan.o
obj-$(CONFIG_KEYBOARD_EP93XX) += ep93xx_keypad.o
+obj-$(CONFIG_KEYBOARD_MRST) += mrst_keypad.o
obj-$(CONFIG_KEYBOARD_GPIO) += gpio_keys.o
obj-$(CONFIG_KEYBOARD_HIL) += hil_kbd.o
obj-$(CONFIG_KEYBOARD_HIL_OLD) += hilkbd.o
diff --git a/drivers/input/keyboard/mrst_keypad.c b/drivers/input/keyboard/mrst_keypad.c
new file mode 100644
index 0000000..faf3ab7
--- /dev/null
+++ b/drivers/input/keyboard/mrst_keypad.c
@@ -0,0 +1,782 @@
+/*
+ * linux/drivers/input/keyboard/mrst_keypad.c
+ *
+ * Driver for the matrix keypad controller on Moorestown platform.
+ *
+ * Copyright (c) 2009 Intel Corporation.
+ * Created: Sep 18, 2008
+ * Updated: Apr 24, 2009
+ *
+ * Based on pxa27x_keypad.c by Rodolfo Giometti <giometti@linux.it>
+ * pxa27x_keypad.c is based on a previous implementation by Kevin O'Connor
+ * <kevin_at_keconnor.net> and Alex Osborne <bobofdoom@gmail.com> and
+ * on some suggestions by Nicolas Pitre <nico@cam.org>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
+#define DRV_NAME "mrst_keypad"
+#define DRV_VERSION "0.0.1"
+#define MRST_KEYPAD_DRIVER_NAME DRV_NAME " " DRV_VERSION
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/input.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/gpio.h>
+
+/*
+ * Keypad Controller registers
+ */
+#define KPC 0x0000 /* Keypad Control register */
+#define KPDK 0x0004 /* Keypad Direct Key register */
+#define KPREC 0x0008 /* Keypad Rotary Encoder register */
+#define KPMK 0x000C /* Keypad Matrix Key register */
+#define KPAS 0x0010 /* Keypad Automatic Scan register */
+
+/* Keypad Automatic Scan Multiple Key Presser register 0-3 */
+#define KPASMKP0 0x0014
+#define KPASMKP1 0x0018
+#define KPASMKP2 0x001C
+#define KPASMKP3 0x0020
+#define KPKDI 0x0024
+
+/* bit definitions */
+#define KPC_MKRN(n) ((((n) - 1) & 0x7) << 26) /* matrix key row number */
+#define KPC_MKCN(n) ((((n) - 1) & 0x7) << 23) /* matrix key col number */
+#define KPC_DKN(n) ((((n) - 1) & 0x7) << 6) /* direct key number */
+
+#define KPC_AS (0x1 << 30) /* Automatic Scan bit */
+#define KPC_ASACT (0x1 << 29) /* Automatic Scan on Activity */
+#define KPC_MI (0x1 << 22) /* Matrix interrupt bit */
+#define KPC_IMKP (0x1 << 21) /* Ignore Multiple Key Press */
+
+#define KPC_MS(n) (0x1 << (13 + (n))) /* Matrix scan line 'n' */
+#define KPC_MS_ALL (0xff << 13)
+
+#define KPC_ME (0x1 << 12) /* Matrix Keypad Enable */
+#define KPC_MIE (0x1 << 11) /* Matrix Interrupt Enable */
+#define KPC_DK_DEB_SEL (0x1 << 9) /* Direct Keypad Debounce Select */
+#define KPC_DI (0x1 << 5) /* Direct key interrupt bit */
+#define KPC_RE_ZERO_DEB (0x1 << 4) /* Rotary Encoder Zero Debounce */
+#define KPC_REE1 (0x1 << 3) /* Rotary Encoder1 Enable */
+#define KPC_REE0 (0x1 << 2) /* Rotary Encoder0 Enable */
+#define KPC_DE (0x1 << 1) /* Direct Keypad Enable */
+#define KPC_DIE (0x1 << 0) /* Direct Keypad interrupt Enable */
+
+#define KPDK_DKP (0x1 << 31)
+#define KPDK_DK(n) ((n) & 0xff)
+
+#define KPREC_OF1 (0x1 << 31)
+#define kPREC_UF1 (0x1 << 30)
+#define KPREC_OF0 (0x1 << 15)
+#define KPREC_UF0 (0x1 << 14)
+
+#define KPREC_RECOUNT0(n) ((n) & 0xff)
+#define KPREC_RECOUNT1(n) (((n) >> 16) & 0xff)
+
+#define KPMK_MKP (0x1 << 31)
+#define KPAS_SO (0x1 << 31)
+#define KPASMKPx_SO (0x1 << 31)
+
+#define KPAS_MUKP(n) (((n) >> 26) & 0x1f)
+#define KPAS_RP(n) (((n) >> 4) & 0xf)
+#define KPAS_CP(n) ((n) & 0xf)
+
+#define KPASMKP_MKC_MASK (0xff)
+
+#define KEYPAD_MATRIX_GPIO_IN_PIN 24
+#define KEYPAD_MATRIX_GPIO_OUT_PIN 32
+#define KEYPAD_DIRECT_GPIO_IN_PIN 40
+
+
+static struct pci_device_id keypad_pci_tbl[] = {
+ {0x8086, 0x0805, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+ {0,}
+};
+MODULE_DEVICE_TABLE(pci, keypad_pci_tbl);
+
+#define keypad_readl(off) readl(keypad->mmio_base + (off))
+#define keypad_writel(off, v) writel((v), keypad->mmio_base + (off))
+
+#define MAX_MATRIX_KEY_NUM (8 * 8)
+#define MAX_DIRECT_KEY_NUM (4)
+
+#define MAX_MATRIX_KEY_ROWS (8)
+#define MAX_MATRIX_KEY_COLS (8)
+#define DEBOUNCE_INTERVAL 100
+
+#define KEY_HALFSHUTTER KEY_PROG1
+#define KEY_FULLSHUTTER KEY_CAMERA
+
+static unsigned int mrst_keycode[MAX_MATRIX_KEY_NUM] = {
+ KEY_F, KEY_D, KEY_E, KEY_GRAVE, KEY_C, KEY_R, KEY_4, KEY_V,
+ KEY_NUMLOCK, KEY_LEFTCTRL, KEY_Z, KEY_W, KEY_2, KEY_X, KEY_S, KEY_3,
+ KEY_EQUAL, KEY_N, KEY_H, KEY_U, KEY_7, KEY_M, KEY_J, KEY_8,
+ KEY_6, KEY_5, KEY_APOSTROPHE, KEY_G, KEY_T, KEY_SPACE, KEY_B, KEY_Y,
+ KEY_MINUS, KEY_0, KEY_LEFT, KEY_SEMICOLON, KEY_P, KEY_DOWN, KEY_UP,
+ KEY_BACKSPACE,
+ KEY_L, KEY_K, KEY_I, KEY_SLASH, KEY_COMMA, KEY_O, KEY_9, KEY_DOT,
+ KEY_Q, KEY_TAB, KEY_ESC, KEY_LEFTSHIFT, KEY_CAPSLOCK, KEY_1, KEY_FN,
+ KEY_A,
+ 0, KEY_RIGHTSHIFT, KEY_ENTER, 0, KEY_RIGHT, 0, 0, 0,
+};
+
+/* NumLk key mapping */
+static unsigned int mrst_keycode_numlck[MAX_MATRIX_KEY_NUM] = {
+ KEY_F, KEY_D, KEY_E, KEY_GRAVE, KEY_C, KEY_R, KEY_4, KEY_V,
+ KEY_NUMLOCK, KEY_LEFTCTRL, KEY_Z, KEY_W, KEY_2, KEY_X, KEY_S, KEY_3,
+ KEY_EQUAL, KEY_N, KEY_H, KEY_KP4, KEY_KP7, KEY_KP0, KEY_KP1, KEY_KP8,
+ KEY_6, KEY_5, KEY_APOSTROPHE, KEY_G, KEY_T, KEY_SPACE, KEY_B, KEY_Y,
+ KEY_MINUS, KEY_KPSLASH, KEY_LEFT, KEY_KPMINUS, KEY_KPASTERISK,
+ KEY_DOWN, KEY_UP, KEY_BACKSPACE,
+ KEY_KP3, KEY_KP2, KEY_KP5, KEY_SLASH, KEY_KPDOT, KEY_KP6, KEY_KP9,
+ KEY_KPPLUS,
+ KEY_Q, KEY_TAB, KEY_ESC, KEY_LEFTSHIFT, KEY_CAPSLOCK, KEY_1, KEY_FN,
+ KEY_A,
+ 0, KEY_RIGHTSHIFT, KEY_ENTER, 0, KEY_RIGHT, 0, 0, 0,
+};
+
+/* Fn key mapping */
+static unsigned int mrst_keycode_fn[MAX_MATRIX_KEY_NUM] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ KEY_LEFTBRACE, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, KEY_HOME, 0, 0, KEY_PAGEDOWN, KEY_PAGEUP, 0,
+ 0, 0, 0, KEY_RIGHTBRACE, KEY_LEFTBRACE, 0, 0, KEY_RIGHTBRACE,
+ 0, 0, 0, KEY_LEFTSHIFT, 0, 0, KEY_FN, 0,
+ 0, KEY_RIGHTSHIFT, 0, 0, KEY_END, 0, 0, 0,
+};
+
+/* direct key map */
+static unsigned int mrst_direct_keycode[MAX_DIRECT_KEY_NUM] = {
+ KEY_VOLUMEUP, KEY_VOLUMEDOWN, KEY_HALFSHUTTER, KEY_FULLSHUTTER,
+};
+
+struct mrst_keypad {
+
+ struct input_dev *input_dev;
+ void __iomem *mmio_base;
+
+ unsigned int matrix_key_rows;
+ unsigned int matrix_key_cols;
+ int matrix_key_map_size;
+
+ /* key debounce interval */
+ unsigned int debounce_interval;
+
+ /* matrix key code map */
+ unsigned int matrix_keycodes[MAX_MATRIX_KEY_NUM];
+
+ /* state row bits of each column scan */
+ uint32_t matrix_key_state[MAX_MATRIX_KEY_COLS];
+ uint32_t direct_key_state;
+
+ unsigned int direct_key_mask;
+
+ int direct_key_num;
+
+ unsigned int direct_key_map[MAX_DIRECT_KEY_NUM];
+
+ /* rotary encoders 0 */
+ int enable_rotary0;
+ int rotary0_rel_code;
+ int rotary0_up_key;
+ int rotary0_down_key;
+
+ /* rotary encoders 1 */
+ int enable_rotary1;
+ int rotary1_rel_code;
+ int rotary1_up_key;
+ int rotary1_down_key;
+
+ int rotary_rel_code[2];
+ int rotary_up_key[2];
+ int rotary_down_key[2];
+
+ /* Fn key */
+ int fn;
+
+ /* Number Lock key */
+ int numlck;
+
+ /* FIXME:
+ * Keypad controller likely issues fake interrupts
+ * when direct key status registers were first initialized
+ * This value assures this interrupt will not be proceeded.
+ */
+ int count;
+};
+
+static void mrst_keypad_build_keycode(struct mrst_keypad *keypad)
+{
+ struct input_dev *input_dev = keypad->input_dev;
+ unsigned int *key;
+ int i, code;
+
+ keypad->matrix_key_rows = MAX_MATRIX_KEY_ROWS;
+ keypad->matrix_key_cols = MAX_MATRIX_KEY_COLS;
+ keypad->matrix_key_map_size = MAX_MATRIX_KEY_NUM;
+ keypad->debounce_interval = DEBOUNCE_INTERVAL;
+
+ /* three sets of keycode here */
+ if (keypad->fn)
+ memcpy(keypad->matrix_keycodes, mrst_keycode_fn,
+ sizeof(keypad->matrix_keycodes));
+ else if (keypad->numlck)
+ memcpy(keypad->matrix_keycodes, mrst_keycode_numlck,
+ sizeof(keypad->matrix_keycodes));
+ else
+ memcpy(keypad->matrix_keycodes, mrst_keycode,
+ sizeof(keypad->matrix_keycodes));
+
+ memcpy(keypad->direct_key_map, mrst_direct_keycode,
+ sizeof(keypad->direct_key_map));
+
+ key = &keypad->matrix_keycodes[0];
+ for (i = 0; i < MAX_MATRIX_KEY_NUM; i++, key++) {
+ code = (*key) & 0xffffff;
+ set_bit(code, input_dev->keybit);
+ }
+
+ key = &keypad->direct_key_map[0];
+ for (i = 0; i < MAX_DIRECT_KEY_NUM; i++, key++) {
+ code = (*key) & 0xffffff;
+ set_bit(code, input_dev->keybit);
+ }
+
+ keypad->direct_key_num = MAX_DIRECT_KEY_NUM;
+ keypad->enable_rotary0 = 0;
+ keypad->enable_rotary1 = 0;
+
+}
+
+static inline unsigned int lookup_matrix_keycode(
+ struct mrst_keypad *keypad, int row, int col)
+{
+ return keypad->matrix_keycodes[(row << 3) + col];
+}
+
+static void handle_constant_keypress(struct mrst_keypad *keypad,
+ int num, int col, int row,
+ int state)
+{
+ struct input_dev *dev = keypad->input_dev;
+
+ switch (num) {
+ case 0:
+ if (keypad->fn)
+ keypad->fn = 0;
+ /* Manually release special keys (Fn combinations) */
+ if (test_bit(KEY_LEFTBRACE, dev->key))
+ input_report_key(dev, KEY_LEFTBRACE, 0);
+ if (test_bit(KEY_RIGHTBRACE, dev->key))
+ input_report_key(dev, KEY_RIGHTBRACE, 0);
+ if (test_bit(KEY_HOME, dev->key))
+ input_report_key(dev, KEY_RIGHTBRACE, 0);
+ if (test_bit(KEY_END, dev->key))
+ input_report_key(dev, KEY_END, 0);
+ if (test_bit(KEY_PAGEUP, dev->key))
+ input_report_key(dev, KEY_RIGHTBRACE, 0);
+ if (test_bit(KEY_PAGEDOWN, dev->key))
+ input_report_key(dev, KEY_RIGHTBRACE, 0);
+
+ return;
+
+ case 1:
+ /* if Fn pressed */
+ if (col == 6 && row == 6)
+ keypad->fn = 1;
+ /* key '[' */
+ else if ((col == 0 && row == 2) && state) {
+ keypad->fn = 0;
+ set_bit(KEY_EQUAL, dev->key);
+ dev->repeat_key = KEY_EQUAL;
+ }
+ /* key ']' */
+ else if ((col == 3 && row == 5) && state) {
+ keypad->fn = 0;
+ set_bit(KEY_SLASH, dev->key);
+ dev->repeat_key = KEY_SLASH;
+ }
+ /* key '{' */
+ else if ((col == 4 && row == 5) && state) {
+ keypad->fn = 0;
+ set_bit(KEY_COMMA, dev->key);
+ dev->repeat_key = KEY_COMMA;
+ }
+ /* key '}' */
+ else if ((col == 7 && row == 5) && state) {
+ keypad->fn = 0;
+ set_bit(KEY_DOT, dev->key);
+ dev->repeat_key = KEY_DOT;
+ }
+
+ return;
+ default:
+ ;
+ }
+}
+
+static void mrst_keypad_scan_matrix(struct mrst_keypad *keypad)
+{
+ int row, col, num_keys_pressed = 0;
+ uint32_t new_state[MAX_MATRIX_KEY_COLS];
+ uint32_t kpas = keypad_readl(KPAS);
+ int status;
+
+ num_keys_pressed = KPAS_MUKP(kpas);
+
+ memset(new_state, 0, sizeof(new_state));
+
+ if (num_keys_pressed == 0) {
+ status = keypad->matrix_key_state[0] & (1 << 0);
+ handle_constant_keypress(keypad, num_keys_pressed, 0, 0,
+ status);
+
+ goto scan;
+ }
+
+ if (num_keys_pressed == 1) {
+ col = KPAS_CP(kpas);
+ row = KPAS_RP(kpas);
+
+ /* if invalid row/col, treat as no key pressed */
+ if (col < MAX_MATRIX_KEY_COLS &&
+ row < MAX_MATRIX_KEY_ROWS) {
+
+ /* if NumLk pressed */
+ if (col == 0 && row == 1)
+ keypad->numlck = !keypad->numlck;
+
+ status = keypad->matrix_key_state[col] & (1 << row);
+ handle_constant_keypress(keypad, num_keys_pressed, col,
+ row, status);
+
+ new_state[col] = (1 << row);
+ }
+
+ goto scan;
+ }
+
+ if (num_keys_pressed > 1) {
+ uint32_t kpasmkp0 = keypad_readl(KPASMKP0);
+ uint32_t kpasmkp1 = keypad_readl(KPASMKP1);
+ uint32_t kpasmkp2 = keypad_readl(KPASMKP2);
+ uint32_t kpasmkp3 = keypad_readl(KPASMKP3);
+
+ new_state[0] = kpasmkp0 & KPASMKP_MKC_MASK;
+ new_state[1] = (kpasmkp0 >> 16) & KPASMKP_MKC_MASK;
+ new_state[2] = kpasmkp1 & KPASMKP_MKC_MASK;
+ new_state[3] = (kpasmkp1 >> 16) & KPASMKP_MKC_MASK;
+ new_state[4] = kpasmkp2 & KPASMKP_MKC_MASK;
+ new_state[5] = (kpasmkp2 >> 16) & KPASMKP_MKC_MASK;
+ new_state[6] = kpasmkp3 & KPASMKP_MKC_MASK;
+ new_state[7] = (kpasmkp3 >> 16) & KPASMKP_MKC_MASK;
+
+ /* if Fn is pressed, all SHIFT is ignored, except when {
+ * or } is pressed */
+ if (new_state[6] & 0x40) {
+ keypad->fn = 1;
+ new_state[3] &= ~0x40;
+ new_state[1] &= ~0x80;
+ }
+
+ if (keypad->fn == 1) {
+ /* if { or } pressed */
+ if ((new_state[4] & 0x20) || (new_state[7] & 0x20)) {
+ /* as if LEFTSHIFT is pressed */
+ new_state[3] |= 0x40;
+ /* as if Fn not pressed */
+ new_state[6] &= ~0x40;
+ }
+ /* if [ or ] pressed */
+ if ((new_state[0] & 0x04) || (new_state[3] & 0x20))
+ /* as if Fn not pressed */
+ new_state[6] &= ~0x40;
+ }
+ }
+
+
+scan:
+ /* re-build keycode */
+ mrst_keypad_build_keycode(keypad);
+
+ for (col = 0; col < keypad->matrix_key_cols; col++) {
+ uint32_t bits_changed;
+
+ bits_changed = keypad->matrix_key_state[col] ^ new_state[col];
+ if (bits_changed == 0)
+ continue;
+
+ for (row = 0; row < keypad->matrix_key_rows; row++) {
+ if ((bits_changed & (1 << row)) == 0)
+ continue;
+
+ input_report_key(keypad->input_dev,
+ lookup_matrix_keycode(keypad, row, col),
+ new_state[col] & (1 << row));
+ }
+ }
+ input_sync(keypad->input_dev);
+ memcpy(keypad->matrix_key_state, new_state, sizeof(new_state));
+}
+
+#define DEFAULT_KPREC (0x007f007f)
+
+static inline int rotary_delta(uint32_t kprec)
+{
+ if (kprec & KPREC_OF0)
+ return (kprec & 0xff) + 0x7f;
+ else if (kprec & KPREC_UF0)
+ return (kprec & 0xff) - 0x7f - 0xff;
+ else
+ return (kprec & 0xff) - 0x7f;
+}
+
+static void report_rotary_event(struct mrst_keypad *keypad, int r, int delta)
+{
+ struct input_dev *dev = keypad->input_dev;
+
+ if (delta == 0)
+ return;
+
+ if (keypad->rotary_up_key[r] && keypad->rotary_down_key[r]) {
+ int keycode = (delta > 0) ? keypad->rotary_up_key[r] :
+ keypad->rotary_down_key[r];
+
+ /* simulate a press-n-release */
+ input_report_key(dev, keycode, 1);
+ input_sync(dev);
+ input_report_key(dev, keycode, 0);
+ input_sync(dev);
+ } else {
+ input_report_rel(dev, keypad->rotary_rel_code[r], delta);
+ input_sync(dev);
+ }
+}
+
+static void mrst_keypad_scan_rotary(struct mrst_keypad *keypad)
+{
+ unsigned int kprec;
+
+ /* read and reset to default count value */
+ kprec = keypad_readl(KPREC);
+ keypad_writel(KPREC, DEFAULT_KPREC);
+
+ if (keypad->enable_rotary0)
+ report_rotary_event(keypad, 0, rotary_delta(kprec));
+
+ if (keypad->enable_rotary1)
+ report_rotary_event(keypad, 1, rotary_delta(kprec >> 16));
+}
+
+static void mrst_keypad_scan_direct(struct mrst_keypad *keypad)
+{
+ unsigned int new_state;
+ uint32_t kpdk, bits_changed;
+ int i;
+
+ kpdk = keypad_readl(KPDK);
+
+ if (keypad->enable_rotary0 || keypad->enable_rotary1)
+ mrst_keypad_scan_rotary(keypad);
+
+ if ((keypad->direct_key_map == NULL) || (++keypad->count == 1)) {
+ keypad->direct_key_state = 0;
+ return;
+ }
+
+ new_state = KPDK_DK(kpdk) & keypad->direct_key_mask;
+ new_state = ~new_state;
+ bits_changed = keypad->direct_key_state ^ new_state;
+
+ if (bits_changed == 0)
+ return;
+
+ for (i = 0; i < keypad->direct_key_num; i++) {
+ if (bits_changed & (1 << i)) {
+ input_report_key(keypad->input_dev,
+ keypad->direct_key_map[i],
+ (new_state & (1 << i)));
+ }
+ }
+ input_sync(keypad->input_dev);
+ keypad->direct_key_state = new_state;
+
+}
+
+static irqreturn_t mrst_keypad_irq_handler(int irq, void *dev_id)
+{
+ struct mrst_keypad *keypad = dev_id;
+ unsigned long kpc = keypad_readl(KPC);
+
+ if (kpc & KPC_DI)
+ mrst_keypad_scan_direct(keypad);
+
+ if (kpc & KPC_MI)
+ mrst_keypad_scan_matrix(keypad);
+
+ return IRQ_HANDLED;
+}
+
+static int mrst_keypad_gpio_init(void)
+{
+ int i, err, cnt = 0;
+ int pins = KEYPAD_MATRIX_GPIO_IN_PIN + MAX_MATRIX_KEY_ROWS +
+ MAX_MATRIX_KEY_COLS + MAX_DIRECT_KEY_NUM;
+
+ /* explicitely tell which pins have been occupied... */
+ for (i = KEYPAD_MATRIX_GPIO_IN_PIN; i < pins; i++, cnt++) {
+ err = gpio_request(i, NULL);
+ if (err) {
+ printk(KERN_ERR "GPIO pin %d failed to request.\n", i);
+ goto err_request;
+ }
+ }
+
+ for (i = 0; i < MAX_MATRIX_KEY_ROWS; i++)
+ gpio_direction_input(KEYPAD_MATRIX_GPIO_IN_PIN + i);
+
+ for (i = 0; i < MAX_MATRIX_KEY_COLS; i++)
+ /* __gpio_set_value(KEYPAD_GPIO_OUT_PIN + i, 1); */
+ /* set action is executed in gpio_direction_output() */
+ gpio_direction_output(KEYPAD_MATRIX_GPIO_OUT_PIN + i, 1);
+
+ for (i = 0; i < MAX_DIRECT_KEY_NUM; i++)
+ gpio_direction_input(KEYPAD_DIRECT_GPIO_IN_PIN + i);
+
+ return 0;
+
+err_request:
+ /* free requested pins... */
+ for (i = KEYPAD_MATRIX_GPIO_IN_PIN + cnt - 1;
+ i >= KEYPAD_MATRIX_GPIO_IN_PIN; i--)
+ gpio_free(i);
+ return err;
+}
+
+static void mrst_keypad_config(struct mrst_keypad *keypad)
+{
+ unsigned int mask = 0, direct_key_num = 0;
+ unsigned long kpc = 0;
+
+ /* enable matrix keys with automatic scan */
+ if (keypad->matrix_key_rows && keypad->matrix_key_cols) {
+ kpc |= KPC_ASACT | KPC_MIE | KPC_ME | KPC_MS_ALL;
+ kpc |= KPC_MKRN(keypad->matrix_key_rows) |
+ KPC_MKCN(keypad->matrix_key_cols);
+ }
+
+ /* enable rotary key, debounce interval same as direct keys */
+ if (keypad->enable_rotary0) {
+ mask |= 0x03;
+ direct_key_num = 2;
+ kpc |= KPC_REE0;
+ }
+
+ if (keypad->enable_rotary1) {
+ mask |= 0x0c;
+ direct_key_num = 4;
+ kpc |= KPC_REE1;
+ }
+
+ if (keypad->direct_key_num > direct_key_num)
+ direct_key_num = keypad->direct_key_num;
+
+ keypad->direct_key_mask = ((2 << direct_key_num) - 1) & ~mask;
+
+ /* enable direct key */
+ if (direct_key_num)
+ kpc |= KPC_DE | KPC_DIE | KPC_DKN(direct_key_num);
+
+ keypad_writel(KPC, kpc);
+ keypad_writel(KPREC, DEFAULT_KPREC);
+ keypad_writel(KPKDI, keypad->debounce_interval);
+}
+
+static int mrst_keypad_open(struct input_dev *dev)
+{
+ struct mrst_keypad *keypad = input_get_drvdata(dev);
+ int err;
+
+ err = mrst_keypad_gpio_init();
+ if (err)
+ return err;
+ mrst_keypad_config(keypad);
+
+ return 0;
+}
+
+static void mrst_keypad_close(struct input_dev *dev)
+{
+ int pins = KEYPAD_MATRIX_GPIO_IN_PIN + MAX_MATRIX_KEY_ROWS +
+ MAX_MATRIX_KEY_COLS + MAX_DIRECT_KEY_NUM;
+
+ int i;
+ /* free occupied pins */
+ for (i = KEYPAD_MATRIX_GPIO_IN_PIN; i < pins; i++)
+ gpio_free(i);
+}
+
+static int __devinit mrst_keypad_probe(struct pci_dev *pdev,
+ const struct pci_device_id *ent)
+{
+ struct mrst_keypad *keypad;
+ struct input_dev *input_dev;
+ int error;
+
+#ifndef MODULE
+ printk(KERN_INFO MRST_KEYPAD_DRIVER_NAME "\n");
+#endif
+
+ keypad = kzalloc(sizeof(struct mrst_keypad), GFP_KERNEL);
+ if (keypad == NULL) {
+ dev_err(&pdev->dev, "failed to allocate driver data\n");
+ return -ENOMEM;
+ }
+
+ error = pci_enable_device(pdev);
+ if (error || (pdev->irq < 0)) {
+ dev_err(&pdev->dev, "failed to enable device/get irq\n");
+ error = -ENXIO;
+ goto failed_free;
+ }
+
+ error = pci_request_regions(pdev, DRV_NAME);
+ if (error) {
+ dev_err(&pdev->dev, "failed to request I/O memory\n");
+ goto failed_free;
+ }
+
+ keypad->mmio_base = ioremap(pci_resource_start(pdev, 0),
+ pci_resource_len(pdev, 0));
+ if (keypad->mmio_base == NULL) {
+ dev_err(&pdev->dev, "failed to remap I/O memory\n");
+ error = -ENXIO;
+ goto failed_free_mem;
+ }
+
+ /* Create and register the input driver. */
+ input_dev = input_allocate_device();
+ if (!input_dev) {
+ dev_err(&pdev->dev, "failed to allocate input device\n");
+ error = -ENOMEM;
+ goto failed_free_io;
+ }
+
+ input_dev->name = pci_name(pdev);
+ input_dev->id.bustype = BUS_PCI;
+ input_dev->open = mrst_keypad_open;
+ input_dev->close = mrst_keypad_close;
+ input_dev->dev.parent = &pdev->dev;
+
+ input_dev->keycode = keypad->matrix_keycodes;
+ input_dev->keycodesize = sizeof(unsigned int);
+ input_dev->keycodemax = ARRAY_SIZE(mrst_keycode);
+
+ keypad->input_dev = input_dev;
+ keypad->fn = 0;
+ keypad->numlck = 0;
+ /*FIXME*/keypad->count = 0;
+ input_set_drvdata(input_dev, keypad);
+
+ input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) |
+ BIT_MASK(EV_REL);
+
+ mrst_keypad_build_keycode(keypad);
+ pci_set_drvdata(pdev, keypad);
+
+ error = request_irq(pdev->irq, mrst_keypad_irq_handler, IRQF_SHARED,
+ pci_name(pdev), keypad);
+ if (error) {
+ dev_err(&pdev->dev, "failed to request IRQ\n");
+ goto failed_free_dev;
+ }
+
+ /* Register the input device */
+ error = input_register_device(input_dev);
+ if (error) {
+ dev_err(&pdev->dev, "failed to register input device\n");
+ goto failed_free_irq;
+ }
+
+ printk(KERN_INFO "*** keypad driver load successfully ***\n");
+ return 0;
+
+failed_free_irq:
+ free_irq(pdev->irq, keypad);
+ pci_set_drvdata(pdev, NULL);
+failed_free_dev:
+ input_free_device(input_dev);
+failed_free_io:
+ iounmap(keypad->mmio_base);
+failed_free_mem:
+ pci_release_regions(pdev);
+failed_free:
+ kfree(keypad);
+ return error;
+}
+
+static void __devexit mrst_keypad_remove(struct pci_dev *pdev)
+{
+ struct mrst_keypad *keypad = pci_get_drvdata(pdev);
+ int i;
+ int pins = KEYPAD_MATRIX_GPIO_IN_PIN + MAX_MATRIX_KEY_ROWS +
+ MAX_MATRIX_KEY_COLS + MAX_DIRECT_KEY_NUM;
+
+ for (i = pins - 1; i > KEYPAD_MATRIX_GPIO_IN_PIN; i--)
+ gpio_free(i);
+
+ free_irq(pdev->irq, keypad);
+ input_unregister_device(keypad->input_dev);
+ iounmap(keypad->mmio_base);
+ pci_release_regions(pdev);
+ pci_set_drvdata(pdev, NULL);
+ kfree(keypad);
+}
+
+
+static struct pci_driver mrst_keypad_driver = {
+ .name = DRV_NAME,
+ .id_table = keypad_pci_tbl,
+ .probe = mrst_keypad_probe,
+ .remove = __devexit_p(mrst_keypad_remove),
+#ifdef CONFIG_PM
+ .suspend = NULL,
+ .resume = NULL,
+#endif /* CONFIG_PM */
+};
+
+static int __init mrst_keypad_init(void)
+{
+ return pci_register_driver(&mrst_keypad_driver);
+}
+
+static void __exit mrst_keypad_exit(void)
+{
+ pci_unregister_driver(&mrst_keypad_driver);
+}
+
+module_init(mrst_keypad_init);
+module_exit(mrst_keypad_exit);
+
+MODULE_DESCRIPTION("MRST Keypad Controller Driver");
+MODULE_LICENSE("GPL v2");
--
1.6.2.5

View File

@ -1,35 +0,0 @@
From 722a639fd2cec44501c04ae32af57fd822c5a2d5 Mon Sep 17 00:00:00 2001
From: Yinghai Lu <yinghai@kernel.org>
Date: Wed, 24 Feb 2010 12:39:37 -0800
Subject: [PATCH] x86, pci: Exclude Moorestown PCI code if CONFIG_X86_MRST=n
If we don't have any Moorestown CPU support compiled in, we don't need
the Moorestown PCI support either.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
LKML-Reference: <4B858E89.7040807@kernel.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Acked-by: Yong Wang <yong.y.wang@intel.com>
Patch-mainline: Patch-mainline: Merged into x86/mrst branch of -tip
---
arch/x86/pci/Makefile | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/arch/x86/pci/Makefile b/arch/x86/pci/Makefile
index 4753ebc..56caf2a 100644
--- a/arch/x86/pci/Makefile
+++ b/arch/x86/pci/Makefile
@@ -13,7 +13,9 @@ obj-$(CONFIG_X86_VISWS) += visws.o
obj-$(CONFIG_X86_NUMAQ) += numaq_32.o
-obj-y += common.o early.o mrst.o
+obj-$(CONFIG_X86_MRST) += mrst.o
+
+obj-y += common.o early.o
obj-y += amd_bus.o
obj-$(CONFIG_X86_64) += bus_numa.o
--
1.5.5.1

Some files were not shown because too many files have changed in this diff Show More