Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 15 Nov 2013 05:19:54 +0000 (14:19 +0900)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 15 Nov 2013 05:19:54 +0000 (14:19 +0900)
Pull drm updates from Dave Airlie:
 "This is a combo of -next and some -fixes that came in in the
  intervening time.

  Highlights:

  New drivers:
    ARM Armada driver for Marvell Armada 510 SOCs

  Intel:
    Broadwell initial support under a default off switch,
    Stereo/3D HDMI mode support
    Valleyview improvements
    Displayport improvements
    Haswell fixes
    initial mipi dsi panel support
    CRC support for debugging
    build with CONFIG_FB=n

  Radeon:
    enable DPM on a number of GPUs by default
    secondary GPU powerdown support
    enable HDMI audio by default
    Hawaii support

  Nouveau:
    dynamic pm code infrastructure reworked, does nothing major yet
    GK208 modesetting support
    MSI fixes, on by default again
    PMPEG improvements
    pageflipping fixes

  GMA500:
    minnowboard SDVO support

  VMware:
    misc fixes

  MSM:
    prime, plane and rendernodes support

  Tegra:
    rearchitected to put the drm driver into the drm subsystem.
    HDMI and gr2d support for tegra 114 SoC

  QXL:
    oops fix, and multi-head fixes

  DRM core:
    sysfs lifetime fixes
    client capability ioctl
    further cleanups to device midlayer
    more vblank timestamp fixes"

* 'drm-next' of git://people.freedesktop.org/~airlied/linux: (789 commits)
  drm/nouveau: do not map evicted vram buffers in nouveau_bo_vma_add
  drm/nvc0-/gr: shift wrapping bug in nvc0_grctx_generate_r406800
  drm/nouveau/pwr: fix missing mutex unlock in a failure path
  drm/nv40/therm: fix slowing down fan when pstate undefined
  drm/nv11-: synchronise flips to vblank, unless async flip requested
  drm/nvc0-: remove nasty fifo swmthd hack for flip completion method
  drm/nv10-: we no longer need to create nvsw object on user channels
  drm/nouveau: always queue flips relative to kernel channel activity
  drm/nouveau: there is no need to reserve/fence the new fb when flipping
  drm/nouveau: when bailing out of a pushbuf ioctl, do not remove previous fence
  drm/nouveau: allow nouveau_fence_ref() to be a noop
  drm/nvc8/mc: msi rearm is via the nvc0 method
  drm/ttm: Fix vma page_prot bit manipulation
  drm/vmwgfx: Fix a couple of compile / sparse warnings and errors
  drm/vmwgfx: Resource evict fixes
  drm/edid: compare actual vrefresh for all modes for quirks
  drm: shmob_drm: Convert to clk_prepare/unprepare
  drm/nouveau: fix 32-bit build
  drm/i915/opregion: fix build error on CONFIG_ACPI=n
  Revert "drm/radeon/audio: don't set speaker allocation on DCE4+"
  ...

1  2 
MAINTAINERS
drivers/gpu/drm/drm_fops.c
drivers/gpu/drm/exynos/exynos_drm_drv.c
drivers/gpu/drm/gma500/oaktrail_device.c
drivers/gpu/drm/gma500/oaktrail_lvds.c
drivers/gpu/drm/nouveau/nouveau_acpi.c
drivers/gpu/drm/radeon/evergreen.c
drivers/staging/imx-drm/imx-drm-core.c
drivers/video/Kconfig
include/linux/cpufreq.h

diff --combined MAINTAINERS
@@@ -253,20 -253,6 +253,20 @@@ F:       drivers/pci/*acpi
  F:    drivers/pci/*/*acpi*
  F:    drivers/pci/*/*/*acpi*
  
 +ACPI COMPONENT ARCHITECTURE (ACPICA)
 +M:    Robert Moore <robert.moore@intel.com>
 +M:    Lv Zheng <lv.zheng@intel.com>
 +M:    Rafael J. Wysocki <rafael.j.wysocki@intel.com>
 +L:    linux-acpi@vger.kernel.org
 +L:    devel@acpica.org
 +W:    https://acpica.org/
 +W:    https://github.com/acpica/acpica/
 +Q:    https://patchwork.kernel.org/project/linux-acpi/list/
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
 +S:    Supported
 +F:    drivers/acpi/acpica/
 +F:    include/acpi/
 +
  ACPI FAN DRIVER
  M:    Zhang Rui <rui.zhang@intel.com>
  L:    linux-acpi@vger.kernel.org
@@@ -777,10 -763,6 +777,10 @@@ W:       http://maxim.org.za/at91_26.htm
  W:    http://www.linux4sam.org
  S:    Supported
  F:    arch/arm/mach-at91/
 +F:    arch/arm/boot/dts/at91*.dts
 +F:    arch/arm/boot/dts/at91*.dtsi
 +F:    arch/arm/boot/dts/sama*.dts
 +F:    arch/arm/boot/dts/sama*.dtsi
  
  ARM/CALXEDA HIGHBANK ARCHITECTURE
  M:    Rob Herring <rob.herring@calxeda.com>
@@@ -947,7 -929,7 +947,7 @@@ M: Javier Martinez Canillas <javier@dow
  L:    linux-omap@vger.kernel.org
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
 -F:    arch/arm/mach-omap2/board-igep0020.c
 +F:    arch/arm/boot/dts/omap3-igep*
  
  ARM/INCOME PXA270 SUPPORT
  M:    Marek Vasut <marek.vasut@gmail.com>
@@@ -1175,6 -1157,11 +1175,6 @@@ S:     Maintaine
  F:    arch/arm/mach-rockchip/
  F:    drivers/*/*rockchip*
  
 -ARM/SHARK MACHINE SUPPORT
 -M:    Alexander Schulz <alex@shark-linux.de>
 -W:    http://www.shark-linux.de/shark.html
 -S:    Maintained
 -
  ARM/SAMSUNG ARM ARCHITECTURES
  M:    Ben Dooks <ben-linux@fluff.org>
  M:    Kukjin Kim <kgene.kim@samsung.com>
@@@ -1182,8 -1169,6 +1182,8 @@@ L:      linux-arm-kernel@lists.infradead.or
  L:    linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
  W:    http://www.fluff.org/ben/linux/
  S:    Maintained
 +F:    arch/arm/boot/dts/s3c*
 +F:    arch/arm/boot/dts/exynos*
  F:    arch/arm/plat-samsung/
  F:    arch/arm/mach-s3c24*/
  F:    arch/arm/mach-s3c64xx/
