Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 2 May 2013 21:38:53 +0000 (14:38 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 2 May 2013 21:38:53 +0000 (14:38 -0700)
Pull i2c changes from Wolfram Sang:

 - an arbitration driver.  While the driver is quite simple, it caused
   discussion if we need additional arbitration on top of the one
   specified in the I2C standard.  Conclusion is that I accept a few
   generic mechanisms, but not very specific ones.

 - the core lost the detach_adapter() call.  It has no users anymore and
   was in the way for other cleanups.  attach_adapter() is sadly still
   there since there are users waiting to be converted.

 - the core gained a bus recovery infrastructure.  I2C defines a way to
   recover if the data line is stalled.  This mechanism is now in the
   core and drivers can now pass some data to make use of it.

 - bigger driver cleanups for designware, s3c2410

 - removing superfluous refcounting from drivers

 - removing Ben Dooks as second maintainer due to inactivity.  Thanks
   for all your work so far, Ben!

 - bugfixes, feature additions, devicetree fixups, simplifications...

* 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (38 commits)
  i2c: xiic: must always write 16-bit words to TX_FIFO
  i2c: octeon: use HZ in timeout value
  i2c: octeon: Fix i2c fail problem when a process is terminated by a signal
  i2c: designware-pci: drop superfluous {get|put}_device
  i2c: designware-plat: drop superfluous {get|put}_device
  i2c: davinci: drop superfluous {get|put}_device
  MAINTAINERS: Ben Dooks is inactive regarding I2C
  i2c: mux: Add i2c-arb-gpio-challenge 'mux' driver
  i2c: at91: convert to dma_request_slave_channel_compat()
  i2c: mxs: do error checking and handling in PIO mode
  i2c: mxs: remove races in PIO code
  i2c-designware: switch to use runtime PM autosuspend
  i2c-designware: use usleep_range() in the busy-loop
  i2c-designware: enable/disable the controller properly
  i2c-designware: use dynamic adapter numbering on Lynxpoint
  i2c-designware-pci: use managed functions pcim_* and devm_*
  i2c-designware-pci: use dev_err() instead of printk()
  i2c-designware: move to managed functions (devm_*)
  i2c: remove CONFIG_HOTPLUG ifdefs
  i2c: s3c2410: Add SMBus emulation for block read
  ...

1  2 
MAINTAINERS
arch/arm/mach-tegra/tegra.c
arch/arm/plat-samsung/devs.c
drivers/i2c/busses/i2c-designware-platdrv.c
drivers/i2c/busses/i2c-puv3.c
drivers/media/pci/bt8xx/bttv-i2c.c
drivers/net/ethernet/sfc/falcon.c
drivers/staging/media/go7007/go7007-driver.c

diff --combined MAINTAINERS
index b57e2765a34269b94de4f2012dbe9faa83092a07,1b3c1f63b0caa9ee48def0ac331f45385d6896f7..59d708f2924953814e5b6b9b4d7063435733e71b
@@@ -90,9 -90,6 +90,9 @@@ Descriptions of section entries
           F:   drivers/net/*   all files in drivers/net, but not below
           F:   */net/*         all files in "any top level directory"/net
           One pattern per line.  Multiple F: lines acceptable.
 +      N: Files and directories with regex patterns.
 +         N:   [^a-z]tegra     all files whose path contains the word tegra
 +         One pattern per line.  Multiple N: lines acceptable.
        X: Files and directories that are NOT maintained, same rules as F:
           Files exclusions are tested before file matches.
           Can be useful for excluding a specific subdirectory, for instance:
           X:   net/ipv6/
           matches all files in and below net excluding net/ipv6/
        K: Keyword perl extended regex pattern to match content in a
 -         patch or file, or an affected filename.  For instance:
 +         patch or file.  For instance:
           K: of_get_profile
 -            matches patch or file content, or filenames, that contain
 -            "of_get_profile"
 +            matches patches or files that contain "of_get_profile"
           K: \b(printk|pr_(info|err))\b
 -            matches patch or file content, or filenames, that contain one or
 -            more of the words printk, pr_info or pr_err
 +            matches patches or files that contain one or more of the words
 +            printk, pr_info or pr_err
           One regex pattern per line.  Multiple K: lines acceptable.
  
  Note: For the hard of thinking, this list is meant to remain in alphabetical
@@@ -1033,7 -1031,6 +1033,7 @@@ F:      drivers/mmc/host/msm_sdcc.
  F:    drivers/tty/serial/msm_serial.h
  F:    drivers/tty/serial/msm_serial.c
  F:    drivers/*/pm8???-*
 +F:    drivers/ssbi/
  F:    include/linux/mfd/pm8xxx/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/davidb/linux-msm.git
  S:    Maintained
@@@ -1767,7 -1764,7 +1767,7 @@@ F:      arch/arm/configs/bcm2835_defconfi
  F:    drivers/*/*bcm2835*
  
  BROADCOM TG3 GIGABIT ETHERNET DRIVER
 -M:    Matt Carlson <mcarlson@broadcom.com>
 +M:    Nithin Nayak Sujir <nsujir@broadcom.com>
  M:    Michael Chan <mchan@broadcom.com>
  L:    netdev@vger.kernel.org
  S:    Supported
@@@ -1889,7 -1886,7 +1889,7 @@@ F:      Documentation/video4linux/cafe_cci
  F:    drivers/media/platform/marvell-ccic/
  
  CAIF NETWORK LAYER
 -M:    Sjur Braendeland <sjur.brandeland@stericsson.com>
 +M:    Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
  L:    netdev@vger.kernel.org
  S:    Supported
  F:    Documentation/networking/caif/
@@@ -2203,34 -2200,12 +2203,34 @@@ F:   drivers/net/ethernet/ti/cpmac.
  
  CPU FREQUENCY DRIVERS
  M:    Rafael J. Wysocki <rjw@sisk.pl>
 +M:    Viresh Kumar <viresh.kumar@linaro.org>
  L:    cpufreq@vger.kernel.org
  L:    linux-pm@vger.kernel.org
  S:    Maintained
 +T:    git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
  F:    drivers/cpufreq/
  F:    include/linux/cpufreq.h
  
 +CPU FREQUENCY DRIVERS - ARM BIG LITTLE
 +M:    Viresh Kumar <viresh.kumar@linaro.org>
 +M:    Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
 +L:    cpufreq@vger.kernel.org
 +L:    linux-pm@vger.kernel.org
 +W:    http://www.arm.com/products/processors/technologies/biglittleprocessing.php
 +S:    Maintained
 +F:    drivers/cpufreq/arm_big_little.h
 +F:    drivers/cpufreq/arm_big_little.c
 +F:    drivers/cpufreq/arm_big_little_dt.c
 +
 +CPUIDLE DRIVERS
 +M:    Rafael J. Wysocki <rjw@sisk.pl>
 +M:    Daniel Lezcano <daniel.lezcano@linaro.org>
 +L:    linux-pm@vger.kernel.org
 +S:    Maintained
 +T:    git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
 +F:    drivers/cpuidle/*
 +F:    include/linux/cpuidle.h
 +
  CPUID/MSR DRIVER
  M:    "H. Peter Anvin" <hpa@zytor.com>
  S:    Maintained
@@@ -2309,7 -2284,7 +2309,7 @@@ L:      linux-media@vger.kernel.or
  T:    git git://linuxtv.org/media_tree.git
  W:    http://linuxtv.org
  S:    Maintained
 -F:    drivers/media/i2c/cx2341x*
 +F:    drivers/media/common/cx2341x*
  F:    include/media/cx2341x*
  
  CX88 VIDEO4LINUX DRIVER
@@@ -2392,16 -2367,6 +2392,16 @@@ W:    http://www.cyclades.com
  S:    Orphan
  F:    drivers/net/wan/pc300*
  
 +CYPRESS_FIRMWARE MEDIA DRIVER
 +M:    Antti Palosaari <crope@iki.fi>
 +L:    linux-media@vger.kernel.org
 +W:    http://linuxtv.org/
 +W:    http://palosaari.fi/linux/
 +Q:    http://patchwork.linuxtv.org/project/linux-media/list/
 +T:    git git://linuxtv.org/anttip/media_tree.git
 +S:    Maintained
 +F:    drivers/media/common/cypress_firmware*
 +
  CYTTSP TOUCHSCREEN DRIVER
  M:    Javier Martinez Canillas <javier@dowhile0.org>
  L:    linux-input@vger.kernel.org
@@@ -2476,7 -2441,9 +2476,7 @@@ S:      Maintaine
  F:    drivers/platform/x86/dell-laptop.c
  
  DELL LAPTOP SMM DRIVER
 -M:    Massimo Dal Zotto <dz@debian.org>
 -W:    http://www.debian.org/~dz/i8k/
 -S:    Maintained
 +S:    Orphan
  F:    drivers/char/i8k.c
  F:    include/uapi/linux/i8k.h
  
@@@ -2491,12 -2458,6 +2491,12 @@@ M:    Matthew Garrett <mjg59@srcf.ucam.org
  S:    Maintained
  F:    drivers/platform/x86/dell-wmi.c
  
 +DESIGNWARE USB2 DRD IP DRIVER
 +M:    Paul Zimmerman <paulz@synopsys.com>
 +L:    linux-usb@vger.kernel.org
 +S:    Maintained
 +F:    drivers/staging/dwc2/
 +
  DESIGNWARE USB3 DRD IP DRIVER
  M:    Felipe Balbi <balbi@ti.com>
  L:    linux-usb@vger.kernel.org
@@@ -2770,7 -2731,7 +2770,7 @@@ T:      git git://linuxtv.org/media_tree.gi
  S:    Maintained
  F:    drivers/media/usb/dvb-usb/cxusb*
  
 -DVB_USB_CYPRESS_FIRMWARE MEDIA DRIVER
 +DVB_USB_EC168 MEDIA DRIVER
  M:    Antti Palosaari <crope@iki.fi>
  L:    linux-media@vger.kernel.org
  W:    http://linuxtv.org/
@@@ -2778,16 -2739,17 +2778,16 @@@ W:   http://palosaari.fi/linux
  Q:    http://patchwork.linuxtv.org/project/linux-media/list/
  T:    git git://linuxtv.org/anttip/media_tree.git
  S:    Maintained
 -F:    drivers/media/usb/dvb-usb-v2/cypress_firmware*
 +F:    drivers/media/usb/dvb-usb-v2/ec168*
  
 -DVB_USB_EC168 MEDIA DRIVER
 +DVB_USB_GL861 MEDIA DRIVER
  M:    Antti Palosaari <crope@iki.fi>
  L:    linux-media@vger.kernel.org
  W:    http://linuxtv.org/
 -W:    http://palosaari.fi/linux/
  Q:    http://patchwork.linuxtv.org/project/linux-media/list/
  T:    git git://linuxtv.org/anttip/media_tree.git
  S:    Maintained
 -F:    drivers/media/usb/dvb-usb-v2/ec168*
 +F:    drivers/media/usb/dvb-usb-v2/gl861*
  
  DVB_USB_MXL111SF MEDIA DRIVER
  M:    Michael Krufky <mkrufky@linuxtv.org>
@@@ -3025,18 -2987,9 +3025,18 @@@ F:    arch/ia64/kernel/efi.
  F:    arch/x86/boot/compressed/eboot.[ch]
  F:    arch/x86/include/asm/efi.h
  F:    arch/x86/platform/efi/*
 -F:    drivers/firmware/efivars.c
 +F:    drivers/firmware/efi/*
  F:    include/linux/efi*.h
  
 +EFI VARIABLE FILESYSTEM
 +M:    Matthew Garrett <matthew.garrett@nebula.com>
 +M:    Jeremy Kerr <jk@ozlabs.org>
 +M:    Matt Fleming <matt.fleming@intel.com>
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mfleming/efi.git
 +L:    linux-efi@vger.kernel.org
 +S:    Maintained
 +F:    fs/efivarfs/
 +
  EFIFB FRAMEBUFFER DRIVER
  L:    linux-fbdev@vger.kernel.org
  M:    Peter Jones <pjones@redhat.com>
@@@ -3289,12 -3242,6 +3289,12 @@@ F:    Documentation/firmware_class
  F:    drivers/base/firmware*.c
  F:    include/linux/firmware.h
  
 +FLASHSYSTEM DRIVER (IBM FlashSystem 70/80 PCI SSD Flash Card)
 +M:    Joshua Morris <josh.h.morris@us.ibm.com>
 +M:    Philip Kelleher <pjk1939@linux.vnet.ibm.com>
 +S:    Maintained
 +F:    drivers/block/rsxx/
 +
  FLOPPY DRIVER
  M:    Jiri Kosina <jkosina@suse.cz>
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/floppy.git
@@@ -3555,7 -3502,7 +3555,7 @@@ F:      drivers/isdn/gigaset
  F:    include/uapi/linux/gigaset_dev.h
  
  GPIO SUBSYSTEM
 -M:    Grant Likely <grant.likely@secretlab.ca>
 +M:    Grant Likely <grant.likely@linaro.org>
  M:    Linus Walleij <linus.walleij@linaro.org>
  S:    Maintained
  T:    git git://git.secretlab.ca/git/linux-2.6.git
@@@ -3640,14 -3587,6 +3640,14 @@@ W:    http://www.kernel.org/pub/linux/kern
  S:    Maintained
  F:    drivers/platform/x86/hdaps.c
  
 +HDPVR USB VIDEO ENCODER DRIVER
 +M:    Hans Verkuil <hverkuil@xs4all.nl>
 +L:    linux-media@vger.kernel.org
 +T:    git git://linuxtv.org/media_tree.git
 +W:    http://linuxtv.org
 +S:    Odd Fixes
 +F:    drivers/media/usb/hdpvr
 +
  HWPOISON MEMORY FAILURE HANDLING
  M:    Andi Kleen <andi@firstfloor.org>
  L:    linux-mm@kvack.org
@@@ -3919,7 -3858,6 +3919,6 @@@ F:      drivers/i2c/i2c-stub.
  
  I2C SUBSYSTEM
  M:    Wolfram Sang <wsa@the-dreams.de>
- M:    "Ben Dooks (embedded platforms)" <ben-linux@fluff.org>
  L:    linux-i2c@vger.kernel.org
  W:    http://i2c.wiki.kernel.org/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git
@@@ -4396,7 -4334,7 +4395,7 @@@ F:      drivers/irqchip
  
  IRQ DOMAINS (IRQ NUMBER MAPPING LIBRARY)
  M:    Benjamin Herrenschmidt <benh@kernel.crashing.org>
 -M:    Grant Likely <grant.likely@secretlab.ca>
 +M:    Grant Likely <grant.likely@linaro.org>
  T:    git git://git.secretlab.ca/git/linux-2.6.git irqdomain/next
  S:    Maintained
  F:    Documentation/IRQ-domain.txt
@@@ -4477,16 -4415,6 +4476,16 @@@ Q:    http://patchwork.linuxtv.org/project
  S:    Maintained
  F:    drivers/media/dvb-frontends/it913x-fe*
  
 +IT913X MEDIA DRIVER
 +M:    Antti Palosaari <crope@iki.fi>
 +L:    linux-media@vger.kernel.org
 +W:    http://linuxtv.org/
 +W:    http://palosaari.fi/linux/
 +Q:    http://patchwork.linuxtv.org/project/linux-media/list/
 +T:    git git://linuxtv.org/anttip/media_tree.git
 +S:    Maintained
 +F:    drivers/media/tuners/it913x*
 +
  IVTV VIDEO4LINUX DRIVER
  M:    Andy Walls <awalls@md.metrocast.net>
  L:    ivtv-devel@ivtvdriver.org (moderated for non-subscribers)
@@@ -4893,8 -4821,11 +4892,8 @@@ F:     arch/powerpc/platforms/40x
  F:    arch/powerpc/platforms/44x/
  
  LINUX FOR POWERPC EMBEDDED XILINX VIRTEX
 -M:    Grant Likely <grant.likely@secretlab.ca>
 -W:    http://wiki.secretlab.ca/index.php/Linux_on_Xilinx_Virtex
  L:    linuxppc-dev@lists.ozlabs.org
 -T:    git git://git.secretlab.ca/git/linux-2.6.git
 -S:    Maintained
 +S:    Unmaintained
  F:    arch/powerpc/*/*virtex*
  F:    arch/powerpc/*/*/*virtex*
  
@@@ -5003,12 -4934,6 +5002,12 @@@ W:    logfs.or
  S:    Maintained
  F:    fs/logfs/
  
 +LPC32XX MACHINE SUPPORT
 +M:    Roland Stigge <stigge@antcom.de>
 +L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 +S:    Maintained
 +F:    arch/arm/mach-lpc32xx/
 +
  LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI)
  M:    Nagalakshmi Nandigama <Nagalakshmi.Nandigama@lsi.com>
  M:    Sreekanth Reddy <Sreekanth.Reddy@lsi.com>
