LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 00/12] Remove mach-msm and associated code
@ 2015-03-13 18:09 Stephen Boyd
  2015-03-13 18:09 ` [PATCH 01/12] ARM: Remove mach-msm and associated ARM architecture code Stephen Boyd
                   ` (12 more replies)
  0 siblings, 13 replies; 32+ messages in thread
From: Stephen Boyd @ 2015-03-13 18:09 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: linux-arm-kernel, linux-kernel, David Brown, Bryan Huntsman,
	Daniel Walker, Arnd Bergmann, Linus Walleij, Alexandre Courbot,
	Greg Kroah-Hartman, David S . Miller, Ulf Hansson, Chris Ball,
	Alan Stern, linux-usb

The maintainers for mach-msm no longer have any plans to support
or test the platforms supported by this architecture[1]. Most likely
there aren't any active users of this code anyway, so let's
delete it and the associated drivers/code. We should probably merge
this as one big series through arm-soc. Although some patches
should be fine to take through maintainers, some things like
mmc and usb have header file dependencies for platform_data.

[1] http://lkml.kernel.org/r/20150307031212.GA8434@fifo99.com

Stephen Boyd (12):
  ARM: Remove mach-msm and associated ARM architecture code
  gpio: Remove gpio-msm-v1 driver
  tty: serial: Remove orphaned serial driver
  tty: serial: msm_serial: Remove dead code
  net: smc91x: Remove dead code
  mmc: Remove msm_sdcc driver
  clocksource: qcom: Remove dead code
  ehci-msm: Remove dead dependency
  usb: phy: msm: Remove dead code
  phy: qcom-ufs: Switch dependency to ARCH_QCOM
  ufs-qcom: Switch dependency to ARCH_QCOM
  msm: msm_fb: Remove dead code

 Documentation/arm/00-INDEX                      |    2 -
 Documentation/arm/msm/gpiomux.txt               |  176 ---
 MAINTAINERS                                     |   20 +-
 arch/arm/Kconfig                                |   14 -
 arch/arm/Kconfig.debug                          |   31 +-
 arch/arm/Makefile                               |    2 -
 arch/arm/configs/msm_defconfig                  |  121 --
 arch/arm/include/debug/msm.S                    |   14 -
 arch/arm/mach-msm/Kconfig                       |  109 --
 arch/arm/mach-msm/Makefile                      |   23 -
 arch/arm/mach-msm/Makefile.boot                 |    3 -
 arch/arm/mach-msm/board-halibut.c               |  104 --
 arch/arm/mach-msm/board-msm7x30.c               |  191 ---
 arch/arm/mach-msm/board-qsd8x50.c               |  248 ---
 arch/arm/mach-msm/board-sapphire.c              |  114 --
 arch/arm/mach-msm/board-trout-gpio.c            |  233 ---
 arch/arm/mach-msm/board-trout-mmc.c             |  185 ---
 arch/arm/mach-msm/board-trout-panel.c           |  292 ----
 arch/arm/mach-msm/board-trout.c                 |  111 --
 arch/arm/mach-msm/board-trout.h                 |  162 --
 arch/arm/mach-msm/clock-pcom.c                  |  176 ---
 arch/arm/mach-msm/clock-pcom.h                  |  145 --
 arch/arm/mach-msm/clock.c                       |   28 -
 arch/arm/mach-msm/clock.h                       |   43 -
 arch/arm/mach-msm/common.h                      |   41 -
 arch/arm/mach-msm/devices-msm7x00.c             |  480 ------
 arch/arm/mach-msm/devices-msm7x30.c             |  246 ---
 arch/arm/mach-msm/devices-qsd8x50.c             |  388 -----
 arch/arm/mach-msm/devices.h                     |   53 -
 arch/arm/mach-msm/dma.c                         |  298 ----
 arch/arm/mach-msm/gpiomux-8x50.c                |   51 -
 arch/arm/mach-msm/gpiomux-v1.h                  |   67 -
 arch/arm/mach-msm/gpiomux.c                     |  111 --
 arch/arm/mach-msm/gpiomux.h                     |   84 -
 arch/arm/mach-msm/include/mach/clk.h            |   31 -
 arch/arm/mach-msm/include/mach/dma.h            |  151 --
 arch/arm/mach-msm/include/mach/entry-macro.S    |   36 -
 arch/arm/mach-msm/include/mach/hardware.h       |   18 -
 arch/arm/mach-msm/include/mach/irqs-7x00.h      |   75 -
 arch/arm/mach-msm/include/mach/irqs-7x30.h      |  153 --
 arch/arm/mach-msm/include/mach/irqs-8x50.h      |   88 --
 arch/arm/mach-msm/include/mach/irqs.h           |   37 -
 arch/arm/mach-msm/include/mach/msm_gpiomux.h    |   38 -
 arch/arm/mach-msm/include/mach/msm_iomap-7x00.h |  108 --
 arch/arm/mach-msm/include/mach/msm_iomap-7x30.h |  103 --
 arch/arm/mach-msm/include/mach/msm_iomap-8x50.h |  125 --
 arch/arm/mach-msm/include/mach/msm_iomap.h      |   53 -
 arch/arm/mach-msm/include/mach/msm_smd.h        |  109 --
 arch/arm/mach-msm/include/mach/sirc.h           |   98 --
 arch/arm/mach-msm/include/mach/vreg.h           |   29 -
 arch/arm/mach-msm/io.c                          |  161 --
 arch/arm/mach-msm/irq-vic.c                     |  363 -----
 arch/arm/mach-msm/irq.c                         |  151 --
 arch/arm/mach-msm/last_radio_log.c              |   71 -
 arch/arm/mach-msm/proc_comm.c                   |  129 --
 arch/arm/mach-msm/proc_comm.h                   |  258 ----
 arch/arm/mach-msm/sirc.c                        |  172 ---
 arch/arm/mach-msm/smd.c                         | 1034 -------------
 arch/arm/mach-msm/smd_debug.c                   |  311 ----
 arch/arm/mach-msm/smd_private.h                 |  403 -----
 arch/arm/mach-msm/vreg.c                        |  220 ---
 drivers/clocksource/qcom-timer.c                |   59 -
 drivers/gpio/Kconfig                            |    8 -
 drivers/gpio/Makefile                           |    1 -
 drivers/gpio/gpio-msm-v1.c                      |  714 ---------
 drivers/mmc/host/Kconfig                        |    8 -
 drivers/mmc/host/Makefile                       |    1 -
 drivers/mmc/host/msm_sdcc.c                     | 1474 ------------------
 drivers/mmc/host/msm_sdcc.h                     |  256 ----
 drivers/net/ethernet/smsc/smc91x.h              |   14 -
 drivers/phy/Kconfig                             |    2 +-
 drivers/scsi/ufs/Kconfig                        |    2 +-
 drivers/tty/serial/Kconfig                      |   14 +-
 drivers/tty/serial/Makefile                     |    1 -
 drivers/tty/serial/msm_serial.h                 |    9 -
 drivers/tty/serial/msm_serial_hs.c              | 1874 -----------------------
 drivers/usb/host/Kconfig                        |    2 +-
 drivers/usb/phy/Kconfig                         |    2 +-
 drivers/usb/phy/phy-msm-usb.c                   |   18 +-
 drivers/video/fbdev/Kconfig                     |    7 -
 drivers/video/fbdev/Makefile                    |    1 -
 drivers/video/fbdev/msm/Makefile                |   19 -
 drivers/video/fbdev/msm/mddi.c                  |  821 ----------
 drivers/video/fbdev/msm/mddi_client_dummy.c     |   85 -
 drivers/video/fbdev/msm/mddi_client_nt35399.c   |  252 ---
 drivers/video/fbdev/msm/mddi_client_toshiba.c   |  280 ----
 drivers/video/fbdev/msm/mddi_hw.h               |  305 ----
 drivers/video/fbdev/msm/mdp.c                   |  520 -------
 drivers/video/fbdev/msm/mdp_csc_table.h         |  582 -------
 drivers/video/fbdev/msm/mdp_hw.h                |  627 --------
 drivers/video/fbdev/msm/mdp_ppp.c               |  731 ---------
 drivers/video/fbdev/msm/mdp_scale_tables.c      |  766 ---------
 drivers/video/fbdev/msm/mdp_scale_tables.h      |   38 -
 drivers/video/fbdev/msm/msm_fb.c                |  659 --------
 include/linux/platform_data/mmc-msm_sdcc.h      |   27 -
 include/linux/platform_data/msm_serial_hs.h     |   49 -
 include/linux/platform_data/video-msm_fb.h      |  146 --
 include/linux/usb/msm_hsusb.h                   |    4 -
 98 files changed, 16 insertions(+), 19253 deletions(-)
 delete mode 100644 Documentation/arm/msm/gpiomux.txt
 delete mode 100644 arch/arm/configs/msm_defconfig
 delete mode 100644 arch/arm/mach-msm/Kconfig
 delete mode 100644 arch/arm/mach-msm/Makefile
 delete mode 100644 arch/arm/mach-msm/Makefile.boot
 delete mode 100644 arch/arm/mach-msm/board-halibut.c
 delete mode 100644 arch/arm/mach-msm/board-msm7x30.c
 delete mode 100644 arch/arm/mach-msm/board-qsd8x50.c
 delete mode 100644 arch/arm/mach-msm/board-sapphire.c
 delete mode 100644 arch/arm/mach-msm/board-trout-gpio.c
 delete mode 100644 arch/arm/mach-msm/board-trout-mmc.c
 delete mode 100644 arch/arm/mach-msm/board-trout-panel.c
 delete mode 100644 arch/arm/mach-msm/board-trout.c
 delete mode 100644 arch/arm/mach-msm/board-trout.h
 delete mode 100644 arch/arm/mach-msm/clock-pcom.c
 delete mode 100644 arch/arm/mach-msm/clock-pcom.h
 delete mode 100644 arch/arm/mach-msm/clock.c
 delete mode 100644 arch/arm/mach-msm/clock.h
 delete mode 100644 arch/arm/mach-msm/common.h
 delete mode 100644 arch/arm/mach-msm/devices-msm7x00.c
 delete mode 100644 arch/arm/mach-msm/devices-msm7x30.c
 delete mode 100644 arch/arm/mach-msm/devices-qsd8x50.c
 delete mode 100644 arch/arm/mach-msm/devices.h
 delete mode 100644 arch/arm/mach-msm/dma.c
 delete mode 100644 arch/arm/mach-msm/gpiomux-8x50.c
 delete mode 100644 arch/arm/mach-msm/gpiomux-v1.h
 delete mode 100644 arch/arm/mach-msm/gpiomux.c
 delete mode 100644 arch/arm/mach-msm/gpiomux.h
 delete mode 100644 arch/arm/mach-msm/include/mach/clk.h
 delete mode 100644 arch/arm/mach-msm/include/mach/dma.h
 delete mode 100644 arch/arm/mach-msm/include/mach/entry-macro.S
 delete mode 100644 arch/arm/mach-msm/include/mach/hardware.h
 delete mode 100644 arch/arm/mach-msm/include/mach/irqs-7x00.h
 delete mode 100644 arch/arm/mach-msm/include/mach/irqs-7x30.h
 delete mode 100644 arch/arm/mach-msm/include/mach/irqs-8x50.h
 delete mode 100644 arch/arm/mach-msm/include/mach/irqs.h
 delete mode 100644 arch/arm/mach-msm/include/mach/msm_gpiomux.h
 delete mode 100644 arch/arm/mach-msm/include/mach/msm_iomap-7x00.h
 delete mode 100644 arch/arm/mach-msm/include/mach/msm_iomap-7x30.h
 delete mode 100644 arch/arm/mach-msm/include/mach/msm_iomap-8x50.h
 delete mode 100644 arch/arm/mach-msm/include/mach/msm_iomap.h
 delete mode 100644 arch/arm/mach-msm/include/mach/msm_smd.h
 delete mode 100644 arch/arm/mach-msm/include/mach/sirc.h
 delete mode 100644 arch/arm/mach-msm/include/mach/vreg.h
 delete mode 100644 arch/arm/mach-msm/io.c
 delete mode 100644 arch/arm/mach-msm/irq-vic.c
 delete mode 100644 arch/arm/mach-msm/irq.c
 delete mode 100644 arch/arm/mach-msm/last_radio_log.c
 delete mode 100644 arch/arm/mach-msm/proc_comm.c
 delete mode 100644 arch/arm/mach-msm/proc_comm.h
 delete mode 100644 arch/arm/mach-msm/sirc.c
 delete mode 100644 arch/arm/mach-msm/smd.c
 delete mode 100644 arch/arm/mach-msm/smd_debug.c
 delete mode 100644 arch/arm/mach-msm/smd_private.h
 delete mode 100644 arch/arm/mach-msm/vreg.c
 delete mode 100644 drivers/gpio/gpio-msm-v1.c
 delete mode 100644 drivers/mmc/host/msm_sdcc.c
 delete mode 100644 drivers/mmc/host/msm_sdcc.h
 delete mode 100644 drivers/tty/serial/msm_serial_hs.c
 delete mode 100644 drivers/video/fbdev/msm/Makefile
 delete mode 100644 drivers/video/fbdev/msm/mddi.c
 delete mode 100644 drivers/video/fbdev/msm/mddi_client_dummy.c
 delete mode 100644 drivers/video/fbdev/msm/mddi_client_nt35399.c
 delete mode 100644 drivers/video/fbdev/msm/mddi_client_toshiba.c
 delete mode 100644 drivers/video/fbdev/msm/mddi_hw.h
 delete mode 100644 drivers/video/fbdev/msm/mdp.c
 delete mode 100644 drivers/video/fbdev/msm/mdp_csc_table.h
 delete mode 100644 drivers/video/fbdev/msm/mdp_hw.h
 delete mode 100644 drivers/video/fbdev/msm/mdp_ppp.c
 delete mode 100644 drivers/video/fbdev/msm/mdp_scale_tables.c
 delete mode 100644 drivers/video/fbdev/msm/mdp_scale_tables.h
 delete mode 100644 drivers/video/fbdev/msm/msm_fb.c
 delete mode 100644 include/linux/platform_data/mmc-msm_sdcc.h
 delete mode 100644 include/linux/platform_data/msm_serial_hs.h
 delete mode 100644 include/linux/platform_data/video-msm_fb.h

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH 01/12] ARM: Remove mach-msm and associated ARM architecture code
  2015-03-13 18:09 [PATCH 00/12] Remove mach-msm and associated code Stephen Boyd
@ 2015-03-13 18:09 ` Stephen Boyd
  2015-03-13 19:36   ` Paul Bolle
  2015-03-13 18:09 ` [PATCH 02/12] gpio: Remove gpio-msm-v1 driver Stephen Boyd
                   ` (11 subsequent siblings)
  12 siblings, 1 reply; 32+ messages in thread
From: Stephen Boyd @ 2015-03-13 18:09 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: linux-arm-kernel, linux-kernel, David Brown, Bryan Huntsman,
	Daniel Walker, Arnd Bergmann

The maintainers for mach-msm no longer have any plans to support
or test the platforms supported by this architecture[1]. Most likely
there aren't any active users of this code anyway, so let's
delete it.

[1] http://lkml.kernel.org/r/20150307031212.GA8434@fifo99.com
Cc: David Brown <davidb@codeaurora.org>
Cc: Bryan Huntsman <bryanh@codeaurora.org>
Cc: Daniel Walker <dwalker@fifo99.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
 Documentation/arm/00-INDEX                      |    2 -
 Documentation/arm/msm/gpiomux.txt               |  176 ----
 MAINTAINERS                                     |   20 +-
 arch/arm/Kconfig                                |   14 -
 arch/arm/Kconfig.debug                          |   31 +-
 arch/arm/Makefile                               |    2 -
 arch/arm/configs/msm_defconfig                  |  121 ---
 arch/arm/include/debug/msm.S                    |   14 -
 arch/arm/mach-msm/Kconfig                       |  109 ---
 arch/arm/mach-msm/Makefile                      |   23 -
 arch/arm/mach-msm/Makefile.boot                 |    3 -
 arch/arm/mach-msm/board-halibut.c               |  104 ---
 arch/arm/mach-msm/board-msm7x30.c               |  191 -----
 arch/arm/mach-msm/board-qsd8x50.c               |  248 ------
 arch/arm/mach-msm/board-sapphire.c              |  114 ---
 arch/arm/mach-msm/board-trout-gpio.c            |  233 -----
 arch/arm/mach-msm/board-trout-mmc.c             |  185 ----
 arch/arm/mach-msm/board-trout-panel.c           |  292 -------
 arch/arm/mach-msm/board-trout.c                 |  111 ---
 arch/arm/mach-msm/board-trout.h                 |  162 ----
 arch/arm/mach-msm/clock-pcom.c                  |  176 ----
 arch/arm/mach-msm/clock-pcom.h                  |  145 ----
 arch/arm/mach-msm/clock.c                       |   28 -
 arch/arm/mach-msm/clock.h                       |   43 -
 arch/arm/mach-msm/common.h                      |   41 -
 arch/arm/mach-msm/devices-msm7x00.c             |  480 -----------
 arch/arm/mach-msm/devices-msm7x30.c             |  246 ------
 arch/arm/mach-msm/devices-qsd8x50.c             |  388 ---------
 arch/arm/mach-msm/devices.h                     |   53 --
 arch/arm/mach-msm/dma.c                         |  298 -------
 arch/arm/mach-msm/gpiomux-8x50.c                |   51 --
 arch/arm/mach-msm/gpiomux-v1.h                  |   67 --
 arch/arm/mach-msm/gpiomux.c                     |  111 ---
 arch/arm/mach-msm/gpiomux.h                     |   84 --
 arch/arm/mach-msm/include/mach/clk.h            |   31 -
 arch/arm/mach-msm/include/mach/dma.h            |  151 ----
 arch/arm/mach-msm/include/mach/entry-macro.S    |   36 -
 arch/arm/mach-msm/include/mach/hardware.h       |   18 -
 arch/arm/mach-msm/include/mach/irqs-7x00.h      |   75 --
 arch/arm/mach-msm/include/mach/irqs-7x30.h      |  153 ----
 arch/arm/mach-msm/include/mach/irqs-8x50.h      |   88 --
 arch/arm/mach-msm/include/mach/irqs.h           |   37 -
 arch/arm/mach-msm/include/mach/msm_gpiomux.h    |   38 -
 arch/arm/mach-msm/include/mach/msm_iomap-7x00.h |  108 ---
 arch/arm/mach-msm/include/mach/msm_iomap-7x30.h |  103 ---
 arch/arm/mach-msm/include/mach/msm_iomap-8x50.h |  125 ---
 arch/arm/mach-msm/include/mach/msm_iomap.h      |   53 --
 arch/arm/mach-msm/include/mach/msm_smd.h        |  109 ---
 arch/arm/mach-msm/include/mach/sirc.h           |   98 ---
 arch/arm/mach-msm/include/mach/vreg.h           |   29 -
 arch/arm/mach-msm/io.c                          |  161 ----
 arch/arm/mach-msm/irq-vic.c                     |  363 --------
 arch/arm/mach-msm/irq.c                         |  151 ----
 arch/arm/mach-msm/last_radio_log.c              |   71 --
 arch/arm/mach-msm/proc_comm.c                   |  129 ---
 arch/arm/mach-msm/proc_comm.h                   |  258 ------
 arch/arm/mach-msm/sirc.c                        |  172 ----
 arch/arm/mach-msm/smd.c                         | 1034 -----------------------
 arch/arm/mach-msm/smd_debug.c                   |  311 -------
 arch/arm/mach-msm/smd_private.h                 |  403 ---------
 arch/arm/mach-msm/vreg.c                        |  220 -----
 61 files changed, 9 insertions(+), 8882 deletions(-)
 delete mode 100644 Documentation/arm/msm/gpiomux.txt
 delete mode 100644 arch/arm/configs/msm_defconfig
 delete mode 100644 arch/arm/mach-msm/Kconfig
 delete mode 100644 arch/arm/mach-msm/Makefile
 delete mode 100644 arch/arm/mach-msm/Makefile.boot
 delete mode 100644 arch/arm/mach-msm/board-halibut.c
 delete mode 100644 arch/arm/mach-msm/board-msm7x30.c
 delete mode 100644 arch/arm/mach-msm/board-qsd8x50.c
 delete mode 100644 arch/arm/mach-msm/board-sapphire.c
 delete mode 100644 arch/arm/mach-msm/board-trout-gpio.c
 delete mode 100644 arch/arm/mach-msm/board-trout-mmc.c
 delete mode 100644 arch/arm/mach-msm/board-trout-panel.c
 delete mode 100644 arch/arm/mach-msm/board-trout.c
 delete mode 100644 arch/arm/mach-msm/board-trout.h
 delete mode 100644 arch/arm/mach-msm/clock-pcom.c
 delete mode 100644 arch/arm/mach-msm/clock-pcom.h
 delete mode 100644 arch/arm/mach-msm/clock.c
 delete mode 100644 arch/arm/mach-msm/clock.h
 delete mode 100644 arch/arm/mach-msm/common.h
 delete mode 100644 arch/arm/mach-msm/devices-msm7x00.c
 delete mode 100644 arch/arm/mach-msm/devices-msm7x30.c
 delete mode 100644 arch/arm/mach-msm/devices-qsd8x50.c
 delete mode 100644 arch/arm/mach-msm/devices.h
 delete mode 100644 arch/arm/mach-msm/dma.c
 delete mode 100644 arch/arm/mach-msm/gpiomux-8x50.c
 delete mode 100644 arch/arm/mach-msm/gpiomux-v1.h
 delete mode 100644 arch/arm/mach-msm/gpiomux.c
 delete mode 100644 arch/arm/mach-msm/gpiomux.h
 delete mode 100644 arch/arm/mach-msm/include/mach/clk.h
 delete mode 100644 arch/arm/mach-msm/include/mach/dma.h
 delete mode 100644 arch/arm/mach-msm/include/mach/entry-macro.S
 delete mode 100644 arch/arm/mach-msm/include/mach/hardware.h
 delete mode 100644 arch/arm/mach-msm/include/mach/irqs-7x00.h
 delete mode 100644 arch/arm/mach-msm/include/mach/irqs-7x30.h
 delete mode 100644 arch/arm/mach-msm/include/mach/irqs-8x50.h
 delete mode 100644 arch/arm/mach-msm/include/mach/irqs.h
 delete mode 100644 arch/arm/mach-msm/include/mach/msm_gpiomux.h
 delete mode 100644 arch/arm/mach-msm/include/mach/msm_iomap-7x00.h
 delete mode 100644 arch/arm/mach-msm/include/mach/msm_iomap-7x30.h
 delete mode 100644 arch/arm/mach-msm/include/mach/msm_iomap-8x50.h
 delete mode 100644 arch/arm/mach-msm/include/mach/msm_iomap.h
 delete mode 100644 arch/arm/mach-msm/include/mach/msm_smd.h
 delete mode 100644 arch/arm/mach-msm/include/mach/sirc.h
 delete mode 100644 arch/arm/mach-msm/include/mach/vreg.h
 delete mode 100644 arch/arm/mach-msm/io.c
 delete mode 100644 arch/arm/mach-msm/irq-vic.c
 delete mode 100644 arch/arm/mach-msm/irq.c
 delete mode 100644 arch/arm/mach-msm/last_radio_log.c
 delete mode 100644 arch/arm/mach-msm/proc_comm.c
 delete mode 100644 arch/arm/mach-msm/proc_comm.h
 delete mode 100644 arch/arm/mach-msm/sirc.c
 delete mode 100644 arch/arm/mach-msm/smd.c
 delete mode 100644 arch/arm/mach-msm/smd_debug.c
 delete mode 100644 arch/arm/mach-msm/smd_private.h
 delete mode 100644 arch/arm/mach-msm/vreg.c

diff --git a/Documentation/arm/00-INDEX b/Documentation/arm/00-INDEX
index 8edb9007844e..dea011c8d7c7 100644
--- a/Documentation/arm/00-INDEX
+++ b/Documentation/arm/00-INDEX
@@ -10,8 +10,6 @@ IXP4xx
 	- Intel IXP4xx Network processor.
 Makefile
 	- Build sourcefiles as part of the Documentation-build for arm
-msm/
-	- MSM specific documentation
 Netwinder
 	- Netwinder specific documentation
 Porting
diff --git a/Documentation/arm/msm/gpiomux.txt b/Documentation/arm/msm/gpiomux.txt
deleted file mode 100644
index 67a81620adf6..000000000000
--- a/Documentation/arm/msm/gpiomux.txt
+++ /dev/null
@@ -1,176 +0,0 @@
-This document provides an overview of the msm_gpiomux interface, which
-is used to provide gpio pin multiplexing and configuration on mach-msm
-targets.
-
-History
-=======
-
-The first-generation API for gpio configuration & multiplexing on msm
-is the function gpio_tlmm_config().  This function has a few notable
-shortcomings, which led to its deprecation and replacement by gpiomux:
-
-The 'disable' parameter:  Setting the second parameter to
-gpio_tlmm_config to GPIO_CFG_DISABLE tells the peripheral
-processor in charge of the subsystem to perform a look-up into a
-low-power table and apply the low-power/sleep setting for the pin.
-As the msm family evolved this became problematic. Not all pins
-have sleep settings, not all peripheral processors will accept requests
-to apply said sleep settings, and not all msm targets have their gpio
-subsystems managed by a peripheral processor. In order to get consistent
-behavior on all targets, drivers are forced to ignore this parameter,
-rendering it useless.
-
-The 'direction' flag: for all mux-settings other than raw-gpio (0),
-the output-enable bit of a gpio is hard-wired to a known
-input (usually VDD or ground).  For those settings, the direction flag
-is meaningless at best, and deceptive at worst.  In addition, using the
-direction flag to change output-enable (OE) directly can cause trouble in
-gpiolib, which has no visibility into gpio direction changes made
-in this way.  Direction control in gpio mode should be made through gpiolib.
-
-Key Features of gpiomux
-=======================
-
-- A consistent interface across all generations of msm.  Drivers can expect
-the same results on every target.
-- gpiomux plays nicely with gpiolib.  Functions that should belong to gpiolib
-are left to gpiolib and not duplicated here.  gpiomux is written with the
-intent that gpio_chips will call gpiomux reference-counting methods
-from their request() and free() hooks, providing full integration.
-- Tabular configuration.  Instead of having to call gpio_tlmm_config
-hundreds of times, gpio configuration is placed in a single table.
-- Per-gpio sleep.  Each gpio is individually reference counted, allowing only
-those lines which are in use to be put in high-power states.
-- 0 means 'do nothing': all flags are designed so that the default memset-zero
-equates to a sensible default of 'no configuration', preventing users
-from having to provide hundreds of 'no-op' configs for unused or
-unwanted lines.
-
-Usage
-=====
-
-To use gpiomux, provide configuration information for relevant gpio lines
-in the msm_gpiomux_configs table.  Since a 0 equates to "unconfigured",
-only those lines to be managed by gpiomux need to be specified.  Here
-is a completely fictional example:
-
-struct msm_gpiomux_config msm_gpiomux_configs[GPIOMUX_NGPIOS] = {
-	[12] = {
-		.active = GPIOMUX_VALID | GPIOMUX_DRV_8MA | GPIOMUX_FUNC_1,
-		.suspended = GPIOMUX_VALID | GPIOMUX_PULL_DOWN,
-	},
-	[34] = {
-		.suspended = GPIOMUX_VALID | GPIOMUX_PULL_DOWN,
-	},
-};
-
-To indicate that a gpio is in use, call msm_gpiomux_get() to increase
-its reference count.  To decrease the reference count, call msm_gpiomux_put().
-
-The effect of this configuration is as follows:
-
-When the system boots, gpios 12 and 34 will be initialized with their
-'suspended' configurations.  All other gpios, which were left unconfigured,
-will not be touched.
-
-When msm_gpiomux_get() is called on gpio 12 to raise its reference count
-above 0, its active configuration will be applied.  Since no other gpio
-line has a valid active configuration, msm_gpiomux_get() will have no
-effect on any other line.
-
-When msm_gpiomux_put() is called on gpio 12 or 34 to drop their reference
-count to 0, their suspended configurations will be applied.
-Since no other gpio line has a valid suspended configuration, no other
-gpio line will be effected by msm_gpiomux_put().  Since gpio 34 has no valid
-active configuration, this is effectively a no-op for gpio 34 as well,
-with one small caveat, see the section "About Output-Enable Settings".
-
-All of the GPIOMUX_VALID flags may seem like unnecessary overhead, but
-they address some important issues.  As unused entries (all those
-except 12 and 34) are zero-filled, gpiomux needs a way to distinguish
-the used fields from the unused.  In addition, the all-zero pattern
-is a valid configuration!  Therefore, gpiomux defines an additional bit
-which is used to indicate when a field is used.  This has the pleasant
-side-effect of allowing calls to msm_gpiomux_write to use '0' to indicate
-that a value should not be changed:
-
-  msm_gpiomux_write(0, GPIOMUX_VALID, 0);
-
-replaces the active configuration of gpio 0 with an all-zero configuration,
-but leaves the suspended configuration as it was.
-
-Static Configurations
-=====================
-
-To install a static configuration, which is applied at boot and does
-not change after that, install a configuration with a suspended component
-but no active component, as in the previous example:
-
-	[34] = {
-		.suspended = GPIOMUX_VALID | GPIOMUX_PULL_DOWN,
-	},
-
-The suspended setting is applied during boot, and the lack of any valid
-active setting prevents any other setting from being applied at runtime.
-If other subsystems attempting to access the line is a concern, one could
-*really* anchor the configuration down by calling msm_gpiomux_get on the
-line at initialization to move the line into active mode.  With the line
-held, it will never be re-suspended, and with no valid active configuration,
-no new configurations will be applied.
-
-But then, if having other subsystems grabbing for the line is truly a concern,
-it should be reserved with gpio_request instead, which carries an implicit
-msm_gpiomux_get.
-
-gpiomux and gpiolib
-===================
-
-It is expected that msm gpio_chips will call msm_gpiomux_get() and
-msm_gpiomux_put() from their request and free hooks, like this fictional
-example:
-
-static int request(struct gpio_chip *chip, unsigned offset)
-{
-        return msm_gpiomux_get(chip->base + offset);
-}
-
-static void free(struct gpio_chip *chip, unsigned offset)
-{
-        msm_gpiomux_put(chip->base + offset);
-}
-
-	...somewhere in a gpio_chip declaration...
-	.request = request,
-	.free    = free,
-
-This provides important functionality:
-- It guarantees that a gpio line will have its 'active' config applied
-  when the line is requested, and will not be suspended while the line
-  remains requested; and
-- It guarantees that gpio-direction settings from gpiolib behave sensibly.
-  See "About Output-Enable Settings."
-
-This mechanism allows for "auto-request" of gpiomux lines via gpiolib
-when it is suitable.  Drivers wishing more exact control are, of course,
-free to also use msm_gpiomux_set and msm_gpiomux_get.
-
-About Output-Enable Settings
-============================
-
-Some msm targets do not have the ability to query the current gpio
-configuration setting.  This means that changes made to the output-enable
-(OE) bit by gpiolib cannot be consistently detected and preserved by gpiomux.
-Therefore, when gpiomux applies a configuration setting, any direction
-settings which may have been applied by gpiolib are lost and the default
-input settings are re-applied.
-
-For this reason, drivers should not assume that gpio direction settings
-continue to hold if they free and then re-request a gpio.  This seems like
-common sense - after all, anybody could have obtained the line in the
-meantime - but it needs saying.
-
-This also means that calls to msm_gpiomux_write will reset the OE bit,
-which means that if the gpio line is held by a client of gpiolib and
-msm_gpiomux_write is called, the direction setting has been lost and
-gpiolib's internal state has been broken.
-Release gpio lines before reconfiguring them.
diff --git a/MAINTAINERS b/MAINTAINERS
index 60e3c8c81a5c..1a1bf1619be2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1244,22 +1244,6 @@ L:	openmoko-kernel@lists.openmoko.org (subscribers-only)
 W:	http://wiki.openmoko.org/wiki/Neo_FreeRunner
 S:	Supported
 
-ARM/QUALCOMM MSM MACHINE SUPPORT
-M:	David Brown <davidb@codeaurora.org>
-M:	Daniel Walker <dwalker@fifo99.com>
-M:	Bryan Huntsman <bryanh@codeaurora.org>
-L:	linux-arm-msm@vger.kernel.org
-F:	arch/arm/mach-msm/
-F:	drivers/video/fbdev/msm/
-F:	drivers/mmc/host/msm_sdcc.c
-F:	drivers/mmc/host/msm_sdcc.h
-F:	drivers/tty/serial/msm_serial.h
-F:	drivers/tty/serial/msm_serial.c
-F:	drivers/*/pm8???-*
-F:	drivers/mfd/ssbi.c
-T:	git git://git.kernel.org/pub/scm/linux/kernel/git/davidb/linux-msm.git
-S:	Maintained
-
 ARM/TOSA MACHINE SUPPORT
 M:	Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
 M:	Dirk Opfer <dirk@opfer-online.de>
@@ -1317,6 +1301,10 @@ L:	linux-soc@vger.kernel.org
 S:	Maintained
 F:	arch/arm/mach-qcom/
 F:	drivers/soc/qcom/
+F:	drivers/tty/serial/msm_serial.h
+F:	drivers/tty/serial/msm_serial.c
+F:	drivers/*/pm8???-*
+F:	drivers/mfd/ssbi.c
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/galak/linux-qcom.git
 
 ARM/RADISYS ENP2611 MACHINE SUPPORT
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 55f1d9ba4b20..bb19add04bde 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -625,18 +625,6 @@ config ARCH_PXA
 	help
 	  Support for Intel/Marvell's PXA2xx/PXA3xx processor line.
 
-config ARCH_MSM
-	bool "Qualcomm MSM (non-multiplatform)"
-	select ARCH_REQUIRE_GPIOLIB
-	select COMMON_CLK
-	select GENERIC_CLOCKEVENTS
-	help
-	  Support for Qualcomm MSM/QSD based systems.  This runs on the
-	  apps processor of the MSM/QSD and depends on a shared memory
-	  interface to the modem processor which runs the baseband
-	  stack and controls some vital subsystems
-	  (clock and power control, etc).
-
 config ARCH_SHMOBILE_LEGACY
 	bool "Renesas ARM SoCs (non-multiplatform)"
 	select ARCH_SHMOBILE
@@ -889,8 +877,6 @@ source "arch/arm/mach-ks8695/Kconfig"
 
 source "arch/arm/mach-meson/Kconfig"
 
-source "arch/arm/mach-msm/Kconfig"
-
 source "arch/arm/mach-moxart/Kconfig"
 
 source "arch/arm/mach-mv78xx0/Kconfig"
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 6e55ed915332..a989e9f15227 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -448,25 +448,6 @@ choice
 		  Say Y here if you want kernel low-level debugging support
 		  on MMP UART3.
 
-	config DEBUG_MSM_UART
-		bool "Kernel low-level debugging messages via MSM UART"
-		depends on ARCH_MSM
-		help
-		  Say Y here if you want the debug print routines to direct
-		  their output to the serial port on MSM devices.
-
-		  ARCH                DEBUG_UART_PHYS   DEBUG_UART_VIRT   #
-		  MSM7X00A, QSD8X50   0xa9a00000        0xe1000000        UART1
-		  MSM7X00A, QSD8X50   0xa9b00000        0xe1000000        UART2
-		  MSM7X00A, QSD8X50   0xa9c00000        0xe1000000        UART3
-
-		  MSM7X30             0xaca00000        0xe1000000        UART1
-		  MSM7X30             0xacb00000        0xe1000000        UART2
-		  MSM7X30             0xacc00000        0xe1000000        UART3
-
-		  Please adjust DEBUG_UART_PHYS and DEBUG_UART_BASE configuration
-		  options based on your needs.
-
 	config DEBUG_QCOM_UARTDM
 		bool "Kernel low-level debugging messages via QCOM UARTDM"
 		depends on ARCH_QCOM
@@ -1294,7 +1275,7 @@ config DEBUG_LL_INCLUDE
 				 DEBUG_IMX6SL_UART || \
 				 DEBUG_IMX6SX_UART
 	default "debug/ks8695.S" if DEBUG_KS8695_UART
-	default "debug/msm.S" if DEBUG_MSM_UART || DEBUG_QCOM_UARTDM
+	default "debug/msm.S" if DEBUG_QCOM_UARTDM
 	default "debug/netx.S" if DEBUG_NETX_UART
 	default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART
 	default "debug/renesas-scif.S" if DEBUG_R7S72100_SCIF2
@@ -1387,7 +1368,6 @@ config DEBUG_UART_PHYS
 	default 0x80230000 if DEBUG_PICOXCELL_UART
 	default 0x808c0000 if ARCH_EP93XX
 	default 0x90020000 if DEBUG_NSPIRE_CLASSIC_UART || DEBUG_NSPIRE_CX_UART
-	default 0xa9a00000 if DEBUG_MSM_UART
 	default 0xb0060000 if DEBUG_SIRFPRIMA2_UART1
 	default 0xb0090000 if DEBUG_VEXPRESS_UART0_CRX
 	default 0xc0013000 if DEBUG_U300_UART
@@ -1432,7 +1412,7 @@ config DEBUG_UART_PHYS
 	        DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \
 		DEBUG_LL_UART_EFM32 || \
 		DEBUG_UART_8250 || DEBUG_UART_PL01X || DEBUG_MESON_UARTAO || \
-		DEBUG_MSM_UART || DEBUG_NETX_UART || \
+		DEBUG_NETX_UART || \
 		DEBUG_QCOM_UARTDM || DEBUG_R7S72100_SCIF2 || \
 		DEBUG_RCAR_GEN1_SCIF0 || DEBUG_RCAR_GEN1_SCIF2 || \
 		DEBUG_RCAR_GEN2_SCIF0 || DEBUG_RCAR_GEN2_SCIF2 || \
@@ -1445,7 +1425,6 @@ config DEBUG_UART_VIRT
 	hex "Virtual base address of debug UART"
 	default 0xe0000a00 if DEBUG_NETX_UART
 	default 0xe0010fe0 if ARCH_RPC
-	default 0xe1000000 if DEBUG_MSM_UART
 	default 0xf0000be0 if ARCH_EBSA110
 	default 0xf0010000 if DEBUG_ASM9260_UART
 	default 0xf01fb000 if DEBUG_NOMADIK_UART
@@ -1525,7 +1504,7 @@ config DEBUG_UART_VIRT
 	default DEBUG_UART_PHYS if !MMU
 	depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \
 		DEBUG_UART_8250 || DEBUG_UART_PL01X || DEBUG_MESON_UARTAO || \
-		DEBUG_MSM_UART || DEBUG_NETX_UART || \
+		DEBUG_NETX_UART || \
 		DEBUG_QCOM_UARTDM || DEBUG_S3C24XX_UART || \
 		DEBUG_UART_BCM63XX || DEBUG_ASM9260_UART || \
 		DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0
@@ -1555,7 +1534,7 @@ config DEBUG_UART_8250_FLOW_CONTROL
 
 config DEBUG_UNCOMPRESS
 	bool
-	depends on ARCH_MULTIPLATFORM || ARCH_MSM || PLAT_SAMSUNG
+	depends on ARCH_MULTIPLATFORM || PLAT_SAMSUNG
 	default y if DEBUG_LL && !DEBUG_OMAP2PLUS_UART && \
 		     (!DEBUG_TEGRA_UART || !ZBOOT_ROM)
 	help
@@ -1571,7 +1550,7 @@ config DEBUG_UNCOMPRESS
 
 config UNCOMPRESS_INCLUDE
 	string
-	default "debug/uncompress.h" if ARCH_MULTIPLATFORM || ARCH_MSM || \
+	default "debug/uncompress.h" if ARCH_MULTIPLATFORM || \
 					PLAT_SAMSUNG || ARCH_EFM32 || \
 					ARCH_SHMOBILE_LEGACY
 	default "mach/uncompress.h"
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 7f99cd652203..fa03c13ddfec 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -136,7 +136,6 @@ textofs-$(CONFIG_PM_H1940)      := 0x00108000
 ifeq ($(CONFIG_ARCH_SA1100),y)
 textofs-$(CONFIG_SA1111) := 0x00208000
 endif
-textofs-$(CONFIG_ARCH_MSM7X30) := 0x00208000
 textofs-$(CONFIG_ARCH_MSM8X60) := 0x00208000
 textofs-$(CONFIG_ARCH_MSM8960) := 0x00208000
 textofs-$(CONFIG_ARCH_AXXIA) := 0x00308000
@@ -170,7 +169,6 @@ machine-$(CONFIG_ARCH_LPC32XX)		+= lpc32xx
 machine-$(CONFIG_ARCH_MESON)		+= meson
 machine-$(CONFIG_ARCH_MMP)		+= mmp
 machine-$(CONFIG_ARCH_MOXART)		+= moxart
-machine-$(CONFIG_ARCH_MSM)		+= msm
 machine-$(CONFIG_ARCH_MV78XX0)		+= mv78xx0
 machine-$(CONFIG_ARCH_MVEBU)		+= mvebu
 machine-$(CONFIG_ARCH_MXC)		+= imx
diff --git a/arch/arm/configs/msm_defconfig b/arch/arm/configs/msm_defconfig
deleted file mode 100644
index dd18c9e527d6..000000000000
--- a/arch/arm/configs/msm_defconfig
+++ /dev/null
@@ -1,121 +0,0 @@
-CONFIG_SYSVIPC=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-CONFIG_IKCONFIG=y
-CONFIG_IKCONFIG_PROC=y
-CONFIG_BLK_DEV_INITRD=y
-CONFIG_SYSCTL_SYSCALL=y
-CONFIG_KALLSYMS_ALL=y
-CONFIG_EMBEDDED=y
-# CONFIG_SLUB_DEBUG is not set
-# CONFIG_COMPAT_BRK is not set
-CONFIG_PROFILING=y
-CONFIG_OPROFILE=y
-CONFIG_KPROBES=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
-CONFIG_MODULE_FORCE_UNLOAD=y
-CONFIG_MODVERSIONS=y
-CONFIG_PARTITION_ADVANCED=y
-CONFIG_ARCH_MSM=y
-CONFIG_PREEMPT=y
-CONFIG_AEABI=y
-CONFIG_HIGHMEM=y
-CONFIG_HIGHPTE=y
-CONFIG_CLEANCACHE=y
-CONFIG_AUTO_ZRELADDR=y
-CONFIG_VFP=y
-# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
-CONFIG_NET=y
-CONFIG_PACKET=y
-CONFIG_UNIX=y
-CONFIG_INET=y
-CONFIG_IP_ADVANCED_ROUTER=y
-CONFIG_IP_MULTIPLE_TABLES=y
-CONFIG_IP_ROUTE_VERBOSE=y
-CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
-# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
-# CONFIG_INET_XFRM_MODE_TUNNEL is not set
-# CONFIG_INET_XFRM_MODE_BEET is not set
-# CONFIG_INET_LRO is not set
-# CONFIG_IPV6 is not set
-CONFIG_CFG80211=y
-CONFIG_RFKILL=y
-CONFIG_BLK_DEV_LOOP=y
-CONFIG_BLK_DEV_RAM=y
-CONFIG_SCSI=y
-CONFIG_BLK_DEV_SD=y
-CONFIG_CHR_DEV_SG=y
-CONFIG_CHR_DEV_SCH=y
-CONFIG_SCSI_MULTI_LUN=y
-CONFIG_SCSI_CONSTANTS=y
-CONFIG_SCSI_LOGGING=y
-CONFIG_SCSI_SCAN_ASYNC=y
-CONFIG_NETDEVICES=y
-CONFIG_DUMMY=y
-CONFIG_SLIP=y
-CONFIG_SLIP_COMPRESSED=y
-CONFIG_SLIP_MODE_SLIP6=y
-CONFIG_USB_USBNET=y
-# CONFIG_USB_NET_AX8817X is not set
-# CONFIG_USB_NET_ZAURUS is not set
-CONFIG_INPUT_EVDEV=y
-# CONFIG_KEYBOARD_ATKBD is not set
-# CONFIG_MOUSE_PS2 is not set
-CONFIG_INPUT_JOYSTICK=y
-CONFIG_INPUT_TOUCHSCREEN=y
-CONFIG_INPUT_MISC=y
-CONFIG_INPUT_UINPUT=y
-CONFIG_SERIO_LIBPS2=y
-# CONFIG_LEGACY_PTYS is not set
-CONFIG_SERIAL_MSM=y
-CONFIG_SERIAL_MSM_CONSOLE=y
-# CONFIG_HW_RANDOM is not set
-CONFIG_I2C=y
-CONFIG_I2C_CHARDEV=y
-CONFIG_SPI=y
-CONFIG_DEBUG_GPIO=y
-CONFIG_GPIO_SYSFS=y
-CONFIG_THERMAL=y
-CONFIG_REGULATOR=y
-CONFIG_MEDIA_SUPPORT=y
-CONFIG_FB=y
-CONFIG_SOUND=y
-CONFIG_SND=y
-CONFIG_SND_DYNAMIC_MINORS=y
-# CONFIG_SND_ARM is not set
-# CONFIG_SND_SPI is not set
-# CONFIG_SND_USB is not set
-CONFIG_SND_SOC=y
-CONFIG_USB=y
-CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
-CONFIG_USB_MON=y
-CONFIG_USB_EHCI_HCD=y
-CONFIG_USB_ACM=y
-CONFIG_USB_SERIAL=y
-CONFIG_USB_GADGET=y
-CONFIG_USB_GADGET_DEBUG_FILES=y
-CONFIG_USB_GADGET_VBUS_DRAW=500
-CONFIG_RTC_CLASS=y
-CONFIG_STAGING=y
-CONFIG_EXT2_FS=y
-CONFIG_EXT2_FS_XATTR=y
-CONFIG_EXT3_FS=y
-# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
-CONFIG_EXT4_FS=y
-CONFIG_FUSE_FS=y
-CONFIG_VFAT_FS=y
-CONFIG_TMPFS=y
-CONFIG_NFS_FS=y
-CONFIG_NFS_V3_ACL=y
-CONFIG_NFS_V4=y
-CONFIG_CIFS=y
-CONFIG_PRINTK_TIME=y
-CONFIG_DYNAMIC_DEBUG=y
-CONFIG_DEBUG_INFO=y
-CONFIG_MAGIC_SYSRQ=y
-CONFIG_LOCKUP_DETECTOR=y
-# CONFIG_DETECT_HUNG_TASK is not set
-# CONFIG_SCHED_DEBUG is not set
-CONFIG_TIMER_STATS=y
diff --git a/arch/arm/include/debug/msm.S b/arch/arm/include/debug/msm.S
index e55a9426b496..b03024fa671f 100644
--- a/arch/arm/include/debug/msm.S
+++ b/arch/arm/include/debug/msm.S
@@ -16,24 +16,17 @@
  */
 
 	.macro	addruart, rp, rv, tmp
-#ifdef CONFIG_DEBUG_UART_PHYS
 	ldr	\rp, =CONFIG_DEBUG_UART_PHYS
 	ldr	\rv, =CONFIG_DEBUG_UART_VIRT
-#endif
 	.endm
 
 	.macro	senduart, rd, rx
 ARM_BE8(rev	\rd, \rd )
-#ifdef CONFIG_DEBUG_QCOM_UARTDM
 	@ Write the 1 character to UARTDM_TF
 	str	\rd, [\rx, #0x70]
-#else
-	str	\rd, [\rx, #0x0C]
-#endif
 	.endm
 
 	.macro	waituart, rd, rx
-#ifdef CONFIG_DEBUG_QCOM_UARTDM
 	@ check for TX_EMT in UARTDM_SR
 	ldr	\rd, [\rx, #0x08]
 ARM_BE8(rev     \rd, \rd )
@@ -55,13 +48,6 @@ ARM_BE8(rev     \rd, \rd )
 	str	\rd, [\rx, #0x40]
 	@ UARTDM reg. Read to induce delay
 	ldr	\rd, [\rx, #0x08]
-#else
-	@ wait for TX_READY
-1001:	ldr	\rd, [\rx, #0x08]
-ARM_BE8(rev     \rd, \rd )
-	tst	\rd, #0x04
-	beq	1001b
-#endif
 	.endm
 
 	.macro	busyuart, rd, rx
diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig
deleted file mode 100644
index a6b50e62a495..000000000000
--- a/arch/arm/mach-msm/Kconfig
+++ /dev/null
@@ -1,109 +0,0 @@
-if ARCH_MSM
-
-choice
-	prompt "Qualcomm MSM SoC Type"
-	default ARCH_MSM7X00A
-	depends on ARCH_MSM
-
-config ARCH_MSM7X00A
-	bool "MSM7x00A / MSM7x01A"
-	select ARCH_MSM_ARM11
-	select CPU_V6
-	select GPIO_MSM_V1
-	select MACH_TROUT if !MACH_HALIBUT
-	select MSM_PROC_COMM
-	select MSM_SMD
-	select CLKSRC_QCOM
-	select MSM_SMD_PKG3
-
-config ARCH_MSM7X30
-	bool "MSM7x30"
-	select ARCH_MSM_SCORPION
-	select CPU_V7
-	select GPIO_MSM_V1
-	select MACH_MSM7X30_SURF # if !
-	select MSM_GPIOMUX
-	select MSM_PROC_COMM
-	select MSM_SMD
-	select CLKSRC_QCOM
-	select MSM_VIC
-
-config ARCH_QSD8X50
-	bool "QSD8X50"
-	select ARCH_MSM_SCORPION
-	select CPU_V7
-	select GPIO_MSM_V1
-	select MACH_QSD8X50_SURF if !MACH_QSD8X50A_ST1_5
-	select MSM_GPIOMUX
-	select MSM_PROC_COMM
-	select MSM_SMD
-	select CLKSRC_QCOM
-	select MSM_VIC
-
-endchoice
-
-config MSM_SOC_REV_A
-	bool
-
-config  ARCH_MSM_ARM11
-	bool
-
-config  ARCH_MSM_SCORPION
-	bool
-
-config  MSM_VIC
-	bool
-
-menu "Qualcomm MSM Board Type"
-	depends on ARCH_MSM
-
-config MACH_HALIBUT
-	depends on ARCH_MSM
-	depends on ARCH_MSM7X00A
-	bool "Halibut Board (QCT SURF7201A)"
-	help
-	  Support for the Qualcomm SURF7201A eval board.
-
-config MACH_TROUT
-	depends on ARCH_MSM
-	depends on ARCH_MSM7X00A
-	bool "HTC Dream (aka trout)"
-	help
-	  Support for the HTC Dream, T-Mobile G1, Android ADP1 devices.
-
-config MACH_MSM7X30_SURF
-	depends on ARCH_MSM7X30
-	bool "MSM7x30 SURF"
-	help
-	  Support for the Qualcomm MSM7x30 SURF eval board.
-
-config MACH_QSD8X50_SURF
-	depends on ARCH_QSD8X50
-	bool "QSD8x50 SURF"
-	help
-	  Support for the Qualcomm QSD8x50 SURF eval board.
-
-config MACH_QSD8X50A_ST1_5
-	depends on ARCH_QSD8X50
-	bool "QSD8x50A ST1.5"
-	select MSM_SOC_REV_A
-	help
-	  Support for the Qualcomm ST1.5.
-
-endmenu
-
-config MSM_SMD_PKG3
-	bool
-
-config MSM_PROC_COMM
-	bool
-
-config MSM_SMD
-	bool
-
-config MSM_GPIOMUX
-	bool
-	help
-	  Support for MSM V1 TLMM GPIOMUX architecture.
-
-endif
diff --git a/arch/arm/mach-msm/Makefile b/arch/arm/mach-msm/Makefile
deleted file mode 100644
index 27c078a568df..000000000000
--- a/arch/arm/mach-msm/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-obj-$(CONFIG_MSM_PROC_COMM) += clock.o
-
-obj-$(CONFIG_MSM_VIC) += irq-vic.o
-
-obj-$(CONFIG_ARCH_MSM7X00A) += irq.o
-obj-$(CONFIG_ARCH_QSD8X50) += sirc.o
-
-obj-$(CONFIG_MSM_PROC_COMM) += proc_comm.o clock-pcom.o vreg.o
-
-obj-$(CONFIG_ARCH_MSM7X00A) += dma.o io.o
-obj-$(CONFIG_ARCH_MSM7X30) += dma.o io.o
-obj-$(CONFIG_ARCH_QSD8X50) += dma.o io.o
-
-obj-$(CONFIG_MSM_SMD) += smd.o smd_debug.o
-obj-$(CONFIG_MSM_SMD) += last_radio_log.o
-
-obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o devices-msm7x00.o
-obj-$(CONFIG_MACH_TROUT) += board-trout.o board-trout-gpio.o board-trout-mmc.o board-trout-panel.o devices-msm7x00.o
-obj-$(CONFIG_MACH_HALIBUT) += board-halibut.o devices-msm7x00.o
-obj-$(CONFIG_ARCH_MSM7X30) += board-msm7x30.o devices-msm7x30.o
-obj-$(CONFIG_ARCH_QSD8X50) += board-qsd8x50.o devices-qsd8x50.o
-obj-$(CONFIG_MSM_GPIOMUX) += gpiomux.o
-obj-$(CONFIG_ARCH_QSD8X50) += gpiomux-8x50.o
diff --git a/arch/arm/mach-msm/Makefile.boot b/arch/arm/mach-msm/Makefile.boot
deleted file mode 100644
index 9b803a578b4d..000000000000
--- a/arch/arm/mach-msm/Makefile.boot
+++ /dev/null
@@ -1,3 +0,0 @@
-  zreladdr-y		+= 0x10008000
-params_phys-y		:= 0x10000100
-initrd_phys-y		:= 0x10800000
diff --git a/arch/arm/mach-msm/board-halibut.c b/arch/arm/mach-msm/board-halibut.c
deleted file mode 100644
index 61bfe584a9d7..000000000000
--- a/arch/arm/mach-msm/board-halibut.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/* linux/arch/arm/mach-msm/board-halibut.c
- *
- * Copyright (C) 2007 Google, Inc.
- * Author: Brian Swetland <swetland@google.com>
- *
- * 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/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/input.h>
-#include <linux/io.h>
-#include <linux/delay.h>
-
-#include <mach/hardware.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/flash.h>
-#include <asm/setup.h>
-
-#include <mach/irqs.h>
-#include <mach/msm_iomap.h>
-
-#include <linux/mtd/nand.h>
-#include <linux/mtd/partitions.h>
-
-#include "devices.h"
-#include "common.h"
-
-static struct resource smc91x_resources[] = {
-	[0] = {
-		.start	= 0x9C004300,
-		.end	= 0x9C004400,
-		.flags	= IORESOURCE_MEM,
-	},
-	[1] = {
-		.start	= MSM_GPIO_TO_INT(49),
-		.end	= MSM_GPIO_TO_INT(49),
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct platform_device smc91x_device = {
-	.name		= "smc91x",
-	.id		= 0,
-	.num_resources	= ARRAY_SIZE(smc91x_resources),
-	.resource	= smc91x_resources,
-};
-
-static struct platform_device *devices[] __initdata = {
-	&msm_clock_7x01a,
-	&msm_device_gpio_7201,
-	&msm_device_uart3,
-	&msm_device_smd,
-	&msm_device_nand,
-	&msm_device_hsusb,
-	&msm_device_i2c,
-	&smc91x_device,
-};
-
-static void __init halibut_init_early(void)
-{
-	arch_ioremap_caller = __msm_ioremap_caller;
-}
-
-static void __init halibut_init_irq(void)
-{
-	msm_init_irq();
-}
-
-static void __init halibut_init(void)
-{
-	platform_add_devices(devices, ARRAY_SIZE(devices));
-}
-
-static void __init halibut_map_io(void)
-{
-	msm_map_common_io();
-}
-
-static void __init halibut_init_late(void)
-{
-	smd_debugfs_init();
-}
-
-MACHINE_START(HALIBUT, "Halibut Board (QCT SURF7200A)")
-	.atag_offset	= 0x100,
-	.map_io		= halibut_map_io,
-	.init_early	= halibut_init_early,
-	.init_irq	= halibut_init_irq,
-	.init_machine	= halibut_init,
-	.init_late	= halibut_init_late,
-	.init_time	= msm7x01_timer_init,
-MACHINE_END
diff --git a/arch/arm/mach-msm/board-msm7x30.c b/arch/arm/mach-msm/board-msm7x30.c
deleted file mode 100644
index 8f5ecdc4f3ce..000000000000
--- a/arch/arm/mach-msm/board-msm7x30.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/* Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-#include <linux/gpio.h>
-#include <linux/kernel.h>
-#include <linux/irq.h>
-#include <linux/platform_device.h>
-#include <linux/delay.h>
-#include <linux/io.h>
-#include <linux/smsc911x.h>
-#include <linux/usb/msm_hsusb.h>
-#include <linux/clkdev.h>
-#include <linux/memblock.h>
-
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/memory.h>
-#include <asm/setup.h>
-
-#include <mach/clk.h>
-#include <mach/msm_iomap.h>
-#include <mach/dma.h>
-
-#include <mach/vreg.h>
-#include "devices.h"
-#include "gpiomux.h"
-#include "proc_comm.h"
-#include "common.h"
-
-static void __init msm7x30_fixup(struct tag *tag, char **cmdline)
-{
-	for (; tag->hdr.size; tag = tag_next(tag))
-		if (tag->hdr.tag == ATAG_MEM && tag->u.mem.start == 0x200000) {
-			tag->u.mem.start = 0;
-			tag->u.mem.size += SZ_2M;
-		}
-}
-
-static void __init msm7x30_reserve(void)
-{
-	memblock_remove(0x0, SZ_2M);
-}
-
-static int hsusb_phy_init_seq[] = {
-	0x30, 0x32,	/* Enable and set Pre-Emphasis Depth to 20% */
-	0x02, 0x36,	/* Disable CDR Auto Reset feature */
-	-1
-};
-
-static int hsusb_link_clk_reset(struct clk *link_clk, bool assert)
-{
-	int ret;
-
-	if (assert) {
-		ret = clk_reset(link_clk, CLK_RESET_ASSERT);
-		if (ret)
-			pr_err("usb hs_clk assert failed\n");
-	} else {
-		ret = clk_reset(link_clk, CLK_RESET_DEASSERT);
-		if (ret)
-			pr_err("usb hs_clk deassert failed\n");
-	}
-	return ret;
-}
-
-static int hsusb_phy_clk_reset(struct clk *phy_clk)
-{
-	int ret;
-
-	ret = clk_reset(phy_clk, CLK_RESET_ASSERT);
-	if (ret) {
-		pr_err("usb phy clk assert failed\n");
-		return ret;
-	}
-	usleep_range(10000, 12000);
-	ret = clk_reset(phy_clk, CLK_RESET_DEASSERT);
-	if (ret)
-		pr_err("usb phy clk deassert failed\n");
-	return ret;
-}
-
-static struct msm_otg_platform_data msm_otg_pdata = {
-	.phy_init_seq		= hsusb_phy_init_seq,
-	.mode                   = USB_DR_MODE_PERIPHERAL,
-	.otg_control		= OTG_PHY_CONTROL,
-	.link_clk_reset		= hsusb_link_clk_reset,
-	.phy_clk_reset		= hsusb_phy_clk_reset,
-};
-
-struct msm_gpiomux_config msm_gpiomux_configs[GPIOMUX_NGPIOS] = {
-#ifdef CONFIG_SERIAL_MSM_CONSOLE
-	[49] = { /* UART2 RFR */
-		.suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN |
-			     GPIOMUX_FUNC_2 | GPIOMUX_VALID,
-	},
-	[50] = { /* UART2 CTS */
-		.suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN |
-			     GPIOMUX_FUNC_2 | GPIOMUX_VALID,
-	},
-	[51] = { /* UART2 RX */
-		.suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN |
-			     GPIOMUX_FUNC_2 | GPIOMUX_VALID,
-	},
-	[52] = { /* UART2 TX */
-		.suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN |
-			     GPIOMUX_FUNC_2 | GPIOMUX_VALID,
-	},
-#endif
-};
-
-static struct platform_device *devices[] __initdata = {
-	&msm_clock_7x30,
-	&msm_device_gpio_7x30,
-#if defined(CONFIG_SERIAL_MSM)
-        &msm_device_uart2,
-#endif
-	&msm_device_smd,
-	&msm_device_otg,
-	&msm_device_hsusb,
-	&msm_device_hsusb_host,
-};
-
-static void __init msm7x30_init_irq(void)
-{
-	msm_init_irq();
-}
-
-static void __init msm7x30_init(void)
-{
-	msm_device_otg.dev.platform_data = &msm_otg_pdata;
-	msm_device_hsusb.dev.parent = &msm_device_otg.dev;
-	msm_device_hsusb_host.dev.parent = &msm_device_otg.dev;
-
-	platform_add_devices(devices, ARRAY_SIZE(devices));
-}
-
-static void __init msm7x30_map_io(void)
-{
-	msm_map_msm7x30_io();
-}
-
-static void __init msm7x30_init_late(void)
-{
-	smd_debugfs_init();
-}
-
-MACHINE_START(MSM7X30_SURF, "QCT MSM7X30 SURF")
-	.atag_offset = 0x100,
-	.fixup = msm7x30_fixup,
-	.reserve = msm7x30_reserve,
-	.map_io = msm7x30_map_io,
-	.init_irq = msm7x30_init_irq,
-	.init_machine = msm7x30_init,
-	.init_late = msm7x30_init_late,
-	.init_time	= msm7x30_timer_init,
-MACHINE_END
-
-MACHINE_START(MSM7X30_FFA, "QCT MSM7X30 FFA")
-	.atag_offset = 0x100,
-	.fixup = msm7x30_fixup,
-	.reserve = msm7x30_reserve,
-	.map_io = msm7x30_map_io,
-	.init_irq = msm7x30_init_irq,
-	.init_machine = msm7x30_init,
-	.init_late = msm7x30_init_late,
-	.init_time	= msm7x30_timer_init,
-MACHINE_END
-
-MACHINE_START(MSM7X30_FLUID, "QCT MSM7X30 FLUID")
-	.atag_offset = 0x100,
-	.fixup = msm7x30_fixup,
-	.reserve = msm7x30_reserve,
-	.map_io = msm7x30_map_io,
-	.init_irq = msm7x30_init_irq,
-	.init_machine = msm7x30_init,
-	.init_late = msm7x30_init_late,
-	.init_time	= msm7x30_timer_init,
-MACHINE_END
diff --git a/arch/arm/mach-msm/board-qsd8x50.c b/arch/arm/mach-msm/board-qsd8x50.c
deleted file mode 100644
index 4c748616ef47..000000000000
--- a/arch/arm/mach-msm/board-qsd8x50.c
+++ /dev/null
@@ -1,248 +0,0 @@
-/* Copyright (c) 2009-2011, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-#include <linux/gpio.h>
-#include <linux/kernel.h>
-#include <linux/irq.h>
-#include <linux/platform_device.h>
-#include <linux/delay.h>
-#include <linux/usb/msm_hsusb.h>
-#include <linux/err.h>
-#include <linux/clkdev.h>
-
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/io.h>
-#include <asm/setup.h>
-
-#include <mach/irqs.h>
-#include <mach/sirc.h>
-#include <mach/vreg.h>
-#include <mach/clk.h>
-#include <linux/platform_data/mmc-msm_sdcc.h>
-
-#include "devices.h"
-#include "common.h"
-
-static const resource_size_t qsd8x50_surf_smc91x_base __initconst = 0x70000300;
-static const unsigned        qsd8x50_surf_smc91x_gpio __initconst = 156;
-
-/* Leave smc91x resources empty here, as we'll fill them in
- * at run-time: they vary from board to board, and the true
- * configuration won't be known until boot.
- */
-static struct resource smc91x_resources[] = {
-	[0] = {
-		.flags = IORESOURCE_MEM,
-	},
-	[1] = {
-		.flags = IORESOURCE_IRQ,
-	},
-};
-
-static struct platform_device smc91x_device = {
-	.name           = "smc91x",
-	.id             = 0,
-	.num_resources  = ARRAY_SIZE(smc91x_resources),
-	.resource       = smc91x_resources,
-};
-
-static int __init msm_init_smc91x(void)
-{
-	if (machine_is_qsd8x50_surf()) {
-		smc91x_resources[0].start = qsd8x50_surf_smc91x_base;
-		smc91x_resources[0].end   = qsd8x50_surf_smc91x_base + 0xff;
-		smc91x_resources[1].start =
-			gpio_to_irq(qsd8x50_surf_smc91x_gpio);
-		smc91x_resources[1].end   =
-			gpio_to_irq(qsd8x50_surf_smc91x_gpio);
-		platform_device_register(&smc91x_device);
-	}
-
-	return 0;
-}
-module_init(msm_init_smc91x);
-
-static int hsusb_phy_init_seq[] = {
-	0x08, 0x31,	/* Increase HS Driver Amplitude */
-	0x20, 0x32,	/* Enable and set Pre-Emphasis Depth to 10% */
-	-1
-};
-
-static int hsusb_link_clk_reset(struct clk *link_clk, bool assert)
-{
-	int ret;
-
-	if (assert) {
-		ret = clk_reset(link_clk, CLK_RESET_ASSERT);
-		if (ret)
-			pr_err("usb hs_clk assert failed\n");
-	} else {
-		ret = clk_reset(link_clk, CLK_RESET_DEASSERT);
-		if (ret)
-			pr_err("usb hs_clk deassert failed\n");
-	}
-	return ret;
-}
-
-static int hsusb_phy_clk_reset(struct clk *phy_clk)
-{
-	int ret;
-
-	ret = clk_reset(phy_clk, CLK_RESET_ASSERT);
-	if (ret) {
-		pr_err("usb phy clk assert failed\n");
-		return ret;
-	}
-	usleep_range(10000, 12000);
-	ret = clk_reset(phy_clk, CLK_RESET_DEASSERT);
-	if (ret)
-		pr_err("usb phy clk deassert failed\n");
-	return ret;
-}
-
-static struct msm_otg_platform_data msm_otg_pdata = {
-	.phy_init_seq		= hsusb_phy_init_seq,
-	.mode                   = USB_DR_MODE_PERIPHERAL,
-	.otg_control		= OTG_PHY_CONTROL,
-	.link_clk_reset		= hsusb_link_clk_reset,
-	.phy_clk_reset		= hsusb_phy_clk_reset,
-};
-
-static struct platform_device *devices[] __initdata = {
-	&msm_clock_8x50,
-	&msm_device_gpio_8x50,
-	&msm_device_uart3,
-	&msm_device_smd,
-	&msm_device_otg,
-	&msm_device_hsusb,
-	&msm_device_hsusb_host,
-};
-
-static struct msm_mmc_gpio sdc1_gpio_cfg[] = {
-	{51, "sdc1_dat_3"},
-	{52, "sdc1_dat_2"},
-	{53, "sdc1_dat_1"},
-	{54, "sdc1_dat_0"},
-	{55, "sdc1_cmd"},
-	{56, "sdc1_clk"}
-};
-
-static struct vreg *vreg_mmc;
-static unsigned long vreg_sts;
-
-static uint32_t msm_sdcc_setup_power(struct device *dv, unsigned int vdd)
-{
-	int rc = 0;
-	struct platform_device *pdev;
-
-	pdev = container_of(dv, struct platform_device, dev);
-
-	if (vdd == 0) {
-		if (!vreg_sts)
-			return 0;
-
-		clear_bit(pdev->id, &vreg_sts);
-
-		if (!vreg_sts) {
-			rc = vreg_disable(vreg_mmc);
-			if (rc)
-				pr_err("vreg_mmc disable failed for slot "
-						"%d: %d\n", pdev->id, rc);
-		}
-		return 0;
-	}
-
-	if (!vreg_sts) {
-		rc = vreg_set_level(vreg_mmc, 2900);
-		if (rc)
-			pr_err("vreg_mmc set level failed for slot %d: %d\n",
-					pdev->id, rc);
-		rc = vreg_enable(vreg_mmc);
-		if (rc)
-			pr_err("vreg_mmc enable failed for slot %d: %d\n",
-					pdev->id, rc);
-	}
-	set_bit(pdev->id, &vreg_sts);
-	return 0;
-}
-
-static struct msm_mmc_gpio_data sdc1_gpio = {
-	.gpio = sdc1_gpio_cfg,
-	.size = ARRAY_SIZE(sdc1_gpio_cfg),
-};
-
-static struct msm_mmc_platform_data qsd8x50_sdc1_data = {
-	.ocr_mask	= MMC_VDD_27_28 | MMC_VDD_28_29,
-	.translate_vdd	= msm_sdcc_setup_power,
-	.gpio_data = &sdc1_gpio,
-};
-
-static void __init qsd8x50_init_mmc(void)
-{
-	vreg_mmc = vreg_get(NULL, "gp5");
-
-	if (IS_ERR(vreg_mmc)) {
-		pr_err("vreg get for vreg_mmc failed (%ld)\n",
-				PTR_ERR(vreg_mmc));
-		return;
-	}
-
-	msm_add_sdcc(1, &qsd8x50_sdc1_data, 0, 0);
-}
-
-static void __init qsd8x50_map_io(void)
-{
-	msm_map_qsd8x50_io();
-}
-
-static void __init qsd8x50_init_irq(void)
-{
-	msm_init_irq();
-	msm_init_sirc();
-}
-
-static void __init qsd8x50_init(void)
-{
-	msm_device_otg.dev.platform_data = &msm_otg_pdata;
-	msm_device_hsusb.dev.parent = &msm_device_otg.dev;
-	msm_device_hsusb_host.dev.parent = &msm_device_otg.dev;
-	platform_add_devices(devices, ARRAY_SIZE(devices));
-	qsd8x50_init_mmc();
-}
-
-static void __init qsd8x50_init_late(void)
-{
-	smd_debugfs_init();
-}
-
-MACHINE_START(QSD8X50_SURF, "QCT QSD8X50 SURF")
-	.atag_offset = 0x100,
-	.map_io = qsd8x50_map_io,
-	.init_irq = qsd8x50_init_irq,
-	.init_machine = qsd8x50_init,
-	.init_late = qsd8x50_init_late,
-	.init_time	= qsd8x50_timer_init,
-MACHINE_END
-
-MACHINE_START(QSD8X50A_ST1_5, "QCT QSD8X50A ST1.5")
-	.atag_offset = 0x100,
-	.map_io = qsd8x50_map_io,
-	.init_irq = qsd8x50_init_irq,
-	.init_machine = qsd8x50_init,
-	.init_late = qsd8x50_init_late,
-	.init_time	= qsd8x50_timer_init,
-MACHINE_END
diff --git a/arch/arm/mach-msm/board-sapphire.c b/arch/arm/mach-msm/board-sapphire.c
deleted file mode 100644
index e50967926dcd..000000000000
--- a/arch/arm/mach-msm/board-sapphire.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/* linux/arch/arm/mach-msm/board-sapphire.c
- * Copyright (C) 2007-2009 HTC Corporation.
- * Author: Thomas Tsai <thomas_tsai@htc.com>
- *
- * 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/gpio.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/input.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <linux/device.h>
-
-#include <linux/delay.h>
-
-#include <mach/hardware.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/mach/flash.h>
-#include <mach/vreg.h>
-
-#include <asm/io.h>
-#include <asm/delay.h>
-#include <asm/setup.h>
-
-#include <linux/mtd/nand.h>
-#include <linux/mtd/partitions.h>
-#include <linux/memblock.h>
-
-#include "gpio_chip.h"
-#include "board-sapphire.h"
-#include "proc_comm.h"
-#include "devices.h"
-#include "common.h"
-
-void msm_init_irq(void);
-void msm_init_gpio(void);
-
-static struct platform_device *devices[] __initdata = {
-	&msm_device_smd,
-	&msm_device_dmov,
-	&msm_device_nand,
-	&msm_device_uart1,
-	&msm_device_uart3,
-};
-
-void msm_timer_init(void);
-
-static void __init sapphire_init_irq(void)
-{
-	msm_init_irq();
-}
-
-static void __init sapphire_init(void)
-{
-	platform_add_devices(devices, ARRAY_SIZE(devices));
-}
-
-static struct map_desc sapphire_io_desc[] __initdata = {
-	{
-		.virtual = SAPPHIRE_CPLD_BASE,
-		.pfn     = __phys_to_pfn(SAPPHIRE_CPLD_START),
-		.length  = SAPPHIRE_CPLD_SIZE,
-		.type    = MT_DEVICE_NONSHARED
-	}
-};
-
-static void __init sapphire_fixup(struct tag *tags, char **cmdline)
-{
-	int smi_sz = parse_tag_smi((const struct tag *)tags);
-
-	if (smi_sz == 32) {
-		memblock_add(PHYS_OFFSET, 84*SZ_1M);
-	} else if (smi_sz == 64) {
-		memblock_add(PHYS_OFFSET, 101*SZ_1M);
-	} else {
-		memblock_add(PHYS_OFFSET, 101*SZ_1M);
-		/* Give a default value when not get smi size */
-		smi_sz = 64;
-	}
-}
-
-static void __init sapphire_map_io(void)
-{
-	msm_map_common_io();
-	iotable_init(sapphire_io_desc, ARRAY_SIZE(sapphire_io_desc));
-	msm_clock_init();
-}
-
-static void __init sapphire_init_late(void)
-{
-	smd_debugfs_init();
-}
-
-MACHINE_START(SAPPHIRE, "sapphire")
-/* Maintainer: Brian Swetland <swetland@google.com> */
-	.atag_offset    = 0x100,
-	.fixup          = sapphire_fixup,
-	.map_io         = sapphire_map_io,
-	.init_irq       = sapphire_init_irq,
-	.init_machine   = sapphire_init,
-	.init_late      = sapphire_init_late,
-	.init_time	= msm_timer_init,
-MACHINE_END
diff --git a/arch/arm/mach-msm/board-trout-gpio.c b/arch/arm/mach-msm/board-trout-gpio.c
deleted file mode 100644
index 722ad63b7edc..000000000000
--- a/arch/arm/mach-msm/board-trout-gpio.c
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * linux/arch/arm/mach-msm/gpio.c
- *
- * Copyright (C) 2005 HP Labs
- * Copyright (C) 2008 Google, Inc.
- * Copyright (C) 2009 Pavel Machek <pavel@ucw.cz>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/io.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <linux/gpio.h>
-
-#include "board-trout.h"
-
-static uint8_t trout_int_mask[2] = {
-	[0] = 0xff, /* mask all interrupts */
-	[1] = 0xff,
-};
-static uint8_t trout_sleep_int_mask[] = {
-	[0] = 0xff,
-	[1] = 0xff,
-};
-
-struct msm_gpio_chip {
-	struct gpio_chip	chip;
-	void __iomem		*reg;	/* Base of register bank */
-	u8			shadow;
-};
-
-#define to_msm_gpio_chip(c) container_of(c, struct msm_gpio_chip, chip)
-
-static int msm_gpiolib_get(struct gpio_chip *chip, unsigned offset)
-{
-	struct msm_gpio_chip *msm_gpio = to_msm_gpio_chip(chip);
-	unsigned mask = 1 << offset;
-
-	return !!(readb(msm_gpio->reg) & mask);
-}
-
-static void msm_gpiolib_set(struct gpio_chip *chip, unsigned offset, int val)
-{
-	struct msm_gpio_chip *msm_gpio = to_msm_gpio_chip(chip);
-	unsigned mask = 1 << offset;
-
-	if (val)
-		msm_gpio->shadow |= mask;
-	else
-		msm_gpio->shadow &= ~mask;
-
-	writeb(msm_gpio->shadow, msm_gpio->reg);
-}
-
-static int msm_gpiolib_direction_input(struct gpio_chip *chip,
-					unsigned offset)
-{
-	msm_gpiolib_set(chip, offset, 0);
-	return 0;
-}
-
-static int msm_gpiolib_direction_output(struct gpio_chip *chip,
-					 unsigned offset, int val)
-{
-	msm_gpiolib_set(chip, offset, val);
-	return 0;
-}
-
-static int trout_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
-{
-	return TROUT_GPIO_TO_INT(offset + chip->base);
-}
-
-#define TROUT_GPIO_BANK(name, reg_num, base_gpio, shadow_val)		\
-	{								\
-		.chip = {						\
-			.label		  = name,			\
-			.direction_input  = msm_gpiolib_direction_input,\
-			.direction_output = msm_gpiolib_direction_output, \
-			.get		  = msm_gpiolib_get,		\
-			.set		  = msm_gpiolib_set,		\
-			.to_irq		  = trout_gpio_to_irq,		\
-			.base		  = base_gpio,			\
-			.ngpio		  = 8,				\
-		},							\
-		.reg = reg_num + TROUT_CPLD_BASE,			\
-		.shadow = shadow_val,					\
-	}
-
-static struct msm_gpio_chip msm_gpio_banks[] = {
-#if defined(CONFIG_DEBUG_MSM_UART) && (CONFIG_DEBUG_UART_PHYS == 0xa9a00000)
-	/* H2W pins <-> UART1 */
-	TROUT_GPIO_BANK("MISC2", 0x00,   TROUT_GPIO_MISC2_BASE, 0x40),
-#else
-	/* H2W pins <-> UART3, Bluetooth <-> UART1 */
-	TROUT_GPIO_BANK("MISC2", 0x00,   TROUT_GPIO_MISC2_BASE, 0x80),
-#endif
-	/* I2C pull */
-	TROUT_GPIO_BANK("MISC3", 0x02,   TROUT_GPIO_MISC3_BASE, 0x04),
-	TROUT_GPIO_BANK("MISC4", 0x04,   TROUT_GPIO_MISC4_BASE, 0),
-	/* mmdi 32k en */
-	TROUT_GPIO_BANK("MISC5", 0x06,   TROUT_GPIO_MISC5_BASE, 0x04),
-	TROUT_GPIO_BANK("INT2", 0x08,    TROUT_GPIO_INT2_BASE,  0),
-	TROUT_GPIO_BANK("MISC1", 0x0a,   TROUT_GPIO_MISC1_BASE, 0),
-	TROUT_GPIO_BANK("VIRTUAL", 0x12, TROUT_GPIO_VIRTUAL_BASE, 0),
-};
-
-static void trout_gpio_irq_ack(struct irq_data *d)
-{
-	int bank = TROUT_INT_TO_BANK(d->irq);
-	uint8_t mask = TROUT_INT_TO_MASK(d->irq);
-	int reg = TROUT_BANK_TO_STAT_REG(bank);
-	/*printk(KERN_INFO "trout_gpio_irq_ack irq %d\n", d->irq);*/
-	writeb(mask, TROUT_CPLD_BASE + reg);
-}
-
-static void trout_gpio_irq_mask(struct irq_data *d)
-{
-	unsigned long flags;
-	uint8_t reg_val;
-	int bank = TROUT_INT_TO_BANK(d->irq);
-	uint8_t mask = TROUT_INT_TO_MASK(d->irq);
-	int reg = TROUT_BANK_TO_MASK_REG(bank);
-
-	local_irq_save(flags);
-	reg_val = trout_int_mask[bank] |= mask;
-	/*printk(KERN_INFO "trout_gpio_irq_mask irq %d => %d:%02x\n",
-	       d->irq, bank, reg_val);*/
-	writeb(reg_val, TROUT_CPLD_BASE + reg);
-	local_irq_restore(flags);
-}
-
-static void trout_gpio_irq_unmask(struct irq_data *d)
-{
-	unsigned long flags;
-	uint8_t reg_val;
-	int bank = TROUT_INT_TO_BANK(d->irq);
-	uint8_t mask = TROUT_INT_TO_MASK(d->irq);
-	int reg = TROUT_BANK_TO_MASK_REG(bank);
-
-	local_irq_save(flags);
-	reg_val = trout_int_mask[bank] &= ~mask;
-	/*printk(KERN_INFO "trout_gpio_irq_unmask irq %d => %d:%02x\n",
-	       d->irq, bank, reg_val);*/
-	writeb(reg_val, TROUT_CPLD_BASE + reg);
-	local_irq_restore(flags);
-}
-
-int trout_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
-{
-	unsigned long flags;
-	int bank = TROUT_INT_TO_BANK(d->irq);
-	uint8_t mask = TROUT_INT_TO_MASK(d->irq);
-
-	local_irq_save(flags);
-	if(on)
-		trout_sleep_int_mask[bank] &= ~mask;
-	else
-		trout_sleep_int_mask[bank] |= mask;
-	local_irq_restore(flags);
-	return 0;
-}
-
-static void trout_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
-{
-	int j, m;
-	unsigned v;
-	int bank;
-	int stat_reg;
-	int int_base = TROUT_INT_START;
-	uint8_t int_mask;
-
-	for (bank = 0; bank < 2; bank++) {
-		stat_reg = TROUT_BANK_TO_STAT_REG(bank);
-		v = readb(TROUT_CPLD_BASE + stat_reg);
-		int_mask = trout_int_mask[bank];
-		if (v & int_mask) {
-			writeb(v & int_mask, TROUT_CPLD_BASE + stat_reg);
-			printk(KERN_ERR "trout_gpio_irq_handler: got masked "
-			       "interrupt: %d:%02x\n", bank, v & int_mask);
-		}
-		v &= ~int_mask;
-		while (v) {
-			m = v & -v;
-			j = fls(m) - 1;
-			/*printk(KERN_INFO "msm_gpio_irq_handler %d:%02x %02x b"
-			       "it %d irq %d\n", bank, v, m, j, int_base + j);*/
-			v &= ~m;
-			generic_handle_irq(int_base + j);
-		}
-		int_base += TROUT_INT_BANK0_COUNT;
-	}
-	desc->irq_data.chip->irq_ack(&desc->irq_data);
-}
-
-static struct irq_chip trout_gpio_irq_chip = {
-	.name          = "troutgpio",
-	.irq_ack       = trout_gpio_irq_ack,
-	.irq_mask      = trout_gpio_irq_mask,
-	.irq_unmask    = trout_gpio_irq_unmask,
-	.irq_set_wake  = trout_gpio_irq_set_wake,
-};
-
-/*
- * Called from the processor-specific init to enable GPIO pin support.
- */
-int __init trout_init_gpio(void)
-{
-	int i;
-	for(i = TROUT_INT_START; i <= TROUT_INT_END; i++) {
-		irq_set_chip_and_handler(i, &trout_gpio_irq_chip,
-					 handle_edge_irq);
-		set_irq_flags(i, IRQF_VALID);
-	}
-
-	for (i = 0; i < ARRAY_SIZE(msm_gpio_banks); i++)
-		gpiochip_add(&msm_gpio_banks[i].chip);
-
-	irq_set_irq_type(MSM_GPIO_TO_INT(17), IRQF_TRIGGER_HIGH);
-	irq_set_chained_handler(MSM_GPIO_TO_INT(17), trout_gpio_irq_handler);
-	irq_set_irq_wake(MSM_GPIO_TO_INT(17), 1);
-
-	return 0;
-}
-
-postcore_initcall(trout_init_gpio);
-
diff --git a/arch/arm/mach-msm/board-trout-mmc.c b/arch/arm/mach-msm/board-trout-mmc.c
deleted file mode 100644
index 3723e55819d6..000000000000
--- a/arch/arm/mach-msm/board-trout-mmc.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/* linux/arch/arm/mach-msm/board-trout-mmc.c
-** Author: Brian Swetland <swetland@google.com>
-*/
-#include <linux/gpio.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/delay.h>
-#include <linux/mmc/host.h>
-#include <linux/mmc/sdio_ids.h>
-#include <linux/err.h>
-#include <linux/debugfs.h>
-
-#include <asm/io.h>
-
-#include <mach/vreg.h>
-
-#include <linux/platform_data/mmc-msm_sdcc.h>
-
-#include "devices.h"
-
-#include "board-trout.h"
-
-#include "proc_comm.h"
-
-#define DEBUG_SDSLOT_VDD 1
-
-/* ---- COMMON ---- */
-static void config_gpio_table(uint32_t *table, int len)
-{
-	int n;
-	unsigned id;
-	for(n = 0; n < len; n++) {
-		id = table[n];
-		msm_proc_comm(PCOM_RPC_GPIO_TLMM_CONFIG_EX, &id, 0);
-	}
-}
-
-/* ---- SDCARD ---- */
-
-static uint32_t sdcard_on_gpio_table[] = {
-	PCOM_GPIO_CFG(62, 2, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_8MA), /* CLK */
-	PCOM_GPIO_CFG(63, 2, GPIO_OUTPUT, GPIO_PULL_UP, GPIO_8MA), /* CMD */
-	PCOM_GPIO_CFG(64, 2, GPIO_OUTPUT, GPIO_PULL_UP, GPIO_8MA), /* DAT3 */
-	PCOM_GPIO_CFG(65, 2, GPIO_OUTPUT, GPIO_PULL_UP, GPIO_8MA), /* DAT2 */
-	PCOM_GPIO_CFG(66, 2, GPIO_OUTPUT, GPIO_PULL_UP, GPIO_4MA), /* DAT1 */
-	PCOM_GPIO_CFG(67, 2, GPIO_OUTPUT, GPIO_PULL_UP, GPIO_4MA), /* DAT0 */
-};
-
-static uint32_t sdcard_off_gpio_table[] = {
-	PCOM_GPIO_CFG(62, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_4MA), /* CLK */
-	PCOM_GPIO_CFG(63, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_4MA), /* CMD */
-	PCOM_GPIO_CFG(64, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_4MA), /* DAT3 */
-	PCOM_GPIO_CFG(65, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_4MA), /* DAT2 */
-	PCOM_GPIO_CFG(66, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_4MA), /* DAT1 */
-	PCOM_GPIO_CFG(67, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_4MA), /* DAT0 */
-};
-
-static uint opt_disable_sdcard;
-
-static int __init trout_disablesdcard_setup(char *str)
-{
-	int cal = simple_strtol(str, NULL, 0);
-	
-	opt_disable_sdcard = cal;
-	return 1;
-}
-
-__setup("board_trout.disable_sdcard=", trout_disablesdcard_setup);
-
-static struct vreg *vreg_sdslot;	/* SD slot power */
-
-struct mmc_vdd_xlat {
-	int mask;
-	int level;
-};
-
-static struct mmc_vdd_xlat mmc_vdd_table[] = {
-	{ MMC_VDD_165_195,	1800 },
-	{ MMC_VDD_20_21,	2050 },
-	{ MMC_VDD_21_22,	2150 },
-	{ MMC_VDD_22_23,	2250 },
-	{ MMC_VDD_23_24,	2350 },
-	{ MMC_VDD_24_25,	2450 },
-	{ MMC_VDD_25_26,	2550 },
-	{ MMC_VDD_26_27,	2650 },
-	{ MMC_VDD_27_28,	2750 },
-	{ MMC_VDD_28_29,	2850 },
-	{ MMC_VDD_29_30,	2950 },
-};
-
-static unsigned int sdslot_vdd = 0xffffffff;
-static unsigned int sdslot_vreg_enabled;
-
-static uint32_t trout_sdslot_switchvdd(struct device *dev, unsigned int vdd)
-{
-	int i, rc;
-
-	BUG_ON(!vreg_sdslot);
-
-	if (vdd == sdslot_vdd)
-		return 0;
-
-	sdslot_vdd = vdd;
-
-	if (vdd == 0) {
-#if DEBUG_SDSLOT_VDD
-		printk("%s: Disabling SD slot power\n", __func__);
-#endif
-		config_gpio_table(sdcard_off_gpio_table,
-				  ARRAY_SIZE(sdcard_off_gpio_table));
-		vreg_disable(vreg_sdslot);
-		sdslot_vreg_enabled = 0;
-		return 0;
-	}
-
-	if (!sdslot_vreg_enabled) {
-		rc = vreg_enable(vreg_sdslot);
-		if (rc) {
-			printk(KERN_ERR "%s: Error enabling vreg (%d)\n",
-			       __func__, rc);
-		}
-		config_gpio_table(sdcard_on_gpio_table,
-				  ARRAY_SIZE(sdcard_on_gpio_table));
-		sdslot_vreg_enabled = 1;
-	}
-
-	for (i = 0; i < ARRAY_SIZE(mmc_vdd_table); i++) {
-		if (mmc_vdd_table[i].mask == (1 << vdd)) {
-#if DEBUG_SDSLOT_VDD
-			printk("%s: Setting level to %u\n",
-			        __func__, mmc_vdd_table[i].level);
-#endif
-			rc = vreg_set_level(vreg_sdslot,
-					    mmc_vdd_table[i].level);
-			if (rc) {
-				printk(KERN_ERR
-				       "%s: Error setting vreg level (%d)\n",
-				       __func__, rc);
-			}
-			return 0;
-		}
-	}
-
-	printk(KERN_ERR "%s: Invalid VDD %d specified\n", __func__, vdd);
-	return 0;
-}
-
-static unsigned int trout_sdslot_status(struct device *dev)
-{
-	unsigned int status;
-
-	status = (unsigned int) gpio_get_value(TROUT_GPIO_SDMC_CD_N);
-	return (!status);
-}
-
-#define TROUT_MMC_VDD	MMC_VDD_165_195 | MMC_VDD_20_21 | MMC_VDD_21_22 \
-			| MMC_VDD_22_23 | MMC_VDD_23_24 | MMC_VDD_24_25 \
-			| MMC_VDD_25_26 | MMC_VDD_26_27 | MMC_VDD_27_28 \
-			| MMC_VDD_28_29 | MMC_VDD_29_30
-
-static struct msm_mmc_platform_data trout_sdslot_data = {
-	.ocr_mask	= TROUT_MMC_VDD,
-	.status		= trout_sdslot_status,
-	.translate_vdd	= trout_sdslot_switchvdd,
-};
-
-int __init trout_init_mmc(unsigned int sys_rev)
-{
-	sdslot_vreg_enabled = 0;
-
-	vreg_sdslot = vreg_get(0, "gp6");
-	if (IS_ERR(vreg_sdslot))
-		return PTR_ERR(vreg_sdslot);
-
-	irq_set_irq_wake(TROUT_GPIO_TO_INT(TROUT_GPIO_SDMC_CD_N), 1);
-
-	if (!opt_disable_sdcard)
-		msm_add_sdcc(2, &trout_sdslot_data,
-			     TROUT_GPIO_TO_INT(TROUT_GPIO_SDMC_CD_N), 0);
-	else
-		printk(KERN_INFO "trout: SD-Card interface disabled\n");
-	return 0;
-}
-
diff --git a/arch/arm/mach-msm/board-trout-panel.c b/arch/arm/mach-msm/board-trout-panel.c
deleted file mode 100644
index 77b0a26f897f..000000000000
--- a/arch/arm/mach-msm/board-trout-panel.c
+++ /dev/null
@@ -1,292 +0,0 @@
-/* linux/arch/arm/mach-msm/board-trout-mddi.c
-** Author: Brian Swetland <swetland@google.com>
-*/
-#include <linux/gpio.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/delay.h>
-#include <linux/leds.h>
-#include <linux/err.h>
-
-#include <asm/io.h>
-#include <asm/mach-types.h>
-#include <asm/system_info.h>
-
-#include <linux/platform_data/video-msm_fb.h>
-#include <mach/vreg.h>
-
-#include "board-trout.h"
-#include "proc_comm.h"
-#include "clock-pcom.h"
-#include "devices.h"
-
-#define TROUT_DEFAULT_BACKLIGHT_BRIGHTNESS 255
-
-#define MDDI_CLIENT_CORE_BASE  0x108000
-#define LCD_CONTROL_BLOCK_BASE 0x110000
-#define SPI_BLOCK_BASE         0x120000
-#define I2C_BLOCK_BASE         0x130000
-#define PWM_BLOCK_BASE         0x140000
-#define GPIO_BLOCK_BASE        0x150000
-#define SYSTEM_BLOCK1_BASE     0x160000
-#define SYSTEM_BLOCK2_BASE     0x170000
-
-
-#define	DPSUS       (MDDI_CLIENT_CORE_BASE|0x24)
-#define	SYSCLKENA   (MDDI_CLIENT_CORE_BASE|0x2C)
-#define	PWM0OFF	      (PWM_BLOCK_BASE|0x1C)
-
-#define V_VDDE2E_VDD2_GPIO 0
-#define MDDI_RST_N 82
-
-#define	MDDICAP0    (MDDI_CLIENT_CORE_BASE|0x00)
-#define	MDDICAP1    (MDDI_CLIENT_CORE_BASE|0x04)
-#define	MDDICAP2    (MDDI_CLIENT_CORE_BASE|0x08)
-#define	MDDICAP3    (MDDI_CLIENT_CORE_BASE|0x0C)
-#define	MDCAPCHG    (MDDI_CLIENT_CORE_BASE|0x10)
-#define	MDCRCERC    (MDDI_CLIENT_CORE_BASE|0x14)
-#define	TTBUSSEL    (MDDI_CLIENT_CORE_BASE|0x18)
-#define	DPSET0      (MDDI_CLIENT_CORE_BASE|0x1C)
-#define	DPSET1      (MDDI_CLIENT_CORE_BASE|0x20)
-#define	DPSUS       (MDDI_CLIENT_CORE_BASE|0x24)
-#define	DPRUN       (MDDI_CLIENT_CORE_BASE|0x28)
-#define	SYSCKENA    (MDDI_CLIENT_CORE_BASE|0x2C)
-#define	TESTMODE    (MDDI_CLIENT_CORE_BASE|0x30)
-#define	FIFOMONI    (MDDI_CLIENT_CORE_BASE|0x34)
-#define	INTMONI     (MDDI_CLIENT_CORE_BASE|0x38)
-#define	MDIOBIST    (MDDI_CLIENT_CORE_BASE|0x3C)
-#define	MDIOPSET    (MDDI_CLIENT_CORE_BASE|0x40)
-#define	BITMAP0     (MDDI_CLIENT_CORE_BASE|0x44)
-#define	BITMAP1     (MDDI_CLIENT_CORE_BASE|0x48)
-#define	BITMAP2     (MDDI_CLIENT_CORE_BASE|0x4C)
-#define	BITMAP3     (MDDI_CLIENT_CORE_BASE|0x50)
-#define	BITMAP4     (MDDI_CLIENT_CORE_BASE|0x54)
-
-#define	SRST        (LCD_CONTROL_BLOCK_BASE|0x00)
-#define	PORT_ENB    (LCD_CONTROL_BLOCK_BASE|0x04)
-#define	START       (LCD_CONTROL_BLOCK_BASE|0x08)
-#define	PORT        (LCD_CONTROL_BLOCK_BASE|0x0C)
-#define	CMN         (LCD_CONTROL_BLOCK_BASE|0x10)
-#define	GAMMA       (LCD_CONTROL_BLOCK_BASE|0x14)
-#define	INTFLG      (LCD_CONTROL_BLOCK_BASE|0x18)
-#define	INTMSK      (LCD_CONTROL_BLOCK_BASE|0x1C)
-#define	MPLFBUF     (LCD_CONTROL_BLOCK_BASE|0x20)
-#define	HDE_LEFT    (LCD_CONTROL_BLOCK_BASE|0x24)
-#define	VDE_TOP     (LCD_CONTROL_BLOCK_BASE|0x28)
-#define	PXL         (LCD_CONTROL_BLOCK_BASE|0x30)
-#define	HCYCLE      (LCD_CONTROL_BLOCK_BASE|0x34)
-#define	HSW         (LCD_CONTROL_BLOCK_BASE|0x38)
-#define	HDE_START   (LCD_CONTROL_BLOCK_BASE|0x3C)
-#define	HDE_SIZE    (LCD_CONTROL_BLOCK_BASE|0x40)
-#define	VCYCLE      (LCD_CONTROL_BLOCK_BASE|0x44)
-#define	VSW         (LCD_CONTROL_BLOCK_BASE|0x48)
-#define	VDE_START   (LCD_CONTROL_BLOCK_BASE|0x4C)
-#define	VDE_SIZE    (LCD_CONTROL_BLOCK_BASE|0x50)
-#define	WAKEUP      (LCD_CONTROL_BLOCK_BASE|0x54)
-#define	WSYN_DLY    (LCD_CONTROL_BLOCK_BASE|0x58)
-#define	REGENB      (LCD_CONTROL_BLOCK_BASE|0x5C)
-#define	VSYNIF      (LCD_CONTROL_BLOCK_BASE|0x60)
-#define	WRSTB       (LCD_CONTROL_BLOCK_BASE|0x64)
-#define	RDSTB       (LCD_CONTROL_BLOCK_BASE|0x68)
-#define	ASY_DATA    (LCD_CONTROL_BLOCK_BASE|0x6C)
-#define	ASY_DATB    (LCD_CONTROL_BLOCK_BASE|0x70)
-#define	ASY_DATC    (LCD_CONTROL_BLOCK_BASE|0x74)
-#define	ASY_DATD    (LCD_CONTROL_BLOCK_BASE|0x78)
-#define	ASY_DATE    (LCD_CONTROL_BLOCK_BASE|0x7C)
-#define	ASY_DATF    (LCD_CONTROL_BLOCK_BASE|0x80)
-#define	ASY_DATG    (LCD_CONTROL_BLOCK_BASE|0x84)
-#define	ASY_DATH    (LCD_CONTROL_BLOCK_BASE|0x88)
-#define	ASY_CMDSET  (LCD_CONTROL_BLOCK_BASE|0x8C)
-
-#define	SSICTL      (SPI_BLOCK_BASE|0x00)
-#define	SSITIME     (SPI_BLOCK_BASE|0x04)
-#define	SSITX       (SPI_BLOCK_BASE|0x08)
-#define	SSIRX       (SPI_BLOCK_BASE|0x0C)
-#define	SSIINTC     (SPI_BLOCK_BASE|0x10)
-#define	SSIINTS     (SPI_BLOCK_BASE|0x14)
-#define	SSIDBG1     (SPI_BLOCK_BASE|0x18)
-#define	SSIDBG2     (SPI_BLOCK_BASE|0x1C)
-#define	SSIID       (SPI_BLOCK_BASE|0x20)
-
-#define	WKREQ       (SYSTEM_BLOCK1_BASE|0x00)
-#define	CLKENB      (SYSTEM_BLOCK1_BASE|0x04)
-#define	DRAMPWR     (SYSTEM_BLOCK1_BASE|0x08)
-#define	INTMASK     (SYSTEM_BLOCK1_BASE|0x0C)
-#define	GPIOSEL     (SYSTEM_BLOCK2_BASE|0x00)
-
-#define	GPIODATA    (GPIO_BLOCK_BASE|0x00)
-#define	GPIODIR     (GPIO_BLOCK_BASE|0x04)
-#define	GPIOIS      (GPIO_BLOCK_BASE|0x08)
-#define	GPIOIBE     (GPIO_BLOCK_BASE|0x0C)
-#define	GPIOIEV     (GPIO_BLOCK_BASE|0x10)
-#define	GPIOIE      (GPIO_BLOCK_BASE|0x14)
-#define	GPIORIS     (GPIO_BLOCK_BASE|0x18)
-#define	GPIOMIS     (GPIO_BLOCK_BASE|0x1C)
-#define	GPIOIC      (GPIO_BLOCK_BASE|0x20)
-#define	GPIOOMS     (GPIO_BLOCK_BASE|0x24)
-#define	GPIOPC      (GPIO_BLOCK_BASE|0x28)
-#define	GPIOID      (GPIO_BLOCK_BASE|0x30)
-
-#define SPI_WRITE(reg, val) \
-	{ SSITX,        0x00010000 | (((reg) & 0xff) << 8) | ((val) & 0xff) }, \
-	{ 0, 5 },
-
-#define SPI_WRITE1(reg) \
-	{ SSITX,        (reg) & 0xff }, \
-	{ 0, 5 },
-
-struct mddi_table {
-	uint32_t reg;
-	uint32_t value;
-};
-static struct mddi_table mddi_toshiba_init_table[] = {
-	{ DPSET0,       0x09e90046 },
-	{ DPSET1,       0x00000118 },
-	{ DPSUS,        0x00000000 },
-	{ DPRUN,        0x00000001 },
-	{ 1,            14         }, /* msleep 14 */
-	{ SYSCKENA,     0x00000001 },
-	{ CLKENB,       0x0000A1EF },  /*    # SYS.CLKENB  # Enable clocks for each module (without DCLK , i2cCLK) */
-
-	{ GPIODATA,     0x02000200 },  /*   # GPI .GPIODATA  # GPIO2(RESET_LCD_N) set to 0 , GPIO3(eDRAM_Power) set to 0 */
-	{ GPIODIR,      0x000030D  },  /* 24D   # GPI .GPIODIR  # Select direction of GPIO port (0,2,3,6,9 output) */
-	{ GPIOSEL,      0/*0x00000173*/},  /*   # SYS.GPIOSEL  # GPIO port multiplexing control */
-	{ GPIOPC,       0x03C300C0 },  /*   # GPI .GPIOPC  # GPIO2,3 PD cut */
-	{ WKREQ,        0x00000000 },  /*   # SYS.WKREQ  # Wake-up request event is VSYNC alignment */
-
-	{ GPIOIBE,      0x000003FF },
-	{ GPIOIS,       0x00000000 },
-	{ GPIOIC,       0x000003FF },
-	{ GPIOIE,       0x00000000 },
-
-	{ GPIODATA,     0x00040004 },  /*   # GPI .GPIODATA  # eDRAM VD supply */
-	{ 1,            1          }, /* msleep 1 */
-	{ GPIODATA,     0x02040004 },  /*   # GPI .GPIODATA  # eDRAM VD supply */
-	{ DRAMPWR,      0x00000001 }, /* eDRAM power */
-};
-
-#define GPIOSEL_VWAKEINT (1U << 0)
-#define INTMASK_VWAKEOUT (1U << 0)
-
-
-static int trout_new_backlight = 1;
-static struct vreg *vreg_mddi_1v5;
-static struct vreg *vreg_lcm_2v85;
-
-static void trout_process_mddi_table(struct msm_mddi_client_data *client_data,
-				     struct mddi_table *table, size_t count)
-{
-	int i;
-	for (i = 0; i < count; i++) {
-		uint32_t reg = table[i].reg;
-		uint32_t value = table[i].value;
-
-		if (reg == 0)
-			udelay(value);
-		else if (reg == 1)
-			msleep(value);
-		else
-			client_data->remote_write(client_data, value, reg);
-	}
-}
-
-static int trout_mddi_toshiba_client_init(
-	struct msm_mddi_bridge_platform_data *bridge_data,
-	struct msm_mddi_client_data *client_data)
-{
-	int panel_id;
-
-	client_data->auto_hibernate(client_data, 0);
-	trout_process_mddi_table(client_data, mddi_toshiba_init_table,
-				 ARRAY_SIZE(mddi_toshiba_init_table));
-	client_data->auto_hibernate(client_data, 1);
-	panel_id = (client_data->remote_read(client_data, GPIODATA) >> 4) & 3;
-	if (panel_id > 1) {
-		printk(KERN_WARNING "unknown panel id at mddi_enable\n");
-		return -1;
-	}
-	return 0;
-}
-
-static int trout_mddi_toshiba_client_uninit(
-	struct msm_mddi_bridge_platform_data *bridge_data,
-	struct msm_mddi_client_data *client_data)
-{
-	return 0;
-}
-
-static struct resource resources_msm_fb[] = {
-	{
-		.start = MSM_FB_BASE,
-		.end = MSM_FB_BASE + MSM_FB_SIZE,
-		.flags = IORESOURCE_MEM,
-	},
-};
-
-struct msm_mddi_bridge_platform_data toshiba_client_data = {
-	.init = trout_mddi_toshiba_client_init,
-	.uninit = trout_mddi_toshiba_client_uninit,
-	.fb_data = {
-		.xres = 320,
-		.yres = 480,
-		.width = 45,
-		.height = 67,
-		.output_format = 0,
-	},
-};
-
-static struct msm_mddi_platform_data mddi_pdata = {
-	.clk_rate = 122880000,
-	.fb_resource = resources_msm_fb,
-	.num_clients = 1,
-	.client_platform_data = {
-		{
-			.product_id = (0xd263 << 16 | 0),
-			.name = "mddi_c_d263_0000",
-			.id = 0,
-			.client_data = &toshiba_client_data,
-			.clk_rate = 0,
-		},
-	},
-};
-
-int __init trout_init_panel(void)
-{
-	int rc;
-
-	if (!machine_is_trout())
-		return 0;
-	vreg_mddi_1v5 = vreg_get(0, "gp2");
-	if (IS_ERR(vreg_mddi_1v5))
-		return PTR_ERR(vreg_mddi_1v5);
-	vreg_lcm_2v85 = vreg_get(0, "gp4");
-	if (IS_ERR(vreg_lcm_2v85))
-		return PTR_ERR(vreg_lcm_2v85);
-
-	trout_new_backlight = system_rev >= 5;
-	if (trout_new_backlight) {
-		uint32_t config = PCOM_GPIO_CFG(27, 0, GPIO_OUTPUT,
-						GPIO_NO_PULL, GPIO_8MA);
-		msm_proc_comm(PCOM_RPC_GPIO_TLMM_CONFIG_EX, &config, 0);
-	} else {
-		uint32_t config = PCOM_GPIO_CFG(27, 1, GPIO_OUTPUT,
-						GPIO_NO_PULL, GPIO_8MA);
-		uint32_t id = P_GP_CLK;
-		uint32_t rate = 19200000;
-
-		msm_proc_comm(PCOM_RPC_GPIO_TLMM_CONFIG_EX, &config, 0);
-
-		msm_proc_comm(PCOM_CLKCTL_RPC_SET_RATE, &id, &rate);
-		if (id < 0)
-			pr_err("trout_init_panel: set clock rate failed\n");
-	}
-
-	rc = platform_device_register(&msm_device_mdp);
-	if (rc)
-		return rc;
-	msm_device_mddi0.dev.platform_data = &mddi_pdata;
-	return platform_device_register(&msm_device_mddi0);
-}
-
-device_initcall(trout_init_panel);
diff --git a/arch/arm/mach-msm/board-trout.c b/arch/arm/mach-msm/board-trout.c
deleted file mode 100644
index ba3edd3a46cb..000000000000
--- a/arch/arm/mach-msm/board-trout.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/* linux/arch/arm/mach-msm/board-trout.c
- *
- * Copyright (C) 2009 Google, Inc.
- * Author: Brian Swetland <swetland@google.com>
- *
- * 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.
- *
- */
-#define pr_fmt(fmt) "%s: " fmt, __func__
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/platform_device.h>
-#include <linux/clkdev.h>
-#include <linux/memblock.h>
-
-#include <asm/system_info.h>
-#include <asm/mach-types.h>
-#include <asm/mach/arch.h>
-#include <asm/mach/map.h>
-#include <asm/setup.h>
-
-#include <mach/hardware.h>
-#include <mach/msm_iomap.h>
-
-#include "devices.h"
-#include "board-trout.h"
-#include "common.h"
-
-extern int trout_init_mmc(unsigned int);
-
-static struct platform_device *devices[] __initdata = {
-	&msm_clock_7x01a,
-	&msm_device_gpio_7201,
-	&msm_device_uart3,
-	&msm_device_smd,
-	&msm_device_nand,
-	&msm_device_hsusb,
-	&msm_device_i2c,
-};
-
-static void __init trout_init_early(void)
-{
-	arch_ioremap_caller = __msm_ioremap_caller;
-}
-
-static void __init trout_init_irq(void)
-{
-	msm_init_irq();
-}
-
-static void __init trout_fixup(struct tag *tags, char **cmdline)
-{
-	memblock_add(PHYS_OFFSET, 101*SZ_1M);
-}
-
-static void __init trout_init(void)
-{
-	int rc;
-
-	platform_add_devices(devices, ARRAY_SIZE(devices));
-
-	if (IS_ENABLED(CONFIG_MMC)) {
-		rc = trout_init_mmc(system_rev);
-		if (rc)
-			pr_crit("MMC init failure (%d)\n", rc);
-	}
-}
-
-static struct map_desc trout_io_desc[] __initdata = {
-	{
-		.virtual = (unsigned long)TROUT_CPLD_BASE,
-		.pfn     = __phys_to_pfn(TROUT_CPLD_START),
-		.length  = TROUT_CPLD_SIZE,
-		.type    = MT_DEVICE_NONSHARED
-	}
-};
-
-static void __init trout_map_io(void)
-{
-	msm_map_common_io();
-	iotable_init(trout_io_desc, ARRAY_SIZE(trout_io_desc));
-
-#if defined(CONFIG_DEBUG_MSM_UART) && (CONFIG_DEBUG_UART_PHYS == 0xa9c00000)
-	/* route UART3 to the "H2W" extended usb connector */
-	writeb(0x80, TROUT_CPLD_BASE + 0x00);
-#endif
-}
-
-static void __init trout_init_late(void)
-{
-	smd_debugfs_init();
-}
-
-MACHINE_START(TROUT, "HTC Dream")
-	.atag_offset	= 0x100,
-	.fixup		= trout_fixup,
-	.map_io		= trout_map_io,
-	.init_early	= trout_init_early,
-	.init_irq	= trout_init_irq,
-	.init_machine	= trout_init,
-	.init_late	= trout_init_late,
-	.init_time	= msm7x01_timer_init,
-MACHINE_END
diff --git a/arch/arm/mach-msm/board-trout.h b/arch/arm/mach-msm/board-trout.h
deleted file mode 100644
index adb757abbb92..000000000000
--- a/arch/arm/mach-msm/board-trout.h
+++ /dev/null
@@ -1,162 +0,0 @@
-/* linux/arch/arm/mach-msm/board-trout.h
-** Author: Brian Swetland <swetland@google.com>
-*/
-#ifndef __ARCH_ARM_MACH_MSM_BOARD_TROUT_H
-#define __ARCH_ARM_MACH_MSM_BOARD_TROUT_H
-
-#include "common.h"
-
-#define MSM_SMI_BASE		0x00000000
-#define MSM_SMI_SIZE		0x00800000
-
-#define MSM_EBI_BASE		0x10000000
-#define MSM_EBI_SIZE		0x06e00000
-
-#define MSM_PMEM_GPU0_BASE	0x00000000
-#define MSM_PMEM_GPU0_SIZE	0x00700000
-
-#define MSM_PMEM_MDP_BASE	0x02000000
-#define MSM_PMEM_MDP_SIZE	0x00800000
-
-#define MSM_PMEM_ADSP_BASE      0x02800000
-#define MSM_PMEM_ADSP_SIZE	0x00800000
-
-#define MSM_PMEM_CAMERA_BASE	0x03000000
-#define MSM_PMEM_CAMERA_SIZE	0x00800000
-
-#define MSM_FB_BASE		0x03800000
-#define MSM_FB_SIZE		0x00100000
-
-#define MSM_LINUX_BASE		MSM_EBI_BASE
-#define MSM_LINUX_SIZE		0x06500000
-
-#define MSM_PMEM_GPU1_SIZE	0x800000
-#define MSM_PMEM_GPU1_BASE	(MSM_RAM_CONSOLE_BASE - MSM_PMEM_GPU1_SIZE)
-
-#define MSM_RAM_CONSOLE_BASE	(MSM_EBI_BASE + 0x6d00000)
-#define MSM_RAM_CONSOLE_SIZE	(128 * SZ_1K)
-
-#if (MSM_FB_BASE + MSM_FB_SIZE) >= (MSM_PMEM_GPU1_BASE)
-#error invalid memory map
-#endif
-
-#define DECLARE_MSM_IOMAP
-#include <mach/msm_iomap.h>
-
-#define TROUT_4_BALL_UP_0     1
-#define TROUT_4_BALL_LEFT_0   18
-#define TROUT_4_BALL_DOWN_0   57
-#define TROUT_4_BALL_RIGHT_0  91
-
-#define TROUT_5_BALL_UP_0     94
-#define TROUT_5_BALL_LEFT_0   18
-#define TROUT_5_BALL_DOWN_0   90
-#define TROUT_5_BALL_RIGHT_0  19
-
-#define TROUT_POWER_KEY     20
-
-#define TROUT_4_TP_LS_EN    19
-#define TROUT_5_TP_LS_EN    1
-
-#define TROUT_CPLD_BASE   IOMEM(0xE8100000)
-#define TROUT_CPLD_START  0x98000000
-#define TROUT_CPLD_SIZE   SZ_4K
-
-#define TROUT_GPIO_CABLE_IN1		(83)
-#define TROUT_GPIO_CABLE_IN2		(49)
-
-#define TROUT_GPIO_START (128)
-
-#define TROUT_GPIO_INT_MASK0_REG            (0x0c)
-#define TROUT_GPIO_INT_STAT0_REG            (0x0e)
-#define TROUT_GPIO_INT_MASK1_REG            (0x14)
-#define TROUT_GPIO_INT_STAT1_REG            (0x10)
-
-#define TROUT_GPIO_HAPTIC_PWM               (28)
-#define TROUT_GPIO_PS_HOLD                  (25)
-
-#define TROUT_GPIO_MISC2_BASE               (TROUT_GPIO_START + 0x00)
-#define TROUT_GPIO_MISC3_BASE               (TROUT_GPIO_START + 0x08)
-#define TROUT_GPIO_MISC4_BASE               (TROUT_GPIO_START + 0x10)
-#define TROUT_GPIO_MISC5_BASE               (TROUT_GPIO_START + 0x18)
-#define TROUT_GPIO_INT2_BASE                (TROUT_GPIO_START + 0x20)
-#define TROUT_GPIO_MISC1_BASE               (TROUT_GPIO_START + 0x28)
-#define TROUT_GPIO_VIRTUAL_BASE             (TROUT_GPIO_START + 0x30)
-#define TROUT_GPIO_INT5_BASE                (TROUT_GPIO_START + 0x48)
-
-#define TROUT_GPIO_CHARGER_EN               (TROUT_GPIO_MISC2_BASE + 0)
-#define TROUT_GPIO_ISET                     (TROUT_GPIO_MISC2_BASE + 1)
-#define TROUT_GPIO_H2W_DAT_DIR              (TROUT_GPIO_MISC2_BASE + 2)
-#define TROUT_GPIO_H2W_CLK_DIR              (TROUT_GPIO_MISC2_BASE + 3)
-#define TROUT_GPIO_H2W_DAT_GPO              (TROUT_GPIO_MISC2_BASE + 4)
-#define TROUT_GPIO_H2W_CLK_GPO              (TROUT_GPIO_MISC2_BASE + 5)
-#define TROUT_GPIO_H2W_SEL0                 (TROUT_GPIO_MISC2_BASE + 6)
-#define TROUT_GPIO_H2W_SEL1                 (TROUT_GPIO_MISC2_BASE + 7)
-
-#define TROUT_GPIO_SPOTLIGHT_EN             (TROUT_GPIO_MISC3_BASE + 0)
-#define TROUT_GPIO_FLASH_EN                 (TROUT_GPIO_MISC3_BASE + 1)
-#define TROUT_GPIO_I2C_PULL                 (TROUT_GPIO_MISC3_BASE + 2)
-#define TROUT_GPIO_TP_I2C_PULL              (TROUT_GPIO_MISC3_BASE + 3)
-#define TROUT_GPIO_TP_EN                    (TROUT_GPIO_MISC3_BASE + 4)
-#define TROUT_GPIO_JOG_EN                   (TROUT_GPIO_MISC3_BASE + 5)
-#define TROUT_GPIO_UI_LED_EN                (TROUT_GPIO_MISC3_BASE + 6)
-#define TROUT_GPIO_QTKEY_LED_EN             (TROUT_GPIO_MISC3_BASE + 7)
-
-#define TROUT_GPIO_VCM_PWDN                 (TROUT_GPIO_MISC4_BASE + 0)
-#define TROUT_GPIO_USB_H2W_SW               (TROUT_GPIO_MISC4_BASE + 1)
-#define TROUT_GPIO_COMPASS_RST_N            (TROUT_GPIO_MISC4_BASE + 2)
-#define TROUT_GPIO_HAPTIC_EN_UP             (TROUT_GPIO_MISC4_BASE + 3)
-#define TROUT_GPIO_HAPTIC_EN_MAIN           (TROUT_GPIO_MISC4_BASE + 4)
-#define TROUT_GPIO_USB_PHY_RST_N            (TROUT_GPIO_MISC4_BASE + 5)
-#define TROUT_GPIO_WIFI_PA_RESETX           (TROUT_GPIO_MISC4_BASE + 6)
-#define TROUT_GPIO_WIFI_EN                  (TROUT_GPIO_MISC4_BASE + 7)
-
-#define TROUT_GPIO_BT_32K_EN                (TROUT_GPIO_MISC5_BASE + 0)
-#define TROUT_GPIO_MAC_32K_EN               (TROUT_GPIO_MISC5_BASE + 1)
-#define TROUT_GPIO_MDDI_32K_EN              (TROUT_GPIO_MISC5_BASE + 2)
-#define TROUT_GPIO_COMPASS_32K_EN           (TROUT_GPIO_MISC5_BASE + 3)
-
-#define TROUT_GPIO_NAVI_ACT_N               (TROUT_GPIO_INT2_BASE + 0)
-#define TROUT_GPIO_COMPASS_IRQ              (TROUT_GPIO_INT2_BASE + 1)
-#define TROUT_GPIO_SLIDING_DET              (TROUT_GPIO_INT2_BASE + 2)
-#define TROUT_GPIO_AUD_HSMIC_DET_N          (TROUT_GPIO_INT2_BASE + 3)
-#define TROUT_GPIO_SD_DOOR_N                (TROUT_GPIO_INT2_BASE + 4)
-#define TROUT_GPIO_CAM_BTN_STEP1_N          (TROUT_GPIO_INT2_BASE + 5)
-#define TROUT_GPIO_CAM_BTN_STEP2_N          (TROUT_GPIO_INT2_BASE + 6)
-#define TROUT_GPIO_TP_ATT_N                 (TROUT_GPIO_INT2_BASE + 7)
-#define TROUT_GPIO_BANK0_FIRST_INT_SOURCE   (TROUT_GPIO_NAVI_ACT_N)
-#define TROUT_GPIO_BANK0_LAST_INT_SOURCE    (TROUT_GPIO_TP_ATT_N)
-
-#define TROUT_GPIO_H2W_DAT_GPI              (TROUT_GPIO_MISC1_BASE + 0)
-#define TROUT_GPIO_H2W_CLK_GPI              (TROUT_GPIO_MISC1_BASE + 1)
-#define TROUT_GPIO_CPLD128_VER_0            (TROUT_GPIO_MISC1_BASE + 4)
-#define TROUT_GPIO_CPLD128_VER_1            (TROUT_GPIO_MISC1_BASE + 5)
-#define TROUT_GPIO_CPLD128_VER_2            (TROUT_GPIO_MISC1_BASE + 6)
-#define TROUT_GPIO_CPLD128_VER_3            (TROUT_GPIO_MISC1_BASE + 7)
-
-#define TROUT_GPIO_SDMC_CD_N                (TROUT_GPIO_VIRTUAL_BASE + 0)
-#define TROUT_GPIO_END                      (TROUT_GPIO_SDMC_CD_N)
-#define TROUT_GPIO_BANK1_FIRST_INT_SOURCE   (TROUT_GPIO_SDMC_CD_N)
-#define TROUT_GPIO_BANK1_LAST_INT_SOURCE    (TROUT_GPIO_SDMC_CD_N)
-
-#define TROUT_GPIO_VIRTUAL_TO_REAL_OFFSET \
-	(TROUT_GPIO_INT5_BASE - TROUT_GPIO_VIRTUAL_BASE)
-
-#define TROUT_INT_START (NR_MSM_IRQS + NR_GPIO_IRQS)
-#define TROUT_INT_BANK0_COUNT (8)
-#define TROUT_INT_BANK1_START (TROUT_INT_START + TROUT_INT_BANK0_COUNT)
-#define TROUT_INT_BANK1_COUNT (1)
-#define TROUT_INT_END (TROUT_INT_START + TROUT_INT_BANK0_COUNT + \
-			TROUT_INT_BANK1_COUNT - 1)
-#define TROUT_GPIO_TO_INT(n) (((n) <= TROUT_GPIO_BANK0_LAST_INT_SOURCE) ? \
-	(TROUT_INT_START - TROUT_GPIO_BANK0_FIRST_INT_SOURCE + (n)) : \
-	(TROUT_INT_BANK1_START - TROUT_GPIO_BANK1_FIRST_INT_SOURCE + (n)))
-
-#define TROUT_INT_TO_BANK(n) ((n - TROUT_INT_START) / TROUT_INT_BANK0_COUNT)
-#define TROUT_INT_TO_MASK(n) (1U << ((n - TROUT_INT_START) & 7))
-#define TROUT_BANK_TO_MASK_REG(bank) \
-	(bank ? TROUT_GPIO_INT_MASK1_REG : TROUT_GPIO_INT_MASK0_REG)
-#define TROUT_BANK_TO_STAT_REG(bank) \
-	(bank ? TROUT_GPIO_INT_STAT1_REG : TROUT_GPIO_INT_STAT0_REG)
-
-#endif /* GUARD */
diff --git a/arch/arm/mach-msm/clock-pcom.c b/arch/arm/mach-msm/clock-pcom.c
deleted file mode 100644
index f5b69d736ee5..000000000000
--- a/arch/arm/mach-msm/clock-pcom.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright (C) 2007 Google, Inc.
- * Copyright (c) 2007-2012, The Linux Foundation. All rights reserved.
- *
- * 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/kernel.h>
-#include <linux/err.h>
-#include <linux/platform_device.h>
-#include <linux/module.h>
-#include <linux/clk-provider.h>
-#include <linux/clkdev.h>
-
-#include <mach/clk.h>
-
-#include "proc_comm.h"
-#include "clock.h"
-#include "clock-pcom.h"
-
-struct clk_pcom {
-	unsigned id;
-	unsigned long flags;
-	struct msm_clk msm_clk;
-};
-
-static inline struct clk_pcom *to_clk_pcom(struct clk_hw *hw)
-{
-	return container_of(to_msm_clk(hw), struct clk_pcom, msm_clk);
-}
-
-static int pc_clk_enable(struct clk_hw *hw)
-{
-	unsigned id = to_clk_pcom(hw)->id;
-	int rc = msm_proc_comm(PCOM_CLKCTL_RPC_ENABLE, &id, NULL);
-	if (rc < 0)
-		return rc;
-	else
-		return (int)id < 0 ? -EINVAL : 0;
-}
-
-static void pc_clk_disable(struct clk_hw *hw)
-{
-	unsigned id = to_clk_pcom(hw)->id;
-	msm_proc_comm(PCOM_CLKCTL_RPC_DISABLE, &id, NULL);
-}
-
-static int pc_clk_reset(struct clk_hw *hw, enum clk_reset_action action)
-{
-	int rc;
-	unsigned id = to_clk_pcom(hw)->id;
-
-	if (action == CLK_RESET_ASSERT)
-		rc = msm_proc_comm(PCOM_CLKCTL_RPC_RESET_ASSERT, &id, NULL);
-	else
-		rc = msm_proc_comm(PCOM_CLKCTL_RPC_RESET_DEASSERT, &id, NULL);
-
-	if (rc < 0)
-		return rc;
-	else
-		return (int)id < 0 ? -EINVAL : 0;
-}
-
-static int pc_clk_set_rate(struct clk_hw *hw, unsigned long new_rate,
-			   unsigned long p_rate)
-{
-	struct clk_pcom *p = to_clk_pcom(hw);
-	unsigned id = p->id, rate = new_rate;
-	int rc;
-
-	/*
-	 * The rate _might_ be rounded off to the nearest KHz value by the
-	 * remote function. So a return value of 0 doesn't necessarily mean
-	 * that the exact rate was set successfully.
-	 */
-	if (p->flags & CLKFLAG_MIN)
-		rc = msm_proc_comm(PCOM_CLKCTL_RPC_MIN_RATE, &id, &rate);
-	else
-		rc = msm_proc_comm(PCOM_CLKCTL_RPC_SET_RATE, &id, &rate);
-	if (rc < 0)
-		return rc;
-	else
-		return (int)id < 0 ? -EINVAL : 0;
-}
-
-static unsigned long pc_clk_recalc_rate(struct clk_hw *hw, unsigned long p_rate)
-{
-	unsigned id = to_clk_pcom(hw)->id;
-	if (msm_proc_comm(PCOM_CLKCTL_RPC_RATE, &id, NULL))
-		return 0;
-	else
-		return id;
-}
-
-static int pc_clk_is_enabled(struct clk_hw *hw)
-{
-	unsigned id = to_clk_pcom(hw)->id;
-	if (msm_proc_comm(PCOM_CLKCTL_RPC_ENABLED, &id, NULL))
-		return 0;
-	else
-		return id;
-}
-
-static long pc_clk_round_rate(struct clk_hw *hw, unsigned long rate,
-			      unsigned long *p_rate)
-{
-	/* Not really supported; pc_clk_set_rate() does rounding on it's own. */
-	return rate;
-}
-
-static struct clk_ops clk_ops_pcom = {
-	.enable = pc_clk_enable,
-	.disable = pc_clk_disable,
-	.set_rate = pc_clk_set_rate,
-	.recalc_rate = pc_clk_recalc_rate,
-	.is_enabled = pc_clk_is_enabled,
-	.round_rate = pc_clk_round_rate,
-};
-
-static int msm_clock_pcom_probe(struct platform_device *pdev)
-{
-	const struct pcom_clk_pdata *pdata = pdev->dev.platform_data;
-	int i, ret;
-
-	for (i = 0; i < pdata->num_lookups; i++) {
-		const struct clk_pcom_desc *desc = &pdata->lookup[i];
-		struct clk *c;
-		struct clk_pcom *p;
-		struct clk_hw *hw;
-		struct clk_init_data init;
-
-		p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL);
-		if (!p)
-			return -ENOMEM;
-
-		p->id = desc->id;
-		p->flags = desc->flags;
-		p->msm_clk.reset = pc_clk_reset;
-
-		hw = &p->msm_clk.hw;
-		hw->init = &init;
-
-		init.name = desc->name;
-		init.ops = &clk_ops_pcom;
-		init.num_parents = 0;
-		init.flags = CLK_IS_ROOT;
-
-		if (!(p->flags & CLKFLAG_AUTO_OFF))
-			init.flags |= CLK_IGNORE_UNUSED;
-
-		c = devm_clk_register(&pdev->dev, hw);
-		ret = clk_register_clkdev(c, desc->con, desc->dev);
-		if (ret)
-			return ret;
-	}
-
-	return 0;
-}
-
-static struct platform_driver msm_clock_pcom_driver = {
-	.probe		= msm_clock_pcom_probe,
-	.driver		= {
-		.name	= "msm-clock-pcom",
-	},
-};
-module_platform_driver(msm_clock_pcom_driver);
-
-MODULE_LICENSE("GPL v2");
diff --git a/arch/arm/mach-msm/clock-pcom.h b/arch/arm/mach-msm/clock-pcom.h
deleted file mode 100644
index 5bb164fd46a8..000000000000
--- a/arch/arm/mach-msm/clock-pcom.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright (c) 2009-2012, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#ifndef __ARCH_ARM_MACH_MSM_CLOCK_PCOM_H
-#define __ARCH_ARM_MACH_MSM_CLOCK_PCOM_H
-
-/* clock IDs used by the modem processor */
-
-#define P_ACPU_CLK	0   /* Applications processor clock */
-#define P_ADM_CLK	1   /* Applications data mover clock */
-#define P_ADSP_CLK	2   /* ADSP clock */
-#define P_EBI1_CLK	3   /* External bus interface 1 clock */
-#define P_EBI2_CLK	4   /* External bus interface 2 clock */
-#define P_ECODEC_CLK	5   /* External CODEC clock */
-#define P_EMDH_CLK	6   /* External MDDI host clock */
-#define P_GP_CLK	7   /* General purpose clock */
-#define P_GRP_3D_CLK	8   /* Graphics clock */
-#define P_I2C_CLK	9   /* I2C clock */
-#define P_ICODEC_RX_CLK	10  /* Internal CODEX RX clock */
-#define P_ICODEC_TX_CLK	11  /* Internal CODEX TX clock */
-#define P_IMEM_CLK	12  /* Internal graphics memory clock */
-#define P_MDC_CLK	13  /* MDDI client clock */
-#define P_MDP_CLK	14  /* Mobile display processor clock */
-#define P_PBUS_CLK	15  /* Peripheral bus clock */
-#define P_PCM_CLK	16  /* PCM clock */
-#define P_PMDH_CLK	17  /* Primary MDDI host clock */
-#define P_SDAC_CLK	18  /* Stereo DAC clock */
-#define P_SDC1_CLK	19  /* Secure Digital Card clocks */
-#define P_SDC1_P_CLK	20
-#define P_SDC2_CLK	21
-#define P_SDC2_P_CLK	22
-#define P_SDC3_CLK	23
-#define P_SDC3_P_CLK	24
-#define P_SDC4_CLK	25
-#define P_SDC4_P_CLK	26
-#define P_TSIF_CLK	27  /* Transport Stream Interface clocks */
-#define P_TSIF_REF_CLK	28
-#define P_TV_DAC_CLK	29  /* TV clocks */
-#define P_TV_ENC_CLK	30
-#define P_UART1_CLK	31  /* UART clocks */
-#define P_UART2_CLK	32
-#define P_UART3_CLK	33
-#define P_UART1DM_CLK	34
-#define P_UART2DM_CLK	35
-#define P_USB_HS_CLK	36  /* High speed USB core clock */
-#define P_USB_HS_P_CLK	37  /* High speed USB pbus clock */
-#define P_USB_OTG_CLK	38  /* Full speed USB clock */
-#define P_VDC_CLK	39  /* Video controller clock */
-#define P_VFE_MDC_CLK	40  /* Camera / Video Front End clock */
-#define P_VFE_CLK	41  /* VFE MDDI client clock */
-#define P_MDP_LCDC_PCLK_CLK	42
-#define P_MDP_LCDC_PAD_PCLK_CLK 43
-#define P_MDP_VSYNC_CLK	44
-#define P_SPI_CLK	45
-#define P_VFE_AXI_CLK	46
-#define P_USB_HS2_CLK	47  /* High speed USB 2 core clock */
-#define P_USB_HS2_P_CLK	48  /* High speed USB 2 pbus clock */
-#define P_USB_HS3_CLK	49  /* High speed USB 3 core clock */
-#define P_USB_HS3_P_CLK	50  /* High speed USB 3 pbus clock */
-#define P_GRP_3D_P_CLK	51  /* Graphics pbus clock */
-#define P_USB_PHY_CLK	52  /* USB PHY clock */
-#define P_USB_HS_CORE_CLK	53  /* High speed USB 1 core clock */
-#define P_USB_HS2_CORE_CLK	54  /* High speed USB 2 core clock */
-#define P_USB_HS3_CORE_CLK	55  /* High speed USB 3 core clock */
-#define P_CAM_M_CLK		56
-#define P_CAMIF_PAD_P_CLK	57
-#define P_GRP_2D_CLK		58
-#define P_GRP_2D_P_CLK		59
-#define P_I2S_CLK		60
-#define P_JPEG_CLK		61
-#define P_JPEG_P_CLK		62
-#define P_LPA_CODEC_CLK		63
-#define P_LPA_CORE_CLK		64
-#define P_LPA_P_CLK		65
-#define P_MDC_IO_CLK		66
-#define P_MDC_P_CLK		67
-#define P_MFC_CLK		68
-#define P_MFC_DIV2_CLK		69
-#define P_MFC_P_CLK		70
-#define P_QUP_I2C_CLK		71
-#define P_ROTATOR_IMEM_CLK	72
-#define P_ROTATOR_P_CLK		73
-#define P_VFE_CAMIF_CLK		74
-#define P_VFE_P_CLK		75
-#define P_VPE_CLK		76
-#define P_I2C_2_CLK		77
-#define P_MI2S_CODEC_RX_S_CLK	78
-#define P_MI2S_CODEC_RX_M_CLK	79
-#define P_MI2S_CODEC_TX_S_CLK	80
-#define P_MI2S_CODEC_TX_M_CLK	81
-#define P_PMDH_P_CLK		82
-#define P_EMDH_P_CLK		83
-#define P_SPI_P_CLK		84
-#define P_TSIF_P_CLK		85
-#define P_MDP_P_CLK		86
-#define P_SDAC_M_CLK		87
-#define P_MI2S_S_CLK		88
-#define P_MI2S_M_CLK		89
-#define P_AXI_ROTATOR_CLK	90
-#define P_HDMI_CLK		91
-#define P_CSI0_CLK		92
-#define P_CSI0_VFE_CLK		93
-#define P_CSI0_P_CLK		94
-#define P_CSI1_CLK		95
-#define P_CSI1_VFE_CLK		96
-#define P_CSI1_P_CLK		97
-#define P_GSBI_CLK		98
-#define P_GSBI_P_CLK		99
-#define P_CE_CLK		100 /* Crypto engine */
-#define P_CODEC_SSBI_CLK	101
-
-#define P_NR_CLKS		102
-
-struct clk_pcom_desc {
-	unsigned id;
-	const char *name;
-	const char *con;
-	const char *dev;
-	unsigned long flags;
-};
-
-struct pcom_clk_pdata {
-	struct clk_pcom_desc *lookup;
-	u32 num_lookups;
-};
-
-#define CLK_PCOM(clk_name, clk_id, clk_dev, clk_flags) {	\
-	.id = P_##clk_id,					\
-	.name = #clk_id,					\
-	.con = clk_name,					\
-	.dev = clk_dev,						\
-	.flags = clk_flags,					\
-	}
-
-#endif
diff --git a/arch/arm/mach-msm/clock.c b/arch/arm/mach-msm/clock.c
deleted file mode 100644
index 35ea02b52483..000000000000
--- a/arch/arm/mach-msm/clock.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* arch/arm/mach-msm/clock.c
- *
- * Copyright (C) 2007 Google, Inc.
- * Copyright (c) 2007-2012, The Linux Foundation. All rights reserved.
- *
- * 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/clk-provider.h>
-#include <linux/module.h>
-
-#include "clock.h"
-
-int clk_reset(struct clk *clk, enum clk_reset_action action)
-{
-	struct clk_hw *hw = __clk_get_hw(clk);
-	struct msm_clk *m = to_msm_clk(hw);
-	return m->reset(hw, action);
-}
-EXPORT_SYMBOL(clk_reset);
diff --git a/arch/arm/mach-msm/clock.h b/arch/arm/mach-msm/clock.h
deleted file mode 100644
index 42d29dd7aafc..000000000000
--- a/arch/arm/mach-msm/clock.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* arch/arm/mach-msm/clock.h
- *
- * Copyright (C) 2007 Google, Inc.
- * Copyright (c) 2007-2012, The Linux Foundation. All rights reserved.
- *
- * 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.
- *
- */
-
-#ifndef __ARCH_ARM_MACH_MSM_CLOCK_H
-#define __ARCH_ARM_MACH_MSM_CLOCK_H
-
-#include <linux/clk-provider.h>
-#include <mach/clk.h>
-
-#define CLK_FIRST_AVAILABLE_FLAG	0x00000100
-#define CLKFLAG_AUTO_OFF		0x00000200
-#define CLKFLAG_MIN			0x00000400
-#define CLKFLAG_MAX			0x00000800
-
-#define OFF CLKFLAG_AUTO_OFF
-#define CLK_MIN CLKFLAG_MIN
-#define CLK_MAX CLKFLAG_MAX
-#define CLK_MINMAX (CLK_MIN | CLK_MAX)
-
-struct msm_clk {
-	int (*reset)(struct clk_hw *hw, enum clk_reset_action action);
-	struct clk_hw hw;
-};
-
-static inline struct msm_clk *to_msm_clk(struct clk_hw *hw)
-{
-	return container_of(hw, struct msm_clk, hw);
-}
-
-#endif
diff --git a/arch/arm/mach-msm/common.h b/arch/arm/mach-msm/common.h
deleted file mode 100644
index 572479a3c7be..000000000000
--- a/arch/arm/mach-msm/common.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-#ifndef __MACH_COMMON_H
-#define __MACH_COMMON_H
-
-extern void msm7x01_timer_init(void);
-extern void msm7x30_timer_init(void);
-extern void qsd8x50_timer_init(void);
-
-extern void msm_map_common_io(void);
-extern void msm_map_msm7x30_io(void);
-extern void msm_map_qsd8x50_io(void);
-
-extern void __iomem *__msm_ioremap_caller(phys_addr_t phys_addr, size_t size,
-					  unsigned int mtype, void *caller);
-
-struct msm_mmc_platform_data;
-
-extern void msm_add_devices(void);
-extern void msm_init_irq(void);
-extern void msm_init_gpio(void);
-extern int msm_add_sdcc(unsigned int controller,
-			struct msm_mmc_platform_data *plat,
-			unsigned int stat_irq, unsigned long stat_irq_flags);
-
-#if defined(CONFIG_MSM_SMD) && defined(CONFIG_DEBUG_FS)
-extern int smd_debugfs_init(void);
-#else
-static inline int smd_debugfs_init(void) { return 0; }
-#endif
-
-#endif
diff --git a/arch/arm/mach-msm/devices-msm7x00.c b/arch/arm/mach-msm/devices-msm7x00.c
deleted file mode 100644
index d83404d4b328..000000000000
--- a/arch/arm/mach-msm/devices-msm7x00.c
+++ /dev/null
@@ -1,480 +0,0 @@
-/* linux/arch/arm/mach-msm/devices.c
- *
- * Copyright (C) 2008 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/kernel.h>
-#include <linux/platform_device.h>
-#include <linux/clkdev.h>
-
-#include <mach/irqs.h>
-#include <mach/msm_iomap.h>
-#include "devices.h"
-
-#include <asm/mach/flash.h>
-#include <linux/mtd/nand.h>
-#include <linux/mtd/partitions.h>
-
-#include "clock.h"
-#include "clock-pcom.h"
-#include <linux/platform_data/mmc-msm_sdcc.h>
-
-static struct resource msm_gpio_resources[] = {
-	{
-		.start	= 32 + 0,
-		.end	= 32 + 0,
-		.flags	= IORESOURCE_IRQ,
-	},
-	{
-		.start	= 32 + 1,
-		.end	= 32 + 1,
-		.flags	= IORESOURCE_IRQ,
-	},
-	{
-		.start	= 0xa9200800,
-		.end	= 0xa9200800 + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-		.name  = "gpio1"
-	},
-	{
-		.start	= 0xa9300C00,
-		.end	= 0xa9300C00 + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-		.name  = "gpio2"
-	},
-};
-
-struct platform_device msm_device_gpio_7201 = {
-	.name	= "gpio-msm-7201",
-	.num_resources	= ARRAY_SIZE(msm_gpio_resources),
-	.resource	= msm_gpio_resources,
-};
-
-static struct resource resources_uart1[] = {
-	{
-		.start	= INT_UART1,
-		.end	= INT_UART1,
-		.flags	= IORESOURCE_IRQ,
-	},
-	{
-		.start	= MSM_UART1_PHYS,
-		.end	= MSM_UART1_PHYS + MSM_UART1_SIZE - 1,
-		.flags	= IORESOURCE_MEM,
-		.name  = "uart_resource"
-	},
-};
-
-static struct resource resources_uart2[] = {
-	{
-		.start	= INT_UART2,
-		.end	= INT_UART2,
-		.flags	= IORESOURCE_IRQ,
-	},
-	{
-		.start	= MSM_UART2_PHYS,
-		.end	= MSM_UART2_PHYS + MSM_UART2_SIZE - 1,
-		.flags	= IORESOURCE_MEM,
-		.name  = "uart_resource"
-	},
-};
-
-static struct resource resources_uart3[] = {
-	{
-		.start	= INT_UART3,
-		.end	= INT_UART3,
-		.flags	= IORESOURCE_IRQ,
-	},
-	{
-		.start	= MSM_UART3_PHYS,
-		.end	= MSM_UART3_PHYS + MSM_UART3_SIZE - 1,
-		.flags	= IORESOURCE_MEM,
-		.name  = "uart_resource"
-	},
-};
-
-struct platform_device msm_device_uart1 = {
-	.name	= "msm_serial",
-	.id	= 0,
-	.num_resources	= ARRAY_SIZE(resources_uart1),
-	.resource	= resources_uart1,
-};
-
-struct platform_device msm_device_uart2 = {
-	.name	= "msm_serial",
-	.id	= 1,
-	.num_resources	= ARRAY_SIZE(resources_uart2),
-	.resource	= resources_uart2,
-};
-
-struct platform_device msm_device_uart3 = {
-	.name	= "msm_serial",
-	.id	= 2,
-	.num_resources	= ARRAY_SIZE(resources_uart3),
-	.resource	= resources_uart3,
-};
-
-static struct resource resources_i2c[] = {
-	{
-		.start	= MSM_I2C_PHYS,
-		.end	= MSM_I2C_PHYS + MSM_I2C_SIZE - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_PWB_I2C,
-		.end	= INT_PWB_I2C,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-struct platform_device msm_device_i2c = {
-	.name		= "msm_i2c",
-	.id		= 0,
-	.num_resources	= ARRAY_SIZE(resources_i2c),
-	.resource	= resources_i2c,
-};
-
-static struct resource resources_hsusb[] = {
-	{
-		.start	= MSM_HSUSB_PHYS,
-		.end	= MSM_HSUSB_PHYS + MSM_HSUSB_SIZE,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_USB_HS,
-		.end	= INT_USB_HS,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-struct platform_device msm_device_hsusb = {
-	.name		= "msm_hsusb",
-	.id		= -1,
-	.num_resources	= ARRAY_SIZE(resources_hsusb),
-	.resource	= resources_hsusb,
-	.dev		= {
-		.coherent_dma_mask	= 0xffffffff,
-	},
-};
-
-struct flash_platform_data msm_nand_data = {
-	.parts		= NULL,
-	.nr_parts	= 0,
-};
-
-static struct resource resources_nand[] = {
-	[0] = {
-		.start	= 7,
-		.end	= 7,
-		.flags	= IORESOURCE_DMA,
-	},
-};
-
-struct platform_device msm_device_nand = {
-	.name		= "msm_nand",
-	.id		= -1,
-	.num_resources	= ARRAY_SIZE(resources_nand),
-	.resource	= resources_nand,
-	.dev		= {
-		.platform_data	= &msm_nand_data,
-	},
-};
-
-struct platform_device msm_device_smd = {
-	.name	= "msm_smd",
-	.id	= -1,
-};
-
-static struct resource resources_sdc1[] = {
-	{
-		.start	= MSM_SDC1_PHYS,
-		.end	= MSM_SDC1_PHYS + MSM_SDC1_SIZE - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_SDC1_0,
-		.end	= INT_SDC1_0,
-		.flags	= IORESOURCE_IRQ,
-		.name	= "cmd_irq",
-	},
-	{
-		.flags	= IORESOURCE_IRQ | IORESOURCE_DISABLED,
-		.name	= "status_irq"
-	},
-	{
-		.start	= 8,
-		.end	= 8,
-		.flags	= IORESOURCE_DMA,
-	},
-};
-
-static struct resource resources_sdc2[] = {
-	{
-		.start	= MSM_SDC2_PHYS,
-		.end	= MSM_SDC2_PHYS + MSM_SDC2_SIZE - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_SDC2_0,
-		.end	= INT_SDC2_0,
-		.flags	= IORESOURCE_IRQ,
-		.name	= "cmd_irq",
-	},
-	{
-		.flags	= IORESOURCE_IRQ | IORESOURCE_DISABLED,
-		.name	= "status_irq"
-	},
-	{
-		.start	= 8,
-		.end	= 8,
-		.flags	= IORESOURCE_DMA,
-	},
-};
-
-static struct resource resources_sdc3[] = {
-	{
-		.start	= MSM_SDC3_PHYS,
-		.end	= MSM_SDC3_PHYS + MSM_SDC3_SIZE - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_SDC3_0,
-		.end	= INT_SDC3_0,
-		.flags	= IORESOURCE_IRQ,
-		.name	= "cmd_irq",
-	},
-	{
-		.flags	= IORESOURCE_IRQ | IORESOURCE_DISABLED,
-		.name	= "status_irq"
-	},
-	{
-		.start	= 8,
-		.end	= 8,
-		.flags	= IORESOURCE_DMA,
-	},
-};
-
-static struct resource resources_sdc4[] = {
-	{
-		.start	= MSM_SDC4_PHYS,
-		.end	= MSM_SDC4_PHYS + MSM_SDC4_SIZE - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_SDC4_0,
-		.end	= INT_SDC4_0,
-		.flags	= IORESOURCE_IRQ,
-		.name	= "cmd_irq",
-	},
-	{
-		.flags	= IORESOURCE_IRQ | IORESOURCE_DISABLED,
-		.name	= "status_irq"
-	},
-	{
-		.start	= 8,
-		.end	= 8,
-		.flags	= IORESOURCE_DMA,
-	},
-};
-
-struct platform_device msm_device_sdc1 = {
-	.name		= "msm_sdcc",
-	.id		= 1,
-	.num_resources	= ARRAY_SIZE(resources_sdc1),
-	.resource	= resources_sdc1,
-	.dev		= {
-		.coherent_dma_mask	= 0xffffffff,
-	},
-};
-
-struct platform_device msm_device_sdc2 = {
-	.name		= "msm_sdcc",
-	.id		= 2,
-	.num_resources	= ARRAY_SIZE(resources_sdc2),
-	.resource	= resources_sdc2,
-	.dev		= {
-		.coherent_dma_mask	= 0xffffffff,
-	},
-};
-
-struct platform_device msm_device_sdc3 = {
-	.name		= "msm_sdcc",
-	.id		= 3,
-	.num_resources	= ARRAY_SIZE(resources_sdc3),
-	.resource	= resources_sdc3,
-	.dev		= {
-		.coherent_dma_mask	= 0xffffffff,
-	},
-};
-
-struct platform_device msm_device_sdc4 = {
-	.name		= "msm_sdcc",
-	.id		= 4,
-	.num_resources	= ARRAY_SIZE(resources_sdc4),
-	.resource	= resources_sdc4,
-	.dev		= {
-		.coherent_dma_mask	= 0xffffffff,
-	},
-};
-
-static struct platform_device *msm_sdcc_devices[] __initdata = {
-	&msm_device_sdc1,
-	&msm_device_sdc2,
-	&msm_device_sdc3,
-	&msm_device_sdc4,
-};
-
-int __init msm_add_sdcc(unsigned int controller,
-			struct msm_mmc_platform_data *plat,
-			unsigned int stat_irq, unsigned long stat_irq_flags)
-{
-	struct platform_device	*pdev;
-	struct resource *res;
-
-	if (controller < 1 || controller > 4)
-		return -EINVAL;
-
-	pdev = msm_sdcc_devices[controller-1];
-	pdev->dev.platform_data = plat;
-
-	res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "status_irq");
-	if (!res)
-		return -EINVAL;
-	else if (stat_irq) {
-		res->start = res->end = stat_irq;
-		res->flags &= ~IORESOURCE_DISABLED;
-		res->flags |= stat_irq_flags;
-	}
-
-	return platform_device_register(pdev);
-}
-
-static struct resource resources_mddi0[] = {
-	{
-		.start	= MSM_PMDH_PHYS,
-		.end	= MSM_PMDH_PHYS + MSM_PMDH_SIZE - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_MDDI_PRI,
-		.end	= INT_MDDI_PRI,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-static struct resource resources_mddi1[] = {
-	{
-		.start	= MSM_EMDH_PHYS,
-		.end	= MSM_EMDH_PHYS + MSM_EMDH_SIZE - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_MDDI_EXT,
-		.end	= INT_MDDI_EXT,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-struct platform_device msm_device_mddi0 = {
-	.name = "msm_mddi",
-	.id = 0,
-	.num_resources = ARRAY_SIZE(resources_mddi0),
-	.resource = resources_mddi0,
-	.dev = {
-		.coherent_dma_mask      = 0xffffffff,
-	},
-};
-
-struct platform_device msm_device_mddi1 = {
-	.name = "msm_mddi",
-	.id = 1,
-	.num_resources = ARRAY_SIZE(resources_mddi1),
-	.resource = resources_mddi1,
-	.dev = {
-		.coherent_dma_mask      = 0xffffffff,
-	},
-};
-
-static struct resource resources_mdp[] = {
-	{
-		.start	= MSM_MDP_PHYS,
-		.end	= MSM_MDP_PHYS + MSM_MDP_SIZE - 1,
-		.name	= "mdp",
-		.flags	= IORESOURCE_MEM
-	},
-	{
-		.start	= INT_MDP,
-		.end	= INT_MDP,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-struct platform_device msm_device_mdp = {
-	.name = "msm_mdp",
-	.id = 0,
-	.num_resources = ARRAY_SIZE(resources_mdp),
-	.resource = resources_mdp,
-};
-
-static struct clk_pcom_desc msm_clocks_7x01a[] = {
-	CLK_PCOM("adm_clk",	ADM_CLK,	NULL, 0),
-	CLK_PCOM("adsp_clk",	ADSP_CLK,	NULL, 0),
-	CLK_PCOM("ebi1_clk",	EBI1_CLK,	NULL, 0),
-	CLK_PCOM("ebi2_clk",	EBI2_CLK,	NULL, 0),
-	CLK_PCOM("ecodec_clk",	ECODEC_CLK,	NULL, 0),
-	CLK_PCOM("emdh_clk",	EMDH_CLK,	NULL, OFF),
-	CLK_PCOM("gp_clk",		GP_CLK,		NULL, 0),
-	CLK_PCOM("grp_clk",	GRP_3D_CLK,	NULL, OFF),
-	CLK_PCOM("i2c_clk",	I2C_CLK,	"msm_i2c.0", 0),
-	CLK_PCOM("icodec_rx_clk",	ICODEC_RX_CLK,	NULL, 0),
-	CLK_PCOM("icodec_tx_clk",	ICODEC_TX_CLK,	NULL, 0),
-	CLK_PCOM("imem_clk",	IMEM_CLK,	NULL, OFF),
-	CLK_PCOM("mdc_clk",	MDC_CLK,	NULL, 0),
-	CLK_PCOM("mdp_clk",	MDP_CLK,	NULL, OFF),
-	CLK_PCOM("pbus_clk",	PBUS_CLK,	NULL, 0),
-	CLK_PCOM("pcm_clk",	PCM_CLK,	NULL, 0),
-	CLK_PCOM("mddi_clk",	PMDH_CLK,	NULL, OFF | CLK_MINMAX),
-	CLK_PCOM("sdac_clk",	SDAC_CLK,	NULL, OFF),
-	CLK_PCOM("sdc_clk",	SDC1_CLK,	"msm_sdcc.1", OFF),
-	CLK_PCOM("sdc_pclk",	SDC1_P_CLK,	"msm_sdcc.1", OFF),
-	CLK_PCOM("sdc_clk",	SDC2_CLK,	"msm_sdcc.2", OFF),
-	CLK_PCOM("sdc_pclk",	SDC2_P_CLK,	"msm_sdcc.2", OFF),
-	CLK_PCOM("sdc_clk",	SDC3_CLK,	"msm_sdcc.3", OFF),
-	CLK_PCOM("sdc_pclk",	SDC3_P_CLK,	"msm_sdcc.3", OFF),
-	CLK_PCOM("sdc_clk",	SDC4_CLK,	"msm_sdcc.4", OFF),
-	CLK_PCOM("sdc_pclk",	SDC4_P_CLK,	"msm_sdcc.4", OFF),
-	CLK_PCOM("tsif_clk",	TSIF_CLK,	NULL, 0),
-	CLK_PCOM("tsif_ref_clk",	TSIF_REF_CLK,	NULL, 0),
-	CLK_PCOM("tv_dac_clk",	TV_DAC_CLK,	NULL, 0),
-	CLK_PCOM("tv_enc_clk",	TV_ENC_CLK,	NULL, 0),
-	CLK_PCOM("core",	UART1_CLK,	"msm_serial.0", OFF),
-	CLK_PCOM("core",	UART2_CLK,	"msm_serial.1", 0),
-	CLK_PCOM("core",	UART3_CLK,	"msm_serial.2", OFF),
-	CLK_PCOM("uart1dm_clk",	UART1DM_CLK,	NULL, OFF),
-	CLK_PCOM("uart2dm_clk",	UART2DM_CLK,	NULL, 0),
-	CLK_PCOM("usb_hs_clk",	USB_HS_CLK,	"msm_hsusb", OFF),
-	CLK_PCOM("usb_hs_pclk",	USB_HS_P_CLK,	"msm_hsusb", OFF),
-	CLK_PCOM("usb_otg_clk",	USB_OTG_CLK,	NULL, 0),
-	CLK_PCOM("vdc_clk",	VDC_CLK,	NULL, OFF ),
-	CLK_PCOM("vfe_clk",	VFE_CLK,	NULL, OFF),
-	CLK_PCOM("vfe_mdc_clk",	VFE_MDC_CLK,	NULL, OFF),
-};
-
-static struct pcom_clk_pdata msm_clock_7x01a_pdata = {
-	.lookup = msm_clocks_7x01a,
-	.num_lookups = ARRAY_SIZE(msm_clocks_7x01a),
-};
-
-struct platform_device msm_clock_7x01a = {
-	.name = "msm-clock-pcom",
-	.dev.platform_data = &msm_clock_7x01a_pdata,
-};
diff --git a/arch/arm/mach-msm/devices-msm7x30.c b/arch/arm/mach-msm/devices-msm7x30.c
deleted file mode 100644
index c15ea8ab20a7..000000000000
--- a/arch/arm/mach-msm/devices-msm7x30.c
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * Copyright (C) 2008 Google, Inc.
- * Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved.
- *
- * 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/kernel.h>
-#include <linux/platform_device.h>
-
-#include <linux/dma-mapping.h>
-#include <linux/clkdev.h>
-#include <mach/irqs.h>
-#include <mach/msm_iomap.h>
-#include <mach/dma.h>
-
-#include "devices.h"
-#include "smd_private.h"
-#include "common.h"
-
-#include <asm/mach/flash.h>
-
-#include "clock.h"
-#include "clock-pcom.h"
-
-#include <linux/platform_data/mmc-msm_sdcc.h>
-
-static struct resource msm_gpio_resources[] = {
-	{
-		.start	= 32 + 18,
-		.end	= 32 + 18,
-		.flags	= IORESOURCE_IRQ,
-	},
-	{
-		.start	= 32 + 19,
-		.end	= 32 + 19,
-		.flags	= IORESOURCE_IRQ,
-	},
-	{
-		.start	= 0xac001000,
-		.end	= 0xac001000 + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-		.name  = "gpio1"
-	},
-	{
-		.start	= 0xac101400,
-		.end	= 0xac101400 + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-		.name  = "gpio2"
-	},
-};
-
-struct platform_device msm_device_gpio_7x30 = {
-	.name	= "gpio-msm-7x30",
-	.num_resources	= ARRAY_SIZE(msm_gpio_resources),
-	.resource	= msm_gpio_resources,
-};
-
-static struct resource resources_uart2[] = {
-	{
-		.start	= INT_UART2,
-		.end	= INT_UART2,
-		.flags	= IORESOURCE_IRQ,
-	},
-	{
-		.start	= MSM_UART2_PHYS,
-		.end	= MSM_UART2_PHYS + MSM_UART2_SIZE - 1,
-		.flags	= IORESOURCE_MEM,
-		.name  = "uart_resource"
-	},
-};
-
-struct platform_device msm_device_uart2 = {
-	.name	= "msm_serial",
-	.id	= 1,
-	.num_resources	= ARRAY_SIZE(resources_uart2),
-	.resource	= resources_uart2,
-};
-
-struct platform_device msm_device_smd = {
-	.name   = "msm_smd",
-	.id     = -1,
-};
-
-static struct resource resources_otg[] = {
-	{
-		.start	= MSM_HSUSB_PHYS,
-		.end	= MSM_HSUSB_PHYS + MSM_HSUSB_SIZE,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_USB_HS,
-		.end	= INT_USB_HS,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-struct platform_device msm_device_otg = {
-	.name		= "msm_otg",
-	.id		= -1,
-	.num_resources	= ARRAY_SIZE(resources_otg),
-	.resource	= resources_otg,
-	.dev		= {
-		.coherent_dma_mask	= 0xffffffff,
-	},
-};
-
-static struct resource resources_hsusb[] = {
-	{
-		.start	= MSM_HSUSB_PHYS,
-		.end	= MSM_HSUSB_PHYS + MSM_HSUSB_SIZE,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_USB_HS,
-		.end	= INT_USB_HS,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-struct platform_device msm_device_hsusb = {
-	.name		= "msm_hsusb",
-	.id		= -1,
-	.num_resources	= ARRAY_SIZE(resources_hsusb),
-	.resource	= resources_hsusb,
-	.dev		= {
-		.coherent_dma_mask	= 0xffffffff,
-	},
-};
-
-static u64 dma_mask = 0xffffffffULL;
-static struct resource resources_hsusb_host[] = {
-	{
-		.start	= MSM_HSUSB_PHYS,
-		.end	= MSM_HSUSB_PHYS + MSM_HSUSB_SIZE,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_USB_HS,
-		.end	= INT_USB_HS,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-struct platform_device msm_device_hsusb_host = {
-	.name		= "msm_hsusb_host",
-	.id		= -1,
-	.num_resources	= ARRAY_SIZE(resources_hsusb_host),
-	.resource	= resources_hsusb_host,
-	.dev		= {
-		.dma_mask               = &dma_mask,
-		.coherent_dma_mask      = 0xffffffffULL,
-	},
-};
-
-static struct clk_pcom_desc msm_clocks_7x30[] = {
-	CLK_PCOM("adm_clk",	ADM_CLK,	NULL, 0),
-	CLK_PCOM("adsp_clk",	ADSP_CLK,	NULL, 0),
-	CLK_PCOM("cam_m_clk",	CAM_M_CLK,	NULL, 0),
-	CLK_PCOM("camif_pad_pclk",	CAMIF_PAD_P_CLK,	NULL, OFF),
-	CLK_PCOM("ce_clk",	CE_CLK,	NULL, 0),
-	CLK_PCOM("codec_ssbi_clk",	CODEC_SSBI_CLK,	NULL, 0),
-	CLK_PCOM("ebi1_clk",	EBI1_CLK,	NULL, CLK_MIN),
-	CLK_PCOM("ecodec_clk",	ECODEC_CLK,	NULL, 0),
-	CLK_PCOM("emdh_clk",	EMDH_CLK,	NULL, OFF | CLK_MINMAX),
-	CLK_PCOM("emdh_pclk",	EMDH_P_CLK,	NULL, OFF),
-	CLK_PCOM("gp_clk",	GP_CLK,		NULL, 0),
-	CLK_PCOM("grp_2d_clk",	GRP_2D_CLK,	NULL, 0),
-	CLK_PCOM("grp_2d_pclk",	GRP_2D_P_CLK,	NULL, 0),
-	CLK_PCOM("grp_clk",	GRP_3D_CLK,	NULL, 0),
-	CLK_PCOM("grp_pclk",	GRP_3D_P_CLK,	NULL, 0),
-	CLK_PCOM("hdmi_clk",	HDMI_CLK,	NULL, 0),
-	CLK_PCOM("imem_clk",	IMEM_CLK,	NULL, OFF),
-	CLK_PCOM("jpeg_clk",	JPEG_CLK,	NULL, OFF),
-	CLK_PCOM("jpeg_pclk",	JPEG_P_CLK,	NULL, OFF),
-	CLK_PCOM("lpa_codec_clk",	LPA_CODEC_CLK,		NULL, 0),
-	CLK_PCOM("lpa_core_clk",	LPA_CORE_CLK,		NULL, 0),
-	CLK_PCOM("lpa_pclk",		LPA_P_CLK,		NULL, 0),
-	CLK_PCOM("mdc_clk",	MDC_CLK,	NULL, 0),
-	CLK_PCOM("mddi_clk",	PMDH_CLK,	NULL, OFF | CLK_MINMAX),
-	CLK_PCOM("mddi_pclk",	PMDH_P_CLK,	NULL, 0),
-	CLK_PCOM("mdp_clk",	MDP_CLK,	NULL, OFF),
-	CLK_PCOM("mdp_pclk",	MDP_P_CLK,	NULL, 0),
-	CLK_PCOM("mdp_lcdc_pclk_clk", MDP_LCDC_PCLK_CLK, NULL, 0),
-	CLK_PCOM("mdp_lcdc_pad_pclk_clk", MDP_LCDC_PAD_PCLK_CLK, NULL, 0),
-	CLK_PCOM("mdp_vsync_clk",	MDP_VSYNC_CLK,  NULL, 0),
-	CLK_PCOM("mfc_clk",		MFC_CLK,		NULL, 0),
-	CLK_PCOM("mfc_div2_clk",	MFC_DIV2_CLK,		NULL, 0),
-	CLK_PCOM("mfc_pclk",		MFC_P_CLK,		NULL, 0),
-	CLK_PCOM("mi2s_m_clk",		MI2S_M_CLK,  		NULL, 0),
-	CLK_PCOM("mi2s_s_clk",		MI2S_S_CLK,  		NULL, 0),
-	CLK_PCOM("mi2s_codec_rx_m_clk",	MI2S_CODEC_RX_M_CLK,  NULL, 0),
-	CLK_PCOM("mi2s_codec_rx_s_clk",	MI2S_CODEC_RX_S_CLK,  NULL, 0),
-	CLK_PCOM("mi2s_codec_tx_m_clk",	MI2S_CODEC_TX_M_CLK,  NULL, 0),
-	CLK_PCOM("mi2s_codec_tx_s_clk",	MI2S_CODEC_TX_S_CLK,  NULL, 0),
-	CLK_PCOM("pbus_clk",	PBUS_CLK,	NULL, CLK_MIN),
-	CLK_PCOM("pcm_clk",	PCM_CLK,	NULL, 0),
-	CLK_PCOM("rotator_clk",	AXI_ROTATOR_CLK,		NULL, 0),
-	CLK_PCOM("rotator_imem_clk",	ROTATOR_IMEM_CLK,	NULL, OFF),
-	CLK_PCOM("rotator_pclk",	ROTATOR_P_CLK,		NULL, OFF),
-	CLK_PCOM("sdac_clk",	SDAC_CLK,	NULL, OFF),
-	CLK_PCOM("spi_clk",	SPI_CLK,	NULL, 0),
-	CLK_PCOM("spi_pclk",	SPI_P_CLK,	NULL, 0),
-	CLK_PCOM("tv_dac_clk",	TV_DAC_CLK,	NULL, 0),
-	CLK_PCOM("tv_enc_clk",	TV_ENC_CLK,	NULL, 0),
-	CLK_PCOM("core",	UART2_CLK,	"msm_serial.1", 0),
-	CLK_PCOM("usb_phy_clk",	USB_PHY_CLK,	NULL, 0),
-	CLK_PCOM("usb_hs_clk",		USB_HS_CLK,		NULL, OFF),
-	CLK_PCOM("usb_hs_pclk",		USB_HS_P_CLK,		NULL, OFF),
-	CLK_PCOM("usb_hs_core_clk",	USB_HS_CORE_CLK,	NULL, OFF),
-	CLK_PCOM("usb_hs2_clk",		USB_HS2_CLK,		NULL, OFF),
-	CLK_PCOM("usb_hs2_pclk",	USB_HS2_P_CLK,		NULL, OFF),
-	CLK_PCOM("usb_hs2_core_clk",	USB_HS2_CORE_CLK,	NULL, OFF),
-	CLK_PCOM("usb_hs3_clk",		USB_HS3_CLK,		NULL, OFF),
-	CLK_PCOM("usb_hs3_pclk",	USB_HS3_P_CLK,		NULL, OFF),
-	CLK_PCOM("usb_hs3_core_clk",	USB_HS3_CORE_CLK,	NULL, OFF),
-	CLK_PCOM("vdc_clk",	VDC_CLK,	NULL, OFF | CLK_MIN),
-	CLK_PCOM("vfe_camif_clk",	VFE_CAMIF_CLK, 	NULL, 0),
-	CLK_PCOM("vfe_clk",	VFE_CLK,	NULL, 0),
-	CLK_PCOM("vfe_mdc_clk",	VFE_MDC_CLK,	NULL, 0),
-	CLK_PCOM("vfe_pclk",	VFE_P_CLK,	NULL, OFF),
-	CLK_PCOM("vpe_clk",	VPE_CLK,	NULL, 0),
-
-	/* 7x30 v2 hardware only. */
-	CLK_PCOM("csi_clk",	CSI0_CLK,	NULL, 0),
-	CLK_PCOM("csi_pclk",	CSI0_P_CLK,	NULL, 0),
-	CLK_PCOM("csi_vfe_clk",	CSI0_VFE_CLK,	NULL, 0),
-};
-
-static struct pcom_clk_pdata msm_clock_7x30_pdata = {
-	.lookup = msm_clocks_7x30,
-	.num_lookups = ARRAY_SIZE(msm_clocks_7x30),
-};
-
-struct platform_device msm_clock_7x30 = {
-	.name = "msm-clock-pcom",
-	.dev.platform_data = &msm_clock_7x30_pdata,
-};
diff --git a/arch/arm/mach-msm/devices-qsd8x50.c b/arch/arm/mach-msm/devices-qsd8x50.c
deleted file mode 100644
index 9e1e9ce07b1a..000000000000
--- a/arch/arm/mach-msm/devices-qsd8x50.c
+++ /dev/null
@@ -1,388 +0,0 @@
-/*
- * Copyright (C) 2008 Google, Inc.
- * Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved.
- *
- * 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/kernel.h>
-#include <linux/platform_device.h>
-#include <linux/clkdev.h>
-#include <linux/dma-mapping.h>
-
-#include <mach/irqs.h>
-#include <mach/msm_iomap.h>
-#include <mach/dma.h>
-
-#include "devices.h"
-#include "common.h"
-
-#include <asm/mach/flash.h>
-
-#include <linux/platform_data/mmc-msm_sdcc.h>
-#include "clock.h"
-#include "clock-pcom.h"
-
-static struct resource msm_gpio_resources[] = {
-	{
-		.start	= 64 + 165 + 9,
-		.end	= 64 + 165 + 9,
-		.flags	= IORESOURCE_IRQ,
-	},
-	{
-		.start	= 64 + 165 + 10,
-		.end	= 64 + 165 + 10,
-		.flags	= IORESOURCE_IRQ,
-	},
-	{
-		.start	= 0xa9000800,
-		.end	= 0xa9000800 + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-		.name  = "gpio1"
-	},
-	{
-		.start	= 0xa9100C00,
-		.end	= 0xa9100C00 + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-		.name  = "gpio2"
-	},
-};
-
-struct platform_device msm_device_gpio_8x50 = {
-	.name	= "gpio-msm-8x50",
-	.num_resources	= ARRAY_SIZE(msm_gpio_resources),
-	.resource	= msm_gpio_resources,
-};
-
-static struct resource resources_uart3[] = {
-	{
-		.start	= INT_UART3,
-		.end	= INT_UART3,
-		.flags	= IORESOURCE_IRQ,
-	},
-	{
-		.start	= MSM_UART3_PHYS,
-		.end	= MSM_UART3_PHYS + MSM_UART3_SIZE - 1,
-		.flags	= IORESOURCE_MEM,
-		.name  = "uart_resource"
-	},
-};
-
-struct platform_device msm_device_uart3 = {
-	.name	= "msm_serial",
-	.id	= 2,
-	.num_resources	= ARRAY_SIZE(resources_uart3),
-	.resource	= resources_uart3,
-};
-
-struct platform_device msm_device_smd = {
-	.name   = "msm_smd",
-	.id     = -1,
-};
-
-static struct resource resources_otg[] = {
-	{
-		.start	= MSM_HSUSB_PHYS,
-		.end	= MSM_HSUSB_PHYS + MSM_HSUSB_SIZE,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_USB_HS,
-		.end	= INT_USB_HS,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-struct platform_device msm_device_otg = {
-	.name		= "msm_otg",
-	.id		= -1,
-	.num_resources	= ARRAY_SIZE(resources_otg),
-	.resource	= resources_otg,
-	.dev		= {
-		.coherent_dma_mask	= 0xffffffff,
-	},
-};
-
-static struct resource resources_hsusb[] = {
-	{
-		.start	= MSM_HSUSB_PHYS,
-		.end	= MSM_HSUSB_PHYS + MSM_HSUSB_SIZE,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_USB_HS,
-		.end	= INT_USB_HS,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-struct platform_device msm_device_hsusb = {
-	.name		= "msm_hsusb",
-	.id		= -1,
-	.num_resources	= ARRAY_SIZE(resources_hsusb),
-	.resource	= resources_hsusb,
-	.dev		= {
-		.coherent_dma_mask	= 0xffffffff,
-	},
-};
-
-static u64 dma_mask = 0xffffffffULL;
-static struct resource resources_hsusb_host[] = {
-	{
-		.start	= MSM_HSUSB_PHYS,
-		.end	= MSM_HSUSB_PHYS + MSM_HSUSB_SIZE,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_USB_HS,
-		.end	= INT_USB_HS,
-		.flags	= IORESOURCE_IRQ,
-	},
-};
-
-struct platform_device msm_device_hsusb_host = {
-	.name		= "msm_hsusb_host",
-	.id		= -1,
-	.num_resources	= ARRAY_SIZE(resources_hsusb_host),
-	.resource	= resources_hsusb_host,
-	.dev		= {
-		.dma_mask               = &dma_mask,
-		.coherent_dma_mask      = 0xffffffffULL,
-	},
-};
-
-static struct resource resources_sdc1[] = {
-	{
-		.start	= MSM_SDC1_PHYS,
-		.end	= MSM_SDC1_PHYS + MSM_SDC1_SIZE - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_SDC1_0,
-		.end	= INT_SDC1_0,
-		.flags	= IORESOURCE_IRQ,
-		.name	= "cmd_irq",
-	},
-	{
-		.flags	= IORESOURCE_IRQ | IORESOURCE_DISABLED,
-		.name	= "status_irq"
-	},
-	{
-		.start	= 8,
-		.end	= 8,
-		.flags	= IORESOURCE_DMA,
-	},
-};
-
-static struct resource resources_sdc2[] = {
-	{
-		.start	= MSM_SDC2_PHYS,
-		.end	= MSM_SDC2_PHYS + MSM_SDC2_SIZE - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_SDC2_0,
-		.end	= INT_SDC2_0,
-		.flags	= IORESOURCE_IRQ,
-		.name	= "cmd_irq",
-	},
-	{
-		.flags	= IORESOURCE_IRQ | IORESOURCE_DISABLED,
-		.name	= "status_irq"
-	},
-	{
-		.start	= 8,
-		.end	= 8,
-		.flags	= IORESOURCE_DMA,
-	},
-};
-
-static struct resource resources_sdc3[] = {
-	{
-		.start	= MSM_SDC3_PHYS,
-		.end	= MSM_SDC3_PHYS + MSM_SDC3_SIZE - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_SDC3_0,
-		.end	= INT_SDC3_0,
-		.flags	= IORESOURCE_IRQ,
-		.name	= "cmd_irq",
-	},
-	{
-		.flags	= IORESOURCE_IRQ | IORESOURCE_DISABLED,
-		.name	= "status_irq"
-	},
-	{
-		.start	= 8,
-		.end	= 8,
-		.flags	= IORESOURCE_DMA,
-	},
-};
-
-static struct resource resources_sdc4[] = {
-	{
-		.start	= MSM_SDC4_PHYS,
-		.end	= MSM_SDC4_PHYS + MSM_SDC4_SIZE - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	{
-		.start	= INT_SDC4_0,
-		.end	= INT_SDC4_0,
-		.flags	= IORESOURCE_IRQ,
-		.name	= "cmd_irq",
-	},
-	{
-		.flags	= IORESOURCE_IRQ | IORESOURCE_DISABLED,
-		.name	= "status_irq"
-	},
-	{
-		.start	= 8,
-		.end	= 8,
-		.flags	= IORESOURCE_DMA,
-	},
-};
-
-struct platform_device msm_device_sdc1 = {
-	.name		= "msm_sdcc",
-	.id		= 1,
-	.num_resources	= ARRAY_SIZE(resources_sdc1),
-	.resource	= resources_sdc1,
-	.dev		= {
-		.coherent_dma_mask	= 0xffffffff,
-	},
-};
-
-struct platform_device msm_device_sdc2 = {
-	.name		= "msm_sdcc",
-	.id		= 2,
-	.num_resources	= ARRAY_SIZE(resources_sdc2),
-	.resource	= resources_sdc2,
-	.dev		= {
-		.coherent_dma_mask	= 0xffffffff,
-	},
-};
-
-struct platform_device msm_device_sdc3 = {
-	.name		= "msm_sdcc",
-	.id		= 3,
-	.num_resources	= ARRAY_SIZE(resources_sdc3),
-	.resource	= resources_sdc3,
-	.dev		= {
-		.coherent_dma_mask	= 0xffffffff,
-	},
-};
-
-struct platform_device msm_device_sdc4 = {
-	.name		= "msm_sdcc",
-	.id		= 4,
-	.num_resources	= ARRAY_SIZE(resources_sdc4),
-	.resource	= resources_sdc4,
-	.dev		= {
-		.coherent_dma_mask	= 0xffffffff,
-	},
-};
-
-static struct platform_device *msm_sdcc_devices[] __initdata = {
-	&msm_device_sdc1,
-	&msm_device_sdc2,
-	&msm_device_sdc3,
-	&msm_device_sdc4,
-};
-
-int __init msm_add_sdcc(unsigned int controller,
-			struct msm_mmc_platform_data *plat,
-			unsigned int stat_irq, unsigned long stat_irq_flags)
-{
-	struct platform_device	*pdev;
-	struct resource *res;
-
-	if (controller < 1 || controller > 4)
-		return -EINVAL;
-
-	pdev = msm_sdcc_devices[controller-1];
-	pdev->dev.platform_data = plat;
-
-	res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "status_irq");
-	if (!res)
-		return -EINVAL;
-	else if (stat_irq) {
-		res->start = res->end = stat_irq;
-		res->flags &= ~IORESOURCE_DISABLED;
-		res->flags |= stat_irq_flags;
-	}
-
-	return platform_device_register(pdev);
-}
-
-static struct clk_pcom_desc msm_clocks_8x50[] = {
-	CLK_PCOM("adm_clk",	ADM_CLK,	NULL, 0),
-	CLK_PCOM("ce_clk",	CE_CLK,		NULL, 0),
-	CLK_PCOM("ebi1_clk",	EBI1_CLK,	NULL, CLK_MIN),
-	CLK_PCOM("ebi2_clk",	EBI2_CLK,	NULL, 0),
-	CLK_PCOM("ecodec_clk",	ECODEC_CLK,	NULL, 0),
-	CLK_PCOM("emdh_clk",	EMDH_CLK,	NULL, OFF | CLK_MINMAX),
-	CLK_PCOM("gp_clk",	GP_CLK,		NULL, 0),
-	CLK_PCOM("grp_clk",	GRP_3D_CLK,	NULL, 0),
-	CLK_PCOM("i2c_clk",	I2C_CLK,	NULL, 0),
-	CLK_PCOM("icodec_rx_clk",	ICODEC_RX_CLK,	NULL, 0),
-	CLK_PCOM("icodec_tx_clk",	ICODEC_TX_CLK,	NULL, 0),
-	CLK_PCOM("imem_clk",	IMEM_CLK,	NULL, OFF),
-	CLK_PCOM("mdc_clk",	MDC_CLK,	NULL, 0),
-	CLK_PCOM("mddi_clk",	PMDH_CLK,	NULL, OFF | CLK_MINMAX),
-	CLK_PCOM("mdp_clk",	MDP_CLK,	NULL, OFF),
-	CLK_PCOM("mdp_lcdc_pclk_clk", MDP_LCDC_PCLK_CLK, NULL, 0),
-	CLK_PCOM("mdp_lcdc_pad_pclk_clk", MDP_LCDC_PAD_PCLK_CLK, NULL, 0),
-	CLK_PCOM("mdp_vsync_clk",	MDP_VSYNC_CLK,	NULL, 0),
-	CLK_PCOM("pbus_clk",	PBUS_CLK,	NULL, CLK_MIN),
-	CLK_PCOM("pcm_clk",	PCM_CLK,	NULL, 0),
-	CLK_PCOM("sdac_clk",	SDAC_CLK,	NULL, OFF),
-	CLK_PCOM("sdc_clk",	SDC1_CLK,	"msm_sdcc.1", OFF),
-	CLK_PCOM("sdc_pclk",	SDC1_P_CLK,	"msm_sdcc.1", OFF),
-	CLK_PCOM("sdc_clk",	SDC2_CLK,	"msm_sdcc.2", OFF),
-	CLK_PCOM("sdc_pclk",	SDC2_P_CLK,	"msm_sdcc.2", OFF),
-	CLK_PCOM("sdc_clk",	SDC3_CLK,	"msm_sdcc.3", OFF),
-	CLK_PCOM("sdc_pclk",	SDC3_P_CLK,	"msm_sdcc.3", OFF),
-	CLK_PCOM("sdc_clk",	SDC4_CLK,	"msm_sdcc.4", OFF),
-	CLK_PCOM("sdc_pclk",	SDC4_P_CLK,	"msm_sdcc.4", OFF),
-	CLK_PCOM("spi_clk",	SPI_CLK,	NULL, 0),
-	CLK_PCOM("tsif_clk",	TSIF_CLK,	NULL, 0),
-	CLK_PCOM("tsif_ref_clk",	TSIF_REF_CLK,	NULL, 0),
-	CLK_PCOM("tv_dac_clk",	TV_DAC_CLK,	NULL, 0),
-	CLK_PCOM("tv_enc_clk",	TV_ENC_CLK,	NULL, 0),
-	CLK_PCOM("core",	UART1_CLK,	NULL, OFF),
-	CLK_PCOM("core",	UART2_CLK,	NULL, 0),
-	CLK_PCOM("core",	UART3_CLK,	"msm_serial.2", OFF),
-	CLK_PCOM("uartdm_clk",	UART1DM_CLK,	NULL, OFF),
-	CLK_PCOM("uartdm_clk",	UART2DM_CLK,	NULL, 0),
-	CLK_PCOM("usb_hs_clk",	USB_HS_CLK,	NULL, OFF),
-	CLK_PCOM("usb_hs_pclk",	USB_HS_P_CLK,	NULL, OFF),
-	CLK_PCOM("usb_otg_clk",	USB_OTG_CLK,	NULL, 0),
-	CLK_PCOM("vdc_clk",	VDC_CLK,	NULL, OFF | CLK_MIN),
-	CLK_PCOM("vfe_clk",	VFE_CLK,	NULL, OFF),
-	CLK_PCOM("vfe_mdc_clk",	VFE_MDC_CLK,	NULL, OFF),
-	CLK_PCOM("vfe_axi_clk",	VFE_AXI_CLK,	NULL, OFF),
-	CLK_PCOM("usb_hs2_clk",	USB_HS2_CLK,	NULL, OFF),
-	CLK_PCOM("usb_hs2_pclk",	USB_HS2_P_CLK,	NULL, OFF),
-	CLK_PCOM("usb_hs3_clk",	USB_HS3_CLK,	NULL, OFF),
-	CLK_PCOM("usb_hs3_pclk",	USB_HS3_P_CLK,	NULL, OFF),
-	CLK_PCOM("usb_phy_clk",	USB_PHY_CLK,	NULL, 0),
-};
-
-static struct pcom_clk_pdata msm_clock_8x50_pdata = {
-	.lookup = msm_clocks_8x50,
-	.num_lookups = ARRAY_SIZE(msm_clocks_8x50),
-};
-
-struct platform_device msm_clock_8x50 = {
-	.name = "msm-clock-pcom",
-	.dev.platform_data = &msm_clock_8x50_pdata,
-};
diff --git a/arch/arm/mach-msm/devices.h b/arch/arm/mach-msm/devices.h
deleted file mode 100644
index dccefad9f9b9..000000000000
--- a/arch/arm/mach-msm/devices.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* linux/arch/arm/mach-msm/devices.h
- *
- * Copyright (C) 2008 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.
- *
- */
-
-#ifndef __ARCH_ARM_MACH_MSM_DEVICES_H
-#define __ARCH_ARM_MACH_MSM_DEVICES_H
-
-extern struct platform_device msm_device_gpio_7201;
-extern struct platform_device msm_device_gpio_7x30;
-extern struct platform_device msm_device_gpio_8x50;
-
-extern struct platform_device msm_device_uart1;
-extern struct platform_device msm_device_uart2;
-extern struct platform_device msm_device_uart3;
-
-extern struct platform_device msm8960_device_uart_gsbi2;
-extern struct platform_device msm8960_device_uart_gsbi5;
-
-extern struct platform_device msm_device_sdc1;
-extern struct platform_device msm_device_sdc2;
-extern struct platform_device msm_device_sdc3;
-extern struct platform_device msm_device_sdc4;
-
-extern struct platform_device msm_device_hsusb;
-extern struct platform_device msm_device_otg;
-extern struct platform_device msm_device_hsusb_host;
-
-extern struct platform_device msm_device_i2c;
-
-extern struct platform_device msm_device_smd;
-
-extern struct platform_device msm_device_nand;
-
-extern struct platform_device msm_device_mddi0;
-extern struct platform_device msm_device_mddi1;
-extern struct platform_device msm_device_mdp;
-
-extern struct platform_device msm_clock_7x01a;
-extern struct platform_device msm_clock_7x30;
-extern struct platform_device msm_clock_8x50;
-
-#endif
diff --git a/arch/arm/mach-msm/dma.c b/arch/arm/mach-msm/dma.c
deleted file mode 100644
index fb9762464718..000000000000
--- a/arch/arm/mach-msm/dma.c
+++ /dev/null
@@ -1,298 +0,0 @@
-/* linux/arch/arm/mach-msm/dma.c
- *
- * Copyright (C) 2007 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/clk.h>
-#include <linux/err.h>
-#include <linux/io.h>
-#include <linux/interrupt.h>
-#include <linux/completion.h>
-#include <linux/module.h>
-#include <mach/dma.h>
-#include <mach/msm_iomap.h>
-
-#define MSM_DMOV_CHANNEL_COUNT 16
-
-#define DMOV_SD0(off, ch) (MSM_DMOV_BASE + 0x0000 + (off) + ((ch) << 2))
-#define DMOV_SD1(off, ch) (MSM_DMOV_BASE + 0x0400 + (off) + ((ch) << 2))
-#define DMOV_SD2(off, ch) (MSM_DMOV_BASE + 0x0800 + (off) + ((ch) << 2))
-#define DMOV_SD3(off, ch) (MSM_DMOV_BASE + 0x0C00 + (off) + ((ch) << 2))
-
-#if defined(CONFIG_ARCH_MSM7X30)
-#define DMOV_SD_AARM DMOV_SD2
-#else
-#define DMOV_SD_AARM DMOV_SD3
-#endif
-
-#define DMOV_CMD_PTR(ch)      DMOV_SD_AARM(0x000, ch)
-#define DMOV_RSLT(ch)         DMOV_SD_AARM(0x040, ch)
-#define DMOV_FLUSH0(ch)       DMOV_SD_AARM(0x080, ch)
-#define DMOV_FLUSH1(ch)       DMOV_SD_AARM(0x0C0, ch)
-#define DMOV_FLUSH2(ch)       DMOV_SD_AARM(0x100, ch)
-#define DMOV_FLUSH3(ch)       DMOV_SD_AARM(0x140, ch)
-#define DMOV_FLUSH4(ch)       DMOV_SD_AARM(0x180, ch)
-#define DMOV_FLUSH5(ch)       DMOV_SD_AARM(0x1C0, ch)
-
-#define DMOV_STATUS(ch)       DMOV_SD_AARM(0x200, ch)
-#define DMOV_ISR              DMOV_SD_AARM(0x380, 0)
-
-#define DMOV_CONFIG(ch)       DMOV_SD_AARM(0x300, ch)
-
-enum {
-	MSM_DMOV_PRINT_ERRORS = 1,
-	MSM_DMOV_PRINT_IO = 2,
-	MSM_DMOV_PRINT_FLOW = 4
-};
-
-static DEFINE_SPINLOCK(msm_dmov_lock);
-static struct clk *msm_dmov_clk;
-static unsigned int channel_active;
-static struct list_head ready_commands[MSM_DMOV_CHANNEL_COUNT];
-static struct list_head active_commands[MSM_DMOV_CHANNEL_COUNT];
-unsigned int msm_dmov_print_mask = MSM_DMOV_PRINT_ERRORS;
-
-#define MSM_DMOV_DPRINTF(mask, format, args...) \
-	do { \
-		if ((mask) & msm_dmov_print_mask) \
-			printk(KERN_ERR format, args); \
-	} while (0)
-#define PRINT_ERROR(format, args...) \
-	MSM_DMOV_DPRINTF(MSM_DMOV_PRINT_ERRORS, format, args);
-#define PRINT_IO(format, args...) \
-	MSM_DMOV_DPRINTF(MSM_DMOV_PRINT_IO, format, args);
-#define PRINT_FLOW(format, args...) \
-	MSM_DMOV_DPRINTF(MSM_DMOV_PRINT_FLOW, format, args);
-
-void msm_dmov_stop_cmd(unsigned id, struct msm_dmov_cmd *cmd, int graceful)
-{
-	writel((graceful << 31), DMOV_FLUSH0(id));
-}
-EXPORT_SYMBOL_GPL(msm_dmov_stop_cmd);
-
-void msm_dmov_enqueue_cmd(unsigned id, struct msm_dmov_cmd *cmd)
-{
-	unsigned long irq_flags;
-	unsigned int status;
-
-	spin_lock_irqsave(&msm_dmov_lock, irq_flags);
-	if (!channel_active)
-		clk_enable(msm_dmov_clk);
-	dsb();
-	status = readl(DMOV_STATUS(id));
-	if (list_empty(&ready_commands[id]) &&
-		(status & DMOV_STATUS_CMD_PTR_RDY)) {
-#if 0
-		if (list_empty(&active_commands[id])) {
-			PRINT_FLOW("msm_dmov_enqueue_cmd(%d), enable interrupt\n", id);
-			writel(DMOV_CONFIG_IRQ_EN, DMOV_CONFIG(id));
-		}
-#endif
-		if (cmd->execute_func)
-			cmd->execute_func(cmd);
-		PRINT_IO("msm_dmov_enqueue_cmd(%d), start command, status %x\n", id, status);
-		list_add_tail(&cmd->list, &active_commands[id]);
-		if (!channel_active)
-			enable_irq(INT_ADM_AARM);
-		channel_active |= 1U << id;
-		writel(cmd->cmdptr, DMOV_CMD_PTR(id));
-	} else {
-		if (!channel_active)
-			clk_disable(msm_dmov_clk);
-		if (list_empty(&active_commands[id]))
-			PRINT_ERROR("msm_dmov_enqueue_cmd(%d), error datamover stalled, status %x\n", id, status);
-
-		PRINT_IO("msm_dmov_enqueue_cmd(%d), enqueue command, status %x\n", id, status);
-		list_add_tail(&cmd->list, &ready_commands[id]);
-	}
-	spin_unlock_irqrestore(&msm_dmov_lock, irq_flags);
-}
-EXPORT_SYMBOL_GPL(msm_dmov_enqueue_cmd);
-
-struct msm_dmov_exec_cmdptr_cmd {
-	struct msm_dmov_cmd dmov_cmd;
-	struct completion complete;
-	unsigned id;
-	unsigned int result;
-	struct msm_dmov_errdata err;
-};
-
-static void
-dmov_exec_cmdptr_complete_func(struct msm_dmov_cmd *_cmd,
-			       unsigned int result,
-			       struct msm_dmov_errdata *err)
-{
-	struct msm_dmov_exec_cmdptr_cmd *cmd = container_of(_cmd, struct msm_dmov_exec_cmdptr_cmd, dmov_cmd);
-	cmd->result = result;
-	if (result != 0x80000002 && err)
-		memcpy(&cmd->err, err, sizeof(struct msm_dmov_errdata));
-
-	complete(&cmd->complete);
-}
-
-int msm_dmov_exec_cmd(unsigned id, unsigned int cmdptr)
-{
-	struct msm_dmov_exec_cmdptr_cmd cmd;
-
-	PRINT_FLOW("dmov_exec_cmdptr(%d, %x)\n", id, cmdptr);
-
-	cmd.dmov_cmd.cmdptr = cmdptr;
-	cmd.dmov_cmd.complete_func = dmov_exec_cmdptr_complete_func;
-	cmd.dmov_cmd.execute_func = NULL;
-	cmd.id = id;
-	init_completion(&cmd.complete);
-
-	msm_dmov_enqueue_cmd(id, &cmd.dmov_cmd);
-	wait_for_completion(&cmd.complete);
-
-	if (cmd.result != 0x80000002) {
-		PRINT_ERROR("dmov_exec_cmdptr(%d): ERROR, result: %x\n", id, cmd.result);
-		PRINT_ERROR("dmov_exec_cmdptr(%d):  flush: %x %x %x %x\n",
-			id, cmd.err.flush[0], cmd.err.flush[1], cmd.err.flush[2], cmd.err.flush[3]);
-		return -EIO;
-	}
-	PRINT_FLOW("dmov_exec_cmdptr(%d, %x) done\n", id, cmdptr);
-	return 0;
-}
-
-
-static irqreturn_t msm_datamover_irq_handler(int irq, void *dev_id)
-{
-	unsigned int int_status, mask, id;
-	unsigned long irq_flags;
-	unsigned int ch_status;
-	unsigned int ch_result;
-	struct msm_dmov_cmd *cmd;
-
-	spin_lock_irqsave(&msm_dmov_lock, irq_flags);
-
-	int_status = readl(DMOV_ISR); /* read and clear interrupt */
-	PRINT_FLOW("msm_datamover_irq_handler: DMOV_ISR %x\n", int_status);
-
-	while (int_status) {
-		mask = int_status & -int_status;
-		id = fls(mask) - 1;
-		PRINT_FLOW("msm_datamover_irq_handler %08x %08x id %d\n", int_status, mask, id);
-		int_status &= ~mask;
-		ch_status = readl(DMOV_STATUS(id));
-		if (!(ch_status & DMOV_STATUS_RSLT_VALID)) {
-			PRINT_FLOW("msm_datamover_irq_handler id %d, result not valid %x\n", id, ch_status);
-			continue;
-		}
-		do {
-			ch_result = readl(DMOV_RSLT(id));
-			if (list_empty(&active_commands[id])) {
-				PRINT_ERROR("msm_datamover_irq_handler id %d, got result "
-					"with no active command, status %x, result %x\n",
-					id, ch_status, ch_result);
-				cmd = NULL;
-			} else
-				cmd = list_entry(active_commands[id].next, typeof(*cmd), list);
-			PRINT_FLOW("msm_datamover_irq_handler id %d, status %x, result %x\n", id, ch_status, ch_result);
-			if (ch_result & DMOV_RSLT_DONE) {
-				PRINT_FLOW("msm_datamover_irq_handler id %d, status %x\n",
-					id, ch_status);
-				PRINT_IO("msm_datamover_irq_handler id %d, got result "
-					"for %p, result %x\n", id, cmd, ch_result);
-				if (cmd) {
-					list_del(&cmd->list);
-					dsb();
-					cmd->complete_func(cmd, ch_result, NULL);
-				}
-			}
-			if (ch_result & DMOV_RSLT_FLUSH) {
-				struct msm_dmov_errdata errdata;
-
-				errdata.flush[0] = readl(DMOV_FLUSH0(id));
-				errdata.flush[1] = readl(DMOV_FLUSH1(id));
-				errdata.flush[2] = readl(DMOV_FLUSH2(id));
-				errdata.flush[3] = readl(DMOV_FLUSH3(id));
-				errdata.flush[4] = readl(DMOV_FLUSH4(id));
-				errdata.flush[5] = readl(DMOV_FLUSH5(id));
-				PRINT_FLOW("msm_datamover_irq_handler id %d, status %x\n", id, ch_status);
-				PRINT_FLOW("msm_datamover_irq_handler id %d, flush, result %x, flush0 %x\n", id, ch_result, errdata.flush[0]);
-				if (cmd) {
-					list_del(&cmd->list);
-					dsb();
-					cmd->complete_func(cmd, ch_result, &errdata);
-				}
-			}
-			if (ch_result & DMOV_RSLT_ERROR) {
-				struct msm_dmov_errdata errdata;
-
-				errdata.flush[0] = readl(DMOV_FLUSH0(id));
-				errdata.flush[1] = readl(DMOV_FLUSH1(id));
-				errdata.flush[2] = readl(DMOV_FLUSH2(id));
-				errdata.flush[3] = readl(DMOV_FLUSH3(id));
-				errdata.flush[4] = readl(DMOV_FLUSH4(id));
-				errdata.flush[5] = readl(DMOV_FLUSH5(id));
-
-				PRINT_ERROR("msm_datamover_irq_handler id %d, status %x\n", id, ch_status);
-				PRINT_ERROR("msm_datamover_irq_handler id %d, error, result %x, flush0 %x\n", id, ch_result, errdata.flush[0]);
-				if (cmd) {
-					list_del(&cmd->list);
-					dsb();
-					cmd->complete_func(cmd, ch_result, &errdata);
-				}
-				/* this does not seem to work, once we get an error */
-				/* the datamover will no longer accept commands */
-				writel(0, DMOV_FLUSH0(id));
-			}
-			ch_status = readl(DMOV_STATUS(id));
-			PRINT_FLOW("msm_datamover_irq_handler id %d, status %x\n", id, ch_status);
-			if ((ch_status & DMOV_STATUS_CMD_PTR_RDY) && !list_empty(&ready_commands[id])) {
-				cmd = list_entry(ready_commands[id].next, typeof(*cmd), list);
-				list_move_tail(&cmd->list, &active_commands[id]);
-				if (cmd->execute_func)
-					cmd->execute_func(cmd);
-				PRINT_FLOW("msm_datamover_irq_handler id %d, start command\n", id);
-				writel(cmd->cmdptr, DMOV_CMD_PTR(id));
-			}
-		} while (ch_status & DMOV_STATUS_RSLT_VALID);
-		if (list_empty(&active_commands[id]) && list_empty(&ready_commands[id]))
-			channel_active &= ~(1U << id);
-		PRINT_FLOW("msm_datamover_irq_handler id %d, status %x\n", id, ch_status);
-	}
-
-	if (!channel_active) {
-		disable_irq_nosync(INT_ADM_AARM);
-		clk_disable(msm_dmov_clk);
-	}
-
-	spin_unlock_irqrestore(&msm_dmov_lock, irq_flags);
-	return IRQ_HANDLED;
-}
-
-static int __init msm_init_datamover(void)
-{
-	int i;
-	int ret;
-	struct clk *clk;
-
-	for (i = 0; i < MSM_DMOV_CHANNEL_COUNT; i++) {
-		INIT_LIST_HEAD(&ready_commands[i]);
-		INIT_LIST_HEAD(&active_commands[i]);
-		writel(DMOV_CONFIG_IRQ_EN | DMOV_CONFIG_FORCE_TOP_PTR_RSLT | DMOV_CONFIG_FORCE_FLUSH_RSLT, DMOV_CONFIG(i));
-	}
-	clk = clk_get(NULL, "adm_clk");
-	if (IS_ERR(clk))
-		return PTR_ERR(clk);
-	clk_prepare(clk);
-	msm_dmov_clk = clk;
-	ret = request_irq(INT_ADM_AARM, msm_datamover_irq_handler, 0, "msmdatamover", NULL);
-	if (ret)
-		return ret;
-	disable_irq(INT_ADM_AARM);
-	return 0;
-}
-module_init(msm_init_datamover);
diff --git a/arch/arm/mach-msm/gpiomux-8x50.c b/arch/arm/mach-msm/gpiomux-8x50.c
deleted file mode 100644
index f7a4ea593c95..000000000000
--- a/arch/arm/mach-msm/gpiomux-8x50.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-#include "gpiomux.h"
-
-#if defined(CONFIG_MMC_MSM) || defined(CONFIG_MMC_MSM_MODULE)
-	#define SDCC_DAT_0_3_CMD_ACTV_CFG (GPIOMUX_VALID | GPIOMUX_PULL_UP\
-					| GPIOMUX_FUNC_1 | GPIOMUX_DRV_8MA)
-	#define SDCC_CLK_ACTV_CFG (GPIOMUX_VALID | GPIOMUX_PULL_NONE\
-					| GPIOMUX_FUNC_1 | GPIOMUX_DRV_8MA)
-#else
-	#define SDCC_DAT_0_3_CMD_ACTV_CFG 0
-	#define SDCC_CLK_ACTV_CFG 0
-#endif
-
-#define SDC1_SUSPEND_CONFIG (GPIOMUX_VALID | GPIOMUX_PULL_DOWN\
-				| GPIOMUX_FUNC_GPIO | GPIOMUX_DRV_2MA)
-
-struct msm_gpiomux_config msm_gpiomux_configs[GPIOMUX_NGPIOS] = {
-	[86] = { /* UART3 RX */
-		.suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN |
-			     GPIOMUX_FUNC_1 | GPIOMUX_VALID,
-	},
-	[87] = { /* UART3 TX */
-		.suspended = GPIOMUX_DRV_2MA | GPIOMUX_PULL_DOWN |
-			     GPIOMUX_FUNC_1 | GPIOMUX_VALID,
-	},
-	/* SDC1 data[3:0] & CMD */
-	[51 ... 55] = {
-		.active = SDCC_DAT_0_3_CMD_ACTV_CFG,
-		.suspended = SDC1_SUSPEND_CONFIG
-	},
-	/* SDC1 CLK */
-	[56] = {
-		.active = SDCC_CLK_ACTV_CFG,
-		.suspended = SDC1_SUSPEND_CONFIG
-	},
-};
diff --git a/arch/arm/mach-msm/gpiomux-v1.h b/arch/arm/mach-msm/gpiomux-v1.h
deleted file mode 100644
index 71d86feba450..000000000000
--- a/arch/arm/mach-msm/gpiomux-v1.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-#ifndef __ARCH_ARM_MACH_MSM_GPIOMUX_V1_H
-#define __ARCH_ARM_MACH_MSM_GPIOMUX_V1_H
-
-#if defined(CONFIG_ARCH_MSM7X30)
-#define GPIOMUX_NGPIOS 182
-#elif defined(CONFIG_ARCH_QSD8X50)
-#define GPIOMUX_NGPIOS 165
-#else
-#define GPIOMUX_NGPIOS 133
-#endif
-
-typedef u32 gpiomux_config_t;
-
-enum {
-	GPIOMUX_DRV_2MA  = 0UL << 17,
-	GPIOMUX_DRV_4MA  = 1UL << 17,
-	GPIOMUX_DRV_6MA  = 2UL << 17,
-	GPIOMUX_DRV_8MA  = 3UL << 17,
-	GPIOMUX_DRV_10MA = 4UL << 17,
-	GPIOMUX_DRV_12MA = 5UL << 17,
-	GPIOMUX_DRV_14MA = 6UL << 17,
-	GPIOMUX_DRV_16MA = 7UL << 17,
-};
-
-enum {
-	GPIOMUX_FUNC_GPIO = 0UL,
-	GPIOMUX_FUNC_1    = 1UL,
-	GPIOMUX_FUNC_2    = 2UL,
-	GPIOMUX_FUNC_3    = 3UL,
-	GPIOMUX_FUNC_4    = 4UL,
-	GPIOMUX_FUNC_5    = 5UL,
-	GPIOMUX_FUNC_6    = 6UL,
-	GPIOMUX_FUNC_7    = 7UL,
-	GPIOMUX_FUNC_8    = 8UL,
-	GPIOMUX_FUNC_9    = 9UL,
-	GPIOMUX_FUNC_A    = 10UL,
-	GPIOMUX_FUNC_B    = 11UL,
-	GPIOMUX_FUNC_C    = 12UL,
-	GPIOMUX_FUNC_D    = 13UL,
-	GPIOMUX_FUNC_E    = 14UL,
-	GPIOMUX_FUNC_F    = 15UL,
-};
-
-enum {
-	GPIOMUX_PULL_NONE   = 0UL << 15,
-	GPIOMUX_PULL_DOWN   = 1UL << 15,
-	GPIOMUX_PULL_KEEPER = 2UL << 15,
-	GPIOMUX_PULL_UP     = 3UL << 15,
-};
-
-#endif
diff --git a/arch/arm/mach-msm/gpiomux.c b/arch/arm/mach-msm/gpiomux.c
deleted file mode 100644
index 2b8e2d217082..000000000000
--- a/arch/arm/mach-msm/gpiomux.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-#include <linux/module.h>
-#include <linux/spinlock.h>
-#include "gpiomux.h"
-#include "proc_comm.h"
-
-static DEFINE_SPINLOCK(gpiomux_lock);
-
-static void __msm_gpiomux_write(unsigned gpio, gpiomux_config_t val)
-{
-	unsigned tlmm_config  = (val & ~GPIOMUX_CTL_MASK) |
-				((gpio & 0x3ff) << 4);
-	unsigned tlmm_disable = 0;
-	int rc;
-
-	rc = msm_proc_comm(PCOM_RPC_GPIO_TLMM_CONFIG_EX,
-			   &tlmm_config, &tlmm_disable);
-	if (rc)
-		pr_err("%s: unexpected proc_comm failure %d: %08x %08x\n",
-		       __func__, rc, tlmm_config, tlmm_disable);
-}
-
-int msm_gpiomux_write(unsigned gpio,
-		      gpiomux_config_t active,
-		      gpiomux_config_t suspended)
-{
-	struct msm_gpiomux_config *cfg = msm_gpiomux_configs + gpio;
-	unsigned long irq_flags;
-	gpiomux_config_t setting;
-
-	if (gpio >= GPIOMUX_NGPIOS)
-		return -EINVAL;
-
-	spin_lock_irqsave(&gpiomux_lock, irq_flags);
-
-	if (active & GPIOMUX_VALID)
-		cfg->active = active;
-
-	if (suspended & GPIOMUX_VALID)
-		cfg->suspended = suspended;
-
-	setting = cfg->ref ? active : suspended;
-	if (setting & GPIOMUX_VALID)
-		__msm_gpiomux_write(gpio, setting);
-
-	spin_unlock_irqrestore(&gpiomux_lock, irq_flags);
-	return 0;
-}
-EXPORT_SYMBOL(msm_gpiomux_write);
-
-int msm_gpiomux_get(unsigned gpio)
-{
-	struct msm_gpiomux_config *cfg = msm_gpiomux_configs + gpio;
-	unsigned long irq_flags;
-
-	if (gpio >= GPIOMUX_NGPIOS)
-		return -EINVAL;
-
-	spin_lock_irqsave(&gpiomux_lock, irq_flags);
-	if (cfg->ref++ == 0 && cfg->active & GPIOMUX_VALID)
-		__msm_gpiomux_write(gpio, cfg->active);
-	spin_unlock_irqrestore(&gpiomux_lock, irq_flags);
-	return 0;
-}
-EXPORT_SYMBOL(msm_gpiomux_get);
-
-int msm_gpiomux_put(unsigned gpio)
-{
-	struct msm_gpiomux_config *cfg = msm_gpiomux_configs + gpio;
-	unsigned long irq_flags;
-
-	if (gpio >= GPIOMUX_NGPIOS)
-		return -EINVAL;
-
-	spin_lock_irqsave(&gpiomux_lock, irq_flags);
-	BUG_ON(cfg->ref == 0);
-	if (--cfg->ref == 0 && cfg->suspended & GPIOMUX_VALID)
-		__msm_gpiomux_write(gpio, cfg->suspended);
-	spin_unlock_irqrestore(&gpiomux_lock, irq_flags);
-	return 0;
-}
-EXPORT_SYMBOL(msm_gpiomux_put);
-
-static int __init gpiomux_init(void)
-{
-	unsigned n;
-
-	for (n = 0; n < GPIOMUX_NGPIOS; ++n) {
-		msm_gpiomux_configs[n].ref = 0;
-		if (!(msm_gpiomux_configs[n].suspended & GPIOMUX_VALID))
-			continue;
-		__msm_gpiomux_write(n, msm_gpiomux_configs[n].suspended);
-	}
-	return 0;
-}
-postcore_initcall(gpiomux_init);
diff --git a/arch/arm/mach-msm/gpiomux.h b/arch/arm/mach-msm/gpiomux.h
deleted file mode 100644
index 4410d7766f93..000000000000
--- a/arch/arm/mach-msm/gpiomux.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-#ifndef __ARCH_ARM_MACH_MSM_GPIOMUX_H
-#define __ARCH_ARM_MACH_MSM_GPIOMUX_H
-
-#include <linux/bitops.h>
-#include <linux/errno.h>
-#include <mach/msm_gpiomux.h>
-#include "gpiomux-v1.h"
-
-/**
- * struct msm_gpiomux_config: gpiomux settings for one gpio line.
- *
- * A complete gpiomux config is the bitwise-or of a drive-strength,
- * function, and pull.  For functions other than GPIO, the OE
- * is hard-wired according to the function.  For GPIO mode,
- * OE is controlled by gpiolib.
- *
- * Available settings differ by target; see the gpiomux header
- * specific to your target arch for available configurations.
- *
- * @active: The configuration to be installed when the line is
- * active, or its reference count is > 0.
- * @suspended: The configuration to be installed when the line
- * is suspended, or its reference count is 0.
- * @ref: The reference count of the line.  For internal use of
- * the gpiomux framework only.
- */
-struct msm_gpiomux_config {
-	gpiomux_config_t active;
-	gpiomux_config_t suspended;
-	unsigned         ref;
-};
-
-/**
- * @GPIOMUX_VALID:	If set, the config field contains 'good data'.
- *                      The absence of this bit will prevent the gpiomux
- *			system from applying the configuration under all
- *			circumstances.
- */
-enum {
-	GPIOMUX_VALID	 = BIT(sizeof(gpiomux_config_t) * BITS_PER_BYTE - 1),
-	GPIOMUX_CTL_MASK = GPIOMUX_VALID,
-};
-
-#ifdef CONFIG_MSM_GPIOMUX
-
-/* Each architecture must provide its own instance of this table.
- * To avoid having gpiomux manage any given gpio, one or both of
- * the entries can avoid setting GPIOMUX_VALID - the absence
- * of that flag will prevent the configuration from being applied
- * during state transitions.
- */
-extern struct msm_gpiomux_config msm_gpiomux_configs[GPIOMUX_NGPIOS];
-
-/* Install a new configuration to the gpio line.  To avoid overwriting
- * a configuration, leave the VALID bit out.
- */
-int msm_gpiomux_write(unsigned gpio,
-		      gpiomux_config_t active,
-		      gpiomux_config_t suspended);
-#else
-static inline int msm_gpiomux_write(unsigned gpio,
-				    gpiomux_config_t active,
-				    gpiomux_config_t suspended)
-{
-	return -ENOSYS;
-}
-#endif
-#endif
diff --git a/arch/arm/mach-msm/include/mach/clk.h b/arch/arm/mach-msm/include/mach/clk.h
deleted file mode 100644
index fd4f4a7a83b3..000000000000
--- a/arch/arm/mach-msm/include/mach/clk.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Copyright (c) 2009, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-#ifndef __MACH_CLK_H
-#define __MACH_CLK_H
-
-/* Magic rate value for use with PM QOS to request the board's maximum
- * supported AXI rate. PM QOS will only pass positive s32 rate values
- * through to the clock driver, so INT_MAX is used.
- */
-#define MSM_AXI_MAX_FREQ	LONG_MAX
-
-enum clk_reset_action {
-	CLK_RESET_DEASSERT	= 0,
-	CLK_RESET_ASSERT	= 1
-};
-
-struct clk;
-
-/* Assert/Deassert reset to a hardware block associated with a clock */
-int clk_reset(struct clk *clk, enum clk_reset_action action);
-
-#endif
diff --git a/arch/arm/mach-msm/include/mach/dma.h b/arch/arm/mach-msm/include/mach/dma.h
deleted file mode 100644
index a72d48d42342..000000000000
--- a/arch/arm/mach-msm/include/mach/dma.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/* linux/include/asm-arm/arch-msm/dma.h
- *
- * Copyright (C) 2007 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.
- *
- */
-
-#ifndef __ASM_ARCH_MSM_DMA_H
-
-#include <linux/list.h>
-
-struct msm_dmov_errdata {
-	uint32_t flush[6];
-};
-
-struct msm_dmov_cmd {
-	struct list_head list;
-	unsigned int cmdptr;
-	void (*complete_func)(struct msm_dmov_cmd *cmd,
-			      unsigned int result,
-			      struct msm_dmov_errdata *err);
-	void (*execute_func)(struct msm_dmov_cmd *cmd);
-	void *data;
-};
-
-#ifndef CONFIG_ARCH_MSM8X60
-void msm_dmov_enqueue_cmd(unsigned id, struct msm_dmov_cmd *cmd);
-void msm_dmov_stop_cmd(unsigned id, struct msm_dmov_cmd *cmd, int graceful);
-int msm_dmov_exec_cmd(unsigned id, unsigned int cmdptr);
-#else
-static inline
-void msm_dmov_enqueue_cmd(unsigned id, struct msm_dmov_cmd *cmd) { }
-static inline
-void msm_dmov_stop_cmd(unsigned id, struct msm_dmov_cmd *cmd, int graceful) { }
-static inline
-int msm_dmov_exec_cmd(unsigned id, unsigned int cmdptr) { return -EIO; }
-#endif
-
-#define DMOV_CMD_LIST         (0 << 29) /* does not work */
-#define DMOV_CMD_PTR_LIST     (1 << 29) /* works */
-#define DMOV_CMD_INPUT_CFG    (2 << 29) /* untested */
-#define DMOV_CMD_OUTPUT_CFG   (3 << 29) /* untested */
-#define DMOV_CMD_ADDR(addr)   ((addr) >> 3)
-
-#define DMOV_RSLT_VALID       (1 << 31) /* 0 == host has empties result fifo */
-#define DMOV_RSLT_ERROR       (1 << 3)
-#define DMOV_RSLT_FLUSH       (1 << 2)
-#define DMOV_RSLT_DONE        (1 << 1)  /* top pointer done */
-#define DMOV_RSLT_USER        (1 << 0)  /* command with FR force result */
-
-#define DMOV_STATUS_RSLT_COUNT(n)    (((n) >> 29))
-#define DMOV_STATUS_CMD_COUNT(n)     (((n) >> 27) & 3)
-#define DMOV_STATUS_RSLT_VALID       (1 << 1)
-#define DMOV_STATUS_CMD_PTR_RDY      (1 << 0)
-
-#define DMOV_CONFIG_FORCE_TOP_PTR_RSLT (1 << 2)
-#define DMOV_CONFIG_FORCE_FLUSH_RSLT   (1 << 1)
-#define DMOV_CONFIG_IRQ_EN             (1 << 0)
-
-/* channel assignments */
-
-#define DMOV_NAND_CHAN        7
-#define DMOV_NAND_CRCI_CMD    5
-#define DMOV_NAND_CRCI_DATA   4
-
-#define DMOV_SDC1_CHAN        8
-#define DMOV_SDC1_CRCI        6
-
-#define DMOV_SDC2_CHAN        8
-#define DMOV_SDC2_CRCI        7
-
-#define DMOV_TSIF_CHAN        10
-#define DMOV_TSIF_CRCI        10
-
-#define DMOV_USB_CHAN         11
-
-/* no client rate control ifc (eg, ram) */
-#define DMOV_NONE_CRCI        0
-
-
-/* If the CMD_PTR register has CMD_PTR_LIST selected, the data mover
- * is going to walk a list of 32bit pointers as described below.  Each
- * pointer points to a *array* of dmov_s, etc structs.  The last pointer
- * in the list is marked with CMD_PTR_LP.  The last struct in each array
- * is marked with CMD_LC (see below).
- */
-#define CMD_PTR_ADDR(addr)  ((addr) >> 3)
-#define CMD_PTR_LP          (1 << 31) /* last pointer */
-#define CMD_PTR_PT          (3 << 29) /* ? */
-
-/* Single Item Mode */
-typedef struct {
-	unsigned cmd;
-	unsigned src;
-	unsigned dst;
-	unsigned len;
-} dmov_s;
-
-/* Scatter/Gather Mode */
-typedef struct {
-	unsigned cmd;
-	unsigned src_dscr;
-	unsigned dst_dscr;
-	unsigned _reserved;
-} dmov_sg;
-
-/* Box mode */
-typedef struct {
-	uint32_t cmd;
-	uint32_t src_row_addr;
-	uint32_t dst_row_addr;
-	uint32_t src_dst_len;
-	uint32_t num_rows;
-	uint32_t row_offset;
-} dmov_box;
-
-/* bits for the cmd field of the above structures */
-
-#define CMD_LC      (1 << 31)  /* last command */
-#define CMD_FR      (1 << 22)  /* force result -- does not work? */
-#define CMD_OCU     (1 << 21)  /* other channel unblock */
-#define CMD_OCB     (1 << 20)  /* other channel block */
-#define CMD_TCB     (1 << 19)  /* ? */
-#define CMD_DAH     (1 << 18)  /* destination address hold -- does not work?*/
-#define CMD_SAH     (1 << 17)  /* source address hold -- does not work? */
-
-#define CMD_MODE_SINGLE     (0 << 0) /* dmov_s structure used */
-#define CMD_MODE_SG         (1 << 0) /* untested */
-#define CMD_MODE_IND_SG     (2 << 0) /* untested */
-#define CMD_MODE_BOX        (3 << 0) /* untested */
-
-#define CMD_DST_SWAP_BYTES  (1 << 14) /* exchange each byte n with byte n+1 */
-#define CMD_DST_SWAP_SHORTS (1 << 15) /* exchange each short n with short n+1 */
-#define CMD_DST_SWAP_WORDS  (1 << 16) /* exchange each word n with word n+1 */
-
-#define CMD_SRC_SWAP_BYTES  (1 << 11) /* exchange each byte n with byte n+1 */
-#define CMD_SRC_SWAP_SHORTS (1 << 12) /* exchange each short n with short n+1 */
-#define CMD_SRC_SWAP_WORDS  (1 << 13) /* exchange each word n with word n+1 */
-
-#define CMD_DST_CRCI(n)     (((n) & 15) << 7)
-#define CMD_SRC_CRCI(n)     (((n) & 15) << 3)
-
-#endif
diff --git a/arch/arm/mach-msm/include/mach/entry-macro.S b/arch/arm/mach-msm/include/mach/entry-macro.S
deleted file mode 100644
index f2ae9087f654..000000000000
--- a/arch/arm/mach-msm/include/mach/entry-macro.S
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- *
- */
-
-#if !defined(CONFIG_ARM_GIC)
-#include <mach/msm_iomap.h>
-
-	.macro	get_irqnr_preamble, base, tmp
-	@ enable imprecise aborts
-	cpsie	a
-	mov	\base, #MSM_VIC_BASE
-	.endm
-
-	.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
-	@ 0xD0 has irq# or old irq# if the irq has been handled
-	@ 0xD4 has irq# or -1 if none pending *but* if you just
-	@ read 0xD4 you never get the first irq for some reason
-	ldr	\irqnr, [\base, #0xD0]
-	ldr	\irqnr, [\base, #0xD4]
-	cmp	\irqnr, #0xffffffff
-	.endm
-#endif
diff --git a/arch/arm/mach-msm/include/mach/hardware.h b/arch/arm/mach-msm/include/mach/hardware.h
deleted file mode 100644
index 2d126091ae41..000000000000
--- a/arch/arm/mach-msm/include/mach/hardware.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/* arch/arm/mach-msm/include/mach/hardware.h
- *
- * Copyright (C) 2007 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.
- *
- */
-
-#ifndef __ASM_ARCH_MSM_HARDWARE_H
-
-#endif
diff --git a/arch/arm/mach-msm/include/mach/irqs-7x00.h b/arch/arm/mach-msm/include/mach/irqs-7x00.h
deleted file mode 100644
index f1fe70612fe9..000000000000
--- a/arch/arm/mach-msm/include/mach/irqs-7x00.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2007 Google, Inc.
- * Copyright (c) 2009, Code Aurora Forum. All rights reserved.
- * Author: Brian Swetland <swetland@google.com>
- */
-
-#ifndef __ASM_ARCH_MSM_IRQS_7X00_H
-#define __ASM_ARCH_MSM_IRQS_7X00_H
-
-/* MSM ARM11 Interrupt Numbers */
-/* See 80-VE113-1 A, pp219-221     */
-
-#define INT_A9_M2A_0         0
-#define INT_A9_M2A_1         1
-#define INT_A9_M2A_2         2
-#define INT_A9_M2A_3         3
-#define INT_A9_M2A_4         4
-#define INT_A9_M2A_5         5
-#define INT_A9_M2A_6         6
-#define INT_GP_TIMER_EXP     7
-#define INT_DEBUG_TIMER_EXP  8
-#define INT_UART1            9
-#define INT_UART2            10
-#define INT_UART3            11
-#define INT_UART1_RX         12
-#define INT_UART2_RX         13
-#define INT_UART3_RX         14
-#define INT_USB_OTG          15
-#define INT_MDDI_PRI         16
-#define INT_MDDI_EXT         17
-#define INT_MDDI_CLIENT      18
-#define INT_MDP              19
-#define INT_GRAPHICS         20
-#define INT_ADM_AARM         21
-#define INT_ADSP_A11         22
-#define INT_ADSP_A9_A11      23
-#define INT_SDC1_0           24
-#define INT_SDC1_1           25
-#define INT_SDC2_0           26
-#define INT_SDC2_1           27
-#define INT_KEYSENSE         28
-#define INT_TCHSCRN_SSBI     29
-#define INT_TCHSCRN1         30
-#define INT_TCHSCRN2         31
-
-#define INT_GPIO_GROUP1      (32 + 0)
-#define INT_GPIO_GROUP2      (32 + 1)
-#define INT_PWB_I2C          (32 + 2)
-#define INT_SOFTRESET        (32 + 3)
-#define INT_NAND_WR_ER_DONE  (32 + 4)
-#define INT_NAND_OP_DONE     (32 + 5)
-#define INT_PBUS_ARM11       (32 + 6)
-#define INT_AXI_MPU_SMI      (32 + 7)
-#define INT_AXI_MPU_EBI1     (32 + 8)
-#define INT_AD_HSSD          (32 + 9)
-#define INT_ARM11_PMU        (32 + 10)
-#define INT_ARM11_DMA        (32 + 11)
-#define INT_TSIF_IRQ         (32 + 12)
-#define INT_UART1DM_IRQ      (32 + 13)
-#define INT_UART1DM_RX       (32 + 14)
-#define INT_USB_HS           (32 + 15)
-#define INT_SDC3_0           (32 + 16)
-#define INT_SDC3_1           (32 + 17)
-#define INT_SDC4_0           (32 + 18)
-#define INT_SDC4_1           (32 + 19)
-#define INT_UART2DM_RX       (32 + 20)
-#define INT_UART2DM_IRQ      (32 + 21)
-
-/* 22-31 are reserved */
-
-#define NR_MSM_IRQS 64
-#define NR_GPIO_IRQS 122
-#define NR_BOARD_IRQS 64
-
-#endif
diff --git a/arch/arm/mach-msm/include/mach/irqs-7x30.h b/arch/arm/mach-msm/include/mach/irqs-7x30.h
deleted file mode 100644
index 1f15902655fd..000000000000
--- a/arch/arm/mach-msm/include/mach/irqs-7x30.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/* Copyright (c) 2009, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#ifndef __ASM_ARCH_MSM_IRQS_7X30_H
-#define __ASM_ARCH_MSM_IRQS_7X30_H
-
-/* MSM ACPU Interrupt Numbers */
-
-#define INT_DEBUG_TIMER_EXP	0
-#define INT_GPT0_TIMER_EXP	1
-#define INT_GPT1_TIMER_EXP	2
-#define INT_WDT0_ACCSCSSBARK	3
-#define INT_WDT1_ACCSCSSBARK	4
-#define INT_AVS_SVIC		5
-#define INT_AVS_SVIC_SW_DONE	6
-#define INT_SC_DBG_RX_FULL	7
-#define INT_SC_DBG_TX_EMPTY	8
-#define INT_ARM11_PM		9
-#define INT_AVS_REQ_DOWN	10
-#define INT_AVS_REQ_UP		11
-#define INT_SC_ACG		12
-/* SCSS_VICFIQSTS0[13:15] are RESERVED */
-#define INT_L2_SVICCPUIRPTREQ	16
-#define INT_L2_SVICDMANSIRPTREQ 17
-#define INT_L2_SVICDMASIRPTREQ  18
-#define INT_L2_SVICSLVIRPTREQ	19
-#define INT_AD5A_MPROC_APPS_0	20
-#define INT_AD5A_MPROC_APPS_1	21
-#define INT_A9_M2A_0		22
-#define INT_A9_M2A_1		23
-#define INT_A9_M2A_2		24
-#define INT_A9_M2A_3		25
-#define INT_A9_M2A_4		26
-#define INT_A9_M2A_5		27
-#define INT_A9_M2A_6		28
-#define INT_A9_M2A_7		29
-#define INT_A9_M2A_8		30
-#define INT_A9_M2A_9		31
-
-#define INT_AXI_EBI1_SC		(32 + 0)
-#define INT_IMEM_ERR		(32 + 1)
-#define INT_AXI_EBI0_SC		(32 + 2)
-#define INT_PBUS_SC_IRQC	(32 + 3)
-#define INT_PERPH_BUS_BPM	(32 + 4)
-#define INT_CC_TEMP_SENSE	(32 + 5)
-#define INT_UXMC_EBI0		(32 + 6)
-#define INT_UXMC_EBI1		(32 + 7)
-#define INT_EBI2_OP_DONE	(32 + 8)
-#define INT_EBI2_WR_ER_DONE	(32 + 9)
-#define INT_TCSR_SPSS_CE	(32 + 10)
-#define INT_EMDH		(32 + 11)
-#define INT_PMDH		(32 + 12)
-#define INT_MDC			(32 + 13)
-#define INT_MIDI_TO_SUPSS	(32 + 14)
-#define INT_LPA_2		(32 + 15)
-#define INT_GPIO_GROUP1_SECURE	(32 + 16)
-#define INT_GPIO_GROUP2_SECURE	(32 + 17)
-#define INT_GPIO_GROUP1		(32 + 18)
-#define INT_GPIO_GROUP2		(32 + 19)
-#define INT_MPRPH_SOFTRESET	(32 + 20)
-#define INT_PWB_I2C		(32 + 21)
-#define INT_PWB_I2C_2		(32 + 22)
-#define INT_TSSC_SAMPLE		(32 + 23)
-#define INT_TSSC_PENUP		(32 + 24)
-#define INT_TCHSCRN_SSBI	(32 + 25)
-#define INT_FM_RDS		(32 + 26)
-#define INT_KEYSENSE 		(32 + 27)
-#define INT_USB_OTG_HS		(32 + 28)
-#define INT_USB_OTG_HS2		(32 + 29)
-#define INT_USB_OTG_HS3		(32 + 30)
-#define INT_CSI			(32 + 31)
-
-#define INT_SPI_OUTPUT		(64 + 0)
-#define INT_SPI_INPUT		(64 + 1)
-#define INT_SPI_ERROR		(64 + 2)
-#define INT_UART1		(64 + 3)
-#define INT_UART1_RX		(64 + 4)
-#define INT_UART2		(64 + 5)
-#define INT_UART2_RX		(64 + 6)
-#define INT_UART3		(64 + 7)
-#define INT_UART3_RX		(64 + 8)
-#define INT_UART1DM_IRQ		(64 + 9)
-#define INT_UART1DM_RX		(64 + 10)
-#define INT_UART2DM_IRQ		(64 + 11)
-#define INT_UART2DM_RX		(64 + 12)
-#define INT_TSIF		(64 + 13)
-#define INT_ADM_SC1		(64 + 14)
-#define INT_ADM_SC2		(64 + 15)
-#define INT_MDP			(64 + 16)
-#define INT_VPE			(64 + 17)
-#define INT_GRP_2D		(64 + 18)
-#define INT_GRP_3D		(64 + 19)
-#define INT_ROTATOR		(64 + 20)
-#define INT_MFC720		(64 + 21)
-#define INT_JPEG		(64 + 22)
-#define INT_VFE			(64 + 23)
-#define INT_TV_ENC		(64 + 24)
-#define INT_PMIC_SSBI		(64 + 25)
-#define INT_MPM_1		(64 + 26)
-#define INT_TCSR_SPSS_SAMPLE	(64 + 27)
-#define INT_TCSR_SPSS_PENUP	(64 + 28)
-#define INT_MPM_2		(64 + 29)
-#define INT_SDC1_0		(64 + 30)
-#define INT_SDC1_1		(64 + 31)
-
-#define INT_SDC3_0		(96 + 0)
-#define INT_SDC3_1		(96 + 1)
-#define INT_SDC2_0		(96 + 2)
-#define INT_SDC2_1		(96 + 3)
-#define INT_SDC4_0		(96 + 4)
-#define INT_SDC4_1		(96 + 5)
-#define INT_PWB_QUP_IN		(96 + 6)
-#define INT_PWB_QUP_OUT		(96 + 7)
-#define INT_PWB_QUP_ERR		(96 + 8)
-#define INT_SCSS_WDT0_BITE	(96 + 9)
-/* SCSS_VICFIQSTS3[10:31] are RESERVED */
-
-/* Retrofit universal macro names */
-#define INT_ADM_AARM		INT_ADM_SC2
-#define INT_USB_HS   		INT_USB_OTG_HS
-#define INT_USB_OTG   		INT_USB_OTG_HS
-#define INT_TCHSCRN1 		INT_TSSC_SAMPLE
-#define INT_TCHSCRN2 		INT_TSSC_PENUP
-#define INT_GP_TIMER_EXP 	INT_GPT0_TIMER_EXP
-#define INT_ADSP_A11 		INT_AD5A_MPROC_APPS_0
-#define INT_ADSP_A9_A11 	INT_AD5A_MPROC_APPS_1
-#define INT_MDDI_EXT		INT_EMDH
-#define INT_MDDI_PRI		INT_PMDH
-#define INT_MDDI_CLIENT		INT_MDC
-#define INT_NAND_WR_ER_DONE	INT_EBI2_WR_ER_DONE
-#define INT_NAND_OP_DONE	INT_EBI2_OP_DONE
-
-#define NR_MSM_IRQS		128
-#define NR_GPIO_IRQS		182
-#define PMIC8058_IRQ_BASE	(NR_MSM_IRQS + NR_GPIO_IRQS)
-#define NR_PMIC8058_GPIO_IRQS	40
-#define NR_PMIC8058_MPP_IRQS	12
-#define NR_PMIC8058_MISC_IRQS	8
-#define NR_PMIC8058_IRQS	(NR_PMIC8058_GPIO_IRQS +\
-				NR_PMIC8058_MPP_IRQS +\
-				NR_PMIC8058_MISC_IRQS)
-#define NR_BOARD_IRQS		NR_PMIC8058_IRQS
-
-#endif /* __ASM_ARCH_MSM_IRQS_7X30_H */
diff --git a/arch/arm/mach-msm/include/mach/irqs-8x50.h b/arch/arm/mach-msm/include/mach/irqs-8x50.h
deleted file mode 100644
index 26adbe0e9406..000000000000
--- a/arch/arm/mach-msm/include/mach/irqs-8x50.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#ifndef __ASM_ARCH_MSM_IRQS_8XXX_H
-#define __ASM_ARCH_MSM_IRQS_8XXX_H
-
-/* MSM ACPU Interrupt Numbers */
-
-#define INT_A9_M2A_0         0
-#define INT_A9_M2A_1         1
-#define INT_A9_M2A_2         2
-#define INT_A9_M2A_3         3
-#define INT_A9_M2A_4         4
-#define INT_A9_M2A_5         5
-#define INT_A9_M2A_6         6
-#define INT_GP_TIMER_EXP     7
-#define INT_DEBUG_TIMER_EXP  8
-#define INT_SIRC_0           9
-#define INT_SDC3_0           10
-#define INT_SDC3_1           11
-#define INT_SDC4_0           12
-#define INT_SDC4_1           13
-#define INT_AD6_EXT_VFR      14
-#define INT_USB_OTG          15
-#define INT_MDDI_PRI         16
-#define INT_MDDI_EXT         17
-#define INT_MDDI_CLIENT      18
-#define INT_MDP              19
-#define INT_GRAPHICS         20
-#define INT_ADM_AARM         21
-#define INT_ADSP_A11         22
-#define INT_ADSP_A9_A11      23
-#define INT_SDC1_0           24
-#define INT_SDC1_1           25
-#define INT_SDC2_0           26
-#define INT_SDC2_1           27
-#define INT_KEYSENSE         28
-#define INT_TCHSCRN_SSBI     29
-#define INT_TCHSCRN1         30
-#define INT_TCHSCRN2         31
-
-#define INT_TCSR_MPRPH_SC1   (32 + 0)
-#define INT_USB_FS2          (32 + 1)
-#define INT_PWB_I2C          (32 + 2)
-#define INT_SOFTRESET        (32 + 3)
-#define INT_NAND_WR_ER_DONE  (32 + 4)
-#define INT_NAND_OP_DONE     (32 + 5)
-#define INT_TCSR_MPRPH_SC2   (32 + 6)
-#define INT_OP_PEN           (32 + 7)
-#define INT_AD_HSSD          (32 + 8)
-#define INT_ARM11_PM         (32 + 9)
-#define INT_SDMA_NON_SECURE  (32 + 10)
-#define INT_TSIF_IRQ         (32 + 11)
-#define INT_UART1DM_IRQ      (32 + 12)
-#define INT_UART1DM_RX       (32 + 13)
-#define INT_SDMA_SECURE      (32 + 14)
-#define INT_SI2S_SLAVE       (32 + 15)
-#define INT_SC_I2CPU         (32 + 16)
-#define INT_SC_DBG_RDTRFULL  (32 + 17)
-#define INT_SC_DBG_WDTRFULL  (32 + 18)
-#define INT_SCPLL_CTL_DONE   (32 + 19)
-#define INT_UART2DM_IRQ      (32 + 20)
-#define INT_UART2DM_RX       (32 + 21)
-#define INT_VDC_MEC          (32 + 22)
-#define INT_VDC_DB           (32 + 23)
-#define INT_VDC_AXI          (32 + 24)
-#define INT_VFE              (32 + 25)
-#define INT_USB_HS           (32 + 26)
-#define INT_AUDIO_OUT0       (32 + 27)
-#define INT_AUDIO_OUT1       (32 + 28)
-#define INT_CRYPTO           (32 + 29)
-#define INT_AD6M_IDLE        (32 + 30)
-#define INT_SIRC_1           (32 + 31)
-
-#define NR_GPIO_IRQS 165
-#define NR_MSM_IRQS 64
-#define NR_BOARD_IRQS 64
-
-#endif
diff --git a/arch/arm/mach-msm/include/mach/irqs.h b/arch/arm/mach-msm/include/mach/irqs.h
deleted file mode 100644
index 164d355c96ea..000000000000
--- a/arch/arm/mach-msm/include/mach/irqs.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2007 Google, Inc.
- * Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved.
- * Author: Brian Swetland <swetland@google.com>
- *
- * 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.
- *
- */
-
-#ifndef __ASM_ARCH_MSM_IRQS_H
-#define __ASM_ARCH_MSM_IRQS_H
-
-#define MSM_IRQ_BIT(irq)     (1 << ((irq) & 31))
-
-#if defined(CONFIG_ARCH_MSM7X30)
-#include "irqs-7x30.h"
-#elif defined(CONFIG_ARCH_QSD8X50)
-#include "irqs-8x50.h"
-#include "sirc.h"
-#elif defined(CONFIG_ARCH_MSM_ARM11)
-#include "irqs-7x00.h"
-#else
-#error "Unknown architecture specification"
-#endif
-
-#define NR_IRQS (NR_MSM_IRQS + NR_GPIO_IRQS + NR_BOARD_IRQS)
-#define MSM_GPIO_TO_INT(n) (NR_MSM_IRQS + (n))
-#define MSM_INT_TO_REG(base, irq) (base + irq / 32)
-
-#endif
diff --git a/arch/arm/mach-msm/include/mach/msm_gpiomux.h b/arch/arm/mach-msm/include/mach/msm_gpiomux.h
deleted file mode 100644
index 0c7d3936e02f..000000000000
--- a/arch/arm/mach-msm/include/mach/msm_gpiomux.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#ifndef _LINUX_MSM_GPIOMUX_H
-#define _LINUX_MSM_GPIOMUX_H
-
-#ifdef CONFIG_MSM_GPIOMUX
-
-/* Increment a gpio's reference count, possibly activating the line. */
-int __must_check msm_gpiomux_get(unsigned gpio);
-
-/* Decrement a gpio's reference count, possibly suspending the line. */
-int msm_gpiomux_put(unsigned gpio);
-
-#else
-
-static inline int __must_check msm_gpiomux_get(unsigned gpio)
-{
-	return -ENOSYS;
-}
-
-static inline int msm_gpiomux_put(unsigned gpio)
-{
-	return -ENOSYS;
-}
-
-#endif
-
-#endif /* _LINUX_MSM_GPIOMUX_H */
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap-7x00.h b/arch/arm/mach-msm/include/mach/msm_iomap-7x00.h
deleted file mode 100644
index 67dc0e98b958..000000000000
--- a/arch/arm/mach-msm/include/mach/msm_iomap-7x00.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/* arch/arm/mach-msm/include/mach/msm_iomap.h
- *
- * Copyright (C) 2007 Google, Inc.
- * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
- * Author: Brian Swetland <swetland@google.com>
- *
- * 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.
- *
- *
- * The MSM peripherals are spread all over across 768MB of physical
- * space, which makes just having a simple IO_ADDRESS macro to slide
- * them into the right virtual location rough.  Instead, we will
- * provide a master phys->virt mapping for peripherals here.
- *
- */
-
-#ifndef __ASM_ARCH_MSM_IOMAP_7X00_H
-#define __ASM_ARCH_MSM_IOMAP_7X00_H
-
-#include <asm/sizes.h>
-
-/* Physical base address and size of peripherals.
- * Ordered by the virtual base addresses they will be mapped at.
- *
- * MSM_VIC_BASE must be an value that can be loaded via a "mov"
- * instruction, otherwise entry-macro.S will not compile.
- *
- * If you add or remove entries here, you'll want to edit the
- * msm_io_desc array in arch/arm/mach-msm/io.c to reflect your
- * changes.
- *
- */
-
-#define MSM_VIC_BASE          IOMEM(0xE0000000)
-#define MSM_VIC_PHYS          0xC0000000
-#define MSM_VIC_SIZE          SZ_4K
-
-#define MSM7X00_CSR_PHYS      0xC0100000
-#define MSM7X00_CSR_SIZE      SZ_4K
-
-#define MSM_DMOV_BASE         IOMEM(0xE0002000)
-#define MSM_DMOV_PHYS         0xA9700000
-#define MSM_DMOV_SIZE         SZ_4K
-
-#define MSM7X00_GPIO1_PHYS        0xA9200000
-#define MSM7X00_GPIO1_SIZE        SZ_4K
-
-#define MSM7X00_GPIO2_PHYS        0xA9300000
-#define MSM7X00_GPIO2_SIZE        SZ_4K
-
-#define MSM_CLK_CTL_BASE      IOMEM(0xE0005000)
-#define MSM_CLK_CTL_PHYS      0xA8600000
-#define MSM_CLK_CTL_SIZE      SZ_4K
-
-#define MSM_SHARED_RAM_BASE   IOMEM(0xE0100000)
-#define MSM_SHARED_RAM_PHYS   0x01F00000
-#define MSM_SHARED_RAM_SIZE   SZ_1M
-
-#define MSM_UART1_PHYS        0xA9A00000
-#define MSM_UART1_SIZE        SZ_4K
-
-#define MSM_UART2_PHYS        0xA9B00000
-#define MSM_UART2_SIZE        SZ_4K
-
-#define MSM_UART3_PHYS        0xA9C00000
-#define MSM_UART3_SIZE        SZ_4K
-
-#define MSM_SDC1_PHYS         0xA0400000
-#define MSM_SDC1_SIZE         SZ_4K
-
-#define MSM_SDC2_PHYS         0xA0500000
-#define MSM_SDC2_SIZE         SZ_4K
-
-#define MSM_SDC3_PHYS         0xA0600000
-#define MSM_SDC3_SIZE         SZ_4K
-
-#define MSM_SDC4_PHYS         0xA0700000
-#define MSM_SDC4_SIZE         SZ_4K
-
-#define MSM_I2C_PHYS          0xA9900000
-#define MSM_I2C_SIZE          SZ_4K
-
-#define MSM_HSUSB_PHYS        0xA0800000
-#define MSM_HSUSB_SIZE        SZ_4K
-
-#define MSM_PMDH_PHYS         0xAA600000
-#define MSM_PMDH_SIZE         SZ_4K
-
-#define MSM_EMDH_PHYS         0xAA700000
-#define MSM_EMDH_SIZE         SZ_4K
-
-#define MSM_MDP_PHYS          0xAA200000
-#define MSM_MDP_SIZE          0x000F0000
-
-#define MSM_MDC_PHYS	      0xAA500000
-#define MSM_MDC_SIZE	      SZ_1M
-
-#define MSM_AD5_PHYS          0xAC000000
-#define MSM_AD5_SIZE          (SZ_1M*13)
-
-#endif
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap-7x30.h b/arch/arm/mach-msm/include/mach/msm_iomap-7x30.h
deleted file mode 100644
index 198202c267c8..000000000000
--- a/arch/arm/mach-msm/include/mach/msm_iomap-7x30.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (C) 2007 Google, Inc.
- * Copyright (c) 2008-2011 Code Aurora Forum. All rights reserved.
- * Author: Brian Swetland <swetland@google.com>
- *
- * 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.
- *
- *
- * The MSM peripherals are spread all over across 768MB of physical
- * space, which makes just having a simple IO_ADDRESS macro to slide
- * them into the right virtual location rough.  Instead, we will
- * provide a master phys->virt mapping for peripherals here.
- *
- */
-
-#ifndef __ASM_ARCH_MSM_IOMAP_7X30_H
-#define __ASM_ARCH_MSM_IOMAP_7X30_H
-
-/* Physical base address and size of peripherals.
- * Ordered by the virtual base addresses they will be mapped at.
- *
- * MSM_VIC_BASE must be an value that can be loaded via a "mov"
- * instruction, otherwise entry-macro.S will not compile.
- *
- * If you add or remove entries here, you'll want to edit the
- * msm_io_desc array in arch/arm/mach-msm/io.c to reflect your
- * changes.
- *
- */
-
-#define MSM_VIC_BASE          IOMEM(0xE0000000)
-#define MSM_VIC_PHYS          0xC0080000
-#define MSM_VIC_SIZE          SZ_4K
-
-#define MSM7X30_CSR_PHYS      0xC0100000
-#define MSM7X30_CSR_SIZE      SZ_4K
-
-#define MSM_DMOV_BASE         IOMEM(0xE0002000)
-#define MSM_DMOV_PHYS         0xAC400000
-#define MSM_DMOV_SIZE         SZ_4K
-
-#define MSM7X30_GPIO1_PHYS        0xAC001000
-#define MSM7X30_GPIO1_SIZE        SZ_4K
-
-#define MSM7X30_GPIO2_PHYS        0xAC101000
-#define MSM7X30_GPIO2_SIZE        SZ_4K
-
-#define MSM_CLK_CTL_BASE      IOMEM(0xE0005000)
-#define MSM_CLK_CTL_PHYS      0xAB800000
-#define MSM_CLK_CTL_SIZE      SZ_4K
-
-#define MSM_CLK_CTL_SH2_BASE  IOMEM(0xE0006000)
-#define MSM_CLK_CTL_SH2_PHYS  0xABA01000
-#define MSM_CLK_CTL_SH2_SIZE  SZ_4K
-
-#define MSM_ACC_BASE          IOMEM(0xE0007000)
-#define MSM_ACC_PHYS          0xC0101000
-#define MSM_ACC_SIZE          SZ_4K
-
-#define MSM_SAW_BASE          IOMEM(0xE0008000)
-#define MSM_SAW_PHYS          0xC0102000
-#define MSM_SAW_SIZE          SZ_4K
-
-#define MSM_GCC_BASE	      IOMEM(0xE0009000)
-#define MSM_GCC_PHYS	      0xC0182000
-#define MSM_GCC_SIZE	      SZ_4K
-
-#define MSM_TCSR_BASE	      IOMEM(0xE000A000)
-#define MSM_TCSR_PHYS	      0xAB600000
-#define MSM_TCSR_SIZE	      SZ_4K
-
-#define MSM_SHARED_RAM_BASE   IOMEM(0xE0100000)
-#define MSM_SHARED_RAM_PHYS   0x00100000
-#define MSM_SHARED_RAM_SIZE   SZ_1M
-
-#define MSM_UART1_PHYS        0xACA00000
-#define MSM_UART1_SIZE        SZ_4K
-
-#define MSM_UART2_PHYS        0xACB00000
-#define MSM_UART2_SIZE        SZ_4K
-
-#define MSM_UART3_PHYS        0xACC00000
-#define MSM_UART3_SIZE        SZ_4K
-
-#define MSM_MDC_BASE	      IOMEM(0xE0200000)
-#define MSM_MDC_PHYS	      0xAA500000
-#define MSM_MDC_SIZE	      SZ_1M
-
-#define MSM_AD5_BASE          IOMEM(0xE0300000)
-#define MSM_AD5_PHYS          0xA7000000
-#define MSM_AD5_SIZE          (SZ_1M*13)
-
-#define MSM_HSUSB_PHYS        0xA3600000
-#define MSM_HSUSB_SIZE        SZ_1K
-
-#endif
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap-8x50.h b/arch/arm/mach-msm/include/mach/msm_iomap-8x50.h
deleted file mode 100644
index 0faa894729b7..000000000000
--- a/arch/arm/mach-msm/include/mach/msm_iomap-8x50.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright (C) 2007 Google, Inc.
- * Copyright (c) 2008-2011 Code Aurora Forum. All rights reserved.
- * Author: Brian Swetland <swetland@google.com>
- *
- * 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.
- *
- *
- * The MSM peripherals are spread all over across 768MB of physical
- * space, which makes just having a simple IO_ADDRESS macro to slide
- * them into the right virtual location rough.  Instead, we will
- * provide a master phys->virt mapping for peripherals here.
- *
- */
-
-#ifndef __ASM_ARCH_MSM_IOMAP_8X50_H
-#define __ASM_ARCH_MSM_IOMAP_8X50_H
-
-/* Physical base address and size of peripherals.
- * Ordered by the virtual base addresses they will be mapped at.
- *
- * MSM_VIC_BASE must be an value that can be loaded via a "mov"
- * instruction, otherwise entry-macro.S will not compile.
- *
- * If you add or remove entries here, you'll want to edit the
- * msm_io_desc array in arch/arm/mach-msm/io.c to reflect your
- * changes.
- *
- */
-
-#define MSM_VIC_BASE          IOMEM(0xE0000000)
-#define MSM_VIC_PHYS          0xAC000000
-#define MSM_VIC_SIZE          SZ_4K
-
-#define QSD8X50_CSR_PHYS      0xAC100000
-#define QSD8X50_CSR_SIZE      SZ_4K
-
-#define MSM_DMOV_BASE         IOMEM(0xE0002000)
-#define MSM_DMOV_PHYS         0xA9700000
-#define MSM_DMOV_SIZE         SZ_4K
-
-#define QSD8X50_GPIO1_PHYS        0xA9000000
-#define QSD8X50_GPIO1_SIZE        SZ_4K
-
-#define QSD8X50_GPIO2_PHYS        0xA9100000
-#define QSD8X50_GPIO2_SIZE        SZ_4K
-
-#define MSM_CLK_CTL_BASE      IOMEM(0xE0005000)
-#define MSM_CLK_CTL_PHYS      0xA8600000
-#define MSM_CLK_CTL_SIZE      SZ_4K
-
-#define MSM_SIRC_BASE         IOMEM(0xE1006000)
-#define MSM_SIRC_PHYS         0xAC200000
-#define MSM_SIRC_SIZE         SZ_4K
-
-#define MSM_SCPLL_BASE        IOMEM(0xE1007000)
-#define MSM_SCPLL_PHYS        0xA8800000
-#define MSM_SCPLL_SIZE        SZ_4K
-
-#ifdef CONFIG_MSM_SOC_REV_A
-#define MSM_SMI_BASE 0xE0000000
-#else
-#define MSM_SMI_BASE 0x00000000
-#endif
-
-#define MSM_SHARED_RAM_BASE   IOMEM(0xE0100000)
-#define MSM_SHARED_RAM_PHYS (MSM_SMI_BASE + 0x00100000)
-#define MSM_SHARED_RAM_SIZE   SZ_1M
-
-#define MSM_UART1_PHYS        0xA9A00000
-#define MSM_UART1_SIZE        SZ_4K
-
-#define MSM_UART2_PHYS        0xA9B00000
-#define MSM_UART2_SIZE        SZ_4K
-
-#define MSM_UART3_PHYS        0xA9C00000
-#define MSM_UART3_SIZE        SZ_4K
-
-#define MSM_MDC_BASE	      IOMEM(0xE0200000)
-#define MSM_MDC_PHYS	      0xAA500000
-#define MSM_MDC_SIZE	      SZ_1M
-
-#define MSM_AD5_BASE          IOMEM(0xE0300000)
-#define MSM_AD5_PHYS          0xAC000000
-#define MSM_AD5_SIZE          (SZ_1M*13)
-
-
-#define MSM_I2C_SIZE          SZ_4K
-#define MSM_I2C_PHYS          0xA9900000
-
-#define MSM_HSUSB_PHYS        0xA0800000
-#define MSM_HSUSB_SIZE        SZ_1K
-
-#define MSM_NAND_PHYS           0xA0A00000
-
-
-#define MSM_TSIF_PHYS        (0xa0100000)
-#define MSM_TSIF_SIZE        (0x200)
-
-#define MSM_TSSC_PHYS         0xAA300000
-
-#define MSM_UART1DM_PHYS      0xA0200000
-#define MSM_UART2DM_PHYS      0xA0900000
-
-
-#define MSM_SDC1_PHYS          0xA0300000
-#define MSM_SDC1_SIZE          SZ_4K
-
-#define MSM_SDC2_PHYS          0xA0400000
-#define MSM_SDC2_SIZE          SZ_4K
-
-#define MSM_SDC3_PHYS          0xA0500000
-#define MSM_SDC3_SIZE           SZ_4K
-
-#define MSM_SDC4_PHYS          0xA0600000
-#define MSM_SDC4_SIZE          SZ_4K
-
-#endif
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap.h b/arch/arm/mach-msm/include/mach/msm_iomap.h
deleted file mode 100644
index 0e4f49157684..000000000000
--- a/arch/arm/mach-msm/include/mach/msm_iomap.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2007 Google, Inc.
- * Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved.
- * Author: Brian Swetland <swetland@google.com>
- *
- * 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.
- *
- *
- * The MSM peripherals are spread all over across 768MB of physical
- * space, which makes just having a simple IO_ADDRESS macro to slide
- * them into the right virtual location rough.  Instead, we will
- * provide a master phys->virt mapping for peripherals here.
- *
- */
-
-#ifndef __ASM_ARCH_MSM_IOMAP_H
-#define __ASM_ARCH_MSM_IOMAP_H
-
-#include <asm/sizes.h>
-
-/* Physical base address and size of peripherals.
- * Ordered by the virtual base addresses they will be mapped at.
- *
- * MSM_VIC_BASE must be an value that can be loaded via a "mov"
- * instruction, otherwise entry-macro.S will not compile.
- *
- * If you add or remove entries here, you'll want to edit the
- * msm_io_desc array in arch/arm/mach-msm/io.c to reflect your
- * changes.
- *
- */
-
-#if defined(CONFIG_ARCH_MSM7X30)
-#include "msm_iomap-7x30.h"
-#elif defined(CONFIG_ARCH_QSD8X50)
-#include "msm_iomap-8x50.h"
-#else
-#include "msm_iomap-7x00.h"
-#endif
-
-/* Virtual addresses shared across all MSM targets. */
-#define MSM_CSR_BASE		IOMEM(0xE0001000)
-#define MSM_GPIO1_BASE		IOMEM(0xE0003000)
-#define MSM_GPIO2_BASE		IOMEM(0xE0004000)
-
-#endif
diff --git a/arch/arm/mach-msm/include/mach/msm_smd.h b/arch/arm/mach-msm/include/mach/msm_smd.h
deleted file mode 100644
index 029463ec8756..000000000000
--- a/arch/arm/mach-msm/include/mach/msm_smd.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/* linux/include/asm-arm/arch-msm/msm_smd.h
- *
- * Copyright (C) 2007 Google, Inc.
- * Author: Brian Swetland <swetland@google.com>
- *
- * 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.
- *
- */
-
-#ifndef __ASM_ARCH_MSM_SMD_H
-#define __ASM_ARCH_MSM_SMD_H
-
-typedef struct smd_channel smd_channel_t;
-
-extern int (*msm_check_for_modem_crash)(void);
-
-/* warning: notify() may be called before open returns */
-int smd_open(const char *name, smd_channel_t **ch, void *priv,
-	     void (*notify)(void *priv, unsigned event));
-
-#define SMD_EVENT_DATA 1
-#define SMD_EVENT_OPEN 2
-#define SMD_EVENT_CLOSE 3
-
-int smd_close(smd_channel_t *ch);
-
-/* passing a null pointer for data reads and discards */
-int smd_read(smd_channel_t *ch, void *data, int len);
-
-/* Write to stream channels may do a partial write and return
-** the length actually written.
-** Write to packet channels will never do a partial write --
-** it will return the requested length written or an error.
-*/
-int smd_write(smd_channel_t *ch, const void *data, int len);
-int smd_write_atomic(smd_channel_t *ch, const void *data, int len);
-
-int smd_write_avail(smd_channel_t *ch);
-int smd_read_avail(smd_channel_t *ch);
-
-/* Returns the total size of the current packet being read.
-** Returns 0 if no packets available or a stream channel.
-*/
-int smd_cur_packet_size(smd_channel_t *ch);
-
-/* used for tty unthrottling and the like -- causes the notify()
-** callback to be called from the same lock context as is used
-** when it is called from channel updates
-*/
-void smd_kick(smd_channel_t *ch);
-
-
-#if 0
-/* these are interruptable waits which will block you until the specified
-** number of bytes are readable or writable.
-*/
-int smd_wait_until_readable(smd_channel_t *ch, int bytes);
-int smd_wait_until_writable(smd_channel_t *ch, int bytes);
-#endif
-
-typedef enum {
-	SMD_PORT_DS = 0,
-	SMD_PORT_DIAG,
-	SMD_PORT_RPC_CALL,
-	SMD_PORT_RPC_REPLY,
-	SMD_PORT_BT,
-	SMD_PORT_CONTROL,
-	SMD_PORT_MEMCPY_SPARE1,
-	SMD_PORT_DATA1,
-	SMD_PORT_DATA2,
-	SMD_PORT_DATA3,
-	SMD_PORT_DATA4,
-	SMD_PORT_DATA5,
-	SMD_PORT_DATA6,
-	SMD_PORT_DATA7,
-	SMD_PORT_DATA8,
-	SMD_PORT_DATA9,
-	SMD_PORT_DATA10,
-	SMD_PORT_DATA11,
-	SMD_PORT_DATA12,
-	SMD_PORT_DATA13,
-	SMD_PORT_DATA14,
-	SMD_PORT_DATA15,
-	SMD_PORT_DATA16,
-	SMD_PORT_DATA17,
-	SMD_PORT_DATA18,
-	SMD_PORT_DATA19,
-	SMD_PORT_DATA20,
-	SMD_PORT_GPS_NMEA,
-	SMD_PORT_BRIDGE_1,
-	SMD_PORT_BRIDGE_2,
-	SMD_PORT_BRIDGE_3,
-	SMD_PORT_BRIDGE_4,
-	SMD_PORT_BRIDGE_5,
-	SMD_PORT_LOOPBACK,
-	SMD_PORT_CS_APPS_MODEM,
-	SMD_PORT_CS_APPS_DSP,
-	SMD_PORT_CS_MODEM_DSP,
-	SMD_NUM_PORTS,
-} smd_port_id_type;
-
-#endif
diff --git a/arch/arm/mach-msm/include/mach/sirc.h b/arch/arm/mach-msm/include/mach/sirc.h
deleted file mode 100644
index ef55868a5b8a..000000000000
--- a/arch/arm/mach-msm/include/mach/sirc.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#ifndef __ASM_ARCH_MSM_SIRC_H
-#define __ASM_ARCH_MSM_SIRC_H
-
-struct sirc_regs_t {
-	void    *int_enable;
-	void    *int_enable_clear;
-	void    *int_enable_set;
-	void    *int_type;
-	void    *int_polarity;
-	void    *int_clear;
-};
-
-struct sirc_cascade_regs {
-	void    *int_status;
-	unsigned int    cascade_irq;
-};
-
-void msm_init_sirc(void);
-void msm_sirc_enter_sleep(void);
-void msm_sirc_exit_sleep(void);
-
-#if defined(CONFIG_ARCH_MSM_SCORPION)
-
-#include <mach/msm_iomap.h>
-
-/*
- * Secondary interrupt controller interrupts
- */
-
-#define FIRST_SIRC_IRQ (NR_MSM_IRQS + NR_GPIO_IRQS)
-
-#define INT_UART1                     (FIRST_SIRC_IRQ + 0)
-#define INT_UART2                     (FIRST_SIRC_IRQ + 1)
-#define INT_UART3                     (FIRST_SIRC_IRQ + 2)
-#define INT_UART1_RX                  (FIRST_SIRC_IRQ + 3)
-#define INT_UART2_RX                  (FIRST_SIRC_IRQ + 4)
-#define INT_UART3_RX                  (FIRST_SIRC_IRQ + 5)
-#define INT_SPI_INPUT                 (FIRST_SIRC_IRQ + 6)
-#define INT_SPI_OUTPUT                (FIRST_SIRC_IRQ + 7)
-#define INT_SPI_ERROR                 (FIRST_SIRC_IRQ + 8)
-#define INT_GPIO_GROUP1               (FIRST_SIRC_IRQ + 9)
-#define INT_GPIO_GROUP2               (FIRST_SIRC_IRQ + 10)
-#define INT_GPIO_GROUP1_SECURE        (FIRST_SIRC_IRQ + 11)
-#define INT_GPIO_GROUP2_SECURE        (FIRST_SIRC_IRQ + 12)
-#define INT_AVS_SVIC                  (FIRST_SIRC_IRQ + 13)
-#define INT_AVS_REQ_UP                (FIRST_SIRC_IRQ + 14)
-#define INT_AVS_REQ_DOWN              (FIRST_SIRC_IRQ + 15)
-#define INT_PBUS_ERR                  (FIRST_SIRC_IRQ + 16)
-#define INT_AXI_ERR                   (FIRST_SIRC_IRQ + 17)
-#define INT_SMI_ERR                   (FIRST_SIRC_IRQ + 18)
-#define INT_EBI1_ERR                  (FIRST_SIRC_IRQ + 19)
-#define INT_IMEM_ERR                  (FIRST_SIRC_IRQ + 20)
-#define INT_TEMP_SENSOR               (FIRST_SIRC_IRQ + 21)
-#define INT_TV_ENC                    (FIRST_SIRC_IRQ + 22)
-#define INT_GRP2D                     (FIRST_SIRC_IRQ + 23)
-#define INT_GSBI_QUP                  (FIRST_SIRC_IRQ + 24)
-#define INT_SC_ACG                    (FIRST_SIRC_IRQ + 25)
-#define INT_WDT0                      (FIRST_SIRC_IRQ + 26)
-#define INT_WDT1                      (FIRST_SIRC_IRQ + 27)
-
-#if defined(CONFIG_MSM_SOC_REV_A)
-#define NR_SIRC_IRQS                  28
-#define SIRC_MASK                     0x0FFFFFFF
-#else
-#define NR_SIRC_IRQS                  23
-#define SIRC_MASK                     0x007FFFFF
-#endif
-
-#define LAST_SIRC_IRQ                 (FIRST_SIRC_IRQ + NR_SIRC_IRQS - 1)
-
-#define SPSS_SIRC_INT_SELECT          (MSM_SIRC_BASE + 0x00)
-#define SPSS_SIRC_INT_ENABLE          (MSM_SIRC_BASE + 0x04)
-#define SPSS_SIRC_INT_ENABLE_CLEAR    (MSM_SIRC_BASE + 0x08)
-#define SPSS_SIRC_INT_ENABLE_SET      (MSM_SIRC_BASE + 0x0C)
-#define SPSS_SIRC_INT_TYPE            (MSM_SIRC_BASE + 0x10)
-#define SPSS_SIRC_INT_POLARITY        (MSM_SIRC_BASE + 0x14)
-#define SPSS_SIRC_SECURITY            (MSM_SIRC_BASE + 0x18)
-#define SPSS_SIRC_IRQ_STATUS          (MSM_SIRC_BASE + 0x1C)
-#define SPSS_SIRC_IRQ1_STATUS         (MSM_SIRC_BASE + 0x20)
-#define SPSS_SIRC_RAW_STATUS          (MSM_SIRC_BASE + 0x24)
-#define SPSS_SIRC_INT_CLEAR           (MSM_SIRC_BASE + 0x28)
-#define SPSS_SIRC_SOFT_INT            (MSM_SIRC_BASE + 0x2C)
-
-#endif
-
-#endif
diff --git a/arch/arm/mach-msm/include/mach/vreg.h b/arch/arm/mach-msm/include/mach/vreg.h
deleted file mode 100644
index 6626e7864e28..000000000000
--- a/arch/arm/mach-msm/include/mach/vreg.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* linux/include/asm-arm/arch-msm/vreg.h
- *
- * Copyright (C) 2008 Google, Inc.
- * Author: Brian Swetland <swetland@google.com>
- *
- * 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.
- *
- */
-
-#ifndef __ARCH_ARM_MACH_MSM_VREG_H
-#define __ARCH_ARM_MACH_MSM_VREG_H
-
-struct vreg;
-
-struct vreg *vreg_get(struct device *dev, const char *id);
-void vreg_put(struct vreg *vreg);
-
-int vreg_enable(struct vreg *vreg);
-int vreg_disable(struct vreg *vreg);
-int vreg_set_level(struct vreg *vreg, unsigned mv);
-
-#endif
diff --git a/arch/arm/mach-msm/io.c b/arch/arm/mach-msm/io.c
deleted file mode 100644
index b042dca1f633..000000000000
--- a/arch/arm/mach-msm/io.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/* arch/arm/mach-msm/io.c
- *
- * MSM7K, QSD io support
- *
- * Copyright (C) 2007 Google, Inc.
- * Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved.
- * Author: Brian Swetland <swetland@google.com>
- *
- * 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/kernel.h>
-#include <linux/bug.h>
-#include <linux/init.h>
-#include <linux/io.h>
-#include <linux/export.h>
-
-#include <mach/hardware.h>
-#include <asm/page.h>
-#include <mach/msm_iomap.h>
-#include <asm/mach/map.h>
-
-#include "common.h"
-
-#define MSM_CHIP_DEVICE_TYPE(name, chip, mem_type) {			      \
-		.virtual = (unsigned long) MSM_##name##_BASE, \
-		.pfn = __phys_to_pfn(chip##_##name##_PHYS), \
-		.length = chip##_##name##_SIZE, \
-		.type = mem_type, \
-	 }
-
-#define MSM_DEVICE_TYPE(name, mem_type) \
-		MSM_CHIP_DEVICE_TYPE(name, MSM, mem_type)
-#define MSM_CHIP_DEVICE(name, chip) \
-		MSM_CHIP_DEVICE_TYPE(name, chip, MT_DEVICE)
-#define MSM_DEVICE(name) MSM_CHIP_DEVICE(name, MSM)
-
-#if defined(CONFIG_ARCH_MSM7X00A)
-static struct map_desc msm_io_desc[] __initdata = {
-	MSM_DEVICE_TYPE(VIC, MT_DEVICE_NONSHARED),
-	MSM_CHIP_DEVICE_TYPE(CSR, MSM7X00, MT_DEVICE_NONSHARED),
-	MSM_DEVICE_TYPE(DMOV, MT_DEVICE_NONSHARED),
-	MSM_CHIP_DEVICE_TYPE(GPIO1, MSM7X00, MT_DEVICE_NONSHARED),
-	MSM_CHIP_DEVICE_TYPE(GPIO2, MSM7X00, MT_DEVICE_NONSHARED),
-	MSM_DEVICE_TYPE(CLK_CTL, MT_DEVICE_NONSHARED),
-	{
-		.virtual =  (unsigned long) MSM_SHARED_RAM_BASE,
-		.pfn = __phys_to_pfn(MSM_SHARED_RAM_PHYS),
-		.length =   MSM_SHARED_RAM_SIZE,
-		.type =     MT_DEVICE,
-	},
-#if defined(CONFIG_DEBUG_MSM_UART)
-	{
-		/* Must be last: virtual and pfn filled in by debug_ll_addr() */
-		.length = SZ_4K,
-		.type = MT_DEVICE_NONSHARED,
-	}
-#endif
-};
-
-void __init msm_map_common_io(void)
-{
-	size_t size = ARRAY_SIZE(msm_io_desc);
-
-	/* Make sure the peripheral register window is closed, since
-	 * we will use PTE flags (TEX[1]=1,B=0,C=1) to determine which
-	 * pages are peripheral interface or not.
-	 */
-	asm("mcr p15, 0, %0, c15, c2, 4" : : "r" (0));
-#if defined(CONFIG_DEBUG_MSM_UART)
-#ifdef CONFIG_MMU
-	debug_ll_addr(&msm_io_desc[size - 1].pfn,
-		      &msm_io_desc[size - 1].virtual);
-#endif
-	msm_io_desc[size - 1].pfn = __phys_to_pfn(msm_io_desc[size - 1].pfn);
-#endif
-	iotable_init(msm_io_desc, size);
-}
-#endif
-
-#ifdef CONFIG_ARCH_QSD8X50
-static struct map_desc qsd8x50_io_desc[] __initdata = {
-	MSM_DEVICE(VIC),
-	MSM_CHIP_DEVICE(CSR, QSD8X50),
-	MSM_DEVICE(DMOV),
-	MSM_CHIP_DEVICE(GPIO1, QSD8X50),
-	MSM_CHIP_DEVICE(GPIO2, QSD8X50),
-	MSM_DEVICE(CLK_CTL),
-	MSM_DEVICE(SIRC),
-	MSM_DEVICE(SCPLL),
-	MSM_DEVICE(AD5),
-	MSM_DEVICE(MDC),
-	{
-		.virtual =  (unsigned long) MSM_SHARED_RAM_BASE,
-		.pfn = __phys_to_pfn(MSM_SHARED_RAM_PHYS),
-		.length =   MSM_SHARED_RAM_SIZE,
-		.type =     MT_DEVICE,
-	},
-};
-
-void __init msm_map_qsd8x50_io(void)
-{
-	debug_ll_io_init();
-	iotable_init(qsd8x50_io_desc, ARRAY_SIZE(qsd8x50_io_desc));
-}
-#endif /* CONFIG_ARCH_QSD8X50 */
-
-#ifdef CONFIG_ARCH_MSM7X30
-static struct map_desc msm7x30_io_desc[] __initdata = {
-	MSM_DEVICE(VIC),
-	MSM_CHIP_DEVICE(CSR, MSM7X30),
-	MSM_DEVICE(DMOV),
-	MSM_CHIP_DEVICE(GPIO1, MSM7X30),
-	MSM_CHIP_DEVICE(GPIO2, MSM7X30),
-	MSM_DEVICE(CLK_CTL),
-	MSM_DEVICE(CLK_CTL_SH2),
-	MSM_DEVICE(AD5),
-	MSM_DEVICE(MDC),
-	MSM_DEVICE(ACC),
-	MSM_DEVICE(SAW),
-	MSM_DEVICE(GCC),
-	MSM_DEVICE(TCSR),
-	{
-		.virtual =  (unsigned long) MSM_SHARED_RAM_BASE,
-		.pfn = __phys_to_pfn(MSM_SHARED_RAM_PHYS),
-		.length =   MSM_SHARED_RAM_SIZE,
-		.type =     MT_DEVICE,
-	},
-};
-
-void __init msm_map_msm7x30_io(void)
-{
-	debug_ll_io_init();
-	iotable_init(msm7x30_io_desc, ARRAY_SIZE(msm7x30_io_desc));
-}
-#endif /* CONFIG_ARCH_MSM7X30 */
-
-#ifdef CONFIG_ARCH_MSM7X00A
-void __iomem *__msm_ioremap_caller(phys_addr_t phys_addr, size_t size,
-				   unsigned int mtype, void *caller)
-{
-	if (mtype == MT_DEVICE) {
-		/* The peripherals in the 88000000 - D0000000 range
-		 * are only accessible by type MT_DEVICE_NONSHARED.
-		 * Adjust mtype as necessary to make this "just work."
-		 */
-		if ((phys_addr >= 0x88000000) && (phys_addr < 0xD0000000))
-			mtype = MT_DEVICE_NONSHARED;
-	}
-
-	return __arm_ioremap_caller(phys_addr, size, mtype, caller);
-}
-#endif
diff --git a/arch/arm/mach-msm/irq-vic.c b/arch/arm/mach-msm/irq-vic.c
deleted file mode 100644
index 1b54f807c2d0..000000000000
--- a/arch/arm/mach-msm/irq-vic.c
+++ /dev/null
@@ -1,363 +0,0 @@
-/*
- * Copyright (C) 2007 Google, Inc.
- * Copyright (c) 2009, Code Aurora Forum. All rights reserved.
- *
- * 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/init.h>
-#include <linux/module.h>
-#include <linux/sched.h>
-#include <linux/interrupt.h>
-#include <linux/ptrace.h>
-#include <linux/timer.h>
-#include <linux/irq.h>
-#include <linux/io.h>
-
-#include <asm/cacheflush.h>
-
-#include <mach/hardware.h>
-
-#include <mach/msm_iomap.h>
-
-#include "smd_private.h"
-
-enum {
-	IRQ_DEBUG_SLEEP_INT_TRIGGER = 1U << 0,
-	IRQ_DEBUG_SLEEP_INT = 1U << 1,
-	IRQ_DEBUG_SLEEP_ABORT = 1U << 2,
-	IRQ_DEBUG_SLEEP = 1U << 3,
-	IRQ_DEBUG_SLEEP_REQUEST = 1U << 4,
-};
-static int msm_irq_debug_mask;
-module_param_named(debug_mask, msm_irq_debug_mask, int,
-		   S_IRUGO | S_IWUSR | S_IWGRP);
-
-#define VIC_REG(off) (MSM_VIC_BASE + (off))
-#define VIC_INT_TO_REG_ADDR(base, irq) (base + (irq / 32) * 4)
-#define VIC_INT_TO_REG_INDEX(irq) ((irq >> 5) & 3)
-
-#define VIC_INT_SELECT0     VIC_REG(0x0000)  /* 1: FIQ, 0: IRQ */
-#define VIC_INT_SELECT1     VIC_REG(0x0004)  /* 1: FIQ, 0: IRQ */
-#define VIC_INT_SELECT2     VIC_REG(0x0008)  /* 1: FIQ, 0: IRQ */
-#define VIC_INT_SELECT3     VIC_REG(0x000C)  /* 1: FIQ, 0: IRQ */
-#define VIC_INT_EN0         VIC_REG(0x0010)
-#define VIC_INT_EN1         VIC_REG(0x0014)
-#define VIC_INT_EN2         VIC_REG(0x0018)
-#define VIC_INT_EN3         VIC_REG(0x001C)
-#define VIC_INT_ENCLEAR0    VIC_REG(0x0020)
-#define VIC_INT_ENCLEAR1    VIC_REG(0x0024)
-#define VIC_INT_ENCLEAR2    VIC_REG(0x0028)
-#define VIC_INT_ENCLEAR3    VIC_REG(0x002C)
-#define VIC_INT_ENSET0      VIC_REG(0x0030)
-#define VIC_INT_ENSET1      VIC_REG(0x0034)
-#define VIC_INT_ENSET2      VIC_REG(0x0038)
-#define VIC_INT_ENSET3      VIC_REG(0x003C)
-#define VIC_INT_TYPE0       VIC_REG(0x0040)  /* 1: EDGE, 0: LEVEL  */
-#define VIC_INT_TYPE1       VIC_REG(0x0044)  /* 1: EDGE, 0: LEVEL  */
-#define VIC_INT_TYPE2       VIC_REG(0x0048)  /* 1: EDGE, 0: LEVEL  */
-#define VIC_INT_TYPE3       VIC_REG(0x004C)  /* 1: EDGE, 0: LEVEL  */
-#define VIC_INT_POLARITY0   VIC_REG(0x0050)  /* 1: NEG, 0: POS */
-#define VIC_INT_POLARITY1   VIC_REG(0x0054)  /* 1: NEG, 0: POS */
-#define VIC_INT_POLARITY2   VIC_REG(0x0058)  /* 1: NEG, 0: POS */
-#define VIC_INT_POLARITY3   VIC_REG(0x005C)  /* 1: NEG, 0: POS */
-#define VIC_NO_PEND_VAL     VIC_REG(0x0060)
-
-#if defined(CONFIG_ARCH_MSM_SCORPION)
-#define VIC_NO_PEND_VAL_FIQ VIC_REG(0x0064)
-#define VIC_INT_MASTEREN    VIC_REG(0x0068)  /* 1: IRQ, 2: FIQ     */
-#define VIC_CONFIG          VIC_REG(0x006C)  /* 1: USE SC VIC */
-#else
-#define VIC_INT_MASTEREN    VIC_REG(0x0064)  /* 1: IRQ, 2: FIQ     */
-#define VIC_PROTECTION      VIC_REG(0x006C)  /* 1: ENABLE          */
-#define VIC_CONFIG          VIC_REG(0x0068)  /* 1: USE ARM1136 VIC */
-#endif
-
-#define VIC_IRQ_STATUS0     VIC_REG(0x0080)
-#define VIC_IRQ_STATUS1     VIC_REG(0x0084)
-#define VIC_IRQ_STATUS2     VIC_REG(0x0088)
-#define VIC_IRQ_STATUS3     VIC_REG(0x008C)
-#define VIC_FIQ_STATUS0     VIC_REG(0x0090)
-#define VIC_FIQ_STATUS1     VIC_REG(0x0094)
-#define VIC_FIQ_STATUS2     VIC_REG(0x0098)
-#define VIC_FIQ_STATUS3     VIC_REG(0x009C)
-#define VIC_RAW_STATUS0     VIC_REG(0x00A0)
-#define VIC_RAW_STATUS1     VIC_REG(0x00A4)
-#define VIC_RAW_STATUS2     VIC_REG(0x00A8)
-#define VIC_RAW_STATUS3     VIC_REG(0x00AC)
-#define VIC_INT_CLEAR0      VIC_REG(0x00B0)
-#define VIC_INT_CLEAR1      VIC_REG(0x00B4)
-#define VIC_INT_CLEAR2      VIC_REG(0x00B8)
-#define VIC_INT_CLEAR3      VIC_REG(0x00BC)
-#define VIC_SOFTINT0        VIC_REG(0x00C0)
-#define VIC_SOFTINT1        VIC_REG(0x00C4)
-#define VIC_SOFTINT2        VIC_REG(0x00C8)
-#define VIC_SOFTINT3        VIC_REG(0x00CC)
-#define VIC_IRQ_VEC_RD      VIC_REG(0x00D0)  /* pending int # */
-#define VIC_IRQ_VEC_PEND_RD VIC_REG(0x00D4)  /* pending vector addr */
-#define VIC_IRQ_VEC_WR      VIC_REG(0x00D8)
-
-#if defined(CONFIG_ARCH_MSM_SCORPION)
-#define VIC_FIQ_VEC_RD      VIC_REG(0x00DC)
-#define VIC_FIQ_VEC_PEND_RD VIC_REG(0x00E0)
-#define VIC_FIQ_VEC_WR      VIC_REG(0x00E4)
-#define VIC_IRQ_IN_SERVICE  VIC_REG(0x00E8)
-#define VIC_IRQ_IN_STACK    VIC_REG(0x00EC)
-#define VIC_FIQ_IN_SERVICE  VIC_REG(0x00F0)
-#define VIC_FIQ_IN_STACK    VIC_REG(0x00F4)
-#define VIC_TEST_BUS_SEL    VIC_REG(0x00F8)
-#define VIC_IRQ_CTRL_CONFIG VIC_REG(0x00FC)
-#else
-#define VIC_IRQ_IN_SERVICE  VIC_REG(0x00E0)
-#define VIC_IRQ_IN_STACK    VIC_REG(0x00E4)
-#define VIC_TEST_BUS_SEL    VIC_REG(0x00E8)
-#endif
-
-#define VIC_VECTPRIORITY(n) VIC_REG(0x0200+((n) * 4))
-#define VIC_VECTADDR(n)     VIC_REG(0x0400+((n) * 4))
-
-#if defined(CONFIG_ARCH_MSM7X30)
-#define VIC_NUM_REGS	    4
-#else
-#define VIC_NUM_REGS	    2
-#endif
-
-#if VIC_NUM_REGS == 2
-#define DPRINT_REGS(base_reg, format, ...)	      			\
-	printk(KERN_INFO format " %x %x\n", ##__VA_ARGS__,		\
-			readl(base_reg ## 0), readl(base_reg ## 1))
-#define DPRINT_ARRAY(array, format, ...)				\
-	printk(KERN_INFO format " %x %x\n", ##__VA_ARGS__,		\
-			array[0], array[1])
-#elif VIC_NUM_REGS == 4
-#define DPRINT_REGS(base_reg, format, ...) \
-	printk(KERN_INFO format " %x %x %x %x\n", ##__VA_ARGS__,	\
-			readl(base_reg ## 0), readl(base_reg ## 1),	\
-			readl(base_reg ## 2), readl(base_reg ## 3))
-#define DPRINT_ARRAY(array, format, ...)				\
-	printk(KERN_INFO format " %x %x %x %x\n", ##__VA_ARGS__,	\
-			array[0], array[1],				\
-			array[2], array[3])
-#else
-#error "VIC_NUM_REGS set to illegal value"
-#endif
-
-static uint32_t msm_irq_smsm_wake_enable[2];
-static struct {
-	uint32_t int_en[2];
-	uint32_t int_type;
-	uint32_t int_polarity;
-	uint32_t int_select;
-} msm_irq_shadow_reg[VIC_NUM_REGS];
-static uint32_t msm_irq_idle_disable[VIC_NUM_REGS];
-
-#define SMSM_FAKE_IRQ (0xff)
-static uint8_t msm_irq_to_smsm[NR_IRQS] = {
-	[INT_MDDI_EXT] = 1,
-	[INT_MDDI_PRI] = 2,
-	[INT_MDDI_CLIENT] = 3,
-	[INT_USB_OTG] = 4,
-
-	[INT_PWB_I2C] = 5,
-	[INT_SDC1_0] = 6,
-	[INT_SDC1_1] = 7,
-	[INT_SDC2_0] = 8,
-
-	[INT_SDC2_1] = 9,
-	[INT_ADSP_A9_A11] = 10,
-	[INT_UART1] = 11,
-	[INT_UART2] = 12,
-
-	[INT_UART3] = 13,
-	[INT_UART1_RX] = 14,
-	[INT_UART2_RX] = 15,
-	[INT_UART3_RX] = 16,
-
-	[INT_UART1DM_IRQ] = 17,
-	[INT_UART1DM_RX] = 18,
-	[INT_KEYSENSE] = 19,
-#if !defined(CONFIG_ARCH_MSM7X30)
-	[INT_AD_HSSD] = 20,
-#endif
-
-	[INT_NAND_WR_ER_DONE] = 21,
-	[INT_NAND_OP_DONE] = 22,
-	[INT_TCHSCRN1] = 23,
-	[INT_TCHSCRN2] = 24,
-
-	[INT_TCHSCRN_SSBI] = 25,
-	[INT_USB_HS] = 26,
-	[INT_UART2DM_RX] = 27,
-	[INT_UART2DM_IRQ] = 28,
-
-	[INT_SDC4_1] = 29,
-	[INT_SDC4_0] = 30,
-	[INT_SDC3_1] = 31,
-	[INT_SDC3_0] = 32,
-
-	/* fake wakeup interrupts */
-	[INT_GPIO_GROUP1] = SMSM_FAKE_IRQ,
-	[INT_GPIO_GROUP2] = SMSM_FAKE_IRQ,
-	[INT_A9_M2A_0] = SMSM_FAKE_IRQ,
-	[INT_A9_M2A_1] = SMSM_FAKE_IRQ,
-	[INT_A9_M2A_5] = SMSM_FAKE_IRQ,
-	[INT_GP_TIMER_EXP] = SMSM_FAKE_IRQ,
-	[INT_DEBUG_TIMER_EXP] = SMSM_FAKE_IRQ,
-	[INT_ADSP_A11] = SMSM_FAKE_IRQ,
-#ifdef CONFIG_ARCH_QSD8X50
-	[INT_SIRC_0] = SMSM_FAKE_IRQ,
-	[INT_SIRC_1] = SMSM_FAKE_IRQ,
-#endif
-};
-
-static inline void msm_irq_write_all_regs(void __iomem *base, unsigned int val)
-{
-	int i;
-
-	for (i = 0; i < VIC_NUM_REGS; i++)
-		writel(val, base + (i * 4));
-}
-
-static void msm_irq_ack(struct irq_data *d)
-{
-	void __iomem *reg = VIC_INT_TO_REG_ADDR(VIC_INT_CLEAR0, d->irq);
-	writel(1 << (d->irq & 31), reg);
-}
-
-static void msm_irq_mask(struct irq_data *d)
-{
-	void __iomem *reg = VIC_INT_TO_REG_ADDR(VIC_INT_ENCLEAR0, d->irq);
-	unsigned index = VIC_INT_TO_REG_INDEX(d->irq);
-	uint32_t mask = 1UL << (d->irq & 31);
-	int smsm_irq = msm_irq_to_smsm[d->irq];
-
-	msm_irq_shadow_reg[index].int_en[0] &= ~mask;
-	writel(mask, reg);
-	if (smsm_irq == 0)
-		msm_irq_idle_disable[index] &= ~mask;
-	else {
-		mask = 1UL << (smsm_irq - 1);
-		msm_irq_smsm_wake_enable[0] &= ~mask;
-	}
-}
-
-static void msm_irq_unmask(struct irq_data *d)
-{
-	void __iomem *reg = VIC_INT_TO_REG_ADDR(VIC_INT_ENSET0, d->irq);
-	unsigned index = VIC_INT_TO_REG_INDEX(d->irq);
-	uint32_t mask = 1UL << (d->irq & 31);
-	int smsm_irq = msm_irq_to_smsm[d->irq];
-
-	msm_irq_shadow_reg[index].int_en[0] |= mask;
-	writel(mask, reg);
-
-	if (smsm_irq == 0)
-		msm_irq_idle_disable[index] |= mask;
-	else {
-		mask = 1UL << (smsm_irq - 1);
-		msm_irq_smsm_wake_enable[0] |= mask;
-	}
-}
-
-static int msm_irq_set_wake(struct irq_data *d, unsigned int on)
-{
-	unsigned index = VIC_INT_TO_REG_INDEX(d->irq);
-	uint32_t mask = 1UL << (d->irq & 31);
-	int smsm_irq = msm_irq_to_smsm[d->irq];
-
-	if (smsm_irq == 0) {
-		printk(KERN_ERR "msm_irq_set_wake: bad wakeup irq %d\n", d->irq);
-		return -EINVAL;
-	}
-	if (on)
-		msm_irq_shadow_reg[index].int_en[1] |= mask;
-	else
-		msm_irq_shadow_reg[index].int_en[1] &= ~mask;
-
-	if (smsm_irq == SMSM_FAKE_IRQ)
-		return 0;
-
-	mask = 1UL << (smsm_irq - 1);
-	if (on)
-		msm_irq_smsm_wake_enable[1] |= mask;
-	else
-		msm_irq_smsm_wake_enable[1] &= ~mask;
-	return 0;
-}
-
-static int msm_irq_set_type(struct irq_data *d, unsigned int flow_type)
-{
-	void __iomem *treg = VIC_INT_TO_REG_ADDR(VIC_INT_TYPE0, d->irq);
-	void __iomem *preg = VIC_INT_TO_REG_ADDR(VIC_INT_POLARITY0, d->irq);
-	unsigned index = VIC_INT_TO_REG_INDEX(d->irq);
-	int b = 1 << (d->irq & 31);
-	uint32_t polarity;
-	uint32_t type;
-
-	polarity = msm_irq_shadow_reg[index].int_polarity;
-	if (flow_type & (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_LOW))
-		polarity |= b;
-	if (flow_type & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_HIGH))
-		polarity &= ~b;
-	writel(polarity, preg);
-	msm_irq_shadow_reg[index].int_polarity = polarity;
-
-	type = msm_irq_shadow_reg[index].int_type;
-	if (flow_type & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)) {
-		type |= b;
-		__irq_set_handler_locked(d->irq, handle_edge_irq);
-	}
-	if (flow_type & (IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW)) {
-		type &= ~b;
-		__irq_set_handler_locked(d->irq, handle_level_irq);
-	}
-	writel(type, treg);
-	msm_irq_shadow_reg[index].int_type = type;
-	return 0;
-}
-
-static struct irq_chip msm_irq_chip = {
-	.name          = "msm",
-	.irq_disable   = msm_irq_mask,
-	.irq_ack       = msm_irq_ack,
-	.irq_mask      = msm_irq_mask,
-	.irq_unmask    = msm_irq_unmask,
-	.irq_set_wake  = msm_irq_set_wake,
-	.irq_set_type  = msm_irq_set_type,
-};
-
-void __init msm_init_irq(void)
-{
-	unsigned n;
-
-	/* select level interrupts */
-	msm_irq_write_all_regs(VIC_INT_TYPE0, 0);
-
-	/* select highlevel interrupts */
-	msm_irq_write_all_regs(VIC_INT_POLARITY0, 0);
-
-	/* select IRQ for all INTs */
-	msm_irq_write_all_regs(VIC_INT_SELECT0, 0);
-
-	/* disable all INTs */
-	msm_irq_write_all_regs(VIC_INT_EN0, 0);
-
-	/* don't use vic */
-	writel(0, VIC_CONFIG);
-
-	/* enable interrupt controller */
-	writel(3, VIC_INT_MASTEREN);
-
-	for (n = 0; n < NR_MSM_IRQS; n++) {
-		irq_set_chip_and_handler(n, &msm_irq_chip, handle_level_irq);
-		set_irq_flags(n, IRQF_VALID);
-	}
-}
diff --git a/arch/arm/mach-msm/irq.c b/arch/arm/mach-msm/irq.c
deleted file mode 100644
index ea514be390c6..000000000000
--- a/arch/arm/mach-msm/irq.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/* linux/arch/arm/mach-msm/irq.c
- *
- * Copyright (C) 2007 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/init.h>
-#include <linux/module.h>
-#include <linux/sched.h>
-#include <linux/interrupt.h>
-#include <linux/ptrace.h>
-#include <linux/timer.h>
-#include <linux/irq.h>
-#include <linux/io.h>
-
-#include <mach/hardware.h>
-
-#include <mach/msm_iomap.h>
-
-#define VIC_REG(off) (MSM_VIC_BASE + (off))
-
-#define VIC_INT_SELECT0     VIC_REG(0x0000)  /* 1: FIQ, 0: IRQ */
-#define VIC_INT_SELECT1     VIC_REG(0x0004)  /* 1: FIQ, 0: IRQ */
-#define VIC_INT_EN0         VIC_REG(0x0010)
-#define VIC_INT_EN1         VIC_REG(0x0014)
-#define VIC_INT_ENCLEAR0    VIC_REG(0x0020)
-#define VIC_INT_ENCLEAR1    VIC_REG(0x0024)
-#define VIC_INT_ENSET0      VIC_REG(0x0030)
-#define VIC_INT_ENSET1      VIC_REG(0x0034)
-#define VIC_INT_TYPE0       VIC_REG(0x0040)  /* 1: EDGE, 0: LEVEL  */
-#define VIC_INT_TYPE1       VIC_REG(0x0044)  /* 1: EDGE, 0: LEVEL  */
-#define VIC_INT_POLARITY0   VIC_REG(0x0050)  /* 1: NEG, 0: POS */
-#define VIC_INT_POLARITY1   VIC_REG(0x0054)  /* 1: NEG, 0: POS */
-#define VIC_NO_PEND_VAL     VIC_REG(0x0060)
-#define VIC_INT_MASTEREN    VIC_REG(0x0064)  /* 1: IRQ, 2: FIQ     */
-#define VIC_PROTECTION      VIC_REG(0x006C)  /* 1: ENABLE          */
-#define VIC_CONFIG          VIC_REG(0x0068)  /* 1: USE ARM1136 VIC */
-#define VIC_IRQ_STATUS0     VIC_REG(0x0080)
-#define VIC_IRQ_STATUS1     VIC_REG(0x0084)
-#define VIC_FIQ_STATUS0     VIC_REG(0x0090)
-#define VIC_FIQ_STATUS1     VIC_REG(0x0094)
-#define VIC_RAW_STATUS0     VIC_REG(0x00A0)
-#define VIC_RAW_STATUS1     VIC_REG(0x00A4)
-#define VIC_INT_CLEAR0      VIC_REG(0x00B0)
-#define VIC_INT_CLEAR1      VIC_REG(0x00B4)
-#define VIC_SOFTINT0        VIC_REG(0x00C0)
-#define VIC_SOFTINT1        VIC_REG(0x00C4)
-#define VIC_IRQ_VEC_RD      VIC_REG(0x00D0)  /* pending int # */
-#define VIC_IRQ_VEC_PEND_RD VIC_REG(0x00D4)  /* pending vector addr */
-#define VIC_IRQ_VEC_WR      VIC_REG(0x00D8)
-#define VIC_IRQ_IN_SERVICE  VIC_REG(0x00E0)
-#define VIC_IRQ_IN_STACK    VIC_REG(0x00E4)
-#define VIC_TEST_BUS_SEL    VIC_REG(0x00E8)
-
-#define VIC_VECTPRIORITY(n) VIC_REG(0x0200+((n) * 4))
-#define VIC_VECTADDR(n)     VIC_REG(0x0400+((n) * 4))
-
-static void msm_irq_ack(struct irq_data *d)
-{
-	void __iomem *reg = VIC_INT_CLEAR0 + ((d->irq & 32) ? 4 : 0);
-	writel(1 << (d->irq & 31), reg);
-}
-
-static void msm_irq_mask(struct irq_data *d)
-{
-	void __iomem *reg = VIC_INT_ENCLEAR0 + ((d->irq & 32) ? 4 : 0);
-	writel(1 << (d->irq & 31), reg);
-}
-
-static void msm_irq_unmask(struct irq_data *d)
-{
-	void __iomem *reg = VIC_INT_ENSET0 + ((d->irq & 32) ? 4 : 0);
-	writel(1 << (d->irq & 31), reg);
-}
-
-static int msm_irq_set_wake(struct irq_data *d, unsigned int on)
-{
-	return -EINVAL;
-}
-
-static int msm_irq_set_type(struct irq_data *d, unsigned int flow_type)
-{
-	void __iomem *treg = VIC_INT_TYPE0 + ((d->irq & 32) ? 4 : 0);
-	void __iomem *preg = VIC_INT_POLARITY0 + ((d->irq & 32) ? 4 : 0);
-	int b = 1 << (d->irq & 31);
-
-	if (flow_type & (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_LOW))
-		writel(readl(preg) | b, preg);
-	if (flow_type & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_HIGH))
-		writel(readl(preg) & (~b), preg);
-
-	if (flow_type & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)) {
-		writel(readl(treg) | b, treg);
-		__irq_set_handler_locked(d->irq, handle_edge_irq);
-	}
-	if (flow_type & (IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW)) {
-		writel(readl(treg) & (~b), treg);
-		__irq_set_handler_locked(d->irq, handle_level_irq);
-	}
-	return 0;
-}
-
-static struct irq_chip msm_irq_chip = {
-	.name          = "msm",
-	.irq_ack       = msm_irq_ack,
-	.irq_mask      = msm_irq_mask,
-	.irq_unmask    = msm_irq_unmask,
-	.irq_set_wake  = msm_irq_set_wake,
-	.irq_set_type  = msm_irq_set_type,
-};
-
-void __init msm_init_irq(void)
-{
-	unsigned n;
-
-	/* select level interrupts */
-	writel(0, VIC_INT_TYPE0);
-	writel(0, VIC_INT_TYPE1);
-
-	/* select highlevel interrupts */
-	writel(0, VIC_INT_POLARITY0);
-	writel(0, VIC_INT_POLARITY1);
-
-	/* select IRQ for all INTs */
-	writel(0, VIC_INT_SELECT0);
-	writel(0, VIC_INT_SELECT1);
-
-	/* disable all INTs */
-	writel(0, VIC_INT_EN0);
-	writel(0, VIC_INT_EN1);
-
-	/* don't use 1136 vic */
-	writel(0, VIC_CONFIG);
-
-	/* enable interrupt controller */
-	writel(1, VIC_INT_MASTEREN);
-
-	for (n = 0; n < NR_MSM_IRQS; n++) {
-		irq_set_chip_and_handler(n, &msm_irq_chip, handle_level_irq);
-		set_irq_flags(n, IRQF_VALID);
-	}
-}
diff --git a/arch/arm/mach-msm/last_radio_log.c b/arch/arm/mach-msm/last_radio_log.c
deleted file mode 100644
index 9c392a29fc7e..000000000000
--- a/arch/arm/mach-msm/last_radio_log.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/* arch/arm/mach-msm/last_radio_log.c
- *
- * Extract the log from a modem crash though SMEM
- *
- * Copyright (C) 2007 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/kernel.h>
-#include <linux/module.h>
-#include <linux/fs.h>
-#include <linux/proc_fs.h>
-#include <linux/uaccess.h>
-
-#include "smd_private.h"
-
-static void *radio_log_base;
-static size_t radio_log_size;
-
-extern void *smem_item(unsigned id, unsigned *size);
-
-static ssize_t last_radio_log_read(struct file *file, char __user *buf,
-			size_t len, loff_t *offset)
-{
-	return simple_read_from_buffer(buf, len, offset,
-				radio_log_base, radio_log_size);
-}
-
-static struct file_operations last_radio_log_fops = {
-	.read = last_radio_log_read,
-	.llseek = default_llseek,
-};
-
-void msm_init_last_radio_log(struct module *owner)
-{
-	struct proc_dir_entry *entry;
-
-	if (last_radio_log_fops.owner) {
-		pr_err("%s: already claimed\n", __func__);
-		return;
-	}
-
-	radio_log_base = smem_item(SMEM_CLKREGIM_BSP, &radio_log_size);
-	if (!radio_log_base) {
-		pr_err("%s: could not retrieve SMEM_CLKREGIM_BSP\n", __func__);
-		return;
-	}
-
-	entry = proc_create("last_radio_log", S_IRUGO, NULL,
-				&last_radio_log_fops);
-	if (!entry) {
-		pr_err("%s: could not create proc entry for radio log\n",
-				__func__);
-		return;
-	}
-
-	pr_err("%s: last radio log is %d bytes long\n", __func__,
-		radio_log_size);
-	last_radio_log_fops.owner = owner;
-	proc_set_size(entry, radio_log_size);
-}
-EXPORT_SYMBOL(msm_init_last_radio_log);
diff --git a/arch/arm/mach-msm/proc_comm.c b/arch/arm/mach-msm/proc_comm.c
deleted file mode 100644
index 507f5ca80697..000000000000
--- a/arch/arm/mach-msm/proc_comm.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/* arch/arm/mach-msm/proc_comm.c
- *
- * Copyright (C) 2007-2008 Google, Inc.
- * Author: Brian Swetland <swetland@google.com>
- *
- * 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/delay.h>
-#include <linux/errno.h>
-#include <linux/io.h>
-#include <linux/spinlock.h>
-#include <mach/msm_iomap.h>
-
-#include "proc_comm.h"
-
-static inline void msm_a2m_int(uint32_t irq)
-{
-#if defined(CONFIG_ARCH_MSM7X30)
-	writel(1 << irq, MSM_GCC_BASE + 0x8);
-#else
-	writel(1, MSM_CSR_BASE + 0x400 + (irq * 4));
-#endif
-}
-
-static inline void notify_other_proc_comm(void)
-{
-	msm_a2m_int(6);
-}
-
-#define APP_COMMAND 0x00
-#define APP_STATUS  0x04
-#define APP_DATA1   0x08
-#define APP_DATA2   0x0C
-
-#define MDM_COMMAND 0x10
-#define MDM_STATUS  0x14
-#define MDM_DATA1   0x18
-#define MDM_DATA2   0x1C
-
-static DEFINE_SPINLOCK(proc_comm_lock);
-
-/* The higher level SMD support will install this to
- * provide a way to check for and handle modem restart.
- */
-int (*msm_check_for_modem_crash)(void);
-
-/* Poll for a state change, checking for possible
- * modem crashes along the way (so we don't wait
- * forever while the ARM9 is blowing up).
- *
- * Return an error in the event of a modem crash and
- * restart so the msm_proc_comm() routine can restart
- * the operation from the beginning.
- */
-static int proc_comm_wait_for(void __iomem *addr, unsigned value)
-{
-	for (;;) {
-		if (readl(addr) == value)
-			return 0;
-
-		if (msm_check_for_modem_crash)
-			if (msm_check_for_modem_crash())
-				return -EAGAIN;
-	}
-}
-
-int msm_proc_comm(unsigned cmd, unsigned *data1, unsigned *data2)
-{
-	void __iomem *base = MSM_SHARED_RAM_BASE;
-	unsigned long flags;
-	int ret;
-
-	spin_lock_irqsave(&proc_comm_lock, flags);
-
-	for (;;) {
-		if (proc_comm_wait_for(base + MDM_STATUS, PCOM_READY))
-			continue;
-
-		writel(cmd, base + APP_COMMAND);
-		writel(data1 ? *data1 : 0, base + APP_DATA1);
-		writel(data2 ? *data2 : 0, base + APP_DATA2);
-
-		notify_other_proc_comm();
-
-		if (proc_comm_wait_for(base + APP_COMMAND, PCOM_CMD_DONE))
-			continue;
-
-		if (readl(base + APP_STATUS) != PCOM_CMD_FAIL) {
-			if (data1)
-				*data1 = readl(base + APP_DATA1);
-			if (data2)
-				*data2 = readl(base + APP_DATA2);
-			ret = 0;
-		} else {
-			ret = -EIO;
-		}
-		break;
-	}
-
-	writel(PCOM_CMD_IDLE, base + APP_COMMAND);
-
-	spin_unlock_irqrestore(&proc_comm_lock, flags);
-
-	return ret;
-}
-
-/*
- * We need to wait for the ARM9 to at least partially boot
- * up before we can continue. Since the ARM9 does resource
- * allocation, if we dont' wait we could end up crashing or in
- * and unknown state. This function should be called early to
- * wait on the ARM9.
- */
-void proc_comm_boot_wait(void)
-{
-	void __iomem *base = MSM_SHARED_RAM_BASE;
- 
-	proc_comm_wait_for(base + MDM_STATUS, PCOM_READY);
- 
-}
diff --git a/arch/arm/mach-msm/proc_comm.h b/arch/arm/mach-msm/proc_comm.h
deleted file mode 100644
index e8d043a0e990..000000000000
--- a/arch/arm/mach-msm/proc_comm.h
+++ /dev/null
@@ -1,258 +0,0 @@
-/* arch/arm/mach-msm/proc_comm.h
- *
- * Copyright (c) 2007 QUALCOMM Incorporated
- *
- * 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.
- *
- */
-
-#ifndef _ARCH_ARM_MACH_MSM_PROC_COMM_H_
-#define _ARCH_ARM_MACH_MSM_PROC_COMM_H_
-
-#include <linux/init.h>
-
-enum {
-	PCOM_CMD_IDLE = 0x0,
-	PCOM_CMD_DONE,
-	PCOM_RESET_APPS,
-	PCOM_RESET_CHIP,
-	PCOM_CONFIG_NAND_MPU,
-	PCOM_CONFIG_USB_CLKS,
-	PCOM_GET_POWER_ON_STATUS,
-	PCOM_GET_WAKE_UP_STATUS,
-	PCOM_GET_BATT_LEVEL,
-	PCOM_CHG_IS_CHARGING,
-	PCOM_POWER_DOWN,
-	PCOM_USB_PIN_CONFIG,
-	PCOM_USB_PIN_SEL,
-	PCOM_SET_RTC_ALARM,
-	PCOM_NV_READ,
-	PCOM_NV_WRITE,
-	PCOM_GET_UUID_HIGH,
-	PCOM_GET_UUID_LOW,
-	PCOM_GET_HW_ENTROPY,
-	PCOM_RPC_GPIO_TLMM_CONFIG_REMOTE,
-	PCOM_CLKCTL_RPC_ENABLE,
-	PCOM_CLKCTL_RPC_DISABLE,
-	PCOM_CLKCTL_RPC_RESET,
-	PCOM_CLKCTL_RPC_SET_FLAGS,
-	PCOM_CLKCTL_RPC_SET_RATE,
-	PCOM_CLKCTL_RPC_MIN_RATE,
-	PCOM_CLKCTL_RPC_MAX_RATE,
-	PCOM_CLKCTL_RPC_RATE,
-	PCOM_CLKCTL_RPC_PLL_REQUEST,
-	PCOM_CLKCTL_RPC_ENABLED,
-	PCOM_VREG_SWITCH,
-	PCOM_VREG_SET_LEVEL,
-	PCOM_GPIO_TLMM_CONFIG_GROUP,
-	PCOM_GPIO_TLMM_UNCONFIG_GROUP,
-	PCOM_NV_WRITE_BYTES_4_7,
-	PCOM_CONFIG_DISP,
-	PCOM_GET_FTM_BOOT_COUNT,
-	PCOM_RPC_GPIO_TLMM_CONFIG_EX,
-	PCOM_PM_MPP_CONFIG,
-	PCOM_GPIO_IN,
-	PCOM_GPIO_OUT,
-	PCOM_RESET_MODEM,
-	PCOM_RESET_CHIP_IMM,
-	PCOM_PM_VID_EN,
-	PCOM_VREG_PULLDOWN,
-	PCOM_GET_MODEM_VERSION,
-	PCOM_CLK_REGIME_SEC_RESET,
-	PCOM_CLK_REGIME_SEC_RESET_ASSERT,
-	PCOM_CLK_REGIME_SEC_RESET_DEASSERT,
-	PCOM_CLK_REGIME_SEC_PLL_REQUEST_WRP,
-	PCOM_CLK_REGIME_SEC_ENABLE,
-	PCOM_CLK_REGIME_SEC_DISABLE,
-	PCOM_CLK_REGIME_SEC_IS_ON,
-	PCOM_CLK_REGIME_SEC_SEL_CLK_INV,
-	PCOM_CLK_REGIME_SEC_SEL_CLK_SRC,
-	PCOM_CLK_REGIME_SEC_SEL_CLK_DIV,
-	PCOM_CLK_REGIME_SEC_ICODEC_CLK_ENABLE,
-	PCOM_CLK_REGIME_SEC_ICODEC_CLK_DISABLE,
-	PCOM_CLK_REGIME_SEC_SEL_SPEED,
-	PCOM_CLK_REGIME_SEC_CONFIG_GP_CLK_WRP,
-	PCOM_CLK_REGIME_SEC_CONFIG_MDH_CLK_WRP,
-	PCOM_CLK_REGIME_SEC_USB_XTAL_ON,
-	PCOM_CLK_REGIME_SEC_USB_XTAL_OFF,
-	PCOM_CLK_REGIME_SEC_SET_QDSP_DME_MODE,
-	PCOM_CLK_REGIME_SEC_SWITCH_ADSP_CLK,
-	PCOM_CLK_REGIME_SEC_GET_MAX_ADSP_CLK_KHZ,
-	PCOM_CLK_REGIME_SEC_GET_I2C_CLK_KHZ,
-	PCOM_CLK_REGIME_SEC_MSM_GET_CLK_FREQ_KHZ,
-	PCOM_CLK_REGIME_SEC_SEL_VFE_SRC,
-	PCOM_CLK_REGIME_SEC_MSM_SEL_CAMCLK,
-	PCOM_CLK_REGIME_SEC_MSM_SEL_LCDCLK,
-	PCOM_CLK_REGIME_SEC_VFE_RAIL_OFF,
-	PCOM_CLK_REGIME_SEC_VFE_RAIL_ON,
-	PCOM_CLK_REGIME_SEC_GRP_RAIL_OFF,
-	PCOM_CLK_REGIME_SEC_GRP_RAIL_ON,
-	PCOM_CLK_REGIME_SEC_VDC_RAIL_OFF,
-	PCOM_CLK_REGIME_SEC_VDC_RAIL_ON,
-	PCOM_CLK_REGIME_SEC_LCD_CTRL,
-	PCOM_CLK_REGIME_SEC_REGISTER_FOR_CPU_RESOURCE,
-	PCOM_CLK_REGIME_SEC_DEREGISTER_FOR_CPU_RESOURCE,
-	PCOM_CLK_REGIME_SEC_RESOURCE_REQUEST_WRP,
-	PCOM_CLK_REGIME_MSM_SEC_SEL_CLK_OWNER,
-	PCOM_CLK_REGIME_SEC_DEVMAN_REQUEST_WRP,
-	PCOM_GPIO_CONFIG,
-	PCOM_GPIO_CONFIGURE_GROUP,
-	PCOM_GPIO_TLMM_SET_PORT,
-	PCOM_GPIO_TLMM_CONFIG_EX,
-	PCOM_SET_FTM_BOOT_COUNT,
-	PCOM_RESERVED0,
-	PCOM_RESERVED1,
-	PCOM_CUSTOMER_CMD1,
-	PCOM_CUSTOMER_CMD2,
-	PCOM_CUSTOMER_CMD3,
-	PCOM_CLK_REGIME_ENTER_APPSBL_CHG_MODE,
-	PCOM_CLK_REGIME_EXIT_APPSBL_CHG_MODE,
-	PCOM_CLK_REGIME_SEC_RAIL_DISABLE,
-	PCOM_CLK_REGIME_SEC_RAIL_ENABLE,
-	PCOM_CLK_REGIME_SEC_RAIL_CONTROL,
-	PCOM_SET_SW_WATCHDOG_STATE,
-	PCOM_PM_MPP_CONFIG_DIGITAL_INPUT,
-	PCOM_PM_MPP_CONFIG_I_SINK,
-	PCOM_RESERVED_101,
-	PCOM_MSM_HSUSB_PHY_RESET,
-	PCOM_GET_BATT_MV_LEVEL,
-	PCOM_CHG_USB_IS_PC_CONNECTED,
-	PCOM_CHG_USB_IS_CHARGER_CONNECTED,
-	PCOM_CHG_USB_IS_DISCONNECTED,
-	PCOM_CHG_USB_IS_AVAILABLE,
-	PCOM_CLK_REGIME_SEC_MSM_SEL_FREQ,
-	PCOM_CLK_REGIME_SEC_SET_PCLK_AXI_POLICY,
-	PCOM_CLKCTL_RPC_RESET_ASSERT,
-	PCOM_CLKCTL_RPC_RESET_DEASSERT,
-	PCOM_CLKCTL_RPC_RAIL_ON,
-	PCOM_CLKCTL_RPC_RAIL_OFF,
-	PCOM_CLKCTL_RPC_RAIL_ENABLE,
-	PCOM_CLKCTL_RPC_RAIL_DISABLE,
-	PCOM_CLKCTL_RPC_RAIL_CONTROL,
-	PCOM_CLKCTL_RPC_MIN_MSMC1,
-	PCOM_NUM_CMDS,
-};
-
-enum {
-	PCOM_INVALID_STATUS = 0x0,
-	PCOM_READY,
-	PCOM_CMD_RUNNING,
-	PCOM_CMD_SUCCESS,
-	PCOM_CMD_FAIL,
-	PCOM_CMD_FAIL_FALSE_RETURNED,
-	PCOM_CMD_FAIL_CMD_OUT_OF_BOUNDS_SERVER,
-	PCOM_CMD_FAIL_CMD_OUT_OF_BOUNDS_CLIENT,
-	PCOM_CMD_FAIL_CMD_UNREGISTERED,
-	PCOM_CMD_FAIL_CMD_LOCKED,
-	PCOM_CMD_FAIL_SERVER_NOT_YET_READY,
-	PCOM_CMD_FAIL_BAD_DESTINATION,
-	PCOM_CMD_FAIL_SERVER_RESET,
-	PCOM_CMD_FAIL_SMSM_NOT_INIT,
-	PCOM_CMD_FAIL_PROC_COMM_BUSY,
-	PCOM_CMD_FAIL_PROC_COMM_NOT_INIT,
-
-};
-
-/* List of VREGs that support the Pull Down Resistor setting. */
-enum vreg_pdown_id {
-	PM_VREG_PDOWN_MSMA_ID,
-	PM_VREG_PDOWN_MSMP_ID,
-	PM_VREG_PDOWN_MSME1_ID,	/* Not supported in Panoramix */
-	PM_VREG_PDOWN_MSMC1_ID,	/* Not supported in PM6620 */
-	PM_VREG_PDOWN_MSMC2_ID,	/* Supported in PM7500 only */
-	PM_VREG_PDOWN_GP3_ID,	/* Supported in PM7500 only */
-	PM_VREG_PDOWN_MSME2_ID,	/* Supported in PM7500 and Panoramix only */
-	PM_VREG_PDOWN_GP4_ID,	/* Supported in PM7500 only */
-	PM_VREG_PDOWN_GP1_ID,	/* Supported in PM7500 only */
-	PM_VREG_PDOWN_TCXO_ID,
-	PM_VREG_PDOWN_PA_ID,
-	PM_VREG_PDOWN_RFTX_ID,
-	PM_VREG_PDOWN_RFRX1_ID,
-	PM_VREG_PDOWN_RFRX2_ID,
-	PM_VREG_PDOWN_SYNT_ID,
-	PM_VREG_PDOWN_WLAN_ID,
-	PM_VREG_PDOWN_USB_ID,
-	PM_VREG_PDOWN_MMC_ID,
-	PM_VREG_PDOWN_RUIM_ID,
-	PM_VREG_PDOWN_MSMC0_ID,	/* Supported in PM6610 only */
-	PM_VREG_PDOWN_GP2_ID,	/* Supported in PM7500 only */
-	PM_VREG_PDOWN_GP5_ID,	/* Supported in PM7500 only */
-	PM_VREG_PDOWN_GP6_ID,	/* Supported in PM7500 only */
-	PM_VREG_PDOWN_RF_ID,
-	PM_VREG_PDOWN_RF_VCO_ID,
-	PM_VREG_PDOWN_MPLL_ID,
-	PM_VREG_PDOWN_S2_ID,
-	PM_VREG_PDOWN_S3_ID,
-	PM_VREG_PDOWN_RFUBM_ID,
-
-	/* new for HAN */
-	PM_VREG_PDOWN_RF1_ID,
-	PM_VREG_PDOWN_RF2_ID,
-	PM_VREG_PDOWN_RFA_ID,
-	PM_VREG_PDOWN_CDC2_ID,
-	PM_VREG_PDOWN_RFTX2_ID,
-	PM_VREG_PDOWN_USIM_ID,
-	PM_VREG_PDOWN_USB2P6_ID,
-	PM_VREG_PDOWN_USB3P3_ID,
-	PM_VREG_PDOWN_INVALID_ID,
-
-	/* backward compatible enums only */
-	PM_VREG_PDOWN_CAM_ID = PM_VREG_PDOWN_GP1_ID,
-	PM_VREG_PDOWN_MDDI_ID = PM_VREG_PDOWN_GP2_ID,
-	PM_VREG_PDOWN_RUIM2_ID = PM_VREG_PDOWN_GP3_ID,
-	PM_VREG_PDOWN_AUX_ID = PM_VREG_PDOWN_GP4_ID,
-	PM_VREG_PDOWN_AUX2_ID = PM_VREG_PDOWN_GP5_ID,
-	PM_VREG_PDOWN_BT_ID = PM_VREG_PDOWN_GP6_ID,
-
-	PM_VREG_PDOWN_MSME_ID = PM_VREG_PDOWN_MSME1_ID,
-	PM_VREG_PDOWN_MSMC_ID = PM_VREG_PDOWN_MSMC1_ID,
-	PM_VREG_PDOWN_RFA1_ID = PM_VREG_PDOWN_RFRX2_ID,
-	PM_VREG_PDOWN_RFA2_ID = PM_VREG_PDOWN_RFTX2_ID,
-	PM_VREG_PDOWN_XO_ID = PM_VREG_PDOWN_TCXO_ID
-};
-
-enum {
-	PCOM_CLKRGM_APPS_RESET_USB_PHY	= 34,
-	PCOM_CLKRGM_APPS_RESET_USBH	= 37,
-};
-
-/* gpio info for PCOM_RPC_GPIO_TLMM_CONFIG_EX */
-
-#define GPIO_ENABLE	0
-#define GPIO_DISABLE	1
-
-#define GPIO_INPUT	0
-#define GPIO_OUTPUT	1
-
-#define GPIO_NO_PULL	0
-#define GPIO_PULL_DOWN	1
-#define GPIO_KEEPER	2
-#define GPIO_PULL_UP	3
-
-#define GPIO_2MA	0
-#define GPIO_4MA	1
-#define GPIO_6MA	2
-#define GPIO_8MA	3
-#define GPIO_10MA	4
-#define GPIO_12MA	5
-#define GPIO_14MA	6
-#define GPIO_16MA	7
-
-#define PCOM_GPIO_CFG(gpio, func, dir, pull, drvstr) \
-		((((gpio) & 0x3FF) << 4)	| \
-		((func) & 0xf)			| \
-		(((dir) & 0x1) << 14)		| \
-		(((pull) & 0x3) << 15)		| \
-		(((drvstr) & 0xF) << 17))
-
-int msm_proc_comm(unsigned cmd, unsigned *data1, unsigned *data2);
-void proc_comm_boot_wait(void);
-
-#endif
diff --git a/arch/arm/mach-msm/sirc.c b/arch/arm/mach-msm/sirc.c
deleted file mode 100644
index 689e78c95f38..000000000000
--- a/arch/arm/mach-msm/sirc.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/* Copyright (c) 2008-2009, Code Aurora Forum. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- *
- */
-
-#include <linux/io.h>
-#include <linux/irq.h>
-#include <linux/interrupt.h>
-#include <asm/irq.h>
-
-static unsigned int int_enable;
-static unsigned int wake_enable;
-
-static struct sirc_regs_t sirc_regs = {
-	.int_enable       = SPSS_SIRC_INT_ENABLE,
-	.int_enable_clear = SPSS_SIRC_INT_ENABLE_CLEAR,
-	.int_enable_set   = SPSS_SIRC_INT_ENABLE_SET,
-	.int_type         = SPSS_SIRC_INT_TYPE,
-	.int_polarity     = SPSS_SIRC_INT_POLARITY,
-	.int_clear        = SPSS_SIRC_INT_CLEAR,
-};
-
-static struct sirc_cascade_regs sirc_reg_table[] = {
-	{
-		.int_status  = SPSS_SIRC_IRQ_STATUS,
-		.cascade_irq = INT_SIRC_0,
-	}
-};
-
-/* Mask off the given interrupt. Keep the int_enable mask in sync with
-   the enable reg, so it can be restored after power collapse. */
-static void sirc_irq_mask(struct irq_data *d)
-{
-	unsigned int mask;
-
-	mask = 1 << (d->irq - FIRST_SIRC_IRQ);
-	writel(mask, sirc_regs.int_enable_clear);
-	int_enable &= ~mask;
-	return;
-}
-
-/* Unmask the given interrupt. Keep the int_enable mask in sync with
-   the enable reg, so it can be restored after power collapse. */
-static void sirc_irq_unmask(struct irq_data *d)
-{
-	unsigned int mask;
-
-	mask = 1 << (d->irq - FIRST_SIRC_IRQ);
-	writel(mask, sirc_regs.int_enable_set);
-	int_enable |= mask;
-	return;
-}
-
-static void sirc_irq_ack(struct irq_data *d)
-{
-	unsigned int mask;
-
-	mask = 1 << (d->irq - FIRST_SIRC_IRQ);
-	writel(mask, sirc_regs.int_clear);
-	return;
-}
-
-static int sirc_irq_set_wake(struct irq_data *d, unsigned int on)
-{
-	unsigned int mask;
-
-	/* Used to set the interrupt enable mask during power collapse. */
-	mask = 1 << (d->irq - FIRST_SIRC_IRQ);
-	if (on)
-		wake_enable |= mask;
-	else
-		wake_enable &= ~mask;
-
-	return 0;
-}
-
-static int sirc_irq_set_type(struct irq_data *d, unsigned int flow_type)
-{
-	unsigned int mask;
-	unsigned int val;
-
-	mask = 1 << (d->irq - FIRST_SIRC_IRQ);
-	val = readl(sirc_regs.int_polarity);
-
-	if (flow_type & (IRQF_TRIGGER_LOW | IRQF_TRIGGER_FALLING))
-		val |= mask;
-	else
-		val &= ~mask;
-
-	writel(val, sirc_regs.int_polarity);
-
-	val = readl(sirc_regs.int_type);
-	if (flow_type & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)) {
-		val |= mask;
-		__irq_set_handler_locked(d->irq, handle_edge_irq);
-	} else {
-		val &= ~mask;
-		__irq_set_handler_locked(d->irq, handle_level_irq);
-	}
-
-	writel(val, sirc_regs.int_type);
-
-	return 0;
-}
-
-/* Finds the pending interrupt on the passed cascade irq and redrives it */
-static void sirc_irq_handler(unsigned int irq, struct irq_desc *desc)
-{
-	unsigned int reg = 0;
-	unsigned int sirq;
-	unsigned int status;
-
-	while ((reg < ARRAY_SIZE(sirc_reg_table)) &&
-		(sirc_reg_table[reg].cascade_irq != irq))
-		reg++;
-
-	status = readl(sirc_reg_table[reg].int_status);
-	status &= SIRC_MASK;
-	if (status == 0)
-		return;
-
-	for (sirq = 0;
-	     (sirq < NR_SIRC_IRQS) && ((status & (1U << sirq)) == 0);
-	     sirq++)
-		;
-	generic_handle_irq(sirq+FIRST_SIRC_IRQ);
-
-	desc->irq_data.chip->irq_ack(&desc->irq_data);
-}
-
-static struct irq_chip sirc_irq_chip = {
-	.name          = "sirc",
-	.irq_ack       = sirc_irq_ack,
-	.irq_mask      = sirc_irq_mask,
-	.irq_unmask    = sirc_irq_unmask,
-	.irq_set_wake  = sirc_irq_set_wake,
-	.irq_set_type  = sirc_irq_set_type,
-};
-
-void __init msm_init_sirc(void)
-{
-	int i;
-
-	int_enable = 0;
-	wake_enable = 0;
-
-	for (i = FIRST_SIRC_IRQ; i < LAST_SIRC_IRQ; i++) {
-		irq_set_chip_and_handler(i, &sirc_irq_chip, handle_edge_irq);
-		set_irq_flags(i, IRQF_VALID);
-	}
-
-	for (i = 0; i < ARRAY_SIZE(sirc_reg_table); i++) {
-		irq_set_chained_handler(sirc_reg_table[i].cascade_irq,
-					sirc_irq_handler);
-		irq_set_irq_wake(sirc_reg_table[i].cascade_irq, 1);
-	}
-	return;
-}
-
diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c
deleted file mode 100644
index 7550f5a08956..000000000000
--- a/arch/arm/mach-msm/smd.c
+++ /dev/null
@@ -1,1034 +0,0 @@
-/* arch/arm/mach-msm/smd.c
- *
- * Copyright (C) 2007 Google, Inc.
- * Author: Brian Swetland <swetland@google.com>
- *
- * 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.
- *
- */
-
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
-#include <linux/platform_device.h>
-#include <linux/module.h>
-#include <linux/fs.h>
-#include <linux/cdev.h>
-#include <linux/device.h>
-#include <linux/wait.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <linux/list.h>
-#include <linux/slab.h>
-#include <linux/debugfs.h>
-#include <linux/delay.h>
-
-#include <mach/msm_smd.h>
-
-#include "smd_private.h"
-#include "proc_comm.h"
-
-#if defined(CONFIG_ARCH_QSD8X50)
-#define CONFIG_QDSP6 1
-#endif
-
-#define MODULE_NAME "msm_smd"
-
-enum {
-	MSM_SMD_DEBUG = 1U << 0,
-	MSM_SMSM_DEBUG = 1U << 0,
-};
-
-static int msm_smd_debug_mask;
-
-struct shared_info {
-	int ready;
-	void __iomem *state;
-};
-
-static unsigned dummy_state[SMSM_STATE_COUNT];
-
-static struct shared_info smd_info = {
-	/* FIXME: not a real __iomem pointer */
-	.state = &dummy_state,
-};
-
-module_param_named(debug_mask, msm_smd_debug_mask,
-		   int, S_IRUGO | S_IWUSR | S_IWGRP);
-
-static unsigned last_heap_free = 0xffffffff;
-
-static inline void notify_other_smsm(void)
-{
-	msm_a2m_int(5);
-#ifdef CONFIG_QDSP6
-	msm_a2m_int(8);
-#endif
-}
-
-static inline void notify_modem_smd(void)
-{
-	msm_a2m_int(0);
-}
-
-static inline void notify_dsp_smd(void)
-{
-	msm_a2m_int(8);
-}
-
-static void smd_diag(void)
-{
-	char *x;
-
-	x = smem_find(ID_DIAG_ERR_MSG, SZ_DIAG_ERR_MSG);
-	if (x != 0) {
-		x[SZ_DIAG_ERR_MSG - 1] = 0;
-		pr_debug("DIAG '%s'\n", x);
-	}
-}
-
-/* call when SMSM_RESET flag is set in the A9's smsm_state */
-static void handle_modem_crash(void)
-{
-	pr_err("ARM9 has CRASHED\n");
-	smd_diag();
-
-	/* in this case the modem or watchdog should reboot us */
-	for (;;)
-		;
-}
-
-uint32_t raw_smsm_get_state(enum smsm_state_item item)
-{
-	return readl(smd_info.state + item * 4);
-}
-
-static int check_for_modem_crash(void)
-{
-	if (raw_smsm_get_state(SMSM_STATE_MODEM) & SMSM_RESET) {
-		handle_modem_crash();
-		return -1;
-	}
-	return 0;
-}
-
-/* the spinlock is used to synchronize between the
- * irq handler and code that mutates the channel
- * list or fiddles with channel state
- */
-DEFINE_SPINLOCK(smd_lock);
-DEFINE_SPINLOCK(smem_lock);
-
-/* the mutex is used during open() and close()
- * operations to avoid races while creating or
- * destroying smd_channel structures
- */
-static DEFINE_MUTEX(smd_creation_mutex);
-
-static int smd_initialized;
-
-LIST_HEAD(smd_ch_closed_list);
-LIST_HEAD(smd_ch_list_modem);
-LIST_HEAD(smd_ch_list_dsp);
-
-static unsigned char smd_ch_allocated[64];
-static struct work_struct probe_work;
-
-/* how many bytes are available for reading */
-static int smd_stream_read_avail(struct smd_channel *ch)
-{
-	return (ch->recv->head - ch->recv->tail) & ch->fifo_mask;
-}
-
-/* how many bytes we are free to write */
-static int smd_stream_write_avail(struct smd_channel *ch)
-{
-	return ch->fifo_mask -
-		((ch->send->head - ch->send->tail) & ch->fifo_mask);
-}
-
-static int smd_packet_read_avail(struct smd_channel *ch)
-{
-	if (ch->current_packet) {
-		int n = smd_stream_read_avail(ch);
-		if (n > ch->current_packet)
-			n = ch->current_packet;
-		return n;
-	} else {
-		return 0;
-	}
-}
-
-static int smd_packet_write_avail(struct smd_channel *ch)
-{
-	int n = smd_stream_write_avail(ch);
-	return n > SMD_HEADER_SIZE ? n - SMD_HEADER_SIZE : 0;
-}
-
-static int ch_is_open(struct smd_channel *ch)
-{
-	return (ch->recv->state == SMD_SS_OPENED) &&
-		(ch->send->state == SMD_SS_OPENED);
-}
-
-/* provide a pointer and length to readable data in the fifo */
-static unsigned ch_read_buffer(struct smd_channel *ch, void **ptr)
-{
-	unsigned head = ch->recv->head;
-	unsigned tail = ch->recv->tail;
-	*ptr = (void *) (ch->recv_data + tail);
-
-	if (tail <= head)
-		return head - tail;
-	else
-		return ch->fifo_size - tail;
-}
-
-/* advance the fifo read pointer after data from ch_read_buffer is consumed */
-static void ch_read_done(struct smd_channel *ch, unsigned count)
-{
-	BUG_ON(count > smd_stream_read_avail(ch));
-	ch->recv->tail = (ch->recv->tail + count) & ch->fifo_mask;
-	ch->send->fTAIL = 1;
-}
-
-/* basic read interface to ch_read_{buffer,done} used
- * by smd_*_read() and update_packet_state()
- * will read-and-discard if the _data pointer is null
- */
-static int ch_read(struct smd_channel *ch, void *_data, int len)
-{
-	void *ptr;
-	unsigned n;
-	unsigned char *data = _data;
-	int orig_len = len;
-
-	while (len > 0) {
-		n = ch_read_buffer(ch, &ptr);
-		if (n == 0)
-			break;
-
-		if (n > len)
-			n = len;
-		if (_data)
-			memcpy(data, ptr, n);
-
-		data += n;
-		len -= n;
-		ch_read_done(ch, n);
-	}
-
-	return orig_len - len;
-}
-
-static void update_stream_state(struct smd_channel *ch)
-{
-	/* streams have no special state requiring updating */
-}
-
-static void update_packet_state(struct smd_channel *ch)
-{
-	unsigned hdr[5];
-	int r;
-
-	/* can't do anything if we're in the middle of a packet */
-	if (ch->current_packet != 0)
-		return;
-
-	/* don't bother unless we can get the full header */
-	if (smd_stream_read_avail(ch) < SMD_HEADER_SIZE)
-		return;
-
-	r = ch_read(ch, hdr, SMD_HEADER_SIZE);
-	BUG_ON(r != SMD_HEADER_SIZE);
-
-	ch->current_packet = hdr[0];
-}
-
-/* provide a pointer and length to next free space in the fifo */
-static unsigned ch_write_buffer(struct smd_channel *ch, void **ptr)
-{
-	unsigned head = ch->send->head;
-	unsigned tail = ch->send->tail;
-	*ptr = (void *) (ch->send_data + head);
-
-	if (head < tail) {
-		return tail - head - 1;
-	} else {
-		if (tail == 0)
-			return ch->fifo_size - head - 1;
-		else
-			return ch->fifo_size - head;
-	}
-}
-
-/* advace the fifo write pointer after freespace
- * from ch_write_buffer is filled
- */
-static void ch_write_done(struct smd_channel *ch, unsigned count)
-{
-	BUG_ON(count > smd_stream_write_avail(ch));
-	ch->send->head = (ch->send->head + count) & ch->fifo_mask;
-	ch->send->fHEAD = 1;
-}
-
-static void ch_set_state(struct smd_channel *ch, unsigned n)
-{
-	if (n == SMD_SS_OPENED) {
-		ch->send->fDSR = 1;
-		ch->send->fCTS = 1;
-		ch->send->fCD = 1;
-	} else {
-		ch->send->fDSR = 0;
-		ch->send->fCTS = 0;
-		ch->send->fCD = 0;
-	}
-	ch->send->state = n;
-	ch->send->fSTATE = 1;
-	ch->notify_other_cpu();
-}
-
-static void do_smd_probe(void)
-{
-	struct smem_shared *shared = (void *) MSM_SHARED_RAM_BASE;
-	if (shared->heap_info.free_offset != last_heap_free) {
-		last_heap_free = shared->heap_info.free_offset;
-		schedule_work(&probe_work);
-	}
-}
-
-static void smd_state_change(struct smd_channel *ch,
-			     unsigned last, unsigned next)
-{
-	ch->last_state = next;
-
-	pr_debug("ch %d %d -> %d\n", ch->n, last, next);
-
-	switch (next) {
-	case SMD_SS_OPENING:
-		ch->recv->tail = 0;
-	case SMD_SS_OPENED:
-		if (ch->send->state != SMD_SS_OPENED)
-			ch_set_state(ch, SMD_SS_OPENED);
-		ch->notify(ch->priv, SMD_EVENT_OPEN);
-		break;
-	case SMD_SS_FLUSHING:
-	case SMD_SS_RESET:
-		/* we should force them to close? */
-	default:
-		ch->notify(ch->priv, SMD_EVENT_CLOSE);
-	}
-}
-
-static void handle_smd_irq(struct list_head *list, void (*notify)(void))
-{
-	unsigned long flags;
-	struct smd_channel *ch;
-	int do_notify = 0;
-	unsigned ch_flags;
-	unsigned tmp;
-
-	spin_lock_irqsave(&smd_lock, flags);
-	list_for_each_entry(ch, list, ch_list) {
-		ch_flags = 0;
-		if (ch_is_open(ch)) {
-			if (ch->recv->fHEAD) {
-				ch->recv->fHEAD = 0;
-				ch_flags |= 1;
-				do_notify |= 1;
-			}
-			if (ch->recv->fTAIL) {
-				ch->recv->fTAIL = 0;
-				ch_flags |= 2;
-				do_notify |= 1;
-			}
-			if (ch->recv->fSTATE) {
-				ch->recv->fSTATE = 0;
-				ch_flags |= 4;
-				do_notify |= 1;
-			}
-		}
-		tmp = ch->recv->state;
-		if (tmp != ch->last_state)
-			smd_state_change(ch, ch->last_state, tmp);
-		if (ch_flags) {
-			ch->update_state(ch);
-			ch->notify(ch->priv, SMD_EVENT_DATA);
-		}
-	}
-	if (do_notify)
-		notify();
-	spin_unlock_irqrestore(&smd_lock, flags);
-	do_smd_probe();
-}
-
-static irqreturn_t smd_modem_irq_handler(int irq, void *data)
-{
-	handle_smd_irq(&smd_ch_list_modem, notify_modem_smd);
-	return IRQ_HANDLED;
-}
-
-#if defined(CONFIG_QDSP6)
-static irqreturn_t smd_dsp_irq_handler(int irq, void *data)
-{
-	handle_smd_irq(&smd_ch_list_dsp, notify_dsp_smd);
-	return IRQ_HANDLED;
-}
-#endif
-
-static void smd_fake_irq_handler(unsigned long arg)
-{
-	handle_smd_irq(&smd_ch_list_modem, notify_modem_smd);
-	handle_smd_irq(&smd_ch_list_dsp, notify_dsp_smd);
-}
-
-static DECLARE_TASKLET(smd_fake_irq_tasklet, smd_fake_irq_handler, 0);
-
-static inline int smd_need_int(struct smd_channel *ch)
-{
-	if (ch_is_open(ch)) {
-		if (ch->recv->fHEAD || ch->recv->fTAIL || ch->recv->fSTATE)
-			return 1;
-		if (ch->recv->state != ch->last_state)
-			return 1;
-	}
-	return 0;
-}
-
-void smd_sleep_exit(void)
-{
-	unsigned long flags;
-	struct smd_channel *ch;
-	int need_int = 0;
-
-	spin_lock_irqsave(&smd_lock, flags);
-	list_for_each_entry(ch, &smd_ch_list_modem, ch_list) {
-		if (smd_need_int(ch)) {
-			need_int = 1;
-			break;
-		}
-	}
-	list_for_each_entry(ch, &smd_ch_list_dsp, ch_list) {
-		if (smd_need_int(ch)) {
-			need_int = 1;
-			break;
-		}
-	}
-	spin_unlock_irqrestore(&smd_lock, flags);
-	do_smd_probe();
-
-	if (need_int) {
-		if (msm_smd_debug_mask & MSM_SMD_DEBUG)
-			pr_info("smd_sleep_exit need interrupt\n");
-		tasklet_schedule(&smd_fake_irq_tasklet);
-	}
-}
-
-
-void smd_kick(smd_channel_t *ch)
-{
-	unsigned long flags;
-	unsigned tmp;
-
-	spin_lock_irqsave(&smd_lock, flags);
-	ch->update_state(ch);
-	tmp = ch->recv->state;
-	if (tmp != ch->last_state) {
-		ch->last_state = tmp;
-		if (tmp == SMD_SS_OPENED)
-			ch->notify(ch->priv, SMD_EVENT_OPEN);
-		else
-			ch->notify(ch->priv, SMD_EVENT_CLOSE);
-	}
-	ch->notify(ch->priv, SMD_EVENT_DATA);
-	ch->notify_other_cpu();
-	spin_unlock_irqrestore(&smd_lock, flags);
-}
-
-static int smd_is_packet(int chn, unsigned type)
-{
-	type &= SMD_KIND_MASK;
-	if (type == SMD_KIND_PACKET)
-		return 1;
-	if (type == SMD_KIND_STREAM)
-		return 0;
-
-	/* older AMSS reports SMD_KIND_UNKNOWN always */
-	if ((chn > 4) || (chn == 1))
-		return 1;
-	else
-		return 0;
-}
-
-static int smd_stream_write(smd_channel_t *ch, const void *_data, int len)
-{
-	void *ptr;
-	const unsigned char *buf = _data;
-	unsigned xfer;
-	int orig_len = len;
-
-	if (len < 0)
-		return -EINVAL;
-
-	while ((xfer = ch_write_buffer(ch, &ptr)) != 0) {
-		if (!ch_is_open(ch))
-			break;
-		if (xfer > len)
-			xfer = len;
-		memcpy(ptr, buf, xfer);
-		ch_write_done(ch, xfer);
-		len -= xfer;
-		buf += xfer;
-		if (len == 0)
-			break;
-	}
-
-	ch->notify_other_cpu();
-
-	return orig_len - len;
-}
-
-static int smd_packet_write(smd_channel_t *ch, const void *_data, int len)
-{
-	unsigned hdr[5];
-
-	if (len < 0)
-		return -EINVAL;
-
-	if (smd_stream_write_avail(ch) < (len + SMD_HEADER_SIZE))
-		return -ENOMEM;
-
-	hdr[0] = len;
-	hdr[1] = hdr[2] = hdr[3] = hdr[4] = 0;
-
-	smd_stream_write(ch, hdr, sizeof(hdr));
-	smd_stream_write(ch, _data, len);
-
-	return len;
-}
-
-static int smd_stream_read(smd_channel_t *ch, void *data, int len)
-{
-	int r;
-
-	if (len < 0)
-		return -EINVAL;
-
-	r = ch_read(ch, data, len);
-	if (r > 0)
-		ch->notify_other_cpu();
-
-	return r;
-}
-
-static int smd_packet_read(smd_channel_t *ch, void *data, int len)
-{
-	unsigned long flags;
-	int r;
-
-	if (len < 0)
-		return -EINVAL;
-
-	if (len > ch->current_packet)
-		len = ch->current_packet;
-
-	r = ch_read(ch, data, len);
-	if (r > 0)
-		ch->notify_other_cpu();
-
-	spin_lock_irqsave(&smd_lock, flags);
-	ch->current_packet -= r;
-	update_packet_state(ch);
-	spin_unlock_irqrestore(&smd_lock, flags);
-
-	return r;
-}
-
-static int smd_alloc_channel(const char *name, uint32_t cid, uint32_t type)
-{
-	struct smd_channel *ch;
-
-	ch = kzalloc(sizeof(struct smd_channel), GFP_KERNEL);
-	if (ch == 0) {
-		pr_err("smd_alloc_channel() out of memory\n");
-		return -1;
-	}
-	ch->n = cid;
-
-	if (_smd_alloc_channel(ch)) {
-		kfree(ch);
-		return -1;
-	}
-
-	ch->fifo_mask = ch->fifo_size - 1;
-	ch->type = type;
-
-	if ((type & SMD_TYPE_MASK) == SMD_TYPE_APPS_MODEM)
-		ch->notify_other_cpu = notify_modem_smd;
-	else
-		ch->notify_other_cpu = notify_dsp_smd;
-
-	if (smd_is_packet(cid, type)) {
-		ch->read = smd_packet_read;
-		ch->write = smd_packet_write;
-		ch->read_avail = smd_packet_read_avail;
-		ch->write_avail = smd_packet_write_avail;
-		ch->update_state = update_packet_state;
-	} else {
-		ch->read = smd_stream_read;
-		ch->write = smd_stream_write;
-		ch->read_avail = smd_stream_read_avail;
-		ch->write_avail = smd_stream_write_avail;
-		ch->update_state = update_stream_state;
-	}
-
-	if ((type & 0xff) == 0)
-		memcpy(ch->name, "SMD_", 4);
-	else
-		memcpy(ch->name, "DSP_", 4);
-	memcpy(ch->name + 4, name, 20);
-	ch->name[23] = 0;
-	ch->pdev.name = ch->name;
-	ch->pdev.id = -1;
-
-	pr_debug("smd_alloc_channel() cid=%02d size=%05d '%s'\n",
-		ch->n, ch->fifo_size, ch->name);
-
-	mutex_lock(&smd_creation_mutex);
-	list_add(&ch->ch_list, &smd_ch_closed_list);
-	mutex_unlock(&smd_creation_mutex);
-
-	platform_device_register(&ch->pdev);
-	return 0;
-}
-
-static void smd_channel_probe_worker(struct work_struct *work)
-{
-	struct smd_alloc_elm *shared;
-	unsigned ctype;
-	unsigned type;
-	unsigned n;
-
-	shared = smem_find(ID_CH_ALLOC_TBL, sizeof(*shared) * 64);
-	if (!shared) {
-		pr_err("cannot find allocation table\n");
-		return;
-	}
-	for (n = 0; n < 64; n++) {
-		if (smd_ch_allocated[n])
-			continue;
-		if (!shared[n].ref_count)
-			continue;
-		if (!shared[n].name[0])
-			continue;
-		ctype = shared[n].ctype;
-		type = ctype & SMD_TYPE_MASK;
-
-		/* DAL channels are stream but neither the modem,
-		 * nor the DSP correctly indicate this.  Fixup manually.
-		 */
-		if (!memcmp(shared[n].name, "DAL", 3))
-			ctype = (ctype & (~SMD_KIND_MASK)) | SMD_KIND_STREAM;
-
-		type = shared[n].ctype & SMD_TYPE_MASK;
-		if ((type == SMD_TYPE_APPS_MODEM) ||
-		    (type == SMD_TYPE_APPS_DSP))
-			if (!smd_alloc_channel(shared[n].name, shared[n].cid, ctype))
-				smd_ch_allocated[n] = 1;
-	}
-}
-
-static void do_nothing_notify(void *priv, unsigned flags)
-{
-}
-
-struct smd_channel *smd_get_channel(const char *name)
-{
-	struct smd_channel *ch;
-
-	mutex_lock(&smd_creation_mutex);
-	list_for_each_entry(ch, &smd_ch_closed_list, ch_list) {
-		if (!strcmp(name, ch->name)) {
-			list_del(&ch->ch_list);
-			mutex_unlock(&smd_creation_mutex);
-			return ch;
-		}
-	}
-	mutex_unlock(&smd_creation_mutex);
-
-	return NULL;
-}
-
-int smd_open(const char *name, smd_channel_t **_ch,
-	     void *priv, void (*notify)(void *, unsigned))
-{
-	struct smd_channel *ch;
-	unsigned long flags;
-
-	if (smd_initialized == 0) {
-		pr_info("smd_open() before smd_init()\n");
-		return -ENODEV;
-	}
-
-	ch = smd_get_channel(name);
-	if (!ch)
-		return -ENODEV;
-
-	if (notify == 0)
-		notify = do_nothing_notify;
-
-	ch->notify = notify;
-	ch->current_packet = 0;
-	ch->last_state = SMD_SS_CLOSED;
-	ch->priv = priv;
-
-	*_ch = ch;
-
-	spin_lock_irqsave(&smd_lock, flags);
-
-	if ((ch->type & SMD_TYPE_MASK) == SMD_TYPE_APPS_MODEM)
-		list_add(&ch->ch_list, &smd_ch_list_modem);
-	else
-		list_add(&ch->ch_list, &smd_ch_list_dsp);
-
-	/* If the remote side is CLOSING, we need to get it to
-	 * move to OPENING (which we'll do by moving from CLOSED to
-	 * OPENING) and then get it to move from OPENING to
-	 * OPENED (by doing the same state change ourselves).
-	 *
-	 * Otherwise, it should be OPENING and we can move directly
-	 * to OPENED so that it will follow.
-	 */
-	if (ch->recv->state == SMD_SS_CLOSING) {
-		ch->send->head = 0;
-		ch_set_state(ch, SMD_SS_OPENING);
-	} else {
-		ch_set_state(ch, SMD_SS_OPENED);
-	}
-	spin_unlock_irqrestore(&smd_lock, flags);
-	smd_kick(ch);
-
-	return 0;
-}
-
-int smd_close(smd_channel_t *ch)
-{
-	unsigned long flags;
-
-	if (ch == 0)
-		return -1;
-
-	spin_lock_irqsave(&smd_lock, flags);
-	ch->notify = do_nothing_notify;
-	list_del(&ch->ch_list);
-	ch_set_state(ch, SMD_SS_CLOSED);
-	spin_unlock_irqrestore(&smd_lock, flags);
-
-	mutex_lock(&smd_creation_mutex);
-	list_add(&ch->ch_list, &smd_ch_closed_list);
-	mutex_unlock(&smd_creation_mutex);
-
-	return 0;
-}
-
-int smd_read(smd_channel_t *ch, void *data, int len)
-{
-	return ch->read(ch, data, len);
-}
-
-int smd_write(smd_channel_t *ch, const void *data, int len)
-{
-	return ch->write(ch, data, len);
-}
-
-int smd_write_atomic(smd_channel_t *ch, const void *data, int len)
-{
-	unsigned long flags;
-	int res;
-	spin_lock_irqsave(&smd_lock, flags);
-	res = ch->write(ch, data, len);
-	spin_unlock_irqrestore(&smd_lock, flags);
-	return res;
-}
-
-int smd_read_avail(smd_channel_t *ch)
-{
-	return ch->read_avail(ch);
-}
-
-int smd_write_avail(smd_channel_t *ch)
-{
-	return ch->write_avail(ch);
-}
-
-int smd_wait_until_readable(smd_channel_t *ch, int bytes)
-{
-	return -1;
-}
-
-int smd_wait_until_writable(smd_channel_t *ch, int bytes)
-{
-	return -1;
-}
-
-int smd_cur_packet_size(smd_channel_t *ch)
-{
-	return ch->current_packet;
-}
-
-
-/* ------------------------------------------------------------------------- */
-
-void *smem_alloc(unsigned id, unsigned size)
-{
-	return smem_find(id, size);
-}
-
-void __iomem *smem_item(unsigned id, unsigned *size)
-{
-	struct smem_shared *shared = (void *) MSM_SHARED_RAM_BASE;
-	struct smem_heap_entry *toc = shared->heap_toc;
-
-	if (id >= SMEM_NUM_ITEMS)
-		return NULL;
-
-	if (toc[id].allocated) {
-		*size = toc[id].size;
-		return (MSM_SHARED_RAM_BASE + toc[id].offset);
-	} else {
-		*size = 0;
-	}
-
-	return NULL;
-}
-
-void *smem_find(unsigned id, unsigned size_in)
-{
-	unsigned size;
-	void *ptr;
-
-	ptr = smem_item(id, &size);
-	if (!ptr)
-		return 0;
-
-	size_in = ALIGN(size_in, 8);
-	if (size_in != size) {
-		pr_err("smem_find(%d, %d): wrong size %d\n",
-		       id, size_in, size);
-		return 0;
-	}
-
-	return ptr;
-}
-
-static irqreturn_t smsm_irq_handler(int irq, void *data)
-{
-	unsigned long flags;
-	unsigned apps, modm;
-
-	spin_lock_irqsave(&smem_lock, flags);
-
-	apps = raw_smsm_get_state(SMSM_STATE_APPS);
-	modm = raw_smsm_get_state(SMSM_STATE_MODEM);
-
-	if (msm_smd_debug_mask & MSM_SMSM_DEBUG)
-		pr_info("<SM %08x %08x>\n", apps, modm);
-	if (modm & SMSM_RESET)
-		handle_modem_crash();
-
-	do_smd_probe();
-
-	spin_unlock_irqrestore(&smem_lock, flags);
-	return IRQ_HANDLED;
-}
-
-int smsm_change_state(enum smsm_state_item item,
-		      uint32_t clear_mask, uint32_t set_mask)
-{
-	void __iomem *addr = smd_info.state + item * 4;
-	unsigned long flags;
-	unsigned state;
-
-	if (!smd_info.ready)
-		return -EIO;
-
-	spin_lock_irqsave(&smem_lock, flags);
-
-	if (raw_smsm_get_state(SMSM_STATE_MODEM) & SMSM_RESET)
-		handle_modem_crash();
-
-	state = (readl(addr) & ~clear_mask) | set_mask;
-	writel(state, addr);
-
-	if (msm_smd_debug_mask & MSM_SMSM_DEBUG)
-		pr_info("smsm_change_state %d %x\n", item, state);
-	notify_other_smsm();
-
-	spin_unlock_irqrestore(&smem_lock, flags);
-
-	return 0;
-}
-
-uint32_t smsm_get_state(enum smsm_state_item item)
-{
-	unsigned long flags;
-	uint32_t rv;
-
-	spin_lock_irqsave(&smem_lock, flags);
-
-	rv = readl(smd_info.state + item * 4);
-
-	if (item == SMSM_STATE_MODEM && (rv & SMSM_RESET))
-		handle_modem_crash();
-
-	spin_unlock_irqrestore(&smem_lock, flags);
-
-	return rv;
-}
-
-#ifdef CONFIG_ARCH_MSM_SCORPION
-
-int smsm_set_sleep_duration(uint32_t delay)
-{
-	struct msm_dem_slave_data *ptr;
-
-	ptr = smem_find(SMEM_APPS_DEM_SLAVE_DATA, sizeof(*ptr));
-	if (ptr == NULL) {
-		pr_err("smsm_set_sleep_duration <SM NO APPS_DEM_SLAVE_DATA>\n");
-		return -EIO;
-	}
-	if (msm_smd_debug_mask & MSM_SMSM_DEBUG)
-		pr_info("smsm_set_sleep_duration %d -> %d\n",
-		       ptr->sleep_time, delay);
-	ptr->sleep_time = delay;
-	return 0;
-}
-
-#else
-
-int smsm_set_sleep_duration(uint32_t delay)
-{
-	uint32_t *ptr;
-
-	ptr = smem_find(SMEM_SMSM_SLEEP_DELAY, sizeof(*ptr));
-	if (ptr == NULL) {
-		pr_err("smsm_set_sleep_duration <SM NO SLEEP_DELAY>\n");
-		return -EIO;
-	}
-	if (msm_smd_debug_mask & MSM_SMSM_DEBUG)
-		pr_info("smsm_set_sleep_duration %d -> %d\n",
-		       *ptr, delay);
-	*ptr = delay;
-	return 0;
-}
-
-#endif
-
-int smd_core_init(void)
-{
-	int r;
-
-	/* wait for essential items to be initialized */
-	for (;;) {
-		unsigned size;
-		void __iomem *state;
-		state = smem_item(SMEM_SMSM_SHARED_STATE, &size);
-		if (size == SMSM_V1_SIZE || size == SMSM_V2_SIZE) {
-			smd_info.state = state;
-			break;
-		}
-	}
-
-	smd_info.ready = 1;
-
-	r = request_irq(INT_A9_M2A_0, smd_modem_irq_handler,
-			IRQF_TRIGGER_RISING, "smd_dev", 0);
-	if (r < 0)
-		return r;
-	r = enable_irq_wake(INT_A9_M2A_0);
-	if (r < 0)
-		pr_err("smd_core_init: enable_irq_wake failed for A9_M2A_0\n");
-
-	r = request_irq(INT_A9_M2A_5, smsm_irq_handler,
-			IRQF_TRIGGER_RISING, "smsm_dev", 0);
-	if (r < 0) {
-		free_irq(INT_A9_M2A_0, 0);
-		return r;
-	}
-	r = enable_irq_wake(INT_A9_M2A_5);
-	if (r < 0)
-		pr_err("smd_core_init: enable_irq_wake failed for A9_M2A_5\n");
-
-#if defined(CONFIG_QDSP6)
-	r = request_irq(INT_ADSP_A11, smd_dsp_irq_handler,
-			IRQF_TRIGGER_RISING, "smd_dsp", 0);
-	if (r < 0) {
-		free_irq(INT_A9_M2A_0, 0);
-		free_irq(INT_A9_M2A_5, 0);
-		return r;
-	}
-#endif
-
-	/* check for any SMD channels that may already exist */
-	do_smd_probe();
-
-	/* indicate that we're up and running */
-	smsm_change_state(SMSM_STATE_APPS,
-			  ~0, SMSM_INIT | SMSM_SMDINIT | SMSM_RPCINIT | SMSM_RUN);
-#ifdef CONFIG_ARCH_MSM_SCORPION
-	smsm_change_state(SMSM_STATE_APPS_DEM, ~0, 0);
-#endif
-
-	return 0;
-}
-
-static int msm_smd_probe(struct platform_device *pdev)
-{
-	/*
-	 * If we haven't waited for the ARM9 to boot up till now,
-	 * then we need to wait here. Otherwise this should just
-	 * return immediately.
-	 */
-	proc_comm_boot_wait();
-
-	INIT_WORK(&probe_work, smd_channel_probe_worker);
-
-	if (smd_core_init()) {
-		pr_err("smd_core_init() failed\n");
-		return -1;
-	}
-
-	do_smd_probe();
-
-	msm_check_for_modem_crash = check_for_modem_crash;
-
-	msm_init_last_radio_log(THIS_MODULE);
-
-	smd_initialized = 1;
-
-	return 0;
-}
-
-static struct platform_driver msm_smd_driver = {
-	.probe = msm_smd_probe,
-	.driver = {
-		.name = MODULE_NAME,
-	},
-};
-
-static int __init msm_smd_init(void)
-{
-	return platform_driver_register(&msm_smd_driver);
-}
-
-module_init(msm_smd_init);
-
-MODULE_DESCRIPTION("MSM Shared Memory Core");
-MODULE_AUTHOR("Brian Swetland <swetland@google.com>");
-MODULE_LICENSE("GPL");
diff --git a/arch/arm/mach-msm/smd_debug.c b/arch/arm/mach-msm/smd_debug.c
deleted file mode 100644
index 8056b3e5590f..000000000000
--- a/arch/arm/mach-msm/smd_debug.c
+++ /dev/null
@@ -1,311 +0,0 @@
-/* arch/arm/mach-msm/smd_debug.c
- *
- * Copyright (C) 2007 Google, Inc.
- * Author: Brian Swetland <swetland@google.com>
- *
- * 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/debugfs.h>
-#include <linux/list.h>
-
-#include <mach/msm_iomap.h>
-
-#include "smd_private.h"
-
-#if defined(CONFIG_DEBUG_FS)
-
-static char *chstate(unsigned n)
-{
-	switch (n) {
-	case SMD_SS_CLOSED:
-		return "CLOSED";
-	case SMD_SS_OPENING:
-		return "OPENING";
-	case SMD_SS_OPENED:
-		return "OPENED";
-	case SMD_SS_FLUSHING:
-		return "FLUSHING";
-	case SMD_SS_CLOSING:
-		return "CLOSING";
-	case SMD_SS_RESET:
-		return "RESET";
-	case SMD_SS_RESET_OPENING:
-		return "ROPENING";
-	default:
-		return "UNKNOWN";
-	}
-}
-
-
-static int dump_ch(char *buf, int max, struct smd_channel *ch)
-{
-	volatile struct smd_half_channel *s = ch->send;
-	volatile struct smd_half_channel *r = ch->recv;
-
-	return scnprintf(
-		buf, max,
-		"ch%02d:"
-		" %8s(%05d/%05d) %c%c%c%c%c%c%c <->"
-		" %8s(%05d/%05d) %c%c%c%c%c%c%c '%s'\n", ch->n,
-		chstate(s->state), s->tail, s->head,
-		s->fDSR ? 'D' : 'd',
-		s->fCTS ? 'C' : 'c',
-		s->fCD ? 'C' : 'c',
-		s->fRI ? 'I' : 'i',
-		s->fHEAD ? 'W' : 'w',
-		s->fTAIL ? 'R' : 'r',
-		s->fSTATE ? 'S' : 's',
-		chstate(r->state), r->tail, r->head,
-		r->fDSR ? 'D' : 'd',
-		r->fCTS ? 'R' : 'r',
-		r->fCD ? 'C' : 'c',
-		r->fRI ? 'I' : 'i',
-		r->fHEAD ? 'W' : 'w',
-		r->fTAIL ? 'R' : 'r',
-		r->fSTATE ? 'S' : 's',
-		ch->name
-		);
-}
-
-static int debug_read_stat(char *buf, int max)
-{
-	char *msg;
-	int i = 0;
-
-	msg = smem_find(ID_DIAG_ERR_MSG, SZ_DIAG_ERR_MSG);
-
-	if (raw_smsm_get_state(SMSM_STATE_MODEM) & SMSM_RESET)
-		i += scnprintf(buf + i, max - i,
-			       "smsm: ARM9 HAS CRASHED\n");
-
-	i += scnprintf(buf + i, max - i, "smsm: a9: %08x a11: %08x\n",
-		       raw_smsm_get_state(SMSM_STATE_MODEM),
-		       raw_smsm_get_state(SMSM_STATE_APPS));
-#ifdef CONFIG_ARCH_MSM_SCORPION
-	i += scnprintf(buf + i, max - i, "smsm dem: apps: %08x modem: %08x "
-		       "qdsp6: %08x power: %08x time: %08x\n",
-		       raw_smsm_get_state(SMSM_STATE_APPS_DEM),
-		       raw_smsm_get_state(SMSM_STATE_MODEM_DEM),
-		       raw_smsm_get_state(SMSM_STATE_QDSP6_DEM),
-		       raw_smsm_get_state(SMSM_STATE_POWER_MASTER_DEM),
-		       raw_smsm_get_state(SMSM_STATE_TIME_MASTER_DEM));
-#endif
-	if (msg) {
-		msg[SZ_DIAG_ERR_MSG - 1] = 0;
-		i += scnprintf(buf + i, max - i, "diag: '%s'\n", msg);
-	}
-	return i;
-}
-
-static int debug_read_mem(char *buf, int max)
-{
-	unsigned n;
-	struct smem_shared *shared = (void *) MSM_SHARED_RAM_BASE;
-	struct smem_heap_entry *toc = shared->heap_toc;
-	int i = 0;
-
-	i += scnprintf(buf + i, max - i,
-		       "heap: init=%d free=%d remain=%d\n",
-		       shared->heap_info.initialized,
-		       shared->heap_info.free_offset,
-		       shared->heap_info.heap_remaining);
-
-	for (n = 0; n < SMEM_NUM_ITEMS; n++) {
-		if (toc[n].allocated == 0)
-			continue;
-		i += scnprintf(buf + i, max - i,
-			       "%04d: offset %08x size %08x\n",
-			       n, toc[n].offset, toc[n].size);
-	}
-	return i;
-}
-
-static int debug_read_ch(char *buf, int max)
-{
-	struct smd_channel *ch;
-	unsigned long flags;
-	int i = 0;
-
-	spin_lock_irqsave(&smd_lock, flags);
-	list_for_each_entry(ch, &smd_ch_list_dsp, ch_list)
-		i += dump_ch(buf + i, max - i, ch);
-	list_for_each_entry(ch, &smd_ch_list_modem, ch_list)
-		i += dump_ch(buf + i, max - i, ch);
-	list_for_each_entry(ch, &smd_ch_closed_list, ch_list)
-		i += dump_ch(buf + i, max - i, ch);
-	spin_unlock_irqrestore(&smd_lock, flags);
-
-	return i;
-}
-
-static int debug_read_version(char *buf, int max)
-{
-	struct smem_shared *shared = (void *) MSM_SHARED_RAM_BASE;
-	unsigned version = shared->version[VERSION_MODEM];
-	return sprintf(buf, "%d.%d\n", version >> 16, version & 0xffff);
-}
-
-static int debug_read_build_id(char *buf, int max)
-{
-	unsigned size;
-	void *data;
-
-	data = smem_item(SMEM_HW_SW_BUILD_ID, &size);
-	if (!data)
-		return 0;
-
-	if (size >= max)
-		size = max;
-	memcpy(buf, data, size);
-
-	return size;
-}
-
-static int debug_read_alloc_tbl(char *buf, int max)
-{
-	struct smd_alloc_elm *shared;
-	int n, i = 0;
-
-	shared = smem_find(ID_CH_ALLOC_TBL, sizeof(*shared) * 64);
-
-	for (n = 0; n < 64; n++) {
-		if (shared[n].ref_count == 0)
-			continue;
-		i += scnprintf(buf + i, max - i,
-			       "%03d: %-20s cid=%02d type=%03d "
-			       "kind=%02d ref_count=%d\n",
-			       n, shared[n].name, shared[n].cid,
-			       shared[n].ctype & 0xff,
-			       (shared[n].ctype >> 8) & 0xf,
-			       shared[n].ref_count);
-	}
-
-	return i;
-}
-
-#define DEBUG_BUFMAX 4096
-static char debug_buffer[DEBUG_BUFMAX];
-
-static ssize_t debug_read(struct file *file, char __user *buf,
-			  size_t count, loff_t *ppos)
-{
-	int (*fill)(char *buf, int max) = file->private_data;
-	int bsize = fill(debug_buffer, DEBUG_BUFMAX);
-	return simple_read_from_buffer(buf, count, ppos, debug_buffer, bsize);
-}
-
-static const struct file_operations debug_ops = {
-	.read = debug_read,
-	.open = simple_open,
-	.llseek = default_llseek,
-};
-
-static void debug_create(const char *name, umode_t mode,
-			 struct dentry *dent,
-			 int (*fill)(char *buf, int max))
-{
-	debugfs_create_file(name, mode, dent, fill, &debug_ops);
-}
-
-int __init smd_debugfs_init(void)
-{
-	struct dentry *dent;
-
-	dent = debugfs_create_dir("smd", 0);
-	if (IS_ERR(dent))
-		return 1;
-
-	debug_create("ch", 0444, dent, debug_read_ch);
-	debug_create("stat", 0444, dent, debug_read_stat);
-	debug_create("mem", 0444, dent, debug_read_mem);
-	debug_create("version", 0444, dent, debug_read_version);
-	debug_create("tbl", 0444, dent, debug_read_alloc_tbl);
-	debug_create("build", 0444, dent, debug_read_build_id);
-
-	return 0;
-}
-
-#endif
-
-
-#define MAX_NUM_SLEEP_CLIENTS		64
-#define MAX_SLEEP_NAME_LEN		8
-
-#define NUM_GPIO_INT_REGISTERS		6
-#define GPIO_SMEM_NUM_GROUPS		2
-#define GPIO_SMEM_MAX_PC_INTERRUPTS	8
-
-struct tramp_gpio_save {
-	unsigned int enable;
-	unsigned int detect;
-	unsigned int polarity;
-};
-
-struct tramp_gpio_smem {
-	uint16_t num_fired[GPIO_SMEM_NUM_GROUPS];
-	uint16_t fired[GPIO_SMEM_NUM_GROUPS][GPIO_SMEM_MAX_PC_INTERRUPTS];
-	uint32_t enabled[NUM_GPIO_INT_REGISTERS];
-	uint32_t detection[NUM_GPIO_INT_REGISTERS];
-	uint32_t polarity[NUM_GPIO_INT_REGISTERS];
-};
-
-
-void smsm_print_sleep_info(void)
-{
-	unsigned long flags;
-	uint32_t *ptr;
-#ifndef CONFIG_ARCH_MSM_SCORPION
-	struct tramp_gpio_smem *gpio;
-	struct smsm_interrupt_info *int_info;
-#endif
-
-
-	spin_lock_irqsave(&smem_lock, flags);
-
-	ptr = smem_alloc(SMEM_SMSM_SLEEP_DELAY, sizeof(*ptr));
-	if (ptr)
-		pr_info("SMEM_SMSM_SLEEP_DELAY: %x\n", *ptr);
-
-	ptr = smem_alloc(SMEM_SMSM_LIMIT_SLEEP, sizeof(*ptr));
-	if (ptr)
-		pr_info("SMEM_SMSM_LIMIT_SLEEP: %x\n", *ptr);
-
-	ptr = smem_alloc(SMEM_SLEEP_POWER_COLLAPSE_DISABLED, sizeof(*ptr));
-	if (ptr)
-		pr_info("SMEM_SLEEP_POWER_COLLAPSE_DISABLED: %x\n", *ptr);
-
-#ifndef CONFIG_ARCH_MSM_SCORPION
-	int_info = smem_alloc(SMEM_SMSM_INT_INFO, sizeof(*int_info));
-	if (int_info)
-		pr_info("SMEM_SMSM_INT_INFO %x %x %x\n",
-			int_info->interrupt_mask,
-			int_info->pending_interrupts,
-			int_info->wakeup_reason);
-
-	gpio = smem_alloc(SMEM_GPIO_INT, sizeof(*gpio));
-	if (gpio) {
-		int i;
-		for (i = 0; i < NUM_GPIO_INT_REGISTERS; i++)
-			pr_info("SMEM_GPIO_INT: %d: e %x d %x p %x\n",
-				i, gpio->enabled[i], gpio->detection[i],
-				gpio->polarity[i]);
-
-		for (i = 0; i < GPIO_SMEM_NUM_GROUPS; i++)
-			pr_info("SMEM_GPIO_INT: %d: f %d: %d %d...\n",
-				i, gpio->num_fired[i], gpio->fired[i][0],
-				gpio->fired[i][1]);
-	}
-#else
-#endif
-	spin_unlock_irqrestore(&smem_lock, flags);
-}
-
diff --git a/arch/arm/mach-msm/smd_private.h b/arch/arm/mach-msm/smd_private.h
deleted file mode 100644
index 727bfe68aa9b..000000000000
--- a/arch/arm/mach-msm/smd_private.h
+++ /dev/null
@@ -1,403 +0,0 @@
-/* arch/arm/mach-msm/smd_private.h
- *
- * Copyright (C) 2007 Google, Inc.
- * Copyright (c) 2007 QUALCOMM Incorporated
- *
- * 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.
- *
- */
-#ifndef _ARCH_ARM_MACH_MSM_MSM_SMD_PRIVATE_H_
-#define _ARCH_ARM_MACH_MSM_MSM_SMD_PRIVATE_H_
-
-#include <linux/platform_device.h>
-#include <linux/spinlock.h>
-#include <linux/list.h>
-#include <linux/io.h>
-
-#include <mach/msm_iomap.h>
-
-struct smem_heap_info {
-	unsigned initialized;
-	unsigned free_offset;
-	unsigned heap_remaining;
-	unsigned reserved;
-};
-
-struct smem_heap_entry {
-	unsigned allocated;
-	unsigned offset;
-	unsigned size;
-	unsigned reserved;
-};
-
-struct smem_proc_comm {
-	unsigned command;
-	unsigned status;
-	unsigned data1;
-	unsigned data2;
-};
-
-#define PC_APPS  0
-#define PC_MODEM 1
-
-#define VERSION_SMD       0
-#define VERSION_QDSP6     4
-#define VERSION_APPS_SBL  6
-#define VERSION_MODEM_SBL 7
-#define VERSION_APPS      8
-#define VERSION_MODEM     9
-
-struct smem_shared {
-	struct smem_proc_comm proc_comm[4];
-	unsigned version[32];
-	struct smem_heap_info heap_info;
-	struct smem_heap_entry heap_toc[512];
-};
-
-#define SMSM_V1_SIZE		(sizeof(unsigned) * 8)
-#define SMSM_V2_SIZE		(sizeof(unsigned) * 4)
-
-#ifdef CONFIG_MSM_SMD_PKG3
-struct smsm_interrupt_info {
-	uint32_t interrupt_mask;
-	uint32_t pending_interrupts;
-	uint32_t wakeup_reason;
-};
-#else
-#define DEM_MAX_PORT_NAME_LEN (20)
-struct msm_dem_slave_data {
-	uint32_t sleep_time;
-	uint32_t interrupt_mask;
-	uint32_t resources_used;
-	uint32_t reserved1;
-
-	uint32_t wakeup_reason;
-	uint32_t pending_interrupts;
-	uint32_t rpc_prog;
-	uint32_t rpc_proc;
-	char     smd_port_name[DEM_MAX_PORT_NAME_LEN];
-	uint32_t reserved2;
-};
-#endif
-
-#define SZ_DIAG_ERR_MSG 0xC8
-#define ID_DIAG_ERR_MSG SMEM_DIAG_ERR_MESSAGE
-#define ID_SMD_CHANNELS SMEM_SMD_BASE_ID
-#define ID_SHARED_STATE SMEM_SMSM_SHARED_STATE
-#define ID_CH_ALLOC_TBL SMEM_CHANNEL_ALLOC_TBL
-
-#define SMSM_INIT		0x00000001
-#define SMSM_SMDINIT		0x00000008
-#define SMSM_RPCINIT		0x00000020
-#define SMSM_RESET		0x00000040
-#define SMSM_RSA		0x00000080
-#define SMSM_RUN		0x00000100
-#define SMSM_PWRC		0x00000200
-#define SMSM_TIMEWAIT		0x00000400
-#define SMSM_TIMEINIT		0x00000800
-#define SMSM_PWRC_EARLY_EXIT	0x00001000
-#define SMSM_WFPI		0x00002000
-#define SMSM_SLEEP		0x00004000
-#define SMSM_SLEEPEXIT		0x00008000
-#define SMSM_APPS_REBOOT	0x00020000
-#define SMSM_SYSTEM_POWER_DOWN	0x00040000
-#define SMSM_SYSTEM_REBOOT	0x00080000
-#define SMSM_SYSTEM_DOWNLOAD	0x00100000
-#define SMSM_PWRC_SUSPEND	0x00200000
-#define SMSM_APPS_SHUTDOWN	0x00400000
-#define SMSM_SMD_LOOPBACK	0x00800000
-#define SMSM_RUN_QUIET		0x01000000
-#define SMSM_MODEM_WAIT		0x02000000
-#define SMSM_MODEM_BREAK	0x04000000
-#define SMSM_MODEM_CONTINUE	0x08000000
-#define SMSM_UNKNOWN		0x80000000
-
-#define SMSM_WKUP_REASON_RPC	0x00000001
-#define SMSM_WKUP_REASON_INT	0x00000002
-#define SMSM_WKUP_REASON_GPIO	0x00000004
-#define SMSM_WKUP_REASON_TIMER	0x00000008
-#define SMSM_WKUP_REASON_ALARM	0x00000010
-#define SMSM_WKUP_REASON_RESET	0x00000020
-
-#ifdef CONFIG_ARCH_MSM7X00A
-enum smsm_state_item {
-	SMSM_STATE_APPS = 1,
-	SMSM_STATE_MODEM = 3,
-	SMSM_STATE_COUNT,
-};
-#else
-enum smsm_state_item {
-	SMSM_STATE_APPS,
-	SMSM_STATE_MODEM,
-	SMSM_STATE_HEXAGON,
-	SMSM_STATE_APPS_DEM,
-	SMSM_STATE_MODEM_DEM,
-	SMSM_STATE_QDSP6_DEM,
-	SMSM_STATE_POWER_MASTER_DEM,
-	SMSM_STATE_TIME_MASTER_DEM,
-	SMSM_STATE_COUNT,
-};
-#endif
-
-void *smem_alloc(unsigned id, unsigned size);
-int smsm_change_state(enum smsm_state_item item, uint32_t clear_mask, uint32_t set_mask);
-uint32_t smsm_get_state(enum smsm_state_item item);
-int smsm_set_sleep_duration(uint32_t delay);
-void smsm_print_sleep_info(void);
-
-#define SMEM_NUM_SMD_CHANNELS        64
-
-typedef enum {
-	/* fixed items */
-	SMEM_PROC_COMM = 0,
-	SMEM_HEAP_INFO,
-	SMEM_ALLOCATION_TABLE,
-	SMEM_VERSION_INFO,
-	SMEM_HW_RESET_DETECT,
-	SMEM_AARM_WARM_BOOT,
-	SMEM_DIAG_ERR_MESSAGE,
-	SMEM_SPINLOCK_ARRAY,
-	SMEM_MEMORY_BARRIER_LOCATION,
-
-	/* dynamic items */
-	SMEM_AARM_PARTITION_TABLE,
-	SMEM_AARM_BAD_BLOCK_TABLE,
-	SMEM_RESERVE_BAD_BLOCKS,
-	SMEM_WM_UUID,
-	SMEM_CHANNEL_ALLOC_TBL,
-	SMEM_SMD_BASE_ID,
-	SMEM_SMEM_LOG_IDX = SMEM_SMD_BASE_ID + SMEM_NUM_SMD_CHANNELS,
-	SMEM_SMEM_LOG_EVENTS,
-	SMEM_SMEM_STATIC_LOG_IDX,
-	SMEM_SMEM_STATIC_LOG_EVENTS,
-	SMEM_SMEM_SLOW_CLOCK_SYNC,
-	SMEM_SMEM_SLOW_CLOCK_VALUE,
-	SMEM_BIO_LED_BUF,
-	SMEM_SMSM_SHARED_STATE,
-	SMEM_SMSM_INT_INFO,
-	SMEM_SMSM_SLEEP_DELAY,
-	SMEM_SMSM_LIMIT_SLEEP,
-	SMEM_SLEEP_POWER_COLLAPSE_DISABLED,
-	SMEM_KEYPAD_KEYS_PRESSED,
-	SMEM_KEYPAD_STATE_UPDATED,
-	SMEM_KEYPAD_STATE_IDX,
-	SMEM_GPIO_INT,
-	SMEM_MDDI_LCD_IDX,
-	SMEM_MDDI_HOST_DRIVER_STATE,
-	SMEM_MDDI_LCD_DISP_STATE,
-	SMEM_LCD_CUR_PANEL,
-	SMEM_MARM_BOOT_SEGMENT_INFO,
-	SMEM_AARM_BOOT_SEGMENT_INFO,
-	SMEM_SLEEP_STATIC,
-	SMEM_SCORPION_FREQUENCY,
-	SMEM_SMD_PROFILES,
-	SMEM_TSSC_BUSY,
-	SMEM_HS_SUSPEND_FILTER_INFO,
-	SMEM_BATT_INFO,
-	SMEM_APPS_BOOT_MODE,
-	SMEM_VERSION_FIRST,
-	SMEM_VERSION_LAST = SMEM_VERSION_FIRST + 24,
-	SMEM_OSS_RRCASN1_BUF1,
-	SMEM_OSS_RRCASN1_BUF2,
-	SMEM_ID_VENDOR0,
-	SMEM_ID_VENDOR1,
-	SMEM_ID_VENDOR2,
-	SMEM_HW_SW_BUILD_ID,
-	SMEM_SMD_BLOCK_PORT_BASE_ID,
-	SMEM_SMD_BLOCK_PORT_PROC0_HEAP = SMEM_SMD_BLOCK_PORT_BASE_ID + SMEM_NUM_SMD_CHANNELS,
-	SMEM_SMD_BLOCK_PORT_PROC1_HEAP = SMEM_SMD_BLOCK_PORT_PROC0_HEAP + SMEM_NUM_SMD_CHANNELS,
-	SMEM_I2C_MUTEX = SMEM_SMD_BLOCK_PORT_PROC1_HEAP + SMEM_NUM_SMD_CHANNELS,
-	SMEM_SCLK_CONVERSION,
-	SMEM_SMD_SMSM_INTR_MUX,
-	SMEM_SMSM_CPU_INTR_MASK,
-	SMEM_APPS_DEM_SLAVE_DATA,
-	SMEM_QDSP6_DEM_SLAVE_DATA,
-	SMEM_CLKREGIM_BSP,
-	SMEM_CLKREGIM_SOURCES,
-	SMEM_SMD_FIFO_BASE_ID,
-	SMEM_USABLE_RAM_PARTITION_TABLE = SMEM_SMD_FIFO_BASE_ID + SMEM_NUM_SMD_CHANNELS,
-	SMEM_POWER_ON_STATUS_INFO,
-	SMEM_DAL_AREA,
-	SMEM_SMEM_LOG_POWER_IDX,
-	SMEM_SMEM_LOG_POWER_WRAP,
-	SMEM_SMEM_LOG_POWER_EVENTS,
-	SMEM_ERR_CRASH_LOG,
-	SMEM_ERR_F3_TRACE_LOG,
-	SMEM_NUM_ITEMS,
-} smem_mem_type;
-
-
-#define SMD_SS_CLOSED		0x00000000
-#define SMD_SS_OPENING		0x00000001
-#define SMD_SS_OPENED		0x00000002
-#define SMD_SS_FLUSHING		0x00000003
-#define SMD_SS_CLOSING		0x00000004
-#define SMD_SS_RESET		0x00000005
-#define SMD_SS_RESET_OPENING	0x00000006
-
-#define SMD_BUF_SIZE		8192
-#define SMD_CHANNELS		64
-
-#define SMD_HEADER_SIZE		20
-
-struct smd_alloc_elm {
-	char name[20];
-	uint32_t cid;
-	uint32_t ctype;
-	uint32_t ref_count;
-};
-
-struct smd_half_channel {
-	unsigned state;
-	unsigned char fDSR;
-	unsigned char fCTS;
-	unsigned char fCD;
-	unsigned char fRI;
-	unsigned char fHEAD;
-	unsigned char fTAIL;
-	unsigned char fSTATE;
-	unsigned char fUNUSED;
-	unsigned tail;
-	unsigned head;
-} __attribute__(( aligned(4), packed ));
-
-/* Only used on SMD package v3 on msm7201a */
-struct smd_shared_v1 {
-	struct smd_half_channel ch0;
-	unsigned char data0[SMD_BUF_SIZE];
-	struct smd_half_channel ch1;
-	unsigned char data1[SMD_BUF_SIZE];
-};
-
-/* Used on SMD package v4 */
-struct smd_shared_v2 {
-	struct smd_half_channel ch0;
-	struct smd_half_channel ch1;
-};
-
-struct smd_channel {
-	volatile struct smd_half_channel *send;
-	volatile struct smd_half_channel *recv;
-	unsigned char *send_data;
-	unsigned char *recv_data;
-
-	unsigned fifo_mask;
-	unsigned fifo_size;
-	unsigned current_packet;
-	unsigned n;
-
-	struct list_head ch_list;
-
-	void *priv;
-	void (*notify)(void *priv, unsigned flags);
-
-	int (*read)(struct smd_channel *ch, void *data, int len);
-	int (*write)(struct smd_channel *ch, const void *data, int len);
-	int (*read_avail)(struct smd_channel *ch);
-	int (*write_avail)(struct smd_channel *ch);
-
-	void (*update_state)(struct smd_channel *ch);
-	unsigned last_state;
-	void (*notify_other_cpu)(void);
-	unsigned type;
-
-	char name[32];
-	struct platform_device pdev;
-};
-
-#define SMD_TYPE_MASK		0x0FF
-#define SMD_TYPE_APPS_MODEM	0x000
-#define SMD_TYPE_APPS_DSP	0x001
-#define SMD_TYPE_MODEM_DSP	0x002
-
-#define SMD_KIND_MASK		0xF00
-#define SMD_KIND_UNKNOWN	0x000
-#define SMD_KIND_STREAM		0x100
-#define SMD_KIND_PACKET		0x200
-
-extern struct list_head smd_ch_closed_list;
-extern struct list_head smd_ch_list_modem;
-extern struct list_head smd_ch_list_dsp;
-
-extern spinlock_t smd_lock;
-extern spinlock_t smem_lock;
-
-void *smem_find(unsigned id, unsigned size);
-void *smem_item(unsigned id, unsigned *size);
-uint32_t raw_smsm_get_state(enum smsm_state_item item);
-
-extern void msm_init_last_radio_log(struct module *);
-
-#ifdef CONFIG_MSM_SMD_PKG3
-/*
- * This allocator assumes an SMD Package v3 which only exists on
- * MSM7x00 SoC's.
- */
-static inline int _smd_alloc_channel(struct smd_channel *ch)
-{
-	struct smd_shared_v1 *shared1;
-
-	shared1 = smem_alloc(ID_SMD_CHANNELS + ch->n, sizeof(*shared1));
-	if (!shared1) {
-		pr_err("smd_alloc_channel() cid %d does not exist\n", ch->n);
-		return -1;
-	}
-	ch->send = &shared1->ch0;
-	ch->recv = &shared1->ch1;
-	ch->send_data = shared1->data0;
-	ch->recv_data = shared1->data1;
-	ch->fifo_size = SMD_BUF_SIZE;
-	return 0;
-}
-#else
-/*
- * This allocator assumes an SMD Package v4, the most common
- * and the default.
- */
-static inline int _smd_alloc_channel(struct smd_channel *ch)
-{
-	struct smd_shared_v2 *shared2;
-	void *buffer;
-	unsigned buffer_sz;
-
-	shared2 = smem_alloc(SMEM_SMD_BASE_ID + ch->n, sizeof(*shared2));
-	buffer = smem_item(SMEM_SMD_FIFO_BASE_ID + ch->n, &buffer_sz);
-
-	if (!buffer)
-		return -1;
-
-	/* buffer must be a power-of-two size */
-	if (buffer_sz & (buffer_sz - 1))
-		return -1;
-
-	buffer_sz /= 2;
-	ch->send = &shared2->ch0;
-	ch->recv = &shared2->ch1;
-	ch->send_data = buffer;
-	ch->recv_data = buffer + buffer_sz;
-	ch->fifo_size = buffer_sz;
-	return 0;
-}
-#endif /* CONFIG_MSM_SMD_PKG3 */
-
-#if defined(CONFIG_ARCH_MSM7X30)
-static inline void msm_a2m_int(uint32_t irq)
-{
-	writel(1 << irq, MSM_GCC_BASE + 0x8);
-}
-#else
-static inline void msm_a2m_int(uint32_t irq)
-{
-	writel(1, MSM_CSR_BASE + 0x400 + (irq * 4));
-}
-#endif /* CONFIG_ARCH_MSM7X30 */
-
-
-#endif
diff --git a/arch/arm/mach-msm/vreg.c b/arch/arm/mach-msm/vreg.c
deleted file mode 100644
index bd66ed04d6dc..000000000000
--- a/arch/arm/mach-msm/vreg.c
+++ /dev/null
@@ -1,220 +0,0 @@
-/* arch/arm/mach-msm/vreg.c
- *
- * Copyright (C) 2008 Google, Inc.
- * Copyright (c) 2009, Code Aurora Forum. All rights reserved.
- * Author: Brian Swetland <swetland@google.com>
- *
- * 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/kernel.h>
-#include <linux/device.h>
-#include <linux/init.h>
-#include <linux/debugfs.h>
-#include <linux/module.h>
-#include <linux/string.h>
-#include <mach/vreg.h>
-
-#include "proc_comm.h"
-
-struct vreg {
-	const char *name;
-	unsigned id;
-	int status;
-	unsigned refcnt;
-};
-
-#define VREG(_name, _id, _status, _refcnt) \
-	{ .name = _name, .id = _id, .status = _status, .refcnt = _refcnt }
-
-static struct vreg vregs[] = {
-	VREG("msma",	0, 0, 0),
-	VREG("msmp",	1, 0, 0),
-	VREG("msme1",	2, 0, 0),
-	VREG("msmc1",	3, 0, 0),
-	VREG("msmc2",	4, 0, 0),
-	VREG("gp3",	5, 0, 0),
-	VREG("msme2",	6, 0, 0),
-	VREG("gp4",	7, 0, 0),
-	VREG("gp1",	8, 0, 0),
-	VREG("tcxo",	9, 0, 0),
-	VREG("pa",	10, 0, 0),
-	VREG("rftx",	11, 0, 0),
-	VREG("rfrx1",	12, 0, 0),
-	VREG("rfrx2",	13, 0, 0),
-	VREG("synt",	14, 0, 0),
-	VREG("wlan",	15, 0, 0),
-	VREG("usb",	16, 0, 0),
-	VREG("boost",	17, 0, 0),
-	VREG("mmc",	18, 0, 0),
-	VREG("ruim",	19, 0, 0),
-	VREG("msmc0",	20, 0, 0),
-	VREG("gp2",	21, 0, 0),
-	VREG("gp5",	22, 0, 0),
-	VREG("gp6",	23, 0, 0),
-	VREG("rf",	24, 0, 0),
-	VREG("rf_vco",	26, 0, 0),
-	VREG("mpll",	27, 0, 0),
-	VREG("s2",	28, 0, 0),
-	VREG("s3",	29, 0, 0),
-	VREG("rfubm",	30, 0, 0),
-	VREG("ncp",	31, 0, 0),
-	VREG("gp7",	32, 0, 0),
-	VREG("gp8",	33, 0, 0),
-	VREG("gp9",	34, 0, 0),
-	VREG("gp10",	35, 0, 0),
-	VREG("gp11",	36, 0, 0),
-	VREG("gp12",	37, 0, 0),
-	VREG("gp13",	38, 0, 0),
-	VREG("gp14",	39, 0, 0),
-	VREG("gp15",	40, 0, 0),
-	VREG("gp16",	41, 0, 0),
-	VREG("gp17",	42, 0, 0),
-	VREG("s4",	43, 0, 0),
-	VREG("usb2",	44, 0, 0),
-	VREG("wlan2",	45, 0, 0),
-	VREG("xo_out",	46, 0, 0),
-	VREG("lvsw0",	47, 0, 0),
-	VREG("lvsw1",	48, 0, 0),
-};
-
-struct vreg *vreg_get(struct device *dev, const char *id)
-{
-	int n;
-	for (n = 0; n < ARRAY_SIZE(vregs); n++) {
-		if (!strcmp(vregs[n].name, id))
-			return vregs + n;
-	}
-	return ERR_PTR(-ENOENT);
-}
-
-void vreg_put(struct vreg *vreg)
-{
-}
-
-int vreg_enable(struct vreg *vreg)
-{
-	unsigned id = vreg->id;
-	unsigned enable = 1;
-
-	if (vreg->refcnt == 0)
-		vreg->status = msm_proc_comm(PCOM_VREG_SWITCH, &id, &enable);
-
-	if ((vreg->refcnt < UINT_MAX) && (!vreg->status))
-		vreg->refcnt++;
-
-	return vreg->status;
-}
-
-int vreg_disable(struct vreg *vreg)
-{
-	unsigned id = vreg->id;
-	unsigned enable = 0;
-
-	if (!vreg->refcnt)
-		return 0;
-
-	if (vreg->refcnt == 1)
-		vreg->status = msm_proc_comm(PCOM_VREG_SWITCH, &id, &enable);
-
-	if (!vreg->status)
-		vreg->refcnt--;
-
-	return vreg->status;
-}
-
-int vreg_set_level(struct vreg *vreg, unsigned mv)
-{
-	unsigned id = vreg->id;
-
-	vreg->status = msm_proc_comm(PCOM_VREG_SET_LEVEL, &id, &mv);
-	return vreg->status;
-}
-
-#if defined(CONFIG_DEBUG_FS)
-
-static int vreg_debug_set(void *data, u64 val)
-{
-	struct vreg *vreg = data;
-	switch (val) {
-	case 0:
-		vreg_disable(vreg);
-		break;
-	case 1:
-		vreg_enable(vreg);
-		break;
-	default:
-		vreg_set_level(vreg, val);
-		break;
-	}
-	return 0;
-}
-
-static int vreg_debug_get(void *data, u64 *val)
-{
-	struct vreg *vreg = data;
-
-	if (!vreg->status)
-		*val = 0;
-	else
-		*val = 1;
-
-	return 0;
-}
-
-static int vreg_debug_count_set(void *data, u64 val)
-{
-	struct vreg *vreg = data;
-	if (val > UINT_MAX)
-		val = UINT_MAX;
-	vreg->refcnt = val;
-	return 0;
-}
-
-static int vreg_debug_count_get(void *data, u64 *val)
-{
-	struct vreg *vreg = data;
-
-	*val = vreg->refcnt;
-
-	return 0;
-}
-
-DEFINE_SIMPLE_ATTRIBUTE(vreg_fops, vreg_debug_get, vreg_debug_set, "%llu\n");
-DEFINE_SIMPLE_ATTRIBUTE(vreg_count_fops, vreg_debug_count_get,
-			vreg_debug_count_set, "%llu\n");
-
-static int __init vreg_debug_init(void)
-{
-	struct dentry *dent;
-	int n;
-	char name[32];
-	const char *refcnt_name = "_refcnt";
-
-	dent = debugfs_create_dir("vreg", 0);
-	if (IS_ERR(dent))
-		return 0;
-
-	for (n = 0; n < ARRAY_SIZE(vregs); n++) {
-		(void) debugfs_create_file(vregs[n].name, 0644,
-					   dent, vregs + n, &vreg_fops);
-
-		strlcpy(name, vregs[n].name, sizeof(name));
-		strlcat(name, refcnt_name, sizeof(name));
-		(void) debugfs_create_file(name, 0644,
-					   dent, vregs + n, &vreg_count_fops);
-	}
-
-	return 0;
-}
-
-device_initcall(vreg_debug_init);
-#endif
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH 02/12] gpio: Remove gpio-msm-v1 driver
  2015-03-13 18:09 [PATCH 00/12] Remove mach-msm and associated code Stephen Boyd
  2015-03-13 18:09 ` [PATCH 01/12] ARM: Remove mach-msm and associated ARM architecture code Stephen Boyd
@ 2015-03-13 18:09 ` Stephen Boyd
  2015-03-18 12:02   ` Linus Walleij
  2015-03-13 18:09 ` [PATCH 03/12] tty: serial: Remove orphaned serial driver Stephen Boyd
                   ` (10 subsequent siblings)
  12 siblings, 1 reply; 32+ messages in thread
From: Stephen Boyd @ 2015-03-13 18:09 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: linux-arm-kernel, linux-kernel, David Brown, Bryan Huntsman,
	Daniel Walker, Arnd Bergmann, Linus Walleij, Alexandre Courbot

This driver is orphaned now that mach-msm has been removed.
Delete it.

Cc: David Brown <davidb@codeaurora.org>
Cc: Bryan Huntsman <bryanh@codeaurora.org>
Cc: Daniel Walker <dwalker@fifo99.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---

This can be acked and go through arm-soc or applied directly to gpio tree.

 drivers/gpio/Kconfig       |   8 -
 drivers/gpio/Makefile      |   1 -
 drivers/gpio/gpio-msm-v1.c | 714 ---------------------------------------------
 3 files changed, 723 deletions(-)
 delete mode 100644 drivers/gpio/gpio-msm-v1.c

diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index c1e2ca3d9a51..02087e82e77d 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -223,14 +223,6 @@ config GPIO_MPC8XXX
 	  Say Y here if you're going to use hardware that connects to the
 	  MPC512x/831x/834x/837x/8572/8610 GPIOs.
 
-config GPIO_MSM_V1
-	tristate "Qualcomm MSM GPIO v1"
-	depends on GPIOLIB && ARCH_MSM && (ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50)
-	help
-	  Say yes here to support the GPIO interface on ARM v6 based
-	  Qualcomm MSM chips.  Most of the pins on the MSM can be
-	  selected for GPIO, and are controlled by this driver.
-
 config GPIO_MSM_V2
 	tristate "Qualcomm MSM GPIO v2"
 	depends on GPIOLIB && OF && ARCH_QCOM
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index bdda6a94d2cd..aa0f2eaa040b 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -58,7 +58,6 @@ obj-$(CONFIG_GPIO_MOXART)	+= gpio-moxart.o
 obj-$(CONFIG_GPIO_MPC5200)	+= gpio-mpc5200.o
 obj-$(CONFIG_GPIO_MPC8XXX)	+= gpio-mpc8xxx.o
 obj-$(CONFIG_GPIO_MSIC)		+= gpio-msic.o
-obj-$(CONFIG_GPIO_MSM_V1)	+= gpio-msm-v1.o
 obj-$(CONFIG_GPIO_MSM_V2)	+= gpio-msm-v2.o
 obj-$(CONFIG_GPIO_MVEBU)        += gpio-mvebu.o
 obj-$(CONFIG_GPIO_MXC)		+= gpio-mxc.o
diff --git a/drivers/gpio/gpio-msm-v1.c b/drivers/gpio/gpio-msm-v1.c
deleted file mode 100644
index edf285e26667..000000000000
--- a/drivers/gpio/gpio-msm-v1.c
+++ /dev/null
@@ -1,714 +0,0 @@
-/*
- * Copyright (C) 2007 Google, Inc.
- * Copyright (c) 2009-2012, The Linux Foundation. All rights reserved.
- *
- * 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/bitops.h>
-#include <linux/gpio.h>
-#include <linux/interrupt.h>
-#include <linux/io.h>
-#include <linux/irq.h>
-#include <linux/module.h>
-#include <linux/device.h>
-#include <linux/platform_device.h>
-#include <linux/err.h>
-
-#include <mach/msm_gpiomux.h>
-
-/* see 80-VA736-2 Rev C pp 695-751
-**
-** These are actually the *shadow* gpio registers, since the
-** real ones (which allow full access) are only available to the
-** ARM9 side of the world.
-**
-** Since the _BASE need to be page-aligned when we're mapping them
-** to virtual addresses, adjust for the additional offset in these
-** macros.
-*/
-
-#define MSM_GPIO1_REG(off) (off)
-#define MSM_GPIO2_REG(off) (off)
-#define MSM_GPIO1_SHADOW_REG(off) (off)
-#define MSM_GPIO2_SHADOW_REG(off) (off)
-
-/*
- * MSM7X00 registers
- */
-/* output value */
-#define MSM7X00_GPIO_OUT_0	MSM_GPIO1_SHADOW_REG(0x00)  /* gpio  15-0  */
-#define MSM7X00_GPIO_OUT_1	MSM_GPIO2_SHADOW_REG(0x00)  /* gpio  42-16 */
-#define MSM7X00_GPIO_OUT_2	MSM_GPIO1_SHADOW_REG(0x04)  /* gpio  67-43 */
-#define MSM7X00_GPIO_OUT_3	MSM_GPIO1_SHADOW_REG(0x08)  /* gpio  94-68 */
-#define MSM7X00_GPIO_OUT_4	MSM_GPIO1_SHADOW_REG(0x0C)  /* gpio 106-95 */
-#define MSM7X00_GPIO_OUT_5	MSM_GPIO1_SHADOW_REG(0x50)  /* gpio 107-121 */
-
-/* same pin map as above, output enable */
-#define MSM7X00_GPIO_OE_0	MSM_GPIO1_SHADOW_REG(0x10)
-#define MSM7X00_GPIO_OE_1	MSM_GPIO2_SHADOW_REG(0x08)
-#define MSM7X00_GPIO_OE_2	MSM_GPIO1_SHADOW_REG(0x14)
-#define MSM7X00_GPIO_OE_3	MSM_GPIO1_SHADOW_REG(0x18)
-#define MSM7X00_GPIO_OE_4	MSM_GPIO1_SHADOW_REG(0x1C)
-#define MSM7X00_GPIO_OE_5	MSM_GPIO1_SHADOW_REG(0x54)
-
-/* same pin map as above, input read */
-#define MSM7X00_GPIO_IN_0	MSM_GPIO1_SHADOW_REG(0x34)
-#define MSM7X00_GPIO_IN_1	MSM_GPIO2_SHADOW_REG(0x20)
-#define MSM7X00_GPIO_IN_2	MSM_GPIO1_SHADOW_REG(0x38)
-#define MSM7X00_GPIO_IN_3	MSM_GPIO1_SHADOW_REG(0x3C)
-#define MSM7X00_GPIO_IN_4	MSM_GPIO1_SHADOW_REG(0x40)
-#define MSM7X00_GPIO_IN_5	MSM_GPIO1_SHADOW_REG(0x44)
-
-/* same pin map as above, 1=edge 0=level interrup */
-#define MSM7X00_GPIO_INT_EDGE_0	MSM_GPIO1_SHADOW_REG(0x60)
-#define MSM7X00_GPIO_INT_EDGE_1	MSM_GPIO2_SHADOW_REG(0x50)
-#define MSM7X00_GPIO_INT_EDGE_2	MSM_GPIO1_SHADOW_REG(0x64)
-#define MSM7X00_GPIO_INT_EDGE_3	MSM_GPIO1_SHADOW_REG(0x68)
-#define MSM7X00_GPIO_INT_EDGE_4	MSM_GPIO1_SHADOW_REG(0x6C)
-#define MSM7X00_GPIO_INT_EDGE_5	MSM_GPIO1_SHADOW_REG(0xC0)
-
-/* same pin map as above, 1=positive 0=negative */
-#define MSM7X00_GPIO_INT_POS_0	MSM_GPIO1_SHADOW_REG(0x70)
-#define MSM7X00_GPIO_INT_POS_1	MSM_GPIO2_SHADOW_REG(0x58)
-#define MSM7X00_GPIO_INT_POS_2	MSM_GPIO1_SHADOW_REG(0x74)
-#define MSM7X00_GPIO_INT_POS_3	MSM_GPIO1_SHADOW_REG(0x78)
-#define MSM7X00_GPIO_INT_POS_4	MSM_GPIO1_SHADOW_REG(0x7C)
-#define MSM7X00_GPIO_INT_POS_5	MSM_GPIO1_SHADOW_REG(0xBC)
-
-/* same pin map as above, interrupt enable */
-#define MSM7X00_GPIO_INT_EN_0	MSM_GPIO1_SHADOW_REG(0x80)
-#define MSM7X00_GPIO_INT_EN_1	MSM_GPIO2_SHADOW_REG(0x60)
-#define MSM7X00_GPIO_INT_EN_2	MSM_GPIO1_SHADOW_REG(0x84)
-#define MSM7X00_GPIO_INT_EN_3	MSM_GPIO1_SHADOW_REG(0x88)
-#define MSM7X00_GPIO_INT_EN_4	MSM_GPIO1_SHADOW_REG(0x8C)
-#define MSM7X00_GPIO_INT_EN_5	MSM_GPIO1_SHADOW_REG(0xB8)
-
-/* same pin map as above, write 1 to clear interrupt */
-#define MSM7X00_GPIO_INT_CLEAR_0	MSM_GPIO1_SHADOW_REG(0x90)
-#define MSM7X00_GPIO_INT_CLEAR_1	MSM_GPIO2_SHADOW_REG(0x68)
-#define MSM7X00_GPIO_INT_CLEAR_2	MSM_GPIO1_SHADOW_REG(0x94)
-#define MSM7X00_GPIO_INT_CLEAR_3	MSM_GPIO1_SHADOW_REG(0x98)
-#define MSM7X00_GPIO_INT_CLEAR_4	MSM_GPIO1_SHADOW_REG(0x9C)
-#define MSM7X00_GPIO_INT_CLEAR_5	MSM_GPIO1_SHADOW_REG(0xB4)
-
-/* same pin map as above, 1=interrupt pending */
-#define MSM7X00_GPIO_INT_STATUS_0	MSM_GPIO1_SHADOW_REG(0xA0)
-#define MSM7X00_GPIO_INT_STATUS_1	MSM_GPIO2_SHADOW_REG(0x70)
-#define MSM7X00_GPIO_INT_STATUS_2	MSM_GPIO1_SHADOW_REG(0xA4)
-#define MSM7X00_GPIO_INT_STATUS_3	MSM_GPIO1_SHADOW_REG(0xA8)
-#define MSM7X00_GPIO_INT_STATUS_4	MSM_GPIO1_SHADOW_REG(0xAC)
-#define MSM7X00_GPIO_INT_STATUS_5	MSM_GPIO1_SHADOW_REG(0xB0)
-
-/*
- * QSD8X50 registers
- */
-/* output value */
-#define QSD8X50_GPIO_OUT_0	MSM_GPIO1_SHADOW_REG(0x00)  /* gpio  15-0   */
-#define QSD8X50_GPIO_OUT_1	MSM_GPIO2_SHADOW_REG(0x00)  /* gpio  42-16  */
-#define QSD8X50_GPIO_OUT_2	MSM_GPIO1_SHADOW_REG(0x04)  /* gpio  67-43  */
-#define QSD8X50_GPIO_OUT_3	MSM_GPIO1_SHADOW_REG(0x08)  /* gpio  94-68  */
-#define QSD8X50_GPIO_OUT_4	MSM_GPIO1_SHADOW_REG(0x0C)  /* gpio 103-95  */
-#define QSD8X50_GPIO_OUT_5	MSM_GPIO1_SHADOW_REG(0x10)  /* gpio 121-104 */
-#define QSD8X50_GPIO_OUT_6	MSM_GPIO1_SHADOW_REG(0x14)  /* gpio 152-122 */
-#define QSD8X50_GPIO_OUT_7	MSM_GPIO1_SHADOW_REG(0x18)  /* gpio 164-153 */
-
-/* same pin map as above, output enable */
-#define QSD8X50_GPIO_OE_0	MSM_GPIO1_SHADOW_REG(0x20)
-#define QSD8X50_GPIO_OE_1	MSM_GPIO2_SHADOW_REG(0x08)
-#define QSD8X50_GPIO_OE_2	MSM_GPIO1_SHADOW_REG(0x24)
-#define QSD8X50_GPIO_OE_3	MSM_GPIO1_SHADOW_REG(0x28)
-#define QSD8X50_GPIO_OE_4	MSM_GPIO1_SHADOW_REG(0x2C)
-#define QSD8X50_GPIO_OE_5	MSM_GPIO1_SHADOW_REG(0x30)
-#define QSD8X50_GPIO_OE_6	MSM_GPIO1_SHADOW_REG(0x34)
-#define QSD8X50_GPIO_OE_7	MSM_GPIO1_SHADOW_REG(0x38)
-
-/* same pin map as above, input read */
-#define QSD8X50_GPIO_IN_0	MSM_GPIO1_SHADOW_REG(0x50)
-#define QSD8X50_GPIO_IN_1	MSM_GPIO2_SHADOW_REG(0x20)
-#define QSD8X50_GPIO_IN_2	MSM_GPIO1_SHADOW_REG(0x54)
-#define QSD8X50_GPIO_IN_3	MSM_GPIO1_SHADOW_REG(0x58)
-#define QSD8X50_GPIO_IN_4	MSM_GPIO1_SHADOW_REG(0x5C)
-#define QSD8X50_GPIO_IN_5	MSM_GPIO1_SHADOW_REG(0x60)
-#define QSD8X50_GPIO_IN_6	MSM_GPIO1_SHADOW_REG(0x64)
-#define QSD8X50_GPIO_IN_7	MSM_GPIO1_SHADOW_REG(0x68)
-
-/* same pin map as above, 1=edge 0=level interrup */
-#define QSD8X50_GPIO_INT_EDGE_0	MSM_GPIO1_SHADOW_REG(0x70)
-#define QSD8X50_GPIO_INT_EDGE_1	MSM_GPIO2_SHADOW_REG(0x50)
-#define QSD8X50_GPIO_INT_EDGE_2	MSM_GPIO1_SHADOW_REG(0x74)
-#define QSD8X50_GPIO_INT_EDGE_3	MSM_GPIO1_SHADOW_REG(0x78)
-#define QSD8X50_GPIO_INT_EDGE_4	MSM_GPIO1_SHADOW_REG(0x7C)
-#define QSD8X50_GPIO_INT_EDGE_5	MSM_GPIO1_SHADOW_REG(0x80)
-#define QSD8X50_GPIO_INT_EDGE_6	MSM_GPIO1_SHADOW_REG(0x84)
-#define QSD8X50_GPIO_INT_EDGE_7	MSM_GPIO1_SHADOW_REG(0x88)
-
-/* same pin map as above, 1=positive 0=negative */
-#define QSD8X50_GPIO_INT_POS_0	MSM_GPIO1_SHADOW_REG(0x90)
-#define QSD8X50_GPIO_INT_POS_1	MSM_GPIO2_SHADOW_REG(0x58)
-#define QSD8X50_GPIO_INT_POS_2	MSM_GPIO1_SHADOW_REG(0x94)
-#define QSD8X50_GPIO_INT_POS_3	MSM_GPIO1_SHADOW_REG(0x98)
-#define QSD8X50_GPIO_INT_POS_4	MSM_GPIO1_SHADOW_REG(0x9C)
-#define QSD8X50_GPIO_INT_POS_5	MSM_GPIO1_SHADOW_REG(0xA0)
-#define QSD8X50_GPIO_INT_POS_6	MSM_GPIO1_SHADOW_REG(0xA4)
-#define QSD8X50_GPIO_INT_POS_7	MSM_GPIO1_SHADOW_REG(0xA8)
-
-/* same pin map as above, interrupt enable */
-#define QSD8X50_GPIO_INT_EN_0	MSM_GPIO1_SHADOW_REG(0xB0)
-#define QSD8X50_GPIO_INT_EN_1	MSM_GPIO2_SHADOW_REG(0x60)
-#define QSD8X50_GPIO_INT_EN_2	MSM_GPIO1_SHADOW_REG(0xB4)
-#define QSD8X50_GPIO_INT_EN_3	MSM_GPIO1_SHADOW_REG(0xB8)
-#define QSD8X50_GPIO_INT_EN_4	MSM_GPIO1_SHADOW_REG(0xBC)
-#define QSD8X50_GPIO_INT_EN_5	MSM_GPIO1_SHADOW_REG(0xC0)
-#define QSD8X50_GPIO_INT_EN_6	MSM_GPIO1_SHADOW_REG(0xC4)
-#define QSD8X50_GPIO_INT_EN_7	MSM_GPIO1_SHADOW_REG(0xC8)
-
-/* same pin map as above, write 1 to clear interrupt */
-#define QSD8X50_GPIO_INT_CLEAR_0	MSM_GPIO1_SHADOW_REG(0xD0)
-#define QSD8X50_GPIO_INT_CLEAR_1	MSM_GPIO2_SHADOW_REG(0x68)
-#define QSD8X50_GPIO_INT_CLEAR_2	MSM_GPIO1_SHADOW_REG(0xD4)
-#define QSD8X50_GPIO_INT_CLEAR_3	MSM_GPIO1_SHADOW_REG(0xD8)
-#define QSD8X50_GPIO_INT_CLEAR_4	MSM_GPIO1_SHADOW_REG(0xDC)
-#define QSD8X50_GPIO_INT_CLEAR_5	MSM_GPIO1_SHADOW_REG(0xE0)
-#define QSD8X50_GPIO_INT_CLEAR_6	MSM_GPIO1_SHADOW_REG(0xE4)
-#define QSD8X50_GPIO_INT_CLEAR_7	MSM_GPIO1_SHADOW_REG(0xE8)
-
-/* same pin map as above, 1=interrupt pending */
-#define QSD8X50_GPIO_INT_STATUS_0	MSM_GPIO1_SHADOW_REG(0xF0)
-#define QSD8X50_GPIO_INT_STATUS_1	MSM_GPIO2_SHADOW_REG(0x70)
-#define QSD8X50_GPIO_INT_STATUS_2	MSM_GPIO1_SHADOW_REG(0xF4)
-#define QSD8X50_GPIO_INT_STATUS_3	MSM_GPIO1_SHADOW_REG(0xF8)
-#define QSD8X50_GPIO_INT_STATUS_4	MSM_GPIO1_SHADOW_REG(0xFC)
-#define QSD8X50_GPIO_INT_STATUS_5	MSM_GPIO1_SHADOW_REG(0x100)
-#define QSD8X50_GPIO_INT_STATUS_6	MSM_GPIO1_SHADOW_REG(0x104)
-#define QSD8X50_GPIO_INT_STATUS_7	MSM_GPIO1_SHADOW_REG(0x108)
-
-/*
- * MSM7X30 registers
- */
-/* output value */
-#define MSM7X30_GPIO_OUT_0	MSM_GPIO1_REG(0x00)   /* gpio  15-0   */
-#define MSM7X30_GPIO_OUT_1	MSM_GPIO2_REG(0x00)   /* gpio  43-16  */
-#define MSM7X30_GPIO_OUT_2	MSM_GPIO1_REG(0x04)   /* gpio  67-44  */
-#define MSM7X30_GPIO_OUT_3	MSM_GPIO1_REG(0x08)   /* gpio  94-68  */
-#define MSM7X30_GPIO_OUT_4	MSM_GPIO1_REG(0x0C)   /* gpio 106-95  */
-#define MSM7X30_GPIO_OUT_5	MSM_GPIO1_REG(0x50)   /* gpio 133-107 */
-#define MSM7X30_GPIO_OUT_6	MSM_GPIO1_REG(0xC4)   /* gpio 150-134 */
-#define MSM7X30_GPIO_OUT_7	MSM_GPIO1_REG(0x214)  /* gpio 181-151 */
-
-/* same pin map as above, output enable */
-#define MSM7X30_GPIO_OE_0	MSM_GPIO1_REG(0x10)
-#define MSM7X30_GPIO_OE_1	MSM_GPIO2_REG(0x08)
-#define MSM7X30_GPIO_OE_2	MSM_GPIO1_REG(0x14)
-#define MSM7X30_GPIO_OE_3	MSM_GPIO1_REG(0x18)
-#define MSM7X30_GPIO_OE_4	MSM_GPIO1_REG(0x1C)
-#define MSM7X30_GPIO_OE_5	MSM_GPIO1_REG(0x54)
-#define MSM7X30_GPIO_OE_6	MSM_GPIO1_REG(0xC8)
-#define MSM7X30_GPIO_OE_7	MSM_GPIO1_REG(0x218)
-
-/* same pin map as above, input read */
-#define MSM7X30_GPIO_IN_0	MSM_GPIO1_REG(0x34)
-#define MSM7X30_GPIO_IN_1	MSM_GPIO2_REG(0x20)
-#define MSM7X30_GPIO_IN_2	MSM_GPIO1_REG(0x38)
-#define MSM7X30_GPIO_IN_3	MSM_GPIO1_REG(0x3C)
-#define MSM7X30_GPIO_IN_4	MSM_GPIO1_REG(0x40)
-#define MSM7X30_GPIO_IN_5	MSM_GPIO1_REG(0x44)
-#define MSM7X30_GPIO_IN_6	MSM_GPIO1_REG(0xCC)
-#define MSM7X30_GPIO_IN_7	MSM_GPIO1_REG(0x21C)
-
-/* same pin map as above, 1=edge 0=level interrup */
-#define MSM7X30_GPIO_INT_EDGE_0	MSM_GPIO1_REG(0x60)
-#define MSM7X30_GPIO_INT_EDGE_1	MSM_GPIO2_REG(0x50)
-#define MSM7X30_GPIO_INT_EDGE_2	MSM_GPIO1_REG(0x64)
-#define MSM7X30_GPIO_INT_EDGE_3	MSM_GPIO1_REG(0x68)
-#define MSM7X30_GPIO_INT_EDGE_4	MSM_GPIO1_REG(0x6C)
-#define MSM7X30_GPIO_INT_EDGE_5	MSM_GPIO1_REG(0xC0)
-#define MSM7X30_GPIO_INT_EDGE_6	MSM_GPIO1_REG(0xD0)
-#define MSM7X30_GPIO_INT_EDGE_7	MSM_GPIO1_REG(0x240)
-
-/* same pin map as above, 1=positive 0=negative */
-#define MSM7X30_GPIO_INT_POS_0	MSM_GPIO1_REG(0x70)
-#define MSM7X30_GPIO_INT_POS_1	MSM_GPIO2_REG(0x58)
-#define MSM7X30_GPIO_INT_POS_2	MSM_GPIO1_REG(0x74)
-#define MSM7X30_GPIO_INT_POS_3	MSM_GPIO1_REG(0x78)
-#define MSM7X30_GPIO_INT_POS_4	MSM_GPIO1_REG(0x7C)
-#define MSM7X30_GPIO_INT_POS_5	MSM_GPIO1_REG(0xBC)
-#define MSM7X30_GPIO_INT_POS_6	MSM_GPIO1_REG(0xD4)
-#define MSM7X30_GPIO_INT_POS_7	MSM_GPIO1_REG(0x228)
-
-/* same pin map as above, interrupt enable */
-#define MSM7X30_GPIO_INT_EN_0	MSM_GPIO1_REG(0x80)
-#define MSM7X30_GPIO_INT_EN_1	MSM_GPIO2_REG(0x60)
-#define MSM7X30_GPIO_INT_EN_2	MSM_GPIO1_REG(0x84)
-#define MSM7X30_GPIO_INT_EN_3	MSM_GPIO1_REG(0x88)
-#define MSM7X30_GPIO_INT_EN_4	MSM_GPIO1_REG(0x8C)
-#define MSM7X30_GPIO_INT_EN_5	MSM_GPIO1_REG(0xB8)
-#define MSM7X30_GPIO_INT_EN_6	MSM_GPIO1_REG(0xD8)
-#define MSM7X30_GPIO_INT_EN_7	MSM_GPIO1_REG(0x22C)
-
-/* same pin map as above, write 1 to clear interrupt */
-#define MSM7X30_GPIO_INT_CLEAR_0	MSM_GPIO1_REG(0x90)
-#define MSM7X30_GPIO_INT_CLEAR_1	MSM_GPIO2_REG(0x68)
-#define MSM7X30_GPIO_INT_CLEAR_2	MSM_GPIO1_REG(0x94)
-#define MSM7X30_GPIO_INT_CLEAR_3	MSM_GPIO1_REG(0x98)
-#define MSM7X30_GPIO_INT_CLEAR_4	MSM_GPIO1_REG(0x9C)
-#define MSM7X30_GPIO_INT_CLEAR_5	MSM_GPIO1_REG(0xB4)
-#define MSM7X30_GPIO_INT_CLEAR_6	MSM_GPIO1_REG(0xDC)
-#define MSM7X30_GPIO_INT_CLEAR_7	MSM_GPIO1_REG(0x230)
-
-/* same pin map as above, 1=interrupt pending */
-#define MSM7X30_GPIO_INT_STATUS_0	MSM_GPIO1_REG(0xA0)
-#define MSM7X30_GPIO_INT_STATUS_1	MSM_GPIO2_REG(0x70)
-#define MSM7X30_GPIO_INT_STATUS_2	MSM_GPIO1_REG(0xA4)
-#define MSM7X30_GPIO_INT_STATUS_3	MSM_GPIO1_REG(0xA8)
-#define MSM7X30_GPIO_INT_STATUS_4	MSM_GPIO1_REG(0xAC)
-#define MSM7X30_GPIO_INT_STATUS_5	MSM_GPIO1_REG(0xB0)
-#define MSM7X30_GPIO_INT_STATUS_6	MSM_GPIO1_REG(0xE0)
-#define MSM7X30_GPIO_INT_STATUS_7	MSM_GPIO1_REG(0x234)
-
-#define FIRST_GPIO_IRQ MSM_GPIO_TO_INT(0)
-
-#define MSM_GPIO_BANK(soc, bank, first, last)				\
-	{								\
-		.regs[MSM_GPIO_OUT] =         soc##_GPIO_OUT_##bank,	\
-		.regs[MSM_GPIO_IN] =          soc##_GPIO_IN_##bank,	\
-		.regs[MSM_GPIO_INT_STATUS] =  soc##_GPIO_INT_STATUS_##bank, \
-		.regs[MSM_GPIO_INT_CLEAR] =   soc##_GPIO_INT_CLEAR_##bank, \
-		.regs[MSM_GPIO_INT_EN] =      soc##_GPIO_INT_EN_##bank,	\
-		.regs[MSM_GPIO_INT_EDGE] =    soc##_GPIO_INT_EDGE_##bank, \
-		.regs[MSM_GPIO_INT_POS] =     soc##_GPIO_INT_POS_##bank, \
-		.regs[MSM_GPIO_OE] =          soc##_GPIO_OE_##bank,	\
-		.chip = {						\
-			.base = (first),				\
-			.ngpio = (last) - (first) + 1,			\
-			.get = msm_gpio_get,				\
-			.set = msm_gpio_set,				\
-			.direction_input = msm_gpio_direction_input,	\
-			.direction_output = msm_gpio_direction_output,	\
-			.to_irq = msm_gpio_to_irq,			\
-			.request = msm_gpio_request,			\
-			.free = msm_gpio_free,				\
-		}							\
-	}
-
-#define MSM_GPIO_BROKEN_INT_CLEAR 1
-
-enum msm_gpio_reg {
-	MSM_GPIO_IN,
-	MSM_GPIO_OUT,
-	MSM_GPIO_INT_STATUS,
-	MSM_GPIO_INT_CLEAR,
-	MSM_GPIO_INT_EN,
-	MSM_GPIO_INT_EDGE,
-	MSM_GPIO_INT_POS,
-	MSM_GPIO_OE,
-	MSM_GPIO_REG_NR
-};
-
-struct msm_gpio_chip {
-	spinlock_t		lock;
-	struct gpio_chip	chip;
-	unsigned long		regs[MSM_GPIO_REG_NR];
-#if MSM_GPIO_BROKEN_INT_CLEAR
-	unsigned                int_status_copy;
-#endif
-	unsigned int            both_edge_detect;
-	unsigned int            int_enable[2]; /* 0: awake, 1: sleep */
-	void __iomem		*base;
-};
-
-struct msm_gpio_initdata {
-	struct msm_gpio_chip *chips;
-	int count;
-};
-
-static void msm_gpio_writel(struct msm_gpio_chip *chip, u32 val,
-			    enum msm_gpio_reg reg)
-{
-	writel(val, chip->base + chip->regs[reg]);
-}
-
-static u32 msm_gpio_readl(struct msm_gpio_chip *chip, enum msm_gpio_reg reg)
-{
-	return readl(chip->base + chip->regs[reg]);
-}
-
-static int msm_gpio_write(struct msm_gpio_chip *msm_chip,
-			  unsigned offset, unsigned on)
-{
-	unsigned mask = BIT(offset);
-	unsigned val;
-
-	val = msm_gpio_readl(msm_chip, MSM_GPIO_OUT);
-	if (on)
-		msm_gpio_writel(msm_chip, val | mask, MSM_GPIO_OUT);
-	else
-		msm_gpio_writel(msm_chip, val & ~mask, MSM_GPIO_OUT);
-	return 0;
-}
-
-static void msm_gpio_update_both_edge_detect(struct msm_gpio_chip *msm_chip)
-{
-	int loop_limit = 100;
-	unsigned pol, val, val2, intstat;
-	do {
-		val = msm_gpio_readl(msm_chip, MSM_GPIO_IN);
-		pol = msm_gpio_readl(msm_chip, MSM_GPIO_INT_POS);
-		pol = (pol & ~msm_chip->both_edge_detect) |
-		      (~val & msm_chip->both_edge_detect);
-		msm_gpio_writel(msm_chip, pol, MSM_GPIO_INT_POS);
-		intstat = msm_gpio_readl(msm_chip, MSM_GPIO_INT_STATUS);
-		val2 = msm_gpio_readl(msm_chip, MSM_GPIO_IN);
-		if (((val ^ val2) & msm_chip->both_edge_detect & ~intstat) == 0)
-			return;
-	} while (loop_limit-- > 0);
-	printk(KERN_ERR "msm_gpio_update_both_edge_detect, "
-	       "failed to reach stable state %x != %x\n", val, val2);
-}
-
-static int msm_gpio_clear_detect_status(struct msm_gpio_chip *msm_chip,
-					unsigned offset)
-{
-	unsigned bit = BIT(offset);
-
-#if MSM_GPIO_BROKEN_INT_CLEAR
-	/* Save interrupts that already triggered before we loose them. */
-	/* Any interrupt that triggers between the read of int_status */
-	/* and the write to int_clear will still be lost though. */
-	msm_chip->int_status_copy |=
-		msm_gpio_readl(msm_chip, MSM_GPIO_INT_STATUS);
-	msm_chip->int_status_copy &= ~bit;
-#endif
-	msm_gpio_writel(msm_chip, bit, MSM_GPIO_INT_CLEAR);
-	msm_gpio_update_both_edge_detect(msm_chip);
-	return 0;
-}
-
-static int msm_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
-{
-	struct msm_gpio_chip *msm_chip;
-	unsigned long irq_flags;
-	u32 val;
-
-	msm_chip = container_of(chip, struct msm_gpio_chip, chip);
-	spin_lock_irqsave(&msm_chip->lock, irq_flags);
-	val = msm_gpio_readl(msm_chip, MSM_GPIO_OE) & ~BIT(offset);
-	msm_gpio_writel(msm_chip, val, MSM_GPIO_OE);
-	spin_unlock_irqrestore(&msm_chip->lock, irq_flags);
-	return 0;
-}
-
-static int
-msm_gpio_direction_output(struct gpio_chip *chip, unsigned offset, int value)
-{
-	struct msm_gpio_chip *msm_chip;
-	unsigned long irq_flags;
-	u32 val;
-
-	msm_chip = container_of(chip, struct msm_gpio_chip, chip);
-	spin_lock_irqsave(&msm_chip->lock, irq_flags);
-	msm_gpio_write(msm_chip, offset, value);
-	val = msm_gpio_readl(msm_chip, MSM_GPIO_OE) | BIT(offset);
-	msm_gpio_writel(msm_chip, val, MSM_GPIO_OE);
-	spin_unlock_irqrestore(&msm_chip->lock, irq_flags);
-	return 0;
-}
-
-static int msm_gpio_get(struct gpio_chip *chip, unsigned offset)
-{
-	struct msm_gpio_chip *msm_chip;
-
-	msm_chip = container_of(chip, struct msm_gpio_chip, chip);
-	return (msm_gpio_readl(msm_chip, MSM_GPIO_IN) & (1U << offset)) ? 1 : 0;
-}
-
-static void msm_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
-{
-	struct msm_gpio_chip *msm_chip;
-	unsigned long irq_flags;
-
-	msm_chip = container_of(chip, struct msm_gpio_chip, chip);
-	spin_lock_irqsave(&msm_chip->lock, irq_flags);
-	msm_gpio_write(msm_chip, offset, value);
-	spin_unlock_irqrestore(&msm_chip->lock, irq_flags);
-}
-
-static int msm_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
-{
-	return MSM_GPIO_TO_INT(chip->base + offset);
-}
-
-#ifdef CONFIG_MSM_GPIOMUX
-static int msm_gpio_request(struct gpio_chip *chip, unsigned offset)
-{
-	return msm_gpiomux_get(chip->base + offset);
-}
-
-static void msm_gpio_free(struct gpio_chip *chip, unsigned offset)
-{
-	msm_gpiomux_put(chip->base + offset);
-}
-#else
-#define msm_gpio_request NULL
-#define msm_gpio_free NULL
-#endif
-
-static struct msm_gpio_chip *msm_gpio_chips;
-static int msm_gpio_count;
-
-static struct msm_gpio_chip msm_gpio_chips_msm7x01[] = {
-	MSM_GPIO_BANK(MSM7X00, 0,   0,  15),
-	MSM_GPIO_BANK(MSM7X00, 1,  16,  42),
-	MSM_GPIO_BANK(MSM7X00, 2,  43,  67),
-	MSM_GPIO_BANK(MSM7X00, 3,  68,  94),
-	MSM_GPIO_BANK(MSM7X00, 4,  95, 106),
-	MSM_GPIO_BANK(MSM7X00, 5, 107, 121),
-};
-
-static struct msm_gpio_initdata msm_gpio_7x01_init = {
-	.chips = msm_gpio_chips_msm7x01,
-	.count = ARRAY_SIZE(msm_gpio_chips_msm7x01),
-};
-
-static struct msm_gpio_chip msm_gpio_chips_msm7x30[] = {
-	MSM_GPIO_BANK(MSM7X30, 0,   0,  15),
-	MSM_GPIO_BANK(MSM7X30, 1,  16,  43),
-	MSM_GPIO_BANK(MSM7X30, 2,  44,  67),
-	MSM_GPIO_BANK(MSM7X30, 3,  68,  94),
-	MSM_GPIO_BANK(MSM7X30, 4,  95, 106),
-	MSM_GPIO_BANK(MSM7X30, 5, 107, 133),
-	MSM_GPIO_BANK(MSM7X30, 6, 134, 150),
-	MSM_GPIO_BANK(MSM7X30, 7, 151, 181),
-};
-
-static struct msm_gpio_initdata msm_gpio_7x30_init = {
-	.chips = msm_gpio_chips_msm7x30,
-	.count = ARRAY_SIZE(msm_gpio_chips_msm7x30),
-};
-
-static struct msm_gpio_chip msm_gpio_chips_qsd8x50[] = {
-	MSM_GPIO_BANK(QSD8X50, 0,   0,  15),
-	MSM_GPIO_BANK(QSD8X50, 1,  16,  42),
-	MSM_GPIO_BANK(QSD8X50, 2,  43,  67),
-	MSM_GPIO_BANK(QSD8X50, 3,  68,  94),
-	MSM_GPIO_BANK(QSD8X50, 4,  95, 103),
-	MSM_GPIO_BANK(QSD8X50, 5, 104, 121),
-	MSM_GPIO_BANK(QSD8X50, 6, 122, 152),
-	MSM_GPIO_BANK(QSD8X50, 7, 153, 164),
-};
-
-static struct msm_gpio_initdata msm_gpio_8x50_init = {
-	.chips = msm_gpio_chips_qsd8x50,
-	.count = ARRAY_SIZE(msm_gpio_chips_qsd8x50),
-};
-
-static void msm_gpio_irq_ack(struct irq_data *d)
-{
-	unsigned long irq_flags;
-	struct msm_gpio_chip *msm_chip = irq_data_get_irq_chip_data(d);
-	spin_lock_irqsave(&msm_chip->lock, irq_flags);
-	msm_gpio_clear_detect_status(msm_chip,
-				     d->irq - gpio_to_irq(msm_chip->chip.base));
-	spin_unlock_irqrestore(&msm_chip->lock, irq_flags);
-}
-
-static void msm_gpio_irq_mask(struct irq_data *d)
-{
-	unsigned long irq_flags;
-	struct msm_gpio_chip *msm_chip = irq_data_get_irq_chip_data(d);
-	unsigned offset = d->irq - gpio_to_irq(msm_chip->chip.base);
-
-	spin_lock_irqsave(&msm_chip->lock, irq_flags);
-	/* level triggered interrupts are also latched */
-	if (!(msm_gpio_readl(msm_chip, MSM_GPIO_INT_EDGE) & BIT(offset)))
-		msm_gpio_clear_detect_status(msm_chip, offset);
-	msm_chip->int_enable[0] &= ~BIT(offset);
-	msm_gpio_writel(msm_chip, msm_chip->int_enable[0], MSM_GPIO_INT_EN);
-	spin_unlock_irqrestore(&msm_chip->lock, irq_flags);
-}
-
-static void msm_gpio_irq_unmask(struct irq_data *d)
-{
-	unsigned long irq_flags;
-	struct msm_gpio_chip *msm_chip = irq_data_get_irq_chip_data(d);
-	unsigned offset = d->irq - gpio_to_irq(msm_chip->chip.base);
-
-	spin_lock_irqsave(&msm_chip->lock, irq_flags);
-	/* level triggered interrupts are also latched */
-	if (!(msm_gpio_readl(msm_chip, MSM_GPIO_INT_EDGE) & BIT(offset)))
-		msm_gpio_clear_detect_status(msm_chip, offset);
-	msm_chip->int_enable[0] |= BIT(offset);
-	msm_gpio_writel(msm_chip, msm_chip->int_enable[0], MSM_GPIO_INT_EN);
-	spin_unlock_irqrestore(&msm_chip->lock, irq_flags);
-}
-
-static int msm_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
-{
-	unsigned long irq_flags;
-	struct msm_gpio_chip *msm_chip = irq_data_get_irq_chip_data(d);
-	unsigned offset = d->irq - gpio_to_irq(msm_chip->chip.base);
-
-	spin_lock_irqsave(&msm_chip->lock, irq_flags);
-
-	if (on)
-		msm_chip->int_enable[1] |= BIT(offset);
-	else
-		msm_chip->int_enable[1] &= ~BIT(offset);
-
-	spin_unlock_irqrestore(&msm_chip->lock, irq_flags);
-	return 0;
-}
-
-static int msm_gpio_irq_set_type(struct irq_data *d, unsigned int flow_type)
-{
-	unsigned long irq_flags;
-	struct msm_gpio_chip *msm_chip = irq_data_get_irq_chip_data(d);
-	unsigned offset = d->irq - gpio_to_irq(msm_chip->chip.base);
-	unsigned val, mask = BIT(offset);
-
-	spin_lock_irqsave(&msm_chip->lock, irq_flags);
-	val = msm_gpio_readl(msm_chip, MSM_GPIO_INT_EDGE);
-	if (flow_type & IRQ_TYPE_EDGE_BOTH) {
-		msm_gpio_writel(msm_chip, val | mask, MSM_GPIO_INT_EDGE);
-		__irq_set_handler_locked(d->irq, handle_edge_irq);
-	} else {
-		msm_gpio_writel(msm_chip, val & ~mask, MSM_GPIO_INT_EDGE);
-		__irq_set_handler_locked(d->irq, handle_level_irq);
-	}
-	if ((flow_type & IRQ_TYPE_EDGE_BOTH) == IRQ_TYPE_EDGE_BOTH) {
-		msm_chip->both_edge_detect |= mask;
-		msm_gpio_update_both_edge_detect(msm_chip);
-	} else {
-		msm_chip->both_edge_detect &= ~mask;
-		val = msm_gpio_readl(msm_chip, MSM_GPIO_INT_POS);
-		if (flow_type & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_HIGH))
-			val |= mask;
-		else
-			val &= ~mask;
-		msm_gpio_writel(msm_chip, val, MSM_GPIO_INT_POS);
-	}
-	spin_unlock_irqrestore(&msm_chip->lock, irq_flags);
-	return 0;
-}
-
-static void msm_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
-{
-	int i, j, mask;
-	unsigned val;
-
-	for (i = 0; i < msm_gpio_count; i++) {
-		struct msm_gpio_chip *msm_chip = &msm_gpio_chips[i];
-		val = msm_gpio_readl(msm_chip, MSM_GPIO_INT_STATUS);
-		val &= msm_chip->int_enable[0];
-		while (val) {
-			mask = val & -val;
-			j = fls(mask) - 1;
-			/* printk("%s %08x %08x bit %d gpio %d irq %d\n",
-				__func__, v, m, j, msm_chip->chip.start + j,
-				FIRST_GPIO_IRQ + msm_chip->chip.start + j); */
-			val &= ~mask;
-			generic_handle_irq(FIRST_GPIO_IRQ +
-					   msm_chip->chip.base + j);
-		}
-	}
-	desc->irq_data.chip->irq_ack(&desc->irq_data);
-}
-
-static struct irq_chip msm_gpio_irq_chip = {
-	.name          = "msmgpio",
-	.irq_ack       = msm_gpio_irq_ack,
-	.irq_mask      = msm_gpio_irq_mask,
-	.irq_unmask    = msm_gpio_irq_unmask,
-	.irq_set_wake  = msm_gpio_irq_set_wake,
-	.irq_set_type  = msm_gpio_irq_set_type,
-};
-
-static int gpio_msm_v1_probe(struct platform_device *pdev)
-{
-	int i, j = 0;
-	const struct platform_device_id *dev_id = platform_get_device_id(pdev);
-	struct msm_gpio_initdata *data;
-	int irq1, irq2;
-	struct resource *res;
-	void __iomem *base1, __iomem *base2;
-
-	data = (struct msm_gpio_initdata *)dev_id->driver_data;
-	msm_gpio_chips = data->chips;
-	msm_gpio_count = data->count;
-
-	irq1 = platform_get_irq(pdev, 0);
-	if (irq1 < 0)
-		return irq1;
-
-	irq2 = platform_get_irq(pdev, 1);
-	if (irq2 < 0)
-		return irq2;
-
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	base1 = devm_ioremap_resource(&pdev->dev, res);
-	if (IS_ERR(base1))
-		return PTR_ERR(base1);
-
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-	base2 = devm_ioremap_resource(&pdev->dev, res);
-	if (IS_ERR(base2))
-		return PTR_ERR(base2);
-
-	for (i = FIRST_GPIO_IRQ; i < FIRST_GPIO_IRQ + NR_GPIO_IRQS; i++) {
-		if (i - FIRST_GPIO_IRQ >=
-			msm_gpio_chips[j].chip.base +
-			msm_gpio_chips[j].chip.ngpio)
-			j++;
-		irq_set_chip_data(i, &msm_gpio_chips[j]);
-		irq_set_chip_and_handler(i, &msm_gpio_irq_chip,
-					 handle_edge_irq);
-		set_irq_flags(i, IRQF_VALID);
-	}
-
-	for (i = 0; i < msm_gpio_count; i++) {
-		if (i == 1)
-			msm_gpio_chips[i].base = base2;
-		else
-			msm_gpio_chips[i].base = base1;
-		spin_lock_init(&msm_gpio_chips[i].lock);
-		msm_gpio_writel(&msm_gpio_chips[i], 0, MSM_GPIO_INT_EN);
-		gpiochip_add(&msm_gpio_chips[i].chip);
-	}
-
-	irq_set_chained_handler(irq1, msm_gpio_irq_handler);
-	irq_set_chained_handler(irq2, msm_gpio_irq_handler);
-	irq_set_irq_wake(irq1, 1);
-	irq_set_irq_wake(irq2, 1);
-	return 0;
-}
-
-static struct platform_device_id gpio_msm_v1_device_ids[] = {
-	{ "gpio-msm-7201", (unsigned long)&msm_gpio_7x01_init },
-	{ "gpio-msm-7x30", (unsigned long)&msm_gpio_7x30_init },
-	{ "gpio-msm-8x50", (unsigned long)&msm_gpio_8x50_init },
-	{ }
-};
-MODULE_DEVICE_TABLE(platform, gpio_msm_v1_device_ids);
-
-static struct platform_driver gpio_msm_v1_driver = {
-	.driver = {
-		.name = "gpio-msm-v1",
-	},
-	.probe = gpio_msm_v1_probe,
-	.id_table = gpio_msm_v1_device_ids,
-};
-
-static int __init gpio_msm_v1_init(void)
-{
-	return platform_driver_register(&gpio_msm_v1_driver);
-}
-postcore_initcall(gpio_msm_v1_init);
-MODULE_LICENSE("GPL v2");
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH 03/12] tty: serial: Remove orphaned serial driver
  2015-03-13 18:09 [PATCH 00/12] Remove mach-msm and associated code Stephen Boyd
  2015-03-13 18:09 ` [PATCH 01/12] ARM: Remove mach-msm and associated ARM architecture code Stephen Boyd
  2015-03-13 18:09 ` [PATCH 02/12] gpio: Remove gpio-msm-v1 driver Stephen Boyd
@ 2015-03-13 18:09 ` Stephen Boyd
  2015-03-13 18:09 ` [PATCH 04/12] tty: serial: msm_serial: Remove dead code Stephen Boyd
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 32+ messages in thread
From: Stephen Boyd @ 2015-03-13 18:09 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: linux-arm-kernel, linux-kernel, David Brown, Bryan Huntsman,
	Daniel Walker, Arnd Bergmann, Greg Kroah-Hartman

This driver is orphaned now that mach-msm has been removed.
Delete it.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: David Brown <davidb@codeaurora.org>
Cc: Bryan Huntsman <bryanh@codeaurora.org>
Cc: Daniel Walker <dwalker@fifo99.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---

This can be acked and go through arm-soc or applied directly to serial tree.

 drivers/tty/serial/Kconfig                  |   12 -
 drivers/tty/serial/Makefile                 |    1 -
 drivers/tty/serial/msm_serial_hs.c          | 1874 ---------------------------
 include/linux/platform_data/msm_serial_hs.h |   49 -
 4 files changed, 1936 deletions(-)
 delete mode 100644 drivers/tty/serial/msm_serial_hs.c
 delete mode 100644 include/linux/platform_data/msm_serial_hs.h

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index d2501f01cd03..965c80f9fc50 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -1063,18 +1063,6 @@ config SERIAL_MSM_CONSOLE
 	select SERIAL_CORE_CONSOLE
 	select SERIAL_EARLYCON
 
-config SERIAL_MSM_HS
-	tristate "MSM UART High Speed: Serial Driver"
-	depends on ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50
-	select SERIAL_CORE
-	help
-	  If you have a machine based on MSM family of SoCs, you
-	  can enable its onboard high speed serial port by enabling
-	  this option.
-
-	  Choose M here to compile it as a module. The module will be
-	  called msm_serial_hs.
-
 config SERIAL_VT8500
 	bool "VIA VT8500 on-chip serial port support"
 	depends on ARCH_VT8500
diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile
index 599be4b05a26..91565e8d2e4c 100644
--- a/drivers/tty/serial/Makefile
+++ b/drivers/tty/serial/Makefile
@@ -62,7 +62,6 @@ obj-$(CONFIG_SERIAL_SGI_IOC3) += ioc3_serial.o
 obj-$(CONFIG_SERIAL_ATMEL) += atmel_serial.o
 obj-$(CONFIG_SERIAL_UARTLITE) += uartlite.o
 obj-$(CONFIG_SERIAL_MSM) += msm_serial.o
-obj-$(CONFIG_SERIAL_MSM_HS) += msm_serial_hs.o
 obj-$(CONFIG_SERIAL_NETX) += netx-serial.o
 obj-$(CONFIG_SERIAL_OF_PLATFORM) += of_serial.o
 obj-$(CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL) += nwpserial.o
diff --git a/drivers/tty/serial/msm_serial_hs.c b/drivers/tty/serial/msm_serial_hs.c
deleted file mode 100644
index 62da8534ba75..000000000000
--- a/drivers/tty/serial/msm_serial_hs.c
+++ /dev/null
@@ -1,1874 +0,0 @@
-/*
- * MSM 7k/8k High speed uart driver
- *
- * Copyright (c) 2007-2011, Code Aurora Forum. All rights reserved.
- * Copyright (c) 2008 Google Inc.
- * Modified: Nick Pelly <npelly@google.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * Has optional support for uart power management independent of linux
- * suspend/resume:
- *
- * RX wakeup.
- * UART wakeup can be triggered by RX activity (using a wakeup GPIO on the
- * UART RX pin). This should only be used if there is not a wakeup
- * GPIO on the UART CTS, and the first RX byte is known (for example, with the
- * Bluetooth Texas Instruments HCILL protocol), since the first RX byte will
- * always be lost. RTS will be asserted even while the UART is off in this mode
- * of operation. See msm_serial_hs_platform_data.rx_wakeup_irq.
- */
-
-#include <linux/module.h>
-
-#include <linux/serial.h>
-#include <linux/serial_core.h>
-#include <linux/tty.h>
-#include <linux/tty_flip.h>
-#include <linux/slab.h>
-#include <linux/init.h>
-#include <linux/interrupt.h>
-#include <linux/irq.h>
-#include <linux/io.h>
-#include <linux/ioport.h>
-#include <linux/kernel.h>
-#include <linux/timer.h>
-#include <linux/clk.h>
-#include <linux/platform_device.h>
-#include <linux/pm_runtime.h>
-#include <linux/dma-mapping.h>
-#include <linux/dmapool.h>
-#include <linux/wait.h>
-#include <linux/workqueue.h>
-
-#include <linux/atomic.h>
-#include <asm/irq.h>
-
-#include <mach/hardware.h>
-#include <mach/dma.h>
-#include <linux/platform_data/msm_serial_hs.h>
-
-/* HSUART Registers */
-#define UARTDM_MR1_ADDR 0x0
-#define UARTDM_MR2_ADDR 0x4
-
-/* Data Mover result codes */
-#define RSLT_FIFO_CNTR_BMSK (0xE << 28)
-#define RSLT_VLD            BIT(1)
-
-/* write only register */
-#define UARTDM_CSR_ADDR 0x8
-#define UARTDM_CSR_115200 0xFF
-#define UARTDM_CSR_57600  0xEE
-#define UARTDM_CSR_38400  0xDD
-#define UARTDM_CSR_28800  0xCC
-#define UARTDM_CSR_19200  0xBB
-#define UARTDM_CSR_14400  0xAA
-#define UARTDM_CSR_9600   0x99
-#define UARTDM_CSR_7200   0x88
-#define UARTDM_CSR_4800   0x77
-#define UARTDM_CSR_3600   0x66
-#define UARTDM_CSR_2400   0x55
-#define UARTDM_CSR_1200   0x44
-#define UARTDM_CSR_600    0x33
-#define UARTDM_CSR_300    0x22
-#define UARTDM_CSR_150    0x11
-#define UARTDM_CSR_75     0x00
-
-/* write only register */
-#define UARTDM_TF_ADDR 0x70
-#define UARTDM_TF2_ADDR 0x74
-#define UARTDM_TF3_ADDR 0x78
-#define UARTDM_TF4_ADDR 0x7C
-
-/* write only register */
-#define UARTDM_CR_ADDR 0x10
-#define UARTDM_IMR_ADDR 0x14
-
-#define UARTDM_IPR_ADDR 0x18
-#define UARTDM_TFWR_ADDR 0x1c
-#define UARTDM_RFWR_ADDR 0x20
-#define UARTDM_HCR_ADDR 0x24
-#define UARTDM_DMRX_ADDR 0x34
-#define UARTDM_IRDA_ADDR 0x38
-#define UARTDM_DMEN_ADDR 0x3c
-
-/* UART_DM_NO_CHARS_FOR_TX */
-#define UARTDM_NCF_TX_ADDR 0x40
-
-#define UARTDM_BADR_ADDR 0x44
-
-#define UARTDM_SIM_CFG_ADDR 0x80
-/* Read Only register */
-#define UARTDM_SR_ADDR 0x8
-
-/* Read Only register */
-#define UARTDM_RF_ADDR  0x70
-#define UARTDM_RF2_ADDR 0x74
-#define UARTDM_RF3_ADDR 0x78
-#define UARTDM_RF4_ADDR 0x7C
-
-/* Read Only register */
-#define UARTDM_MISR_ADDR 0x10
-
-/* Read Only register */
-#define UARTDM_ISR_ADDR 0x14
-#define UARTDM_RX_TOTAL_SNAP_ADDR 0x38
-
-#define UARTDM_RXFS_ADDR 0x50
-
-/* Register field Mask Mapping */
-#define UARTDM_SR_PAR_FRAME_BMSK        BIT(5)
-#define UARTDM_SR_OVERRUN_BMSK          BIT(4)
-#define UARTDM_SR_TXEMT_BMSK            BIT(3)
-#define UARTDM_SR_TXRDY_BMSK            BIT(2)
-#define UARTDM_SR_RXRDY_BMSK            BIT(0)
-
-#define UARTDM_CR_TX_DISABLE_BMSK       BIT(3)
-#define UARTDM_CR_RX_DISABLE_BMSK       BIT(1)
-#define UARTDM_CR_TX_EN_BMSK            BIT(2)
-#define UARTDM_CR_RX_EN_BMSK            BIT(0)
-
-/* UARTDM_CR channel_comman bit value (register field is bits 8:4) */
-#define RESET_RX                0x10
-#define RESET_TX                0x20
-#define RESET_ERROR_STATUS      0x30
-#define RESET_BREAK_INT         0x40
-#define START_BREAK             0x50
-#define STOP_BREAK              0x60
-#define RESET_CTS               0x70
-#define RESET_STALE_INT         0x80
-#define RFR_LOW                 0xD0
-#define RFR_HIGH                0xE0
-#define CR_PROTECTION_EN        0x100
-#define STALE_EVENT_ENABLE      0x500
-#define STALE_EVENT_DISABLE     0x600
-#define FORCE_STALE_EVENT       0x400
-#define CLEAR_TX_READY          0x300
-#define RESET_TX_ERROR          0x800
-#define RESET_TX_DONE           0x810
-
-#define UARTDM_MR1_AUTO_RFR_LEVEL1_BMSK 0xffffff00
-#define UARTDM_MR1_AUTO_RFR_LEVEL0_BMSK 0x3f
-#define UARTDM_MR1_CTS_CTL_BMSK 0x40
-#define UARTDM_MR1_RX_RDY_CTL_BMSK 0x80
-
-#define UARTDM_MR2_ERROR_MODE_BMSK 0x40
-#define UARTDM_MR2_BITS_PER_CHAR_BMSK 0x30
-
-/* bits per character configuration */
-#define FIVE_BPC  (0 << 4)
-#define SIX_BPC   (1 << 4)
-#define SEVEN_BPC (2 << 4)
-#define EIGHT_BPC (3 << 4)
-
-#define UARTDM_MR2_STOP_BIT_LEN_BMSK 0xc
-#define STOP_BIT_ONE (1 << 2)
-#define STOP_BIT_TWO (3 << 2)
-
-#define UARTDM_MR2_PARITY_MODE_BMSK 0x3
-
-/* Parity configuration */
-#define NO_PARITY 0x0
-#define EVEN_PARITY 0x1
-#define ODD_PARITY 0x2
-#define SPACE_PARITY 0x3
-
-#define UARTDM_IPR_STALE_TIMEOUT_MSB_BMSK 0xffffff80
-#define UARTDM_IPR_STALE_LSB_BMSK 0x1f
-
-/* These can be used for both ISR and IMR register */
-#define UARTDM_ISR_TX_READY_BMSK        BIT(7)
-#define UARTDM_ISR_CURRENT_CTS_BMSK     BIT(6)
-#define UARTDM_ISR_DELTA_CTS_BMSK       BIT(5)
-#define UARTDM_ISR_RXLEV_BMSK           BIT(4)
-#define UARTDM_ISR_RXSTALE_BMSK         BIT(3)
-#define UARTDM_ISR_RXBREAK_BMSK         BIT(2)
-#define UARTDM_ISR_RXHUNT_BMSK          BIT(1)
-#define UARTDM_ISR_TXLEV_BMSK           BIT(0)
-
-/* Field definitions for UART_DM_DMEN*/
-#define UARTDM_TX_DM_EN_BMSK 0x1
-#define UARTDM_RX_DM_EN_BMSK 0x2
-
-#define UART_FIFOSIZE 64
-#define UARTCLK 7372800
-
-/* Rx DMA request states */
-enum flush_reason {
-	FLUSH_NONE,
-	FLUSH_DATA_READY,
-	FLUSH_DATA_INVALID,  /* values after this indicate invalid data */
-	FLUSH_IGNORE = FLUSH_DATA_INVALID,
-	FLUSH_STOP,
-	FLUSH_SHUTDOWN,
-};
-
-/* UART clock states */
-enum msm_hs_clk_states_e {
-	MSM_HS_CLK_PORT_OFF,     /* port not in use */
-	MSM_HS_CLK_OFF,          /* clock disabled */
-	MSM_HS_CLK_REQUEST_OFF,  /* disable after TX and RX flushed */
-	MSM_HS_CLK_ON,           /* clock enabled */
-};
-
-/* Track the forced RXSTALE flush during clock off sequence.
- * These states are only valid during MSM_HS_CLK_REQUEST_OFF */
-enum msm_hs_clk_req_off_state_e {
-	CLK_REQ_OFF_START,
-	CLK_REQ_OFF_RXSTALE_ISSUED,
-	CLK_REQ_OFF_FLUSH_ISSUED,
-	CLK_REQ_OFF_RXSTALE_FLUSHED,
-};
-
-/**
- * struct msm_hs_tx
- * @tx_ready_int_en: ok to dma more tx?
- * @dma_in_flight: tx dma in progress
- * @xfer: top level DMA command pointer structure
- * @command_ptr: third level command struct pointer
- * @command_ptr_ptr: second level command list struct pointer
- * @mapped_cmd_ptr: DMA view of third level command struct
- * @mapped_cmd_ptr_ptr: DMA view of second level command list struct
- * @tx_count: number of bytes to transfer in DMA transfer
- * @dma_base: DMA view of UART xmit buffer
- *
- * This structure describes a single Tx DMA transaction. MSM DMA
- * commands have two levels of indirection. The top level command
- * ptr points to a list of command ptr which in turn points to a
- * single DMA 'command'. In our case each Tx transaction consists
- * of a single second level pointer pointing to a 'box type' command.
- */
-struct msm_hs_tx {
-	unsigned int tx_ready_int_en;
-	unsigned int dma_in_flight;
-	struct msm_dmov_cmd xfer;
-	dmov_box *command_ptr;
-	u32 *command_ptr_ptr;
-	dma_addr_t mapped_cmd_ptr;
-	dma_addr_t mapped_cmd_ptr_ptr;
-	int tx_count;
-	dma_addr_t dma_base;
-};
-
-/**
- * struct msm_hs_rx
- * @flush: Rx DMA request state
- * @xfer: top level DMA command pointer structure
- * @cmdptr_dmaaddr: DMA view of second level command structure
- * @command_ptr: third level DMA command pointer structure
- * @command_ptr_ptr: second level DMA command list pointer
- * @mapped_cmd_ptr: DMA view of the third level command structure
- * @wait: wait for DMA completion before shutdown
- * @buffer: destination buffer for RX DMA
- * @rbuffer: DMA view of buffer
- * @pool: dma pool out of which coherent rx buffer is allocated
- * @tty_work: private work-queue for tty flip buffer push task
- *
- * This structure describes a single Rx DMA transaction. Rx DMA
- * transactions use box mode DMA commands.
- */
-struct msm_hs_rx {
-	enum flush_reason flush;
-	struct msm_dmov_cmd xfer;
-	dma_addr_t cmdptr_dmaaddr;
-	dmov_box *command_ptr;
-	u32 *command_ptr_ptr;
-	dma_addr_t mapped_cmd_ptr;
-	wait_queue_head_t wait;
-	dma_addr_t rbuffer;
-	unsigned char *buffer;
-	struct dma_pool *pool;
-	struct work_struct tty_work;
-};
-
-/**
- * struct msm_hs_rx_wakeup
- * @irq: IRQ line to be configured as interrupt source on Rx activity
- * @ignore: boolean value. 1 = ignore the wakeup interrupt
- * @rx_to_inject: extra character to be inserted to Rx tty on wakeup
- * @inject_rx: 1 = insert rx_to_inject. 0 = do not insert extra character
- *
- * This is an optional structure required for UART Rx GPIO IRQ based
- * wakeup from low power state. UART wakeup can be triggered by RX activity
- * (using a wakeup GPIO on the UART RX pin). This should only be used if
- * there is not a wakeup GPIO on the UART CTS, and the first RX byte is
- * known (eg., with the Bluetooth Texas Instruments HCILL protocol),
- * since the first RX byte will always be lost. RTS will be asserted even
- * while the UART is clocked off in this mode of operation.
- */
-struct msm_hs_rx_wakeup {
-	int irq;  /* < 0 indicates low power wakeup disabled */
-	unsigned char ignore;
-	unsigned char inject_rx;
-	char rx_to_inject;
-};
-
-/**
- * struct msm_hs_port
- * @uport: embedded uart port structure
- * @imr_reg: shadow value of UARTDM_IMR
- * @clk: uart input clock handle
- * @tx: Tx transaction related data structure
- * @rx: Rx transaction related data structure
- * @dma_tx_channel: Tx DMA command channel
- * @dma_rx_channel Rx DMA command channel
- * @dma_tx_crci: Tx channel rate control interface number
- * @dma_rx_crci: Rx channel rate control interface number
- * @clk_off_timer: Timer to poll DMA event completion before clock off
- * @clk_off_delay: clk_off_timer poll interval
- * @clk_state: overall clock state
- * @clk_req_off_state: post flush clock states
- * @rx_wakeup: optional rx_wakeup feature related data
- * @exit_lpm_cb: optional callback to exit low power mode
- *
- * Low level serial port structure.
- */
-struct msm_hs_port {
-	struct uart_port uport;
-	unsigned long imr_reg;
-	struct clk *clk;
-	struct msm_hs_tx tx;
-	struct msm_hs_rx rx;
-
-	int dma_tx_channel;
-	int dma_rx_channel;
-	int dma_tx_crci;
-	int dma_rx_crci;
-
-	struct hrtimer clk_off_timer;
-	ktime_t clk_off_delay;
-	enum msm_hs_clk_states_e clk_state;
-	enum msm_hs_clk_req_off_state_e clk_req_off_state;
-
-	struct msm_hs_rx_wakeup rx_wakeup;
-	void (*exit_lpm_cb)(struct uart_port *);
-};
-
-#define MSM_UARTDM_BURST_SIZE 16   /* DM burst size (in bytes) */
-#define UARTDM_TX_BUF_SIZE UART_XMIT_SIZE
-#define UARTDM_RX_BUF_SIZE 512
-
-#define UARTDM_NR 2
-
-static struct msm_hs_port q_uart_port[UARTDM_NR];
-static struct platform_driver msm_serial_hs_platform_driver;
-static struct uart_driver msm_hs_driver;
-static struct uart_ops msm_hs_ops;
-static struct workqueue_struct *msm_hs_workqueue;
-
-#define UARTDM_TO_MSM(uart_port) \
-	container_of((uart_port), struct msm_hs_port, uport)
-
-static unsigned int use_low_power_rx_wakeup(struct msm_hs_port
-						   *msm_uport)
-{
-	return (msm_uport->rx_wakeup.irq >= 0);
-}
-
-static unsigned int msm_hs_read(struct uart_port *uport,
-				       unsigned int offset)
-{
-	return ioread32(uport->membase + offset);
-}
-
-static void msm_hs_write(struct uart_port *uport, unsigned int offset,
-				 unsigned int value)
-{
-	iowrite32(value, uport->membase + offset);
-}
-
-static void msm_hs_release_port(struct uart_port *port)
-{
-	iounmap(port->membase);
-}
-
-static int msm_hs_request_port(struct uart_port *port)
-{
-	port->membase = ioremap(port->mapbase, PAGE_SIZE);
-	if (unlikely(!port->membase))
-		return -ENOMEM;
-
-	/* configure the CR Protection to Enable */
-	msm_hs_write(port, UARTDM_CR_ADDR, CR_PROTECTION_EN);
-	return 0;
-}
-
-static int msm_hs_remove(struct platform_device *pdev)
-{
-
-	struct msm_hs_port *msm_uport;
-	struct device *dev;
-
-	if (pdev->id < 0 || pdev->id >= UARTDM_NR) {
-		printk(KERN_ERR "Invalid plaform device ID = %d\n", pdev->id);
-		return -EINVAL;
-	}
-
-	msm_uport = &q_uart_port[pdev->id];
-	dev = msm_uport->uport.dev;
-
-	dma_unmap_single(dev, msm_uport->rx.mapped_cmd_ptr, sizeof(dmov_box),
-			 DMA_TO_DEVICE);
-	dma_pool_free(msm_uport->rx.pool, msm_uport->rx.buffer,
-		      msm_uport->rx.rbuffer);
-	dma_pool_destroy(msm_uport->rx.pool);
-
-	dma_unmap_single(dev, msm_uport->rx.cmdptr_dmaaddr, sizeof(u32),
-			 DMA_TO_DEVICE);
-	dma_unmap_single(dev, msm_uport->tx.mapped_cmd_ptr_ptr, sizeof(u32),
-			 DMA_TO_DEVICE);
-	dma_unmap_single(dev, msm_uport->tx.mapped_cmd_ptr, sizeof(dmov_box),
-			 DMA_TO_DEVICE);
-
-	uart_remove_one_port(&msm_hs_driver, &msm_uport->uport);
-	clk_put(msm_uport->clk);
-
-	/* Free the tx resources */
-	kfree(msm_uport->tx.command_ptr);
-	kfree(msm_uport->tx.command_ptr_ptr);
-
-	/* Free the rx resources */
-	kfree(msm_uport->rx.command_ptr);
-	kfree(msm_uport->rx.command_ptr_ptr);
-
-	iounmap(msm_uport->uport.membase);
-
-	return 0;
-}
-
-static int msm_hs_init_clk_locked(struct uart_port *uport)
-{
-	int ret;
-	struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport);
-
-	ret = clk_enable(msm_uport->clk);
-	if (ret) {
-		printk(KERN_ERR "Error could not turn on UART clk\n");
-		return ret;
-	}
-
-	/* Set up the MREG/NREG/DREG/MNDREG */
-	ret = clk_set_rate(msm_uport->clk, uport->uartclk);
-	if (ret) {
-		printk(KERN_WARNING "Error setting clock rate on UART\n");
-		clk_disable(msm_uport->clk);
-		return ret;
-	}
-
-	msm_uport->clk_state = MSM_HS_CLK_ON;
-	return 0;
-}
-
-/* Enable and Disable clocks  (Used for power management) */
-static void msm_hs_pm(struct uart_port *uport, unsigned int state,
-		      unsigned int oldstate)
-{
-	struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport);
-
-	if (use_low_power_rx_wakeup(msm_uport) ||
-	    msm_uport->exit_lpm_cb)
-		return;  /* ignore linux PM states,
-			    use msm_hs_request_clock API */
-
-	switch (state) {
-	case 0:
-		clk_enable(msm_uport->clk);
-		break;
-	case 3:
-		clk_disable(msm_uport->clk);
-		break;
-	default:
-		dev_err(uport->dev, "msm_serial: Unknown PM state %d\n",
-			state);
-	}
-}
-
-/*
- * programs the UARTDM_CSR register with correct bit rates
- *
- * Interrupts should be disabled before we are called, as
- * we modify Set Baud rate
- * Set receive stale interrupt level, dependent on Bit Rate
- * Goal is to have around 8 ms before indicate stale.
- * roundup (((Bit Rate * .008) / 10) + 1
- */
-static void msm_hs_set_bps_locked(struct uart_port *uport,
-				  unsigned int bps)
-{
-	unsigned long rxstale;
-	unsigned long data;
-	struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport);
-
-	switch (bps) {
-	case 300:
-		msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_75);
-		rxstale = 1;
-		break;
-	case 600:
-		msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_150);
-		rxstale = 1;
-		break;
-	case 1200:
-		msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_300);
-		rxstale = 1;
-		break;
-	case 2400:
-		msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_600);
-		rxstale = 1;
-		break;
-	case 4800:
-		msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_1200);
-		rxstale = 1;
-		break;
-	case 9600:
-		msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_2400);
-		rxstale = 2;
-		break;
-	case 14400:
-		msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_3600);
-		rxstale = 3;
-		break;
-	case 19200:
-		msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_4800);
-		rxstale = 4;
-		break;
-	case 28800:
-		msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_7200);
-		rxstale = 6;
-		break;
-	case 38400:
-		msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_9600);
-		rxstale = 8;
-		break;
-	case 57600:
-		msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_14400);
-		rxstale = 16;
-		break;
-	case 76800:
-		msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_19200);
-		rxstale = 16;
-		break;
-	case 115200:
-		msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_28800);
-		rxstale = 31;
-		break;
-	case 230400:
-		msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_57600);
-		rxstale = 31;
-		break;
-	case 460800:
-		msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_115200);
-		rxstale = 31;
-		break;
-	case 4000000:
-	case 3686400:
-	case 3200000:
-	case 3500000:
-	case 3000000:
-	case 2500000:
-	case 1500000:
-	case 1152000:
-	case 1000000:
-	case 921600:
-		msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_115200);
-		rxstale = 31;
-		break;
-	default:
-		msm_hs_write(uport, UARTDM_CSR_ADDR, UARTDM_CSR_2400);
-		/* default to 9600 */
-		bps = 9600;
-		rxstale = 2;
-		break;
-	}
-	if (bps > 460800)
-		uport->uartclk = bps * 16;
-	else
-		uport->uartclk = UARTCLK;
-
-	if (clk_set_rate(msm_uport->clk, uport->uartclk)) {
-		printk(KERN_WARNING "Error setting clock rate on UART\n");
-		return;
-	}
-
-	data = rxstale & UARTDM_IPR_STALE_LSB_BMSK;
-	data |= UARTDM_IPR_STALE_TIMEOUT_MSB_BMSK & (rxstale << 2);
-
-	msm_hs_write(uport, UARTDM_IPR_ADDR, data);
-}
-
-/*
- * termios :  new ktermios
- * oldtermios:  old ktermios previous setting
- *
- * Configure the serial port
- */
-static void msm_hs_set_termios(struct uart_port *uport,
-			       struct ktermios *termios,
-			       struct ktermios *oldtermios)
-{
-	unsigned int bps;
-	unsigned long data;
-	unsigned long flags;
-	unsigned int c_cflag = termios->c_cflag;
-	struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport);
-
-	spin_lock_irqsave(&uport->lock, flags);
-	clk_enable(msm_uport->clk);
-
-	/* 300 is the minimum baud support by the driver  */
-	bps = uart_get_baud_rate(uport, termios, oldtermios, 200, 4000000);
-
-	/* Temporary remapping  200 BAUD to 3.2 mbps */
-	if (bps == 200)
-		bps = 3200000;
-
-	msm_hs_set_bps_locked(uport, bps);
-
-	data = msm_hs_read(uport, UARTDM_MR2_ADDR);
-	data &= ~UARTDM_MR2_PARITY_MODE_BMSK;
-	/* set parity */
-	if (PARENB == (c_cflag & PARENB)) {
-		if (PARODD == (c_cflag & PARODD))
-			data |= ODD_PARITY;
-		else if (CMSPAR == (c_cflag & CMSPAR))
-			data |= SPACE_PARITY;
-		else
-			data |= EVEN_PARITY;
-	}
-
-	/* Set bits per char */
-	data &= ~UARTDM_MR2_BITS_PER_CHAR_BMSK;
-
-	switch (c_cflag & CSIZE) {
-	case CS5:
-		data |= FIVE_BPC;
-		break;
-	case CS6:
-		data |= SIX_BPC;
-		break;
-	case CS7:
-		data |= SEVEN_BPC;
-		break;
-	default:
-		data |= EIGHT_BPC;
-		break;
-	}
-	/* stop bits */
-	if (c_cflag & CSTOPB) {
-		data |= STOP_BIT_TWO;
-	} else {
-		/* otherwise 1 stop bit */
-		data |= STOP_BIT_ONE;
-	}
-	data |= UARTDM_MR2_ERROR_MODE_BMSK;
-	/* write parity/bits per char/stop bit configuration */
-	msm_hs_write(uport, UARTDM_MR2_ADDR, data);
-
-	/* Configure HW flow control */
-	data = msm_hs_read(uport, UARTDM_MR1_ADDR);
-
-	data &= ~(UARTDM_MR1_CTS_CTL_BMSK | UARTDM_MR1_RX_RDY_CTL_BMSK);
-
-	if (c_cflag & CRTSCTS) {
-		data |= UARTDM_MR1_CTS_CTL_BMSK;
-		data |= UARTDM_MR1_RX_RDY_CTL_BMSK;
-	}
-
-	msm_hs_write(uport, UARTDM_MR1_ADDR, data);
-
-	uport->ignore_status_mask = termios->c_iflag & INPCK;
-	uport->ignore_status_mask |= termios->c_iflag & IGNPAR;
-	uport->read_status_mask = (termios->c_cflag & CREAD);
-
-	msm_hs_write(uport, UARTDM_IMR_ADDR, 0);
-
-	/* Set Transmit software time out */
-	uart_update_timeout(uport, c_cflag, bps);
-
-	msm_hs_write(uport, UARTDM_CR_ADDR, RESET_RX);
-	msm_hs_write(uport, UARTDM_CR_ADDR, RESET_TX);
-
-	if (msm_uport->rx.flush == FLUSH_NONE) {
-		msm_uport->rx.flush = FLUSH_IGNORE;
-		msm_dmov_stop_cmd(msm_uport->dma_rx_channel, NULL, 1);
-	}
-
-	msm_hs_write(uport, UARTDM_IMR_ADDR, msm_uport->imr_reg);
-
-	clk_disable(msm_uport->clk);
-	spin_unlock_irqrestore(&uport->lock, flags);
-}
-
-/*
- *  Standard API, Transmitter
- *  Any character in the transmit shift register is sent
- */
-static unsigned int msm_hs_tx_empty(struct uart_port *uport)
-{
-	unsigned int data;
-	unsigned int ret = 0;
-	struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport);
-
-	clk_enable(msm_uport->clk);
-
-	data = msm_hs_read(uport, UARTDM_SR_ADDR);
-	if (data & UARTDM_SR_TXEMT_BMSK)
-		ret = TIOCSER_TEMT;
-
-	clk_disable(msm_uport->clk);
-
-	return ret;
-}
-
-/*
- *  Standard API, Stop transmitter.
- *  Any character in the transmit shift register is sent as
- *  well as the current data mover transfer .
- */
-static void msm_hs_stop_tx_locked(struct uart_port *uport)
-{
-	struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport);
-
-	msm_uport->tx.tx_ready_int_en = 0;
-}
-
-/*
- *  Standard API, Stop receiver as soon as possible.
- *
- *  Function immediately terminates the operation of the
- *  channel receiver and any incoming characters are lost. None
- *  of the receiver status bits are affected by this command and
- *  characters that are already in the receive FIFO there.
- */
-static void msm_hs_stop_rx_locked(struct uart_port *uport)
-{
-	struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport);
-	unsigned int data;
-
-	clk_enable(msm_uport->clk);
-
-	/* disable dlink */
-	data = msm_hs_read(uport, UARTDM_DMEN_ADDR);
-	data &= ~UARTDM_RX_DM_EN_BMSK;
-	msm_hs_write(uport, UARTDM_DMEN_ADDR, data);
-
-	/* Disable the receiver */
-	if (msm_uport->rx.flush == FLUSH_NONE)
-		msm_dmov_stop_cmd(msm_uport->dma_rx_channel, NULL, 1);
-
-	if (msm_uport->rx.flush != FLUSH_SHUTDOWN)
-		msm_uport->rx.flush = FLUSH_STOP;
-
-	clk_disable(msm_uport->clk);
-}
-
-/*  Transmit the next chunk of data */
-static void msm_hs_submit_tx_locked(struct uart_port *uport)
-{
-	int left;
-	int tx_count;
-	dma_addr_t src_addr;
-	struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport);
-	struct msm_hs_tx *tx = &msm_uport->tx;
-	struct circ_buf *tx_buf = &msm_uport->uport.state->xmit;
-
-	if (uart_circ_empty(tx_buf) || uport->state->port.tty->stopped) {
-		msm_hs_stop_tx_locked(uport);
-		return;
-	}
-
-	tx->dma_in_flight = 1;
-
-	tx_count = uart_circ_chars_pending(tx_buf);
-
-	if (UARTDM_TX_BUF_SIZE < tx_count)
-		tx_count = UARTDM_TX_BUF_SIZE;
-
-	left = UART_XMIT_SIZE - tx_buf->tail;
-
-	if (tx_count > left)
-		tx_count = left;
-
-	src_addr = tx->dma_base + tx_buf->tail;
-	dma_sync_single_for_device(uport->dev, src_addr, tx_count,
-				   DMA_TO_DEVICE);
-
-	tx->command_ptr->num_rows = (((tx_count + 15) >> 4) << 16) |
-				     ((tx_count + 15) >> 4);
-	tx->command_ptr->src_row_addr = src_addr;
-
-	dma_sync_single_for_device(uport->dev, tx->mapped_cmd_ptr,
-				   sizeof(dmov_box), DMA_TO_DEVICE);
-
-	*tx->command_ptr_ptr = CMD_PTR_LP | DMOV_CMD_ADDR(tx->mapped_cmd_ptr);
-
-	dma_sync_single_for_device(uport->dev, tx->mapped_cmd_ptr_ptr,
-				   sizeof(u32), DMA_TO_DEVICE);
-
-	/* Save tx_count to use in Callback */
-	tx->tx_count = tx_count;
-	msm_hs_write(uport, UARTDM_NCF_TX_ADDR, tx_count);
-
-	/* Disable the tx_ready interrupt */
-	msm_uport->imr_reg &= ~UARTDM_ISR_TX_READY_BMSK;
-	msm_hs_write(uport, UARTDM_IMR_ADDR, msm_uport->imr_reg);
-	msm_dmov_enqueue_cmd(msm_uport->dma_tx_channel, &tx->xfer);
-}
-
-/* Start to receive the next chunk of data */
-static void msm_hs_start_rx_locked(struct uart_port *uport)
-{
-	struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport);
-
-	msm_hs_write(uport, UARTDM_CR_ADDR, RESET_STALE_INT);
-	msm_hs_write(uport, UARTDM_DMRX_ADDR, UARTDM_RX_BUF_SIZE);
-	msm_hs_write(uport, UARTDM_CR_ADDR, STALE_EVENT_ENABLE);
-	msm_uport->imr_reg |= UARTDM_ISR_RXLEV_BMSK;
-	msm_hs_write(uport, UARTDM_IMR_ADDR, msm_uport->imr_reg);
-
-	msm_uport->rx.flush = FLUSH_NONE;
-	msm_dmov_enqueue_cmd(msm_uport->dma_rx_channel, &msm_uport->rx.xfer);
-
-	/* might have finished RX and be ready to clock off */
-	hrtimer_start(&msm_uport->clk_off_timer, msm_uport->clk_off_delay,
-			HRTIMER_MODE_REL);
-}
-
-/* Enable the transmitter Interrupt */
-static void msm_hs_start_tx_locked(struct uart_port *uport)
-{
-	struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport);
-
-	clk_enable(msm_uport->clk);
-
-	if (msm_uport->exit_lpm_cb)
-		msm_uport->exit_lpm_cb(uport);
-
-	if (msm_uport->tx.tx_ready_int_en == 0) {
-		msm_uport->tx.tx_ready_int_en = 1;
-		msm_hs_submit_tx_locked(uport);
-	}
-
-	clk_disable(msm_uport->clk);
-}
-
-/*
- *  This routine is called when we are done with a DMA transfer
- *
- *  This routine is registered with Data mover when we set
- *  up a Data Mover transfer. It is called from Data mover ISR
- *  when the DMA transfer is done.
- */
-static void msm_hs_dmov_tx_callback(struct msm_dmov_cmd *cmd_ptr,
-					unsigned int result,
-					struct msm_dmov_errdata *err)
-{
-	unsigned long flags;
-	struct msm_hs_port *msm_uport;
-
-	/* DMA did not finish properly */
-	WARN_ON((((result & RSLT_FIFO_CNTR_BMSK) >> 28) == 1) &&
-		!(result & RSLT_VLD));
-
-	msm_uport = container_of(cmd_ptr, struct msm_hs_port, tx.xfer);
-
-	spin_lock_irqsave(&msm_uport->uport.lock, flags);
-	clk_enable(msm_uport->clk);
-
-	msm_uport->imr_reg |= UARTDM_ISR_TX_READY_BMSK;
-	msm_hs_write(&msm_uport->uport, UARTDM_IMR_ADDR, msm_uport->imr_reg);
-
-	clk_disable(msm_uport->clk);
-	spin_unlock_irqrestore(&msm_uport->uport.lock, flags);
-}
-
-/*
- * This routine is called when we are done with a DMA transfer or the
- * a flush has been sent to the data mover driver.
- *
- * This routine is registered with Data mover when we set up a Data Mover
- *  transfer. It is called from Data mover ISR when the DMA transfer is done.
- */
-static void msm_hs_dmov_rx_callback(struct msm_dmov_cmd *cmd_ptr,
-					unsigned int result,
-					struct msm_dmov_errdata *err)
-{
-	int retval;
-	int rx_count;
-	unsigned long status;
-	unsigned int error_f = 0;
-	unsigned long flags;
-	unsigned int flush;
-	struct tty_port *port;
-	struct uart_port *uport;
-	struct msm_hs_port *msm_uport;
-
-	msm_uport = container_of(cmd_ptr, struct msm_hs_port, rx.xfer);
-	uport = &msm_uport->uport;
-
-	spin_lock_irqsave(&uport->lock, flags);
-	clk_enable(msm_uport->clk);
-
-	port = &uport->state->port;
-
-	msm_hs_write(uport, UARTDM_CR_ADDR, STALE_EVENT_DISABLE);
-
-	status = msm_hs_read(uport, UARTDM_SR_ADDR);
-
-	/* overflow is not connect to data in a FIFO */
-	if (unlikely((status & UARTDM_SR_OVERRUN_BMSK) &&
-		     (uport->read_status_mask & CREAD))) {
-		tty_insert_flip_char(port, 0, TTY_OVERRUN);
-		uport->icount.buf_overrun++;
-		error_f = 1;
-	}
-
-	if (!(uport->ignore_status_mask & INPCK))
-		status = status & ~(UARTDM_SR_PAR_FRAME_BMSK);
-
-	if (unlikely(status & UARTDM_SR_PAR_FRAME_BMSK)) {
-		/* Can not tell difference between parity & frame error */
-		uport->icount.parity++;
-		error_f = 1;
-		if (uport->ignore_status_mask & IGNPAR)
-			tty_insert_flip_char(port, 0, TTY_PARITY);
-	}
-
-	if (error_f)
-		msm_hs_write(uport, UARTDM_CR_ADDR, RESET_ERROR_STATUS);
-
-	if (msm_uport->clk_req_off_state == CLK_REQ_OFF_FLUSH_ISSUED)
-		msm_uport->clk_req_off_state = CLK_REQ_OFF_RXSTALE_FLUSHED;
-
-	flush = msm_uport->rx.flush;
-	if (flush == FLUSH_IGNORE)
-		msm_hs_start_rx_locked(uport);
-	if (flush == FLUSH_STOP)
-		msm_uport->rx.flush = FLUSH_SHUTDOWN;
-	if (flush >= FLUSH_DATA_INVALID)
-		goto out;
-
-	rx_count = msm_hs_read(uport, UARTDM_RX_TOTAL_SNAP_ADDR);
-
-	if (0 != (uport->read_status_mask & CREAD)) {
-		retval = tty_insert_flip_string(port, msm_uport->rx.buffer,
-						rx_count);
-		BUG_ON(retval != rx_count);
-	}
-
-	msm_hs_start_rx_locked(uport);
-
-out:
-	clk_disable(msm_uport->clk);
-
-	spin_unlock_irqrestore(&uport->lock, flags);
-
-	if (flush < FLUSH_DATA_INVALID)
-		queue_work(msm_hs_workqueue, &msm_uport->rx.tty_work);
-}
-
-static void msm_hs_tty_flip_buffer_work(struct work_struct *work)
-{
-	struct msm_hs_port *msm_uport =
-			container_of(work, struct msm_hs_port, rx.tty_work);
-
-	tty_flip_buffer_push(&msm_uport->uport.state->port);
-}
-
-/*
- *  Standard API, Current states of modem control inputs
- *
- * Since CTS can be handled entirely by HARDWARE we always
- * indicate clear to send and count on the TX FIFO to block when
- * it fills up.
- *
- * - TIOCM_DCD
- * - TIOCM_CTS
- * - TIOCM_DSR
- * - TIOCM_RI
- *  (Unsupported) DCD and DSR will return them high. RI will return low.
- */
-static unsigned int msm_hs_get_mctrl_locked(struct uart_port *uport)
-{
-	return TIOCM_DSR | TIOCM_CAR | TIOCM_CTS;
-}
-
-/*
- * True enables UART auto RFR, which indicates we are ready for data if the RX
- * buffer is not full. False disables auto RFR, and deasserts RFR to indicate
- * we are not ready for data. Must be called with UART clock on.
- */
-static void set_rfr_locked(struct uart_port *uport, int auto_rfr)
-{
-	unsigned int data;
-
-	data = msm_hs_read(uport, UARTDM_MR1_ADDR);
-
-	if (auto_rfr) {
-		/* enable auto ready-for-receiving */
-		data |= UARTDM_MR1_RX_RDY_CTL_BMSK;
-		msm_hs_write(uport, UARTDM_MR1_ADDR, data);
-	} else {
-		/* disable auto ready-for-receiving */
-		data &= ~UARTDM_MR1_RX_RDY_CTL_BMSK;
-		msm_hs_write(uport, UARTDM_MR1_ADDR, data);
-		/* RFR is active low, set high */
-		msm_hs_write(uport, UARTDM_CR_ADDR, RFR_HIGH);
-	}
-}
-
-/*
- *  Standard API, used to set or clear RFR
- */
-static void msm_hs_set_mctrl_locked(struct uart_port *uport,
-				    unsigned int mctrl)
-{
-	unsigned int auto_rfr;
-	struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport);
-
-	clk_enable(msm_uport->clk);
-
-	auto_rfr = TIOCM_RTS & mctrl ? 1 : 0;
-	set_rfr_locked(uport, auto_rfr);
-
-	clk_disable(msm_uport->clk);
-}
-
-/* Standard API, Enable modem status (CTS) interrupt  */
-static void msm_hs_enable_ms_locked(struct uart_port *uport)
-{
-	struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport);
-
-	clk_enable(msm_uport->clk);
-
-	/* Enable DELTA_CTS Interrupt */
-	msm_uport->imr_reg |= UARTDM_ISR_DELTA_CTS_BMSK;
-	msm_hs_write(uport, UARTDM_IMR_ADDR, msm_uport->imr_reg);
-
-	clk_disable(msm_uport->clk);
-
-}
-
-/*
- *  Standard API, Break Signal
- *
- * Control the transmission of a break signal. ctl eq 0 => break
- * signal terminate ctl ne 0 => start break signal
- */
-static void msm_hs_break_ctl(struct uart_port *uport, int ctl)
-{
-	struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport);
-
-	clk_enable(msm_uport->clk);
-	msm_hs_write(uport, UARTDM_CR_ADDR, ctl ? START_BREAK : STOP_BREAK);
-	clk_disable(msm_uport->clk);
-}
-
-static void msm_hs_config_port(struct uart_port *uport, int cfg_flags)
-{
-	unsigned long flags;
-
-	spin_lock_irqsave(&uport->lock, flags);
-	if (cfg_flags & UART_CONFIG_TYPE) {
-		uport->type = PORT_MSM;
-		msm_hs_request_port(uport);
-	}
-	spin_unlock_irqrestore(&uport->lock, flags);
-}
-
-/*  Handle CTS changes (Called from interrupt handler) */
-static void msm_hs_handle_delta_cts_locked(struct uart_port *uport)
-{
-	struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport);
-
-	clk_enable(msm_uport->clk);
-
-	/* clear interrupt */
-	msm_hs_write(uport, UARTDM_CR_ADDR, RESET_CTS);
-	uport->icount.cts++;
-
-	clk_disable(msm_uport->clk);
-
-	/* clear the IOCTL TIOCMIWAIT if called */
-	wake_up_interruptible(&uport->state->port.delta_msr_wait);
-}
-
-/* check if the TX path is flushed, and if so clock off
- * returns 0 did not clock off, need to retry (still sending final byte)
- *        -1 did not clock off, do not retry
- *         1 if we clocked off
- */
-static int msm_hs_check_clock_off_locked(struct uart_port *uport)
-{
-	unsigned long sr_status;
-	struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport);
-	struct circ_buf *tx_buf = &uport->state->xmit;
-
-	/* Cancel if tx tty buffer is not empty, dma is in flight,
-	 * or tx fifo is not empty, or rx fifo is not empty */
-	if (msm_uport->clk_state != MSM_HS_CLK_REQUEST_OFF ||
-	    !uart_circ_empty(tx_buf) || msm_uport->tx.dma_in_flight ||
-	    (msm_uport->imr_reg & UARTDM_ISR_TXLEV_BMSK) ||
-	    !(msm_uport->imr_reg & UARTDM_ISR_RXLEV_BMSK))  {
-		return -1;
-	}
-
-	/* Make sure the uart is finished with the last byte */
-	sr_status = msm_hs_read(uport, UARTDM_SR_ADDR);
-	if (!(sr_status & UARTDM_SR_TXEMT_BMSK))
-		return 0;  /* retry */
-
-	/* Make sure forced RXSTALE flush complete */
-	switch (msm_uport->clk_req_off_state) {
-	case CLK_REQ_OFF_START:
-		msm_uport->clk_req_off_state = CLK_REQ_OFF_RXSTALE_ISSUED;
-		msm_hs_write(uport, UARTDM_CR_ADDR, FORCE_STALE_EVENT);
-		return 0;  /* RXSTALE flush not complete - retry */
-	case CLK_REQ_OFF_RXSTALE_ISSUED:
-	case CLK_REQ_OFF_FLUSH_ISSUED:
-		return 0;  /* RXSTALE flush not complete - retry */
-	case CLK_REQ_OFF_RXSTALE_FLUSHED:
-		break;  /* continue */
-	}
-
-	if (msm_uport->rx.flush != FLUSH_SHUTDOWN) {
-		if (msm_uport->rx.flush == FLUSH_NONE)
-			msm_hs_stop_rx_locked(uport);
-		return 0;  /* come back later to really clock off */
-	}
-
-	/* we really want to clock off */
-	clk_disable(msm_uport->clk);
-	msm_uport->clk_state = MSM_HS_CLK_OFF;
-
-	if (use_low_power_rx_wakeup(msm_uport)) {
-		msm_uport->rx_wakeup.ignore = 1;
-		enable_irq(msm_uport->rx_wakeup.irq);
-	}
-	return 1;
-}
-
-static enum hrtimer_restart msm_hs_clk_off_retry(struct hrtimer *timer)
-{
-	unsigned long flags;
-	int ret = HRTIMER_NORESTART;
-	struct msm_hs_port *msm_uport = container_of(timer, struct msm_hs_port,
-						     clk_off_timer);
-	struct uart_port *uport = &msm_uport->uport;
-
-	spin_lock_irqsave(&uport->lock, flags);
-
-	if (!msm_hs_check_clock_off_locked(uport)) {
-		hrtimer_forward_now(timer, msm_uport->clk_off_delay);
-		ret = HRTIMER_RESTART;
-	}
-
-	spin_unlock_irqrestore(&uport->lock, flags);
-
-	return ret;
-}
-
-static irqreturn_t msm_hs_isr(int irq, void *dev)
-{
-	unsigned long flags;
-	unsigned long isr_status;
-	struct msm_hs_port *msm_uport = dev;
-	struct uart_port *uport = &msm_uport->uport;
-	struct circ_buf *tx_buf = &uport->state->xmit;
-	struct msm_hs_tx *tx = &msm_uport->tx;
-	struct msm_hs_rx *rx = &msm_uport->rx;
-
-	spin_lock_irqsave(&uport->lock, flags);
-
-	isr_status = msm_hs_read(uport, UARTDM_MISR_ADDR);
-
-	/* Uart RX starting */
-	if (isr_status & UARTDM_ISR_RXLEV_BMSK) {
-		msm_uport->imr_reg &= ~UARTDM_ISR_RXLEV_BMSK;
-		msm_hs_write(uport, UARTDM_IMR_ADDR, msm_uport->imr_reg);
-	}
-	/* Stale rx interrupt */
-	if (isr_status & UARTDM_ISR_RXSTALE_BMSK) {
-		msm_hs_write(uport, UARTDM_CR_ADDR, STALE_EVENT_DISABLE);
-		msm_hs_write(uport, UARTDM_CR_ADDR, RESET_STALE_INT);
-
-		if (msm_uport->clk_req_off_state == CLK_REQ_OFF_RXSTALE_ISSUED)
-			msm_uport->clk_req_off_state =
-					CLK_REQ_OFF_FLUSH_ISSUED;
-		if (rx->flush == FLUSH_NONE) {
-			rx->flush = FLUSH_DATA_READY;
-			msm_dmov_stop_cmd(msm_uport->dma_rx_channel, NULL, 1);
-		}
-	}
-	/* tx ready interrupt */
-	if (isr_status & UARTDM_ISR_TX_READY_BMSK) {
-		/* Clear  TX Ready */
-		msm_hs_write(uport, UARTDM_CR_ADDR, CLEAR_TX_READY);
-
-		if (msm_uport->clk_state == MSM_HS_CLK_REQUEST_OFF) {
-			msm_uport->imr_reg |= UARTDM_ISR_TXLEV_BMSK;
-			msm_hs_write(uport, UARTDM_IMR_ADDR,
-				     msm_uport->imr_reg);
-		}
-
-		/* Complete DMA TX transactions and submit new transactions */
-		tx_buf->tail = (tx_buf->tail + tx->tx_count) & ~UART_XMIT_SIZE;
-
-		tx->dma_in_flight = 0;
-
-		uport->icount.tx += tx->tx_count;
-		if (tx->tx_ready_int_en)
-			msm_hs_submit_tx_locked(uport);
-
-		if (uart_circ_chars_pending(tx_buf) < WAKEUP_CHARS)
-			uart_write_wakeup(uport);
-	}
-	if (isr_status & UARTDM_ISR_TXLEV_BMSK) {
-		/* TX FIFO is empty */
-		msm_uport->imr_reg &= ~UARTDM_ISR_TXLEV_BMSK;
-		msm_hs_write(uport, UARTDM_IMR_ADDR, msm_uport->imr_reg);
-		if (!msm_hs_check_clock_off_locked(uport))
-			hrtimer_start(&msm_uport->clk_off_timer,
-				      msm_uport->clk_off_delay,
-				      HRTIMER_MODE_REL);
-	}
-
-	/* Change in CTS interrupt */
-	if (isr_status & UARTDM_ISR_DELTA_CTS_BMSK)
-		msm_hs_handle_delta_cts_locked(uport);
-
-	spin_unlock_irqrestore(&uport->lock, flags);
-
-	return IRQ_HANDLED;
-}
-
-void msm_hs_request_clock_off_locked(struct uart_port *uport)
-{
-	struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport);
-
-	if (msm_uport->clk_state == MSM_HS_CLK_ON) {
-		msm_uport->clk_state = MSM_HS_CLK_REQUEST_OFF;
-		msm_uport->clk_req_off_state = CLK_REQ_OFF_START;
-		if (!use_low_power_rx_wakeup(msm_uport))
-			set_rfr_locked(uport, 0);
-		msm_uport->imr_reg |= UARTDM_ISR_TXLEV_BMSK;
-		msm_hs_write(uport, UARTDM_IMR_ADDR, msm_uport->imr_reg);
-	}
-}
-
-/**
- * msm_hs_request_clock_off - request to (i.e. asynchronously) turn off uart
- * clock once pending TX is flushed and Rx DMA command is terminated.
- * @uport: uart_port structure for the device instance.
- *
- * This functions puts the device into a partially active low power mode. It
- * waits to complete all pending tx transactions, flushes ongoing Rx DMA
- * command and terminates UART side Rx transaction, puts UART HW in non DMA
- * mode and then clocks off the device. A client calls this when no UART
- * data is expected. msm_request_clock_on() must be called before any further
- * UART can be sent or received.
- */
-void msm_hs_request_clock_off(struct uart_port *uport)
-{
-	unsigned long flags;
-
-	spin_lock_irqsave(&uport->lock, flags);
-	msm_hs_request_clock_off_locked(uport);
-	spin_unlock_irqrestore(&uport->lock, flags);
-}
-
-void msm_hs_request_clock_on_locked(struct uart_port *uport)
-{
-	struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport);
-	unsigned int data;
-
-	switch (msm_uport->clk_state) {
-	case MSM_HS_CLK_OFF:
-		clk_enable(msm_uport->clk);
-		disable_irq_nosync(msm_uport->rx_wakeup.irq);
-		/* fall-through */
-	case MSM_HS_CLK_REQUEST_OFF:
-		if (msm_uport->rx.flush == FLUSH_STOP ||
-		    msm_uport->rx.flush == FLUSH_SHUTDOWN) {
-			msm_hs_write(uport, UARTDM_CR_ADDR, RESET_RX);
-			data = msm_hs_read(uport, UARTDM_DMEN_ADDR);
-			data |= UARTDM_RX_DM_EN_BMSK;
-			msm_hs_write(uport, UARTDM_DMEN_ADDR, data);
-		}
-		hrtimer_try_to_cancel(&msm_uport->clk_off_timer);
-		if (msm_uport->rx.flush == FLUSH_SHUTDOWN)
-			msm_hs_start_rx_locked(uport);
-		if (!use_low_power_rx_wakeup(msm_uport))
-			set_rfr_locked(uport, 1);
-		if (msm_uport->rx.flush == FLUSH_STOP)
-			msm_uport->rx.flush = FLUSH_IGNORE;
-		msm_uport->clk_state = MSM_HS_CLK_ON;
-		break;
-	case MSM_HS_CLK_ON:
-		break;
-	case MSM_HS_CLK_PORT_OFF:
-		break;
-	}
-}
-
-/**
- * msm_hs_request_clock_on - Switch the device from partially active low
- * power mode to fully active (i.e. clock on) mode.
- * @uport: uart_port structure for the device.
- *
- * This function switches on the input clock, puts UART HW into DMA mode
- * and enqueues an Rx DMA command if the device was in partially active
- * mode. It has no effect if called with the device in inactive state.
- */
-void msm_hs_request_clock_on(struct uart_port *uport)
-{
-	unsigned long flags;
-
-	spin_lock_irqsave(&uport->lock, flags);
-	msm_hs_request_clock_on_locked(uport);
-	spin_unlock_irqrestore(&uport->lock, flags);
-}
-
-static irqreturn_t msm_hs_rx_wakeup_isr(int irq, void *dev)
-{
-	unsigned int wakeup = 0;
-	unsigned long flags;
-	struct msm_hs_port *msm_uport = dev;
-	struct uart_port *uport = &msm_uport->uport;
-
-	spin_lock_irqsave(&uport->lock, flags);
-	if (msm_uport->clk_state == MSM_HS_CLK_OFF) {
-		/* ignore the first irq - it is a pending irq that occurred
-		 * before enable_irq() */
-		if (msm_uport->rx_wakeup.ignore)
-			msm_uport->rx_wakeup.ignore = 0;
-		else
-			wakeup = 1;
-	}
-
-	if (wakeup) {
-		/* the uart was clocked off during an rx, wake up and
-		 * optionally inject char into tty rx */
-		msm_hs_request_clock_on_locked(uport);
-		if (msm_uport->rx_wakeup.inject_rx) {
-			tty_insert_flip_char(&uport->state->port,
-					     msm_uport->rx_wakeup.rx_to_inject,
-					     TTY_NORMAL);
-			queue_work(msm_hs_workqueue, &msm_uport->rx.tty_work);
-		}
-	}
-
-	spin_unlock_irqrestore(&uport->lock, flags);
-
-	return IRQ_HANDLED;
-}
-
-static const char *msm_hs_type(struct uart_port *port)
-{
-	return (port->type == PORT_MSM) ? "MSM_HS_UART" : NULL;
-}
-
-/* Called when port is opened */
-static int msm_hs_startup(struct uart_port *uport)
-{
-	int ret;
-	int rfr_level;
-	unsigned long flags;
-	unsigned int data;
-	struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport);
-	struct circ_buf *tx_buf = &uport->state->xmit;
-	struct msm_hs_tx *tx = &msm_uport->tx;
-	struct msm_hs_rx *rx = &msm_uport->rx;
-
-	rfr_level = uport->fifosize;
-	if (rfr_level > 16)
-		rfr_level -= 16;
-
-	tx->dma_base = dma_map_single(uport->dev, tx_buf->buf, UART_XMIT_SIZE,
-				      DMA_TO_DEVICE);
-
-	/* do not let tty layer execute RX in global workqueue, use a
-	 * dedicated workqueue managed by this driver */
-	uport->state->port.low_latency = 1;
-
-	/* turn on uart clk */
-	ret = msm_hs_init_clk_locked(uport);
-	if (unlikely(ret)) {
-		printk(KERN_ERR "Turning uartclk failed!\n");
-		goto err_msm_hs_init_clk;
-	}
-
-	/* Set auto RFR Level */
-	data = msm_hs_read(uport, UARTDM_MR1_ADDR);
-	data &= ~UARTDM_MR1_AUTO_RFR_LEVEL1_BMSK;
-	data &= ~UARTDM_MR1_AUTO_RFR_LEVEL0_BMSK;
-	data |= (UARTDM_MR1_AUTO_RFR_LEVEL1_BMSK & (rfr_level << 2));
-	data |= (UARTDM_MR1_AUTO_RFR_LEVEL0_BMSK & rfr_level);
-	msm_hs_write(uport, UARTDM_MR1_ADDR, data);
-
-	/* Make sure RXSTALE count is non-zero */
-	data = msm_hs_read(uport, UARTDM_IPR_ADDR);
-	if (!data) {
-		data |= 0x1f & UARTDM_IPR_STALE_LSB_BMSK;
-		msm_hs_write(uport, UARTDM_IPR_ADDR, data);
-	}
-
-	/* Enable Data Mover Mode */
-	data = UARTDM_TX_DM_EN_BMSK | UARTDM_RX_DM_EN_BMSK;
-	msm_hs_write(uport, UARTDM_DMEN_ADDR, data);
-
-	/* Reset TX */
-	msm_hs_write(uport, UARTDM_CR_ADDR, RESET_TX);
-	msm_hs_write(uport, UARTDM_CR_ADDR, RESET_RX);
-	msm_hs_write(uport, UARTDM_CR_ADDR, RESET_ERROR_STATUS);
-	msm_hs_write(uport, UARTDM_CR_ADDR, RESET_BREAK_INT);
-	msm_hs_write(uport, UARTDM_CR_ADDR, RESET_STALE_INT);
-	msm_hs_write(uport, UARTDM_CR_ADDR, RESET_CTS);
-	msm_hs_write(uport, UARTDM_CR_ADDR, RFR_LOW);
-	/* Turn on Uart Receiver */
-	msm_hs_write(uport, UARTDM_CR_ADDR, UARTDM_CR_RX_EN_BMSK);
-
-	/* Turn on Uart Transmitter */
-	msm_hs_write(uport, UARTDM_CR_ADDR, UARTDM_CR_TX_EN_BMSK);
-
-	/* Initialize the tx */
-	tx->tx_ready_int_en = 0;
-	tx->dma_in_flight = 0;
-
-	tx->xfer.complete_func = msm_hs_dmov_tx_callback;
-	tx->xfer.execute_func = NULL;
-
-	tx->command_ptr->cmd = CMD_LC |
-	    CMD_DST_CRCI(msm_uport->dma_tx_crci) | CMD_MODE_BOX;
-
-	tx->command_ptr->src_dst_len = (MSM_UARTDM_BURST_SIZE << 16)
-					   | (MSM_UARTDM_BURST_SIZE);
-
-	tx->command_ptr->row_offset = (MSM_UARTDM_BURST_SIZE << 16);
-
-	tx->command_ptr->dst_row_addr =
-	    msm_uport->uport.mapbase + UARTDM_TF_ADDR;
-
-
-	/* Turn on Uart Receive */
-	rx->xfer.complete_func = msm_hs_dmov_rx_callback;
-	rx->xfer.execute_func = NULL;
-
-	rx->command_ptr->cmd = CMD_LC |
-	    CMD_SRC_CRCI(msm_uport->dma_rx_crci) | CMD_MODE_BOX;
-
-	rx->command_ptr->src_dst_len = (MSM_UARTDM_BURST_SIZE << 16)
-					   | (MSM_UARTDM_BURST_SIZE);
-	rx->command_ptr->row_offset =  MSM_UARTDM_BURST_SIZE;
-	rx->command_ptr->src_row_addr = uport->mapbase + UARTDM_RF_ADDR;
-
-
-	msm_uport->imr_reg |= UARTDM_ISR_RXSTALE_BMSK;
-	/* Enable reading the current CTS, no harm even if CTS is ignored */
-	msm_uport->imr_reg |= UARTDM_ISR_CURRENT_CTS_BMSK;
-
-	msm_hs_write(uport, UARTDM_TFWR_ADDR, 0);  /* TXLEV on empty TX fifo */
-
-
-	ret = request_irq(uport->irq, msm_hs_isr, IRQF_TRIGGER_HIGH,
-			  "msm_hs_uart", msm_uport);
-	if (unlikely(ret)) {
-		printk(KERN_ERR "Request msm_hs_uart IRQ failed!\n");
-		goto err_request_irq;
-	}
-	if (use_low_power_rx_wakeup(msm_uport)) {
-		ret = request_irq(msm_uport->rx_wakeup.irq,
-				  msm_hs_rx_wakeup_isr,
-				  IRQF_TRIGGER_FALLING,
-				  "msm_hs_rx_wakeup", msm_uport);
-		if (unlikely(ret)) {
-			printk(KERN_ERR "Request msm_hs_rx_wakeup IRQ failed!\n");
-			free_irq(uport->irq, msm_uport);
-			goto err_request_irq;
-		}
-		disable_irq(msm_uport->rx_wakeup.irq);
-	}
-
-	spin_lock_irqsave(&uport->lock, flags);
-
-	msm_hs_write(uport, UARTDM_RFWR_ADDR, 0);
-	msm_hs_start_rx_locked(uport);
-
-	spin_unlock_irqrestore(&uport->lock, flags);
-	ret = pm_runtime_set_active(uport->dev);
-	if (ret)
-		dev_err(uport->dev, "set active error:%d\n", ret);
-	pm_runtime_enable(uport->dev);
-
-	return 0;
-
-err_request_irq:
-err_msm_hs_init_clk:
-	dma_unmap_single(uport->dev, tx->dma_base,
-				UART_XMIT_SIZE, DMA_TO_DEVICE);
-	return ret;
-}
-
-/* Initialize tx and rx data structures */
-static int uartdm_init_port(struct uart_port *uport)
-{
-	int ret = 0;
-	struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport);
-	struct msm_hs_tx *tx = &msm_uport->tx;
-	struct msm_hs_rx *rx = &msm_uport->rx;
-
-	/* Allocate the command pointer. Needs to be 64 bit aligned */
-	tx->command_ptr = kmalloc(sizeof(dmov_box), GFP_KERNEL | __GFP_DMA);
-	if (!tx->command_ptr)
-		return -ENOMEM;
-
-	tx->command_ptr_ptr = kmalloc(sizeof(u32), GFP_KERNEL | __GFP_DMA);
-	if (!tx->command_ptr_ptr) {
-		ret = -ENOMEM;
-		goto err_tx_command_ptr_ptr;
-	}
-
-	tx->mapped_cmd_ptr = dma_map_single(uport->dev, tx->command_ptr,
-					    sizeof(dmov_box), DMA_TO_DEVICE);
-	tx->mapped_cmd_ptr_ptr = dma_map_single(uport->dev,
-						tx->command_ptr_ptr,
-						sizeof(u32), DMA_TO_DEVICE);
-	tx->xfer.cmdptr = DMOV_CMD_ADDR(tx->mapped_cmd_ptr_ptr);
-
-	init_waitqueue_head(&rx->wait);
-
-	rx->pool = dma_pool_create("rx_buffer_pool", uport->dev,
-				   UARTDM_RX_BUF_SIZE, 16, 0);
-	if (!rx->pool) {
-		pr_err("%s(): cannot allocate rx_buffer_pool", __func__);
-		ret = -ENOMEM;
-		goto err_dma_pool_create;
-	}
-
-	rx->buffer = dma_pool_alloc(rx->pool, GFP_KERNEL, &rx->rbuffer);
-	if (!rx->buffer) {
-		pr_err("%s(): cannot allocate rx->buffer", __func__);
-		ret = -ENOMEM;
-		goto err_dma_pool_alloc;
-	}
-
-	/* Allocate the command pointer. Needs to be 64 bit aligned */
-	rx->command_ptr = kmalloc(sizeof(dmov_box), GFP_KERNEL | __GFP_DMA);
-	if (!rx->command_ptr) {
-		pr_err("%s(): cannot allocate rx->command_ptr", __func__);
-		ret = -ENOMEM;
-		goto err_rx_command_ptr;
-	}
-
-	rx->command_ptr_ptr = kmalloc(sizeof(u32), GFP_KERNEL | __GFP_DMA);
-	if (!rx->command_ptr_ptr) {
-		pr_err("%s(): cannot allocate rx->command_ptr_ptr", __func__);
-		ret = -ENOMEM;
-		goto err_rx_command_ptr_ptr;
-	}
-
-	rx->command_ptr->num_rows = ((UARTDM_RX_BUF_SIZE >> 4) << 16) |
-					 (UARTDM_RX_BUF_SIZE >> 4);
-
-	rx->command_ptr->dst_row_addr = rx->rbuffer;
-
-	rx->mapped_cmd_ptr = dma_map_single(uport->dev, rx->command_ptr,
-					    sizeof(dmov_box), DMA_TO_DEVICE);
-
-	*rx->command_ptr_ptr = CMD_PTR_LP | DMOV_CMD_ADDR(rx->mapped_cmd_ptr);
-
-	rx->cmdptr_dmaaddr = dma_map_single(uport->dev, rx->command_ptr_ptr,
-					    sizeof(u32), DMA_TO_DEVICE);
-	rx->xfer.cmdptr = DMOV_CMD_ADDR(rx->cmdptr_dmaaddr);
-
-	INIT_WORK(&rx->tty_work, msm_hs_tty_flip_buffer_work);
-
-	return ret;
-
-err_rx_command_ptr_ptr:
-	kfree(rx->command_ptr);
-err_rx_command_ptr:
-	dma_pool_free(msm_uport->rx.pool, msm_uport->rx.buffer,
-						msm_uport->rx.rbuffer);
-err_dma_pool_alloc:
-	dma_pool_destroy(msm_uport->rx.pool);
-err_dma_pool_create:
-	dma_unmap_single(uport->dev, msm_uport->tx.mapped_cmd_ptr_ptr,
-				sizeof(u32), DMA_TO_DEVICE);
-	dma_unmap_single(uport->dev, msm_uport->tx.mapped_cmd_ptr,
-				sizeof(dmov_box), DMA_TO_DEVICE);
-	kfree(msm_uport->tx.command_ptr_ptr);
-err_tx_command_ptr_ptr:
-	kfree(msm_uport->tx.command_ptr);
-	return ret;
-}
-
-static int msm_hs_probe(struct platform_device *pdev)
-{
-	int ret;
-	struct uart_port *uport;
-	struct msm_hs_port *msm_uport;
-	struct resource *resource;
-	const struct msm_serial_hs_platform_data *pdata =
-						dev_get_platdata(&pdev->dev);
-
-	if (pdev->id < 0 || pdev->id >= UARTDM_NR) {
-		printk(KERN_ERR "Invalid plaform device ID = %d\n", pdev->id);
-		return -EINVAL;
-	}
-
-	msm_uport = &q_uart_port[pdev->id];
-	uport = &msm_uport->uport;
-
-	uport->dev = &pdev->dev;
-
-	resource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (unlikely(!resource))
-		return -ENXIO;
-
-	uport->mapbase = resource->start;
-	uport->irq = platform_get_irq(pdev, 0);
-	if (unlikely(uport->irq < 0))
-		return -ENXIO;
-
-	if (unlikely(irq_set_irq_wake(uport->irq, 1)))
-		return -ENXIO;
-
-	if (pdata == NULL || pdata->rx_wakeup_irq < 0)
-		msm_uport->rx_wakeup.irq = -1;
-	else {
-		msm_uport->rx_wakeup.irq = pdata->rx_wakeup_irq;
-		msm_uport->rx_wakeup.ignore = 1;
-		msm_uport->rx_wakeup.inject_rx = pdata->inject_rx_on_wakeup;
-		msm_uport->rx_wakeup.rx_to_inject = pdata->rx_to_inject;
-
-		if (unlikely(msm_uport->rx_wakeup.irq < 0))
-			return -ENXIO;
-
-		if (unlikely(irq_set_irq_wake(msm_uport->rx_wakeup.irq, 1)))
-			return -ENXIO;
-	}
-
-	if (pdata == NULL)
-		msm_uport->exit_lpm_cb = NULL;
-	else
-		msm_uport->exit_lpm_cb = pdata->exit_lpm_cb;
-
-	resource = platform_get_resource_byname(pdev, IORESOURCE_DMA,
-						"uartdm_channels");
-	if (unlikely(!resource))
-		return -ENXIO;
-
-	msm_uport->dma_tx_channel = resource->start;
-	msm_uport->dma_rx_channel = resource->end;
-
-	resource = platform_get_resource_byname(pdev, IORESOURCE_DMA,
-						"uartdm_crci");
-	if (unlikely(!resource))
-		return -ENXIO;
-
-	msm_uport->dma_tx_crci = resource->start;
-	msm_uport->dma_rx_crci = resource->end;
-
-	uport->iotype = UPIO_MEM;
-	uport->fifosize = UART_FIFOSIZE;
-	uport->ops = &msm_hs_ops;
-	uport->flags = UPF_BOOT_AUTOCONF;
-	uport->uartclk = UARTCLK;
-	msm_uport->imr_reg = 0x0;
-	msm_uport->clk = clk_get(&pdev->dev, "uartdm_clk");
-	if (IS_ERR(msm_uport->clk))
-		return PTR_ERR(msm_uport->clk);
-
-	ret = uartdm_init_port(uport);
-	if (unlikely(ret))
-		return ret;
-
-	msm_uport->clk_state = MSM_HS_CLK_PORT_OFF;
-	hrtimer_init(&msm_uport->clk_off_timer, CLOCK_MONOTONIC,
-		     HRTIMER_MODE_REL);
-	msm_uport->clk_off_timer.function = msm_hs_clk_off_retry;
-	msm_uport->clk_off_delay = ktime_set(0, 1000000);  /* 1ms */
-
-	uport->line = pdev->id;
-	return uart_add_one_port(&msm_hs_driver, uport);
-}
-
-static int __init msm_serial_hs_init(void)
-{
-	int ret, i;
-
-	/* Init all UARTS as non-configured */
-	for (i = 0; i < UARTDM_NR; i++)
-		q_uart_port[i].uport.type = PORT_UNKNOWN;
-
-	msm_hs_workqueue = create_singlethread_workqueue("msm_serial_hs");
-	if (unlikely(!msm_hs_workqueue))
-		return -ENOMEM;
-
-	ret = uart_register_driver(&msm_hs_driver);
-	if (unlikely(ret)) {
-		printk(KERN_ERR "%s failed to load\n", __func__);
-		goto err_uart_register_driver;
-	}
-
-	ret = platform_driver_register(&msm_serial_hs_platform_driver);
-	if (ret) {
-		printk(KERN_ERR "%s failed to load\n", __func__);
-		goto err_platform_driver_register;
-	}
-
-	return ret;
-
-err_platform_driver_register:
-	uart_unregister_driver(&msm_hs_driver);
-err_uart_register_driver:
-	destroy_workqueue(msm_hs_workqueue);
-	return ret;
-}
-module_init(msm_serial_hs_init);
-
-/*
- *  Called by the upper layer when port is closed.
- *     - Disables the port
- *     - Unhook the ISR
- */
-static void msm_hs_shutdown(struct uart_port *uport)
-{
-	unsigned long flags;
-	struct msm_hs_port *msm_uport = UARTDM_TO_MSM(uport);
-
-	BUG_ON(msm_uport->rx.flush < FLUSH_STOP);
-
-	spin_lock_irqsave(&uport->lock, flags);
-	clk_enable(msm_uport->clk);
-
-	/* Disable the transmitter */
-	msm_hs_write(uport, UARTDM_CR_ADDR, UARTDM_CR_TX_DISABLE_BMSK);
-	/* Disable the receiver */
-	msm_hs_write(uport, UARTDM_CR_ADDR, UARTDM_CR_RX_DISABLE_BMSK);
-
-	pm_runtime_disable(uport->dev);
-	pm_runtime_set_suspended(uport->dev);
-
-	/* Free the interrupt */
-	free_irq(uport->irq, msm_uport);
-	if (use_low_power_rx_wakeup(msm_uport))
-		free_irq(msm_uport->rx_wakeup.irq, msm_uport);
-
-	msm_uport->imr_reg = 0;
-	msm_hs_write(uport, UARTDM_IMR_ADDR, msm_uport->imr_reg);
-
-	wait_event(msm_uport->rx.wait, msm_uport->rx.flush == FLUSH_SHUTDOWN);
-
-	clk_disable(msm_uport->clk);  /* to balance local clk_enable() */
-	if (msm_uport->clk_state != MSM_HS_CLK_OFF)
-		clk_disable(msm_uport->clk);  /* to balance clk_state */
-	msm_uport->clk_state = MSM_HS_CLK_PORT_OFF;
-
-	dma_unmap_single(uport->dev, msm_uport->tx.dma_base,
-			 UART_XMIT_SIZE, DMA_TO_DEVICE);
-
-	spin_unlock_irqrestore(&uport->lock, flags);
-
-	if (cancel_work_sync(&msm_uport->rx.tty_work))
-		msm_hs_tty_flip_buffer_work(&msm_uport->rx.tty_work);
-}
-
-static void __exit msm_serial_hs_exit(void)
-{
-	flush_workqueue(msm_hs_workqueue);
-	destroy_workqueue(msm_hs_workqueue);
-	platform_driver_unregister(&msm_serial_hs_platform_driver);
-	uart_unregister_driver(&msm_hs_driver);
-}
-module_exit(msm_serial_hs_exit);
-
-#ifdef CONFIG_PM
-static int msm_hs_runtime_idle(struct device *dev)
-{
-	/*
-	 * returning success from idle results in runtime suspend to be
-	 * called
-	 */
-	return 0;
-}
-
-static int msm_hs_runtime_resume(struct device *dev)
-{
-	struct platform_device *pdev = container_of(dev, struct
-						    platform_device, dev);
-	struct msm_hs_port *msm_uport = &q_uart_port[pdev->id];
-
-	msm_hs_request_clock_on(&msm_uport->uport);
-	return 0;
-}
-
-static int msm_hs_runtime_suspend(struct device *dev)
-{
-	struct platform_device *pdev = container_of(dev, struct
-						    platform_device, dev);
-	struct msm_hs_port *msm_uport = &q_uart_port[pdev->id];
-
-	msm_hs_request_clock_off(&msm_uport->uport);
-	return 0;
-}
-#else
-#define msm_hs_runtime_idle NULL
-#define msm_hs_runtime_resume NULL
-#define msm_hs_runtime_suspend NULL
-#endif
-
-static const struct dev_pm_ops msm_hs_dev_pm_ops = {
-	.runtime_suspend = msm_hs_runtime_suspend,
-	.runtime_resume  = msm_hs_runtime_resume,
-	.runtime_idle    = msm_hs_runtime_idle,
-};
-
-static struct platform_driver msm_serial_hs_platform_driver = {
-	.probe = msm_hs_probe,
-	.remove = msm_hs_remove,
-	.driver = {
-		.name = "msm_serial_hs",
-		.pm   = &msm_hs_dev_pm_ops,
-	},
-};
-
-static struct uart_driver msm_hs_driver = {
-	.owner = THIS_MODULE,
-	.driver_name = "msm_serial_hs",
-	.dev_name = "ttyHS",
-	.nr = UARTDM_NR,
-	.cons = 0,
-};
-
-static struct uart_ops msm_hs_ops = {
-	.tx_empty = msm_hs_tx_empty,
-	.set_mctrl = msm_hs_set_mctrl_locked,
-	.get_mctrl = msm_hs_get_mctrl_locked,
-	.stop_tx = msm_hs_stop_tx_locked,
-	.start_tx = msm_hs_start_tx_locked,
-	.stop_rx = msm_hs_stop_rx_locked,
-	.enable_ms = msm_hs_enable_ms_locked,
-	.break_ctl = msm_hs_break_ctl,
-	.startup = msm_hs_startup,
-	.shutdown = msm_hs_shutdown,
-	.set_termios = msm_hs_set_termios,
-	.pm = msm_hs_pm,
-	.type = msm_hs_type,
-	.config_port = msm_hs_config_port,
-	.release_port = msm_hs_release_port,
-	.request_port = msm_hs_request_port,
-};
-
-MODULE_DESCRIPTION("High Speed UART Driver for the MSM chipset");
-MODULE_VERSION("1.2");
-MODULE_LICENSE("GPL v2");
diff --git a/include/linux/platform_data/msm_serial_hs.h b/include/linux/platform_data/msm_serial_hs.h
deleted file mode 100644
index 98a2046f8b31..000000000000
--- a/include/linux/platform_data/msm_serial_hs.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2008 Google, Inc.
- * Author: Nick Pelly <npelly@google.com>
- *
- * 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.
- */
-
-#ifndef __ASM_ARCH_MSM_SERIAL_HS_H
-#define __ASM_ARCH_MSM_SERIAL_HS_H
-
-#include <linux/serial_core.h>
-
-/* API to request the uart clock off or on for low power management
- * Clients should call request_clock_off() when no uart data is expected,
- * and must call request_clock_on() before any further uart data can be
- * received. */
-extern void msm_hs_request_clock_off(struct uart_port *uport);
-extern void msm_hs_request_clock_on(struct uart_port *uport);
-
-/**
- * struct msm_serial_hs_platform_data
- * @rx_wakeup_irq: Rx activity irq
- * @rx_to_inject: extra character to be inserted to Rx tty on wakeup
- * @inject_rx: 1 = insert rx_to_inject. 0 = do not insert extra character
- * @exit_lpm_cb: function called before every Tx transaction
- *
- * This is an optional structure required for UART Rx GPIO IRQ based
- * wakeup from low power state. UART wakeup can be triggered by RX activity
- * (using a wakeup GPIO on the UART RX pin). This should only be used if
- * there is not a wakeup GPIO on the UART CTS, and the first RX byte is
- * known (eg., with the Bluetooth Texas Instruments HCILL protocol),
- * since the first RX byte will always be lost. RTS will be asserted even
- * while the UART is clocked off in this mode of operation.
- */
-struct msm_serial_hs_platform_data {
-	int rx_wakeup_irq;
-	unsigned char inject_rx_on_wakeup;
-	char rx_to_inject;
-	void (*exit_lpm_cb)(struct uart_port *);
-};
-
-#endif
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH 04/12] tty: serial: msm_serial: Remove dead code
  2015-03-13 18:09 [PATCH 00/12] Remove mach-msm and associated code Stephen Boyd
                   ` (2 preceding siblings ...)
  2015-03-13 18:09 ` [PATCH 03/12] tty: serial: Remove orphaned serial driver Stephen Boyd
@ 2015-03-13 18:09 ` Stephen Boyd
  2015-03-13 18:09 ` [PATCH 05/12] net: smc91x: " Stephen Boyd
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 32+ messages in thread
From: Stephen Boyd @ 2015-03-13 18:09 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: linux-arm-kernel, linux-kernel, David Brown, Bryan Huntsman,
	Daniel Walker, Arnd Bergmann, Greg Kroah-Hartman

This config no longer exists now that mach-msm has been removed.
Delete it and the associated code.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: David Brown <davidb@codeaurora.org>
Cc: Bryan Huntsman <bryanh@codeaurora.org>
Cc: Daniel Walker <dwalker@fifo99.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---

This can be acked and go through arm-soc or applied directly to serial tree.

 drivers/tty/serial/Kconfig      | 2 +-
 drivers/tty/serial/msm_serial.h | 9 ---------
 2 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 965c80f9fc50..049b9eb2e3e3 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -1054,7 +1054,7 @@ config SERIAL_SGI_IOC3
 
 config SERIAL_MSM
 	bool "MSM on-chip serial port support"
-	depends on ARCH_MSM || ARCH_QCOM
+	depends on ARCH_QCOM
 	select SERIAL_CORE
 
 config SERIAL_MSM_CONSOLE
diff --git a/drivers/tty/serial/msm_serial.h b/drivers/tty/serial/msm_serial.h
index 3e1c7138d8cd..737f69fe7113 100644
--- a/drivers/tty/serial/msm_serial.h
+++ b/drivers/tty/serial/msm_serial.h
@@ -170,15 +170,6 @@ void msm_serial_set_mnd_regs_from_uartclk(struct uart_port *port)
 		msm_serial_set_mnd_regs_tcxoby4(port);
 }
 
-/*
- * TROUT has a specific defect that makes it report it's uartclk
- * as 19.2Mhz (TCXO) when it's actually 4.8Mhz (TCXO/4). This special
- * cases TROUT to use the right clock.
- */
-#ifdef CONFIG_MACH_TROUT
-#define msm_serial_set_mnd_regs msm_serial_set_mnd_regs_tcxoby4
-#else
 #define msm_serial_set_mnd_regs msm_serial_set_mnd_regs_from_uartclk
-#endif
 
 #endif	/* __DRIVERS_SERIAL_MSM_SERIAL_H */
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH 05/12] net: smc91x: Remove dead code
  2015-03-13 18:09 [PATCH 00/12] Remove mach-msm and associated code Stephen Boyd
                   ` (3 preceding siblings ...)
  2015-03-13 18:09 ` [PATCH 04/12] tty: serial: msm_serial: Remove dead code Stephen Boyd
@ 2015-03-13 18:09 ` Stephen Boyd
  2015-03-13 19:52   ` Arnd Bergmann
  2015-03-13 18:09 ` [PATCH 06/12] mmc: Remove msm_sdcc driver Stephen Boyd
                   ` (7 subsequent siblings)
  12 siblings, 1 reply; 32+ messages in thread
From: Stephen Boyd @ 2015-03-13 18:09 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: linux-arm-kernel, linux-kernel, David Brown, Bryan Huntsman,
	Daniel Walker, Arnd Bergmann, David S. Miller

This config no longer exists now that mach-msm has been removed.
Delete it and the associated code.

Cc: David S. Miller <davem@davemloft.net>
Cc: David Brown <davidb@codeaurora.org>
Cc: Bryan Huntsman <bryanh@codeaurora.org>
Cc: Daniel Walker <dwalker@fifo99.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---

This can be acked and go through arm-soc or applied directly.

 drivers/net/ethernet/smsc/smc91x.h | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/drivers/net/ethernet/smsc/smc91x.h b/drivers/net/ethernet/smsc/smc91x.h
index be67baf5f677..6fd5643c4fba 100644
--- a/drivers/net/ethernet/smsc/smc91x.h
+++ b/drivers/net/ethernet/smsc/smc91x.h
@@ -237,20 +237,6 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg)
 #define RPC_LSA_DEFAULT         RPC_LED_100_10
 #define RPC_LSB_DEFAULT         RPC_LED_TX_RX
 
-#elif defined(CONFIG_ARCH_MSM)
-
-#define SMC_CAN_USE_8BIT	0
-#define SMC_CAN_USE_16BIT	1
-#define SMC_CAN_USE_32BIT	0
-#define SMC_NOWAIT		1
-
-#define SMC_inw(a, r)		readw((a) + (r))
-#define SMC_outw(v, a, r)	writew(v, (a) + (r))
-#define SMC_insw(a, r, p, l)	readsw((a) + (r), p, l)
-#define SMC_outsw(a, r, p, l)	writesw((a) + (r), p, l)
-
-#define SMC_IRQ_FLAGS		IRQF_TRIGGER_HIGH
-
 #elif defined(CONFIG_COLDFIRE)
 
 #define SMC_CAN_USE_8BIT	0
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH 06/12] mmc: Remove msm_sdcc driver
  2015-03-13 18:09 [PATCH 00/12] Remove mach-msm and associated code Stephen Boyd
                   ` (4 preceding siblings ...)
  2015-03-13 18:09 ` [PATCH 05/12] net: smc91x: " Stephen Boyd
@ 2015-03-13 18:09 ` Stephen Boyd
  2015-03-16 11:04   ` Ulf Hansson
  2015-03-13 18:09 ` [PATCH 07/12] clocksource: qcom: Remove dead code Stephen Boyd
                   ` (6 subsequent siblings)
  12 siblings, 1 reply; 32+ messages in thread
From: Stephen Boyd @ 2015-03-13 18:09 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: linux-arm-kernel, linux-kernel, David Brown, Bryan Huntsman,
	Daniel Walker, Arnd Bergmann, Ulf Hansson, Chris Ball

This driver is orphaned now that mach-msm has been removed.
Delete it.

Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Chris Ball <chris@printf.net>
Cc: David Brown <davidb@codeaurora.org>
Cc: Bryan Huntsman <bryanh@codeaurora.org>
Cc: Daniel Walker <dwalker@fifo99.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---

I'd appreciate an ack here from mmc maintainers so this can go with patch 1
through arm-soc.

 drivers/mmc/host/Kconfig                   |    8 -
 drivers/mmc/host/Makefile                  |    1 -
 drivers/mmc/host/msm_sdcc.c                | 1474 ----------------------------
 drivers/mmc/host/msm_sdcc.h                |  256 -----
 include/linux/platform_data/mmc-msm_sdcc.h |   27 -
 5 files changed, 1766 deletions(-)
 delete mode 100644 drivers/mmc/host/msm_sdcc.c
 delete mode 100644 drivers/mmc/host/msm_sdcc.h
 delete mode 100644 include/linux/platform_data/mmc-msm_sdcc.h

diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
index 61ac63a3776a..37d1d80fdf04 100644
--- a/drivers/mmc/host/Kconfig
+++ b/drivers/mmc/host/Kconfig
@@ -393,14 +393,6 @@ config MMC_SDHCI_MSM
 
 	  If unsure, say N.
 
-config MMC_MSM
-	tristate "Qualcomm SDCC Controller Support"
-	depends on MMC && (ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50)
-	help
-	  This provides support for the SD/MMC cell found in the
-	  MSM and QSD SOCs from Qualcomm. The controller also has
-	  support for SDIO devices.
-
 config MMC_MXC
 	tristate "Freescale i.MX21/27/31 or MPC512x Multimedia Card support"
 	depends on ARCH_MXC || PPC_MPC512x
diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile
index 6a7cfe0de332..47f9421d0281 100644
--- a/drivers/mmc/host/Makefile
+++ b/drivers/mmc/host/Makefile
@@ -24,7 +24,6 @@ obj-$(CONFIG_MMC_OMAP)		+= omap.o
 obj-$(CONFIG_MMC_OMAP_HS)	+= omap_hsmmc.o
 obj-$(CONFIG_MMC_ATMELMCI)	+= atmel-mci.o
 obj-$(CONFIG_MMC_TIFM_SD)	+= tifm_sd.o
-obj-$(CONFIG_MMC_MSM)		+= msm_sdcc.o
 obj-$(CONFIG_MMC_MVSDIO)	+= mvsdio.o
 obj-$(CONFIG_MMC_DAVINCI)       += davinci_mmc.o
 obj-$(CONFIG_MMC_GOLDFISH)	+= android-goldfish.o
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
deleted file mode 100644
index 90c60fd4ff6e..000000000000
--- a/drivers/mmc/host/msm_sdcc.c
+++ /dev/null
@@ -1,1474 +0,0 @@
-/*
- *  linux/drivers/mmc/host/msm_sdcc.c - Qualcomm MSM 7X00A SDCC Driver
- *
- *  Copyright (C) 2007 Google Inc,
- *  Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved.
- *  Copyright (C) 2009, Code Aurora Forum. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Based on mmci.c
- *
- * Author: San Mehat (san@android.com)
- *
- */
-
-#include <linux/module.h>
-#include <linux/moduleparam.h>
-#include <linux/init.h>
-#include <linux/ioport.h>
-#include <linux/device.h>
-#include <linux/interrupt.h>
-#include <linux/delay.h>
-#include <linux/err.h>
-#include <linux/highmem.h>
-#include <linux/log2.h>
-#include <linux/mmc/host.h>
-#include <linux/mmc/card.h>
-#include <linux/mmc/sdio.h>
-#include <linux/clk.h>
-#include <linux/scatterlist.h>
-#include <linux/platform_device.h>
-#include <linux/dma-mapping.h>
-#include <linux/debugfs.h>
-#include <linux/io.h>
-#include <linux/memory.h>
-#include <linux/gfp.h>
-#include <linux/gpio.h>
-
-#include <asm/cacheflush.h>
-#include <asm/div64.h>
-#include <asm/sizes.h>
-
-#include <linux/platform_data/mmc-msm_sdcc.h>
-#include <mach/dma.h>
-#include <mach/clk.h>
-
-#include "msm_sdcc.h"
-
-#define DRIVER_NAME "msm-sdcc"
-
-#define BUSCLK_PWRSAVE 1
-#define BUSCLK_TIMEOUT (HZ)
-static unsigned int msmsdcc_fmin = 144000;
-static unsigned int msmsdcc_fmax = 50000000;
-static unsigned int msmsdcc_4bit = 1;
-static unsigned int msmsdcc_pwrsave = 1;
-static unsigned int msmsdcc_piopoll = 1;
-static unsigned int msmsdcc_sdioirq;
-
-#define PIO_SPINMAX 30
-#define CMD_SPINMAX 20
-
-
-static inline void
-msmsdcc_disable_clocks(struct msmsdcc_host *host, int deferr)
-{
-	WARN_ON(!host->clks_on);
-
-	BUG_ON(host->curr.mrq);
-
-	if (deferr) {
-		mod_timer(&host->busclk_timer, jiffies + BUSCLK_TIMEOUT);
-	} else {
-		del_timer_sync(&host->busclk_timer);
-		/* Need to check clks_on again in case the busclk
-		 * timer fired
-		 */
-		if (host->clks_on) {
-			clk_disable(host->clk);
-			clk_disable(host->pclk);
-			host->clks_on = 0;
-		}
-	}
-}
-
-static inline int
-msmsdcc_enable_clocks(struct msmsdcc_host *host)
-{
-	int rc;
-
-	del_timer_sync(&host->busclk_timer);
-
-	if (!host->clks_on) {
-		rc = clk_enable(host->pclk);
-		if (rc)
-			return rc;
-		rc = clk_enable(host->clk);
-		if (rc) {
-			clk_disable(host->pclk);
-			return rc;
-		}
-		udelay(1 + ((3 * USEC_PER_SEC) /
-		       (host->clk_rate ? host->clk_rate : msmsdcc_fmin)));
-		host->clks_on = 1;
-	}
-	return 0;
-}
-
-static inline unsigned int
-msmsdcc_readl(struct msmsdcc_host *host, unsigned int reg)
-{
-	return readl(host->base + reg);
-}
-
-static inline void
-msmsdcc_writel(struct msmsdcc_host *host, u32 data, unsigned int reg)
-{
-	writel(data, host->base + reg);
-	/* 3 clk delay required! */
-	udelay(1 + ((3 * USEC_PER_SEC) /
-	       (host->clk_rate ? host->clk_rate : msmsdcc_fmin)));
-}
-
-static void
-msmsdcc_start_command(struct msmsdcc_host *host, struct mmc_command *cmd,
-		      u32 c);
-
-static void msmsdcc_reset_and_restore(struct msmsdcc_host *host)
-{
-	u32	mci_clk = 0;
-	u32	mci_mask0 = 0;
-	int	ret = 0;
-
-	/* Save the controller state */
-	mci_clk = readl(host->base + MMCICLOCK);
-	mci_mask0 = readl(host->base + MMCIMASK0);
-
-	/* Reset the controller */
-	ret = clk_reset(host->clk, CLK_RESET_ASSERT);
-	if (ret)
-		pr_err("%s: Clock assert failed at %u Hz with err %d\n",
-				mmc_hostname(host->mmc), host->clk_rate, ret);
-
-	ret = clk_reset(host->clk, CLK_RESET_DEASSERT);
-	if (ret)
-		pr_err("%s: Clock deassert failed at %u Hz with err %d\n",
-				mmc_hostname(host->mmc), host->clk_rate, ret);
-
-	pr_info("%s: Controller has been re-initialiazed\n",
-			mmc_hostname(host->mmc));
-
-	/* Restore the contoller state */
-	writel(host->pwr, host->base + MMCIPOWER);
-	writel(mci_clk, host->base + MMCICLOCK);
-	writel(mci_mask0, host->base + MMCIMASK0);
-	ret = clk_set_rate(host->clk, host->clk_rate);
-	if (ret)
-		pr_err("%s: Failed to set clk rate %u Hz (%d)\n",
-				mmc_hostname(host->mmc), host->clk_rate, ret);
-}
-
-static void
-msmsdcc_request_end(struct msmsdcc_host *host, struct mmc_request *mrq)
-{
-	BUG_ON(host->curr.data);
-
-	host->curr.mrq = NULL;
-	host->curr.cmd = NULL;
-
-	if (mrq->data)
-		mrq->data->bytes_xfered = host->curr.data_xfered;
-	if (mrq->cmd->error == -ETIMEDOUT)
-		mdelay(5);
-
-#if BUSCLK_PWRSAVE
-	msmsdcc_disable_clocks(host, 1);
-#endif
-	/*
-	 * Need to drop the host lock here; mmc_request_done may call
-	 * back into the driver...
-	 */
-	spin_unlock(&host->lock);
-	mmc_request_done(host->mmc, mrq);
-	spin_lock(&host->lock);
-}
-
-static void
-msmsdcc_stop_data(struct msmsdcc_host *host)
-{
-	host->curr.data = NULL;
-	host->curr.got_dataend = 0;
-}
-
-uint32_t msmsdcc_fifo_addr(struct msmsdcc_host *host)
-{
-	return host->memres->start + MMCIFIFO;
-}
-
-static inline void
-msmsdcc_start_command_exec(struct msmsdcc_host *host, u32 arg, u32 c) {
-       msmsdcc_writel(host, arg, MMCIARGUMENT);
-       msmsdcc_writel(host, c, MMCICOMMAND);
-}
-
-static void
-msmsdcc_dma_exec_func(struct msm_dmov_cmd *cmd)
-{
-	struct msmsdcc_host *host = (struct msmsdcc_host *)cmd->data;
-
-	msmsdcc_writel(host, host->cmd_timeout, MMCIDATATIMER);
-	msmsdcc_writel(host, (unsigned int)host->curr.xfer_size,
-		       MMCIDATALENGTH);
-	msmsdcc_writel(host, (msmsdcc_readl(host, MMCIMASK0) &
-			(~MCI_IRQ_PIO)) | host->cmd_pio_irqmask, MMCIMASK0);
-	msmsdcc_writel(host, host->cmd_datactrl, MMCIDATACTRL);
-
-	if (host->cmd_cmd) {
-		msmsdcc_start_command_exec(host,
-					   (u32) host->cmd_cmd->arg,
-					   (u32) host->cmd_c);
-	}
-	host->dma.active = 1;
-}
-
-static void
-msmsdcc_dma_complete_tlet(unsigned long data)
-{
-	struct msmsdcc_host *host = (struct msmsdcc_host *)data;
-	unsigned long		flags;
-	struct mmc_request	*mrq;
-	struct msm_dmov_errdata err;
-
-	spin_lock_irqsave(&host->lock, flags);
-	host->dma.active = 0;
-
-	err = host->dma.err;
-	mrq = host->curr.mrq;
-	BUG_ON(!mrq);
-	WARN_ON(!mrq->data);
-
-	if (!(host->dma.result & DMOV_RSLT_VALID)) {
-		pr_err("msmsdcc: Invalid DataMover result\n");
-		goto out;
-	}
-
-	if (host->dma.result & DMOV_RSLT_DONE) {
-		host->curr.data_xfered = host->curr.xfer_size;
-	} else {
-		/* Error or flush  */
-		if (host->dma.result & DMOV_RSLT_ERROR)
-			pr_err("%s: DMA error (0x%.8x)\n",
-			       mmc_hostname(host->mmc), host->dma.result);
-		if (host->dma.result & DMOV_RSLT_FLUSH)
-			pr_err("%s: DMA channel flushed (0x%.8x)\n",
-			       mmc_hostname(host->mmc), host->dma.result);
-
-		pr_err("Flush data: %.8x %.8x %.8x %.8x %.8x %.8x\n",
-		       err.flush[0], err.flush[1], err.flush[2],
-		       err.flush[3], err.flush[4], err.flush[5]);
-
-		msmsdcc_reset_and_restore(host);
-		if (!mrq->data->error)
-			mrq->data->error = -EIO;
-	}
-	dma_unmap_sg(mmc_dev(host->mmc), host->dma.sg, host->dma.num_ents,
-		     host->dma.dir);
-
-	host->dma.sg = NULL;
-	host->dma.busy = 0;
-
-	if (host->curr.got_dataend || mrq->data->error) {
-
-		/*
-		 * If we've already gotten our DATAEND / DATABLKEND
-		 * for this request, then complete it through here.
-		 */
-		msmsdcc_stop_data(host);
-
-		if (!mrq->data->error)
-			host->curr.data_xfered = host->curr.xfer_size;
-		if (!mrq->data->stop || mrq->cmd->error) {
-			host->curr.mrq = NULL;
-			host->curr.cmd = NULL;
-			mrq->data->bytes_xfered = host->curr.data_xfered;
-
-			spin_unlock_irqrestore(&host->lock, flags);
-#if BUSCLK_PWRSAVE
-			msmsdcc_disable_clocks(host, 1);
-#endif
-			mmc_request_done(host->mmc, mrq);
-			return;
-		} else
-			msmsdcc_start_command(host, mrq->data->stop, 0);
-	}
-
-out:
-	spin_unlock_irqrestore(&host->lock, flags);
-	return;
-}
-
-static void
-msmsdcc_dma_complete_func(struct msm_dmov_cmd *cmd,
-			  unsigned int result,
-			  struct msm_dmov_errdata *err)
-{
-	struct msmsdcc_dma_data	*dma_data =
-		container_of(cmd, struct msmsdcc_dma_data, hdr);
-	struct msmsdcc_host *host = dma_data->host;
-
-	dma_data->result = result;
-	if (err)
-		memcpy(&dma_data->err, err, sizeof(struct msm_dmov_errdata));
-
-	tasklet_schedule(&host->dma_tlet);
-}
-
-static int validate_dma(struct msmsdcc_host *host, struct mmc_data *data)
-{
-	if (host->dma.channel == -1)
-		return -ENOENT;
-
-	if ((data->blksz * data->blocks) < MCI_FIFOSIZE)
-		return -EINVAL;
-	if ((data->blksz * data->blocks) % MCI_FIFOSIZE)
-		return -EINVAL;
-	return 0;
-}
-
-static int msmsdcc_config_dma(struct msmsdcc_host *host, struct mmc_data *data)
-{
-	struct msmsdcc_nc_dmadata *nc;
-	dmov_box *box;
-	uint32_t rows;
-	uint32_t crci;
-	unsigned int n;
-	int i, rc;
-	struct scatterlist *sg = data->sg;
-
-	rc = validate_dma(host, data);
-	if (rc)
-		return rc;
-
-	host->dma.sg = data->sg;
-	host->dma.num_ents = data->sg_len;
-
-       BUG_ON(host->dma.num_ents > NR_SG); /* Prevent memory corruption */
-
-	nc = host->dma.nc;
-
-	switch (host->pdev_id) {
-	case 1:
-		crci = MSMSDCC_CRCI_SDC1;
-		break;
-	case 2:
-		crci = MSMSDCC_CRCI_SDC2;
-		break;
-	case 3:
-		crci = MSMSDCC_CRCI_SDC3;
-		break;
-	case 4:
-		crci = MSMSDCC_CRCI_SDC4;
-		break;
-	default:
-		host->dma.sg = NULL;
-		host->dma.num_ents = 0;
-		return -ENOENT;
-	}
-
-	if (data->flags & MMC_DATA_READ)
-		host->dma.dir = DMA_FROM_DEVICE;
-	else
-		host->dma.dir = DMA_TO_DEVICE;
-
-	host->curr.user_pages = 0;
-
-	box = &nc->cmd[0];
-
-	/* location of command block must be 64 bit aligned */
-	BUG_ON(host->dma.cmd_busaddr & 0x07);
-
-	nc->cmdptr = (host->dma.cmd_busaddr >> 3) | CMD_PTR_LP;
-	host->dma.hdr.cmdptr = DMOV_CMD_PTR_LIST |
-			       DMOV_CMD_ADDR(host->dma.cmdptr_busaddr);
-	host->dma.hdr.complete_func = msmsdcc_dma_complete_func;
-
-	n = dma_map_sg(mmc_dev(host->mmc), host->dma.sg,
-			host->dma.num_ents, host->dma.dir);
-	if (n == 0) {
-		pr_err("%s: Unable to map in all sg elements\n",
-			mmc_hostname(host->mmc));
-		host->dma.sg = NULL;
-		host->dma.num_ents = 0;
-		return -ENOMEM;
-	}
-
-	for_each_sg(host->dma.sg, sg, n, i) {
-
-		box->cmd = CMD_MODE_BOX;
-
-		if (i == n - 1)
-			box->cmd |= CMD_LC;
-		rows = (sg_dma_len(sg) % MCI_FIFOSIZE) ?
-			(sg_dma_len(sg) / MCI_FIFOSIZE) + 1 :
-			(sg_dma_len(sg) / MCI_FIFOSIZE) ;
-
-		if (data->flags & MMC_DATA_READ) {
-			box->src_row_addr = msmsdcc_fifo_addr(host);
-			box->dst_row_addr = sg_dma_address(sg);
-
-			box->src_dst_len = (MCI_FIFOSIZE << 16) |
-					   (MCI_FIFOSIZE);
-			box->row_offset = MCI_FIFOSIZE;
-
-			box->num_rows = rows * ((1 << 16) + 1);
-			box->cmd |= CMD_SRC_CRCI(crci);
-		} else {
-			box->src_row_addr = sg_dma_address(sg);
-			box->dst_row_addr = msmsdcc_fifo_addr(host);
-
-			box->src_dst_len = (MCI_FIFOSIZE << 16) |
-					   (MCI_FIFOSIZE);
-			box->row_offset = (MCI_FIFOSIZE << 16);
-
-			box->num_rows = rows * ((1 << 16) + 1);
-			box->cmd |= CMD_DST_CRCI(crci);
-		}
-		box++;
-	}
-
-	return 0;
-}
-
-static int
-snoop_cccr_abort(struct mmc_command *cmd)
-{
-	if ((cmd->opcode == 52) &&
-	    (cmd->arg & 0x80000000) &&
-	    (((cmd->arg >> 9) & 0x1ffff) == SDIO_CCCR_ABORT))
-		return 1;
-	return 0;
-}
-
-static void
-msmsdcc_start_command_deferred(struct msmsdcc_host *host,
-				struct mmc_command *cmd, u32 *c)
-{
-	*c |= (cmd->opcode | MCI_CPSM_ENABLE);
-
-	if (cmd->flags & MMC_RSP_PRESENT) {
-		if (cmd->flags & MMC_RSP_136)
-			*c |= MCI_CPSM_LONGRSP;
-		*c |= MCI_CPSM_RESPONSE;
-	}
-
-	if (/*interrupt*/0)
-		*c |= MCI_CPSM_INTERRUPT;
-
-	if ((((cmd->opcode == 17) || (cmd->opcode == 18))  ||
-	     ((cmd->opcode == 24) || (cmd->opcode == 25))) ||
-	      (cmd->opcode == 53))
-		*c |= MCI_CSPM_DATCMD;
-
-	if (host->prog_scan && (cmd->opcode == 12)) {
-		*c |= MCI_CPSM_PROGENA;
-		host->prog_enable = true;
-	}
-
-	if (cmd == cmd->mrq->stop)
-		*c |= MCI_CSPM_MCIABORT;
-
-	if (snoop_cccr_abort(cmd))
-		*c |= MCI_CSPM_MCIABORT;
-
-	if (host->curr.cmd != NULL) {
-		pr_err("%s: Overlapping command requests\n",
-			mmc_hostname(host->mmc));
-	}
-	host->curr.cmd = cmd;
-}
-
-static void
-msmsdcc_start_data(struct msmsdcc_host *host, struct mmc_data *data,
-			struct mmc_command *cmd, u32 c)
-{
-	unsigned int datactrl, timeout;
-	unsigned long long clks;
-	unsigned int pio_irqmask = 0;
-
-	host->curr.data = data;
-	host->curr.xfer_size = data->blksz * data->blocks;
-	host->curr.xfer_remain = host->curr.xfer_size;
-	host->curr.data_xfered = 0;
-	host->curr.got_dataend = 0;
-
-	memset(&host->pio, 0, sizeof(host->pio));
-
-	datactrl = MCI_DPSM_ENABLE | (data->blksz << 4);
-
-	if (!msmsdcc_config_dma(host, data))
-		datactrl |= MCI_DPSM_DMAENABLE;
-	else {
-		host->pio.sg = data->sg;
-		host->pio.sg_len = data->sg_len;
-		host->pio.sg_off = 0;
-
-		if (data->flags & MMC_DATA_READ) {
-			pio_irqmask = MCI_RXFIFOHALFFULLMASK;
-			if (host->curr.xfer_remain < MCI_FIFOSIZE)
-				pio_irqmask |= MCI_RXDATAAVLBLMASK;
-		} else
-			pio_irqmask = MCI_TXFIFOHALFEMPTYMASK;
-	}
-
-	if (data->flags & MMC_DATA_READ)
-		datactrl |= MCI_DPSM_DIRECTION;
-
-	clks = (unsigned long long)data->timeout_ns * host->clk_rate;
-	do_div(clks, NSEC_PER_SEC);
-	timeout = data->timeout_clks + (unsigned int)clks*2 ;
-
-	if (datactrl & MCI_DPSM_DMAENABLE) {
-		/* Save parameters for the exec function */
-		host->cmd_timeout = timeout;
-		host->cmd_pio_irqmask = pio_irqmask;
-		host->cmd_datactrl = datactrl;
-		host->cmd_cmd = cmd;
-
-		host->dma.hdr.execute_func = msmsdcc_dma_exec_func;
-		host->dma.hdr.data = (void *)host;
-		host->dma.busy = 1;
-
-		if (cmd) {
-			msmsdcc_start_command_deferred(host, cmd, &c);
-			host->cmd_c = c;
-		}
-		msm_dmov_enqueue_cmd(host->dma.channel, &host->dma.hdr);
-		if (data->flags & MMC_DATA_WRITE)
-			host->prog_scan = true;
-	} else {
-		msmsdcc_writel(host, timeout, MMCIDATATIMER);
-
-		msmsdcc_writel(host, host->curr.xfer_size, MMCIDATALENGTH);
-
-		msmsdcc_writel(host, (msmsdcc_readl(host, MMCIMASK0) &
-				(~MCI_IRQ_PIO)) | pio_irqmask, MMCIMASK0);
-
-		msmsdcc_writel(host, datactrl, MMCIDATACTRL);
-
-		if (cmd) {
-			/* Daisy-chain the command if requested */
-			msmsdcc_start_command(host, cmd, c);
-		}
-	}
-}
-
-static void
-msmsdcc_start_command(struct msmsdcc_host *host, struct mmc_command *cmd, u32 c)
-{
-	if (cmd == cmd->mrq->stop)
-		c |= MCI_CSPM_MCIABORT;
-
-	host->stats.cmds++;
-
-	msmsdcc_start_command_deferred(host, cmd, &c);
-	msmsdcc_start_command_exec(host, cmd->arg, c);
-}
-
-static void
-msmsdcc_data_err(struct msmsdcc_host *host, struct mmc_data *data,
-		 unsigned int status)
-{
-	if (status & MCI_DATACRCFAIL) {
-		pr_err("%s: Data CRC error\n", mmc_hostname(host->mmc));
-		pr_err("%s: opcode 0x%.8x\n", __func__,
-		       data->mrq->cmd->opcode);
-		pr_err("%s: blksz %d, blocks %d\n", __func__,
-		       data->blksz, data->blocks);
-		data->error = -EILSEQ;
-	} else if (status & MCI_DATATIMEOUT) {
-		pr_err("%s: Data timeout\n", mmc_hostname(host->mmc));
-		data->error = -ETIMEDOUT;
-	} else if (status & MCI_RXOVERRUN) {
-		pr_err("%s: RX overrun\n", mmc_hostname(host->mmc));
-		data->error = -EIO;
-	} else if (status & MCI_TXUNDERRUN) {
-		pr_err("%s: TX underrun\n", mmc_hostname(host->mmc));
-		data->error = -EIO;
-	} else {
-		pr_err("%s: Unknown error (0x%.8x)\n",
-		       mmc_hostname(host->mmc), status);
-		data->error = -EIO;
-	}
-}
-
-
-static int
-msmsdcc_pio_read(struct msmsdcc_host *host, char *buffer, unsigned int remain)
-{
-	uint32_t	*ptr = (uint32_t *) buffer;
-	int		count = 0;
-
-	if (remain % 4)
-		remain = ((remain >> 2) + 1) << 2;
-
-	while (msmsdcc_readl(host, MMCISTATUS) & MCI_RXDATAAVLBL) {
-		*ptr = msmsdcc_readl(host, MMCIFIFO + (count % MCI_FIFOSIZE));
-		ptr++;
-		count += sizeof(uint32_t);
-
-		remain -=  sizeof(uint32_t);
-		if (remain == 0)
-			break;
-	}
-	return count;
-}
-
-static int
-msmsdcc_pio_write(struct msmsdcc_host *host, char *buffer,
-		  unsigned int remain, u32 status)
-{
-	void __iomem *base = host->base;
-	char *ptr = buffer;
-
-	do {
-		unsigned int count, maxcnt, sz;
-
-		maxcnt = status & MCI_TXFIFOEMPTY ? MCI_FIFOSIZE :
-						    MCI_FIFOHALFSIZE;
-		count = min(remain, maxcnt);
-
-		sz = count % 4 ? (count >> 2) + 1 : (count >> 2);
-		writesl(base + MMCIFIFO, ptr, sz);
-		ptr += count;
-		remain -= count;
-
-		if (remain == 0)
-			break;
-
-		status = msmsdcc_readl(host, MMCISTATUS);
-	} while (status & MCI_TXFIFOHALFEMPTY);
-
-	return ptr - buffer;
-}
-
-static int
-msmsdcc_spin_on_status(struct msmsdcc_host *host, uint32_t mask, int maxspin)
-{
-	while (maxspin) {
-		if ((msmsdcc_readl(host, MMCISTATUS) & mask))
-			return 0;
-		udelay(1);
-		--maxspin;
-	}
-	return -ETIMEDOUT;
-}
-
-static irqreturn_t
-msmsdcc_pio_irq(int irq, void *dev_id)
-{
-	struct msmsdcc_host	*host = dev_id;
-	uint32_t		status;
-	u32 mci_mask0;
-
-	status = msmsdcc_readl(host, MMCISTATUS);
-	mci_mask0 = msmsdcc_readl(host, MMCIMASK0);
-
-	if (((mci_mask0 & status) & MCI_IRQ_PIO) == 0)
-		return IRQ_NONE;
-
-	do {
-		unsigned long flags;
-		unsigned int remain, len;
-		char *buffer;
-
-		if (!(status & (MCI_TXFIFOHALFEMPTY | MCI_RXDATAAVLBL))) {
-			if (host->curr.xfer_remain == 0 || !msmsdcc_piopoll)
-				break;
-
-			if (msmsdcc_spin_on_status(host,
-						   (MCI_TXFIFOHALFEMPTY |
-						   MCI_RXDATAAVLBL),
-						   PIO_SPINMAX)) {
-				break;
-			}
-		}
-
-		/* Map the current scatter buffer */
-		local_irq_save(flags);
-		buffer = kmap_atomic(sg_page(host->pio.sg))
-				     + host->pio.sg->offset;
-		buffer += host->pio.sg_off;
-		remain = host->pio.sg->length - host->pio.sg_off;
-		len = 0;
-		if (status & MCI_RXACTIVE)
-			len = msmsdcc_pio_read(host, buffer, remain);
-		if (status & MCI_TXACTIVE)
-			len = msmsdcc_pio_write(host, buffer, remain, status);
-
-		/* Unmap the buffer */
-		kunmap_atomic(buffer);
-		local_irq_restore(flags);
-
-		host->pio.sg_off += len;
-		host->curr.xfer_remain -= len;
-		host->curr.data_xfered += len;
-		remain -= len;
-
-		if (remain == 0) {
-			/* This sg page is full - do some housekeeping */
-			if (status & MCI_RXACTIVE && host->curr.user_pages)
-				flush_dcache_page(sg_page(host->pio.sg));
-
-			if (!--host->pio.sg_len) {
-				memset(&host->pio, 0, sizeof(host->pio));
-				break;
-			}
-
-			/* Advance to next sg */
-			host->pio.sg++;
-			host->pio.sg_off = 0;
-		}
-
-		status = msmsdcc_readl(host, MMCISTATUS);
-	} while (1);
-
-	if (status & MCI_RXACTIVE && host->curr.xfer_remain < MCI_FIFOSIZE)
-		msmsdcc_writel(host, (mci_mask0 & (~MCI_IRQ_PIO)) |
-					MCI_RXDATAAVLBLMASK, MMCIMASK0);
-
-	if (!host->curr.xfer_remain)
-		msmsdcc_writel(host, (mci_mask0 & (~MCI_IRQ_PIO)) | 0,
-					MMCIMASK0);
-
-	return IRQ_HANDLED;
-}
-
-static void msmsdcc_do_cmdirq(struct msmsdcc_host *host, uint32_t status)
-{
-	struct mmc_command *cmd = host->curr.cmd;
-
-	host->curr.cmd = NULL;
-	cmd->resp[0] = msmsdcc_readl(host, MMCIRESPONSE0);
-	cmd->resp[1] = msmsdcc_readl(host, MMCIRESPONSE1);
-	cmd->resp[2] = msmsdcc_readl(host, MMCIRESPONSE2);
-	cmd->resp[3] = msmsdcc_readl(host, MMCIRESPONSE3);
-
-	if (status & MCI_CMDTIMEOUT) {
-		cmd->error = -ETIMEDOUT;
-	} else if (status & MCI_CMDCRCFAIL &&
-		   cmd->flags & MMC_RSP_CRC) {
-		pr_err("%s: Command CRC error\n", mmc_hostname(host->mmc));
-		cmd->error = -EILSEQ;
-	}
-
-	if (!cmd->data || cmd->error) {
-		if (host->curr.data && host->dma.sg)
-			msm_dmov_stop_cmd(host->dma.channel,
-					  &host->dma.hdr, 0);
-		else if (host->curr.data) { /* Non DMA */
-			msmsdcc_reset_and_restore(host);
-			msmsdcc_stop_data(host);
-			msmsdcc_request_end(host, cmd->mrq);
-		} else { /* host->data == NULL */
-			if (!cmd->error && host->prog_enable) {
-				if (status & MCI_PROGDONE) {
-					host->prog_scan = false;
-					host->prog_enable = false;
-					msmsdcc_request_end(host, cmd->mrq);
-				} else {
-					host->curr.cmd = cmd;
-				}
-			} else {
-				if (host->prog_enable) {
-					host->prog_scan = false;
-					host->prog_enable = false;
-				}
-				msmsdcc_request_end(host, cmd->mrq);
-			}
-		}
-	} else if (cmd->data)
-		if (!(cmd->data->flags & MMC_DATA_READ))
-			msmsdcc_start_data(host, cmd->data,
-						NULL, 0);
-}
-
-static void
-msmsdcc_handle_irq_data(struct msmsdcc_host *host, u32 status,
-			void __iomem *base)
-{
-	struct mmc_data *data = host->curr.data;
-
-	if (status & (MCI_CMDSENT | MCI_CMDRESPEND | MCI_CMDCRCFAIL |
-			MCI_CMDTIMEOUT | MCI_PROGDONE) && host->curr.cmd) {
-		msmsdcc_do_cmdirq(host, status);
-	}
-
-	if (!data)
-		return;
-
-	/* Check for data errors */
-	if (status & (MCI_DATACRCFAIL | MCI_DATATIMEOUT |
-		      MCI_TXUNDERRUN | MCI_RXOVERRUN)) {
-		msmsdcc_data_err(host, data, status);
-		host->curr.data_xfered = 0;
-		if (host->dma.sg)
-			msm_dmov_stop_cmd(host->dma.channel,
-					  &host->dma.hdr, 0);
-		else {
-			msmsdcc_reset_and_restore(host);
-			if (host->curr.data)
-				msmsdcc_stop_data(host);
-			if (!data->stop)
-				msmsdcc_request_end(host, data->mrq);
-			else
-				msmsdcc_start_command(host, data->stop, 0);
-		}
-	}
-
-	/* Check for data done */
-	if (!host->curr.got_dataend && (status & MCI_DATAEND))
-		host->curr.got_dataend = 1;
-
-	/*
-	 * If DMA is still in progress, we complete via the completion handler
-	 */
-	if (host->curr.got_dataend && !host->dma.busy) {
-		/*
-		 * There appears to be an issue in the controller where
-		 * if you request a small block transfer (< fifo size),
-		 * you may get your DATAEND/DATABLKEND irq without the
-		 * PIO data irq.
-		 *
-		 * Check to see if there is still data to be read,
-		 * and simulate a PIO irq.
-		 */
-		if (readl(base + MMCISTATUS) & MCI_RXDATAAVLBL)
-			msmsdcc_pio_irq(1, host);
-
-		msmsdcc_stop_data(host);
-		if (!data->error)
-			host->curr.data_xfered = host->curr.xfer_size;
-
-		if (!data->stop)
-			msmsdcc_request_end(host, data->mrq);
-		else
-			msmsdcc_start_command(host, data->stop, 0);
-	}
-}
-
-static irqreturn_t
-msmsdcc_irq(int irq, void *dev_id)
-{
-	struct msmsdcc_host	*host = dev_id;
-	void __iomem		*base = host->base;
-	u32			status;
-	int			ret = 0;
-	int			cardint = 0;
-
-	spin_lock(&host->lock);
-
-	do {
-		status = msmsdcc_readl(host, MMCISTATUS);
-		status &= msmsdcc_readl(host, MMCIMASK0);
-		if ((status & (~MCI_IRQ_PIO)) == 0)
-			break;
-		msmsdcc_writel(host, status, MMCICLEAR);
-
-		if (status & MCI_SDIOINTR)
-			status &= ~MCI_SDIOINTR;
-
-		if (!status)
-			break;
-
-		msmsdcc_handle_irq_data(host, status, base);
-
-		if (status & MCI_SDIOINTOPER) {
-			cardint = 1;
-			status &= ~MCI_SDIOINTOPER;
-		}
-		ret = 1;
-	} while (status);
-
-	spin_unlock(&host->lock);
-
-	/*
-	 * We have to delay handling the card interrupt as it calls
-	 * back into the driver.
-	 */
-	if (cardint)
-		mmc_signal_sdio_irq(host->mmc);
-
-	return IRQ_RETVAL(ret);
-}
-
-static void
-msmsdcc_request(struct mmc_host *mmc, struct mmc_request *mrq)
-{
-	struct msmsdcc_host *host = mmc_priv(mmc);
-	unsigned long flags;
-
-	WARN_ON(host->curr.mrq != NULL);
-	WARN_ON(host->pwr == 0);
-
-	spin_lock_irqsave(&host->lock, flags);
-
-	host->stats.reqs++;
-
-	if (host->eject) {
-		if (mrq->data && !(mrq->data->flags & MMC_DATA_READ)) {
-			mrq->cmd->error = 0;
-			mrq->data->bytes_xfered = mrq->data->blksz *
-						  mrq->data->blocks;
-		} else
-			mrq->cmd->error = -ENOMEDIUM;
-
-		spin_unlock_irqrestore(&host->lock, flags);
-		mmc_request_done(mmc, mrq);
-		return;
-	}
-
-	msmsdcc_enable_clocks(host);
-
-	host->curr.mrq = mrq;
-
-	if (mrq->data && mrq->data->flags & MMC_DATA_READ)
-		/* Queue/read data, daisy-chain command when data starts */
-		msmsdcc_start_data(host, mrq->data, mrq->cmd, 0);
-	else
-		msmsdcc_start_command(host, mrq->cmd, 0);
-
-	if (host->cmdpoll && !msmsdcc_spin_on_status(host,
-				MCI_CMDRESPEND|MCI_CMDCRCFAIL|MCI_CMDTIMEOUT,
-				CMD_SPINMAX)) {
-		uint32_t status = msmsdcc_readl(host, MMCISTATUS);
-		msmsdcc_do_cmdirq(host, status);
-		msmsdcc_writel(host,
-			       MCI_CMDRESPEND | MCI_CMDCRCFAIL | MCI_CMDTIMEOUT,
-			       MMCICLEAR);
-		host->stats.cmdpoll_hits++;
-	} else {
-		host->stats.cmdpoll_misses++;
-	}
-	spin_unlock_irqrestore(&host->lock, flags);
-}
-
-static void msmsdcc_setup_gpio(struct msmsdcc_host *host, bool enable)
-{
-	struct msm_mmc_gpio_data *curr;
-	int i, rc = 0;
-
-	if (!host->plat->gpio_data || host->gpio_config_status == enable)
-		return;
-
-	curr = host->plat->gpio_data;
-	for (i = 0; i < curr->size; i++) {
-		if (enable) {
-			rc = gpio_request(curr->gpio[i].no,
-						curr->gpio[i].name);
-			if (rc) {
-				pr_err("%s: gpio_request(%d, %s) failed %d\n",
-					mmc_hostname(host->mmc),
-					curr->gpio[i].no,
-					curr->gpio[i].name, rc);
-				goto free_gpios;
-			}
-		} else {
-			gpio_free(curr->gpio[i].no);
-		}
-	}
-	host->gpio_config_status = enable;
-	return;
-
-free_gpios:
-	for (; i >= 0; i--)
-		gpio_free(curr->gpio[i].no);
-}
-
-static void
-msmsdcc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
-{
-	struct msmsdcc_host *host = mmc_priv(mmc);
-	u32 clk = 0, pwr = 0;
-	int rc;
-	unsigned long flags;
-
-	spin_lock_irqsave(&host->lock, flags);
-
-	msmsdcc_enable_clocks(host);
-
-	spin_unlock_irqrestore(&host->lock, flags);
-
-	if (ios->clock) {
-		if (ios->clock != host->clk_rate) {
-			rc = clk_set_rate(host->clk, ios->clock);
-			if (rc < 0)
-				pr_err("%s: Error setting clock rate (%d)\n",
-				       mmc_hostname(host->mmc), rc);
-			else
-				host->clk_rate = ios->clock;
-		}
-		clk |= MCI_CLK_ENABLE;
-	}
-
-	if (ios->bus_width == MMC_BUS_WIDTH_4)
-		clk |= (2 << 10); /* Set WIDEBUS */
-
-	if (ios->clock > 400000 && msmsdcc_pwrsave)
-		clk |= (1 << 9); /* PWRSAVE */
-
-	clk |= (1 << 12); /* FLOW_ENA */
-	clk |= (1 << 15); /* feedback clock */
-
-	if (host->plat->translate_vdd)
-		pwr |= host->plat->translate_vdd(mmc_dev(mmc), ios->vdd);
-
-	switch (ios->power_mode) {
-	case MMC_POWER_OFF:
-		msmsdcc_setup_gpio(host, false);
-		break;
-	case MMC_POWER_UP:
-		pwr |= MCI_PWR_UP;
-		msmsdcc_setup_gpio(host, true);
-		break;
-	case MMC_POWER_ON:
-		pwr |= MCI_PWR_ON;
-		break;
-	}
-
-	if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN)
-		pwr |= MCI_OD;
-
-	msmsdcc_writel(host, clk, MMCICLOCK);
-
-	if (host->pwr != pwr) {
-		host->pwr = pwr;
-		msmsdcc_writel(host, pwr, MMCIPOWER);
-	}
-#if BUSCLK_PWRSAVE
-	spin_lock_irqsave(&host->lock, flags);
-	msmsdcc_disable_clocks(host, 1);
-	spin_unlock_irqrestore(&host->lock, flags);
-#endif
-}
-
-static void msmsdcc_enable_sdio_irq(struct mmc_host *mmc, int enable)
-{
-	struct msmsdcc_host *host = mmc_priv(mmc);
-	unsigned long flags;
-	u32 status;
-
-	spin_lock_irqsave(&host->lock, flags);
-	if (msmsdcc_sdioirq == 1) {
-		status = msmsdcc_readl(host, MMCIMASK0);
-		if (enable)
-			status |= MCI_SDIOINTOPERMASK;
-		else
-			status &= ~MCI_SDIOINTOPERMASK;
-		host->saved_irq0mask = status;
-		msmsdcc_writel(host, status, MMCIMASK0);
-	}
-	spin_unlock_irqrestore(&host->lock, flags);
-}
-
-static void msmsdcc_init_card(struct mmc_host *mmc, struct mmc_card *card)
-{
-	struct msmsdcc_host *host = mmc_priv(mmc);
-
-	if (host->plat->init_card)
-		host->plat->init_card(card);
-}
-
-static const struct mmc_host_ops msmsdcc_ops = {
-	.request	= msmsdcc_request,
-	.set_ios	= msmsdcc_set_ios,
-	.enable_sdio_irq = msmsdcc_enable_sdio_irq,
-	.init_card	= msmsdcc_init_card,
-};
-
-static void
-msmsdcc_check_status(unsigned long data)
-{
-	struct msmsdcc_host *host = (struct msmsdcc_host *)data;
-	unsigned int status;
-
-	if (!host->plat->status) {
-		mmc_detect_change(host->mmc, 0);
-		goto out;
-	}
-
-	status = host->plat->status(mmc_dev(host->mmc));
-	host->eject = !status;
-	if (status ^ host->oldstat) {
-		pr_info("%s: Slot status change detected (%d -> %d)\n",
-			mmc_hostname(host->mmc), host->oldstat, status);
-		if (status)
-			mmc_detect_change(host->mmc, (5 * HZ) / 2);
-		else
-			mmc_detect_change(host->mmc, 0);
-	}
-
-	host->oldstat = status;
-
-out:
-	if (host->timer.function)
-		mod_timer(&host->timer, jiffies + HZ);
-}
-
-static irqreturn_t
-msmsdcc_platform_status_irq(int irq, void *dev_id)
-{
-	struct msmsdcc_host *host = dev_id;
-
-	pr_debug("%s: %d\n", __func__, irq);
-	msmsdcc_check_status((unsigned long) host);
-	return IRQ_HANDLED;
-}
-
-static void
-msmsdcc_status_notify_cb(int card_present, void *dev_id)
-{
-	struct msmsdcc_host *host = dev_id;
-
-	pr_debug("%s: card_present %d\n", mmc_hostname(host->mmc),
-	       card_present);
-	msmsdcc_check_status((unsigned long) host);
-}
-
-static void
-msmsdcc_busclk_expired(unsigned long _data)
-{
-	struct msmsdcc_host	*host = (struct msmsdcc_host *) _data;
-
-	if (host->clks_on)
-		msmsdcc_disable_clocks(host, 0);
-}
-
-static int
-msmsdcc_init_dma(struct msmsdcc_host *host)
-{
-	memset(&host->dma, 0, sizeof(struct msmsdcc_dma_data));
-	host->dma.host = host;
-	host->dma.channel = -1;
-
-	if (!host->dmares)
-		return -ENODEV;
-
-	host->dma.nc = dma_alloc_coherent(NULL,
-					  sizeof(struct msmsdcc_nc_dmadata),
-					  &host->dma.nc_busaddr,
-					  GFP_KERNEL);
-	if (host->dma.nc == NULL) {
-		pr_err("Unable to allocate DMA buffer\n");
-		return -ENOMEM;
-	}
-	memset(host->dma.nc, 0x00, sizeof(struct msmsdcc_nc_dmadata));
-	host->dma.cmd_busaddr = host->dma.nc_busaddr;
-	host->dma.cmdptr_busaddr = host->dma.nc_busaddr +
-				offsetof(struct msmsdcc_nc_dmadata, cmdptr);
-	host->dma.channel = host->dmares->start;
-
-	return 0;
-}
-
-static int
-msmsdcc_probe(struct platform_device *pdev)
-{
-	struct msm_mmc_platform_data *plat = pdev->dev.platform_data;
-	struct msmsdcc_host *host;
-	struct mmc_host *mmc;
-	struct resource *cmd_irqres = NULL;
-	struct resource *stat_irqres = NULL;
-	struct resource *memres = NULL;
-	struct resource *dmares = NULL;
-	int ret;
-
-	/* must have platform data */
-	if (!plat) {
-		pr_err("%s: Platform data not available\n", __func__);
-		ret = -EINVAL;
-		goto out;
-	}
-
-	if (pdev->id < 1 || pdev->id > 4)
-		return -EINVAL;
-
-	if (pdev->resource == NULL || pdev->num_resources < 2) {
-		pr_err("%s: Invalid resource\n", __func__);
-		return -ENXIO;
-	}
-
-	memres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0);
-	cmd_irqres = platform_get_resource_byname(pdev, IORESOURCE_IRQ,
-						  "cmd_irq");
-	stat_irqres = platform_get_resource_byname(pdev, IORESOURCE_IRQ,
-						   "status_irq");
-
-	if (!cmd_irqres || !memres) {
-		pr_err("%s: Invalid resource\n", __func__);
-		return -ENXIO;
-	}
-
-	/*
-	 * Setup our host structure
-	 */
-
-	mmc = mmc_alloc_host(sizeof(struct msmsdcc_host), &pdev->dev);
-	if (!mmc) {
-		ret = -ENOMEM;
-		goto out;
-	}
-
-	host = mmc_priv(mmc);
-	host->pdev_id = pdev->id;
-	host->plat = plat;
-	host->mmc = mmc;
-	host->curr.cmd = NULL;
-	init_timer(&host->busclk_timer);
-	host->busclk_timer.data = (unsigned long) host;
-	host->busclk_timer.function = msmsdcc_busclk_expired;
-
-
-	host->cmdpoll = 1;
-
-	host->base = ioremap(memres->start, PAGE_SIZE);
-	if (!host->base) {
-		ret = -ENOMEM;
-		goto host_free;
-	}
-
-	host->cmd_irqres = cmd_irqres;
-	host->memres = memres;
-	host->dmares = dmares;
-	spin_lock_init(&host->lock);
-
-	tasklet_init(&host->dma_tlet, msmsdcc_dma_complete_tlet,
-			(unsigned long)host);
-
-	/*
-	 * Setup DMA
-	 */
-	if (host->dmares) {
-		ret = msmsdcc_init_dma(host);
-		if (ret)
-			goto ioremap_free;
-	} else {
-		host->dma.channel = -1;
-	}
-
-	/* Get our clocks */
-	host->pclk = clk_get(&pdev->dev, "sdc_pclk");
-	if (IS_ERR(host->pclk)) {
-		ret = PTR_ERR(host->pclk);
-		goto dma_free;
-	}
-
-	host->clk = clk_get(&pdev->dev, "sdc_clk");
-	if (IS_ERR(host->clk)) {
-		ret = PTR_ERR(host->clk);
-		goto pclk_put;
-	}
-
-	ret = clk_set_rate(host->clk, msmsdcc_fmin);
-	if (ret) {
-		pr_err("%s: Clock rate set failed (%d)\n", __func__, ret);
-		goto clk_put;
-	}
-
-	ret = clk_prepare(host->pclk);
-	if (ret)
-		goto clk_put;
-
-	ret = clk_prepare(host->clk);
-	if (ret)
-		goto clk_unprepare_p;
-
-	/* Enable clocks */
-	ret = msmsdcc_enable_clocks(host);
-	if (ret)
-		goto clk_unprepare;
-
-	host->pclk_rate = clk_get_rate(host->pclk);
-	host->clk_rate = clk_get_rate(host->clk);
-
-	/*
-	 * Setup MMC host structure
-	 */
-	mmc->ops = &msmsdcc_ops;
-	mmc->f_min = msmsdcc_fmin;
-	mmc->f_max = msmsdcc_fmax;
-	mmc->ocr_avail = plat->ocr_mask;
-
-	if (msmsdcc_4bit)
-		mmc->caps |= MMC_CAP_4_BIT_DATA;
-	if (msmsdcc_sdioirq)
-		mmc->caps |= MMC_CAP_SDIO_IRQ;
-	mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED;
-
-	mmc->max_segs = NR_SG;
-	mmc->max_blk_size = 4096;	/* MCI_DATA_CTL BLOCKSIZE up to 4096 */
-	mmc->max_blk_count = 65536;
-
-	mmc->max_req_size = 33554432;	/* MCI_DATA_LENGTH is 25 bits */
-	mmc->max_seg_size = mmc->max_req_size;
-
-	msmsdcc_writel(host, 0, MMCIMASK0);
-	msmsdcc_writel(host, 0x5e007ff, MMCICLEAR);
-
-	msmsdcc_writel(host, MCI_IRQENABLE, MMCIMASK0);
-	host->saved_irq0mask = MCI_IRQENABLE;
-
-	/*
-	 * Setup card detect change
-	 */
-
-	memset(&host->timer, 0, sizeof(host->timer));
-
-	if (stat_irqres && !(stat_irqres->flags & IORESOURCE_DISABLED)) {
-		unsigned long irqflags = IRQF_SHARED |
-			(stat_irqres->flags & IRQF_TRIGGER_MASK);
-
-		host->stat_irq = stat_irqres->start;
-		ret = request_irq(host->stat_irq,
-				  msmsdcc_platform_status_irq,
-				  irqflags,
-				  DRIVER_NAME " (slot)",
-				  host);
-		if (ret) {
-			pr_err("%s: Unable to get slot IRQ %d (%d)\n",
-			       mmc_hostname(mmc), host->stat_irq, ret);
-			goto clk_disable;
-		}
-	} else if (plat->register_status_notify) {
-		plat->register_status_notify(msmsdcc_status_notify_cb, host);
-	} else if (!plat->status)
-		pr_err("%s: No card detect facilities available\n",
-		       mmc_hostname(mmc));
-	else {
-		init_timer(&host->timer);
-		host->timer.data = (unsigned long)host;
-		host->timer.function = msmsdcc_check_status;
-		host->timer.expires = jiffies + HZ;
-		add_timer(&host->timer);
-	}
-
-	if (plat->status) {
-		host->oldstat = host->plat->status(mmc_dev(host->mmc));
-		host->eject = !host->oldstat;
-	}
-
-	ret = request_irq(cmd_irqres->start, msmsdcc_irq, IRQF_SHARED,
-			  DRIVER_NAME " (cmd)", host);
-	if (ret)
-		goto stat_irq_free;
-
-	ret = request_irq(cmd_irqres->start, msmsdcc_pio_irq, IRQF_SHARED,
-			  DRIVER_NAME " (pio)", host);
-	if (ret)
-		goto cmd_irq_free;
-
-	platform_set_drvdata(pdev, mmc);
-	mmc_add_host(mmc);
-
-	pr_info("%s: Qualcomm MSM SDCC at 0x%016llx irq %d,%d dma %d\n",
-		mmc_hostname(mmc), (unsigned long long)memres->start,
-		(unsigned int) cmd_irqres->start,
-		(unsigned int) host->stat_irq, host->dma.channel);
-	pr_info("%s: 4 bit data mode %s\n", mmc_hostname(mmc),
-		(mmc->caps & MMC_CAP_4_BIT_DATA ? "enabled" : "disabled"));
-	pr_info("%s: MMC clock %u -> %u Hz, PCLK %u Hz\n",
-		mmc_hostname(mmc), msmsdcc_fmin, msmsdcc_fmax, host->pclk_rate);
-	pr_info("%s: Slot eject status = %d\n", mmc_hostname(mmc), host->eject);
-	pr_info("%s: Power save feature enable = %d\n",
-		mmc_hostname(mmc), msmsdcc_pwrsave);
-
-	if (host->dma.channel != -1) {
-		pr_info("%s: DM non-cached buffer at %p, dma_addr 0x%.8x\n",
-			mmc_hostname(mmc), host->dma.nc, host->dma.nc_busaddr);
-		pr_info("%s: DM cmd busaddr 0x%.8x, cmdptr busaddr 0x%.8x\n",
-			mmc_hostname(mmc), host->dma.cmd_busaddr,
-			host->dma.cmdptr_busaddr);
-	} else
-		pr_info("%s: PIO transfer enabled\n", mmc_hostname(mmc));
-	if (host->timer.function)
-		pr_info("%s: Polling status mode enabled\n", mmc_hostname(mmc));
-
-	return 0;
- cmd_irq_free:
-	free_irq(cmd_irqres->start, host);
- stat_irq_free:
-	if (host->stat_irq)
-		free_irq(host->stat_irq, host);
- clk_disable:
-	msmsdcc_disable_clocks(host, 0);
- clk_unprepare:
-	clk_unprepare(host->clk);
- clk_unprepare_p:
-	clk_unprepare(host->pclk);
- clk_put:
-	clk_put(host->clk);
- pclk_put:
-	clk_put(host->pclk);
-dma_free:
-	if (host->dmares)
-		dma_free_coherent(NULL, sizeof(struct msmsdcc_nc_dmadata),
-					host->dma.nc, host->dma.nc_busaddr);
-ioremap_free:
-	tasklet_kill(&host->dma_tlet);
-	iounmap(host->base);
- host_free:
-	mmc_free_host(mmc);
- out:
-	return ret;
-}
-
-#ifdef CONFIG_PM
-static int
-msmsdcc_suspend(struct platform_device *dev, pm_message_t state)
-{
-	struct mmc_host *mmc = platform_get_drvdata(dev);
-
-	if (mmc) {
-		struct msmsdcc_host *host = mmc_priv(mmc);
-
-		if (host->stat_irq)
-			disable_irq(host->stat_irq);
-
-		msmsdcc_writel(host, 0, MMCIMASK0);
-		if (host->clks_on)
-			msmsdcc_disable_clocks(host, 0);
-	}
-	return 0;
-}
-
-static int
-msmsdcc_resume(struct platform_device *dev)
-{
-	struct mmc_host *mmc = platform_get_drvdata(dev);
-
-	if (mmc) {
-		struct msmsdcc_host *host = mmc_priv(mmc);
-
-		msmsdcc_enable_clocks(host);
-
-		msmsdcc_writel(host, host->saved_irq0mask, MMCIMASK0);
-
-		if (host->stat_irq)
-			enable_irq(host->stat_irq);
-#if BUSCLK_PWRSAVE
-		msmsdcc_disable_clocks(host, 1);
-#endif
-	}
-	return 0;
-}
-#else
-#define msmsdcc_suspend	0
-#define msmsdcc_resume 0
-#endif
-
-static struct platform_driver msmsdcc_driver = {
-	.probe		= msmsdcc_probe,
-	.suspend	= msmsdcc_suspend,
-	.resume		= msmsdcc_resume,
-	.driver		= {
-		.name	= "msm_sdcc",
-	},
-};
-
-module_platform_driver(msmsdcc_driver);
-
-MODULE_DESCRIPTION("Qualcomm MSM 7X00A Multimedia Card Interface driver");
-MODULE_LICENSE("GPL");
diff --git a/drivers/mmc/host/msm_sdcc.h b/drivers/mmc/host/msm_sdcc.h
deleted file mode 100644
index 402028d16b86..000000000000
--- a/drivers/mmc/host/msm_sdcc.h
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- *  linux/drivers/mmc/host/msmsdcc.h - QCT MSM7K SDC Controller
- *
- *  Copyright (C) 2008 Google, All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * - Based on mmci.h
- */
-
-#ifndef _MSM_SDCC_H
-#define _MSM_SDCC_H
-
-#define MSMSDCC_CRCI_SDC1	6
-#define MSMSDCC_CRCI_SDC2	7
-#define MSMSDCC_CRCI_SDC3	12
-#define MSMSDCC_CRCI_SDC4	13
-
-#define MMCIPOWER		0x000
-#define MCI_PWR_OFF		0x00
-#define MCI_PWR_UP		0x02
-#define MCI_PWR_ON		0x03
-#define MCI_OD			(1 << 6)
-
-#define MMCICLOCK		0x004
-#define MCI_CLK_ENABLE		(1 << 8)
-#define MCI_CLK_PWRSAVE		(1 << 9)
-#define MCI_CLK_WIDEBUS		(1 << 10)
-#define MCI_CLK_FLOWENA		(1 << 12)
-#define MCI_CLK_INVERTOUT	(1 << 13)
-#define MCI_CLK_SELECTIN	(1 << 14)
-
-#define MMCIARGUMENT		0x008
-#define MMCICOMMAND		0x00c
-#define MCI_CPSM_RESPONSE	(1 << 6)
-#define MCI_CPSM_LONGRSP	(1 << 7)
-#define MCI_CPSM_INTERRUPT	(1 << 8)
-#define MCI_CPSM_PENDING	(1 << 9)
-#define MCI_CPSM_ENABLE		(1 << 10)
-#define MCI_CPSM_PROGENA	(1 << 11)
-#define MCI_CSPM_DATCMD		(1 << 12)
-#define MCI_CSPM_MCIABORT	(1 << 13)
-#define MCI_CSPM_CCSENABLE	(1 << 14)
-#define MCI_CSPM_CCSDISABLE	(1 << 15)
-
-
-#define MMCIRESPCMD		0x010
-#define MMCIRESPONSE0		0x014
-#define MMCIRESPONSE1		0x018
-#define MMCIRESPONSE2		0x01c
-#define MMCIRESPONSE3		0x020
-#define MMCIDATATIMER		0x024
-#define MMCIDATALENGTH		0x028
-
-#define MMCIDATACTRL		0x02c
-#define MCI_DPSM_ENABLE		(1 << 0)
-#define MCI_DPSM_DIRECTION	(1 << 1)
-#define MCI_DPSM_MODE		(1 << 2)
-#define MCI_DPSM_DMAENABLE	(1 << 3)
-
-#define MMCIDATACNT		0x030
-#define MMCISTATUS		0x034
-#define MCI_CMDCRCFAIL		(1 << 0)
-#define MCI_DATACRCFAIL		(1 << 1)
-#define MCI_CMDTIMEOUT		(1 << 2)
-#define MCI_DATATIMEOUT		(1 << 3)
-#define MCI_TXUNDERRUN		(1 << 4)
-#define MCI_RXOVERRUN		(1 << 5)
-#define MCI_CMDRESPEND		(1 << 6)
-#define MCI_CMDSENT		(1 << 7)
-#define MCI_DATAEND		(1 << 8)
-#define MCI_DATABLOCKEND	(1 << 10)
-#define MCI_CMDACTIVE		(1 << 11)
-#define MCI_TXACTIVE		(1 << 12)
-#define MCI_RXACTIVE		(1 << 13)
-#define MCI_TXFIFOHALFEMPTY	(1 << 14)
-#define MCI_RXFIFOHALFFULL	(1 << 15)
-#define MCI_TXFIFOFULL		(1 << 16)
-#define MCI_RXFIFOFULL		(1 << 17)
-#define MCI_TXFIFOEMPTY		(1 << 18)
-#define MCI_RXFIFOEMPTY		(1 << 19)
-#define MCI_TXDATAAVLBL		(1 << 20)
-#define MCI_RXDATAAVLBL		(1 << 21)
-#define MCI_SDIOINTR		(1 << 22)
-#define MCI_PROGDONE		(1 << 23)
-#define MCI_ATACMDCOMPL		(1 << 24)
-#define MCI_SDIOINTOPER		(1 << 25)
-#define MCI_CCSTIMEOUT		(1 << 26)
-
-#define MMCICLEAR		0x038
-#define MCI_CMDCRCFAILCLR	(1 << 0)
-#define MCI_DATACRCFAILCLR	(1 << 1)
-#define MCI_CMDTIMEOUTCLR	(1 << 2)
-#define MCI_DATATIMEOUTCLR	(1 << 3)
-#define MCI_TXUNDERRUNCLR	(1 << 4)
-#define MCI_RXOVERRUNCLR	(1 << 5)
-#define MCI_CMDRESPENDCLR	(1 << 6)
-#define MCI_CMDSENTCLR		(1 << 7)
-#define MCI_DATAENDCLR		(1 << 8)
-#define MCI_DATABLOCKENDCLR	(1 << 10)
-
-#define MMCIMASK0		0x03c
-#define MCI_CMDCRCFAILMASK	(1 << 0)
-#define MCI_DATACRCFAILMASK	(1 << 1)
-#define MCI_CMDTIMEOUTMASK	(1 << 2)
-#define MCI_DATATIMEOUTMASK	(1 << 3)
-#define MCI_TXUNDERRUNMASK	(1 << 4)
-#define MCI_RXOVERRUNMASK	(1 << 5)
-#define MCI_CMDRESPENDMASK	(1 << 6)
-#define MCI_CMDSENTMASK		(1 << 7)
-#define MCI_DATAENDMASK		(1 << 8)
-#define MCI_DATABLOCKENDMASK	(1 << 10)
-#define MCI_CMDACTIVEMASK	(1 << 11)
-#define MCI_TXACTIVEMASK	(1 << 12)
-#define MCI_RXACTIVEMASK	(1 << 13)
-#define MCI_TXFIFOHALFEMPTYMASK	(1 << 14)
-#define MCI_RXFIFOHALFFULLMASK	(1 << 15)
-#define MCI_TXFIFOFULLMASK	(1 << 16)
-#define MCI_RXFIFOFULLMASK	(1 << 17)
-#define MCI_TXFIFOEMPTYMASK	(1 << 18)
-#define MCI_RXFIFOEMPTYMASK	(1 << 19)
-#define MCI_TXDATAAVLBLMASK	(1 << 20)
-#define MCI_RXDATAAVLBLMASK	(1 << 21)
-#define MCI_SDIOINTMASK		(1 << 22)
-#define MCI_PROGDONEMASK	(1 << 23)
-#define MCI_ATACMDCOMPLMASK	(1 << 24)
-#define MCI_SDIOINTOPERMASK	(1 << 25)
-#define MCI_CCSTIMEOUTMASK	(1 << 26)
-
-#define MMCIMASK1		0x040
-#define MMCIFIFOCNT		0x044
-#define MCICCSTIMER		0x058
-
-#define MMCIFIFO		0x080 /* to 0x0bc */
-
-#define MCI_IRQENABLE	\
-	(MCI_CMDCRCFAILMASK|MCI_DATACRCFAILMASK|MCI_CMDTIMEOUTMASK|	\
-	MCI_DATATIMEOUTMASK|MCI_TXUNDERRUNMASK|MCI_RXOVERRUNMASK|	\
-	MCI_CMDRESPENDMASK|MCI_CMDSENTMASK|MCI_DATAENDMASK|MCI_PROGDONEMASK)
-
-#define MCI_IRQ_PIO \
-	(MCI_RXDATAAVLBLMASK | MCI_TXDATAAVLBLMASK | MCI_RXFIFOEMPTYMASK | \
-	 MCI_TXFIFOEMPTYMASK | MCI_RXFIFOFULLMASK | MCI_TXFIFOFULLMASK | \
-	 MCI_RXFIFOHALFFULLMASK | MCI_TXFIFOHALFEMPTYMASK | \
-	 MCI_RXACTIVEMASK | MCI_TXACTIVEMASK)
-/*
- * The size of the FIFO in bytes.
- */
-#define MCI_FIFOSIZE	(16*4)
-
-#define MCI_FIFOHALFSIZE (MCI_FIFOSIZE / 2)
-
-#define NR_SG		32
-
-struct clk;
-
-struct msmsdcc_nc_dmadata {
-	dmov_box	cmd[NR_SG];
-	uint32_t	cmdptr;
-};
-
-struct msmsdcc_dma_data {
-	struct msmsdcc_nc_dmadata	*nc;
-	dma_addr_t			nc_busaddr;
-	dma_addr_t			cmd_busaddr;
-	dma_addr_t			cmdptr_busaddr;
-
-	struct msm_dmov_cmd		hdr;
-	enum dma_data_direction		dir;
-
-	struct scatterlist		*sg;
-	int				num_ents;
-
-	int				channel;
-	struct msmsdcc_host		*host;
-	int				busy; /* Set if DM is busy */
-	int				active;
-	unsigned int			result;
-	struct msm_dmov_errdata		err;
-};
-
-struct msmsdcc_pio_data {
-	struct scatterlist	*sg;
-	unsigned int		sg_len;
-	unsigned int		sg_off;
-};
-
-struct msmsdcc_curr_req {
-	struct mmc_request	*mrq;
-	struct mmc_command	*cmd;
-	struct mmc_data		*data;
-	unsigned int		xfer_size;	/* Total data size */
-	unsigned int		xfer_remain;	/* Bytes remaining to send */
-	unsigned int		data_xfered;	/* Bytes acked by BLKEND irq */
-	int			got_dataend;
-	int			user_pages;
-};
-
-struct msmsdcc_stats {
-	unsigned int reqs;
-	unsigned int cmds;
-	unsigned int cmdpoll_hits;
-	unsigned int cmdpoll_misses;
-};
-
-struct msmsdcc_host {
-	struct resource		*cmd_irqres;
-	struct resource		*memres;
-	struct resource		*dmares;
-	void __iomem		*base;
-	int			pdev_id;
-	unsigned int		stat_irq;
-
-	struct msmsdcc_curr_req	curr;
-
-	struct mmc_host		*mmc;
-	struct clk		*clk;		/* main MMC bus clock */
-	struct clk		*pclk;		/* SDCC peripheral bus clock */
-	unsigned int		clks_on;	/* set if clocks are enabled */
-	struct timer_list	busclk_timer;
-
-	unsigned int		eject;		/* eject state */
-
-	spinlock_t		lock;
-
-	unsigned int		clk_rate;	/* Current clock rate */
-	unsigned int		pclk_rate;
-
-	u32			pwr;
-	u32			saved_irq0mask;	/* MMCIMASK0 reg value */
-	struct msm_mmc_platform_data *plat;
-
-	struct timer_list	timer;
-	unsigned int		oldstat;
-
-	struct msmsdcc_dma_data	dma;
-	struct msmsdcc_pio_data	pio;
-	int			cmdpoll;
-	struct msmsdcc_stats	stats;
-
-	struct tasklet_struct	dma_tlet;
-	/* Command parameters */
-	unsigned int		cmd_timeout;
-	unsigned int		cmd_pio_irqmask;
-	unsigned int		cmd_datactrl;
-	struct mmc_command	*cmd_cmd;
-	u32			cmd_c;
-	bool			gpio_config_status;
-
-	bool prog_scan;
-	bool prog_enable;
-};
-
-#endif
diff --git a/include/linux/platform_data/mmc-msm_sdcc.h b/include/linux/platform_data/mmc-msm_sdcc.h
deleted file mode 100644
index 55aa873c9396..000000000000
--- a/include/linux/platform_data/mmc-msm_sdcc.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef __MMC_MSM_SDCC_H
-#define __MMC_MSM_SDCC_H
-
-#include <linux/mmc/host.h>
-#include <linux/mmc/card.h>
-#include <linux/mmc/sdio_func.h>
-
-struct msm_mmc_gpio {
-	unsigned no;
-	const char *name;
-};
-
-struct msm_mmc_gpio_data {
-	struct msm_mmc_gpio *gpio;
-	u8 size;
-};
-
-struct msm_mmc_platform_data {
-	unsigned int ocr_mask;			/* available voltages */
-	u32 (*translate_vdd)(struct device *, unsigned int);
-	unsigned int (*status)(struct device *);
-	int (*register_status_notify)(void (*callback)(int card_present, void *dev_id), void *dev_id);
-	struct msm_mmc_gpio_data *gpio_data;
-	void (*init_card)(struct mmc_card *card);
-};
-
-#endif
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH 07/12] clocksource: qcom: Remove dead code
  2015-03-13 18:09 [PATCH 00/12] Remove mach-msm and associated code Stephen Boyd
                   ` (5 preceding siblings ...)
  2015-03-13 18:09 ` [PATCH 06/12] mmc: Remove msm_sdcc driver Stephen Boyd
@ 2015-03-13 18:09 ` Stephen Boyd
  2015-03-13 18:14   ` Daniel Lezcano
  2015-03-13 18:09 ` [PATCH 08/12] ehci-msm: Remove dead dependency Stephen Boyd
                   ` (5 subsequent siblings)
  12 siblings, 1 reply; 32+ messages in thread
From: Stephen Boyd @ 2015-03-13 18:09 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: linux-arm-kernel, linux-kernel, David Brown, Bryan Huntsman,
	Daniel Walker, Arnd Bergmann, Daniel Lezcano

This code is no longer used now that mach-msm has been removed.
Delete it.

Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: David Brown <davidb@codeaurora.org>
Cc: Bryan Huntsman <bryanh@codeaurora.org>
Cc: Daniel Walker <dwalker@fifo99.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---

This can be acked and go through arm-soc or applied directly to clocksource
tree.

 drivers/clocksource/qcom-timer.c | 59 ----------------------------------------
 1 file changed, 59 deletions(-)

diff --git a/drivers/clocksource/qcom-timer.c b/drivers/clocksource/qcom-timer.c
index 098c542e5c53..cba2d015564c 100644
--- a/drivers/clocksource/qcom-timer.c
+++ b/drivers/clocksource/qcom-timer.c
@@ -40,8 +40,6 @@
 
 #define GPT_HZ 32768
 
-#define MSM_DGT_SHIFT 5
-
 static void __iomem *event_base;
 static void __iomem *sts_base;
 
@@ -232,7 +230,6 @@ err:
 	register_current_timer_delay(&msm_delay_timer);
 }
 
-#ifdef CONFIG_ARCH_QCOM
 static void __init msm_dt_timer_init(struct device_node *np)
 {
 	u32 freq;
@@ -285,59 +282,3 @@ static void __init msm_dt_timer_init(struct device_node *np)
 }
 CLOCKSOURCE_OF_DECLARE(kpss_timer, "qcom,kpss-timer", msm_dt_timer_init);
 CLOCKSOURCE_OF_DECLARE(scss_timer, "qcom,scss-timer", msm_dt_timer_init);
-#else
-
-static int __init msm_timer_map(phys_addr_t addr, u32 event, u32 source,
-				u32 sts)
-{
-	void __iomem *base;
-
-	base = ioremap(addr, SZ_256);
-	if (!base) {
-		pr_err("Failed to map timer base\n");
-		return -ENOMEM;
-	}
-	event_base = base + event;
-	source_base = base + source;
-	if (sts)
-		sts_base = base + sts;
-
-	return 0;
-}
-
-static notrace cycle_t msm_read_timer_count_shift(struct clocksource *cs)
-{
-	/*
-	 * Shift timer count down by a constant due to unreliable lower bits
-	 * on some targets.
-	 */
-	return msm_read_timer_count(cs) >> MSM_DGT_SHIFT;
-}
-
-void __init msm7x01_timer_init(void)
-{
-	struct clocksource *cs = &msm_clocksource;
-
-	if (msm_timer_map(0xc0100000, 0x0, 0x10, 0x0))
-		return;
-	cs->read = msm_read_timer_count_shift;
-	cs->mask = CLOCKSOURCE_MASK((32 - MSM_DGT_SHIFT));
-	/* 600 KHz */
-	msm_timer_init(19200000 >> MSM_DGT_SHIFT, 32 - MSM_DGT_SHIFT, 7,
-			false);
-}
-
-void __init msm7x30_timer_init(void)
-{
-	if (msm_timer_map(0xc0100000, 0x4, 0x24, 0x80))
-		return;
-	msm_timer_init(24576000 / 4, 32, 1, false);
-}
-
-void __init qsd8x50_timer_init(void)
-{
-	if (msm_timer_map(0xAC100000, 0x0, 0x10, 0x34))
-		return;
-	msm_timer_init(19200000 / 4, 32, 7, false);
-}
-#endif
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH 08/12] ehci-msm: Remove dead dependency
  2015-03-13 18:09 [PATCH 00/12] Remove mach-msm and associated code Stephen Boyd
                   ` (6 preceding siblings ...)
  2015-03-13 18:09 ` [PATCH 07/12] clocksource: qcom: Remove dead code Stephen Boyd
@ 2015-03-13 18:09 ` Stephen Boyd
  2015-03-13 18:09 ` [PATCH 09/12] usb: phy: msm: Remove dead code Stephen Boyd
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 32+ messages in thread
From: Stephen Boyd @ 2015-03-13 18:09 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: linux-arm-kernel, linux-kernel, David Brown, Bryan Huntsman,
	Daniel Walker, Arnd Bergmann, Greg Kroah-Hartman, Alan Stern,
	linux-usb

This dependency no longer exists now that mach-msm has been
removed. Delete it.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: linux-usb@vger.kernel.org
Cc: David Brown <davidb@codeaurora.org>
Cc: Bryan Huntsman <bryanh@codeaurora.org>
Cc: Daniel Walker <dwalker@fifo99.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---

This can be acked and go through arm-soc or applied directly to usb tree.

 drivers/usb/host/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 5ad60e46dc2b..197a6a3e613b 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -198,7 +198,7 @@ config USB_EHCI_HCD_AT91
 
 config USB_EHCI_MSM
 	tristate "Support for Qualcomm QSD/MSM on-chip EHCI USB controller"
-	depends on ARCH_MSM || ARCH_QCOM
+	depends on ARCH_QCOM
 	select USB_EHCI_ROOT_HUB_TT
 	---help---
 	  Enables support for the USB Host controller present on the
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH 09/12] usb: phy: msm: Remove dead code
  2015-03-13 18:09 [PATCH 00/12] Remove mach-msm and associated code Stephen Boyd
                   ` (7 preceding siblings ...)
  2015-03-13 18:09 ` [PATCH 08/12] ehci-msm: Remove dead dependency Stephen Boyd
@ 2015-03-13 18:09 ` Stephen Boyd
  2015-03-13 18:09 ` [PATCH 10/12] phy: qcom-ufs: Switch dependency to ARCH_QCOM Stephen Boyd
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 32+ messages in thread
From: Stephen Boyd @ 2015-03-13 18:09 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: linux-arm-kernel, linux-kernel, David Brown, Bryan Huntsman,
	Daniel Walker, Arnd Bergmann, Felipe Balbi, Greg Kroah-Hartman,
	linux-usb

This code is no longer used now that mach-msm has been removed.
Delete it.

Cc: Felipe Balbi <balbi@ti.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Cc: David Brown <davidb@codeaurora.org>
Cc: Bryan Huntsman <bryanh@codeaurora.org>
Cc: Daniel Walker <dwalker@fifo99.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---

This needs an ack to go through arm-soc with patch 1 that removes the platform
code using these ops.

 drivers/usb/phy/Kconfig       |  2 +-
 drivers/usb/phy/phy-msm-usb.c | 18 ++----------------
 include/linux/usb/msm_hsusb.h |  4 ----
 3 files changed, 3 insertions(+), 21 deletions(-)

diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig
index 52d3d58252e1..2fb3828b5089 100644
--- a/drivers/usb/phy/Kconfig
+++ b/drivers/usb/phy/Kconfig
@@ -139,7 +139,7 @@ config USB_ISP1301
 
 config USB_MSM_OTG
 	tristate "Qualcomm on-chip USB OTG controller support"
-	depends on (USB || USB_GADGET) && (ARCH_MSM || ARCH_QCOM || COMPILE_TEST)
+	depends on (USB || USB_GADGET) && (ARCH_QCOM || COMPILE_TEST)
 	depends on RESET_CONTROLLER
 	select USB_PHY
 	help
diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
index 000fd892455f..b50c45c62da7 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -263,9 +263,7 @@ static int msm_otg_link_clk_reset(struct msm_otg *motg, bool assert)
 {
 	int ret;
 
-	if (motg->pdata->link_clk_reset)
-		ret = motg->pdata->link_clk_reset(motg->clk, assert);
-	else if (assert)
+	if (assert)
 		ret = reset_control_assert(motg->link_rst);
 	else
 		ret = reset_control_deassert(motg->link_rst);
@@ -281,9 +279,7 @@ static int msm_otg_phy_clk_reset(struct msm_otg *motg)
 {
 	int ret = 0;
 
-	if (motg->pdata->phy_clk_reset)
-		ret = motg->pdata->phy_clk_reset(motg->phy_reset_clk);
-	else if (motg->phy_rst)
+	if (motg->phy_rst)
 		ret = reset_control_reset(motg->phy_rst);
 
 	if (ret)
@@ -1551,16 +1547,6 @@ static int msm_otg_probe(struct platform_device *pdev)
 	phy = &motg->phy;
 	phy->dev = &pdev->dev;
 
-	if (motg->pdata->phy_clk_reset) {
-		motg->phy_reset_clk = devm_clk_get(&pdev->dev,
-					   np ? "phy" : "usb_phy_clk");
-
-		if (IS_ERR(motg->phy_reset_clk)) {
-			dev_err(&pdev->dev, "failed to get usb_phy_clk\n");
-			return PTR_ERR(motg->phy_reset_clk);
-		}
-	}
-
 	motg->clk = devm_clk_get(&pdev->dev, np ? "core" : "usb_hs_clk");
 	if (IS_ERR(motg->clk)) {
 		dev_err(&pdev->dev, "failed to get usb_hs_clk\n");
diff --git a/include/linux/usb/msm_hsusb.h b/include/linux/usb/msm_hsusb.h
index b0a39243295a..7dbecf9a4656 100644
--- a/include/linux/usb/msm_hsusb.h
+++ b/include/linux/usb/msm_hsusb.h
@@ -117,8 +117,6 @@ struct msm_otg_platform_data {
 	enum otg_control_type otg_control;
 	enum msm_usb_phy_type phy_type;
 	void (*setup_gpio)(enum usb_otg_state state);
-	int (*link_clk_reset)(struct clk *link_clk, bool assert);
-	int (*phy_clk_reset)(struct clk *phy_clk);
 };
 
 /**
@@ -128,7 +126,6 @@ struct msm_otg_platform_data {
  * @irq: IRQ number assigned for HSUSB controller.
  * @clk: clock struct of usb_hs_clk.
  * @pclk: clock struct of usb_hs_pclk.
- * @phy_reset_clk: clock struct of usb_phy_clk.
  * @core_clk: clock struct of usb_hs_core_clk.
  * @regs: ioremapped register base address.
  * @inputs: OTG state machine inputs(Id, SessValid etc).
@@ -148,7 +145,6 @@ struct msm_otg {
 	int irq;
 	struct clk *clk;
 	struct clk *pclk;
-	struct clk *phy_reset_clk;
 	struct clk *core_clk;
 	void __iomem *regs;
 #define ID		0
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH 10/12] phy: qcom-ufs: Switch dependency to ARCH_QCOM
  2015-03-13 18:09 [PATCH 00/12] Remove mach-msm and associated code Stephen Boyd
                   ` (8 preceding siblings ...)
  2015-03-13 18:09 ` [PATCH 09/12] usb: phy: msm: Remove dead code Stephen Boyd
@ 2015-03-13 18:09 ` Stephen Boyd
  2015-03-13 18:09 ` [PATCH 11/12] ufs-qcom: " Stephen Boyd
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 32+ messages in thread
From: Stephen Boyd @ 2015-03-13 18:09 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: linux-arm-kernel, linux-kernel, David Brown, Bryan Huntsman,
	Daniel Walker, Arnd Bergmann, Yaniv Gardi, Dov Levenglick,
	Christoph Hellwig

This phy only exists on platforms under ARCH_QCOM, not ARCH_MSM.

Cc: Yaniv Gardi <ygardi@codeaurora.org>
Cc: Dov Levenglick <dovl@codeaurora.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: David Brown <davidb@codeaurora.org>
Cc: Bryan Huntsman <bryanh@codeaurora.org>
Cc: Daniel Walker <dwalker@fifo99.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---

This can be acked and go through arm-soc or applied directly to phy tree.

 drivers/phy/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
index 2962de205ba7..9b1ff313bd51 100644
--- a/drivers/phy/Kconfig
+++ b/drivers/phy/Kconfig
@@ -286,7 +286,7 @@ config PHY_STIH41X_USB
 
 config PHY_QCOM_UFS
 	tristate "Qualcomm UFS PHY driver"
-	depends on OF && ARCH_MSM
+	depends on OF && ARCH_QCOM
 	select GENERIC_PHY
 	help
 	  Support for UFS PHY on QCOM chipsets.
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH 11/12] ufs-qcom: Switch dependency to ARCH_QCOM
  2015-03-13 18:09 [PATCH 00/12] Remove mach-msm and associated code Stephen Boyd
                   ` (9 preceding siblings ...)
  2015-03-13 18:09 ` [PATCH 10/12] phy: qcom-ufs: Switch dependency to ARCH_QCOM Stephen Boyd
@ 2015-03-13 18:09 ` Stephen Boyd
  2015-03-13 18:09 ` [PATCH 12/12] msm: msm_fb: Remove dead code Stephen Boyd
  2015-03-13 19:55 ` [PATCH 00/12] Remove mach-msm and associated code Arnd Bergmann
  12 siblings, 0 replies; 32+ messages in thread
From: Stephen Boyd @ 2015-03-13 18:09 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: linux-arm-kernel, linux-kernel, David Brown, Bryan Huntsman,
	Daniel Walker, Arnd Bergmann, Yaniv Gardi, Dov Levenglick,
	Christoph Hellwig

This device only exists on platforms under ARCH_QCOM, not
ARCH_MSM.

Cc: Yaniv Gardi <ygardi@codeaurora.org>
Cc: Dov Levenglick <dovl@codeaurora.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: David Brown <davidb@codeaurora.org>
Cc: Bryan Huntsman <bryanh@codeaurora.org>
Cc: Daniel Walker <dwalker@fifo99.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---

This can be acked and go through arm-soc or applied directly. 

 drivers/scsi/ufs/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/ufs/Kconfig b/drivers/scsi/ufs/Kconfig
index 8a1f4b355416..e94538362536 100644
--- a/drivers/scsi/ufs/Kconfig
+++ b/drivers/scsi/ufs/Kconfig
@@ -73,7 +73,7 @@ config SCSI_UFSHCD_PLATFORM
 
 config SCSI_UFS_QCOM
 	bool "QCOM specific hooks to UFS controller platform driver"
-	depends on SCSI_UFSHCD_PLATFORM && ARCH_MSM
+	depends on SCSI_UFSHCD_PLATFORM && ARCH_QCOM
 	select PHY_QCOM_UFS
 	help
 	  This selects the QCOM specific additions to UFSHCD platform driver.
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH 12/12] msm: msm_fb: Remove dead code
  2015-03-13 18:09 [PATCH 00/12] Remove mach-msm and associated code Stephen Boyd
                   ` (10 preceding siblings ...)
  2015-03-13 18:09 ` [PATCH 11/12] ufs-qcom: " Stephen Boyd
@ 2015-03-13 18:09 ` Stephen Boyd
  2015-03-13 18:51   ` Jean-Christophe PLAGNIOL-VILLARD
  2015-03-13 19:55 ` [PATCH 00/12] Remove mach-msm and associated code Arnd Bergmann
  12 siblings, 1 reply; 32+ messages in thread
From: Stephen Boyd @ 2015-03-13 18:09 UTC (permalink / raw)
  To: linux-arm-msm
  Cc: linux-arm-kernel, linux-kernel, David Brown, Bryan Huntsman,
	Daniel Walker, Arnd Bergmann, Jean-Christophe Plagniol-Villard,
	Tomi Valkeinen

This code is no longer used now that mach-msm has been removed.
Delete it.

Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: David Brown <davidb@codeaurora.org>
Cc: Bryan Huntsman <bryanh@codeaurora.org>
Cc: Daniel Walker <dwalker@fifo99.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---

This needs an ack to go through arm-soc with patch 1.

 drivers/video/fbdev/Kconfig                   |   7 -
 drivers/video/fbdev/Makefile                  |   1 -
 drivers/video/fbdev/msm/Makefile              |  19 -
 drivers/video/fbdev/msm/mddi.c                | 821 --------------------------
 drivers/video/fbdev/msm/mddi_client_dummy.c   |  85 ---
 drivers/video/fbdev/msm/mddi_client_nt35399.c | 252 --------
 drivers/video/fbdev/msm/mddi_client_toshiba.c | 280 ---------
 drivers/video/fbdev/msm/mddi_hw.h             | 305 ----------
 drivers/video/fbdev/msm/mdp.c                 | 520 ----------------
 drivers/video/fbdev/msm/mdp_csc_table.h       | 582 ------------------
 drivers/video/fbdev/msm/mdp_hw.h              | 627 --------------------
 drivers/video/fbdev/msm/mdp_ppp.c             | 731 -----------------------
 drivers/video/fbdev/msm/mdp_scale_tables.c    | 766 ------------------------
 drivers/video/fbdev/msm/mdp_scale_tables.h    |  38 --
 drivers/video/fbdev/msm/msm_fb.c              | 659 ---------------------
 include/linux/platform_data/video-msm_fb.h    | 146 -----
 16 files changed, 5839 deletions(-)
 delete mode 100644 drivers/video/fbdev/msm/Makefile
 delete mode 100644 drivers/video/fbdev/msm/mddi.c
 delete mode 100644 drivers/video/fbdev/msm/mddi_client_dummy.c
 delete mode 100644 drivers/video/fbdev/msm/mddi_client_nt35399.c
 delete mode 100644 drivers/video/fbdev/msm/mddi_client_toshiba.c
 delete mode 100644 drivers/video/fbdev/msm/mddi_hw.h
 delete mode 100644 drivers/video/fbdev/msm/mdp.c
 delete mode 100644 drivers/video/fbdev/msm/mdp_csc_table.h
 delete mode 100644 drivers/video/fbdev/msm/mdp_hw.h
 delete mode 100644 drivers/video/fbdev/msm/mdp_ppp.c
 delete mode 100644 drivers/video/fbdev/msm/mdp_scale_tables.c
 delete mode 100644 drivers/video/fbdev/msm/mdp_scale_tables.h
 delete mode 100644 drivers/video/fbdev/msm/msm_fb.c
 delete mode 100644 include/linux/platform_data/video-msm_fb.h

diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index b3dd417b4719..b8bf5978e288 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -2326,13 +2326,6 @@ config FB_PRE_INIT_FB
 	  Select this option if display contents should be inherited as set by
 	  the bootloader.
 
-config FB_MSM
-	tristate "MSM Framebuffer support"
-	depends on FB && ARCH_MSM
-	select FB_CFB_FILLRECT
-	select FB_CFB_COPYAREA
-	select FB_CFB_IMAGEBLIT
-
 config FB_MX3
 	tristate "MX3 Framebuffer support"
 	depends on FB && MX3_IPU
diff --git a/drivers/video/fbdev/Makefile b/drivers/video/fbdev/Makefile
index 1979afffccfe..cecea5063a80 100644
--- a/drivers/video/fbdev/Makefile
+++ b/drivers/video/fbdev/Makefile
@@ -126,7 +126,6 @@ obj-y                             += omap2/
 obj-$(CONFIG_XEN_FBDEV_FRONTEND)  += xen-fbfront.o
 obj-$(CONFIG_FB_CARMINE)          += carminefb.o
 obj-$(CONFIG_FB_MB862XX)	  += mb862xx/
-obj-$(CONFIG_FB_MSM)              += msm/
 obj-$(CONFIG_FB_NUC900)           += nuc900fb.o
 obj-$(CONFIG_FB_JZ4740)		  += jz4740_fb.o
 obj-$(CONFIG_FB_PUV3_UNIGFX)      += fb-puv3.o
diff --git a/drivers/video/fbdev/msm/Makefile b/drivers/video/fbdev/msm/Makefile
deleted file mode 100644
index 802d6ae523fb..000000000000
--- a/drivers/video/fbdev/msm/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-
-# core framebuffer
-#
-obj-y := msm_fb.o
-
-# MDP DMA/PPP engine
-#
-obj-y += mdp.o mdp_scale_tables.o mdp_ppp.o
-
-# MDDI interface
-#
-obj-y += mddi.o
-
-# MDDI client/panel drivers
-#
-obj-y += mddi_client_dummy.o
-obj-y += mddi_client_toshiba.o
-obj-y += mddi_client_nt35399.o
-
diff --git a/drivers/video/fbdev/msm/mddi.c b/drivers/video/fbdev/msm/mddi.c
deleted file mode 100644
index e0f8011a3c4b..000000000000
--- a/drivers/video/fbdev/msm/mddi.c
+++ /dev/null
@@ -1,821 +0,0 @@
-/*
- * MSM MDDI Transport
- *
- * Copyright (C) 2007 Google Incorporated
- * Copyright (C) 2007 QUALCOMM Incorporated
- *
- * 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/module.h>
-#include <linux/kernel.h>
-#include <linux/dma-mapping.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-#include <linux/delay.h>
-#include <linux/gfp.h>
-#include <linux/spinlock.h>
-#include <linux/clk.h>
-#include <linux/io.h>
-#include <linux/sched.h>
-#include <linux/platform_data/video-msm_fb.h>
-#include "mddi_hw.h"
-
-#define FLAG_DISABLE_HIBERNATION 0x0001
-#define FLAG_HAVE_CAPS		 0x0002
-#define FLAG_HAS_VSYNC_IRQ	 0x0004
-#define FLAG_HAVE_STATUS	 0x0008
-
-#define CMD_GET_CLIENT_CAP     0x0601
-#define CMD_GET_CLIENT_STATUS  0x0602
-
-union mddi_rev {
-	unsigned char raw[MDDI_REV_BUFFER_SIZE];
-	struct mddi_rev_packet hdr;
-	struct mddi_client_status status;
-	struct mddi_client_caps caps;
-	struct mddi_register_access reg;
-};
-
-struct reg_read_info {
-	struct completion done;
-	uint32_t reg;
-	uint32_t status;
-	uint32_t result;
-};
-
-struct mddi_info {
-	uint16_t flags;
-	uint16_t version;
-	char __iomem *base;
-	int irq;
-	struct clk *clk;
-	struct msm_mddi_client_data client_data;
-
-	/* buffer for rev encap packets */
-	void *rev_data;
-	dma_addr_t rev_addr;
-	struct mddi_llentry *reg_write_data;
-	dma_addr_t reg_write_addr;
-	struct mddi_llentry *reg_read_data;
-	dma_addr_t reg_read_addr;
-	size_t rev_data_curr;
-
-	spinlock_t int_lock;
-	uint32_t int_enable;
-	uint32_t got_int;
-	wait_queue_head_t int_wait;
-
-	struct mutex reg_write_lock;
-	struct mutex reg_read_lock;
-	struct reg_read_info *reg_read;
-
-	struct mddi_client_caps caps;
-	struct mddi_client_status status;
-
-	void (*power_client)(struct msm_mddi_client_data *, int);
-
-	/* client device published to bind us to the
-	 * appropriate mddi_client driver
-	 */
-	char client_name[20];
-
-	struct platform_device client_pdev;
-};
-
-static void mddi_init_rev_encap(struct mddi_info *mddi);
-
-#define mddi_readl(r) readl(mddi->base + (MDDI_##r))
-#define mddi_writel(v, r) writel((v), mddi->base + (MDDI_##r))
-
-void mddi_activate_link(struct msm_mddi_client_data *cdata)
-{
-	struct mddi_info *mddi = container_of(cdata, struct mddi_info,
-					      client_data);
-
-	mddi_writel(MDDI_CMD_LINK_ACTIVE, CMD);
-}
-
-static void mddi_handle_link_list_done(struct mddi_info *mddi)
-{
-}
-
-static void mddi_reset_rev_encap_ptr(struct mddi_info *mddi)
-{
-	printk(KERN_INFO "mddi: resetting rev ptr\n");
-	mddi->rev_data_curr = 0;
-	mddi_writel(mddi->rev_addr, REV_PTR);
-	mddi_writel(mddi->rev_addr, REV_PTR);
-	mddi_writel(MDDI_CMD_FORCE_NEW_REV_PTR, CMD);
-}
-
-static void mddi_handle_rev_data(struct mddi_info *mddi, union mddi_rev *rev)
-{
-	int i;
-	struct reg_read_info *ri;
-
-	if ((rev->hdr.length <= MDDI_REV_BUFFER_SIZE - 2) &&
-	   (rev->hdr.length >= sizeof(struct mddi_rev_packet) - 2)) {
-
-		switch (rev->hdr.type) {
-		case TYPE_CLIENT_CAPS:
-			memcpy(&mddi->caps, &rev->caps,
-			       sizeof(struct mddi_client_caps));
-			mddi->flags |= FLAG_HAVE_CAPS;
-			wake_up(&mddi->int_wait);
-			break;
-		case TYPE_CLIENT_STATUS:
-			memcpy(&mddi->status, &rev->status,
-			       sizeof(struct mddi_client_status));
-			mddi->flags |= FLAG_HAVE_STATUS;
-			wake_up(&mddi->int_wait);
-			break;
-		case TYPE_REGISTER_ACCESS:
-			ri = mddi->reg_read;
-			if (ri == 0) {
-				printk(KERN_INFO "rev: got reg %x = %x without "
-						 " pending read\n",
-				       rev->reg.register_address,
-				       rev->reg.register_data_list);
-				break;
-			}
-			if (ri->reg != rev->reg.register_address) {
-				printk(KERN_INFO "rev: got reg %x = %x for "
-						 "wrong register, expected "
-						 "%x\n",
-				       rev->reg.register_address,
-				       rev->reg.register_data_list, ri->reg);
-				break;
-			}
-			mddi->reg_read = NULL;
-			ri->status = 0;
-			ri->result = rev->reg.register_data_list;
-			complete(&ri->done);
-			break;
-		default:
-			printk(KERN_INFO "rev: unknown reverse packet: "
-					 "len=%04x type=%04x CURR_REV_PTR=%x\n",
-			       rev->hdr.length, rev->hdr.type,
-			       mddi_readl(CURR_REV_PTR));
-			for (i = 0; i < rev->hdr.length + 2; i++) {
-				if ((i % 16) == 0)
-					printk(KERN_INFO "\n");
-				printk(KERN_INFO " %02x", rev->raw[i]);
-			}
-			printk(KERN_INFO "\n");
-			mddi_reset_rev_encap_ptr(mddi);
-		}
-	} else {
-		printk(KERN_INFO "bad rev length, %d, CURR_REV_PTR %x\n",
-		       rev->hdr.length, mddi_readl(CURR_REV_PTR));
-		mddi_reset_rev_encap_ptr(mddi);
-	}
-}
-
-static void mddi_wait_interrupt(struct mddi_info *mddi, uint32_t intmask);
-
-static void mddi_handle_rev_data_avail(struct mddi_info *mddi)
-{
-	uint32_t rev_data_count;
-	uint32_t rev_crc_err_count;
-	struct reg_read_info *ri;
-	size_t prev_offset;
-	uint16_t length;
-
-	union mddi_rev *crev = mddi->rev_data + mddi->rev_data_curr;
-
-	/* clear the interrupt */
-	mddi_writel(MDDI_INT_REV_DATA_AVAIL, INT);
-	rev_data_count = mddi_readl(REV_PKT_CNT);
-	rev_crc_err_count = mddi_readl(REV_CRC_ERR);
-	if (rev_data_count > 1)
-		printk(KERN_INFO "rev_data_count %d\n", rev_data_count);
-
-	if (rev_crc_err_count) {
-		printk(KERN_INFO "rev_crc_err_count %d, INT %x\n",
-		       rev_crc_err_count,  mddi_readl(INT));
-		ri = mddi->reg_read;
-		if (ri == 0) {
-			printk(KERN_INFO "rev: got crc error without pending "
-			       "read\n");
-		} else {
-			mddi->reg_read = NULL;
-			ri->status = -EIO;
-			ri->result = -1;
-			complete(&ri->done);
-		}
-	}
-
-	if (rev_data_count == 0)
-		return;
-
-	prev_offset = mddi->rev_data_curr;
-
-	length = *((uint8_t *)mddi->rev_data + mddi->rev_data_curr);
-	mddi->rev_data_curr++;
-	if (mddi->rev_data_curr == MDDI_REV_BUFFER_SIZE)
-		mddi->rev_data_curr = 0;
-	length += *((uint8_t *)mddi->rev_data + mddi->rev_data_curr) << 8;
-	mddi->rev_data_curr += 1 + length;
-	if (mddi->rev_data_curr >= MDDI_REV_BUFFER_SIZE)
-		mddi->rev_data_curr =
-			mddi->rev_data_curr % MDDI_REV_BUFFER_SIZE;
-
-	if (length > MDDI_REV_BUFFER_SIZE - 2) {
-		printk(KERN_INFO "mddi: rev data length greater than buffer"
-			"size\n");
-		mddi_reset_rev_encap_ptr(mddi);
-		return;
-	}
-
-	if (prev_offset + 2 + length >= MDDI_REV_BUFFER_SIZE) {
-		union mddi_rev tmprev;
-		size_t rem = MDDI_REV_BUFFER_SIZE - prev_offset;
-		memcpy(&tmprev.raw[0], mddi->rev_data + prev_offset, rem);
-		memcpy(&tmprev.raw[rem], mddi->rev_data, 2 + length - rem);
-		mddi_handle_rev_data(mddi, &tmprev);
-	} else {
-		mddi_handle_rev_data(mddi, crev);
-	}
-
-	if (prev_offset < MDDI_REV_BUFFER_SIZE / 2 &&
-	    mddi->rev_data_curr >= MDDI_REV_BUFFER_SIZE / 2) {
-		mddi_writel(mddi->rev_addr, REV_PTR);
-	}
-}
-
-static irqreturn_t mddi_isr(int irq, void *data)
-{
-	struct msm_mddi_client_data *cdata = data;
-	struct mddi_info *mddi = container_of(cdata, struct mddi_info,
-					      client_data);
-	uint32_t active, status;
-
-	spin_lock(&mddi->int_lock);
-
-	active = mddi_readl(INT);
-	status = mddi_readl(STAT);
-
-	mddi_writel(active, INT);
-
-	/* ignore any interrupts we have disabled */
-	active &= mddi->int_enable;
-
-	mddi->got_int |= active;
-	wake_up(&mddi->int_wait);
-
-	if (active & MDDI_INT_PRI_LINK_LIST_DONE) {
-		mddi->int_enable &= (~MDDI_INT_PRI_LINK_LIST_DONE);
-		mddi_handle_link_list_done(mddi);
-	}
-	if (active & MDDI_INT_REV_DATA_AVAIL)
-		mddi_handle_rev_data_avail(mddi);
-
-	if (active & ~MDDI_INT_NEED_CLEAR)
-		mddi->int_enable &= ~(active & ~MDDI_INT_NEED_CLEAR);
-
-	if (active & MDDI_INT_LINK_ACTIVE) {
-		mddi->int_enable &= (~MDDI_INT_LINK_ACTIVE);
-		mddi->int_enable |= MDDI_INT_IN_HIBERNATION;
-	}
-
-	if (active & MDDI_INT_IN_HIBERNATION) {
-		mddi->int_enable &= (~MDDI_INT_IN_HIBERNATION);
-		mddi->int_enable |= MDDI_INT_LINK_ACTIVE;
-	}
-
-	mddi_writel(mddi->int_enable, INTEN);
-	spin_unlock(&mddi->int_lock);
-
-	return IRQ_HANDLED;
-}
-
-static long mddi_wait_interrupt_timeout(struct mddi_info *mddi,
-					uint32_t intmask, int timeout)
-{
-	unsigned long irq_flags;
-
-	spin_lock_irqsave(&mddi->int_lock, irq_flags);
-	mddi->got_int &= ~intmask;
-	mddi->int_enable |= intmask;
-	mddi_writel(mddi->int_enable, INTEN);
-	spin_unlock_irqrestore(&mddi->int_lock, irq_flags);
-	return wait_event_timeout(mddi->int_wait, mddi->got_int & intmask,
-				  timeout);
-}
-
-static void mddi_wait_interrupt(struct mddi_info *mddi, uint32_t intmask)
-{
-	if (mddi_wait_interrupt_timeout(mddi, intmask, HZ/10) == 0)
-		printk(KERN_INFO "mddi_wait_interrupt %d, timeout "
-		       "waiting for %x, INT = %x, STAT = %x gotint = %x\n",
-		       current->pid, intmask, mddi_readl(INT), mddi_readl(STAT),
-		       mddi->got_int);
-}
-
-static void mddi_init_rev_encap(struct mddi_info *mddi)
-{
-	memset(mddi->rev_data, 0xee, MDDI_REV_BUFFER_SIZE);
-	mddi_writel(mddi->rev_addr, REV_PTR);
-	mddi_writel(MDDI_CMD_FORCE_NEW_REV_PTR, CMD);
-	mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
-}
-
-void mddi_set_auto_hibernate(struct msm_mddi_client_data *cdata, int on)
-{
-	struct mddi_info *mddi = container_of(cdata, struct mddi_info,
-					      client_data);
-	mddi_writel(MDDI_CMD_POWERDOWN, CMD);
-	mddi_wait_interrupt(mddi, MDDI_INT_IN_HIBERNATION);
-	mddi_writel(MDDI_CMD_HIBERNATE | !!on, CMD);
-	mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
-}
-
-
-static uint16_t mddi_init_registers(struct mddi_info *mddi)
-{
-	mddi_writel(0x0001, VERSION);
-	mddi_writel(MDDI_HOST_BYTES_PER_SUBFRAME, BPS);
-	mddi_writel(0x0003, SPM); /* subframes per media */
-	mddi_writel(0x0005, TA1_LEN);
-	mddi_writel(MDDI_HOST_TA2_LEN, TA2_LEN);
-	mddi_writel(0x0096, DRIVE_HI);
-	/* 0x32 normal, 0x50 for Toshiba display */
-	mddi_writel(0x0050, DRIVE_LO);
-	mddi_writel(0x003C, DISP_WAKE); /* wakeup counter */
-	mddi_writel(MDDI_HOST_REV_RATE_DIV, REV_RATE_DIV);
-
-	mddi_writel(MDDI_REV_BUFFER_SIZE, REV_SIZE);
-	mddi_writel(MDDI_MAX_REV_PKT_SIZE, REV_ENCAP_SZ);
-
-	/* disable periodic rev encap */
-	mddi_writel(MDDI_CMD_PERIODIC_REV_ENCAP, CMD);
-	mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
-
-	if (mddi_readl(PAD_CTL) == 0) {
-		/* If we are turning on band gap, need to wait 5us before
-		 * turning on the rest of the PAD */
-		mddi_writel(0x08000, PAD_CTL);
-		udelay(5);
-	}
-
-	/* Recommendation from PAD hw team */
-	mddi_writel(0xa850f, PAD_CTL);
-
-
-	/* Need an even number for counts */
-	mddi_writel(0x60006, DRIVER_START_CNT);
-
-	mddi_set_auto_hibernate(&mddi->client_data, 0);
-
-	mddi_writel(MDDI_CMD_DISP_IGNORE, CMD);
-	mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
-
-	mddi_init_rev_encap(mddi);
-	return mddi_readl(CORE_VER) & 0xffff;
-}
-
-static void mddi_suspend(struct msm_mddi_client_data *cdata)
-{
-	struct mddi_info *mddi = container_of(cdata, struct mddi_info,
-					      client_data);
-	/* turn off the client */
-	if (mddi->power_client)
-		mddi->power_client(&mddi->client_data, 0);
-	/* turn off the link */
-	mddi_writel(MDDI_CMD_RESET, CMD);
-	mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
-	/* turn off the clock */
-	clk_disable(mddi->clk);
-}
-
-static void mddi_resume(struct msm_mddi_client_data *cdata)
-{
-	struct mddi_info *mddi = container_of(cdata, struct mddi_info,
-					      client_data);
-	mddi_set_auto_hibernate(&mddi->client_data, 0);
-	/* turn on the client */
-	if (mddi->power_client)
-		mddi->power_client(&mddi->client_data, 1);
-	/* turn on the clock */
-	clk_enable(mddi->clk);
-	/* set up the local registers */
-	mddi->rev_data_curr = 0;
-	mddi_init_registers(mddi);
-	mddi_writel(mddi->int_enable, INTEN);
-	mddi_writel(MDDI_CMD_LINK_ACTIVE, CMD);
-	mddi_writel(MDDI_CMD_SEND_RTD, CMD);
-	mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
-	mddi_set_auto_hibernate(&mddi->client_data, 1);
-}
-
-static int mddi_get_client_caps(struct mddi_info *mddi)
-{
-	int i, j;
-
-	/* clear any stale interrupts */
-	mddi_writel(0xffffffff, INT);
-
-	mddi->int_enable = MDDI_INT_LINK_ACTIVE |
-			   MDDI_INT_IN_HIBERNATION |
-			   MDDI_INT_PRI_LINK_LIST_DONE |
-			   MDDI_INT_REV_DATA_AVAIL |
-			   MDDI_INT_REV_OVERFLOW |
-			   MDDI_INT_REV_OVERWRITE |
-			   MDDI_INT_RTD_FAILURE;
-	mddi_writel(mddi->int_enable, INTEN);
-
-	mddi_writel(MDDI_CMD_LINK_ACTIVE, CMD);
-	mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
-
-	for (j = 0; j < 3; j++) {
-		/* the toshiba vga panel does not respond to get
-		 * caps unless you SEND_RTD, but the first SEND_RTD
-		 * will fail...
-		 */
-		for (i = 0; i < 4; i++) {
-			uint32_t stat;
-
-			mddi_writel(MDDI_CMD_SEND_RTD, CMD);
-			mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
-			stat = mddi_readl(STAT);
-			printk(KERN_INFO "mddi cmd send rtd: int %x, stat %x, "
-					"rtd val %x\n", mddi_readl(INT), stat,
-					mddi_readl(RTD_VAL));
-			if ((stat & MDDI_STAT_RTD_MEAS_FAIL) == 0)
-				break;
-			msleep(1);
-		}
-
-		mddi_writel(CMD_GET_CLIENT_CAP, CMD);
-		mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
-		wait_event_timeout(mddi->int_wait, mddi->flags & FLAG_HAVE_CAPS,
-				   HZ / 100);
-
-		if (mddi->flags & FLAG_HAVE_CAPS)
-			break;
-		printk(KERN_INFO "mddi_init, timeout waiting for caps\n");
-	}
-	return mddi->flags & FLAG_HAVE_CAPS;
-}
-
-/* link must be active when this is called */
-int mddi_check_status(struct mddi_info *mddi)
-{
-	int ret = -1, retry = 3;
-	mutex_lock(&mddi->reg_read_lock);
-	mddi_writel(MDDI_CMD_PERIODIC_REV_ENCAP | 1, CMD);
-	mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
-
-	do {
-		mddi->flags &= ~FLAG_HAVE_STATUS;
-		mddi_writel(CMD_GET_CLIENT_STATUS, CMD);
-		mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
-		wait_event_timeout(mddi->int_wait,
-				   mddi->flags & FLAG_HAVE_STATUS,
-				   HZ / 100);
-
-		if (mddi->flags & FLAG_HAVE_STATUS) {
-			if (mddi->status.crc_error_count)
-				printk(KERN_INFO "mddi status: crc_error "
-					"count: %d\n",
-					mddi->status.crc_error_count);
-			else
-				ret = 0;
-			break;
-		} else
-			printk(KERN_INFO "mddi status: failed to get client "
-				"status\n");
-		mddi_writel(MDDI_CMD_SEND_RTD, CMD);
-		mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
-	} while (--retry);
-
-	mddi_writel(MDDI_CMD_PERIODIC_REV_ENCAP | 0, CMD);
-	mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
-	mutex_unlock(&mddi->reg_read_lock);
-	return ret;
-}
-
-
-void mddi_remote_write(struct msm_mddi_client_data *cdata, uint32_t val,
-		       uint32_t reg)
-{
-	struct mddi_info *mddi = container_of(cdata, struct mddi_info,
-					      client_data);
-	struct mddi_llentry *ll;
-	struct mddi_register_access *ra;
-
-	mutex_lock(&mddi->reg_write_lock);
-
-	ll = mddi->reg_write_data;
-
-	ra = &(ll->u.r);
-	ra->length = 14 + 4;
-	ra->type = TYPE_REGISTER_ACCESS;
-	ra->client_id = 0;
-	ra->read_write_info = MDDI_WRITE | 1;
-	ra->crc16 = 0;
-
-	ra->register_address = reg;
-	ra->register_data_list = val;
-
-	ll->flags = 1;
-	ll->header_count = 14;
-	ll->data_count = 4;
-	ll->data = mddi->reg_write_addr + offsetof(struct mddi_llentry,
-						   u.r.register_data_list);
-	ll->next = 0;
-	ll->reserved = 0;
-
-	mddi_writel(mddi->reg_write_addr, PRI_PTR);
-
-	mddi_wait_interrupt(mddi, MDDI_INT_PRI_LINK_LIST_DONE);
-	mutex_unlock(&mddi->reg_write_lock);
-}
-
-uint32_t mddi_remote_read(struct msm_mddi_client_data *cdata, uint32_t reg)
-{
-	struct mddi_info *mddi = container_of(cdata, struct mddi_info,
-					      client_data);
-	struct mddi_llentry *ll;
-	struct mddi_register_access *ra;
-	struct reg_read_info ri;
-	unsigned s;
-	int retry_count = 2;
-	unsigned long irq_flags;
-
-	mutex_lock(&mddi->reg_read_lock);
-
-	ll = mddi->reg_read_data;
-
-	ra = &(ll->u.r);
-	ra->length = 14;
-	ra->type = TYPE_REGISTER_ACCESS;
-	ra->client_id = 0;
-	ra->read_write_info = MDDI_READ | 1;
-	ra->crc16 = 0;
-
-	ra->register_address = reg;
-
-	ll->flags = 0x11;
-	ll->header_count = 14;
-	ll->data_count = 0;
-	ll->data = 0;
-	ll->next = 0;
-	ll->reserved = 0;
-
-	s = mddi_readl(STAT);
-
-	ri.reg = reg;
-	ri.status = -1;
-
-	do {
-		init_completion(&ri.done);
-		mddi->reg_read = &ri;
-		mddi_writel(mddi->reg_read_addr, PRI_PTR);
-
-		mddi_wait_interrupt(mddi, MDDI_INT_PRI_LINK_LIST_DONE);
-
-		/* Enable Periodic Reverse Encapsulation. */
-		mddi_writel(MDDI_CMD_PERIODIC_REV_ENCAP | 1, CMD);
-		mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
-		if (wait_for_completion_timeout(&ri.done, HZ/10) == 0 &&
-		    !ri.done.done) {
-			printk(KERN_INFO "mddi_remote_read(%x) timeout "
-					 "(%d %d %d)\n",
-			       reg, ri.status, ri.result, ri.done.done);
-			spin_lock_irqsave(&mddi->int_lock, irq_flags);
-			mddi->reg_read = NULL;
-			spin_unlock_irqrestore(&mddi->int_lock, irq_flags);
-			ri.status = -1;
-			ri.result = -1;
-		}
-		if (ri.status == 0)
-			break;
-
-		mddi_writel(MDDI_CMD_SEND_RTD, CMD);
-		mddi_writel(MDDI_CMD_LINK_ACTIVE, CMD);
-		mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
-		printk(KERN_INFO "mddi_remote_read: failed, sent "
-		       "MDDI_CMD_SEND_RTD: int %x, stat %x, rtd val %x "
-		       "curr_rev_ptr %x\n", mddi_readl(INT), mddi_readl(STAT),
-		       mddi_readl(RTD_VAL), mddi_readl(CURR_REV_PTR));
-	} while (retry_count-- > 0);
-	/* Disable Periodic Reverse Encapsulation. */
-	mddi_writel(MDDI_CMD_PERIODIC_REV_ENCAP | 0, CMD);
-	mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
-	mddi->reg_read = NULL;
-	mutex_unlock(&mddi->reg_read_lock);
-	return ri.result;
-}
-
-static struct mddi_info mddi_info[2];
-
-static int mddi_clk_setup(struct platform_device *pdev, struct mddi_info *mddi,
-			  unsigned long clk_rate)
-{
-	int ret;
-
-	/* set up the clocks */
-	mddi->clk = clk_get(&pdev->dev, "mddi_clk");
-	if (IS_ERR(mddi->clk)) {
-		printk(KERN_INFO "mddi: failed to get clock\n");
-		return PTR_ERR(mddi->clk);
-	}
-	ret =  clk_enable(mddi->clk);
-	if (ret)
-		goto fail;
-	ret = clk_set_rate(mddi->clk, clk_rate);
-	if (ret)
-		goto fail;
-	return 0;
-
-fail:
-	clk_put(mddi->clk);
-	return ret;
-}
-
-static int __init mddi_rev_data_setup(struct mddi_info *mddi)
-{
-	void *dma;
-	dma_addr_t dma_addr;
-
-	/* set up dma buffer */
-	dma = dma_alloc_coherent(NULL, 0x1000, &dma_addr, GFP_KERNEL);
-	if (dma == 0)
-		return -ENOMEM;
-	mddi->rev_data = dma;
-	mddi->rev_data_curr = 0;
-	mddi->rev_addr = dma_addr;
-	mddi->reg_write_data = dma + MDDI_REV_BUFFER_SIZE;
-	mddi->reg_write_addr = dma_addr + MDDI_REV_BUFFER_SIZE;
-	mddi->reg_read_data = mddi->reg_write_data + 1;
-	mddi->reg_read_addr = mddi->reg_write_addr +
-			      sizeof(*mddi->reg_write_data);
-	return 0;
-}
-
-static int mddi_probe(struct platform_device *pdev)
-{
-	struct msm_mddi_platform_data *pdata = pdev->dev.platform_data;
-	struct mddi_info *mddi = &mddi_info[pdev->id];
-	struct resource *resource;
-	int ret, i;
-
-	resource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!resource) {
-		printk(KERN_ERR "mddi: no associated mem resource!\n");
-		return -ENOMEM;
-	}
-	mddi->base = ioremap(resource->start, resource_size(resource));
-	if (!mddi->base) {
-		printk(KERN_ERR "mddi: failed to remap base!\n");
-		ret = -EINVAL;
-		goto error_ioremap;
-	}
-	resource = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (!resource) {
-		printk(KERN_ERR "mddi: no associated irq resource!\n");
-		ret = -EINVAL;
-		goto error_get_irq_resource;
-	}
-	mddi->irq = resource->start;
-	printk(KERN_INFO "mddi: init() base=0x%p irq=%d\n", mddi->base,
-	       mddi->irq);
-	mddi->power_client = pdata->power_client;
-
-	mutex_init(&mddi->reg_write_lock);
-	mutex_init(&mddi->reg_read_lock);
-	spin_lock_init(&mddi->int_lock);
-	init_waitqueue_head(&mddi->int_wait);
-
-	ret = mddi_clk_setup(pdev, mddi, pdata->clk_rate);
-	if (ret) {
-		printk(KERN_ERR "mddi: failed to setup clock!\n");
-		goto error_clk_setup;
-	}
-
-	ret = mddi_rev_data_setup(mddi);
-	if (ret) {
-		printk(KERN_ERR "mddi: failed to setup rev data!\n");
-		goto error_rev_data;
-	}
-
-	mddi->int_enable = 0;
-	mddi_writel(mddi->int_enable, INTEN);
-	ret = request_irq(mddi->irq, mddi_isr, 0, "mddi",
-			  &mddi->client_data);
-	if (ret) {
-		printk(KERN_ERR "mddi: failed to request enable irq!\n");
-		goto error_request_irq;
-	}
-
-	/* turn on the mddi client bridge chip */
-	if (mddi->power_client)
-		mddi->power_client(&mddi->client_data, 1);
-
-	/* initialize the mddi registers */
-	mddi_set_auto_hibernate(&mddi->client_data, 0);
-	mddi_writel(MDDI_CMD_RESET, CMD);
-	mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
-	mddi->version = mddi_init_registers(mddi);
-	if (mddi->version < 0x20) {
-		printk(KERN_ERR "mddi: unsupported version 0x%x\n",
-		       mddi->version);
-		ret = -ENODEV;
-		goto error_mddi_version;
-	}
-
-	/* read the capabilities off the client */
-	if (!mddi_get_client_caps(mddi)) {
-		printk(KERN_INFO "mddi: no client found\n");
-		/* power down the panel */
-		mddi_writel(MDDI_CMD_POWERDOWN, CMD);
-		printk(KERN_INFO "mddi powerdown: stat %x\n", mddi_readl(STAT));
-		msleep(100);
-		printk(KERN_INFO "mddi powerdown: stat %x\n", mddi_readl(STAT));
-		return 0;
-	}
-	mddi_set_auto_hibernate(&mddi->client_data, 1);
-
-	if (mddi->caps.Mfr_Name == 0 && mddi->caps.Product_Code == 0)
-		pdata->fixup(&mddi->caps.Mfr_Name, &mddi->caps.Product_Code);
-
-	mddi->client_pdev.id = 0;
-	for (i = 0; i < pdata->num_clients; i++) {
-		if (pdata->client_platform_data[i].product_id ==
-		    (mddi->caps.Mfr_Name << 16 | mddi->caps.Product_Code)) {
-			mddi->client_data.private_client_data =
-				pdata->client_platform_data[i].client_data;
-			mddi->client_pdev.name =
-				pdata->client_platform_data[i].name;
-			mddi->client_pdev.id =
-				pdata->client_platform_data[i].id;
-			/* XXX: possibly set clock */
-			break;
-		}
-	}
-
-	if (i >= pdata->num_clients)
-		mddi->client_pdev.name = "mddi_c_dummy";
-	printk(KERN_INFO "mddi: registering panel %s\n",
-		mddi->client_pdev.name);
-
-	mddi->client_data.suspend = mddi_suspend;
-	mddi->client_data.resume = mddi_resume;
-	mddi->client_data.activate_link = mddi_activate_link;
-	mddi->client_data.remote_write = mddi_remote_write;
-	mddi->client_data.remote_read = mddi_remote_read;
-	mddi->client_data.auto_hibernate = mddi_set_auto_hibernate;
-	mddi->client_data.fb_resource = pdata->fb_resource;
-	if (pdev->id == 0)
-		mddi->client_data.interface_type = MSM_MDDI_PMDH_INTERFACE;
-	else if (pdev->id == 1)
-		mddi->client_data.interface_type = MSM_MDDI_EMDH_INTERFACE;
-	else {
-		printk(KERN_ERR "mddi: can not determine interface %d!\n",
-		       pdev->id);
-		ret = -EINVAL;
-		goto error_mddi_interface;
-	}
-
-	mddi->client_pdev.dev.platform_data = &mddi->client_data;
-	printk(KERN_INFO "mddi: publish: %s\n", mddi->client_name);
-	platform_device_register(&mddi->client_pdev);
-	return 0;
-
-error_mddi_interface:
-error_mddi_version:
-	free_irq(mddi->irq, 0);
-error_request_irq:
-	dma_free_coherent(NULL, 0x1000, mddi->rev_data, mddi->rev_addr);
-error_rev_data:
-error_clk_setup:
-error_get_irq_resource:
-	iounmap(mddi->base);
-error_ioremap:
-
-	printk(KERN_INFO "mddi: mddi_init() failed (%d)\n", ret);
-	return ret;
-}
-
-
-static struct platform_driver mddi_driver = {
-	.probe = mddi_probe,
-	.driver = { .name = "msm_mddi" },
-};
-
-static int __init _mddi_init(void)
-{
-	return platform_driver_register(&mddi_driver);
-}
-
-module_init(_mddi_init);
diff --git a/drivers/video/fbdev/msm/mddi_client_dummy.c b/drivers/video/fbdev/msm/mddi_client_dummy.c
deleted file mode 100644
index cdb8f69a5d88..000000000000
--- a/drivers/video/fbdev/msm/mddi_client_dummy.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/* drivers/video/msm_fb/mddi_client_dummy.c
- *
- * Support for "dummy" mddi client devices which require no
- * special initialization code.
- *
- * Copyright (C) 2007 Google Incorporated
- *
- * 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/device.h>
-#include <linux/slab.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/platform_device.h>
-
-#include <linux/platform_data/video-msm_fb.h>
-
-struct panel_info {
-	struct platform_device pdev;
-	struct msm_panel_data panel_data;
-};
-
-static int mddi_dummy_suspend(struct msm_panel_data *panel_data)
-{
-	return 0;
-}
-
-static int mddi_dummy_resume(struct msm_panel_data *panel_data)
-{
-	return 0;
-}
-
-static int mddi_dummy_blank(struct msm_panel_data *panel_data)
-{
-	return 0;
-}
-
-static int mddi_dummy_unblank(struct msm_panel_data *panel_data)
-{
-	return 0;
-}
-
-static int mddi_dummy_probe(struct platform_device *pdev)
-{
-	struct msm_mddi_client_data *client_data = pdev->dev.platform_data;
-	struct panel_info *panel =
-		devm_kzalloc(&pdev->dev, sizeof(struct panel_info), GFP_KERNEL);
-	if (!panel)
-		return -ENOMEM;
-	platform_set_drvdata(pdev, panel);
-	panel->panel_data.suspend = mddi_dummy_suspend;
-	panel->panel_data.resume = mddi_dummy_resume;
-	panel->panel_data.blank = mddi_dummy_blank;
-	panel->panel_data.unblank = mddi_dummy_unblank;
-	panel->panel_data.caps = MSMFB_CAP_PARTIAL_UPDATES;
-	panel->pdev.name = "msm_panel";
-	panel->pdev.id = pdev->id;
-	platform_device_add_resources(&panel->pdev,
-				      client_data->fb_resource, 1);
-	panel->panel_data.fb_data = client_data->private_client_data;
-	panel->pdev.dev.platform_data = &panel->panel_data;
-	return platform_device_register(&panel->pdev);
-}
-
-static struct platform_driver mddi_client_dummy = {
-	.probe = mddi_dummy_probe,
-	.driver = { .name = "mddi_c_dummy" },
-};
-
-static int __init mddi_client_dummy_init(void)
-{
-	platform_driver_register(&mddi_client_dummy);
-	return 0;
-}
-
-module_init(mddi_client_dummy_init);
-
diff --git a/drivers/video/fbdev/msm/mddi_client_nt35399.c b/drivers/video/fbdev/msm/mddi_client_nt35399.c
deleted file mode 100644
index f96df32e5509..000000000000
--- a/drivers/video/fbdev/msm/mddi_client_nt35399.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/* drivers/video/msm_fb/mddi_client_nt35399.c
- *
- * Support for Novatek NT35399 MDDI client of Sapphire
- *
- * Copyright (C) 2008 HTC Incorporated
- * Author: Solomon Chiu (solomon_chiu@htc.com)
- *
- * 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/module.h>
-#include <linux/kernel.h>
-#include <linux/platform_device.h>
-#include <linux/interrupt.h>
-#include <linux/sched.h>
-#include <linux/gpio.h>
-#include <linux/slab.h>
-#include <linux/platform_data/video-msm_fb.h>
-
-static DECLARE_WAIT_QUEUE_HEAD(nt35399_vsync_wait);
-
-struct panel_info {
-	struct msm_mddi_client_data *client_data;
-	struct platform_device pdev;
-	struct msm_panel_data panel_data;
-	struct msmfb_callback *fb_callback;
-	struct work_struct panel_work;
-	struct workqueue_struct *fb_wq;
-	int nt35399_got_int;
-};
-
-static void
-nt35399_request_vsync(struct msm_panel_data *panel_data,
-		      struct msmfb_callback *callback)
-{
-	struct panel_info *panel = container_of(panel_data, struct panel_info,
-						panel_data);
-	struct msm_mddi_client_data *client_data = panel->client_data;
-
-	panel->fb_callback = callback;
-	if (panel->nt35399_got_int) {
-		panel->nt35399_got_int = 0;
-		client_data->activate_link(client_data); /* clears interrupt */
-	}
-}
-
-static void nt35399_wait_vsync(struct msm_panel_data *panel_data)
-{
-	struct panel_info *panel = container_of(panel_data, struct panel_info,
-						panel_data);
-	struct msm_mddi_client_data *client_data = panel->client_data;
-
-	if (panel->nt35399_got_int) {
-		panel->nt35399_got_int = 0;
-		client_data->activate_link(client_data); /* clears interrupt */
-	}
-
-	if (wait_event_timeout(nt35399_vsync_wait, panel->nt35399_got_int,
-				HZ/2) == 0)
-		printk(KERN_ERR "timeout waiting for VSYNC\n");
-
-	panel->nt35399_got_int = 0;
-	/* interrupt clears when screen dma starts */
-}
-
-static int nt35399_suspend(struct msm_panel_data *panel_data)
-{
-	struct panel_info *panel = container_of(panel_data, struct panel_info,
-						panel_data);
-	struct msm_mddi_client_data *client_data = panel->client_data;
-
-	struct msm_mddi_bridge_platform_data *bridge_data =
-		client_data->private_client_data;
-	int ret;
-
-	ret = bridge_data->uninit(bridge_data, client_data);
-	if (ret) {
-		printk(KERN_INFO "mddi nt35399 client: non zero return from "
-			"uninit\n");
-		return ret;
-	}
-	client_data->suspend(client_data);
-	return 0;
-}
-
-static int nt35399_resume(struct msm_panel_data *panel_data)
-{
-	struct panel_info *panel = container_of(panel_data, struct panel_info,
-						panel_data);
-	struct msm_mddi_client_data *client_data = panel->client_data;
-
-	struct msm_mddi_bridge_platform_data *bridge_data =
-		client_data->private_client_data;
-	int ret;
-
-	client_data->resume(client_data);
-	ret = bridge_data->init(bridge_data, client_data);
-	if (ret)
-		return ret;
-	return 0;
-}
-
-static int nt35399_blank(struct msm_panel_data *panel_data)
-{
-	struct panel_info *panel = container_of(panel_data, struct panel_info,
-						panel_data);
-	struct msm_mddi_client_data *client_data = panel->client_data;
-	struct msm_mddi_bridge_platform_data *bridge_data =
-		client_data->private_client_data;
-
-	return bridge_data->blank(bridge_data, client_data);
-}
-
-static int nt35399_unblank(struct msm_panel_data *panel_data)
-{
-	struct panel_info *panel = container_of(panel_data, struct panel_info,
-						panel_data);
-	struct msm_mddi_client_data *client_data = panel->client_data;
-	struct msm_mddi_bridge_platform_data *bridge_data =
-		client_data->private_client_data;
-
-	return bridge_data->unblank(bridge_data, client_data);
-}
-
-irqreturn_t nt35399_vsync_interrupt(int irq, void *data)
-{
-	struct panel_info *panel = data;
-
-	panel->nt35399_got_int = 1;
-
-	if (panel->fb_callback) {
-		panel->fb_callback->func(panel->fb_callback);
-		panel->fb_callback = NULL;
-	}
-
-	wake_up(&nt35399_vsync_wait);
-
-	return IRQ_HANDLED;
-}
-
-static int setup_vsync(struct panel_info *panel, int init)
-{
-	int ret;
-	int gpio = 97;
-	unsigned int irq;
-
-	if (!init) {
-		ret = 0;
-		goto uninit;
-	}
-	ret = gpio_request_one(gpio, GPIOF_IN, "vsync");
-	if (ret)
-		goto err_request_gpio_failed;
-
-	ret = irq = gpio_to_irq(gpio);
-	if (ret < 0)
-		goto err_get_irq_num_failed;
-
-	ret = request_irq(irq, nt35399_vsync_interrupt, IRQF_TRIGGER_RISING,
-			  "vsync", panel);
-	if (ret)
-		goto err_request_irq_failed;
-
-	printk(KERN_INFO "vsync on gpio %d now %d\n",
-	       gpio, gpio_get_value(gpio));
-	return 0;
-
-uninit:
-	free_irq(gpio_to_irq(gpio), panel->client_data);
-err_request_irq_failed:
-err_get_irq_num_failed:
-	gpio_free(gpio);
-err_request_gpio_failed:
-	return ret;
-}
-
-static int mddi_nt35399_probe(struct platform_device *pdev)
-{
-	struct msm_mddi_client_data *client_data = pdev->dev.platform_data;
-	struct msm_mddi_bridge_platform_data *bridge_data =
-		client_data->private_client_data;
-
-	int ret;
-
-	struct panel_info *panel = devm_kzalloc(&pdev->dev,
-						sizeof(struct panel_info),
-						GFP_KERNEL);
-
-	printk(KERN_DEBUG "%s: enter.\n", __func__);
-
-	if (!panel)
-		return -ENOMEM;
-	platform_set_drvdata(pdev, panel);
-
-	ret = setup_vsync(panel, 1);
-	if (ret) {
-		dev_err(&pdev->dev, "mddi_nt35399_setup_vsync failed\n");
-		return ret;
-	}
-
-	panel->client_data = client_data;
-	panel->panel_data.suspend = nt35399_suspend;
-	panel->panel_data.resume = nt35399_resume;
-	panel->panel_data.wait_vsync = nt35399_wait_vsync;
-	panel->panel_data.request_vsync = nt35399_request_vsync;
-	panel->panel_data.blank = nt35399_blank;
-	panel->panel_data.unblank = nt35399_unblank;
-	panel->panel_data.fb_data = &bridge_data->fb_data;
-	panel->panel_data.caps = 0;
-
-	panel->pdev.name = "msm_panel";
-	panel->pdev.id = pdev->id;
-	panel->pdev.resource = client_data->fb_resource;
-	panel->pdev.num_resources = 1;
-	panel->pdev.dev.platform_data = &panel->panel_data;
-
-	if (bridge_data->init)
-		bridge_data->init(bridge_data, client_data);
-
-	platform_device_register(&panel->pdev);
-
-	return 0;
-}
-
-static int mddi_nt35399_remove(struct platform_device *pdev)
-{
-	struct panel_info *panel = platform_get_drvdata(pdev);
-
-	setup_vsync(panel, 0);
-	return 0;
-}
-
-static struct platform_driver mddi_client_0bda_8a47 = {
-	.probe = mddi_nt35399_probe,
-	.remove = mddi_nt35399_remove,
-	.driver = { .name = "mddi_c_0bda_8a47" },
-};
-
-static int __init mddi_client_nt35399_init(void)
-{
-	return platform_driver_register(&mddi_client_0bda_8a47);
-}
-
-module_init(mddi_client_nt35399_init);
-
diff --git a/drivers/video/fbdev/msm/mddi_client_toshiba.c b/drivers/video/fbdev/msm/mddi_client_toshiba.c
deleted file mode 100644
index 061d7dfebbf3..000000000000
--- a/drivers/video/fbdev/msm/mddi_client_toshiba.c
+++ /dev/null
@@ -1,280 +0,0 @@
-/* drivers/video/msm_fb/mddi_client_toshiba.c
- *
- * Support for Toshiba TC358720XBG mddi client devices which require no
- * special initialization code.
- *
- * Copyright (C) 2007 Google Incorporated
- *
- * 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/module.h>
-#include <linux/kernel.h>
-#include <linux/platform_device.h>
-#include <linux/interrupt.h>
-#include <linux/gpio.h>
-#include <linux/sched.h>
-#include <linux/slab.h>
-#include <linux/platform_data/video-msm_fb.h>
-
-
-#define LCD_CONTROL_BLOCK_BASE 0x110000
-#define CMN         (LCD_CONTROL_BLOCK_BASE|0x10)
-#define INTFLG      (LCD_CONTROL_BLOCK_BASE|0x18)
-#define HCYCLE      (LCD_CONTROL_BLOCK_BASE|0x34)
-#define HDE_START   (LCD_CONTROL_BLOCK_BASE|0x3C)
-#define VPOS        (LCD_CONTROL_BLOCK_BASE|0xC0)
-#define MPLFBUF     (LCD_CONTROL_BLOCK_BASE|0x20)
-#define WAKEUP      (LCD_CONTROL_BLOCK_BASE|0x54)
-#define WSYN_DLY    (LCD_CONTROL_BLOCK_BASE|0x58)
-#define REGENB      (LCD_CONTROL_BLOCK_BASE|0x5C)
-
-#define BASE5 0x150000
-#define BASE6 0x160000
-#define BASE7 0x170000
-
-#define GPIOIEV     (BASE5 + 0x10)
-#define GPIOIE      (BASE5 + 0x14)
-#define GPIORIS     (BASE5 + 0x18)
-#define GPIOMIS     (BASE5 + 0x1C)
-#define GPIOIC      (BASE5 + 0x20)
-
-#define INTMASK     (BASE6 + 0x0C)
-#define INTMASK_VWAKEOUT (1U << 0)
-#define INTMASK_VWAKEOUT_ACTIVE_LOW (1U << 8)
-#define GPIOSEL     (BASE7 + 0x00)
-#define GPIOSEL_VWAKEINT (1U << 0)
-
-static DECLARE_WAIT_QUEUE_HEAD(toshiba_vsync_wait);
-
-struct panel_info {
-	struct msm_mddi_client_data *client_data;
-	struct platform_device pdev;
-	struct msm_panel_data panel_data;
-	struct msmfb_callback *toshiba_callback;
-	int toshiba_got_int;
-};
-
-
-static void toshiba_request_vsync(struct msm_panel_data *panel_data,
-				  struct msmfb_callback *callback)
-{
-	struct panel_info *panel = container_of(panel_data, struct panel_info,
-						panel_data);
-	struct msm_mddi_client_data *client_data = panel->client_data;
-
-	panel->toshiba_callback = callback;
-	if (panel->toshiba_got_int) {
-		panel->toshiba_got_int = 0;
-		client_data->activate_link(client_data);
-	}
-}
-
-static void toshiba_clear_vsync(struct msm_panel_data *panel_data)
-{
-	struct panel_info *panel = container_of(panel_data, struct panel_info,
-						panel_data);
-	struct msm_mddi_client_data *client_data = panel->client_data;
-
-	client_data->activate_link(client_data);
-}
-
-static void toshiba_wait_vsync(struct msm_panel_data *panel_data)
-{
-	struct panel_info *panel = container_of(panel_data, struct panel_info,
-						panel_data);
-	struct msm_mddi_client_data *client_data = panel->client_data;
-
-	if (panel->toshiba_got_int) {
-		panel->toshiba_got_int = 0;
-		client_data->activate_link(client_data); /* clears interrupt */
-	}
-	if (wait_event_timeout(toshiba_vsync_wait, panel->toshiba_got_int,
-				HZ/2) == 0)
-		printk(KERN_ERR "timeout waiting for VSYNC\n");
-	panel->toshiba_got_int = 0;
-	/* interrupt clears when screen dma starts */
-}
-
-static int toshiba_suspend(struct msm_panel_data *panel_data)
-{
-	struct panel_info *panel = container_of(panel_data, struct panel_info,
-						panel_data);
-	struct msm_mddi_client_data *client_data = panel->client_data;
-
-	struct msm_mddi_bridge_platform_data *bridge_data =
-		client_data->private_client_data;
-	int ret;
-
-	ret = bridge_data->uninit(bridge_data, client_data);
-	if (ret) {
-		printk(KERN_INFO "mddi toshiba client: non zero return from "
-			"uninit\n");
-		return ret;
-	}
-	client_data->suspend(client_data);
-	return 0;
-}
-
-static int toshiba_resume(struct msm_panel_data *panel_data)
-{
-	struct panel_info *panel = container_of(panel_data, struct panel_info,
-						panel_data);
-	struct msm_mddi_client_data *client_data = panel->client_data;
-
-	struct msm_mddi_bridge_platform_data *bridge_data =
-		client_data->private_client_data;
-	int ret;
-
-	client_data->resume(client_data);
-	ret = bridge_data->init(bridge_data, client_data);
-	if (ret)
-		return ret;
-	return 0;
-}
-
-static int toshiba_blank(struct msm_panel_data *panel_data)
-{
-	struct panel_info *panel = container_of(panel_data, struct panel_info,
-						panel_data);
-	struct msm_mddi_client_data *client_data = panel->client_data;
-	struct msm_mddi_bridge_platform_data *bridge_data =
-		client_data->private_client_data;
-
-	return bridge_data->blank(bridge_data, client_data);
-}
-
-static int toshiba_unblank(struct msm_panel_data *panel_data)
-{
-	struct panel_info *panel = container_of(panel_data, struct panel_info,
-						panel_data);
-	struct msm_mddi_client_data *client_data = panel->client_data;
-	struct msm_mddi_bridge_platform_data *bridge_data =
-		client_data->private_client_data;
-
-	return bridge_data->unblank(bridge_data, client_data);
-}
-
-irqreturn_t toshiba_vsync_interrupt(int irq, void *data)
-{
-	struct panel_info *panel = data;
-
-	panel->toshiba_got_int = 1;
-	if (panel->toshiba_callback) {
-		panel->toshiba_callback->func(panel->toshiba_callback);
-		panel->toshiba_callback = 0;
-	}
-	wake_up(&toshiba_vsync_wait);
-	return IRQ_HANDLED;
-}
-
-static int setup_vsync(struct panel_info *panel,
-		       int init)
-{
-	int ret;
-	int gpio = 97;
-	unsigned int irq;
-
-	if (!init) {
-		ret = 0;
-		goto uninit;
-	}
-	ret = gpio_request_one(gpio, GPIOF_IN, "vsync");
-	if (ret)
-		goto err_request_gpio_failed;
-
-	ret = irq = gpio_to_irq(gpio);
-	if (ret < 0)
-		goto err_get_irq_num_failed;
-
-	ret = request_irq(irq, toshiba_vsync_interrupt, IRQF_TRIGGER_RISING,
-			  "vsync", panel);
-	if (ret)
-		goto err_request_irq_failed;
-	printk(KERN_INFO "vsync on gpio %d now %d\n",
-	       gpio, gpio_get_value(gpio));
-	return 0;
-
-uninit:
-	free_irq(gpio_to_irq(gpio), panel);
-err_request_irq_failed:
-err_get_irq_num_failed:
-	gpio_free(gpio);
-err_request_gpio_failed:
-	return ret;
-}
-
-static int mddi_toshiba_probe(struct platform_device *pdev)
-{
-	int ret;
-	struct msm_mddi_client_data *client_data = pdev->dev.platform_data;
-	struct msm_mddi_bridge_platform_data *bridge_data =
-		client_data->private_client_data;
-	struct panel_info *panel =
-		kzalloc(sizeof(struct panel_info), GFP_KERNEL);
-	if (!panel)
-		return -ENOMEM;
-	platform_set_drvdata(pdev, panel);
-
-	/* mddi_remote_write(mddi, 0, WAKEUP); */
-	client_data->remote_write(client_data, GPIOSEL_VWAKEINT, GPIOSEL);
-	client_data->remote_write(client_data, INTMASK_VWAKEOUT, INTMASK);
-
-	ret = setup_vsync(panel, 1);
-	if (ret) {
-		dev_err(&pdev->dev, "mddi_bridge_setup_vsync failed\n");
-		return ret;
-	}
-
-	panel->client_data = client_data;
-	panel->panel_data.suspend = toshiba_suspend;
-	panel->panel_data.resume = toshiba_resume;
-	panel->panel_data.wait_vsync = toshiba_wait_vsync;
-	panel->panel_data.request_vsync = toshiba_request_vsync;
-	panel->panel_data.clear_vsync = toshiba_clear_vsync;
-	panel->panel_data.blank = toshiba_blank;
-	panel->panel_data.unblank = toshiba_unblank;
-	panel->panel_data.fb_data =  &bridge_data->fb_data;
-	panel->panel_data.caps = MSMFB_CAP_PARTIAL_UPDATES;
-
-	panel->pdev.name = "msm_panel";
-	panel->pdev.id = pdev->id;
-	panel->pdev.resource = client_data->fb_resource;
-	panel->pdev.num_resources = 1;
-	panel->pdev.dev.platform_data = &panel->panel_data;
-	bridge_data->init(bridge_data, client_data);
-	platform_device_register(&panel->pdev);
-
-	return 0;
-}
-
-static int mddi_toshiba_remove(struct platform_device *pdev)
-{
-	struct panel_info *panel = platform_get_drvdata(pdev);
-
-	setup_vsync(panel, 0);
-	kfree(panel);
-	return 0;
-}
-
-static struct platform_driver mddi_client_d263_0000 = {
-	.probe = mddi_toshiba_probe,
-	.remove = mddi_toshiba_remove,
-	.driver = { .name = "mddi_c_d263_0000" },
-};
-
-static int __init mddi_client_toshiba_init(void)
-{
-	platform_driver_register(&mddi_client_d263_0000);
-	return 0;
-}
-
-module_init(mddi_client_toshiba_init);
-
diff --git a/drivers/video/fbdev/msm/mddi_hw.h b/drivers/video/fbdev/msm/mddi_hw.h
deleted file mode 100644
index 45cc01fc1e7f..000000000000
--- a/drivers/video/fbdev/msm/mddi_hw.h
+++ /dev/null
@@ -1,305 +0,0 @@
-/* drivers/video/msm_fb/mddi_hw.h
- *
- * MSM MDDI Hardware Registers and Structures
- *
- * Copyright (C) 2007 QUALCOMM Incorporated
- * Copyright (C) 2007 Google Incorporated
- *
- * 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.
- */
-
-#ifndef _MDDI_HW_H_
-#define _MDDI_HW_H_
-
-#include <linux/types.h>
-
-#define MDDI_CMD                0x0000
-#define MDDI_VERSION            0x0004
-#define MDDI_PRI_PTR            0x0008
-#define MDDI_SEC_PTR            0x000c
-#define MDDI_BPS                0x0010
-#define MDDI_SPM                0x0014
-#define MDDI_INT                0x0018
-#define MDDI_INTEN              0x001c
-#define MDDI_REV_PTR            0x0020
-#define MDDI_REV_SIZE           0x0024
-#define MDDI_STAT               0x0028
-#define MDDI_REV_RATE_DIV       0x002c
-#define MDDI_REV_CRC_ERR        0x0030
-#define MDDI_TA1_LEN            0x0034
-#define MDDI_TA2_LEN            0x0038
-#define MDDI_TEST_BUS           0x003c
-#define MDDI_TEST               0x0040
-#define MDDI_REV_PKT_CNT        0x0044
-#define MDDI_DRIVE_HI           0x0048
-#define MDDI_DRIVE_LO           0x004c
-#define MDDI_DISP_WAKE          0x0050
-#define MDDI_REV_ENCAP_SZ       0x0054
-#define MDDI_RTD_VAL            0x0058
-#define MDDI_PAD_CTL            0x0068
-#define MDDI_DRIVER_START_CNT   0x006c
-#define MDDI_NEXT_PRI_PTR       0x0070
-#define MDDI_NEXT_SEC_PTR       0x0074
-#define MDDI_MISR_CTL           0x0078
-#define MDDI_MISR_DATA          0x007c
-#define MDDI_SF_CNT             0x0080
-#define MDDI_MF_CNT             0x0084
-#define MDDI_CURR_REV_PTR       0x0088
-#define MDDI_CORE_VER           0x008c
-
-#define MDDI_INT_PRI_PTR_READ       0x0001
-#define MDDI_INT_SEC_PTR_READ       0x0002
-#define MDDI_INT_REV_DATA_AVAIL     0x0004
-#define MDDI_INT_DISP_REQ           0x0008
-#define MDDI_INT_PRI_UNDERFLOW      0x0010
-#define MDDI_INT_SEC_UNDERFLOW      0x0020
-#define MDDI_INT_REV_OVERFLOW       0x0040
-#define MDDI_INT_CRC_ERROR          0x0080
-#define MDDI_INT_MDDI_IN            0x0100
-#define MDDI_INT_PRI_OVERWRITE      0x0200
-#define MDDI_INT_SEC_OVERWRITE      0x0400
-#define MDDI_INT_REV_OVERWRITE      0x0800
-#define MDDI_INT_DMA_FAILURE        0x1000
-#define MDDI_INT_LINK_ACTIVE        0x2000
-#define MDDI_INT_IN_HIBERNATION     0x4000
-#define MDDI_INT_PRI_LINK_LIST_DONE 0x8000
-#define MDDI_INT_SEC_LINK_LIST_DONE 0x10000
-#define MDDI_INT_NO_CMD_PKTS_PEND   0x20000
-#define MDDI_INT_RTD_FAILURE        0x40000
-#define MDDI_INT_REV_PKT_RECEIVED   0x80000
-#define MDDI_INT_REV_PKTS_AVAIL     0x100000
-
-#define MDDI_INT_NEED_CLEAR ( \
-	MDDI_INT_REV_DATA_AVAIL | \
-	MDDI_INT_PRI_UNDERFLOW | \
-	MDDI_INT_SEC_UNDERFLOW | \
-	MDDI_INT_REV_OVERFLOW | \
-	MDDI_INT_CRC_ERROR | \
-	MDDI_INT_REV_PKT_RECEIVED)
-
-
-#define MDDI_STAT_LINK_ACTIVE        0x0001
-#define MDDI_STAT_NEW_REV_PTR        0x0002
-#define MDDI_STAT_NEW_PRI_PTR        0x0004
-#define MDDI_STAT_NEW_SEC_PTR        0x0008
-#define MDDI_STAT_IN_HIBERNATION     0x0010
-#define MDDI_STAT_PRI_LINK_LIST_DONE 0x0020
-#define MDDI_STAT_SEC_LINK_LIST_DONE 0x0040
-#define MDDI_STAT_PENDING_TIMING_PKT 0x0080
-#define MDDI_STAT_PENDING_REV_ENCAP  0x0100
-#define MDDI_STAT_PENDING_POWERDOWN  0x0200
-#define MDDI_STAT_RTD_MEAS_FAIL      0x0800
-#define MDDI_STAT_CLIENT_WAKEUP_REQ  0x1000
-
-
-#define MDDI_CMD_POWERDOWN           0x0100
-#define MDDI_CMD_POWERUP             0x0200
-#define MDDI_CMD_HIBERNATE           0x0300
-#define MDDI_CMD_RESET               0x0400
-#define MDDI_CMD_DISP_IGNORE         0x0501
-#define MDDI_CMD_DISP_LISTEN         0x0500
-#define MDDI_CMD_SEND_REV_ENCAP      0x0600
-#define MDDI_CMD_GET_CLIENT_CAP      0x0601
-#define MDDI_CMD_GET_CLIENT_STATUS   0x0602
-#define MDDI_CMD_SEND_RTD            0x0700
-#define MDDI_CMD_LINK_ACTIVE         0x0900
-#define MDDI_CMD_PERIODIC_REV_ENCAP  0x0A00
-#define MDDI_CMD_FORCE_NEW_REV_PTR   0x0C00
-
-
-
-#define MDDI_VIDEO_REV_PKT_SIZE              0x40
-#define MDDI_CLIENT_CAPABILITY_REV_PKT_SIZE  0x60
-#define MDDI_MAX_REV_PKT_SIZE                0x60
-
-/* #define MDDI_REV_BUFFER_SIZE 128 */
-#define MDDI_REV_BUFFER_SIZE (MDDI_MAX_REV_PKT_SIZE * 4)
-
-/* MDP sends 256 pixel packets, so lower value hibernates more without
- * significantly increasing latency of waiting for next subframe */
-#define MDDI_HOST_BYTES_PER_SUBFRAME  0x3C00
-#define MDDI_HOST_TA2_LEN       0x000c
-#define MDDI_HOST_REV_RATE_DIV  0x0002
-
-
-struct __attribute__((packed)) mddi_rev_packet {
-	uint16_t length;
-	uint16_t type;
-	uint16_t client_id;
-};
-
-struct __attribute__((packed)) mddi_client_status {
-	uint16_t length;
-	uint16_t type;
-	uint16_t client_id;
-	uint16_t reverse_link_request;  /* bytes needed in rev encap message */
-	uint8_t  crc_error_count;
-	uint8_t  capability_change;
-	uint16_t graphics_busy_flags;
-	uint16_t crc16;
-};
-
-struct __attribute__((packed)) mddi_client_caps {
-	uint16_t length; /* length, exclusive of this field */
-	uint16_t type; /* 66 */
-	uint16_t client_id;
-
-	uint16_t Protocol_Version;
-	uint16_t Minimum_Protocol_Version;
-	uint16_t Data_Rate_Capability;
-	uint8_t  Interface_Type_Capability;
-	uint8_t  Number_of_Alt_Displays;
-	uint16_t PostCal_Data_Rate;
-	uint16_t Bitmap_Width;
-	uint16_t Bitmap_Height;
-	uint16_t Display_Window_Width;
-	uint16_t Display_Window_Height;
-	uint32_t Color_Map_Size;
-	uint16_t Color_Map_RGB_Width;
-	uint16_t RGB_Capability;
-	uint8_t  Monochrome_Capability;
-	uint8_t  Reserved_1;
-	uint16_t Y_Cb_Cr_Capability;
-	uint16_t Bayer_Capability;
-	uint16_t Alpha_Cursor_Image_Planes;
-	uint32_t Client_Feature_Capability_Indicators;
-	uint8_t  Maximum_Video_Frame_Rate_Capability;
-	uint8_t  Minimum_Video_Frame_Rate_Capability;
-	uint16_t Minimum_Sub_frame_Rate;
-	uint16_t Audio_Buffer_Depth;
-	uint16_t Audio_Channel_Capability;
-	uint16_t Audio_Sample_Rate_Capability;
-	uint8_t  Audio_Sample_Resolution;
-	uint8_t  Mic_Audio_Sample_Resolution;
-	uint16_t Mic_Sample_Rate_Capability;
-	uint8_t  Keyboard_Data_Format;
-	uint8_t  pointing_device_data_format;
-	uint16_t content_protection_type;
-	uint16_t Mfr_Name;
-	uint16_t Product_Code;
-	uint16_t Reserved_3;
-	uint32_t Serial_Number;
-	uint8_t  Week_of_Manufacture;
-	uint8_t  Year_of_Manufacture;
-
-	uint16_t crc16;
-} mddi_client_capability_type;
-
-
-struct __attribute__((packed)) mddi_video_stream {
-	uint16_t length;
-	uint16_t type; /* 16 */
-	uint16_t client_id; /* 0 */
-
-	uint16_t video_data_format_descriptor;
-/* format of each pixel in the Pixel Data in the present stream in the
- * present packet.
- * If bits [15:13] = 000 monochrome
- * If bits [15:13] = 001 color pixels (palette).
- * If bits [15:13] = 010 color pixels in raw RGB
- * If bits [15:13] = 011 data in 4:2:2 Y Cb Cr format
- * If bits [15:13] = 100 Bayer pixels
- */
-
-	uint16_t pixel_data_attributes;
-/* interpreted as follows:
- * Bits [1:0] = 11  pixel data is displayed to both eyes
- * Bits [1:0] = 10  pixel data is routed to the left eye only.
- * Bits [1:0] = 01  pixel data is routed to the right eye only.
- * Bits [1:0] = 00  pixel data is routed to the alternate display.
- * Bit 2 is 0  Pixel Data is in the standard progressive format.
- * Bit 2 is 1  Pixel Data is in interlace format.
- * Bit 3 is 0  Pixel Data is in the standard progressive format.
- * Bit 3 is 1  Pixel Data is in alternate pixel format.
- * Bit 4 is 0  Pixel Data is to or from the display frame buffer.
- * Bit 4 is 1  Pixel Data is to or from the camera.
- * Bit 5 is 0  pixel data contains the next consecutive row of pixels.
- * Bit 5 is 1  X Left Edge, Y Top Edge, X Right Edge, Y Bottom Edge,
- *             X Start, and Y Start parameters are not defined and
- *             shall be ignored by the client.
- * Bits [7:6] = 01  Pixel data is written to the offline image buffer.
- * Bits [7:6] = 00  Pixel data is written to the buffer to refresh display.
- * Bits [7:6] = 11  Pixel data is written to all image buffers.
- * Bits [7:6] = 10  Invalid. Reserved for future use.
- * Bits 8 through 11 alternate display number.
- * Bits 12 through 14 are reserved for future use and shall be set to zero.
- * Bit 15 is 1 the row of pixels is the last row of pixels in a frame.
- */
-
-	uint16_t x_left_edge;
-	uint16_t y_top_edge;
-	/* X,Y coordinate of the top left edge of the screen window */
-
-	uint16_t x_right_edge;
-	uint16_t y_bottom_edge;
-	/* X,Y coordinate of the bottom right edge of the window being
-	 * updated. */
-
-	uint16_t x_start;
-	uint16_t y_start;
-	/* (X Start, Y Start) is the first pixel in the Pixel Data field
-	 * below. */
-
-	uint16_t pixel_count;
-	/* number of pixels in the Pixel Data field below. */
-
-	uint16_t parameter_CRC;
-	/* 16-bit CRC of all bytes from the Packet Length to the Pixel Count. */
-
-	uint16_t reserved;
-	/* 16-bit variable to make structure align on 4 byte boundary */
-};
-
-#define TYPE_VIDEO_STREAM      16
-#define TYPE_CLIENT_CAPS       66
-#define TYPE_REGISTER_ACCESS   146
-#define TYPE_CLIENT_STATUS     70
-
-struct __attribute__((packed)) mddi_register_access {
-	uint16_t length;
-	uint16_t type; /* 146 */
-	uint16_t client_id;
-
-	uint16_t read_write_info;
-	/* Bits 13:0  a 14-bit unsigned integer that specifies the number of
-	 *            32-bit Register Data List items to be transferred in the
-	 *            Register Data List field.
-	 * Bits[15:14] = 00  Write to register(s);
-	 * Bits[15:14] = 10  Read from register(s);
-	 * Bits[15:14] = 11  Response to a Read.
-	 * Bits[15:14] = 01  this value is reserved for future use. */
-#define MDDI_WRITE     (0 << 14)
-#define MDDI_READ      (2 << 14)
-#define MDDI_READ_RESP (3 << 14)
-
-	uint32_t register_address;
-	/* the register address that is to be written to or read from. */
-
-	uint16_t crc16;
-
-	uint32_t register_data_list;
-	/* list of 4-byte register data values for/from client registers */
-};
-
-struct __attribute__((packed)) mddi_llentry {
-	uint16_t flags;
-	uint16_t header_count;
-	uint16_t data_count;
-	dma_addr_t data; /* 32 bit */
-	struct mddi_llentry *next;
-	uint16_t reserved;
-	union {
-		struct mddi_video_stream v;
-		struct mddi_register_access r;
-		uint32_t _[12];
-	} u;
-};
-
-#endif
diff --git a/drivers/video/fbdev/msm/mdp.c b/drivers/video/fbdev/msm/mdp.c
deleted file mode 100644
index 113c7876c855..000000000000
--- a/drivers/video/fbdev/msm/mdp.c
+++ /dev/null
@@ -1,520 +0,0 @@
-/* drivers/video/msm_fb/mdp.c
- *
- * MSM MDP Interface (used by framebuffer core)
- *
- * Copyright (C) 2007 QUALCOMM Incorporated
- * Copyright (C) 2007 Google Incorporated
- *
- * 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/kernel.h>
-#include <linux/fb.h>
-#include <linux/msm_mdp.h>
-#include <linux/interrupt.h>
-#include <linux/wait.h>
-#include <linux/clk.h>
-#include <linux/file.h>
-#include <linux/major.h>
-#include <linux/slab.h>
-
-#include <linux/platform_data/video-msm_fb.h>
-#include <linux/platform_device.h>
-#include <linux/export.h>
-
-#include "mdp_hw.h"
-
-struct class *mdp_class;
-
-#define MDP_CMD_DEBUG_ACCESS_BASE (0x10000)
-
-static uint16_t mdp_default_ccs[] = {
-	0x254, 0x000, 0x331, 0x254, 0xF38, 0xE61, 0x254, 0x409, 0x000,
-	0x010, 0x080, 0x080
-};
-
-static DECLARE_WAIT_QUEUE_HEAD(mdp_dma2_waitqueue);
-static DECLARE_WAIT_QUEUE_HEAD(mdp_ppp_waitqueue);
-static struct msmfb_callback *dma_callback;
-static struct clk *clk;
-static unsigned int mdp_irq_mask;
-static DEFINE_SPINLOCK(mdp_lock);
-DEFINE_MUTEX(mdp_mutex);
-
-static int enable_mdp_irq(struct mdp_info *mdp, uint32_t mask)
-{
-	unsigned long irq_flags;
-	int ret = 0;
-
-	BUG_ON(!mask);
-
-	spin_lock_irqsave(&mdp_lock, irq_flags);
-	/* if the mask bits are already set return an error, this interrupt
-	 * is already enabled */
-	if (mdp_irq_mask & mask) {
-		printk(KERN_ERR "mdp irq already on already on %x %x\n",
-		       mdp_irq_mask, mask);
-		ret = -1;
-	}
-	/* if the mdp irq is not already enabled enable it */
-	if (!mdp_irq_mask) {
-		if (clk)
-			clk_enable(clk);
-		enable_irq(mdp->irq);
-	}
-
-	/* update the irq mask to reflect the fact that the interrupt is
-	 * enabled */
-	mdp_irq_mask |= mask;
-	spin_unlock_irqrestore(&mdp_lock, irq_flags);
-	return ret;
-}
-
-static int locked_disable_mdp_irq(struct mdp_info *mdp, uint32_t mask)
-{
-	/* this interrupt is already disabled! */
-	if (!(mdp_irq_mask & mask)) {
-		printk(KERN_ERR "mdp irq already off %x %x\n",
-		       mdp_irq_mask, mask);
-		return -1;
-	}
-	/* update the irq mask to reflect the fact that the interrupt is
-	 * disabled */
-	mdp_irq_mask &= ~(mask);
-	/* if no one is waiting on the interrupt, disable it */
-	if (!mdp_irq_mask) {
-		disable_irq_nosync(mdp->irq);
-		if (clk)
-			clk_disable(clk);
-	}
-	return 0;
-}
-
-static int disable_mdp_irq(struct mdp_info *mdp, uint32_t mask)
-{
-	unsigned long irq_flags;
-	int ret;
-
-	spin_lock_irqsave(&mdp_lock, irq_flags);
-	ret = locked_disable_mdp_irq(mdp, mask);
-	spin_unlock_irqrestore(&mdp_lock, irq_flags);
-	return ret;
-}
-
-static irqreturn_t mdp_isr(int irq, void *data)
-{
-	uint32_t status;
-	unsigned long irq_flags;
-	struct mdp_info *mdp = data;
-
-	spin_lock_irqsave(&mdp_lock, irq_flags);
-
-	status = mdp_readl(mdp, MDP_INTR_STATUS);
-	mdp_writel(mdp, status, MDP_INTR_CLEAR);
-
-	status &= mdp_irq_mask;
-	if (status & DL0_DMA2_TERM_DONE) {
-		if (dma_callback) {
-			dma_callback->func(dma_callback);
-			dma_callback = NULL;
-		}
-		wake_up(&mdp_dma2_waitqueue);
-	}
-
-	if (status & DL0_ROI_DONE)
-		wake_up(&mdp_ppp_waitqueue);
-
-	if (status)
-		locked_disable_mdp_irq(mdp, status);
-
-	spin_unlock_irqrestore(&mdp_lock, irq_flags);
-	return IRQ_HANDLED;
-}
-
-static uint32_t mdp_check_mask(uint32_t mask)
-{
-	uint32_t ret;
-	unsigned long irq_flags;
-
-	spin_lock_irqsave(&mdp_lock, irq_flags);
-	ret = mdp_irq_mask & mask;
-	spin_unlock_irqrestore(&mdp_lock, irq_flags);
-	return ret;
-}
-
-static int mdp_wait(struct mdp_info *mdp, uint32_t mask, wait_queue_head_t *wq)
-{
-	int ret = 0;
-	unsigned long irq_flags;
-
-	wait_event_timeout(*wq, !mdp_check_mask(mask), HZ);
-
-	spin_lock_irqsave(&mdp_lock, irq_flags);
-	if (mdp_irq_mask & mask) {
-		locked_disable_mdp_irq(mdp, mask);
-		printk(KERN_WARNING "timeout waiting for mdp to complete %x\n",
-		       mask);
-		ret = -ETIMEDOUT;
-	}
-	spin_unlock_irqrestore(&mdp_lock, irq_flags);
-
-	return ret;
-}
-
-void mdp_dma_wait(struct mdp_device *mdp_dev)
-{
-#define MDP_MAX_TIMEOUTS 20
-	static int timeout_count;
-	struct mdp_info *mdp = container_of(mdp_dev, struct mdp_info, mdp_dev);
-
-	if (mdp_wait(mdp, DL0_DMA2_TERM_DONE, &mdp_dma2_waitqueue) == -ETIMEDOUT)
-		timeout_count++;
-	else
-		timeout_count = 0;
-
-	if (timeout_count > MDP_MAX_TIMEOUTS) {
-		printk(KERN_ERR "mdp: dma failed %d times, somethings wrong!\n",
-		       MDP_MAX_TIMEOUTS);
-		BUG();
-	}
-}
-
-static int mdp_ppp_wait(struct mdp_info *mdp)
-{
-	return mdp_wait(mdp, DL0_ROI_DONE, &mdp_ppp_waitqueue);
-}
-
-void mdp_dma_to_mddi(struct mdp_info *mdp, uint32_t addr, uint32_t stride,
-		     uint32_t width, uint32_t height, uint32_t x, uint32_t y,
-		     struct msmfb_callback *callback)
-{
-	uint32_t dma2_cfg;
-	uint16_t ld_param = 0; /* 0=PRIM, 1=SECD, 2=EXT */
-
-	if (enable_mdp_irq(mdp, DL0_DMA2_TERM_DONE)) {
-		printk(KERN_ERR "mdp_dma_to_mddi: busy\n");
-		return;
-	}
-
-	dma_callback = callback;
-
-	dma2_cfg = DMA_PACK_TIGHT |
-		DMA_PACK_ALIGN_LSB |
-		DMA_PACK_PATTERN_RGB |
-		DMA_OUT_SEL_AHB |
-		DMA_IBUF_NONCONTIGUOUS;
-
-	dma2_cfg |= DMA_IBUF_FORMAT_RGB565;
-
-	dma2_cfg |= DMA_OUT_SEL_MDDI;
-
-	dma2_cfg |= DMA_MDDI_DMAOUT_LCD_SEL_PRIMARY;
-
-	dma2_cfg |= DMA_DITHER_EN;
-
-	/* setup size, address, and stride */
-	mdp_writel(mdp, (height << 16) | (width),
-		   MDP_CMD_DEBUG_ACCESS_BASE + 0x0184);
-	mdp_writel(mdp, addr, MDP_CMD_DEBUG_ACCESS_BASE + 0x0188);
-	mdp_writel(mdp, stride, MDP_CMD_DEBUG_ACCESS_BASE + 0x018C);
-
-	/* 666 18BPP */
-	dma2_cfg |= DMA_DSTC0G_6BITS | DMA_DSTC1B_6BITS | DMA_DSTC2R_6BITS;
-
-	/* set y & x offset and MDDI transaction parameters */
-	mdp_writel(mdp, (y << 16) | (x), MDP_CMD_DEBUG_ACCESS_BASE + 0x0194);
-	mdp_writel(mdp, ld_param, MDP_CMD_DEBUG_ACCESS_BASE + 0x01a0);
-	mdp_writel(mdp, (MDDI_VDO_PACKET_DESC << 16) | MDDI_VDO_PACKET_PRIM,
-		   MDP_CMD_DEBUG_ACCESS_BASE + 0x01a4);
-
-	mdp_writel(mdp, dma2_cfg, MDP_CMD_DEBUG_ACCESS_BASE + 0x0180);
-
-	/* start DMA2 */
-	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x0044);
-}
-
-void mdp_dma(struct mdp_device *mdp_dev, uint32_t addr, uint32_t stride,
-	     uint32_t width, uint32_t height, uint32_t x, uint32_t y,
-	     struct msmfb_callback *callback, int interface)
-{
-	struct mdp_info *mdp = container_of(mdp_dev, struct mdp_info, mdp_dev);
-
-	if (interface == MSM_MDDI_PMDH_INTERFACE) {
-		mdp_dma_to_mddi(mdp, addr, stride, width, height, x, y,
-				callback);
-	}
-}
-
-int get_img(struct mdp_img *img, struct fb_info *info,
-	    unsigned long *start, unsigned long *len,
-	    struct file **filep)
-{
-	int ret = 0;
-	struct fd f = fdget(img->memory_id);
-	if (f.file == NULL)
-		return -1;
-
-	if (MAJOR(file_inode(f.file)->i_rdev) == FB_MAJOR) {
-		*start = info->fix.smem_start;
-		*len = info->fix.smem_len;
-	} else
-		ret = -1;
-	fdput(f);
-
-	return ret;
-}
-
-void put_img(struct file *src_file, struct file *dst_file)
-{
-}
-
-int mdp_blit(struct mdp_device *mdp_dev, struct fb_info *fb,
-	     struct mdp_blit_req *req)
-{
-	int ret;
-	unsigned long src_start = 0, src_len = 0, dst_start = 0, dst_len = 0;
-	struct mdp_info *mdp = container_of(mdp_dev, struct mdp_info, mdp_dev);
-	struct file *src_file = 0, *dst_file = 0;
-
-	/* WORKAROUND FOR HARDWARE BUG IN BG TILE FETCH */
-	if (unlikely(req->src_rect.h == 0 ||
-		     req->src_rect.w == 0)) {
-		printk(KERN_ERR "mpd_ppp: src img of zero size!\n");
-		return -EINVAL;
-	}
-	if (unlikely(req->dst_rect.h == 0 ||
-		     req->dst_rect.w == 0))
-		return -EINVAL;
-
-	/* do this first so that if this fails, the caller can always
-	 * safely call put_img */
-	if (unlikely(get_img(&req->src, fb, &src_start, &src_len, &src_file))) {
-		printk(KERN_ERR "mpd_ppp: could not retrieve src image from "
-				"memory\n");
-		return -EINVAL;
-	}
-
-	if (unlikely(get_img(&req->dst, fb, &dst_start, &dst_len, &dst_file))) {
-		printk(KERN_ERR "mpd_ppp: could not retrieve dst image from "
-				"memory\n");
-		return -EINVAL;
-	}
-	mutex_lock(&mdp_mutex);
-
-	/* transp_masking unimplemented */
-	req->transp_mask = MDP_TRANSP_NOP;
-	if (unlikely((req->transp_mask != MDP_TRANSP_NOP ||
-		      req->alpha != MDP_ALPHA_NOP ||
-		      HAS_ALPHA(req->src.format)) &&
-		     (req->flags & MDP_ROT_90 &&
-		      req->dst_rect.w <= 16 && req->dst_rect.h >= 16))) {
-		int i;
-		unsigned int tiles = req->dst_rect.h / 16;
-		unsigned int remainder = req->dst_rect.h % 16;
-		req->src_rect.w = 16*req->src_rect.w / req->dst_rect.h;
-		req->dst_rect.h = 16;
-		for (i = 0; i < tiles; i++) {
-			enable_mdp_irq(mdp, DL0_ROI_DONE);
-			ret = mdp_ppp_blit(mdp, req, src_file, src_start,
-					   src_len, dst_file, dst_start,
-					   dst_len);
-			if (ret)
-				goto err_bad_blit;
-			ret = mdp_ppp_wait(mdp);
-			if (ret)
-				goto err_wait_failed;
-			req->dst_rect.y += 16;
-			req->src_rect.x += req->src_rect.w;
-		}
-		if (!remainder)
-			goto end;
-		req->src_rect.w = remainder*req->src_rect.w / req->dst_rect.h;
-		req->dst_rect.h = remainder;
-	}
-	enable_mdp_irq(mdp, DL0_ROI_DONE);
-	ret = mdp_ppp_blit(mdp, req, src_file, src_start, src_len, dst_file,
-			   dst_start,
-			   dst_len);
-	if (ret)
-		goto err_bad_blit;
-	ret = mdp_ppp_wait(mdp);
-	if (ret)
-		goto err_wait_failed;
-end:
-	put_img(src_file, dst_file);
-	mutex_unlock(&mdp_mutex);
-	return 0;
-err_bad_blit:
-	disable_mdp_irq(mdp, DL0_ROI_DONE);
-err_wait_failed:
-	put_img(src_file, dst_file);
-	mutex_unlock(&mdp_mutex);
-	return ret;
-}
-
-void mdp_set_grp_disp(struct mdp_device *mdp_dev, unsigned disp_id)
-{
-	struct mdp_info *mdp = container_of(mdp_dev, struct mdp_info, mdp_dev);
-
-	disp_id &= 0xf;
-	mdp_writel(mdp, disp_id, MDP_FULL_BYPASS_WORD43);
-}
-
-int register_mdp_client(struct class_interface *cint)
-{
-	if (!mdp_class) {
-		pr_err("mdp: no mdp_class when registering mdp client\n");
-		return -ENODEV;
-	}
-	cint->class = mdp_class;
-	return class_interface_register(cint);
-}
-
-#include "mdp_csc_table.h"
-#include "mdp_scale_tables.h"
-
-int mdp_probe(struct platform_device *pdev)
-{
-	struct resource *resource;
-	int ret;
-	int n;
-	struct mdp_info *mdp;
-
-	resource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!resource) {
-		pr_err("mdp: can not get mdp mem resource!\n");
-		return -ENOMEM;
-	}
-
-	mdp = kzalloc(sizeof(struct mdp_info), GFP_KERNEL);
-	if (!mdp)
-		return -ENOMEM;
-
-	mdp->irq = platform_get_irq(pdev, 0);
-	if (mdp->irq < 0) {
-		pr_err("mdp: can not get mdp irq\n");
-		ret = mdp->irq;
-		goto error_get_irq;
-	}
-
-	mdp->base = ioremap(resource->start, resource_size(resource));
-	if (mdp->base == 0) {
-		printk(KERN_ERR "msmfb: cannot allocate mdp regs!\n");
-		ret = -ENOMEM;
-		goto error_ioremap;
-	}
-
-	mdp->mdp_dev.dma = mdp_dma;
-	mdp->mdp_dev.dma_wait = mdp_dma_wait;
-	mdp->mdp_dev.blit = mdp_blit;
-	mdp->mdp_dev.set_grp_disp = mdp_set_grp_disp;
-
-	clk = clk_get(&pdev->dev, "mdp_clk");
-	if (IS_ERR(clk)) {
-		printk(KERN_INFO "mdp: failed to get mdp clk");
-		ret = PTR_ERR(clk);
-		goto error_get_clk;
-	}
-
-	ret = request_irq(mdp->irq, mdp_isr, 0, "msm_mdp", mdp);
-	if (ret)
-		goto error_request_irq;
-	disable_irq(mdp->irq);
-	mdp_irq_mask = 0;
-
-	/* debug interface write access */
-	mdp_writel(mdp, 1, 0x60);
-
-	mdp_writel(mdp, MDP_ANY_INTR_MASK, MDP_INTR_ENABLE);
-	mdp_writel(mdp, 1, MDP_EBI2_PORTMAP_MODE);
-
-	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x01f8);
-	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x01fc);
-
-	for (n = 0; n < ARRAY_SIZE(csc_table); n++)
-		mdp_writel(mdp, csc_table[n].val, csc_table[n].reg);
-
-	/* clear up unused fg/main registers */
-	/* comp.plane 2&3 ystride */
-	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x0120);
-
-	/* unpacked pattern */
-	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x012c);
-	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x0130);
-	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x0134);
-	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x0158);
-	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x015c);
-	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x0160);
-	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x0170);
-	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x0174);
-	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x017c);
-
-	/* comp.plane 2 & 3 */
-	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x0114);
-	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x0118);
-
-	/* clear unused bg registers */
-	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x01c8);
-	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x01d0);
-	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x01dc);
-	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x01e0);
-	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x01e4);
-
-	for (n = 0; n < ARRAY_SIZE(mdp_upscale_table); n++)
-		mdp_writel(mdp, mdp_upscale_table[n].val,
-		       mdp_upscale_table[n].reg);
-
-	for (n = 0; n < 9; n++)
-		mdp_writel(mdp, mdp_default_ccs[n], 0x40440 + 4 * n);
-	mdp_writel(mdp, mdp_default_ccs[9], 0x40500 + 4 * 0);
-	mdp_writel(mdp, mdp_default_ccs[10], 0x40500 + 4 * 0);
-	mdp_writel(mdp, mdp_default_ccs[11], 0x40500 + 4 * 0);
-
-	/* register mdp device */
-	mdp->mdp_dev.dev.parent = &pdev->dev;
-	mdp->mdp_dev.dev.class = mdp_class;
-	dev_set_name(&mdp->mdp_dev.dev, "mdp%d", pdev->id);
-
-	/* if you can remove the platform device you'd have to implement
-	 * this:
-	mdp_dev.release = mdp_class; */
-
-	ret = device_register(&mdp->mdp_dev.dev);
-	if (ret)
-		goto error_device_register;
-	return 0;
-
-error_device_register:
-	free_irq(mdp->irq, mdp);
-error_request_irq:
-error_get_clk:
-	iounmap(mdp->base);
-error_get_irq:
-error_ioremap:
-	kfree(mdp);
-	return ret;
-}
-
-static struct platform_driver msm_mdp_driver = {
-	.probe = mdp_probe,
-	.driver = {.name = "msm_mdp"},
-};
-
-static int __init mdp_init(void)
-{
-	mdp_class = class_create(THIS_MODULE, "msm_mdp");
-	if (IS_ERR(mdp_class)) {
-		printk(KERN_ERR "Error creating mdp class\n");
-		return PTR_ERR(mdp_class);
-	}
-	return platform_driver_register(&msm_mdp_driver);
-}
-
-subsys_initcall(mdp_init);
diff --git a/drivers/video/fbdev/msm/mdp_csc_table.h b/drivers/video/fbdev/msm/mdp_csc_table.h
deleted file mode 100644
index d1cde30ead52..000000000000
--- a/drivers/video/fbdev/msm/mdp_csc_table.h
+++ /dev/null
@@ -1,582 +0,0 @@
-/* drivers/video/msm_fb/mdp_csc_table.h
- *
- * Copyright (C) 2007 QUALCOMM Incorporated
- * Copyright (C) 2007 Google Incorporated
- *
- * 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.
- */
-
-static struct {
-	uint32_t reg;
-	uint32_t val;
-} csc_table[] = {
-	{ 0x40400, 0x83 },
-	{ 0x40404, 0x102 },
-	{ 0x40408, 0x32 },
-	{ 0x4040c, 0xffffffb5 },
-	{ 0x40410, 0xffffff6c },
-	{ 0x40414, 0xe1 },
-	{ 0x40418, 0xe1 },
-	{ 0x4041c, 0xffffff45 },
-	{ 0x40420, 0xffffffdc },
-	{ 0x40440, 0x254 },
-	{ 0x40444, 0x0 },
-	{ 0x40448, 0x331 },
-	{ 0x4044c, 0x254 },
-	{ 0x40450, 0xffffff38 },
-	{ 0x40454, 0xfffffe61 },
-	{ 0x40458, 0x254 },
-	{ 0x4045c, 0x409 },
-	{ 0x40460, 0x0 },
-	{ 0x40480, 0x5d },
-	{ 0x40484, 0x13a },
-	{ 0x40488, 0x20 },
-	{ 0x4048c, 0xffffffcd },
-	{ 0x40490, 0xffffff54 },
-	{ 0x40494, 0xe1 },
-	{ 0x40498, 0xe1 },
-	{ 0x4049c, 0xffffff35 },
-	{ 0x404a0, 0xffffffec },
-	{ 0x404c0, 0x254 },
-	{ 0x404c4, 0x0 },
-	{ 0x404c8, 0x396 },
-	{ 0x404cc, 0x254 },
-	{ 0x404d0, 0xffffff94 },
-	{ 0x404d4, 0xfffffef0 },
-	{ 0x404d8, 0x254 },
-	{ 0x404dc, 0x43a },
-	{ 0x404e0, 0x0 },
-	{ 0x40500, 0x10 },
-	{ 0x40504, 0x80 },
-	{ 0x40508, 0x80 },
-	{ 0x40540, 0x10 },
-	{ 0x40544, 0x80 },
-	{ 0x40548, 0x80 },
-	{ 0x40580, 0x10 },
-	{ 0x40584, 0xeb },
-	{ 0x40588, 0x10 },
-	{ 0x4058c, 0xf0 },
-	{ 0x405c0, 0x10 },
-	{ 0x405c4, 0xeb },
-	{ 0x405c8, 0x10 },
-	{ 0x405cc, 0xf0 },
-	{ 0x40800, 0x0 },
-	{ 0x40804, 0x151515 },
-	{ 0x40808, 0x1d1d1d },
-	{ 0x4080c, 0x232323 },
-	{ 0x40810, 0x272727 },
-	{ 0x40814, 0x2b2b2b },
-	{ 0x40818, 0x2f2f2f },
-	{ 0x4081c, 0x333333 },
-	{ 0x40820, 0x363636 },
-	{ 0x40824, 0x393939 },
-	{ 0x40828, 0x3b3b3b },
-	{ 0x4082c, 0x3e3e3e },
-	{ 0x40830, 0x404040 },
-	{ 0x40834, 0x434343 },
-	{ 0x40838, 0x454545 },
-	{ 0x4083c, 0x474747 },
-	{ 0x40840, 0x494949 },
-	{ 0x40844, 0x4b4b4b },
-	{ 0x40848, 0x4d4d4d },
-	{ 0x4084c, 0x4f4f4f },
-	{ 0x40850, 0x515151 },
-	{ 0x40854, 0x535353 },
-	{ 0x40858, 0x555555 },
-	{ 0x4085c, 0x565656 },
-	{ 0x40860, 0x585858 },
-	{ 0x40864, 0x5a5a5a },
-	{ 0x40868, 0x5b5b5b },
-	{ 0x4086c, 0x5d5d5d },
-	{ 0x40870, 0x5e5e5e },
-	{ 0x40874, 0x606060 },
-	{ 0x40878, 0x616161 },
-	{ 0x4087c, 0x636363 },
-	{ 0x40880, 0x646464 },
-	{ 0x40884, 0x666666 },
-	{ 0x40888, 0x676767 },
-	{ 0x4088c, 0x686868 },
-	{ 0x40890, 0x6a6a6a },
-	{ 0x40894, 0x6b6b6b },
-	{ 0x40898, 0x6c6c6c },
-	{ 0x4089c, 0x6e6e6e },
-	{ 0x408a0, 0x6f6f6f },
-	{ 0x408a4, 0x707070 },
-	{ 0x408a8, 0x717171 },
-	{ 0x408ac, 0x727272 },
-	{ 0x408b0, 0x747474 },
-	{ 0x408b4, 0x757575 },
-	{ 0x408b8, 0x767676 },
-	{ 0x408bc, 0x777777 },
-	{ 0x408c0, 0x787878 },
-	{ 0x408c4, 0x797979 },
-	{ 0x408c8, 0x7a7a7a },
-	{ 0x408cc, 0x7c7c7c },
-	{ 0x408d0, 0x7d7d7d },
-	{ 0x408d4, 0x7e7e7e },
-	{ 0x408d8, 0x7f7f7f },
-	{ 0x408dc, 0x808080 },
-	{ 0x408e0, 0x818181 },
-	{ 0x408e4, 0x828282 },
-	{ 0x408e8, 0x838383 },
-	{ 0x408ec, 0x848484 },
-	{ 0x408f0, 0x858585 },
-	{ 0x408f4, 0x868686 },
-	{ 0x408f8, 0x878787 },
-	{ 0x408fc, 0x888888 },
-	{ 0x40900, 0x898989 },
-	{ 0x40904, 0x8a8a8a },
-	{ 0x40908, 0x8b8b8b },
-	{ 0x4090c, 0x8c8c8c },
-	{ 0x40910, 0x8d8d8d },
-	{ 0x40914, 0x8e8e8e },
-	{ 0x40918, 0x8f8f8f },
-	{ 0x4091c, 0x8f8f8f },
-	{ 0x40920, 0x909090 },
-	{ 0x40924, 0x919191 },
-	{ 0x40928, 0x929292 },
-	{ 0x4092c, 0x939393 },
-	{ 0x40930, 0x949494 },
-	{ 0x40934, 0x959595 },
-	{ 0x40938, 0x969696 },
-	{ 0x4093c, 0x969696 },
-	{ 0x40940, 0x979797 },
-	{ 0x40944, 0x989898 },
-	{ 0x40948, 0x999999 },
-	{ 0x4094c, 0x9a9a9a },
-	{ 0x40950, 0x9b9b9b },
-	{ 0x40954, 0x9c9c9c },
-	{ 0x40958, 0x9c9c9c },
-	{ 0x4095c, 0x9d9d9d },
-	{ 0x40960, 0x9e9e9e },
-	{ 0x40964, 0x9f9f9f },
-	{ 0x40968, 0xa0a0a0 },
-	{ 0x4096c, 0xa0a0a0 },
-	{ 0x40970, 0xa1a1a1 },
-	{ 0x40974, 0xa2a2a2 },
-	{ 0x40978, 0xa3a3a3 },
-	{ 0x4097c, 0xa4a4a4 },
-	{ 0x40980, 0xa4a4a4 },
-	{ 0x40984, 0xa5a5a5 },
-	{ 0x40988, 0xa6a6a6 },
-	{ 0x4098c, 0xa7a7a7 },
-	{ 0x40990, 0xa7a7a7 },
-	{ 0x40994, 0xa8a8a8 },
-	{ 0x40998, 0xa9a9a9 },
-	{ 0x4099c, 0xaaaaaa },
-	{ 0x409a0, 0xaaaaaa },
-	{ 0x409a4, 0xababab },
-	{ 0x409a8, 0xacacac },
-	{ 0x409ac, 0xadadad },
-	{ 0x409b0, 0xadadad },
-	{ 0x409b4, 0xaeaeae },
-	{ 0x409b8, 0xafafaf },
-	{ 0x409bc, 0xafafaf },
-	{ 0x409c0, 0xb0b0b0 },
-	{ 0x409c4, 0xb1b1b1 },
-	{ 0x409c8, 0xb2b2b2 },
-	{ 0x409cc, 0xb2b2b2 },
-	{ 0x409d0, 0xb3b3b3 },
-	{ 0x409d4, 0xb4b4b4 },
-	{ 0x409d8, 0xb4b4b4 },
-	{ 0x409dc, 0xb5b5b5 },
-	{ 0x409e0, 0xb6b6b6 },
-	{ 0x409e4, 0xb6b6b6 },
-	{ 0x409e8, 0xb7b7b7 },
-	{ 0x409ec, 0xb8b8b8 },
-	{ 0x409f0, 0xb8b8b8 },
-	{ 0x409f4, 0xb9b9b9 },
-	{ 0x409f8, 0xbababa },
-	{ 0x409fc, 0xbababa },
-	{ 0x40a00, 0xbbbbbb },
-	{ 0x40a04, 0xbcbcbc },
-	{ 0x40a08, 0xbcbcbc },
-	{ 0x40a0c, 0xbdbdbd },
-	{ 0x40a10, 0xbebebe },
-	{ 0x40a14, 0xbebebe },
-	{ 0x40a18, 0xbfbfbf },
-	{ 0x40a1c, 0xc0c0c0 },
-	{ 0x40a20, 0xc0c0c0 },
-	{ 0x40a24, 0xc1c1c1 },
-	{ 0x40a28, 0xc1c1c1 },
-	{ 0x40a2c, 0xc2c2c2 },
-	{ 0x40a30, 0xc3c3c3 },
-	{ 0x40a34, 0xc3c3c3 },
-	{ 0x40a38, 0xc4c4c4 },
-	{ 0x40a3c, 0xc5c5c5 },
-	{ 0x40a40, 0xc5c5c5 },
-	{ 0x40a44, 0xc6c6c6 },
-	{ 0x40a48, 0xc6c6c6 },
-	{ 0x40a4c, 0xc7c7c7 },
-	{ 0x40a50, 0xc8c8c8 },
-	{ 0x40a54, 0xc8c8c8 },
-	{ 0x40a58, 0xc9c9c9 },
-	{ 0x40a5c, 0xc9c9c9 },
-	{ 0x40a60, 0xcacaca },
-	{ 0x40a64, 0xcbcbcb },
-	{ 0x40a68, 0xcbcbcb },
-	{ 0x40a6c, 0xcccccc },
-	{ 0x40a70, 0xcccccc },
-	{ 0x40a74, 0xcdcdcd },
-	{ 0x40a78, 0xcecece },
-	{ 0x40a7c, 0xcecece },
-	{ 0x40a80, 0xcfcfcf },
-	{ 0x40a84, 0xcfcfcf },
-	{ 0x40a88, 0xd0d0d0 },
-	{ 0x40a8c, 0xd0d0d0 },
-	{ 0x40a90, 0xd1d1d1 },
-	{ 0x40a94, 0xd2d2d2 },
-	{ 0x40a98, 0xd2d2d2 },
-	{ 0x40a9c, 0xd3d3d3 },
-	{ 0x40aa0, 0xd3d3d3 },
-	{ 0x40aa4, 0xd4d4d4 },
-	{ 0x40aa8, 0xd4d4d4 },
-	{ 0x40aac, 0xd5d5d5 },
-	{ 0x40ab0, 0xd6d6d6 },
-	{ 0x40ab4, 0xd6d6d6 },
-	{ 0x40ab8, 0xd7d7d7 },
-	{ 0x40abc, 0xd7d7d7 },
-	{ 0x40ac0, 0xd8d8d8 },
-	{ 0x40ac4, 0xd8d8d8 },
-	{ 0x40ac8, 0xd9d9d9 },
-	{ 0x40acc, 0xd9d9d9 },
-	{ 0x40ad0, 0xdadada },
-	{ 0x40ad4, 0xdbdbdb },
-	{ 0x40ad8, 0xdbdbdb },
-	{ 0x40adc, 0xdcdcdc },
-	{ 0x40ae0, 0xdcdcdc },
-	{ 0x40ae4, 0xdddddd },
-	{ 0x40ae8, 0xdddddd },
-	{ 0x40aec, 0xdedede },
-	{ 0x40af0, 0xdedede },
-	{ 0x40af4, 0xdfdfdf },
-	{ 0x40af8, 0xdfdfdf },
-	{ 0x40afc, 0xe0e0e0 },
-	{ 0x40b00, 0xe0e0e0 },
-	{ 0x40b04, 0xe1e1e1 },
-	{ 0x40b08, 0xe1e1e1 },
-	{ 0x40b0c, 0xe2e2e2 },
-	{ 0x40b10, 0xe3e3e3 },
-	{ 0x40b14, 0xe3e3e3 },
-	{ 0x40b18, 0xe4e4e4 },
-	{ 0x40b1c, 0xe4e4e4 },
-	{ 0x40b20, 0xe5e5e5 },
-	{ 0x40b24, 0xe5e5e5 },
-	{ 0x40b28, 0xe6e6e6 },
-	{ 0x40b2c, 0xe6e6e6 },
-	{ 0x40b30, 0xe7e7e7 },
-	{ 0x40b34, 0xe7e7e7 },
-	{ 0x40b38, 0xe8e8e8 },
-	{ 0x40b3c, 0xe8e8e8 },
-	{ 0x40b40, 0xe9e9e9 },
-	{ 0x40b44, 0xe9e9e9 },
-	{ 0x40b48, 0xeaeaea },
-	{ 0x40b4c, 0xeaeaea },
-	{ 0x40b50, 0xebebeb },
-	{ 0x40b54, 0xebebeb },
-	{ 0x40b58, 0xececec },
-	{ 0x40b5c, 0xececec },
-	{ 0x40b60, 0xededed },
-	{ 0x40b64, 0xededed },
-	{ 0x40b68, 0xeeeeee },
-	{ 0x40b6c, 0xeeeeee },
-	{ 0x40b70, 0xefefef },
-	{ 0x40b74, 0xefefef },
-	{ 0x40b78, 0xf0f0f0 },
-	{ 0x40b7c, 0xf0f0f0 },
-	{ 0x40b80, 0xf1f1f1 },
-	{ 0x40b84, 0xf1f1f1 },
-	{ 0x40b88, 0xf2f2f2 },
-	{ 0x40b8c, 0xf2f2f2 },
-	{ 0x40b90, 0xf2f2f2 },
-	{ 0x40b94, 0xf3f3f3 },
-	{ 0x40b98, 0xf3f3f3 },
-	{ 0x40b9c, 0xf4f4f4 },
-	{ 0x40ba0, 0xf4f4f4 },
-	{ 0x40ba4, 0xf5f5f5 },
-	{ 0x40ba8, 0xf5f5f5 },
-	{ 0x40bac, 0xf6f6f6 },
-	{ 0x40bb0, 0xf6f6f6 },
-	{ 0x40bb4, 0xf7f7f7 },
-	{ 0x40bb8, 0xf7f7f7 },
-	{ 0x40bbc, 0xf8f8f8 },
-	{ 0x40bc0, 0xf8f8f8 },
-	{ 0x40bc4, 0xf9f9f9 },
-	{ 0x40bc8, 0xf9f9f9 },
-	{ 0x40bcc, 0xfafafa },
-	{ 0x40bd0, 0xfafafa },
-	{ 0x40bd4, 0xfafafa },
-	{ 0x40bd8, 0xfbfbfb },
-	{ 0x40bdc, 0xfbfbfb },
-	{ 0x40be0, 0xfcfcfc },
-	{ 0x40be4, 0xfcfcfc },
-	{ 0x40be8, 0xfdfdfd },
-	{ 0x40bec, 0xfdfdfd },
-	{ 0x40bf0, 0xfefefe },
-	{ 0x40bf4, 0xfefefe },
-	{ 0x40bf8, 0xffffff },
-	{ 0x40bfc, 0xffffff },
-	{ 0x40c00, 0x0 },
-	{ 0x40c04, 0x0 },
-	{ 0x40c08, 0x0 },
-	{ 0x40c0c, 0x0 },
-	{ 0x40c10, 0x0 },
-	{ 0x40c14, 0x0 },
-	{ 0x40c18, 0x0 },
-	{ 0x40c1c, 0x0 },
-	{ 0x40c20, 0x0 },
-	{ 0x40c24, 0x0 },
-	{ 0x40c28, 0x0 },
-	{ 0x40c2c, 0x0 },
-	{ 0x40c30, 0x0 },
-	{ 0x40c34, 0x0 },
-	{ 0x40c38, 0x0 },
-	{ 0x40c3c, 0x0 },
-	{ 0x40c40, 0x10101 },
-	{ 0x40c44, 0x10101 },
-	{ 0x40c48, 0x10101 },
-	{ 0x40c4c, 0x10101 },
-	{ 0x40c50, 0x10101 },
-	{ 0x40c54, 0x10101 },
-	{ 0x40c58, 0x10101 },
-	{ 0x40c5c, 0x10101 },
-	{ 0x40c60, 0x10101 },
-	{ 0x40c64, 0x10101 },
-	{ 0x40c68, 0x20202 },
-	{ 0x40c6c, 0x20202 },
-	{ 0x40c70, 0x20202 },
-	{ 0x40c74, 0x20202 },
-	{ 0x40c78, 0x20202 },
-	{ 0x40c7c, 0x20202 },
-	{ 0x40c80, 0x30303 },
-	{ 0x40c84, 0x30303 },
-	{ 0x40c88, 0x30303 },
-	{ 0x40c8c, 0x30303 },
-	{ 0x40c90, 0x30303 },
-	{ 0x40c94, 0x40404 },
-	{ 0x40c98, 0x40404 },
-	{ 0x40c9c, 0x40404 },
-	{ 0x40ca0, 0x40404 },
-	{ 0x40ca4, 0x40404 },
-	{ 0x40ca8, 0x50505 },
-	{ 0x40cac, 0x50505 },
-	{ 0x40cb0, 0x50505 },
-	{ 0x40cb4, 0x50505 },
-	{ 0x40cb8, 0x60606 },
-	{ 0x40cbc, 0x60606 },
-	{ 0x40cc0, 0x60606 },
-	{ 0x40cc4, 0x70707 },
-	{ 0x40cc8, 0x70707 },
-	{ 0x40ccc, 0x70707 },
-	{ 0x40cd0, 0x70707 },
-	{ 0x40cd4, 0x80808 },
-	{ 0x40cd8, 0x80808 },
-	{ 0x40cdc, 0x80808 },
-	{ 0x40ce0, 0x90909 },
-	{ 0x40ce4, 0x90909 },
-	{ 0x40ce8, 0xa0a0a },
-	{ 0x40cec, 0xa0a0a },
-	{ 0x40cf0, 0xa0a0a },
-	{ 0x40cf4, 0xb0b0b },
-	{ 0x40cf8, 0xb0b0b },
-	{ 0x40cfc, 0xb0b0b },
-	{ 0x40d00, 0xc0c0c },
-	{ 0x40d04, 0xc0c0c },
-	{ 0x40d08, 0xd0d0d },
-	{ 0x40d0c, 0xd0d0d },
-	{ 0x40d10, 0xe0e0e },
-	{ 0x40d14, 0xe0e0e },
-	{ 0x40d18, 0xe0e0e },
-	{ 0x40d1c, 0xf0f0f },
-	{ 0x40d20, 0xf0f0f },
-	{ 0x40d24, 0x101010 },
-	{ 0x40d28, 0x101010 },
-	{ 0x40d2c, 0x111111 },
-	{ 0x40d30, 0x111111 },
-	{ 0x40d34, 0x121212 },
-	{ 0x40d38, 0x121212 },
-	{ 0x40d3c, 0x131313 },
-	{ 0x40d40, 0x131313 },
-	{ 0x40d44, 0x141414 },
-	{ 0x40d48, 0x151515 },
-	{ 0x40d4c, 0x151515 },
-	{ 0x40d50, 0x161616 },
-	{ 0x40d54, 0x161616 },
-	{ 0x40d58, 0x171717 },
-	{ 0x40d5c, 0x171717 },
-	{ 0x40d60, 0x181818 },
-	{ 0x40d64, 0x191919 },
-	{ 0x40d68, 0x191919 },
-	{ 0x40d6c, 0x1a1a1a },
-	{ 0x40d70, 0x1b1b1b },
-	{ 0x40d74, 0x1b1b1b },
-	{ 0x40d78, 0x1c1c1c },
-	{ 0x40d7c, 0x1c1c1c },
-	{ 0x40d80, 0x1d1d1d },
-	{ 0x40d84, 0x1e1e1e },
-	{ 0x40d88, 0x1f1f1f },
-	{ 0x40d8c, 0x1f1f1f },
-	{ 0x40d90, 0x202020 },
-	{ 0x40d94, 0x212121 },
-	{ 0x40d98, 0x212121 },
-	{ 0x40d9c, 0x222222 },
-	{ 0x40da0, 0x232323 },
-	{ 0x40da4, 0x242424 },
-	{ 0x40da8, 0x242424 },
-	{ 0x40dac, 0x252525 },
-	{ 0x40db0, 0x262626 },
-	{ 0x40db4, 0x272727 },
-	{ 0x40db8, 0x272727 },
-	{ 0x40dbc, 0x282828 },
-	{ 0x40dc0, 0x292929 },
-	{ 0x40dc4, 0x2a2a2a },
-	{ 0x40dc8, 0x2b2b2b },
-	{ 0x40dcc, 0x2c2c2c },
-	{ 0x40dd0, 0x2c2c2c },
-	{ 0x40dd4, 0x2d2d2d },
-	{ 0x40dd8, 0x2e2e2e },
-	{ 0x40ddc, 0x2f2f2f },
-	{ 0x40de0, 0x303030 },
-	{ 0x40de4, 0x313131 },
-	{ 0x40de8, 0x323232 },
-	{ 0x40dec, 0x333333 },
-	{ 0x40df0, 0x333333 },
-	{ 0x40df4, 0x343434 },
-	{ 0x40df8, 0x353535 },
-	{ 0x40dfc, 0x363636 },
-	{ 0x40e00, 0x373737 },
-	{ 0x40e04, 0x383838 },
-	{ 0x40e08, 0x393939 },
-	{ 0x40e0c, 0x3a3a3a },
-	{ 0x40e10, 0x3b3b3b },
-	{ 0x40e14, 0x3c3c3c },
-	{ 0x40e18, 0x3d3d3d },
-	{ 0x40e1c, 0x3e3e3e },
-	{ 0x40e20, 0x3f3f3f },
-	{ 0x40e24, 0x404040 },
-	{ 0x40e28, 0x414141 },
-	{ 0x40e2c, 0x424242 },
-	{ 0x40e30, 0x434343 },
-	{ 0x40e34, 0x444444 },
-	{ 0x40e38, 0x464646 },
-	{ 0x40e3c, 0x474747 },
-	{ 0x40e40, 0x484848 },
-	{ 0x40e44, 0x494949 },
-	{ 0x40e48, 0x4a4a4a },
-	{ 0x40e4c, 0x4b4b4b },
-	{ 0x40e50, 0x4c4c4c },
-	{ 0x40e54, 0x4d4d4d },
-	{ 0x40e58, 0x4f4f4f },
-	{ 0x40e5c, 0x505050 },
-	{ 0x40e60, 0x515151 },
-	{ 0x40e64, 0x525252 },
-	{ 0x40e68, 0x535353 },
-	{ 0x40e6c, 0x545454 },
-	{ 0x40e70, 0x565656 },
-	{ 0x40e74, 0x575757 },
-	{ 0x40e78, 0x585858 },
-	{ 0x40e7c, 0x595959 },
-	{ 0x40e80, 0x5b5b5b },
-	{ 0x40e84, 0x5c5c5c },
-	{ 0x40e88, 0x5d5d5d },
-	{ 0x40e8c, 0x5e5e5e },
-	{ 0x40e90, 0x606060 },
-	{ 0x40e94, 0x616161 },
-	{ 0x40e98, 0x626262 },
-	{ 0x40e9c, 0x646464 },
-	{ 0x40ea0, 0x656565 },
-	{ 0x40ea4, 0x666666 },
-	{ 0x40ea8, 0x686868 },
-	{ 0x40eac, 0x696969 },
-	{ 0x40eb0, 0x6a6a6a },
-	{ 0x40eb4, 0x6c6c6c },
-	{ 0x40eb8, 0x6d6d6d },
-	{ 0x40ebc, 0x6f6f6f },
-	{ 0x40ec0, 0x707070 },
-	{ 0x40ec4, 0x717171 },
-	{ 0x40ec8, 0x737373 },
-	{ 0x40ecc, 0x747474 },
-	{ 0x40ed0, 0x767676 },
-	{ 0x40ed4, 0x777777 },
-	{ 0x40ed8, 0x797979 },
-	{ 0x40edc, 0x7a7a7a },
-	{ 0x40ee0, 0x7c7c7c },
-	{ 0x40ee4, 0x7d7d7d },
-	{ 0x40ee8, 0x7f7f7f },
-	{ 0x40eec, 0x808080 },
-	{ 0x40ef0, 0x828282 },
-	{ 0x40ef4, 0x838383 },
-	{ 0x40ef8, 0x858585 },
-	{ 0x40efc, 0x868686 },
-	{ 0x40f00, 0x888888 },
-	{ 0x40f04, 0x898989 },
-	{ 0x40f08, 0x8b8b8b },
-	{ 0x40f0c, 0x8d8d8d },
-	{ 0x40f10, 0x8e8e8e },
-	{ 0x40f14, 0x909090 },
-	{ 0x40f18, 0x919191 },
-	{ 0x40f1c, 0x939393 },
-	{ 0x40f20, 0x959595 },
-	{ 0x40f24, 0x969696 },
-	{ 0x40f28, 0x989898 },
-	{ 0x40f2c, 0x9a9a9a },
-	{ 0x40f30, 0x9b9b9b },
-	{ 0x40f34, 0x9d9d9d },
-	{ 0x40f38, 0x9f9f9f },
-	{ 0x40f3c, 0xa1a1a1 },
-	{ 0x40f40, 0xa2a2a2 },
-	{ 0x40f44, 0xa4a4a4 },
-	{ 0x40f48, 0xa6a6a6 },
-	{ 0x40f4c, 0xa7a7a7 },
-	{ 0x40f50, 0xa9a9a9 },
-	{ 0x40f54, 0xababab },
-	{ 0x40f58, 0xadadad },
-	{ 0x40f5c, 0xafafaf },
-	{ 0x40f60, 0xb0b0b0 },
-	{ 0x40f64, 0xb2b2b2 },
-	{ 0x40f68, 0xb4b4b4 },
-	{ 0x40f6c, 0xb6b6b6 },
-	{ 0x40f70, 0xb8b8b8 },
-	{ 0x40f74, 0xbababa },
-	{ 0x40f78, 0xbbbbbb },
-	{ 0x40f7c, 0xbdbdbd },
-	{ 0x40f80, 0xbfbfbf },
-	{ 0x40f84, 0xc1c1c1 },
-	{ 0x40f88, 0xc3c3c3 },
-	{ 0x40f8c, 0xc5c5c5 },
-	{ 0x40f90, 0xc7c7c7 },
-	{ 0x40f94, 0xc9c9c9 },
-	{ 0x40f98, 0xcbcbcb },
-	{ 0x40f9c, 0xcdcdcd },
-	{ 0x40fa0, 0xcfcfcf },
-	{ 0x40fa4, 0xd1d1d1 },
-	{ 0x40fa8, 0xd3d3d3 },
-	{ 0x40fac, 0xd5d5d5 },
-	{ 0x40fb0, 0xd7d7d7 },
-	{ 0x40fb4, 0xd9d9d9 },
-	{ 0x40fb8, 0xdbdbdb },
-	{ 0x40fbc, 0xdddddd },
-	{ 0x40fc0, 0xdfdfdf },
-	{ 0x40fc4, 0xe1e1e1 },
-	{ 0x40fc8, 0xe3e3e3 },
-	{ 0x40fcc, 0xe5e5e5 },
-	{ 0x40fd0, 0xe7e7e7 },
-	{ 0x40fd4, 0xe9e9e9 },
-	{ 0x40fd8, 0xebebeb },
-	{ 0x40fdc, 0xeeeeee },
-	{ 0x40fe0, 0xf0f0f0 },
-	{ 0x40fe4, 0xf2f2f2 },
-	{ 0x40fe8, 0xf4f4f4 },
-	{ 0x40fec, 0xf6f6f6 },
-	{ 0x40ff0, 0xf8f8f8 },
-	{ 0x40ff4, 0xfbfbfb },
-	{ 0x40ff8, 0xfdfdfd },
-	{ 0x40ffc, 0xffffff },
-};
diff --git a/drivers/video/fbdev/msm/mdp_hw.h b/drivers/video/fbdev/msm/mdp_hw.h
deleted file mode 100644
index 35848d741001..000000000000
--- a/drivers/video/fbdev/msm/mdp_hw.h
+++ /dev/null
@@ -1,627 +0,0 @@
-/* drivers/video/msm_fb/mdp_hw.h
- *
- * Copyright (C) 2007 QUALCOMM Incorporated
- * Copyright (C) 2007 Google Incorporated
- *
- * 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.
- */
-#ifndef _MDP_HW_H_
-#define _MDP_HW_H_
-
-#include <linux/platform_data/video-msm_fb.h>
-
-struct mdp_info {
-	struct mdp_device mdp_dev;
-	char * __iomem base;
-	int irq;
-};
-struct mdp_blit_req;
-struct mdp_device;
-int mdp_ppp_blit(const struct mdp_info *mdp, struct mdp_blit_req *req,
-		 struct file *src_file, unsigned long src_start,
-		 unsigned long src_len, struct file *dst_file,
-		 unsigned long dst_start, unsigned long dst_len);
-#define mdp_writel(mdp, value, offset) writel(value, mdp->base + offset)
-#define mdp_readl(mdp, offset) readl(mdp->base + offset)
-
-#define MDP_SYNC_CONFIG_0                (0x00000)
-#define MDP_SYNC_CONFIG_1                (0x00004)
-#define MDP_SYNC_CONFIG_2                (0x00008)
-#define MDP_SYNC_STATUS_0                (0x0000c)
-#define MDP_SYNC_STATUS_1                (0x00010)
-#define MDP_SYNC_STATUS_2                (0x00014)
-#define MDP_SYNC_THRESH_0                (0x00018)
-#define MDP_SYNC_THRESH_1                (0x0001c)
-#define MDP_INTR_ENABLE                  (0x00020)
-#define MDP_INTR_STATUS                  (0x00024)
-#define MDP_INTR_CLEAR                   (0x00028)
-#define MDP_DISPLAY0_START               (0x00030)
-#define MDP_DISPLAY1_START               (0x00034)
-#define MDP_DISPLAY_STATUS               (0x00038)
-#define MDP_EBI2_LCD0                    (0x0003c)
-#define MDP_EBI2_LCD1                    (0x00040)
-#define MDP_DISPLAY0_ADDR                (0x00054)
-#define MDP_DISPLAY1_ADDR                (0x00058)
-#define MDP_EBI2_PORTMAP_MODE            (0x0005c)
-#define MDP_MODE                         (0x00060)
-#define MDP_TV_OUT_STATUS                (0x00064)
-#define MDP_HW_VERSION                   (0x00070)
-#define MDP_SW_RESET                     (0x00074)
-#define MDP_AXI_ERROR_MASTER_STOP        (0x00078)
-#define MDP_SEL_CLK_OR_HCLK_TEST_BUS     (0x0007c)
-#define MDP_PRIMARY_VSYNC_OUT_CTRL       (0x00080)
-#define MDP_SECONDARY_VSYNC_OUT_CTRL     (0x00084)
-#define MDP_EXTERNAL_VSYNC_OUT_CTRL      (0x00088)
-#define MDP_VSYNC_CTRL                   (0x0008c)
-#define MDP_CGC_EN                       (0x00100)
-#define MDP_CMD_STATUS                   (0x10008)
-#define MDP_PROFILE_EN                   (0x10010)
-#define MDP_PROFILE_COUNT                (0x10014)
-#define MDP_DMA_START                    (0x10044)
-#define MDP_FULL_BYPASS_WORD0            (0x10100)
-#define MDP_FULL_BYPASS_WORD1            (0x10104)
-#define MDP_COMMAND_CONFIG               (0x10104)
-#define MDP_FULL_BYPASS_WORD2            (0x10108)
-#define MDP_FULL_BYPASS_WORD3            (0x1010c)
-#define MDP_FULL_BYPASS_WORD4            (0x10110)
-#define MDP_FULL_BYPASS_WORD6            (0x10118)
-#define MDP_FULL_BYPASS_WORD7            (0x1011c)
-#define MDP_FULL_BYPASS_WORD8            (0x10120)
-#define MDP_FULL_BYPASS_WORD9            (0x10124)
-#define MDP_PPP_SOURCE_CONFIG            (0x10124)
-#define MDP_FULL_BYPASS_WORD10           (0x10128)
-#define MDP_FULL_BYPASS_WORD11           (0x1012c)
-#define MDP_FULL_BYPASS_WORD12           (0x10130)
-#define MDP_FULL_BYPASS_WORD13           (0x10134)
-#define MDP_FULL_BYPASS_WORD14           (0x10138)
-#define MDP_PPP_OPERATION_CONFIG         (0x10138)
-#define MDP_FULL_BYPASS_WORD15           (0x1013c)
-#define MDP_FULL_BYPASS_WORD16           (0x10140)
-#define MDP_FULL_BYPASS_WORD17           (0x10144)
-#define MDP_FULL_BYPASS_WORD18           (0x10148)
-#define MDP_FULL_BYPASS_WORD19           (0x1014c)
-#define MDP_FULL_BYPASS_WORD20           (0x10150)
-#define MDP_PPP_DESTINATION_CONFIG       (0x10150)
-#define MDP_FULL_BYPASS_WORD21           (0x10154)
-#define MDP_FULL_BYPASS_WORD22           (0x10158)
-#define MDP_FULL_BYPASS_WORD23           (0x1015c)
-#define MDP_FULL_BYPASS_WORD24           (0x10160)
-#define MDP_FULL_BYPASS_WORD25           (0x10164)
-#define MDP_FULL_BYPASS_WORD26           (0x10168)
-#define MDP_FULL_BYPASS_WORD27           (0x1016c)
-#define MDP_FULL_BYPASS_WORD29           (0x10174)
-#define MDP_FULL_BYPASS_WORD30           (0x10178)
-#define MDP_FULL_BYPASS_WORD31           (0x1017c)
-#define MDP_FULL_BYPASS_WORD32           (0x10180)
-#define MDP_DMA_CONFIG                   (0x10180)
-#define MDP_FULL_BYPASS_WORD33           (0x10184)
-#define MDP_FULL_BYPASS_WORD34           (0x10188)
-#define MDP_FULL_BYPASS_WORD35           (0x1018c)
-#define MDP_FULL_BYPASS_WORD37           (0x10194)
-#define MDP_FULL_BYPASS_WORD39           (0x1019c)
-#define MDP_FULL_BYPASS_WORD40           (0x101a0)
-#define MDP_FULL_BYPASS_WORD41           (0x101a4)
-#define MDP_FULL_BYPASS_WORD43           (0x101ac)
-#define MDP_FULL_BYPASS_WORD46           (0x101b8)
-#define MDP_FULL_BYPASS_WORD47           (0x101bc)
-#define MDP_FULL_BYPASS_WORD48           (0x101c0)
-#define MDP_FULL_BYPASS_WORD49           (0x101c4)
-#define MDP_FULL_BYPASS_WORD50           (0x101c8)
-#define MDP_FULL_BYPASS_WORD51           (0x101cc)
-#define MDP_FULL_BYPASS_WORD52           (0x101d0)
-#define MDP_FULL_BYPASS_WORD53           (0x101d4)
-#define MDP_FULL_BYPASS_WORD54           (0x101d8)
-#define MDP_FULL_BYPASS_WORD55           (0x101dc)
-#define MDP_FULL_BYPASS_WORD56           (0x101e0)
-#define MDP_FULL_BYPASS_WORD57           (0x101e4)
-#define MDP_FULL_BYPASS_WORD58           (0x101e8)
-#define MDP_FULL_BYPASS_WORD59           (0x101ec)
-#define MDP_FULL_BYPASS_WORD60           (0x101f0)
-#define MDP_VSYNC_THRESHOLD              (0x101f0)
-#define MDP_FULL_BYPASS_WORD61           (0x101f4)
-#define MDP_FULL_BYPASS_WORD62           (0x101f8)
-#define MDP_FULL_BYPASS_WORD63           (0x101fc)
-#define MDP_TFETCH_TEST_MODE             (0x20004)
-#define MDP_TFETCH_STATUS                (0x20008)
-#define MDP_TFETCH_TILE_COUNT            (0x20010)
-#define MDP_TFETCH_FETCH_COUNT           (0x20014)
-#define MDP_TFETCH_CONSTANT_COLOR        (0x20040)
-#define MDP_CSC_BYPASS                   (0x40004)
-#define MDP_SCALE_COEFF_LSB              (0x5fffc)
-#define MDP_TV_OUT_CTL                   (0xc0000)
-#define MDP_TV_OUT_FIR_COEFF             (0xc0004)
-#define MDP_TV_OUT_BUF_ADDR              (0xc0008)
-#define MDP_TV_OUT_CC_DATA               (0xc000c)
-#define MDP_TV_OUT_SOBEL                 (0xc0010)
-#define MDP_TV_OUT_Y_CLAMP               (0xc0018)
-#define MDP_TV_OUT_CB_CLAMP              (0xc001c)
-#define MDP_TV_OUT_CR_CLAMP              (0xc0020)
-#define MDP_TEST_MODE_CLK                (0xd0000)
-#define MDP_TEST_MISR_RESET_CLK          (0xd0004)
-#define MDP_TEST_EXPORT_MISR_CLK         (0xd0008)
-#define MDP_TEST_MISR_CURR_VAL_CLK       (0xd000c)
-#define MDP_TEST_MODE_HCLK               (0xd0100)
-#define MDP_TEST_MISR_RESET_HCLK         (0xd0104)
-#define MDP_TEST_EXPORT_MISR_HCLK        (0xd0108)
-#define MDP_TEST_MISR_CURR_VAL_HCLK      (0xd010c)
-#define MDP_TEST_MODE_DCLK               (0xd0200)
-#define MDP_TEST_MISR_RESET_DCLK         (0xd0204)
-#define MDP_TEST_EXPORT_MISR_DCLK        (0xd0208)
-#define MDP_TEST_MISR_CURR_VAL_DCLK      (0xd020c)
-#define MDP_TEST_CAPTURED_DCLK           (0xd0210)
-#define MDP_TEST_MISR_CAPT_VAL_DCLK      (0xd0214)
-#define MDP_LCDC_CTL                     (0xe0000)
-#define MDP_LCDC_HSYNC_CTL               (0xe0004)
-#define MDP_LCDC_VSYNC_CTL               (0xe0008)
-#define MDP_LCDC_ACTIVE_HCTL             (0xe000c)
-#define MDP_LCDC_ACTIVE_VCTL             (0xe0010)
-#define MDP_LCDC_BORDER_CLR              (0xe0014)
-#define MDP_LCDC_H_BLANK                 (0xe0018)
-#define MDP_LCDC_V_BLANK                 (0xe001c)
-#define MDP_LCDC_UNDERFLOW_CLR           (0xe0020)
-#define MDP_LCDC_HSYNC_SKEW              (0xe0024)
-#define MDP_LCDC_TEST_CTL                (0xe0028)
-#define MDP_LCDC_LINE_IRQ                (0xe002c)
-#define MDP_LCDC_CTL_POLARITY            (0xe0030)
-#define MDP_LCDC_DMA_CONFIG              (0xe1000)
-#define MDP_LCDC_DMA_SIZE                (0xe1004)
-#define MDP_LCDC_DMA_IBUF_ADDR           (0xe1008)
-#define MDP_LCDC_DMA_IBUF_Y_STRIDE       (0xe100c)
-
-
-#define MDP_DMA2_TERM 0x1
-#define MDP_DMA3_TERM 0x2
-#define MDP_PPP_TERM 0x3
-
-/* MDP_INTR_ENABLE */
-#define DL0_ROI_DONE           (1<<0)
-#define DL1_ROI_DONE           (1<<1)
-#define DL0_DMA2_TERM_DONE     (1<<2)
-#define DL1_DMA2_TERM_DONE     (1<<3)
-#define DL0_PPP_TERM_DONE      (1<<4)
-#define DL1_PPP_TERM_DONE      (1<<5)
-#define TV_OUT_DMA3_DONE       (1<<6)
-#define TV_ENC_UNDERRUN        (1<<7)
-#define DL0_FETCH_DONE         (1<<11)
-#define DL1_FETCH_DONE         (1<<12)
-
-#define MDP_PPP_BUSY_STATUS (DL0_ROI_DONE| \
-			   DL1_ROI_DONE| \
-			   DL0_PPP_TERM_DONE| \
-			   DL1_PPP_TERM_DONE)
-
-#define MDP_ANY_INTR_MASK (DL0_ROI_DONE| \
-			   DL1_ROI_DONE| \
-			   DL0_DMA2_TERM_DONE| \
-			   DL1_DMA2_TERM_DONE| \
-			   DL0_PPP_TERM_DONE| \
-			   DL1_PPP_TERM_DONE| \
-			   DL0_FETCH_DONE| \
-			   DL1_FETCH_DONE| \
-			   TV_ENC_UNDERRUN)
-
-#define MDP_TOP_LUMA       16
-#define MDP_TOP_CHROMA     0
-#define MDP_BOTTOM_LUMA    19
-#define MDP_BOTTOM_CHROMA  3
-#define MDP_LEFT_LUMA      22
-#define MDP_LEFT_CHROMA    6
-#define MDP_RIGHT_LUMA     25
-#define MDP_RIGHT_CHROMA   9
-
-#define CLR_G 0x0
-#define CLR_B 0x1
-#define CLR_R 0x2
-#define CLR_ALPHA 0x3
-
-#define CLR_Y  CLR_G
-#define CLR_CB CLR_B
-#define CLR_CR CLR_R
-
-/* from lsb to msb */
-#define MDP_GET_PACK_PATTERN(a, x, y, z, bit) \
-	(((a)<<(bit*3))|((x)<<(bit*2))|((y)<<bit)|(z))
-
-/* MDP_SYNC_CONFIG_0/1/2 */
-#define MDP_SYNCFG_HGT_LOC 22
-#define MDP_SYNCFG_VSYNC_EXT_EN (1<<21)
-#define MDP_SYNCFG_VSYNC_INT_EN (1<<20)
-
-/* MDP_SYNC_THRESH_0 */
-#define MDP_PRIM_BELOW_LOC 0
-#define MDP_PRIM_ABOVE_LOC 8
-
-/* MDP_{PRIMARY,SECONDARY,EXTERNAL}_VSYNC_OUT_CRL */
-#define VSYNC_PULSE_EN (1<<31)
-#define VSYNC_PULSE_INV (1<<30)
-
-/* MDP_VSYNC_CTRL */
-#define DISP0_VSYNC_MAP_VSYNC0 0
-#define DISP0_VSYNC_MAP_VSYNC1 (1<<0)
-#define DISP0_VSYNC_MAP_VSYNC2 ((1<<0)|(1<<1))
-
-#define DISP1_VSYNC_MAP_VSYNC0 0
-#define DISP1_VSYNC_MAP_VSYNC1 (1<<2)
-#define DISP1_VSYNC_MAP_VSYNC2 ((1<<2)|(1<<3))
-
-#define PRIMARY_LCD_SYNC_EN (1<<4)
-#define PRIMARY_LCD_SYNC_DISABLE 0
-
-#define SECONDARY_LCD_SYNC_EN (1<<5)
-#define SECONDARY_LCD_SYNC_DISABLE 0
-
-#define EXTERNAL_LCD_SYNC_EN (1<<6)
-#define EXTERNAL_LCD_SYNC_DISABLE 0
-
-/* MDP_VSYNC_THRESHOLD / MDP_FULL_BYPASS_WORD60 */
-#define VSYNC_THRESHOLD_ABOVE_LOC 0
-#define VSYNC_THRESHOLD_BELOW_LOC 16
-#define VSYNC_ANTI_TEAR_EN (1<<31)
-
-/* MDP_COMMAND_CONFIG / MDP_FULL_BYPASS_WORD1 */
-#define MDP_CMD_DBGBUS_EN (1<<0)
-
-/* MDP_PPP_SOURCE_CONFIG / MDP_FULL_BYPASS_WORD9&53 */
-#define PPP_SRC_C0G_8BIT ((1<<1)|(1<<0))
-#define PPP_SRC_C1B_8BIT ((1<<3)|(1<<2))
-#define PPP_SRC_C2R_8BIT ((1<<5)|(1<<4))
-#define PPP_SRC_C3A_8BIT ((1<<7)|(1<<6))
-
-#define PPP_SRC_C0G_6BIT (1<<1)
-#define PPP_SRC_C1B_6BIT (1<<3)
-#define PPP_SRC_C2R_6BIT (1<<5)
-
-#define PPP_SRC_C0G_5BIT (1<<0)
-#define PPP_SRC_C1B_5BIT (1<<2)
-#define PPP_SRC_C2R_5BIT (1<<4)
-
-#define PPP_SRC_C3ALPHA_EN (1<<8)
-
-#define PPP_SRC_BPP_1BYTES 0
-#define PPP_SRC_BPP_2BYTES (1<<9)
-#define PPP_SRC_BPP_3BYTES (1<<10)
-#define PPP_SRC_BPP_4BYTES ((1<<10)|(1<<9))
-
-#define PPP_SRC_BPP_ROI_ODD_X (1<<11)
-#define PPP_SRC_BPP_ROI_ODD_Y (1<<12)
-#define PPP_SRC_INTERLVD_2COMPONENTS (1<<13)
-#define PPP_SRC_INTERLVD_3COMPONENTS (1<<14)
-#define PPP_SRC_INTERLVD_4COMPONENTS ((1<<14)|(1<<13))
-
-
-/* RGB666 unpack format
-** TIGHT means R6+G6+B6 together
-** LOOSE means R6+2 +G6+2+ B6+2 (with MSB)
-**          or 2+R6 +2+G6 +2+B6 (with LSB)
-*/
-#define PPP_SRC_PACK_TIGHT (1<<17)
-#define PPP_SRC_PACK_LOOSE 0
-#define PPP_SRC_PACK_ALIGN_LSB 0
-#define PPP_SRC_PACK_ALIGN_MSB (1<<18)
-
-#define PPP_SRC_PLANE_INTERLVD 0
-#define PPP_SRC_PLANE_PSEUDOPLNR (1<<20)
-
-#define PPP_SRC_WMV9_MODE (1<<21)
-
-/* MDP_PPP_OPERATION_CONFIG / MDP_FULL_BYPASS_WORD14 */
-#define PPP_OP_SCALE_X_ON (1<<0)
-#define PPP_OP_SCALE_Y_ON (1<<1)
-
-#define PPP_OP_CONVERT_RGB2YCBCR 0
-#define PPP_OP_CONVERT_YCBCR2RGB (1<<2)
-#define PPP_OP_CONVERT_ON (1<<3)
-
-#define PPP_OP_CONVERT_MATRIX_PRIMARY 0
-#define PPP_OP_CONVERT_MATRIX_SECONDARY (1<<4)
-
-#define PPP_OP_LUT_C0_ON (1<<5)
-#define PPP_OP_LUT_C1_ON (1<<6)
-#define PPP_OP_LUT_C2_ON (1<<7)
-
-/* rotate or blend enable */
-#define PPP_OP_ROT_ON (1<<8)
-
-#define PPP_OP_ROT_90 (1<<9)
-#define PPP_OP_FLIP_LR (1<<10)
-#define PPP_OP_FLIP_UD (1<<11)
-
-#define PPP_OP_BLEND_ON (1<<12)
-
-#define PPP_OP_BLEND_SRCPIXEL_ALPHA 0
-#define PPP_OP_BLEND_DSTPIXEL_ALPHA (1<<13)
-#define PPP_OP_BLEND_CONSTANT_ALPHA (1<<14)
-#define PPP_OP_BLEND_SRCPIXEL_TRANSP ((1<<13)|(1<<14))
-
-#define PPP_OP_BLEND_ALPHA_BLEND_NORMAL 0
-#define PPP_OP_BLEND_ALPHA_BLEND_REVERSE (1<<15)
-
-#define PPP_OP_DITHER_EN (1<<16)
-
-#define PPP_OP_COLOR_SPACE_RGB 0
-#define PPP_OP_COLOR_SPACE_YCBCR (1<<17)
-
-#define PPP_OP_SRC_CHROMA_RGB 0
-#define PPP_OP_SRC_CHROMA_H2V1 (1<<18)
-#define PPP_OP_SRC_CHROMA_H1V2 (1<<19)
-#define PPP_OP_SRC_CHROMA_420 ((1<<18)|(1<<19))
-#define PPP_OP_SRC_CHROMA_COSITE 0
-#define PPP_OP_SRC_CHROMA_OFFSITE (1<<20)
-
-#define PPP_OP_DST_CHROMA_RGB 0
-#define PPP_OP_DST_CHROMA_H2V1 (1<<21)
-#define PPP_OP_DST_CHROMA_H1V2 (1<<22)
-#define PPP_OP_DST_CHROMA_420 ((1<<21)|(1<<22))
-#define PPP_OP_DST_CHROMA_COSITE 0
-#define PPP_OP_DST_CHROMA_OFFSITE (1<<23)
-
-#define PPP_BLEND_ALPHA_TRANSP (1<<24)
-
-#define PPP_OP_BG_CHROMA_RGB 0
-#define PPP_OP_BG_CHROMA_H2V1 (1<<25)
-#define PPP_OP_BG_CHROMA_H1V2 (1<<26)
-#define PPP_OP_BG_CHROMA_420 ((1<<25)|(1<<26))
-#define PPP_OP_BG_CHROMA_SITE_COSITE 0
-#define PPP_OP_BG_CHROMA_SITE_OFFSITE (1<<27)
-
-/* MDP_PPP_DESTINATION_CONFIG / MDP_FULL_BYPASS_WORD20 */
-#define PPP_DST_C0G_8BIT ((1<<0)|(1<<1))
-#define PPP_DST_C1B_8BIT ((1<<3)|(1<<2))
-#define PPP_DST_C2R_8BIT ((1<<5)|(1<<4))
-#define PPP_DST_C3A_8BIT ((1<<7)|(1<<6))
-
-#define PPP_DST_C0G_6BIT (1<<1)
-#define PPP_DST_C1B_6BIT (1<<3)
-#define PPP_DST_C2R_6BIT (1<<5)
-
-#define PPP_DST_C0G_5BIT (1<<0)
-#define PPP_DST_C1B_5BIT (1<<2)
-#define PPP_DST_C2R_5BIT (1<<4)
-
-#define PPP_DST_C3A_8BIT ((1<<7)|(1<<6))
-#define PPP_DST_C3ALPHA_EN (1<<8)
-
-#define PPP_DST_INTERLVD_2COMPONENTS (1<<9)
-#define PPP_DST_INTERLVD_3COMPONENTS (1<<10)
-#define PPP_DST_INTERLVD_4COMPONENTS ((1<<10)|(1<<9))
-#define PPP_DST_INTERLVD_6COMPONENTS ((1<<11)|(1<<9))
-
-#define PPP_DST_PACK_LOOSE 0
-#define PPP_DST_PACK_TIGHT (1<<13)
-#define PPP_DST_PACK_ALIGN_LSB 0
-#define PPP_DST_PACK_ALIGN_MSB (1<<14)
-
-#define PPP_DST_OUT_SEL_AXI 0
-#define PPP_DST_OUT_SEL_MDDI (1<<15)
-
-#define PPP_DST_BPP_2BYTES (1<<16)
-#define PPP_DST_BPP_3BYTES (1<<17)
-#define PPP_DST_BPP_4BYTES ((1<<17)|(1<<16))
-
-#define PPP_DST_PLANE_INTERLVD 0
-#define PPP_DST_PLANE_PLANAR (1<<18)
-#define PPP_DST_PLANE_PSEUDOPLNR (1<<19)
-
-#define PPP_DST_TO_TV (1<<20)
-
-#define PPP_DST_MDDI_PRIMARY 0
-#define PPP_DST_MDDI_SECONDARY (1<<21)
-#define PPP_DST_MDDI_EXTERNAL (1<<22)
-
-/* image configurations by image type */
-#define PPP_CFG_MDP_RGB_565(dir)       (PPP_##dir##_C2R_5BIT | \
-					PPP_##dir##_C0G_6BIT | \
-					PPP_##dir##_C1B_5BIT | \
-					PPP_##dir##_BPP_2BYTES | \
-					PPP_##dir##_INTERLVD_3COMPONENTS | \
-					PPP_##dir##_PACK_TIGHT | \
-					PPP_##dir##_PACK_ALIGN_LSB | \
-					PPP_##dir##_PLANE_INTERLVD)
-
-#define PPP_CFG_MDP_RGB_888(dir)       (PPP_##dir##_C2R_8BIT | \
-					PPP_##dir##_C0G_8BIT | \
-					PPP_##dir##_C1B_8BIT | \
-					PPP_##dir##_BPP_3BYTES | \
-					PPP_##dir##_INTERLVD_3COMPONENTS | \
-					PPP_##dir##_PACK_TIGHT | \
-					PPP_##dir##_PACK_ALIGN_LSB | \
-					PPP_##dir##_PLANE_INTERLVD)
-
-#define PPP_CFG_MDP_ARGB_8888(dir)     (PPP_##dir##_C2R_8BIT | \
-					PPP_##dir##_C0G_8BIT | \
-					PPP_##dir##_C1B_8BIT | \
-					PPP_##dir##_C3A_8BIT | \
-					PPP_##dir##_C3ALPHA_EN | \
-					PPP_##dir##_BPP_4BYTES | \
-					PPP_##dir##_INTERLVD_4COMPONENTS | \
-					PPP_##dir##_PACK_TIGHT | \
-					PPP_##dir##_PACK_ALIGN_LSB | \
-					PPP_##dir##_PLANE_INTERLVD)
-
-#define PPP_CFG_MDP_XRGB_8888(dir) PPP_CFG_MDP_ARGB_8888(dir)
-#define PPP_CFG_MDP_RGBA_8888(dir) PPP_CFG_MDP_ARGB_8888(dir)
-#define PPP_CFG_MDP_BGRA_8888(dir) PPP_CFG_MDP_ARGB_8888(dir)
-#define PPP_CFG_MDP_RGBX_8888(dir) PPP_CFG_MDP_ARGB_8888(dir)
-
-#define PPP_CFG_MDP_Y_CBCR_H2V2(dir)   (PPP_##dir##_C2R_8BIT | \
-					PPP_##dir##_C0G_8BIT | \
-					PPP_##dir##_C1B_8BIT | \
-					PPP_##dir##_C3A_8BIT | \
-					PPP_##dir##_BPP_2BYTES | \
-					PPP_##dir##_INTERLVD_2COMPONENTS | \
-					PPP_##dir##_PACK_TIGHT | \
-					PPP_##dir##_PACK_ALIGN_LSB | \
-					PPP_##dir##_PLANE_PSEUDOPLNR)
-
-#define PPP_CFG_MDP_Y_CRCB_H2V2(dir)	PPP_CFG_MDP_Y_CBCR_H2V2(dir)
-
-#define PPP_CFG_MDP_YCRYCB_H2V1(dir)   (PPP_##dir##_C2R_8BIT | \
-					PPP_##dir##_C0G_8BIT | \
-					PPP_##dir##_C1B_8BIT | \
-					PPP_##dir##_C3A_8BIT | \
-					PPP_##dir##_BPP_2BYTES | \
-					PPP_##dir##_INTERLVD_4COMPONENTS | \
-					PPP_##dir##_PACK_TIGHT | \
-					PPP_##dir##_PACK_ALIGN_LSB |\
-					PPP_##dir##_PLANE_INTERLVD)
-
-#define PPP_CFG_MDP_Y_CBCR_H2V1(dir)   (PPP_##dir##_C2R_8BIT | \
-					PPP_##dir##_C0G_8BIT | \
-					PPP_##dir##_C1B_8BIT | \
-					PPP_##dir##_C3A_8BIT | \
-					PPP_##dir##_BPP_2BYTES |   \
-					PPP_##dir##_INTERLVD_2COMPONENTS |  \
-					PPP_##dir##_PACK_TIGHT | \
-					PPP_##dir##_PACK_ALIGN_LSB | \
-					PPP_##dir##_PLANE_PSEUDOPLNR)
-
-#define PPP_CFG_MDP_Y_CRCB_H2V1(dir)	PPP_CFG_MDP_Y_CBCR_H2V1(dir)
-
-#define PPP_PACK_PATTERN_MDP_RGB_565 \
-	MDP_GET_PACK_PATTERN(0, CLR_R, CLR_G, CLR_B, 8)
-#define PPP_PACK_PATTERN_MDP_RGB_888 PPP_PACK_PATTERN_MDP_RGB_565
-#define PPP_PACK_PATTERN_MDP_XRGB_8888 \
-	MDP_GET_PACK_PATTERN(CLR_B, CLR_G, CLR_R, CLR_ALPHA, 8)
-#define PPP_PACK_PATTERN_MDP_ARGB_8888 PPP_PACK_PATTERN_MDP_XRGB_8888
-#define PPP_PACK_PATTERN_MDP_RGBA_8888 \
-	MDP_GET_PACK_PATTERN(CLR_ALPHA, CLR_B, CLR_G, CLR_R, 8)
-#define PPP_PACK_PATTERN_MDP_BGRA_8888 \
-	MDP_GET_PACK_PATTERN(CLR_ALPHA, CLR_R, CLR_G, CLR_B, 8)
-#define PPP_PACK_PATTERN_MDP_RGBX_8888 \
-	MDP_GET_PACK_PATTERN(CLR_ALPHA, CLR_B, CLR_G, CLR_R, 8)
-#define PPP_PACK_PATTERN_MDP_Y_CBCR_H2V1 \
-	MDP_GET_PACK_PATTERN(0, 0, CLR_CB, CLR_CR, 8)
-#define PPP_PACK_PATTERN_MDP_Y_CBCR_H2V2 PPP_PACK_PATTERN_MDP_Y_CBCR_H2V1
-#define PPP_PACK_PATTERN_MDP_Y_CRCB_H2V1 \
-	MDP_GET_PACK_PATTERN(0, 0, CLR_CR, CLR_CB, 8)
-#define PPP_PACK_PATTERN_MDP_Y_CRCB_H2V2 PPP_PACK_PATTERN_MDP_Y_CRCB_H2V1
-#define PPP_PACK_PATTERN_MDP_YCRYCB_H2V1 \
-	MDP_GET_PACK_PATTERN(CLR_Y, CLR_R, CLR_Y, CLR_B, 8)
-
-#define PPP_CHROMA_SAMP_MDP_RGB_565(dir) PPP_OP_##dir##_CHROMA_RGB
-#define PPP_CHROMA_SAMP_MDP_RGB_888(dir) PPP_OP_##dir##_CHROMA_RGB
-#define PPP_CHROMA_SAMP_MDP_XRGB_8888(dir) PPP_OP_##dir##_CHROMA_RGB
-#define PPP_CHROMA_SAMP_MDP_ARGB_8888(dir) PPP_OP_##dir##_CHROMA_RGB
-#define PPP_CHROMA_SAMP_MDP_RGBA_8888(dir) PPP_OP_##dir##_CHROMA_RGB
-#define PPP_CHROMA_SAMP_MDP_BGRA_8888(dir) PPP_OP_##dir##_CHROMA_RGB
-#define PPP_CHROMA_SAMP_MDP_RGBX_8888(dir) PPP_OP_##dir##_CHROMA_RGB
-#define PPP_CHROMA_SAMP_MDP_Y_CBCR_H2V1(dir) PPP_OP_##dir##_CHROMA_H2V1
-#define PPP_CHROMA_SAMP_MDP_Y_CBCR_H2V2(dir) PPP_OP_##dir##_CHROMA_420
-#define PPP_CHROMA_SAMP_MDP_Y_CRCB_H2V1(dir) PPP_OP_##dir##_CHROMA_H2V1
-#define PPP_CHROMA_SAMP_MDP_Y_CRCB_H2V2(dir) PPP_OP_##dir##_CHROMA_420
-#define PPP_CHROMA_SAMP_MDP_YCRYCB_H2V1(dir) PPP_OP_##dir##_CHROMA_H2V1
-
-/* Helpful array generation macros */
-#define PPP_ARRAY0(name) \
-	[MDP_RGB_565] = PPP_##name##_MDP_RGB_565,\
-	[MDP_RGB_888] = PPP_##name##_MDP_RGB_888,\
-	[MDP_XRGB_8888] = PPP_##name##_MDP_XRGB_8888,\
-	[MDP_ARGB_8888] = PPP_##name##_MDP_ARGB_8888,\
-	[MDP_RGBA_8888] = PPP_##name##_MDP_RGBA_8888,\
-	[MDP_BGRA_8888] = PPP_##name##_MDP_BGRA_8888,\
-	[MDP_RGBX_8888] = PPP_##name##_MDP_RGBX_8888,\
-	[MDP_Y_CBCR_H2V1] = PPP_##name##_MDP_Y_CBCR_H2V1,\
-	[MDP_Y_CBCR_H2V2] = PPP_##name##_MDP_Y_CBCR_H2V2,\
-	[MDP_Y_CRCB_H2V1] = PPP_##name##_MDP_Y_CRCB_H2V1,\
-	[MDP_Y_CRCB_H2V2] = PPP_##name##_MDP_Y_CRCB_H2V2,\
-	[MDP_YCRYCB_H2V1] = PPP_##name##_MDP_YCRYCB_H2V1
-
-#define PPP_ARRAY1(name, dir) \
-	[MDP_RGB_565] = PPP_##name##_MDP_RGB_565(dir),\
-	[MDP_RGB_888] = PPP_##name##_MDP_RGB_888(dir),\
-	[MDP_XRGB_8888] = PPP_##name##_MDP_XRGB_8888(dir),\
-	[MDP_ARGB_8888] = PPP_##name##_MDP_ARGB_8888(dir),\
-	[MDP_RGBA_8888] = PPP_##name##_MDP_RGBA_8888(dir),\
-	[MDP_BGRA_8888] = PPP_##name##_MDP_BGRA_8888(dir),\
-	[MDP_RGBX_8888] = PPP_##name##_MDP_RGBX_8888(dir),\
-	[MDP_Y_CBCR_H2V1] = PPP_##name##_MDP_Y_CBCR_H2V1(dir),\
-	[MDP_Y_CBCR_H2V2] = PPP_##name##_MDP_Y_CBCR_H2V2(dir),\
-	[MDP_Y_CRCB_H2V1] = PPP_##name##_MDP_Y_CRCB_H2V1(dir),\
-	[MDP_Y_CRCB_H2V2] = PPP_##name##_MDP_Y_CRCB_H2V2(dir),\
-	[MDP_YCRYCB_H2V1] = PPP_##name##_MDP_YCRYCB_H2V1(dir)
-
-#define IS_YCRCB(img) ((img == MDP_Y_CRCB_H2V2) | (img == MDP_Y_CBCR_H2V2) | \
-		       (img == MDP_Y_CRCB_H2V1) | (img == MDP_Y_CBCR_H2V1) | \
-		       (img == MDP_YCRYCB_H2V1))
-#define IS_RGB(img) ((img == MDP_RGB_565) | (img == MDP_RGB_888) | \
-		     (img == MDP_ARGB_8888) | (img == MDP_RGBA_8888) | \
-		     (img == MDP_XRGB_8888) | (img == MDP_BGRA_8888) | \
-		     (img == MDP_RGBX_8888))
-#define HAS_ALPHA(img) ((img == MDP_ARGB_8888) | (img == MDP_RGBA_8888) | \
-			(img == MDP_BGRA_8888))
-
-#define IS_PSEUDOPLNR(img) ((img == MDP_Y_CRCB_H2V2) | \
-			    (img == MDP_Y_CBCR_H2V2) | \
-			    (img == MDP_Y_CRCB_H2V1) | \
-			    (img == MDP_Y_CBCR_H2V1))
-
-/* Mappings from addr to purpose */
-#define PPP_ADDR_SRC_ROI		MDP_FULL_BYPASS_WORD2
-#define PPP_ADDR_SRC0			MDP_FULL_BYPASS_WORD3
-#define PPP_ADDR_SRC1			MDP_FULL_BYPASS_WORD4
-#define PPP_ADDR_SRC_YSTRIDE		MDP_FULL_BYPASS_WORD7
-#define PPP_ADDR_SRC_CFG		MDP_FULL_BYPASS_WORD9
-#define PPP_ADDR_SRC_PACK_PATTERN	MDP_FULL_BYPASS_WORD10
-#define PPP_ADDR_OPERATION		MDP_FULL_BYPASS_WORD14
-#define PPP_ADDR_PHASEX_INIT		MDP_FULL_BYPASS_WORD15
-#define PPP_ADDR_PHASEY_INIT		MDP_FULL_BYPASS_WORD16
-#define PPP_ADDR_PHASEX_STEP		MDP_FULL_BYPASS_WORD17
-#define PPP_ADDR_PHASEY_STEP		MDP_FULL_BYPASS_WORD18
-#define PPP_ADDR_ALPHA_TRANSP		MDP_FULL_BYPASS_WORD19
-#define PPP_ADDR_DST_CFG		MDP_FULL_BYPASS_WORD20
-#define PPP_ADDR_DST_PACK_PATTERN	MDP_FULL_BYPASS_WORD21
-#define PPP_ADDR_DST_ROI		MDP_FULL_BYPASS_WORD25
-#define PPP_ADDR_DST0			MDP_FULL_BYPASS_WORD26
-#define PPP_ADDR_DST1			MDP_FULL_BYPASS_WORD27
-#define PPP_ADDR_DST_YSTRIDE		MDP_FULL_BYPASS_WORD30
-#define PPP_ADDR_EDGE			MDP_FULL_BYPASS_WORD46
-#define PPP_ADDR_BG0			MDP_FULL_BYPASS_WORD48
-#define PPP_ADDR_BG1			MDP_FULL_BYPASS_WORD49
-#define PPP_ADDR_BG_YSTRIDE		MDP_FULL_BYPASS_WORD51
-#define PPP_ADDR_BG_CFG			MDP_FULL_BYPASS_WORD53
-#define PPP_ADDR_BG_PACK_PATTERN	MDP_FULL_BYPASS_WORD54
-
-/* MDP_DMA_CONFIG / MDP_FULL_BYPASS_WORD32 */
-#define DMA_DSTC0G_6BITS (1<<1)
-#define DMA_DSTC1B_6BITS (1<<3)
-#define DMA_DSTC2R_6BITS (1<<5)
-#define DMA_DSTC0G_5BITS (1<<0)
-#define DMA_DSTC1B_5BITS (1<<2)
-#define DMA_DSTC2R_5BITS (1<<4)
-
-#define DMA_PACK_TIGHT (1<<6)
-#define DMA_PACK_LOOSE 0
-#define DMA_PACK_ALIGN_LSB 0
-#define DMA_PACK_ALIGN_MSB (1<<7)
-#define DMA_PACK_PATTERN_RGB \
-	(MDP_GET_PACK_PATTERN(0, CLR_R, CLR_G, CLR_B, 2)<<8)
-
-#define DMA_OUT_SEL_AHB  0
-#define DMA_OUT_SEL_MDDI (1<<14)
-#define DMA_AHBM_LCD_SEL_PRIMARY 0
-#define DMA_AHBM_LCD_SEL_SECONDARY (1<<15)
-#define DMA_IBUF_C3ALPHA_EN (1<<16)
-#define DMA_DITHER_EN (1<<17)
-
-#define DMA_MDDI_DMAOUT_LCD_SEL_PRIMARY 0
-#define DMA_MDDI_DMAOUT_LCD_SEL_SECONDARY (1<<18)
-#define DMA_MDDI_DMAOUT_LCD_SEL_EXTERNAL (1<<19)
-
-#define DMA_IBUF_FORMAT_RGB565 (1<<20)
-#define DMA_IBUF_FORMAT_RGB888_OR_ARGB8888 0
-
-#define DMA_IBUF_NONCONTIGUOUS (1<<21)
-
-/* MDDI REGISTER ? */
-#define MDDI_VDO_PACKET_DESC  0x5666
-#define MDDI_VDO_PACKET_PRIM  0xC3
-#define MDDI_VDO_PACKET_SECD  0xC0
-
-#endif
diff --git a/drivers/video/fbdev/msm/mdp_ppp.c b/drivers/video/fbdev/msm/mdp_ppp.c
deleted file mode 100644
index be6079cdfbb6..000000000000
--- a/drivers/video/fbdev/msm/mdp_ppp.c
+++ /dev/null
@@ -1,731 +0,0 @@
-/* drivers/video/msm/mdp_ppp.c
- *
- * Copyright (C) 2007 QUALCOMM Incorporated
- * Copyright (C) 2007 Google Incorporated
- *
- * 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/fb.h>
-#include <linux/file.h>
-#include <linux/delay.h>
-#include <linux/msm_mdp.h>
-#include <linux/platform_data/video-msm_fb.h>
-
-#include "mdp_hw.h"
-#include "mdp_scale_tables.h"
-
-#define DLOG(x...) do {} while (0)
-
-#define MDP_DOWNSCALE_BLUR (MDP_DOWNSCALE_MAX + 1)
-static int downscale_y_table = MDP_DOWNSCALE_MAX;
-static int downscale_x_table = MDP_DOWNSCALE_MAX;
-
-struct mdp_regs {
-	uint32_t src0;
-	uint32_t src1;
-	uint32_t dst0;
-	uint32_t dst1;
-	uint32_t src_cfg;
-	uint32_t dst_cfg;
-	uint32_t src_pack;
-	uint32_t dst_pack;
-	uint32_t src_rect;
-	uint32_t dst_rect;
-	uint32_t src_ystride;
-	uint32_t dst_ystride;
-	uint32_t op;
-	uint32_t src_bpp;
-	uint32_t dst_bpp;
-	uint32_t edge;
-	uint32_t phasex_init;
-	uint32_t phasey_init;
-	uint32_t phasex_step;
-	uint32_t phasey_step;
-};
-
-static uint32_t pack_pattern[] = {
-	PPP_ARRAY0(PACK_PATTERN)
-};
-
-static uint32_t src_img_cfg[] = {
-	PPP_ARRAY1(CFG, SRC)
-};
-
-static uint32_t dst_img_cfg[] = {
-	PPP_ARRAY1(CFG, DST)
-};
-
-static uint32_t bytes_per_pixel[] = {
-	[MDP_RGB_565] = 2,
-	[MDP_RGB_888] = 3,
-	[MDP_XRGB_8888] = 4,
-	[MDP_ARGB_8888] = 4,
-	[MDP_RGBA_8888] = 4,
-	[MDP_BGRA_8888] = 4,
-	[MDP_RGBX_8888] = 4,
-	[MDP_Y_CBCR_H2V1] = 1,
-	[MDP_Y_CBCR_H2V2] = 1,
-	[MDP_Y_CRCB_H2V1] = 1,
-	[MDP_Y_CRCB_H2V2] = 1,
-	[MDP_YCRYCB_H2V1] = 2
-};
-
-static uint32_t dst_op_chroma[] = {
-	PPP_ARRAY1(CHROMA_SAMP, DST)
-};
-
-static uint32_t src_op_chroma[] = {
-	PPP_ARRAY1(CHROMA_SAMP, SRC)
-};
-
-static uint32_t bg_op_chroma[] = {
-	PPP_ARRAY1(CHROMA_SAMP, BG)
-};
-
-static void rotate_dst_addr_x(struct mdp_blit_req *req, struct mdp_regs *regs)
-{
-	regs->dst0 += (req->dst_rect.w -
-		       min((uint32_t)16, req->dst_rect.w)) * regs->dst_bpp;
-	regs->dst1 += (req->dst_rect.w -
-		       min((uint32_t)16, req->dst_rect.w)) * regs->dst_bpp;
-}
-
-static void rotate_dst_addr_y(struct mdp_blit_req *req, struct mdp_regs *regs)
-{
-	regs->dst0 += (req->dst_rect.h -
-		       min((uint32_t)16, req->dst_rect.h)) *
-		       regs->dst_ystride;
-	regs->dst1 += (req->dst_rect.h -
-		       min((uint32_t)16, req->dst_rect.h)) *
-		       regs->dst_ystride;
-}
-
-static void blit_rotate(struct mdp_blit_req *req,
-			struct mdp_regs *regs)
-{
-	if (req->flags == MDP_ROT_NOP)
-		return;
-
-	regs->op |= PPP_OP_ROT_ON;
-	if ((req->flags & MDP_ROT_90 || req->flags & MDP_FLIP_LR) &&
-	    !(req->flags & MDP_ROT_90 && req->flags & MDP_FLIP_LR))
-		rotate_dst_addr_x(req, regs);
-	if (req->flags & MDP_ROT_90)
-		regs->op |= PPP_OP_ROT_90;
-	if (req->flags & MDP_FLIP_UD) {
-		regs->op |= PPP_OP_FLIP_UD;
-		rotate_dst_addr_y(req, regs);
-	}
-	if (req->flags & MDP_FLIP_LR)
-		regs->op |= PPP_OP_FLIP_LR;
-}
-
-static void blit_convert(struct mdp_blit_req *req, struct mdp_regs *regs)
-{
-	if (req->src.format == req->dst.format)
-		return;
-	if (IS_RGB(req->src.format) && IS_YCRCB(req->dst.format)) {
-		regs->op |= PPP_OP_CONVERT_RGB2YCBCR | PPP_OP_CONVERT_ON;
-	} else if (IS_YCRCB(req->src.format) && IS_RGB(req->dst.format)) {
-		regs->op |= PPP_OP_CONVERT_YCBCR2RGB | PPP_OP_CONVERT_ON;
-		if (req->dst.format == MDP_RGB_565)
-			regs->op |= PPP_OP_CONVERT_MATRIX_SECONDARY;
-	}
-}
-
-#define GET_BIT_RANGE(value, high, low) \
-	(((1 << (high - low + 1)) - 1) & (value >> low))
-static uint32_t transp_convert(struct mdp_blit_req *req)
-{
-	uint32_t transp = 0;
-	if (req->src.format == MDP_RGB_565) {
-		/* pad each value to 8 bits by copying the high bits into the
-		 * low end, convert RGB to RBG by switching low 2 components */
-		transp |= ((GET_BIT_RANGE(req->transp_mask, 15, 11) << 3) |
-			   (GET_BIT_RANGE(req->transp_mask, 15, 13))) << 16;
-
-		transp |= ((GET_BIT_RANGE(req->transp_mask, 4, 0) << 3) |
-			   (GET_BIT_RANGE(req->transp_mask, 4, 2))) << 8;
-
-		transp |= (GET_BIT_RANGE(req->transp_mask, 10, 5) << 2) |
-			  (GET_BIT_RANGE(req->transp_mask, 10, 9));
-	} else {
-		/* convert RGB to RBG */
-		transp |= (GET_BIT_RANGE(req->transp_mask, 15, 8)) |
-			  (GET_BIT_RANGE(req->transp_mask, 23, 16) << 16) |
-			  (GET_BIT_RANGE(req->transp_mask, 7, 0) << 8);
-	}
-	return transp;
-}
-#undef GET_BIT_RANGE
-
-static void blit_blend(struct mdp_blit_req *req, struct mdp_regs *regs)
-{
-	/* TRANSP BLEND */
-	if (req->transp_mask != MDP_TRANSP_NOP) {
-		req->transp_mask = transp_convert(req);
-		if (req->alpha != MDP_ALPHA_NOP) {
-			/* use blended transparancy mode
-			 * pixel = (src == transp) ? dst : blend
-			 * blend is combo of blend_eq_sel and
-			 * blend_alpha_sel */
-			regs->op |= PPP_OP_ROT_ON | PPP_OP_BLEND_ON |
-				PPP_OP_BLEND_ALPHA_BLEND_NORMAL |
-				PPP_OP_BLEND_CONSTANT_ALPHA |
-				PPP_BLEND_ALPHA_TRANSP;
-		} else {
-			/* simple transparancy mode
-			 * pixel = (src == transp) ? dst : src */
-			regs->op |= PPP_OP_ROT_ON | PPP_OP_BLEND_ON |
-				PPP_OP_BLEND_SRCPIXEL_TRANSP;
-		}
-	}
-
-	req->alpha &= 0xff;
-	/* ALPHA BLEND */
-	if (HAS_ALPHA(req->src.format)) {
-		regs->op |= PPP_OP_ROT_ON | PPP_OP_BLEND_ON |
-			PPP_OP_BLEND_SRCPIXEL_ALPHA;
-	} else if (req->alpha < MDP_ALPHA_NOP) {
-		/* just blend by alpha */
-		regs->op |= PPP_OP_ROT_ON | PPP_OP_BLEND_ON |
-			PPP_OP_BLEND_ALPHA_BLEND_NORMAL |
-			PPP_OP_BLEND_CONSTANT_ALPHA;
-	}
-
-	regs->op |= bg_op_chroma[req->dst.format];
-}
-
-#define ONE_HALF	(1LL << 32)
-#define ONE		(1LL << 33)
-#define TWO		(2LL << 33)
-#define THREE		(3LL << 33)
-#define FRAC_MASK (ONE - 1)
-#define INT_MASK (~FRAC_MASK)
-
-static int scale_params(uint32_t dim_in, uint32_t dim_out, uint32_t origin,
-			uint32_t *phase_init, uint32_t *phase_step)
-{
-	/* to improve precicsion calculations are done in U31.33 and converted
-	 * to U3.29 at the end */
-	int64_t k1, k2, k3, k4, tmp;
-	uint64_t n, d, os, os_p, od, od_p, oreq;
-	unsigned rpa = 0;
-	int64_t ip64, delta;
-
-	if (dim_out % 3 == 0)
-		rpa = !(dim_in % (dim_out / 3));
-
-	n = ((uint64_t)dim_out) << 34;
-	d = dim_in;
-	if (!d)
-		return -1;
-	do_div(n, d);
-	k3 = (n + 1) >> 1;
-	if ((k3 >> 4) < (1LL << 27) || (k3 >> 4) > (1LL << 31)) {
-		DLOG("crap bad scale\n");
-		return -1;
-	}
-	n = ((uint64_t)dim_in) << 34;
-	d = (uint64_t)dim_out;
-	if (!d)
-		return -1;
-	do_div(n, d);
-	k1 = (n + 1) >> 1;
-	k2 = (k1 - ONE) >> 1;
-
-	*phase_init = (int)(k2 >> 4);
-	k4 = (k3 - ONE) >> 1;
-
-	if (rpa) {
-		os = ((uint64_t)origin << 33) - ONE_HALF;
-		tmp = (dim_out * os) + ONE_HALF;
-		if (!dim_in)
-			return -1;
-		do_div(tmp, dim_in);
-		od = tmp - ONE_HALF;
-	} else {
-		os = ((uint64_t)origin << 1) - 1;
-		od = (((k3 * os) >> 1) + k4);
-	}
-
-	od_p = od & INT_MASK;
-	if (od_p != od)
-		od_p += ONE;
-
-	if (rpa) {
-		tmp = (dim_in * od_p) + ONE_HALF;
-		if (!dim_in)
-			return -1;
-		do_div(tmp, dim_in);
-		os_p = tmp - ONE_HALF;
-	} else {
-		os_p = ((k1 * (od_p >> 33)) + k2);
-	}
-
-	oreq = (os_p & INT_MASK) - ONE;
-
-	ip64 = os_p - oreq;
-	delta = ((int64_t)(origin) << 33) - oreq;
-	ip64 -= delta;
-	/* limit to valid range before the left shift */
-	delta = (ip64 & (1LL << 63)) ? 4 : -4;
-	delta <<= 33;
-	while (abs((int)(ip64 >> 33)) > 4)
-		ip64 += delta;
-	*phase_init = (int)(ip64 >> 4);
-	*phase_step = (uint32_t)(k1 >> 4);
-	return 0;
-}
-
-static void load_scale_table(const struct mdp_info *mdp,
-			     struct mdp_table_entry *table, int len)
-{
-	int i;
-	for (i = 0; i < len; i++)
-		mdp_writel(mdp, table[i].val, table[i].reg);
-}
-
-enum {
-IMG_LEFT,
-IMG_RIGHT,
-IMG_TOP,
-IMG_BOTTOM,
-};
-
-static void get_edge_info(uint32_t src, uint32_t src_coord, uint32_t dst,
-			  uint32_t *interp1, uint32_t *interp2,
-			  uint32_t *repeat1, uint32_t *repeat2) {
-	if (src > 3 * dst) {
-		*interp1 = 0;
-		*interp2 = src - 1;
-		*repeat1 = 0;
-		*repeat2 = 0;
-	} else if (src == 3 * dst) {
-		*interp1 = 0;
-		*interp2 = src;
-		*repeat1 = 0;
-		*repeat2 = 1;
-	} else if (src > dst && src < 3 * dst) {
-		*interp1 = -1;
-		*interp2 = src;
-		*repeat1 = 1;
-		*repeat2 = 1;
-	} else if (src == dst) {
-		*interp1 = -1;
-		*interp2 = src + 1;
-		*repeat1 = 1;
-		*repeat2 = 2;
-	} else {
-		*interp1 = -2;
-		*interp2 = src + 1;
-		*repeat1 = 2;
-		*repeat2 = 2;
-	}
-	*interp1 += src_coord;
-	*interp2 += src_coord;
-}
-
-static int get_edge_cond(struct mdp_blit_req *req, struct mdp_regs *regs)
-{
-	int32_t luma_interp[4];
-	int32_t luma_repeat[4];
-	int32_t chroma_interp[4];
-	int32_t chroma_bound[4];
-	int32_t chroma_repeat[4];
-	uint32_t dst_w, dst_h;
-
-	memset(&luma_interp, 0, sizeof(int32_t) * 4);
-	memset(&luma_repeat, 0, sizeof(int32_t) * 4);
-	memset(&chroma_interp, 0, sizeof(int32_t) * 4);
-	memset(&chroma_bound, 0, sizeof(int32_t) * 4);
-	memset(&chroma_repeat, 0, sizeof(int32_t) * 4);
-	regs->edge = 0;
-
-	if (req->flags & MDP_ROT_90) {
-		dst_w = req->dst_rect.h;
-		dst_h = req->dst_rect.w;
-	} else {
-		dst_w = req->dst_rect.w;
-		dst_h = req->dst_rect.h;
-	}
-
-	if (regs->op & (PPP_OP_SCALE_Y_ON | PPP_OP_SCALE_X_ON)) {
-		get_edge_info(req->src_rect.h, req->src_rect.y, dst_h,
-			      &luma_interp[IMG_TOP], &luma_interp[IMG_BOTTOM],
-			      &luma_repeat[IMG_TOP], &luma_repeat[IMG_BOTTOM]);
-		get_edge_info(req->src_rect.w, req->src_rect.x, dst_w,
-			      &luma_interp[IMG_LEFT], &luma_interp[IMG_RIGHT],
-			      &luma_repeat[IMG_LEFT], &luma_repeat[IMG_RIGHT]);
-	} else {
-		luma_interp[IMG_LEFT] = req->src_rect.x;
-		luma_interp[IMG_RIGHT] = req->src_rect.x + req->src_rect.w - 1;
-		luma_interp[IMG_TOP] = req->src_rect.y;
-		luma_interp[IMG_BOTTOM] = req->src_rect.y + req->src_rect.h - 1;
-		luma_repeat[IMG_LEFT] = 0;
-		luma_repeat[IMG_TOP] = 0;
-		luma_repeat[IMG_RIGHT] = 0;
-		luma_repeat[IMG_BOTTOM] = 0;
-	}
-
-	chroma_interp[IMG_LEFT] = luma_interp[IMG_LEFT];
-	chroma_interp[IMG_RIGHT] = luma_interp[IMG_RIGHT];
-	chroma_interp[IMG_TOP] = luma_interp[IMG_TOP];
-	chroma_interp[IMG_BOTTOM] = luma_interp[IMG_BOTTOM];
-
-	chroma_bound[IMG_LEFT] = req->src_rect.x;
-	chroma_bound[IMG_RIGHT] = req->src_rect.x + req->src_rect.w - 1;
-	chroma_bound[IMG_TOP] = req->src_rect.y;
-	chroma_bound[IMG_BOTTOM] = req->src_rect.y + req->src_rect.h - 1;
-
-	if (IS_YCRCB(req->src.format)) {
-		chroma_interp[IMG_LEFT] = chroma_interp[IMG_LEFT] >> 1;
-		chroma_interp[IMG_RIGHT] = (chroma_interp[IMG_RIGHT] + 1) >> 1;
-
-		chroma_bound[IMG_LEFT] = chroma_bound[IMG_LEFT] >> 1;
-		chroma_bound[IMG_RIGHT] = chroma_bound[IMG_RIGHT] >> 1;
-	}
-
-	if (req->src.format == MDP_Y_CBCR_H2V2 ||
-	    req->src.format == MDP_Y_CRCB_H2V2) {
-		chroma_interp[IMG_TOP] = (chroma_interp[IMG_TOP] - 1) >> 1;
-		chroma_interp[IMG_BOTTOM] = (chroma_interp[IMG_BOTTOM] + 1)
-					    >> 1;
-		chroma_bound[IMG_TOP] = (chroma_bound[IMG_TOP] + 1) >> 1;
-		chroma_bound[IMG_BOTTOM] = chroma_bound[IMG_BOTTOM] >> 1;
-	}
-
-	chroma_repeat[IMG_LEFT] = chroma_bound[IMG_LEFT] -
-				  chroma_interp[IMG_LEFT];
-	chroma_repeat[IMG_RIGHT] = chroma_interp[IMG_RIGHT] -
-				  chroma_bound[IMG_RIGHT];
-	chroma_repeat[IMG_TOP] = chroma_bound[IMG_TOP] -
-				  chroma_interp[IMG_TOP];
-	chroma_repeat[IMG_BOTTOM] = chroma_interp[IMG_BOTTOM] -
-				  chroma_bound[IMG_BOTTOM];
-
-	if (chroma_repeat[IMG_LEFT] < 0 || chroma_repeat[IMG_LEFT] > 3 ||
-	    chroma_repeat[IMG_RIGHT] < 0 || chroma_repeat[IMG_RIGHT] > 3 ||
-	    chroma_repeat[IMG_TOP] < 0 || chroma_repeat[IMG_TOP] > 3 ||
-	    chroma_repeat[IMG_BOTTOM] < 0 || chroma_repeat[IMG_BOTTOM] > 3 ||
-	    luma_repeat[IMG_LEFT] < 0 || luma_repeat[IMG_LEFT] > 3 ||
-	    luma_repeat[IMG_RIGHT] < 0 || luma_repeat[IMG_RIGHT] > 3 ||
-	    luma_repeat[IMG_TOP] < 0 || luma_repeat[IMG_TOP] > 3 ||
-	    luma_repeat[IMG_BOTTOM] < 0 || luma_repeat[IMG_BOTTOM] > 3)
-		return -1;
-
-	regs->edge |= (chroma_repeat[IMG_LEFT] & 3) << MDP_LEFT_CHROMA;
-	regs->edge |= (chroma_repeat[IMG_RIGHT] & 3) << MDP_RIGHT_CHROMA;
-	regs->edge |= (chroma_repeat[IMG_TOP] & 3) << MDP_TOP_CHROMA;
-	regs->edge |= (chroma_repeat[IMG_BOTTOM] & 3) << MDP_BOTTOM_CHROMA;
-	regs->edge |= (luma_repeat[IMG_LEFT] & 3) << MDP_LEFT_LUMA;
-	regs->edge |= (luma_repeat[IMG_RIGHT] & 3) << MDP_RIGHT_LUMA;
-	regs->edge |= (luma_repeat[IMG_TOP] & 3) << MDP_TOP_LUMA;
-	regs->edge |= (luma_repeat[IMG_BOTTOM] & 3) << MDP_BOTTOM_LUMA;
-	return 0;
-}
-
-static int blit_scale(const struct mdp_info *mdp, struct mdp_blit_req *req,
-		      struct mdp_regs *regs)
-{
-	uint32_t phase_init_x, phase_init_y, phase_step_x, phase_step_y;
-	uint32_t scale_factor_x, scale_factor_y;
-	uint32_t downscale;
-	uint32_t dst_w, dst_h;
-
-	if (req->flags & MDP_ROT_90) {
-		dst_w = req->dst_rect.h;
-		dst_h = req->dst_rect.w;
-	} else {
-		dst_w = req->dst_rect.w;
-		dst_h = req->dst_rect.h;
-	}
-	if ((req->src_rect.w == dst_w)  && (req->src_rect.h == dst_h) &&
-	    !(req->flags & MDP_BLUR)) {
-		regs->phasex_init = 0;
-		regs->phasey_init = 0;
-		regs->phasex_step = 0;
-		regs->phasey_step = 0;
-		return 0;
-	}
-
-	if (scale_params(req->src_rect.w, dst_w, 1, &phase_init_x,
-			 &phase_step_x) ||
-	    scale_params(req->src_rect.h, dst_h, 1, &phase_init_y,
-			 &phase_step_y))
-		return -1;
-
-	scale_factor_x = (dst_w * 10) / req->src_rect.w;
-	scale_factor_y = (dst_h * 10) / req->src_rect.h;
-
-	if (scale_factor_x > 8)
-		downscale = MDP_DOWNSCALE_PT8TO1;
-	else if (scale_factor_x > 6)
-		downscale = MDP_DOWNSCALE_PT6TOPT8;
-	else if (scale_factor_x > 4)
-		downscale = MDP_DOWNSCALE_PT4TOPT6;
-	else
-		downscale = MDP_DOWNSCALE_PT2TOPT4;
-	if (downscale != downscale_x_table) {
-		load_scale_table(mdp, mdp_downscale_x_table[downscale], 64);
-		downscale_x_table = downscale;
-	}
-
-	if (scale_factor_y > 8)
-		downscale = MDP_DOWNSCALE_PT8TO1;
-	else if (scale_factor_y > 6)
-		downscale = MDP_DOWNSCALE_PT6TOPT8;
-	else if (scale_factor_y > 4)
-		downscale = MDP_DOWNSCALE_PT4TOPT6;
-	else
-		downscale = MDP_DOWNSCALE_PT2TOPT4;
-	if (downscale != downscale_y_table) {
-		load_scale_table(mdp, mdp_downscale_y_table[downscale], 64);
-		downscale_y_table = downscale;
-	}
-
-	regs->phasex_init = phase_init_x;
-	regs->phasey_init = phase_init_y;
-	regs->phasex_step = phase_step_x;
-	regs->phasey_step = phase_step_y;
-	regs->op |= (PPP_OP_SCALE_Y_ON | PPP_OP_SCALE_X_ON);
-	return 0;
-
-}
-
-static void blit_blur(const struct mdp_info *mdp, struct mdp_blit_req *req,
-		      struct mdp_regs *regs)
-{
-	if (!(req->flags & MDP_BLUR))
-		return;
-
-	if (!(downscale_x_table == MDP_DOWNSCALE_BLUR &&
-	      downscale_y_table == MDP_DOWNSCALE_BLUR)) {
-		load_scale_table(mdp, mdp_gaussian_blur_table, 128);
-		downscale_x_table = MDP_DOWNSCALE_BLUR;
-		downscale_y_table = MDP_DOWNSCALE_BLUR;
-	}
-
-	regs->op |= (PPP_OP_SCALE_Y_ON | PPP_OP_SCALE_X_ON);
-}
-
-
-#define IMG_LEN(rect_h, w, rect_w, bpp) (((rect_h) * w) * bpp)
-
-#define Y_TO_CRCB_RATIO(format) \
-	((format == MDP_Y_CBCR_H2V2 || format == MDP_Y_CRCB_H2V2) ?  2 :\
-	 (format == MDP_Y_CBCR_H2V1 || format == MDP_Y_CRCB_H2V1) ?  1 : 1)
-
-static void get_len(struct mdp_img *img, struct mdp_rect *rect, uint32_t bpp,
-		    uint32_t *len0, uint32_t *len1)
-{
-	*len0 = IMG_LEN(rect->h, img->width, rect->w, bpp);
-	if (IS_PSEUDOPLNR(img->format))
-		*len1 = *len0/Y_TO_CRCB_RATIO(img->format);
-	else
-		*len1 = 0;
-}
-
-static int valid_src_dst(unsigned long src_start, unsigned long src_len,
-			 unsigned long dst_start, unsigned long dst_len,
-			 struct mdp_blit_req *req, struct mdp_regs *regs)
-{
-	unsigned long src_min_ok = src_start;
-	unsigned long src_max_ok = src_start + src_len;
-	unsigned long dst_min_ok = dst_start;
-	unsigned long dst_max_ok = dst_start + dst_len;
-	uint32_t src0_len, src1_len, dst0_len, dst1_len;
-	get_len(&req->src, &req->src_rect, regs->src_bpp, &src0_len,
-		 &src1_len);
-	get_len(&req->dst, &req->dst_rect, regs->dst_bpp, &dst0_len,
-		 &dst1_len);
-
-	if (regs->src0 < src_min_ok || regs->src0 > src_max_ok ||
-	    regs->src0 + src0_len > src_max_ok) {
-		DLOG("invalid_src %x %x %lx %lx\n", regs->src0,
-		      src0_len, src_min_ok, src_max_ok);
-		return 0;
-	}
-	if (regs->src_cfg & PPP_SRC_PLANE_PSEUDOPLNR) {
-		if (regs->src1 < src_min_ok || regs->src1 > src_max_ok ||
-		    regs->src1 + src1_len > src_max_ok) {
-			DLOG("invalid_src1");
-			return 0;
-		}
-	}
-	if (regs->dst0 < dst_min_ok || regs->dst0 > dst_max_ok ||
-	    regs->dst0 + dst0_len > dst_max_ok) {
-		DLOG("invalid_dst");
-		return 0;
-	}
-	if (regs->dst_cfg & PPP_SRC_PLANE_PSEUDOPLNR) {
-		if (regs->dst1 < dst_min_ok || regs->dst1 > dst_max_ok ||
-		    regs->dst1 + dst1_len > dst_max_ok) {
-			DLOG("invalid_dst1");
-			return 0;
-		}
-	}
-	return 1;
-}
-
-
-static void flush_imgs(struct mdp_blit_req *req, struct mdp_regs *regs,
-		       struct file *src_file, struct file *dst_file)
-{
-}
-
-static void get_chroma_addr(struct mdp_img *img, struct mdp_rect *rect,
-			    uint32_t base, uint32_t bpp, uint32_t cfg,
-			    uint32_t *addr, uint32_t *ystride)
-{
-	uint32_t compress_v = Y_TO_CRCB_RATIO(img->format);
-	uint32_t compress_h = 2;
-	uint32_t  offset;
-
-	if (IS_PSEUDOPLNR(img->format)) {
-		offset = (rect->x / compress_h) * compress_h;
-		offset += rect->y == 0 ? 0 :
-			  ((rect->y + 1) / compress_v) * img->width;
-		*addr = base + (img->width * img->height * bpp);
-		*addr += offset * bpp;
-		*ystride |= *ystride << 16;
-	} else {
-		*addr = 0;
-	}
-}
-
-static int send_blit(const struct mdp_info *mdp, struct mdp_blit_req *req,
-		     struct mdp_regs *regs, struct file *src_file,
-		     struct file *dst_file)
-{
-	mdp_writel(mdp, 1, 0x060);
-	mdp_writel(mdp, regs->src_rect, PPP_ADDR_SRC_ROI);
-	mdp_writel(mdp, regs->src0, PPP_ADDR_SRC0);
-	mdp_writel(mdp, regs->src1, PPP_ADDR_SRC1);
-	mdp_writel(mdp, regs->src_ystride, PPP_ADDR_SRC_YSTRIDE);
-	mdp_writel(mdp, regs->src_cfg, PPP_ADDR_SRC_CFG);
-	mdp_writel(mdp, regs->src_pack, PPP_ADDR_SRC_PACK_PATTERN);
-
-	mdp_writel(mdp, regs->op, PPP_ADDR_OPERATION);
-	mdp_writel(mdp, regs->phasex_init, PPP_ADDR_PHASEX_INIT);
-	mdp_writel(mdp, regs->phasey_init, PPP_ADDR_PHASEY_INIT);
-	mdp_writel(mdp, regs->phasex_step, PPP_ADDR_PHASEX_STEP);
-	mdp_writel(mdp, regs->phasey_step, PPP_ADDR_PHASEY_STEP);
-
-	mdp_writel(mdp, (req->alpha << 24) | (req->transp_mask & 0xffffff),
-	       PPP_ADDR_ALPHA_TRANSP);
-
-	mdp_writel(mdp, regs->dst_cfg, PPP_ADDR_DST_CFG);
-	mdp_writel(mdp, regs->dst_pack, PPP_ADDR_DST_PACK_PATTERN);
-	mdp_writel(mdp, regs->dst_rect, PPP_ADDR_DST_ROI);
-	mdp_writel(mdp, regs->dst0, PPP_ADDR_DST0);
-	mdp_writel(mdp, regs->dst1, PPP_ADDR_DST1);
-	mdp_writel(mdp, regs->dst_ystride, PPP_ADDR_DST_YSTRIDE);
-
-	mdp_writel(mdp, regs->edge, PPP_ADDR_EDGE);
-	if (regs->op & PPP_OP_BLEND_ON) {
-		mdp_writel(mdp, regs->dst0, PPP_ADDR_BG0);
-		mdp_writel(mdp, regs->dst1, PPP_ADDR_BG1);
-		mdp_writel(mdp, regs->dst_ystride, PPP_ADDR_BG_YSTRIDE);
-		mdp_writel(mdp, src_img_cfg[req->dst.format], PPP_ADDR_BG_CFG);
-		mdp_writel(mdp, pack_pattern[req->dst.format],
-			   PPP_ADDR_BG_PACK_PATTERN);
-	}
-	flush_imgs(req, regs, src_file, dst_file);
-	mdp_writel(mdp, 0x1000, MDP_DISPLAY0_START);
-	return 0;
-}
-
-int mdp_ppp_blit(const struct mdp_info *mdp, struct mdp_blit_req *req,
-		 struct file *src_file, unsigned long src_start, unsigned long src_len,
-		 struct file *dst_file, unsigned long dst_start, unsigned long dst_len)
-{
-	struct mdp_regs regs = {0};
-
-	if (unlikely(req->src.format >= MDP_IMGTYPE_LIMIT ||
-		     req->dst.format >= MDP_IMGTYPE_LIMIT)) {
-		printk(KERN_ERR "mpd_ppp: img is of wrong format\n");
-		return -EINVAL;
-	}
-
-	if (unlikely(req->src_rect.x > req->src.width ||
-		     req->src_rect.y > req->src.height ||
-		     req->dst_rect.x > req->dst.width ||
-		     req->dst_rect.y > req->dst.height)) {
-		printk(KERN_ERR "mpd_ppp: img rect is outside of img!\n");
-		return -EINVAL;
-	}
-
-	/* set the src image configuration */
-	regs.src_cfg = src_img_cfg[req->src.format];
-	regs.src_cfg |= (req->src_rect.x & 0x1) ? PPP_SRC_BPP_ROI_ODD_X : 0;
-	regs.src_cfg |= (req->src_rect.y & 0x1) ? PPP_SRC_BPP_ROI_ODD_Y : 0;
-	regs.src_rect = (req->src_rect.h << 16) | req->src_rect.w;
-	regs.src_pack = pack_pattern[req->src.format];
-
-	/* set the dest image configuration */
-	regs.dst_cfg = dst_img_cfg[req->dst.format] | PPP_DST_OUT_SEL_AXI;
-	regs.dst_rect = (req->dst_rect.h << 16) | req->dst_rect.w;
-	regs.dst_pack = pack_pattern[req->dst.format];
-
-	/* set src, bpp, start pixel and ystride */
-	regs.src_bpp = bytes_per_pixel[req->src.format];
-	regs.src0 = src_start + req->src.offset;
-	regs.src_ystride = req->src.width * regs.src_bpp;
-	get_chroma_addr(&req->src, &req->src_rect, regs.src0, regs.src_bpp,
-			regs.src_cfg, &regs.src1, &regs.src_ystride);
-	regs.src0 += (req->src_rect.x + (req->src_rect.y * req->src.width)) *
-		      regs.src_bpp;
-
-	/* set dst, bpp, start pixel and ystride */
-	regs.dst_bpp = bytes_per_pixel[req->dst.format];
-	regs.dst0 = dst_start + req->dst.offset;
-	regs.dst_ystride = req->dst.width * regs.dst_bpp;
-	get_chroma_addr(&req->dst, &req->dst_rect, regs.dst0, regs.dst_bpp,
-			regs.dst_cfg, &regs.dst1, &regs.dst_ystride);
-	regs.dst0 += (req->dst_rect.x + (req->dst_rect.y * req->dst.width)) *
-		      regs.dst_bpp;
-
-	if (!valid_src_dst(src_start, src_len, dst_start, dst_len, req,
-			   &regs)) {
-		printk(KERN_ERR "mpd_ppp: final src or dst location is "
-			"invalid, are you trying to make an image too large "
-			"or to place it outside the screen?\n");
-		return -EINVAL;
-	}
-
-	/* set up operation register */
-	regs.op = 0;
-	blit_rotate(req, &regs);
-	blit_convert(req, &regs);
-	if (req->flags & MDP_DITHER)
-		regs.op |= PPP_OP_DITHER_EN;
-	blit_blend(req, &regs);
-	if (blit_scale(mdp, req, &regs)) {
-		printk(KERN_ERR "mpd_ppp: error computing scale for img.\n");
-		return -EINVAL;
-	}
-	blit_blur(mdp, req, &regs);
-	regs.op |= dst_op_chroma[req->dst.format] |
-		   src_op_chroma[req->src.format];
-
-	/* if the image is YCRYCB, the x and w must be even */
-	if (unlikely(req->src.format == MDP_YCRYCB_H2V1)) {
-		req->src_rect.x = req->src_rect.x & (~0x1);
-		req->src_rect.w = req->src_rect.w & (~0x1);
-		req->dst_rect.x = req->dst_rect.x & (~0x1);
-		req->dst_rect.w = req->dst_rect.w & (~0x1);
-	}
-	if (get_edge_cond(req, &regs))
-		return -EINVAL;
-
-	send_blit(mdp, req, &regs, src_file, dst_file);
-	return 0;
-}
diff --git a/drivers/video/fbdev/msm/mdp_scale_tables.c b/drivers/video/fbdev/msm/mdp_scale_tables.c
deleted file mode 100644
index 604783b2e17c..000000000000
--- a/drivers/video/fbdev/msm/mdp_scale_tables.c
+++ /dev/null
@@ -1,766 +0,0 @@
-/* drivers/video/msm_fb/mdp_scale_tables.c
- *
- * Copyright (C) 2007 QUALCOMM Incorporated
- * Copyright (C) 2007 Google Incorporated
- *
- * 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 "mdp_scale_tables.h"
-#include "mdp_hw.h"
-
-struct mdp_table_entry mdp_upscale_table[] = {
-	{ 0x5fffc, 0x0 },
-	{ 0x50200, 0x7fc00000 },
-	{ 0x5fffc, 0xff80000d },
-	{ 0x50204, 0x7ec003f9 },
-	{ 0x5fffc, 0xfec0001c },
-	{ 0x50208, 0x7d4003f3 },
-	{ 0x5fffc, 0xfe40002b },
-	{ 0x5020c, 0x7b8003ed },
-	{ 0x5fffc, 0xfd80003c },
-	{ 0x50210, 0x794003e8 },
-	{ 0x5fffc, 0xfcc0004d },
-	{ 0x50214, 0x76c003e4 },
-	{ 0x5fffc, 0xfc40005f },
-	{ 0x50218, 0x73c003e0 },
-	{ 0x5fffc, 0xfb800071 },
-	{ 0x5021c, 0x708003de },
-	{ 0x5fffc, 0xfac00085 },
-	{ 0x50220, 0x6d0003db },
-	{ 0x5fffc, 0xfa000098 },
-	{ 0x50224, 0x698003d9 },
-	{ 0x5fffc, 0xf98000ac },
-	{ 0x50228, 0x654003d8 },
-	{ 0x5fffc, 0xf8c000c1 },
-	{ 0x5022c, 0x610003d7 },
-	{ 0x5fffc, 0xf84000d5 },
-	{ 0x50230, 0x5c8003d7 },
-	{ 0x5fffc, 0xf7c000e9 },
-	{ 0x50234, 0x580003d7 },
-	{ 0x5fffc, 0xf74000fd },
-	{ 0x50238, 0x534003d8 },
-	{ 0x5fffc, 0xf6c00112 },
-	{ 0x5023c, 0x4e8003d8 },
-	{ 0x5fffc, 0xf6800126 },
-	{ 0x50240, 0x494003da },
-	{ 0x5fffc, 0xf600013a },
-	{ 0x50244, 0x448003db },
-	{ 0x5fffc, 0xf600014d },
-	{ 0x50248, 0x3f4003dd },
-	{ 0x5fffc, 0xf5c00160 },
-	{ 0x5024c, 0x3a4003df },
-	{ 0x5fffc, 0xf5c00172 },
-	{ 0x50250, 0x354003e1 },
-	{ 0x5fffc, 0xf5c00184 },
-	{ 0x50254, 0x304003e3 },
-	{ 0x5fffc, 0xf6000195 },
-	{ 0x50258, 0x2b0003e6 },
-	{ 0x5fffc, 0xf64001a6 },
-	{ 0x5025c, 0x260003e8 },
-	{ 0x5fffc, 0xf6c001b4 },
-	{ 0x50260, 0x214003eb },
-	{ 0x5fffc, 0xf78001c2 },
-	{ 0x50264, 0x1c4003ee },
-	{ 0x5fffc, 0xf80001cf },
-	{ 0x50268, 0x17c003f1 },
-	{ 0x5fffc, 0xf90001db },
-	{ 0x5026c, 0x134003f3 },
-	{ 0x5fffc, 0xfa0001e5 },
-	{ 0x50270, 0xf0003f6 },
-	{ 0x5fffc, 0xfb4001ee },
-	{ 0x50274, 0xac003f9 },
-	{ 0x5fffc, 0xfcc001f5 },
-	{ 0x50278, 0x70003fb },
-	{ 0x5fffc, 0xfe4001fb },
-	{ 0x5027c, 0x34003fe },
-};
-
-static struct mdp_table_entry mdp_downscale_x_table_PT2TOPT4[] = {
-	{ 0x5fffc, 0x740008c },
-	{ 0x50280, 0x33800088 },
-	{ 0x5fffc, 0x800008e },
-	{ 0x50284, 0x33400084 },
-	{ 0x5fffc, 0x8400092 },
-	{ 0x50288, 0x33000080 },
-	{ 0x5fffc, 0x9000094 },
-	{ 0x5028c, 0x3300007b },
-	{ 0x5fffc, 0x9c00098 },
-	{ 0x50290, 0x32400077 },
-	{ 0x5fffc, 0xa40009b },
-	{ 0x50294, 0x32000073 },
-	{ 0x5fffc, 0xb00009d },
-	{ 0x50298,  0x31c0006f },
-	{ 0x5fffc,  0xbc000a0 },
-	{ 0x5029c,  0x3140006b },
-	{ 0x5fffc,  0xc8000a2 },
-	{ 0x502a0,  0x31000067 },
-	{ 0x5fffc,  0xd8000a5 },
-	{ 0x502a4,  0x30800062 },
-	{ 0x5fffc,  0xe4000a8 },
-	{ 0x502a8,  0x2fc0005f },
-	{ 0x5fffc,  0xec000aa },
-	{ 0x502ac,  0x2fc0005b },
-	{ 0x5fffc,  0xf8000ad },
-	{ 0x502b0,  0x2f400057 },
-	{ 0x5fffc,  0x108000b0 },
-	{ 0x502b4,  0x2e400054 },
-	{ 0x5fffc,  0x114000b2 },
-	{ 0x502b8,  0x2e000050 },
-	{ 0x5fffc,  0x124000b4 },
-	{ 0x502bc,  0x2d80004c },
-	{ 0x5fffc,  0x130000b6 },
-	{ 0x502c0,  0x2d000049 },
-	{ 0x5fffc,  0x140000b8 },
-	{ 0x502c4,  0x2c800045 },
-	{ 0x5fffc,  0x150000b9 },
-	{ 0x502c8,  0x2c000042 },
-	{ 0x5fffc,  0x15c000bd },
-	{ 0x502cc,  0x2b40003e },
-	{ 0x5fffc,  0x16c000bf },
-	{ 0x502d0,  0x2a80003b },
-	{ 0x5fffc,  0x17c000bf },
-	{ 0x502d4,  0x2a000039 },
-	{ 0x5fffc,  0x188000c2 },
-	{ 0x502d8,  0x29400036 },
-	{ 0x5fffc,  0x19c000c4 },
-	{ 0x502dc,  0x28800032 },
-	{ 0x5fffc,  0x1ac000c5 },
-	{ 0x502e0,  0x2800002f },
-	{ 0x5fffc,  0x1bc000c7 },
-	{ 0x502e4,  0x2740002c },
-	{ 0x5fffc,  0x1cc000c8 },
-	{ 0x502e8,  0x26c00029 },
-	{ 0x5fffc,  0x1dc000c9 },
-	{ 0x502ec,  0x26000027 },
-	{ 0x5fffc,  0x1ec000cc },
-	{ 0x502f0,  0x25000024 },
-	{ 0x5fffc,  0x200000cc },
-	{ 0x502f4,  0x24800021 },
-	{ 0x5fffc,  0x210000cd },
-	{ 0x502f8,  0x23800020 },
-	{ 0x5fffc,  0x220000ce },
-	{ 0x502fc,  0x2300001d },
-};
-
-static struct mdp_table_entry mdp_downscale_x_table_PT4TOPT6[] = {
-	{ 0x5fffc,  0x740008c },
-	{ 0x50280,  0x33800088 },
-	{ 0x5fffc,  0x800008e },
-	{ 0x50284,  0x33400084 },
-	{ 0x5fffc,  0x8400092 },
-	{ 0x50288,  0x33000080 },
-	{ 0x5fffc,  0x9000094 },
-	{ 0x5028c,  0x3300007b },
-	{ 0x5fffc,  0x9c00098 },
-	{ 0x50290,  0x32400077 },
-	{ 0x5fffc,  0xa40009b },
-	{ 0x50294,  0x32000073 },
-	{ 0x5fffc,  0xb00009d },
-	{ 0x50298,  0x31c0006f },
-	{ 0x5fffc,  0xbc000a0 },
-	{ 0x5029c,  0x3140006b },
-	{ 0x5fffc,  0xc8000a2 },
-	{ 0x502a0,  0x31000067 },
-	{ 0x5fffc,  0xd8000a5 },
-	{ 0x502a4,  0x30800062 },
-	{ 0x5fffc,  0xe4000a8 },
-	{ 0x502a8,  0x2fc0005f },
-	{ 0x5fffc,  0xec000aa },
-	{ 0x502ac,  0x2fc0005b },
-	{ 0x5fffc,  0xf8000ad },
-	{ 0x502b0,  0x2f400057 },
-	{ 0x5fffc,  0x108000b0 },
-	{ 0x502b4,  0x2e400054 },
-	{ 0x5fffc,  0x114000b2 },
-	{ 0x502b8,  0x2e000050 },
-	{ 0x5fffc,  0x124000b4 },
-	{ 0x502bc,  0x2d80004c },
-	{ 0x5fffc,  0x130000b6 },
-	{ 0x502c0,  0x2d000049 },
-	{ 0x5fffc,  0x140000b8 },
-	{ 0x502c4,  0x2c800045 },
-	{ 0x5fffc,  0x150000b9 },
-	{ 0x502c8,  0x2c000042 },
-	{ 0x5fffc,  0x15c000bd },
-	{ 0x502cc,  0x2b40003e },
-	{ 0x5fffc,  0x16c000bf },
-	{ 0x502d0,  0x2a80003b },
-	{ 0x5fffc,  0x17c000bf },
-	{ 0x502d4,  0x2a000039 },
-	{ 0x5fffc,  0x188000c2 },
-	{ 0x502d8,  0x29400036 },
-	{ 0x5fffc,  0x19c000c4 },
-	{ 0x502dc,  0x28800032 },
-	{ 0x5fffc,  0x1ac000c5 },
-	{ 0x502e0,  0x2800002f },
-	{ 0x5fffc,  0x1bc000c7 },
-	{ 0x502e4,  0x2740002c },
-	{ 0x5fffc,  0x1cc000c8 },
-	{ 0x502e8,  0x26c00029 },
-	{ 0x5fffc,  0x1dc000c9 },
-	{ 0x502ec,  0x26000027 },
-	{ 0x5fffc,  0x1ec000cc },
-	{ 0x502f0,  0x25000024 },
-	{ 0x5fffc,  0x200000cc },
-	{ 0x502f4,  0x24800021 },
-	{ 0x5fffc,  0x210000cd },
-	{ 0x502f8,  0x23800020 },
-	{ 0x5fffc,  0x220000ce },
-	{ 0x502fc,  0x2300001d },
-};
-
-static struct mdp_table_entry mdp_downscale_x_table_PT6TOPT8[] = {
-	{ 0x5fffc,  0xfe000070 },
-	{ 0x50280,  0x4bc00068 },
-	{ 0x5fffc,  0xfe000078 },
-	{ 0x50284,  0x4bc00060 },
-	{ 0x5fffc,  0xfe000080 },
-	{ 0x50288,  0x4b800059 },
-	{ 0x5fffc,  0xfe000089 },
-	{ 0x5028c,  0x4b000052 },
-	{ 0x5fffc,  0xfe400091 },
-	{ 0x50290,  0x4a80004b },
-	{ 0x5fffc,  0xfe40009a },
-	{ 0x50294,  0x4a000044 },
-	{ 0x5fffc,  0xfe8000a3 },
-	{ 0x50298,  0x4940003d },
-	{ 0x5fffc,  0xfec000ac },
-	{ 0x5029c,  0x48400037 },
-	{ 0x5fffc,  0xff0000b4 },
-	{ 0x502a0,  0x47800031 },
-	{ 0x5fffc,  0xff8000bd },
-	{ 0x502a4,  0x4640002b },
-	{ 0x5fffc,  0xc5 },
-	{ 0x502a8,  0x45000026 },
-	{ 0x5fffc,  0x8000ce },
-	{ 0x502ac,  0x43800021 },
-	{ 0x5fffc,  0x10000d6 },
-	{ 0x502b0,  0x4240001c },
-	{ 0x5fffc,  0x18000df },
-	{ 0x502b4,  0x40800018 },
-	{ 0x5fffc,  0x24000e6 },
-	{ 0x502b8,  0x3f000014 },
-	{ 0x5fffc,  0x30000ee },
-	{ 0x502bc,  0x3d400010 },
-	{ 0x5fffc,  0x40000f5 },
-	{ 0x502c0,  0x3b80000c },
-	{ 0x5fffc,  0x50000fc },
-	{ 0x502c4,  0x39800009 },
-	{ 0x5fffc,  0x6000102 },
-	{ 0x502c8,  0x37c00006 },
-	{ 0x5fffc,  0x7000109 },
-	{ 0x502cc,  0x35800004 },
-	{ 0x5fffc,  0x840010e },
-	{ 0x502d0,  0x33800002 },
-	{ 0x5fffc,  0x9800114 },
-	{ 0x502d4,  0x31400000 },
-	{ 0x5fffc,  0xac00119 },
-	{ 0x502d8,  0x2f4003fe },
-	{ 0x5fffc,  0xc40011e },
-	{ 0x502dc,  0x2d0003fc },
-	{ 0x5fffc,  0xdc00121 },
-	{ 0x502e0,  0x2b0003fb },
-	{ 0x5fffc,  0xf400125 },
-	{ 0x502e4,  0x28c003fa },
-	{ 0x5fffc,  0x11000128 },
-	{ 0x502e8,  0x268003f9 },
-	{ 0x5fffc,  0x12c0012a },
-	{ 0x502ec,  0x244003f9 },
-	{ 0x5fffc,  0x1480012c },
-	{ 0x502f0,  0x224003f8 },
-	{ 0x5fffc,  0x1640012e },
-	{ 0x502f4,  0x200003f8 },
-	{ 0x5fffc,  0x1800012f },
-	{ 0x502f8,  0x1e0003f8 },
-	{ 0x5fffc,  0x1a00012f },
-	{ 0x502fc,  0x1c0003f8 },
-};
-
-static struct mdp_table_entry mdp_downscale_x_table_PT8TO1[] = {
-	{ 0x5fffc,  0x0 },
-	{ 0x50280,  0x7fc00000 },
-	{ 0x5fffc,  0xff80000d },
-	{ 0x50284,  0x7ec003f9 },
-	{ 0x5fffc,  0xfec0001c },
-	{ 0x50288,  0x7d4003f3 },
-	{ 0x5fffc,  0xfe40002b },
-	{ 0x5028c,  0x7b8003ed },
-	{ 0x5fffc,  0xfd80003c },
-	{ 0x50290,  0x794003e8 },
-	{ 0x5fffc,  0xfcc0004d },
-	{ 0x50294,  0x76c003e4 },
-	{ 0x5fffc,  0xfc40005f },
-	{ 0x50298,  0x73c003e0 },
-	{ 0x5fffc,  0xfb800071 },
-	{ 0x5029c,  0x708003de },
-	{ 0x5fffc,  0xfac00085 },
-	{ 0x502a0,  0x6d0003db },
-	{ 0x5fffc,  0xfa000098 },
-	{ 0x502a4,  0x698003d9 },
-	{ 0x5fffc,  0xf98000ac },
-	{ 0x502a8,  0x654003d8 },
-	{ 0x5fffc,  0xf8c000c1 },
-	{ 0x502ac,  0x610003d7 },
-	{ 0x5fffc,  0xf84000d5 },
-	{ 0x502b0,  0x5c8003d7 },
-	{ 0x5fffc,  0xf7c000e9 },
-	{ 0x502b4,  0x580003d7 },
-	{ 0x5fffc,  0xf74000fd },
-	{ 0x502b8,  0x534003d8 },
-	{ 0x5fffc,  0xf6c00112 },
-	{ 0x502bc,  0x4e8003d8 },
-	{ 0x5fffc,  0xf6800126 },
-	{ 0x502c0,  0x494003da },
-	{ 0x5fffc,  0xf600013a },
-	{ 0x502c4,  0x448003db },
-	{ 0x5fffc,  0xf600014d },
-	{ 0x502c8,  0x3f4003dd },
-	{ 0x5fffc,  0xf5c00160 },
-	{ 0x502cc,  0x3a4003df },
-	{ 0x5fffc,  0xf5c00172 },
-	{ 0x502d0,  0x354003e1 },
-	{ 0x5fffc,  0xf5c00184 },
-	{ 0x502d4,  0x304003e3 },
-	{ 0x5fffc,  0xf6000195 },
-	{ 0x502d8,  0x2b0003e6 },
-	{ 0x5fffc,  0xf64001a6 },
-	{ 0x502dc,  0x260003e8 },
-	{ 0x5fffc,  0xf6c001b4 },
-	{ 0x502e0,  0x214003eb },
-	{ 0x5fffc,  0xf78001c2 },
-	{ 0x502e4,  0x1c4003ee },
-	{ 0x5fffc,  0xf80001cf },
-	{ 0x502e8,  0x17c003f1 },
-	{ 0x5fffc,  0xf90001db },
-	{ 0x502ec,  0x134003f3 },
-	{ 0x5fffc,  0xfa0001e5 },
-	{ 0x502f0,  0xf0003f6 },
-	{ 0x5fffc,  0xfb4001ee },
-	{ 0x502f4,  0xac003f9 },
-	{ 0x5fffc,  0xfcc001f5 },
-	{ 0x502f8,  0x70003fb },
-	{ 0x5fffc,  0xfe4001fb },
-	{ 0x502fc,  0x34003fe },
-};
-
-struct mdp_table_entry *mdp_downscale_x_table[MDP_DOWNSCALE_MAX] = {
-	[MDP_DOWNSCALE_PT2TOPT4] = mdp_downscale_x_table_PT2TOPT4,
-	[MDP_DOWNSCALE_PT4TOPT6] = mdp_downscale_x_table_PT4TOPT6,
-	[MDP_DOWNSCALE_PT6TOPT8] = mdp_downscale_x_table_PT6TOPT8,
-	[MDP_DOWNSCALE_PT8TO1]  = mdp_downscale_x_table_PT8TO1,
-};
-
-static struct mdp_table_entry mdp_downscale_y_table_PT2TOPT4[] = {
-	{ 0x5fffc,  0x740008c },
-	{ 0x50300,  0x33800088 },
-	{ 0x5fffc,  0x800008e },
-	{ 0x50304,  0x33400084 },
-	{ 0x5fffc,  0x8400092 },
-	{ 0x50308,  0x33000080 },
-	{ 0x5fffc,  0x9000094 },
-	{ 0x5030c,  0x3300007b },
-	{ 0x5fffc,  0x9c00098 },
-	{ 0x50310,  0x32400077 },
-	{ 0x5fffc,  0xa40009b },
-	{ 0x50314,  0x32000073 },
-	{ 0x5fffc,  0xb00009d },
-	{ 0x50318,  0x31c0006f },
-	{ 0x5fffc,  0xbc000a0 },
-	{ 0x5031c,  0x3140006b },
-	{ 0x5fffc,  0xc8000a2 },
-	{ 0x50320,  0x31000067 },
-	{ 0x5fffc,  0xd8000a5 },
-	{ 0x50324,  0x30800062 },
-	{ 0x5fffc,  0xe4000a8 },
-	{ 0x50328,  0x2fc0005f },
-	{ 0x5fffc,  0xec000aa },
-	{ 0x5032c,  0x2fc0005b },
-	{ 0x5fffc,  0xf8000ad },
-	{ 0x50330,  0x2f400057 },
-	{ 0x5fffc,  0x108000b0 },
-	{ 0x50334,  0x2e400054 },
-	{ 0x5fffc,  0x114000b2 },
-	{ 0x50338,  0x2e000050 },
-	{ 0x5fffc,  0x124000b4 },
-	{ 0x5033c,  0x2d80004c },
-	{ 0x5fffc,  0x130000b6 },
-	{ 0x50340,  0x2d000049 },
-	{ 0x5fffc,  0x140000b8 },
-	{ 0x50344,  0x2c800045 },
-	{ 0x5fffc,  0x150000b9 },
-	{ 0x50348,  0x2c000042 },
-	{ 0x5fffc,  0x15c000bd },
-	{ 0x5034c,  0x2b40003e },
-	{ 0x5fffc,  0x16c000bf },
-	{ 0x50350,  0x2a80003b },
-	{ 0x5fffc,  0x17c000bf },
-	{ 0x50354,  0x2a000039 },
-	{ 0x5fffc,  0x188000c2 },
-	{ 0x50358,  0x29400036 },
-	{ 0x5fffc,  0x19c000c4 },
-	{ 0x5035c,  0x28800032 },
-	{ 0x5fffc,  0x1ac000c5 },
-	{ 0x50360,  0x2800002f },
-	{ 0x5fffc,  0x1bc000c7 },
-	{ 0x50364,  0x2740002c },
-	{ 0x5fffc,  0x1cc000c8 },
-	{ 0x50368,  0x26c00029 },
-	{ 0x5fffc,  0x1dc000c9 },
-	{ 0x5036c,  0x26000027 },
-	{ 0x5fffc,  0x1ec000cc },
-	{ 0x50370,  0x25000024 },
-	{ 0x5fffc,  0x200000cc },
-	{ 0x50374,  0x24800021 },
-	{ 0x5fffc,  0x210000cd },
-	{ 0x50378,  0x23800020 },
-	{ 0x5fffc,  0x220000ce },
-	{ 0x5037c,  0x2300001d },
-};
-
-static struct mdp_table_entry mdp_downscale_y_table_PT4TOPT6[] = {
-	{ 0x5fffc,  0x740008c },
-	{ 0x50300,  0x33800088 },
-	{ 0x5fffc,  0x800008e },
-	{ 0x50304,  0x33400084 },
-	{ 0x5fffc,  0x8400092 },
-	{ 0x50308,  0x33000080 },
-	{ 0x5fffc,  0x9000094 },
-	{ 0x5030c,  0x3300007b },
-	{ 0x5fffc,  0x9c00098 },
-	{ 0x50310,  0x32400077 },
-	{ 0x5fffc,  0xa40009b },
-	{ 0x50314,  0x32000073 },
-	{ 0x5fffc,  0xb00009d },
-	{ 0x50318,  0x31c0006f },
-	{ 0x5fffc,  0xbc000a0 },
-	{ 0x5031c,  0x3140006b },
-	{ 0x5fffc,  0xc8000a2 },
-	{ 0x50320,  0x31000067 },
-	{ 0x5fffc,  0xd8000a5 },
-	{ 0x50324,  0x30800062 },
-	{ 0x5fffc,  0xe4000a8 },
-	{ 0x50328,  0x2fc0005f },
-	{ 0x5fffc,  0xec000aa },
-	{ 0x5032c,  0x2fc0005b },
-	{ 0x5fffc,  0xf8000ad },
-	{ 0x50330,  0x2f400057 },
-	{ 0x5fffc,  0x108000b0 },
-	{ 0x50334,  0x2e400054 },
-	{ 0x5fffc,  0x114000b2 },
-	{ 0x50338,  0x2e000050 },
-	{ 0x5fffc,  0x124000b4 },
-	{ 0x5033c,  0x2d80004c },
-	{ 0x5fffc,  0x130000b6 },
-	{ 0x50340,  0x2d000049 },
-	{ 0x5fffc,  0x140000b8 },
-	{ 0x50344,  0x2c800045 },
-	{ 0x5fffc,  0x150000b9 },
-	{ 0x50348,  0x2c000042 },
-	{ 0x5fffc,  0x15c000bd },
-	{ 0x5034c,  0x2b40003e },
-	{ 0x5fffc,  0x16c000bf },
-	{ 0x50350,  0x2a80003b },
-	{ 0x5fffc,  0x17c000bf },
-	{ 0x50354,  0x2a000039 },
-	{ 0x5fffc,  0x188000c2 },
-	{ 0x50358,  0x29400036 },
-	{ 0x5fffc,  0x19c000c4 },
-	{ 0x5035c,  0x28800032 },
-	{ 0x5fffc,  0x1ac000c5 },
-	{ 0x50360,  0x2800002f },
-	{ 0x5fffc,  0x1bc000c7 },
-	{ 0x50364,  0x2740002c },
-	{ 0x5fffc,  0x1cc000c8 },
-	{ 0x50368,  0x26c00029 },
-	{ 0x5fffc,  0x1dc000c9 },
-	{ 0x5036c,  0x26000027 },
-	{ 0x5fffc,  0x1ec000cc },
-	{ 0x50370,  0x25000024 },
-	{ 0x5fffc,  0x200000cc },
-	{ 0x50374,  0x24800021 },
-	{ 0x5fffc,  0x210000cd },
-	{ 0x50378,  0x23800020 },
-	{ 0x5fffc,  0x220000ce },
-	{ 0x5037c,  0x2300001d },
-};
-
-static struct mdp_table_entry mdp_downscale_y_table_PT6TOPT8[] = {
-	{ 0x5fffc,  0xfe000070 },
-	{ 0x50300,  0x4bc00068 },
-	{ 0x5fffc,  0xfe000078 },
-	{ 0x50304,  0x4bc00060 },
-	{ 0x5fffc,  0xfe000080 },
-	{ 0x50308,  0x4b800059 },
-	{ 0x5fffc,  0xfe000089 },
-	{ 0x5030c,  0x4b000052 },
-	{ 0x5fffc,  0xfe400091 },
-	{ 0x50310,  0x4a80004b },
-	{ 0x5fffc,  0xfe40009a },
-	{ 0x50314,  0x4a000044 },
-	{ 0x5fffc,  0xfe8000a3 },
-	{ 0x50318,  0x4940003d },
-	{ 0x5fffc,  0xfec000ac },
-	{ 0x5031c,  0x48400037 },
-	{ 0x5fffc,  0xff0000b4 },
-	{ 0x50320,  0x47800031 },
-	{ 0x5fffc,  0xff8000bd },
-	{ 0x50324,  0x4640002b },
-	{ 0x5fffc,  0xc5 },
-	{ 0x50328,  0x45000026 },
-	{ 0x5fffc,  0x8000ce },
-	{ 0x5032c,  0x43800021 },
-	{ 0x5fffc,  0x10000d6 },
-	{ 0x50330,  0x4240001c },
-	{ 0x5fffc,  0x18000df },
-	{ 0x50334,  0x40800018 },
-	{ 0x5fffc,  0x24000e6 },
-	{ 0x50338,  0x3f000014 },
-	{ 0x5fffc,  0x30000ee },
-	{ 0x5033c,  0x3d400010 },
-	{ 0x5fffc,  0x40000f5 },
-	{ 0x50340,  0x3b80000c },
-	{ 0x5fffc,  0x50000fc },
-	{ 0x50344,  0x39800009 },
-	{ 0x5fffc,  0x6000102 },
-	{ 0x50348,  0x37c00006 },
-	{ 0x5fffc,  0x7000109 },
-	{ 0x5034c,  0x35800004 },
-	{ 0x5fffc,  0x840010e },
-	{ 0x50350,  0x33800002 },
-	{ 0x5fffc,  0x9800114 },
-	{ 0x50354,  0x31400000 },
-	{ 0x5fffc,  0xac00119 },
-	{ 0x50358,  0x2f4003fe },
-	{ 0x5fffc,  0xc40011e },
-	{ 0x5035c,  0x2d0003fc },
-	{ 0x5fffc,  0xdc00121 },
-	{ 0x50360,  0x2b0003fb },
-	{ 0x5fffc,  0xf400125 },
-	{ 0x50364,  0x28c003fa },
-	{ 0x5fffc,  0x11000128 },
-	{ 0x50368,  0x268003f9 },
-	{ 0x5fffc,  0x12c0012a },
-	{ 0x5036c,  0x244003f9 },
-	{ 0x5fffc,  0x1480012c },
-	{ 0x50370,  0x224003f8 },
-	{ 0x5fffc,  0x1640012e },
-	{ 0x50374,  0x200003f8 },
-	{ 0x5fffc,  0x1800012f },
-	{ 0x50378,  0x1e0003f8 },
-	{ 0x5fffc,  0x1a00012f },
-	{ 0x5037c,  0x1c0003f8 },
-};
-
-static struct mdp_table_entry mdp_downscale_y_table_PT8TO1[] = {
-	{ 0x5fffc,  0x0 },
-	{ 0x50300,  0x7fc00000 },
-	{ 0x5fffc,  0xff80000d },
-	{ 0x50304,  0x7ec003f9 },
-	{ 0x5fffc,  0xfec0001c },
-	{ 0x50308,  0x7d4003f3 },
-	{ 0x5fffc,  0xfe40002b },
-	{ 0x5030c,  0x7b8003ed },
-	{ 0x5fffc,  0xfd80003c },
-	{ 0x50310,  0x794003e8 },
-	{ 0x5fffc,  0xfcc0004d },
-	{ 0x50314,  0x76c003e4 },
-	{ 0x5fffc,  0xfc40005f },
-	{ 0x50318,  0x73c003e0 },
-	{ 0x5fffc,  0xfb800071 },
-	{ 0x5031c,  0x708003de },
-	{ 0x5fffc,  0xfac00085 },
-	{ 0x50320,  0x6d0003db },
-	{ 0x5fffc,  0xfa000098 },
-	{ 0x50324,  0x698003d9 },
-	{ 0x5fffc,  0xf98000ac },
-	{ 0x50328,  0x654003d8 },
-	{ 0x5fffc,  0xf8c000c1 },
-	{ 0x5032c,  0x610003d7 },
-	{ 0x5fffc,  0xf84000d5 },
-	{ 0x50330,  0x5c8003d7 },
-	{ 0x5fffc,  0xf7c000e9 },
-	{ 0x50334,  0x580003d7 },
-	{ 0x5fffc,  0xf74000fd },
-	{ 0x50338,  0x534003d8 },
-	{ 0x5fffc,  0xf6c00112 },
-	{ 0x5033c,  0x4e8003d8 },
-	{ 0x5fffc,  0xf6800126 },
-	{ 0x50340,  0x494003da },
-	{ 0x5fffc,  0xf600013a },
-	{ 0x50344,  0x448003db },
-	{ 0x5fffc,  0xf600014d },
-	{ 0x50348,  0x3f4003dd },
-	{ 0x5fffc,  0xf5c00160 },
-	{ 0x5034c,  0x3a4003df },
-	{ 0x5fffc,  0xf5c00172 },
-	{ 0x50350,  0x354003e1 },
-	{ 0x5fffc,  0xf5c00184 },
-	{ 0x50354,  0x304003e3 },
-	{ 0x5fffc,  0xf6000195 },
-	{ 0x50358,  0x2b0003e6 },
-	{ 0x5fffc,  0xf64001a6 },
-	{ 0x5035c,  0x260003e8 },
-	{ 0x5fffc,  0xf6c001b4 },
-	{ 0x50360,  0x214003eb },
-	{ 0x5fffc,  0xf78001c2 },
-	{ 0x50364,  0x1c4003ee },
-	{ 0x5fffc,  0xf80001cf },
-	{ 0x50368,  0x17c003f1 },
-	{ 0x5fffc,  0xf90001db },
-	{ 0x5036c,  0x134003f3 },
-	{ 0x5fffc,  0xfa0001e5 },
-	{ 0x50370,  0xf0003f6 },
-	{ 0x5fffc,  0xfb4001ee },
-	{ 0x50374,  0xac003f9 },
-	{ 0x5fffc,  0xfcc001f5 },
-	{ 0x50378,  0x70003fb },
-	{ 0x5fffc,  0xfe4001fb },
-	{ 0x5037c,  0x34003fe },
-};
-
-struct mdp_table_entry *mdp_downscale_y_table[MDP_DOWNSCALE_MAX] = {
-	[MDP_DOWNSCALE_PT2TOPT4] = mdp_downscale_y_table_PT2TOPT4,
-	[MDP_DOWNSCALE_PT4TOPT6] = mdp_downscale_y_table_PT4TOPT6,
-	[MDP_DOWNSCALE_PT6TOPT8] = mdp_downscale_y_table_PT6TOPT8,
-	[MDP_DOWNSCALE_PT8TO1]  = mdp_downscale_y_table_PT8TO1,
-};
-
-struct mdp_table_entry mdp_gaussian_blur_table[] = {
-	/* max variance */
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50280, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50284, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50288, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x5028c, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50290, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50294, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50298, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x5029c, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x502a0, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x502a4, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x502a8, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x502ac, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x502b0, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x502b4, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x502b8, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x502bc, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x502c0, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x502c4, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x502c8, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x502cc, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x502d0, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x502d4, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x502d8, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x502dc, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x502e0, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x502e4, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x502e8, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x502ec, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x502f0, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x502f4, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x502f8, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x502fc, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50300, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50304, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50308, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x5030c, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50310, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50314, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50318, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x5031c, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50320, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50324, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50328, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x5032c, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50330, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50334, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50338, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x5033c, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50340, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50344, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50348, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x5034c, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50350, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50354, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50358, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x5035c, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50360, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50364, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50368, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x5036c, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50370, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50374, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x50378, 0x20000080 },
-	{ 0x5fffc, 0x20000080 },
-	{ 0x5037c, 0x20000080 },
-};
diff --git a/drivers/video/fbdev/msm/mdp_scale_tables.h b/drivers/video/fbdev/msm/mdp_scale_tables.h
deleted file mode 100644
index 34077b1af603..000000000000
--- a/drivers/video/fbdev/msm/mdp_scale_tables.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* drivers/video/msm_fb/mdp_scale_tables.h
- *
- * Copyright (C) 2007 QUALCOMM Incorporated
- * Copyright (C) 2007 Google Incorporated
- *
- * 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.
- */
-#ifndef _MDP_SCALE_TABLES_H_
-#define _MDP_SCALE_TABLES_H_
-
-#include <linux/types.h>
-struct mdp_table_entry {
-	uint32_t reg;
-	uint32_t val;
-};
-
-extern struct mdp_table_entry mdp_upscale_table[64];
-
-enum {
-	MDP_DOWNSCALE_PT2TOPT4,
-	MDP_DOWNSCALE_PT4TOPT6,
-	MDP_DOWNSCALE_PT6TOPT8,
-	MDP_DOWNSCALE_PT8TO1,
-	MDP_DOWNSCALE_MAX,
-};
-
-extern struct mdp_table_entry *mdp_downscale_x_table[MDP_DOWNSCALE_MAX];
-extern struct mdp_table_entry *mdp_downscale_y_table[MDP_DOWNSCALE_MAX];
-extern struct mdp_table_entry mdp_gaussian_blur_table[];
-
-#endif
diff --git a/drivers/video/fbdev/msm/msm_fb.c b/drivers/video/fbdev/msm/msm_fb.c
deleted file mode 100644
index 2979d7e72126..000000000000
--- a/drivers/video/fbdev/msm/msm_fb.c
+++ /dev/null
@@ -1,659 +0,0 @@
-/* drivers/video/msm/msm_fb.c
- *
- * Core MSM framebuffer driver.
- *
- * Copyright (C) 2007 Google Incorporated
- *
- * 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/platform_device.h>
-#include <linux/module.h>
-#include <linux/fb.h>
-#include <linux/slab.h>
-#include <linux/delay.h>
-
-#include <linux/freezer.h>
-#include <linux/wait.h>
-#include <linux/msm_mdp.h>
-#include <linux/io.h>
-#include <linux/uaccess.h>
-#include <linux/platform_data/video-msm_fb.h>
-#include <linux/workqueue.h>
-#include <linux/clk.h>
-#include <linux/debugfs.h>
-#include <linux/dma-mapping.h>
-
-#define PRINT_FPS 0
-#define PRINT_BLIT_TIME 0
-
-#define SLEEPING 0x4
-#define UPDATING 0x3
-#define FULL_UPDATE_DONE 0x2
-#define WAKING 0x1
-#define AWAKE 0x0
-
-#define NONE 0
-#define SUSPEND_RESUME 0x1
-#define FPS 0x2
-#define BLIT_TIME 0x4
-#define SHOW_UPDATES 0x8
-
-#define DLOG(mask, fmt, args...) \
-do { \
-	if (msmfb_debug_mask & mask) \
-		printk(KERN_INFO "msmfb: "fmt, ##args); \
-} while (0)
-
-static int msmfb_debug_mask;
-module_param_named(msmfb_debug_mask, msmfb_debug_mask, int,
-		   S_IRUGO | S_IWUSR | S_IWGRP);
-
-struct mdp_device *mdp;
-
-struct msmfb_info {
-	struct fb_info *fb;
-	struct msm_panel_data *panel;
-	int xres;
-	int yres;
-	unsigned output_format;
-	unsigned yoffset;
-	unsigned frame_requested;
-	unsigned frame_done;
-	int sleeping;
-	unsigned update_frame;
-	struct {
-		int left;
-		int top;
-		int eright; /* exclusive */
-		int ebottom; /* exclusive */
-	} update_info;
-	char *black;
-
-	spinlock_t update_lock;
-	struct mutex panel_init_lock;
-	wait_queue_head_t frame_wq;
-	struct work_struct resume_work;
-	struct msmfb_callback dma_callback;
-	struct msmfb_callback vsync_callback;
-	struct hrtimer fake_vsync;
-	ktime_t vsync_request_time;
-};
-
-static int msmfb_open(struct fb_info *info, int user)
-{
-	return 0;
-}
-
-static int msmfb_release(struct fb_info *info, int user)
-{
-	return 0;
-}
-
-/* Called from dma interrupt handler, must not sleep */
-static void msmfb_handle_dma_interrupt(struct msmfb_callback *callback)
-{
-	unsigned long irq_flags;
-	struct msmfb_info *msmfb  = container_of(callback, struct msmfb_info,
-					       dma_callback);
-
-	spin_lock_irqsave(&msmfb->update_lock, irq_flags);
-	msmfb->frame_done = msmfb->frame_requested;
-	if (msmfb->sleeping == UPDATING &&
-	    msmfb->frame_done == msmfb->update_frame) {
-		DLOG(SUSPEND_RESUME, "full update completed\n");
-		schedule_work(&msmfb->resume_work);
-	}
-	spin_unlock_irqrestore(&msmfb->update_lock, irq_flags);
-	wake_up(&msmfb->frame_wq);
-}
-
-static int msmfb_start_dma(struct msmfb_info *msmfb)
-{
-	uint32_t x, y, w, h;
-	unsigned addr;
-	unsigned long irq_flags;
-	uint32_t yoffset;
-	s64 time_since_request;
-	struct msm_panel_data *panel = msmfb->panel;
-
-	spin_lock_irqsave(&msmfb->update_lock, irq_flags);
-	time_since_request = ktime_to_ns(ktime_sub(ktime_get(),
-			     msmfb->vsync_request_time));
-	if (time_since_request > 20 * NSEC_PER_MSEC) {
-		uint32_t us;
-		us = do_div(time_since_request, NSEC_PER_MSEC) / NSEC_PER_USEC;
-		printk(KERN_WARNING "msmfb_start_dma %lld.%03u ms after vsync "
-			"request\n", time_since_request, us);
-	}
-	if (msmfb->frame_done == msmfb->frame_requested) {
-		spin_unlock_irqrestore(&msmfb->update_lock, irq_flags);
-		return -1;
-	}
-	if (msmfb->sleeping == SLEEPING) {
-		DLOG(SUSPEND_RESUME, "tried to start dma while asleep\n");
-		spin_unlock_irqrestore(&msmfb->update_lock, irq_flags);
-		return -1;
-	}
-	x = msmfb->update_info.left;
-	y = msmfb->update_info.top;
-	w = msmfb->update_info.eright - x;
-	h = msmfb->update_info.ebottom - y;
-	yoffset = msmfb->yoffset;
-	msmfb->update_info.left = msmfb->xres + 1;
-	msmfb->update_info.top = msmfb->yres + 1;
-	msmfb->update_info.eright = 0;
-	msmfb->update_info.ebottom = 0;
-	if (unlikely(w > msmfb->xres || h > msmfb->yres ||
-		     w == 0 || h == 0)) {
-		printk(KERN_INFO "invalid update: %d %d %d "
-				"%d\n", x, y, w, h);
-		msmfb->frame_done = msmfb->frame_requested;
-		goto error;
-	}
-	spin_unlock_irqrestore(&msmfb->update_lock, irq_flags);
-
-	addr = ((msmfb->xres * (yoffset + y) + x) * 2);
-	mdp->dma(mdp, addr + msmfb->fb->fix.smem_start,
-		 msmfb->xres * 2, w, h, x, y, &msmfb->dma_callback,
-		 panel->interface_type);
-	return 0;
-error:
-	spin_unlock_irqrestore(&msmfb->update_lock, irq_flags);
-	/* some clients need to clear their vsync interrupt */
-	if (panel->clear_vsync)
-		panel->clear_vsync(panel);
-	wake_up(&msmfb->frame_wq);
-	return 0;
-}
-
-/* Called from esync interrupt handler, must not sleep */
-static void msmfb_handle_vsync_interrupt(struct msmfb_callback *callback)
-{
-	struct msmfb_info *msmfb = container_of(callback, struct msmfb_info,
-					       vsync_callback);
-	msmfb_start_dma(msmfb);
-}
-
-static enum hrtimer_restart msmfb_fake_vsync(struct hrtimer *timer)
-{
-	struct msmfb_info *msmfb  = container_of(timer, struct msmfb_info,
-					       fake_vsync);
-	msmfb_start_dma(msmfb);
-	return HRTIMER_NORESTART;
-}
-
-static void msmfb_pan_update(struct fb_info *info, uint32_t left, uint32_t top,
-			     uint32_t eright, uint32_t ebottom,
-			     uint32_t yoffset, int pan_display)
-{
-	struct msmfb_info *msmfb = info->par;
-	struct msm_panel_data *panel = msmfb->panel;
-	unsigned long irq_flags;
-	int sleeping;
-	int retry = 1;
-
-	DLOG(SHOW_UPDATES, "update %d %d %d %d %d %d\n",
-		left, top, eright, ebottom, yoffset, pan_display);
-restart:
-	spin_lock_irqsave(&msmfb->update_lock, irq_flags);
-
-	/* if we are sleeping, on a pan_display wait 10ms (to throttle back
-	 * drawing otherwise return */
-	if (msmfb->sleeping == SLEEPING) {
-		DLOG(SUSPEND_RESUME, "drawing while asleep\n");
-		spin_unlock_irqrestore(&msmfb->update_lock, irq_flags);
-		if (pan_display)
-			wait_event_interruptible_timeout(msmfb->frame_wq,
-				msmfb->sleeping != SLEEPING, HZ/10);
-		return;
-	}
-
-	sleeping = msmfb->sleeping;
-	/* on a full update, if the last frame has not completed, wait for it */
-	if ((pan_display && msmfb->frame_requested != msmfb->frame_done) ||
-			    sleeping == UPDATING) {
-		int ret;
-		spin_unlock_irqrestore(&msmfb->update_lock, irq_flags);
-		ret = wait_event_interruptible_timeout(msmfb->frame_wq,
-			msmfb->frame_done == msmfb->frame_requested &&
-			msmfb->sleeping != UPDATING, 5 * HZ);
-		if (ret <= 0 && (msmfb->frame_requested != msmfb->frame_done ||
-				 msmfb->sleeping == UPDATING)) {
-			if (retry && panel->request_vsync &&
-			    (sleeping == AWAKE)) {
-				panel->request_vsync(panel,
-					&msmfb->vsync_callback);
-				retry = 0;
-				printk(KERN_WARNING "msmfb_pan_display timeout "
-					"rerequest vsync\n");
-			} else {
-				printk(KERN_WARNING "msmfb_pan_display timeout "
-					"waiting for frame start, %d %d\n",
-					msmfb->frame_requested,
-					msmfb->frame_done);
-				return;
-			}
-		}
-		goto restart;
-	}
-
-
-	msmfb->frame_requested++;
-	/* if necessary, update the y offset, if this is the
-	 * first full update on resume, set the sleeping state */
-	if (pan_display) {
-		msmfb->yoffset = yoffset;
-		if (left == 0 && top == 0 && eright == info->var.xres &&
-		    ebottom == info->var.yres) {
-			if (sleeping == WAKING) {
-				msmfb->update_frame = msmfb->frame_requested;
-				DLOG(SUSPEND_RESUME, "full update starting\n");
-				msmfb->sleeping = UPDATING;
-			}
-		}
-	}
-
-	/* set the update request */
-	if (left < msmfb->update_info.left)
-		msmfb->update_info.left = left;
-	if (top < msmfb->update_info.top)
-		msmfb->update_info.top = top;
-	if (eright > msmfb->update_info.eright)
-		msmfb->update_info.eright = eright;
-	if (ebottom > msmfb->update_info.ebottom)
-		msmfb->update_info.ebottom = ebottom;
-	DLOG(SHOW_UPDATES, "update queued %d %d %d %d %d\n",
-		msmfb->update_info.left, msmfb->update_info.top,
-		msmfb->update_info.eright, msmfb->update_info.ebottom,
-		msmfb->yoffset);
-	spin_unlock_irqrestore(&msmfb->update_lock, irq_flags);
-
-	/* if the panel is all the way on wait for vsync, otherwise sleep
-	 * for 16 ms (long enough for the dma to panel) and then begin dma */
-	msmfb->vsync_request_time = ktime_get();
-	if (panel->request_vsync && (sleeping == AWAKE)) {
-		panel->request_vsync(panel, &msmfb->vsync_callback);
-	} else {
-		if (!hrtimer_active(&msmfb->fake_vsync)) {
-			hrtimer_start(&msmfb->fake_vsync,
-				      ktime_set(0, NSEC_PER_SEC/60),
-				      HRTIMER_MODE_REL);
-		}
-	}
-}
-
-static void msmfb_update(struct fb_info *info, uint32_t left, uint32_t top,
-			 uint32_t eright, uint32_t ebottom)
-{
-	msmfb_pan_update(info, left, top, eright, ebottom, 0, 0);
-}
-
-static void power_on_panel(struct work_struct *work)
-{
-	struct msmfb_info *msmfb =
-		container_of(work, struct msmfb_info, resume_work);
-	struct msm_panel_data *panel = msmfb->panel;
-	unsigned long irq_flags;
-
-	mutex_lock(&msmfb->panel_init_lock);
-	DLOG(SUSPEND_RESUME, "turning on panel\n");
-	if (msmfb->sleeping == UPDATING) {
-		if (panel->unblank(panel)) {
-			printk(KERN_INFO "msmfb: panel unblank failed,"
-			       "not starting drawing\n");
-			goto error;
-		}
-		spin_lock_irqsave(&msmfb->update_lock, irq_flags);
-		msmfb->sleeping = AWAKE;
-		wake_up(&msmfb->frame_wq);
-		spin_unlock_irqrestore(&msmfb->update_lock, irq_flags);
-	}
-error:
-	mutex_unlock(&msmfb->panel_init_lock);
-}
-
-
-static int msmfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
-{
-	if ((var->xres != info->var.xres) ||
-	    (var->yres != info->var.yres) ||
-	    (var->xres_virtual != info->var.xres_virtual) ||
-	    (var->yres_virtual != info->var.yres_virtual) ||
-	    (var->xoffset != info->var.xoffset) ||
-	    (var->bits_per_pixel != info->var.bits_per_pixel) ||
-	    (var->grayscale != info->var.grayscale))
-		 return -EINVAL;
-	return 0;
-}
-
-int msmfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
-{
-	struct msmfb_info *msmfb = info->par;
-	struct msm_panel_data *panel = msmfb->panel;
-
-	/* "UPDT" */
-	if ((panel->caps & MSMFB_CAP_PARTIAL_UPDATES) &&
-	    (var->reserved[0] == 0x54445055)) {
-		msmfb_pan_update(info, var->reserved[1] & 0xffff,
-				 var->reserved[1] >> 16,
-				 var->reserved[2] & 0xffff,
-				 var->reserved[2] >> 16, var->yoffset, 1);
-	} else {
-		msmfb_pan_update(info, 0, 0, info->var.xres, info->var.yres,
-				 var->yoffset, 1);
-	}
-	return 0;
-}
-
-static void msmfb_fillrect(struct fb_info *p, const struct fb_fillrect *rect)
-{
-	cfb_fillrect(p, rect);
-	msmfb_update(p, rect->dx, rect->dy, rect->dx + rect->width,
-		     rect->dy + rect->height);
-}
-
-static void msmfb_copyarea(struct fb_info *p, const struct fb_copyarea *area)
-{
-	cfb_copyarea(p, area);
-	msmfb_update(p, area->dx, area->dy, area->dx + area->width,
-		     area->dy + area->height);
-}
-
-static void msmfb_imageblit(struct fb_info *p, const struct fb_image *image)
-{
-	cfb_imageblit(p, image);
-	msmfb_update(p, image->dx, image->dy, image->dx + image->width,
-		     image->dy + image->height);
-}
-
-
-static int msmfb_blit(struct fb_info *info,
-		      void __user *p)
-{
-	struct mdp_blit_req req;
-	struct mdp_blit_req_list req_list;
-	int i;
-	int ret;
-
-	if (copy_from_user(&req_list, p, sizeof(req_list)))
-		return -EFAULT;
-
-	for (i = 0; i < req_list.count; i++) {
-		struct mdp_blit_req_list *list =
-			(struct mdp_blit_req_list *)p;
-		if (copy_from_user(&req, &list->req[i], sizeof(req)))
-			return -EFAULT;
-		ret = mdp->blit(mdp, info, &req);
-		if (ret)
-			return ret;
-	}
-	return 0;
-}
-
-
-DEFINE_MUTEX(mdp_ppp_lock);
-
-static int msmfb_ioctl(struct fb_info *p, unsigned int cmd, unsigned long arg)
-{
-	void __user *argp = (void __user *)arg;
-	int ret;
-
-	switch (cmd) {
-	case MSMFB_GRP_DISP:
-		mdp->set_grp_disp(mdp, arg);
-		break;
-	case MSMFB_BLIT:
-		ret = msmfb_blit(p, argp);
-		if (ret)
-			return ret;
-		break;
-	default:
-			printk(KERN_INFO "msmfb unknown ioctl: %d\n", cmd);
-			return -EINVAL;
-	}
-	return 0;
-}
-
-static struct fb_ops msmfb_ops = {
-	.owner = THIS_MODULE,
-	.fb_open = msmfb_open,
-	.fb_release = msmfb_release,
-	.fb_check_var = msmfb_check_var,
-	.fb_pan_display = msmfb_pan_display,
-	.fb_fillrect = msmfb_fillrect,
-	.fb_copyarea = msmfb_copyarea,
-	.fb_imageblit = msmfb_imageblit,
-	.fb_ioctl = msmfb_ioctl,
-};
-
-static unsigned PP[16];
-
-
-
-#define BITS_PER_PIXEL 16
-
-static void setup_fb_info(struct msmfb_info *msmfb)
-{
-	struct fb_info *fb_info = msmfb->fb;
-	int r;
-
-	/* finish setting up the fb_info struct */
-	strncpy(fb_info->fix.id, "msmfb", 16);
-	fb_info->fix.ypanstep = 1;
-
-	fb_info->fbops = &msmfb_ops;
-	fb_info->flags = FBINFO_DEFAULT;
-
-	fb_info->fix.type = FB_TYPE_PACKED_PIXELS;
-	fb_info->fix.visual = FB_VISUAL_TRUECOLOR;
-	fb_info->fix.line_length = msmfb->xres * 2;
-
-	fb_info->var.xres = msmfb->xres;
-	fb_info->var.yres = msmfb->yres;
-	fb_info->var.width = msmfb->panel->fb_data->width;
-	fb_info->var.height = msmfb->panel->fb_data->height;
-	fb_info->var.xres_virtual = msmfb->xres;
-	fb_info->var.yres_virtual = msmfb->yres * 2;
-	fb_info->var.bits_per_pixel = BITS_PER_PIXEL;
-	fb_info->var.accel_flags = 0;
-
-	fb_info->var.yoffset = 0;
-
-	if (msmfb->panel->caps & MSMFB_CAP_PARTIAL_UPDATES) {
-		/*
-		 * Set the param in the fixed screen, so userspace can't
-		 * change it. This will be used to check for the
-		 * capability.
-		 */
-		fb_info->fix.reserved[0] = 0x5444;
-		fb_info->fix.reserved[1] = 0x5055;
-
-		/*
-		 * This preloads the value so that if userspace doesn't
-		 * change it, it will be a full update
-		 */
-		fb_info->var.reserved[0] = 0x54445055;
-		fb_info->var.reserved[1] = 0;
-		fb_info->var.reserved[2] = (uint16_t)msmfb->xres |
-					   ((uint32_t)msmfb->yres << 16);
-	}
-
-	fb_info->var.red.offset = 11;
-	fb_info->var.red.length = 5;
-	fb_info->var.red.msb_right = 0;
-	fb_info->var.green.offset = 5;
-	fb_info->var.green.length = 6;
-	fb_info->var.green.msb_right = 0;
-	fb_info->var.blue.offset = 0;
-	fb_info->var.blue.length = 5;
-	fb_info->var.blue.msb_right = 0;
-
-	r = fb_alloc_cmap(&fb_info->cmap, 16, 0);
-	fb_info->pseudo_palette = PP;
-
-	PP[0] = 0;
-	for (r = 1; r < 16; r++)
-		PP[r] = 0xffffffff;
-}
-
-static int setup_fbmem(struct msmfb_info *msmfb, struct platform_device *pdev)
-{
-	struct fb_info *fb = msmfb->fb;
-	struct resource *resource;
-	unsigned long size = msmfb->xres * msmfb->yres *
-			     (BITS_PER_PIXEL >> 3) * 2;
-	unsigned char *fbram;
-
-	/* board file might have attached a resource describing an fb */
-	resource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!resource)
-		return -EINVAL;
-
-	/* check the resource is large enough to fit the fb */
-	if (resource->end - resource->start < size) {
-		printk(KERN_ERR "allocated resource is too small for "
-				"fb\n");
-		return -ENOMEM;
-	}
-	fb->fix.smem_start = resource->start;
-	fb->fix.smem_len = resource_size(resource);
-	fbram = ioremap(resource->start, resource_size(resource));
-	if (fbram == NULL) {
-		printk(KERN_ERR "msmfb: cannot allocate fbram!\n");
-		return -ENOMEM;
-	}
-	fb->screen_base = fbram;
-	return 0;
-}
-
-static int msmfb_probe(struct platform_device *pdev)
-{
-	struct fb_info *fb;
-	struct msmfb_info *msmfb;
-	struct msm_panel_data *panel = pdev->dev.platform_data;
-	int ret;
-
-	if (!panel) {
-		pr_err("msmfb_probe: no platform data\n");
-		return -EINVAL;
-	}
-	if (!panel->fb_data) {
-		pr_err("msmfb_probe: no fb_data\n");
-		return -EINVAL;
-	}
-
-	fb = framebuffer_alloc(sizeof(struct msmfb_info), &pdev->dev);
-	if (!fb)
-		return -ENOMEM;
-	msmfb = fb->par;
-	msmfb->fb = fb;
-	msmfb->panel = panel;
-	msmfb->xres = panel->fb_data->xres;
-	msmfb->yres = panel->fb_data->yres;
-
-	ret = setup_fbmem(msmfb, pdev);
-	if (ret)
-		goto error_setup_fbmem;
-
-	setup_fb_info(msmfb);
-
-	spin_lock_init(&msmfb->update_lock);
-	mutex_init(&msmfb->panel_init_lock);
-	init_waitqueue_head(&msmfb->frame_wq);
-	INIT_WORK(&msmfb->resume_work, power_on_panel);
-	msmfb->black = devm_kzalloc(&pdev->dev,
-				    msmfb->fb->var.bits_per_pixel*msmfb->xres,
-				    GFP_KERNEL);
-	if (!msmfb->black) {
-		ret = -ENOMEM;
-		goto error_register_framebuffer;
-	}
-
-	printk(KERN_INFO "msmfb_probe() installing %d x %d panel\n",
-	       msmfb->xres, msmfb->yres);
-
-	msmfb->dma_callback.func = msmfb_handle_dma_interrupt;
-	msmfb->vsync_callback.func = msmfb_handle_vsync_interrupt;
-	hrtimer_init(&msmfb->fake_vsync, CLOCK_MONOTONIC,
-		     HRTIMER_MODE_REL);
-
-
-	msmfb->fake_vsync.function = msmfb_fake_vsync;
-
-	ret = register_framebuffer(fb);
-	if (ret)
-		goto error_register_framebuffer;
-
-	msmfb->sleeping = WAKING;
-
-	platform_set_drvdata(pdev, msmfb);
-
-	return 0;
-
-error_register_framebuffer:
-	iounmap(fb->screen_base);
-error_setup_fbmem:
-	framebuffer_release(msmfb->fb);
-	return ret;
-}
-
-static int msmfb_remove(struct platform_device *pdev)
-{
-	struct msmfb_info *msmfb;
-
-	msmfb = platform_get_drvdata(pdev);
-
-	unregister_framebuffer(msmfb->fb);
-	iounmap(msmfb->fb->screen_base);
-	framebuffer_release(msmfb->fb);
-
-	return 0;
-}
-
-static struct platform_driver msm_panel_driver = {
-	/* need to write remove */
-	.probe = msmfb_probe,
-	.remove = msmfb_remove,
-	.driver = {.name = "msm_panel"},
-};
-
-
-static int msmfb_add_mdp_device(struct device *dev,
-				struct class_interface *class_intf)
-{
-	/* might need locking if mulitple mdp devices */
-	if (mdp)
-		return 0;
-	mdp = container_of(dev, struct mdp_device, dev);
-	return platform_driver_register(&msm_panel_driver);
-}
-
-static void msmfb_remove_mdp_device(struct device *dev,
-				struct class_interface *class_intf)
-{
-	/* might need locking if mulitple mdp devices */
-	if (dev != &mdp->dev)
-		return;
-	platform_driver_unregister(&msm_panel_driver);
-	mdp = NULL;
-}
-
-static struct class_interface msm_fb_interface = {
-	.add_dev = &msmfb_add_mdp_device,
-	.remove_dev = &msmfb_remove_mdp_device,
-};
-
-static int __init msmfb_init(void)
-{
-	return register_mdp_client(&msm_fb_interface);
-}
-
-module_init(msmfb_init);
diff --git a/include/linux/platform_data/video-msm_fb.h b/include/linux/platform_data/video-msm_fb.h
deleted file mode 100644
index 31449be3eadb..000000000000
--- a/include/linux/platform_data/video-msm_fb.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Internal shared definitions for various MSM framebuffer parts.
- *
- * Copyright (C) 2007 Google Incorporated
- *
- * 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.
- */
-
-#ifndef _MSM_FB_H_
-#define _MSM_FB_H_
-
-#include <linux/device.h>
-
-struct mddi_info;
-
-struct msm_fb_data {
-	int xres;	/* x resolution in pixels */
-	int yres;	/* y resolution in pixels */
-	int width;	/* disply width in mm */
-	int height;	/* display height in mm */
-	unsigned output_format;
-};
-
-struct msmfb_callback {
-	void (*func)(struct msmfb_callback *);
-};
-
-enum {
-	MSM_MDDI_PMDH_INTERFACE,
-	MSM_MDDI_EMDH_INTERFACE,
-	MSM_EBI2_INTERFACE,
-};
-
-#define MSMFB_CAP_PARTIAL_UPDATES	(1 << 0)
-
-struct msm_panel_data {
-	/* turns off the fb memory */
-	int (*suspend)(struct msm_panel_data *);
-	/* turns on the fb memory */
-	int (*resume)(struct msm_panel_data *);
-	/* turns off the panel */
-	int (*blank)(struct msm_panel_data *);
-	/* turns on the panel */
-	int (*unblank)(struct msm_panel_data *);
-	void (*wait_vsync)(struct msm_panel_data *);
-	void (*request_vsync)(struct msm_panel_data *, struct msmfb_callback *);
-	void (*clear_vsync)(struct msm_panel_data *);
-	/* from the enum above */
-	unsigned interface_type;
-	/* data to be passed to the fb driver */
-	struct msm_fb_data *fb_data;
-
-	/* capabilities supported by the panel */
-	uint32_t caps;
-};
-
-struct msm_mddi_client_data {
-	void (*suspend)(struct msm_mddi_client_data *);
-	void (*resume)(struct msm_mddi_client_data *);
-	void (*activate_link)(struct msm_mddi_client_data *);
-	void (*remote_write)(struct msm_mddi_client_data *, uint32_t val,
-			     uint32_t reg);
-	uint32_t (*remote_read)(struct msm_mddi_client_data *, uint32_t reg);
-	void (*auto_hibernate)(struct msm_mddi_client_data *, int);
-	/* custom data that needs to be passed from the board file to a 
-	 * particular client */
-	void *private_client_data;
-	struct resource *fb_resource;
-	/* from the list above */
-	unsigned interface_type;
-};
-
-struct msm_mddi_platform_data {
-	unsigned int clk_rate;
-	void (*power_client)(struct msm_mddi_client_data *, int on);
-
-	/* fixup the mfr name, product id */
-	void (*fixup)(uint16_t *mfr_name, uint16_t *product_id);
-
-	struct resource *fb_resource; /*optional*/
-	/* number of clients in the list that follows */
-	int num_clients;
-	/* array of client information of clients */
-	struct {
-		unsigned product_id; /* mfr id in top 16 bits, product id
-				      * in lower 16 bits
-				      */
-		char *name;	/* the device name will be the platform
-				 * device name registered for the client,
-				 * it should match the name of the associated
-				 * driver
-				 */
-		unsigned id;	/* id for mddi client device node, will also
-				 * be used as device id of panel devices, if
-				 * the client device will have multiple panels
-				 * space must be left here for them
-				 */
-		void *client_data;	/* required private client data */
-		unsigned int clk_rate;	/* optional: if the client requires a
-					* different mddi clk rate
-					*/
-	} client_platform_data[];
-};
-
-struct mdp_blit_req;
-struct fb_info;
-struct mdp_device {
-	struct device dev;
-	void (*dma)(struct mdp_device *mpd, uint32_t addr,
-		    uint32_t stride, uint32_t w, uint32_t h, uint32_t x,
-		    uint32_t y, struct msmfb_callback *callback, int interface);
-	void (*dma_wait)(struct mdp_device *mdp);
-	int (*blit)(struct mdp_device *mdp, struct fb_info *fb,
-		    struct mdp_blit_req *req);
-	void (*set_grp_disp)(struct mdp_device *mdp, uint32_t disp_id);
-};
-
-struct class_interface;
-int register_mdp_client(struct class_interface *class_intf);
-
-/**** private client data structs go below this line ***/
-
-struct msm_mddi_bridge_platform_data {
-	/* from board file */
-	int (*init)(struct msm_mddi_bridge_platform_data *,
-		    struct msm_mddi_client_data *);
-	int (*uninit)(struct msm_mddi_bridge_platform_data *,
-		      struct msm_mddi_client_data *);
-	/* passed to panel for use by the fb driver */
-	int (*blank)(struct msm_mddi_bridge_platform_data *,
-		     struct msm_mddi_client_data *);
-	int (*unblank)(struct msm_mddi_bridge_platform_data *,
-		       struct msm_mddi_client_data *);
-	struct msm_fb_data fb_data;
-};
-
-
-
-#endif
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 07/12] clocksource: qcom: Remove dead code
  2015-03-13 18:09 ` [PATCH 07/12] clocksource: qcom: Remove dead code Stephen Boyd
@ 2015-03-13 18:14   ` Daniel Lezcano
  2015-03-13 18:22     ` Stephen Boyd
  0 siblings, 1 reply; 32+ messages in thread
From: Daniel Lezcano @ 2015-03-13 18:14 UTC (permalink / raw)
  To: Stephen Boyd, linux-arm-msm
  Cc: linux-arm-kernel, linux-kernel, David Brown, Bryan Huntsman,
	Daniel Walker, Arnd Bergmann

On 03/13/2015 07:09 PM, Stephen Boyd wrote:
> This code is no longer used now that mach-msm has been removed.
> Delete it.
>
> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> Cc: David Brown <davidb@codeaurora.org>
> Cc: Bryan Huntsman <bryanh@codeaurora.org>
> Cc: Daniel Walker <dwalker@fifo99.com>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> ---
>
> This can be acked and go through arm-soc or applied directly to clocksource
> tree.
>
>   drivers/clocksource/qcom-timer.c | 59 ----------------------------------------
>   1 file changed, 59 deletions(-)

Applied to my tree for 4.1.

Thanks

   -- Daniel


-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 07/12] clocksource: qcom: Remove dead code
  2015-03-13 18:14   ` Daniel Lezcano
@ 2015-03-13 18:22     ` Stephen Boyd
  2015-03-13 21:11       ` Daniel Lezcano
  0 siblings, 1 reply; 32+ messages in thread
From: Stephen Boyd @ 2015-03-13 18:22 UTC (permalink / raw)
  To: Daniel Lezcano, linux-arm-msm
  Cc: linux-arm-kernel, linux-kernel, David Brown, Bryan Huntsman,
	Daniel Walker, Arnd Bergmann

On 03/13/15 11:14, Daniel Lezcano wrote:
> On 03/13/2015 07:09 PM, Stephen Boyd wrote:
>> This code is no longer used now that mach-msm has been removed.
>> Delete it.
>>
>> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
>> Cc: David Brown <davidb@codeaurora.org>
>> Cc: Bryan Huntsman <bryanh@codeaurora.org>
>> Cc: Daniel Walker <dwalker@fifo99.com>
>> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
>> ---
>>
>> This can be acked and go through arm-soc or applied directly to
>> clocksource
>> tree.
>>
>>   drivers/clocksource/qcom-timer.c | 59
>> ----------------------------------------
>>   1 file changed, 59 deletions(-)
>
> Applied to my tree for 4.1.
>


Ah sorry, this one has to go with patch 1 through arm-soc, because it
deletes symbols that patch 1 is using.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 12/12] msm: msm_fb: Remove dead code
  2015-03-13 18:09 ` [PATCH 12/12] msm: msm_fb: Remove dead code Stephen Boyd
@ 2015-03-13 18:51   ` Jean-Christophe PLAGNIOL-VILLARD
  2015-04-10 23:07     ` Stephen Boyd
  2015-06-16 18:43     ` Stephen Boyd
  0 siblings, 2 replies; 32+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2015-03-13 18:51 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: linux-arm-msm, linux-arm-kernel, linux-kernel, David Brown,
	Bryan Huntsman, Daniel Walker, Arnd Bergmann, Tomi Valkeinen

On 11:09 Fri 13 Mar     , Stephen Boyd wrote:
> This code is no longer used now that mach-msm has been removed.
> Delete it.
> 
> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Cc: David Brown <davidb@codeaurora.org>
> Cc: Bryan Huntsman <bryanh@codeaurora.org>
> Cc: Daniel Walker <dwalker@fifo99.com>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>

Best Regards,
J.
> ---
> 
> This needs an ack to go through arm-soc with patch 1.
> 
>  drivers/video/fbdev/Kconfig                   |   7 -
>  drivers/video/fbdev/Makefile                  |   1 -
>  drivers/video/fbdev/msm/Makefile              |  19 -
>  drivers/video/fbdev/msm/mddi.c                | 821 --------------------------
>  drivers/video/fbdev/msm/mddi_client_dummy.c   |  85 ---
>  drivers/video/fbdev/msm/mddi_client_nt35399.c | 252 --------
>  drivers/video/fbdev/msm/mddi_client_toshiba.c | 280 ---------
>  drivers/video/fbdev/msm/mddi_hw.h             | 305 ----------
>  drivers/video/fbdev/msm/mdp.c                 | 520 ----------------
>  drivers/video/fbdev/msm/mdp_csc_table.h       | 582 ------------------
>  drivers/video/fbdev/msm/mdp_hw.h              | 627 --------------------
>  drivers/video/fbdev/msm/mdp_ppp.c             | 731 -----------------------
>  drivers/video/fbdev/msm/mdp_scale_tables.c    | 766 ------------------------
>  drivers/video/fbdev/msm/mdp_scale_tables.h    |  38 --
>  drivers/video/fbdev/msm/msm_fb.c              | 659 ---------------------
>  include/linux/platform_data/video-msm_fb.h    | 146 -----
>  16 files changed, 5839 deletions(-)
>  delete mode 100644 drivers/video/fbdev/msm/Makefile
>  delete mode 100644 drivers/video/fbdev/msm/mddi.c
>  delete mode 100644 drivers/video/fbdev/msm/mddi_client_dummy.c
>  delete mode 100644 drivers/video/fbdev/msm/mddi_client_nt35399.c
>  delete mode 100644 drivers/video/fbdev/msm/mddi_client_toshiba.c
>  delete mode 100644 drivers/video/fbdev/msm/mddi_hw.h
>  delete mode 100644 drivers/video/fbdev/msm/mdp.c
>  delete mode 100644 drivers/video/fbdev/msm/mdp_csc_table.h
>  delete mode 100644 drivers/video/fbdev/msm/mdp_hw.h
>  delete mode 100644 drivers/video/fbdev/msm/mdp_ppp.c
>  delete mode 100644 drivers/video/fbdev/msm/mdp_scale_tables.c
>  delete mode 100644 drivers/video/fbdev/msm/mdp_scale_tables.h
>  delete mode 100644 drivers/video/fbdev/msm/msm_fb.c
>  delete mode 100644 include/linux/platform_data/video-msm_fb.h
> 
> diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
> index b3dd417b4719..b8bf5978e288 100644
> --- a/drivers/video/fbdev/Kconfig
> +++ b/drivers/video/fbdev/Kconfig
> @@ -2326,13 +2326,6 @@ config FB_PRE_INIT_FB
>  	  Select this option if display contents should be inherited as set by
>  	  the bootloader.
>  
> -config FB_MSM
> -	tristate "MSM Framebuffer support"
> -	depends on FB && ARCH_MSM
> -	select FB_CFB_FILLRECT
> -	select FB_CFB_COPYAREA
> -	select FB_CFB_IMAGEBLIT
> -
>  config FB_MX3
>  	tristate "MX3 Framebuffer support"
>  	depends on FB && MX3_IPU
> diff --git a/drivers/video/fbdev/Makefile b/drivers/video/fbdev/Makefile
> index 1979afffccfe..cecea5063a80 100644
> --- a/drivers/video/fbdev/Makefile
> +++ b/drivers/video/fbdev/Makefile
> @@ -126,7 +126,6 @@ obj-y                             += omap2/
>  obj-$(CONFIG_XEN_FBDEV_FRONTEND)  += xen-fbfront.o
>  obj-$(CONFIG_FB_CARMINE)          += carminefb.o
>  obj-$(CONFIG_FB_MB862XX)	  += mb862xx/
> -obj-$(CONFIG_FB_MSM)              += msm/
>  obj-$(CONFIG_FB_NUC900)           += nuc900fb.o
>  obj-$(CONFIG_FB_JZ4740)		  += jz4740_fb.o
>  obj-$(CONFIG_FB_PUV3_UNIGFX)      += fb-puv3.o
> diff --git a/drivers/video/fbdev/msm/Makefile b/drivers/video/fbdev/msm/Makefile
> deleted file mode 100644
> index 802d6ae523fb..000000000000
> --- a/drivers/video/fbdev/msm/Makefile
> +++ /dev/null
> @@ -1,19 +0,0 @@
> -
> -# core framebuffer
> -#
> -obj-y := msm_fb.o
> -
> -# MDP DMA/PPP engine
> -#
> -obj-y += mdp.o mdp_scale_tables.o mdp_ppp.o
> -
> -# MDDI interface
> -#
> -obj-y += mddi.o
> -
> -# MDDI client/panel drivers
> -#
> -obj-y += mddi_client_dummy.o
> -obj-y += mddi_client_toshiba.o
> -obj-y += mddi_client_nt35399.o
> -
> diff --git a/drivers/video/fbdev/msm/mddi.c b/drivers/video/fbdev/msm/mddi.c
> deleted file mode 100644
> index e0f8011a3c4b..000000000000
> --- a/drivers/video/fbdev/msm/mddi.c
> +++ /dev/null
> @@ -1,821 +0,0 @@
> -/*
> - * MSM MDDI Transport
> - *
> - * Copyright (C) 2007 Google Incorporated
> - * Copyright (C) 2007 QUALCOMM Incorporated
> - *
> - * 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/module.h>
> -#include <linux/kernel.h>
> -#include <linux/dma-mapping.h>
> -#include <linux/interrupt.h>
> -#include <linux/platform_device.h>
> -#include <linux/delay.h>
> -#include <linux/gfp.h>
> -#include <linux/spinlock.h>
> -#include <linux/clk.h>
> -#include <linux/io.h>
> -#include <linux/sched.h>
> -#include <linux/platform_data/video-msm_fb.h>
> -#include "mddi_hw.h"
> -
> -#define FLAG_DISABLE_HIBERNATION 0x0001
> -#define FLAG_HAVE_CAPS		 0x0002
> -#define FLAG_HAS_VSYNC_IRQ	 0x0004
> -#define FLAG_HAVE_STATUS	 0x0008
> -
> -#define CMD_GET_CLIENT_CAP     0x0601
> -#define CMD_GET_CLIENT_STATUS  0x0602
> -
> -union mddi_rev {
> -	unsigned char raw[MDDI_REV_BUFFER_SIZE];
> -	struct mddi_rev_packet hdr;
> -	struct mddi_client_status status;
> -	struct mddi_client_caps caps;
> -	struct mddi_register_access reg;
> -};
> -
> -struct reg_read_info {
> -	struct completion done;
> -	uint32_t reg;
> -	uint32_t status;
> -	uint32_t result;
> -};
> -
> -struct mddi_info {
> -	uint16_t flags;
> -	uint16_t version;
> -	char __iomem *base;
> -	int irq;
> -	struct clk *clk;
> -	struct msm_mddi_client_data client_data;
> -
> -	/* buffer for rev encap packets */
> -	void *rev_data;
> -	dma_addr_t rev_addr;
> -	struct mddi_llentry *reg_write_data;
> -	dma_addr_t reg_write_addr;
> -	struct mddi_llentry *reg_read_data;
> -	dma_addr_t reg_read_addr;
> -	size_t rev_data_curr;
> -
> -	spinlock_t int_lock;
> -	uint32_t int_enable;
> -	uint32_t got_int;
> -	wait_queue_head_t int_wait;
> -
> -	struct mutex reg_write_lock;
> -	struct mutex reg_read_lock;
> -	struct reg_read_info *reg_read;
> -
> -	struct mddi_client_caps caps;
> -	struct mddi_client_status status;
> -
> -	void (*power_client)(struct msm_mddi_client_data *, int);
> -
> -	/* client device published to bind us to the
> -	 * appropriate mddi_client driver
> -	 */
> -	char client_name[20];
> -
> -	struct platform_device client_pdev;
> -};
> -
> -static void mddi_init_rev_encap(struct mddi_info *mddi);
> -
> -#define mddi_readl(r) readl(mddi->base + (MDDI_##r))
> -#define mddi_writel(v, r) writel((v), mddi->base + (MDDI_##r))
> -
> -void mddi_activate_link(struct msm_mddi_client_data *cdata)
> -{
> -	struct mddi_info *mddi = container_of(cdata, struct mddi_info,
> -					      client_data);
> -
> -	mddi_writel(MDDI_CMD_LINK_ACTIVE, CMD);
> -}
> -
> -static void mddi_handle_link_list_done(struct mddi_info *mddi)
> -{
> -}
> -
> -static void mddi_reset_rev_encap_ptr(struct mddi_info *mddi)
> -{
> -	printk(KERN_INFO "mddi: resetting rev ptr\n");
> -	mddi->rev_data_curr = 0;
> -	mddi_writel(mddi->rev_addr, REV_PTR);
> -	mddi_writel(mddi->rev_addr, REV_PTR);
> -	mddi_writel(MDDI_CMD_FORCE_NEW_REV_PTR, CMD);
> -}
> -
> -static void mddi_handle_rev_data(struct mddi_info *mddi, union mddi_rev *rev)
> -{
> -	int i;
> -	struct reg_read_info *ri;
> -
> -	if ((rev->hdr.length <= MDDI_REV_BUFFER_SIZE - 2) &&
> -	   (rev->hdr.length >= sizeof(struct mddi_rev_packet) - 2)) {
> -
> -		switch (rev->hdr.type) {
> -		case TYPE_CLIENT_CAPS:
> -			memcpy(&mddi->caps, &rev->caps,
> -			       sizeof(struct mddi_client_caps));
> -			mddi->flags |= FLAG_HAVE_CAPS;
> -			wake_up(&mddi->int_wait);
> -			break;
> -		case TYPE_CLIENT_STATUS:
> -			memcpy(&mddi->status, &rev->status,
> -			       sizeof(struct mddi_client_status));
> -			mddi->flags |= FLAG_HAVE_STATUS;
> -			wake_up(&mddi->int_wait);
> -			break;
> -		case TYPE_REGISTER_ACCESS:
> -			ri = mddi->reg_read;
> -			if (ri == 0) {
> -				printk(KERN_INFO "rev: got reg %x = %x without "
> -						 " pending read\n",
> -				       rev->reg.register_address,
> -				       rev->reg.register_data_list);
> -				break;
> -			}
> -			if (ri->reg != rev->reg.register_address) {
> -				printk(KERN_INFO "rev: got reg %x = %x for "
> -						 "wrong register, expected "
> -						 "%x\n",
> -				       rev->reg.register_address,
> -				       rev->reg.register_data_list, ri->reg);
> -				break;
> -			}
> -			mddi->reg_read = NULL;
> -			ri->status = 0;
> -			ri->result = rev->reg.register_data_list;
> -			complete(&ri->done);
> -			break;
> -		default:
> -			printk(KERN_INFO "rev: unknown reverse packet: "
> -					 "len=%04x type=%04x CURR_REV_PTR=%x\n",
> -			       rev->hdr.length, rev->hdr.type,
> -			       mddi_readl(CURR_REV_PTR));
> -			for (i = 0; i < rev->hdr.length + 2; i++) {
> -				if ((i % 16) == 0)
> -					printk(KERN_INFO "\n");
> -				printk(KERN_INFO " %02x", rev->raw[i]);
> -			}
> -			printk(KERN_INFO "\n");
> -			mddi_reset_rev_encap_ptr(mddi);
> -		}
> -	} else {
> -		printk(KERN_INFO "bad rev length, %d, CURR_REV_PTR %x\n",
> -		       rev->hdr.length, mddi_readl(CURR_REV_PTR));
> -		mddi_reset_rev_encap_ptr(mddi);
> -	}
> -}
> -
> -static void mddi_wait_interrupt(struct mddi_info *mddi, uint32_t intmask);
> -
> -static void mddi_handle_rev_data_avail(struct mddi_info *mddi)
> -{
> -	uint32_t rev_data_count;
> -	uint32_t rev_crc_err_count;
> -	struct reg_read_info *ri;
> -	size_t prev_offset;
> -	uint16_t length;
> -
> -	union mddi_rev *crev = mddi->rev_data + mddi->rev_data_curr;
> -
> -	/* clear the interrupt */
> -	mddi_writel(MDDI_INT_REV_DATA_AVAIL, INT);
> -	rev_data_count = mddi_readl(REV_PKT_CNT);
> -	rev_crc_err_count = mddi_readl(REV_CRC_ERR);
> -	if (rev_data_count > 1)
> -		printk(KERN_INFO "rev_data_count %d\n", rev_data_count);
> -
> -	if (rev_crc_err_count) {
> -		printk(KERN_INFO "rev_crc_err_count %d, INT %x\n",
> -		       rev_crc_err_count,  mddi_readl(INT));
> -		ri = mddi->reg_read;
> -		if (ri == 0) {
> -			printk(KERN_INFO "rev: got crc error without pending "
> -			       "read\n");
> -		} else {
> -			mddi->reg_read = NULL;
> -			ri->status = -EIO;
> -			ri->result = -1;
> -			complete(&ri->done);
> -		}
> -	}
> -
> -	if (rev_data_count == 0)
> -		return;
> -
> -	prev_offset = mddi->rev_data_curr;
> -
> -	length = *((uint8_t *)mddi->rev_data + mddi->rev_data_curr);
> -	mddi->rev_data_curr++;
> -	if (mddi->rev_data_curr == MDDI_REV_BUFFER_SIZE)
> -		mddi->rev_data_curr = 0;
> -	length += *((uint8_t *)mddi->rev_data + mddi->rev_data_curr) << 8;
> -	mddi->rev_data_curr += 1 + length;
> -	if (mddi->rev_data_curr >= MDDI_REV_BUFFER_SIZE)
> -		mddi->rev_data_curr =
> -			mddi->rev_data_curr % MDDI_REV_BUFFER_SIZE;
> -
> -	if (length > MDDI_REV_BUFFER_SIZE - 2) {
> -		printk(KERN_INFO "mddi: rev data length greater than buffer"
> -			"size\n");
> -		mddi_reset_rev_encap_ptr(mddi);
> -		return;
> -	}
> -
> -	if (prev_offset + 2 + length >= MDDI_REV_BUFFER_SIZE) {
> -		union mddi_rev tmprev;
> -		size_t rem = MDDI_REV_BUFFER_SIZE - prev_offset;
> -		memcpy(&tmprev.raw[0], mddi->rev_data + prev_offset, rem);
> -		memcpy(&tmprev.raw[rem], mddi->rev_data, 2 + length - rem);
> -		mddi_handle_rev_data(mddi, &tmprev);
> -	} else {
> -		mddi_handle_rev_data(mddi, crev);
> -	}
> -
> -	if (prev_offset < MDDI_REV_BUFFER_SIZE / 2 &&
> -	    mddi->rev_data_curr >= MDDI_REV_BUFFER_SIZE / 2) {
> -		mddi_writel(mddi->rev_addr, REV_PTR);
> -	}
> -}
> -
> -static irqreturn_t mddi_isr(int irq, void *data)
> -{
> -	struct msm_mddi_client_data *cdata = data;
> -	struct mddi_info *mddi = container_of(cdata, struct mddi_info,
> -					      client_data);
> -	uint32_t active, status;
> -
> -	spin_lock(&mddi->int_lock);
> -
> -	active = mddi_readl(INT);
> -	status = mddi_readl(STAT);
> -
> -	mddi_writel(active, INT);
> -
> -	/* ignore any interrupts we have disabled */
> -	active &= mddi->int_enable;
> -
> -	mddi->got_int |= active;
> -	wake_up(&mddi->int_wait);
> -
> -	if (active & MDDI_INT_PRI_LINK_LIST_DONE) {
> -		mddi->int_enable &= (~MDDI_INT_PRI_LINK_LIST_DONE);
> -		mddi_handle_link_list_done(mddi);
> -	}
> -	if (active & MDDI_INT_REV_DATA_AVAIL)
> -		mddi_handle_rev_data_avail(mddi);
> -
> -	if (active & ~MDDI_INT_NEED_CLEAR)
> -		mddi->int_enable &= ~(active & ~MDDI_INT_NEED_CLEAR);
> -
> -	if (active & MDDI_INT_LINK_ACTIVE) {
> -		mddi->int_enable &= (~MDDI_INT_LINK_ACTIVE);
> -		mddi->int_enable |= MDDI_INT_IN_HIBERNATION;
> -	}
> -
> -	if (active & MDDI_INT_IN_HIBERNATION) {
> -		mddi->int_enable &= (~MDDI_INT_IN_HIBERNATION);
> -		mddi->int_enable |= MDDI_INT_LINK_ACTIVE;
> -	}
> -
> -	mddi_writel(mddi->int_enable, INTEN);
> -	spin_unlock(&mddi->int_lock);
> -
> -	return IRQ_HANDLED;
> -}
> -
> -static long mddi_wait_interrupt_timeout(struct mddi_info *mddi,
> -					uint32_t intmask, int timeout)
> -{
> -	unsigned long irq_flags;
> -
> -	spin_lock_irqsave(&mddi->int_lock, irq_flags);
> -	mddi->got_int &= ~intmask;
> -	mddi->int_enable |= intmask;
> -	mddi_writel(mddi->int_enable, INTEN);
> -	spin_unlock_irqrestore(&mddi->int_lock, irq_flags);
> -	return wait_event_timeout(mddi->int_wait, mddi->got_int & intmask,
> -				  timeout);
> -}
> -
> -static void mddi_wait_interrupt(struct mddi_info *mddi, uint32_t intmask)
> -{
> -	if (mddi_wait_interrupt_timeout(mddi, intmask, HZ/10) == 0)
> -		printk(KERN_INFO "mddi_wait_interrupt %d, timeout "
> -		       "waiting for %x, INT = %x, STAT = %x gotint = %x\n",
> -		       current->pid, intmask, mddi_readl(INT), mddi_readl(STAT),
> -		       mddi->got_int);
> -}
> -
> -static void mddi_init_rev_encap(struct mddi_info *mddi)
> -{
> -	memset(mddi->rev_data, 0xee, MDDI_REV_BUFFER_SIZE);
> -	mddi_writel(mddi->rev_addr, REV_PTR);
> -	mddi_writel(MDDI_CMD_FORCE_NEW_REV_PTR, CMD);
> -	mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
> -}
> -
> -void mddi_set_auto_hibernate(struct msm_mddi_client_data *cdata, int on)
> -{
> -	struct mddi_info *mddi = container_of(cdata, struct mddi_info,
> -					      client_data);
> -	mddi_writel(MDDI_CMD_POWERDOWN, CMD);
> -	mddi_wait_interrupt(mddi, MDDI_INT_IN_HIBERNATION);
> -	mddi_writel(MDDI_CMD_HIBERNATE | !!on, CMD);
> -	mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
> -}
> -
> -
> -static uint16_t mddi_init_registers(struct mddi_info *mddi)
> -{
> -	mddi_writel(0x0001, VERSION);
> -	mddi_writel(MDDI_HOST_BYTES_PER_SUBFRAME, BPS);
> -	mddi_writel(0x0003, SPM); /* subframes per media */
> -	mddi_writel(0x0005, TA1_LEN);
> -	mddi_writel(MDDI_HOST_TA2_LEN, TA2_LEN);
> -	mddi_writel(0x0096, DRIVE_HI);
> -	/* 0x32 normal, 0x50 for Toshiba display */
> -	mddi_writel(0x0050, DRIVE_LO);
> -	mddi_writel(0x003C, DISP_WAKE); /* wakeup counter */
> -	mddi_writel(MDDI_HOST_REV_RATE_DIV, REV_RATE_DIV);
> -
> -	mddi_writel(MDDI_REV_BUFFER_SIZE, REV_SIZE);
> -	mddi_writel(MDDI_MAX_REV_PKT_SIZE, REV_ENCAP_SZ);
> -
> -	/* disable periodic rev encap */
> -	mddi_writel(MDDI_CMD_PERIODIC_REV_ENCAP, CMD);
> -	mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
> -
> -	if (mddi_readl(PAD_CTL) == 0) {
> -		/* If we are turning on band gap, need to wait 5us before
> -		 * turning on the rest of the PAD */
> -		mddi_writel(0x08000, PAD_CTL);
> -		udelay(5);
> -	}
> -
> -	/* Recommendation from PAD hw team */
> -	mddi_writel(0xa850f, PAD_CTL);
> -
> -
> -	/* Need an even number for counts */
> -	mddi_writel(0x60006, DRIVER_START_CNT);
> -
> -	mddi_set_auto_hibernate(&mddi->client_data, 0);
> -
> -	mddi_writel(MDDI_CMD_DISP_IGNORE, CMD);
> -	mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
> -
> -	mddi_init_rev_encap(mddi);
> -	return mddi_readl(CORE_VER) & 0xffff;
> -}
> -
> -static void mddi_suspend(struct msm_mddi_client_data *cdata)
> -{
> -	struct mddi_info *mddi = container_of(cdata, struct mddi_info,
> -					      client_data);
> -	/* turn off the client */
> -	if (mddi->power_client)
> -		mddi->power_client(&mddi->client_data, 0);
> -	/* turn off the link */
> -	mddi_writel(MDDI_CMD_RESET, CMD);
> -	mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
> -	/* turn off the clock */
> -	clk_disable(mddi->clk);
> -}
> -
> -static void mddi_resume(struct msm_mddi_client_data *cdata)
> -{
> -	struct mddi_info *mddi = container_of(cdata, struct mddi_info,
> -					      client_data);
> -	mddi_set_auto_hibernate(&mddi->client_data, 0);
> -	/* turn on the client */
> -	if (mddi->power_client)
> -		mddi->power_client(&mddi->client_data, 1);
> -	/* turn on the clock */
> -	clk_enable(mddi->clk);
> -	/* set up the local registers */
> -	mddi->rev_data_curr = 0;
> -	mddi_init_registers(mddi);
> -	mddi_writel(mddi->int_enable, INTEN);
> -	mddi_writel(MDDI_CMD_LINK_ACTIVE, CMD);
> -	mddi_writel(MDDI_CMD_SEND_RTD, CMD);
> -	mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
> -	mddi_set_auto_hibernate(&mddi->client_data, 1);
> -}
> -
> -static int mddi_get_client_caps(struct mddi_info *mddi)
> -{
> -	int i, j;
> -
> -	/* clear any stale interrupts */
> -	mddi_writel(0xffffffff, INT);
> -
> -	mddi->int_enable = MDDI_INT_LINK_ACTIVE |
> -			   MDDI_INT_IN_HIBERNATION |
> -			   MDDI_INT_PRI_LINK_LIST_DONE |
> -			   MDDI_INT_REV_DATA_AVAIL |
> -			   MDDI_INT_REV_OVERFLOW |
> -			   MDDI_INT_REV_OVERWRITE |
> -			   MDDI_INT_RTD_FAILURE;
> -	mddi_writel(mddi->int_enable, INTEN);
> -
> -	mddi_writel(MDDI_CMD_LINK_ACTIVE, CMD);
> -	mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
> -
> -	for (j = 0; j < 3; j++) {
> -		/* the toshiba vga panel does not respond to get
> -		 * caps unless you SEND_RTD, but the first SEND_RTD
> -		 * will fail...
> -		 */
> -		for (i = 0; i < 4; i++) {
> -			uint32_t stat;
> -
> -			mddi_writel(MDDI_CMD_SEND_RTD, CMD);
> -			mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
> -			stat = mddi_readl(STAT);
> -			printk(KERN_INFO "mddi cmd send rtd: int %x, stat %x, "
> -					"rtd val %x\n", mddi_readl(INT), stat,
> -					mddi_readl(RTD_VAL));
> -			if ((stat & MDDI_STAT_RTD_MEAS_FAIL) == 0)
> -				break;
> -			msleep(1);
> -		}
> -
> -		mddi_writel(CMD_GET_CLIENT_CAP, CMD);
> -		mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
> -		wait_event_timeout(mddi->int_wait, mddi->flags & FLAG_HAVE_CAPS,
> -				   HZ / 100);
> -
> -		if (mddi->flags & FLAG_HAVE_CAPS)
> -			break;
> -		printk(KERN_INFO "mddi_init, timeout waiting for caps\n");
> -	}
> -	return mddi->flags & FLAG_HAVE_CAPS;
> -}
> -
> -/* link must be active when this is called */
> -int mddi_check_status(struct mddi_info *mddi)
> -{
> -	int ret = -1, retry = 3;
> -	mutex_lock(&mddi->reg_read_lock);
> -	mddi_writel(MDDI_CMD_PERIODIC_REV_ENCAP | 1, CMD);
> -	mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
> -
> -	do {
> -		mddi->flags &= ~FLAG_HAVE_STATUS;
> -		mddi_writel(CMD_GET_CLIENT_STATUS, CMD);
> -		mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
> -		wait_event_timeout(mddi->int_wait,
> -				   mddi->flags & FLAG_HAVE_STATUS,
> -				   HZ / 100);
> -
> -		if (mddi->flags & FLAG_HAVE_STATUS) {
> -			if (mddi->status.crc_error_count)
> -				printk(KERN_INFO "mddi status: crc_error "
> -					"count: %d\n",
> -					mddi->status.crc_error_count);
> -			else
> -				ret = 0;
> -			break;
> -		} else
> -			printk(KERN_INFO "mddi status: failed to get client "
> -				"status\n");
> -		mddi_writel(MDDI_CMD_SEND_RTD, CMD);
> -		mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
> -	} while (--retry);
> -
> -	mddi_writel(MDDI_CMD_PERIODIC_REV_ENCAP | 0, CMD);
> -	mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
> -	mutex_unlock(&mddi->reg_read_lock);
> -	return ret;
> -}
> -
> -
> -void mddi_remote_write(struct msm_mddi_client_data *cdata, uint32_t val,
> -		       uint32_t reg)
> -{
> -	struct mddi_info *mddi = container_of(cdata, struct mddi_info,
> -					      client_data);
> -	struct mddi_llentry *ll;
> -	struct mddi_register_access *ra;
> -
> -	mutex_lock(&mddi->reg_write_lock);
> -
> -	ll = mddi->reg_write_data;
> -
> -	ra = &(ll->u.r);
> -	ra->length = 14 + 4;
> -	ra->type = TYPE_REGISTER_ACCESS;
> -	ra->client_id = 0;
> -	ra->read_write_info = MDDI_WRITE | 1;
> -	ra->crc16 = 0;
> -
> -	ra->register_address = reg;
> -	ra->register_data_list = val;
> -
> -	ll->flags = 1;
> -	ll->header_count = 14;
> -	ll->data_count = 4;
> -	ll->data = mddi->reg_write_addr + offsetof(struct mddi_llentry,
> -						   u.r.register_data_list);
> -	ll->next = 0;
> -	ll->reserved = 0;
> -
> -	mddi_writel(mddi->reg_write_addr, PRI_PTR);
> -
> -	mddi_wait_interrupt(mddi, MDDI_INT_PRI_LINK_LIST_DONE);
> -	mutex_unlock(&mddi->reg_write_lock);
> -}
> -
> -uint32_t mddi_remote_read(struct msm_mddi_client_data *cdata, uint32_t reg)
> -{
> -	struct mddi_info *mddi = container_of(cdata, struct mddi_info,
> -					      client_data);
> -	struct mddi_llentry *ll;
> -	struct mddi_register_access *ra;
> -	struct reg_read_info ri;
> -	unsigned s;
> -	int retry_count = 2;
> -	unsigned long irq_flags;
> -
> -	mutex_lock(&mddi->reg_read_lock);
> -
> -	ll = mddi->reg_read_data;
> -
> -	ra = &(ll->u.r);
> -	ra->length = 14;
> -	ra->type = TYPE_REGISTER_ACCESS;
> -	ra->client_id = 0;
> -	ra->read_write_info = MDDI_READ | 1;
> -	ra->crc16 = 0;
> -
> -	ra->register_address = reg;
> -
> -	ll->flags = 0x11;
> -	ll->header_count = 14;
> -	ll->data_count = 0;
> -	ll->data = 0;
> -	ll->next = 0;
> -	ll->reserved = 0;
> -
> -	s = mddi_readl(STAT);
> -
> -	ri.reg = reg;
> -	ri.status = -1;
> -
> -	do {
> -		init_completion(&ri.done);
> -		mddi->reg_read = &ri;
> -		mddi_writel(mddi->reg_read_addr, PRI_PTR);
> -
> -		mddi_wait_interrupt(mddi, MDDI_INT_PRI_LINK_LIST_DONE);
> -
> -		/* Enable Periodic Reverse Encapsulation. */
> -		mddi_writel(MDDI_CMD_PERIODIC_REV_ENCAP | 1, CMD);
> -		mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
> -		if (wait_for_completion_timeout(&ri.done, HZ/10) == 0 &&
> -		    !ri.done.done) {
> -			printk(KERN_INFO "mddi_remote_read(%x) timeout "
> -					 "(%d %d %d)\n",
> -			       reg, ri.status, ri.result, ri.done.done);
> -			spin_lock_irqsave(&mddi->int_lock, irq_flags);
> -			mddi->reg_read = NULL;
> -			spin_unlock_irqrestore(&mddi->int_lock, irq_flags);
> -			ri.status = -1;
> -			ri.result = -1;
> -		}
> -		if (ri.status == 0)
> -			break;
> -
> -		mddi_writel(MDDI_CMD_SEND_RTD, CMD);
> -		mddi_writel(MDDI_CMD_LINK_ACTIVE, CMD);
> -		mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
> -		printk(KERN_INFO "mddi_remote_read: failed, sent "
> -		       "MDDI_CMD_SEND_RTD: int %x, stat %x, rtd val %x "
> -		       "curr_rev_ptr %x\n", mddi_readl(INT), mddi_readl(STAT),
> -		       mddi_readl(RTD_VAL), mddi_readl(CURR_REV_PTR));
> -	} while (retry_count-- > 0);
> -	/* Disable Periodic Reverse Encapsulation. */
> -	mddi_writel(MDDI_CMD_PERIODIC_REV_ENCAP | 0, CMD);
> -	mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
> -	mddi->reg_read = NULL;
> -	mutex_unlock(&mddi->reg_read_lock);
> -	return ri.result;
> -}
> -
> -static struct mddi_info mddi_info[2];
> -
> -static int mddi_clk_setup(struct platform_device *pdev, struct mddi_info *mddi,
> -			  unsigned long clk_rate)
> -{
> -	int ret;
> -
> -	/* set up the clocks */
> -	mddi->clk = clk_get(&pdev->dev, "mddi_clk");
> -	if (IS_ERR(mddi->clk)) {
> -		printk(KERN_INFO "mddi: failed to get clock\n");
> -		return PTR_ERR(mddi->clk);
> -	}
> -	ret =  clk_enable(mddi->clk);
> -	if (ret)
> -		goto fail;
> -	ret = clk_set_rate(mddi->clk, clk_rate);
> -	if (ret)
> -		goto fail;
> -	return 0;
> -
> -fail:
> -	clk_put(mddi->clk);
> -	return ret;
> -}
> -
> -static int __init mddi_rev_data_setup(struct mddi_info *mddi)
> -{
> -	void *dma;
> -	dma_addr_t dma_addr;
> -
> -	/* set up dma buffer */
> -	dma = dma_alloc_coherent(NULL, 0x1000, &dma_addr, GFP_KERNEL);
> -	if (dma == 0)
> -		return -ENOMEM;
> -	mddi->rev_data = dma;
> -	mddi->rev_data_curr = 0;
> -	mddi->rev_addr = dma_addr;
> -	mddi->reg_write_data = dma + MDDI_REV_BUFFER_SIZE;
> -	mddi->reg_write_addr = dma_addr + MDDI_REV_BUFFER_SIZE;
> -	mddi->reg_read_data = mddi->reg_write_data + 1;
> -	mddi->reg_read_addr = mddi->reg_write_addr +
> -			      sizeof(*mddi->reg_write_data);
> -	return 0;
> -}
> -
> -static int mddi_probe(struct platform_device *pdev)
> -{
> -	struct msm_mddi_platform_data *pdata = pdev->dev.platform_data;
> -	struct mddi_info *mddi = &mddi_info[pdev->id];
> -	struct resource *resource;
> -	int ret, i;
> -
> -	resource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (!resource) {
> -		printk(KERN_ERR "mddi: no associated mem resource!\n");
> -		return -ENOMEM;
> -	}
> -	mddi->base = ioremap(resource->start, resource_size(resource));
> -	if (!mddi->base) {
> -		printk(KERN_ERR "mddi: failed to remap base!\n");
> -		ret = -EINVAL;
> -		goto error_ioremap;
> -	}
> -	resource = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> -	if (!resource) {
> -		printk(KERN_ERR "mddi: no associated irq resource!\n");
> -		ret = -EINVAL;
> -		goto error_get_irq_resource;
> -	}
> -	mddi->irq = resource->start;
> -	printk(KERN_INFO "mddi: init() base=0x%p irq=%d\n", mddi->base,
> -	       mddi->irq);
> -	mddi->power_client = pdata->power_client;
> -
> -	mutex_init(&mddi->reg_write_lock);
> -	mutex_init(&mddi->reg_read_lock);
> -	spin_lock_init(&mddi->int_lock);
> -	init_waitqueue_head(&mddi->int_wait);
> -
> -	ret = mddi_clk_setup(pdev, mddi, pdata->clk_rate);
> -	if (ret) {
> -		printk(KERN_ERR "mddi: failed to setup clock!\n");
> -		goto error_clk_setup;
> -	}
> -
> -	ret = mddi_rev_data_setup(mddi);
> -	if (ret) {
> -		printk(KERN_ERR "mddi: failed to setup rev data!\n");
> -		goto error_rev_data;
> -	}
> -
> -	mddi->int_enable = 0;
> -	mddi_writel(mddi->int_enable, INTEN);
> -	ret = request_irq(mddi->irq, mddi_isr, 0, "mddi",
> -			  &mddi->client_data);
> -	if (ret) {
> -		printk(KERN_ERR "mddi: failed to request enable irq!\n");
> -		goto error_request_irq;
> -	}
> -
> -	/* turn on the mddi client bridge chip */
> -	if (mddi->power_client)
> -		mddi->power_client(&mddi->client_data, 1);
> -
> -	/* initialize the mddi registers */
> -	mddi_set_auto_hibernate(&mddi->client_data, 0);
> -	mddi_writel(MDDI_CMD_RESET, CMD);
> -	mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
> -	mddi->version = mddi_init_registers(mddi);
> -	if (mddi->version < 0x20) {
> -		printk(KERN_ERR "mddi: unsupported version 0x%x\n",
> -		       mddi->version);
> -		ret = -ENODEV;
> -		goto error_mddi_version;
> -	}
> -
> -	/* read the capabilities off the client */
> -	if (!mddi_get_client_caps(mddi)) {
> -		printk(KERN_INFO "mddi: no client found\n");
> -		/* power down the panel */
> -		mddi_writel(MDDI_CMD_POWERDOWN, CMD);
> -		printk(KERN_INFO "mddi powerdown: stat %x\n", mddi_readl(STAT));
> -		msleep(100);
> -		printk(KERN_INFO "mddi powerdown: stat %x\n", mddi_readl(STAT));
> -		return 0;
> -	}
> -	mddi_set_auto_hibernate(&mddi->client_data, 1);
> -
> -	if (mddi->caps.Mfr_Name == 0 && mddi->caps.Product_Code == 0)
> -		pdata->fixup(&mddi->caps.Mfr_Name, &mddi->caps.Product_Code);
> -
> -	mddi->client_pdev.id = 0;
> -	for (i = 0; i < pdata->num_clients; i++) {
> -		if (pdata->client_platform_data[i].product_id ==
> -		    (mddi->caps.Mfr_Name << 16 | mddi->caps.Product_Code)) {
> -			mddi->client_data.private_client_data =
> -				pdata->client_platform_data[i].client_data;
> -			mddi->client_pdev.name =
> -				pdata->client_platform_data[i].name;
> -			mddi->client_pdev.id =
> -				pdata->client_platform_data[i].id;
> -			/* XXX: possibly set clock */
> -			break;
> -		}
> -	}
> -
> -	if (i >= pdata->num_clients)
> -		mddi->client_pdev.name = "mddi_c_dummy";
> -	printk(KERN_INFO "mddi: registering panel %s\n",
> -		mddi->client_pdev.name);
> -
> -	mddi->client_data.suspend = mddi_suspend;
> -	mddi->client_data.resume = mddi_resume;
> -	mddi->client_data.activate_link = mddi_activate_link;
> -	mddi->client_data.remote_write = mddi_remote_write;
> -	mddi->client_data.remote_read = mddi_remote_read;
> -	mddi->client_data.auto_hibernate = mddi_set_auto_hibernate;
> -	mddi->client_data.fb_resource = pdata->fb_resource;
> -	if (pdev->id == 0)
> -		mddi->client_data.interface_type = MSM_MDDI_PMDH_INTERFACE;
> -	else if (pdev->id == 1)
> -		mddi->client_data.interface_type = MSM_MDDI_EMDH_INTERFACE;
> -	else {
> -		printk(KERN_ERR "mddi: can not determine interface %d!\n",
> -		       pdev->id);
> -		ret = -EINVAL;
> -		goto error_mddi_interface;
> -	}
> -
> -	mddi->client_pdev.dev.platform_data = &mddi->client_data;
> -	printk(KERN_INFO "mddi: publish: %s\n", mddi->client_name);
> -	platform_device_register(&mddi->client_pdev);
> -	return 0;
> -
> -error_mddi_interface:
> -error_mddi_version:
> -	free_irq(mddi->irq, 0);
> -error_request_irq:
> -	dma_free_coherent(NULL, 0x1000, mddi->rev_data, mddi->rev_addr);
> -error_rev_data:
> -error_clk_setup:
> -error_get_irq_resource:
> -	iounmap(mddi->base);
> -error_ioremap:
> -
> -	printk(KERN_INFO "mddi: mddi_init() failed (%d)\n", ret);
> -	return ret;
> -}
> -
> -
> -static struct platform_driver mddi_driver = {
> -	.probe = mddi_probe,
> -	.driver = { .name = "msm_mddi" },
> -};
> -
> -static int __init _mddi_init(void)
> -{
> -	return platform_driver_register(&mddi_driver);
> -}
> -
> -module_init(_mddi_init);
> diff --git a/drivers/video/fbdev/msm/mddi_client_dummy.c b/drivers/video/fbdev/msm/mddi_client_dummy.c
> deleted file mode 100644
> index cdb8f69a5d88..000000000000
> --- a/drivers/video/fbdev/msm/mddi_client_dummy.c
> +++ /dev/null
> @@ -1,85 +0,0 @@
> -/* drivers/video/msm_fb/mddi_client_dummy.c
> - *
> - * Support for "dummy" mddi client devices which require no
> - * special initialization code.
> - *
> - * Copyright (C) 2007 Google Incorporated
> - *
> - * 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/device.h>
> -#include <linux/slab.h>
> -#include <linux/module.h>
> -#include <linux/kernel.h>
> -#include <linux/platform_device.h>
> -
> -#include <linux/platform_data/video-msm_fb.h>
> -
> -struct panel_info {
> -	struct platform_device pdev;
> -	struct msm_panel_data panel_data;
> -};
> -
> -static int mddi_dummy_suspend(struct msm_panel_data *panel_data)
> -{
> -	return 0;
> -}
> -
> -static int mddi_dummy_resume(struct msm_panel_data *panel_data)
> -{
> -	return 0;
> -}
> -
> -static int mddi_dummy_blank(struct msm_panel_data *panel_data)
> -{
> -	return 0;
> -}
> -
> -static int mddi_dummy_unblank(struct msm_panel_data *panel_data)
> -{
> -	return 0;
> -}
> -
> -static int mddi_dummy_probe(struct platform_device *pdev)
> -{
> -	struct msm_mddi_client_data *client_data = pdev->dev.platform_data;
> -	struct panel_info *panel =
> -		devm_kzalloc(&pdev->dev, sizeof(struct panel_info), GFP_KERNEL);
> -	if (!panel)
> -		return -ENOMEM;
> -	platform_set_drvdata(pdev, panel);
> -	panel->panel_data.suspend = mddi_dummy_suspend;
> -	panel->panel_data.resume = mddi_dummy_resume;
> -	panel->panel_data.blank = mddi_dummy_blank;
> -	panel->panel_data.unblank = mddi_dummy_unblank;
> -	panel->panel_data.caps = MSMFB_CAP_PARTIAL_UPDATES;
> -	panel->pdev.name = "msm_panel";
> -	panel->pdev.id = pdev->id;
> -	platform_device_add_resources(&panel->pdev,
> -				      client_data->fb_resource, 1);
> -	panel->panel_data.fb_data = client_data->private_client_data;
> -	panel->pdev.dev.platform_data = &panel->panel_data;
> -	return platform_device_register(&panel->pdev);
> -}
> -
> -static struct platform_driver mddi_client_dummy = {
> -	.probe = mddi_dummy_probe,
> -	.driver = { .name = "mddi_c_dummy" },
> -};
> -
> -static int __init mddi_client_dummy_init(void)
> -{
> -	platform_driver_register(&mddi_client_dummy);
> -	return 0;
> -}
> -
> -module_init(mddi_client_dummy_init);
> -
> diff --git a/drivers/video/fbdev/msm/mddi_client_nt35399.c b/drivers/video/fbdev/msm/mddi_client_nt35399.c
> deleted file mode 100644
> index f96df32e5509..000000000000
> --- a/drivers/video/fbdev/msm/mddi_client_nt35399.c
> +++ /dev/null
> @@ -1,252 +0,0 @@
> -/* drivers/video/msm_fb/mddi_client_nt35399.c
> - *
> - * Support for Novatek NT35399 MDDI client of Sapphire
> - *
> - * Copyright (C) 2008 HTC Incorporated
> - * Author: Solomon Chiu (solomon_chiu@htc.com)
> - *
> - * 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/module.h>
> -#include <linux/kernel.h>
> -#include <linux/platform_device.h>
> -#include <linux/interrupt.h>
> -#include <linux/sched.h>
> -#include <linux/gpio.h>
> -#include <linux/slab.h>
> -#include <linux/platform_data/video-msm_fb.h>
> -
> -static DECLARE_WAIT_QUEUE_HEAD(nt35399_vsync_wait);
> -
> -struct panel_info {
> -	struct msm_mddi_client_data *client_data;
> -	struct platform_device pdev;
> -	struct msm_panel_data panel_data;
> -	struct msmfb_callback *fb_callback;
> -	struct work_struct panel_work;
> -	struct workqueue_struct *fb_wq;
> -	int nt35399_got_int;
> -};
> -
> -static void
> -nt35399_request_vsync(struct msm_panel_data *panel_data,
> -		      struct msmfb_callback *callback)
> -{
> -	struct panel_info *panel = container_of(panel_data, struct panel_info,
> -						panel_data);
> -	struct msm_mddi_client_data *client_data = panel->client_data;
> -
> -	panel->fb_callback = callback;
> -	if (panel->nt35399_got_int) {
> -		panel->nt35399_got_int = 0;
> -		client_data->activate_link(client_data); /* clears interrupt */
> -	}
> -}
> -
> -static void nt35399_wait_vsync(struct msm_panel_data *panel_data)
> -{
> -	struct panel_info *panel = container_of(panel_data, struct panel_info,
> -						panel_data);
> -	struct msm_mddi_client_data *client_data = panel->client_data;
> -
> -	if (panel->nt35399_got_int) {
> -		panel->nt35399_got_int = 0;
> -		client_data->activate_link(client_data); /* clears interrupt */
> -	}
> -
> -	if (wait_event_timeout(nt35399_vsync_wait, panel->nt35399_got_int,
> -				HZ/2) == 0)
> -		printk(KERN_ERR "timeout waiting for VSYNC\n");
> -
> -	panel->nt35399_got_int = 0;
> -	/* interrupt clears when screen dma starts */
> -}
> -
> -static int nt35399_suspend(struct msm_panel_data *panel_data)
> -{
> -	struct panel_info *panel = container_of(panel_data, struct panel_info,
> -						panel_data);
> -	struct msm_mddi_client_data *client_data = panel->client_data;
> -
> -	struct msm_mddi_bridge_platform_data *bridge_data =
> -		client_data->private_client_data;
> -	int ret;
> -
> -	ret = bridge_data->uninit(bridge_data, client_data);
> -	if (ret) {
> -		printk(KERN_INFO "mddi nt35399 client: non zero return from "
> -			"uninit\n");
> -		return ret;
> -	}
> -	client_data->suspend(client_data);
> -	return 0;
> -}
> -
> -static int nt35399_resume(struct msm_panel_data *panel_data)
> -{
> -	struct panel_info *panel = container_of(panel_data, struct panel_info,
> -						panel_data);
> -	struct msm_mddi_client_data *client_data = panel->client_data;
> -
> -	struct msm_mddi_bridge_platform_data *bridge_data =
> -		client_data->private_client_data;
> -	int ret;
> -
> -	client_data->resume(client_data);
> -	ret = bridge_data->init(bridge_data, client_data);
> -	if (ret)
> -		return ret;
> -	return 0;
> -}
> -
> -static int nt35399_blank(struct msm_panel_data *panel_data)
> -{
> -	struct panel_info *panel = container_of(panel_data, struct panel_info,
> -						panel_data);
> -	struct msm_mddi_client_data *client_data = panel->client_data;
> -	struct msm_mddi_bridge_platform_data *bridge_data =
> -		client_data->private_client_data;
> -
> -	return bridge_data->blank(bridge_data, client_data);
> -}
> -
> -static int nt35399_unblank(struct msm_panel_data *panel_data)
> -{
> -	struct panel_info *panel = container_of(panel_data, struct panel_info,
> -						panel_data);
> -	struct msm_mddi_client_data *client_data = panel->client_data;
> -	struct msm_mddi_bridge_platform_data *bridge_data =
> -		client_data->private_client_data;
> -
> -	return bridge_data->unblank(bridge_data, client_data);
> -}
> -
> -irqreturn_t nt35399_vsync_interrupt(int irq, void *data)
> -{
> -	struct panel_info *panel = data;
> -
> -	panel->nt35399_got_int = 1;
> -
> -	if (panel->fb_callback) {
> -		panel->fb_callback->func(panel->fb_callback);
> -		panel->fb_callback = NULL;
> -	}
> -
> -	wake_up(&nt35399_vsync_wait);
> -
> -	return IRQ_HANDLED;
> -}
> -
> -static int setup_vsync(struct panel_info *panel, int init)
> -{
> -	int ret;
> -	int gpio = 97;
> -	unsigned int irq;
> -
> -	if (!init) {
> -		ret = 0;
> -		goto uninit;
> -	}
> -	ret = gpio_request_one(gpio, GPIOF_IN, "vsync");
> -	if (ret)
> -		goto err_request_gpio_failed;
> -
> -	ret = irq = gpio_to_irq(gpio);
> -	if (ret < 0)
> -		goto err_get_irq_num_failed;
> -
> -	ret = request_irq(irq, nt35399_vsync_interrupt, IRQF_TRIGGER_RISING,
> -			  "vsync", panel);
> -	if (ret)
> -		goto err_request_irq_failed;
> -
> -	printk(KERN_INFO "vsync on gpio %d now %d\n",
> -	       gpio, gpio_get_value(gpio));
> -	return 0;
> -
> -uninit:
> -	free_irq(gpio_to_irq(gpio), panel->client_data);
> -err_request_irq_failed:
> -err_get_irq_num_failed:
> -	gpio_free(gpio);
> -err_request_gpio_failed:
> -	return ret;
> -}
> -
> -static int mddi_nt35399_probe(struct platform_device *pdev)
> -{
> -	struct msm_mddi_client_data *client_data = pdev->dev.platform_data;
> -	struct msm_mddi_bridge_platform_data *bridge_data =
> -		client_data->private_client_data;
> -
> -	int ret;
> -
> -	struct panel_info *panel = devm_kzalloc(&pdev->dev,
> -						sizeof(struct panel_info),
> -						GFP_KERNEL);
> -
> -	printk(KERN_DEBUG "%s: enter.\n", __func__);
> -
> -	if (!panel)
> -		return -ENOMEM;
> -	platform_set_drvdata(pdev, panel);
> -
> -	ret = setup_vsync(panel, 1);
> -	if (ret) {
> -		dev_err(&pdev->dev, "mddi_nt35399_setup_vsync failed\n");
> -		return ret;
> -	}
> -
> -	panel->client_data = client_data;
> -	panel->panel_data.suspend = nt35399_suspend;
> -	panel->panel_data.resume = nt35399_resume;
> -	panel->panel_data.wait_vsync = nt35399_wait_vsync;
> -	panel->panel_data.request_vsync = nt35399_request_vsync;
> -	panel->panel_data.blank = nt35399_blank;
> -	panel->panel_data.unblank = nt35399_unblank;
> -	panel->panel_data.fb_data = &bridge_data->fb_data;
> -	panel->panel_data.caps = 0;
> -
> -	panel->pdev.name = "msm_panel";
> -	panel->pdev.id = pdev->id;
> -	panel->pdev.resource = client_data->fb_resource;
> -	panel->pdev.num_resources = 1;
> -	panel->pdev.dev.platform_data = &panel->panel_data;
> -
> -	if (bridge_data->init)
> -		bridge_data->init(bridge_data, client_data);
> -
> -	platform_device_register(&panel->pdev);
> -
> -	return 0;
> -}
> -
> -static int mddi_nt35399_remove(struct platform_device *pdev)
> -{
> -	struct panel_info *panel = platform_get_drvdata(pdev);
> -
> -	setup_vsync(panel, 0);
> -	return 0;
> -}
> -
> -static struct platform_driver mddi_client_0bda_8a47 = {
> -	.probe = mddi_nt35399_probe,
> -	.remove = mddi_nt35399_remove,
> -	.driver = { .name = "mddi_c_0bda_8a47" },
> -};
> -
> -static int __init mddi_client_nt35399_init(void)
> -{
> -	return platform_driver_register(&mddi_client_0bda_8a47);
> -}
> -
> -module_init(mddi_client_nt35399_init);
> -
> diff --git a/drivers/video/fbdev/msm/mddi_client_toshiba.c b/drivers/video/fbdev/msm/mddi_client_toshiba.c
> deleted file mode 100644
> index 061d7dfebbf3..000000000000
> --- a/drivers/video/fbdev/msm/mddi_client_toshiba.c
> +++ /dev/null
> @@ -1,280 +0,0 @@
> -/* drivers/video/msm_fb/mddi_client_toshiba.c
> - *
> - * Support for Toshiba TC358720XBG mddi client devices which require no
> - * special initialization code.
> - *
> - * Copyright (C) 2007 Google Incorporated
> - *
> - * 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/module.h>
> -#include <linux/kernel.h>
> -#include <linux/platform_device.h>
> -#include <linux/interrupt.h>
> -#include <linux/gpio.h>
> -#include <linux/sched.h>
> -#include <linux/slab.h>
> -#include <linux/platform_data/video-msm_fb.h>
> -
> -
> -#define LCD_CONTROL_BLOCK_BASE 0x110000
> -#define CMN         (LCD_CONTROL_BLOCK_BASE|0x10)
> -#define INTFLG      (LCD_CONTROL_BLOCK_BASE|0x18)
> -#define HCYCLE      (LCD_CONTROL_BLOCK_BASE|0x34)
> -#define HDE_START   (LCD_CONTROL_BLOCK_BASE|0x3C)
> -#define VPOS        (LCD_CONTROL_BLOCK_BASE|0xC0)
> -#define MPLFBUF     (LCD_CONTROL_BLOCK_BASE|0x20)
> -#define WAKEUP      (LCD_CONTROL_BLOCK_BASE|0x54)
> -#define WSYN_DLY    (LCD_CONTROL_BLOCK_BASE|0x58)
> -#define REGENB      (LCD_CONTROL_BLOCK_BASE|0x5C)
> -
> -#define BASE5 0x150000
> -#define BASE6 0x160000
> -#define BASE7 0x170000
> -
> -#define GPIOIEV     (BASE5 + 0x10)
> -#define GPIOIE      (BASE5 + 0x14)
> -#define GPIORIS     (BASE5 + 0x18)
> -#define GPIOMIS     (BASE5 + 0x1C)
> -#define GPIOIC      (BASE5 + 0x20)
> -
> -#define INTMASK     (BASE6 + 0x0C)
> -#define INTMASK_VWAKEOUT (1U << 0)
> -#define INTMASK_VWAKEOUT_ACTIVE_LOW (1U << 8)
> -#define GPIOSEL     (BASE7 + 0x00)
> -#define GPIOSEL_VWAKEINT (1U << 0)
> -
> -static DECLARE_WAIT_QUEUE_HEAD(toshiba_vsync_wait);
> -
> -struct panel_info {
> -	struct msm_mddi_client_data *client_data;
> -	struct platform_device pdev;
> -	struct msm_panel_data panel_data;
> -	struct msmfb_callback *toshiba_callback;
> -	int toshiba_got_int;
> -};
> -
> -
> -static void toshiba_request_vsync(struct msm_panel_data *panel_data,
> -				  struct msmfb_callback *callback)
> -{
> -	struct panel_info *panel = container_of(panel_data, struct panel_info,
> -						panel_data);
> -	struct msm_mddi_client_data *client_data = panel->client_data;
> -
> -	panel->toshiba_callback = callback;
> -	if (panel->toshiba_got_int) {
> -		panel->toshiba_got_int = 0;
> -		client_data->activate_link(client_data);
> -	}
> -}
> -
> -static void toshiba_clear_vsync(struct msm_panel_data *panel_data)
> -{
> -	struct panel_info *panel = container_of(panel_data, struct panel_info,
> -						panel_data);
> -	struct msm_mddi_client_data *client_data = panel->client_data;
> -
> -	client_data->activate_link(client_data);
> -}
> -
> -static void toshiba_wait_vsync(struct msm_panel_data *panel_data)
> -{
> -	struct panel_info *panel = container_of(panel_data, struct panel_info,
> -						panel_data);
> -	struct msm_mddi_client_data *client_data = panel->client_data;
> -
> -	if (panel->toshiba_got_int) {
> -		panel->toshiba_got_int = 0;
> -		client_data->activate_link(client_data); /* clears interrupt */
> -	}
> -	if (wait_event_timeout(toshiba_vsync_wait, panel->toshiba_got_int,
> -				HZ/2) == 0)
> -		printk(KERN_ERR "timeout waiting for VSYNC\n");
> -	panel->toshiba_got_int = 0;
> -	/* interrupt clears when screen dma starts */
> -}
> -
> -static int toshiba_suspend(struct msm_panel_data *panel_data)
> -{
> -	struct panel_info *panel = container_of(panel_data, struct panel_info,
> -						panel_data);
> -	struct msm_mddi_client_data *client_data = panel->client_data;
> -
> -	struct msm_mddi_bridge_platform_data *bridge_data =
> -		client_data->private_client_data;
> -	int ret;
> -
> -	ret = bridge_data->uninit(bridge_data, client_data);
> -	if (ret) {
> -		printk(KERN_INFO "mddi toshiba client: non zero return from "
> -			"uninit\n");
> -		return ret;
> -	}
> -	client_data->suspend(client_data);
> -	return 0;
> -}
> -
> -static int toshiba_resume(struct msm_panel_data *panel_data)
> -{
> -	struct panel_info *panel = container_of(panel_data, struct panel_info,
> -						panel_data);
> -	struct msm_mddi_client_data *client_data = panel->client_data;
> -
> -	struct msm_mddi_bridge_platform_data *bridge_data =
> -		client_data->private_client_data;
> -	int ret;
> -
> -	client_data->resume(client_data);
> -	ret = bridge_data->init(bridge_data, client_data);
> -	if (ret)
> -		return ret;
> -	return 0;
> -}
> -
> -static int toshiba_blank(struct msm_panel_data *panel_data)
> -{
> -	struct panel_info *panel = container_of(panel_data, struct panel_info,
> -						panel_data);
> -	struct msm_mddi_client_data *client_data = panel->client_data;
> -	struct msm_mddi_bridge_platform_data *bridge_data =
> -		client_data->private_client_data;
> -
> -	return bridge_data->blank(bridge_data, client_data);
> -}
> -
> -static int toshiba_unblank(struct msm_panel_data *panel_data)
> -{
> -	struct panel_info *panel = container_of(panel_data, struct panel_info,
> -						panel_data);
> -	struct msm_mddi_client_data *client_data = panel->client_data;
> -	struct msm_mddi_bridge_platform_data *bridge_data =
> -		client_data->private_client_data;
> -
> -	return bridge_data->unblank(bridge_data, client_data);
> -}
> -
> -irqreturn_t toshiba_vsync_interrupt(int irq, void *data)
> -{
> -	struct panel_info *panel = data;
> -
> -	panel->toshiba_got_int = 1;
> -	if (panel->toshiba_callback) {
> -		panel->toshiba_callback->func(panel->toshiba_callback);
> -		panel->toshiba_callback = 0;
> -	}
> -	wake_up(&toshiba_vsync_wait);
> -	return IRQ_HANDLED;
> -}
> -
> -static int setup_vsync(struct panel_info *panel,
> -		       int init)
> -{
> -	int ret;
> -	int gpio = 97;
> -	unsigned int irq;
> -
> -	if (!init) {
> -		ret = 0;
> -		goto uninit;
> -	}
> -	ret = gpio_request_one(gpio, GPIOF_IN, "vsync");
> -	if (ret)
> -		goto err_request_gpio_failed;
> -
> -	ret = irq = gpio_to_irq(gpio);
> -	if (ret < 0)
> -		goto err_get_irq_num_failed;
> -
> -	ret = request_irq(irq, toshiba_vsync_interrupt, IRQF_TRIGGER_RISING,
> -			  "vsync", panel);
> -	if (ret)
> -		goto err_request_irq_failed;
> -	printk(KERN_INFO "vsync on gpio %d now %d\n",
> -	       gpio, gpio_get_value(gpio));
> -	return 0;
> -
> -uninit:
> -	free_irq(gpio_to_irq(gpio), panel);
> -err_request_irq_failed:
> -err_get_irq_num_failed:
> -	gpio_free(gpio);
> -err_request_gpio_failed:
> -	return ret;
> -}
> -
> -static int mddi_toshiba_probe(struct platform_device *pdev)
> -{
> -	int ret;
> -	struct msm_mddi_client_data *client_data = pdev->dev.platform_data;
> -	struct msm_mddi_bridge_platform_data *bridge_data =
> -		client_data->private_client_data;
> -	struct panel_info *panel =
> -		kzalloc(sizeof(struct panel_info), GFP_KERNEL);
> -	if (!panel)
> -		return -ENOMEM;
> -	platform_set_drvdata(pdev, panel);
> -
> -	/* mddi_remote_write(mddi, 0, WAKEUP); */
> -	client_data->remote_write(client_data, GPIOSEL_VWAKEINT, GPIOSEL);
> -	client_data->remote_write(client_data, INTMASK_VWAKEOUT, INTMASK);
> -
> -	ret = setup_vsync(panel, 1);
> -	if (ret) {
> -		dev_err(&pdev->dev, "mddi_bridge_setup_vsync failed\n");
> -		return ret;
> -	}
> -
> -	panel->client_data = client_data;
> -	panel->panel_data.suspend = toshiba_suspend;
> -	panel->panel_data.resume = toshiba_resume;
> -	panel->panel_data.wait_vsync = toshiba_wait_vsync;
> -	panel->panel_data.request_vsync = toshiba_request_vsync;
> -	panel->panel_data.clear_vsync = toshiba_clear_vsync;
> -	panel->panel_data.blank = toshiba_blank;
> -	panel->panel_data.unblank = toshiba_unblank;
> -	panel->panel_data.fb_data =  &bridge_data->fb_data;
> -	panel->panel_data.caps = MSMFB_CAP_PARTIAL_UPDATES;
> -
> -	panel->pdev.name = "msm_panel";
> -	panel->pdev.id = pdev->id;
> -	panel->pdev.resource = client_data->fb_resource;
> -	panel->pdev.num_resources = 1;
> -	panel->pdev.dev.platform_data = &panel->panel_data;
> -	bridge_data->init(bridge_data, client_data);
> -	platform_device_register(&panel->pdev);
> -
> -	return 0;
> -}
> -
> -static int mddi_toshiba_remove(struct platform_device *pdev)
> -{
> -	struct panel_info *panel = platform_get_drvdata(pdev);
> -
> -	setup_vsync(panel, 0);
> -	kfree(panel);
> -	return 0;
> -}
> -
> -static struct platform_driver mddi_client_d263_0000 = {
> -	.probe = mddi_toshiba_probe,
> -	.remove = mddi_toshiba_remove,
> -	.driver = { .name = "mddi_c_d263_0000" },
> -};
> -
> -static int __init mddi_client_toshiba_init(void)
> -{
> -	platform_driver_register(&mddi_client_d263_0000);
> -	return 0;
> -}
> -
> -module_init(mddi_client_toshiba_init);
> -
> diff --git a/drivers/video/fbdev/msm/mddi_hw.h b/drivers/video/fbdev/msm/mddi_hw.h
> deleted file mode 100644
> index 45cc01fc1e7f..000000000000
> --- a/drivers/video/fbdev/msm/mddi_hw.h
> +++ /dev/null
> @@ -1,305 +0,0 @@
> -/* drivers/video/msm_fb/mddi_hw.h
> - *
> - * MSM MDDI Hardware Registers and Structures
> - *
> - * Copyright (C) 2007 QUALCOMM Incorporated
> - * Copyright (C) 2007 Google Incorporated
> - *
> - * 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.
> - */
> -
> -#ifndef _MDDI_HW_H_
> -#define _MDDI_HW_H_
> -
> -#include <linux/types.h>
> -
> -#define MDDI_CMD                0x0000
> -#define MDDI_VERSION            0x0004
> -#define MDDI_PRI_PTR            0x0008
> -#define MDDI_SEC_PTR            0x000c
> -#define MDDI_BPS                0x0010
> -#define MDDI_SPM                0x0014
> -#define MDDI_INT                0x0018
> -#define MDDI_INTEN              0x001c
> -#define MDDI_REV_PTR            0x0020
> -#define MDDI_REV_SIZE           0x0024
> -#define MDDI_STAT               0x0028
> -#define MDDI_REV_RATE_DIV       0x002c
> -#define MDDI_REV_CRC_ERR        0x0030
> -#define MDDI_TA1_LEN            0x0034
> -#define MDDI_TA2_LEN            0x0038
> -#define MDDI_TEST_BUS           0x003c
> -#define MDDI_TEST               0x0040
> -#define MDDI_REV_PKT_CNT        0x0044
> -#define MDDI_DRIVE_HI           0x0048
> -#define MDDI_DRIVE_LO           0x004c
> -#define MDDI_DISP_WAKE          0x0050
> -#define MDDI_REV_ENCAP_SZ       0x0054
> -#define MDDI_RTD_VAL            0x0058
> -#define MDDI_PAD_CTL            0x0068
> -#define MDDI_DRIVER_START_CNT   0x006c
> -#define MDDI_NEXT_PRI_PTR       0x0070
> -#define MDDI_NEXT_SEC_PTR       0x0074
> -#define MDDI_MISR_CTL           0x0078
> -#define MDDI_MISR_DATA          0x007c
> -#define MDDI_SF_CNT             0x0080
> -#define MDDI_MF_CNT             0x0084
> -#define MDDI_CURR_REV_PTR       0x0088
> -#define MDDI_CORE_VER           0x008c
> -
> -#define MDDI_INT_PRI_PTR_READ       0x0001
> -#define MDDI_INT_SEC_PTR_READ       0x0002
> -#define MDDI_INT_REV_DATA_AVAIL     0x0004
> -#define MDDI_INT_DISP_REQ           0x0008
> -#define MDDI_INT_PRI_UNDERFLOW      0x0010
> -#define MDDI_INT_SEC_UNDERFLOW      0x0020
> -#define MDDI_INT_REV_OVERFLOW       0x0040
> -#define MDDI_INT_CRC_ERROR          0x0080
> -#define MDDI_INT_MDDI_IN            0x0100
> -#define MDDI_INT_PRI_OVERWRITE      0x0200
> -#define MDDI_INT_SEC_OVERWRITE      0x0400
> -#define MDDI_INT_REV_OVERWRITE      0x0800
> -#define MDDI_INT_DMA_FAILURE        0x1000
> -#define MDDI_INT_LINK_ACTIVE        0x2000
> -#define MDDI_INT_IN_HIBERNATION     0x4000
> -#define MDDI_INT_PRI_LINK_LIST_DONE 0x8000
> -#define MDDI_INT_SEC_LINK_LIST_DONE 0x10000
> -#define MDDI_INT_NO_CMD_PKTS_PEND   0x20000
> -#define MDDI_INT_RTD_FAILURE        0x40000
> -#define MDDI_INT_REV_PKT_RECEIVED   0x80000
> -#define MDDI_INT_REV_PKTS_AVAIL     0x100000
> -
> -#define MDDI_INT_NEED_CLEAR ( \
> -	MDDI_INT_REV_DATA_AVAIL | \
> -	MDDI_INT_PRI_UNDERFLOW | \
> -	MDDI_INT_SEC_UNDERFLOW | \
> -	MDDI_INT_REV_OVERFLOW | \
> -	MDDI_INT_CRC_ERROR | \
> -	MDDI_INT_REV_PKT_RECEIVED)
> -
> -
> -#define MDDI_STAT_LINK_ACTIVE        0x0001
> -#define MDDI_STAT_NEW_REV_PTR        0x0002
> -#define MDDI_STAT_NEW_PRI_PTR        0x0004
> -#define MDDI_STAT_NEW_SEC_PTR        0x0008
> -#define MDDI_STAT_IN_HIBERNATION     0x0010
> -#define MDDI_STAT_PRI_LINK_LIST_DONE 0x0020
> -#define MDDI_STAT_SEC_LINK_LIST_DONE 0x0040
> -#define MDDI_STAT_PENDING_TIMING_PKT 0x0080
> -#define MDDI_STAT_PENDING_REV_ENCAP  0x0100
> -#define MDDI_STAT_PENDING_POWERDOWN  0x0200
> -#define MDDI_STAT_RTD_MEAS_FAIL      0x0800
> -#define MDDI_STAT_CLIENT_WAKEUP_REQ  0x1000
> -
> -
> -#define MDDI_CMD_POWERDOWN           0x0100
> -#define MDDI_CMD_POWERUP             0x0200
> -#define MDDI_CMD_HIBERNATE           0x0300
> -#define MDDI_CMD_RESET               0x0400
> -#define MDDI_CMD_DISP_IGNORE         0x0501
> -#define MDDI_CMD_DISP_LISTEN         0x0500
> -#define MDDI_CMD_SEND_REV_ENCAP      0x0600
> -#define MDDI_CMD_GET_CLIENT_CAP      0x0601
> -#define MDDI_CMD_GET_CLIENT_STATUS   0x0602
> -#define MDDI_CMD_SEND_RTD            0x0700
> -#define MDDI_CMD_LINK_ACTIVE         0x0900
> -#define MDDI_CMD_PERIODIC_REV_ENCAP  0x0A00
> -#define MDDI_CMD_FORCE_NEW_REV_PTR   0x0C00
> -
> -
> -
> -#define MDDI_VIDEO_REV_PKT_SIZE              0x40
> -#define MDDI_CLIENT_CAPABILITY_REV_PKT_SIZE  0x60
> -#define MDDI_MAX_REV_PKT_SIZE                0x60
> -
> -/* #define MDDI_REV_BUFFER_SIZE 128 */
> -#define MDDI_REV_BUFFER_SIZE (MDDI_MAX_REV_PKT_SIZE * 4)
> -
> -/* MDP sends 256 pixel packets, so lower value hibernates more without
> - * significantly increasing latency of waiting for next subframe */
> -#define MDDI_HOST_BYTES_PER_SUBFRAME  0x3C00
> -#define MDDI_HOST_TA2_LEN       0x000c
> -#define MDDI_HOST_REV_RATE_DIV  0x0002
> -
> -
> -struct __attribute__((packed)) mddi_rev_packet {
> -	uint16_t length;
> -	uint16_t type;
> -	uint16_t client_id;
> -};
> -
> -struct __attribute__((packed)) mddi_client_status {
> -	uint16_t length;
> -	uint16_t type;
> -	uint16_t client_id;
> -	uint16_t reverse_link_request;  /* bytes needed in rev encap message */
> -	uint8_t  crc_error_count;
> -	uint8_t  capability_change;
> -	uint16_t graphics_busy_flags;
> -	uint16_t crc16;
> -};
> -
> -struct __attribute__((packed)) mddi_client_caps {
> -	uint16_t length; /* length, exclusive of this field */
> -	uint16_t type; /* 66 */
> -	uint16_t client_id;
> -
> -	uint16_t Protocol_Version;
> -	uint16_t Minimum_Protocol_Version;
> -	uint16_t Data_Rate_Capability;
> -	uint8_t  Interface_Type_Capability;
> -	uint8_t  Number_of_Alt_Displays;
> -	uint16_t PostCal_Data_Rate;
> -	uint16_t Bitmap_Width;
> -	uint16_t Bitmap_Height;
> -	uint16_t Display_Window_Width;
> -	uint16_t Display_Window_Height;
> -	uint32_t Color_Map_Size;
> -	uint16_t Color_Map_RGB_Width;
> -	uint16_t RGB_Capability;
> -	uint8_t  Monochrome_Capability;
> -	uint8_t  Reserved_1;
> -	uint16_t Y_Cb_Cr_Capability;
> -	uint16_t Bayer_Capability;
> -	uint16_t Alpha_Cursor_Image_Planes;
> -	uint32_t Client_Feature_Capability_Indicators;
> -	uint8_t  Maximum_Video_Frame_Rate_Capability;
> -	uint8_t  Minimum_Video_Frame_Rate_Capability;
> -	uint16_t Minimum_Sub_frame_Rate;
> -	uint16_t Audio_Buffer_Depth;
> -	uint16_t Audio_Channel_Capability;
> -	uint16_t Audio_Sample_Rate_Capability;
> -	uint8_t  Audio_Sample_Resolution;
> -	uint8_t  Mic_Audio_Sample_Resolution;
> -	uint16_t Mic_Sample_Rate_Capability;
> -	uint8_t  Keyboard_Data_Format;
> -	uint8_t  pointing_device_data_format;
> -	uint16_t content_protection_type;
> -	uint16_t Mfr_Name;
> -	uint16_t Product_Code;
> -	uint16_t Reserved_3;
> -	uint32_t Serial_Number;
> -	uint8_t  Week_of_Manufacture;
> -	uint8_t  Year_of_Manufacture;
> -
> -	uint16_t crc16;
> -} mddi_client_capability_type;
> -
> -
> -struct __attribute__((packed)) mddi_video_stream {
> -	uint16_t length;
> -	uint16_t type; /* 16 */
> -	uint16_t client_id; /* 0 */
> -
> -	uint16_t video_data_format_descriptor;
> -/* format of each pixel in the Pixel Data in the present stream in the
> - * present packet.
> - * If bits [15:13] = 000 monochrome
> - * If bits [15:13] = 001 color pixels (palette).
> - * If bits [15:13] = 010 color pixels in raw RGB
> - * If bits [15:13] = 011 data in 4:2:2 Y Cb Cr format
> - * If bits [15:13] = 100 Bayer pixels
> - */
> -
> -	uint16_t pixel_data_attributes;
> -/* interpreted as follows:
> - * Bits [1:0] = 11  pixel data is displayed to both eyes
> - * Bits [1:0] = 10  pixel data is routed to the left eye only.
> - * Bits [1:0] = 01  pixel data is routed to the right eye only.
> - * Bits [1:0] = 00  pixel data is routed to the alternate display.
> - * Bit 2 is 0  Pixel Data is in the standard progressive format.
> - * Bit 2 is 1  Pixel Data is in interlace format.
> - * Bit 3 is 0  Pixel Data is in the standard progressive format.
> - * Bit 3 is 1  Pixel Data is in alternate pixel format.
> - * Bit 4 is 0  Pixel Data is to or from the display frame buffer.
> - * Bit 4 is 1  Pixel Data is to or from the camera.
> - * Bit 5 is 0  pixel data contains the next consecutive row of pixels.
> - * Bit 5 is 1  X Left Edge, Y Top Edge, X Right Edge, Y Bottom Edge,
> - *             X Start, and Y Start parameters are not defined and
> - *             shall be ignored by the client.
> - * Bits [7:6] = 01  Pixel data is written to the offline image buffer.
> - * Bits [7:6] = 00  Pixel data is written to the buffer to refresh display.
> - * Bits [7:6] = 11  Pixel data is written to all image buffers.
> - * Bits [7:6] = 10  Invalid. Reserved for future use.
> - * Bits 8 through 11 alternate display number.
> - * Bits 12 through 14 are reserved for future use and shall be set to zero.
> - * Bit 15 is 1 the row of pixels is the last row of pixels in a frame.
> - */
> -
> -	uint16_t x_left_edge;
> -	uint16_t y_top_edge;
> -	/* X,Y coordinate of the top left edge of the screen window */
> -
> -	uint16_t x_right_edge;
> -	uint16_t y_bottom_edge;
> -	/* X,Y coordinate of the bottom right edge of the window being
> -	 * updated. */
> -
> -	uint16_t x_start;
> -	uint16_t y_start;
> -	/* (X Start, Y Start) is the first pixel in the Pixel Data field
> -	 * below. */
> -
> -	uint16_t pixel_count;
> -	/* number of pixels in the Pixel Data field below. */
> -
> -	uint16_t parameter_CRC;
> -	/* 16-bit CRC of all bytes from the Packet Length to the Pixel Count. */
> -
> -	uint16_t reserved;
> -	/* 16-bit variable to make structure align on 4 byte boundary */
> -};
> -
> -#define TYPE_VIDEO_STREAM      16
> -#define TYPE_CLIENT_CAPS       66
> -#define TYPE_REGISTER_ACCESS   146
> -#define TYPE_CLIENT_STATUS     70
> -
> -struct __attribute__((packed)) mddi_register_access {
> -	uint16_t length;
> -	uint16_t type; /* 146 */
> -	uint16_t client_id;
> -
> -	uint16_t read_write_info;
> -	/* Bits 13:0  a 14-bit unsigned integer that specifies the number of
> -	 *            32-bit Register Data List items to be transferred in the
> -	 *            Register Data List field.
> -	 * Bits[15:14] = 00  Write to register(s);
> -	 * Bits[15:14] = 10  Read from register(s);
> -	 * Bits[15:14] = 11  Response to a Read.
> -	 * Bits[15:14] = 01  this value is reserved for future use. */
> -#define MDDI_WRITE     (0 << 14)
> -#define MDDI_READ      (2 << 14)
> -#define MDDI_READ_RESP (3 << 14)
> -
> -	uint32_t register_address;
> -	/* the register address that is to be written to or read from. */
> -
> -	uint16_t crc16;
> -
> -	uint32_t register_data_list;
> -	/* list of 4-byte register data values for/from client registers */
> -};
> -
> -struct __attribute__((packed)) mddi_llentry {
> -	uint16_t flags;
> -	uint16_t header_count;
> -	uint16_t data_count;
> -	dma_addr_t data; /* 32 bit */
> -	struct mddi_llentry *next;
> -	uint16_t reserved;
> -	union {
> -		struct mddi_video_stream v;
> -		struct mddi_register_access r;
> -		uint32_t _[12];
> -	} u;
> -};
> -
> -#endif
> diff --git a/drivers/video/fbdev/msm/mdp.c b/drivers/video/fbdev/msm/mdp.c
> deleted file mode 100644
> index 113c7876c855..000000000000
> --- a/drivers/video/fbdev/msm/mdp.c
> +++ /dev/null
> @@ -1,520 +0,0 @@
> -/* drivers/video/msm_fb/mdp.c
> - *
> - * MSM MDP Interface (used by framebuffer core)
> - *
> - * Copyright (C) 2007 QUALCOMM Incorporated
> - * Copyright (C) 2007 Google Incorporated
> - *
> - * 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/kernel.h>
> -#include <linux/fb.h>
> -#include <linux/msm_mdp.h>
> -#include <linux/interrupt.h>
> -#include <linux/wait.h>
> -#include <linux/clk.h>
> -#include <linux/file.h>
> -#include <linux/major.h>
> -#include <linux/slab.h>
> -
> -#include <linux/platform_data/video-msm_fb.h>
> -#include <linux/platform_device.h>
> -#include <linux/export.h>
> -
> -#include "mdp_hw.h"
> -
> -struct class *mdp_class;
> -
> -#define MDP_CMD_DEBUG_ACCESS_BASE (0x10000)
> -
> -static uint16_t mdp_default_ccs[] = {
> -	0x254, 0x000, 0x331, 0x254, 0xF38, 0xE61, 0x254, 0x409, 0x000,
> -	0x010, 0x080, 0x080
> -};
> -
> -static DECLARE_WAIT_QUEUE_HEAD(mdp_dma2_waitqueue);
> -static DECLARE_WAIT_QUEUE_HEAD(mdp_ppp_waitqueue);
> -static struct msmfb_callback *dma_callback;
> -static struct clk *clk;
> -static unsigned int mdp_irq_mask;
> -static DEFINE_SPINLOCK(mdp_lock);
> -DEFINE_MUTEX(mdp_mutex);
> -
> -static int enable_mdp_irq(struct mdp_info *mdp, uint32_t mask)
> -{
> -	unsigned long irq_flags;
> -	int ret = 0;
> -
> -	BUG_ON(!mask);
> -
> -	spin_lock_irqsave(&mdp_lock, irq_flags);
> -	/* if the mask bits are already set return an error, this interrupt
> -	 * is already enabled */
> -	if (mdp_irq_mask & mask) {
> -		printk(KERN_ERR "mdp irq already on already on %x %x\n",
> -		       mdp_irq_mask, mask);
> -		ret = -1;
> -	}
> -	/* if the mdp irq is not already enabled enable it */
> -	if (!mdp_irq_mask) {
> -		if (clk)
> -			clk_enable(clk);
> -		enable_irq(mdp->irq);
> -	}
> -
> -	/* update the irq mask to reflect the fact that the interrupt is
> -	 * enabled */
> -	mdp_irq_mask |= mask;
> -	spin_unlock_irqrestore(&mdp_lock, irq_flags);
> -	return ret;
> -}
> -
> -static int locked_disable_mdp_irq(struct mdp_info *mdp, uint32_t mask)
> -{
> -	/* this interrupt is already disabled! */
> -	if (!(mdp_irq_mask & mask)) {
> -		printk(KERN_ERR "mdp irq already off %x %x\n",
> -		       mdp_irq_mask, mask);
> -		return -1;
> -	}
> -	/* update the irq mask to reflect the fact that the interrupt is
> -	 * disabled */
> -	mdp_irq_mask &= ~(mask);
> -	/* if no one is waiting on the interrupt, disable it */
> -	if (!mdp_irq_mask) {
> -		disable_irq_nosync(mdp->irq);
> -		if (clk)
> -			clk_disable(clk);
> -	}
> -	return 0;
> -}
> -
> -static int disable_mdp_irq(struct mdp_info *mdp, uint32_t mask)
> -{
> -	unsigned long irq_flags;
> -	int ret;
> -
> -	spin_lock_irqsave(&mdp_lock, irq_flags);
> -	ret = locked_disable_mdp_irq(mdp, mask);
> -	spin_unlock_irqrestore(&mdp_lock, irq_flags);
> -	return ret;
> -}
> -
> -static irqreturn_t mdp_isr(int irq, void *data)
> -{
> -	uint32_t status;
> -	unsigned long irq_flags;
> -	struct mdp_info *mdp = data;
> -
> -	spin_lock_irqsave(&mdp_lock, irq_flags);
> -
> -	status = mdp_readl(mdp, MDP_INTR_STATUS);
> -	mdp_writel(mdp, status, MDP_INTR_CLEAR);
> -
> -	status &= mdp_irq_mask;
> -	if (status & DL0_DMA2_TERM_DONE) {
> -		if (dma_callback) {
> -			dma_callback->func(dma_callback);
> -			dma_callback = NULL;
> -		}
> -		wake_up(&mdp_dma2_waitqueue);
> -	}
> -
> -	if (status & DL0_ROI_DONE)
> -		wake_up(&mdp_ppp_waitqueue);
> -
> -	if (status)
> -		locked_disable_mdp_irq(mdp, status);
> -
> -	spin_unlock_irqrestore(&mdp_lock, irq_flags);
> -	return IRQ_HANDLED;
> -}
> -
> -static uint32_t mdp_check_mask(uint32_t mask)
> -{
> -	uint32_t ret;
> -	unsigned long irq_flags;
> -
> -	spin_lock_irqsave(&mdp_lock, irq_flags);
> -	ret = mdp_irq_mask & mask;
> -	spin_unlock_irqrestore(&mdp_lock, irq_flags);
> -	return ret;
> -}
> -
> -static int mdp_wait(struct mdp_info *mdp, uint32_t mask, wait_queue_head_t *wq)
> -{
> -	int ret = 0;
> -	unsigned long irq_flags;
> -
> -	wait_event_timeout(*wq, !mdp_check_mask(mask), HZ);
> -
> -	spin_lock_irqsave(&mdp_lock, irq_flags);
> -	if (mdp_irq_mask & mask) {
> -		locked_disable_mdp_irq(mdp, mask);
> -		printk(KERN_WARNING "timeout waiting for mdp to complete %x\n",
> -		       mask);
> -		ret = -ETIMEDOUT;
> -	}
> -	spin_unlock_irqrestore(&mdp_lock, irq_flags);
> -
> -	return ret;
> -}
> -
> -void mdp_dma_wait(struct mdp_device *mdp_dev)
> -{
> -#define MDP_MAX_TIMEOUTS 20
> -	static int timeout_count;
> -	struct mdp_info *mdp = container_of(mdp_dev, struct mdp_info, mdp_dev);
> -
> -	if (mdp_wait(mdp, DL0_DMA2_TERM_DONE, &mdp_dma2_waitqueue) == -ETIMEDOUT)
> -		timeout_count++;
> -	else
> -		timeout_count = 0;
> -
> -	if (timeout_count > MDP_MAX_TIMEOUTS) {
> -		printk(KERN_ERR "mdp: dma failed %d times, somethings wrong!\n",
> -		       MDP_MAX_TIMEOUTS);
> -		BUG();
> -	}
> -}
> -
> -static int mdp_ppp_wait(struct mdp_info *mdp)
> -{
> -	return mdp_wait(mdp, DL0_ROI_DONE, &mdp_ppp_waitqueue);
> -}
> -
> -void mdp_dma_to_mddi(struct mdp_info *mdp, uint32_t addr, uint32_t stride,
> -		     uint32_t width, uint32_t height, uint32_t x, uint32_t y,
> -		     struct msmfb_callback *callback)
> -{
> -	uint32_t dma2_cfg;
> -	uint16_t ld_param = 0; /* 0=PRIM, 1=SECD, 2=EXT */
> -
> -	if (enable_mdp_irq(mdp, DL0_DMA2_TERM_DONE)) {
> -		printk(KERN_ERR "mdp_dma_to_mddi: busy\n");
> -		return;
> -	}
> -
> -	dma_callback = callback;
> -
> -	dma2_cfg = DMA_PACK_TIGHT |
> -		DMA_PACK_ALIGN_LSB |
> -		DMA_PACK_PATTERN_RGB |
> -		DMA_OUT_SEL_AHB |
> -		DMA_IBUF_NONCONTIGUOUS;
> -
> -	dma2_cfg |= DMA_IBUF_FORMAT_RGB565;
> -
> -	dma2_cfg |= DMA_OUT_SEL_MDDI;
> -
> -	dma2_cfg |= DMA_MDDI_DMAOUT_LCD_SEL_PRIMARY;
> -
> -	dma2_cfg |= DMA_DITHER_EN;
> -
> -	/* setup size, address, and stride */
> -	mdp_writel(mdp, (height << 16) | (width),
> -		   MDP_CMD_DEBUG_ACCESS_BASE + 0x0184);
> -	mdp_writel(mdp, addr, MDP_CMD_DEBUG_ACCESS_BASE + 0x0188);
> -	mdp_writel(mdp, stride, MDP_CMD_DEBUG_ACCESS_BASE + 0x018C);
> -
> -	/* 666 18BPP */
> -	dma2_cfg |= DMA_DSTC0G_6BITS | DMA_DSTC1B_6BITS | DMA_DSTC2R_6BITS;
> -
> -	/* set y & x offset and MDDI transaction parameters */
> -	mdp_writel(mdp, (y << 16) | (x), MDP_CMD_DEBUG_ACCESS_BASE + 0x0194);
> -	mdp_writel(mdp, ld_param, MDP_CMD_DEBUG_ACCESS_BASE + 0x01a0);
> -	mdp_writel(mdp, (MDDI_VDO_PACKET_DESC << 16) | MDDI_VDO_PACKET_PRIM,
> -		   MDP_CMD_DEBUG_ACCESS_BASE + 0x01a4);
> -
> -	mdp_writel(mdp, dma2_cfg, MDP_CMD_DEBUG_ACCESS_BASE + 0x0180);
> -
> -	/* start DMA2 */
> -	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x0044);
> -}
> -
> -void mdp_dma(struct mdp_device *mdp_dev, uint32_t addr, uint32_t stride,
> -	     uint32_t width, uint32_t height, uint32_t x, uint32_t y,
> -	     struct msmfb_callback *callback, int interface)
> -{
> -	struct mdp_info *mdp = container_of(mdp_dev, struct mdp_info, mdp_dev);
> -
> -	if (interface == MSM_MDDI_PMDH_INTERFACE) {
> -		mdp_dma_to_mddi(mdp, addr, stride, width, height, x, y,
> -				callback);
> -	}
> -}
> -
> -int get_img(struct mdp_img *img, struct fb_info *info,
> -	    unsigned long *start, unsigned long *len,
> -	    struct file **filep)
> -{
> -	int ret = 0;
> -	struct fd f = fdget(img->memory_id);
> -	if (f.file == NULL)
> -		return -1;
> -
> -	if (MAJOR(file_inode(f.file)->i_rdev) == FB_MAJOR) {
> -		*start = info->fix.smem_start;
> -		*len = info->fix.smem_len;
> -	} else
> -		ret = -1;
> -	fdput(f);
> -
> -	return ret;
> -}
> -
> -void put_img(struct file *src_file, struct file *dst_file)
> -{
> -}
> -
> -int mdp_blit(struct mdp_device *mdp_dev, struct fb_info *fb,
> -	     struct mdp_blit_req *req)
> -{
> -	int ret;
> -	unsigned long src_start = 0, src_len = 0, dst_start = 0, dst_len = 0;
> -	struct mdp_info *mdp = container_of(mdp_dev, struct mdp_info, mdp_dev);
> -	struct file *src_file = 0, *dst_file = 0;
> -
> -	/* WORKAROUND FOR HARDWARE BUG IN BG TILE FETCH */
> -	if (unlikely(req->src_rect.h == 0 ||
> -		     req->src_rect.w == 0)) {
> -		printk(KERN_ERR "mpd_ppp: src img of zero size!\n");
> -		return -EINVAL;
> -	}
> -	if (unlikely(req->dst_rect.h == 0 ||
> -		     req->dst_rect.w == 0))
> -		return -EINVAL;
> -
> -	/* do this first so that if this fails, the caller can always
> -	 * safely call put_img */
> -	if (unlikely(get_img(&req->src, fb, &src_start, &src_len, &src_file))) {
> -		printk(KERN_ERR "mpd_ppp: could not retrieve src image from "
> -				"memory\n");
> -		return -EINVAL;
> -	}
> -
> -	if (unlikely(get_img(&req->dst, fb, &dst_start, &dst_len, &dst_file))) {
> -		printk(KERN_ERR "mpd_ppp: could not retrieve dst image from "
> -				"memory\n");
> -		return -EINVAL;
> -	}
> -	mutex_lock(&mdp_mutex);
> -
> -	/* transp_masking unimplemented */
> -	req->transp_mask = MDP_TRANSP_NOP;
> -	if (unlikely((req->transp_mask != MDP_TRANSP_NOP ||
> -		      req->alpha != MDP_ALPHA_NOP ||
> -		      HAS_ALPHA(req->src.format)) &&
> -		     (req->flags & MDP_ROT_90 &&
> -		      req->dst_rect.w <= 16 && req->dst_rect.h >= 16))) {
> -		int i;
> -		unsigned int tiles = req->dst_rect.h / 16;
> -		unsigned int remainder = req->dst_rect.h % 16;
> -		req->src_rect.w = 16*req->src_rect.w / req->dst_rect.h;
> -		req->dst_rect.h = 16;
> -		for (i = 0; i < tiles; i++) {
> -			enable_mdp_irq(mdp, DL0_ROI_DONE);
> -			ret = mdp_ppp_blit(mdp, req, src_file, src_start,
> -					   src_len, dst_file, dst_start,
> -					   dst_len);
> -			if (ret)
> -				goto err_bad_blit;
> -			ret = mdp_ppp_wait(mdp);
> -			if (ret)
> -				goto err_wait_failed;
> -			req->dst_rect.y += 16;
> -			req->src_rect.x += req->src_rect.w;
> -		}
> -		if (!remainder)
> -			goto end;
> -		req->src_rect.w = remainder*req->src_rect.w / req->dst_rect.h;
> -		req->dst_rect.h = remainder;
> -	}
> -	enable_mdp_irq(mdp, DL0_ROI_DONE);
> -	ret = mdp_ppp_blit(mdp, req, src_file, src_start, src_len, dst_file,
> -			   dst_start,
> -			   dst_len);
> -	if (ret)
> -		goto err_bad_blit;
> -	ret = mdp_ppp_wait(mdp);
> -	if (ret)
> -		goto err_wait_failed;
> -end:
> -	put_img(src_file, dst_file);
> -	mutex_unlock(&mdp_mutex);
> -	return 0;
> -err_bad_blit:
> -	disable_mdp_irq(mdp, DL0_ROI_DONE);
> -err_wait_failed:
> -	put_img(src_file, dst_file);
> -	mutex_unlock(&mdp_mutex);
> -	return ret;
> -}
> -
> -void mdp_set_grp_disp(struct mdp_device *mdp_dev, unsigned disp_id)
> -{
> -	struct mdp_info *mdp = container_of(mdp_dev, struct mdp_info, mdp_dev);
> -
> -	disp_id &= 0xf;
> -	mdp_writel(mdp, disp_id, MDP_FULL_BYPASS_WORD43);
> -}
> -
> -int register_mdp_client(struct class_interface *cint)
> -{
> -	if (!mdp_class) {
> -		pr_err("mdp: no mdp_class when registering mdp client\n");
> -		return -ENODEV;
> -	}
> -	cint->class = mdp_class;
> -	return class_interface_register(cint);
> -}
> -
> -#include "mdp_csc_table.h"
> -#include "mdp_scale_tables.h"
> -
> -int mdp_probe(struct platform_device *pdev)
> -{
> -	struct resource *resource;
> -	int ret;
> -	int n;
> -	struct mdp_info *mdp;
> -
> -	resource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (!resource) {
> -		pr_err("mdp: can not get mdp mem resource!\n");
> -		return -ENOMEM;
> -	}
> -
> -	mdp = kzalloc(sizeof(struct mdp_info), GFP_KERNEL);
> -	if (!mdp)
> -		return -ENOMEM;
> -
> -	mdp->irq = platform_get_irq(pdev, 0);
> -	if (mdp->irq < 0) {
> -		pr_err("mdp: can not get mdp irq\n");
> -		ret = mdp->irq;
> -		goto error_get_irq;
> -	}
> -
> -	mdp->base = ioremap(resource->start, resource_size(resource));
> -	if (mdp->base == 0) {
> -		printk(KERN_ERR "msmfb: cannot allocate mdp regs!\n");
> -		ret = -ENOMEM;
> -		goto error_ioremap;
> -	}
> -
> -	mdp->mdp_dev.dma = mdp_dma;
> -	mdp->mdp_dev.dma_wait = mdp_dma_wait;
> -	mdp->mdp_dev.blit = mdp_blit;
> -	mdp->mdp_dev.set_grp_disp = mdp_set_grp_disp;
> -
> -	clk = clk_get(&pdev->dev, "mdp_clk");
> -	if (IS_ERR(clk)) {
> -		printk(KERN_INFO "mdp: failed to get mdp clk");
> -		ret = PTR_ERR(clk);
> -		goto error_get_clk;
> -	}
> -
> -	ret = request_irq(mdp->irq, mdp_isr, 0, "msm_mdp", mdp);
> -	if (ret)
> -		goto error_request_irq;
> -	disable_irq(mdp->irq);
> -	mdp_irq_mask = 0;
> -
> -	/* debug interface write access */
> -	mdp_writel(mdp, 1, 0x60);
> -
> -	mdp_writel(mdp, MDP_ANY_INTR_MASK, MDP_INTR_ENABLE);
> -	mdp_writel(mdp, 1, MDP_EBI2_PORTMAP_MODE);
> -
> -	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x01f8);
> -	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x01fc);
> -
> -	for (n = 0; n < ARRAY_SIZE(csc_table); n++)
> -		mdp_writel(mdp, csc_table[n].val, csc_table[n].reg);
> -
> -	/* clear up unused fg/main registers */
> -	/* comp.plane 2&3 ystride */
> -	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x0120);
> -
> -	/* unpacked pattern */
> -	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x012c);
> -	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x0130);
> -	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x0134);
> -	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x0158);
> -	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x015c);
> -	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x0160);
> -	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x0170);
> -	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x0174);
> -	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x017c);
> -
> -	/* comp.plane 2 & 3 */
> -	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x0114);
> -	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x0118);
> -
> -	/* clear unused bg registers */
> -	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x01c8);
> -	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x01d0);
> -	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x01dc);
> -	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x01e0);
> -	mdp_writel(mdp, 0, MDP_CMD_DEBUG_ACCESS_BASE + 0x01e4);
> -
> -	for (n = 0; n < ARRAY_SIZE(mdp_upscale_table); n++)
> -		mdp_writel(mdp, mdp_upscale_table[n].val,
> -		       mdp_upscale_table[n].reg);
> -
> -	for (n = 0; n < 9; n++)
> -		mdp_writel(mdp, mdp_default_ccs[n], 0x40440 + 4 * n);
> -	mdp_writel(mdp, mdp_default_ccs[9], 0x40500 + 4 * 0);
> -	mdp_writel(mdp, mdp_default_ccs[10], 0x40500 + 4 * 0);
> -	mdp_writel(mdp, mdp_default_ccs[11], 0x40500 + 4 * 0);
> -
> -	/* register mdp device */
> -	mdp->mdp_dev.dev.parent = &pdev->dev;
> -	mdp->mdp_dev.dev.class = mdp_class;
> -	dev_set_name(&mdp->mdp_dev.dev, "mdp%d", pdev->id);
> -
> -	/* if you can remove the platform device you'd have to implement
> -	 * this:
> -	mdp_dev.release = mdp_class; */
> -
> -	ret = device_register(&mdp->mdp_dev.dev);
> -	if (ret)
> -		goto error_device_register;
> -	return 0;
> -
> -error_device_register:
> -	free_irq(mdp->irq, mdp);
> -error_request_irq:
> -error_get_clk:
> -	iounmap(mdp->base);
> -error_get_irq:
> -error_ioremap:
> -	kfree(mdp);
> -	return ret;
> -}
> -
> -static struct platform_driver msm_mdp_driver = {
> -	.probe = mdp_probe,
> -	.driver = {.name = "msm_mdp"},
> -};
> -
> -static int __init mdp_init(void)
> -{
> -	mdp_class = class_create(THIS_MODULE, "msm_mdp");
> -	if (IS_ERR(mdp_class)) {
> -		printk(KERN_ERR "Error creating mdp class\n");
> -		return PTR_ERR(mdp_class);
> -	}
> -	return platform_driver_register(&msm_mdp_driver);
> -}
> -
> -subsys_initcall(mdp_init);
> diff --git a/drivers/video/fbdev/msm/mdp_csc_table.h b/drivers/video/fbdev/msm/mdp_csc_table.h
> deleted file mode 100644
> index d1cde30ead52..000000000000
> --- a/drivers/video/fbdev/msm/mdp_csc_table.h
> +++ /dev/null
> @@ -1,582 +0,0 @@
> -/* drivers/video/msm_fb/mdp_csc_table.h
> - *
> - * Copyright (C) 2007 QUALCOMM Incorporated
> - * Copyright (C) 2007 Google Incorporated
> - *
> - * 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.
> - */
> -
> -static struct {
> -	uint32_t reg;
> -	uint32_t val;
> -} csc_table[] = {
> -	{ 0x40400, 0x83 },
> -	{ 0x40404, 0x102 },
> -	{ 0x40408, 0x32 },
> -	{ 0x4040c, 0xffffffb5 },
> -	{ 0x40410, 0xffffff6c },
> -	{ 0x40414, 0xe1 },
> -	{ 0x40418, 0xe1 },
> -	{ 0x4041c, 0xffffff45 },
> -	{ 0x40420, 0xffffffdc },
> -	{ 0x40440, 0x254 },
> -	{ 0x40444, 0x0 },
> -	{ 0x40448, 0x331 },
> -	{ 0x4044c, 0x254 },
> -	{ 0x40450, 0xffffff38 },
> -	{ 0x40454, 0xfffffe61 },
> -	{ 0x40458, 0x254 },
> -	{ 0x4045c, 0x409 },
> -	{ 0x40460, 0x0 },
> -	{ 0x40480, 0x5d },
> -	{ 0x40484, 0x13a },
> -	{ 0x40488, 0x20 },
> -	{ 0x4048c, 0xffffffcd },
> -	{ 0x40490, 0xffffff54 },
> -	{ 0x40494, 0xe1 },
> -	{ 0x40498, 0xe1 },
> -	{ 0x4049c, 0xffffff35 },
> -	{ 0x404a0, 0xffffffec },
> -	{ 0x404c0, 0x254 },
> -	{ 0x404c4, 0x0 },
> -	{ 0x404c8, 0x396 },
> -	{ 0x404cc, 0x254 },
> -	{ 0x404d0, 0xffffff94 },
> -	{ 0x404d4, 0xfffffef0 },
> -	{ 0x404d8, 0x254 },
> -	{ 0x404dc, 0x43a },
> -	{ 0x404e0, 0x0 },
> -	{ 0x40500, 0x10 },
> -	{ 0x40504, 0x80 },
> -	{ 0x40508, 0x80 },
> -	{ 0x40540, 0x10 },
> -	{ 0x40544, 0x80 },
> -	{ 0x40548, 0x80 },
> -	{ 0x40580, 0x10 },
> -	{ 0x40584, 0xeb },
> -	{ 0x40588, 0x10 },
> -	{ 0x4058c, 0xf0 },
> -	{ 0x405c0, 0x10 },
> -	{ 0x405c4, 0xeb },
> -	{ 0x405c8, 0x10 },
> -	{ 0x405cc, 0xf0 },
> -	{ 0x40800, 0x0 },
> -	{ 0x40804, 0x151515 },
> -	{ 0x40808, 0x1d1d1d },
> -	{ 0x4080c, 0x232323 },
> -	{ 0x40810, 0x272727 },
> -	{ 0x40814, 0x2b2b2b },
> -	{ 0x40818, 0x2f2f2f },
> -	{ 0x4081c, 0x333333 },
> -	{ 0x40820, 0x363636 },
> -	{ 0x40824, 0x393939 },
> -	{ 0x40828, 0x3b3b3b },
> -	{ 0x4082c, 0x3e3e3e },
> -	{ 0x40830, 0x404040 },
> -	{ 0x40834, 0x434343 },
> -	{ 0x40838, 0x454545 },
> -	{ 0x4083c, 0x474747 },
> -	{ 0x40840, 0x494949 },
> -	{ 0x40844, 0x4b4b4b },
> -	{ 0x40848, 0x4d4d4d },
> -	{ 0x4084c, 0x4f4f4f },
> -	{ 0x40850, 0x515151 },
> -	{ 0x40854, 0x535353 },
> -	{ 0x40858, 0x555555 },
> -	{ 0x4085c, 0x565656 },
> -	{ 0x40860, 0x585858 },
> -	{ 0x40864, 0x5a5a5a },
> -	{ 0x40868, 0x5b5b5b },
> -	{ 0x4086c, 0x5d5d5d },
> -	{ 0x40870, 0x5e5e5e },
> -	{ 0x40874, 0x606060 },
> -	{ 0x40878, 0x616161 },
> -	{ 0x4087c, 0x636363 },
> -	{ 0x40880, 0x646464 },
> -	{ 0x40884, 0x666666 },
> -	{ 0x40888, 0x676767 },
> -	{ 0x4088c, 0x686868 },
> -	{ 0x40890, 0x6a6a6a },
> -	{ 0x40894, 0x6b6b6b },
> -	{ 0x40898, 0x6c6c6c },
> -	{ 0x4089c, 0x6e6e6e },
> -	{ 0x408a0, 0x6f6f6f },
> -	{ 0x408a4, 0x707070 },
> -	{ 0x408a8, 0x717171 },
> -	{ 0x408ac, 0x727272 },
> -	{ 0x408b0, 0x747474 },
> -	{ 0x408b4, 0x757575 },
> -	{ 0x408b8, 0x767676 },
> -	{ 0x408bc, 0x777777 },
> -	{ 0x408c0, 0x787878 },
> -	{ 0x408c4, 0x797979 },
> -	{ 0x408c8, 0x7a7a7a },
> -	{ 0x408cc, 0x7c7c7c },
> -	{ 0x408d0, 0x7d7d7d },
> -	{ 0x408d4, 0x7e7e7e },
> -	{ 0x408d8, 0x7f7f7f },
> -	{ 0x408dc, 0x808080 },
> -	{ 0x408e0, 0x818181 },
> -	{ 0x408e4, 0x828282 },
> -	{ 0x408e8, 0x838383 },
> -	{ 0x408ec, 0x848484 },
> -	{ 0x408f0, 0x858585 },
> -	{ 0x408f4, 0x868686 },
> -	{ 0x408f8, 0x878787 },
> -	{ 0x408fc, 0x888888 },
> -	{ 0x40900, 0x898989 },
> -	{ 0x40904, 0x8a8a8a },
> -	{ 0x40908, 0x8b8b8b },
> -	{ 0x4090c, 0x8c8c8c },
> -	{ 0x40910, 0x8d8d8d },
> -	{ 0x40914, 0x8e8e8e },
> -	{ 0x40918, 0x8f8f8f },
> -	{ 0x4091c, 0x8f8f8f },
> -	{ 0x40920, 0x909090 },
> -	{ 0x40924, 0x919191 },
> -	{ 0x40928, 0x929292 },
> -	{ 0x4092c, 0x939393 },
> -	{ 0x40930, 0x949494 },
> -	{ 0x40934, 0x959595 },
> -	{ 0x40938, 0x969696 },
> -	{ 0x4093c, 0x969696 },
> -	{ 0x40940, 0x979797 },
> -	{ 0x40944, 0x989898 },
> -	{ 0x40948, 0x999999 },
> -	{ 0x4094c, 0x9a9a9a },
> -	{ 0x40950, 0x9b9b9b },
> -	{ 0x40954, 0x9c9c9c },
> -	{ 0x40958, 0x9c9c9c },
> -	{ 0x4095c, 0x9d9d9d },
> -	{ 0x40960, 0x9e9e9e },
> -	{ 0x40964, 0x9f9f9f },
> -	{ 0x40968, 0xa0a0a0 },
> -	{ 0x4096c, 0xa0a0a0 },
> -	{ 0x40970, 0xa1a1a1 },
> -	{ 0x40974, 0xa2a2a2 },
> -	{ 0x40978, 0xa3a3a3 },
> -	{ 0x4097c, 0xa4a4a4 },
> -	{ 0x40980, 0xa4a4a4 },
> -	{ 0x40984, 0xa5a5a5 },
> -	{ 0x40988, 0xa6a6a6 },
> -	{ 0x4098c, 0xa7a7a7 },
> -	{ 0x40990, 0xa7a7a7 },
> -	{ 0x40994, 0xa8a8a8 },
> -	{ 0x40998, 0xa9a9a9 },
> -	{ 0x4099c, 0xaaaaaa },
> -	{ 0x409a0, 0xaaaaaa },
> -	{ 0x409a4, 0xababab },
> -	{ 0x409a8, 0xacacac },
> -	{ 0x409ac, 0xadadad },
> -	{ 0x409b0, 0xadadad },
> -	{ 0x409b4, 0xaeaeae },
> -	{ 0x409b8, 0xafafaf },
> -	{ 0x409bc, 0xafafaf },
> -	{ 0x409c0, 0xb0b0b0 },
> -	{ 0x409c4, 0xb1b1b1 },
> -	{ 0x409c8, 0xb2b2b2 },
> -	{ 0x409cc, 0xb2b2b2 },
> -	{ 0x409d0, 0xb3b3b3 },
> -	{ 0x409d4, 0xb4b4b4 },
> -	{ 0x409d8, 0xb4b4b4 },
> -	{ 0x409dc, 0xb5b5b5 },
> -	{ 0x409e0, 0xb6b6b6 },
> -	{ 0x409e4, 0xb6b6b6 },
> -	{ 0x409e8, 0xb7b7b7 },
> -	{ 0x409ec, 0xb8b8b8 },
> -	{ 0x409f0, 0xb8b8b8 },
> -	{ 0x409f4, 0xb9b9b9 },
> -	{ 0x409f8, 0xbababa },
> -	{ 0x409fc, 0xbababa },
> -	{ 0x40a00, 0xbbbbbb },
> -	{ 0x40a04, 0xbcbcbc },
> -	{ 0x40a08, 0xbcbcbc },
> -	{ 0x40a0c, 0xbdbdbd },
> -	{ 0x40a10, 0xbebebe },
> -	{ 0x40a14, 0xbebebe },
> -	{ 0x40a18, 0xbfbfbf },
> -	{ 0x40a1c, 0xc0c0c0 },
> -	{ 0x40a20, 0xc0c0c0 },
> -	{ 0x40a24, 0xc1c1c1 },
> -	{ 0x40a28, 0xc1c1c1 },
> -	{ 0x40a2c, 0xc2c2c2 },
> -	{ 0x40a30, 0xc3c3c3 },
> -	{ 0x40a34, 0xc3c3c3 },
> -	{ 0x40a38, 0xc4c4c4 },
> -	{ 0x40a3c, 0xc5c5c5 },
> -	{ 0x40a40, 0xc5c5c5 },
> -	{ 0x40a44, 0xc6c6c6 },
> -	{ 0x40a48, 0xc6c6c6 },
> -	{ 0x40a4c, 0xc7c7c7 },
> -	{ 0x40a50, 0xc8c8c8 },
> -	{ 0x40a54, 0xc8c8c8 },
> -	{ 0x40a58, 0xc9c9c9 },
> -	{ 0x40a5c, 0xc9c9c9 },
> -	{ 0x40a60, 0xcacaca },
> -	{ 0x40a64, 0xcbcbcb },
> -	{ 0x40a68, 0xcbcbcb },
> -	{ 0x40a6c, 0xcccccc },
> -	{ 0x40a70, 0xcccccc },
> -	{ 0x40a74, 0xcdcdcd },
> -	{ 0x40a78, 0xcecece },
> -	{ 0x40a7c, 0xcecece },
> -	{ 0x40a80, 0xcfcfcf },
> -	{ 0x40a84, 0xcfcfcf },
> -	{ 0x40a88, 0xd0d0d0 },
> -	{ 0x40a8c, 0xd0d0d0 },
> -	{ 0x40a90, 0xd1d1d1 },
> -	{ 0x40a94, 0xd2d2d2 },
> -	{ 0x40a98, 0xd2d2d2 },
> -	{ 0x40a9c, 0xd3d3d3 },
> -	{ 0x40aa0, 0xd3d3d3 },
> -	{ 0x40aa4, 0xd4d4d4 },
> -	{ 0x40aa8, 0xd4d4d4 },
> -	{ 0x40aac, 0xd5d5d5 },
> -	{ 0x40ab0, 0xd6d6d6 },
> -	{ 0x40ab4, 0xd6d6d6 },
> -	{ 0x40ab8, 0xd7d7d7 },
> -	{ 0x40abc, 0xd7d7d7 },
> -	{ 0x40ac0, 0xd8d8d8 },
> -	{ 0x40ac4, 0xd8d8d8 },
> -	{ 0x40ac8, 0xd9d9d9 },
> -	{ 0x40acc, 0xd9d9d9 },
> -	{ 0x40ad0, 0xdadada },
> -	{ 0x40ad4, 0xdbdbdb },
> -	{ 0x40ad8, 0xdbdbdb },
> -	{ 0x40adc, 0xdcdcdc },
> -	{ 0x40ae0, 0xdcdcdc },
> -	{ 0x40ae4, 0xdddddd },
> -	{ 0x40ae8, 0xdddddd },
> -	{ 0x40aec, 0xdedede },
> -	{ 0x40af0, 0xdedede },
> -	{ 0x40af4, 0xdfdfdf },
> -	{ 0x40af8, 0xdfdfdf },
> -	{ 0x40afc, 0xe0e0e0 },
> -	{ 0x40b00, 0xe0e0e0 },
> -	{ 0x40b04, 0xe1e1e1 },
> -	{ 0x40b08, 0xe1e1e1 },
> -	{ 0x40b0c, 0xe2e2e2 },
> -	{ 0x40b10, 0xe3e3e3 },
> -	{ 0x40b14, 0xe3e3e3 },
> -	{ 0x40b18, 0xe4e4e4 },
> -	{ 0x40b1c, 0xe4e4e4 },
> -	{ 0x40b20, 0xe5e5e5 },
> -	{ 0x40b24, 0xe5e5e5 },
> -	{ 0x40b28, 0xe6e6e6 },
> -	{ 0x40b2c, 0xe6e6e6 },
> -	{ 0x40b30, 0xe7e7e7 },
> -	{ 0x40b34, 0xe7e7e7 },
> -	{ 0x40b38, 0xe8e8e8 },
> -	{ 0x40b3c, 0xe8e8e8 },
> -	{ 0x40b40, 0xe9e9e9 },
> -	{ 0x40b44, 0xe9e9e9 },
> -	{ 0x40b48, 0xeaeaea },
> -	{ 0x40b4c, 0xeaeaea },
> -	{ 0x40b50, 0xebebeb },
> -	{ 0x40b54, 0xebebeb },
> -	{ 0x40b58, 0xececec },
> -	{ 0x40b5c, 0xececec },
> -	{ 0x40b60, 0xededed },
> -	{ 0x40b64, 0xededed },
> -	{ 0x40b68, 0xeeeeee },
> -	{ 0x40b6c, 0xeeeeee },
> -	{ 0x40b70, 0xefefef },
> -	{ 0x40b74, 0xefefef },
> -	{ 0x40b78, 0xf0f0f0 },
> -	{ 0x40b7c, 0xf0f0f0 },
> -	{ 0x40b80, 0xf1f1f1 },
> -	{ 0x40b84, 0xf1f1f1 },
> -	{ 0x40b88, 0xf2f2f2 },
> -	{ 0x40b8c, 0xf2f2f2 },
> -	{ 0x40b90, 0xf2f2f2 },
> -	{ 0x40b94, 0xf3f3f3 },
> -	{ 0x40b98, 0xf3f3f3 },
> -	{ 0x40b9c, 0xf4f4f4 },
> -	{ 0x40ba0, 0xf4f4f4 },
> -	{ 0x40ba4, 0xf5f5f5 },
> -	{ 0x40ba8, 0xf5f5f5 },
> -	{ 0x40bac, 0xf6f6f6 },
> -	{ 0x40bb0, 0xf6f6f6 },
> -	{ 0x40bb4, 0xf7f7f7 },
> -	{ 0x40bb8, 0xf7f7f7 },
> -	{ 0x40bbc, 0xf8f8f8 },
> -	{ 0x40bc0, 0xf8f8f8 },
> -	{ 0x40bc4, 0xf9f9f9 },
> -	{ 0x40bc8, 0xf9f9f9 },
> -	{ 0x40bcc, 0xfafafa },
> -	{ 0x40bd0, 0xfafafa },
> -	{ 0x40bd4, 0xfafafa },
> -	{ 0x40bd8, 0xfbfbfb },
> -	{ 0x40bdc, 0xfbfbfb },
> -	{ 0x40be0, 0xfcfcfc },
> -	{ 0x40be4, 0xfcfcfc },
> -	{ 0x40be8, 0xfdfdfd },
> -	{ 0x40bec, 0xfdfdfd },
> -	{ 0x40bf0, 0xfefefe },
> -	{ 0x40bf4, 0xfefefe },
> -	{ 0x40bf8, 0xffffff },
> -	{ 0x40bfc, 0xffffff },
> -	{ 0x40c00, 0x0 },
> -	{ 0x40c04, 0x0 },
> -	{ 0x40c08, 0x0 },
> -	{ 0x40c0c, 0x0 },
> -	{ 0x40c10, 0x0 },
> -	{ 0x40c14, 0x0 },
> -	{ 0x40c18, 0x0 },
> -	{ 0x40c1c, 0x0 },
> -	{ 0x40c20, 0x0 },
> -	{ 0x40c24, 0x0 },
> -	{ 0x40c28, 0x0 },
> -	{ 0x40c2c, 0x0 },
> -	{ 0x40c30, 0x0 },
> -	{ 0x40c34, 0x0 },
> -	{ 0x40c38, 0x0 },
> -	{ 0x40c3c, 0x0 },
> -	{ 0x40c40, 0x10101 },
> -	{ 0x40c44, 0x10101 },
> -	{ 0x40c48, 0x10101 },
> -	{ 0x40c4c, 0x10101 },
> -	{ 0x40c50, 0x10101 },
> -	{ 0x40c54, 0x10101 },
> -	{ 0x40c58, 0x10101 },
> -	{ 0x40c5c, 0x10101 },
> -	{ 0x40c60, 0x10101 },
> -	{ 0x40c64, 0x10101 },
> -	{ 0x40c68, 0x20202 },
> -	{ 0x40c6c, 0x20202 },
> -	{ 0x40c70, 0x20202 },
> -	{ 0x40c74, 0x20202 },
> -	{ 0x40c78, 0x20202 },
> -	{ 0x40c7c, 0x20202 },
> -	{ 0x40c80, 0x30303 },
> -	{ 0x40c84, 0x30303 },
> -	{ 0x40c88, 0x30303 },
> -	{ 0x40c8c, 0x30303 },
> -	{ 0x40c90, 0x30303 },
> -	{ 0x40c94, 0x40404 },
> -	{ 0x40c98, 0x40404 },
> -	{ 0x40c9c, 0x40404 },
> -	{ 0x40ca0, 0x40404 },
> -	{ 0x40ca4, 0x40404 },
> -	{ 0x40ca8, 0x50505 },
> -	{ 0x40cac, 0x50505 },
> -	{ 0x40cb0, 0x50505 },
> -	{ 0x40cb4, 0x50505 },
> -	{ 0x40cb8, 0x60606 },
> -	{ 0x40cbc, 0x60606 },
> -	{ 0x40cc0, 0x60606 },
> -	{ 0x40cc4, 0x70707 },
> -	{ 0x40cc8, 0x70707 },
> -	{ 0x40ccc, 0x70707 },
> -	{ 0x40cd0, 0x70707 },
> -	{ 0x40cd4, 0x80808 },
> -	{ 0x40cd8, 0x80808 },
> -	{ 0x40cdc, 0x80808 },
> -	{ 0x40ce0, 0x90909 },
> -	{ 0x40ce4, 0x90909 },
> -	{ 0x40ce8, 0xa0a0a },
> -	{ 0x40cec, 0xa0a0a },
> -	{ 0x40cf0, 0xa0a0a },
> -	{ 0x40cf4, 0xb0b0b },
> -	{ 0x40cf8, 0xb0b0b },
> -	{ 0x40cfc, 0xb0b0b },
> -	{ 0x40d00, 0xc0c0c },
> -	{ 0x40d04, 0xc0c0c },
> -	{ 0x40d08, 0xd0d0d },
> -	{ 0x40d0c, 0xd0d0d },
> -	{ 0x40d10, 0xe0e0e },
> -	{ 0x40d14, 0xe0e0e },
> -	{ 0x40d18, 0xe0e0e },
> -	{ 0x40d1c, 0xf0f0f },
> -	{ 0x40d20, 0xf0f0f },
> -	{ 0x40d24, 0x101010 },
> -	{ 0x40d28, 0x101010 },
> -	{ 0x40d2c, 0x111111 },
> -	{ 0x40d30, 0x111111 },
> -	{ 0x40d34, 0x121212 },
> -	{ 0x40d38, 0x121212 },
> -	{ 0x40d3c, 0x131313 },
> -	{ 0x40d40, 0x131313 },
> -	{ 0x40d44, 0x141414 },
> -	{ 0x40d48, 0x151515 },
> -	{ 0x40d4c, 0x151515 },
> -	{ 0x40d50, 0x161616 },
> -	{ 0x40d54, 0x161616 },
> -	{ 0x40d58, 0x171717 },
> -	{ 0x40d5c, 0x171717 },
> -	{ 0x40d60, 0x181818 },
> -	{ 0x40d64, 0x191919 },
> -	{ 0x40d68, 0x191919 },
> -	{ 0x40d6c, 0x1a1a1a },
> -	{ 0x40d70, 0x1b1b1b },
> -	{ 0x40d74, 0x1b1b1b },
> -	{ 0x40d78, 0x1c1c1c },
> -	{ 0x40d7c, 0x1c1c1c },
> -	{ 0x40d80, 0x1d1d1d },
> -	{ 0x40d84, 0x1e1e1e },
> -	{ 0x40d88, 0x1f1f1f },
> -	{ 0x40d8c, 0x1f1f1f },
> -	{ 0x40d90, 0x202020 },
> -	{ 0x40d94, 0x212121 },
> -	{ 0x40d98, 0x212121 },
> -	{ 0x40d9c, 0x222222 },
> -	{ 0x40da0, 0x232323 },
> -	{ 0x40da4, 0x242424 },
> -	{ 0x40da8, 0x242424 },
> -	{ 0x40dac, 0x252525 },
> -	{ 0x40db0, 0x262626 },
> -	{ 0x40db4, 0x272727 },
> -	{ 0x40db8, 0x272727 },
> -	{ 0x40dbc, 0x282828 },
> -	{ 0x40dc0, 0x292929 },
> -	{ 0x40dc4, 0x2a2a2a },
> -	{ 0x40dc8, 0x2b2b2b },
> -	{ 0x40dcc, 0x2c2c2c },
> -	{ 0x40dd0, 0x2c2c2c },
> -	{ 0x40dd4, 0x2d2d2d },
> -	{ 0x40dd8, 0x2e2e2e },
> -	{ 0x40ddc, 0x2f2f2f },
> -	{ 0x40de0, 0x303030 },
> -	{ 0x40de4, 0x313131 },
> -	{ 0x40de8, 0x323232 },
> -	{ 0x40dec, 0x333333 },
> -	{ 0x40df0, 0x333333 },
> -	{ 0x40df4, 0x343434 },
> -	{ 0x40df8, 0x353535 },
> -	{ 0x40dfc, 0x363636 },
> -	{ 0x40e00, 0x373737 },
> -	{ 0x40e04, 0x383838 },
> -	{ 0x40e08, 0x393939 },
> -	{ 0x40e0c, 0x3a3a3a },
> -	{ 0x40e10, 0x3b3b3b },
> -	{ 0x40e14, 0x3c3c3c },
> -	{ 0x40e18, 0x3d3d3d },
> -	{ 0x40e1c, 0x3e3e3e },
> -	{ 0x40e20, 0x3f3f3f },
> -	{ 0x40e24, 0x404040 },
> -	{ 0x40e28, 0x414141 },
> -	{ 0x40e2c, 0x424242 },
> -	{ 0x40e30, 0x434343 },
> -	{ 0x40e34, 0x444444 },
> -	{ 0x40e38, 0x464646 },
> -	{ 0x40e3c, 0x474747 },
> -	{ 0x40e40, 0x484848 },
> -	{ 0x40e44, 0x494949 },
> -	{ 0x40e48, 0x4a4a4a },
> -	{ 0x40e4c, 0x4b4b4b },
> -	{ 0x40e50, 0x4c4c4c },
> -	{ 0x40e54, 0x4d4d4d },
> -	{ 0x40e58, 0x4f4f4f },
> -	{ 0x40e5c, 0x505050 },
> -	{ 0x40e60, 0x515151 },
> -	{ 0x40e64, 0x525252 },
> -	{ 0x40e68, 0x535353 },
> -	{ 0x40e6c, 0x545454 },
> -	{ 0x40e70, 0x565656 },
> -	{ 0x40e74, 0x575757 },
> -	{ 0x40e78, 0x585858 },
> -	{ 0x40e7c, 0x595959 },
> -	{ 0x40e80, 0x5b5b5b },
> -	{ 0x40e84, 0x5c5c5c },
> -	{ 0x40e88, 0x5d5d5d },
> -	{ 0x40e8c, 0x5e5e5e },
> -	{ 0x40e90, 0x606060 },
> -	{ 0x40e94, 0x616161 },
> -	{ 0x40e98, 0x626262 },
> -	{ 0x40e9c, 0x646464 },
> -	{ 0x40ea0, 0x656565 },
> -	{ 0x40ea4, 0x666666 },
> -	{ 0x40ea8, 0x686868 },
> -	{ 0x40eac, 0x696969 },
> -	{ 0x40eb0, 0x6a6a6a },
> -	{ 0x40eb4, 0x6c6c6c },
> -	{ 0x40eb8, 0x6d6d6d },
> -	{ 0x40ebc, 0x6f6f6f },
> -	{ 0x40ec0, 0x707070 },
> -	{ 0x40ec4, 0x717171 },
> -	{ 0x40ec8, 0x737373 },
> -	{ 0x40ecc, 0x747474 },
> -	{ 0x40ed0, 0x767676 },
> -	{ 0x40ed4, 0x777777 },
> -	{ 0x40ed8, 0x797979 },
> -	{ 0x40edc, 0x7a7a7a },
> -	{ 0x40ee0, 0x7c7c7c },
> -	{ 0x40ee4, 0x7d7d7d },
> -	{ 0x40ee8, 0x7f7f7f },
> -	{ 0x40eec, 0x808080 },
> -	{ 0x40ef0, 0x828282 },
> -	{ 0x40ef4, 0x838383 },
> -	{ 0x40ef8, 0x858585 },
> -	{ 0x40efc, 0x868686 },
> -	{ 0x40f00, 0x888888 },
> -	{ 0x40f04, 0x898989 },
> -	{ 0x40f08, 0x8b8b8b },
> -	{ 0x40f0c, 0x8d8d8d },
> -	{ 0x40f10, 0x8e8e8e },
> -	{ 0x40f14, 0x909090 },
> -	{ 0x40f18, 0x919191 },
> -	{ 0x40f1c, 0x939393 },
> -	{ 0x40f20, 0x959595 },
> -	{ 0x40f24, 0x969696 },
> -	{ 0x40f28, 0x989898 },
> -	{ 0x40f2c, 0x9a9a9a },
> -	{ 0x40f30, 0x9b9b9b },
> -	{ 0x40f34, 0x9d9d9d },
> -	{ 0x40f38, 0x9f9f9f },
> -	{ 0x40f3c, 0xa1a1a1 },
> -	{ 0x40f40, 0xa2a2a2 },
> -	{ 0x40f44, 0xa4a4a4 },
> -	{ 0x40f48, 0xa6a6a6 },
> -	{ 0x40f4c, 0xa7a7a7 },
> -	{ 0x40f50, 0xa9a9a9 },
> -	{ 0x40f54, 0xababab },
> -	{ 0x40f58, 0xadadad },
> -	{ 0x40f5c, 0xafafaf },
> -	{ 0x40f60, 0xb0b0b0 },
> -	{ 0x40f64, 0xb2b2b2 },
> -	{ 0x40f68, 0xb4b4b4 },
> -	{ 0x40f6c, 0xb6b6b6 },
> -	{ 0x40f70, 0xb8b8b8 },
> -	{ 0x40f74, 0xbababa },
> -	{ 0x40f78, 0xbbbbbb },
> -	{ 0x40f7c, 0xbdbdbd },
> -	{ 0x40f80, 0xbfbfbf },
> -	{ 0x40f84, 0xc1c1c1 },
> -	{ 0x40f88, 0xc3c3c3 },
> -	{ 0x40f8c, 0xc5c5c5 },
> -	{ 0x40f90, 0xc7c7c7 },
> -	{ 0x40f94, 0xc9c9c9 },
> -	{ 0x40f98, 0xcbcbcb },
> -	{ 0x40f9c, 0xcdcdcd },
> -	{ 0x40fa0, 0xcfcfcf },
> -	{ 0x40fa4, 0xd1d1d1 },
> -	{ 0x40fa8, 0xd3d3d3 },
> -	{ 0x40fac, 0xd5d5d5 },
> -	{ 0x40fb0, 0xd7d7d7 },
> -	{ 0x40fb4, 0xd9d9d9 },
> -	{ 0x40fb8, 0xdbdbdb },
> -	{ 0x40fbc, 0xdddddd },
> -	{ 0x40fc0, 0xdfdfdf },
> -	{ 0x40fc4, 0xe1e1e1 },
> -	{ 0x40fc8, 0xe3e3e3 },
> -	{ 0x40fcc, 0xe5e5e5 },
> -	{ 0x40fd0, 0xe7e7e7 },
> -	{ 0x40fd4, 0xe9e9e9 },
> -	{ 0x40fd8, 0xebebeb },
> -	{ 0x40fdc, 0xeeeeee },
> -	{ 0x40fe0, 0xf0f0f0 },
> -	{ 0x40fe4, 0xf2f2f2 },
> -	{ 0x40fe8, 0xf4f4f4 },
> -	{ 0x40fec, 0xf6f6f6 },
> -	{ 0x40ff0, 0xf8f8f8 },
> -	{ 0x40ff4, 0xfbfbfb },
> -	{ 0x40ff8, 0xfdfdfd },
> -	{ 0x40ffc, 0xffffff },
> -};
> diff --git a/drivers/video/fbdev/msm/mdp_hw.h b/drivers/video/fbdev/msm/mdp_hw.h
> deleted file mode 100644
> index 35848d741001..000000000000
> --- a/drivers/video/fbdev/msm/mdp_hw.h
> +++ /dev/null
> @@ -1,627 +0,0 @@
> -/* drivers/video/msm_fb/mdp_hw.h
> - *
> - * Copyright (C) 2007 QUALCOMM Incorporated
> - * Copyright (C) 2007 Google Incorporated
> - *
> - * 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.
> - */
> -#ifndef _MDP_HW_H_
> -#define _MDP_HW_H_
> -
> -#include <linux/platform_data/video-msm_fb.h>
> -
> -struct mdp_info {
> -	struct mdp_device mdp_dev;
> -	char * __iomem base;
> -	int irq;
> -};
> -struct mdp_blit_req;
> -struct mdp_device;
> -int mdp_ppp_blit(const struct mdp_info *mdp, struct mdp_blit_req *req,
> -		 struct file *src_file, unsigned long src_start,
> -		 unsigned long src_len, struct file *dst_file,
> -		 unsigned long dst_start, unsigned long dst_len);
> -#define mdp_writel(mdp, value, offset) writel(value, mdp->base + offset)
> -#define mdp_readl(mdp, offset) readl(mdp->base + offset)
> -
> -#define MDP_SYNC_CONFIG_0                (0x00000)
> -#define MDP_SYNC_CONFIG_1                (0x00004)
> -#define MDP_SYNC_CONFIG_2                (0x00008)
> -#define MDP_SYNC_STATUS_0                (0x0000c)
> -#define MDP_SYNC_STATUS_1                (0x00010)
> -#define MDP_SYNC_STATUS_2                (0x00014)
> -#define MDP_SYNC_THRESH_0                (0x00018)
> -#define MDP_SYNC_THRESH_1                (0x0001c)
> -#define MDP_INTR_ENABLE                  (0x00020)
> -#define MDP_INTR_STATUS                  (0x00024)
> -#define MDP_INTR_CLEAR                   (0x00028)
> -#define MDP_DISPLAY0_START               (0x00030)
> -#define MDP_DISPLAY1_START               (0x00034)
> -#define MDP_DISPLAY_STATUS               (0x00038)
> -#define MDP_EBI2_LCD0                    (0x0003c)
> -#define MDP_EBI2_LCD1                    (0x00040)
> -#define MDP_DISPLAY0_ADDR                (0x00054)
> -#define MDP_DISPLAY1_ADDR                (0x00058)
> -#define MDP_EBI2_PORTMAP_MODE            (0x0005c)
> -#define MDP_MODE                         (0x00060)
> -#define MDP_TV_OUT_STATUS                (0x00064)
> -#define MDP_HW_VERSION                   (0x00070)
> -#define MDP_SW_RESET                     (0x00074)
> -#define MDP_AXI_ERROR_MASTER_STOP        (0x00078)
> -#define MDP_SEL_CLK_OR_HCLK_TEST_BUS     (0x0007c)
> -#define MDP_PRIMARY_VSYNC_OUT_CTRL       (0x00080)
> -#define MDP_SECONDARY_VSYNC_OUT_CTRL     (0x00084)
> -#define MDP_EXTERNAL_VSYNC_OUT_CTRL      (0x00088)
> -#define MDP_VSYNC_CTRL                   (0x0008c)
> -#define MDP_CGC_EN                       (0x00100)
> -#define MDP_CMD_STATUS                   (0x10008)
> -#define MDP_PROFILE_EN                   (0x10010)
> -#define MDP_PROFILE_COUNT                (0x10014)
> -#define MDP_DMA_START                    (0x10044)
> -#define MDP_FULL_BYPASS_WORD0            (0x10100)
> -#define MDP_FULL_BYPASS_WORD1            (0x10104)
> -#define MDP_COMMAND_CONFIG               (0x10104)
> -#define MDP_FULL_BYPASS_WORD2            (0x10108)
> -#define MDP_FULL_BYPASS_WORD3            (0x1010c)
> -#define MDP_FULL_BYPASS_WORD4            (0x10110)
> -#define MDP_FULL_BYPASS_WORD6            (0x10118)
> -#define MDP_FULL_BYPASS_WORD7            (0x1011c)
> -#define MDP_FULL_BYPASS_WORD8            (0x10120)
> -#define MDP_FULL_BYPASS_WORD9            (0x10124)
> -#define MDP_PPP_SOURCE_CONFIG            (0x10124)
> -#define MDP_FULL_BYPASS_WORD10           (0x10128)
> -#define MDP_FULL_BYPASS_WORD11           (0x1012c)
> -#define MDP_FULL_BYPASS_WORD12           (0x10130)
> -#define MDP_FULL_BYPASS_WORD13           (0x10134)
> -#define MDP_FULL_BYPASS_WORD14           (0x10138)
> -#define MDP_PPP_OPERATION_CONFIG         (0x10138)
> -#define MDP_FULL_BYPASS_WORD15           (0x1013c)
> -#define MDP_FULL_BYPASS_WORD16           (0x10140)
> -#define MDP_FULL_BYPASS_WORD17           (0x10144)
> -#define MDP_FULL_BYPASS_WORD18           (0x10148)
> -#define MDP_FULL_BYPASS_WORD19           (0x1014c)
> -#define MDP_FULL_BYPASS_WORD20           (0x10150)
> -#define MDP_PPP_DESTINATION_CONFIG       (0x10150)
> -#define MDP_FULL_BYPASS_WORD21           (0x10154)
> -#define MDP_FULL_BYPASS_WORD22           (0x10158)
> -#define MDP_FULL_BYPASS_WORD23           (0x1015c)
> -#define MDP_FULL_BYPASS_WORD24           (0x10160)
> -#define MDP_FULL_BYPASS_WORD25           (0x10164)
> -#define MDP_FULL_BYPASS_WORD26           (0x10168)
> -#define MDP_FULL_BYPASS_WORD27           (0x1016c)
> -#define MDP_FULL_BYPASS_WORD29           (0x10174)
> -#define MDP_FULL_BYPASS_WORD30           (0x10178)
> -#define MDP_FULL_BYPASS_WORD31           (0x1017c)
> -#define MDP_FULL_BYPASS_WORD32           (0x10180)
> -#define MDP_DMA_CONFIG                   (0x10180)
> -#define MDP_FULL_BYPASS_WORD33           (0x10184)
> -#define MDP_FULL_BYPASS_WORD34           (0x10188)
> -#define MDP_FULL_BYPASS_WORD35           (0x1018c)
> -#define MDP_FULL_BYPASS_WORD37           (0x10194)
> -#define MDP_FULL_BYPASS_WORD39           (0x1019c)
> -#define MDP_FULL_BYPASS_WORD40           (0x101a0)
> -#define MDP_FULL_BYPASS_WORD41           (0x101a4)
> -#define MDP_FULL_BYPASS_WORD43           (0x101ac)
> -#define MDP_FULL_BYPASS_WORD46           (0x101b8)
> -#define MDP_FULL_BYPASS_WORD47           (0x101bc)
> -#define MDP_FULL_BYPASS_WORD48           (0x101c0)
> -#define MDP_FULL_BYPASS_WORD49           (0x101c4)
> -#define MDP_FULL_BYPASS_WORD50           (0x101c8)
> -#define MDP_FULL_BYPASS_WORD51           (0x101cc)
> -#define MDP_FULL_BYPASS_WORD52           (0x101d0)
> -#define MDP_FULL_BYPASS_WORD53           (0x101d4)
> -#define MDP_FULL_BYPASS_WORD54           (0x101d8)
> -#define MDP_FULL_BYPASS_WORD55           (0x101dc)
> -#define MDP_FULL_BYPASS_WORD56           (0x101e0)
> -#define MDP_FULL_BYPASS_WORD57           (0x101e4)
> -#define MDP_FULL_BYPASS_WORD58           (0x101e8)
> -#define MDP_FULL_BYPASS_WORD59           (0x101ec)
> -#define MDP_FULL_BYPASS_WORD60           (0x101f0)
> -#define MDP_VSYNC_THRESHOLD              (0x101f0)
> -#define MDP_FULL_BYPASS_WORD61           (0x101f4)
> -#define MDP_FULL_BYPASS_WORD62           (0x101f8)
> -#define MDP_FULL_BYPASS_WORD63           (0x101fc)
> -#define MDP_TFETCH_TEST_MODE             (0x20004)
> -#define MDP_TFETCH_STATUS                (0x20008)
> -#define MDP_TFETCH_TILE_COUNT            (0x20010)
> -#define MDP_TFETCH_FETCH_COUNT           (0x20014)
> -#define MDP_TFETCH_CONSTANT_COLOR        (0x20040)
> -#define MDP_CSC_BYPASS                   (0x40004)
> -#define MDP_SCALE_COEFF_LSB              (0x5fffc)
> -#define MDP_TV_OUT_CTL                   (0xc0000)
> -#define MDP_TV_OUT_FIR_COEFF             (0xc0004)
> -#define MDP_TV_OUT_BUF_ADDR              (0xc0008)
> -#define MDP_TV_OUT_CC_DATA               (0xc000c)
> -#define MDP_TV_OUT_SOBEL                 (0xc0010)
> -#define MDP_TV_OUT_Y_CLAMP               (0xc0018)
> -#define MDP_TV_OUT_CB_CLAMP              (0xc001c)
> -#define MDP_TV_OUT_CR_CLAMP              (0xc0020)
> -#define MDP_TEST_MODE_CLK                (0xd0000)
> -#define MDP_TEST_MISR_RESET_CLK          (0xd0004)
> -#define MDP_TEST_EXPORT_MISR_CLK         (0xd0008)
> -#define MDP_TEST_MISR_CURR_VAL_CLK       (0xd000c)
> -#define MDP_TEST_MODE_HCLK               (0xd0100)
> -#define MDP_TEST_MISR_RESET_HCLK         (0xd0104)
> -#define MDP_TEST_EXPORT_MISR_HCLK        (0xd0108)
> -#define MDP_TEST_MISR_CURR_VAL_HCLK      (0xd010c)
> -#define MDP_TEST_MODE_DCLK               (0xd0200)
> -#define MDP_TEST_MISR_RESET_DCLK         (0xd0204)
> -#define MDP_TEST_EXPORT_MISR_DCLK        (0xd0208)
> -#define MDP_TEST_MISR_CURR_VAL_DCLK      (0xd020c)
> -#define MDP_TEST_CAPTURED_DCLK           (0xd0210)
> -#define MDP_TEST_MISR_CAPT_VAL_DCLK      (0xd0214)
> -#define MDP_LCDC_CTL                     (0xe0000)
> -#define MDP_LCDC_HSYNC_CTL               (0xe0004)
> -#define MDP_LCDC_VSYNC_CTL               (0xe0008)
> -#define MDP_LCDC_ACTIVE_HCTL             (0xe000c)
> -#define MDP_LCDC_ACTIVE_VCTL             (0xe0010)
> -#define MDP_LCDC_BORDER_CLR              (0xe0014)
> -#define MDP_LCDC_H_BLANK                 (0xe0018)
> -#define MDP_LCDC_V_BLANK                 (0xe001c)
> -#define MDP_LCDC_UNDERFLOW_CLR           (0xe0020)
> -#define MDP_LCDC_HSYNC_SKEW              (0xe0024)
> -#define MDP_LCDC_TEST_CTL                (0xe0028)
> -#define MDP_LCDC_LINE_IRQ                (0xe002c)
> -#define MDP_LCDC_CTL_POLARITY            (0xe0030)
> -#define MDP_LCDC_DMA_CONFIG              (0xe1000)
> -#define MDP_LCDC_DMA_SIZE                (0xe1004)
> -#define MDP_LCDC_DMA_IBUF_ADDR           (0xe1008)
> -#define MDP_LCDC_DMA_IBUF_Y_STRIDE       (0xe100c)
> -
> -
> -#define MDP_DMA2_TERM 0x1
> -#define MDP_DMA3_TERM 0x2
> -#define MDP_PPP_TERM 0x3
> -
> -/* MDP_INTR_ENABLE */
> -#define DL0_ROI_DONE           (1<<0)
> -#define DL1_ROI_DONE           (1<<1)
> -#define DL0_DMA2_TERM_DONE     (1<<2)
> -#define DL1_DMA2_TERM_DONE     (1<<3)
> -#define DL0_PPP_TERM_DONE      (1<<4)
> -#define DL1_PPP_TERM_DONE      (1<<5)
> -#define TV_OUT_DMA3_DONE       (1<<6)
> -#define TV_ENC_UNDERRUN        (1<<7)
> -#define DL0_FETCH_DONE         (1<<11)
> -#define DL1_FETCH_DONE         (1<<12)
> -
> -#define MDP_PPP_BUSY_STATUS (DL0_ROI_DONE| \
> -			   DL1_ROI_DONE| \
> -			   DL0_PPP_TERM_DONE| \
> -			   DL1_PPP_TERM_DONE)
> -
> -#define MDP_ANY_INTR_MASK (DL0_ROI_DONE| \
> -			   DL1_ROI_DONE| \
> -			   DL0_DMA2_TERM_DONE| \
> -			   DL1_DMA2_TERM_DONE| \
> -			   DL0_PPP_TERM_DONE| \
> -			   DL1_PPP_TERM_DONE| \
> -			   DL0_FETCH_DONE| \
> -			   DL1_FETCH_DONE| \
> -			   TV_ENC_UNDERRUN)
> -
> -#define MDP_TOP_LUMA       16
> -#define MDP_TOP_CHROMA     0
> -#define MDP_BOTTOM_LUMA    19
> -#define MDP_BOTTOM_CHROMA  3
> -#define MDP_LEFT_LUMA      22
> -#define MDP_LEFT_CHROMA    6
> -#define MDP_RIGHT_LUMA     25
> -#define MDP_RIGHT_CHROMA   9
> -
> -#define CLR_G 0x0
> -#define CLR_B 0x1
> -#define CLR_R 0x2
> -#define CLR_ALPHA 0x3
> -
> -#define CLR_Y  CLR_G
> -#define CLR_CB CLR_B
> -#define CLR_CR CLR_R
> -
> -/* from lsb to msb */
> -#define MDP_GET_PACK_PATTERN(a, x, y, z, bit) \
> -	(((a)<<(bit*3))|((x)<<(bit*2))|((y)<<bit)|(z))
> -
> -/* MDP_SYNC_CONFIG_0/1/2 */
> -#define MDP_SYNCFG_HGT_LOC 22
> -#define MDP_SYNCFG_VSYNC_EXT_EN (1<<21)
> -#define MDP_SYNCFG_VSYNC_INT_EN (1<<20)
> -
> -/* MDP_SYNC_THRESH_0 */
> -#define MDP_PRIM_BELOW_LOC 0
> -#define MDP_PRIM_ABOVE_LOC 8
> -
> -/* MDP_{PRIMARY,SECONDARY,EXTERNAL}_VSYNC_OUT_CRL */
> -#define VSYNC_PULSE_EN (1<<31)
> -#define VSYNC_PULSE_INV (1<<30)
> -
> -/* MDP_VSYNC_CTRL */
> -#define DISP0_VSYNC_MAP_VSYNC0 0
> -#define DISP0_VSYNC_MAP_VSYNC1 (1<<0)
> -#define DISP0_VSYNC_MAP_VSYNC2 ((1<<0)|(1<<1))
> -
> -#define DISP1_VSYNC_MAP_VSYNC0 0
> -#define DISP1_VSYNC_MAP_VSYNC1 (1<<2)
> -#define DISP1_VSYNC_MAP_VSYNC2 ((1<<2)|(1<<3))
> -
> -#define PRIMARY_LCD_SYNC_EN (1<<4)
> -#define PRIMARY_LCD_SYNC_DISABLE 0
> -
> -#define SECONDARY_LCD_SYNC_EN (1<<5)
> -#define SECONDARY_LCD_SYNC_DISABLE 0
> -
> -#define EXTERNAL_LCD_SYNC_EN (1<<6)
> -#define EXTERNAL_LCD_SYNC_DISABLE 0
> -
> -/* MDP_VSYNC_THRESHOLD / MDP_FULL_BYPASS_WORD60 */
> -#define VSYNC_THRESHOLD_ABOVE_LOC 0
> -#define VSYNC_THRESHOLD_BELOW_LOC 16
> -#define VSYNC_ANTI_TEAR_EN (1<<31)
> -
> -/* MDP_COMMAND_CONFIG / MDP_FULL_BYPASS_WORD1 */
> -#define MDP_CMD_DBGBUS_EN (1<<0)
> -
> -/* MDP_PPP_SOURCE_CONFIG / MDP_FULL_BYPASS_WORD9&53 */
> -#define PPP_SRC_C0G_8BIT ((1<<1)|(1<<0))
> -#define PPP_SRC_C1B_8BIT ((1<<3)|(1<<2))
> -#define PPP_SRC_C2R_8BIT ((1<<5)|(1<<4))
> -#define PPP_SRC_C3A_8BIT ((1<<7)|(1<<6))
> -
> -#define PPP_SRC_C0G_6BIT (1<<1)
> -#define PPP_SRC_C1B_6BIT (1<<3)
> -#define PPP_SRC_C2R_6BIT (1<<5)
> -
> -#define PPP_SRC_C0G_5BIT (1<<0)
> -#define PPP_SRC_C1B_5BIT (1<<2)
> -#define PPP_SRC_C2R_5BIT (1<<4)
> -
> -#define PPP_SRC_C3ALPHA_EN (1<<8)
> -
> -#define PPP_SRC_BPP_1BYTES 0
> -#define PPP_SRC_BPP_2BYTES (1<<9)
> -#define PPP_SRC_BPP_3BYTES (1<<10)
> -#define PPP_SRC_BPP_4BYTES ((1<<10)|(1<<9))
> -
> -#define PPP_SRC_BPP_ROI_ODD_X (1<<11)
> -#define PPP_SRC_BPP_ROI_ODD_Y (1<<12)
> -#define PPP_SRC_INTERLVD_2COMPONENTS (1<<13)
> -#define PPP_SRC_INTERLVD_3COMPONENTS (1<<14)
> -#define PPP_SRC_INTERLVD_4COMPONENTS ((1<<14)|(1<<13))
> -
> -
> -/* RGB666 unpack format
> -** TIGHT means R6+G6+B6 together
> -** LOOSE means R6+2 +G6+2+ B6+2 (with MSB)
> -**          or 2+R6 +2+G6 +2+B6 (with LSB)
> -*/
> -#define PPP_SRC_PACK_TIGHT (1<<17)
> -#define PPP_SRC_PACK_LOOSE 0
> -#define PPP_SRC_PACK_ALIGN_LSB 0
> -#define PPP_SRC_PACK_ALIGN_MSB (1<<18)
> -
> -#define PPP_SRC_PLANE_INTERLVD 0
> -#define PPP_SRC_PLANE_PSEUDOPLNR (1<<20)
> -
> -#define PPP_SRC_WMV9_MODE (1<<21)
> -
> -/* MDP_PPP_OPERATION_CONFIG / MDP_FULL_BYPASS_WORD14 */
> -#define PPP_OP_SCALE_X_ON (1<<0)
> -#define PPP_OP_SCALE_Y_ON (1<<1)
> -
> -#define PPP_OP_CONVERT_RGB2YCBCR 0
> -#define PPP_OP_CONVERT_YCBCR2RGB (1<<2)
> -#define PPP_OP_CONVERT_ON (1<<3)
> -
> -#define PPP_OP_CONVERT_MATRIX_PRIMARY 0
> -#define PPP_OP_CONVERT_MATRIX_SECONDARY (1<<4)
> -
> -#define PPP_OP_LUT_C0_ON (1<<5)
> -#define PPP_OP_LUT_C1_ON (1<<6)
> -#define PPP_OP_LUT_C2_ON (1<<7)
> -
> -/* rotate or blend enable */
> -#define PPP_OP_ROT_ON (1<<8)
> -
> -#define PPP_OP_ROT_90 (1<<9)
> -#define PPP_OP_FLIP_LR (1<<10)
> -#define PPP_OP_FLIP_UD (1<<11)
> -
> -#define PPP_OP_BLEND_ON (1<<12)
> -
> -#define PPP_OP_BLEND_SRCPIXEL_ALPHA 0
> -#define PPP_OP_BLEND_DSTPIXEL_ALPHA (1<<13)
> -#define PPP_OP_BLEND_CONSTANT_ALPHA (1<<14)
> -#define PPP_OP_BLEND_SRCPIXEL_TRANSP ((1<<13)|(1<<14))
> -
> -#define PPP_OP_BLEND_ALPHA_BLEND_NORMAL 0
> -#define PPP_OP_BLEND_ALPHA_BLEND_REVERSE (1<<15)
> -
> -#define PPP_OP_DITHER_EN (1<<16)
> -
> -#define PPP_OP_COLOR_SPACE_RGB 0
> -#define PPP_OP_COLOR_SPACE_YCBCR (1<<17)
> -
> -#define PPP_OP_SRC_CHROMA_RGB 0
> -#define PPP_OP_SRC_CHROMA_H2V1 (1<<18)
> -#define PPP_OP_SRC_CHROMA_H1V2 (1<<19)
> -#define PPP_OP_SRC_CHROMA_420 ((1<<18)|(1<<19))
> -#define PPP_OP_SRC_CHROMA_COSITE 0
> -#define PPP_OP_SRC_CHROMA_OFFSITE (1<<20)
> -
> -#define PPP_OP_DST_CHROMA_RGB 0
> -#define PPP_OP_DST_CHROMA_H2V1 (1<<21)
> -#define PPP_OP_DST_CHROMA_H1V2 (1<<22)
> -#define PPP_OP_DST_CHROMA_420 ((1<<21)|(1<<22))
> -#define PPP_OP_DST_CHROMA_COSITE 0
> -#define PPP_OP_DST_CHROMA_OFFSITE (1<<23)
> -
> -#define PPP_BLEND_ALPHA_TRANSP (1<<24)
> -
> -#define PPP_OP_BG_CHROMA_RGB 0
> -#define PPP_OP_BG_CHROMA_H2V1 (1<<25)
> -#define PPP_OP_BG_CHROMA_H1V2 (1<<26)
> -#define PPP_OP_BG_CHROMA_420 ((1<<25)|(1<<26))
> -#define PPP_OP_BG_CHROMA_SITE_COSITE 0
> -#define PPP_OP_BG_CHROMA_SITE_OFFSITE (1<<27)
> -
> -/* MDP_PPP_DESTINATION_CONFIG / MDP_FULL_BYPASS_WORD20 */
> -#define PPP_DST_C0G_8BIT ((1<<0)|(1<<1))
> -#define PPP_DST_C1B_8BIT ((1<<3)|(1<<2))
> -#define PPP_DST_C2R_8BIT ((1<<5)|(1<<4))
> -#define PPP_DST_C3A_8BIT ((1<<7)|(1<<6))
> -
> -#define PPP_DST_C0G_6BIT (1<<1)
> -#define PPP_DST_C1B_6BIT (1<<3)
> -#define PPP_DST_C2R_6BIT (1<<5)
> -
> -#define PPP_DST_C0G_5BIT (1<<0)
> -#define PPP_DST_C1B_5BIT (1<<2)
> -#define PPP_DST_C2R_5BIT (1<<4)
> -
> -#define PPP_DST_C3A_8BIT ((1<<7)|(1<<6))
> -#define PPP_DST_C3ALPHA_EN (1<<8)
> -
> -#define PPP_DST_INTERLVD_2COMPONENTS (1<<9)
> -#define PPP_DST_INTERLVD_3COMPONENTS (1<<10)
> -#define PPP_DST_INTERLVD_4COMPONENTS ((1<<10)|(1<<9))
> -#define PPP_DST_INTERLVD_6COMPONENTS ((1<<11)|(1<<9))
> -
> -#define PPP_DST_PACK_LOOSE 0
> -#define PPP_DST_PACK_TIGHT (1<<13)
> -#define PPP_DST_PACK_ALIGN_LSB 0
> -#define PPP_DST_PACK_ALIGN_MSB (1<<14)
> -
> -#define PPP_DST_OUT_SEL_AXI 0
> -#define PPP_DST_OUT_SEL_MDDI (1<<15)
> -
> -#define PPP_DST_BPP_2BYTES (1<<16)
> -#define PPP_DST_BPP_3BYTES (1<<17)
> -#define PPP_DST_BPP_4BYTES ((1<<17)|(1<<16))
> -
> -#define PPP_DST_PLANE_INTERLVD 0
> -#define PPP_DST_PLANE_PLANAR (1<<18)
> -#define PPP_DST_PLANE_PSEUDOPLNR (1<<19)
> -
> -#define PPP_DST_TO_TV (1<<20)
> -
> -#define PPP_DST_MDDI_PRIMARY 0
> -#define PPP_DST_MDDI_SECONDARY (1<<21)
> -#define PPP_DST_MDDI_EXTERNAL (1<<22)
> -
> -/* image configurations by image type */
> -#define PPP_CFG_MDP_RGB_565(dir)       (PPP_##dir##_C2R_5BIT | \
> -					PPP_##dir##_C0G_6BIT | \
> -					PPP_##dir##_C1B_5BIT | \
> -					PPP_##dir##_BPP_2BYTES | \
> -					PPP_##dir##_INTERLVD_3COMPONENTS | \
> -					PPP_##dir##_PACK_TIGHT | \
> -					PPP_##dir##_PACK_ALIGN_LSB | \
> -					PPP_##dir##_PLANE_INTERLVD)
> -
> -#define PPP_CFG_MDP_RGB_888(dir)       (PPP_##dir##_C2R_8BIT | \
> -					PPP_##dir##_C0G_8BIT | \
> -					PPP_##dir##_C1B_8BIT | \
> -					PPP_##dir##_BPP_3BYTES | \
> -					PPP_##dir##_INTERLVD_3COMPONENTS | \
> -					PPP_##dir##_PACK_TIGHT | \
> -					PPP_##dir##_PACK_ALIGN_LSB | \
> -					PPP_##dir##_PLANE_INTERLVD)
> -
> -#define PPP_CFG_MDP_ARGB_8888(dir)     (PPP_##dir##_C2R_8BIT | \
> -					PPP_##dir##_C0G_8BIT | \
> -					PPP_##dir##_C1B_8BIT | \
> -					PPP_##dir##_C3A_8BIT | \
> -					PPP_##dir##_C3ALPHA_EN | \
> -					PPP_##dir##_BPP_4BYTES | \
> -					PPP_##dir##_INTERLVD_4COMPONENTS | \
> -					PPP_##dir##_PACK_TIGHT | \
> -					PPP_##dir##_PACK_ALIGN_LSB | \
> -					PPP_##dir##_PLANE_INTERLVD)
> -
> -#define PPP_CFG_MDP_XRGB_8888(dir) PPP_CFG_MDP_ARGB_8888(dir)
> -#define PPP_CFG_MDP_RGBA_8888(dir) PPP_CFG_MDP_ARGB_8888(dir)
> -#define PPP_CFG_MDP_BGRA_8888(dir) PPP_CFG_MDP_ARGB_8888(dir)
> -#define PPP_CFG_MDP_RGBX_8888(dir) PPP_CFG_MDP_ARGB_8888(dir)
> -
> -#define PPP_CFG_MDP_Y_CBCR_H2V2(dir)   (PPP_##dir##_C2R_8BIT | \
> -					PPP_##dir##_C0G_8BIT | \
> -					PPP_##dir##_C1B_8BIT | \
> -					PPP_##dir##_C3A_8BIT | \
> -					PPP_##dir##_BPP_2BYTES | \
> -					PPP_##dir##_INTERLVD_2COMPONENTS | \
> -					PPP_##dir##_PACK_TIGHT | \
> -					PPP_##dir##_PACK_ALIGN_LSB | \
> -					PPP_##dir##_PLANE_PSEUDOPLNR)
> -
> -#define PPP_CFG_MDP_Y_CRCB_H2V2(dir)	PPP_CFG_MDP_Y_CBCR_H2V2(dir)
> -
> -#define PPP_CFG_MDP_YCRYCB_H2V1(dir)   (PPP_##dir##_C2R_8BIT | \
> -					PPP_##dir##_C0G_8BIT | \
> -					PPP_##dir##_C1B_8BIT | \
> -					PPP_##dir##_C3A_8BIT | \
> -					PPP_##dir##_BPP_2BYTES | \
> -					PPP_##dir##_INTERLVD_4COMPONENTS | \
> -					PPP_##dir##_PACK_TIGHT | \
> -					PPP_##dir##_PACK_ALIGN_LSB |\
> -					PPP_##dir##_PLANE_INTERLVD)
> -
> -#define PPP_CFG_MDP_Y_CBCR_H2V1(dir)   (PPP_##dir##_C2R_8BIT | \
> -					PPP_##dir##_C0G_8BIT | \
> -					PPP_##dir##_C1B_8BIT | \
> -					PPP_##dir##_C3A_8BIT | \
> -					PPP_##dir##_BPP_2BYTES |   \
> -					PPP_##dir##_INTERLVD_2COMPONENTS |  \
> -					PPP_##dir##_PACK_TIGHT | \
> -					PPP_##dir##_PACK_ALIGN_LSB | \
> -					PPP_##dir##_PLANE_PSEUDOPLNR)
> -
> -#define PPP_CFG_MDP_Y_CRCB_H2V1(dir)	PPP_CFG_MDP_Y_CBCR_H2V1(dir)
> -
> -#define PPP_PACK_PATTERN_MDP_RGB_565 \
> -	MDP_GET_PACK_PATTERN(0, CLR_R, CLR_G, CLR_B, 8)
> -#define PPP_PACK_PATTERN_MDP_RGB_888 PPP_PACK_PATTERN_MDP_RGB_565
> -#define PPP_PACK_PATTERN_MDP_XRGB_8888 \
> -	MDP_GET_PACK_PATTERN(CLR_B, CLR_G, CLR_R, CLR_ALPHA, 8)
> -#define PPP_PACK_PATTERN_MDP_ARGB_8888 PPP_PACK_PATTERN_MDP_XRGB_8888
> -#define PPP_PACK_PATTERN_MDP_RGBA_8888 \
> -	MDP_GET_PACK_PATTERN(CLR_ALPHA, CLR_B, CLR_G, CLR_R, 8)
> -#define PPP_PACK_PATTERN_MDP_BGRA_8888 \
> -	MDP_GET_PACK_PATTERN(CLR_ALPHA, CLR_R, CLR_G, CLR_B, 8)
> -#define PPP_PACK_PATTERN_MDP_RGBX_8888 \
> -	MDP_GET_PACK_PATTERN(CLR_ALPHA, CLR_B, CLR_G, CLR_R, 8)
> -#define PPP_PACK_PATTERN_MDP_Y_CBCR_H2V1 \
> -	MDP_GET_PACK_PATTERN(0, 0, CLR_CB, CLR_CR, 8)
> -#define PPP_PACK_PATTERN_MDP_Y_CBCR_H2V2 PPP_PACK_PATTERN_MDP_Y_CBCR_H2V1
> -#define PPP_PACK_PATTERN_MDP_Y_CRCB_H2V1 \
> -	MDP_GET_PACK_PATTERN(0, 0, CLR_CR, CLR_CB, 8)
> -#define PPP_PACK_PATTERN_MDP_Y_CRCB_H2V2 PPP_PACK_PATTERN_MDP_Y_CRCB_H2V1
> -#define PPP_PACK_PATTERN_MDP_YCRYCB_H2V1 \
> -	MDP_GET_PACK_PATTERN(CLR_Y, CLR_R, CLR_Y, CLR_B, 8)
> -
> -#define PPP_CHROMA_SAMP_MDP_RGB_565(dir) PPP_OP_##dir##_CHROMA_RGB
> -#define PPP_CHROMA_SAMP_MDP_RGB_888(dir) PPP_OP_##dir##_CHROMA_RGB
> -#define PPP_CHROMA_SAMP_MDP_XRGB_8888(dir) PPP_OP_##dir##_CHROMA_RGB
> -#define PPP_CHROMA_SAMP_MDP_ARGB_8888(dir) PPP_OP_##dir##_CHROMA_RGB
> -#define PPP_CHROMA_SAMP_MDP_RGBA_8888(dir) PPP_OP_##dir##_CHROMA_RGB
> -#define PPP_CHROMA_SAMP_MDP_BGRA_8888(dir) PPP_OP_##dir##_CHROMA_RGB
> -#define PPP_CHROMA_SAMP_MDP_RGBX_8888(dir) PPP_OP_##dir##_CHROMA_RGB
> -#define PPP_CHROMA_SAMP_MDP_Y_CBCR_H2V1(dir) PPP_OP_##dir##_CHROMA_H2V1
> -#define PPP_CHROMA_SAMP_MDP_Y_CBCR_H2V2(dir) PPP_OP_##dir##_CHROMA_420
> -#define PPP_CHROMA_SAMP_MDP_Y_CRCB_H2V1(dir) PPP_OP_##dir##_CHROMA_H2V1
> -#define PPP_CHROMA_SAMP_MDP_Y_CRCB_H2V2(dir) PPP_OP_##dir##_CHROMA_420
> -#define PPP_CHROMA_SAMP_MDP_YCRYCB_H2V1(dir) PPP_OP_##dir##_CHROMA_H2V1
> -
> -/* Helpful array generation macros */
> -#define PPP_ARRAY0(name) \
> -	[MDP_RGB_565] = PPP_##name##_MDP_RGB_565,\
> -	[MDP_RGB_888] = PPP_##name##_MDP_RGB_888,\
> -	[MDP_XRGB_8888] = PPP_##name##_MDP_XRGB_8888,\
> -	[MDP_ARGB_8888] = PPP_##name##_MDP_ARGB_8888,\
> -	[MDP_RGBA_8888] = PPP_##name##_MDP_RGBA_8888,\
> -	[MDP_BGRA_8888] = PPP_##name##_MDP_BGRA_8888,\
> -	[MDP_RGBX_8888] = PPP_##name##_MDP_RGBX_8888,\
> -	[MDP_Y_CBCR_H2V1] = PPP_##name##_MDP_Y_CBCR_H2V1,\
> -	[MDP_Y_CBCR_H2V2] = PPP_##name##_MDP_Y_CBCR_H2V2,\
> -	[MDP_Y_CRCB_H2V1] = PPP_##name##_MDP_Y_CRCB_H2V1,\
> -	[MDP_Y_CRCB_H2V2] = PPP_##name##_MDP_Y_CRCB_H2V2,\
> -	[MDP_YCRYCB_H2V1] = PPP_##name##_MDP_YCRYCB_H2V1
> -
> -#define PPP_ARRAY1(name, dir) \
> -	[MDP_RGB_565] = PPP_##name##_MDP_RGB_565(dir),\
> -	[MDP_RGB_888] = PPP_##name##_MDP_RGB_888(dir),\
> -	[MDP_XRGB_8888] = PPP_##name##_MDP_XRGB_8888(dir),\
> -	[MDP_ARGB_8888] = PPP_##name##_MDP_ARGB_8888(dir),\
> -	[MDP_RGBA_8888] = PPP_##name##_MDP_RGBA_8888(dir),\
> -	[MDP_BGRA_8888] = PPP_##name##_MDP_BGRA_8888(dir),\
> -	[MDP_RGBX_8888] = PPP_##name##_MDP_RGBX_8888(dir),\
> -	[MDP_Y_CBCR_H2V1] = PPP_##name##_MDP_Y_CBCR_H2V1(dir),\
> -	[MDP_Y_CBCR_H2V2] = PPP_##name##_MDP_Y_CBCR_H2V2(dir),\
> -	[MDP_Y_CRCB_H2V1] = PPP_##name##_MDP_Y_CRCB_H2V1(dir),\
> -	[MDP_Y_CRCB_H2V2] = PPP_##name##_MDP_Y_CRCB_H2V2(dir),\
> -	[MDP_YCRYCB_H2V1] = PPP_##name##_MDP_YCRYCB_H2V1(dir)
> -
> -#define IS_YCRCB(img) ((img == MDP_Y_CRCB_H2V2) | (img == MDP_Y_CBCR_H2V2) | \
> -		       (img == MDP_Y_CRCB_H2V1) | (img == MDP_Y_CBCR_H2V1) | \
> -		       (img == MDP_YCRYCB_H2V1))
> -#define IS_RGB(img) ((img == MDP_RGB_565) | (img == MDP_RGB_888) | \
> -		     (img == MDP_ARGB_8888) | (img == MDP_RGBA_8888) | \
> -		     (img == MDP_XRGB_8888) | (img == MDP_BGRA_8888) | \
> -		     (img == MDP_RGBX_8888))
> -#define HAS_ALPHA(img) ((img == MDP_ARGB_8888) | (img == MDP_RGBA_8888) | \
> -			(img == MDP_BGRA_8888))
> -
> -#define IS_PSEUDOPLNR(img) ((img == MDP_Y_CRCB_H2V2) | \
> -			    (img == MDP_Y_CBCR_H2V2) | \
> -			    (img == MDP_Y_CRCB_H2V1) | \
> -			    (img == MDP_Y_CBCR_H2V1))
> -
> -/* Mappings from addr to purpose */
> -#define PPP_ADDR_SRC_ROI		MDP_FULL_BYPASS_WORD2
> -#define PPP_ADDR_SRC0			MDP_FULL_BYPASS_WORD3
> -#define PPP_ADDR_SRC1			MDP_FULL_BYPASS_WORD4
> -#define PPP_ADDR_SRC_YSTRIDE		MDP_FULL_BYPASS_WORD7
> -#define PPP_ADDR_SRC_CFG		MDP_FULL_BYPASS_WORD9
> -#define PPP_ADDR_SRC_PACK_PATTERN	MDP_FULL_BYPASS_WORD10
> -#define PPP_ADDR_OPERATION		MDP_FULL_BYPASS_WORD14
> -#define PPP_ADDR_PHASEX_INIT		MDP_FULL_BYPASS_WORD15
> -#define PPP_ADDR_PHASEY_INIT		MDP_FULL_BYPASS_WORD16
> -#define PPP_ADDR_PHASEX_STEP		MDP_FULL_BYPASS_WORD17
> -#define PPP_ADDR_PHASEY_STEP		MDP_FULL_BYPASS_WORD18
> -#define PPP_ADDR_ALPHA_TRANSP		MDP_FULL_BYPASS_WORD19
> -#define PPP_ADDR_DST_CFG		MDP_FULL_BYPASS_WORD20
> -#define PPP_ADDR_DST_PACK_PATTERN	MDP_FULL_BYPASS_WORD21
> -#define PPP_ADDR_DST_ROI		MDP_FULL_BYPASS_WORD25
> -#define PPP_ADDR_DST0			MDP_FULL_BYPASS_WORD26
> -#define PPP_ADDR_DST1			MDP_FULL_BYPASS_WORD27
> -#define PPP_ADDR_DST_YSTRIDE		MDP_FULL_BYPASS_WORD30
> -#define PPP_ADDR_EDGE			MDP_FULL_BYPASS_WORD46
> -#define PPP_ADDR_BG0			MDP_FULL_BYPASS_WORD48
> -#define PPP_ADDR_BG1			MDP_FULL_BYPASS_WORD49
> -#define PPP_ADDR_BG_YSTRIDE		MDP_FULL_BYPASS_WORD51
> -#define PPP_ADDR_BG_CFG			MDP_FULL_BYPASS_WORD53
> -#define PPP_ADDR_BG_PACK_PATTERN	MDP_FULL_BYPASS_WORD54
> -
> -/* MDP_DMA_CONFIG / MDP_FULL_BYPASS_WORD32 */
> -#define DMA_DSTC0G_6BITS (1<<1)
> -#define DMA_DSTC1B_6BITS (1<<3)
> -#define DMA_DSTC2R_6BITS (1<<5)
> -#define DMA_DSTC0G_5BITS (1<<0)
> -#define DMA_DSTC1B_5BITS (1<<2)
> -#define DMA_DSTC2R_5BITS (1<<4)
> -
> -#define DMA_PACK_TIGHT (1<<6)
> -#define DMA_PACK_LOOSE 0
> -#define DMA_PACK_ALIGN_LSB 0
> -#define DMA_PACK_ALIGN_MSB (1<<7)
> -#define DMA_PACK_PATTERN_RGB \
> -	(MDP_GET_PACK_PATTERN(0, CLR_R, CLR_G, CLR_B, 2)<<8)
> -
> -#define DMA_OUT_SEL_AHB  0
> -#define DMA_OUT_SEL_MDDI (1<<14)
> -#define DMA_AHBM_LCD_SEL_PRIMARY 0
> -#define DMA_AHBM_LCD_SEL_SECONDARY (1<<15)
> -#define DMA_IBUF_C3ALPHA_EN (1<<16)
> -#define DMA_DITHER_EN (1<<17)
> -
> -#define DMA_MDDI_DMAOUT_LCD_SEL_PRIMARY 0
> -#define DMA_MDDI_DMAOUT_LCD_SEL_SECONDARY (1<<18)
> -#define DMA_MDDI_DMAOUT_LCD_SEL_EXTERNAL (1<<19)
> -
> -#define DMA_IBUF_FORMAT_RGB565 (1<<20)
> -#define DMA_IBUF_FORMAT_RGB888_OR_ARGB8888 0
> -
> -#define DMA_IBUF_NONCONTIGUOUS (1<<21)
> -
> -/* MDDI REGISTER ? */
> -#define MDDI_VDO_PACKET_DESC  0x5666
> -#define MDDI_VDO_PACKET_PRIM  0xC3
> -#define MDDI_VDO_PACKET_SECD  0xC0
> -
> -#endif
> diff --git a/drivers/video/fbdev/msm/mdp_ppp.c b/drivers/video/fbdev/msm/mdp_ppp.c
> deleted file mode 100644
> index be6079cdfbb6..000000000000
> --- a/drivers/video/fbdev/msm/mdp_ppp.c
> +++ /dev/null
> @@ -1,731 +0,0 @@
> -/* drivers/video/msm/mdp_ppp.c
> - *
> - * Copyright (C) 2007 QUALCOMM Incorporated
> - * Copyright (C) 2007 Google Incorporated
> - *
> - * 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/fb.h>
> -#include <linux/file.h>
> -#include <linux/delay.h>
> -#include <linux/msm_mdp.h>
> -#include <linux/platform_data/video-msm_fb.h>
> -
> -#include "mdp_hw.h"
> -#include "mdp_scale_tables.h"
> -
> -#define DLOG(x...) do {} while (0)
> -
> -#define MDP_DOWNSCALE_BLUR (MDP_DOWNSCALE_MAX + 1)
> -static int downscale_y_table = MDP_DOWNSCALE_MAX;
> -static int downscale_x_table = MDP_DOWNSCALE_MAX;
> -
> -struct mdp_regs {
> -	uint32_t src0;
> -	uint32_t src1;
> -	uint32_t dst0;
> -	uint32_t dst1;
> -	uint32_t src_cfg;
> -	uint32_t dst_cfg;
> -	uint32_t src_pack;
> -	uint32_t dst_pack;
> -	uint32_t src_rect;
> -	uint32_t dst_rect;
> -	uint32_t src_ystride;
> -	uint32_t dst_ystride;
> -	uint32_t op;
> -	uint32_t src_bpp;
> -	uint32_t dst_bpp;
> -	uint32_t edge;
> -	uint32_t phasex_init;
> -	uint32_t phasey_init;
> -	uint32_t phasex_step;
> -	uint32_t phasey_step;
> -};
> -
> -static uint32_t pack_pattern[] = {
> -	PPP_ARRAY0(PACK_PATTERN)
> -};
> -
> -static uint32_t src_img_cfg[] = {
> -	PPP_ARRAY1(CFG, SRC)
> -};
> -
> -static uint32_t dst_img_cfg[] = {
> -	PPP_ARRAY1(CFG, DST)
> -};
> -
> -static uint32_t bytes_per_pixel[] = {
> -	[MDP_RGB_565] = 2,
> -	[MDP_RGB_888] = 3,
> -	[MDP_XRGB_8888] = 4,
> -	[MDP_ARGB_8888] = 4,
> -	[MDP_RGBA_8888] = 4,
> -	[MDP_BGRA_8888] = 4,
> -	[MDP_RGBX_8888] = 4,
> -	[MDP_Y_CBCR_H2V1] = 1,
> -	[MDP_Y_CBCR_H2V2] = 1,
> -	[MDP_Y_CRCB_H2V1] = 1,
> -	[MDP_Y_CRCB_H2V2] = 1,
> -	[MDP_YCRYCB_H2V1] = 2
> -};
> -
> -static uint32_t dst_op_chroma[] = {
> -	PPP_ARRAY1(CHROMA_SAMP, DST)
> -};
> -
> -static uint32_t src_op_chroma[] = {
> -	PPP_ARRAY1(CHROMA_SAMP, SRC)
> -};
> -
> -static uint32_t bg_op_chroma[] = {
> -	PPP_ARRAY1(CHROMA_SAMP, BG)
> -};
> -
> -static void rotate_dst_addr_x(struct mdp_blit_req *req, struct mdp_regs *regs)
> -{
> -	regs->dst0 += (req->dst_rect.w -
> -		       min((uint32_t)16, req->dst_rect.w)) * regs->dst_bpp;
> -	regs->dst1 += (req->dst_rect.w -
> -		       min((uint32_t)16, req->dst_rect.w)) * regs->dst_bpp;
> -}
> -
> -static void rotate_dst_addr_y(struct mdp_blit_req *req, struct mdp_regs *regs)
> -{
> -	regs->dst0 += (req->dst_rect.h -
> -		       min((uint32_t)16, req->dst_rect.h)) *
> -		       regs->dst_ystride;
> -	regs->dst1 += (req->dst_rect.h -
> -		       min((uint32_t)16, req->dst_rect.h)) *
> -		       regs->dst_ystride;
> -}
> -
> -static void blit_rotate(struct mdp_blit_req *req,
> -			struct mdp_regs *regs)
> -{
> -	if (req->flags == MDP_ROT_NOP)
> -		return;
> -
> -	regs->op |= PPP_OP_ROT_ON;
> -	if ((req->flags & MDP_ROT_90 || req->flags & MDP_FLIP_LR) &&
> -	    !(req->flags & MDP_ROT_90 && req->flags & MDP_FLIP_LR))
> -		rotate_dst_addr_x(req, regs);
> -	if (req->flags & MDP_ROT_90)
> -		regs->op |= PPP_OP_ROT_90;
> -	if (req->flags & MDP_FLIP_UD) {
> -		regs->op |= PPP_OP_FLIP_UD;
> -		rotate_dst_addr_y(req, regs);
> -	}
> -	if (req->flags & MDP_FLIP_LR)
> -		regs->op |= PPP_OP_FLIP_LR;
> -}
> -
> -static void blit_convert(struct mdp_blit_req *req, struct mdp_regs *regs)
> -{
> -	if (req->src.format == req->dst.format)
> -		return;
> -	if (IS_RGB(req->src.format) && IS_YCRCB(req->dst.format)) {
> -		regs->op |= PPP_OP_CONVERT_RGB2YCBCR | PPP_OP_CONVERT_ON;
> -	} else if (IS_YCRCB(req->src.format) && IS_RGB(req->dst.format)) {
> -		regs->op |= PPP_OP_CONVERT_YCBCR2RGB | PPP_OP_CONVERT_ON;
> -		if (req->dst.format == MDP_RGB_565)
> -			regs->op |= PPP_OP_CONVERT_MATRIX_SECONDARY;
> -	}
> -}
> -
> -#define GET_BIT_RANGE(value, high, low) \
> -	(((1 << (high - low + 1)) - 1) & (value >> low))
> -static uint32_t transp_convert(struct mdp_blit_req *req)
> -{
> -	uint32_t transp = 0;
> -	if (req->src.format == MDP_RGB_565) {
> -		/* pad each value to 8 bits by copying the high bits into the
> -		 * low end, convert RGB to RBG by switching low 2 components */
> -		transp |= ((GET_BIT_RANGE(req->transp_mask, 15, 11) << 3) |
> -			   (GET_BIT_RANGE(req->transp_mask, 15, 13))) << 16;
> -
> -		transp |= ((GET_BIT_RANGE(req->transp_mask, 4, 0) << 3) |
> -			   (GET_BIT_RANGE(req->transp_mask, 4, 2))) << 8;
> -
> -		transp |= (GET_BIT_RANGE(req->transp_mask, 10, 5) << 2) |
> -			  (GET_BIT_RANGE(req->transp_mask, 10, 9));
> -	} else {
> -		/* convert RGB to RBG */
> -		transp |= (GET_BIT_RANGE(req->transp_mask, 15, 8)) |
> -			  (GET_BIT_RANGE(req->transp_mask, 23, 16) << 16) |
> -			  (GET_BIT_RANGE(req->transp_mask, 7, 0) << 8);
> -	}
> -	return transp;
> -}
> -#undef GET_BIT_RANGE
> -
> -static void blit_blend(struct mdp_blit_req *req, struct mdp_regs *regs)
> -{
> -	/* TRANSP BLEND */
> -	if (req->transp_mask != MDP_TRANSP_NOP) {
> -		req->transp_mask = transp_convert(req);
> -		if (req->alpha != MDP_ALPHA_NOP) {
> -			/* use blended transparancy mode
> -			 * pixel = (src == transp) ? dst : blend
> -			 * blend is combo of blend_eq_sel and
> -			 * blend_alpha_sel */
> -			regs->op |= PPP_OP_ROT_ON | PPP_OP_BLEND_ON |
> -				PPP_OP_BLEND_ALPHA_BLEND_NORMAL |
> -				PPP_OP_BLEND_CONSTANT_ALPHA |
> -				PPP_BLEND_ALPHA_TRANSP;
> -		} else {
> -			/* simple transparancy mode
> -			 * pixel = (src == transp) ? dst : src */
> -			regs->op |= PPP_OP_ROT_ON | PPP_OP_BLEND_ON |
> -				PPP_OP_BLEND_SRCPIXEL_TRANSP;
> -		}
> -	}
> -
> -	req->alpha &= 0xff;
> -	/* ALPHA BLEND */
> -	if (HAS_ALPHA(req->src.format)) {
> -		regs->op |= PPP_OP_ROT_ON | PPP_OP_BLEND_ON |
> -			PPP_OP_BLEND_SRCPIXEL_ALPHA;
> -	} else if (req->alpha < MDP_ALPHA_NOP) {
> -		/* just blend by alpha */
> -		regs->op |= PPP_OP_ROT_ON | PPP_OP_BLEND_ON |
> -			PPP_OP_BLEND_ALPHA_BLEND_NORMAL |
> -			PPP_OP_BLEND_CONSTANT_ALPHA;
> -	}
> -
> -	regs->op |= bg_op_chroma[req->dst.format];
> -}
> -
> -#define ONE_HALF	(1LL << 32)
> -#define ONE		(1LL << 33)
> -#define TWO		(2LL << 33)
> -#define THREE		(3LL << 33)
> -#define FRAC_MASK (ONE - 1)
> -#define INT_MASK (~FRAC_MASK)
> -
> -static int scale_params(uint32_t dim_in, uint32_t dim_out, uint32_t origin,
> -			uint32_t *phase_init, uint32_t *phase_step)
> -{
> -	/* to improve precicsion calculations are done in U31.33 and converted
> -	 * to U3.29 at the end */
> -	int64_t k1, k2, k3, k4, tmp;
> -	uint64_t n, d, os, os_p, od, od_p, oreq;
> -	unsigned rpa = 0;
> -	int64_t ip64, delta;
> -
> -	if (dim_out % 3 == 0)
> -		rpa = !(dim_in % (dim_out / 3));
> -
> -	n = ((uint64_t)dim_out) << 34;
> -	d = dim_in;
> -	if (!d)
> -		return -1;
> -	do_div(n, d);
> -	k3 = (n + 1) >> 1;
> -	if ((k3 >> 4) < (1LL << 27) || (k3 >> 4) > (1LL << 31)) {
> -		DLOG("crap bad scale\n");
> -		return -1;
> -	}
> -	n = ((uint64_t)dim_in) << 34;
> -	d = (uint64_t)dim_out;
> -	if (!d)
> -		return -1;
> -	do_div(n, d);
> -	k1 = (n + 1) >> 1;
> -	k2 = (k1 - ONE) >> 1;
> -
> -	*phase_init = (int)(k2 >> 4);
> -	k4 = (k3 - ONE) >> 1;
> -
> -	if (rpa) {
> -		os = ((uint64_t)origin << 33) - ONE_HALF;
> -		tmp = (dim_out * os) + ONE_HALF;
> -		if (!dim_in)
> -			return -1;
> -		do_div(tmp, dim_in);
> -		od = tmp - ONE_HALF;
> -	} else {
> -		os = ((uint64_t)origin << 1) - 1;
> -		od = (((k3 * os) >> 1) + k4);
> -	}
> -
> -	od_p = od & INT_MASK;
> -	if (od_p != od)
> -		od_p += ONE;
> -
> -	if (rpa) {
> -		tmp = (dim_in * od_p) + ONE_HALF;
> -		if (!dim_in)
> -			return -1;
> -		do_div(tmp, dim_in);
> -		os_p = tmp - ONE_HALF;
> -	} else {
> -		os_p = ((k1 * (od_p >> 33)) + k2);
> -	}
> -
> -	oreq = (os_p & INT_MASK) - ONE;
> -
> -	ip64 = os_p - oreq;
> -	delta = ((int64_t)(origin) << 33) - oreq;
> -	ip64 -= delta;
> -	/* limit to valid range before the left shift */
> -	delta = (ip64 & (1LL << 63)) ? 4 : -4;
> -	delta <<= 33;
> -	while (abs((int)(ip64 >> 33)) > 4)
> -		ip64 += delta;
> -	*phase_init = (int)(ip64 >> 4);
> -	*phase_step = (uint32_t)(k1 >> 4);
> -	return 0;
> -}
> -
> -static void load_scale_table(const struct mdp_info *mdp,
> -			     struct mdp_table_entry *table, int len)
> -{
> -	int i;
> -	for (i = 0; i < len; i++)
> -		mdp_writel(mdp, table[i].val, table[i].reg);
> -}
> -
> -enum {
> -IMG_LEFT,
> -IMG_RIGHT,
> -IMG_TOP,
> -IMG_BOTTOM,
> -};
> -
> -static void get_edge_info(uint32_t src, uint32_t src_coord, uint32_t dst,
> -			  uint32_t *interp1, uint32_t *interp2,
> -			  uint32_t *repeat1, uint32_t *repeat2) {
> -	if (src > 3 * dst) {
> -		*interp1 = 0;
> -		*interp2 = src - 1;
> -		*repeat1 = 0;
> -		*repeat2 = 0;
> -	} else if (src == 3 * dst) {
> -		*interp1 = 0;
> -		*interp2 = src;
> -		*repeat1 = 0;
> -		*repeat2 = 1;
> -	} else if (src > dst && src < 3 * dst) {
> -		*interp1 = -1;
> -		*interp2 = src;
> -		*repeat1 = 1;
> -		*repeat2 = 1;
> -	} else if (src == dst) {
> -		*interp1 = -1;
> -		*interp2 = src + 1;
> -		*repeat1 = 1;
> -		*repeat2 = 2;
> -	} else {
> -		*interp1 = -2;
> -		*interp2 = src + 1;
> -		*repeat1 = 2;
> -		*repeat2 = 2;
> -	}
> -	*interp1 += src_coord;
> -	*interp2 += src_coord;
> -}
> -
> -static int get_edge_cond(struct mdp_blit_req *req, struct mdp_regs *regs)
> -{
> -	int32_t luma_interp[4];
> -	int32_t luma_repeat[4];
> -	int32_t chroma_interp[4];
> -	int32_t chroma_bound[4];
> -	int32_t chroma_repeat[4];
> -	uint32_t dst_w, dst_h;
> -
> -	memset(&luma_interp, 0, sizeof(int32_t) * 4);
> -	memset(&luma_repeat, 0, sizeof(int32_t) * 4);
> -	memset(&chroma_interp, 0, sizeof(int32_t) * 4);
> -	memset(&chroma_bound, 0, sizeof(int32_t) * 4);
> -	memset(&chroma_repeat, 0, sizeof(int32_t) * 4);
> -	regs->edge = 0;
> -
> -	if (req->flags & MDP_ROT_90) {
> -		dst_w = req->dst_rect.h;
> -		dst_h = req->dst_rect.w;
> -	} else {
> -		dst_w = req->dst_rect.w;
> -		dst_h = req->dst_rect.h;
> -	}
> -
> -	if (regs->op & (PPP_OP_SCALE_Y_ON | PPP_OP_SCALE_X_ON)) {
> -		get_edge_info(req->src_rect.h, req->src_rect.y, dst_h,
> -			      &luma_interp[IMG_TOP], &luma_interp[IMG_BOTTOM],
> -			      &luma_repeat[IMG_TOP], &luma_repeat[IMG_BOTTOM]);
> -		get_edge_info(req->src_rect.w, req->src_rect.x, dst_w,
> -			      &luma_interp[IMG_LEFT], &luma_interp[IMG_RIGHT],
> -			      &luma_repeat[IMG_LEFT], &luma_repeat[IMG_RIGHT]);
> -	} else {
> -		luma_interp[IMG_LEFT] = req->src_rect.x;
> -		luma_interp[IMG_RIGHT] = req->src_rect.x + req->src_rect.w - 1;
> -		luma_interp[IMG_TOP] = req->src_rect.y;
> -		luma_interp[IMG_BOTTOM] = req->src_rect.y + req->src_rect.h - 1;
> -		luma_repeat[IMG_LEFT] = 0;
> -		luma_repeat[IMG_TOP] = 0;
> -		luma_repeat[IMG_RIGHT] = 0;
> -		luma_repeat[IMG_BOTTOM] = 0;
> -	}
> -
> -	chroma_interp[IMG_LEFT] = luma_interp[IMG_LEFT];
> -	chroma_interp[IMG_RIGHT] = luma_interp[IMG_RIGHT];
> -	chroma_interp[IMG_TOP] = luma_interp[IMG_TOP];
> -	chroma_interp[IMG_BOTTOM] = luma_interp[IMG_BOTTOM];
> -
> -	chroma_bound[IMG_LEFT] = req->src_rect.x;
> -	chroma_bound[IMG_RIGHT] = req->src_rect.x + req->src_rect.w - 1;
> -	chroma_bound[IMG_TOP] = req->src_rect.y;
> -	chroma_bound[IMG_BOTTOM] = req->src_rect.y + req->src_rect.h - 1;
> -
> -	if (IS_YCRCB(req->src.format)) {
> -		chroma_interp[IMG_LEFT] = chroma_interp[IMG_LEFT] >> 1;
> -		chroma_interp[IMG_RIGHT] = (chroma_interp[IMG_RIGHT] + 1) >> 1;
> -
> -		chroma_bound[IMG_LEFT] = chroma_bound[IMG_LEFT] >> 1;
> -		chroma_bound[IMG_RIGHT] = chroma_bound[IMG_RIGHT] >> 1;
> -	}
> -
> -	if (req->src.format == MDP_Y_CBCR_H2V2 ||
> -	    req->src.format == MDP_Y_CRCB_H2V2) {
> -		chroma_interp[IMG_TOP] = (chroma_interp[IMG_TOP] - 1) >> 1;
> -		chroma_interp[IMG_BOTTOM] = (chroma_interp[IMG_BOTTOM] + 1)
> -					    >> 1;
> -		chroma_bound[IMG_TOP] = (chroma_bound[IMG_TOP] + 1) >> 1;
> -		chroma_bound[IMG_BOTTOM] = chroma_bound[IMG_BOTTOM] >> 1;
> -	}
> -
> -	chroma_repeat[IMG_LEFT] = chroma_bound[IMG_LEFT] -
> -				  chroma_interp[IMG_LEFT];
> -	chroma_repeat[IMG_RIGHT] = chroma_interp[IMG_RIGHT] -
> -				  chroma_bound[IMG_RIGHT];
> -	chroma_repeat[IMG_TOP] = chroma_bound[IMG_TOP] -
> -				  chroma_interp[IMG_TOP];
> -	chroma_repeat[IMG_BOTTOM] = chroma_interp[IMG_BOTTOM] -
> -				  chroma_bound[IMG_BOTTOM];
> -
> -	if (chroma_repeat[IMG_LEFT] < 0 || chroma_repeat[IMG_LEFT] > 3 ||
> -	    chroma_repeat[IMG_RIGHT] < 0 || chroma_repeat[IMG_RIGHT] > 3 ||
> -	    chroma_repeat[IMG_TOP] < 0 || chroma_repeat[IMG_TOP] > 3 ||
> -	    chroma_repeat[IMG_BOTTOM] < 0 || chroma_repeat[IMG_BOTTOM] > 3 ||
> -	    luma_repeat[IMG_LEFT] < 0 || luma_repeat[IMG_LEFT] > 3 ||
> -	    luma_repeat[IMG_RIGHT] < 0 || luma_repeat[IMG_RIGHT] > 3 ||
> -	    luma_repeat[IMG_TOP] < 0 || luma_repeat[IMG_TOP] > 3 ||
> -	    luma_repeat[IMG_BOTTOM] < 0 || luma_repeat[IMG_BOTTOM] > 3)
> -		return -1;
> -
> -	regs->edge |= (chroma_repeat[IMG_LEFT] & 3) << MDP_LEFT_CHROMA;
> -	regs->edge |= (chroma_repeat[IMG_RIGHT] & 3) << MDP_RIGHT_CHROMA;
> -	regs->edge |= (chroma_repeat[IMG_TOP] & 3) << MDP_TOP_CHROMA;
> -	regs->edge |= (chroma_repeat[IMG_BOTTOM] & 3) << MDP_BOTTOM_CHROMA;
> -	regs->edge |= (luma_repeat[IMG_LEFT] & 3) << MDP_LEFT_LUMA;
> -	regs->edge |= (luma_repeat[IMG_RIGHT] & 3) << MDP_RIGHT_LUMA;
> -	regs->edge |= (luma_repeat[IMG_TOP] & 3) << MDP_TOP_LUMA;
> -	regs->edge |= (luma_repeat[IMG_BOTTOM] & 3) << MDP_BOTTOM_LUMA;
> -	return 0;
> -}
> -
> -static int blit_scale(const struct mdp_info *mdp, struct mdp_blit_req *req,
> -		      struct mdp_regs *regs)
> -{
> -	uint32_t phase_init_x, phase_init_y, phase_step_x, phase_step_y;
> -	uint32_t scale_factor_x, scale_factor_y;
> -	uint32_t downscale;
> -	uint32_t dst_w, dst_h;
> -
> -	if (req->flags & MDP_ROT_90) {
> -		dst_w = req->dst_rect.h;
> -		dst_h = req->dst_rect.w;
> -	} else {
> -		dst_w = req->dst_rect.w;
> -		dst_h = req->dst_rect.h;
> -	}
> -	if ((req->src_rect.w == dst_w)  && (req->src_rect.h == dst_h) &&
> -	    !(req->flags & MDP_BLUR)) {
> -		regs->phasex_init = 0;
> -		regs->phasey_init = 0;
> -		regs->phasex_step = 0;
> -		regs->phasey_step = 0;
> -		return 0;
> -	}
> -
> -	if (scale_params(req->src_rect.w, dst_w, 1, &phase_init_x,
> -			 &phase_step_x) ||
> -	    scale_params(req->src_rect.h, dst_h, 1, &phase_init_y,
> -			 &phase_step_y))
> -		return -1;
> -
> -	scale_factor_x = (dst_w * 10) / req->src_rect.w;
> -	scale_factor_y = (dst_h * 10) / req->src_rect.h;
> -
> -	if (scale_factor_x > 8)
> -		downscale = MDP_DOWNSCALE_PT8TO1;
> -	else if (scale_factor_x > 6)
> -		downscale = MDP_DOWNSCALE_PT6TOPT8;
> -	else if (scale_factor_x > 4)
> -		downscale = MDP_DOWNSCALE_PT4TOPT6;
> -	else
> -		downscale = MDP_DOWNSCALE_PT2TOPT4;
> -	if (downscale != downscale_x_table) {
> -		load_scale_table(mdp, mdp_downscale_x_table[downscale], 64);
> -		downscale_x_table = downscale;
> -	}
> -
> -	if (scale_factor_y > 8)
> -		downscale = MDP_DOWNSCALE_PT8TO1;
> -	else if (scale_factor_y > 6)
> -		downscale = MDP_DOWNSCALE_PT6TOPT8;
> -	else if (scale_factor_y > 4)
> -		downscale = MDP_DOWNSCALE_PT4TOPT6;
> -	else
> -		downscale = MDP_DOWNSCALE_PT2TOPT4;
> -	if (downscale != downscale_y_table) {
> -		load_scale_table(mdp, mdp_downscale_y_table[downscale], 64);
> -		downscale_y_table = downscale;
> -	}
> -
> -	regs->phasex_init = phase_init_x;
> -	regs->phasey_init = phase_init_y;
> -	regs->phasex_step = phase_step_x;
> -	regs->phasey_step = phase_step_y;
> -	regs->op |= (PPP_OP_SCALE_Y_ON | PPP_OP_SCALE_X_ON);
> -	return 0;
> -
> -}
> -
> -static void blit_blur(const struct mdp_info *mdp, struct mdp_blit_req *req,
> -		      struct mdp_regs *regs)
> -{
> -	if (!(req->flags & MDP_BLUR))
> -		return;
> -
> -	if (!(downscale_x_table == MDP_DOWNSCALE_BLUR &&
> -	      downscale_y_table == MDP_DOWNSCALE_BLUR)) {
> -		load_scale_table(mdp, mdp_gaussian_blur_table, 128);
> -		downscale_x_table = MDP_DOWNSCALE_BLUR;
> -		downscale_y_table = MDP_DOWNSCALE_BLUR;
> -	}
> -
> -	regs->op |= (PPP_OP_SCALE_Y_ON | PPP_OP_SCALE_X_ON);
> -}
> -
> -
> -#define IMG_LEN(rect_h, w, rect_w, bpp) (((rect_h) * w) * bpp)
> -
> -#define Y_TO_CRCB_RATIO(format) \
> -	((format == MDP_Y_CBCR_H2V2 || format == MDP_Y_CRCB_H2V2) ?  2 :\
> -	 (format == MDP_Y_CBCR_H2V1 || format == MDP_Y_CRCB_H2V1) ?  1 : 1)
> -
> -static void get_len(struct mdp_img *img, struct mdp_rect *rect, uint32_t bpp,
> -		    uint32_t *len0, uint32_t *len1)
> -{
> -	*len0 = IMG_LEN(rect->h, img->width, rect->w, bpp);
> -	if (IS_PSEUDOPLNR(img->format))
> -		*len1 = *len0/Y_TO_CRCB_RATIO(img->format);
> -	else
> -		*len1 = 0;
> -}
> -
> -static int valid_src_dst(unsigned long src_start, unsigned long src_len,
> -			 unsigned long dst_start, unsigned long dst_len,
> -			 struct mdp_blit_req *req, struct mdp_regs *regs)
> -{
> -	unsigned long src_min_ok = src_start;
> -	unsigned long src_max_ok = src_start + src_len;
> -	unsigned long dst_min_ok = dst_start;
> -	unsigned long dst_max_ok = dst_start + dst_len;
> -	uint32_t src0_len, src1_len, dst0_len, dst1_len;
> -	get_len(&req->src, &req->src_rect, regs->src_bpp, &src0_len,
> -		 &src1_len);
> -	get_len(&req->dst, &req->dst_rect, regs->dst_bpp, &dst0_len,
> -		 &dst1_len);
> -
> -	if (regs->src0 < src_min_ok || regs->src0 > src_max_ok ||
> -	    regs->src0 + src0_len > src_max_ok) {
> -		DLOG("invalid_src %x %x %lx %lx\n", regs->src0,
> -		      src0_len, src_min_ok, src_max_ok);
> -		return 0;
> -	}
> -	if (regs->src_cfg & PPP_SRC_PLANE_PSEUDOPLNR) {
> -		if (regs->src1 < src_min_ok || regs->src1 > src_max_ok ||
> -		    regs->src1 + src1_len > src_max_ok) {
> -			DLOG("invalid_src1");
> -			return 0;
> -		}
> -	}
> -	if (regs->dst0 < dst_min_ok || regs->dst0 > dst_max_ok ||
> -	    regs->dst0 + dst0_len > dst_max_ok) {
> -		DLOG("invalid_dst");
> -		return 0;
> -	}
> -	if (regs->dst_cfg & PPP_SRC_PLANE_PSEUDOPLNR) {
> -		if (regs->dst1 < dst_min_ok || regs->dst1 > dst_max_ok ||
> -		    regs->dst1 + dst1_len > dst_max_ok) {
> -			DLOG("invalid_dst1");
> -			return 0;
> -		}
> -	}
> -	return 1;
> -}
> -
> -
> -static void flush_imgs(struct mdp_blit_req *req, struct mdp_regs *regs,
> -		       struct file *src_file, struct file *dst_file)
> -{
> -}
> -
> -static void get_chroma_addr(struct mdp_img *img, struct mdp_rect *rect,
> -			    uint32_t base, uint32_t bpp, uint32_t cfg,
> -			    uint32_t *addr, uint32_t *ystride)
> -{
> -	uint32_t compress_v = Y_TO_CRCB_RATIO(img->format);
> -	uint32_t compress_h = 2;
> -	uint32_t  offset;
> -
> -	if (IS_PSEUDOPLNR(img->format)) {
> -		offset = (rect->x / compress_h) * compress_h;
> -		offset += rect->y == 0 ? 0 :
> -			  ((rect->y + 1) / compress_v) * img->width;
> -		*addr = base + (img->width * img->height * bpp);
> -		*addr += offset * bpp;
> -		*ystride |= *ystride << 16;
> -	} else {
> -		*addr = 0;
> -	}
> -}
> -
> -static int send_blit(const struct mdp_info *mdp, struct mdp_blit_req *req,
> -		     struct mdp_regs *regs, struct file *src_file,
> -		     struct file *dst_file)
> -{
> -	mdp_writel(mdp, 1, 0x060);
> -	mdp_writel(mdp, regs->src_rect, PPP_ADDR_SRC_ROI);
> -	mdp_writel(mdp, regs->src0, PPP_ADDR_SRC0);
> -	mdp_writel(mdp, regs->src1, PPP_ADDR_SRC1);
> -	mdp_writel(mdp, regs->src_ystride, PPP_ADDR_SRC_YSTRIDE);
> -	mdp_writel(mdp, regs->src_cfg, PPP_ADDR_SRC_CFG);
> -	mdp_writel(mdp, regs->src_pack, PPP_ADDR_SRC_PACK_PATTERN);
> -
> -	mdp_writel(mdp, regs->op, PPP_ADDR_OPERATION);
> -	mdp_writel(mdp, regs->phasex_init, PPP_ADDR_PHASEX_INIT);
> -	mdp_writel(mdp, regs->phasey_init, PPP_ADDR_PHASEY_INIT);
> -	mdp_writel(mdp, regs->phasex_step, PPP_ADDR_PHASEX_STEP);
> -	mdp_writel(mdp, regs->phasey_step, PPP_ADDR_PHASEY_STEP);
> -
> -	mdp_writel(mdp, (req->alpha << 24) | (req->transp_mask & 0xffffff),
> -	       PPP_ADDR_ALPHA_TRANSP);
> -
> -	mdp_writel(mdp, regs->dst_cfg, PPP_ADDR_DST_CFG);
> -	mdp_writel(mdp, regs->dst_pack, PPP_ADDR_DST_PACK_PATTERN);
> -	mdp_writel(mdp, regs->dst_rect, PPP_ADDR_DST_ROI);
> -	mdp_writel(mdp, regs->dst0, PPP_ADDR_DST0);
> -	mdp_writel(mdp, regs->dst1, PPP_ADDR_DST1);
> -	mdp_writel(mdp, regs->dst_ystride, PPP_ADDR_DST_YSTRIDE);
> -
> -	mdp_writel(mdp, regs->edge, PPP_ADDR_EDGE);
> -	if (regs->op & PPP_OP_BLEND_ON) {
> -		mdp_writel(mdp, regs->dst0, PPP_ADDR_BG0);
> -		mdp_writel(mdp, regs->dst1, PPP_ADDR_BG1);
> -		mdp_writel(mdp, regs->dst_ystride, PPP_ADDR_BG_YSTRIDE);
> -		mdp_writel(mdp, src_img_cfg[req->dst.format], PPP_ADDR_BG_CFG);
> -		mdp_writel(mdp, pack_pattern[req->dst.format],
> -			   PPP_ADDR_BG_PACK_PATTERN);
> -	}
> -	flush_imgs(req, regs, src_file, dst_file);
> -	mdp_writel(mdp, 0x1000, MDP_DISPLAY0_START);
> -	return 0;
> -}
> -
> -int mdp_ppp_blit(const struct mdp_info *mdp, struct mdp_blit_req *req,
> -		 struct file *src_file, unsigned long src_start, unsigned long src_len,
> -		 struct file *dst_file, unsigned long dst_start, unsigned long dst_len)
> -{
> -	struct mdp_regs regs = {0};
> -
> -	if (unlikely(req->src.format >= MDP_IMGTYPE_LIMIT ||
> -		     req->dst.format >= MDP_IMGTYPE_LIMIT)) {
> -		printk(KERN_ERR "mpd_ppp: img is of wrong format\n");
> -		return -EINVAL;
> -	}
> -
> -	if (unlikely(req->src_rect.x > req->src.width ||
> -		     req->src_rect.y > req->src.height ||
> -		     req->dst_rect.x > req->dst.width ||
> -		     req->dst_rect.y > req->dst.height)) {
> -		printk(KERN_ERR "mpd_ppp: img rect is outside of img!\n");
> -		return -EINVAL;
> -	}
> -
> -	/* set the src image configuration */
> -	regs.src_cfg = src_img_cfg[req->src.format];
> -	regs.src_cfg |= (req->src_rect.x & 0x1) ? PPP_SRC_BPP_ROI_ODD_X : 0;
> -	regs.src_cfg |= (req->src_rect.y & 0x1) ? PPP_SRC_BPP_ROI_ODD_Y : 0;
> -	regs.src_rect = (req->src_rect.h << 16) | req->src_rect.w;
> -	regs.src_pack = pack_pattern[req->src.format];
> -
> -	/* set the dest image configuration */
> -	regs.dst_cfg = dst_img_cfg[req->dst.format] | PPP_DST_OUT_SEL_AXI;
> -	regs.dst_rect = (req->dst_rect.h << 16) | req->dst_rect.w;
> -	regs.dst_pack = pack_pattern[req->dst.format];
> -
> -	/* set src, bpp, start pixel and ystride */
> -	regs.src_bpp = bytes_per_pixel[req->src.format];
> -	regs.src0 = src_start + req->src.offset;
> -	regs.src_ystride = req->src.width * regs.src_bpp;
> -	get_chroma_addr(&req->src, &req->src_rect, regs.src0, regs.src_bpp,
> -			regs.src_cfg, &regs.src1, &regs.src_ystride);
> -	regs.src0 += (req->src_rect.x + (req->src_rect.y * req->src.width)) *
> -		      regs.src_bpp;
> -
> -	/* set dst, bpp, start pixel and ystride */
> -	regs.dst_bpp = bytes_per_pixel[req->dst.format];
> -	regs.dst0 = dst_start + req->dst.offset;
> -	regs.dst_ystride = req->dst.width * regs.dst_bpp;
> -	get_chroma_addr(&req->dst, &req->dst_rect, regs.dst0, regs.dst_bpp,
> -			regs.dst_cfg, &regs.dst1, &regs.dst_ystride);
> -	regs.dst0 += (req->dst_rect.x + (req->dst_rect.y * req->dst.width)) *
> -		      regs.dst_bpp;
> -
> -	if (!valid_src_dst(src_start, src_len, dst_start, dst_len, req,
> -			   &regs)) {
> -		printk(KERN_ERR "mpd_ppp: final src or dst location is "
> -			"invalid, are you trying to make an image too large "
> -			"or to place it outside the screen?\n");
> -		return -EINVAL;
> -	}
> -
> -	/* set up operation register */
> -	regs.op = 0;
> -	blit_rotate(req, &regs);
> -	blit_convert(req, &regs);
> -	if (req->flags & MDP_DITHER)
> -		regs.op |= PPP_OP_DITHER_EN;
> -	blit_blend(req, &regs);
> -	if (blit_scale(mdp, req, &regs)) {
> -		printk(KERN_ERR "mpd_ppp: error computing scale for img.\n");
> -		return -EINVAL;
> -	}
> -	blit_blur(mdp, req, &regs);
> -	regs.op |= dst_op_chroma[req->dst.format] |
> -		   src_op_chroma[req->src.format];
> -
> -	/* if the image is YCRYCB, the x and w must be even */
> -	if (unlikely(req->src.format == MDP_YCRYCB_H2V1)) {
> -		req->src_rect.x = req->src_rect.x & (~0x1);
> -		req->src_rect.w = req->src_rect.w & (~0x1);
> -		req->dst_rect.x = req->dst_rect.x & (~0x1);
> -		req->dst_rect.w = req->dst_rect.w & (~0x1);
> -	}
> -	if (get_edge_cond(req, &regs))
> -		return -EINVAL;
> -
> -	send_blit(mdp, req, &regs, src_file, dst_file);
> -	return 0;
> -}
> diff --git a/drivers/video/fbdev/msm/mdp_scale_tables.c b/drivers/video/fbdev/msm/mdp_scale_tables.c
> deleted file mode 100644
> index 604783b2e17c..000000000000
> --- a/drivers/video/fbdev/msm/mdp_scale_tables.c
> +++ /dev/null
> @@ -1,766 +0,0 @@
> -/* drivers/video/msm_fb/mdp_scale_tables.c
> - *
> - * Copyright (C) 2007 QUALCOMM Incorporated
> - * Copyright (C) 2007 Google Incorporated
> - *
> - * 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 "mdp_scale_tables.h"
> -#include "mdp_hw.h"
> -
> -struct mdp_table_entry mdp_upscale_table[] = {
> -	{ 0x5fffc, 0x0 },
> -	{ 0x50200, 0x7fc00000 },
> -	{ 0x5fffc, 0xff80000d },
> -	{ 0x50204, 0x7ec003f9 },
> -	{ 0x5fffc, 0xfec0001c },
> -	{ 0x50208, 0x7d4003f3 },
> -	{ 0x5fffc, 0xfe40002b },
> -	{ 0x5020c, 0x7b8003ed },
> -	{ 0x5fffc, 0xfd80003c },
> -	{ 0x50210, 0x794003e8 },
> -	{ 0x5fffc, 0xfcc0004d },
> -	{ 0x50214, 0x76c003e4 },
> -	{ 0x5fffc, 0xfc40005f },
> -	{ 0x50218, 0x73c003e0 },
> -	{ 0x5fffc, 0xfb800071 },
> -	{ 0x5021c, 0x708003de },
> -	{ 0x5fffc, 0xfac00085 },
> -	{ 0x50220, 0x6d0003db },
> -	{ 0x5fffc, 0xfa000098 },
> -	{ 0x50224, 0x698003d9 },
> -	{ 0x5fffc, 0xf98000ac },
> -	{ 0x50228, 0x654003d8 },
> -	{ 0x5fffc, 0xf8c000c1 },
> -	{ 0x5022c, 0x610003d7 },
> -	{ 0x5fffc, 0xf84000d5 },
> -	{ 0x50230, 0x5c8003d7 },
> -	{ 0x5fffc, 0xf7c000e9 },
> -	{ 0x50234, 0x580003d7 },
> -	{ 0x5fffc, 0xf74000fd },
> -	{ 0x50238, 0x534003d8 },
> -	{ 0x5fffc, 0xf6c00112 },
> -	{ 0x5023c, 0x4e8003d8 },
> -	{ 0x5fffc, 0xf6800126 },
> -	{ 0x50240, 0x494003da },
> -	{ 0x5fffc, 0xf600013a },
> -	{ 0x50244, 0x448003db },
> -	{ 0x5fffc, 0xf600014d },
> -	{ 0x50248, 0x3f4003dd },
> -	{ 0x5fffc, 0xf5c00160 },
> -	{ 0x5024c, 0x3a4003df },
> -	{ 0x5fffc, 0xf5c00172 },
> -	{ 0x50250, 0x354003e1 },
> -	{ 0x5fffc, 0xf5c00184 },
> -	{ 0x50254, 0x304003e3 },
> -	{ 0x5fffc, 0xf6000195 },
> -	{ 0x50258, 0x2b0003e6 },
> -	{ 0x5fffc, 0xf64001a6 },
> -	{ 0x5025c, 0x260003e8 },
> -	{ 0x5fffc, 0xf6c001b4 },
> -	{ 0x50260, 0x214003eb },
> -	{ 0x5fffc, 0xf78001c2 },
> -	{ 0x50264, 0x1c4003ee },
> -	{ 0x5fffc, 0xf80001cf },
> -	{ 0x50268, 0x17c003f1 },
> -	{ 0x5fffc, 0xf90001db },
> -	{ 0x5026c, 0x134003f3 },
> -	{ 0x5fffc, 0xfa0001e5 },
> -	{ 0x50270, 0xf0003f6 },
> -	{ 0x5fffc, 0xfb4001ee },
> -	{ 0x50274, 0xac003f9 },
> -	{ 0x5fffc, 0xfcc001f5 },
> -	{ 0x50278, 0x70003fb },
> -	{ 0x5fffc, 0xfe4001fb },
> -	{ 0x5027c, 0x34003fe },
> -};
> -
> -static struct mdp_table_entry mdp_downscale_x_table_PT2TOPT4[] = {
> -	{ 0x5fffc, 0x740008c },
> -	{ 0x50280, 0x33800088 },
> -	{ 0x5fffc, 0x800008e },
> -	{ 0x50284, 0x33400084 },
> -	{ 0x5fffc, 0x8400092 },
> -	{ 0x50288, 0x33000080 },
> -	{ 0x5fffc, 0x9000094 },
> -	{ 0x5028c, 0x3300007b },
> -	{ 0x5fffc, 0x9c00098 },
> -	{ 0x50290, 0x32400077 },
> -	{ 0x5fffc, 0xa40009b },
> -	{ 0x50294, 0x32000073 },
> -	{ 0x5fffc, 0xb00009d },
> -	{ 0x50298,  0x31c0006f },
> -	{ 0x5fffc,  0xbc000a0 },
> -	{ 0x5029c,  0x3140006b },
> -	{ 0x5fffc,  0xc8000a2 },
> -	{ 0x502a0,  0x31000067 },
> -	{ 0x5fffc,  0xd8000a5 },
> -	{ 0x502a4,  0x30800062 },
> -	{ 0x5fffc,  0xe4000a8 },
> -	{ 0x502a8,  0x2fc0005f },
> -	{ 0x5fffc,  0xec000aa },
> -	{ 0x502ac,  0x2fc0005b },
> -	{ 0x5fffc,  0xf8000ad },
> -	{ 0x502b0,  0x2f400057 },
> -	{ 0x5fffc,  0x108000b0 },
> -	{ 0x502b4,  0x2e400054 },
> -	{ 0x5fffc,  0x114000b2 },
> -	{ 0x502b8,  0x2e000050 },
> -	{ 0x5fffc,  0x124000b4 },
> -	{ 0x502bc,  0x2d80004c },
> -	{ 0x5fffc,  0x130000b6 },
> -	{ 0x502c0,  0x2d000049 },
> -	{ 0x5fffc,  0x140000b8 },
> -	{ 0x502c4,  0x2c800045 },
> -	{ 0x5fffc,  0x150000b9 },
> -	{ 0x502c8,  0x2c000042 },
> -	{ 0x5fffc,  0x15c000bd },
> -	{ 0x502cc,  0x2b40003e },
> -	{ 0x5fffc,  0x16c000bf },
> -	{ 0x502d0,  0x2a80003b },
> -	{ 0x5fffc,  0x17c000bf },
> -	{ 0x502d4,  0x2a000039 },
> -	{ 0x5fffc,  0x188000c2 },
> -	{ 0x502d8,  0x29400036 },
> -	{ 0x5fffc,  0x19c000c4 },
> -	{ 0x502dc,  0x28800032 },
> -	{ 0x5fffc,  0x1ac000c5 },
> -	{ 0x502e0,  0x2800002f },
> -	{ 0x5fffc,  0x1bc000c7 },
> -	{ 0x502e4,  0x2740002c },
> -	{ 0x5fffc,  0x1cc000c8 },
> -	{ 0x502e8,  0x26c00029 },
> -	{ 0x5fffc,  0x1dc000c9 },
> -	{ 0x502ec,  0x26000027 },
> -	{ 0x5fffc,  0x1ec000cc },
> -	{ 0x502f0,  0x25000024 },
> -	{ 0x5fffc,  0x200000cc },
> -	{ 0x502f4,  0x24800021 },
> -	{ 0x5fffc,  0x210000cd },
> -	{ 0x502f8,  0x23800020 },
> -	{ 0x5fffc,  0x220000ce },
> -	{ 0x502fc,  0x2300001d },
> -};
> -
> -static struct mdp_table_entry mdp_downscale_x_table_PT4TOPT6[] = {
> -	{ 0x5fffc,  0x740008c },
> -	{ 0x50280,  0x33800088 },
> -	{ 0x5fffc,  0x800008e },
> -	{ 0x50284,  0x33400084 },
> -	{ 0x5fffc,  0x8400092 },
> -	{ 0x50288,  0x33000080 },
> -	{ 0x5fffc,  0x9000094 },
> -	{ 0x5028c,  0x3300007b },
> -	{ 0x5fffc,  0x9c00098 },
> -	{ 0x50290,  0x32400077 },
> -	{ 0x5fffc,  0xa40009b },
> -	{ 0x50294,  0x32000073 },
> -	{ 0x5fffc,  0xb00009d },
> -	{ 0x50298,  0x31c0006f },
> -	{ 0x5fffc,  0xbc000a0 },
> -	{ 0x5029c,  0x3140006b },
> -	{ 0x5fffc,  0xc8000a2 },
> -	{ 0x502a0,  0x31000067 },
> -	{ 0x5fffc,  0xd8000a5 },
> -	{ 0x502a4,  0x30800062 },
> -	{ 0x5fffc,  0xe4000a8 },
> -	{ 0x502a8,  0x2fc0005f },
> -	{ 0x5fffc,  0xec000aa },
> -	{ 0x502ac,  0x2fc0005b },
> -	{ 0x5fffc,  0xf8000ad },
> -	{ 0x502b0,  0x2f400057 },
> -	{ 0x5fffc,  0x108000b0 },
> -	{ 0x502b4,  0x2e400054 },
> -	{ 0x5fffc,  0x114000b2 },
> -	{ 0x502b8,  0x2e000050 },
> -	{ 0x5fffc,  0x124000b4 },
> -	{ 0x502bc,  0x2d80004c },
> -	{ 0x5fffc,  0x130000b6 },
> -	{ 0x502c0,  0x2d000049 },
> -	{ 0x5fffc,  0x140000b8 },
> -	{ 0x502c4,  0x2c800045 },
> -	{ 0x5fffc,  0x150000b9 },
> -	{ 0x502c8,  0x2c000042 },
> -	{ 0x5fffc,  0x15c000bd },
> -	{ 0x502cc,  0x2b40003e },
> -	{ 0x5fffc,  0x16c000bf },
> -	{ 0x502d0,  0x2a80003b },
> -	{ 0x5fffc,  0x17c000bf },
> -	{ 0x502d4,  0x2a000039 },
> -	{ 0x5fffc,  0x188000c2 },
> -	{ 0x502d8,  0x29400036 },
> -	{ 0x5fffc,  0x19c000c4 },
> -	{ 0x502dc,  0x28800032 },
> -	{ 0x5fffc,  0x1ac000c5 },
> -	{ 0x502e0,  0x2800002f },
> -	{ 0x5fffc,  0x1bc000c7 },
> -	{ 0x502e4,  0x2740002c },
> -	{ 0x5fffc,  0x1cc000c8 },
> -	{ 0x502e8,  0x26c00029 },
> -	{ 0x5fffc,  0x1dc000c9 },
> -	{ 0x502ec,  0x26000027 },
> -	{ 0x5fffc,  0x1ec000cc },
> -	{ 0x502f0,  0x25000024 },
> -	{ 0x5fffc,  0x200000cc },
> -	{ 0x502f4,  0x24800021 },
> -	{ 0x5fffc,  0x210000cd },
> -	{ 0x502f8,  0x23800020 },
> -	{ 0x5fffc,  0x220000ce },
> -	{ 0x502fc,  0x2300001d },
> -};
> -
> -static struct mdp_table_entry mdp_downscale_x_table_PT6TOPT8[] = {
> -	{ 0x5fffc,  0xfe000070 },
> -	{ 0x50280,  0x4bc00068 },
> -	{ 0x5fffc,  0xfe000078 },
> -	{ 0x50284,  0x4bc00060 },
> -	{ 0x5fffc,  0xfe000080 },
> -	{ 0x50288,  0x4b800059 },
> -	{ 0x5fffc,  0xfe000089 },
> -	{ 0x5028c,  0x4b000052 },
> -	{ 0x5fffc,  0xfe400091 },
> -	{ 0x50290,  0x4a80004b },
> -	{ 0x5fffc,  0xfe40009a },
> -	{ 0x50294,  0x4a000044 },
> -	{ 0x5fffc,  0xfe8000a3 },
> -	{ 0x50298,  0x4940003d },
> -	{ 0x5fffc,  0xfec000ac },
> -	{ 0x5029c,  0x48400037 },
> -	{ 0x5fffc,  0xff0000b4 },
> -	{ 0x502a0,  0x47800031 },
> -	{ 0x5fffc,  0xff8000bd },
> -	{ 0x502a4,  0x4640002b },
> -	{ 0x5fffc,  0xc5 },
> -	{ 0x502a8,  0x45000026 },
> -	{ 0x5fffc,  0x8000ce },
> -	{ 0x502ac,  0x43800021 },
> -	{ 0x5fffc,  0x10000d6 },
> -	{ 0x502b0,  0x4240001c },
> -	{ 0x5fffc,  0x18000df },
> -	{ 0x502b4,  0x40800018 },
> -	{ 0x5fffc,  0x24000e6 },
> -	{ 0x502b8,  0x3f000014 },
> -	{ 0x5fffc,  0x30000ee },
> -	{ 0x502bc,  0x3d400010 },
> -	{ 0x5fffc,  0x40000f5 },
> -	{ 0x502c0,  0x3b80000c },
> -	{ 0x5fffc,  0x50000fc },
> -	{ 0x502c4,  0x39800009 },
> -	{ 0x5fffc,  0x6000102 },
> -	{ 0x502c8,  0x37c00006 },
> -	{ 0x5fffc,  0x7000109 },
> -	{ 0x502cc,  0x35800004 },
> -	{ 0x5fffc,  0x840010e },
> -	{ 0x502d0,  0x33800002 },
> -	{ 0x5fffc,  0x9800114 },
> -	{ 0x502d4,  0x31400000 },
> -	{ 0x5fffc,  0xac00119 },
> -	{ 0x502d8,  0x2f4003fe },
> -	{ 0x5fffc,  0xc40011e },
> -	{ 0x502dc,  0x2d0003fc },
> -	{ 0x5fffc,  0xdc00121 },
> -	{ 0x502e0,  0x2b0003fb },
> -	{ 0x5fffc,  0xf400125 },
> -	{ 0x502e4,  0x28c003fa },
> -	{ 0x5fffc,  0x11000128 },
> -	{ 0x502e8,  0x268003f9 },
> -	{ 0x5fffc,  0x12c0012a },
> -	{ 0x502ec,  0x244003f9 },
> -	{ 0x5fffc,  0x1480012c },
> -	{ 0x502f0,  0x224003f8 },
> -	{ 0x5fffc,  0x1640012e },
> -	{ 0x502f4,  0x200003f8 },
> -	{ 0x5fffc,  0x1800012f },
> -	{ 0x502f8,  0x1e0003f8 },
> -	{ 0x5fffc,  0x1a00012f },
> -	{ 0x502fc,  0x1c0003f8 },
> -};
> -
> -static struct mdp_table_entry mdp_downscale_x_table_PT8TO1[] = {
> -	{ 0x5fffc,  0x0 },
> -	{ 0x50280,  0x7fc00000 },
> -	{ 0x5fffc,  0xff80000d },
> -	{ 0x50284,  0x7ec003f9 },
> -	{ 0x5fffc,  0xfec0001c },
> -	{ 0x50288,  0x7d4003f3 },
> -	{ 0x5fffc,  0xfe40002b },
> -	{ 0x5028c,  0x7b8003ed },
> -	{ 0x5fffc,  0xfd80003c },
> -	{ 0x50290,  0x794003e8 },
> -	{ 0x5fffc,  0xfcc0004d },
> -	{ 0x50294,  0x76c003e4 },
> -	{ 0x5fffc,  0xfc40005f },
> -	{ 0x50298,  0x73c003e0 },
> -	{ 0x5fffc,  0xfb800071 },
> -	{ 0x5029c,  0x708003de },
> -	{ 0x5fffc,  0xfac00085 },
> -	{ 0x502a0,  0x6d0003db },
> -	{ 0x5fffc,  0xfa000098 },
> -	{ 0x502a4,  0x698003d9 },
> -	{ 0x5fffc,  0xf98000ac },
> -	{ 0x502a8,  0x654003d8 },
> -	{ 0x5fffc,  0xf8c000c1 },
> -	{ 0x502ac,  0x610003d7 },
> -	{ 0x5fffc,  0xf84000d5 },
> -	{ 0x502b0,  0x5c8003d7 },
> -	{ 0x5fffc,  0xf7c000e9 },
> -	{ 0x502b4,  0x580003d7 },
> -	{ 0x5fffc,  0xf74000fd },
> -	{ 0x502b8,  0x534003d8 },
> -	{ 0x5fffc,  0xf6c00112 },
> -	{ 0x502bc,  0x4e8003d8 },
> -	{ 0x5fffc,  0xf6800126 },
> -	{ 0x502c0,  0x494003da },
> -	{ 0x5fffc,  0xf600013a },
> -	{ 0x502c4,  0x448003db },
> -	{ 0x5fffc,  0xf600014d },
> -	{ 0x502c8,  0x3f4003dd },
> -	{ 0x5fffc,  0xf5c00160 },
> -	{ 0x502cc,  0x3a4003df },
> -	{ 0x5fffc,  0xf5c00172 },
> -	{ 0x502d0,  0x354003e1 },
> -	{ 0x5fffc,  0xf5c00184 },
> -	{ 0x502d4,  0x304003e3 },
> -	{ 0x5fffc,  0xf6000195 },
> -	{ 0x502d8,  0x2b0003e6 },
> -	{ 0x5fffc,  0xf64001a6 },
> -	{ 0x502dc,  0x260003e8 },
> -	{ 0x5fffc,  0xf6c001b4 },
> -	{ 0x502e0,  0x214003eb },
> -	{ 0x5fffc,  0xf78001c2 },
> -	{ 0x502e4,  0x1c4003ee },
> -	{ 0x5fffc,  0xf80001cf },
> -	{ 0x502e8,  0x17c003f1 },
> -	{ 0x5fffc,  0xf90001db },
> -	{ 0x502ec,  0x134003f3 },
> -	{ 0x5fffc,  0xfa0001e5 },
> -	{ 0x502f0,  0xf0003f6 },
> -	{ 0x5fffc,  0xfb4001ee },
> -	{ 0x502f4,  0xac003f9 },
> -	{ 0x5fffc,  0xfcc001f5 },
> -	{ 0x502f8,  0x70003fb },
> -	{ 0x5fffc,  0xfe4001fb },
> -	{ 0x502fc,  0x34003fe },
> -};
> -
> -struct mdp_table_entry *mdp_downscale_x_table[MDP_DOWNSCALE_MAX] = {
> -	[MDP_DOWNSCALE_PT2TOPT4] = mdp_downscale_x_table_PT2TOPT4,
> -	[MDP_DOWNSCALE_PT4TOPT6] = mdp_downscale_x_table_PT4TOPT6,
> -	[MDP_DOWNSCALE_PT6TOPT8] = mdp_downscale_x_table_PT6TOPT8,
> -	[MDP_DOWNSCALE_PT8TO1]  = mdp_downscale_x_table_PT8TO1,
> -};
> -
> -static struct mdp_table_entry mdp_downscale_y_table_PT2TOPT4[] = {
> -	{ 0x5fffc,  0x740008c },
> -	{ 0x50300,  0x33800088 },
> -	{ 0x5fffc,  0x800008e },
> -	{ 0x50304,  0x33400084 },
> -	{ 0x5fffc,  0x8400092 },
> -	{ 0x50308,  0x33000080 },
> -	{ 0x5fffc,  0x9000094 },
> -	{ 0x5030c,  0x3300007b },
> -	{ 0x5fffc,  0x9c00098 },
> -	{ 0x50310,  0x32400077 },
> -	{ 0x5fffc,  0xa40009b },
> -	{ 0x50314,  0x32000073 },
> -	{ 0x5fffc,  0xb00009d },
> -	{ 0x50318,  0x31c0006f },
> -	{ 0x5fffc,  0xbc000a0 },
> -	{ 0x5031c,  0x3140006b },
> -	{ 0x5fffc,  0xc8000a2 },
> -	{ 0x50320,  0x31000067 },
> -	{ 0x5fffc,  0xd8000a5 },
> -	{ 0x50324,  0x30800062 },
> -	{ 0x5fffc,  0xe4000a8 },
> -	{ 0x50328,  0x2fc0005f },
> -	{ 0x5fffc,  0xec000aa },
> -	{ 0x5032c,  0x2fc0005b },
> -	{ 0x5fffc,  0xf8000ad },
> -	{ 0x50330,  0x2f400057 },
> -	{ 0x5fffc,  0x108000b0 },
> -	{ 0x50334,  0x2e400054 },
> -	{ 0x5fffc,  0x114000b2 },
> -	{ 0x50338,  0x2e000050 },
> -	{ 0x5fffc,  0x124000b4 },
> -	{ 0x5033c,  0x2d80004c },
> -	{ 0x5fffc,  0x130000b6 },
> -	{ 0x50340,  0x2d000049 },
> -	{ 0x5fffc,  0x140000b8 },
> -	{ 0x50344,  0x2c800045 },
> -	{ 0x5fffc,  0x150000b9 },
> -	{ 0x50348,  0x2c000042 },
> -	{ 0x5fffc,  0x15c000bd },
> -	{ 0x5034c,  0x2b40003e },
> -	{ 0x5fffc,  0x16c000bf },
> -	{ 0x50350,  0x2a80003b },
> -	{ 0x5fffc,  0x17c000bf },
> -	{ 0x50354,  0x2a000039 },
> -	{ 0x5fffc,  0x188000c2 },
> -	{ 0x50358,  0x29400036 },
> -	{ 0x5fffc,  0x19c000c4 },
> -	{ 0x5035c,  0x28800032 },
> -	{ 0x5fffc,  0x1ac000c5 },
> -	{ 0x50360,  0x2800002f },
> -	{ 0x5fffc,  0x1bc000c7 },
> -	{ 0x50364,  0x2740002c },
> -	{ 0x5fffc,  0x1cc000c8 },
> -	{ 0x50368,  0x26c00029 },
> -	{ 0x5fffc,  0x1dc000c9 },
> -	{ 0x5036c,  0x26000027 },
> -	{ 0x5fffc,  0x1ec000cc },
> -	{ 0x50370,  0x25000024 },
> -	{ 0x5fffc,  0x200000cc },
> -	{ 0x50374,  0x24800021 },
> -	{ 0x5fffc,  0x210000cd },
> -	{ 0x50378,  0x23800020 },
> -	{ 0x5fffc,  0x220000ce },
> -	{ 0x5037c,  0x2300001d },
> -};
> -
> -static struct mdp_table_entry mdp_downscale_y_table_PT4TOPT6[] = {
> -	{ 0x5fffc,  0x740008c },
> -	{ 0x50300,  0x33800088 },
> -	{ 0x5fffc,  0x800008e },
> -	{ 0x50304,  0x33400084 },
> -	{ 0x5fffc,  0x8400092 },
> -	{ 0x50308,  0x33000080 },
> -	{ 0x5fffc,  0x9000094 },
> -	{ 0x5030c,  0x3300007b },
> -	{ 0x5fffc,  0x9c00098 },
> -	{ 0x50310,  0x32400077 },
> -	{ 0x5fffc,  0xa40009b },
> -	{ 0x50314,  0x32000073 },
> -	{ 0x5fffc,  0xb00009d },
> -	{ 0x50318,  0x31c0006f },
> -	{ 0x5fffc,  0xbc000a0 },
> -	{ 0x5031c,  0x3140006b },
> -	{ 0x5fffc,  0xc8000a2 },
> -	{ 0x50320,  0x31000067 },
> -	{ 0x5fffc,  0xd8000a5 },
> -	{ 0x50324,  0x30800062 },
> -	{ 0x5fffc,  0xe4000a8 },
> -	{ 0x50328,  0x2fc0005f },
> -	{ 0x5fffc,  0xec000aa },
> -	{ 0x5032c,  0x2fc0005b },
> -	{ 0x5fffc,  0xf8000ad },
> -	{ 0x50330,  0x2f400057 },
> -	{ 0x5fffc,  0x108000b0 },
> -	{ 0x50334,  0x2e400054 },
> -	{ 0x5fffc,  0x114000b2 },
> -	{ 0x50338,  0x2e000050 },
> -	{ 0x5fffc,  0x124000b4 },
> -	{ 0x5033c,  0x2d80004c },
> -	{ 0x5fffc,  0x130000b6 },
> -	{ 0x50340,  0x2d000049 },
> -	{ 0x5fffc,  0x140000b8 },
> -	{ 0x50344,  0x2c800045 },
> -	{ 0x5fffc,  0x150000b9 },
> -	{ 0x50348,  0x2c000042 },
> -	{ 0x5fffc,  0x15c000bd },
> -	{ 0x5034c,  0x2b40003e },
> -	{ 0x5fffc,  0x16c000bf },
> -	{ 0x50350,  0x2a80003b },
> -	{ 0x5fffc,  0x17c000bf },
> -	{ 0x50354,  0x2a000039 },
> -	{ 0x5fffc,  0x188000c2 },
> -	{ 0x50358,  0x29400036 },
> -	{ 0x5fffc,  0x19c000c4 },
> -	{ 0x5035c,  0x28800032 },
> -	{ 0x5fffc,  0x1ac000c5 },
> -	{ 0x50360,  0x2800002f },
> -	{ 0x5fffc,  0x1bc000c7 },
> -	{ 0x50364,  0x2740002c },
> -	{ 0x5fffc,  0x1cc000c8 },
> -	{ 0x50368,  0x26c00029 },
> -	{ 0x5fffc,  0x1dc000c9 },
> -	{ 0x5036c,  0x26000027 },
> -	{ 0x5fffc,  0x1ec000cc },
> -	{ 0x50370,  0x25000024 },
> -	{ 0x5fffc,  0x200000cc },
> -	{ 0x50374,  0x24800021 },
> -	{ 0x5fffc,  0x210000cd },
> -	{ 0x50378,  0x23800020 },
> -	{ 0x5fffc,  0x220000ce },
> -	{ 0x5037c,  0x2300001d },
> -};
> -
> -static struct mdp_table_entry mdp_downscale_y_table_PT6TOPT8[] = {
> -	{ 0x5fffc,  0xfe000070 },
> -	{ 0x50300,  0x4bc00068 },
> -	{ 0x5fffc,  0xfe000078 },
> -	{ 0x50304,  0x4bc00060 },
> -	{ 0x5fffc,  0xfe000080 },
> -	{ 0x50308,  0x4b800059 },
> -	{ 0x5fffc,  0xfe000089 },
> -	{ 0x5030c,  0x4b000052 },
> -	{ 0x5fffc,  0xfe400091 },
> -	{ 0x50310,  0x4a80004b },
> -	{ 0x5fffc,  0xfe40009a },
> -	{ 0x50314,  0x4a000044 },
> -	{ 0x5fffc,  0xfe8000a3 },
> -	{ 0x50318,  0x4940003d },
> -	{ 0x5fffc,  0xfec000ac },
> -	{ 0x5031c,  0x48400037 },
> -	{ 0x5fffc,  0xff0000b4 },
> -	{ 0x50320,  0x47800031 },
> -	{ 0x5fffc,  0xff8000bd },
> -	{ 0x50324,  0x4640002b },
> -	{ 0x5fffc,  0xc5 },
> -	{ 0x50328,  0x45000026 },
> -	{ 0x5fffc,  0x8000ce },
> -	{ 0x5032c,  0x43800021 },
> -	{ 0x5fffc,  0x10000d6 },
> -	{ 0x50330,  0x4240001c },
> -	{ 0x5fffc,  0x18000df },
> -	{ 0x50334,  0x40800018 },
> -	{ 0x5fffc,  0x24000e6 },
> -	{ 0x50338,  0x3f000014 },
> -	{ 0x5fffc,  0x30000ee },
> -	{ 0x5033c,  0x3d400010 },
> -	{ 0x5fffc,  0x40000f5 },
> -	{ 0x50340,  0x3b80000c },
> -	{ 0x5fffc,  0x50000fc },
> -	{ 0x50344,  0x39800009 },
> -	{ 0x5fffc,  0x6000102 },
> -	{ 0x50348,  0x37c00006 },
> -	{ 0x5fffc,  0x7000109 },
> -	{ 0x5034c,  0x35800004 },
> -	{ 0x5fffc,  0x840010e },
> -	{ 0x50350,  0x33800002 },
> -	{ 0x5fffc,  0x9800114 },
> -	{ 0x50354,  0x31400000 },
> -	{ 0x5fffc,  0xac00119 },
> -	{ 0x50358,  0x2f4003fe },
> -	{ 0x5fffc,  0xc40011e },
> -	{ 0x5035c,  0x2d0003fc },
> -	{ 0x5fffc,  0xdc00121 },
> -	{ 0x50360,  0x2b0003fb },
> -	{ 0x5fffc,  0xf400125 },
> -	{ 0x50364,  0x28c003fa },
> -	{ 0x5fffc,  0x11000128 },
> -	{ 0x50368,  0x268003f9 },
> -	{ 0x5fffc,  0x12c0012a },
> -	{ 0x5036c,  0x244003f9 },
> -	{ 0x5fffc,  0x1480012c },
> -	{ 0x50370,  0x224003f8 },
> -	{ 0x5fffc,  0x1640012e },
> -	{ 0x50374,  0x200003f8 },
> -	{ 0x5fffc,  0x1800012f },
> -	{ 0x50378,  0x1e0003f8 },
> -	{ 0x5fffc,  0x1a00012f },
> -	{ 0x5037c,  0x1c0003f8 },
> -};
> -
> -static struct mdp_table_entry mdp_downscale_y_table_PT8TO1[] = {
> -	{ 0x5fffc,  0x0 },
> -	{ 0x50300,  0x7fc00000 },
> -	{ 0x5fffc,  0xff80000d },
> -	{ 0x50304,  0x7ec003f9 },
> -	{ 0x5fffc,  0xfec0001c },
> -	{ 0x50308,  0x7d4003f3 },
> -	{ 0x5fffc,  0xfe40002b },
> -	{ 0x5030c,  0x7b8003ed },
> -	{ 0x5fffc,  0xfd80003c },
> -	{ 0x50310,  0x794003e8 },
> -	{ 0x5fffc,  0xfcc0004d },
> -	{ 0x50314,  0x76c003e4 },
> -	{ 0x5fffc,  0xfc40005f },
> -	{ 0x50318,  0x73c003e0 },
> -	{ 0x5fffc,  0xfb800071 },
> -	{ 0x5031c,  0x708003de },
> -	{ 0x5fffc,  0xfac00085 },
> -	{ 0x50320,  0x6d0003db },
> -	{ 0x5fffc,  0xfa000098 },
> -	{ 0x50324,  0x698003d9 },
> -	{ 0x5fffc,  0xf98000ac },
> -	{ 0x50328,  0x654003d8 },
> -	{ 0x5fffc,  0xf8c000c1 },
> -	{ 0x5032c,  0x610003d7 },
> -	{ 0x5fffc,  0xf84000d5 },
> -	{ 0x50330,  0x5c8003d7 },
> -	{ 0x5fffc,  0xf7c000e9 },
> -	{ 0x50334,  0x580003d7 },
> -	{ 0x5fffc,  0xf74000fd },
> -	{ 0x50338,  0x534003d8 },
> -	{ 0x5fffc,  0xf6c00112 },
> -	{ 0x5033c,  0x4e8003d8 },
> -	{ 0x5fffc,  0xf6800126 },
> -	{ 0x50340,  0x494003da },
> -	{ 0x5fffc,  0xf600013a },
> -	{ 0x50344,  0x448003db },
> -	{ 0x5fffc,  0xf600014d },
> -	{ 0x50348,  0x3f4003dd },
> -	{ 0x5fffc,  0xf5c00160 },
> -	{ 0x5034c,  0x3a4003df },
> -	{ 0x5fffc,  0xf5c00172 },
> -	{ 0x50350,  0x354003e1 },
> -	{ 0x5fffc,  0xf5c00184 },
> -	{ 0x50354,  0x304003e3 },
> -	{ 0x5fffc,  0xf6000195 },
> -	{ 0x50358,  0x2b0003e6 },
> -	{ 0x5fffc,  0xf64001a6 },
> -	{ 0x5035c,  0x260003e8 },
> -	{ 0x5fffc,  0xf6c001b4 },
> -	{ 0x50360,  0x214003eb },
> -	{ 0x5fffc,  0xf78001c2 },
> -	{ 0x50364,  0x1c4003ee },
> -	{ 0x5fffc,  0xf80001cf },
> -	{ 0x50368,  0x17c003f1 },
> -	{ 0x5fffc,  0xf90001db },
> -	{ 0x5036c,  0x134003f3 },
> -	{ 0x5fffc,  0xfa0001e5 },
> -	{ 0x50370,  0xf0003f6 },
> -	{ 0x5fffc,  0xfb4001ee },
> -	{ 0x50374,  0xac003f9 },
> -	{ 0x5fffc,  0xfcc001f5 },
> -	{ 0x50378,  0x70003fb },
> -	{ 0x5fffc,  0xfe4001fb },
> -	{ 0x5037c,  0x34003fe },
> -};
> -
> -struct mdp_table_entry *mdp_downscale_y_table[MDP_DOWNSCALE_MAX] = {
> -	[MDP_DOWNSCALE_PT2TOPT4] = mdp_downscale_y_table_PT2TOPT4,
> -	[MDP_DOWNSCALE_PT4TOPT6] = mdp_downscale_y_table_PT4TOPT6,
> -	[MDP_DOWNSCALE_PT6TOPT8] = mdp_downscale_y_table_PT6TOPT8,
> -	[MDP_DOWNSCALE_PT8TO1]  = mdp_downscale_y_table_PT8TO1,
> -};
> -
> -struct mdp_table_entry mdp_gaussian_blur_table[] = {
> -	/* max variance */
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50280, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50284, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50288, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x5028c, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50290, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50294, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50298, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x5029c, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x502a0, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x502a4, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x502a8, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x502ac, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x502b0, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x502b4, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x502b8, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x502bc, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x502c0, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x502c4, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x502c8, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x502cc, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x502d0, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x502d4, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x502d8, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x502dc, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x502e0, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x502e4, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x502e8, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x502ec, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x502f0, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x502f4, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x502f8, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x502fc, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50300, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50304, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50308, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x5030c, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50310, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50314, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50318, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x5031c, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50320, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50324, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50328, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x5032c, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50330, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50334, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50338, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x5033c, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50340, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50344, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50348, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x5034c, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50350, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50354, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50358, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x5035c, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50360, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50364, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50368, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x5036c, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50370, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50374, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x50378, 0x20000080 },
> -	{ 0x5fffc, 0x20000080 },
> -	{ 0x5037c, 0x20000080 },
> -};
> diff --git a/drivers/video/fbdev/msm/mdp_scale_tables.h b/drivers/video/fbdev/msm/mdp_scale_tables.h
> deleted file mode 100644
> index 34077b1af603..000000000000
> --- a/drivers/video/fbdev/msm/mdp_scale_tables.h
> +++ /dev/null
> @@ -1,38 +0,0 @@
> -/* drivers/video/msm_fb/mdp_scale_tables.h
> - *
> - * Copyright (C) 2007 QUALCOMM Incorporated
> - * Copyright (C) 2007 Google Incorporated
> - *
> - * 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.
> - */
> -#ifndef _MDP_SCALE_TABLES_H_
> -#define _MDP_SCALE_TABLES_H_
> -
> -#include <linux/types.h>
> -struct mdp_table_entry {
> -	uint32_t reg;
> -	uint32_t val;
> -};
> -
> -extern struct mdp_table_entry mdp_upscale_table[64];
> -
> -enum {
> -	MDP_DOWNSCALE_PT2TOPT4,
> -	MDP_DOWNSCALE_PT4TOPT6,
> -	MDP_DOWNSCALE_PT6TOPT8,
> -	MDP_DOWNSCALE_PT8TO1,
> -	MDP_DOWNSCALE_MAX,
> -};
> -
> -extern struct mdp_table_entry *mdp_downscale_x_table[MDP_DOWNSCALE_MAX];
> -extern struct mdp_table_entry *mdp_downscale_y_table[MDP_DOWNSCALE_MAX];
> -extern struct mdp_table_entry mdp_gaussian_blur_table[];
> -
> -#endif
> diff --git a/drivers/video/fbdev/msm/msm_fb.c b/drivers/video/fbdev/msm/msm_fb.c
> deleted file mode 100644
> index 2979d7e72126..000000000000
> --- a/drivers/video/fbdev/msm/msm_fb.c
> +++ /dev/null
> @@ -1,659 +0,0 @@
> -/* drivers/video/msm/msm_fb.c
> - *
> - * Core MSM framebuffer driver.
> - *
> - * Copyright (C) 2007 Google Incorporated
> - *
> - * 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/platform_device.h>
> -#include <linux/module.h>
> -#include <linux/fb.h>
> -#include <linux/slab.h>
> -#include <linux/delay.h>
> -
> -#include <linux/freezer.h>
> -#include <linux/wait.h>
> -#include <linux/msm_mdp.h>
> -#include <linux/io.h>
> -#include <linux/uaccess.h>
> -#include <linux/platform_data/video-msm_fb.h>
> -#include <linux/workqueue.h>
> -#include <linux/clk.h>
> -#include <linux/debugfs.h>
> -#include <linux/dma-mapping.h>
> -
> -#define PRINT_FPS 0
> -#define PRINT_BLIT_TIME 0
> -
> -#define SLEEPING 0x4
> -#define UPDATING 0x3
> -#define FULL_UPDATE_DONE 0x2
> -#define WAKING 0x1
> -#define AWAKE 0x0
> -
> -#define NONE 0
> -#define SUSPEND_RESUME 0x1
> -#define FPS 0x2
> -#define BLIT_TIME 0x4
> -#define SHOW_UPDATES 0x8
> -
> -#define DLOG(mask, fmt, args...) \
> -do { \
> -	if (msmfb_debug_mask & mask) \
> -		printk(KERN_INFO "msmfb: "fmt, ##args); \
> -} while (0)
> -
> -static int msmfb_debug_mask;
> -module_param_named(msmfb_debug_mask, msmfb_debug_mask, int,
> -		   S_IRUGO | S_IWUSR | S_IWGRP);
> -
> -struct mdp_device *mdp;
> -
> -struct msmfb_info {
> -	struct fb_info *fb;
> -	struct msm_panel_data *panel;
> -	int xres;
> -	int yres;
> -	unsigned output_format;
> -	unsigned yoffset;
> -	unsigned frame_requested;
> -	unsigned frame_done;
> -	int sleeping;
> -	unsigned update_frame;
> -	struct {
> -		int left;
> -		int top;
> -		int eright; /* exclusive */
> -		int ebottom; /* exclusive */
> -	} update_info;
> -	char *black;
> -
> -	spinlock_t update_lock;
> -	struct mutex panel_init_lock;
> -	wait_queue_head_t frame_wq;
> -	struct work_struct resume_work;
> -	struct msmfb_callback dma_callback;
> -	struct msmfb_callback vsync_callback;
> -	struct hrtimer fake_vsync;
> -	ktime_t vsync_request_time;
> -};
> -
> -static int msmfb_open(struct fb_info *info, int user)
> -{
> -	return 0;
> -}
> -
> -static int msmfb_release(struct fb_info *info, int user)
> -{
> -	return 0;
> -}
> -
> -/* Called from dma interrupt handler, must not sleep */
> -static void msmfb_handle_dma_interrupt(struct msmfb_callback *callback)
> -{
> -	unsigned long irq_flags;
> -	struct msmfb_info *msmfb  = container_of(callback, struct msmfb_info,
> -					       dma_callback);
> -
> -	spin_lock_irqsave(&msmfb->update_lock, irq_flags);
> -	msmfb->frame_done = msmfb->frame_requested;
> -	if (msmfb->sleeping == UPDATING &&
> -	    msmfb->frame_done == msmfb->update_frame) {
> -		DLOG(SUSPEND_RESUME, "full update completed\n");
> -		schedule_work(&msmfb->resume_work);
> -	}
> -	spin_unlock_irqrestore(&msmfb->update_lock, irq_flags);
> -	wake_up(&msmfb->frame_wq);
> -}
> -
> -static int msmfb_start_dma(struct msmfb_info *msmfb)
> -{
> -	uint32_t x, y, w, h;
> -	unsigned addr;
> -	unsigned long irq_flags;
> -	uint32_t yoffset;
> -	s64 time_since_request;
> -	struct msm_panel_data *panel = msmfb->panel;
> -
> -	spin_lock_irqsave(&msmfb->update_lock, irq_flags);
> -	time_since_request = ktime_to_ns(ktime_sub(ktime_get(),
> -			     msmfb->vsync_request_time));
> -	if (time_since_request > 20 * NSEC_PER_MSEC) {
> -		uint32_t us;
> -		us = do_div(time_since_request, NSEC_PER_MSEC) / NSEC_PER_USEC;
> -		printk(KERN_WARNING "msmfb_start_dma %lld.%03u ms after vsync "
> -			"request\n", time_since_request, us);
> -	}
> -	if (msmfb->frame_done == msmfb->frame_requested) {
> -		spin_unlock_irqrestore(&msmfb->update_lock, irq_flags);
> -		return -1;
> -	}
> -	if (msmfb->sleeping == SLEEPING) {
> -		DLOG(SUSPEND_RESUME, "tried to start dma while asleep\n");
> -		spin_unlock_irqrestore(&msmfb->update_lock, irq_flags);
> -		return -1;
> -	}
> -	x = msmfb->update_info.left;
> -	y = msmfb->update_info.top;
> -	w = msmfb->update_info.eright - x;
> -	h = msmfb->update_info.ebottom - y;
> -	yoffset = msmfb->yoffset;
> -	msmfb->update_info.left = msmfb->xres + 1;
> -	msmfb->update_info.top = msmfb->yres + 1;
> -	msmfb->update_info.eright = 0;
> -	msmfb->update_info.ebottom = 0;
> -	if (unlikely(w > msmfb->xres || h > msmfb->yres ||
> -		     w == 0 || h == 0)) {
> -		printk(KERN_INFO "invalid update: %d %d %d "
> -				"%d\n", x, y, w, h);
> -		msmfb->frame_done = msmfb->frame_requested;
> -		goto error;
> -	}
> -	spin_unlock_irqrestore(&msmfb->update_lock, irq_flags);
> -
> -	addr = ((msmfb->xres * (yoffset + y) + x) * 2);
> -	mdp->dma(mdp, addr + msmfb->fb->fix.smem_start,
> -		 msmfb->xres * 2, w, h, x, y, &msmfb->dma_callback,
> -		 panel->interface_type);
> -	return 0;
> -error:
> -	spin_unlock_irqrestore(&msmfb->update_lock, irq_flags);
> -	/* some clients need to clear their vsync interrupt */
> -	if (panel->clear_vsync)
> -		panel->clear_vsync(panel);
> -	wake_up(&msmfb->frame_wq);
> -	return 0;
> -}
> -
> -/* Called from esync interrupt handler, must not sleep */
> -static void msmfb_handle_vsync_interrupt(struct msmfb_callback *callback)
> -{
> -	struct msmfb_info *msmfb = container_of(callback, struct msmfb_info,
> -					       vsync_callback);
> -	msmfb_start_dma(msmfb);
> -}
> -
> -static enum hrtimer_restart msmfb_fake_vsync(struct hrtimer *timer)
> -{
> -	struct msmfb_info *msmfb  = container_of(timer, struct msmfb_info,
> -					       fake_vsync);
> -	msmfb_start_dma(msmfb);
> -	return HRTIMER_NORESTART;
> -}
> -
> -static void msmfb_pan_update(struct fb_info *info, uint32_t left, uint32_t top,
> -			     uint32_t eright, uint32_t ebottom,
> -			     uint32_t yoffset, int pan_display)
> -{
> -	struct msmfb_info *msmfb = info->par;
> -	struct msm_panel_data *panel = msmfb->panel;
> -	unsigned long irq_flags;
> -	int sleeping;
> -	int retry = 1;
> -
> -	DLOG(SHOW_UPDATES, "update %d %d %d %d %d %d\n",
> -		left, top, eright, ebottom, yoffset, pan_display);
> -restart:
> -	spin_lock_irqsave(&msmfb->update_lock, irq_flags);
> -
> -	/* if we are sleeping, on a pan_display wait 10ms (to throttle back
> -	 * drawing otherwise return */
> -	if (msmfb->sleeping == SLEEPING) {
> -		DLOG(SUSPEND_RESUME, "drawing while asleep\n");
> -		spin_unlock_irqrestore(&msmfb->update_lock, irq_flags);
> -		if (pan_display)
> -			wait_event_interruptible_timeout(msmfb->frame_wq,
> -				msmfb->sleeping != SLEEPING, HZ/10);
> -		return;
> -	}
> -
> -	sleeping = msmfb->sleeping;
> -	/* on a full update, if the last frame has not completed, wait for it */
> -	if ((pan_display && msmfb->frame_requested != msmfb->frame_done) ||
> -			    sleeping == UPDATING) {
> -		int ret;
> -		spin_unlock_irqrestore(&msmfb->update_lock, irq_flags);
> -		ret = wait_event_interruptible_timeout(msmfb->frame_wq,
> -			msmfb->frame_done == msmfb->frame_requested &&
> -			msmfb->sleeping != UPDATING, 5 * HZ);
> -		if (ret <= 0 && (msmfb->frame_requested != msmfb->frame_done ||
> -				 msmfb->sleeping == UPDATING)) {
> -			if (retry && panel->request_vsync &&
> -			    (sleeping == AWAKE)) {
> -				panel->request_vsync(panel,
> -					&msmfb->vsync_callback);
> -				retry = 0;
> -				printk(KERN_WARNING "msmfb_pan_display timeout "
> -					"rerequest vsync\n");
> -			} else {
> -				printk(KERN_WARNING "msmfb_pan_display timeout "
> -					"waiting for frame start, %d %d\n",
> -					msmfb->frame_requested,
> -					msmfb->frame_done);
> -				return;
> -			}
> -		}
> -		goto restart;
> -	}
> -
> -
> -	msmfb->frame_requested++;
> -	/* if necessary, update the y offset, if this is the
> -	 * first full update on resume, set the sleeping state */
> -	if (pan_display) {
> -		msmfb->yoffset = yoffset;
> -		if (left == 0 && top == 0 && eright == info->var.xres &&
> -		    ebottom == info->var.yres) {
> -			if (sleeping == WAKING) {
> -				msmfb->update_frame = msmfb->frame_requested;
> -				DLOG(SUSPEND_RESUME, "full update starting\n");
> -				msmfb->sleeping = UPDATING;
> -			}
> -		}
> -	}
> -
> -	/* set the update request */
> -	if (left < msmfb->update_info.left)
> -		msmfb->update_info.left = left;
> -	if (top < msmfb->update_info.top)
> -		msmfb->update_info.top = top;
> -	if (eright > msmfb->update_info.eright)
> -		msmfb->update_info.eright = eright;
> -	if (ebottom > msmfb->update_info.ebottom)
> -		msmfb->update_info.ebottom = ebottom;
> -	DLOG(SHOW_UPDATES, "update queued %d %d %d %d %d\n",
> -		msmfb->update_info.left, msmfb->update_info.top,
> -		msmfb->update_info.eright, msmfb->update_info.ebottom,
> -		msmfb->yoffset);
> -	spin_unlock_irqrestore(&msmfb->update_lock, irq_flags);
> -
> -	/* if the panel is all the way on wait for vsync, otherwise sleep
> -	 * for 16 ms (long enough for the dma to panel) and then begin dma */
> -	msmfb->vsync_request_time = ktime_get();
> -	if (panel->request_vsync && (sleeping == AWAKE)) {
> -		panel->request_vsync(panel, &msmfb->vsync_callback);
> -	} else {
> -		if (!hrtimer_active(&msmfb->fake_vsync)) {
> -			hrtimer_start(&msmfb->fake_vsync,
> -				      ktime_set(0, NSEC_PER_SEC/60),
> -				      HRTIMER_MODE_REL);
> -		}
> -	}
> -}
> -
> -static void msmfb_update(struct fb_info *info, uint32_t left, uint32_t top,
> -			 uint32_t eright, uint32_t ebottom)
> -{
> -	msmfb_pan_update(info, left, top, eright, ebottom, 0, 0);
> -}
> -
> -static void power_on_panel(struct work_struct *work)
> -{
> -	struct msmfb_info *msmfb =
> -		container_of(work, struct msmfb_info, resume_work);
> -	struct msm_panel_data *panel = msmfb->panel;
> -	unsigned long irq_flags;
> -
> -	mutex_lock(&msmfb->panel_init_lock);
> -	DLOG(SUSPEND_RESUME, "turning on panel\n");
> -	if (msmfb->sleeping == UPDATING) {
> -		if (panel->unblank(panel)) {
> -			printk(KERN_INFO "msmfb: panel unblank failed,"
> -			       "not starting drawing\n");
> -			goto error;
> -		}
> -		spin_lock_irqsave(&msmfb->update_lock, irq_flags);
> -		msmfb->sleeping = AWAKE;
> -		wake_up(&msmfb->frame_wq);
> -		spin_unlock_irqrestore(&msmfb->update_lock, irq_flags);
> -	}
> -error:
> -	mutex_unlock(&msmfb->panel_init_lock);
> -}
> -
> -
> -static int msmfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
> -{
> -	if ((var->xres != info->var.xres) ||
> -	    (var->yres != info->var.yres) ||
> -	    (var->xres_virtual != info->var.xres_virtual) ||
> -	    (var->yres_virtual != info->var.yres_virtual) ||
> -	    (var->xoffset != info->var.xoffset) ||
> -	    (var->bits_per_pixel != info->var.bits_per_pixel) ||
> -	    (var->grayscale != info->var.grayscale))
> -		 return -EINVAL;
> -	return 0;
> -}
> -
> -int msmfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
> -{
> -	struct msmfb_info *msmfb = info->par;
> -	struct msm_panel_data *panel = msmfb->panel;
> -
> -	/* "UPDT" */
> -	if ((panel->caps & MSMFB_CAP_PARTIAL_UPDATES) &&
> -	    (var->reserved[0] == 0x54445055)) {
> -		msmfb_pan_update(info, var->reserved[1] & 0xffff,
> -				 var->reserved[1] >> 16,
> -				 var->reserved[2] & 0xffff,
> -				 var->reserved[2] >> 16, var->yoffset, 1);
> -	} else {
> -		msmfb_pan_update(info, 0, 0, info->var.xres, info->var.yres,
> -				 var->yoffset, 1);
> -	}
> -	return 0;
> -}
> -
> -static void msmfb_fillrect(struct fb_info *p, const struct fb_fillrect *rect)
> -{
> -	cfb_fillrect(p, rect);
> -	msmfb_update(p, rect->dx, rect->dy, rect->dx + rect->width,
> -		     rect->dy + rect->height);
> -}
> -
> -static void msmfb_copyarea(struct fb_info *p, const struct fb_copyarea *area)
> -{
> -	cfb_copyarea(p, area);
> -	msmfb_update(p, area->dx, area->dy, area->dx + area->width,
> -		     area->dy + area->height);
> -}
> -
> -static void msmfb_imageblit(struct fb_info *p, const struct fb_image *image)
> -{
> -	cfb_imageblit(p, image);
> -	msmfb_update(p, image->dx, image->dy, image->dx + image->width,
> -		     image->dy + image->height);
> -}
> -
> -
> -static int msmfb_blit(struct fb_info *info,
> -		      void __user *p)
> -{
> -	struct mdp_blit_req req;
> -	struct mdp_blit_req_list req_list;
> -	int i;
> -	int ret;
> -
> -	if (copy_from_user(&req_list, p, sizeof(req_list)))
> -		return -EFAULT;
> -
> -	for (i = 0; i < req_list.count; i++) {
> -		struct mdp_blit_req_list *list =
> -			(struct mdp_blit_req_list *)p;
> -		if (copy_from_user(&req, &list->req[i], sizeof(req)))
> -			return -EFAULT;
> -		ret = mdp->blit(mdp, info, &req);
> -		if (ret)
> -			return ret;
> -	}
> -	return 0;
> -}
> -
> -
> -DEFINE_MUTEX(mdp_ppp_lock);
> -
> -static int msmfb_ioctl(struct fb_info *p, unsigned int cmd, unsigned long arg)
> -{
> -	void __user *argp = (void __user *)arg;
> -	int ret;
> -
> -	switch (cmd) {
> -	case MSMFB_GRP_DISP:
> -		mdp->set_grp_disp(mdp, arg);
> -		break;
> -	case MSMFB_BLIT:
> -		ret = msmfb_blit(p, argp);
> -		if (ret)
> -			return ret;
> -		break;
> -	default:
> -			printk(KERN_INFO "msmfb unknown ioctl: %d\n", cmd);
> -			return -EINVAL;
> -	}
> -	return 0;
> -}
> -
> -static struct fb_ops msmfb_ops = {
> -	.owner = THIS_MODULE,
> -	.fb_open = msmfb_open,
> -	.fb_release = msmfb_release,
> -	.fb_check_var = msmfb_check_var,
> -	.fb_pan_display = msmfb_pan_display,
> -	.fb_fillrect = msmfb_fillrect,
> -	.fb_copyarea = msmfb_copyarea,
> -	.fb_imageblit = msmfb_imageblit,
> -	.fb_ioctl = msmfb_ioctl,
> -};
> -
> -static unsigned PP[16];
> -
> -
> -
> -#define BITS_PER_PIXEL 16
> -
> -static void setup_fb_info(struct msmfb_info *msmfb)
> -{
> -	struct fb_info *fb_info = msmfb->fb;
> -	int r;
> -
> -	/* finish setting up the fb_info struct */
> -	strncpy(fb_info->fix.id, "msmfb", 16);
> -	fb_info->fix.ypanstep = 1;
> -
> -	fb_info->fbops = &msmfb_ops;
> -	fb_info->flags = FBINFO_DEFAULT;
> -
> -	fb_info->fix.type = FB_TYPE_PACKED_PIXELS;
> -	fb_info->fix.visual = FB_VISUAL_TRUECOLOR;
> -	fb_info->fix.line_length = msmfb->xres * 2;
> -
> -	fb_info->var.xres = msmfb->xres;
> -	fb_info->var.yres = msmfb->yres;
> -	fb_info->var.width = msmfb->panel->fb_data->width;
> -	fb_info->var.height = msmfb->panel->fb_data->height;
> -	fb_info->var.xres_virtual = msmfb->xres;
> -	fb_info->var.yres_virtual = msmfb->yres * 2;
> -	fb_info->var.bits_per_pixel = BITS_PER_PIXEL;
> -	fb_info->var.accel_flags = 0;
> -
> -	fb_info->var.yoffset = 0;
> -
> -	if (msmfb->panel->caps & MSMFB_CAP_PARTIAL_UPDATES) {
> -		/*
> -		 * Set the param in the fixed screen, so userspace can't
> -		 * change it. This will be used to check for the
> -		 * capability.
> -		 */
> -		fb_info->fix.reserved[0] = 0x5444;
> -		fb_info->fix.reserved[1] = 0x5055;
> -
> -		/*
> -		 * This preloads the value so that if userspace doesn't
> -		 * change it, it will be a full update
> -		 */
> -		fb_info->var.reserved[0] = 0x54445055;
> -		fb_info->var.reserved[1] = 0;
> -		fb_info->var.reserved[2] = (uint16_t)msmfb->xres |
> -					   ((uint32_t)msmfb->yres << 16);
> -	}
> -
> -	fb_info->var.red.offset = 11;
> -	fb_info->var.red.length = 5;
> -	fb_info->var.red.msb_right = 0;
> -	fb_info->var.green.offset = 5;
> -	fb_info->var.green.length = 6;
> -	fb_info->var.green.msb_right = 0;
> -	fb_info->var.blue.offset = 0;
> -	fb_info->var.blue.length = 5;
> -	fb_info->var.blue.msb_right = 0;
> -
> -	r = fb_alloc_cmap(&fb_info->cmap, 16, 0);
> -	fb_info->pseudo_palette = PP;
> -
> -	PP[0] = 0;
> -	for (r = 1; r < 16; r++)
> -		PP[r] = 0xffffffff;
> -}
> -
> -static int setup_fbmem(struct msmfb_info *msmfb, struct platform_device *pdev)
> -{
> -	struct fb_info *fb = msmfb->fb;
> -	struct resource *resource;
> -	unsigned long size = msmfb->xres * msmfb->yres *
> -			     (BITS_PER_PIXEL >> 3) * 2;
> -	unsigned char *fbram;
> -
> -	/* board file might have attached a resource describing an fb */
> -	resource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (!resource)
> -		return -EINVAL;
> -
> -	/* check the resource is large enough to fit the fb */
> -	if (resource->end - resource->start < size) {
> -		printk(KERN_ERR "allocated resource is too small for "
> -				"fb\n");
> -		return -ENOMEM;
> -	}
> -	fb->fix.smem_start = resource->start;
> -	fb->fix.smem_len = resource_size(resource);
> -	fbram = ioremap(resource->start, resource_size(resource));
> -	if (fbram == NULL) {
> -		printk(KERN_ERR "msmfb: cannot allocate fbram!\n");
> -		return -ENOMEM;
> -	}
> -	fb->screen_base = fbram;
> -	return 0;
> -}
> -
> -static int msmfb_probe(struct platform_device *pdev)
> -{
> -	struct fb_info *fb;
> -	struct msmfb_info *msmfb;
> -	struct msm_panel_data *panel = pdev->dev.platform_data;
> -	int ret;
> -
> -	if (!panel) {
> -		pr_err("msmfb_probe: no platform data\n");
> -		return -EINVAL;
> -	}
> -	if (!panel->fb_data) {
> -		pr_err("msmfb_probe: no fb_data\n");
> -		return -EINVAL;
> -	}
> -
> -	fb = framebuffer_alloc(sizeof(struct msmfb_info), &pdev->dev);
> -	if (!fb)
> -		return -ENOMEM;
> -	msmfb = fb->par;
> -	msmfb->fb = fb;
> -	msmfb->panel = panel;
> -	msmfb->xres = panel->fb_data->xres;
> -	msmfb->yres = panel->fb_data->yres;
> -
> -	ret = setup_fbmem(msmfb, pdev);
> -	if (ret)
> -		goto error_setup_fbmem;
> -
> -	setup_fb_info(msmfb);
> -
> -	spin_lock_init(&msmfb->update_lock);
> -	mutex_init(&msmfb->panel_init_lock);
> -	init_waitqueue_head(&msmfb->frame_wq);
> -	INIT_WORK(&msmfb->resume_work, power_on_panel);
> -	msmfb->black = devm_kzalloc(&pdev->dev,
> -				    msmfb->fb->var.bits_per_pixel*msmfb->xres,
> -				    GFP_KERNEL);
> -	if (!msmfb->black) {
> -		ret = -ENOMEM;
> -		goto error_register_framebuffer;
> -	}
> -
> -	printk(KERN_INFO "msmfb_probe() installing %d x %d panel\n",
> -	       msmfb->xres, msmfb->yres);
> -
> -	msmfb->dma_callback.func = msmfb_handle_dma_interrupt;
> -	msmfb->vsync_callback.func = msmfb_handle_vsync_interrupt;
> -	hrtimer_init(&msmfb->fake_vsync, CLOCK_MONOTONIC,
> -		     HRTIMER_MODE_REL);
> -
> -
> -	msmfb->fake_vsync.function = msmfb_fake_vsync;
> -
> -	ret = register_framebuffer(fb);
> -	if (ret)
> -		goto error_register_framebuffer;
> -
> -	msmfb->sleeping = WAKING;
> -
> -	platform_set_drvdata(pdev, msmfb);
> -
> -	return 0;
> -
> -error_register_framebuffer:
> -	iounmap(fb->screen_base);
> -error_setup_fbmem:
> -	framebuffer_release(msmfb->fb);
> -	return ret;
> -}
> -
> -static int msmfb_remove(struct platform_device *pdev)
> -{
> -	struct msmfb_info *msmfb;
> -
> -	msmfb = platform_get_drvdata(pdev);
> -
> -	unregister_framebuffer(msmfb->fb);
> -	iounmap(msmfb->fb->screen_base);
> -	framebuffer_release(msmfb->fb);
> -
> -	return 0;
> -}
> -
> -static struct platform_driver msm_panel_driver = {
> -	/* need to write remove */
> -	.probe = msmfb_probe,
> -	.remove = msmfb_remove,
> -	.driver = {.name = "msm_panel"},
> -};
> -
> -
> -static int msmfb_add_mdp_device(struct device *dev,
> -				struct class_interface *class_intf)
> -{
> -	/* might need locking if mulitple mdp devices */
> -	if (mdp)
> -		return 0;
> -	mdp = container_of(dev, struct mdp_device, dev);
> -	return platform_driver_register(&msm_panel_driver);
> -}
> -
> -static void msmfb_remove_mdp_device(struct device *dev,
> -				struct class_interface *class_intf)
> -{
> -	/* might need locking if mulitple mdp devices */
> -	if (dev != &mdp->dev)
> -		return;
> -	platform_driver_unregister(&msm_panel_driver);
> -	mdp = NULL;
> -}
> -
> -static struct class_interface msm_fb_interface = {
> -	.add_dev = &msmfb_add_mdp_device,
> -	.remove_dev = &msmfb_remove_mdp_device,
> -};
> -
> -static int __init msmfb_init(void)
> -{
> -	return register_mdp_client(&msm_fb_interface);
> -}
> -
> -module_init(msmfb_init);
> diff --git a/include/linux/platform_data/video-msm_fb.h b/include/linux/platform_data/video-msm_fb.h
> deleted file mode 100644
> index 31449be3eadb..000000000000
> --- a/include/linux/platform_data/video-msm_fb.h
> +++ /dev/null
> @@ -1,146 +0,0 @@
> -/*
> - * Internal shared definitions for various MSM framebuffer parts.
> - *
> - * Copyright (C) 2007 Google Incorporated
> - *
> - * 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.
> - */
> -
> -#ifndef _MSM_FB_H_
> -#define _MSM_FB_H_
> -
> -#include <linux/device.h>
> -
> -struct mddi_info;
> -
> -struct msm_fb_data {
> -	int xres;	/* x resolution in pixels */
> -	int yres;	/* y resolution in pixels */
> -	int width;	/* disply width in mm */
> -	int height;	/* display height in mm */
> -	unsigned output_format;
> -};
> -
> -struct msmfb_callback {
> -	void (*func)(struct msmfb_callback *);
> -};
> -
> -enum {
> -	MSM_MDDI_PMDH_INTERFACE,
> -	MSM_MDDI_EMDH_INTERFACE,
> -	MSM_EBI2_INTERFACE,
> -};
> -
> -#define MSMFB_CAP_PARTIAL_UPDATES	(1 << 0)
> -
> -struct msm_panel_data {
> -	/* turns off the fb memory */
> -	int (*suspend)(struct msm_panel_data *);
> -	/* turns on the fb memory */
> -	int (*resume)(struct msm_panel_data *);
> -	/* turns off the panel */
> -	int (*blank)(struct msm_panel_data *);
> -	/* turns on the panel */
> -	int (*unblank)(struct msm_panel_data *);
> -	void (*wait_vsync)(struct msm_panel_data *);
> -	void (*request_vsync)(struct msm_panel_data *, struct msmfb_callback *);
> -	void (*clear_vsync)(struct msm_panel_data *);
> -	/* from the enum above */
> -	unsigned interface_type;
> -	/* data to be passed to the fb driver */
> -	struct msm_fb_data *fb_data;
> -
> -	/* capabilities supported by the panel */
> -	uint32_t caps;
> -};
> -
> -struct msm_mddi_client_data {
> -	void (*suspend)(struct msm_mddi_client_data *);
> -	void (*resume)(struct msm_mddi_client_data *);
> -	void (*activate_link)(struct msm_mddi_client_data *);
> -	void (*remote_write)(struct msm_mddi_client_data *, uint32_t val,
> -			     uint32_t reg);
> -	uint32_t (*remote_read)(struct msm_mddi_client_data *, uint32_t reg);
> -	void (*auto_hibernate)(struct msm_mddi_client_data *, int);
> -	/* custom data that needs to be passed from the board file to a 
> -	 * particular client */
> -	void *private_client_data;
> -	struct resource *fb_resource;
> -	/* from the list above */
> -	unsigned interface_type;
> -};
> -
> -struct msm_mddi_platform_data {
> -	unsigned int clk_rate;
> -	void (*power_client)(struct msm_mddi_client_data *, int on);
> -
> -	/* fixup the mfr name, product id */
> -	void (*fixup)(uint16_t *mfr_name, uint16_t *product_id);
> -
> -	struct resource *fb_resource; /*optional*/
> -	/* number of clients in the list that follows */
> -	int num_clients;
> -	/* array of client information of clients */
> -	struct {
> -		unsigned product_id; /* mfr id in top 16 bits, product id
> -				      * in lower 16 bits
> -				      */
> -		char *name;	/* the device name will be the platform
> -				 * device name registered for the client,
> -				 * it should match the name of the associated
> -				 * driver
> -				 */
> -		unsigned id;	/* id for mddi client device node, will also
> -				 * be used as device id of panel devices, if
> -				 * the client device will have multiple panels
> -				 * space must be left here for them
> -				 */
> -		void *client_data;	/* required private client data */
> -		unsigned int clk_rate;	/* optional: if the client requires a
> -					* different mddi clk rate
> -					*/
> -	} client_platform_data[];
> -};
> -
> -struct mdp_blit_req;
> -struct fb_info;
> -struct mdp_device {
> -	struct device dev;
> -	void (*dma)(struct mdp_device *mpd, uint32_t addr,
> -		    uint32_t stride, uint32_t w, uint32_t h, uint32_t x,
> -		    uint32_t y, struct msmfb_callback *callback, int interface);
> -	void (*dma_wait)(struct mdp_device *mdp);
> -	int (*blit)(struct mdp_device *mdp, struct fb_info *fb,
> -		    struct mdp_blit_req *req);
> -	void (*set_grp_disp)(struct mdp_device *mdp, uint32_t disp_id);
> -};
> -
> -struct class_interface;
> -int register_mdp_client(struct class_interface *class_intf);
> -
> -/**** private client data structs go below this line ***/
> -
> -struct msm_mddi_bridge_platform_data {
> -	/* from board file */
> -	int (*init)(struct msm_mddi_bridge_platform_data *,
> -		    struct msm_mddi_client_data *);
> -	int (*uninit)(struct msm_mddi_bridge_platform_data *,
> -		      struct msm_mddi_client_data *);
> -	/* passed to panel for use by the fb driver */
> -	int (*blank)(struct msm_mddi_bridge_platform_data *,
> -		     struct msm_mddi_client_data *);
> -	int (*unblank)(struct msm_mddi_bridge_platform_data *,
> -		       struct msm_mddi_client_data *);
> -	struct msm_fb_data fb_data;
> -};
> -
> -
> -
> -#endif
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 01/12] ARM: Remove mach-msm and associated ARM architecture code
  2015-03-13 18:09 ` [PATCH 01/12] ARM: Remove mach-msm and associated ARM architecture code Stephen Boyd
@ 2015-03-13 19:36   ` Paul Bolle
  2015-03-13 20:44     ` Stephen Boyd
  0 siblings, 1 reply; 32+ messages in thread
From: Paul Bolle @ 2015-03-13 19:36 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: linux-arm-msm, linux-arm-kernel, linux-kernel, David Brown,
	Bryan Huntsman, Daniel Walker, Arnd Bergmann

I've checked this series with my local Kconfig checker (for no other
reason than that it removes board-sapphire.c and I had promised to do so
too a week ago).

On Fri, 2015-03-13 at 11:09 -0700, Stephen Boyd wrote:
> --- a/arch/arm/mach-msm/Kconfig
> +++ /dev/null
> -config MSM_SMD
> -	bool

After this series MSM_SMD is still referenced in drivers/char/Kconfig
(sin the entry for MSM_SMD_PKT) and drivers/tty/serial/Kconfig (in the
entry for SERIAL_MSM_SMD).

So I think those two Kconfing entries, drivers/char/msm_smd_pkt.c,
drivers/tty/serial/msm_smd_tty.c, and the related lines in the two
Makefiles involved, can be removed too. (A quick glance at those tow
entries and those two files suggests there are no second order effects
from removing all that.)


Paul Bolle


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 05/12] net: smc91x: Remove dead code
  2015-03-13 18:09 ` [PATCH 05/12] net: smc91x: " Stephen Boyd
@ 2015-03-13 19:52   ` Arnd Bergmann
  0 siblings, 0 replies; 32+ messages in thread
From: Arnd Bergmann @ 2015-03-13 19:52 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: linux-arm-msm, linux-arm-kernel, linux-kernel, David Brown,
	Bryan Huntsman, Daniel Walker, David S. Miller

On Friday 13 March 2015 11:09:38 Stephen Boyd wrote:
> This config no longer exists now that mach-msm has been removed.
> Delete it and the associated code.
> 
> Cc: David S. Miller <davem@davemloft.net>
> Cc: David Brown <davidb@codeaurora.org>
> Cc: Bryan Huntsman <bryanh@codeaurora.org>
> Cc: Daniel Walker <dwalker@fifo99.com>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> ---
> 
> This can be acked and go through arm-soc or applied directly.
> 
>  drivers/net/ethernet/smsc/smc91x.h | 14 --------------
>  1 file changed, 14 deletions(-)
> 

David Miller already merged a patch that removes this and the other
platform specific parts of that file that are no longer needed.

	Arnd

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 00/12] Remove mach-msm and associated code
  2015-03-13 18:09 [PATCH 00/12] Remove mach-msm and associated code Stephen Boyd
                   ` (11 preceding siblings ...)
  2015-03-13 18:09 ` [PATCH 12/12] msm: msm_fb: Remove dead code Stephen Boyd
@ 2015-03-13 19:55 ` Arnd Bergmann
  2015-03-13 19:56   ` Arnd Bergmann
  2015-03-13 20:45   ` Stephen Boyd
  12 siblings, 2 replies; 32+ messages in thread
From: Arnd Bergmann @ 2015-03-13 19:55 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: linux-arm-msm, linux-arm-kernel, linux-kernel, David Brown,
	Bryan Huntsman, Daniel Walker, Linus Walleij, Alexandre Courbot,
	Greg Kroah-Hartman, David S . Miller, Ulf Hansson, Chris Ball,
	Alan Stern, linux-usb

On Friday 13 March 2015 11:09:33 Stephen Boyd wrote:
> The maintainers for mach-msm no longer have any plans to support
> or test the platforms supported by this architecture[1]. Most likely
> there aren't any active users of this code anyway, so let's
> delete it and the associated drivers/code. We should probably merge
> this as one big series through arm-soc. Although some patches
> should be fine to take through maintainers, some things like
> mmc and usb have header file dependencies for platform_data.
> 
> [1] http://lkml.kernel.org/r/20150307031212.GA8434@fifo99.com
> 

As I wrote, I'd have a mild preference for doing the multiplatform
conversion first and then removing the support in the following merge
window, just in case someone wants that code back.

If everyone wants to see that code die rather sooner than later,
that's fine with me as well.

I think the MMC driver should also be removed when the platform
code is deleted, new code would use the mmci driver anyway.

	Arnd

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 00/12] Remove mach-msm and associated code
  2015-03-13 19:55 ` [PATCH 00/12] Remove mach-msm and associated code Arnd Bergmann
@ 2015-03-13 19:56   ` Arnd Bergmann
  2015-03-13 20:45   ` Stephen Boyd
  1 sibling, 0 replies; 32+ messages in thread
From: Arnd Bergmann @ 2015-03-13 19:56 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: linux-arm-msm, linux-arm-kernel, linux-kernel, David Brown,
	Bryan Huntsman, Daniel Walker, Linus Walleij, Alexandre Courbot,
	Greg Kroah-Hartman, David S . Miller, Ulf Hansson, Chris Ball,
	Alan Stern, linux-usb

On Friday 13 March 2015 20:55:30 Arnd Bergmann wrote:
> 
> I think the MMC driver should also be removed when the platform
> code is deleted, new code would use the mmci driver anyway.

Nevermind, I now see patch 6/12, which does just this.

	Arnd

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 01/12] ARM: Remove mach-msm and associated ARM architecture code
  2015-03-13 19:36   ` Paul Bolle
@ 2015-03-13 20:44     ` Stephen Boyd
  0 siblings, 0 replies; 32+ messages in thread
From: Stephen Boyd @ 2015-03-13 20:44 UTC (permalink / raw)
  To: Paul Bolle
  Cc: linux-arm-msm, linux-arm-kernel, linux-kernel, David Brown,
	Bryan Huntsman, Daniel Walker, Arnd Bergmann

On 03/13/15 12:36, Paul Bolle wrote:
> I've checked this series with my local Kconfig checker (for no other
> reason than that it removes board-sapphire.c and I had promised to do so
> too a week ago).
>
> On Fri, 2015-03-13 at 11:09 -0700, Stephen Boyd wrote:
>> --- a/arch/arm/mach-msm/Kconfig
>> +++ /dev/null
>> -config MSM_SMD
>> -	bool
> After this series MSM_SMD is still referenced in drivers/char/Kconfig
> (sin the entry for MSM_SMD_PKT) and drivers/tty/serial/Kconfig (in the
> entry for SERIAL_MSM_SMD).
>
> So I think those two Kconfing entries, drivers/char/msm_smd_pkt.c,
> drivers/tty/serial/msm_smd_tty.c, and the related lines in the two
> Makefiles involved, can be removed too. (A quick glance at those tow
> entries and those two files suggests there are no second order effects
> from removing all that.)
>

Oh yeah I missed those. We can delete them now and reintroduce them when
they're needed.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 00/12] Remove mach-msm and associated code
  2015-03-13 19:55 ` [PATCH 00/12] Remove mach-msm and associated code Arnd Bergmann
  2015-03-13 19:56   ` Arnd Bergmann
@ 2015-03-13 20:45   ` Stephen Boyd
  2015-03-17 16:18     ` dwalker
  1 sibling, 1 reply; 32+ messages in thread
From: Stephen Boyd @ 2015-03-13 20:45 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-arm-msm, linux-arm-kernel, linux-kernel, David Brown,
	Bryan Huntsman, Daniel Walker, Linus Walleij, Alexandre Courbot,
	Greg Kroah-Hartman, David S . Miller, Ulf Hansson, Chris Ball,
	Alan Stern, linux-usb

On 03/13/15 12:55, Arnd Bergmann wrote:
> On Friday 13 March 2015 11:09:33 Stephen Boyd wrote:
>> The maintainers for mach-msm no longer have any plans to support
>> or test the platforms supported by this architecture[1]. Most likely
>> there aren't any active users of this code anyway, so let's
>> delete it and the associated drivers/code. We should probably merge
>> this as one big series through arm-soc. Although some patches
>> should be fine to take through maintainers, some things like
>> mmc and usb have header file dependencies for platform_data.
>>
>> [1] http://lkml.kernel.org/r/20150307031212.GA8434@fifo99.com
>>
> As I wrote, I'd have a mild preference for doing the multiplatform
> conversion first and then removing the support in the following merge
> window, just in case someone wants that code back.
>
> If everyone wants to see that code die rather sooner than later,
> that's fine with me as well.

I think everyone wants to see the code die now. They can always pull the
multi-platform patches from the list. I'll stash away my 7200 DT
conversion in case someone cares but I really doubt anybody does.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 07/12] clocksource: qcom: Remove dead code
  2015-03-13 18:22     ` Stephen Boyd
@ 2015-03-13 21:11       ` Daniel Lezcano
  0 siblings, 0 replies; 32+ messages in thread
From: Daniel Lezcano @ 2015-03-13 21:11 UTC (permalink / raw)
  To: Stephen Boyd, linux-arm-msm
  Cc: linux-arm-kernel, linux-kernel, David Brown, Bryan Huntsman,
	Daniel Walker, Arnd Bergmann

On 03/13/2015 07:22 PM, Stephen Boyd wrote:
> On 03/13/15 11:14, Daniel Lezcano wrote:
>> On 03/13/2015 07:09 PM, Stephen Boyd wrote:
>>> This code is no longer used now that mach-msm has been removed.
>>> Delete it.
>>>
>>> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
>>> Cc: David Brown <davidb@codeaurora.org>
>>> Cc: Bryan Huntsman <bryanh@codeaurora.org>
>>> Cc: Daniel Walker <dwalker@fifo99.com>
>>> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
>>> ---
>>>
>>> This can be acked and go through arm-soc or applied directly to
>>> clocksource
>>> tree.
>>>
>>>    drivers/clocksource/qcom-timer.c | 59
>>> ----------------------------------------
>>>    1 file changed, 59 deletions(-)
>>
>> Applied to my tree for 4.1.
>>
>
>
> Ah sorry, this one has to go with patch 1 through arm-soc, because it
> deletes symbols that patch 1 is using.

Ok. Removed from my tree.

   -- Daniel


-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 06/12] mmc: Remove msm_sdcc driver
  2015-03-13 18:09 ` [PATCH 06/12] mmc: Remove msm_sdcc driver Stephen Boyd
@ 2015-03-16 11:04   ` Ulf Hansson
  0 siblings, 0 replies; 32+ messages in thread
From: Ulf Hansson @ 2015-03-16 11:04 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: linux-arm-msm, linux-arm-kernel, linux-kernel, David Brown,
	Bryan Huntsman, Daniel Walker, Arnd Bergmann, Chris Ball

On 13 March 2015 at 19:09, Stephen Boyd <sboyd@codeaurora.org> wrote:
> This driver is orphaned now that mach-msm has been removed.
> Delete it.
>
> Cc: Ulf Hansson <ulf.hansson@linaro.org>
> Cc: Chris Ball <chris@printf.net>
> Cc: David Brown <davidb@codeaurora.org>
> Cc: Bryan Huntsman <bryanh@codeaurora.org>
> Cc: Daniel Walker <dwalker@fifo99.com>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

> ---
>
> I'd appreciate an ack here from mmc maintainers so this can go with patch 1
> through arm-soc.
>
>  drivers/mmc/host/Kconfig                   |    8 -
>  drivers/mmc/host/Makefile                  |    1 -
>  drivers/mmc/host/msm_sdcc.c                | 1474 ----------------------------
>  drivers/mmc/host/msm_sdcc.h                |  256 -----
>  include/linux/platform_data/mmc-msm_sdcc.h |   27 -
>  5 files changed, 1766 deletions(-)
>  delete mode 100644 drivers/mmc/host/msm_sdcc.c
>  delete mode 100644 drivers/mmc/host/msm_sdcc.h
>  delete mode 100644 include/linux/platform_data/mmc-msm_sdcc.h
>
> diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
> index 61ac63a3776a..37d1d80fdf04 100644
> --- a/drivers/mmc/host/Kconfig
> +++ b/drivers/mmc/host/Kconfig
> @@ -393,14 +393,6 @@ config MMC_SDHCI_MSM
>
>           If unsure, say N.
>
> -config MMC_MSM
> -       tristate "Qualcomm SDCC Controller Support"
> -       depends on MMC && (ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50)
> -       help
> -         This provides support for the SD/MMC cell found in the
> -         MSM and QSD SOCs from Qualcomm. The controller also has
> -         support for SDIO devices.
> -
>  config MMC_MXC
>         tristate "Freescale i.MX21/27/31 or MPC512x Multimedia Card support"
>         depends on ARCH_MXC || PPC_MPC512x
> diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile
> index 6a7cfe0de332..47f9421d0281 100644
> --- a/drivers/mmc/host/Makefile
> +++ b/drivers/mmc/host/Makefile
> @@ -24,7 +24,6 @@ obj-$(CONFIG_MMC_OMAP)                += omap.o
>  obj-$(CONFIG_MMC_OMAP_HS)      += omap_hsmmc.o
>  obj-$(CONFIG_MMC_ATMELMCI)     += atmel-mci.o
>  obj-$(CONFIG_MMC_TIFM_SD)      += tifm_sd.o
> -obj-$(CONFIG_MMC_MSM)          += msm_sdcc.o
>  obj-$(CONFIG_MMC_MVSDIO)       += mvsdio.o
>  obj-$(CONFIG_MMC_DAVINCI)       += davinci_mmc.o
>  obj-$(CONFIG_MMC_GOLDFISH)     += android-goldfish.o
> diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
> deleted file mode 100644
> index 90c60fd4ff6e..000000000000
> --- a/drivers/mmc/host/msm_sdcc.c
> +++ /dev/null
> @@ -1,1474 +0,0 @@
> -/*
> - *  linux/drivers/mmc/host/msm_sdcc.c - Qualcomm MSM 7X00A SDCC Driver
> - *
> - *  Copyright (C) 2007 Google Inc,
> - *  Copyright (C) 2003 Deep Blue Solutions, Ltd, All Rights Reserved.
> - *  Copyright (C) 2009, Code Aurora Forum. All Rights Reserved.
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License version 2 as
> - * published by the Free Software Foundation.
> - *
> - * Based on mmci.c
> - *
> - * Author: San Mehat (san@android.com)
> - *
> - */
> -
> -#include <linux/module.h>
> -#include <linux/moduleparam.h>
> -#include <linux/init.h>
> -#include <linux/ioport.h>
> -#include <linux/device.h>
> -#include <linux/interrupt.h>
> -#include <linux/delay.h>
> -#include <linux/err.h>
> -#include <linux/highmem.h>
> -#include <linux/log2.h>
> -#include <linux/mmc/host.h>
> -#include <linux/mmc/card.h>
> -#include <linux/mmc/sdio.h>
> -#include <linux/clk.h>
> -#include <linux/scatterlist.h>
> -#include <linux/platform_device.h>
> -#include <linux/dma-mapping.h>
> -#include <linux/debugfs.h>
> -#include <linux/io.h>
> -#include <linux/memory.h>
> -#include <linux/gfp.h>
> -#include <linux/gpio.h>
> -
> -#include <asm/cacheflush.h>
> -#include <asm/div64.h>
> -#include <asm/sizes.h>
> -
> -#include <linux/platform_data/mmc-msm_sdcc.h>
> -#include <mach/dma.h>
> -#include <mach/clk.h>
> -
> -#include "msm_sdcc.h"
> -
> -#define DRIVER_NAME "msm-sdcc"
> -
> -#define BUSCLK_PWRSAVE 1
> -#define BUSCLK_TIMEOUT (HZ)
> -static unsigned int msmsdcc_fmin = 144000;
> -static unsigned int msmsdcc_fmax = 50000000;
> -static unsigned int msmsdcc_4bit = 1;
> -static unsigned int msmsdcc_pwrsave = 1;
> -static unsigned int msmsdcc_piopoll = 1;
> -static unsigned int msmsdcc_sdioirq;
> -
> -#define PIO_SPINMAX 30
> -#define CMD_SPINMAX 20
> -
> -
> -static inline void
> -msmsdcc_disable_clocks(struct msmsdcc_host *host, int deferr)
> -{
> -       WARN_ON(!host->clks_on);
> -
> -       BUG_ON(host->curr.mrq);
> -
> -       if (deferr) {
> -               mod_timer(&host->busclk_timer, jiffies + BUSCLK_TIMEOUT);
> -       } else {
> -               del_timer_sync(&host->busclk_timer);
> -               /* Need to check clks_on again in case the busclk
> -                * timer fired
> -                */
> -               if (host->clks_on) {
> -                       clk_disable(host->clk);
> -                       clk_disable(host->pclk);
> -                       host->clks_on = 0;
> -               }
> -       }
> -}
> -
> -static inline int
> -msmsdcc_enable_clocks(struct msmsdcc_host *host)
> -{
> -       int rc;
> -
> -       del_timer_sync(&host->busclk_timer);
> -
> -       if (!host->clks_on) {
> -               rc = clk_enable(host->pclk);
> -               if (rc)
> -                       return rc;
> -               rc = clk_enable(host->clk);
> -               if (rc) {
> -                       clk_disable(host->pclk);
> -                       return rc;
> -               }
> -               udelay(1 + ((3 * USEC_PER_SEC) /
> -                      (host->clk_rate ? host->clk_rate : msmsdcc_fmin)));
> -               host->clks_on = 1;
> -       }
> -       return 0;
> -}
> -
> -static inline unsigned int
> -msmsdcc_readl(struct msmsdcc_host *host, unsigned int reg)
> -{
> -       return readl(host->base + reg);
> -}
> -
> -static inline void
> -msmsdcc_writel(struct msmsdcc_host *host, u32 data, unsigned int reg)
> -{
> -       writel(data, host->base + reg);
> -       /* 3 clk delay required! */
> -       udelay(1 + ((3 * USEC_PER_SEC) /
> -              (host->clk_rate ? host->clk_rate : msmsdcc_fmin)));
> -}
> -
> -static void
> -msmsdcc_start_command(struct msmsdcc_host *host, struct mmc_command *cmd,
> -                     u32 c);
> -
> -static void msmsdcc_reset_and_restore(struct msmsdcc_host *host)
> -{
> -       u32     mci_clk = 0;
> -       u32     mci_mask0 = 0;
> -       int     ret = 0;
> -
> -       /* Save the controller state */
> -       mci_clk = readl(host->base + MMCICLOCK);
> -       mci_mask0 = readl(host->base + MMCIMASK0);
> -
> -       /* Reset the controller */
> -       ret = clk_reset(host->clk, CLK_RESET_ASSERT);
> -       if (ret)
> -               pr_err("%s: Clock assert failed at %u Hz with err %d\n",
> -                               mmc_hostname(host->mmc), host->clk_rate, ret);
> -
> -       ret = clk_reset(host->clk, CLK_RESET_DEASSERT);
> -       if (ret)
> -               pr_err("%s: Clock deassert failed at %u Hz with err %d\n",
> -                               mmc_hostname(host->mmc), host->clk_rate, ret);
> -
> -       pr_info("%s: Controller has been re-initialiazed\n",
> -                       mmc_hostname(host->mmc));
> -
> -       /* Restore the contoller state */
> -       writel(host->pwr, host->base + MMCIPOWER);
> -       writel(mci_clk, host->base + MMCICLOCK);
> -       writel(mci_mask0, host->base + MMCIMASK0);
> -       ret = clk_set_rate(host->clk, host->clk_rate);
> -       if (ret)
> -               pr_err("%s: Failed to set clk rate %u Hz (%d)\n",
> -                               mmc_hostname(host->mmc), host->clk_rate, ret);
> -}
> -
> -static void
> -msmsdcc_request_end(struct msmsdcc_host *host, struct mmc_request *mrq)
> -{
> -       BUG_ON(host->curr.data);
> -
> -       host->curr.mrq = NULL;
> -       host->curr.cmd = NULL;
> -
> -       if (mrq->data)
> -               mrq->data->bytes_xfered = host->curr.data_xfered;
> -       if (mrq->cmd->error == -ETIMEDOUT)
> -               mdelay(5);
> -
> -#if BUSCLK_PWRSAVE
> -       msmsdcc_disable_clocks(host, 1);
> -#endif
> -       /*
> -        * Need to drop the host lock here; mmc_request_done may call
> -        * back into the driver...
> -        */
> -       spin_unlock(&host->lock);
> -       mmc_request_done(host->mmc, mrq);
> -       spin_lock(&host->lock);
> -}
> -
> -static void
> -msmsdcc_stop_data(struct msmsdcc_host *host)
> -{
> -       host->curr.data = NULL;
> -       host->curr.got_dataend = 0;
> -}
> -
> -uint32_t msmsdcc_fifo_addr(struct msmsdcc_host *host)
> -{
> -       return host->memres->start + MMCIFIFO;
> -}
> -
> -static inline void
> -msmsdcc_start_command_exec(struct msmsdcc_host *host, u32 arg, u32 c) {
> -       msmsdcc_writel(host, arg, MMCIARGUMENT);
> -       msmsdcc_writel(host, c, MMCICOMMAND);
> -}
> -
> -static void
> -msmsdcc_dma_exec_func(struct msm_dmov_cmd *cmd)
> -{
> -       struct msmsdcc_host *host = (struct msmsdcc_host *)cmd->data;
> -
> -       msmsdcc_writel(host, host->cmd_timeout, MMCIDATATIMER);
> -       msmsdcc_writel(host, (unsigned int)host->curr.xfer_size,
> -                      MMCIDATALENGTH);
> -       msmsdcc_writel(host, (msmsdcc_readl(host, MMCIMASK0) &
> -                       (~MCI_IRQ_PIO)) | host->cmd_pio_irqmask, MMCIMASK0);
> -       msmsdcc_writel(host, host->cmd_datactrl, MMCIDATACTRL);
> -
> -       if (host->cmd_cmd) {
> -               msmsdcc_start_command_exec(host,
> -                                          (u32) host->cmd_cmd->arg,
> -                                          (u32) host->cmd_c);
> -       }
> -       host->dma.active = 1;
> -}
> -
> -static void
> -msmsdcc_dma_complete_tlet(unsigned long data)
> -{
> -       struct msmsdcc_host *host = (struct msmsdcc_host *)data;
> -       unsigned long           flags;
> -       struct mmc_request      *mrq;
> -       struct msm_dmov_errdata err;
> -
> -       spin_lock_irqsave(&host->lock, flags);
> -       host->dma.active = 0;
> -
> -       err = host->dma.err;
> -       mrq = host->curr.mrq;
> -       BUG_ON(!mrq);
> -       WARN_ON(!mrq->data);
> -
> -       if (!(host->dma.result & DMOV_RSLT_VALID)) {
> -               pr_err("msmsdcc: Invalid DataMover result\n");
> -               goto out;
> -       }
> -
> -       if (host->dma.result & DMOV_RSLT_DONE) {
> -               host->curr.data_xfered = host->curr.xfer_size;
> -       } else {
> -               /* Error or flush  */
> -               if (host->dma.result & DMOV_RSLT_ERROR)
> -                       pr_err("%s: DMA error (0x%.8x)\n",
> -                              mmc_hostname(host->mmc), host->dma.result);
> -               if (host->dma.result & DMOV_RSLT_FLUSH)
> -                       pr_err("%s: DMA channel flushed (0x%.8x)\n",
> -                              mmc_hostname(host->mmc), host->dma.result);
> -
> -               pr_err("Flush data: %.8x %.8x %.8x %.8x %.8x %.8x\n",
> -                      err.flush[0], err.flush[1], err.flush[2],
> -                      err.flush[3], err.flush[4], err.flush[5]);
> -
> -               msmsdcc_reset_and_restore(host);
> -               if (!mrq->data->error)
> -                       mrq->data->error = -EIO;
> -       }
> -       dma_unmap_sg(mmc_dev(host->mmc), host->dma.sg, host->dma.num_ents,
> -                    host->dma.dir);
> -
> -       host->dma.sg = NULL;
> -       host->dma.busy = 0;
> -
> -       if (host->curr.got_dataend || mrq->data->error) {
> -
> -               /*
> -                * If we've already gotten our DATAEND / DATABLKEND
> -                * for this request, then complete it through here.
> -                */
> -               msmsdcc_stop_data(host);
> -
> -               if (!mrq->data->error)
> -                       host->curr.data_xfered = host->curr.xfer_size;
> -               if (!mrq->data->stop || mrq->cmd->error) {
> -                       host->curr.mrq = NULL;
> -                       host->curr.cmd = NULL;
> -                       mrq->data->bytes_xfered = host->curr.data_xfered;
> -
> -                       spin_unlock_irqrestore(&host->lock, flags);
> -#if BUSCLK_PWRSAVE
> -                       msmsdcc_disable_clocks(host, 1);
> -#endif
> -                       mmc_request_done(host->mmc, mrq);
> -                       return;
> -               } else
> -                       msmsdcc_start_command(host, mrq->data->stop, 0);
> -       }
> -
> -out:
> -       spin_unlock_irqrestore(&host->lock, flags);
> -       return;
> -}
> -
> -static void
> -msmsdcc_dma_complete_func(struct msm_dmov_cmd *cmd,
> -                         unsigned int result,
> -                         struct msm_dmov_errdata *err)
> -{
> -       struct msmsdcc_dma_data *dma_data =
> -               container_of(cmd, struct msmsdcc_dma_data, hdr);
> -       struct msmsdcc_host *host = dma_data->host;
> -
> -       dma_data->result = result;
> -       if (err)
> -               memcpy(&dma_data->err, err, sizeof(struct msm_dmov_errdata));
> -
> -       tasklet_schedule(&host->dma_tlet);
> -}
> -
> -static int validate_dma(struct msmsdcc_host *host, struct mmc_data *data)
> -{
> -       if (host->dma.channel == -1)
> -               return -ENOENT;
> -
> -       if ((data->blksz * data->blocks) < MCI_FIFOSIZE)
> -               return -EINVAL;
> -       if ((data->blksz * data->blocks) % MCI_FIFOSIZE)
> -               return -EINVAL;
> -       return 0;
> -}
> -
> -static int msmsdcc_config_dma(struct msmsdcc_host *host, struct mmc_data *data)
> -{
> -       struct msmsdcc_nc_dmadata *nc;
> -       dmov_box *box;
> -       uint32_t rows;
> -       uint32_t crci;
> -       unsigned int n;
> -       int i, rc;
> -       struct scatterlist *sg = data->sg;
> -
> -       rc = validate_dma(host, data);
> -       if (rc)
> -               return rc;
> -
> -       host->dma.sg = data->sg;
> -       host->dma.num_ents = data->sg_len;
> -
> -       BUG_ON(host->dma.num_ents > NR_SG); /* Prevent memory corruption */
> -
> -       nc = host->dma.nc;
> -
> -       switch (host->pdev_id) {
> -       case 1:
> -               crci = MSMSDCC_CRCI_SDC1;
> -               break;
> -       case 2:
> -               crci = MSMSDCC_CRCI_SDC2;
> -               break;
> -       case 3:
> -               crci = MSMSDCC_CRCI_SDC3;
> -               break;
> -       case 4:
> -               crci = MSMSDCC_CRCI_SDC4;
> -               break;
> -       default:
> -               host->dma.sg = NULL;
> -               host->dma.num_ents = 0;
> -               return -ENOENT;
> -       }
> -
> -       if (data->flags & MMC_DATA_READ)
> -               host->dma.dir = DMA_FROM_DEVICE;
> -       else
> -               host->dma.dir = DMA_TO_DEVICE;
> -
> -       host->curr.user_pages = 0;
> -
> -       box = &nc->cmd[0];
> -
> -       /* location of command block must be 64 bit aligned */
> -       BUG_ON(host->dma.cmd_busaddr & 0x07);
> -
> -       nc->cmdptr = (host->dma.cmd_busaddr >> 3) | CMD_PTR_LP;
> -       host->dma.hdr.cmdptr = DMOV_CMD_PTR_LIST |
> -                              DMOV_CMD_ADDR(host->dma.cmdptr_busaddr);
> -       host->dma.hdr.complete_func = msmsdcc_dma_complete_func;
> -
> -       n = dma_map_sg(mmc_dev(host->mmc), host->dma.sg,
> -                       host->dma.num_ents, host->dma.dir);
> -       if (n == 0) {
> -               pr_err("%s: Unable to map in all sg elements\n",
> -                       mmc_hostname(host->mmc));
> -               host->dma.sg = NULL;
> -               host->dma.num_ents = 0;
> -               return -ENOMEM;
> -       }
> -
> -       for_each_sg(host->dma.sg, sg, n, i) {
> -
> -               box->cmd = CMD_MODE_BOX;
> -
> -               if (i == n - 1)
> -                       box->cmd |= CMD_LC;
> -               rows = (sg_dma_len(sg) % MCI_FIFOSIZE) ?
> -                       (sg_dma_len(sg) / MCI_FIFOSIZE) + 1 :
> -                       (sg_dma_len(sg) / MCI_FIFOSIZE) ;
> -
> -               if (data->flags & MMC_DATA_READ) {
> -                       box->src_row_addr = msmsdcc_fifo_addr(host);
> -                       box->dst_row_addr = sg_dma_address(sg);
> -
> -                       box->src_dst_len = (MCI_FIFOSIZE << 16) |
> -                                          (MCI_FIFOSIZE);
> -                       box->row_offset = MCI_FIFOSIZE;
> -
> -                       box->num_rows = rows * ((1 << 16) + 1);
> -                       box->cmd |= CMD_SRC_CRCI(crci);
> -               } else {
> -                       box->src_row_addr = sg_dma_address(sg);
> -                       box->dst_row_addr = msmsdcc_fifo_addr(host);
> -
> -                       box->src_dst_len = (MCI_FIFOSIZE << 16) |
> -                                          (MCI_FIFOSIZE);
> -                       box->row_offset = (MCI_FIFOSIZE << 16);
> -
> -                       box->num_rows = rows * ((1 << 16) + 1);
> -                       box->cmd |= CMD_DST_CRCI(crci);
> -               }
> -               box++;
> -       }
> -
> -       return 0;
> -}
> -
> -static int
> -snoop_cccr_abort(struct mmc_command *cmd)
> -{
> -       if ((cmd->opcode == 52) &&
> -           (cmd->arg & 0x80000000) &&
> -           (((cmd->arg >> 9) & 0x1ffff) == SDIO_CCCR_ABORT))
> -               return 1;
> -       return 0;
> -}
> -
> -static void
> -msmsdcc_start_command_deferred(struct msmsdcc_host *host,
> -                               struct mmc_command *cmd, u32 *c)
> -{
> -       *c |= (cmd->opcode | MCI_CPSM_ENABLE);
> -
> -       if (cmd->flags & MMC_RSP_PRESENT) {
> -               if (cmd->flags & MMC_RSP_136)
> -                       *c |= MCI_CPSM_LONGRSP;
> -               *c |= MCI_CPSM_RESPONSE;
> -       }
> -
> -       if (/*interrupt*/0)
> -               *c |= MCI_CPSM_INTERRUPT;
> -
> -       if ((((cmd->opcode == 17) || (cmd->opcode == 18))  ||
> -            ((cmd->opcode == 24) || (cmd->opcode == 25))) ||
> -             (cmd->opcode == 53))
> -               *c |= MCI_CSPM_DATCMD;
> -
> -       if (host->prog_scan && (cmd->opcode == 12)) {
> -               *c |= MCI_CPSM_PROGENA;
> -               host->prog_enable = true;
> -       }
> -
> -       if (cmd == cmd->mrq->stop)
> -               *c |= MCI_CSPM_MCIABORT;
> -
> -       if (snoop_cccr_abort(cmd))
> -               *c |= MCI_CSPM_MCIABORT;
> -
> -       if (host->curr.cmd != NULL) {
> -               pr_err("%s: Overlapping command requests\n",
> -                       mmc_hostname(host->mmc));
> -       }
> -       host->curr.cmd = cmd;
> -}
> -
> -static void
> -msmsdcc_start_data(struct msmsdcc_host *host, struct mmc_data *data,
> -                       struct mmc_command *cmd, u32 c)
> -{
> -       unsigned int datactrl, timeout;
> -       unsigned long long clks;
> -       unsigned int pio_irqmask = 0;
> -
> -       host->curr.data = data;
> -       host->curr.xfer_size = data->blksz * data->blocks;
> -       host->curr.xfer_remain = host->curr.xfer_size;
> -       host->curr.data_xfered = 0;
> -       host->curr.got_dataend = 0;
> -
> -       memset(&host->pio, 0, sizeof(host->pio));
> -
> -       datactrl = MCI_DPSM_ENABLE | (data->blksz << 4);
> -
> -       if (!msmsdcc_config_dma(host, data))
> -               datactrl |= MCI_DPSM_DMAENABLE;
> -       else {
> -               host->pio.sg = data->sg;
> -               host->pio.sg_len = data->sg_len;
> -               host->pio.sg_off = 0;
> -
> -               if (data->flags & MMC_DATA_READ) {
> -                       pio_irqmask = MCI_RXFIFOHALFFULLMASK;
> -                       if (host->curr.xfer_remain < MCI_FIFOSIZE)
> -                               pio_irqmask |= MCI_RXDATAAVLBLMASK;
> -               } else
> -                       pio_irqmask = MCI_TXFIFOHALFEMPTYMASK;
> -       }
> -
> -       if (data->flags & MMC_DATA_READ)
> -               datactrl |= MCI_DPSM_DIRECTION;
> -
> -       clks = (unsigned long long)data->timeout_ns * host->clk_rate;
> -       do_div(clks, NSEC_PER_SEC);
> -       timeout = data->timeout_clks + (unsigned int)clks*2 ;
> -
> -       if (datactrl & MCI_DPSM_DMAENABLE) {
> -               /* Save parameters for the exec function */
> -               host->cmd_timeout = timeout;
> -               host->cmd_pio_irqmask = pio_irqmask;
> -               host->cmd_datactrl = datactrl;
> -               host->cmd_cmd = cmd;
> -
> -               host->dma.hdr.execute_func = msmsdcc_dma_exec_func;
> -               host->dma.hdr.data = (void *)host;
> -               host->dma.busy = 1;
> -
> -               if (cmd) {
> -                       msmsdcc_start_command_deferred(host, cmd, &c);
> -                       host->cmd_c = c;
> -               }
> -               msm_dmov_enqueue_cmd(host->dma.channel, &host->dma.hdr);
> -               if (data->flags & MMC_DATA_WRITE)
> -                       host->prog_scan = true;
> -       } else {
> -               msmsdcc_writel(host, timeout, MMCIDATATIMER);
> -
> -               msmsdcc_writel(host, host->curr.xfer_size, MMCIDATALENGTH);
> -
> -               msmsdcc_writel(host, (msmsdcc_readl(host, MMCIMASK0) &
> -                               (~MCI_IRQ_PIO)) | pio_irqmask, MMCIMASK0);
> -
> -               msmsdcc_writel(host, datactrl, MMCIDATACTRL);
> -
> -               if (cmd) {
> -                       /* Daisy-chain the command if requested */
> -                       msmsdcc_start_command(host, cmd, c);
> -               }
> -       }
> -}
> -
> -static void
> -msmsdcc_start_command(struct msmsdcc_host *host, struct mmc_command *cmd, u32 c)
> -{
> -       if (cmd == cmd->mrq->stop)
> -               c |= MCI_CSPM_MCIABORT;
> -
> -       host->stats.cmds++;
> -
> -       msmsdcc_start_command_deferred(host, cmd, &c);
> -       msmsdcc_start_command_exec(host, cmd->arg, c);
> -}
> -
> -static void
> -msmsdcc_data_err(struct msmsdcc_host *host, struct mmc_data *data,
> -                unsigned int status)
> -{
> -       if (status & MCI_DATACRCFAIL) {
> -               pr_err("%s: Data CRC error\n", mmc_hostname(host->mmc));
> -               pr_err("%s: opcode 0x%.8x\n", __func__,
> -                      data->mrq->cmd->opcode);
> -               pr_err("%s: blksz %d, blocks %d\n", __func__,
> -                      data->blksz, data->blocks);
> -               data->error = -EILSEQ;
> -       } else if (status & MCI_DATATIMEOUT) {
> -               pr_err("%s: Data timeout\n", mmc_hostname(host->mmc));
> -               data->error = -ETIMEDOUT;
> -       } else if (status & MCI_RXOVERRUN) {
> -               pr_err("%s: RX overrun\n", mmc_hostname(host->mmc));
> -               data->error = -EIO;
> -       } else if (status & MCI_TXUNDERRUN) {
> -               pr_err("%s: TX underrun\n", mmc_hostname(host->mmc));
> -               data->error = -EIO;
> -       } else {
> -               pr_err("%s: Unknown error (0x%.8x)\n",
> -                      mmc_hostname(host->mmc), status);
> -               data->error = -EIO;
> -       }
> -}
> -
> -
> -static int
> -msmsdcc_pio_read(struct msmsdcc_host *host, char *buffer, unsigned int remain)
> -{
> -       uint32_t        *ptr = (uint32_t *) buffer;
> -       int             count = 0;
> -
> -       if (remain % 4)
> -               remain = ((remain >> 2) + 1) << 2;
> -
> -       while (msmsdcc_readl(host, MMCISTATUS) & MCI_RXDATAAVLBL) {
> -               *ptr = msmsdcc_readl(host, MMCIFIFO + (count % MCI_FIFOSIZE));
> -               ptr++;
> -               count += sizeof(uint32_t);
> -
> -               remain -=  sizeof(uint32_t);
> -               if (remain == 0)
> -                       break;
> -       }
> -       return count;
> -}
> -
> -static int
> -msmsdcc_pio_write(struct msmsdcc_host *host, char *buffer,
> -                 unsigned int remain, u32 status)
> -{
> -       void __iomem *base = host->base;
> -       char *ptr = buffer;
> -
> -       do {
> -               unsigned int count, maxcnt, sz;
> -
> -               maxcnt = status & MCI_TXFIFOEMPTY ? MCI_FIFOSIZE :
> -                                                   MCI_FIFOHALFSIZE;
> -               count = min(remain, maxcnt);
> -
> -               sz = count % 4 ? (count >> 2) + 1 : (count >> 2);
> -               writesl(base + MMCIFIFO, ptr, sz);
> -               ptr += count;
> -               remain -= count;
> -
> -               if (remain == 0)
> -                       break;
> -
> -               status = msmsdcc_readl(host, MMCISTATUS);
> -       } while (status & MCI_TXFIFOHALFEMPTY);
> -
> -       return ptr - buffer;
> -}
> -
> -static int
> -msmsdcc_spin_on_status(struct msmsdcc_host *host, uint32_t mask, int maxspin)
> -{
> -       while (maxspin) {
> -               if ((msmsdcc_readl(host, MMCISTATUS) & mask))
> -                       return 0;
> -               udelay(1);
> -               --maxspin;
> -       }
> -       return -ETIMEDOUT;
> -}
> -
> -static irqreturn_t
> -msmsdcc_pio_irq(int irq, void *dev_id)
> -{
> -       struct msmsdcc_host     *host = dev_id;
> -       uint32_t                status;
> -       u32 mci_mask0;
> -
> -       status = msmsdcc_readl(host, MMCISTATUS);
> -       mci_mask0 = msmsdcc_readl(host, MMCIMASK0);
> -
> -       if (((mci_mask0 & status) & MCI_IRQ_PIO) == 0)
> -               return IRQ_NONE;
> -
> -       do {
> -               unsigned long flags;
> -               unsigned int remain, len;
> -               char *buffer;
> -
> -               if (!(status & (MCI_TXFIFOHALFEMPTY | MCI_RXDATAAVLBL))) {
> -                       if (host->curr.xfer_remain == 0 || !msmsdcc_piopoll)
> -                               break;
> -
> -                       if (msmsdcc_spin_on_status(host,
> -                                                  (MCI_TXFIFOHALFEMPTY |
> -                                                  MCI_RXDATAAVLBL),
> -                                                  PIO_SPINMAX)) {
> -                               break;
> -                       }
> -               }
> -
> -               /* Map the current scatter buffer */
> -               local_irq_save(flags);
> -               buffer = kmap_atomic(sg_page(host->pio.sg))
> -                                    + host->pio.sg->offset;
> -               buffer += host->pio.sg_off;
> -               remain = host->pio.sg->length - host->pio.sg_off;
> -               len = 0;
> -               if (status & MCI_RXACTIVE)
> -                       len = msmsdcc_pio_read(host, buffer, remain);
> -               if (status & MCI_TXACTIVE)
> -                       len = msmsdcc_pio_write(host, buffer, remain, status);
> -
> -               /* Unmap the buffer */
> -               kunmap_atomic(buffer);
> -               local_irq_restore(flags);
> -
> -               host->pio.sg_off += len;
> -               host->curr.xfer_remain -= len;
> -               host->curr.data_xfered += len;
> -               remain -= len;
> -
> -               if (remain == 0) {
> -                       /* This sg page is full - do some housekeeping */
> -                       if (status & MCI_RXACTIVE && host->curr.user_pages)
> -                               flush_dcache_page(sg_page(host->pio.sg));
> -
> -                       if (!--host->pio.sg_len) {
> -                               memset(&host->pio, 0, sizeof(host->pio));
> -                               break;
> -                       }
> -
> -                       /* Advance to next sg */
> -                       host->pio.sg++;
> -                       host->pio.sg_off = 0;
> -               }
> -
> -               status = msmsdcc_readl(host, MMCISTATUS);
> -       } while (1);
> -
> -       if (status & MCI_RXACTIVE && host->curr.xfer_remain < MCI_FIFOSIZE)
> -               msmsdcc_writel(host, (mci_mask0 & (~MCI_IRQ_PIO)) |
> -                                       MCI_RXDATAAVLBLMASK, MMCIMASK0);
> -
> -       if (!host->curr.xfer_remain)
> -               msmsdcc_writel(host, (mci_mask0 & (~MCI_IRQ_PIO)) | 0,
> -                                       MMCIMASK0);
> -
> -       return IRQ_HANDLED;
> -}
> -
> -static void msmsdcc_do_cmdirq(struct msmsdcc_host *host, uint32_t status)
> -{
> -       struct mmc_command *cmd = host->curr.cmd;
> -
> -       host->curr.cmd = NULL;
> -       cmd->resp[0] = msmsdcc_readl(host, MMCIRESPONSE0);
> -       cmd->resp[1] = msmsdcc_readl(host, MMCIRESPONSE1);
> -       cmd->resp[2] = msmsdcc_readl(host, MMCIRESPONSE2);
> -       cmd->resp[3] = msmsdcc_readl(host, MMCIRESPONSE3);
> -
> -       if (status & MCI_CMDTIMEOUT) {
> -               cmd->error = -ETIMEDOUT;
> -       } else if (status & MCI_CMDCRCFAIL &&
> -                  cmd->flags & MMC_RSP_CRC) {
> -               pr_err("%s: Command CRC error\n", mmc_hostname(host->mmc));
> -               cmd->error = -EILSEQ;
> -       }
> -
> -       if (!cmd->data || cmd->error) {
> -               if (host->curr.data && host->dma.sg)
> -                       msm_dmov_stop_cmd(host->dma.channel,
> -                                         &host->dma.hdr, 0);
> -               else if (host->curr.data) { /* Non DMA */
> -                       msmsdcc_reset_and_restore(host);
> -                       msmsdcc_stop_data(host);
> -                       msmsdcc_request_end(host, cmd->mrq);
> -               } else { /* host->data == NULL */
> -                       if (!cmd->error && host->prog_enable) {
> -                               if (status & MCI_PROGDONE) {
> -                                       host->prog_scan = false;
> -                                       host->prog_enable = false;
> -                                       msmsdcc_request_end(host, cmd->mrq);
> -                               } else {
> -                                       host->curr.cmd = cmd;
> -                               }
> -                       } else {
> -                               if (host->prog_enable) {
> -                                       host->prog_scan = false;
> -                                       host->prog_enable = false;
> -                               }
> -                               msmsdcc_request_end(host, cmd->mrq);
> -                       }
> -               }
> -       } else if (cmd->data)
> -               if (!(cmd->data->flags & MMC_DATA_READ))
> -                       msmsdcc_start_data(host, cmd->data,
> -                                               NULL, 0);
> -}
> -
> -static void
> -msmsdcc_handle_irq_data(struct msmsdcc_host *host, u32 status,
> -                       void __iomem *base)
> -{
> -       struct mmc_data *data = host->curr.data;
> -
> -       if (status & (MCI_CMDSENT | MCI_CMDRESPEND | MCI_CMDCRCFAIL |
> -                       MCI_CMDTIMEOUT | MCI_PROGDONE) && host->curr.cmd) {
> -               msmsdcc_do_cmdirq(host, status);
> -       }
> -
> -       if (!data)
> -               return;
> -
> -       /* Check for data errors */
> -       if (status & (MCI_DATACRCFAIL | MCI_DATATIMEOUT |
> -                     MCI_TXUNDERRUN | MCI_RXOVERRUN)) {
> -               msmsdcc_data_err(host, data, status);
> -               host->curr.data_xfered = 0;
> -               if (host->dma.sg)
> -                       msm_dmov_stop_cmd(host->dma.channel,
> -                                         &host->dma.hdr, 0);
> -               else {
> -                       msmsdcc_reset_and_restore(host);
> -                       if (host->curr.data)
> -                               msmsdcc_stop_data(host);
> -                       if (!data->stop)
> -                               msmsdcc_request_end(host, data->mrq);
> -                       else
> -                               msmsdcc_start_command(host, data->stop, 0);
> -               }
> -       }
> -
> -       /* Check for data done */
> -       if (!host->curr.got_dataend && (status & MCI_DATAEND))
> -               host->curr.got_dataend = 1;
> -
> -       /*
> -        * If DMA is still in progress, we complete via the completion handler
> -        */
> -       if (host->curr.got_dataend && !host->dma.busy) {
> -               /*
> -                * There appears to be an issue in the controller where
> -                * if you request a small block transfer (< fifo size),
> -                * you may get your DATAEND/DATABLKEND irq without the
> -                * PIO data irq.
> -                *
> -                * Check to see if there is still data to be read,
> -                * and simulate a PIO irq.
> -                */
> -               if (readl(base + MMCISTATUS) & MCI_RXDATAAVLBL)
> -                       msmsdcc_pio_irq(1, host);
> -
> -               msmsdcc_stop_data(host);
> -               if (!data->error)
> -                       host->curr.data_xfered = host->curr.xfer_size;
> -
> -               if (!data->stop)
> -                       msmsdcc_request_end(host, data->mrq);
> -               else
> -                       msmsdcc_start_command(host, data->stop, 0);
> -       }
> -}
> -
> -static irqreturn_t
> -msmsdcc_irq(int irq, void *dev_id)
> -{
> -       struct msmsdcc_host     *host = dev_id;
> -       void __iomem            *base = host->base;
> -       u32                     status;
> -       int                     ret = 0;
> -       int                     cardint = 0;
> -
> -       spin_lock(&host->lock);
> -
> -       do {
> -               status = msmsdcc_readl(host, MMCISTATUS);
> -               status &= msmsdcc_readl(host, MMCIMASK0);
> -               if ((status & (~MCI_IRQ_PIO)) == 0)
> -                       break;
> -               msmsdcc_writel(host, status, MMCICLEAR);
> -
> -               if (status & MCI_SDIOINTR)
> -                       status &= ~MCI_SDIOINTR;
> -
> -               if (!status)
> -                       break;
> -
> -               msmsdcc_handle_irq_data(host, status, base);
> -
> -               if (status & MCI_SDIOINTOPER) {
> -                       cardint = 1;
> -                       status &= ~MCI_SDIOINTOPER;
> -               }
> -               ret = 1;
> -       } while (status);
> -
> -       spin_unlock(&host->lock);
> -
> -       /*
> -        * We have to delay handling the card interrupt as it calls
> -        * back into the driver.
> -        */
> -       if (cardint)
> -               mmc_signal_sdio_irq(host->mmc);
> -
> -       return IRQ_RETVAL(ret);
> -}
> -
> -static void
> -msmsdcc_request(struct mmc_host *mmc, struct mmc_request *mrq)
> -{
> -       struct msmsdcc_host *host = mmc_priv(mmc);
> -       unsigned long flags;
> -
> -       WARN_ON(host->curr.mrq != NULL);
> -       WARN_ON(host->pwr == 0);
> -
> -       spin_lock_irqsave(&host->lock, flags);
> -
> -       host->stats.reqs++;
> -
> -       if (host->eject) {
> -               if (mrq->data && !(mrq->data->flags & MMC_DATA_READ)) {
> -                       mrq->cmd->error = 0;
> -                       mrq->data->bytes_xfered = mrq->data->blksz *
> -                                                 mrq->data->blocks;
> -               } else
> -                       mrq->cmd->error = -ENOMEDIUM;
> -
> -               spin_unlock_irqrestore(&host->lock, flags);
> -               mmc_request_done(mmc, mrq);
> -               return;
> -       }
> -
> -       msmsdcc_enable_clocks(host);
> -
> -       host->curr.mrq = mrq;
> -
> -       if (mrq->data && mrq->data->flags & MMC_DATA_READ)
> -               /* Queue/read data, daisy-chain command when data starts */
> -               msmsdcc_start_data(host, mrq->data, mrq->cmd, 0);
> -       else
> -               msmsdcc_start_command(host, mrq->cmd, 0);
> -
> -       if (host->cmdpoll && !msmsdcc_spin_on_status(host,
> -                               MCI_CMDRESPEND|MCI_CMDCRCFAIL|MCI_CMDTIMEOUT,
> -                               CMD_SPINMAX)) {
> -               uint32_t status = msmsdcc_readl(host, MMCISTATUS);
> -               msmsdcc_do_cmdirq(host, status);
> -               msmsdcc_writel(host,
> -                              MCI_CMDRESPEND | MCI_CMDCRCFAIL | MCI_CMDTIMEOUT,
> -                              MMCICLEAR);
> -               host->stats.cmdpoll_hits++;
> -       } else {
> -               host->stats.cmdpoll_misses++;
> -       }
> -       spin_unlock_irqrestore(&host->lock, flags);
> -}
> -
> -static void msmsdcc_setup_gpio(struct msmsdcc_host *host, bool enable)
> -{
> -       struct msm_mmc_gpio_data *curr;
> -       int i, rc = 0;
> -
> -       if (!host->plat->gpio_data || host->gpio_config_status == enable)
> -               return;
> -
> -       curr = host->plat->gpio_data;
> -       for (i = 0; i < curr->size; i++) {
> -               if (enable) {
> -                       rc = gpio_request(curr->gpio[i].no,
> -                                               curr->gpio[i].name);
> -                       if (rc) {
> -                               pr_err("%s: gpio_request(%d, %s) failed %d\n",
> -                                       mmc_hostname(host->mmc),
> -                                       curr->gpio[i].no,
> -                                       curr->gpio[i].name, rc);
> -                               goto free_gpios;
> -                       }
> -               } else {
> -                       gpio_free(curr->gpio[i].no);
> -               }
> -       }
> -       host->gpio_config_status = enable;
> -       return;
> -
> -free_gpios:
> -       for (; i >= 0; i--)
> -               gpio_free(curr->gpio[i].no);
> -}
> -
> -static void
> -msmsdcc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
> -{
> -       struct msmsdcc_host *host = mmc_priv(mmc);
> -       u32 clk = 0, pwr = 0;
> -       int rc;
> -       unsigned long flags;
> -
> -       spin_lock_irqsave(&host->lock, flags);
> -
> -       msmsdcc_enable_clocks(host);
> -
> -       spin_unlock_irqrestore(&host->lock, flags);
> -
> -       if (ios->clock) {
> -               if (ios->clock != host->clk_rate) {
> -                       rc = clk_set_rate(host->clk, ios->clock);
> -                       if (rc < 0)
> -                               pr_err("%s: Error setting clock rate (%d)\n",
> -                                      mmc_hostname(host->mmc), rc);
> -                       else
> -                               host->clk_rate = ios->clock;
> -               }
> -               clk |= MCI_CLK_ENABLE;
> -       }
> -
> -       if (ios->bus_width == MMC_BUS_WIDTH_4)
> -               clk |= (2 << 10); /* Set WIDEBUS */
> -
> -       if (ios->clock > 400000 && msmsdcc_pwrsave)
> -               clk |= (1 << 9); /* PWRSAVE */
> -
> -       clk |= (1 << 12); /* FLOW_ENA */
> -       clk |= (1 << 15); /* feedback clock */
> -
> -       if (host->plat->translate_vdd)
> -               pwr |= host->plat->translate_vdd(mmc_dev(mmc), ios->vdd);
> -
> -       switch (ios->power_mode) {
> -       case MMC_POWER_OFF:
> -               msmsdcc_setup_gpio(host, false);
> -               break;
> -       case MMC_POWER_UP:
> -               pwr |= MCI_PWR_UP;
> -               msmsdcc_setup_gpio(host, true);
> -               break;
> -       case MMC_POWER_ON:
> -               pwr |= MCI_PWR_ON;
> -               break;
> -       }
> -
> -       if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN)
> -               pwr |= MCI_OD;
> -
> -       msmsdcc_writel(host, clk, MMCICLOCK);
> -
> -       if (host->pwr != pwr) {
> -               host->pwr = pwr;
> -               msmsdcc_writel(host, pwr, MMCIPOWER);
> -       }
> -#if BUSCLK_PWRSAVE
> -       spin_lock_irqsave(&host->lock, flags);
> -       msmsdcc_disable_clocks(host, 1);
> -       spin_unlock_irqrestore(&host->lock, flags);
> -#endif
> -}
> -
> -static void msmsdcc_enable_sdio_irq(struct mmc_host *mmc, int enable)
> -{
> -       struct msmsdcc_host *host = mmc_priv(mmc);
> -       unsigned long flags;
> -       u32 status;
> -
> -       spin_lock_irqsave(&host->lock, flags);
> -       if (msmsdcc_sdioirq == 1) {
> -               status = msmsdcc_readl(host, MMCIMASK0);
> -               if (enable)
> -                       status |= MCI_SDIOINTOPERMASK;
> -               else
> -                       status &= ~MCI_SDIOINTOPERMASK;
> -               host->saved_irq0mask = status;
> -               msmsdcc_writel(host, status, MMCIMASK0);
> -       }
> -       spin_unlock_irqrestore(&host->lock, flags);
> -}
> -
> -static void msmsdcc_init_card(struct mmc_host *mmc, struct mmc_card *card)
> -{
> -       struct msmsdcc_host *host = mmc_priv(mmc);
> -
> -       if (host->plat->init_card)
> -               host->plat->init_card(card);
> -}
> -
> -static const struct mmc_host_ops msmsdcc_ops = {
> -       .request        = msmsdcc_request,
> -       .set_ios        = msmsdcc_set_ios,
> -       .enable_sdio_irq = msmsdcc_enable_sdio_irq,
> -       .init_card      = msmsdcc_init_card,
> -};
> -
> -static void
> -msmsdcc_check_status(unsigned long data)
> -{
> -       struct msmsdcc_host *host = (struct msmsdcc_host *)data;
> -       unsigned int status;
> -
> -       if (!host->plat->status) {
> -               mmc_detect_change(host->mmc, 0);
> -               goto out;
> -       }
> -
> -       status = host->plat->status(mmc_dev(host->mmc));
> -       host->eject = !status;
> -       if (status ^ host->oldstat) {
> -               pr_info("%s: Slot status change detected (%d -> %d)\n",
> -                       mmc_hostname(host->mmc), host->oldstat, status);
> -               if (status)
> -                       mmc_detect_change(host->mmc, (5 * HZ) / 2);
> -               else
> -                       mmc_detect_change(host->mmc, 0);
> -       }
> -
> -       host->oldstat = status;
> -
> -out:
> -       if (host->timer.function)
> -               mod_timer(&host->timer, jiffies + HZ);
> -}
> -
> -static irqreturn_t
> -msmsdcc_platform_status_irq(int irq, void *dev_id)
> -{
> -       struct msmsdcc_host *host = dev_id;
> -
> -       pr_debug("%s: %d\n", __func__, irq);
> -       msmsdcc_check_status((unsigned long) host);
> -       return IRQ_HANDLED;
> -}
> -
> -static void
> -msmsdcc_status_notify_cb(int card_present, void *dev_id)
> -{
> -       struct msmsdcc_host *host = dev_id;
> -
> -       pr_debug("%s: card_present %d\n", mmc_hostname(host->mmc),
> -              card_present);
> -       msmsdcc_check_status((unsigned long) host);
> -}
> -
> -static void
> -msmsdcc_busclk_expired(unsigned long _data)
> -{
> -       struct msmsdcc_host     *host = (struct msmsdcc_host *) _data;
> -
> -       if (host->clks_on)
> -               msmsdcc_disable_clocks(host, 0);
> -}
> -
> -static int
> -msmsdcc_init_dma(struct msmsdcc_host *host)
> -{
> -       memset(&host->dma, 0, sizeof(struct msmsdcc_dma_data));
> -       host->dma.host = host;
> -       host->dma.channel = -1;
> -
> -       if (!host->dmares)
> -               return -ENODEV;
> -
> -       host->dma.nc = dma_alloc_coherent(NULL,
> -                                         sizeof(struct msmsdcc_nc_dmadata),
> -                                         &host->dma.nc_busaddr,
> -                                         GFP_KERNEL);
> -       if (host->dma.nc == NULL) {
> -               pr_err("Unable to allocate DMA buffer\n");
> -               return -ENOMEM;
> -       }
> -       memset(host->dma.nc, 0x00, sizeof(struct msmsdcc_nc_dmadata));
> -       host->dma.cmd_busaddr = host->dma.nc_busaddr;
> -       host->dma.cmdptr_busaddr = host->dma.nc_busaddr +
> -                               offsetof(struct msmsdcc_nc_dmadata, cmdptr);
> -       host->dma.channel = host->dmares->start;
> -
> -       return 0;
> -}
> -
> -static int
> -msmsdcc_probe(struct platform_device *pdev)
> -{
> -       struct msm_mmc_platform_data *plat = pdev->dev.platform_data;
> -       struct msmsdcc_host *host;
> -       struct mmc_host *mmc;
> -       struct resource *cmd_irqres = NULL;
> -       struct resource *stat_irqres = NULL;
> -       struct resource *memres = NULL;
> -       struct resource *dmares = NULL;
> -       int ret;
> -
> -       /* must have platform data */
> -       if (!plat) {
> -               pr_err("%s: Platform data not available\n", __func__);
> -               ret = -EINVAL;
> -               goto out;
> -       }
> -
> -       if (pdev->id < 1 || pdev->id > 4)
> -               return -EINVAL;
> -
> -       if (pdev->resource == NULL || pdev->num_resources < 2) {
> -               pr_err("%s: Invalid resource\n", __func__);
> -               return -ENXIO;
> -       }
> -
> -       memres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0);
> -       cmd_irqres = platform_get_resource_byname(pdev, IORESOURCE_IRQ,
> -                                                 "cmd_irq");
> -       stat_irqres = platform_get_resource_byname(pdev, IORESOURCE_IRQ,
> -                                                  "status_irq");
> -
> -       if (!cmd_irqres || !memres) {
> -               pr_err("%s: Invalid resource\n", __func__);
> -               return -ENXIO;
> -       }
> -
> -       /*
> -        * Setup our host structure
> -        */
> -
> -       mmc = mmc_alloc_host(sizeof(struct msmsdcc_host), &pdev->dev);
> -       if (!mmc) {
> -               ret = -ENOMEM;
> -               goto out;
> -       }
> -
> -       host = mmc_priv(mmc);
> -       host->pdev_id = pdev->id;
> -       host->plat = plat;
> -       host->mmc = mmc;
> -       host->curr.cmd = NULL;
> -       init_timer(&host->busclk_timer);
> -       host->busclk_timer.data = (unsigned long) host;
> -       host->busclk_timer.function = msmsdcc_busclk_expired;
> -
> -
> -       host->cmdpoll = 1;
> -
> -       host->base = ioremap(memres->start, PAGE_SIZE);
> -       if (!host->base) {
> -               ret = -ENOMEM;
> -               goto host_free;
> -       }
> -
> -       host->cmd_irqres = cmd_irqres;
> -       host->memres = memres;
> -       host->dmares = dmares;
> -       spin_lock_init(&host->lock);
> -
> -       tasklet_init(&host->dma_tlet, msmsdcc_dma_complete_tlet,
> -                       (unsigned long)host);
> -
> -       /*
> -        * Setup DMA
> -        */
> -       if (host->dmares) {
> -               ret = msmsdcc_init_dma(host);
> -               if (ret)
> -                       goto ioremap_free;
> -       } else {
> -               host->dma.channel = -1;
> -       }
> -
> -       /* Get our clocks */
> -       host->pclk = clk_get(&pdev->dev, "sdc_pclk");
> -       if (IS_ERR(host->pclk)) {
> -               ret = PTR_ERR(host->pclk);
> -               goto dma_free;
> -       }
> -
> -       host->clk = clk_get(&pdev->dev, "sdc_clk");
> -       if (IS_ERR(host->clk)) {
> -               ret = PTR_ERR(host->clk);
> -               goto pclk_put;
> -       }
> -
> -       ret = clk_set_rate(host->clk, msmsdcc_fmin);
> -       if (ret) {
> -               pr_err("%s: Clock rate set failed (%d)\n", __func__, ret);
> -               goto clk_put;
> -       }
> -
> -       ret = clk_prepare(host->pclk);
> -       if (ret)
> -               goto clk_put;
> -
> -       ret = clk_prepare(host->clk);
> -       if (ret)
> -               goto clk_unprepare_p;
> -
> -       /* Enable clocks */
> -       ret = msmsdcc_enable_clocks(host);
> -       if (ret)
> -               goto clk_unprepare;
> -
> -       host->pclk_rate = clk_get_rate(host->pclk);
> -       host->clk_rate = clk_get_rate(host->clk);
> -
> -       /*
> -        * Setup MMC host structure
> -        */
> -       mmc->ops = &msmsdcc_ops;
> -       mmc->f_min = msmsdcc_fmin;
> -       mmc->f_max = msmsdcc_fmax;
> -       mmc->ocr_avail = plat->ocr_mask;
> -
> -       if (msmsdcc_4bit)
> -               mmc->caps |= MMC_CAP_4_BIT_DATA;
> -       if (msmsdcc_sdioirq)
> -               mmc->caps |= MMC_CAP_SDIO_IRQ;
> -       mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED;
> -
> -       mmc->max_segs = NR_SG;
> -       mmc->max_blk_size = 4096;       /* MCI_DATA_CTL BLOCKSIZE up to 4096 */
> -       mmc->max_blk_count = 65536;
> -
> -       mmc->max_req_size = 33554432;   /* MCI_DATA_LENGTH is 25 bits */
> -       mmc->max_seg_size = mmc->max_req_size;
> -
> -       msmsdcc_writel(host, 0, MMCIMASK0);
> -       msmsdcc_writel(host, 0x5e007ff, MMCICLEAR);
> -
> -       msmsdcc_writel(host, MCI_IRQENABLE, MMCIMASK0);
> -       host->saved_irq0mask = MCI_IRQENABLE;
> -
> -       /*
> -        * Setup card detect change
> -        */
> -
> -       memset(&host->timer, 0, sizeof(host->timer));
> -
> -       if (stat_irqres && !(stat_irqres->flags & IORESOURCE_DISABLED)) {
> -               unsigned long irqflags = IRQF_SHARED |
> -                       (stat_irqres->flags & IRQF_TRIGGER_MASK);
> -
> -               host->stat_irq = stat_irqres->start;
> -               ret = request_irq(host->stat_irq,
> -                                 msmsdcc_platform_status_irq,
> -                                 irqflags,
> -                                 DRIVER_NAME " (slot)",
> -                                 host);
> -               if (ret) {
> -                       pr_err("%s: Unable to get slot IRQ %d (%d)\n",
> -                              mmc_hostname(mmc), host->stat_irq, ret);
> -                       goto clk_disable;
> -               }
> -       } else if (plat->register_status_notify) {
> -               plat->register_status_notify(msmsdcc_status_notify_cb, host);
> -       } else if (!plat->status)
> -               pr_err("%s: No card detect facilities available\n",
> -                      mmc_hostname(mmc));
> -       else {
> -               init_timer(&host->timer);
> -               host->timer.data = (unsigned long)host;
> -               host->timer.function = msmsdcc_check_status;
> -               host->timer.expires = jiffies + HZ;
> -               add_timer(&host->timer);
> -       }
> -
> -       if (plat->status) {
> -               host->oldstat = host->plat->status(mmc_dev(host->mmc));
> -               host->eject = !host->oldstat;
> -       }
> -
> -       ret = request_irq(cmd_irqres->start, msmsdcc_irq, IRQF_SHARED,
> -                         DRIVER_NAME " (cmd)", host);
> -       if (ret)
> -               goto stat_irq_free;
> -
> -       ret = request_irq(cmd_irqres->start, msmsdcc_pio_irq, IRQF_SHARED,
> -                         DRIVER_NAME " (pio)", host);
> -       if (ret)
> -               goto cmd_irq_free;
> -
> -       platform_set_drvdata(pdev, mmc);
> -       mmc_add_host(mmc);
> -
> -       pr_info("%s: Qualcomm MSM SDCC at 0x%016llx irq %d,%d dma %d\n",
> -               mmc_hostname(mmc), (unsigned long long)memres->start,
> -               (unsigned int) cmd_irqres->start,
> -               (unsigned int) host->stat_irq, host->dma.channel);
> -       pr_info("%s: 4 bit data mode %s\n", mmc_hostname(mmc),
> -               (mmc->caps & MMC_CAP_4_BIT_DATA ? "enabled" : "disabled"));
> -       pr_info("%s: MMC clock %u -> %u Hz, PCLK %u Hz\n",
> -               mmc_hostname(mmc), msmsdcc_fmin, msmsdcc_fmax, host->pclk_rate);
> -       pr_info("%s: Slot eject status = %d\n", mmc_hostname(mmc), host->eject);
> -       pr_info("%s: Power save feature enable = %d\n",
> -               mmc_hostname(mmc), msmsdcc_pwrsave);
> -
> -       if (host->dma.channel != -1) {
> -               pr_info("%s: DM non-cached buffer at %p, dma_addr 0x%.8x\n",
> -                       mmc_hostname(mmc), host->dma.nc, host->dma.nc_busaddr);
> -               pr_info("%s: DM cmd busaddr 0x%.8x, cmdptr busaddr 0x%.8x\n",
> -                       mmc_hostname(mmc), host->dma.cmd_busaddr,
> -                       host->dma.cmdptr_busaddr);
> -       } else
> -               pr_info("%s: PIO transfer enabled\n", mmc_hostname(mmc));
> -       if (host->timer.function)
> -               pr_info("%s: Polling status mode enabled\n", mmc_hostname(mmc));
> -
> -       return 0;
> - cmd_irq_free:
> -       free_irq(cmd_irqres->start, host);
> - stat_irq_free:
> -       if (host->stat_irq)
> -               free_irq(host->stat_irq, host);
> - clk_disable:
> -       msmsdcc_disable_clocks(host, 0);
> - clk_unprepare:
> -       clk_unprepare(host->clk);
> - clk_unprepare_p:
> -       clk_unprepare(host->pclk);
> - clk_put:
> -       clk_put(host->clk);
> - pclk_put:
> -       clk_put(host->pclk);
> -dma_free:
> -       if (host->dmares)
> -               dma_free_coherent(NULL, sizeof(struct msmsdcc_nc_dmadata),
> -                                       host->dma.nc, host->dma.nc_busaddr);
> -ioremap_free:
> -       tasklet_kill(&host->dma_tlet);
> -       iounmap(host->base);
> - host_free:
> -       mmc_free_host(mmc);
> - out:
> -       return ret;
> -}
> -
> -#ifdef CONFIG_PM
> -static int
> -msmsdcc_suspend(struct platform_device *dev, pm_message_t state)
> -{
> -       struct mmc_host *mmc = platform_get_drvdata(dev);
> -
> -       if (mmc) {
> -               struct msmsdcc_host *host = mmc_priv(mmc);
> -
> -               if (host->stat_irq)
> -                       disable_irq(host->stat_irq);
> -
> -               msmsdcc_writel(host, 0, MMCIMASK0);
> -               if (host->clks_on)
> -                       msmsdcc_disable_clocks(host, 0);
> -       }
> -       return 0;
> -}
> -
> -static int
> -msmsdcc_resume(struct platform_device *dev)
> -{
> -       struct mmc_host *mmc = platform_get_drvdata(dev);
> -
> -       if (mmc) {
> -               struct msmsdcc_host *host = mmc_priv(mmc);
> -
> -               msmsdcc_enable_clocks(host);
> -
> -               msmsdcc_writel(host, host->saved_irq0mask, MMCIMASK0);
> -
> -               if (host->stat_irq)
> -                       enable_irq(host->stat_irq);
> -#if BUSCLK_PWRSAVE
> -               msmsdcc_disable_clocks(host, 1);
> -#endif
> -       }
> -       return 0;
> -}
> -#else
> -#define msmsdcc_suspend        0
> -#define msmsdcc_resume 0
> -#endif
> -
> -static struct platform_driver msmsdcc_driver = {
> -       .probe          = msmsdcc_probe,
> -       .suspend        = msmsdcc_suspend,
> -       .resume         = msmsdcc_resume,
> -       .driver         = {
> -               .name   = "msm_sdcc",
> -       },
> -};
> -
> -module_platform_driver(msmsdcc_driver);
> -
> -MODULE_DESCRIPTION("Qualcomm MSM 7X00A Multimedia Card Interface driver");
> -MODULE_LICENSE("GPL");
> diff --git a/drivers/mmc/host/msm_sdcc.h b/drivers/mmc/host/msm_sdcc.h
> deleted file mode 100644
> index 402028d16b86..000000000000
> --- a/drivers/mmc/host/msm_sdcc.h
> +++ /dev/null
> @@ -1,256 +0,0 @@
> -/*
> - *  linux/drivers/mmc/host/msmsdcc.h - QCT MSM7K SDC Controller
> - *
> - *  Copyright (C) 2008 Google, All Rights Reserved.
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License version 2 as
> - * published by the Free Software Foundation.
> - *
> - * - Based on mmci.h
> - */
> -
> -#ifndef _MSM_SDCC_H
> -#define _MSM_SDCC_H
> -
> -#define MSMSDCC_CRCI_SDC1      6
> -#define MSMSDCC_CRCI_SDC2      7
> -#define MSMSDCC_CRCI_SDC3      12
> -#define MSMSDCC_CRCI_SDC4      13
> -
> -#define MMCIPOWER              0x000
> -#define MCI_PWR_OFF            0x00
> -#define MCI_PWR_UP             0x02
> -#define MCI_PWR_ON             0x03
> -#define MCI_OD                 (1 << 6)
> -
> -#define MMCICLOCK              0x004
> -#define MCI_CLK_ENABLE         (1 << 8)
> -#define MCI_CLK_PWRSAVE                (1 << 9)
> -#define MCI_CLK_WIDEBUS                (1 << 10)
> -#define MCI_CLK_FLOWENA                (1 << 12)
> -#define MCI_CLK_INVERTOUT      (1 << 13)
> -#define MCI_CLK_SELECTIN       (1 << 14)
> -
> -#define MMCIARGUMENT           0x008
> -#define MMCICOMMAND            0x00c
> -#define MCI_CPSM_RESPONSE      (1 << 6)
> -#define MCI_CPSM_LONGRSP       (1 << 7)
> -#define MCI_CPSM_INTERRUPT     (1 << 8)
> -#define MCI_CPSM_PENDING       (1 << 9)
> -#define MCI_CPSM_ENABLE                (1 << 10)
> -#define MCI_CPSM_PROGENA       (1 << 11)
> -#define MCI_CSPM_DATCMD                (1 << 12)
> -#define MCI_CSPM_MCIABORT      (1 << 13)
> -#define MCI_CSPM_CCSENABLE     (1 << 14)
> -#define MCI_CSPM_CCSDISABLE    (1 << 15)
> -
> -
> -#define MMCIRESPCMD            0x010
> -#define MMCIRESPONSE0          0x014
> -#define MMCIRESPONSE1          0x018
> -#define MMCIRESPONSE2          0x01c
> -#define MMCIRESPONSE3          0x020
> -#define MMCIDATATIMER          0x024
> -#define MMCIDATALENGTH         0x028
> -
> -#define MMCIDATACTRL           0x02c
> -#define MCI_DPSM_ENABLE                (1 << 0)
> -#define MCI_DPSM_DIRECTION     (1 << 1)
> -#define MCI_DPSM_MODE          (1 << 2)
> -#define MCI_DPSM_DMAENABLE     (1 << 3)
> -
> -#define MMCIDATACNT            0x030
> -#define MMCISTATUS             0x034
> -#define MCI_CMDCRCFAIL         (1 << 0)
> -#define MCI_DATACRCFAIL                (1 << 1)
> -#define MCI_CMDTIMEOUT         (1 << 2)
> -#define MCI_DATATIMEOUT                (1 << 3)
> -#define MCI_TXUNDERRUN         (1 << 4)
> -#define MCI_RXOVERRUN          (1 << 5)
> -#define MCI_CMDRESPEND         (1 << 6)
> -#define MCI_CMDSENT            (1 << 7)
> -#define MCI_DATAEND            (1 << 8)
> -#define MCI_DATABLOCKEND       (1 << 10)
> -#define MCI_CMDACTIVE          (1 << 11)
> -#define MCI_TXACTIVE           (1 << 12)
> -#define MCI_RXACTIVE           (1 << 13)
> -#define MCI_TXFIFOHALFEMPTY    (1 << 14)
> -#define MCI_RXFIFOHALFFULL     (1 << 15)
> -#define MCI_TXFIFOFULL         (1 << 16)
> -#define MCI_RXFIFOFULL         (1 << 17)
> -#define MCI_TXFIFOEMPTY                (1 << 18)
> -#define MCI_RXFIFOEMPTY                (1 << 19)
> -#define MCI_TXDATAAVLBL                (1 << 20)
> -#define MCI_RXDATAAVLBL                (1 << 21)
> -#define MCI_SDIOINTR           (1 << 22)
> -#define MCI_PROGDONE           (1 << 23)
> -#define MCI_ATACMDCOMPL                (1 << 24)
> -#define MCI_SDIOINTOPER                (1 << 25)
> -#define MCI_CCSTIMEOUT         (1 << 26)
> -
> -#define MMCICLEAR              0x038
> -#define MCI_CMDCRCFAILCLR      (1 << 0)
> -#define MCI_DATACRCFAILCLR     (1 << 1)
> -#define MCI_CMDTIMEOUTCLR      (1 << 2)
> -#define MCI_DATATIMEOUTCLR     (1 << 3)
> -#define MCI_TXUNDERRUNCLR      (1 << 4)
> -#define MCI_RXOVERRUNCLR       (1 << 5)
> -#define MCI_CMDRESPENDCLR      (1 << 6)
> -#define MCI_CMDSENTCLR         (1 << 7)
> -#define MCI_DATAENDCLR         (1 << 8)
> -#define MCI_DATABLOCKENDCLR    (1 << 10)
> -
> -#define MMCIMASK0              0x03c
> -#define MCI_CMDCRCFAILMASK     (1 << 0)
> -#define MCI_DATACRCFAILMASK    (1 << 1)
> -#define MCI_CMDTIMEOUTMASK     (1 << 2)
> -#define MCI_DATATIMEOUTMASK    (1 << 3)
> -#define MCI_TXUNDERRUNMASK     (1 << 4)
> -#define MCI_RXOVERRUNMASK      (1 << 5)
> -#define MCI_CMDRESPENDMASK     (1 << 6)
> -#define MCI_CMDSENTMASK                (1 << 7)
> -#define MCI_DATAENDMASK                (1 << 8)
> -#define MCI_DATABLOCKENDMASK   (1 << 10)
> -#define MCI_CMDACTIVEMASK      (1 << 11)
> -#define MCI_TXACTIVEMASK       (1 << 12)
> -#define MCI_RXACTIVEMASK       (1 << 13)
> -#define MCI_TXFIFOHALFEMPTYMASK        (1 << 14)
> -#define MCI_RXFIFOHALFFULLMASK (1 << 15)
> -#define MCI_TXFIFOFULLMASK     (1 << 16)
> -#define MCI_RXFIFOFULLMASK     (1 << 17)
> -#define MCI_TXFIFOEMPTYMASK    (1 << 18)
> -#define MCI_RXFIFOEMPTYMASK    (1 << 19)
> -#define MCI_TXDATAAVLBLMASK    (1 << 20)
> -#define MCI_RXDATAAVLBLMASK    (1 << 21)
> -#define MCI_SDIOINTMASK                (1 << 22)
> -#define MCI_PROGDONEMASK       (1 << 23)
> -#define MCI_ATACMDCOMPLMASK    (1 << 24)
> -#define MCI_SDIOINTOPERMASK    (1 << 25)
> -#define MCI_CCSTIMEOUTMASK     (1 << 26)
> -
> -#define MMCIMASK1              0x040
> -#define MMCIFIFOCNT            0x044
> -#define MCICCSTIMER            0x058
> -
> -#define MMCIFIFO               0x080 /* to 0x0bc */
> -
> -#define MCI_IRQENABLE  \
> -       (MCI_CMDCRCFAILMASK|MCI_DATACRCFAILMASK|MCI_CMDTIMEOUTMASK|     \
> -       MCI_DATATIMEOUTMASK|MCI_TXUNDERRUNMASK|MCI_RXOVERRUNMASK|       \
> -       MCI_CMDRESPENDMASK|MCI_CMDSENTMASK|MCI_DATAENDMASK|MCI_PROGDONEMASK)
> -
> -#define MCI_IRQ_PIO \
> -       (MCI_RXDATAAVLBLMASK | MCI_TXDATAAVLBLMASK | MCI_RXFIFOEMPTYMASK | \
> -        MCI_TXFIFOEMPTYMASK | MCI_RXFIFOFULLMASK | MCI_TXFIFOFULLMASK | \
> -        MCI_RXFIFOHALFFULLMASK | MCI_TXFIFOHALFEMPTYMASK | \
> -        MCI_RXACTIVEMASK | MCI_TXACTIVEMASK)
> -/*
> - * The size of the FIFO in bytes.
> - */
> -#define MCI_FIFOSIZE   (16*4)
> -
> -#define MCI_FIFOHALFSIZE (MCI_FIFOSIZE / 2)
> -
> -#define NR_SG          32
> -
> -struct clk;
> -
> -struct msmsdcc_nc_dmadata {
> -       dmov_box        cmd[NR_SG];
> -       uint32_t        cmdptr;
> -};
> -
> -struct msmsdcc_dma_data {
> -       struct msmsdcc_nc_dmadata       *nc;
> -       dma_addr_t                      nc_busaddr;
> -       dma_addr_t                      cmd_busaddr;
> -       dma_addr_t                      cmdptr_busaddr;
> -
> -       struct msm_dmov_cmd             hdr;
> -       enum dma_data_direction         dir;
> -
> -       struct scatterlist              *sg;
> -       int                             num_ents;
> -
> -       int                             channel;
> -       struct msmsdcc_host             *host;
> -       int                             busy; /* Set if DM is busy */
> -       int                             active;
> -       unsigned int                    result;
> -       struct msm_dmov_errdata         err;
> -};
> -
> -struct msmsdcc_pio_data {
> -       struct scatterlist      *sg;
> -       unsigned int            sg_len;
> -       unsigned int            sg_off;
> -};
> -
> -struct msmsdcc_curr_req {
> -       struct mmc_request      *mrq;
> -       struct mmc_command      *cmd;
> -       struct mmc_data         *data;
> -       unsigned int            xfer_size;      /* Total data size */
> -       unsigned int            xfer_remain;    /* Bytes remaining to send */
> -       unsigned int            data_xfered;    /* Bytes acked by BLKEND irq */
> -       int                     got_dataend;
> -       int                     user_pages;
> -};
> -
> -struct msmsdcc_stats {
> -       unsigned int reqs;
> -       unsigned int cmds;
> -       unsigned int cmdpoll_hits;
> -       unsigned int cmdpoll_misses;
> -};
> -
> -struct msmsdcc_host {
> -       struct resource         *cmd_irqres;
> -       struct resource         *memres;
> -       struct resource         *dmares;
> -       void __iomem            *base;
> -       int                     pdev_id;
> -       unsigned int            stat_irq;
> -
> -       struct msmsdcc_curr_req curr;
> -
> -       struct mmc_host         *mmc;
> -       struct clk              *clk;           /* main MMC bus clock */
> -       struct clk              *pclk;          /* SDCC peripheral bus clock */
> -       unsigned int            clks_on;        /* set if clocks are enabled */
> -       struct timer_list       busclk_timer;
> -
> -       unsigned int            eject;          /* eject state */
> -
> -       spinlock_t              lock;
> -
> -       unsigned int            clk_rate;       /* Current clock rate */
> -       unsigned int            pclk_rate;
> -
> -       u32                     pwr;
> -       u32                     saved_irq0mask; /* MMCIMASK0 reg value */
> -       struct msm_mmc_platform_data *plat;
> -
> -       struct timer_list       timer;
> -       unsigned int            oldstat;
> -
> -       struct msmsdcc_dma_data dma;
> -       struct msmsdcc_pio_data pio;
> -       int                     cmdpoll;
> -       struct msmsdcc_stats    stats;
> -
> -       struct tasklet_struct   dma_tlet;
> -       /* Command parameters */
> -       unsigned int            cmd_timeout;
> -       unsigned int            cmd_pio_irqmask;
> -       unsigned int            cmd_datactrl;
> -       struct mmc_command      *cmd_cmd;
> -       u32                     cmd_c;
> -       bool                    gpio_config_status;
> -
> -       bool prog_scan;
> -       bool prog_enable;
> -};
> -
> -#endif
> diff --git a/include/linux/platform_data/mmc-msm_sdcc.h b/include/linux/platform_data/mmc-msm_sdcc.h
> deleted file mode 100644
> index 55aa873c9396..000000000000
> --- a/include/linux/platform_data/mmc-msm_sdcc.h
> +++ /dev/null
> @@ -1,27 +0,0 @@
> -#ifndef __MMC_MSM_SDCC_H
> -#define __MMC_MSM_SDCC_H
> -
> -#include <linux/mmc/host.h>
> -#include <linux/mmc/card.h>
> -#include <linux/mmc/sdio_func.h>
> -
> -struct msm_mmc_gpio {
> -       unsigned no;
> -       const char *name;
> -};
> -
> -struct msm_mmc_gpio_data {
> -       struct msm_mmc_gpio *gpio;
> -       u8 size;
> -};
> -
> -struct msm_mmc_platform_data {
> -       unsigned int ocr_mask;                  /* available voltages */
> -       u32 (*translate_vdd)(struct device *, unsigned int);
> -       unsigned int (*status)(struct device *);
> -       int (*register_status_notify)(void (*callback)(int card_present, void *dev_id), void *dev_id);
> -       struct msm_mmc_gpio_data *gpio_data;
> -       void (*init_card)(struct mmc_card *card);
> -};
> -
> -#endif
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
>

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 00/12] Remove mach-msm and associated code
  2015-03-13 20:45   ` Stephen Boyd
@ 2015-03-17 16:18     ` dwalker
  0 siblings, 0 replies; 32+ messages in thread
From: dwalker @ 2015-03-17 16:18 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Arnd Bergmann, linux-arm-msm, linux-arm-kernel, linux-kernel,
	David Brown, Bryan Huntsman, Linus Walleij, Alexandre Courbot,
	Greg Kroah-Hartman, David S . Miller, Ulf Hansson, Chris Ball,
	Alan Stern, linux-usb

On Fri, Mar 13, 2015 at 01:45:36PM -0700, Stephen Boyd wrote:
> On 03/13/15 12:55, Arnd Bergmann wrote:
> > On Friday 13 March 2015 11:09:33 Stephen Boyd wrote:
> >> The maintainers for mach-msm no longer have any plans to support
> >> or test the platforms supported by this architecture[1]. Most likely
> >> there aren't any active users of this code anyway, so let's
> >> delete it and the associated drivers/code. We should probably merge
> >> this as one big series through arm-soc. Although some patches
> >> should be fine to take through maintainers, some things like
> >> mmc and usb have header file dependencies for platform_data.
> >>
> >> [1] http://lkml.kernel.org/r/20150307031212.GA8434@fifo99.com
> >>
> > As I wrote, I'd have a mild preference for doing the multiplatform
> > conversion first and then removing the support in the following merge
> > window, just in case someone wants that code back.
> >
> > If everyone wants to see that code die rather sooner than later,
> > that's fine with me as well.
> 
> I think everyone wants to see the code die now. They can always pull the
> multi-platform patches from the list. I'll stash away my 7200 DT
> conversion in case someone cares but I really doubt anybody does.


I would say I want it to die , but it seems like you do .. It's fine with me
tho ..

Daniel

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 02/12] gpio: Remove gpio-msm-v1 driver
  2015-03-13 18:09 ` [PATCH 02/12] gpio: Remove gpio-msm-v1 driver Stephen Boyd
@ 2015-03-18 12:02   ` Linus Walleij
  0 siblings, 0 replies; 32+ messages in thread
From: Linus Walleij @ 2015-03-18 12:02 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: linux-arm-msm, linux-arm-kernel, linux-kernel, David Brown,
	Bryan Huntsman, Daniel Walker, Arnd Bergmann, Alexandre Courbot

On Fri, Mar 13, 2015 at 7:09 PM, Stephen Boyd <sboyd@codeaurora.org> wrote:

> This driver is orphaned now that mach-msm has been removed.
> Delete it.
>
> Cc: David Brown <davidb@codeaurora.org>
> Cc: Bryan Huntsman <bryanh@codeaurora.org>
> Cc: Daniel Walker <dwalker@fifo99.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Alexandre Courbot <gnurou@gmail.com>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> ---
>
> This can be acked and go through arm-soc or applied directly to gpio tree.

This would collide with Arnds multiplatform patches.

If you coordinate with Arnd and agree:
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 12/12] msm: msm_fb: Remove dead code
  2015-03-13 18:51   ` Jean-Christophe PLAGNIOL-VILLARD
@ 2015-04-10 23:07     ` Stephen Boyd
  2015-06-16 18:43     ` Stephen Boyd
  1 sibling, 0 replies; 32+ messages in thread
From: Stephen Boyd @ 2015-04-10 23:07 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD
  Cc: linux-arm-msm, linux-arm-kernel, linux-kernel, David Brown,
	Bryan Huntsman, Daniel Walker, Arnd Bergmann, Tomi Valkeinen,
	Kumar Gala

On 03/13/15 11:51, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 11:09 Fri 13 Mar     , Stephen Boyd wrote:
>> This code is no longer used now that mach-msm has been removed.
>> Delete it.
>>
>> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
>> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
>> Cc: David Brown <davidb@codeaurora.org>
>> Cc: Bryan Huntsman <bryanh@codeaurora.org>
>> Cc: Daniel Walker <dwalker@fifo99.com>
>> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
>

Thanks. Kumar, can you pick this one up too?

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 12/12] msm: msm_fb: Remove dead code
  2015-03-13 18:51   ` Jean-Christophe PLAGNIOL-VILLARD
  2015-04-10 23:07     ` Stephen Boyd
@ 2015-06-16 18:43     ` Stephen Boyd
  2015-06-16 23:27       ` Kevin Hilman
  2015-06-17  9:56       ` Tomi Valkeinen
  1 sibling, 2 replies; 32+ messages in thread
From: Stephen Boyd @ 2015-06-16 18:43 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD
  Cc: linux-arm-msm, linux-arm-kernel, linux-kernel, David Brown,
	Bryan Huntsman, Daniel Walker, Arnd Bergmann, Tomi Valkeinen,
	arm

On 03/13/2015 11:51 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 11:09 Fri 13 Mar     , Stephen Boyd wrote:
>> This code is no longer used now that mach-msm has been removed.
>> Delete it.
>>
>> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
>> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
>> Cc: David Brown <davidb@codeaurora.org>
>> Cc: Bryan Huntsman <bryanh@codeaurora.org>
>> Cc: Daniel Walker <dwalker@fifo99.com>
>> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
>

Thanks again. Should this go through arm-soc (Cced)? Or some other tree
besides the fb tree? This is the last patch that hasn't been applied in
this set of 12 patches.

-Stephen

(leaving context in case arm-soc wants to apply directly)

>> ---
>>
>> This needs an ack to go through arm-soc with patch 1.
>>
>>  drivers/video/fbdev/Kconfig                   |   7 -
>>  drivers/video/fbdev/Makefile                  |   1 -
>>  drivers/video/fbdev/msm/Makefile              |  19 -
>>  drivers/video/fbdev/msm/mddi.c                | 821 --------------------------
>>  drivers/video/fbdev/msm/mddi_client_dummy.c   |  85 ---
>>  drivers/video/fbdev/msm/mddi_client_nt35399.c | 252 --------
>>  drivers/video/fbdev/msm/mddi_client_toshiba.c | 280 ---------
>>  drivers/video/fbdev/msm/mddi_hw.h             | 305 ----------
>>  drivers/video/fbdev/msm/mdp.c                 | 520 ----------------
>>  drivers/video/fbdev/msm/mdp_csc_table.h       | 582 ------------------
>>  drivers/video/fbdev/msm/mdp_hw.h              | 627 --------------------
>>  drivers/video/fbdev/msm/mdp_ppp.c             | 731 -----------------------
>>  drivers/video/fbdev/msm/mdp_scale_tables.c    | 766 ------------------------
>>  drivers/video/fbdev/msm/mdp_scale_tables.h    |  38 --
>>  drivers/video/fbdev/msm/msm_fb.c              | 659 ---------------------
>>  include/linux/platform_data/video-msm_fb.h    | 146 -----
>>  16 files changed, 5839 deletions(-)
>>  delete mode 100644 drivers/video/fbdev/msm/Makefile
>>  delete mode 100644 drivers/video/fbdev/msm/mddi.c
>>  delete mode 100644 drivers/video/fbdev/msm/mddi_client_dummy.c
>>  delete mode 100644 drivers/video/fbdev/msm/mddi_client_nt35399.c
>>  delete mode 100644 drivers/video/fbdev/msm/mddi_client_toshiba.c
>>  delete mode 100644 drivers/video/fbdev/msm/mddi_hw.h
>>  delete mode 100644 drivers/video/fbdev/msm/mdp.c
>>  delete mode 100644 drivers/video/fbdev/msm/mdp_csc_table.h
>>  delete mode 100644 drivers/video/fbdev/msm/mdp_hw.h
>>  delete mode 100644 drivers/video/fbdev/msm/mdp_ppp.c
>>  delete mode 100644 drivers/video/fbdev/msm/mdp_scale_tables.c
>>  delete mode 100644 drivers/video/fbdev/msm/mdp_scale_tables.h
>>  delete mode 100644 drivers/video/fbdev/msm/msm_fb.c
>>  delete mode 100644 include/linux/platform_data/video-msm_fb.h
>>
>> diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
>> index b3dd417b4719..b8bf5978e288 100644
>> --- a/drivers/video/fbdev/Kconfig
>> +++ b/drivers/video/fbdev/Kconfig
>> @@ -2326,13 +2326,6 @@ config FB_PRE_INIT_FB
>>  	  Select this option if display contents should be inherited as set by
>>  	  the bootloader.
>>  
>> -config FB_MSM
>> -	tristate "MSM Framebuffer support"
>> -	depends on FB && ARCH_MSM
>> -	select FB_CFB_FILLRECT
>> -	select FB_CFB_COPYAREA
>> -	select FB_CFB_IMAGEBLIT
>> -
>>  config FB_MX3
>>  	tristate "MX3 Framebuffer support"
>>  	depends on FB && MX3_IPU
>> diff --git a/drivers/video/fbdev/Makefile b/drivers/video/fbdev/Makefile
>> index 1979afffccfe..cecea5063a80 100644
>> --- a/drivers/video/fbdev/Makefile
>> +++ b/drivers/video/fbdev/Makefile
>> @@ -126,7 +126,6 @@ obj-y                             += omap2/
>>  obj-$(CONFIG_XEN_FBDEV_FRONTEND)  += xen-fbfront.o
>>  obj-$(CONFIG_FB_CARMINE)          += carminefb.o
>>  obj-$(CONFIG_FB_MB862XX)	  += mb862xx/
>> -obj-$(CONFIG_FB_MSM)              += msm/
>>  obj-$(CONFIG_FB_NUC900)           += nuc900fb.o
>>  obj-$(CONFIG_FB_JZ4740)		  += jz4740_fb.o
>>  obj-$(CONFIG_FB_PUV3_UNIGFX)      += fb-puv3.o
>> diff --git a/drivers/video/fbdev/msm/Makefile b/drivers/video/fbdev/msm/Makefile
>> deleted file mode 100644
>> index 802d6ae523fb..000000000000
>> --- a/drivers/video/fbdev/msm/Makefile
>> +++ /dev/null
>> @@ -1,19 +0,0 @@
>> -
>> -# core framebuffer
>> -#
>> -obj-y := msm_fb.o
>> -
>> -# MDP DMA/PPP engine
>> -#
>> -obj-y += mdp.o mdp_scale_tables.o mdp_ppp.o
>> -
>> -# MDDI interface
>> -#
>> -obj-y += mddi.o
>> -
>> -# MDDI client/panel drivers
>> -#
>> -obj-y += mddi_client_dummy.o
>> -obj-y += mddi_client_toshiba.o
>> -obj-y += mddi_client_nt35399.o
>> -
>> diff --git a/drivers/video/fbdev/msm/mddi.c b/drivers/video/fbdev/msm/mddi.c
>> deleted file mode 100644
>> index e0f8011a3c4b..000000000000
>> --- a/drivers/video/fbdev/msm/mddi.c
>> +++ /dev/null
>> @@ -1,821 +0,0 @@
>> -/*
>> - * MSM MDDI Transport
>> - *
>> - * Copyright (C) 2007 Google Incorporated
>> - * Copyright (C) 2007 QUALCOMM Incorporated
>> - *
>> - * 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/module.h>
>> -#include <linux/kernel.h>
>> -#include <linux/dma-mapping.h>
>> -#include <linux/interrupt.h>
>> -#include <linux/platform_device.h>
>> -#include <linux/delay.h>
>> -#include <linux/gfp.h>
>> -#include <linux/spinlock.h>
>> -#include <linux/clk.h>
>> -#include <linux/io.h>
>> -#include <linux/sched.h>
>> -#include <linux/platform_data/video-msm_fb.h>
>> -#include "mddi_hw.h"
>> -
>> -#define FLAG_DISABLE_HIBERNATION 0x0001
>> -#define FLAG_HAVE_CAPS		 0x0002
>> -#define FLAG_HAS_VSYNC_IRQ	 0x0004
>> -#define FLAG_HAVE_STATUS	 0x0008
>> -
>> -#define CMD_GET_CLIENT_CAP     0x0601
>> -#define CMD_GET_CLIENT_STATUS  0x0602
>> -
>> -union mddi_rev {
>> -	unsigned char raw[MDDI_REV_BUFFER_SIZE];
>> -	struct mddi_rev_packet hdr;
>> -	struct mddi_client_status status;
>> -	struct mddi_client_caps caps;
>> -	struct mddi_register_access reg;
>> -};
>> -
>> -struct reg_read_info {
>> -	struct completion done;
>> -	uint32_t reg;
>> -	uint32_t status;
>> -	uint32_t result;
>> -};
>> -
>> -struct mddi_info {
>> -	uint16_t flags;
>> -	uint16_t version;
>> -	char __iomem *base;
>> -	int irq;
>> -	struct clk *clk;
>> -	struct msm_mddi_client_data client_data;
>> -
>> -	/* buffer for rev encap packets */
>> -	void *rev_data;
>> -	dma_addr_t rev_addr;
>> -	struct mddi_llentry *reg_write_data;
>> -	dma_addr_t reg_write_addr;
>> -	struct mddi_llentry *reg_read_data;
>> -	dma_addr_t reg_read_addr;
>> -	size_t rev_data_curr;
>> -
>> -	spinlock_t int_lock;
>> -	uint32_t int_enable;
>> -	uint32_t got_int;
>> -	wait_queue_head_t int_wait;
>> -
>> -	struct mutex reg_write_lock;
>> -	struct mutex reg_read_lock;
>> -	struct reg_read_info *reg_read;
>> -
>> -	struct mddi_client_caps caps;
>> -	struct mddi_client_status status;
>> -
>> -	void (*power_client)(struct msm_mddi_client_data *, int);
>> -
>> -	/* client device published to bind us to the
>> -	 * appropriate mddi_client driver
>> -	 */
>> -	char client_name[20];
>> -
>> -	struct platform_device client_pdev;
>> -};
>> -
>> -static void mddi_init_rev_encap(struct mddi_info *mddi);
>> -
>> -#define mddi_readl(r) readl(mddi->base + (MDDI_##r))
>> -#define mddi_writel(v, r) writel((v), mddi->base + (MDDI_##r))
>> -
>> -void mddi_activate_link(struct msm_mddi_client_data *cdata)
>> -{
>> -	struct mddi_info *mddi = container_of(cdata, struct mddi_info,
>> -					      client_data);
>> -
>> -	mddi_writel(MDDI_CMD_LINK_ACTIVE, CMD);
>> -}
>> -
>> -static void mddi_handle_link_list_done(struct mddi_info *mddi)
>> -{
>> -}
>> -
>> -static void mddi_reset_rev_encap_ptr(struct mddi_info *mddi)
>> -{
>> -	printk(KERN_INFO "mddi: resetting rev ptr\n");
>> -	mddi->rev_data_curr = 0;
>> -	mddi_writel(mddi->rev_addr, REV_PTR);
>> -	mddi_writel(mddi->rev_addr, REV_PTR);
>> -	mddi_writel(MDDI_CMD_FORCE_NEW_REV_PTR, CMD);
>> -}
>> -
>> -static void mddi_handle_rev_data(struct mddi_info *mddi, union mddi_rev *rev)
>> -{
>> -	int i;
>> -	struct reg_read_info *ri;
>> -
>> -	if ((rev->hdr.length <= MDDI_REV_BUFFER_SIZE - 2) &&
>> -	   (rev->hdr.length >= sizeof(struct mddi_rev_packet) - 2)) {
>> -
>> -		switch (rev->hdr.type) {
>> -		case TYPE_CLIENT_CAPS:
>> -			memcpy(&mddi->caps, &rev->caps,
>> -			       sizeof(struct mddi_client_caps));
>> -			mddi->flags |= FLAG_HAVE_CAPS;
>> -			wake_up(&mddi->int_wait);
>> -			break;
>> -		case TYPE_CLIENT_STATUS:
>> -			memcpy(&mddi->status, &rev->status,
>> -			       sizeof(struct mddi_client_status));
>> -			mddi->flags |= FLAG_HAVE_STATUS;
>> -			wake_up(&mddi->int_wait);
>> -			break;
>> -		case TYPE_REGISTER_ACCESS:
>> -			ri = mddi->reg_read;
>> -			if (ri == 0) {
>> -				printk(KERN_INFO "rev: got reg %x = %x without "
>> -						 " pending read\n",
>> -				       rev->reg.register_address,
>> -				       rev->reg.register_data_list);
>> -				break;
>> -			}
>> -			if (ri->reg != rev->reg.register_address) {
>> -				printk(KERN_INFO "rev: got reg %x = %x for "
>> -						 "wrong register, expected "
>> -						 "%x\n",
>> -				       rev->reg.register_address,
>> -				       rev->reg.register_data_list, ri->reg);
>> -				break;
>> -			}
>> -			mddi->reg_read = NULL;
>> -			ri->status = 0;
>> -			ri->result = rev->reg.register_data_list;
>> -			complete(&ri->done);
>> -			break;
>> -		default:
>> -			printk(KERN_INFO "rev: unknown reverse packet: "
>> -					 "len=%04x type=%04x CURR_REV_PTR=%x\n",
>> -			       rev->hdr.length, rev->hdr.type,
>> -			       mddi_readl(CURR_REV_PTR));
>> -			for (i = 0; i < rev->hdr.length + 2; i++) {
>> -				if ((i % 16) == 0)
>> -					printk(KERN_INFO "\n");
>> -				printk(KERN_INFO " %02x", rev->raw[i]);
>> -			}
>> -			printk(KERN_INFO "\n");
>> -			mddi_reset_rev_encap_ptr(mddi);
>> -		}
>> -	} else {
>> -		printk(KERN_INFO "bad rev length, %d, CURR_REV_PTR %x\n",
>> -		       rev->hdr.length, mddi_readl(CURR_REV_PTR));
>> -		mddi_reset_rev_encap_ptr(mddi);
>> -	}
>> -}
>> -
>> -static void mddi_wait_interrupt(struct mddi_info *mddi, uint32_t intmask);
>> -
>> -static void mddi_handle_rev_data_avail(struct mddi_info *mddi)
>> -{
>> -	uint32_t rev_data_count;
>> -	uint32_t rev_crc_err_count;
>> -	struct reg_read_info *ri;
>> -	size_t prev_offset;
>> -	uint16_t length;
>> -
>> -	union mddi_rev *crev = mddi->rev_data + mddi->rev_data_curr;
>> -
>> -	/* clear the interrupt */
>> -	mddi_writel(MDDI_INT_REV_DATA_AVAIL, INT);
>> -	rev_data_count = mddi_readl(REV_PKT_CNT);
>> -	rev_crc_err_count = mddi_readl(REV_CRC_ERR);
>> -	if (rev_data_count > 1)
>> -		printk(KERN_INFO "rev_data_count %d\n", rev_data_count);
>> -
>> -	if (rev_crc_err_count) {
>> -		printk(KERN_INFO "rev_crc_err_count %d, INT %x\n",
>> -		       rev_crc_err_count,  mddi_readl(INT));
>> -		ri = mddi->reg_read;
>> -		if (ri == 0) {
>> -			printk(KERN_INFO "rev: got crc error without pending "
>> -			       "read\n");
>> -		} else {
>> -			mddi->reg_read = NULL;
>> -			ri->status = -EIO;
>> -			ri->result = -1;
>> -			complete(&ri->done);
>> -		}
>> -	}
>> -
>> -	if (rev_data_count == 0)
>> -		return;
>> -
>> -	prev_offset = mddi->rev_data_curr;
>> -
>> -	length = *((uint8_t *)mddi->rev_data + mddi->rev_data_curr);
>> -	mddi->rev_data_curr++;
>> -	if (mddi->rev_data_curr == MDDI_REV_BUFFER_SIZE)
>> -		mddi->rev_data_curr = 0;
>> -	length += *((uint8_t *)mddi->rev_data + mddi->rev_data_curr) << 8;
>> -	mddi->rev_data_curr += 1 + length;
>> -	if (mddi->rev_data_curr >= MDDI_REV_BUFFER_SIZE)
>> -		mddi->rev_data_curr =
>> -			mddi->rev_data_curr % MDDI_REV_BUFFER_SIZE;
>> -
>> -	if (length > MDDI_REV_BUFFER_SIZE - 2) {
>> -		printk(KERN_INFO "mddi: rev data length greater than buffer"
>> -			"size\n");
>> -		mddi_reset_rev_encap_ptr(mddi);
>> -		return;
>> -	}
>> -
>> -	if (prev_offset + 2 + length >= MDDI_REV_BUFFER_SIZE) {
>> -		union mddi_rev tmprev;
>> -		size_t rem = MDDI_REV_BUFFER_SIZE - prev_offset;
>> -		memcpy(&tmprev.raw[0], mddi->rev_data + prev_offset, rem);
>> -		memcpy(&tmprev.raw[rem], mddi->rev_data, 2 + length - rem);
>> -		mddi_handle_rev_data(mddi, &tmprev);
>> -	} else {
>> -		mddi_handle_rev_data(mddi, crev);
>> -	}
>> -
>> -	if (prev_offset < MDDI_REV_BUFFER_SIZE / 2 &&
>> -	    mddi->rev_data_curr >= MDDI_REV_BUFFER_SIZE / 2) {
>> -		mddi_writel(mddi->rev_addr, REV_PTR);
>> -	}
>> -}
>> -
>> -static irqreturn_t mddi_isr(int irq, void *data)
>> -{
>> -	struct msm_mddi_client_data *cdata = data;
>> -	struct mddi_info *mddi = container_of(cdata, struct mddi_info,
>> -					      client_data);
>> -	uint32_t active, status;
>> -
>> -	spin_lock(&mddi->int_lock);
>> -
>> -	active = mddi_readl(INT);
>> -	status = mddi_readl(STAT);
>> -
>> -	mddi_writel(active, INT);
>> -
>> -	/* ignore any interrupts we have disabled */
>> -	active &= mddi->int_enable;
>> -
>> -	mddi->got_int |= active;
>> -	wake_up(&mddi->int_wait);
>> -
>> -	if (active & MDDI_INT_PRI_LINK_LIST_DONE) {
>> -		mddi->int_enable &= (~MDDI_INT_PRI_LINK_LIST_DONE);
>> -		mddi_handle_link_list_done(mddi);
>> -	}
>> -	if (active & MDDI_INT_REV_DATA_AVAIL)
>> -		mddi_handle_rev_data_avail(mddi);
>> -
>> -	if (active & ~MDDI_INT_NEED_CLEAR)
>> -		mddi->int_enable &= ~(active & ~MDDI_INT_NEED_CLEAR);
>> -
>> -	if (active & MDDI_INT_LINK_ACTIVE) {
>> -		mddi->int_enable &= (~MDDI_INT_LINK_ACTIVE);
>> -		mddi->int_enable |= MDDI_INT_IN_HIBERNATION;
>> -	}
>> -
>> -	if (active & MDDI_INT_IN_HIBERNATION) {
>> -		mddi->int_enable &= (~MDDI_INT_IN_HIBERNATION);
>> -		mddi->int_enable |= MDDI_INT_LINK_ACTIVE;
>> -	}
>> -
>> -	mddi_writel(mddi->int_enable, INTEN);
>> -	spin_unlock(&mddi->int_lock);
>> -
>> -	return IRQ_HANDLED;
>> -}
>> -
>> -static long mddi_wait_interrupt_timeout(struct mddi_info *mddi,
>> -					uint32_t intmask, int timeout)
>> -{
>> -	unsigned long irq_flags;
>> -
>> -	spin_lock_irqsave(&mddi->int_lock, irq_flags);
>> -	mddi->got_int &= ~intmask;
>> -	mddi->int_enable |= intmask;
>> -	mddi_writel(mddi->int_enable, INTEN);
>> -	spin_unlock_irqrestore(&mddi->int_lock, irq_flags);
>> -	return wait_event_timeout(mddi->int_wait, mddi->got_int & intmask,
>> -				  timeout);
>> -}
>> -
>> -static void mddi_wait_interrupt(struct mddi_info *mddi, uint32_t intmask)
>> -{
>> -	if (mddi_wait_interrupt_timeout(mddi, intmask, HZ/10) == 0)
>> -		printk(KERN_INFO "mddi_wait_interrupt %d, timeout "
>> -		       "waiting for %x, INT = %x, STAT = %x gotint = %x\n",
>> -		       current->pid, intmask, mddi_readl(INT), mddi_readl(STAT),
>> -		       mddi->got_int);
>> -}
>> -
>> -static void mddi_init_rev_encap(struct mddi_info *mddi)
>> -{
>> -	memset(mddi->rev_data, 0xee, MDDI_REV_BUFFER_SIZE);
>> -	mddi_writel(mddi->rev_addr, REV_PTR);
>> -	mddi_writel(MDDI_CMD_FORCE_NEW_REV_PTR, CMD);
>> -	mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
>> -}
>> -
>> -void mddi_set_auto_hibernate(struct msm_mddi_client_data *cdata, int on)
>> -{
>> -	struct mddi_info *mddi = container_of(cdata, struct mddi_info,
>> -					      client_data);
>> -	mddi_writel(MDDI_CMD_POWERDOWN, CMD);
>> -	mddi_wait_interrupt(mddi, MDDI_INT_IN_HIBERNATION);
>> -	mddi_writel(MDDI_CMD_HIBERNATE | !!on, CMD);
>> -	mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
>> -}
>> -
>> -
>> -static uint16_t mddi_init_registers(struct mddi_info *mddi)
>> -{
>> -	mddi_writel(0x0001, VERSION);
>> -	mddi_writel(MDDI_HOST_BYTES_PER_SUBFRAME, BPS);
>> -	mddi_writel(0x0003, SPM); /* subframes per media */
>> -	mddi_writel(0x0005, TA1_LEN);
>> -	mddi_writel(MDDI_HOST_TA2_LEN, TA2_LEN);
>> -	mddi_writel(0x0096, DRIVE_HI);
>> -	/* 0x32 normal, 0x50 for Toshiba display */
>> -	mddi_writel(0x0050, DRIVE_LO);
>> -	mddi_writel(0x003C, DISP_WAKE); /* wakeup counter */
>> -	mddi_writel(MDDI_HOST_REV_RATE_DIV, REV_RATE_DIV);
>> -
>> -	mddi_writel(MDDI_REV_BUFFER_SIZE, REV_SIZE);
>> -	mddi_writel(MDDI_MAX_REV_PKT_SIZE, REV_ENCAP_SZ);
>> -
>> -	/* disable periodic rev encap */
>> -	mddi_writel(MDDI_CMD_PERIODIC_REV_ENCAP, CMD);
>> -	mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
>> -
>> -	if (mddi_readl(PAD_CTL) == 0) {
>> -		/* If we are turning on band gap, need to wait 5us before
>> -		 * turning on the rest of the PAD */
>> -		mddi_writel(0x08000, PAD_CTL);
>> -		udelay(5);
>> -	}
>> -
>> -	/* Recommendation from PAD hw team */
>> -	mddi_writel(0xa850f, PAD_CTL);
>> -
>> -
>> -	/* Need an even number for counts */
>> -	mddi_writel(0x60006, DRIVER_START_CNT);
>> -
>> -	mddi_set_auto_hibernate(&mddi->client_data, 0);
>> -
>> -	mddi_writel(MDDI_CMD_DISP_IGNORE, CMD);
>> -	mddi_wait_interrupt(mddi, MDDI_INT_NO_CMD_PKTS_PEND);
>> -
>> -	mddi_init_rev_encap(mddi);
>> -	return mddi_readl(CORE_VER) & 0xffff;
>> -}
>> -
>> -static void mddi_suspend(struct msm_mddi_client_data *cdata)
>> -{
>> -	struct mddi_info *mddi = container_of(cdata, struct mddi_info,
>> -					      client_data);
>> -	/* turn off the client */
>> -	if (mddi->power_client)
>> -		mddi->power_cli