@@@ -1675,15 -1660,16 +1675,15 @@@ S:   Maintaine
  F:    drivers/net/wireless/b43legacy/
  
  BACKLIGHT CLASS/SUBSYSTEM
 -M:    Richard Purdie <rpurdie@rpsys.net>
  M:    Jingoo Han <jg1.han@samsung.com>
  S:    Maintained
  F:    drivers/video/backlight/
  F:    include/linux/backlight.h
  
  BATMAN ADVANCED
 -M:    Marek Lindner <lindner_marek@yahoo.de>
 -M:    Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
 -M:    Antonio Quartulli <ordex@autistici.org>
 +M:    Marek Lindner <mareklindner@neomailbox.ch>
 +M:    Simon Wunderlich <sw@simonwunderlich.de>
 +M:    Antonio Quartulli <antonio@meshcoding.com>
  L:    b.a.t.m.a.n@lists.open-mesh.org
  W:    http://www.open-mesh.org/
  S:    Maintained
@@@ -1836,7 -1822,7 +1836,7 @@@ F:      drivers/net/ethernet/broadcom/bnx2.
  F:    drivers/net/ethernet/broadcom/bnx2_*
  
  BROADCOM BNX2X 10 GIGABIT ETHERNET DRIVER
 -M:    Eilon Greenstein <eilong@broadcom.com>
 +M:    Ariel Elior <ariele@broadcom.com>
  L:    netdev@vger.kernel.org
  S:    Supported
  F:    drivers/net/ethernet/broadcom/bnx2x/
@@@ -1881,7 -1867,7 +1881,7 @@@ S:      Supporte
  F:    drivers/net/wireless/brcm80211/
  
  BROADCOM BNX2FC 10 GIGABIT FCOE DRIVER
 -M:    Bhanu Prakash Gollapudi <bprakash@broadcom.com>
 +M:    Eddie Wai <eddie.wai@broadcom.com>
  L:    linux-scsi@vger.kernel.org
  S:    Supported
  F:    drivers/scsi/bnx2fc/
@@@ -2386,7 -2372,7 +2386,7 @@@ F:      kernel/cpuset.
  
  CRAMFS FILESYSTEM
  W:    http://sourceforge.net/projects/cramfs/
 -S:    Orphan
 +S:    Orphan / Obsolete
  F:    Documentation/filesystems/cramfs.txt
  F:    fs/cramfs/
  
@@@ -2661,7 -2647,6 +2661,7 @@@ M:      dm-devel@redhat.co
  L:    dm-devel@redhat.com
  W:    http://sources.redhat.com/dm
  Q:    http://patchwork.kernel.org/project/dm-devel/list/
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git
  T:    quilt http://people.redhat.com/agk/patches/linux/editing/
  S:    Maintained
  F:    Documentation/device-mapper/
@@@ -2849,7 -2834,9 +2849,9 @@@ L:      dri-devel@lists.freedesktop.or
  L:    linux-tegra@vger.kernel.org
  T:    git git://anongit.freedesktop.org/tegra/linux.git
  S:    Supported
+ F:    drivers/gpu/drm/tegra/
  F:    drivers/gpu/host1x/
+ F:    include/linux/host1x.h
  F:    include/uapi/drm/tegra_drm.h
  F:    Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt
  
@@@ -3706,14 -3693,6 +3708,14 @@@ S:    Maintaine
  F:    include/asm-generic/
  F:    include/uapi/asm-generic/
  
 +GENERIC PHY FRAMEWORK
 +M:    Kishon Vijay Abraham I <kishon@ti.com>
 +L:    linux-kernel@vger.kernel.org
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy.git
 +S:    Supported
 +F:    drivers/phy/
 +F:    include/linux/phy/
 +
  GENERIC UIO DRIVER FOR PCI DEVICES
  M:    "Michael S. Tsirkin" <mst@redhat.com>
  L:    kvm@vger.kernel.org
@@@ -4255,7 -4234,7 +4257,7 @@@ S:      Maintaine
  F:    drivers/media/rc/iguanair.c
  
  IIO SUBSYSTEM AND DRIVERS
 -M:    Jonathan Cameron <jic23@cam.ac.uk>
 +M:    Jonathan Cameron <jic23@kernel.org>
  L:    linux-iio@vger.kernel.org
  S:    Maintained
  F:    drivers/iio/
@@@ -4454,12 -4433,6 +4456,12 @@@ F:    Documentation/networking/ixgbevf.tx
  F:    Documentation/networking/i40e.txt
  F:    drivers/net/ethernet/intel/
  
 +INTEL-MID GPIO DRIVER
 +M:    David Cohen <david.a.cohen@linux.intel.com>
 +L:    linux-gpio@vger.kernel.org
 +S:    Maintained
 +F:    drivers/gpio/gpio-intel-mid.c
 +
  INTEL PRO/WIRELESS 2100, 2200BG, 2915ABG NETWORK CONNECTION SUPPORT
  M:    Stanislav Yakovlev <stas.yakovlev@gmail.com>
  L:    linux-wireless@vger.kernel.org
@@@ -4798,13 -4771,6 +4800,13 @@@ S:    Maintaine
  F:    Documentation/hwmon/k8temp
  F:    drivers/hwmon/k8temp.c
  
 +KTAP
 +M:    Jovi Zhangwei <jovi.zhangwei@gmail.com>
 +W:    http://www.ktap.org
 +L:    ktap@freelists.org
 +S:    Maintained
 +F:    drivers/staging/ktap/
 +
  KCONFIG
  M:    Michal Marek <mmarek@suse.cz>
  L:    linux-kbuild@vger.kernel.org