@@@ -5133,8 -5058,9 +5132,8 @@@ S:      Maintaine
  F:    drivers/net/ethernet/marvell/sk*
  
  MARVELL LIBERTAS WIRELESS DRIVER
 -M:    Dan Williams <dcbw@redhat.com>
  L:    libertas-dev@lists.infradead.org
 -S:    Maintained
 +S:    Orphan
  F:    drivers/net/wireless/libertas/
  
  MARVELL MV643XX ETHERNET DRIVER
@@@ -5474,13 -5400,6 +5473,13 @@@ L:    linux-scsi@vger.kernel.or
  S:    Maintained
  F:    drivers/scsi/NCR_D700.*
  
 +NCT6775 HARDWARE MONITOR DRIVER
 +M:    Guenter Roeck <linux@roeck-us.net>
 +L:    lm-sensors@lm-sensors.org
 +S:    Maintained
 +F:    Documentation/hwmon/nct6775
 +F:    drivers/hwmon/nct6775.c
 +
  NETEFFECT IWARP RNIC DRIVER (IW_NES)
  M:    Faisal Latif <faisal.latif@intel.com>
  L:    linux-rdma@vger.kernel.org
@@@ -5643,7 -5562,6 +5642,7 @@@ F:      include/uapi/linux/if_
  F:    include/uapi/linux/netdevice.h
  
  NETXEN (1/10) GbE SUPPORT
 +M:    Manish Chopra <manish.chopra@qlogic.com>
  M:    Sony Chacko <sony.chacko@qlogic.com>
  M:    Rajesh Borundia <rajesh.borundia@qlogic.com>
  L:    netdev@vger.kernel.org
@@@ -5764,7 -5682,7 +5763,7 @@@ S:      Maintaine
  F:    arch/arm/*omap*/*clock*
  
  OMAP POWER MANAGEMENT SUPPORT
 -M:    Kevin Hilman <khilman@ti.com>
 +M:    Kevin Hilman <khilman@deeprootsystems.com>
  L:    linux-omap@vger.kernel.org
  S:    Maintained
  F:    arch/arm/*omap*/*pm*
@@@ -5858,7 -5776,7 +5857,7 @@@ F:      arch/arm/*omap*/usb
  
  OMAP GPIO DRIVER
  M:    Santosh Shilimkar <santosh.shilimkar@ti.com>
 -M:    Kevin Hilman <khilman@ti.com>
 +M:    Kevin Hilman <khilman@deeprootsystems.com>
  L:    linux-omap@vger.kernel.org
  S:    Maintained
  F:    drivers/gpio/gpio-omap.c
@@@ -5912,7 -5830,7 +5911,7 @@@ F:      Documentation/i2c/busses/i2c-ocore
  F:    drivers/i2c/busses/i2c-ocores.c
  
  OPEN FIRMWARE AND FLATTENED DEVICE TREE
 -M:    Grant Likely <grant.likely@secretlab.ca>
 +M:    Grant Likely <grant.likely@linaro.org>
  M:    Rob Herring <rob.herring@calxeda.com>
  L:    devicetree-discuss@lists.ozlabs.org (moderated for non-subscribers)
  W:    http://fdt.secretlab.ca
@@@ -6267,7 -6185,7 +6266,7 @@@ S:      Supporte
  F:    drivers/scsi/pmcraid.*
  
  PMC SIERRA PM8001 DRIVER
 -M:    jack_wang@usish.com
 +M:    xjtuwjp@gmail.com
  M:    lindar_liu@usish.com
  L:    linux-scsi@vger.kernel.org
  S:    Supported
@@@ -6290,7 -6208,7 +6289,7 @@@ F:      include/linux/power_supply.
  F:    drivers/power/
  
  PNP SUPPORT
 -M:    Adam Belay <abelay@mit.edu>
 +M:    Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  M:    Bjorn Helgaas <bhelgaas@google.com>
  S:    Maintained
  F:    drivers/pnp/
@@@ -6400,12 -6318,11 +6399,12 @@@ S:   Maintaine
  T:    git git://git.infradead.org/users/cbou/linux-pstore.git
  F:    fs/pstore/
  F:    include/linux/pstore*
 -F:    drivers/firmware/efivars.c
 +F:    drivers/firmware/efi/efi-pstore.c
  F:    drivers/acpi/apei/erst.c
  
  PTP HARDWARE CLOCK SUPPORT
  M:    Richard Cochran <richardcochran@gmail.com>
 +L:    netdev@vger.kernel.org
  S:    Maintained
  W:    http://linuxptp.sourceforge.net/
  F:    Documentation/ABI/testing/sysfs-ptp
