Merge tag 'for-linus' of git://github.com/rustyrussell/linux
Linus Torvalds [Sat, 14 Jan 2012 20:32:16 +0000 (12:32 -0800)]
Autogenerated GPG tag for Rusty D1ADB8F1: 15EE 8D6C AB0E 7F0C F999  BFCB D920 0E6C D1AD B8F1

* tag 'for-linus' of git://github.com/rustyrussell/linux:
  module_param: check that bool parameters really are bool.
  intelfbdrv.c: bailearly is an int module_param
  paride/pcd: fix bool verbose module parameter.
  module_param: make bool parameters really bool (drivers & misc)
  module_param: make bool parameters really bool (arch)
  module_param: make bool parameters really bool (core code)
  kernel/async: remove redundant declaration.
  printk: fix unnecessary module_param_name.
  lirc_parallel: fix module parameter description.
  module_param: avoid bool abuse, add bint for special cases.
  module_param: check type correctness for module_param_array
  modpost: use linker section to generate table.
  modpost: use a table rather than a giant if/else statement.
  modules: sysfs - export: taint, coresize, initsize
  kernel/params: replace DEBUGP with pr_debug
  module: replace DEBUGP with pr_debug
  module: struct module_ref should contains long fields
  module: Fix performance regression on modules with large symbol tables
  module: Add comments describing how the "strmap" logic works

Fix up conflicts in scripts/mod/file2alias.c due to the new linker-
generated table approach to adding __mod_*_device_table entries.  The
ARM sa11x0 mcp bus needed to be converted to that too.

491 files changed:
CREDITS
Documentation/ABI/testing/sysfs-kernel-slab
Documentation/cgroups/memory.txt
Documentation/devicetree/bindings/mfd/mc13xxx.txt [new file with mode: 0644]
Documentation/devicetree/bindings/mfd/twl-familly.txt [new file with mode: 0644]
Documentation/dma-buf-sharing.txt
Documentation/filesystems/ceph.txt
Documentation/filesystems/nfs/00-INDEX
Documentation/filesystems/nfs/fault_injection.txt [new file with mode: 0644]
Documentation/filesystems/proc.txt
Documentation/filesystems/squashfs.txt
Documentation/mmc/mmc-dev-attrs.txt
Documentation/mmc/mmc-dev-parts.txt
Documentation/sysctl/kernel.txt
Documentation/vm/slub.txt
MAINTAINERS
arch/Kconfig
arch/arm/mach-sa1100/assabet.c
arch/arm/mach-sa1100/cerf.c
arch/arm/mach-sa1100/collie.c
arch/arm/mach-sa1100/generic.c
arch/arm/mach-sa1100/include/mach/mcp.h
arch/arm/mach-sa1100/lart.c
arch/arm/mach-sa1100/shannon.c
arch/arm/mach-sa1100/simpad.c
arch/arm/mach-ux500/board-mop500.c
arch/arm/mach-ux500/board-u5500.c
arch/arm/mach-ux500/include/mach/irqs-board-mop500.h
arch/arm/plat-samsung/include/plat/sdhci.h
arch/arm/plat-samsung/platformdata.c
arch/avr32/include/asm/system.h
arch/avr32/kernel/traps.c
arch/ia64/include/asm/processor.h
arch/ia64/include/asm/unistd.h
arch/ia64/kernel/entry.S
arch/ia64/kernel/machine_kexec.c
arch/m68k/amiga/config.c
arch/mips/include/asm/ptrace.h
arch/mips/kernel/traps.c
arch/mn10300/include/asm/exceptions.h
arch/parisc/include/asm/processor.h
arch/parisc/kernel/process.c
arch/powerpc/kernel/idle.c
arch/powerpc/kernel/machine_kexec_32.c
arch/powerpc/kernel/machine_kexec_64.c
arch/powerpc/mm/numa.c
arch/powerpc/platforms/pseries/hvCall.S
arch/powerpc/platforms/pseries/lpar.c
arch/powerpc/platforms/pseries/nvram.c
arch/s390/include/asm/processor.h
arch/s390/kernel/nmi.c
arch/sh/kernel/process_32.c
arch/sh/kernel/process_64.c
arch/tile/kernel/machine_kexec.c
arch/x86/Kconfig
arch/x86/Kconfig.cpu
arch/x86/kernel/cpu/mcheck/mce.c
arch/x86/mm/numa.c
arch/x86/um/Kconfig
drivers/Makefile
drivers/base/Kconfig
drivers/base/memory.c
drivers/block/rbd.c
drivers/char/ramoops.c
drivers/gpio/gpio-stmpe.c
drivers/gpu/drm/gma500/cdv_intel_crt.c
drivers/gpu/drm/gma500/cdv_intel_hdmi.c
drivers/gpu/drm/gma500/oaktrail_hdmi.c
drivers/gpu/drm/gma500/psb_intel_sdvo.c
drivers/gpu/drm/nouveau/nouveau_acpi.c
drivers/gpu/drm/nouveau/nouveau_drv.h
drivers/gpu/drm/nouveau/nouveau_state.c
drivers/gpu/drm/radeon/evergreen_cs.c
drivers/gpu/drm/radeon/r100.c
drivers/gpu/drm/radeon/radeon_drv.c
drivers/gpu/drm/radeon/rs600.c
drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
drivers/i2c/busses/i2c-ali1535.c
drivers/i2c/busses/i2c-ali1563.c
drivers/i2c/busses/i2c-ali15x3.c
drivers/i2c/busses/i2c-amd756.c
drivers/i2c/busses/i2c-amd8111.c
drivers/i2c/busses/i2c-at91.c
drivers/i2c/busses/i2c-au1550.c
drivers/i2c/busses/i2c-cpm.c
drivers/i2c/busses/i2c-designware-pcidrv.c
drivers/i2c/busses/i2c-eg20t.c
drivers/i2c/busses/i2c-highlander.c
drivers/i2c/busses/i2c-hydra.c
drivers/i2c/busses/i2c-i801.c
drivers/i2c/busses/i2c-ibm_iic.c
drivers/i2c/busses/i2c-intel-mid.c
drivers/i2c/busses/i2c-iop3xx.c
drivers/i2c/busses/i2c-isch.c
drivers/i2c/busses/i2c-ixp2000.c
drivers/i2c/busses/i2c-mpc.c
drivers/i2c/busses/i2c-mv64xxx.c
drivers/i2c/busses/i2c-nforce2.c
drivers/i2c/busses/i2c-ocores.c
drivers/i2c/busses/i2c-octeon.c
drivers/i2c/busses/i2c-pasemi.c
drivers/i2c/busses/i2c-pca-platform.c
drivers/i2c/busses/i2c-piix4.c
drivers/i2c/busses/i2c-pmcmsp.c
drivers/i2c/busses/i2c-powermac.c
drivers/i2c/busses/i2c-pxa-pci.c
drivers/i2c/busses/i2c-sh7760.c
drivers/i2c/busses/i2c-simtec.c
drivers/i2c/busses/i2c-sis5595.c
drivers/i2c/busses/i2c-sis630.c
drivers/i2c/busses/i2c-sis96x.c
drivers/i2c/busses/i2c-via.c
drivers/i2c/busses/i2c-viapro.c
drivers/i2c/busses/i2c-xiic.c
drivers/i2c/busses/scx200_acb.c
drivers/i2c/i2c-dev.c
drivers/i2c/muxes/gpio-i2cmux.c
drivers/input/misc/ab8500-ponkey.c
drivers/isdn/i4l/Kconfig
drivers/leds/Kconfig
drivers/leds/Makefile
drivers/leds/leds-max8997.c [new file with mode: 0644]
drivers/mfd/88pm860x-i2c.c
drivers/mfd/Kconfig
drivers/mfd/Makefile
drivers/mfd/aat2870-core.c
drivers/mfd/ab5500-core.c
drivers/mfd/ab5500-debugfs.c
drivers/mfd/ab8500-core.c
drivers/mfd/ab8500-debugfs.c
drivers/mfd/ab8500-gpadc.c
drivers/mfd/ab8500-i2c.c
drivers/mfd/ab8500-sysctrl.c
drivers/mfd/cs5535-mfd.c
drivers/mfd/dm355evm_msp.c
drivers/mfd/intel_msic.c
drivers/mfd/jz4740-adc.c
drivers/mfd/lpc_sch.c
drivers/mfd/max8925-i2c.c
drivers/mfd/max8997.c
drivers/mfd/max8998.c
drivers/mfd/mc13xxx-core.c
drivers/mfd/mcp-core.c
drivers/mfd/mcp-sa11x0.c
drivers/mfd/omap-usb-host.c
drivers/mfd/pcf50633-adc.c
drivers/mfd/s5m-core.c [new file with mode: 0644]
drivers/mfd/s5m-irq.c [new file with mode: 0644]
drivers/mfd/sm501.c
drivers/mfd/stmpe-i2c.c [new file with mode: 0644]
drivers/mfd/stmpe-spi.c [new file with mode: 0644]
drivers/mfd/stmpe.c
drivers/mfd/stmpe.h
drivers/mfd/t7l66xb.c
drivers/mfd/tc6387xb.c
drivers/mfd/ti-ssp.c
drivers/mfd/timberdale.c
drivers/mfd/tps65910-irq.c
drivers/mfd/tps65910.c
drivers/mfd/tps65912-spi.c
drivers/mfd/twl-core.c
drivers/mfd/twl4030-audio.c
drivers/mfd/twl4030-irq.c
drivers/mfd/twl4030-madc.c
drivers/mfd/twl4030-power.c
drivers/mfd/twl6040-core.c
drivers/mfd/ucb1x00-core.c
drivers/mfd/ucb1x00-ts.c
drivers/mfd/vx855.c
drivers/mfd/wm831x-core.c
drivers/mfd/wm831x-i2c.c
drivers/mfd/wm831x-irq.c
drivers/mfd/wm831x-spi.c
drivers/mfd/wm8350-core.c
drivers/mfd/wm8350-i2c.c
drivers/mfd/wm8400-core.c
drivers/misc/Kconfig
drivers/misc/Makefile
drivers/misc/ab8500-pwm.c
drivers/misc/max8997-muic.c [new file with mode: 0644]
drivers/mmc/Makefile
drivers/mmc/card/block.c
drivers/mmc/card/mmc_test.c
drivers/mmc/card/queue.c
drivers/mmc/core/Makefile
drivers/mmc/core/bus.c
drivers/mmc/core/cd-gpio.c [new file with mode: 0644]
drivers/mmc/core/core.c
drivers/mmc/core/core.h
drivers/mmc/core/debugfs.c
drivers/mmc/core/host.c
drivers/mmc/core/mmc.c
drivers/mmc/core/sd.c
drivers/mmc/core/sdio.c
drivers/mmc/core/sdio_io.c
drivers/mmc/core/sdio_ops.c
drivers/mmc/host/Makefile
drivers/mmc/host/at91_mci.c
drivers/mmc/host/bfin_sdh.c
drivers/mmc/host/cb710-mmc.c
drivers/mmc/host/dw_mmc.c
drivers/mmc/host/dw_mmc.h
drivers/mmc/host/jz4740_mmc.c
drivers/mmc/host/mmc_spi.c
drivers/mmc/host/mmci.c
drivers/mmc/host/msm_sdcc.c
drivers/mmc/host/mxcmmc.c
drivers/mmc/host/mxs-mmc.c
drivers/mmc/host/omap_hsmmc.c
drivers/mmc/host/pxamci.c
drivers/mmc/host/s3cmci.c
drivers/mmc/host/sdhci-cns3xxx.c
drivers/mmc/host/sdhci-dove.c
drivers/mmc/host/sdhci-esdhc-imx.c
drivers/mmc/host/sdhci-esdhc.h
drivers/mmc/host/sdhci-of-esdhc.c
drivers/mmc/host/sdhci-of-hlwd.c
drivers/mmc/host/sdhci-pci-data.c [new file with mode: 0644]
drivers/mmc/host/sdhci-pci.c
drivers/mmc/host/sdhci-pxav2.c
drivers/mmc/host/sdhci-pxav3.c
drivers/mmc/host/sdhci-s3c.c
drivers/mmc/host/sdhci-spear.c
drivers/mmc/host/sdhci-tegra.c
drivers/mmc/host/sdhci.c
drivers/mmc/host/sdhci.h
drivers/mmc/host/sh_mmcif.c
drivers/mmc/host/sh_mobile_sdhi.c
drivers/mmc/host/tifm_sd.c
drivers/mmc/host/tmio_mmc.c
drivers/mmc/host/tmio_mmc.h
drivers/mmc/host/tmio_mmc_pio.c
drivers/mtd/mtdoops.c
drivers/mtd/ubi/debug.h
drivers/mtd/ubi/vtbl.c
drivers/net/bonding/bond_alb.c
drivers/net/ethernet/8390/ax88796.c
drivers/net/ethernet/adi/bfin_mac.c
drivers/net/ethernet/amd/au1000_eth.c
drivers/net/ethernet/broadcom/bcm63xx_enet.c
drivers/net/ethernet/broadcom/sb1250-mac.c
drivers/net/ethernet/cadence/macb.c
drivers/net/ethernet/dnet.c
drivers/net/ethernet/freescale/fec.c
drivers/net/ethernet/freescale/fec.h
drivers/net/ethernet/freescale/gianfar.c
drivers/net/ethernet/freescale/gianfar.h
drivers/net/ethernet/lantiq_etop.c
drivers/net/ethernet/marvell/mv643xx_eth.c
drivers/net/ethernet/marvell/pxa168_eth.c
drivers/net/ethernet/micrel/ksz884x.c
drivers/net/ethernet/renesas/sh_eth.c
drivers/net/ethernet/s6gmac.c
drivers/net/ethernet/smsc/smsc911x.c
drivers/net/ethernet/stmicro/stmmac/mmc_core.c
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
drivers/net/ethernet/ti/cpmac.c
drivers/net/ethernet/ti/davinci_mdio.c
drivers/net/ethernet/tundra/tsi108_eth.c
drivers/net/ethernet/via/via-rhine.c
drivers/net/ethernet/xscale/ixp4xx_eth.c
drivers/net/phy/dp83640.c
drivers/net/phy/fixed.c
drivers/net/phy/mdio-gpio.c
drivers/net/phy/mdio-octeon.c
drivers/net/phy/mdio_bus.c
drivers/net/ppp/pptp.c
drivers/net/usb/asix.c
drivers/net/wireless/ath/ath9k/ar9003_phy.c
drivers/net/wireless/ath/ath9k/ath9k.h
drivers/net/wireless/ath/ath9k/calib.c
drivers/net/wireless/ath/ath9k/calib.h
drivers/net/wireless/ath/ath9k/main.c
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
drivers/net/wireless/rtlwifi/rtl8192se/fw.c
drivers/parport/parport_pc.c
drivers/regulator/ab8500.c
drivers/rtc/rtc-ab8500.c
drivers/rtc/rtc-max8925.c
drivers/usb/otg/ab8500-usb.c
drivers/video/nvidia/nvidia.c
fs/aio.c
fs/autofs4/waitq.c
fs/block_dev.c
fs/btrfs/disk-io.c
fs/ceph/dir.c
fs/ceph/export.c
fs/ceph/inode.c
fs/ceph/mds_client.c
fs/ceph/super.c
fs/ceph/super.h
fs/ceph/xattr.c
fs/dcache.c
fs/direct-io.c
fs/eventpoll.c
fs/gfs2/glock.c
fs/gfs2/glock.h
fs/gfs2/incore.h
fs/gfs2/inode.c
fs/gfs2/lock_dlm.c
fs/gfs2/main.c
fs/gfs2/ops_fstype.c
fs/gfs2/recovery.c
fs/gfs2/rgrp.c
fs/gfs2/sys.c
fs/gfs2/sys.h
fs/hugetlbfs/inode.c
fs/nfs/internal.h
fs/nfs/write.c
fs/nfsd/Kconfig
fs/nfsd/Makefile
fs/nfsd/export.c
fs/nfsd/fault_inject.c [new file with mode: 0644]
fs/nfsd/fault_inject.h [new file with mode: 0644]
fs/nfsd/nfs4idmap.c
fs/nfsd/nfs4proc.c
fs/nfsd/nfs4recover.c
fs/nfsd/nfs4state.c
fs/nfsd/nfs4xdr.c
fs/nfsd/nfsctl.c
fs/nfsd/nfsd.h
fs/nfsd/state.h
fs/nfsd/vfs.c
fs/pipe.c
fs/proc/array.c
fs/proc/base.c
fs/squashfs/cache.c
fs/squashfs/inode.c
fs/squashfs/squashfs_fs_sb.h
fs/squashfs/super.c
fs/ubifs/debug.c
fs/ubifs/debug.h
fs/ubifs/journal.c
fs/ubifs/replay.c
fs/ubifs/tnc.c
fs/ubifs/tnc_misc.c
include/asm-generic/tlb.h
include/drm/drm_crtc.h
include/linux/amba/mmci.h
include/linux/crash_dump.h
include/linux/dcache.h
include/linux/eventpoll.h
include/linux/fs.h
include/linux/gfs2_ondisk.h
include/linux/huge_mm.h
include/linux/i2c/twl.h
include/linux/inet_diag.h
include/linux/kernel.h
include/linux/kmsg_dump.h
include/linux/linkage.h
include/linux/memcontrol.h
include/linux/mfd/88pm860x.h
include/linux/mfd/abx500/ab5500.h [moved from include/linux/mfd/ab5500/ab5500.h with 100% similarity]
include/linux/mfd/abx500/ab8500-gpadc.h [moved from include/linux/mfd/ab8500/gpadc.h with 100% similarity]
include/linux/mfd/abx500/ab8500-gpio.h [moved from include/linux/mfd/ab8500/gpio.h with 100% similarity]
include/linux/mfd/abx500/ab8500-sysctrl.h [moved from include/linux/mfd/ab8500/sysctrl.h with 100% similarity]
include/linux/mfd/abx500/ab8500.h [moved from include/linux/mfd/ab8500.h with 100% similarity]
include/linux/mfd/max8925.h
include/linux/mfd/max8997.h
include/linux/mfd/mc13xxx.h
include/linux/mfd/mcp.h
include/linux/mfd/s5m87xx/s5m-core.h [new file with mode: 0644]
include/linux/mfd/s5m87xx/s5m-pmic.h [new file with mode: 0644]
include/linux/mfd/s5m87xx/s5m-rtc.h [new file with mode: 0644]
include/linux/mfd/stmpe.h
include/linux/mfd/ucb1x00.h
include/linux/migrate.h
include/linux/mm_inline.h
include/linux/mm_types.h
include/linux/mmc/card.h
include/linux/mmc/cd-gpio.h [new file with mode: 0644]
include/linux/mmc/core.h
include/linux/mmc/dw_mmc.h
include/linux/mmc/host.h
include/linux/mmc/mmc.h
include/linux/mmc/sdhci-pci-data.h [new file with mode: 0644]
include/linux/mmc/sdhci.h
include/linux/mmc/sdio.h
include/linux/mmzone.h
include/linux/mod_devicetable.h
include/linux/oom.h
include/linux/page_cgroup.h
include/linux/pagevec.h
include/linux/phy.h
include/linux/pkt_sched.h
include/linux/prctl.h
include/linux/radix-tree.h
include/linux/rmap.h
include/linux/sched.h
include/linux/sunrpc/svc_xprt.h
include/linux/sunrpc/svcsock.h
include/net/bluetooth/hci_core.h
include/net/red.h
include/trace/events/vmscan.h
init/Kconfig
kernel/exit.c
kernel/kexec.c
kernel/kprobes.c
kernel/panic.c
kernel/pid.c
kernel/pid_namespace.c
kernel/sys.c
lib/decompress_unlzo.c
lib/radix-tree.c
mm/compaction.c
mm/filemap.c
mm/huge_memory.c
mm/ksm.c
mm/memcontrol.c
mm/memory-failure.c
mm/memory.c
mm/memory_hotplug.c
mm/mempolicy.c
mm/migrate.c
mm/oom_kill.c
mm/page_alloc.c
mm/page_cgroup.c
mm/rmap.c
mm/slub.c
mm/swap.c
mm/swap_state.c
mm/swapfile.c
mm/vmalloc.c
mm/vmscan.c
mm/vmstat.c
net/bluetooth/af_bluetooth.c
net/bluetooth/hci_event.c
net/bluetooth/hci_sock.c
net/bluetooth/l2cap_core.c
net/bluetooth/l2cap_sock.c
net/bluetooth/mgmt.c
net/bluetooth/rfcomm/sock.c
net/bluetooth/rfcomm/tty.c
net/bluetooth/sco.c
net/ceph/crush/mapper.c
net/ceph/crypto.c
net/ceph/osd_client.c
net/core/net-sysfs.c
net/core/netpoll.c
net/dccp/diag.c
net/decnet/dn_dev.c
net/ipv4/devinet.c
net/ipv4/fib_trie.c
net/ipv4/igmp.c
net/ipv4/inet_diag.c
net/ipv4/ipip.c
net/ipv4/ipmr.c
net/ipv4/tcp_diag.c
net/ipv4/tcp_memcontrol.c
net/ipv4/udp_diag.c
net/ipv6/addrconf.c
net/ipv6/ip6_tunnel.c
net/ipv6/raw.c
net/ipv6/sit.c
net/mac80211/agg-rx.c
net/mac80211/cfg.c
net/mac80211/ibss.c
net/mac80211/sta_info.c
net/mac80211/wpa.c
net/netfilter/nf_conntrack_core.c
net/netfilter/nf_conntrack_ecache.c
net/netfilter/nf_conntrack_extend.c
net/netfilter/nf_conntrack_helper.c
net/netfilter/nf_conntrack_netlink.c
net/netfilter/nf_log.c
net/netfilter/nf_queue.c
net/netfilter/nfnetlink.c
net/netlabel/netlabel_domainhash.c
net/netlabel/netlabel_unlabeled.c
net/phonet/af_phonet.c
net/phonet/pn_dev.c
net/phonet/socket.c
net/rds/iw_rdma.c
net/sched/sch_sfq.c
net/socket.c
net/sunrpc/auth_gss/auth_gss.c
net/sunrpc/cache.c
net/sunrpc/svc.c
net/sunrpc/svc_xprt.c
net/sunrpc/svcsock.c
net/sunrpc/xprtrdma/svc_rdma_transport.c
net/wireless/nl80211.c
net/xfrm/xfrm_user.c
scripts/mod/file2alias.c
tools/nfsd/inject_fault.sh [new file with mode: 0755]
tools/testing/selftests/Makefile [new file with mode: 0644]
tools/testing/selftests/breakpoints/Makefile [new file with mode: 0644]
tools/testing/selftests/breakpoints/breakpoint_test.c [new file with mode: 0644]
tools/testing/selftests/run_tests [new file with mode: 0644]

diff --git a/CREDITS b/CREDITS
index 44fce98..370b4c7 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -514,6 +514,11 @@ S: Bessemerstraat 21
 S: Amsterdam
 S: The Netherlands
 
+N: NeilBrown
+E: neil@brown.name
+P: 4096R/566281B9 1BC6 29EB D390 D870 7B5F  497A 39EC 9EDD 5662 81B9
+D: NFSD Maintainer 2000-2007
+
 N: Zach Brown
 E: zab@zabbo.net
 D: maestro pci sound
index 8b093f8..91bd6ca 100644 (file)
@@ -346,6 +346,10 @@ Description:
                number of objects per slab.  If a slab cannot be allocated
                because of fragmentation, SLUB will retry with the minimum order
                possible depending on its characteristics.
+               When debug_guardpage_minorder=N (N > 0) parameter is specified
+               (see Documentation/kernel-parameters.txt), the minimum possible
+               order is used and this sysfs entry can not be used to change
+               the order at run time.
 
 What:          /sys/kernel/slab/cache/order_fallback
 Date:          April 2008
index 4d8774f..4c95c00 100644 (file)
@@ -61,7 +61,7 @@ Brief summary of control files.
  memory.failcnt                         # show the number of memory usage hits limits
  memory.memsw.failcnt           # show the number of memory+Swap hits limits
  memory.max_usage_in_bytes      # show max memory usage recorded
