Merge tag 'cleanup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 24 Jan 2014 02:36:55 +0000 (18:36 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 24 Jan 2014 02:36:55 +0000 (18:36 -0800)
Pull ARM SoC cleanups from Olof Johansson:
 "This is the branch where we usually queue up cleanup efforts, moving
  drivers out of the architecture directory, header file restructuring,
  etc.  Sometimes they tangle with new development so it's hard to keep
  it strictly to cleanups.

  Some of the things included in this branch are:

   * Atmel SAMA5 conversion to common clock
   * Reset framework conversion for tegra platforms
    - Some of this depends on tegra clock driver reworks that are shared
      with Mike Turquette's clk tree.
   * Tegra DMA refactoring, which are shared branches with the DMA tree.
   * Removal of some header files on exynos to prepare for
     multiplatform"

* tag 'cleanup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (169 commits)
  ARM: mvebu: move Armada 370/XP specific definitions to armada-370-xp.h
  ARM: mvebu: remove prototypes of non-existing functions from common.h
  ARM: mvebu: move ARMADA_XP_MAX_CPUS to armada-370-xp.h
  serial: sh-sci: Rework baud rate calculation
  serial: sh-sci: Compute overrun_bit without using baud rate algo
  serial: sh-sci: Remove unused GPIO request code
  serial: sh-sci: Move overrun_bit and error_mask fields out of pdata
  serial: sh-sci: Support resources passed through platform resources
  serial: sh-sci: Don't check IRQ in verify port operation
  serial: sh-sci: Set the UPF_FIXED_PORT flag
  serial: sh-sci: Remove duplicate interrupt check in verify port op
  serial: sh-sci: Simplify baud rate calculation algorithms
  serial: sh-sci: Remove baud rate calculation algorithm 5
  serial: sh-sci: Sort headers alphabetically
  ARM: EXYNOS: Kill exynos_pm_late_initcall()
  ARM: EXYNOS: Consolidate selection of PM_GENERIC_DOMAINS for Exynos4
  ARM: at91: switch Calao QIL-A9260 board to DT
  clk: at91: fix pmc_clk_ids data type attriubte
  PM / devfreq: use inclusion <mach/map.h> instead of <plat/map-s5p.h>
  ARM: EXYNOS: remove <mach/regs-clock.h> for exynos
  ...

20 files changed:
1  2 
arch/arm/Kconfig
arch/arm/mach-at91/Kconfig.non_dt
arch/arm/mach-at91/setup.c
arch/arm/mach-s3c24xx/simtec-usb.c
arch/arm/mach-s3c64xx/mach-smartq.c
arch/arm/mach-shmobile/board-lager.c
drivers/devfreq/exynos/exynos4_bus.c
drivers/dma/Kconfig
drivers/dma/dmaengine.c
drivers/pci/host/pci-tegra.c
drivers/spi/Kconfig
drivers/staging/nvec/nvec.c
drivers/usb/gadget/atmel_usba_udc.c
drivers/usb/host/ehci-tegra.c
include/linux/dmaengine.h
sound/soc/tegra/Kconfig
sound/soc/tegra/tegra20_ac97.c
sound/soc/tegra/tegra20_i2s.c
sound/soc/tegra/tegra30_i2s.c
sound/soc/tegra/tegra_pcm.c

diff --combined arch/arm/Kconfig
index 0b6d8bf1bc34021f0fec3d20e3634c88879486fe,5e227a371401eedac47237706f17856a211f17d6..dbe173dfa4aef795ca2b55fea1373f7a5bf81f3e
@@@ -6,13 -6,12 +6,13 @@@ config AR
        select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
        select ARCH_HAVE_CUSTOM_GPIO_H
        select ARCH_MIGHT_HAVE_PC_PARPORT
 +      select ARCH_USE_BUILTIN_BSWAP
        select ARCH_USE_CMPXCHG_LOCKREF
        select ARCH_WANT_IPC_PARSE_VERSION
        select BUILDTIME_EXTABLE_SORT if MMU
        select CLONE_BACKWARDS
        select CPU_PM if (SUSPEND || CPU_IDLE)
 -      select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN && MMU
 +      select DCACHE_WORD_ACCESS if HAVE_EFFICIENT_UNALIGNED_ACCESS
        select GENERIC_ATOMIC64 if (CPU_V7M || CPU_V6 || !CPU_32v6K || !AEABI)
        select GENERIC_CLOCKEVENTS_BROADCAST if SMP
        select GENERIC_IDLE_POLL_SETUP
        select HAVE_BPF_JIT
        select HAVE_CONTEXT_TRACKING
        select HAVE_C_RECORDMCOUNT
 +      select HAVE_CC_STACKPROTECTOR
        select HAVE_DEBUG_KMEMLEAK
        select HAVE_DMA_API_DEBUG
        select HAVE_DMA_ATTRS
        select HAVE_DMA_CONTIGUOUS if MMU
        select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL)
 +      select HAVE_EFFICIENT_UNALIGNED_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU
        select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)
        select HAVE_FUNCTION_GRAPH_TRACER if (!THUMB2_KERNEL)
        select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
@@@ -65,7 -62,6 +65,7 @@@
        select IRQ_FORCED_THREADING
        select KTIME_SCALAR
        select MODULES_USE_ELF_REL
 +      select NO_BOOTMEM
        select OLD_SIGACTION
        select OLD_SIGSUSPEND3
        select PERF_USE_VMALLOC
@@@ -714,6 -710,7 +714,6 @@@ config ARCH_S3C24X
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
        select HAVE_S3C_RTC if RTC_CLASS
        select MULTI_IRQ_HANDLER
 -      select NEED_MACH_GPIO_H
        select NEED_MACH_IO_H
        select SAMSUNG_ATAGS
        help
@@@ -726,7 -723,6 +726,7 @@@ config ARCH_S3C64X
        bool "Samsung S3C64XX"
        select ARCH_HAS_CPUFREQ
        select ARCH_REQUIRE_GPIOLIB
 +      select ARM_AMBA
        select ARM_VIC
        select CLKDEV_LOOKUP
        select CLKSRC_SAMSUNG_PWM
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
        select HAVE_TCM
 -      select NEED_MACH_GPIO_H
        select NO_IOPORT
        select PLAT_SAMSUNG
        select PM_GENERIC_DOMAINS
        select S3C_DEV_NAND
        select S3C_GPIO_TRACK
        select SAMSUNG_ATAGS
-       select SAMSUNG_GPIOLIB_4BIT
        select SAMSUNG_WAKEMASK
        select SAMSUNG_WDT_RESET
        select USB_ARCH_HAS_OHCI
@@@ -1596,7 -1592,7 +1595,7 @@@ config ARM_PSC
  config ARCH_NR_GPIO
        int
        default 1024 if ARCH_SHMOBILE || ARCH_TEGRA
 -      default 512 if ARCH_EXYNOS || ARCH_KEYSTONE || SOC_OMAP5 || SOC_DRA7XX
 +      default 512 if ARCH_EXYNOS || ARCH_KEYSTONE || SOC_OMAP5 || SOC_DRA7XX || ARCH_S3C24XX || ARCH_S3C64XX
        default 392 if ARCH_U8500
        default 352 if ARCH_VT8500
        default 288 if ARCH_SUNXI
@@@ -1654,6 -1650,9 +1653,6 @@@ config H
  config SCHED_HRTICK
        def_bool HIGH_RES_TIMERS
  
 -config SCHED_HRTICK
 -      def_bool HIGH_RES_TIMERS
 -
  config THUMB2_KERNEL
        bool "Compile the kernel in Thumb-2 mode" if !CPU_THUMBONLY
        depends on (CPU_V7 || CPU_V7M) && !CPU_V6 && !CPU_V6K