@@@ -6537,7 -6454,6 +6536,7 @@@ S:      Supporte
  F:    drivers/net/ethernet/qlogic/qlcnic/
  
  QLOGIC QLGE 10Gb ETHERNET DRIVER
 +M:    Shahed Shaikh <shahed.shaikh@qlogic.com>
  M:    Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
  M:    Ron Mercer <ron.mercer@qlogic.com>
  M:    linux-driver@qlogic.com
@@@ -6634,6 -6550,12 +6633,6 @@@ S:     Maintaine
  F:    Documentation/blockdev/ramdisk.txt
  F:    drivers/block/brd.c
  
 -RAMSAM DRIVER (IBM RamSan 70/80 PCI SSD Flash Card)
 -M:    Joshua Morris <josh.h.morris@us.ibm.com>
 -M:    Philip Kelleher <pjk1939@linux.vnet.ibm.com>
 -S:    Maintained
 -F:    drivers/block/rsxx/
 -
  RANDOM NUMBER DRIVER
  M:    Theodore Ts'o" <tytso@mit.edu>
  S:    Maintained
@@@ -6702,7 -6624,7 +6701,7 @@@ S:      Supporte
  F:    fs/reiserfs/
  
  REGISTER MAP ABSTRACTION
 -M:    Mark Brown <broonie@opensource.wolfsonmicro.com>
 +M:    Mark Brown <broonie@kernel.org>
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git
  S:    Supported
  F:    drivers/base/regmap/
@@@ -6763,16 -6685,6 +6762,16 @@@ T:    git git://linuxtv.org/anttip/media_t
  S:    Maintained
  F:    drivers/media/dvb-frontends/rtl2830*
  
 +RTL2832 MEDIA DRIVER
 +M:    Antti Palosaari <crope@iki.fi>
 +L:    linux-media@vger.kernel.org
 +W:    http://linuxtv.org/
 +W:    http://palosaari.fi/linux/
 +Q:    http://patchwork.linuxtv.org/project/linux-media/list/
 +T:    git git://linuxtv.org/anttip/media_tree.git
 +S:    Maintained
 +F:    drivers/media/dvb-frontends/rtl2832*
 +
  RTL8180 WIRELESS DRIVER
  M:    "John W. Linville" <linville@tuxdriver.com>
  L:    linux-wireless@vger.kernel.org