@@@ -4871,8 -4837,7 +4873,8 @@@ KERNEL VIRTUAL MACHINE (KVM
  M:    Gleb Natapov <gleb@redhat.com>
  M:    Paolo Bonzini <pbonzini@redhat.com>
  L:    kvm@vger.kernel.org
 -W:    http://linux-kvm.org
 +W:    http://www.linux-kvm.org
 +T:    git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
  S:    Supported
  F:    Documentation/*/kvm*.txt
  F:    Documentation/virtual/kvm/
@@@ -5390,7 -5355,7 +5392,7 @@@ S:      Orpha
  F:    drivers/net/wireless/libertas/
  
  MARVELL MV643XX ETHERNET DRIVER
 -M:    Lennert Buytenhek <buytenh@wantstofly.org>
 +M:    Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
  L:    netdev@vger.kernel.org
  S:    Maintained
  F:    drivers/net/ethernet/marvell/mv643xx_eth.*
@@@ -6146,12 -6111,6 +6148,12 @@@ L:    linux-omap@vger.kernel.or
  S:    Maintained
  F:    drivers/gpio/gpio-omap.c
  
 +OMAP/NEWFLOW NANOBONE MACHINE SUPPORT
 +M:    Mark Jackson <mpfj@newflow.co.uk>
 +L:    linux-omap@vger.kernel.org
 +S:    Maintained
 +F:    arch/arm/boot/dts/am335x-nano.dts
 +
  OMFS FILESYSTEM
  M:    Bob Copeland <me@bobcopeland.com>
  L:    linux-karma-devel@lists.sourceforge.net
@@@ -6428,7 -6387,6 +6430,7 @@@ S:      Supporte
  F:    Documentation/PCI/
  F:    drivers/pci/
  F:    include/linux/pci*
 +F:    arch/x86/pci/
  
  PCI DRIVER FOR NVIDIA TEGRA
  M:    Thierry Reding <thierry.reding@gmail.com>
@@@ -6437,12 -6395,6 +6439,12 @@@ S:    Supporte
  F:    Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt
  F:    drivers/pci/host/pci-tegra.c
  
 +PCI DRIVER FOR SAMSUNG EXYNOS
 +M:    Jingoo Han <jg1.han@samsung.com>
 +L:    linux-pci@vger.kernel.org
 +S:    Maintained
 +F:    drivers/pci/host/pci-exynos.c
 +
  PCMCIA SUBSYSTEM
  P:    Linux PCMCIA Team
  L:    linux-pcmcia@lists.infradead.org
@@@ -6913,14 -6865,6 +6915,14 @@@ L:    linux-hexagon@vger.kernel.or
  S:    Supported
  F:    arch/hexagon/
  
 +QUALCOMM WCN36XX WIRELESS DRIVER
 +M:    Eugene Krasnikov <k.eugene.e@gmail.com>
 +L:    wcn36xx@lists.infradead.org
 +W:    http://wireless.kernel.org/en/users/Drivers/wcn36xx
 +T:    git git://github.com/KrasnikovEugene/wcn36xx.git
 +S:    Supported
 +F:    drivers/net/wireless/ath/wcn36xx/
 +
  QUICKCAM PARALLEL PORT WEBCAMS
  M:    Hans Verkuil <hverkuil@xs4all.nl>
  L:    linux-media@vger.kernel.org
@@@ -7008,7 -6952,7 +7010,7 @@@ M:      "Paul E. McKenney" <paulmck@linux.vn
  S:    Supported
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
  F:    Documentation/RCU/torture.txt
 -F:    kernel/rcutorture.c
 +F:    kernel/rcu/torture.c
  
  RDC R-321X SoC
  M:    Florian Fainelli <florian@openwrt.org>
@@@ -7035,9 -6979,8 +7037,9 @@@ T:      git git://git.kernel.org/pub/scm/lin
  F:    Documentation/RCU/
  X:    Documentation/RCU/torture.txt
  F:    include/linux/rcu*
 -F:    kernel/rcu*
 -X:    kernel/rcutorture.c
 +X:    include/linux/srcu.h
 +F:    kernel/rcu/
 +X:    kernel/rcu/torture.c
  
  REAL TIME CLOCK (RTC) SUBSYSTEM
  M:    Alessandro Zummo <a.zummo@towertech.it>
@@@ -7350,7 -7293,7 +7352,7 @@@ S:      Odd Fixe
  F:    drivers/media/usb/tlg2300/
  
  SC1200 WDT DRIVER
 -M:    Zwane Mwaikambo <zwane@arm.linux.org.uk>
 +M:    Zwane Mwaikambo <zwanem@gmail.com>
  S:    Maintained
  F:    drivers/watchdog/sc1200wdt.c
  
@@@ -7362,8 -7305,6 +7364,8 @@@ S:      Maintaine
  F:    kernel/sched/
  F:    include/linux/sched.h
  F:    include/uapi/linux/sched.h
 +F:    kernel/wait.c
 +F:    include/linux/wait.h
  
  SCORE ARCHITECTURE
  M:    Chen Liqin <liqin.linux@gmail.com>
@@@ -7726,8 -7667,8 +7728,8 @@@ M:      "Paul E. McKenney" <paulmck@linux.vn
  W:    http://www.rdrop.com/users/paulmck/RCU/
  S:    Supported
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
 -F:    include/linux/srcu*
 -F:    kernel/srcu*
 +F:    include/linux/srcu.h
 +F:    kernel/rcu/srcu.c
  
  SMACK SECURITY MODULE
  M:    Casey Schaufler <casey@schaufler-ca.com>
@@@ -8062,7 -8003,7 +8064,7 @@@ S:      Maintaine
  F:    drivers/staging/media/go7007/
  
  STAGING - INDUSTRIAL IO
 -M:    Jonathan Cameron <jic23@cam.ac.uk>
 +M:    Jonathan Cameron <jic23@kernel.org>
  L:    linux-iio@vger.kernel.org
  S:    Odd Fixes
  F:    drivers/staging/iio/
@@@ -8743,6 -8684,14 +8745,6 @@@ S:     Maintaine
  F:    arch/m68k/*/*_no.*
  F:    arch/m68k/include/asm/*_no.*
  
 -UCLINUX FOR RENESAS H8/300 (H8300)
 -M:    Yoshinori Sato <ysato@users.sourceforge.jp>
 -W:    http://uclinux-h8.sourceforge.jp/
 -S:    Supported
 -F:    arch/h8300/
 -F:    drivers/ide/ide-h8300.c
 -F:    drivers/net/ethernet/8390/ne-h8300.c
 -
  UDF FILESYSTEM
  M:    Jan Kara <jack@suse.cz>
  S:    Maintained
@@@ -113,7 -113,6 +113,6 @@@ int drm_open(struct inode *inode, struc
        retcode = drm_open_helper(inode, filp, dev);
        if (retcode)
                goto err_undo;
-       atomic_inc(&dev->counts[_DRM_STAT_OPENS]);
        if (need_setup) {
                retcode = drm_setup(dev);
                if (retcode)
@@@ -148,7 -147,7 +147,7 @@@ int drm_stub_open(struct inode *inode, 
        struct drm_minor *minor;
        int minor_id = iminor(inode);
        int err = -ENODEV;
 -      const struct file_operations *old_fops;
 +      const struct file_operations *new_fops;
  
        DRM_DEBUG("\n");
  
        if (drm_device_is_unplugged(dev))
                goto out;
  
 -      old_fops = filp->f_op;
 -      filp->f_op = fops_get(dev->driver->fops);
 -      if (filp->f_op == NULL) {
 -              filp->f_op = old_fops;
 +      new_fops = fops_get(dev->driver->fops);
 +      if (!new_fops)
                goto out;
 -      }
 -      if (filp->f_op->open && (err = filp->f_op->open(inode, filp))) {
 -              fops_put(filp->f_op);
 -              filp->f_op = fops_get(old_fops);
 -      }
 -      fops_put(old_fops);
  
 +      replace_fops(filp, new_fops);
 +      if (filp->f_op->open)
 +              err = filp->f_op->open(inode, filp);
  out:
        mutex_unlock(&drm_global_mutex);
        return err;
@@@ -235,7 -239,8 +234,8 @@@ static int drm_open_helper(struct inod
  
        priv->ioctl_count = 0;
        /* for compatibility root is always authenticated */
-       priv->authenticated = capable(CAP_SYS_ADMIN);
+       priv->always_authenticated = capable(CAP_SYS_ADMIN);
+       priv->authenticated = priv->always_authenticated;
        priv->lock_count = 0;
  
        INIT_LIST_HEAD(&priv->lhead);
@@@ -374,12 -379,79 +374,79 @@@ static void drm_events_release(struct d
                }
  
        /* Remove unconsumed events */
-       list_for_each_entry_safe(e, et, &file_priv->event_list, link)
+       list_for_each_entry_safe(e, et, &file_priv->event_list, link) {
+               list_del(&e->link);
                e->destroy(e);
+       }
  
        spin_unlock_irqrestore(&dev->event_lock, flags);
  }
  