@@@ -1856,6 -1855,18 +1855,6 @@@ config SECCOM
          and the task is only allowed to execute a few safe syscalls
          defined by each seccomp mode.
  
 -config CC_STACKPROTECTOR
 -      bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)"
 -      help
 -        This option turns on the -fstack-protector GCC feature. This
 -        feature puts, at the beginning of functions, a canary value on
 -        the stack just before the return address, and validates
 -        the value just before actually returning.  Stack based buffer
 -        overflows (that need to overwrite this return address) now also
 -        overwrite the canary, which gets detected and the attack is then
 -        neutralized via a kernel panic.
 -        This feature requires gcc version 4.2 or above.
 -
  config SWIOTLB
        def_bool y
  
@@@ -1934,7 -1945,6 +1933,7 @@@ config ZBOOT_ROM_BS
  config ZBOOT_ROM
        bool "Compressed boot loader in ROM/flash"
        depends on ZBOOT_ROM_TEXT != ZBOOT_ROM_BSS
 +      depends on !ARM_APPENDED_DTB && !XIP_KERNEL && !AUTO_ZRELADDR
        help
          Say Y here if you intend to execute your compressed kernel image
          (zImage) directly from ROM or flash.  If unsure, say N.
@@@ -1970,7 -1980,7 +1969,7 @@@ endchoic
  
  config ARM_APPENDED_DTB
        bool "Use appended device tree blob to zImage (EXPERIMENTAL)"
 -      depends on OF && !ZBOOT_ROM
 +      depends on OF
        help
          With this option, the boot code will look for a device tree binary
          (DTB) appended to zImage
@@@ -2058,7 -2068,7 +2057,7 @@@ endchoic
  
  config XIP_KERNEL
        bool "Kernel Execute-In-Place from ROM"
 -      depends on !ZBOOT_ROM && !ARM_LPAE && !ARCH_MULTIPLATFORM
 +      depends on !ARM_LPAE && !ARCH_MULTIPLATFORM
        help
          Execute-In-Place allows the kernel to run from non-volatile storage
          directly addressable by the CPU, such as NOR flash. This saves RAM
@@@ -2121,6 -2131,7 +2120,6 @@@ config CRASH_DUM
  
  config AUTO_ZRELADDR
        bool "Auto calculation of the decompressed kernel image address"
 -      depends on !ZBOOT_ROM
        help
          ZRELADDR is the physical address where the decompressed kernel
          image will be placed. If AUTO_ZRELADDR is selected, the address
index 0363dba7d3f6fcadd4452d6f97bcc790936dff7a,091caa0219776376a2619592e69b3de89a636e90..1f73e9b527dac56f57ca37ec7af80f47b05c37fe
@@@ -12,26 -12,32 +12,32 @@@ config ARCH_AT91_NON
  config ARCH_AT91RM9200
        bool "AT91RM9200"
        select SOC_AT91RM9200
+       select AT91_USE_OLD_CLK
  
  config ARCH_AT91SAM9260
        bool "AT91SAM9260 or AT91SAM9XE or AT91SAM9G20"
        select SOC_AT91SAM9260
+       select AT91_USE_OLD_CLK
  
  config ARCH_AT91SAM9261
        bool "AT91SAM9261 or AT91SAM9G10"
        select SOC_AT91SAM9261
+       select AT91_USE_OLD_CLK
  
  config ARCH_AT91SAM9263
        bool "AT91SAM9263"
        select SOC_AT91SAM9263
+       select AT91_USE_OLD_CLK
  
  config ARCH_AT91SAM9RL
        bool "AT91SAM9RL"
        select SOC_AT91SAM9RL
+       select AT91_USE_OLD_CLK
  
  config ARCH_AT91SAM9G45
        bool "AT91SAM9G45"
        select SOC_AT91SAM9G45
+       select AT91_USE_OLD_CLK
  
  config ARCH_AT91X40
        bool "AT91x40"
@@@ -176,12 -182,6 +182,6 @@@ config MACH_AFEB926
          <svn://194.85.238.22/home/users/george/svn/arm9eb>
          <http://groups.google.com/group/arm9fpga-evolution-board>
  
- config MACH_QIL_A9260
-       bool "CALAO QIL-A9260 board"
-       help
-         Select this if you are using a Calao Systems QIL-A9260 Board.
-         <http://www.calao-systems.com>
  config MACH_CPU9260
        bool "Eukrea CPU9260 board"
        help
@@@ -241,7 -241,7 +241,7 @@@ config MACH_PCONTROL_G2
        bool "PControl G20 CPU module"
        help
          Select this if you are using taskit's Stamp9G20 CPU module on this
 -        carrier board, beeing the decentralized unit of a building automation
 +        carrier board, being the decentralized unit of a building automation
          system; featuring nvram, eth-switch, iso-rs485, display, io
  
  config MACH_GSIA18S
index 2742e00ec5d6c82a8e4abd1b6b3560e3588407c6,7d3f7cc610813ab90da29c83e624910d8382adb7..9dc8894c56233db9e9567002d75365c144290ab3
@@@ -11,6 -11,7 +11,7 @@@
  #include <linux/pm.h>
  #include <linux/of_address.h>
  #include <linux/pinctrl/machine.h>
+ #include <linux/clk/at91_pmc.h>
  
  #include <asm/system_misc.h>
  #include <asm/mach/map.h>
@@@ -18,7 -19,6 +19,6 @@@
  #include <mach/hardware.h>
  #include <mach/cpu.h>
  #include <mach/at91_dbgu.h>
- #include <mach/at91_pmc.h>
  
  #include "at91_shdwc.h"
  #include "soc.h"