@@@ -6875,7 -6787,7 +6874,7 @@@ L:      linux-media@vger.kernel.or
  W:    http://linuxtv.org
  T:    git git://linuxtv.org/media_tree.git
  S:    Odd fixes
 -F:    Documentation/video4linux/saa7134/
 +F:    Documentation/video4linux/*.saa7134
  F:    drivers/media/pci/saa7134/
  
  SAA7146 VIDEO4LINUX-2 DRIVER
@@@ -6968,8 -6880,9 +6967,8 @@@ F:      drivers/clocksourc
  
  TLG2300 VIDEO4LINUX-2 DRIVER
  M:    Huang Shijie <shijie8@gmail.com>
 -M:    Kang Yong <kangyong@telegent.com>
 -M:    Zhang Xiaobing <xbzhang@telegent.com>
 -S:    Supported
 +M:    Hans Verkuil <hverkuil@xs4all.nl>
 +S:    Odd Fixes
  F:    drivers/media/usb/tlg2300
  
  SC1200 WDT DRIVER
@@@ -7037,6 -6950,7 +7036,6 @@@ F:      drivers/scsi/st
  
  SCTP PROTOCOL
  M:    Vlad Yasevich <vyasevich@gmail.com>
 -M:    Sridhar Samudrala <sri@us.ibm.com>
  M:    Neil Horman <nhorman@tuxdriver.com>
  L:    linux-sctp@vger.kernel.org
  W:    http://lksctp.sourceforge.net
@@@ -7215,43 -7129,17 +7214,43 @@@ F:   drivers/media/radio/si470x/radio-si4
  F:    drivers/media/radio/si470x/radio-si470x.h
  F:    drivers/media/radio/si470x/radio-si470x-usb.c
  
 +SI4713 FM RADIO TRANSMITTER I2C DRIVER
 +M:    Eduardo Valentin <edubezval@gmail.com>
 +L:    linux-media@vger.kernel.org
 +T:    git git://linuxtv.org/media_tree.git
 +W:    http://linuxtv.org
 +S:    Odd Fixes
 +F:    drivers/media/radio/si4713-i2c.?
 +
 +SI4713 FM RADIO TRANSMITTER PLATFORM DRIVER
 +M:    Eduardo Valentin <edubezval@gmail.com>
 +L:    linux-media@vger.kernel.org
 +T:    git git://linuxtv.org/media_tree.git
 +W:    http://linuxtv.org
 +S:    Odd Fixes
 +F:    drivers/media/radio/radio-si4713.h
 +
 +SIANO DVB DRIVER
 +M:    Mauro Carvalho Chehab <mchehab@redhat.com>
 +L:    linux-media@vger.kernel.org
 +W:    http://linuxtv.org
 +T:    git git://linuxtv.org/media_tree.git
 +S:    Odd fixes
 +F:    drivers/media/common/siano/
 +F:    drivers/media/dvb/siano/
 +F:    drivers/media/usb/siano/
 +F:    drivers/media/mmc/siano
 +
  SH_VEU V4L2 MEM2MEM DRIVER
  M:    Guennadi Liakhovetski <g.liakhovetski@gmx.de>
  L:    linux-media@vger.kernel.org
  S:    Maintained
  F:    drivers/media/platform/sh_veu.c
 -F:    include/media/sh_veu.h
  
  SH_VOU V4L2 OUTPUT DRIVER
  M:    Guennadi Liakhovetski <g.liakhovetski@gmx.de>
  L:    linux-media@vger.kernel.org
 -S:    Maintained
 +S:    Odd Fixes
  F:    drivers/media/platform/sh_vou.c
  F:    include/media/sh_vou.h
  
@@@ -7284,7 -7172,7 +7283,7 @@@ F:      arch/arm/mach-s3c2410/bast-irq.
  
  TI DAVINCI MACHINE SUPPORT
  M:    Sekhar Nori <nsekhar@ti.com>
 -M:    Kevin Hilman <khilman@ti.com>
 +M:    Kevin Hilman <khilman@deeprootsystems.com>
  L:    davinci-linux-open-source@linux.davincidsp.com (moderated for non-subscribers)
  T:    git git://gitorious.org/linux-davinci/linux-davinci.git
  Q:    http://patchwork.kernel.org/project/linux-davinci/list/
@@@ -7293,13 -7181,14 +7292,13 @@@ F:   arch/arm/mach-davinc
  F:    drivers/i2c/busses/i2c-davinci.c
  
  TI DAVINCI SERIES MEDIA DRIVER
 -M:    Manjunath Hadli <manjunath.hadli@ti.com>
 -M:    Prabhakar Lad <prabhakar.lad@ti.com>
 +M:    Lad, Prabhakar <prabhakar.csengg@gmail.com>
  L:    linux-media@vger.kernel.org
  L:    davinci-linux-open-source@linux.davincidsp.com (moderated for non-subscribers)
  W:    http://linuxtv.org/
  Q:    http://patchwork.linuxtv.org/project/linux-media/list/
  T:    git git://linuxtv.org/mhadli/v4l-dvb-davinci_devices.git
 -S:    Supported
 +S:    Maintained
  F:    drivers/media/platform/davinci/
  F:    include/media/davinci/
  
@@@ -7484,7 -7373,7 +7483,7 @@@ F:      sound
  
  SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC)
  M:    Liam Girdwood <lgirdwood@gmail.com>
 -M:    Mark Brown <broonie@opensource.wolfsonmicro.com>
 +M:    Mark Brown <broonie@kernel.org>
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
  L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
  W:    http://alsa-project.org/main/index.php/ASoC
@@@ -7572,11 -7461,11 +7571,11 @@@ S:   Maintaine
  F:    drivers/clk/spear/
  
  SPI SUBSYSTEM
 -M:    Grant Likely <grant.likely@secretlab.ca>
 -M:    Mark Brown <broonie@opensource.wolfsonmicro.com>
 +M:    Mark Brown <broonie@kernel.org>
 +M:    Grant Likely <grant.likely@linaro.org>
  L:    spi-devel-general@lists.sourceforge.net
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
  Q:    http://patchwork.kernel.org/project/spi-devel-general/list/
 -T:    git git://git.secretlab.ca/git/linux-2.6.git
  S:    Maintained
  F:    Documentation/spi/
  F:    drivers/spi/
@@@ -7671,11 -7560,6 +7670,11 @@@ M:    David Täht <d@teklibre.com
  S:    Odd Fixes
  F:    drivers/staging/frontier/
  
 +STAGING - GO7007 MPEG CODEC
 +M:    Hans Verkuil <hans.verkuil@cisco.com>
 +S:    Maintained
 +F:    drivers/staging/media/go7007/
 +
  STAGING - INDUSTRIAL IO
  M:    Jonathan Cameron <jic23@cam.ac.uk>
  L:    linux-iio@vger.kernel.org
@@@ -7726,8 -7610,8 +7725,8 @@@ S:      Odd Fixe
  F:    drivers/staging/sm7xxfb/
  
  STAGING - SOFTLOGIC 6x10 MPEG CODEC
 -M:    Ben Collins <bcollins@bluecherry.net>
 -S:    Odd Fixes
 +M:    Ismael Luceno <ismael.luceno@corp.bluecherry.net>
 +S:    Supported
  F:    drivers/staging/media/solo6x10/
  
  STAGING - SPEAKUP CONSOLE SPEECH DRIVER
@@@ -7821,10 -7705,9 +7820,10 @@@ F:    include/linux/swiotlb.
  
  SYNOPSYS ARC ARCHITECTURE
  M:    Vineet Gupta <vgupta@synopsys.com>
 -L:    linux-snps-arc@vger.kernel.org
  S:    Supported
  F:    arch/arc/
 +F:    Documentation/devicetree/bindings/arc/
 +F:    drivers/tty/serial/arc-uart.c
  
  SYSV FILESYSTEM
  M:    Christoph Hellwig <hch@infradead.org>
@@@ -7992,7 -7875,7 +7991,7 @@@ L:      linux-tegra@vger.kernel.or
  Q:    http://patchwork.ozlabs.org/project/linux-tegra/list/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra.git
  S:    Supported
 -K:    (?i)[^a-z]tegra
 +N:    [^a-z]tegra
  
  TEHUTI ETHERNET DRIVER
  M:    Andy Gospodarek <andy@greyhouse.net>
@@@ -8035,12 -7918,6 +8034,12 @@@ T:    git git://repo.or.cz/linux-2.6/linux
  S:    Maintained
  F:    drivers/platform/x86/thinkpad_acpi.c
  
 +TI BANDGAP AND THERMAL DRIVER
 +M:    Eduardo Valentin <eduardo.valentin@ti.com>
 +L:    linux-pm@vger.kernel.org
 +S:    Maintained
 +F:    drivers/staging/omap-thermal/
 +
  TI FLASH MEDIA INTERFACE DRIVER
  M:    Alex Dubov <oakad@yahoo.com>
  S:    Maintained
@@@ -8478,10 -8355,9 +8477,10 @@@ S:    Maintaine
  F:    drivers/usb/serial/option.c
  
  USB PEGASUS DRIVER
 -M:    Petko Manolov <petkan@users.sourceforge.net>
 +M:    Petko Manolov <petkan@nucleusys.com>
  L:    linux-usb@vger.kernel.org
  L:    netdev@vger.kernel.org
 +T:    git git://git.code.sf.net/p/pegasus2/git
  W:    http://pegasus2.sourceforge.net/
  S:    Maintained
  F:    drivers/net/usb/pegasus.*
@@@ -8501,10 -8377,9 +8500,10 @@@ S:    Supporte
  F:    drivers/usb/class/usblp.c
  
  USB RTL8150 DRIVER
 -M:    Petko Manolov <petkan@users.sourceforge.net>
 +M:    Petko Manolov <petkan@nucleusys.com>
  L:    linux-usb@vger.kernel.org
  L:    netdev@vger.kernel.org
 +T:    git git://git.code.sf.net/p/pegasus2/git
  W:    http://pegasus2.sourceforge.net/
  S:    Maintained
  F:    drivers/net/usb/rtl8150.c
@@@ -8638,7 -8513,7 +8637,7 @@@ F:      drivers/usb/gadget/*uvc*.
  F:    drivers/usb/gadget/webcam.c
  
  USB WIRELESS RNDIS DRIVER (rndis_wlan)
 -M:    Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
 +M:    Jussi Kivilinna <jussi.kivilinna@iki.fi>
  L:    linux-wireless@vger.kernel.org
  S:    Maintained
  F:    drivers/net/wireless/rndis_wlan.c
@@@ -8743,7 -8618,6 +8742,7 @@@ F:      drivers/virtio
  F:    drivers/net/virtio_net.c
  F:    drivers/block/virtio_blk.c
  F:    include/linux/virtio_*.h
 +F:    include/uapi/linux/virtio_*.h
  
  VIRTIO HOST (VHOST)
  M:    "Michael S. Tsirkin" <mst@redhat.com>
@@@ -8831,8 -8705,8 +8830,8 @@@ F:      drivers/scsi/vmw_pvscsi.
  F:    drivers/scsi/vmw_pvscsi.h
  
  VOLTAGE AND CURRENT REGULATOR FRAMEWORK
 -M:    Liam Girdwood <lrg@ti.com>
 -M:    Mark Brown <broonie@opensource.wolfsonmicro.com>
 +M:    Liam Girdwood <lgirdwood@gmail.com>
 +M:    Mark Brown <broonie@kernel.org>
  W:    http://opensource.wolfsonmicro.com/node/15
  W:    http://www.slimlogic.co.uk/?p=48
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/lrg/regulator.git
@@@ -9095,7 -8969,9 +9094,7 @@@ S:      Maintaine
  F:    drivers/net/ethernet/xilinx/xilinx_axienet*
  
  XILINX SYSTEMACE DRIVER
 -M:    Grant Likely <grant.likely@secretlab.ca>
 -W:    http://www.secretlab.ca/
 -S:    Maintained
 +S:    Unmaintained
  F:    drivers/block/xsysace.c
  
  XILINX UARTLITE SERIAL DRIVER
index 84deeab23ee7e6d7209d7389ce76a4cbd42cb70a,0000000000000000000000000000000000000000..9cf1ab17afeb9ddd7069ab0b7a1c56b3cc930e4d
mode 100644,000000..100644
--- /dev/null
@@@ -1,186 -1,0 +1,184 @@@
- #include <linux/i2c.h>
- #include <linux/i2c-tegra.h>
 +/*
 + * NVIDIA Tegra SoC device tree board support
 + *
 + * Copyright (C) 2011, 2013, NVIDIA Corporation
 + * Copyright (C) 2010 Secret Lab Technologies, Ltd.
 + * Copyright (C) 2010 Google, Inc.
 + *
 + * This software is licensed under the terms of the GNU General Public
 + * License version 2, as published by the Free Software Foundation, and
 + * may be copied, distributed, and modified under those terms.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + */
 +
 +#include <linux/clocksource.h>
 +#include <linux/kernel.h>
 +#include <linux/init.h>
 +#include <linux/platform_device.h>
 +#include <linux/serial_8250.h>
 +#include <linux/clk.h>
 +#include <linux/dma-mapping.h>
 +#include <linux/irqdomain.h>
 +#include <linux/of.h>
 +#include <linux/of_address.h>
 +#include <linux/of_fdt.h>
 +#include <linux/of_platform.h>
 +#include <linux/pda_power.h>
 +#include <linux/platform_data/tegra_usb.h>
 +#include <linux/io.h>
 +#include <linux/slab.h>
 +#include <linux/sys_soc.h>
 +#include <linux/usb/tegra_usb_phy.h>
 +
 +#include <asm/mach-types.h>
 +#include <asm/mach/arch.h>
 +#include <asm/mach/time.h>
 +#include <asm/setup.h>
 +
 +#include "board.h"
 +#include "common.h"
 +#include "fuse.h"
 +#include "iomap.h"
 +
 +static struct tegra_ehci_platform_data tegra_ehci1_pdata = {
 +      .operating_mode = TEGRA_USB_OTG,
 +      .power_down_on_bus_suspend = 1,
 +      .vbus_gpio = -1,
 +};
 +
 +static struct tegra_ulpi_config tegra_ehci2_ulpi_phy_config = {
 +      .reset_gpio = -1,
 +      .clk = "cdev2",
 +};
 +
 +static struct tegra_ehci_platform_data tegra_ehci2_pdata = {
 +      .phy_config = &tegra_ehci2_ulpi_phy_config,
 +      .operating_mode = TEGRA_USB_HOST,
 +      .power_down_on_bus_suspend = 1,
 +      .vbus_gpio = -1,
 +};
 +
 +static struct tegra_ehci_platform_data tegra_ehci3_pdata = {
 +      .operating_mode = TEGRA_USB_HOST,
 +      .power_down_on_bus_suspend = 1,
 +      .vbus_gpio = -1,
 +};
 +
 +static struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = {
 +      OF_DEV_AUXDATA("nvidia,tegra20-ehci", 0xC5000000, "tegra-ehci.0",
 +                     &tegra_ehci1_pdata),
 +      OF_DEV_AUXDATA("nvidia,tegra20-ehci", 0xC5004000, "tegra-ehci.1",
 +                     &tegra_ehci2_pdata),
 +      OF_DEV_AUXDATA("nvidia,tegra20-ehci", 0xC5008000, "tegra-ehci.2",
 +                     &tegra_ehci3_pdata),
 +      {}
 +};
 +
 +static void __init tegra_dt_init(void)
 +{
 +      struct soc_device_attribute *soc_dev_attr;
 +      struct soc_device *soc_dev;
 +      struct device *parent = NULL;
 +
 +      soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
 +      if (!soc_dev_attr)
 +              goto out;
 +
 +      soc_dev_attr->family = kasprintf(GFP_KERNEL, "Tegra");
 +      soc_dev_attr->revision = kasprintf(GFP_KERNEL, "%d", tegra_revision);
 +      soc_dev_attr->soc_id = kasprintf(GFP_KERNEL, "%d", tegra_chip_id);
 +
 +      soc_dev = soc_device_register(soc_dev_attr);
 +      if (IS_ERR(soc_dev)) {
 +              kfree(soc_dev_attr->family);
 +              kfree(soc_dev_attr->revision);
 +              kfree(soc_dev_attr->soc_id);
 +              kfree(soc_dev_attr);
 +              goto out;
 +      }
 +
 +      parent = soc_device_to_device(soc_dev);
 +
 +      /*
 +       * Finished with the static registrations now; fill in the missing
 +       * devices
 +       */
 +out:
 +      of_platform_populate(NULL, of_default_bus_match_table,
 +                              tegra20_auxdata_lookup, parent);
 +}
 +
 +static void __init trimslice_init(void)
 +{
 +#ifdef CONFIG_TEGRA_PCI
 +      int ret;
 +
 +      ret = tegra_pcie_init(true, true);
 +      if (ret)
 +              pr_err("tegra_pci_init() failed: %d\n", ret);
 +#endif
 +}
 +
 +static void __init harmony_init(void)
 +{
 +#ifdef CONFIG_TEGRA_PCI
 +      int ret;
 +
 +      ret = harmony_pcie_init();
 +      if (ret)
 +              pr_err("harmony_pcie_init() failed: %d\n", ret);
 +#endif
 +}
 +
 +static void __init paz00_init(void)
 +{
 +      if (IS_ENABLED(CONFIG_ARCH_TEGRA_2x_SOC))
 +              tegra_paz00_wifikill_init();
 +}
 +
 +static struct {
 +      char *machine;
 +      void (*init)(void);
 +} board_init_funcs[] = {
 +      { "compulab,trimslice", trimslice_init },
 +      { "nvidia,harmony", harmony_init },
 +      { "compal,paz00", paz00_init },
 +};
 +
 +static void __init tegra_dt_init_late(void)
 +{
 +      int i;
 +
 +      tegra_init_late();
 +
 +      for (i = 0; i < ARRAY_SIZE(board_init_funcs); i++) {
 +              if (of_machine_is_compatible(board_init_funcs[i].machine)) {
 +                      board_init_funcs[i].init();
 +                      break;
 +              }
 +      }
 +}
 +
 +static const char * const tegra_dt_board_compat[] = {
 +      "nvidia,tegra114",
 +      "nvidia,tegra30",
 +      "nvidia,tegra20",
 +      NULL
 +};
 +
 +DT_MACHINE_START(TEGRA_DT, "NVIDIA Tegra SoC (Flattened Device Tree)")
 +      .map_io         = tegra_map_common_io,
 +      .smp            = smp_ops(tegra_smp_ops),
 +      .init_early     = tegra_init_early,
 +      .init_irq       = tegra_dt_init_irq,
 +      .init_time      = clocksource_of_init,
 +      .init_machine   = tegra_dt_init,
 +      .init_late      = tegra_dt_init_late,
 +      .restart        = tegra_assert_system_reset,
 +      .dt_compat      = tegra_dt_board_compat,
 +MACHINE_END