+ /**
+  * drm_legacy_dev_reinit
+  *
+  * Reinitializes a legacy/ums drm device in it's lastclose function.
+  */
+ static void drm_legacy_dev_reinit(struct drm_device *dev)
+ {
+       if (drm_core_check_feature(dev, DRIVER_MODESET))
+               return;
+       atomic_set(&dev->ioctl_count, 0);
+       atomic_set(&dev->vma_count, 0);
+       dev->sigdata.lock = NULL;
+       dev->context_flag = 0;
+       dev->last_context = 0;
+       dev->if_version = 0;
+ }
+ /**
+  * Take down the DRM device.
+  *
+  * \param dev DRM device structure.
+  *
+  * Frees every resource in \p dev.
+  *
+  * \sa drm_device
+  */
+ int drm_lastclose(struct drm_device * dev)
+ {
+       struct drm_vma_entry *vma, *vma_temp;
+       DRM_DEBUG("\n");
+       if (dev->driver->lastclose)
+               dev->driver->lastclose(dev);
+       DRM_DEBUG("driver lastclose completed\n");
+       if (dev->irq_enabled && !drm_core_check_feature(dev, DRIVER_MODESET))
+               drm_irq_uninstall(dev);
+       mutex_lock(&dev->struct_mutex);
+       drm_agp_clear(dev);
+       drm_legacy_sg_cleanup(dev);
+       /* Clear vma list (only built for debugging) */
+       list_for_each_entry_safe(vma, vma_temp, &dev->vmalist, head) {
+               list_del(&vma->head);
+               kfree(vma);
+       }
+       drm_legacy_dma_takedown(dev);
+       dev->dev_mapping = NULL;
+       mutex_unlock(&dev->struct_mutex);
+       drm_legacy_dev_reinit(dev);
+       DRM_DEBUG("lastclose completed\n");
+       return 0;
+ }
  /**
   * Release file.
   *
@@@ -449,7 -521,6 +516,6 @@@ int drm_release(struct inode *inode, st
  
                                list_del(&pos->head);
                                kfree(pos);
-                               --dev->ctx_count;
                        }
                }
        }
                list_for_each_entry(temp, &dev->filelist, lhead) {
                        if ((temp->master == file_priv->master) &&
                            (temp != file_priv))
-                               temp->authenticated = 0;
+                               temp->authenticated = temp->always_authenticated;
                }
  
                /**
         * End inline drm_release
         */
  