@@@ -81,7 -81,7 +81,7 @@@ void __init at91_init_sram(int bank, un
  
        desc->pfn = __phys_to_pfn(base);
        desc->length = length;
 -      desc->type = MT_MEMORY_NONCACHED;
 +      desc->type = MT_MEMORY_RWX_NONCACHED;
  
        pr_info("AT91: sram at 0x%lx of 0x%x mapped at 0x%lx\n",
                base, length, desc->virtual);
@@@ -491,7 -491,8 +491,8 @@@ void __init at91rm9200_dt_initialize(vo
        at91_dt_clock_init();
  
        /* Register the processor-specific clocks */
-       at91_boot_soc.register_clocks();
+       if (at91_boot_soc.register_clocks)
+               at91_boot_soc.register_clocks();
  
        at91_boot_soc.init();
  }
@@@ -506,7 -507,8 +507,8 @@@ void __init at91_dt_initialize(void
        at91_dt_clock_init();
  
        /* Register the processor-specific clocks */
-       at91_boot_soc.register_clocks();
+       if (at91_boot_soc.register_clocks)
+               at91_boot_soc.register_clocks();
  
        if (at91_boot_soc.init)
                at91_boot_soc.init();
index 8dea917e954b83cb993491741ccea391befe52d3,bb3eac6a769733155c17ce165342153333b255c2..b70aa66efebea9246159155ffbcf5ea2782c30af
@@@ -29,7 -29,6 +29,7 @@@
  #include <asm/mach/irq.h>
  
  #include <mach/hardware.h>
 +#include <mach/gpio-samsung.h>
  #include <asm/irq.h>
  
  #include <linux/platform_data/usb-ohci-s3c2410.h>
@@@ -79,8 -78,7 +79,7 @@@ static void usb_simtec_enableoc(struct 
  
        if (on) {
                ret = request_irq(BAST_IRQ_USBOC, usb_simtec_ocirq,
-                                 IRQF_DISABLED | IRQF_TRIGGER_RISING |
-                                  IRQF_TRIGGER_FALLING,
+                                 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
                                  "USB Over-current", info);
                if (ret != 0) {
                        printk(KERN_ERR "failed to request usb oc irq\n");
index 5629df905fcdac2f422013f263dd97f65ffe4338,08a889c141dab878de4271096ec73a10e1dee9b6..6e72bd5c1d0cc934232ea27d8953a5da8048ecf1
@@@ -25,7 -25,6 +25,7 @@@
  
  #include <mach/map.h>
  #include <mach/regs-gpio.h>
 +#include <mach/gpio-samsung.h>
  
  #include <plat/clock.h>
  #include <plat/cpu.h>
@@@ -107,7 -106,7 +107,7 @@@ static void smartq_usb_host_enableoc(st
  
        if (on) {
                ret = request_irq(gpio_to_irq(S3C64XX_GPL(10)),
-                                 smartq_usb_host_ocirq, IRQF_DISABLED |
+                                 smartq_usb_host_ocirq,
                                  IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
                                  "USB host overcurrent", info);
                if (ret != 0)
index e0406fd373906e4d43d53769a7d7cfa548b6f388,78a31b6679880828dd8571d44dacbde7e0288ac8..d1a8dddecfc832cb38a736ddd1f2c8211a71fdba
@@@ -148,7 -148,7 +148,7 @@@ static const struct sh_mmcif_plat_data 
  };
  
  static const struct resource mmcif1_resources[] __initconst = {
-       DEFINE_RES_MEM_NAMED(0xee220000, 0x80, "MMCIF1"),
+       DEFINE_RES_MEM(0xee220000, 0x80),
        DEFINE_RES_IRQ(gic_spi(170)),
  };
  
@@@ -245,9 -245,7 +245,9 @@@ static void __init lager_init(void
  {
        lager_add_standard_devices();
  
 -      phy_register_fixup_for_id("r8a7790-ether-ff:01", lager_ksz8041_fixup);
 +      if (IS_ENABLED(CONFIG_PHYLIB))
 +              phy_register_fixup_for_id("r8a7790-ether-ff:01",
 +                                        lager_ksz8041_fixup);
  }
  
  static const char * const lager_boards_compat_dt[] __initconst = {
index bbbfe6853b18b96b6e6fbcba1707b9d89553a4de,1ab8cdd48c1745b616007160966dafe214df7499..e07b0c68c71523db4ce74c24897a88b21fbc7911
@@@ -30,9 -30,9 +30,9 @@@
  extern unsigned int exynos_result_of_asv;
  #endif
  
- #include <mach/regs-clock.h>
+ #include <mach/map.h>
  
- #include <plat/map-s5p.h>
+ #include "exynos4_bus.h"
  
  #define MAX_SAFEVOLT  1200000 /* 1.2V */
  
@@@ -116,7 -116,7 +116,7 @@@ static struct bus_opp_table exynos4210_
  };
  
  /*
 - * MIF is the main control knob clock for exynox4x12 MIF/INT
 + * MIF is the main control knob clock for Exynos4x12 MIF/INT
   * clock and voltage of both mif/int are controlled.
   */
  static struct bus_opp_table exynos4x12_mifclk_table[] = {
diff --combined drivers/dma/Kconfig
index c823daaf90430bb501ff9bc168e88adbcecf87ef,af3676333da4408e11f3e39ed83c1f36b2783a13..c10eb89a3c1bdd388da699f3ac4f8e00c92cc63b
@@@ -62,7 -62,6 +62,7 @@@ config INTEL_IOATDM
        tristate "Intel I/OAT DMA support"
        depends on PCI && X86
        select DMA_ENGINE
 +      select DMA_ENGINE_RAID
        select DCA
        help
          Enable support for the Intel(R) I/OAT DMA engine present
@@@ -113,7 -112,6 +113,7 @@@ config MV_XO
        bool "Marvell XOR engine support"
        depends on PLAT_ORION
        select DMA_ENGINE
 +      select DMA_ENGINE_RAID
        select ASYNC_TX_ENABLE_CHANNEL_SWITCH
        ---help---
          Enable support for the Marvell XOR engine.
@@@ -189,7 -187,6 +189,7 @@@ config AMCC_PPC440SPE_ADM
        tristate "AMCC PPC440SPe ADMA support"
        depends on 440SPe || 440SP
        select DMA_ENGINE
 +      select DMA_ENGINE_RAID
        select ARCH_HAS_ASYNC_TX_FIND_CHANNEL
        select ASYNC_TX_ENABLE_CHANNEL_SWITCH
        help
@@@ -292,9 -289,11 +292,11 @@@ config MMP_TDM
        bool "MMP Two-Channel DMA support"
        depends on ARCH_MMP
        select DMA_ENGINE
+       select MMP_SRAM
        help
          Support the MMP Two-Channel DMA engine.
          This engine used for MMP Audio DMA and pxa910 SQU.
+         It needs sram driver under mach-mmp.
  
          Say Y here if you enabled MMP ADMA, otherwise say N.
  
@@@ -355,7 -354,6 +357,7 @@@ config NET_DM
        bool "Network: TCP receive copy offload"
        depends on DMA_ENGINE && NET
        default (INTEL_IOATDMA || FSL_DMA)
 +      depends on BROKEN
        help
          This enables the use of DMA engines in the network stack to
          offload receive copy-to-user operations, freeing CPU cycles.
@@@ -381,7 -379,4 +383,7 @@@ config DMATES
          Simple DMA test client. Say N unless you're debugging a
          DMA Device driver.
  
 +config DMA_ENGINE_RAID
 +      bool
 +
  endif
diff --combined drivers/dma/dmaengine.c
index 92caad629d996cec8415b5d96dfc10605b127195,24095ff8a93b0a0ff121254198e6d4e46bc6ddb8..ed610b4975186b8e389de7360d4d3c8e6f5785e3
@@@ -535,6 -535,34 +535,34 @@@ struct dma_chan *dma_get_slave_channel(
  }
  EXPORT_SYMBOL_GPL(dma_get_slave_channel);
  
+ struct dma_chan *dma_get_any_slave_channel(struct dma_device *device)
+ {
+       dma_cap_mask_t mask;
+       struct dma_chan *chan;
+       int err;
+       dma_cap_zero(mask);
+       dma_cap_set(DMA_SLAVE, mask);
+       /* lock against __dma_request_channel */
+       mutex_lock(&dma_list_mutex);
+       chan = private_candidate(&mask, device, NULL, NULL);
+       if (chan) {
+               err = dma_chan_get(chan);
+               if (err) {
+                       pr_debug("%s: failed to get %s: (%d)\n",
+                               __func__, dma_chan_name(chan), err);
+                       chan = NULL;
+               }
+       }
+       mutex_unlock(&dma_list_mutex);
+       return chan;
+ }
+ EXPORT_SYMBOL_GPL(dma_get_any_slave_channel);
  /**
   * __dma_request_channel - try to allocate an exclusive channel
   * @mask: capabilities that the channel must satisfy
@@@ -939,7 -967,7 +967,7 @@@ struct dmaengine_unmap_pool 
  #define __UNMAP_POOL(x) { .size = x, .name = "dmaengine-unmap-" __stringify(x) }
  static struct dmaengine_unmap_pool unmap_pool[] = {
        __UNMAP_POOL(2),
 -      #if IS_ENABLED(CONFIG_ASYNC_TX_DMA)
 +      #if IS_ENABLED(CONFIG_DMA_ENGINE_RAID)
        __UNMAP_POOL(16),
        __UNMAP_POOL(128),
        __UNMAP_POOL(256),
@@@ -1081,7 -1109,7 +1109,7 @@@ dma_async_memcpy_pg_to_pg(struct dma_ch
        dma_cookie_t cookie;
        unsigned long flags;
  
 -      unmap = dmaengine_get_unmap_data(dev->dev, 2, GFP_NOIO);
 +      unmap = dmaengine_get_unmap_data(dev->dev, 2, GFP_NOWAIT);
        if (!unmap)
                return -ENOMEM;
  
index b8ba2f794559c65fba1aed5b6eebfd82f4c364b5,0175041ab728b8a641194f432146fa3e1e84c646..330f7e3a32dd9f3694a09844106b551751235296
@@@ -25,7 -25,6 +25,6 @@@
   */
  
  #include <linux/clk.h>
- #include <linux/clk/tegra.h>
  #include <linux/delay.h>
  #include <linux/export.h>
  #include <linux/interrupt.h>
@@@ -39,6 -38,7 +38,7 @@@
  #include <linux/of_platform.h>
  #include <linux/pci.h>
  #include <linux/platform_device.h>
+ #include <linux/reset.h>
  #include <linux/sizes.h>
  #include <linux/slab.h>
  #include <linux/tegra-cpuidle.h>
@@@ -259,10 -259,13 +259,13 @@@ struct tegra_pcie 
  
        struct clk *pex_clk;
        struct clk *afi_clk;
-       struct clk *pcie_xclk;
        struct clk *pll_e;
        struct clk *cml_clk;
  
+       struct reset_control *pex_rst;
+       struct reset_control *afi_rst;
+       struct reset_control *pcie_xrst;
        struct tegra_msi msi;
  
        struct list_head ports;
@@@ -805,7 -808,7 +808,7 @@@ static int tegra_pcie_enable_controller
        afi_writel(pcie, value, AFI_PCIE_CONFIG);
  
        value = afi_readl(pcie, AFI_FUSE);
 -      value &= ~AFI_FUSE_PCIE_T0_GEN2_DIS;
 +      value |= AFI_FUSE_PCIE_T0_GEN2_DIS;
        afi_writel(pcie, value, AFI_FUSE);
  
        /* initialize internal PHY, enable up to 16 PCIE lanes */
        pads_writel(pcie, value, PADS_CTL);
  
        /* take the PCIe interface module out of reset */
-       tegra_periph_reset_deassert(pcie->pcie_xclk);
+       reset_control_deassert(pcie->pcie_xrst);
  
        /* finally enable PCIe */
        value = afi_readl(pcie, AFI_CONFIGURATION);
@@@ -891,9 -894,9 +894,9 @@@ static void tegra_pcie_power_off(struc
  
        /* TODO: disable and unprepare clocks? */
  
-       tegra_periph_reset_assert(pcie->pcie_xclk);
-       tegra_periph_reset_assert(pcie->afi_clk);
-       tegra_periph_reset_assert(pcie->pex_clk);
+       reset_control_assert(pcie->pcie_xrst);
+       reset_control_assert(pcie->afi_rst);
+       reset_control_assert(pcie->pex_rst);
  
        tegra_powergate_power_off(TEGRA_POWERGATE_PCIE);
  
@@@ -921,9 -924,9 +924,9 @@@ static int tegra_pcie_power_on(struct t
        const struct tegra_pcie_soc_data *soc = pcie->soc_data;
        int err;
  
-       tegra_periph_reset_assert(pcie->pcie_xclk);
-       tegra_periph_reset_assert(pcie->afi_clk);
-       tegra_periph_reset_assert(pcie->pex_clk);
+       reset_control_assert(pcie->pcie_xrst);
+       reset_control_assert(pcie->afi_rst);
+       reset_control_assert(pcie->pex_rst);
  
        tegra_powergate_power_off(TEGRA_POWERGATE_PCIE);
  
        }
  
        err = tegra_powergate_sequence_power_up(TEGRA_POWERGATE_PCIE,
-                                               pcie->pex_clk);
+                                               pcie->pex_clk,
+                                               pcie->pex_rst);
        if (err) {
                dev_err(pcie->dev, "powerup sequence failed: %d\n", err);
                return err;
        }
  
-       tegra_periph_reset_deassert(pcie->afi_clk);
+       reset_control_deassert(pcie->afi_rst);
  
        err = clk_prepare_enable(pcie->afi_clk);
        if (err < 0) {
@@@ -996,10 -1000,6 +1000,6 @@@ static int tegra_pcie_clocks_get(struc
        if (IS_ERR(pcie->afi_clk))
                return PTR_ERR(pcie->afi_clk);
  
-       pcie->pcie_xclk = devm_clk_get(pcie->dev, "pcie_xclk");
-       if (IS_ERR(pcie->pcie_xclk))
-               return PTR_ERR(pcie->pcie_xclk);
        pcie->pll_e = devm_clk_get(pcie->dev, "pll_e");
        if (IS_ERR(pcie->pll_e))
                return PTR_ERR(pcie->pll_e);
        return 0;
  }
  
+ static int tegra_pcie_resets_get(struct tegra_pcie *pcie)
+ {
+       pcie->pex_rst = devm_reset_control_get(pcie->dev, "pex");
+       if (IS_ERR(pcie->pex_rst))
+               return PTR_ERR(pcie->pex_rst);
+       pcie->afi_rst = devm_reset_control_get(pcie->dev, "afi");
+       if (IS_ERR(pcie->afi_rst))
+               return PTR_ERR(pcie->afi_rst);
+       pcie->pcie_xrst = devm_reset_control_get(pcie->dev, "pcie_x");
+       if (IS_ERR(pcie->pcie_xrst))
+               return PTR_ERR(pcie->pcie_xrst);
+       return 0;
+ }
  static int tegra_pcie_get_resources(struct tegra_pcie *pcie)
  {
        struct platform_device *pdev = to_platform_device(pcie->dev);
                return err;
        }
  
+       err = tegra_pcie_resets_get(pcie);
+       if (err) {
+               dev_err(&pdev->dev, "failed to get resets: %d\n", err);
+               return err;
+       }
        err = tegra_pcie_power_on(pcie);
        if (err) {
                dev_err(&pdev->dev, "failed to power up: %d\n", err);
diff --combined drivers/spi/Kconfig
index e2dd2fbec5ee869f014db05a2fe8b3b616ac9d75,9fc66e83c1a789b1c4046992ea1c3f6810335b43..385602f77cadf74a0b69c7d8cda1394cb71eba73
@@@ -395,7 -395,7 +395,7 @@@ config SPI_S3C24XX_FI
  config SPI_S3C64XX
        tristate "Samsung S3C64XX series type SPI"
        depends on PLAT_SAMSUNG
 -      select S3C64XX_DMA if ARCH_S3C64XX
 +      select S3C64XX_PL080 if ARCH_S3C64XX
        help
          SPI driver for Samsung S3C64XX and newer SoCs.
  
@@@ -448,6 -448,7 +448,7 @@@ config SPI_MX
  config SPI_TEGRA114
        tristate "NVIDIA Tegra114 SPI Controller"
        depends on (ARCH_TEGRA && TEGRA20_APB_DMA) || COMPILE_TEST
+       depends on RESET_CONTROLLER
        help
          SPI driver for NVIDIA Tegra114 SPI Controller interface. This controller
          is different than the older SoCs SPI controller and also register interface
  config SPI_TEGRA20_SFLASH
        tristate "Nvidia Tegra20 Serial flash Controller"
        depends on ARCH_TEGRA || COMPILE_TEST
+       depends on RESET_CONTROLLER
        help
          SPI driver for Nvidia Tegra20 Serial flash Controller interface.
          The main usecase of this controller is to use spi flash as boot
  config SPI_TEGRA20_SLINK
        tristate "Nvidia Tegra20/Tegra30 SLINK Controller"
        depends on (ARCH_TEGRA && TEGRA20_APB_DMA) || COMPILE_TEST
+       depends on RESET_CONTROLLER
        help
          SPI driver for Nvidia Tegra20/Tegra30 SLINK Controller interface.
  
index bb152201e93d2292835571c838c01ebf58805ed1,986870593b0cd2241d9fbd3cb66ce1ac0a5aaf64..3ee0b1887a5474c1d0d763f0e37e34278fbb1adc
@@@ -36,7 -36,6 +36,6 @@@
  #include <linux/slab.h>
  #include <linux/spinlock.h>
  #include <linux/workqueue.h>
- #include <linux/clk/tegra.h>
  
  #include "nvec.h"
  
@@@ -83,7 -82,7 +82,7 @@@ enum nvec_sleep_subcmds 
  
  static struct nvec_chip *nvec_power_handle;
  
 -static struct mfd_cell nvec_devices[] = {
 +static const struct mfd_cell nvec_devices[] = {
        {
                .name = "nvec-kbd",
                .id = 1,
@@@ -734,9 -733,9 +733,9 @@@ static void tegra_init_i2c_slave(struc
  
        clk_prepare_enable(nvec->i2c_clk);
  
-       tegra_periph_reset_assert(nvec->i2c_clk);
+       reset_control_assert(nvec->rst);
        udelay(2);
-       tegra_periph_reset_deassert(nvec->i2c_clk);
+       reset_control_deassert(nvec->rst);
  
        val = I2C_CNFG_NEW_MASTER_SFM | I2C_CNFG_PACKET_MODE_EN |
            (0x2 << I2C_CNFG_DEBOUNCE_CNT_SHIFT);
@@@ -837,6 -836,12 +836,12 @@@ static int tegra_nvec_probe(struct plat
                return -ENODEV;
        }
  
+       nvec->rst = devm_reset_control_get(&pdev->dev, "i2c");
+       if (IS_ERR(nvec->rst)) {
+               dev_err(nvec->dev, "failed to get controller reset\n");
+               return PTR_ERR(nvec->rst);
+       }
        nvec->base = base;
        nvec->irq = res->start;
        nvec->i2c_clk = i2c_clk;
index 38bf67b1a97d03bbe2de7e4c4074fd5b3609ce3e,9f71d9fdcc143206d8947b00e1c8d5cebb33297f..52771d4c44bc96c7974fd50e82f4256d02bc9dc2
@@@ -326,7 -326,7 +326,7 @@@ static int vbus_is_present(struct usba_
  
  #if defined(CONFIG_ARCH_AT91SAM9RL)
  
- #include <mach/at91_pmc.h>
+ #include <linux/clk/at91_pmc.h>
  
  static void toggle_bias(int is_on)
  {
@@@ -1012,7 -1012,7 +1012,7 @@@ static void nop_release(struct device *
  
  }
  
 -struct usb_gadget usba_gadget_template = {
 +static struct usb_gadget usba_gadget_template = {
        .ops            = &usba_udc_ops,
        .max_speed      = USB_SPEED_HIGH,
        .name           = "atmel_usba_udc",
@@@ -1904,7 -1904,7 +1904,7 @@@ static struct usba_ep * atmel_udc_of_in
                ep->dma_regs = udc->regs + USBA_DMA_BASE(i);
                ep->fifo = udc->fifo + USBA_FIFO_BASE(i);
                ep->ep.ops = &usba_ep_ops;
 -              ep->ep.maxpacket = ep->fifo_size;
 +              usb_ep_set_maxpacket_limit(&ep->ep, ep->fifo_size);
                ep->udc = udc;
                INIT_LIST_HEAD(&ep->queue);
  
@@@ -1957,8 -1957,7 +1957,8 @@@ static struct usba_ep * usba_udc_pdata(
                ep->fifo = udc->fifo + USBA_FIFO_BASE(i);
                ep->ep.ops = &usba_ep_ops;
                ep->ep.name = pdata->ep[i].name;
 -              ep->fifo_size = ep->ep.maxpacket = pdata->ep[i].fifo_size;
 +              ep->fifo_size = pdata->ep[i].fifo_size;
 +              usb_ep_set_maxpacket_limit(&ep->ep, ep->fifo_size);
                ep->udc = udc;
                INIT_LIST_HEAD(&ep->queue);
                ep->nr_banks = pdata->ep[i].nr_banks;
@@@ -1996,12 -1995,14 +1996,12 @@@ static int __init usba_udc_probe(struc
        if (irq < 0)
                return irq;
  
 -      pclk = clk_get(&pdev->dev, "pclk");
 +      pclk = devm_clk_get(&pdev->dev, "pclk");
        if (IS_ERR(pclk))
                return PTR_ERR(pclk);
 -      hclk = clk_get(&pdev->dev, "hclk");
 -      if (IS_ERR(hclk)) {
 -              ret = PTR_ERR(hclk);
 -              goto err_get_hclk;
 -      }
 +      hclk = devm_clk_get(&pdev->dev, "hclk");
 +      if (IS_ERR(hclk))
 +              return PTR_ERR(hclk);
  
        spin_lock_init(&udc->lock);
        udc->pdev = pdev;
        udc->vbus_pin = -ENODEV;
  
        ret = -ENOMEM;
 -      udc->regs = ioremap(regs->start, resource_size(regs));
 +      udc->regs = devm_ioremap(&pdev->dev, regs->start, resource_size(regs));
        if (!udc->regs) {
                dev_err(&pdev->dev, "Unable to map I/O memory, aborting.\n");
 -              goto err_map_regs;
 +              return ret;
        }
        dev_info(&pdev->dev, "MMIO registers at 0x%08lx mapped at %p\n",
                 (unsigned long)regs->start, udc->regs);
 -      udc->fifo = ioremap(fifo->start, resource_size(fifo));
 +      udc->fifo = devm_ioremap(&pdev->dev, fifo->start, resource_size(fifo));
        if (!udc->fifo) {
                dev_err(&pdev->dev, "Unable to map FIFO, aborting.\n");
 -              goto err_map_fifo;
 +              return ret;
        }
        dev_info(&pdev->dev, "FIFO at 0x%08lx mapped at %p\n",
                 (unsigned long)fifo->start, udc->fifo);
        ret = clk_prepare_enable(pclk);
        if (ret) {
                dev_err(&pdev->dev, "Unable to enable pclk, aborting.\n");
 -              goto err_clk_enable;
 +              return ret;
        }
        toggle_bias(0);
        usba_writel(udc, CTRL, USBA_DISABLE_MASK);
        else
                udc->usba_ep = usba_udc_pdata(pdev, udc);
  
 -      if (IS_ERR(udc->usba_ep)) {
 -              ret = PTR_ERR(udc->usba_ep);
 -              goto err_alloc_ep;
 -      }
 +      if (IS_ERR(udc->usba_ep))
 +              return PTR_ERR(udc->usba_ep);
  
 -      ret = request_irq(irq, usba_udc_irq, 0, "atmel_usba_udc", udc);
 +      ret = devm_request_irq(&pdev->dev, irq, usba_udc_irq, 0,
 +                              "atmel_usba_udc", udc);
        if (ret) {
                dev_err(&pdev->dev, "Cannot request irq %d (error %d)\n",
                        irq, ret);
 -              goto err_request_irq;
 +              return ret;
        }
        udc->irq = irq;
  
        if (gpio_is_valid(udc->vbus_pin)) {
                if (!devm_gpio_request(&pdev->dev, udc->vbus_pin, "atmel_usba_udc")) {
 -                      ret = request_irq(gpio_to_irq(udc->vbus_pin),
 +                      ret = devm_request_irq(&pdev->dev,
 +                                      gpio_to_irq(udc->vbus_pin),
                                        usba_vbus_irq, 0,
                                        "atmel_usba_udc", udc);
                        if (ret) {
  
        ret = usb_add_gadget_udc(&pdev->dev, &udc->gadget);
        if (ret)
 -              goto err_add_udc;
 +              return ret;
  
        usba_init_debugfs(udc);
        for (i = 1; i < udc->num_ep; i++)
                usba_ep_init_debugfs(udc, &udc->usba_ep[i]);
  
        return 0;
 -
 -err_add_udc:
 -      if (gpio_is_valid(udc->vbus_pin))
 -              free_irq(gpio_to_irq(udc->vbus_pin), udc);
 -
 -      free_irq(irq, udc);
 -err_request_irq:
 -err_alloc_ep:
 -err_clk_enable:
 -      iounmap(udc->fifo);
 -err_map_fifo:
 -      iounmap(udc->regs);
 -err_map_regs:
 -      clk_put(hclk);
 -err_get_hclk:
 -      clk_put(pclk);
 -
 -      return ret;
  }
  
  static int __exit usba_udc_remove(struct platform_device *pdev)
                usba_ep_cleanup_debugfs(&udc->usba_ep[i]);
        usba_cleanup_debugfs(udc);
  
 -      if (gpio_is_valid(udc->vbus_pin)) {
 -              free_irq(gpio_to_irq(udc->vbus_pin), udc);
 -      }
 -
 -      free_irq(udc->irq, udc);
 -      iounmap(udc->fifo);
 -      iounmap(udc->regs);
 -      clk_put(udc->hclk);
 -      clk_put(udc->pclk);
 -
        return 0;
  }
  
index a8f4471dae7b8d48875696ad94a528a17639e788,6f7e23dd1417815204d4f4e7258bbae2689acefb..af28b748e87a01d840b12b3084ea063665c48485
@@@ -17,7 -17,6 +17,6 @@@
   */
  
  #include <linux/clk.h>
- #include <linux/clk/tegra.h>
  #include <linux/dma-mapping.h>
  #include <linux/err.h>
  #include <linux/gpio.h>
@@@ -29,6 -28,7 +28,7 @@@
  #include <linux/of_gpio.h>
  #include <linux/platform_device.h>
  #include <linux/pm_runtime.h>
+ #include <linux/reset.h>
  #include <linux/slab.h>
  #include <linux/usb/ehci_def.h>
  #include <linux/usb/tegra_usb_phy.h>
@@@ -62,6 -62,7 +62,7 @@@ static int (*orig_hub_control)(struct u
  struct tegra_ehci_hcd {
        struct tegra_usb_phy *phy;
        struct clk *clk;
+       struct reset_control *rst;
        int port_resuming;
        bool needs_double_reset;
        enum tegra_usb_phy_port_speed port_speed;
@@@ -385,13 -386,20 +386,20 @@@ static int tegra_ehci_probe(struct plat
                goto cleanup_hcd_create;
        }
  
+       tegra->rst = devm_reset_control_get(&pdev->dev, "usb");
+       if (IS_ERR(tegra->rst)) {
+               dev_err(&pdev->dev, "Can't get ehci reset\n");
+               err = PTR_ERR(tegra->rst);
+               goto cleanup_hcd_create;
+       }
        err = clk_prepare_enable(tegra->clk);
        if (err)
                goto cleanup_hcd_create;
  
-       tegra_periph_reset_assert(tegra->clk);
+       reset_control_assert(tegra->rst);
        udelay(1);
-       tegra_periph_reset_deassert(tegra->clk);
+       reset_control_deassert(tegra->rst);
  
        u_phy = devm_usb_get_phy_by_phandle(&pdev->dev, "nvidia,phy", 0);
        if (IS_ERR(u_phy)) {
                dev_err(&pdev->dev, "Failed to add USB HCD\n");
                goto cleanup_otg_set_host;
        }
 +      device_wakeup_enable(hcd->self.controller);
  
        return err;
  
index ba5f96db07540dc2897399d98a1b7085cc16a63a,bae1568416f81bb5037cd2c3d1ef88ed564a28e8..6fd9390ccf91ab541f4aba92ac80da639bdf58ad
@@@ -364,32 -364,6 +364,32 @@@ struct dma_slave_config 
        unsigned int slave_id;
  };
  
 +/**
 + * enum dma_residue_granularity - Granularity of the reported transfer residue
 + * @DMA_RESIDUE_GRANULARITY_DESCRIPTOR: Residue reporting is not support. The
 + *  DMA channel is only able to tell whether a descriptor has been completed or
 + *  not, which means residue reporting is not supported by this channel. The
 + *  residue field of the dma_tx_state field will always be 0.
 + * @DMA_RESIDUE_GRANULARITY_SEGMENT: Residue is updated after each successfully
 + *  completed segment of the transfer (For cyclic transfers this is after each
 + *  period). This is typically implemented by having the hardware generate an
 + *  interrupt after each transferred segment and then the drivers updates the
 + *  outstanding residue by the size of the segment. Another possibility is if
 + *  the hardware supports scatter-gather and the segment descriptor has a field
 + *  which gets set after the segment has been completed. The driver then counts
 + *  the number of segments without the flag set to compute the residue.
 + * @DMA_RESIDUE_GRANULARITY_BURST: Residue is updated after each transferred
 + *  burst. This is typically only supported if the hardware has a progress
 + *  register of some sort (E.g. a register with the current read/write address
 + *  or a register with the amount of bursts/beats/bytes that have been
 + *  transferred or still need to be transferred).
 + */
 +enum dma_residue_granularity {
 +      DMA_RESIDUE_GRANULARITY_DESCRIPTOR = 0,
 +      DMA_RESIDUE_GRANULARITY_SEGMENT = 1,
 +      DMA_RESIDUE_GRANULARITY_BURST = 2,
 +};
 +
  /* struct dma_slave_caps - expose capabilities of a slave channel only
   *
   * @src_addr_widths: bit mask of src addr widths the channel supports
   *    should be checked by controller as well
   * @cmd_pause: true, if pause and thereby resume is supported
   * @cmd_terminate: true, if terminate cmd is supported
 + * @residue_granularity: granularity of the reported transfer residue
   */
  struct dma_slave_caps {
        u32 src_addr_widths;
        u32 directions;
        bool cmd_pause;
        bool cmd_terminate;
 +      enum dma_residue_granularity residue_granularity;
  };
  
  static inline const char *dma_chan_name(struct dma_chan *chan)
@@@ -1115,6 -1087,7 +1115,7 @@@ int dma_async_device_register(struct dm
  void dma_async_device_unregister(struct dma_device *device);
  void dma_run_dependencies(struct dma_async_tx_descriptor *tx);
  struct dma_chan *dma_get_slave_channel(struct dma_chan *chan);
+ struct dma_chan *dma_get_any_slave_channel(struct dma_device *device);
  struct dma_chan *net_dma_find_channel(void);
  #define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y)
  #define dma_request_slave_channel_compat(mask, x, y, dev, name) \
diff --combined sound/soc/tegra/Kconfig
index 65a85f542521563627be1fe02b4c22c6bfdea194,896292bb853f9565d2083adb491d6929f1225db4..9f9c1856f822588b60843765cb4e57ec1eef9176
@@@ -1,6 -1,8 +1,8 @@@
  config SND_SOC_TEGRA
        tristate "SoC Audio for the Tegra System-on-Chip"
        depends on (ARCH_TEGRA && TEGRA20_APB_DMA) || COMPILE_TEST
+       depends on COMMON_CLK
+       depends on RESET_CONTROLLER
        select REGMAP_MMIO
        select SND_SOC_GENERIC_DMAENGINE_PCM
        help
@@@ -116,13 -118,3 +118,13 @@@ config SND_SOC_TEGRA_ALC563
        help
          Say Y or M here if you want to add support for SoC audio on the
          Toshiba AC100 netbook.
 +
 +config SND_SOC_TEGRA_MAX98090
 +      tristate "SoC Audio support for Tegra boards using a MAX98090 codec"
 +      depends on SND_SOC_TEGRA && I2C && GPIOLIB
 +      select SND_SOC_TEGRA20_I2S if ARCH_TEGRA_2x_SOC
 +      select SND_SOC_TEGRA30_I2S if ARCH_TEGRA_3x_SOC
 +      select SND_SOC_MAX98090
 +      help
 +        Say Y or M here if you want to add support for SoC audio on Tegra
 +        boards using the MAX98090 codec, such as Venice2.
index 088518d7694ae95d09ebf795d1dc7cdd33fc9a64,d8b98d70ff41b8ef7362428c7ff7534bb2034186..cf5e1cfe818d9b6a8c4f980e4d5c9f23dacbe2c6
@@@ -313,7 -313,6 +313,6 @@@ static int tegra20_ac97_platform_probe(
  {
        struct tegra20_ac97 *ac97;
        struct resource *mem;
-       u32 of_dma[2];
        void __iomem *regs;
        int ret = 0;
  
                goto err_clk_put;
        }
  
-       if (of_property_read_u32_array(pdev->dev.of_node,
-                                      "nvidia,dma-request-selector",
-                                      of_dma, 2) < 0) {
-               dev_err(&pdev->dev, "No DMA resource\n");
-               ret = -ENODEV;
-               goto err_clk_put;
-       }
        ac97->reset_gpio = of_get_named_gpio(pdev->dev.of_node,
                                             "nvidia,codec-reset-gpio", 0);
        if (gpio_is_valid(ac97->reset_gpio)) {
        ac97->capture_dma_data.addr = mem->start + TEGRA20_AC97_FIFO_RX1;
        ac97->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
        ac97->capture_dma_data.maxburst = 4;
-       ac97->capture_dma_data.slave_id = of_dma[1];
  
        ac97->playback_dma_data.addr = mem->start + TEGRA20_AC97_FIFO_TX1;
        ac97->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
        ac97->playback_dma_data.maxburst = 4;
-       ac97->playback_dma_data.slave_id = of_dma[1];
  
        ret = tegra_asoc_utils_init(&ac97->util_data, &pdev->dev);
        if (ret)
        ret = snd_soc_set_ac97_ops(&tegra20_ac97_ops);
        if (ret) {
                dev_err(&pdev->dev, "Failed to set AC'97 ops: %d\n", ret);
 -              goto err_asoc_utils_fini;
 +              goto err_clk_disable_unprepare;
        }
  
        ret = snd_soc_register_component(&pdev->dev, &tegra20_ac97_component,
        if (ret) {
                dev_err(&pdev->dev, "Could not register DAI: %d\n", ret);
                ret = -ENOMEM;
 -              goto err_asoc_utils_fini;
 +              goto err_clk_disable_unprepare;
        }
  
        ret = tegra_pcm_platform_register(&pdev->dev);
  
  err_unregister_component:
        snd_soc_unregister_component(&pdev->dev);
 +err_clk_disable_unprepare:
 +      clk_disable_unprepare(ac97->clk_ac97);
  err_asoc_utils_fini:
        tegra_asoc_utils_fini(&ac97->util_data);
  err_clk_put:
index 8c819f8114708f7a94e33929a04ebecbdf3e2ffc,1dc869c475e7a561240f2ea1664b140f5b916786..42c1f6bfaf2e5bb2a4f2df89269be672b26e377c
@@@ -74,7 -74,7 +74,7 @@@ static int tegra20_i2s_set_fmt(struct s
                                unsigned int fmt)
  {
        struct tegra20_i2s *i2s = snd_soc_dai_get_drvdata(dai);
 -      unsigned int mask, val;
 +      unsigned int mask = 0, val = 0;
  
        switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
        case SND_SOC_DAIFMT_NB_NF:
                return -EINVAL;
        }
  
 -      mask = TEGRA20_I2S_CTRL_MASTER_ENABLE;
 +      mask |= TEGRA20_I2S_CTRL_MASTER_ENABLE;
        switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
        case SND_SOC_DAIFMT_CBS_CFS:
 -              val = TEGRA20_I2S_CTRL_MASTER_ENABLE;
 +              val |= TEGRA20_I2S_CTRL_MASTER_ENABLE;
                break;
        case SND_SOC_DAIFMT_CBM_CFM:
                break;
@@@ -339,9 -339,7 +339,7 @@@ static const struct regmap_config tegra
  static int tegra20_i2s_platform_probe(struct platform_device *pdev)
  {
        struct tegra20_i2s *i2s;
-       struct resource *mem, *memregion, *dmareq;
-       u32 of_dma[2];
-       u32 dma_ch;
+       struct resource *mem, *memregion;
        void __iomem *regs;
        int ret;
  
                goto err_clk_put;
        }
  
-       dmareq = platform_get_resource(pdev, IORESOURCE_DMA, 0);
-       if (!dmareq) {
-               if (of_property_read_u32_array(pdev->dev.of_node,
-                                       "nvidia,dma-request-selector",
-                                       of_dma, 2) < 0) {
-                       dev_err(&pdev->dev, "No DMA resource\n");
-                       ret = -ENODEV;
-                       goto err_clk_put;
-               }
-               dma_ch = of_dma[1];
-       } else {
-               dma_ch = dmareq->start;
-       }
        memregion = devm_request_mem_region(&pdev->dev, mem->start,
                                            resource_size(mem), DRV_NAME);
        if (!memregion) {
        i2s->capture_dma_data.addr = mem->start + TEGRA20_I2S_FIFO2;
        i2s->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
        i2s->capture_dma_data.maxburst = 4;
-       i2s->capture_dma_data.slave_id = dma_ch;
  
        i2s->playback_dma_data.addr = mem->start + TEGRA20_I2S_FIFO1;
        i2s->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
        i2s->playback_dma_data.maxburst = 4;
-       i2s->playback_dma_data.slave_id = dma_ch;
  
        pm_runtime_enable(&pdev->dev);
        if (!pm_runtime_enabled(&pdev->dev)) {
index 02247fee1cf7e1450fb4bbcdf2e58cf5ee76c7e8,362e8f728ddfe1334af25c8ff9d7b3b8ded6c706..49ad9366add86b008823f6091315d74d78f13aeb
@@@ -73,52 -73,11 +73,11 @@@ static int tegra30_i2s_runtime_resume(s
        return 0;
  }
  
- static int tegra30_i2s_startup(struct snd_pcm_substream *substream,
-                       struct snd_soc_dai *dai)
- {
-       struct tegra30_i2s *i2s = snd_soc_dai_get_drvdata(dai);
-       int ret;
-       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-               ret = tegra30_ahub_allocate_tx_fifo(&i2s->playback_fifo_cif,
-                                       &i2s->playback_dma_data.addr,
-                                       &i2s->playback_dma_data.slave_id);
-               i2s->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
-               i2s->playback_dma_data.maxburst = 4;
-               tegra30_ahub_set_rx_cif_source(i2s->playback_i2s_cif,
-                                              i2s->playback_fifo_cif);
-       } else {
-               ret = tegra30_ahub_allocate_rx_fifo(&i2s->capture_fifo_cif,
-                                       &i2s->capture_dma_data.addr,
-                                       &i2s->capture_dma_data.slave_id);
-               i2s->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
-               i2s->capture_dma_data.maxburst = 4;
-               tegra30_ahub_set_rx_cif_source(i2s->capture_fifo_cif,
-                                              i2s->capture_i2s_cif);
-       }
-       return ret;
- }
- static void tegra30_i2s_shutdown(struct snd_pcm_substream *substream,
-                       struct snd_soc_dai *dai)
- {
-       struct tegra30_i2s *i2s = snd_soc_dai_get_drvdata(dai);
-       if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-               tegra30_ahub_unset_rx_cif_source(i2s->playback_i2s_cif);
-               tegra30_ahub_free_tx_fifo(i2s->playback_fifo_cif);
-       } else {
-               tegra30_ahub_unset_rx_cif_source(i2s->capture_fifo_cif);
-               tegra30_ahub_free_rx_fifo(i2s->capture_fifo_cif);
-       }
- }
  static int tegra30_i2s_set_fmt(struct snd_soc_dai *dai,
                                unsigned int fmt)
  {
        struct tegra30_i2s *i2s = snd_soc_dai_get_drvdata(dai);
 -      unsigned int mask, val;
 +      unsigned int mask = 0, val = 0;
  
        switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
        case SND_SOC_DAIFMT_NB_NF:
                return -EINVAL;
        }
  
 -      mask = TEGRA30_I2S_CTRL_MASTER_ENABLE;
 +      mask |= TEGRA30_I2S_CTRL_MASTER_ENABLE;
        switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
        case SND_SOC_DAIFMT_CBS_CFS:
 -              val = TEGRA30_I2S_CTRL_MASTER_ENABLE;
 +              val |= TEGRA30_I2S_CTRL_MASTER_ENABLE;
                break;
        case SND_SOC_DAIFMT_CBM_CFM:
                break;
@@@ -317,8 -276,6 +276,6 @@@ static int tegra30_i2s_probe(struct snd
  }
  
  static struct snd_soc_dai_ops tegra30_i2s_dai_ops = {
-       .startup        = tegra30_i2s_startup,
-       .shutdown       = tegra30_i2s_shutdown,
        .set_fmt        = tegra30_i2s_set_fmt,
        .hw_params      = tegra30_i2s_hw_params,
        .trigger        = tegra30_i2s_trigger,
@@@ -499,15 -456,51 +456,51 @@@ static int tegra30_i2s_platform_probe(s
                        goto err_pm_disable;
        }
  
+       i2s->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
+       i2s->playback_dma_data.maxburst = 4;
+       ret = tegra30_ahub_allocate_tx_fifo(&i2s->playback_fifo_cif,
+                                           i2s->playback_dma_chan,
+                                           sizeof(i2s->playback_dma_chan),
+                                           &i2s->playback_dma_data.addr);
+       if (ret) {
+               dev_err(&pdev->dev, "Could not alloc TX FIFO: %d\n", ret);
+               goto err_suspend;
+       }
+       ret = tegra30_ahub_set_rx_cif_source(i2s->playback_i2s_cif,
+                                            i2s->playback_fifo_cif);
+       if (ret) {
+               dev_err(&pdev->dev, "Could not route TX FIFO: %d\n", ret);
+               goto err_free_tx_fifo;
+       }
+       i2s->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
+       i2s->capture_dma_data.maxburst = 4;
+       ret = tegra30_ahub_allocate_rx_fifo(&i2s->capture_fifo_cif,
+                                           i2s->capture_dma_chan,
+                                           sizeof(i2s->capture_dma_chan),
+                                           &i2s->capture_dma_data.addr);
+       if (ret) {
+               dev_err(&pdev->dev, "Could not alloc RX FIFO: %d\n", ret);
+               goto err_unroute_tx_fifo;
+       }
+       ret = tegra30_ahub_set_rx_cif_source(i2s->capture_fifo_cif,
+                                            i2s->capture_i2s_cif);
+       if (ret) {
+               dev_err(&pdev->dev, "Could not route TX FIFO: %d\n", ret);
+               goto err_free_rx_fifo;
+       }
        ret = snd_soc_register_component(&pdev->dev, &tegra30_i2s_component,
                                   &i2s->dai, 1);
        if (ret) {
                dev_err(&pdev->dev, "Could not register DAI: %d\n", ret);
                ret = -ENOMEM;
-               goto err_suspend;
+               goto err_unroute_rx_fifo;
        }
  
-       ret = tegra_pcm_platform_register(&pdev->dev);
+       ret = tegra_pcm_platform_register_with_chan_names(&pdev->dev,
+                               &i2s->dma_config, i2s->playback_dma_chan,
+                               i2s->capture_dma_chan);
        if (ret) {
                dev_err(&pdev->dev, "Could not register PCM: %d\n", ret);
                goto err_unregister_component;
  
  err_unregister_component:
        snd_soc_unregister_component(&pdev->dev);
+ err_unroute_rx_fifo:
+       tegra30_ahub_unset_rx_cif_source(i2s->capture_fifo_cif);
+ err_free_rx_fifo:
+       tegra30_ahub_free_rx_fifo(i2s->capture_fifo_cif);
+ err_unroute_tx_fifo:
+       tegra30_ahub_unset_rx_cif_source(i2s->playback_i2s_cif);
+ err_free_tx_fifo:
+       tegra30_ahub_free_tx_fifo(i2s->playback_fifo_cif);
  err_suspend:
        if (!pm_runtime_status_suspended(&pdev->dev))
                tegra30_i2s_runtime_suspend(&pdev->dev);
@@@ -539,6 -540,12 +540,12 @@@ static int tegra30_i2s_platform_remove(
        tegra_pcm_platform_unregister(&pdev->dev);
        snd_soc_unregister_component(&pdev->dev);
  
+       tegra30_ahub_unset_rx_cif_source(i2s->capture_fifo_cif);
+       tegra30_ahub_free_rx_fifo(i2s->capture_fifo_cif);
+       tegra30_ahub_unset_rx_cif_source(i2s->playback_i2s_cif);
+       tegra30_ahub_free_tx_fifo(i2s->playback_fifo_cif);
        clk_put(i2s->clk_i2s);
  
        return 0;
index c09ffd18791b9de9b13713dc068ee5cb4d75e42d,7ce5c334a660ed043f8a8f1700cf1d5aa928a93a..93caed500565662450da8379dd640f268315860d
@@@ -42,6 -42,9 +42,6 @@@ static const struct snd_pcm_hardware te
        .info                   = SNDRV_PCM_INFO_MMAP |
                                  SNDRV_PCM_INFO_MMAP_VALID |
                                  SNDRV_PCM_INFO_INTERLEAVED,
 -      .formats                = SNDRV_PCM_FMTBIT_S16_LE,
 -      .channels_min           = 2,
 -      .channels_max           = 2,
        .period_bytes_min       = 1024,
        .period_bytes_max       = PAGE_SIZE,
        .periods_min            = 2,
@@@ -58,12 -61,23 +58,23 @@@ static const struct snd_dmaengine_pcm_c
  
  int tegra_pcm_platform_register(struct device *dev)
  {
-       return snd_dmaengine_pcm_register(dev, &tegra_dmaengine_pcm_config,
-                       SND_DMAENGINE_PCM_FLAG_NO_DT |
-                       SND_DMAENGINE_PCM_FLAG_COMPAT);
+       return snd_dmaengine_pcm_register(dev, &tegra_dmaengine_pcm_config, 0);
  }
  EXPORT_SYMBOL_GPL(tegra_pcm_platform_register);
  
+ int tegra_pcm_platform_register_with_chan_names(struct device *dev,
+                               struct snd_dmaengine_pcm_config *config,
+                               char *txdmachan, char *rxdmachan)
+ {
+       *config = tegra_dmaengine_pcm_config;
+       config->dma_dev = dev->parent;
+       config->chan_names[0] = txdmachan;
+       config->chan_names[1] = rxdmachan;
+       return snd_dmaengine_pcm_register(dev, config, 0);
+ }
+ EXPORT_SYMBOL_GPL(tegra_pcm_platform_register_with_chan_names);
  void tegra_pcm_platform_unregister(struct device *dev)
  {
        return snd_dmaengine_pcm_unregister(dev);