Merge branches 'cns3xxx/devel', 'davinci/devel', 'imx/devel', 'lpc32xx/devel', 'pxa...
authorArnd Bergmann <arnd@arndb.de>
Sun, 17 Jul 2011 19:31:38 +0000 (21:31 +0200)
committerArnd Bergmann <arnd@arndb.de>
Sun, 17 Jul 2011 19:31:38 +0000 (21:31 +0200)
445 files changed:
Documentation/Changes
Documentation/CodingStyle
Documentation/cgroups/blkio-controller.txt
Documentation/feature-removal-schedule.txt
Documentation/filesystems/caching/netfs-api.txt
Documentation/kernel-parameters.txt
Documentation/laptops/thinkpad-acpi.txt
Documentation/spinlocks.txt
MAINTAINERS
Makefile
arch/arm/Kconfig
arch/arm/common/dmabounce.c
arch/arm/configs/mx51_defconfig
arch/arm/configs/mxs_defconfig
arch/arm/configs/u8500_defconfig
arch/arm/include/asm/irq.h
arch/arm/kernel/irq.c
arch/arm/kernel/perf_event.c
arch/arm/kernel/setup.c
arch/arm/kernel/smp_twd.c
arch/arm/mach-cns3xxx/cns3420vb.c
arch/arm/mach-cns3xxx/core.c
arch/arm/mach-cns3xxx/core.h
arch/arm/mach-ep93xx/core.c
arch/arm/mach-exynos4/cpu.c
arch/arm/mach-exynos4/dev-audio.c
arch/arm/mach-exynos4/headsmp.S
arch/arm/mach-exynos4/mach-smdkv310.c
arch/arm/mach-imx/Kconfig
arch/arm/mach-imx/dma-v1.c
arch/arm/mach-imx/eukrea_mbimx27-baseboard.c
arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
arch/arm/mach-imx/mach-apf9328.c
arch/arm/mach-imx/mach-armadillo5x0.c
arch/arm/mach-imx/mach-bug.c
arch/arm/mach-imx/mach-cpuimx27.c
arch/arm/mach-imx/mach-cpuimx35.c
arch/arm/mach-imx/mach-eukrea_cpuimx25.c
arch/arm/mach-imx/mach-imx27_visstrim_m10.c
arch/arm/mach-imx/mach-imx27ipcam.c
arch/arm/mach-imx/mach-imx27lite.c
arch/arm/mach-imx/mach-kzm_arm11_01.c
arch/arm/mach-imx/mach-mx1ads.c
arch/arm/mach-imx/mach-mx21ads.c
arch/arm/mach-imx/mach-mx25_3ds.c
arch/arm/mach-imx/mach-mx27_3ds.c
arch/arm/mach-imx/mach-mx27ads.c
arch/arm/mach-imx/mach-mx31_3ds.c
arch/arm/mach-imx/mach-mx31ads.c
arch/arm/mach-imx/mach-mx31lilly.c
arch/arm/mach-imx/mach-mx31lite.c
arch/arm/mach-imx/mach-mx31moboard.c
arch/arm/mach-imx/mach-mx35_3ds.c
arch/arm/mach-imx/mach-mxt_td60.c
arch/arm/mach-imx/mach-pca100.c
arch/arm/mach-imx/mach-pcm037.c
arch/arm/mach-imx/mach-pcm038.c
arch/arm/mach-imx/mach-pcm043.c
arch/arm/mach-imx/mach-qong.c
arch/arm/mach-imx/mach-scb9328.c
arch/arm/mach-imx/mach-vpr200.c
arch/arm/mach-imx/mm-imx1.c
arch/arm/mach-imx/mm-imx21.c
arch/arm/mach-imx/mm-imx25.c
arch/arm/mach-imx/mm-imx27.c
arch/arm/mach-imx/mm-imx31.c
arch/arm/mach-imx/mm-imx35.c
arch/arm/mach-imx/mx31lite-db.c
arch/arm/mach-lpc32xx/clock.c
arch/arm/mach-lpc32xx/common.c
arch/arm/mach-lpc32xx/common.h
arch/arm/mach-mmp/Kconfig
arch/arm/mach-mmp/Makefile
arch/arm/mach-mmp/clock.c
arch/arm/mach-mmp/clock.h
arch/arm/mach-mmp/gplugd.c [new file with mode: 0644]
arch/arm/mach-mmp/include/mach/mfp-gplugd.h [new file with mode: 0644]
arch/arm/mach-mmp/include/mach/mfp-pxa168.h
arch/arm/mach-mmp/include/mach/pxa168.h
arch/arm/mach-mmp/include/mach/regs-apmu.h
arch/arm/mach-mmp/pxa168.c
arch/arm/mach-mmp/ttc_dkb.c
arch/arm/mach-mx5/Kconfig
arch/arm/mach-mx5/Makefile
arch/arm/mach-mx5/board-cpuimx51.c
arch/arm/mach-mx5/board-cpuimx51sd.c
arch/arm/mach-mx5/board-mx50_rdp.c
arch/arm/mach-mx5/board-mx51_3ds.c
arch/arm/mach-mx5/board-mx51_babbage.c
arch/arm/mach-mx5/board-mx51_efikamx.c
arch/arm/mach-mx5/board-mx51_efikasb.c
arch/arm/mach-mx5/board-mx53_ard.c [new file with mode: 0644]
arch/arm/mach-mx5/board-mx53_evk.c
arch/arm/mach-mx5/board-mx53_loco.c
arch/arm/mach-mx5/board-mx53_smd.c
arch/arm/mach-mx5/clock-mx51-mx53.c
arch/arm/mach-mx5/crm_regs.h
arch/arm/mach-mx5/devices-imx53.h
arch/arm/mach-mx5/devices.c
arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c
arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c
arch/arm/mach-mx5/mm-mx50.c
arch/arm/mach-mx5/mm.c
arch/arm/mach-mx5/pm-imx5.c [new file with mode: 0644]
arch/arm/mach-mxs/Kconfig
arch/arm/mach-mxs/Makefile
arch/arm/mach-mxs/devices.c
arch/arm/mach-mxs/devices/Makefile
arch/arm/mach-mxs/devices/platform-gpio-mxs.c [new file with mode: 0644]
arch/arm/mach-mxs/devices/platform-mxsfb.c
arch/arm/mach-mxs/gpio.c [deleted file]
arch/arm/mach-mxs/gpio.h [deleted file]
arch/arm/mach-mxs/include/mach/devices-common.h
arch/arm/mach-mxs/mach-mx28evk.c
arch/arm/mach-mxs/mach-tx28.c
arch/arm/mach-mxs/mm-mx23.c
arch/arm/mach-mxs/mm-mx28.c
arch/arm/mach-omap1/board-ams-delta.c
arch/arm/mach-omap1/gpio15xx.c
arch/arm/mach-omap1/gpio16xx.c
arch/arm/mach-omap1/gpio7xx.c
arch/arm/mach-omap2/board-rx51-peripherals.c
arch/arm/mach-pxa/balloon3.c
arch/arm/mach-pxa/capc7117.c
arch/arm/mach-pxa/clock.c
arch/arm/mach-pxa/clock.h
arch/arm/mach-pxa/cm-x2xx.c
arch/arm/mach-pxa/cm-x300.c
arch/arm/mach-pxa/colibri-pxa270.c
arch/arm/mach-pxa/colibri-pxa300.c
arch/arm/mach-pxa/colibri-pxa320.c
arch/arm/mach-pxa/corgi.c
arch/arm/mach-pxa/csb726.c
arch/arm/mach-pxa/em-x270.c
arch/arm/mach-pxa/eseries.c
arch/arm/mach-pxa/ezx.c
arch/arm/mach-pxa/generic.h
arch/arm/mach-pxa/gumstix.c
arch/arm/mach-pxa/h5000.c
arch/arm/mach-pxa/himalaya.c
arch/arm/mach-pxa/hx4700.c
arch/arm/mach-pxa/icontrol.c
arch/arm/mach-pxa/idp.c
arch/arm/mach-pxa/include/mach/irqs.h
arch/arm/mach-pxa/include/mach/pxa25x.h
arch/arm/mach-pxa/include/mach/pxa27x.h
arch/arm/mach-pxa/include/mach/pxa300.h
arch/arm/mach-pxa/include/mach/pxa320.h
arch/arm/mach-pxa/include/mach/pxa3xx.h [new file with mode: 0644]
arch/arm/mach-pxa/include/mach/pxa930.h
arch/arm/mach-pxa/include/mach/regs-intc.h [deleted file]
arch/arm/mach-pxa/irq.c
arch/arm/mach-pxa/littleton.c
arch/arm/mach-pxa/lpd270.c
arch/arm/mach-pxa/lubbock.c
arch/arm/mach-pxa/magician.c
arch/arm/mach-pxa/mainstone.c
arch/arm/mach-pxa/mioa701.c
arch/arm/mach-pxa/mp900.c
arch/arm/mach-pxa/palmld.c
arch/arm/mach-pxa/palmt5.c
arch/arm/mach-pxa/palmtc.c
arch/arm/mach-pxa/palmte2.c
arch/arm/mach-pxa/palmtreo.c
arch/arm/mach-pxa/palmtx.c
arch/arm/mach-pxa/palmz72.c
arch/arm/mach-pxa/pcm027.c
arch/arm/mach-pxa/poodle.c
arch/arm/mach-pxa/pxa3xx.c
arch/arm/mach-pxa/pxa95x.c
arch/arm/mach-pxa/raumfeld.c
arch/arm/mach-pxa/saar.c
arch/arm/mach-pxa/saarb.c
arch/arm/mach-pxa/spitz.c
arch/arm/mach-pxa/stargate2.c
arch/arm/mach-pxa/tavorevb.c
arch/arm/mach-pxa/tavorevb3.c
arch/arm/mach-pxa/tosa.c
arch/arm/mach-pxa/trizeps4.c
arch/arm/mach-pxa/viper.c
arch/arm/mach-pxa/vpac270.c
arch/arm/mach-pxa/xcep.c
arch/arm/mach-pxa/z2.c
arch/arm/mach-pxa/zeus.c
arch/arm/mach-pxa/zylonite.c
arch/arm/mach-s3c2440/mach-mini2440.c
arch/arm/mach-s3c64xx/dev-spi.c
arch/arm/mach-s5p64x0/dev-spi.c
arch/arm/mach-s5pc100/dev-spi.c
arch/arm/mach-s5pv210/dev-spi.c
arch/arm/mach-tegra/board-harmony.c
arch/arm/mach-tegra/board-paz00-pinmux.c
arch/arm/mach-tegra/board-paz00.c
arch/arm/mach-tegra/board-paz00.h
arch/arm/mach-tegra/board-seaboard.c
arch/arm/mach-tegra/board-trimslice-pinmux.c
arch/arm/mach-tegra/board-trimslice.c
arch/arm/mach-tegra/board-trimslice.h
arch/arm/mach-tegra/devices.c
arch/arm/mach-tegra/include/mach/barriers.h [deleted file]
arch/arm/mach-tegra/platsmp.c
arch/arm/mach-tegra/tegra2_clocks.c
arch/arm/mach-u300/spi.c
arch/arm/mach-u300/timer.c
arch/arm/mach-ux500/Kconfig
arch/arm/mach-ux500/board-mop500-pins.c
arch/arm/mach-ux500/board-mop500-regulators.c
arch/arm/mach-ux500/board-mop500-sdi.c
arch/arm/mach-ux500/board-mop500-uib.c
arch/arm/mach-ux500/board-mop500.c
arch/arm/mach-ux500/board-mop500.h
arch/arm/mach-ux500/clock.c
arch/arm/mach-ux500/cpu-db5500.c
arch/arm/mach-ux500/include/mach/uncompress.h
arch/arm/mach-ux500/usb.c
arch/arm/mach-vt8500/irq.c
arch/arm/mm/Kconfig
arch/arm/mm/cache-l2x0.c
arch/arm/mm/mmu.c
arch/arm/mm/nommu.c
arch/arm/plat-mxc/Makefile
arch/arm/plat-mxc/avic.c
arch/arm/plat-mxc/devices.c
arch/arm/plat-mxc/devices/Makefile
arch/arm/plat-mxc/devices/platform-gpio-mxc.c [new file with mode: 0644]
arch/arm/plat-mxc/devices/platform-imx-dma.c
arch/arm/plat-mxc/devices/platform-imx-i2c.c
arch/arm/plat-mxc/devices/platform-imx-keypad.c
arch/arm/plat-mxc/devices/platform-imx-ssi.c
arch/arm/plat-mxc/devices/platform-imx-uart.c
arch/arm/plat-mxc/gpio.c [deleted file]
arch/arm/plat-mxc/include/mach/common.h
arch/arm/plat-mxc/include/mach/debug-macro.S
arch/arm/plat-mxc/include/mach/devices-common.h
arch/arm/plat-mxc/include/mach/gpio.h
arch/arm/plat-mxc/include/mach/hardware.h
arch/arm/plat-mxc/include/mach/iomux-mx53.h
arch/arm/plat-mxc/include/mach/iomux-v1.h
arch/arm/plat-mxc/include/mach/iomux-v3.h
arch/arm/plat-mxc/include/mach/iomux.h [deleted file]
arch/arm/plat-mxc/include/mach/mx53.h
arch/arm/plat-mxc/include/mach/mxc.h
arch/arm/plat-mxc/include/mach/sdma.h
arch/arm/plat-mxc/include/mach/timex.h
arch/arm/plat-mxc/include/mach/uncompress.h
arch/arm/plat-mxc/iomux-v1.c
arch/arm/plat-mxc/irq-common.c
arch/arm/plat-mxc/pwm.c
arch/arm/plat-mxc/tzic.c
arch/arm/plat-s3c24xx/dma.c
arch/arm/plat-s5p/s5p-time.c
arch/arm/plat-samsung/include/plat/devs.h
arch/arm/plat-samsung/include/plat/s3c64xx-spi.h
arch/x86/include/asm/mmzone_32.h
arch/x86/kernel/acpi/realmode/wakeup.S
arch/x86/kernel/acpi/realmode/wakeup.h
arch/x86/kernel/acpi/sleep.c
arch/x86/kernel/reboot.c
arch/x86/oprofile/nmi_int.c
arch/x86/pci/xen.c
arch/x86/platform/efi/efi.c
block/cfq-iosched.c
drivers/base/syscore.c
drivers/block/drbd/drbd_actlog.c
drivers/block/drbd/drbd_bitmap.c
drivers/block/drbd/drbd_receiver.c
drivers/block/drbd/drbd_worker.c
drivers/cpufreq/acpi-cpufreq.c
drivers/dma/imx-dma.c
drivers/dma/imx-sdma.c
drivers/firewire/ohci.c
drivers/gpio/Kconfig
drivers/gpio/Makefile
drivers/gpio/gpio-mxc.c [new file with mode: 0644]
drivers/gpio/gpio-mxs.c [new file with mode: 0644]
drivers/gpio/langwell_gpio.c
drivers/gpio/tps65910-gpio.c
drivers/gpu/drm/drm_crtc.c
drivers/gpu/drm/radeon/evergreen.c
drivers/gpu/drm/radeon/evergreend.h
drivers/gpu/drm/radeon/ni.c
drivers/gpu/drm/radeon/r600.c
drivers/gpu/drm/radeon/r600d.h
drivers/gpu/drm/radeon/rv770.c
drivers/hwmon/lm95241.c
drivers/hwmon/pmbus.c
drivers/i2c/busses/i2c-bfin-twi.c
drivers/i2c/busses/i2c-s3c2410.c
drivers/i2c/busses/i2c-tegra.c
drivers/input/keyboard/pmic8xxx-keypad.c
drivers/input/misc/pmic8xxx-pwrkey.c
drivers/leds/leds-pca9532.c
drivers/media/rc/fintek-cir.c
drivers/media/rc/imon.c
drivers/media/rc/ir-raw.c
drivers/media/rc/ite-cir.c
drivers/media/rc/ite-cir.h
drivers/media/rc/keymaps/rc-pinnacle-pctv-hd.c
drivers/media/rc/lirc_dev.c
drivers/media/rc/mceusb.c
drivers/media/rc/nuvoton-cir.c
drivers/media/rc/nuvoton-cir.h
drivers/media/rc/rc-main.c
drivers/media/video/bt8xx/bttv-driver.c
drivers/media/video/cx18/cx18-ioctl.c
drivers/media/video/ivtv/ivtv-ioctl.c
drivers/media/video/m5mols/m5mols.h
drivers/media/video/m5mols/m5mols_capture.c
drivers/media/video/m5mols/m5mols_controls.c
drivers/media/video/m5mols/m5mols_core.c
drivers/media/video/m5mols/m5mols_reg.h
drivers/media/video/msp3400-driver.c
drivers/media/video/mx1_camera.c
drivers/media/video/omap/omap_vout.c
drivers/media/video/omap/omap_voutlib.c
drivers/media/video/omap3isp/isp.c
drivers/media/video/pvrusb2/pvrusb2-hdw.c
drivers/media/video/pwc/pwc-ctrl.c
drivers/media/video/pwc/pwc-if.c
drivers/media/video/pwc/pwc.h
drivers/media/video/s5p-fimc/fimc-capture.c
drivers/media/video/s5p-fimc/fimc-core.c
drivers/media/video/s5p-fimc/fimc-core.h
drivers/media/video/saa7134/saa7134-input.c
drivers/media/video/tuner-core.c
drivers/media/video/uvc/uvc_entity.c
drivers/media/video/uvc/uvc_queue.c
drivers/media/video/uvc/uvc_video.c
drivers/media/video/v4l2-dev.c
drivers/media/video/v4l2-ioctl.c
drivers/media/video/videobuf2-core.c
drivers/media/video/videobuf2-dma-sg.c
drivers/mfd/Kconfig
drivers/mfd/Makefile
drivers/mfd/asic3.c
drivers/mfd/htc-pasic3.c
drivers/mfd/omap-usb-host.c
drivers/mfd/tps65911-comparator.c
drivers/mmc/host/mmci.c
drivers/mmc/host/mmci.h
drivers/mmc/host/mxcmmc.c
drivers/net/8139too.c
drivers/net/bna/bnad.c
drivers/net/greth.c
drivers/net/hamradio/6pack.c
drivers/net/hamradio/mkiss.c
drivers/net/natsemi.c
drivers/net/qlge/qlge.h
drivers/net/qlge/qlge_main.c
drivers/net/sh_eth.c
drivers/net/vmxnet3/vmxnet3_drv.c
drivers/net/vmxnet3/vmxnet3_int.h
drivers/net/wireless/ath/ath5k/desc.c
drivers/net/wireless/ath/ath5k/eeprom.c
drivers/net/wireless/ath/ath9k/pci.c
drivers/net/wireless/iwlwifi/iwl-1000.c
drivers/net/wireless/iwlwifi/iwl-2000.c
drivers/net/wireless/iwlwifi/iwl-5000.c
drivers/net/wireless/iwlwifi/iwl-6000.c
drivers/net/wireless/iwlwifi/iwl-core.c
drivers/net/wireless/iwlwifi/iwl-tx.c
drivers/pci/pci.c
drivers/pci/pci.h
drivers/pci/setup-bus.c
drivers/platform/x86/acer-wmi.c
drivers/platform/x86/asus-wmi.c
drivers/platform/x86/compal-laptop.c
drivers/platform/x86/dell-laptop.c
drivers/platform/x86/hp-wmi.c
drivers/platform/x86/intel_oaktrail.c
drivers/platform/x86/thinkpad_acpi.c
drivers/regulator/db8500-prcmu.c
drivers/regulator/max8952.c
drivers/regulator/max8997.c
drivers/spi/spi_s3c64xx.c
drivers/staging/lirc/lirc_imon.c
drivers/staging/lirc/lirc_serial.c
drivers/staging/lirc/lirc_sir.c
drivers/staging/lirc/lirc_zilog.c
drivers/usb/core/message.c
drivers/usb/gadget/fsl_udc_core.c
drivers/w1/masters/ds1wm.c
fs/binfmt_elf_fdpic.c
fs/btrfs/ctree.h
fs/btrfs/inode.c
fs/btrfs/super.c
fs/btrfs/volumes.c
fs/ceph/file.c
fs/cifs/cifsfs.c
fs/cifs/cifsproto.h
fs/cifs/connect.c
fs/cifs/fscache.c
fs/fscache/page.c
fs/hfsplus/super.c
fs/hfsplus/wrapper.c
fs/locks.c
fs/nfs/fscache.c
fs/xfs/xfs_inode_item.c
fs/xfs/xfs_trans.c
include/linux/drbd_limits.h
include/linux/fscache.h
include/linux/mfd/ds1wm.h
include/linux/sched.h
include/media/lirc_dev.h
include/media/m5mols.h
include/media/v4l2-subdev.h
include/net/cfg80211.h
include/net/dst.h
kernel/jump_label.c
kernel/power/snapshot.c
kernel/resource.c
kernel/sched.c
lib/debugobjects.c
mm/memcontrol.c
mm/memory.c
mm/nommu.c
mm/vmscan.c
net/8021q/vlan_dev.c
net/bridge/br_device.c
net/bridge/br_input.c
net/ceph/osd_client.c
net/core/dst.c
net/ipv4/af_inet.c
net/ipv4/ip_output.c
net/ipv4/tcp.c
net/ipv4/udp.c
net/ipv4/xfrm4_output.c
net/ipv6/af_inet6.c
net/ipv6/route.c
net/mac80211/wpa.c
net/sctp/protocol.c
net/sctp/socket.c
net/wireless/nl80211.c
net/xfrm/xfrm_policy.c
sound/pci/hda/patch_realtek.c
sound/soc/blackfin/bf5xx-i2s-pcm.c
sound/soc/codecs/ak4642.c
sound/soc/codecs/tlv320aic26.c
sound/soc/codecs/tlv320aic3x.c
sound/soc/codecs/wm8731.c
sound/soc/codecs/wm8994.c
sound/soc/imx/imx-pcm-dma-mx2.c
sound/soc/soc-core.c
sound/soc/tegra/tegra_i2s.c

index 5f4828a034e3235f21d3e6050f4a4092dc4bd23e..b1758088527339466c5d5eb8be6151eabe02952d 100644 (file)
@@ -2,13 +2,7 @@ Intro
 =====
 
 This document is designed to provide a list of the minimum levels of
-software necessary to run the 2.6 kernels, as well as provide brief
-instructions regarding any other "Gotchas" users may encounter when
-trying life on the Bleeding Edge.  If upgrading from a pre-2.4.x
-kernel, please consult the Changes file included with 2.4.x kernels for
-additional information; most of that information will not be repeated
-here.  Basically, this document assumes that your system is already
-functional and running at least 2.4.x kernels.
+software necessary to run the 3.0 kernels.
 
 This document is originally based on my "Changes" file for 2.0.x kernels
 and therefore owes credit to the same people as that file (Jared Mauch,
@@ -22,11 +16,10 @@ Upgrade to at *least* these software revisions before thinking you've
 encountered a bug!  If you're unsure what version you're currently
 running, the suggested command should tell you.
 
-Again, keep in mind that this list assumes you are already
-functionally running a Linux 2.4 kernel.  Also, not all tools are
-necessary on all systems; obviously, if you don't have any ISDN
-hardware, for example, you probably needn't concern yourself with
-isdn4k-utils.
+Again, keep in mind that this list assumes you are already functionally
+running a Linux kernel.  Also, not all tools are necessary on all
+systems; obviously, if you don't have any ISDN hardware, for example,
+you probably needn't concern yourself with isdn4k-utils.
 
 o  Gnu C                  3.2                     # gcc --version
 o  Gnu make               3.80                    # make --version
@@ -114,12 +107,12 @@ Ksymoops
 
 If the unthinkable happens and your kernel oopses, you may need the
 ksymoops tool to decode it, but in most cases you don't.
-In the 2.6 kernel it is generally preferred to build the kernel with
-CONFIG_KALLSYMS so that it produces readable dumps that can be used as-is
-(this also produces better output than ksymoops).
-If for some reason your kernel is not build with CONFIG_KALLSYMS and
-you have no way to rebuild and reproduce the Oops with that option, then
-you can still decode that Oops with ksymoops.
+It is generally preferred to build the kernel with CONFIG_KALLSYMS so
+that it produces readable dumps that can be used as-is (this also
+produces better output than ksymoops).  If for some reason your kernel
+is not build with CONFIG_KALLSYMS and you have no way to rebuild and
+reproduce the Oops with that option, then you can still decode that Oops
+with ksymoops.
 
 Module-Init-Tools
 -----------------
@@ -261,8 +254,8 @@ needs to be recompiled or (preferably) upgraded.
 NFS-utils
 ---------
 
-In 2.4 and earlier kernels, the nfs server needed to know about any
-client that expected to be able to access files via NFS.  This
+In ancient (2.4 and earlier) kernels, the nfs server needed to know
+about any client that expected to be able to access files via NFS.  This
 information would be given to the kernel by "mountd" when the client
 mounted the filesystem, or by "exportfs" at system startup.  exportfs
 would take information about active clients from /var/lib/nfs/rmtab.
@@ -272,11 +265,11 @@ which is not always easy, particularly when trying to implement
 fail-over.  Even when the system is working well, rmtab suffers from
 getting lots of old entries that never get removed.
 
-With 2.6 we have the option of having the kernel tell mountd when it
-gets a request from an unknown host, and mountd can give appropriate
-export information to the kernel.  This removes the dependency on
-rmtab and means that the kernel only needs to know about currently
-active clients.
+With modern kernels we have the option of having the kernel tell mountd
+when it gets a request from an unknown host, and mountd can give
+appropriate export information to the kernel.  This removes the
+dependency on rmtab and means that the kernel only needs to know about
+currently active clients.
 
 To enable this new functionality, you need to:
 
index 58b0bf9178349c435fd53674d96c29d7ecea0414..fa6e25b94a54bfe1d39450cd9bc568c4043ddfa3 100644 (file)
@@ -680,8 +680,8 @@ ones already enabled by DEBUG.
                Chapter 14: Allocating memory
 
 The kernel provides the following general purpose memory allocators:
-kmalloc(), kzalloc(), kcalloc(), and vmalloc().  Please refer to the API
-documentation for further information about them.
+kmalloc(), kzalloc(), kcalloc(), vmalloc(), and vzalloc().  Please refer to
+the API documentation for further information about them.
 
 The preferred form for passing a size of a struct is the following:
 
index cd45c8ea7463f71eccee9d82ce6a82b47bcee467..84f0a15fc210aec69648309a7676717d889ef6e5 100644 (file)
@@ -77,7 +77,7 @@ Throttling/Upper Limit policy
 - Specify a bandwidth rate on particular device for root group. The format
   for policy is "<major>:<minor>  <byes_per_second>".
 
-        echo "8:16  1048576" > /sys/fs/cgroup/blkio/blkio.read_bps_device
+        echo "8:16  1048576" > /sys/fs/cgroup/blkio/blkio.throttle.read_bps_device
 
   Above will put a limit of 1MB/second on reads happening for root group
   on device having major/minor number 8:16.
@@ -90,7 +90,7 @@ Throttling/Upper Limit policy
         1024+0 records out
         4194304 bytes (4.2 MB) copied, 4.0001 s, 1.0 MB/s
 
- Limits for writes can be put using blkio.write_bps_device file.
+ Limits for writes can be put using blkio.throttle.write_bps_device file.
 
 Hierarchical Cgroups
 ====================
@@ -286,28 +286,28 @@ Throttling/Upper limit policy files
          specified in bytes per second. Rules are per deivce. Following is
          the format.
 
-  echo "<major>:<minor>  <rate_bytes_per_second>" > /cgrp/blkio.read_bps_device
+  echo "<major>:<minor>  <rate_bytes_per_second>" > /cgrp/blkio.throttle.read_bps_device
 
 - blkio.throttle.write_bps_device
        - Specifies upper limit on WRITE rate to the device. IO rate is
          specified in bytes per second. Rules are per deivce. Following is
          the format.
 
-  echo "<major>:<minor>  <rate_bytes_per_second>" > /cgrp/blkio.write_bps_device
+  echo "<major>:<minor>  <rate_bytes_per_second>" > /cgrp/blkio.throttle.write_bps_device
 
 - blkio.throttle.read_iops_device
        - Specifies upper limit on READ rate from the device. IO rate is
          specified in IO per second. Rules are per deivce. Following is
          the format.
 
-  echo "<major>:<minor>  <rate_io_per_second>" > /cgrp/blkio.read_iops_device
+  echo "<major>:<minor>  <rate_io_per_second>" > /cgrp/blkio.throttle.read_iops_device
 
 - blkio.throttle.write_iops_device
        - Specifies upper limit on WRITE rate to the device. IO rate is
          specified in io per second. Rules are per deivce. Following is
          the format.
 
-  echo "<major>:<minor>  <rate_io_per_second>" > /cgrp/blkio.write_iops_device
+  echo "<major>:<minor>  <rate_io_per_second>" > /cgrp/blkio.throttle.write_iops_device
 
 Note: If both BW and IOPS rules are specified for a device, then IO is
       subjectd to both the constraints.
index 72e238465b0b6ca452ee4905dc097007b9ff3dc0..b1c921c27519a0953591b6a64159e46856e7558d 100644 (file)
@@ -583,3 +583,25 @@ Why:       Superseded by the UVCIOC_CTRL_QUERY ioctl.
 Who:   Laurent Pinchart <laurent.pinchart@ideasonboard.com>
 
 ----------------------------
+
+What:  For VIDIOC_S_FREQUENCY the type field must match the device node's type.
+       If not, return -EINVAL.
+When:  3.2
+Why:   It makes no sense to switch the tuner to radio mode by calling
+       VIDIOC_S_FREQUENCY on a video node, or to switch the tuner to tv mode by
+       calling VIDIOC_S_FREQUENCY on a radio node. This is the first step of a
+       move to more consistent handling of tv and radio tuners.
+Who:   Hans Verkuil <hans.verkuil@cisco.com>
+
+----------------------------
+
+What:  Opening a radio device node will no longer automatically switch the
+       tuner mode from tv to radio.
+When:  3.3
+Why:   Just opening a V4L device should not change the state of the hardware
+       like that. It's very unexpected and against the V4L spec. Instead, you
+       switch to radio mode by calling VIDIOC_S_FREQUENCY. This is the second
+       and last step of the move to consistent handling of tv and radio tuners.
+Who:   Hans Verkuil <hans.verkuil@cisco.com>
+
+----------------------------
index a167ab876c357111c8e5ba4e1a204bda29a7285e..7cc6bf2871ebfbae736436959a3d8a2e5153334d 100644 (file)
@@ -673,6 +673,22 @@ storage request to complete, or it may attempt to cancel the storage request -
 in which case the page will not be stored in the cache this time.
 
 
+BULK INODE PAGE UNCACHE
+-----------------------
+
+A convenience routine is provided to perform an uncache on all the pages
+attached to an inode.  This assumes that the pages on the inode correspond on a
+1:1 basis with the pages in the cache.
+
+       void fscache_uncache_all_inode_pages(struct fscache_cookie *cookie,
+                                            struct inode *inode);
+
+This takes the netfs cookie that the pages were cached with and the inode that
+the pages are attached to.  This function will wait for pages to finish being
+written to the cache and for the cache to finish with the page generally.  No
+error is returned.
+
+
 ==========================
 INDEX AND DATA FILE UPDATE
 ==========================
index fd248a318211a189163f2c42ba911a44284ea0bc..aa47be71df4c12ddeb15f7abead764279b20f113 100644 (file)
@@ -2015,6 +2015,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
                                the default.
                                off: Turn ECRC off
                                on: Turn ECRC on.
+               realloc         reallocate PCI resources if allocations done by BIOS
+                               are erroneous.
 
        pcie_aspm=      [PCIE] Forcibly enable or disable PCIe Active State Power
                        Management.
index 1565eefd6fd52a4c225fd19f4036164b62af2cbc..61815483efa34d9f7118d4aa91b321c66d42db44 100644 (file)
@@ -534,6 +534,8 @@ Events that are never propagated by the driver:
 0x2404         System is waking up from hibernation to undock
 0x2405         System is waking up from hibernation to eject bay
 0x5010         Brightness level changed/control event
+0x6000         KEYBOARD: Numlock key pressed
+0x6005         KEYBOARD: Fn key pressed (TO BE VERIFIED)
 
 Events that are propagated by the driver to userspace:
 
@@ -545,6 +547,8 @@ Events that are propagated by the driver to userspace:
 0x3006         Bay hotplug request (hint to power up SATA link when
                the optical drive tray is ejected)
 0x4003         Undocked (see 0x2x04), can sleep again
+0x4010         Docked into hotplug port replicator (non-ACPI dock)
+0x4011         Undocked from hotplug port replicator (non-ACPI dock)
 0x500B         Tablet pen inserted into its storage bay
 0x500C         Tablet pen removed from its storage bay
 0x6011         ALARM: battery is too hot
@@ -552,6 +556,7 @@ Events that are propagated by the driver to userspace:
 0x6021         ALARM: a sensor is too hot
 0x6022         ALARM: a sensor is extremely hot
 0x6030         System thermal table changed
+0x6040         Nvidia Optimus/AC adapter related (TO BE VERIFIED)
 
 Battery nearly empty alarms are a last resort attempt to get the
 operating system to hibernate or shutdown cleanly (0x2313), or shutdown
index 2e3c64b1a6a5a64ede63c9e76377f79514e95088..9dbe885ecd8d130e8a1e0300f05686dea59440c6 100644 (file)
@@ -13,18 +13,8 @@ static DEFINE_SPINLOCK(xxx_lock);
 The above is always safe. It will disable interrupts _locally_, but the
 spinlock itself will guarantee the global lock, so it will guarantee that
 there is only one thread-of-control within the region(s) protected by that
-lock. This works well even under UP. The above sequence under UP
-essentially is just the same as doing
-
-       unsigned long flags;
-
-       save_flags(flags); cli();
-        ... critical section ...
-       restore_flags(flags);
-
-so the code does _not_ need to worry about UP vs SMP issues: the spinlocks
-work correctly under both (and spinlocks are actually more efficient on
-architectures that allow doing the "save_flags + cli" in one operation).
+lock. This works well even under UP also, so the code does _not_ need to
+worry about UP vs SMP issues: the spinlocks work correctly under both.
 
    NOTE! Implications of spin_locks for memory are further described in:
 
@@ -36,27 +26,7 @@ The above is usually pretty simple (you usually need and want only one
 spinlock for most things - using more than one spinlock can make things a
 lot more complex and even slower and is usually worth it only for
 sequences that you _know_ need to be split up: avoid it at all cost if you
-aren't sure). HOWEVER, it _does_ mean that if you have some code that does
-
-       cli();
-       .. critical section ..
-       sti();
-
-and another sequence that does
-
-       spin_lock_irqsave(flags);
-       .. critical section ..
-       spin_unlock_irqrestore(flags);
-
-then they are NOT mutually exclusive, and the critical regions can happen
-at the same time on two different CPU's. That's fine per se, but the
-critical regions had better be critical for different things (ie they
-can't stomp on each other).
-
-The above is a problem mainly if you end up mixing code - for example the
-routines in ll_rw_block() tend to use cli/sti to protect the atomicity of
-their actions, and if a driver uses spinlocks instead then you should
-think about issues like the above.
+aren't sure).
 
 This is really the only really hard part about spinlocks: once you start
 using spinlocks they tend to expand to areas you might not have noticed
@@ -120,11 +90,10 @@ Lesson 3: spinlocks revisited.
 
 The single spin-lock primitives above are by no means the only ones. They
 are the most safe ones, and the ones that work under all circumstances,
-but partly _because_ they are safe they are also fairly slow. They are
-much faster than a generic global cli/sti pair, but slower than they'd
-need to be, because they do have to disable interrupts (which is just a
-single instruction on a x86, but it's an expensive one - and on other
-architectures it can be worse).
+but partly _because_ they are safe they are also fairly slow. They are slower
+than they'd need to be, because they do have to disable interrupts
+(which is just a single instruction on a x86, but it's an expensive one -
+and on other architectures it can be worse).
 
 If you have a case where you have to protect a data structure across
 several CPU's and you want to use spinlocks you can potentially use
index ae563fad227163eb266a3a28c579fb50952d4eaa..187282da92137a2ea147bcb0f664e0e99d90e681 100644 (file)
@@ -594,6 +594,16 @@ S: Maintained
 F:     arch/arm/lib/floppydma.S
 F:     arch/arm/include/asm/floppy.h
 
+ARM PMU PROFILING AND DEBUGGING
+M:     Will Deacon <will.deacon@arm.com>
+S:     Maintained
+F:     arch/arm/kernel/perf_event*
+F:     arch/arm/oprofile/common.c
+F:     arch/arm/kernel/pmu.c
+F:     arch/arm/include/asm/pmu.h
+F:     arch/arm/kernel/hw_breakpoint.c
+F:     arch/arm/include/asm/hw_breakpoint.h
+
 ARM PORT
 M:     Russell King <linux@arm.linux.org.uk>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@ -2197,7 +2207,7 @@ F:        drivers/acpi/dock.c
 DOCUMENTATION
 M:     Randy Dunlap <rdunlap@xenotime.net>
 L:     linux-doc@vger.kernel.org
-T:     quilt oss.oracle.com/~rdunlap/kernel-doc-patches/current/
+T:     quilt http://userweb.kernel.org/~rdunlap/kernel-doc-patches/current/
 S:     Maintained
 F:     Documentation/
 
@@ -4982,7 +4992,7 @@ F:        drivers/power/power_supply*
 
 PNP SUPPORT
 M:     Adam Belay <abelay@mit.edu>
-M:     Bjorn Helgaas <bjorn.helgaas@hp.com>
+M:     Bjorn Helgaas <bhelgaas@google.com>
 S:     Maintained
 F:     drivers/pnp/
 
@@ -6733,6 +6743,7 @@ F:        fs/fat/
 VIDEOBUF2 FRAMEWORK
 M:     Pawel Osciak <pawel@osciak.com>
 M:     Marek Szyprowski <m.szyprowski@samsung.com>
+M:     Kyungmin Park <kyungmin.park@samsung.com>
 L:     linux-media@vger.kernel.org
 S:     Maintained
 F:     drivers/media/video/videobuf2-*
index 86f47a0ddc794d5ec1b4b5b1baa27e2f45a37028..60d91f76c2fd1c94af79dd994d79d46a131c6cbd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 3
 PATCHLEVEL = 0
 SUBLEVEL = 0
-EXTRAVERSION = -rc6
+EXTRAVERSION = -rc7
 NAME = Sneaky Weasel
 
 # *DOCUMENTATION*
index 9adc278a22abb36df1bdfdacd1db1fe240f8d0fb..a9bb4395744346aae83738227e9d5754be805ef1 100644 (file)
@@ -321,7 +321,7 @@ config ARCH_CLPS711X
 
 config ARCH_CNS3XXX
        bool "Cavium Networks CNS3XXX family"
-       select CPU_V6
+       select CPU_V6K
        select GENERIC_CLOCKEVENTS
        select ARM_GIC
        select MIGHT_HAVE_PCI
@@ -376,6 +376,7 @@ config ARCH_MXC
        select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
+       select GENERIC_IRQ_CHIP
        select HAVE_SCHED_CLOCK
        help
          Support for Freescale MXC/iMX-based family of processors
@@ -591,7 +592,6 @@ config ARCH_TEGRA
        select GENERIC_GPIO
        select HAVE_CLK
        select HAVE_SCHED_CLOCK
-       select ARCH_HAS_BARRIERS if CACHE_L2X0
        select ARCH_HAS_CPUFREQ
        help
          This enables support for NVIDIA Tegra based systems (Tegra APX,
@@ -618,6 +618,8 @@ config ARCH_PXA
        select TICK_ONESHOT
        select PLAT_PXA
        select SPARSE_IRQ
+       select AUTO_ZRELADDR
+       select MULTI_IRQ_HANDLER
        help
          Support for Intel/Marvell's PXA2xx/PXA3xx processor line.
 
index e5681636626f5fab71e38ac758a4409b2a127247..841df7d21c2f64e8d8d9412ec7d848bd0da40318 100644 (file)
@@ -255,7 +255,7 @@ static inline dma_addr_t map_single(struct device *dev, void *ptr, size_t size,
                if (buf == 0) {
                        dev_err(dev, "%s: unable to map unsafe buffer %p!\n",
                               __func__, ptr);
-                       return 0;
+                       return ~0;
                }
 
                dev_dbg(dev,
index 0ace16cba9b5cc3ad3464d15757a4bc89795eaca..88c5802a23514b06d0c2c6b4e07cdc35a502c32d 100644 (file)
@@ -106,6 +106,7 @@ CONFIG_GPIO_SYSFS=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_MXC=y
+CONFIG_USB_STORAGE=y
 CONFIG_MMC=y
 CONFIG_MMC_BLOCK=m
 CONFIG_MMC_SDHCI=m
@@ -145,7 +146,7 @@ CONFIG_ROOT_NFS=y
 CONFIG_NLS_DEFAULT="cp437"
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ASCII=y
-CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_ISO8859_1=y
 CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_UTF8=y
 CONFIG_MAGIC_SYSRQ=y
index 2bf224310fb4d96df2a6a72c2828ce6caee13d7c..db2cb7d180dc0283602744964f27798e778314eb 100644 (file)
@@ -22,6 +22,8 @@ CONFIG_BLK_DEV_INTEGRITY=y
 # CONFIG_IOSCHED_DEADLINE is not set
 # CONFIG_IOSCHED_CFQ is not set
 CONFIG_ARCH_MXS=y
+CONFIG_MACH_MX23EVK=y
+CONFIG_MACH_MX28EVK=y
 CONFIG_MACH_STMP378X_DEVB=y
 CONFIG_MACH_TX28=y
 # CONFIG_ARM_THUMB is not set
@@ -89,7 +91,7 @@ CONFIG_DISPLAY_SUPPORT=m
 # CONFIG_USB_SUPPORT is not set
 CONFIG_MMC=y
 CONFIG_MMC_MXS=y
-CONFIG_RTC_CLASS=m
+CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_DS1307=m
 CONFIG_DMADEVICES=y
 CONFIG_MXS_DMA=y
index a5cce242a77555d7476a02e05c71ca67e0c99c43..97d31a4663daf0c6186cd948a05abf35687686d3 100644 (file)
@@ -11,12 +11,12 @@ CONFIG_ARCH_U8500=y
 CONFIG_UX500_SOC_DB5500=y
 CONFIG_UX500_SOC_DB8500=y
 CONFIG_MACH_U8500=y
+CONFIG_MACH_SNOWBALL=y
 CONFIG_MACH_U5500=y
 CONFIG_NO_HZ=y
 CONFIG_HIGH_RES_TIMERS=y
 CONFIG_SMP=y
 CONFIG_NR_CPUS=2
-CONFIG_HOTPLUG_CPU=y
 CONFIG_PREEMPT=y
 CONFIG_AEABI=y
 CONFIG_CMDLINE="root=/dev/ram0 console=ttyAMA2,115200n8"
@@ -25,8 +25,13 @@ CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
 CONFIG_VFP=y
 CONFIG_NEON=y
 CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_NETFILTER=y
 CONFIG_PHONET=y
-CONFIG_PHONET_PIPECTRLR=y
 # CONFIG_WIRELESS is not set
 CONFIG_CAIF=y
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
@@ -35,6 +40,13 @@ CONFIG_BLK_DEV_RAM_SIZE=65536
 CONFIG_MISC_DEVICES=y
 CONFIG_AB8500_PWM=y
 CONFIG_SENSORS_BH1780=y
+CONFIG_NETDEVICES=y
+CONFIG_SMSC_PHY=y
+CONFIG_NET_ETHERNET=y
+CONFIG_SMSC911X=y
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+# CONFIG_WLAN is not set
 # CONFIG_INPUT_MOUSEDEV_PSAUX is not set
 CONFIG_INPUT_EVDEV=y
 # CONFIG_KEYBOARD_ATKBD is not set
@@ -49,9 +61,9 @@ CONFIG_INPUT_MISC=y
 CONFIG_INPUT_AB8500_PONKEY=y
 # CONFIG_SERIO is not set
 CONFIG_VT_HW_CONSOLE_BINDING=y
+# CONFIG_LEGACY_PTYS is not set
 CONFIG_SERIAL_AMBA_PL011=y
 CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
-# CONFIG_LEGACY_PTYS is not set
 CONFIG_HW_RANDOM=y
 CONFIG_HW_RANDOM_NOMADIK=y
 CONFIG_I2C=y
@@ -64,14 +76,19 @@ CONFIG_GPIO_TC3589X=y
 CONFIG_MFD_STMPE=y
 CONFIG_MFD_TC3589X=y
 CONFIG_AB8500_CORE=y
-CONFIG_REGULATOR=y
 CONFIG_REGULATOR_AB8500=y
 # CONFIG_HID_SUPPORT is not set
-# CONFIG_USB_SUPPORT is not set
+CONFIG_USB_MUSB_HDRC=y
+CONFIG_USB_GADGET_MUSB_HDRC=y
+CONFIG_MUSB_PIO_ONLY=y
+CONFIG_USB_GADGET=y
+CONFIG_AB8500_USB=y
 CONFIG_MMC=y
+CONFIG_MMC_CLKGATE=y
 CONFIG_MMC_ARMMMCI=y
 CONFIG_NEW_LEDS=y
 CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_LM3530=y
 CONFIG_LEDS_LP5521=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_AB8500=y
@@ -79,7 +96,6 @@ CONFIG_RTC_DRV_PL031=y
 CONFIG_DMADEVICES=y
 CONFIG_STE_DMA40=y
 CONFIG_STAGING=y
-# CONFIG_STAGING_EXCLUDE_BUILD is not set
 CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT2_FS_XATTR=y
@@ -91,6 +107,8 @@ CONFIG_TMPFS=y
 CONFIG_TMPFS_POSIX_ACL=y
 CONFIG_CONFIGFS_FS=m
 # CONFIG_MISC_FILESYSTEMS is not set
+CONFIG_NFS_FS=y
+CONFIG_ROOT_NFS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
 CONFIG_MAGIC_SYSRQ=y
@@ -99,7 +117,5 @@ CONFIG_DEBUG_KERNEL=y
 # CONFIG_SCHED_DEBUG is not set
 # CONFIG_DEBUG_PREEMPT is not set
 CONFIG_DEBUG_INFO=y
-# CONFIG_RCU_CPU_STALL_DETECTOR is not set
 # CONFIG_FTRACE is not set
 CONFIG_DEBUG_USER=y
-CONFIG_DEBUG_ERRORS=y
index 2721a5814cb93b56e0583722df184440c9497532..5a526afb5f1858615ec02928f2e2010b3a25982d 100644 (file)
@@ -23,6 +23,7 @@ struct pt_regs;
 extern void migrate_irqs(void);
 
 extern void asm_do_IRQ(unsigned int, struct pt_regs *);
+void handle_IRQ(unsigned int, struct pt_regs *);
 void init_IRQ(void);
 
 #endif
index 83bbad03fcc6642f7ab5dc0bc1f8bce5a790eac9..dbc1f41575b2c1d87db293290dbbf18b04ecfe42 100644 (file)
@@ -67,12 +67,12 @@ int arch_show_interrupts(struct seq_file *p, int prec)
 }
 
 /*
- * do_IRQ handles all hardware IRQ's.  Decoded IRQs should not
- * come via this function.  Instead, they should provide their
- * own 'handler'
+ * handle_IRQ handles all hardware IRQ's.  Decoded IRQs should
+ * not come via this function.  Instead, they should provide their
+ * own 'handler'.  Used by platform code implementing C-based 1st
+ * level decoding.
  */
-asmlinkage void __exception_irq_entry
-asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
+void handle_IRQ(unsigned int irq, struct pt_regs *regs)
 {
        struct pt_regs *old_regs = set_irq_regs(regs);
 
@@ -97,6 +97,15 @@ asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
        set_irq_regs(old_regs);
 }
 
+/*
+ * asm_do_IRQ is the interface to be used from assembly code.
+ */
+asmlinkage void __exception_irq_entry
+asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
+{
+       handle_IRQ(irq, regs);
+}
+
 void set_irq_flags(unsigned int irq, unsigned int iflags)
 {
        unsigned long clr = 0, set = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
index d53c0abc4dd3aaa375595fcd4d54527f013b41f8..2b5b1421596c2d5cd09f7e2b603f91c9fc3c5dab 100644 (file)
@@ -583,7 +583,7 @@ static int armpmu_event_init(struct perf_event *event)
 static void armpmu_enable(struct pmu *pmu)
 {
        /* Enable all of the perf events on hardware. */
-       int idx;
+       int idx, enabled = 0;
        struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
 
        if (!armpmu)
@@ -596,9 +596,11 @@ static void armpmu_enable(struct pmu *pmu)
                        continue;
 
                armpmu->enable(&event->hw, idx);
+               enabled = 1;
        }
 
-       armpmu->start();
+       if (enabled)
+               armpmu->start();
 }
 
 static void armpmu_disable(struct pmu *pmu)
index ed11fb08b05a5b2d3fd022d981970c01c9fdc088..acbb447ac6b5eae7d5a0d5d99297ab3091a7869b 100644 (file)
@@ -73,6 +73,7 @@ __setup("fpe=", fpe_setup);
 #endif
 
 extern void paging_init(struct machine_desc *desc);
+extern void sanity_check_meminfo(void);
 extern void reboot_setup(char *str);
 
 unsigned int processor_id;
@@ -900,6 +901,7 @@ void __init setup_arch(char **cmdline_p)
 
        parse_early_param();
 
+       sanity_check_meminfo();
        arm_memblock_init(&meminfo, mdesc);
 
        paging_init(mdesc);
index 60636f499cb3eafd5318413dd4c83a97949abe91..2c277d40cee681ccc496239b3ab6724259a35756 100644 (file)
@@ -115,7 +115,7 @@ static void __cpuinit twd_calibrate_rate(void)
                twd_timer_rate = (0xFFFFFFFFU - count) * (HZ / 5);
 
                printk("%lu.%02luMHz.\n", twd_timer_rate / 1000000,
-                       (twd_timer_rate / 1000000) % 100);
+                       (twd_timer_rate / 10000) % 100);
        }
 }
 
index 08e5c8759502ba14cf3a83495ccd1df6d00dbf9b..4b804baa5f80f8ecf8131ee0a596be92831b16bc 100644 (file)
@@ -170,6 +170,8 @@ static struct platform_device *cns3420_pdevs[] __initdata = {
 
 static void __init cns3420_init(void)
 {
+       cns3xxx_l2x0_init();
+
        platform_add_devices(cns3420_pdevs, ARRAY_SIZE(cns3420_pdevs));
 
        cns3xxx_ahci_init();
index da30078a80c16078192373b67ac0ed59de30a7a7..941a308e12533e859b0eddeb17998931921591f1 100644 (file)
@@ -16,6 +16,7 @@
 #include <asm/mach/time.h>
 #include <asm/mach/irq.h>
 #include <asm/hardware/gic.h>
+#include <asm/hardware/cache-l2x0.h>
 #include <mach/cns3xxx.h>
 #include "core.h"
 
@@ -244,3 +245,45 @@ static void __init cns3xxx_timer_init(void)
 struct sys_timer cns3xxx_timer = {
        .init = cns3xxx_timer_init,
 };
+
+#ifdef CONFIG_CACHE_L2X0
+
+void __init cns3xxx_l2x0_init(void)
+{
+       void __iomem *base = ioremap(CNS3XXX_L2C_BASE, SZ_4K);
+       u32 val;
+
+       if (WARN_ON(!base))
+               return;
+
+       /*
+        * Tag RAM Control register
+        *
+        * bit[10:8]    - 1 cycle of write accesses latency
+        * bit[6:4]     - 1 cycle of read accesses latency
+        * bit[3:0]     - 1 cycle of setup latency
+        *
+        * 1 cycle of latency for setup, read and write accesses
+        */
+       val = readl(base + L2X0_TAG_LATENCY_CTRL);
+       val &= 0xfffff888;
+       writel(val, base + L2X0_TAG_LATENCY_CTRL);
+
+       /*
+        * Data RAM Control register
+        *
+        * bit[10:8]    - 1 cycles of write accesses latency
+        * bit[6:4]     - 1 cycles of read accesses latency
+        * bit[3:0]     - 1 cycle of setup latency
+        *
+        * 1 cycle of latency for setup, read and write accesses
+        */
+       val = readl(base + L2X0_DATA_LATENCY_CTRL);
+       val &= 0xfffff888;
+       writel(val, base + L2X0_DATA_LATENCY_CTRL);
+
+       /* 32 KiB, 8-way, parity disable */
+       l2x0_init(base, 0x00540000, 0xfe000fff);
+}
+
+#endif /* CONFIG_CACHE_L2X0 */
index ffeb3a8b73bacfb1498d6cfa52ae3e1dd8d11439..fcd225343c61c6b18535edcd2ce0230db8e65348 100644 (file)
 
 extern struct sys_timer cns3xxx_timer;
 
+#ifdef CONFIG_CACHE_L2X0
+void __init cns3xxx_l2x0_init(void);
+#else
+static inline void cns3xxx_l2x0_init(void) {}
+#endif /* CONFIG_CACHE_L2X0 */
+
 void __init cns3xxx_map_io(void);
 void __init cns3xxx_init_irq(void);
 void cns3xxx_power_off(void);
index 1d4b65fd673eb23e9d2ac2fd9dbded0f2e8ba6d9..6659a0d137a32f246895a011195d1ead66657841 100644 (file)
@@ -251,9 +251,9 @@ static void ep93xx_uart_set_mctrl(struct amba_device *dev,
        unsigned int mcr;
 
        mcr = 0;
-       if (!(mctrl & TIOCM_RTS))
+       if (mctrl & TIOCM_RTS)
                mcr |= 2;
-       if (!(mctrl & TIOCM_DTR))
+       if (mctrl & TIOCM_DTR)
                mcr |= 1;
 
        __raw_writel(mcr, base + EP93XX_UART_MCR_OFFSET);
index 9babe4473e8893614e2cddef1ebfd1855f9e94c2..bfd621460abfa6d5322024a9412d28c4b891a4d7 100644 (file)
@@ -23,6 +23,7 @@
 #include <plat/sdhci.h>
 #include <plat/devs.h>
 #include <plat/fimc-core.h>
+#include <plat/iic-core.h>
 
 #include <mach/regs-irq.h>
 
@@ -132,6 +133,11 @@ void __init exynos4_map_io(void)
        s3c_fimc_setname(1, "exynos4-fimc");
        s3c_fimc_setname(2, "exynos4-fimc");
        s3c_fimc_setname(3, "exynos4-fimc");
+
+       /* The I2C bus controllers are directly compatible with s3c2440 */
+       s3c_i2c0_setname("s3c2440-i2c");
+       s3c_i2c1_setname("s3c2440-i2c");
+       s3c_i2c2_setname("s3c2440-i2c");
 }
 
 void __init exynos4_init_clocks(int xtal)
index 1eed5f9f7bd318bee8be3270239d684bd7b69824..983069a5323912f6b7f0775681166db200089b29 100644 (file)
@@ -330,7 +330,7 @@ struct platform_device exynos4_device_ac97 = {
 
 static int exynos4_spdif_cfg_gpio(struct platform_device *pdev)
 {
-       s3c_gpio_cfgpin_range(EXYNOS4_GPC1(0), 2, S3C_GPIO_SFN(3));
+       s3c_gpio_cfgpin_range(EXYNOS4_GPC1(0), 2, S3C_GPIO_SFN(4));
 
        return 0;
 }
index 6c6cfc50c46b6bd6ef37b1c213c2e9fb4e5f6131..3cdeb3647542592a4a62f98e0c6b647da358b0d4 100644 (file)
@@ -13,7 +13,7 @@
 #include <linux/linkage.h>
 #include <linux/init.h>
 
-       __INIT
+       __CPUINIT
 
 /*
  * exynos4 specific entry point for secondary CPUs.  This provides
index 152676471b67d4fb7f219c3bedf1eaa5de560ca5..edd814110da86efcf451e1c1c0585651a447011b 100644 (file)
@@ -78,9 +78,7 @@ static struct s3c2410_uartcfg smdkv310_uartcfgs[] __initdata = {
 };
 
 static struct s3c_sdhci_platdata smdkv310_hsmmc0_pdata __initdata = {
-       .cd_type                = S3C_SDHCI_CD_GPIO,
-       .ext_cd_gpio            = EXYNOS4_GPK0(2),
-       .ext_cd_gpio_invert     = 1,
+       .cd_type                = S3C_SDHCI_CD_INTERNAL,
        .clk_type               = S3C_SDHCI_CLK_DIV_EXTERNAL,
 #ifdef CONFIG_EXYNOS4_SDHCI_CH0_8BIT
        .max_width              = 8,
@@ -96,9 +94,7 @@ static struct s3c_sdhci_platdata smdkv310_hsmmc1_pdata __initdata = {
 };
 
 static struct s3c_sdhci_platdata smdkv310_hsmmc2_pdata __initdata = {
-       .cd_type                = S3C_SDHCI_CD_GPIO,
-       .ext_cd_gpio            = EXYNOS4_GPK2(2),
-       .ext_cd_gpio_invert     = 1,
+       .cd_type                = S3C_SDHCI_CD_INTERNAL,
        .clk_type               = S3C_SDHCI_CLK_DIV_EXTERNAL,
 #ifdef CONFIG_EXYNOS4_SDHCI_CH2_8BIT
        .max_width              = 8,
index 59c97a3311368cb9b2dddd8171fe7efdb73c79a8..0519dd7f034bc07446d2cb7384f9d434821ca551 100644 (file)
@@ -167,6 +167,7 @@ config MACH_EUKREA_MBIMXSD25_BASEBOARD
        bool "Eukrea MBIMXSD development board"
        select IMX_HAVE_PLATFORM_GPIO_KEYS
        select IMX_HAVE_PLATFORM_IMX_SSI
+       select LEDS_GPIO_REGISTER
        help
          This adds board specific devices that can be found on Eukrea's
          MBIMXSD evaluation board.
@@ -265,6 +266,7 @@ config MACH_EUKREA_MBIMX27_BASEBOARD
        select IMX_HAVE_PLATFORM_IMX_UART
        select IMX_HAVE_PLATFORM_MXC_MMC
        select IMX_HAVE_PLATFORM_SPI_IMX
+       select LEDS_GPIO_REGISTER
        help
          This adds board specific devices that can be found on Eukrea's
          MBIMX27 evaluation board.
@@ -276,6 +278,7 @@ config MACH_MX27_3DS
        select SOC_IMX27
        select IMX_HAVE_PLATFORM_FSL_USB2_UDC
        select IMX_HAVE_PLATFORM_IMX2_WDT
+       select IMX_HAVE_PLATFORM_IMX_FB
        select IMX_HAVE_PLATFORM_IMX_I2C
        select IMX_HAVE_PLATFORM_IMX_KEYPAD
        select IMX_HAVE_PLATFORM_IMX_UART
@@ -403,6 +406,7 @@ config MACH_MX31LITE
        select IMX_HAVE_PLATFORM_MXC_NAND
        select IMX_HAVE_PLATFORM_MXC_RTC
        select IMX_HAVE_PLATFORM_SPI_IMX
+       select LEDS_GPIO_REGISTER
        help
          Include support for MX31 LITEKIT platform. This includes specific
          configurations for the board and its peripherals.
@@ -471,6 +475,7 @@ config MACH_MX31MOBOARD
        select IMX_HAVE_PLATFORM_MXC_EHCI
        select IMX_HAVE_PLATFORM_MXC_MMC
        select IMX_HAVE_PLATFORM_SPI_IMX
+       select LEDS_GPIO_REGISTER
        select MXC_ULPI if USB_ULPI
        help
          Include support for mx31moboard platform. This includes specific
@@ -577,6 +582,7 @@ config MACH_EUKREA_MBIMXSD35_BASEBOARD
        select IMX_HAVE_PLATFORM_GPIO_KEYS
        select IMX_HAVE_PLATFORM_IMX_SSI
        select IMX_HAVE_PLATFORM_IPU_CORE
+       select LEDS_GPIO_REGISTER
        help
          This adds board specific devices that can be found on Eukrea's
          MBIMXSD evaluation board.
index 236f1495efad092039a391089b34a6100f77e5f3..4d76f67f270fa4ac6e57a86ba5f3fa529ba97d75 100644 (file)
@@ -475,7 +475,6 @@ void imx_dma_enable(int channel)
        imx_dmav1_writel(imx_dmav1_readl(DMA_CCR(channel)) | CCR_CEN |
                CCR_ACRPT, DMA_CCR(channel));
 
-#ifdef CONFIG_ARCH_MX2
        if ((cpu_is_mx21() || cpu_is_mx27()) &&
                        imxdma->sg && imx_dma_hw_chain(imxdma)) {
                imxdma->sg = sg_next(imxdma->sg);
@@ -487,7 +486,6 @@ void imx_dma_enable(int channel)
                                DMA_CCR(channel));
                }
        }
-#endif
        imxdma->in_use = 1;
 
        local_irq_restore(flags);
@@ -518,7 +516,6 @@ void imx_dma_disable(int channel)
 }
 EXPORT_SYMBOL(imx_dma_disable);
 
-#ifdef CONFIG_ARCH_MX2
 static void imx_dma_watchdog(unsigned long chno)
 {
        struct imx_dma_channel *imxdma = &imx_dma_channels[chno];
@@ -530,7 +527,6 @@ static void imx_dma_watchdog(unsigned long chno)
        if (imxdma->err_handler)
                imxdma->err_handler(chno, imxdma->data, IMX_DMA_ERR_TIMEOUT);
 }
-#endif
 
 static irqreturn_t dma_err_handler(int irq, void *dev_id)
 {
@@ -654,10 +650,8 @@ static irqreturn_t dma_irq_handler(int irq, void *dev_id)
 {
        int i, disr;
 
-#ifdef CONFIG_ARCH_MX2
        if (cpu_is_mx21() || cpu_is_mx27())
                dma_err_handler(irq, dev_id);
-#endif
 
        disr = imx_dmav1_readl(DMA_DISR);
 
@@ -703,7 +697,6 @@ int imx_dma_request(int channel, const char *name)
        imxdma->name = name;
        local_irq_restore(flags); /* request_irq() can block */
 
-#ifdef CONFIG_ARCH_MX2
        if (cpu_is_mx21() || cpu_is_mx27()) {
                ret = request_irq(MX2x_INT_DMACH0 + channel,
                                dma_irq_handler, 0, "DMA", NULL);
@@ -717,7 +710,6 @@ int imx_dma_request(int channel, const char *name)
                imxdma->watchdog.function = &imx_dma_watchdog;
                imxdma->watchdog.data = channel;
        }
-#endif
 
        return ret;
 }
@@ -744,10 +736,8 @@ void imx_dma_free(int channel)
        imx_dma_disable(channel);
        imxdma->name = NULL;
 
-#ifdef CONFIG_ARCH_MX2
        if (cpu_is_mx21() || cpu_is_mx27())
                free_irq(MX2x_INT_DMACH0 + channel, NULL);
-#endif
 
        local_irq_restore(flags);
 }
@@ -803,21 +793,13 @@ static int __init imx_dma_init(void)
        int ret = 0;
        int i;
 
-#ifdef CONFIG_ARCH_MX1
        if (cpu_is_mx1())
                imx_dmav1_baseaddr = MX1_IO_ADDRESS(MX1_DMA_BASE_ADDR);
-       else
-#endif
-#ifdef CONFIG_MACH_MX21
-       if (cpu_is_mx21())
+       else if (cpu_is_mx21())
                imx_dmav1_baseaddr = MX21_IO_ADDRESS(MX21_DMA_BASE_ADDR);
-       else
-#endif
-#ifdef CONFIG_MACH_MX27
-       if (cpu_is_mx27())
+       else if (cpu_is_mx27())
                imx_dmav1_baseaddr = MX27_IO_ADDRESS(MX27_DMA_BASE_ADDR);
        else
-#endif
                return 0;
 
        dma_clk = clk_get(NULL, "dma");
@@ -828,7 +810,6 @@ static int __init imx_dma_init(void)
        /* reset DMA module */
        imx_dmav1_writel(DCR_DRST, DMA_DCR);
 
-#ifdef CONFIG_ARCH_MX1
        if (cpu_is_mx1()) {
                ret = request_irq(MX1_DMA_INT, dma_irq_handler, 0, "DMA", NULL);
                if (ret) {
@@ -843,7 +824,7 @@ static int __init imx_dma_init(void)
                        return ret;
                }
        }
-#endif
+
        /* enable DMA module */
        imx_dmav1_writel(DCR_DEN, DMA_DCR);
 
index 5911281da5f59cef0aed95f3e82e3da30750bdeb..5db3e1463af7714bff06e8b17f526804148e89b0 100644 (file)
@@ -112,7 +112,7 @@ eukrea_mbimx27_keymap_data __initconst = {
        .keymap_size    = ARRAY_SIZE(eukrea_mbimx27_keymap),
 };
 
-static struct gpio_led gpio_leds[] = {
+static const struct gpio_led eukrea_mbimx27_gpio_leds[] __initconst = {
        {
                .name                   = "led1",
                .default_trigger        = "heartbeat",
@@ -127,17 +127,10 @@ static struct gpio_led gpio_leds[] = {
        },
 };
 
-static struct gpio_led_platform_data gpio_led_info = {
-       .leds           = gpio_leds,
-       .num_leds       = ARRAY_SIZE(gpio_leds),
-};
-
-static struct platform_device leds_gpio = {
-       .name   = "leds-gpio",
-       .id     = -1,
-       .dev    = {
-               .platform_data  = &gpio_led_info,
-       },
+static const struct gpio_led_platform_data
+               eukrea_mbimx27_gpio_led_info __initconst = {
+       .leds           = eukrea_mbimx27_gpio_leds,
+       .num_leds       = ARRAY_SIZE(eukrea_mbimx27_gpio_leds),
 };
 
 static struct imx_fb_videomode eukrea_mbimx27_modes[] = {
@@ -293,10 +286,6 @@ static struct i2c_board_info eukrea_mbimx27_i2c_devices[] = {
        },
 };
 
-static struct platform_device *platform_devices[] __initdata = {
-       &leds_gpio,
-};
-
 static const struct imxmmc_platform_data sdhc_pdata __initconst = {
        .dat3_card_detect = 1,
 };
@@ -377,5 +366,5 @@ void __init eukrea_mbimx27_baseboard_init(void)
 
        imx27_add_imx_keypad(&eukrea_mbimx27_keymap_data);
 
-       platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
+       gpio_led_register_device(-1, &eukrea_mbimx27_gpio_led_info);
 }
index f9ef04acdab1f6a37e767657d73ab5201644e40a..01ebcb31e4820fa976cd54e2263c597688c55c87 100644 (file)
@@ -173,7 +173,7 @@ static struct platform_device eukrea_mbimxsd_lcd_powerdev = {
        .dev.platform_data      = &eukrea_mbimxsd_lcd_power_data,
 };
 
-static struct gpio_led eukrea_mbimxsd_leds[] = {
+static const struct gpio_led eukrea_mbimxsd_leds[] __initconst = {
        {
                .name                   = "led1",
                .default_trigger        = "heartbeat",
@@ -182,19 +182,12 @@ static struct gpio_led eukrea_mbimxsd_leds[] = {
        },
 };
 
-static struct gpio_led_platform_data eukrea_mbimxsd_led_info = {
+static const struct gpio_led_platform_data
+               eukrea_mbimxsd_led_info __initconst = {
        .leds           = eukrea_mbimxsd_leds,
        .num_leds       = ARRAY_SIZE(eukrea_mbimxsd_leds),
 };
 
-static struct platform_device eukrea_mbimxsd_leds_gpio = {
-       .name   = "leds-gpio",
-       .id     = -1,
-       .dev    = {
-               .platform_data  = &eukrea_mbimxsd_led_info,
-       },
-};
-
 static struct gpio_keys_button eukrea_mbimxsd_gpio_buttons[] = {
        {
                .gpio           = GPIO_SWITCH1,
@@ -212,7 +205,6 @@ static const struct gpio_keys_platform_data
 };
 
 static struct platform_device *platform_devices[] __initdata = {
-       &eukrea_mbimxsd_leds_gpio,
        &eukrea_mbimxsd_lcd_powerdev,
 };
 
@@ -287,5 +279,6 @@ void __init eukrea_mbimxsd25_baseboard_init(void)
                                ARRAY_SIZE(eukrea_mbimxsd_i2c_devices));
 
        platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
+       gpio_led_register_device(-1, &eukrea_mbimxsd_led_info);
        imx_add_gpio_keys(&eukrea_mbimxsd_button_data);
 }
index 4909ea05855a13a83806e4760189a3c1100628b1..558eb526ba56fdb0a738587681c913373a63cd61 100644 (file)
@@ -193,19 +193,12 @@ static struct gpio_led eukrea_mbimxsd_leds[] = {
        },
 };
 
-static struct gpio_led_platform_data eukrea_mbimxsd_led_info = {
+static const struct gpio_led_platform_data
+               eukrea_mbimxsd_led_info __initconst = {
        .leds           = eukrea_mbimxsd_leds,
        .num_leds       = ARRAY_SIZE(eukrea_mbimxsd_leds),
 };
 
-static struct platform_device eukrea_mbimxsd_leds_gpio = {
-       .name   = "leds-gpio",
-       .id     = -1,
-       .dev    = {
-               .platform_data  = &eukrea_mbimxsd_led_info,
-       },
-};
-
 static struct gpio_keys_button eukrea_mbimxsd_gpio_buttons[] = {
        {
                .gpio           = GPIO_SWITCH1,
@@ -223,7 +216,6 @@ static const struct gpio_keys_platform_data
 };
 
 static struct platform_device *platform_devices[] __initdata = {
-       &eukrea_mbimxsd_leds_gpio,
        &eukrea_mbimxsd_lcd_powerdev,
 };
 
@@ -299,5 +291,6 @@ void __init eukrea_mbimxsd35_baseboard_init(void)
                                ARRAY_SIZE(eukrea_mbimxsd_i2c_devices));
 
        platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
+       gpio_led_register_device(-1, &eukrea_mbimxsd_led_info);
        imx_add_gpio_keys(&eukrea_mbimxsd_button_data);
 }
index 15e45c84e37189b2f12e440b637b9a1cc6a64025..a404c89485ca376541403d2b74aca709f152b323 100644 (file)
@@ -99,11 +99,6 @@ static struct platform_device dm9000x_device = {
        }
 };
 
-/* --- SERIAL RESSOURCE --- */
-static const struct imxuart_platform_data uart0_pdata __initconst = {
-       .flags = 0,
-};
-
 static const struct imxuart_platform_data uart1_pdata __initconst = {
        .flags = IMXUART_HAVE_RTSCTS,
 };
@@ -115,11 +110,13 @@ static struct platform_device *devices[] __initdata = {
 
 static void __init apf9328_init(void)
 {
+       imx1_soc_init();
+
        mxc_gpio_setup_multiple_pins(apf9328_pins,
                        ARRAY_SIZE(apf9328_pins),
                        "APF9328");
 
-       imx1_add_imx_uart0(&uart0_pdata);
+       imx1_add_imx_uart0(NULL);
        imx1_add_imx_uart1(&uart1_pdata);
 
        platform_add_devices(devices, ARRAY_SIZE(devices));
index ffb40ff619b1013c8716b798fd5352387869f575..ede2710f8b764396ee04860154b90cf45b99bec5 100644 (file)
@@ -490,6 +490,8 @@ static struct platform_device *devices[] __initdata = {
  */
 static void __init armadillo5x0_init(void)
 {
+       imx31_soc_init();
+
        mxc_iomux_setup_multiple_pins(armadillo5x0_pins,
                        ARRAY_SIZE(armadillo5x0_pins), "armadillo5x0");
 
index 42e4f078a19c2025c3639ca68f368d33fcab2afe..f49470553bdfb24fd49ff07440cccde06ca42354 100644 (file)
@@ -42,6 +42,8 @@ static const unsigned int bug_pins[] __initconst = {
 
 static void __init bug_board_init(void)
 {
+       imx31_soc_init();
+
        mxc_iomux_setup_multiple_pins(bug_pins,
                                      ARRAY_SIZE(bug_pins), "uart-4");
        imx31_add_imx_uart4(&uart_pdata);
index 46a2e41d43d2c21bac6cb2e54e9472aad6d9393d..87887ac5806b43612c8bba200e3f57df83be0c24 100644 (file)
@@ -250,6 +250,8 @@ __setup("otg_mode=", eukrea_cpuimx27_otg_mode);
 
 static void __init eukrea_cpuimx27_init(void)
 {
+       imx27_soc_init();
+
        mxc_gpio_setup_multiple_pins(eukrea_cpuimx27_pins,
                ARRAY_SIZE(eukrea_cpuimx27_pins), "CPUIMX27");
 
index 3f8ef825fa6f132207c9100c04c39a7c013d0ec8..f39a478ba1a63540a26783a4713033b37121d4f3 100644 (file)
@@ -156,6 +156,8 @@ __setup("otg_mode=", eukrea_cpuimx35_otg_mode);
  */
 static void __init eukrea_cpuimx35_init(void)
 {
+       imx35_soc_init();
+
        mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx35_pads,
                        ARRAY_SIZE(eukrea_cpuimx35_pads));
 
index 148cff2819b95246c9c8946c62f41600fb546402..da36da52969db2bc82e5da006e7085df21a3482a 100644 (file)
@@ -125,6 +125,8 @@ __setup("otg_mode=", eukrea_cpuimx25_otg_mode);
 
 static void __init eukrea_cpuimx25_init(void)
 {
+       imx25_soc_init();
+
        if (mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx25_pads,
                        ARRAY_SIZE(eukrea_cpuimx25_pads)))
                printk(KERN_ERR "error setting cpuimx25 pads !\n");
index 7ae43b1ec51715ece828b11a72937c99ccb920a7..6707de0ab71671ca07098f279aec78e8522305dc 100644 (file)
@@ -34,7 +34,7 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
 #include <mach/common.h>
-#include <mach/iomux.h>
+#include <mach/iomux-mx27.h>
 
 #include "devices-imx27.h"
 
@@ -231,6 +231,8 @@ static void __init visstrim_m10_board_init(void)
 {
        int ret;
 
+       imx27_soc_init();
+
        ret = mxc_gpio_setup_multiple_pins(visstrim_m10_pins,
                        ARRAY_SIZE(visstrim_m10_pins), "VISSTRIM_M10");
        if (ret)
index 9be6cd6fbf8c0563d456eb79db4afd03bc8db121..272f793e9247128fc49300f0afe40dabdf8b19d4 100644 (file)
@@ -50,6 +50,8 @@ static const int mx27ipcam_pins[] __initconst = {
 
 static void __init mx27ipcam_init(void)
 {
+       imx27_soc_init();
+
        mxc_gpio_setup_multiple_pins(mx27ipcam_pins, ARRAY_SIZE(mx27ipcam_pins),
                "mx27ipcam");
 
index 841140516ede2e89e5d197053f18ef39762a033b..d81a769fe895f69951ec4e8aa2bef4a56c26bd48 100644 (file)
@@ -59,6 +59,8 @@ static const struct imxuart_platform_data uart_pdata __initconst = {
 
 static void __init mx27lite_init(void)
 {
+       imx27_soc_init();
+
        mxc_gpio_setup_multiple_pins(mx27lite_pins, ARRAY_SIZE(mx27lite_pins),
                "imx27lite");
        imx27_add_imx_uart0(&uart_pdata);
index 1ecae20cf4e3cae1a240bd34aee6861b29a9aaab..e472a1d88058706549523fefe8a0ec7fd44c8858 100644 (file)
@@ -223,6 +223,8 @@ static int kzm_pins[] __initdata = {
  */
 static void __init kzm_board_init(void)
 {
+       imx31_soc_init();
+
        mxc_iomux_setup_multiple_pins(kzm_pins,
                                      ARRAY_SIZE(kzm_pins), "kzm");
        kzm_init_ext_uart();
index 38ec5cbbda9bd9f96a1bd82e17534fab1f50cecf..5cd8bee4696025525112bd585e90790e813eb221 100644 (file)
@@ -115,6 +115,8 @@ static struct i2c_board_info mx1ads_i2c_devices[] = {
  */
 static void __init mx1ads_init(void)
 {
+       imx1_soc_init();
+
        mxc_gpio_setup_multiple_pins(mx1ads_pins,
                ARRAY_SIZE(mx1ads_pins), "mx1ads");
 
index 74ac88978ddd6ec22cf25d86f78b8d4f176e01ec..d389ecf9b5a86bfa0a68ccbd69df246d8acbcd82 100644 (file)
@@ -279,6 +279,8 @@ static struct platform_device *platform_devices[] __initdata = {
 
 static void __init mx21ads_board_init(void)
 {
+       imx21_soc_init();
+
        mxc_gpio_setup_multiple_pins(mx21ads_pins, ARRAY_SIZE(mx21ads_pins),
                        "mx21ads");
 
index 58ea3fdf09119bdfa239f44b4a51a74f6bd9de16..01534bb613051432e4ae26d97b4642d5b658aa40 100644 (file)
@@ -219,6 +219,8 @@ static const struct esdhc_platform_data mx25pdk_esdhc_pdata __initconst = {
 
 static void __init mx25pdk_init(void)
 {
+       imx25_soc_init();
+
        mxc_iomux_v3_setup_multiple_pads(mx25pdk_pads,
                        ARRAY_SIZE(mx25pdk_pads));
 
index 6e1accf93f811d57b7ab97c463b562a39bd43b82..6fa6934ab1509b87642bd41158b01841e9b49d26 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/mfd/mc13783.h>
 #include <linux/spi/spi.h>
 #include <linux/regulator/machine.h>
+#include <linux/spi/l4f00242t03.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
 #include "devices-imx27.h"
 
-#define SD1_EN_GPIO (GPIO_PORTB + 25)
-#define OTG_PHY_RESET_GPIO (GPIO_PORTB + 23)
-#define SPI2_SS0 (GPIO_PORTD + 21)
-#define EXPIO_PARENT_INT       (MXC_INTERNAL_IRQS + GPIO_PORTC + 28)
+#define SD1_EN_GPIO            IMX_GPIO_NR(2, 25)
+#define OTG_PHY_RESET_GPIO     IMX_GPIO_NR(2, 23)
+#define SPI2_SS0               IMX_GPIO_NR(4, 21)
+#define EXPIO_PARENT_INT       gpio_to_irq(IMX_GPIO_NR(3, 28))
+#define PMIC_INT               IMX_GPIO_NR(3, 14)
+#define SPI1_SS0               IMX_GPIO_NR(4, 28)
+#define SD1_CD                 IMX_GPIO_NR(2, 26)
+#define LCD_RESET              IMX_GPIO_NR(1, 3)
+#define LCD_ENABLE             IMX_GPIO_NR(1, 31)
 
 static const int mx27pdk_pins[] __initconst = {
        /* UART1 */
@@ -94,13 +100,47 @@ static const int mx27pdk_pins[] __initconst = {
        PE2_PF_USBOTG_DIR,
        PE24_PF_USBOTG_CLK,
        PE25_PF_USBOTG_DATA7,
+       /* CSPI1 */
+       PD31_PF_CSPI1_MOSI,
+       PD30_PF_CSPI1_MISO,
+       PD29_PF_CSPI1_SCLK,
+       PD25_PF_CSPI1_RDY,
+       SPI1_SS0 | GPIO_GPIO | GPIO_OUT,
        /* CSPI2 */
        PD22_PF_CSPI2_SCLK,
        PD23_PF_CSPI2_MISO,
        PD24_PF_CSPI2_MOSI,
+       SPI2_SS0 | GPIO_GPIO | GPIO_OUT,
        /* I2C1 */
        PD17_PF_I2C_DATA,
        PD18_PF_I2C_CLK,
+       /* PMIC INT */
+       PMIC_INT | GPIO_GPIO | GPIO_IN,
+       /* LCD */
+       PA5_PF_LSCLK,
+       PA6_PF_LD0,
+       PA7_PF_LD1,
+       PA8_PF_LD2,
+       PA9_PF_LD3,
+       PA10_PF_LD4,
+       PA11_PF_LD5,
+       PA12_PF_LD6,
+       PA13_PF_LD7,
+       PA14_PF_LD8,
+       PA15_PF_LD9,
+       PA16_PF_LD10,
+       PA17_PF_LD11,
+       PA18_PF_LD12,
+       PA19_PF_LD13,
+       PA20_PF_LD14,
+       PA21_PF_LD15,
+       PA22_PF_LD16,
+       PA23_PF_LD17,
+       PA28_PF_HSYNC,
+       PA29_PF_VSYNC,
+       PA30_PF_CONTRAST,
+       LCD_ENABLE | GPIO_GPIO | GPIO_OUT,
+       LCD_RESET | GPIO_GPIO | GPIO_OUT,
 };
 
 static const struct imxuart_platform_data uart_pdata __initconst = {
@@ -131,13 +171,13 @@ static const struct matrix_keymap_data mx27_3ds_keymap_data __initconst = {
 static int mx27_3ds_sdhc1_init(struct device *dev, irq_handler_t detect_irq,
                                void *data)
 {
-       return request_irq(IRQ_GPIOB(26), detect_irq, IRQF_TRIGGER_FALLING |
-                       IRQF_TRIGGER_RISING, "sdhc1-card-detect", data);
+       return request_irq(gpio_to_irq(SD1_CD), detect_irq,
+       IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, "sdhc1-card-detect", data);
 }
 
 static void mx27_3ds_sdhc1_exit(struct device *dev, void *data)
 {
-       free_irq(IRQ_GPIOB(26), data);
+       free_irq(gpio_to_irq(SD1_CD), data);
 }
 
 static const struct imxmmc_platform_data sdhc1_pdata __initconst = {
@@ -193,6 +233,13 @@ static int __init mx27_3ds_otg_mode(char *options)
 __setup("otg_mode=", mx27_3ds_otg_mode);
 
 /* Regulators */
+static struct regulator_init_data gpo_init = {
+       .constraints = {
+               .boot_on = 1,
+               .always_on = 1,
+       }
+};
+
 static struct regulator_consumer_supply vmmc1_consumers[] = {
        REGULATOR_SUPPLY("lcd_2v8", NULL),
 };
@@ -201,7 +248,9 @@ static struct regulator_init_data vmmc1_init = {
        .constraints = {
                .min_uV = 2800000,
                .max_uV = 2800000,
-               .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
+               .apply_uV = 1,
+               .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
+                                 REGULATOR_CHANGE_STATUS,
        },
        .num_consumer_supplies = ARRAY_SIZE(vmmc1_consumers),
        .consumer_supplies = vmmc1_consumers,
@@ -228,6 +277,12 @@ static struct mc13xxx_regulator_init_data mx27_3ds_regulators[] = {
        }, {
                .id = MC13783_REG_VGEN,
                .init_data = &vgen_init,
+       }, {
+               .id = MC13783_REG_GPO1, /* Turn on 1.8V */
+               .init_data = &gpo_init,
+       }, {
+               .id = MC13783_REG_GPO3, /* Turn on 3.3V */
+               .init_data = &gpo_init,
        },
 };
 
@@ -238,15 +293,63 @@ static struct mc13xxx_platform_data mc13783_pdata = {
                .num_regulators = ARRAY_SIZE(mx27_3ds_regulators),
 
        },
-       .flags  = MC13783_USE_REGULATOR,
+       .flags  = MC13783_USE_REGULATOR | MC13783_USE_TOUCHSCREEN |
+       MC13783_USE_RTC,
 };
 
 /* SPI */
-static int spi2_internal_chipselect[] = {SPI2_SS0};
+static int spi1_chipselect[] = {SPI1_SS0};
+
+static const struct spi_imx_master spi1_pdata __initconst = {
+       .chipselect     = spi1_chipselect,
+       .num_chipselect = ARRAY_SIZE(spi1_chipselect),
+};
+
+static int spi2_chipselect[] = {SPI2_SS0};
 
 static const struct spi_imx_master spi2_pdata __initconst = {
-       .chipselect     = spi2_internal_chipselect,
-       .num_chipselect = ARRAY_SIZE(spi2_internal_chipselect),
+       .chipselect     = spi2_chipselect,
+       .num_chipselect = ARRAY_SIZE(spi2_chipselect),
+};
+
+static struct imx_fb_videomode mx27_3ds_modes[] = {
+       {       /* 480x640 @ 60 Hz */
+               .mode = {
+                       .name           = "Epson-VGA",
+                       .refresh        = 60,
+                       .xres           = 480,
+                       .yres           = 640,
+                       .pixclock       = 41701,
+                       .left_margin    = 20,
+                       .right_margin   = 41,
+                       .upper_margin   = 10,
+                       .lower_margin   = 5,
+                       .hsync_len      = 20,
+                       .vsync_len      = 10,
+                       .sync           = FB_SYNC_OE_ACT_HIGH |
+                                               FB_SYNC_CLK_INVERT,
+                       .vmode          = FB_VMODE_NONINTERLACED,
+                       .flag           = 0,
+               },
+               .bpp            = 16,
+               .pcr            = 0xFAC08B82,
+       },
+};
+
+static const struct imx_fb_platform_data mx27_3ds_fb_data __initconst = {
+       .mode = mx27_3ds_modes,
+       .num_modes = ARRAY_SIZE(mx27_3ds_modes),
+       .pwmr           = 0x00A903FF,
+       .lscr1          = 0x00120300,
+       .dmacr          = 0x00020010,
+};
+
+/* LCD */
+static struct l4f00242t03_pdata mx27_3ds_lcd_pdata = {
+       .reset_gpio             = LCD_RESET,
+       .data_enable_gpio       = LCD_ENABLE,
+       .core_supply            = "lcd_2v8",
+       .io_supply              = "vdd_lcdio",
 };
 
 static struct spi_board_info mx27_3ds_spi_devs[] __initdata = {
@@ -256,8 +359,14 @@ static struct spi_board_info mx27_3ds_spi_devs[] __initdata = {
                .bus_num        = 1,
                .chip_select    = 0, /* SS0 */
                .platform_data  = &mc13783_pdata,
-               .irq = IRQ_GPIOC(14),
+               .irq = gpio_to_irq(PMIC_INT),
                .mode = SPI_CS_HIGH,
+       }, {
+               .modalias       = "l4f00242t03",
+               .max_speed_hz   = 5000000,
+               .bus_num        = 0,
+               .chip_select    = 0, /* SS0 */
+               .platform_data  = &mx27_3ds_lcd_pdata,
        },
 };
 
@@ -267,6 +376,8 @@ static const struct imxi2c_platform_data mx27_3ds_i2c0_data __initconst = {
 
 static void __init mx27pdk_init(void)
 {
+       imx27_soc_init();
+
        mxc_gpio_setup_multiple_pins(mx27pdk_pins, ARRAY_SIZE(mx27pdk_pins),
                "mx27pdk");
        mx27_3ds_sdhc1_enable_level_translator();
@@ -289,12 +400,14 @@ static void __init mx27pdk_init(void)
                imx27_add_fsl_usb2_udc(&otg_device_pdata);
 
        imx27_add_spi_imx1(&spi2_pdata);
+       imx27_add_spi_imx0(&spi1_pdata);
        spi_register_board_info(mx27_3ds_spi_devs,
                                                ARRAY_SIZE(mx27_3ds_spi_devs));
 
        if (mxc_expio_init(MX27_CS5_BASE_ADDR, EXPIO_PARENT_INT))
                pr_warn("Init of the debugboard failed, all devices on the debugboard are unusable.\n");
        imx27_add_imx_i2c(0, &mx27_3ds_i2c0_data);
+       imx27_add_imx_fb(&mx27_3ds_fb_data);
 }
 
 static void __init mx27pdk_timer_init(void)
index 1db79506f5e42e724b939f8b39c27b542c819d53..fc26ed71b9edf56cafa4426668b3a52d523b9fb1 100644 (file)
@@ -288,6 +288,8 @@ static const struct imxuart_platform_data uart_pdata __initconst = {
 
 static void __init mx27ads_board_init(void)
 {
+       imx27_soc_init();
+
        mxc_gpio_setup_multiple_pins(mx27ads_pins, ARRAY_SIZE(mx27ads_pins),
                        "mx27ads");
 
index 9b982449cb520723a0ae68491cb8db86abe90ee6..1446b353af056c1824fc3a19a86514875631d5cd 100644 (file)
@@ -53,11 +53,8 @@ static int mx31_3ds_pins[] = {
        MX31_PIN_RXD1__RXD1,
        IOMUX_MODE(MX31_PIN_GPIO1_1, IOMUX_CONFIG_GPIO),
        /*SPI0*/
-       MX31_PIN_CSPI1_SCLK__SCLK,
-       MX31_PIN_CSPI1_MOSI__MOSI,
-       MX31_PIN_CSPI1_MISO__MISO,
-       MX31_PIN_CSPI1_SPI_RDY__SPI_RDY,
-       MX31_PIN_CSPI1_SS2__SS2, /* CS for LCD */
+       IOMUX_MODE(MX31_PIN_DSR_DCE1, IOMUX_CONFIG_ALT1),
+       IOMUX_MODE(MX31_PIN_RI_DCE1, IOMUX_CONFIG_ALT1),
        /* SPI 1 */
        MX31_PIN_CSPI2_SCLK__SCLK,
        MX31_PIN_CSPI2_MOSI__MOSI,
@@ -689,6 +686,11 @@ static void __init mx31_3ds_init(void)
 {
        int ret;
 
+       imx31_soc_init();
+
+       /* Configure SPI1 IOMUX */
+       mxc_iomux_set_gpr(MUX_PGP_CSPI_BB, true);
+
        mxc_iomux_setup_multiple_pins(mx31_3ds_pins, ARRAY_SIZE(mx31_3ds_pins),
                                      "mx31_3ds");
 
index f4dee025463433430fc490ab6a276b0ef271766d..0ce49478a479783947ee6547b3eab34e86fd04be 100644 (file)
@@ -516,6 +516,8 @@ static void __init mx31ads_init_irq(void)
 
 static void __init mx31ads_init(void)
 {
+       imx31_soc_init();
+
        mxc_init_extuart();
        mxc_init_imx_uart();
        mxc_init_i2c();
index 410e676ae087ff16520333b70f085acba14ccbe9..750368ddf0f977479ee301933d31832ff5434e65 100644 (file)
@@ -243,6 +243,8 @@ core_param(mx31lilly_baseboard, mx31lilly_baseboard, int, 0444);
 
 static void __init mx31lilly_board_init(void)
 {
+       imx31_soc_init();
+
        switch (mx31lilly_baseboard) {
        case MX31LILLY_NOBOARD:
                break;
index ac9b4cad320edeb2a3c6c79690f53224b8c80cc3..4b47fd9fdd899f6d13c25f9f816e43b58de7c510 100644 (file)
@@ -230,6 +230,8 @@ static void __init mx31lite_init(void)
 {
        int ret;
 
+       imx31_soc_init();
+
        switch (mx31lite_baseboard) {
        case MX31LITE_NOBOARD:
                break;
index eaa51e49ca9517466793fb667248f9cfabe9f700..b358383120e7c3cb41b793b6c1e4aa71d6582b5a 100644 (file)
@@ -425,7 +425,7 @@ static int __init moboard_usbh2_init(void)
        return 0;
 }
 
-static struct gpio_led mx31moboard_leds[] = {
+static const struct gpio_led mx31moboard_leds[] __initconst = {
        {
                .name   = "coreboard-led-0:red:running",
                .default_trigger = "heartbeat",
@@ -442,26 +442,17 @@ static struct gpio_led mx31moboard_leds[] = {
        },
 };
 
-static struct gpio_led_platform_data mx31moboard_led_pdata = {
+static const struct gpio_led_platform_data mx31moboard_led_pdata __initconst = {
        .num_leds       = ARRAY_SIZE(mx31moboard_leds),
        .leds           = mx31moboard_leds,
 };
 
-static struct platform_device mx31moboard_leds_device = {
-       .name   = "leds-gpio",
-       .id     = -1,
-       .dev    = {
-               .platform_data = &mx31moboard_led_pdata,
-       },
-};
-
 static const struct ipu_platform_data mx3_ipu_data __initconst = {
        .irq_base = MXC_IPU_IRQ_START,
 };
 
 static struct platform_device *devices[] __initdata = {
        &mx31moboard_flash,
-       &mx31moboard_leds_device,
 };
 
 static struct mx3_camera_pdata camera_pdata __initdata = {
@@ -507,10 +498,13 @@ core_param(mx31moboard_baseboard, mx31moboard_baseboard, int, 0444);
  */
 static void __init mx31moboard_init(void)
 {
+       imx31_soc_init();
+
        mxc_iomux_setup_multiple_pins(moboard_pins, ARRAY_SIZE(moboard_pins),
                "moboard");
 
        platform_add_devices(devices, ARRAY_SIZE(devices));
+       gpio_led_register_device(-1, &mx31moboard_led_pdata);
 
        imx31_add_imx_uart0(&uart0_pdata);
        imx31_add_imx_uart4(&uart4_pdata);
index 882880ac1bbc9bf1b57a9b6e2c17ec31cd5415db..b3b9bd8ac2a33f3bf5d993cd9ca9d9e189edd1c1 100644 (file)
@@ -43,7 +43,7 @@
 
 #include "devices-imx35.h"
 
-#define EXPIO_PARENT_INT       (MXC_INTERNAL_IRQS + GPIO_PORTA + 1)
+#define EXPIO_PARENT_INT       gpio_to_irq(IMX_GPIO_NR(1, 1))
 
 static const struct imxuart_platform_data uart_pdata __initconst = {
        .flags = IMXUART_HAVE_RTSCTS,
@@ -179,6 +179,8 @@ static const struct imxi2c_platform_data mx35_3ds_i2c0_data __initconst = {
  */
 static void __init mx35_3ds_init(void)
 {
+       imx35_soc_init();
+
        mxc_iomux_v3_setup_multiple_pads(mx35pdk_pads, ARRAY_SIZE(mx35pdk_pads));
 
        imx35_add_fec(NULL);
index 2774541511e7bc2da0935663a933eb3917cfab62..c85876fed663d072a78e0122f71cef2c2a6f145f 100644 (file)
@@ -233,6 +233,8 @@ static const struct imxuart_platform_data uart_pdata __initconst = {
 
 static void __init mxt_td60_board_init(void)
 {
+       imx27_soc_init();
+
        mxc_gpio_setup_multiple_pins(mxt_td60_pins, ARRAY_SIZE(mxt_td60_pins),
                        "MXT_TD60");
 
index bbddc5a11c43b52dec562f719b0fe3fce044edc6..71083aa160381be2a3b4392cf87a1880ba1d6326 100644 (file)
@@ -357,6 +357,8 @@ static void __init pca100_init(void)
 {
        int ret;
 
+       imx27_soc_init();
+
        /* SSI unit */
        mxc_audmux_v1_configure_port(MX27_AUDMUX_HPCR1_SSI0,
                                  MXC_AUDMUX_V1_PCR_SYN | /* 4wire mode */
index 89c213b81295cc7dc999c112916c2fbfcef17cff..f45b7cd72c8a9df52d12ddc4a2e97708bc275a53 100644 (file)
@@ -576,6 +576,8 @@ static void __init pcm037_init(void)
 {
        int ret;
 
+       imx31_soc_init();
+
        mxc_iomux_set_gpr(MUX_PGP_UH2, 1);
 
        mxc_iomux_setup_multiple_pins(pcm037_pins, ARRAY_SIZE(pcm037_pins),
index 853bb871c7ed0d34b3e124ae20e3584b600736f0..2d6a64bbac44eb18b83ea1694da8fc5c4332bb65 100644 (file)
@@ -295,6 +295,8 @@ static const struct mxc_usbh_platform_data usbh2_pdata __initconst = {
 
 static void __init pcm038_init(void)
 {
+       imx27_soc_init();
+
        mxc_gpio_setup_multiple_pins(pcm038_pins, ARRAY_SIZE(pcm038_pins),
                        "PCM038");
 
index 026441628dfaae962c9dfb88e02788c4e72a8e89..163cc318cafb5ac2019b47b508b91742ed52063a 100644 (file)
@@ -356,6 +356,8 @@ static struct esdhc_platform_data sd1_pdata = {
  */
 static void __init pcm043_init(void)
 {
+       imx35_soc_init();
+
        mxc_iomux_v3_setup_multiple_pads(pcm043_pads, ARRAY_SIZE(pcm043_pads));
 
        mxc_audmux_v2_configure_port(3,
index c1632871593993dc0d98b961d8fd85bd24424d99..3626f486498aee40196f28ebb35c7fd4815f0e11 100644 (file)
@@ -244,6 +244,8 @@ static void __init qong_init_fpga(void)
  */
 static void __init qong_init(void)
 {
+       imx31_soc_init();
+
        mxc_init_imx_uart();
        qong_init_nor_mtd();
        qong_init_fpga();
index dcaee043628ee449590edebba994e32636a8ab98..db2d60470e1583a68b6d98a40b2cc35364b9edce 100644 (file)
@@ -101,21 +101,7 @@ static const int mxc_uart1_pins[] = {
        PC12_PF_UART1_RXD,
 };
 
-static int uart1_mxc_init(struct platform_device *pdev)
-{
-       return mxc_gpio_setup_multiple_pins(mxc_uart1_pins,
-                       ARRAY_SIZE(mxc_uart1_pins), "UART1");
-}
-
-static void uart1_mxc_exit(struct platform_device *pdev)
-{
-       mxc_gpio_release_multiple_pins(mxc_uart1_pins,
-                       ARRAY_SIZE(mxc_uart1_pins));
-}
-
 static const struct imxuart_platform_data uart_pdata __initconst = {
-       .init = uart1_mxc_init,
-       .exit = uart1_mxc_exit,
        .flags = IMXUART_HAVE_RTSCTS,
 };
 
@@ -129,6 +115,11 @@ static struct platform_device *devices[] __initdata = {
  */
 static void __init scb9328_init(void)
 {
+       imx1_soc_init();
+
+       mxc_gpio_setup_multiple_pins(mxc_uart1_pins,
+                       ARRAY_SIZE(mxc_uart1_pins), "UART1");
+
        imx1_add_imx_uart0(&uart_pdata);
 
        printk(KERN_INFO"Scb9328: Adding devices\n");
index d74e3473d2369163adac10c2aba99d7403598115..7d8e012a6335957ae91485230d96d7eb45adf020 100644 (file)
@@ -267,6 +267,8 @@ static struct platform_device *devices[] __initdata = {
  */
 static void __init vpr200_board_init(void)
 {
+       imx35_soc_init();
+
        mxc_iomux_v3_setup_multiple_pads(vpr200_pads, ARRAY_SIZE(vpr200_pads));
 
        imx35_add_fec(NULL);
index 2e482ba5a0e71fa8b21268059e44ee76158bcf05..f2a6566e22e721334433092d7c6bef2331bff3af 100644 (file)
@@ -23,7 +23,6 @@
 
 #include <mach/common.h>
 #include <mach/hardware.h>
-#include <mach/gpio.h>
 #include <mach/irqs.h>
 #include <mach/iomux-v1.h>
 
@@ -44,15 +43,19 @@ void __init imx1_init_early(void)
                        MX1_NUM_GPIO_PORT);
 }
 
-static struct mxc_gpio_port imx1_gpio_ports[] = {
-       DEFINE_IMX_GPIO_PORT_IRQ(MX1, 0, 1, MX1_GPIO_INT_PORTA),
-       DEFINE_IMX_GPIO_PORT_IRQ(MX1, 1, 2, MX1_GPIO_INT_PORTB),
-       DEFINE_IMX_GPIO_PORT_IRQ(MX1, 2, 3, MX1_GPIO_INT_PORTC),
-       DEFINE_IMX_GPIO_PORT_IRQ(MX1, 3, 4, MX1_GPIO_INT_PORTD),
-};
-
 void __init mx1_init_irq(void)
 {
        mxc_init_irq(MX1_IO_ADDRESS(MX1_AVIC_BASE_ADDR));
-       mxc_gpio_init(imx1_gpio_ports,  ARRAY_SIZE(imx1_gpio_ports));
+}
+
+void __init imx1_soc_init(void)
+{
+       mxc_register_gpio(0, MX1_GPIO1_BASE_ADDR, SZ_256,
+                                               MX1_GPIO_INT_PORTA, 0);
+       mxc_register_gpio(1, MX1_GPIO2_BASE_ADDR, SZ_256,
+                                               MX1_GPIO_INT_PORTB, 0);
+       mxc_register_gpio(2, MX1_GPIO3_BASE_ADDR, SZ_256,
+                                               MX1_GPIO_INT_PORTC, 0);
+       mxc_register_gpio(3, MX1_GPIO4_BASE_ADDR, SZ_256,
+                                               MX1_GPIO_INT_PORTD, 0);
 }
index 7a0c500ac2c865462726bd33098df67438cb67ab..4f32a8a9aeed2780a27a320d7e8c84411063beae 100644 (file)
@@ -22,9 +22,9 @@
 #include <linux/init.h>
 #include <mach/hardware.h>
 #include <mach/common.h>
+#include <mach/devices-common.h>
 #include <asm/pgtable.h>
 #include <asm/mach/map.h>
-#include <mach/gpio.h>
 #include <mach/irqs.h>
 #include <mach/iomux-v1.h>
 
@@ -70,17 +70,19 @@ void __init imx21_init_early(void)
                        MX21_NUM_GPIO_PORT);
 }
 
-static struct mxc_gpio_port imx21_gpio_ports[] = {
-       DEFINE_IMX_GPIO_PORT_IRQ(MX21, 0, 1, MX21_INT_GPIO),
-       DEFINE_IMX_GPIO_PORT(MX21, 1, 2),
-       DEFINE_IMX_GPIO_PORT(MX21, 2, 3),
-       DEFINE_IMX_GPIO_PORT(MX21, 3, 4),
-       DEFINE_IMX_GPIO_PORT(MX21, 4, 5),
-       DEFINE_IMX_GPIO_PORT(MX21, 5, 6),
-};
-
 void __init mx21_init_irq(void)
 {
        mxc_init_irq(MX21_IO_ADDRESS(MX21_AVIC_BASE_ADDR));
-       mxc_gpio_init(imx21_gpio_ports, ARRAY_SIZE(imx21_gpio_ports));
+}
+
+void __init imx21_soc_init(void)
+{
+       mxc_register_gpio(0, MX21_GPIO1_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0);
+       mxc_register_gpio(1, MX21_GPIO2_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0);
+       mxc_register_gpio(2, MX21_GPIO3_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0);
+       mxc_register_gpio(3, MX21_GPIO4_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0);
+       mxc_register_gpio(4, MX21_GPIO5_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0);
+       mxc_register_gpio(5, MX21_GPIO6_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0);
+
+       imx_add_imx_dma();
 }
index 02f7b5c7fa8e840d526302fade50adb11c026bdb..1e0c95651c2315a5c7a113e27f5b71572cd80c6b 100644 (file)
 #include <asm/mach/map.h>
 
 #include <mach/common.h>
+#include <mach/devices-common.h>
 #include <mach/hardware.h>
 #include <mach/mx25.h>
 #include <mach/iomux-v3.h>
-#include <mach/gpio.h>
 #include <mach/irqs.h>
 
 /*
@@ -57,16 +57,39 @@ void __init imx25_init_early(void)
        mxc_arch_reset_init(MX25_IO_ADDRESS(MX25_WDOG_BASE_ADDR));
 }
 
-static struct mxc_gpio_port imx25_gpio_ports[] = {
-       DEFINE_IMX_GPIO_PORT_IRQ(MX25, 0, 1, MX25_INT_GPIO1),
-       DEFINE_IMX_GPIO_PORT_IRQ(MX25, 1, 2, MX25_INT_GPIO2),
-       DEFINE_IMX_GPIO_PORT_IRQ(MX25, 2, 3, MX25_INT_GPIO3),
-       DEFINE_IMX_GPIO_PORT_IRQ(MX25, 3, 4, MX25_INT_GPIO4),
-};
-
 void __init mx25_init_irq(void)
 {
        mxc_init_irq(MX25_IO_ADDRESS(MX25_AVIC_BASE_ADDR));
-       mxc_gpio_init(imx25_gpio_ports, ARRAY_SIZE(imx25_gpio_ports));
 }
 
+static struct sdma_script_start_addrs imx25_sdma_script __initdata = {
+       .ap_2_ap_addr = 729,
+       .uart_2_mcu_addr = 904,
+       .per_2_app_addr = 1255,
+       .mcu_2_app_addr = 834,
+       .uartsh_2_mcu_addr = 1120,
+       .per_2_shp_addr = 1329,
+       .mcu_2_shp_addr = 1048,
+       .ata_2_mcu_addr = 1560,
+       .mcu_2_ata_addr = 1479,
+       .app_2_per_addr = 1189,
+       .app_2_mcu_addr = 770,
+       .shp_2_per_addr = 1407,
+       .shp_2_mcu_addr = 979,
+};
+
+static struct sdma_platform_data imx25_sdma_pdata __initdata = {
+       .sdma_version = 2,
+       .fw_name = "sdma-imx25.bin",
+       .script_addrs = &imx25_sdma_script,
+};
+
+void __init imx25_soc_init(void)
+{
+       mxc_register_gpio(0, MX25_GPIO1_BASE_ADDR, SZ_16K, MX25_INT_GPIO1, 0);
+       mxc_register_gpio(1, MX25_GPIO2_BASE_ADDR, SZ_16K, MX25_INT_GPIO2, 0);
+       mxc_register_gpio(2, MX25_GPIO3_BASE_ADDR, SZ_16K, MX25_INT_GPIO3, 0);
+       mxc_register_gpio(3, MX25_GPIO4_BASE_ADDR, SZ_16K, MX25_INT_GPIO4, 0);
+
+       imx_add_imx_sdma(MX25_SDMA_BASE_ADDR, MX25_INT_SDMA, &imx25_sdma_pdata);
+}
index a6761a39f08ccb54bb6f7fce93cf191c41a44681..944e02d3ccc23776c1bf7d00ceef712fe9d06374 100644 (file)
@@ -22,9 +22,9 @@
 #include <linux/init.h>
 #include <mach/hardware.h>
 #include <mach/common.h>
+#include <mach/devices-common.h>
 #include <asm/pgtable.h>
 #include <asm/mach/map.h>
-#include <mach/gpio.h>
 #include <mach/irqs.h>
 #include <mach/iomux-v1.h>
 
@@ -70,17 +70,19 @@ void __init imx27_init_early(void)
                        MX27_NUM_GPIO_PORT);
 }
 
-static struct mxc_gpio_port imx27_gpio_ports[] = {
-       DEFINE_IMX_GPIO_PORT_IRQ(MX27, 0, 1, MX27_INT_GPIO),
-       DEFINE_IMX_GPIO_PORT(MX27, 1, 2),
-       DEFINE_IMX_GPIO_PORT(MX27, 2, 3),
-       DEFINE_IMX_GPIO_PORT(MX27, 3, 4),
-       DEFINE_IMX_GPIO_PORT(MX27, 4, 5),
-       DEFINE_IMX_GPIO_PORT(MX27, 5, 6),
-};
-
 void __init mx27_init_irq(void)
 {
        mxc_init_irq(MX27_IO_ADDRESS(MX27_AVIC_BASE_ADDR));
-       mxc_gpio_init(imx27_gpio_ports, ARRAY_SIZE(imx27_gpio_ports));
+}
+
+void __init imx27_soc_init(void)
+{
+       mxc_register_gpio(0, MX27_GPIO1_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0);
+       mxc_register_gpio(1, MX27_GPIO2_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0);
+       mxc_register_gpio(2, MX27_GPIO3_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0);
+       mxc_register_gpio(3, MX27_GPIO4_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0);
+       mxc_register_gpio(4, MX27_GPIO5_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0);
+       mxc_register_gpio(5, MX27_GPIO6_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0);
+
+       imx_add_imx_dma();
 }
index 86b9b45864d2f482b55c58c09362967564eb2785..a1ff96f249d1b90f2689909a47d06d0cc259c402 100644 (file)
@@ -24,9 +24,9 @@
 #include <asm/mach/map.h>
 
 #include <mach/common.h>
+#include <mach/devices-common.h>
 #include <mach/hardware.h>
 #include <mach/iomux-v3.h>
-#include <mach/gpio.h>
 #include <mach/irqs.h>
 
 static struct map_desc mx31_io_desc[] __initdata = {
@@ -53,14 +53,40 @@ void __init imx31_init_early(void)
        mxc_arch_reset_init(MX31_IO_ADDRESS(MX31_WDOG_BASE_ADDR));
 }
 
-static struct mxc_gpio_port imx31_gpio_ports[] = {
-       DEFINE_IMX_GPIO_PORT_IRQ(MX31, 0, 1, MX31_INT_GPIO1),
-       DEFINE_IMX_GPIO_PORT_IRQ(MX31, 1, 2, MX31_INT_GPIO2),
-       DEFINE_IMX_GPIO_PORT_IRQ(MX31, 2, 3, MX31_INT_GPIO3),
-};
-
 void __init mx31_init_irq(void)
 {
        mxc_init_irq(MX31_IO_ADDRESS(MX31_AVIC_BASE_ADDR));
-       mxc_gpio_init(imx31_gpio_ports, ARRAY_SIZE(imx31_gpio_ports));
+}
+
+static struct sdma_script_start_addrs imx31_to1_sdma_script __initdata = {
+       .per_2_per_addr = 1677,
+};
+
+static struct sdma_script_start_addrs imx31_to2_sdma_script __initdata = {
+       .ap_2_ap_addr = 423,
+       .ap_2_bp_addr = 829,
+       .bp_2_ap_addr = 1029,
+};
+
+static struct sdma_platform_data imx31_sdma_pdata __initdata = {
+       .sdma_version = 1,
+       .fw_name = "sdma-imx31-to2.bin",
+       .script_addrs = &imx31_to2_sdma_script,
+};
+
+void __init imx31_soc_init(void)
+{
+       int to_version = mx31_revision() >> 4;
+
+       mxc_register_gpio(0, MX31_GPIO1_BASE_ADDR, SZ_16K, MX31_INT_GPIO1, 0);
+       mxc_register_gpio(1, MX31_GPIO2_BASE_ADDR, SZ_16K, MX31_INT_GPIO2, 0);
+       mxc_register_gpio(2, MX31_GPIO3_BASE_ADDR, SZ_16K, MX31_INT_GPIO3, 0);
+
+       if (to_version == 1) {
+               strncpy(imx31_sdma_pdata.fw_name, "sdma-imx31-to1.bin",
+                       strlen(imx31_sdma_pdata.fw_name));
+               imx31_sdma_pdata.script_addrs = &imx31_to1_sdma_script;
+       }
+
+       imx_add_imx_sdma(MX31_SDMA_BASE_ADDR, MX31_INT_SDMA, &imx31_sdma_pdata);
 }
index c880e6d1ae550312d1136a8f37890144ea442bc3..da530ca48aeadd6c757af71973b22f4e037cad0a 100644 (file)
@@ -25,9 +25,9 @@
 #include <asm/hardware/cache-l2x0.h>
 
 #include <mach/common.h>
+#include <mach/devices-common.h>
 #include <mach/hardware.h>
 #include <mach/iomux-v3.h>
-#include <mach/gpio.h>
 #include <mach/irqs.h>
 
 static struct map_desc mx35_io_desc[] __initdata = {
@@ -50,14 +50,60 @@ void __init imx35_init_early(void)
        mxc_arch_reset_init(MX35_IO_ADDRESS(MX35_WDOG_BASE_ADDR));
 }
 
-static struct mxc_gpio_port imx35_gpio_ports[] = {
-       DEFINE_IMX_GPIO_PORT_IRQ(MX35, 0, 1, MX35_INT_GPIO1),
-       DEFINE_IMX_GPIO_PORT_IRQ(MX35, 1, 2, MX35_INT_GPIO2),
-       DEFINE_IMX_GPIO_PORT_IRQ(MX35, 2, 3, MX35_INT_GPIO3),
-};
-
 void __init mx35_init_irq(void)
 {
        mxc_init_irq(MX35_IO_ADDRESS(MX35_AVIC_BASE_ADDR));
-       mxc_gpio_init(imx35_gpio_ports, ARRAY_SIZE(imx35_gpio_ports));
+}
+
+static struct sdma_script_start_addrs imx35_to1_sdma_script __initdata = {
+       .ap_2_ap_addr = 642,
+       .uart_2_mcu_addr = 817,
+       .mcu_2_app_addr = 747,
+       .uartsh_2_mcu_addr = 1183,
+       .per_2_shp_addr = 1033,
+       .mcu_2_shp_addr = 961,
+       .ata_2_mcu_addr = 1333,
+       .mcu_2_ata_addr = 1252,
+       .app_2_mcu_addr = 683,
+       .shp_2_per_addr = 1111,
+       .shp_2_mcu_addr = 892,
+};
+
+static struct sdma_script_start_addrs imx35_to2_sdma_script __initdata = {
+       .ap_2_ap_addr = 729,
+       .uart_2_mcu_addr = 904,
+       .per_2_app_addr = 1597,
+       .mcu_2_app_addr = 834,
+       .uartsh_2_mcu_addr = 1270,
+       .per_2_shp_addr = 1120,
+       .mcu_2_shp_addr = 1048,
+       .ata_2_mcu_addr = 1429,
+       .mcu_2_ata_addr = 1339,
+       .app_2_per_addr = 1531,
+       .app_2_mcu_addr = 770,
+       .shp_2_per_addr = 1198,
+       .shp_2_mcu_addr = 979,
+};
+
+static struct sdma_platform_data imx35_sdma_pdata __initdata = {
+       .sdma_version = 2,
+       .fw_name = "sdma-imx35-to2.bin",
+       .script_addrs = &imx35_to2_sdma_script,
+};
+
+void __init imx35_soc_init(void)
+{
+       int to_version = mx35_revision() >> 4;
+
+       mxc_register_gpio(0, MX35_GPIO1_BASE_ADDR, SZ_16K, MX35_INT_GPIO1, 0);
+       mxc_register_gpio(1, MX35_GPIO2_BASE_ADDR, SZ_16K, MX35_INT_GPIO2, 0);
+       mxc_register_gpio(2, MX35_GPIO3_BASE_ADDR, SZ_16K, MX35_INT_GPIO3, 0);
+
+       if (to_version == 1) {
+               strncpy(imx35_sdma_pdata.fw_name, "sdma-imx35-to1.bin",
+                       strlen(imx35_sdma_pdata.fw_name));
+               imx35_sdma_pdata.script_addrs = &imx35_to1_sdma_script;
+       }
+
+       imx_add_imx_sdma(MX35_SDMA_BASE_ADDR, MX35_INT_SDMA, &imx35_sdma_pdata);
 }
index 5aa053edc17cc1b5799676a50ab1a630e0629aaa..bf0fb87946ba40fbd1a0ee5222572034177ccc68 100644 (file)
@@ -161,7 +161,7 @@ static const struct spi_imx_master spi0_pdata __initconst = {
 
 /* GPIO LEDs */
 
-static struct gpio_led litekit_leds[] = {
+static const struct gpio_led litekit_leds[] __initconst = {
        {
                .name           = "GPIO0",
                .gpio           = IOMUX_TO_GPIO(MX31_PIN_COMPARE),
@@ -176,19 +176,12 @@ static struct gpio_led litekit_leds[] = {
        }
 };
 
-static struct gpio_led_platform_data litekit_led_platform_data = {
+static const struct gpio_led_platform_data
+               litekit_led_platform_data __initconst = {
        .leds           = litekit_leds,
        .num_leds       = ARRAY_SIZE(litekit_leds),
 };
 
-static struct platform_device litekit_led_device = {
-       .name   = "leds-gpio",
-       .id     = -1,
-       .dev    = {
-               .platform_data = &litekit_led_platform_data,
-       },
-};
-
 void __init mx31lite_db_init(void)
 {
        mxc_iomux_setup_multiple_pins(litekit_db_board_pins,
@@ -197,7 +190,7 @@ void __init mx31lite_db_init(void)
        imx31_add_imx_uart0(&uart_pdata);
        imx31_add_mxc_mmc(0, &mmc_pdata);
        imx31_add_spi_imx0(&spi0_pdata);
-       platform_device_register(&litekit_led_device);
+       gpio_led_register_device(-1, &litekit_led_platform_data);
        imx31_add_imx2_wdt(NULL);
        imx31_add_mxc_rtc(NULL);
 }
index da0e6498110a4f6400274b74015e964ab81566f5..1e027514096d0d9e15f87152a0e92761f1e959e8 100644 (file)
@@ -1077,7 +1077,7 @@ static struct clk_lookup lookups[] = {
        _REGISTER_CLOCK("lpc32xx-nand.0", "nand_ck", clk_nand)
        _REGISTER_CLOCK("tbd", "i2s0_ck", clk_i2s0)
        _REGISTER_CLOCK("tbd", "i2s1_ck", clk_i2s1)
-       _REGISTER_CLOCK("lpc32xx-ts", NULL, clk_tsc)
+       _REGISTER_CLOCK("ts-lpc32xx", NULL, clk_tsc)
        _REGISTER_CLOCK("dev:mmc0", "MCLK", clk_mmc)
        _REGISTER_CLOCK("lpc-net.0", NULL, clk_net)
        _REGISTER_CLOCK("dev:clcd", NULL, clk_lcd)
index ee24dc28e93ec7d4741825487ab8ddf37ba197cf..205b2dbb565bb91c00593b848c1aec2adfda74cf 100644 (file)
@@ -95,6 +95,48 @@ struct platform_device lpc32xx_i2c2_device = {
        },
 };
 
+/* TSC (Touch Screen Controller) */
+
+static struct resource lpc32xx_tsc_resources[] = {
+       {
+               .start = LPC32XX_ADC_BASE,
+               .end = LPC32XX_ADC_BASE + SZ_4K - 1,
+               .flags = IORESOURCE_MEM,
+       }, {
+               .start = IRQ_LPC32XX_TS_IRQ,
+               .end = IRQ_LPC32XX_TS_IRQ,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+struct platform_device lpc32xx_tsc_device = {
+       .name =  "ts-lpc32xx",
+       .id = -1,
+       .num_resources = ARRAY_SIZE(lpc32xx_tsc_resources),
+       .resource = lpc32xx_tsc_resources,
+};
+
+/* RTC */
+
+static struct resource lpc32xx_rtc_resources[] = {
+       {
+               .start = LPC32XX_RTC_BASE,
+               .end = LPC32XX_RTC_BASE + SZ_4K - 1,
+               .flags = IORESOURCE_MEM,
+       },{
+               .start = IRQ_LPC32XX_RTC,
+               .end = IRQ_LPC32XX_RTC,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+struct platform_device lpc32xx_rtc_device = {
+       .name =  "rtc-lpc32xx",
+       .id = -1,
+       .num_resources = ARRAY_SIZE(lpc32xx_rtc_resources),
+       .resource = lpc32xx_rtc_resources,
+};
+
 /*
  * Returns the unique ID for the device
  */
index f82211fd80c1fab17d37c74d9ce1cc01353082ee..5583f52662bda8164dec061b60d57476b9c761e4 100644 (file)
@@ -28,6 +28,8 @@ extern struct platform_device lpc32xx_watchdog_device;
 extern struct platform_device lpc32xx_i2c0_device;
 extern struct platform_device lpc32xx_i2c1_device;
 extern struct platform_device lpc32xx_i2c2_device;
+extern struct platform_device lpc32xx_tsc_device;
+extern struct platform_device lpc32xx_rtc_device;
 
 /*
  * Other arch specific structures and functions
index 67793a6902727eeb67fb53b5d688e2a738efc185..56ef5f6c811636a5d0a2b40cd82c0ab0aabc53a5 100644 (file)
@@ -77,6 +77,13 @@ config MACH_TETON_BGA
          Say 'Y' here if you want to support the Marvell PXA168-based
          Teton BGA Development Board.
 
+config MACH_SHEEVAD
+       bool "Marvell's PXA168 GuruPlug Display (gplugD) Board"
+       select CPU_PXA168
+       help
+         Say 'Y' here if you want to support the Marvell PXA168-based
+         GuruPlug Display (gplugD) Board
+
 endmenu
 
 config CPU_PXA168
index 5c68382141af09d902ae911694a08117861bc0cd..b0ac942327aa72bf5ffa36acc9e9434cd0884fb1 100644 (file)
@@ -19,3 +19,4 @@ obj-$(CONFIG_MACH_BROWNSTONE) += brownstone.o
 obj-$(CONFIG_MACH_FLINT)       += flint.o
 obj-$(CONFIG_MACH_MARVELL_JASPER) += jasper.o
 obj-$(CONFIG_MACH_TETON_BGA)   += teton_bga.o
+obj-$(CONFIG_MACH_SHEEVAD)     += gplugd.o
index 886e05648f08a5a4975bc0257b2b0929e9fffc1f..7c6f95f291425c5fd3fc3d5c8969d4e9f739201f 100644 (file)
@@ -88,3 +88,18 @@ unsigned long clk_get_rate(struct clk *clk)
        return rate;
 }
 EXPORT_SYMBOL(clk_get_rate);
+
+int clk_set_rate(struct clk *clk, unsigned long rate)
+{
+       unsigned long flags;
+       int ret = -EINVAL;
+
+       if (clk->ops->setrate) {
+               spin_lock_irqsave(&clocks_lock, flags);
+               ret = clk->ops->setrate(clk, rate);
+               spin_unlock_irqrestore(&clocks_lock, flags);
+       }
+
+       return ret;
+}
+EXPORT_SYMBOL(clk_set_rate);
index 9b027d7491f5e9ba854e496568eaa2fafdc9be5e..3143e994e672326acb26a7648a4cac7376e1f078 100644 (file)
@@ -12,6 +12,7 @@ struct clkops {
        void                    (*enable)(struct clk *);
        void                    (*disable)(struct clk *);
        unsigned long           (*getrate)(struct clk *);
+       int                     (*setrate)(struct clk *, unsigned long);
 };
 
 struct clk {
diff --git a/arch/arm/mach-mmp/gplugd.c b/arch/arm/mach-mmp/gplugd.c
new file mode 100644 (file)
index 0000000..c070c24
--- /dev/null
@@ -0,0 +1,189 @@
+/*
+ *  linux/arch/arm/mach-mmp/gplugd.c
+ *
+ *  Support for the Marvell PXA168-based GuruPlug Display (gplugD) Platform.
+ *
+ *  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
+ *  publishhed by the Free Software Foundation.
+ */
+
+#include <linux/init.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach-types.h>
+
+#include <mach/gpio.h>
+#include <mach/pxa168.h>
+#include <mach/mfp-pxa168.h>
+#include <mach/mfp-gplugd.h>
+
+#include "common.h"
+
+static unsigned long gplugd_pin_config[] __initdata = {
+       /* UART3 */
+       GPIO8_UART3_SOUT,
+       GPIO9_UART3_SIN,
+       GPI1O_UART3_CTS,
+       GPI11_UART3_RTS,
+
+       /* MMC2 */
+       GPIO28_MMC2_CMD,
+       GPIO29_MMC2_CLK,
+       GPIO30_MMC2_DAT0,
+       GPIO31_MMC2_DAT1,
+       GPIO32_MMC2_DAT2,
+       GPIO33_MMC2_DAT3,
+
+       /* LCD & HDMI clock selection GPIO: 0: 74.176MHz, 1: 74.25 MHz */
+       GPIO35_GPIO,
+       GPIO36_GPIO, /* CEC Interrupt */
+
+       /* MMC1 */
+       GPIO43_MMC1_CLK,
+       GPIO49_MMC1_CMD,
+       GPIO41_MMC1_DAT0,
+       GPIO40_MMC1_DAT1,
+       GPIO52_MMC1_DAT2,
+       GPIO51_MMC1_DAT3,
+       GPIO53_MMC1_CD,
+
+       /* LCD */
+       GPIO56_LCD_FCLK_RD,
+       GPIO57_LCD_LCLK_A0,
+       GPIO58_LCD_PCLK_WR,
+       GPIO59_LCD_DENA_BIAS,
+       GPIO60_LCD_DD0,
+       GPIO61_LCD_DD1,
+       GPIO62_LCD_DD2,
+       GPIO63_LCD_DD3,
+       GPIO64_LCD_DD4,
+       GPIO65_LCD_DD5,
+       GPIO66_LCD_DD6,
+       GPIO67_LCD_DD7,
+       GPIO68_LCD_DD8,
+       GPIO69_LCD_DD9,
+       GPIO70_LCD_DD10,
+       GPIO71_LCD_DD11,
+       GPIO72_LCD_DD12,
+       GPIO73_LCD_DD13,
+       GPIO74_LCD_DD14,
+       GPIO75_LCD_DD15,
+       GPIO76_LCD_DD16,
+       GPIO77_LCD_DD17,
+       GPIO78_LCD_DD18,
+       GPIO79_LCD_DD19,
+       GPIO80_LCD_DD20,
+       GPIO81_LCD_DD21,
+       GPIO82_LCD_DD22,
+       GPIO83_LCD_DD23,
+
+       /* GPIO */
+       GPIO84_GPIO,
+       GPIO85_GPIO,
+
+       /* Fast-Ethernet*/
+       GPIO86_TX_CLK,
+       GPIO87_TX_EN,
+       GPIO88_TX_DQ3,
+       GPIO89_TX_DQ2,
+       GPIO90_TX_DQ1,
+       GPIO91_TX_DQ0,
+       GPIO92_MII_CRS,
+       GPIO93_MII_COL,
+       GPIO94_RX_CLK,
+       GPIO95_RX_ER,
+       GPIO96_RX_DQ3,
+       GPIO97_RX_DQ2,
+       GPIO98_RX_DQ1,
+       GPIO99_RX_DQ0,
+       GPIO100_MII_MDC,
+       GPIO101_MII_MDIO,
+       GPIO103_RX_DV,
+       GPIO104_GPIO,     /* Reset PHY */
+
+       /* RTC interrupt */
+       GPIO102_GPIO,
+
+       /* I2C */
+       GPIO105_CI2C_SDA,
+       GPIO106_CI2C_SCL,
+
+       /* Select JTAG */
+       GPIO109_GPIO,
+
+       /* I2S */
+       GPIO114_I2S_FRM,
+       GPIO115_I2S_BCLK,
+       GPIO116_I2S_TXD
+};
+
+static struct i2c_board_info gplugd_i2c_board_info[] = {
+       {
+               .type = "isl1208",
+               .addr = 0x6F,
+       }
+};
+
+/* Bring PHY out of reset by setting GPIO 104 */
+static int gplugd_eth_init(void)
+{
+       if (unlikely(gpio_request(104, "ETH_RESET_N"))) {
+               printk(KERN_ERR "Can't get hold of GPIO 104 to bring Ethernet "
+                               "PHY out of reset\n");
+               return -EIO;
+       }
+
+       gpio_direction_output(104, 1);
+       gpio_free(104);
+       return 0;
+}
+
+struct pxa168_eth_platform_data gplugd_eth_platform_data = {
+       .port_number = 0,
+       .phy_addr    = 0,
+       .speed       = 0, /* Autonagotiation */
+       .init        = gplugd_eth_init,
+};
+
+static void __init select_disp_freq(void)
+{
+       /* set GPIO 35 & clear GPIO 85 to set LCD External Clock to 74.25 MHz */
+       if (unlikely(gpio_request(35, "DISP_FREQ_SEL"))) {
+               printk(KERN_ERR "Can't get hold of GPIO 35 to select display "
+                               "frequency\n");
+       } else {
+               gpio_direction_output(35, 1);
+               gpio_free(104);
+       }
+
+       if (unlikely(gpio_request(85, "DISP_FREQ_SEL_2"))) {
+               printk(KERN_ERR "Can't get hold of GPIO 85 to select display "
+                               "frequency\n");
+       } else {
+               gpio_direction_output(85, 0);
+               gpio_free(104);
+       }
+}
+
+static void __init gplugd_init(void)
+{
+       mfp_config(ARRAY_AND_SIZE(gplugd_pin_config));
+
+       select_disp_freq();
+
+       /* on-chip devices */
+       pxa168_add_uart(3);
+       pxa168_add_ssp(0);
+       pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(gplugd_i2c_board_info));
+
+       pxa168_add_eth(&gplugd_eth_platform_data);
+}
+
+MACHINE_START(SHEEVAD, "PXA168-based GuruPlug Display (gplugD) Platform")
+       .map_io         = mmp_map_io,
+       .nr_irqs        = IRQ_BOARD_START,
+       .init_irq       = pxa168_init_irq,
+       .timer          = &pxa168_timer,
+       .init_machine   = gplugd_init,
+MACHINE_END
diff --git a/arch/arm/mach-mmp/include/mach/mfp-gplugd.h b/arch/arm/mach-mmp/include/mach/mfp-gplugd.h
new file mode 100644 (file)
index 0000000..b8cf38d
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * linux/arch/arm/mach-mmp/include/mach/mfp-gplugd.h
+ *
+ *   MFP definitions used in gplugD
+ *
+ * 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.
+ */
+
+#ifndef __MACH_MFP_GPLUGD_H
+#define __MACH_MFP_GPLUGD_H
+
+#include <plat/mfp.h>
+#include <mach/mfp.h>
+
+/* UART3 */
+#define GPIO8_UART3_SOUT       MFP_CFG(GPIO8, AF2)
+#define GPIO9_UART3_SIN        MFP_CFG(GPIO9, AF2)
+#define GPI1O_UART3_CTS        MFP_CFG(GPIO10, AF2)
+#define GPI11_UART3_RTS        MFP_CFG(GPIO11, AF2)
+
+/* MMC2 */
+#define        GPIO28_MMC2_CMD         MFP_CFG_DRV(GPIO28, AF6, FAST)
+#define        GPIO29_MMC2_CLK         MFP_CFG_DRV(GPIO29, AF6, FAST)
+#define        GPIO30_MMC2_DAT0        MFP_CFG_DRV(GPIO30, AF6, FAST)
+#define        GPIO31_MMC2_DAT1        MFP_CFG_DRV(GPIO31, AF6, FAST)
+#define        GPIO32_MMC2_DAT2        MFP_CFG_DRV(GPIO32, AF6, FAST)
+#define        GPIO33_MMC2_DAT3        MFP_CFG_DRV(GPIO33, AF6, FAST)
+
+/* I2S */
+#undef GPIO114_I2S_FRM
+#undef GPIO115_I2S_BCLK
+
+#define GPIO114_I2S_FRM                MFP_CFG_DRV(GPIO114, AF1, FAST)
+#define GPIO115_I2S_BCLK        MFP_CFG_DRV(GPIO115, AF1, FAST)
+#define GPIO116_I2S_TXD         MFP_CFG_DRV(GPIO116, AF1, FAST)
+
+/* MMC4 */
+#define GPIO125_MMC4_DAT3       MFP_CFG_DRV(GPIO125, AF7, FAST)
+#define GPIO126_MMC4_DAT2       MFP_CFG_DRV(GPIO126, AF7, FAST)
+#define GPIO127_MMC4_DAT1       MFP_CFG_DRV(GPIO127, AF7, FAST)
+#define GPIO0_2_MMC4_DAT0       MFP_CFG_DRV(GPIO0_2, AF7, FAST)
+#define GPIO1_2_MMC4_CMD        MFP_CFG_DRV(GPIO1_2, AF7, FAST)
+#define GPIO2_2_MMC4_CLK        MFP_CFG_DRV(GPIO2_2, AF7, FAST)
+
+/* OTG GPIO */
+#define GPIO_USB_OTG_PEN        18
+#define GPIO_USB_OIDIR          20
+
+/* Other GPIOs are 35, 84, 85 */
+#endif /* __MACH_MFP_GPLUGD_H */
index 713be155a44d716df91aeb74c2d043630f543564..8c782328b21cf4e6a92460b436a5241a5e573fae 100644 (file)
 #define GPIO112_KP_MKOUT6       MFP_CFG(GPIO112, AF7)
 #define GPIO121_KP_MKIN4        MFP_CFG(GPIO121, AF7)
 
+/* Fast Ethernet */
+#define GPIO86_TX_CLK          MFP_CFG(GPIO86, AF5)
+#define GPIO87_TX_EN           MFP_CFG(GPIO87, AF5)
+#define GPIO88_TX_DQ3          MFP_CFG(GPIO88, AF5)
+#define GPIO89_TX_DQ2          MFP_CFG(GPIO89, AF5)
+#define GPIO90_TX_DQ1          MFP_CFG(GPIO90, AF5)
+#define GPIO91_TX_DQ0          MFP_CFG(GPIO91, AF5)
+#define GPIO92_MII_CRS         MFP_CFG(GPIO92, AF5)
+#define GPIO93_MII_COL         MFP_CFG(GPIO93, AF5)
+#define GPIO94_RX_CLK          MFP_CFG(GPIO94, AF5)
+#define GPIO95_RX_ER           MFP_CFG(GPIO95, AF5)
+#define GPIO96_RX_DQ3          MFP_CFG(GPIO96, AF5)
+#define GPIO97_RX_DQ2          MFP_CFG(GPIO97, AF5)
+#define GPIO98_RX_DQ1          MFP_CFG(GPIO98, AF5)
+#define GPIO99_RX_DQ0          MFP_CFG(GPIO99, AF5)
+#define GPIO100_MII_MDC                MFP_CFG(GPIO100, AF5)
+#define GPIO101_MII_MDIO       MFP_CFG(GPIO101, AF5)
+#define GPIO103_RX_DV          MFP_CFG(GPIO103, AF5)
+
 #endif /* __ASM_MACH_MFP_PXA168_H */
index a52b3d2f325ce7a3e6654b3fde2d87ad1af4dce4..7f005843a7075d1ae1ec334fa694dd309acf3c92 100644 (file)
@@ -14,9 +14,11 @@ extern void pxa168_clear_keypad_wakeup(void);
 #include <video/pxa168fb.h>
 #include <plat/pxa27x_keypad.h>
 #include <mach/cputype.h>
+#include <linux/pxa168_eth.h>
 
 extern struct pxa_device_desc pxa168_device_uart1;
 extern struct pxa_device_desc pxa168_device_uart2;
+extern struct pxa_device_desc pxa168_device_uart3;
 extern struct pxa_device_desc pxa168_device_twsi0;
 extern struct pxa_device_desc pxa168_device_twsi1;
 extern struct pxa_device_desc pxa168_device_pwm1;
@@ -31,6 +33,7 @@ extern struct pxa_device_desc pxa168_device_ssp5;
 extern struct pxa_device_desc pxa168_device_nand;
 extern struct pxa_device_desc pxa168_device_fb;
 extern struct pxa_device_desc pxa168_device_keypad;
+extern struct pxa_device_desc pxa168_device_eth;
 
 static inline int pxa168_add_uart(int id)
 {
@@ -39,6 +42,7 @@ static inline int pxa168_add_uart(int id)
        switch (id) {
        case 1: d = &pxa168_device_uart1; break;
        case 2: d = &pxa168_device_uart2; break;
+       case 3: d = &pxa168_device_uart3; break;
        }
 
        if (d == NULL)
@@ -117,4 +121,8 @@ static inline int pxa168_add_keypad(struct pxa27x_keypad_platform_data *data)
        return pxa_register_device(&pxa168_device_keypad, data, sizeof(*data));
 }
 
+static inline int pxa168_add_eth(struct pxa168_eth_platform_data *data)
+{
+       return pxa_register_device(&pxa168_device_eth, data, sizeof(*data));
+}
 #endif /* __ASM_MACH_PXA168_H */
index f7011ef70bf5e2565bd0fc508ffd66fa681cff7b..8447ac63e28f343ce6a883ebb407d08b22cc6371 100644 (file)
@@ -29,6 +29,7 @@
 #define APMU_BUS       APMU_REG(0x06c)
 #define APMU_SDH2      APMU_REG(0x0e8)
 #define APMU_SDH3      APMU_REG(0x0ec)
+#define APMU_ETH       APMU_REG(0x0fc)
 
 #define APMU_FNCLK_EN  (1 << 4)
 #define APMU_AXICLK_EN (1 << 3)
index 72b4e76315830e91b9dad19dfdedcdf829021559..96d451dc305c5daf7ba8e6288507a9bee39885b7 100644 (file)
@@ -66,6 +66,7 @@ void __init pxa168_init_irq(void)
 /* APB peripheral clocks */
 static APBC_CLK(uart1, PXA168_UART1, 1, 14745600);
 static APBC_CLK(uart2, PXA168_UART2, 1, 14745600);
+static APBC_CLK(uart3, PXA168_UART3, 1, 14745600);
 static APBC_CLK(twsi0, PXA168_TWSI0, 1, 33000000);
 static APBC_CLK(twsi1, PXA168_TWSI1, 1, 33000000);
 static APBC_CLK(pwm1, PXA168_PWM1, 1, 13000000);
@@ -81,11 +82,13 @@ static APBC_CLK(keypad, PXA168_KPC, 0, 32000);
 
 static APMU_CLK(nand, NAND, 0x01db, 208000000);
 static APMU_CLK(lcd, LCD, 0x7f, 312000000);
+static APMU_CLK(eth, ETH, 0x09, 0);
 
 /* device and clock bindings */
 static struct clk_lookup pxa168_clkregs[] = {
        INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL),
        INIT_CLKREG(&clk_uart2, "pxa2xx-uart.1", NULL),
+       INIT_CLKREG(&clk_uart3, "pxa2xx-uart.2", NULL),
        INIT_CLKREG(&clk_twsi0, "pxa2xx-i2c.0", NULL),
        INIT_CLKREG(&clk_twsi1, "pxa2xx-i2c.1", NULL),
        INIT_CLKREG(&clk_pwm1, "pxa168-pwm.0", NULL),
@@ -100,6 +103,7 @@ static struct clk_lookup pxa168_clkregs[] = {
        INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL),
        INIT_CLKREG(&clk_lcd, "pxa168-fb", NULL),
        INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL),
+       INIT_CLKREG(&clk_eth, "pxa168-eth", "MFUCLK"),
 };
 
 static int __init pxa168_init(void)
@@ -149,6 +153,7 @@ void pxa168_clear_keypad_wakeup(void)
 /* on-chip devices */
 PXA168_DEVICE(uart1, "pxa2xx-uart", 0, UART1, 0xd4017000, 0x30, 21, 22);
 PXA168_DEVICE(uart2, "pxa2xx-uart", 1, UART2, 0xd4018000, 0x30, 23, 24);
+PXA168_DEVICE(uart3, "pxa2xx-uart", 2, UART3, 0xd4026000, 0x30, 23, 24);
 PXA168_DEVICE(twsi0, "pxa2xx-i2c", 0, TWSI0, 0xd4011000, 0x28);
 PXA168_DEVICE(twsi1, "pxa2xx-i2c", 1, TWSI1, 0xd4025000, 0x28);
 PXA168_DEVICE(pwm1, "pxa168-pwm", 0, NONE, 0xd401a000, 0x10);
@@ -163,3 +168,4 @@ PXA168_DEVICE(ssp4, "pxa168-ssp", 3, SSP4, 0xd4020000, 0x40, 58, 59);
 PXA168_DEVICE(ssp5, "pxa168-ssp", 4, SSP5, 0xd4021000, 0x40, 60, 61);
 PXA168_DEVICE(fb, "pxa168-fb", -1, LCD, 0xd420b000, 0x1c8);
 PXA168_DEVICE(keypad, "pxa27x-keypad", -1, KEYPAD, 0xd4012000, 0x4c);
+PXA168_DEVICE(eth, "pxa168-eth", -1, MFU, 0xc0800000, 0x0fff);
index e411039ea59e3f2911513ca4353c8b9ce87312ac..6bd37a27e5fca67ccfd876582fed715441f409a4 100644 (file)
@@ -15,6 +15,8 @@
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/onenand.h>
 #include <linux/interrupt.h>
+#include <linux/i2c/pca953x.h>
+#include <linux/gpio.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
 #include "common.h"
 
-#define TTCDKB_NR_IRQS         (IRQ_BOARD_START + 24)
+#define TTCDKB_GPIO_EXT0(x)    (NR_BUILTIN_GPIO + ((x < 0) ? 0 :       \
+                               ((x < 16) ? x : 15)))
+#define TTCDKB_GPIO_EXT1(x)    (NR_BUILTIN_GPIO + 16 + ((x < 0) ? 0 :  \
+                               ((x < 16) ? x : 15)))
+
+/*
+ * 16 board interrupts -- MAX7312 GPIO expander
+ * 16 board interrupts -- PCA9575 GPIO expander
+ * 24 board interrupts -- 88PM860x PMIC
+ */
+#define TTCDKB_NR_IRQS         (IRQ_BOARD_START + 16 + 16 + 24)
 
 static unsigned long ttc_dkb_pin_config[] __initdata = {
        /* UART2 */
@@ -113,6 +125,22 @@ static struct platform_device *ttc_dkb_devices[] = {
        &ttc_dkb_device_onenand,
 };
 
+static struct pca953x_platform_data max7312_data[] = {
+       {
+               .gpio_base      = TTCDKB_GPIO_EXT0(0),
+               .irq_base       = IRQ_BOARD_START,
+       },
+};
+
+static struct i2c_board_info ttc_dkb_i2c_info[] = {
+       {
+               .type           = "max7312",
+               .addr           = 0x23,
+               .irq            = IRQ_GPIO(80),
+               .platform_data  = &max7312_data,
+       },
+};
+
 static void __init ttc_dkb_init(void)
 {
        mfp_config(ARRAY_AND_SIZE(ttc_dkb_pin_config));
@@ -121,6 +149,7 @@ static void __init ttc_dkb_init(void)
        pxa910_add_uart(1);
 
        /* off-chip devices */
+       pxa910_add_twsi(0, NULL, ARRAY_AND_SIZE(ttc_dkb_i2c_info));
        platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices));
 }
 
index 799fbc40e53c22437420d9767cb6a18f10f7bb57..b4e7c58bbb3844d76edb890a5a352b033160f760 100644 (file)
@@ -109,6 +109,7 @@ config MACH_EUKREA_MBIMX51_BASEBOARD
        bool
        select IMX_HAVE_PLATFORM_IMX_KEYPAD
        select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
+       select LEDS_GPIO_REGISTER
        help
          This adds board specific devices that can be found on Eukrea's
          MBIMX51 evaluation board.
@@ -135,6 +136,7 @@ config MACH_EUKREA_MBIMXSD51_BASEBOARD
        prompt "Eukrea MBIMXSD development board"
        bool
        select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
+       select LEDS_GPIO_REGISTER
        help
          This adds board specific devices that can be found on Eukrea's
          MBIMXSD evaluation board.
@@ -151,6 +153,7 @@ config MX51_EFIKA_COMMON
 
 config MACH_MX51_EFIKAMX
        bool "Support MX51 Genesi Efika MX nettop"
+       select LEDS_GPIO_REGISTER
        select MX51_EFIKA_COMMON
        help
          Include support for Genesi Efika MX nettop. This includes specific
@@ -158,6 +161,7 @@ config MACH_MX51_EFIKAMX
 
 config MACH_MX51_EFIKASB
        bool "Support MX51 Genesi Efika Smartbook"
+       select LEDS_GPIO_REGISTER
        select MX51_EFIKA_COMMON
        help
          Include support for Genesi Efika Smartbook. This includes specific
@@ -176,6 +180,7 @@ config MACH_MX53_EVK
        select IMX_HAVE_PLATFORM_IMX_I2C
        select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
        select IMX_HAVE_PLATFORM_SPI_IMX
+       select LEDS_GPIO_REGISTER
        help
          Include support for MX53 EVK platform. This includes specific
          configurations for the board and its peripherals.
@@ -199,10 +204,23 @@ config MACH_MX53_LOCO
        select IMX_HAVE_PLATFORM_IMX_UART
        select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
        select IMX_HAVE_PLATFORM_GPIO_KEYS
+       select LEDS_GPIO_REGISTER
        help
          Include support for MX53 LOCO platform. This includes specific
          configurations for the board and its peripherals.
 
+config MACH_MX53_ARD
+       bool "Support MX53 ARD platforms"
+       select SOC_IMX53
+       select IMX_HAVE_PLATFORM_IMX2_WDT
+       select IMX_HAVE_PLATFORM_IMX_I2C
+       select IMX_HAVE_PLATFORM_IMX_UART
+       select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
+       select IMX_HAVE_PLATFORM_GPIO_KEYS
+       help
+         Include support for MX53 ARD platform. This includes specific
+         configurations for the board and its peripherals.
+
 endif # ARCH_MX53_SUPPORTED
 
 endif
index 0b9338cec516bf9061ba65da27851a965509d6ad..383e7cd3fbcb5b711783706ceeea2e605e0777b2 100644 (file)
@@ -6,12 +6,14 @@
 obj-y   := cpu.o mm.o clock-mx51-mx53.o devices.o ehci.o system.o
 obj-$(CONFIG_SOC_IMX50) += mm-mx50.o
 
+obj-$(CONFIG_PM) += pm-imx5.o
 obj-$(CONFIG_CPU_FREQ_IMX)    += cpu_op-mx51.o
 obj-$(CONFIG_MACH_MX51_BABBAGE) += board-mx51_babbage.o
 obj-$(CONFIG_MACH_MX51_3DS) += board-mx51_3ds.o
 obj-$(CONFIG_MACH_MX53_EVK) += board-mx53_evk.o
 obj-$(CONFIG_MACH_MX53_SMD) += board-mx53_smd.o
 obj-$(CONFIG_MACH_MX53_LOCO) += board-mx53_loco.o
+obj-$(CONFIG_MACH_MX53_ARD) += board-mx53_ard.o
 obj-$(CONFIG_MACH_EUKREA_CPUIMX51) += board-cpuimx51.o
 obj-$(CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD) += eukrea_mbimx51-baseboard.o
 obj-$(CONFIG_MACH_EUKREA_CPUIMX51SD) += board-cpuimx51sd.o
index 4efa02ee163991aa4c788bc042f8d1d8dff2111b..7c893fa70266928418aebff1f3140221d4355b30 100644 (file)
 #define CPUIMX51_QUARTB_GPIO   IMX_GPIO_NR(3, 25)
 #define CPUIMX51_QUARTC_GPIO   IMX_GPIO_NR(3, 26)
 #define CPUIMX51_QUARTD_GPIO   IMX_GPIO_NR(3, 27)
-#define CPUIMX51_QUARTA_IRQ    (MXC_INTERNAL_IRQS + CPUIMX51_QUARTA_GPIO)
-#define CPUIMX51_QUARTB_IRQ    (MXC_INTERNAL_IRQS + CPUIMX51_QUARTB_GPIO)
-#define CPUIMX51_QUARTC_IRQ    (MXC_INTERNAL_IRQS + CPUIMX51_QUARTC_GPIO)
-#define CPUIMX51_QUARTD_IRQ    (MXC_INTERNAL_IRQS + CPUIMX51_QUARTD_GPIO)
 #define CPUIMX51_QUART_XTAL    14745600
 #define CPUIMX51_QUART_REGSHIFT        17
 
@@ -61,7 +57,7 @@
 static struct plat_serial8250_port serial_platform_data[] = {
        {
                .mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x400000),
-               .irq = CPUIMX51_QUARTA_IRQ,
+               .irq = gpio_to_irq(CPUIMX51_QUARTA_GPIO),
                .irqflags = IRQF_TRIGGER_HIGH,
                .uartclk = CPUIMX51_QUART_XTAL,
                .regshift = CPUIMX51_QUART_REGSHIFT,
@@ -69,7 +65,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
                .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
        }, {
                .mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x800000),
-               .irq = CPUIMX51_QUARTB_IRQ,
+               .irq = gpio_to_irq(CPUIMX51_QUARTB_GPIO),
                .irqflags = IRQF_TRIGGER_HIGH,
                .uartclk = CPUIMX51_QUART_XTAL,
                .regshift = CPUIMX51_QUART_REGSHIFT,
@@ -77,7 +73,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
                .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
        }, {
                .mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x1000000),
-               .irq = CPUIMX51_QUARTC_IRQ,
+               .irq = gpio_to_irq(CPUIMX51_QUARTC_GPIO),
                .irqflags = IRQF_TRIGGER_HIGH,
                .uartclk = CPUIMX51_QUART_XTAL,
                .regshift = CPUIMX51_QUART_REGSHIFT,
@@ -85,7 +81,7 @@ static struct plat_serial8250_port serial_platform_data[] = {
                .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
        }, {
                .mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x2000000),
-               .irq = CPUIMX51_QUARTD_IRQ,
+               .irq = irq_to_gpio(CPUIMX51_QUARTD_GPIO),
                .irqflags = IRQF_TRIGGER_HIGH,
                .uartclk = CPUIMX51_QUART_XTAL,
                .regshift = CPUIMX51_QUART_REGSHIFT,
@@ -245,6 +241,8 @@ __setup("otg_mode=", eukrea_cpuimx51_otg_mode);
  */
 static void __init eukrea_cpuimx51_init(void)
 {
+       imx51_soc_init();
+
        mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx51_pads,
                                        ARRAY_SIZE(eukrea_cpuimx51_pads));
 
index 5ef25a596143bf52a9c1bc3034e95c903d31325e..ff096d587299063248e3408c3ffa811b1756f50d 100644 (file)
@@ -264,6 +264,8 @@ static struct platform_device *platform_devices[] __initdata = {
 
 static void __init eukrea_cpuimx51sd_init(void)
 {
+       imx51_soc_init();
+
        mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx51sd_pads,
                                        ARRAY_SIZE(eukrea_cpuimx51sd_pads));
 
index 11210e1ae42a3a61155d67163a5ce74cfeda4473..7de25c6712eb50f2df13a5cd8562e3aec61da431 100644 (file)
@@ -192,6 +192,8 @@ static const struct imxi2c_platform_data i2c_data __initconst = {
  */
 static void __init mx50_rdp_board_init(void)
 {
+       imx50_soc_init();
+
        mxc_iomux_v3_setup_multiple_pads(mx50_rdp_pads,
                                        ARRAY_SIZE(mx50_rdp_pads));
 
index 63dfbeafbc1e4e51a20b0326bb34cd6e8000c6c7..07a38154da215b76cdc5409d64ccef405ead46f0 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/irq.h>
 #include <linux/platform_device.h>
 #include <linux/spi/spi.h>
+#include <linux/gpio.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -26,7 +27,7 @@
 #include "devices-imx51.h"
 #include "devices.h"
 
-#define EXPIO_PARENT_INT       (MXC_INTERNAL_IRQS + GPIO_PORTA + 6)
+#define EXPIO_PARENT_INT       gpio_to_irq(IMX_GPIO_NR(1, 6))
 #define MX51_3DS_ECSPI2_CS     (GPIO_PORTC + 28)
 
 static iomux_v3_cfg_t mx51_3ds_pads[] = {
@@ -135,6 +136,8 @@ static struct spi_board_info mx51_3ds_spi_nor_device[] = {
  */
 static void __init mx51_3ds_init(void)
 {
+       imx51_soc_init();
+
        mxc_iomux_v3_setup_multiple_pads(mx51_3ds_pads,
                                        ARRAY_SIZE(mx51_3ds_pads));
 
index c7b3fabf50f99a550bb5242f0b3fad37c65ee650..15c600026aeeb683b6d30836fec658db1a12f39d 100644 (file)
 
 #define BABBAGE_USB_HUB_RESET  IMX_GPIO_NR(1, 7)
 #define BABBAGE_USBH1_STP      IMX_GPIO_NR(1, 27)
-#define BABBAGE_PHY_RESET      IMX_GPIO_NR(2, 5)
+#define BABBAGE_USB_PHY_RESET  IMX_GPIO_NR(2, 5)
 #define BABBAGE_FEC_PHY_RESET  IMX_GPIO_NR(2, 14)
 #define BABBAGE_POWER_KEY      IMX_GPIO_NR(2, 21)
 #define BABBAGE_ECSPI1_CS0     IMX_GPIO_NR(4, 24)
 #define BABBAGE_ECSPI1_CS1     IMX_GPIO_NR(4, 25)
+#define BABBAGE_SD1_CD         IMX_GPIO_NR(1, 0)
+#define BABBAGE_SD1_WP         IMX_GPIO_NR(1, 1)
+#define BABBAGE_SD2_CD         IMX_GPIO_NR(1, 6)
+#define BABBAGE_SD2_WP         IMX_GPIO_NR(1, 5)
 
 /* USB_CTRL_1 */
 #define MX51_USB_CTRL_1_OFFSET                 0x10
@@ -110,6 +114,9 @@ static iomux_v3_cfg_t mx51babbage_pads[] = {
        /* USB HUB reset line*/
        MX51_PAD_GPIO1_7__GPIO1_7,
 
+       /* USB PHY reset line */
+       MX51_PAD_EIM_D21__GPIO2_5,
+
        /* FEC */
        MX51_PAD_EIM_EB2__FEC_MDIO,
        MX51_PAD_EIM_EB3__FEC_RDATA1,
@@ -139,6 +146,8 @@ static iomux_v3_cfg_t mx51babbage_pads[] = {
        MX51_PAD_SD1_DATA1__SD1_DATA1,
        MX51_PAD_SD1_DATA2__SD1_DATA2,
        MX51_PAD_SD1_DATA3__SD1_DATA3,
+       MX51_PAD_GPIO1_0__GPIO1_0,
+       MX51_PAD_GPIO1_1__GPIO1_1,
 
        /* SD 2 */
        MX51_PAD_SD2_CMD__SD2_CMD,
@@ -147,6 +156,8 @@ static iomux_v3_cfg_t mx51babbage_pads[] = {
        MX51_PAD_SD2_DATA1__SD2_DATA1,
        MX51_PAD_SD2_DATA2__SD2_DATA2,
        MX51_PAD_SD2_DATA3__SD2_DATA3,
+       MX51_PAD_GPIO1_6__GPIO1_6,
+       MX51_PAD_GPIO1_5__GPIO1_5,
 
        /* eCSPI1 */
        MX51_PAD_CSPI1_MISO__ECSPI1_MISO,
@@ -169,34 +180,31 @@ static struct imxi2c_platform_data babbage_hsi2c_data = {
        .bitrate = 400000,
 };
 
+static struct gpio mx51_babbage_usbh1_gpios[] = {
+       { BABBAGE_USBH1_STP, GPIOF_OUT_INIT_LOW, "usbh1_stp" },
+       { BABBAGE_USB_PHY_RESET, GPIOF_OUT_INIT_LOW, "usbh1_phy_reset" },
+};
+
 static int gpio_usbh1_active(void)
 {
        iomux_v3_cfg_t usbh1stp_gpio = MX51_PAD_USBH1_STP__GPIO1_27;
-       iomux_v3_cfg_t phyreset_gpio = MX51_PAD_EIM_D21__GPIO2_5;
        int ret;
 
        /* Set USBH1_STP to GPIO and toggle it */
        mxc_iomux_v3_setup_pad(usbh1stp_gpio);
-       ret = gpio_request(BABBAGE_USBH1_STP, "usbh1_stp");
+       ret = gpio_request_array(mx51_babbage_usbh1_gpios,
+                                       ARRAY_SIZE(mx51_babbage_usbh1_gpios));
 
        if (ret) {
-               pr_debug("failed to get MX51_PAD_USBH1_STP__GPIO_1_27: %d\n", ret);
+               pr_debug("failed to get USBH1 pins: %d\n", ret);
                return ret;
        }
-       gpio_direction_output(BABBAGE_USBH1_STP, 0);
-       gpio_set_value(BABBAGE_USBH1_STP, 1);
-       msleep(100);
-       gpio_free(BABBAGE_USBH1_STP);
-
-       /* De-assert USB PHY RESETB */
-       mxc_iomux_v3_setup_pad(phyreset_gpio);
-       ret = gpio_request(BABBAGE_PHY_RESET, "phy_reset");
 
-       if (ret) {
-               pr_debug("failed to get MX51_PAD_EIM_D21__GPIO_2_5: %d\n", ret);
-               return ret;
-       }
-       gpio_direction_output(BABBAGE_PHY_RESET, 1);
+       msleep(100);
+       gpio_set_value(BABBAGE_USBH1_STP, 1);
+       gpio_set_value(BABBAGE_USB_PHY_RESET, 1);
+       gpio_free_array(mx51_babbage_usbh1_gpios,
+                                       ARRAY_SIZE(mx51_babbage_usbh1_gpios));
        return 0;
 }
 
@@ -331,6 +339,16 @@ static const struct spi_imx_master mx51_babbage_spi_pdata __initconst = {
        .num_chipselect = ARRAY_SIZE(mx51_babbage_spi_cs),
 };
 
+static const struct esdhc_platform_data mx51_babbage_sd1_data __initconst = {
+       .cd_gpio = BABBAGE_SD1_CD,
+       .wp_gpio = BABBAGE_SD1_WP,
+};
+
+static const struct esdhc_platform_data mx51_babbage_sd2_data __initconst = {
+       .cd_gpio = BABBAGE_SD2_CD,
+       .wp_gpio = BABBAGE_SD2_WP,
+};
+
 /*
  * Board specific initialization.
  */
@@ -340,6 +358,8 @@ static void __init mx51_babbage_init(void)
        iomux_v3_cfg_t power_key = _MX51_PAD_EIM_A27__GPIO2_21 |
                MUX_PAD_CTRL(PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH | PAD_CTL_PUS_100K_UP);
 
+       imx51_soc_init();
+
 #if defined(CONFIG_CPU_FREQ_IMX)
        get_cpu_op = mx51_get_cpu_op;
 #endif
@@ -374,8 +394,8 @@ static void __init mx51_babbage_init(void)
        mxc_iomux_v3_setup_pad(usbh1stp);
        babbage_usbhub_reset();
 
-       imx51_add_sdhci_esdhc_imx(0, NULL);
-       imx51_add_sdhci_esdhc_imx(1, NULL);
+       imx51_add_sdhci_esdhc_imx(0, &mx51_babbage_sd1_data);
+       imx51_add_sdhci_esdhc_imx(1, &mx51_babbage_sd2_data);
 
        spi_register_board_info(mx51_babbage_spi_board_info,
                ARRAY_SIZE(mx51_babbage_spi_board_info));
index 6e362315291b4f03a9dd71d6085b67edfd2078a6..f70700dc0ec1d7bf3b4120c5645c96dbbb05db26 100644 (file)
@@ -139,7 +139,7 @@ static void __init mx51_efikamx_board_id(void)
        }
 }
 
-static struct gpio_led mx51_efikamx_leds[] = {
+static struct gpio_led mx51_efikamx_leds[] __initdata = {
        {
                .name = "efikamx:green",
                .default_trigger = "default-on",
@@ -157,19 +157,12 @@ static struct gpio_led mx51_efikamx_leds[] = {
        },
 };
 
-static struct gpio_led_platform_data mx51_efikamx_leds_data = {
+static const struct gpio_led_platform_data
+               mx51_efikamx_leds_data __initconst = {
        .leds = mx51_efikamx_leds,
        .num_leds = ARRAY_SIZE(mx51_efikamx_leds),
 };
 
-static struct platform_device mx51_efikamx_leds_device = {
-       .name = "leds-gpio",
-       .id = -1,
-       .dev = {
-               .platform_data = &mx51_efikamx_leds_data,
-       },
-};
-
 static struct gpio_keys_button mx51_efikamx_powerkey[] = {
        {
                .code = KEY_POWER,
@@ -236,6 +229,8 @@ late_initcall(mx51_efikamx_power_init);
 
 static void __init mx51_efikamx_init(void)
 {
+       imx51_soc_init();
+
        mxc_iomux_v3_setup_multiple_pads(mx51efikamx_pads,
                                        ARRAY_SIZE(mx51efikamx_pads));
        efika_board_common_init();
@@ -248,7 +243,7 @@ static void __init mx51_efikamx_init(void)
                mx51_efikamx_leds[2].default_trigger = "mmc1";
        }
 
-       platform_device_register(&mx51_efikamx_leds_device);
+       gpio_led_register_device(-1, &mx51_efikamx_leds_data);
        imx_add_gpio_keys(&mx51_efikamx_powerkey_data);
 
        if (system_rev == 0x11) {
index 474fc6e4c6df5593ecd0df7a80b3f3c8c5569a1c..2e4d9d32a87c688061181939c318790ea3f52d37 100644 (file)
@@ -132,7 +132,7 @@ static void __init mx51_efikasb_usb(void)
                mxc_register_device(&mxc_usbh2_device, &usbh2_config);
 }
 
-static struct gpio_led mx51_efikasb_leds[] = {
+static const struct gpio_led mx51_efikasb_leds[] __initconst = {
        {
                .name = "efikasb:green",
                .default_trigger = "default-on",
@@ -146,19 +146,12 @@ static struct gpio_led mx51_efikasb_leds[] = {
        },
 };
 
-static struct gpio_led_platform_data mx51_efikasb_leds_data = {
+static const struct gpio_led_platform_data
+               mx51_efikasb_leds_data __initconst = {
        .leds = mx51_efikasb_leds,
        .num_leds = ARRAY_SIZE(mx51_efikasb_leds),
 };
 
-static struct platform_device mx51_efikasb_leds_device = {
-       .name = "leds-gpio",
-       .id = -1,
-       .dev = {
-               .platform_data = &mx51_efikasb_leds_data,
-       },
-};
-
 static struct gpio_keys_button mx51_efikasb_keys[] = {
        {
                .code = KEY_POWER,
@@ -248,6 +241,8 @@ static void __init mx51_efikasb_board_id(void)
 
 static void __init efikasb_board_init(void)
 {
+       imx51_soc_init();
+
        mxc_iomux_v3_setup_multiple_pads(mx51efikasb_pads,
                                        ARRAY_SIZE(mx51efikasb_pads));
        efika_board_common_init();
@@ -256,9 +251,8 @@ static void __init efikasb_board_init(void)
        mx51_efikasb_usb();
        imx51_add_sdhci_esdhc_imx(1, NULL);
 
-       platform_device_register(&mx51_efikasb_leds_device);
+       gpio_led_register_device(-1, &mx51_efikasb_leds_data);
        imx_add_gpio_keys(&mx51_efikasb_keys_data);
-
 }
 
 static void __init mx51_efikasb_timer_init(void)
diff --git a/arch/arm/mach-mx5/board-mx53_ard.c b/arch/arm/mach-mx5/board-mx53_ard.c
new file mode 100644 (file)
index 0000000..76a67c4
--- /dev/null
@@ -0,0 +1,254 @@
+/*
+ * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
+ */
+
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <linux/init.h>
+#include <linux/clk.h>
+#include <linux/delay.h>
+#include <linux/gpio.h>
+#include <linux/smsc911x.h>
+
+#include <mach/common.h>
+#include <mach/hardware.h>
+#include <mach/iomux-mx53.h>
+
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <asm/mach/time.h>
+
+#include "crm_regs.h"
+#include "devices-imx53.h"
+
+#define ARD_ETHERNET_INT_B     IMX_GPIO_NR(2, 31)
+#define ARD_SD1_CD             IMX_GPIO_NR(1, 1)
+#define ARD_SD1_WP             IMX_GPIO_NR(1, 9)
+#define ARD_I2CPORTEXP_B       IMX_GPIO_NR(2, 3)
+#define ARD_VOLUMEDOWN         IMX_GPIO_NR(4, 0)
+#define ARD_HOME                       IMX_GPIO_NR(5, 10)
+#define ARD_BACK                       IMX_GPIO_NR(5, 11)
+#define ARD_PROG                       IMX_GPIO_NR(5, 12)
+#define ARD_VOLUMEUP           IMX_GPIO_NR(5, 13)
+
+static iomux_v3_cfg_t mx53_ard_pads[] = {
+       /* UART1 */
+       MX53_PAD_PATA_DIOW__UART1_TXD_MUX,
+       MX53_PAD_PATA_DMACK__UART1_RXD_MUX,
+       /* WEIM for CS1 */
+       MX53_PAD_EIM_EB3__GPIO2_31, /* ETHERNET_INT_B */
+       MX53_PAD_EIM_D16__EMI_WEIM_D_16,
+       MX53_PAD_EIM_D17__EMI_WEIM_D_17,
+       MX53_PAD_EIM_D18__EMI_WEIM_D_18,
+       MX53_PAD_EIM_D19__EMI_WEIM_D_19,
+       MX53_PAD_EIM_D20__EMI_WEIM_D_20,
+       MX53_PAD_EIM_D21__EMI_WEIM_D_21,
+       MX53_PAD_EIM_D22__EMI_WEIM_D_22,
+       MX53_PAD_EIM_D23__EMI_WEIM_D_23,
+       MX53_PAD_EIM_D24__EMI_WEIM_D_24,
+       MX53_PAD_EIM_D25__EMI_WEIM_D_25,
+       MX53_PAD_EIM_D26__EMI_WEIM_D_26,
+       MX53_PAD_EIM_D27__EMI_WEIM_D_27,
+       MX53_PAD_EIM_D28__EMI_WEIM_D_28,
+       MX53_PAD_EIM_D29__EMI_WEIM_D_29,
+       MX53_PAD_EIM_D30__EMI_WEIM_D_30,
+       MX53_PAD_EIM_D31__EMI_WEIM_D_31,
+       MX53_PAD_EIM_DA0__EMI_NAND_WEIM_DA_0,
+       MX53_PAD_EIM_DA1__EMI_NAND_WEIM_DA_1,
+       MX53_PAD_EIM_DA2__EMI_NAND_WEIM_DA_2,
+       MX53_PAD_EIM_DA3__EMI_NAND_WEIM_DA_3,
+       MX53_PAD_EIM_DA4__EMI_NAND_WEIM_DA_4,
+       MX53_PAD_EIM_DA5__EMI_NAND_WEIM_DA_5,
+       MX53_PAD_EIM_DA6__EMI_NAND_WEIM_DA_6,
+       MX53_PAD_EIM_OE__EMI_WEIM_OE,
+       MX53_PAD_EIM_RW__EMI_WEIM_RW,
+       MX53_PAD_EIM_CS1__EMI_WEIM_CS_1,
+       /* SDHC1 */
+       MX53_PAD_SD1_CMD__ESDHC1_CMD,
+       MX53_PAD_SD1_CLK__ESDHC1_CLK,
+       MX53_PAD_SD1_DATA0__ESDHC1_DAT0,
+       MX53_PAD_SD1_DATA1__ESDHC1_DAT1,
+       MX53_PAD_SD1_DATA2__ESDHC1_DAT2,
+       MX53_PAD_SD1_DATA3__ESDHC1_DAT3,
+       MX53_PAD_PATA_DATA8__ESDHC1_DAT4,
+       MX53_PAD_PATA_DATA9__ESDHC1_DAT5,
+       MX53_PAD_PATA_DATA10__ESDHC1_DAT6,
+       MX53_PAD_PATA_DATA11__ESDHC1_DAT7,
+       MX53_PAD_GPIO_1__GPIO1_1,
+       MX53_PAD_GPIO_9__GPIO1_9,
+       /* I2C2 */
+       MX53_PAD_EIM_EB2__I2C2_SCL,
+       MX53_PAD_KEY_ROW3__I2C2_SDA,
+       /* I2C3 */
+       MX53_PAD_GPIO_3__I2C3_SCL,
+       MX53_PAD_GPIO_16__I2C3_SDA,
+       /* GPIO */
+       MX53_PAD_DISP0_DAT16__GPIO5_10, /* home */
+       MX53_PAD_DISP0_DAT17__GPIO5_11, /* back */
+       MX53_PAD_DISP0_DAT18__GPIO5_12, /* prog */
+       MX53_PAD_DISP0_DAT19__GPIO5_13, /* vol up */
+       MX53_PAD_GPIO_10__GPIO4_0,              /* vol down */
+};
+
+#define GPIO_BUTTON(gpio_num, ev_code, act_low, descr, wake)   \
+{                                                      \
+       .gpio           = gpio_num,                             \
+       .type           = EV_KEY,                               \
+       .code           = ev_code,                              \
+       .active_low     = act_low,                              \
+       .desc           = "btn " descr,                 \
+       .wakeup         = wake,                                 \
+}
+
+static struct gpio_keys_button ard_buttons[] = {
+       GPIO_BUTTON(ARD_HOME, KEY_HOME, 1, "home", 0),
+       GPIO_BUTTON(ARD_BACK, KEY_BACK, 1, "back", 0),
+       GPIO_BUTTON(ARD_PROG, KEY_PROGRAM, 1, "program", 0),
+       GPIO_BUTTON(ARD_VOLUMEUP, KEY_VOLUMEUP, 1, "volume-up", 0),
+       GPIO_BUTTON(ARD_VOLUMEDOWN, KEY_VOLUMEDOWN, 1, "volume-down", 0),
+};
+
+static const struct gpio_keys_platform_data ard_button_data __initconst = {
+       .buttons        = ard_buttons,
+       .nbuttons       = ARRAY_SIZE(ard_buttons),
+};
+
+static struct resource ard_smsc911x_resources[] = {
+       {
+               .start = MX53_CS1_64MB_BASE_ADDR,
+               .end = MX53_CS1_64MB_BASE_ADDR + SZ_32M - 1,
+               .flags = IORESOURCE_MEM,
+       },
+       {
+               .start =  gpio_to_irq(ARD_ETHERNET_INT_B),
+               .end =  gpio_to_irq(ARD_ETHERNET_INT_B),
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+struct smsc911x_platform_config ard_smsc911x_config = {
+       .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
+       .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
+       .flags = SMSC911X_USE_32BIT,
+};
+
+static struct platform_device ard_smsc_lan9220_device = {
+       .name = "smsc911x",
+       .id = -1,
+       .num_resources = ARRAY_SIZE(ard_smsc911x_resources),
+       .resource = ard_smsc911x_resources,
+       .dev = {
+               .platform_data = &ard_smsc911x_config,
+       },
+};
+
+static const struct esdhc_platform_data mx53_ard_sd1_data __initconst = {
+       .cd_gpio = ARD_SD1_CD,
+       .wp_gpio = ARD_SD1_WP,
+};
+
+static struct imxi2c_platform_data mx53_ard_i2c2_data = {
+       .bitrate = 50000,
+};
+
+static struct imxi2c_platform_data mx53_ard_i2c3_data = {
+       .bitrate = 400000,
+};
+
+static void __init mx53_ard_io_init(void)
+{
+       mxc_iomux_v3_setup_multiple_pads(mx53_ard_pads,
+                               ARRAY_SIZE(mx53_ard_pads));
+
+       gpio_request(ARD_ETHERNET_INT_B, "eth-int-b");
+       gpio_direction_input(ARD_ETHERNET_INT_B);
+
+       gpio_request(ARD_I2CPORTEXP_B, "i2cptexp-rst");
+       gpio_direction_output(ARD_I2CPORTEXP_B, 1);
+}
+
+/* Config CS1 settings for ethernet controller */
+static int weim_cs_config(void)
+{
+       u32 reg;
+       void __iomem *weim_base, *iomuxc_base;
+
+       weim_base = ioremap(MX53_WEIM_BASE_ADDR, SZ_4K);
+       if (!weim_base)
+               return -ENOMEM;
+
+       iomuxc_base = ioremap(MX53_IOMUXC_BASE_ADDR, SZ_4K);
+       if (!iomuxc_base)
+               return -ENOMEM;
+
+       /* CS1 timings for LAN9220 */
+       writel(0x20001, (weim_base + 0x18));
+       writel(0x0, (weim_base + 0x1C));
+       writel(0x16000202, (weim_base + 0x20));
+       writel(0x00000002, (weim_base + 0x24));
+       writel(0x16002082, (weim_base + 0x28));
+       writel(0x00000000, (weim_base + 0x2C));
+       writel(0x00000000, (weim_base + 0x90));
+
+       /* specify 64 MB on CS1 and CS0 on GPR1 */
+       reg = readl(iomuxc_base + 0x4);
+       reg &= ~0x3F;
+       reg |= 0x1B;
+       writel(reg, (iomuxc_base + 0x4));
+
+       iounmap(iomuxc_base);
+       iounmap(weim_base);
+
+       return 0;
+}
+
+static struct platform_device *devices[] __initdata = {
+       &ard_smsc_lan9220_device,
+};
+
+static void __init mx53_ard_board_init(void)
+{
+       imx53_soc_init();
+       imx53_add_imx_uart(0, NULL);
+
+       mx53_ard_io_init();
+       weim_cs_config();
+       platform_add_devices(devices, ARRAY_SIZE(devices));
+
+       imx53_add_sdhci_esdhc_imx(0, &mx53_ard_sd1_data);
+       imx53_add_imx2_wdt(0, NULL);
+       imx53_add_imx_i2c(1, &mx53_ard_i2c2_data);
+       imx53_add_imx_i2c(2, &mx53_ard_i2c3_data);
+       imx_add_gpio_keys(&ard_button_data);
+}
+
+static void __init mx53_ard_timer_init(void)
+{
+       mx53_clocks_init(32768, 24000000, 22579200, 0);
+}
+
+static struct sys_timer mx53_ard_timer = {
+       .init   = mx53_ard_timer_init,
+};
+
+MACHINE_START(MX53_ARD, "Freescale MX53 ARD Board")
+       .map_io = mx53_map_io,
+       .init_early = imx53_init_early,
+       .init_irq = mx53_init_irq,
+       .timer = &mx53_ard_timer,
+       .init_machine = mx53_ard_board_init,
+MACHINE_END
index f87d571882c64df8419e7cd3ce6bff9099bab428..1b417b06b7360b526d87915654e569ae91111efd 100644 (file)
@@ -35,6 +35,7 @@
 #define MX53_EVK_FEC_PHY_RST   IMX_GPIO_NR(7, 6)
 #define EVK_ECSPI1_CS0         IMX_GPIO_NR(2, 30)
 #define EVK_ECSPI1_CS1         IMX_GPIO_NR(3, 19)
+#define MX53EVK_LED            IMX_GPIO_NR(7, 7)
 
 #include "crm_regs.h"
 #include "devices-imx53.h"
@@ -58,12 +59,27 @@ static iomux_v3_cfg_t mx53_evk_pads[] = {
        /* ecspi chip select lines */
        MX53_PAD_EIM_EB2__GPIO2_30,
        MX53_PAD_EIM_D19__GPIO3_19,
+       /* LED */
+       MX53_PAD_PATA_DA_1__GPIO7_7,
 };
 
 static const struct imxuart_platform_data mx53_evk_uart_pdata __initconst = {
        .flags = IMXUART_HAVE_RTSCTS,
 };
 
+static const struct gpio_led mx53evk_leds[] __initconst = {
+       {
+               .name                   = "green",
+               .default_trigger        = "heartbeat",
+               .gpio                   = MX53EVK_LED,
+       },
+};
+
+static const struct gpio_led_platform_data mx53evk_leds_data __initconst = {
+       .leds           = mx53evk_leds,
+       .num_leds       = ARRAY_SIZE(mx53evk_leds),
+};
+
 static inline void mx53_evk_init_uart(void)
 {
        imx53_add_imx_uart(0, NULL);
@@ -117,6 +133,8 @@ static const struct spi_imx_master mx53_evk_spi_data __initconst = {
 
 static void __init mx53_evk_board_init(void)
 {
+       imx53_soc_init();
+
        mxc_iomux_v3_setup_multiple_pads(mx53_evk_pads,
                                        ARRAY_SIZE(mx53_evk_pads));
        mx53_evk_init_uart();
@@ -133,6 +151,7 @@ static void __init mx53_evk_board_init(void)
                ARRAY_SIZE(mx53_evk_spi_board_info));
        imx53_add_ecspi(0, &mx53_evk_spi_data);
        imx53_add_imx2_wdt(0, NULL);
+       gpio_led_register_device(-1, &mx53evk_leds_data);
 }
 
 static void __init mx53_evk_timer_init(void)
index 1b947e8c9c0c69f45c6bfef5abf048b1f33d5cdf..54be525e2bd75bb6eed97eefbd5e9bd9f181784f 100644 (file)
 #define MX53_LOCO_UI1                  IMX_GPIO_NR(2, 14)
 #define MX53_LOCO_UI2                  IMX_GPIO_NR(2, 15)
 #define LOCO_FEC_PHY_RST               IMX_GPIO_NR(7, 6)
+#define LOCO_LED                       IMX_GPIO_NR(7, 7)
+#define LOCO_SD3_CD                    IMX_GPIO_NR(3, 11)
+#define LOCO_SD3_WP                    IMX_GPIO_NR(3, 12)
+#define LOCO_SD1_CD                    IMX_GPIO_NR(3, 13)
 
 static iomux_v3_cfg_t mx53_loco_pads[] = {
        /* FEC */
@@ -70,6 +74,8 @@ static iomux_v3_cfg_t mx53_loco_pads[] = {
        MX53_PAD_SD1_DATA1__ESDHC1_DAT1,
        MX53_PAD_SD1_DATA2__ESDHC1_DAT2,
        MX53_PAD_SD1_DATA3__ESDHC1_DAT3,
+       /* SD1_CD */
+       MX53_PAD_EIM_DA13__GPIO3_13,
        /* SD3 */
        MX53_PAD_PATA_DATA8__ESDHC3_DAT0,
        MX53_PAD_PATA_DATA9__ESDHC3_DAT1,
@@ -163,7 +169,7 @@ static iomux_v3_cfg_t mx53_loco_pads[] = {
        MX53_PAD_GPIO_7__SPDIF_PLOCK,
        MX53_PAD_GPIO_17__SPDIF_OUT1,
        /* GPIO */
-       MX53_PAD_PATA_DA_1__GPIO7_7,
+       MX53_PAD_PATA_DA_1__GPIO7_7,            /* LED */
        MX53_PAD_PATA_DA_2__GPIO7_8,
        MX53_PAD_PATA_DATA5__GPIO2_5,
        MX53_PAD_PATA_DATA6__GPIO2_6,
@@ -202,6 +208,15 @@ static const struct gpio_keys_platform_data loco_button_data __initconst = {
        .nbuttons       = ARRAY_SIZE(loco_buttons),
 };
 
+static const struct esdhc_platform_data mx53_loco_sd1_data __initconst = {
+       .cd_gpio = LOCO_SD1_CD,
+};
+
+static const struct esdhc_platform_data mx53_loco_sd3_data __initconst = {
+       .cd_gpio = LOCO_SD3_CD,
+       .wp_gpio = LOCO_SD3_WP,
+};
+
 static inline void mx53_loco_fec_reset(void)
 {
        int ret;
@@ -225,8 +240,23 @@ static const struct imxi2c_platform_data mx53_loco_i2c_data __initconst = {
        .bitrate = 100000,
 };
 
+static const struct gpio_led mx53loco_leds[] __initconst = {
+       {
+               .name                   = "green",
+               .default_trigger        = "heartbeat",
+               .gpio                   = LOCO_LED,
+       },
+};
+
+static const struct gpio_led_platform_data mx53loco_leds_data __initconst = {
+       .leds           = mx53loco_leds,
+       .num_leds       = ARRAY_SIZE(mx53loco_leds),
+};
+
 static void __init mx53_loco_board_init(void)
 {
+       imx53_soc_init();
+
        mxc_iomux_v3_setup_multiple_pads(mx53_loco_pads,
                                        ARRAY_SIZE(mx53_loco_pads));
        imx53_add_imx_uart(0, NULL);
@@ -235,9 +265,10 @@ static void __init mx53_loco_board_init(void)
        imx53_add_imx2_wdt(0, NULL);
        imx53_add_imx_i2c(0, &mx53_loco_i2c_data);
        imx53_add_imx_i2c(1, &mx53_loco_i2c_data);
-       imx53_add_sdhci_esdhc_imx(0, NULL);
-       imx53_add_sdhci_esdhc_imx(2, NULL);
+       imx53_add_sdhci_esdhc_imx(0, &mx53_loco_sd1_data);
+       imx53_add_sdhci_esdhc_imx(2, &mx53_loco_sd3_data);
        imx_add_gpio_keys(&loco_button_data);
+       gpio_led_register_device(-1, &mx53loco_leds_data);
 }
 
 static void __init mx53_loco_timer_init(void)
index 817c08938f552e0194a8c409c48132252766ba51..bc02894eafefab9126347857ff709293e1bffeb5 100644 (file)
@@ -113,6 +113,8 @@ static const struct imxi2c_platform_data mx53_smd_i2c_data __initconst = {
 
 static void __init mx53_smd_board_init(void)
 {
+       imx53_soc_init();
+
        mxc_iomux_v3_setup_multiple_pads(mx53_smd_pads,
                                        ARRAY_SIZE(mx53_smd_pads));
        mx53_smd_init_uart();
index 6b89c1bf4eb2f7a774b18c7b68871b173b5f4da1..ff16d86ff59744aaa39a7010b9a174058c1852d9 100644 (file)
@@ -1254,12 +1254,20 @@ DEFINE_CLOCK(uart2_ipg_clk, 1, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG5_OFFSET,
        NULL,  NULL, &ipg_clk, &aips_tz1_clk);
 DEFINE_CLOCK(uart3_ipg_clk, 2, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG7_OFFSET,
        NULL,  NULL, &ipg_clk, &spba_clk);
+DEFINE_CLOCK(uart4_ipg_clk, 3, MXC_CCM_CCGR7, MXC_CCM_CCGRx_CG4_OFFSET,
+       NULL,  NULL, &ipg_clk, &spba_clk);
+DEFINE_CLOCK(uart5_ipg_clk, 4, MXC_CCM_CCGR7, MXC_CCM_CCGRx_CG6_OFFSET,
+       NULL,  NULL, &ipg_clk, &spba_clk);
 DEFINE_CLOCK(uart1_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG4_OFFSET,
        NULL,  NULL, &uart_root_clk, &uart1_ipg_clk);
 DEFINE_CLOCK(uart2_clk, 1, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG6_OFFSET,
        NULL,  NULL, &uart_root_clk, &uart2_ipg_clk);
 DEFINE_CLOCK(uart3_clk, 2, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG8_OFFSET,
        NULL,  NULL, &uart_root_clk, &uart3_ipg_clk);
+DEFINE_CLOCK(uart4_clk, 3, MXC_CCM_CCGR7, MXC_CCM_CCGRx_CG5_OFFSET,
+       NULL,  NULL, &uart_root_clk, &uart4_ipg_clk);
+DEFINE_CLOCK(uart5_clk, 4, MXC_CCM_CCGR7, MXC_CCM_CCGRx_CG7_OFFSET,
+       NULL,  NULL, &uart_root_clk, &uart5_ipg_clk);
 
 /* GPT */
 DEFINE_CLOCK(gpt_ipg_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG10_OFFSET,
@@ -1274,11 +1282,13 @@ DEFINE_CLOCK(pwm2_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG8_OFFSET,
 
 /* I2C */
 DEFINE_CLOCK(i2c1_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG9_OFFSET,
-       NULL, NULL, &ipg_clk, NULL);
+       NULL, NULL, &ipg_perclk, NULL);
 DEFINE_CLOCK(i2c2_clk, 1, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG10_OFFSET,
-       NULL, NULL, &ipg_clk, NULL);
+       NULL, NULL, &ipg_perclk, NULL);
 DEFINE_CLOCK(hsi2c_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG11_OFFSET,
        NULL, NULL, &ipg_clk, NULL);
+DEFINE_CLOCK(i2c3_mx53_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG11_OFFSET,
+       NULL, NULL, &ipg_perclk, NULL);
 
 /* FEC */
 DEFINE_CLOCK(fec_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG12_OFFSET,
@@ -1462,11 +1472,14 @@ static struct clk_lookup mx53_lookups[] = {
        _REGISTER_CLOCK("imx-uart.0", NULL, uart1_clk)
        _REGISTER_CLOCK("imx-uart.1", NULL, uart2_clk)
        _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk)
+       _REGISTER_CLOCK("imx-uart.3", NULL, uart4_clk)
+       _REGISTER_CLOCK("imx-uart.4", NULL, uart5_clk)
        _REGISTER_CLOCK(NULL, "gpt", gpt_clk)
        _REGISTER_CLOCK("fec.0", NULL, fec_clk)
        _REGISTER_CLOCK(NULL, "iim_clk", iim_clk)
        _REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk)
        _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk)
+       _REGISTER_CLOCK("imx-i2c.2", NULL, i2c3_mx53_clk)
        _REGISTER_CLOCK("sdhci-esdhc-imx.0", NULL, esdhc1_clk)
        _REGISTER_CLOCK("sdhci-esdhc-imx.1", NULL, esdhc2_mx53_clk)
        _REGISTER_CLOCK("sdhci-esdhc-imx.2", NULL, esdhc3_mx53_clk)
@@ -1476,6 +1489,11 @@ static struct clk_lookup mx53_lookups[] = {
        _REGISTER_CLOCK("imx53-cspi.0", NULL, cspi_clk)
        _REGISTER_CLOCK("imx2-wdt.0", NULL, dummy_clk)
        _REGISTER_CLOCK("imx2-wdt.1", NULL, dummy_clk)
+       _REGISTER_CLOCK("imx-sdma", NULL, sdma_clk)
+       _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk)
+       _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk)
+       _REGISTER_CLOCK("imx-ssi.2", NULL, ssi3_clk)
+       _REGISTER_CLOCK("imx-keypad", NULL, dummy_clk)
 };
 
 static void clk_tree_init(void)
index 87c0c58f27a75c24a65658838e1dc366f97e7bd0..5e11ba7daee2e34ce64d3ad903cebfe6adb151b7 100644 (file)
 #define MXC_CCM_CCGR4          (MX51_CCM_BASE + 0x78)
 #define MXC_CCM_CCGR5          (MX51_CCM_BASE + 0x7C)
 #define MXC_CCM_CCGR6          (MX51_CCM_BASE + 0x80)
+#define MXC_CCM_CCGR7          (MX51_CCM_BASE + 0x84)
+
 #define MXC_CCM_CMEOR          (MX51_CCM_BASE + 0x84)
 
 /* Define the bits in register CCR */
index 48f4c8cc42f54e95e72c70fe2c58a900a86185b4..c27fe8bb4762ecce77a9caf5e5699d0b93d1eb14 100644 (file)
@@ -32,3 +32,11 @@ extern const struct imx_spi_imx_data imx53_ecspi_data[];
 extern const struct imx_imx2_wdt_data imx53_imx2_wdt_data[];
 #define imx53_add_imx2_wdt(id, pdata)  \
        imx_add_imx2_wdt(&imx53_imx2_wdt_data[id])
+
+extern const struct imx_imx_ssi_data imx53_imx_ssi_data[];
+#define imx53_add_imx_ssi(id, pdata)   \
+       imx_add_imx_ssi(&imx53_imx_ssi_data[id], pdata)
+
+extern const struct imx_imx_keypad_data imx53_imx_keypad_data;
+#define imx53_add_imx_keypad(pdata)    \
+       imx_add_imx_keypad(&imx53_imx_keypad_data, pdata)
index 153ada53e575aaf37acef19c53776c519beb2916..371ca8c8414c23dd3f696f530830fa9af3c70bbe 100644 (file)
@@ -12,7 +12,6 @@
 
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
-#include <linux/gpio.h>
 #include <mach/hardware.h>
 #include <mach/imx-uart.h>
 #include <mach/irqs.h>
@@ -119,66 +118,3 @@ struct platform_device mxc_usbh2_device = {
                .coherent_dma_mask = DMA_BIT_MASK(32),
        },
 };
-
-static struct mxc_gpio_port mxc_gpio_ports[] = {
-       {
-               .chip.label = "gpio-0",
-               .base = MX51_IO_ADDRESS(MX51_GPIO1_BASE_ADDR),
-               .irq = MX51_MXC_INT_GPIO1_LOW,
-               .irq_high = MX51_MXC_INT_GPIO1_HIGH,
-               .virtual_irq_start = MXC_GPIO_IRQ_START
-       },
-       {
-               .chip.label = "gpio-1",
-               .base = MX51_IO_ADDRESS(MX51_GPIO2_BASE_ADDR),
-               .irq = MX51_MXC_INT_GPIO2_LOW,
-               .irq_high = MX51_MXC_INT_GPIO2_HIGH,
-               .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 1
-       },
-       {
-               .chip.label = "gpio-2",
-               .base = MX51_IO_ADDRESS(MX51_GPIO3_BASE_ADDR),
-               .irq = MX51_MXC_INT_GPIO3_LOW,
-               .irq_high = MX51_MXC_INT_GPIO3_HIGH,
-               .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 2
-       },
-       {
-               .chip.label = "gpio-3",
-               .base = MX51_IO_ADDRESS(MX51_GPIO4_BASE_ADDR),
-               .irq = MX51_MXC_INT_GPIO4_LOW,
-               .irq_high = MX51_MXC_INT_GPIO4_HIGH,
-               .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 3
-       },
-       {
-               .chip.label = "gpio-4",
-               .base = MX53_IO_ADDRESS(MX53_GPIO5_BASE_ADDR),
-               .irq = MX53_INT_GPIO5_LOW,
-               .irq_high = MX53_INT_GPIO5_HIGH,
-               .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 4
-       },
-       {
-               .chip.label = "gpio-5",
-               .base = MX53_IO_ADDRESS(MX53_GPIO6_BASE_ADDR),
-               .irq = MX53_INT_GPIO6_LOW,
-               .irq_high = MX53_INT_GPIO6_HIGH,
-               .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 5
-       },
-       {
-               .chip.label = "gpio-6",
-               .base = MX53_IO_ADDRESS(MX53_GPIO7_BASE_ADDR),
-               .irq = MX53_INT_GPIO7_LOW,
-               .irq_high = MX53_INT_GPIO7_HIGH,
-               .virtual_irq_start = MXC_GPIO_IRQ_START + 32 * 6
-       },
-};
-
-int __init imx51_register_gpios(void)
-{
-       return mxc_gpio_init(mxc_gpio_ports, 4);
-}
-
-int __init imx53_register_gpios(void)
-{
-       return mxc_gpio_init(mxc_gpio_ports, ARRAY_SIZE(mxc_gpio_ports));
-}
-
index 97292d20f1f39353fe63bdda41088ac9ff5fce94..bbf4564bd05076d7ead9dc6211fc2ccf90b72ca0 100644 (file)
 #include "devices.h"
 
 #define MBIMX51_TSC2007_GPIO   IMX_GPIO_NR(3, 30)
-#define MBIMX51_TSC2007_IRQ    (MXC_INTERNAL_IRQS + MBIMX51_TSC2007_GPIO)
 #define MBIMX51_LED0           IMX_GPIO_NR(3, 5)
 #define MBIMX51_LED1           IMX_GPIO_NR(3, 6)
 #define MBIMX51_LED2           IMX_GPIO_NR(3, 7)
 #define MBIMX51_LED3           IMX_GPIO_NR(3, 8)
 
-static struct gpio_led mbimx51_leds[] = {
+static const struct gpio_led mbimx51_leds[] __initconst = {
        {
                .name                   = "led0",
                .default_trigger        = "heartbeat",
@@ -64,23 +63,11 @@ static struct gpio_led mbimx51_leds[] = {
        },
 };
 
-static struct gpio_led_platform_data mbimx51_leds_info = {
+static const struct gpio_led_platform_data mbimx51_leds_info __initconst = {
        .leds           = mbimx51_leds,
        .num_leds       = ARRAY_SIZE(mbimx51_leds),
 };
 
-static struct platform_device mbimx51_leds_gpio = {
-       .name   = "leds-gpio",
-       .id     = -1,
-       .dev    = {
-               .platform_data  = &mbimx51_leds_info,
-       },
-};
-
-static struct platform_device *devices[] __initdata = {
-       &mbimx51_leds_gpio,
-};
-
 static iomux_v3_cfg_t mbimx51_pads[] = {
        /* UART2 */
        MX51_PAD_UART2_RXD__UART2_RXD,
@@ -173,7 +160,7 @@ struct tsc2007_platform_data tsc2007_data = {
 static struct i2c_board_info mbimx51_i2c_devices[] = {
        {
                I2C_BOARD_INFO("tsc2007", 0x49),
-               .irq  = MBIMX51_TSC2007_IRQ,
+               .irq  = gpio_to_irq(MBIMX51_TSC2007_GPIO),
                .platform_data = &tsc2007_data,
        }, {
                I2C_BOARD_INFO("tlv320aic23", 0x1a),
@@ -204,13 +191,14 @@ void __init eukrea_mbimx51_baseboard_init(void)
        gpio_direction_output(MBIMX51_LED3, 1);
        gpio_free(MBIMX51_LED3);
 
-       platform_add_devices(devices, ARRAY_SIZE(devices));
+       gpio_led_register_device(-1, &mbimx51_leds_info);
 
        imx51_add_imx_keypad(&mbimx51_map_data);
 
        gpio_request(MBIMX51_TSC2007_GPIO, "tsc2007_irq");
        gpio_direction_input(MBIMX51_TSC2007_GPIO);
-       irq_set_irq_type(MBIMX51_TSC2007_IRQ, IRQF_TRIGGER_FALLING);
+       irq_set_irq_type(gpio_to_irq(MBIMX51_TSC2007_GPIO),
+                                       IRQF_TRIGGER_FALLING);
        i2c_register_board_info(1, mbimx51_i2c_devices,
                                ARRAY_SIZE(mbimx51_i2c_devices));
 
index 31c871ec46a6f9cc060d8a24c72df591f0277dbd..261923997643b0c17091840593ab9d8d6e0599dd 100644 (file)
@@ -74,7 +74,7 @@ static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = {
 #define GPIO_LED1      IMX_GPIO_NR(3, 30)
 #define GPIO_SWITCH1   IMX_GPIO_NR(3, 31)
 
-static struct gpio_led eukrea_mbimxsd_leds[] = {
+static const struct gpio_led eukrea_mbimxsd_leds[] __initconst = {
        {
                .name                   = "led1",
                .default_trigger        = "heartbeat",
@@ -83,19 +83,12 @@ static struct gpio_led eukrea_mbimxsd_leds[] = {
        },
 };
 
-static struct gpio_led_platform_data eukrea_mbimxsd_led_info = {
+static const struct gpio_led_platform_data
+               eukrea_mbimxsd_led_info __initconst = {
        .leds           = eukrea_mbimxsd_leds,
        .num_leds       = ARRAY_SIZE(eukrea_mbimxsd_leds),
 };
 
-static struct platform_device eukrea_mbimxsd_leds_gpio = {
-       .name   = "leds-gpio",
-       .id     = -1,
-       .dev    = {
-               .platform_data  = &eukrea_mbimxsd_led_info,
-       },
-};
-
 static struct gpio_keys_button eukrea_mbimxsd_gpio_buttons[] = {
        {
                .gpio           = GPIO_SWITCH1,
@@ -112,10 +105,6 @@ static const struct gpio_keys_platform_data
        .nbuttons       = ARRAY_SIZE(eukrea_mbimxsd_gpio_buttons),
 };
 
-static struct platform_device *platform_devices[] __initdata = {
-       &eukrea_mbimxsd_leds_gpio,
-};
-
 static const struct imxuart_platform_data uart_pdata __initconst = {
        .flags = IMXUART_HAVE_RTSCTS,
 };
@@ -154,6 +143,6 @@ void __init eukrea_mbimxsd51_baseboard_init(void)
        i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices,
                                ARRAY_SIZE(eukrea_mbimxsd_i2c_devices));
 
-       platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
+       gpio_led_register_device(-1, &eukrea_mbimxsd_led_info);
        imx_add_gpio_keys(&eukrea_mbimxsd_button_data);
 }
index b9c363b514a9d4c9f767ec1dd5f0775417ccef4b..28c3f60f734f0c89cea026393bfae03020ee3602 100644 (file)
@@ -26,7 +26,6 @@
 #include <mach/hardware.h>
 #include <mach/common.h>
 #include <mach/iomux-v3.h>
-#include <mach/gpio.h>
 #include <mach/irqs.h>
 
 /*
@@ -56,17 +55,17 @@ void __init imx50_init_early(void)
        mxc_arch_reset_init(MX50_IO_ADDRESS(MX50_WDOG_BASE_ADDR));
 }
 
-static struct mxc_gpio_port imx50_gpio_ports[] = {
-       DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 0, 1, MX50_INT_GPIO1_LOW, MX50_INT_GPIO1_HIGH),
-       DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 1, 2, MX50_INT_GPIO2_LOW, MX50_INT_GPIO2_HIGH),
-       DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 2, 3, MX50_INT_GPIO3_LOW, MX50_INT_GPIO3_HIGH),
-       DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 3, 4, MX50_INT_GPIO3_LOW, MX50_INT_GPIO3_HIGH),
-       DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 4, 5, MX50_INT_GPIO3_LOW, MX50_INT_GPIO3_HIGH),
-       DEFINE_IMX_GPIO_PORT_IRQ_HIGH(MX50, 5, 6, MX50_INT_GPIO3_LOW, MX50_INT_GPIO3_HIGH),
-};
-
 void __init mx50_init_irq(void)
 {
        tzic_init_irq(MX50_IO_ADDRESS(MX50_TZIC_BASE_ADDR));
-       mxc_gpio_init(imx50_gpio_ports, ARRAY_SIZE(imx50_gpio_ports));
+}
+
+void __init imx50_soc_init(void)
+{
+       mxc_register_gpio(0, MX50_GPIO1_BASE_ADDR, SZ_16K, MX50_INT_GPIO1_LOW, MX50_INT_GPIO1_HIGH);
+       mxc_register_gpio(1, MX50_GPIO2_BASE_ADDR, SZ_16K, MX50_INT_GPIO2_LOW, MX50_INT_GPIO2_HIGH);
+       mxc_register_gpio(2, MX50_GPIO3_BASE_ADDR, SZ_16K, MX50_INT_GPIO3_LOW, MX50_INT_GPIO3_HIGH);
+       mxc_register_gpio(3, MX50_GPIO4_BASE_ADDR, SZ_16K, MX50_INT_GPIO4_LOW, MX50_INT_GPIO4_HIGH);
+       mxc_register_gpio(4, MX50_GPIO5_BASE_ADDR, SZ_16K, MX50_INT_GPIO5_LOW, MX50_INT_GPIO5_HIGH);
+       mxc_register_gpio(5, MX50_GPIO6_BASE_ADDR, SZ_16K, MX50_INT_GPIO6_LOW, MX50_INT_GPIO6_HIGH);
 }
index ff557301b42bc90ecdf49a0a15e5c17949e449f9..1b7059f1ac7645c42eb305ffd30270ee0986cf9b 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <mach/hardware.h>
 #include <mach/common.h>
+#include <mach/devices-common.h>
 #include <mach/iomux-v3.h>
 
 /*
@@ -69,8 +70,6 @@ void __init imx53_init_early(void)
        mxc_arch_reset_init(MX53_IO_ADDRESS(MX53_WDOG1_BASE_ADDR));
 }
 
-int imx51_register_gpios(void);
-
 void __init mx51_init_irq(void)
 {
        unsigned long tzic_addr;
@@ -86,11 +85,8 @@ void __init mx51_init_irq(void)
                panic("unable to map TZIC interrupt controller\n");
 
        tzic_init_irq(tzic_virt);
-       imx51_register_gpios();
 }
 
-int imx53_register_gpios(void);
-
 void __init mx53_init_irq(void)
 {
        unsigned long tzic_addr;
@@ -103,5 +99,66 @@ void __init mx53_init_irq(void)
                panic("unable to map TZIC interrupt controller\n");
 
        tzic_init_irq(tzic_virt);
-       imx53_register_gpios();
+}
+
+static struct sdma_script_start_addrs imx51_sdma_script __initdata = {
+       .ap_2_ap_addr = 642,
+       .uart_2_mcu_addr = 817,
+       .mcu_2_app_addr = 747,
+       .mcu_2_shp_addr = 961,
+       .ata_2_mcu_addr = 1473,
+       .mcu_2_ata_addr = 1392,
+       .app_2_per_addr = 1033,
+       .app_2_mcu_addr = 683,
+       .shp_2_per_addr = 1251,
+       .shp_2_mcu_addr = 892,
+};
+
+static struct sdma_platform_data imx51_sdma_pdata __initdata = {
+       .sdma_version = 2,
+       .fw_name = "sdma-imx51.bin",
+       .script_addrs = &imx51_sdma_script,
+};
+
+static struct sdma_script_start_addrs imx53_sdma_script __initdata = {
+       .ap_2_ap_addr = 642,
+       .app_2_mcu_addr = 683,
+       .mcu_2_app_addr = 747,
+       .uart_2_mcu_addr = 817,
+       .shp_2_mcu_addr = 891,
+       .mcu_2_shp_addr = 960,
+       .uartsh_2_mcu_addr = 1032,
+       .spdif_2_mcu_addr = 1100,
+       .mcu_2_spdif_addr = 1134,
+       .firi_2_mcu_addr = 1193,
+       .mcu_2_firi_addr = 1290,
+};
+
+static struct sdma_platform_data imx53_sdma_pdata __initdata = {
+       .sdma_version = 2,
+       .fw_name = "sdma-imx53.bin",
+       .script_addrs = &imx53_sdma_script,
+};
+
+void __init imx51_soc_init(void)
+{
+       mxc_register_gpio(0, MX51_GPIO1_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO1_LOW, MX51_MXC_INT_GPIO1_HIGH);
+       mxc_register_gpio(1, MX51_GPIO2_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO2_LOW, MX51_MXC_INT_GPIO2_HIGH);
+       mxc_register_gpio(2, MX51_GPIO3_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO3_LOW, MX51_MXC_INT_GPIO3_HIGH);
+       mxc_register_gpio(3, MX51_GPIO4_BASE_ADDR, SZ_16K, MX51_MXC_INT_GPIO4_LOW, MX51_MXC_INT_GPIO4_HIGH);
+
+       imx_add_imx_sdma(MX51_SDMA_BASE_ADDR, MX51_INT_SDMA, &imx51_sdma_pdata);
+}
+
+void __init imx53_soc_init(void)
+{
+       mxc_register_gpio(0, MX53_GPIO1_BASE_ADDR, SZ_16K, MX53_INT_GPIO1_LOW, MX53_INT_GPIO1_HIGH);
+       mxc_register_gpio(1, MX53_GPIO2_BASE_ADDR, SZ_16K, MX53_INT_GPIO2_LOW, MX53_INT_GPIO2_HIGH);
+       mxc_register_gpio(2, MX53_GPIO3_BASE_ADDR, SZ_16K, MX53_INT_GPIO3_LOW, MX53_INT_GPIO3_HIGH);
+       mxc_register_gpio(3, MX53_GPIO4_BASE_ADDR, SZ_16K, MX53_INT_GPIO4_LOW, MX53_INT_GPIO4_HIGH);
+       mxc_register_gpio(4, MX53_GPIO5_BASE_ADDR, SZ_16K, MX53_INT_GPIO5_LOW, MX53_INT_GPIO5_HIGH);
+       mxc_register_gpio(5, MX53_GPIO6_BASE_ADDR, SZ_16K, MX53_INT_GPIO6_LOW, MX53_INT_GPIO6_HIGH);
+       mxc_register_gpio(6, MX53_GPIO7_BASE_ADDR, SZ_16K, MX53_INT_GPIO7_LOW, MX53_INT_GPIO7_HIGH);
+
+       imx_add_imx_sdma(MX53_SDMA_BASE_ADDR, MX53_INT_SDMA, &imx53_sdma_pdata);
 }
diff --git a/arch/arm/mach-mx5/pm-imx5.c b/arch/arm/mach-mx5/pm-imx5.c
new file mode 100644 (file)
index 0000000..e4529af
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ *  Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+#include <linux/suspend.h>
+#include <linux/clk.h>
+#include <linux/io.h>
+#include <linux/err.h>
+#include <asm/cacheflush.h>
+#include <asm/tlbflush.h>
+#include <mach/system.h>
+#include "crm_regs.h"
+
+static struct clk *gpc_dvfs_clk;
+
+static int mx5_suspend_enter(suspend_state_t state)
+{
+       clk_enable(gpc_dvfs_clk);
+       switch (state) {
+       case PM_SUSPEND_MEM:
+               mx5_cpu_lp_set(STOP_POWER_OFF);
+               break;
+       case PM_SUSPEND_STANDBY:
+               mx5_cpu_lp_set(WAIT_UNCLOCKED_POWER_OFF);
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       if (state == PM_SUSPEND_MEM) {
+               local_flush_tlb_all();
+               flush_cache_all();
+
+               /*clear the EMPGC0/1 bits */
+               __raw_writel(0, MXC_SRPG_EMPGC0_SRPGCR);
+               __raw_writel(0, MXC_SRPG_EMPGC1_SRPGCR);
+       }
+       cpu_do_idle();
+       clk_disable(gpc_dvfs_clk);
+
+       return 0;
+}
+
+static int mx5_pm_valid(suspend_state_t state)
+{
+       return (state > PM_SUSPEND_ON && state <= PM_SUSPEND_MAX);
+}
+
+static const struct platform_suspend_ops mx5_suspend_ops = {
+       .valid = mx5_pm_valid,
+       .enter = mx5_suspend_enter,
+};
+
+static int __init mx5_pm_init(void)
+{
+       if (gpc_dvfs_clk == NULL)
+               gpc_dvfs_clk = clk_get(NULL, "gpc_dvfs");
+
+       if (!IS_ERR(gpc_dvfs_clk)) {
+               if (cpu_is_mx51())
+                       suspend_set_ops(&mx5_suspend_ops);
+       } else
+               return -EPERM;
+
+       return 0;
+}
+device_initcall(mx5_pm_init);
index f114960622e05079a1b2f9ddaaffbbd7b6c30fc5..4cd0231ee539ead25f0728fa8572fc1070fa5e60 100644 (file)
@@ -41,6 +41,7 @@ config MACH_MX23EVK
 config MACH_MX28EVK
        bool "Support MX28EVK Platform"
        select SOC_IMX28
+       select LEDS_GPIO_REGISTER
        select MXS_HAVE_AMBA_DUART
        select MXS_HAVE_PLATFORM_AUART
        select MXS_HAVE_PLATFORM_FEC
@@ -55,10 +56,12 @@ config MACH_MX28EVK
 config MODULE_TX28
        bool
        select SOC_IMX28
+       select LEDS_GPIO_REGISTER
        select MXS_HAVE_AMBA_DUART
        select MXS_HAVE_PLATFORM_AUART
        select MXS_HAVE_PLATFORM_FEC
        select MXS_HAVE_PLATFORM_MXS_I2C
+       select MXS_HAVE_PLATFORM_MXS_MMC
        select MXS_HAVE_PLATFORM_MXS_PWM
 
 config MACH_TX28
index 58e892376bf2b10cd2e00fa3ba885987549ffce7..6c38262a3aaa35fb1313c9b29a528e99e08de6a6 100644 (file)
@@ -1,5 +1,5 @@
 # Common support
-obj-y := clock.o devices.o gpio.o icoll.o iomux.o system.o timer.o
+obj-y := clock.o devices.o icoll.o iomux.o system.o timer.o
 
 obj-$(CONFIG_MXS_OCOTP) += ocotp.o
 obj-$(CONFIG_PM) += pm.o
index cfdb6b284702d75fb38cbf79fd97b4331ee46600..fe3e847930c9ff514fb3ca735e6c9a6530986246 100644 (file)
@@ -88,3 +88,14 @@ int __init mxs_add_amba_device(const struct amba_device *dev)
 
        return amba_device_register(adev, &iomem_resource);
 }
+
+struct device mxs_apbh_bus = {
+       .init_name      = "mxs_apbh",
+       .parent         = &platform_bus,
+};
+
+static int __init mxs_device_init(void)
+{
+       return device_register(&mxs_apbh_bus);
+}
+core_initcall(mxs_device_init);
index 324f2824d38d8e2d931a9769de4a8cc312d4744a..351915c683ffa0d749053012a68240541120abc6 100644 (file)
@@ -6,4 +6,5 @@ obj-$(CONFIG_MXS_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o
 obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_I2C) += platform-mxs-i2c.o
 obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_MMC) += platform-mxs-mmc.o
 obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_PWM) += platform-mxs-pwm.o
+obj-y += platform-gpio-mxs.o
 obj-$(CONFIG_MXS_HAVE_PLATFORM_MXSFB) += platform-mxsfb.o
diff --git a/arch/arm/mach-mxs/devices/platform-gpio-mxs.c b/arch/arm/mach-mxs/devices/platform-gpio-mxs.c
new file mode 100644 (file)
index 0000000..ed0885e
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
+ *
+ * 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/compiler.h>
+#include <linux/err.h>
+#include <linux/init.h>
+
+#include <mach/mx23.h>
+#include <mach/mx28.h>
+#include <mach/devices-common.h>
+
+struct platform_device *__init mxs_add_gpio(
+       int id, resource_size_t iobase, int irq)
+{
+       struct resource res[] = {
+               {
+                       .start = iobase,
+                       .end = iobase + SZ_8K - 1,
+                       .flags = IORESOURCE_MEM,
+               }, {
+                       .start = irq,
+                       .end = irq,
+                       .flags = IORESOURCE_IRQ,
+               },
+       };
+
+       return platform_device_register_resndata(&mxs_apbh_bus,
+                       "gpio-mxs", id, res, ARRAY_SIZE(res), NULL, 0);
+}
+
+static int __init mxs_add_mxs_gpio(void)
+{
+       if (cpu_is_mx23()) {
+               mxs_add_gpio(0, MX23_PINCTRL_BASE_ADDR, MX23_INT_GPIO0);
+               mxs_add_gpio(1, MX23_PINCTRL_BASE_ADDR, MX23_INT_GPIO1);
+               mxs_add_gpio(2, MX23_PINCTRL_BASE_ADDR, MX23_INT_GPIO2);
+       }
+
+       if (cpu_is_mx28()) {
+               mxs_add_gpio(0, MX28_PINCTRL_BASE_ADDR, MX28_INT_GPIO0);
+               mxs_add_gpio(1, MX28_PINCTRL_BASE_ADDR, MX28_INT_GPIO1);
+               mxs_add_gpio(2, MX28_PINCTRL_BASE_ADDR, MX28_INT_GPIO2);
+               mxs_add_gpio(3, MX28_PINCTRL_BASE_ADDR, MX28_INT_GPIO3);
+               mxs_add_gpio(4, MX28_PINCTRL_BASE_ADDR, MX28_INT_GPIO4);
+       }
+
+       return 0;
+}
+postcore_initcall(mxs_add_mxs_gpio);
index bf72c9b8dbdd19736b1f9090eafc479b0052bfdb..5a75b7180f74b616939b30c0aeeaa7c3f987f847 100644 (file)
@@ -5,6 +5,7 @@
  * the terms of the GNU General Public License version 2 as published by the
  * Free Software Foundation.
  */
+#include <linux/dma-mapping.h>
 #include <asm/sizes.h>
 #include <mach/mx23.h>
 #include <mach/mx28.h>
diff --git a/arch/arm/mach-mxs/gpio.c b/arch/arm/mach-mxs/gpio.c
deleted file mode 100644 (file)
index 2c950fe..0000000
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- * MXC GPIO support. (c) 2008 Daniel Mack <daniel@caiaq.de>
- * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
- *
- * Based on code from Freescale,
- * Copyright (C) 2004-2010 Freescale Semiconductor, Inc. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA  02110-1301, USA.
- */
-
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/io.h>
-#include <linux/irq.h>
-#include <linux/gpio.h>
-#include <mach/mx23.h>
-#include <mach/mx28.h>
-#include <asm-generic/bug.h>
-
-#include "gpio.h"
-
-static struct mxs_gpio_port *mxs_gpio_ports;
-static int gpio_table_size;
-
-#define PINCTRL_DOUT(n)                ((cpu_is_mx23() ? 0x0500 : 0x0700) + (n) * 0x10)
-#define PINCTRL_DIN(n)         ((cpu_is_mx23() ? 0x0600 : 0x0900) + (n) * 0x10)
-#define PINCTRL_DOE(n)         ((cpu_is_mx23() ? 0x0700 : 0x0b00) + (n) * 0x10)
-#define PINCTRL_PIN2IRQ(n)     ((cpu_is_mx23() ? 0x0800 : 0x1000) + (n) * 0x10)
-#define PINCTRL_IRQEN(n)       ((cpu_is_mx23() ? 0x0900 : 0x1100) + (n) * 0x10)
-#define PINCTRL_IRQLEV(n)      ((cpu_is_mx23() ? 0x0a00 : 0x1200) + (n) * 0x10)
-#define PINCTRL_IRQPOL(n)      ((cpu_is_mx23() ? 0x0b00 : 0x1300) + (n) * 0x10)
-#define PINCTRL_IRQSTAT(n)     ((cpu_is_mx23() ? 0x0c00 : 0x1400) + (n) * 0x10)
-
-#define GPIO_INT_FALL_EDGE     0x0
-#define GPIO_INT_LOW_LEV       0x1
-#define GPIO_INT_RISE_EDGE     0x2
-#define GPIO_INT_HIGH_LEV      0x3
-#define GPIO_INT_LEV_MASK      (1 << 0)
-#define GPIO_INT_POL_MASK      (1 << 1)
-
-/* Note: This driver assumes 32 GPIOs are handled in one register */
-
-static void clear_gpio_irqstatus(struct mxs_gpio_port *port, u32 index)
-{
-       __mxs_clrl(1 << index, port->base + PINCTRL_IRQSTAT(port->id));
-}
-
-static void set_gpio_irqenable(struct mxs_gpio_port *port, u32 index,
-                               int enable)
-{
-       if (enable) {
-               __mxs_setl(1 << index, port->base + PINCTRL_IRQEN(port->id));
-               __mxs_setl(1 << index, port->base + PINCTRL_PIN2IRQ(port->id));
-       } else {
-               __mxs_clrl(1 << index, port->base + PINCTRL_IRQEN(port->id));
-       }
-}
-
-static void mxs_gpio_ack_irq(struct irq_data *d)
-{
-       u32 gpio = irq_to_gpio(d->irq);
-       clear_gpio_irqstatus(&mxs_gpio_ports[gpio / 32], gpio & 0x1f);
-}
-
-static void mxs_gpio_mask_irq(struct irq_data *d)
-{
-       u32 gpio = irq_to_gpio(d->irq);
-       set_gpio_irqenable(&mxs_gpio_ports[gpio / 32], gpio & 0x1f, 0);
-}
-
-static void mxs_gpio_unmask_irq(struct irq_data *d)
-{
-       u32 gpio = irq_to_gpio(d->irq);
-       set_gpio_irqenable(&mxs_gpio_ports[gpio / 32], gpio & 0x1f, 1);
-}
-
-static int mxs_gpio_get(struct gpio_chip *chip, unsigned offset);
-
-static int mxs_gpio_set_irq_type(struct irq_data *d, unsigned int type)
-{
-       u32 gpio = irq_to_gpio(d->irq);
-       u32 pin_mask = 1 << (gpio & 31);
-       struct mxs_gpio_port *port = &mxs_gpio_ports[gpio / 32];
-       void __iomem *pin_addr;
-       int edge;
-
-       switch (type) {
-       case IRQ_TYPE_EDGE_RISING:
-               edge = GPIO_INT_RISE_EDGE;
-               break;
-       case IRQ_TYPE_EDGE_FALLING:
-               edge = GPIO_INT_FALL_EDGE;
-               break;
-       case IRQ_TYPE_LEVEL_LOW:
-               edge = GPIO_INT_LOW_LEV;
-               break;
-       case IRQ_TYPE_LEVEL_HIGH:
-               edge = GPIO_INT_HIGH_LEV;
-               break;
-       default:
-               return -EINVAL;
-       }
-
-       /* set level or edge */
-       pin_addr = port->base + PINCTRL_IRQLEV(port->id);
-       if (edge & GPIO_INT_LEV_MASK)
-               __mxs_setl(pin_mask, pin_addr);
-       else
-               __mxs_clrl(pin_mask, pin_addr);
-
-       /* set polarity */
-       pin_addr = port->base + PINCTRL_IRQPOL(port->id);
-       if (edge & GPIO_INT_POL_MASK)
-               __mxs_setl(pin_mask, pin_addr);
-       else
-               __mxs_clrl(pin_mask, pin_addr);
-
-       clear_gpio_irqstatus(port, gpio & 0x1f);
-
-       return 0;
-}
-
-/* MXS has one interrupt *per* gpio port */
-static void mxs_gpio_irq_handler(u32 irq, struct irq_desc *desc)
-{
-       u32 irq_stat;
-       struct mxs_gpio_port *port = (struct mxs_gpio_port *)irq_get_handler_data(irq);
-       u32 gpio_irq_no_base = port->virtual_irq_start;
-
-       desc->irq_data.chip->irq_ack(&desc->irq_data);
-
-       irq_stat = __raw_readl(port->base + PINCTRL_IRQSTAT(port->id)) &
-                       __raw_readl(port->base + PINCTRL_IRQEN(port->id));
-
-       while (irq_stat != 0) {
-               int irqoffset = fls(irq_stat) - 1;
-               generic_handle_irq(gpio_irq_no_base + irqoffset);
-               irq_stat &= ~(1 << irqoffset);
-       }
-}
-
-/*
- * Set interrupt number "irq" in the GPIO as a wake-up source.
- * While system is running, all registered GPIO interrupts need to have
- * wake-up enabled. When system is suspended, only selected GPIO interrupts
- * need to have wake-up enabled.
- * @param  irq          interrupt source number
- * @param  enable       enable as wake-up if equal to non-zero
- * @return       This function returns 0 on success.
- */
-static int mxs_gpio_set_wake_irq(struct irq_data *d, unsigned int enable)
-{
-       u32 gpio = irq_to_gpio(d->irq);
-       u32 gpio_idx = gpio & 0x1f;
-       struct mxs_gpio_port *port = &mxs_gpio_ports[gpio / 32];
-
-       if (enable) {
-               if (port->irq_high && (gpio_idx >= 16))
-                       enable_irq_wake(port->irq_high);
-               else
-                       enable_irq_wake(port->irq);
-       } else {
-               if (port->irq_high && (gpio_idx >= 16))
-                       disable_irq_wake(port->irq_high);
-               else
-                       disable_irq_wake(port->irq);
-       }
-
-       return 0;
-}
-
-static struct irq_chip gpio_irq_chip = {
-       .name = "mxs gpio",
-       .irq_ack = mxs_gpio_ack_irq,
-       .irq_mask = mxs_gpio_mask_irq,
-       .irq_unmask = mxs_gpio_unmask_irq,
-       .irq_set_type = mxs_gpio_set_irq_type,
-       .irq_set_wake = mxs_gpio_set_wake_irq,
-};
-
-static void mxs_set_gpio_direction(struct gpio_chip *chip, unsigned offset,
-                               int dir)
-{
-       struct mxs_gpio_port *port =
-               container_of(chip, struct mxs_gpio_port, chip);
-       void __iomem *pin_addr = port->base + PINCTRL_DOE(port->id);
-
-       if (dir)
-               __mxs_setl(1 << offset, pin_addr);
-       else
-               __mxs_clrl(1 << offset, pin_addr);
-}
-
-static int mxs_gpio_get(struct gpio_chip *chip, unsigned offset)
-{
-       struct mxs_gpio_port *port =
-               container_of(chip, struct mxs_gpio_port, chip);
-
-       return (__raw_readl(port->base + PINCTRL_DIN(port->id)) >> offset) & 1;
-}
-
-static void mxs_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
-{
-       struct mxs_gpio_port *port =
-               container_of(chip, struct mxs_gpio_port, chip);
-       void __iomem *pin_addr = port->base + PINCTRL_DOUT(port->id);
-
-       if (value)
-               __mxs_setl(1 << offset, pin_addr);
-       else
-               __mxs_clrl(1 << offset, pin_addr);
-}
-
-static int mxs_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
-{
-       struct mxs_gpio_port *port =
-               container_of(chip, struct mxs_gpio_port, chip);
-
-       return port->virtual_irq_start + offset;
-}
-
-static int mxs_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
-{
-       mxs_set_gpio_direction(chip, offset, 0);
-       return 0;
-}
-
-static int mxs_gpio_direction_output(struct gpio_chip *chip,
-                                    unsigned offset, int value)
-{
-       mxs_gpio_set(chip, offset, value);
-       mxs_set_gpio_direction(chip, offset, 1);
-       return 0;
-}
-
-int __init mxs_gpio_init(struct mxs_gpio_port *port, int cnt)
-{
-       int i, j;
-
-       /* save for local usage */
-       mxs_gpio_ports = port;
-       gpio_table_size = cnt;
-
-       pr_info("MXS GPIO hardware\n");
-
-       for (i = 0; i < cnt; i++) {
-               /* disable the interrupt and clear the status */
-               __raw_writel(0, port[i].base + PINCTRL_PIN2IRQ(i));
-               __raw_writel(0, port[i].base + PINCTRL_IRQEN(i));
-
-               /* clear address has to be used to clear IRQSTAT bits */
-               __mxs_clrl(~0U, port[i].base + PINCTRL_IRQSTAT(i));
-
-               for (j = port[i].virtual_irq_start;
-                       j < port[i].virtual_irq_start + 32; j++) {
-                       irq_set_chip_and_handler(j, &gpio_irq_chip,
-                                                handle_level_irq);
-                       set_irq_flags(j, IRQF_VALID);
-               }
-
-               /* setup one handler for each entry */
-               irq_set_chained_handler(port[i].irq, mxs_gpio_irq_handler);
-               irq_set_handler_data(port[i].irq, &port[i]);
-
-               /* register gpio chip */
-               port[i].chip.direction_input = mxs_gpio_direction_input;
-               port[i].chip.direction_output = mxs_gpio_direction_output;
-               port[i].chip.get = mxs_gpio_get;
-               port[i].chip.set = mxs_gpio_set;
-               port[i].chip.to_irq = mxs_gpio_to_irq;
-               port[i].chip.base = i * 32;
-               port[i].chip.ngpio = 32;
-
-               /* its a serious configuration bug when it fails */
-               BUG_ON(gpiochip_add(&port[i].chip) < 0);
-       }
-
-       return 0;
-}
-
-#define MX23_GPIO_BASE MX23_IO_ADDRESS(MX23_PINCTRL_BASE_ADDR)
-#define MX28_GPIO_BASE MX28_IO_ADDRESS(MX28_PINCTRL_BASE_ADDR)
-
-#define DEFINE_MXS_GPIO_PORT(_base, _irq, _id)                         \
-       {                                                               \
-               .chip.label = "gpio-" #_id,                             \
-               .id = _id,                                              \
-               .irq = _irq,                                            \
-               .base = _base,                                          \
-               .virtual_irq_start = MXS_GPIO_IRQ_START + (_id) * 32,   \
-       }
-
-#ifdef CONFIG_SOC_IMX23
-static struct mxs_gpio_port mx23_gpio_ports[] = {
-       DEFINE_MXS_GPIO_PORT(MX23_GPIO_BASE, MX23_INT_GPIO0, 0),
-       DEFINE_MXS_GPIO_PORT(MX23_GPIO_BASE, MX23_INT_GPIO1, 1),
-       DEFINE_MXS_GPIO_PORT(MX23_GPIO_BASE, MX23_INT_GPIO2, 2),
-};
-
-int __init mx23_register_gpios(void)
-{
-       return mxs_gpio_init(mx23_gpio_ports, ARRAY_SIZE(mx23_gpio_ports));
-}
-#endif
-
-#ifdef CONFIG_SOC_IMX28
-static struct mxs_gpio_port mx28_gpio_ports[] = {
-       DEFINE_MXS_GPIO_PORT(MX28_GPIO_BASE, MX28_INT_GPIO0, 0),
-       DEFINE_MXS_GPIO_PORT(MX28_GPIO_BASE, MX28_INT_GPIO1, 1),
-       DEFINE_MXS_GPIO_PORT(MX28_GPIO_BASE, MX28_INT_GPIO2, 2),
-       DEFINE_MXS_GPIO_PORT(MX28_GPIO_BASE, MX28_INT_GPIO3, 3),
-       DEFINE_MXS_GPIO_PORT(MX28_GPIO_BASE, MX28_INT_GPIO4, 4),
-};
-
-int __init mx28_register_gpios(void)
-{
-       return mxs_gpio_init(mx28_gpio_ports, ARRAY_SIZE(mx28_gpio_ports));
-}
-#endif
diff --git a/arch/arm/mach-mxs/gpio.h b/arch/arm/mach-mxs/gpio.h
deleted file mode 100644 (file)
index 005bb06..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 2007 Freescale Semiconductor, Inc. All Rights Reserved.
- * Copyright 2008 Juergen Beisert, kernel@pengutronix.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.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA  02110-1301, USA.
- */
-
-#ifndef __MXS_GPIO_H__
-#define __MXS_GPIO_H__
-
-struct mxs_gpio_port {
-       void __iomem *base;
-       int id;
-       int irq;
-       int irq_high;
-       int virtual_irq_start;
-       struct gpio_chip chip;
-};
-
-int mxs_gpio_init(struct mxs_gpio_port*, int);
-
-#endif /* __MXS_GPIO_H__ */
index 7a37469ed5bf37baa3bd4908f99be3a6dd79ef34..812d7a813a780d8a0f75ea8170290a666b89ff41 100644 (file)
@@ -11,6 +11,8 @@
 #include <linux/init.h>
 #include <linux/amba/bus.h>
 
+extern struct device mxs_apbh_bus;
+
 struct platform_device *mxs_add_platform_device_dmamask(
                const char *name, int id,
                const struct resource *res, unsigned int num_resources,
index eacdc6b0e70abeb497e542d1084031b0a3d5da07..eaaf6ff289905501fffb048fb1aa0e3a4850b48d 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/delay.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
+#include <linux/leds.h>
 #include <linux/irq.h>
 #include <linux/clk.h>
 
 #include <mach/iomux-mx28.h>
 
 #include "devices-mx28.h"
-#include "gpio.h"
 
 #define MX28EVK_FLEXCAN_SWITCH MXS_GPIO_NR(2, 13)
 #define MX28EVK_FEC_PHY_POWER  MXS_GPIO_NR(2, 15)
+#define MX28EVK_GPIO_LED       MXS_GPIO_NR(3, 5)
 #define MX28EVK_BL_ENABLE      MXS_GPIO_NR(3, 18)
 #define MX28EVK_LCD_ENABLE     MXS_GPIO_NR(3, 30)
 #define MX28EVK_FEC_PHY_RESET  MXS_GPIO_NR(4, 13)
@@ -179,6 +180,23 @@ static const iomux_cfg_t mx28evk_pads[] __initconst = {
        /* slot power enable */
        MX28_PAD_PWM4__GPIO_3_29 |
                (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
+
+       /* led */
+       MX28_PAD_AUART1_TX__GPIO_3_5 | MXS_PAD_CTRL,
+};
+
+/* led */
+static const struct gpio_led mx28evk_leds[] __initconst = {
+       {
+               .name = "GPIO-LED",
+               .default_trigger = "heartbeat",
+               .gpio = MX28EVK_GPIO_LED,
+       },
+};
+
+static const struct gpio_led_platform_data mx28evk_led_data __initconst = {
+       .leds = mx28evk_leds,
+       .num_leds = ARRAY_SIZE(mx28evk_leds),
 };
 
 /* fec */
@@ -386,6 +404,8 @@ static void __init mx28evk_init(void)
        if (ret)
                pr_warn("failed to request gpio mmc1-slot-power: %d\n", ret);
        mx28_add_mxs_mmc(1, &mx28evk_mmc_pdata[1]);
+
+       gpio_led_register_device(0, &mx28evk_led_data);
 }
 
 static void __init mx28evk_timer_init(void)
index b65e3719cbc4ae1cf43fe40ba253b581eb121d85..515a423f82cd22fc26e3d0a3ae4c176b3fbcdb7e 100644 (file)
@@ -101,14 +101,6 @@ static const iomux_cfg_t tx28_stk5v3_pads[] __initconst = {
                (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
        MX28_PAD_SSP0_DATA3__SSP0_D3 |
                (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
-       MX28_PAD_SSP0_DATA4__SSP0_D4 |
-               (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
-       MX28_PAD_SSP0_DATA5__SSP0_D5 |
-               (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
-       MX28_PAD_SSP0_DATA6__SSP0_D6 |
-               (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
-       MX28_PAD_SSP0_DATA7__SSP0_D7 |
-               (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
        MX28_PAD_SSP0_CMD__SSP0_CMD |
                (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
        MX28_PAD_SSP0_DETECT__SSP0_CARD_DETECT |
@@ -117,7 +109,7 @@ static const iomux_cfg_t tx28_stk5v3_pads[] __initconst = {
                (MXS_PAD_12MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
 };
 
-static struct gpio_led tx28_stk5v3_leds[] = {
+static const struct gpio_led tx28_stk5v3_leds[] __initconst = {
        {
                .name = "GPIO-LED",
                .default_trigger = "heartbeat",
@@ -147,6 +139,11 @@ static struct i2c_board_info tx28_stk5v3_i2c_boardinfo[] __initdata = {
        },
 };
 
+static struct mxs_mmc_platform_data tx28_mmc0_pdata __initdata = {
+       .wp_gpio = -EINVAL,
+       .flags = SLOTF_4_BIT_CAPABLE,
+};
+
 static void __init tx28_stk5v3_init(void)
 {
        mxs_iomux_setup_multiple_pads(tx28_stk5v3_pads,
@@ -159,11 +156,11 @@ static void __init tx28_stk5v3_init(void)
        /* spi via ssp will be added when available */
        spi_register_board_info(tx28_spi_board_info,
                        ARRAY_SIZE(tx28_spi_board_info));
-       mxs_add_platform_device("leds-gpio", 0, NULL, 0,
-                       &tx28_stk5v3_led_data, sizeof(tx28_stk5v3_led_data));
+       gpio_led_register_device(0, &tx28_stk5v3_led_data);
        mx28_add_mxs_i2c(0);
        i2c_register_board_info(0, tx28_stk5v3_i2c_boardinfo,
                        ARRAY_SIZE(tx28_stk5v3_i2c_boardinfo));
+       mx28_add_mxs_mmc(0, &tx28_mmc0_pdata);
 }
 
 static void __init tx28_timer_init(void)
index 5148cd64a6b7b0ea0779c8ab76d3295570b6882c..1b2345ac1a878f47ca195556acd3e14de56ca03f 100644 (file)
@@ -41,5 +41,4 @@ void __init mx23_map_io(void)
 void __init mx23_init_irq(void)
 {
        icoll_init_irq();
-       mx23_register_gpios();
 }
index 7e4cea32ebc64ee46e07e53125b00e6c9d1ea017..b6e18ddb92c02dc92806f07501056ad221bfb303 100644 (file)
@@ -41,5 +41,4 @@ void __init mx28_map_io(void)
 void __init mx28_init_irq(void)
 {
        icoll_init_irq();
-       mx28_register_gpios();
 }
index de88c9297b68bc4f014076bf444196549d7893ef..f49ce85d2448eab2a65b8875045504d5b9c44d98 100644 (file)
@@ -215,7 +215,7 @@ static struct omap_kp_platform_data ams_delta_kp_data __initdata = {
        .delay          = 9,
 };
 
-static struct platform_device ams_delta_kp_device __initdata = {
+static struct platform_device ams_delta_kp_device = {
        .name           = "omap-keypad",
        .id             = -1,
        .dev            = {
@@ -225,12 +225,12 @@ static struct platform_device ams_delta_kp_device __initdata = {
        .resource       = ams_delta_kp_resources,
 };
 
-static struct platform_device ams_delta_lcd_device __initdata = {
+static struct platform_device ams_delta_lcd_device = {
        .name   = "lcd_ams_delta",
        .id     = -1,
 };
 
-static struct platform_device ams_delta_led_device __initdata = {
+static struct platform_device ams_delta_led_device = {
        .name   = "ams-delta-led",
        .id     = -1
 };
@@ -267,7 +267,7 @@ static struct soc_camera_link ams_delta_iclink = {
        .power          = ams_delta_camera_power,
 };
 
-static struct platform_device ams_delta_camera_device __initdata = {
+static struct platform_device ams_delta_camera_device = {
        .name   = "soc-camera-pdrv",
        .id     = 0,
        .dev    = {
index 04c4b04cf54eba1a72c08a42d3bc96e53dbb5a1f..364137c2042c71a93f64ceab30ba65ee3fbadaa8 100644 (file)
@@ -41,7 +41,7 @@ static struct __initdata omap_gpio_platform_data omap15xx_mpu_gpio_config = {
        .bank_stride            = 1,
 };
 
-static struct __initdata platform_device omap15xx_mpu_gpio = {
+static struct platform_device omap15xx_mpu_gpio = {
        .name           = "omap_gpio",
        .id             = 0,
        .dev            = {
@@ -70,7 +70,7 @@ static struct __initdata omap_gpio_platform_data omap15xx_gpio_config = {
        .bank_width             = 16,
 };
 
-static struct __initdata platform_device omap15xx_gpio = {
+static struct platform_device omap15xx_gpio = {
        .name           = "omap_gpio",
        .id             = 1,
        .dev            = {
index 5dd0d4c82b247601fd8ceafbb690df17d236f600..293a246e2824a4c1c4d47971e5cd713b530c2e7c 100644 (file)
@@ -44,7 +44,7 @@ static struct __initdata omap_gpio_platform_data omap16xx_mpu_gpio_config = {
        .bank_stride            = 1,
 };
 
-static struct __initdata platform_device omap16xx_mpu_gpio = {
+static struct platform_device omap16xx_mpu_gpio = {
        .name           = "omap_gpio",
        .id             = 0,
        .dev            = {
@@ -73,7 +73,7 @@ static struct __initdata omap_gpio_platform_data omap16xx_gpio1_config = {
        .bank_width             = 16,
 };
 
-static struct __initdata platform_device omap16xx_gpio1 = {
+static struct platform_device omap16xx_gpio1 = {
        .name           = "omap_gpio",
        .id             = 1,
        .dev            = {
@@ -102,7 +102,7 @@ static struct __initdata omap_gpio_platform_data omap16xx_gpio2_config = {
        .bank_width             = 16,
 };
 
-static struct __initdata platform_device omap16xx_gpio2 = {
+static struct platform_device omap16xx_gpio2 = {
        .name           = "omap_gpio",
        .id             = 2,
        .dev            = {
@@ -131,7 +131,7 @@ static struct __initdata omap_gpio_platform_data omap16xx_gpio3_config = {
        .bank_width             = 16,
 };
 
-static struct __initdata platform_device omap16xx_gpio3 = {
+static struct platform_device omap16xx_gpio3 = {
        .name           = "omap_gpio",
        .id             = 3,
        .dev            = {
@@ -160,7 +160,7 @@ static struct __initdata omap_gpio_platform_data omap16xx_gpio4_config = {
        .bank_width             = 16,
 };
 
-static struct __initdata platform_device omap16xx_gpio4 = {
+static struct platform_device omap16xx_gpio4 = {
        .name           = "omap_gpio",
        .id             = 4,
        .dev            = {
index 1204c8b871af505bd2ccc001271bb15f1d87585f..c6ad248d63a6f24524cb9b78709cbf1fc7172ea8 100644 (file)
@@ -46,7 +46,7 @@ static struct __initdata omap_gpio_platform_data omap7xx_mpu_gpio_config = {
        .bank_stride            = 2,
 };
 
-static struct __initdata platform_device omap7xx_mpu_gpio = {
+static struct platform_device omap7xx_mpu_gpio = {
        .name           = "omap_gpio",
        .id             = 0,
        .dev            = {
@@ -75,7 +75,7 @@ static struct __initdata omap_gpio_platform_data omap7xx_gpio1_config = {
        .bank_width             = 32,
 };
 
-static struct __initdata platform_device omap7xx_gpio1 = {
+static struct platform_device omap7xx_gpio1 = {
        .name           = "omap_gpio",
        .id             = 1,
        .dev            = {
@@ -104,7 +104,7 @@ static struct __initdata omap_gpio_platform_data omap7xx_gpio2_config = {
        .bank_width             = 32,
 };
 
-static struct __initdata platform_device omap7xx_gpio2 = {
+static struct platform_device omap7xx_gpio2 = {
        .name           = "omap_gpio",
        .id             = 2,
        .dev            = {
@@ -133,7 +133,7 @@ static struct __initdata omap_gpio_platform_data omap7xx_gpio3_config = {
        .bank_width             = 32,
 };
 
-static struct __initdata platform_device omap7xx_gpio3 = {
+static struct platform_device omap7xx_gpio3 = {
        .name           = "omap_gpio",
        .id             = 3,
        .dev            = {
@@ -162,7 +162,7 @@ static struct __initdata omap_gpio_platform_data omap7xx_gpio4_config = {
        .bank_width             = 32,
 };
 
-static struct __initdata platform_device omap7xx_gpio4 = {
+static struct platform_device omap7xx_gpio4 = {
        .name           = "omap_gpio",
        .id             = 4,
        .dev            = {
@@ -191,7 +191,7 @@ static struct __initdata omap_gpio_platform_data omap7xx_gpio5_config = {
        .bank_width             = 32,
 };
 
-static struct __initdata platform_device omap7xx_gpio5 = {
+static struct platform_device omap7xx_gpio5 = {
        .name           = "omap_gpio",
        .id             = 5,
        .dev            = {
@@ -220,7 +220,7 @@ static struct __initdata omap_gpio_platform_data omap7xx_gpio6_config = {
        .bank_width             = 32,
 };
 
-static struct __initdata platform_device omap7xx_gpio6 = {
+static struct platform_device omap7xx_gpio6 = {
        .name           = "omap_gpio",
        .id             = 6,
        .dev            = {
index 990366726c58f2c2614e43536dc28c5f36b70cbf..88bd6f7705f0317808575cd8ecda856e4e36ec87 100644 (file)
@@ -558,7 +558,7 @@ static struct radio_si4713_platform_data rx51_si4713_data __initdata_or_module =
        .subdev_board_info = &rx51_si4713_board_info,
 };
 
-static struct platform_device rx51_si4713_dev __initdata_or_module = {
+static struct platform_device rx51_si4713_dev = {
        .name   = "radio-si4713",
        .id     = -1,
        .dev    = {
index 810a982a66f8246291ffd8f776c5debb08714bc7..ef3e8b1e06c1400b05328725459af90f2256f1d0 100644 (file)
@@ -825,6 +825,7 @@ MACHINE_START(BALLOON3, "Balloon3")
        .map_io         = balloon3_map_io,
        .nr_irqs        = BALLOON3_NR_IRQS,
        .init_irq       = balloon3_init_irq,
+       .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = balloon3_init,
        .boot_params    = PLAT_PHYS_OFFSET + 0x100,
index 4284513f396a041f7e94556f62a98319a833fc77..648b0ab2bf771a3c3dd4c894866a43659f880966 100644 (file)
@@ -151,6 +151,7 @@ MACHINE_START(CAPC7117,
        .boot_params = 0xa0000100,
        .map_io = pxa3xx_map_io,
        .init_irq = pxa3xx_init_irq,
+       .handle_irq = pxa3xx_handle_irq,
        .timer = &pxa_timer,
        .init_machine = capc7117_init
 MACHINE_END
index d5152220ce947607f072b47ae01d21419170c3b3..4d466102a0272edc5812ec7645d480541c92be37 100644 (file)
@@ -53,6 +53,21 @@ unsigned long clk_get_rate(struct clk *clk)
 }
 EXPORT_SYMBOL(clk_get_rate);
 
+int clk_set_rate(struct clk *clk, unsigned long rate)
+{
+       unsigned long flags;
+       int ret = -EINVAL;
+
+       if (clk->ops->setrate) {
+               spin_lock_irqsave(&clocks_lock, flags);
+               ret = clk->ops->setrate(clk, rate);
+               spin_unlock_irqrestore(&clocks_lock, flags);
+       }
+
+       return ret;
+}
+EXPORT_SYMBOL(clk_set_rate);
+
 void clk_dummy_enable(struct clk *clk)
 {
 }
index 1f2fb9c43f062301ab5dc9595203a94ab4bfada4..3a258b1bf1aa46f39d255cb81a2643b667394192 100644 (file)
@@ -5,6 +5,7 @@ struct clkops {
        void                    (*enable)(struct clk *);
        void                    (*disable)(struct clk *);
        unsigned long           (*getrate)(struct clk *);
+       int                     (*setrate)(struct clk *, unsigned long);
 };
 
 struct clk {
index a1099678247630524da6ab789d4719e87d75ce47..1719927c24d63b575a50beed30746f922004ea24 100644 (file)
@@ -21,7 +21,8 @@
 #include <asm/mach-types.h>
 #include <asm/mach/map.h>
 
-#include <mach/pxa2xx-regs.h>
+#include <mach/pxa25x.h>
+#include <mach/pxa27x.h>
 #include <mach/audio.h>
 #include <mach/pxafb.h>
 #include <mach/smemc.h>
@@ -516,6 +517,8 @@ MACHINE_START(ARMCORE, "Compulab CM-X2XX")
        .map_io         = cmx2xx_map_io,
        .nr_irqs        = CMX2XX_NR_IRQS,
        .init_irq       = cmx2xx_init_irq,
+       /* NOTE: pxa25x_handle_irq() works on PXA27x w/o camera support */
+       .handle_irq     = pxa25x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = cmx2xx_init,
 MACHINE_END
index b2248e76ec8b713b9bf1f8a01ca84aca2e845d9c..de577c7e3acec015a747e70d85eed45276b47546 100644 (file)
@@ -859,6 +859,7 @@ MACHINE_START(CM_X300, "CM-X300 module")
        .boot_params    = 0xa0000100,
        .map_io         = pxa3xx_map_io,
        .init_irq       = pxa3xx_init_irq,
+       .handle_irq     = pxa3xx_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = cm_x300_init,
        .fixup          = cm_x300_fixup,
index 7545a48ed88bf5e66c28ca8c859dfedddda9e7a4..870920934ecfa037d7933776f89ff979c63bd0e8 100644 (file)
@@ -310,6 +310,7 @@ MACHINE_START(COLIBRI, "Toradex Colibri PXA270")
        .init_machine   = colibri_pxa270_init,
        .map_io         = pxa27x_map_io,
        .init_irq       = pxa27x_init_irq,
+       .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
 MACHINE_END
 
@@ -318,6 +319,7 @@ MACHINE_START(INCOME, "Income s.r.o. SH-Dmaster PXA270 SBC")
        .init_machine   = colibri_pxa270_income_init,
        .map_io         = pxa27x_map_io,
        .init_irq       = pxa27x_init_irq,
+       .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
 MACHINE_END
 
index 66dd81cbc8a046bb7b0c94146836e449525b0414..60a6781e7a8ee3422b20207464e39dcf0bd5c4bc 100644 (file)
@@ -187,6 +187,7 @@ MACHINE_START(COLIBRI300, "Toradex Colibri PXA300")
        .init_machine   = colibri_pxa300_init,
        .map_io         = pxa3xx_map_io,
        .init_irq       = pxa3xx_init_irq,
+       .handle_irq     = pxa3xx_handle_irq,
        .timer          = &pxa_timer,
 MACHINE_END
 
index ff9ff5f4fc47e599f409c10935151e65621023e1..d2c6631915d43cd7b66ea923c527f66159d513c5 100644 (file)
@@ -23,8 +23,7 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/irq.h>
 
-#include <mach/pxa3xx-regs.h>
-#include <mach/mfp-pxa320.h>
+#include <mach/pxa320.h>
 #include <mach/colibri.h>
 #include <mach/pxafb.h>
 #include <mach/ohci.h>
@@ -258,6 +257,7 @@ MACHINE_START(COLIBRI320, "Toradex Colibri PXA320")
        .init_machine   = colibri_pxa320_init,
        .map_io         = pxa3xx_map_io,
        .init_irq       = pxa3xx_init_irq,
+       .handle_irq     = pxa3xx_handle_irq,
        .timer          = &pxa_timer,
 MACHINE_END
 
index 3a5507e319197e493b34fb99d62c5f066ce682af..185a37cad25404ac9ad4382f9f53badd597f5a41 100644 (file)
@@ -722,6 +722,7 @@ MACHINE_START(CORGI, "SHARP Corgi")
        .fixup          = fixup_corgi,
        .map_io         = pxa25x_map_io,
        .init_irq       = pxa25x_init_irq,
+       .handle_irq     = pxa25x_handle_irq,
        .init_machine   = corgi_init,
        .timer          = &pxa_timer,
 MACHINE_END
@@ -732,6 +733,7 @@ MACHINE_START(SHEPHERD, "SHARP Shepherd")
        .fixup          = fixup_corgi,
        .map_io         = pxa25x_map_io,
        .init_irq       = pxa25x_init_irq,
+       .handle_irq     = pxa25x_handle_irq,
        .init_machine   = corgi_init,
        .timer          = &pxa_timer,
 MACHINE_END
@@ -742,6 +744,7 @@ MACHINE_START(HUSKY, "SHARP Husky")
        .fixup          = fixup_corgi,
        .map_io         = pxa25x_map_io,
        .init_irq       = pxa25x_init_irq,
+       .handle_irq     = pxa25x_handle_irq,
        .init_machine   = corgi_init,
        .timer          = &pxa_timer,
 MACHINE_END
index 0481c29a70e8b9540f3419a120c4e0ca43724856..fe812eafb1f178a1e33e82d26c3bca23869c38a6 100644 (file)
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <mach/csb726.h>
-#include <mach/mfp-pxa27x.h>
+#include <mach/pxa27x.h>
 #include <mach/mmc.h>
 #include <mach/ohci.h>
-#include <mach/pxa2xx-regs.h>
 #include <mach/audio.h>
 #include <mach/smemc.h>
 
@@ -276,6 +275,7 @@ MACHINE_START(CSB726, "Cogent CSB726")
        .boot_params    = 0xa0000100,
        .map_io         = pxa27x_map_io,
        .init_irq       = pxa27x_init_irq,
+       .handle_irq       = pxa27x_handle_irq,
        .init_machine   = csb726_init,
        .timer          = &pxa_timer,
 MACHINE_END
index f8a6e9d79a3a5362c34ae8fa3c9bd8711a6e9db6..2e37ea52b372139e6abe469cc6727c39f695c049 100644 (file)
@@ -1302,6 +1302,7 @@ MACHINE_START(EM_X270, "Compulab EM-X270")
        .boot_params    = 0xa0000100,
        .map_io         = pxa27x_map_io,
        .init_irq       = pxa27x_init_irq,
+       .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = em_x270_init,
 MACHINE_END
@@ -1310,6 +1311,7 @@ MACHINE_START(EXEDA, "Compulab eXeda")
        .boot_params    = 0xa0000100,
        .map_io         = pxa27x_map_io,
        .init_irq       = pxa27x_init_irq,
+       .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = em_x270_init,
 MACHINE_END
index 2e3970fdde0bf4679bfedc7890d2fdb7f5a62e55..b4599ec9d6195e70eb74e40671290d9e826e3a88 100644 (file)
@@ -193,6 +193,7 @@ MACHINE_START(E330, "Toshiba e330")
        .map_io         = pxa25x_map_io,
        .nr_irqs        = ESERIES_NR_IRQS,
        .init_irq       = pxa25x_init_irq,
+       .handle_irq     = pxa25x_handle_irq,
        .fixup          = eseries_fixup,
        .init_machine   = e330_init,
        .timer          = &pxa_timer,
@@ -242,6 +243,7 @@ MACHINE_START(E350, "Toshiba e350")
        .map_io         = pxa25x_map_io,
        .nr_irqs        = ESERIES_NR_IRQS,
        .init_irq       = pxa25x_init_irq,
+       .handle_irq     = pxa25x_handle_irq,
        .fixup          = eseries_fixup,
        .init_machine   = e350_init,
        .timer          = &pxa_timer,
@@ -364,6 +366,7 @@ MACHINE_START(E400, "Toshiba e400")
        .map_io         = pxa25x_map_io,
        .nr_irqs        = ESERIES_NR_IRQS,
        .init_irq       = pxa25x_init_irq,
+       .handle_irq     = pxa25x_handle_irq,
        .fixup          = eseries_fixup,
        .init_machine   = e400_init,
        .timer          = &pxa_timer,
@@ -552,6 +555,7 @@ MACHINE_START(E740, "Toshiba e740")
        .map_io         = pxa25x_map_io,
        .nr_irqs        = ESERIES_NR_IRQS,
        .init_irq       = pxa25x_init_irq,
+       .handle_irq     = pxa25x_handle_irq,
        .fixup          = eseries_fixup,
        .init_machine   = e740_init,
        .timer          = &pxa_timer,
@@ -743,6 +747,7 @@ MACHINE_START(E750, "Toshiba e750")
        .map_io         = pxa25x_map_io,
        .nr_irqs        = ESERIES_NR_IRQS,
        .init_irq       = pxa25x_init_irq,
+       .handle_irq     = pxa25x_handle_irq,
        .fixup          = eseries_fixup,
        .init_machine   = e750_init,
        .timer          = &pxa_timer,
@@ -947,6 +952,7 @@ MACHINE_START(E800, "Toshiba e800")
        .map_io         = pxa25x_map_io,
        .nr_irqs        = ESERIES_NR_IRQS,
        .init_irq       = pxa25x_init_irq,
+       .handle_irq     = pxa25x_handle_irq,
        .fixup          = eseries_fixup,
        .init_machine   = e800_init,
        .timer          = &pxa_timer,
index d88aed8fbe15c1f96c7156c09cea1781189cf5e3..b73eadb9f5dc0f07638c3ad873157299aef8408d 100644 (file)
@@ -801,6 +801,7 @@ MACHINE_START(EZX_A780, "Motorola EZX A780")
        .map_io         = pxa27x_map_io,
        .nr_irqs        = EZX_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
+       .handle_irq       = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = a780_init,
 MACHINE_END
@@ -866,6 +867,7 @@ MACHINE_START(EZX_E680, "Motorola EZX E680")
        .map_io         = pxa27x_map_io,
        .nr_irqs        = EZX_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
+       .handle_irq       = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = e680_init,
 MACHINE_END
@@ -931,6 +933,7 @@ MACHINE_START(EZX_A1200, "Motorola EZX A1200")
        .map_io         = pxa27x_map_io,
        .nr_irqs        = EZX_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
+       .handle_irq       = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = a1200_init,
 MACHINE_END
@@ -1121,6 +1124,7 @@ MACHINE_START(EZX_A910, "Motorola EZX A910")
        .map_io         = pxa27x_map_io,
        .nr_irqs        = EZX_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
+       .handle_irq       = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = a910_init,
 MACHINE_END
@@ -1186,6 +1190,7 @@ MACHINE_START(EZX_E6, "Motorola EZX E6")
        .map_io         = pxa27x_map_io,
        .nr_irqs        = EZX_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
+       .handle_irq       = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = e6_init,
 MACHINE_END
@@ -1225,6 +1230,7 @@ MACHINE_START(EZX_E2, "Motorola EZX E2")
        .map_io         = pxa27x_map_io,
        .nr_irqs        = EZX_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
+       .handle_irq       = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = e2_init,
 MACHINE_END
index e6c9344a95ae1cb9062fab82415f096f6d96b651..92a2e85ab02cff7d91c182ec47628ff3087e5d65 100644 (file)
@@ -13,21 +13,8 @@ struct irq_data;
 struct sys_timer;
 
 extern struct sys_timer pxa_timer;
-extern void __init pxa_init_irq(int irq_nr,
-                               int (*set_wake)(struct irq_data *,
-                                               unsigned int));
-extern void __init pxa25x_init_irq(void);
-#ifdef CONFIG_CPU_PXA26x
-extern void __init pxa26x_init_irq(void);
-#endif
-extern void __init pxa27x_init_irq(void);
-extern void __init pxa3xx_init_irq(void);
-extern void __init pxa95x_init_irq(void);
 
 extern void __init pxa_map_io(void);
-extern void __init pxa25x_map_io(void);
-extern void __init pxa27x_map_io(void);
-extern void __init pxa3xx_map_io(void);
 
 extern unsigned int get_clk_frequency_khz(int info);
 
index d65e4bde9b917401d8a109642a2faf2ddd737ead..deaa111c91f9dd380a4ca60efb05da38f6ae79c6 100644 (file)
@@ -236,6 +236,7 @@ MACHINE_START(GUMSTIX, "Gumstix")
        .boot_params    = 0xa0000100, /* match u-boot bi_boot_params */
        .map_io         = pxa25x_map_io,
        .init_irq       = pxa25x_init_irq,
+       .handle_irq     = pxa25x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = gumstix_init,
 MACHINE_END
index 657db469de1ff996469ca7e360d548abb4c46666..0a235128914d24f3157df0344d9361c6ec34e50b 100644 (file)
@@ -28,6 +28,7 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
+#include <asm/irq.h>
 
 #include <mach/pxa25x.h>
 #include <mach/h5000.h>
@@ -205,6 +206,7 @@ MACHINE_START(H5400, "HP iPAQ H5000")
        .boot_params = 0xa0000100,
        .map_io = pxa25x_map_io,
        .init_irq = pxa25x_init_irq,
+       .handle_irq = pxa25x_handle_irq,
        .timer = &pxa_timer,
        .init_machine = h5000_init,
 MACHINE_END
index e8603eba54bd508e520ee4f60df00edd3187ed8a..a997d0ab2872b21aa02989c392591b15cc5ae41f 100644 (file)
@@ -24,8 +24,7 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
-#include <mach/mfp-pxa25x.h>
-#include <mach/hardware.h>
+#include <mach/pxa25x.h>
 
 #include "generic.h"
 
@@ -162,6 +161,7 @@ MACHINE_START(HIMALAYA, "HTC Himalaya")
        .boot_params = 0xa0000100,
        .map_io = pxa25x_map_io,
        .init_irq = pxa25x_init_irq,
+       .handle_irq = pxa25x_handle_irq,
        .init_machine = himalaya_init,
        .timer = &pxa_timer,
 MACHINE_END
index f941a495a4a8ed1806a38233ac4236899fee4f34..9a734cb7236e412b5acf27aa30fcdf35dbebcee0 100644 (file)
@@ -874,6 +874,7 @@ MACHINE_START(H4700, "HP iPAQ HX4700")
        .map_io       = pxa27x_map_io,
        .nr_irqs      = HX4700_NR_IRQS,
        .init_irq     = pxa27x_init_irq,
+       .handle_irq     = pxa27x_handle_irq,
        .init_machine = hx4700_init,
        .timer        = &pxa_timer,
 MACHINE_END
index 6cedc81da3bc1b806dd2cec3356d37de0a3c581c..d427429f1f34bdb4d6e1a9be2a72b56a685ee16e 100644 (file)
@@ -194,6 +194,7 @@ MACHINE_START(ICONTROL, "iControl/SafeTcam boards using Embedian MXM-8x10 CoM")
        .boot_params    = 0xa0000100,
        .map_io         = pxa3xx_map_io,
        .init_irq       = pxa3xx_init_irq,
+       .handle_irq     = pxa3xx_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = icontrol_init
 MACHINE_END
index f7fb64f11a7d2ffba1cef682460f1a143945498a..ddf20e5c376ed292a11b7945d5c35dc8ed3ca167 100644 (file)
@@ -196,6 +196,7 @@ MACHINE_START(PXA_IDP, "Vibren PXA255 IDP")
        /* Maintainer: Vibren Technologies */
        .map_io         = idp_map_io,
        .init_irq       = pxa25x_init_irq,
+       .handle_irq     = pxa25x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = idp_init,
 MACHINE_END
index 038402404e3932e78c702181c6d62cd4e4d145a7..7cc5a781e99e4dc6683b16d3ed132645c420126d 100644 (file)
 
 #define NR_IRQS                        (IRQ_BOARD_START)
 
+#ifndef __ASSEMBLY__
+struct irq_data;
+struct pt_regs;
+
+void pxa_mask_irq(struct irq_data *);
+void pxa_unmask_irq(struct irq_data *);
+void icip_handle_irq(struct pt_regs *);
+void ichp_handle_irq(struct pt_regs *);
+
+void pxa_init_irq(int irq_nr, int (*set_wake)(struct irq_data *, unsigned int));
+#endif
+
 #endif /* __ASM_MACH_IRQS_H */
index 508c3ba1f4d011d24ec48103d2d65a15f06d387d..3ac0baac73508bc418fd4493255b51004adff25f 100644 (file)
@@ -4,5 +4,14 @@
 #include <mach/hardware.h>
 #include <mach/pxa2xx-regs.h>
 #include <mach/mfp-pxa25x.h>
+#include <mach/irqs.h>
+
+extern void __init pxa25x_map_io(void);
+extern void __init pxa25x_init_irq(void);
+#ifdef CONFIG_CPU_PXA26x
+extern void __init pxa26x_init_irq(void);
+#endif
+
+#define pxa25x_handle_irq      icip_handle_irq
 
 #endif /* __MACH_PXA25x_H */
index 0b702693f4583eef6088febcc96d50f986f6873e..b9b1bdc4baccdcc4da734089f135106df3750a13 100644 (file)
@@ -4,6 +4,7 @@
 #include <mach/hardware.h>
 #include <mach/pxa2xx-regs.h>
 #include <mach/mfp-pxa27x.h>
+#include <mach/irqs.h>
 
 #define ARB_CNTRL      __REG(0x48000048)  /* Arbiter Control Register */
 
 #define ARB_CORE_PARK          (1<<24)    /* Be parked with core when idle */
 #define ARB_LOCK_FLAG          (1<<23)    /* Only Locking masters gain access to the bus */
 
+extern void __init pxa27x_map_io(void);
+extern void __init pxa27x_init_irq(void);
 extern int __init pxa27x_set_pwrmode(unsigned int mode);
 
+#define pxa27x_handle_irq      ichp_handle_irq
+
 #endif /* __MACH_PXA27x_H */
index 2f33076c9e4813e5e27009007b7b7f1e3f7a24dc..733b6412c3df7ba52e09b9f12683aaa940c6ddf5 100644 (file)
@@ -1,8 +1,7 @@
 #ifndef __MACH_PXA300_H
 #define __MACH_PXA300_H
 
-#include <mach/hardware.h>
-#include <mach/pxa3xx-regs.h>
+#include <mach/pxa3xx.h>
 #include <mach/mfp-pxa300.h>
 
 #endif /* __MACH_PXA300_H */
index cab78e903273e71b95836ec778881a9629b22208..b6204e470d89288d0bde5a2064f9db0e056d3ba9 100644 (file)
@@ -1,8 +1,7 @@
 #ifndef __MACH_PXA320_H
 #define __MACH_PXA320_H
 
-#include <mach/hardware.h>
-#include <mach/pxa3xx-regs.h>
+#include <mach/pxa3xx.h>
 #include <mach/mfp-pxa320.h>
 
 #endif /* __MACH_PXA320_H */
diff --git a/arch/arm/mach-pxa/include/mach/pxa3xx.h b/arch/arm/mach-pxa/include/mach/pxa3xx.h
new file mode 100644 (file)
index 0000000..cd3e57f
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef __MACH_PXA3XX_H        
+#define __MACH_PXA3XX_H
+
+#include <mach/hardware.h>
+#include <mach/pxa3xx-regs.h>
+#include <mach/irqs.h>
+
+extern void __init pxa3xx_map_io(void);
+extern void __init pxa3xx_init_irq(void);
+extern void __init pxa95x_init_irq(void);
+
+#define pxa3xx_handle_irq      ichp_handle_irq
+
+#endif /* __MACH_PXA3XX_H */
index d45f76a9b54ddcd5838fb97f27b63d07611d8ab6..190363b98d01275c0c93cc7daa756e78b2dbb0e3 100644 (file)
@@ -1,8 +1,7 @@
 #ifndef __MACH_PXA930_H
 #define __MACH_PXA930_H
 
-#include <mach/hardware.h>
-#include <mach/pxa3xx-regs.h>
+#include <mach/pxa3xx.h>
 #include <mach/mfp-pxa930.h>
 
 #endif /* __MACH_PXA930_H */
diff --git a/arch/arm/mach-pxa/include/mach/regs-intc.h b/arch/arm/mach-pxa/include/mach/regs-intc.h
deleted file mode 100644 (file)
index 662288e..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef __ASM_MACH_REGS_INTC_H
-#define __ASM_MACH_REGS_INTC_H
-
-#include <mach/hardware.h>
-
-/*
- * Interrupt Controller
- */
-
-#define ICIP           __REG(0x40D00000)  /* Interrupt Controller IRQ Pending Register */
-#define ICMR           __REG(0x40D00004)  /* Interrupt Controller Mask Register */
-#define ICLR           __REG(0x40D00008)  /* Interrupt Controller Level Register */
-#define ICFP           __REG(0x40D0000C)  /* Interrupt Controller FIQ Pending Register */
-#define ICPR           __REG(0x40D00010)  /* Interrupt Controller Pending Register */
-#define ICCR           __REG(0x40D00014)  /* Interrupt Controller Control Register */
-#define ICHP           __REG(0x40D00018)  /* Interrupt Controller Highest Priority Register */
-
-#define ICIP2          __REG(0x40D0009C)  /* Interrupt Controller IRQ Pending Register 2 */
-#define ICMR2          __REG(0x40D000A0)  /* Interrupt Controller Mask Register 2 */
-#define ICLR2          __REG(0x40D000A4)  /* Interrupt Controller Level Register 2 */
-#define ICFP2          __REG(0x40D000A8)  /* Interrupt Controller FIQ Pending Register 2 */
-#define ICPR2          __REG(0x40D000AC)  /* Interrupt Controller Pending Register 2 */
-
-#define ICIP3          __REG(0x40D00130)  /* Interrupt Controller IRQ Pending Register 3 */
-#define ICMR3          __REG(0x40D00134)  /* Interrupt Controller Mask Register 3 */
-#define ICLR3          __REG(0x40D00138)  /* Interrupt Controller Level Register 3 */
-#define ICFP3          __REG(0x40D0013C)  /* Interrupt Controller FIQ Pending Register 3 */
-#define ICPR3          __REG(0x40D00140)  /* Interrupt Controller Pending Register 3 */
-
-#endif /* __ASM_MACH_REGS_INTC_H */
index 32ed551bf9c5d363f8181a590e79157ed002f0c1..b09e848eb6c6f0ae27356dc3feedb8ab790c4835 100644 (file)
@@ -37,6 +37,8 @@
 #define IPR(i)                 (((i) < 32) ? (0x01c + ((i) << 2)) :            \
                                ((i) < 64) ? (0x0b0 + (((i) - 32) << 2)) :      \
                                      (0x144 + (((i) - 64) << 2)))
+#define ICHP_VAL_IRQ           (1 << 31)
+#define ICHP_IRQ(i)            (((i) >> 16) & 0x7fff)
 #define IPR_VALID              (1 << 31)
 #define IRQ_BIT(n)             (((n) - PXA_IRQ(0)) & 0x1f)
 
@@ -64,7 +66,7 @@ static inline void __iomem *irq_base(int i)
        return (void __iomem *)io_p2v(phys_base[i]);
 }
 
-static void pxa_mask_irq(struct irq_data *d)
+void pxa_mask_irq(struct irq_data *d)
 {
        void __iomem *base = irq_data_get_irq_chip_data(d);
        uint32_t icmr = __raw_readl(base + ICMR);
@@ -73,7 +75,7 @@ static void pxa_mask_irq(struct irq_data *d)
        __raw_writel(icmr, base + ICMR);
 }
 
-static void pxa_unmask_irq(struct irq_data *d)
+void pxa_unmask_irq(struct irq_data *d)
 {
        void __iomem *base = irq_data_get_irq_chip_data(d);
        uint32_t icmr = __raw_readl(base + ICMR);
@@ -127,6 +129,36 @@ static struct irq_chip pxa_low_gpio_chip = {
        .irq_set_type   = pxa_set_low_gpio_type,
 };
 
+asmlinkage void __exception_irq_entry icip_handle_irq(struct pt_regs *regs)
+{
+       uint32_t icip, icmr, mask;
+
+       do {
+               icip = __raw_readl(IRQ_BASE + ICIP);
+               icmr = __raw_readl(IRQ_BASE + ICMR);
+               mask = icip & icmr;
+
+               if (mask == 0)
+                       break;
+
+               handle_IRQ(PXA_IRQ(fls(mask) - 1), regs);
+       } while (1);
+}
+
+asmlinkage void __exception_irq_entry ichp_handle_irq(struct pt_regs *regs)
+{
+       uint32_t ichp;
+
+       do {
+               __asm__ __volatile__("mrc p6, 0, %0, c5, c0, 0\n": "=r"(ichp));
+
+               if ((ichp & ICHP_VAL_IRQ) == 0)
+                       break;
+
+               handle_IRQ(PXA_IRQ(ICHP_IRQ(ichp)), regs);
+       } while (1);
+}
+
 static void __init pxa_init_low_gpio_irq(set_wake_t fn)
 {
        int irq;
index e5e326d2cdc981ebf7e08fec2c4aa8fcf62134b3..8f97e15e86e56e1834b3e4ac72254ed87368a0ae 100644 (file)
@@ -441,6 +441,7 @@ MACHINE_START(LITTLETON, "Marvell Form Factor Development Platform (aka Littleto
        .map_io         = pxa3xx_map_io,
        .nr_irqs        = LITTLETON_NR_IRQS,
        .init_irq       = pxa3xx_init_irq,
+       .handle_irq     = pxa3xx_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = littleton_init,
 MACHINE_END
index 6cf8180bf5bdd2de3941009ccf1231fa9fa0d8ac..c171d6ebee49805e1e529e6af8a4d664125cd68d 100644 (file)
@@ -503,6 +503,7 @@ MACHINE_START(LOGICPD_PXA270, "LogicPD PXA270 Card Engine")
        .map_io         = lpd270_map_io,
        .nr_irqs        = LPD270_NR_IRQS,
        .init_irq       = lpd270_init_irq,
+       .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = lpd270_init,
 MACHINE_END
index e10ddb827147940b14d7793942c301e3fe9ea806..a8c696bfc132929bb6256851b6790ec7e11a4afa 100644 (file)
@@ -553,6 +553,7 @@ MACHINE_START(LUBBOCK, "Intel DBPXA250 Development Platform (aka Lubbock)")
        .map_io         = lubbock_map_io,
        .nr_irqs        = LUBBOCK_NR_IRQS,
        .init_irq       = lubbock_init_irq,
+       .handle_irq     = pxa25x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = lubbock_init,
 MACHINE_END
index e1920572948a9b1dcdc0d96a5be03a763f6f2e43..cb3509ee1fe2309b8ece28c3d44241531fd6c83f 100644 (file)
@@ -768,6 +768,7 @@ MACHINE_START(MAGICIAN, "HTC Magician")
        .map_io = pxa27x_map_io,
        .nr_irqs = MAGICIAN_NR_IRQS,
        .init_irq = pxa27x_init_irq,
+       .handle_irq = pxa27x_handle_irq,
        .init_machine = magician_init,
        .timer = &pxa_timer,
 MACHINE_END
index 3479e2b3b51195ee51c40962604aecfc68a35a35..4622eb78ef25172be578f29671476c2840012e50 100644 (file)
@@ -620,6 +620,7 @@ MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)")
        .map_io         = mainstone_map_io,
        .nr_irqs        = MAINSTONE_NR_IRQS,
        .init_irq       = mainstone_init_irq,
+       .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = mainstone_init,
 MACHINE_END
index e3470137c93473a3929d5fb53a7eebb0932b1090..ff92efd65a53221aeac32a1170f85960ea3715cc 100644 (file)
@@ -794,6 +794,7 @@ MACHINE_START(MIOA701, "MIO A701")
        .boot_params    = 0xa0000100,
        .map_io         = &pxa27x_map_io,
        .init_irq       = &pxa27x_init_irq,
+       .handle_irq     = &pxa27x_handle_irq,
        .init_machine   = mioa701_machine_init,
        .timer          = &pxa_timer,
 MACHINE_END
index 59cce78aebd19c1850dcaee97ef610fa3c3331a6..fb408861dbcfeac057bcb26e872318e4cc81c01c 100644 (file)
@@ -96,6 +96,7 @@ MACHINE_START(NEC_MP900, "MobilePro900/C")
        .timer          = &pxa_timer,
        .map_io         = pxa25x_map_io,
        .init_irq       = pxa25x_init_irq,
+       .handle_irq     = pxa25x_handle_irq,
        .init_machine   = mp900c_init,
 MACHINE_END
 
index 4061ecddee70fa02524bede634c451ede4f2d702..6b77365ed93858466f984b6ec57cc095083fc07f 100644 (file)
@@ -345,6 +345,7 @@ MACHINE_START(PALMLD, "Palm LifeDrive")
        .boot_params    = 0xa0000100,
        .map_io         = palmld_map_io,
        .init_irq       = pxa27x_init_irq,
+       .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = palmld_init
 MACHINE_END
index df4d7d009fbbe72bd59e8650e59f8813c8886d2f..9bd3e47486fbe5e6e456d6296f68b522939ff60e 100644 (file)
@@ -206,6 +206,7 @@ MACHINE_START(PALMT5, "Palm Tungsten|T5")
        .map_io         = pxa27x_map_io,
        .reserve        = palmt5_reserve,
        .init_irq       = pxa27x_init_irq,
+       .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = palmt5_init
 MACHINE_END
index fb06bd04727257345f60ed1047b354c65c89e69c..6ad4a6c7bc96bd7591d101f5152cee71ac212839 100644 (file)
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
+#include <mach/pxa25x.h>
 #include <mach/audio.h>
 #include <mach/palmtc.h>
 #include <mach/mmc.h>
 #include <mach/pxafb.h>
-#include <mach/mfp-pxa25x.h>
 #include <mach/irda.h>
 #include <mach/udc.h>
-#include <mach/pxa2xx-regs.h>
 
 #include "generic.h"
 #include "devices.h"
@@ -541,6 +540,7 @@ MACHINE_START(PALMTC, "Palm Tungsten|C")
        .boot_params    = 0xa0000100,
        .map_io         = pxa25x_map_io,
        .init_irq       = pxa25x_init_irq,
+       .handle_irq     = pxa25x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = palmtc_init
 MACHINE_END
index 726f5b98dcd3599f8115f78b5b5d27053862d7c6..664232f3e62c7d24d20cdcb5aca699fba3326729 100644 (file)
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
+#include <mach/pxa25x.h>
 #include <mach/audio.h>
 #include <mach/palmte2.h>
 #include <mach/mmc.h>
 #include <mach/pxafb.h>
-#include <mach/mfp-pxa25x.h>
 #include <mach/irda.h>
 #include <mach/udc.h>
 #include <mach/palmasoc.h>
@@ -359,6 +359,7 @@ MACHINE_START(PALMTE2, "Palm Tungsten|E2")
        .boot_params    = 0xa0000100,
        .map_io         = pxa25x_map_io,
        .init_irq       = pxa25x_init_irq,
+       .handle_irq     = pxa25x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = palmte2_init
 MACHINE_END
index 20d1b18b1733ff5ab37b994264ba01b4bdcf9554..bb27d4b688d876b7ecfb032e1e99e27d0b7f7205 100644 (file)
@@ -444,6 +444,7 @@ MACHINE_START(TREO680, "Palm Treo 680")
        .map_io         = pxa27x_map_io,
        .reserve        = treo_reserve,
        .init_irq       = pxa27x_init_irq,
+       .handle_irq       = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = treo680_init,
 MACHINE_END
@@ -453,6 +454,7 @@ MACHINE_START(CENTRO, "Palm Centro 685")
        .map_io         = pxa27x_map_io,
        .reserve        = treo_reserve,
        .init_irq       = pxa27x_init_irq,
+       .handle_irq       = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = centro_init,
 MACHINE_END
index 595f002066cc0434e734c15831e469acddd9f675..fc4285589c1f1e15922c8c9ed148aba4697fc609 100644 (file)
@@ -367,6 +367,7 @@ MACHINE_START(PALMTX, "Palm T|X")
        .boot_params    = 0xa0000100,
        .map_io         = palmtx_map_io,
        .init_irq       = pxa27x_init_irq,
+       .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = palmtx_init
 MACHINE_END
index 65f24f0b77e85673d7908aec8683debc6110249e..95d71c3a5bae88c3e096fd2fad533eb938336ac3 100644 (file)
@@ -401,6 +401,7 @@ MACHINE_START(PALMZ72, "Palm Zire72")
        .boot_params    = 0xa0000100,
        .map_io         = pxa27x_map_io,
        .init_irq       = pxa27x_init_irq,
+       .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = palmz72_init
 MACHINE_END
index 1fc8a66407ae1fef0ba0fe5ce1bcae925e854eda..ffa65dfb8c6f895f56b1bb1a79ed0546c7f23053 100644 (file)
@@ -262,6 +262,7 @@ MACHINE_START(PCM027, "Phytec Messtechnik GmbH phyCORE-PXA270")
        .map_io         = pcm027_map_io,
        .nr_irqs        = PCM027_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
+       .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = pcm027_init,
 MACHINE_END
index 16d14fd79b4b26506801246df4476f617afed810..a113ea9ab4abd180f6923b1af45070e6d0a6c927 100644 (file)
@@ -468,6 +468,7 @@ MACHINE_START(POODLE, "SHARP Poodle")
        .map_io         = pxa25x_map_io,
        .nr_irqs        = POODLE_NR_IRQS,       /* 4 for LoCoMo */
        .init_irq       = pxa25x_init_irq,
+       .handle_irq     = pxa25x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = poodle_init,
 MACHINE_END
index 8521d7d6f1dab39402ef5c36ed3abece4cf17f89..e66dc1562cdadafbd9c5bfd5773cc2ff3d3c88d9 100644 (file)
@@ -31,7 +31,6 @@
 #include <mach/ohci.h>
 #include <mach/pm.h>
 #include <mach/dma.h>
-#include <mach/regs-intc.h>
 #include <mach/smemc.h>
 
 #include "generic.h"
@@ -328,13 +327,13 @@ static void pxa_ack_ext_wakeup(struct irq_data *d)
 
 static void pxa_mask_ext_wakeup(struct irq_data *d)
 {
-       ICMR2 &= ~(1 << ((d->irq - PXA_IRQ(0)) & 0x1f));
+       pxa_mask_irq(d);
        PECR &= ~PECR_IE(d->irq - IRQ_WAKEUP0);
 }
 
 static void pxa_unmask_ext_wakeup(struct irq_data *d)
 {
-       ICMR2 |= 1 << ((d->irq - PXA_IRQ(0)) & 0x1f);
+       pxa_unmask_irq(d);
        PECR |= PECR_IE(d->irq - IRQ_WAKEUP0);
 }
 
index ecc82a330fad09a6747beca85c9007598ded30f5..0ee166b61f81399448d48c119f101829b1a85158 100644 (file)
@@ -27,7 +27,6 @@
 #include <mach/reset.h>
 #include <mach/pm.h>
 #include <mach/dma.h>
-#include <mach/regs-intc.h>
 
 #include "generic.h"
 #include "devices.h"
index d130f77b6d11c8dfd6317cf793dcdcabd1b354af..8b8cff6a962073adb0fd79f21b841c9a586a73db 100644 (file)
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
-#include <mach/hardware.h>
-#include <mach/pxa3xx-regs.h>
-#include <mach/mfp-pxa3xx.h>
-#include <mach/mfp-pxa300.h>
+#include <mach/pxa300.h>
 #include <mach/ohci.h>
 #include <mach/pxafb.h>
 #include <mach/mmc.h>
@@ -1091,6 +1088,7 @@ MACHINE_START(RAUMFELD_RC, "Raumfeld Controller")
        .init_machine   = raumfeld_controller_init,
        .map_io         = pxa3xx_map_io,
        .init_irq       = pxa3xx_init_irq,
+       .handle_irq     = pxa3xx_handle_irq,
        .timer          = &pxa_timer,
 MACHINE_END
 #endif
@@ -1101,6 +1099,7 @@ MACHINE_START(RAUMFELD_CONNECTOR, "Raumfeld Connector")
        .init_machine   = raumfeld_connector_init,
        .map_io         = pxa3xx_map_io,
        .init_irq       = pxa3xx_init_irq,
+       .handle_irq     = pxa3xx_handle_irq,
        .timer          = &pxa_timer,
 MACHINE_END
 #endif
@@ -1111,6 +1110,7 @@ MACHINE_START(RAUMFELD_SPEAKER, "Raumfeld Speaker")
        .init_machine   = raumfeld_speaker_init,
        .map_io         = pxa3xx_map_io,
        .init_irq       = pxa3xx_init_irq,
+       .handle_irq     = pxa3xx_handle_irq,
        .timer          = &pxa_timer,
 MACHINE_END
 #endif
index fee97a935122392005988f3461fbff85dc3c8288..df4356e8acae38996b56a746f5aff2cb63c6551e 100644 (file)
@@ -599,6 +599,7 @@ MACHINE_START(SAAR, "PXA930 Handheld Platform (aka SAAR)")
        .boot_params    = 0xa0000100,
        .map_io         = pxa3xx_map_io,
        .init_irq       = pxa3xx_init_irq,
+       .handle_irq       = pxa3xx_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = saar_init,
 MACHINE_END
index 9322fe527c7f9cb017eb537ee0db9957c06bce9e..3b582d691cc6d4ea54858997ee7932476bccd75b 100644 (file)
@@ -107,6 +107,7 @@ MACHINE_START(SAARB, "PXA955 Handheld Platform (aka SAARB)")
        .map_io         = pxa_map_io,
        .nr_irqs        = SAARB_NR_IRQS,
        .init_irq       = pxa95x_init_irq,
+       .handle_irq     = pxa3xx_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = saarb_init,
 MACHINE_END
index 01c576963e94504f9a56390ffa2e4b8339d8fb55..438c7b5e451f0a58db257abd339067da99ba1d65 100644 (file)
@@ -984,6 +984,7 @@ MACHINE_START(SPITZ, "SHARP Spitz")
        .fixup          = spitz_fixup,
        .map_io         = pxa27x_map_io,
        .init_irq       = pxa27x_init_irq,
+       .handle_irq     = pxa27x_handle_irq,
        .init_machine   = spitz_init,
        .timer          = &pxa_timer,
 MACHINE_END
@@ -994,6 +995,7 @@ MACHINE_START(BORZOI, "SHARP Borzoi")
        .fixup          = spitz_fixup,
        .map_io         = pxa27x_map_io,
        .init_irq       = pxa27x_init_irq,
+       .handle_irq     = pxa27x_handle_irq,
        .init_machine   = spitz_init,
        .timer          = &pxa_timer,
 MACHINE_END
@@ -1004,6 +1006,7 @@ MACHINE_START(AKITA, "SHARP Akita")
        .fixup          = spitz_fixup,
        .map_io         = pxa27x_map_io,
        .init_irq       = pxa27x_init_irq,
+       .handle_irq     = pxa27x_handle_irq,
        .init_machine   = spitz_init,
        .timer          = &pxa_timer,
 MACHINE_END
index cb5611daf5fe21ddc193ab3f910ab69a878fe861..3f8d0af9e2f7b48753e4818488c3982839615a32 100644 (file)
@@ -1001,6 +1001,7 @@ static void __init stargate2_init(void)
 MACHINE_START(INTELMOTE2, "IMOTE 2")
        .map_io         = pxa27x_map_io,
        .init_irq       = pxa27x_init_irq,
+       .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = imote2_init,
        .boot_params    = 0xA0000100,
@@ -1012,6 +1013,7 @@ MACHINE_START(STARGATE2, "Stargate 2")
        .map_io = pxa27x_map_io,
        .nr_irqs = STARGATE_NR_IRQS,
        .init_irq = pxa27x_init_irq,
+       .handle_irq = pxa27x_handle_irq,
        .timer = &pxa_timer,
        .init_machine = stargate2_init,
        .boot_params = 0xA0000100,
index 53d4a472b6992419ef4e0e12c7e0e1c81879359d..32fb58e01b1014ec4901387fe4d440d9169567bf 100644 (file)
@@ -492,6 +492,7 @@ MACHINE_START(TAVOREVB, "PXA930 Evaluation Board (aka TavorEVB)")
        .boot_params    = 0xa0000100,
        .map_io         = pxa3xx_map_io,
        .init_irq       = pxa3xx_init_irq,
+       .handle_irq       = pxa3xx_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = tavorevb_init,
 MACHINE_END
index 79f4422f12f4d13b2ae051bbb5c9828138ae1e7a..fd5a8eae0a876ed217e1b48c0f97b960c1756dca 100644 (file)
@@ -129,6 +129,7 @@ MACHINE_START(TAVOREVB3, "PXA950 Evaluation Board (aka TavorEVB3)")
        .map_io         = pxa3xx_map_io,
        .nr_irqs        = TAVOREVB3_NR_IRQS,
        .init_irq       = pxa3xx_init_irq,
+       .handle_irq       = pxa3xx_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = evb3_init,
 MACHINE_END
index 5fa145778e7d4b1a9e7a737b7292edc5c6715eb6..9f69a26826933b5a5469339ebb66cd27df2b0b5f 100644 (file)
@@ -974,6 +974,7 @@ MACHINE_START(TOSA, "SHARP Tosa")
        .map_io         = pxa25x_map_io,
        .nr_irqs        = TOSA_NR_IRQS,
        .init_irq       = pxa25x_init_irq,
+       .handle_irq       = pxa25x_handle_irq,
        .init_machine   = tosa_init,
        .timer          = &pxa_timer,
 MACHINE_END
index 687417a936988014da451cfaf8676fad1e08aa55..c0417508f39dc17c149c53a94294fe0496975bf0 100644 (file)
@@ -558,6 +558,7 @@ MACHINE_START(TRIZEPS4, "Keith und Koep Trizeps IV module")
        .init_machine   = trizeps4_init,
        .map_io         = trizeps4_map_io,
        .init_irq       = pxa27x_init_irq,
+       .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
 MACHINE_END
 
@@ -567,5 +568,6 @@ MACHINE_START(TRIZEPS4WL, "Keith und Koep Trizeps IV-WL module")
        .init_machine   = trizeps4_init,
        .map_io         = trizeps4_map_io,
        .init_irq       = pxa27x_init_irq,
+       .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
 MACHINE_END
index 903218eab56db6031ecf54ea2b3244edb165eb6e..d4a3dc74e84a06091953fc2ee63a542335f0f29a 100644 (file)
@@ -995,6 +995,7 @@ MACHINE_START(VIPER, "Arcom/Eurotech VIPER SBC")
        .boot_params    = 0xa0000100,
        .map_io         = viper_map_io,
        .init_irq       = viper_init_irq,
+       .handle_irq     = pxa25x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = viper_init,
 MACHINE_END
index 67bd41488bf81f05f0d853e708c243a747e8cd03..5f8490ab07cb2bdda9b5303d06866fdc388935e4 100644 (file)
@@ -719,6 +719,7 @@ MACHINE_START(VPAC270, "Voipac PXA270")
        .boot_params    = 0xa0000100,
        .map_io         = pxa27x_map_io,
        .init_irq       = pxa27x_init_irq,
+       .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = vpac270_init
 MACHINE_END
index f55f8f2e0db3219720e7fc5ed30b22108b8fb6ae..acc600f5e72f4a8897ecf01175020dadbd1702df 100644 (file)
@@ -28,8 +28,7 @@
 #include <asm/mach/map.h>
 
 #include <mach/hardware.h>
-#include <mach/pxa2xx-regs.h>
-#include <mach/mfp-pxa25x.h>
+#include <mach/pxa25x.h>
 #include <mach/smemc.h>
 
 #include "generic.h"
@@ -185,6 +184,7 @@ MACHINE_START(XCEP, "Iskratel XCEP")
        .init_machine   = xcep_init,
        .map_io         = pxa25x_map_io,
        .init_irq       = pxa25x_init_irq,
+       .handle_irq     = pxa25x_handle_irq,
        .timer          = &pxa_timer,
 MACHINE_END
 
index fbe9e02e2f9f8f9c7ebc56c5eed51c5dbcde9509..6c9275a20c91d6735e1ee656b332816e3aaf3a86 100644 (file)
@@ -40,6 +40,7 @@
 #include <mach/pxafb.h>
 #include <mach/mmc.h>
 #include <plat/pxa27x_keypad.h>
+#include <mach/pm.h>
 
 #include "generic.h"
 #include "devices.h"
@@ -677,6 +678,20 @@ static void __init z2_pmic_init(void)
 static inline void z2_pmic_init(void) {}
 #endif
 
+#ifdef CONFIG_PM
+static void z2_power_off(void)
+{
+       /* We're using deep sleep as poweroff, so clear PSPR to ensure that
+        * bootloader will jump to its entry point in resume handler
+        */
+       PSPR = 0x0;
+       local_irq_disable();
+       pxa27x_cpu_suspend(PWRMODE_DEEPSLEEP, PLAT_PHYS_OFFSET - PAGE_OFFSET);
+}
+#else
+#define z2_power_off   NULL
+#endif
+
 /******************************************************************************
  * Machine init
  ******************************************************************************/
@@ -698,12 +713,15 @@ static void __init z2_init(void)
        z2_leds_init();
        z2_keys_init();
        z2_pmic_init();
+
+       pm_power_off = z2_power_off;
 }
 
 MACHINE_START(ZIPIT2, "Zipit Z2")
        .boot_params    = 0xa0000100,
        .map_io         = pxa27x_map_io,
        .init_irq       = pxa27x_init_irq,
+       .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = z2_init,
 MACHINE_END
index 00363c7ac1828c58e45035f7d37a5ea0bcbcfcf5..667e0956a5677883ef12db463ab0e035615c3281 100644 (file)
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#include <mach/pxa2xx-regs.h>
+#include <mach/pxa27x.h>
 #include <mach/regs-uart.h>
 #include <mach/ohci.h>
 #include <mach/mmc.h>
 #include <mach/pxa27x-udc.h>
 #include <mach/udc.h>
 #include <mach/pxafb.h>
-#include <mach/mfp-pxa27x.h>
 #include <mach/pm.h>
 #include <mach/audio.h>
 #include <mach/arcom-pcmcia.h>
@@ -908,6 +907,7 @@ MACHINE_START(ARCOM_ZEUS, "Arcom/Eurotech ZEUS")
        .map_io         = zeus_map_io,
        .nr_irqs        = ZEUS_NR_IRQS,
        .init_irq       = zeus_init_irq,
+       .handle_irq     = pxa27x_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = zeus_init,
 MACHINE_END
index 5821185f77ab16b14de591d9db2ba7482694ea41..15ec66b3471a80644da24083ceb8da43f9002ea2 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
-#include <mach/hardware.h>
+#include <mach/pxa3xx.h>
 #include <mach/audio.h>
 #include <mach/pxafb.h>
 #include <mach/zylonite.h>
@@ -426,6 +426,7 @@ MACHINE_START(ZYLONITE, "PXA3xx Platform Development Kit (aka Zylonite)")
        .map_io         = pxa3xx_map_io,
        .nr_irqs        = ZYLONITE_NR_IRQS,
        .init_irq       = pxa3xx_init_irq,
+       .handle_irq     = pxa3xx_handle_irq,
        .timer          = &pxa_timer,
        .init_machine   = zylonite_init,
 MACHINE_END
index dd3120df09fe3299ca78f74945d0ff446ada8db8..fc2dc0b3d4feb4dd5599101db123b78de309f2ea 100644 (file)
@@ -552,7 +552,7 @@ struct mini2440_features_t {
        struct platform_device *optional[8];
 };
 
-static void mini2440_parse_features(
+static void __init mini2440_parse_features(
                struct mini2440_features_t * features,
                const char * features_str )
 {
index 82db072cb836b78899e917f4691bacdc3857557b..5e6b42089eb44d7048b39cc2855403cd44cc0ddc 100644 (file)
@@ -88,6 +88,7 @@ static struct s3c64xx_spi_info s3c64xx_spi0_pdata = {
        .cfg_gpio = s3c64xx_spi_cfg_gpio,
        .fifo_lvl_mask = 0x7f,
        .rx_lvl_offset = 13,
+       .tx_st_done = 21,
 };
 
 static u64 spi_dmamask = DMA_BIT_MASK(32);
@@ -132,6 +133,7 @@ static struct s3c64xx_spi_info s3c64xx_spi1_pdata = {
        .cfg_gpio = s3c64xx_spi_cfg_gpio,
        .fifo_lvl_mask = 0x7f,
        .rx_lvl_offset = 13,
+       .tx_st_done = 21,
 };
 
 struct platform_device s3c64xx_device_spi1 = {
index e78ee18c76e321bf3a8b43862b3fa0dd0e5e6bc1..ac825e82632645c0a79300aad63ab85776cfded6 100644 (file)
@@ -112,12 +112,14 @@ static struct s3c64xx_spi_info s5p6440_spi0_pdata = {
        .cfg_gpio       = s5p6440_spi_cfg_gpio,
        .fifo_lvl_mask  = 0x1ff,
        .rx_lvl_offset  = 15,
+       .tx_st_done     = 25,
 };
 
 static struct s3c64xx_spi_info s5p6450_spi0_pdata = {
        .cfg_gpio       = s5p6450_spi_cfg_gpio,
        .fifo_lvl_mask  = 0x1ff,
        .rx_lvl_offset  = 15,
+       .tx_st_done     = 25,
 };
 
 static u64 spi_dmamask = DMA_BIT_MASK(32);
@@ -160,12 +162,14 @@ static struct s3c64xx_spi_info s5p6440_spi1_pdata = {
        .cfg_gpio       = s5p6440_spi_cfg_gpio,
        .fifo_lvl_mask  = 0x7f,
        .rx_lvl_offset  = 15,
+       .tx_st_done     = 25,
 };
 
 static struct s3c64xx_spi_info s5p6450_spi1_pdata = {
        .cfg_gpio       = s5p6450_spi_cfg_gpio,
        .fifo_lvl_mask  = 0x7f,
        .rx_lvl_offset  = 15,
+       .tx_st_done     = 25,
 };
 
 struct platform_device s5p64x0_device_spi1 = {
index 57b19794d9bbb50a5013023ed3d1b7e5902f27d0..e5d6c4dceb566db4f77d616eff07550e74ae0b28 100644 (file)
@@ -15,6 +15,7 @@
 #include <mach/dma.h>
 #include <mach/map.h>
 #include <mach/spi-clocks.h>
+#include <mach/irqs.h>
 
 #include <plat/s3c64xx-spi.h>
 #include <plat/gpio-cfg.h>
@@ -90,6 +91,7 @@ static struct s3c64xx_spi_info s5pc100_spi0_pdata = {
        .fifo_lvl_mask = 0x7f,
        .rx_lvl_offset = 13,
        .high_speed = 1,
+       .tx_st_done = 21,
 };
 
 static u64 spi_dmamask = DMA_BIT_MASK(32);
@@ -134,6 +136,7 @@ static struct s3c64xx_spi_info s5pc100_spi1_pdata = {
        .fifo_lvl_mask = 0x7f,
        .rx_lvl_offset = 13,
        .high_speed = 1,
+       .tx_st_done = 21,
 };
 
 struct platform_device s5pc100_device_spi1 = {
@@ -176,6 +179,7 @@ static struct s3c64xx_spi_info s5pc100_spi2_pdata = {
        .fifo_lvl_mask = 0x7f,
        .rx_lvl_offset = 13,
        .high_speed = 1,
+       .tx_st_done = 21,
 };
 
 struct platform_device s5pc100_device_spi2 = {
index e3249a47e3b1de90bc8ed5e5345debb75de29260..eaf9a7bff7a0bb6facc39dd27ba12592ec1dfb2b 100644 (file)
@@ -85,6 +85,7 @@ static struct s3c64xx_spi_info s5pv210_spi0_pdata = {
        .fifo_lvl_mask = 0x1ff,
        .rx_lvl_offset = 15,
        .high_speed = 1,
+       .tx_st_done = 25,
 };
 
 static u64 spi_dmamask = DMA_BIT_MASK(32);
@@ -129,6 +130,7 @@ static struct s3c64xx_spi_info s5pv210_spi1_pdata = {
        .fifo_lvl_mask = 0x7f,
        .rx_lvl_offset = 15,
        .high_speed = 1,
+       .tx_st_done = 25,
 };
 
 struct platform_device s5pv210_device_spi1 = {
index 30e18bc60647b35e78bc914703de41af0ecc8e44..846cd7d69e3ed0e4ae73608e418b5ebe02bccd75 100644 (file)
@@ -25,7 +25,6 @@
 #include <linux/io.h>
 #include <linux/gpio.h>
 #include <linux/i2c.h>
-#include <linux/i2c-tegra.h>
 
 #include <sound/wm8903.h>
 
@@ -83,22 +82,6 @@ static struct platform_device harmony_audio_device = {
        },
 };
 
-static struct tegra_i2c_platform_data harmony_i2c1_platform_data = {
-       .bus_clk_rate   = 400000,
-};
-
-static struct tegra_i2c_platform_data harmony_i2c2_platform_data = {
-       .bus_clk_rate   = 400000,
-};
-
-static struct tegra_i2c_platform_data harmony_i2c3_platform_data = {
-       .bus_clk_rate   = 400000,
-};
-
-static struct tegra_i2c_platform_data harmony_dvc_platform_data = {
-       .bus_clk_rate   = 400000,
-};
-
 static struct wm8903_platform_data harmony_wm8903_pdata = {
        .irq_active_low = 0,
        .micdet_cfg = 0,
@@ -121,11 +104,6 @@ static struct i2c_board_info __initdata wm8903_board_info = {
 
 static void __init harmony_i2c_init(void)
 {
-       tegra_i2c_device1.dev.platform_data = &harmony_i2c1_platform_data;
-       tegra_i2c_device2.dev.platform_data = &harmony_i2c2_platform_data;
-       tegra_i2c_device3.dev.platform_data = &harmony_i2c3_platform_data;
-       tegra_i2c_device4.dev.platform_data = &harmony_dvc_platform_data;
-
        platform_device_register(&tegra_i2c_device1);
        platform_device_register(&tegra_i2c_device2);
        platform_device_register(&tegra_i2c_device3);
index 2643d1bd568b50102231d93432178c297dc79b05..bdd2627dd87ba0acdde5eb29b254274808f09499 100644 (file)
@@ -141,12 +141,10 @@ static struct tegra_pingroup_config paz00_pinmux[] = {
 };
 
 static struct tegra_gpio_table gpio_table[] = {
-       { .gpio = TEGRA_GPIO_SD1_CD,    .enable = true  },
-       { .gpio = TEGRA_GPIO_SD1_WP,    .enable = true  },
-       { .gpio = TEGRA_GPIO_SD1_POWER, .enable = true  },
-       { .gpio = TEGRA_GPIO_SD4_CD,    .enable = true  },
-       { .gpio = TEGRA_GPIO_SD4_WP,    .enable = true  },
-       { .gpio = TEGRA_GPIO_SD4_POWER, .enable = true  },
+       { .gpio = TEGRA_GPIO_SD1_CD,    .enable = true },
+       { .gpio = TEGRA_GPIO_SD1_WP,    .enable = true },
+       { .gpio = TEGRA_GPIO_SD1_POWER, .enable = true },
+       { .gpio = TEGRA_ULPI_RST,       .enable = true },
 };
 
 void paz00_pinmux_init(void)
index 57e50a823eeca7160749dcc7c468560377fdbb2d..ea2f79c9879bbbbba6c1f868f531d880fae1262d 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/pda_power.h>
 #include <linux/io.h>
+#include <linux/i2c.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -34,6 +35,7 @@
 #include <mach/iomap.h>
 #include <mach/irqs.h>
 #include <mach/sdhci.h>
+#include <mach/gpio.h>
 
 #include "board.h"
 #include "board-paz00.h"
@@ -66,10 +68,22 @@ static struct platform_device debug_uart = {
 static struct platform_device *paz00_devices[] __initdata = {
        &debug_uart,
        &tegra_sdhci_device1,
-       &tegra_sdhci_device2,
        &tegra_sdhci_device4,
 };
 
+static void paz00_i2c_init(void)
+{
+       platform_device_register(&tegra_i2c_device1);
+       platform_device_register(&tegra_i2c_device2);
+       platform_device_register(&tegra_i2c_device4);
+}
+
+static void paz00_usb_init(void)
+{
+       platform_device_register(&tegra_ehci2_device);
+       platform_device_register(&tegra_ehci3_device);
+}
+
 static void __init tegra_paz00_fixup(struct machine_desc *desc,
        struct tag *tags, char **cmdline, struct meminfo *mi)
 {
@@ -84,23 +98,16 @@ static __initdata struct tegra_clk_init_table paz00_clk_init_table[] = {
        { NULL,         NULL,           0,              0},
 };
 
-
 static struct tegra_sdhci_platform_data sdhci_pdata1 = {
        .cd_gpio        = TEGRA_GPIO_SD1_CD,
        .wp_gpio        = TEGRA_GPIO_SD1_WP,
        .power_gpio     = TEGRA_GPIO_SD1_POWER,
 };
 
-static struct tegra_sdhci_platform_data sdhci_pdata2 = {
+static struct tegra_sdhci_platform_data sdhci_pdata4 = {
        .cd_gpio        = -1,
        .wp_gpio        = -1,
        .power_gpio     = -1,
-};
-
-static struct tegra_sdhci_platform_data sdhci_pdata4 = {
-       .cd_gpio        = TEGRA_GPIO_SD4_CD,
-       .wp_gpio        = TEGRA_GPIO_SD4_WP,
-       .power_gpio     = TEGRA_GPIO_SD4_POWER,
        .is_8bit        = 1,
 };
 
@@ -111,13 +118,15 @@ static void __init tegra_paz00_init(void)
        paz00_pinmux_init();
 
        tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1;
-       tegra_sdhci_device2.dev.platform_data = &sdhci_pdata2;
        tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
 
        platform_add_devices(paz00_devices, ARRAY_SIZE(paz00_devices));
+
+       paz00_i2c_init();
+       paz00_usb_init();
 }
 
-MACHINE_START(PAZ00, "paz00")
+MACHINE_START(PAZ00, "Toshiba AC100 / Dynabook AZ")
        .boot_params    = 0x00000100,
        .fixup          = tegra_paz00_fixup,
        .map_io         = tegra_map_common_io,
index da193ca76d3b168105ed29f0eb03f0fe68128a5e..d4ff39ddaeb3e4fffbbdf62e2183e68a2013f9de 100644 (file)
 #ifndef _MACH_TEGRA_BOARD_PAZ00_H
 #define _MACH_TEGRA_BOARD_PAZ00_H
 
-#define TEGRA_GPIO_SD1_CD               TEGRA_GPIO_PV5
-#define TEGRA_GPIO_SD1_WP               TEGRA_GPIO_PH1
-#define TEGRA_GPIO_SD1_POWER            TEGRA_GPIO_PT3
-#define TEGRA_GPIO_SD4_CD               TEGRA_GPIO_PH2
-#define TEGRA_GPIO_SD4_WP               TEGRA_GPIO_PH3
-#define TEGRA_GPIO_SD4_POWER            TEGRA_GPIO_PI6
+#define TEGRA_GPIO_SD1_CD              TEGRA_GPIO_PV5
+#define TEGRA_GPIO_SD1_WP              TEGRA_GPIO_PH1
+#define TEGRA_GPIO_SD1_POWER           TEGRA_GPIO_PT3
+#define TEGRA_ULPI_RST                 TEGRA_GPIO_PV0
 
 void paz00_pinmux_init(void);
 
index a8d7ace9f958ef2fd4c6db3e5802e2a8d8a861e5..46d5df90c79ece38fd57c9171b11d5713f2c88fb 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/platform_device.h>
 #include <linux/serial_8250.h>
 #include <linux/i2c.h>
-#include <linux/i2c-tegra.h>
 #include <linux/delay.h>
 #include <linux/input.h>
 #include <linux/io.h>
@@ -66,22 +65,6 @@ static __initdata struct tegra_clk_init_table seaboard_clk_init_table[] = {
        { NULL,         NULL,           0,              0},
 };
 
-static struct tegra_i2c_platform_data seaboard_i2c1_platform_data = {
-       .bus_clk_rate   = 400000.
-};
-
-static struct tegra_i2c_platform_data seaboard_i2c2_platform_data = {
-       .bus_clk_rate   = 400000,
-};
-
-static struct tegra_i2c_platform_data seaboard_i2c3_platform_data = {
-       .bus_clk_rate   = 400000,
-};
-
-static struct tegra_i2c_platform_data seaboard_dvc_platform_data = {
-       .bus_clk_rate   = 400000,
-};
-
 static struct gpio_keys_button seaboard_gpio_keys_buttons[] = {
        {
                .code           = SW_LID,
@@ -137,9 +120,9 @@ static struct tegra_sdhci_platform_data sdhci_pdata4 = {
 static struct platform_device *seaboard_devices[] __initdata = {
        &debug_uart,
        &tegra_pmu_device,
-       &tegra_sdhci_device1,
-       &tegra_sdhci_device3,
        &tegra_sdhci_device4,
+       &tegra_sdhci_device3,
+       &tegra_sdhci_device1,
        &seaboard_gpio_keys_device,
 };
 
@@ -161,11 +144,6 @@ static void __init seaboard_i2c_init(void)
 
        i2c_register_board_info(4, &adt7461_device, 1);
 
-       tegra_i2c_device1.dev.platform_data = &seaboard_i2c1_platform_data;
-       tegra_i2c_device2.dev.platform_data = &seaboard_i2c2_platform_data;
-       tegra_i2c_device3.dev.platform_data = &seaboard_i2c3_platform_data;
-       tegra_i2c_device4.dev.platform_data = &seaboard_dvc_platform_data;
-
        platform_device_register(&tegra_i2c_device1);
        platform_device_register(&tegra_i2c_device2);
        platform_device_register(&tegra_i2c_device3);
index 13534fa08abfd4b2586b0e983d776d51bfe5289f..82646a411ecdea7f6921d61433f12bce48c06766 100644 (file)
@@ -29,7 +29,7 @@ static __initdata struct tegra_pingroup_config trimslice_pinmux[] = {
        {TEGRA_PINGROUP_ATC,   TEGRA_MUX_NAND,          TEGRA_PUPD_NORMAL,      TEGRA_TRI_TRISTATE},
        {TEGRA_PINGROUP_ATD,   TEGRA_MUX_GMI,           TEGRA_PUPD_NORMAL,      TEGRA_TRI_TRISTATE},
        {TEGRA_PINGROUP_ATE,   TEGRA_MUX_GMI,           TEGRA_PUPD_NORMAL,      TEGRA_TRI_TRISTATE},
-       {TEGRA_PINGROUP_CDEV1, TEGRA_MUX_OSC,           TEGRA_PUPD_NORMAL,      TEGRA_TRI_NORMAL},
+       {TEGRA_PINGROUP_CDEV1, TEGRA_MUX_PLLA_OUT,      TEGRA_PUPD_NORMAL,      TEGRA_TRI_NORMAL},
        {TEGRA_PINGROUP_CDEV2, TEGRA_MUX_PLLP_OUT4,     TEGRA_PUPD_PULL_DOWN,   TEGRA_TRI_TRISTATE},
        {TEGRA_PINGROUP_CRTP,  TEGRA_MUX_CRT,           TEGRA_PUPD_NORMAL,      TEGRA_TRI_TRISTATE},
        {TEGRA_PINGROUP_CSUS,  TEGRA_MUX_VI_SENSOR_CLK, TEGRA_PUPD_PULL_DOWN,   TEGRA_TRI_TRISTATE},
@@ -126,7 +126,7 @@ static __initdata struct tegra_pingroup_config trimslice_pinmux[] = {
        {TEGRA_PINGROUP_SPIH,  TEGRA_MUX_SPI2_ALT,      TEGRA_PUPD_PULL_UP,     TEGRA_TRI_TRISTATE},
        {TEGRA_PINGROUP_UAA,   TEGRA_MUX_ULPI,          TEGRA_PUPD_PULL_UP,     TEGRA_TRI_TRISTATE},
        {TEGRA_PINGROUP_UAB,   TEGRA_MUX_ULPI,          TEGRA_PUPD_PULL_UP,     TEGRA_TRI_TRISTATE},
-       {TEGRA_PINGROUP_UAC,   TEGRA_MUX_RSVD2,         TEGRA_PUPD_NORMAL,      TEGRA_TRI_TRISTATE},
+       {TEGRA_PINGROUP_UAC,   TEGRA_MUX_RSVD2,         TEGRA_PUPD_NORMAL,      TEGRA_TRI_NORMAL},
        {TEGRA_PINGROUP_UAD,   TEGRA_MUX_IRDA,          TEGRA_PUPD_PULL_UP,     TEGRA_TRI_TRISTATE},
        {TEGRA_PINGROUP_UCA,   TEGRA_MUX_UARTC,         TEGRA_PUPD_PULL_UP,     TEGRA_TRI_TRISTATE},
        {TEGRA_PINGROUP_UCB,   TEGRA_MUX_UARTC,         TEGRA_PUPD_PULL_UP,     TEGRA_TRI_TRISTATE},
@@ -145,6 +145,9 @@ static __initdata struct tegra_pingroup_config trimslice_pinmux[] = {
 static struct tegra_gpio_table gpio_table[] = {
        { .gpio = TRIMSLICE_GPIO_SD4_CD, .enable = true }, /* mmc4 cd */
        { .gpio = TRIMSLICE_GPIO_SD4_WP, .enable = true }, /* mmc4 wp */
+
+       { .gpio = TRIMSLICE_GPIO_USB1_MODE, .enable = true }, /* USB1 mode */
+       { .gpio = TRIMSLICE_GPIO_USB2_RST,  .enable = true }, /* USB2 PHY rst */
 };
 
 void __init trimslice_pinmux_init(void)
index cda4cfd78e8417f6f8af5fe0a30e2015f074efa9..89a6d2adc1dedb61d329f54d5beb10a4d5eadc54 100644 (file)
@@ -23,6 +23,8 @@
 #include <linux/platform_device.h>
 #include <linux/serial_8250.h>
 #include <linux/io.h>
+#include <linux/i2c.h>
+#include <linux/gpio.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -30,6 +32,7 @@
 
 #include <mach/iomap.h>
 #include <mach/sdhci.h>
+#include <mach/gpio.h>
 
 #include "board.h"
 #include "clock.h"
@@ -71,12 +74,58 @@ static struct tegra_sdhci_platform_data sdhci_pdata4 = {
        .power_gpio     = -1,
 };
 
+static struct platform_device trimslice_audio_device = {
+       .name   = "tegra-snd-trimslice",
+       .id     = 0,
+};
+
 static struct platform_device *trimslice_devices[] __initdata = {
        &debug_uart,
        &tegra_sdhci_device1,
        &tegra_sdhci_device4,
+       &tegra_i2s_device1,
+       &tegra_das_device,
+       &tegra_pcm_device,
+       &trimslice_audio_device,
 };
 
+static struct i2c_board_info trimslice_i2c3_board_info[] = {
+       {
+               I2C_BOARD_INFO("tlv320aic23", 0x1a),
+       },
+       {
+               I2C_BOARD_INFO("em3027", 0x56),
+       },
+};
+
+static void trimslice_i2c_init(void)
+{
+       platform_device_register(&tegra_i2c_device1);
+       platform_device_register(&tegra_i2c_device2);
+       platform_device_register(&tegra_i2c_device3);
+
+       i2c_register_board_info(2, trimslice_i2c3_board_info,
+                               ARRAY_SIZE(trimslice_i2c3_board_info));
+}
+
+static void trimslice_usb_init(void)
+{
+       int err;
+
+       platform_device_register(&tegra_ehci3_device);
+
+       platform_device_register(&tegra_ehci2_device);
+
+       err = gpio_request_one(TRIMSLICE_GPIO_USB1_MODE, GPIOF_OUT_INIT_HIGH,
+                              "usb1mode");
+       if (err) {
+               pr_err("TrimSlice: failed to obtain USB1 mode gpio: %d\n", err);
+               return;
+       }
+
+       platform_device_register(&tegra_ehci1_device);
+}
+
 static void __init tegra_trimslice_fixup(struct machine_desc *desc,
        struct tag *tags, char **cmdline, struct meminfo *mi)
 {
@@ -90,6 +139,10 @@ static void __init tegra_trimslice_fixup(struct machine_desc *desc,
 static __initdata struct tegra_clk_init_table trimslice_clk_init_table[] = {
        /* name         parent          rate            enabled */
        { "uarta",      "pll_p",        216000000,      true },
+       { "pll_a",      "pll_p_out1",   56448000,       true },
+       { "pll_a_out0", "pll_a",        11289600,       true },
+       { "cdev1",      NULL,           0,              true },
+       { "i2s1",       "pll_a_out0",   11289600,       false},
        { NULL,         NULL,           0,              0},
 };
 
@@ -112,6 +165,9 @@ static void __init tegra_trimslice_init(void)
        tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
 
        platform_add_devices(trimslice_devices, ARRAY_SIZE(trimslice_devices));
+
+       trimslice_i2c_init();
+       trimslice_usb_init();
 }
 
 MACHINE_START(TRIMSLICE, "trimslice")
index e8ef6291c6f1945e7f7c8e8f51ef36749b8e0c7e..7a7dee86b4da717a3ac00982f31674754c50c924 100644 (file)
@@ -20,6 +20,9 @@
 #define TRIMSLICE_GPIO_SD4_CD  TEGRA_GPIO_PP1  /* mmc4 cd */
 #define TRIMSLICE_GPIO_SD4_WP  TEGRA_GPIO_PP2  /* mmc4 wp */
 
+#define TRIMSLICE_GPIO_USB1_MODE       TEGRA_GPIO_PV2 /* USB1 mode */
+#define TRIMSLICE_GPIO_USB2_RST                TEGRA_GPIO_PV0 /* USB2 PHY reset */
+
 void trimslice_pinmux_init(void);
 
 #endif
index 1528f9daef1f2087cc7383b39dd0a3ed3fa8ce07..57e35d20c24cf495e1e1e3863d691b28b4d37c46 100644 (file)
 #include <linux/dma-mapping.h>
 #include <linux/fsl_devices.h>
 #include <linux/serial_8250.h>
+#include <linux/i2c-tegra.h>
+#include <linux/platform_data/tegra_usb.h>
 #include <asm/pmu.h>
 #include <mach/irqs.h>
 #include <mach/iomap.h>
 #include <mach/dma.h>
+#include <mach/usb_phy.h>
+#include "gpio-names.h"
 
 static struct resource i2c_resource1[] = {
        [0] = {
@@ -79,13 +83,29 @@ static struct resource i2c_resource4[] = {
        },
 };
 
+static struct tegra_i2c_platform_data tegra_i2c1_platform_data = {
+       .bus_clk_rate   = 400000,
+};
+
+static struct tegra_i2c_platform_data tegra_i2c2_platform_data = {
+       .bus_clk_rate   = 400000,
+};
+
+static struct tegra_i2c_platform_data tegra_i2c3_platform_data = {
+       .bus_clk_rate   = 400000,
+};
+
+static struct tegra_i2c_platform_data tegra_dvc_platform_data = {
+       .bus_clk_rate   = 400000,
+};
+
 struct platform_device tegra_i2c_device1 = {
        .name           = "tegra-i2c",
        .id             = 0,
        .resource       = i2c_resource1,
        .num_resources  = ARRAY_SIZE(i2c_resource1),
        .dev = {
-               .platform_data = 0,
+               .platform_data = &tegra_i2c1_platform_data,
        },
 };
 
@@ -95,7 +115,7 @@ struct platform_device tegra_i2c_device2 = {
        .resource       = i2c_resource2,
        .num_resources  = ARRAY_SIZE(i2c_resource2),
        .dev = {
-               .platform_data = 0,
+               .platform_data = &tegra_i2c2_platform_data,
        },
 };
 
@@ -105,7 +125,7 @@ struct platform_device tegra_i2c_device3 = {
        .resource       = i2c_resource3,
        .num_resources  = ARRAY_SIZE(i2c_resource3),
        .dev = {
-               .platform_data = 0,
+               .platform_data = &tegra_i2c3_platform_data,
        },
 };
 
@@ -115,7 +135,7 @@ struct platform_device tegra_i2c_device4 = {
        .resource       = i2c_resource4,
        .num_resources  = ARRAY_SIZE(i2c_resource4),
        .dev = {
-               .platform_data = 0,
+               .platform_data = &tegra_dvc_platform_data,
        },
 };
 
@@ -334,6 +354,28 @@ static struct resource tegra_usb3_resources[] = {
        },
 };
 
+static struct tegra_ulpi_config tegra_ehci2_ulpi_phy_config = {
+       /* All existing boards use GPIO PV0 for phy reset */
+       .reset_gpio = TEGRA_GPIO_PV0,
+       .clk = "cdev2",
+};
+
+static struct tegra_ehci_platform_data tegra_ehci1_pdata = {
+       .operating_mode = TEGRA_USB_OTG,
+       .power_down_on_bus_suspend = 1,
+};
+
+static struct tegra_ehci_platform_data tegra_ehci2_pdata = {
+       .phy_config = &tegra_ehci2_ulpi_phy_config,
+       .operating_mode = TEGRA_USB_HOST,
+       .power_down_on_bus_suspend = 1,
+};
+
+static struct tegra_ehci_platform_data tegra_ehci3_pdata = {
+       .operating_mode = TEGRA_USB_HOST,
+       .power_down_on_bus_suspend = 1,
+};
+
 static u64 tegra_ehci_dmamask = DMA_BIT_MASK(32);
 
 struct platform_device tegra_ehci1_device = {
@@ -342,6 +384,7 @@ struct platform_device tegra_ehci1_device = {
        .dev    = {
                .dma_mask       = &tegra_ehci_dmamask,
                .coherent_dma_mask = DMA_BIT_MASK(32),
+               .platform_data = &tegra_ehci1_pdata,
        },
        .resource = tegra_usb1_resources,
        .num_resources = ARRAY_SIZE(tegra_usb1_resources),
@@ -353,6 +396,7 @@ struct platform_device tegra_ehci2_device = {
        .dev    = {
                .dma_mask       = &tegra_ehci_dmamask,
                .coherent_dma_mask = DMA_BIT_MASK(32),
+               .platform_data = &tegra_ehci2_pdata,
        },
        .resource = tegra_usb2_resources,
        .num_resources = ARRAY_SIZE(tegra_usb2_resources),
@@ -364,6 +408,7 @@ struct platform_device tegra_ehci3_device = {
        .dev    = {
                .dma_mask       = &tegra_ehci_dmamask,
                .coherent_dma_mask = DMA_BIT_MASK(32),
+               .platform_data = &tegra_ehci3_pdata,
        },
        .resource = tegra_usb3_resources,
        .num_resources = ARRAY_SIZE(tegra_usb3_resources),
diff --git a/arch/arm/mach-tegra/include/mach/barriers.h b/arch/arm/mach-tegra/include/mach/barriers.h
deleted file mode 100644 (file)
index 425b42e..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * arch/arm/mach-realview/include/mach/barriers.h
- *
- * Copyright (C) 2010 ARM Ltd.
- * Written by Catalin Marinas <catalin.marinas@arm.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef __MACH_BARRIERS_H
-#define __MACH_BARRIERS_H
-
-#include <asm/outercache.h>
-
-#define rmb()          dsb()
-#define wmb()          do { dsb(); outer_sync(); } while (0)
-#define mb()           wmb()
-
-#endif /* __MACH_BARRIERS_H */
index b8ae3c978dee30a26ce8ca4df3828714c3551f87..468523c72b431523ef6cc87c8aa3135a89289d06 100644 (file)
@@ -122,7 +122,7 @@ void __init smp_init_cpus(void)
        }
 
        for (i = 0; i < ncores; i++)
-               cpu_set(i, cpu_possible_map);
+               set_cpu_possible(i, true);
 
        set_smp_cross_call(gic_raise_softirq);
 }
index bb618075fab67911b97bf757147cc85b425bc40d..0fe9b3ee294768b7c44efc90c6a012e18f5c15d9 100644 (file)
@@ -2182,8 +2182,8 @@ struct clk tegra_list_clks[] = {
        PERIPH_CLK("tvo",       "tvo",                  NULL,   49,     0x188,  250000000, mux_pllp_plld_pllc_clkm,     MUX | DIV_U71), /* requires min voltage */
        PERIPH_CLK("hdmi",      "hdmi",                 NULL,   51,     0x18c,  600000000, mux_pllp_plld_pllc_clkm,     MUX | DIV_U71), /* requires min voltage */
        PERIPH_CLK("tvdac",     "tvdac",                NULL,   53,     0x194,  250000000, mux_pllp_plld_pllc_clkm,     MUX | DIV_U71), /* requires min voltage */
-       PERIPH_CLK("disp1",     "tegradc.0",            NULL,   27,     0x138,  600000000, mux_pllp_plld_pllc_clkm,     MUX | DIV_U71), /* scales with voltage and process_id */
-       PERIPH_CLK("disp2",     "tegradc.1",            NULL,   26,     0x13c,  600000000, mux_pllp_plld_pllc_clkm,     MUX | DIV_U71), /* scales with voltage and process_id */
+       PERIPH_CLK("disp1",     "tegradc.0",            NULL,   27,     0x138,  600000000, mux_pllp_plld_pllc_clkm,     MUX), /* scales with voltage and process_id */
+       PERIPH_CLK("disp2",     "tegradc.1",            NULL,   26,     0x13c,  600000000, mux_pllp_plld_pllc_clkm,     MUX), /* scales with voltage and process_id */
        PERIPH_CLK("usbd",      "fsl-tegra-udc",        NULL,   22,     0,      480000000, mux_clk_m,                   0), /* requires min voltage */
        PERIPH_CLK("usb2",      "tegra-ehci.1",         NULL,   58,     0,      480000000, mux_clk_m,                   0), /* requires min voltage */
        PERIPH_CLK("usb3",      "tegra-ehci.2",         NULL,   59,     0,      480000000, mux_clk_m,                   0), /* requires min voltage */
index 5767208f1c1dc5ac99bce10b73b5a4c799b8edb8..7b597e2b19e2aa724d238f04a8b6b503e0ea67aa 100644 (file)
@@ -40,8 +40,8 @@ struct pl022_config_chip dummy_chip_info = {
        .hierarchy = SSP_MASTER,
        /* 0 = drive TX even as slave, 1 = do not drive TX as slave */
        .slave_tx_disable = 0,
-       .rx_lev_trig = SSP_RX_1_OR_MORE_ELEM,
-       .tx_lev_trig = SSP_TX_1_OR_MORE_EMPTY_LOC,
+       .rx_lev_trig = SSP_RX_4_OR_MORE_ELEM,
+       .tx_lev_trig = SSP_TX_4_OR_MORE_EMPTY_LOC,
        .ctrl_len = SSP_BITS_12,
        .wait_state = SSP_MWIRE_WAIT_ZERO,
        .duplex = SSP_MICROWIRE_CHANNEL_FULL_DUPLEX,
index 18d7fa0603c230259ff96d3f9dc910b4a53a3b04..5f51bdeef0ef1dd0a8cdb824dc35ad5f924a7d24 100644 (file)
@@ -27,9 +27,6 @@
 #include <asm/mach/time.h>
 #include <asm/mach/irq.h>
 
-/* Be able to sleep for atleast 4 seconds (usually more) */
-#define APPTIMER_MIN_RANGE 4
-
 /*
  * APP side special timer registers
  * This timer contains four timers which can fire an interrupt each.
@@ -309,11 +306,11 @@ static int u300_set_next_event(unsigned long cycles,
 
 /* Use general purpose timer 1 as clock event */
 static struct clock_event_device clockevent_u300_1mhz = {
-       .name           = "GPT1",
-       .rating         = 300, /* Reasonably fast and accurate clock event */
-       .features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
-       .set_next_event = u300_set_next_event,
-       .set_mode       = u300_set_mode,
+       .name           = "GPT1",
+       .rating         = 300, /* Reasonably fast and accurate clock event */
+       .features       = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
+       .set_next_event = u300_set_next_event,
+       .set_mode       = u300_set_mode,
 };
 
 /* Clock event timer interrupt handler */
@@ -328,9 +325,9 @@ static irqreturn_t u300_timer_interrupt(int irq, void *dev_id)
 }
 
 static struct irqaction u300_timer_irq = {
-       .name           = "U300 Timer Tick",
-       .flags          = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
-       .handler        = u300_timer_interrupt,
+       .name           = "U300 Timer Tick",
+       .flags          = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
+       .handler        = u300_timer_interrupt,
 };
 
 /*
@@ -413,16 +410,10 @@ static void __init u300_timer_init(void)
                        "GPT2", rate, 300, 32, clocksource_mmio_readl_up))
                pr_err("timer: failed to initialize U300 clock source\n");
 
-       clockevents_calc_mult_shift(&clockevent_u300_1mhz,
-                                   rate, APPTIMER_MIN_RANGE);
-       /* 32bit counter, so 32bits delta is max */
-       clockevent_u300_1mhz.max_delta_ns =
-               clockevent_delta2ns(0xffffffff, &clockevent_u300_1mhz);
-       /* This timer is slow enough to set for 1 cycle == 1 MHz */
-       clockevent_u300_1mhz.min_delta_ns =
-               clockevent_delta2ns(1, &clockevent_u300_1mhz);
-       clockevent_u300_1mhz.cpumask = cpumask_of(0);
-       clockevents_register_device(&clockevent_u300_1mhz);
+       /* Configure and register the clockevent */
+       clockevents_config_and_register(&clockevent_u300_1mhz, rate,
+                                       1, 0xffffffff);
+
        /*
         * TODO: init and register the rest of the timers too, they can be
         * used by hrtimers!
index f8b9392ee3471b7628a7f8fcfd7ce50d7d52f269..4210cb434dbc6be30badd18e0caf10144f9bfbbb 100644 (file)
@@ -20,7 +20,7 @@ config UX500_SOC_DB8500
 
 endmenu
 
-menu "Ux500 target platform"
+menu "Ux500 target platform (boards)"
 
 config MACH_U8500
        bool "U8500 Development platform"
@@ -29,6 +29,19 @@ config MACH_U8500
        help
          Include support for the mop500 development platform.
 
+config MACH_HREFV60
+       bool "U85000 Development platform, HREFv60 version"
+       depends on UX500_SOC_DB8500
+       help
+         Include support for the HREFv60 new development platform.
+
+config MACH_SNOWBALL
+       bool "U8500 Snowball platform"
+       depends on UX500_SOC_DB8500
+       select MACH_U8500
+       help
+         Include support for the snowball development platform.
+
 config MACH_U5500
        bool "U5500 Development platform"
        depends on UX500_SOC_DB5500
index 70cdbd60596a906d3c6264a4610c3151f4aaa14d..f26fd76f72b4f26301b2af1226664c4767ae6b86 100644 (file)
@@ -236,6 +236,46 @@ static pin_cfg_t mop500_pins_hrefv60[] = {
 
 };
 
+static pin_cfg_t snowball_pins[] = {
+       /* SSP0, to AB8500 */
+       GPIO143_SSP0_CLK,
+       GPIO144_SSP0_FRM,
+       GPIO145_SSP0_RXD        | PIN_PULL_DOWN,
+       GPIO146_SSP0_TXD,
+
+       /* MMC0: MicroSD card */
+       GPIO21_MC0_DAT31DIR     | PIN_OUTPUT_HIGH,
+
+       /* MMC2: LAN */
+       GPIO86_SM_ADQ0,
+       GPIO87_SM_ADQ1,
+       GPIO88_SM_ADQ2,
+       GPIO89_SM_ADQ3,
+       GPIO90_SM_ADQ4,
+       GPIO91_SM_ADQ5,
+       GPIO92_SM_ADQ6,
+       GPIO93_SM_ADQ7,
+
+       GPIO94_SM_ADVn,
+       GPIO95_SM_CS0n,
+       GPIO96_SM_OEn,
+       GPIO97_SM_WEn,
+
+       GPIO128_SM_CKO,
+       GPIO130_SM_FBCLK,
+       GPIO131_SM_ADQ8,
+       GPIO132_SM_ADQ9,
+       GPIO133_SM_ADQ10,
+       GPIO134_SM_ADQ11,
+       GPIO135_SM_ADQ12,
+       GPIO136_SM_ADQ13,
+       GPIO137_SM_ADQ14,
+       GPIO138_SM_ADQ15,
+
+       /* RSTn_LAN */
+       GPIO141_GPIO            | PIN_OUTPUT_HIGH,
+};
+
 void __init mop500_pins_init(void)
 {
        nmk_config_pins(mop500_pins_common,
@@ -243,6 +283,9 @@ void __init mop500_pins_init(void)
        if (machine_is_hrefv60())
                nmk_config_pins(mop500_pins_hrefv60,
                                ARRAY_SIZE(mop500_pins_hrefv60));
+       else if (machine_is_snowball())
+               nmk_config_pins(snowball_pins,
+                               ARRAY_SIZE(snowball_pins));
        else
                nmk_config_pins(mop500_pins_default,
                                ARRAY_SIZE(mop500_pins_default));
index 9ed0f90cfe2368d33dc89f1b2a8679c69a8ddd8d..c0bc833df9032c60efdada89bfa4c64d0685ff7c 100644 (file)
@@ -272,7 +272,14 @@ struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS] = {
                        .max_uV = 2900000,
                        .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
                                          REGULATOR_CHANGE_STATUS,
-                       .boot_on = 1, /* must be on for display */
+                       .boot_on = 1, /* display is on at boot */
+                       /*
+                        * This voltage cannot be disabled right now because
+                        * it is somehow affecting the external MMC
+                        * functionality, though that typically will use
+                        * AUX3.
+                        */
+                       .always_on = 1,
                },
                .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux1_consumers),
                .consumer_supplies = ab8500_vaux1_consumers,
index 7c6cb4fa47a937211b16917cd63d5ac008bd574c..d0cb9e5eb87c344deac47cad41d782f1b82abd45 100644 (file)
 #define MCI_DATA31DIREN                (1 << 5)
 #define MCI_FBCLKEN            (1 << 7)
 
+/* GPIO pins used by the sdi0 level shifter */
+static int sdi0_en = -1;
+static int sdi0_vsel = -1;
+
 static u32 mop500_sdi0_vdd_handler(struct device *dev, unsigned int vdd,
                                   unsigned char power_mode)
 {
-       if (power_mode == MMC_POWER_UP)
-               gpio_set_value_cansleep(GPIO_SDMMC_EN, 1);
-       else if (power_mode == MMC_POWER_OFF)
-               gpio_set_value_cansleep(GPIO_SDMMC_EN, 0);
+       switch (power_mode) {
+       case MMC_POWER_UP:
+       case MMC_POWER_ON:
+               /*
+                * Level shifter voltage should depend on vdd to when deciding
+                * on either 1.8V or 2.9V. Once the decision has been made the
+                * level shifter must be disabled and re-enabled with a changed
+                * select signal in order to switch the voltage. Since there is
+                * no framework support yet for indicating 1.8V in vdd, use the
+                * default 2.9V.
+                */
+               gpio_direction_output(sdi0_vsel, 0);
+               gpio_direction_output(sdi0_en, 1);
+               break;
+       case MMC_POWER_OFF:
+               gpio_direction_output(sdi0_vsel, 0);
+               gpio_direction_output(sdi0_en, 0);
+               break;
+       }
 
        return MCI_FBCLKEN | MCI_CMDDIREN | MCI_DATA0DIREN |
               MCI_DATA2DIREN | MCI_DATA31DIREN;
@@ -67,8 +86,10 @@ static struct stedma40_chan_cfg mop500_sdi0_dma_cfg_tx = {
 static struct mmci_platform_data mop500_sdi0_data = {
        .vdd_handler    = mop500_sdi0_vdd_handler,
        .ocr_mask       = MMC_VDD_29_30,
-       .f_max          = 100000000,
-       .capabilities   = MMC_CAP_4_BIT_DATA,
+       .f_max          = 50000000,
+       .capabilities   = MMC_CAP_4_BIT_DATA |
+                               MMC_CAP_SD_HIGHSPEED |
+                               MMC_CAP_MMC_HIGHSPEED,
        .gpio_wp        = -1,
 #ifdef CONFIG_STE_DMA40
        .dma_filter     = stedma40_filter,
@@ -77,10 +98,6 @@ static struct mmci_platform_data mop500_sdi0_data = {
 #endif
 };
 
-/* GPIO pins used by the sdi0 level shifter */
-static int sdi0_en = -1;
-static int sdi0_vsel = -1;
-
 static void sdi0_configure(void)
 {
        int ret;
@@ -140,7 +157,7 @@ static struct stedma40_chan_cfg mop500_sdi2_dma_cfg_tx = {
 
 static struct mmci_platform_data mop500_sdi2_data = {
        .ocr_mask       = MMC_VDD_165_195,
-       .f_max          = 100000000,
+       .f_max          = 50000000,
        .capabilities   = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
        .gpio_cd        = -1,
        .gpio_wp        = -1,
@@ -177,7 +194,7 @@ static struct stedma40_chan_cfg mop500_sdi4_dma_cfg_tx = {
 
 static struct mmci_platform_data mop500_sdi4_data = {
        .ocr_mask       = MMC_VDD_29_30,
-       .f_max          = 100000000,
+       .f_max          = 50000000,
        .capabilities   = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA |
                          MMC_CAP_MMC_HIGHSPEED,
        .gpio_cd        = -1,
@@ -199,17 +216,27 @@ void __init mop500_sdi_init(void)
        /* PoP:ed eMMC on top of DB8500 v1.0 has problems with high speed */
        if (!cpu_is_u8500v10())
                mop500_sdi2_data.capabilities |= MMC_CAP_MMC_HIGHSPEED;
-       db8500_add_sdi2(&mop500_sdi2_data, periphid);
+       /* sdi2 on snowball is in ATL_B mode for FSMC (LAN) */
+       if (!machine_is_snowball())
+               db8500_add_sdi2(&mop500_sdi2_data, periphid);
 
        /* On-board eMMC */
        db8500_add_sdi4(&mop500_sdi4_data, periphid);
 
-       if (machine_is_hrefv60()) {
-               mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO;
-               sdi0_en = HREFV60_SDMMC_EN_GPIO;
-               sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO;
+       if (machine_is_hrefv60() || machine_is_snowball()) {
+               if (machine_is_hrefv60()) {
+                       mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO;
+                       sdi0_en = HREFV60_SDMMC_EN_GPIO;
+                       sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO;
+               } else if (machine_is_snowball()) {
+                       mop500_sdi0_data.gpio_cd = SNOWBALL_SDMMC_CD_GPIO;
+                       mop500_sdi0_data.cd_invert = true;
+                       sdi0_en = SNOWBALL_SDMMC_EN_GPIO;
+                       sdi0_vsel = SNOWBALL_SDMMC_1V8_3V_GPIO;
+               }
                sdi0_configure();
        }
+
        /*
         * On boards with the TC35892 GPIO expander, sdi0 will finally
         * be added when the TC35892 initializes and calls
index 69cce41f602a2243c131dc51b3b6bfb8b5f516a3..5af36aa56c08c140f899c702537ca0867d6f135c 100644 (file)
@@ -25,7 +25,7 @@ struct uib {
        void (*init)(void);
 };
 
-static struct __initdata uib mop500_uibs[] = {
+static struct uib __initdata mop500_uibs[] = {
        [STUIB] = {
                .name   = "ST-UIB",
                .option = "stuib",
index 2a08c07dec6dfd3c9d44cb837f4f43e01ea75e77..cd54abaccd96460e1a821d574223887dedb82f86 100644 (file)
 #include <linux/mfd/ab8500/gpio.h>
 #include <linux/leds-lp5521.h>
 #include <linux/input.h>
+#include <linux/smsc911x.h>
 #include <linux/gpio_keys.h>
 #include <linux/delay.h>
 
+#include <linux/leds.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
 #include "board-mop500.h"
 #include "board-mop500-regulators.h"
 
+static struct gpio_led snowball_led_array[] = {
+       {
+               .name = "user_led",
+               .default_trigger = "none",
+               .gpio = 142,
+       },
+};
+
+static struct gpio_led_platform_data snowball_led_data = {
+       .leds = snowball_led_array,
+       .num_leds = ARRAY_SIZE(snowball_led_array),
+};
+
+static struct platform_device snowball_led_dev = {
+       .name = "leds-gpio",
+       .dev = {
+               .platform_data = &snowball_led_data,
+       },
+};
+
 static struct ab8500_gpio_platform_data ab8500_gpio_pdata = {
        .gpio_base              = MOP500_AB8500_GPIO(0),
        .irq_base               = MOP500_AB8500_VIR_GPIO_IRQ_BASE,
@@ -69,6 +91,97 @@ static struct ab8500_gpio_platform_data ab8500_gpio_pdata = {
                                        0x7A, 0x00, 0x00},
 };
 
+static struct gpio_keys_button snowball_key_array[] = {
+       {
+               .gpio           = 32,
+               .type           = EV_KEY,
+               .code           = KEY_1,
+               .desc           = "userpb",
+               .active_low     = 1,
+               .debounce_interval = 50,
+               .wakeup         = 1,
+       },
+       {
+               .gpio           = 151,
+               .type           = EV_KEY,
+               .code           = KEY_2,
+               .desc           = "extkb1",
+               .active_low     = 1,
+               .debounce_interval = 50,
+               .wakeup         = 1,
+       },
+       {
+               .gpio           = 152,
+               .type           = EV_KEY,
+               .code           = KEY_3,
+               .desc           = "extkb2",
+               .active_low     = 1,
+               .debounce_interval = 50,
+               .wakeup         = 1,
+       },
+       {
+               .gpio           = 161,
+               .type           = EV_KEY,
+               .code           = KEY_4,
+               .desc           = "extkb3",
+               .active_low     = 1,
+               .debounce_interval = 50,
+               .wakeup         = 1,
+       },
+       {
+               .gpio           = 162,
+               .type           = EV_KEY,
+               .code           = KEY_5,
+               .desc           = "extkb4",
+               .active_low     = 1,
+               .debounce_interval = 50,
+               .wakeup         = 1,
+       },
+};
+
+static struct gpio_keys_platform_data snowball_key_data = {
+       .buttons        = snowball_key_array,
+       .nbuttons       = ARRAY_SIZE(snowball_key_array),
+};
+
+static struct platform_device snowball_key_dev = {
+       .name           = "gpio-keys",
+       .id             = -1,
+       .dev            = {
+               .platform_data  = &snowball_key_data,
+       }
+};
+
+static struct smsc911x_platform_config snowball_sbnet_cfg = {
+       .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
+       .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
+       .flags = SMSC911X_USE_16BIT | SMSC911X_FORCE_INTERNAL_PHY,
+       .shift = 1,
+};
+
+static struct resource sbnet_res[] = {
+       {
+               .name = "smsc911x-memory",
+               .start = (0x5000 << 16),
+               .end  =  (0x5000 << 16) + 0xffff,
+               .flags = IORESOURCE_MEM,
+       },
+       {
+               .start = NOMADIK_GPIO_TO_IRQ(140),
+               .end = NOMADIK_GPIO_TO_IRQ(140),
+               .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
+       },
+};
+
+static struct platform_device snowball_sbnet_dev = {
+       .name           = "smsc911x",
+       .num_resources  = ARRAY_SIZE(sbnet_res),
+       .resource       = sbnet_res,
+       .dev            = {
+               .platform_data = &snowball_sbnet_cfg,
+       },
+};
+
 static struct ab8500_platform_data ab8500_platdata = {
        .irq_base       = MOP500_AB8500_IRQ_BASE,
        .regulator_reg_init = ab8500_regulator_reg_init,
@@ -295,8 +408,9 @@ static void mop500_prox_deactivate(struct device *dev)
 }
 
 /* add any platform devices here - TODO */
-static struct platform_device *platform_devs[] __initdata = {
+static struct platform_device *mop500_platform_devs[] __initdata = {
        &mop500_gpio_keys_device,
+       &ab8500_device,
 };
 
 #ifdef CONFIG_STE_DMA40
@@ -478,6 +592,13 @@ static void __init mop500_uart_init(void)
        db8500_add_uart2(&uart2_plat);
 }
 
+static struct platform_device *snowball_platform_devs[] __initdata = {
+       &snowball_led_dev,
+       &snowball_key_dev,
+       &snowball_sbnet_dev,
+       &ab8500_device,
+};
+
 static void __init mop500_init_machine(void)
 {
        int i2c0_devs;
@@ -487,24 +608,29 @@ static void __init mop500_init_machine(void)
         * all these GPIO pins to the internal GPIO controller
         * instead.
         */
-       if (machine_is_hrefv60())
-               mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
-       else
-               mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
+       if (!machine_is_snowball()) {
+               if (machine_is_hrefv60())
+                       mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
+               else
+                       mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
+       }
 
        u8500_init_devices();
 
        mop500_pins_init();
 
-       platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs));
+       if (machine_is_snowball())
+               platform_add_devices(snowball_platform_devs,
+                                       ARRAY_SIZE(snowball_platform_devs));
+       else
+               platform_add_devices(mop500_platform_devs,
+                                       ARRAY_SIZE(mop500_platform_devs));
 
        mop500_i2c_init();
        mop500_sdi_init();
        mop500_spi_init();
        mop500_uart_init();
 
-       platform_device_register(&ab8500_device);
-
        i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
        if (machine_is_hrefv60())
                i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES;
@@ -512,6 +638,9 @@ static void __init mop500_init_machine(void)
        i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs);
        i2c_register_board_info(2, mop500_i2c2_devices,
                                ARRAY_SIZE(mop500_i2c2_devices));
+
+       /* This board has full regulator constraints */
+       regulator_has_full_constraints();
 }
 
 MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
@@ -531,3 +660,12 @@ MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
        .timer          = &ux500_timer,
        .init_machine   = mop500_init_machine,
 MACHINE_END
+
+MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
+       .boot_params    = 0x100,
+       .map_io         = u8500_map_io,
+       .init_irq       = ux500_init_irq,
+       /* we re-use nomadik timer here */
+       .timer          = &ux500_timer,
+       .init_machine   = mop500_init_machine,
+MACHINE_END
index 03a31cc9b0841243c48fd57cbe555b1507a68efe..ee77a8970c33b0d47e8300e7d4043e04eebbbe77 100644 (file)
@@ -7,6 +7,11 @@
 #ifndef __BOARD_MOP500_H
 #define __BOARD_MOP500_H
 
+/* snowball GPIO for MMC card */
+#define SNOWBALL_SDMMC_EN_GPIO 217
+#define SNOWBALL_SDMMC_1V8_3V_GPIO 228
+#define SNOWBALL_SDMMC_CD_GPIO 218
+
 /* HREFv60-specific GPIO assignments, this board has no GPIO expander */
 #define HREFV60_TOUCH_RST_GPIO         143
 #define HREFV60_PROX_SENSE_GPIO                217
index 32ce90840ee1509dbc877a037298b956ea18b4ba..b4e786a0fa4f9db597a8b20e0e7f6bfd7b4779c1 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/clkdev.h>
+#include <linux/cpufreq.h>
 
 #include <plat/mtu.h>
 #include <mach/hardware.h>
@@ -759,6 +760,51 @@ err_out:
 late_initcall(clk_debugfs_init);
 #endif /* defined(CONFIG_DEBUG_FS) */
 
+unsigned long clk_smp_twd_rate = 400000000;
+
+unsigned long clk_smp_twd_get_rate(struct clk *clk)
+{
+       return clk_smp_twd_rate;
+}
+
+static struct clk clk_smp_twd = {
+       .get_rate = clk_smp_twd_get_rate,
+       .name =  "smp_twd",
+};
+
+static struct clk_lookup clk_smp_twd_lookup = {
+       .dev_id = "smp_twd",
+       .clk = &clk_smp_twd,
+};
+
+#ifdef CONFIG_CPU_FREQ
+
+static int clk_twd_cpufreq_transition(struct notifier_block *nb,
+                                     unsigned long state, void *data)
+{
+       struct cpufreq_freqs *f = data;
+
+       if (state == CPUFREQ_PRECHANGE) {
+               /* Save frequency in simple Hz */
+               clk_smp_twd_rate = f->new * 1000;
+       }
+
+       return NOTIFY_OK;
+}
+
+static struct notifier_block clk_twd_cpufreq_nb = {
+       .notifier_call = clk_twd_cpufreq_transition,
+};
+
+static int clk_init_smp_twd_cpufreq(void)
+{
+       return cpufreq_register_notifier(&clk_twd_cpufreq_nb,
+                                 CPUFREQ_TRANSITION_NOTIFIER);
+}
+late_initcall(clk_init_smp_twd_cpufreq);
+
+#endif
+
 int __init clk_init(void)
 {
        if (cpu_is_u8500ed()) {
@@ -779,6 +825,8 @@ int __init clk_init(void)
        else
                clkdev_add_table(u8500_v1_clks, ARRAY_SIZE(u8500_v1_clks));
 
+       clkdev_add(&clk_smp_twd_lookup);
+
 #ifdef CONFIG_DEBUG_FS
        clk_debugfs_add_table(u8500_common_clks, ARRAY_SIZE(u8500_common_clks));
        if (cpu_is_u8500ed())
index c01bc19e3c5eac6c51d3adf1cffb13333a29047b..22705d246fc7ee8262858f46e521a1bd86276f27 100644 (file)
@@ -44,6 +44,7 @@ static struct map_desc u5500_io_desc[] __initdata = {
        __IO_DEV_DESC(U5500_GPIO3_BASE, SZ_4K),
        __IO_DEV_DESC(U5500_GPIO4_BASE, SZ_4K),
        __IO_DEV_DESC(U5500_PRCMU_BASE, SZ_4K),
+       __IO_DEV_DESC(U5500_PRCMU_TCDM_BASE, SZ_4K),
 };
 
 static struct resource db5500_pmu_resources[] = {
index 088b550c40df5f12b6e01baee83cd88a67deca9c..7dd08074c37b6adfce0437aa80f017ea923ac8e9 100644 (file)
@@ -54,7 +54,8 @@ static inline void arch_decomp_setup(void)
        if (machine_is_u8500() ||
            machine_is_svp8500v1() ||
            machine_is_svp8500v2() ||
-           machine_is_hrefv60())
+           machine_is_hrefv60()   ||
+           machine_is_snowball())
                ux500_uart_base = U8500_UART2_BASE;
        else if (machine_is_u5500())
                ux500_uart_base = U5500_UART0_BASE;
index 82e535953fd978cd786336661af6c398b4d5c47f..0a01cbdfe06339492c8aa21632d3223af3bf4ef1 100644 (file)
@@ -6,6 +6,7 @@
  */
 #include <linux/platform_device.h>
 #include <linux/usb/musb.h>
+#include <linux/dma-mapping.h>
 #include <plat/ste_dma40.h>
 #include <mach/hardware.h>
 #include <mach/usb.h>
index 245140c0df107d5b00830032f3351fe6cc82ff88..642de0408f25731eb6081958cafa67beb793c4ab 100644 (file)
 static void __iomem *ic_regbase;
 static void __iomem *sic_regbase;
 
-static void vt8500_irq_mask(unsigned int irq)
+static void vt8500_irq_mask(struct irq_data *d)
 {
        void __iomem *base = ic_regbase;
+       unsigned irq = d->irq;
        u8 edge;
 
        if (irq >= 64) {
@@ -64,9 +65,10 @@ static void vt8500_irq_mask(unsigned int irq)
        }
 }
 
-static void vt8500_irq_unmask(unsigned int irq)
+static void vt8500_irq_unmask(struct irq_data *d)
 {
        void __iomem *base = ic_regbase;
+       unsigned irq = d->irq;
        u8 dctr;
 
        if (irq >= 64) {
@@ -78,10 +80,11 @@ static void vt8500_irq_unmask(unsigned int irq)
        writeb(dctr, base + VT8500_IC_DCTR + irq);
 }
 
-static int vt8500_irq_set_type(unsigned int irq, unsigned int flow_type)
+static int vt8500_irq_set_type(struct irq_data *d, unsigned int flow_type)
 {
        void __iomem *base = ic_regbase;
-       unsigned int orig_irq = irq;
+       unsigned irq = d->irq;
+       unsigned orig_irq = irq;
        u8 dctr;
 
        if (irq >= 64) {
@@ -114,11 +117,11 @@ static int vt8500_irq_set_type(unsigned int irq, unsigned int flow_type)
 }
 
 static struct irq_chip vt8500_irq_chip = {
-       .name      = "vt8500",
-       .ack       = vt8500_irq_mask,
-       .mask      = vt8500_irq_mask,
-       .unmask    = vt8500_irq_unmask,
-       .set_type  = vt8500_irq_set_type,
+       .name = "vt8500",
+       .irq_ack = vt8500_irq_mask,
+       .irq_mask = vt8500_irq_mask,
+       .irq_unmask = vt8500_irq_unmask,
+       .irq_set_type = vt8500_irq_set_type,
 };
 
 void __init vt8500_init_irq(void)
index 0074b8dba793d6b9c54cd0869ab7f40535f7e07d..cb26d49a8cd671266ec585b8bf2a6672470cbde7 100644 (file)
@@ -821,7 +821,7 @@ config CACHE_L2X0
        depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \
                   REALVIEW_EB_A9MP || SOC_IMX35 || SOC_IMX31 || MACH_REALVIEW_PBX || \
                   ARCH_NOMADIK || ARCH_OMAP4 || ARCH_EXYNOS4 || ARCH_TEGRA || \
-                  ARCH_U8500 || ARCH_VEXPRESS_CA9X4 || ARCH_SHMOBILE
+                  ARCH_U8500 || ARCH_VEXPRESS_CA9X4 || ARCH_SHMOBILE || ARCH_CNS3XXX
        default y
        select OUTER_CACHE
        select OUTER_CACHE_SYNC
index ef59099a5463e5bbb409caf7e5a97ffbaf065d24..44c086710d2ba5d21a40741290ef8c40de35928c 100644 (file)
@@ -120,17 +120,22 @@ static void l2x0_cache_sync(void)
        spin_unlock_irqrestore(&l2x0_lock, flags);
 }
 
-static void l2x0_flush_all(void)
+static void __l2x0_flush_all(void)
 {
-       unsigned long flags;
-
-       /* clean all ways */
-       spin_lock_irqsave(&l2x0_lock, flags);
        debug_writel(0x03);
        writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_CLEAN_INV_WAY);
        cache_wait_way(l2x0_base + L2X0_CLEAN_INV_WAY, l2x0_way_mask);
        cache_sync();
        debug_writel(0x00);
+}
+
+static void l2x0_flush_all(void)
+{
+       unsigned long flags;
+
+       /* clean all ways */
+       spin_lock_irqsave(&l2x0_lock, flags);
+       __l2x0_flush_all();
        spin_unlock_irqrestore(&l2x0_lock, flags);
 }
 
@@ -266,7 +271,9 @@ static void l2x0_disable(void)
        unsigned long flags;
 
        spin_lock_irqsave(&l2x0_lock, flags);
-       writel(0, l2x0_base + L2X0_CTRL);
+       __l2x0_flush_all();
+       writel_relaxed(0, l2x0_base + L2X0_CTRL);
+       dsb();
        spin_unlock_irqrestore(&l2x0_lock, flags);
 }
 
index 9d9e736c2b4f4afe2a90190d8b583c8e1f0c656a..594d677b92c883c25c4d5051bcc635394984b6f6 100644 (file)
@@ -759,7 +759,7 @@ early_param("vmalloc", early_vmalloc);
 
 static phys_addr_t lowmem_limit __initdata = 0;
 
-static void __init sanity_check_meminfo(void)
+void __init sanity_check_meminfo(void)
 {
        int i, j, highmem = 0;
 
@@ -1032,8 +1032,9 @@ void __init paging_init(struct machine_desc *mdesc)
 {
        void *zero_page;
 
+       memblock_set_current_limit(lowmem_limit);
+
        build_mem_type_table();
-       sanity_check_meminfo();
        prepare_page_table();
        map_lowmem();
        devicemaps_init(mdesc);
index 687d02319a41ea68afcfe65698204a4db84d8400..941a98c9e8aaf327b5131227ccaddb1d697ad2e5 100644 (file)
@@ -27,6 +27,10 @@ void __init arm_mm_memblock_reserve(void)
        memblock_reserve(CONFIG_VECTORS_BASE, PAGE_SIZE);
 }
 
+void __init sanity_check_meminfo(void)
+{
+}
+
 /*
  * paging_init() sets up the page tables, initialises the zone memory
  * maps, and sets up the zero page, bad page and bad page tables.
index a1387875a491942949416789816f9f308c259280..d53c35fe2ea71cfb67f8684446b017457862e07b 100644 (file)
@@ -3,7 +3,7 @@
 #
 
 # Common support
-obj-y := clock.o gpio.o time.o devices.o cpu.o system.o irq-common.o
+obj-y := clock.o time.o devices.o cpu.o system.o irq-common.o
 
 # MX51 uses the TZIC interrupt controller, older platforms use AVIC
 obj-$(CONFIG_MXC_TZIC) += tzic.o
index 09e2bd0fcdca742a41b004d3c846fa16b298a309..55d2534ec727e0d47a13235cb4eec9ab534e5657 100644 (file)
@@ -46,6 +46,8 @@
 #define AVIC_FIPNDH            0x60    /* fast int pending high */
 #define AVIC_FIPNDL            0x64    /* fast int pending low */
 
+#define AVIC_NUM_IRQS 64
+
 void __iomem *avic_base;
 
 #ifdef CONFIG_MXC_IRQ_PRIOR
@@ -54,7 +56,7 @@ static int avic_irq_set_priority(unsigned char irq, unsigned char prio)
        unsigned int temp;
        unsigned int mask = 0x0F << irq % 8 * 4;
 
-       if (irq >= MXC_INTERNAL_IRQS)
+       if (irq >= AVIC_NUM_IRQS)
                return -EINVAL;;
 
        temp = __raw_readl(avic_base + AVIC_NIPRIORITY(irq / 8));
@@ -72,14 +74,14 @@ static int avic_set_irq_fiq(unsigned int irq, unsigned int type)
 {
        unsigned int irqt;
 
-       if (irq >= MXC_INTERNAL_IRQS)
+       if (irq >= AVIC_NUM_IRQS)
                return -EINVAL;
 
-       if (irq < MXC_INTERNAL_IRQS / 2) {
+       if (irq < AVIC_NUM_IRQS / 2) {
                irqt = __raw_readl(avic_base + AVIC_INTTYPEL) & ~(1 << irq);
                __raw_writel(irqt | (!!type << irq), avic_base + AVIC_INTTYPEL);
        } else {
-               irq -= MXC_INTERNAL_IRQS / 2;
+               irq -= AVIC_NUM_IRQS / 2;
                irqt = __raw_readl(avic_base + AVIC_INTTYPEH) & ~(1 << irq);
                __raw_writel(irqt | (!!type << irq), avic_base + AVIC_INTTYPEH);
        }
@@ -138,7 +140,7 @@ void __init mxc_init_irq(void __iomem *irqbase)
        /* all IRQ no FIQ */
        __raw_writel(0, avic_base + AVIC_INTTYPEH);
        __raw_writel(0, avic_base + AVIC_INTTYPEL);
-       for (i = 0; i < MXC_INTERNAL_IRQS; i++) {
+       for (i = 0; i < AVIC_NUM_IRQS; i++) {
                irq_set_chip_and_handler(i, &mxc_avic_chip.base,
                                         handle_level_irq);
                set_irq_flags(i, IRQF_VALID);
index eee1b6096a0898ce869238cd5b421bca50a6e411..0d6ed31bdbf27c63a8af85949317fd2d2783a1f6 100644 (file)
@@ -89,3 +89,28 @@ err:
 
        return pdev;
 }
+
+struct device mxc_aips_bus = {
+       .init_name      = "mxc_aips",
+       .parent         = &platform_bus,
+};
+
+struct device mxc_ahb_bus = {
+       .init_name      = "mxc_ahb",
+       .parent         = &platform_bus,
+};
+
+static int __init mxc_device_init(void)
+{
+       int ret;
+
+       ret = device_register(&mxc_aips_bus);
+       if (IS_ERR_VALUE(ret))
+               goto done;
+
+       ret = device_register(&mxc_ahb_bus);
+
+done:
+       return ret;
+}
+core_initcall(mxc_device_init);
index ad2922acf480428976cecb8e01a1c4a54089ca78..b41bf972b54b6f837f1be2f53ab5f72fb47649b5 100644 (file)
@@ -2,6 +2,7 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_FEC) += platform-fec.o
 obj-$(CONFIG_IMX_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o
 obj-$(CONFIG_IMX_HAVE_PLATFORM_FSL_USB2_UDC) += platform-fsl-usb2-udc.o
 obj-$(CONFIG_IMX_HAVE_PLATFORM_GPIO_KEYS) += platform-gpio_keys.o
+obj-y += platform-gpio-mxc.o
 obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX21_HCD) += platform-imx21-hcd.o
 obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX2_WDT) += platform-imx2-wdt.o
 obj-$(CONFIG_IMX_HAVE_PLATFORM_IMXDI_RTC) += platform-imxdi_rtc.o
diff --git a/arch/arm/plat-mxc/devices/platform-gpio-mxc.c b/arch/arm/plat-mxc/devices/platform-gpio-mxc.c
new file mode 100644 (file)
index 0000000..cf1b7fd
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2011 Linaro Limited
+ *
+ * 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 <mach/devices-common.h>
+
+struct platform_device *__init mxc_register_gpio(int id,
+       resource_size_t iobase, resource_size_t iosize, int irq, int irq_high)
+{
+       struct resource res[] = {
+               {
+                       .start = iobase,
+                       .end = iobase + iosize - 1,
+                       .flags = IORESOURCE_MEM,
+               }, {
+                       .start = irq,
+                       .end = irq,
+                       .flags = IORESOURCE_IRQ,
+               }, {
+                       .start = irq_high,
+                       .end = irq_high,
+                       .flags = IORESOURCE_IRQ,
+               },
+       };
+
+       return platform_device_register_resndata(&mxc_aips_bus,
+                       "gpio-mxc", id, res, ARRAY_SIZE(res), NULL, 0);
+}
index b130f60ca6b73e9b7b8435dcc52633bb1761078c..2b0fdb23beb873221531086c8fd14ef22e9631a9 100644 (file)
  * the terms of the GNU General Public License version 2 as published by the
  * Free Software Foundation.
  */
-#include <linux/compiler.h>
-#include <linux/err.h>
-#include <linux/init.h>
-
-#include <mach/hardware.h>
 #include <mach/devices-common.h>
-#include <mach/sdma.h>
-
-struct imx_imx_sdma_data {
-       resource_size_t iobase;
-       resource_size_t irq;
-       struct sdma_platform_data pdata;
-};
-
-#define imx_imx_sdma_data_entry_single(soc, _sdma_version, _cpu_name, _to_version)\
-       {                                                               \
-               .iobase = soc ## _SDMA ## _BASE_ADDR,                   \
-               .irq = soc ## _INT_SDMA,                                \
-               .pdata = {                                              \
-                       .sdma_version = _sdma_version,                  \
-                       .cpu_name = _cpu_name,                          \
-                       .to_version = _to_version,                      \
-               },                                                      \
-       }
-
-#ifdef CONFIG_SOC_IMX25
-struct imx_imx_sdma_data imx25_imx_sdma_data __initconst =
-       imx_imx_sdma_data_entry_single(MX25, 1, "imx25", 0);
-#endif /* ifdef CONFIG_SOC_IMX25 */
 
-#ifdef CONFIG_SOC_IMX31
-struct imx_imx_sdma_data imx31_imx_sdma_data __initdata =
-       imx_imx_sdma_data_entry_single(MX31, 1, "imx31", 0);
-#endif /* ifdef CONFIG_SOC_IMX31 */
-
-#ifdef CONFIG_SOC_IMX35
-struct imx_imx_sdma_data imx35_imx_sdma_data __initdata =
-       imx_imx_sdma_data_entry_single(MX35, 2, "imx35", 0);
-#endif /* ifdef CONFIG_SOC_IMX35 */
-
-#ifdef CONFIG_SOC_IMX51
-struct imx_imx_sdma_data imx51_imx_sdma_data __initconst =
-       imx_imx_sdma_data_entry_single(MX51, 2, "imx51", 0);
-#endif /* ifdef CONFIG_SOC_IMX51 */
+struct platform_device __init __maybe_unused *imx_add_imx_dma(void)
+{
+       return platform_device_register_resndata(&mxc_ahb_bus,
+                       "imx-dma", -1, NULL, 0, NULL, 0);
+}
 
-static struct platform_device __init __maybe_unused *imx_add_imx_sdma(
-               const struct imx_imx_sdma_data *data)
+struct platform_device __init __maybe_unused *imx_add_imx_sdma(
+       resource_size_t iobase, int irq, struct sdma_platform_data *pdata)
 {
        struct resource res[] = {
                {
-                       .start = data->iobase,
-                       .end = data->iobase + SZ_4K - 1,
+                       .start = iobase,
+                       .end = iobase + SZ_16K - 1,
                        .flags = IORESOURCE_MEM,
                }, {
-                       .start = data->irq,
-                       .end = data->irq,
+                       .start = irq,
+                       .end = irq,
                        .flags = IORESOURCE_IRQ,
                },
        };
 
-       return imx_add_platform_device("imx-sdma", -1,
-                       res, ARRAY_SIZE(res),
-                       &data->pdata, sizeof(data->pdata));
-}
-
-static struct platform_device __init __maybe_unused *imx_add_imx_dma(void)
-{
-       return imx_add_platform_device("imx-dma", -1, NULL, 0, NULL, 0);
-}
-
-#ifdef CONFIG_ARCH_MX25
-static struct sdma_script_start_addrs addr_imx25_to1 = {
-       .ap_2_ap_addr = 729,
-       .uart_2_mcu_addr = 904,
-       .per_2_app_addr = 1255,
-       .mcu_2_app_addr = 834,
-       .uartsh_2_mcu_addr = 1120,
-       .per_2_shp_addr = 1329,
-       .mcu_2_shp_addr = 1048,
-       .ata_2_mcu_addr = 1560,
-       .mcu_2_ata_addr = 1479,
-       .app_2_per_addr = 1189,
-       .app_2_mcu_addr = 770,
-       .shp_2_per_addr = 1407,
-       .shp_2_mcu_addr = 979,
-};
-#endif
-
-#ifdef CONFIG_SOC_IMX31
-static struct sdma_script_start_addrs addr_imx31_to1 = {
-       .per_2_per_addr = 1677,
-};
-
-static struct sdma_script_start_addrs addr_imx31_to2 = {
-       .ap_2_ap_addr = 423,
-       .ap_2_bp_addr = 829,
-       .bp_2_ap_addr = 1029,
-};
-#endif
-
-#ifdef CONFIG_SOC_IMX35
-static struct sdma_script_start_addrs addr_imx35_to1 = {
-       .ap_2_ap_addr = 642,
-       .uart_2_mcu_addr = 817,
-       .mcu_2_app_addr = 747,
-       .uartsh_2_mcu_addr = 1183,
-       .per_2_shp_addr = 1033,
-       .mcu_2_shp_addr = 961,
-       .ata_2_mcu_addr = 1333,
-       .mcu_2_ata_addr = 1252,
-       .app_2_mcu_addr = 683,
-       .shp_2_per_addr = 1111,
-       .shp_2_mcu_addr = 892,
-};
-
-static struct sdma_script_start_addrs addr_imx35_to2 = {
-       .ap_2_ap_addr = 729,
-       .uart_2_mcu_addr = 904,
-       .per_2_app_addr = 1597,
-       .mcu_2_app_addr = 834,
-       .uartsh_2_mcu_addr = 1270,
-       .per_2_shp_addr = 1120,
-       .mcu_2_shp_addr = 1048,
-       .ata_2_mcu_addr = 1429,
-       .mcu_2_ata_addr = 1339,
-       .app_2_per_addr = 1531,
-       .app_2_mcu_addr = 770,
-       .shp_2_per_addr = 1198,
-       .shp_2_mcu_addr = 979,
-};
-#endif
-
-#ifdef CONFIG_SOC_IMX51
-static struct sdma_script_start_addrs addr_imx51 = {
-       .ap_2_ap_addr = 642,
-       .uart_2_mcu_addr = 817,
-       .mcu_2_app_addr = 747,
-       .mcu_2_shp_addr = 961,
-       .ata_2_mcu_addr = 1473,
-       .mcu_2_ata_addr = 1392,
-       .app_2_per_addr = 1033,
-       .app_2_mcu_addr = 683,
-       .shp_2_per_addr = 1251,
-       .shp_2_mcu_addr = 892,
-};
-#endif
-
-static int __init imxXX_add_imx_dma(void)
-{
-       struct platform_device *ret;
-
-#if defined(CONFIG_SOC_IMX21) || defined(CONFIG_SOC_IMX27)
-       if (cpu_is_mx21() || cpu_is_mx27())
-               ret = imx_add_imx_dma();
-       else
-#endif
-
-#if defined(CONFIG_SOC_IMX25)
-       if (cpu_is_mx25()) {
-               imx25_imx_sdma_data.pdata.script_addrs = &addr_imx25_to1;
-               ret = imx_add_imx_sdma(&imx25_imx_sdma_data);
-       } else
-#endif
-
-#if defined(CONFIG_SOC_IMX31)
-       if (cpu_is_mx31()) {
-               int to_version = mx31_revision() >> 4;
-               imx31_imx_sdma_data.pdata.to_version = to_version;
-               if (to_version == 1)
-                       imx31_imx_sdma_data.pdata.script_addrs = &addr_imx31_to1;
-               else
-                       imx31_imx_sdma_data.pdata.script_addrs = &addr_imx31_to2;
-               ret = imx_add_imx_sdma(&imx31_imx_sdma_data);
-       } else
-#endif
-
-#if defined(CONFIG_SOC_IMX35)
-       if (cpu_is_mx35()) {
-               int to_version = mx35_revision() >> 4;
-               imx35_imx_sdma_data.pdata.to_version = to_version;
-               if (to_version == 1)
-                       imx35_imx_sdma_data.pdata.script_addrs = &addr_imx35_to1;
-               else
-                       imx35_imx_sdma_data.pdata.script_addrs = &addr_imx35_to2;
-               ret = imx_add_imx_sdma(&imx35_imx_sdma_data);
-       } else
-#endif
-
-#if defined(CONFIG_SOC_IMX51)
-       if (cpu_is_mx51()) {
-               int to_version = mx51_revision() >> 4;
-               imx51_imx_sdma_data.pdata.to_version = to_version;
-               imx51_imx_sdma_data.pdata.script_addrs = &addr_imx51;
-               ret = imx_add_imx_sdma(&imx51_imx_sdma_data);
-       } else
-#endif
-               ret = ERR_PTR(-ENODEV);
-
-       if (IS_ERR(ret))
-               return PTR_ERR(ret);
-
-       return 0;
+       return platform_device_register_resndata(&mxc_ahb_bus, "imx-sdma",
+                       -1, res, ARRAY_SIZE(res), pdata, sizeof(*pdata));
 }
-arch_initcall(imxXX_add_imx_dma);
index 2ab74f0da9a6eba27df1a6fea91fa2b288c6917d..afe60f7244a875765c02506acec4615c6c5e8123 100644 (file)
@@ -94,8 +94,9 @@ const struct imx_imx_i2c_data imx53_imx_i2c_data[] __initconst = {
        imx_imx_i2c_data_entry(MX53, _id, _hwid, SZ_4K)
        imx53_imx_i2c_data_entry(0, 1),
        imx53_imx_i2c_data_entry(1, 2),
+       imx53_imx_i2c_data_entry(2, 3),
 };
-#endif /* ifdef CONFIG_SOC_IMX51 */
+#endif /* ifdef CONFIG_SOC_IMX53 */
 
 struct platform_device *__init imx_add_imx_i2c(
                const struct imx_imx_i2c_data *data,
index 26366114b021aadc9cb49173de6c70c0d4e6227c..479c3e9f771f04be7105551e0286cda2a8dd21c3 100644 (file)
@@ -46,6 +46,11 @@ const struct imx_imx_keypad_data imx51_imx_keypad_data __initconst =
        imx_imx_keypad_data_entry_single(MX51, SZ_16);
 #endif /* ifdef CONFIG_SOC_IMX51 */
 
+#ifdef CONFIG_SOC_IMX53
+const struct imx_imx_keypad_data imx53_imx_keypad_data __initconst =
+       imx_imx_keypad_data_entry_single(MX53, SZ_16);
+#endif /* ifdef CONFIG_SOC_IMX53 */
+
 struct platform_device *__init imx_add_imx_keypad(
                const struct imx_imx_keypad_data *data,
                const struct matrix_keymap_data *pdata)
index 2569c8d8a2ef53e7ff4c1bd1894d8a11f15738c2..21c6f30e1017403c386f2694aed6aeb81fd33339 100644 (file)
@@ -69,13 +69,23 @@ const struct imx_imx_ssi_data imx35_imx_ssi_data[] __initconst = {
 #ifdef CONFIG_SOC_IMX51
 const struct imx_imx_ssi_data imx51_imx_ssi_data[] __initconst = {
 #define imx51_imx_ssi_data_entry(_id, _hwid)                           \
-       imx_imx_ssi_data_entry(MX51, _id, _hwid, SZ_4K)
+       imx_imx_ssi_data_entry(MX51, _id, _hwid, SZ_16K)
        imx51_imx_ssi_data_entry(0, 1),
        imx51_imx_ssi_data_entry(1, 2),
        imx51_imx_ssi_data_entry(2, 3),
 };
 #endif /* ifdef CONFIG_SOC_IMX51 */
 
+#ifdef CONFIG_SOC_IMX53
+const struct imx_imx_ssi_data imx53_imx_ssi_data[] __initconst = {
+#define imx53_imx_ssi_data_entry(_id, _hwid)                           \
+       imx_imx_ssi_data_entry(MX53, _id, _hwid, SZ_16K)
+       imx53_imx_ssi_data_entry(0, 1),
+       imx53_imx_ssi_data_entry(1, 2),
+       imx53_imx_ssi_data_entry(2, 3),
+};
+#endif /* ifdef CONFIG_SOC_IMX53 */
+
 struct platform_device *__init imx_add_imx_ssi(
                const struct imx_imx_ssi_data *data,
                const struct imx_ssi_platform_data *pdata)
index 3c854c2cc6ddc8be9c3ca4b28847937f684f1fc1..cfce8c918b73521e4261b3018cf55f11462113c8 100644 (file)
@@ -123,6 +123,8 @@ const struct imx_imx_uart_1irq_data imx53_imx_uart_data[] __initconst = {
        imx53_imx_uart_data_entry(0, 1),
        imx53_imx_uart_data_entry(1, 2),
        imx53_imx_uart_data_entry(2, 3),
+       imx53_imx_uart_data_entry(3, 4),
+       imx53_imx_uart_data_entry(4, 5),
 };
 #endif /* ifdef CONFIG_SOC_IMX53 */
 
diff --git a/arch/arm/plat-mxc/gpio.c b/arch/arm/plat-mxc/gpio.c
deleted file mode 100644 (file)
index 6cd6d7f..0000000
+++ /dev/null
@@ -1,361 +0,0 @@
-/*
- * MXC GPIO support. (c) 2008 Daniel Mack <daniel@caiaq.de>
- * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
- *
- * Based on code from Freescale,
- * Copyright (C) 2004-2010 Freescale Semiconductor, Inc. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- */
-
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/io.h>
-#include <linux/irq.h>
-#include <linux/gpio.h>
-#include <mach/hardware.h>
-#include <asm-generic/bug.h>
-
-static struct mxc_gpio_port *mxc_gpio_ports;
-static int gpio_table_size;
-
-#define cpu_is_mx1_mx2()       (cpu_is_mx1() || cpu_is_mx2())
-
-#define GPIO_DR                (cpu_is_mx1_mx2() ? 0x1c : 0x00)
-#define GPIO_GDIR      (cpu_is_mx1_mx2() ? 0x00 : 0x04)
-#define GPIO_PSR       (cpu_is_mx1_mx2() ? 0x24 : 0x08)
-#define GPIO_ICR1      (cpu_is_mx1_mx2() ? 0x28 : 0x0C)
-#define GPIO_ICR2      (cpu_is_mx1_mx2() ? 0x2C : 0x10)
-#define GPIO_IMR       (cpu_is_mx1_mx2() ? 0x30 : 0x14)
-#define GPIO_ISR       (cpu_is_mx1_mx2() ? 0x34 : 0x18)
-
-#define GPIO_INT_LOW_LEV       (cpu_is_mx1_mx2() ? 0x3 : 0x0)
-#define GPIO_INT_HIGH_LEV      (cpu_is_mx1_mx2() ? 0x2 : 0x1)
-#define GPIO_INT_RISE_EDGE     (cpu_is_mx1_mx2() ? 0x0 : 0x2)
-#define GPIO_INT_FALL_EDGE     (cpu_is_mx1_mx2() ? 0x1 : 0x3)
-#define GPIO_INT_NONE          0x4
-
-/* Note: This driver assumes 32 GPIOs are handled in one register */
-
-static void _clear_gpio_irqstatus(struct mxc_gpio_port *port, u32 index)
-{
-       __raw_writel(1 << index, port->base + GPIO_ISR);
-}
-
-static void _set_gpio_irqenable(struct mxc_gpio_port *port, u32 index,
-                               int enable)
-{
-       u32 l;
-
-       l = __raw_readl(port->base + GPIO_IMR);
-       l = (l & (~(1 << index))) | (!!enable << index);
-       __raw_writel(l, port->base + GPIO_IMR);
-}
-
-static void gpio_ack_irq(struct irq_data *d)
-{
-       u32 gpio = irq_to_gpio(d->irq);
-       _clear_gpio_irqstatus(&mxc_gpio_ports[gpio / 32], gpio & 0x1f);
-}
-
-static void gpio_mask_irq(struct irq_data *d)
-{
-       u32 gpio = irq_to_gpio(d->irq);
-       _set_gpio_irqenable(&mxc_gpio_ports[gpio / 32], gpio & 0x1f, 0);
-}
-
-static void gpio_unmask_irq(struct irq_data *d)
-{
-       u32 gpio = irq_to_gpio(d->irq);
-       _set_gpio_irqenable(&mxc_gpio_ports[gpio / 32], gpio & 0x1f, 1);
-}
-
-static int mxc_gpio_get(struct gpio_chip *chip, unsigned offset);
-
-static int gpio_set_irq_type(struct irq_data *d, u32 type)
-{
-       u32 gpio = irq_to_gpio(d->irq);
-       struct mxc_gpio_port *port = &mxc_gpio_ports[gpio / 32];
-       u32 bit, val;
-       int edge;
-       void __iomem *reg = port->base;
-
-       port->both_edges &= ~(1 << (gpio & 31));
-       switch (type) {
-       case IRQ_TYPE_EDGE_RISING:
-               edge = GPIO_INT_RISE_EDGE;
-               break;
-       case IRQ_TYPE_EDGE_FALLING:
-               edge = GPIO_INT_FALL_EDGE;
-               break;
-       case IRQ_TYPE_EDGE_BOTH:
-               val = mxc_gpio_get(&port->chip, gpio & 31);
-               if (val) {
-                       edge = GPIO_INT_LOW_LEV;
-                       pr_debug("mxc: set GPIO %d to low trigger\n", gpio);
-               } else {
-                       edge = GPIO_INT_HIGH_LEV;
-                       pr_debug("mxc: set GPIO %d to high trigger\n", gpio);
-               }
-               port->both_edges |= 1 << (gpio & 31);
-               break;
-       case IRQ_TYPE_LEVEL_LOW:
-               edge = GPIO_INT_LOW_LEV;
-               break;
-       case IRQ_TYPE_LEVEL_HIGH:
-               edge = GPIO_INT_HIGH_LEV;
-               break;
-       default:
-               return -EINVAL;
-       }
-
-       reg += GPIO_ICR1 + ((gpio & 0x10) >> 2); /* lower or upper register */
-       bit = gpio & 0xf;
-       val = __raw_readl(reg) & ~(0x3 << (bit << 1));
-       __raw_writel(val | (edge << (bit << 1)), reg);
-       _clear_gpio_irqstatus(port, gpio & 0x1f);
-
-       return 0;
-}
-
-static void mxc_flip_edge(struct mxc_gpio_port *port, u32 gpio)
-{
-       void __iomem *reg = port->base;
-       u32 bit, val;
-       int edge;
-
-       reg += GPIO_ICR1 + ((gpio & 0x10) >> 2); /* lower or upper register */
-       bit = gpio & 0xf;
-       val = __raw_readl(reg);
-       edge = (val >> (bit << 1)) & 3;
-       val &= ~(0x3 << (bit << 1));
-       if (edge == GPIO_INT_HIGH_LEV) {
-               edge = GPIO_INT_LOW_LEV;
-               pr_debug("mxc: switch GPIO %d to low trigger\n", gpio);
-       } else if (edge == GPIO_INT_LOW_LEV) {
-               edge = GPIO_INT_HIGH_LEV;
-               pr_debug("mxc: switch GPIO %d to high trigger\n", gpio);
-       } else {
-               pr_err("mxc: invalid configuration for GPIO %d: %x\n",
-                      gpio, edge);
-               return;
-       }
-       __raw_writel(val | (edge << (bit << 1)), reg);
-}
-
-/* handle 32 interrupts in one status register */
-static void mxc_gpio_irq_handler(struct mxc_gpio_port *port, u32 irq_stat)
-{
-       u32 gpio_irq_no_base = port->virtual_irq_start;
-
-       while (irq_stat != 0) {
-               int irqoffset = fls(irq_stat) - 1;
-
-               if (port->both_edges & (1 << irqoffset))
-                       mxc_flip_edge(port, irqoffset);
-
-               generic_handle_irq(gpio_irq_no_base + irqoffset);
-
-               irq_stat &= ~(1 << irqoffset);
-       }
-}
-
-/* MX1 and MX3 has one interrupt *per* gpio port */
-static void mx3_gpio_irq_handler(u32 irq, struct irq_desc *desc)
-{
-       u32 irq_stat;
-       struct mxc_gpio_port *port = irq_get_handler_data(irq);
-
-       irq_stat = __raw_readl(port->base + GPIO_ISR) &
-                       __raw_readl(port->base + GPIO_IMR);
-
-       mxc_gpio_irq_handler(port, irq_stat);
-}
-
-/* MX2 has one interrupt *for all* gpio ports */
-static void mx2_gpio_irq_handler(u32 irq, struct irq_desc *desc)
-{
-       int i;
-       u32 irq_msk, irq_stat;
-       struct mxc_gpio_port *port = irq_get_handler_data(irq);
-
-       /* walk through all interrupt status registers */
-       for (i = 0; i < gpio_table_size; i++) {
-               irq_msk = __raw_readl(port[i].base + GPIO_IMR);
-               if (!irq_msk)
-                       continue;
-
-               irq_stat = __raw_readl(port[i].base + GPIO_ISR) & irq_msk;
-               if (irq_stat)
-                       mxc_gpio_irq_handler(&port[i], irq_stat);
-       }
-}
-
-/*
- * Set interrupt number "irq" in the GPIO as a wake-up source.
- * While system is running, all registered GPIO interrupts need to have
- * wake-up enabled. When system is suspended, only selected GPIO interrupts
- * need to have wake-up enabled.
- * @param  irq          interrupt source number
- * @param  enable       enable as wake-up if equal to non-zero
- * @return       This function returns 0 on success.
- */
-static int gpio_set_wake_irq(struct irq_data *d, u32 enable)
-{
-       u32 gpio = irq_to_gpio(d->irq);
-       u32 gpio_idx = gpio & 0x1F;
-       struct mxc_gpio_port *port = &mxc_gpio_ports[gpio / 32];
-
-       if (enable) {
-               if (port->irq_high && (gpio_idx >= 16))
-                       enable_irq_wake(port->irq_high);
-               else
-                       enable_irq_wake(port->irq);
-       } else {
-               if (port->irq_high && (gpio_idx >= 16))
-                       disable_irq_wake(port->irq_high);
-               else
-                       disable_irq_wake(port->irq);
-       }
-
-       return 0;
-}
-
-static struct irq_chip gpio_irq_chip = {
-       .name = "GPIO",
-       .irq_ack = gpio_ack_irq,
-       .irq_mask = gpio_mask_irq,
-       .irq_unmask = gpio_unmask_irq,
-       .irq_set_type = gpio_set_irq_type,
-       .irq_set_wake = gpio_set_wake_irq,
-};
-
-static void _set_gpio_direction(struct gpio_chip *chip, unsigned offset,
-                               int dir)
-{
-       struct mxc_gpio_port *port =
-               container_of(chip, struct mxc_gpio_port, chip);
-       u32 l;
-       unsigned long flags;
-
-       spin_lock_irqsave(&port->lock, flags);
-       l = __raw_readl(port->base + GPIO_GDIR);
-       if (dir)
-               l |= 1 << offset;
-       else
-               l &= ~(1 << offset);
-       __raw_writel(l, port->base + GPIO_GDIR);
-       spin_unlock_irqrestore(&port->lock, flags);
-}
-
-static void mxc_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
-{
-       struct mxc_gpio_port *port =
-               container_of(chip, struct mxc_gpio_port, chip);
-       void __iomem *reg = port->base + GPIO_DR;
-       u32 l;
-       unsigned long flags;
-
-       spin_lock_irqsave(&port->lock, flags);
-       l = (__raw_readl(reg) & (~(1 << offset))) | (!!value << offset);
-       __raw_writel(l, reg);
-       spin_unlock_irqrestore(&port->lock, flags);
-}
-
-static int mxc_gpio_get(struct gpio_chip *chip, unsigned offset)
-{
-       struct mxc_gpio_port *port =
-               container_of(chip, struct mxc_gpio_port, chip);
-
-       return (__raw_readl(port->base + GPIO_PSR) >> offset) & 1;
-}
-
-static int mxc_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
-{
-       _set_gpio_direction(chip, offset, 0);
-       return 0;
-}
-
-static int mxc_gpio_direction_output(struct gpio_chip *chip,
-                                    unsigned offset, int value)
-{
-       mxc_gpio_set(chip, offset, value);
-       _set_gpio_direction(chip, offset, 1);
-       return 0;
-}
-
-/*
- * This lock class tells lockdep that GPIO irqs are in a different
- * category than their parents, so it won't report false recursion.
- */
-static struct lock_class_key gpio_lock_class;
-
-int __init mxc_gpio_init(struct mxc_gpio_port *port, int cnt)
-{
-       int i, j;
-
-       /* save for local usage */
-       mxc_gpio_ports = port;
-       gpio_table_size = cnt;
-
-       printk(KERN_INFO "MXC GPIO hardware\n");
-
-       for (i = 0; i < cnt; i++) {
-               /* disable the interrupt and clear the status */
-               __raw_writel(0, port[i].base + GPIO_IMR);
-               __raw_writel(~0, port[i].base + GPIO_ISR);
-               for (j = port[i].virtual_irq_start;
-                       j < port[i].virtual_irq_start + 32; j++) {
-                       irq_set_lockdep_class(j, &gpio_lock_class);
-                       irq_set_chip_and_handler(j, &gpio_irq_chip,
-                                                handle_level_irq);
-                       set_irq_flags(j, IRQF_VALID);
-               }
-
-               /* register gpio chip */
-               port[i].chip.direction_input = mxc_gpio_direction_input;
-               port[i].chip.direction_output = mxc_gpio_direction_output;
-               port[i].chip.get = mxc_gpio_get;
-               port[i].chip.set = mxc_gpio_set;
-               port[i].chip.base = i * 32;
-               port[i].chip.ngpio = 32;
-
-               spin_lock_init(&port[i].lock);
-
-               /* its a serious configuration bug when it fails */
-               BUG_ON( gpiochip_add(&port[i].chip) < 0 );
-
-               if (cpu_is_mx1() || cpu_is_mx3() || cpu_is_mx25() || cpu_is_mx51()) {
-                       /* setup one handler for each entry */
-                       irq_set_chained_handler(port[i].irq,
-                                               mx3_gpio_irq_handler);
-                       irq_set_handler_data(port[i].irq, &port[i]);
-                       if (port[i].irq_high) {
-                               /* setup handler for GPIO 16 to 31 */
-                               irq_set_chained_handler(port[i].irq_high,
-                                                       mx3_gpio_irq_handler);
-                               irq_set_handler_data(port[i].irq_high,
-                                                    &port[i]);
-                       }
-               }
-       }
-
-       if (cpu_is_mx2()) {
-               /* setup one handler for all GPIO interrupts */
-               irq_set_chained_handler(port[0].irq, mx2_gpio_irq_handler);
-               irq_set_handler_data(port[0].irq, port);
-       }
-
-       return 0;
-}
index da7991832af671f022d4fed02f84168f82dbb0ce..91fa2632aa5e97175de043fc3e7647f1d082d488 100644 (file)
@@ -43,6 +43,15 @@ extern void mx35_init_irq(void);
 extern void mx50_init_irq(void);
 extern void mx51_init_irq(void);
 extern void mx53_init_irq(void);
+extern void imx1_soc_init(void);
+extern void imx21_soc_init(void);
+extern void imx25_soc_init(void);
+extern void imx27_soc_init(void);
+extern void imx31_soc_init(void);
+extern void imx35_soc_init(void);
+extern void imx50_soc_init(void);
+extern void imx51_soc_init(void);
+extern void imx53_soc_init(void);
 extern void epit_timer_init(struct clk *timer_clk, void __iomem *base, int irq);
 extern void mxc_timer_init(struct clk *timer_clk, void __iomem *, int);
 extern int mx1_clocks_init(unsigned long fref);
@@ -55,7 +64,8 @@ extern int mx51_clocks_init(unsigned long ckil, unsigned long osc,
                        unsigned long ckih1, unsigned long ckih2);
 extern int mx53_clocks_init(unsigned long ckil, unsigned long osc,
                        unsigned long ckih1, unsigned long ckih2);
-extern int mxc_register_gpios(void);
+extern struct platform_device *mxc_register_gpio(int id,
+       resource_size_t iobase, resource_size_t iosize, int irq, int irq_high);
 extern int mxc_register_device(struct platform_device *pdev, void *data);
 extern void mxc_set_cpu_type(unsigned int type);
 extern void mxc_arch_reset_init(void __iomem *);
index 8e8d175e5077d991dda9c46313ccc6c6a7eb5b53..91fc7cdb5dc97309b143aae6f70c72a106977208 100644 (file)
  */
 #include <mach/hardware.h>
 
-#ifdef CONFIG_ARCH_MX1
+#ifdef CONFIG_SOC_IMX1
 #define UART_PADDR     MX1_UART1_BASE_ADDR
 #endif
 
-#ifdef CONFIG_ARCH_MX25
+#ifdef CONFIG_SOC_IMX25
 #ifdef UART_PADDR
 #error "CONFIG_DEBUG_LL is incompatible with multiple archs"
 #endif
 #define UART_PADDR     MX25_UART1_BASE_ADDR
 #endif
 
-#ifdef CONFIG_ARCH_MX2
+#if defined(CONFIG_SOC_IMX21) || defined (CONFIG_SOC_IMX27)
 #ifdef UART_PADDR
 #error "CONFIG_DEBUG_LL is incompatible with multiple archs"
 #endif
 #define UART_PADDR     MX2x_UART1_BASE_ADDR
 #endif
 
-#ifdef CONFIG_ARCH_MX3
+#if defined(CONFIG_SOC_IMX31) || defined(CONFIG_SOC_IMX35)
 #ifdef UART_PADDR
 #error "CONFIG_DEBUG_LL is incompatible with multiple archs"
 #endif
 #define UART_PADDR     MX3x_UART1_BASE_ADDR
 #endif
 
-#ifdef CONFIG_ARCH_MX5
+#ifdef CONFIG_SOC_IMX51
 #ifdef UART_PADDR
 #error "CONFIG_DEBUG_LL is incompatible with multiple archs"
 #endif
index fa8477337f9150f67641507da451416436989920..bf93820ab61cd03ac5f4c1d57fef094e388aa8cd 100644 (file)
@@ -9,6 +9,10 @@
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
 #include <linux/init.h>
+#include <mach/sdma.h>
+
+extern struct device mxc_aips_bus;
+extern struct device mxc_ahb_bus;
 
 struct platform_device *imx_add_platform_device_dmamask(
                const char *name, int id,
@@ -291,3 +295,7 @@ struct imx_spi_imx_data {
 struct platform_device *__init imx_add_spi_imx(
                const struct imx_spi_imx_data *data,
                const struct spi_imx_master *pdata);
+
+struct platform_device *imx_add_imx_dma(void);
+struct platform_device *imx_add_imx_sdma(
+       resource_size_t iobase, int irq, struct sdma_platform_data *pdata);
index a2747f12813eb5fe6e9e9b743bad5f7522406315..31c820c1b7960eb3e0d64aa9dfc782f9c7e4ff00 100644 (file)
 #define gpio_to_irq(gpio)      (MXC_GPIO_IRQ_START + (gpio))
 #define irq_to_gpio(irq)       ((irq) - MXC_GPIO_IRQ_START)
 
-struct mxc_gpio_port {
-       void __iomem *base;
-       int irq;
-       int irq_high;
-       int virtual_irq_start;
-       struct gpio_chip chip;
-       u32 both_edges;
-       spinlock_t lock;
-};
-
-#define DEFINE_IMX_GPIO_PORT_IRQ_HIGH(soc, _id, _hwid, _irq, _irq_high)        \
-       {                                                               \
-               .chip.label = "gpio-" #_id,                             \
-               .irq = _irq,                                            \
-               .irq_high = _irq_high,                                  \
-               .base = soc ## _IO_ADDRESS(                             \
-                               soc ## _GPIO ## _hwid ## _BASE_ADDR),   \
-               .virtual_irq_start = MXC_GPIO_IRQ_START + (_id) * 32,   \
-       }
-
-#define DEFINE_IMX_GPIO_PORT_IRQ(soc, _id, _hwid, _irq)                        \
-       DEFINE_IMX_GPIO_PORT_IRQ_HIGH(soc, _id, _hwid, _irq, 0)
-#define DEFINE_IMX_GPIO_PORT(soc, _id, _hwid)                          \
-       DEFINE_IMX_GPIO_PORT_IRQ(soc, _id, _hwid, 0)
-
-int mxc_gpio_init(struct mxc_gpio_port*, int);
-
 #endif
index 67d3e2bed0656dfb6f94ac26e8c0cc998d5f2bdd..a8bfd565dcad2ba73f60695ac01bf97c9e90ba81 100644 (file)
 
 #include <mach/mxc.h>
 
-#ifdef CONFIG_ARCH_MX5
 #include <mach/mx50.h>
 #include <mach/mx51.h>
 #include <mach/mx53.h>
-#endif
-
-#ifdef CONFIG_ARCH_MX3
 #include <mach/mx3x.h>
 #include <mach/mx31.h>
 #include <mach/mx35.h>
-#endif
-
-#ifdef CONFIG_ARCH_MX2
-# include <mach/mx2x.h>
-# ifdef CONFIG_MACH_MX21
-#  include <mach/mx21.h>
-# endif
-# ifdef CONFIG_MACH_MX27
-#  include <mach/mx27.h>
-# endif
-#endif
-
-#ifdef CONFIG_ARCH_MX1
-# include <mach/mx1.h>
-#endif
-
-#ifdef CONFIG_ARCH_MX25
-# include <mach/mx25.h>
-#endif
+#include <mach/mx2x.h>
+#include <mach/mx21.h>
+#include <mach/mx27.h>
+#include <mach/mx1.h>
+#include <mach/mx25.h>
 
 #define imx_map_entry(soc, name, _type)        {                               \
        .virtual = soc ## _IO_P2V(soc ## _ ## name ## _BASE_ADDR),      \
index e95d9cb8aeb7fd02a210d96bd84dfef98540c87d..e11dd5f09c34457606c19f209dd9674d54b885fa 100644 (file)
@@ -39,7 +39,7 @@
 #define _MX53_PAD_GPIO_19__ECSPI1_RDY  IOMUX_PAD(0x348, 0x20, 5, 0x0, 0, 0)
 #define _MX53_PAD_GPIO_19__FEC_TDATA_3 IOMUX_PAD(0x348, 0x20, 6, 0x0, 0, 0)
 #define _MX53_PAD_GPIO_19__SRC_INT_BOOT        IOMUX_PAD(0x348, 0x20,7, 0x0, 0, 0)
-#define _MX53_PAD_KEY_COL0__KPP_COL_0  IOMUX_PAD(0x34C, 0x24, o, 0x0, 0, 0)
+#define _MX53_PAD_KEY_COL0__KPP_COL_0  IOMUX_PAD(0x34C, 0x24, 0, 0x0, 0, 0)
 #define _MX53_PAD_KEY_COL0__GPIO4_6            IOMUX_PAD(0x34C, 0x24, 1, 0x0, 0, 0)
 #define _MX53_PAD_KEY_COL0__AUDMUX_AUD5_TXC    IOMUX_PAD(0x34C, 0x24, 2, 0x758, 0, 0)
 #define _MX53_PAD_KEY_COL0__UART4_TXD_MUX      IOMUX_PAD(0x34C, 0x24, 4, 0x890, 0, 0)
 #define _MX53_PAD_EIM_DA5__GPIO3_5                     IOMUX_PAD(0x500, 0x1B0, 1, 0x0, 0, 0)
 #define _MX53_PAD_EIM_DA5__IPU_DISP1_DAT_4             IOMUX_PAD(0x500, 0x1B0, 3, 0x0, 0, 0)
 #define _MX53_PAD_EIM_DA5__IPU_CSI1_D_4                IOMUX_PAD(0x500, 0x1B0, 4, 0x0, 0, 0)
-#define _MX53_PAD_EIM_DA5__SRC_BT_CFG3_6               IOMUX_PAD(0x500, 0x1B0, 17, 0x0, 0, 0)
+#define _MX53_PAD_EIM_DA5__SRC_BT_CFG3_6               IOMUX_PAD(0x500, 0x1B0, 7 | IOMUX_CONFIG_SION, 0x0, 0, 0)
 #define _MX53_PAD_EIM_DA6__EMI_NAND_WEIM_DA_6  IOMUX_PAD(0x504, 0x1B4, 0, 0x0, 0, 0)
 #define _MX53_PAD_EIM_DA6__GPIO3_6                     IOMUX_PAD(0x504, 0x1B4, 1, 0x0, 0, 0)
 #define _MX53_PAD_EIM_DA6__IPU_DISP1_DAT_3             IOMUX_PAD(0x504, 0x1B4, 3, 0x0, 0, 0)
 #define _MX53_PAD_PATA_DATA5__ESDHC4_DAT5              IOMUX_PAD(0x63C, 0x2B8, 4, 0x0, 0, 0)
 #define _MX53_PAD_PATA_DATA5__GPU3d_GPU_DEBUG_OUT_5    IOMUX_PAD(0x63C, 0x2B8, 5, 0x0, 0, 0)
 #define _MX53_PAD_PATA_DATA5__IPU_DIAG_BUS_5   IOMUX_PAD(0x63C, 0x2B8, 6, 0x0, 0, 0)
-#define _MX53_PAD_PATA_DATA6__PATA_DATA_6      IOMUX_PAD(0x640, 0x2BC, 1, 0x0, 0, 0)
+#define _MX53_PAD_PATA_DATA6__PATA_DATA_6      IOMUX_PAD(0x640, 0x2BC, 0, 0x0, 0, 0)
 #define _MX53_PAD_PATA_DATA6__GPIO2_6          IOMUX_PAD(0x640, 0x2BC, 1, 0x0, 0, 0)
-#define _MX53_PAD_PATA_DATA6__EMI_NANDF_D_6    IOMUX_PAD(0x640, 0x2BC, 1, 0x0, 0, 0)
-#define _MX53_PAD_PATA_DATA6__ESDHC4_DAT6              IOMUX_PAD(0x640, 0x2BC, 1, 0x0, 0, 0)
-#define _MX53_PAD_PATA_DATA6__GPU3d_GPU_DEBUG_OUT_6    IOMUX_PAD(0x640, 0x2BC, 1, 0x0, 0, 0)
-#define _MX53_PAD_PATA_DATA6__IPU_DIAG_BUS_6   IOMUX_PAD(0x640, 0x2BC, 1, 0x0, 0, 0)
+#define _MX53_PAD_PATA_DATA6__EMI_NANDF_D_6    IOMUX_PAD(0x640, 0x2BC, 3, 0x0, 0, 0)
+#define _MX53_PAD_PATA_DATA6__ESDHC4_DAT6              IOMUX_PAD(0x640, 0x2BC, 4, 0x0, 0, 0)
+#define _MX53_PAD_PATA_DATA6__GPU3d_GPU_DEBUG_OUT_6    IOMUX_PAD(0x640, 0x2BC, 5, 0x0, 0, 0)
+#define _MX53_PAD_PATA_DATA6__IPU_DIAG_BUS_6   IOMUX_PAD(0x640, 0x2BC, 6, 0x0, 0, 0)
 #define _MX53_PAD_PATA_DATA7__PATA_DATA_7              IOMUX_PAD(0x644, 0x2C0, 0, 0x0, 0, 0)
 #define _MX53_PAD_PATA_DATA7__GPIO2_7          IOMUX_PAD(0x644, 0x2C0, 1, 0x0, 0, 0)
 #define _MX53_PAD_PATA_DATA7__EMI_NANDF_D_7    IOMUX_PAD(0x644, 0x2C0, 3, 0x0, 0, 0)
index c07d30210c576c222c711d8d6c974f1c53c9f4fc..6fa8a707b9a0347778a0513f05c953f16defd70f 100644 (file)
@@ -85,9 +85,6 @@
 #define GPIO_BOUT_0    (2 << GPIO_BOUT_SHIFT)
 #define GPIO_BOUT_1    (3 << GPIO_BOUT_SHIFT)
 
-/* decode irq number to use with IMR(x), ISR(x) and friends */
-#define IRQ_TO_REG(irq) ((irq - MXC_INTERNAL_IRQS) >> 5)
-
 #define IRQ_GPIOA(x)  (MXC_GPIO_IRQ_START + x)
 #define IRQ_GPIOB(x)  (IRQ_GPIOA(32) + x)
 #define IRQ_GPIOC(x)  (IRQ_GPIOB(32) + x)
@@ -98,7 +95,6 @@
 extern int mxc_gpio_mode(int gpio_mode);
 extern int mxc_gpio_setup_multiple_pins(const int *pin_list, unsigned count,
                const char *label);
-extern void mxc_gpio_release_multiple_pins(const int *pin_list, int count);
 
 extern int __init imx_iomuxv1_init(void __iomem *base, int numports);
 
index 82620af1922f981b749bfcd59b872638e3dd81e2..ebbce33097a76f81cae8696758ac713091279f88 100644 (file)
@@ -66,7 +66,6 @@ typedef u64 iomux_v3_cfg_t;
 #define MUX_MODE_MASK          ((iomux_v3_cfg_t)0x1f << MUX_MODE_SHIFT)
 #define MUX_PAD_CTRL_SHIFT     41
 #define MUX_PAD_CTRL_MASK      ((iomux_v3_cfg_t)0x1ffff << MUX_PAD_CTRL_SHIFT)
-#define NO_PAD_CTRL            ((iomux_v3_cfg_t)1 << (MUX_PAD_CTRL_SHIFT + 16))
 #define MUX_SEL_INPUT_SHIFT    58
 #define MUX_SEL_INPUT_MASK     ((iomux_v3_cfg_t)0xf << MUX_SEL_INPUT_SHIFT)
 
@@ -85,6 +84,7 @@ typedef u64 iomux_v3_cfg_t;
  * Use to set PAD control
  */
 
+#define NO_PAD_CTRL                    (1 << 16)
 #define PAD_CTL_DVS                    (1 << 13)
 #define PAD_CTL_HYS                    (1 << 8)
 
diff --git a/arch/arm/plat-mxc/include/mach/iomux.h b/arch/arm/plat-mxc/include/mach/iomux.h
deleted file mode 100644 (file)
index 3d226d7..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2010 Uwe Kleine-Koenig, Pengutronix
- *
- * 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.
- */
-#ifndef __MACH_IOMUX_H__
-#define __MACH_IOMUX_H__
-
-/* This file will go away, please include mach/iomux-mx... directly */
-
-#ifdef CONFIG_ARCH_MX1
-#include <mach/iomux-mx1.h>
-#endif
-#ifdef CONFIG_ARCH_MX2
-#include <mach/iomux-mx2x.h>
-#ifdef CONFIG_MACH_MX21
-#include <mach/iomux-mx21.h>
-#endif
-#ifdef CONFIG_MACH_MX27
-#include <mach/iomux-mx27.h>
-#endif
-#endif
-
-#endif /* __MACH_IOMUX_H__ */
index 9d2a1ef84de2104c873120dff2bf15be2a200b29..5e3c3236ebf3e804f2e68e717669a3da665943fc 100644 (file)
 /*
  * Memory regions and CS
  */
-#define MX53_CSD0_BASE_ADDR            0x90000000
-#define MX53_CSD1_BASE_ADDR            0xA0000000
-#define MX53_CS0_BASE_ADDR             0xB0000000
-#define MX53_CS1_BASE_ADDR             0xB8000000
-#define MX53_CS2_BASE_ADDR             0xC0000000
-#define MX53_CS3_BASE_ADDR             0xC8000000
-#define MX53_CS4_BASE_ADDR             0xCC000000
-#define MX53_CS5_BASE_ADDR             0xCE000000
+#define MX53_CSD0_BASE_ADDR            0x70000000
+#define MX53_CSD1_BASE_ADDR            0xB0000000
+#define MX53_CS0_BASE_ADDR             0xF0000000
+#define MX53_CS1_32MB_BASE_ADDR        0xF2000000
+#define MX53_CS1_64MB_BASE_ADDR                0xF4000000
+#define MX53_CS2_64MB_BASE_ADDR                0xF4000000
+#define MX53_CS2_96MB_BASE_ADDR                0xF6000000
+#define MX53_CS3_BASE_ADDR             0xF6000000
 
 #define MX53_IO_P2V(x)                 IMX_IO_P2V(x)
 #define MX53_IO_ADDRESS(x)             IOMEM(MX53_IO_P2V(x))
 /*
  * DMA request assignments
  */
-#define MX53_DMA_REQ_SSI3_TX1          47
-#define MX53_DMA_REQ_SSI3_RX1          46
-#define MX53_DMA_REQ_SSI3_TX2          45
-#define MX53_DMA_REQ_SSI3_RX2          44
+#define MX53_DMA_REQ_SSI3_TX0          47
+#define MX53_DMA_REQ_SSI3_RX0          46
+#define MX53_DMA_REQ_SSI3_TX1          45
+#define MX53_DMA_REQ_SSI3_RX1          44
 #define MX53_DMA_REQ_UART3_TX  43
 #define MX53_DMA_REQ_UART3_RX  42
 #define MX53_DMA_REQ_ESAI_TX           41
 #define MX53_DMA_REQ_ASRC_DMA1 32
 #define MX53_DMA_REQ_EMI_WR            31
 #define MX53_DMA_REQ_EMI_RD            30
-#define MX53_DMA_REQ_SSI1_TX1          29
-#define MX53_DMA_REQ_SSI1_RX1          28
-#define MX53_DMA_REQ_SSI1_TX2          27
-#define MX53_DMA_REQ_SSI1_RX2          26
-#define MX53_DMA_REQ_SSI2_TX1          25
-#define MX53_DMA_REQ_SSI2_RX1          24
-#define MX53_DMA_REQ_SSI2_TX2          23
-#define MX53_DMA_REQ_SSI2_RX2          22
+#define MX53_DMA_REQ_SSI1_TX0          29
+#define MX53_DMA_REQ_SSI1_RX0          28
+#define MX53_DMA_REQ_SSI1_TX1          27
+#define MX53_DMA_REQ_SSI1_RX1          26
+#define MX53_DMA_REQ_SSI2_TX0          25
+#define MX53_DMA_REQ_SSI2_RX0          24
+#define MX53_DMA_REQ_SSI2_TX1          23
+#define MX53_DMA_REQ_SSI2_RX1          22
 #define MX53_DMA_REQ_I2C2_SDHC2        21
 #define MX53_DMA_REQ_I2C1_SDHC1        20
 #define MX53_DMA_REQ_UART1_TX  19
 #define MX53_INT_ESDHC2        2
 #define MX53_INT_ESDHC3        3
 #define MX53_INT_ESDHC4        4
-#define MX53_INT_RESV5 5
+#define MX53_INT_DAP   5
 #define MX53_INT_SDMA  6
 #define MX53_INT_IOMUX 7
 #define MX53_INT_NFC   8
 #define MX53_INT_IPU_ERR       10
 #define MX53_INT_IPU_SYN       11
 #define MX53_INT_GPU   12
-#define MX53_INT_RESV13        13
+#define MX53_INT_UART4 13
 #define MX53_INT_USB_H1        14
 #define MX53_INT_EMI   15
 #define MX53_INT_USB_H2        16
 #define MX53_INT_UART1 31
 #define MX53_INT_UART2 32
 #define MX53_INT_UART3 33
-#define MX53_INT_RESV34        34
-#define MX53_INT_RESV35        35
+#define MX53_INT_RTC   34
+#define MX53_INT_PTP   35
 #define MX53_INT_ECSPI1        36
 #define MX53_INT_ECSPI2        37
 #define MX53_INT_CSPI  38
 #define MX53_INT_I2C1  62
 #define MX53_INT_I2C2  63
 #define MX53_INT_I2C3  64
-#define MX53_INT_RESV65        65
-#define MX53_INT_RESV66        66
+#define MX53_INT_MLB   65
+#define MX53_INT_ASRC  66
 #define MX53_INT_SPDIF 67
 #define MX53_INT_SIM_DAT       68
 #define MX53_INT_IIM   69
 #define MX53_INT_CAN2  83
 #define MX53_INT_GPU2_IRQ      84
 #define MX53_INT_GPU2_BUSY     85
-#define MX53_INT_RESV86        86
+#define MX53_INT_UART5 86
 #define MX53_INT_FEC   87
 #define MX53_INT_OWIRE 88
 #define MX53_INT_CTI1_TG2      89
index 4ac53ce97c24f3526abcdd21df11a5998289b528..09879235a9f57430a034da6d12e111501a7118ae 100644 (file)
@@ -68,7 +68,7 @@
 extern unsigned int __mxc_cpu_type;
 #endif
 
-#ifdef CONFIG_ARCH_MX1
+#ifdef CONFIG_SOC_IMX1
 # ifdef mxc_cpu_type
 #  undef mxc_cpu_type
 #  define mxc_cpu_type __mxc_cpu_type
@@ -80,7 +80,7 @@ extern unsigned int __mxc_cpu_type;
 # define cpu_is_mx1()          (0)
 #endif
 
-#ifdef CONFIG_MACH_MX21
+#ifdef CONFIG_SOC_IMX21
 # ifdef mxc_cpu_type
 #  undef mxc_cpu_type
 #  define mxc_cpu_type __mxc_cpu_type
@@ -92,7 +92,7 @@ extern unsigned int __mxc_cpu_type;
 # define cpu_is_mx21()         (0)
 #endif
 
-#ifdef CONFIG_ARCH_MX25
+#ifdef CONFIG_SOC_IMX25
 # ifdef mxc_cpu_type
 #  undef mxc_cpu_type
 #  define mxc_cpu_type __mxc_cpu_type
@@ -104,7 +104,7 @@ extern unsigned int __mxc_cpu_type;
 # define cpu_is_mx25()         (0)
 #endif
 
-#ifdef CONFIG_MACH_MX27
+#ifdef CONFIG_SOC_IMX27
 # ifdef mxc_cpu_type
 #  undef mxc_cpu_type
 #  define mxc_cpu_type __mxc_cpu_type
index 913e0432e40e99d17d2456ad26b8f3a02e1a72c3..f495c87c113fc269020d0ec49397c2bfc24d3ff0 100644 (file)
@@ -49,14 +49,12 @@ struct sdma_script_start_addrs {
  * struct sdma_platform_data - platform specific data for SDMA engine
  *
  * @sdma_version       The version of this SDMA engine
- * @cpu_name           used to generate the firmware name
- * @to_version         CPU Tape out version
+ * @fw_name            The firmware name
  * @script_addrs       SDMA scripts addresses in SDMA ROM
  */
 struct sdma_platform_data {
        int sdma_version;
-       char *cpu_name;
-       int to_version;
+       char *fw_name;
        struct sdma_script_start_addrs *script_addrs;
 };
 
index d61d5c74817cb3cce231db111eee134682750d28..10343d1f87e144542b1414f0b23e28519c5a2617 100644 (file)
 #ifndef __ASM_ARCH_MXC_TIMEX_H__
 #define __ASM_ARCH_MXC_TIMEX_H__
 
-#if defined CONFIG_ARCH_MX1
-#define CLOCK_TICK_RATE                16000000
-#elif defined CONFIG_ARCH_MX2
-#define CLOCK_TICK_RATE                13300000
-#elif defined CONFIG_ARCH_MX3
-#define CLOCK_TICK_RATE                16625000
-#elif defined CONFIG_ARCH_MX25
-#define CLOCK_TICK_RATE                16000000
-#elif defined CONFIG_ARCH_MX5
-#define CLOCK_TICK_RATE                8000000
-#endif
+/* Bogus value */
+#define CLOCK_TICK_RATE        12345678
 
 #endif                         /* __ASM_ARCH_MXC_TIMEX_H__ */
index d85e2d1c0324449ca1209a1b572e216255e350ed..88fd40452567a30aeb6f2b55ba1e3f4684959a78 100644 (file)
@@ -117,6 +117,7 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)
        case MACH_TYPE_MX53_EVK:
        case MACH_TYPE_MX53_LOCO:
        case MACH_TYPE_MX53_SMD:
+       case MACH_TYPE_MX53_ARD:
                uart_base = MX53_UART1_BASE_ADDR;
                break;
        default:
index 3238c10d4e022073de8fd340336378bcfb9186fc..1f73963bc13e916e895433ffd5e5d7687e9e333d 100644 (file)
@@ -157,7 +157,7 @@ EXPORT_SYMBOL(mxc_gpio_mode);
 static int imx_iomuxv1_setup_multiple(const int *list, unsigned count)
 {
        size_t i;
-       int ret;
+       int ret = 0;
 
        for (i = 0; i < count; ++i) {
                ret = mxc_gpio_mode(list[i]);
@@ -172,45 +172,13 @@ static int imx_iomuxv1_setup_multiple(const int *list, unsigned count)
 int mxc_gpio_setup_multiple_pins(const int *pin_list, unsigned count,
                const char *label)
 {
-       size_t i;
        int ret;
 
-       for (i = 0; i < count; ++i) {
-               unsigned gpio = pin_list[i] & (GPIO_PIN_MASK | GPIO_PORT_MASK);
-
-               ret = gpio_request(gpio, label);
-               if (ret)
-                       goto err_gpio_request;
-       }
-
        ret = imx_iomuxv1_setup_multiple(pin_list, count);
-       if (ret)
-               goto err_setup;
-
-       return 0;
-
-err_setup:
-       BUG_ON(i != count);
-
-err_gpio_request:
-       mxc_gpio_release_multiple_pins(pin_list, i);
-
        return ret;
 }
 EXPORT_SYMBOL(mxc_gpio_setup_multiple_pins);
 
-void mxc_gpio_release_multiple_pins(const int *pin_list, int count)
-{
-       size_t i;
-
-       for (i = 0; i < count; ++i) {
-               unsigned gpio = pin_list[i] & (GPIO_PIN_MASK | GPIO_PORT_MASK);
-
-               gpio_free(gpio);
-       }
-}
-EXPORT_SYMBOL(mxc_gpio_release_multiple_pins);
-
 int __init imx_iomuxv1_init(void __iomem *base, int numports)
 {
        imx_iomuxv1_baseaddr = base;
index e1c6eff7258ae4728bb4d09e19fbbd1153c5e3f1..96953e2e4f11dbc55e67218a4617674bb166656f 100644 (file)
@@ -42,17 +42,16 @@ EXPORT_SYMBOL(imx_irq_set_priority);
 
 int mxc_set_irq_fiq(unsigned int irq, unsigned int type)
 {
-       struct mxc_irq_chip *chip;
-       struct irq_chip *base;
+       struct irq_chip_generic *gc;
+       int (*set_irq_fiq)(unsigned int, unsigned int);
        int ret;
 
        ret = -ENOSYS;
 
-       base = irq_get_chip(irq);
-       if (base) {
-               chip = container_of(base, struct mxc_irq_chip, base);
-               if (chip->set_irq_fiq)
-                       ret = chip->set_irq_fiq(irq, type);
+       gc = irq_get_chip_data(irq);
+       if (gc && gc->private) {
+               set_irq_fiq = gc->private;
+               ret = set_irq_fiq(irq, type);
        }
 
        return ret;
index 7a61ef8f471a49fd3ac0b67540f949cf13eaaa43..761c3c940a68cf84aa65e0bbaebd64e999b9ff9c 100644 (file)
@@ -214,14 +214,14 @@ static int __devinit mxc_pwm_probe(struct platform_device *pdev)
                goto err_free_clk;
        }
 
-       r = request_mem_region(r->start, r->end - r->start + 1, pdev->name);
+       r = request_mem_region(r->start, resource_size(r), pdev->name);
        if (r == NULL) {
                dev_err(&pdev->dev, "failed to request memory resource\n");
                ret = -EBUSY;
                goto err_free_clk;
        }
 
-       pwm->mmio_base = ioremap(r->start, r->end - r->start + 1);
+       pwm->mmio_base = ioremap(r->start, resource_size(r));
        if (pwm->mmio_base == NULL) {
                dev_err(&pdev->dev, "failed to ioremap() registers\n");
                ret = -ENODEV;
@@ -236,7 +236,7 @@ static int __devinit mxc_pwm_probe(struct platform_device *pdev)
        return 0;
 
 err_free_mem:
-       release_mem_region(r->start, r->end - r->start + 1);
+       release_mem_region(r->start, resource_size(r));
 err_free_clk:
        clk_put(pwm->clk);
 err_free:
@@ -260,7 +260,7 @@ static int __devexit mxc_pwm_remove(struct platform_device *pdev)
        iounmap(pwm->mmio_base);
 
        r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       release_mem_region(r->start, r->end - r->start + 1);
+       release_mem_region(r->start, resource_size(r));
 
        clk_put(pwm->clk);
 
index 57f9395f87ceaddb2cbd522e6b27a4555af6140d..f257fccdc39405e40029c2b16a8590dd62a2b2a0 100644 (file)
@@ -49,6 +49,8 @@
 
 void __iomem *tzic_base; /* Used as irq controller base in entry-macro.S */
 
+#define TZIC_NUM_IRQS 128
+
 #ifdef CONFIG_FIQ
 static int tzic_set_irq_fiq(unsigned int irq, unsigned int type)
 {
@@ -66,78 +68,34 @@ static int tzic_set_irq_fiq(unsigned int irq, unsigned int type)
 
        return 0;
 }
+#else
+#define tzic_set_irq_fiq NULL
 #endif
 
-/**
- * tzic_mask_irq() - Disable interrupt source "d" in the TZIC
- *
- * @param  d            interrupt source
- */
-static void tzic_mask_irq(struct irq_data *d)
-{
-       int index, off;
-
-       index = d->irq >> 5;
-       off = d->irq & 0x1F;
-       __raw_writel(1 << off, tzic_base + TZIC_ENCLEAR0(index));
-}
+static unsigned int *wakeup_intr[4];
 
-/**
- * tzic_unmask_irq() - Enable interrupt source "d" in the TZIC
- *
- * @param  d            interrupt source
- */
-static void tzic_unmask_irq(struct irq_data *d)
+static __init void tzic_init_gc(unsigned int irq_start)
 {
-       int index, off;
-
-       index = d->irq >> 5;
-       off = d->irq & 0x1F;
-       __raw_writel(1 << off, tzic_base + TZIC_ENSET0(index));
+       struct irq_chip_generic *gc;
+       struct irq_chip_type *ct;
+       int idx = irq_start >> 5;
+
+       gc = irq_alloc_generic_chip("tzic", 1, irq_start, tzic_base,
+                                   handle_level_irq);
+       gc->private = tzic_set_irq_fiq;
+       gc->wake_enabled = IRQ_MSK(32);
+       wakeup_intr[idx] = &gc->wake_active;
+
+       ct = gc->chip_types;
+       ct->chip.irq_mask = irq_gc_mask_disable_reg;
+       ct->chip.irq_unmask = irq_gc_unmask_enable_reg;
+       ct->chip.irq_set_wake = irq_gc_set_wake;
+       ct->regs.disable = TZIC_ENCLEAR0(idx);
+       ct->regs.enable = TZIC_ENSET0(idx);
+
+       irq_setup_generic_chip(gc, IRQ_MSK(32), 0, IRQ_NOREQUEST, 0);
 }
 
-static unsigned int wakeup_intr[4];
-
-/**
- * tzic_set_wake_irq() - Set interrupt source "d" in the TZIC as a wake-up source.
- *
- * @param  d            interrupt source
- * @param  enable       enable as wake-up if equal to non-zero
- *                     disble as wake-up if equal to zero
- *
- * @return       This function returns 0 on success.
- */
-static int tzic_set_wake_irq(struct irq_data *d, unsigned int enable)
-{
-       unsigned int index, off;
-
-       index = d->irq >> 5;
-       off = d->irq & 0x1F;
-
-       if (index > 3)
-               return -EINVAL;
-
-       if (enable)
-               wakeup_intr[index] |= (1 << off);
-       else
-               wakeup_intr[index] &= ~(1 << off);
-
-       return 0;
-}
-
-static struct mxc_irq_chip mxc_tzic_chip = {
-       .base = {
-               .name = "MXC_TZIC",
-               .irq_ack = tzic_mask_irq,
-               .irq_mask = tzic_mask_irq,
-               .irq_unmask = tzic_unmask_irq,
-               .irq_set_wake = tzic_set_wake_irq,
-       },
-#ifdef CONFIG_FIQ
-       .set_irq_fiq = tzic_set_irq_fiq,
-#endif
-};
-
 /*
  * This function initializes the TZIC hardware and disables all the
  * interrupts. It registers the interrupt enable and disable functions
@@ -166,11 +124,8 @@ void __init tzic_init_irq(void __iomem *irqbase)
 
        /* all IRQ no FIQ Warning :: No selection */
 
-       for (i = 0; i < MXC_INTERNAL_IRQS; i++) {
-               irq_set_chip_and_handler(i, &mxc_tzic_chip.base,
-                                        handle_level_irq);
-               set_irq_flags(i, IRQF_VALID);
-       }
+       for (i = 0; i < TZIC_NUM_IRQS; i += 32)
+               tzic_init_gc(i);
 
 #ifdef CONFIG_FIQ
        /* Initialize FIQ */
@@ -197,7 +152,7 @@ int tzic_enable_wake(int is_idle)
 
        for (i = 0; i < 4; i++) {
                v = is_idle ? __raw_readl(tzic_base + TZIC_ENSET0(i)) :
-                       wakeup_intr[i];
+                       *wakeup_intr[i];
                __raw_writel(v, tzic_base + TZIC_WAKEUP0(i));
        }
 
index 2abf9660bc6cc6eaa9879b82281bf79d3c83225d..a79a8ccd25f67898d5a657e785b32d52f2800650 100644 (file)
@@ -1027,17 +1027,13 @@ int s3c2410_dma_config(unsigned int channel,
        struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel);
        unsigned int dcon;
 
-       pr_debug("%s: chan=%d, xfer_unit=%d, dcon=%08x\n",
-                __func__, channel, xferunit, dcon);
+       pr_debug("%s: chan=%d, xfer_unit=%d\n", __func__, channel, xferunit);
 
        if (chan == NULL)
                return -EINVAL;
 
-       pr_debug("%s: Initial dcon is %08x\n", __func__, dcon);
-
        dcon = chan->dcon & dma_sel.dcon_mask;
-
-       pr_debug("%s: New dcon is %08x\n", __func__, dcon);
+       pr_debug("%s: dcon is %08x\n", __func__, dcon);
 
        switch (chan->req_ch) {
        case DMACH_I2S_IN:
@@ -1235,7 +1231,7 @@ static void s3c2410_dma_resume_chan(struct s3c2410_dma_chan *cp)
        /* restore channel's hardware configuration */
 
        if (!cp->in_use)
-               return 0;
+               return;
 
        printk(KERN_INFO "dma%d: restoring configuration\n", cp->number);
 
@@ -1246,8 +1242,6 @@ static void s3c2410_dma_resume_chan(struct s3c2410_dma_chan *cp)
 
        if (cp->map != NULL)
                dma_sel.select(cp, cp->map);
-
-       return 0;
 }
 
 static void s3c2410_dma_resume(void)
index 899a8cc011fffc6cc98ff8bd87e07b4f54e97f1c..612934c48b0d25fc3d2bacbb1eed22e2806f191d 100644 (file)
@@ -370,11 +370,11 @@ static void __init s5p_clocksource_init(void)
 
        clock_rate = clk_get_rate(tin_source);
 
-       init_sched_clock(&cd, s5p_update_sched_clock, 32, clock_rate);
-
        s5p_time_setup(timer_source.source_id, TCNT_MAX);
        s5p_time_start(timer_source.source_id, PERIODIC);
 
+       init_sched_clock(&cd, s5p_update_sched_clock, 32, clock_rate);
+
        if (clocksource_register_hz(&time_clocksource, clock_rate))
                panic("%s: can't register clocksource\n", time_clocksource.name);
 }
index 4af108ff41121da579b41e0717802daf6c56285b..e3b31c26ac3eaa7fc1737daec9725e09990b9a21 100644 (file)
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
 */
+
+#ifndef __PLAT_DEVS_H
+#define __PLAT_DEVS_H __FILE__
+
 #include <linux/platform_device.h>
 
 struct s3c24xx_uart_resources {
@@ -159,3 +163,5 @@ extern struct platform_device s3c_device_ac97;
  */
 extern void *s3c_set_platdata(void *pd, size_t pdsize,
                              struct platform_device *pdev);
+
+#endif /* __PLAT_DEVS_H */
index 0ffe34a215544b1008dc0d0ff6dbf0bc852da0cf..4c16fa3621bb813f1dbd80f25e9a987dbd5e04ca 100644 (file)
@@ -39,6 +39,7 @@ struct s3c64xx_spi_csinfo {
  * @fifo_lvl_mask: All tx fifo_lvl fields start at offset-6
  * @rx_lvl_offset: Depends on tx fifo_lvl field and bus number
  * @high_speed: If the controller supports HIGH_SPEED_EN bit
+ * @tx_st_done: Depends on tx fifo_lvl field
  */
 struct s3c64xx_spi_info {
        int src_clk_nr;
@@ -53,6 +54,7 @@ struct s3c64xx_spi_info {
        int fifo_lvl_mask;
        int rx_lvl_offset;
        int high_speed;
+       int tx_st_done;
 };
 
 /**
index 224e8c5eb3070351fe06a6838a611b6a5a1799bb..ffa037f28d39a7542c364bbef12689f23d1a22a2 100644 (file)
@@ -57,6 +57,8 @@ static inline int pfn_valid(int pfn)
        return 0;
 }
 
+#define early_pfn_valid(pfn)   pfn_valid((pfn))
+
 #endif /* CONFIG_DISCONTIGMEM */
 
 #ifdef CONFIG_NEED_MULTIPLE_NODES
index ead21b6631175df124210113025f49f994186a98..b4fd836e405377363754eb5ac412c2c6a6e57147 100644 (file)
@@ -28,6 +28,8 @@ pmode_cr3:    .long   0       /* Saved %cr3 */
 pmode_cr4:     .long   0       /* Saved %cr4 */
 pmode_efer:    .quad   0       /* Saved EFER */
 pmode_gdt:     .quad   0
+pmode_misc_en: .quad   0       /* Saved MISC_ENABLE MSR */
+pmode_behavior:        .long   0       /* Wakeup behavior flags */
 realmode_flags:        .long   0
 real_magic:    .long   0
 trampoline_segment:    .word 0
@@ -91,6 +93,18 @@ wakeup_code:
        /* Call the C code */
        calll   main
 
+       /* Restore MISC_ENABLE before entering protected mode, in case
+          BIOS decided to clear XD_DISABLE during S3. */
+       movl    pmode_behavior, %eax
+       btl     $WAKEUP_BEHAVIOR_RESTORE_MISC_ENABLE, %eax
+       jnc     1f
+
+       movl    pmode_misc_en, %eax
+       movl    pmode_misc_en + 4, %edx
+       movl    $MSR_IA32_MISC_ENABLE, %ecx
+       wrmsr
+1:
+
        /* Do any other stuff... */
 
 #ifndef CONFIG_64BIT
index e1828c07e79cdb2f47a9ecfa3661621229ead8f9..97a29e1430e3c245a314661af02fbed5ca7565af 100644 (file)
@@ -21,6 +21,9 @@ struct wakeup_header {
        u32 pmode_efer_low;     /* Protected mode EFER */
        u32 pmode_efer_high;
        u64 pmode_gdt;
+       u32 pmode_misc_en_low;  /* Protected mode MISC_ENABLE */
+       u32 pmode_misc_en_high;
+       u32 pmode_behavior;     /* Wakeup routine behavior flags */
        u32 realmode_flags;
        u32 real_magic;
        u16 trampoline_segment; /* segment with trampoline code, 64-bit only */
@@ -39,4 +42,7 @@ extern struct wakeup_header wakeup_header;
 #define WAKEUP_HEADER_SIGNATURE 0x51ee1111
 #define WAKEUP_END_SIGNATURE   0x65a22c82
 
+/* Wakeup behavior bits */
+#define WAKEUP_BEHAVIOR_RESTORE_MISC_ENABLE     0
+
 #endif /* ARCH_X86_KERNEL_ACPI_RM_WAKEUP_H */
index 18a857ba7a25a920a1ad83f3acd477d587b28477..103b6ab368d39315bc752e02a7bdc5b83ede0acf 100644 (file)
@@ -77,6 +77,12 @@ int acpi_suspend_lowlevel(void)
 
        header->pmode_cr0 = read_cr0();
        header->pmode_cr4 = read_cr4_safe();
+       header->pmode_behavior = 0;
+       if (!rdmsr_safe(MSR_IA32_MISC_ENABLE,
+                       &header->pmode_misc_en_low,
+                       &header->pmode_misc_en_high))
+               header->pmode_behavior |=
+                       (1 << WAKEUP_BEHAVIOR_RESTORE_MISC_ENABLE);
        header->realmode_flags = acpi_realmode_flags;
        header->real_magic = 0x12345678;
 
index 0c016f727695e9ab1a4544e845fa698a8c540737..4f0d46fefa7f7166e4d82b4dfda94528662034aa 100644 (file)
@@ -294,6 +294,14 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = {
                        DMI_MATCH(DMI_BOARD_NAME, "VersaLogic Menlow board"),
                },
        },
+       { /* Handle reboot issue on Acer Aspire one */
+               .callback = set_bios_reboot,
+               .ident = "Acer Aspire One A110",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+                       DMI_MATCH(DMI_PRODUCT_NAME, "AOA110"),
+               },
+       },
        { }
 };
 
index cf9750004a08fe673eb312414090c7b0c7759b09..68894fdc034bc3cb01cd79b66ec995dadc7b7c67 100644 (file)
@@ -112,8 +112,10 @@ static void nmi_cpu_start(void *dummy)
 static int nmi_start(void)
 {
        get_online_cpus();
-       on_each_cpu(nmi_cpu_start, NULL, 1);
        ctr_running = 1;
+       /* make ctr_running visible to the nmi handler: */
+       smp_mb();
+       on_each_cpu(nmi_cpu_start, NULL, 1);
        put_online_cpus();
        return 0;
 }
@@ -504,15 +506,18 @@ static int nmi_setup(void)
 
        nmi_enabled = 0;
        ctr_running = 0;
-       barrier();
+       /* make variables visible to the nmi handler: */
+       smp_mb();
        err = register_die_notifier(&profile_exceptions_nb);
        if (err)
                goto fail;
 
        get_online_cpus();
        register_cpu_notifier(&oprofile_cpu_nb);
-       on_each_cpu(nmi_cpu_setup, NULL, 1);
        nmi_enabled = 1;
+       /* make nmi_enabled visible to the nmi handler: */
+       smp_mb();
+       on_each_cpu(nmi_cpu_setup, NULL, 1);
        put_online_cpus();
 
        return 0;
@@ -531,7 +536,8 @@ static void nmi_shutdown(void)
        nmi_enabled = 0;
        ctr_running = 0;
        put_online_cpus();
-       barrier();
+       /* make variables visible to the nmi handler: */
+       smp_mb();
        unregister_die_notifier(&profile_exceptions_nb);
        msrs = &get_cpu_var(cpu_msrs);
        model->shutdown(msrs);
index fe008309ffec118197bab1b4125a22dca9e6c8aa..f567965c06201cf0315605cde43c6eaa9bb228a5 100644 (file)
@@ -327,13 +327,12 @@ int __init pci_xen_hvm_init(void)
 }
 
 #ifdef CONFIG_XEN_DOM0
-static int xen_register_pirq(u32 gsi, int triggering)
+static int xen_register_pirq(u32 gsi, int gsi_override, int triggering)
 {
        int rc, pirq, irq = -1;
        struct physdev_map_pirq map_irq;
        int shareable = 0;
        char *name;
-       bool gsi_override = false;
 
        if (!xen_pv_domain())
                return -1;
@@ -345,31 +344,12 @@ static int xen_register_pirq(u32 gsi, int triggering)
                shareable = 1;
                name = "ioapic-level";
        }
-
        pirq = xen_allocate_pirq_gsi(gsi);
        if (pirq < 0)
                goto out;
 
-       /* Before we bind the GSI to a Linux IRQ, check whether
-        * we need to override it with bus_irq (IRQ) value. Usually for
-        * IRQs below IRQ_LEGACY_IRQ this holds IRQ == GSI, as so:
-        *  ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 low level)
-        * but there are oddballs where the IRQ != GSI:
-        *  ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 20 low level)
-        * which ends up being: gsi_to_irq[9] == 20
-        * (which is what acpi_gsi_to_irq ends up calling when starting the
-        * the ACPI interpreter and keels over since IRQ 9 has not been
-        * setup as we had setup IRQ 20 for it).
-        */
-       if (gsi == acpi_sci_override_gsi) {
-               /* Check whether the GSI != IRQ */
-               acpi_gsi_to_irq(gsi, &irq);
-               if (irq != gsi)
-                       /* Bugger, we MUST have that IRQ. */
-                       gsi_override = true;
-       }
-       if (gsi_override)
-               irq = xen_bind_pirq_gsi_to_irq(irq, pirq, shareable, name);
+       if (gsi_override >= 0)
+               irq = xen_bind_pirq_gsi_to_irq(gsi_override, pirq, shareable, name);
        else
                irq = xen_bind_pirq_gsi_to_irq(gsi, pirq, shareable, name);
        if (irq < 0)
@@ -392,7 +372,7 @@ out:
        return irq;
 }
 
-static int xen_register_gsi(u32 gsi, int triggering, int polarity)
+static int xen_register_gsi(u32 gsi, int gsi_override, int triggering, int polarity)
 {
        int rc, irq;
        struct physdev_setup_gsi setup_gsi;
@@ -403,7 +383,7 @@ static int xen_register_gsi(u32 gsi, int triggering, int polarity)
        printk(KERN_DEBUG "xen: registering gsi %u triggering %d polarity %d\n",
                        gsi, triggering, polarity);
 
-       irq = xen_register_pirq(gsi, triggering);
+       irq = xen_register_pirq(gsi, gsi_override, triggering);
 
        setup_gsi.gsi = gsi;
        setup_gsi.triggering = (triggering == ACPI_EDGE_SENSITIVE ? 0 : 1);
@@ -425,6 +405,8 @@ static __init void xen_setup_acpi_sci(void)
        int rc;
        int trigger, polarity;
        int gsi = acpi_sci_override_gsi;
+       int irq = -1;
+       int gsi_override = -1;
 
        if (!gsi)
                return;
@@ -441,7 +423,25 @@ static __init void xen_setup_acpi_sci(void)
        printk(KERN_INFO "xen: sci override: global_irq=%d trigger=%d "
                        "polarity=%d\n", gsi, trigger, polarity);
 
-       gsi = xen_register_gsi(gsi, trigger, polarity);
+       /* Before we bind the GSI to a Linux IRQ, check whether
+        * we need to override it with bus_irq (IRQ) value. Usually for
+        * IRQs below IRQ_LEGACY_IRQ this holds IRQ == GSI, as so:
+        *  ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 low level)
+        * but there are oddballs where the IRQ != GSI:
+        *  ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 20 low level)
+        * which ends up being: gsi_to_irq[9] == 20
+        * (which is what acpi_gsi_to_irq ends up calling when starting the
+        * the ACPI interpreter and keels over since IRQ 9 has not been
+        * setup as we had setup IRQ 20 for it).
+        */
+       /* Check whether the GSI != IRQ */
+       if (acpi_gsi_to_irq(gsi, &irq) == 0) {
+               if (irq >= 0 && irq != gsi)
+                       /* Bugger, we MUST have that IRQ. */
+                       gsi_override = irq;
+       }
+
+       gsi = xen_register_gsi(gsi, gsi_override, trigger, polarity);
        printk(KERN_INFO "xen: acpi sci %d\n", gsi);
 
        return;
@@ -450,7 +450,7 @@ static __init void xen_setup_acpi_sci(void)
 static int acpi_register_gsi_xen(struct device *dev, u32 gsi,
                                 int trigger, int polarity)
 {
-       return xen_register_gsi(gsi, trigger, polarity);
+       return xen_register_gsi(gsi, -1 /* no GSI override */, trigger, polarity);
 }
 
 static int __init pci_xen_initial_domain(void)
@@ -489,7 +489,7 @@ void __init xen_setup_pirqs(void)
                if (acpi_get_override_irq(irq, &trigger, &polarity) == -1)
                        continue;
 
-               xen_register_pirq(irq,
+               xen_register_pirq(irq, -1 /* no GSI override */,
                        trigger ? ACPI_LEVEL_SENSITIVE : ACPI_EDGE_SENSITIVE);
        }
 }
index 474356b98ede32e647d4343c32a7e7893fe4beff..899e393d8e7326352f29d64cfc27c9b1820e0314 100644 (file)
@@ -504,9 +504,6 @@ void __init efi_init(void)
        x86_platform.set_wallclock = efi_set_rtc_mmss;
 #endif
 
-       /* Setup for EFI runtime service */
-       reboot_type = BOOT_EFI;
-
 #if EFI_DEBUG
        print_efi_memmap();
 #endif
index f3799432676d53cc3648c9ab6801fe4fd084b911..ae21919f15e1edf2ea6880efc6d5d43deae7fd9f 100644 (file)
@@ -2773,11 +2773,14 @@ static void __cfq_exit_single_io_context(struct cfq_data *cfqd,
        smp_wmb();
        cic->key = cfqd_dead_key(cfqd);
 
+       rcu_read_lock();
        if (rcu_dereference(ioc->ioc_data) == cic) {
+               rcu_read_unlock();
                spin_lock(&ioc->lock);
                rcu_assign_pointer(ioc->ioc_data, NULL);
                spin_unlock(&ioc->lock);
-       }
+       } else
+               rcu_read_unlock();
 
        if (cic->cfqq[BLK_RW_ASYNC]) {
                cfq_exit_cfqq(cfqd, cic->cfqq[BLK_RW_ASYNC]);
@@ -3084,7 +3087,8 @@ cfq_drop_dead_cic(struct cfq_data *cfqd, struct io_context *ioc,
 
        spin_lock_irqsave(&ioc->lock, flags);
 
-       BUG_ON(ioc->ioc_data == cic);
+       BUG_ON(rcu_dereference_check(ioc->ioc_data,
+               lockdep_is_held(&ioc->lock)) == cic);
 
        radix_tree_delete(&ioc->radix_root, cfqd->cic_index);
        hlist_del_rcu(&cic->cic_list);
index c126db3cb7d12c92be4b5d62abfd58d4a699a961..e8d11b6630eeb6ed7b815ffe2e21588965882587 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/syscore_ops.h>
 #include <linux/mutex.h>
 #include <linux/module.h>
+#include <linux/interrupt.h>
 
 static LIST_HEAD(syscore_ops_list);
 static DEFINE_MUTEX(syscore_ops_lock);
@@ -48,6 +49,13 @@ int syscore_suspend(void)
        struct syscore_ops *ops;
        int ret = 0;
 
+       pr_debug("Checking wakeup interrupts\n");
+
+       /* Return error code if there are any wakeup interrupts pending. */
+       ret = check_wakeup_irqs();
+       if (ret)
+               return ret;
+
        WARN_ONCE(!irqs_disabled(),
                "Interrupts enabled before system core suspend.\n");
 
index 09ef9a878ef06335393cbc4509f38425a5465713..cf0e63dd97da9bf09a88bf364cba87956cea4f42 100644 (file)
@@ -79,7 +79,7 @@ static int _drbd_md_sync_page_io(struct drbd_conf *mdev,
        md_io.error = 0;
 
        if ((rw & WRITE) && !test_bit(MD_NO_FUA, &mdev->flags))
-               rw |= REQ_FUA;
+               rw |= REQ_FUA | REQ_FLUSH;
        rw |= REQ_SYNC;
 
        bio = bio_alloc(GFP_NOIO, 1);
index f440a02dfdb15519799c64e2ab7c219db9a95ab5..7b976296b564faeed6a676afb22119bb99500174 100644 (file)
@@ -112,9 +112,6 @@ struct drbd_bitmap {
        struct task_struct *bm_task;
 };
 
-static int __bm_change_bits_to(struct drbd_conf *mdev, const unsigned long s,
-                              unsigned long e, int val, const enum km_type km);
-
 #define bm_print_lock_info(m) __bm_print_lock_info(m, __func__)
 static void __bm_print_lock_info(struct drbd_conf *mdev, const char *func)
 {
@@ -994,6 +991,9 @@ static void bm_page_io_async(struct bm_aio_ctx *ctx, int page_nr, int rw) __must
                bio_endio(bio, -EIO);
        } else {
                submit_bio(rw, bio);
+               /* this should not count as user activity and cause the
+                * resync to throttle -- see drbd_rs_should_slow_down(). */
+               atomic_add(len >> 9, &mdev->rs_sect_ev);
        }
 }
 
@@ -1256,7 +1256,7 @@ unsigned long _drbd_bm_find_next_zero(struct drbd_conf *mdev, unsigned long bm_f
  * expected to be called for only a few bits (e - s about BITS_PER_LONG).
  * Must hold bitmap lock already. */
 static int __bm_change_bits_to(struct drbd_conf *mdev, const unsigned long s,
-       unsigned long e, int val, const enum km_type km)
+       unsigned long e, int val)
 {
        struct drbd_bitmap *b = mdev->bitmap;
        unsigned long *p_addr = NULL;
@@ -1274,14 +1274,14 @@ static int __bm_change_bits_to(struct drbd_conf *mdev, const unsigned long s,
                unsigned int page_nr = bm_bit_to_page_idx(b, bitnr);
                if (page_nr != last_page_nr) {
                        if (p_addr)
-                               __bm_unmap(p_addr, km);
+                               __bm_unmap(p_addr, KM_IRQ1);
                        if (c < 0)
                                bm_set_page_lazy_writeout(b->bm_pages[last_page_nr]);
                        else if (c > 0)
                                bm_set_page_need_writeout(b->bm_pages[last_page_nr]);
                        changed_total += c;
                        c = 0;
-                       p_addr = __bm_map_pidx(b, page_nr, km);
+                       p_addr = __bm_map_pidx(b, page_nr, KM_IRQ1);
                        last_page_nr = page_nr;
                }
                if (val)
@@ -1290,7 +1290,7 @@ static int __bm_change_bits_to(struct drbd_conf *mdev, const unsigned long s,
                        c -= (0 != __test_and_clear_bit_le(bitnr & BITS_PER_PAGE_MASK, p_addr));
        }
        if (p_addr)
-               __bm_unmap(p_addr, km);
+               __bm_unmap(p_addr, KM_IRQ1);
        if (c < 0)
                bm_set_page_lazy_writeout(b->bm_pages[last_page_nr]);
        else if (c > 0)
@@ -1318,7 +1318,7 @@ static int bm_change_bits_to(struct drbd_conf *mdev, const unsigned long s,
        if ((val ? BM_DONT_SET : BM_DONT_CLEAR) & b->bm_flags)
                bm_print_lock_info(mdev);
 
-       c = __bm_change_bits_to(mdev, s, e, val, KM_IRQ1);
+       c = __bm_change_bits_to(mdev, s, e, val);
 
        spin_unlock_irqrestore(&b->bm_lock, flags);
        return c;
@@ -1343,16 +1343,17 @@ static inline void bm_set_full_words_within_one_page(struct drbd_bitmap *b,
 {
        int i;
        int bits;
-       unsigned long *paddr = kmap_atomic(b->bm_pages[page_nr], KM_USER0);
+       unsigned long *paddr = kmap_atomic(b->bm_pages[page_nr], KM_IRQ1);
        for (i = first_word; i < last_word; i++) {
                bits = hweight_long(paddr[i]);
                paddr[i] = ~0UL;
                b->bm_set += BITS_PER_LONG - bits;
        }
-       kunmap_atomic(paddr, KM_USER0);
+       kunmap_atomic(paddr, KM_IRQ1);
 }
 
-/* Same thing as drbd_bm_set_bits, but without taking the spin_lock_irqsave.
+/* Same thing as drbd_bm_set_bits,
+ * but more efficient for a large bit range.
  * You must first drbd_bm_lock().
  * Can be called to set the whole bitmap in one go.
  * Sets bits from s to e _inclusive_. */
@@ -1366,6 +1367,7 @@ void _drbd_bm_set_bits(struct drbd_conf *mdev, const unsigned long s, const unsi
         * Do not use memset, because we must account for changes,
         * so we need to loop over the words with hweight() anyways.
         */
+       struct drbd_bitmap *b = mdev->bitmap;
        unsigned long sl = ALIGN(s,BITS_PER_LONG);
        unsigned long el = (e+1) & ~((unsigned long)BITS_PER_LONG-1);
        int first_page;
@@ -1376,15 +1378,19 @@ void _drbd_bm_set_bits(struct drbd_conf *mdev, const unsigned long s, const unsi
 
        if (e - s <= 3*BITS_PER_LONG) {
                /* don't bother; el and sl may even be wrong. */
-               __bm_change_bits_to(mdev, s, e, 1, KM_USER0);
+               spin_lock_irq(&b->bm_lock);
+               __bm_change_bits_to(mdev, s, e, 1);
+               spin_unlock_irq(&b->bm_lock);
                return;
        }
 
        /* difference is large enough that we can trust sl and el */
 
+       spin_lock_irq(&b->bm_lock);
+
        /* bits filling the current long */
        if (sl)
-               __bm_change_bits_to(mdev, s, sl-1, 1, KM_USER0);
+               __bm_change_bits_to(mdev, s, sl-1, 1);
 
        first_page = sl >> (3 + PAGE_SHIFT);
        last_page = el >> (3 + PAGE_SHIFT);
@@ -1397,8 +1403,10 @@ void _drbd_bm_set_bits(struct drbd_conf *mdev, const unsigned long s, const unsi
        /* first and full pages, unless first page == last page */
        for (page_nr = first_page; page_nr < last_page; page_nr++) {
                bm_set_full_words_within_one_page(mdev->bitmap, page_nr, first_word, last_word);
+               spin_unlock_irq(&b->bm_lock);
                cond_resched();
                first_word = 0;
+               spin_lock_irq(&b->bm_lock);
        }
 
        /* last page (respectively only page, for first page == last page) */
@@ -1411,7 +1419,8 @@ void _drbd_bm_set_bits(struct drbd_conf *mdev, const unsigned long s, const unsi
         * it would trigger an assert in __bm_change_bits_to()
         */
        if (el <= e)
-               __bm_change_bits_to(mdev, el, e, 1, KM_USER0);
+               __bm_change_bits_to(mdev, el, e, 1);
+       spin_unlock_irq(&b->bm_lock);
 }
 
 /* returns bit state
index 25d32c5aa50ab58e0b2fdb4e7dfde2377ec96878..43beaca53179846f591fc940bb7108a6cc494e3c 100644 (file)
@@ -4602,6 +4602,11 @@ int drbd_asender(struct drbd_thread *thi)
                        dev_err(DEV, "meta connection shut down by peer.\n");
                        goto reconnect;
                } else if (rv == -EAGAIN) {
+                       /* If the data socket received something meanwhile,
+                        * that is good enough: peer is still alive. */
+                       if (time_after(mdev->last_received,
+                               jiffies - mdev->meta.socket->sk->sk_rcvtimeo))
+                               continue;
                        if (ping_timeout_active) {
                                dev_err(DEV, "PingAck did not arrive in time.\n");
                                goto reconnect;
@@ -4637,6 +4642,7 @@ int drbd_asender(struct drbd_thread *thi)
                                goto reconnect;
                }
                if (received == expect) {
+                       mdev->last_received = jiffies;
                        D_ASSERT(cmd != NULL);
                        if (!cmd->process(mdev, h))
                                goto reconnect;
index 4d76b06b6b20966f176e9b3dc9a795345a23798b..4d3e6f6213ba0436cc2eceff16b7876e58d952b6 100644 (file)
@@ -536,12 +536,7 @@ static int w_make_resync_request(struct drbd_conf *mdev,
                return 1;
        }
 
-       /* starting with drbd 8.3.8, we can handle multi-bio EEs,
-        * if it should be necessary */
-       max_bio_size =
-               mdev->agreed_pro_version < 94 ? queue_max_hw_sectors(mdev->rq_queue) << 9 :
-               mdev->agreed_pro_version < 95 ? DRBD_MAX_SIZE_H80_PACKET : DRBD_MAX_BIO_SIZE;
-
+       max_bio_size = queue_max_hw_sectors(mdev->rq_queue) << 9;
        number = drbd_rs_number_requests(mdev);
        if (number == 0)
                goto requeue;
index 4e04e1274388744efa6689da9fb7922974182999..596d5dd32f4153826e7a05d73dc818bd522b691b 100644 (file)
@@ -759,7 +759,7 @@ static void __exit acpi_cpufreq_exit(void)
 
        cpufreq_unregister_driver(&acpi_cpufreq_driver);
 
-       free_percpu(acpi_perf_data);
+       free_acpi_perf_data();
 }
 
 module_param(acpi_pstate_strict, uint, 0644);
index e18eaabe92b97bea100b6baa5528078696abb1ec..d99f71c356b51cb5387423b22c49290ea26a1869 100644 (file)
@@ -135,7 +135,8 @@ static int imxdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
                if (ret)
                        return ret;
 
-               imx_dma_config_burstlen(imxdmac->imxdma_channel, imxdmac->watermark_level);
+               imx_dma_config_burstlen(imxdmac->imxdma_channel,
+                               imxdmac->watermark_level * imxdmac->word_size);
 
                return 0;
        default:
index b6d1455fa9362ecba3dbfe088df72bc77b2ef21e..1ea47db2ff0630e6cb90f429f7008398597902e3 100644 (file)
@@ -1105,7 +1105,7 @@ static void sdma_add_scripts(struct sdma_engine *sdma,
 }
 
 static int __init sdma_get_firmware(struct sdma_engine *sdma,
-               const char *cpu_name, int to_version)
+               const char *fw_name)
 {
        const struct firmware *fw;
        char *fwname;
@@ -1114,7 +1114,7 @@ static int __init sdma_get_firmware(struct sdma_engine *sdma,
        const struct sdma_script_start_addrs *addr;
        unsigned short *ram_code;
 
-       fwname = kasprintf(GFP_KERNEL, "sdma-%s-to%d.bin", cpu_name, to_version);
+       fwname = kasprintf(GFP_KERNEL, "%s", fw_name);
        if (!fwname)
                return -ENOMEM;
 
@@ -1317,7 +1317,7 @@ static int __init sdma_probe(struct platform_device *pdev)
        if (pdata->script_addrs)
                sdma_add_scripts(sdma, pdata->script_addrs);
 
-       sdma_get_firmware(sdma, pdata->cpu_name, pdata->to_version);
+       sdma_get_firmware(sdma, pdata->fw_name);
 
        sdma->dma_device.dev = &pdev->dev;
 
index 438e6c83117087d8d10c13418ff3a68edf9314ff..ebb897329c1e947d3392f091f9ef627bc1f5fa82 100644 (file)
@@ -264,6 +264,7 @@ static char ohci_driver_name[] = KBUILD_MODNAME;
 #define PCI_DEVICE_ID_AGERE_FW643      0x5901
 #define PCI_DEVICE_ID_JMICRON_JMB38X_FW        0x2380
 #define PCI_DEVICE_ID_TI_TSB12LV22     0x8009
+#define PCI_VENDOR_ID_PINNACLE_SYSTEMS 0x11bd
 
 #define QUIRK_CYCLE_TIMER              1
 #define QUIRK_RESET_PACKET             2
@@ -3190,6 +3191,11 @@ static int __devinit pci_probe(struct pci_dev *dev,
        int i, err;
        size_t size;
 
+       if (dev->vendor == PCI_VENDOR_ID_PINNACLE_SYSTEMS) {
+               dev_err(&dev->dev, "Pinnacle MovieBoard is not yet supported\n");
+               return -ENOSYS;
+       }
+
        ohci = kzalloc(sizeof(*ohci), GFP_KERNEL);
        if (ohci == NULL) {
                err = -ENOMEM;
index 2967002a9f820b2894dd1f8f1110a47a9694e250..5e6fc222bb2320d7126dea54d03525b319340f34 100644 (file)
@@ -90,6 +90,15 @@ config GPIO_EXYNOS4
        def_bool y
        depends on CPU_EXYNOS4210
 
+config GPIO_MXS
+       def_bool y
+       depends on ARCH_MXS
+
+config GPIO_MXC
+       def_bool y
+       depends on ARCH_MXC
+       select GPIO_BASIC_MMIO_CORE
+
 config GPIO_PLAT_SAMSUNG
        def_bool y
        depends on SAMSUNG_GPIOLIB_4BIT
index b605f8ec6fbe0afc01e6c4604de67e6a85f98add..9c37339a57a792e442aa4c03732e10933ec085de 100644 (file)
@@ -9,6 +9,8 @@ obj-$(CONFIG_GPIO_ADP5588)      += adp5588-gpio.o
 obj-$(CONFIG_GPIO_BASIC_MMIO_CORE)     += basic_mmio_gpio.o
 obj-$(CONFIG_GPIO_BASIC_MMIO)  += basic_mmio_gpio.o
 obj-$(CONFIG_GPIO_EXYNOS4)     += gpio-exynos4.o
+obj-$(CONFIG_GPIO_MXC)         += gpio-mxc.o
+obj-$(CONFIG_GPIO_MXS)         += gpio-mxs.o
 obj-$(CONFIG_GPIO_PLAT_SAMSUNG)        += gpio-plat-samsung.o
 obj-$(CONFIG_GPIO_S5PC100)     += gpio-s5pc100.o
 obj-$(CONFIG_GPIO_S5PV210)     += gpio-s5pv210.o
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
new file mode 100644 (file)
index 0000000..b351952
--- /dev/null
@@ -0,0 +1,379 @@
+/*
+ * MXC GPIO support. (c) 2008 Daniel Mack <daniel@caiaq.de>
+ * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
+ *
+ * Based on code from Freescale,
+ * Copyright (C) 2004-2010 Freescale Semiconductor, Inc. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <linux/irq.h>
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+#include <linux/basic_mmio_gpio.h>
+#include <mach/hardware.h>
+#include <asm-generic/bug.h>
+
+struct mxc_gpio_port {
+       struct list_head node;
+       void __iomem *base;
+       int irq;
+       int irq_high;
+       int virtual_irq_start;
+       struct bgpio_chip bgc;
+       u32 both_edges;
+};
+
+/*
+ * MX2 has one interrupt *for all* gpio ports. The list is used
+ * to save the references to all ports, so that mx2_gpio_irq_handler
+ * can walk through all interrupt status registers.
+ */
+static LIST_HEAD(mxc_gpio_ports);
+
+#define cpu_is_mx1_mx2()       (cpu_is_mx1() || cpu_is_mx2())
+
+#define GPIO_DR                (cpu_is_mx1_mx2() ? 0x1c : 0x00)
+#define GPIO_GDIR      (cpu_is_mx1_mx2() ? 0x00 : 0x04)
+#define GPIO_PSR       (cpu_is_mx1_mx2() ? 0x24 : 0x08)
+#define GPIO_ICR1      (cpu_is_mx1_mx2() ? 0x28 : 0x0C)
+#define GPIO_ICR2      (cpu_is_mx1_mx2() ? 0x2C : 0x10)
+#define GPIO_IMR       (cpu_is_mx1_mx2() ? 0x30 : 0x14)
+#define GPIO_ISR       (cpu_is_mx1_mx2() ? 0x34 : 0x18)
+
+#define GPIO_INT_LOW_LEV       (cpu_is_mx1_mx2() ? 0x3 : 0x0)
+#define GPIO_INT_HIGH_LEV      (cpu_is_mx1_mx2() ? 0x2 : 0x1)
+#define GPIO_INT_RISE_EDGE     (cpu_is_mx1_mx2() ? 0x0 : 0x2)
+#define GPIO_INT_FALL_EDGE     (cpu_is_mx1_mx2() ? 0x1 : 0x3)
+#define GPIO_INT_NONE          0x4
+
+/* Note: This driver assumes 32 GPIOs are handled in one register */
+
+static void _clear_gpio_irqstatus(struct mxc_gpio_port *port, u32 index)
+{
+       writel(1 << index, port->base + GPIO_ISR);
+}
+
+static void _set_gpio_irqenable(struct mxc_gpio_port *port, u32 index,
+                               int enable)
+{
+       u32 l;
+
+       l = readl(port->base + GPIO_IMR);
+       l = (l & (~(1 << index))) | (!!enable << index);
+       writel(l, port->base + GPIO_IMR);
+}
+
+static void gpio_ack_irq(struct irq_data *d)
+{
+       struct mxc_gpio_port *port = irq_data_get_irq_chip_data(d);
+       u32 gpio = irq_to_gpio(d->irq);
+       _clear_gpio_irqstatus(port, gpio & 0x1f);
+}
+
+static void gpio_mask_irq(struct irq_data *d)
+{
+       struct mxc_gpio_port *port = irq_data_get_irq_chip_data(d);
+       u32 gpio = irq_to_gpio(d->irq);
+       _set_gpio_irqenable(port, gpio & 0x1f, 0);
+}
+
+static void gpio_unmask_irq(struct irq_data *d)
+{
+       struct mxc_gpio_port *port = irq_data_get_irq_chip_data(d);
+       u32 gpio = irq_to_gpio(d->irq);
+       _set_gpio_irqenable(port, gpio & 0x1f, 1);
+}
+
+static int gpio_set_irq_type(struct irq_data *d, u32 type)
+{
+       u32 gpio = irq_to_gpio(d->irq);
+       struct mxc_gpio_port *port = irq_data_get_irq_chip_data(d);
+       u32 bit, val;
+       int edge;
+       void __iomem *reg = port->base;
+
+       port->both_edges &= ~(1 << (gpio & 31));
+       switch (type) {
+       case IRQ_TYPE_EDGE_RISING:
+               edge = GPIO_INT_RISE_EDGE;
+               break;
+       case IRQ_TYPE_EDGE_FALLING:
+               edge = GPIO_INT_FALL_EDGE;
+               break;
+       case IRQ_TYPE_EDGE_BOTH:
+               val = gpio_get_value(gpio & 31);
+               if (val) {
+                       edge = GPIO_INT_LOW_LEV;
+                       pr_debug("mxc: set GPIO %d to low trigger\n", gpio);
+               } else {
+                       edge = GPIO_INT_HIGH_LEV;
+                       pr_debug("mxc: set GPIO %d to high trigger\n", gpio);
+               }
+               port->both_edges |= 1 << (gpio & 31);
+               break;
+       case IRQ_TYPE_LEVEL_LOW:
+               edge = GPIO_INT_LOW_LEV;
+               break;
+       case IRQ_TYPE_LEVEL_HIGH:
+               edge = GPIO_INT_HIGH_LEV;
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       reg += GPIO_ICR1 + ((gpio & 0x10) >> 2); /* lower or upper register */
+       bit = gpio & 0xf;
+       val = readl(reg) & ~(0x3 << (bit << 1));
+       writel(val | (edge << (bit << 1)), reg);
+       _clear_gpio_irqstatus(port, gpio & 0x1f);
+
+       return 0;
+}
+
+static void mxc_flip_edge(struct mxc_gpio_port *port, u32 gpio)
+{
+       void __iomem *reg = port->base;
+       u32 bit, val;
+       int edge;
+
+       reg += GPIO_ICR1 + ((gpio & 0x10) >> 2); /* lower or upper register */
+       bit = gpio & 0xf;
+       val = readl(reg);
+       edge = (val >> (bit << 1)) & 3;
+       val &= ~(0x3 << (bit << 1));
+       if (edge == GPIO_INT_HIGH_LEV) {
+               edge = GPIO_INT_LOW_LEV;
+               pr_debug("mxc: switch GPIO %d to low trigger\n", gpio);
+       } else if (edge == GPIO_INT_LOW_LEV) {
+               edge = GPIO_INT_HIGH_LEV;
+               pr_debug("mxc: switch GPIO %d to high trigger\n", gpio);
+       } else {
+               pr_err("mxc: invalid configuration for GPIO %d: %x\n",
+                      gpio, edge);
+               return;
+       }
+       writel(val | (edge << (bit << 1)), reg);
+}
+
+/* handle 32 interrupts in one status register */
+static void mxc_gpio_irq_handler(struct mxc_gpio_port *port, u32 irq_stat)
+{
+       u32 gpio_irq_no_base = port->virtual_irq_start;
+
+       while (irq_stat != 0) {
+               int irqoffset = fls(irq_stat) - 1;
+
+               if (port->both_edges & (1 << irqoffset))
+                       mxc_flip_edge(port, irqoffset);
+
+               generic_handle_irq(gpio_irq_no_base + irqoffset);
+
+               irq_stat &= ~(1 << irqoffset);
+       }
+}
+
+/* MX1 and MX3 has one interrupt *per* gpio port */
+static void mx3_gpio_irq_handler(u32 irq, struct irq_desc *desc)
+{
+       u32 irq_stat;
+       struct mxc_gpio_port *port = irq_get_handler_data(irq);
+
+       irq_stat = readl(port->base + GPIO_ISR) & readl(port->base + GPIO_IMR);
+
+       mxc_gpio_irq_handler(port, irq_stat);
+}
+
+/* MX2 has one interrupt *for all* gpio ports */
+static void mx2_gpio_irq_handler(u32 irq, struct irq_desc *desc)
+{
+       u32 irq_msk, irq_stat;
+       struct mxc_gpio_port *port;
+
+       /* walk through all interrupt status registers */
+       list_for_each_entry(port, &mxc_gpio_ports, node) {
+               irq_msk = readl(port->base + GPIO_IMR);
+               if (!irq_msk)
+                       continue;
+
+               irq_stat = readl(port->base + GPIO_ISR) & irq_msk;
+               if (irq_stat)
+                       mxc_gpio_irq_handler(port, irq_stat);
+       }
+}
+
+/*
+ * Set interrupt number "irq" in the GPIO as a wake-up source.
+ * While system is running, all registered GPIO interrupts need to have
+ * wake-up enabled. When system is suspended, only selected GPIO interrupts
+ * need to have wake-up enabled.
+ * @param  irq          interrupt source number
+ * @param  enable       enable as wake-up if equal to non-zero
+ * @return       This function returns 0 on success.
+ */
+static int gpio_set_wake_irq(struct irq_data *d, u32 enable)
+{
+       u32 gpio = irq_to_gpio(d->irq);
+       u32 gpio_idx = gpio & 0x1F;
+       struct mxc_gpio_port *port = irq_data_get_irq_chip_data(d);
+
+       if (enable) {
+               if (port->irq_high && (gpio_idx >= 16))
+                       enable_irq_wake(port->irq_high);
+               else
+                       enable_irq_wake(port->irq);
+       } else {
+               if (port->irq_high && (gpio_idx >= 16))
+                       disable_irq_wake(port->irq_high);
+               else
+                       disable_irq_wake(port->irq);
+       }
+
+       return 0;
+}
+
+static struct irq_chip gpio_irq_chip = {
+       .name = "GPIO",
+       .irq_ack = gpio_ack_irq,
+       .irq_mask = gpio_mask_irq,
+       .irq_unmask = gpio_unmask_irq,
+       .irq_set_type = gpio_set_irq_type,
+       .irq_set_wake = gpio_set_wake_irq,
+};
+
+/*
+ * This lock class tells lockdep that GPIO irqs are in a different
+ * category than their parents, so it won't report false recursion.
+ */
+static struct lock_class_key gpio_lock_class;
+
+static int __devinit mxc_gpio_probe(struct platform_device *pdev)
+{
+       struct mxc_gpio_port *port;
+       struct resource *iores;
+       int err, i;
+
+       port = kzalloc(sizeof(struct mxc_gpio_port), GFP_KERNEL);
+       if (!port)
+               return -ENOMEM;
+
+       port->virtual_irq_start = MXC_GPIO_IRQ_START + pdev->id * 32;
+
+       iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       if (!iores) {
+               err = -ENODEV;
+               goto out_kfree;
+       }
+
+       if (!request_mem_region(iores->start, resource_size(iores),
+                               pdev->name)) {
+               err = -EBUSY;
+               goto out_kfree;
+       }
+
+       port->base = ioremap(iores->start, resource_size(iores));
+       if (!port->base) {
+               err = -ENOMEM;
+               goto out_release_mem;
+       }
+
+       port->irq_high = platform_get_irq(pdev, 1);
+       port->irq = platform_get_irq(pdev, 0);
+       if (port->irq < 0) {
+               err = -EINVAL;
+               goto out_iounmap;
+       }
+
+       /* disable the interrupt and clear the status */
+       writel(0, port->base + GPIO_IMR);
+       writel(~0, port->base + GPIO_ISR);
+
+       for (i = port->virtual_irq_start;
+               i < port->virtual_irq_start + 32; i++) {
+               irq_set_lockdep_class(i, &gpio_lock_class);
+               irq_set_chip_and_handler(i, &gpio_irq_chip, handle_level_irq);
+               set_irq_flags(i, IRQF_VALID);
+               irq_set_chip_data(i, port);
+       }
+
+       if (cpu_is_mx2()) {
+               /* setup one handler for all GPIO interrupts */
+               if (pdev->id == 0)
+                       irq_set_chained_handler(port->irq,
+                                               mx2_gpio_irq_handler);
+       } else {
+               /* setup one handler for each entry */
+               irq_set_chained_handler(port->irq, mx3_gpio_irq_handler);
+               irq_set_handler_data(port->irq, port);
+               if (port->irq_high > 0) {
+                       /* setup handler for GPIO 16 to 31 */
+                       irq_set_chained_handler(port->irq_high,
+                                               mx3_gpio_irq_handler);
+                       irq_set_handler_data(port->irq_high, port);
+               }
+       }
+
+       err = bgpio_init(&port->bgc, &pdev->dev, 4,
+                        port->base + GPIO_PSR,
+                        port->base + GPIO_DR, NULL,
+                        port->base + GPIO_GDIR, NULL, false);
+       if (err)
+               goto out_iounmap;
+
+       port->bgc.gc.base = pdev->id * 32;
+
+       err = gpiochip_add(&port->bgc.gc);
+       if (err)
+               goto out_bgpio_remove;
+
+       list_add_tail(&port->node, &mxc_gpio_ports);
+
+       return 0;
+
+out_bgpio_remove:
+       bgpio_remove(&port->bgc);
+out_iounmap:
+       iounmap(port->base);
+out_release_mem:
+       release_mem_region(iores->start, resource_size(iores));
+out_kfree:
+       kfree(port);
+       dev_info(&pdev->dev, "%s failed with errno %d\n", __func__, err);
+       return err;
+}
+
+static struct platform_driver mxc_gpio_driver = {
+       .driver         = {
+               .name   = "gpio-mxc",
+               .owner  = THIS_MODULE,
+       },
+       .probe          = mxc_gpio_probe,
+};
+
+static int __init gpio_mxc_init(void)
+{
+       return platform_driver_register(&mxc_gpio_driver);
+}
+postcore_initcall(gpio_mxc_init);
+
+MODULE_AUTHOR("Freescale Semiconductor, "
+             "Daniel Mack <danielncaiaq.de>, "
+             "Juergen Beisert <kernel@pengutronix.de>");
+MODULE_DESCRIPTION("Freescale MXC GPIO");
+MODULE_LICENSE("GPL");
diff --git a/drivers/gpio/gpio-mxs.c b/drivers/gpio/gpio-mxs.c
new file mode 100644 (file)
index 0000000..a287614
--- /dev/null
@@ -0,0 +1,370 @@
+/*
+ * MXC GPIO support. (c) 2008 Daniel Mack <daniel@caiaq.de>
+ * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
+ *
+ * Based on code from Freescale,
+ * Copyright (C) 2004-2010 Freescale Semiconductor, Inc. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ */
+
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/io.h>
+#include <linux/irq.h>
+#include <linux/gpio.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+#include <mach/mxs.h>
+
+#define MXS_SET                0x4
+#define MXS_CLR                0x8
+
+#define PINCTRL_DOUT(n)                ((cpu_is_mx23() ? 0x0500 : 0x0700) + (n) * 0x10)
+#define PINCTRL_DIN(n)         ((cpu_is_mx23() ? 0x0600 : 0x0900) + (n) * 0x10)
+#define PINCTRL_DOE(n)         ((cpu_is_mx23() ? 0x0700 : 0x0b00) + (n) * 0x10)
+#define PINCTRL_PIN2IRQ(n)     ((cpu_is_mx23() ? 0x0800 : 0x1000) + (n) * 0x10)
+#define PINCTRL_IRQEN(n)       ((cpu_is_mx23() ? 0x0900 : 0x1100) + (n) * 0x10)
+#define PINCTRL_IRQLEV(n)      ((cpu_is_mx23() ? 0x0a00 : 0x1200) + (n) * 0x10)
+#define PINCTRL_IRQPOL(n)      ((cpu_is_mx23() ? 0x0b00 : 0x1300) + (n) * 0x10)
+#define PINCTRL_IRQSTAT(n)     ((cpu_is_mx23() ? 0x0c00 : 0x1400) + (n) * 0x10)
+
+#define GPIO_INT_FALL_EDGE     0x0
+#define GPIO_INT_LOW_LEV       0x1
+#define GPIO_INT_RISE_EDGE     0x2
+#define GPIO_INT_HIGH_LEV      0x3
+#define GPIO_INT_LEV_MASK      (1 << 0)
+#define GPIO_INT_POL_MASK      (1 << 1)
+
+struct mxs_gpio_port {
+       void __iomem *base;
+       int id;
+       int irq;
+       int irq_high;
+       int virtual_irq_start;
+       struct gpio_chip chip;
+};
+
+/* Note: This driver assumes 32 GPIOs are handled in one register */
+
+static void clear_gpio_irqstatus(struct mxs_gpio_port *port, u32 index)
+{
+       writel(1 << index, port->base + PINCTRL_IRQSTAT(port->id) + MXS_CLR);
+}
+
+static void set_gpio_irqenable(struct mxs_gpio_port *port, u32 index,
+                               int enable)
+{
+       if (enable) {
+               writel(1 << index,
+                       port->base + PINCTRL_IRQEN(port->id) + MXS_SET);
+               writel(1 << index,
+                       port->base + PINCTRL_PIN2IRQ(port->id) + MXS_SET);
+       } else {
+               writel(1 << index,
+                       port->base + PINCTRL_IRQEN(port->id) + MXS_CLR);
+       }
+}
+
+static void mxs_gpio_ack_irq(struct irq_data *d)
+{
+       struct mxs_gpio_port *port = irq_data_get_irq_chip_data(d);
+       u32 gpio = irq_to_gpio(d->irq);
+       clear_gpio_irqstatus(port, gpio & 0x1f);
+}
+
+static void mxs_gpio_mask_irq(struct irq_data *d)
+{
+       struct mxs_gpio_port *port = irq_data_get_irq_chip_data(d);
+       u32 gpio = irq_to_gpio(d->irq);
+       set_gpio_irqenable(port, gpio & 0x1f, 0);
+}
+
+static void mxs_gpio_unmask_irq(struct irq_data *d)
+{
+       struct mxs_gpio_port *port = irq_data_get_irq_chip_data(d);
+       u32 gpio = irq_to_gpio(d->irq);
+       set_gpio_irqenable(port, gpio & 0x1f, 1);
+}
+
+static int mxs_gpio_get(struct gpio_chip *chip, unsigned offset);
+
+static int mxs_gpio_set_irq_type(struct irq_data *d, unsigned int type)
+{
+       u32 gpio = irq_to_gpio(d->irq);
+       u32 pin_mask = 1 << (gpio & 31);
+       struct mxs_gpio_port *port = irq_data_get_irq_chip_data(d);
+       void __iomem *pin_addr;
+       int edge;
+
+       switch (type) {
+       case IRQ_TYPE_EDGE_RISING:
+               edge = GPIO_INT_RISE_EDGE;
+               break;
+       case IRQ_TYPE_EDGE_FALLING:
+               edge = GPIO_INT_FALL_EDGE;
+               break;
+       case IRQ_TYPE_LEVEL_LOW:
+               edge = GPIO_INT_LOW_LEV;
+               break;
+       case IRQ_TYPE_LEVEL_HIGH:
+               edge = GPIO_INT_HIGH_LEV;
+               break;
+       default:
+               return -EINVAL;
+       }
+
+       /* set level or edge */
+       pin_addr = port->base + PINCTRL_IRQLEV(port->id);
+       if (edge & GPIO_INT_LEV_MASK)
+               writel(pin_mask, pin_addr + MXS_SET);
+       else
+               writel(pin_mask, pin_addr + MXS_CLR);
+
+       /* set polarity */
+       pin_addr = port->base + PINCTRL_IRQPOL(port->id);
+       if (edge & GPIO_INT_POL_MASK)
+               writel(pin_mask, pin_addr + MXS_SET);
+       else
+               writel(pin_mask, pin_addr + MXS_CLR);
+
+       clear_gpio_irqstatus(port, gpio & 0x1f);
+
+       return 0;
+}
+
+/* MXS has one interrupt *per* gpio port */
+static void mxs_gpio_irq_handler(u32 irq, struct irq_desc *desc)
+{
+       u32 irq_stat;
+       struct mxs_gpio_port *port = irq_get_handler_data(irq);
+       u32 gpio_irq_no_base = port->virtual_irq_start;
+
+       desc->irq_data.chip->irq_ack(&desc->irq_data);
+
+       irq_stat = readl(port->base + PINCTRL_IRQSTAT(port->id)) &
+                       readl(port->base + PINCTRL_IRQEN(port->id));
+
+       while (irq_stat != 0) {
+               int irqoffset = fls(irq_stat) - 1;
+               generic_handle_irq(gpio_irq_no_base + irqoffset);
+               irq_stat &= ~(1 << irqoffset);
+       }
+}
+
+/*
+ * Set interrupt number "irq" in the GPIO as a wake-up source.
+ * While system is running, all registered GPIO interrupts need to have
+ * wake-up enabled. When system is suspended, only selected GPIO interrupts
+ * need to have wake-up enabled.
+ * @param  irq          interrupt source number
+ * @param  enable       enable as wake-up if equal to non-zero
+ * @return       This function returns 0 on success.
+ */
+static int mxs_gpio_set_wake_irq(struct irq_data *d, unsigned int enable)
+{
+       u32 gpio = irq_to_gpio(d->irq);
+       u32 gpio_idx = gpio & 0x1f;
+       struct mxs_gpio_port *port = irq_data_get_irq_chip_data(d);
+
+       if (enable) {
+               if (port->irq_high && (gpio_idx >= 16))
+                       enable_irq_wake(port->irq_high);
+               else
+                       enable_irq_wake(port->irq);
+       } else {
+               if (port->irq_high && (gpio_idx >= 16))
+                       disable_irq_wake(port->irq_high);
+               else
+                       disable_irq_wake(port->irq);
+       }
+
+       return 0;
+}
+
+static struct irq_chip gpio_irq_chip = {
+       .name = "mxs gpio",
+       .irq_ack = mxs_gpio_ack_irq,
+       .irq_mask = mxs_gpio_mask_irq,
+       .irq_unmask = mxs_gpio_unmask_irq,
+       .irq_set_type = mxs_gpio_set_irq_type,
+       .irq_set_wake = mxs_gpio_set_wake_irq,
+};
+
+static void mxs_set_gpio_direction(struct gpio_chip *chip, unsigned offset,
+                               int dir)
+{
+       struct mxs_gpio_port *port =
+               container_of(chip, struct mxs_gpio_port, chip);
+       void __iomem *pin_addr = port->base + PINCTRL_DOE(port->id);
+
+       if (dir)
+               writel(1 << offset, pin_addr + MXS_SET);
+       else
+               writel(1 << offset, pin_addr + MXS_CLR);
+}
+
+static int mxs_gpio_get(struct gpio_chip *chip, unsigned offset)
+{
+       struct mxs_gpio_port *port =
+               container_of(chip, struct mxs_gpio_port, chip);
+
+       return (readl(port->base + PINCTRL_DIN(port->id)) >> offset) & 1;
+}
+
+static void mxs_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
+{
+       struct mxs_gpio_port *port =
+               container_of(chip, struct mxs_gpio_port, chip);
+       void __iomem *pin_addr = port->base + PINCTRL_DOUT(port->id);
+
+       if (value)
+               writel(1 << offset, pin_addr + MXS_SET);
+       else
+               writel(1 << offset, pin_addr + MXS_CLR);
+}
+
+static int mxs_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
+{
+       struct mxs_gpio_port *port =
+               container_of(chip, struct mxs_gpio_port, chip);
+
+       return port->virtual_irq_start + offset;
+}
+
+static int mxs_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
+{
+       mxs_set_gpio_direction(chip, offset, 0);
+       return 0;
+}
+
+static int mxs_gpio_direction_output(struct gpio_chip *chip,
+                                    unsigned offset, int value)
+{
+       mxs_gpio_set(chip, offset, value);
+       mxs_set_gpio_direction(chip, offset, 1);
+       return 0;
+}
+
+static int __devinit mxs_gpio_probe(struct platform_device *pdev)
+{
+       static void __iomem *base;
+       struct mxs_gpio_port *port;
+       struct resource *iores = NULL;
+       int err, i;
+
+       port = kzalloc(sizeof(struct mxs_gpio_port), GFP_KERNEL);
+       if (!port)
+               return -ENOMEM;
+
+       port->id = pdev->id;
+       port->virtual_irq_start = MXS_GPIO_IRQ_START + port->id * 32;
+
+       /*
+        * map memory region only once, as all the gpio ports
+        * share the same one
+        */
+       if (!base) {
+               iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+               if (!iores) {
+                       err = -ENODEV;
+                       goto out_kfree;
+               }
+
+               if (!request_mem_region(iores->start, resource_size(iores),
+                                       pdev->name)) {
+                       err = -EBUSY;
+                       goto out_kfree;
+               }
+
+               base = ioremap(iores->start, resource_size(iores));
+               if (!base) {
+                       err = -ENOMEM;
+                       goto out_release_mem;
+               }
+       }
+       port->base = base;
+
+       port->irq = platform_get_irq(pdev, 0);
+       if (port->irq < 0) {
+               err = -EINVAL;
+               goto out_iounmap;
+       }
+
+       /* disable the interrupt and clear the status */
+       writel(0, port->base + PINCTRL_PIN2IRQ(port->id));
+       writel(0, port->base + PINCTRL_IRQEN(port->id));
+
+       /* clear address has to be used to clear IRQSTAT bits */
+       writel(~0U, port->base + PINCTRL_IRQSTAT(port->id) + MXS_CLR);
+
+       for (i = port->virtual_irq_start;
+               i < port->virtual_irq_start + 32; i++) {
+               irq_set_chip_and_handler(i, &gpio_irq_chip,
+                                        handle_level_irq);
+               set_irq_flags(i, IRQF_VALID);
+               irq_set_chip_data(i, port);
+       }
+
+       /* setup one handler for each entry */
+       irq_set_chained_handler(port->irq, mxs_gpio_irq_handler);
+       irq_set_handler_data(port->irq, port);
+
+       /* register gpio chip */
+       port->chip.direction_input = mxs_gpio_direction_input;
+       port->chip.direction_output = mxs_gpio_direction_output;
+       port->chip.get = mxs_gpio_get;
+       port->chip.set = mxs_gpio_set;
+       port->chip.to_irq = mxs_gpio_to_irq;
+       port->chip.base = port->id * 32;
+       port->chip.ngpio = 32;
+
+       err = gpiochip_add(&port->chip);
+       if (err)
+               goto out_iounmap;
+
+       return 0;
+
+out_iounmap:
+       if (iores)
+               iounmap(port->base);
+out_release_mem:
+       if (iores)
+               release_mem_region(iores->start, resource_size(iores));
+out_kfree:
+       kfree(port);
+       dev_info(&pdev->dev, "%s failed with errno %d\n", __func__, err);
+       return err;
+}
+
+static struct platform_driver mxs_gpio_driver = {
+       .driver         = {
+               .name   = "gpio-mxs",
+               .owner  = THIS_MODULE,
+       },
+       .probe          = mxs_gpio_probe,
+};
+
+static int __init mxs_gpio_init(void)
+{
+       return platform_driver_register(&mxs_gpio_driver);
+}
+postcore_initcall(mxs_gpio_init);
+
+MODULE_AUTHOR("Freescale Semiconductor, "
+             "Daniel Mack <danielncaiaq.de>, "
+             "Juergen Beisert <kernel@pengutronix.de>");
+MODULE_DESCRIPTION("Freescale MXS GPIO");
+MODULE_LICENSE("GPL");
index bd6571e0097a8be17b8fe3c27db173f3c8d9438b..644ba1255d3c8f0777e7d519efb8c7030c46f39d 100644 (file)
@@ -223,7 +223,7 @@ static void lnw_irq_handler(unsigned irq, struct irq_desc *desc)
                gedr = gpio_reg(&lnw->chip, base, GEDR);
                pending = readl(gedr);
                while (pending) {
-                       gpio = __ffs(pending) - 1;
+                       gpio = __ffs(pending);
                        mask = BIT(gpio);
                        pending &= ~mask;
                        /* Clear before handling so we can't lose an edge */
index 8d1ddfdd63eb2ab6b89eb749ee831e37ede6b96d..15097ca616d69606e150ab96c62bfa89a38159cf 100644 (file)
@@ -81,8 +81,10 @@ void tps65910_gpio_init(struct tps65910 *tps65910, int gpio_base)
        switch(tps65910_chip_id(tps65910)) {
        case TPS65910:
                tps65910->gpio.ngpio    = 6;
+               break;
        case TPS65911:
                tps65910->gpio.ngpio    = 9;
+               break;
        default:
                return;
        }
index 21058e6ad2b80ccbc10be90795402701270d1585..82db1850666253dc021f8a43e635fe91ebce94df 100644 (file)
@@ -886,9 +886,6 @@ int drm_mode_group_init(struct drm_device *dev, struct drm_mode_group *group)
        total_objects += dev->mode_config.num_connector;
        total_objects += dev->mode_config.num_encoder;
 
-       if (total_objects == 0)
-               return -EINVAL;
-
        group->id_list = kzalloc(total_objects * sizeof(uint32_t), GFP_KERNEL);
        if (!group->id_list)
                return -ENOMEM;
index e8a5ffb0124d2256d821f2adc899f659351040a8..660f96401a05a7ac8dd4766802684b5a42d03f38 100644 (file)
@@ -985,17 +985,19 @@ void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *sav
 {
        save->vga_control[0] = RREG32(D1VGA_CONTROL);
        save->vga_control[1] = RREG32(D2VGA_CONTROL);
-       save->vga_control[2] = RREG32(EVERGREEN_D3VGA_CONTROL);
-       save->vga_control[3] = RREG32(EVERGREEN_D4VGA_CONTROL);
-       save->vga_control[4] = RREG32(EVERGREEN_D5VGA_CONTROL);
-       save->vga_control[5] = RREG32(EVERGREEN_D6VGA_CONTROL);
        save->vga_render_control = RREG32(VGA_RENDER_CONTROL);
        save->vga_hdp_control = RREG32(VGA_HDP_CONTROL);
        save->crtc_control[0] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET);
        save->crtc_control[1] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET);
-       if (!(rdev->flags & RADEON_IS_IGP)) {
+       if (rdev->num_crtc >= 4) {
+               save->vga_control[2] = RREG32(EVERGREEN_D3VGA_CONTROL);
+               save->vga_control[3] = RREG32(EVERGREEN_D4VGA_CONTROL);
                save->crtc_control[2] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET);
                save->crtc_control[3] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET);
+       }
+       if (rdev->num_crtc >= 6) {
+               save->vga_control[4] = RREG32(EVERGREEN_D5VGA_CONTROL);
+               save->vga_control[5] = RREG32(EVERGREEN_D6VGA_CONTROL);
                save->crtc_control[4] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET);
                save->crtc_control[5] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET);
        }
@@ -1004,35 +1006,45 @@ void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *sav
        WREG32(VGA_RENDER_CONTROL, 0);
        WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC0_REGISTER_OFFSET, 1);
        WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC1_REGISTER_OFFSET, 1);
-       if (!(rdev->flags & RADEON_IS_IGP)) {
+       if (rdev->num_crtc >= 4) {
                WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC2_REGISTER_OFFSET, 1);
                WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC3_REGISTER_OFFSET, 1);
+       }
+       if (rdev->num_crtc >= 6) {
                WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC4_REGISTER_OFFSET, 1);
                WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC5_REGISTER_OFFSET, 1);
        }
        WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET, 0);
        WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET, 0);
-       if (!(rdev->flags & RADEON_IS_IGP)) {
+       if (rdev->num_crtc >= 4) {
                WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET, 0);
                WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET, 0);
+       }
+       if (rdev->num_crtc >= 6) {
                WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET, 0);
                WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET, 0);
        }
        WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC0_REGISTER_OFFSET, 0);
        WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC1_REGISTER_OFFSET, 0);
-       if (!(rdev->flags & RADEON_IS_IGP)) {
+       if (rdev->num_crtc >= 4) {
                WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC2_REGISTER_OFFSET, 0);
                WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC3_REGISTER_OFFSET, 0);
+       }
+       if (rdev->num_crtc >= 6) {
                WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC4_REGISTER_OFFSET, 0);
                WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC5_REGISTER_OFFSET, 0);
        }
 
        WREG32(D1VGA_CONTROL, 0);
        WREG32(D2VGA_CONTROL, 0);
-       WREG32(EVERGREEN_D3VGA_CONTROL, 0);
-       WREG32(EVERGREEN_D4VGA_CONTROL, 0);
-       WREG32(EVERGREEN_D5VGA_CONTROL, 0);
-       WREG32(EVERGREEN_D6VGA_CONTROL, 0);
+       if (rdev->num_crtc >= 4) {
+               WREG32(EVERGREEN_D3VGA_CONTROL, 0);
+               WREG32(EVERGREEN_D4VGA_CONTROL, 0);
+       }
+       if (rdev->num_crtc >= 6) {
+               WREG32(EVERGREEN_D5VGA_CONTROL, 0);
+               WREG32(EVERGREEN_D6VGA_CONTROL, 0);
+       }
 }
 
 void evergreen_mc_resume(struct radeon_device *rdev, struct evergreen_mc_save *save)
@@ -1055,7 +1067,7 @@ void evergreen_mc_resume(struct radeon_device *rdev, struct evergreen_mc_save *s
        WREG32(EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS + EVERGREEN_CRTC1_REGISTER_OFFSET,
               (u32)rdev->mc.vram_start);
 
-       if (!(rdev->flags & RADEON_IS_IGP)) {
+       if (rdev->num_crtc >= 4) {
                WREG32(EVERGREEN_GRPH_PRIMARY_SURFACE_ADDRESS_HIGH + EVERGREEN_CRTC2_REGISTER_OFFSET,
                       upper_32_bits(rdev->mc.vram_start));
                WREG32(EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS_HIGH + EVERGREEN_CRTC2_REGISTER_OFFSET,
@@ -1073,7 +1085,8 @@ void evergreen_mc_resume(struct radeon_device *rdev, struct evergreen_mc_save *s
                       (u32)rdev->mc.vram_start);
                WREG32(EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS + EVERGREEN_CRTC3_REGISTER_OFFSET,
                       (u32)rdev->mc.vram_start);
-
+       }
+       if (rdev->num_crtc >= 6) {
                WREG32(EVERGREEN_GRPH_PRIMARY_SURFACE_ADDRESS_HIGH + EVERGREEN_CRTC4_REGISTER_OFFSET,
                       upper_32_bits(rdev->mc.vram_start));
                WREG32(EVERGREEN_GRPH_SECONDARY_SURFACE_ADDRESS_HIGH + EVERGREEN_CRTC4_REGISTER_OFFSET,
@@ -1101,31 +1114,41 @@ void evergreen_mc_resume(struct radeon_device *rdev, struct evergreen_mc_save *s
        /* Restore video state */
        WREG32(D1VGA_CONTROL, save->vga_control[0]);
        WREG32(D2VGA_CONTROL, save->vga_control[1]);
-       WREG32(EVERGREEN_D3VGA_CONTROL, save->vga_control[2]);
-       WREG32(EVERGREEN_D4VGA_CONTROL, save->vga_control[3]);
-       WREG32(EVERGREEN_D5VGA_CONTROL, save->vga_control[4]);
-       WREG32(EVERGREEN_D6VGA_CONTROL, save->vga_control[5]);
+       if (rdev->num_crtc >= 4) {
+               WREG32(EVERGREEN_D3VGA_CONTROL, save->vga_control[2]);
+               WREG32(EVERGREEN_D4VGA_CONTROL, save->vga_control[3]);
+       }
+       if (rdev->num_crtc >= 6) {
+               WREG32(EVERGREEN_D5VGA_CONTROL, save->vga_control[4]);
+               WREG32(EVERGREEN_D6VGA_CONTROL, save->vga_control[5]);
+       }
        WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC0_REGISTER_OFFSET, 1);
        WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC1_REGISTER_OFFSET, 1);
-       if (!(rdev->flags & RADEON_IS_IGP)) {
+       if (rdev->num_crtc >= 4) {
                WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC2_REGISTER_OFFSET, 1);
                WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC3_REGISTER_OFFSET, 1);
+       }
+       if (rdev->num_crtc >= 6) {
                WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC4_REGISTER_OFFSET, 1);
                WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC5_REGISTER_OFFSET, 1);
        }
        WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET, save->crtc_control[0]);
        WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET, save->crtc_control[1]);
-       if (!(rdev->flags & RADEON_IS_IGP)) {
+       if (rdev->num_crtc >= 4) {
                WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET, save->crtc_control[2]);
                WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET, save->crtc_control[3]);
+       }
+       if (rdev->num_crtc >= 6) {
                WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET, save->crtc_control[4]);
                WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET, save->crtc_control[5]);
        }
        WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC0_REGISTER_OFFSET, 0);
        WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC1_REGISTER_OFFSET, 0);
-       if (!(rdev->flags & RADEON_IS_IGP)) {
+       if (rdev->num_crtc >= 4) {
                WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC2_REGISTER_OFFSET, 0);
                WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC3_REGISTER_OFFSET, 0);
+       }
+       if (rdev->num_crtc >= 6) {
                WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC4_REGISTER_OFFSET, 0);
                WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC5_REGISTER_OFFSET, 0);
        }
@@ -2417,18 +2440,22 @@ void evergreen_disable_interrupt_state(struct radeon_device *rdev)
        WREG32(GRBM_INT_CNTL, 0);
        WREG32(INT_MASK + EVERGREEN_CRTC0_REGISTER_OFFSET, 0);
        WREG32(INT_MASK + EVERGREEN_CRTC1_REGISTER_OFFSET, 0);
-       if (!(rdev->flags & RADEON_IS_IGP)) {
+       if (rdev->num_crtc >= 4) {
                WREG32(INT_MASK + EVERGREEN_CRTC2_REGISTER_OFFSET, 0);
                WREG32(INT_MASK + EVERGREEN_CRTC3_REGISTER_OFFSET, 0);
+       }
+       if (rdev->num_crtc >= 6) {
                WREG32(INT_MASK + EVERGREEN_CRTC4_REGISTER_OFFSET, 0);
                WREG32(INT_MASK + EVERGREEN_CRTC5_REGISTER_OFFSET, 0);
        }
 
        WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET, 0);
        WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET, 0);
-       if (!(rdev->flags & RADEON_IS_IGP)) {
+       if (rdev->num_crtc >= 4) {
                WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET, 0);
                WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET, 0);
+       }
+       if (rdev->num_crtc >= 6) {
                WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET, 0);
                WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET, 0);
        }
@@ -2547,19 +2574,25 @@ int evergreen_irq_set(struct radeon_device *rdev)
 
        WREG32(INT_MASK + EVERGREEN_CRTC0_REGISTER_OFFSET, crtc1);
        WREG32(INT_MASK + EVERGREEN_CRTC1_REGISTER_OFFSET, crtc2);
-       if (!(rdev->flags & RADEON_IS_IGP)) {
+       if (rdev->num_crtc >= 4) {
                WREG32(INT_MASK + EVERGREEN_CRTC2_REGISTER_OFFSET, crtc3);
                WREG32(INT_MASK + EVERGREEN_CRTC3_REGISTER_OFFSET, crtc4);
+       }
+       if (rdev->num_crtc >= 6) {
                WREG32(INT_MASK + EVERGREEN_CRTC4_REGISTER_OFFSET, crtc5);
                WREG32(INT_MASK + EVERGREEN_CRTC5_REGISTER_OFFSET, crtc6);
        }
 
        WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET, grph1);
        WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET, grph2);
-       WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET, grph3);
-       WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET, grph4);
-       WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET, grph5);
-       WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET, grph6);
+       if (rdev->num_crtc >= 4) {
+               WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET, grph3);
+               WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET, grph4);
+       }
+       if (rdev->num_crtc >= 6) {
+               WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET, grph5);
+               WREG32(GRPH_INT_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET, grph6);
+       }
 
        WREG32(DC_HPD1_INT_CONTROL, hpd1);
        WREG32(DC_HPD2_INT_CONTROL, hpd2);
@@ -2583,53 +2616,57 @@ static inline void evergreen_irq_ack(struct radeon_device *rdev)
        rdev->irq.stat_regs.evergreen.disp_int_cont5 = RREG32(DISP_INTERRUPT_STATUS_CONTINUE5);
        rdev->irq.stat_regs.evergreen.d1grph_int = RREG32(GRPH_INT_STATUS + EVERGREEN_CRTC0_REGISTER_OFFSET);
        rdev->irq.stat_regs.evergreen.d2grph_int = RREG32(GRPH_INT_STATUS + EVERGREEN_CRTC1_REGISTER_OFFSET);
-       rdev->irq.stat_regs.evergreen.d3grph_int = RREG32(GRPH_INT_STATUS + EVERGREEN_CRTC2_REGISTER_OFFSET);
-       rdev->irq.stat_regs.evergreen.d4grph_int = RREG32(GRPH_INT_STATUS + EVERGREEN_CRTC3_REGISTER_OFFSET);
-       rdev->irq.stat_regs.evergreen.d5grph_int = RREG32(GRPH_INT_STATUS + EVERGREEN_CRTC4_REGISTER_OFFSET);
-       rdev->irq.stat_regs.evergreen.d6grph_int = RREG32(GRPH_INT_STATUS + EVERGREEN_CRTC5_REGISTER_OFFSET);
+       if (rdev->num_crtc >= 4) {
+               rdev->irq.stat_regs.evergreen.d3grph_int = RREG32(GRPH_INT_STATUS + EVERGREEN_CRTC2_REGISTER_OFFSET);
+               rdev->irq.stat_regs.evergreen.d4grph_int = RREG32(GRPH_INT_STATUS + EVERGREEN_CRTC3_REGISTER_OFFSET);
+       }
+       if (rdev->num_crtc >= 6) {
+               rdev->irq.stat_regs.evergreen.d5grph_int = RREG32(GRPH_INT_STATUS + EVERGREEN_CRTC4_REGISTER_OFFSET);
+               rdev->irq.stat_regs.evergreen.d6grph_int = RREG32(GRPH_INT_STATUS + EVERGREEN_CRTC5_REGISTER_OFFSET);
+       }
 
        if (rdev->irq.stat_regs.evergreen.d1grph_int & GRPH_PFLIP_INT_OCCURRED)
                WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC0_REGISTER_OFFSET, GRPH_PFLIP_INT_CLEAR);
        if (rdev->irq.stat_regs.evergreen.d2grph_int & GRPH_PFLIP_INT_OCCURRED)
                WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC1_REGISTER_OFFSET, GRPH_PFLIP_INT_CLEAR);
-       if (rdev->irq.stat_regs.evergreen.d3grph_int & GRPH_PFLIP_INT_OCCURRED)
-               WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC2_REGISTER_OFFSET, GRPH_PFLIP_INT_CLEAR);
-       if (rdev->irq.stat_regs.evergreen.d4grph_int & GRPH_PFLIP_INT_OCCURRED)
-               WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC3_REGISTER_OFFSET, GRPH_PFLIP_INT_CLEAR);
-       if (rdev->irq.stat_regs.evergreen.d5grph_int & GRPH_PFLIP_INT_OCCURRED)
-               WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC4_REGISTER_OFFSET, GRPH_PFLIP_INT_CLEAR);
-       if (rdev->irq.stat_regs.evergreen.d6grph_int & GRPH_PFLIP_INT_OCCURRED)
-               WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC5_REGISTER_OFFSET, GRPH_PFLIP_INT_CLEAR);
-
        if (rdev->irq.stat_regs.evergreen.disp_int & LB_D1_VBLANK_INTERRUPT)
                WREG32(VBLANK_STATUS + EVERGREEN_CRTC0_REGISTER_OFFSET, VBLANK_ACK);
        if (rdev->irq.stat_regs.evergreen.disp_int & LB_D1_VLINE_INTERRUPT)
                WREG32(VLINE_STATUS + EVERGREEN_CRTC0_REGISTER_OFFSET, VLINE_ACK);
-
        if (rdev->irq.stat_regs.evergreen.disp_int_cont & LB_D2_VBLANK_INTERRUPT)
                WREG32(VBLANK_STATUS + EVERGREEN_CRTC1_REGISTER_OFFSET, VBLANK_ACK);
        if (rdev->irq.stat_regs.evergreen.disp_int_cont & LB_D2_VLINE_INTERRUPT)
                WREG32(VLINE_STATUS + EVERGREEN_CRTC1_REGISTER_OFFSET, VLINE_ACK);
 
-       if (rdev->irq.stat_regs.evergreen.disp_int_cont2 & LB_D3_VBLANK_INTERRUPT)
-               WREG32(VBLANK_STATUS + EVERGREEN_CRTC2_REGISTER_OFFSET, VBLANK_ACK);
-       if (rdev->irq.stat_regs.evergreen.disp_int_cont2 & LB_D3_VLINE_INTERRUPT)
-               WREG32(VLINE_STATUS + EVERGREEN_CRTC2_REGISTER_OFFSET, VLINE_ACK);
-
-       if (rdev->irq.stat_regs.evergreen.disp_int_cont3 & LB_D4_VBLANK_INTERRUPT)
-               WREG32(VBLANK_STATUS + EVERGREEN_CRTC3_REGISTER_OFFSET, VBLANK_ACK);
-       if (rdev->irq.stat_regs.evergreen.disp_int_cont3 & LB_D4_VLINE_INTERRUPT)
-               WREG32(VLINE_STATUS + EVERGREEN_CRTC3_REGISTER_OFFSET, VLINE_ACK);
-
-       if (rdev->irq.stat_regs.evergreen.disp_int_cont4 & LB_D5_VBLANK_INTERRUPT)
-               WREG32(VBLANK_STATUS + EVERGREEN_CRTC4_REGISTER_OFFSET, VBLANK_ACK);
-       if (rdev->irq.stat_regs.evergreen.disp_int_cont4 & LB_D5_VLINE_INTERRUPT)
-               WREG32(VLINE_STATUS + EVERGREEN_CRTC4_REGISTER_OFFSET, VLINE_ACK);
-
-       if (rdev->irq.stat_regs.evergreen.disp_int_cont5 & LB_D6_VBLANK_INTERRUPT)
-               WREG32(VBLANK_STATUS + EVERGREEN_CRTC5_REGISTER_OFFSET, VBLANK_ACK);
-       if (rdev->irq.stat_regs.evergreen.disp_int_cont5 & LB_D6_VLINE_INTERRUPT)
-               WREG32(VLINE_STATUS + EVERGREEN_CRTC5_REGISTER_OFFSET, VLINE_ACK);
+       if (rdev->num_crtc >= 4) {
+               if (rdev->irq.stat_regs.evergreen.d3grph_int & GRPH_PFLIP_INT_OCCURRED)
+                       WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC2_REGISTER_OFFSET, GRPH_PFLIP_INT_CLEAR);
+               if (rdev->irq.stat_regs.evergreen.d4grph_int & GRPH_PFLIP_INT_OCCURRED)
+                       WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC3_REGISTER_OFFSET, GRPH_PFLIP_INT_CLEAR);
+               if (rdev->irq.stat_regs.evergreen.disp_int_cont2 & LB_D3_VBLANK_INTERRUPT)
+                       WREG32(VBLANK_STATUS + EVERGREEN_CRTC2_REGISTER_OFFSET, VBLANK_ACK);
+               if (rdev->irq.stat_regs.evergreen.disp_int_cont2 & LB_D3_VLINE_INTERRUPT)
+                       WREG32(VLINE_STATUS + EVERGREEN_CRTC2_REGISTER_OFFSET, VLINE_ACK);
+               if (rdev->irq.stat_regs.evergreen.disp_int_cont3 & LB_D4_VBLANK_INTERRUPT)
+                       WREG32(VBLANK_STATUS + EVERGREEN_CRTC3_REGISTER_OFFSET, VBLANK_ACK);
+               if (rdev->irq.stat_regs.evergreen.disp_int_cont3 & LB_D4_VLINE_INTERRUPT)
+                       WREG32(VLINE_STATUS + EVERGREEN_CRTC3_REGISTER_OFFSET, VLINE_ACK);
+       }
+
+       if (rdev->num_crtc >= 6) {
+               if (rdev->irq.stat_regs.evergreen.d5grph_int & GRPH_PFLIP_INT_OCCURRED)
+                       WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC4_REGISTER_OFFSET, GRPH_PFLIP_INT_CLEAR);
+               if (rdev->irq.stat_regs.evergreen.d6grph_int & GRPH_PFLIP_INT_OCCURRED)
+                       WREG32(GRPH_INT_STATUS + EVERGREEN_CRTC5_REGISTER_OFFSET, GRPH_PFLIP_INT_CLEAR);
+               if (rdev->irq.stat_regs.evergreen.disp_int_cont4 & LB_D5_VBLANK_INTERRUPT)
+                       WREG32(VBLANK_STATUS + EVERGREEN_CRTC4_REGISTER_OFFSET, VBLANK_ACK);
+               if (rdev->irq.stat_regs.evergreen.disp_int_cont4 & LB_D5_VLINE_INTERRUPT)
+                       WREG32(VLINE_STATUS + EVERGREEN_CRTC4_REGISTER_OFFSET, VLINE_ACK);
+               if (rdev->irq.stat_regs.evergreen.disp_int_cont5 & LB_D6_VBLANK_INTERRUPT)
+                       WREG32(VBLANK_STATUS + EVERGREEN_CRTC5_REGISTER_OFFSET, VBLANK_ACK);
+               if (rdev->irq.stat_regs.evergreen.disp_int_cont5 & LB_D6_VLINE_INTERRUPT)
+                       WREG32(VLINE_STATUS + EVERGREEN_CRTC5_REGISTER_OFFSET, VLINE_ACK);
+       }
 
        if (rdev->irq.stat_regs.evergreen.disp_int & DC_HPD1_INTERRUPT) {
                tmp = RREG32(DC_HPD1_INT_CONTROL);
@@ -3237,6 +3274,7 @@ void evergreen_fini(struct radeon_device *rdev)
        r700_cp_fini(rdev);
        r600_irq_fini(rdev);
        radeon_wb_fini(rdev);
+       radeon_ib_pool_fini(rdev);
        radeon_irq_kms_fini(rdev);
        evergreen_pcie_gart_fini(rdev);
        radeon_gem_fini(rdev);
index 1636e34498252c3550e17a6515aa6097974bbf7f..b7b2714f0b327d379aa21d2a478b463e067f1bce 100644 (file)
 #define IH_RB_WPTR_ADDR_LO                                0x3e14
 #define IH_CNTL                                           0x3e18
 #       define ENABLE_INTR                                (1 << 0)
-#       define IH_MC_SWAP(x)                              ((x) << 2)
+#       define IH_MC_SWAP(x)                              ((x) << 1)
 #       define IH_MC_SWAP_NONE                            0
 #       define IH_MC_SWAP_16BIT                           1
 #       define IH_MC_SWAP_32BIT                           2
 #       define LB_D5_VBLANK_INTERRUPT                   (1 << 3)
 #       define DC_HPD5_INTERRUPT                        (1 << 17)
 #       define DC_HPD5_RX_INTERRUPT                     (1 << 18)
-#define DISP_INTERRUPT_STATUS_CONTINUE5                 0x6050
+#define DISP_INTERRUPT_STATUS_CONTINUE5                 0x6150
 #       define LB_D6_VLINE_INTERRUPT                    (1 << 2)
 #       define LB_D6_VBLANK_INTERRUPT                   (1 << 3)
 #       define DC_HPD6_INTERRUPT                        (1 << 17)
index 16caafeadf5e5603208a3055b2344355106d5a05..559dbd412906096f762f3d41cacecdf4e0810794 100644 (file)
@@ -1581,6 +1581,7 @@ void cayman_fini(struct radeon_device *rdev)
        cayman_cp_fini(rdev);
        r600_irq_fini(rdev);
        radeon_wb_fini(rdev);
+       radeon_ib_pool_fini(rdev);
        radeon_irq_kms_fini(rdev);
        cayman_pcie_gart_fini(rdev);
        radeon_gem_fini(rdev);
index f79d2ccb675553c73204c14bd46183f05fd4567b..bc54b26cb32f75be52d31daff0e4f4effe40784c 100644 (file)
@@ -2628,6 +2628,7 @@ void r600_fini(struct radeon_device *rdev)
        r600_cp_fini(rdev);
        r600_irq_fini(rdev);
        radeon_wb_fini(rdev);
+       radeon_ib_pool_fini(rdev);
        radeon_irq_kms_fini(rdev);
        r600_pcie_gart_fini(rdev);
        radeon_agp_fini(rdev);
index f140a0d5cb543c0281c8e8a85f62df873fa51809..0245ae6c204ec60a739dd2200eff1d858e9a38da 100644 (file)
 #define IH_RB_WPTR_ADDR_LO                                0x3e14
 #define IH_CNTL                                           0x3e18
 #       define ENABLE_INTR                                (1 << 0)
-#       define IH_MC_SWAP(x)                              ((x) << 2)
+#       define IH_MC_SWAP(x)                              ((x) << 1)
 #       define IH_MC_SWAP_NONE                            0
 #       define IH_MC_SWAP_16BIT                           1
 #       define IH_MC_SWAP_32BIT                           2
index 8bb347d23ca6bb3c757fb00a820a448e3be34457..4de51891aa6d911abd16502b1b7bb7aabc7cbe17 100644 (file)
@@ -1368,6 +1368,7 @@ void rv770_fini(struct radeon_device *rdev)
        r700_cp_fini(rdev);
        r600_irq_fini(rdev);
        radeon_wb_fini(rdev);
+       radeon_ib_pool_fini(rdev);
        radeon_irq_kms_fini(rdev);
        rv770_pcie_gart_fini(rdev);
        rv770_vram_scratch_fini(rdev);
index 1a6dfb6df1e7ff121ce4903ab80f1b2e57ba2ef1..d3b464b74ced3b743969e2f0377523b0883243f2 100644 (file)
@@ -98,11 +98,16 @@ struct lm95241_data {
 };
 
 /* Conversions */
-static int TempFromReg(u8 val_h, u8 val_l)
+static int temp_from_reg_signed(u8 val_h, u8 val_l)
 {
-       if (val_h & 0x80)
-               return val_h - 0x100;
-       return val_h * 1000 + val_l * 1000 / 256;
+       s16 val_hl = (val_h << 8) | val_l;
+       return val_hl * 1000 / 256;
+}
+
+static int temp_from_reg_unsigned(u8 val_h, u8 val_l)
+{
+       u16 val_hl = (val_h << 8) | val_l;
+       return val_hl * 1000 / 256;
 }
 
 static struct lm95241_data *lm95241_update_device(struct device *dev)
@@ -135,10 +140,13 @@ static ssize_t show_input(struct device *dev, struct device_attribute *attr,
                          char *buf)
 {
        struct lm95241_data *data = lm95241_update_device(dev);
+       int index = to_sensor_dev_attr(attr)->index;
 
        return snprintf(buf, PAGE_SIZE - 1, "%d\n",
-               TempFromReg(data->temp[to_sensor_dev_attr(attr)->index],
-                           data->temp[to_sensor_dev_attr(attr)->index + 1]));
+                       index == 0 || (data->config & (1 << (index / 2))) ?
+               temp_from_reg_signed(data->temp[index], data->temp[index + 1]) :
+               temp_from_reg_unsigned(data->temp[index],
+                                      data->temp[index + 1]));
 }
 
 static ssize_t show_type(struct device *dev, struct device_attribute *attr,
@@ -339,7 +347,7 @@ static int lm95241_detect(struct i2c_client *new_client,
        if ((i2c_smbus_read_byte_data(new_client, LM95241_REG_R_MAN_ID)
             == MANUFACTURER_ID)
            && (i2c_smbus_read_byte_data(new_client, LM95241_REG_R_CHIP_ID)
-               >= DEFAULT_REVISION)) {
+               == DEFAULT_REVISION)) {
                name = DEVNAME;
        } else {
                dev_dbg(&adapter->dev, "LM95241 detection failed at 0x%02x\n",
index 931d940923aebb77c5b7d1d9bc029977c029dd14..9b1f0c37ef77bb22d0c14bcf43e891b7e7a6eb4f 100644 (file)
@@ -59,16 +59,17 @@ static void pmbus_find_sensor_groups(struct i2c_client *client,
                if (pmbus_check_byte_register(client, 0, PMBUS_STATUS_FAN_34))
                        info->func[0] |= PMBUS_HAVE_STATUS_FAN34;
        }
-       if (pmbus_check_word_register(client, 0, PMBUS_READ_TEMPERATURE_1)) {
+       if (pmbus_check_word_register(client, 0, PMBUS_READ_TEMPERATURE_1))
                info->func[0] |= PMBUS_HAVE_TEMP;
-               if (pmbus_check_byte_register(client, 0,
-                                             PMBUS_STATUS_TEMPERATURE))
-                       info->func[0] |= PMBUS_HAVE_STATUS_TEMP;
-       }
        if (pmbus_check_word_register(client, 0, PMBUS_READ_TEMPERATURE_2))
                info->func[0] |= PMBUS_HAVE_TEMP2;
        if (pmbus_check_word_register(client, 0, PMBUS_READ_TEMPERATURE_3))
                info->func[0] |= PMBUS_HAVE_TEMP3;
+       if (info->func[0] & (PMBUS_HAVE_TEMP | PMBUS_HAVE_TEMP2
+                            | PMBUS_HAVE_TEMP3)
+           && pmbus_check_byte_register(client, 0,
+                                        PMBUS_STATUS_TEMPERATURE))
+                       info->func[0] |= PMBUS_HAVE_STATUS_TEMP;
 
        /* Sensors detected on all pages */
        for (page = 0; page < info->pages; page++) {
index 52b545a795f2ae6e533bf0920385623e8e6e1b04..cbc98aea5b098872cee1c181f24c25c676f62f2e 100644 (file)
@@ -193,7 +193,13 @@ static void bfin_twi_handle_interrupt(struct bfin_twi_iface *iface,
                return;
        }
        if (twi_int_status & MCOMP) {
-               if (iface->cur_mode == TWI_I2C_MODE_COMBINED) {
+               if ((read_MASTER_CTL(iface) & MEN) == 0 &&
+                       (iface->cur_mode == TWI_I2C_MODE_REPEAT ||
+                       iface->cur_mode == TWI_I2C_MODE_COMBINED)) {
+                       iface->result = -1;
+                       write_INT_MASK(iface, 0);
+                       write_MASTER_CTL(iface, 0);
+               } else if (iface->cur_mode == TWI_I2C_MODE_COMBINED) {
                        if (iface->readNum == 0) {
                                /* set the read number to 1 and ask for manual
                                 * stop in block combine mode
index 6c00c107ebf30af4360bd3fef78fac03b62a4683..f84a63c6dd9708e329d1571feefde07d56f0de97 100644 (file)
@@ -248,12 +248,12 @@ static inline int is_msgend(struct s3c24xx_i2c *i2c)
        return i2c->msg_ptr >= i2c->msg->len;
 }
 
-/* i2s_s3c_irq_nextbyte
+/* i2c_s3c_irq_nextbyte
  *
  * process an interrupt and work out what to do
  */
 
-static int i2s_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat)
+static int i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat)
 {
        unsigned long tmp;
        unsigned char byte;
@@ -264,7 +264,6 @@ static int i2s_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat)
        case STATE_IDLE:
                dev_err(i2c->dev, "%s: called in STATE_IDLE\n", __func__);
                goto out;
-               break;
 
        case STATE_STOP:
                dev_err(i2c->dev, "%s: called in STATE_STOP\n", __func__);
@@ -444,7 +443,7 @@ static irqreturn_t s3c24xx_i2c_irq(int irqno, void *dev_id)
        /* pretty much this leaves us with the fact that we've
         * transmitted or received whatever byte we last sent */
 
-       i2s_s3c_irq_nextbyte(i2c, status);
+       i2c_s3c_irq_nextbyte(i2c, status);
 
  out:
        return IRQ_HANDLED;
index 4d9319665e328176993886494516e208181c38aa..fb3b4f8f8152f41879ab736ee2c758332f1facb8 100644 (file)
 #define I2C_CNFG_NEW_MASTER_FSM                        (1<<11)
 #define I2C_STATUS                             0x01C
 #define I2C_SL_CNFG                            0x020
+#define I2C_SL_CNFG_NACK                       (1<<1)
 #define I2C_SL_CNFG_NEWSL                      (1<<2)
 #define I2C_SL_ADDR1                           0x02c
+#define I2C_SL_ADDR2                           0x030
 #define I2C_TX_FIFO                            0x050
 #define I2C_RX_FIFO                            0x054
 #define I2C_PACKET_TRANSFER_STATUS             0x058
@@ -337,7 +339,11 @@ static int tegra_i2c_init(struct tegra_i2c_dev *i2c_dev)
 
        if (!i2c_dev->is_dvc) {
                u32 sl_cfg = i2c_readl(i2c_dev, I2C_SL_CNFG);
-               i2c_writel(i2c_dev, sl_cfg | I2C_SL_CNFG_NEWSL, I2C_SL_CNFG);
+               sl_cfg |= I2C_SL_CNFG_NACK | I2C_SL_CNFG_NEWSL;
+               i2c_writel(i2c_dev, sl_cfg, I2C_SL_CNFG);
+               i2c_writel(i2c_dev, 0xfc, I2C_SL_ADDR1);
+               i2c_writel(i2c_dev, 0x00, I2C_SL_ADDR2);
+
        }
 
        val = 7 << I2C_FIFO_CONTROL_TX_TRIG_SHIFT |
index 40b02ae96f864b0ff2014300cf8b3b2d94afe1d0..6229c3e8e78b807c90ab1a8f549e8b250601679e 100644 (file)
@@ -520,7 +520,8 @@ static void pmic8xxx_kp_close(struct input_dev *dev)
  */
 static int __devinit pmic8xxx_kp_probe(struct platform_device *pdev)
 {
-       const struct pm8xxx_keypad_platform_data *pdata = mfd_get_data(pdev);
+       const struct pm8xxx_keypad_platform_data *pdata =
+                                       dev_get_platdata(&pdev->dev);
        const struct matrix_keymap_data *keymap_data;
        struct pmic8xxx_kp *kp;
        int rc;
index 97e07e786e41023da526b3ec7a25e617379759c2..b3cfb9c71e664244f85bb77427e13ca01a932d20 100644 (file)
@@ -90,7 +90,8 @@ static int __devinit pmic8xxx_pwrkey_probe(struct platform_device *pdev)
        unsigned int delay;
        u8 pon_cntl;
        struct pmic8xxx_pwrkey *pwrkey;
-       const struct pm8xxx_pwrkey_platform_data *pdata = mfd_get_data(pdev);
+       const struct pm8xxx_pwrkey_platform_data *pdata =
+                                       dev_get_platdata(&pdev->dev);
 
        if (!pdata) {
                dev_err(&pdev->dev, "power key platform data not supplied\n");
index d8d3a1e910a1bbb7f81e9c1d7c4cb58452415691..a2c874623e3521550ab6917be4b56eb3e42b4aaa 100644 (file)
@@ -88,7 +88,7 @@ static const struct pca9532_chip_info pca9532_chip_info_tbl[] = {
 
 static struct i2c_driver pca9532_driver = {
        .driver = {
-               .name = "pca953x",
+               .name = "leds-pca953x",
        },
        .probe = pca9532_probe,
        .remove = pca9532_remove,
index 8fa539dde1b4be8547ecee3247add51bb2957a19..7f7079b12f2321ab2174a764dca2959e0c0a6952 100644 (file)
@@ -597,12 +597,17 @@ static void __devexit fintek_remove(struct pnp_dev *pdev)
 static int fintek_suspend(struct pnp_dev *pdev, pm_message_t state)
 {
        struct fintek_dev *fintek = pnp_get_drvdata(pdev);
+       unsigned long flags;
 
        fit_dbg("%s called", __func__);
 
+       spin_lock_irqsave(&fintek->fintek_lock, flags);
+
        /* disable all CIR interrupts */
        fintek_cir_reg_write(fintek, CIR_STATUS_IRQ_MASK, CIR_STATUS);
 
+       spin_unlock_irqrestore(&fintek->fintek_lock, flags);
+
        fintek_config_mode_enable(fintek);
 
        /* disable cir logical dev */
index 3f3c70716268d2e40faf343a0d1320791a265924..6bc35eeb653bf0cbc3ff8a82766481e862d9b198 100644 (file)
@@ -307,6 +307,14 @@ static const struct {
        /* 0xffdc iMON MCE VFD */
        { 0x00010000ffffffeell, KEY_VOLUMEUP },
        { 0x01000000ffffffeell, KEY_VOLUMEDOWN },
+       { 0x00000001ffffffeell, KEY_MUTE },
+       { 0x0000000fffffffeell, KEY_MEDIA },
+       { 0x00000012ffffffeell, KEY_UP },
+       { 0x00000013ffffffeell, KEY_DOWN },
+       { 0x00000014ffffffeell, KEY_LEFT },
+       { 0x00000015ffffffeell, KEY_RIGHT },
+       { 0x00000016ffffffeell, KEY_ENTER },
+       { 0x00000017ffffffeell, KEY_ESC },
        /* iMON Knob values */
        { 0x000100ffffffffeell, KEY_VOLUMEUP },
        { 0x010000ffffffffeell, KEY_VOLUMEDOWN },
@@ -1582,16 +1590,16 @@ static void imon_incoming_packet(struct imon_context *ictx,
        /* Only panel type events left to process now */
        spin_lock_irqsave(&ictx->kc_lock, flags);
 
+       do_gettimeofday(&t);
        /* KEY_MUTE repeats from knob need to be suppressed */
        if (ictx->kc == KEY_MUTE && ictx->kc == ictx->last_keycode) {
-               do_gettimeofday(&t);
                msec = tv2int(&t, &prev_time);
-               prev_time = t;
                if (msec < ictx->idev->rep[REP_DELAY]) {
                        spin_unlock_irqrestore(&ictx->kc_lock, flags);
                        return;
                }
        }
+       prev_time = t;
        kc = ictx->kc;
 
        spin_unlock_irqrestore(&ictx->kc_lock, flags);
@@ -1603,7 +1611,9 @@ static void imon_incoming_packet(struct imon_context *ictx,
        input_report_key(ictx->idev, kc, 0);
        input_sync(ictx->idev);
 
+       spin_lock_irqsave(&ictx->kc_lock, flags);
        ictx->last_keycode = kc;
+       spin_unlock_irqrestore(&ictx->kc_lock, flags);
 
        return;
 
@@ -1740,6 +1750,8 @@ static void imon_get_ffdc_type(struct imon_context *ictx)
                detected_display_type = IMON_DISPLAY_TYPE_VFD;
                break;
        /* iMON VFD, MCE IR */
+       case 0x46:
+       case 0x7e:
        case 0x9e:
                dev_info(ictx->dev, "0xffdc iMON VFD, MCE IR");
                detected_display_type = IMON_DISPLAY_TYPE_VFD;
@@ -1755,6 +1767,9 @@ static void imon_get_ffdc_type(struct imon_context *ictx)
                dev_info(ictx->dev, "Unknown 0xffdc device, "
                         "defaulting to VFD and iMON IR");
                detected_display_type = IMON_DISPLAY_TYPE_VFD;
+               /* We don't know which one it is, allow user to set the
+                * RC6 one from userspace if OTHER wasn't correct. */
+               allowed_protos |= RC_TYPE_RC6;
                break;
        }
 
index 11c19d8d0ee0a7edad7aeb3ea241130585a6d381..423ed45d6c55a4e3ccb43f3ae1284bcf55d952da 100644 (file)
@@ -114,18 +114,20 @@ int ir_raw_event_store_edge(struct rc_dev *dev, enum raw_event_type type)
        s64                     delta; /* ns */
        DEFINE_IR_RAW_EVENT(ev);
        int                     rc = 0;
+       int                     delay;
 
        if (!dev->raw)
                return -EINVAL;
 
        now = ktime_get();
        delta = ktime_to_ns(ktime_sub(now, dev->raw->last_event));
+       delay = MS_TO_NS(dev->input_dev->rep[REP_DELAY]);
 
        /* Check for a long duration since last event or if we're
         * being called for the first time, note that delta can't
         * possibly be negative.
         */
-       if (delta > IR_MAX_DURATION || !dev->raw->last_type)
+       if (delta > delay || !dev->raw->last_type)
                type |= IR_START_EVENT;
        else
                ev.duration = delta;
index e716b931cf7e69d52228dc258ae644bde14f09a3..ecd3d028076852b3ee8da36794bbac1c58a59157 100644 (file)
@@ -1347,6 +1347,7 @@ static const struct ite_dev_params ite_dev_descs[] = {
        {       /* 0: ITE8704 */
               .model = "ITE8704 CIR transceiver",
               .io_region_size = IT87_IOREG_LENGTH,
+              .io_rsrc_no = 0,
               .hw_tx_capable = true,
               .sample_period = (u32) (1000000000ULL / 115200),
               .tx_carrier_freq = 38000,
@@ -1371,6 +1372,7 @@ static const struct ite_dev_params ite_dev_descs[] = {
        {       /* 1: ITE8713 */
               .model = "ITE8713 CIR transceiver",
               .io_region_size = IT87_IOREG_LENGTH,
+              .io_rsrc_no = 0,
               .hw_tx_capable = true,
               .sample_period = (u32) (1000000000ULL / 115200),
               .tx_carrier_freq = 38000,
@@ -1395,6 +1397,7 @@ static const struct ite_dev_params ite_dev_descs[] = {
        {       /* 2: ITE8708 */
               .model = "ITE8708 CIR transceiver",
               .io_region_size = IT8708_IOREG_LENGTH,
+              .io_rsrc_no = 0,
               .hw_tx_capable = true,
               .sample_period = (u32) (1000000000ULL / 115200),
               .tx_carrier_freq = 38000,
@@ -1420,6 +1423,7 @@ static const struct ite_dev_params ite_dev_descs[] = {
        {       /* 3: ITE8709 */
               .model = "ITE8709 CIR transceiver",
               .io_region_size = IT8709_IOREG_LENGTH,
+              .io_rsrc_no = 2,
               .hw_tx_capable = true,
               .sample_period = (u32) (1000000000ULL / 115200),
               .tx_carrier_freq = 38000,
@@ -1461,6 +1465,7 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id
        struct rc_dev *rdev = NULL;
        int ret = -ENOMEM;
        int model_no;
+       int io_rsrc_no;
 
        ite_dbg("%s called", __func__);
 
@@ -1490,10 +1495,11 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id
 
        /* get the description for the device */
        dev_desc = &ite_dev_descs[model_no];
+       io_rsrc_no = dev_desc->io_rsrc_no;
 
        /* validate pnp resources */
-       if (!pnp_port_valid(pdev, 0) ||
-           pnp_port_len(pdev, 0) != dev_desc->io_region_size) {
+       if (!pnp_port_valid(pdev, io_rsrc_no) ||
+           pnp_port_len(pdev, io_rsrc_no) != dev_desc->io_region_size) {
                dev_err(&pdev->dev, "IR PNP Port not valid!\n");
                goto failure;
        }
@@ -1504,7 +1510,7 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id
        }
 
        /* store resource values */
-       itdev->cir_addr = pnp_port_start(pdev, 0);
+       itdev->cir_addr = pnp_port_start(pdev, io_rsrc_no);
        itdev->cir_irq = pnp_irq(pdev, 0);
 
        /* initialize spinlocks */
index 16a19f5fd71890e95a9cbf230d0e18947101284a..aa899a0b9750770da5ee1a4b8a079d8f6d21bc4a 100644 (file)
@@ -57,6 +57,9 @@ struct ite_dev_params {
        /* size of the I/O region */
        int io_region_size;
 
+       /* IR pnp I/O resource number */
+       int io_rsrc_no;
+
        /* true if the hardware supports transmission */
        bool hw_tx_capable;
 
index bb10ffe086b415ad252948d4d4c761ce236adaba..8d558ae63456488da72ba9982c7aae6739a3dd48 100644 (file)
 /* Pinnacle PCTV HD 800i mini remote */
 
 static struct rc_map_table pinnacle_pctv_hd[] = {
-
-       { 0x0f, KEY_1 },
-       { 0x15, KEY_2 },
-       { 0x10, KEY_3 },
-       { 0x18, KEY_4 },
-       { 0x1b, KEY_5 },
-       { 0x1e, KEY_6 },
-       { 0x11, KEY_7 },
-       { 0x21, KEY_8 },
-       { 0x12, KEY_9 },
-       { 0x27, KEY_0 },
-
-       { 0x24, KEY_ZOOM },
-       { 0x2a, KEY_SUBTITLE },
-
-       { 0x00, KEY_MUTE },
-       { 0x01, KEY_ENTER },    /* Pinnacle Logo */
-       { 0x39, KEY_POWER },
-
-       { 0x03, KEY_VOLUMEUP },
-       { 0x09, KEY_VOLUMEDOWN },
-       { 0x06, KEY_CHANNELUP },
-       { 0x0c, KEY_CHANNELDOWN },
-
-       { 0x2d, KEY_REWIND },
-       { 0x30, KEY_PLAYPAUSE },
-       { 0x33, KEY_FASTFORWARD },
-       { 0x3c, KEY_STOP },
-       { 0x36, KEY_RECORD },
-       { 0x3f, KEY_EPG },      /* Labeled "?" */
+       /* Key codes for the tiny Pinnacle remote*/
+       { 0x0700, KEY_MUTE },
+       { 0x0701, KEY_MENU }, /* Pinnacle logo */
+       { 0x0739, KEY_POWER },
+       { 0x0703, KEY_VOLUMEUP },
+       { 0x0709, KEY_VOLUMEDOWN },
+       { 0x0706, KEY_CHANNELUP },
+       { 0x070c, KEY_CHANNELDOWN },
+       { 0x070f, KEY_1 },
+       { 0x0715, KEY_2 },
+       { 0x0710, KEY_3 },
+       { 0x0718, KEY_4 },
+       { 0x071b, KEY_5 },
+       { 0x071e, KEY_6 },
+       { 0x0711, KEY_7 },
+       { 0x0721, KEY_8 },
+       { 0x0712, KEY_9 },
+       { 0x0727, KEY_0 },
+       { 0x0724, KEY_ZOOM }, /* 'Square' key */
+       { 0x072a, KEY_SUBTITLE },   /* 'T' key */
+       { 0x072d, KEY_REWIND },
+       { 0x0730, KEY_PLAYPAUSE },
+       { 0x0733, KEY_FASTFORWARD },
+       { 0x0736, KEY_RECORD },
+       { 0x073c, KEY_STOP },
+       { 0x073f, KEY_HELP }, /* '?' key */
 };
 
 static struct rc_map_list pinnacle_pctv_hd_map = {
        .map = {
                .scan    = pinnacle_pctv_hd,
                .size    = ARRAY_SIZE(pinnacle_pctv_hd),
-               .rc_type = RC_TYPE_UNKNOWN,     /* Legacy IR type */
+               .rc_type = RC_TYPE_RC5,
                .name    = RC_MAP_PINNACLE_PCTV_HD,
        }
 };
index fd237ab120bbbd8a3a753b379f3edddb41079f61..27997a9ceb0d4552944bbbb6605bfc711ad9d9ea 100644 (file)
@@ -55,6 +55,8 @@ struct irctl {
        struct lirc_buffer *buf;
        unsigned int chunk_size;
 
+       struct cdev *cdev;
+
        struct task_struct *task;
        long jiffies_to_wait;
 };
@@ -62,7 +64,6 @@ struct irctl {
 static DEFINE_MUTEX(lirc_dev_lock);
 
 static struct irctl *irctls[MAX_IRCTL_DEVICES];
-static struct cdev cdevs[MAX_IRCTL_DEVICES];
 
 /* Only used for sysfs but defined to void otherwise */
 static struct class *lirc_class;
@@ -167,9 +168,13 @@ static struct file_operations lirc_dev_fops = {
 
 static int lirc_cdev_add(struct irctl *ir)
 {
-       int retval;
+       int retval = -ENOMEM;
        struct lirc_driver *d = &ir->d;
-       struct cdev *cdev = &cdevs[d->minor];
+       struct cdev *cdev;
+
+       cdev = kzalloc(sizeof(*cdev), GFP_KERNEL);
+       if (!cdev)
+               goto err_out;
 
        if (d->fops) {
                cdev_init(cdev, d->fops);
@@ -180,12 +185,20 @@ static int lirc_cdev_add(struct irctl *ir)
        }
        retval = kobject_set_name(&cdev->kobj, "lirc%d", d->minor);
        if (retval)
-               return retval;
+               goto err_out;
 
        retval = cdev_add(cdev, MKDEV(MAJOR(lirc_base_dev), d->minor), 1);
-       if (retval)
+       if (retval) {
                kobject_put(&cdev->kobj);
+               goto err_out;
+       }
+
+       ir->cdev = cdev;
+
+       return 0;
 
+err_out:
+       kfree(cdev);
        return retval;
 }
 
@@ -214,7 +227,7 @@ int lirc_register_driver(struct lirc_driver *d)
        if (MAX_IRCTL_DEVICES <= d->minor) {
                dev_err(d->dev, "lirc_dev: lirc_register_driver: "
                        "\"minor\" must be between 0 and %d (%d)!\n",
-                       MAX_IRCTL_DEVICES-1, d->minor);
+                       MAX_IRCTL_DEVICES - 1, d->minor);
                err = -EBADRQC;
                goto out;
        }
@@ -369,7 +382,7 @@ int lirc_unregister_driver(int minor)
 
        if (minor < 0 || minor >= MAX_IRCTL_DEVICES) {
                printk(KERN_ERR "lirc_dev: %s: minor (%d) must be between "
-                      "0 and %d!\n", __func__, minor, MAX_IRCTL_DEVICES-1);
+                      "0 and %d!\n", __func__, minor, MAX_IRCTL_DEVICES - 1);
                return -EBADRQC;
        }
 
@@ -380,7 +393,7 @@ int lirc_unregister_driver(int minor)
                return -ENOENT;
        }
 
-       cdev = &cdevs[minor];
+       cdev = ir->cdev;
 
        mutex_lock(&lirc_dev_lock);
 
@@ -410,6 +423,7 @@ int lirc_unregister_driver(int minor)
        } else {
                lirc_irctl_cleanup(ir);
                cdev_del(cdev);
+               kfree(cdev);
                kfree(ir);
                irctls[minor] = NULL;
        }
@@ -453,7 +467,7 @@ int lirc_dev_fop_open(struct inode *inode, struct file *file)
                goto error;
        }
 
-       cdev = &cdevs[iminor(inode)];
+       cdev = ir->cdev;
        if (try_module_get(cdev->owner)) {
                ir->open++;
                retval = ir->d.set_use_inc(ir->d.data);
@@ -484,13 +498,15 @@ EXPORT_SYMBOL(lirc_dev_fop_open);
 int lirc_dev_fop_close(struct inode *inode, struct file *file)
 {
        struct irctl *ir = irctls[iminor(inode)];
-       struct cdev *cdev = &cdevs[iminor(inode)];
+       struct cdev *cdev;
 
        if (!ir) {
                printk(KERN_ERR "%s: called with invalid irctl\n", __func__);
                return -EINVAL;
        }
 
+       cdev = ir->cdev;
+
        dev_dbg(ir->d.dev, LOGHEAD "close called\n", ir->d.name, ir->d.minor);
 
        WARN_ON(mutex_lock_killable(&lirc_dev_lock));
@@ -503,6 +519,7 @@ int lirc_dev_fop_close(struct inode *inode, struct file *file)
                lirc_irctl_cleanup(ir);
                cdev_del(cdev);
                irctls[ir->d.minor] = NULL;
+               kfree(cdev);
                kfree(ir);
        }
 
index ad927fcaa0203e3128346b8911fc962c5008c420..06dfe0957b5e1d26ae2d7f61c1c7154e8a47f24e 100644 (file)
@@ -108,6 +108,12 @@ static int debug = 1;
 static int debug;
 #endif
 
+#define mce_dbg(dev, fmt, ...)                                 \
+       do {                                                    \
+               if (debug)                                      \
+                       dev_info(dev, fmt, ## __VA_ARGS__);     \
+       } while (0)
+
 /* general constants */
 #define SEND_FLAG_IN_PROGRESS  1
 #define SEND_FLAG_COMPLETE     2
@@ -246,6 +252,9 @@ static struct usb_device_id mceusb_dev_table[] = {
          .driver_info = MCE_GEN2_TX_INV },
        /* SMK eHome Infrared Transceiver */
        { USB_DEVICE(VENDOR_SMK, 0x0338) },
+       /* SMK/I-O Data GV-MC7/RCKIT Receiver */
+       { USB_DEVICE(VENDOR_SMK, 0x0353),
+         .driver_info = MCE_GEN2_NO_TX },
        /* Tatung eHome Infrared Transceiver */
        { USB_DEVICE(VENDOR_TATUNG, 0x9150) },
        /* Shuttle eHome Infrared Transceiver */
@@ -606,12 +615,15 @@ static void mce_async_callback(struct urb *urb, struct pt_regs *regs)
        if (ir) {
                len = urb->actual_length;
 
-               dev_dbg(ir->dev, "callback called (status=%d len=%d)\n",
+               mce_dbg(ir->dev, "callback called (status=%d len=%d)\n",
                        urb->status, len);
 
                mceusb_dev_printdata(ir, urb->transfer_buffer, 0, len, true);
        }
 
+       /* the transfer buffer and urb were allocated in mce_request_packet */
+       kfree(urb->transfer_buffer);
+       usb_free_urb(urb);
 }
 
 /* request incoming or send outgoing usb packet - used to initialize remote */
@@ -655,17 +667,17 @@ static void mce_request_packet(struct mceusb_dev *ir, unsigned char *data,
                return;
        }
 
-       dev_dbg(dev, "receive request called (size=%#x)\n", size);
+       mce_dbg(dev, "receive request called (size=%#x)\n", size);
 
        async_urb->transfer_buffer_length = size;
        async_urb->dev = ir->usbdev;
 
        res = usb_submit_urb(async_urb, GFP_ATOMIC);
        if (res) {
-               dev_dbg(dev, "receive request FAILED! (res=%d)\n", res);
+               mce_dbg(dev, "receive request FAILED! (res=%d)\n", res);
                return;
        }
-       dev_dbg(dev, "receive request complete (res=%d)\n", res);
+       mce_dbg(dev, "receive request complete (res=%d)\n", res);
 }
 
 static void mce_async_out(struct mceusb_dev *ir, unsigned char *data, int size)
@@ -673,9 +685,9 @@ static void mce_async_out(struct mceusb_dev *ir, unsigned char *data, int size)
        mce_request_packet(ir, data, size, MCEUSB_TX);
 }
 
-static void mce_sync_in(struct mceusb_dev *ir, unsigned char *data, int size)
+static void mce_flush_rx_buffer(struct mceusb_dev *ir, int size)
 {
-       mce_request_packet(ir, data, size, MCEUSB_RX);
+       mce_request_packet(ir, NULL, size, MCEUSB_RX);
 }
 
 /* Send data out the IR blaster port(s) */
@@ -794,7 +806,7 @@ static int mceusb_set_tx_carrier(struct rc_dev *dev, u32 carrier)
                        ir->carrier = carrier;
                        cmdbuf[2] = MCE_CMD_SIG_END;
                        cmdbuf[3] = MCE_IRDATA_TRAILER;
-                       dev_dbg(ir->dev, "%s: disabling carrier "
+                       mce_dbg(ir->dev, "%s: disabling carrier "
                                "modulation\n", __func__);
                        mce_async_out(ir, cmdbuf, sizeof(cmdbuf));
                        return carrier;
@@ -806,7 +818,7 @@ static int mceusb_set_tx_carrier(struct rc_dev *dev, u32 carrier)
                                ir->carrier = carrier;
                                cmdbuf[2] = prescaler;
                                cmdbuf[3] = divisor;
-                               dev_dbg(ir->dev, "%s: requesting %u HZ "
+                               mce_dbg(ir->dev, "%s: requesting %u HZ "
                                        "carrier\n", __func__, carrier);
 
                                /* Transmit new carrier to mce device */
@@ -879,7 +891,7 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len)
                        rawir.duration = (ir->buf_in[i] & MCE_PULSE_MASK)
                                         * US_TO_NS(MCE_TIME_UNIT);
 
-                       dev_dbg(ir->dev, "Storing %s with duration %d\n",
+                       mce_dbg(ir->dev, "Storing %s with duration %d\n",
                                rawir.pulse ? "pulse" : "space",
                                rawir.duration);
 
@@ -911,7 +923,7 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len)
                if (ir->parser_state != CMD_HEADER && !ir->rem)
                        ir->parser_state = CMD_HEADER;
        }
-       dev_dbg(ir->dev, "processed IR data, calling ir_raw_event_handle\n");
+       mce_dbg(ir->dev, "processed IR data, calling ir_raw_event_handle\n");
        ir_raw_event_handle(ir->rc);
 }
 
@@ -933,7 +945,7 @@ static void mceusb_dev_recv(struct urb *urb, struct pt_regs *regs)
 
        if (ir->send_flags == RECV_FLAG_IN_PROGRESS) {
                ir->send_flags = SEND_FLAG_COMPLETE;
-               dev_dbg(ir->dev, "setup answer received %d bytes\n",
+               mce_dbg(ir->dev, "setup answer received %d bytes\n",
                        buf_len);
        }
 
@@ -951,7 +963,7 @@ static void mceusb_dev_recv(struct urb *urb, struct pt_regs *regs)
 
        case -EPIPE:
        default:
-               dev_dbg(ir->dev, "Error: urb status = %d\n", urb->status);
+               mce_dbg(ir->dev, "Error: urb status = %d\n", urb->status);
                break;
        }
 
@@ -961,7 +973,6 @@ static void mceusb_dev_recv(struct urb *urb, struct pt_regs *regs)
 static void mceusb_gen1_init(struct mceusb_dev *ir)
 {
        int ret;
-       int maxp = ir->len_in;
        struct device *dev = ir->dev;
        char *data;
 
@@ -978,8 +989,8 @@ static void mceusb_gen1_init(struct mceusb_dev *ir)
        ret = usb_control_msg(ir->usbdev, usb_rcvctrlpipe(ir->usbdev, 0),
                              USB_REQ_SET_ADDRESS, USB_TYPE_VENDOR, 0, 0,
                              data, USB_CTRL_MSG_SZ, HZ * 3);
-       dev_dbg(dev, "%s - ret = %d\n", __func__, ret);
-       dev_dbg(dev, "%s - data[0] = %d, data[1] = %d\n",
+       mce_dbg(dev, "%s - ret = %d\n", __func__, ret);
+       mce_dbg(dev, "%s - data[0] = %d, data[1] = %d\n",
                __func__, data[0], data[1]);
 
        /* set feature: bit rate 38400 bps */
@@ -987,71 +998,56 @@ static void mceusb_gen1_init(struct mceusb_dev *ir)
                              USB_REQ_SET_FEATURE, USB_TYPE_VENDOR,
                              0xc04e, 0x0000, NULL, 0, HZ * 3);
 
-       dev_dbg(dev, "%s - ret = %d\n", __func__, ret);
+       mce_dbg(dev, "%s - ret = %d\n", __func__, ret);
 
        /* bRequest 4: set char length to 8 bits */
        ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0),
                              4, USB_TYPE_VENDOR,
                              0x0808, 0x0000, NULL, 0, HZ * 3);
-       dev_dbg(dev, "%s - retB = %d\n", __func__, ret);
+       mce_dbg(dev, "%s - retB = %d\n", __func__, ret);
 
        /* bRequest 2: set handshaking to use DTR/DSR */
        ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0),
                              2, USB_TYPE_VENDOR,
                              0x0000, 0x0100, NULL, 0, HZ * 3);
-       dev_dbg(dev, "%s - retC = %d\n", __func__, ret);
+       mce_dbg(dev, "%s - retC = %d\n", __func__, ret);
 
        /* device reset */
        mce_async_out(ir, DEVICE_RESET, sizeof(DEVICE_RESET));
-       mce_sync_in(ir, NULL, maxp);
 
        /* get hw/sw revision? */
        mce_async_out(ir, GET_REVISION, sizeof(GET_REVISION));
-       mce_sync_in(ir, NULL, maxp);
 
        kfree(data);
 };
 
 static void mceusb_gen2_init(struct mceusb_dev *ir)
 {
-       int maxp = ir->len_in;
-
        /* device reset */
        mce_async_out(ir, DEVICE_RESET, sizeof(DEVICE_RESET));
-       mce_sync_in(ir, NULL, maxp);
 
        /* get hw/sw revision? */
        mce_async_out(ir, GET_REVISION, sizeof(GET_REVISION));
-       mce_sync_in(ir, NULL, maxp);
 
        /* unknown what the next two actually return... */
        mce_async_out(ir, GET_UNKNOWN, sizeof(GET_UNKNOWN));
-       mce_sync_in(ir, NULL, maxp);
        mce_async_out(ir, GET_UNKNOWN2, sizeof(GET_UNKNOWN2));
-       mce_sync_in(ir, NULL, maxp);
 }
 
 static void mceusb_get_parameters(struct mceusb_dev *ir)
 {
-       int maxp = ir->len_in;
-
        /* get the carrier and frequency */
        mce_async_out(ir, GET_CARRIER_FREQ, sizeof(GET_CARRIER_FREQ));
-       mce_sync_in(ir, NULL, maxp);
 
-       if (!ir->flags.no_tx) {
+       if (!ir->flags.no_tx)
                /* get the transmitter bitmask */
                mce_async_out(ir, GET_TX_BITMASK, sizeof(GET_TX_BITMASK));
-               mce_sync_in(ir, NULL, maxp);
-       }
 
        /* get receiver timeout value */
        mce_async_out(ir, GET_RX_TIMEOUT, sizeof(GET_RX_TIMEOUT));
-       mce_sync_in(ir, NULL, maxp);
 
        /* get receiver sensor setting */
        mce_async_out(ir, GET_RX_SENSOR, sizeof(GET_RX_SENSOR));
-       mce_sync_in(ir, NULL, maxp);
 }
 
 static struct rc_dev *mceusb_init_rc_dev(struct mceusb_dev *ir)
@@ -1122,7 +1118,7 @@ static int __devinit mceusb_dev_probe(struct usb_interface *intf,
        bool tx_mask_normal;
        int ir_intfnum;
 
-       dev_dbg(&intf->dev, "%s called\n", __func__);
+       mce_dbg(&intf->dev, "%s called\n", __func__);
 
        idesc  = intf->cur_altsetting;
 
@@ -1150,7 +1146,7 @@ static int __devinit mceusb_dev_probe(struct usb_interface *intf,
                        ep_in = ep;
                        ep_in->bmAttributes = USB_ENDPOINT_XFER_INT;
                        ep_in->bInterval = 1;
-                       dev_dbg(&intf->dev, "acceptable inbound endpoint "
+                       mce_dbg(&intf->dev, "acceptable inbound endpoint "
                                "found\n");
                }
 
@@ -1165,12 +1161,12 @@ static int __devinit mceusb_dev_probe(struct usb_interface *intf,
                        ep_out = ep;
                        ep_out->bmAttributes = USB_ENDPOINT_XFER_INT;
                        ep_out->bInterval = 1;
-                       dev_dbg(&intf->dev, "acceptable outbound endpoint "
+                       mce_dbg(&intf->dev, "acceptable outbound endpoint "
                                "found\n");
                }
        }
        if (ep_in == NULL) {
-               dev_dbg(&intf->dev, "inbound and/or endpoint not found\n");
+               mce_dbg(&intf->dev, "inbound and/or endpoint not found\n");
                return -ENODEV;
        }
 
@@ -1215,16 +1211,16 @@ static int __devinit mceusb_dev_probe(struct usb_interface *intf,
        if (!ir->rc)
                goto rc_dev_fail;
 
-       /* flush buffers on the device */
-       mce_sync_in(ir, NULL, maxp);
-       mce_sync_in(ir, NULL, maxp);
-
        /* wire up inbound data handler */
        usb_fill_int_urb(ir->urb_in, dev, pipe, ir->buf_in,
                maxp, (usb_complete_t) mceusb_dev_recv, ir, ep_in->bInterval);
        ir->urb_in->transfer_dma = ir->dma_in;
        ir->urb_in->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
 
+       /* flush buffers on the device */
+       mce_dbg(&intf->dev, "Flushing receive buffers\n");
+       mce_flush_rx_buffer(ir, maxp);
+
        /* initialize device */
        if (ir->flags.microsoft_gen1)
                mceusb_gen1_init(ir);
index bf3060ea610782a42d596b3848629b905100a8df..565f24c20d77ddad0f4a02f6e0aa2867d377503f 100644 (file)
@@ -991,7 +991,6 @@ static int nvt_open(struct rc_dev *dev)
        unsigned long flags;
 
        spin_lock_irqsave(&nvt->nvt_lock, flags);
-       nvt->in_use = true;
        nvt_enable_cir(nvt);
        spin_unlock_irqrestore(&nvt->nvt_lock, flags);
 
@@ -1004,7 +1003,6 @@ static void nvt_close(struct rc_dev *dev)
        unsigned long flags;
 
        spin_lock_irqsave(&nvt->nvt_lock, flags);
-       nvt->in_use = false;
        nvt_disable_cir(nvt);
        spin_unlock_irqrestore(&nvt->nvt_lock, flags);
 }
index 379795d61ea7684f4eac4dc08ddb23b7ab4d9459..1241fc89a36c10c02dfa56ed5e351c89f28ac4e7 100644 (file)
@@ -70,7 +70,6 @@ struct nvt_dev {
        struct ir_raw_event rawir;
 
        spinlock_t nvt_lock;
-       bool in_use;
 
        /* for rx */
        u8 buf[RX_BUF_LEN];
index f57cd5677ac27c4bee3ebbbbfda25997585d6f1b..3186ac7c2c108c00d4346076d4bc20fc0d765df2 100644 (file)
@@ -522,18 +522,20 @@ EXPORT_SYMBOL_GPL(rc_g_keycode_from_table);
 /**
  * ir_do_keyup() - internal function to signal the release of a keypress
  * @dev:       the struct rc_dev descriptor of the device
+ * @sync:      whether or not to call input_sync
  *
  * This function is used internally to release a keypress, it must be
  * called with keylock held.
  */
-static void ir_do_keyup(struct rc_dev *dev)
+static void ir_do_keyup(struct rc_dev *dev, bool sync)
 {
        if (!dev->keypressed)
                return;
 
        IR_dprintk(1, "keyup key 0x%04x\n", dev->last_keycode);
        input_report_key(dev->input_dev, dev->last_keycode, 0);
-       input_sync(dev->input_dev);
+       if (sync)
+               input_sync(dev->input_dev);
        dev->keypressed = false;
 }
 
@@ -549,7 +551,7 @@ void rc_keyup(struct rc_dev *dev)
        unsigned long flags;
 
        spin_lock_irqsave(&dev->keylock, flags);
-       ir_do_keyup(dev);
+       ir_do_keyup(dev, true);
        spin_unlock_irqrestore(&dev->keylock, flags);
 }
 EXPORT_SYMBOL_GPL(rc_keyup);
@@ -578,7 +580,7 @@ static void ir_timer_keyup(unsigned long cookie)
         */
        spin_lock_irqsave(&dev->keylock, flags);
        if (time_is_before_eq_jiffies(dev->keyup_jiffies))
-               ir_do_keyup(dev);
+               ir_do_keyup(dev, true);
        spin_unlock_irqrestore(&dev->keylock, flags);
 }
 
@@ -597,6 +599,7 @@ void rc_repeat(struct rc_dev *dev)
        spin_lock_irqsave(&dev->keylock, flags);
 
        input_event(dev->input_dev, EV_MSC, MSC_SCAN, dev->last_scancode);
+       input_sync(dev->input_dev);
 
        if (!dev->keypressed)
                goto out;
@@ -622,29 +625,28 @@ EXPORT_SYMBOL_GPL(rc_repeat);
 static void ir_do_keydown(struct rc_dev *dev, int scancode,
                          u32 keycode, u8 toggle)
 {
-       input_event(dev->input_dev, EV_MSC, MSC_SCAN, scancode);
-
-       /* Repeat event? */
-       if (dev->keypressed &&
-           dev->last_scancode == scancode &&
-           dev->last_toggle == toggle)
-               return;
+       bool new_event = !dev->keypressed ||
+                        dev->last_scancode != scancode ||
+                        dev->last_toggle != toggle;
 
-       /* Release old keypress */
-       ir_do_keyup(dev);
+       if (new_event && dev->keypressed)
+               ir_do_keyup(dev, false);
 
-       dev->last_scancode = scancode;
-       dev->last_toggle = toggle;
-       dev->last_keycode = keycode;
+       input_event(dev->input_dev, EV_MSC, MSC_SCAN, scancode);
 
-       if (keycode == KEY_RESERVED)
-               return;
+       if (new_event && keycode != KEY_RESERVED) {
+               /* Register a keypress */
+               dev->keypressed = true;
+               dev->last_scancode = scancode;
+               dev->last_toggle = toggle;
+               dev->last_keycode = keycode;
+
+               IR_dprintk(1, "%s: key down event, "
+                          "key 0x%04x, scancode 0x%04x\n",
+                          dev->input_name, keycode, scancode);
+               input_report_key(dev->input_dev, keycode, 1);
+       }
 
-       /* Register a keypress */
-       dev->keypressed = true;
-       IR_dprintk(1, "%s: key down event, key 0x%04x, scancode 0x%04x\n",
-                  dev->input_name, keycode, scancode);
-       input_report_key(dev->input_dev, dev->last_keycode, 1);
        input_sync(dev->input_dev);
 }
 
index a97cf2750bd99a3c41d071707dd16a3c285b1183..834a48394bce1bc4546f2754c24553a54119d862 100644 (file)
@@ -3474,7 +3474,7 @@ static int radio_s_tuner(struct file *file, void *priv,
        if (0 != t->index)
                return -EINVAL;
 
-       bttv_call_all(btv, tuner, g_tuner, t);
+       bttv_call_all(btv, tuner, s_tuner, t);
        return 0;
 }
 
index 1933d4d11bf20ac526adcfc8a1714b28560bcad6..e80134f52ef5c3ba41b00a4d3751d4ba95db3365 100644 (file)
@@ -695,14 +695,10 @@ static int cx18_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)
 
        cx18_call_all(cx, tuner, g_tuner, vt);
 
-       if (test_bit(CX18_F_I_RADIO_USER, &cx->i_flags)) {
+       if (vt->type == V4L2_TUNER_RADIO)
                strlcpy(vt->name, "cx18 Radio Tuner", sizeof(vt->name));
-               vt->type = V4L2_TUNER_RADIO;
-       } else {
+       else
                strlcpy(vt->name, "cx18 TV Tuner", sizeof(vt->name));
-               vt->type = V4L2_TUNER_ANALOG_TV;
-       }
-
        return 0;
 }
 
index f9e347dae7391a4487e15ac17e9e16578f59d16e..120c7d8e0895ea36619e97759b34b0184edd2bf6 100644 (file)
@@ -1184,14 +1184,10 @@ static int ivtv_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)
 
        ivtv_call_all(itv, tuner, g_tuner, vt);
 
-       if (test_bit(IVTV_F_I_RADIO_USER, &itv->i_flags)) {
+       if (vt->type == V4L2_TUNER_RADIO)
                strlcpy(vt->name, "ivtv Radio Tuner", sizeof(vt->name));
-               vt->type = V4L2_TUNER_RADIO;
-       } else {
+       else
                strlcpy(vt->name, "ivtv TV Tuner", sizeof(vt->name));
-               vt->type = V4L2_TUNER_ANALOG_TV;
-       }
-
        return 0;
 }
 
index 10b55c854487e5b9ff3628056eb6032fe30cb1c3..89d09a8914f8ea5099d6031d59b5f9117c214b78 100644 (file)
@@ -2,10 +2,10 @@
  * Header for M-5MOLS 8M Pixel camera sensor with ISP
  *
  * Copyright (C) 2011 Samsung Electronics Co., Ltd.
- * Author: HeungJun Kim, riverful.kim@samsung.com
+ * Author: HeungJun Kim <riverful.kim@samsung.com>
  *
  * Copyright (C) 2009 Samsung Electronics Co., Ltd.
- * Author: Dongsoo Nathaniel Kim, dongsoo45.kim@samsung.com
+ * Author: Dongsoo Nathaniel Kim <dongsoo45.kim@samsung.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -106,23 +106,23 @@ struct m5mols_capture {
  * The each value according to each scenemode is recommended in the documents.
  */
 struct m5mols_scenemode {
-       u32 metering;
-       u32 ev_bias;
-       u32 wb_mode;
-       u32 wb_preset;
-       u32 chroma_en;
-       u32 chroma_lvl;
-       u32 edge_en;
-       u32 edge_lvl;
-       u32 af_range;
-       u32 fd_mode;
-       u32 mcc;
-       u32 light;
-       u32 flash;
-       u32 tone;
-       u32 iso;
-       u32 capt_mode;
-       u32 wdr;
+       u8 metering;
+       u8 ev_bias;
+       u8 wb_mode;
+       u8 wb_preset;
+       u8 chroma_en;
+       u8 chroma_lvl;
+       u8 edge_en;
+       u8 edge_lvl;
+       u8 af_range;
+       u8 fd_mode;
+       u8 mcc;
+       u8 light;
+       u8 flash;
+       u8 tone;
+       u8 iso;
+       u8 capt_mode;
+       u8 wdr;
 };
 
 /**
@@ -154,7 +154,6 @@ struct m5mols_version {
        u8      str[VERSION_STRING_SIZE];
        u8      af;
 };
-#define VERSION_SIZE sizeof(struct m5mols_version)
 
 /**
  * struct m5mols_info - M-5MOLS driver data structure
@@ -216,9 +215,9 @@ struct m5mols_info {
        bool lock_ae;
        bool lock_awb;
        u8 resolution;
-       u32 interrupt;
-       u32 mode;
-       u32 mode_save;
+       u8 interrupt;
+       u8 mode;
+       u8 mode_save;
        int (*set_power)(struct device *dev, int on);
 };
 
@@ -256,9 +255,11 @@ struct m5mols_info {
  *   +-------+---+----------+-----+------+------+------+------+
  *   - d[0..3]: according to size1
  */
-int m5mols_read(struct v4l2_subdev *sd, u32 reg_comb, u32 *val);
+int m5mols_read_u8(struct v4l2_subdev *sd, u32 reg_comb, u8 *val);
+int m5mols_read_u16(struct v4l2_subdev *sd, u32 reg_comb, u16 *val);
+int m5mols_read_u32(struct v4l2_subdev *sd, u32 reg_comb, u32 *val);
 int m5mols_write(struct v4l2_subdev *sd, u32 reg_comb, u32 val);
-int m5mols_busy(struct v4l2_subdev *sd, u8 category, u8 cmd, u32 value);
+int m5mols_busy(struct v4l2_subdev *sd, u8 category, u8 cmd, u8 value);
 
 /*
  * Mode operation of the M-5MOLS
@@ -280,12 +281,12 @@ int m5mols_busy(struct v4l2_subdev *sd, u8 category, u8 cmd, u32 value);
  * The available executing order between each modes are as follows:
  *   PARAMETER <---> MONITOR <---> CAPTURE
  */
-int m5mols_mode(struct m5mols_info *info, u32 mode);
+int m5mols_mode(struct m5mols_info *info, u8 mode);
 
-int m5mols_enable_interrupt(struct v4l2_subdev *sd, u32 reg);
+int m5mols_enable_interrupt(struct v4l2_subdev *sd, u8 reg);
 int m5mols_sync_controls(struct m5mols_info *info);
 int m5mols_start_capture(struct m5mols_info *info);
-int m5mols_do_scenemode(struct m5mols_info *info, u32 mode);
+int m5mols_do_scenemode(struct m5mols_info *info, u8 mode);
 int m5mols_lock_3a(struct m5mols_info *info, bool lock);
 int m5mols_set_ctrl(struct v4l2_ctrl *ctrl);
 
index d71a3903b60fbd1ec579c5e5a9aa375472a0010e..d9471928369df378adf9c14f5134f0be53563f40 100644 (file)
@@ -2,10 +2,10 @@
  * The Capture code for Fujitsu M-5MOLS ISP
  *
  * Copyright (C) 2011 Samsung Electronics Co., Ltd.
- * Author: HeungJun Kim, riverful.kim@samsung.com
+ * Author: HeungJun Kim <riverful.kim@samsung.com>
  *
  * Copyright (C) 2009 Samsung Electronics Co., Ltd.
- * Author: Dongsoo Nathaniel Kim, dongsoo45.kim@samsung.com
+ * Author: Dongsoo Nathaniel Kim <dongsoo45.kim@samsung.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -58,9 +58,9 @@ static int m5mols_read_rational(struct v4l2_subdev *sd, u32 addr_num,
 {
        u32 num, den;
 
-       int ret = m5mols_read(sd, addr_num, &num);
+       int ret = m5mols_read_u32(sd, addr_num, &num);
        if (!ret)
-               ret = m5mols_read(sd, addr_den, &den);
+               ret = m5mols_read_u32(sd, addr_den, &den);
        if (ret)
                return ret;
        *val = den == 0 ? 0 : num / den;
@@ -99,20 +99,20 @@ static int m5mols_capture_info(struct m5mols_info *info)
        if (ret)
                return ret;
 
-       ret = m5mols_read(sd, EXIF_INFO_ISO, (u32 *)&exif->iso_speed);
+       ret = m5mols_read_u16(sd, EXIF_INFO_ISO, &exif->iso_speed);
        if (!ret)
-               ret = m5mols_read(sd, EXIF_INFO_FLASH, (u32 *)&exif->flash);
+               ret = m5mols_read_u16(sd, EXIF_INFO_FLASH, &exif->flash);
        if (!ret)
-               ret = m5mols_read(sd, EXIF_INFO_SDR, (u32 *)&exif->sdr);
+               ret = m5mols_read_u16(sd, EXIF_INFO_SDR, &exif->sdr);
        if (!ret)
-               ret = m5mols_read(sd, EXIF_INFO_QVAL, (u32 *)&exif->qval);
+               ret = m5mols_read_u16(sd, EXIF_INFO_QVAL, &exif->qval);
        if (ret)
                return ret;
 
        if (!ret)
-               ret = m5mols_read(sd, CAPC_IMAGE_SIZE, &info->cap.main);
+               ret = m5mols_read_u32(sd, CAPC_IMAGE_SIZE, &info->cap.main);
        if (!ret)
-               ret = m5mols_read(sd, CAPC_THUMB_SIZE, &info->cap.thumb);
+               ret = m5mols_read_u32(sd, CAPC_THUMB_SIZE, &info->cap.thumb);
        if (!ret)
                info->cap.total = info->cap.main + info->cap.thumb;
 
@@ -122,7 +122,7 @@ static int m5mols_capture_info(struct m5mols_info *info)
 int m5mols_start_capture(struct m5mols_info *info)
 {
        struct v4l2_subdev *sd = &info->sd;
-       u32 resolution = info->resolution;
+       u8 resolution = info->resolution;
        int timeout;
        int ret;
 
index 817c16fec368c409cd09d8ea8e4f28608b6cc00e..d135d20d09cfb79348cf98c041137d6b90bd0039 100644 (file)
@@ -2,10 +2,10 @@
  * Controls for M-5MOLS 8M Pixel camera sensor with ISP
  *
  * Copyright (C) 2011 Samsung Electronics Co., Ltd.
- * Author: HeungJun Kim, riverful.kim@samsung.com
+ * Author: HeungJun Kim <riverful.kim@samsung.com>
  *
  * Copyright (C) 2009 Samsung Electronics Co., Ltd.
- * Author: Dongsoo Nathaniel Kim, dongsoo45.kim@samsung.com
+ * Author: Dongsoo Nathaniel Kim <dongsoo45.kim@samsung.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -130,7 +130,7 @@ static struct m5mols_scenemode m5mols_default_scenemode[] = {
  *
  * WARNING: The execution order is important. Do not change the order.
  */
-int m5mols_do_scenemode(struct m5mols_info *info, u32 mode)
+int m5mols_do_scenemode(struct m5mols_info *info, u8 mode)
 {
        struct v4l2_subdev *sd = &info->sd;
        struct m5mols_scenemode scenemode = m5mols_default_scenemode[mode];
index 76eac26e84ae6877ee3f8408f28ca79ad35f48dd..43c68f51c5ce07822b58b44de9efe7749e1c3cf9 100644 (file)
@@ -2,10 +2,10 @@
  * Driver for M-5MOLS 8M Pixel camera sensor with ISP
  *
  * Copyright (C) 2011 Samsung Electronics Co., Ltd.
- * Author: HeungJun Kim, riverful.kim@samsung.com
+ * Author: HeungJun Kim <riverful.kim@samsung.com>
  *
  * Copyright (C) 2009 Samsung Electronics Co., Ltd.
- * Author: Dongsoo Nathaniel Kim, dongsoo45.kim@samsung.com
+ * Author: Dongsoo Nathaniel Kim <dongsoo45.kim@samsung.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -133,13 +133,13 @@ static u32 m5mols_swap_byte(u8 *data, u8 length)
 /**
  * m5mols_read -  I2C read function
  * @reg: combination of size, category and command for the I2C packet
+ * @size: desired size of I2C packet
  * @val: read value
  */
-int m5mols_read(struct v4l2_subdev *sd, u32 reg, u32 *val)
+static int m5mols_read(struct v4l2_subdev *sd, u32 size, u32 reg, u32 *val)
 {
        struct i2c_client *client = v4l2_get_subdevdata(sd);
        u8 rbuf[M5MOLS_I2C_MAX_SIZE + 1];
-       u8 size = I2C_SIZE(reg);
        u8 category = I2C_CATEGORY(reg);
        u8 cmd = I2C_COMMAND(reg);
        struct i2c_msg msg[2];
@@ -149,11 +149,6 @@ int m5mols_read(struct v4l2_subdev *sd, u32 reg, u32 *val)
        if (!client->adapter)
                return -ENODEV;
 
-       if (size != 1 && size != 2 && size != 4) {
-               v4l2_err(sd, "Wrong data size\n");
-               return -EINVAL;
-       }
-
        msg[0].addr = client->addr;
        msg[0].flags = 0;
        msg[0].len = 5;
@@ -184,6 +179,52 @@ int m5mols_read(struct v4l2_subdev *sd, u32 reg, u32 *val)
        return 0;
 }
 
+int m5mols_read_u8(struct v4l2_subdev *sd, u32 reg, u8 *val)
+{
+       u32 val_32;
+       int ret;
+
+       if (I2C_SIZE(reg) != 1) {
+               v4l2_err(sd, "Wrong data size\n");
+               return -EINVAL;
+       }
+
+       ret = m5mols_read(sd, I2C_SIZE(reg), reg, &val_32);
+       if (ret)
+               return ret;
+
+       *val = (u8)val_32;
+       return ret;
+}
+
+int m5mols_read_u16(struct v4l2_subdev *sd, u32 reg, u16 *val)
+{
+       u32 val_32;
+       int ret;
+
+       if (I2C_SIZE(reg) != 2) {
+               v4l2_err(sd, "Wrong data size\n");
+               return -EINVAL;
+       }
+
+       ret = m5mols_read(sd, I2C_SIZE(reg), reg, &val_32);
+       if (ret)
+               return ret;
+
+       *val = (u16)val_32;
+       return ret;
+}
+
+int m5mols_read_u32(struct v4l2_subdev *sd, u32 reg, u32 *val)
+{
+       if (I2C_SIZE(reg) != 4) {
+               v4l2_err(sd, "Wrong data size\n");
+               return -EINVAL;
+       }
+
+       return m5mols_read(sd, I2C_SIZE(reg), reg, val);
+}
+
 /**
  * m5mols_write - I2C command write function
  * @reg: combination of size, category and command for the I2C packet
@@ -231,13 +272,14 @@ int m5mols_write(struct v4l2_subdev *sd, u32 reg, u32 val)
        return 0;
 }
 
-int m5mols_busy(struct v4l2_subdev *sd, u8 category, u8 cmd, u32 mask)
+int m5mols_busy(struct v4l2_subdev *sd, u8 category, u8 cmd, u8 mask)
 {
-       u32 busy, i;
+       u8 busy;
+       int i;
        int ret;
 
        for (i = 0; i < M5MOLS_I2C_CHECK_RETRY; i++) {
-               ret = m5mols_read(sd, I2C_REG(category, cmd, 1), &busy);
+               ret = m5mols_read_u8(sd, I2C_REG(category, cmd, 1), &busy);
                if (ret < 0)
                        return ret;
                if ((busy & mask) == mask)
@@ -252,14 +294,14 @@ int m5mols_busy(struct v4l2_subdev *sd, u8 category, u8 cmd, u32 mask)
  * Before writing desired interrupt value the INT_FACTOR register should
  * be read to clear pending interrupts.
  */
-int m5mols_enable_interrupt(struct v4l2_subdev *sd, u32 reg)
+int m5mols_enable_interrupt(struct v4l2_subdev *sd, u8 reg)
 {
        struct m5mols_info *info = to_m5mols(sd);
-       u32 mask = is_available_af(info) ? REG_INT_AF : 0;
-       u32 dummy;
+       u8 mask = is_available_af(info) ? REG_INT_AF : 0;
+       u8 dummy;
        int ret;
 
-       ret = m5mols_read(sd, SYSTEM_INT_FACTOR, &dummy);
+       ret = m5mols_read_u8(sd, SYSTEM_INT_FACTOR, &dummy);
        if (!ret)
                ret = m5mols_write(sd, SYSTEM_INT_ENABLE, reg & ~mask);
        return ret;
@@ -271,7 +313,7 @@ int m5mols_enable_interrupt(struct v4l2_subdev *sd, u32 reg)
  * It always accompanies a little delay changing the M-5MOLS mode, so it is
  * needed checking current busy status to guarantee right mode.
  */
-static int m5mols_reg_mode(struct v4l2_subdev *sd, u32 mode)
+static int m5mols_reg_mode(struct v4l2_subdev *sd, u8 mode)
 {
        int ret = m5mols_write(sd, SYSTEM_SYSMODE, mode);
 
@@ -286,16 +328,16 @@ static int m5mols_reg_mode(struct v4l2_subdev *sd, u32 mode)
  * can be guaranteed only when the sensor is operating in mode which which
  * a command belongs to.
  */
-int m5mols_mode(struct m5mols_info *info, u32 mode)
+int m5mols_mode(struct m5mols_info *info, u8 mode)
 {
        struct v4l2_subdev *sd = &info->sd;
        int ret = -EINVAL;
-       u32 reg;
+       u8 reg;
 
        if (mode < REG_PARAMETER && mode > REG_CAPTURE)
                return ret;
 
-       ret = m5mols_read(sd, SYSTEM_SYSMODE, &reg);
+       ret = m5mols_read_u8(sd, SYSTEM_SYSMODE, &reg);
        if ((!ret && reg == mode) || ret)
                return ret;
 
@@ -344,41 +386,37 @@ int m5mols_mode(struct m5mols_info *info, u32 mode)
 static int m5mols_get_version(struct v4l2_subdev *sd)
 {
        struct m5mols_info *info = to_m5mols(sd);
-       union {
-               struct m5mols_version ver;
-               u8 bytes[VERSION_SIZE];
-       } version;
-       u32 *value;
-       u8 cmd = CAT0_VER_CUSTOMER;
+       struct m5mols_version *ver = &info->ver;
+       u8 *str = ver->str;
+       int i;
        int ret;
 
-       do {
-               value = (u32 *)&version.bytes[cmd];
-               ret = m5mols_read(sd, SYSTEM_CMD(cmd), value);
-               if (ret)
-                       return ret;
-       } while (cmd++ != CAT0_VER_AWB);
+       ret = m5mols_read_u8(sd, SYSTEM_VER_CUSTOMER, &ver->customer);
+       if (!ret)
+               ret = m5mols_read_u8(sd, SYSTEM_VER_PROJECT, &ver->project);
+       if (!ret)
+               ret = m5mols_read_u16(sd, SYSTEM_VER_FIRMWARE, &ver->fw);
+       if (!ret)
+               ret = m5mols_read_u16(sd, SYSTEM_VER_HARDWARE, &ver->hw);
+       if (!ret)
+               ret = m5mols_read_u16(sd, SYSTEM_VER_PARAMETER, &ver->param);
+       if (!ret)
+               ret = m5mols_read_u16(sd, SYSTEM_VER_AWB, &ver->awb);
+       if (!ret)
+               ret = m5mols_read_u8(sd, AF_VERSION, &ver->af);
+       if (ret)
+               return ret;
 
-       do {
-               value = (u32 *)&version.bytes[cmd];
-               ret = m5mols_read(sd, SYSTEM_VER_STRING, value);
+       for (i = 0; i < VERSION_STRING_SIZE; i++) {
+               ret = m5mols_read_u8(sd, SYSTEM_VER_STRING, &str[i]);
                if (ret)
                        return ret;
-               if (cmd >= VERSION_SIZE - 1)
-                       return -EINVAL;
-       } while (version.bytes[cmd++]);
-
-       value = (u32 *)&version.bytes[cmd];
-       ret = m5mols_read(sd, AF_VERSION, value);
-       if (ret)
-               return ret;
+       }
 
-       /* store version information swapped for being readable */
-       info->ver       = version.ver;
-       info->ver.fw    = be16_to_cpu(info->ver.fw);
-       info->ver.hw    = be16_to_cpu(info->ver.hw);
-       info->ver.param = be16_to_cpu(info->ver.param);
-       info->ver.awb   = be16_to_cpu(info->ver.awb);
+       ver->fw = be16_to_cpu(ver->fw);
+       ver->hw = be16_to_cpu(ver->hw);
+       ver->param = be16_to_cpu(ver->param);
+       ver->awb = be16_to_cpu(ver->awb);
 
        v4l2_info(sd, "Manufacturer\t[%s]\n",
                        is_manufacturer(info, REG_SAMSUNG_ELECTRO) ?
@@ -722,7 +760,7 @@ static int m5mols_init_controls(struct m5mols_info *info)
        int ret;
 
        /* Determine value's range & step of controls for various FW version */
-       ret = m5mols_read(sd, AE_MAX_GAIN_MON, (u32 *)&max_exposure);
+       ret = m5mols_read_u16(sd, AE_MAX_GAIN_MON, &max_exposure);
        if (!ret)
                step_zoom = is_manufacturer(info, REG_SAMSUNG_OPTICS) ? 31 : 1;
        if (ret)
@@ -842,18 +880,18 @@ static void m5mols_irq_work(struct work_struct *work)
        struct m5mols_info *info =
                container_of(work, struct m5mols_info, work_irq);
        struct v4l2_subdev *sd = &info->sd;
-       u32 reg;
+       u8 reg;
        int ret;
 
        if (!is_powered(info) ||
-                       m5mols_read(sd, SYSTEM_INT_FACTOR, &info->interrupt))
+                       m5mols_read_u8(sd, SYSTEM_INT_FACTOR, &info->interrupt))
                return;
 
        switch (info->interrupt & REG_INT_MASK) {
        case REG_INT_AF:
                if (!is_available_af(info))
                        break;
-               ret = m5mols_read(sd, AF_STATUS, &reg);
+               ret = m5mols_read_u8(sd, AF_STATUS, &reg);
                v4l2_dbg(2, m5mols_debug, sd, "AF %s\n",
                         reg == REG_AF_FAIL ? "Failed" :
                         reg == REG_AF_SUCCESS ? "Success" :
index b83e36fc6ac658240ea9699fafaa56ee76fa8ca9..c755bd6edfe9b0a485731e641766d39396356ee0 100644 (file)
@@ -2,10 +2,10 @@
  * Register map for M-5MOLS 8M Pixel camera sensor with ISP
  *
  * Copyright (C) 2011 Samsung Electronics Co., Ltd.
- * Author: HeungJun Kim, riverful.kim@samsung.com
+ * Author: HeungJun Kim <riverful.kim@samsung.com>
  *
  * Copyright (C) 2009 Samsung Electronics Co., Ltd.
- * Author: Dongsoo Nathaniel Kim, dongsoo45.kim@samsung.com
+ * Author: Dongsoo Nathaniel Kim <dongsoo45.kim@samsung.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * more specific contents, see definition if file m5mols.h.
  */
 #define CAT0_VER_CUSTOMER      0x00    /* customer version */
-#define CAT0_VER_AWB           0x09    /* Auto WB version */
+#define CAT0_VER_PROJECT       0x01    /* project version */
+#define CAT0_VER_FIRMWARE      0x02    /* Firmware version */
+#define CAT0_VER_HARDWARE      0x04    /* Hardware version */
+#define CAT0_VER_PARAMETER     0x06    /* Parameter version */
+#define CAT0_VER_AWB           0x08    /* Auto WB version */
 #define CAT0_VER_STRING                0x0a    /* string including M-5MOLS */
 #define CAT0_SYSMODE           0x0b    /* SYSTEM mode register */
 #define CAT0_STATUS            0x0c    /* SYSTEM mode status register */
 #define CAT0_INT_FACTOR                0x10    /* interrupt pending register */
 #define CAT0_INT_ENABLE                0x11    /* interrupt enable register */
 
+#define SYSTEM_VER_CUSTOMER    I2C_REG(CAT_SYSTEM, CAT0_VER_CUSTOMER, 1)
+#define SYSTEM_VER_PROJECT     I2C_REG(CAT_SYSTEM, CAT0_VER_PROJECT, 1)
+#define SYSTEM_VER_FIRMWARE    I2C_REG(CAT_SYSTEM, CAT0_VER_FIRMWARE, 2)
+#define SYSTEM_VER_HARDWARE    I2C_REG(CAT_SYSTEM, CAT0_VER_HARDWARE, 2)
+#define SYSTEM_VER_PARAMETER   I2C_REG(CAT_SYSTEM, CAT0_VER_PARAMETER, 2)
+#define SYSTEM_VER_AWB         I2C_REG(CAT_SYSTEM, CAT0_VER_AWB, 2)
+
 #define SYSTEM_SYSMODE         I2C_REG(CAT_SYSTEM, CAT0_SYSMODE, 1)
 #define REG_SYSINIT            0x00    /* SYSTEM mode */
 #define REG_PARAMETER          0x01    /* PARAMETER mode */
 #define REG_CAP_START_MAIN     0x01
 #define REG_CAP_START_THUMB    0x03
 
-#define CAPC_IMAGE_SIZE                I2C_REG(CAT_CAPT_CTRL, CATC_CAP_IMAGE_SIZE, 1)
-#define CAPC_THUMB_SIZE                I2C_REG(CAT_CAPT_CTRL, CATC_CAP_THUMB_SIZE, 1)
+#define CAPC_IMAGE_SIZE                I2C_REG(CAT_CAPT_CTRL, CATC_CAP_IMAGE_SIZE, 4)
+#define CAPC_THUMB_SIZE                I2C_REG(CAT_CAPT_CTRL, CATC_CAP_THUMB_SIZE, 4)
 
 /*
  * Category F - Flash
index de5d481b03287dfe826b202fb62114e91c9fa9a5..c43c81f5f9784ea6b9ac0691753aa7b05fdd39a7 100644 (file)
@@ -480,12 +480,14 @@ static int msp_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
        struct msp_state *state = to_state(sd);
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
-       if (state->radio)
+       if (vt->type != V4L2_TUNER_ANALOG_TV)
                return 0;
-       if (state->opmode == OPMODE_AUTOSELECT)
-               msp_detect_stereo(client);
-       vt->audmode    = state->audmode;
-       vt->rxsubchans = state->rxsubchans;
+       if (!state->radio) {
+               if (state->opmode == OPMODE_AUTOSELECT)
+                       msp_detect_stereo(client);
+               vt->rxsubchans = state->rxsubchans;
+       }
+       vt->audmode = state->audmode;
        vt->capability |= V4L2_TUNER_CAP_STEREO |
                V4L2_TUNER_CAP_LANG1 | V4L2_TUNER_CAP_LANG2;
        return 0;
index bc0c23a1009c2a89b5b40841d2de802c17a62037..63f8a0cc33d89ec167701c1bee1a0614eebed89f 100644 (file)
@@ -444,12 +444,9 @@ static int mx1_camera_add_device(struct soc_camera_device *icd)
 {
        struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
        struct mx1_camera_dev *pcdev = ici->priv;
-       int ret;
 
-       if (pcdev->icd) {
-               ret = -EBUSY;
-               goto ebusy;
-       }
+       if (pcdev->icd)
+               return -EBUSY;
 
        dev_info(icd->dev.parent, "MX1 Camera driver attached to camera %d\n",
                 icd->devnum);
@@ -458,8 +455,7 @@ static int mx1_camera_add_device(struct soc_camera_device *icd)
 
        pcdev->icd = icd;
 
-ebusy:
-       return ret;
+       return 0;
 }
 
 static void mx1_camera_remove_device(struct soc_camera_device *icd)
index 4ada9be1d430d0f50f9f63e866b5ca82e835226a..4d07c58444024c48dd2bb7859d7149da324e6d71 100644 (file)
@@ -982,6 +982,14 @@ static int omap_vout_buffer_setup(struct videobuf_queue *q, unsigned int *count,
        startindex = (vout->vid == OMAP_VIDEO1) ?
                video1_numbuffers : video2_numbuffers;
 
+       /* Check the size of the buffer */
+       if (*size > vout->buffer_size) {
+               v4l2_err(&vout->vid_dev->v4l2_dev,
+                               "buffer allocation mismatch [%u] [%u]\n",
+                               *size, vout->buffer_size);
+               return -ENOMEM;
+       }
+
        for (i = startindex; i < *count; i++) {
                vout->buffer_size = *size;
 
@@ -1228,6 +1236,14 @@ static int omap_vout_mmap(struct file *file, struct vm_area_struct *vma)
                                (vma->vm_pgoff << PAGE_SHIFT));
                return -EINVAL;
        }
+       /* Check the size of the buffer */
+       if (size > vout->buffer_size) {
+               v4l2_err(&vout->vid_dev->v4l2_dev,
+                               "insufficient memory [%lu] [%u]\n",
+                               size, vout->buffer_size);
+               return -ENOMEM;
+       }
+
        q->bufs[i]->baddr = vma->vm_start;
 
        vma->vm_flags |= VM_RESERVED;
@@ -2391,7 +2407,7 @@ static int __init omap_vout_create_video_devices(struct platform_device *pdev)
                /* Register the Video device with V4L2
                 */
                vfd = vout->vfd;
-               if (video_register_device(vfd, VFL_TYPE_GRABBER, k + 1) < 0) {
+               if (video_register_device(vfd, VFL_TYPE_GRABBER, -1) < 0) {
                        dev_err(&pdev->dev, ": Could not register "
                                        "Video for Linux device\n");
                        vfd->minor = -1;
index 2aa6a76c5e593742090843242dfdb578a38d2df2..8ae74817a1105251d07fff196d63c26b8c736de5 100644 (file)
@@ -193,7 +193,7 @@ int omap_vout_new_crop(struct v4l2_pix_format *pix,
                return -EINVAL;
 
        if (cpu_is_omap24xx()) {
-               if (crop->height != win->w.height) {
+               if (try_crop.height != win->w.height) {
                        /* If we're resizing vertically, we can't support a
                         * crop width wider than 768 pixels.
                         */
@@ -202,7 +202,7 @@ int omap_vout_new_crop(struct v4l2_pix_format *pix,
                }
        }
        /* vertical resizing */
-       vresize = (1024 * crop->height) / win->w.height;
+       vresize = (1024 * try_crop.height) / win->w.height;
        if (cpu_is_omap24xx() && (vresize > 2048))
                vresize = 2048;
        else if (cpu_is_omap34xx() && (vresize > 4096))
@@ -221,7 +221,7 @@ int omap_vout_new_crop(struct v4l2_pix_format *pix,
                        try_crop.height = 2;
        }
        /* horizontal resizing */
-       hresize = (1024 * crop->width) / win->w.width;
+       hresize = (1024 * try_crop.width) / win->w.width;
        if (cpu_is_omap24xx() && (hresize > 2048))
                hresize = 2048;
        else if (cpu_is_omap34xx() && (hresize > 4096))
index c9fd04ee70a8ae766811059c6942657334ac7621..94b6ed89e195866e8eb1af83950faea772c7d0c6 100644 (file)
@@ -1748,7 +1748,7 @@ static int isp_register_entities(struct isp_device *isp)
                goto done;
 
        /* Register external entities */
-       for (subdevs = pdata->subdevs; subdevs->subdevs; ++subdevs) {
+       for (subdevs = pdata->subdevs; subdevs && subdevs->subdevs; ++subdevs) {
                struct v4l2_subdev *sensor;
                struct media_entity *input;
                unsigned int flags;
index 9d0dd08f57f8ccc4b360424e4a53ad45883c07a1..e98d38212791034cdac61d11a24dec00ca636297 100644 (file)
@@ -3046,6 +3046,8 @@ static void pvr2_subdev_update(struct pvr2_hdw *hdw)
        if (hdw->input_dirty || hdw->audiomode_dirty || hdw->force_dirty) {
                struct v4l2_tuner vt;
                memset(&vt, 0, sizeof(vt));
+               vt.type = (hdw->input_val == PVR2_CVAL_INPUT_RADIO) ?
+                       V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
                vt.audmode = hdw->audiomode_val;
                v4l2_device_call_all(&hdw->v4l2_dev, 0, tuner, s_tuner, &vt);
        }
@@ -5171,6 +5173,8 @@ void pvr2_hdw_status_poll(struct pvr2_hdw *hdw)
 {
        struct v4l2_tuner *vtp = &hdw->tuner_signal_info;
        memset(vtp, 0, sizeof(*vtp));
+       vtp->type = (hdw->input_val == PVR2_CVAL_INPUT_RADIO) ?
+               V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
        hdw->tuner_signal_stale = 0;
        /* Note: There apparently is no replacement for VIDIOC_CROPCAP
           using v4l2-subdev - therefore we can't support that AT ALL right
index 1593f8deb8105e18bc9fd1d5b09e5c8b8e9f68ea..760b4de13adf6fa852b358ae88a9751f7cd1b597 100644 (file)
@@ -1414,7 +1414,7 @@ long pwc_ioctl(struct pwc_device *pdev, unsigned int cmd, void *arg)
        {
                ARG_DEF(struct pwc_probe, probe)
 
-               strcpy(ARGR(probe).name, pdev->vdev->name);
+               strcpy(ARGR(probe).name, pdev->vdev.name);
                ARGR(probe).type = pdev->type;
                ARG_OUT(probe)
                break;
index 356cd42b593b3f36b72569d24217768c220e6c70..b0bde5a87c8a8b08575973f3158dde40ed546cc2 100644 (file)
@@ -40,7 +40,7 @@
    Oh yes, convention: to disctinguish between all the various pointers to
    device-structures, I use these names for the pointer variables:
    udev: struct usb_device *
-   vdev: struct video_device *
+   vdev: struct video_device (member of pwc_dev)
    pdev: struct pwc_devive *
 */
 
@@ -152,6 +152,7 @@ static ssize_t pwc_video_read(struct file *file, char __user *buf,
                          size_t count, loff_t *ppos);
 static unsigned int pwc_video_poll(struct file *file, poll_table *wait);
 static int  pwc_video_mmap(struct file *file, struct vm_area_struct *vma);
+static void pwc_video_release(struct video_device *vfd);
 
 static const struct v4l2_file_operations pwc_fops = {
        .owner =        THIS_MODULE,
@@ -164,41 +165,11 @@ static const struct v4l2_file_operations pwc_fops = {
 };
 static struct video_device pwc_template = {
        .name =         "Philips Webcam",       /* Filled in later */
-       .release =      video_device_release,
+       .release =      pwc_video_release,
        .fops =         &pwc_fops,
+       .ioctl_ops =    &pwc_ioctl_ops,
 };
 
-/***************************************************************************/
-
-/* Okay, this is some magic that I worked out and the reasoning behind it...
-
-   The biggest problem with any USB device is of course: "what to do
-   when the user unplugs the device while it is in use by an application?"
-   We have several options:
-   1) Curse them with the 7 plagues when they do (requires divine intervention)
-   2) Tell them not to (won't work: they'll do it anyway)
-   3) Oops the kernel (this will have a negative effect on a user's uptime)
-   4) Do something sensible.
-
-   Of course, we go for option 4.
-
-   It happens that this device will be linked to two times, once from
-   usb_device and once from the video_device in their respective 'private'
-   pointers. This is done when the device is probed() and all initialization
-   succeeded. The pwc_device struct links back to both structures.
-
-   When a device is unplugged while in use it will be removed from the
-   list of known USB devices; I also de-register it as a V4L device, but
-   unfortunately I can't free the memory since the struct is still in use
-   by the file descriptor. This free-ing is then deferend until the first
-   opportunity. Crude, but it works.
-
-   A small 'advantage' is that if a user unplugs the cam and plugs it back
-   in, it should get assigned the same video device minor, but unfortunately
-   it's non-trivial to re-link the cam back to the video device... (that
-   would surely be magic! :))
-*/
-
 /***************************************************************************/
 /* Private functions */
 
@@ -1016,16 +987,15 @@ static ssize_t show_snapshot_button_status(struct device *class_dev,
 static DEVICE_ATTR(button, S_IRUGO | S_IWUSR, show_snapshot_button_status,
                   NULL);
 
-static int pwc_create_sysfs_files(struct video_device *vdev)
+static int pwc_create_sysfs_files(struct pwc_device *pdev)
 {
-       struct pwc_device *pdev = video_get_drvdata(vdev);
        int rc;
 
-       rc = device_create_file(&vdev->dev, &dev_attr_button);
+       rc = device_create_file(&pdev->vdev.dev, &dev_attr_button);
        if (rc)
                goto err;
        if (pdev->features & FEATURE_MOTOR_PANTILT) {
-               rc = device_create_file(&vdev->dev, &dev_attr_pan_tilt);
+               rc = device_create_file(&pdev->vdev.dev, &dev_attr_pan_tilt);
                if (rc)
                        goto err_button;
        }
@@ -1033,19 +1003,17 @@ static int pwc_create_sysfs_files(struct video_device *vdev)
        return 0;
 
 err_button:
-       device_remove_file(&vdev->dev, &dev_attr_button);
+       device_remove_file(&pdev->vdev.dev, &dev_attr_button);
 err:
        PWC_ERROR("Could not create sysfs files.\n");
        return rc;
 }
 
-static void pwc_remove_sysfs_files(struct video_device *vdev)
+static void pwc_remove_sysfs_files(struct pwc_device *pdev)
 {
-       struct pwc_device *pdev = video_get_drvdata(vdev);
-
        if (pdev->features & FEATURE_MOTOR_PANTILT)
-               device_remove_file(&vdev->dev, &dev_attr_pan_tilt);
-       device_remove_file(&vdev->dev, &dev_attr_button);
+               device_remove_file(&pdev->vdev.dev, &dev_attr_pan_tilt);
+       device_remove_file(&pdev->vdev.dev, &dev_attr_button);
 }
 
 #ifdef CONFIG_USB_PWC_DEBUG
@@ -1106,7 +1074,7 @@ static int pwc_video_open(struct file *file)
                if (ret >= 0)
                {
                        PWC_DEBUG_OPEN("This %s camera is equipped with a %s (%d).\n",
-                                       pdev->vdev->name,
+                                       pdev->vdev.name,
                                        pwc_sensor_type_to_string(i), i);
                }
        }
@@ -1180,16 +1148,15 @@ static int pwc_video_open(struct file *file)
        return 0;
 }
 
-
-static void pwc_cleanup(struct pwc_device *pdev)
+static void pwc_video_release(struct video_device *vfd)
 {
-       pwc_remove_sysfs_files(pdev->vdev);
-       video_unregister_device(pdev->vdev);
+       struct pwc_device *pdev = container_of(vfd, struct pwc_device, vdev);
+       int hint;
 
-#ifdef CONFIG_USB_PWC_INPUT_EVDEV
-       if (pdev->button_dev)
-               input_unregister_device(pdev->button_dev);
-#endif
+       /* search device_hint[] table if we occupy a slot, by any chance */
+       for (hint = 0; hint < MAX_DEV_HINTS; hint++)
+               if (device_hint[hint].pdev == pdev)
+                       device_hint[hint].pdev = NULL;
 
        kfree(pdev);
 }
@@ -1199,7 +1166,7 @@ static int pwc_video_close(struct file *file)
 {
        struct video_device *vdev = file->private_data;
        struct pwc_device *pdev;
-       int i, hint;
+       int i;
 
        PWC_DEBUG_OPEN(">> video_close called(vdev = 0x%p).\n", vdev);
 
@@ -1234,12 +1201,6 @@ static int pwc_video_close(struct file *file)
                }
                pdev->vopen--;
                PWC_DEBUG_OPEN("<< video_close() vopen=%d\n", pdev->vopen);
-       } else {
-               pwc_cleanup(pdev);
-               /* search device_hint[] table if we occupy a slot, by any chance */
-               for (hint = 0; hint < MAX_DEV_HINTS; hint++)
-                       if (device_hint[hint].pdev == pdev)
-                               device_hint[hint].pdev = NULL;
        }
 
        return 0;
@@ -1715,19 +1676,12 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
        init_waitqueue_head(&pdev->frameq);
        pdev->vcompression = pwc_preferred_compression;
 
-       /* Allocate video_device structure */
-       pdev->vdev = video_device_alloc();
-       if (!pdev->vdev) {
-               PWC_ERROR("Err, cannot allocate video_device struture. Failing probe.");
-               rc = -ENOMEM;
-               goto err_free_mem;
-       }
-       memcpy(pdev->vdev, &pwc_template, sizeof(pwc_template));
-       pdev->vdev->parent = &intf->dev;
-       pdev->vdev->lock = &pdev->modlock;
-       pdev->vdev->ioctl_ops = &pwc_ioctl_ops;
-       strcpy(pdev->vdev->name, name);
-       video_set_drvdata(pdev->vdev, pdev);
+       /* Init video_device structure */
+       memcpy(&pdev->vdev, &pwc_template, sizeof(pwc_template));
+       pdev->vdev.parent = &intf->dev;
+       pdev->vdev.lock = &pdev->modlock;
+       strcpy(pdev->vdev.name, name);
+       video_set_drvdata(&pdev->vdev, pdev);
 
        pdev->release = le16_to_cpu(udev->descriptor.bcdDevice);
        PWC_DEBUG_PROBE("Release: %04x\n", pdev->release);
@@ -1746,8 +1700,6 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
                }
        }
 
-       pdev->vdev->release = video_device_release;
-
        /* occupy slot */
        if (hint < MAX_DEV_HINTS)
                device_hint[hint].pdev = pdev;
@@ -1759,16 +1711,16 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
        pwc_set_leds(pdev, 0, 0);
        pwc_camera_power(pdev, 0);
 
-       rc = video_register_device(pdev->vdev, VFL_TYPE_GRABBER, video_nr);
+       rc = video_register_device(&pdev->vdev, VFL_TYPE_GRABBER, video_nr);
        if (rc < 0) {
                PWC_ERROR("Failed to register as video device (%d).\n", rc);
-               goto err_video_release;
+               goto err_free_mem;
        }
-       rc = pwc_create_sysfs_files(pdev->vdev);
+       rc = pwc_create_sysfs_files(pdev);
        if (rc)
                goto err_video_unreg;
 
-       PWC_INFO("Registered as %s.\n", video_device_node_name(pdev->vdev));
+       PWC_INFO("Registered as %s.\n", video_device_node_name(&pdev->vdev));
 
 #ifdef CONFIG_USB_PWC_INPUT_EVDEV
        /* register webcam snapshot button input device */
@@ -1776,7 +1728,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
        if (!pdev->button_dev) {
                PWC_ERROR("Err, insufficient memory for webcam snapshot button device.");
                rc = -ENOMEM;
-               pwc_remove_sysfs_files(pdev->vdev);
+               pwc_remove_sysfs_files(pdev);
                goto err_video_unreg;
        }
 
@@ -1794,7 +1746,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
        if (rc) {
                input_free_device(pdev->button_dev);
                pdev->button_dev = NULL;
-               pwc_remove_sysfs_files(pdev->vdev);
+               pwc_remove_sysfs_files(pdev);
                goto err_video_unreg;
        }
 #endif
@@ -1804,10 +1756,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
 err_video_unreg:
        if (hint < MAX_DEV_HINTS)
                device_hint[hint].pdev = NULL;
-       video_unregister_device(pdev->vdev);
-       pdev->vdev = NULL;      /* So we don't try to release it below */
-err_video_release:
-       video_device_release(pdev->vdev);
+       video_unregister_device(&pdev->vdev);
 err_free_mem:
        kfree(pdev);
        return rc;
@@ -1816,10 +1765,8 @@ err_free_mem:
 /* The user yanked out the cable... */
 static void usb_pwc_disconnect(struct usb_interface *intf)
 {
-       struct pwc_device *pdev;
-       int hint;
+       struct pwc_device *pdev  = usb_get_intfdata(intf);
 
-       pdev = usb_get_intfdata (intf);
        mutex_lock(&pdev->modlock);
        usb_set_intfdata (intf, NULL);
        if (pdev == NULL) {
@@ -1836,30 +1783,25 @@ static void usb_pwc_disconnect(struct usb_interface *intf)
        }
 
        /* We got unplugged; this is signalled by an EPIPE error code */
-       if (pdev->vopen) {
-               PWC_INFO("Disconnected while webcam is in use!\n");
-               pdev->error_status = EPIPE;
-       }
+       pdev->error_status = EPIPE;
+       pdev->unplugged = 1;
 
        /* Alert waiting processes */
        wake_up_interruptible(&pdev->frameq);
-       /* Wait until device is closed */
-       if (pdev->vopen) {
-               pdev->unplugged = 1;
-               pwc_iso_stop(pdev);
-       } else {
-               /* Device is closed, so we can safely unregister it */
-               PWC_DEBUG_PROBE("Unregistering video device in disconnect().\n");
 
-disconnect_out:
-               /* search device_hint[] table if we occupy a slot, by any chance */
-               for (hint = 0; hint < MAX_DEV_HINTS; hint++)
-                       if (device_hint[hint].pdev == pdev)
-                               device_hint[hint].pdev = NULL;
-       }
+       /* No need to keep the urbs around after disconnection */
+       pwc_isoc_cleanup(pdev);
 
+disconnect_out:
        mutex_unlock(&pdev->modlock);
-       pwc_cleanup(pdev);
+
+       pwc_remove_sysfs_files(pdev);
+       video_unregister_device(&pdev->vdev);
+
+#ifdef CONFIG_USB_PWC_INPUT_EVDEV
+       if (pdev->button_dev)
+               input_unregister_device(pdev->button_dev);
+#endif
 }
 
 
index e947766337d63d9233ed333539705e677f81a742..083f8b15df7337323666f01af18dc9ab5aa183bc 100644 (file)
@@ -162,9 +162,9 @@ struct pwc_imgbuf
 
 struct pwc_device
 {
-   struct video_device *vdev;
+       struct video_device vdev;
 
-   /* Pointer to our usb_device */
+   /* Pointer to our usb_device, may be NULL after unplug */
    struct usb_device *udev;
 
    int type;                    /* type of cam (645, 646, 675, 680, 690, 720, 730, 740, 750) */
index d142b40ea64efd1135dbfc242b5fd7d4c7092697..81b4a826ee5e3338d25910d52e498c0cd0779a1f 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * Samsung S5P SoC series camera interface (camera capture) driver
+ * Samsung S5P/EXYNOS4 SoC series camera interface (camera capture) driver
  *
- * Copyright (c) 2010 Samsung Electronics Co., Ltd
+ * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd.
  * Author: Sylwester Nawrocki, <s.nawrocki@samsung.com>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -262,12 +262,7 @@ static unsigned int get_plane_size(struct fimc_frame *fr, unsigned int plane)
 {
        if (!fr || plane >= fr->fmt->memplanes)
                return 0;
-
-       dbg("%s: w: %d. h: %d. depth[%d]: %d",
-           __func__, fr->width, fr->height, plane, fr->fmt->depth[plane]);
-
        return fr->f_width * fr->f_height * fr->fmt->depth[plane] / 8;
-
 }
 
 static int queue_setup(struct vb2_queue *vq, unsigned int *num_buffers,
@@ -283,24 +278,14 @@ static int queue_setup(struct vb2_queue *vq, unsigned int *num_buffers,
 
        *num_planes = fmt->memplanes;
 
-       dbg("%s, buffer count=%d, plane count=%d",
-           __func__, *num_buffers, *num_planes);
-
        for (i = 0; i < fmt->memplanes; i++) {
                sizes[i] = get_plane_size(&ctx->d_frame, i);
-               dbg("plane: %u, plane_size: %lu", i, sizes[i]);
                allocators[i] = ctx->fimc_dev->alloc_ctx;
        }
 
        return 0;
 }
 
-static int buffer_init(struct vb2_buffer *vb)
-{
-       /* TODO: */
-       return 0;
-}
-
 static int buffer_prepare(struct vb2_buffer *vb)
 {
        struct vb2_queue *vq = vb->vb2_queue;
@@ -380,7 +365,6 @@ static struct vb2_ops fimc_capture_qops = {
        .queue_setup            = queue_setup,
        .buf_prepare            = buffer_prepare,
        .buf_queue              = buffer_queue,
-       .buf_init               = buffer_init,
        .wait_prepare           = fimc_unlock,
        .wait_finish            = fimc_lock,
        .start_streaming        = start_streaming,
@@ -903,6 +887,7 @@ err_vd_reg:
 err_v4l2_reg:
        v4l2_device_unregister(v4l2_dev);
 err_info:
+       kfree(ctx);
        dev_err(&fimc->pdev->dev, "failed to install\n");
        return ret;
 }
index dc91a8511af66ca1bb0f898a68dba0ac4c873257..bdf19ada91725eb45a03d6b710691dd9778f6a97 100644 (file)
@@ -1,9 +1,8 @@
 /*
- * S5P camera interface (video postprocessor) driver
+ * Samsung S5P/EXYNOS4 SoC series camera interface (video postprocessor) driver
  *
- * Copyright (c) 2010 Samsung Electronics Co., Ltd
- *
- * Sylwester Nawrocki, <s.nawrocki@samsung.com>
+ * Copyright (C) 2010-2011 Samsung Electronics Co., Ltd.
+ * Contact: Sylwester Nawrocki, <s.nawrocki@samsung.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published
@@ -42,7 +41,6 @@ static struct fimc_fmt fimc_formats[] = {
                .color          = S5P_FIMC_RGB565,
                .memplanes      = 1,
                .colplanes      = 1,
-               .mbus_code      = V4L2_MBUS_FMT_RGB565_2X8_BE,
                .flags          = FMT_FLAGS_M2M,
        }, {
                .name           = "BGR666",
@@ -232,11 +230,7 @@ static int fimc_get_scaler_factor(u32 src, u32 tar, u32 *ratio, u32 *shift)
                        return 0;
                }
        }
-
        *shift = 0, *ratio = 1;
-
-       dbg("s: %d, t: %d, shift: %d, ratio: %d",
-           src, tar, *shift, *ratio);
        return 0;
 }
 
@@ -268,10 +262,8 @@ int fimc_set_scaler_info(struct fimc_ctx *ctx)
                err("invalid source size: %d x %d", sx, sy);
                return -EINVAL;
        }
-
        sc->real_width = sx;
        sc->real_height = sy;
-       dbg("sx= %d, sy= %d, tx= %d, ty= %d", sx, sy, tx, ty);
 
        ret = fimc_get_scaler_factor(sx, tx, &sc->pre_hratio, &sc->hfactor);
        if (ret)
@@ -711,22 +703,18 @@ static int fimc_queue_setup(struct vb2_queue *vq, unsigned int *num_buffers,
        f = ctx_get_frame(ctx, vq->type);
        if (IS_ERR(f))
                return PTR_ERR(f);
-
        /*
         * Return number of non-contigous planes (plane buffers)
         * depending on the configured color format.
         */
-       if (f->fmt)
-               *num_planes = f->fmt->memplanes;
+       if (!f->fmt)
+               return -EINVAL;
 
+       *num_planes = f->fmt->memplanes;
        for (i = 0; i < f->fmt->memplanes; i++) {
-               sizes[i] = (f->width * f->height * f->fmt->depth[i]) >> 3;
+               sizes[i] = (f->f_width * f->f_height * f->fmt->depth[i]) / 8;
                allocators[i] = ctx->fimc_dev->alloc_ctx;
        }
-
-       if (*num_buffers == 0)
-               *num_buffers = 1;
-
        return 0;
 }
 
@@ -852,7 +840,7 @@ struct fimc_fmt *find_format(struct v4l2_format *f, unsigned int mask)
 
        for (i = 0; i < ARRAY_SIZE(fimc_formats); ++i) {
                fmt = &fimc_formats[i];
-               if (fmt->fourcc == f->fmt.pix.pixelformat &&
+               if (fmt->fourcc == f->fmt.pix_mp.pixelformat &&
                   (fmt->flags & mask))
                        break;
        }
index 3beb1e5320ce71ef674b5f810d8014ec454c8d68..1f70772daaf0056fad709c7f26845595191f6ab0 100644 (file)
@@ -1,7 +1,5 @@
 /*
- * Copyright (c) 2010 Samsung Electronics
- *
- * Sylwester Nawrocki, <s.nawrocki@samsung.com>
+ * Copyright (C) 2010 - 2011 Samsung Electronics Co., Ltd.
  *
  * 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
@@ -135,9 +133,10 @@ enum fimc_color_fmt {
  * @name: format description
  * @fourcc: the fourcc code for this format, 0 if not applicable
  * @color: the corresponding fimc_color_fmt
- * @depth: per plane driver's private 'number of bits per pixel'
  * @memplanes: number of physically non-contiguous data planes
  * @colplanes: number of physically contiguous data planes
+ * @depth: per plane driver's private 'number of bits per pixel'
+ * @flags: flags indicating which operation mode format applies to
  */
 struct fimc_fmt {
        enum v4l2_mbus_pixelcode mbus_code;
@@ -171,7 +170,7 @@ struct fimc_dma_offset {
 };
 
 /**
- * struct fimc_effect - the configuration data for the "Arbitrary" image effect
+ * struct fimc_effect - color effect information
  * @type:      effect type
  * @pat_cb:    cr value when type is "arbitrary"
  * @pat_cr:    cr value when type is "arbitrary"
@@ -184,7 +183,6 @@ struct fimc_effect {
 
 /**
  * struct fimc_scaler - the configuration data for FIMC inetrnal scaler
- *
  * @scaleup_h:         flag indicating scaling up horizontally
  * @scaleup_v:         flag indicating scaling up vertically
  * @copy_mode:         flag indicating transparent DMA transfer (no scaling
@@ -220,7 +218,6 @@ struct fimc_scaler {
 
 /**
  * struct fimc_addr - the FIMC physical address set for DMA
- *
  * @y:  luminance plane physical address
  * @cb:         Cb plane physical address
  * @cr:         Cr plane physical address
@@ -234,6 +231,7 @@ struct fimc_addr {
 /**
  * struct fimc_vid_buffer - the driver's video buffer
  * @vb:    v4l videobuf buffer
+ * @list:  linked list structure for buffer queue
  * @paddr: precalculated physical address set
  * @index: buffer index for the output DMA engine
  */
@@ -254,11 +252,10 @@ struct fimc_vid_buffer {
  * @offs_v:    image vertical pixel offset
  * @width:     image pixel width
  * @height:    image pixel weight
- * @paddr:     image frame buffer physical addresses
- * @buf_cnt:   number of buffers depending on a color format
  * @payload:   image size in bytes (w x h x bpp)
- * @color:     color format
+ * @paddr:     image frame buffer physical addresses
  * @dma_offset:        DMA offset in bytes
+ * @fmt:       fimc color format pointer
  */
 struct fimc_frame {
        u32     f_width;
@@ -390,21 +387,22 @@ struct fimc_ctx;
 
 /**
  * struct fimc_dev - abstraction for FIMC entity
- *
  * @slock:     the spinlock protecting this data structure
  * @lock:      the mutex protecting this data structure
  * @pdev:      pointer to the FIMC platform device
  * @pdata:     pointer to the device platform data
+ * @variant:   the IP variant information
  * @id:                FIMC device index (0..FIMC_MAX_DEVS)
  * @num_clocks: the number of clocks managed by this device instance
- * @clock[]:   the clocks required for FIMC operation
+ * @clock:     clocks required for FIMC operation
  * @regs:      the mapped hardware registers
  * @regs_res:  the resource claimed for IO registers
- * @irq:       interrupt number of the FIMC subdevice
- * @irq_queue:
+ * @irq:       FIMC interrupt number
+ * @irq_queue: interrupt handler waitqueue
  * @m2m:       memory-to-memory V4L2 device information
  * @vid_cap:   camera capture device information
  * @state:     flags used to synchronize m2m and capture mode operation
+ * @alloc_ctx: videobuf2 memory allocator context
  */
 struct fimc_dev {
        spinlock_t                      slock;
@@ -427,8 +425,7 @@ struct fimc_dev {
 
 /**
  * fimc_ctx - the device context data
- *
- * @lock:              mutex protecting this data structure
+ * @slock:             spinlock protecting this data structure
  * @s_frame:           source frame properties
  * @d_frame:           destination frame properties
  * @out_order_1p:      output 1-plane YCBCR order
index ff6c0e97563e90339458e1eb1c499ceed6009475..d4ee24bf692820dd0f58004d480d010d1be18c29 100644 (file)
@@ -963,7 +963,7 @@ static int saa7134_raw_decode_irq(struct saa7134_dev *dev)
         * to work with other protocols.
         */
        if (!ir->active) {
-               timeout = jiffies + jiffies_to_msecs(15);
+               timeout = jiffies + msecs_to_jiffies(15);
                mod_timer(&ir->timer, timeout);
                ir->active = true;
        }
index 9363ed91a4cbda40a91ce2e1bf3958e9da097283..cfa9f7efe93dc4247f740a5192527541bc44a0a0 100644 (file)
@@ -724,19 +724,15 @@ static inline int check_mode(struct tuner *t, enum v4l2_tuner_type mode)
 }
 
 /**
- * set_mode_freq - Switch tuner to other mode.
- * @client:    struct i2c_client pointer
+ * set_mode - Switch tuner to other mode.
  * @t:         a pointer to the module's internal struct_tuner
  * @mode:      enum v4l2_type (radio or TV)
- * @freq:      frequency to set (0 means to use the previous one)
  *
  * If tuner doesn't support the needed mode (radio or TV), prints a
  * debug message and returns -EINVAL, changing its state to standby.
- * Otherwise, changes the state and sets frequency to the last value, if
- * the tuner can sleep or if it supports both Radio and TV.
+ * Otherwise, changes the mode and returns 0.
  */
-static int set_mode_freq(struct i2c_client *client, struct tuner *t,
-                        enum v4l2_tuner_type mode, unsigned int freq)
+static int set_mode(struct tuner *t, enum v4l2_tuner_type mode)
 {
        struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops;
 
@@ -752,17 +748,27 @@ static int set_mode_freq(struct i2c_client *client, struct tuner *t,
                t->mode = mode;
                tuner_dbg("Changing to mode %d\n", mode);
        }
+       return 0;
+}
+
+/**
+ * set_freq - Set the tuner to the desired frequency.
+ * @t:         a pointer to the module's internal struct_tuner
+ * @freq:      frequency to set (0 means to use the current frequency)
+ */
+static void set_freq(struct tuner *t, unsigned int freq)
+{
+       struct i2c_client *client = v4l2_get_subdevdata(&t->sd);
+
        if (t->mode == V4L2_TUNER_RADIO) {
-               if (freq)
-                       t->radio_freq = freq;
-               set_radio_freq(client, t->radio_freq);
+               if (!freq)
+                       freq = t->radio_freq;
+               set_radio_freq(client, freq);
        } else {
-               if (freq)
-                       t->tv_freq = freq;
-               set_tv_freq(client, t->tv_freq);
+               if (!freq)
+                       freq = t->tv_freq;
+               set_tv_freq(client, freq);
        }
-
-       return 0;
 }
 
 /*
@@ -817,7 +823,8 @@ static void set_tv_freq(struct i2c_client *c, unsigned int freq)
 /**
  * tuner_fixup_std - force a given video standard variant
  *
- * @t: tuner internal struct
+ * @t: tuner internal struct
+ * @std:       TV standard
  *
  * A few devices or drivers have problem to detect some standard variations.
  * On other operational systems, the drivers generally have a per-country
@@ -827,57 +834,39 @@ static void set_tv_freq(struct i2c_client *c, unsigned int freq)
  * to distinguish all video standard variations, a modprobe parameter can
  * be used to force a video standard match.
  */
-static int tuner_fixup_std(struct tuner *t)
+static v4l2_std_id tuner_fixup_std(struct tuner *t, v4l2_std_id std)
 {
-       if ((t->std & V4L2_STD_PAL) == V4L2_STD_PAL) {
+       if (pal[0] != '-' && (std & V4L2_STD_PAL) == V4L2_STD_PAL) {
                switch (pal[0]) {
                case '6':
-                       tuner_dbg("insmod fixup: PAL => PAL-60\n");
-                       t->std = V4L2_STD_PAL_60;
-                       break;
+                       return V4L2_STD_PAL_60;
                case 'b':
                case 'B':
                case 'g':
                case 'G':
-                       tuner_dbg("insmod fixup: PAL => PAL-BG\n");
-                       t->std = V4L2_STD_PAL_BG;
-                       break;
+                       return V4L2_STD_PAL_BG;
                case 'i':
                case 'I':
-                       tuner_dbg("insmod fixup: PAL => PAL-I\n");
-                       t->std = V4L2_STD_PAL_I;
-                       break;
+                       return V4L2_STD_PAL_I;
                case 'd':
                case 'D':
                case 'k':
                case 'K':
-                       tuner_dbg("insmod fixup: PAL => PAL-DK\n");
-                       t->std = V4L2_STD_PAL_DK;
-                       break;
+                       return V4L2_STD_PAL_DK;
                case 'M':
                case 'm':
-                       tuner_dbg("insmod fixup: PAL => PAL-M\n");
-                       t->std = V4L2_STD_PAL_M;
-                       break;
+                       return V4L2_STD_PAL_M;
                case 'N':
                case 'n':
-                       if (pal[1] == 'c' || pal[1] == 'C') {
-                               tuner_dbg("insmod fixup: PAL => PAL-Nc\n");
-                               t->std = V4L2_STD_PAL_Nc;
-                       } else {
-                               tuner_dbg("insmod fixup: PAL => PAL-N\n");
-                               t->std = V4L2_STD_PAL_N;
-                       }
-                       break;
-               case '-':
-                       /* default parameter, do nothing */
-                       break;
+                       if (pal[1] == 'c' || pal[1] == 'C')
+                               return V4L2_STD_PAL_Nc;
+                       return V4L2_STD_PAL_N;
                default:
                        tuner_warn("pal= argument not recognised\n");
                        break;
                }
        }
-       if ((t->std & V4L2_STD_SECAM) == V4L2_STD_SECAM) {
+       if (secam[0] != '-' && (std & V4L2_STD_SECAM) == V4L2_STD_SECAM) {
                switch (secam[0]) {
                case 'b':
                case 'B':
@@ -885,63 +874,42 @@ static int tuner_fixup_std(struct tuner *t)
                case 'G':
                case 'h':
                case 'H':
-                       tuner_dbg("insmod fixup: SECAM => SECAM-BGH\n");
-                       t->std = V4L2_STD_SECAM_B |
-                                V4L2_STD_SECAM_G |
-                                V4L2_STD_SECAM_H;
-                       break;
+                       return V4L2_STD_SECAM_B |
+                              V4L2_STD_SECAM_G |
+                              V4L2_STD_SECAM_H;
                case 'd':
                case 'D':
                case 'k':
                case 'K':
-                       tuner_dbg("insmod fixup: SECAM => SECAM-DK\n");
-                       t->std = V4L2_STD_SECAM_DK;
-                       break;
+                       return V4L2_STD_SECAM_DK;
                case 'l':
                case 'L':
-                       if ((secam[1] == 'C') || (secam[1] == 'c')) {
-                               tuner_dbg("insmod fixup: SECAM => SECAM-L'\n");
-                               t->std = V4L2_STD_SECAM_LC;
-                       } else {
-                               tuner_dbg("insmod fixup: SECAM => SECAM-L\n");
-                               t->std = V4L2_STD_SECAM_L;
-                       }
-                       break;
-               case '-':
-                       /* default parameter, do nothing */
-                       break;
+                       if ((secam[1] == 'C') || (secam[1] == 'c'))
+                               return V4L2_STD_SECAM_LC;
+                       return V4L2_STD_SECAM_L;
                default:
                        tuner_warn("secam= argument not recognised\n");
                        break;
                }
        }
 
-       if ((t->std & V4L2_STD_NTSC) == V4L2_STD_NTSC) {
+       if (ntsc[0] != '-' && (std & V4L2_STD_NTSC) == V4L2_STD_NTSC) {
                switch (ntsc[0]) {
                case 'm':
                case 'M':
-                       tuner_dbg("insmod fixup: NTSC => NTSC-M\n");
-                       t->std = V4L2_STD_NTSC_M;
-                       break;
+                       return V4L2_STD_NTSC_M;
                case 'j':
                case 'J':
-                       tuner_dbg("insmod fixup: NTSC => NTSC_M_JP\n");
-                       t->std = V4L2_STD_NTSC_M_JP;
-                       break;
+                       return V4L2_STD_NTSC_M_JP;
                case 'k':
                case 'K':
-                       tuner_dbg("insmod fixup: NTSC => NTSC_M_KR\n");
-                       t->std = V4L2_STD_NTSC_M_KR;
-                       break;
-               case '-':
-                       /* default parameter, do nothing */
-                       break;
+                       return V4L2_STD_NTSC_M_KR;
                default:
                        tuner_info("ntsc= argument not recognised\n");
                        break;
                }
        }
-       return 0;
+       return std;
 }
 
 /*
@@ -1058,10 +1026,9 @@ static void tuner_status(struct dvb_frontend *fe)
 static int tuner_s_radio(struct v4l2_subdev *sd)
 {
        struct tuner *t = to_tuner(sd);
-       struct i2c_client *client = v4l2_get_subdevdata(sd);
 
-       if (set_mode_freq(client, t, V4L2_TUNER_RADIO, 0) == -EINVAL)
-               return 0;
+       if (set_mode(t, V4L2_TUNER_RADIO) == 0)
+               set_freq(t, 0);
        return 0;
 }
 
@@ -1072,16 +1039,20 @@ static int tuner_s_radio(struct v4l2_subdev *sd)
 /**
  * tuner_s_power - controls the power state of the tuner
  * @sd: pointer to struct v4l2_subdev
- * @on: a zero value puts the tuner to sleep
+ * @on: a zero value puts the tuner to sleep, non-zero wakes it up
  */
 static int tuner_s_power(struct v4l2_subdev *sd, int on)
 {
        struct tuner *t = to_tuner(sd);
        struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops;
 
-       /* FIXME: Why this function don't wake the tuner if on != 0 ? */
-       if (on)
+       if (on) {
+               if (t->standby && set_mode(t, t->mode) == 0) {
+                       tuner_dbg("Waking up tuner\n");
+                       set_freq(t, 0);
+               }
                return 0;
+       }
 
        tuner_dbg("Putting tuner to sleep\n");
        t->standby = true;
@@ -1093,28 +1064,36 @@ static int tuner_s_power(struct v4l2_subdev *sd, int on)
 static int tuner_s_std(struct v4l2_subdev *sd, v4l2_std_id std)
 {
        struct tuner *t = to_tuner(sd);
-       struct i2c_client *client = v4l2_get_subdevdata(sd);
 
-       if (set_mode_freq(client, t, V4L2_TUNER_ANALOG_TV, 0) == -EINVAL)
+       if (set_mode(t, V4L2_TUNER_ANALOG_TV))
                return 0;
 
-       t->std = std;
-       tuner_fixup_std(t);
-
+       t->std = tuner_fixup_std(t, std);
+       if (t->std != std)
+               tuner_dbg("Fixup standard %llx to %llx\n", std, t->std);
+       set_freq(t, 0);
        return 0;
 }
 
 static int tuner_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f)
 {
        struct tuner *t = to_tuner(sd);
-       struct i2c_client *client = v4l2_get_subdevdata(sd);
-
-       if (set_mode_freq(client, t, f->type, f->frequency) == -EINVAL)
-               return 0;
 
+       if (set_mode(t, f->type) == 0)
+               set_freq(t, f->frequency);
        return 0;
 }
 
+/**
+ * tuner_g_frequency - Get the tuned frequency for the tuner
+ * @sd: pointer to struct v4l2_subdev
+ * @f: pointer to struct v4l2_frequency
+ *
+ * At return, the structure f will be filled with tuner frequency
+ * if the tuner matches the f->type.
+ * Note: f->type should be initialized before calling it.
+ * This is done by either video_ioctl2 or by the bridge driver.
+ */
 static int tuner_g_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f)
 {
        struct tuner *t = to_tuner(sd);
@@ -1122,8 +1101,7 @@ static int tuner_g_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f)
 
        if (check_mode(t, f->type) == -EINVAL)
                return 0;
-       f->type = t->mode;
-       if (fe_tuner_ops->get_frequency && !t->standby) {
+       if (f->type == t->mode && fe_tuner_ops->get_frequency && !t->standby) {
                u32 abs_freq;
 
                fe_tuner_ops->get_frequency(&t->fe, &abs_freq);
@@ -1131,12 +1109,22 @@ static int tuner_g_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *f)
                        DIV_ROUND_CLOSEST(abs_freq * 2, 125) :
                        DIV_ROUND_CLOSEST(abs_freq, 62500);
        } else {
-               f->frequency = (V4L2_TUNER_RADIO == t->mode) ?
+               f->frequency = (V4L2_TUNER_RADIO == f->type) ?
                        t->radio_freq : t->tv_freq;
        }
        return 0;
 }
 
+/**
+ * tuner_g_tuner - Fill in tuner information
+ * @sd: pointer to struct v4l2_subdev
+ * @vt: pointer to struct v4l2_tuner
+ *
+ * At return, the structure vt will be filled with tuner information
+ * if the tuner matches vt->type.
+ * Note: vt->type should be initialized before calling it.
+ * This is done by either video_ioctl2 or by the bridge driver.
+ */
 static int tuner_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
 {
        struct tuner *t = to_tuner(sd);
@@ -1145,48 +1133,58 @@ static int tuner_g_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
 
        if (check_mode(t, vt->type) == -EINVAL)
                return 0;
-       vt->type = t->mode;
-       if (analog_ops->get_afc)
+       if (vt->type == t->mode && analog_ops->get_afc)
                vt->afc = analog_ops->get_afc(&t->fe);
-       if (t->mode == V4L2_TUNER_ANALOG_TV)
+       if (vt->type == V4L2_TUNER_ANALOG_TV)
                vt->capability |= V4L2_TUNER_CAP_NORM;
-       if (t->mode != V4L2_TUNER_RADIO) {
+       if (vt->type != V4L2_TUNER_RADIO) {
                vt->rangelow = tv_range[0] * 16;
                vt->rangehigh = tv_range[1] * 16;
                return 0;
        }
 
        /* radio mode */
-       vt->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO;
-       if (fe_tuner_ops->get_status) {
-               u32 tuner_status;
-
-               fe_tuner_ops->get_status(&t->fe, &tuner_status);
-               vt->rxsubchans =
-                       (tuner_status & TUNER_STATUS_STEREO) ?
-                       V4L2_TUNER_SUB_STEREO :
-                       V4L2_TUNER_SUB_MONO;
+       if (vt->type == t->mode) {
+               vt->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO;
+               if (fe_tuner_ops->get_status) {
+                       u32 tuner_status;
+
+                       fe_tuner_ops->get_status(&t->fe, &tuner_status);
+                       vt->rxsubchans =
+                               (tuner_status & TUNER_STATUS_STEREO) ?
+                               V4L2_TUNER_SUB_STEREO :
+                               V4L2_TUNER_SUB_MONO;
+               }
+               if (analog_ops->has_signal)
+                       vt->signal = analog_ops->has_signal(&t->fe);
+               vt->audmode = t->audmode;
        }
-       if (analog_ops->has_signal)
-               vt->signal = analog_ops->has_signal(&t->fe);
        vt->capability |= V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO;
-       vt->audmode = t->audmode;
        vt->rangelow = radio_range[0] * 16000;
        vt->rangehigh = radio_range[1] * 16000;
 
        return 0;
 }
 
+/**
+ * tuner_s_tuner - Set the tuner's audio mode
+ * @sd: pointer to struct v4l2_subdev
+ * @vt: pointer to struct v4l2_tuner
+ *
+ * Sets the audio mode if the tuner matches vt->type.
+ * Note: vt->type should be initialized before calling it.
+ * This is done by either video_ioctl2 or by the bridge driver.
+ */
 static int tuner_s_tuner(struct v4l2_subdev *sd, struct v4l2_tuner *vt)
 {
        struct tuner *t = to_tuner(sd);
-       struct i2c_client *client = v4l2_get_subdevdata(sd);
 
-       if (set_mode_freq(client, t, vt->type, 0) == -EINVAL)
+       if (set_mode(t, vt->type))
                return 0;
 
        if (t->mode == V4L2_TUNER_RADIO)
                t->audmode = vt->audmode;
+       set_freq(t, 0);
 
        return 0;
 }
@@ -1221,7 +1219,8 @@ static int tuner_resume(struct i2c_client *c)
        tuner_dbg("resume\n");
 
        if (!t->standby)
-               set_mode_freq(c, t, t->type, 0);
+               if (set_mode(t, t->mode) == 0)
+                       set_freq(t, 0);
 
        return 0;
 }
index c3ab0c813be249d4957fa93e83cfac0df567b703..48fea373c25ae99df89224d945065c25a302311f 100644 (file)
@@ -27,14 +27,20 @@ static int uvc_mc_register_entity(struct uvc_video_chain *chain,
        struct uvc_entity *entity)
 {
        const u32 flags = MEDIA_LNK_FL_ENABLED | MEDIA_LNK_FL_IMMUTABLE;
-       struct uvc_entity *remote;
+       struct media_entity *sink;
        unsigned int i;
-       u8 remote_pad;
-       int ret = 0;
+       int ret;
+
+       sink = (UVC_ENTITY_TYPE(entity) == UVC_TT_STREAMING)
+            ? (entity->vdev ? &entity->vdev->entity : NULL)
+            : &entity->subdev.entity;
+       if (sink == NULL)
+               return 0;
 
        for (i = 0; i < entity->num_pads; ++i) {
                struct media_entity *source;
-               struct media_entity *sink;
+               struct uvc_entity *remote;
+               u8 remote_pad;
 
                if (!(entity->pads[i].flags & MEDIA_PAD_FL_SINK))
                        continue;
@@ -43,10 +49,11 @@ static int uvc_mc_register_entity(struct uvc_video_chain *chain,
                if (remote == NULL)
                        return -EINVAL;
 
-               source = (UVC_ENTITY_TYPE(remote) == UVC_TT_STREAMING)
-                      ? &remote->vdev->entity : &remote->subdev.entity;
-               sink = (UVC_ENTITY_TYPE(entity) == UVC_TT_STREAMING)
-                    ? &entity->vdev->entity : &entity->subdev.entity;
+               source = (UVC_ENTITY_TYPE(remote) != UVC_TT_STREAMING)
+                      ? (remote->vdev ? &remote->vdev->entity : NULL)
+                      : &remote->subdev.entity;
+               if (source == NULL)
+                       continue;
 
                remote_pad = remote->num_pads - 1;
                ret = media_entity_create_link(source, remote_pad,
@@ -55,11 +62,10 @@ static int uvc_mc_register_entity(struct uvc_video_chain *chain,
                        return ret;
        }
 
-       if (UVC_ENTITY_TYPE(entity) != UVC_TT_STREAMING)
-               ret = v4l2_device_register_subdev(&chain->dev->vdev,
-                                                 &entity->subdev);
+       if (UVC_ENTITY_TYPE(entity) == UVC_TT_STREAMING)
+               return 0;
 
-       return ret;
+       return v4l2_device_register_subdev(&chain->dev->vdev, &entity->subdev);
 }
 
 static struct v4l2_subdev_ops uvc_subdev_ops = {
@@ -84,9 +90,11 @@ static int uvc_mc_init_entity(struct uvc_entity *entity)
 
                ret = media_entity_init(&entity->subdev.entity,
                                        entity->num_pads, entity->pads, 0);
-       } else
+       } else if (entity->vdev != NULL) {
                ret = media_entity_init(&entity->vdev->entity,
                                        entity->num_pads, entity->pads, 0);
+       } else
+               ret = 0;
 
        return ret;
 }
index 109a06384a8f73d945c9f5d5014b88b10442c8c2..f90ce9fce53927566b5569a9beeb387d034cb946 100644 (file)
@@ -104,6 +104,8 @@ static int __uvc_free_buffers(struct uvc_video_queue *queue)
        }
 
        if (queue->count) {
+               uvc_queue_cancel(queue, 0);
+               INIT_LIST_HEAD(&queue->mainqueue);
                vfree(queue->mem);
                queue->count = 0;
        }
index fc766b9f24c529e3b1083dbe0b7e37f365550669..49994793cc777ab36c38a8dc43685b5886aaaa4d 100644 (file)
@@ -1255,8 +1255,10 @@ int uvc_video_enable(struct uvc_streaming *stream, int enable)
 
        /* Commit the streaming parameters. */
        ret = uvc_commit_video(stream, &stream->ctrl);
-       if (ret < 0)
+       if (ret < 0) {
+               uvc_queue_enable(&stream->queue, 0);
                return ret;
+       }
 
        return uvc_init_video(stream, GFP_KERNEL);
 }
index 19d5ae2937802a41e8784bf691400162c57c9152..06f14008b346443a50a55cc58c2a2009e1664ecd 100644 (file)
@@ -167,6 +167,12 @@ static void v4l2_device_release(struct device *cd)
 
        mutex_unlock(&videodev_lock);
 
+#if defined(CONFIG_MEDIA_CONTROLLER)
+       if (vdev->v4l2_dev && vdev->v4l2_dev->mdev &&
+           vdev->vfl_type != VFL_TYPE_SUBDEV)
+               media_device_unregister_entity(&vdev->entity);
+#endif
+
        /* Release video_device and perform other
           cleanups as needed. */
        vdev->release(vdev);
@@ -389,9 +395,6 @@ static int v4l2_mmap(struct file *filp, struct vm_area_struct *vm)
 static int v4l2_open(struct inode *inode, struct file *filp)
 {
        struct video_device *vdev;
-#if defined(CONFIG_MEDIA_CONTROLLER)
-       struct media_entity *entity = NULL;
-#endif
        int ret = 0;
 
        /* Check if the video device is available */
@@ -405,17 +408,6 @@ static int v4l2_open(struct inode *inode, struct file *filp)
        /* and increase the device refcount */
        video_get(vdev);
        mutex_unlock(&videodev_lock);
-#if defined(CONFIG_MEDIA_CONTROLLER)
-       if (vdev->v4l2_dev && vdev->v4l2_dev->mdev &&
-           vdev->vfl_type != VFL_TYPE_SUBDEV) {
-               entity = media_entity_get(&vdev->entity);
-               if (!entity) {
-                       ret = -EBUSY;
-                       video_put(vdev);
-                       return ret;
-               }
-       }
-#endif
        if (vdev->fops->open) {
                if (vdev->lock && mutex_lock_interruptible(vdev->lock)) {
                        ret = -ERESTARTSYS;
@@ -431,14 +423,8 @@ static int v4l2_open(struct inode *inode, struct file *filp)
 
 err:
        /* decrease the refcount in case of an error */
-       if (ret) {
-#if defined(CONFIG_MEDIA_CONTROLLER)
-               if (vdev->v4l2_dev && vdev->v4l2_dev->mdev &&
-                   vdev->vfl_type != VFL_TYPE_SUBDEV)
-                       media_entity_put(entity);
-#endif
+       if (ret)
                video_put(vdev);
-       }
        return ret;
 }
 
@@ -455,11 +441,6 @@ static int v4l2_release(struct inode *inode, struct file *filp)
                if (vdev->lock)
                        mutex_unlock(vdev->lock);
        }
-#if defined(CONFIG_MEDIA_CONTROLLER)
-       if (vdev->v4l2_dev && vdev->v4l2_dev->mdev &&
-           vdev->vfl_type != VFL_TYPE_SUBDEV)
-               media_entity_put(&vdev->entity);
-#endif
        /* decrease the refcount unconditionally since the release()
           return value is ignored. */
        video_put(vdev);
@@ -754,12 +735,6 @@ void video_unregister_device(struct video_device *vdev)
        if (!vdev || !video_is_registered(vdev))
                return;
 
-#if defined(CONFIG_MEDIA_CONTROLLER)
-       if (vdev->v4l2_dev && vdev->v4l2_dev->mdev &&
-           vdev->vfl_type != VFL_TYPE_SUBDEV)
-               media_device_unregister_entity(&vdev->entity);
-#endif
-
        mutex_lock(&videodev_lock);
        /* This must be in a critical section to prevent a race with v4l2_open.
         * Once this bit has been cleared video_get may never be called again.
index 506edcc2ddeb722eedae63934ab4be34b65371f3..69e8c6ffcc49b8b64700c8049acaf0b172d25350 100644 (file)
@@ -1822,6 +1822,8 @@ static long __video_do_ioctl(struct file *file,
                if (!ops->vidioc_g_tuner)
                        break;
 
+               p->type = (vfd->vfl_type == VFL_TYPE_RADIO) ?
+                       V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
                ret = ops->vidioc_g_tuner(file, fh, p);
                if (!ret)
                        dbgarg(cmd, "index=%d, name=%s, type=%d, "
@@ -1840,6 +1842,8 @@ static long __video_do_ioctl(struct file *file,
 
                if (!ops->vidioc_s_tuner)
                        break;
+               p->type = (vfd->vfl_type == VFL_TYPE_RADIO) ?
+                       V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
                dbgarg(cmd, "index=%d, name=%s, type=%d, "
                                "capability=0x%x, rangelow=%d, "
                                "rangehigh=%d, signal=%d, afc=%d, "
@@ -1858,6 +1862,8 @@ static long __video_do_ioctl(struct file *file,
                if (!ops->vidioc_g_frequency)
                        break;
 
+               p->type = (vfd->vfl_type == VFL_TYPE_RADIO) ?
+                       V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
                ret = ops->vidioc_g_frequency(file, fh, p);
                if (!ret)
                        dbgarg(cmd, "tuner=%d, type=%d, frequency=%d\n",
@@ -1940,13 +1946,19 @@ static long __video_do_ioctl(struct file *file,
        case VIDIOC_S_HW_FREQ_SEEK:
        {
                struct v4l2_hw_freq_seek *p = arg;
+               enum v4l2_tuner_type type;
 
                if (!ops->vidioc_s_hw_freq_seek)
                        break;
+               type = (vfd->vfl_type == VFL_TYPE_RADIO) ?
+                       V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
                dbgarg(cmd,
-                       "tuner=%d, type=%d, seek_upward=%d, wrap_around=%d\n",
-                       p->tuner, p->type, p->seek_upward, p->wrap_around);
-               ret = ops->vidioc_s_hw_freq_seek(file, fh, p);
+                       "tuner=%u, type=%u, seek_upward=%u, wrap_around=%u, spacing=%u\n",
+                       p->tuner, p->type, p->seek_upward, p->wrap_around, p->spacing);
+               if (p->type != type)
+                       ret = -EINVAL;
+               else
+                       ret = ops->vidioc_s_hw_freq_seek(file, fh, p);
                break;
        }
        case VIDIOC_ENUM_FRAMESIZES:
index 6ba1461d51ef9456be18be6421837c0c279064b8..3015e6000946b735a89d9b0a5e90f70540ab10c2 100644 (file)
@@ -492,13 +492,6 @@ int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req)
                return -EINVAL;
        }
 
-       /*
-        * If the same number of buffers and memory access method is requested
-        * then return immediately.
-        */
-       if (q->memory == req->memory && req->count == q->num_buffers)
-               return 0;
-
        if (req->count == 0 || q->num_buffers != 0 || q->memory != req->memory) {
                /*
                 * We already have buffers allocated, so first check if they
@@ -539,9 +532,9 @@ int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req)
        /* Finally, allocate buffers and video memory */
        ret = __vb2_queue_alloc(q, req->memory, num_buffers, num_planes,
                                plane_sizes);
-       if (ret < 0) {
-               dprintk(1, "Memory allocation failed with error: %d\n", ret);
-               return ret;
+       if (ret == 0) {
+               dprintk(1, "Memory allocation failed\n");
+               return -ENOMEM;
        }
 
        /*
@@ -1196,6 +1189,7 @@ static void __vb2_queue_cancel(struct vb2_queue *q)
         * has not already dequeued before initiating cancel.
         */
        INIT_LIST_HEAD(&q->done_list);
+       atomic_set(&q->queued_count, 0);
        wake_up_all(&q->done_wq);
 
        /*
index b2d9485aac75e7ade363e79a6994af5e003c4534..10a20d9509d982434f456ee300b771c6389f872e 100644 (file)
@@ -62,7 +62,7 @@ static void *vb2_dma_sg_alloc(void *alloc_ctx, unsigned long size)
                goto fail_pages_array_alloc;
 
        for (i = 0; i < buf->sg_desc.num_pages; ++i) {
-               buf->pages[i] = alloc_page(GFP_KERNEL | __GFP_ZERO);
+               buf->pages[i] = alloc_page(GFP_KERNEL | __GFP_ZERO | __GFP_NOWARN);
                if (NULL == buf->pages[i])
                        goto fail_pages_alloc;
                sg_set_page(&buf->sg_desc.sglist[i],
index 0f09c057e7960ca203886b61be108dfb9d3003d3..6ca938a6bf94d336ddbfd830c02bc4739436ffc9 100644 (file)
@@ -728,6 +728,9 @@ config MFD_TPS65910
          if you say yes here you get support for the TPS65910 series of
          Power Management chips.
 
+config TPS65911_COMPARATOR
+       tristate
+
 endif # MFD_SUPPORT
 
 menu "Multimedia Capabilities Port drivers"
index efe3cc33ed92ed83a7a8ece78f32686c87bb6170..d7d47d2a4c7615c17d4aec23080692f2b603dda7 100644 (file)
@@ -94,3 +94,4 @@ obj-$(CONFIG_MFD_OMAP_USB_HOST)       += omap-usb-host.o
 obj-$(CONFIG_MFD_PM8921_CORE)  += pm8921-core.o
 obj-$(CONFIG_MFD_PM8XXX_IRQ)   += pm8xxx-irq.o
 obj-$(CONFIG_MFD_TPS65910)     += tps65910.o tps65910-irq.o
+obj-$(CONFIG_TPS65911_COMPARATOR)      += tps65911-comparator.o
index c27fd1fc3b86789a73cf725ce57a5863e5175d6f..c71ae09430c5c580e7f0cc5bbd0d3610fd8b5048 100644 (file)
@@ -619,6 +619,7 @@ static void asic3_clk_disable(struct asic3 *asic, struct asic3_clk *clk)
 /* MFD cells (SPI, PWM, LED, DS1WM, MMC) */
 static struct ds1wm_driver_data ds1wm_pdata = {
        .active_high = 1,
+       .reset_recover_delay = 1,
 };
 
 static struct resource ds1wm_resources[] = {
index 2808bd125d1352303ee49ed968aca8913dc2d6c8..04c7093d6499cb88f330b2f768713e49e58c9ffc 100644 (file)
@@ -99,6 +99,7 @@ static int ds1wm_disable(struct platform_device *pdev)
 
 static struct ds1wm_driver_data ds1wm_pdata = {
        .active_high = 0,
+       .reset_recover_delay = 1,
 };
 
 static struct resource ds1wm_resources[] __initdata = {
index 855219526ccb9ec390afe9e2a74b138b1b415f31..1717144fe7f4f220f6cd79ccea856f39f87ecac3 100644 (file)
@@ -26,7 +26,6 @@
 #include <linux/spinlock.h>
 #include <linux/gpio.h>
 #include <plat/usb.h>
-#include <linux/pm_runtime.h>
 
 #define USBHS_DRIVER_NAME      "usbhs-omap"
 #define OMAP_EHCI_DEVICE       "ehci-omap"
 
 
 struct usbhs_hcd_omap {
+       struct clk                      *usbhost_ick;
+       struct clk                      *usbhost_hs_fck;
+       struct clk                      *usbhost_fs_fck;
        struct clk                      *xclk60mhsp1_ck;
        struct clk                      *xclk60mhsp2_ck;
        struct clk                      *utmi_p1_fck;
@@ -156,6 +158,8 @@ struct usbhs_hcd_omap {
        struct clk                      *usbhost_p2_fck;
        struct clk                      *usbtll_p2_fck;
        struct clk                      *init_60m_fclk;
+       struct clk                      *usbtll_fck;
+       struct clk                      *usbtll_ick;
 
        void __iomem                    *uhh_base;
        void __iomem                    *tll_base;
@@ -349,13 +353,46 @@ static int __devinit usbhs_omap_probe(struct platform_device *pdev)
        omap->platdata.ehci_data = pdata->ehci_data;
        omap->platdata.ohci_data = pdata->ohci_data;
 
-       pm_runtime_enable(&pdev->dev);
+       omap->usbhost_ick = clk_get(dev, "usbhost_ick");
+       if (IS_ERR(omap->usbhost_ick)) {
+               ret =  PTR_ERR(omap->usbhost_ick);
+               dev_err(dev, "usbhost_ick failed error:%d\n", ret);
+               goto err_end;
+       }
+
+       omap->usbhost_hs_fck = clk_get(dev, "hs_fck");
+       if (IS_ERR(omap->usbhost_hs_fck)) {
+               ret = PTR_ERR(omap->usbhost_hs_fck);
+               dev_err(dev, "usbhost_hs_fck failed error:%d\n", ret);
+               goto err_usbhost_ick;
+       }
+
+       omap->usbhost_fs_fck = clk_get(dev, "fs_fck");
+       if (IS_ERR(omap->usbhost_fs_fck)) {
+               ret = PTR_ERR(omap->usbhost_fs_fck);
+               dev_err(dev, "usbhost_fs_fck failed error:%d\n", ret);
+               goto err_usbhost_hs_fck;
+       }
+
+       omap->usbtll_fck = clk_get(dev, "usbtll_fck");
+       if (IS_ERR(omap->usbtll_fck)) {
+               ret = PTR_ERR(omap->usbtll_fck);
+               dev_err(dev, "usbtll_fck failed error:%d\n", ret);
+               goto err_usbhost_fs_fck;
+       }
+
+       omap->usbtll_ick = clk_get(dev, "usbtll_ick");
+       if (IS_ERR(omap->usbtll_ick)) {
+               ret = PTR_ERR(omap->usbtll_ick);
+               dev_err(dev, "usbtll_ick failed error:%d\n", ret);
+               goto err_usbtll_fck;
+       }
 
        omap->utmi_p1_fck = clk_get(dev, "utmi_p1_gfclk");
        if (IS_ERR(omap->utmi_p1_fck)) {
                ret = PTR_ERR(omap->utmi_p1_fck);
                dev_err(dev, "utmi_p1_gfclk failed error:%d\n", ret);
-               goto err_end;
+               goto err_usbtll_ick;
        }
 
        omap->xclk60mhsp1_ck = clk_get(dev, "xclk60mhsp1_ck");
@@ -485,8 +522,22 @@ err_xclk60mhsp1_ck:
 err_utmi_p1_fck:
        clk_put(omap->utmi_p1_fck);
 
+err_usbtll_ick:
+       clk_put(omap->usbtll_ick);
+
+err_usbtll_fck:
+       clk_put(omap->usbtll_fck);
+
+err_usbhost_fs_fck:
+       clk_put(omap->usbhost_fs_fck);
+
+err_usbhost_hs_fck:
+       clk_put(omap->usbhost_hs_fck);
+
+err_usbhost_ick:
+       clk_put(omap->usbhost_ick);
+
 err_end:
-       pm_runtime_disable(&pdev->dev);
        kfree(omap);
 
 end_probe:
@@ -520,7 +571,11 @@ static int __devexit usbhs_omap_remove(struct platform_device *pdev)
        clk_put(omap->utmi_p2_fck);
        clk_put(omap->xclk60mhsp1_ck);
        clk_put(omap->utmi_p1_fck);
-       pm_runtime_disable(&pdev->dev);
+       clk_put(omap->usbtll_ick);
+       clk_put(omap->usbtll_fck);
+       clk_put(omap->usbhost_fs_fck);
+       clk_put(omap->usbhost_hs_fck);
+       clk_put(omap->usbhost_ick);
        kfree(omap);
 
        return 0;
@@ -640,6 +695,7 @@ static int usbhs_enable(struct device *dev)
        struct usbhs_omap_platform_data *pdata = &omap->platdata;
        unsigned long                   flags = 0;
        int                             ret = 0;
+       unsigned long                   timeout;
        unsigned                        reg;
 
        dev_dbg(dev, "starting TI HSUSB Controller\n");
@@ -652,7 +708,11 @@ static int usbhs_enable(struct device *dev)
        if (omap->count > 0)
                goto end_count;
 
-       pm_runtime_get_sync(dev);
+       clk_enable(omap->usbhost_ick);
+       clk_enable(omap->usbhost_hs_fck);
+       clk_enable(omap->usbhost_fs_fck);
+       clk_enable(omap->usbtll_fck);
+       clk_enable(omap->usbtll_ick);
 
        if (pdata->ehci_data->phy_reset) {
                if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0])) {
@@ -676,6 +736,50 @@ static int usbhs_enable(struct device *dev)
        omap->usbhs_rev = usbhs_read(omap->uhh_base, OMAP_UHH_REVISION);
        dev_dbg(dev, "OMAP UHH_REVISION 0x%x\n", omap->usbhs_rev);
 
+       /* perform TLL soft reset, and wait until reset is complete */
+       usbhs_write(omap->tll_base, OMAP_USBTLL_SYSCONFIG,
+                       OMAP_USBTLL_SYSCONFIG_SOFTRESET);
+
+       /* Wait for TLL reset to complete */
+       timeout = jiffies + msecs_to_jiffies(1000);
+       while (!(usbhs_read(omap->tll_base, OMAP_USBTLL_SYSSTATUS)
+                       & OMAP_USBTLL_SYSSTATUS_RESETDONE)) {
+               cpu_relax();
+
+               if (time_after(jiffies, timeout)) {
+                       dev_dbg(dev, "operation timed out\n");
+                       ret = -EINVAL;
+                       goto err_tll;
+               }
+       }
+
+       dev_dbg(dev, "TLL RESET DONE\n");
+
+       /* (1<<3) = no idle mode only for initial debugging */
+       usbhs_write(omap->tll_base, OMAP_USBTLL_SYSCONFIG,
+                       OMAP_USBTLL_SYSCONFIG_ENAWAKEUP |
+                       OMAP_USBTLL_SYSCONFIG_SIDLEMODE |
+                       OMAP_USBTLL_SYSCONFIG_AUTOIDLE);
+
+       /* Put UHH in NoIdle/NoStandby mode */
+       reg = usbhs_read(omap->uhh_base, OMAP_UHH_SYSCONFIG);
+       if (is_omap_usbhs_rev1(omap)) {
+               reg |= (OMAP_UHH_SYSCONFIG_ENAWAKEUP
+                               | OMAP_UHH_SYSCONFIG_SIDLEMODE
+                               | OMAP_UHH_SYSCONFIG_CACTIVITY
+                               | OMAP_UHH_SYSCONFIG_MIDLEMODE);
+               reg &= ~OMAP_UHH_SYSCONFIG_AUTOIDLE;
+
+
+       } else if (is_omap_usbhs_rev2(omap)) {
+               reg &= ~OMAP4_UHH_SYSCONFIG_IDLEMODE_CLEAR;
+               reg |= OMAP4_UHH_SYSCONFIG_NOIDLE;
+               reg &= ~OMAP4_UHH_SYSCONFIG_STDBYMODE_CLEAR;
+               reg |= OMAP4_UHH_SYSCONFIG_NOSTDBY;
+       }
+
+       usbhs_write(omap->uhh_base, OMAP_UHH_SYSCONFIG, reg);
+
        reg = usbhs_read(omap->uhh_base, OMAP_UHH_HOSTCONFIG);
        /* setup ULPI bypass and burst configurations */
        reg |= (OMAP_UHH_HOSTCONFIG_INCR4_BURST_EN
@@ -815,8 +919,6 @@ end_count:
        return 0;
 
 err_tll:
-       pm_runtime_put_sync(dev);
-       spin_unlock_irqrestore(&omap->lock, flags);
        if (pdata->ehci_data->phy_reset) {
                if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0]))
                        gpio_free(pdata->ehci_data->reset_gpio_port[0]);
@@ -824,6 +926,13 @@ err_tll:
                if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1]))
                        gpio_free(pdata->ehci_data->reset_gpio_port[1]);
        }
+
+       clk_disable(omap->usbtll_ick);
+       clk_disable(omap->usbtll_fck);
+       clk_disable(omap->usbhost_fs_fck);
+       clk_disable(omap->usbhost_hs_fck);
+       clk_disable(omap->usbhost_ick);
+       spin_unlock_irqrestore(&omap->lock, flags);
        return ret;
 }
 
@@ -896,7 +1005,11 @@ static void usbhs_disable(struct device *dev)
                clk_disable(omap->utmi_p1_fck);
        }
 
-       pm_runtime_put_sync(dev);
+       clk_disable(omap->usbtll_ick);
+       clk_disable(omap->usbtll_fck);
+       clk_disable(omap->usbhost_fs_fck);
+       clk_disable(omap->usbhost_hs_fck);
+       clk_disable(omap->usbhost_ick);
 
        /* The gpio_free migh sleep; so unlock the spinlock */
        spin_unlock_irqrestore(&omap->lock, flags);
index 3d2dc56a3d40c927277c81a980ad0c04783743c7..283ac67597575831b778ad9653420b6750aab763 100644 (file)
@@ -125,7 +125,7 @@ static DEVICE_ATTR(comp2_threshold, S_IRUGO, comp_threshold_show, NULL);
 static __devinit int tps65911_comparator_probe(struct platform_device *pdev)
 {
        struct tps65910 *tps65910 = dev_get_drvdata(pdev->dev.parent);
-       struct tps65910_platform_data *pdata = dev_get_platdata(tps65910->dev);
+       struct tps65910_board *pdata = dev_get_platdata(tps65910->dev);
        int ret;
 
        ret = comp_threshold_set(tps65910, COMP1,  pdata->vmbch_threshold);
index 7721de942c69e29cd0d36300eb48a695dfbdafbf..fe140724a02eb878f83e45ab0654ec7e9dfeda43 100644 (file)
@@ -582,6 +582,8 @@ mmci_data_irq(struct mmci_host *host, struct mmc_data *data,
                        data->error = -EILSEQ;
                } else if (status & MCI_DATATIMEOUT) {
                        data->error = -ETIMEDOUT;
+               } else if (status & MCI_STARTBITERR) {
+                       data->error = -ECOMM;
                } else if (status & MCI_TXUNDERRUN) {
                        data->error = -EIO;
                } else if (status & MCI_RXOVERRUN) {
index bb32e21c09dbefcc1a0599b7f278d230f5d35689..2164e8c6476c1bca8e085ff7c04871a38c33fad9 100644 (file)
@@ -86,6 +86,7 @@
 #define MCI_CMDRESPEND         (1 << 6)
 #define MCI_CMDSENT            (1 << 7)
 #define MCI_DATAEND            (1 << 8)
+#define MCI_STARTBITERR                (1 << 9)
 #define MCI_DATABLOCKEND       (1 << 10)
 #define MCI_CMDACTIVE          (1 << 11)
 #define MCI_TXACTIVE           (1 << 12)
 #define MCI_CMDRESPENDCLR      (1 << 6)
 #define MCI_CMDSENTCLR         (1 << 7)
 #define MCI_DATAENDCLR         (1 << 8)
+#define MCI_STARTBITERRCLR     (1 << 9)
 #define MCI_DATABLOCKENDCLR    (1 << 10)
 /* Extended status bits for the ST Micro variants */
 #define MCI_ST_SDIOITC         (1 << 22)
 #define MCI_CMDRESPENDMASK     (1 << 6)
 #define MCI_CMDSENTMASK                (1 << 7)
 #define MCI_DATAENDMASK                (1 << 8)
+#define MCI_STARTBITERRMASK    (1 << 9)
 #define MCI_DATABLOCKENDMASK   (1 << 10)
 #define MCI_CMDACTIVEMASK      (1 << 11)
 #define MCI_TXACTIVEMASK       (1 << 12)
 #define MCI_IRQENABLE  \
        (MCI_CMDCRCFAILMASK|MCI_DATACRCFAILMASK|MCI_CMDTIMEOUTMASK|     \
        MCI_DATATIMEOUTMASK|MCI_TXUNDERRUNMASK|MCI_RXOVERRUNMASK|       \
-       MCI_CMDRESPENDMASK|MCI_CMDSENTMASK)
+       MCI_CMDRESPENDMASK|MCI_CMDSENTMASK|MCI_STARTBITERRMASK)
 
 /* These interrupts are directed to IRQ1 when two IRQ lines are available */
 #define MCI_IRQ1MASK \
index cc20e025932593db93deb84d3e27f05bf9ed89c0..14aa213b00da3a3b2a8d5e332528bb2d952e44a9 100644 (file)
@@ -715,13 +715,13 @@ static void mxcmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
        int burstlen, ret;
 
        /*
-        * use burstlen of 64 in 4 bit mode (--> reg value  0)
-        * use burstlen of 16 in 1 bit mode (--> reg value 16)
+        * use burstlen of 64 (16 words) in 4 bit mode (--> reg value  0)
+        * use burstlen of 16 (4 words) in 1 bit mode (--> reg value 16)
         */
        if (ios->bus_width == MMC_BUS_WIDTH_4)
-               burstlen = 64;
-       else
                burstlen = 16;
+       else
+               burstlen = 4;
 
        if (mxcmci_use_dma(host) && burstlen != host->burstlen) {
                host->burstlen = burstlen;
index 98517a373473e18b1a9f6982407831580079263a..e3bad8247fd1b237c93bb210b02480d11a1f9e94 100644 (file)
@@ -992,6 +992,7 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
         * features
         */
        dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA;
+       dev->vlan_features = dev->features;
 
        dev->irq = pdev->irq;
 
index 7d25a97d33f6fd2daffd467e9be3984dd8153bda..44e219c910daf4d33eec02d92724baa23395c229 100644 (file)
@@ -1111,7 +1111,7 @@ bnad_mbox_irq_alloc(struct bnad *bnad,
                    struct bna_intr_info *intr_info)
 {
        int             err = 0;
-       unsigned long   flags;
+       unsigned long   irq_flags = 0, flags;
        u32     irq;
        irq_handler_t   irq_handler;
 
@@ -1125,18 +1125,17 @@ bnad_mbox_irq_alloc(struct bnad *bnad,
        if (bnad->cfg_flags & BNAD_CF_MSIX) {
                irq_handler = (irq_handler_t)bnad_msix_mbox_handler;
                irq = bnad->msix_table[bnad->msix_num - 1].vector;
-               flags = 0;
                intr_info->intr_type = BNA_INTR_T_MSIX;
                intr_info->idl[0].vector = bnad->msix_num - 1;
        } else {
                irq_handler = (irq_handler_t)bnad_isr;
                irq = bnad->pcidev->irq;
-               flags = IRQF_SHARED;
+               irq_flags = IRQF_SHARED;
                intr_info->intr_type = BNA_INTR_T_INTX;
                /* intr_info->idl.vector = 0 ? */
        }
        spin_unlock_irqrestore(&bnad->bna_lock, flags);
-
+       flags = irq_flags;
        sprintf(bnad->mbox_irq_name, "%s", BNAD_NAME);
 
        /*
index f181304a7ab6464b809b0bf7fc7a436a3721f006..672f096fe0905d8a59bf6efb495922e51b031c48 100644 (file)
@@ -1015,11 +1015,10 @@ static int greth_set_mac_add(struct net_device *dev, void *p)
                return -EINVAL;
 
        memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
+       GRETH_REGSAVE(regs->esa_msb, dev->dev_addr[0] << 8 | dev->dev_addr[1]);
+       GRETH_REGSAVE(regs->esa_lsb, dev->dev_addr[2] << 24 | dev->dev_addr[3] << 16 |
+                     dev->dev_addr[4] << 8 | dev->dev_addr[5]);
 
-       GRETH_REGSAVE(regs->esa_msb, addr->sa_data[0] << 8 | addr->sa_data[1]);
-       GRETH_REGSAVE(regs->esa_lsb,
-                     addr->sa_data[2] << 24 | addr->
-                     sa_data[3] << 16 | addr->sa_data[4] << 8 | addr->sa_data[5]);
        return 0;
 }
 
index 3e5d0b6b6516133039192fa5dfd1fdf88660d81b..0d283781bc5e54a72d72a608b667f0e067b6d680 100644 (file)
@@ -692,10 +692,10 @@ static void sixpack_close(struct tty_struct *tty)
 {
        struct sixpack *sp;
 
-       write_lock(&disc_data_lock);
+       write_lock_bh(&disc_data_lock);
        sp = tty->disc_data;
        tty->disc_data = NULL;
-       write_unlock(&disc_data_lock);
+       write_unlock_bh(&disc_data_lock);
        if (!sp)
                return;
 
index 4c628393c8b157cbc09de52d902b5fa8c3d370a3..bc02968cee161f017dc3749cc6d57d8928b059d0 100644 (file)
@@ -813,10 +813,10 @@ static void mkiss_close(struct tty_struct *tty)
 {
        struct mkiss *ax;
 
-       write_lock(&disc_data_lock);
+       write_lock_bh(&disc_data_lock);
        ax = tty->disc_data;
        tty->disc_data = NULL;
-       write_unlock(&disc_data_lock);
+       write_unlock_bh(&disc_data_lock);
 
        if (!ax)
                return;
index b78be088c4ad53b54be4c61b37cb0cb7d93c9373..8f8b65af9ed5f9fcbb977d69294096dc51d66d12 100644 (file)
@@ -2360,7 +2360,8 @@ static void netdev_rx(struct net_device *dev, int *work_done, int work_to_do)
                                        PCI_DMA_FROMDEVICE);
                        } else {
                                pci_unmap_single(np->pci_dev, np->rx_dma[entry],
-                                       buflen, PCI_DMA_FROMDEVICE);
+                                                buflen + NATSEMI_PADDING,
+                                                PCI_DMA_FROMDEVICE);
                                skb_put(skb = np->rx_skbuff[entry], pkt_len);
                                np->rx_skbuff[entry] = NULL;
                        }
index d32850715f5c309350ca8b29d81267c6c33e3735..ca306fd5f588727cf235b692e8147d4a916ef164 100644 (file)
@@ -16,7 +16,7 @@
  */
 #define DRV_NAME       "qlge"
 #define DRV_STRING     "QLogic 10 Gigabit PCI-E Ethernet Driver "
-#define DRV_VERSION    "v1.00.00.27.00.00-01"
+#define DRV_VERSION    "v1.00.00.29.00.00-01"
 
 #define WQ_ADDR_ALIGN  0x3     /* 4 byte alignment */
 
@@ -1996,6 +1996,7 @@ enum {
        QL_LB_LINK_UP = 10,
        QL_FRC_COREDUMP = 11,
        QL_EEH_FATAL = 12,
+       QL_ASIC_RECOVERY = 14, /* We are in ascic recovery. */
 };
 
 /* link_status bit definitions */
index 930ae45457bbc11df0316f07ab803a347fc5b75d..6b4ff970972b493bd0c326bdef2dd0f52b133b32 100644 (file)
@@ -2152,6 +2152,10 @@ void ql_queue_asic_error(struct ql_adapter *qdev)
         * thread
         */
        clear_bit(QL_ADAPTER_UP, &qdev->flags);
+       /* Set asic recovery bit to indicate reset process that we are
+        * in fatal error recovery process rather than normal close
+        */
+       set_bit(QL_ASIC_RECOVERY, &qdev->flags);
        queue_delayed_work(qdev->workqueue, &qdev->asic_reset_work, 0);
 }
 
@@ -2166,23 +2170,20 @@ static void ql_process_chip_ae_intr(struct ql_adapter *qdev,
                return;
 
        case CAM_LOOKUP_ERR_EVENT:
-               netif_err(qdev, link, qdev->ndev,
-                         "Multiple CAM hits lookup occurred.\n");
-               netif_err(qdev, drv, qdev->ndev,
-                         "This event shouldn't occur.\n");
+               netdev_err(qdev->ndev, "Multiple CAM hits lookup occurred.\n");
+               netdev_err(qdev->ndev, "This event shouldn't occur.\n");
                ql_queue_asic_error(qdev);
                return;
 
        case SOFT_ECC_ERROR_EVENT:
-               netif_err(qdev, rx_err, qdev->ndev,
-                         "Soft ECC error detected.\n");
+               netdev_err(qdev->ndev, "Soft ECC error detected.\n");
                ql_queue_asic_error(qdev);
                break;
 
        case PCI_ERR_ANON_BUF_RD:
-               netif_err(qdev, rx_err, qdev->ndev,
-                         "PCI error occurred when reading anonymous buffers from rx_ring %d.\n",
-                         ib_ae_rsp->q_id);
+               netdev_err(qdev->ndev, "PCI error occurred when reading "
+                                       "anonymous buffers from rx_ring %d.\n",
+                                       ib_ae_rsp->q_id);
                ql_queue_asic_error(qdev);
                break;
 
@@ -2437,11 +2438,10 @@ static irqreturn_t qlge_isr(int irq, void *dev_id)
         */
        if (var & STS_FE) {
                ql_queue_asic_error(qdev);
-               netif_err(qdev, intr, qdev->ndev,
-                         "Got fatal error, STS = %x.\n", var);
+               netdev_err(qdev->ndev, "Got fatal error, STS = %x.\n", var);
                var = ql_read32(qdev, ERR_STS);
-               netif_err(qdev, intr, qdev->ndev,
-                         "Resetting chip. Error Status Register = 0x%x\n", var);
+               netdev_err(qdev->ndev, "Resetting chip. "
+                                       "Error Status Register = 0x%x\n", var);
                return IRQ_HANDLED;
        }
 
@@ -3818,11 +3818,17 @@ static int ql_adapter_reset(struct ql_adapter *qdev)
        end_jiffies = jiffies +
                max((unsigned long)1, usecs_to_jiffies(30));
 
-       /* Stop management traffic. */
-       ql_mb_set_mgmnt_traffic_ctl(qdev, MB_SET_MPI_TFK_STOP);
+       /* Check if bit is set then skip the mailbox command and
+        * clear the bit, else we are in normal reset process.
+        */
+       if (!test_bit(QL_ASIC_RECOVERY, &qdev->flags)) {
+               /* Stop management traffic. */
+               ql_mb_set_mgmnt_traffic_ctl(qdev, MB_SET_MPI_TFK_STOP);
 
-       /* Wait for the NIC and MGMNT FIFOs to empty. */
-       ql_wait_fifo_empty(qdev);
+               /* Wait for the NIC and MGMNT FIFOs to empty. */
+               ql_wait_fifo_empty(qdev);
+       } else
+               clear_bit(QL_ASIC_RECOVERY, &qdev->flags);
 
        ql_write32(qdev, RST_FO, (RST_FO_FR << 16) | RST_FO_FR);
 
index 8a72a979ee711262a613ddbe6e0fd3276b6f77d4..1f3f7b4dd6389d6bcdf4ea8c76baf66d92896f63 100644 (file)
@@ -140,6 +140,8 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
        .tpauser        = 1,
        .hw_swap        = 1,
        .no_ade         = 1,
+       .rpadir         = 1,
+       .rpadir_value   = 2 << 16,
 };
 
 #define SH_GIGA_ETH_BASE       0xfee00000
@@ -1184,8 +1186,8 @@ static void sh_eth_adjust_link(struct net_device *ndev)
                                mdp->cd->set_rate(ndev);
                }
                if (mdp->link == PHY_DOWN) {
-                       sh_eth_write(ndev, (sh_eth_read(ndev, ECMR) & ~ECMR_TXF)
-                                       | ECMR_DM, ECMR);
+                       sh_eth_write(ndev,
+                               (sh_eth_read(ndev, ECMR) & ~ECMR_TXF), ECMR);
                        new_state = 1;
                        mdp->link = phydev->link;
                }
index fa6e2ac7475a337664117cc494930877cf5dc10e..67402350d0dffaae181015f816cf9c3d67313847 100644 (file)
@@ -575,7 +575,7 @@ vmxnet3_rq_alloc_rx_buf(struct vmxnet3_rx_queue *rq, u32 ring_idx,
        struct vmxnet3_cmd_ring *ring = &rq->rx_ring[ring_idx];
        u32 val;
 
-       while (num_allocated < num_to_alloc) {
+       while (num_allocated <= num_to_alloc) {
                struct vmxnet3_rx_buf_info *rbi;
                union Vmxnet3_GenericDesc *gd;
 
@@ -621,9 +621,15 @@ vmxnet3_rq_alloc_rx_buf(struct vmxnet3_rx_queue *rq, u32 ring_idx,
 
                BUG_ON(rbi->dma_addr == 0);
                gd->rxd.addr = cpu_to_le64(rbi->dma_addr);
-               gd->dword[2] = cpu_to_le32((ring->gen << VMXNET3_RXD_GEN_SHIFT)
+               gd->dword[2] = cpu_to_le32((!ring->gen << VMXNET3_RXD_GEN_SHIFT)
                                           | val | rbi->len);
 
+               /* Fill the last buffer but dont mark it ready, or else the
+                * device will think that the queue is full */
+               if (num_allocated == num_to_alloc)
+                       break;
+
+               gd->dword[2] |= cpu_to_le32(ring->gen << VMXNET3_RXD_GEN_SHIFT);
                num_allocated++;
                vmxnet3_cmd_ring_adv_next2fill(ring);
        }
@@ -1140,6 +1146,7 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
                VMXNET3_REG_RXPROD, VMXNET3_REG_RXPROD2
        };
        u32 num_rxd = 0;
+       bool skip_page_frags = false;
        struct Vmxnet3_RxCompDesc *rcd;
        struct vmxnet3_rx_ctx *ctx = &rq->rx_ctx;
 #ifdef __BIG_ENDIAN_BITFIELD
@@ -1150,11 +1157,12 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
                          &rxComp);
        while (rcd->gen == rq->comp_ring.gen) {
                struct vmxnet3_rx_buf_info *rbi;
-               struct sk_buff *skb;
+               struct sk_buff *skb, *new_skb = NULL;
+               struct page *new_page = NULL;
                int num_to_alloc;
                struct Vmxnet3_RxDesc *rxd;
                u32 idx, ring_idx;
-
+               struct vmxnet3_cmd_ring *ring = NULL;
                if (num_rxd >= quota) {
                        /* we may stop even before we see the EOP desc of
                         * the current pkt
@@ -1165,6 +1173,7 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
                BUG_ON(rcd->rqID != rq->qid && rcd->rqID != rq->qid2);
                idx = rcd->rxdIdx;
                ring_idx = rcd->rqID < adapter->num_rx_queues ? 0 : 1;
+               ring = rq->rx_ring + ring_idx;
                vmxnet3_getRxDesc(rxd, &rq->rx_ring[ring_idx].base[idx].rxd,
                                  &rxCmdDesc);
                rbi = rq->buf_info[ring_idx] + idx;
@@ -1193,37 +1202,80 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
                                goto rcd_done;
                        }
 
+                       skip_page_frags = false;
                        ctx->skb = rbi->skb;
-                       rbi->skb = NULL;
+                       new_skb = dev_alloc_skb(rbi->len + NET_IP_ALIGN);
+                       if (new_skb == NULL) {
+                               /* Skb allocation failed, do not handover this
+                                * skb to stack. Reuse it. Drop the existing pkt
+                                */
+                               rq->stats.rx_buf_alloc_failure++;
+                               ctx->skb = NULL;
+                               rq->stats.drop_total++;
+                               skip_page_frags = true;
+                               goto rcd_done;
+                       }
 
                        pci_unmap_single(adapter->pdev, rbi->dma_addr, rbi->len,
                                         PCI_DMA_FROMDEVICE);
 
                        skb_put(ctx->skb, rcd->len);
+
+                       /* Immediate refill */
+                       new_skb->dev = adapter->netdev;
+                       skb_reserve(new_skb, NET_IP_ALIGN);
+                       rbi->skb = new_skb;
+                       rbi->dma_addr = pci_map_single(adapter->pdev,
+                                       rbi->skb->data, rbi->len,
+                                       PCI_DMA_FROMDEVICE);
+                       rxd->addr = cpu_to_le64(rbi->dma_addr);
+                       rxd->len = rbi->len;
+
                } else {
-                       BUG_ON(ctx->skb == NULL);
+                       BUG_ON(ctx->skb == NULL && !skip_page_frags);
+
                        /* non SOP buffer must be type 1 in most cases */
-                       if (rbi->buf_type == VMXNET3_RX_BUF_PAGE) {
-                               BUG_ON(rxd->btype != VMXNET3_RXD_BTYPE_BODY);
+                       BUG_ON(rbi->buf_type != VMXNET3_RX_BUF_PAGE);
+                       BUG_ON(rxd->btype != VMXNET3_RXD_BTYPE_BODY);
 
-                               if (rcd->len) {
-                                       pci_unmap_page(adapter->pdev,
-                                                      rbi->dma_addr, rbi->len,
-                                                      PCI_DMA_FROMDEVICE);
+                       /* If an sop buffer was dropped, skip all
+                        * following non-sop fragments. They will be reused.
+                        */
+                       if (skip_page_frags)
+                               goto rcd_done;
 
-                                       vmxnet3_append_frag(ctx->skb, rcd, rbi);
-                                       rbi->page = NULL;
-                               }
-                       } else {
-                               /*
-                                * The only time a non-SOP buffer is type 0 is
-                                * when it's EOP and error flag is raised, which
-                                * has already been handled.
+                       new_page = alloc_page(GFP_ATOMIC);
+                       if (unlikely(new_page == NULL)) {
+                               /* Replacement page frag could not be allocated.
+                                * Reuse this page. Drop the pkt and free the
+                                * skb which contained this page as a frag. Skip
+                                * processing all the following non-sop frags.
                                 */
-                               BUG_ON(true);
+                               rq->stats.rx_buf_alloc_failure++;
+                               dev_kfree_skb(ctx->skb);
+                               ctx->skb = NULL;
+                               skip_page_frags = true;
+                               goto rcd_done;
+                       }
+
+                       if (rcd->len) {
+                               pci_unmap_page(adapter->pdev,
+                                              rbi->dma_addr, rbi->len,
+                                              PCI_DMA_FROMDEVICE);
+
+                               vmxnet3_append_frag(ctx->skb, rcd, rbi);
                        }
+
+                       /* Immediate refill */
+                       rbi->page = new_page;
+                       rbi->dma_addr = pci_map_page(adapter->pdev, rbi->page,
+                                                    0, PAGE_SIZE,
+                                                    PCI_DMA_FROMDEVICE);
+                       rxd->addr = cpu_to_le64(rbi->dma_addr);
+                       rxd->len = rbi->len;
                }
 
+
                skb = ctx->skb;
                if (rcd->eop) {
                        skb->len += skb->data_len;
@@ -1244,26 +1296,27 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
                }
 
 rcd_done:
-               /* device may skip some rx descs */
-               rq->rx_ring[ring_idx].next2comp = idx;
-               VMXNET3_INC_RING_IDX_ONLY(rq->rx_ring[ring_idx].next2comp,
-                                         rq->rx_ring[ring_idx].size);
-
-               /* refill rx buffers frequently to avoid starving the h/w */
-               num_to_alloc = vmxnet3_cmd_ring_desc_avail(rq->rx_ring +
-                                                          ring_idx);
-               if (unlikely(num_to_alloc > VMXNET3_RX_ALLOC_THRESHOLD(rq,
-                                                       ring_idx, adapter))) {
-                       vmxnet3_rq_alloc_rx_buf(rq, ring_idx, num_to_alloc,
-                                               adapter);
-
-                       /* if needed, update the register */
-                       if (unlikely(rq->shared->updateRxProd)) {
-                               VMXNET3_WRITE_BAR0_REG(adapter,
-                                       rxprod_reg[ring_idx] + rq->qid * 8,
-                                       rq->rx_ring[ring_idx].next2fill);
-                               rq->uncommitted[ring_idx] = 0;
-                       }
+               /* device may have skipped some rx descs */
+               ring->next2comp = idx;
+               num_to_alloc = vmxnet3_cmd_ring_desc_avail(ring);
+               ring = rq->rx_ring + ring_idx;
+               while (num_to_alloc) {
+                       vmxnet3_getRxDesc(rxd, &ring->base[ring->next2fill].rxd,
+                                         &rxCmdDesc);
+                       BUG_ON(!rxd->addr);
+
+                       /* Recv desc is ready to be used by the device */
+                       rxd->gen = ring->gen;
+                       vmxnet3_cmd_ring_adv_next2fill(ring);
+                       num_to_alloc--;
+               }
+
+               /* if needed, update the register */
+               if (unlikely(rq->shared->updateRxProd)) {
+                       VMXNET3_WRITE_BAR0_REG(adapter,
+                               rxprod_reg[ring_idx] + rq->qid * 8,
+                               ring->next2fill);
+                       rq->uncommitted[ring_idx] = 0;
                }
 
                vmxnet3_comp_ring_adv_next2proc(&rq->comp_ring);
@@ -2894,6 +2947,7 @@ vmxnet3_probe_device(struct pci_dev *pdev,
        else
 #endif
                num_rx_queues = 1;
+       num_rx_queues = rounddown_pow_of_two(num_rx_queues);
 
        if (enable_mq)
                num_tx_queues = min(VMXNET3_DEVICE_MAX_TX_QUEUES,
@@ -2901,6 +2955,7 @@ vmxnet3_probe_device(struct pci_dev *pdev,
        else
                num_tx_queues = 1;
 
+       num_tx_queues = rounddown_pow_of_two(num_tx_queues);
        netdev = alloc_etherdev_mq(sizeof(struct vmxnet3_adapter),
                                   max(num_tx_queues, num_rx_queues));
        printk(KERN_INFO "# of Tx queues : %d, # of Rx queues : %d\n",
@@ -3085,6 +3140,7 @@ vmxnet3_remove_device(struct pci_dev *pdev)
        else
 #endif
                num_rx_queues = 1;
+       num_rx_queues = rounddown_pow_of_two(num_rx_queues);
 
        cancel_work_sync(&adapter->work);
 
index f50d36fdf4056a9774434a9fb51eebd937b53117..e08d75e3f170a3ae523957fde0ae80b1e60e3a20 100644 (file)
@@ -55,6 +55,7 @@
 #include <linux/if_vlan.h>
 #include <linux/if_arp.h>
 #include <linux/inetdevice.h>
+#include <linux/log2.h>
 
 #include "vmxnet3_defs.h"
 
 /*
  * Version numbers
  */
-#define VMXNET3_DRIVER_VERSION_STRING   "1.1.9.0-k"
+#define VMXNET3_DRIVER_VERSION_STRING   "1.1.18.0-k"
 
 /* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */
-#define VMXNET3_DRIVER_VERSION_NUM      0x01010900
+#define VMXNET3_DRIVER_VERSION_NUM      0x01011200
 
 #if defined(CONFIG_PCI_MSI)
        /* RSS only makes sense if MSI-X is supported. */
index 62172d5857239549ba6fa233df721096773fd707..f82383b3ed30c11ae4bceaae6d8e0c5028ba5f01 100644 (file)
@@ -107,10 +107,13 @@ ath5k_hw_setup_2word_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc,
                case AR5K_PKT_TYPE_BEACON:
                case AR5K_PKT_TYPE_PROBE_RESP:
                        frame_type = AR5K_AR5210_TX_DESC_FRAME_TYPE_NO_DELAY;
+                       break;
                case AR5K_PKT_TYPE_PIFS:
                        frame_type = AR5K_AR5210_TX_DESC_FRAME_TYPE_PIFS;
+                       break;
                default:
                        frame_type = type;
+                       break;
                }
 
                tx_ctl->tx_control_0 |=
index 1fef84f87c78f5196e57ff5c9a3ad78ca7fed50a..392771f937599d7a9731589d018d505a66c4255c 100644 (file)
@@ -691,14 +691,12 @@ ath5k_eeprom_free_pcal_info(struct ath5k_hw *ah, int mode)
                if (!chinfo[pier].pd_curves)
                        continue;
 
-               for (pdg = 0; pdg < ee->ee_pd_gains[mode]; pdg++) {
+               for (pdg = 0; pdg < AR5K_EEPROM_N_PD_CURVES; pdg++) {
                        struct ath5k_pdgain_info *pd =
                                        &chinfo[pier].pd_curves[pdg];
 
-                       if (pd != NULL) {
-                               kfree(pd->pd_step);
-                               kfree(pd->pd_pwr);
-                       }
+                       kfree(pd->pd_step);
+                       kfree(pd->pd_pwr);
                }
 
                kfree(chinfo[pier].pd_curves);
index b8cbfc7072137064f443ad0f137b9ccba99c85f4..3bad0b2cf9a3f6517525950a3fe55411d8d79fb0 100644 (file)
@@ -278,6 +278,12 @@ static int ath_pci_suspend(struct device *device)
 
        ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1);
 
+       /* The device has to be moved to FULLSLEEP forcibly.
+        * Otherwise the chip never moved to full sleep,
+        * when no interface is up.
+        */
+       ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_FULL_SLEEP);
+
        return 0;
 }
 
index 61d4a11f566b4f9e9864f1109369eade4634c50a..2a88e73bb39cf51c3cea461160d2d0266fcda829 100644 (file)
@@ -36,6 +36,7 @@
 #include <net/mac80211.h>
 #include <linux/etherdevice.h>
 #include <asm/unaligned.h>
+#include <linux/stringify.h>
 
 #include "iwl-eeprom.h"
 #include "iwl-dev.h"
 #define IWL100_UCODE_API_MIN 5
 
 #define IWL1000_FW_PRE "iwlwifi-1000-"
-#define IWL1000_MODULE_FIRMWARE(api) IWL1000_FW_PRE #api ".ucode"
+#define IWL1000_MODULE_FIRMWARE(api) IWL1000_FW_PRE __stringify(api) ".ucode"
 
 #define IWL100_FW_PRE "iwlwifi-100-"
-#define IWL100_MODULE_FIRMWARE(api) IWL100_FW_PRE #api ".ucode"
+#define IWL100_MODULE_FIRMWARE(api) IWL100_FW_PRE __stringify(api) ".ucode"
 
 
 /*
index 2282279cffc454c5089277a6cb1f279a60ad2dab..3df76f53a41b7be0e75b880b9f94f9d9fdcca508 100644 (file)
@@ -36,6 +36,7 @@
 #include <net/mac80211.h>
 #include <linux/etherdevice.h>
 #include <asm/unaligned.h>
+#include <linux/stringify.h>
 
 #include "iwl-eeprom.h"
 #include "iwl-dev.h"
 #define IWL105_UCODE_API_MIN 5
 
 #define IWL2030_FW_PRE "iwlwifi-2030-"
-#define IWL2030_MODULE_FIRMWARE(api) IWL2030_FW_PRE #api ".ucode"
+#define IWL2030_MODULE_FIRMWARE(api) IWL2030_FW_PRE __stringify(api) ".ucode"
 
 #define IWL2000_FW_PRE "iwlwifi-2000-"
-#define IWL2000_MODULE_FIRMWARE(api) IWL2000_FW_PRE #api ".ucode"
+#define IWL2000_MODULE_FIRMWARE(api) IWL2000_FW_PRE __stringify(api) ".ucode"
 
 #define IWL105_FW_PRE "iwlwifi-105-"
-#define IWL105_MODULE_FIRMWARE(api) IWL105_FW_PRE #api ".ucode"
+#define IWL105_MODULE_FIRMWARE(api) IWL105_FW_PRE __stringify(api) ".ucode"
 
 static void iwl2000_set_ct_threshold(struct iwl_priv *priv)
 {
index f99f9c1933524e6d06af64f191341fd67057dbce..e816c27db79455214dce66a833ef5fe30cfdcf0b 100644 (file)
@@ -37,6 +37,7 @@
 #include <net/mac80211.h>
 #include <linux/etherdevice.h>
 #include <asm/unaligned.h>
+#include <linux/stringify.h>
 
 #include "iwl-eeprom.h"
 #include "iwl-dev.h"
 #define IWL5150_UCODE_API_MIN 1
 
 #define IWL5000_FW_PRE "iwlwifi-5000-"
-#define IWL5000_MODULE_FIRMWARE(api) IWL5000_FW_PRE #api ".ucode"
+#define IWL5000_MODULE_FIRMWARE(api) IWL5000_FW_PRE __stringify(api) ".ucode"
 
 #define IWL5150_FW_PRE "iwlwifi-5150-"
-#define IWL5150_MODULE_FIRMWARE(api) IWL5150_FW_PRE #api ".ucode"
+#define IWL5150_MODULE_FIRMWARE(api) IWL5150_FW_PRE __stringify(api) ".ucode"
 
 /* NIC configuration for 5000 series */
 static void iwl5000_nic_config(struct iwl_priv *priv)
index fbe565c816e32ce367c09dad8ef5762e4c819d86..5b150bc70b0654a1b27641516062aa004235ad47 100644 (file)
@@ -36,6 +36,7 @@
 #include <net/mac80211.h>
 #include <linux/etherdevice.h>
 #include <asm/unaligned.h>
+#include <linux/stringify.h>
 
 #include "iwl-eeprom.h"
 #include "iwl-dev.h"
 #define IWL6000G2_UCODE_API_MIN 4
 
 #define IWL6000_FW_PRE "iwlwifi-6000-"
-#define IWL6000_MODULE_FIRMWARE(api) IWL6000_FW_PRE #api ".ucode"
+#define IWL6000_MODULE_FIRMWARE(api) IWL6000_FW_PRE __stringify(api) ".ucode"
 
 #define IWL6050_FW_PRE "iwlwifi-6050-"
-#define IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE #api ".ucode"
+#define IWL6050_MODULE_FIRMWARE(api) IWL6050_FW_PRE __stringify(api) ".ucode"
 
 #define IWL6005_FW_PRE "iwlwifi-6000g2a-"
-#define IWL6005_MODULE_FIRMWARE(api) IWL6005_FW_PRE #api ".ucode"
+#define IWL6005_MODULE_FIRMWARE(api) IWL6005_FW_PRE __stringify(api) ".ucode"
 
 #define IWL6030_FW_PRE "iwlwifi-6000g2b-"
-#define IWL6030_MODULE_FIRMWARE(api) IWL6030_FW_PRE #api ".ucode"
+#define IWL6030_MODULE_FIRMWARE(api) IWL6030_FW_PRE __stringify(api) ".ucode"
 
 static void iwl6000_set_ct_threshold(struct iwl_priv *priv)
 {
index 213c80c6a6682d000efff4b0d356cb5bafa691d4..45cc51c9c93ec4caf312fcc631b35cbf13b7e001 100644 (file)
@@ -1763,6 +1763,7 @@ int iwl_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
        struct iwl_rxon_context *ctx = iwl_rxon_ctx_from_vif(vif);
        struct iwl_rxon_context *bss_ctx = &priv->contexts[IWL_RXON_CTX_BSS];
        struct iwl_rxon_context *tmp;
+       enum nl80211_iftype newviftype = newtype;
        u32 interface_modes;
        int err;
 
@@ -1818,7 +1819,7 @@ int iwl_mac_change_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 
        /* success */
        iwl_teardown_interface(priv, vif, true);
-       vif->type = newtype;
+       vif->type = newviftype;
        vif->p2p = newp2p;
        err = iwl_setup_interface(priv, ctx);
        WARN_ON(err);
index 686e176b5ebdeb80c992860b49e2e64150892ca0..137dba95b1ad765753425ec3afafb69949d2d16e 100644 (file)
@@ -126,7 +126,7 @@ static inline u8 iwl_tfd_get_num_tbs(struct iwl_tfd *tfd)
 }
 
 static void iwlagn_unmap_tfd(struct iwl_priv *priv, struct iwl_cmd_meta *meta,
-                            struct iwl_tfd *tfd)
+                            struct iwl_tfd *tfd, int dma_dir)
 {
        struct pci_dev *dev = priv->pci_dev;
        int i;
@@ -151,7 +151,7 @@ static void iwlagn_unmap_tfd(struct iwl_priv *priv, struct iwl_cmd_meta *meta,
        /* Unmap chunks, if any. */
        for (i = 1; i < num_tbs; i++)
                pci_unmap_single(dev, iwl_tfd_tb_get_addr(tfd, i),
-                               iwl_tfd_tb_get_len(tfd, i), PCI_DMA_TODEVICE);
+                               iwl_tfd_tb_get_len(tfd, i), dma_dir);
 }
 
 /**
@@ -167,7 +167,8 @@ void iwlagn_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq)
        struct iwl_tfd *tfd_tmp = txq->tfds;
        int index = txq->q.read_ptr;
 
-       iwlagn_unmap_tfd(priv, &txq->meta[index], &tfd_tmp[index]);
+       iwlagn_unmap_tfd(priv, &txq->meta[index], &tfd_tmp[index],
+                        PCI_DMA_TODEVICE);
 
        /* free SKB */
        if (txq->txb) {
@@ -310,9 +311,7 @@ void iwl_cmd_queue_unmap(struct iwl_priv *priv)
                i = get_cmd_index(q, q->read_ptr);
 
                if (txq->meta[i].flags & CMD_MAPPED) {
-                       pci_unmap_single(priv->pci_dev,
-                                        dma_unmap_addr(&txq->meta[i], mapping),
-                                        dma_unmap_len(&txq->meta[i], len),
+                       iwlagn_unmap_tfd(priv, &txq->meta[i], &txq->tfds[i],
                                         PCI_DMA_BIDIRECTIONAL);
                        txq->meta[i].flags = 0;
                }
@@ -535,12 +534,7 @@ out_free_arrays:
 void iwl_tx_queue_reset(struct iwl_priv *priv, struct iwl_tx_queue *txq,
                        int slots_num, u32 txq_id)
 {
-       int actual_slots = slots_num;
-
-       if (txq_id == priv->cmd_queue)
-               actual_slots++;
-
-       memset(txq->meta, 0, sizeof(struct iwl_cmd_meta) * actual_slots);
+       memset(txq->meta, 0, sizeof(struct iwl_cmd_meta) * slots_num);
 
        txq->need_update = 0;
 
@@ -700,10 +694,11 @@ int iwl_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd)
                if (!(cmd->dataflags[i] & IWL_HCMD_DFL_NOCOPY))
                        continue;
                phys_addr = pci_map_single(priv->pci_dev, (void *)cmd->data[i],
-                                          cmd->len[i], PCI_DMA_TODEVICE);
+                                          cmd->len[i], PCI_DMA_BIDIRECTIONAL);
                if (pci_dma_mapping_error(priv->pci_dev, phys_addr)) {
                        iwlagn_unmap_tfd(priv, out_meta,
-                                        &txq->tfds[q->write_ptr]);
+                                        &txq->tfds[q->write_ptr],
+                                        PCI_DMA_BIDIRECTIONAL);
                        idx = -ENOMEM;
                        goto out;
                }
@@ -807,7 +802,7 @@ void iwl_tx_cmd_complete(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
        cmd = txq->cmd[cmd_index];
        meta = &txq->meta[cmd_index];
 
-       iwlagn_unmap_tfd(priv, meta, &txq->tfds[index]);
+       iwlagn_unmap_tfd(priv, meta, &txq->tfds[index], PCI_DMA_BIDIRECTIONAL);
 
        /* Input error checking is done when commands are added to queue. */
        if (meta->flags & CMD_WANT_SKB) {
index 2c5b9b9912795c880faa882bbf4a8d9523037530..692671b11667381516b9d95101e26415c10e35fc 100644 (file)
@@ -3483,6 +3483,8 @@ static int __init pci_setup(char *str)
                                pci_no_msi();
                        } else if (!strcmp(str, "noaer")) {
                                pci_no_aer();
+                       } else if (!strncmp(str, "realloc", 7)) {
+                               pci_realloc();
                        } else if (!strcmp(str, "nodomains")) {
                                pci_no_domains();
                        } else if (!strncmp(str, "cbiosize=", 9)) {
index 731e20265ace428114b4ba217470fb5868908ad1..3a39bf1f1e2c11a8ee6cd094a8f43f931a256e6b 100644 (file)
@@ -146,6 +146,8 @@ static inline void pci_no_msi(void) { }
 static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { }
 #endif
 
+extern void pci_realloc(void);
+
 static inline int pci_no_d1d2(struct pci_dev *dev)
 {
        unsigned int parent_dstates = 0;
index 1e9e5a5b8c81909b951ac4b4a058b203e956f3e4..9995842e45b5cb75fcc296bb668df3638ded8088 100644 (file)
@@ -47,6 +47,13 @@ struct resource_list_x {
        (head)->next = NULL;                            \
 } while (0)
 
+int pci_realloc_enable = 0;
+#define pci_realloc_enabled() pci_realloc_enable
+void pci_realloc(void)
+{
+       pci_realloc_enable = 1;
+}
+
 /**
  * add_to_list() - add a new resource tracker to the list
  * @head:      Head of the list
@@ -1025,6 +1032,7 @@ static int __init pci_get_max_depth(void)
        return depth;
 }
 
+
 /*
  * first try will not touch pci bridge res
  * second  and later try will clear small leaf bridge res
@@ -1068,6 +1076,13 @@ again:
        /* any device complain? */
        if (!head.next)
                goto enable_and_dump;
+
+       /* don't realloc if asked to do so */
+       if (!pci_realloc_enabled()) {
+               free_list(resource_list_x, &head);
+               goto enable_and_dump;
+       }
+
        failed_type = 0;
        for (list = head.next; list;) {
                failed_type |= list->flags;
index 005417bd429e815f24cce88c23b4f53ef46afc74..e1c4938b301bbcdacbcc1303e9b8cde5bf288585 100644 (file)
@@ -1156,9 +1156,9 @@ static acpi_status wmid3_set_device_status(u32 value, u16 device)
        struct wmid3_gds_input_param params = {
                .function_num = 0x1,
                .hotkey_number = 0x01,
-               .devices = ACER_WMID3_GDS_WIRELESS &
-                               ACER_WMID3_GDS_THREEG &
-                               ACER_WMID3_GDS_WIMAX &
+               .devices = ACER_WMID3_GDS_WIRELESS |
+                               ACER_WMID3_GDS_THREEG |
+                               ACER_WMID3_GDS_WIMAX |
                                ACER_WMID3_GDS_BLUETOOTH,
        };
        struct acpi_buffer input = {
@@ -1445,6 +1445,8 @@ static void acer_wmi_notify(u32 value, void *context)
        union acpi_object *obj;
        struct event_return_value return_value;
        acpi_status status;
+       u16 device_state;
+       const struct key_entry *key;
 
        status = wmi_get_event_data(value, &response);
        if (status != AE_OK) {
@@ -1472,23 +1474,32 @@ static void acer_wmi_notify(u32 value, void *context)
 
        switch (return_value.function) {
        case WMID_HOTKEY_EVENT:
-               if (return_value.device_state) {
-                       u16 device_state = return_value.device_state;
-                       pr_debug("device state: 0x%x\n", device_state);
-                       if (has_cap(ACER_CAP_WIRELESS))
-                               rfkill_set_sw_state(wireless_rfkill,
-                               !(device_state & ACER_WMID3_GDS_WIRELESS));
-                       if (has_cap(ACER_CAP_BLUETOOTH))
-                               rfkill_set_sw_state(bluetooth_rfkill,
-                               !(device_state & ACER_WMID3_GDS_BLUETOOTH));
-                       if (has_cap(ACER_CAP_THREEG))
-                               rfkill_set_sw_state(threeg_rfkill,
-                               !(device_state & ACER_WMID3_GDS_THREEG));
-               }
-               if (!sparse_keymap_report_event(acer_wmi_input_dev,
-                               return_value.key_num, 1, true))
+               device_state = return_value.device_state;
+               pr_debug("device state: 0x%x\n", device_state);
+
+               key = sparse_keymap_entry_from_scancode(acer_wmi_input_dev,
+                                                       return_value.key_num);
+               if (!key) {
                        pr_warn("Unknown key number - 0x%x\n",
                                return_value.key_num);
+               } else {
+                       switch (key->keycode) {
+                       case KEY_WLAN:
+                       case KEY_BLUETOOTH:
+                               if (has_cap(ACER_CAP_WIRELESS))
+                                       rfkill_set_sw_state(wireless_rfkill,
+                                               !(device_state & ACER_WMID3_GDS_WIRELESS));
+                               if (has_cap(ACER_CAP_THREEG))
+                                       rfkill_set_sw_state(threeg_rfkill,
+                                               !(device_state & ACER_WMID3_GDS_THREEG));
+                               if (has_cap(ACER_CAP_BLUETOOTH))
+                                       rfkill_set_sw_state(bluetooth_rfkill,
+                                               !(device_state & ACER_WMID3_GDS_BLUETOOTH));
+                               break;
+                       }
+                       sparse_keymap_report_entry(acer_wmi_input_dev, key,
+                                                  1, true);
+               }
                break;
        default:
                pr_warn("Unknown function number - %d - %d\n",
index 00460cb9587b753119696647844759200a1bc8c8..3c7857c71a230e12b2fc1bac6446c08af0e0c893 100644 (file)
@@ -1025,6 +1025,7 @@ static int asus_wmi_backlight_init(struct asus_wmi *asus)
                return power;
 
        memset(&props, 0, sizeof(struct backlight_properties));
+       props.type = BACKLIGHT_PLATFORM;
        props.max_brightness = max;
        bd = backlight_device_register(asus->driver->name,
                                       &asus->platform_device->dev, asus,
index 3f204fde1b029e6433df6ad7e4fc0e6d26ab363a..8877b836d27cf4bde02014d9a37763a3672bb4a0 100644 (file)
@@ -1030,8 +1030,10 @@ static int __devinit compal_probe(struct platform_device *pdev)
        initialize_fan_control_data(data);
 
        err = sysfs_create_group(&pdev->dev.kobj, &compal_attribute_group);
-       if (err)
+       if (err) {
+               kfree(data);
                return err;
+       }
 
        data->hwmon_dev = hwmon_device_register(&pdev->dev);
        if (IS_ERR(data->hwmon_dev)) {
index d3841de6a8cf199ec08b24bd85f50a0af0490d37..e39ab1d3ed878b6044a391db4be16b58224da0d2 100644 (file)
@@ -292,12 +292,9 @@ static int dell_rfkill_set(void *data, bool blocked)
        dell_send_request(buffer, 17, 11);
 
        /* If the hardware switch controls this radio, and the hardware
-          switch is disabled, don't allow changing the software state.
-          If the hardware switch is reported as not supported, always
-          fire the SMI to toggle the killswitch. */
+          switch is disabled, don't allow changing the software state */
        if ((hwswitch_state & BIT(hwswitch_bit)) &&
-           !(buffer->output[1] & BIT(16)) &&
-           (buffer->output[1] & BIT(0))) {
+           !(buffer->output[1] & BIT(16))) {
                ret = -EINVAL;
                goto out;
        }
@@ -403,23 +400,6 @@ static const struct file_operations dell_debugfs_fops = {
 
 static void dell_update_rfkill(struct work_struct *ignored)
 {
-       int status;
-
-       get_buffer();
-       dell_send_request(buffer, 17, 11);
-       status = buffer->output[1];
-       release_buffer();
-
-       /* if hardware rfkill is not supported, set it explicitly */
-       if (!(status & BIT(0))) {
-               if (wifi_rfkill)
-                       dell_rfkill_set((void *)1, !((status & BIT(17)) >> 17));
-               if (bluetooth_rfkill)
-                       dell_rfkill_set((void *)2, !((status & BIT(18)) >> 18));
-               if (wwan_rfkill)
-                       dell_rfkill_set((void *)3, !((status & BIT(19)) >> 19));
-       }
-
        if (wifi_rfkill)
                dell_rfkill_query(wifi_rfkill, (void *)1);
        if (bluetooth_rfkill)
@@ -560,11 +540,11 @@ static int dell_get_intensity(struct backlight_device *bd)
        else
                dell_send_request(buffer, 0, 1);
 
+       ret = buffer->output[1];
+
 out:
        release_buffer();
-       if (ret)
-               return ret;
-       return buffer->output[1];
+       return ret;
 }
 
 static const struct backlight_ops dell_ops = {
index f94017bcdd6e9c8b10d80c70f7fd56ed27788d83..e2faa3cbb792e3f154d83db97ca0f9f45ed44402 100644 (file)
@@ -207,6 +207,7 @@ static int hp_wmi_perform_query(int query, int write, void *buffer,
        };
        struct acpi_buffer input = { sizeof(struct bios_args), &args };
        struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
+       u32 rc;
 
        if (WARN_ON(insize > sizeof(args.data)))
                return -EINVAL;
@@ -224,13 +225,13 @@ static int hp_wmi_perform_query(int query, int write, void *buffer,
        }
 
        bios_return = (struct bios_return *)obj->buffer.pointer;
+       rc = bios_return->return_code;
 
-       if (bios_return->return_code) {
-               if (bios_return->return_code != HPWMI_RET_UNKNOWN_CMDTYPE)
-                       pr_warn("query 0x%x returned error 0x%x\n",
-                               query, bios_return->return_code);
+       if (rc) {
+               if (rc != HPWMI_RET_UNKNOWN_CMDTYPE)
+                       pr_warn("query 0x%x returned error 0x%x\n", query, rc);
                kfree(obj);
-               return bios_return->return_code;
+               return rc;
        }
 
        if (!outsize) {
index e936364a609d452f18534bf02f1e57647ffde97c..7f88c7923fc6ab18ad8bc674da4ee96411bbf2fc 100644 (file)
@@ -250,6 +250,7 @@ static int oaktrail_backlight_init(void)
        struct backlight_properties props;
 
        memset(&props, 0, sizeof(struct backlight_properties));
+       props.type = BACKLIGHT_PLATFORM;
        props.max_brightness = OT_EC_BL_BRIGHTNESS_MAX;
        bd = backlight_device_register(DRIVER_NAME,
                                       &oaktrail_device->dev, NULL,
index 77f6e707a2a9a43d4c08777f1a97e42dd49a11a0..26c5b117df22d5011c46c64f2f588f83dd7ed58c 100644 (file)
@@ -184,6 +184,10 @@ enum tpacpi_hkey_event_t {
 
        /* Misc bay events */
        TP_HKEY_EV_OPTDRV_EJ            = 0x3006, /* opt. drive tray ejected */
+       TP_HKEY_EV_HOTPLUG_DOCK         = 0x4010, /* docked into hotplug dock
+                                                    or port replicator */
+       TP_HKEY_EV_HOTPLUG_UNDOCK       = 0x4011, /* undocked from hotplug
+                                                    dock or port replicator */
 
        /* User-interface events */
        TP_HKEY_EV_LID_CLOSE            = 0x5001, /* laptop lid closed */
@@ -194,6 +198,10 @@ enum tpacpi_hkey_event_t {
        TP_HKEY_EV_PEN_REMOVED          = 0x500c, /* tablet pen removed */
        TP_HKEY_EV_BRGHT_CHANGED        = 0x5010, /* backlight control event */
 
+       /* Key-related user-interface events */
+       TP_HKEY_EV_KEY_NUMLOCK          = 0x6000, /* NumLock key pressed */
+       TP_HKEY_EV_KEY_FN               = 0x6005, /* Fn key pressed? E420 */
+
        /* Thermal events */
        TP_HKEY_EV_ALARM_BAT_HOT        = 0x6011, /* battery too hot */
        TP_HKEY_EV_ALARM_BAT_XHOT       = 0x6012, /* battery critically hot */
@@ -201,6 +209,10 @@ enum tpacpi_hkey_event_t {
        TP_HKEY_EV_ALARM_SENSOR_XHOT    = 0x6022, /* sensor critically hot */
        TP_HKEY_EV_THM_TABLE_CHANGED    = 0x6030, /* thermal table changed */
 
+       TP_HKEY_EV_UNK_6040             = 0x6040, /* Related to AC change?
+                                                    some sort of APM hint,
+                                                    W520 */
+
        /* Misc */
        TP_HKEY_EV_RFKILL_CHANGED       = 0x7000, /* rfkill switch changed */
 };
@@ -3513,6 +3525,34 @@ static bool hotkey_notify_wakeup(const u32 hkey,
        return true;
 }
 
+static bool hotkey_notify_dockevent(const u32 hkey,
+                                bool *send_acpi_ev,
+                                bool *ignore_acpi_ev)
+{
+       /* 0x4000-0x4FFF: dock-related events */
+       *send_acpi_ev = true;
+       *ignore_acpi_ev = false;
+
+       switch (hkey) {
+       case TP_HKEY_EV_UNDOCK_ACK:
+               /* ACPI undock operation completed after wakeup */
+               hotkey_autosleep_ack = 1;
+               pr_info("undocked\n");
+               hotkey_wakeup_hotunplug_complete_notify_change();
+               return true;
+
+       case TP_HKEY_EV_HOTPLUG_DOCK: /* docked to port replicator */
+               pr_info("docked into hotplug port replicator\n");
+               return true;
+       case TP_HKEY_EV_HOTPLUG_UNDOCK: /* undocked from port replicator */
+               pr_info("undocked from hotplug port replicator\n");
+               return true;
+
+       default:
+               return false;
+       }
+}
+
 static bool hotkey_notify_usrevent(const u32 hkey,
                                 bool *send_acpi_ev,
                                 bool *ignore_acpi_ev)
@@ -3547,13 +3587,13 @@ static bool hotkey_notify_usrevent(const u32 hkey,
 
 static void thermal_dump_all_sensors(void);
 
-static bool hotkey_notify_thermal(const u32 hkey,
+static bool hotkey_notify_6xxx(const u32 hkey,
                                 bool *send_acpi_ev,
                                 bool *ignore_acpi_ev)
 {
        bool known = true;
 
-       /* 0x6000-0x6FFF: thermal alarms */
+       /* 0x6000-0x6FFF: thermal alarms/notices and keyboard events */
        *send_acpi_ev = true;
        *ignore_acpi_ev = false;
 
@@ -3582,8 +3622,17 @@ static bool hotkey_notify_thermal(const u32 hkey,
                         "a sensor reports something is extremely hot!\n");
                /* recommended action: immediate sleep/hibernate */
                break;
+
+       case TP_HKEY_EV_KEY_NUMLOCK:
+       case TP_HKEY_EV_KEY_FN:
+               /* key press events, we just ignore them as long as the EC
+                * is still reporting them in the normal keyboard stream */
+               *send_acpi_ev = false;
+               *ignore_acpi_ev = true;
+               return true;
+
        default:
-               pr_alert("THERMAL ALERT: unknown thermal alarm received\n");
+               pr_warn("unknown possible thermal alarm or keyboard event received\n");
                known = false;
        }
 
@@ -3652,15 +3701,9 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
                        }
                        break;
                case 4:
-                       /* 0x4000-0x4FFF: dock-related wakeups */
-                       if (hkey == TP_HKEY_EV_UNDOCK_ACK) {
-                               hotkey_autosleep_ack = 1;
-                               pr_info("undocked\n");
-                               hotkey_wakeup_hotunplug_complete_notify_change();
-                               known_ev = true;
-                       } else {
-                               known_ev = false;
-                       }
+                       /* 0x4000-0x4FFF: dock-related events */
+                       known_ev = hotkey_notify_dockevent(hkey, &send_acpi_ev,
+                                               &ignore_acpi_ev);
                        break;
                case 5:
                        /* 0x5000-0x5FFF: human interface helpers */
@@ -3668,8 +3711,9 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
                                                 &ignore_acpi_ev);
                        break;
                case 6:
-                       /* 0x6000-0x6FFF: thermal alarms */
-                       known_ev = hotkey_notify_thermal(hkey, &send_acpi_ev,
+                       /* 0x6000-0x6FFF: thermal alarms/notices and
+                        *                keyboard events */
+                       known_ev = hotkey_notify_6xxx(hkey, &send_acpi_ev,
                                                 &ignore_acpi_ev);
                        break;
                case 7:
index e5f7b8fe51f4b74fe4a71599043e4b396823ee19..2bb8f451cc067302dcd4145c9de157aaf10cbd6d 100644 (file)
@@ -266,7 +266,7 @@ static struct regulator_ops db8500_regulator_switch_ops = {
  * Regulator information
  */
 static struct db8500_regulator_info
-               db8500_regulator_info[DB8500_NUM_REGULATORS] = {
+db8500_regulator_info[DB8500_NUM_REGULATORS] = {
        [DB8500_REGULATOR_VAPE] = {
                .desc = {
                        .name   = "db8500-vape",
@@ -492,11 +492,9 @@ static int __devinit db8500_regulator_probe(struct platform_device *pdev)
                                info->desc.name, err);
 
                        /* if failing, unregister all earlier regulators */
-                       i--;
-                       while (i >= 0) {
+                       while (--i >= 0) {
                                info = &db8500_regulator_info[i];
                                regulator_unregister(info->rdev);
-                               i--;
                        }
                        return err;
                }
@@ -536,13 +534,7 @@ static struct platform_driver db8500_regulator_driver = {
 
 static int __init db8500_regulator_init(void)
 {
-       int ret;
-
-       ret = platform_driver_register(&db8500_regulator_driver);
-       if (ret < 0)
-               return -ENODEV;
-
-       return 0;
+       return platform_driver_register(&db8500_regulator_driver);
 }
 
 static void __exit db8500_regulator_exit(void)
index daff7fd0e95c14d7ace35894e7ad8351334f4107..486ed8141fcddc93dc13b7c5f91a58e8fd8baf10 100644 (file)
@@ -139,7 +139,7 @@ static int max8952_set_voltage(struct regulator_dev *rdev,
        s8 vid = -1, i;
 
        if (!gpio_is_valid(max8952->pdata->gpio_vid0) ||
-                       !gpio_is_valid(max8952->pdata->gpio_vid0)) {
+                       !gpio_is_valid(max8952->pdata->gpio_vid1)) {
                /* DVS not supported */
                return -EPERM;
        }
index 10d5a1d9768e3fd973ea4f8ea6ab388d9a24eaaa..ad6628ca94f41378bdddbe11f1286d54a64f4fd0 100644 (file)
@@ -39,25 +39,28 @@ struct max8997_data {
        struct regulator_dev **rdev;
        int ramp_delay; /* in mV/us */
 
+       bool buck1_gpiodvs;
+       bool buck2_gpiodvs;
+       bool buck5_gpiodvs;
        u8 buck1_vol[8];
        u8 buck2_vol[8];
        u8 buck5_vol[8];
+       int buck125_gpios[3];
        int buck125_gpioindex;
+       bool ignore_gpiodvs_side_effect;
 
        u8 saved_states[MAX8997_REG_MAX];
 };
 
 static inline void max8997_set_gpio(struct max8997_data *max8997)
 {
-       struct max8997_platform_data *pdata =
-               dev_get_platdata(max8997->iodev->dev);
        int set3 = (max8997->buck125_gpioindex) & 0x1;
        int set2 = ((max8997->buck125_gpioindex) >> 1) & 0x1;
        int set1 = ((max8997->buck125_gpioindex) >> 2) & 0x1;
 
-       gpio_set_value(pdata->buck125_gpios[0], set1);
-       gpio_set_value(pdata->buck125_gpios[1], set2);
-       gpio_set_value(pdata->buck125_gpios[2], set3);
+       gpio_set_value(max8997->buck125_gpios[0], set1);
+       gpio_set_value(max8997->buck125_gpios[1], set2);
+       gpio_set_value(max8997->buck125_gpios[2], set3);
 }
 
 struct voltage_map_desc {
@@ -380,8 +383,6 @@ static int max8997_get_voltage_register(struct regulator_dev *rdev,
 static int max8997_get_voltage(struct regulator_dev *rdev)
 {
        struct max8997_data *max8997 = rdev_get_drvdata(rdev);
-       struct max8997_platform_data *pdata =
-               dev_get_platdata(max8997->iodev->dev);
        struct i2c_client *i2c = max8997->iodev->i2c;
        int reg, shift, mask, ret;
        int rid = max8997_get_rid(rdev);
@@ -391,9 +392,9 @@ static int max8997_get_voltage(struct regulator_dev *rdev)
        if (ret)
                return ret;
 
-       if ((rid == MAX8997_BUCK1 && pdata->buck1_gpiodvs) ||
-                       (rid == MAX8997_BUCK2 && pdata->buck2_gpiodvs) ||
-                       (rid == MAX8997_BUCK5 && pdata->buck5_gpiodvs))
+       if ((rid == MAX8997_BUCK1 && max8997->buck1_gpiodvs) ||
+                       (rid == MAX8997_BUCK2 && max8997->buck2_gpiodvs) ||
+                       (rid == MAX8997_BUCK5 && max8997->buck5_gpiodvs))
                reg += max8997->buck125_gpioindex;
 
        ret = max8997_read_reg(i2c, reg, &val);
@@ -543,7 +544,8 @@ static int max8997_set_voltage_ldobuck(struct regulator_dev *rdev,
                        rid == MAX8997_BUCK4 || rid == MAX8997_BUCK5) {
                /* If the voltage is increasing */
                if (org < i)
-                       udelay(desc->step * (i - org) / max8997->ramp_delay);
+                       udelay(DIV_ROUND_UP(desc->step * (i - org),
+                                               max8997->ramp_delay));
        }
 
        return ret;
@@ -561,8 +563,6 @@ static int max8997_assess_side_effect(struct regulator_dev *rdev,
                u8 new_val, int *best)
 {
        struct max8997_data *max8997 = rdev_get_drvdata(rdev);
-       struct max8997_platform_data *pdata =
-               dev_get_platdata(max8997->iodev->dev);
        int rid = max8997_get_rid(rdev);
        u8 *buckx_val[3];
        bool buckx_gpiodvs[3];
@@ -589,9 +589,9 @@ static int max8997_assess_side_effect(struct regulator_dev *rdev,
        buckx_val[0] = max8997->buck1_vol;
        buckx_val[1] = max8997->buck2_vol;
        buckx_val[2] = max8997->buck5_vol;
-       buckx_gpiodvs[0] = pdata->buck1_gpiodvs;
-       buckx_gpiodvs[1] = pdata->buck2_gpiodvs;
-       buckx_gpiodvs[2] = pdata->buck5_gpiodvs;
+       buckx_gpiodvs[0] = max8997->buck1_gpiodvs;
+       buckx_gpiodvs[1] = max8997->buck2_gpiodvs;
+       buckx_gpiodvs[2] = max8997->buck5_gpiodvs;
 
        for (i = 0; i < 8; i++) {
                int others;
@@ -640,8 +640,6 @@ static int max8997_set_voltage_buck(struct regulator_dev *rdev,
                int min_uV, int max_uV, unsigned *selector)
 {
        struct max8997_data *max8997 = rdev_get_drvdata(rdev);
-       struct max8997_platform_data *pdata =
-               dev_get_platdata(max8997->iodev->dev);
        int rid = max8997_get_rid(rdev);
        const struct voltage_map_desc *desc;
        int new_val, new_idx, damage, tmp_val, tmp_idx, tmp_dmg;
@@ -653,15 +651,15 @@ static int max8997_set_voltage_buck(struct regulator_dev *rdev,
 
        switch (rid) {
        case MAX8997_BUCK1:
-               if (pdata->buck1_gpiodvs)
+               if (max8997->buck1_gpiodvs)
                        gpio_dvs_mode = true;
                break;
        case MAX8997_BUCK2:
-               if (pdata->buck2_gpiodvs)
+               if (max8997->buck2_gpiodvs)
                        gpio_dvs_mode = true;
                break;
        case MAX8997_BUCK5:
-               if (pdata->buck5_gpiodvs)
+               if (max8997->buck5_gpiodvs)
                        gpio_dvs_mode = true;
                break;
        }
@@ -695,7 +693,7 @@ static int max8997_set_voltage_buck(struct regulator_dev *rdev,
        new_idx = tmp_idx;
        new_val = tmp_val;
 
-       if (pdata->ignore_gpiodvs_side_effect == false)
+       if (max8997->ignore_gpiodvs_side_effect == false)
                return -EINVAL;
 
        dev_warn(&rdev->dev, "MAX8997 GPIO-DVS Side Effect Warning: GPIO SET:"
@@ -993,6 +991,11 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev)
        i2c = max8997->iodev->i2c;
 
        max8997->buck125_gpioindex = pdata->buck125_default_idx;
+       max8997->buck1_gpiodvs = pdata->buck1_gpiodvs;
+       max8997->buck2_gpiodvs = pdata->buck2_gpiodvs;
+       max8997->buck5_gpiodvs = pdata->buck5_gpiodvs;
+       memcpy(max8997->buck125_gpios, pdata->buck125_gpios, sizeof(int) * 3);
+       max8997->ignore_gpiodvs_side_effect = pdata->ignore_gpiodvs_side_effect;
 
        for (i = 0; i < 8; i++) {
                max8997->buck1_vol[i] = ret =
@@ -1124,6 +1127,10 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev)
                                0x3f);
        }
 
+       /* Misc Settings */
+       max8997->ramp_delay = 10; /* set 10mV/us, which is the default */
+       max8997_write_reg(i2c, MAX8997_REG_BUCKRAMP, (0xf << 4) | 0x9);
+
        for (i = 0; i < pdata->num_regulators; i++) {
                const struct voltage_map_desc *desc;
                int id = pdata->regulators[i].id;
@@ -1148,10 +1155,6 @@ static __devinit int max8997_pmic_probe(struct platform_device *pdev)
                }
        }
 
-       /* Misc Settings */
-       max8997->ramp_delay = 10; /* set 10mV/us, which is the default */
-       max8997_write_reg(i2c, MAX8997_REG_BUCKRAMP, (0xf << 4) | 0x9);
-
        return 0;
 err:
        for (i = 0; i < max8997->num_regulators; i++)
index 795828b90f45ebe4eef243d4abccfebee503f2f7..8945e201e42eb5a57d66d4a4f8ab762314f601a6 100644 (file)
                                        (((i)->fifo_lvl_mask + 1))) \
                                        ? 1 : 0)
 
-#define S3C64XX_SPI_ST_TX_DONE(v, i) ((((v) >> (i)->rx_lvl_offset) & \
-                                       (((i)->fifo_lvl_mask + 1) << 1)) \
-                                       ? 1 : 0)
+#define S3C64XX_SPI_ST_TX_DONE(v, i) (((v) & (1 << (i)->tx_st_done)) ? 1 : 0)
 #define TX_FIFO_LVL(v, i) (((v) >> 6) & (i)->fifo_lvl_mask)
 #define RX_FIFO_LVL(v, i) (((v) >> (i)->rx_lvl_offset) & (i)->fifo_lvl_mask)
 
index 4039eda2a15ba9cb769b1d5588e9a6a09aa4f56a..4a9e563f40fa17ce45db1b591a511b7d2aae5b96 100644 (file)
@@ -672,8 +672,6 @@ static void imon_incoming_packet(struct imon_context *context,
 static void usb_rx_callback(struct urb *urb)
 {
        struct imon_context *context;
-       unsigned char *buf;
-       int len;
        int intfnum = 0;
 
        if (!urb)
@@ -683,9 +681,6 @@ static void usb_rx_callback(struct urb *urb)
        if (!context)
                return;
 
-       buf = urb->transfer_buffer;
-       len = urb->actual_length;
-
        switch (urb->status) {
        case -ENOENT:           /* usbcore unlink successful! */
                return;
@@ -728,7 +723,6 @@ static int imon_probe(struct usb_interface *interface,
        int ir_ep_found = 0;
        int alloc_status = 0;
        int vfd_proto_6p = 0;
-       int code_length;
        struct imon_context *context = NULL;
        int i;
        u16 vendor, product;
@@ -749,8 +743,6 @@ static int imon_probe(struct usb_interface *interface,
        else
                context->display = 1;
 
-       code_length = BUF_CHUNK_SIZE * 8;
-
        usbdev     = usb_get_dev(interface_to_usbdev(interface));
        iface_desc = interface->cur_altsetting;
        num_endpts = iface_desc->desc.bNumEndpoints;
@@ -856,7 +848,7 @@ static int imon_probe(struct usb_interface *interface,
 
        strcpy(driver->name, MOD_NAME);
        driver->minor = -1;
-       driver->code_length = sizeof(int) * 8;
+       driver->code_length = BUF_CHUNK_SIZE * 8;
        driver->sample_rate = 0;
        driver->features = LIRC_CAN_REC_MODE2;
        driver->data = context;
index 4a3cca03224a8a114176a9ea4f09600d3f245600..805df913bb6e164f68ae0c2fdc6efe933040da9d 100644 (file)
@@ -838,7 +838,23 @@ static int hardware_init_port(void)
 
 static int init_port(void)
 {
-       int i, nlow, nhigh;
+       int i, nlow, nhigh, result;
+
+       result = request_irq(irq, irq_handler,
+                            IRQF_DISABLED | (share_irq ? IRQF_SHARED : 0),
+                            LIRC_DRIVER_NAME, (void *)&hardware);
+
+       switch (result) {
+       case -EBUSY:
+               printk(KERN_ERR LIRC_DRIVER_NAME ": IRQ %d busy\n", irq);
+               return -EBUSY;
+       case -EINVAL:
+               printk(KERN_ERR LIRC_DRIVER_NAME
+                      ": Bad irq number or handler\n");
+               return -EINVAL;
+       default:
+               break;
+       };
 
        /* Reserve io region. */
        /*
@@ -893,34 +909,17 @@ static int init_port(void)
                printk(KERN_INFO LIRC_DRIVER_NAME  ": Manually using active "
                       "%s receiver\n", sense ? "low" : "high");
 
+       dprintk("Interrupt %d, port %04x obtained\n", irq, io);
        return 0;
 }
 
 static int set_use_inc(void *data)
 {
-       int result;
        unsigned long flags;
 
        /* initialize timestamp */
        do_gettimeofday(&lasttv);
 
-       result = request_irq(irq, irq_handler,
-                            IRQF_DISABLED | (share_irq ? IRQF_SHARED : 0),
-                            LIRC_DRIVER_NAME, (void *)&hardware);
-
-       switch (result) {
-       case -EBUSY:
-               printk(KERN_ERR LIRC_DRIVER_NAME ": IRQ %d busy\n", irq);
-               return -EBUSY;
-       case -EINVAL:
-               printk(KERN_ERR LIRC_DRIVER_NAME
-                      ": Bad irq number or handler\n");
-               return -EINVAL;
-       default:
-               dprintk("Interrupt %d, port %04x obtained\n", irq, io);
-               break;
-       }
-
        spin_lock_irqsave(&hardware[type].lock, flags);
 
        /* Set DLAB 0. */
@@ -945,10 +944,6 @@ static void set_use_dec(void *data)
        soutp(UART_IER, sinp(UART_IER) &
              (~(UART_IER_MSI|UART_IER_RLSI|UART_IER_THRI|UART_IER_RDI)));
        spin_unlock_irqrestore(&hardware[type].lock, flags);
-
-       free_irq(irq, (void *)&hardware);
-
-       dprintk("freed IRQ %d\n", irq);
 }
 
 static ssize_t lirc_write(struct file *file, const char *buf,
@@ -1256,6 +1251,9 @@ exit_serial_exit:
 static void __exit lirc_serial_exit_module(void)
 {
        lirc_serial_exit();
+
+       free_irq(irq, (void *)&hardware);
+
        if (iommap != 0)
                release_mem_region(iommap, 8 << ioshift);
        else
index a7b46f24f24e242e61cf5e7c0dea2b9650bef7d8..0d3864594b12abf28545f4b52cc511ae5ce17378 100644 (file)
@@ -739,23 +739,16 @@ static void send_space(unsigned long len)
 static void send_pulse(unsigned long len)
 {
        long bytes_out = len / TIME_CONST;
-       long time_left;
 
-       time_left = (long)len - (long)bytes_out * (long)TIME_CONST;
-       if (bytes_out == 0) {
+       if (bytes_out == 0)
                bytes_out++;
-               time_left = 0;
-       }
+
        while (bytes_out--) {
                outb(PULSE, io + UART_TX);
                /* FIXME treba seriozne cakanie z char/serial.c */
                while (!(inb(io + UART_LSR) & UART_LSR_THRE))
                        ;
        }
-#if 0
-       if (time_left > 0)
-               safe_udelay(time_left);
-#endif
 }
 #endif
 
index dd6a57c3c3a3149bac53eb36fd4ddeabed804050..4e051f6b52dba96c57ddb96e9207ad5a97a67ee7 100644 (file)
@@ -475,14 +475,14 @@ static int lirc_thread(void *arg)
        dprintk("poll thread started\n");
 
        while (!kthread_should_stop()) {
+               set_current_state(TASK_INTERRUPTIBLE);
+
                /* if device not opened, we can sleep half a second */
                if (atomic_read(&ir->open_count) == 0) {
                        schedule_timeout(HZ/2);
                        continue;
                }
 
-               set_current_state(TASK_INTERRUPTIBLE);
-
                /*
                 * This is ~113*2 + 24 + jitter (2*repeat gap + code length).
                 * We use this interval as the chip resets every time you poll
index 64c7ab4702df39ae27b6cad3f72d42a6608e591e..0b5ec234c787ff907cf677c25dbf4f407a418642 100644 (file)
@@ -1147,6 +1147,14 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
         * any drivers bound to them (a key side effect)
         */
        if (dev->actconfig) {
+               /*
+                * FIXME: In order to avoid self-deadlock involving the
+                * bandwidth_mutex, we have to mark all the interfaces
+                * before unregistering any of them.
+                */
+               for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++)
+                       dev->actconfig->interface[i]->unregistering = 1;
+
                for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) {
                        struct usb_interface    *interface;
 
@@ -1156,7 +1164,6 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
                                continue;
                        dev_dbg(&dev->dev, "unregistering interface %s\n",
                                dev_name(&interface->dev));
-                       interface->unregistering = 1;
                        remove_intf_ep_devs(interface);
                        device_del(&interface->dev);
                }
@@ -1286,6 +1293,8 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate)
                        interface);
                return -EINVAL;
        }
+       if (iface->unregistering)
+               return -ENODEV;
 
        alt = usb_altnum_to_altsetting(iface, alternate);
        if (!alt) {
index 2cd9a60c7f3a55d5872395aba45d4bc0bb1d977b..4e4833168087565215274dd1dab672628cd303b9 100644 (file)
@@ -46,7 +46,6 @@
 #include <asm/system.h>
 #include <asm/unaligned.h>
 #include <asm/dma.h>
-#include <asm/cacheflush.h>
 
 #include "fsl_usb2_udc.h"
 
@@ -118,6 +117,17 @@ static void (*_fsl_writel)(u32 v, unsigned __iomem *p);
 #define fsl_readl(p)           (*_fsl_readl)((p))
 #define fsl_writel(v, p)       (*_fsl_writel)((v), (p))
 
+static inline void fsl_set_accessors(struct fsl_usb2_platform_data *pdata)
+{
+       if (pdata->big_endian_mmio) {
+               _fsl_readl = _fsl_readl_be;
+               _fsl_writel = _fsl_writel_be;
+       } else {
+               _fsl_readl = _fsl_readl_le;
+               _fsl_writel = _fsl_writel_le;
+       }
+}
+
 static inline u32 cpu_to_hc32(const u32 x)
 {
        return udc_controller->pdata->big_endian_desc
@@ -132,6 +142,8 @@ static inline u32 hc32_to_cpu(const u32 x)
                : le32_to_cpu((__force __le32)x);
 }
 #else /* !CONFIG_PPC32 */
+static inline void fsl_set_accessors(struct fsl_usb2_platform_data *pdata) {}
+
 #define fsl_readl(addr)                readl(addr)
 #define fsl_writel(val32, addr) writel(val32, addr)
 #define cpu_to_hc32(x)         cpu_to_le32(x)
@@ -1277,6 +1289,11 @@ static int ep0_prime_status(struct fsl_udc *udc, int direction)
        req->req.complete = NULL;
        req->dtd_count = 0;
 
+       req->req.dma = dma_map_single(ep->udc->gadget.dev.parent,
+                       req->req.buf, req->req.length,
+                       ep_is_in(ep) ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
+       req->mapped = 1;
+
        if (fsl_req_to_dtd(req) == 0)
                fsl_queue_td(ep, req);
        else
@@ -1348,9 +1365,6 @@ static void ch9getstatus(struct fsl_udc *udc, u8 request_type, u16 value,
        /* Fill in the reqest structure */
        *((u16 *) req->req.buf) = cpu_to_le16(tmp);
 
-       /* flush cache for the req buffer */
-       flush_dcache_range((u32)req->req.buf, (u32)req->req.buf + 8);
-
        req->ep = ep;
        req->req.length = 2;
        req->req.status = -EINPROGRESS;
@@ -1358,6 +1372,11 @@ static void ch9getstatus(struct fsl_udc *udc, u8 request_type, u16 value,
        req->req.complete = NULL;
        req->dtd_count = 0;
 
+       req->req.dma = dma_map_single(ep->udc->gadget.dev.parent,
+                               req->req.buf, req->req.length,
+                               ep_is_in(ep) ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
+       req->mapped = 1;
+
        /* prime the data phase */
        if ((fsl_req_to_dtd(req) == 0))
                fsl_queue_td(ep, req);
@@ -2354,7 +2373,6 @@ static int __init struct_udc_setup(struct fsl_udc *udc,
                        struct fsl_req, req);
        /* allocate a small amount of memory to get valid address */
        udc->status_req->req.buf = kmalloc(8, GFP_KERNEL);
-       udc->status_req->req.dma = virt_to_phys(udc->status_req->req.buf);
 
        udc->resume_state = USB_STATE_NOTATTACHED;
        udc->usb_state = USB_STATE_POWERED;
@@ -2470,13 +2488,7 @@ static int __init fsl_udc_probe(struct platform_device *pdev)
        }
 
        /* Set accessors only after pdata->init() ! */
-       if (pdata->big_endian_mmio) {
-               _fsl_readl = _fsl_readl_be;
-               _fsl_writel = _fsl_writel_be;
-       } else {
-               _fsl_readl = _fsl_readl_le;
-               _fsl_writel = _fsl_writel_le;
-       }
+       fsl_set_accessors(pdata);
 
 #ifndef CONFIG_ARCH_MXC
        if (pdata->have_sysif_regs)
index ad57593d224a1f3200a0ef818b36bcb22f6fdf75..a0c8965c1a793cb00f157eaa506355dedbd8ca00 100644 (file)
@@ -109,6 +109,7 @@ struct ds1wm_data {
        /* byte to write that makes all intr disabled, */
        /* considering active_state (IAS) (optimization) */
        u8       int_en_reg_none;
+       unsigned int reset_recover_delay; /* see ds1wm.h */
 };
 
 static inline void ds1wm_write_register(struct ds1wm_data *ds1wm_data, u32 reg,
@@ -187,6 +188,9 @@ static int ds1wm_reset(struct ds1wm_data *ds1wm_data)
                return 1;
        }
 
+       if (ds1wm_data->reset_recover_delay)
+               msleep(ds1wm_data->reset_recover_delay);
+
        return 0;
 }
 
@@ -490,6 +494,7 @@ static int ds1wm_probe(struct platform_device *pdev)
        }
        ds1wm_data->irq = res->start;
        ds1wm_data->int_en_reg_none = (plat->active_high ? DS1WM_INTEN_IAS : 0);
+       ds1wm_data->reset_recover_delay = plat->reset_recover_delay;
 
        if (res->flags & IORESOURCE_IRQ_HIGHEDGE)
                irq_set_irq_type(ds1wm_data->irq, IRQ_TYPE_EDGE_RISING);
index 63039ed9576f75c396ed0dae71bec1e4abf53058..2bc5dc644b4cb82c21300a925276a861644de5bd 100644 (file)
@@ -1864,6 +1864,7 @@ cleanup:
        kfree(psinfo);
        kfree(notes);
        kfree(fpu);
+       kfree(shdr4extnum);
 #ifdef ELF_CORE_COPY_XFPREGS
        kfree(xfpu);
 #endif
index f30ac05dbda7d1a60048aee7422026754b49b885..3b859a3e6a0e9354a653e324f8c08ba85d45f959 100644 (file)
@@ -1335,6 +1335,11 @@ struct btrfs_ioctl_defrag_range_args {
  */
 #define BTRFS_STRING_ITEM_KEY  253
 
+/*
+ * Flags for mount options.
+ *
+ * Note: don't forget to add new options to btrfs_show_options()
+ */
 #define BTRFS_MOUNT_NODATASUM          (1 << 0)
 #define BTRFS_MOUNT_NODATACOW          (1 << 1)
 #define BTRFS_MOUNT_NOBARRIER          (1 << 2)
index d340f63d8f07b2cf7c0e087fdf92ba384e31662e..3601f0aebddf61931906f2cbe49d5559778e5e51 100644 (file)
@@ -2678,12 +2678,14 @@ noinline int btrfs_update_inode(struct btrfs_trans_handle *trans,
        int ret;
 
        /*
-        * If root is tree root, it means this inode is used to
-        * store free space information. And these inodes are updated
-        * when committing the transaction, so they needn't delaye to
-        * be updated, or deadlock will occured.
+        * If the inode is a free space inode, we can deadlock during commit
+        * if we put it into the delayed code.
+        *
+        * The data relocation inode should also be directly updated
+        * without delay
         */
-       if (!is_free_space_inode(root, inode)) {
+       if (!is_free_space_inode(root, inode)
+           && root->root_key.objectid != BTRFS_DATA_RELOC_TREE_OBJECTID) {
                ret = btrfs_delayed_update_inode(trans, root, inode);
                if (!ret)
                        btrfs_set_inode_last_trans(trans, inode);
index 0bb4ebbb71b7b0bf6861b7a5efde6f5cf2f5b97e..15634d4648d719922bc36313657c31b60066973c 100644 (file)
@@ -723,6 +723,12 @@ static int btrfs_show_options(struct seq_file *seq, struct vfsmount *vfs)
                seq_puts(seq, ",clear_cache");
        if (btrfs_test_opt(root, USER_SUBVOL_RM_ALLOWED))
                seq_puts(seq, ",user_subvol_rm_allowed");
+       if (btrfs_test_opt(root, ENOSPC_DEBUG))
+               seq_puts(seq, ",enospc_debug");
+       if (btrfs_test_opt(root, AUTO_DEFRAG))
+               seq_puts(seq, ",autodefrag");
+       if (btrfs_test_opt(root, INODE_MAP_CACHE))
+               seq_puts(seq, ",inode_cache");
        return 0;
 }
 
index 1efa56e18f9b905ceac4dbcb3faa0221ab331ce2..19450bc536327c77f7add37e723b668da410eedd 100644 (file)
@@ -2098,7 +2098,8 @@ int btrfs_balance(struct btrfs_root *dev_root)
                                           chunk_root->root_key.objectid,
                                           found_key.objectid,
                                           found_key.offset);
-               BUG_ON(ret && ret != -ENOSPC);
+               if (ret && ret != -ENOSPC)
+                       goto error;
                key.offset = found_key.offset - 1;
        }
        ret = 0;
index 9542f07d0b9306774e7172afed25b6f809503c06..4698a5c553dc010fa0aedabe3f3f4e0fb68b65c8 100644 (file)
@@ -290,7 +290,6 @@ static int striped_read(struct inode *inode,
        struct ceph_inode_info *ci = ceph_inode(inode);
        u64 pos, this_len;
        int io_align, page_align;
-       int page_off = off & ~PAGE_CACHE_MASK; /* first byte's offset in page */
        int left, pages_left;
        int read;
        struct page **page_pos;
@@ -326,12 +325,11 @@ more:
             ret, hit_stripe ? " HITSTRIPE" : "", was_short ? " SHORT" : "");
 
        if (ret > 0) {
-               int didpages =
-                       ((pos & ~PAGE_CACHE_MASK) + ret) >> PAGE_CACHE_SHIFT;
+               int didpages = (page_align + ret) >> PAGE_CACHE_SHIFT;
 
                if (read < pos - off) {
                        dout(" zero gap %llu to %llu\n", off + read, pos);
-                       ceph_zero_page_vector_range(page_off + read,
+                       ceph_zero_page_vector_range(page_align + read,
                                                    pos - off - read, pages);
                }
                pos += ret;
@@ -356,7 +354,7 @@ more:
                                left = inode->i_size - pos;
 
                        dout("zero tail %d\n", left);
-                       ceph_zero_page_vector_range(page_off + read, left,
+                       ceph_zero_page_vector_range(page_align + read, left,
                                                    pages);
                        read += left;
                }
@@ -478,9 +476,6 @@ static ssize_t ceph_sync_write(struct file *file, const char __user *data,
        else
                pos = *offset;
 
-       io_align = pos & ~PAGE_MASK;
-       buf_align = (unsigned long)data & ~PAGE_MASK;
-
        ret = filemap_write_and_wait_range(inode->i_mapping, pos, pos + left);
        if (ret < 0)
                return ret;
@@ -504,6 +499,8 @@ static ssize_t ceph_sync_write(struct file *file, const char __user *data,
         * boundary.  this isn't atomic, unfortunately.  :(
         */
 more:
+       io_align = pos & ~PAGE_MASK;
+       buf_align = (unsigned long)data & ~PAGE_MASK;
        len = left;
        if (file->f_flags & O_DIRECT) {
                /* write from beginning of first page, regardless of
@@ -593,6 +590,7 @@ out:
                pos += len;
                written += len;
                left -= len;
+               data += written;
                if (left)
                        goto more;
 
index 35f9154615fa5ca7cc01fe857324b640b9533245..3e2989976297bf654649055f67ca2007e3d71733 100644 (file)
@@ -649,9 +649,9 @@ cifs_do_mount(struct file_system_type *fs_type,
 
        cFYI(1, "Devname: %s flags: %d ", dev_name, flags);
 
-       rc = cifs_setup_volume_info(&volume_info, (char *)data, dev_name);
-       if (rc)
-               return ERR_PTR(rc);
+       volume_info = cifs_get_volume_info((char *)data, dev_name);
+       if (IS_ERR(volume_info))
+               return ERR_CAST(volume_info);
 
        cifs_sb = kzalloc(sizeof(struct cifs_sb_info), GFP_KERNEL);
        if (cifs_sb == NULL) {
@@ -713,7 +713,7 @@ cifs_do_mount(struct file_system_type *fs_type,
 out_super:
        deactivate_locked_super(sb);
 out:
-       cifs_cleanup_volume_info(&volume_info);
+       cifs_cleanup_volume_info(volume_info);
        return root;
 
 out_mountdata:
index 257f312ede422d6e5c1592954bb9467f602c6e6a..8df28e925e5b180240ad35ce2b304dec18ed5188 100644 (file)
@@ -154,9 +154,9 @@ extern int set_cifs_acl(struct cifs_ntsd *, __u32, struct inode *,
 extern void cifs_setup_cifs_sb(struct smb_vol *pvolume_info,
                               struct cifs_sb_info *cifs_sb);
 extern int cifs_match_super(struct super_block *, void *);
-extern void cifs_cleanup_volume_info(struct smb_vol **pvolume_info);
-extern int cifs_setup_volume_info(struct smb_vol **pvolume_info,
-                                 char *mount_data, const char *devname);
+extern void cifs_cleanup_volume_info(struct smb_vol *pvolume_info);
+extern struct smb_vol *cifs_get_volume_info(char *mount_data,
+                                           const char *devname);
 extern int cifs_mount(struct cifs_sb_info *, struct smb_vol *);
 extern void cifs_umount(struct cifs_sb_info *);
 extern void cifs_dfs_release_automount_timer(void);
index c8cb83ef6f6ff9881abc720b195cfe9276686923..dbd669cc5bc7623ea93fafcff8d0448d55a92653 100644 (file)
@@ -65,6 +65,8 @@ static int ip_connect(struct TCP_Server_Info *server);
 static int generic_ip_connect(struct TCP_Server_Info *server);
 static void tlink_rb_insert(struct rb_root *root, struct tcon_link *new_tlink);
 static void cifs_prune_tlinks(struct work_struct *work);
+static int cifs_setup_volume_info(struct smb_vol *volume_info, char *mount_data,
+                                       const char *devname);
 
 /*
  * cifs tcp session reconnection
@@ -2240,8 +2242,8 @@ cifs_match_super(struct super_block *sb, void *data)
 
        rc = compare_mount_options(sb, mnt_data);
 out:
-       cifs_put_tlink(tlink);
        spin_unlock(&cifs_tcp_ses_lock);
+       cifs_put_tlink(tlink);
        return rc;
 }
 
@@ -2830,15 +2832,9 @@ is_path_accessible(int xid, struct cifs_tcon *tcon,
        return rc;
 }
 
-void
-cifs_cleanup_volume_info(struct smb_vol **pvolume_info)
+static void
+cleanup_volume_info_contents(struct smb_vol *volume_info)
 {
-       struct smb_vol *volume_info;
-
-       if (!pvolume_info || !*pvolume_info)
-               return;
-
-       volume_info = *pvolume_info;
        kfree(volume_info->username);
        kzfree(volume_info->password);
        kfree(volume_info->UNC);
@@ -2846,28 +2842,44 @@ cifs_cleanup_volume_info(struct smb_vol **pvolume_info)
        kfree(volume_info->domainname);
        kfree(volume_info->iocharset);
        kfree(volume_info->prepath);
+}
+
+void
+cifs_cleanup_volume_info(struct smb_vol *volume_info)
+{
+       if (!volume_info)
+               return;
+       cleanup_volume_info_contents(volume_info);
        kfree(volume_info);
-       *pvolume_info = NULL;
-       return;
 }
 
+
 #ifdef CONFIG_CIFS_DFS_UPCALL
 /* build_path_to_root returns full path to root when
  * we do not have an exiting connection (tcon) */
 static char *
-build_unc_path_to_root(const struct smb_vol *volume_info,
+build_unc_path_to_root(const struct smb_vol *vol,
                const struct cifs_sb_info *cifs_sb)
 {
-       char *full_path;
+       char *full_path, *pos;
+       unsigned int pplen = vol->prepath ? strlen(vol->prepath) : 0;
+       unsigned int unc_len = strnlen(vol->UNC, MAX_TREE_SIZE + 1);
 
-       int unc_len = strnlen(volume_info->UNC, MAX_TREE_SIZE + 1);
-       full_path = kmalloc(unc_len + 1, GFP_KERNEL);
+       full_path = kmalloc(unc_len + pplen + 1, GFP_KERNEL);
        if (full_path == NULL)
                return ERR_PTR(-ENOMEM);
 
-       strncpy(full_path, volume_info->UNC, unc_len);
-       full_path[unc_len] = 0; /* add trailing null */
+       strncpy(full_path, vol->UNC, unc_len);
+       pos = full_path + unc_len;
+
+       if (pplen) {
+               strncpy(pos, vol->prepath, pplen);
+               pos += pplen;
+       }
+
+       *pos = '\0'; /* add trailing null */
        convert_delimiter(full_path, CIFS_DIR_SEP(cifs_sb));
+       cFYI(1, "%s: full_path=%s", __func__, full_path);
        return full_path;
 }
 
@@ -2910,15 +2922,18 @@ expand_dfs_referral(int xid, struct cifs_ses *pSesInfo,
                                                   &fake_devname);
 
                free_dfs_info_array(referrals, num_referrals);
-               kfree(fake_devname);
-
-               if (cifs_sb->mountdata != NULL)
-                       kfree(cifs_sb->mountdata);
 
                if (IS_ERR(mdata)) {
                        rc = PTR_ERR(mdata);
                        mdata = NULL;
+               } else {
+                       cleanup_volume_info_contents(volume_info);
+                       memset(volume_info, '\0', sizeof(*volume_info));
+                       rc = cifs_setup_volume_info(volume_info, mdata,
+                                                       fake_devname);
                }
+               kfree(fake_devname);
+               kfree(cifs_sb->mountdata);
                cifs_sb->mountdata = mdata;
        }
        kfree(full_path);
@@ -2926,33 +2941,20 @@ expand_dfs_referral(int xid, struct cifs_ses *pSesInfo,
 }
 #endif
 
-int cifs_setup_volume_info(struct smb_vol **pvolume_info, char *mount_data,
-                          const char *devname)
+static int
+cifs_setup_volume_info(struct smb_vol *volume_info, char *mount_data,
+                       const char *devname)
 {
-       struct smb_vol *volume_info;
        int rc = 0;
 
-       *pvolume_info = NULL;
-
-       volume_info = kzalloc(sizeof(struct smb_vol), GFP_KERNEL);
-       if (!volume_info) {
-               rc = -ENOMEM;
-               goto out;
-       }
-
-       if (cifs_parse_mount_options(mount_data, devname,
-                                    volume_info)) {
-               rc = -EINVAL;
-               goto out;
-       }
+       if (cifs_parse_mount_options(mount_data, devname, volume_info))
+               return -EINVAL;
 
        if (volume_info->nullauth) {
                cFYI(1, "null user");
                volume_info->username = kzalloc(1, GFP_KERNEL);
-               if (volume_info->username == NULL) {
-                       rc = -ENOMEM;
-                       goto out;
-               }
+               if (volume_info->username == NULL)
+                       return -ENOMEM;
        } else if (volume_info->username) {
                /* BB fixme parse for domain name here */
                cFYI(1, "Username: %s", volume_info->username);
@@ -2960,8 +2962,7 @@ int cifs_setup_volume_info(struct smb_vol **pvolume_info, char *mount_data,
                cifserror("No username specified");
        /* In userspace mount helper we can get user name from alternate
           locations such as env variables and files on disk */
-               rc = -EINVAL;
-               goto out;
+               return -EINVAL;
        }
 
        /* this is needed for ASCII cp to Unicode converts */
@@ -2973,18 +2974,32 @@ int cifs_setup_volume_info(struct smb_vol **pvolume_info, char *mount_data,
                if (volume_info->local_nls == NULL) {
                        cERROR(1, "CIFS mount error: iocharset %s not found",
                                 volume_info->iocharset);
-                       rc = -ELIBACC;
-                       goto out;
+                       return -ELIBACC;
                }
        }
 
-       *pvolume_info = volume_info;
-       return rc;
-out:
-       cifs_cleanup_volume_info(&volume_info);
        return rc;
 }
 
+struct smb_vol *
+cifs_get_volume_info(char *mount_data, const char *devname)
+{
+       int rc;
+       struct smb_vol *volume_info;
+
+       volume_info = kzalloc(sizeof(struct smb_vol), GFP_KERNEL);
+       if (!volume_info)
+               return ERR_PTR(-ENOMEM);
+
+       rc = cifs_setup_volume_info(volume_info, mount_data, devname);
+       if (rc) {
+               cifs_cleanup_volume_info(volume_info);
+               volume_info = ERR_PTR(rc);
+       }
+
+       return volume_info;
+}
+
 int
 cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info)
 {
@@ -2997,6 +3012,7 @@ cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info)
        struct tcon_link *tlink;
 #ifdef CONFIG_CIFS_DFS_UPCALL
        int referral_walks_count = 0;
+#endif
 
        rc = bdi_setup_and_register(&cifs_sb->bdi, "cifs", BDI_CAP_MAP_COPY);
        if (rc)
@@ -3004,6 +3020,7 @@ cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info)
 
        cifs_sb->bdi.ra_pages = default_backing_dev_info.ra_pages;
 
+#ifdef CONFIG_CIFS_DFS_UPCALL
 try_mount_again:
        /* cleanup activities if we're chasing a referral */
        if (referral_walks_count) {
@@ -3012,7 +3029,6 @@ try_mount_again:
                else if (pSesInfo)
                        cifs_put_smb_ses(pSesInfo);
 
-               cifs_cleanup_volume_info(&volume_info);
                FreeXid(xid);
        }
 #endif
index 816696621ec9ea1be2d5b351ac4fc17d0e8f41aa..42e5363b41024c8c34d399398dfb77d1216bcd03 100644 (file)
@@ -92,6 +92,7 @@ static void cifs_fscache_disable_inode_cookie(struct inode *inode)
 
        if (cifsi->fscache) {
                cFYI(1, "%s: (0x%p)", __func__, cifsi->fscache);
+               fscache_uncache_all_inode_pages(cifsi->fscache, inode);
                fscache_relinquish_cookie(cifsi->fscache, 1);
                cifsi->fscache = NULL;
        }
index a2a5d19ece6adc92b3deda283bd6f5db1f2c701c..2f343b4d7a7d87b6792aad379b91ebffee9e15bc 100644 (file)
@@ -954,3 +954,47 @@ void fscache_mark_pages_cached(struct fscache_retrieval *op,
        pagevec_reinit(pagevec);
 }
 EXPORT_SYMBOL(fscache_mark_pages_cached);
+
+/*
+ * Uncache all the pages in an inode that are marked PG_fscache, assuming them
+ * to be associated with the given cookie.
+ */
+void __fscache_uncache_all_inode_pages(struct fscache_cookie *cookie,
+                                      struct inode *inode)
+{
+       struct address_space *mapping = inode->i_mapping;
+       struct pagevec pvec;
+       pgoff_t next;
+       int i;
+
+       _enter("%p,%p", cookie, inode);
+
+       if (!mapping || mapping->nrpages == 0) {
+               _leave(" [no pages]");
+               return;
+       }
+
+       pagevec_init(&pvec, 0);
+       next = 0;
+       while (next <= (loff_t)-1 &&
+              pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE)
+              ) {
+               for (i = 0; i < pagevec_count(&pvec); i++) {
+                       struct page *page = pvec.pages[i];
+                       pgoff_t page_index = page->index;
+
+                       ASSERTCMP(page_index, >=, next);
+                       next = page_index + 1;
+
+                       if (PageFsCache(page)) {
+                               __fscache_wait_on_page_write(cookie, page);
+                               __fscache_uncache_page(cookie, page);
+                       }
+               }
+               pagevec_release(&pvec);
+               cond_resched();
+       }
+
+       _leave("");
+}
+EXPORT_SYMBOL(__fscache_uncache_all_inode_pages);
index b49b55584c844e8578b1aecb090affa73991d0cc..84a47b709f51835de4dc368e30318abddbbce226 100644 (file)
@@ -500,7 +500,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
 out_put_hidden_dir:
        iput(sbi->hidden_dir);
 out_put_root:
-       iput(sbi->alloc_file);
+       iput(root);
 out_put_alloc_file:
        iput(sbi->alloc_file);
 out_close_cat_tree:
index 3031d81f5f0f585b17ecc3928da80b19b8a9eee3..4ac88ff79aa6671ef37b66fdbb96d7e6ff5609f7 100644 (file)
@@ -36,6 +36,7 @@ int hfsplus_submit_bio(struct block_device *bdev, sector_t sector,
 {
        DECLARE_COMPLETION_ONSTACK(wait);
        struct bio *bio;
+       int ret = 0;
 
        bio = bio_alloc(GFP_NOIO, 1);
        bio->bi_sector = sector;
@@ -54,8 +55,10 @@ int hfsplus_submit_bio(struct block_device *bdev, sector_t sector,
        wait_for_completion(&wait);
 
        if (!bio_flagged(bio, BIO_UPTODATE))
-               return -EIO;
-       return 0;
+               ret = -EIO;
+
+       bio_put(bio);
+       return ret;
 }
 
 static int hfsplus_read_mdb(void *bufptr, struct hfsplus_wd *wd)
index 0a4f50dfadfbf672ff3bc0bcba0581a3e94b83bb..b286539d547a5a11db6760688fcc8f1a37360ec3 100644 (file)
@@ -160,10 +160,28 @@ EXPORT_SYMBOL_GPL(unlock_flocks);
 
 static struct kmem_cache *filelock_cache __read_mostly;
 
+static void locks_init_lock_always(struct file_lock *fl)
+{
+       fl->fl_next = NULL;
+       fl->fl_fasync = NULL;
+       fl->fl_owner = NULL;
+       fl->fl_pid = 0;
+       fl->fl_nspid = NULL;
+       fl->fl_file = NULL;
+       fl->fl_flags = 0;
+       fl->fl_type = 0;
+       fl->fl_start = fl->fl_end = 0;
+}
+
 /* Allocate an empty lock structure. */
 struct file_lock *locks_alloc_lock(void)
 {
-       return kmem_cache_alloc(filelock_cache, GFP_KERNEL);
+       struct file_lock *fl = kmem_cache_alloc(filelock_cache, GFP_KERNEL);
+
+       if (fl)
+               locks_init_lock_always(fl);
+
+       return fl;
 }
 EXPORT_SYMBOL_GPL(locks_alloc_lock);
 
@@ -200,17 +218,9 @@ void locks_init_lock(struct file_lock *fl)
        INIT_LIST_HEAD(&fl->fl_link);
        INIT_LIST_HEAD(&fl->fl_block);
        init_waitqueue_head(&fl->fl_wait);
-       fl->fl_next = NULL;
-       fl->fl_fasync = NULL;
-       fl->fl_owner = NULL;
-       fl->fl_pid = 0;
-       fl->fl_nspid = NULL;
-       fl->fl_file = NULL;
-       fl->fl_flags = 0;
-       fl->fl_type = 0;
-       fl->fl_start = fl->fl_end = 0;
        fl->fl_ops = NULL;
        fl->fl_lmops = NULL;
+       locks_init_lock_always(fl);
 }
 
 EXPORT_SYMBOL(locks_init_lock);
index ce153a6b3aecb42ee0567e6087f4e9597a55be76..419119c371bf81d3a5487448a289cf5e3e219314 100644 (file)
@@ -259,12 +259,10 @@ static void nfs_fscache_disable_inode_cookie(struct inode *inode)
                dfprintk(FSCACHE,
                         "NFS: nfsi 0x%p turning cache off\n", NFS_I(inode));
 
-               /* Need to invalidate any mapped pages that were read in before
-                * turning off the cache.
+               /* Need to uncache any pages attached to this inode that
+                * fscache knows about before turning off the cache.
                 */
-               if (inode->i_mapping && inode->i_mapping->nrpages)
-                       invalidate_inode_pages2(inode->i_mapping);
-
+               fscache_uncache_all_inode_pages(NFS_I(inode)->fscache, inode);
                nfs_fscache_zap_inode_cookie(inode);
        }
 }
index 09983a3344a569094a1799dfa32990214cdb38b9..b1e88d56069caea9016cf907e6f4a0fd040b999b 100644 (file)
@@ -681,15 +681,15 @@ xfs_inode_item_unlock(
  * where the cluster buffer may be unpinned before the inode is inserted into
  * the AIL during transaction committed processing. If the buffer is unpinned
  * before the inode item has been committed and inserted, then it is possible
- * for the buffer to be written and IO completions before the inode is inserted
+ * for the buffer to be written and IO completes before the inode is inserted
  * into the AIL. In that case, we'd be inserting a clean, stale inode into the
  * AIL which will never get removed. It will, however, get reclaimed which
  * triggers an assert in xfs_inode_free() complaining about freein an inode
  * still in the AIL.
  *
- * To avoid this, return a lower LSN than the one passed in so that the
- * transaction committed code will not move the inode forward in the AIL but
- * will still unpin it properly.
+ * To avoid this, just unpin the inode directly and return a LSN of -1 so the
+ * transaction committed code knows that it does not need to do any further
+ * processing on the item.
  */
 STATIC xfs_lsn_t
 xfs_inode_item_committed(
@@ -699,8 +699,10 @@ xfs_inode_item_committed(
        struct xfs_inode_log_item *iip = INODE_ITEM(lip);
        struct xfs_inode        *ip = iip->ili_inode;
 
-       if (xfs_iflags_test(ip, XFS_ISTALE))
-               return lsn - 1;
+       if (xfs_iflags_test(ip, XFS_ISTALE)) {
+               xfs_inode_item_unpin(lip, 0);
+               return -1;
+       }
        return lsn;
 }
 
index 7c7bc2b786bd47d6ec89e31bcf966f6dc5121ec1..c83f63b33aaed62ba6f1bf8b290091e6f5d398e6 100644 (file)
@@ -1361,7 +1361,7 @@ xfs_trans_item_committed(
                lip->li_flags |= XFS_LI_ABORTED;
        item_lsn = IOP_COMMITTED(lip, commit_lsn);
 
-       /* If the committed routine returns -1, item has been freed. */
+       /* item_lsn of -1 means the item needs no further processing */
        if (XFS_LSN_CMP(item_lsn, (xfs_lsn_t)-1) == 0)
                return;
 
@@ -1474,7 +1474,7 @@ xfs_trans_committed_bulk(
                        lip->li_flags |= XFS_LI_ABORTED;
                item_lsn = IOP_COMMITTED(lip, commit_lsn);
 
-               /* item_lsn of -1 means the item was freed */
+               /* item_lsn of -1 means the item needs no further processing */
                if (XFS_LSN_CMP(item_lsn, (xfs_lsn_t)-1) == 0)
                        continue;
 
index 246f576c981d67c2d5430d036c0f39bab88b12f4..447c36752385a52bc661adcea0cec1ca37ffad7f 100644 (file)
 /* drbdsetup XY resize -d Z
  * you are free to reduce the device size to nothing, if you want to.
  * the upper limit with 64bit kernel, enough ram and flexible meta data
- * is 16 TB, currently. */
+ * is 1 PiB, currently. */
 /* DRBD_MAX_SECTORS */
 #define DRBD_DISK_SIZE_SECT_MIN  0
-#define DRBD_DISK_SIZE_SECT_MAX  (16 * (2LLU << 30))
+#define DRBD_DISK_SIZE_SECT_MAX  (1 * (2LLU << 40))
 #define DRBD_DISK_SIZE_SECT_DEF  0 /* = disabled = no user size... */
 
 #define DRBD_ON_IO_ERROR_DEF EP_PASS_ON
index 7c4d72f5581f34ec81580edf108810e4319285e5..9ec20dec3353afa83478ef0509fb15309be5fca0 100644 (file)
@@ -204,6 +204,8 @@ extern bool __fscache_check_page_write(struct fscache_cookie *, struct page *);
 extern void __fscache_wait_on_page_write(struct fscache_cookie *, struct page *);
 extern bool __fscache_maybe_release_page(struct fscache_cookie *, struct page *,
                                         gfp_t);
+extern void __fscache_uncache_all_inode_pages(struct fscache_cookie *,
+                                             struct inode *);
 
 /**
  * fscache_register_netfs - Register a filesystem as desiring caching services
@@ -643,4 +645,23 @@ bool fscache_maybe_release_page(struct fscache_cookie *cookie,
        return false;
 }
 
+/**
+ * fscache_uncache_all_inode_pages - Uncache all an inode's pages
+ * @cookie: The cookie representing the inode's cache object.
+ * @inode: The inode to uncache pages from.
+ *
+ * Uncache all the pages in an inode that are marked PG_fscache, assuming them
+ * to be associated with the given cookie.
+ *
+ * This function may sleep.  It will wait for pages that are being written out
+ * and will wait whilst the PG_fscache mark is removed by the cache.
+ */
+static inline
+void fscache_uncache_all_inode_pages(struct fscache_cookie *cookie,
+                                    struct inode *inode)
+{
+       if (fscache_cookie_valid(cookie))
+               __fscache_uncache_all_inode_pages(cookie, inode);
+}
+
 #endif /* _LINUX_FSCACHE_H */
index be469a357cbbcf3cbbe774e20857bc068cd44c01..38a372a0e2854fed3f06b790f4f591ca052661c7 100644 (file)
@@ -3,4 +3,11 @@
 struct ds1wm_driver_data {
        int active_high;
        int clock_rate;
+       /* in milliseconds, the amount of time to */
+       /* sleep following a reset pulse. Zero    */
+       /* should work if your bus devices recover*/
+       /* time respects the 1-wire spec since the*/
+       /* ds1wm implements the precise timings of*/
+       /* a reset pulse/presence detect sequence.*/
+       unsigned int reset_recover_delay;
 };
index a837b20ba190330c23b59ec5a3fb584fc9f6308f..496770a96487676ec12f222d97a4af8defcf341b 100644 (file)
@@ -808,7 +808,7 @@ enum cpu_idle_type {
  * when BITS_PER_LONG <= 32 are pretty high and the returns do not justify the
  * increased costs.
  */
-#if BITS_PER_LONG > 32
+#if 0 /* BITS_PER_LONG > 32 -- currently broken: it increases power usage under light load  */
 # define SCHED_LOAD_RESOLUTION 10
 # define scale_load(w)         ((w) << SCHED_LOAD_RESOLUTION)
 # define scale_load_down(w)    ((w) >> SCHED_LOAD_RESOLUTION)
index 630e702c9511466f46813c0552eed7371450a807..168dd0b1bae236ea3859e1fb384b6cc79766a1da 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef _LINUX_LIRC_DEV_H
 #define _LINUX_LIRC_DEV_H
 
-#define MAX_IRCTL_DEVICES 4
+#define MAX_IRCTL_DEVICES 8
 #define BUFLEN            16
 
 #define mod(n, div) ((n) % (div))
index 2d7e7ca2313db8cff79b262f3ec03921a4abe931..aac2c0e06d5ee78c6795f23efdd99b6aedf4767e 100644 (file)
@@ -2,10 +2,10 @@
  * Driver header for M-5MOLS 8M Pixel camera sensor with ISP
  *
  * Copyright (C) 2011 Samsung Electronics Co., Ltd.
- * Author: HeungJun Kim, riverful.kim@samsung.com
+ * Author: HeungJun Kim <riverful.kim@samsung.com>
  *
  * Copyright (C) 2009 Samsung Electronics Co., Ltd.
- * Author: Dongsoo Nathaniel Kim, dongsoo45.kim@samsung.com
+ * Author: Dongsoo Nathaniel Kim <dongsoo45.kim@samsung.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
index 1562c4ff3a650de87a1dc20581b2a389fd458808..2884e3e69cb15b31442624444111a3585ebc8e9c 100644 (file)
@@ -173,16 +173,20 @@ struct v4l2_subdev_core_ops {
                                 struct v4l2_event_subscription *sub);
 };
 
-/* s_mode: switch the tuner to a specific tuner mode. Replacement of s_radio.
+/* s_radio: v4l device was opened in radio mode.
 
-   s_radio: v4l device was opened in Radio mode, to be replaced by s_mode.
+   g_frequency: freq->type must be filled in. Normally done by video_ioctl2
+       or the bridge driver.
+
+   g_tuner:
+   s_tuner: vt->type must be filled in. Normally done by video_ioctl2 or the
+       bridge driver.
 
    s_type_addr: sets tuner type and its I2C addr.
 
    s_config: sets tda9887 specific stuff, like port1, port2 and qss
  */
 struct v4l2_subdev_tuner_ops {
-       int (*s_mode)(struct v4l2_subdev *sd, enum v4l2_tuner_type);
        int (*s_radio)(struct v4l2_subdev *sd);
        int (*s_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq);
        int (*g_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq);
index 0589f554788aea2dd5dc28c9a372ee10637e3eb6..396e8fc8910e5901a8ae7e3b0c976fb3435b7e2b 100644 (file)
@@ -2688,7 +2688,7 @@ void cfg80211_send_unprot_disassoc(struct net_device *dev, const u8 *buf,
  * @dev: network device
  * @addr: The source MAC address of the frame
  * @key_type: The key type that the received frame used
- * @key_id: Key identifier (0..3)
+ * @key_id: Key identifier (0..3). Can be -1 if missing.
  * @tsc: The TSC value of the frame that generated the MIC failure (6 octets)
  * @gfp: allocation flags
  *
index 7d15d238b6ecc4f3d4c47af4389525ead0f7a2c7..e12ddfb9eb1652626b9d8cc1d0c0f62f177895d2 100644 (file)
@@ -77,6 +77,7 @@ struct dst_entry {
 #define DST_NOPOLICY           0x0004
 #define DST_NOHASH             0x0008
 #define DST_NOCACHE            0x0010
+#define DST_NOCOUNT            0x0020
        union {
                struct dst_entry        *next;
                struct rtable __rcu     *rt_next;
index fa27e750dbc0edb3dd5c502da1b5be38d83d8c8b..a8ce45097f3d21354c7ed8c18e5fcbc4e11792d1 100644 (file)
@@ -375,15 +375,19 @@ int jump_label_text_reserved(void *start, void *end)
 
 static void jump_label_update(struct jump_label_key *key, int enable)
 {
-       struct jump_entry *entry = key->entries;
-
-       /* if there are no users, entry can be NULL */
-       if (entry)
-               __jump_label_update(key, entry, __stop___jump_table, enable);
+       struct jump_entry *entry = key->entries, *stop = __stop___jump_table;
 
 #ifdef CONFIG_MODULES
+       struct module *mod = __module_address((jump_label_t)key);
+
        __jump_label_mod_update(key, enable);
+
+       if (mod)
+               stop = mod->jump_entries + mod->num_jump_entries;
 #endif
+       /* if there are no users, entry can be NULL */
+       if (entry)
+               __jump_label_update(key, entry, stop, enable);
 }
 
 #endif
index ace55889f7027b051acbaabdbce71389315418e5..06efa54f93d6686bfc2f218d92149ee56cf9e511 100644 (file)
@@ -1211,7 +1211,11 @@ static void free_unnecessary_pages(void)
                to_free_highmem = alloc_highmem - save;
        } else {
                to_free_highmem = 0;
-               to_free_normal -= save - alloc_highmem;
+               save -= alloc_highmem;
+               if (to_free_normal > save)
+                       to_free_normal -= save;
+               else
+                       to_free_normal = 0;
        }
 
        memory_bm_position_reset(&copy_bm);
index 798e2fae2a069645c13853f4b658dada92af8f66..3ff40178dce77d21fdd1ec508fc2baab5e87db84 100644 (file)
@@ -38,6 +38,14 @@ struct resource iomem_resource = {
 };
 EXPORT_SYMBOL(iomem_resource);
 
+/* constraints to be met while allocating resources */
+struct resource_constraint {
+       resource_size_t min, max, align;
+       resource_size_t (*alignf)(void *, const struct resource *,
+                       resource_size_t, resource_size_t);
+       void *alignf_data;
+};
+
 static DEFINE_RWLOCK(resource_lock);
 
 static void *r_next(struct seq_file *m, void *v, loff_t *pos)
@@ -384,16 +392,13 @@ static bool resource_contains(struct resource *res1, struct resource *res2)
 }
 
 /*
- * Find empty slot in the resource tree given range and alignment.
+ * Find empty slot in the resource tree with the given range and
+ * alignment constraints
  */
-static int find_resource(struct resource *root, struct resource *new,
-                        resource_size_t size, resource_size_t min,
-                        resource_size_t max, resource_size_t align,
-                        resource_size_t (*alignf)(void *,
-                                                  const struct resource *,
-                                                  resource_size_t,
-                                                  resource_size_t),
-                        void *alignf_data)
+static int __find_resource(struct resource *root, struct resource *old,
+                        struct resource *new,
+                        resource_size_t  size,
+                        struct resource_constraint *constraint)
 {
        struct resource *this = root->child;
        struct resource tmp = *new, avail, alloc;
@@ -404,25 +409,26 @@ static int find_resource(struct resource *root, struct resource *new,
         * Skip past an allocated resource that starts at 0, since the assignment
         * of this->start - 1 to tmp->end below would cause an underflow.
         */
-       if (this && this->start == 0) {
-               tmp.start = this->end + 1;
+       if (this && this->start == root->start) {
+               tmp.start = (this == old) ? old->start : this->end + 1;
                this = this->sibling;
        }
        for(;;) {
                if (this)
-                       tmp.end = this->start - 1;
+                       tmp.end = (this == old) ?  this->end : this->start - 1;
                else
                        tmp.end = root->end;
 
-               resource_clip(&tmp, min, max);
+               resource_clip(&tmp, constraint->min, constraint->max);
                arch_remove_reservations(&tmp);
 
                /* Check for overflow after ALIGN() */
                avail = *new;
-               avail.start = ALIGN(tmp.start, align);
+               avail.start = ALIGN(tmp.start, constraint->align);
                avail.end = tmp.end;
                if (avail.start >= tmp.start) {
-                       alloc.start = alignf(alignf_data, &avail, size, align);
+                       alloc.start = constraint->alignf(constraint->alignf_data, &avail,
+                                       size, constraint->align);
                        alloc.end = alloc.start + size - 1;
                        if (resource_contains(&avail, &alloc)) {
                                new->start = alloc.start;
@@ -432,14 +438,75 @@ static int find_resource(struct resource *root, struct resource *new,
                }
                if (!this)
                        break;
-               tmp.start = this->end + 1;
+               if (this != old)
+                       tmp.start = this->end + 1;
                this = this->sibling;
        }
        return -EBUSY;
 }
 
+/*
+ * Find empty slot in the resource tree given range and alignment.
+ */
+static int find_resource(struct resource *root, struct resource *new,
+                       resource_size_t size,
+                       struct resource_constraint  *constraint)
+{
+       return  __find_resource(root, NULL, new, size, constraint);
+}
+
 /**
- * allocate_resource - allocate empty slot in the resource tree given range & alignment
+ * reallocate_resource - allocate a slot in the resource tree given range & alignment.
+ *     The resource will be relocated if the new size cannot be reallocated in the
+ *     current location.
+ *
+ * @root: root resource descriptor
+ * @old:  resource descriptor desired by caller
+ * @newsize: new size of the resource descriptor
+ * @constraint: the size and alignment constraints to be met.
+ */
+int reallocate_resource(struct resource *root, struct resource *old,
+                       resource_size_t newsize,
+                       struct resource_constraint  *constraint)
+{
+       int err=0;
+       struct resource new = *old;
+       struct resource *conflict;
+
+       write_lock(&resource_lock);
+
+       if ((err = __find_resource(root, old, &new, newsize, constraint)))
+               goto out;
+
+       if (resource_contains(&new, old)) {
+               old->start = new.start;
+               old->end = new.end;
+               goto out;
+       }
+
+       if (old->child) {
+               err = -EBUSY;
+               goto out;
+       }
+
+       if (resource_contains(old, &new)) {
+               old->start = new.start;
+               old->end = new.end;
+       } else {
+               __release_resource(old);
+               *old = new;
+               conflict = __request_resource(root, old);
+               BUG_ON(conflict);
+       }
+out:
+       write_unlock(&resource_lock);
+       return err;
+}
+
+
+/**
+ * allocate_resource - allocate empty slot in the resource tree given range & alignment.
+ *     The resource will be reallocated with a new size if it was already allocated
  * @root: root resource descriptor
  * @new: resource descriptor desired by caller
  * @size: requested resource region size
@@ -459,12 +526,25 @@ int allocate_resource(struct resource *root, struct resource *new,
                      void *alignf_data)
 {
        int err;
+       struct resource_constraint constraint;
 
        if (!alignf)
                alignf = simple_align_resource;
 
+       constraint.min = min;
+       constraint.max = max;
+       constraint.align = align;
+       constraint.alignf = alignf;
+       constraint.alignf_data = alignf_data;
+
+       if ( new->parent ) {
+               /* resource is already allocated, try reallocating with
+                  the new constraints */
+               return reallocate_resource(root, new, size, &constraint);
+       }
+
        write_lock(&resource_lock);
-       err = find_resource(root, new, size, min, max, align, alignf, alignf_data);
+       err = find_resource(root, new, size, &constraint);
        if (err >= 0 && __request_resource(root, new))
                err = -EBUSY;
        write_unlock(&resource_lock);
index 3f2e502d609bb7957e10b4ec6aa647c9b3069c6e..9769c756ad6650734f9f038db30064d1c38232f5 100644 (file)
@@ -292,8 +292,8 @@ static DEFINE_SPINLOCK(task_group_lock);
  * (The default weight is 1024 - so there's no practical
  *  limitation from this.)
  */
-#define MIN_SHARES     2
-#define MAX_SHARES     (1UL << (18 + SCHED_LOAD_RESOLUTION))
+#define MIN_SHARES     (1UL <<  1)
+#define MAX_SHARES     (1UL << 18)
 
 static int root_task_group_load = ROOT_TASK_GROUP_LOAD;
 #endif
@@ -8450,10 +8450,7 @@ int sched_group_set_shares(struct task_group *tg, unsigned long shares)
        if (!tg->se[0])
                return -EINVAL;
 
-       if (shares < MIN_SHARES)
-               shares = MIN_SHARES;
-       else if (shares > MAX_SHARES)
-               shares = MAX_SHARES;
+       shares = clamp(shares, scale_load(MIN_SHARES), scale_load(MAX_SHARES));
 
        mutex_lock(&shares_mutex);
        if (tg->shares == shares)
index 9d86e45086f54c06bd39f7e989593f4b3ccfa086..a78b7c6e042c9f64fb76bcb252236c456bf8a6a0 100644 (file)
@@ -198,7 +198,7 @@ static void free_object(struct debug_obj *obj)
         * initialized:
         */
        if (obj_pool_free > ODEBUG_POOL_SIZE && obj_cache)
-               sched = !work_pending(&debug_obj_work);
+               sched = keventd_up() && !work_pending(&debug_obj_work);
        hlist_add_head(&obj->node, &obj_pool);
        obj_pool_free++;
        obj_pool_used--;
index ddffc74cdebe50f1d83a592a6d905ad0ff011f16..e013b8e57d25cd198c410743adcadb8446176e75 100644 (file)
@@ -108,10 +108,12 @@ enum mem_cgroup_events_index {
 enum mem_cgroup_events_target {
        MEM_CGROUP_TARGET_THRESH,
        MEM_CGROUP_TARGET_SOFTLIMIT,
+       MEM_CGROUP_TARGET_NUMAINFO,
        MEM_CGROUP_NTARGETS,
 };
 #define THRESHOLDS_EVENTS_TARGET (128)
 #define SOFTLIMIT_EVENTS_TARGET (1024)
+#define NUMAINFO_EVENTS_TARGET (1024)
 
 struct mem_cgroup_stat_cpu {
        long count[MEM_CGROUP_STAT_NSTATS];
@@ -237,7 +239,8 @@ struct mem_cgroup {
        int last_scanned_node;
 #if MAX_NUMNODES > 1
        nodemask_t      scan_nodes;
-       unsigned long   next_scan_node_update;
+       atomic_t        numainfo_events;
+       atomic_t        numainfo_updating;
 #endif
        /*
         * Should the accounting and control be hierarchical, per subtree?
@@ -577,15 +580,6 @@ static long mem_cgroup_read_stat(struct mem_cgroup *mem,
        return val;
 }
 
-static long mem_cgroup_local_usage(struct mem_cgroup *mem)
-{
-       long ret;
-
-       ret = mem_cgroup_read_stat(mem, MEM_CGROUP_STAT_RSS);
-       ret += mem_cgroup_read_stat(mem, MEM_CGROUP_STAT_CACHE);
-       return ret;
-}
-
 static void mem_cgroup_swap_statistics(struct mem_cgroup *mem,
                                         bool charge)
 {
@@ -689,6 +683,9 @@ static void __mem_cgroup_target_update(struct mem_cgroup *mem, int target)
        case MEM_CGROUP_TARGET_SOFTLIMIT:
                next = val + SOFTLIMIT_EVENTS_TARGET;
                break;
+       case MEM_CGROUP_TARGET_NUMAINFO:
+               next = val + NUMAINFO_EVENTS_TARGET;
+               break;
        default:
                return;
        }
@@ -707,11 +704,19 @@ static void memcg_check_events(struct mem_cgroup *mem, struct page *page)
                mem_cgroup_threshold(mem);
                __mem_cgroup_target_update(mem, MEM_CGROUP_TARGET_THRESH);
                if (unlikely(__memcg_event_check(mem,
-                       MEM_CGROUP_TARGET_SOFTLIMIT))){
+                            MEM_CGROUP_TARGET_SOFTLIMIT))) {
                        mem_cgroup_update_tree(mem, page);
                        __mem_cgroup_target_update(mem,
-                               MEM_CGROUP_TARGET_SOFTLIMIT);
+                                                  MEM_CGROUP_TARGET_SOFTLIMIT);
+               }
+#if MAX_NUMNODES > 1
+               if (unlikely(__memcg_event_check(mem,
+                       MEM_CGROUP_TARGET_NUMAINFO))) {
+                       atomic_inc(&mem->numainfo_events);
+                       __mem_cgroup_target_update(mem,
+                               MEM_CGROUP_TARGET_NUMAINFO);
                }
+#endif
        }
 }
 
@@ -1129,7 +1134,6 @@ unsigned long mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg,
        return MEM_CGROUP_ZSTAT(mz, lru);
 }
 
-#ifdef CONFIG_NUMA
 static unsigned long mem_cgroup_node_nr_file_lru_pages(struct mem_cgroup *memcg,
                                                        int nid)
 {
@@ -1141,6 +1145,17 @@ static unsigned long mem_cgroup_node_nr_file_lru_pages(struct mem_cgroup *memcg,
        return ret;
 }
 
+static unsigned long mem_cgroup_node_nr_anon_lru_pages(struct mem_cgroup *memcg,
+                                                       int nid)
+{
+       unsigned long ret;
+
+       ret = mem_cgroup_get_zonestat_node(memcg, nid, LRU_INACTIVE_ANON) +
+               mem_cgroup_get_zonestat_node(memcg, nid, LRU_ACTIVE_ANON);
+       return ret;
+}
+
+#if MAX_NUMNODES > 1
 static unsigned long mem_cgroup_nr_file_lru_pages(struct mem_cgroup *memcg)
 {
        u64 total = 0;
@@ -1152,17 +1167,6 @@ static unsigned long mem_cgroup_nr_file_lru_pages(struct mem_cgroup *memcg)
        return total;
 }
 
-static unsigned long mem_cgroup_node_nr_anon_lru_pages(struct mem_cgroup *memcg,
-                                                       int nid)
-{
-       unsigned long ret;
-
-       ret = mem_cgroup_get_zonestat_node(memcg, nid, LRU_INACTIVE_ANON) +
-               mem_cgroup_get_zonestat_node(memcg, nid, LRU_ACTIVE_ANON);
-
-       return ret;
-}
-
 static unsigned long mem_cgroup_nr_anon_lru_pages(struct mem_cgroup *memcg)
 {
        u64 total = 0;
@@ -1559,6 +1563,28 @@ mem_cgroup_select_victim(struct mem_cgroup *root_mem)
        return ret;
 }
 
+/**
+ * test_mem_cgroup_node_reclaimable
+ * @mem: the target memcg
+ * @nid: the node ID to be checked.
+ * @noswap : specify true here if the user wants flle only information.
+ *
+ * This function returns whether the specified memcg contains any
+ * reclaimable pages on a node. Returns true if there are any reclaimable
+ * pages in the node.
+ */
+static bool test_mem_cgroup_node_reclaimable(struct mem_cgroup *mem,
+               int nid, bool noswap)
+{
+       if (mem_cgroup_node_nr_file_lru_pages(mem, nid))
+               return true;
+       if (noswap || !total_swap_pages)
+               return false;
+       if (mem_cgroup_node_nr_anon_lru_pages(mem, nid))
+               return true;
+       return false;
+
+}
 #if MAX_NUMNODES > 1
 
 /*
@@ -1570,26 +1596,26 @@ mem_cgroup_select_victim(struct mem_cgroup *root_mem)
 static void mem_cgroup_may_update_nodemask(struct mem_cgroup *mem)
 {
        int nid;
-
-       if (time_after(mem->next_scan_node_update, jiffies))
+       /*
+        * numainfo_events > 0 means there was at least NUMAINFO_EVENTS_TARGET
+        * pagein/pageout changes since the last update.
+        */
+       if (!atomic_read(&mem->numainfo_events))
+               return;
+       if (atomic_inc_return(&mem->numainfo_updating) > 1)
                return;
 
-       mem->next_scan_node_update = jiffies + 10*HZ;
        /* make a nodemask where this memcg uses memory from */
        mem->scan_nodes = node_states[N_HIGH_MEMORY];
 
        for_each_node_mask(nid, node_states[N_HIGH_MEMORY]) {
 
-               if (mem_cgroup_get_zonestat_node(mem, nid, LRU_INACTIVE_FILE) ||
-                   mem_cgroup_get_zonestat_node(mem, nid, LRU_ACTIVE_FILE))
-                       continue;
-
-               if (total_swap_pages &&
-                   (mem_cgroup_get_zonestat_node(mem, nid, LRU_INACTIVE_ANON) ||
-                    mem_cgroup_get_zonestat_node(mem, nid, LRU_ACTIVE_ANON)))
-                       continue;
-               node_clear(nid, mem->scan_nodes);
+               if (!test_mem_cgroup_node_reclaimable(mem, nid, false))
+                       node_clear(nid, mem->scan_nodes);
        }
+
+       atomic_set(&mem->numainfo_events, 0);
+       atomic_set(&mem->numainfo_updating, 0);
 }
 
 /*
@@ -1627,11 +1653,51 @@ int mem_cgroup_select_victim_node(struct mem_cgroup *mem)
        return node;
 }
 
+/*
+ * Check all nodes whether it contains reclaimable pages or not.
+ * For quick scan, we make use of scan_nodes. This will allow us to skip
+ * unused nodes. But scan_nodes is lazily updated and may not cotain
+ * enough new information. We need to do double check.
+ */
+bool mem_cgroup_reclaimable(struct mem_cgroup *mem, bool noswap)
+{
+       int nid;
+
+       /*
+        * quick check...making use of scan_node.
+        * We can skip unused nodes.
+        */
+       if (!nodes_empty(mem->scan_nodes)) {
+               for (nid = first_node(mem->scan_nodes);
+                    nid < MAX_NUMNODES;
+                    nid = next_node(nid, mem->scan_nodes)) {
+
+                       if (test_mem_cgroup_node_reclaimable(mem, nid, noswap))
+                               return true;
+               }
+       }
+       /*
+        * Check rest of nodes.
+        */
+       for_each_node_state(nid, N_HIGH_MEMORY) {
+               if (node_isset(nid, mem->scan_nodes))
+                       continue;
+               if (test_mem_cgroup_node_reclaimable(mem, nid, noswap))
+                       return true;
+       }
+       return false;
+}
+
 #else
 int mem_cgroup_select_victim_node(struct mem_cgroup *mem)
 {
        return 0;
 }
+
+bool mem_cgroup_reclaimable(struct mem_cgroup *mem, bool noswap)
+{
+       return test_mem_cgroup_node_reclaimable(mem, 0, noswap);
+}
 #endif
 
 /*
@@ -1702,7 +1768,7 @@ static int mem_cgroup_hierarchical_reclaim(struct mem_cgroup *root_mem,
                                }
                        }
                }
-               if (!mem_cgroup_local_usage(victim)) {
+               if (!mem_cgroup_reclaimable(victim, noswap)) {
                        /* this cgroup's local usage == 0 */
                        css_put(&victim->css);
                        continue;
index 40b7531ee8badb288823b64715265d0f16be397d..9b8a01d941cbc77dc0b1674fd817b54bb4f281f4 100644 (file)
@@ -305,6 +305,7 @@ int __tlb_remove_page(struct mmu_gather *tlb, struct page *page)
        if (batch->nr == batch->max) {
                if (!tlb_next_batch(tlb))
                        return 0;
+               batch = tlb->active;
        }
        VM_BUG_ON(batch->nr > batch->max);
 
index 1fd0c51b10a63db69181fc6ba2f42127aaad6ef7..9edc897a3970e3a22753e6bbed4ce0bdde9d0f19 100644 (file)
@@ -1813,10 +1813,13 @@ struct page *follow_page(struct vm_area_struct *vma, unsigned long address,
        return NULL;
 }
 
-int remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
-               unsigned long to, unsigned long size, pgprot_t prot)
+int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr,
+               unsigned long pfn, unsigned long size, pgprot_t prot)
 {
-       vma->vm_start = vma->vm_pgoff << PAGE_SHIFT;
+       if (addr != (pfn << PAGE_SHIFT))
+               return -EINVAL;
+
+       vma->vm_flags |= VM_IO | VM_RESERVED | VM_PFNMAP;
        return 0;
 }
 EXPORT_SYMBOL(remap_pfn_range);
index 4f49535d4cd31f998fd58f456eb7ff16ccbf82f9..5ed24b94c5e69a0dbe6c361ccb0665e3fcc591af 100644 (file)
@@ -2326,7 +2326,7 @@ static bool sleeping_prematurely(pg_data_t *pgdat, int order, long remaining,
                return true;
 
        /* Check the watermark levels */
-       for (i = 0; i < pgdat->nr_zones; i++) {
+       for (i = 0; i <= classzone_idx; i++) {
                struct zone *zone = pgdat->node_zones + i;
 
                if (!populated_zone(zone))
@@ -2344,7 +2344,7 @@ static bool sleeping_prematurely(pg_data_t *pgdat, int order, long remaining,
                }
 
                if (!zone_watermark_ok_safe(zone, order, high_wmark_pages(zone),
-                                                       classzone_idx, 0))
+                                                       i, 0))
                        all_zones_ok = false;
                else
                        balanced += zone->present_pages;
@@ -2451,7 +2451,6 @@ loop_again:
                        if (!zone_watermark_ok_safe(zone, order,
                                        high_wmark_pages(zone), 0, 0)) {
                                end_zone = i;
-                               *classzone_idx = i;
                                break;
                        }
                }
@@ -2510,18 +2509,18 @@ loop_again:
                                KSWAPD_ZONE_BALANCE_GAP_RATIO);
                        if (!zone_watermark_ok_safe(zone, order,
                                        high_wmark_pages(zone) + balance_gap,
-                                       end_zone, 0))
+                                       end_zone, 0)) {
                                shrink_zone(priority, zone, &sc);
-                       reclaim_state->reclaimed_slab = 0;
-                       nr_slab = shrink_slab(&shrink, sc.nr_scanned, lru_pages);
-                       sc.nr_reclaimed += reclaim_state->reclaimed_slab;
-                       total_scanned += sc.nr_scanned;
 
-                       if (zone->all_unreclaimable)
-                               continue;
-                       if (nr_slab == 0 &&
-                           !zone_reclaimable(zone))
-                               zone->all_unreclaimable = 1;
+                               reclaim_state->reclaimed_slab = 0;
+                               nr_slab = shrink_slab(&shrink, sc.nr_scanned, lru_pages);
+                               sc.nr_reclaimed += reclaim_state->reclaimed_slab;
+                               total_scanned += sc.nr_scanned;
+
+                               if (nr_slab == 0 && !zone_reclaimable(zone))
+                                       zone->all_unreclaimable = 1;
+                       }
+
                        /*
                         * If we've done a decent amount of scanning and
                         * the reclaim ratio is low, start doing writepage
@@ -2531,6 +2530,12 @@ loop_again:
                            total_scanned > sc.nr_reclaimed + sc.nr_reclaimed / 2)
                                sc.may_writepage = 1;
 
+                       if (zone->all_unreclaimable) {
+                               if (end_zone && end_zone == i)
+                                       end_zone--;
+                               continue;
+                       }
+
                        if (!zone_watermark_ok_safe(zone, order,
                                        high_wmark_pages(zone), end_zone, 0)) {
                                all_zones_ok = 0;
@@ -2709,8 +2714,8 @@ static void kswapd_try_to_sleep(pg_data_t *pgdat, int order, int classzone_idx)
  */
 static int kswapd(void *p)
 {
-       unsigned long order;
-       int classzone_idx;
+       unsigned long order, new_order;
+       int classzone_idx, new_classzone_idx;
        pg_data_t *pgdat = (pg_data_t*)p;
        struct task_struct *tsk = current;
 
@@ -2740,17 +2745,23 @@ static int kswapd(void *p)
        tsk->flags |= PF_MEMALLOC | PF_SWAPWRITE | PF_KSWAPD;
        set_freezable();
 
-       order = 0;
-       classzone_idx = MAX_NR_ZONES - 1;
+       order = new_order = 0;
+       classzone_idx = new_classzone_idx = pgdat->nr_zones - 1;
        for ( ; ; ) {
-               unsigned long new_order;
-               int new_classzone_idx;
                int ret;
 
-               new_order = pgdat->kswapd_max_order;
-               new_classzone_idx = pgdat->classzone_idx;
-               pgdat->kswapd_max_order = 0;
-               pgdat->classzone_idx = MAX_NR_ZONES - 1;
+               /*
+                * If the last balance_pgdat was unsuccessful it's unlikely a
+                * new request of a similar or harder type will succeed soon
+                * so consider going to sleep on the basis we reclaimed at
+                */
+               if (classzone_idx >= new_classzone_idx && order == new_order) {
+                       new_order = pgdat->kswapd_max_order;
+                       new_classzone_idx = pgdat->classzone_idx;
+                       pgdat->kswapd_max_order =  0;
+                       pgdat->classzone_idx = pgdat->nr_zones - 1;
+               }
+
                if (order < new_order || classzone_idx > new_classzone_idx) {
                        /*
                         * Don't sleep if someone wants a larger 'order'
@@ -2763,7 +2774,7 @@ static int kswapd(void *p)
                        order = pgdat->kswapd_max_order;
                        classzone_idx = pgdat->classzone_idx;
                        pgdat->kswapd_max_order = 0;
-                       pgdat->classzone_idx = MAX_NR_ZONES - 1;
+                       pgdat->classzone_idx = pgdat->nr_zones - 1;
                }
 
                ret = try_to_freeze();
index 7ea5cf9ea08a9db7f3b6edaf083f14030914463c..86bff9b1ac4741b7a6c36fe6c8c98d8cab7bc610 100644 (file)
@@ -586,9 +586,14 @@ static void vlan_dev_uninit(struct net_device *dev)
 static u32 vlan_dev_fix_features(struct net_device *dev, u32 features)
 {
        struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
+       u32 old_features = features;
 
        features &= real_dev->features;
        features &= real_dev->vlan_features;
+
+       if (old_features & NETIF_F_SOFT_FEATURES)
+               features |= old_features & NETIF_F_SOFT_FEATURES;
+
        if (dev_ethtool_get_rx_csum(real_dev))
                features |= NETIF_F_RXCSUM;
        features |= NETIF_F_LLTX;
index c188c803c09c5085014b5bb221aeb57c8fba4871..32b8f9f7f79e4a5ce555e4c803f7ecd79878006e 100644 (file)
@@ -49,7 +49,9 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
        skb_pull(skb, ETH_HLEN);
 
        rcu_read_lock();
-       if (is_multicast_ether_addr(dest)) {
+       if (is_broadcast_ether_addr(dest))
+               br_flood_deliver(br, skb);
+       else if (is_multicast_ether_addr(dest)) {
                if (unlikely(netpoll_tx_running(dev))) {
                        br_flood_deliver(br, skb);
                        goto out;
index f3ac1e858ee1c321484fc59a67451efab47e0f0d..f06ee39c73fd64dfe958e6f94e735e60e3ba0b78 100644 (file)
@@ -60,7 +60,7 @@ int br_handle_frame_finish(struct sk_buff *skb)
        br = p->br;
        br_fdb_update(br, p, eth_hdr(skb)->h_source);
 
-       if (is_multicast_ether_addr(dest) &&
+       if (!is_broadcast_ether_addr(dest) && is_multicast_ether_addr(dest) &&
            br_multicast_rcv(br, p, skb))
                goto drop;
 
@@ -77,7 +77,9 @@ int br_handle_frame_finish(struct sk_buff *skb)
 
        dst = NULL;
 
-       if (is_multicast_ether_addr(dest)) {
+       if (is_broadcast_ether_addr(dest))
+               skb2 = skb;
+       else if (is_multicast_ether_addr(dest)) {
                mdst = br_mdb_get(br, skb);
                if (mdst || BR_INPUT_SKB_CB_MROUTERS_ONLY(skb)) {
                        if ((mdst && mdst->mglist) ||
index 9cb627a4073aef3007afe4dd600ae96d85f0af0b..7330c2757c0c23c6cf0f11b1331d59de82983690 100644 (file)
@@ -477,8 +477,9 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc,
        calc_layout(osdc, vino, layout, off, plen, req, ops);
        req->r_file_layout = *layout;  /* keep a copy */
 
-       /* in case it differs from natural alignment that calc_layout
-          filled in for us */
+       /* in case it differs from natural (file) alignment that
+          calc_layout filled in for us */
+       req->r_num_pages = calc_pages_for(page_align, *plen);
        req->r_page_alignment = page_align;
 
        ceph_osdc_build_request(req, off, plen, ops,
@@ -2027,8 +2028,9 @@ static struct ceph_msg *get_reply(struct ceph_connection *con,
                int want = calc_pages_for(req->r_page_alignment, data_len);
 
                if (unlikely(req->r_num_pages < want)) {
-                       pr_warning("tid %lld reply %d > expected %d pages\n",
-                                  tid, want, m->nr_pages);
+                       pr_warning("tid %lld reply has %d bytes %d pages, we"
+                                  " had only %d pages ready\n", tid, data_len,
+                                  want, req->r_num_pages);
                        *skip = 1;
                        ceph_msg_put(m);
                        m = NULL;
index 9ccca038444f11fda683bbed8bf56ad0d5e1b65e..6135f3671692689b773c2289d940ecabb29c6a26 100644 (file)
@@ -190,7 +190,8 @@ void *dst_alloc(struct dst_ops *ops, struct net_device *dev,
        dst->lastuse = jiffies;
        dst->flags = flags;
        dst->next = NULL;
-       dst_entries_add(ops, 1);
+       if (!(flags & DST_NOCOUNT))
+               dst_entries_add(ops, 1);
        return dst;
 }
 EXPORT_SYMBOL(dst_alloc);
@@ -243,7 +244,8 @@ again:
                neigh_release(neigh);
        }
 
-       dst_entries_add(dst->ops, -1);
+       if (!(dst->flags & DST_NOCOUNT))
+               dst_entries_add(dst->ops, -1);
 
        if (dst->ops->destroy)
                dst->ops->destroy(dst);
index eae1f676f870a8e219bcb3ee4a28453961604def..ef1528af7abf0f9dadb567f4156f4e10da360828 100644 (file)
@@ -465,8 +465,10 @@ int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
        if (addr_len < sizeof(struct sockaddr_in))
                goto out;
 
-       if (addr->sin_family != AF_INET)
+       if (addr->sin_family != AF_INET) {
+               err = -EAFNOSUPPORT;
                goto out;
+       }
 
        chk_addr_ret = inet_addr_type(sock_net(sk), addr->sin_addr.s_addr);
 
index 4a7e16b5d3f34b53b3470711a779972d9195dc94..84f26e8e6c6075a53806f7392eff87782df42151 100644 (file)
@@ -828,7 +828,7 @@ static int __ip_append_data(struct sock *sk,
        cork->length += length;
        if (((length > mtu) || (skb && skb_is_gso(skb))) &&
            (sk->sk_protocol == IPPROTO_UDP) &&
-           (rt->dst.dev->features & NETIF_F_UFO)) {
+           (rt->dst.dev->features & NETIF_F_UFO) && !rt->dst.header_len) {
                err = ip_ufo_append_data(sk, queue, getfrag, from, length,
                                         hh_len, fragheaderlen, transhdrlen,
                                         mtu, flags);
index 054a59d21eb0d4211bf4857f6a15b33d5e80abdc..46febcacb729f0657c9c325ee18f007c2f9fe417 100644 (file)
@@ -3220,7 +3220,7 @@ __setup("thash_entries=", set_thash_entries);
 void __init tcp_init(void)
 {
        struct sk_buff *skb = NULL;
-       unsigned long nr_pages, limit;
+       unsigned long limit;
        int i, max_share, cnt;
        unsigned long jiffy = jiffies;
 
@@ -3277,13 +3277,7 @@ void __init tcp_init(void)
        sysctl_tcp_max_orphans = cnt / 2;
        sysctl_max_syn_backlog = max(128, cnt / 256);
 
-       /* Set the pressure threshold to be a fraction of global memory that
-        * is up to 1/2 at 256 MB, decreasing toward zero with the amount of
-        * memory, with a floor of 128 pages.
-        */
-       nr_pages = totalram_pages - totalhigh_pages;
-       limit = min(nr_pages, 1UL<<(28-PAGE_SHIFT)) >> (20-PAGE_SHIFT);
-       limit = (limit * (nr_pages >> (20-PAGE_SHIFT))) >> (PAGE_SHIFT-11);
+       limit = nr_free_buffer_pages() / 8;
        limit = max(limit, 128UL);
        sysctl_tcp_mem[0] = limit / 4 * 3;
        sysctl_tcp_mem[1] = limit;
index 48cd88e625539cb7b94b34747233d57c1543bcee..198f75b7bdd3d0d6b2c43f1e4f71183667948d24 100644 (file)
@@ -2209,16 +2209,10 @@ void __init udp_table_init(struct udp_table *table, const char *name)
 
 void __init udp_init(void)
 {
-       unsigned long nr_pages, limit;
+       unsigned long limit;
 
        udp_table_init(&udp_table, "UDP");
-       /* Set the pressure threshold up by the same strategy of TCP. It is a
-        * fraction of global memory that is up to 1/2 at 256 MB, decreasing
-        * toward zero with the amount of memory, with a floor of 128 pages.
-        */
-       nr_pages = totalram_pages - totalhigh_pages;
-       limit = min(nr_pages, 1UL<<(28-PAGE_SHIFT)) >> (20-PAGE_SHIFT);
-       limit = (limit * (nr_pages >> (20-PAGE_SHIFT))) >> (PAGE_SHIFT-11);
+       limit = nr_free_buffer_pages() / 8;
        limit = max(limit, 128UL);
        sysctl_udp_mem[0] = limit / 4 * 3;
        sysctl_udp_mem[1] = limit;
index 2d51840e53a114be661abd42200a632b9ebf791e..327a617d594cd04929ffa668082ed575b0f54d7f 100644 (file)
@@ -32,7 +32,12 @@ static int xfrm4_tunnel_check_size(struct sk_buff *skb)
        dst = skb_dst(skb);
        mtu = dst_mtu(dst);
        if (skb->len > mtu) {
-               icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu));
+               if (skb->sk)
+                       ip_local_error(skb->sk, EMSGSIZE, ip_hdr(skb)->daddr,
+                                      inet_sk(skb->sk)->inet_dport, mtu);
+               else
+                       icmp_send(skb, ICMP_DEST_UNREACH,
+                                 ICMP_FRAG_NEEDED, htonl(mtu));
                ret = -EMSGSIZE;
        }
 out:
index d450a2f9fc0645b7addef3fcbf2d586e89d86da7..3b5669a2582df03c1f1b896991fba664e137d62e 100644 (file)
@@ -274,7 +274,7 @@ int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
                return -EINVAL;
 
        if (addr->sin6_family != AF_INET6)
-               return -EINVAL;
+               return -EAFNOSUPPORT;
 
        addr_type = ipv6_addr_type(&addr->sin6_addr);
        if ((addr_type & IPV6_ADDR_MULTICAST) && sock->type == SOCK_STREAM)
index de2b1decd78668d832937cf525115152411bb075..0ef1f086feb8ec294ed71fef231f0cab1642faa7 100644 (file)
@@ -228,9 +228,10 @@ static struct rt6_info ip6_blk_hole_entry_template = {
 
 /* allocate dst with ip6_dst_ops */
 static inline struct rt6_info *ip6_dst_alloc(struct dst_ops *ops,
-                                            struct net_device *dev)
+                                            struct net_device *dev,
+                                            int flags)
 {
-       struct rt6_info *rt = dst_alloc(ops, dev, 0, 0, 0);
+       struct rt6_info *rt = dst_alloc(ops, dev, 0, 0, flags);
 
        memset(&rt->rt6i_table, 0, sizeof(*rt) - sizeof(struct dst_entry));
 
@@ -1042,7 +1043,7 @@ struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
        if (unlikely(idev == NULL))
                return NULL;
 
-       rt = ip6_dst_alloc(&net->ipv6.ip6_dst_ops, dev);
+       rt = ip6_dst_alloc(&net->ipv6.ip6_dst_ops, dev, 0);
        if (unlikely(rt == NULL)) {
                in6_dev_put(idev);
                goto out;
@@ -1062,14 +1063,6 @@ struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
        dst_metric_set(&rt->dst, RTAX_HOPLIMIT, 255);
        rt->dst.output  = ip6_output;
 
-#if 0  /* there's no chance to use these for ndisc */
-       rt->dst.flags   = ipv6_addr_type(addr) & IPV6_ADDR_UNICAST
-                               ? DST_HOST
-                               : 0;
-       ipv6_addr_copy(&rt->rt6i_dst.addr, addr);
-       rt->rt6i_dst.plen = 128;
-#endif
-
        spin_lock_bh(&icmp6_dst_lock);
        rt->dst.next = icmp6_dst_gc_list;
        icmp6_dst_gc_list = &rt->dst;
@@ -1214,7 +1207,7 @@ int ip6_route_add(struct fib6_config *cfg)
                goto out;
        }
 
-       rt = ip6_dst_alloc(&net->ipv6.ip6_dst_ops, NULL);
+       rt = ip6_dst_alloc(&net->ipv6.ip6_dst_ops, NULL, DST_NOCOUNT);
 
        if (rt == NULL) {
                err = -ENOMEM;
@@ -1244,7 +1237,7 @@ int ip6_route_add(struct fib6_config *cfg)
        ipv6_addr_prefix(&rt->rt6i_dst.addr, &cfg->fc_dst, cfg->fc_dst_len);
        rt->rt6i_dst.plen = cfg->fc_dst_len;
        if (rt->rt6i_dst.plen == 128)
-              rt->dst.flags = DST_HOST;
+              rt->dst.flags |= DST_HOST;
 
 #ifdef CONFIG_IPV6_SUBTREES
        ipv6_addr_prefix(&rt->rt6i_src.addr, &cfg->fc_src, cfg->fc_src_len);
@@ -1734,7 +1727,7 @@ static struct rt6_info * ip6_rt_copy(struct rt6_info *ort)
 {
        struct net *net = dev_net(ort->rt6i_dev);
        struct rt6_info *rt = ip6_dst_alloc(&net->ipv6.ip6_dst_ops,
-                                           ort->dst.dev);
+                                           ort->dst.dev, 0);
 
        if (rt) {
                rt->dst.input = ort->dst.input;
@@ -2013,7 +2006,7 @@ struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev,
 {
        struct net *net = dev_net(idev->dev);
        struct rt6_info *rt = ip6_dst_alloc(&net->ipv6.ip6_dst_ops,
-                                           net->loopback_dev);
+                                           net->loopback_dev, 0);
        struct neighbour *neigh;
 
        if (rt == NULL) {
@@ -2025,7 +2018,7 @@ struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev,
 
        in6_dev_hold(idev);
 
-       rt->dst.flags = DST_HOST;
+       rt->dst.flags |= DST_HOST;
        rt->dst.input = ip6_input;
        rt->dst.output = ip6_output;
        rt->rt6i_idev = idev;
index 9dc3b5f26e80c800a306aca5287b0e22fcda5378..d91c1a26630dc07a00ec22547e13ca7a02620f33 100644 (file)
@@ -154,7 +154,13 @@ update_iv:
        return RX_CONTINUE;
 
 mic_fail:
-       mac80211_ev_michael_mic_failure(rx->sdata, rx->key->conf.keyidx,
+       /*
+        * In some cases the key can be unset - e.g. a multicast packet, in
+        * a driver that supports HW encryption. Send up the key idx only if
+        * the key is set.
+        */
+       mac80211_ev_michael_mic_failure(rx->sdata,
+                                       rx->key ? rx->key->conf.keyidx : -1,
                                        (void *) skb->data, NULL, GFP_ATOMIC);
        return RX_DROP_UNUSABLE;
 }
index 67380a29e2e9a93c33a6dfd7d0b8f497c9789eba..207175b2f40a9cdaaaba8fcc6e8ac8e02cc9769f 100644 (file)
@@ -1058,7 +1058,6 @@ SCTP_STATIC __init int sctp_init(void)
        int status = -EINVAL;
        unsigned long goal;
        unsigned long limit;
-       unsigned long nr_pages;
        int max_share;
        int order;
 
@@ -1148,15 +1147,7 @@ SCTP_STATIC __init int sctp_init(void)
        /* Initialize handle used for association ids. */
        idr_init(&sctp_assocs_id);
 
-       /* Set the pressure threshold to be a fraction of global memory that
-        * is up to 1/2 at 256 MB, decreasing toward zero with the amount of
-        * memory, with a floor of 128 pages.
-        * Note this initializes the data in sctpv6_prot too
-        * Unabashedly stolen from tcp_init
-        */
-       nr_pages = totalram_pages - totalhigh_pages;
-       limit = min(nr_pages, 1UL<<(28-PAGE_SHIFT)) >> (20-PAGE_SHIFT);
-       limit = (limit * (nr_pages >> (20-PAGE_SHIFT))) >> (PAGE_SHIFT-11);
+       limit = nr_free_buffer_pages() / 8;
        limit = max(limit, 128UL);
        sysctl_sctp_mem[0] = limit / 4 * 3;
        sysctl_sctp_mem[1] = limit;
index 6766913a53e626279a7a2f4eb543e1f9fa7b5263..08c6238802de1fad5b81d1e7943ebc61c7430952 100644 (file)
@@ -2073,10 +2073,33 @@ static int sctp_setsockopt_disable_fragments(struct sock *sk,
 static int sctp_setsockopt_events(struct sock *sk, char __user *optval,
                                  unsigned int optlen)
 {
+       struct sctp_association *asoc;
+       struct sctp_ulpevent *event;
+
        if (optlen > sizeof(struct sctp_event_subscribe))
                return -EINVAL;
        if (copy_from_user(&sctp_sk(sk)->subscribe, optval, optlen))
                return -EFAULT;
+
+       /*
+        * At the time when a user app subscribes to SCTP_SENDER_DRY_EVENT,
+        * if there is no data to be sent or retransmit, the stack will
+        * immediately send up this notification.
+        */
+       if (sctp_ulpevent_type_enabled(SCTP_SENDER_DRY_EVENT,
+                                      &sctp_sk(sk)->subscribe)) {
+               asoc = sctp_id2assoc(sk, 0);
+
+               if (asoc && sctp_outq_is_empty(&asoc->outqueue)) {
+                       event = sctp_ulpevent_make_sender_dry_event(asoc,
+                                       GFP_ATOMIC);
+                       if (!event)
+                               return -ENOMEM;
+
+                       sctp_ulpq_tail_event(&asoc->ulpq, event);
+               }
+       }
+
        return 0;
 }
 
index 98fa8eb6cc4bec27e6adbf737c3653392da32adc..f07602d7bf68595fa73effe1ff90f759cd3f0447 100644 (file)
@@ -6463,7 +6463,8 @@ void nl80211_michael_mic_failure(struct cfg80211_registered_device *rdev,
        if (addr)
                NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, addr);
        NLA_PUT_U32(msg, NL80211_ATTR_KEY_TYPE, key_type);
-       NLA_PUT_U8(msg, NL80211_ATTR_KEY_IDX, key_id);
+       if (key_id != -1)
+               NLA_PUT_U8(msg, NL80211_ATTR_KEY_IDX, key_id);
        if (tsc)
                NLA_PUT(msg, NL80211_ATTR_KEY_SEQ, 6, tsc);
 
index 9bec2e8a838c384e420e8eea4f60244f357e545a..5ce74a385525c9a5ef036428670663d1d924e063 100644 (file)
@@ -50,7 +50,7 @@ static struct xfrm_policy_afinfo *xfrm_policy_get_afinfo(unsigned short family);
 static void xfrm_policy_put_afinfo(struct xfrm_policy_afinfo *afinfo);
 static void xfrm_init_pmtu(struct dst_entry *dst);
 static int stale_bundle(struct dst_entry *dst);
-static int xfrm_bundle_ok(struct xfrm_dst *xdst, int family);
+static int xfrm_bundle_ok(struct xfrm_dst *xdst);
 
 
 static struct xfrm_policy *__xfrm_policy_unlink(struct xfrm_policy *pol,
@@ -2241,7 +2241,7 @@ static struct dst_entry *xfrm_dst_check(struct dst_entry *dst, u32 cookie)
 
 static int stale_bundle(struct dst_entry *dst)
 {
-       return !xfrm_bundle_ok((struct xfrm_dst *)dst, AF_UNSPEC);
+       return !xfrm_bundle_ok((struct xfrm_dst *)dst);
 }
 
 void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev)
@@ -2313,7 +2313,7 @@ static void xfrm_init_pmtu(struct dst_entry *dst)
  * still valid.
  */
 
-static int xfrm_bundle_ok(struct xfrm_dst *first, int family)
+static int xfrm_bundle_ok(struct xfrm_dst *first)
 {
        struct dst_entry *dst = &first->u.dst;
        struct xfrm_dst *last;
index d21191dcfe8809e27d8fe9da883b796b20d18322..b48fb43b5448bd7d400c75de0acd6355d7156f28 100644 (file)
@@ -2715,17 +2715,30 @@ typedef int (*getput_call_t)(struct snd_kcontrol *kcontrol,
 
 static int alc_cap_getput_caller(struct snd_kcontrol *kcontrol,
                                 struct snd_ctl_elem_value *ucontrol,
-                                getput_call_t func)
+                                getput_call_t func, bool check_adc_switch)
 {
        struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
        struct alc_spec *spec = codec->spec;
-       unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
-       int err;
+       int i, err = 0;
 
        mutex_lock(&codec->control_mutex);
-       kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[adc_idx],
-                                                     3, 0, HDA_INPUT);
-       err = func(kcontrol, ucontrol);
+       if (check_adc_switch && spec->dual_adc_switch) {
+               for (i = 0; i < spec->num_adc_nids; i++) {
+                       kcontrol->private_value =
+                               HDA_COMPOSE_AMP_VAL(spec->adc_nids[i],
+                                                   3, 0, HDA_INPUT);
+                       err = func(kcontrol, ucontrol);
+                       if (err < 0)
+                               goto error;
+               }
+       } else {
+               i = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
+               kcontrol->private_value =
+                       HDA_COMPOSE_AMP_VAL(spec->adc_nids[i],
+                                           3, 0, HDA_INPUT);
+               err = func(kcontrol, ucontrol);
+       }
+ error:
        mutex_unlock(&codec->control_mutex);
        return err;
 }
@@ -2734,14 +2747,14 @@ static int alc_cap_vol_get(struct snd_kcontrol *kcontrol,
                           struct snd_ctl_elem_value *ucontrol)
 {
        return alc_cap_getput_caller(kcontrol, ucontrol,
-                                    snd_hda_mixer_amp_volume_get);
+                                    snd_hda_mixer_amp_volume_get, false);
 }
 
 static int alc_cap_vol_put(struct snd_kcontrol *kcontrol,
                           struct snd_ctl_elem_value *ucontrol)
 {
        return alc_cap_getput_caller(kcontrol, ucontrol,
-                                    snd_hda_mixer_amp_volume_put);
+                                    snd_hda_mixer_amp_volume_put, true);
 }
 
 /* capture mixer elements */
@@ -2751,14 +2764,14 @@ static int alc_cap_sw_get(struct snd_kcontrol *kcontrol,
                          struct snd_ctl_elem_value *ucontrol)
 {
        return alc_cap_getput_caller(kcontrol, ucontrol,
-                                    snd_hda_mixer_amp_switch_get);
+                                    snd_hda_mixer_amp_switch_get, false);
 }
 
 static int alc_cap_sw_put(struct snd_kcontrol *kcontrol,
                          struct snd_ctl_elem_value *ucontrol)
 {
        return alc_cap_getput_caller(kcontrol, ucontrol,
-                                    snd_hda_mixer_amp_switch_put);
+                                    snd_hda_mixer_amp_switch_put, true);
 }
 
 #define _DEFINE_CAPMIX(num) \
index b5101efd1c8733bd002cf5ae700f5807b665ebed..f1fd95bb6416ce0b44e750e356d4ddc95346f31c 100644 (file)
@@ -138,11 +138,20 @@ static snd_pcm_uframes_t bf5xx_pcm_pointer(struct snd_pcm_substream *substream)
        pr_debug("%s enter\n", __func__);
        if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
                diff = sport_curr_offset_tx(sport);
-               frames = bytes_to_frames(substream->runtime, diff);
        } else {
                diff = sport_curr_offset_rx(sport);
-               frames = bytes_to_frames(substream->runtime, diff);
        }
+
+       /*
+        * TX at least can report one frame beyond the end of the
+        * buffer if we hit the wraparound case - clamp to within the
+        * buffer as the ALSA APIs require.
+        */
+       if (diff == snd_pcm_lib_buffer_bytes(substream))
+               diff = 0;
+
+       frames = bytes_to_frames(substream->runtime, diff);
+
        return frames;
 }
 
index 4be0570e3f1fc167fad8682e27f33dd7c810dd30..65f46047b1cbd21d0d9441966ae6ceb6c5c6120e 100644 (file)
@@ -357,7 +357,7 @@ static int ak4642_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
        default:
                return -EINVAL;
        }
-       snd_soc_update_bits(codec, PW_MGMT2, MS, data);
+       snd_soc_update_bits(codec, PW_MGMT2, MS | MCKO | PMPLL, data);
        snd_soc_update_bits(codec, MD_CTL1, BCKO_MASK, bcko);
 
        /* format type */
index e2a7608d39449cb53151685f2dafaf21d13f8d21..7859bdcc93db4064cad1474a8fe2533e19026f1e 100644 (file)
@@ -161,10 +161,18 @@ static int aic26_hw_params(struct snd_pcm_substream *substream,
                dev_dbg(&aic26->spi->dev, "bad format\n"); return -EINVAL;
        }
 
-       /* Configure PLL */
+       /**
+        * Configure PLL
+        * fsref = (mclk * PLLM) / 2048
+        * where PLLM = J.DDDD (DDDD register ranges from 0 to 9999, decimal)
+        */
        pval = 1;
-       jval = (fsref == 44100) ? 7 : 8;
-       dval = (fsref == 44100) ? 5264 : 1920;
+       /* compute J portion of multiplier */
+       jval = fsref / (aic26->mclk / 2048);
+       /* compute fractional DDDD component of multiplier */
+       dval = fsref - (jval * (aic26->mclk / 2048));
+       dval = (10000 * dval) / (aic26->mclk / 2048);
+       dev_dbg(&aic26->spi->dev, "Setting PLLM to %d.%04d\n", jval, dval);
        qval = 0;
        reg = 0x8000 | qval << 11 | pval << 8 | jval << 2;
        aic26_reg_write(codec, AIC26_REG_PLL_PROG1, reg);
index c3d96fc8c26734855de19a32bd1747531e914df6..789453d44ec5d212d2974d8c1db28dc95b81b52f 100644 (file)
@@ -1114,12 +1114,19 @@ static int aic3x_set_power(struct snd_soc_codec *codec, int power)
 
                /* Sync reg_cache with the hardware */
                codec->cache_only = 0;
-               for (i = 0; i < ARRAY_SIZE(aic3x_reg); i++)
+               for (i = AIC3X_SAMPLE_RATE_SEL_REG; i < ARRAY_SIZE(aic3x_reg); i++)
                        snd_soc_write(codec, i, cache[i]);
                if (aic3x->model == AIC3X_MODEL_3007)
                        aic3x_init_3007(codec);
                codec->cache_sync = 0;
        } else {
+               /*
+                * Do soft reset to this codec instance in order to clear
+                * possible VDD leakage currents in case the supply regulators
+                * remain on
+                */
+               snd_soc_write(codec, AIC3X_RESET, SOFT_RESET);
+               codec->cache_sync = 1;
                aic3x->power = 0;
                /* HW writes are needless when bias is off */
                codec->cache_only = 1;
index 2dc964b55e4fa15ce23fec72fbc7c7925f8fbc1e..76b4361e9b8042c112a32b14b290304e17761604 100644 (file)
@@ -175,6 +175,7 @@ static const struct snd_kcontrol_new wm8731_input_mux_controls =
 SOC_DAPM_ENUM("Input Select", wm8731_insel_enum);
 
 static const struct snd_soc_dapm_widget wm8731_dapm_widgets[] = {
+SND_SOC_DAPM_SUPPLY("ACTIVE",WM8731_ACTIVE, 0, 0, NULL, 0),
 SND_SOC_DAPM_SUPPLY("OSC", WM8731_PWR, 5, 1, NULL, 0),
 SND_SOC_DAPM_MIXER("Output Mixer", WM8731_PWR, 4, 1,
        &wm8731_output_mixer_controls[0],
@@ -204,6 +205,8 @@ static int wm8731_check_osc(struct snd_soc_dapm_widget *source,
 static const struct snd_soc_dapm_route wm8731_intercon[] = {
        {"DAC", NULL, "OSC", wm8731_check_osc},
        {"ADC", NULL, "OSC", wm8731_check_osc},
+       {"DAC", NULL, "ACTIVE"},
+       {"ADC", NULL, "ACTIVE"},
 
        /* output mixer */
        {"Output Mixer", "Line Bypass Switch", "Line Input"},
@@ -315,29 +318,6 @@ static int wm8731_hw_params(struct snd_pcm_substream *substream,
        return 0;
 }
 
-static int wm8731_pcm_prepare(struct snd_pcm_substream *substream,
-                             struct snd_soc_dai *dai)
-{
-       struct snd_soc_codec *codec = dai->codec;
-
-       /* set active */
-       snd_soc_write(codec, WM8731_ACTIVE, 0x0001);
-
-       return 0;
-}
-
-static void wm8731_shutdown(struct snd_pcm_substream *substream,
-                           struct snd_soc_dai *dai)
-{
-       struct snd_soc_codec *codec = dai->codec;
-
-       /* deactivate */
-       if (!codec->active) {
-               udelay(50);
-               snd_soc_write(codec, WM8731_ACTIVE, 0x0);
-       }
-}
-
 static int wm8731_mute(struct snd_soc_dai *dai, int mute)
 {
        struct snd_soc_codec *codec = dai->codec;
@@ -480,7 +460,6 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec,
                snd_soc_write(codec, WM8731_PWR, reg | 0x0040);
                break;
        case SND_SOC_BIAS_OFF:
-               snd_soc_write(codec, WM8731_ACTIVE, 0x0);
                snd_soc_write(codec, WM8731_PWR, 0xffff);
                regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies),
                                       wm8731->supplies);
@@ -496,9 +475,7 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec,
        SNDRV_PCM_FMTBIT_S24_LE)
 
 static struct snd_soc_dai_ops wm8731_dai_ops = {
-       .prepare        = wm8731_pcm_prepare,
        .hw_params      = wm8731_hw_params,
-       .shutdown       = wm8731_shutdown,
        .digital_mute   = wm8731_mute,
        .set_sysclk     = wm8731_set_dai_sysclk,
        .set_fmt        = wm8731_set_dai_fmt,
index 970a95c5360bfc271fd9a43c0a259bedd2d0d7a9..c2fc0356c2a44daac0c9a3fffd96e0119cd4ba3e 100644 (file)
@@ -1713,6 +1713,8 @@ static int _wm8994_set_fll(struct snd_soc_codec *codec, int id, int src,
                snd_soc_update_bits(codec, WM8994_FLL1_CONTROL_1 + reg_offset,
                                    WM8994_FLL1_ENA | WM8994_FLL1_FRAC,
                                    reg);
+
+               msleep(5);
        }
 
        wm8994->fll[id].in = freq_in;
index 4173b3d87f979d2757f1498bd503f15b07195542..43fdc24f7e8d6fdf323f096fee6c01682c433a24 100644 (file)
@@ -110,12 +110,12 @@ static int imx_ssi_dma_alloc(struct snd_pcm_substream *substream,
                slave_config.direction = DMA_TO_DEVICE;
                slave_config.dst_addr = dma_params->dma_addr;
                slave_config.dst_addr_width = buswidth;
-               slave_config.dst_maxburst = dma_params->burstsize * buswidth;
+               slave_config.dst_maxburst = dma_params->burstsize;
        } else {
                slave_config.direction = DMA_FROM_DEVICE;
                slave_config.src_addr = dma_params->dma_addr;
                slave_config.src_addr_width = buswidth;
-               slave_config.src_maxburst = dma_params->burstsize * buswidth;
+               slave_config.src_maxburst = dma_params->burstsize;
        }
 
        ret = dmaengine_slave_config(iprtd->dma_chan, &slave_config);
index d75043ed7fc0551f66881675df110dede0d5ccf0..b194be09e74d623220e06e3addb5bb4bfcf9fb70 100644 (file)
@@ -1929,8 +1929,9 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
                 "%s", card->name);
        snprintf(card->snd_card->longname, sizeof(card->snd_card->longname),
                 "%s", card->long_name ? card->long_name : card->name);
-       snprintf(card->snd_card->driver, sizeof(card->snd_card->driver),
-                "%s", card->driver_name ? card->driver_name : card->name);
+       if (card->driver_name)
+               strlcpy(card->snd_card->driver, card->driver_name,
+                       sizeof(card->snd_card->driver));
 
        if (card->late_probe) {
                ret = card->late_probe(card);
index 6b817e20548ca07fa94938caf8202bc37b9b0386..95f03c10b4f7401da2686d2b6ff0d904e749ea87 100644 (file)
@@ -222,12 +222,18 @@ static int tegra_i2s_hw_params(struct snd_pcm_substream *substream,
        if (i2sclock % (2 * srate))
                reg |= TEGRA_I2S_TIMING_NON_SYM_ENABLE;
 
+       if (!i2s->clk_refs)
+               clk_enable(i2s->clk_i2s);
+
        tegra_i2s_write(i2s, TEGRA_I2S_TIMING, reg);
 
        tegra_i2s_write(i2s, TEGRA_I2S_FIFO_SCR,
                TEGRA_I2S_FIFO_SCR_FIFO2_ATN_LVL_FOUR_SLOTS |
                TEGRA_I2S_FIFO_SCR_FIFO1_ATN_LVL_FOUR_SLOTS);
 
+       if (!i2s->clk_refs)
+               clk_disable(i2s->clk_i2s);
+
        return 0;
 }