index f55d3f9b508d3675e6157ebcda48b5bfc76d212c,76209c9506b8006a8e3da88f11512caf64ed34a5..8f456bed4fa0e0ea6f2c8a7e99e1ebb3604a4a79
@@@ -10,7 -10,6 +10,7 @@@
   * published by the Free Software Foundation.
  */
  
 +#include <linux/amba/pl330.h>
  #include <linux/kernel.h>
  #include <linux/types.h>
  #include <linux/interrupt.h>
@@@ -63,7 -62,6 +63,6 @@@
  #include <linux/platform_data/usb-s3c2410_udc.h>
  #include <linux/platform_data/usb-ohci-s3c2410.h>
  #include <plat/usb-phy.h>
- #include <plat/regs-iic.h>
  #include <plat/regs-serial.h>
  #include <plat/regs-spi.h>
  #include <linux/platform_data/spi-s3c64xx.h>
@@@ -879,6 -877,51 +878,6 @@@ void __init s3c24xx_fb_set_platdata(str
  }
  #endif /* CONFIG_PLAT_S3C24XX */
  
 -/* MFC */
 -
 -#ifdef CONFIG_S5P_DEV_MFC
 -static struct resource s5p_mfc_resource[] = {
 -      [0] = DEFINE_RES_MEM(S5P_PA_MFC, SZ_64K),
 -      [1] = DEFINE_RES_IRQ(IRQ_MFC),
 -};
 -
 -struct platform_device s5p_device_mfc = {
 -      .name           = "s5p-mfc",
 -      .id             = -1,
 -      .num_resources  = ARRAY_SIZE(s5p_mfc_resource),
 -      .resource       = s5p_mfc_resource,
 -};
 -
 -/*
 - * MFC hardware has 2 memory interfaces which are modelled as two separate
 - * platform devices to let dma-mapping distinguish between them.
 - *
 - * MFC parent device (s5p_device_mfc) must be registered before memory
 - * interface specific devices (s5p_device_mfc_l and s5p_device_mfc_r).
 - */
 -
 -struct platform_device s5p_device_mfc_l = {
 -      .name           = "s5p-mfc-l",
 -      .id             = -1,
 -      .dev            = {
 -              .parent                 = &s5p_device_mfc.dev,
 -              .dma_mask               = &samsung_device_dma_mask,
 -              .coherent_dma_mask      = DMA_BIT_MASK(32),
 -      },
 -};
 -
 -struct platform_device s5p_device_mfc_r = {
 -      .name           = "s5p-mfc-r",
 -      .id             = -1,
 -      .dev            = {
 -              .parent                 = &s5p_device_mfc.dev,
 -              .dma_mask               = &samsung_device_dma_mask,
 -              .coherent_dma_mask      = DMA_BIT_MASK(32),
 -      },
 -};
 -
 -#endif /* CONFIG_S5P_DEV_MFC */
 -
  /* MIPI CSIS */
  
  #ifdef CONFIG_S5P_DEV_CSIS0
@@@ -1508,9 -1551,6 +1507,9 @@@ void __init s3c64xx_spi0_set_platdata(i
        pd.num_cs = num_cs;
        pd.src_clk_nr = src_clk_nr;
        pd.cfg_gpio = (cfg_gpio) ? cfg_gpio : s3c64xx_spi0_cfg_gpio;
 +#ifdef CONFIG_PL330_DMA
 +      pd.filter = pl330_filter;
 +#endif
  
        s3c_set_platdata(&pd, sizeof(pd), &s3c64xx_device_spi0);
  }
@@@ -1549,9 -1589,6 +1548,9 @@@ void __init s3c64xx_spi1_set_platdata(i
        pd.num_cs = num_cs;
        pd.src_clk_nr = src_clk_nr;
        pd.cfg_gpio = (cfg_gpio) ? cfg_gpio : s3c64xx_spi1_cfg_gpio;
 +#ifdef CONFIG_PL330_DMA
 +      pd.filter = pl330_filter;
 +#endif
  
        s3c_set_platdata(&pd, sizeof(pd), &s3c64xx_device_spi1);
  }
@@@ -1590,9 -1627,6 +1589,9 @@@ void __init s3c64xx_spi2_set_platdata(i
        pd.num_cs = num_cs;
        pd.src_clk_nr = src_clk_nr;
        pd.cfg_gpio = (cfg_gpio) ? cfg_gpio : s3c64xx_spi2_cfg_gpio;
 +#ifdef CONFIG_PL330_DMA
 +      pd.filter = pl330_filter;
 +#endif
  
        s3c_set_platdata(&pd, sizeof(pd), &s3c64xx_device_spi2);
  }
index e3085c487ace5943650e79ae7ffdde03d0ffcfb9,f7549b612ca595c49f328d79db80b9405fff2443..8ec91335d95a52c679193cabbd4a522cbb3851bc
@@@ -56,20 -56,11 +56,11 @@@ static u32 i2c_dw_get_clk_rate_khz(stru
  static int dw_i2c_acpi_configure(struct platform_device *pdev)
  {
        struct dw_i2c_dev *dev = platform_get_drvdata(pdev);
-       struct acpi_device *adev;
-       int busno, ret;
  
        if (!ACPI_HANDLE(&pdev->dev))
                return -ENODEV;
  
-       ret = acpi_bus_get_device(ACPI_HANDLE(&pdev->dev), &adev);
-       if (ret)
-               return -ENODEV;
        dev->adapter.nr = -1;
-       if (adev->pnp.unique_id && !kstrtoint(adev->pnp.unique_id, 0, &busno))
-               dev->adapter.nr = busno;
        dev->tx_fifo_depth = 32;
        dev->rx_fifo_depth = 32;
        return 0;
@@@ -92,7 -83,7 +83,7 @@@ static int dw_i2c_probe(struct platform
  {
        struct dw_i2c_dev *dev;
        struct i2c_adapter *adap;
-       struct resource *mem, *ioarea;
+       struct resource *mem;
        int irq, r;
  
        /* NOTE: driver uses the static register mapping */
                return irq; /* -ENXIO */
        }
  
-       ioarea = request_mem_region(mem->start, resource_size(mem),
-                       pdev->name);
-       if (!ioarea) {
-               dev_err(&pdev->dev, "I2C region already claimed\n");
-               return -EBUSY;
-       }
+       dev = devm_kzalloc(&pdev->dev, sizeof(struct dw_i2c_dev), GFP_KERNEL);
+       if (!dev)
+               return -ENOMEM;
  
-       dev = kzalloc(sizeof(struct dw_i2c_dev), GFP_KERNEL);
-       if (!dev) {
-               r = -ENOMEM;
-               goto err_release_region;
-       }
+       dev->base = devm_ioremap_resource(&pdev->dev, mem);
+       if (IS_ERR(dev->base))
+               return PTR_ERR(dev->base);
  
        init_completion(&dev->cmd_complete);
        mutex_init(&dev->lock);
-       dev->dev = get_device(&pdev->dev);
+       dev->dev = &pdev->dev;
        dev->irq = irq;
        platform_set_drvdata(pdev, dev);
  
-       dev->clk = clk_get(&pdev->dev, NULL);
+       dev->clk = devm_clk_get(&pdev->dev, NULL);
        dev->get_clk_rate_khz = i2c_dw_get_clk_rate_khz;
  
-       if (IS_ERR(dev->clk)) {
-               r = -ENODEV;
-               goto err_free_mem;
-       }
+       if (IS_ERR(dev->clk))
+               return PTR_ERR(dev->clk);
        clk_prepare_enable(dev->clk);
  
        dev->functionality =
        dev->master_cfg =  DW_IC_CON_MASTER | DW_IC_CON_SLAVE_DISABLE |
                DW_IC_CON_RESTART_EN | DW_IC_CON_SPEED_FAST;
  
-       dev->base = ioremap(mem->start, resource_size(mem));
-       if (dev->base == NULL) {
-               dev_err(&pdev->dev, "failure mapping io resources\n");
-               r = -EBUSY;
-               goto err_unuse_clocks;
-       }
        /* Try first if we can configure the device from ACPI */
        r = dw_i2c_acpi_configure(pdev);
        if (r) {
        }
        r = i2c_dw_init(dev);
        if (r)
-               goto err_iounmap;
+               return r;
  
        i2c_dw_disable_int(dev);
-       r = request_irq(dev->irq, i2c_dw_isr, IRQF_SHARED, pdev->name, dev);
+       r = devm_request_irq(&pdev->dev, dev->irq, i2c_dw_isr, IRQF_SHARED,
+                       pdev->name, dev);
        if (r) {
                dev_err(&pdev->dev, "failure requesting irq %i\n", dev->irq);
-               goto err_iounmap;
+               return r;
        }
  
        adap = &dev->adapter;
        adap->algo = &i2c_dw_algo;
        adap->dev.parent = &pdev->dev;
        adap->dev.of_node = pdev->dev.of_node;
 -      ACPI_HANDLE_SET(&adap->dev, ACPI_HANDLE(&pdev->dev));
  
        r = i2c_add_numbered_adapter(adap);
        if (r) {
                dev_err(&pdev->dev, "failure adding adapter\n");
-               goto err_free_irq;
+               return r;
        }
        of_i2c_register_devices(adap);
        acpi_i2c_register_devices(adap);
  
+       pm_runtime_set_autosuspend_delay(&pdev->dev, 1000);
+       pm_runtime_use_autosuspend(&pdev->dev);
        pm_runtime_set_active(&pdev->dev);
        pm_runtime_enable(&pdev->dev);
-       pm_runtime_put(&pdev->dev);
  
        return 0;
- err_free_irq:
-       free_irq(dev->irq, dev);
- err_iounmap:
-       iounmap(dev->base);
- err_unuse_clocks:
-       clk_disable_unprepare(dev->clk);
-       clk_put(dev->clk);
-       dev->clk = NULL;
- err_free_mem:
-       put_device(&pdev->dev);
-       kfree(dev);
- err_release_region:
-       release_mem_region(mem->start, resource_size(mem));
-       return r;
  }
  
  static int dw_i2c_remove(struct platform_device *pdev)
  {
        struct dw_i2c_dev *dev = platform_get_drvdata(pdev);
-       struct resource *mem;
  
        pm_runtime_get_sync(&pdev->dev);
  
        i2c_del_adapter(&dev->adapter);
-       put_device(&pdev->dev);
-       clk_disable_unprepare(dev->clk);
-       clk_put(dev->clk);
-       dev->clk = NULL;
  
        i2c_dw_disable(dev);
-       free_irq(dev->irq, dev);
-       kfree(dev);
  
        pm_runtime_put(&pdev->dev);
        pm_runtime_disable(&pdev->dev);
  
-       mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       release_mem_region(mem->start, resource_size(mem));
        return 0;
  }
  
index 8acef657abf3c76cd6377a80f001172a0c8d06ef,4fd47bcd110898ff5350767e033b2fff1fc9e33f..37a84c87c5fdd3fe31df3007afe959be7f98c289
@@@ -199,7 -199,7 +199,7 @@@ static int puv3_i2c_probe(struct platfo
  
        adapter = kzalloc(sizeof(struct i2c_adapter), GFP_KERNEL);
        if (adapter == NULL) {
 -              dev_err(&pdev->dev, "can't allocate inteface!\n");
 +              dev_err(&pdev->dev, "can't allocate interface!\n");
                rc = -ENOMEM;
                goto fail_nomem;
        }
@@@ -234,21 -234,15 +234,15 @@@ static int puv3_i2c_remove(struct platf
  {
        struct i2c_adapter *adapter = platform_get_drvdata(pdev);
        struct resource *mem;
-       int rc;
  
-       rc = i2c_del_adapter(adapter);
-       if (rc) {
-               dev_err(&pdev->dev, "Adapter '%s' delete fail\n",
-                               adapter->name);
-               return rc;
-       }
+       i2c_del_adapter(adapter);
  
        put_device(&pdev->dev);
  
        mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        release_mem_region(mem->start, resource_size(mem));
  
-       return rc;
+       return 0;
  }
  
  #ifdef CONFIG_PM
index b7c52dc8999c4f9acfb115f7fde26822dd3328a2,c63c643ed1f83360bb05586aa21ee003a4a8e4cc..d43911deb617a97a78348bc5e7bdb5f6ee1bf265
@@@ -394,11 -394,3 +394,11 @@@ int init_bttv_i2c(struct bttv *btv
  
        return btv->i2c_rc;
  }
-       if (0 != btv->i2c_rc)
-               return 0;
 +
 +int fini_bttv_i2c(struct bttv *btv)
 +{
-       return i2c_del_adapter(&btv->c.i2c_adap);
++      if (btv->i2c_rc == 0)
++              i2c_del_adapter(&btv->c.i2c_adap);
 +
++      return 0;
 +}
index 4486102fa9b3fd7a06fea65b987f7c6081449c7b,defed0eda820176ced04a068d1ecd318b96bcdc1..71998e7995d9b3af015653eee2a80f1ec097c3ab
@@@ -1528,7 -1528,7 +1528,7 @@@ static int falcon_probe_nic(struct efx_
        return 0;
  
   fail6:
-       BUG_ON(i2c_del_adapter(&board->i2c_adap));
+       i2c_del_adapter(&board->i2c_adap);
        memset(&board->i2c_adap, 0, sizeof(board->i2c_adap));
   fail5:
        efx_nic_free_buffer(efx, &efx->irq_status);
  
  static void falcon_init_rx_cfg(struct efx_nic *efx)
  {
 -      /* Prior to Siena the RX DMA engine will split each frame at
 -       * intervals of RX_USR_BUF_SIZE (32-byte units). We set it to
 -       * be so large that that never happens. */
 -      const unsigned huge_buf_size = (3 * 4096) >> 5;
        /* RX control FIFO thresholds (32 entries) */
        const unsigned ctrl_xon_thr = 20;
        const unsigned ctrl_xoff_thr = 25;
  
        efx_reado(efx, &reg, FR_AZ_RX_CFG);
        if (efx_nic_rev(efx) <= EFX_REV_FALCON_A1) {
 -              /* Data FIFO size is 5.5K */
 +              /* Data FIFO size is 5.5K.  The RX DMA engine only
 +               * supports scattering for user-mode queues, but will
 +               * split DMA writes at intervals of RX_USR_BUF_SIZE
 +               * (32-byte units) even for kernel-mode queues.  We
 +               * set it to be so large that that never happens.
 +               */
                EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_DESC_PUSH_EN, 0);
                EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_USR_BUF_SIZE,
 -                                  huge_buf_size);
 +                                  (3 * 4096) >> 5);
                EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XON_MAC_TH, 512 >> 8);
                EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XOFF_MAC_TH, 2048 >> 8);
                EFX_SET_OWORD_FIELD(reg, FRF_AA_RX_XON_TX_TH, ctrl_xon_thr);
                /* Data FIFO size is 80K; register fields moved */
                EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_DESC_PUSH_EN, 0);
                EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_USR_BUF_SIZE,
 -                                  huge_buf_size);
 +                                  EFX_RX_USR_BUF_SIZE >> 5);
                /* Send XON and XOFF at ~3 * max MTU away from empty/full */
                EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XON_MAC_TH, 27648 >> 8);
                EFX_SET_OWORD_FIELD(reg, FRF_BZ_RX_XOFF_MAC_TH, 54272 >> 8);