- memory.memsw.usage_in_bytes    # show max memory+Swap usage recorded
+ memory.memsw.max_usage_in_bytes # show max memory+Swap usage recorded
  memory.soft_limit_in_bytes     # set/show soft limit of memory usage
  memory.stat                    # show various statistics
  memory.use_hierarchy           # set/show hierarchical account enabled
@@ -410,8 +410,11 @@ memory.stat file includes following statistics
 cache          - # of bytes of page cache memory.
 rss            - # of bytes of anonymous and swap cache memory.
 mapped_file    - # of bytes of mapped file (includes tmpfs/shmem)
-pgpgin         - # of pages paged in (equivalent to # of charging events).
-pgpgout                - # of pages paged out (equivalent to # of uncharging events).
+pgpgin         - # of charging events to the memory cgroup. The charging
+               event happens each time a page is accounted as either mapped
+               anon page(RSS) or cache page(Page Cache) to the cgroup.
+pgpgout                - # of uncharging events to the memory cgroup. The uncharging
+               event happens each time a page is unaccounted from the cgroup.
 swap           - # of bytes of swap usage
 inactive_anon  - # of bytes of anonymous memory and swap cache memory on
                LRU list.
diff --git a/Documentation/devicetree/bindings/mfd/mc13xxx.txt b/Documentation/devicetree/bindings/mfd/mc13xxx.txt
new file mode 100644 (file)
index 0000000..19f6af4
--- /dev/null
@@ -0,0 +1,78 @@
+* Freescale MC13783/MC13892 Power Management Integrated Circuit (PMIC)
+
+Required properties:
+- compatible : Should be "fsl,mc13783" or "fsl,mc13892"
+
+Optional properties:
+- fsl,mc13xxx-uses-adc : Indicate the ADC is being used
+- fsl,mc13xxx-uses-codec : Indicate the Audio Codec is being used
+- fsl,mc13xxx-uses-rtc : Indicate the RTC is being used
+- fsl,mc13xxx-uses-touch : Indicate the touchscreen controller is being used
+
+Sub-nodes:
+- regulators : Contain the regulator nodes.  The MC13892 regulators are
+  bound using their names as listed below with their registers and bits
+  for enabling.
+
+    vcoincell : regulator VCOINCELL (register 13, bit 23)
+    sw1       : regulator SW1      (register 24, bit 0)
+    sw2       : regulator SW2      (register 25, bit 0)
+    sw3       : regulator SW3      (register 26, bit 0)
+    sw4       : regulator SW4      (register 27, bit 0)
+    swbst     : regulator SWBST            (register 29, bit 20)
+    vgen1     : regulator VGEN1            (register 32, bit 0)
+    viohi     : regulator VIOHI            (register 32, bit 3)
+    vdig      : regulator VDIG     (register 32, bit 9)
+    vgen2     : regulator VGEN2            (register 32, bit 12)
+    vpll      : regulator VPLL     (register 32, bit 15)
+    vusb2     : regulator VUSB2            (register 32, bit 18)
+    vgen3     : regulator VGEN3            (register 33, bit 0)
+    vcam      : regulator VCAM     (register 33, bit 6)
+    vvideo    : regulator VVIDEO    (register 33, bit 12)
+    vaudio    : regulator VAUDIO    (register 33, bit 15)
+    vsd       : regulator VSD      (register 33, bit 18)
+    gpo1      : regulator GPO1     (register 34, bit 6)
+    gpo2      : regulator GPO2     (register 34, bit 8)
+    gpo3      : regulator GPO3     (register 34, bit 10)
+    gpo4      : regulator GPO4     (register 34, bit 12)
+    pwgt1spi  : regulator PWGT1SPI  (register 34, bit 15)
+    pwgt2spi  : regulator PWGT2SPI  (register 34, bit 16)
+    vusb      : regulator VUSB     (register 50, bit 3)
+
+  The bindings details of individual regulator device can be found in:
+  Documentation/devicetree/bindings/regulator/regulator.txt
+
+Examples:
+
+ecspi@70010000 { /* ECSPI1 */
+       fsl,spi-num-chipselects = <2>;
+       cs-gpios = <&gpio3 24 0>, /* GPIO4_24 */
+                  <&gpio3 25 0>; /* GPIO4_25 */
+       status = "okay";
+
+       pmic: mc13892@0 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "fsl,mc13892";
+               spi-max-frequency = <6000000>;
+               reg = <0>;
+               interrupt-parent = <&gpio0>;
+               interrupts = <8>;
+
+               regulators {
+                       sw1_reg: mc13892__sw1 {
+                               regulator-min-microvolt = <600000>;
+                               regulator-max-microvolt = <1375000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+
+                       sw2_reg: mc13892__sw2 {
+                               regulator-min-microvolt = <900000>;
+                               regulator-max-microvolt = <1850000>;
+                               regulator-boot-on;
+                               regulator-always-on;
+                       };
+               };
+       };
+};
diff --git a/Documentation/devicetree/bindings/mfd/twl-familly.txt b/Documentation/devicetree/bindings/mfd/twl-familly.txt
new file mode 100644 (file)
index 0000000..a66fcf9
--- /dev/null
@@ -0,0 +1,47 @@
+Texas Instruments TWL family
+
+The TWLs are Integrated Power Management Chips.
+Some version might contain much more analog function like
+USB transceiver or Audio amplifier.
+These chips are connected to an i2c bus.
+
+
+Required properties:
+- compatible : Must be "ti,twl4030";
+  For Integrated power-management/audio CODEC device used in OMAP3
+  based boards
+- compatible : Must be "ti,twl6030";
+  For Integrated power-management used in OMAP4 based boards
+- interrupts : This i2c device has an IRQ line connected to the main SoC
+- interrupt-controller : Since the twl support several interrupts internally,
+  it is considered as an interrupt controller cascaded to the SoC one.
+- #interrupt-cells = <1>;
+- interrupt-parent : The parent interrupt controller.
+
+Optional node:
+- Child nodes contain in the twl. The twl family is made of several variants
+  that support a different number of features.
+  The children nodes will thus depend of the capability of the variant.
+
+
+Example:
+/*
+ * Integrated Power Management Chip
+ * http://www.ti.com/lit/ds/symlink/twl6030.pdf
+ */
+twl@48 {
+    compatible = "ti,twl6030";
+    reg = <0x48>;
+    interrupts = <39>; /* IRQ_SYS_1N cascaded to gic */
+    interrupt-controller;
+    #interrupt-cells = <1>;
+    interrupt-parent = <&gic>;
+    #address-cells = <1>;
+    #size-cells = <0>;
+
+    twl_rtc {
+        compatible = "ti,twl_rtc";
+        interrupts = <11>;
+        reg = <0>;
+    };
+};
index 510eab3..225f96d 100644 (file)
@@ -219,6 +219,10 @@ NOTES:
    If the exporter chooses not to allow an attach() operation once a
    map_dma_buf() API has been called, it simply returns an error.
 
+Miscellaneous notes:
+- Any exporters or users of the dma-buf buffer sharing framework must have
+  a 'select DMA_SHARED_BUFFER' in their respective Kconfigs.
+
 References:
 [1] struct dma_buf_ops in include/linux/dma-buf.h
 [2] All interfaces mentioned above defined in include/linux/dma-buf.h
index 763d8eb..d6030aa 100644 (file)
@@ -119,12 +119,20 @@ Mount Options
        must rely on TCP's error correction to detect data corruption
        in the data payload.
 
-  noasyncreaddir
-       Disable client's use its local cache to satisfy readdir
-       requests.  (This does not change correctness; the client uses
-       cached metadata only when a lease or capability ensures it is
-       valid.)
+  dcache
+        Use the dcache contents to perform negative lookups and
+        readdir when the client has the entire directory contents in
+        its cache.  (This does not change correctness; the client uses
+        cached metadata only when a lease or capability ensures it is
+        valid.)
+
+  nodcache
+        Do not use the dcache as above.  This avoids a significant amount of
+        complex code, sacrificing performance without affecting correctness,
+        and is useful for tracking down bugs.
 
+  noasyncreaddir
+       Do not use the dcache as above for readdir.
 
 More Information
 ================
index a57e124..1716874 100644 (file)
@@ -2,6 +2,8 @@
        - this file (nfs-related documentation).
 Exporting
        - explanation of how to make filesystems exportable.
+fault_injection.txt
+       - information for using fault injection on the server
 knfsd-stats.txt
        - statistics which the NFS server makes available to user space.
 nfs.txt
diff --git a/Documentation/filesystems/nfs/fault_injection.txt b/Documentation/filesystems/nfs/fault_injection.txt
new file mode 100644 (file)
index 0000000..426d166
--- /dev/null
@@ -0,0 +1,69 @@
+
+Fault Injection
+===============
+Fault injection is a method for forcing errors that may not normally occur, or
+may be difficult to reproduce.  Forcing these errors in a controlled environment
+can help the developer find and fix bugs before their code is shipped in a
+production system.  Injecting an error on the Linux NFS server will allow us to
+observe how the client reacts and if it manages to recover its state correctly.
+
+NFSD_FAULT_INJECTION must be selected when configuring the kernel to use this
+feature.
+
+
+Using Fault Injection
+=====================
+On the client, mount the fault injection server through NFS v4.0+ and do some
+work over NFS (open files, take locks, ...).
+
+On the server, mount the debugfs filesystem to <debug_dir> and ls
+<debug_dir>/nfsd.  This will show a list of files that will be used for
+injecting faults on the NFS server.  As root, write a number n to the file
+corresponding to the action you want the server to take.  The server will then
+process the first n items it finds.  So if you want to forget 5 locks, echo '5'
+to <debug_dir>/nfsd/forget_locks.  A value of 0 will tell the server to forget
+all corresponding items.  A log message will be created containing the number
+of items forgotten (check dmesg).
+
+Go back to work on the client and check if the client recovered from the error
+correctly.
+
+
+Available Faults
+================
+forget_clients:
+     The NFS server keeps a list of clients that have placed a mount call.  If
+     this list is cleared, the server will have no knowledge of who the client
+     is, forcing the client to reauthenticate with the server.
+
+forget_openowners:
+     The NFS server keeps a list of what files are currently opened and who
+     they were opened by.  Clearing this list will force the client to reopen
+     its files.
+
+forget_locks:
+     The NFS server keeps a list of what files are currently locked in the VFS.
+     Clearing this list will force the client to reclaim its locks (files are
+     unlocked through the VFS as they are cleared from this list).
+
+forget_delegations:
+     A delegation is used to assure the client that a file, or part of a file,
+     has not changed since the delegation was awarded.  Clearing this list will
+     force the client to reaquire its delegation before accessing the file
+     again.
+
+recall_delegations:
+     Delegations can be recalled by the server when another client attempts to
+     access a file.  This test will notify the client that its delegation has
+     been revoked, forcing the client to reaquire the delegation before using
+     the file again.
+
+
+tools/nfs/inject_faults.sh script
+=================================
+This script has been created to ease the fault injection process.  This script
+will detect the mounted debugfs directory and write to the files located there
+based on the arguments passed by the user.  For example, running
+`inject_faults.sh forget_locks 1` as root will instruct the server to forget
+one lock.  Running `inject_faults forget_locks` will instruct the server to
+forgetall locks.
index 12fee13..a76a26a 100644 (file)
@@ -307,6 +307,9 @@ Table 1-4: Contents of the stat files (as of 2.6.30-rc7)
   blkio_ticks   time spent waiting for block IO
   gtime         guest time of the task in jiffies
   cgtime        guest time of the task children in jiffies
+  start_data    address above which program data+bss is placed
+  end_data      address below which program data+bss is placed
+  start_brk     address above which program heap can be expanded with brk()
 ..............................................................................
 
 The /proc/PID/maps file containing the currently mapped memory regions and
index 7db3ebd..403c090 100644 (file)
@@ -93,8 +93,8 @@ byte alignment:
 
 Compressed data blocks are written to the filesystem as files are read from
 the source directory, and checked for duplicates.  Once all file data has been
-written the completed inode, directory, fragment, export and uid/gid lookup
-tables are written.
+written the completed inode, directory, fragment, export, uid/gid lookup and
+xattr tables are written.
 
 3.1 Compression options
 -----------------------
@@ -151,7 +151,7 @@ in each metadata block.  Directories are sorted in alphabetical order,
 and at lookup the index is scanned linearly looking for the first filename
 alphabetically larger than the filename being looked up.  At this point the
 location of the metadata block the filename is in has been found.
-The general idea of the index is ensure only one metadata block needs to be
+The general idea of the index is to ensure only one metadata block needs to be
 decompressed to do a lookup irrespective of the length of the directory.
 This scheme has the advantage that it doesn't require extra memory overhead
 and doesn't require much extra storage on disk.
index 8898a95..22ae844 100644 (file)
@@ -64,3 +64,13 @@ Note on Erase Size and Preferred Erase Size:
        size specified by the card.
 
        "preferred_erase_size" is in bytes.
+
+SD/MMC/SDIO Clock Gating Attribute
+==================================
+
+Read and write access is provided to following attribute.
+This attribute appears only if CONFIG_MMC_CLKGATE is enabled.
+
+       clkgate_delay   Tune the clock gating delay with desired value in milliseconds.
+
+echo <desired delay> > /sys/class/mmc_host/mmcX/clkgate_delay
index 2db28b8..f08d078 100644 (file)
@@ -25,3 +25,16 @@ echo 0 > /sys/block/mmcblkXbootY/force_ro
 To re-enable read-only access:
 
 echo 1 > /sys/block/mmcblkXbootY/force_ro
+
+The boot partitions can also be locked read only until the next power on,
+with:
+
+echo 1 > /sys/block/mmcblkXbootY/ro_lock_until_next_power_on
+
+This is a feature of the card and not of the kernel. If the card does
+not support boot partition locking, the file will not exist. If the
+feature has been disabled on the card, the file will be read-only.
+
+The boot partitions can also be locked permanently, but this feature is
+not accessible through sysfs in order to avoid accidental or malicious
+bricking.
index 6d8cd8b..8c20fbd 100644 (file)
@@ -415,6 +415,14 @@ PIDs of value pid_max or larger are not allocated.
 
 ==============================================================
 
+ns_last_pid:
+
+The last pid allocated in the current (the one task using this sysctl
+lives in) pid namespace. When selecting a pid for a next task on fork
+kernel tries to allocate a number starting from this one.
+
+==============================================================
+
 powersave-nap: (PPC only)
 
 If set, Linux-PPC will use the 'nap' mode of powersaving,
index 2acdda9..6752870 100644 (file)
@@ -131,7 +131,10 @@ slub_min_objects.
 slub_max_order specified the order at which slub_min_objects should no
 longer be checked. This is useful to avoid SLUB trying to generate
 super large order pages to fit slub_min_objects of a slab cache with
-large object sizes into one high order page.
+large object sizes into one high order page. Setting command line
+parameter debug_guardpage_minorder=N (N > 0), forces setting
+slub_max_order to 0, what cause minimum possible order of slabs
+allocation.
 
 SLUB Debug output
 -----------------
index 1094edf..4d1ba20 100644 (file)
@@ -3193,6 +3193,7 @@ F:        drivers/i2c/busses/i2c-stub.c
 I2C SUBSYSTEM
 M:     "Jean Delvare (PC drivers, core)" <khali@linux-fr.org>
 M:     "Ben Dooks (embedded platforms)" <ben-linux@fluff.org>
+M:     "Wolfram Sang (embedded platforms)" <w.sang@pengutronix.de>
 L:     linux-i2c@vger.kernel.org
 W:     http://i2c.wiki.kernel.org/
 T:     quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-i2c/
@@ -3774,7 +3775,6 @@ S:        Odd Fixes
 
 KERNEL NFSD, SUNRPC, AND LOCKD SERVERS
 M:     "J. Bruce Fields" <bfields@fieldses.org>
-M:     Neil Brown <neilb@suse.de>
 L:     linux-nfs@vger.kernel.org
 W:     http://nfs.sourceforge.net/
 S:     Supported
@@ -4683,6 +4683,8 @@ Q:        http://patchwork.kernel.org/project/linux-omap/list/
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git
 S:     Maintained
 F:     arch/arm/*omap*/
+F:     drivers/i2c/busses/i2c-omap.c
+F:     include/linux/i2c-omap.h
 
 OMAP CLOCK FRAMEWORK SUPPORT
 M:     Paul Walmsley <paul@pwsan.com>
@@ -5956,6 +5958,7 @@ L:        davinci-linux-open-source@linux.davincidsp.com (subscribers-only)
 Q:     http://patchwork.kernel.org/project/linux-davinci/list/
 S:     Supported
 F:     arch/arm/mach-davinci
+F:     drivers/i2c/busses/i2c-davinci.c
 
 SIS 190 ETHERNET DRIVER
 M:     Francois Romieu <romieu@fr.zoreil.com>
index 2505740..4f55c73 100644 (file)
@@ -185,4 +185,18 @@ config HAVE_RCU_TABLE_FREE
 config ARCH_HAVE_NMI_SAFE_CMPXCHG
        bool
 
+config HAVE_ALIGNED_STRUCT_PAGE
+       bool
+       help
+         This makes sure that struct pages are double word aligned and that
+         e.g. the SLUB allocator can perform double word atomic operations
+         on a struct page for better performance. However selecting this
+         might increase the size of a struct page by a word.
+
+config HAVE_CMPXCHG_LOCAL
+       bool
+
+config HAVE_CMPXCHG_DOUBLE
+       bool
+
 source "kernel/gcov/Kconfig"
index 6b93e20..5bc6b38 100644 (file)
@@ -202,6 +202,7 @@ static struct irda_platform_data assabet_irda_data = {
 static struct mcp_plat_data assabet_mcp_data = {
        .mccr0          = MCCR0_ADM,
        .sclk_rate      = 11981000,
+       .codec          = "ucb1x00",
 };
 
 static void __init assabet_init(void)
@@ -252,6 +253,17 @@ static void __init assabet_init(void)
        sa11x0_register_mtd(&assabet_flash_data, assabet_flash_resources,
                            ARRAY_SIZE(assabet_flash_resources));
        sa11x0_register_irda(&assabet_irda_data);
+
+       /*
+        * Setup the PPC unit correctly.
+        */
+       PPDR &= ~PPC_RXD4;
+       PPDR |= PPC_TXD4 | PPC_SCLK | PPC_SFRM;
+       PSDR |= PPC_RXD4;
+       PSDR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
+       PPSR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
+
+       ASSABET_BCR_set(ASSABET_BCR_CODEC_RST);
        sa11x0_register_mcp(&assabet_mcp_data);
 }
 
index 11bb6d0..d12d0f4 100644 (file)
@@ -124,12 +124,23 @@ static void __init cerf_map_io(void)
 static struct mcp_plat_data cerf_mcp_data = {
        .mccr0          = MCCR0_ADM,
        .sclk_rate      = 11981000,
+       .codec          = "ucb1x00",
 };
 
 static void __init cerf_init(void)
 {
        platform_add_devices(cerf_devices, ARRAY_SIZE(cerf_devices));
        sa11x0_register_mtd(&cerf_flash_data, &cerf_flash_resource, 1);
+
+       /*
+        * Setup the PPC unit correctly.
+        */
+       PPDR &= ~PPC_RXD4;
+       PPDR |= PPC_TXD4 | PPC_SCLK | PPC_SFRM;
+       PSDR |= PPC_RXD4;
+       PSDR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
+       PPSR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
+
        sa11x0_register_mcp(&cerf_mcp_data);
 }
 
index b9060e2..c483912 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/timer.h>
 #include <linux/gpio.h>
 #include <linux/pda_power.h>
+#include <linux/mfd/ucb1x00.h>
 
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
@@ -85,10 +86,15 @@ static struct scoop_pcmcia_config collie_pcmcia_config = {
        .num_devs       = 1,
 };
 
+static struct ucb1x00_plat_data collie_ucb1x00_data = {
+       .gpio_base      = COLLIE_TC35143_GPIO_BASE,
+};
+
 static struct mcp_plat_data collie_mcp_data = {
        .mccr0          = MCCR0_ADM | MCCR0_ExtClk,
        .sclk_rate      = 9216000,
-       .gpio_base      = COLLIE_TC35143_GPIO_BASE,
+       .codec          = "ucb1x00",
+       .codec_pdata    = &collie_ucb1x00_data,
 };
 
 /*
@@ -351,6 +357,16 @@ static void __init collie_init(void)
 
        sa11x0_register_mtd(&collie_flash_data, collie_flash_resources,
                            ARRAY_SIZE(collie_flash_resources));
+
+       /*
+        * Setup the PPC unit correctly.
+        */
+       PPDR &= ~PPC_RXD4;
+       PPDR |= PPC_TXD4 | PPC_SCLK | PPC_SFRM;
+       PSDR |= PPC_RXD4;
+       PSDR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
+       PPSR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
+
        sa11x0_register_mcp(&collie_mcp_data);
 
        sharpsl_save_param();
