xburst: remove support for old kernels
authorGabor Juhos <juhosg@openwrt.org>
Sun, 27 May 2012 15:01:35 +0000 (15:01 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Sun, 27 May 2012 15:01:35 +0000 (15:01 +0000)
SVN-Revision: 31904

54 files changed:
target/linux/xburst/config-2.6.37 [deleted file]
target/linux/xburst/config-3.2 [deleted file]
target/linux/xburst/id800wt/config-2.6.36 [deleted file]
target/linux/xburst/id800wt/config-2.6.37 [deleted file]
target/linux/xburst/n516/config-2.6.36 [deleted file]
target/linux/xburst/n516/config-2.6.37 [deleted file]
target/linux/xburst/n526/config-2.6.36 [deleted file]
target/linux/xburst/n526/config-2.6.37 [deleted file]
target/linux/xburst/patches-2.6.37/001-xburst-cache-quirks.patch [deleted file]
target/linux/xburst/patches-2.6.37/006-add-n516-board-support.patch [deleted file]
target/linux/xburst/patches-2.6.37/007-add-n526-board-support.patch [deleted file]
target/linux/xburst/patches-2.6.37/008-add-id800wt-board-support.patch [deleted file]
target/linux/xburst/patches-2.6.37/010-n516-sound.patch [deleted file]
target/linux/xburst/patches-2.6.37/011-n526-sound.patch [deleted file]
target/linux/xburst/patches-2.6.37/020-qi_lb60-add-gpio-charger.patch [deleted file]
target/linux/xburst/patches-2.6.37/021-qi_lb60-Don-t-use-3-wire-spi-mode-for-the-display-f.patch [deleted file]
target/linux/xburst/patches-2.6.37/050-i2c.patch [deleted file]
target/linux/xburst/patches-2.6.37/051-fix-i2c-driver-name.patch [deleted file]
target/linux/xburst/patches-2.6.37/060-adc-touchscreen.patch [deleted file]
target/linux/xburst/patches-2.6.37/061-touchscreen.patch [deleted file]
target/linux/xburst/patches-2.6.37/100-lcm.patch [deleted file]
target/linux/xburst/patches-2.6.37/102-gpio-charger.patch [deleted file]
target/linux/xburst/patches-2.6.37/200-udc.patch [deleted file]
target/linux/xburst/patches-2.6.37/300-battery-fixes.patch [deleted file]
target/linux/xburst/patches-2.6.37/302-nand-fixes.patch [deleted file]
target/linux/xburst/patches-2.6.37/303-qi_lb60-set-nand-ecc-offsets.patch [deleted file]
target/linux/xburst/patches-2.6.37/420-fb-notifier-pre-post.patch [deleted file]
target/linux/xburst/patches-2.6.37/440-metronome.patch [deleted file]
target/linux/xburst/patches-2.6.37/500-modifier-keys.patch [deleted file]
target/linux/xburst/patches-2.6.37/800-n516-lpc.patch [deleted file]
target/linux/xburst/patches-2.6.37/801-n526-lpc.patch [deleted file]
target/linux/xburst/patches-2.6.37/900-add-openwrt-logo.patch [deleted file]
target/linux/xburst/patches-3.2/0001-ubi-Read-only-the-vid-header-instead-of-the-whole-pa.patch [deleted file]
target/linux/xburst/patches-3.2/0002-Add-jz4740-udc-driver.patch [deleted file]
target/linux/xburst/patches-3.2/0003-NAND-Optimize-NAND_ECC_HW_OOB_FIRST-read.patch [deleted file]
target/linux/xburst/patches-3.2/0004-NAND-Add-support-for-subpage-reads-for-NAND_ECC_HW_O.patch [deleted file]
target/linux/xburst/patches-3.2/0005-NAND-Optimize-reading-the-eec-data-for-the-JZ4740.patch [deleted file]
target/linux/xburst/patches-3.2/0006-MTD-NAND-JZ4740-Multi-bank-support-with-autodetectio.patch [deleted file]
target/linux/xburst/patches-3.2/0007-Add-ili8960-lcd-driver.patch [deleted file]
target/linux/xburst/patches-3.2/0008-qi_lb60-Don-t-use-3-wire-spi-mode-for-the-display-fo.patch [deleted file]
target/linux/xburst/patches-3.2/0009-dev-mem-Add-kernel-config-option-to-omit-this-device.patch [deleted file]
target/linux/xburst/patches-3.2/0010-cpufreq_stats-Support-runtime-changes-to-frequency-t.patch [deleted file]
target/linux/xburst/patches-3.2/0011-MIPS-JZ4740-Added-setting-of-PLL-rate-and-main-divid.patch [deleted file]
target/linux/xburst/patches-3.2/0012-MIPS-JZ4740-Add-cpufreq-support.patch [deleted file]
target/linux/xburst/patches-3.2/0013-MMC-JZ4740-Added-support-for-CPU-frequency-changing.patch [deleted file]
target/linux/xburst/patches-3.2/0014-MIPS-JZ4740-reset-Initialize-hibernate-wakeup-counte.patch [deleted file]
target/linux/xburst/patches-3.2/0015-ASoC-JZ4740-Replaced-comma-operators-with-semicolons.patch [deleted file]
target/linux/xburst/patches-3.2/0016-ASoC-JZ4740-Support-buffer-size-that-is-not-a-multip.patch [deleted file]
target/linux/xburst/patches-3.2/0017-MIPS-JZ4740-qi_lb60-Look-for-NAND-chip-in-bank-1.patch [deleted file]
target/linux/xburst/patches-3.2/0018-ASoC-jz4740-Convert-qi_lb60-to-use-snd_soc_register_.patch [deleted file]
target/linux/xburst/patches-3.2/0019-Framebuffer-notifier-Call-notifier-callbacks-prior-t.patch [deleted file]
target/linux/xburst/patches-3.2/0020-qi_lb60-NAND-add-data-partition.patch [deleted file]
target/linux/xburst/patches-3.2/0021-rtc-jz4740-fix-hwclock-give-time-out.patch [deleted file]
target/linux/xburst/qi_lb60/config-3.2 [deleted file]

diff --git a/target/linux/xburst/config-2.6.37 b/target/linux/xburst/config-2.6.37
deleted file mode 100644 (file)
index c13eac5..0000000
+++ /dev/null
@@ -1,411 +0,0 @@
-
-CONFIG_32BIT=y
-# CONFIG_64BIT is not set
-# CONFIG_ALCHEMY_GPIO_INDIRECT is not set
-# CONFIG_AR7 is not set
-CONFIG_ARCH_HIBERNATION_POSSIBLE=y
-CONFIG_ARCH_POPULATES_NODE_MAP=y
-CONFIG_ARCH_REQUIRE_GPIOLIB=y
-CONFIG_ARCH_SUPPORTS_OPROFILE=y
-CONFIG_ARCH_SUSPEND_POSSIBLE=y
-# CONFIG_ARPD is not set
-# CONFIG_AUTO_IRQ_AFFINITY is not set
-# CONFIG_BACKLIGHT_CLASS_DEVICE is not set
-# CONFIG_BACKLIGHT_GENERIC is not set
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
-# CONFIG_BATTERY_BQ20Z75 is not set
-# CONFIG_BATTERY_JZ4740 is not set
-# CONFIG_BCM47XX is not set
-# CONFIG_BCM63XX is not set
-CONFIG_BITREVERSE=y
-# CONFIG_BKL is not set
-# CONFIG_BLK_DEV_INITRD is not set
-# CONFIG_BMP085 is not set
-# CONFIG_BRIDGE is not set
-# CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD is not set
-# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set
-CONFIG_CHARGER_GPIO=y
-CONFIG_CONSOLE_TRANSLATIONS=y
-# CONFIG_CPU_BIG_ENDIAN is not set
-# CONFIG_CPU_CAVIUM_OCTEON is not set
-CONFIG_CPU_HAS_PREFETCH=y
-CONFIG_CPU_HAS_SYNC=y
-CONFIG_CPU_LITTLE_ENDIAN=y
-# CONFIG_CPU_LOONGSON2E is not set
-# CONFIG_CPU_LOONGSON2F is not set
-CONFIG_CPU_MIPS32_R1=y
-# CONFIG_CPU_MIPS32_R2 is not set
-CONFIG_CPU_MIPS32=y
-# CONFIG_CPU_MIPS64_R1 is not set
-# CONFIG_CPU_MIPS64_R2 is not set
-CONFIG_CPU_MIPSR1=y
-# CONFIG_CPU_NEVADA is not set
-# CONFIG_CPU_R10000 is not set
-# CONFIG_CPU_R3000 is not set
-# CONFIG_CPU_R4300 is not set
-# CONFIG_CPU_R4X00 is not set
-# CONFIG_CPU_R5000 is not set
-# CONFIG_CPU_R5432 is not set
-# CONFIG_CPU_R5500 is not set
-# CONFIG_CPU_R6000 is not set
-# CONFIG_CPU_R8000 is not set
-# CONFIG_CPU_RM7000 is not set
-# CONFIG_CPU_RM9000 is not set
-# CONFIG_CPU_SB1 is not set
-CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
-CONFIG_CPU_SUPPORTS_HIGHMEM=y
-# CONFIG_CPU_TX39XX is not set
-# CONFIG_CPU_TX49XX is not set
-# CONFIG_CPU_VR41XX is not set
-CONFIG_CRC16=y
-CONFIG_CRYPTO_DEFLATE=y
-CONFIG_CRYPTO_LZO=y
-CONFIG_DEFAULT_AS=y
-CONFIG_DMA_NEED_PCI_MAP_STATE=y
-CONFIG_DMA_NONCOHERENT=y
-CONFIG_DUMMY_CONSOLE=y
-CONFIG_EARLY_PRINTK=y
-CONFIG_ELF_CORE=y
-CONFIG_ENABLE_MUST_CHECK=y
-CONFIG_EXT4_FS=y
-CONFIG_FAT_FS=y
-# CONFIG_FB_JZ4740 is not set
-CONFIG_FB_SYS_COPYAREA=y
-CONFIG_FB_SYS_FILLRECT=y
-CONFIG_FB_SYS_IMAGEBLIT=y
-CONFIG_FB=y
-# CONFIG_FIRMWARE_EDID is not set
-CONFIG_FONTS=y
-# CONFIG_FONT_10x18 is not set
-# CONFIG_FONT_6x11 is not set
-# CONFIG_FONT_7x14 is not set
-# CONFIG_FONT_8x16 is not set
-# CONFIG_FONT_8x8 is not set
-# CONFIG_FONT_ACORN_8x8 is not set
-# CONFIG_FONT_MINI_4x6 is not set
-# CONFIG_FONT_PEARL_8x8 is not set
-# CONFIG_FONT_SUN12x22 is not set
-CONFIG_FONT_SUN8x16=y
-CONFIG_FORCE_MAX_ZONEORDER=12
-# CONFIG_FRAMEBUFFER_CONSOLE is not set
-# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
-# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
-CONFIG_FREEZER=y
-CONFIG_GENERIC_ATOMIC64=y
-CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
-CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_GENERIC_CMOS_UPDATE=y
-CONFIG_GENERIC_FIND_LAST_BIT=y
-CONFIG_GENERIC_FIND_NEXT_BIT=y
-CONFIG_GENERIC_GPIO=y
-CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
-# CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED is not set
-# CONFIG_GENERIC_PENDING_IRQ is not set
-CONFIG_GPIOLIB=y
-# CONFIG_GPIO_SX150X is not set
-# CONFIG_HAMRADIO is not set
-# CONFIG_HARDLOCKUP_DETECTOR is not set
-# CONFIG_HARDIRQS_SW_RESEND is not set
-CONFIG_HARDWARE_WATCHPOINTS=y
-CONFIG_HAS_DMA=y
-CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT=y
-CONFIG_HAVE_ARCH_KGDB=y
-CONFIG_HAVE_C_RECORDMCOUNT=y
-CONFIG_HAVE_DMA_API_DEBUG=y
-CONFIG_HAVE_DMA_ATTRS=y
-CONFIG_HAVE_DYNAMIC_FTRACE=y
-CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
-CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
-CONFIG_HAVE_FUNCTION_TRACER=y
-CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
-CONFIG_HAVE_GENERIC_HARDIRQS=y
-CONFIG_HAVE_GENERIC_DMA_COHERENT=y
-CONFIG_HAVE_IDE=y
-CONFIG_HAVE_KPROBES=y
-CONFIG_HAVE_KRETPROBES=y
-CONFIG_HAVE_OPROFILE=y
-CONFIG_HAVE_PERF_EVENTS=y
-CONFIG_HAVE_PWM=y
-# CONFIG_HAVE_SPARSE_IRQ is not set
-# CONFIG_HIBERNATION is not set
-# CONFIG_HIGH_RES_TIMERS is not set
-CONFIG_HW_CONSOLE=y
-# CONFIG_HW_RANDOM is not set
-# CONFIG_I2C_JZ47XX is not set
-# CONFIG_INLINE_READ_UNLOCK is not set
-# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
-# CONFIG_INLINE_SPIN_UNLOCK is not set
-# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
-# CONFIG_INLINE_WRITE_UNLOCK is not set
-# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
-CONFIG_INOTIFY_USER=y
-CONFIG_INPUT_EVDEV=y
-# CONFIG_INPUT_GPIO_BUTTONS is not set
-CONFIG_INPUT_KEYBOARD=y
-# CONFIG_INPUT_PWM_BEEPER is not set
-CONFIG_INPUT=y
-CONFIG_IRQ_CPU=y
-# CONFIG_IRQ_PER_CPU is not set
-CONFIG_JBD=y
-CONFIG_JBD2=y
-# CONFIG_JZ4740_ADC is not set
-# CONFIG_JZ4740_ID800WT is not set
-# CONFIG_JZ4740_N516 is not set
-# CONFIG_JZ4740_N526 is not set
-# CONFIG_JZ4740_QI_LB60 is not set
-CONFIG_KALLSYMS=y
-# CONFIG_KEYBOARD_ATKBD is not set
-# CONFIG_KEYBOARD_GPIO is not set
-# CONFIG_KEYBOARD_LKKBD is not set
-# CONFIG_KEYBOARD_MATRIX is not set
-# CONFIG_KEYBOARD_MCS is not set
-# CONFIG_KEYBOARD_NEWTON is not set
-# CONFIG_KEYBOARD_STOWAWAY is not set
-# CONFIG_KEYBOARD_SUNKBD is not set
-# CONFIG_KEYBOARD_XTKBD is not set
-# CONFIG_LCD_CLASS_DEVICE is not set
-# CONFIG_LCD_GPM940B0 is not set
-# CONFIG_LCD_ILI9320 is not set
-# CONFIG_LCD_L4F00242T03 is not set
-# CONFIG_LCD_LMS283GF05 is not set
-# CONFIG_LCD_LTV350QV is not set
-# CONFIG_LCD_PLATFORM is not set
-# CONFIG_LCD_TDO24M is not set
-# CONFIG_LCD_VGG2432A4 is not set
-# CONFIG_LEDS_PWM is not set
-CONFIG_LEGACY_PTYS=y
-CONFIG_LEGACY_PTY_COUNT=2
-CONFIG_LOCK_KERNEL=y
-# CONFIG_LOGO is not set
-# CONFIG_LOGO_LINUX_CLUT224 is not set
-# CONFIG_LOGO_LINUX_MONO is not set
-# CONFIG_LOGO_LINUX_VGA16 is not set
-# CONFIG_LOGO_OPENWRT_CLUT224 is not set
-# CONFIG_LOONGSON_MC146818 is not set
-CONFIG_LOONGSON_UART_BASE=y
-CONFIG_LZO_COMPRESS=y
-CONFIG_LZO_DECOMPRESS=y
-# CONFIG_MACH_ALCHEMY is not set
-# CONFIG_MACH_DECSTATION is not set
-# CONFIG_MACH_JAZZ is not set
-CONFIG_MACH_JZ4740=y
-# CONFIG_MACH_LOONGSON is not set
-# CONFIG_MACH_TX39XX is not set
-# CONFIG_MACH_TX49XX is not set
-# CONFIG_MACH_VR41XX is not set
-# CONFIG_MIPS_ALCHEMY is not set
-# CONFIG_MFD_JZ4740_ADC is not set
-# CONFIG_MFD_MAX8998 is not set
-# CONFIG_MFD_STMPE is not set
-# CONFIG_MFD_TPS6586X is not set
-# CONFIG_MIKROTIK_RB532 is not set
-# CONFIG_MINI_FO is not set
-# CONFIG_MIPS_COBALT is not set
-CONFIG_MIPS_L1_CACHE_SHIFT=5
-# CONFIG_MIPS_MACHINE is not set
-# CONFIG_MIPS_MALTA is not set
-CONFIG_MIPS_MT_DISABLED=y
-# CONFIG_MIPS_MT_SMP is not set
-# CONFIG_MIPS_MT_SMTC is not set
-# CONFIG_MIPS_SIM is not set
-CONFIG_MIPS=y
-# CONFIG_MMC_AT91 is not set
-# CONFIG_MMC_ATMELMCI is not set
-# CONFIG_MMC_BLOCK_BOUNCE is not set
-CONFIG_MMC_BLOCK=y
-CONFIG_MMC_JZ4740=y
-CONFIG_MMC_UNSAFE_RESUME=y
-CONFIG_MMC=y
-# CONFIG_MTD_CFI is not set
-# CONFIG_MTD_COMPLEX_MAPPINGS is not set
-CONFIG_MTD_NAND_JZ4740=y
-# CONFIG_MTD_NAND_VERIFY_WRITE is not set
-CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_ECC=y
-# CONFIG_MTD_SM_COMMON is not set
-CONFIG_MTD_UBI_BEB_RESERVE=1
-# CONFIG_MTD_UBI_DEBUG is not set
-# CONFIG_MTD_UBI_GLUEBI is not set
-CONFIG_MTD_UBI_WL_THRESHOLD=4096
-CONFIG_MTD_UBI=y
-# CONFIG_N516_LPC is not set
-CONFIG_NEED_DMA_MAP_STATE=y
-CONFIG_NEED_PER_CPU_KM=y
-# CONFIG_NETDEV_1000 is not set
-# CONFIG_NETWORK_FILESYSTEMS is not set
-# CONFIG_NET_ETHERNET is not set
-# CONFIG_NET_SCHED is not set
-# CONFIG_NEW_LEDS is not set
-CONFIG_NLS_ASCII=y
-CONFIG_NLS_CODEPAGE_1250=y
-CONFIG_NLS_CODEPAGE_1251=y
-CONFIG_NLS_CODEPAGE_437=y
-CONFIG_NLS_CODEPAGE_737=y
-CONFIG_NLS_CODEPAGE_775=y
-CONFIG_NLS_CODEPAGE_850=y
-CONFIG_NLS_CODEPAGE_852=y
-CONFIG_NLS_CODEPAGE_855=y
-CONFIG_NLS_CODEPAGE_857=y
-CONFIG_NLS_CODEPAGE_860=y
-CONFIG_NLS_CODEPAGE_861=y
-CONFIG_NLS_CODEPAGE_862=y
-CONFIG_NLS_CODEPAGE_863=y
-CONFIG_NLS_CODEPAGE_864=y
-CONFIG_NLS_CODEPAGE_865=y
-CONFIG_NLS_CODEPAGE_866=y
-CONFIG_NLS_CODEPAGE_869=y
-CONFIG_NLS_CODEPAGE_874=y
-CONFIG_NLS_CODEPAGE_932=y
-CONFIG_NLS_CODEPAGE_936=y
-CONFIG_NLS_CODEPAGE_949=y
-CONFIG_NLS_CODEPAGE_950=y
-CONFIG_NLS_ISO8859_13=y
-CONFIG_NLS_ISO8859_14=y
-CONFIG_NLS_ISO8859_15=y
-CONFIG_NLS_ISO8859_1=y
-CONFIG_NLS_ISO8859_2=y
-CONFIG_NLS_ISO8859_3=y
-CONFIG_NLS_ISO8859_4=y
-CONFIG_NLS_ISO8859_5=y
-CONFIG_NLS_ISO8859_6=y
-CONFIG_NLS_ISO8859_7=y
-CONFIG_NLS_ISO8859_8=y
-CONFIG_NLS_ISO8859_9=y
-CONFIG_NLS_KOI8_R=y
-CONFIG_NLS_KOI8_U=y
-CONFIG_NLS_UTF8=y
-CONFIG_NLS=y
-# CONFIG_NO_IOPORT is not set
-# CONFIG_NXP_STB220 is not set
-# CONFIG_NXP_STB225 is not set
-# CONFIG_PACKET_MMAP is not set
-CONFIG_PAGEFLAGS_EXTENDED=y
-# CONFIG_PCI is not set
-# CONFIG_PDA_POWER is not set
-CONFIG_PERF_USE_VMALLOC=y
-# CONFIG_PMC_MSP is not set
-# CONFIG_PMC_YOSEMITE is not set
-# CONFIG_PM_DEBUG is not set
-CONFIG_PM_OPS=y
-# CONFIG_PM_RUNTIME is not set
-CONFIG_PM_SLEEP=y
-CONFIG_PM=y
-# CONFIG_PNX8550_JBS is not set
-# CONFIG_PNX8550_STB810 is not set
-# CONFIG_POWERTV is not set
-CONFIG_POWER_SUPPLY=y
-# CONFIG_PREEMPT_NONE is not set
-# CONFIG_PREEMPT_RCU is not set
-CONFIG_PREEMPT=y
-CONFIG_PRINTK_TIME=y
-CONFIG_RTC_CLASS=y
-# CONFIG_RTC_DRV_CMOS is not set
-# CONFIG_RTC_DRV_DS3232 is not set
-# CONFIG_RTC_DRV_ISL12022 is not set
-CONFIG_RTC_DRV_JZ4740=y
-CONFIG_SCHED_OMIT_FRAME_POINTER=y
-# CONFIG_SCSI_DMA is not set
-CONFIG_SCSI_MOD=y
-# CONFIG_SENSORS_BH1780 is not set
-# CONFIG_SENSORS_EMC2103 is not set
-# CONFIG_SENSORS_JC42 is not set
-# CONFIG_SENSORS_JZ4740 is not set
-# CONFIG_SENSORS_SMM665 is not set
-# CONFIG_SERIAL_8250_EXTENDED is not set
-# CONFIG_SERIAL_MAX3107 is not set
-# CONFIG_SGI_IP22 is not set
-# CONFIG_SGI_IP27 is not set
-# CONFIG_SGI_IP28 is not set
-# CONFIG_SGI_IP32 is not set
-# CONFIG_SIBYTE_BIGSUR is not set
-# CONFIG_SIBYTE_CARMEL is not set
-# CONFIG_SIBYTE_CRHINE is not set
-# CONFIG_SIBYTE_CRHONE is not set
-# CONFIG_SIBYTE_LITTLESUR is not set
-# CONFIG_SIBYTE_RHONE is not set
-# CONFIG_SIBYTE_SENTOSA is not set
-# CONFIG_SIBYTE_SWARM is not set
-# CONFIG_SND_JZ4740_SOC_N516 is not set
-# CONFIG_SND_JZ4740_SOC_N526 is not set
-# CONFIG_SND_JZ4740_SOC_QI_LB60 is not set
-# CONFIG_SND_SOC_ALL_CODECS is not set
-# CONFIG_SND_SOC_JZ4740 is not set
-# CONFIG_SPI_SPIDEV is not set
-# CONFIG_SQUASHFS is not set
-# CONFIG_STAGING is not set
-CONFIG_SUSPEND_FREEZER=y
-CONFIG_SUSPEND_NVS=y
-CONFIG_SUSPEND=y
-# CONFIG_SYN_COOKIES is not set
-CONFIG_SYS_HAS_CPU_MIPS32_R1=y
-CONFIG_SYS_HAS_EARLY_PRINTK=y
-CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
-CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
-CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
-# CONFIG_TEST_POWER is not set
-# CONFIG_TINY_PREEMPT_RCU is not set
-CONFIG_TRAD_SIGNALS=y
-CONFIG_UBIFS_FS_ADVANCED_COMPR=y
-# CONFIG_UBIFS_FS_DEBUG is not set
-CONFIG_UBIFS_FS_LZO=y
-# CONFIG_UBIFS_FS_XATTR is not set
-CONFIG_UBIFS_FS_ZLIB=y
-CONFIG_UBIFS_FS=y
-# CONFIG_USB_ARCH_HAS_EHCI is not set
-CONFIG_USB_ARCH_HAS_HCD=y
-CONFIG_USB_ARCH_HAS_OHCI=y
-# CONFIG_USB_AUDIO is not set
-# CONFIG_USB_CDC_COMPOSITE is not set
-# CONFIG_USB_ETH_EEM is not set
-CONFIG_USB_ETH_RNDIS=y
-CONFIG_USB_ETH=y
-# CONFIG_USB_FILE_STORAGE is not set
-# CONFIG_USB_FUNCTIONFS is not set
-# CONFIG_USB_GADGETFS is not set
-# CONFIG_USB_GADGET_AMD5536UDC is not set
-# CONFIG_USB_GADGET_AT91 is not set
-# CONFIG_USB_GADGET_ATMEL_USBA is not set
-# CONFIG_USB_GADGET_CI13XXX is not set
-# CONFIG_USB_GADGET_DEBUG_FILES is not set
-# CONFIG_USB_GADGET_DEBUG_FS is not set
-CONFIG_USB_GADGET_DUALSPEED=y
-# CONFIG_USB_GADGET_DUMMY_HCD is not set
-# CONFIG_USB_GADGET_FSL_QE is not set
-# CONFIG_USB_GADGET_FSL_USB2 is not set
-# CONFIG_USB_GADGET_GOKU is not set
-# CONFIG_USB_GADGET_IMX is not set
-CONFIG_USB_GADGET_JZ4740=y
-# CONFIG_USB_GADGET_LANGWELL is not set
-# CONFIG_USB_GADGET_LH7A40X is not set
-# CONFIG_USB_GADGET_M66592 is not set
-# CONFIG_USB_GADGET_MUSB_HDRC is not set
-# CONFIG_USB_GADGET_NET2280 is not set
-# CONFIG_USB_GADGET_OMAP is not set
-# CONFIG_USB_GADGET_PXA25X is not set
-# CONFIG_USB_GADGET_PXA27X is not set
-# CONFIG_USB_GADGET_R8A66597 is not set
-# CONFIG_USB_GADGET_S3C2410 is not set
-# CONFIG_USB_GADGET_S3C_HSOTG is not set
-CONFIG_USB_GADGET_SELECTED=y
-CONFIG_USB_GADGET_VBUS_DRAW=2
-CONFIG_USB_GADGET=y
-# CONFIG_USB_G_DBGP is not set
-# CONFIG_USB_G_HID is not set
-# CONFIG_USB_G_PRINTER is not set
-# CONFIG_USB_G_SERIAL is not set
-# CONFIG_USB_G_WEBCAM is not set
-CONFIG_USB_JZ4740=y
-# CONFIG_USB_MIDI_GADGET is not set
-CONFIG_USB_SUPPORT=y
-# CONFIG_USB_ZERO is not set
-CONFIG_VFAT_FS=y
-# CONFIG_VGA_CONSOLE is not set
-# CONFIG_VLAN_8021Q is not set
-CONFIG_VT_CONSOLE=y
-CONFIG_VT_HW_CONSOLE_BINDING=y
-CONFIG_VT=y
-# CONFIG_WATCHDOG is not set
-# CONFIG_WLAN_80211 is not set
-CONFIG_ZONE_DMA_FLAG=0
-
diff --git a/target/linux/xburst/config-3.2 b/target/linux/xburst/config-3.2
deleted file mode 100644 (file)
index e856ffb..0000000
+++ /dev/null
@@ -1,305 +0,0 @@
-CONFIG_ARCH_HIBERNATION_POSSIBLE=y
-CONFIG_ARCH_POPULATES_NODE_MAP=y
-CONFIG_ARCH_REQUIRE_GPIOLIB=y
-CONFIG_ARCH_SUSPEND_POSSIBLE=y
-# CONFIG_ARPD is not set
-# CONFIG_ATH79 is not set
-# CONFIG_ATMEL_PWM is not set
-# CONFIG_BATTERY_BQ20Z75 is not set
-CONFIG_BATTERY_JZ4740=y
-CONFIG_BCMA_POSSIBLE=y
-# CONFIG_BLK_DEV_INITRD is not set
-# CONFIG_BRIDGE is not set
-CONFIG_CHARGER_GPIO=y
-CONFIG_CONSOLE_TRANSLATIONS=y
-CONFIG_CPU_HAS_PREFETCH=y
-CONFIG_CPU_HAS_SYNC=y
-CONFIG_CPU_LITTLE_ENDIAN=y
-CONFIG_CPU_MIPS32=y
-CONFIG_CPU_MIPS32_R1=y
-CONFIG_CPU_MIPSR1=y
-CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
-CONFIG_CPU_SUPPORTS_CPUFREQ=y
-CONFIG_CPU_SUPPORTS_HIGHMEM=y
-CONFIG_CRC16=y
-CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_ALGAPI2=y
-CONFIG_CRYPTO_DEFLATE=y
-CONFIG_CRYPTO_LZO=y
-CONFIG_CRYPTO_XZ=y
-CONFIG_DEVMEM=y
-CONFIG_DMA_NONCOHERENT=y
-CONFIG_DUMMY_CONSOLE=y
-CONFIG_EARLY_PRINTK=y
-CONFIG_ELF_CORE=y
-CONFIG_ENABLE_MUST_CHECK=y
-CONFIG_EXT4_FS=y
-CONFIG_FAT_FS=y
-CONFIG_FB=y
-CONFIG_FB_JZ4740=y
-CONFIG_FB_SYS_COPYAREA=y
-CONFIG_FB_SYS_FILLRECT=y
-CONFIG_FB_SYS_IMAGEBLIT=y
-# CONFIG_FB_TMIO is not set
-# CONFIG_FB_WMT_GE_ROPS is not set
-# CONFIG_FIRMWARE_EDID is not set
-CONFIG_FONTS=y
-# CONFIG_FONT_10x18 is not set
-CONFIG_FONT_6x11=y
-# CONFIG_FONT_7x14 is not set
-# CONFIG_FONT_8x16 is not set
-# CONFIG_FONT_8x8 is not set
-# CONFIG_FONT_ACORN_8x8 is not set
-# CONFIG_FONT_MINI_4x6 is not set
-# CONFIG_FONT_PEARL_8x8 is not set
-# CONFIG_FONT_SUN12x22 is not set
-# CONFIG_FONT_SUN8x16 is not set
-CONFIG_FORCE_MAX_ZONEORDER=12
-CONFIG_FRAMEBUFFER_CONSOLE=y
-# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
-# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
-CONFIG_FREEZER=y
-CONFIG_FS_MBCACHE=y
-CONFIG_GENERIC_ATOMIC64=y
-CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
-CONFIG_GENERIC_CMOS_UPDATE=y
-CONFIG_GENERIC_GPIO=y
-CONFIG_GENERIC_IRQ_CHIP=y
-CONFIG_GENERIC_IRQ_SHOW=y
-CONFIG_GPIOLIB=y
-# CONFIG_HAMRADIO is not set
-CONFIG_HARDWARE_WATCHPOINTS=y
-CONFIG_HAS_DMA=y
-CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT=y
-CONFIG_HAVE_ARCH_JUMP_LABEL=y
-CONFIG_HAVE_ARCH_KGDB=y
-CONFIG_HAVE_CLK=y
-CONFIG_HAVE_C_RECORDMCOUNT=y
-CONFIG_HAVE_DMA_API_DEBUG=y
-CONFIG_HAVE_DMA_ATTRS=y
-CONFIG_HAVE_DYNAMIC_FTRACE=y
-CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
-CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
-CONFIG_HAVE_FUNCTION_TRACER=y
-CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y
-CONFIG_HAVE_GENERIC_DMA_COHERENT=y
-CONFIG_HAVE_GENERIC_HARDIRQS=y
-CONFIG_HAVE_IDE=y
-CONFIG_HAVE_IRQ_WORK=y
-CONFIG_HAVE_OPROFILE=y
-CONFIG_HAVE_PERF_EVENTS=y
-CONFIG_HAVE_PWM=y
-# CONFIG_HIGH_RES_TIMERS is not set
-CONFIG_HW_CONSOLE=y
-CONFIG_I2C=y
-CONFIG_I2C_BOARDINFO=y
-# CONFIG_INLINE_READ_UNLOCK is not set
-# CONFIG_INLINE_READ_UNLOCK_IRQ is not set
-# CONFIG_INLINE_SPIN_UNLOCK is not set
-# CONFIG_INLINE_SPIN_UNLOCK_IRQ is not set
-# CONFIG_INLINE_WRITE_UNLOCK is not set
-# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
-CONFIG_INPUT=y
-CONFIG_INPUT_EVDEV=y
-# CONFIG_INPUT_GPIO_BUTTONS is not set
-CONFIG_INPUT_KEYBOARD=y
-CONFIG_INPUT_MOUSE=y
-CONFIG_INPUT_MOUSEDEV=y
-# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
-CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
-CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
-# CONFIG_INPUT_PWM_BEEPER is not set
-CONFIG_INPUT_UINPUT=y
-CONFIG_IRQ_CPU=y
-CONFIG_IRQ_FORCED_THREADING=y
-CONFIG_JBD2=y
-CONFIG_JZ4740_QI_LB60=y
-CONFIG_KALLSYMS=y
-CONFIG_KEXEC=y
-# CONFIG_KEYBOARD_GPIO is not set
-# CONFIG_LANTIQ is not set
-CONFIG_LEGACY_PTYS=y
-CONFIG_LEGACY_PTY_COUNT=2
-CONFIG_LZO_COMPRESS=y
-CONFIG_LZO_DECOMPRESS=y
-CONFIG_MACH_JZ4740=y
-CONFIG_MFD_CORE=y
-CONFIG_MFD_JZ4740_ADC=y
-CONFIG_MIPS=y
-CONFIG_MIPS_CPUFREQ=y
-CONFIG_MIPS_FPU_EMU=y
-CONFIG_MIPS_L1_CACHE_SHIFT=5
-# CONFIG_MIPS_MACHINE is not set
-CONFIG_MIPS_MT_DISABLED=y
-CONFIG_MMC=y
-CONFIG_MMC_BLOCK=y
-# CONFIG_MMC_BLOCK_BOUNCE is not set
-CONFIG_MMC_JZ4740=y
-CONFIG_MMC_UNSAFE_RESUME=y
-# CONFIG_MOUSE_BCM5974 is not set
-CONFIG_MOUSE_PS2=y
-# CONFIG_MOUSE_PS2_ALPS is not set
-# CONFIG_MOUSE_PS2_ELANTECH is not set
-# CONFIG_MOUSE_PS2_LOGIPS2PP is not set
-# CONFIG_MOUSE_PS2_SYNAPTICS is not set
-# CONFIG_MOUSE_PS2_TOUCHKIT is not set
-# CONFIG_MOUSE_PS2_TRACKPOINT is not set
-# CONFIG_MOUSE_SERIAL is not set
-# CONFIG_MOUSE_VSXXXAA is not set
-# CONFIG_MTD_CFI is not set
-# CONFIG_MTD_COMPLEX_MAPPINGS is not set
-CONFIG_MTD_NAND=y
-CONFIG_MTD_NAND_ECC=y
-CONFIG_MTD_NAND_JZ4740=y
-# CONFIG_MTD_SM_COMMON is not set
-CONFIG_MTD_UBI=y
-CONFIG_MTD_UBI_BEB_RESERVE=1
-# CONFIG_MTD_UBI_DEBUG is not set
-# CONFIG_MTD_UBI_GLUEBI is not set
-CONFIG_MTD_UBI_WL_THRESHOLD=4096
-CONFIG_NEED_DMA_MAP_STATE=y
-CONFIG_NEED_PER_CPU_KM=y
-# CONFIG_NETWORK_FILESYSTEMS is not set
-# CONFIG_NET_SCHED is not set
-# CONFIG_NEW_LEDS is not set
-CONFIG_NLS=y
-CONFIG_NLS_ASCII=y
-CONFIG_NLS_CODEPAGE_1250=y
-CONFIG_NLS_CODEPAGE_1251=y
-CONFIG_NLS_CODEPAGE_437=y
-CONFIG_NLS_CODEPAGE_737=y
-CONFIG_NLS_CODEPAGE_775=y
-CONFIG_NLS_CODEPAGE_850=y
-CONFIG_NLS_CODEPAGE_852=y
-CONFIG_NLS_CODEPAGE_855=y
-CONFIG_NLS_CODEPAGE_857=y
-CONFIG_NLS_CODEPAGE_860=y
-CONFIG_NLS_CODEPAGE_861=y
-CONFIG_NLS_CODEPAGE_862=y
-CONFIG_NLS_CODEPAGE_863=y
-CONFIG_NLS_CODEPAGE_864=y
-CONFIG_NLS_CODEPAGE_865=y
-CONFIG_NLS_CODEPAGE_866=y
-CONFIG_NLS_CODEPAGE_869=y
-CONFIG_NLS_CODEPAGE_874=y
-CONFIG_NLS_CODEPAGE_932=y
-CONFIG_NLS_CODEPAGE_936=y
-CONFIG_NLS_CODEPAGE_949=y
-CONFIG_NLS_CODEPAGE_950=y
-CONFIG_NLS_ISO8859_1=y
-CONFIG_NLS_ISO8859_13=y
-CONFIG_NLS_ISO8859_14=y
-CONFIG_NLS_ISO8859_15=y
-CONFIG_NLS_ISO8859_2=y
-CONFIG_NLS_ISO8859_3=y
-CONFIG_NLS_ISO8859_4=y
-CONFIG_NLS_ISO8859_5=y
-CONFIG_NLS_ISO8859_6=y
-CONFIG_NLS_ISO8859_7=y
-CONFIG_NLS_ISO8859_8=y
-CONFIG_NLS_ISO8859_9=y
-CONFIG_NLS_KOI8_R=y
-CONFIG_NLS_KOI8_U=y
-CONFIG_NLS_UTF8=y
-CONFIG_PAGEFLAGS_EXTENDED=y
-# CONFIG_PDA_POWER is not set
-CONFIG_PERF_USE_VMALLOC=y
-CONFIG_PM=y
-CONFIG_PM_CLK=y
-# CONFIG_PM_DEBUG is not set
-CONFIG_PM_SLEEP=y
-CONFIG_POWER_SUPPLY=y
-CONFIG_PREEMPT=y
-CONFIG_PREEMPT_COUNT=y
-# CONFIG_PREEMPT_NONE is not set
-CONFIG_PREEMPT_RCU=y
-CONFIG_PRINTK_TIME=y
-CONFIG_PROC_PAGE_MONITOR=y
-# CONFIG_RCU_BOOST is not set
-CONFIG_REGMAP=y
-CONFIG_REGMAP_I2C=y
-CONFIG_RTC_CLASS=y
-# CONFIG_RTC_DRV_CMOS is not set
-CONFIG_RTC_DRV_JZ4740=y
-# CONFIG_SCSI_DMA is not set
-CONFIG_SERIO=y
-CONFIG_SERIO_LIBPS2=y
-CONFIG_SND=y
-# CONFIG_SND_EMU10K1_SEQ is not set
-CONFIG_SND_JACK=y
-CONFIG_SND_JZ4740_SOC=y
-CONFIG_SND_JZ4740_SOC_I2S=y
-CONFIG_SND_JZ4740_SOC_QI_LB60=y
-# CONFIG_SND_OPL3_LIB_SEQ is not set
-# CONFIG_SND_OPL4_LIB_SEQ is not set
-CONFIG_SND_PCM=y
-# CONFIG_SND_RAWMIDI_SEQ is not set
-# CONFIG_SND_SBAWE_SEQ is not set
-CONFIG_SND_SOC=y
-# CONFIG_SND_SOC_ALL_CODECS is not set
-CONFIG_SND_SOC_I2C_AND_SPI=y
-CONFIG_SND_SOC_JZ4740_CODEC=y
-CONFIG_SND_TIMER=y
-CONFIG_SOUND=y
-# CONFIG_SOUND_OSS_CORE is not set
-# CONFIG_SQUASHFS is not set
-# CONFIG_STAGING is not set
-CONFIG_SUSPEND=y
-CONFIG_SUSPEND_FREEZER=y
-# CONFIG_SYN_COOKIES is not set
-CONFIG_SYS_HAS_CPU_MIPS32_R1=y
-CONFIG_SYS_HAS_EARLY_PRINTK=y
-CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
-CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
-CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
-CONFIG_TINY_PREEMPT_RCU=y
-CONFIG_UBIFS_FS=y
-CONFIG_UBIFS_FS_ADVANCED_COMPR=y
-# CONFIG_UBIFS_FS_DEBUG is not set
-CONFIG_UBIFS_FS_LZO=y
-# CONFIG_UBIFS_FS_XATTR is not set
-CONFIG_UBIFS_FS_XZ=y
-CONFIG_UBIFS_FS_ZLIB=y
-# CONFIG_USB_ARCH_HAS_EHCI is not set
-# CONFIG_USB_ARCH_HAS_XHCI is not set
-# CONFIG_USB_AUDIO is not set
-# CONFIG_USB_CDC_COMPOSITE is not set
-CONFIG_USB_COMMON=y
-CONFIG_USB_ETH=y
-# CONFIG_USB_ETH_EEM is not set
-# CONFIG_USB_ETH_RNDIS is not set
-# CONFIG_USB_FILE_STORAGE is not set
-# CONFIG_USB_FUNCTIONFS is not set
-CONFIG_USB_FUSB300=y
-CONFIG_USB_GADGET=y
-# CONFIG_USB_GADGETFS is not set
-# CONFIG_USB_GADGET_DEBUG_FILES is not set
-# CONFIG_USB_GADGET_DEBUG_FS is not set
-CONFIG_USB_GADGET_DUALSPEED=y
-CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2
-CONFIG_USB_GADGET_VBUS_DRAW=2
-# CONFIG_USB_G_ACM_MS is not set
-# CONFIG_USB_G_DBGP is not set
-# CONFIG_USB_G_HID is not set
-# CONFIG_USB_G_NCM is not set
-# CONFIG_USB_G_PRINTER is not set
-# CONFIG_USB_G_SERIAL is not set
-# CONFIG_USB_JZ4740 is not set
-# CONFIG_USB_M66592 is not set
-# CONFIG_USB_MIDI_GADGET is not set
-# CONFIG_USB_NET2272 is not set
-# CONFIG_USB_R8A66597 is not set
-CONFIG_USB_SUPPORT=y
-# CONFIG_USB_ZERO is not set
-CONFIG_VFAT_FS=y
-# CONFIG_VGA_CONSOLE is not set
-# CONFIG_VLAN_8021Q is not set
-CONFIG_VT=y
-CONFIG_VT_CONSOLE=y
-CONFIG_VT_CONSOLE_SLEEP=y
-CONFIG_VT_HW_CONSOLE_BINDING=y
-# CONFIG_WATCHDOG is not set
-CONFIG_XZ_DEC=y
-CONFIG_ZONE_DMA_FLAG=0
diff --git a/target/linux/xburst/id800wt/config-2.6.36 b/target/linux/xburst/id800wt/config-2.6.36
deleted file mode 100644 (file)
index a0e0acb..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-CONFIG_BACKLIGHT_CLASS_DEVICE=y
-CONFIG_BACKLIGHT_LCD_SUPPORT=y
-# CONFIG_BACKLIGHT_ADP8860 is not set
-CONFIG_BACKLIGHT_PWM=y
-CONFIG_BLK_DEV_SD=y
-CONFIG_FB_JZ4740=y
-# CONFIG_FB_TMIO is not set
-CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_GPIO_SYSFS=y
-CONFIG_INPUT_PWM_BEEPER=y
-CONFIG_INPUT_TOUCHSCREEN=y
-CONFIG_JZ4740_ID800WT=y
-CONFIG_KEYBOARD_GPIO=y
-CONFIG_KEYBOARD_MATRIX=y
-CONFIG_LCD_CLASS_DEVICE=y
-CONFIG_LCD_ILI8960=y
-# CONFIG_LCD_S6E63M0 is not set
-CONFIG_LOGO=y
-CONFIG_MFD_CORE=y
-CONFIG_MFD_JZ4740_ADC=y
-CONFIG_SCSI=y
-CONFIG_SCSI_DMA=y
-CONFIG_SPI=y
-CONFIG_SPI_BITBANG=y
-CONFIG_SPI_GPIO=y
-CONFIG_SPI_MASTER=y
-# CONFIG_TOUCHSCREEN_DYNAPRO is not set
-# CONFIG_TOUCHSCREEN_HAMPSHIRE is not set
-CONFIG_TOUCHSCREEN_JZ4740=y
-CONFIG_USB=y
-# CONFIG_USB_ETH_RNDIS is not set
-# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
-# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
-CONFIG_USB_OHCI_HCD=y
-CONFIG_USB_STORAGE=y
diff --git a/target/linux/xburst/id800wt/config-2.6.37 b/target/linux/xburst/id800wt/config-2.6.37
deleted file mode 100644 (file)
index a0e0acb..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-CONFIG_BACKLIGHT_CLASS_DEVICE=y
-CONFIG_BACKLIGHT_LCD_SUPPORT=y
-# CONFIG_BACKLIGHT_ADP8860 is not set
-CONFIG_BACKLIGHT_PWM=y
-CONFIG_BLK_DEV_SD=y
-CONFIG_FB_JZ4740=y
-# CONFIG_FB_TMIO is not set
-CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_GPIO_SYSFS=y
-CONFIG_INPUT_PWM_BEEPER=y
-CONFIG_INPUT_TOUCHSCREEN=y
-CONFIG_JZ4740_ID800WT=y
-CONFIG_KEYBOARD_GPIO=y
-CONFIG_KEYBOARD_MATRIX=y
-CONFIG_LCD_CLASS_DEVICE=y
-CONFIG_LCD_ILI8960=y
-# CONFIG_LCD_S6E63M0 is not set
-CONFIG_LOGO=y
-CONFIG_MFD_CORE=y
-CONFIG_MFD_JZ4740_ADC=y
-CONFIG_SCSI=y
-CONFIG_SCSI_DMA=y
-CONFIG_SPI=y
-CONFIG_SPI_BITBANG=y
-CONFIG_SPI_GPIO=y
-CONFIG_SPI_MASTER=y
-# CONFIG_TOUCHSCREEN_DYNAPRO is not set
-# CONFIG_TOUCHSCREEN_HAMPSHIRE is not set
-CONFIG_TOUCHSCREEN_JZ4740=y
-CONFIG_USB=y
-# CONFIG_USB_ETH_RNDIS is not set
-# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
-# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
-CONFIG_USB_OHCI_HCD=y
-CONFIG_USB_STORAGE=y
diff --git a/target/linux/xburst/n516/config-2.6.36 b/target/linux/xburst/n516/config-2.6.36
deleted file mode 100644 (file)
index a3f4b11..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-CONFIG_FB_DEFERRED_IO=y
-CONFIG_FB_JZ4740=y
-CONFIG_FB_METRONOME=m
-CONFIG_FB_SYS_FOPS=m
-CONFIG_HWMON=y
-CONFIG_I2C=y
-CONFIG_I2C_ALGOBIT=y
-CONFIG_I2C_BOARDINFO=y
-CONFIG_I2C_JZ47XX=y
-CONFIG_JZ4740_N516=y
-CONFIG_LEDS_GPIO=y
-CONFIG_MTD_CMDLINE_PARTS=y
-CONFIG_NEW_LEDS=y
-CONFIG_SENSORS_LM75=y
diff --git a/target/linux/xburst/n516/config-2.6.37 b/target/linux/xburst/n516/config-2.6.37
deleted file mode 100644 (file)
index 2f82d9c..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-CONFIG_FB_DEFERRED_IO=y
-CONFIG_FB_JZ4740=y
-CONFIG_FB_METRONOME=m
-CONFIG_FB_SYS_FOPS=m
-CONFIG_HWMON=y
-CONFIG_I2C=y
-CONFIG_I2C_ALGOBIT=y
-CONFIG_I2C_BOARDINFO=y
-CONFIG_JZ4740_N516=y
-CONFIG_LEDS_GPIO=y
-CONFIG_MTD_CMDLINE_PARTS=y
-CONFIG_NEW_LEDS=y
-CONFIG_SENSORS_LM75=y
diff --git a/target/linux/xburst/n526/config-2.6.36 b/target/linux/xburst/n526/config-2.6.36
deleted file mode 100644 (file)
index 8f7155c..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-# CONFIG_FB_SYS_COPYAREA is not set
-# CONFIG_FB_SYS_FILLRECT is not set
-# CONFIG_FB_SYS_IMAGEBLIT is not set
-CONFIG_I2C=y
-CONFIG_I2C_ALGOBIT=y
-CONFIG_I2C_BOARDINFO=y
-CONFIG_I2C_JZ47XX=y
-CONFIG_JZ4740_N526=y
-CONFIG_N526_LPC=y
diff --git a/target/linux/xburst/n526/config-2.6.37 b/target/linux/xburst/n526/config-2.6.37
deleted file mode 100644 (file)
index 79a901d..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-# CONFIG_FB_SYS_COPYAREA is not set
-# CONFIG_FB_SYS_FILLRECT is not set
-# CONFIG_FB_SYS_IMAGEBLIT is not set
-CONFIG_I2C=y
-CONFIG_I2C_ALGOBIT=y
-CONFIG_I2C_BOARDINFO=y
-CONFIG_JZ4740_N526=y
-CONFIG_N526_LPC=y
diff --git a/target/linux/xburst/patches-2.6.37/001-xburst-cache-quirks.patch b/target/linux/xburst/patches-2.6.37/001-xburst-cache-quirks.patch
deleted file mode 100644 (file)
index 2508947..0000000
+++ /dev/null
@@ -1,334 +0,0 @@
-From 765782d71760915300cba7ee0259a7c770c56d71 Mon Sep 17 00:00:00 2001
-From: Lars-Peter Clausen <lars@metafoo.de>
-Date: Sat, 24 Apr 2010 17:34:29 +0200
-Subject: [PATCH 01/23] JZ4740 cache quirks
-
----
- arch/mips/include/asm/r4kcache.h |  231 ++++++++++++++++++++++++++++++++++++++
- 1 files changed, 231 insertions(+), 0 deletions(-)
-
---- a/arch/mips/include/asm/r4kcache.h
-+++ b/arch/mips/include/asm/r4kcache.h
-@@ -17,6 +17,58 @@
- #include <asm/cpu-features.h>
- #include <asm/mipsmtregs.h>
-+#ifdef CONFIG_JZRISC
-+
-+#define K0_TO_K1()                            \
-+do {                                          \
-+      unsigned long __k0_addr;                \
-+                                              \
-+      __asm__ __volatile__(                   \
-+      "la %0, 1f\n\t"                         \
-+      "or     %0, %0, %1\n\t"                 \
-+      "jr     %0\n\t"                         \
-+      "nop\n\t"                               \
-+      "1: nop\n"                              \
-+      : "=&r"(__k0_addr)                      \
-+      : "r" (0x20000000) );                   \
-+} while(0)
-+
-+#define K1_TO_K0()                            \
-+do {                                          \
-+      unsigned long __k0_addr;                \
-+      __asm__ __volatile__(                   \
-+      "nop;nop;nop;nop;nop;nop;nop\n\t"       \
-+      "la %0, 1f\n\t"                         \
-+      "jr     %0\n\t"                         \
-+      "nop\n\t"                               \
-+      "1:     nop\n"                          \
-+      : "=&r" (__k0_addr));                   \
-+} while (0)
-+
-+#define INVALIDATE_BTB()                      \
-+do {                                          \
-+      unsigned long tmp;                      \
-+      __asm__ __volatile__(                   \
-+      ".set mips32\n\t"                       \
-+      "mfc0 %0, $16, 7\n\t"                   \
-+      "nop\n\t"                               \
-+      "ori %0, 2\n\t"                         \
-+      "mtc0 %0, $16, 7\n\t"                   \
-+      "nop\n\t"                               \
-+      : "=&r" (tmp));                         \
-+} while (0)
-+
-+#define SYNC_WB() __asm__ __volatile__ ("sync")
-+
-+#else /* CONFIG_JZRISC */
-+
-+#define K0_TO_K1() do { } while (0)
-+#define K1_TO_K0() do { } while (0)
-+#define INVALIDATE_BTB() do { } while (0)
-+#define SYNC_WB() do { } while (0)
-+
-+#endif /* CONFIG_JZRISC */
-+
- /*
-  * This macro return a properly sign-extended address suitable as base address
-  * for indexed cache operations.  Two issues here:
-@@ -144,6 +196,7 @@ static inline void flush_icache_line_ind
- {
-       __iflush_prologue
-       cache_op(Index_Invalidate_I, addr);
-+      INVALIDATE_BTB();
-       __iflush_epilogue
- }
-@@ -151,6 +204,7 @@ static inline void flush_dcache_line_ind
- {
-       __dflush_prologue
-       cache_op(Index_Writeback_Inv_D, addr);
-+      SYNC_WB();
-       __dflush_epilogue
- }
-@@ -163,6 +217,7 @@ static inline void flush_icache_line(uns
- {
-       __iflush_prologue
-       cache_op(Hit_Invalidate_I, addr);
-+      INVALIDATE_BTB();
-       __iflush_epilogue
- }
-@@ -170,6 +225,7 @@ static inline void flush_dcache_line(uns
- {
-       __dflush_prologue
-       cache_op(Hit_Writeback_Inv_D, addr);
-+      SYNC_WB();
-       __dflush_epilogue
- }
-@@ -177,6 +233,7 @@ static inline void invalidate_dcache_lin
- {
-       __dflush_prologue
-       cache_op(Hit_Invalidate_D, addr);
-+      SYNC_WB();
-       __dflush_epilogue
- }
-@@ -209,6 +266,7 @@ static inline void flush_scache_line(uns
- static inline void protected_flush_icache_line(unsigned long addr)
- {
-       protected_cache_op(Hit_Invalidate_I, addr);
-+      INVALIDATE_BTB();
- }
- /*
-@@ -220,6 +278,7 @@ static inline void protected_flush_icach
- static inline void protected_writeback_dcache_line(unsigned long addr)
- {
-       protected_cache_op(Hit_Writeback_Inv_D, addr);
-+      SYNC_WB();
- }
- static inline void protected_writeback_scache_line(unsigned long addr)
-@@ -396,8 +455,10 @@ static inline void blast_##pfx##cache##l
- __BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 16)
- __BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 16)
- __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 16)
-+#ifndef CONFIG_JZRISC
- __BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 32)
- __BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 32)
-+#endif
- __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 32)
- __BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 64)
- __BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64)
-@@ -405,12 +466,122 @@ __BUILD_BLAST_CACHE(s, scache, Index_Wri
- __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128)
- __BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 16)
-+#ifndef CONFIG_JZRISC
- __BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 32)
-+#endif
- __BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 16)
- __BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 32)
- __BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 64)
- __BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 128)
-+#ifdef CONFIG_JZRISC
-+
-+static inline void blast_dcache32(void)
-+{
-+      unsigned long start = INDEX_BASE;
-+      unsigned long end = start + current_cpu_data.dcache.waysize;
-+      unsigned long ws_inc = 1UL << current_cpu_data.dcache.waybit;
-+      unsigned long ws_end = current_cpu_data.dcache.ways <<
-+                             current_cpu_data.dcache.waybit;
-+      unsigned long ws, addr;
-+
-+      for (ws = 0; ws < ws_end; ws += ws_inc)
-+              for (addr = start; addr < end; addr += 0x400)
-+                      cache32_unroll32(addr|ws,Index_Writeback_Inv_D);
-+
-+      SYNC_WB();
-+}
-+
-+static inline void blast_dcache32_page(unsigned long page)
-+{
-+      unsigned long start = page;
-+      unsigned long end = page + PAGE_SIZE;
-+
-+      do {
-+              cache32_unroll32(start,Hit_Writeback_Inv_D);
-+              start += 0x400;
-+      } while (start < end);
-+
-+      SYNC_WB();
-+}
-+
-+static inline void blast_dcache32_page_indexed(unsigned long page)
-+{
-+      unsigned long indexmask = current_cpu_data.dcache.waysize - 1;
-+      unsigned long start = INDEX_BASE + (page & indexmask);
-+      unsigned long end = start + PAGE_SIZE;
-+      unsigned long ws_inc = 1UL << current_cpu_data.dcache.waybit;
-+      unsigned long ws_end = current_cpu_data.dcache.ways <<
-+                             current_cpu_data.dcache.waybit;
-+      unsigned long ws, addr;
-+
-+      for (ws = 0; ws < ws_end; ws += ws_inc)
-+              for (addr = start; addr < end; addr += 0x400)
-+                      cache32_unroll32(addr|ws,Index_Writeback_Inv_D);
-+
-+      SYNC_WB();
-+}
-+
-+static inline void blast_icache32(void)
-+{
-+      unsigned long start = INDEX_BASE;
-+      unsigned long end = start + current_cpu_data.icache.waysize;
-+      unsigned long ws_inc = 1UL << current_cpu_data.icache.waybit;
-+      unsigned long ws_end = current_cpu_data.icache.ways <<
-+                             current_cpu_data.icache.waybit;
-+      unsigned long ws, addr;
-+
-+      K0_TO_K1();
-+
-+      for (ws = 0; ws < ws_end; ws += ws_inc)
-+              for (addr = start; addr < end; addr += 0x400)
-+                      cache32_unroll32(addr|ws,Index_Invalidate_I);
-+
-+      INVALIDATE_BTB();
-+
-+      K1_TO_K0();
-+}
-+
-+static inline void blast_icache32_page(unsigned long page)
-+{
-+      unsigned long start = page;
-+      unsigned long end = page + PAGE_SIZE;
-+
-+      K0_TO_K1();
-+
-+      do {
-+              cache32_unroll32(start,Hit_Invalidate_I);
-+              start += 0x400;
-+      } while (start < end);
-+
-+      INVALIDATE_BTB();
-+
-+      K1_TO_K0();
-+}
-+
-+static inline void blast_icache32_page_indexed(unsigned long page)
-+{
-+      unsigned long indexmask = current_cpu_data.icache.waysize - 1;
-+      unsigned long start = INDEX_BASE + (page & indexmask);
-+      unsigned long end = start + PAGE_SIZE;
-+      unsigned long ws_inc = 1UL << current_cpu_data.icache.waybit;
-+      unsigned long ws_end = current_cpu_data.icache.ways <<
-+                             current_cpu_data.icache.waybit;
-+      unsigned long ws, addr;
-+
-+      K0_TO_K1();
-+
-+      for (ws = 0; ws < ws_end; ws += ws_inc)
-+              for (addr = start; addr < end; addr += 0x400)
-+                      cache32_unroll32(addr|ws,Index_Invalidate_I);
-+
-+      INVALIDATE_BTB();
-+
-+      K1_TO_K0();
-+}
-+
-+#endif /* CONFIG_JZRISC */
-+
- /* build blast_xxx_range, protected_blast_xxx_range */
- #define __BUILD_BLAST_CACHE_RANGE(pfx, desc, hitop, prot) \
- static inline void prot##blast_##pfx##cache##_range(unsigned long start, \
-@@ -432,13 +603,73 @@ static inline void prot##blast_##pfx##ca
-       __##pfx##flush_epilogue                                         \
- }
-+#ifndef CONFIG_JZRISC
- __BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, protected_)
-+#endif
- __BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, protected_)
-+#ifndef CONFIG_JZRISC
- __BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, protected_)
- __BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, )
-+#endif
- __BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, )
- /* blast_inv_dcache_range */
- __BUILD_BLAST_CACHE_RANGE(inv_d, dcache, Hit_Invalidate_D, )
- __BUILD_BLAST_CACHE_RANGE(inv_s, scache, Hit_Invalidate_SD, )
-+#ifdef CONFIG_JZRISC
-+
-+static inline void protected_blast_dcache_range(unsigned long start,
-+                                              unsigned long end)
-+{
-+      unsigned long lsize = cpu_dcache_line_size();
-+      unsigned long addr = start & ~(lsize - 1);
-+      unsigned long aend = (end - 1) & ~(lsize - 1);
-+
-+      while (1) {
-+              protected_cache_op(Hit_Writeback_Inv_D, addr);
-+              if (addr == aend)
-+                      break;
-+              addr += lsize;
-+      }
-+      SYNC_WB();
-+}
-+
-+static inline void protected_blast_icache_range(unsigned long start,
-+                                              unsigned long end)
-+{
-+      unsigned long lsize = cpu_icache_line_size();
-+      unsigned long addr = start & ~(lsize - 1);
-+      unsigned long aend = (end - 1) & ~(lsize - 1);
-+
-+      K0_TO_K1();
-+
-+      while (1) {
-+              protected_cache_op(Hit_Invalidate_I, addr);
-+              if (addr == aend)
-+                      break;
-+              addr += lsize;
-+      }
-+      INVALIDATE_BTB();
-+
-+      K1_TO_K0();
-+}
-+
-+static inline void blast_dcache_range(unsigned long start,
-+                                    unsigned long end)
-+{
-+      unsigned long lsize = cpu_dcache_line_size();
-+      unsigned long addr = start & ~(lsize - 1);
-+      unsigned long aend = (end - 1) & ~(lsize - 1);
-+
-+      while (1) {
-+              cache_op(Hit_Writeback_Inv_D, addr);
-+              if (addr == aend)
-+                      break;
-+              addr += lsize;
-+      }
-+      SYNC_WB();
-+}
-+
-+#endif /* CONFIG_JZRISC */
-+
- #endif /* _ASM_R4KCACHE_H */
diff --git a/target/linux/xburst/patches-2.6.37/006-add-n516-board-support.patch b/target/linux/xburst/patches-2.6.37/006-add-n516-board-support.patch
deleted file mode 100644 (file)
index c875f13..0000000
+++ /dev/null
@@ -1,663 +0,0 @@
-From fc2b1daf842a1b98472699fdddc8c12ce344bbd7 Mon Sep 17 00:00:00 2001
-From: Lars-Peter Clausen <lars@metafoo.de>
-Date: Sat, 24 Apr 2010 17:25:01 +0200
-Subject: [PATCH 06/23] Add n516 board support
-
----
- arch/mips/include/asm/mach-jz4740/board-n516.h |   39 +++
- arch/mips/jz4740/Kconfig                       |    4 +
- arch/mips/jz4740/Makefile                      |    1 +
- arch/mips/jz4740/board-n516-display.c          |  394 ++++++++++++++++++++++++
- arch/mips/jz4740/board-n516.c                  |  182 +++++++++++
- 5 files changed, 620 insertions(+), 0 deletions(-)
- create mode 100644 arch/mips/include/asm/mach-jz4740/board-n516.h
- create mode 100644 arch/mips/jz4740/board-n516-display.c
- create mode 100644 arch/mips/jz4740/board-n516.c
-
---- /dev/null
-+++ b/arch/mips/include/asm/mach-jz4740/board-n516.h
-@@ -0,0 +1,39 @@
-+/*
-+ *  linux/include/asm-mips/mach-jz4740/board-n516.h
-+ *
-+ *  JZ4730-based N516 board definition.
-+ *
-+ *  Copyright (C) 2009, Yauhen Kharuzhy <jekhor@gmail.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.
-+ */
-+
-+#ifndef __ASM_JZ4740_N516_H__
-+#define __ASM_JZ4740_N516_H__
-+
-+#include <asm/mach-jz4740/gpio.h>
-+
-+/*
-+ * GPIO
-+ */
-+#define GPIO_SD_VCC_EN_N      JZ_GPIO_PORTD(17)
-+#define GPIO_SD_CD_N          JZ_GPIO_PORTD(7)
-+#define GPIO_SD_WP            JZ_GPIO_PORTD(15)
-+#define GPIO_USB_DETECT               JZ_GPIO_PORTD(19)
-+#define GPIO_CHARG_STAT_N     JZ_GPIO_PORTD(16)
-+#define GPIO_LED_ENABLE               JZ_GPIO_PORTD(28)
-+#define GPIO_LPC_INT          JZ_GPIO_PORTD(14)
-+#define GPIO_HPHONE_DETECT    JZ_GPIO_PORTD(20)
-+#define GPIO_SPEAKER_ENABLE   JZ_GPIO_PORTD(21)
-+
-+/* Display */
-+#define GPIO_DISPLAY_RST_L    JZ_GPIO_PORTB(18)
-+#define GPIO_DISPLAY_RDY      JZ_GPIO_PORTB(17)
-+#define GPIO_DISPLAY_STBY     JZ_GPIO_PORTC(22)
-+#define GPIO_DISPLAY_ERR      JZ_GPIO_PORTC(23)
-+#define GPIO_DISPLAY_OFF_N    JZ_GPIO_PORTD(1)
-+
-+#endif /* __ASM_JZ4740_N516_H__ */
---- a/arch/mips/jz4740/Kconfig
-+++ b/arch/mips/jz4740/Kconfig
-@@ -6,6 +6,10 @@ choice
- config JZ4740_QI_LB60
-       bool "Qi Hardware Ben NanoNote"
-+config JZ4740_N516
-+      bool "Hanvon n516 eBook reader"
-+      select SOC_JZ4740
-+
- endchoice
- config HAVE_PWM
---- a/arch/mips/jz4740/Makefile
-+++ b/arch/mips/jz4740/Makefile
-@@ -12,6 +12,7 @@ obj-$(CONFIG_DEBUG_FS) += clock-debugfs.
- # board specific support
- obj-$(CONFIG_JZ4740_QI_LB60)  += board-qi_lb60.o
-+obj-$(CONFIG_JZ4740_N516)     += board-n516.o board-n516-display.o
- # PM support
---- /dev/null
-+++ b/arch/mips/jz4740/board-n516-display.c
-@@ -0,0 +1,394 @@
-+/*
-+ * board-n516-display.c -- Platform device for N516 display
-+ *
-+ * Copyright (C) 2009, Yauhen Kharuzhy <jekhor@gmail.com>
-+ *
-+ * This file is subject to the terms and conditions of the GNU General Public
-+ * License. See the file COPYING in the main directory of this archive for
-+ * more details.
-+ */
-+
-+#include <linux/module.h>
-+#include <linux/kernel.h>
-+#include <linux/errno.h>
-+#include <linux/string.h>
-+#include <linux/delay.h>
-+#include <linux/interrupt.h>
-+#include <linux/fb.h>
-+#include <linux/init.h>
-+#include <linux/platform_device.h>
-+#include <linux/irq.h>
-+#include <linux/gpio.h>
-+
-+#include <asm/mach-jz4740/jz4740_fb.h>
-+
-+#include <asm/mach-jz4740/platform.h>
-+#include <asm/mach-jz4740/board-n516.h>
-+
-+#include <video/metronomefb.h>
-+#include <linux/console.h>
-+
-+static struct fb_videomode n516_fb_modes[] = {
-+      [0] = {
-+              .name           = "Metronome 800x600",
-+              .refresh        = 50,
-+              .xres           = 400,
-+              .yres           = 624,
-+              .hsync_len      = 31,
-+              .vsync_len      = 23,
-+              .right_margin   = 31,
-+              .left_margin    = 5,
-+              .upper_margin   = 1,
-+              .lower_margin   = 2,
-+              .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
-+      },
-+};
-+
-+static struct jz4740_fb_platform_data n516_fb_pdata = {
-+      .num_modes      = ARRAY_SIZE(n516_fb_modes),
-+      .modes          = n516_fb_modes,
-+      .bpp            = 16,
-+      .lcd_type       = JZ_LCD_TYPE_GENERIC_16_BIT,
-+};
-+
-+struct n516_board_info {
-+      uint8_t *metromem;
-+      size_t wfm_size;
-+      struct fb_info *host_fbinfo; /* the host LCD controller's fbi */
-+      unsigned int fw;
-+      unsigned int fh;
-+};
-+
-+static struct platform_device *n516_device;
-+static struct n516_board_info n516_board_info;
-+
-+static int metronome_gpios[] = {
-+      GPIO_DISPLAY_STBY,
-+      GPIO_DISPLAY_RST_L,
-+      GPIO_DISPLAY_RDY,
-+      GPIO_DISPLAY_ERR,
-+/*    GPIO_DISPLAY_OFF_N,*/
-+};
-+
-+static const char *metronome_gpio_names[] = {
-+      "Metronome STDBY",
-+      "Metronome RST",
-+      "Metronome RDY",
-+      "Metronome ERR",
-+/*    "Metronone OFF",*/
-+};
-+
-+static int n516_enable_hostfb(bool enable)
-+{
-+      int ret;
-+      int blank = enable ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN;
-+
-+      acquire_console_sem();
-+      ret = fb_blank(n516_board_info.host_fbinfo, blank);
-+      release_console_sem();
-+
-+      return ret;
-+}
-+
-+static int n516_init_metronome_gpios(struct metronomefb_par *par)
-+{
-+      int i;
-+      int ret;
-+
-+      for (i = 0; i < ARRAY_SIZE(metronome_gpios); ++i) {
-+              ret = gpio_request(metronome_gpios[i], metronome_gpio_names[i]);
-+              if (ret)
-+                      goto err;
-+      }
-+
-+      gpio_direction_output(GPIO_DISPLAY_OFF_N, 0);
-+      gpio_direction_output(GPIO_DISPLAY_RST_L, 0);
-+      gpio_direction_output(GPIO_DISPLAY_STBY, 0);
-+      gpio_direction_input(GPIO_DISPLAY_RDY);
-+      gpio_direction_input(GPIO_DISPLAY_ERR);
-+
-+      return 0;
-+err:
-+      for (--i; i >= 0; --i)
-+              gpio_free(metronome_gpios[i]);
-+
-+      return ret;
-+}
-+
-+static int n516_share_video_mem(struct fb_info *info)
-+{
-+      int ret;
-+
-+      dev_dbg(&n516_device->dev, "ENTER %s\n", __func__);
-+      dev_dbg(&n516_device->dev, "%s, info->var.xres = %u, info->var.yres = %u\n", __func__, info->var.xres, info->var.yres);
-+      /* rough check if this is our desired fb and not something else */
-+      if ((info->var.xres != n516_fb_pdata.modes[0].xres)
-+              || (info->var.yres != n516_fb_pdata.modes[0].yres))
-+              return 0;
-+
-+      /* we've now been notified that we have our new fb */
-+      n516_board_info.metromem = info->screen_base;
-+      n516_board_info.host_fbinfo = info;
-+
-+      n516_enable_hostfb(false);
-+      /* try to refcount host drv since we are the consumer after this */
-+      if (!try_module_get(info->fbops->owner))
-+              return -ENODEV;
-+
-+      /* this _add binds metronomefb to n516. metronomefb refcounts n516 */
-+      ret = platform_device_add(n516_device);
-+
-+      if (ret) {
-+              platform_device_put(n516_device);
-+              return ret;
-+      }
-+
-+      /* request our platform independent driver */
-+      request_module("metronomefb");
-+
-+      return 0;
-+}
-+
-+static int n516_unshare_video_mem(struct fb_info *info)
-+{
-+      dev_dbg(&n516_device->dev, "ENTER %s\n", __func__);
-+
-+      if (info != n516_board_info.host_fbinfo)
-+              return 0;
-+
-+      module_put(n516_board_info.host_fbinfo->fbops->owner);
-+      return 0;
-+}
-+
-+static int n516_fb_notifier_callback(struct notifier_block *self,
-+                               unsigned long event, void *data)
-+{
-+      struct fb_event *evdata = data;
-+      struct fb_info *info = evdata->info;
-+
-+      dev_dbg(&n516_device->dev, "ENTER %s\n", __func__);
-+
-+      if (event == FB_EVENT_FB_REGISTERED)
-+              return n516_share_video_mem(info);
-+      else if (event == FB_EVENT_FB_UNREGISTERED)
-+              return n516_unshare_video_mem(info);
-+
-+      return 0;
-+}
-+
-+static struct notifier_block n516_fb_notif = {
-+      .notifier_call = n516_fb_notifier_callback,
-+};
-+
-+/* this gets called as part of our init. these steps must be done now so
-+ * that we can use set_pxa_fb_info */
-+static void __init n516_presetup_fb(void)
-+{
-+      int padding_size;
-+      int totalsize;
-+
-+      /* the frame buffer is divided as follows:
-+      command | CRC | padding
-+      16kb waveform data | CRC | padding
-+      image data | CRC
-+      */
-+
-+      n516_board_info.fw = 800;
-+      n516_board_info.fh = 624;
-+
-+      /* waveform must be 16k + 2 for checksum */
-+      n516_board_info.wfm_size = roundup(16*1024 + 2, n516_board_info.fw);
-+
-+      padding_size = PAGE_SIZE + (4 * n516_board_info.fw);
-+
-+      /* total is 1 cmd , 1 wfm, padding and image */
-+      totalsize = n516_board_info.fw + n516_board_info.wfm_size;
-+      totalsize += padding_size + (n516_board_info.fw*n516_board_info.fh);
-+
-+      /* save this off because we're manipulating fw after this and
-+       * we'll need it when we're ready to setup the framebuffer */
-+
-+      /* the reason we do this adjustment is because we want to acquire
-+       * more framebuffer memory without imposing custom awareness on the
-+       * underlying driver */
-+      n516_fb_pdata.modes[0].yres = DIV_ROUND_UP(totalsize, n516_board_info.fw);
-+
-+      jz4740_framebuffer_device.dev.platform_data = &n516_fb_pdata;
-+      platform_device_register(&jz4740_framebuffer_device);
-+}
-+
-+/* this gets called by metronomefb as part of its init, in our case, we
-+ * have already completed initial framebuffer init in presetup_fb so we
-+ * can just setup the fb access pointers */
-+static int n516_setup_fb(struct metronomefb_par *par)
-+{
-+      /* metromem was set up by the notifier in share_video_mem so now
-+       * we can use its value to calculate the other entries */
-+      par->metromem_cmd = (struct metromem_cmd *) n516_board_info.metromem;
-+      par->metromem_wfm = n516_board_info.metromem + n516_board_info.fw;
-+      par->metromem_img = par->metromem_wfm + n516_board_info.wfm_size;
-+      par->metromem_img_csum = (u16 *) (par->metromem_img + (n516_board_info.fw * n516_board_info.fh));
-+      par->metromem_dma = n516_board_info.host_fbinfo->fix.smem_start;
-+
-+      return 0;
-+}
-+
-+static int n516_get_panel_type(void)
-+{
-+      return 5;
-+}
-+
-+static irqreturn_t n516_handle_irq(int irq, void *dev_id)
-+{
-+      struct metronomefb_par *par = dev_id;
-+
-+      dev_dbg(&par->pdev->dev, "Metronome IRQ! RDY=%d\n",     gpio_get_value(GPIO_DISPLAY_RDY));
-+      wake_up_all(&par->waitq);
-+
-+      return IRQ_HANDLED;
-+}
-+
-+static void n516_power_ctl(struct metronomefb_par *par, int cmd)
-+{
-+      switch (cmd) {
-+      case METRONOME_POWER_OFF:
-+              gpio_set_value(GPIO_DISPLAY_OFF_N, 1);
-+              n516_enable_hostfb(false);
-+              break;
-+      case METRONOME_POWER_ON:
-+              gpio_set_value(GPIO_DISPLAY_OFF_N, 0);
-+              n516_enable_hostfb(true);
-+              break;
-+      }
-+}
-+
-+static int n516_get_rdy(struct metronomefb_par *par)
-+{
-+      return gpio_get_value(GPIO_DISPLAY_RDY);
-+}
-+
-+static int n516_get_err(struct metronomefb_par *par)
-+{
-+      return gpio_get_value(GPIO_DISPLAY_ERR);
-+}
-+
-+static int n516_setup_irq(struct fb_info *info)
-+{
-+      int ret;
-+
-+      dev_dbg(&n516_device->dev, "ENTER %s\n", __func__);
-+
-+      ret = request_irq(gpio_to_irq(GPIO_DISPLAY_RDY), n516_handle_irq,
-+                              IRQF_TRIGGER_RISING,
-+                              "n516", info->par);
-+      if (ret)
-+              dev_err(&n516_device->dev, "request_irq failed: %d\n", ret);
-+
-+      return ret;
-+}
-+
-+static void n516_set_rst(struct metronomefb_par *par, int state)
-+{
-+      dev_dbg(&n516_device->dev, "ENTER %s, RDY=%d\n", __func__, gpio_get_value(GPIO_DISPLAY_RDY));
-+      if (state)
-+              gpio_set_value(GPIO_DISPLAY_RST_L, 1);
-+      else
-+              gpio_set_value(GPIO_DISPLAY_RST_L, 0);
-+}
-+
-+static void n516_set_stdby(struct metronomefb_par *par, int state)
-+{
-+      dev_dbg(&n516_device->dev, "ENTER %s, RDY=%d\n", __func__, gpio_get_value(GPIO_DISPLAY_RDY));
-+      if (state)
-+              gpio_set_value(GPIO_DISPLAY_STBY, 1);
-+      else
-+              gpio_set_value(GPIO_DISPLAY_STBY, 0);
-+}
-+
-+static int n516_wait_event(struct metronomefb_par *par)
-+{
-+      unsigned long timeout = jiffies + HZ / 20;
-+
-+      dev_dbg(&n516_device->dev, "ENTER1 %s, RDY=%d\n",
-+                      __func__, gpio_get_value(GPIO_DISPLAY_RDY));
-+      while (n516_get_rdy(par) && time_before(jiffies, timeout))
-+              schedule();
-+
-+      dev_dbg(&n516_device->dev, "ENTER2 %s, RDY=%d\n",
-+                      __func__, gpio_get_value(GPIO_DISPLAY_RDY));
-+      return wait_event_timeout(par->waitq,
-+                      n516_get_rdy(par), HZ * 2) ? 0 : -EIO;
-+}
-+
-+static int n516_wait_event_intr(struct metronomefb_par *par)
-+{
-+      unsigned long timeout = jiffies + HZ/20;
-+
-+      dev_dbg(&n516_device->dev, "ENTER1 %s, RDY=%d\n",
-+                      __func__, gpio_get_value(GPIO_DISPLAY_RDY));
-+      while (n516_get_rdy(par) && time_before(jiffies, timeout))
-+              schedule();
-+
-+      dev_dbg(&n516_device->dev, "ENTER2 %s, RDY=%d\n",
-+                      __func__, gpio_get_value(GPIO_DISPLAY_RDY));
-+      return wait_event_interruptible_timeout(par->waitq,
-+                                      n516_get_rdy(par), HZ * 2) ? 0 : -EIO;
-+}
-+
-+static void n516_cleanup(struct metronomefb_par *par)
-+{
-+      int i;
-+
-+      free_irq(gpio_to_irq(GPIO_DISPLAY_RDY), par);
-+      for (i = 0; i < ARRAY_SIZE(metronome_gpios); ++i)
-+              gpio_free(metronome_gpios[i]);
-+}
-+
-+static struct metronome_board n516_board __initdata = {
-+      .owner                  = THIS_MODULE,
-+      .power_ctl              = n516_power_ctl,
-+      .setup_irq              = n516_setup_irq,
-+      .setup_io               = n516_init_metronome_gpios,
-+      .setup_fb               = n516_setup_fb,
-+      .set_rst                = n516_set_rst,
-+      .get_err                = n516_get_err,
-+      .get_rdy                = n516_get_rdy,
-+      .set_stdby              = n516_set_stdby,
-+      .met_wait_event         = n516_wait_event,
-+      .met_wait_event_intr    = n516_wait_event_intr,
-+      .get_panel_type         = n516_get_panel_type,
-+      .cleanup                = n516_cleanup,
-+};
-+
-+static int __init n516_init(void)
-+{
-+      int ret;
-+
-+      /* Keep the metronome off, until its driver is loaded */
-+      ret = gpio_request(GPIO_DISPLAY_OFF_N, "Display off");
-+      if (ret)
-+              return ret;
-+
-+      gpio_direction_output(GPIO_DISPLAY_OFF_N, 1);
-+
-+      /* before anything else, we request notification for any fb
-+       * creation events */
-+      fb_register_client(&n516_fb_notif);
-+
-+      n516_device = platform_device_alloc("metronomefb", -1);
-+      if (!n516_device)
-+              return -ENOMEM;
-+
-+      /* the n516_board that will be seen by metronomefb is a copy */
-+      platform_device_add_data(n516_device, &n516_board,
-+                                      sizeof(n516_board));
-+
-+      n516_presetup_fb();
-+
-+      return 0;
-+}
-+module_init(n516_init);
-+
-+MODULE_DESCRIPTION("board driver for n516 display");
-+MODULE_AUTHOR("Yauhen Kharuzhy");
-+MODULE_LICENSE("GPL");
---- /dev/null
-+++ b/arch/mips/jz4740/board-n516.c
-@@ -0,0 +1,182 @@
-+/*
-+ * linux/arch/mips/jz4740/board-516.c
-+ *
-+ * JZ4740 n516 board setup routines.
-+ *
-+ * Copyright (c) 2009, Yauhen Kharuzhy <jekhor@gmail.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.
-+ */
-+
-+#include <linux/init.h>
-+#include <linux/sched.h>
-+#include <linux/ioport.h>
-+#include <linux/mm.h>
-+#include <linux/console.h>
-+#include <linux/delay.h>
-+#include <linux/i2c.h>
-+#include <linux/platform_device.h>
-+#include <linux/mtd/mtd.h>
-+#include <linux/leds.h>
-+
-+#include <linux/power_supply.h>
-+#include <linux/power/gpio-charger.h>
-+
-+#include <linux/i2c.h>
-+
-+#include <asm/mach-jz4740/jz4740_mmc.h>
-+#include <asm/mach-jz4740/jz4740_nand.h>
-+
-+#include <asm/mach-jz4740/board-n516.h>
-+#include <asm/mach-jz4740/platform.h>
-+
-+#include "clock.h"
-+
-+static long n516_panic_blink(int state)
-+{
-+      gpio_set_value(GPIO_LED_ENABLE, state ? 1 : 0);
-+      return 0;
-+}
-+
-+static void __init board_gpio_setup(void)
-+{
-+/*    jz_gpio_enable_pullup(JZ_GPIO_PORTD(23));
-+      jz_gpio_enable_pullup(JZ_GPIO_PORTD(24));*/
-+}
-+
-+static const struct i2c_board_info n516_i2c_board_info[] = {
-+      {
-+              .type           = "LPC524",
-+              .addr           = 0x54,
-+      },
-+      {
-+              .type           = "lm75a",
-+              .addr           = 0x48,
-+      }
-+};
-+
-+static struct jz4740_mmc_platform_data n516_mmc_pdata = {
-+      .gpio_card_detect       = GPIO_SD_CD_N,
-+      .card_detect_active_low = 1,
-+      .gpio_read_only         = -1,
-+      .gpio_power             = GPIO_SD_VCC_EN_N,
-+      .power_active_low = 1,
-+};
-+
-+static struct gpio_led n516_leds[] = {
-+      {
-+              .name = "n516:blue:power",
-+              .gpio = GPIO_LED_ENABLE,
-+              .default_state = LEDS_GPIO_DEFSTATE_ON,
-+              .default_trigger = "nand-disk",
-+      }
-+};
-+
-+static struct gpio_led_platform_data n516_leds_pdata = {
-+      .leds = n516_leds,
-+      .num_leds = ARRAY_SIZE(n516_leds),
-+};
-+
-+static struct platform_device n516_leds_device = {
-+      .name = "leds-gpio",
-+      .id = -1,
-+      .dev = {
-+              .platform_data = &n516_leds_pdata,
-+      },
-+};
-+
-+static struct mtd_partition n516_partitions[] = {
-+      { .name = "NAND BOOT partition",
-+        .offset = 0 * 0x100000,
-+        .size = 4 * 0x100000,
-+      },
-+      { .name = "NAND KERNEL partition",
-+        .offset = 4 * 0x100000,
-+        .size = 4 * 0x100000,
-+      },
-+      { .name = "NAND ROOTFS partition",
-+        .offset = 8 * 0x100000,
-+        .size = 504 * 0x100000,
-+      },
-+};
-+
-+static struct nand_ecclayout n516_ecclayout = {
-+      .eccbytes = 36,
-+      .eccpos = {
-+               6,  7,  8,  9, 10, 11, 12, 13, 14,
-+              15, 16, 17, 18, 19, 20, 21, 22, 23,
-+              24, 25, 26, 27, 28, 29, 30, 31, 32,
-+              33, 34, 35, 36, 37, 38, 39, 40, 41,
-+      },
-+      .oobfree = {
-+              {
-+                      .offset = 2,
-+                      .length = 4
-+              },
-+              {
-+                      .offset = 42,
-+                      .length = 22,
-+              }
-+      }
-+};
-+
-+static struct jz_nand_platform_data n516_nand_pdata = {
-+      .ecc_layout = &n516_ecclayout,
-+      .partitions = n516_partitions,
-+      .num_partitions = ARRAY_SIZE(n516_partitions),
-+      .busy_gpio = 94,
-+};
-+
-+static char *n516_batteries[] = {
-+      "n516_battery",
-+};
-+
-+static struct gpio_charger_platform_data n516_charger_pdata = {
-+      .name = "usb",
-+      .type = POWER_SUPPLY_TYPE_USB,
-+      .gpio = GPIO_USB_DETECT,
-+      .gpio_active_low = 1,
-+      .batteries = n516_batteries,
-+      .num_batteries = ARRAY_SIZE(n516_batteries),
-+};
-+
-+static struct platform_device n516_charger_device = {
-+      .name = "gpio-charger",
-+      .dev = {
-+              .platform_data = &n516_charger_pdata,
-+      },
-+};
-+
-+static struct platform_device *n516_devices[] __initdata = {
-+      &jz4740_nand_device,
-+      &n516_leds_device,
-+      &jz4740_mmc_device,
-+      &jz4740_i2s_device,
-+      &jz4740_codec_device,
-+      &jz4740_rtc_device,
-+      &jz4740_udc_device,
-+      &jz4740_i2c_device,
-+      &n516_charger_device,
-+};
-+
-+struct jz4740_clock_board_data jz4740_clock_bdata = {
-+      .ext_rate = 12000000,
-+      .rtc_rate = 32768,
-+};
-+
-+static int n516_setup_platform(void)
-+{
-+      jz4740_serial_device_register();
-+      board_gpio_setup();
-+
-+      panic_blink = n516_panic_blink;
-+      i2c_register_board_info(0, n516_i2c_board_info, ARRAY_SIZE(n516_i2c_board_info));
-+      jz4740_mmc_device.dev.platform_data = &n516_mmc_pdata;
-+      jz4740_nand_device.dev.platform_data = &n516_nand_pdata;
-+
-+      return platform_add_devices(n516_devices, ARRAY_SIZE(n516_devices));
-+}
-+arch_initcall(n516_setup_platform);
diff --git a/target/linux/xburst/patches-2.6.37/007-add-n526-board-support.patch b/target/linux/xburst/patches-2.6.37/007-add-n526-board-support.patch
deleted file mode 100644 (file)
index 8e496b9..0000000
+++ /dev/null
@@ -1,358 +0,0 @@
-From 5739f1348052000ed12a7745f7bafd352fff832a Mon Sep 17 00:00:00 2001
-From: Lars-Peter Clausen <lars@metafoo.de>
-Date: Sat, 24 Apr 2010 17:25:23 +0200
-Subject: [PATCH 07/23] Add n526 board support
-
----
- arch/mips/jz4740/Kconfig      |    4 +
- arch/mips/jz4740/Makefile     |    1 +
- arch/mips/jz4740/board-n526.c |  318 +++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 323 insertions(+), 0 deletions(-)
- create mode 100644 arch/mips/jz4740/board-n526.c
-
---- a/arch/mips/jz4740/Kconfig
-+++ b/arch/mips/jz4740/Kconfig
-@@ -10,6 +10,10 @@ config JZ4740_N516
-       bool "Hanvon n516 eBook reader"
-       select SOC_JZ4740
-+config JZ4740_N526
-+      bool "Hanvon n526 eBook reader"
-+      select SOC_JZ4740
-+
- endchoice
- config HAVE_PWM
---- a/arch/mips/jz4740/Makefile
-+++ b/arch/mips/jz4740/Makefile
-@@ -13,6 +13,7 @@ obj-$(CONFIG_DEBUG_FS) += clock-debugfs.
- obj-$(CONFIG_JZ4740_QI_LB60)  += board-qi_lb60.o
- obj-$(CONFIG_JZ4740_N516)     += board-n516.o board-n516-display.o
-+obj-$(CONFIG_JZ4740_N526)     += board-n526.o
- # PM support
---- /dev/null
-+++ b/arch/mips/jz4740/board-n526.c
-@@ -0,0 +1,320 @@
-+/*
-+ *  Copyright (C) 2009, Lars-Peter Clausen <lars@metafoo.de>
-+ *    N526 eBook reader support
-+ *
-+ *  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.
-+ *
-+ *  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/kernel.h>
-+#include <linux/init.h>
-+#include <linux/gpio.h>
-+
-+#include <linux/mutex.h>
-+#include <linux/wait.h>
-+#include <video/broadsheetfb.h>
-+#include <linux/delay.h>
-+#include <linux/interrupt.h>
-+
-+#include <linux/input.h>
-+#include <linux/gpio_keys.h>
-+
-+#include <linux/leds.h>
-+
-+#include <linux/i2c.h>
-+
-+#include "clock.h"
-+
-+#include <asm/mach-jz4740/jz4740_mmc.h>
-+#include <asm/mach-jz4740/jz4740_nand.h>
-+#include <asm/mach-jz4740/jz4740_fb.h>
-+
-+#include <asm/mach-jz4740/platform.h>
-+
-+/* NAND */
-+static struct nand_ecclayout n526_ecclayout = {
-+      .eccbytes = 36,
-+      .eccpos = {
-+              6,  7,  8,  9,  10, 11, 12, 13,
-+              14, 15, 16, 17, 18, 19, 20, 21,
-+              22, 23, 24, 25, 26, 27, 28, 29,
-+              30, 31, 32, 33, 34, 35, 36, 37,
-+              38, 39, 40, 41},
-+      .oobfree = {
-+              {
-+                      .offset = 2,
-+                      .length = 4,
-+              },
-+              {
-+                      .offset = 42,
-+                      .length = 22,
-+              },
-+      }
-+};
-+
-+static struct mtd_partition n526_partitions[] = {
-+      { .name = "NAND BOOT partition",
-+        .offset = 0 * 0x100000,
-+        .size = 4 * 0x100000,
-+      },
-+      { .name = "NAND KERNEL partition",
-+        .offset = 4 * 0x100000,
-+        .size = 4 * 0x100000,
-+      },
-+      { .name = "NAND ROOTFS partition",
-+        .offset = 16 * 0x100000,
-+        .size = 498 * 0x100000,
-+      },
-+};
-+
-+static struct jz_nand_platform_data n526_nand_pdata = {
-+      .ecc_layout = &n526_ecclayout,
-+      .partitions = n526_partitions,
-+      .num_partitions = ARRAY_SIZE(n526_partitions),
-+      .busy_gpio = JZ_GPIO_PORTC(30),
-+};
-+
-+static struct jz4740_mmc_platform_data n526_mmc_pdata = {
-+      .gpio_card_detect       = JZ_GPIO_PORTD(7),
-+      .card_detect_active_low = 1,
-+      .gpio_read_only         = -1,
-+      .gpio_power             = JZ_GPIO_PORTD(17),
-+      .power_active_low       = 1,
-+};
-+
-+static struct gpio_led n526_leds[] = {
-+      {
-+              .name = "n526:blue:power",
-+              .gpio = JZ_GPIO_PORTD(28),
-+              .default_state = LEDS_GPIO_DEFSTATE_ON,
-+      }
-+};
-+
-+static struct gpio_led_platform_data n526_leds_pdata = {
-+      .leds = n526_leds,
-+      .num_leds = ARRAY_SIZE(n526_leds),
-+};
-+
-+static struct platform_device n526_leds_device = {
-+      .name = "leds-gpio",
-+      .id = -1,
-+      .dev = {
-+              .platform_data = &n526_leds_pdata,
-+      },
-+};
-+
-+static void __init board_gpio_setup(void)
-+{
-+      /* We only need to enable/disable pullup here for pins used in generic
-+       * drivers. Everything else is done by the drivers themselfs. */
-+      jz_gpio_disable_pullup(JZ_GPIO_PORTD(17));
-+      jz_gpio_enable_pullup(JZ_GPIO_PORTD(7));
-+      jz_gpio_disable_pullup(JZ_GPIO_PORTC(19));
-+      jz_gpio_disable_pullup(JZ_GPIO_PORTC(20));
-+      jz_gpio_disable_pullup(JZ_GPIO_PORTC(21));
-+      jz_gpio_disable_pullup(JZ_GPIO_PORTC(23));
-+}
-+
-+
-+static const int n526_eink_ctrl_gpios[] = {
-+      0,
-+      JZ_GPIO_PORTC(23),
-+      JZ_GPIO_PORTC(19),
-+      JZ_GPIO_PORTC(20),
-+};
-+
-+static void n526_eink_set_ctl(struct broadsheetfb_par * par, unsigned char ctrl, u8
-+value)
-+{
-+      gpio_set_value(n526_eink_ctrl_gpios[ctrl], value);
-+}
-+
-+
-+static int n526_eink_wait(struct broadsheetfb_par *par)
-+{
-+      wait_event(par->waitq, gpio_get_value(JZ_GPIO_PORTB(17)));
-+
-+      return 0;
-+}
-+
-+static u16 n526_eink_get_hdb(struct broadsheetfb_par *par)
-+{
-+      u16 value = 0;
-+      jz_gpio_port_direction_input(JZ_GPIO_PORTC(0), 0xffff);
-+      gpio_set_value(JZ_GPIO_PORTC(21), 0);
-+      mdelay(100);
-+
-+      value = jz_gpio_port_get_value(JZ_GPIO_PORTC(0), 0xffff);
-+
-+      gpio_set_value(JZ_GPIO_PORTC(21), 1);
-+      jz_gpio_port_direction_output(JZ_GPIO_PORTC(0), 0xffff);
-+      return value;
-+}
-+
-+static void n526_eink_set_hdb(struct broadsheetfb_par *par, u16 value)
-+{
-+      jz_gpio_port_set_value(JZ_GPIO_PORTC(0), value, 0xffff);
-+}
-+
-+static int n526_eink_init(struct broadsheetfb_par *par)
-+{
-+      int i;
-+
-+      gpio_request(JZ_GPIO_PORTD(1), "display reset");
-+      gpio_direction_output(JZ_GPIO_PORTD(1), 1);
-+      mdelay(10);
-+      gpio_set_value(JZ_GPIO_PORTD(1), 0);
-+
-+      gpio_request(JZ_GPIO_PORTB(18), "eink enable");
-+      gpio_direction_output(JZ_GPIO_PORTB(18), 0);
-+
-+      gpio_request(JZ_GPIO_PORTB(29), "foobar");
-+      gpio_direction_output(JZ_GPIO_PORTB(29), 1);
-+
-+      for(i = 1; i < ARRAY_SIZE(n526_eink_ctrl_gpios); ++i) {
-+              gpio_request(n526_eink_ctrl_gpios[i], "eink display ctrl");
-+              gpio_direction_output(n526_eink_ctrl_gpios[i], 0);
-+      }
-+
-+      gpio_request(JZ_GPIO_PORTC(22), "foobar");
-+      gpio_direction_input(JZ_GPIO_PORTC(22));
-+      gpio_request(JZ_GPIO_PORTC(21), "eink nRD");
-+      gpio_direction_output(JZ_GPIO_PORTC(21), 1);
-+
-+      for(i = 0; i < 16; ++i) {
-+              gpio_request(JZ_GPIO_PORTC(i), "eink display data");
-+      }
-+      jz_gpio_port_direction_output(JZ_GPIO_PORTC(0), 0xffff);
-+
-+      gpio_set_value(JZ_GPIO_PORTB(18), 1);
-+
-+      return 0;
-+}
-+
-+static irqreturn_t n526_eink_busy_irq(int irq, void *devid)
-+{
-+      struct broadsheetfb_par *par = devid;
-+      wake_up(&par->waitq);
-+
-+      return IRQ_HANDLED;
-+}
-+
-+static int n526_eink_setup_irq(struct fb_info *info)
-+{
-+      int ret;
-+      struct broadsheetfb_par *par = info->par;
-+
-+      gpio_request(JZ_GPIO_PORTB(17), "eink busy");
-+      gpio_direction_input(JZ_GPIO_PORTB(17));
-+
-+      ret = request_irq(gpio_to_irq(JZ_GPIO_PORTB(17)), n526_eink_busy_irq,
-+                              IRQF_DISABLED | IRQF_TRIGGER_RISING,
-+                              "eink busyline", par);
-+      if (ret)
-+              printk("n526 display: Failed to request busyline irq: %d\n", ret);
-+      return 0;
-+}
-+
-+static void n526_eink_cleanup(struct broadsheetfb_par *par)
-+{
-+}
-+
-+static struct broadsheet_board broadsheet_pdata = {
-+      .owner = THIS_MODULE,
-+      .init = n526_eink_init,
-+      .wait_for_rdy = n526_eink_wait,
-+      .set_ctl = n526_eink_set_ctl,
-+      .set_hdb = n526_eink_set_hdb,
-+      .get_hdb = n526_eink_get_hdb,
-+      .cleanup = n526_eink_cleanup,
-+      .setup_irq = n526_eink_setup_irq,
-+};
-+
-+static struct platform_device n526_broadsheet_device = {
-+      .name = "broadsheetfb",
-+      .id = -1,
-+      .dev = {
-+              .platform_data = &broadsheet_pdata,
-+      },
-+};
-+
-+/* Buttons */
-+static struct gpio_keys_button n526_gpio_keys_buttons[] = {
-+      [0] = {
-+              .code           = KEY_ENTER,
-+              .gpio           = 0,
-+              .active_low     = 1,
-+              .desc           = "Power",
-+      },
-+};
-+
-+static struct gpio_keys_platform_data n526_gpio_keys_data = {
-+      .nbuttons = ARRAY_SIZE(n526_gpio_keys_buttons),
-+      .buttons = n526_gpio_keys_buttons,
-+};
-+
-+static struct platform_device n526_gpio_keys_device = {
-+      .name = "gpio-keys",
-+      .id =   -1,
-+      .dev = {
-+              .platform_data = &n526_gpio_keys_data,
-+      }
-+};
-+
-+static struct i2c_board_info n526_i2c_board_info = {
-+      .type = "n526-lpc",
-+      .addr = 0x54,
-+};
-+
-+static struct platform_device *n526_platform_devices[] __initdata = {
-+      &jz4740_usb_ohci_device,
-+      &jz4740_udc_device,
-+      &jz4740_mmc_device,
-+      &jz4740_nand_device,
-+      &jz4740_i2s_device,
-+      &jz4740_codec_device,
-+      &jz4740_pcm_device,
-+      &jz4740_rtc_device,
-+      &jz4740_i2c_device,
-+      &n526_leds_device,
-+      &n526_broadsheet_device,
-+      &n526_gpio_keys_device,
-+};
-+
-+static int __init n526_init_platform_devices(void)
-+{
-+      jz4740_nand_device.dev.platform_data = &n526_nand_pdata;
-+      jz4740_mmc_device.dev.platform_data = &n526_mmc_pdata;
-+
-+      jz4740_serial_device_register();
-+
-+      n526_i2c_board_info.irq = gpio_to_irq(JZ_GPIO_PORTD(14)),
-+      i2c_register_board_info(0, &n526_i2c_board_info, 1);
-+
-+      return platform_add_devices(n526_platform_devices,
-+                                      ARRAY_SIZE(n526_platform_devices));
-+
-+}
-+
-+struct jz4740_clock_board_data jz4740_clock_bdata = {
-+      .ext_rate = 12000000,
-+      .rtc_rate = 32768,
-+};
-+
-+static int __init n526_board_setup(void)
-+{
-+      board_gpio_setup();
-+
-+      if (n526_init_platform_devices())
-+              panic("Failed to initalize platform devices\n");
-+
-+      return 0;
-+}
-+arch_initcall(n526_board_setup);
diff --git a/target/linux/xburst/patches-2.6.37/008-add-id800wt-board-support.patch b/target/linux/xburst/patches-2.6.37/008-add-id800wt-board-support.patch
deleted file mode 100644 (file)
index 04f367c..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-From ac67a626a852d6e720c2cc474b5e8824ad5b0875 Mon Sep 17 00:00:00 2001
-From: Lars-Peter Clausen <lars@metafoo.de>
-Date: Sun, 5 Sep 2010 20:34:08 +0200
-Subject: [PATCH 12/23] MIPS: JZ4740: Add id800wt board
-
----
- arch/mips/jz4740/Kconfig         |    4 +
- arch/mips/jz4740/Makefile        |    1 +
- arch/mips/jz4740/board-id800wt.c |  158 ++++++++++++++++++++++++++++++++++++++
- 3 files changed, 163 insertions(+), 0 deletions(-)
- create mode 100644 arch/mips/jz4740/board-id800wt.c
-
---- a/arch/mips/jz4740/Kconfig
-+++ b/arch/mips/jz4740/Kconfig
-@@ -14,6 +14,10 @@ config JZ4740_N526
-       bool "Hanvon n526 eBook reader"
-       select SOC_JZ4740
-+config JZ4740_ID800WT
-+      bool "Sungale id800wt picture frame"
-+      select SOC_JZ4740
-+
- endchoice
- config HAVE_PWM
---- a/arch/mips/jz4740/Makefile
-+++ b/arch/mips/jz4740/Makefile
-@@ -14,6 +14,7 @@ obj-$(CONFIG_DEBUG_FS) += clock-debugfs.
- obj-$(CONFIG_JZ4740_QI_LB60)  += board-qi_lb60.o
- obj-$(CONFIG_JZ4740_N516)     += board-n516.o board-n516-display.o
- obj-$(CONFIG_JZ4740_N526)     += board-n526.o
-+obj-$(CONFIG_JZ4740_ID800WT)  += board-id800wt.o
- # PM support
---- /dev/null
-+++ b/arch/mips/jz4740/board-id800wt.c
-@@ -0,0 +1,158 @@
-+/*
-+ * Copyright (C) 2010 Lars-Peter Clausen <lars@metafoo.de>
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 or later
-+ * as published by the Free Software Foundation.
-+ */
-+
-+#include <linux/kernel.h>
-+#include <linux/init.h>
-+#include <linux/gpio.h>
-+
-+#include <asm/mach-jz4740/platform.h>
-+
-+#include <linux/input.h>
-+#include <linux/power_supply.h>
-+#include <linux/pwm_backlight.h>
-+
-+#include "clock.h"
-+
-+#include <asm/mach-jz4740/jz4740_fb.h>
-+#include <asm/mach-jz4740/jz4740_nand.h>
-+
-+/* NAND */
-+static struct nand_ecclayout id800wt_ecclayout = {
-+      .oobfree = {
-+              {
-+                      .offset = 2,
-+                      .length = 4,
-+              },
-+              {
-+                      .offset = 42,
-+                      .length = 22,
-+              },
-+      }
-+};
-+
-+static struct mtd_partition id800wt_partitions[] = {
-+      { .name = "NAND BOOT partition",
-+        .offset = 0 * 0x100000,
-+        .size = 2 * 0x100000,
-+      },
-+      { .name = "NAND KERNEL partition",
-+        .offset = 2 * 0x100000,
-+        .size = 4 * 0x100000,
-+      },
-+      { .name = "NAND ROOTFS partition",
-+        .offset = 6 * 0x100000,
-+        .size = 498 * 0x100000,
-+      },
-+};
-+
-+static struct jz_nand_platform_data id800wt_nand_pdata = {
-+      .ecc_layout = &id800wt_ecclayout,
-+      .partitions = id800wt_partitions,
-+      .num_partitions = ARRAY_SIZE(id800wt_partitions),
-+      .busy_gpio = JZ_GPIO_PORTC(30),
-+};
-+
-+/* Display */
-+static struct fb_videomode id800wt_video_modes[] = {
-+      {
-+              .name = "800x600",
-+              .xres = 800,
-+              .yres = 600,
-+              .refresh = 40,
-+              .left_margin = 0,
-+              .right_margin = 255,
-+              .upper_margin = 0,
-+              .lower_margin = 35,
-+              .hsync_len = 1,
-+              .vsync_len = 1,
-+              .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
-+              .vmode = FB_VMODE_NONINTERLACED,
-+      },
-+};
-+
-+static struct jz4740_fb_platform_data id800wt_fb_pdata = {
-+      .width          = 60,
-+      .height         = 45,
-+      .num_modes      = ARRAY_SIZE(id800wt_video_modes),
-+      .modes          = id800wt_video_modes,
-+      .bpp            = 16,
-+      .lcd_type       = JZ_LCD_TYPE_SPECIAL_TFT_1,
-+      .pixclk_falling_edge = 1,
-+      .special_tft_config = {
-+              .spl = JZ4740_FB_SPECIAL_TFT_CONFIG(1051, 1053),
-+              .cls = JZ4740_FB_SPECIAL_TFT_CONFIG(631, 744),
-+              .ps  = JZ4740_FB_SPECIAL_TFT_CONFIG(0, 45),
-+              .rev = JZ4740_FB_SPECIAL_TFT_CONFIG(0, 0),
-+      },
-+};
-+
-+/* Backlight */
-+static int id800wt_backlight_invert(struct device *dev, int brightness)
-+{
-+      return 255 - brightness;
-+}
-+
-+static struct platform_pwm_backlight_data id800wt_backlight_data = {
-+      .pwm_id = 7,
-+      .max_brightness = 255,
-+      .dft_brightness = 255,
-+      .pwm_period_ns = 8000000,
-+      .notify = id800wt_backlight_invert,
-+};
-+
-+static struct platform_device id800wt_backlight_device = {
-+      .name = "pwm-backlight",
-+      .id = -1,
-+      .dev = {
-+              .platform_data = &id800wt_backlight_data,
-+              .parent = &jz4740_framebuffer_device.dev,
-+      },
-+};
-+
-+static struct platform_device *jz_platform_devices[] __initdata = {
-+      &jz4740_usb_ohci_device,
-+      &jz4740_udc_device,
-+      &jz4740_nand_device,
-+      &jz4740_framebuffer_device,
-+      &jz4740_i2s_device,
-+      &jz4740_codec_device,
-+      &jz4740_pcm_device,
-+      &jz4740_rtc_device,
-+      &jz4740_adc_device,
-+      &id800wt_backlight_device,
-+};
-+
-+static int __init id800wt_init_platform_devices(void)
-+{
-+      jz4740_framebuffer_device.dev.platform_data = &id800wt_fb_pdata;
-+      jz4740_nand_device.dev.platform_data = &id800wt_nand_pdata;
-+
-+      jz4740_serial_device_register();
-+
-+      jz_gpio_enable_pullup(JZ_GPIO_LCD_PS);
-+      jz_gpio_enable_pullup(JZ_GPIO_LCD_REV);
-+
-+      return platform_add_devices(jz_platform_devices,
-+                                      ARRAY_SIZE(jz_platform_devices));
-+}
-+
-+struct jz4740_clock_board_data jz4740_clock_bdata = {
-+      .ext_rate = 12000000,
-+      .rtc_rate = 32768,
-+};
-+
-+static int __init id800wt_board_setup(void)
-+{
-+      printk("Sungale pictureframe id800wt setup\n");
-+
-+      if (id800wt_init_platform_devices())
-+              panic("Failed to initalize platform devices\n");
-+
-+      return 0;
-+}
-+arch_initcall(id800wt_board_setup);
diff --git a/target/linux/xburst/patches-2.6.37/010-n516-sound.patch b/target/linux/xburst/patches-2.6.37/010-n516-sound.patch
deleted file mode 100644 (file)
index 99be829..0000000
+++ /dev/null
@@ -1,342 +0,0 @@
-From f5d9169627e0b0d7111011c9b10f1ff533c8dc85 Mon Sep 17 00:00:00 2001
-From: Lars-Peter Clausen <lars@metafoo.de>
-Date: Sun, 1 Aug 2010 21:34:54 +0200
-Subject: [PATCH 08/23] Add N516 sound SoC board driver
-
----
- sound/soc/jz4740/Kconfig  |    8 ++
- sound/soc/jz4740/Makefile |    2 +
- sound/soc/jz4740/n516.c   |  303 +++++++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 313 insertions(+), 0 deletions(-)
- create mode 100644 sound/soc/jz4740/n516.c
-
---- a/sound/soc/jz4740/Kconfig
-+++ b/sound/soc/jz4740/Kconfig
-@@ -21,3 +21,11 @@ config SND_JZ4740_SOC_QI_LB60
-       help
-         Say Y if you want to add support for ASoC audio on the Qi LB60 board
-         a.k.a Qi Ben NanoNote.
-+
-+config SND_JZ4740_SOC_N516
-+      tristate "SoC Audio support for Hanvon N516 eBook reader"
-+      depends on SND_JZ4740_SOC && JZ4740_N516
-+      select SND_JZ4740_SOC_I2S
-+    select SND_SOC_JZCODEC
-+      help
-+        Say Y if you want to enable support for SoC audio on the Hanvon N516.
---- a/sound/soc/jz4740/Makefile
-+++ b/sound/soc/jz4740/Makefile
-@@ -9,5 +9,7 @@ obj-$(CONFIG_SND_JZ4740_SOC_I2S) += snd-
- # Jz4740 Machine Support
- snd-soc-qi-lb60-objs := qi_lb60.o
-+snd-soc-n516-objs := n516.o
- obj-$(CONFIG_SND_JZ4740_SOC_QI_LB60) += snd-soc-qi-lb60.o
-+obj-$(CONFIG_SND_JZ4740_SOC_N516) += snd-soc-n516.o
---- /dev/null
-+++ b/sound/soc/jz4740/n516.c
-@@ -0,0 +1,303 @@
-+/*
-+ * Copyright (C) 2009, Yauhen Kharuzhy <jekhor@gmail.com>
-+ *  OpenInkpot project
-+ * Copyright (C) 2010, Lars-Peter Clausen <lars@metafoo.de>
-+ *
-+ * 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.
-+ *
-+ * 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/interrupt.h>
-+#include <linux/platform_device.h>
-+#include <sound/core.h>
-+#include <sound/pcm.h>
-+#include <sound/soc.h>
-+#include <sound/soc-dapm.h>
-+#include <sound/jack.h>
-+#include <linux/gpio.h>
-+#include <linux/workqueue.h>
-+
-+#include "../codecs/jzcodec.h"
-+#include "jz4740-pcm.h"
-+#include "jz4740-i2s.h"
-+
-+#include <asm/mach-jz4740/board-n516.h>
-+
-+enum {
-+      N516_SPEAKER_AUTO = 0,
-+      N516_SPEAKER_OFF = 1,
-+      N516_SPEAKER_ON = 2,
-+};
-+
-+static int n516_speaker_mode;
-+static struct snd_soc_codec *n516_codec;
-+static struct work_struct n516_headphone_work;
-+
-+static void n516_ext_control(void)
-+{
-+      if (!n516_codec)
-+              return;
-+
-+      switch (n516_speaker_mode) {
-+      case N516_SPEAKER_ON:
-+              snd_soc_dapm_enable_pin(n516_codec, "Speaker");
-+              break;
-+      case N516_SPEAKER_OFF:
-+              snd_soc_dapm_disable_pin(n516_codec, "Speaker");
-+          break;
-+      case N516_SPEAKER_AUTO:
-+              if (snd_soc_dapm_get_pin_status(n516_codec, "Headphone"))
-+                      snd_soc_dapm_disable_pin(n516_codec, "Speaker");
-+              else
-+                      snd_soc_dapm_enable_pin(n516_codec, "Speaker");
-+              break;
-+      default:
-+              break;
-+      }
-+
-+    /* signal a DAPM event */
-+    snd_soc_dapm_sync(n516_codec);
-+}
-+
-+static int n516_speaker_event(struct snd_soc_dapm_widget *widget,
-+                           struct snd_kcontrol *ctrl, int event)
-+{
-+      int on = !SND_SOC_DAPM_EVENT_OFF(event);
-+
-+      gpio_set_value(GPIO_SPEAKER_ENABLE, on);
-+
-+      return 0;
-+}
-+
-+static void n516_headphone_event_work(struct work_struct *work)
-+{
-+      n516_ext_control();
-+}
-+
-+static int n516_headphone_event(struct snd_soc_dapm_widget *widget,
-+                           struct snd_kcontrol *ctrl, int event)
-+{
-+      /* We can't call soc_dapm_sync from a event handler */
-+      if (event & (SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD))
-+              schedule_work(&n516_headphone_work);
-+      return 0;
-+}
-+
-+static const struct snd_soc_dapm_widget n516_widgets[] = {
-+      SND_SOC_DAPM_SPK("Speaker", n516_speaker_event),
-+      SND_SOC_DAPM_HP("Headphone", n516_headphone_event),
-+      SND_SOC_DAPM_MIC("Mic", NULL),
-+};
-+
-+static const struct snd_soc_dapm_route n516_routes[] = {
-+      {"Mic", NULL, "MIC"},
-+      {"Speaker", NULL, "LOUT"},
-+      {"Speaker", NULL, "ROUT"},
-+      {"Headphone", NULL, "LOUT"},
-+      {"Headphone", NULL, "ROUT"},
-+};
-+
-+static const char *n516_speaker_modes[] = {"Auto", "Off", "On"};
-+static const struct soc_enum n516_speaker_mode_enum =
-+      SOC_ENUM_SINGLE_EXT(ARRAY_SIZE(n516_speaker_modes), n516_speaker_modes);
-+
-+static int n516_get_speaker_mode(struct snd_kcontrol *kcontrol,
-+      struct snd_ctl_elem_value *ucontrol)
-+{
-+      ucontrol->value.integer.value[0] = n516_speaker_mode;
-+      return 0;
-+}
-+
-+static int n516_set_speaker_mode(struct snd_kcontrol *kcontrol,
-+      struct snd_ctl_elem_value *ucontrol)
-+{
-+      if (n516_speaker_mode == ucontrol->value.integer.value[0])
-+              return 0;
-+
-+      n516_speaker_mode = ucontrol->value.integer.value[0];
-+      n516_ext_control();
-+      return 1;
-+}
-+
-+static const struct snd_kcontrol_new n516_controls[] = {
-+      SOC_ENUM_EXT("Speaker Function", n516_speaker_mode_enum,
-+              n516_get_speaker_mode, n516_set_speaker_mode),
-+};
-+
-+#define N516_DAIFMT (SND_SOC_DAIFMT_I2S | \
-+                      SND_SOC_DAIFMT_NB_NF | \
-+                      SND_SOC_DAIFMT_CBM_CFM)
-+
-+static int n516_codec_init(struct snd_soc_codec *codec)
-+{
-+      int ret;
-+      struct snd_soc_dai *cpu_dai = codec->socdev->card->dai_link->cpu_dai;
-+      struct snd_soc_dai *codec_dai = codec->socdev->card->dai_link->codec_dai;
-+
-+      n516_codec = codec;
-+
-+      snd_soc_dapm_nc_pin(codec, "LIN");
-+      snd_soc_dapm_nc_pin(codec, "RIN");
-+
-+      ret = snd_soc_dai_set_fmt(codec_dai, N516_DAIFMT);
-+      if (ret < 0) {
-+              dev_err(codec->dev, "Failed to set codec dai format: %d\n", ret);
-+              return ret;
-+      }
-+
-+      ret = snd_soc_dai_set_fmt(cpu_dai, N516_DAIFMT);
-+      if (ret < 0) {
-+              dev_err(codec->dev, "Failed to set cpu dai format: %d\n", ret);
-+              return ret;
-+      }
-+
-+      ret = snd_soc_dai_set_sysclk(codec_dai, JZCODEC_SYSCLK, 111,
-+              SND_SOC_CLOCK_IN);
-+      if (ret < 0) {
-+              dev_err(codec->dev, "Failed to set codec dai sysclk: %d\n", ret);
-+              return ret;
-+      }
-+
-+      ret = snd_soc_add_controls(codec, n516_controls,
-+              ARRAY_SIZE(n516_controls));
-+      if (ret) {
-+              dev_err(codec->dev, "Failed to add controls: %d\n", ret);
-+              return ret;
-+      }
-+
-+
-+      ret = snd_soc_dapm_new_controls(codec, n516_widgets,
-+              ARRAY_SIZE(n516_widgets));
-+      if (ret) {
-+              dev_err(codec->dev, "Failed to add dapm controls: %d\n", ret);
-+              return ret;
-+      }
-+
-+      ret = snd_soc_dapm_add_routes(codec, n516_routes, ARRAY_SIZE(n516_routes));
-+      if (ret) {
-+              dev_err(codec->dev, "Failed to add dapm routes: %d\n", ret);
-+              return ret;
-+      }
-+
-+      snd_soc_dapm_sync(codec);
-+
-+      return 0;
-+}
-+
-+static struct snd_soc_dai_link n516_dai = {
-+      .name = "jz-codec",
-+      .stream_name = "JZCODEC",
-+      .cpu_dai = &jz4740_i2s_dai,
-+      .codec_dai = &jz_codec_dai,
-+      .init = n516_codec_init,
-+};
-+
-+static struct snd_soc_card n516_card = {
-+      .name = "N516",
-+      .dai_link = &n516_dai,
-+      .num_links = 1,
-+      .platform = &jz4740_soc_platform,
-+};
-+
-+static struct snd_soc_device n516_snd_devdata = {
-+      .card = &n516_card,
-+      .codec_dev = &soc_codec_dev_jzcodec,
-+};
-+
-+static struct platform_device *n516_snd_device;
-+
-+static struct snd_soc_jack n516_hp_jack;
-+
-+static struct snd_soc_jack_pin n516_hp_pin = {
-+      .pin = "Headphone",
-+      .mask = SND_JACK_HEADPHONE,
-+};
-+
-+static struct snd_soc_jack_gpio n516_hp_gpio = {
-+      .gpio = GPIO_HPHONE_DETECT,
-+      .name = "Headphone detect",
-+      .report = SND_JACK_HEADPHONE,
-+      .debounce_time = 100,
-+};
-+
-+static int __init n516_add_headphone_jack(void)
-+{
-+      int ret;
-+
-+      ret = snd_soc_jack_new(&n516_card, "Headphone jack",
-+              SND_JACK_HEADPHONE, &n516_hp_jack);
-+      if (ret)
-+              return ret;
-+
-+      ret = snd_soc_jack_add_pins(&n516_hp_jack, 1, &n516_hp_pin);
-+      if (ret)
-+              return ret;
-+
-+      ret = snd_soc_jack_add_gpios(&n516_hp_jack, 1, &n516_hp_gpio);
-+
-+      return ret;
-+}
-+
-+static int __init n516_init(void)
-+{
-+      int ret;
-+
-+      n516_snd_device = platform_device_alloc("soc-audio", -1);
-+
-+      if (!n516_snd_device)
-+              return -ENOMEM;
-+
-+      ret = gpio_request(GPIO_SPEAKER_ENABLE, "Speaker enable");
-+      if (ret) {
-+              pr_err("n516 snd: Failed to request SPEAKER_ENABLE GPIO(%d): %d\n",
-+                              GPIO_SPEAKER_ENABLE, ret);
-+              goto err_device_put;
-+      }
-+
-+      gpio_direction_output(GPIO_SPEAKER_ENABLE, 0);
-+      INIT_WORK(&n516_headphone_work, n516_headphone_event_work);
-+
-+      platform_set_drvdata(n516_snd_device, &n516_snd_devdata);
-+      n516_snd_devdata.dev = &n516_snd_device->dev;
-+      ret = platform_device_add(n516_snd_device);
-+      if (ret) {
-+              pr_err("n516 snd: Failed to add snd soc device: %d\n", ret);
-+              goto err_unset_pdata;
-+      }
-+
-+      ret = n516_add_headphone_jack();
-+      /* We can live without it, so just print a warning */
-+      if (ret)
-+              pr_warning("n516 snd: Failed to initalise headphone jack: %d\n", ret);
-+
-+      return 0;
-+
-+err_unset_pdata:
-+      platform_set_drvdata(n516_snd_device, NULL);
-+/*err_gpio_free_speaker:*/
-+      gpio_free(GPIO_SPEAKER_ENABLE);
-+err_device_put:
-+      platform_device_put(n516_snd_device);
-+
-+      return ret;
-+}
-+module_init(n516_init);
-+
-+static void __exit n516_exit(void)
-+{
-+      snd_soc_jack_free_gpios(&n516_hp_jack, 1, &n516_hp_gpio);
-+      gpio_free(GPIO_SPEAKER_ENABLE);
-+      platform_device_unregister(n516_snd_device);
-+}
-+module_exit(n516_exit);
-+
-+MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
-+MODULE_DESCRIPTION("ALSA SoC N516 Audio support");
-+MODULE_LICENSE("GPL v2");
diff --git a/target/linux/xburst/patches-2.6.37/011-n526-sound.patch b/target/linux/xburst/patches-2.6.37/011-n526-sound.patch
deleted file mode 100644 (file)
index ac96af1..0000000
+++ /dev/null
@@ -1,209 +0,0 @@
-From ad2a34ac6d06aa5362e648bba89d8796e94b4e7d Mon Sep 17 00:00:00 2001
-From: Lars-Peter Clausen <lars@metafoo.de>
-Date: Sat, 24 Apr 2010 12:38:41 +0200
-Subject: [PATCH 09/23] Add N526 sound SoC board driver
-
----
- sound/soc/jz4740/Kconfig  |    8 ++
- sound/soc/jz4740/Makefile |    2 +
- sound/soc/jz4740/n526.c   |  169 +++++++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 179 insertions(+), 0 deletions(-)
- create mode 100644 sound/soc/jz4740/n526.c
-
---- a/sound/soc/jz4740/Kconfig
-+++ b/sound/soc/jz4740/Kconfig
-@@ -29,3 +29,11 @@ config SND_JZ4740_SOC_N516
-     select SND_SOC_JZCODEC
-       help
-         Say Y if you want to enable support for SoC audio on the Hanvon N516.
-+
-+config SND_JZ4740_SOC_N526
-+      tristate "SoC Audio support for Hanvon N526 eBook reader"
-+      depends on SND_JZ4740_SOC && JZ4740_N526
-+      select SND_JZ4740_SOC_I2S
-+    select SND_SOC_JZCODEC
-+      help
-+        Say Y if you want to enable support for SoC audio on the Hanvon N526.
---- a/sound/soc/jz4740/Makefile
-+++ b/sound/soc/jz4740/Makefile
-@@ -10,6 +10,8 @@ obj-$(CONFIG_SND_JZ4740_SOC_I2S) += snd-
- # Jz4740 Machine Support
- snd-soc-qi-lb60-objs := qi_lb60.o
- snd-soc-n516-objs := n516.o
-+snd-soc-n526-objs := n526.o
- obj-$(CONFIG_SND_JZ4740_SOC_QI_LB60) += snd-soc-qi-lb60.o
- obj-$(CONFIG_SND_JZ4740_SOC_N516) += snd-soc-n516.o
-+obj-$(CONFIG_SND_JZ4740_SOC_N526) += snd-soc-n526.o
---- /dev/null
-+++ b/sound/soc/jz4740/n526.c
-@@ -0,0 +1,169 @@
-+/*
-+ * Copyright (C) 2009, Lars-Peter Clausen <lars@metafoo.de>
-+ *
-+ * 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.
-+ *
-+ *  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/moduleparam.h>
-+#include <linux/timer.h>
-+#include <linux/interrupt.h>
-+#include <linux/platform_device.h>
-+#include <sound/core.h>
-+#include <sound/pcm.h>
-+#include <sound/soc.h>
-+#include <sound/soc-dapm.h>
-+#include <linux/gpio.h>
-+
-+#include "../codecs/jzcodec.h"
-+#include "jz4740-pcm.h"
-+#include "jz4740-i2s.h"
-+
-+#define N526_AMP_EN_GPIO JZ_GPIO_PORTD(4)
-+
-+static int n526_spk_event(struct snd_soc_dapm_widget *widget,
-+                           struct snd_kcontrol *ctrl, int event)
-+{
-+      gpio_set_value(N526_AMP_EN_GPIO, !SND_SOC_DAPM_EVENT_OFF(event));
-+      return 0;
-+}
-+
-+static const struct snd_soc_dapm_widget n526_widgets[] = {
-+      SND_SOC_DAPM_SPK("Speaker", n526_spk_event),
-+      SND_SOC_DAPM_HP("Headphone", NULL),
-+      SND_SOC_DAPM_MIC("Mic", NULL),
-+};
-+
-+static const struct snd_soc_dapm_route n526_routes[] = {
-+      {"Mic", NULL, "MIC"},
-+      {"Speaker", NULL, "LOUT"},
-+      {"Speaker", NULL, "ROUT"},
-+      {"Headphone", NULL, "LOUT"},
-+      {"Headphone", NULL, "ROUT"},
-+};
-+
-+static const struct snd_kcontrol_new n526_controls[] = {
-+      SOC_DAPM_PIN_SWITCH("Speaker"),
-+};
-+
-+#define N526_DAIFMT (SND_SOC_DAIFMT_I2S | \
-+                      SND_SOC_DAIFMT_NB_NF | \
-+                      SND_SOC_DAIFMT_CBM_CFM)
-+
-+static int n526_codec_init(struct snd_soc_codec *codec)
-+{
-+      int ret;
-+      struct snd_soc_dai *cpu_dai = codec->socdev->card->dai_link->cpu_dai;
-+      struct snd_soc_dai *codec_dai = codec->socdev->card->dai_link->codec_dai;
-+
-+      snd_soc_dapm_nc_pin(codec, "LIN");
-+      snd_soc_dapm_nc_pin(codec, "RIN");
-+
-+      ret = snd_soc_dai_set_fmt(codec_dai, N526_DAIFMT);
-+      if (ret < 0) {
-+              dev_err(codec->dev, "Failed to set codec dai format: %d\n", ret);
-+              return ret;
-+      }
-+
-+      ret = snd_soc_dai_set_fmt(cpu_dai, N526_DAIFMT);
-+      if (ret < 0) {
-+              dev_err(codec->dev, "Failed to set cpu dai format: %d\n", ret);
-+              return ret;
-+      }
-+
-+      ret = snd_soc_dai_set_sysclk(codec_dai, JZCODEC_SYSCLK, 111,
-+              SND_SOC_CLOCK_IN);
-+      if (ret < 0) {
-+              dev_err(codec->dev, "Failed to set codec dai sysclk: %d\n", ret);
-+              return ret;
-+      }
-+
-+      snd_soc_dapm_new_controls(codec, n526_widgets, ARRAY_SIZE(n526_widgets));
-+
-+      snd_soc_add_controls(codec, n526_controls,
-+                              ARRAY_SIZE(n526_controls));
-+
-+      snd_soc_dapm_add_routes(codec, n526_routes, ARRAY_SIZE(n526_routes));
-+
-+      snd_soc_dapm_sync(codec);
-+
-+      return 0;
-+}
-+
-+static struct snd_soc_dai_link n526_dai = {
-+      .name = "jz-codec",
-+      .stream_name = "JZCODEC",
-+      .cpu_dai = &jz4740_i2s_dai,
-+      .codec_dai = &jz_codec_dai,
-+      .init = n526_codec_init,
-+};
-+
-+static struct snd_soc_card n526 = {
-+      .name = "N526",
-+      .dai_link = &n526_dai,
-+      .num_links = 1,
-+      .platform = &jz4740_soc_platform,
-+};
-+
-+static struct snd_soc_device n526_snd_devdata = {
-+      .card = &n526,
-+      .codec_dev = &soc_codec_dev_jzcodec,
-+};
-+
-+static struct platform_device *n526_snd_device;
-+
-+static int __init n526_init(void)
-+{
-+      int ret;
-+
-+      n526_snd_device = platform_device_alloc("soc-audio", -1);
-+
-+      if (!n526_snd_device)
-+              return -ENOMEM;
-+
-+      ret = gpio_request(N526_AMP_EN_GPIO, "AMP");
-+      if (ret) {
-+              pr_err("n526 snd: Failed to request AMP GPIO(%d): %d\n",
-+                              N526_AMP_EN_GPIO, ret);
-+              goto err_device_put;
-+      }
-+
-+      gpio_direction_output(JZ_GPIO_PORTD(4), 0);
-+
-+      platform_set_drvdata(n526_snd_device, &n526_snd_devdata);
-+      n526_snd_devdata.dev = &n526_snd_device->dev;
-+      ret = platform_device_add(n526_snd_device);
-+      if (ret) {
-+              pr_err("n526 snd: Failed to add snd soc device: %d\n", ret);
-+              goto err_unset_pdata;
-+      }
-+
-+       return 0;
-+
-+err_unset_pdata:
-+      platform_set_drvdata(n526_snd_device, NULL);
-+      gpio_free(N526_AMP_EN_GPIO);
-+err_device_put:
-+      platform_device_put(n526_snd_device);
-+
-+      return ret;
-+}
-+module_init(n526_init);
-+
-+static void __exit n526_exit(void)
-+{
-+      gpio_free(N526_AMP_EN_GPIO);
-+      platform_device_unregister(n526_snd_device);
-+}
-+module_exit(n526_exit);
-+
-+MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
-+MODULE_DESCRIPTION("ALSA SoC N526 audio support");
-+MODULE_LICENSE("GPL v2");
diff --git a/target/linux/xburst/patches-2.6.37/020-qi_lb60-add-gpio-charger.patch b/target/linux/xburst/patches-2.6.37/020-qi_lb60-add-gpio-charger.patch
deleted file mode 100644 (file)
index 20b4a5e..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-From d6d333bf7512547ca5dab6763e989181bd705d0d Mon Sep 17 00:00:00 2001
-From: Lars-Peter Clausen <lars@metafoo.de>
-Date: Sat, 17 Jul 2010 11:16:29 +0000
-Subject: [PATCH 05/23] MIPS: JZ4740: qi_lb60: Add gpio-charger device
-
-Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
----
- arch/mips/jz4740/board-qi_lb60.c |   24 ++++++++++++++++++++++++
- 1 files changed, 24 insertions(+), 0 deletions(-)
-
---- a/arch/mips/jz4740/board-qi_lb60.c
-+++ b/arch/mips/jz4740/board-qi_lb60.c
-@@ -23,6 +23,7 @@
- #include <linux/spi/spi_gpio.h>
- #include <linux/power_supply.h>
- #include <linux/power/jz4740-battery.h>
-+#include <linux/power/gpio-charger.h>
- #include <asm/mach-jz4740/jz4740_fb.h>
- #include <asm/mach-jz4740/jz4740_mmc.h>
-@@ -396,6 +397,28 @@ static struct platform_device qi_lb60_pw
-       },
- };
-+/* charger */
-+static char *qi_lb60_batteries[] = {
-+      "battery",
-+};
-+
-+static struct gpio_charger_platform_data qi_lb60_charger_pdata = {
-+      .name = "usb",
-+      .type = POWER_SUPPLY_TYPE_USB,
-+      .gpio = JZ_GPIO_PORTD(28),
-+      .gpio_active_low = 1,
-+      .batteries = qi_lb60_batteries,
-+      .num_batteries = ARRAY_SIZE(qi_lb60_batteries),
-+};
-+
-+static struct platform_device qi_lb60_charger_device = {
-+      .name = "gpio-charger",
-+      .dev = {
-+              .platform_data = &qi_lb60_charger_pdata,
-+      },
-+};
-+
-+
- static struct platform_device *jz_platform_devices[] __initdata = {
-       &jz4740_udc_device,
-       &jz4740_mmc_device,
-@@ -410,6 +433,7 @@ static struct platform_device *jz_platfo
-       &jz4740_adc_device,
-       &qi_lb60_gpio_keys,
-       &qi_lb60_pwm_beeper,
-+      &qi_lb60_charger_device,
- };
- static void __init board_gpio_setup(void)
diff --git a/target/linux/xburst/patches-2.6.37/021-qi_lb60-Don-t-use-3-wire-spi-mode-for-the-display-f.patch b/target/linux/xburst/patches-2.6.37/021-qi_lb60-Don-t-use-3-wire-spi-mode-for-the-display-f.patch
deleted file mode 100644 (file)
index 986ce7c..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-From 9871577ee1ba0f90ae748799ccfbeeac77200977 Mon Sep 17 00:00:00 2001
-From: Lars-Peter Clausen <lars@metafoo.de>
-Date: Wed, 13 Oct 2010 01:17:24 +0200
-Subject: [PATCH 17/23] qi_lb60: Don't use 3-wire spi mode for the display for now
-
-The spi_gpio driver does not support 3-wire mode.
----
- arch/mips/jz4740/board-qi_lb60.c |    1 -
- 1 files changed, 0 insertions(+), 1 deletions(-)
-
---- a/arch/mips/jz4740/board-qi_lb60.c
-+++ b/arch/mips/jz4740/board-qi_lb60.c
-@@ -310,7 +310,6 @@ static struct spi_board_info qi_lb60_spi
-               .chip_select = 0,
-               .bus_num = 1,
-               .max_speed_hz = 30 * 1000,
--              .mode = SPI_3WIRE,
-       },
- };
diff --git a/target/linux/xburst/patches-2.6.37/050-i2c.patch b/target/linux/xburst/patches-2.6.37/050-i2c.patch
deleted file mode 100644 (file)
index 5cfa912..0000000
+++ /dev/null
@@ -1,472 +0,0 @@
-From 5af1734d9fc79c2d08853c703d1edfef2a4cae16 Mon Sep 17 00:00:00 2001
-From: Lars-Peter Clausen <lars@metafoo.de>
-Date: Sun, 5 Sep 2010 03:19:10 +0200
-Subject: [PATCH 10/23] i2c: Add i2c driver for JZ47XX SoCs
-
-This patch adds a driver for the i2c controller found in Ingenic JZ47XX based
-SoCs.
-
-Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
----
- drivers/i2c/busses/Kconfig      |   10 +
- drivers/i2c/busses/Makefile     |    1 +
- drivers/i2c/busses/i2c-jz47xx.c |  424 +++++++++++++++++++++++++++++++++++++++
- 3 files changed, 435 insertions(+), 0 deletions(-)
- create mode 100644 drivers/i2c/busses/i2c-jz47xx.c
-
---- a/drivers/i2c/busses/Kconfig
-+++ b/drivers/i2c/busses/Kconfig
-@@ -431,6 +431,16 @@ config I2C_IXP2000
-         This driver is deprecated and will be dropped soon. Use i2c-gpio
-         instead.
-+config I2C_JZ47XX
-+      tristate "JZ4740 I2C Interface"
-+      depends on ARCH_JZ4740
-+      help
-+        Say Y here if you want support for the I2C controller found on Ingenic
-+        JZ47XX based SoCs.
-+
-+        This driver can also be built as a module. If so, the module will be
-+        called i2c-jz47xx.
-+
- config I2C_MPC
-       tristate "MPC107/824x/85xx/512x/52xx/83xx/86xx"
-       depends on PPC32
---- a/drivers/i2c/busses/Makefile
-+++ b/drivers/i2c/busses/Makefile
-@@ -41,6 +41,7 @@ obj-$(CONFIG_I2C_IMX)                += i2c-imx.o
- obj-$(CONFIG_I2C_INTEL_MID)   += i2c-intel-mid.o
- obj-$(CONFIG_I2C_IOP3XX)      += i2c-iop3xx.o
- obj-$(CONFIG_I2C_IXP2000)     += i2c-ixp2000.o
-+obj-$(CONFIG_I2C_JZ47XX)      += i2c-jz47xx.o
- obj-$(CONFIG_I2C_MPC)         += i2c-mpc.o
- obj-$(CONFIG_I2C_MV64XXX)     += i2c-mv64xxx.o
- obj-$(CONFIG_I2C_NOMADIK)     += i2c-nomadik.o
---- /dev/null
-+++ b/drivers/i2c/busses/i2c-jz47xx.c
-@@ -0,0 +1,424 @@
-+
-+#include <linux/init.h>
-+#include <linux/kernel.h>
-+#include <linux/module.h>
-+#include <linux/err.h>
-+#include <linux/clk.h>
-+#include <linux/platform_device.h>
-+#include <linux/i2c.h>
-+#include <linux/slab.h>
-+#include <linux/interrupt.h>
-+
-+#include <linux/gpio.h>
-+#include <linux/delay.h>
-+
-+#define JZ47XX_REG_I2C_DATA   0x00
-+#define JZ47XX_REG_I2C_CTRL   0x04
-+#define JZ47XX_REG_I2C_STATUS 0x08
-+#define JZ47XX_REG_I2C_CLOCK  0x0C
-+
-+#define JZ47XX_I2C_STATUS_FIFO_FULL   BIT(4)
-+#define JZ47XX_I2C_STATUS_BUSY                BIT(3)
-+#define JZ47XX_I2C_STATUS_TEND                BIT(2)
-+#define JZ47XX_I2C_STATUS_DATA_VALID  BIT(1)
-+#define JZ47XX_I2C_STATUS_NACK                BIT(0)
-+
-+#define JZ47XX_I2C_CTRL_IRQ_ENABLE    BIT(4)
-+#define JZ47XX_I2C_CTRL_START         BIT(3)
-+#define JZ47XX_I2C_CTRL_STOP          BIT(2)
-+#define JZ47XX_I2C_CTRL_NACK          BIT(1)
-+#define JZ47XX_I2C_CTRL_ENABLE                BIT(0)
-+
-+struct jz47xx_i2c {
-+      struct resource *mem;
-+      void __iomem *base;
-+      int irq;
-+      struct clk *clk;
-+
-+      struct i2c_adapter adapter;
-+
-+      wait_queue_head_t wait_queue;
-+};
-+
-+static inline struct jz47xx_i2c *adapter_to_jz47xx_i2c(struct i2c_adapter *adap)
-+{
-+      return container_of(adap, struct jz47xx_i2c, adapter);
-+}
-+
-+static inline void jz47xx_i2c_set_ctrl(struct jz47xx_i2c *jz47xx_i2c,
-+      uint8_t mask, uint8_t value)
-+{
-+      uint8_t ctrl;
-+      ctrl = readb(jz47xx_i2c->base + JZ47XX_REG_I2C_CTRL);
-+      ctrl &= ~mask;
-+      ctrl |= value;
-+      printk("ctrl: %x\n", ctrl);
-+      writeb(ctrl, jz47xx_i2c->base + JZ47XX_REG_I2C_CTRL);
-+}
-+
-+static irqreturn_t jz47xx_i2c_irq_handler(int irq, void *devid)
-+{
-+      struct jz47xx_i2c *jz47xx_i2c = devid;
-+
-+      printk("IRQ\n");
-+
-+      wake_up(&jz47xx_i2c->wait_queue);
-+
-+      jz47xx_i2c_set_ctrl(jz47xx_i2c, JZ47XX_I2C_CTRL_IRQ_ENABLE, 0);
-+
-+      return IRQ_HANDLED;
-+}
-+
-+static inline void jz47xx_i2c_set_data_valid(struct jz47xx_i2c *jz47xx_i2c,
-+      bool valid)
-+{
-+      uint8_t val;
-+      val = readb(jz47xx_i2c->base + JZ47XX_REG_I2C_STATUS);
-+      if (valid)
-+              val |= JZ47XX_I2C_STATUS_DATA_VALID;
-+      else
-+              val &= ~JZ47XX_I2C_STATUS_DATA_VALID;
-+      writeb(val, jz47xx_i2c->base + JZ47XX_REG_I2C_STATUS);
-+}
-+
-+static int jz47xx_i2c_test_event(struct jz47xx_i2c *jz47xx_i2c, uint8_t mask, uint8_t value)
-+{
-+      uint8_t status;
-+
-+      mask |= JZ47XX_I2C_STATUS_NACK;
-+      value |= JZ47XX_I2C_STATUS_NACK;
-+
-+      status = readb(jz47xx_i2c->base + JZ47XX_REG_I2C_STATUS);
-+      printk("status: %x %x %x %x\n", status, mask, value, (status & mask) ^
-+      value);
-+      if (((status & mask) ^ value) == mask) {
-+              jz47xx_i2c_set_ctrl(jz47xx_i2c, JZ47XX_I2C_CTRL_IRQ_ENABLE,
-+                      JZ47XX_I2C_CTRL_IRQ_ENABLE);
-+              return 0;
-+      }
-+      return 1;
-+}
-+
-+static int jz47xx_i2c_wait_event_or_nack(struct jz47xx_i2c *jz47xx_i2c, uint8_t
-+mask, uint8_t value)
-+{
-+      int ret;
-+
-+      ret = wait_event_interruptible_timeout(jz47xx_i2c->wait_queue,
-+              jz47xx_i2c_test_event(jz47xx_i2c, mask, value), 30 * HZ);
-+
-+/*    while (!jz47xx_i2c_test_event(jz47xx_i2c, mask, value));
-+
-+      ret = 1;*/
-+
-+      printk("wait event or nack: %d %x\n", ret, readb(jz47xx_i2c->base +
-+      JZ47XX_REG_I2C_STATUS));
-+
-+      if (ret == 0)
-+              ret = -ETIMEDOUT;
-+      else if(ret > 0) {
-+              if (readb(jz47xx_i2c->base + JZ47XX_REG_I2C_STATUS) & JZ47XX_I2C_STATUS_NACK)
-+                      ret = -EIO;
-+              else
-+                      ret = 0;
-+      }
-+
-+      return ret;
-+}
-+
-+static int jz47xx_i2c_wait_event(struct jz47xx_i2c *jz47xx_i2c, uint8_t event)
-+{
-+      int ret;
-+
-+      ret = wait_event_interruptible_timeout(jz47xx_i2c->wait_queue,
-+              jz47xx_i2c_test_event(jz47xx_i2c, event, event), 30 * HZ);
-+
-+      if (ret == 0)
-+              ret = -ETIMEDOUT;
-+      else if(ret > 0)
-+              ret = 0;
-+
-+      return ret;
-+}
-+
-+
-+static int jz47xx_i2c_write_msg(struct jz47xx_i2c *jz47xx_i2c,
-+      struct i2c_msg *msg)
-+{
-+      int ret;
-+      int i;
-+
-+      printk("%s:%s[%d]\n", __FILE__, __func__, __LINE__);
-+      for (i = 0; i < msg->len; ++i) {
-+              writeb(msg->buf[i], jz47xx_i2c->base + JZ47XX_REG_I2C_DATA);
-+              jz47xx_i2c_set_data_valid(jz47xx_i2c, true);
-+              ret = jz47xx_i2c_wait_event_or_nack(jz47xx_i2c,
-+                      JZ47XX_I2C_STATUS_DATA_VALID, 0);
-+              if (ret)
-+                      break;
-+      }
-+      jz47xx_i2c_set_ctrl(jz47xx_i2c, JZ47XX_I2C_CTRL_STOP,
-+              JZ47XX_I2C_CTRL_STOP);
-+
-+      if (!ret)
-+              ret = jz47xx_i2c_wait_event_or_nack(jz47xx_i2c, JZ47XX_I2C_STATUS_TEND,
-+                      JZ47XX_I2C_STATUS_TEND);
-+
-+      return ret;
-+}
-+
-+static int jz47xx_i2c_read_msg(struct jz47xx_i2c *jz47xx_i2c,
-+      struct i2c_msg *msg)
-+{
-+      int i;
-+      int ret;
-+      printk("%s:%s[%d]\n", __FILE__, __func__, __LINE__);
-+
-+      jz47xx_i2c_set_ctrl(jz47xx_i2c, JZ47XX_I2C_CTRL_NACK,
-+              msg->len == 1 ? JZ47XX_I2C_CTRL_NACK : 0);
-+
-+      for (i = 0; i < msg->len; ++i) {
-+              ret = jz47xx_i2c_wait_event(jz47xx_i2c, JZ47XX_I2C_STATUS_DATA_VALID);
-+              if (ret) {
-+                      jz47xx_i2c_set_ctrl(jz47xx_i2c, JZ47XX_I2C_CTRL_NACK,
-+                              JZ47XX_I2C_CTRL_NACK);
-+                      break;
-+              }
-+
-+              if (i == msg->len - 2) {
-+                      jz47xx_i2c_set_ctrl(jz47xx_i2c, JZ47XX_I2C_CTRL_NACK,
-+                              JZ47XX_I2C_CTRL_NACK);
-+              }
-+
-+              msg->buf[i] = readb(jz47xx_i2c->base + JZ47XX_REG_I2C_DATA);
-+              printk("read: %x\n", msg->buf[i]);
-+              jz47xx_i2c_set_data_valid(jz47xx_i2c, false);
-+      }
-+
-+      jz47xx_i2c_set_ctrl(jz47xx_i2c, JZ47XX_I2C_CTRL_STOP,
-+              JZ47XX_I2C_CTRL_STOP);
-+
-+      return ret;
-+}
-+
-+static int jz47xx_i2c_xfer_msg(struct jz47xx_i2c *jz47xx_i2c,
-+      struct i2c_msg *msg)
-+{
-+      uint8_t addr;
-+      int ret;
-+
-+      addr = msg->addr << 1;
-+      if (msg->flags & I2C_M_RD)
-+              addr |= 1;
-+
-+      jz47xx_i2c_set_ctrl(jz47xx_i2c, JZ47XX_I2C_CTRL_START,
-+              JZ47XX_I2C_CTRL_START);
-+      writeb(addr, jz47xx_i2c->base + JZ47XX_REG_I2C_DATA);
-+      jz47xx_i2c_set_data_valid(jz47xx_i2c, true);
-+
-+      if (msg->flags & I2C_M_RD) {
-+              printk("%s:%s[%d]\n", __FILE__, __func__, __LINE__);
-+              ret = jz47xx_i2c_wait_event_or_nack(jz47xx_i2c,
-+              JZ47XX_I2C_STATUS_TEND, JZ47XX_I2C_STATUS_TEND);
-+              if (!ret)
-+                      ret = jz47xx_i2c_read_msg(jz47xx_i2c, msg);
-+      } else {
-+              printk("%s:%s[%d]\n", __FILE__, __func__, __LINE__);
-+              ret = jz47xx_i2c_wait_event_or_nack(jz47xx_i2c,
-+                  JZ47XX_I2C_STATUS_DATA_VALID, 0);
-+              if (!ret)
-+                      ret = jz47xx_i2c_write_msg(jz47xx_i2c, msg);
-+      }
-+
-+      return ret;
-+}
-+
-+static int jz47xx_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int
-+num)
-+{
-+      struct jz47xx_i2c *jz47xx_i2c = adapter_to_jz47xx_i2c(adap);
-+      int ret = 0;
-+      int i;
-+      int mask = JZ47XX_I2C_CTRL_ENABLE;
-+
-+      printk("xfer: %d %x\n", num, readb(jz47xx_i2c->base +
-+      JZ47XX_REG_I2C_STATUS));
-+
-+      clk_enable(jz47xx_i2c->clk);
-+      jz47xx_i2c_set_ctrl(jz47xx_i2c, mask, mask);
-+
-+      for (i = 0; i < num; ++i) {
-+              ret = jz47xx_i2c_xfer_msg(jz47xx_i2c, &msgs[i]);
-+              if (ret)
-+                      break;
-+      }
-+
-+      jz47xx_i2c_set_ctrl(jz47xx_i2c, mask, 0);
-+      clk_disable(jz47xx_i2c->clk);
-+
-+      printk("xfer ret: %d\n", ret);
-+
-+      return ret;
-+}
-+
-+static u32 jz47xx_i2c_functionality(struct i2c_adapter *adap)
-+{
-+      return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
-+}
-+
-+static const struct i2c_algorithm jz47xx_i2c_algorithm = {
-+      .master_xfer = jz47xx_i2c_xfer,
-+      .functionality = jz47xx_i2c_functionality,
-+};
-+
-+const static struct jz_gpio_bulk_request jz47xx_i2c_pins[] = {
-+      JZ_GPIO_BULK_PIN(I2C_SDA),
-+      JZ_GPIO_BULK_PIN(I2C_SCK),
-+};
-+
-+static int __devinit jz47xx_i2c_probe(struct platform_device *pdev)
-+{
-+      struct jz47xx_i2c *jz47xx_i2c;
-+      struct resource *mem;
-+      void __iomem *base;
-+      struct clk *clk;
-+      int irq;
-+      int ret;
-+
-+      irq = platform_get_irq(pdev, 0);
-+      if (!irq) {
-+              dev_err(&pdev->dev, "Failed to get IRQ: %d\n", irq);
-+              return irq;
-+      }
-+
-+      mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+      if (!mem) {
-+              dev_err(&pdev->dev, "Failed to get iomem region\n");
-+              return -ENXIO;
-+      }
-+
-+      mem = request_mem_region(mem->start, resource_size(mem), pdev->name);
-+      if (!mem) {
-+              dev_err(&pdev->dev, "Failed to request iomem region\n");
-+              return -EBUSY;
-+      }
-+
-+      base = ioremap(mem->start, resource_size(mem));
-+      if (!base) {
-+              dev_err(&pdev->dev, "Failed to ioremap iomem\n");
-+              ret = -EBUSY;
-+              goto err_release_mem_region;
-+      }
-+
-+      clk = clk_get(&pdev->dev, "i2c");
-+      if (IS_ERR(clk)) {
-+              ret = PTR_ERR(clk);
-+              goto err_iounmap;
-+      }
-+
-+      jz47xx_i2c = kzalloc(sizeof(*jz47xx_i2c), GFP_KERNEL);
-+      if (!jz47xx_i2c) {
-+              ret = -ENOMEM;
-+              goto err_clk_put;
-+      }
-+
-+      jz47xx_i2c->adapter.owner = THIS_MODULE;
-+      jz47xx_i2c->adapter.algo = &jz47xx_i2c_algorithm;
-+      jz47xx_i2c->adapter.dev.parent = &pdev->dev;
-+      jz47xx_i2c->adapter.nr = pdev->id < 0 ?: 0;
-+      strcpy(jz47xx_i2c->adapter.name, pdev->name);
-+
-+      jz47xx_i2c->mem = mem;
-+      jz47xx_i2c->base = base;
-+      jz47xx_i2c->clk = clk;
-+      jz47xx_i2c->irq = irq;
-+
-+      init_waitqueue_head(&jz47xx_i2c->wait_queue);
-+
-+      ret = request_irq(irq, jz47xx_i2c_irq_handler, 0, pdev->name, jz47xx_i2c);
-+      if (ret) {
-+              dev_err(&pdev->dev, "Failed to request irq: %d\n", ret);
-+              goto err_free;
-+      }
-+
-+    ret = jz_gpio_bulk_request(jz47xx_i2c_pins, ARRAY_SIZE(jz47xx_i2c_pins));
-+      if (ret) {
-+              dev_err(&pdev->dev, "Failed to request i2c pins: %d\n", ret);
-+              goto err_free_irq;
-+      }
-+
-+      writew(0x10, jz47xx_i2c->base + JZ47XX_REG_I2C_CLOCK);
-+
-+      ret = i2c_add_numbered_adapter(&jz47xx_i2c->adapter);
-+      if (ret) {
-+              dev_err(&pdev->dev, "Failed to add i2c adapter: %d\n", ret);
-+              goto err_free_gpios;
-+      }
-+
-+      platform_set_drvdata(pdev, jz47xx_i2c);
-+
-+      printk("JZ4740 I2C\n");
-+
-+      return 0;
-+
-+err_free_gpios:
-+      jz_gpio_bulk_free(jz47xx_i2c_pins, ARRAY_SIZE(jz47xx_i2c_pins));
-+err_free_irq:
-+      free_irq(irq, jz47xx_i2c);
-+err_free:
-+      kfree(jz47xx_i2c);
-+err_clk_put:
-+      clk_put(clk);
-+err_iounmap:
-+      iounmap(base);
-+err_release_mem_region:
-+      release_mem_region(mem->start, resource_size(mem));
-+      return ret;
-+}
-+
-+static int __devexit jz47xx_i2c_remove(struct platform_device *pdev)
-+{
-+      struct jz47xx_i2c *jz47xx_i2c = platform_get_drvdata(pdev);
-+
-+      platform_set_drvdata(pdev, NULL);
-+      i2c_del_adapter(&jz47xx_i2c->adapter);
-+
-+      jz_gpio_bulk_free(jz47xx_i2c_pins, ARRAY_SIZE(jz47xx_i2c_pins));
-+
-+      free_irq(jz47xx_i2c->irq, jz47xx_i2c);
-+      clk_put(jz47xx_i2c->clk);
-+
-+      iounmap(jz47xx_i2c->base);
-+      release_mem_region(jz47xx_i2c->mem->start, resource_size(jz47xx_i2c->mem));
-+
-+      kfree(jz47xx_i2c);
-+
-+      return 0;
-+}
-+
-+static struct platform_driver jz47xx_i2c_driver = {
-+      .probe = jz47xx_i2c_probe,
-+      .remove = jz47xx_i2c_remove,
-+      .driver = {
-+              .name = "jz47xx-i2c",
-+              .owner = THIS_MODULE,
-+      },
-+};
-+
-+static int __init jz47xx_i2c_init(void)
-+{
-+      return platform_driver_register(&jz47xx_i2c_driver);
-+}
-+module_init(jz47xx_i2c_init);
-+
-+static void jz47xx_i2c_exit(void)
-+{
-+      platform_driver_unregister(&jz47xx_i2c_driver);
-+}
-+module_exit(jz47xx_i2c_exit);
-+
-+MODULE_LICENSE("GPL");
-+MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
-+MODULE_DESCRIPTION("I2C adapter driver for JZ47XX SoCs");
-+MODULE_ALIAS("platform:jz47xx-i2c");
-+
diff --git a/target/linux/xburst/patches-2.6.37/051-fix-i2c-driver-name.patch b/target/linux/xburst/patches-2.6.37/051-fix-i2c-driver-name.patch
deleted file mode 100644 (file)
index 7e4b961..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-From 1a340ab0d36718e3cd522134c7c5746040c3c93e Mon Sep 17 00:00:00 2001
-From: Lars-Peter Clausen <lars@metafoo.de>
-Date: Sun, 5 Sep 2010 03:21:51 +0200
-Subject: [PATCH 11/23] MIPS: JZ4740: Fix i2c driver name.
-
-The i2c driver is generic to all JZ47XX based SoCs not only the JZ4740. Reflect
-this in the driver name.
-
-Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
----
- arch/mips/jz4740/platform.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
---- a/arch/mips/jz4740/platform.c
-+++ b/arch/mips/jz4740/platform.c
-@@ -142,7 +142,7 @@ static struct resource jz4740_i2c_resour
- };
- struct platform_device jz4740_i2c_device = {
--      .name           = "jz4740-i2c",
-+      .name           = "jz47xx-i2c",
-       .id             = 0,
-       .num_resources  = ARRAY_SIZE(jz4740_i2c_resources),
-       .resource       = jz4740_i2c_resources,
diff --git a/target/linux/xburst/patches-2.6.37/060-adc-touchscreen.patch b/target/linux/xburst/patches-2.6.37/060-adc-touchscreen.patch
deleted file mode 100644 (file)
index 85697aa..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-From 424b737e5a1858dafc8138fd59d154f0493b21d0 Mon Sep 17 00:00:00 2001
-From: Lars-Peter Clausen <lars@metafoo.de>
-Date: Sun, 5 Sep 2010 20:36:59 +0200
-Subject: [PATCH 13/23] MFD: jz4740-adc: Add support for the touchscreen part of the adc unit
-
----
- drivers/mfd/jz4740-adc.c   |   39 ++++++++++++++++++++++++++++++++++++---
- include/linux/jz4740-adc.h |    2 +-
- 2 files changed, 37 insertions(+), 4 deletions(-)
-
---- a/drivers/mfd/jz4740-adc.c
-+++ b/drivers/mfd/jz4740-adc.c
-@@ -46,9 +46,9 @@
- enum {
-       JZ_ADC_IRQ_ADCIN = 0,
-       JZ_ADC_IRQ_BATTERY,
--      JZ_ADC_IRQ_TOUCH,
--      JZ_ADC_IRQ_PENUP,
--      JZ_ADC_IRQ_PENDOWN,
-+      JZ_ADC_IRQ_TS_DATA_READY,
-+      JZ_ADC_IRQ_TS_PENUP,
-+      JZ_ADC_IRQ_TS_PENDOWN,
- };
- struct jz4740_adc {
-@@ -101,6 +101,7 @@ static void jz4740_adc_irq_ack(unsigned
-       struct jz4740_adc *adc = get_irq_chip_data(irq);
-       irq -= adc->irq_base;
-+
-       writeb(BIT(irq), adc->base + JZ_REG_ADC_STATUS);
- }
-@@ -227,6 +228,27 @@ static struct resource jz4740_battery_re
-       },
- };
-+static struct resource jz4740_ts_resources[] = {
-+      {
-+              .start = JZ_ADC_IRQ_TS_DATA_READY,
-+              .flags = IORESOURCE_IRQ,
-+      },
-+      {
-+              .start = JZ_ADC_IRQ_TS_PENUP,
-+              .flags = IORESOURCE_IRQ,
-+      },
-+      {
-+              .start = JZ_ADC_IRQ_TS_PENDOWN,
-+              .flags = IORESOURCE_IRQ,
-+      },
-+      {
-+              .start  = JZ_REG_ADC_TOUCHSCREEN_BASE,
-+              .end    = JZ_REG_ADC_TOUCHSCREEN_BASE + 0xb,
-+              .flags  = IORESOURCE_MEM,
-+      },
-+};
-+
-+
- const struct mfd_cell jz4740_adc_cells[] = {
-       {
-               .id = 0,
-@@ -248,6 +270,17 @@ const struct mfd_cell jz4740_adc_cells[]
-               .data_size = sizeof(struct mfd_cell),
-               .enable = jz4740_adc_cell_enable,
-+              .disable = jz4740_adc_cell_disable,
-+      },
-+      {
-+              .id = 2,
-+              .name = "jz4740-ts",
-+              .num_resources = ARRAY_SIZE(jz4740_ts_resources),
-+              .resources = jz4740_ts_resources,
-+              .platform_data = (void *)&jz4740_adc_cells[2],
-+              .data_size = sizeof(struct mfd_cell),
-+
-+              .enable = jz4740_adc_cell_enable,
-               .disable = jz4740_adc_cell_disable,
-       },
- };
---- a/include/linux/jz4740-adc.h
-+++ b/include/linux/jz4740-adc.h
-@@ -25,7 +25,7 @@ int jz4740_adc_set_config(struct device
- #define JZ_ADC_CONFIG_BAT_MB          BIT(4)
- #define JZ_ADC_CONFIG_DNUM(dnum)      ((dnum) << 16)
--#define JZ_ADC_CONFIG_XYZ_OFFSET(dnum)        ((xyz) << 13)
-+#define JZ_ADC_CONFIG_XYZ_OFFSET(xyz) ((xyz) << 13)
- #define JZ_ADC_CONFIG_SAMPLE_NUM(x)   ((x) << 10)
- #define JZ_ADC_CONFIG_CLKDIV(div)     ((div) << 5)
diff --git a/target/linux/xburst/patches-2.6.37/061-touchscreen.patch b/target/linux/xburst/patches-2.6.37/061-touchscreen.patch
deleted file mode 100644 (file)
index 9145f8f..0000000
+++ /dev/null
@@ -1,379 +0,0 @@
-From d231cea1dca0c1b04d11cbf996077cf59612e3c4 Mon Sep 17 00:00:00 2001
-From: Lars-Peter Clausen <lars@metafoo.de>
-Date: Sun, 5 Sep 2010 20:45:08 +0200
-Subject: [PATCH 14/23] input: Add touchscreen driver for the JZ4740 SoC
-
-This patch adds a touchscreen driver for the Ingenic JZ4740 SoC.
-The touchscreen controller is part of the ADC unit and thus this driver is a mfd
-cell from the jz4740-adc driver.
-
-Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
----
- drivers/input/touchscreen/Kconfig     |   12 ++
- drivers/input/touchscreen/Makefile    |    1 +
- drivers/input/touchscreen/jz4740-ts.c |  330 +++++++++++++++++++++++++++++++++
- 3 files changed, 343 insertions(+), 0 deletions(-)
- create mode 100644 drivers/input/touchscreen/jz4740-ts.c
-
---- a/drivers/input/touchscreen/Kconfig
-+++ b/drivers/input/touchscreen/Kconfig
-@@ -681,4 +681,16 @@ config TOUCHSCREEN_STMPE
-         To compile this driver as a module, choose M here: the
-         module will be called stmpe-ts.
-+config TOUCHSCREEN_JZ4740
-+      tristate "JZ4740 touchscreen support"
-+      depends on MFD_JZ4740_ADC
-+      help
-+        Say Y here if you want support for the touchscreen controller found on
-+        Ingenic JZ4740 SoCs.
-+
-+        If unsure, say N.
-+
-+        To compile this driver as a module, choose M here: the
-+        module will be called jz4740-ts.
-+
- endif
---- a/drivers/input/touchscreen/Makefile
-+++ b/drivers/input/touchscreen/Makefile
-@@ -26,6 +26,7 @@ obj-$(CONFIG_TOUCHSCREEN_FUJITSU)    += fuj
- obj-$(CONFIG_TOUCHSCREEN_INEXIO)      += inexio.o
- obj-$(CONFIG_TOUCHSCREEN_INTEL_MID)   += intel-mid-touch.o
- obj-$(CONFIG_TOUCHSCREEN_LPC32XX)     += lpc32xx_ts.o
-+obj-$(CONFIG_TOUCHSCREEN_JZ4740)      += jz4740-ts.o
- obj-$(CONFIG_TOUCHSCREEN_MC13783)     += mc13783_ts.o
- obj-$(CONFIG_TOUCHSCREEN_MCS5000)     += mcs5000_ts.o
- obj-$(CONFIG_TOUCHSCREEN_MIGOR)               += migor_ts.o
---- /dev/null
-+++ b/drivers/input/touchscreen/jz4740-ts.c
-@@ -0,0 +1,330 @@
-+/*
-+ * Touchscreen driver for Ingenic JZ SoCs.
-+ *
-+ * Copyright (C) 2010, Lars-Peter Clausen <lars@metafoo.de>
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 as
-+ * published by the Free Software Foundation.
-+ *
-+ */
-+
-+#include <linux/interrupt.h>
-+#include <linux/kernel.h>
-+#include <linux/module.h>
-+#include <linux/platform_device.h>
-+#include <linux/slab.h>
-+
-+#include <linux/delay.h>
-+#include <linux/mfd/core.h>
-+#include <linux/input.h>
-+#include <linux/bitops.h>
-+#include <linux/jz4740-adc.h>
-+
-+struct jz4740_ts {
-+      struct platform_device *pdev;
-+
-+      struct resource *mem;
-+      void __iomem *base;
-+
-+      int irq_penup;
-+      int irq_pendown;
-+      int irq_data_ready;
-+
-+      struct mfd_cell *cell;
-+      struct input_dev *input;
-+
-+      bool is_open;
-+};
-+
-+static irqreturn_t jz4740_ts_data_ready_irq_handler(int irq, void *devid)
-+{
-+      struct jz4740_ts *jz4740_ts = devid;
-+      uint32_t data;
-+      unsigned long x, y, z1, z2, pressure;
-+
-+      data = readl(jz4740_ts->base + 0x08);
-+      x = data & 0xfff;
-+      y = (data >> 16) & 0xfff;
-+
-+      data = readl(jz4740_ts->base + 0x08);
-+      z1 = data & 0xfff;
-+      z2 = (data >> 16) & 0xfff;
-+      if (z1 == 0) {
-+              pressure = 4095UL;
-+      } else if (z1 > z2) {
-+              pressure = 0;
-+      } else {
-+              if (data & 0x8000)
-+                      pressure = (((480UL * x * z2) / z1) - 480UL * x) / 4096UL;
-+              else
-+                      pressure = (((272UL * y * z2) / z1) - 272UL * y) / 4096UL;
-+              if (pressure >= 4096UL)
-+                      pressure = 4095UL;
-+              pressure = 4095UL - pressure;
-+      }
-+
-+      input_report_abs(jz4740_ts->input, ABS_X, y);
-+      input_report_abs(jz4740_ts->input, ABS_Y, 4095 - x);
-+      input_report_abs(jz4740_ts->input, ABS_PRESSURE, pressure);
-+      input_report_key(jz4740_ts->input, BTN_TOUCH, 1);
-+      input_sync(jz4740_ts->input);
-+
-+      return IRQ_HANDLED;
-+}
-+
-+static irqreturn_t jz4740_ts_pen_irq_handler(int irq, void *devid)
-+{
-+      struct jz4740_ts *jz4740_ts = devid;
-+      int is_pressed;
-+
-+      if (irq == jz4740_ts->irq_penup) {
-+              enable_irq(jz4740_ts->irq_pendown);
-+              is_pressed = 0;
-+      } else {
-+              enable_irq(jz4740_ts->irq_penup);
-+              is_pressed = 1;
-+      }
-+      disable_irq_nosync(irq);
-+
-+      printk("pen irq: %d\n", irq);
-+      input_report_key(jz4740_ts->input, BTN_TOUCH, is_pressed);
-+      if (is_pressed == 0)
-+              input_report_abs(jz4740_ts->input, ABS_PRESSURE, 0);
-+      input_sync(jz4740_ts->input);
-+
-+      return IRQ_HANDLED;
-+}
-+
-+static int jz4740_ts_open(struct input_dev *input)
-+{
-+      struct jz4740_ts *jz4740_ts = input_get_drvdata(input);
-+
-+      jz4740_ts->is_open = true;
-+      jz4740_ts->cell->enable(jz4740_ts->pdev);
-+
-+      return 0;
-+}
-+
-+static void jz4740_ts_close(struct input_dev *input)
-+{
-+      struct jz4740_ts *jz4740_ts = input_get_drvdata(input);
-+
-+      jz4740_ts->cell->disable(jz4740_ts->pdev);
-+      jz4740_ts->is_open = false;
-+}
-+
-+static int __devinit jz4740_ts_probe(struct platform_device *pdev)
-+{
-+      int ret = 0;
-+      struct jz4740_ts *jz4740_ts;
-+      struct input_dev *input;
-+
-+      jz4740_ts = kzalloc(sizeof(*jz4740_ts), GFP_KERNEL);
-+      if (!jz4740_ts) {
-+              dev_err(&pdev->dev, "Failed to allocate driver structure\n");
-+              return -ENOMEM;
-+      }
-+
-+      jz4740_ts->pdev = pdev;
-+      jz4740_ts->cell = pdev->dev.platform_data;
-+
-+      jz4740_ts->irq_data_ready = platform_get_irq(pdev, 0);
-+      if (jz4740_ts->irq_data_ready < 0) {
-+              ret = jz4740_ts->irq_data_ready;
-+              dev_err(&pdev->dev, "Failed to get platform irq: %d\n", ret);
-+              goto err_free;
-+      }
-+
-+      jz4740_ts->irq_penup = platform_get_irq(pdev, 1);
-+      if (jz4740_ts->irq_penup < 0) {
-+              ret = jz4740_ts->irq_penup;
-+              dev_err(&pdev->dev, "Failed to get platform irq: %d\n", ret);
-+              goto err_free;
-+      }
-+
-+      jz4740_ts->irq_pendown = platform_get_irq(pdev, 2);
-+      if (jz4740_ts->irq_pendown < 0) {
-+              ret = jz4740_ts->irq_pendown;
-+              dev_err(&pdev->dev, "Failed to get platform irq: %d\n", ret);
-+              goto err_free;
-+      }
-+
-+      jz4740_ts->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+      if (!jz4740_ts->mem) {
-+              ret = -ENOENT;
-+              dev_err(&pdev->dev, "Failed to get platform mmio resource\n");
-+              goto err_free;
-+      }
-+
-+      jz4740_ts->mem = request_mem_region(jz4740_ts->mem->start,
-+                              resource_size(jz4740_ts->mem),  pdev->name);
-+      if (!jz4740_ts->mem) {
-+              ret = -EBUSY;
-+              dev_err(&pdev->dev, "Failed to request mmio memory region\n");
-+              goto err_free;
-+      }
-+
-+      jz4740_ts->base = ioremap_nocache(jz4740_ts->mem->start,
-+                              resource_size(jz4740_ts->mem));
-+      if (!jz4740_ts->base) {
-+              ret = -EBUSY;
-+              dev_err(&pdev->dev, "Failed to ioremap mmio memory\n");
-+              goto err_release_mem_region;
-+      }
-+
-+      input = input_allocate_device();
-+      if (!input) {
-+              dev_err(&pdev->dev, "Failed to allocate input device\n");
-+              ret = -ENOMEM;
-+              goto err_iounmap;
-+      }
-+
-+      input->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
-+      __set_bit(BTN_TOUCH, input->keybit);
-+
-+      input_set_abs_params(input, ABS_X, 150, 3920, 0, 0);
-+      input_set_abs_params(input, ABS_Y, 270, 3700, 0, 0);
-+      input_set_abs_params(input, ABS_PRESSURE, 0, 4096, 0, 0);
-+
-+      input->name = pdev->name;
-+      input->phys = "jz4740";
-+      input->id.bustype = BUS_HOST;
-+      input->dev.parent = &pdev->dev;
-+
-+      input->open = jz4740_ts_open;
-+      input->close = jz4740_ts_close;
-+
-+      input_set_drvdata(input, jz4740_ts);
-+
-+      ret = input_register_device(input);
-+      if (ret) {
-+              dev_err(&pdev->dev, "Failed to register input device: %d\n", ret);
-+              input_free_device(input);
-+              goto err_iounmap;
-+      }
-+      jz4740_ts->input = input;
-+
-+      ret = request_irq(jz4740_ts->irq_data_ready, jz4740_ts_data_ready_irq_handler, 0, pdev->name,
-+                      jz4740_ts);
-+      if (ret) {
-+              dev_err(&pdev->dev, "Failed to request irq %d\n", ret);
-+              goto err_input_unregister_device;
-+      }
-+      ret = request_irq(jz4740_ts->irq_penup, jz4740_ts_pen_irq_handler, 0, pdev->name,
-+                      jz4740_ts);
-+      if (ret) {
-+              dev_err(&pdev->dev, "Failed to request irq %d\n", ret);
-+              goto err_free_irq_data_ready;
-+      }
-+      disable_irq(jz4740_ts->irq_penup);
-+      ret = request_irq(jz4740_ts->irq_pendown, jz4740_ts_pen_irq_handler, 0, pdev->name,
-+                      jz4740_ts);
-+      if (ret) {
-+              dev_err(&pdev->dev, "Failed to request irq %d\n", ret);
-+              goto err_free_irq_penup;
-+      }
-+      platform_set_drvdata(pdev, jz4740_ts);
-+
-+      jz4740_adc_set_config(pdev->dev.parent,
-+              JZ_ADC_CONFIG_EX_IN | JZ_ADC_CONFIG_XYZ_OFFSET(2) | JZ_ADC_CONFIG_DNUM(7),
-+              JZ_ADC_CONFIG_EX_IN | JZ_ADC_CONFIG_XYZ_MASK | JZ_ADC_CONFIG_DNUM_MASK);
-+
-+
-+      writel(0x15e, jz4740_ts->base);
-+      writel(0x32, jz4740_ts->base + 0x04);
-+
-+      return 0;
-+
-+err_free_irq_penup:
-+      free_irq(jz4740_ts->irq_penup, jz4740_ts);
-+err_free_irq_data_ready:
-+      free_irq(jz4740_ts->irq_data_ready, jz4740_ts);
-+err_input_unregister_device:
-+      input_unregister_device(jz4740_ts->input);
-+err_iounmap:
-+      platform_set_drvdata(pdev, NULL);
-+      iounmap(jz4740_ts->base);
-+err_release_mem_region:
-+      release_mem_region(jz4740_ts->mem->start, resource_size(jz4740_ts->mem));
-+err_free:
-+      kfree(jz4740_ts);
-+      return ret;
-+}
-+
-+static int __devexit jz4740_ts_remove(struct platform_device *pdev)
-+{
-+      struct jz4740_ts *jz4740_ts = platform_get_drvdata(pdev);
-+
-+
-+      free_irq(jz4740_ts->irq_pendown, jz4740_ts);
-+      free_irq(jz4740_ts->irq_penup, jz4740_ts);
-+      free_irq(jz4740_ts->irq_data_ready, jz4740_ts);
-+
-+      input_unregister_device(jz4740_ts->input);
-+
-+      iounmap(jz4740_ts->base);
-+      release_mem_region(jz4740_ts->mem->start, resource_size(jz4740_ts->mem));
-+
-+      kfree(jz4740_ts);
-+
-+      return 0;
-+}
-+
-+#ifdef CONFIG_PM
-+static int jz4740_ts_suspend(struct device *dev)
-+{
-+      struct jz4740_ts *jz4740_ts = dev_get_drvdata(dev);
-+
-+      if (jz4740_ts->is_open);
-+              jz4740_ts->cell->disable(jz4740_ts->pdev);
-+
-+      return 0;
-+}
-+
-+static int jz4740_ts_resume(struct device *dev)
-+{
-+      struct jz4740_ts *jz4740_ts = dev_get_drvdata(dev);
-+
-+      if (jz4740_ts->is_open);
-+              jz4740_ts->cell->enable(jz4740_ts->pdev);
-+
-+      return 0;
-+}
-+
-+static const struct dev_pm_ops jz4740_ts_pm_ops = {
-+      .suspend        = jz4740_ts_suspend,
-+      .resume         = jz4740_ts_resume,
-+};
-+
-+#define JZ4740_TS_PM_OPS (&jz4740_ts_pm_ops)
-+#else
-+#define JZ4740_TS_PM_OPS NULL
-+#endif
-+
-+static struct platform_driver jz4740_ts_driver = {
-+      .probe          = jz4740_ts_probe,
-+      .remove         = __devexit_p(jz4740_ts_remove),
-+      .driver = {
-+              .name = "jz4740-ts",
-+              .owner = THIS_MODULE,
-+              .pm = JZ4740_TS_PM_OPS,
-+      },
-+};
-+
-+static int __init jz4740_ts_init(void)
-+{
-+      return platform_driver_register(&jz4740_ts_driver);
-+}
-+module_init(jz4740_ts_init);
-+
-+static void __exit jz4740_ts_exit(void)
-+{
-+      platform_driver_unregister(&jz4740_ts_driver);
-+}
-+module_exit(jz4740_ts_exit);
-+
-+MODULE_ALIAS("platform:jz4740-ts");
-+MODULE_LICENSE("GPL");
-+MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
-+MODULE_DESCRIPTION("JZ4740 SoC battery driver");
diff --git a/target/linux/xburst/patches-2.6.37/100-lcm.patch b/target/linux/xburst/patches-2.6.37/100-lcm.patch
deleted file mode 100644 (file)
index 3b3baa7..0000000
+++ /dev/null
@@ -1,304 +0,0 @@
-From 85061058491114869860964b73e2ae0aacce446e Mon Sep 17 00:00:00 2001
-From: Lars-Peter Clausen <lars@metafoo.de>
-Date: Sun, 1 Aug 2010 21:19:40 +0200
-Subject: [PATCH 03/23] Add ili8960 lcd driver
-
----
- drivers/video/backlight/Kconfig   |    7 +
- drivers/video/backlight/Makefile  |    1 +
- drivers/video/backlight/ili8960.c |  263 +++++++++++++++++++++++++++++++++++++
- 3 files changed, 271 insertions(+), 0 deletions(-)
- create mode 100644 drivers/video/backlight/ili8960.c
-
---- a/drivers/video/backlight/Kconfig
-+++ b/drivers/video/backlight/Kconfig
-@@ -59,6 +59,13 @@ config LCD_LTV350QV
-         The LTV350QV panel is present on all ATSTK1000 boards.
-+config LCD_ILI8960
-+      tristate "Ilitek ili8960 LCD driver"
-+      depends on LCD_CLASS_DEVICE && SPI
-+      default n
-+      help
-+        Driver for the Ilitek ili8960 LCD controller chip.
-+
- config LCD_ILI9320
-       tristate
-       help
---- a/drivers/video/backlight/Makefile
-+++ b/drivers/video/backlight/Makefile
-@@ -6,6 +6,7 @@ obj-$(CONFIG_LCD_HP700)                   += jornada72
- obj-$(CONFIG_LCD_L4F00242T03)    += l4f00242t03.o
- obj-$(CONFIG_LCD_LMS283GF05)     += lms283gf05.o
- obj-$(CONFIG_LCD_LTV350QV)       += ltv350qv.o
-+obj-$(CONFIG_LCD_ILI8960)        += ili8960.o
- obj-$(CONFIG_LCD_ILI9320)        += ili9320.o
- obj-$(CONFIG_LCD_PLATFORM)       += platform_lcd.o
- obj-$(CONFIG_LCD_VGG2432A4)      += vgg2432a4.o
---- /dev/null
-+++ b/drivers/video/backlight/ili8960.c
-@@ -0,0 +1,263 @@
-+/*
-+ *  Copyright (C) 2009-2010, Lars-Peter Clausen <lars@metafoo.de>
-+ *  Driver for Ilitek ili8960 LCD
-+ *
-+ *  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.
-+ *
-+ *  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/spi/spi.h>
-+#include <linux/lcd.h>
-+#include <linux/backlight.h>
-+#include <linux/delay.h>
-+
-+struct ili8960 {
-+      struct spi_device *spi;
-+      struct lcd_device *lcd;
-+      struct backlight_device *bl;
-+      bool enabled;
-+      unsigned int brightness;
-+};
-+
-+#define ILI8960_REG_BRIGHTNESS        0x03
-+#define ILI8960_REG_POWER     0x05
-+#define ILI8960_REG_CONTRAST  0x0d
-+
-+static int ili8960_write_reg(struct spi_device *spi, uint8_t reg,
-+                              uint8_t data)
-+{
-+      uint8_t buf[2];
-+      buf[0] = ((reg & 0x40) << 1) | (reg & 0x3f);
-+      buf[1] = data;
-+
-+      return spi_write(spi, buf, sizeof(buf));
-+}
-+
-+static int ili8960_programm_power(struct spi_device *spi, bool enabled)
-+{
-+      int ret;
-+
-+      if (enabled)
-+              mdelay(20);
-+
-+      ret = ili8960_write_reg(spi, ILI8960_REG_POWER, enabled ? 0xc7 : 0xc6);
-+
-+      if (!enabled)
-+              mdelay(20);
-+
-+      return ret;
-+}
-+
-+static int ili8960_set_power(struct lcd_device *lcd, int power)
-+{
-+      struct ili8960 *ili8960 = lcd_get_data(lcd);
-+
-+      switch (power) {
-+      case FB_BLANK_UNBLANK:
-+              ili8960->enabled = true;
-+              break;
-+      default:
-+              ili8960->enabled = false;
-+              break;
-+      }
-+
-+      return ili8960_programm_power(ili8960->spi, ili8960->enabled);
-+}
-+
-+static int ili8960_get_power(struct lcd_device *lcd)
-+{
-+      struct ili8960 *ili8960 = lcd_get_data(lcd);
-+      return ili8960->enabled ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN;
-+}
-+
-+static int ili8960_set_contrast(struct lcd_device *lcd, int contrast)
-+{
-+      struct ili8960 *ili8960 = lcd_get_data(lcd);
-+
-+      return ili8960_write_reg(ili8960->spi, ILI8960_REG_CONTRAST, contrast);
-+}
-+
-+static int ili8960_set_mode(struct lcd_device *lcd, struct fb_videomode *mode)
-+{
-+      if (mode->xres != 320 && mode->yres != 240)
-+              return -EINVAL;
-+
-+      return 0;
-+}
-+
-+static int ili8960_set_brightness(struct ili8960 *ili8960, int brightness)
-+{
-+      int ret;
-+
-+      ret = ili8960_write_reg(ili8960->spi, ILI8960_REG_BRIGHTNESS, brightness);
-+
-+      if (ret == 0)
-+              ili8960->brightness = brightness;
-+
-+      return ret;
-+}
-+
-+static ssize_t ili8960_show_brightness(struct device *dev,
-+              struct device_attribute *attr, char *buf)
-+{
-+      struct lcd_device *ld = to_lcd_device(dev);
-+      struct ili8960 *ili8960 = lcd_get_data(ld);
-+
-+      return sprintf(buf, "%u\n", ili8960->brightness);
-+}
-+
-+static ssize_t ili8960_store_brightness(struct device *dev,
-+              struct device_attribute *attr, const char *buf, size_t count)
-+{
-+      struct lcd_device *ld = to_lcd_device(dev);
-+      struct ili8960 *ili8960 = lcd_get_data(ld);
-+      unsigned long brightness;
-+      int ret;
-+
-+      ret = strict_strtoul(buf, 0, &brightness);
-+      if (ret)
-+              return ret;
-+
-+      if (brightness > 255)
-+              return -EINVAL;
-+
-+      ili8960_set_brightness(ili8960, brightness);
-+
-+      return count;
-+}
-+
-+
-+static DEVICE_ATTR(brightness, 0644, ili8960_show_brightness,
-+      ili8960_store_brightness);
-+
-+static struct lcd_ops ili8960_lcd_ops = {
-+      .set_power = ili8960_set_power,
-+      .get_power = ili8960_get_power,
-+      .set_contrast = ili8960_set_contrast,
-+      .set_mode = ili8960_set_mode,
-+};
-+
-+static int __devinit ili8960_probe(struct spi_device *spi)
-+{
-+      int ret;
-+      struct ili8960 *ili8960;
-+
-+      ili8960 = kmalloc(sizeof(*ili8960), GFP_KERNEL);
-+      if (!ili8960)
-+              return -ENOMEM;
-+
-+      spi->bits_per_word = 8;
-+      spi->mode = SPI_MODE_3;
-+
-+      ret = spi_setup(spi);
-+      if (ret) {
-+              dev_err(&spi->dev, "Failed to setup spi\n");
-+              goto err_free_ili8960;
-+      }
-+
-+      ili8960->spi = spi;
-+
-+      ili8960->lcd = lcd_device_register("ili8960-lcd", &spi->dev, ili8960,
-+                                              &ili8960_lcd_ops);
-+
-+      if (IS_ERR(ili8960->lcd)) {
-+              ret = PTR_ERR(ili8960->lcd);
-+              dev_err(&spi->dev, "Failed to register lcd device: %d\n", ret);
-+              goto err_free_ili8960;
-+      }
-+
-+      ili8960->lcd->props.max_contrast = 255;
-+
-+      ret = device_create_file(&ili8960->lcd->dev, &dev_attr_brightness);
-+      if (ret)
-+              goto err_unregister_lcd;
-+
-+      ili8960_programm_power(ili8960->spi, true);
-+      ili8960->enabled = true;
-+
-+      spi_set_drvdata(spi, ili8960);
-+
-+      ili8960_write_reg(spi, 0x13, 0x01);
-+
-+      return 0;
-+err_unregister_lcd:
-+      lcd_device_unregister(ili8960->lcd);
-+err_free_ili8960:
-+      kfree(ili8960);
-+      return ret;
-+}
-+
-+static int __devexit ili8960_remove(struct spi_device *spi)
-+{
-+      struct ili8960 *ili8960 = spi_get_drvdata(spi);
-+
-+      device_remove_file(&ili8960->lcd->dev, &dev_attr_brightness);
-+      lcd_device_unregister(ili8960->lcd);
-+
-+      spi_set_drvdata(spi, NULL);
-+      kfree(ili8960);
-+      return 0;
-+}
-+
-+#ifdef CONFIG_PM
-+
-+static int ili8960_suspend(struct spi_device *spi, pm_message_t state)
-+{
-+      struct ili8960 *ili8960 = spi_get_drvdata(spi);
-+
-+      if (ili8960->enabled)
-+              ili8960_programm_power(ili8960->spi, false);
-+
-+      return 0;
-+}
-+
-+static int ili8960_resume(struct spi_device *spi)
-+{
-+      struct ili8960 *ili8960 = spi_get_drvdata(spi);
-+
-+      if (ili8960->enabled)
-+              ili8960_programm_power(ili8960->spi, true);
-+
-+      return 0;
-+}
-+
-+#else
-+#define ili8960_suspend NULL
-+#define ili8960_resume NULL
-+#endif
-+
-+static struct spi_driver ili8960_driver = {
-+      .driver = {
-+              .name = "ili8960",
-+              .owner = THIS_MODULE,
-+      },
-+      .probe = ili8960_probe,
-+      .remove = __devexit_p(ili8960_remove),
-+      .suspend = ili8960_suspend,
-+      .resume = ili8960_resume,
-+};
-+
-+static int __init ili8960_init(void)
-+{
-+      return spi_register_driver(&ili8960_driver);
-+}
-+module_init(ili8960_init);
-+
-+static void __exit ili8960_exit(void)
-+{
-+      spi_unregister_driver(&ili8960_driver);
-+}
-+module_exit(ili8960_exit)
-+
-+MODULE_AUTHOR("Lars-Peter Clausen");
-+MODULE_LICENSE("GPL");
-+MODULE_DESCRIPTION("LCD driver for Ilitek ili8960");
-+MODULE_ALIAS("spi:ili8960");
diff --git a/target/linux/xburst/patches-2.6.37/102-gpio-charger.patch b/target/linux/xburst/patches-2.6.37/102-gpio-charger.patch
deleted file mode 100644 (file)
index 6803a65..0000000
+++ /dev/null
@@ -1,254 +0,0 @@
-From 27681cf969174af00e63d572f257e2155bb914be Mon Sep 17 00:00:00 2001
-From: Lars-Peter Clausen <lars@metafoo.de>
-Date: Sat, 24 Apr 2010 12:29:31 +0200
-Subject: [PATCH 04/23] Add gpio chager driver
-
----
- drivers/power/Kconfig              |    7 ++
- drivers/power/Makefile             |    1 +
- drivers/power/gpio-charger.c       |  185 ++++++++++++++++++++++++++++++++++++
- include/linux/power/gpio-charger.h |   28 ++++++
- 4 files changed, 221 insertions(+), 0 deletions(-)
- create mode 100644 drivers/power/gpio-charger.c
- create mode 100644 include/linux/power/gpio-charger.h
-
---- a/drivers/power/Kconfig
-+++ b/drivers/power/Kconfig
-@@ -185,4 +185,11 @@ config CHARGER_TWL4030
-       help
-         Say Y here to enable support for TWL4030 Battery Charge Interface.
-+config CHARGER_GPIO
-+      tristate "GPIO charger"
-+      depends on GPIOLIB
-+      help
-+        Say Y to include support for chargers indicating their status through
-+        a GPIO pin.
-+
- endif # POWER_SUPPLY
---- a/drivers/power/Makefile
-+++ b/drivers/power/Makefile
-@@ -32,3 +32,4 @@ obj-$(CONFIG_BATTERY_JZ4740) += jz4740-b
- obj-$(CONFIG_BATTERY_INTEL_MID)       += intel_mid_battery.o
- obj-$(CONFIG_CHARGER_ISP1704) += isp1704_charger.o
- obj-$(CONFIG_CHARGER_TWL4030) += twl4030_charger.o
-+obj-$(CONFIG_CHARGER_GPIO)    += gpio-charger.o
---- /dev/null
-+++ b/drivers/power/gpio-charger.c
-@@ -0,0 +1,185 @@
-+/*
-+ *  Copyright (C) 2010, Lars-Peter Clausen <lars@metafoo.de>
-+ *  Driver for chargers indicating their status through a GPIO pin
-+ *
-+ *  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.
-+ *
-+ *  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/device.h>
-+#include <linux/gpio.h>
-+#include <linux/init.h>
-+#include <linux/interrupt.h>
-+#include <linux/kernel.h>
-+#include <linux/module.h>
-+#include <linux/platform_device.h>
-+#include <linux/power_supply.h>
-+#include <linux/slab.h>
-+#include <linux/types.h>
-+
-+#include <linux/power/gpio-charger.h>
-+
-+struct gpio_charger {
-+      const struct gpio_charger_platform_data *pdata;
-+
-+      int irq;
-+
-+      struct power_supply charger;
-+};
-+
-+static irqreturn_t gpio_charger_irq(int irq, void *devid)
-+{
-+      struct power_supply *charger = devid;
-+      power_supply_changed(charger);
-+
-+      return IRQ_HANDLED;
-+}
-+
-+static inline struct gpio_charger *psy_to_gpio_charger(struct power_supply *psy)
-+{
-+      return container_of(psy, struct gpio_charger, charger);
-+}
-+
-+static int gpio_charger_get_property(struct power_supply *psy,
-+      enum power_supply_property psp, union power_supply_propval *val)
-+{
-+      struct gpio_charger *gpio_charger = psy_to_gpio_charger(psy);
-+      const struct gpio_charger_platform_data *pdata = gpio_charger->pdata;
-+
-+      switch (psp) {
-+      case POWER_SUPPLY_PROP_ONLINE:
-+              val->intval = gpio_get_value(pdata->gpio);
-+              val->intval ^= pdata->gpio_active_low;
-+              break;
-+      default:
-+              return -EINVAL;
-+      }
-+
-+      return 0;
-+}
-+
-+static enum power_supply_property gpio_charger_properties[] = {
-+      POWER_SUPPLY_PROP_ONLINE,
-+};
-+
-+static int __devinit gpio_charger_probe(struct platform_device *pdev)
-+{
-+      const struct gpio_charger_platform_data *pdata = pdev->dev.platform_data;
-+      struct gpio_charger *gpio_charger;
-+      struct power_supply *charger;
-+      int ret;
-+
-+      if (!pdata) {
-+              dev_err(&pdev->dev, "No platform data");
-+              return -EINVAL;
-+      }
-+
-+      gpio_charger = kzalloc(sizeof(*gpio_charger), GFP_KERNEL);
-+
-+      charger = &gpio_charger->charger;
-+
-+      charger->name = pdata->name;
-+      charger->type = pdata->type;
-+      charger->properties = gpio_charger_properties;
-+      charger->num_properties = ARRAY_SIZE(gpio_charger_properties);
-+      charger->get_property  = gpio_charger_get_property;
-+      charger->supplied_to = pdata->batteries;
-+      charger->num_supplicants = pdata->num_batteries;
-+
-+      if (gpio_is_valid(pdata->gpio)) {
-+              ret = gpio_request(pdata->gpio, dev_name(&pdev->dev));
-+              if (ret) {
-+                      dev_err(&pdev->dev, "Failed to request gpio pin: %d\n", ret);
-+                      goto err;
-+              }
-+              ret = gpio_direction_input(pdata->gpio);
-+              if (ret) {
-+                      dev_err(&pdev->dev, "Failed to set gpio to input: %d\n", ret);
-+                      goto err_gpio_free;
-+              }
-+
-+              gpio_charger->irq = gpio_to_irq(pdata->gpio);
-+              if (gpio_charger->irq >= 0) {
-+                      ret = request_irq(gpio_charger->irq, gpio_charger_irq,
-+                      IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
-+                      dev_name(&pdev->dev), charger);
-+                      if (ret) {
-+                              dev_warn(&pdev->dev, "Failed to request online gpio irq: %d\n", ret);
-+                              gpio_charger->irq = -1;
-+                      }
-+              }
-+      }
-+
-+      gpio_charger->pdata = pdata;
-+
-+      ret = power_supply_register(&pdev->dev, charger);
-+      if (ret < 0) {
-+              dev_err(&pdev->dev, "Failed to register power supply: %d\n", ret);
-+              goto err_gpio_free;
-+      }
-+
-+      platform_set_drvdata(pdev, gpio_charger);
-+
-+      return 0;
-+
-+err_gpio_free:
-+      if (gpio_is_valid(pdata->gpio)) {
-+              if (gpio_charger->irq >= 0)
-+                      free_irq(gpio_charger->irq, charger);
-+              gpio_free(pdata->gpio);
-+      }
-+err:
-+      return ret;
-+}
-+
-+static int __devexit gpio_charger_remove(struct platform_device *pdev)
-+{
-+      struct gpio_charger *gpio_charger = platform_get_drvdata(pdev);
-+      const struct gpio_charger_platform_data *pdata = gpio_charger->pdata;
-+
-+      power_supply_unregister(&gpio_charger->charger);
-+
-+      if (gpio_is_valid(pdata->gpio)) {
-+              if (gpio_charger->irq >= 0)
-+                      free_irq(gpio_charger->irq, &gpio_charger->charger);
-+              gpio_free(pdata->gpio);
-+      }
-+
-+      platform_set_drvdata(pdev, NULL);
-+      kfree(gpio_charger);
-+
-+      return 0;
-+}
-+
-+static struct platform_driver  gpio_charger_driver = {
-+      .probe = gpio_charger_probe,
-+      .remove = __devexit_p(gpio_charger_remove),
-+      .driver = {
-+              .name = "gpio-charger",
-+              .owner = THIS_MODULE,
-+      },
-+};
-+
-+static int __init gpio_charger_init(void)
-+{
-+      return platform_driver_register(&gpio_charger_driver);
-+}
-+module_init(gpio_charger_init);
-+
-+static void __exit gpio_charger_exit(void)
-+{
-+      platform_driver_unregister(&gpio_charger_driver);
-+}
-+module_exit(gpio_charger_exit);
-+
-+MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
-+MODULE_DESCRIPTION("Driver for chargers indicating their status through a gpio");
-+MODULE_LICENSE("GPL");
-+MODULE_ALIAS("platform:gpio-charger");
---- /dev/null
-+++ b/include/linux/power/gpio-charger.h
-@@ -0,0 +1,28 @@
-+/*
-+ *  Copyright (C) 2010, Lars-Peter Clausen <lars@metafoo.de>
-+ *
-+ *  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.
-+ *
-+ *  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.
-+ *
-+ */
-+
-+#ifndef __LINUX_POWER_GPIO_CHARGER_H__
-+#define __LINUX_POWER_GPIO_CHARGER_H__
-+
-+struct gpio_charger_platform_data {
-+      const char *name;
-+      enum power_supply_type type;
-+      int gpio;
-+      int gpio_active_low;
-+
-+      char **batteries;
-+      size_t num_batteries;
-+};
-+
-+#endif
diff --git a/target/linux/xburst/patches-2.6.37/200-udc.patch b/target/linux/xburst/patches-2.6.37/200-udc.patch
deleted file mode 100644 (file)
index e2a1702..0000000
+++ /dev/null
@@ -1,2563 +0,0 @@
-From f39709ba061049463b1a607369e476512da9ec5b Mon Sep 17 00:00:00 2001
-From: Lars-Peter Clausen <lars@metafoo.de>
-Date: Sat, 24 Apr 2010 12:18:46 +0200
-Subject: [PATCH 02/23] Add jz4740 udc driver
-
----
- drivers/usb/gadget/Kconfig        |   14 +
- drivers/usb/gadget/Makefile       |    1 +
- drivers/usb/gadget/gadget_chips.h |    9 +
- drivers/usb/gadget/jz4740_udc.c   | 2378 +++++++++++++++++++++++++++++++++++++
- drivers/usb/gadget/jz4740_udc.h   |  101 ++
- 5 files changed, 2503 insertions(+), 0 deletions(-)
- create mode 100644 drivers/usb/gadget/jz4740_udc.c
- create mode 100644 drivers/usb/gadget/jz4740_udc.h
-
---- a/drivers/usb/gadget/Kconfig
-+++ b/drivers/usb/gadget/Kconfig
-@@ -121,11 +121,25 @@ choice
- #
- # Integrated controllers
- #
-+config USB_GADGET_JZ4740
-+      boolean "JZ4740 UDC"
-+      depends on MACH_JZ4740
-+      select USB_GADGET_SELECTED
-+      select USB_GADGET_DUALSPEED
-+      help
-+         Select this to support the Ingenic JZ4740 processor
-+           high speed USB device controller.
-+
-+config USB_JZ4740
-+      tristate
-+      depends on USB_GADGET_JZ4740
-+      default USB_GADGET
- config USB_GADGET_AT91
-       boolean "Atmel AT91 USB Device Port"
-       depends on ARCH_AT91 && !ARCH_AT91SAM9RL && !ARCH_AT91CAP9 && !ARCH_AT91SAM9G45
-       select USB_GADGET_SELECTED
-+
-       help
-          Many Atmel AT91 processors (such as the AT91RM2000) have a
-          full speed USB Device Port with support for five configurable
---- a/drivers/usb/gadget/Makefile
-+++ b/drivers/usb/gadget/Makefile
-@@ -24,6 +24,7 @@ obj-$(CONFIG_USB_FSL_QE)     += fsl_qe_udc.o
- obj-$(CONFIG_USB_CI13XXX)     += ci13xxx_udc.o
- obj-$(CONFIG_USB_S3C_HSOTG)   += s3c-hsotg.o
- obj-$(CONFIG_USB_LANGWELL)    += langwell_udc.o
-+obj-$(CONFIG_USB_JZ4740)      += jz4740_udc.o
- #
- # USB gadget drivers
---- a/drivers/usb/gadget/gadget_chips.h
-+++ b/drivers/usb/gadget/gadget_chips.h
-@@ -15,6 +15,12 @@
- #ifndef __GADGET_CHIPS_H
- #define __GADGET_CHIPS_H
-+#ifdef CONFIG_USB_GADGET_JZ4740
-+#define       gadget_is_jz4740(g)     !strcmp("ingenic_hsusb", (g)->name)
-+#else
-+#define       gadget_is_jz4740(g)     0
-+#endif
-+
- #ifdef CONFIG_USB_GADGET_NET2280
- #define       gadget_is_net2280(g)    !strcmp("net2280", (g)->name)
- #else
-@@ -200,6 +206,9 @@ static inline int usb_gadget_controller_
-               return 0x25;
-       else if (gadget_is_s3c_hsotg(gadget))
-               return 0x26;
-+      else if (gadget_is_jz4740(gadget))
-+              return 0x27;
-+
-       return -ENOENT;
- }
---- /dev/null
-+++ b/drivers/usb/gadget/jz4740_udc.c
-@@ -0,0 +1,2378 @@
-+/*
-+ * linux/drivers/usb/gadget/jz4740_udc.c
-+ *
-+ * Ingenic JZ4740 on-chip high speed USB device controller
-+ *
-+ * Copyright (C) 2006 - 2008 Ingenic Semiconductor Inc.
-+ * Author: <jlwei@ingenic.cn>
-+ *
-+ * 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 device has ep0, two bulk-in/interrupt-in endpoints, and one bulk-out endpoint.
-+ *
-+ *  - Endpoint numbering is fixed: ep0, ep1in-int, ep2in-bulk, ep1out-bulk.
-+ *  - DMA works with bulk-in (channel 1) and bulk-out (channel 2) endpoints.
-+ */
-+
-+#include <linux/kernel.h>
-+#include <linux/module.h>
-+#include <linux/platform_device.h>
-+#include <linux/delay.h>
-+#include <linux/ioport.h>
-+#include <linux/slab.h>
-+#include <linux/errno.h>
-+#include <linux/init.h>
-+#include <linux/list.h>
-+#include <linux/interrupt.h>
-+#include <linux/proc_fs.h>
-+#include <linux/usb.h>
-+#include <linux/usb/gadget.h>
-+#include <linux/clk.h>
-+
-+#include <asm/byteorder.h>
-+#include <asm/io.h>
-+#include <asm/irq.h>
-+#include <asm/system.h>
-+#include <asm/mach-jz4740/clock.h>
-+
-+#include "jz4740_udc.h"
-+
-+#define JZ_REG_UDC_FADDR      0x00 /* Function Address 8-bit */
-+#define JZ_REG_UDC_POWER      0x01 /* Power Management 8-bit */
-+#define JZ_REG_UDC_INTRIN     0x02 /* Interrupt IN 16-bit */
-+#define JZ_REG_UDC_INTROUT    0x04 /* Interrupt OUT 16-bit */
-+#define JZ_REG_UDC_INTRINE    0x06 /* Intr IN enable 16-bit */
-+#define JZ_REG_UDC_INTROUTE   0x08 /* Intr OUT enable 16-bit */
-+#define JZ_REG_UDC_INTRUSB    0x0a /* Interrupt USB 8-bit */
-+#define JZ_REG_UDC_INTRUSBE   0x0b /* Interrupt USB Enable 8-bit */
-+#define JZ_REG_UDC_FRAME      0x0c /* Frame number 16-bit */
-+#define JZ_REG_UDC_INDEX      0x0e /* Index register 8-bit */
-+#define JZ_REG_UDC_TESTMODE   0x0f /* USB test mode 8-bit */
-+
-+#define JZ_REG_UDC_CSR0               0x12 /* EP0 CSR 8-bit */
-+#define JZ_REG_UDC_INMAXP     0x10 /* EP1-2 IN Max Pkt Size 16-bit */
-+#define JZ_REG_UDC_INCSR      0x12 /* EP1-2 IN CSR LSB 8/16bit */
-+#define JZ_REG_UDC_INCSRH     0x13 /* EP1-2 IN CSR MSB 8-bit */
-+#define JZ_REG_UDC_OUTMAXP    0x14 /* EP1 OUT Max Pkt Size 16-bit */
-+#define JZ_REG_UDC_OUTCSR     0x16 /* EP1 OUT CSR LSB 8/16bit */
-+#define JZ_REG_UDC_OUTCSRH    0x17 /* EP1 OUT CSR MSB 8-bit */
-+#define JZ_REG_UDC_OUTCOUNT   0x18 /* bytes in EP0/1 OUT FIFO 16-bit */
-+
-+#define JZ_REG_UDC_EP_FIFO(x) (4 * (x) + 0x20)
-+
-+#define JZ_REG_UDC_EPINFO     0x78 /* Endpoint information */
-+#define JZ_REG_UDC_RAMINFO    0x79 /* RAM information */
-+
-+#define JZ_REG_UDC_INTR               0x200 /* DMA pending interrupts */
-+#define JZ_REG_UDC_CNTL1      0x204 /* DMA channel 1 control */
-+#define JZ_REG_UDC_ADDR1      0x208 /* DMA channel 1 AHB memory addr */
-+#define JZ_REG_UDC_COUNT1     0x20c /* DMA channel 1 byte count */
-+#define JZ_REG_UDC_CNTL2      0x214 /* DMA channel 2 control */
-+#define JZ_REG_UDC_ADDR2      0x218 /* DMA channel 2 AHB memory addr */
-+#define JZ_REG_UDC_COUNT2     0x21c /* DMA channel 2 byte count */
-+
-+/* Power register bit masks */
-+#define USB_POWER_SUSPENDM    0x01
-+#define USB_POWER_RESUME      0x04
-+#define USB_POWER_HSMODE      0x10
-+#define USB_POWER_HSENAB      0x20
-+#define USB_POWER_SOFTCONN    0x40
-+
-+/* Interrupt register bit masks */
-+#define USB_INTR_SUSPEND      0x01
-+#define USB_INTR_RESUME               0x02
-+#define USB_INTR_RESET                0x04
-+
-+#define USB_INTR_EP0          0x0001
-+#define USB_INTR_INEP1                0x0002
-+#define USB_INTR_INEP2                0x0004
-+#define USB_INTR_OUTEP1               0x0002
-+
-+/* CSR0 bit masks */
-+#define USB_CSR0_OUTPKTRDY    0x01
-+#define USB_CSR0_INPKTRDY     0x02
-+#define USB_CSR0_SENTSTALL    0x04
-+#define USB_CSR0_DATAEND      0x08
-+#define USB_CSR0_SETUPEND     0x10
-+#define USB_CSR0_SENDSTALL    0x20
-+#define USB_CSR0_SVDOUTPKTRDY 0x40
-+#define USB_CSR0_SVDSETUPEND  0x80
-+
-+/* Endpoint CSR register bits */
-+#define USB_INCSRH_AUTOSET    0x80
-+#define USB_INCSRH_ISO                0x40
-+#define USB_INCSRH_MODE               0x20
-+#define USB_INCSRH_DMAREQENAB 0x10
-+#define USB_INCSRH_DMAREQMODE 0x04
-+#define USB_INCSR_CDT         0x40
-+#define USB_INCSR_SENTSTALL   0x20
-+#define USB_INCSR_SENDSTALL   0x10
-+#define USB_INCSR_FF          0x08
-+#define USB_INCSR_UNDERRUN    0x04
-+#define USB_INCSR_FFNOTEMPT   0x02
-+#define USB_INCSR_INPKTRDY    0x01
-+#define USB_OUTCSRH_AUTOCLR   0x80
-+#define USB_OUTCSRH_ISO               0x40
-+#define USB_OUTCSRH_DMAREQENAB        0x20
-+#define USB_OUTCSRH_DNYT      0x10
-+#define USB_OUTCSRH_DMAREQMODE        0x08
-+#define USB_OUTCSR_CDT                0x80
-+#define USB_OUTCSR_SENTSTALL  0x40
-+#define USB_OUTCSR_SENDSTALL  0x20
-+#define USB_OUTCSR_FF         0x10
-+#define USB_OUTCSR_DATAERR    0x08
-+#define USB_OUTCSR_OVERRUN    0x04
-+#define USB_OUTCSR_FFFULL     0x02
-+#define USB_OUTCSR_OUTPKTRDY  0x01
-+
-+/* DMA control bits */
-+#define USB_CNTL_ENA          0x01
-+#define USB_CNTL_DIR_IN               0x02
-+#define USB_CNTL_MODE_1               0x04
-+#define USB_CNTL_INTR_EN      0x08
-+#define USB_CNTL_EP(n)                ((n) << 4)
-+#define USB_CNTL_BURST_0      (0 << 9)
-+#define USB_CNTL_BURST_4      (1 << 9)
-+#define USB_CNTL_BURST_8      (2 << 9)
-+#define USB_CNTL_BURST_16     (3 << 9)
-+
-+
-+#ifndef DEBUG
-+# define DEBUG(fmt,args...) do {} while(0)
-+#endif
-+#ifndef DEBUG_EP0
-+# define NO_STATES
-+# define DEBUG_EP0(fmt,args...) do {} while(0)
-+#endif
-+#ifndef DEBUG_SETUP
-+# define DEBUG_SETUP(fmt,args...) do {} while(0)
-+#endif
-+
-+static unsigned int use_dma = 0;   /* 1: use DMA, 0: use PIO */
-+
-+module_param(use_dma, int, 0);
-+MODULE_PARM_DESC(use_dma, "DMA mode enable flag");
-+
-+static struct jz4740_udc jz4740_udc_controller;
-+
-+/*
-+ * Local declarations.
-+ */
-+static void jz4740_ep0_kick(struct jz4740_udc *dev, struct jz4740_ep *ep);
-+static void jz4740_handle_ep0(struct jz4740_udc *dev, uint32_t intr);
-+
-+static void done(struct jz4740_ep *ep, struct jz4740_request *req,
-+               int status);
-+static void pio_irq_enable(struct jz4740_ep *ep);
-+static void pio_irq_disable(struct jz4740_ep *ep);
-+static void stop_activity(struct jz4740_udc *dev,
-+                        struct usb_gadget_driver *driver);
-+static void nuke(struct jz4740_ep *ep, int status);
-+static void flush(struct jz4740_ep *ep);
-+static void udc_set_address(struct jz4740_udc *dev, unsigned char address);
-+
-+/*-------------------------------------------------------------------------*/
-+
-+/* inline functions of register read/write/set/clear  */
-+
-+static inline uint8_t usb_readb(struct jz4740_udc *udc, size_t reg)
-+{
-+      return readb(udc->base + reg);
-+}
-+
-+static inline uint16_t usb_readw(struct jz4740_udc *udc, size_t reg)
-+{
-+      return readw(udc->base + reg);
-+}
-+
-+static inline uint32_t usb_readl(struct jz4740_udc *udc, size_t reg)
-+{
-+      return readl(udc->base + reg);
-+}
-+
-+static inline void usb_writeb(struct jz4740_udc *udc, size_t reg, uint8_t val)
-+{
-+      writeb(val, udc->base + reg);
-+}
-+
-+static inline void usb_writew(struct jz4740_udc *udc, size_t reg, uint16_t val)
-+{
-+      writew(val, udc->base + reg);
-+}
-+
-+static inline void usb_writel(struct jz4740_udc *udc, size_t reg, uint32_t val)
-+{
-+      writel(val, udc->base + reg);
-+}
-+
-+static inline void usb_setb(struct jz4740_udc *udc, size_t reg, uint8_t mask)
-+{
-+      usb_writeb(udc, reg, usb_readb(udc, reg) | mask);
-+}
-+
-+static inline void usb_setw(struct jz4740_udc *udc, size_t reg, uint8_t mask)
-+{
-+      usb_writew(udc, reg, usb_readw(udc, reg) | mask);
-+}
-+
-+static inline void usb_clearb(struct jz4740_udc *udc, size_t reg, uint8_t mask)
-+{
-+      usb_writeb(udc, reg, usb_readb(udc, reg) & ~mask);
-+}
-+
-+static inline void usb_clearw(struct jz4740_udc *udc, size_t reg, uint16_t mask)
-+{
-+      usb_writew(udc, reg, usb_readw(udc, reg) & ~mask);
-+}
-+
-+/*-------------------------------------------------------------------------*/
-+
-+static inline void jz_udc_set_index(struct jz4740_udc *udc, uint8_t index)
-+{
-+      usb_writeb(udc, JZ_REG_UDC_INDEX, index);
-+}
-+
-+static inline void jz_udc_select_ep(struct jz4740_ep *ep)
-+{
-+      jz_udc_set_index(ep->dev, ep_index(ep));
-+}
-+
-+static inline int write_packet(struct jz4740_ep *ep,
-+                                 struct jz4740_request *req, unsigned int count)
-+{
-+      uint8_t *buf;
-+      unsigned int length, nlong, nbyte;
-+      void __iomem *fifo = ep->dev->base + ep->fifo;
-+
-+      DEBUG("%s:%s[%d]\n", __FILE__, __func__, __LINE__);
-+
-+      buf = req->req.buf + req->req.actual;
-+      prefetch(buf);
-+
-+      length = req->req.length - req->req.actual;
-+      if (length > count)
-+              length = count;
-+      req->req.actual += length;
-+
-+      DEBUG("Write %d (count %d), fifo %x\n", length, count, ep->fifo);
-+
-+      nlong = length >> 2;
-+      nbyte = length & 0x3;
-+      while (nlong--) {
-+              writel(*((uint32_t *)buf), fifo);
-+              buf += 4;
-+      }
-+      while (nbyte--)
-+              writeb(*buf++, fifo);
-+
-+      return length;
-+}
-+
-+static int read_packet(struct jz4740_ep *ep,
-+                                struct jz4740_request *req, unsigned int count)
-+{
-+      uint8_t *buf;
-+      unsigned int length, nlong, nbyte;
-+      void __iomem *fifo = ep->dev->base + ep->fifo;
-+      DEBUG("%s:%s[%d]\n", __FILE__, __func__, __LINE__);
-+
-+      buf = req->req.buf + req->req.actual;
-+      prefetchw(buf);
-+
-+      length = req->req.length - req->req.actual;
-+      if (length > count)
-+              length = count;
-+      req->req.actual += length;
-+
-+      DEBUG("Read %d, fifo %x\n", length, ep->fifo);
-+      nlong = length >> 2;
-+      nbyte = length & 0x3;
-+      while (nlong--) {
-+              *((uint32_t *)buf) = readl(fifo);
-+              buf += 4;
-+      }
-+      while (nbyte--)
-+              *buf++ = readb(fifo);
-+
-+      return length;
-+}
-+
-+/*-------------------------------------------------------------------------*/
-+
-+/*
-+ *    udc_disable - disable USB device controller
-+ */
-+static void udc_disable(struct jz4740_udc *dev)
-+{
-+      DEBUG("%s:%s[%d]\n", __FILE__, __func__, __LINE__);
-+
-+      udc_set_address(dev, 0);
-+
-+      /* Disable interrupts */
-+      usb_writew(dev, JZ_REG_UDC_INTRINE, 0);
-+      usb_writew(dev, JZ_REG_UDC_INTROUTE, 0);
-+      usb_writeb(dev, JZ_REG_UDC_INTRUSBE, 0);
-+
-+      /* Disable DMA */
-+      usb_writel(dev, JZ_REG_UDC_CNTL1, 0);
-+      usb_writel(dev, JZ_REG_UDC_CNTL2, 0);
-+
-+      /* Disconnect from usb */
-+      usb_clearb(dev, JZ_REG_UDC_POWER, USB_POWER_SOFTCONN);
-+
-+      /* Disable the USB PHY */
-+      clk_disable(dev->clk);
-+
-+      dev->ep0state = WAIT_FOR_SETUP;
-+      dev->gadget.speed = USB_SPEED_UNKNOWN;
-+
-+      return;
-+}
-+
-+/*
-+ *    udc_reinit - initialize software state
-+ */
-+static void udc_reinit(struct jz4740_udc *dev)
-+{
-+      int i;
-+      DEBUG("%s:%s[%d]\n", __FILE__, __func__, __LINE__);
-+
-+      /* device/ep0 records init */
-+      INIT_LIST_HEAD(&dev->gadget.ep_list);
-+      INIT_LIST_HEAD(&dev->gadget.ep0->ep_list);
-+      dev->ep0state = WAIT_FOR_SETUP;
-+
-+      for (i = 0; i < UDC_MAX_ENDPOINTS; i++) {
-+              struct jz4740_ep *ep = &dev->ep[i];
-+
-+              if (i != 0)
-+                      list_add_tail(&ep->ep.ep_list, &dev->gadget.ep_list);
-+
-+              INIT_LIST_HEAD(&ep->queue);
-+              ep->desc = 0;
-+              ep->stopped = 0;
-+      }
-+}
-+
-+/* until it's enabled, this UDC should be completely invisible
-+ * to any USB host.
-+ */
-+static void udc_enable(struct jz4740_udc *dev)
-+{
-+      int i;
-+      DEBUG("%s:%s[%d]\n", __FILE__, __func__, __LINE__);
-+
-+      /* UDC state is incorrect - Added by River */
-+      if (dev->state != UDC_STATE_ENABLE) {
-+              return;
-+      }
-+
-+      dev->gadget.speed = USB_SPEED_UNKNOWN;
-+
-+      /* Flush FIFO for each */
-+      for (i = 0; i < UDC_MAX_ENDPOINTS; i++) {
-+              struct jz4740_ep *ep = &dev->ep[i];
-+
-+              jz_udc_set_index(dev, ep_index(ep));
-+              flush(ep);
-+      }
-+
-+      /* Set this bit to allow the UDC entering low-power mode when
-+       * there are no actions on the USB bus.
-+       * UDC still works during this bit was set.
-+       */
-+      jz4740_clock_udc_enable_auto_suspend();
-+
-+      /* Enable the USB PHY */
-+      clk_enable(dev->clk);
-+
-+      /* Disable interrupts */
-+/*    usb_writew(dev, JZ_REG_UDC_INTRINE, 0);
-+      usb_writew(dev, JZ_REG_UDC_INTROUTE, 0);
-+      usb_writeb(dev, JZ_REG_UDC_INTRUSBE, 0);*/
-+
-+      /* Enable interrupts */
-+      usb_setw(dev, JZ_REG_UDC_INTRINE, USB_INTR_EP0);
-+      usb_setb(dev, JZ_REG_UDC_INTRUSBE, USB_INTR_RESET);
-+      /* Don't enable rest of the interrupts */
-+      /* usb_setw(dev, JZ_REG_UDC_INTRINE, USB_INTR_INEP1 | USB_INTR_INEP2);
-+         usb_setw(dev, JZ_REG_UDC_INTROUTE, USB_INTR_OUTEP1); */
-+
-+      /* Enable SUSPEND */
-+      /* usb_setb(dev, JZ_REG_UDC_POWER, USB_POWER_SUSPENDM); */
-+
-+      /* Enable HS Mode */
-+      usb_setb(dev, JZ_REG_UDC_POWER, USB_POWER_HSENAB);
-+
-+      /* Let host detect UDC:
-+       * Software must write a 1 to the PMR:USB_POWER_SOFTCONN bit to turn this
-+       * transistor on and pull the USBDP pin HIGH.
-+       */
-+      usb_setb(dev, JZ_REG_UDC_POWER, USB_POWER_SOFTCONN);
-+
-+      return;
-+}
-+
-+/*-------------------------------------------------------------------------*/
-+
-+/* keeping it simple:
-+ * - one bus driver, initted first;
-+ * - one function driver, initted second
-+ */
-+
-+/*
-+ * Register entry point for the peripheral controller driver.
-+ */
-+
-+int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
-+              int (*bind)(struct usb_gadget *))
-+{
-+      struct jz4740_udc *dev = &jz4740_udc_controller;
-+      int retval;
-+
-+      if (!driver || !bind)
-+              return -EINVAL;
-+
-+      if (!dev)
-+              return -ENODEV;
-+
-+      if (dev->driver)
-+              return -EBUSY;
-+
-+      /* hook up the driver */
-+      dev->driver = driver;
-+      dev->gadget.dev.driver = &driver->driver;
-+
-+      retval = bind(&dev->gadget);
-+      if (retval) {
-+              DEBUG("%s: bind to driver %s --> error %d\n", dev->gadget.name,
-+                          driver->driver.name, retval);
-+              dev->driver = 0;
-+              return retval;
-+      }
-+
-+      /* then enable host detection and ep0; and we're ready
-+       * for set_configuration as well as eventual disconnect.
-+       */
-+      udc_enable(dev);
-+
-+      DEBUG("%s: registered gadget driver '%s'\n", dev->gadget.name,
-+            driver->driver.name);
-+
-+      return 0;
-+}
-+EXPORT_SYMBOL(usb_gadget_probe_driver);
-+
-+static void stop_activity(struct jz4740_udc *dev,
-+                        struct usb_gadget_driver *driver)
-+{
-+      int i;
-+
-+      DEBUG("%s:%s[%d]\n", __FILE__, __func__, __LINE__);
-+
-+      /* don't disconnect drivers more than once */
-+      if (dev->gadget.speed == USB_SPEED_UNKNOWN)
-+              driver = 0;
-+      dev->gadget.speed = USB_SPEED_UNKNOWN;
-+
-+      /* prevent new request submissions, kill any outstanding requests  */
-+      for (i = 0; i < UDC_MAX_ENDPOINTS; i++) {
-+              struct jz4740_ep *ep = &dev->ep[i];
-+
-+              ep->stopped = 1;
-+
-+              jz_udc_set_index(dev, ep_index(ep));
-+              nuke(ep, -ESHUTDOWN);
-+      }
-+
-+      /* report disconnect; the driver is already quiesced */
-+      if (driver) {
-+              spin_unlock(&dev->lock);
-+              driver->disconnect(&dev->gadget);
-+              spin_lock(&dev->lock);
-+      }
-+
-+      /* re-init driver-visible data structures */
-+      udc_reinit(dev);
-+}
-+
-+
-+/*
-+ * Unregister entry point for the peripheral controller driver.
-+ */
-+int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
-+{
-+      struct jz4740_udc *dev = &jz4740_udc_controller;
-+      unsigned long flags;
-+      DEBUG("%s:%s[%d]\n", __FILE__, __func__, __LINE__);
-+
-+      if (!dev)
-+              return -ENODEV;
-+      if (!driver || driver != dev->driver)
-+              return -EINVAL;
-+      if (!driver->unbind)
-+              return -EBUSY;
-+
-+      spin_lock_irqsave(&dev->lock, flags);
-+      dev->driver = 0;
-+      stop_activity(dev, driver);
-+      spin_unlock_irqrestore(&dev->lock, flags);
-+
-+      driver->unbind(&dev->gadget);
-+
-+      udc_disable(dev);
-+
-+      DEBUG("unregistered driver '%s'\n", driver->driver.name);
-+
-+      return 0;
-+}
-+
-+EXPORT_SYMBOL(usb_gadget_unregister_driver);
-+
-+/*-------------------------------------------------------------------------*/
-+
-+/*
-+ * Starting DMA using mode 1
-+ */
-+static void kick_dma(struct jz4740_ep *ep, struct jz4740_request *req)
-+{
-+      struct jz4740_udc *dev = ep->dev;
-+      uint32_t count = req->req.length;
-+      uint32_t physaddr = virt_to_phys((void *)req->req.buf);
-+
-+      DEBUG("%s:%s[%d]\n", __FILE__, __func__, __LINE__);
-+
-+      jz_udc_select_ep(ep);
-+
-+      if (ep_is_in(ep)) { /* Bulk-IN transfer using DMA channel 1 */
-+              ep->reg_addr = JZ_REG_UDC_ADDR1;
-+
-+              dma_cache_wback_inv((unsigned long)req->req.buf, count);
-+
-+              pio_irq_enable(ep);
-+
-+              usb_writeb(dev, JZ_REG_UDC_INCSRH,
-+                         USB_INCSRH_DMAREQENAB | USB_INCSRH_AUTOSET | USB_INCSRH_DMAREQMODE);
-+
-+              usb_writel(dev, JZ_REG_UDC_ADDR1, physaddr);
-+              usb_writel(dev, JZ_REG_UDC_COUNT1, count);
-+              usb_writel(dev, JZ_REG_UDC_CNTL1, USB_CNTL_ENA | USB_CNTL_DIR_IN | USB_CNTL_MODE_1 |
-+                         USB_CNTL_INTR_EN | USB_CNTL_BURST_16 | USB_CNTL_EP(ep_index(ep)));
-+      }
-+      else { /* Bulk-OUT transfer using DMA channel 2 */
-+              ep->reg_addr = JZ_REG_UDC_ADDR2;
-+
-+              dma_cache_wback_inv((unsigned long)req->req.buf, count);
-+
-+              pio_irq_enable(ep);
-+
-+              usb_setb(dev, JZ_REG_UDC_OUTCSRH,
-+                       USB_OUTCSRH_DMAREQENAB | USB_OUTCSRH_AUTOCLR | USB_OUTCSRH_DMAREQMODE);
-+
-+              usb_writel(dev, JZ_REG_UDC_ADDR2, physaddr);
-+              usb_writel(dev, JZ_REG_UDC_COUNT2, count);
-+              usb_writel(dev, JZ_REG_UDC_CNTL2, USB_CNTL_ENA | USB_CNTL_MODE_1 |
-+                         USB_CNTL_INTR_EN | USB_CNTL_BURST_16 | USB_CNTL_EP(ep_index(ep)));
-+      }
-+}
-+
-+/*-------------------------------------------------------------------------*/
-+
-+/** Write request to FIFO (max write == maxp size)
-+ *  Return:  0 = still running, 1 = completed, negative = errno
-+ *  NOTE: INDEX register must be set for EP
-+ */
-+static int write_fifo(struct jz4740_ep *ep, struct jz4740_request *req)
-+{
-+      struct jz4740_udc *dev = ep->dev;
-+      uint32_t max, csr;
-+      uint32_t physaddr = virt_to_phys((void *)req->req.buf);
-+
-+      DEBUG("%s:%s[%d]\n", __FILE__, __func__, __LINE__);
-+      max = le16_to_cpu(ep->desc->wMaxPacketSize);
-+
-+      if (use_dma) {
-+              uint32_t dma_count;
-+
-+              /* DMA interrupt generated due to the last packet loaded into the FIFO */
-+
-+              dma_count = usb_readl(dev, ep->reg_addr) - physaddr;
-+              req->req.actual += dma_count;
-+
-+              if (dma_count % max) {
-+                      /* If the last packet is less than MAXP, set INPKTRDY manually */
-+                      usb_setb(dev, ep->csr, USB_INCSR_INPKTRDY);
-+              }
-+
-+              done(ep, req, 0);
-+              if (list_empty(&ep->queue)) {
-+                      pio_irq_disable(ep);
-+                      return 1;
-+              }
-+              else {
-+                      /* advance the request queue */
-+                      req = list_entry(ep->queue.next, struct jz4740_request, queue);
-+                      kick_dma(ep, req);
-+                      return 0;
-+              }
-+      }
-+
-+      /*
-+       * PIO mode handling starts here ...
-+       */
-+
-+      csr = usb_readb(dev, ep->csr);
-+
-+      if (!(csr & USB_INCSR_FFNOTEMPT)) {
-+              unsigned count;
-+              int is_last, is_short;
-+
-+              count = write_packet(ep, req, max);
-+              usb_setb(dev, ep->csr, USB_INCSR_INPKTRDY);
-+
-+              /* last packet is usually short (or a zlp) */
-+              if (unlikely(count != max))
-+                      is_last = is_short = 1;
-+              else {
-+                      if (likely(req->req.length != req->req.actual)
-+                          || req->req.zero)
-+                              is_last = 0;
-+                      else
-+                              is_last = 1;
-+                      /* interrupt/iso maxpacket may not fill the fifo */
-+                      is_short = unlikely(max < ep_maxpacket(ep));
-+              }
-+
-+              DEBUG("%s: wrote %s %d bytes%s%s %d left %p\n", __FUNCTION__,
-+                    ep->ep.name, count,
-+                    is_last ? "/L" : "", is_short ? "/S" : "",
-+                    req->req.length - req->req.actual, req);
-+
-+              /* requests complete when all IN data is in the FIFO */
-+              if (is_last) {
-+                      done(ep, req, 0);
-+                      if (list_empty(&ep->queue)) {
-+                              pio_irq_disable(ep);
-+                      }
-+                      return 1;
-+              }
-+      } else {
-+              DEBUG("Hmm.. %d ep FIFO is not empty!\n", ep_index(ep));
-+      }
-+
-+      return 0;
-+}
-+
-+/** Read to request from FIFO (max read == bytes in fifo)
-+ *  Return:  0 = still running, 1 = completed, negative = errno
-+ *  NOTE: INDEX register must be set for EP
-+ */
-+static int read_fifo(struct jz4740_ep *ep, struct jz4740_request *req)
-+{
-+      struct jz4740_udc *dev = ep->dev;
-+      uint32_t csr;
-+      unsigned count, is_short;
-+
-+#if 0
-+      uint32_t physaddr = virt_to_phys((void *)req->req.buf);
-+
-+      if (use_dma) {
-+              uint32_t dma_count;
-+
-+              /* DMA interrupt generated due to a packet less than MAXP loaded into the FIFO */
-+
-+              dma_count = usb_readl(dev, ep->reg_addr) - physaddr;
-+              req->req.actual += dma_count;
-+
-+              /* Disable interrupt and DMA */
-+              pio_irq_disable(ep);
-+              usb_writel(dev, JZ_REG_UDC_CNTL2, 0);
-+
-+              /* Read all bytes from this packet */
-+              count = usb_readw(dev, JZ_REG_UDC_OUTCOUNT);
-+              count = read_packet(ep, req, count);
-+
-+              if (count) {
-+                      /* If the last packet is greater than zero, clear OUTPKTRDY manually */
-+                      usb_clearb(dev, ep->csr, USB_OUTCSR_OUTPKTRDY);
-+              }
-+              done(ep, req, 0);
-+
-+              if (!list_empty(&ep->queue)) {
-+                      /* advance the request queue */
-+                      req = list_entry(ep->queue.next, struct jz4740_request, queue);
-+                      kick_dma(ep, req);
-+              }
-+
-+              return 1;
-+      }
-+#endif
-+      /*
-+       * PIO mode handling starts here ...
-+       */
-+
-+      /* make sure there's a packet in the FIFO. */
-+      csr = usb_readb(dev, ep->csr);
-+      if (!(csr & USB_OUTCSR_OUTPKTRDY)) {
-+              DEBUG("%s: Packet NOT ready!\n", __FUNCTION__);
-+              return -EINVAL;
-+      }
-+
-+      /* read all bytes from this packet */
-+      count = usb_readw(dev, JZ_REG_UDC_OUTCOUNT);
-+
-+      is_short = (count < ep->ep.maxpacket);
-+
-+      count = read_packet(ep, req, count);
-+
-+      DEBUG("read %s %02x, %d bytes%s req %p %d/%d\n",
-+            ep->ep.name, csr, count,
-+            is_short ? "/S" : "", req, req->req.actual, req->req.length);
-+
-+      /* Clear OutPktRdy */
-+      usb_clearb(dev, ep->csr, USB_OUTCSR_OUTPKTRDY);
-+
-+      /* completion */
-+      if (is_short || req->req.actual == req->req.length) {
-+              done(ep, req, 0);
-+
-+              if (list_empty(&ep->queue))
-+                      pio_irq_disable(ep);
-+              return 1;
-+      }
-+
-+      /* finished that packet.  the next one may be waiting... */
-+      return 0;
-+}
-+
-+/*
-+ *    done - retire a request; caller blocked irqs
-+ *  INDEX register is preserved to keep same
-+ */
-+static void done(struct jz4740_ep *ep, struct jz4740_request *req, int status)
-+{
-+      unsigned int stopped = ep->stopped;
-+      uint32_t index;
-+
-+      DEBUG("%s, %p\n", __FUNCTION__, ep);
-+      list_del_init(&req->queue);
-+
-+      if (likely(req->req.status == -EINPROGRESS))
-+              req->req.status = status;
-+      else
-+              status = req->req.status;
-+
-+      if (status && status != -ESHUTDOWN)
-+              DEBUG("complete %s req %p stat %d len %u/%u\n",
-+                    ep->ep.name, &req->req, status,
-+                    req->req.actual, req->req.length);
-+
-+      /* don't modify queue heads during completion callback */
-+      ep->stopped = 1;
-+      /* Read current index (completion may modify it) */
-+      index = usb_readb(ep->dev, JZ_REG_UDC_INDEX);
-+      spin_unlock_irqrestore(&ep->dev->lock, ep->dev->lock_flags);
-+
-+      req->req.complete(&ep->ep, &req->req);
-+
-+      spin_lock_irqsave(&ep->dev->lock, ep->dev->lock_flags);
-+      /* Restore index */
-+      jz_udc_set_index(ep->dev, index);
-+      ep->stopped = stopped;
-+}
-+
-+/** Enable EP interrupt */
-+static void pio_irq_enable(struct jz4740_ep *ep)
-+{
-+      uint8_t index = ep_index(ep);
-+      struct jz4740_udc *dev = ep->dev;
-+      DEBUG("%s: EP%d %s\n", __FUNCTION__, ep_index(ep), ep_is_in(ep) ? "IN": "OUT");
-+
-+      if (ep_is_in(ep)) {
-+              switch (index) {
-+              case 1:
-+              case 2:
-+                      usb_setw(dev, JZ_REG_UDC_INTRINE, BIT(index));
-+                      break;
-+              default:
-+                      DEBUG("Unknown endpoint: %d\n", index);
-+                      break;
-+              }
-+      }
-+      else {
-+              switch (index) {
-+              case 1:
-+                      usb_setw(dev, JZ_REG_UDC_INTROUTE, BIT(index));
-+                      break;
-+              default:
-+                      DEBUG("Unknown endpoint: %d\n", index);
-+                      break;
-+              }
-+      }
-+}
-+
-+/** Disable EP interrupt */
-+static void pio_irq_disable(struct jz4740_ep *ep)
-+{
-+      uint8_t index = ep_index(ep);
-+
-+      DEBUG("%s: EP%d %s\n", __FUNCTION__, ep_index(ep), ep_is_in(ep) ? "IN": "OUT");
-+
-+      if (ep_is_in(ep)) {
-+              switch (ep_index(ep)) {
-+              case 1:
-+              case 2:
-+                      usb_clearw(ep->dev, JZ_REG_UDC_INTRINE, BIT(index));
-+                      break;
-+              default:
-+                      DEBUG("Unknown endpoint: %d\n", index);
-+                      break;
-+              }
-+      }
-+      else {
-+              switch (ep_index(ep)) {
-+              case 1:
-+                      usb_clearw(ep->dev, JZ_REG_UDC_INTROUTE, BIT(index));
-+                      break;
-+              default:
-+                      DEBUG("Unknown endpoint: %d\n", index);
-+                      break;
-+          }
-+      }
-+}
-+
-+/*
-+ *    nuke - dequeue ALL requests
-+ */
-+static void nuke(struct jz4740_ep *ep, int status)
-+{
-+      struct jz4740_request *req;
-+
-+      DEBUG("%s, %p\n", __FUNCTION__, ep);
-+
-+      /* Flush FIFO */
-+      flush(ep);
-+
-+      /* called with irqs blocked */
-+      while (!list_empty(&ep->queue)) {
-+              req = list_entry(ep->queue.next, struct jz4740_request, queue);
-+              done(ep, req, status);
-+      }
-+
-+      /* Disable IRQ if EP is enabled (has descriptor) */
-+      if (ep->desc)
-+              pio_irq_disable(ep);
-+}
-+
-+/** Flush EP FIFO
-+ * NOTE: INDEX register must be set before this call
-+ */
-+static void flush(struct jz4740_ep *ep)
-+{
-+      DEBUG("%s: %s\n", __FUNCTION__, ep->ep.name);
-+
-+      switch (ep->type) {
-+      case ep_bulk_in:
-+      case ep_interrupt:
-+              usb_setb(ep->dev, ep->csr, USB_INCSR_FF);
-+              break;
-+      case ep_bulk_out:
-+              usb_setb(ep->dev, ep->csr, USB_OUTCSR_FF);
-+              break;
-+      case ep_control:
-+              break;
-+      }
-+}
-+
-+/**
-+ * jz4740_in_epn - handle IN interrupt
-+ */
-+static void jz4740_in_epn(struct jz4740_udc *dev, uint32_t ep_idx, uint32_t intr)
-+{
-+      uint32_t csr;
-+      struct jz4740_ep *ep = &dev->ep[ep_idx + 1];
-+      struct jz4740_request *req;
-+      DEBUG("%s:%s[%d]\n", __FILE__, __func__, __LINE__);
-+
-+      jz_udc_set_index(dev, ep_index(ep));
-+
-+      csr = usb_readb(dev, ep->csr);
-+      DEBUG("%s: %d, csr %x\n", __FUNCTION__, ep_idx, csr);
-+
-+      if (csr & USB_INCSR_SENTSTALL) {
-+              DEBUG("USB_INCSR_SENTSTALL\n");
-+              usb_clearb(dev, ep->csr, USB_INCSR_SENTSTALL);
-+              return;
-+      }
-+
-+      if (!ep->desc) {
-+              DEBUG("%s: NO EP DESC\n", __FUNCTION__);
-+              return;
-+      }
-+
-+      if (!list_empty(&ep->queue)) {
-+              req = list_first_entry(&ep->queue, struct jz4740_request, queue);
-+              write_fifo(ep, req);
-+      }
-+}
-+
-+/*
-+ * Bulk OUT (recv)
-+ */
-+static void jz4740_out_epn(struct jz4740_udc *dev, uint32_t ep_idx, uint32_t intr)
-+{
-+      struct jz4740_ep *ep = &dev->ep[ep_idx];
-+      struct jz4740_request *req;
-+
-+      DEBUG("%s: %d\n", __FUNCTION__, ep_idx);
-+
-+      jz_udc_select_ep(ep);
-+      if (ep->desc) {
-+              uint32_t csr;
-+
-+              if (use_dma) {
-+                      /* DMA starts here ... */
-+                      if (!list_empty(&ep->queue)) {
-+                              req = list_first_entry(&ep->queue, struct jz4740_request, queue);
-+                              read_fifo(ep, req);
-+                      }
-+                      return;
-+              }
-+
-+              /*
-+               * PIO mode starts here ...
-+               */
-+
-+              while ((csr = usb_readb(dev, ep->csr)) &
-+                     (USB_OUTCSR_OUTPKTRDY | USB_OUTCSR_SENTSTALL)) {
-+                      DEBUG("%s: %x\n", __FUNCTION__, csr);
-+
-+                      if (csr & USB_OUTCSR_SENTSTALL) {
-+                              DEBUG("%s: stall sent, flush fifo\n",
-+                                    __FUNCTION__);
-+                              /* usb_set(USB_OUT_CSR1_FIFO_FLUSH, ep->csr1); */
-+                              flush(ep);
-+                      } else if (csr & USB_OUTCSR_OUTPKTRDY) {
-+                              if (list_empty(&ep->queue))
-+                                      req = 0;
-+                              else
-+                                      req =
-+                                              list_entry(ep->queue.next,
-+                                                         struct jz4740_request,
-+                                                         queue);
-+
-+                              if (!req) {
-+                                      DEBUG("%s: NULL REQ %d\n",
-+                                            __FUNCTION__, ep_idx);
-+                                      break;
-+                              } else {
-+                                      read_fifo(ep, req);
-+                              }
-+                      }
-+              }
-+      } else {
-+              /* Throw packet away.. */
-+              DEBUG("%s: ep %p ep_indx %d No descriptor?!?\n", __FUNCTION__, ep, ep_idx);
-+              flush(ep);
-+      }
-+}
-+
-+/** Halt specific EP
-+ *  Return 0 if success
-+ *  NOTE: Sets INDEX register to EP !
-+ */
-+static int jz4740_set_halt(struct usb_ep *_ep, int value)
-+{
-+      struct jz4740_udc *dev;
-+      struct jz4740_ep *ep;
-+      unsigned long flags;
-+
-+      DEBUG("%s:%s[%d]\n", __FILE__, __func__, __LINE__);
-+
-+      ep = container_of(_ep, struct jz4740_ep, ep);
-+      if (unlikely(!_ep || (!ep->desc && ep->type != ep_control))) {
-+              DEBUG("%s, bad ep\n", __FUNCTION__);
-+              return -EINVAL;
-+      }
-+
-+      dev = ep->dev;
-+
-+      spin_lock_irqsave(&dev->lock, flags);
-+
-+      jz_udc_select_ep(ep);
-+
-+      DEBUG("%s, ep %d, val %d\n", __FUNCTION__, ep_index(ep), value);
-+
-+      if (ep_index(ep) == 0) {
-+              /* EP0 */
-+              usb_setb(dev, JZ_REG_UDC_CSR0, USB_CSR0_SENDSTALL);
-+      } else if (ep_is_in(ep)) {
-+              uint32_t csr = usb_readb(dev, ep->csr);
-+              if (value && ((csr & USB_INCSR_FFNOTEMPT)
-+                            || !list_empty(&ep->queue))) {
-+                      /*
-+                       * Attempts to halt IN endpoints will fail (returning -EAGAIN)
-+                       * if any transfer requests are still queued, or if the controller
-+                       * FIFO still holds bytes that the host hasn\92t collected.
-+                       */
-+                      spin_unlock_irqrestore(&dev->lock, flags);
-+                      DEBUG
-+                          ("Attempt to halt IN endpoint failed (returning -EAGAIN) %d %d\n",
-+                           (csr & USB_INCSR_FFNOTEMPT),
-+                           !list_empty(&ep->queue));
-+                      return -EAGAIN;
-+              }
-+              flush(ep);
-+              if (value) {
-+                      usb_setb(dev, ep->csr, USB_INCSR_SENDSTALL);
-+              } else {
-+                      usb_clearb(dev, ep->csr, USB_INCSR_SENDSTALL);
-+                      usb_setb(dev, ep->csr, USB_INCSR_CDT);
-+              }
-+      } else {
-+
-+              flush(ep);
-+              if (value) {
-+                      usb_setb(dev, ep->csr, USB_OUTCSR_SENDSTALL);
-+              } else {
-+                      usb_clearb(dev, ep->csr, USB_OUTCSR_SENDSTALL);
-+                      usb_setb(dev, ep->csr, USB_OUTCSR_CDT);
-+              }
-+      }
-+
-+      ep->stopped = value;
-+
-+      spin_unlock_irqrestore(&dev->lock, flags);
-+
-+      DEBUG("%s %s halted\n", _ep->name, value == 0 ? "NOT" : "IS");
-+
-+      return 0;
-+}
-+
-+
-+static int jz4740_ep_enable(struct usb_ep *_ep,
-+                          const struct usb_endpoint_descriptor *desc)
-+{
-+      struct jz4740_ep *ep;
-+      struct jz4740_udc *dev;
-+      unsigned long flags;
-+      uint32_t max, csrh = 0;
-+
-+      DEBUG("%s: trying to enable %s\n", __FUNCTION__, _ep->name);
-+
-+      if (!_ep || !desc)
-+              return -EINVAL;
-+
-+      ep = container_of(_ep, struct jz4740_ep, ep);
-+      if (ep->desc || ep->type == ep_control
-+          || desc->bDescriptorType != USB_DT_ENDPOINT
-+          || ep->bEndpointAddress != desc->bEndpointAddress) {
-+              DEBUG("%s, bad ep or descriptor\n", __FUNCTION__);
-+              return -EINVAL;
-+      }
-+
-+      /* xfer types must match, except that interrupt ~= bulk */
-+      if (ep->bmAttributes != desc->bmAttributes
-+          && ep->bmAttributes != USB_ENDPOINT_XFER_BULK
-+          && desc->bmAttributes != USB_ENDPOINT_XFER_INT) {
-+              DEBUG("%s, %s type mismatch\n", __FUNCTION__, _ep->name);
-+              return -EINVAL;
-+      }
-+
-+      dev = ep->dev;
-+      if (!dev->driver || dev->gadget.speed == USB_SPEED_UNKNOWN) {
-+              DEBUG("%s, bogus device state\n", __FUNCTION__);
-+              return -ESHUTDOWN;
-+      }
-+
-+      max = le16_to_cpu(desc->wMaxPacketSize);
-+
-+      spin_lock_irqsave(&ep->dev->lock, flags);
-+
-+      /* Configure the endpoint */
-+      jz_udc_select_ep(ep);
-+      if (ep_is_in(ep)) {
-+              usb_writew(dev, JZ_REG_UDC_INMAXP, max);
-+              switch (desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) {
-+              case USB_ENDPOINT_XFER_BULK:
-+              case USB_ENDPOINT_XFER_INT:
-+                      csrh &= ~USB_INCSRH_ISO;
-+                      break;
-+              case USB_ENDPOINT_XFER_ISOC:
-+                      csrh |= USB_INCSRH_ISO;
-+                      break;
-+              }
-+              usb_writeb(dev, JZ_REG_UDC_INCSRH, csrh);
-+      }
-+      else {
-+              usb_writew(dev, JZ_REG_UDC_OUTMAXP, max);
-+              switch (desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) {
-+              case USB_ENDPOINT_XFER_BULK:
-+                       csrh &= ~USB_OUTCSRH_ISO;
-+                      break;
-+              case USB_ENDPOINT_XFER_INT:
-+                      csrh &= ~USB_OUTCSRH_ISO;
-+                      csrh |= USB_OUTCSRH_DNYT;
-+                      break;
-+              case USB_ENDPOINT_XFER_ISOC:
-+                      csrh |= USB_OUTCSRH_ISO;
-+                      break;
-+              }
-+              usb_writeb(dev, JZ_REG_UDC_OUTCSRH, csrh);
-+      }
-+
-+
-+      ep->stopped = 0;
-+      ep->desc = desc;
-+      ep->ep.maxpacket = max;
-+
-+      spin_unlock_irqrestore(&ep->dev->lock, flags);
-+
-+      /* Reset halt state (does flush) */
-+      jz4740_set_halt(_ep, 0);
-+
-+      DEBUG("%s: enabled %s\n", __FUNCTION__, _ep->name);
-+
-+      return 0;
-+}
-+
-+/** Disable EP
-+ *  NOTE: Sets INDEX register
-+ */
-+static int jz4740_ep_disable(struct usb_ep *_ep)
-+{
-+      struct jz4740_ep *ep;
-+      unsigned long flags;
-+
-+      DEBUG("%s, %p\n", __FUNCTION__, _ep);
-+
-+      ep = container_of(_ep, struct jz4740_ep, ep);
-+      if (!_ep || !ep->desc) {
-+              DEBUG("%s, %s not enabled\n", __FUNCTION__,
-+                    _ep ? ep->ep.name : NULL);
-+              return -EINVAL;
-+      }
-+
-+      spin_lock_irqsave(&ep->dev->lock, flags);
-+
-+      jz_udc_select_ep(ep);
-+
-+      /* Nuke all pending requests (does flush) */
-+      nuke(ep, -ESHUTDOWN);
-+
-+      /* Disable ep IRQ */
-+      pio_irq_disable(ep);
-+
-+      ep->desc = 0;
-+      ep->stopped = 1;
-+
-+      spin_unlock_irqrestore(&ep->dev->lock, flags);
-+
-+      DEBUG("%s: disabled %s\n", __FUNCTION__, _ep->name);
-+      return 0;
-+}
-+
-+static struct usb_request *jz4740_alloc_request(struct usb_ep *ep, gfp_t gfp_flags)
-+{
-+      struct jz4740_request *req;
-+
-+      req = kzalloc(sizeof(*req), gfp_flags);
-+      if (!req)
-+              return NULL;
-+
-+      INIT_LIST_HEAD(&req->queue);
-+
-+      return &req->req;
-+}
-+
-+static void jz4740_free_request(struct usb_ep *ep, struct usb_request *_req)
-+{
-+      struct jz4740_request *req;
-+
-+      DEBUG("%s, %p\n", __FUNCTION__, ep);
-+
-+      req = container_of(_req, struct jz4740_request, req);
-+      WARN_ON(!list_empty(&req->queue));
-+      kfree(req);
-+}
-+
-+/*--------------------------------------------------------------------*/
-+
-+/** Queue one request
-+ *  Kickstart transfer if needed
-+ *  NOTE: Sets INDEX register
-+ */
-+static int jz4740_queue(struct usb_ep *_ep, struct usb_request *_req,
-+                      gfp_t gfp_flags)
-+{
-+      struct jz4740_request *req;
-+      struct jz4740_ep *ep;
-+      struct jz4740_udc *dev;
-+
-+      DEBUG("%s, %p\n", __FUNCTION__, _ep);
-+
-+      req = container_of(_req, struct jz4740_request, req);
-+      if (unlikely
-+          (!_req || !_req->complete || !_req->buf
-+           || !list_empty(&req->queue))) {
-+              DEBUG("%s, bad params\n", __FUNCTION__);
-+              return -EINVAL;
-+      }
-+
-+      ep = container_of(_ep, struct jz4740_ep, ep);
-+      if (unlikely(!_ep || (!ep->desc && ep->type != ep_control))) {
-+              DEBUG("%s, bad ep\n", __FUNCTION__);
-+              return -EINVAL;
-+      }
-+
-+      dev = ep->dev;
-+      if (unlikely(!dev->driver || dev->gadget.speed == USB_SPEED_UNKNOWN)) {
-+              DEBUG("%s, bogus device state %p\n", __FUNCTION__, dev->driver);
-+              return -ESHUTDOWN;
-+      }
-+
-+      DEBUG("%s queue req %p, len %d buf %p\n", _ep->name, _req, _req->length,
-+            _req->buf);
-+
-+      spin_lock_irqsave(&dev->lock, dev->lock_flags);
-+
-+      _req->status = -EINPROGRESS;
-+      _req->actual = 0;
-+
-+      /* kickstart this i/o queue? */
-+      DEBUG("Add to %d Q %d %d\n", ep_index(ep), list_empty(&ep->queue),
-+            ep->stopped);
-+      if (list_empty(&ep->queue) && likely(!ep->stopped)) {
-+              uint32_t csr;
-+
-+              if (unlikely(ep_index(ep) == 0)) {
-+                      /* EP0 */
-+                      list_add_tail(&req->queue, &ep->queue);
-+                      jz4740_ep0_kick(dev, ep);
-+                      req = 0;
-+              } else if (use_dma) {
-+                      /* DMA */
-+                      kick_dma(ep, req);
-+              }
-+              /* PIO */
-+              else if (ep_is_in(ep)) {
-+                      /* EP1 & EP2 */
-+                      jz_udc_select_ep(ep);
-+                      csr = usb_readb(dev, ep->csr);
-+                      pio_irq_enable(ep);
-+                      if (!(csr & USB_INCSR_FFNOTEMPT)) {
-+                              if (write_fifo(ep, req) == 1)
-+                                      req = 0;
-+                      }
-+              } else {
-+                      /* EP1 */
-+                      jz_udc_select_ep(ep);
-+                      csr = usb_readb(dev, ep->csr);
-+                      pio_irq_enable(ep);
-+                      if (csr & USB_OUTCSR_OUTPKTRDY) {
-+                              if (read_fifo(ep, req) == 1)
-+                                      req = 0;
-+                      }
-+              }
-+      }
-+
-+      /* pio or dma irq handler advances the queue. */
-+      if (likely(req != 0))
-+              list_add_tail(&req->queue, &ep->queue);
-+
-+      spin_unlock_irqrestore(&dev->lock, dev->lock_flags);
-+
-+      return 0;
-+}
-+
-+/* dequeue JUST ONE request */
-+static int jz4740_dequeue(struct usb_ep *_ep, struct usb_request *_req)
-+{
-+      struct jz4740_ep *ep;
-+      struct jz4740_request *req;
-+      unsigned long flags;
-+
-+      DEBUG("%s, %p\n", __FUNCTION__, _ep);
-+
-+      ep = container_of(_ep, struct jz4740_ep, ep);
-+      if (!_ep || ep->type == ep_control)
-+              return -EINVAL;
-+
-+      spin_lock_irqsave(&ep->dev->lock, flags);
-+
-+      /* make sure it's actually queued on this endpoint */
-+      list_for_each_entry(req, &ep->queue, queue) {
-+              if (&req->req == _req)
-+                      break;
-+      }
-+      if (&req->req != _req) {
-+              spin_unlock_irqrestore(&ep->dev->lock, flags);
-+              return -EINVAL;
-+      }
-+      done(ep, req, -ECONNRESET);
-+
-+      spin_unlock_irqrestore(&ep->dev->lock, flags);
-+      return 0;
-+}
-+
-+/** Return bytes in EP FIFO
-+ *  NOTE: Sets INDEX register to EP
-+ */
-+static int jz4740_fifo_status(struct usb_ep *_ep)
-+{
-+      uint32_t csr;
-+      int count = 0;
-+      struct jz4740_ep *ep;
-+      unsigned long flags;
-+
-+      ep = container_of(_ep, struct jz4740_ep, ep);
-+      if (!_ep) {
-+              DEBUG("%s, bad ep\n", __FUNCTION__);
-+              return -ENODEV;
-+      }
-+
-+      DEBUG("%s, %d\n", __FUNCTION__, ep_index(ep));
-+
-+      /* LPD can't report unclaimed bytes from IN fifos */
-+      if (ep_is_in(ep))
-+              return -EOPNOTSUPP;
-+
-+      spin_lock_irqsave(&ep->dev->lock, flags);
-+      jz_udc_select_ep(ep);
-+
-+      csr = usb_readb(ep->dev, ep->csr);
-+      if (ep->dev->gadget.speed != USB_SPEED_UNKNOWN ||
-+          csr & 0x1) {
-+              count = usb_readw(ep->dev, JZ_REG_UDC_OUTCOUNT);
-+      }
-+
-+      spin_unlock_irqrestore(&ep->dev->lock, flags);
-+
-+      return count;
-+}
-+
-+/** Flush EP FIFO
-+ *  NOTE: Sets INDEX register to EP
-+ */
-+static void jz4740_fifo_flush(struct usb_ep *_ep)
-+{
-+      struct jz4740_ep *ep;
-+      unsigned long flags;
-+
-+      DEBUG("%s:%s[%d]\n", __FILE__, __func__, __LINE__);
-+
-+      ep = container_of(_ep, struct jz4740_ep, ep);
-+      if (unlikely(!_ep || (!ep->desc && ep->type == ep_control))) {
-+              DEBUG("%s, bad ep\n", __FUNCTION__);
-+              return;
-+      }
-+
-+      spin_lock_irqsave(&ep->dev->lock, flags);
-+
-+      jz_udc_select_ep(ep);
-+      flush(ep);
-+
-+      spin_unlock_irqrestore(&ep->dev->lock, flags);
-+}
-+
-+/****************************************************************/
-+/* End Point 0 related functions                                */
-+/****************************************************************/
-+
-+/* return:  0 = still running, 1 = completed, negative = errno */
-+static int write_fifo_ep0(struct jz4740_ep *ep, struct jz4740_request *req)
-+{
-+      uint32_t max;
-+      unsigned count;
-+      int is_last;
-+
-+    DEBUG("%s:%s[%d]\n", __FILE__, __func__, __LINE__);
-+      max = ep_maxpacket(ep);
-+
-+      count = write_packet(ep, req, max);
-+
-+      /* last packet is usually short (or a zlp) */
-+      if (unlikely(count != max))
-+              is_last = 1;
-+      else {
-+              if (likely(req->req.length != req->req.actual) || req->req.zero)
-+                      is_last = 0;
-+              else
-+                      is_last = 1;
-+      }
-+
-+      DEBUG_EP0("%s: wrote %s %d bytes%s %d left %p\n", __FUNCTION__,
-+                ep->ep.name, count,
-+                is_last ? "/L" : "", req->req.length - req->req.actual, req);
-+
-+      /* requests complete when all IN data is in the FIFO */
-+      if (is_last) {
-+              done(ep, req, 0);
-+              return 1;
-+      }
-+
-+      return 0;
-+}
-+
-+static inline int jz4740_fifo_read(struct jz4740_ep *ep,
-+                                     unsigned char *cp, int max)
-+{
-+      int bytes;
-+      int count = usb_readw(ep->dev, JZ_REG_UDC_OUTCOUNT);
-+
-+      if (count > max)
-+              count = max;
-+      bytes = count;
-+      while (count--)
-+              *cp++ = usb_readb(ep->dev, ep->fifo);
-+
-+      return bytes;
-+}
-+
-+static inline void jz4740_fifo_write(struct jz4740_ep *ep,
-+                                       unsigned char *cp, int count)
-+{
-+      DEBUG("fifo_write: %d %d\n", ep_index(ep), count);
-+      while (count--)
-+              usb_writeb(ep->dev, ep->fifo, *cp++);
-+}
-+
-+static int read_fifo_ep0(struct jz4740_ep *ep, struct jz4740_request *req)
-+{
-+      struct jz4740_udc *dev = ep->dev;
-+      uint32_t csr;
-+      uint8_t *buf;
-+      unsigned bufferspace, count, is_short;
-+
-+      DEBUG_EP0("%s\n", __FUNCTION__);
-+
-+      csr = usb_readb(dev, JZ_REG_UDC_CSR0);
-+      if (!(csr & USB_CSR0_OUTPKTRDY))
-+              return 0;
-+
-+      buf = req->req.buf + req->req.actual;
-+      prefetchw(buf);
-+      bufferspace = req->req.length - req->req.actual;
-+
-+      /* read all bytes from this packet */
-+      if (likely(csr & USB_CSR0_OUTPKTRDY)) {
-+              count = usb_readw(dev, JZ_REG_UDC_OUTCOUNT);
-+              req->req.actual += min(count, bufferspace);
-+      } else                  /* zlp */
-+              count = 0;
-+
-+      is_short = (count < ep->ep.maxpacket);
-+      DEBUG_EP0("read %s %02x, %d bytes%s req %p %d/%d\n",
-+                ep->ep.name, csr, count,
-+                is_short ? "/S" : "", req, req->req.actual, req->req.length);
-+
-+      while (likely(count-- != 0)) {
-+              uint8_t byte = (uint8_t)usb_readl(dev, ep->fifo);
-+
-+              if (unlikely(bufferspace == 0)) {
-+                      /* this happens when the driver's buffer
-+                       * is smaller than what the host sent.
-+                       * discard the extra data.
-+                       */
-+                      if (req->req.status != -EOVERFLOW)
-+                              DEBUG_EP0("%s overflow %d\n", ep->ep.name,
-+                                        count);
-+                      req->req.status = -EOVERFLOW;
-+              } else {
-+                      *buf++ = byte;
-+                      bufferspace--;
-+              }
-+      }
-+
-+      /* completion */
-+      if (is_short || req->req.actual == req->req.length) {
-+              done(ep, req, 0);
-+              return 1;
-+      }
-+
-+      /* finished that packet.  the next one may be waiting... */
-+      return 0;
-+}
-+
-+/**
-+ * udc_set_address - set the USB address for this device
-+ * @address:
-+ *
-+ * Called from control endpoint function after it decodes a set address setup packet.
-+ */
-+static void udc_set_address(struct jz4740_udc *dev, unsigned char address)
-+{
-+      DEBUG_EP0("%s: %d\n", __FUNCTION__, address);
-+
-+      usb_writeb(dev, JZ_REG_UDC_FADDR, address);
-+}
-+
-+/*
-+ * DATA_STATE_RECV (USB_CSR0_OUTPKTRDY)
-+ *      - if error
-+ *              set USB_CSR0_SVDOUTPKTRDY | USB_CSR0_DATAEND | USB_CSR0_SENDSTALL bits
-+ *      - else
-+ *              set USB_CSR0_SVDOUTPKTRDY bit
-+                              if last set USB_CSR0_DATAEND bit
-+ */
-+static void jz4740_ep0_out(struct jz4740_udc *dev, uint32_t csr, int kickstart)
-+{
-+      struct jz4740_request *req;
-+      struct jz4740_ep *ep = &dev->ep[0];
-+      int ret;
-+
-+      DEBUG_EP0("%s: %x\n", __FUNCTION__, csr);
-+
-+      if (list_empty(&ep->queue))
-+              req = 0;
-+      else
-+              req = list_entry(ep->queue.next, struct jz4740_request, queue);
-+
-+      if (req) {
-+              if (req->req.length == 0) {
-+                      DEBUG_EP0("ZERO LENGTH OUT!\n");
-+                      usb_setb(dev, JZ_REG_UDC_CSR0, (USB_CSR0_SVDOUTPKTRDY | USB_CSR0_DATAEND));
-+                      dev->ep0state = WAIT_FOR_SETUP;
-+                      return;
-+              } else if (kickstart) {
-+                      usb_setb(dev, JZ_REG_UDC_CSR0, (USB_CSR0_SVDOUTPKTRDY));
-+                      return;
-+              }
-+              ret = read_fifo_ep0(ep, req);
-+              if (ret) {
-+                      /* Done! */
-+                      DEBUG_EP0("%s: finished, waiting for status\n",
-+                                __FUNCTION__);
-+                      usb_setb(dev, JZ_REG_UDC_CSR0, (USB_CSR0_SVDOUTPKTRDY | USB_CSR0_DATAEND));
-+                      dev->ep0state = WAIT_FOR_SETUP;
-+              } else {
-+                      /* Not done yet.. */
-+                      DEBUG_EP0("%s: not finished\n", __FUNCTION__);
-+                      usb_setb(dev, JZ_REG_UDC_CSR0, USB_CSR0_SVDOUTPKTRDY);
-+              }
-+      } else {
-+              DEBUG_EP0("NO REQ??!\n");
-+      }
-+}
-+
-+/*
-+ * DATA_STATE_XMIT
-+ */
-+static int jz4740_ep0_in(struct jz4740_udc *dev, uint32_t csr)
-+{
-+      struct jz4740_request *req;
-+      struct jz4740_ep *ep = &dev->ep[0];
-+      int ret, need_zlp = 0;
-+
-+      DEBUG_EP0("%s: %x\n", __FUNCTION__, csr);
-+
-+      if (list_empty(&ep->queue))
-+              req = 0;
-+      else
-+              req = list_entry(ep->queue.next, struct jz4740_request, queue);
-+
-+      if (!req) {
-+              DEBUG_EP0("%s: NULL REQ\n", __FUNCTION__);
-+              return 0;
-+      }
-+
-+      if (req->req.length == 0) {
-+              usb_setb(dev, JZ_REG_UDC_CSR0, (USB_CSR0_INPKTRDY | USB_CSR0_DATAEND));
-+              dev->ep0state = WAIT_FOR_SETUP;
-+              return 1;
-+      }
-+
-+      if (req->req.length - req->req.actual == EP0_MAXPACKETSIZE) {
-+              /* Next write will end with the packet size, */
-+              /* so we need zero-length-packet */
-+              need_zlp = 1;
-+      }
-+
-+      ret = write_fifo_ep0(ep, req);
-+
-+      if (ret == 1 && !need_zlp) {
-+              /* Last packet */
-+              DEBUG_EP0("%s: finished, waiting for status\n", __FUNCTION__);
-+
-+              usb_setb(dev, JZ_REG_UDC_CSR0, (USB_CSR0_INPKTRDY | USB_CSR0_DATAEND));
-+              dev->ep0state = WAIT_FOR_SETUP;
-+      } else {
-+              DEBUG_EP0("%s: not finished\n", __FUNCTION__);
-+              usb_setb(dev, JZ_REG_UDC_CSR0, USB_CSR0_INPKTRDY);
-+      }
-+
-+      if (need_zlp) {
-+              DEBUG_EP0("%s: Need ZLP!\n", __FUNCTION__);
-+              usb_setb(dev, JZ_REG_UDC_CSR0, USB_CSR0_INPKTRDY);
-+              dev->ep0state = DATA_STATE_NEED_ZLP;
-+      }
-+
-+      return 1;
-+}
-+
-+static int jz4740_handle_get_status(struct jz4740_udc *dev,
-+                                  struct usb_ctrlrequest *ctrl)
-+{
-+      struct jz4740_ep *ep0 = &dev->ep[0];
-+      struct jz4740_ep *qep;
-+      int reqtype = (ctrl->bRequestType & USB_RECIP_MASK);
-+      uint16_t val = 0;
-+
-+    DEBUG("%s:%s[%d]\n", __FILE__, __func__, __LINE__);
-+
-+      if (reqtype == USB_RECIP_INTERFACE) {
-+              /* This is not supported.
-+               * And according to the USB spec, this one does nothing..
-+               * Just return 0
-+               */
-+              DEBUG_SETUP("GET_STATUS: USB_RECIP_INTERFACE\n");
-+      } else if (reqtype == USB_RECIP_DEVICE) {
-+              DEBUG_SETUP("GET_STATUS: USB_RECIP_DEVICE\n");
-+              val |= (1 << 0);        /* Self powered */
-+              /*val |= (1<<1); *//* Remote wakeup */
-+      } else if (reqtype == USB_RECIP_ENDPOINT) {
-+              int ep_num = (ctrl->wIndex & ~USB_DIR_IN);
-+
-+              DEBUG_SETUP
-+                      ("GET_STATUS: USB_RECIP_ENDPOINT (%d), ctrl->wLength = %d\n",
-+                       ep_num, ctrl->wLength);
-+
-+              if (ctrl->wLength > 2 || ep_num > 3)
-+                      return -EOPNOTSUPP;
-+
-+              qep = &dev->ep[ep_num];
-+              if (ep_is_in(qep) != ((ctrl->wIndex & USB_DIR_IN) ? 1 : 0)
-+                  && ep_index(qep) != 0) {
-+                      return -EOPNOTSUPP;
-+              }
-+
-+              jz_udc_set_index(dev, ep_index(qep));
-+
-+              /* Return status on next IN token */
-+              switch (qep->type) {
-+              case ep_control:
-+                      val =
-+                          (usb_readb(dev, qep->csr) & USB_CSR0_SENDSTALL) ==
-+                          USB_CSR0_SENDSTALL;
-+                      break;
-+              case ep_bulk_in:
-+              case ep_interrupt:
-+                      val =
-+                          (usb_readb(dev, qep->csr) & USB_INCSR_SENDSTALL) ==
-+                          USB_INCSR_SENDSTALL;
-+                      break;
-+              case ep_bulk_out:
-+                      val =
-+                          (usb_readb(dev, qep->csr) & USB_OUTCSR_SENDSTALL) ==
-+                          USB_OUTCSR_SENDSTALL;
-+                      break;
-+              }
-+
-+              /* Back to EP0 index */
-+              jz_udc_set_index(dev, 0);
-+
-+              DEBUG_SETUP("GET_STATUS, ep: %d (%x), val = %d\n", ep_num,
-+                          ctrl->wIndex, val);
-+      } else {
-+              DEBUG_SETUP("Unknown REQ TYPE: %d\n", reqtype);
-+              return -EOPNOTSUPP;
-+      }
-+
-+      /* Clear "out packet ready" */
-+      usb_setb(dev, JZ_REG_UDC_CSR0, USB_CSR0_SVDOUTPKTRDY);
-+      /* Put status to FIFO */
-+      jz4740_fifo_write(ep0, (uint8_t *)&val, sizeof(val));
-+      /* Issue "In packet ready" */
-+      usb_setb(dev, JZ_REG_UDC_CSR0, (USB_CSR0_INPKTRDY | USB_CSR0_DATAEND));
-+
-+      return 0;
-+}
-+
-+/*
-+ * WAIT_FOR_SETUP (OUTPKTRDY)
-+ *      - read data packet from EP0 FIFO
-+ *      - decode command
-+ *      - if error
-+ *              set USB_CSR0_SVDOUTPKTRDY | USB_CSR0_DATAEND | USB_CSR0_SENDSTALL bits
-+ *      - else
-+ *              set USB_CSR0_SVDOUTPKTRDY | USB_CSR0_DATAEND bits
-+ */
-+static void jz4740_ep0_setup(struct jz4740_udc *dev, uint32_t csr)
-+{
-+      struct jz4740_ep *ep = &dev->ep[0];
-+      struct usb_ctrlrequest ctrl;
-+      int i;
-+
-+      DEBUG_SETUP("%s: %x\n", __FUNCTION__, csr);
-+
-+      /* Nuke all previous transfers */
-+      nuke(ep, -EPROTO);
-+
-+      /* read control req from fifo (8 bytes) */
-+      jz4740_fifo_read(ep, (unsigned char *)&ctrl, 8);
-+
-+      DEBUG_SETUP("SETUP %02x.%02x v%04x i%04x l%04x\n",
-+                  ctrl.bRequestType, ctrl.bRequest,
-+                  ctrl.wValue, ctrl.wIndex, ctrl.wLength);
-+
-+      /* Set direction of EP0 */
-+      if (likely(ctrl.bRequestType & USB_DIR_IN)) {
-+              ep->bEndpointAddress |= USB_DIR_IN;
-+      } else {
-+              ep->bEndpointAddress &= ~USB_DIR_IN;
-+      }
-+
-+      /* Handle some SETUP packets ourselves */
-+      switch (ctrl.bRequest) {
-+      case USB_REQ_SET_ADDRESS:
-+              if (ctrl.bRequestType != (USB_TYPE_STANDARD | USB_RECIP_DEVICE))
-+                      break;
-+
-+              DEBUG_SETUP("USB_REQ_SET_ADDRESS (%d)\n", ctrl.wValue);
-+              udc_set_address(dev, ctrl.wValue);
-+              usb_setb(dev, JZ_REG_UDC_CSR0, (USB_CSR0_SVDOUTPKTRDY | USB_CSR0_DATAEND));
-+              return;
-+
-+      case USB_REQ_SET_CONFIGURATION:
-+              if (ctrl.bRequestType != (USB_TYPE_STANDARD | USB_RECIP_DEVICE))
-+                      break;
-+
-+              DEBUG_SETUP("USB_REQ_SET_CONFIGURATION (%d)\n", ctrl.wValue);
-+/*            usb_setb(JZ_REG_UDC_CSR0, (USB_CSR0_SVDOUTPKTRDY | USB_CSR0_DATAEND));*/
-+
-+              /* Enable RESUME and SUSPEND interrupts */
-+              usb_setb(dev, JZ_REG_UDC_INTRUSBE, (USB_INTR_RESUME | USB_INTR_SUSPEND));
-+              break;
-+
-+      case USB_REQ_SET_INTERFACE:
-+              if (ctrl.bRequestType != (USB_TYPE_STANDARD | USB_RECIP_DEVICE))
-+                      break;
-+
-+              DEBUG_SETUP("USB_REQ_SET_INTERFACE (%d)\n", ctrl.wValue);
-+/*            usb_setb(JZ_REG_UDC_CSR0, (USB_CSR0_SVDOUTPKTRDY | USB_CSR0_DATAEND));*/
-+              break;
-+
-+      case USB_REQ_GET_STATUS:
-+              if (jz4740_handle_get_status(dev, &ctrl) == 0)
-+                      return;
-+
-+      case USB_REQ_CLEAR_FEATURE:
-+      case USB_REQ_SET_FEATURE:
-+              if (ctrl.bRequestType == USB_RECIP_ENDPOINT) {
-+                      struct jz4740_ep *qep;
-+                      int ep_num = (ctrl.wIndex & 0x0f);
-+
-+                      /* Support only HALT feature */
-+                      if (ctrl.wValue != 0 || ctrl.wLength != 0
-+                          || ep_num > 3 || ep_num < 1)
-+                              break;
-+
-+                      qep = &dev->ep[ep_num];
-+                      spin_unlock(&dev->lock);
-+                      if (ctrl.bRequest == USB_REQ_SET_FEATURE) {
-+                              DEBUG_SETUP("SET_FEATURE (%d)\n",
-+                                          ep_num);
-+                              jz4740_set_halt(&qep->ep, 1);
-+                      } else {
-+                              DEBUG_SETUP("CLR_FEATURE (%d)\n",
-+                                          ep_num);
-+                              jz4740_set_halt(&qep->ep, 0);
-+                      }
-+                      spin_lock(&dev->lock);
-+
-+                      jz_udc_set_index(dev, 0);
-+
-+                      /* Reply with a ZLP on next IN token */
-+                      usb_setb(dev, JZ_REG_UDC_CSR0,
-+                               (USB_CSR0_SVDOUTPKTRDY | USB_CSR0_DATAEND));
-+                      return;
-+              }
-+              break;
-+
-+      default:
-+              break;
-+      }
-+
-+      /* gadget drivers see class/vendor specific requests,
-+       * {SET,GET}_{INTERFACE,DESCRIPTOR,CONFIGURATION},
-+       * and more.
-+       */
-+      if (dev->driver) {
-+              /* device-2-host (IN) or no data setup command, process immediately */
-+              spin_unlock(&dev->lock);
-+
-+              i = dev->driver->setup(&dev->gadget, &ctrl);
-+              spin_lock(&dev->lock);
-+
-+              if (unlikely(i < 0)) {
-+                      /* setup processing failed, force stall */
-+                      DEBUG_SETUP
-+                          ("  --> ERROR: gadget setup FAILED (stalling), setup returned %d\n",
-+                           i);
-+                      jz_udc_set_index(dev, 0);
-+                      usb_setb(dev, JZ_REG_UDC_CSR0, (USB_CSR0_SVDOUTPKTRDY | USB_CSR0_DATAEND | USB_CSR0_SENDSTALL));
-+
-+                      /* ep->stopped = 1; */
-+                      dev->ep0state = WAIT_FOR_SETUP;
-+              }
-+              else {
-+                      DEBUG_SETUP("gadget driver setup ok (%d)\n", ctrl.wLength);
-+/*                    if (!ctrl.wLength) {
-+                              usb_setb(JZ_REG_UDC_CSR0, USB_CSR0_SVDOUTPKTRDY);
-+                      }*/
-+              }
-+      }
-+}
-+
-+/*
-+ * DATA_STATE_NEED_ZLP
-+ */
-+static void jz4740_ep0_in_zlp(struct jz4740_udc *dev, uint32_t csr)
-+{
-+      DEBUG_EP0("%s: %x\n", __FUNCTION__, csr);
-+
-+      usb_setb(dev, JZ_REG_UDC_CSR0, (USB_CSR0_INPKTRDY | USB_CSR0_DATAEND));
-+      dev->ep0state = WAIT_FOR_SETUP;
-+}
-+
-+/*
-+ * handle ep0 interrupt
-+ */
-+static void jz4740_handle_ep0(struct jz4740_udc *dev, uint32_t intr)
-+{
-+      struct jz4740_ep *ep = &dev->ep[0];
-+      uint32_t csr;
-+
-+    DEBUG("%s:%s[%d]\n", __FILE__, __func__, __LINE__);
-+      /* Set index 0 */
-+      jz_udc_set_index(dev, 0);
-+      csr = usb_readb(dev, JZ_REG_UDC_CSR0);
-+
-+      DEBUG_EP0("%s: csr = %x  state = \n", __FUNCTION__, csr);//, state_names[dev->ep0state]);
-+
-+      /*
-+       * if SENT_STALL is set
-+       *      - clear the SENT_STALL bit
-+       */
-+      if (csr & USB_CSR0_SENTSTALL) {
-+              DEBUG_EP0("%s: USB_CSR0_SENTSTALL is set: %x\n", __FUNCTION__, csr);
-+              usb_clearb(dev, JZ_REG_UDC_CSR0, USB_CSR0_SENDSTALL | USB_CSR0_SENTSTALL);
-+              nuke(ep, -ECONNABORTED);
-+              dev->ep0state = WAIT_FOR_SETUP;
-+              return;
-+      }
-+
-+      /*
-+       * if a transfer is in progress && INPKTRDY and OUTPKTRDY are clear
-+       *      - fill EP0 FIFO
-+       *      - if last packet
-+       *      -       set IN_PKT_RDY | DATA_END
-+       *      - else
-+       *              set IN_PKT_RDY
-+       */
-+      if (!(csr & (USB_CSR0_INPKTRDY | USB_CSR0_OUTPKTRDY))) {
-+              DEBUG_EP0("%s: INPKTRDY and OUTPKTRDY are clear\n",
-+                        __FUNCTION__);
-+
-+              switch (dev->ep0state) {
-+              case DATA_STATE_XMIT:
-+                      DEBUG_EP0("continue with DATA_STATE_XMIT\n");
-+                      jz4740_ep0_in(dev, csr);
-+                      return;
-+              case DATA_STATE_NEED_ZLP:
-+                      DEBUG_EP0("continue with DATA_STATE_NEED_ZLP\n");
-+                      jz4740_ep0_in_zlp(dev, csr);
-+                      return;
-+              default:
-+                      /* Stall? */
-+//                    DEBUG_EP0("Odd state!! state = %s\n",
-+//                              state_names[dev->ep0state]);
-+                      dev->ep0state = WAIT_FOR_SETUP;
-+                      /* nuke(ep, 0); */
-+                      /* usb_setb(ep->csr, USB_CSR0_SENDSTALL); */
-+//                    break;
-+                      return;
-+              }
-+      }
-+
-+      /*
-+       * if SETUPEND is set
-+       *      - abort the last transfer
-+       *      - set SERVICED_SETUP_END_BIT
-+       */
-+      if (csr & USB_CSR0_SETUPEND) {
-+              DEBUG_EP0("%s: USB_CSR0_SETUPEND is set: %x\n", __FUNCTION__, csr);
-+
-+              usb_setb(dev, JZ_REG_UDC_CSR0, USB_CSR0_SVDSETUPEND);
-+              nuke(ep, 0);
-+              dev->ep0state = WAIT_FOR_SETUP;
-+      }
-+
-+      /*
-+       * if USB_CSR0_OUTPKTRDY is set
-+       *      - read data packet from EP0 FIFO
-+       *      - decode command
-+       *      - if error
-+       *              set SVDOUTPKTRDY | DATAEND | SENDSTALL bits
-+       *      - else
-+       *              set SVDOUTPKTRDY | DATAEND bits
-+       */
-+      if (csr & USB_CSR0_OUTPKTRDY) {
-+
-+              DEBUG_EP0("%s: EP0_OUT_PKT_RDY is set: %x\n", __FUNCTION__,
-+                        csr);
-+
-+              switch (dev->ep0state) {
-+              case WAIT_FOR_SETUP:
-+                      DEBUG_EP0("WAIT_FOR_SETUP\n");
-+                      jz4740_ep0_setup(dev, csr);
-+                      break;
-+
-+              case DATA_STATE_RECV:
-+                      DEBUG_EP0("DATA_STATE_RECV\n");
-+                      jz4740_ep0_out(dev, csr, 0);
-+                      break;
-+
-+              default:
-+                      /* send stall? */
-+                      DEBUG_EP0("strange state!! 2. send stall? state = %d\n",
-+                                dev->ep0state);
-+                      break;
-+              }
-+      }
-+}
-+
-+static void jz4740_ep0_kick(struct jz4740_udc *dev, struct jz4740_ep *ep)
-+{
-+      uint32_t csr;
-+
-+      jz_udc_set_index(dev, 0);
-+
-+      DEBUG_EP0("%s: %x\n", __FUNCTION__, csr);
-+
-+      /* Clear "out packet ready" */
-+
-+      if (ep_is_in(ep)) {
-+              usb_setb(dev, JZ_REG_UDC_CSR0, USB_CSR0_SVDOUTPKTRDY);
-+              csr = usb_readb(dev, JZ_REG_UDC_CSR0);
-+              dev->ep0state = DATA_STATE_XMIT;
-+              jz4740_ep0_in(dev, csr);
-+      } else {
-+              csr = usb_readb(dev, JZ_REG_UDC_CSR0);
-+              dev->ep0state = DATA_STATE_RECV;
-+              jz4740_ep0_out(dev, csr, 1);
-+      }
-+}
-+
-+/** Handle USB RESET interrupt
-+ */
-+static void jz4740_reset_irq(struct jz4740_udc *dev)
-+{
-+      dev->gadget.speed = (usb_readb(dev, JZ_REG_UDC_POWER) & USB_POWER_HSMODE) ?
-+              USB_SPEED_HIGH : USB_SPEED_FULL;
-+
-+      DEBUG_SETUP("%s: address = %d, speed = %s\n", __FUNCTION__, 0,
-+                  (dev->gadget.speed == USB_SPEED_HIGH) ? "HIGH":"FULL" );
-+}
-+
-+/*
-+ *    jz4740 usb device interrupt handler.
-+ */
-+static irqreturn_t jz4740_udc_irq(int irq, void *devid)
-+{
-+      struct jz4740_udc *jz4740_udc = devid;
-+      uint8_t index;
-+
-+      uint32_t intr_usb = usb_readb(jz4740_udc, JZ_REG_UDC_INTRUSB) & 0x7; /* mask SOF */
-+      uint32_t intr_in  = usb_readw(jz4740_udc, JZ_REG_UDC_INTRIN);
-+      uint32_t intr_out = usb_readw(jz4740_udc, JZ_REG_UDC_INTROUT);
-+      uint32_t intr_dma = usb_readb(jz4740_udc, JZ_REG_UDC_INTR);
-+
-+      if (!intr_usb && !intr_in && !intr_out && !intr_dma)
-+              return IRQ_HANDLED;
-+
-+
-+      DEBUG("intr_out=%x intr_in=%x intr_usb=%x\n",
-+            intr_out, intr_in, intr_usb);
-+
-+      spin_lock(&jz4740_udc->lock);
-+      index = usb_readb(jz4740_udc, JZ_REG_UDC_INDEX);
-+
-+      /* Check for resume from suspend mode */
-+      if ((intr_usb & USB_INTR_RESUME) &&
-+          (usb_readb(jz4740_udc, JZ_REG_UDC_INTRUSBE) & USB_INTR_RESUME)) {
-+              DEBUG("USB resume\n");
-+              jz4740_udc->driver->resume(&jz4740_udc->gadget); /* We have suspend(), so we must have resume() too. */
-+      }
-+
-+      /* Check for system interrupts */
-+      if (intr_usb & USB_INTR_RESET) {
-+              DEBUG("USB reset\n");
-+              jz4740_reset_irq(jz4740_udc);
-+      }
-+
-+      /* Check for endpoint 0 interrupt */
-+      if (intr_in & USB_INTR_EP0) {
-+              DEBUG("USB_INTR_EP0 (control)\n");
-+              jz4740_handle_ep0(jz4740_udc, intr_in);
-+      }
-+
-+      /* Check for Bulk-IN DMA interrupt */
-+      if (intr_dma & 0x1) {
-+              int ep_num;
-+              struct jz4740_ep *ep;
-+              ep_num = (usb_readl(jz4740_udc, JZ_REG_UDC_CNTL1) >> 4) & 0xf;
-+              ep = &jz4740_udc->ep[ep_num + 1];
-+              jz_udc_set_index(jz4740_udc, ep_num);
-+              usb_setb(jz4740_udc, ep->csr, USB_INCSR_INPKTRDY);
-+/*            jz4740_in_epn(jz4740_udc, ep_num, intr_in);*/
-+      }
-+
-+      /* Check for Bulk-OUT DMA interrupt */
-+      if (intr_dma & 0x2) {
-+              int ep_num;
-+              ep_num = (usb_readl(jz4740_udc, JZ_REG_UDC_CNTL2) >> 4) & 0xf;
-+              jz4740_out_epn(jz4740_udc, ep_num, intr_out);
-+      }
-+
-+      /* Check for each configured endpoint interrupt */
-+      if (intr_in & USB_INTR_INEP1) {
-+              DEBUG("USB_INTR_INEP1\n");
-+              jz4740_in_epn(jz4740_udc, 1, intr_in);
-+      }
-+
-+      if (intr_in & USB_INTR_INEP2) {
-+              DEBUG("USB_INTR_INEP2\n");
-+              jz4740_in_epn(jz4740_udc, 2, intr_in);
-+      }
-+
-+      if (intr_out & USB_INTR_OUTEP1) {
-+              DEBUG("USB_INTR_OUTEP1\n");
-+              jz4740_out_epn(jz4740_udc, 1, intr_out);
-+      }
-+
-+      /* Check for suspend mode */
-+      if ((intr_usb & USB_INTR_SUSPEND) &&
-+          (usb_readb(jz4740_udc, JZ_REG_UDC_INTRUSBE) & USB_INTR_SUSPEND)) {
-+              DEBUG("USB suspend\n");
-+              jz4740_udc->driver->suspend(&jz4740_udc->gadget);
-+              /* Host unloaded from us, can do something, such as flushing
-+               the NAND block cache etc. */
-+      }
-+
-+    jz_udc_set_index(jz4740_udc, index);
-+
-+      spin_unlock(&jz4740_udc->lock);
-+
-+      return IRQ_HANDLED;
-+}
-+
-+
-+
-+/*-------------------------------------------------------------------------*/
-+
-+
-+static inline struct jz4740_udc *gadget_to_udc(struct usb_gadget *gadget)
-+{
-+      return container_of(gadget, struct jz4740_udc, gadget);
-+}
-+
-+static int jz4740_udc_get_frame(struct usb_gadget *_gadget)
-+{
-+      DEBUG("%s, %p\n", __FUNCTION__, _gadget);
-+      return usb_readw(gadget_to_udc(_gadget), JZ_REG_UDC_FRAME);
-+}
-+
-+static int jz4740_udc_wakeup(struct usb_gadget *_gadget)
-+{
-+      /* host may not have enabled remote wakeup */
-+      /*if ((UDCCS0 & UDCCS0_DRWF) == 0)
-+         return -EHOSTUNREACH;
-+         udc_set_mask_UDCCR(UDCCR_RSM); */
-+      return -ENOTSUPP;
-+}
-+
-+static int jz4740_udc_pullup(struct usb_gadget *_gadget, int on)
-+{
-+      struct jz4740_udc *udc = gadget_to_udc(_gadget);
-+      unsigned long flags;
-+
-+      local_irq_save(flags);
-+
-+      if (on) {
-+              udc->state = UDC_STATE_ENABLE;
-+              udc_enable(udc);
-+      } else {
-+              udc->state = UDC_STATE_DISABLE;
-+              udc_disable(udc);
-+      }
-+
-+      local_irq_restore(flags);
-+
-+      return 0;
-+}
-+
-+
-+static const struct usb_gadget_ops jz4740_udc_ops = {
-+      .get_frame = jz4740_udc_get_frame,
-+      .wakeup = jz4740_udc_wakeup,
-+      .pullup = jz4740_udc_pullup,
-+};
-+
-+static struct usb_ep_ops jz4740_ep_ops = {
-+      .enable         = jz4740_ep_enable,
-+      .disable        = jz4740_ep_disable,
-+
-+      .alloc_request  = jz4740_alloc_request,
-+      .free_request   = jz4740_free_request,
-+
-+      .queue          = jz4740_queue,
-+      .dequeue        = jz4740_dequeue,
-+
-+      .set_halt       = jz4740_set_halt,
-+      .fifo_status    = jz4740_fifo_status,
-+      .fifo_flush     = jz4740_fifo_flush,
-+};
-+
-+
-+/*-------------------------------------------------------------------------*/
-+
-+static struct jz4740_udc jz4740_udc_controller = {
-+      .gadget = {
-+              .ops = &jz4740_udc_ops,
-+              .ep0 = &jz4740_udc_controller.ep[0].ep,
-+              .name = "jz4740-udc",
-+              .dev = {
-+                      .init_name = "gadget",
-+              },
-+      },
-+
-+      /* control endpoint */
-+      .ep[0] = {
-+              .ep = {
-+                      .name = "ep0",
-+                      .ops = &jz4740_ep_ops,
-+                      .maxpacket = EP0_MAXPACKETSIZE,
-+              },
-+              .dev = &jz4740_udc_controller,
-+
-+              .bEndpointAddress = 0,
-+              .bmAttributes = 0,
-+
-+              .type = ep_control,
-+              .fifo = JZ_REG_UDC_EP_FIFO(0),
-+              .csr = JZ_REG_UDC_CSR0,
-+      },
-+
-+      /* bulk out endpoint */
-+      .ep[1] = {
-+              .ep = {
-+                      .name = "ep1out-bulk",
-+                      .ops = &jz4740_ep_ops,
-+                      .maxpacket = EPBULK_MAXPACKETSIZE,
-+              },
-+              .dev = &jz4740_udc_controller,
-+
-+              .bEndpointAddress = 1,
-+              .bmAttributes = USB_ENDPOINT_XFER_BULK,
-+
-+              .type = ep_bulk_out,
-+              .fifo = JZ_REG_UDC_EP_FIFO(1),
-+              .csr = JZ_REG_UDC_OUTCSR,
-+      },
-+
-+      /* bulk in endpoint */
-+      .ep[2] = {
-+              .ep = {
-+                      .name = "ep1in-bulk",
-+                      .ops = &jz4740_ep_ops,
-+                      .maxpacket = EPBULK_MAXPACKETSIZE,
-+              },
-+              .dev = &jz4740_udc_controller,
-+
-+              .bEndpointAddress = 1 | USB_DIR_IN,
-+              .bmAttributes = USB_ENDPOINT_XFER_BULK,
-+
-+              .type = ep_bulk_in,
-+              .fifo = JZ_REG_UDC_EP_FIFO(1),
-+              .csr = JZ_REG_UDC_INCSR,
-+      },
-+
-+      /* interrupt in endpoint */
-+      .ep[3] = {
-+              .ep = {
-+                      .name = "ep2in-int",
-+                      .ops = &jz4740_ep_ops,
-+                      .maxpacket = EPINTR_MAXPACKETSIZE,
-+              },
-+              .dev = &jz4740_udc_controller,
-+
-+              .bEndpointAddress = 2 | USB_DIR_IN,
-+              .bmAttributes = USB_ENDPOINT_XFER_INT,
-+
-+              .type = ep_interrupt,
-+              .fifo = JZ_REG_UDC_EP_FIFO(2),
-+              .csr = JZ_REG_UDC_INCSR,
-+      },
-+};
-+
-+static int __devinit jz4740_udc_probe(struct platform_device *pdev)
-+{
-+      struct jz4740_udc *jz4740_udc = &jz4740_udc_controller;
-+      int ret;
-+
-+      spin_lock_init(&jz4740_udc->lock);
-+
-+      jz4740_udc->dev = &pdev->dev;
-+      jz4740_udc->gadget.dev.parent = &pdev->dev;
-+      jz4740_udc->gadget.dev.dma_mask = pdev->dev.dma_mask;
-+
-+      ret = device_register(&jz4740_udc->gadget.dev);
-+      if (ret)
-+              return ret;
-+
-+      jz4740_udc->clk = clk_get(&pdev->dev, "udc");
-+      if (IS_ERR(jz4740_udc->clk)) {
-+              ret = PTR_ERR(jz4740_udc->clk);
-+              dev_err(&pdev->dev, "Failed to get udc clock: %d\n", ret);
-+              goto err_device_unregister;
-+      }
-+
-+      platform_set_drvdata(pdev, jz4740_udc);
-+
-+      jz4740_udc->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-+
-+      if (!jz4740_udc->mem) {
-+              ret = -ENOENT;
-+              dev_err(&pdev->dev, "Failed to get mmio memory resource\n");
-+              goto err_clk_put;
-+      }
-+
-+      jz4740_udc->mem = request_mem_region(jz4740_udc->mem->start,
-+      resource_size(jz4740_udc->mem), pdev->name);
-+
-+      if (!jz4740_udc->mem) {
-+              ret = -EBUSY;
-+              dev_err(&pdev->dev, "Failed to request mmio memory region\n");
-+              goto err_device_unregister;
-+      }
-+
-+      jz4740_udc->base = ioremap(jz4740_udc->mem->start, resource_size(jz4740_udc->mem));
-+
-+      if (!jz4740_udc->base) {
-+              ret = -EBUSY;
-+              dev_err(&pdev->dev, "Failed to ioremap mmio memory\n");
-+              goto err_release_mem_region;
-+      }
-+
-+      jz4740_udc->irq = platform_get_irq(pdev, 0);
-+      ret = request_irq(jz4740_udc->irq, jz4740_udc_irq, 0, pdev->name,
-+      jz4740_udc);
-+        if (ret) {
-+                dev_err(&pdev->dev, "Failed to request irq: %d\n", ret);
-+                goto err_iounmap;
-+      }
-+
-+      udc_disable(jz4740_udc);
-+      udc_reinit(jz4740_udc);
-+
-+      return 0;
-+
-+err_iounmap:
-+      iounmap(jz4740_udc->base);
-+err_release_mem_region:
-+      release_mem_region(jz4740_udc->mem->start, resource_size(jz4740_udc->mem));
-+err_clk_put:
-+      clk_put(jz4740_udc->clk);
-+err_device_unregister:
-+      device_unregister(&jz4740_udc->gadget.dev);
-+      platform_set_drvdata(pdev, NULL);
-+
-+      return ret;
-+}
-+
-+static int __devexit jz4740_udc_remove(struct platform_device *pdev)
-+{
-+      struct jz4740_udc *dev = platform_get_drvdata(pdev);
-+
-+      if (dev->driver)
-+              return -EBUSY;
-+
-+      udc_disable(dev);
-+
-+      free_irq(dev->irq, dev);
-+      iounmap(dev->base);
-+      release_mem_region(dev->mem->start, resource_size(dev->mem));
-+      clk_put(dev->clk);
-+
-+      platform_set_drvdata(pdev, NULL);
-+      device_unregister(&dev->gadget.dev);
-+
-+      return 0;
-+}
-+
-+#ifdef CONFIG_PM
-+
-+static int jz4740_udc_suspend(struct device *dev)
-+{
-+      struct jz4740_udc *jz4740_udc = dev_get_drvdata(dev);
-+
-+      if (jz4740_udc->state == UDC_STATE_ENABLE)
-+              udc_disable(jz4740_udc);
-+
-+      return 0;
-+}
-+
-+static int jz4740_udc_resume(struct device *dev)
-+{
-+      struct jz4740_udc *jz4740_udc = dev_get_drvdata(dev);
-+
-+      if (jz4740_udc->state == UDC_STATE_ENABLE)
-+              udc_enable(jz4740_udc);
-+
-+      return 0;
-+}
-+
-+static const struct dev_pm_ops jz4740_udc_pm_ops = {
-+      .suspend = jz4740_udc_suspend,
-+      .resume = jz4740_udc_resume,
-+};
-+
-+#define JZ4740_UDC_PM_OPS (&jz4740_udc_pm_ops)
-+
-+#else
-+#define JZ4740_UDC_PM_OPS NULL
-+#endif
-+
-+static struct platform_driver udc_driver = {
-+      .probe          = jz4740_udc_probe,
-+      .remove         = __devexit_p(jz4740_udc_remove),
-+      .driver         = {
-+              .name   = "jz-udc",
-+              .owner  = THIS_MODULE,
-+              .pm             = JZ4740_UDC_PM_OPS,
-+      },
-+};
-+
-+/*-------------------------------------------------------------------------*/
-+
-+static int __init udc_init (void)
-+{
-+      return platform_driver_register(&udc_driver);
-+}
-+module_init(udc_init);
-+
-+static void __exit udc_exit (void)
-+{
-+      platform_driver_unregister(&udc_driver);
-+}
-+module_exit(udc_exit);
-+
-+MODULE_DESCRIPTION("JZ4740 USB Device Controller");
-+MODULE_AUTHOR("Wei Jianli <jlwei@ingenic.cn>");
-+MODULE_LICENSE("GPL");
---- /dev/null
-+++ b/drivers/usb/gadget/jz4740_udc.h
-@@ -0,0 +1,101 @@
-+/*
-+ * linux/drivers/usb/gadget/jz4740_udc.h
-+ *
-+ * Ingenic JZ4740 on-chip high speed USB device controller
-+ *
-+ * Copyright (C) 2006 Ingenic Semiconductor Inc.
-+ * Author: <jlwei@ingenic.cn>
-+ *
-+ * 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.
-+ */
-+
-+#ifndef __USB_GADGET_JZ4740_H__
-+#define __USB_GADGET_JZ4740_H__
-+
-+/*-------------------------------------------------------------------------*/
-+
-+// Max packet size
-+#define EP0_MAXPACKETSIZE     64
-+#define EPBULK_MAXPACKETSIZE          512
-+#define EPINTR_MAXPACKETSIZE          64
-+
-+#define UDC_MAX_ENDPOINTS       4
-+
-+/*-------------------------------------------------------------------------*/
-+
-+enum ep_type {
-+      ep_control, ep_bulk_in, ep_bulk_out, ep_interrupt
-+};
-+
-+struct jz4740_ep {
-+      struct usb_ep ep;
-+      struct jz4740_udc *dev;
-+
-+      const struct usb_endpoint_descriptor *desc;
-+
-+      uint8_t stopped;
-+      uint8_t bEndpointAddress;
-+      uint8_t bmAttributes;
-+
-+      enum ep_type type;
-+      size_t fifo;
-+      uint32_t csr;
-+
-+      uint32_t reg_addr;
-+      struct list_head queue;
-+};
-+
-+struct jz4740_request {
-+      struct usb_request req;
-+      struct list_head queue;
-+};
-+
-+enum ep0state {
-+      WAIT_FOR_SETUP,         /* between STATUS ack and SETUP report */
-+      DATA_STATE_XMIT,        /* data tx stage */
-+      DATA_STATE_NEED_ZLP,    /* data tx zlp stage */
-+      WAIT_FOR_OUT_STATUS,    /* status stages */
-+      DATA_STATE_RECV,        /* data rx stage */
-+};
-+
-+/* For function binding with UDC Disable - Added by River */
-+typedef enum {
-+      UDC_STATE_ENABLE = 0,
-+      UDC_STATE_DISABLE,
-+}udc_state_t;
-+
-+struct jz4740_udc {
-+      struct usb_gadget gadget;
-+      struct usb_gadget_driver *driver;
-+      struct device *dev;
-+      spinlock_t lock;
-+      unsigned long lock_flags;
-+
-+      enum ep0state ep0state;
-+      struct jz4740_ep ep[UDC_MAX_ENDPOINTS];
-+
-+      udc_state_t state;
-+
-+      struct resource *mem;
-+      void __iomem *base;
-+      int irq;
-+
-+      struct clk *clk;
-+};
-+
-+#define ep_maxpacket(EP)      ((EP)->ep.maxpacket)
-+
-+static inline bool ep_is_in(const struct jz4740_ep *ep)
-+{
-+      return (ep->bEndpointAddress & USB_DIR_IN) == USB_DIR_IN;
-+}
-+
-+static inline uint8_t ep_index(const struct jz4740_ep *ep)
-+{
-+      return ep->bEndpointAddress & 0xf;
-+}
-+
-+#endif /* __USB_GADGET_JZ4740_H__ */
diff --git a/target/linux/xburst/patches-2.6.37/300-battery-fixes.patch b/target/linux/xburst/patches-2.6.37/300-battery-fixes.patch
deleted file mode 100644 (file)
index 2f014e7..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/drivers/power/jz4740-battery.c
-+++ b/drivers/power/jz4740-battery.c
-@@ -246,6 +246,11 @@ static int __devinit jz_battery_probe(st
-       struct jz_battery *jz_battery;
-       struct power_supply *battery;
-+      if (!pdata) {
-+              dev_err(&pdev->dev, "No platform_data supplied\n");
-+              return -ENXIO;
-+      }
-+
-       jz_battery = kzalloc(sizeof(*jz_battery), GFP_KERNEL);
-       if (!jz_battery) {
-               dev_err(&pdev->dev, "Failed to allocate driver structure\n");
diff --git a/target/linux/xburst/patches-2.6.37/302-nand-fixes.patch b/target/linux/xburst/patches-2.6.37/302-nand-fixes.patch
deleted file mode 100644 (file)
index 189c0f0..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-From 3ac9f7e0bc48b3c9ab6529410a2b8f3f9eac5bc5 Mon Sep 17 00:00:00 2001
-From: Lars-Peter Clausen <lars@metafoo.de>
-Date: Wed, 10 Nov 2010 11:29:36 +0100
-Subject: [PATCH 20/23] MTD: NAND: jz4740: Make 'struct platform_driver jz_nand_driver' static
-
-Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
----
- drivers/mtd/nand/jz4740_nand.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
---- a/drivers/mtd/nand/jz4740_nand.c
-+++ b/drivers/mtd/nand/jz4740_nand.c
-@@ -251,58 +251,6 @@ static int jz_nand_correct_ecc_rs(struct
-       return 0;
- }
--
--/* Copy paste of nand_read_page_hwecc_oob_first except for different eccpos
-- * handling. The ecc area is for 4k chips 72 bytes long and thus does not fit
-- * into the eccpos array. */
--static int jz_nand_read_page_hwecc_oob_first(struct mtd_info *mtd,
--      struct nand_chip *chip, uint8_t *buf, int page)
--{
--      int i, eccsize = chip->ecc.size;
--      int eccbytes = chip->ecc.bytes;
--      int eccsteps = chip->ecc.steps;
--      uint8_t *p = buf;
--      unsigned int ecc_offset = chip->page_shift;
--
--      /* Read the OOB area first */
--      chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page);
--      chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
--      chip->cmdfunc(mtd, NAND_CMD_READ0, 0, page);
--
--      for (i = ecc_offset; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
--              int stat;
--
--              chip->ecc.hwctl(mtd, NAND_ECC_READ);
--              chip->read_buf(mtd, p, eccsize);
--
--              stat = chip->ecc.correct(mtd, p, &chip->oob_poi[i], NULL);
--              if (stat < 0)
--                      mtd->ecc_stats.failed++;
--              else
--                      mtd->ecc_stats.corrected += stat;
--      }
--      return 0;
--}
--
--/* Copy-and-paste of nand_write_page_hwecc with different eccpos handling. */
--static void jz_nand_write_page_hwecc(struct mtd_info *mtd,
--      struct nand_chip *chip, const uint8_t *buf)
--{
--      int i, eccsize = chip->ecc.size;
--      int eccbytes = chip->ecc.bytes;
--      int eccsteps = chip->ecc.steps;
--      const uint8_t *p = buf;
--      unsigned int ecc_offset = chip->page_shift;
--
--      for (i = ecc_offset; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
--              chip->ecc.hwctl(mtd, NAND_ECC_WRITE);
--              chip->write_buf(mtd, p, eccsize);
--              chip->ecc.calculate(mtd, p, &chip->oob_poi[i]);
--      }
--
--      chip->write_buf(mtd, chip->oob_poi, mtd->oobsize);
--}
--
- #ifdef CONFIG_MTD_CMDLINE_PARTS
- static const char *part_probes[] = {"cmdline", NULL};
- #endif
-@@ -393,9 +341,6 @@ static int __devinit jz_nand_probe(struc
-       chip->ecc.size          = 512;
-       chip->ecc.bytes         = 9;
--      chip->ecc.read_page     = jz_nand_read_page_hwecc_oob_first;
--      chip->ecc.write_page    = jz_nand_write_page_hwecc;
--
-       if (pdata)
-               chip->ecc.layout = pdata->ecc_layout;
-@@ -489,7 +434,7 @@ static int __devexit jz_nand_remove(stru
-       return 0;
- }
--struct platform_driver jz_nand_driver = {
-+static struct platform_driver jz_nand_driver = {
-       .probe = jz_nand_probe,
-       .remove = __devexit_p(jz_nand_remove),
-       .driver = {
diff --git a/target/linux/xburst/patches-2.6.37/303-qi_lb60-set-nand-ecc-offsets.patch b/target/linux/xburst/patches-2.6.37/303-qi_lb60-set-nand-ecc-offsets.patch
deleted file mode 100644 (file)
index 1d4beba..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-From 6bbab54ef3cbfc340a3d3ffdcb0aa47bb4c29de9 Mon Sep 17 00:00:00 2001
-From: Lars-Peter Clausen <lars@metafoo.de>
-Date: Thu, 11 Nov 2010 19:05:40 +0100
-Subject: [PATCH 22/23] MIPS: JZ4740: Set nand ecc offsets for the qi_lb60 board
-
-Now that the mtd core supports more then 64 ecc bytes we can use it instead of
-some a custom hack in the jz4740 nand driver.
-This patches sets the ecc pos fields of the ecc_layout of the qi_lb60 board.
-
-Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
----
- arch/mips/jz4740/board-qi_lb60.c |    8 ++++----
- 1 files changed, 4 insertions(+), 4 deletions(-)
-
---- a/arch/mips/jz4740/board-qi_lb60.c
-+++ b/arch/mips/jz4740/board-qi_lb60.c
-@@ -50,14 +50,14 @@ static bool is_avt2;
- /* NAND */
- static struct nand_ecclayout qi_lb60_ecclayout_1gb = {
--/*    .eccbytes = 36,
-+      .eccbytes = 36,
-       .eccpos = {
-               6,  7,  8,  9,  10, 11, 12, 13,
-               14, 15, 16, 17, 18, 19, 20, 21,
-               22, 23, 24, 25, 26, 27, 28, 29,
-               30, 31, 32, 33, 34, 35, 36, 37,
-               38, 39, 40, 41
--      },*/
-+      },
-       .oobfree = {
-               { .offset = 2, .length = 4 },
-               { .offset = 42, .length = 22 }
-@@ -86,7 +86,7 @@ static struct mtd_partition qi_lb60_part
- };
- static struct nand_ecclayout qi_lb60_ecclayout_2gb = {
--/*    .eccbytes = 72,
-+      .eccbytes = 72,
-       .eccpos = {
-               12, 13, 14, 15, 16, 17, 18, 19,
-               20, 21, 22, 23, 24, 25, 26, 27,
-@@ -97,7 +97,7 @@ static struct nand_ecclayout qi_lb60_ecc
-               60, 61, 62, 63, 64, 65, 66, 67,
-               68, 69, 70, 71, 72, 73, 74, 75,
-               76, 77, 78, 79, 80, 81, 82, 83
--      },*/
-+      },
-       .oobfree = {
-               { .offset = 2, .length = 10 },
-               { .offset = 84, .length = 44 },
diff --git a/target/linux/xburst/patches-2.6.37/420-fb-notifier-pre-post.patch b/target/linux/xburst/patches-2.6.37/420-fb-notifier-pre-post.patch
deleted file mode 100644 (file)
index 640b5f7..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-From d8f08d2d1753371525c9d823411a578728b3f7d5 Mon Sep 17 00:00:00 2001
-From: Lars-Peter Clausen <lars@metafoo.de>
-Date: Sat, 24 Apr 2010 12:23:28 +0200
-Subject: [PATCH 16/23] Framebuffer notifier: Call notifier callbacks prior to blanking the screen
-
----
- drivers/video/fbmem.c |    8 ++++++--
- 1 files changed, 6 insertions(+), 2 deletions(-)
-
---- a/drivers/video/fbmem.c
-+++ b/drivers/video/fbmem.c
-@@ -990,12 +990,12 @@ fb_set_var(struct fb_info *info, struct
- int
- fb_blank(struct fb_info *info, int blank)
- {     
--      int ret = -EINVAL;
-+      int ret = 0;
-       if (blank > FB_BLANK_POWERDOWN)
-               blank = FB_BLANK_POWERDOWN;
--      if (info->fbops->fb_blank)
-+      if (info->fbops->fb_blank && blank == FB_BLANK_UNBLANK)
-               ret = info->fbops->fb_blank(blank, info);
-       if (!ret) {
-@@ -1006,6 +1006,10 @@ fb_blank(struct fb_info *info, int blank
-               fb_notifier_call_chain(FB_EVENT_BLANK, &event);
-       }
-+      if (info->fbops->fb_blank && blank != FB_BLANK_UNBLANK)
-+              ret = info->fbops->fb_blank(blank, info);
-+
-+
-       return ret;
- }
diff --git a/target/linux/xburst/patches-2.6.37/440-metronome.patch b/target/linux/xburst/patches-2.6.37/440-metronome.patch
deleted file mode 100644 (file)
index eb6d660..0000000
+++ /dev/null
@@ -1,1213 +0,0 @@
-From 057f6f13cff319e9f2fff39736371e95ff5ac47b Mon Sep 17 00:00:00 2001
-From: Lars-Peter Clausen <lars@metafoo.de>
-Date: Wed, 12 May 2010 14:24:46 +0200
-Subject: [PATCH 1/5] metronome patches
-
----
- drivers/video/metronomefb.c |  788 +++++++++++++++++++++++++++++++++++++------
- include/video/metronomefb.h |   33 ++-
- 2 files changed, 710 insertions(+), 111 deletions(-)
-
---- a/drivers/video/metronomefb.c
-+++ b/drivers/video/metronomefb.c
-@@ -18,11 +18,13 @@
-  * is provided as am200epd.c
-  *
-  */
-+
- #include <linux/module.h>
- #include <linux/kernel.h>
- #include <linux/errno.h>
- #include <linux/string.h>
- #include <linux/mm.h>
-+#include <linux/slab.h>
- #include <linux/vmalloc.h>
- #include <linux/delay.h>
- #include <linux/interrupt.h>
-@@ -34,16 +36,25 @@
- #include <linux/dma-mapping.h>
- #include <linux/uaccess.h>
- #include <linux/irq.h>
-+#include <linux/ctype.h>
- #include <video/metronomefb.h>
- #include <asm/unaligned.h>
--/* Display specific information */
--#define DPY_W 832
--#define DPY_H 622
-+/*
-+ * 12 is ok to avoid refreshing whole screen while small elements are changed,
-+ * while forcing full refresh if largish dialog boxes or menus are
-+ * shown/dismissed.
-+ */
-+#define DEFAULT_MANUAL_REFRESH_THRESHOLD 12
-+
-+#define WF_MODE_INIT  0 /* Initialization */
-+#define WF_MODE_MU    1 /* Monochrome update */
-+#define WF_MODE_GU    2 /* Grayscale update */
-+#define WF_MODE_GC    3 /* Grayscale clearing */
--static int user_wfm_size;
-+static int temp = 25;
- /* frame differs from image. frame includes non-visible pixels */
- struct epd_frame {
-@@ -53,7 +64,7 @@ struct epd_frame {
-       int wfm_size;
- };
--static struct epd_frame epd_frame_table[] = {
-+static const struct epd_frame epd_frame_table[] = {
-       {
-               .fw = 832,
-               .fh = 622,
-@@ -97,24 +108,40 @@ static struct epd_frame epd_frame_table[
-               },
-               .wfm_size = 46770,
-       },
-+      {
-+              .fw = 800,
-+              .fh = 600,
-+              .config = {
-+                      15 /* sdlew */
-+                      | 2 << 8 /* sdosz */
-+                      | 0 << 11 /* sdor */
-+                      | 0 << 12 /* sdces */
-+                      | 0 << 15, /* sdcer */
-+                      42 /* gdspl */
-+                      | 1 << 8 /* gdr1 */
-+                      | 1 << 9 /* sdshr */
-+                      | 0 << 15, /* gdspp */
-+                      18 /* gdspw */
-+                      | 0 << 15, /* dispc */
-+                      599 /* vdlc */
-+                      | 0 << 11 /* dsi */
-+                      | 0 << 12, /* dsic */
-+              },
-+              .wfm_size = 46901,
-+      },
- };
--static struct fb_fix_screeninfo metronomefb_fix __devinitdata = {
-+static const struct fb_fix_screeninfo metronomefb_fix __devinitconst = {
-       .id =           "metronomefb",
-       .type =         FB_TYPE_PACKED_PIXELS,
-       .visual =       FB_VISUAL_STATIC_PSEUDOCOLOR,
-       .xpanstep =     0,
-       .ypanstep =     0,
-       .ywrapstep =    0,
--      .line_length =  DPY_W,
-       .accel =        FB_ACCEL_NONE,
- };
--static struct fb_var_screeninfo metronomefb_var __devinitdata = {
--      .xres           = DPY_W,
--      .yres           = DPY_H,
--      .xres_virtual   = DPY_W,
--      .yres_virtual   = DPY_H,
-+static const struct fb_var_screeninfo metronomefb_var __devinitconst = {
-       .bits_per_pixel = 8,
-       .grayscale      = 1,
-       .nonstd         = 1,
-@@ -167,7 +194,7 @@ static u16 calc_img_cksum(u16 *start, in
- }
- /* here we decode the incoming waveform file and populate metromem */
--static int __devinit load_waveform(u8 *mem, size_t size, int m, int t,
-+static int load_waveform(u8 *mem, size_t size, int m, int t,
-                               struct metronomefb_par *par)
- {
-       int tta;
-@@ -181,16 +208,12 @@ static int __devinit load_waveform(u8 *m
-       int mem_idx = 0;
-       struct waveform_hdr *wfm_hdr;
-       u8 *metromem = par->metromem_wfm;
--      struct device *dev = par->info->dev;
-+      struct device *dev = &par->pdev->dev;
-+      u8 mc, trc;
-+      u16 *p;
-+      u16 img_cksum;
--      if (user_wfm_size)
--              epd_frame_table[par->dt].wfm_size = user_wfm_size;
--
--      if (size != epd_frame_table[par->dt].wfm_size) {
--              dev_err(dev, "Error: unexpected size %Zd != %d\n", size,
--                                      epd_frame_table[par->dt].wfm_size);
--              return -EINVAL;
--      }
-+      dev_dbg(dev, "Loading waveforms, mode %d, temperature %d\n", m, t);
-       wfm_hdr = (struct waveform_hdr *) mem;
-@@ -208,8 +231,9 @@ static int __devinit load_waveform(u8 *m
-                                       wfm_hdr->wfm_cs);
-               return -EINVAL;
-       }
--      wfm_hdr->mc += 1;
--      wfm_hdr->trc += 1;
-+      mc = wfm_hdr->mc + 1;
-+      trc = wfm_hdr->trc + 1;
-+
-       for (i = 0; i < 5; i++) {
-               if (*(wfm_hdr->stuff2a + i) != 0) {
-                       dev_err(dev, "Error: unexpected value in padding\n");
-@@ -221,10 +245,10 @@ static int __devinit load_waveform(u8 *m
-       the waveform. presumably selecting the right one for the
-       desired temperature. it works out the offset of the first
-       v that exceeds the specified temperature */
--      if ((sizeof(*wfm_hdr) + wfm_hdr->trc) > size)
-+      if ((sizeof(*wfm_hdr) + trc) > size)
-               return -EINVAL;
--      for (i = sizeof(*wfm_hdr); i <= sizeof(*wfm_hdr) + wfm_hdr->trc; i++) {
-+      for (i = sizeof(*wfm_hdr); i <= sizeof(*wfm_hdr) + trc; i++) {
-               if (mem[i] > t) {
-                       trn = i - sizeof(*wfm_hdr) - 1;
-                       break;
-@@ -232,7 +256,7 @@ static int __devinit load_waveform(u8 *m
-       }
-       /* check temperature range table checksum */
--      cksum_idx = sizeof(*wfm_hdr) + wfm_hdr->trc + 1;
-+      cksum_idx = sizeof(*wfm_hdr) + trc + 1;
-       if (cksum_idx > size)
-               return -EINVAL;
-       cksum = calc_cksum(sizeof(*wfm_hdr), cksum_idx, mem);
-@@ -294,6 +318,7 @@ static int __devinit load_waveform(u8 *m
-       cksum_idx = wfm_idx;
-       if (cksum_idx > size)
-               return -EINVAL;
-+      dev_dbg(dev, "mem_idx = %u\n", mem_idx);
-       cksum = calc_cksum(owfm_idx, cksum_idx, mem);
-       if (cksum != mem[cksum_idx]) {
-               dev_err(dev, "Error: bad waveform data cksum"
-@@ -302,16 +327,47 @@ static int __devinit load_waveform(u8 *m
-       }
-       par->frame_count = (mem_idx/64);
-+      p = (u16 *)par->metromem_wfm;
-+      img_cksum = calc_img_cksum(p, 16384 / 2);
-+      p[16384 / 2] = __cpu_to_le16(img_cksum);
-+
-+      par->current_wf_mode = m;
-+      par->current_wf_temp = t;
-+
-       return 0;
- }
-+static int check_err(struct metronomefb_par *par)
-+{
-+      int res;
-+
-+      res = par->board->get_err(par);
-+      dev_dbg(&par->pdev->dev, "ERR = %d\n", res);
-+      return res;
-+}
-+
-+static inline int wait_for_rdy(struct metronomefb_par *par)
-+{
-+      int res = 0;
-+
-+      if (!par->board->get_rdy(par))
-+              res = par->board->met_wait_event_intr(par);
-+
-+      return res;
-+}
-+
- static int metronome_display_cmd(struct metronomefb_par *par)
- {
-       int i;
-       u16 cs;
-       u16 opcode;
--      static u8 borderval;
-+      int res;
-+      res = wait_for_rdy(par);
-+      if (res)
-+              return res;
-+
-+      dev_dbg(&par->pdev->dev, "%s: ENTER\n", __func__);
-       /* setup display command
-       we can't immediately set the opcode since the controller
-       will try parse the command before we've set it all up
-@@ -324,8 +380,9 @@ static int metronome_display_cmd(struct
-       /* set the args ( 2 bytes ) for display */
-       i = 0;
--      par->metromem_cmd->args[i] =    1 << 3 /* border update */
--                                      | ((borderval++ % 4) & 0x0F) << 4
-+      par->metromem_cmd->args[i] =    0 << 3 /* border update */
-+                                      | (3 << 4)
-+//                                    | ((borderval++ % 4) & 0x0F) << 4
-                                       | (par->frame_count - 1) << 8;
-       cs += par->metromem_cmd->args[i++];
-@@ -335,21 +392,25 @@ static int metronome_display_cmd(struct
-       par->metromem_cmd->csum = cs;
-       par->metromem_cmd->opcode = opcode; /* display cmd */
--      return par->board->met_wait_event_intr(par);
-+      return 0;
-+
- }
- static int __devinit metronome_powerup_cmd(struct metronomefb_par *par)
- {
-       int i;
-       u16 cs;
-+      int res;
-+      dev_dbg(&par->pdev->dev, "%s: ENTER\n", __func__);
-       /* setup power up command */
-       par->metromem_cmd->opcode = 0x1234; /* pwr up pseudo cmd */
-       cs = par->metromem_cmd->opcode;
-       /* set pwr1,2,3 to 1024 */
-       for (i = 0; i < 3; i++) {
--              par->metromem_cmd->args[i] = 1024;
-+//            par->metromem_cmd->args[i] = 1024;
-+              par->metromem_cmd->args[i] = 100;
-               cs += par->metromem_cmd->args[i];
-       }
-@@ -364,7 +425,9 @@ static int __devinit metronome_powerup_c
-       msleep(1);
-       par->board->set_stdby(par, 1);
--      return par->board->met_wait_event(par);
-+      res = par->board->met_wait_event(par);
-+      dev_dbg(&par->pdev->dev, "%s: EXIT: %d\n", __func__, res);
-+      return res;
- }
- static int __devinit metronome_config_cmd(struct metronomefb_par *par)
-@@ -373,8 +436,9 @@ static int __devinit metronome_config_cm
-       we can't immediately set the opcode since the controller
-       will try parse the command before we've set it all up */
--      memcpy(par->metromem_cmd->args, epd_frame_table[par->dt].config,
--              sizeof(epd_frame_table[par->dt].config));
-+      dev_dbg(&par->pdev->dev, "%s: ENTER\n", __func__);
-+      memcpy(par->metromem_cmd->args, par->epd_frame->config,
-+              sizeof(par->epd_frame->config));
-       /* the rest are 0 */
-       memset((u8 *) (par->metromem_cmd->args + 4), 0, (32-4)*2);
-@@ -395,11 +459,12 @@ static int __devinit metronome_init_cmd(
-       will try parse the command before we've set it all up
-       so we just set cs here and set the opcode at the end */
-+      dev_dbg(&par->pdev->dev, "%s: ENTER\n", __func__);
-       cs = 0xCC20;
-       /* set the args ( 2 bytes ) for init */
-       i = 0;
--      par->metromem_cmd->args[i] = 0;
-+      par->metromem_cmd->args[i] = 0x0007;
-       cs += par->metromem_cmd->args[i++];
-       /* the rest are 0 */
-@@ -411,76 +476,268 @@ static int __devinit metronome_init_cmd(
-       return par->board->met_wait_event(par);
- }
--static int __devinit metronome_init_regs(struct metronomefb_par *par)
-+static int metronome_bootup(struct metronomefb_par *par)
- {
-       int res;
--      res = par->board->setup_io(par);
--      if (res)
--              return res;
--
-       res = metronome_powerup_cmd(par);
--      if (res)
--              return res;
-+      if (res) {
-+              dev_err(&par->pdev->dev, "metronomefb: POWERUP cmd failed\n");
-+              goto finish;
-+      }
-+      check_err(par);
-       res = metronome_config_cmd(par);
--      if (res)
--              return res;
-+      if (res) {
-+              dev_err(&par->pdev->dev, "metronomefb: CONFIG cmd failed\n");
-+              goto finish;
-+      }
-+      check_err(par);
-       res = metronome_init_cmd(par);
-+      if (res)
-+              dev_err(&par->pdev->dev, "metronomefb: INIT cmd failed\n");
-+      check_err(par);
-+
-+finish:
-+      return res;
-+}
-+
-+static int __devinit metronome_init_regs(struct metronomefb_par *par)
-+{
-+      int res;
-+
-+      if (par->board->power_ctl)
-+              par->board->power_ctl(par, METRONOME_POWER_ON);
-+
-+      res =  metronome_bootup(par);
-       return res;
- }
--static void metronomefb_dpy_update(struct metronomefb_par *par)
-+static uint16_t metronomefb_update_img_buffer_rotated(struct metronomefb_par *par)
- {
--      int fbsize;
--      u16 cksum;
--      unsigned char *buf = (unsigned char __force *)par->info->screen_base;
-+      int x, y;
-+      int xstep, ystep;
-+      int i, j;
-+      uint16_t cksum = 0;
-+      uint8_t *buf = par->info->screen_base;
-+      uint32_t *img = (uint32_t *)(par->metromem_img);
-+      int fw = par->epd_frame->fw;
-+      int fh = par->epd_frame->fh;
-+      int fw_buf = fw / 4;
-+      uint32_t *fxbuckets = par->fxbuckets;
-+      uint32_t *fybuckets = par->fybuckets;
-+      uint32_t diff;
-+      uint32_t tmp;
-+
-+      switch (par->rotation) {
-+      case FB_ROTATE_CW:
-+              xstep = -fh;
-+              ystep = fw * fh + 1;
-+              j = (fw - 1) * fh;
-+              break;
-+      case FB_ROTATE_UD:
-+              xstep = -1;
-+              ystep = 0;
-+              j = fw * fh - 1;
-+              break;
-+      case FB_ROTATE_CCW:
-+              xstep = fh;
-+              ystep = -fw * fh - 1;
-+              j = fh - 1;
-+              break;
-+      default:
-+              BUG();
-+              break;
-+      }
--      fbsize = par->info->fix.smem_len;
--      /* copy from vm to metromem */
--      memcpy(par->metromem_img, buf, fbsize);
-+      memset(fxbuckets, 0, fw_buf * sizeof(*fxbuckets));
-+      memset(fybuckets, 0, fh * sizeof(*fybuckets));
-+
-+      i = 0;
-+      for (y = 0; y < fh; y++) {
-+              for(x = 0; x < fw_buf; x++, i++) {
-+                      tmp = (buf[j] << 5);
-+                      j += xstep;
-+                      tmp |= (buf[j] << 13);
-+                      j += xstep;
-+                      tmp |= (buf[j] << 21);
-+                      j += xstep;
-+                      tmp |= (buf[j] << 29);
-+                      j += xstep;
-+                      tmp &= 0xe0e0e0e0;
-+
-+                      img[i] &= 0xf0f0f0f0;
-+                      diff = img[i] ^ tmp;
-+
-+                      fxbuckets[x] |= diff;
-+                      fybuckets[y] |= diff;
-+
-+                      img[i] = (img[i] >> 4) | tmp;
-+                      cksum += img[i] & 0x0000ffff;
-+                      cksum += (img[i] >> 16);
--      cksum = calc_img_cksum((u16 *) par->metromem_img, fbsize/2);
--      *((u16 *)(par->metromem_img) + fbsize/2) = cksum;
--      metronome_display_cmd(par);
-+              }
-+              j += ystep;
-+      }
-+
-+      return cksum;
- }
--static u16 metronomefb_dpy_update_page(struct metronomefb_par *par, int index)
-+static uint16_t metronomefb_update_img_buffer_normal(struct metronomefb_par *par)
- {
--      int i;
--      u16 csum = 0;
--      u16 *buf = (u16 __force *)(par->info->screen_base + index);
--      u16 *img = (u16 *)(par->metromem_img + index);
--
--      /* swizzle from vm to metromem and recalc cksum at the same time*/
--      for (i = 0; i < PAGE_SIZE/2; i++) {
--              *(img + i) = (buf[i] << 5) & 0xE0E0;
--              csum += *(img + i);
-+      int x, y, i;
-+      uint16_t cksum = 0;
-+      uint32_t *buf = (uint32_t __force *)par->info->screen_base;
-+      uint32_t *img = (uint32_t *)(par->metromem_img);
-+      uint32_t diff;
-+      uint32_t tmp;
-+      int fw = par->epd_frame->fw;
-+      int fh = par->epd_frame->fh;
-+      int fw_buf = fw / sizeof(*buf);
-+      uint32_t *fxbuckets = par->fxbuckets;
-+      uint32_t *fybuckets = par->fybuckets;
-+
-+      memset(fxbuckets, 0, fw_buf * sizeof(*fxbuckets));
-+      memset(fybuckets, 0, fh * sizeof(*fybuckets));
-+
-+      i = 0;
-+      for (y = 0; y < fh; y++) {
-+              for(x = 0; x < fw_buf; x++, i++) {
-+                      tmp = (buf[i] << 5) & 0xe0e0e0e0;
-+                      img[i] &= 0xf0f0f0f0;
-+                      diff = img[i] ^ tmp;
-+
-+                      fxbuckets[x] |= diff;
-+                      fybuckets[y] |= diff;
-+
-+                      img[i] = (img[i] >> 4) | tmp;
-+                      cksum += img[i] & 0x0000ffff;
-+                      cksum += (img[i] >> 16);
-+              }
-       }
--      return csum;
-+
-+      return cksum;
-+}
-+
-+static unsigned int metronomefb_get_change_count(struct metronomefb_par *par)
-+{
-+      int min_x;
-+      int max_x;
-+      int min_y;
-+      int max_y;
-+      int fw = par->epd_frame->fw / 4;
-+      int fh = par->epd_frame->fh;
-+      unsigned int change_count;
-+      uint32_t *fxbuckets = par->fxbuckets;
-+      uint32_t *fybuckets = par->fybuckets;
-+
-+      for (min_x = 0; min_x < fw; ++min_x) {
-+              if(fxbuckets[min_x])
-+                      break;
-+      }
-+
-+      for (max_x = fw - 1; max_x >= 0; --max_x) {
-+              if(fxbuckets[max_x])
-+                      break;
-+      }
-+
-+      for (min_y = 0; min_y < fh; min_y++) {
-+              if(fybuckets[min_y])
-+                      break;
-+      }
-+
-+      for (max_y = fh - 1; max_y >= 0; --max_y) {
-+              if(fybuckets[max_y])
-+                      break;
-+      }
-+
-+      if ((min_x > max_x) || (min_y > max_y))
-+              change_count = 0;
-+      else
-+              change_count = (max_x - min_x + 1) * (max_y - min_y + 1) * 4;
-+
-+      dev_dbg(&par->pdev->dev, "min_x = %d, max_x = %d, min_y = %d, max_y = %d\n",
-+                      min_x, max_x, min_y, max_y);
-+
-+      return change_count;
-+}
-+
-+static void metronomefb_dpy_update(struct metronomefb_par *par, int clear_all)
-+{
-+      unsigned int fbsize = par->info->fix.smem_len;
-+      uint16_t cksum;
-+      int m;
-+
-+      wait_for_rdy(par);
-+
-+      if (par->rotation == 0)
-+              cksum = metronomefb_update_img_buffer_normal(par);
-+      else
-+              cksum = metronomefb_update_img_buffer_rotated(par);
-+
-+      *par->metromem_img_csum = __cpu_to_le16(cksum);
-+
-+      if (clear_all || par->is_first_update ||
-+              (par->partial_updates_count == par->partial_autorefresh_interval)) {
-+              m = WF_MODE_GC;
-+              par->partial_updates_count = 0;
-+      } else {
-+              int change_count = metronomefb_get_change_count(par);
-+              if (change_count < fbsize / 100 * par->manual_refresh_threshold)
-+                      m = WF_MODE_GU;
-+              else
-+                      m = WF_MODE_GC;
-+
-+              dev_dbg(&par->pdev->dev, "change_count = %u, treshold = %u%% (%u pixels)\n",
-+                              change_count, par->manual_refresh_threshold,
-+                              fbsize / 100 * par->manual_refresh_threshold);
-+              ++par->partial_updates_count;
-+      }
-+
-+      if (m != par->current_wf_mode)
-+              load_waveform((u8 *) par->firmware->data, par->firmware->size,
-+                              m, par->current_wf_temp, par);
-+
-+      for (;;) {
-+              if (likely(!check_err(par))) {
-+                      metronome_display_cmd(par);
-+                      break;
-+              }
-+
-+              par->board->set_stdby(par, 0);
-+              dev_warn(&par->pdev->dev, "Resetting Metronome\n");
-+              par->board->set_rst(par, 0);
-+              mdelay(1);
-+              if (par->board->power_ctl)
-+                      par->board->power_ctl(par, METRONOME_POWER_OFF);
-+
-+              mdelay(1);
-+              load_waveform((u8 *) par->firmware->data, par->firmware->size,
-+                              WF_MODE_GC, par->current_wf_temp, par);
-+
-+              if (par->board->power_ctl)
-+                      par->board->power_ctl(par, METRONOME_POWER_ON);
-+              metronome_bootup(par);
-+      }
-+
-+      par->is_first_update = 0;
- }
- /* this is called back from the deferred io workqueue */
- static void metronomefb_dpy_deferred_io(struct fb_info *info,
-                               struct list_head *pagelist)
- {
--      u16 cksum;
--      struct page *cur;
--      struct fb_deferred_io *fbdefio = info->fbdefio;
-       struct metronomefb_par *par = info->par;
--      /* walk the written page list and swizzle the data */
--      list_for_each_entry(cur, &fbdefio->pagelist, lru) {
--              cksum = metronomefb_dpy_update_page(par,
--                                      (cur->index << PAGE_SHIFT));
--              par->metromem_img_csum -= par->csum_table[cur->index];
--              par->csum_table[cur->index] = cksum;
--              par->metromem_img_csum += cksum;
--      }
--
--      metronome_display_cmd(par);
-+      /* We will update entire display because we need to change
-+       * 'previous image' field in pixels which was changed at
-+       * previous refresh
-+       */
-+      mutex_lock(&par->lock);
-+      metronomefb_dpy_update(par, 0);
-+      mutex_unlock(&par->lock);
- }
- static void metronomefb_fillrect(struct fb_info *info,
-@@ -488,8 +745,10 @@ static void metronomefb_fillrect(struct
- {
-       struct metronomefb_par *par = info->par;
-+      mutex_lock(&par->lock);
-       sys_fillrect(info, rect);
--      metronomefb_dpy_update(par);
-+      metronomefb_dpy_update(par, 0);
-+      mutex_unlock(&par->lock);
- }
- static void metronomefb_copyarea(struct fb_info *info,
-@@ -497,8 +756,10 @@ static void metronomefb_copyarea(struct
- {
-       struct metronomefb_par *par = info->par;
-+      mutex_lock(&par->lock);
-       sys_copyarea(info, area);
--      metronomefb_dpy_update(par);
-+      metronomefb_dpy_update(par, 0);
-+      mutex_unlock(&par->lock);
- }
- static void metronomefb_imageblit(struct fb_info *info,
-@@ -506,8 +767,10 @@ static void metronomefb_imageblit(struct
- {
-       struct metronomefb_par *par = info->par;
-+      mutex_lock(&par->lock);
-       sys_imageblit(info, image);
--      metronomefb_dpy_update(par);
-+      metronomefb_dpy_update(par, 0);
-+      mutex_unlock(&par->lock);
- }
- /*
-@@ -545,30 +808,229 @@ static ssize_t metronomefb_write(struct
-       dst = (void __force *)(info->screen_base + p);
-+      mutex_lock(&par->lock);
-+
-       if (copy_from_user(dst, buf, count))
-               err = -EFAULT;
-       if  (!err)
-               *ppos += count;
--      metronomefb_dpy_update(par);
-+      metronomefb_dpy_update(par, 0);
-+      mutex_unlock(&par->lock);
-       return (err) ? err : count;
- }
-+static int metronome_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
-+{
-+      struct metronomefb_par *par = info->par;
-+
-+      var->grayscale = 1;
-+
-+      switch (par->rotation) {
-+      case FB_ROTATE_CW:
-+      case FB_ROTATE_CCW:
-+              if (par->epd_frame->fw == var->yres && par->epd_frame->fh == var->xres)
-+                      return 0;
-+              break;
-+      case FB_ROTATE_UD:
-+      default:
-+              if (par->epd_frame->fw == var->xres && par->epd_frame->fh == var->yres)
-+                      return 0;
-+              break;
-+      }
-+
-+      return -EINVAL;
-+}
-+
-+static int metronomefb_set_par(struct fb_info *info)
-+{
-+      struct metronomefb_par *par = info->par;
-+
-+      par->rotation = (par->board->panel_rotation + info->var.rotate) % 4;
-+
-+      switch (par->rotation) {
-+      case FB_ROTATE_CW:
-+      case FB_ROTATE_CCW:
-+              info->fix.line_length = par->epd_frame->fh;
-+              break;
-+      case FB_ROTATE_UD:
-+      default:
-+              info->fix.line_length = par->epd_frame->fw;
-+              break;
-+      }
-+
-+      mutex_lock(&par->lock);
-+      metronomefb_dpy_update(info->par, 1);
-+      mutex_unlock(&par->lock);
-+
-+      return 0;
-+}
-+
- static struct fb_ops metronomefb_ops = {
-       .owner          = THIS_MODULE,
-       .fb_write       = metronomefb_write,
-       .fb_fillrect    = metronomefb_fillrect,
-       .fb_copyarea    = metronomefb_copyarea,
-       .fb_imageblit   = metronomefb_imageblit,
-+      .fb_check_var   = metronome_check_var,
-+      .fb_set_par     = metronomefb_set_par,
- };
- static struct fb_deferred_io metronomefb_defio = {
--      .delay          = HZ,
-+      .delay          = HZ / 4,
-       .deferred_io    = metronomefb_dpy_deferred_io,
- };
-+static ssize_t metronomefb_defio_delay_show(struct device *dev,
-+              struct device_attribute *attr, char *buf)
-+{
-+      struct fb_info *info = dev_get_drvdata(dev);
-+
-+      sprintf(buf, "%lu\n", info->fbdefio->delay * 1000 / HZ);
-+      return strlen(buf) + 1;
-+}
-+
-+static ssize_t metronomefb_defio_delay_store(struct device *dev,
-+              struct device_attribute *attr, const char *buf, size_t size)
-+{
-+      struct fb_info *info = dev_get_drvdata(dev);
-+      char *after;
-+      unsigned long state = simple_strtoul(buf, &after, 10);
-+      size_t count = after - buf;
-+      ssize_t ret = -EINVAL;
-+
-+      if (*after && isspace(*after))
-+              count++;
-+
-+      state = state * HZ / 1000;
-+
-+      if (!state)
-+              state = 1;
-+
-+      if (count == size) {
-+              ret = count;
-+              info->fbdefio->delay = state;
-+      }
-+
-+      return ret;
-+}
-+
-+static ssize_t metronomefb_manual_refresh_thr_show(struct device *dev,
-+              struct device_attribute *attr, char *buf)
-+{
-+      struct fb_info *info = dev_get_drvdata(dev);
-+      struct metronomefb_par *par = info->par;
-+
-+      return sprintf(buf, "%u\n", par->manual_refresh_threshold);
-+}
-+
-+static ssize_t metronomefb_manual_refresh_thr_store(struct device *dev,
-+              struct device_attribute *attr, const char *buf, size_t size)
-+{
-+      struct fb_info *info = dev_get_drvdata(dev);
-+      struct metronomefb_par *par = info->par;
-+      char *after;
-+      unsigned long val = simple_strtoul(buf, &after, 10);
-+      size_t count = after - buf;
-+      ssize_t ret = -EINVAL;
-+
-+      if (*after && isspace(*after))
-+              count++;
-+
-+      if (val > 100)
-+              return -EINVAL;
-+
-+
-+      if (count == size) {
-+              ret = count;
-+              par->manual_refresh_threshold = val;
-+      }
-+
-+      return ret;
-+}
-+
-+static ssize_t metronomefb_autorefresh_interval_show(struct device *dev,
-+              struct device_attribute *attr, char *buf)
-+{
-+      struct fb_info *info = dev_get_drvdata(dev);
-+      struct metronomefb_par *par = info->par;
-+
-+      return sprintf(buf, "%u\n", par->partial_autorefresh_interval);
-+}
-+
-+static ssize_t metronomefb_autorefresh_interval_store(struct device *dev,
-+              struct device_attribute *attr, const char *buf, size_t size)
-+{
-+      struct fb_info *info = dev_get_drvdata(dev);
-+      struct metronomefb_par *par = info->par;
-+      char *after;
-+      unsigned long val = simple_strtoul(buf, &after, 10);
-+      size_t count = after - buf;
-+      ssize_t ret = -EINVAL;
-+
-+      if (*after && isspace(*after))
-+              count++;
-+
-+      if (val > 100)
-+              return -EINVAL;
-+
-+
-+      if (count == size) {
-+              ret = count;
-+              par->partial_autorefresh_interval = val;
-+      }
-+
-+      return ret;
-+}
-+
-+static ssize_t metronomefb_temp_show(struct device *dev,
-+              struct device_attribute *attr, char *buf)
-+{
-+      struct fb_info *info = dev_get_drvdata(dev);
-+      struct metronomefb_par *par = info->par;
-+
-+      return sprintf(buf, "%u\n", par->current_wf_temp);
-+}
-+
-+static ssize_t metronomefb_temp_store(struct device *dev,
-+              struct device_attribute *attr, const char *buf, size_t size)
-+{
-+      struct fb_info *info = dev_get_drvdata(dev);
-+      struct metronomefb_par *par = info->par;
-+      char *after;
-+      unsigned long val = simple_strtoul(buf, &after, 10);
-+      size_t count = after - buf;
-+      ssize_t ret = -EINVAL;
-+
-+      if (*after && isspace(*after))
-+              count++;
-+
-+      if (val > 100)
-+              return -EINVAL;
-+
-+
-+      if (count == size) {
-+              ret = count;
-+              if (val != par->current_wf_temp)
-+                      load_waveform((u8 *) par->firmware->data, par->firmware->size,
-+                                      par->current_wf_mode, val, par);
-+      }
-+
-+      return ret;
-+}
-+
-+DEVICE_ATTR(defio_delay, 0644,
-+              metronomefb_defio_delay_show, metronomefb_defio_delay_store);
-+DEVICE_ATTR(manual_refresh_threshold, 0644,
-+              metronomefb_manual_refresh_thr_show, metronomefb_manual_refresh_thr_store);
-+DEVICE_ATTR(temp, 0644,
-+              metronomefb_temp_show, metronomefb_temp_store);
-+DEVICE_ATTR(autorefresh_interval, 0644,
-+              metronomefb_autorefresh_interval_show, metronomefb_autorefresh_interval_store);
-+
-+
- static int __devinit metronomefb_probe(struct platform_device *dev)
- {
-       struct fb_info *info;
-@@ -607,6 +1069,9 @@ static int __devinit metronomefb_probe(s
-       panel_type = board->get_panel_type();
-       switch (panel_type) {
-+      case 5:
-+              epd_dt_index = 3;
-+              break;
-       case 6:
-               epd_dt_index = 0;
-               break;
-@@ -632,29 +1097,59 @@ static int __devinit metronomefb_probe(s
-       if (!videomemory)
-               goto err_fb_rel;
--      memset(videomemory, 0, videomemorysize);
-+      memset(videomemory, 0xff, videomemorysize);
-       info->screen_base = (char __force __iomem *)videomemory;
-       info->fbops = &metronomefb_ops;
--      metronomefb_fix.line_length = fw;
--      metronomefb_var.xres = fw;
--      metronomefb_var.yres = fh;
--      metronomefb_var.xres_virtual = fw;
--      metronomefb_var.yres_virtual = fh;
-       info->var = metronomefb_var;
-       info->fix = metronomefb_fix;
--      info->fix.smem_len = videomemorysize;
-+      switch (board->panel_rotation) {
-+      case FB_ROTATE_CW:
-+      case FB_ROTATE_CCW:
-+              info->var.xres = fh;
-+              info->var.yres = fw;
-+              info->var.xres_virtual = fh;
-+              info->var.yres_virtual = fw;
-+              info->fix.line_length = fh;
-+              break;
-+      case FB_ROTATE_UD:
-+      default:
-+              info->var.xres = fw;
-+              info->var.yres = fh;
-+              info->var.xres_virtual = fw;
-+              info->var.yres_virtual = fh;
-+              info->fix.line_length = fw;
-+              break;
-+      }
-+      info->fix.smem_len = fw * fh; /* Real size of image area */
-       par = info->par;
-       par->info = info;
-       par->board = board;
--      par->dt = epd_dt_index;
-+      par->epd_frame = &epd_frame_table[epd_dt_index];
-+      par->pdev = dev;
-+
-+      par->rotation = board->panel_rotation;
-+
-+      par->fxbuckets = kmalloc((fw / 4 + 1) * sizeof(*par->fxbuckets), GFP_KERNEL);
-+      if (!par->fxbuckets)
-+              goto err_vfree;
-+
-+      par->fybuckets = kmalloc(fh * sizeof(*par->fybuckets), GFP_KERNEL);
-+      if (!par->fybuckets)
-+              goto err_fxbuckets;
-+
-       init_waitqueue_head(&par->waitq);
-+      par->manual_refresh_threshold = DEFAULT_MANUAL_REFRESH_THRESHOLD;
-+      par->partial_autorefresh_interval = 256;
-+      par->partial_updates_count = 0;
-+      par->is_first_update = 1;
-+      mutex_init(&par->lock);
-       /* this table caches per page csum values. */
-       par->csum_table = vmalloc(videomemorysize/PAGE_SIZE);
-       if (!par->csum_table)
--              goto err_vfree;
-+              goto err_fybuckets;
-       /* the physical framebuffer that we use is setup by
-        * the platform device driver. It will provide us
-@@ -684,13 +1179,19 @@ static int __devinit metronomefb_probe(s
-               goto err_csum_table;
-       }
--      retval = load_waveform((u8 *) fw_entry->data, fw_entry->size, 3, 31,
-+      retval = load_waveform((u8 *) fw_entry->data, fw_entry->size, WF_MODE_GC, temp,
-                               par);
--      release_firmware(fw_entry);
-       if (retval < 0) {
-               dev_err(&dev->dev, "Failed processing waveform\n");
-               goto err_csum_table;
-       }
-+      par->firmware = fw_entry;
-+
-+      retval = board->setup_io(par);
-+      if (retval) {
-+              dev_err(&dev->dev, "metronomefb: setup_io() failed\n");
-+              goto err_csum_table;
-+      }
-       if (board->setup_irq(info))
-               goto err_csum_table;
-@@ -712,7 +1213,7 @@ static int __devinit metronomefb_probe(s
-       /* set cmap */
-       for (i = 0; i < 8; i++)
--              info->cmap.red[i] = (((2*i)+1)*(0xFFFF))/16;
-+              info->cmap.red[i] = ((2 * i + 1)*(0xFFFF))/16;
-       memcpy(info->cmap.green, info->cmap.red, sizeof(u16)*8);
-       memcpy(info->cmap.blue, info->cmap.red, sizeof(u16)*8);
-@@ -722,18 +1223,47 @@ static int __devinit metronomefb_probe(s
-       platform_set_drvdata(dev, info);
--      dev_dbg(&dev->dev,
-+      retval = device_create_file(info->dev, &dev_attr_defio_delay);
-+      if (retval)
-+              goto err_devattr_defio_delay;
-+
-+      retval = device_create_file(info->dev, &dev_attr_manual_refresh_threshold);
-+      if (retval)
-+              goto err_devattr_manual_refresh_thr;
-+
-+      retval = device_create_file(info->dev, &dev_attr_temp);
-+      if (retval)
-+              goto err_devattr_temp;
-+
-+      retval = device_create_file(info->dev, &dev_attr_autorefresh_interval);
-+      if (retval)
-+              goto err_devattr_autorefresh;
-+
-+      dev_info(&dev->dev,
-               "fb%d: Metronome frame buffer device, using %dK of video"
-               " memory\n", info->node, videomemorysize >> 10);
-       return 0;
-+      device_remove_file(info->dev, &dev_attr_autorefresh_interval);
-+err_devattr_autorefresh:
-+      device_remove_file(info->dev, &dev_attr_temp);
-+err_devattr_temp:
-+      device_remove_file(info->dev, &dev_attr_manual_refresh_threshold);
-+err_devattr_manual_refresh_thr:
-+      device_remove_file(info->dev, &dev_attr_defio_delay);
-+err_devattr_defio_delay:
-+      unregister_framebuffer(info);
- err_cmap:
-       fb_dealloc_cmap(&info->cmap);
- err_free_irq:
-       board->cleanup(par);
- err_csum_table:
-       vfree(par->csum_table);
-+err_fybuckets:
-+      kfree(par->fybuckets);
-+err_fxbuckets:
-+      kfree(par->fxbuckets);
- err_vfree:
-       vfree(videomemory);
- err_fb_rel:
-@@ -750,26 +1280,76 @@ static int __devexit metronomefb_remove(
-       if (info) {
-               struct metronomefb_par *par = info->par;
-+              par->board->set_stdby(par, 0);
-+              mdelay(1);
-+              if (par->board->power_ctl)
-+                      par->board->power_ctl(par, METRONOME_POWER_OFF);
-+
-+              device_remove_file(info->dev, &dev_attr_autorefresh_interval);
-+              device_remove_file(info->dev, &dev_attr_temp);
-+              device_remove_file(info->dev, &dev_attr_manual_refresh_threshold);
-+              device_remove_file(info->dev, &dev_attr_defio_delay);
-               unregister_framebuffer(info);
-               fb_deferred_io_cleanup(info);
-               fb_dealloc_cmap(&info->cmap);
-               par->board->cleanup(par);
-               vfree(par->csum_table);
-+              kfree(par->fybuckets);
-+              kfree(par->fxbuckets);
-               vfree((void __force *)info->screen_base);
-               module_put(par->board->owner);
-+              release_firmware(par->firmware);
-               dev_dbg(&dev->dev, "calling release\n");
-               framebuffer_release(info);
-       }
-       return 0;
- }
-+#ifdef CONFIG_PM
-+static int metronomefb_suspend(struct platform_device *pdev, pm_message_t message)
-+{
-+      struct fb_info *info = platform_get_drvdata(pdev);
-+      struct metronomefb_par *par = info->par;
-+
-+      par->board->set_stdby(par, 0);
-+      par->board->set_rst(par, 0);
-+      if (par->board->power_ctl)
-+              par->board->power_ctl(par, METRONOME_POWER_OFF);
-+
-+
-+      return 0;
-+}
-+
-+static int metronomefb_resume(struct platform_device *pdev)
-+{
-+      struct fb_info *info = platform_get_drvdata(pdev);
-+      struct metronomefb_par *par = info->par;
-+
-+      if (par->board->power_ctl)
-+              par->board->power_ctl(par, METRONOME_POWER_ON);
-+
-+      mutex_lock(&par->lock);
-+      metronome_bootup(par);
-+      mutex_unlock(&par->lock);
-+
-+      return 0;
-+}
-+
-+#else
-+#define metronomefb_suspend NULL
-+#define metronomefb_resume NULL
-+#endif
-+
-+
- static struct platform_driver metronomefb_driver = {
--      .probe  = metronomefb_probe,
--      .remove = metronomefb_remove,
--      .driver = {
--              .owner  = THIS_MODULE,
--              .name   = "metronomefb",
--      },
-+      .driver         = {
-+                      .owner  = THIS_MODULE,
-+                      .name   = "metronomefb",
-+                      },
-+      .probe          = metronomefb_probe,
-+      .remove         = __devexit_p(metronomefb_remove),
-+      .suspend        = metronomefb_suspend,
-+      .resume         = metronomefb_resume,
- };
- static int __init metronomefb_init(void)
-@@ -782,8 +1362,8 @@ static void __exit metronomefb_exit(void
-       platform_driver_unregister(&metronomefb_driver);
- }
--module_param(user_wfm_size, uint, 0);
--MODULE_PARM_DESC(user_wfm_size, "Set custom waveform size");
-+module_param(temp, int, 0);
-+MODULE_PARM_DESC(temp, "Set current temperature");
- module_init(metronomefb_init);
- module_exit(metronomefb_exit);
---- a/include/video/metronomefb.h
-+++ b/include/video/metronomefb.h
-@@ -17,7 +17,9 @@ struct metromem_cmd {
-       u16 opcode;
-       u16 args[((64-2)/2)];
-       u16 csum;
--};
-+} __attribute__((packed));
-+
-+struct epd_frame;
- /* struct used by metronome. board specific stuff comes from *board */
- struct metronomefb_par {
-@@ -27,19 +29,40 @@ struct metronomefb_par {
-       u16 *metromem_img_csum;
-       u16 *csum_table;
-       dma_addr_t metromem_dma;
-+      const struct firmware *firmware;
-       struct fb_info *info;
-       struct metronome_board *board;
-+      struct platform_device *pdev;
-       wait_queue_head_t waitq;
-       u8 frame_count;
-       int extra_size;
--      int dt;
-+      int current_wf_mode;
-+      int current_wf_temp;
-+      unsigned int manual_refresh_threshold;
-+      unsigned int partial_autorefresh_interval;
-+      const struct epd_frame *epd_frame;
-+      u32 *fxbuckets;
-+      u32 *fybuckets;
-+
-+      int rotation;
-+
-+      unsigned int partial_updates_count;
-+      unsigned is_first_update:1;
-+
-+      struct mutex lock;
- };
-+#define METRONOME_POWER_OFF   0
-+#define METRONOME_POWER_ON    1
-+
- /* board specific routines and data */
- struct metronome_board {
-       struct module *owner; /* the platform device */
-+      void (*power_ctl)(struct metronomefb_par *, int);
-       void (*set_rst)(struct metronomefb_par *, int);
-       void (*set_stdby)(struct metronomefb_par *, int);
-+      int (*get_err)(struct metronomefb_par *);
-+      int (*get_rdy)(struct metronomefb_par *);
-       void (*cleanup)(struct metronomefb_par *);
-       int (*met_wait_event)(struct metronomefb_par *);
-       int (*met_wait_event_intr)(struct metronomefb_par *);
-@@ -47,11 +70,7 @@ struct metronome_board {
-       int (*setup_fb)(struct metronomefb_par *);
-       int (*setup_io)(struct metronomefb_par *);
-       int (*get_panel_type)(void);
--      unsigned char *metromem;
--      int fw;
--      int fh;
--      int wfm_size;
--      struct fb_info *host_fbinfo; /* the host LCD controller's fbi */
-+      int panel_rotation;
- };
- #endif
diff --git a/target/linux/xburst/patches-2.6.37/500-modifier-keys.patch b/target/linux/xburst/patches-2.6.37/500-modifier-keys.patch
deleted file mode 100644 (file)
index af27239..0000000
+++ /dev/null
@@ -1,604 +0,0 @@
-From 04b3a56dce20d33d4c990fa65520449db5db6f1f Mon Sep 17 00:00:00 2001
-From: Lars-Peter Clausen <lars@metafoo.de>
-Date: Sat, 24 Apr 2010 12:22:25 +0200
-Subject: [PATCH 2/5] Modify keymap for ben nanonote
-
----
- drivers/tty/vt/defkeymap.c_shipped |  308 +++++++++++++++++++++++++++---------
- drivers/tty/vt/defkeymap.map       |   74 ++++++---
- 2 files changed, 286 insertions(+), 96 deletions(-)
-
---- a/drivers/tty/vt/defkeymap.c_shipped
-+++ b/drivers/tty/vt/defkeymap.c_shipped
-@@ -9,10 +9,10 @@ u_short plain_map[NR_KEYS] = {
-       0xf200, 0xf01b, 0xf031, 0xf032, 0xf033, 0xf034, 0xf035, 0xf036,
-       0xf037, 0xf038, 0xf039, 0xf030, 0xf02d, 0xf03d, 0xf07f, 0xf009,
-       0xfb71, 0xfb77, 0xfb65, 0xfb72, 0xfb74, 0xfb79, 0xfb75, 0xfb69,
--      0xfb6f, 0xfb70, 0xf05b, 0xf05d, 0xf201, 0xf702, 0xfb61, 0xfb73,
-+      0xfb6f, 0xfb70, 0xf05b, 0xf05d, 0xf201, 0xf706, 0xfb61, 0xfb73,
-       0xfb64, 0xfb66, 0xfb67, 0xfb68, 0xfb6a, 0xfb6b, 0xfb6c, 0xf03b,
-       0xf027, 0xf060, 0xf700, 0xf05c, 0xfb7a, 0xfb78, 0xfb63, 0xfb76,
--      0xfb62, 0xfb6e, 0xfb6d, 0xf02c, 0xf02e, 0xf02f, 0xf700, 0xf30c,
-+      0xfb62, 0xfb6e, 0xfb6d, 0xf02c, 0xf02e, 0xf02f, 0xf701, 0xf30c,
-       0xf703, 0xf020, 0xf207, 0xf100, 0xf101, 0xf102, 0xf103, 0xf104,
-       0xf105, 0xf106, 0xf107, 0xf108, 0xf109, 0xf208, 0xf209, 0xf307,
-       0xf308, 0xf309, 0xf30b, 0xf304, 0xf305, 0xf306, 0xf30a, 0xf301,
-@@ -22,54 +22,102 @@ u_short plain_map[NR_KEYS] = {
-       0xf118, 0xf601, 0xf602, 0xf117, 0xf600, 0xf119, 0xf115, 0xf116,
-       0xf11a, 0xf10c, 0xf10d, 0xf11b, 0xf11c, 0xf110, 0xf311, 0xf11d,
-       0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
- };
--u_short shift_map[NR_KEYS] = {
-+static u_short shift_map[NR_KEYS] = {
-       0xf200, 0xf01b, 0xf021, 0xf040, 0xf023, 0xf024, 0xf025, 0xf05e,
-       0xf026, 0xf02a, 0xf028, 0xf029, 0xf05f, 0xf02b, 0xf07f, 0xf009,
-       0xfb51, 0xfb57, 0xfb45, 0xfb52, 0xfb54, 0xfb59, 0xfb55, 0xfb49,
--      0xfb4f, 0xfb50, 0xf07b, 0xf07d, 0xf201, 0xf702, 0xfb41, 0xfb53,
-+      0xfb4f, 0xfb50, 0xf07b, 0xf07d, 0xf201, 0xf706, 0xfb41, 0xfb53,
-       0xfb44, 0xfb46, 0xfb47, 0xfb48, 0xfb4a, 0xfb4b, 0xfb4c, 0xf03a,
-       0xf022, 0xf07e, 0xf700, 0xf07c, 0xfb5a, 0xfb58, 0xfb43, 0xfb56,
--      0xfb42, 0xfb4e, 0xfb4d, 0xf03c, 0xf03e, 0xf03f, 0xf700, 0xf30c,
-+      0xfb42, 0xfb4e, 0xfb4d, 0xf03b, 0xf03a, 0xf03f, 0xf701, 0xf30c,
-       0xf703, 0xf020, 0xf207, 0xf10a, 0xf10b, 0xf10c, 0xf10d, 0xf10e,
-       0xf10f, 0xf110, 0xf111, 0xf112, 0xf113, 0xf213, 0xf203, 0xf307,
-       0xf308, 0xf309, 0xf30b, 0xf304, 0xf305, 0xf306, 0xf30a, 0xf301,
-       0xf302, 0xf303, 0xf300, 0xf310, 0xf206, 0xf200, 0xf03e, 0xf10a,
-       0xf10b, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
--      0xf30e, 0xf702, 0xf30d, 0xf200, 0xf701, 0xf205, 0xf114, 0xf603,
-+      0xf30e, 0xf702, 0xf30d, 0xf01c, 0xf701, 0xf205, 0xf114, 0xf603,
-       0xf20b, 0xf601, 0xf602, 0xf117, 0xf600, 0xf20a, 0xf115, 0xf116,
-       0xf11a, 0xf10c, 0xf10d, 0xf11b, 0xf11c, 0xf110, 0xf311, 0xf11d,
-       0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
- };
--u_short altgr_map[NR_KEYS] = {
-+static u_short altgr_map[NR_KEYS] = {
-       0xf200, 0xf200, 0xf200, 0xf040, 0xf200, 0xf024, 0xf200, 0xf200,
--      0xf07b, 0xf05b, 0xf05d, 0xf07d, 0xf05c, 0xf200, 0xf200, 0xf200,
--      0xfb71, 0xfb77, 0xf918, 0xfb72, 0xfb74, 0xfb79, 0xfb75, 0xfb69,
--      0xfb6f, 0xfb70, 0xf200, 0xf07e, 0xf201, 0xf702, 0xf914, 0xfb73,
--      0xf917, 0xf919, 0xfb67, 0xfb68, 0xfb6a, 0xfb6b, 0xfb6c, 0xf200,
--      0xf200, 0xf200, 0xf700, 0xf200, 0xfb7a, 0xfb78, 0xf916, 0xfb76,
--      0xf915, 0xfb6e, 0xfb6d, 0xf200, 0xf200, 0xf200, 0xf700, 0xf30c,
--      0xf703, 0xf200, 0xf207, 0xf50c, 0xf50d, 0xf50e, 0xf50f, 0xf510,
--      0xf511, 0xf512, 0xf513, 0xf514, 0xf515, 0xf208, 0xf202, 0xf911,
-+      0xf07b, 0xf05b, 0xf05d, 0xf07d, 0xf05c, 0xf07e, 0xf008, 0xf200,
-+      0xf021, 0xf040, 0xf023, 0xf024, 0xf025, 0xf05e, 0xf026, 0xf02a,
-+      0xf028, 0xf029, 0xf200, 0xf07e, 0xf201, 0xf706, 0xf0b0, 0xf0a8,
-+      0xf0a4, 0xf02d, 0xf05f, 0xf07b, 0xf05b, 0xf05d, 0xf07d, 0xf200,
-+      0xf200, 0xf200, 0xf700, 0xf200, 0xf039, 0xf030, 0xf916, 0xfb76,
-+      0xf915, 0xf03c, 0xf03e, 0xf027, 0xf022, 0xf200, 0xf701, 0xf30c,
-+      0xf703, 0xf200, 0xf207, 0xf031, 0xf032, 0xf033, 0xf034, 0xf035,
-+      0xf036, 0xf037, 0xf038, 0xf514, 0xf515, 0xf208, 0xf202, 0xf911,
-       0xf912, 0xf913, 0xf30b, 0xf90e, 0xf90f, 0xf910, 0xf30a, 0xf90b,
-       0xf90c, 0xf90d, 0xf90a, 0xf310, 0xf206, 0xf200, 0xf07c, 0xf516,
-       0xf517, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
--      0xf30e, 0xf702, 0xf30d, 0xf200, 0xf701, 0xf205, 0xf114, 0xf603,
-+      0xf30e, 0xf702, 0xf30d, 0xf01c, 0xf701, 0xf205, 0xf114, 0xf603,
-       0xf118, 0xf601, 0xf602, 0xf117, 0xf600, 0xf119, 0xf115, 0xf116,
-       0xf11a, 0xf10c, 0xf10d, 0xf11b, 0xf11c, 0xf110, 0xf311, 0xf11d,
-       0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
- };
--u_short ctrl_map[NR_KEYS] = {
-+static u_short ctrl_map[NR_KEYS] = {
-       0xf200, 0xf200, 0xf200, 0xf000, 0xf01b, 0xf01c, 0xf01d, 0xf01e,
--      0xf01f, 0xf07f, 0xf200, 0xf200, 0xf01f, 0xf200, 0xf008, 0xf200,
-+      0xf01f, 0xf07f, 0xf200, 0xf200, 0xf01f, 0xf200, 0xf200, 0xf200,
-       0xf011, 0xf017, 0xf005, 0xf012, 0xf014, 0xf019, 0xf015, 0xf009,
--      0xf00f, 0xf010, 0xf01b, 0xf01d, 0xf201, 0xf702, 0xf001, 0xf013,
-+      0xf00f, 0xf010, 0xf01b, 0xf01d, 0xf201, 0xf706, 0xf001, 0xf013,
-       0xf004, 0xf006, 0xf007, 0xf008, 0xf00a, 0xf00b, 0xf00c, 0xf200,
-       0xf007, 0xf000, 0xf700, 0xf01c, 0xf01a, 0xf018, 0xf003, 0xf016,
--      0xf002, 0xf00e, 0xf00d, 0xf200, 0xf20e, 0xf07f, 0xf700, 0xf30c,
-+      0xf002, 0xf00e, 0xf00d, 0xf200, 0xf20e, 0xf07f, 0xf701, 0xf30c,
-       0xf703, 0xf000, 0xf207, 0xf100, 0xf101, 0xf102, 0xf103, 0xf104,
-       0xf105, 0xf106, 0xf107, 0xf108, 0xf109, 0xf208, 0xf204, 0xf307,
-       0xf308, 0xf309, 0xf30b, 0xf304, 0xf305, 0xf306, 0xf30a, 0xf301,
-@@ -79,35 +127,67 @@ u_short ctrl_map[NR_KEYS] = {
-       0xf118, 0xf601, 0xf602, 0xf117, 0xf600, 0xf119, 0xf115, 0xf116,
-       0xf11a, 0xf10c, 0xf10d, 0xf11b, 0xf11c, 0xf110, 0xf311, 0xf11d,
-       0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
- };
--u_short shift_ctrl_map[NR_KEYS] = {
-+static u_short shift_ctrl_map[NR_KEYS] = {
-       0xf200, 0xf200, 0xf200, 0xf000, 0xf200, 0xf200, 0xf200, 0xf200,
-       0xf200, 0xf200, 0xf200, 0xf200, 0xf01f, 0xf200, 0xf200, 0xf200,
-       0xf011, 0xf017, 0xf005, 0xf012, 0xf014, 0xf019, 0xf015, 0xf009,
--      0xf00f, 0xf010, 0xf200, 0xf200, 0xf201, 0xf702, 0xf001, 0xf013,
-+      0xf00f, 0xf010, 0xf200, 0xf200, 0xf201, 0xf706, 0xf001, 0xf013,
-       0xf004, 0xf006, 0xf007, 0xf008, 0xf00a, 0xf00b, 0xf00c, 0xf200,
-       0xf200, 0xf200, 0xf700, 0xf200, 0xf01a, 0xf018, 0xf003, 0xf016,
--      0xf002, 0xf00e, 0xf00d, 0xf200, 0xf200, 0xf200, 0xf700, 0xf30c,
-+      0xf002, 0xf00e, 0xf00d, 0xf200, 0xf200, 0xf200, 0xf701, 0xf30c,
-       0xf703, 0xf200, 0xf207, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-       0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf208, 0xf200, 0xf307,
-       0xf308, 0xf309, 0xf30b, 0xf304, 0xf305, 0xf306, 0xf30a, 0xf301,
-       0xf302, 0xf303, 0xf300, 0xf310, 0xf206, 0xf200, 0xf200, 0xf200,
-       0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
--      0xf30e, 0xf702, 0xf30d, 0xf200, 0xf701, 0xf205, 0xf114, 0xf603,
-+      0xf30e, 0xf702, 0xf30d, 0xf01c, 0xf701, 0xf205, 0xf114, 0xf603,
-       0xf118, 0xf601, 0xf602, 0xf117, 0xf600, 0xf119, 0xf115, 0xf116,
-       0xf11a, 0xf10c, 0xf10d, 0xf11b, 0xf11c, 0xf110, 0xf311, 0xf11d,
-       0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
- };
--u_short alt_map[NR_KEYS] = {
-+static u_short alt_map[NR_KEYS] = {
-       0xf200, 0xf81b, 0xf831, 0xf832, 0xf833, 0xf834, 0xf835, 0xf836,
-       0xf837, 0xf838, 0xf839, 0xf830, 0xf82d, 0xf83d, 0xf87f, 0xf809,
-       0xf871, 0xf877, 0xf865, 0xf872, 0xf874, 0xf879, 0xf875, 0xf869,
--      0xf86f, 0xf870, 0xf85b, 0xf85d, 0xf80d, 0xf702, 0xf861, 0xf873,
-+      0xf86f, 0xf870, 0xf85b, 0xf85d, 0xf80d, 0xf706, 0xf861, 0xf873,
-       0xf864, 0xf866, 0xf867, 0xf868, 0xf86a, 0xf86b, 0xf86c, 0xf83b,
-       0xf827, 0xf860, 0xf700, 0xf85c, 0xf87a, 0xf878, 0xf863, 0xf876,
--      0xf862, 0xf86e, 0xf86d, 0xf82c, 0xf82e, 0xf82f, 0xf700, 0xf30c,
-+      0xf862, 0xf86e, 0xf86d, 0xf200, 0xf200, 0xf82f, 0xf701, 0xf30c,
-       0xf703, 0xf820, 0xf207, 0xf500, 0xf501, 0xf502, 0xf503, 0xf504,
-       0xf505, 0xf506, 0xf507, 0xf508, 0xf509, 0xf208, 0xf209, 0xf907,
-       0xf908, 0xf909, 0xf30b, 0xf904, 0xf905, 0xf906, 0xf30a, 0xf901,
-@@ -117,35 +197,115 @@ u_short alt_map[NR_KEYS] = {
-       0xf118, 0xf210, 0xf211, 0xf117, 0xf600, 0xf119, 0xf115, 0xf116,
-       0xf11a, 0xf10c, 0xf10d, 0xf11b, 0xf11c, 0xf110, 0xf311, 0xf11d,
-       0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
- };
--u_short ctrl_alt_map[NR_KEYS] = {
-+static u_short ctrl_alt_map[NR_KEYS] = {
-       0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-       0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-       0xf811, 0xf817, 0xf805, 0xf812, 0xf814, 0xf819, 0xf815, 0xf809,
--      0xf80f, 0xf810, 0xf200, 0xf200, 0xf201, 0xf702, 0xf801, 0xf813,
-+      0xf80f, 0xf810, 0xf200, 0xf200, 0xf201, 0xf706, 0xf801, 0xf813,
-       0xf804, 0xf806, 0xf807, 0xf808, 0xf80a, 0xf80b, 0xf80c, 0xf200,
-       0xf200, 0xf200, 0xf700, 0xf200, 0xf81a, 0xf818, 0xf803, 0xf816,
--      0xf802, 0xf80e, 0xf80d, 0xf200, 0xf200, 0xf200, 0xf700, 0xf30c,
-+      0xf802, 0xf80e, 0xf80d, 0xf200, 0xf200, 0xf200, 0xf701, 0xf30c,
-       0xf703, 0xf200, 0xf207, 0xf500, 0xf501, 0xf502, 0xf503, 0xf504,
-       0xf505, 0xf506, 0xf507, 0xf508, 0xf509, 0xf208, 0xf200, 0xf307,
-       0xf308, 0xf309, 0xf30b, 0xf304, 0xf305, 0xf306, 0xf30a, 0xf301,
-       0xf302, 0xf303, 0xf300, 0xf20c, 0xf206, 0xf200, 0xf200, 0xf50a,
-       0xf50b, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
--      0xf30e, 0xf702, 0xf30d, 0xf200, 0xf701, 0xf205, 0xf114, 0xf603,
-+      0xf30e, 0xf702, 0xf30d, 0xf01c, 0xf701, 0xf205, 0xf114, 0xf603,
-       0xf118, 0xf601, 0xf602, 0xf117, 0xf600, 0xf119, 0xf115, 0xf20c,
-       0xf11a, 0xf10c, 0xf10d, 0xf11b, 0xf11c, 0xf110, 0xf311, 0xf11d,
-       0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+};
-+
-+static u_short ctl_map[NR_KEYS] = {
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf033, 0xf200, 0xf200,
-+      0xfb71, 0xfb77, 0xfb65, 0xfb72, 0xfb74, 0xfb79, 0xf037, 0xf038,
-+      0xf039, 0xfb70, 0xf200, 0xf200, 0xf201, 0xf706, 0xfb61, 0xfb73,
-+      0xfb64, 0xfb66, 0xfb67, 0xfb68, 0xf034, 0xf035, 0xf036, 0xf200,
-+      0xf200, 0xf200, 0xf700, 0xf200, 0xfb7a, 0xfb78, 0xfb63, 0xfb76,
-+      0xfb62, 0xf031, 0xf032, 0xf200, 0xf200, 0xf030, 0xf701, 0xf30c,
-+      0xf703, 0xf200, 0xf207, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf208, 0xf200, 0xf307,
-+      0xf308, 0xf309, 0xf30b, 0xf304, 0xf305, 0xf306, 0xf30a, 0xf301,
-+      0xf302, 0xf303, 0xf300, 0xf310, 0xf206, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf30e, 0xf702, 0xf30d, 0xf01c, 0xf701, 0xf205, 0xf114, 0xf603,
-+      0xf118, 0xf601, 0xf602, 0xf117, 0xf600, 0xf119, 0xf115, 0xf116,
-+      0xf11a, 0xf10c, 0xf10d, 0xf11b, 0xf11c, 0xf110, 0xf311, 0xf11d,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
-+      0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200,
- };
- ushort *key_maps[MAX_NR_KEYMAPS] = {
--      plain_map, shift_map, altgr_map, NULL,
--      ctrl_map, shift_ctrl_map, NULL, NULL,
--      alt_map, NULL, NULL, NULL,
--      ctrl_alt_map, NULL
-+      plain_map, shift_map, altgr_map, 0,
-+      ctrl_map, shift_ctrl_map, 0, 0,
-+      alt_map, 0, 0, 0,
-+      ctrl_alt_map, 0, 0, 0,
-+      0, 0, 0, 0,
-+      0, 0, 0, 0,
-+      0, 0, 0, 0,
-+      0, 0, 0, 0,
-+      0, 0, 0, 0,
-+      0, 0, 0, 0,
-+      0, 0, 0, 0,
-+      0, 0, 0, 0,
-+      0, 0, 0, 0,
-+      0, 0, 0, 0,
-+      0, 0, 0, 0,
-+      0, 0, 0, 0,
-+      ctl_map,        0
- };
--unsigned int keymap_count = 7;
-+unsigned int keymap_count = 8;
- /*
-  * Philosophy: most people do not define more strings, but they who do
-@@ -216,47 +376,47 @@ char *func_table[MAX_NR_FUNC] = {
-       func_buf + 135,
-       func_buf + 140,
-       func_buf + 145,
--      NULL,
--      NULL,
-+      0,
-+      0,
-       func_buf + 149,
--      NULL,
-+      0,
- };
--struct kbdiacruc accent_table[MAX_DIACR] = {
--      {'`', 'A', 0300},       {'`', 'a', 0340},
--      {'\'', 'A', 0301},      {'\'', 'a', 0341},
--      {'^', 'A', 0302},       {'^', 'a', 0342},
--      {'~', 'A', 0303},       {'~', 'a', 0343},
--      {'"', 'A', 0304},       {'"', 'a', 0344},
--      {'O', 'A', 0305},       {'o', 'a', 0345},
--      {'0', 'A', 0305},       {'0', 'a', 0345},
--      {'A', 'A', 0305},       {'a', 'a', 0345},
--      {'A', 'E', 0306},       {'a', 'e', 0346},
--      {',', 'C', 0307},       {',', 'c', 0347},
--      {'`', 'E', 0310},       {'`', 'e', 0350},
--      {'\'', 'E', 0311},      {'\'', 'e', 0351},
--      {'^', 'E', 0312},       {'^', 'e', 0352},
--      {'"', 'E', 0313},       {'"', 'e', 0353},
--      {'`', 'I', 0314},       {'`', 'i', 0354},
--      {'\'', 'I', 0315},      {'\'', 'i', 0355},
--      {'^', 'I', 0316},       {'^', 'i', 0356},
--      {'"', 'I', 0317},       {'"', 'i', 0357},
--      {'-', 'D', 0320},       {'-', 'd', 0360},
--      {'~', 'N', 0321},       {'~', 'n', 0361},
--      {'`', 'O', 0322},       {'`', 'o', 0362},
--      {'\'', 'O', 0323},      {'\'', 'o', 0363},
--      {'^', 'O', 0324},       {'^', 'o', 0364},
--      {'~', 'O', 0325},       {'~', 'o', 0365},
--      {'"', 'O', 0326},       {'"', 'o', 0366},
--      {'/', 'O', 0330},       {'/', 'o', 0370},
--      {'`', 'U', 0331},       {'`', 'u', 0371},
--      {'\'', 'U', 0332},      {'\'', 'u', 0372},
--      {'^', 'U', 0333},       {'^', 'u', 0373},
--      {'"', 'U', 0334},       {'"', 'u', 0374},
--      {'\'', 'Y', 0335},      {'\'', 'y', 0375},
--      {'T', 'H', 0336},       {'t', 'h', 0376},
--      {'s', 's', 0337},       {'"', 'y', 0377},
--      {'s', 'z', 0337},       {'i', 'j', 0377},
-+struct kbdiacr accent_table[MAX_DIACR] = {
-+      {'`', 'A', '\300'},     {'`', 'a', '\340'},
-+      {'\'', 'A', '\301'},    {'\'', 'a', '\341'},
-+      {'^', 'A', '\302'},     {'^', 'a', '\342'},
-+      {'~', 'A', '\303'},     {'~', 'a', '\343'},
-+      {'"', 'A', '\304'},     {'"', 'a', '\344'},
-+      {'O', 'A', '\305'},     {'o', 'a', '\345'},
-+      {'0', 'A', '\305'},     {'0', 'a', '\345'},
-+      {'A', 'A', '\305'},     {'a', 'a', '\345'},
-+      {'A', 'E', '\306'},     {'a', 'e', '\346'},
-+      {',', 'C', '\307'},     {',', 'c', '\347'},
-+      {'`', 'E', '\310'},     {'`', 'e', '\350'},
-+      {'\'', 'E', '\311'},    {'\'', 'e', '\351'},
-+      {'^', 'E', '\312'},     {'^', 'e', '\352'},
-+      {'"', 'E', '\313'},     {'"', 'e', '\353'},
-+      {'`', 'I', '\314'},     {'`', 'i', '\354'},
-+      {'\'', 'I', '\315'},    {'\'', 'i', '\355'},
-+      {'^', 'I', '\316'},     {'^', 'i', '\356'},
-+      {'"', 'I', '\317'},     {'"', 'i', '\357'},
-+      {'-', 'D', '\320'},     {'-', 'd', '\360'},
-+      {'~', 'N', '\321'},     {'~', 'n', '\361'},
-+      {'`', 'O', '\322'},     {'`', 'o', '\362'},
-+      {'\'', 'O', '\323'},    {'\'', 'o', '\363'},
-+      {'^', 'O', '\324'},     {'^', 'o', '\364'},
-+      {'~', 'O', '\325'},     {'~', 'o', '\365'},
-+      {'"', 'O', '\326'},     {'"', 'o', '\366'},
-+      {'/', 'O', '\330'},     {'/', 'o', '\370'},
-+      {'`', 'U', '\331'},     {'`', 'u', '\371'},
-+      {'\'', 'U', '\332'},    {'\'', 'u', '\372'},
-+      {'^', 'U', '\333'},     {'^', 'u', '\373'},
-+      {'"', 'U', '\334'},     {'"', 'u', '\374'},
-+      {'\'', 'Y', '\335'},    {'\'', 'y', '\375'},
-+      {'T', 'H', '\336'},     {'t', 'h', '\376'},
-+      {'s', 's', '\337'},     {'"', 'y', '\377'},
-+      {'s', 'z', '\337'},     {'i', 'j', '\377'},
- };
- unsigned int accent_table_size = 68;
---- a/drivers/tty/vt/defkeymap.map
-+++ b/drivers/tty/vt/defkeymap.map
-@@ -1,5 +1,5 @@
- # Default kernel keymap. This uses 7 modifier combinations.
--keymaps 0-2,4-5,8,12
-+keymaps 0-2,4-5,8,12,64
- # Change the above line into
- #     keymaps 0-2,4-6,8,12
- # in case you want the entries
-@@ -45,24 +45,38 @@ keycode  12 = minus            underscor
-       control keycode  12 = Control_underscore
-       shift   control keycode  12 = Control_underscore
-       alt     keycode  12 = Meta_minus      
--keycode  13 = equal            plus            
-+keycode  13 = equal            plus             
-       alt     keycode  13 = Meta_equal      
-+      altgr   keycode  13 = asciitilde 
-+      ctrll   keycode  13 = three
- keycode  14 = Delete           Delete          
--      control keycode  14 = BackSpace
-+      altgr   keycode  14 = BackSpace
-       alt     keycode  14 = Meta_Delete     
- keycode  15 = Tab              Tab             
-       alt     keycode  15 = Meta_Tab        
- keycode  16 = q               
-+      altgr   keycode  16 = exclam
- keycode  17 = w               
-+      altgr   keycode  17 = at
- keycode  18 = e
--      altgr   keycode  18 = Hex_E   
-+      altgr   keycode  18 = numbersign
- keycode  19 = r               
-+      altgr   keycode  19 = dollar
- keycode  20 = t               
-+      altgr   keycode  20 = percent
- keycode  21 = y               
-+      altgr   keycode  21 = asciicircum 
- keycode  22 = u               
-+      altgr   keycode  22 = ampersand
-+      ctrll   keycode  22 = seven
- keycode  23 = i               
-+      altgr   keycode  23 = asterisk
-+      ctrll   keycode  23 = eight
- keycode  24 = o               
-+      altgr   keycode  24 = parenleft
-+      ctrll   keycode  24 = nine
- keycode  25 = p               
-+      altgr   keycode  25 = parenright
- keycode  26 = bracketleft      braceleft       
-       control keycode  26 = Escape          
-       alt     keycode  26 = Meta_bracketleft
-@@ -71,19 +85,28 @@ keycode  27 = bracketright     bracerigh
-       alt     keycode  27 = Meta_bracketright
- keycode  28 = Return          
-       alt     keycode  28 = Meta_Control_m  
--keycode  29 = Control         
-+keycode  29 = CtrlL         
- keycode  30 = a
--      altgr   keycode  30 = Hex_A
-+      altgr   keycode  30 = U+00B0
- keycode  31 = s               
-+      altgr   keycode  31 = U+00A8
- keycode  32 = d
--      altgr   keycode  32 = Hex_D   
-+      altgr   keycode  32 = U+20AC
- keycode  33 = f
--      altgr   keycode  33 = Hex_F               
-+      altgr   keycode  33 = minus
- keycode  34 = g               
-+      altgr   keycode  34 = underscore
- keycode  35 = h               
-+      altgr   keycode  35 = braceleft
- keycode  36 = j               
-+      altgr   keycode  36 = bracketleft
-+      ctrll   keycode  36 = four
- keycode  37 = k               
-+      altgr   keycode  37 = bracketright
-+      ctrll   keycode  37 = five
- keycode  38 = l               
-+      altgr   keycode  38 = braceright
-+      ctrll   keycode  38 = six
- keycode  39 = semicolon        colon           
-       alt     keycode  39 = Meta_semicolon  
- keycode  40 = apostrophe       quotedbl        
-@@ -97,58 +120,65 @@ keycode  43 = backslash        bar
-       control keycode  43 = Control_backslash
-       alt     keycode  43 = Meta_backslash  
- keycode  44 = z               
-+      altgr   keycode  44 = nine
- keycode  45 = x               
-+      altgr   keycode  45 = zero
- keycode  46 = c
-       altgr   keycode  46 = Hex_C   
- keycode  47 = v               
- keycode  48 = b
-       altgr   keycode  48 = Hex_B
- keycode  49 = n               
-+      altgr   keycode  49 = less
-+      ctrll   keycode  49 = one
- keycode  50 = m               
--keycode  51 = comma            less            
--      alt     keycode  51 = Meta_comma      
--keycode  52 = period           greater         
-+      altgr   keycode  50 = greater
-+      ctrll   keycode  50 = two
-+keycode  51 = comma            semicolon
-+      altgr   keycode  51 = apostrophe
-+keycode  52 = period           colon
-       control keycode  52 = Compose         
--      alt     keycode  52 = Meta_period     
-+      altgr   keycode  52 =  quotedbl
- keycode  53 = slash            question        
-       control keycode  53 = Delete          
-       alt     keycode  53 = Meta_slash      
--keycode  54 = Shift           
-+      ctrll   keycode  53 = zero
-+keycode  54 = AltGr
- keycode  55 = KP_Multiply     
- keycode  56 = Alt             
- keycode  57 = space            space           
-       control keycode  57 = nul             
-       alt     keycode  57 = Meta_space      
- keycode  58 = Caps_Lock       
--keycode  59 = F1               F11              Console_13      
-+keycode  59 = F1               F11              one
-       control keycode  59 = F1              
-       alt     keycode  59 = Console_1       
-       control alt     keycode  59 = Console_1       
--keycode  60 = F2               F12              Console_14      
-+keycode  60 = F2               F12              two
-       control keycode  60 = F2              
-       alt     keycode  60 = Console_2       
-       control alt     keycode  60 = Console_2       
--keycode  61 = F3               F13              Console_15      
-+keycode  61 = F3               F13              three
-       control keycode  61 = F3              
-       alt     keycode  61 = Console_3       
-       control alt     keycode  61 = Console_3       
--keycode  62 = F4               F14              Console_16      
-+keycode  62 = F4               F14              four
-       control keycode  62 = F4              
-       alt     keycode  62 = Console_4       
-       control alt     keycode  62 = Console_4       
--keycode  63 = F5               F15              Console_17      
-+keycode  63 = F5               F15              five
-       control keycode  63 = F5              
-       alt     keycode  63 = Console_5       
-       control alt     keycode  63 = Console_5       
--keycode  64 = F6               F16              Console_18      
-+keycode  64 = F6               F16              six
-       control keycode  64 = F6              
-       alt     keycode  64 = Console_6       
-       control alt     keycode  64 = Console_6       
--keycode  65 = F7               F17              Console_19      
-+keycode  65 = F7               F17              seven
-       control keycode  65 = F7              
-       alt     keycode  65 = Console_7       
-       control alt     keycode  65 = Console_7       
--keycode  66 = F8               F18              Console_20      
-+keycode  66 = F8               F18              eight
-       control keycode  66 = F8              
-       alt     keycode  66 = Console_8       
-       control alt     keycode  66 = Console_8       
-@@ -220,7 +250,7 @@ keycode  93 =
- keycode  94 =
- keycode  95 =
- keycode  96 = KP_Enter        
--keycode  97 = Control         
-+keycode  97 = Control
- keycode  98 = KP_Divide       
- keycode  99 = Control_backslash
-       control keycode  99 = Control_backslash
diff --git a/target/linux/xburst/patches-2.6.37/800-n516-lpc.patch b/target/linux/xburst/patches-2.6.37/800-n516-lpc.patch
deleted file mode 100644 (file)
index 9f908eb..0000000
+++ /dev/null
@@ -1,510 +0,0 @@
-From 9d67bbbef07b0568d0541f79e3cd664d71d2d96c Mon Sep 17 00:00:00 2001
-From: Lars-Peter Clausen <lars@metafoo.de>
-Date: Wed, 12 May 2010 14:22:36 +0200
-Subject: [PATCH 4/5] Add n516 lpc driver
-
----
- drivers/misc/Kconfig    |    8 +
- drivers/misc/Makefile   |    1 +
- drivers/misc/n516-lpc.c |  471 +++++++++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 480 insertions(+), 0 deletions(-)
- create mode 100644 drivers/misc/n516-lpc.c
-
---- a/drivers/misc/Kconfig
-+++ b/drivers/misc/Kconfig
-@@ -452,6 +452,14 @@ config PCH_PHUB
-         To compile this driver as a module, choose M here: the module will
-         be called pch_phub.
-+config N516_LPC
-+      tristate "N516 keys & power controller"
-+      depends on I2C
-+      depends on INPUT
-+      depends on POWER_SUPPLY
-+      help
-+        N516 keyboard & power controller driver
-+
- source "drivers/misc/c2port/Kconfig"
- source "drivers/misc/eeprom/Kconfig"
- source "drivers/misc/cb710/Kconfig"
---- a/drivers/misc/Makefile
-+++ b/drivers/misc/Makefile
-@@ -42,3 +42,4 @@ obj-$(CONFIG_ARM_CHARLCD)    += arm-charlcd
- obj-$(CONFIG_PCH_PHUB)                += pch_phub.o
- obj-y                         += ti-st/
- obj-$(CONFIG_AB8500_PWM)      += ab8500-pwm.o
-+obj-$(CONFIG_N516_LPC)                += n516-lpc.o
---- /dev/null
-+++ b/drivers/misc/n516-lpc.c
-@@ -0,0 +1,471 @@
-+#include <linux/module.h>
-+#include <linux/version.h>
-+#include <linux/init.h>
-+#include <linux/fs.h>
-+#include <linux/interrupt.h>
-+#include <linux/irq.h>
-+#include <linux/sched.h>
-+#include <linux/pm.h>
-+#include <linux/sysctl.h>
-+#include <linux/proc_fs.h>
-+#include <linux/delay.h>
-+#include <linux/platform_device.h>
-+#include <linux/input.h>
-+#include <linux/power_supply.h>
-+#include <linux/suspend.h>
-+
-+#include <linux/i2c.h>
-+
-+#include <asm/mach-jz4740/irq.h>
-+#include <asm/mach-jz4740/gpio.h>
-+#include <asm/mach-jz4740/board-n516.h>
-+
-+static int batt_level=0;
-+module_param(batt_level, int, 0);
-+
-+struct n516_lpc_chip {
-+      struct i2c_client       *i2c_client;
-+      struct input_dev        *input;
-+      unsigned int            battery_level;
-+      unsigned int            suspending:1, can_sleep:1;
-+};
-+
-+static struct n516_lpc_chip *the_lpc;
-+
-+struct i2c_device_id n516_lpc_i2c_ids[] = {
-+      {"LPC524", 0},
-+      {},
-+};
-+
-+MODULE_DEVICE_TABLE(i2c, n516_lpc_i2c_ids);
-+
-+static const unsigned short normal_i2c[] = I2C_ADDRS(0x54);
-+
-+static const unsigned int n516_lpc_keymap[] = {
-+      [0x01] = KEY_4,
-+      [0x02] = KEY_3,
-+      [0x03] = KEY_2,
-+      [0x04] = KEY_1,
-+      [0x05] = KEY_0,
-+      [0x07] = KEY_9,
-+      [0x08] = KEY_8,
-+      [0x09] = KEY_7,
-+      [0x0a] = KEY_6,
-+      [0x0b] = KEY_5,
-+      [0x0d] = KEY_PLAYPAUSE,
-+      [0x0e] = KEY_MENU,
-+      [0x0f] = KEY_SEARCH,
-+      [0x10] = KEY_DIRECTION,
-+      [0x11] = KEY_SPACE,
-+      [0x13] = KEY_ENTER,
-+      [0x14] = KEY_UP,
-+      [0x15] = KEY_DOWN,
-+      [0x16] = KEY_RIGHT,
-+      [0x17] = KEY_LEFT,
-+      [0x19] = KEY_PAGEDOWN,
-+      [0x1a] = KEY_PAGEUP,
-+      [0x1c] = KEY_POWER,
-+      [0x1d] = KEY_ESC,
-+      [0x1e] = KEY_SLEEP,
-+      [0x1f] = KEY_WAKEUP,
-+};
-+
-+static const unsigned int batt_charge[] = {0, 7, 20, 45, 65, 80, 100};
-+#define MAX_BAT_LEVEL 6
-+
-+static inline int n516_bat_charging(void)
-+{
-+      return !gpio_get_value(GPIO_CHARG_STAT_N);
-+}
-+
-+static int n516_bat_get_status(struct power_supply *b)
-+{
-+      if (power_supply_am_i_supplied(b)) {
-+              if (n516_bat_charging())
-+                      return POWER_SUPPLY_STATUS_CHARGING;
-+              else
-+                      return POWER_SUPPLY_STATUS_FULL;
-+      } else {
-+              return POWER_SUPPLY_STATUS_DISCHARGING;
-+      }
-+}
-+
-+static int n516_bat_get_charge(struct power_supply *b)
-+{
-+      return batt_charge[the_lpc->battery_level];
-+}
-+
-+static int n516_bat_get_property(struct power_supply *b,
-+              enum power_supply_property psp,
-+              union power_supply_propval *val)
-+{
-+      switch (psp) {
-+      case POWER_SUPPLY_PROP_STATUS:
-+              val->intval = n516_bat_get_status(b);
-+              break;
-+      case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
-+              val->intval = 100;
-+              break;
-+      case POWER_SUPPLY_PROP_CHARGE_EMPTY_DESIGN:
-+              val->intval = 0;
-+              break;
-+      case POWER_SUPPLY_PROP_CHARGE_NOW:
-+              val->intval = n516_bat_get_charge(b);
-+              break;
-+      default:
-+              return -EINVAL;
-+      }
-+      return 0;
-+}
-+
-+static void n516_bat_power_changed(struct power_supply *p)
-+{
-+      if (power_supply_am_i_supplied(p) && !n516_bat_charging())
-+              the_lpc->battery_level = MAX_BAT_LEVEL;
-+
-+      power_supply_changed(p);
-+}
-+
-+static enum power_supply_property n516_bat_properties[] = {
-+      POWER_SUPPLY_PROP_STATUS,
-+      POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
-+      POWER_SUPPLY_PROP_CHARGE_EMPTY_DESIGN,
-+      POWER_SUPPLY_PROP_CHARGE_NOW,
-+};
-+
-+static struct power_supply n516_battery = {
-+      .name           = "n516-battery",
-+      .get_property   = n516_bat_get_property,
-+      .properties     = n516_bat_properties,
-+      .num_properties = ARRAY_SIZE(n516_bat_properties),
-+      .external_power_changed = n516_bat_power_changed,
-+};
-+
-+static irqreturn_t n516_bat_charge_irq(int irq, void *dev)
-+{
-+      struct power_supply *psy = dev;
-+
-+      dev_dbg(psy->dev, "Battery charging IRQ\n");
-+
-+      if (power_supply_am_i_supplied(psy) && !n516_bat_charging())
-+              the_lpc->battery_level = MAX_BAT_LEVEL;
-+
-+      power_supply_changed(psy);
-+
-+      return IRQ_HANDLED;
-+}
-+
-+static int n516_lpc_send_message(struct n516_lpc_chip *chip, unsigned char val)
-+{
-+      struct i2c_client *client = chip->i2c_client;
-+      struct i2c_msg msg = {client->addr, client->flags, 1, &val};
-+      int ret = 0;
-+
-+      ret = i2c_transfer(client->adapter, &msg, 1);
-+      return ret > 0 ? 0 : ret;
-+}
-+
-+static void n516_key_event(struct n516_lpc_chip *chip, unsigned char keycode)
-+{
-+      struct i2c_client *client = chip->i2c_client;
-+      bool long_press = false;
-+
-+      if (keycode & 0x40) {
-+              keycode &= ~0x40;
-+              long_press = true;
-+      }
-+
-+      dev_dbg(&client->dev, "keycode: 0x%02x, long_press: 0x%02x\n", keycode, (unsigned int)long_press);
-+
-+      if (keycode >= ARRAY_SIZE(n516_lpc_keymap) || n516_lpc_keymap[keycode] == 0)
-+              return;
-+
-+      if (long_press)
-+              input_report_key(chip->input, KEY_LEFTALT, 1);
-+
-+      input_report_key(chip->input, n516_lpc_keymap[keycode], 1);
-+      input_sync(chip->input);
-+      input_report_key(chip->input, n516_lpc_keymap[keycode], 0);
-+
-+      if (long_press)
-+              input_report_key(chip->input, KEY_LEFTALT, 0);
-+      input_sync(chip->input);
-+}
-+
-+static void n516_battery_event(struct n516_lpc_chip *chip, unsigned char battery_level)
-+{
-+      if (battery_level != chip->battery_level) {
-+              chip->battery_level = battery_level;
-+              power_supply_changed(&n516_battery);
-+      }
-+}
-+
-+static irqreturn_t n516_lpc_irq_thread(int irq, void *devid)
-+{
-+      struct n516_lpc_chip *chip = (struct n516_lpc_chip*)devid;
-+      int ret;
-+      unsigned char raw_msg;
-+      struct i2c_client *client = chip->i2c_client;
-+      struct i2c_msg msg = {client->addr, client->flags | I2C_M_RD, 1, &raw_msg};
-+
-+      if (client->dev.power.status >= DPM_OFF)
-+              return IRQ_HANDLED;
-+
-+      ret = i2c_transfer(client->adapter, &msg, 1);
-+      if (ret != 1) {
-+              dev_dbg(&client->dev, "I2C error: %d\n", ret);
-+              return IRQ_HANDLED;
-+      }
-+
-+      dev_dbg(&client->dev, "msg: 0x%02x\n", raw_msg);
-+
-+      /* Ack wakeup event */
-+      if ((raw_msg & ~0x40) < ARRAY_SIZE(n516_lpc_keymap))
-+              n516_key_event(chip, raw_msg);
-+      else if ((raw_msg >= 0x81) && (raw_msg <= 0x87))
-+              n516_battery_event(chip, raw_msg - 0x81);
-+      else if (raw_msg == 0x7e)
-+              n516_lpc_send_message(chip, 0x00);
-+      else
-+              dev_warn(&client->dev, "Unknown message: %x\n", raw_msg);
-+
-+      if (chip->suspending)
-+              chip->can_sleep = 0;
-+
-+      return IRQ_HANDLED;
-+}
-+
-+static void n516_lpc_power_off(void)
-+{
-+      struct i2c_client *client = the_lpc->i2c_client;
-+      unsigned char val = 0x01;
-+      struct i2c_msg msg = {client->addr, client->flags, 1, &val};
-+
-+      printk("Issue LPC POWEROFF command...\n");
-+      while (1)
-+              i2c_transfer(client->adapter, &msg, 1);
-+}
-+
-+static int n516_lpc_detect(struct i2c_client *client, struct i2c_board_info *info)
-+{
-+      return 0;
-+}
-+
-+static int n516_lpc_suspend_notifier(struct notifier_block *nb,
-+                                              unsigned long event,
-+                                              void *dummy)
-+{
-+      switch(event) {
-+      case PM_SUSPEND_PREPARE:
-+              the_lpc->suspending = 1;
-+              the_lpc->can_sleep = 1;
-+              break;
-+      case PM_POST_SUSPEND:
-+              the_lpc->suspending = 0;
-+              the_lpc->can_sleep = 1;
-+              break;
-+      default:
-+              return NOTIFY_DONE;
-+      }
-+      return NOTIFY_OK;
-+}
-+
-+static struct notifier_block n516_lpc_notif_block = {
-+      .notifier_call = n516_lpc_suspend_notifier,
-+};
-+
-+static int __devinit n516_lpc_probe(struct i2c_client *client, const struct i2c_device_id *id)
-+{
-+      struct n516_lpc_chip *chip;
-+      struct input_dev *input;
-+      int ret = 0;
-+      int i;