-       atomic_inc(&dev->counts[_DRM_STAT_CLOSES]);
        if (!--dev->open_count) {
                if (atomic_read(&dev->ioctl_count)) {
                        DRM_ERROR("Device busy: %d\n",
@@@ -264,7 -264,6 +264,6 @@@ static struct drm_driver exynos_drm_dri
        .get_vblank_counter     = drm_vblank_count,
        .enable_vblank          = exynos_drm_crtc_enable_vblank,
        .disable_vblank         = exynos_drm_crtc_disable_vblank,
-       .gem_init_object        = exynos_drm_gem_init_object,
        .gem_free_object        = exynos_drm_gem_free_object,
        .gem_vm_ops             = &exynos_drm_gem_vm_ops,
        .dumb_create            = exynos_drm_gem_dumb_create,
  
  static int exynos_drm_platform_probe(struct platform_device *pdev)
  {
 -      pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
 +      int ret;
 +
 +      ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
 +      if (ret)
 +              return ret;
  
        return drm_platform_init(&exynos_drm_driver, pdev);
  }
@@@ -26,7 -26,7 +26,7 @@@
  #include "psb_drv.h"
  #include "psb_reg.h"
  #include "psb_intel_reg.h"
 -#include <asm/mrst.h>
 +#include <asm/intel-mid.h>
  #include <asm/intel_scu_ipc.h>
  #include "mid_bios.h"
  #include "intel_bios.h"
@@@ -40,6 -40,9 +40,9 @@@ static int oaktrail_output_init(struct 
                dev_err(dev->dev, "DSI is not supported\n");
        if (dev_priv->hdmi_priv)
                oaktrail_hdmi_init(dev, &dev_priv->mode_dev);
+       psb_intel_sdvo_init(dev, SDVOB);
        return 0;
  }
  
@@@ -526,6 -529,7 +529,7 @@@ static int oaktrail_chip_setup(struct d
                psb_intel_opregion_init(dev);
                psb_intel_init_bios(dev);
        }
+       gma_intel_setup_gmbus(dev);
        oaktrail_hdmi_setup(dev);
        return 0;
  }
@@@ -534,6 -538,7 +538,7 @@@ static void oaktrail_teardown(struct dr
  {
        struct drm_psb_private *dev_priv = dev->dev_private;
  
+       gma_intel_teardown_gmbus(dev);
        oaktrail_hdmi_teardown(dev);
        if (!dev_priv->has_gct)
                psb_intel_destroy_bios(dev);
@@@ -546,6 -551,7 +551,7 @@@ const struct psb_ops oaktrail_chip_ops 
        .crtcs = 2,
        .hdmi_mask = (1 << 1),
        .lvds_mask = (1 << 0),
+       .sdvo_mask = (1 << 1),
        .cursor_needs_phys = 0,
        .sgx_offset = MRST_SGX_OFFSET,
  
@@@ -22,7 -22,7 +22,7 @@@
  
  #include <linux/i2c.h>
  #include <drm/drmP.h>
 -#include <asm/mrst.h>
 +#include <asm/intel-mid.h>
  
  #include "intel_bios.h"
  #include "psb_drv.h"
@@@ -218,30 -218,6 +218,6 @@@ static const struct drm_encoder_helper_
        .commit = oaktrail_lvds_commit,
  };
  
- static struct drm_display_mode lvds_configuration_modes[] = {
-       /* hard coded fixed mode for TPO LTPS LPJ040K001A */
-       { DRM_MODE("800x480",  DRM_MODE_TYPE_DRIVER, 33264, 800, 836,
-                  846, 1056, 0, 480, 489, 491, 525, 0, 0) },
-       /* hard coded fixed mode for LVDS 800x480 */
-       { DRM_MODE("800x480",  DRM_MODE_TYPE_DRIVER, 30994, 800, 801,
-                  802, 1024, 0, 480, 481, 482, 525, 0, 0) },
-       /* hard coded fixed mode for Samsung 480wsvga LVDS 1024x600@75 */
-       { DRM_MODE("1024x600", DRM_MODE_TYPE_DRIVER, 53990, 1024, 1072,
-                  1104, 1184, 0, 600, 603, 604, 608, 0, 0) },
-       /* hard coded fixed mode for Samsung 480wsvga LVDS 1024x600@75 */
-       { DRM_MODE("1024x600", DRM_MODE_TYPE_DRIVER, 53990, 1024, 1104,
-                  1136, 1184, 0, 600, 603, 604, 608, 0, 0) },
-       /* hard coded fixed mode for Sharp wsvga LVDS 1024x600 */
-       { DRM_MODE("1024x600", DRM_MODE_TYPE_DRIVER, 48885, 1024, 1124,
-                  1204, 1312, 0, 600, 607, 610, 621, 0, 0) },
-       /* hard coded fixed mode for LVDS 1024x768 */
-       { DRM_MODE("1024x768", DRM_MODE_TYPE_DRIVER, 65000, 1024, 1048,
-                  1184, 1344, 0, 768, 771, 777, 806, 0, 0) },
-       /* hard coded fixed mode for LVDS 1366x768 */
-       { DRM_MODE("1366x768", DRM_MODE_TYPE_DRIVER, 77500, 1366, 1430,
-                  1558, 1664, 0, 768, 769, 770, 776, 0, 0) },
- };
  /* Returns the panel fixed mode from configuration. */
  
  static void oaktrail_lvds_get_configuration_mode(struct drm_device *dev,
                        mode_dev->panel_fixed_mode =
                                drm_mode_duplicate(dev,
                                        dev_priv->lfp_lvds_vbt_mode);
-       /* Then guess */
+       /* If we still got no mode then bail */
        if (mode_dev->panel_fixed_mode == NULL)
-               mode_dev->panel_fixed_mode
-                       = drm_mode_duplicate(dev, &lvds_configuration_modes[2]);
+               return;
  
        drm_mode_set_name(mode_dev->panel_fixed_mode);
        drm_mode_set_crtcinfo(mode_dev->panel_fixed_mode, 0);
@@@ -253,15 -253,18 +253,15 @@@ static struct vga_switcheroo_handler no
  
  static int nouveau_dsm_pci_probe(struct pci_dev *pdev)
  {
 -      acpi_handle dhandle, nvidia_handle;
 -      acpi_status status;
 +      acpi_handle dhandle;
        int retval = 0;
  
        dhandle = DEVICE_ACPI_HANDLE(&pdev->dev);
        if (!dhandle)
                return false;
  
 -      status = acpi_get_handle(dhandle, "_DSM", &nvidia_handle);
 -      if (ACPI_FAILURE(status)) {
 +      if (!acpi_has_method(dhandle, "_DSM"))
                return false;
 -      }
  
        if (nouveau_test_dsm(dhandle, nouveau_dsm, NOUVEAU_DSM_POWER))
                retval |= NOUVEAU_DSM_HAS_MUX;
@@@ -314,6 -317,16 +314,16 @@@ static bool nouveau_dsm_detect(void
                        has_optimus = 1;
        }
  
+       while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_3D << 8, pdev)) != NULL) {
+               vga_count++;
+               retval = nouveau_dsm_pci_probe(pdev);
+               if (retval & NOUVEAU_DSM_HAS_MUX)
+                       has_dsm |= 1;
+               if (retval & NOUVEAU_DSM_HAS_OPT)
+                       has_optimus = 1;
+       }
        /* find the optimus DSM or the old v1 DSM */
        if (has_optimus == 1) {
                acpi_get_name(nouveau_dsm_priv.dhandle, ACPI_FULL_PATHNAME,
@@@ -1174,18 -1174,81 +1174,74 @@@ int evergreen_set_uvd_clocks(struct rad
  
  void evergreen_fix_pci_max_read_req_size(struct radeon_device *rdev)
  {
 -      u16 ctl, v;
 -      int err;
 -
 -      err = pcie_capability_read_word(rdev->pdev, PCI_EXP_DEVCTL, &ctl);
 -      if (err)
 -              return;
 -
 -      v = (ctl & PCI_EXP_DEVCTL_READRQ) >> 12;
 +      int readrq;
 +      u16 v;
  
 +      readrq = pcie_get_readrq(rdev->pdev);
 +      v = ffs(readrq) - 8;
        /* if bios or OS sets MAX_READ_REQUEST_SIZE to an invalid value, fix it
         * to avoid hangs or perfomance issues
         */
 -      if ((v == 0) || (v == 6) || (v == 7)) {
 -              ctl &= ~PCI_EXP_DEVCTL_READRQ;
 -              ctl |= (2 << 12);
 -              pcie_capability_write_word(rdev->pdev, PCI_EXP_DEVCTL, ctl);
 -      }
 +      if ((v == 0) || (v == 6) || (v == 7))
 +              pcie_set_readrq(rdev->pdev, 512);
  }
  
+ void dce4_program_fmt(struct drm_encoder *encoder)
+ {
+       struct drm_device *dev = encoder->dev;
+       struct radeon_device *rdev = dev->dev_private;
+       struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder);
+       struct radeon_crtc *radeon_crtc = to_radeon_crtc(encoder->crtc);
+       struct drm_connector *connector = radeon_get_connector_for_encoder(encoder);
+       int bpc = 0;
+       u32 tmp = 0;
+       enum radeon_connector_dither dither = RADEON_FMT_DITHER_DISABLE;
+       if (connector) {
+               struct radeon_connector *radeon_connector = to_radeon_connector(connector);
+               bpc = radeon_get_monitor_bpc(connector);
+               dither = radeon_connector->dither;
+       }
+       /* LVDS/eDP FMT is set up by atom */
+       if (radeon_encoder->devices & ATOM_DEVICE_LCD_SUPPORT)
+               return;
+       /* not needed for analog */
+       if ((radeon_encoder->encoder_id == ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC1) ||
+           (radeon_encoder->encoder_id == ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC2))
+               return;
+       if (bpc == 0)
+               return;
+       switch (bpc) {
+       case 6:
+               if (dither == RADEON_FMT_DITHER_ENABLE)
+                       /* XXX sort out optimal dither settings */
+                       tmp |= (FMT_FRAME_RANDOM_ENABLE | FMT_HIGHPASS_RANDOM_ENABLE |
+                               FMT_SPATIAL_DITHER_EN);
+               else
+                       tmp |= FMT_TRUNCATE_EN;
+               break;
+       case 8:
+               if (dither == RADEON_FMT_DITHER_ENABLE)
+                       /* XXX sort out optimal dither settings */
+                       tmp |= (FMT_FRAME_RANDOM_ENABLE | FMT_HIGHPASS_RANDOM_ENABLE |
+                               FMT_RGB_RANDOM_ENABLE |
+                               FMT_SPATIAL_DITHER_EN | FMT_SPATIAL_DITHER_DEPTH);
+               else
+                       tmp |= (FMT_TRUNCATE_EN | FMT_TRUNCATE_DEPTH);
+               break;
+       case 10:
+       default:
+               /* not needed */
+               break;
+       }
+       WREG32(FMT_BIT_DEPTH_CONTROL + radeon_crtc->crtc_offset, tmp);
+ }
  static bool dce4_is_in_vblank(struct radeon_device *rdev, int crtc)
  {
        if (RREG32(EVERGREEN_CRTC_STATUS + crtc_offsets[crtc]) & EVERGREEN_CRTC_V_BLANK)
@@@ -3956,7 -4019,7 +4012,7 @@@ int sumo_rlc_init(struct radeon_device 
                if (rdev->family >= CHIP_TAHITI) {
                        /* SI */
                        for (i = 0; i < rdev->rlc.reg_list_size; i++)
-                               dst_ptr[i] = src_ptr[i];
+                               dst_ptr[i] = cpu_to_le32(src_ptr[i]);
                } else {
                        /* ON/LN/TN */
                        /* format:
                                if (i < dws)
                                        data |= (src_ptr[i] >> 2) << 16;
                                j = (((i - 1) * 3) / 2);
-                               dst_ptr[j] = data;
+                               dst_ptr[j] = cpu_to_le32(data);
                        }
                        j = ((i * 3) / 2);
-                       dst_ptr[j] = RLC_SAVE_RESTORE_LIST_END_MARKER;
+                       dst_ptr[j] = cpu_to_le32(RLC_SAVE_RESTORE_LIST_END_MARKER);
                }
                radeon_bo_kunmap(rdev->rlc.save_restore_obj);
                radeon_bo_unreserve(rdev->rlc.save_restore_obj);
                        cik_get_csb_buffer(rdev, dst_ptr);
                } else if (rdev->family >= CHIP_TAHITI) {
                        reg_list_mc_addr = rdev->rlc.clear_state_gpu_addr + 256;
-                       dst_ptr[0] = upper_32_bits(reg_list_mc_addr);
-                       dst_ptr[1] = lower_32_bits(reg_list_mc_addr);
-                       dst_ptr[2] = rdev->rlc.clear_state_size;
+                       dst_ptr[0] = cpu_to_le32(upper_32_bits(reg_list_mc_addr));
+                       dst_ptr[1] = cpu_to_le32(lower_32_bits(reg_list_mc_addr));
+                       dst_ptr[2] = cpu_to_le32(rdev->rlc.clear_state_size);
                        si_get_csb_buffer(rdev, &dst_ptr[(256/4)]);
                } else {
                        reg_list_hdr_blk_index = 0;
                        reg_list_mc_addr = rdev->rlc.clear_state_gpu_addr + (reg_list_blk_index * 4);
                        data = upper_32_bits(reg_list_mc_addr);
-                       dst_ptr[reg_list_hdr_blk_index] = data;
+                       dst_ptr[reg_list_hdr_blk_index] = cpu_to_le32(data);
                        reg_list_hdr_blk_index++;
                        for (i = 0; cs_data[i].section != NULL; i++) {
                                for (j = 0; cs_data[i].section[j].extent != NULL; j++) {
                                        reg_num = cs_data[i].section[j].reg_count;
                                        data = reg_list_mc_addr & 0xffffffff;
-                                       dst_ptr[reg_list_hdr_blk_index] = data;
+                                       dst_ptr[reg_list_hdr_blk_index] = cpu_to_le32(data);
                                        reg_list_hdr_blk_index++;
  
                                        data = (cs_data[i].section[j].reg_index * 4) & 0xffffffff;
-                                       dst_ptr[reg_list_hdr_blk_index] = data;
+                                       dst_ptr[reg_list_hdr_blk_index] = cpu_to_le32(data);
                                        reg_list_hdr_blk_index++;
  
                                        data = 0x08000000 | (reg_num * 4);
-                                       dst_ptr[reg_list_hdr_blk_index] = data;
+                                       dst_ptr[reg_list_hdr_blk_index] = cpu_to_le32(data);
                                        reg_list_hdr_blk_index++;
  
                                        for (k = 0; k < reg_num; k++) {
                                                data = cs_data[i].section[j].extent[k];
-                                               dst_ptr[reg_list_blk_index + k] = data;
+                                               dst_ptr[reg_list_blk_index + k] = cpu_to_le32(data);
                                        }
                                        reg_list_mc_addr += reg_num * 4;
                                        reg_list_blk_index += reg_num;
                                }
                        }
-                       dst_ptr[reg_list_hdr_blk_index] = RLC_CLEAR_STATE_END_MARKER;
+                       dst_ptr[reg_list_hdr_blk_index] = cpu_to_le32(RLC_CLEAR_STATE_END_MARKER);
                }
                radeon_bo_kunmap(rdev->rlc.clear_state_obj);
                radeon_bo_unreserve(rdev->rlc.clear_state_obj);
@@@ -68,11 -68,6 +68,11 @@@ struct imx_drm_connector 
        struct module                           *owner;
  };
  
 +int imx_drm_crtc_id(struct imx_drm_crtc *crtc)
 +{
 +      return crtc->pipe;
 +}
 +
  static void imx_drm_driver_lastclose(struct drm_device *drm)
  {
        struct imx_drm_device *imxdrm = drm->dev_private;
@@@ -115,12 -110,18 +115,12 @@@ int imx_drm_crtc_panel_format_pins(stru
        struct imx_drm_crtc *imx_crtc;
        struct imx_drm_crtc_helper_funcs *helper;
  
 -      mutex_lock(&imxdrm->mutex);
 -
        list_for_each_entry(imx_crtc, &imxdrm->crtc_list, list)
                if (imx_crtc->crtc == crtc)
                        goto found;
  
 -      mutex_unlock(&imxdrm->mutex);
 -
        return -EINVAL;
  found:
 -      mutex_unlock(&imxdrm->mutex);
 -
        helper = &imx_crtc->imx_drm_helper_funcs;
        if (helper->set_interface_pix_fmt)
                return helper->set_interface_pix_fmt(crtc,
@@@ -190,18 -191,6 +190,18 @@@ static void imx_drm_disable_vblank(stru
        imx_drm_crtc->imx_drm_helper_funcs.disable_vblank(imx_drm_crtc->crtc);
  }
  
 +static void imx_drm_driver_preclose(struct drm_device *drm,
 +              struct drm_file *file)
 +{
 +      int i;
 +
 +      if (!file->is_master)
 +              return;
 +
 +      for (i = 0; i < 4; i++)
 +              imx_drm_disable_vblank(drm , i);
 +}
 +
  static const struct file_operations imx_drm_driver_fops = {
        .owner = THIS_MODULE,
        .open = drm_open,
@@@ -407,14 -396,14 +407,14 @@@ static int imx_drm_driver_load(struct d
  
        /*
         * enable drm irq mode.
-        * - with irq_enabled = 1, we can use the vblank feature.
+        * - with irq_enabled = true, we can use the vblank feature.
         *
         * P.S. note that we wouldn't use drm irq handler but
         *      just specific driver own one instead because
         *      drm framework supports only one irq handler and
         *      drivers can well take care of their interrupts
         */
-       drm->irq_enabled = 1;
+       drm->irq_enabled = true;
  
        drm_mode_config_init(drm);
        imx_drm_mode_config_init(drm);
                goto err_init;
  
        /*
-        * with vblank_disable_allowed = 1, vblank interrupt will be disabled
+        * with vblank_disable_allowed = true, vblank interrupt will be disabled
         * by drm timer once a current process gives up ownership of
         * vblank event.(after drm_vblank_put function is called)
         */
-       imxdrm->drm->vblank_disable_allowed = 1;
+       imxdrm->drm->vblank_disable_allowed = true;
  
        if (!imx_drm_device_get())
                ret = -EINVAL;
@@@ -658,14 -647,20 +658,14 @@@ int imx_drm_encoder_get_mux_id(struct i
        struct imx_drm_crtc *imx_crtc;
        int i = 0;
  
 -      mutex_lock(&imxdrm->mutex);
 -
        list_for_each_entry(imx_crtc, &imxdrm->crtc_list, list) {
                if (imx_crtc->crtc == crtc)
                        goto found;
                i++;
        }
  
 -      mutex_unlock(&imxdrm->mutex);
 -
        return -EINVAL;
  found:
 -      mutex_unlock(&imxdrm->mutex);
 -
        return i;
  }
  EXPORT_SYMBOL_GPL(imx_drm_encoder_get_mux_id);
@@@ -779,26 -774,16 +779,26 @@@ static const struct drm_ioctl_desc imx_
  };
  
  static struct drm_driver imx_drm_driver = {
 -      .driver_features        = DRIVER_MODESET | DRIVER_GEM,
 +      .driver_features        = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME,
        .load                   = imx_drm_driver_load,
        .unload                 = imx_drm_driver_unload,
        .lastclose              = imx_drm_driver_lastclose,
 +      .preclose               = imx_drm_driver_preclose,
        .gem_free_object        = drm_gem_cma_free_object,
        .gem_vm_ops             = &drm_gem_cma_vm_ops,
        .dumb_create            = drm_gem_cma_dumb_create,
        .dumb_map_offset        = drm_gem_cma_dumb_map_offset,
        .dumb_destroy           = drm_gem_dumb_destroy,
  
 +      .prime_handle_to_fd     = drm_gem_prime_handle_to_fd,
 +      .prime_fd_to_handle     = drm_gem_prime_fd_to_handle,
 +      .gem_prime_import       = drm_gem_prime_import,
 +      .gem_prime_export       = drm_gem_prime_export,
 +      .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
 +      .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,
 +      .gem_prime_vmap         = drm_gem_cma_prime_vmap,
 +      .gem_prime_vunmap       = drm_gem_cma_prime_vunmap,
 +      .gem_prime_mmap         = drm_gem_cma_prime_mmap,
        .get_vblank_counter     = drm_vblank_count,
        .enable_vblank          = imx_drm_enable_vblank,
        .disable_vblank         = imx_drm_disable_vblank,
  
  static int imx_drm_platform_probe(struct platform_device *pdev)
  {
 +      int ret;
 +
 +      ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
 +      if (ret)
 +              return ret;
 +
        imx_drm_device->dev = &pdev->dev;
  
        return drm_platform_init(&imx_drm_driver, pdev);
@@@ -858,11 -837,13 +858,11 @@@ static int __init imx_drm_init(void
        INIT_LIST_HEAD(&imx_drm_device->encoder_list);
  
        imx_drm_pdev = platform_device_register_simple("imx-drm", -1, NULL, 0);
 -      if (!imx_drm_pdev) {
 -              ret = -EINVAL;
 +      if (IS_ERR(imx_drm_pdev)) {
 +              ret = PTR_ERR(imx_drm_pdev);
                goto err_pdev;
        }
  
 -      imx_drm_pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32),
 -
        ret = platform_driver_register(&imx_drm_pdrv);
        if (ret)
                goto err_pdrv;
diff --combined drivers/video/Kconfig
@@@ -19,10 -19,10 +19,10 @@@ source "drivers/char/agp/Kconfig
  
  source "drivers/gpu/vga/Kconfig"
  
- source "drivers/gpu/drm/Kconfig"
  source "drivers/gpu/host1x/Kconfig"
  
+ source "drivers/gpu/drm/Kconfig"
  config VGASTATE
         tristate
         default n
@@@ -996,8 -996,6 +996,8 @@@ config FB_ATME
        select FB_CFB_FILLRECT
        select FB_CFB_COPYAREA
        select FB_CFB_IMAGEBLIT
 +      select FB_MODE_HELPERS
 +      select VIDEOMODE_HELPERS
        help
          This enables support for the AT91/AT32 LCD Controller.
  
diff --combined include/linux/cpufreq.h
@@@ -85,20 -85,6 +85,20 @@@ struct cpufreq_policy 
        struct list_head        policy_list;
        struct kobject          kobj;
        struct completion       kobj_unregister;
 +
 +      /*
 +       * The rules for this semaphore:
 +       * - Any routine that wants to read from the policy structure will
 +       *   do a down_read on this semaphore.
 +       * - Any routine that will write to the policy structure and/or may take away
 +       *   the policy altogether (eg. CPU hotplug), will hold this lock in write
 +       *   mode before doing so.
 +       *
 +       * Additional rules:
 +       * - Lock should not be held across
 +       *     __cpufreq_governor(data, CPUFREQ_GOV_POLICY_EXIT);
 +       */
 +      struct rw_semaphore     rwsem;
  };
  
  /* Only for ACPI */
  #define CPUFREQ_SHARED_TYPE_ALL        (2) /* All dependent CPUs should set freq */
  #define CPUFREQ_SHARED_TYPE_ANY        (3) /* Freq can be set from any dependent CPU*/
  
+ #ifdef CONFIG_CPU_FREQ
  struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu);
  void cpufreq_cpu_put(struct cpufreq_policy *policy);
+ #else
+ static inline struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu)
+ {
+       return NULL;
+ }
+ static inline void cpufreq_cpu_put(struct cpufreq_policy *policy) { }
+ #endif
  
  static inline bool policy_is_shared(struct cpufreq_policy *policy)
  {
@@@ -194,6 -188,13 +202,6 @@@ __ATTR(_name, 0644, show_##_name, store
  struct cpufreq_driver {
        char                    name[CPUFREQ_NAME_LEN];
        u8                      flags;
 -      /*
 -       * This should be set by platforms having multiple clock-domains, i.e.
 -       * supporting multiple policies. With this sysfs directories of governor
 -       * would be created in cpu/cpu<num>/cpufreq/ directory and so they can
 -       * use the same governor with different tunables for different clusters.
 -       */
 -      bool                    have_governor_per_policy;
  
        /* needed by all drivers */
        int     (*init)         (struct cpufreq_policy *policy);
  
        /* define one out of two */
        int     (*setpolicy)    (struct cpufreq_policy *policy);
 -      int     (*target)       (struct cpufreq_policy *policy,
 +      int     (*target)       (struct cpufreq_policy *policy, /* Deprecated */
                                 unsigned int target_freq,
                                 unsigned int relation);
 +      int     (*target_index) (struct cpufreq_policy *policy,
 +                               unsigned int index);
  
        /* should be defined, if possible */
        unsigned int    (*get)  (unsigned int cpu);
  };
  
  /* flags */
 -#define CPUFREQ_STICKY                0x01    /* the driver isn't removed even if
 -                                       * all ->init() calls failed */
 -#define CPUFREQ_CONST_LOOPS   0x02    /* loops_per_jiffy or other kernel
 -                                       * "constants" aren't affected by
 -                                       * frequency transitions */
 -#define CPUFREQ_PM_NO_WARN    0x04    /* don't warn on suspend/resume speed
 -                                       * mismatches */
 +#define CPUFREQ_STICKY                (1 << 0)        /* driver isn't removed even if
 +                                                 all ->init() calls failed */
 +#define CPUFREQ_CONST_LOOPS   (1 << 1)        /* loops_per_jiffy or other
 +                                                 kernel "constants" aren't
 +                                                 affected by frequency
 +                                                 transitions */
 +#define CPUFREQ_PM_NO_WARN    (1 << 2)        /* don't warn on suspend/resume
 +                                                 speed mismatches */
 +
 +/*
 + * This should be set by platforms having multiple clock-domains, i.e.
 + * supporting multiple policies. With this sysfs directories of governor would
 + * be created in cpu/cpu<num>/cpufreq/ directory and so they can use the same
 + * governor with different tunables for different clusters.
 + */
 +#define CPUFREQ_HAVE_GOVERNOR_PER_POLICY (1 << 3)
 +
 +/*
 + * Driver will do POSTCHANGE notifications from outside of their ->target()
 + * routine and so must set cpufreq_driver->flags with this flag, so that core
 + * can handle them specially.
 + */
 +#define CPUFREQ_ASYNC_NOTIFICATION  (1 << 4)
  
  int cpufreq_register_driver(struct cpufreq_driver *driver_data);
  int cpufreq_unregister_driver(struct cpufreq_driver *driver_data);
@@@ -265,13 -248,6 +273,13 @@@ static inline void cpufreq_verify_withi
        return;
  }
  
 +static inline void
 +cpufreq_verify_within_cpu_limits(struct cpufreq_policy *policy)
 +{
 +      cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
 +                      policy->cpuinfo.max_freq);
 +}
 +
  /*********************************************************************
   *                     CPUFREQ NOTIFIER INTERFACE                    *
   *********************************************************************/
@@@ -424,7 -400,6 +432,7 @@@ int cpufreq_frequency_table_cpuinfo(str
  
  int cpufreq_frequency_table_verify(struct cpufreq_policy *policy,
                                   struct cpufreq_frequency_table *table);
 +int cpufreq_generic_frequency_table_verify(struct cpufreq_policy *policy);
  
  int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
                                   struct cpufreq_frequency_table *table,
@@@ -440,20 -415,8 +448,20 @@@ struct cpufreq_frequency_table *cpufreq
  
  /* the following are really really optional */
  extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs;
 +extern struct freq_attr *cpufreq_generic_attr[];
  void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table,
                                      unsigned int cpu);
  void cpufreq_frequency_table_put_attr(unsigned int cpu);
 +int cpufreq_table_validate_and_show(struct cpufreq_policy *policy,
 +                                    struct cpufreq_frequency_table *table);
 +
 +int cpufreq_generic_init(struct cpufreq_policy *policy,
 +              struct cpufreq_frequency_table *table,
 +              unsigned int transition_latency);
 +static inline int cpufreq_generic_exit(struct cpufreq_policy *policy)
 +{
 +      cpufreq_frequency_table_put_attr(policy->cpu);
 +      return 0;
 +}
  
  #endif /* _LINUX_CPUFREQ_H */