index 480d2ea..e3a28ca 100644 (file)
@@ -217,10 +217,15 @@ static struct platform_device sa11x0uart3_device = {
 static struct resource sa11x0mcp_resources[] = {
        [0] = {
                .start  = __PREG(Ser4MCCR0),
-               .end    = __PREG(Ser4MCCR0) + 0xffff,
+               .end    = __PREG(Ser4MCCR0) + 0x1C - 1,
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
+               .start  = __PREG(Ser4MCCR1),
+               .end    = __PREG(Ser4MCCR1) + 0x4 - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [2] = {
                .start  = IRQ_Ser4MCP,
                .end    = IRQ_Ser4MCP,
                .flags  = IORESOURCE_IRQ,
index ed1a331..586cec8 100644 (file)
@@ -17,6 +17,8 @@ struct mcp_plat_data {
        u32 mccr1;
        unsigned int sclk_rate;
        int gpio_base;
+       const char *codec;
+       void *codec_pdata;
 };
 
 #endif
index af4e276..d117cea 100644 (file)
 static struct mcp_plat_data lart_mcp_data = {
        .mccr0          = MCCR0_ADM,
        .sclk_rate      = 11981000,
+       .codec          = "ucb1x00",
 };
 
 static void __init lart_init(void)
 {
+       /*
+        * Setup the PPC unit correctly.
+        */
+       PPDR &= ~PPC_RXD4;
+       PPDR |= PPC_TXD4 | PPC_SCLK | PPC_SFRM;
+       PSDR |= PPC_RXD4;
+       PSDR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
+       PPSR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
+
        sa11x0_register_mcp(&lart_mcp_data);
 }
 
index 318b2b7..748d344 100644 (file)
@@ -55,11 +55,22 @@ static struct resource shannon_flash_resource = {
 static struct mcp_plat_data shannon_mcp_data = {
        .mccr0          = MCCR0_ADM,
        .sclk_rate      = 11981000,
+       .codec          = "ucb1x00",
 };
 
 static void __init shannon_init(void)
 {
        sa11x0_register_mtd(&shannon_flash_data, &shannon_flash_resource, 1);
+
+       /*
+        * Setup the PPC unit correctly.
+        */
+       PPDR &= ~PPC_RXD4;
+       PPDR |= PPC_TXD4 | PPC_SCLK | PPC_SFRM;
+       PSDR |= PPC_RXD4;
+       PSDR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
+       PPSR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
+
        sa11x0_register_mcp(&shannon_mcp_data);
 }
 
index e17c04d..458ecec 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/mtd/partitions.h>
 #include <linux/io.h>
 #include <linux/gpio.h>
+#include <linux/mfd/ucb1x00.h>
 
 #include <asm/irq.h>
 #include <mach/hardware.h>
@@ -187,10 +188,15 @@ static struct resource simpad_flash_resources [] = {
        }
 };
 
+static struct ucb1x00_plat_data simpad_ucb1x00_data = {
+       .gpio_base      = SIMPAD_UCB1X00_GPIO_BASE,
+};
+
 static struct mcp_plat_data simpad_mcp_data = {
        .mccr0          = MCCR0_ADM,
        .sclk_rate      = 11981000,
-       .gpio_base      = SIMPAD_UCB1X00_GPIO_BASE,
+       .codec          = "ucb1300",
+       .codec_pdata    = &simpad_ucb1x00_data,
 };
 
 
@@ -378,6 +384,16 @@ static int __init simpad_init(void)
 
        sa11x0_register_mtd(&simpad_flash_data, simpad_flash_resources,
                              ARRAY_SIZE(simpad_flash_resources));
+
+       /*
+        * Setup the PPC unit correctly.
+        */
+       PPDR &= ~PPC_RXD4;
+       PPDR |= PPC_TXD4 | PPC_SCLK | PPC_SFRM;
+       PSDR |= PPC_RXD4;
+       PSDR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
+       PPSR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
+
        sa11x0_register_mcp(&simpad_mcp_data);
 
        ret = platform_add_devices(devices, ARRAY_SIZE(devices));
index 9361a52..5c00712 100644 (file)
 #include <linux/amba/pl022.h>
 #include <linux/amba/serial.h>
 #include <linux/spi/spi.h>
-#include <linux/mfd/ab8500.h>
+#include <linux/mfd/abx500/ab8500.h>
 #include <linux/regulator/ab8500.h>
 #include <linux/mfd/tc3589x.h>
 #include <linux/mfd/tps6105x.h>
-#include <linux/mfd/ab8500/gpio.h>
+#include <linux/mfd/abx500/ab8500-gpio.h>
 #include <linux/leds-lp5521.h>
 #include <linux/input.h>
 #include <linux/smsc911x.h>
index fe1569b..9de9e9c 100644 (file)
@@ -10,7 +10,7 @@
 #include <linux/amba/bus.h>
 #include <linux/irq.h>
 #include <linux/i2c.h>
-#include <linux/mfd/ab5500/ab5500.h>
+#include <linux/mfd/abx500/ab5500.h>
 
 #include <asm/hardware/gic.h>
 #include <asm/mach/arch.h>
index 4796990..d2d4131 100644 (file)
@@ -9,7 +9,7 @@
 #define __MACH_IRQS_BOARD_MOP500_H
 
 /* Number of AB8500 irqs is taken from header file */
-#include <linux/mfd/ab8500.h>
+#include <linux/mfd/abx500/ab8500.h>
 
 #define MOP500_AB8500_IRQ_BASE         IRQ_BOARD_START
 #define MOP500_AB8500_IRQ_END          (MOP500_AB8500_IRQ_BASE \
index 656dc00..f82f888 100644 (file)
@@ -63,6 +63,7 @@ enum clk_types {
 struct s3c_sdhci_platdata {
        unsigned int    max_width;
        unsigned int    host_caps;
+       unsigned int    pm_caps;
        enum cd_types   cd_type;
        enum clk_types  clk_type;
 
index ceb9fa3..0f70718 100644 (file)
@@ -53,6 +53,8 @@ void s3c_sdhci_set_platdata(struct s3c_sdhci_platdata *pd,
                set->cfg_gpio = pd->cfg_gpio;
        if (pd->host_caps)
                set->host_caps |= pd->host_caps;
+       if (pd->pm_caps)
+               set->pm_caps |= pd->pm_caps;
        if (pd->clk_type)
                set->clk_type = pd->clk_type;
 }
index 9702c22..62d9ded 100644 (file)
@@ -169,7 +169,7 @@ static inline unsigned long __cmpxchg_local(volatile void *ptr,
 #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
 
 struct pt_regs;
-void NORET_TYPE die(const char *str, struct pt_regs *regs, long err);
+void die(const char *str, struct pt_regs *regs, long err);
 void _exception(long signr, struct pt_regs *regs, int code,
                unsigned long addr);
 
index 7aa2575..3d760c0 100644 (file)
@@ -24,7 +24,7 @@
 
 static DEFINE_SPINLOCK(die_lock);
 
-void NORET_TYPE die(const char *str, struct pt_regs *regs, long err)
+void die(const char *str, struct pt_regs *regs, long err)
 {
        static int die_counter;
 
index d9f397f..691be0b 100644 (file)
@@ -309,7 +309,6 @@ struct thread_struct {
 }
 
 #define start_thread(regs,new_ip,new_sp) do {                                                  \
-       set_fs(USER_DS);                                                                        \
        regs->cr_ipsr = ((regs->cr_ipsr | (IA64_PSR_BITS_TO_SET | IA64_PSR_CPL))                \
                         & ~(IA64_PSR_BITS_TO_CLEAR | IA64_PSR_RI | IA64_PSR_IS));              \
        regs->cr_iip = new_ip;                                                                  \
index 7617248..7a3bd25 100644 (file)
 #define __NR_sendmmsg                  1331
 #define __NR_process_vm_readv          1332
 #define __NR_process_vm_writev         1333
+#define __NR_accept4                   1334
 
 #ifdef __KERNEL__
 
 
-#define NR_syscalls                    310 /* length of syscall table */
+#define NR_syscalls                    311 /* length of syscall table */
 
 /*
  * The following defines stop scripts/checksyscalls.sh from complaining about
index 5b31d46..1ccbe12 100644 (file)
@@ -1779,6 +1779,7 @@ sys_call_table:
        data8 sys_sendmmsg
        data8 sys_process_vm_readv
        data8 sys_process_vm_writev
+       data8 sys_accept4
 
        .org sys_call_table + 8*NR_syscalls     // guard against failures to increase NR_syscalls
 #endif /* __IA64_ASM_PARAVIRTUALIZED_NATIVE */
index 3d3aeef..4eed358 100644 (file)
 #include <asm/sal.h>
 #include <asm/mca.h>
 
-typedef NORET_TYPE void (*relocate_new_kernel_t)(
+typedef void (*relocate_new_kernel_t)(
                                        unsigned long indirection_page,
                                        unsigned long start_address,
                                        struct ia64_boot_param *boot_param,
-                                       unsigned long pal_addr) ATTRIB_NORET;
+                                       unsigned long pal_addr) __noreturn;
 
 struct kimage *ia64_kimage;
 
index 82a4bb5..b95a451 100644 (file)
@@ -511,8 +511,7 @@ static unsigned long amiga_gettimeoffset(void)
        return ticks + offset;
 }
 
-static NORET_TYPE void amiga_reset(void)
-    ATTRIB_NORET;
+static void amiga_reset(void)  __noreturn;
 
 static void amiga_reset(void)
 {
index de39b1f..7b99c67 100644 (file)
@@ -144,7 +144,7 @@ extern int ptrace_set_watch_regs(struct task_struct *child,
 extern asmlinkage void syscall_trace_enter(struct pt_regs *regs);
 extern asmlinkage void syscall_trace_leave(struct pt_regs *regs);
 
-extern NORET_TYPE void die(const char *, struct pt_regs *) ATTRIB_NORET;
+extern void die(const char *, struct pt_regs *) __noreturn;
 
 static inline void die_if_kernel(const char *str, struct pt_regs *regs)
 {
index 5c8a49d..bbddb86 100644 (file)
@@ -1340,7 +1340,7 @@ void ejtag_exception_handler(struct pt_regs *regs)
 /*
  * NMI exception handler.
  */
-NORET_TYPE void ATTRIB_NORET nmi_exception_handler(struct pt_regs *regs)
+void __noreturn nmi_exception_handler(struct pt_regs *regs)
 {
        bust_spinlocks(1);
        printk("NMI taken!!!!\n");
index ca3e205..95a4d42 100644 (file)
@@ -110,7 +110,7 @@ extern asmlinkage void nmi_handler(void);
 extern asmlinkage void misalignment(struct pt_regs *, enum exception_code);
 
 extern void die(const char *, struct pt_regs *, enum exception_code)
-       ATTRIB_NORET;
+       __noreturn;
 
 extern int die_if_no_fixup(const char *, struct pt_regs *, enum exception_code);
 
index 9ce66e9..7213ec9 100644 (file)
@@ -196,7 +196,6 @@ typedef unsigned int elf_caddr_t;
        /* offset pc for priv. level */                 \
        pc |= 3;                                        \
                                                        \
-       set_fs(USER_DS);                                \
        regs->iasq[0] = spaceid;                        \
        regs->iasq[1] = spaceid;                        \
        regs->iaoq[0] = pc;                             \
@@ -299,7 +298,6 @@ on downward growing arches, it looks like this:
        elf_addr_t pc = (elf_addr_t)new_pc | 3;         \
        elf_caddr_t *argv = (elf_caddr_t *)bprm->exec + 1;      \
                                                        \
-       set_fs(USER_DS);                                \
        regs->iasq[0] = spaceid;                        \
        regs->iasq[1] = spaceid;                        \
        regs->iaoq[0] = pc;                             \
index 4b4b918..62c60b8 100644 (file)
@@ -192,7 +192,6 @@ void flush_thread(void)
        /* Only needs to handle fpu stuff or perf monitors.
        ** REVISIT: several arches implement a "lazy fpu state".
        */
-       set_fs(USER_DS);
 }
 
 void release_thread(struct task_struct *dead_task)
index 7c66ce1..0a48bf5 100644 (file)
@@ -50,12 +50,6 @@ static int __init powersave_off(char *arg)
 }
 __setup("powersave=off", powersave_off);
 
-#if defined(CONFIG_PPC_PSERIES) && defined(CONFIG_TRACEPOINTS)
-static const bool idle_uses_rcu = 1;
-#else
-static const bool idle_uses_rcu;
-#endif
-
 /*
  * The body of the idle task.
  */
@@ -67,8 +61,7 @@ void cpu_idle(void)
        set_thread_flag(TIF_POLLING_NRFLAG);
        while (1) {
                tick_nohz_idle_enter();
-               if (!idle_uses_rcu)
-                       rcu_idle_enter();
+               rcu_idle_enter();
 
                while (!need_resched() && !cpu_should_die()) {
                        ppc64_runlatch_off();
@@ -106,8 +99,7 @@ void cpu_idle(void)
 
                HMT_medium();
                ppc64_runlatch_on();
-               if (!idle_uses_rcu)
-                       rcu_idle_exit();
+               rcu_idle_exit();
                tick_nohz_idle_exit();
                preempt_enable_no_resched();
                if (cpu_should_die())
index e63f2e7..affe5dc 100644 (file)
 #include <asm/hw_irq.h>
 #include <asm/io.h>
 
-typedef NORET_TYPE void (*relocate_new_kernel_t)(
+typedef void (*relocate_new_kernel_t)(
                                unsigned long indirection_page,
                                unsigned long reboot_code_buffer,
-                               unsigned long start_address) ATTRIB_NORET;
+                               unsigned long start_address) __noreturn;
 
 /*
  * This is a generic machine_kexec function suitable at least for
index 26ccbf7..d7f6090 100644 (file)
@@ -307,9 +307,9 @@ static union thread_union kexec_stack __init_task_data =
 struct paca_struct kexec_paca;
 
 /* Our assembly helper, in kexec_stub.S */
-extern NORET_TYPE void kexec_sequence(void *newstack, unsigned long start,
-                                       void *image, void *control,
-                                       void (*clear_all)(void)) ATTRIB_NORET;
+extern void kexec_sequence(void *newstack, unsigned long start,
+                          void *image, void *control,
+                          void (*clear_all)(void)) __noreturn;
 
 /* too late to fail here */
 void default_machine_kexec(struct kimage *image)
index 4ff3d8e..3feefc3 100644 (file)
@@ -58,7 +58,7 @@ static int distance_lookup_table[MAX_NUMNODES][MAX_DISTANCE_REF_POINTS];
  * Allocate node_to_cpumask_map based on number of available nodes
  * Requires node_possible_map to be valid.
  *
- * Note: node_to_cpumask() is not valid until after this is done.
+ * Note: cpumask_of_node() is not valid until after this is done.
  */
 static void __init setup_node_to_cpumask_map(void)
 {
index fd05fde..3ce73d0 100644 (file)
@@ -36,6 +36,7 @@ BEGIN_FTR_SECTION;                                            \
        b       1f;                                             \
 END_FTR_SECTION(0, 1);                                         \
        ld      r12,hcall_tracepoint_refcount@toc(r2);          \
+       std     r12,32(r1);                                     \
        cmpdi   r12,0;                                          \
        beq+    1f;                                             \
        mflr    r0;                                             \
@@ -74,7 +75,7 @@ END_FTR_SECTION(0, 1);                                                \
 BEGIN_FTR_SECTION;                                             \
        b       1f;                                             \
 END_FTR_SECTION(0, 1);                                         \
-       ld      r12,hcall_tracepoint_refcount@toc(r2);          \
+       ld      r12,32(r1);                                     \
        cmpdi   r12,0;                                          \
        beq+    1f;                                             \
        mflr    r0;                                             \
index 948e0e3..7bc73af 100644 (file)
@@ -546,6 +546,13 @@ void __trace_hcall_entry(unsigned long opcode, unsigned long *args)
        unsigned long flags;
        unsigned int *depth;
 
+       /*
+        * We cannot call tracepoints inside RCU idle regions which
+        * means we must not trace H_CEDE.
+        */
+       if (opcode == H_CEDE)
+               return;
+
        local_irq_save(flags);
 
        depth = &__get_cpu_var(hcall_trace_depth);
@@ -556,8 +563,6 @@ void __trace_hcall_entry(unsigned long opcode, unsigned long *args)
        (*depth)++;
        preempt_disable();
        trace_hcall_entry(opcode, args);
-       if (opcode == H_CEDE)
-               rcu_idle_enter();
        (*depth)--;
 
 out:
@@ -570,6 +575,9 @@ void __trace_hcall_exit(long opcode, unsigned long retval,
        unsigned long flags;
        unsigned int *depth;
 
+       if (opcode == H_CEDE)
+               return;
+
        local_irq_save(flags);
 
        depth = &__get_cpu_var(hcall_trace_depth);
@@ -578,8 +586,6 @@ void __trace_hcall_exit(long opcode, unsigned long retval,
                goto out;
 
        (*depth)++;
-       if (opcode == H_CEDE)
-               rcu_idle_exit();
        trace_hcall_exit(opcode, retval, retbuf);
        preempt_enable();
        (*depth)--;
index 330a57b..36f957f 100644 (file)
@@ -638,7 +638,6 @@ static void oops_to_nvram(struct kmsg_dumper *dumper,
                /* These are almost always orderly shutdowns. */
                return;
        case KMSG_DUMP_OOPS:
-       case KMSG_DUMP_KEXEC:
                break;
        case KMSG_DUMP_PANIC:
                panicking = true;
index 27272f6..d25843a 100644 (file)
@@ -236,7 +236,7 @@ static inline unsigned long __rewind_psw(psw_t psw, unsigned long ilc)
 /*
  * Function to drop a processor into disabled wait state
  */
-static inline void ATTRIB_NORET disabled_wait(unsigned long code)
+static inline void __noreturn disabled_wait(unsigned long code)
 {
         unsigned long ctl_buf;
         psw_t dw_psw;
index fab8843..0fd2e86 100644 (file)
@@ -30,7 +30,7 @@ struct mcck_struct {
 
 static DEFINE_PER_CPU(struct mcck_struct, cpu_mcck);
 
-static NORET_TYPE void s390_handle_damage(char *msg)
+static void s390_handle_damage(char *msg)
 {
        smp_send_stop();
        disabled_wait((unsigned long) __builtin_return_address(0));
index aaf6d59..7ec6651 100644 (file)
@@ -70,7 +70,7 @@ void show_regs(struct pt_regs * regs)
 /*
  * Create a kernel thread
  */
-ATTRIB_NORET void kernel_thread_helper(void *arg, int (*fn)(void *))
+__noreturn void kernel_thread_helper(void *arg, int (*fn)(void *))
 {
        do_exit(fn(arg));
 }
index 210c1ca..cbd4e4b 100644 (file)
@@ -285,7 +285,7 @@ void show_regs(struct pt_regs *regs)
 /*
  * Create a kernel thread
  */
-ATTRIB_NORET void kernel_thread_helper(void *arg, int (*fn)(void *))
+__noreturn void kernel_thread_helper(void *arg, int (*fn)(void *))
 {
        do_exit(fn(arg));
 }
index e00d717..6255f2e 100644 (file)
@@ -248,11 +248,11 @@ static void setup_quasi_va_is_pa(void)
 }
 
 
-NORET_TYPE void machine_kexec(struct kimage *image)
+void machine_kexec(struct kimage *image)
 {
        void *reboot_code_buffer;
-       NORET_TYPE void (*rnk)(unsigned long, void *, unsigned long)
-               ATTRIB_NORET;
+       void (*rnk)(unsigned long, void *, unsigned long)
+               __noreturn;
 
        /* Mask all interrupts before starting to reboot. */
        interrupt_mask_set_mask(~0ULL);
index a150f4c..6c14ecd 100644 (file)
@@ -60,6 +60,9 @@ config X86
        select PERF_EVENTS
        select HAVE_PERF_EVENTS_NMI
        select ANON_INODES
+       select HAVE_ALIGNED_STRUCT_PAGE if SLUB && !M386
+       select HAVE_CMPXCHG_LOCAL if !M386
+       select HAVE_CMPXCHG_DOUBLE
        select HAVE_ARCH_KMEMCHECK
        select HAVE_USER_RETURN_NOTIFIER
        select ARCH_BINFMT_ELF_RANDOMIZE_PIE
index e3ca7e0..3c57033 100644 (file)
@@ -309,12 +309,6 @@ config X86_INTERNODE_CACHE_SHIFT
 config X86_CMPXCHG
        def_bool X86_64 || (X86_32 && !M386)
 
-config CMPXCHG_LOCAL
-       def_bool X86_64 || (X86_32 && !M386)
-
-config CMPXCHG_DOUBLE
-       def_bool y
-
 config X86_L1_CACHE_SHIFT
        int
        default "7" if MPENTIUM4 || MPSC
index f22a9f7..29ba329 100644 (file)
@@ -2011,7 +2011,7 @@ static __cpuinit int mce_device_create(unsigned int cpu)
        if (!mce_available(&boot_cpu_data))
                return -EIO;
 
-       memset(&dev->kobj, 0, sizeof(struct kobject));
+       memset(dev, 0, sizeof(struct device));
        dev->id  = cpu;
        dev->bus = &mce_subsys;
 
index 020cd2e..19d3fa0 100644 (file)
@@ -110,7 +110,7 @@ void __cpuinit numa_clear_node(int cpu)
  * Allocate node_to_cpumask_map based on number of available nodes
  * Requires node_possible_map to be valid.
  *
- * Note: node_to_cpumask() is not valid until after this is done.
+ * Note: cpumask_of_node() is not valid until after this is done.
  * (Use CONFIG_DEBUG_PER_CPU_MAPS to check this.)
  */
 void __init setup_node_to_cpumask_map(void)
index 1d97bd8..b2b54d2 100644 (file)
@@ -6,14 +6,6 @@ menu "UML-specific options"
 
 menu "Host processor type and features"
 
-config CMPXCHG_LOCAL
-       bool
-       default n
-
-config CMPXCHG_DOUBLE
-       bool
-       default n
-
 source "arch/x86/Kconfig.cpu"
 
 endmenu
index 1b31421..c07be02 100644 (file)
@@ -97,7 +97,7 @@ obj-$(CONFIG_EISA)            += eisa/
 obj-y                          += lguest/
 obj-$(CONFIG_CPU_FREQ)         += cpufreq/
 obj-$(CONFIG_CPU_IDLE)         += cpuidle/
-obj-$(CONFIG_MMC)              += mmc/
+obj-y                          += mmc/
 obj-$(CONFIG_MEMSTICK)         += memstick/
 obj-y                          += leds/
 obj-$(CONFIG_INFINIBAND)       += infiniband/
index fcbec8a..7be9f79 100644 (file)
@@ -179,7 +179,7 @@ config GENERIC_CPU_DEVICES
 source "drivers/base/regmap/Kconfig"
 
 config DMA_SHARED_BUFFER
-       bool "Buffer framework to be shared between drivers"
+       bool
        default n
        select ANON_INODES
        depends on EXPERIMENTAL
index f17e3ea..ed5de58 100644 (file)
@@ -295,11 +295,22 @@ static int memory_block_change_state(struct memory_block *mem,
 
        ret = memory_block_action(mem->start_section_nr, to_state);
 
-       if (ret)
+       if (ret) {
                mem->state = from_state_req;
-       else
-               mem->state = to_state;
+               goto out;
+       }
 
+       mem->state = to_state;
+       switch (mem->state) {
+       case MEM_OFFLINE:
+               kobject_uevent(&mem->dev.kobj, KOBJ_OFFLINE);
+               break;
+       case MEM_ONLINE:
+               kobject_uevent(&mem->dev.kobj, KOBJ_ONLINE);
+               break;
+       default:
+               break;
+       }
 out:
        mutex_unlock(&mem->state_mutex);
        return ret;
index 148ab94..3fd31de 100644 (file)
@@ -2184,6 +2184,8 @@ static ssize_t rbd_add(struct bus_type *bus,
        INIT_LIST_HEAD(&rbd_dev->node);
        INIT_LIST_HEAD(&rbd_dev->snaps);
 
+       init_rwsem(&rbd_dev->header.snap_rwsem);
+
        /* generate unique id: find highest unique id, add one */
        mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
 
index 7c7f42a..9fec323 100644 (file)
@@ -83,8 +83,7 @@ static void ramoops_do_dump(struct kmsg_dumper *dumper,
        struct timeval timestamp;
 
        if (reason != KMSG_DUMP_OOPS &&
-           reason != KMSG_DUMP_PANIC &&
-           reason != KMSG_DUMP_KEXEC)
+           reason != KMSG_DUMP_PANIC)
                return;
 
        /* Only dump oopses if dump_oops is set */
@@ -126,8 +125,8 @@ static int __init ramoops_probe(struct platform_device *pdev)
                goto fail3;
        }
 
-       rounddown_pow_of_two(pdata->mem_size);
-       rounddown_pow_of_two(pdata->record_size);
+       pdata->mem_size = rounddown_pow_of_two(pdata->mem_size);
+       pdata->record_size = rounddown_pow_of_two(pdata->record_size);
 
        /* Check for the minimum memory size */
        if (pdata->mem_size < MIN_MEM_SIZE &&
@@ -148,14 +147,6 @@ static int __init ramoops_probe(struct platform_device *pdev)
        cxt->phys_addr = pdata->mem_address;
        cxt->record_size = pdata->record_size;
        cxt->dump_oops = pdata->dump_oops;
-       /*
-        * Update the module parameter variables as well so they are visible
-        * through /sys/module/ramoops/parameters/
-        */
-       mem_size = pdata->mem_size;
-       mem_address = pdata->mem_address;
-       record_size = pdata->record_size;
-       dump_oops = pdata->dump_oops;
 
        if (!request_mem_region(cxt->phys_addr, cxt->size, "ramoops")) {
                pr_err("request mem region failed\n");
@@ -176,6 +167,15 @@ static int __init ramoops_probe(struct platform_device *pdev)
                goto fail1;
        }
 
+       /*
+        * Update the module parameter variables as well so they are visible
+        * through /sys/module/ramoops/parameters/
+        */
+       mem_size = pdata->mem_size;
+       mem_address = pdata->mem_address;
+       record_size = pdata->record_size;
+       dump_oops = pdata->dump_oops;
+
        return 0;
 
 fail1:
index 4c980b5..87a68a8 100644 (file)
@@ -65,7 +65,14 @@ static void stmpe_gpio_set(struct gpio_chip *chip, unsigned offset, int val)
        u8 reg = stmpe->regs[which] - (offset / 8);
        u8 mask = 1 << (offset % 8);
 
-       stmpe_reg_write(stmpe, reg, mask);
+       /*
+        * Some variants have single register for gpio set/clear functionality.
+        * For them we need to write 0 to clear and 1 to set.
+        */
+       if (stmpe->regs[STMPE_IDX_GPSR_LSB] == stmpe->regs[STMPE_IDX_GPCR_LSB])
+               stmpe_set_bits(stmpe, reg, mask, val ? mask : 0);
+       else
+               stmpe_reg_write(stmpe, reg, mask);
 }
 
 static int stmpe_gpio_direction_output(struct gpio_chip *chip,
@@ -132,6 +139,10 @@ static int stmpe_gpio_irq_set_type(struct irq_data *d, unsigned int type)
        if (type == IRQ_TYPE_LEVEL_LOW || type == IRQ_TYPE_LEVEL_HIGH)
                return -EINVAL;
 
+       /* STMPE801 doesn't have RE and FE registers */
+       if (stmpe_gpio->stmpe->partnum == STMPE801)
+               return 0;
+
        if (type == IRQ_TYPE_EDGE_RISING)
                stmpe_gpio->regs[REG_RE][regoffset] |= mask;
        else
@@ -165,6 +176,11 @@ static void stmpe_gpio_irq_sync_unlock(struct irq_data *d)
        int i, j;
 
        for (i = 0; i < CACHE_NR_REGS; i++) {
+               /* STMPE801 doesn't have RE and FE registers */
+               if ((stmpe->partnum == STMPE801) &&
+                               (i != REG_IE))
+                       continue;
+
                for (j = 0; j < num_banks; j++) {
                        u8 old = stmpe_gpio->oldregs[i][j];
                        u8 new = stmpe_gpio->regs[i][j];
@@ -241,8 +257,11 @@ static irqreturn_t stmpe_gpio_irq(int irq, void *dev)
                }
 
                stmpe_reg_write(stmpe, statmsbreg + i, status[i]);
-               stmpe_reg_write(stmpe, stmpe->regs[STMPE_IDX_GPEDR_MSB] + i,
-                               status[i]);
+
+               /* Edge detect register is not present on 801 */
+               if (stmpe->partnum != STMPE801)
+                       stmpe_reg_write(stmpe, stmpe->regs[STMPE_IDX_GPEDR_MSB]
+                                       + i, status[i]);
        }
 
        return IRQ_HANDLED;
index 6d0f10b..c100f3e 100644 (file)
@@ -66,6 +66,7 @@ static void cdv_intel_crt_dpms(struct drm_encoder *encoder, int mode)
 static int cdv_intel_crt_mode_valid(struct drm_connector *connector,
                                struct drm_display_mode *mode)
 {
+       struct drm_psb_private *dev_priv = connector->dev->dev_private;
        int max_clock = 0;
        if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
                return MODE_NO_DBLESCAN;
@@ -82,6 +83,11 @@ static int cdv_intel_crt_mode_valid(struct drm_connector *connector,
        if (mode->hdisplay > 1680 || mode->vdisplay > 1050)
                return MODE_PANEL;
 
+       /* We assume worst case scenario of 32 bpp here, since we don't know */
+       if ((ALIGN(mode->hdisplay * 4, 64) * mode->vdisplay) >
+           dev_priv->vram_stolen_size)
+               return MODE_MEM;
+
        return MODE_OK;
 }
 
index 50d7cfb..de25560 100644 (file)
@@ -241,6 +241,7 @@ static int cdv_hdmi_get_modes(struct drm_connector *connector)
 static int cdv_hdmi_mode_valid(struct drm_connector *connector,
                                 struct drm_display_mode *mode)
 {
+       struct drm_psb_private *dev_priv = connector->dev->dev_private;
 
        if (mode->clock > 165000)
                return MODE_CLOCK_HIGH;
@@ -255,14 +256,11 @@ static int cdv_hdmi_mode_valid(struct drm_connector *connector,
        if (mode->flags & DRM_MODE_FLAG_INTERLACE)
                return MODE_NO_INTERLACE;
 
-       /*
-        * FIXME: for now we limit the size to 1680x1050 on CDV, otherwise it
-        * will go beyond the stolen memory size allocated to the framebuffer
-        */
-       if (mode->hdisplay > 1680)
-               return MODE_PANEL;
-       if (mode->vdisplay > 1050)
-               return MODE_PANEL;
+       /* We assume worst case scenario of 32 bpp here, since we don't know */
+       if ((ALIGN(mode->hdisplay * 4, 64) * mode->vdisplay) >
+           dev_priv->vram_stolen_size)
+               return MODE_MEM;
+
        return MODE_OK;
 }
 
index 36878a6..025d309 100644 (file)
@@ -506,6 +506,7 @@ int oaktrail_crtc_hdmi_mode_set(struct drm_crtc *crtc,
 static int oaktrail_hdmi_mode_valid(struct drm_connector *connector,
                                struct drm_display_mode *mode)
 {
+       struct drm_psb_private *dev_priv = connector->dev->dev_private;
        if (mode->clock > 165000)
                return MODE_CLOCK_HIGH;
        if (mode->clock < 20000)
@@ -514,6 +515,11 @@ static int oaktrail_hdmi_mode_valid(struct drm_connector *connector,
        if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
                return MODE_NO_DBLESCAN;
 
+       /* We assume worst case scenario of 32 bpp here, since we don't know */
+       if ((ALIGN(mode->hdisplay * 4, 64) * mode->vdisplay) >
+           dev_priv->vram_stolen_size)
+               return MODE_MEM;
+
        return MODE_OK;
 }
 
index 4882b29..88b4297 100644 (file)
@@ -1141,6 +1141,7 @@ static void psb_intel_sdvo_dpms(struct drm_encoder *encoder, int mode)
 static int psb_intel_sdvo_mode_valid(struct drm_connector *connector,
                                 struct drm_display_mode *mode)
 {
+       struct drm_psb_private *dev_priv = connector->dev->dev_private;
        struct psb_intel_sdvo *psb_intel_sdvo = intel_attached_sdvo(connector);
 
        if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
@@ -1160,6 +1161,11 @@ static int psb_intel_sdvo_mode_valid(struct drm_connector *connector,
                        return MODE_PANEL;
        }
 
+       /* We assume worst case scenario of 32 bpp here, since we don't know */
+       if ((ALIGN(mode->hdisplay * 4, 64) * mode->vdisplay) >
+           dev_priv->vram_stolen_size)
+               return MODE_MEM;
+
        return MODE_OK;
 }
 
index 525744d..7814a76 100644 (file)
 
 #include <linux/vga_switcheroo.h>
 
-#define NOUVEAU_DSM_SUPPORTED 0x00
-#define NOUVEAU_DSM_SUPPORTED_FUNCTIONS 0x00
-
-#define NOUVEAU_DSM_ACTIVE 0x01
-#define NOUVEAU_DSM_ACTIVE_QUERY 0x00
-
 #define NOUVEAU_DSM_LED 0x02
 #define NOUVEAU_DSM_LED_STATE 0x00
 #define NOUVEAU_DSM_LED_OFF 0x10
@@ -35,6 +29,9 @@
 #define NOUVEAU_DSM_POWER_SPEED 0x01
 #define NOUVEAU_DSM_POWER_STAMINA 0x02
 
+#define NOUVEAU_DSM_OPTIMUS_FN 0x1A
+#define NOUVEAU_DSM_OPTIMUS_ARGS 0x03000001
+
 static struct nouveau_dsm_priv {
        bool dsm_detected;
        bool optimus_detected;
@@ -61,7 +58,8 @@ static int nouveau_optimus_dsm(acpi_handle handle, int func, int arg, uint32_t *
        struct acpi_object_list input;
        union acpi_object params[4];
        union acpi_object *obj;
-       int err;
+       int i, err;
+       char args_buff[4];
 
        input.count = 4;
        input.pointer = params;
@@ -73,7 +71,11 @@ static int nouveau_optimus_dsm(acpi_handle handle, int func, int arg, uint32_t *
        params[2].type = ACPI_TYPE_INTEGER;
        params[2].integer.value = func;
        params[3].type = ACPI_TYPE_BUFFER;
-       params[3].buffer.length = 0;
+       params[3].buffer.length = 4;
+       /* ACPI is little endian, AABBCCDD becomes {DD,CC,BB,AA} */
+       for (i = 0; i < 4; i++)
+               args_buff[i] = (arg >> i * 8) & 0xFF;
+       params[3].buffer.pointer = args_buff;
 
        err = acpi_evaluate_object(handle, "_DSM", &input, &output);
        if (err) {
@@ -148,6 +150,23 @@ static int nouveau_dsm(acpi_handle handle, int func, int arg, uint32_t *result)
        return 0;
 }
 
+/* Returns 1 if a DSM function is usable and 0 otherwise */
+static int nouveau_test_dsm(acpi_handle test_handle,
+       int (*dsm_func)(acpi_handle, int, int, uint32_t *),
+       int sfnc)
+{
+       u32 result = 0;
+
+       /* Function 0 returns a Buffer containing available functions. The args
+        * parameter is ignored for function 0, so just put 0 in it */
+       if (dsm_func(test_handle, 0, 0, &result))
+               return 0;
+
+       /* ACPI Spec v4 9.14.1: if bit 0 is zero, no function is supported. If
+        * the n-th bit is enabled, function n is supported */
+       return result & 1 && result & (1 << sfnc);
+}
+
 static int nouveau_dsm_switch_mux(acpi_handle handle, int mux_id)
 {
        mxm_wmi_call_mxmx(mux_id == NOUVEAU_DSM_LED_STAMINA ? MXM_MXDS_ADAPTER_IGD : MXM_MXDS_ADAPTER_0);
@@ -168,6 +187,10 @@ static int nouveau_dsm_set_discrete_state(acpi_handle handle, enum vga_switchero
 
 static int nouveau_dsm_switchto(enum vga_switcheroo_client_id id)
 {
+       /* perhaps the _DSM functions are mutually exclusive, but prepare for
+        * the future */
+       if (!nouveau_dsm_priv.dsm_detected && nouveau_dsm_priv.optimus_detected)
+               return 0;
        if (id == VGA_SWITCHEROO_IGD)
                return nouveau_dsm_switch_mux(nouveau_dsm_priv.dhandle, NOUVEAU_DSM_LED_STAMINA);
        else
@@ -180,6 +203,11 @@ static int nouveau_dsm_power_state(enum vga_switcheroo_client_id id,
        if (id == VGA_SWITCHEROO_IGD)
                return 0;
 
+       /* Optimus laptops have the card already disabled in
+        * nouveau_switcheroo_set_state */
+       if (!nouveau_dsm_priv.dsm_detected && nouveau_dsm_priv.optimus_detected)
+               return 0;
+
        return nouveau_dsm_set_discrete_state(nouveau_dsm_priv.dhandle, state);
 }
 
@@ -212,8 +240,7 @@ static int nouveau_dsm_pci_probe(struct pci_dev *pdev)
 {
        acpi_handle dhandle, nvidia_handle;
        acpi_status status;
-       int ret, retval = 0;
-       uint32_t result;
+       int retval = 0;
 
        dhandle = DEVICE_ACPI_HANDLE(&pdev->dev);
        if (!dhandle)
@@ -224,13 +251,11 @@ static int nouveau_dsm_pci_probe(struct pci_dev *pdev)
                return false;
        }
 
-       ret = nouveau_dsm(dhandle, NOUVEAU_DSM_SUPPORTED,
-                         NOUVEAU_DSM_SUPPORTED_FUNCTIONS, &result);
-       if (ret == 0)
+       if (nouveau_test_dsm(dhandle, nouveau_dsm, NOUVEAU_DSM_POWER))
                retval |= NOUVEAU_DSM_HAS_MUX;
 
-       ret = nouveau_optimus_dsm(dhandle, 0, 0, &result);
-       if (ret == 0)
+       if (nouveau_test_dsm(dhandle, nouveau_optimus_dsm,
+               NOUVEAU_DSM_OPTIMUS_FN))
                retval |= NOUVEAU_DSM_HAS_OPT;
 
        if (retval)
@@ -269,15 +294,22 @@ static bool nouveau_dsm_detect(void)
        }
 
        if (vga_count == 2 && has_dsm && guid_valid) {
-               acpi_get_name(nouveau_dsm_priv.dhandle, ACPI_FULL_PATHNAME, &buffer);
+               acpi_get_name(nouveau_dsm_priv.dhandle, ACPI_FULL_PATHNAME,
+                       &buffer);
                printk(KERN_INFO "VGA switcheroo: detected DSM switching method %s handle\n",
-                      acpi_method_name);
+                       acpi_method_name);
                nouveau_dsm_priv.dsm_detected = true;
                ret = true;
        }
 
-       if (has_optimus == 1)
+       if (has_optimus == 1) {
+               acpi_get_name(nouveau_dsm_priv.dhandle, ACPI_FULL_PATHNAME,
+                       &buffer);
+               printk(KERN_INFO "VGA switcheroo: detected Optimus DSM method %s handle\n",
+                       acpi_method_name);
                nouveau_dsm_priv.optimus_detected = true;
+               ret = true;
+       }
 
        return ret;
 }
@@ -293,6 +325,17 @@ void nouveau_register_dsm_handler(void)
        vga_switcheroo_register_handler(&nouveau_dsm_handler);
 }
 
+/* Must be called for Optimus models before the card can be turned off */
+void nouveau_switcheroo_optimus_dsm(void)
+{
+       u32 result = 0;
+       if (!nouveau_dsm_priv.optimus_detected)
+               return;
+
+       nouveau_optimus_dsm(nouveau_dsm_priv.dhandle, NOUVEAU_DSM_OPTIMUS_FN,
+               NOUVEAU_DSM_OPTIMUS_ARGS, &result);
+}
+
 void nouveau_unregister_dsm_handler(void)
 {
        vga_switcheroo_unregister_handler();
index 38134a9..b827098 100644 (file)
@@ -1055,12 +1055,14 @@ extern int  nouveau_dma_wait(struct nouveau_channel *, int slots, int size);
 #if defined(CONFIG_ACPI)
 void nouveau_register_dsm_handler(void);
 void nouveau_unregister_dsm_handler(void);
+void nouveau_switcheroo_optimus_dsm(void);
 int nouveau_acpi_get_bios_chunk(uint8_t *bios, int offset, int len);
 bool nouveau_acpi_rom_supported(struct pci_dev *pdev);
 int nouveau_acpi_edid(struct drm_device *, struct drm_connector *);
 #else
 static inline void nouveau_register_dsm_handler(void) {}
 static inline void nouveau_unregister_dsm_handler(void) {}
+static inline void nouveau_switcheroo_optimus_dsm(void) {}
 static inline bool nouveau_acpi_rom_supported(struct pci_dev *pdev) { return false; }
 static inline int nouveau_acpi_get_bios_chunk(uint8_t *bios, int offset, int len) { return -EINVAL; }
 static inline int nouveau_acpi_edid(struct drm_device *dev, struct drm_connector *connector) { return -EINVAL; }
index f5e9891..f80c5e0 100644 (file)
@@ -525,6 +525,7 @@ static void nouveau_switcheroo_set_state(struct pci_dev *pdev,
                printk(KERN_ERR "VGA switcheroo: switched nouveau off\n");
                dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
                drm_kms_helper_poll_disable(dev);
+               nouveau_switcheroo_optimus_dsm();
                nouveau_pci_suspend(pdev, pmm);
                dev->switch_power_state = DRM_SWITCH_POWER_OFF;
        }
index f7442e6..8e8cd85 100644 (file)
@@ -1793,10 +1793,12 @@ int evergreen_ib_parse(struct radeon_device *rdev, struct radeon_ib *ib)
                        ret = -EINVAL;
                        break;
                case PACKET_TYPE2:
+                       idx += 1;
                        break;
                case PACKET_TYPE3:
                        pkt.opcode = CP_PACKET3_GET_OPCODE(ib->ptr[idx]);
                        ret = evergreen_vm_packet3_check(rdev, ib->ptr, &pkt);
+                       idx += pkt.count + 2;
                        break;
                default:
                        dev_err(rdev->dev, "Unknown packet type %d !\n", pkt.type);
@@ -1805,7 +1807,6 @@ int evergreen_ib_parse(struct radeon_device *rdev, struct radeon_ib *ib)
                }
                if (ret)
                        break;
-               idx += pkt.count + 2;
        } while (idx < ib->length_dw);
 
        return ret;
index 3ec81c3..bfd36ab 100644 (file)
@@ -2186,7 +2186,6 @@ bool r100_gpu_is_lockup(struct radeon_device *rdev, struct radeon_ring *ring)
 void r100_bm_disable(struct radeon_device *rdev)
 {
        u32 tmp;
-       u16 tmp16;
 
        /* disable bus mastering */
        tmp = RREG32(R_000030_BUS_CNTL);
@@ -2197,8 +2196,7 @@ void r100_bm_disable(struct radeon_device *rdev)
        WREG32(R_000030_BUS_CNTL, (tmp & 0xFFFFFFFF) | 0x00000040);
        tmp = RREG32(RADEON_BUS_CNTL);
        mdelay(1);
-       pci_read_config_word(rdev->pdev, 0x4, &tmp16);
-       pci_write_config_word(rdev->pdev, 0x4, tmp16 & 0xFFFB);
+       pci_clear_master(rdev->pdev);
        mdelay(1);
 }
 
index 31da622..8032f1f 100644 (file)
@@ -145,7 +145,7 @@ module_param_named(vramlimit, radeon_vram_limit, int, 0600);
 MODULE_PARM_DESC(agpmode, "AGP Mode (-1 == PCI)");
 module_param_named(agpmode, radeon_agpmode, int, 0444);
 
-MODULE_PARM_DESC(gartsize, "Size of PCIE/IGP gart to setup in megabytes (32,64, etc)\n");
+MODULE_PARM_DESC(gartsize, "Size of PCIE/IGP gart to setup in megabytes (32, 64, etc)");
 module_param_named(gartsize, radeon_gart_size, int, 0600);
 
 MODULE_PARM_DESC(benchmark, "Run benchmark");
index 803e0d3..ec46eb4 100644 (file)
@@ -322,16 +322,6 @@ void rs600_hpd_fini(struct radeon_device *rdev)
        }
 }
 
-void rs600_bm_disable(struct radeon_device *rdev)
-{
-       u16 tmp;
-
-       /* disable bus mastering */
-       pci_read_config_word(rdev->pdev, 0x4, &tmp);
-       pci_write_config_word(rdev->pdev, 0x4, tmp & 0xFFFB);
-       mdelay(1);
-}
-
 int rs600_asic_reset(struct radeon_device *rdev)
 {
        struct rv515_mc_save save;
@@ -355,7 +345,8 @@ int rs600_asic_reset(struct radeon_device *rdev)
        WREG32(RADEON_CP_RB_CNTL, tmp);
        pci_save_state(rdev->pdev);
        /* disable bus mastering */
-       rs600_bm_disable(rdev);
+       pci_clear_master(rdev->pdev);
+       mdelay(1);
        /* reset GA+VAP */
        WREG32(R_0000F0_RBBM_SOFT_RESET, S_0000F0_SOFT_RESET_VAP(1) |
                                        S_0000F0_SOFT_RESET_GA(1));
index 37ead69..0c46d8c 100644 (file)
@@ -952,10 +952,9 @@ void ttm_dma_unpopulate(struct ttm_dma_tt *ttm_dma, struct device *dev)
 
        type = ttm_to_type(ttm->page_flags, ttm->caching_state);
        pool = ttm_dma_find_pool(dev, type);
-       if (!pool) {
-               WARN_ON(!pool);
+       if (!pool)
                return;
-       }
+
        is_cached = (ttm_dma_find_pool(pool->dev,
                     ttm_to_type(ttm->page_flags, tt_cached)) == pool);
 
index b6807db..e66d248 100644 (file)
 #define        ALI1535_SMBIO_EN        0x04    /* SMB I/O Space enable         */
 
 static struct pci_driver ali1535_driver;
-static unsigned short ali1535_smba;
+static unsigned long ali1535_smba;
+static unsigned short ali1535_offset;
 
 /* Detect whether a ALI1535 can be found, and initialize it, where necessary.
    Note the differences between kernels with the old PCI BIOS interface and
@@ -140,7 +141,7 @@ static unsigned short ali1535_smba;
    defined to make the transition easier. */
 static int __devinit ali1535_setup(struct pci_dev *dev)
 {
-       int retval = -ENODEV;
+       int retval;
        unsigned char temp;
 
        /* Check the following things:
@@ -149,15 +150,28 @@ static int __devinit ali1535_setup(struct pci_dev *dev)
                - We can use the addresses
        */
 
+       retval = pci_enable_device(dev);
+       if (retval) {
+               dev_err(&dev->dev, "ALI1535_smb can't enable device\n");
+               goto exit;
+       }
+
        /* Determine the address of the SMBus area */
-       pci_read_config_word(dev, SMBBA, &ali1535_smba);
-       ali1535_smba &= (0xffff & ~(ALI1535_SMB_IOSIZE - 1));
-       if (ali1535_smba == 0) {
+       pci_read_config_word(dev, SMBBA, &ali1535_offset);
+       dev_dbg(&dev->dev, "ALI1535_smb is at offset 0x%04x\n", ali1535_offset);
+       ali1535_offset &= (0xffff & ~(ALI1535_SMB_IOSIZE - 1));
+       if (ali1535_offset == 0) {
                dev_warn(&dev->dev,
                        "ALI1535_smb region uninitialized - upgrade BIOS?\n");
+               retval = -ENODEV;
                goto exit;
        }
 
+       if (pci_resource_flags(dev, 0) & IORESOURCE_IO)
+               ali1535_smba = pci_resource_start(dev, 0) + ali1535_offset;
+       else
+               ali1535_smba = ali1535_offset;
+
        retval = acpi_check_region(ali1535_smba, ALI1535_SMB_IOSIZE,
                                   ali1535_driver.name);
        if (retval)
@@ -165,8 +179,9 @@ static int __devinit ali1535_setup(struct pci_dev *dev)
 
        if (!request_region(ali1535_smba, ALI1535_SMB_IOSIZE,
                            ali1535_driver.name)) {
-               dev_err(&dev->dev, "ALI1535_smb region 0x%x already in use!\n",
+               dev_err(&dev->dev, "ALI1535_smb region 0x%lx already in use!\n",
                        ali1535_smba);
+               retval = -EBUSY;
                goto exit;
        }
 
@@ -174,6 +189,7 @@ static int __devinit ali1535_setup(struct pci_dev *dev)
        pci_read_config_byte(dev, SMBCFG, &temp);
        if ((temp & ALI1535_SMBIO_EN) == 0) {
                dev_err(&dev->dev, "SMB device not enabled - upgrade BIOS?\n");
+               retval = -ENODEV;
                goto exit_free;
        }
 
@@ -181,6 +197,7 @@ static int __devinit ali1535_setup(struct pci_dev *dev)
        pci_read_config_byte(dev, SMBHSTCFG, &temp);
        if ((temp & 1) == 0) {
                dev_err(&dev->dev, "SMBus controller not enabled - upgrade BIOS?\n");
+               retval = -ENODEV;
                goto exit_free;
        }
 
@@ -196,14 +213,13 @@ static int __devinit ali1535_setup(struct pci_dev *dev)
        */
        pci_read_config_byte(dev, SMBREV, &temp);
        dev_dbg(&dev->dev, "SMBREV = 0x%X\n", temp);
-       dev_dbg(&dev->dev, "ALI1535_smba = 0x%X\n", ali1535_smba);
+       dev_dbg(&dev->dev, "ALI1535_smba = 0x%lx\n", ali1535_smba);
 
-       retval = 0;
-exit:
-       return retval;
+       return 0;
 
 exit_free:
        release_region(ali1535_smba, ALI1535_SMB_IOSIZE);
+exit:
        return retval;
 }
 
@@ -498,7 +514,7 @@ static int __devinit ali1535_probe(struct pci_dev *dev, const struct pci_device_
        ali1535_adapter.dev.parent = &dev->dev;
 
        snprintf(ali1535_adapter.name, sizeof(ali1535_adapter.name),
-               "SMBus ALI1535 adapter at %04x", ali1535_smba);
+               "SMBus ALI1535 adapter at %04x", ali1535_offset);
        return i2c_add_adapter(&ali1535_adapter);
 }
 
index a409cfc..47ae009 100644 (file)
@@ -417,7 +417,7 @@ static void __devexit ali1563_remove(struct pci_dev * dev)
        ali1563_shutdown(dev);
 }
 
-static const struct pci_device_id ali1563_id_table[] __devinitconst = {
+static DEFINE_PCI_DEVICE_TABLE(ali1563_id_table) = {
        { PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1563) },
        {},
 };
index 83e8a60..087ea9c 100644 (file)
@@ -477,7 +477,7 @@ static struct i2c_adapter ali15x3_adapter = {
        .algo           = &smbus_algorithm,
 };
 
-static const struct pci_device_id ali15x3_ids[] = {
+static DEFINE_PCI_DEVICE_TABLE(ali15x3_ids) = {
        { PCI_DEVICE(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101) },
        { 0, }
 };
index 03bcd07..eb778bf 100644 (file)
@@ -308,7 +308,7 @@ static const char* chipname[] = {
        "nVidia nForce", "AMD8111",
 };
 
-static const struct pci_device_id amd756_ids[] = {
+static DEFINE_PCI_DEVICE_TABLE(amd756_ids) = {
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_740B),
          .driver_data = AMD756 },
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7413),
index 6b6a6b1..e5ac53b 100644 (file)
@@ -415,7 +415,7 @@ static const struct i2c_algorithm smbus_algorithm = {
 };
 
 
-static const struct pci_device_id amd8111_ids[] = {
+static DEFINE_PCI_DEVICE_TABLE(amd8111_ids) = {
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8111_SMBUS2) },
        { 0, }
 };
index 305c075..1679dee 100644 (file)
@@ -295,9 +295,6 @@ static int at91_i2c_resume(struct platform_device *pdev)
 #define at91_i2c_resume                NULL
 #endif
 
-/* work with "modprobe at91_i2c" from hotplugging or coldplugging */
-MODULE_ALIAS("platform:at91_i2c");
-
 static struct platform_driver at91_i2c_driver = {
        .probe          = at91_i2c_probe,
        .remove         = __devexit_p(at91_i2c_remove),
@@ -309,19 +306,9 @@ static struct platform_driver at91_i2c_driver = {
        },
 };
 
-static int __init at91_i2c_init(void)
-{
-       return platform_driver_register(&at91_i2c_driver);
-}
-
-static void __exit at91_i2c_exit(void)
-{
-       platform_driver_unregister(&at91_i2c_driver);
-}
-
-module_init(at91_i2c_init);
-module_exit(at91_i2c_exit);
+module_platform_driver(at91_i2c_driver);
 
 MODULE_AUTHOR("Rick Bronson");
 MODULE_DESCRIPTION("I2C (TWI) driver for Atmel AT91");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:at91_i2c");
index f314d7f..582d616 100644 (file)
@@ -426,20 +426,9 @@ static struct platform_driver au1xpsc_smbus_driver = {
        .remove         = __devexit_p(i2c_au1550_remove),
 };
 
-static int __init i2c_au1550_init(void)
-{
-       return platform_driver_register(&au1xpsc_smbus_driver);
-}
-
-static void __exit i2c_au1550_exit(void)
-{
-       platform_driver_unregister(&au1xpsc_smbus_driver);
-}
+module_platform_driver(au1xpsc_smbus_driver);
 
 MODULE_AUTHOR("Dan Malek, Embedded Edge, LLC.");
 MODULE_DESCRIPTION("SMBus adapter Alchemy pb1550");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("platform:au1xpsc_smbus");
-
-module_init (i2c_au1550_init);
-module_exit (i2c_au1550_exit);
index b1d9cd2..c1e1096 100644 (file)
@@ -724,18 +724,7 @@ static struct platform_driver cpm_i2c_driver = {
        },
 };
 
-static int __init cpm_i2c_init(void)
-{
-       return platform_driver_register(&cpm_i2c_driver);
-}
-
-static void __exit cpm_i2c_exit(void)
-{
-       platform_driver_unregister(&cpm_i2c_driver);
-}
-
-module_init(cpm_i2c_init);
-module_exit(cpm_i2c_exit);
+module_platform_driver(cpm_i2c_driver);
 
 MODULE_AUTHOR("Jochen Friedrich <jochen@scram.de>");
 MODULE_DESCRIPTION("I2C-Bus adapter routines for CPM boards");
index 9e89e73..37f4211 100644 (file)
@@ -349,7 +349,7 @@ static void __devexit i2c_dw_pci_remove(struct pci_dev *pdev)
 /* work with hotplug and coldplug */
 MODULE_ALIAS("i2c_designware-pci");
 
-DEFINE_PCI_DEVICE_TABLE(i2_designware_pci_ids) = {
+static DEFINE_PCI_DEVICE_TABLE(i2_designware_pci_ids) = {
        /* Moorestown */
        { PCI_VDEVICE(INTEL, 0x0802), moorestown_0 },
        { PCI_VDEVICE(INTEL, 0x0803), moorestown_1 },
index 18936ac..3ef3557 100644 (file)
@@ -185,7 +185,7 @@ static DEFINE_MUTEX(pch_mutex);
 #define PCI_DEVICE_ID_ML7213_I2C       0x802D
 #define PCI_DEVICE_ID_ML7223_I2C       0x8010
 
-static struct pci_device_id __devinitdata pch_pcidev_id[] = {
+static DEFINE_PCI_DEVICE_TABLE(pch_pcidev_id) = {
        { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_PCH_I2C),   1, },
        { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7213_I2C), 2, },
        { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ML7223_I2C), 1, },
index fa88868..19515df 100644 (file)
@@ -468,18 +468,7 @@ static struct platform_driver highlander_i2c_driver = {
        .remove         = __devexit_p(highlander_i2c_remove),
 };
 
-static int __init highlander_i2c_init(void)
-{
-       return platform_driver_register(&highlander_i2c_driver);
-}
-
-static void __exit highlander_i2c_exit(void)
-{
-       platform_driver_unregister(&highlander_i2c_driver);
-}
-
-module_init(highlander_i2c_init);
-module_exit(highlander_i2c_exit);
+module_platform_driver(highlander_i2c_driver);
 
 MODULE_AUTHOR("Paul Mundt");
 MODULE_DESCRIPTION("Renesas Highlander FPGA I2C/SMBus adapter");
index 9ff1695..c527de1 100644 (file)
@@ -105,7 +105,7 @@ static struct i2c_adapter hydra_adap = {
        .algo_data      = &hydra_bit_data,
 };
 
-static const struct pci_device_id hydra_ids[] = {
+static DEFINE_PCI_DEVICE_TABLE(hydra_ids) = {
        { PCI_DEVICE(PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_HYDRA) },
        { 0, }
 };
index ab26840..5d2e281 100644 (file)
@@ -609,7 +609,7 @@ static const struct i2c_algorithm smbus_algorithm = {
        .functionality  = i801_func,
 };
 
-static const struct pci_device_id i801_ids[] = {
+static DEFINE_PCI_DEVICE_TABLE(i801_ids) = {
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_3) },
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AB_3) },
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_2) },
index c08ceb9..806e225 100644 (file)
@@ -815,15 +815,4 @@ static struct platform_driver ibm_iic_driver = {
        .remove = __devexit_p(iic_remove),
 };
 
-static int __init iic_init(void)
-{
-       return platform_driver_register(&ibm_iic_driver);
-}
-
-static void __exit iic_exit(void)
-{
-       platform_driver_unregister(&ibm_iic_driver);
-}
-
-module_init(iic_init);
-module_exit(iic_exit);
+module_platform_driver(ibm_iic_driver);
index e828ac8..365bad5 100644 (file)
@@ -1093,7 +1093,7 @@ static void __devexit intel_mid_i2c_remove(struct pci_dev *dev)
        pci_release_region(dev, 0);
 }
 
-static struct pci_device_id intel_mid_i2c_ids[] = {
+static DEFINE_PCI_DEVICE_TABLE(intel_mid_i2c_ids) = {
        /* Moorestown */
        { PCI_VDEVICE(INTEL, 0x0802), 0 },
        { PCI_VDEVICE(INTEL, 0x0803), 1 },
index f09c931..93f147a 100644 (file)
@@ -523,21 +523,7 @@ static struct platform_driver iop3xx_i2c_driver = {
        },
 };
 
-static int __init 
-i2c_iop3xx_init (void)
-{
-       return platform_driver_register(&iop3xx_i2c_driver);
-}
-
-static void __exit 
-i2c_iop3xx_exit (void)
-{
-       platform_driver_unregister(&iop3xx_i2c_driver);
-       return;
-}
-
-module_init (i2c_iop3xx_init);
-module_exit (i2c_iop3xx_exit);
+module_platform_driver(iop3xx_i2c_driver);
 
 MODULE_AUTHOR("D-TACQ Solutions Ltd <www.d-tacq.com>");
 MODULE_DESCRIPTION("IOP3xx iic algorithm and driver");
index 0682f8f..6561d27 100644 (file)
@@ -306,20 +306,9 @@ static struct platform_driver smbus_sch_driver = {
        .remove         = __devexit_p(smbus_sch_remove),
 };
 
-static int __init i2c_sch_init(void)
-{
-       return platform_driver_register(&smbus_sch_driver);
-}
-
-static void __exit i2c_sch_exit(void)
-{
-       platform_driver_unregister(&smbus_sch_driver);
-}
+module_platform_driver(smbus_sch_driver);
 
 MODULE_AUTHOR("Jacob Pan <jacob.jun.pan@intel.com>");
 MODULE_DESCRIPTION("Intel SCH SMBus driver");
 MODULE_LICENSE("GPL");
-
-module_init(i2c_sch_init);
-module_exit(i2c_sch_exit);
 MODULE_ALIAS("platform:isch_smbus");
index c01e951..5d263f9 100644 (file)
@@ -148,18 +148,7 @@ static struct platform_driver ixp2000_i2c_driver = {
        },
 };
 
-static int __init ixp2000_i2c_init(void)
-{
-       return platform_driver_register(&ixp2000_i2c_driver);
-}
-
-static void __exit ixp2000_i2c_exit(void)
-{
-       platform_driver_unregister(&ixp2000_i2c_driver);
-}
-
-module_init(ixp2000_i2c_init);
-module_exit(ixp2000_i2c_exit);
+module_platform_driver(ixp2000_i2c_driver);
 
 MODULE_AUTHOR ("Deepak Saxena <dsaxena@plexity.net>");
 MODULE_DESCRIPTION("IXP2000 GPIO-based I2C bus driver");
index 107397a..a8ebb84 100644 (file)
@@ -715,18 +715,7 @@ static struct platform_driver mpc_i2c_driver = {
        },
 };
 
-static int __init fsl_i2c_init(void)
-{
-       return platform_driver_register(&mpc_i2c_driver);
-}
-
-static void __exit fsl_i2c_exit(void)
-{
-       platform_driver_unregister(&mpc_i2c_driver);
-}
-
-module_init(fsl_i2c_init);
-module_exit(fsl_i2c_exit);
+module_platform_driver(mpc_i2c_driver);
 
 MODULE_AUTHOR("Adrian Cox <adrian@humboldt.co.uk>");
 MODULE_DESCRIPTION("I2C-Bus adapter for MPC107 bridge and "
index a9941c6..4f44a33 100644 (file)
@@ -611,20 +611,7 @@ static struct platform_driver mv64xxx_i2c_driver = {
        },
 };
 
-static int __init
-mv64xxx_i2c_init(void)
-{
-       return platform_driver_register(&mv64xxx_i2c_driver);
-}
-
-static void __exit
-mv64xxx_i2c_exit(void)
-{
-       platform_driver_unregister(&mv64xxx_i2c_driver);
-}
-
-module_init(mv64xxx_i2c_init);
-module_exit(mv64xxx_i2c_exit);
+module_platform_driver(mv64xxx_i2c_driver);
 
 MODULE_AUTHOR("Mark A. Greer <mgreer@mvista.com>");
 MODULE_DESCRIPTION("Marvell mv64xxx host bridge i2c ctlr driver");
index ff1e127..43a96a1 100644 (file)
@@ -309,7 +309,7 @@ static struct i2c_algorithm smbus_algorithm = {
 };
 
 
-static const struct pci_device_id nforce2_ids[] = {
+static DEFINE_PCI_DEVICE_TABLE(nforce2_ids) = {
        { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS) },
        { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE2S_SMBUS) },
        { PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE3_SMBUS) },
@@ -356,7 +356,7 @@ static int __devinit nforce2_probe_smb (struct pci_dev *dev, int bar,
        error = acpi_check_region(smbus->base, smbus->size,
                                  nforce2_driver.name);
        if (error)
-               return -1;
+               return error;
 
        if (!request_region(smbus->base, smbus->size, nforce2_driver.name)) {
                dev_err(&smbus->adapter.dev, "Error requesting region %02x .. %02X for %s\n",
index 1b46a9d..18068de 100644 (file)
@@ -394,9 +394,6 @@ static struct of_device_id ocores_i2c_match[] = {
 };
 MODULE_DEVICE_TABLE(of, ocores_i2c_match);
 
-/* work with hotplug and coldplug */
-MODULE_ALIAS("platform:ocores-i2c");
-
 static struct platform_driver ocores_i2c_driver = {
        .probe   = ocores_i2c_probe,
        .remove  = __devexit_p(ocores_i2c_remove),
@@ -409,19 +406,9 @@ static struct platform_driver ocores_i2c_driver = {
        },
 };
 
-static int __init ocores_i2c_init(void)
-{
-       return platform_driver_register(&ocores_i2c_driver);
-}
-
-static void __exit ocores_i2c_exit(void)
-{
-       platform_driver_unregister(&ocores_i2c_driver);
-}
-
-module_init(ocores_i2c_init);
-module_exit(ocores_i2c_exit);
+module_platform_driver(ocores_i2c_driver);
 
 MODULE_AUTHOR("Peter Korsgaard <jacmet@sunsite.dk>");
 MODULE_DESCRIPTION("OpenCores I2C bus driver");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:ocores-i2c");
index 56dbe54..ee139a5 100644 (file)
@@ -629,24 +629,10 @@ static struct platform_driver octeon_i2c_driver = {
        },
 };
 
-static int __init octeon_i2c_init(void)
-{
-       int rv;
-
-       rv = platform_driver_register(&octeon_i2c_driver);
-       return rv;
-}
-
-static void __exit octeon_i2c_exit(void)
-{
-       platform_driver_unregister(&octeon_i2c_driver);
-}
+module_platform_driver(octeon_i2c_driver);
 
 MODULE_AUTHOR("Michael Lawnick <michael.lawnick.ext@nsn.com>");
 MODULE_DESCRIPTION("I2C-Bus adapter for Cavium OCTEON processors");
 MODULE_LICENSE("GPL");
 MODULE_VERSION(DRV_VERSION);
 MODULE_ALIAS("platform:" DRV_NAME);
-
-module_init(octeon_i2c_init);
-module_exit(octeon_i2c_exit);
index 837b8c1..eaaea73 100644 (file)
@@ -401,7 +401,7 @@ static void __devexit pasemi_smb_remove(struct pci_dev *dev)
        kfree(smbus);
 }
 
-static const struct pci_device_id pasemi_smb_ids[] = {
+static DEFINE_PCI_DEVICE_TABLE(pasemi_smb_ids) = {
        { PCI_DEVICE(0x1959, 0xa003) },
        { 0, }
 };
index ace6799..2adbf1a 100644 (file)
@@ -286,20 +286,8 @@ static struct platform_driver i2c_pca_pf_driver = {
        },
 };
 
-static int __init i2c_pca_pf_init(void)
-{
-       return platform_driver_register(&i2c_pca_pf_driver);
-}
-
-static void __exit i2c_pca_pf_exit(void)
-{
-       platform_driver_unregister(&i2c_pca_pf_driver);
-}
+module_platform_driver(i2c_pca_pf_driver);
 
 MODULE_AUTHOR("Wolfram Sang <w.sang@pengutronix.de>");
 MODULE_DESCRIPTION("I2C-PCA9564/PCA9665 platform driver");
 MODULE_LICENSE("GPL");
-
-module_init(i2c_pca_pf_init);
-module_exit(i2c_pca_pf_exit);
-
index 6d14ac2..c14d48d 100644 (file)
@@ -472,7 +472,7 @@ static struct i2c_adapter piix4_adapter = {
        .algo           = &smbus_algorithm,
 };
 
-static const struct pci_device_id piix4_ids[] = {
+static DEFINE_PCI_DEVICE_TABLE(piix4_ids) = {
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3) },
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443MX_3) },
        { PCI_DEVICE(PCI_VENDOR_ID_EFAR, PCI_DEVICE_ID_EFAR_SLC90E66_3) },
index 127051b..07b7447 100644 (file)
@@ -627,9 +627,6 @@ static struct i2c_adapter pmcmsptwi_adapter = {
        .name           = DRV_NAME,
 };
 
-/* work with hotplug and coldplug */
-MODULE_ALIAS("platform:" DRV_NAME);
-
 static struct platform_driver pmcmsptwi_driver = {
        .probe  = pmcmsptwi_probe,
        .remove = __devexit_p(pmcmsptwi_remove),
@@ -639,18 +636,8 @@ static struct platform_driver pmcmsptwi_driver = {
        },
 };
 
-static int __init pmcmsptwi_init(void)
-{
-       return platform_driver_register(&pmcmsptwi_driver);
-}
-
-static void __exit pmcmsptwi_exit(void)
-{
-       platform_driver_unregister(&pmcmsptwi_driver);
-}
+module_platform_driver(pmcmsptwi_driver);
 
 MODULE_DESCRIPTION("PMC MSP TWI/SMBus/I2C driver");
 MODULE_LICENSE("GPL");
-
-module_init(pmcmsptwi_init);
-module_exit(pmcmsptwi_exit);
+MODULE_ALIAS("platform:" DRV_NAME);
index b289ec9..7b397c6 100644 (file)
@@ -312,10 +312,6 @@ static int __devinit i2c_powermac_probe(struct platform_device *dev)
        return rc;
 }
 
-
-/* work with hotplug and coldplug */
-MODULE_ALIAS("platform:i2c-powermac");
-
 static struct platform_driver i2c_powermac_driver = {
        .probe = i2c_powermac_probe,
        .remove = __devexit_p(i2c_powermac_remove),
@@ -325,17 +321,6 @@ static struct platform_driver i2c_powermac_driver = {
        },
 };
 
-static int __init i2c_powermac_init(void)
-{
-       platform_driver_register(&i2c_powermac_driver);
-       return 0;
-}
+module_platform_driver(i2c_powermac_driver);
 
-
-static void __exit i2c_powermac_cleanup(void)
-{
-       platform_driver_unregister(&i2c_powermac_driver);
-}
-
-module_init(i2c_powermac_init);
-module_exit(i2c_powermac_cleanup);
+MODULE_ALIAS("platform:i2c-powermac");
index 632e088..a058179 100644 (file)
@@ -150,7 +150,7 @@ static void __devexit ce4100_i2c_remove(struct pci_dev *dev)
        kfree(sds);
 }
 
-static struct pci_device_id ce4100_i2c_devices[] __devinitdata = {
+static DEFINE_PCI_DEVICE_TABLE(ce4100_i2c_devices) = {
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x2e68)},
        { },
 };
index a67132b..c0c9dff 100644 (file)
@@ -560,18 +560,7 @@ static struct platform_driver sh7760_i2c_drv = {
        .remove         = __devexit_p(sh7760_i2c_remove),
 };
 
-static int __init sh7760_i2c_init(void)
-{
-       return platform_driver_register(&sh7760_i2c_drv);
-}
-
-static void __exit sh7760_i2c_exit(void)
-{
-       platform_driver_unregister(&sh7760_i2c_drv);
-}
-
-module_init(sh7760_i2c_init);
-module_exit(sh7760_i2c_exit);
+module_platform_driver(sh7760_i2c_drv);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("SH7760 I2C bus driver");
index 2fc08fb..4fc87e7 100644 (file)
@@ -156,12 +156,8 @@ static int simtec_i2c_remove(struct platform_device *dev)
        return 0;
 }
 
-
 /* device driver */
 
-/* work with hotplug and coldplug */
-MODULE_ALIAS("platform:simtec-i2c");
-
 static struct platform_driver simtec_i2c_driver = {
        .driver         = {
                .name           = "simtec-i2c",
@@ -171,19 +167,9 @@ static struct platform_driver simtec_i2c_driver = {
        .remove         = simtec_i2c_remove,
 };
 
-static int __init i2c_adap_simtec_init(void)
-{
-       return platform_driver_register(&simtec_i2c_driver);
-}
-
-static void __exit i2c_adap_simtec_exit(void)
-{
-       platform_driver_unregister(&simtec_i2c_driver);
-}
-
-module_init(i2c_adap_simtec_init);
-module_exit(i2c_adap_simtec_exit);
+module_platform_driver(simtec_i2c_driver);
 
 MODULE_DESCRIPTION("Simtec Generic I2C Bus driver");
 MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:simtec-i2c");
index 4375866..87e5126 100644 (file)
@@ -147,7 +147,7 @@ static int __devinit sis5595_setup(struct pci_dev *SIS5595_dev)
        u16 a;
        u8 val;
        int *i;
-       int retval = -ENODEV;
+       int retval;
 
        /* Look for imposters */
        for (i = blacklist; *i != 0; i++) {
@@ -223,7 +223,7 @@ static int __devinit sis5595_setup(struct pci_dev *SIS5595_dev)
 
 error:
        release_region(sis5595_base + SMB_INDEX, 2);
-       return retval;
+       return -ENODEV;
 }
 
 static int sis5595_transaction(struct i2c_adapter *adap)
@@ -369,7 +369,7 @@ static struct i2c_adapter sis5595_adapter = {
        .algo           = &smbus_algorithm,
 };
 
-static const struct pci_device_id sis5595_ids[] __devinitconst = {
+static DEFINE_PCI_DEVICE_TABLE(sis5595_ids) = {
        { PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503) }, 
        { 0, }
 };
index 5889377..15cf78f 100644 (file)
@@ -393,7 +393,7 @@ static int __devinit sis630_setup(struct pci_dev *sis630_dev)
 {
        unsigned char b;
        struct pci_dev *dummy = NULL;
-       int retval = -ENODEV, i;
+       int retval, i;
 
        /* check for supported SiS devices */
        for (i=0; supported[i] > 0 ; i++) {
@@ -418,18 +418,21 @@ static int __devinit sis630_setup(struct pci_dev *sis630_dev)
        */
        if (pci_read_config_byte(sis630_dev, SIS630_BIOS_CTL_REG,&b)) {
                dev_err(&sis630_dev->dev, "Error: Can't read bios ctl reg\n");
+               retval = -ENODEV;
                goto exit;
        }
        /* if ACPI already enabled , do nothing */
        if (!(b & 0x80) &&
            pci_write_config_byte(sis630_dev, SIS630_BIOS_CTL_REG, b | 0x80)) {
                dev_err(&sis630_dev->dev, "Error: Can't enable ACPI\n");
+               retval = -ENODEV;
                goto exit;
        }
 
        /* Determine the ACPI base address */
        if (pci_read_config_word(sis630_dev,SIS630_ACPI_BASE_REG,&acpi_base)) {
                dev_err(&sis630_dev->dev, "Error: Can't determine ACPI base address\n");
+               retval = -ENODEV;
                goto exit;
        }
 
@@ -445,6 +448,7 @@ static int __devinit sis630_setup(struct pci_dev *sis630_dev)
                            sis630_driver.name)) {
                dev_err(&sis630_dev->dev, "SMBus registers 0x%04x-0x%04x already "
                        "in use!\n", acpi_base + SMB_STS, acpi_base + SMB_SAA);
+               retval = -EBUSY;
                goto exit;
        }
 
@@ -468,7 +472,7 @@ static struct i2c_adapter sis630_adapter = {
        .algo           = &smbus_algorithm,
 };
 
-static const struct pci_device_id sis630_ids[] __devinitconst = {
+static DEFINE_PCI_DEVICE_TABLE(sis630_ids) = {
        { PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503) },
        { PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_LPC) },
        { 0, }
index 86837f0..cc5d149 100644 (file)
@@ -245,7 +245,7 @@ static struct i2c_adapter sis96x_adapter = {
        .algo           = &smbus_algorithm,
 };
 
-static const struct pci_device_id sis96x_ids[] = {
+static DEFINE_PCI_DEVICE_TABLE(sis96x_ids) = {
        { PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_SMBUS) },
        { 0, }
 };
index 7799fe5..713d31a 100644 (file)
@@ -89,7 +89,7 @@ static struct i2c_adapter vt586b_adapter = {
 };
 
 
-static const struct pci_device_id vt586b_ids[] __devinitconst = {
+static DEFINE_PCI_DEVICE_TABLE(vt586b_ids) = {
        { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3) },
        { 0, }
 };
index 2a62c99..333011c 100644 (file)
@@ -324,7 +324,7 @@ static int __devinit vt596_probe(struct pci_dev *pdev,
                                 const struct pci_device_id *id)
 {
        unsigned char temp;
-       int error = -ENODEV;
+       int error;
 
        /* Determine the address of the SMBus areas */
        if (force_addr) {
@@ -390,6 +390,7 @@ found:
                        dev_err(&pdev->dev, "SMBUS: Error: Host SMBus "
                                "controller not enabled! - upgrade BIOS or "
                                "use force=1\n");
+                       error = -ENODEV;
                        goto release_region;
                }
        }
@@ -422,9 +423,11 @@ found:
                 "SMBus Via Pro adapter at %04x", vt596_smba);
 
        vt596_pdev = pci_dev_get(pdev);
-       if (i2c_add_adapter(&vt596_adapter)) {
+       error = i2c_add_adapter(&vt596_adapter);
+       if (error) {
                pci_dev_put(vt596_pdev);
                vt596_pdev = NULL;
+               goto release_region;
        }
 
        /* Always return failure here.  This is to allow other drivers to bind
@@ -438,7 +441,7 @@ release_region:
        return error;
 }
 
-static const struct pci_device_id vt596_ids[] = {
+static DEFINE_PCI_DEVICE_TABLE(vt596_ids) = {
        { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C596_3),
          .driver_data = SMBBA1 },
        { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C596B_3),
index ac083a2..2bded76 100644 (file)
@@ -795,10 +795,6 @@ static int __devexit xiic_i2c_remove(struct platform_device* pdev)
        return 0;
 }
 
-
-/* work with hotplug and coldplug */
-MODULE_ALIAS("platform:"DRIVER_NAME);
-
 static struct platform_driver xiic_i2c_driver = {
        .probe   = xiic_i2c_probe,
        .remove  = __devexit_p(xiic_i2c_remove),
@@ -808,19 +804,9 @@ static struct platform_driver xiic_i2c_driver = {
        },
 };
 
-static int __init xiic_i2c_init(void)
-{
-       return platform_driver_register(&xiic_i2c_driver);
-}
-
-static void __exit xiic_i2c_exit(void)
-{
-       platform_driver_unregister(&xiic_i2c_driver);
-}
-
-module_init(xiic_i2c_init);
-module_exit(xiic_i2c_exit);
+module_platform_driver(xiic_i2c_driver);
 
 MODULE_AUTHOR("info@mocean-labs.com");
 MODULE_DESCRIPTION("Xilinx I2C bus driver");
 MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:"DRIVER_NAME);
index 91e349c..2eacb77 100644 (file)
@@ -559,7 +559,7 @@ static struct platform_driver scx200_pci_driver = {
        .remove = __devexit_p(scx200_remove),
 };
 
-static const struct pci_device_id scx200_isa[] __initconst = {
+static DEFINE_PCI_DEVICE_TABLE(scx200_isa) = {
        { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_SCx200_BRIDGE) },
        { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_SC1100_BRIDGE) },
        { 0, }
index 57a45ce..10e7f1e 100644 (file)
@@ -251,15 +251,10 @@ static noinline int i2cdev_ioctl_rdrw(struct i2c_client *client,
        if (rdwr_arg.nmsgs > I2C_RDRW_IOCTL_MAX_MSGS)
                return -EINVAL;
 
-       rdwr_pa = kmalloc(rdwr_arg.nmsgs * sizeof(struct i2c_msg), GFP_KERNEL);
-       if (!rdwr_pa)
-               return -ENOMEM;
-
-       if (copy_from_user(rdwr_pa, rdwr_arg.msgs,
-                          rdwr_arg.nmsgs * sizeof(struct i2c_msg))) {
-               kfree(rdwr_pa);
-               return -EFAULT;
-       }
+       rdwr_pa = memdup_user(rdwr_arg.msgs,
+                             rdwr_arg.nmsgs * sizeof(struct i2c_msg));
+       if (IS_ERR(rdwr_pa))
+               return PTR_ERR(rdwr_pa);
 
        data_ptrs = kmalloc(rdwr_arg.nmsgs * sizeof(u8 __user *), GFP_KERNEL);
        if (data_ptrs == NULL) {
index 7b6ce62..e5fa695 100644 (file)
@@ -165,18 +165,7 @@ static struct platform_driver gpiomux_driver = {
        },
 };
 
-static int __init gpiomux_init(void)
-{
-       return platform_driver_register(&gpiomux_driver);
-}
-
-static void __exit gpiomux_exit(void)
-{
-       platform_driver_unregister(&gpiomux_driver);
-}
-
-module_init(gpiomux_init);
-module_exit(gpiomux_exit);
+module_platform_driver(gpiomux_driver);
 
 MODULE_DESCRIPTION("GPIO-based I2C multiplexer driver");
 MODULE_AUTHOR("Peter Korsgaard <peter.korsgaard@barco.com>");
index 79d9016..350fd0c 100644 (file)
@@ -12,7 +12,7 @@
 #include <linux/platform_device.h>
 #include <linux/input.h>
 #include <linux/interrupt.h>
-#include <linux/mfd/ab8500.h>
+#include <linux/mfd/abx500/ab8500.h>
 #include <linux/slab.h>
 
 /**
index 9c6650e..2302fbe 100644 (file)
@@ -6,7 +6,7 @@ if ISDN_I4L
 
 config ISDN_PPP
        bool "Support synchronous PPP"
-       depends on INET
+       depends on INET && NETDEVICES
        select SLHC
        help
          Over digital connections such as ISDN, there is no need to
index 897a77d..c957c34 100644 (file)
@@ -396,6 +396,13 @@ config LEDS_TCA6507
          LED driver chips accessed via the I2C bus.
          Driver support brightness control and hardware-assisted blinking.
 
+config LEDS_MAX8997
+       tristate "LED support for MAX8997 PMIC"
+       depends on LEDS_CLASS && MFD_MAX8997
+       help
+         This option enables support for on-chip LED drivers on
+         MAXIM MAX8997 PMIC.
+
 config LEDS_TRIGGERS
        bool "LED Trigger support"
        depends on LEDS_CLASS
index 5c9dc4b..b8a9723 100644 (file)
@@ -44,6 +44,7 @@ obj-$(CONFIG_LEDS_NS2)                        += leds-ns2.o
 obj-$(CONFIG_LEDS_NETXBIG)             += leds-netxbig.o
 obj-$(CONFIG_LEDS_ASIC3)               += leds-asic3.o
 obj-$(CONFIG_LEDS_RENESAS_TPU)         += leds-renesas-tpu.o
+obj-$(CONFIG_LEDS_MAX8997)             += leds-max8997.o
 
 # LED SPI Drivers
 obj-$(CONFIG_LEDS_DAC124S085)          += leds-dac124s085.o
diff --git a/drivers/leds/leds-max8997.c b/drivers/leds/leds-max8997.c
new file mode 100644 (file)
index 0000000..f4c0e37
--- /dev/null
@@ -0,0 +1,372 @@
+/*
+ * leds-max8997.c - LED class driver for MAX8997 LEDs.
+ *
+ * Copyright (C) 2011 Samsung Electronics
+ * Donggeun Kim <dg77.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 version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/err.h>
+#include <linux/slab.h>
+#include <linux/workqueue.h>
+#include <linux/leds.h>
+#include <linux/mfd/max8997.h>
+#include <linux/mfd/max8997-private.h>
+#include <linux/platform_device.h>
+
+#define MAX8997_LED_FLASH_SHIFT                        3
+#define MAX8997_LED_FLASH_CUR_MASK             0xf8
+#define MAX8997_LED_MOVIE_SHIFT                        4
+#define MAX8997_LED_MOVIE_CUR_MASK             0xf0
+
+#define MAX8997_LED_FLASH_MAX_BRIGHTNESS       0x1f
+#define MAX8997_LED_MOVIE_MAX_BRIGHTNESS       0xf
+#define MAX8997_LED_NONE_MAX_BRIGHTNESS                0
+
+#define MAX8997_LED0_FLASH_MASK                        0x1
+#define MAX8997_LED0_FLASH_PIN_MASK            0x5
+#define MAX8997_LED0_MOVIE_MASK                        0x8
+#define MAX8997_LED0_MOVIE_PIN_MASK            0x28
+
+#define MAX8997_LED1_FLASH_MASK                        0x2
+#define MAX8997_LED1_FLASH_PIN_MASK            0x6
+#define MAX8997_LED1_MOVIE_MASK                        0x10
+#define MAX8997_LED1_MOVIE_PIN_MASK            0x30
+
+#define MAX8997_LED_BOOST_ENABLE_MASK          (1 << 6)
+
+struct max8997_led {
+       struct max8997_dev *iodev;
+       struct led_classdev cdev;
+       bool enabled;
+       int id;
+       enum max8997_led_mode led_mode;
+       struct mutex mutex;
+};
+
+static void max8997_led_clear_mode(struct max8997_led *led,
+                       enum max8997_led_mode mode)
+{
+       struct i2c_client *client = led->iodev->i2c;
+       u8 val = 0, mask = 0;
+       int ret;
+
+       switch (mode) {
+       case MAX8997_FLASH_MODE:
+               mask = led->id ?
+                     MAX8997_LED1_FLASH_MASK : MAX8997_LED0_FLASH_MASK;
+               break;
+       case MAX8997_MOVIE_MODE:
+               mask = led->id ?
+                     MAX8997_LED1_MOVIE_MASK : MAX8997_LED0_MOVIE_MASK;
+               break;
+       case MAX8997_FLASH_PIN_CONTROL_MODE:
+               mask = led->id ?
+                     MAX8997_LED1_FLASH_PIN_MASK : MAX8997_LED0_FLASH_PIN_MASK;
+               break;
+       case MAX8997_MOVIE_PIN_CONTROL_MODE:
+               mask = led->id ?
+                     MAX8997_LED1_MOVIE_PIN_MASK : MAX8997_LED0_MOVIE_PIN_MASK;
+               break;
+       default:
+               break;
+       }
+
+       if (mask) {
+               ret = max8997_update_reg(client,
+                               MAX8997_REG_LEN_CNTL, val, mask);
+               if (ret)
+                       dev_err(led->iodev->dev,
+                               "failed to update register(%d)\n", ret);
+       }
+}
+
+static void max8997_led_set_mode(struct max8997_led *led,
+                       enum max8997_led_mode mode)
+{
+       int ret;
+       struct i2c_client *client = led->iodev->i2c;
+       u8 mask = 0;
+
+       /* First, clear the previous mode */
+       max8997_led_clear_mode(led, led->led_mode);
+
+       switch (mode) {
+       case MAX8997_FLASH_MODE:
+               mask = led->id ?
+                     MAX8997_LED1_FLASH_MASK : MAX8997_LED0_FLASH_MASK;
+               led->cdev.max_brightness = MAX8997_LED_FLASH_MAX_BRIGHTNESS;
+               break;
+       case MAX8997_MOVIE_MODE:
+               mask = led->id ?
+                     MAX8997_LED1_MOVIE_MASK : MAX8997_LED0_MOVIE_MASK;
+               led->cdev.max_brightness = MAX8997_LED_MOVIE_MAX_BRIGHTNESS;
+               break;
+       case MAX8997_FLASH_PIN_CONTROL_MODE:
+               mask = led->id ?
+                     MAX8997_LED1_FLASH_PIN_MASK : MAX8997_LED0_FLASH_PIN_MASK;
+               led->cdev.max_brightness = MAX8997_LED_FLASH_MAX_BRIGHTNESS;
+               break;
+       case MAX8997_MOVIE_PIN_CONTROL_MODE:
+               mask = led->id ?
+                     MAX8997_LED1_MOVIE_PIN_MASK : MAX8997_LED0_MOVIE_PIN_MASK;
+               led->cdev.max_brightness = MAX8997_LED_MOVIE_MAX_BRIGHTNESS;
+               break;
+       default:
+               led->cdev.max_brightness = MAX8997_LED_NONE_MAX_BRIGHTNESS;
+               break;
+       }
+
+       if (mask) {
+               ret = max8997_update_reg(client,
+                               MAX8997_REG_LEN_CNTL, mask, mask);
+               if (ret)
+                       dev_err(led->iodev->dev,
+                               "failed to update register(%d)\n", ret);
+       }
+
+       led->led_mode = mode;
+}
+
+static void max8997_led_enable(struct max8997_led *led, bool enable)
+{
+       int ret;
+       struct i2c_client *client = led->iodev->i2c;
+       u8 val = 0, mask = MAX8997_LED_BOOST_ENABLE_MASK;
+
+       if (led->enabled == enable)
+               return;
+
+       val = enable ? MAX8997_LED_BOOST_ENABLE_MASK : 0;
+
+       ret = max8997_update_reg(client, MAX8997_REG_BOOST_CNTL, val, mask);
+       if (ret)
+               dev_err(led->iodev->dev,
+                       "failed to update register(%d)\n", ret);
+
+       led->enabled = enable;
+}
+
+static void max8997_led_set_current(struct max8997_led *led,
+                               enum led_brightness value)
+{
+       int ret;
+       struct i2c_client *client = led->iodev->i2c;
+       u8 val = 0, mask = 0, reg = 0;
+
+       switch (led->led_mode) {
+       case MAX8997_FLASH_MODE:
+       case MAX8997_FLASH_PIN_CONTROL_MODE:
+               val = value << MAX8997_LED_FLASH_SHIFT;
+               mask = MAX8997_LED_FLASH_CUR_MASK;
+               reg = led->id ? MAX8997_REG_FLASH2_CUR : MAX8997_REG_FLASH1_CUR;
+               break;
+       case MAX8997_MOVIE_MODE:
+       case MAX8997_MOVIE_PIN_CONTROL_MODE:
+               val = value << MAX8997_LED_MOVIE_SHIFT;
+               mask = MAX8997_LED_MOVIE_CUR_MASK;
+               reg = MAX8997_REG_MOVIE_CUR;
+               break;
+       default:
+               break;
+       }
+
+       if (mask) {
+               ret = max8997_update_reg(client, reg, val, mask);
+               if (ret)
+                       dev_err(led->iodev->dev,
+                               "failed to update register(%d)\n", ret);
+       }
+}
+
+static void max8997_led_brightness_set(struct led_classdev *led_cdev,
+                               enum led_brightness value)
+{
+       struct max8997_led *led =
+                       container_of(led_cdev, struct max8997_led, cdev);
+
+       if (value) {
+               max8997_led_set_current(led, value);
+               max8997_led_enable(led, true);
+       } else {
+               max8997_led_set_current(led, value);
+               max8997_led_enable(led, false);
+       }
+}
+
+static ssize_t max8997_led_show_mode(struct device *dev,
+                               struct device_attribute *attr, char *buf)
+{
+       struct led_classdev *led_cdev = dev_get_drvdata(dev);
+       struct max8997_led *led =
+                       container_of(led_cdev, struct max8997_led, cdev);
+       ssize_t ret = 0;
+
+       mutex_lock(&led->mutex);
+
+       switch (led->led_mode) {
+       case MAX8997_FLASH_MODE:
+               ret += sprintf(buf, "FLASH\n");
+               break;
+       case MAX8997_MOVIE_MODE:
+               ret += sprintf(buf, "MOVIE\n");
+               break;
+       case MAX8997_FLASH_PIN_CONTROL_MODE:
+               ret += sprintf(buf, "FLASH_PIN_CONTROL\n");
+               break;
+       case MAX8997_MOVIE_PIN_CONTROL_MODE:
+               ret += sprintf(buf, "MOVIE_PIN_CONTROL\n");
+               break;
+       default:
+               ret += sprintf(buf, "NONE\n");
+               break;
+       }
+
+       mutex_unlock(&led->mutex);
+
+       return ret;
+}
+
+static ssize_t max8997_led_store_mode(struct device *dev,
+                               struct device_attribute *attr,
+                               const char *buf, size_t size)
+{
+       struct led_classdev *led_cdev = dev_get_drvdata(dev);
+       struct max8997_led *led =
+                       container_of(led_cdev, struct max8997_led, cdev);
+       enum max8997_led_mode mode;
+
+       mutex_lock(&led->mutex);
+
+       if (!strncmp(buf, "FLASH_PIN_CONTROL", 17))
+               mode = MAX8997_FLASH_PIN_CONTROL_MODE;
+       else if (!strncmp(buf, "MOVIE_PIN_CONTROL", 17))
+               mode = MAX8997_MOVIE_PIN_CONTROL_MODE;
+       else if (!strncmp(buf, "FLASH", 5))
+               mode = MAX8997_FLASH_MODE;
+       else if (!strncmp(buf, "MOVIE", 5))
+               mode = MAX8997_MOVIE_MODE;
+       else
+               mode = MAX8997_NONE;
+
+       max8997_led_set_mode(led, mode);
+
+       mutex_unlock(&led->mutex);
+
+       return size;
+}
+
+static DEVICE_ATTR(mode, 0644, max8997_led_show_mode, max8997_led_store_mode);
+
+static int __devinit max8997_led_probe(struct platform_device *pdev)
+{
+       struct max8997_dev *iodev = dev_get_drvdata(pdev->dev.parent);
+       struct max8997_platform_data *pdata = dev_get_platdata(iodev->dev);
+       struct max8997_led *led;
+       char name[20];
+       int ret = 0;
+
+       if (pdata == NULL) {
+               dev_err(&pdev->dev, "no platform data\n");
+               return -ENODEV;
+       }
+
+       led = kzalloc(sizeof(*led), GFP_KERNEL);
+       if (led == NULL) {
+               ret = -ENOMEM;
+               goto err_mem;
+       }
+
+       led->id = pdev->id;
+       snprintf(name, sizeof(name), "max8997-led%d", pdev->id);
+
+       led->cdev.name = name;
+       led->cdev.brightness_set = max8997_led_brightness_set;
+       led->cdev.flags |= LED_CORE_SUSPENDRESUME;
+       led->cdev.brightness = 0;
+       led->iodev = iodev;
+
+       /* initialize mode and brightness according to platform_data */
+       if (pdata->led_pdata) {
+               u8 mode = 0, brightness = 0;
+
+               mode = pdata->led_pdata->mode[led->id];
+               brightness = pdata->led_pdata->brightness[led->id];
+
+               max8997_led_set_mode(led, pdata->led_pdata->mode[led->id]);
+
+               if (brightness > led->cdev.max_brightness)
+                       brightness = led->cdev.max_brightness;
+               max8997_led_set_current(led, brightness);
+               led->cdev.brightness = brightness;
+       } else {
+               max8997_led_set_mode(led, MAX8997_NONE);
+               max8997_led_set_current(led, 0);
+       }
+
+       mutex_init(&led->mutex);
+
+       platform_set_drvdata(pdev, led);
+
+       ret = led_classdev_register(&pdev->dev, &led->cdev);
+       if (ret < 0)
+               goto err_led;
+
+       ret = device_create_file(led->cdev.dev, &dev_attr_mode);
+       if (ret != 0) {
+               dev_err(&pdev->dev,
+                       "failed to create file: %d\n", ret);
+               goto err_file;
+       }
+
+       return 0;
+
+err_file:
+       led_classdev_unregister(&led->cdev);
+err_led:
+       kfree(led);
+err_mem:
+       return ret;
+}
+
+static int __devexit max8997_led_remove(struct platform_device *pdev)
+{
+       struct max8997_led *led = platform_get_drvdata(pdev);
+
+       device_remove_file(led->cdev.dev, &dev_attr_mode);
+       led_classdev_unregister(&led->cdev);
+       kfree(led);
+
+       return 0;
+}
+
+static struct platform_driver max8997_led_driver = {
+       .driver = {
+               .name  = "max8997-led",
+               .owner = THIS_MODULE,
+       },
+       .probe  = max8997_led_probe,
+       .remove = __devexit_p(max8997_led_remove),
+};
+
+static int __init max8997_led_init(void)
+{
+       return platform_driver_register(&max8997_led_driver);
+}
+module_init(max8997_led_init);
+
+static void __exit max8997_led_exit(void)
+{
+       platform_driver_unregister(&max8997_led_driver);
+}
+module_exit(max8997_led_exit);
+
+MODULE_AUTHOR("Donggeun Kim <dg77.kim@samsung.com>");
+MODULE_DESCRIPTION("MAX8997 LED driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:max8997-led");
index e017dc8..f93dd95 100644 (file)
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/i2c.h>
+#include <linux/err.h>
+#include <linux/regmap.h>
 #include <linux/mfd/88pm860x.h>
 #include <linux/slab.h>
 
-static inline int pm860x_read_device(struct i2c_client *i2c,
-                                    int reg, int bytes, void *dest)
-{
-       unsigned char data;
-       int ret;
-
-       data = (unsigned char)reg;
-       ret = i2c_master_send(i2c, &data, 1);
-       if (ret < 0)
-               return ret;
-
-       ret = i2c_master_recv(i2c, dest, bytes);
-       if (ret < 0)
-               return ret;
-       return 0;
-}
-
-static inline int pm860x_write_device(struct i2c_client *i2c,
-                                     int reg, int bytes, void *src)
-{
-       unsigned char buf[bytes + 1];
-       int ret;
-
-       buf[0] = (unsigned char)reg;
-       memcpy(&buf[1], src, bytes);
-
-       ret = i2c_master_send(i2c, buf, bytes + 1);
-       if (ret < 0)
-               return ret;
-       return 0;
-}
-
 int pm860x_reg_read(struct i2c_client *i2c, int reg)
 {
        struct pm860x_chip *chip = i2c_get_clientdata(i2c);
-       unsigned char data;
+       struct regmap *map = (i2c == chip->client) ? chip->regmap
+                               : chip->regmap_companion;
+       unsigned int data;
        int ret;
 
-       mutex_lock(&chip->io_lock);
-       ret = pm860x_read_device(i2c, reg, 1, &data);
-       mutex_unlock(&chip->io_lock);
-
+       ret = regmap_read(map, reg, &data);
        if (ret < 0)
                return ret;
        else
@@ -68,12 +37,11 @@ int pm860x_reg_write(struct i2c_client *i2c, int reg,
                     unsigned char data)
 {
        struct pm860x_chip *chip = i2c_get_clientdata(i2c);
+       struct regmap *map = (i2c == chip->client) ? chip->regmap
+                               : chip->regmap_companion;
        int ret;
 
-       mutex_lock(&chip->io_lock);
-       ret = pm860x_write_device(i2c, reg, 1, &data);
-       mutex_unlock(&chip->io_lock);
-
+       ret = regmap_write(map, reg, data);
        return ret;
 }
 EXPORT_SYMBOL(pm860x_reg_write);
@@ -82,12 +50,11 @@ int pm860x_bulk_read(struct i2c_client *i2c, int reg,
                     int count, unsigned char *buf)
 {
        struct pm860x_chip *chip = i2c_get_clientdata(i2c);
+       struct regmap *map = (i2c == chip->client) ? chip->regmap
+                               : chip->regmap_companion;
        int ret;
 
-       mutex_lock(&chip->io_lock);
-       ret = pm860x_read_device(i2c, reg, count, buf);
-       mutex_unlock(&chip->io_lock);
-
+       ret = regmap_raw_read(map, reg, buf, count);
        return ret;
 }
 EXPORT_SYMBOL(pm860x_bulk_read);
@@ -96,12 +63,11 @@ int pm860x_bulk_write(struct i2c_client *i2c, int reg,
                      int count, unsigned char *buf)
 {
        struct pm860x_chip *chip = i2c_get_clientdata(i2c);
+       struct regmap *map = (i2c == chip->client) ? chip->regmap
+                               : chip->regmap_companion;
        int ret;
 
-       mutex_lock(&chip->io_lock);
-       ret = pm860x_write_device(i2c, reg, count, buf);
-       mutex_unlock(&chip->io_lock);
-
+       ret = regmap_raw_write(map, reg, buf, count);
        return ret;
 }
 EXPORT_SYMBOL(pm860x_bulk_write);
@@ -110,39 +76,78 @@ int pm860x_set_bits(struct i2c_client *i2c, int reg,
                    unsigned char mask, unsigned char data)
 {
        struct pm860x_chip *chip = i2c_get_clientdata(i2c);
-       unsigned char value;
+       struct regmap *map = (i2c == chip->client) ? chip->regmap
+                               : chip->regmap_companion;
        int ret;
 
-       mutex_lock(&chip->io_lock);
-       ret = pm860x_read_device(i2c, reg, 1, &value);
-       if (ret < 0)
-               goto out;
-       value &= ~mask;
-       value |= data;
-       ret = pm860x_write_device(i2c, reg, 1, &value);
-out:
-       mutex_unlock(&chip->io_lock);
+       ret = regmap_update_bits(map, reg, mask, data);
        return ret;
 }
 EXPORT_SYMBOL(pm860x_set_bits);
 
+static int read_device(struct i2c_client *i2c, int reg,
+                      int bytes, void *dest)
+{
+       unsigned char msgbuf0[I2C_SMBUS_BLOCK_MAX + 3];
+       unsigned char msgbuf1[I2C_SMBUS_BLOCK_MAX + 2];
+       struct i2c_adapter *adap = i2c->adapter;
+       struct i2c_msg msg[2] = {{i2c->addr, 0, 1, msgbuf0},
+                                {i2c->addr, I2C_M_RD, 0, msgbuf1},
+                               };
+       int num = 1, ret = 0;
+
+       if (dest == NULL)
+               return -EINVAL;
+       msgbuf0[0] = (unsigned char)reg;        /* command */
+       msg[1].len = bytes;
+
+       /* if data needs to read back, num should be 2 */
+       if (bytes > 0)
+               num = 2;
+       ret = adap->algo->master_xfer(adap, msg, num);
+       memcpy(dest, msgbuf1, bytes);
+       if (ret < 0)
+               return ret;
+       return 0;
+}
+
+static int write_device(struct i2c_client *i2c, int reg,
+                       int bytes, void *src)
+{
+       unsigned char buf[bytes + 1];
+       struct i2c_adapter *adap = i2c->adapter;
+       struct i2c_msg msg;
+       int ret;
+
+       buf[0] = (unsigned char)reg;
+       memcpy(&buf[1], src, bytes);
+       msg.addr = i2c->addr;
+       msg.flags = 0;
+       msg.len = bytes + 1;
+       msg.buf = buf;
+
+       ret = adap->algo->master_xfer(adap, &msg, 1);
+       if (ret < 0)
+               return ret;
+       return 0;
+}
+
 int pm860x_page_reg_read(struct i2c_client *i2c, int reg)
 {
-       struct pm860x_chip *chip = i2c_get_clientdata(i2c);
        unsigned char zero = 0;
        unsigned char data;
        int ret;
 
-       mutex_lock(&chip->io_lock);
-       pm860x_write_device(i2c, 0xFA, 0, &zero);
-       pm860x_write_device(i2c, 0xFB, 0, &zero);
-       pm860x_write_device(i2c, 0xFF, 0, &zero);
-       ret = pm860x_read_device(i2c, reg, 1, &data);
+       i2c_lock_adapter(i2c->adapter);
+       read_device(i2c, 0xFA, 0, &zero);
+       read_device(i2c, 0xFB, 0, &zero);
+       read_device(i2c, 0xFF, 0, &zero);
+       ret = read_device(i2c, reg, 1, &data);
        if (ret >= 0)
                ret = (int)data;
-       pm860x_write_device(i2c, 0xFE, 0, &zero);
-       pm860x_write_device(i2c, 0xFC, 0, &zero);
-       mutex_unlock(&chip->io_lock);
+       read_device(i2c, 0xFE, 0, &zero);
+       read_device(i2c, 0xFC, 0, &zero);
+       i2c_unlock_adapter(i2c->adapter);
        return ret;
 }
 EXPORT_SYMBOL(pm860x_page_reg_read);
@@ -150,18 +155,17 @@ EXPORT_SYMBOL(pm860x_page_reg_read);
 int pm860x_page_reg_write(struct i2c_client *i2c, int reg,
                          unsigned char data)
 {
-       struct pm860x_chip *chip = i2c_get_clientdata(i2c);
        unsigned char zero;
        int ret;
 
-       mutex_lock(&chip->io_lock);
-       pm860x_write_device(i2c, 0xFA, 0, &zero);
-       pm860x_write_device(i2c, 0xFB, 0, &zero);
-       pm860x_write_device(i2c, 0xFF, 0, &zero);
-       ret = pm860x_write_device(i2c, reg, 1, &data);
-       pm860x_write_device(i2c, 0xFE, 0, &zero);
-       pm860x_write_device(i2c, 0xFC, 0, &zero);
-       mutex_unlock(&chip->io_lock);
+       i2c_lock_adapter(i2c->adapter);
+       read_device(i2c, 0xFA, 0, &zero);
+       read_device(i2c, 0xFB, 0, &zero);
+       read_device(i2c, 0xFF, 0, &zero);
+       ret = write_device(i2c, reg, 1, &data);
+       read_device(i2c, 0xFE, 0, &zero);
+       read_device(i2c, 0xFC, 0, &zero);
+       i2c_unlock_adapter(i2c->adapter);
        return ret;
 }
 EXPORT_SYMBOL(pm860x_page_reg_write);
@@ -169,18 +173,17 @@ EXPORT_SYMBOL(pm860x_page_reg_write);
 int pm860x_page_bulk_read(struct i2c_client *i2c, int reg,
                          int count, unsigned char *buf)
 {
-       struct pm860x_chip *chip = i2c_get_clientdata(i2c);
        unsigned char zero = 0;
        int ret;
 
-       mutex_lock(&chip->io_lock);
-       pm860x_write_device(i2c, 0xFA, 0, &zero);
-       pm860x_write_device(i2c, 0xFB, 0, &zero);
-       pm860x_write_device(i2c, 0xFF, 0, &zero);
-       ret = pm860x_read_device(i2c, reg, count, buf);
-       pm860x_write_device(i2c, 0xFE, 0, &zero);
-       pm860x_write_device(i2c, 0xFC, 0, &zero);
-       mutex_unlock(&chip->io_lock);
+       i2c_lock_adapter(i2c->adapter);
+       read_device(i2c, 0xfa, 0, &zero);
+       read_device(i2c, 0xfb, 0, &zero);
+       read_device(i2c, 0xff, 0, &zero);
+       ret = read_device(i2c, reg, count, buf);
+       read_device(i2c, 0xFE, 0, &zero);
+       read_device(i2c, 0xFC, 0, &zero);
+       i2c_unlock_adapter(i2c->adapter);
        return ret;
 }
 EXPORT_SYMBOL(pm860x_page_bulk_read);
@@ -188,18 +191,18 @@ EXPORT_SYMBOL(pm860x_page_bulk_read);
 int pm860x_page_bulk_write(struct i2c_client *i2c, int reg,
                           int count, unsigned char *buf)
 {
-       struct pm860x_chip *chip = i2c_get_clientdata(i2c);
        unsigned char zero = 0;
        int ret;
 
-       mutex_lock(&chip->io_lock);
-       pm860x_write_device(i2c, 0xFA, 0, &zero);
-       pm860x_write_device(i2c, 0xFB, 0, &zero);
-       pm860x_write_device(i2c, 0xFF, 0, &zero);
-       ret = pm860x_write_device(i2c, reg, count, buf);
-       pm860x_write_device(i2c, 0xFE, 0, &zero);
-       pm860x_write_device(i2c, 0xFC, 0, &zero);
-       mutex_unlock(&chip->io_lock);
+       i2c_lock_adapter(i2c->adapter);
+       read_device(i2c, 0xFA, 0, &zero);
+       read_device(i2c, 0xFB, 0, &zero);
+       read_device(i2c, 0xFF, 0, &zero);
+       ret = write_device(i2c, reg, count, buf);
+       read_device(i2c, 0xFE, 0, &zero);
+       read_device(i2c, 0xFC, 0, &zero);
+       i2c_unlock_adapter(i2c->adapter);
+       i2c_unlock_adapter(i2c->adapter);
        return ret;
 }
 EXPORT_SYMBOL(pm860x_page_bulk_write);
@@ -207,25 +210,24 @@ EXPORT_SYMBOL(pm860x_page_bulk_write);
 int pm860x_page_set_bits(struct i2c_client *i2c, int reg,
                         unsigned char mask, unsigned char data)
 {
-       struct pm860x_chip *chip = i2c_get_clientdata(i2c);
        unsigned char zero;
        unsigned char value;
        int ret;
 
-       mutex_lock(&chip->io_lock);
-       pm860x_write_device(i2c, 0xFA, 0, &zero);
-       pm860x_write_device(i2c, 0xFB, 0, &zero);
-       pm860x_write_device(i2c, 0xFF, 0, &zero);
-       ret = pm860x_read_device(i2c, reg, 1, &value);
+       i2c_lock_adapter(i2c->adapter);
+       read_device(i2c, 0xFA, 0, &zero);
+       read_device(i2c, 0xFB, 0, &zero);
+       read_device(i2c, 0xFF, 0, &zero);
+       ret = read_device(i2c, reg, 1, &value);
        if (ret < 0)
                goto out;
        value &= ~mask;
        value |= data;
-       ret = pm860x_write_device(i2c, reg, 1, &value);
+       ret = write_device(i2c, reg, 1, &value);
 out:
-       pm860x_write_device(i2c, 0xFE, 0, &zero);
-       pm860x_write_device(i2c, 0xFC, 0, &zero);
-       mutex_unlock(&chip->io_lock);
+       read_device(i2c, 0xFE, 0, &zero);
+       read_device(i2c, 0xFC, 0, &zero);
+       i2c_unlock_adapter(i2c->adapter);
        return ret;
 }
 EXPORT_SYMBOL(pm860x_page_set_bits);
@@ -257,11 +259,17 @@ static int verify_addr(struct i2c_client *i2c)
        return 0;
 }
 
+static struct regmap_config pm860x_regmap_config = {
+       .reg_bits = 8,
+       .val_bits = 8,
+};
+
 static int __devinit pm860x_probe(struct i2c_client *client,
                                  const struct i2c_device_id *id)
 {
        struct pm860x_platform_data *pdata = client->dev.platform_data;
        struct pm860x_chip *chip;
+       int ret;
 
        if (!pdata) {
                pr_info("No platform data in %s!\n", __func__);
@@ -273,10 +281,17 @@ static int __devinit pm860x_probe(struct i2c_client *client,
                return -ENOMEM;
 
        chip->id = verify_addr(client);
+       chip->regmap = regmap_init_i2c(client, &pm860x_regmap_config);
+       if (IS_ERR(chip->regmap)) {
+               ret = PTR_ERR(chip->regmap);
+               dev_err(&client->dev, "Failed to allocate register map: %d\n",
+                               ret);
+               kfree(chip);
+               return ret;
+       }
        chip->client = client;
        i2c_set_clientdata(client, chip);
        chip->dev = &client->dev;
-       mutex_init(&chip->io_lock);
        dev_set_drvdata(chip->dev, chip);
 
        /*
@@ -290,6 +305,14 @@ static int __devinit pm860x_probe(struct i2c_client *client,
                chip->companion_addr = pdata->companion_addr;
                chip->companion = i2c_new_dummy(chip->client->adapter,
                                                chip->companion_addr);
+               chip->regmap_companion = regmap_init_i2c(chip->companion,
+                                                       &pm860x_regmap_config);
+               if (IS_ERR(chip->regmap_companion)) {
+                       ret = PTR_ERR(chip->regmap_companion);
+                       dev_err(&chip->companion->dev,
+                               "Failed to allocate register map: %d\n", ret);
+                       return ret;
+               }
                i2c_set_clientdata(chip->companion, chip);
        }
 
@@ -302,7 +325,11 @@ static int __devexit pm860x_remove(struct i2c_client *client)
        struct pm860x_chip *chip = i2c_get_clientdata(client);
 
        pm860x_device_exit(chip);
-       i2c_unregister_device(chip->companion);
+       if (chip->companion) {
+               regmap_exit(chip->regmap_companion);
+               i2c_unregister_device(chip->companion);
+       }
+       regmap_exit(chip->regmap);
        kfree(chip);
        return 0;
 }
index 053208d..cd13e9f 100644 (file)
@@ -12,6 +12,7 @@ config MFD_CORE
 config MFD_88PM860X
        bool "Support Marvell 88PM8606/88PM8607"
        depends on I2C=y && GENERIC_HARDIRQS
+       select REGMAP_I2C
        select MFD_CORE
        help
          This supports for Marvell 88PM8606/88PM8607 Power Management IC.
@@ -199,7 +200,7 @@ config MENELAUS
 
 config TWL4030_CORE
        bool "Texas Instruments TWL4030/TWL5030/TWL6030/TPS659x0 Support"
-       depends on I2C=y && GENERIC_HARDIRQS
+       depends on I2C=y && GENERIC_HARDIRQS && IRQ_DOMAIN
        help
          Say yes here if you have TWL4030 / TWL6030 family chip on your board.
          This core driver provides register access and IRQ handling
@@ -257,7 +258,7 @@ config TWL6040_CORE
 
 config MFD_STMPE
        bool "Support STMicroelectronics STMPE"
-       depends on I2C=y && GENERIC_HARDIRQS
+       depends on (I2C=y || SPI_MASTER=y) && GENERIC_HARDIRQS
        select MFD_CORE
        help
          Support for the STMPE family of I/O Expanders from
@@ -278,6 +279,23 @@ config MFD_STMPE
                Keypad: stmpe-keypad
                Touchscreen: stmpe-ts
 
+menu "STMPE Interface Drivers"
+depends on MFD_STMPE
+
+config STMPE_I2C
+       bool "STMPE I2C Inteface"
+       depends on I2C=y
+       default y
+       help
+         This is used to enable I2C interface of STMPE
+
+config STMPE_SPI
+       bool "STMPE SPI Inteface"
+       depends on SPI_MASTER
+       help
+         This is used to enable SPI interface of STMPE
+endmenu
+
 config MFD_TC3589X
        bool "Support Toshiba TC35892 and variants"
        depends on I2C=y && GENERIC_HARDIRQS
@@ -311,7 +329,7 @@ config MFD_TC6387XB
 
 config MFD_TC6393XB
        bool "Support Toshiba TC6393XB"
-       depends on GPIOLIB && ARM
+       depends on GPIOLIB && ARM && HAVE_CLK
        select MFD_CORE
        select MFD_TMIO
        help
@@ -399,6 +417,17 @@ config MFD_MAX8998
          additional drivers must be enabled in order to use the functionality
          of the device.
 
+config MFD_S5M_CORE
+       bool "SAMSUNG S5M Series Support"
+       depends on I2C=y && GENERIC_HARDIRQS
+       select MFD_CORE
+       select REGMAP_I2C
+       help
+        Support for the Samsung Electronics S5M MFD series.
+        This driver provies common support for accessing the device,
+        additional drivers must be enabled in order to use the functionality
+        of the device
+
 config MFD_WM8400
        tristate "Support Wolfson Microelectronics WM8400"
        select MFD_CORE
index 47591fc..b953bab 100644 (file)
@@ -16,6 +16,8 @@ obj-$(CONFIG_MFD_DM355EVM_MSP)        += dm355evm_msp.o
 obj-$(CONFIG_MFD_TI_SSP)       += ti-ssp.o
 
 obj-$(CONFIG_MFD_STMPE)                += stmpe.o
+obj-$(CONFIG_STMPE_I2C)                += stmpe-i2c.o
+obj-$(CONFIG_STMPE_SPI)                += stmpe-spi.o
 obj-$(CONFIG_MFD_TC3589X)      += tc3589x.o
 obj-$(CONFIG_MFD_T7L66XB)      += t7l66xb.o tmio_core.o
 obj-$(CONFIG_MFD_TC6387XB)     += tc6387xb.o tmio_core.o
@@ -109,3 +111,4 @@ obj-$(CONFIG_MFD_PM8XXX_IRQ)        += pm8xxx-irq.o
 obj-$(CONFIG_TPS65911_COMPARATOR)      += tps65911-comparator.o
 obj-$(CONFIG_MFD_AAT2870_CORE) += aat2870-core.o
 obj-$(CONFIG_MFD_INTEL_MSIC)   += intel_msic.o
+obj-$(CONFIG_MFD_S5M_CORE)     += s5m-core.o s5m-irq.o
index 02c4201..3aa36eb 100644 (file)
@@ -407,13 +407,13 @@ static int aat2870_i2c_probe(struct i2c_client *client,
                aat2870->init(aat2870);
 
        if (aat2870->en_pin >= 0) {
-               ret = gpio_request(aat2870->en_pin, "aat2870-en");
+               ret = gpio_request_one(aat2870->en_pin, GPIOF_OUT_INIT_HIGH,
+                                      "aat2870-en");
                if (ret < 0) {
                        dev_err(&client->dev,
                                "Failed to request GPIO %d\n", aat2870->en_pin);
                        goto out_kfree;
                }
-               gpio_direction_output(aat2870->en_pin, 1);
        }
 
        aat2870_enable(aat2870);
@@ -468,9 +468,10 @@ static int aat2870_i2c_remove(struct i2c_client *client)
        return 0;
 }
 
-#ifdef CONFIG_PM
-static int aat2870_i2c_suspend(struct i2c_client *client, pm_message_t state)
+#ifdef CONFIG_PM_SLEEP
+static int aat2870_i2c_suspend(struct device *dev)
 {
+       struct i2c_client *client = to_i2c_client(dev);
        struct aat2870_data *aat2870 = i2c_get_clientdata(client);
 
        aat2870_disable(aat2870);
@@ -478,8 +479,9 @@ static int aat2870_i2c_suspend(struct i2c_client *client, pm_message_t state)
        return 0;
 }
 
-static int aat2870_i2c_resume(struct i2c_client *client)
+static int aat2870_i2c_resume(struct device *dev)
 {
+       struct i2c_client *client = to_i2c_client(dev);
        struct aat2870_data *aat2870 = i2c_get_clientdata(client);
        struct aat2870_register *reg = NULL;
        int i;
@@ -495,12 +497,12 @@ static int aat2870_i2c_resume(struct i2c_client *client)
 
        return 0;
 }
-#else
-#define aat2870_i2c_suspend    NULL
-#define aat2870_i2c_resume     NULL
-#endif /* CONFIG_PM */
+#endif /* CONFIG_PM_SLEEP */
+
+static SIMPLE_DEV_PM_OPS(aat2870_pm_ops, aat2870_i2c_suspend,
+                        aat2870_i2c_resume);
 
-static struct i2c_device_id aat2870_i2c_id_table[] = {
+static const struct i2c_device_id aat2870_i2c_id_table[] = {
        { "aat2870", 0 },
        { }
 };
@@ -510,11 +512,10 @@ static struct i2c_driver aat2870_i2c_driver = {
        .driver = {
                .name   = "aat2870",
                .owner  = THIS_MODULE,
+               .pm     = &aat2870_pm_ops,
        },
        .probe          = aat2870_i2c_probe,
        .remove         = aat2870_i2c_remove,
-       .suspend        = aat2870_i2c_suspend,
-       .resume         = aat2870_i2c_resume,
        .id_table       = aat2870_i2c_id_table,
 };
 
index ec10629..bd56a76 100644 (file)
@@ -22,8 +22,8 @@
 #include <linux/irq.h>
 #include <linux/interrupt.h>
 #include <linux/random.h>
-#include <linux/mfd/ab5500/ab5500.h>
 #include <linux/mfd/abx500.h>
+#include <linux/mfd/abx500/ab5500.h>
 #include <linux/list.h>
 #include <linux/bitops.h>
 #include <linux/spinlock.h>
index b7b2d34..7200694 100644 (file)
@@ -7,8 +7,8 @@
 #include <linux/module.h>
 #include <linux/debugfs.h>
 #include <linux/seq_file.h>
-#include <linux/mfd/ab5500/ab5500.h>
 #include <linux/mfd/abx500.h>
+#include <linux/mfd/abx500/ab5500.h>
 #include <linux/uaccess.h>
 
 #include "ab5500-core.h"
index d3d572b..53e2a80 100644 (file)
@@ -17,7 +17,7 @@
 #include <linux/platform_device.h>
 #include <linux/mfd/core.h>
 #include <linux/mfd/abx500.h>
-#include <linux/mfd/ab8500.h>
+#include <linux/mfd/abx500/ab8500.h>
 #include <linux/regulator/ab8500.h>
 
 /*
index dedb7f6..9a0211a 100644 (file)
@@ -13,7 +13,7 @@
 #include <linux/platform_device.h>
 
 #include <linux/mfd/abx500.h>
-#include <linux/mfd/ab8500.h>
+#include <linux/mfd/abx500/ab8500.h>
 
 static u32 debug_bank;
 static u32 debug_address;
index e985d17..c39fc71 100644 (file)
@@ -18,9 +18,9 @@
 #include <linux/err.h>
 #include <linux/slab.h>
 #include <linux/list.h>
-#include <linux/mfd/ab8500.h>
 #include <linux/mfd/abx500.h>
-#include <linux/mfd/ab8500/gpadc.h>
+#include <linux/mfd/abx500/ab8500.h>
+#include <linux/mfd/abx500/ab8500-gpadc.h>
 
 /*
  * GPADC register offsets
index 9be541c..087fecd 100644 (file)
@@ -10,7 +10,7 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
-#include <linux/mfd/ab8500.h>
+#include <linux/mfd/abx500/ab8500.h>
 #include <linux/mfd/db8500-prcmu.h>
 
 static int ab8500_i2c_write(struct ab8500 *ab8500, u16 addr, u8 data)
index f20feef..c28d4eb 100644 (file)
@@ -7,9 +7,9 @@
 #include <linux/err.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
-#include <linux/mfd/ab8500.h>
 #include <linux/mfd/abx500.h>
-#include <linux/mfd/ab8500/sysctrl.h>
+#include <linux/mfd/abx500/ab8500.h>
+#include <linux/mfd/abx500/ab8500-sysctrl.h>
 
 static struct device *sysctrl_dev;
 
index 155fa04..315fef5 100644 (file)
@@ -172,14 +172,14 @@ static void __devexit cs5535_mfd_remove(struct pci_dev *pdev)
        pci_disable_device(pdev);
 }
 
-static struct pci_device_id cs5535_mfd_pci_tbl[] = {
+static DEFINE_PCI_DEVICE_TABLE(cs5535_mfd_pci_tbl) = {
        { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_CS5535_ISA) },
        { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_ISA) },
        { 0, }
 };
 MODULE_DEVICE_TABLE(pci, cs5535_mfd_pci_tbl);
 
-static struct pci_driver cs5535_mfd_drv = {
+static struct pci_driver cs5535_mfd_driver = {
        .name = DRV_NAME,
        .id_table = cs5535_mfd_pci_tbl,
        .probe = cs5535_mfd_probe,
@@ -188,12 +188,12 @@ static struct pci_driver cs5535_mfd_drv = {
 
 static int __init cs5535_mfd_init(void)
 {
-       return pci_register_driver(&cs5535_mfd_drv);
+       return pci_register_driver(&cs5535_mfd_driver);
 }
 
 static void __exit cs5535_mfd_exit(void)
 {
-       pci_unregister_driver(&cs5535_mfd_drv);
+       pci_unregister_driver(&cs5535_mfd_driver);
 }
 
 module_init(cs5535_mfd_init);
index 8ad88da..7710227 100644 (file)
@@ -308,8 +308,7 @@ static int add_children(struct i2c_client *client)
        for (i = 0; i < ARRAY_SIZE(config_inputs); i++) {
                int gpio = dm355evm_msp_gpio.base + config_inputs[i].offset;
 
-               gpio_request(gpio, config_inputs[i].label);
-               gpio_direction_input(gpio);
+               gpio_request_one(gpio, GPIOF_IN, config_inputs[i].label);
 
                /* make it easy for userspace to see these */
                gpio_export(gpio, false);
index 97c2776..b76657e 100644 (file)
@@ -485,17 +485,7 @@ static struct platform_driver intel_msic_driver = {
        },
 };
 
-static int __init intel_msic_init(void)
-{
-       return platform_driver_register(&intel_msic_driver);
-}
-module_init(intel_msic_init);
-
-static void __exit intel_msic_exit(void)
-{
-       platform_driver_unregister(&intel_msic_driver);
-}
-module_exit(intel_msic_exit);
+module_platform_driver(intel_msic_driver);
 
 MODULE_DESCRIPTION("Driver for Intel MSIC");
 MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>");
index ef39528..87662a1 100644 (file)
@@ -181,7 +181,7 @@ static struct resource jz4740_battery_resources[] = {
        },
 };
 
-const struct mfd_cell jz4740_adc_cells[] = {
+static struct mfd_cell jz4740_adc_cells[] = {
        {
                .id = 0,
                .name = "jz4740-hwmon",
@@ -338,17 +338,7 @@ static struct platform_driver jz4740_adc_driver = {
        },
 };
 
-static int __init jz4740_adc_init(void)
-{
-       return platform_driver_register(&jz4740_adc_driver);
-}
-module_init(jz4740_adc_init);
-
-static void __exit jz4740_adc_exit(void)
-{
-       platform_driver_unregister(&jz4740_adc_driver);
-}
-module_exit(jz4740_adc_exit);
+module_platform_driver(jz4740_adc_driver);
 
 MODULE_DESCRIPTION("JZ4740 SoC ADC driver");
 MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
index ea1169b..abc4213 100644 (file)
@@ -74,7 +74,7 @@ static struct mfd_cell tunnelcreek_cells[] = {
        },
 };
 
-static struct pci_device_id lpc_sch_ids[] = {
+static DEFINE_PCI_DEVICE_TABLE(lpc_sch_ids) = {
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SCH_LPC) },
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ITC_LPC) },
        { 0, }
index 0219115..d9e4b36 100644 (file)
@@ -161,6 +161,8 @@ static int __devinit max8925_probe(struct i2c_client *client,
        chip->adc = i2c_new_dummy(chip->i2c->adapter, ADC_I2C_ADDR);
        i2c_set_clientdata(chip->adc, chip);
 
+       device_init_wakeup(&client->dev, 1);
+
        max8925_device_init(chip, pdata);
 
        return 0;
@@ -177,10 +179,35 @@ static int __devexit max8925_remove(struct i2c_client *client)
        return 0;
 }
 
+#ifdef CONFIG_PM_SLEEP
+static int max8925_suspend(struct device *dev)
+{
+       struct i2c_client *client = container_of(dev, struct i2c_client, dev);
+       struct max8925_chip *chip = i2c_get_clientdata(client);
+
+       if (device_may_wakeup(dev) && chip->wakeup_flag)
+               enable_irq_wake(chip->core_irq);
+       return 0;
+}
+
+static int max8925_resume(struct device *dev)
+{
+       struct i2c_client *client = container_of(dev, struct i2c_client, dev);
+       struct max8925_chip *chip = i2c_get_clientdata(client);
+
+       if (device_may_wakeup(dev) && chip->wakeup_flag)
+               disable_irq_wake(chip->core_irq);
+       return 0;
+}
+#endif
+
+static SIMPLE_DEV_PM_OPS(max8925_pm_ops, max8925_suspend, max8925_resume);
+
 static struct i2c_driver max8925_driver = {
        .driver = {
                .name   = "max8925",
                .owner  = THIS_MODULE,
+               .pm     = &max8925_pm_ops,
        },
        .probe          = max8925_probe,
        .remove         = __devexit_p(max8925_remove),
index 5be53ae..cb83a7a 100644 (file)
@@ -43,7 +43,8 @@ static struct mfd_cell max8997_devs[] = {
        { .name = "max8997-battery", },
        { .name = "max8997-haptic", },
        { .name = "max8997-muic", },
-       { .name = "max8997-flash", },
+       { .name = "max8997-led", .id = 1 },
+       { .name = "max8997-led", .id = 2 },
 };
 
 int max8997_read_reg(struct i2c_client *i2c, u8 reg, u8 *dest)
index de4096a..6ef56d2 100644 (file)
@@ -176,6 +176,8 @@ static int max8998_i2c_probe(struct i2c_client *i2c,
        if (ret < 0)
                goto err;
 
+       device_init_wakeup(max8998->dev, max8998->wakeup);
+
        return ret;
 
 err:
@@ -210,7 +212,7 @@ static int max8998_suspend(struct device *dev)
        struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
        struct max8998_dev *max8998 = i2c_get_clientdata(i2c);
 
-       if (max8998->wakeup)
+       if (device_may_wakeup(dev))
                irq_set_irq_wake(max8998->irq, 1);
        return 0;
 }
@@ -220,7 +222,7 @@ static int max8998_resume(struct device *dev)
        struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
        struct max8998_dev *max8998 = i2c_get_clientdata(i2c);
 
-       if (max8998->wakeup)
+       if (device_may_wakeup(dev))
                irq_set_irq_wake(max8998->irq, 0);
        /*
         * In LP3974, if IRQ registers are not "read & clear"
index e9619ac..7122386 100644 (file)
 #include <linux/spi/spi.h>
 #include <linux/mfd/core.h>
 #include <linux/mfd/mc13xxx.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
+#include <linux/of_gpio.h>
 
 struct mc13xxx {
        struct spi_device *spidev;
        struct mutex lock;
        int irq;
+       int flags;
 
        irq_handler_t irqhandler[MC13XXX_NUM_IRQ];
        void *irqdata[MC13XXX_NUM_IRQ];
@@ -550,10 +554,7 @@ static const char *mc13xxx_get_chipname(struct mc13xxx *mc13xxx)
 
 int mc13xxx_get_flags(struct mc13xxx *mc13xxx)
 {
-       struct mc13xxx_platform_data *pdata =
-               dev_get_platdata(&mc13xxx->spidev->dev);
-
-       return pdata->flags;
+       return mc13xxx->flags;
 }
 EXPORT_SYMBOL(mc13xxx_get_flags);
 
@@ -615,13 +616,13 @@ int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx, unsigned int mode,
                break;
 
        case MC13XXX_ADC_MODE_SINGLE_CHAN:
-               adc0 |= old_adc0 & MC13XXX_ADC0_TSMOD_MASK;
+               adc0 |= old_adc0 & MC13XXX_ADC0_CONFIG_MASK;
                adc1 |= (channel & 0x7) << MC13XXX_ADC1_CHAN0_SHIFT;
                adc1 |= MC13XXX_ADC1_RAND;
                break;
 
        case MC13XXX_ADC_MODE_MULT_CHAN:
-               adc0 |= old_adc0 & MC13XXX_ADC0_TSMOD_MASK;
+               adc0 |= old_adc0 & MC13XXX_ADC0_CONFIG_MASK;
                adc1 |= 4 << MC13XXX_ADC1_CHAN1_SHIFT;
                break;
 
@@ -696,17 +697,67 @@ static int mc13xxx_add_subdevice(struct mc13xxx *mc13xxx, const char *format)
        return mc13xxx_add_subdevice_pdata(mc13xxx, format, NULL, 0);
 }
 
+#ifdef CONFIG_OF
+static int mc13xxx_probe_flags_dt(struct mc13xxx *mc13xxx)
+{
+       struct device_node *np = mc13xxx->spidev->dev.of_node;
+
+       if (!np)
+               return -ENODEV;
+
+       if (of_get_property(np, "fsl,mc13xxx-uses-adc", NULL))
+               mc13xxx->flags |= MC13XXX_USE_ADC;
+
+       if (of_get_property(np, "fsl,mc13xxx-uses-codec", NULL))
+               mc13xxx->flags |= MC13XXX_USE_CODEC;
+
+       if (of_get_property(np, "fsl,mc13xxx-uses-rtc", NULL))
+               mc13xxx->flags |= MC13XXX_USE_RTC;
+
+       if (of_get_property(np, "fsl,mc13xxx-uses-touch", NULL))
+               mc13xxx->flags |= MC13XXX_USE_TOUCHSCREEN;
+
+       return 0;
+}
+#else
+static inline int mc13xxx_probe_flags_dt(struct mc13xxx *mc13xxx)
+{
+       return -ENODEV;
+}
+#endif
+
+static const struct spi_device_id mc13xxx_device_id[] = {
+       {
+               .name = "mc13783",
+               .driver_data = MC13XXX_ID_MC13783,
+       }, {
+               .name = "mc13892",
+               .driver_data = MC13XXX_ID_MC13892,
+       }, {
+               /* sentinel */
+       }
+};
+MODULE_DEVICE_TABLE(spi, mc13xxx_device_id);
+
+static const struct of_device_id mc13xxx_dt_ids[] = {
+       { .compatible = "fsl,mc13783", .data = (void *) MC13XXX_ID_MC13783, },
+       { .compatible = "fsl,mc13892", .data = (void *) MC13XXX_ID_MC13892, },
+       { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, mc13xxx_dt_ids);
+
 static int mc13xxx_probe(struct spi_device *spi)
 {
+       const struct of_device_id *of_id;
+       struct spi_driver *sdrv = to_spi_driver(spi->dev.driver);
        struct mc13xxx *mc13xxx;
        struct mc13xxx_platform_data *pdata = dev_get_platdata(&spi->dev);
        enum mc13xxx_id id;
        int ret;
 
-       if (!pdata) {
-               dev_err(&spi->dev, "invalid platform data\n");
-               return -EINVAL;
-       }
+       of_id = of_match_device(mc13xxx_dt_ids, &spi->dev);
+       if (of_id)
+               sdrv->id_table = &mc13xxx_device_id[(enum mc13xxx_id) of_id->data];
 
        mc13xxx = kzalloc(sizeof(*mc13xxx), GFP_KERNEL);
        if (!mc13xxx)
@@ -749,28 +800,33 @@ err_revision:
 
        mc13xxx_unlock(mc13xxx);
 
-       if (pdata->flags & MC13XXX_USE_ADC)
+       if (mc13xxx_probe_flags_dt(mc13xxx) < 0 && pdata)
+               mc13xxx->flags = pdata->flags;
+
+       if (mc13xxx->flags & MC13XXX_USE_ADC)
                mc13xxx_add_subdevice(mc13xxx, "%s-adc");
 
-       if (pdata->flags & MC13XXX_USE_CODEC)
+       if (mc13xxx->flags & MC13XXX_USE_CODEC)
                mc13xxx_add_subdevice(mc13xxx, "%s-codec");
 
-       mc13xxx_add_subdevice_pdata(mc13xxx, "%s-regulator",
-               &pdata->regulators, sizeof(pdata->regulators));
-
-       if (pdata->flags & MC13XXX_USE_RTC)
+       if (mc13xxx->flags & MC13XXX_USE_RTC)
                mc13xxx_add_subdevice(mc13xxx, "%s-rtc");
 
-       if (pdata->flags & MC13XXX_USE_TOUCHSCREEN)
+       if (mc13xxx->flags & MC13XXX_USE_TOUCHSCREEN)
                mc13xxx_add_subdevice(mc13xxx, "%s-ts");
 
-       if (pdata->leds)
+       if (pdata) {
+               mc13xxx_add_subdevice_pdata(mc13xxx, "%s-regulator",
+                       &pdata->regulators, sizeof(pdata->regulators));
                mc13xxx_add_subdevice_pdata(mc13xxx, "%s-led",
                                pdata->leds, sizeof(*pdata->leds));
-
-       if (pdata->buttons)
                mc13xxx_add_subdevice_pdata(mc13xxx, "%s-pwrbutton",
                                pdata->buttons, sizeof(*pdata->buttons));
+       } else {
+               mc13xxx_add_subdevice(mc13xxx, "%s-regulator");
+               mc13xxx_add_subdevice(mc13xxx, "%s-led");
+               mc13xxx_add_subdevice(mc13xxx, "%s-pwrbutton");
+       }
 
        return 0;
 }
@@ -788,25 +844,12 @@ static int __devexit mc13xxx_remove(struct spi_device *spi)
        return 0;
 }
 
-static const struct spi_device_id mc13xxx_device_id[] = {
-       {
-               .name = "mc13783",
-               .driver_data = MC13XXX_ID_MC13783,
-       }, {
-               .name = "mc13892",
-               .driver_data = MC13XXX_ID_MC13892,
-       }, {
-               /* sentinel */
-       }
-};
-MODULE_DEVICE_TABLE(spi, mc13xxx_device_id);
-
 static struct spi_driver mc13xxx_driver = {
        .id_table = mc13xxx_device_id,
        .driver = {
                .name = "mc13xxx",
-               .bus = &spi_bus_type,
                .owner = THIS_MODULE,
+               .of_match_table = mc13xxx_dt_ids,
        },
        .probe = mc13xxx_probe,
        .remove = __devexit_p(mc13xxx_remove),
index 84815f9..63be60b 100644 (file)
 #define to_mcp(d)              container_of(d, struct mcp, attached_device)
 #define to_mcp_driver(d)       container_of(d, struct mcp_driver, drv)
 
+static const struct mcp_device_id *mcp_match_id(const struct mcp_device_id *id,
+                                               const char *codec)
+{
+       while (id->name[0]) {
+               if (strcmp(codec, id->name) == 0)
+                       return id;
+               id++;
+       }
+       return NULL;
+}
+
+const struct mcp_device_id *mcp_get_device_id(const struct mcp *mcp)
+{
+       const struct mcp_driver *driver =
+               to_mcp_driver(mcp->attached_device.driver);
+
+       return mcp_match_id(driver->id_table, mcp->codec);
+}
+EXPORT_SYMBOL(mcp_get_device_id);
+
 static int mcp_bus_match(struct device *dev, struct device_driver *drv)
 {
-       return 1;
+       const struct mcp *mcp = to_mcp(dev);
+       const struct mcp_driver *driver = to_mcp_driver(drv);
+
+       if (driver->id_table)
+               return !!mcp_match_id(driver->id_table, mcp->codec);
+
+       return 0;
 }
 
 static int mcp_bus_probe(struct device *dev)
@@ -74,9 +100,18 @@ static int mcp_bus_resume(struct device *dev)
        return ret;
 }
 
+static int mcp_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
+{
+       struct mcp *mcp = to_mcp(dev);
+
+       add_uevent_var(env, "MODALIAS=%s%s", MCP_MODULE_PREFIX, mcp->codec);
+       return 0;
+}
+
 static struct bus_type mcp_bus_type = {
        .name           = "mcp",
        .match          = mcp_bus_match,
+       .uevent         = mcp_bus_uevent,
        .probe          = mcp_bus_probe,
        .remove         = mcp_bus_remove,
        .suspend        = mcp_bus_suspend,
@@ -212,9 +247,14 @@ struct mcp *mcp_host_alloc(struct device *parent, size_t size)
 }
 EXPORT_SYMBOL(mcp_host_alloc);
 
-int mcp_host_register(struct mcp *mcp)
+int mcp_host_register(struct mcp *mcp, void *pdata)
 {
+       if (!mcp->codec)
+               return -EINVAL;
+
+       mcp->attached_device.platform_data = pdata;
        dev_set_name(&mcp->attached_device, "mcp0");
+       request_module("%s%s", MCP_MODULE_PREFIX, mcp->codec);
        return device_register(&mcp->attached_device);
 }
 EXPORT_SYMBOL(mcp_host_register);
index 2dab02d..9adc2eb 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/spinlock.h>
 #include <linux/platform_device.h>
 #include <linux/mfd/mcp.h>
+#include <linux/io.h>
 
 #include <mach/dma.h>
 #include <mach/hardware.h>
 #include <asm/system.h>
 #include <mach/mcp.h>
 
-#include <mach/assabet.h>
-
+/* Register offsets */
+#define MCCR0  0x00
+#define MCDR0  0x08
+#define MCDR1  0x0C
+#define MCDR2  0x10
+#define MCSR   0x18
+#define MCCR1  0x00
 
 struct mcp_sa11x0 {
-       u32     mccr0;
-       u32     mccr1;
+       u32             mccr0;
+       u32             mccr1;
+       unsigned char   *mccr0_base;
+       unsigned char   *mccr1_base;
 };
 
 #define priv(mcp)      ((struct mcp_sa11x0 *)mcp_priv(mcp))
@@ -39,25 +47,25 @@ struct mcp_sa11x0 {
 static void
 mcp_sa11x0_set_telecom_divisor(struct mcp *mcp, unsigned int divisor)
 {
-       unsigned int mccr0;
+       struct mcp_sa11x0 *priv = priv(mcp);
 
        divisor /= 32;
 
-       mccr0 = Ser4MCCR0 & ~0x00007f00;
-       mccr0 |= divisor << 8;
-       Ser4MCCR0 = mccr0;
+       priv->mccr0 &= ~0x00007f00;
+       priv->mccr0 |= divisor << 8;
+       __raw_writel(priv->mccr0, priv->mccr0_base + MCCR0);
 }
 
 static void
 mcp_sa11x0_set_audio_divisor(struct mcp *mcp, unsigned int divisor)
 {
-       unsigned int mccr0;
+       struct mcp_sa11x0 *priv = priv(mcp);
 
        divisor /= 32;
 
-       mccr0 = Ser4MCCR0 & ~0x0000007f;
-       mccr0 |= divisor;
-       Ser4MCCR0 = mccr0;
+       priv->mccr0 &= ~0x0000007f;
+       priv->mccr0 |= divisor;
+       __raw_writel(priv->mccr0, priv->mccr0_base + MCCR0);
 }
 
 /*
@@ -71,12 +79,16 @@ mcp_sa11x0_write(struct mcp *mcp, unsigned int reg, unsigned int val)
 {
        int ret = -ETIME;
        int i;
+       u32 mcpreg;
+       struct mcp_sa11x0 *priv = priv(mcp);
 
-       Ser4MCDR2 = reg << 17 | MCDR2_Wr | (val & 0xffff);
+       mcpreg = reg << 17 | MCDR2_Wr | (val & 0xffff);
+       __raw_writel(mcpreg, priv->mccr0_base + MCDR2);
 
        for (i = 0; i < 2; i++) {
                udelay(mcp->rw_timeout);
-               if (Ser4MCSR & MCSR_CWC) {
+               mcpreg = __raw_readl(priv->mccr0_base + MCSR);
+               if (mcpreg & MCSR_CWC) {
                        ret = 0;
                        break;
                }
@@ -97,13 +109,18 @@ mcp_sa11x0_read(struct mcp *mcp, unsigned int reg)
 {
        int ret = -ETIME;
        int i;
+       u32 mcpreg;
+       struct mcp_sa11x0 *priv = priv(mcp);
 
-       Ser4MCDR2 = reg << 17 | MCDR2_Rd;
+       mcpreg = reg << 17 | MCDR2_Rd;
+       __raw_writel(mcpreg, priv->mccr0_base + MCDR2);
 
        for (i = 0; i < 2; i++) {
                udelay(mcp->rw_timeout);
-               if (Ser4MCSR & MCSR_CRC) {
-                       ret = Ser4MCDR2 & 0xffff;
+               mcpreg = __raw_readl(priv->mccr0_base + MCSR);
+               if (mcpreg & MCSR_CRC) {
+                       ret = __raw_readl(priv->mccr0_base + MCDR2)
+                               & 0xffff;
                        break;
                }
        }
@@ -116,13 +133,19 @@ mcp_sa11x0_read(struct mcp *mcp, unsigned int reg)
 
 static void mcp_sa11x0_enable(struct mcp *mcp)
 {
-       Ser4MCSR = -1;
-       Ser4MCCR0 |= MCCR0_MCE;
+       struct mcp_sa11x0 *priv = priv(mcp);
+
+       __raw_writel(-1, priv->mccr0_base + MCSR);
+       priv->mccr0 |= MCCR0_MCE;
+       __raw_writel(priv->mccr0, priv->mccr0_base + MCCR0);
 }
 
 static void mcp_sa11x0_disable(struct mcp *mcp)
 {
-       Ser4MCCR0 &= ~MCCR0_MCE;
+       struct mcp_sa11x0 *priv = priv(mcp);
+
+       priv->mccr0 &= ~MCCR0_MCE;
+       __raw_writel(priv->mccr0, priv->mccr0_base + MCCR0);
 }
 
 /*
@@ -142,50 +165,69 @@ static int mcp_sa11x0_probe(struct platform_device *pdev)
        struct mcp_plat_data *data = pdev->dev.platform_data;
        struct mcp *mcp;
        int ret;
+       struct mcp_sa11x0 *priv;
+       struct resource *res_mem0, *res_mem1;
+       u32 size0, size1;
 
        if (!data)
                return -ENODEV;
 
-       if (!request_mem_region(0x80060000, 0x60, "sa11x0-mcp"))
+       if (!data->codec)
+               return -ENODEV;
+
+       res_mem0 = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       if (!res_mem0)
+               return -ENODEV;
+       size0 = res_mem0->end - res_mem0->start + 1;
+
+       res_mem1 = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+       if (!res_mem1)
+               return -ENODEV;
+       size1 = res_mem1->end - res_mem1->start + 1;
+
+       if (!request_mem_region(res_mem0->start, size0, "sa11x0-mcp"))
                return -EBUSY;
 
+       if (!request_mem_region(res_mem1->start, size1, "sa11x0-mcp")) {
+               ret = -EBUSY;
+               goto release;
+       }
+
        mcp = mcp_host_alloc(&pdev->dev, sizeof(struct mcp_sa11x0));
        if (!mcp) {
                ret = -ENOMEM;
-               goto release;
+               goto release2;
        }
 
+       priv = priv(mcp);
+
        mcp->owner              = THIS_MODULE;
        mcp->ops                = &mcp_sa11x0;
        mcp->sclk_rate          = data->sclk_rate;
-       mcp->dma_audio_rd       = DMA_Ser4MCP0Rd;
-       mcp->dma_audio_wr       = DMA_Ser4MCP0Wr;
-       mcp->dma_telco_rd       = DMA_Ser4MCP1Rd;
-       mcp->dma_telco_wr       = DMA_Ser4MCP1Wr;
-       mcp->gpio_base          = data->gpio_base;
+       mcp->dma_audio_rd       = DDAR_DevAdd(res_mem0->start + MCDR0)
+                               + DDAR_DevRd + DDAR_Brst4 + DDAR_8BitDev;
+       mcp->dma_audio_wr       = DDAR_DevAdd(res_mem0->start + MCDR0)
+                               + DDAR_DevWr + DDAR_Brst4 + DDAR_8BitDev;
+       mcp->dma_telco_rd       = DDAR_DevAdd(res_mem0->start + MCDR1)
+                               + DDAR_DevRd + DDAR_Brst4 + DDAR_8BitDev;
+       mcp->dma_telco_wr       = DDAR_DevAdd(res_mem0->start + MCDR1)
+                               + DDAR_DevWr + DDAR_Brst4 + DDAR_8BitDev;
+       mcp->codec              = data->codec;
 
        platform_set_drvdata(pdev, mcp);
 
-       if (machine_is_assabet()) {
-               ASSABET_BCR_set(ASSABET_BCR_CODEC_RST);
-       }
-
-       /*
-        * Setup the PPC unit correctly.
-        */
-       PPDR &= ~PPC_RXD4;
-       PPDR |= PPC_TXD4 | PPC_SCLK | PPC_SFRM;
-       PSDR |= PPC_RXD4;
-       PSDR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
-       PPSR &= ~(PPC_TXD4 | PPC_SCLK | PPC_SFRM);
-
        /*
         * Initialise device.  Note that we initially
         * set the sampling rate to minimum.
         */
-       Ser4MCSR = -1;
-       Ser4MCCR1 = data->mccr1;
-       Ser4MCCR0 = data->mccr0 | 0x7f7f;
+       priv->mccr0_base = ioremap(res_mem0->start, size0);
+       priv->mccr1_base = ioremap(res_mem1->start, size1);
+
+       __raw_writel(-1, priv->mccr0_base + MCSR);
+       priv->mccr1 = data->mccr1;
+       priv->mccr0 = data->mccr0 | 0x7f7f;
+       __raw_writel(priv->mccr0, priv->mccr0_base + MCCR0);
+       __raw_writel(priv->mccr1, priv->mccr1_base + MCCR1);
 
        /*
         * Calculate the read/write timeout (us) from the bit clock
@@ -195,36 +237,53 @@ static int mcp_sa11x0_probe(struct platform_device *pdev)
        mcp->rw_timeout = (64 * 3 * 1000000 + mcp->sclk_rate - 1) /
                          mcp->sclk_rate;
 
-       ret = mcp_host_register(mcp);
+       ret = mcp_host_register(mcp, data->codec_pdata);
        if (ret == 0)
                goto out;
 
+ release2:
+       release_mem_region(res_mem1->start, size1);
  release:
-       release_mem_region(0x80060000, 0x60);
+       release_mem_region(res_mem0->start, size0);
        platform_set_drvdata(pdev, NULL);
 
  out:
        return ret;
 }
 
-static int mcp_sa11x0_remove(struct platform_device *dev)
+static int mcp_sa11x0_remove(struct platform_device *pdev)
 {
-       struct mcp *mcp = platform_get_drvdata(dev);
+       struct mcp *mcp = platform_get_drvdata(pdev);
+       struct mcp_sa11x0 *priv = priv(mcp);
+       struct resource *res_mem;
+       u32 size;
 
-       platform_set_drvdata(dev, NULL);
+       platform_set_drvdata(pdev, NULL);
        mcp_host_unregister(mcp);
-       release_mem_region(0x80060000, 0x60);
 
+       res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       if (res_mem) {
+               size = res_mem->end - res_mem-&g