@@@ -1666,13 -1665,11 +1666,11 @@@ static void falcon_remove_nic(struct ef
  {
        struct falcon_nic_data *nic_data = efx->nic_data;
        struct falcon_board *board = falcon_board(efx);
-       int rc;
  
        board->type->fini(efx);
  
        /* Remove I2C adapter and clear it in preparation for a retry */
-       rc = i2c_del_adapter(&board->i2c_adap);
-       BUG_ON(rc);
+       i2c_del_adapter(&board->i2c_adap);
        memset(&board->i2c_adap, 0, sizeof(board->i2c_adap));
  
        efx_nic_free_buffer(efx, &efx->irq_status);
@@@ -1816,7 -1813,6 +1814,7 @@@ const struct efx_nic_type falcon_a1_nic
        .evq_rptr_tbl_base = FR_AA_EVQ_RPTR_KER,
        .max_dma_mask = DMA_BIT_MASK(FSF_AZ_TX_KER_BUF_ADDR_WIDTH),
        .rx_buffer_padding = 0x24,
 +      .can_rx_scatter = false,
        .max_interrupt_mode = EFX_INT_MODE_MSI,
        .phys_addr_channels = 4,
        .timer_period_max =  1 << FRF_AB_TC_TIMER_VAL_WIDTH,
@@@ -1867,7 -1863,6 +1865,7 @@@ const struct efx_nic_type falcon_b0_nic
        .max_dma_mask = DMA_BIT_MASK(FSF_AZ_TX_KER_BUF_ADDR_WIDTH),
        .rx_buffer_hash_size = 0x10,
        .rx_buffer_padding = 0,
 +      .can_rx_scatter = true,
        .max_interrupt_mode = EFX_INT_MODE_MSIX,
        .phys_addr_channels = 32, /* Hardware limit is 64, but the legacy
                                   * interrupt handler only supports 32
index a5ca99d7c0b29bad2d13d392fa5ef881df541092,6f83c52a0b5204721f0c01e865cbfd9ef30a40a2..3640df0aa0c1faf6e819a1395d2c846da6ba0ca5
@@@ -35,6 -35,7 +35,6 @@@
  #include <media/v4l2-common.h>
  
  #include "go7007-priv.h"
 -#include "wis-i2c.h"
  
  /*
   * Wait for an interrupt to be delivered from the GO7007SB and return
@@@ -90,43 -91,43 +90,43 @@@ EXPORT_SYMBOL(go7007_read_addr)
  static int go7007_load_encoder(struct go7007 *go)
  {
        const struct firmware *fw_entry;
 -      char fw_name[] = "go7007fw.bin";
 +      char fw_name[] = "go7007/go7007fw.bin";
        void *bounce;
        int fw_len, rv = 0;
        u16 intr_val, intr_data;
  
 -      if (request_firmware(&fw_entry, fw_name, go->dev)) {
 -              v4l2_err(go, "unable to load firmware from file "
 -                      "\"%s\"\n", fw_name);
 -              return -1;
 -      }
 -      if (fw_entry->size < 16 || memcmp(fw_entry->data, "WISGO7007FW", 11)) {
 -              v4l2_err(go, "file \"%s\" does not appear to be "
 -                              "go7007 firmware\n", fw_name);
 -              release_firmware(fw_entry);
 -              return -1;
 -      }
 -      fw_len = fw_entry->size - 16;
 -      bounce = kmemdup(fw_entry->data + 16, fw_len, GFP_KERNEL);
 -      if (bounce == NULL) {
 -              v4l2_err(go, "unable to allocate %d bytes for "
 -                              "firmware transfer\n", fw_len);
 +      if (go->boot_fw == NULL) {
 +              if (request_firmware(&fw_entry, fw_name, go->dev)) {
 +                      v4l2_err(go, "unable to load firmware from file \"%s\"\n", fw_name);
 +                      return -1;
 +              }
 +              if (fw_entry->size < 16 || memcmp(fw_entry->data, "WISGO7007FW", 11)) {
 +                      v4l2_err(go, "file \"%s\" does not appear to be go7007 firmware\n", fw_name);
 +                      release_firmware(fw_entry);
 +                      return -1;
 +              }
 +              fw_len = fw_entry->size - 16;
 +              bounce = kmemdup(fw_entry->data + 16, fw_len, GFP_KERNEL);
 +              if (bounce == NULL) {
 +                      v4l2_err(go, "unable to allocate %d bytes for firmware transfer\n", fw_len);
 +                      release_firmware(fw_entry);
 +                      return -1;
 +              }
                release_firmware(fw_entry);
 -              return -1;
 +              go->boot_fw_len = fw_len;
 +              go->boot_fw = bounce;
        }
 -      release_firmware(fw_entry);
        if (go7007_interface_reset(go) < 0 ||
 -                      go7007_send_firmware(go, bounce, fw_len) < 0 ||
 -                      go7007_read_interrupt(go, &intr_val, &intr_data) < 0 ||
 +          go7007_send_firmware(go, go->boot_fw, go->boot_fw_len) < 0 ||
 +          go7007_read_interrupt(go, &intr_val, &intr_data) < 0 ||
                        (intr_val & ~0x1) != 0x5a5a) {
                v4l2_err(go, "error transferring firmware\n");
                rv = -1;
        }
 -      kfree(bounce);
        return rv;
  }
  
 -MODULE_FIRMWARE("go7007fw.bin");
 +MODULE_FIRMWARE("go7007/go7007fw.bin");
  
  /*
   * Boot the encoder and register the I2C adapter if requested.  Do the
@@@ -166,24 -167,15 +166,24 @@@ static int go7007_init_encoder(struct g
                go7007_write_addr(go, 0x1000, 0x0811);
                go7007_write_addr(go, 0x1000, 0x0c11);
        }
 -      if (go->board_id == GO7007_BOARDID_MATRIX_REV) {
 +      switch (go->board_id) {
 +      case GO7007_BOARDID_MATRIX_REV:
                /* Set GPIO pin 0 to be an output (audio clock control) */
                go7007_write_addr(go, 0x3c82, 0x0001);
                go7007_write_addr(go, 0x3c80, 0x00fe);
 -      }
 -      if (go->board_id == GO7007_BOARDID_ADLINK_MPG24) {
 +              break;
 +      case GO7007_BOARDID_ADLINK_MPG24:
                /* set GPIO5 to be an output, currently low */
                go7007_write_addr(go, 0x3c82, 0x0000);
                go7007_write_addr(go, 0x3c80, 0x00df);
 +              break;
 +      case GO7007_BOARDID_ADS_USBAV_709:
 +              /* GPIO pin 0: audio clock control */
 +              /*      pin 2: TW9906 reset */
 +              /*      pin 3: capture LED */
 +              go7007_write_addr(go, 0x3c82, 0x000d);
 +              go7007_write_addr(go, 0x3c80, 0x00f2);
 +              break;
        }
        return 0;
  }
@@@ -204,54 -196,18 +204,51 @@@ int go7007_reset_encoder(struct go7007 
  /*
   * Attempt to instantiate an I2C client by ID, probably loading a module.
   */
 -static int init_i2c_module(struct i2c_adapter *adapter, const char *type,
 -                         int addr)
 +static int init_i2c_module(struct i2c_adapter *adapter, const struct go_i2c *const i2c)
  {
        struct go7007 *go = i2c_get_adapdata(adapter);
        struct v4l2_device *v4l2_dev = &go->v4l2_dev;
 -
 -      if (v4l2_i2c_new_subdev(v4l2_dev, adapter, type, addr, NULL))
 +      struct v4l2_subdev *sd;
 +      struct i2c_board_info info;
 +
 +      memset(&info, 0, sizeof(info));
 +      strlcpy(info.type, i2c->type, sizeof(info.type));
 +      info.addr = i2c->addr;
 +      info.flags = i2c->flags;
 +
 +      sd = v4l2_i2c_new_subdev_board(v4l2_dev, adapter, &info, NULL);
 +      if (sd) {
 +              if (i2c->is_video)
 +                      go->sd_video = sd;
 +              if (i2c->is_audio)
 +                      go->sd_audio = sd;
                return 0;
-               if (i2c_del_adapter(&go->i2c_adapter) == 0)
-                       go->i2c_adapter_online = 0;
-               else
-                       v4l2_err(&go->v4l2_dev,
-                               "error removing I2C adapter!\n");
 +      }
 +
 +      printk(KERN_INFO "go7007: probing for module i2c:%s failed\n", i2c->type);
 +      return -EINVAL;
 +}
 +
 +/*
 + * Detach and unregister the encoder.  The go7007 struct won't be freed
 + * until v4l2 finishes releasing its resources and all associated fds are
 + * closed by applications.
 + */
 +static void go7007_remove(struct v4l2_device *v4l2_dev)
 +{
 +      struct go7007 *go = container_of(v4l2_dev, struct go7007, v4l2_dev);
 +
 +      v4l2_device_unregister(v4l2_dev);
 +      if (go->hpi_ops->release)
 +              go->hpi_ops->release(go);
 +      if (go->i2c_adapter_online) {
++              i2c_del_adapter(&go->i2c_adapter);
++              go->i2c_adapter_online = 0;
 +      }
  
 -      dev_info(&adapter->dev,
 -               "go7007: probing for module i2c:%s failed\n", type);
 -      return -1;
 +      kfree(go->boot_fw);
 +      go7007_v4l2_remove(go);
 +      kfree(go);
  }
  
  /*
   *
   * Must NOT be called with the hw_lock held.
   */
 -int go7007_register_encoder(struct go7007 *go)
 +int go7007_register_encoder(struct go7007 *go, unsigned num_i2c_devs)
  {
        int i, ret;
  
        dev_info(go->dev, "go7007: registering new %s\n", go->name);
  
 +      go->v4l2_dev.release = go7007_remove;
 +      ret = v4l2_device_register(go->dev, &go->v4l2_dev);
 +      if (ret < 0)
 +              return ret;
 +
        mutex_lock(&go->hw_lock);
        ret = go7007_init_encoder(go);
        mutex_unlock(&go->hw_lock);
        if (ret < 0)
 -              return -1;
 +              return ret;
  
 -      /* v4l2 init must happen before i2c subdevs */
 -      ret = go7007_v4l2_init(go);
 +      ret = go7007_v4l2_ctrl_init(go);
        if (ret < 0)
                return ret;
  
        if (!go->i2c_adapter_online &&
                        go->board_info->flags & GO7007_BOARD_USE_ONBOARD_I2C) {
 -              if (go7007_i2c_init(go) < 0)
 -                      return -1;
 +              ret = go7007_i2c_init(go);
 +              if (ret < 0)
 +                      return ret;
                go->i2c_adapter_online = 1;
        }
        if (go->i2c_adapter_online) {
 -              for (i = 0; i < go->board_info->num_i2c_devs; ++i)
 -                      init_i2c_module(&go->i2c_adapter,
 -                                      go->board_info->i2c_devs[i].type,
 -                                      go->board_info->i2c_devs[i].addr);
 +              if (go->board_id == GO7007_BOARDID_ADS_USBAV_709) {
 +                      /* Reset the TW9906 */
 +                      go7007_write_addr(go, 0x3c82, 0x0009);
 +                      msleep(50);
 +                      go7007_write_addr(go, 0x3c82, 0x000d);
 +              }
 +              for (i = 0; i < num_i2c_devs; ++i)
 +                      init_i2c_module(&go->i2c_adapter, &go->board_info->i2c_devs[i]);
 +
 +              if (go->tuner_type >= 0) {
 +                      struct tuner_setup setup = {
 +                              .addr = ADDR_UNSET,
 +                              .type = go->tuner_type,
 +                              .mode_mask = T_ANALOG_TV,
 +                      };
 +
 +                      v4l2_device_call_all(&go->v4l2_dev, 0, tuner,
 +                              s_type_addr, &setup);
 +              }
                if (go->board_id == GO7007_BOARDID_ADLINK_MPG24)
 -                      i2c_clients_command(&go->i2c_adapter,
 -                              DECODER_SET_CHANNEL, &go->channel_number);
 +                      v4l2_subdev_call(go->sd_video, video, s_routing,
 +                                      0, 0, go->channel_number + 1);
        }
 +
 +      ret = go7007_v4l2_init(go);
 +      if (ret < 0)
 +              return ret;
 +
        if (go->board_info->flags & GO7007_BOARD_HAS_AUDIO) {
                go->audio_enabled = 1;
                go7007_snd_init(go);
@@@ -378,54 -309,48 +375,54 @@@ start_error
  /*
   * Store a byte in the current video buffer, if there is one.
   */
 -static inline void store_byte(struct go7007_buffer *gobuf, u8 byte)
 +static inline void store_byte(struct go7007_buffer *vb, u8 byte)
  {
 -      if (gobuf != NULL && gobuf->bytesused < GO7007_BUF_SIZE) {
 -              unsigned int pgidx = gobuf->offset >> PAGE_SHIFT;
 -              unsigned int pgoff = gobuf->offset & ~PAGE_MASK;
 +      if (vb && vb->vb.v4l2_planes[0].bytesused < GO7007_BUF_SIZE) {
 +              u8 *ptr = vb2_plane_vaddr(&vb->vb, 0);
  
 -              *((u8 *)page_address(gobuf->pages[pgidx]) + pgoff) = byte;
 -              ++gobuf->offset;
 -              ++gobuf->bytesused;
 +              ptr[vb->vb.v4l2_planes[0].bytesused++] = byte;
        }
  }
  
  /*
   * Deliver the last video buffer and get a new one to start writing to.
   */
 -static void frame_boundary(struct go7007 *go)
 +static struct go7007_buffer *frame_boundary(struct go7007 *go, struct go7007_buffer *vb)
  {
 -      struct go7007_buffer *gobuf;
 +      struct go7007_buffer *vb_tmp = NULL;
 +      u32 *bytesused = &vb->vb.v4l2_planes[0].bytesused;
        int i;
  
 -      if (go->active_buf) {
 -              if (go->active_buf->modet_active) {
 -                      if (go->active_buf->bytesused + 216 < GO7007_BUF_SIZE) {
 +      if (vb) {
 +              if (vb->modet_active) {
 +                      if (*bytesused + 216 < GO7007_BUF_SIZE) {
                                for (i = 0; i < 216; ++i)
 -                                      store_byte(go->active_buf,
 -                                                      go->active_map[i]);
 -                              go->active_buf->bytesused -= 216;
 +                                      store_byte(vb, go->active_map[i]);
 +                              *bytesused -= 216;
                        } else
 -                              go->active_buf->modet_active = 0;
 +                              vb->modet_active = 0;
                }
 -              go->active_buf->state = BUF_STATE_DONE;
 -              wake_up_interruptible(&go->frame_waitq);
 -              go->active_buf = NULL;
 +              vb->vb.v4l2_buf.sequence = go->next_seq++;
 +              v4l2_get_timestamp(&vb->vb.v4l2_buf.timestamp);
 +              vb_tmp = vb;
 +              spin_lock(&go->spinlock);
 +              list_del(&vb->list);
 +              if (list_empty(&go->vidq_active))
 +                      vb = NULL;
 +              else
 +                      vb = list_first_entry(&go->vidq_active, struct go7007_buffer, list);
 +              go->active_buf = vb;
 +              spin_unlock(&go->spinlock);
 +              vb2_buffer_done(&vb_tmp->vb, VB2_BUF_STATE_DONE);
 +              return vb;
        }
 -      list_for_each_entry(gobuf, &go->stream, stream)
 -              if (gobuf->state == BUF_STATE_QUEUED) {
 -                      gobuf->seq = go->next_seq;
 -                      do_gettimeofday(&gobuf->timestamp);
 -                      go->active_buf = gobuf;
 -                      break;
 -              }
 -      ++go->next_seq;
 +      spin_lock(&go->spinlock);
 +      if (!list_empty(&go->vidq_active))
 +              vb = go->active_buf =
 +                      list_first_entry(&go->vidq_active, struct go7007_buffer, list);
 +      spin_unlock(&go->spinlock);
 +      go->next_seq++;
 +      return vb;
  }
  
  static void write_bitmap_word(struct go7007 *go)
   */
  void go7007_parse_video_stream(struct go7007 *go, u8 *buf, int length)
  {
 -      int i, seq_start_code = -1, frame_start_code = -1;
 -
 -      spin_lock(&go->spinlock);
 +      struct go7007_buffer *vb = go->active_buf;
 +      int i, seq_start_code = -1, gop_start_code = -1, frame_start_code = -1;
  
        switch (go->format) {
 -      case GO7007_FORMAT_MPEG4:
 +      case V4L2_PIX_FMT_MPEG4:
                seq_start_code = 0xB0;
 +              gop_start_code = 0xB3;
                frame_start_code = 0xB6;
                break;
 -      case GO7007_FORMAT_MPEG1:
 -      case GO7007_FORMAT_MPEG2:
 +      case V4L2_PIX_FMT_MPEG1:
 +      case V4L2_PIX_FMT_MPEG2:
                seq_start_code = 0xB3;
 +              gop_start_code = 0xB8;
                frame_start_code = 0x00;
                break;
        }
  
        for (i = 0; i < length; ++i) {
 -              if (go->active_buf != NULL &&
 -                          go->active_buf->bytesused >= GO7007_BUF_SIZE - 3) {
 +              if (vb && vb->vb.v4l2_planes[0].bytesused >= GO7007_BUF_SIZE - 3) {
                        v4l2_info(&go->v4l2_dev, "dropping oversized frame\n");
 -                      go->active_buf->offset -= go->active_buf->bytesused;
 -                      go->active_buf->bytesused = 0;
 -                      go->active_buf->modet_active = 0;
 -                      go->active_buf = NULL;
 +                      vb->vb.v4l2_planes[0].bytesused = 0;
 +                      vb->frame_offset = 0;
 +                      vb->modet_active = 0;
 +                      vb = go->active_buf = NULL;
                }
  
                switch (go->state) {
                                go->state = STATE_FF;
                                break;
                        default:
 -                              store_byte(go->active_buf, buf[i]);
 +                              store_byte(vb, buf[i]);
                                break;
                        }
                        break;
                                go->state = STATE_00_00;
                                break;
                        case 0xFF:
 -                              store_byte(go->active_buf, 0x00);
 +                              store_byte(vb, 0x00);
                                go->state = STATE_FF;
                                break;
                        default:
 -                              store_byte(go->active_buf, 0x00);
 -                              store_byte(go->active_buf, buf[i]);
 +                              store_byte(vb, 0x00);
 +                              store_byte(vb, buf[i]);
                                go->state = STATE_DATA;
                                break;
                        }
                case STATE_00_00:
                        switch (buf[i]) {
                        case 0x00:
 -                              store_byte(go->active_buf, 0x00);
 +                              store_byte(vb, 0x00);
                                /* go->state remains STATE_00_00 */
                                break;
                        case 0x01:
                                go->state = STATE_00_00_01;
                                break;
                        case 0xFF:
 -                              store_byte(go->active_buf, 0x00);
 -                              store_byte(go->active_buf, 0x00);
 +                              store_byte(vb, 0x00);
 +                              store_byte(vb, 0x00);
                                go->state = STATE_FF;
                                break;
                        default:
 -                              store_byte(go->active_buf, 0x00);
 -                              store_byte(go->active_buf, 0x00);
 -                              store_byte(go->active_buf, buf[i]);
 +                              store_byte(vb, 0x00);
 +                              store_byte(vb, 0x00);
 +                              store_byte(vb, buf[i]);
                                go->state = STATE_DATA;
                                break;
                        }
                case STATE_00_00_01:
                        if (buf[i] == 0xF8 && go->modet_enable == 0) {
                                /* MODET start code, but MODET not enabled */
 -                              store_byte(go->active_buf, 0x00);
 -                              store_byte(go->active_buf, 0x00);
 -                              store_byte(go->active_buf, 0x01);
 -                              store_byte(go->active_buf, 0xF8);
 +                              store_byte(vb, 0x00);
 +                              store_byte(vb, 0x00);
 +                              store_byte(vb, 0x01);
 +                              store_byte(vb, 0xF8);
                                go->state = STATE_DATA;
                                break;
                        }
                        /* If this is the start of a new MPEG frame,
                         * get a new buffer */
 -                      if ((go->format == GO7007_FORMAT_MPEG1 ||
 -                                      go->format == GO7007_FORMAT_MPEG2 ||
 -                                      go->format == GO7007_FORMAT_MPEG4) &&
 -                                      (buf[i] == seq_start_code ||
 -                                              buf[i] == 0xB8 || /* GOP code */
 -                                              buf[i] == frame_start_code)) {
 -                              if (go->active_buf == NULL || go->seen_frame)
 -                                      frame_boundary(go);
 -                              if (buf[i] == frame_start_code) {
 -                                      if (go->active_buf != NULL)
 -                                              go->active_buf->frame_offset =
 -                                                      go->active_buf->offset;
 -                                      go->seen_frame = 1;
 -                              } else {
 -                                      go->seen_frame = 0;
 -                              }
 +                      if ((go->format == V4L2_PIX_FMT_MPEG1 ||
 +                           go->format == V4L2_PIX_FMT_MPEG2 ||
 +                           go->format == V4L2_PIX_FMT_MPEG4) &&
 +                          (buf[i] == seq_start_code ||
 +                           buf[i] == gop_start_code ||
 +                           buf[i] == frame_start_code)) {
 +                              if (vb == NULL || go->seen_frame)
 +                                      vb = frame_boundary(go, vb);
 +                              go->seen_frame = buf[i] == frame_start_code;
 +                              if (vb && go->seen_frame)
 +                                      vb->frame_offset = vb->vb.v4l2_planes[0].bytesused;
                        }
                        /* Handle any special chunk types, or just write the
                         * start code to the (potentially new) buffer */
                                go->state = STATE_MODET_MAP;
                                break;
                        case 0xFF: /* Potential JPEG start code */
 -                              store_byte(go->active_buf, 0x00);
 -                              store_byte(go->active_buf, 0x00);
 -                              store_byte(go->active_buf, 0x01);
 +                              store_byte(vb, 0x00);
 +                              store_byte(vb, 0x00);
 +                              store_byte(vb, 0x01);
                                go->state = STATE_FF;
                                break;
                        default:
 -                              store_byte(go->active_buf, 0x00);
 -                              store_byte(go->active_buf, 0x00);
 -                              store_byte(go->active_buf, 0x01);
 -                              store_byte(go->active_buf, buf[i]);
 +                              store_byte(vb, 0x00);
 +                              store_byte(vb, 0x00);
 +                              store_byte(vb, 0x01);
 +                              store_byte(vb, buf[i]);
                                go->state = STATE_DATA;
                                break;
                        }
                case STATE_FF:
                        switch (buf[i]) {
                        case 0x00:
 -                              store_byte(go->active_buf, 0xFF);
 +                              store_byte(vb, 0xFF);
                                go->state = STATE_00;
                                break;
                        case 0xFF:
 -                              store_byte(go->active_buf, 0xFF);
 +                              store_byte(vb, 0xFF);
                                /* go->state remains STATE_FF */
                                break;
                        case 0xD8:
 -                              if (go->format == GO7007_FORMAT_MJPEG)
 -                                      frame_boundary(go);
 +                              if (go->format == V4L2_PIX_FMT_MJPEG)
 +                                      vb = frame_boundary(go, vb);
                                /* fall through */
                        default:
 -                              store_byte(go->active_buf, 0xFF);
 -                              store_byte(go->active_buf, buf[i]);
 +                              store_byte(vb, 0xFF);
 +                              store_byte(vb, buf[i]);
                                go->state = STATE_DATA;
                                break;
                        }
                                        write_bitmap_word(go);
                                } else
                                        go->modet_word = buf[i] << 8;
 -                      } else if (go->parse_length == 207 && go->active_buf) {
 -                              go->active_buf->modet_active = buf[i];
 +                      } else if (go->parse_length == 207 && vb) {
 +                              vb->modet_active = buf[i];
                        }
                        if (++go->parse_length == 208)
                                go->state = STATE_DATA;
                        break;
                }
        }
 -
 -      spin_unlock(&go->spinlock);
  }
  EXPORT_SYMBOL(go7007_parse_video_stream);
  
  /*
   * Allocate a new go7007 struct.  Used by the hardware-specific probe.
   */
 -struct go7007 *go7007_alloc(struct go7007_board_info *board, struct device *dev)
 +struct go7007 *go7007_alloc(const struct go7007_board_info *board,
 +                                              struct device *dev)
  {
        struct go7007 *go;
        int i;
        mutex_init(&go->hw_lock);
        init_waitqueue_head(&go->frame_waitq);
        spin_lock_init(&go->spinlock);
 -      go->video_dev = NULL;
 -      go->ref_count = 0;
        go->status = STATUS_INIT;
        memset(&go->i2c_adapter, 0, sizeof(go->i2c_adapter));
        go->i2c_adapter_online = 0;
        go->interrupt_available = 0;
        init_waitqueue_head(&go->interrupt_waitq);
 -      go->in_use = 0;
        go->input = 0;
 -      if (board->sensor_flags & GO7007_SENSOR_TV) {
 -              go->standard = GO7007_STD_NTSC;
 -              go->width = 720;
 -              go->height = 480;
 -              go->sensor_framerate = 30000;
 -      } else {
 -              go->standard = GO7007_STD_OTHER;
 -              go->width = board->sensor_width;
 -              go->height = board->sensor_height;
 -              go->sensor_framerate = board->sensor_framerate;
 -      }
 -      go->encoder_v_offset = board->sensor_v_offset;
 -      go->encoder_h_offset = board->sensor_h_offset;
 +      go7007_update_board(go);
        go->encoder_h_halve = 0;
        go->encoder_v_halve = 0;
        go->encoder_subsample = 0;
 -      go->streaming = 0;
 -      go->format = GO7007_FORMAT_MJPEG;
 +      go->format = V4L2_PIX_FMT_MJPEG;
        go->bitrate = 1500000;
        go->fps_scale = 1;
        go->pali = 0;
                go->modet_map[i] = 0;
        go->audio_deliver = NULL;
        go->audio_enabled = 0;
 -      INIT_LIST_HEAD(&go->stream);
  
        return go;
  }
  EXPORT_SYMBOL(go7007_alloc);
  
 -/*
 - * Detach and unregister the encoder.  The go7007 struct won't be freed
 - * until v4l2 finishes releasing its resources and all associated fds are
 - * closed by applications.
 - */
 -void go7007_remove(struct go7007 *go)
 +void go7007_update_board(struct go7007 *go)
  {
 -      if (go->i2c_adapter_online) {
 -              i2c_del_adapter(&go->i2c_adapter);
 -              go->i2c_adapter_online = 0;
 -      }
 +      const struct go7007_board_info *board = go->board_info;
  
 -      if (go->audio_enabled)
 -              go7007_snd_remove(go);
 -      go7007_v4l2_remove(go);
 +      if (board->sensor_flags & GO7007_SENSOR_TV) {
 +              go->standard = GO7007_STD_NTSC;
 +              go->std = V4L2_STD_NTSC_M;
 +              go->width = 720;
 +              go->height = 480;
 +              go->sensor_framerate = 30000;
 +      } else {
 +              go->standard = GO7007_STD_OTHER;
 +              go->width = board->sensor_width;
 +              go->height = board->sensor_height;
 +              go->sensor_framerate = board->sensor_framerate;
 +      }
 +      go->encoder_v_offset = board->sensor_v_offset;
 +      go->encoder_h_offset = board->sensor_h_offset;
  }
 -EXPORT_SYMBOL(go7007_remove);
 +EXPORT_SYMBOL(go7007_update_board);
  
  MODULE_LICENSE("GPL v2");