mtd: Disable mtdchar mmap on MMU systems

commit f5cf8f07423b2677cebebcebc863af77223a4972 upstream.

This code was broken because it assumed that all MTD devices were map-based.
Disable it for now, until it can be fixed properly for the next merge window.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Linux 3.0.74
msm_fb: display: add sysfs and clock control to smart panel

This patch allows both vsync enable and disable are controlled
by framework. Driver reports vsync event to framework via sysfs.
Meanwhile, mdp related clocks are enabled by framework at vsync
enabled request and disabled by driver if there is no any display
update within specifid vsync period.

Change-Id: Ice5be3a6db5930b95bdd2f718d9256bf73936e23
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

Conflicts:
	drivers/video/msm/mdp4_overlay_dsi_cmd.c
	drivers/video/msm/mipi_dsi.c
	drivers/video/msm/mipi_dsi_host.c
msm_fb: display: skip one vsync event after enabling mdp and vsync clk

Both mdp and mdp_vsync clks are disabled for command mode panel when
no new frames are being played. When they are re-enabled if new
requests come in, the first vsync event which is signaled by read
pointer interrupt arrives in a random time due to the sync between mdp
and panel, so skip it to maintain correct vsync timing.

Change-Id: I683b765e4a16d3d152b9270f5982234b94921f1e
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm_fb: display: add video mode dcs cmdlist support

Add video mode dcs command list support. This patch
make sure dcs commands committed while dsi video engine
is busy so that dcs command will be transmitted at beginning
of next BLLP.

Change-Id: I11b0214ee10f3b1ef33b1da4c8e577800068cb06
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm_fb: display: fix dsi_busy_wait race condition

After pipe_commit() released mutex and before kickoff happens,
There has possibility that dcs command may start transmitted.
This patch add dsi_mdp_busy flag to fix this race condition.

Change-Id: I0d9a81cd0719085c91c03386117261ad3bb6b182
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

Conflicts:
	drivers/video/msm/mipi_dsi.c
msm_fb: display: turn mdp clock on at pipe_commit

mdp clock is controlled by frame work. There has
possibility that mdp clock had been turned off while
frame update still happen. In this case update
thread may stuck at wait4vsync since there has no
mdp clcok to trigger vsync interrupt. This patch
will enable mdp clock at pipe commit when mdp clock
is tunred off so that frame update can be completed.

Change-Id: I2d31b9a4b6f0cb9dd36516a80931988e23e8a545
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay_dsi_cmd.c

Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>

Conflicts:
	drivers/video/msm/mdp4_overlay_dsi_cmd.c
iopoll: Introduce memory-mapped IO polling macros

It is sometimes necessary to poll a memory-mapped register until its
value satisfies some condition. Introduce a family of convenience macros
that do this. Tight-loop and sleeping versions are provided with and
without timeouts.

Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Change-Id: Ia7db00cbe60ded8b0ed9bbff264aaea0841da92a
iopoll: Tweak min sleep time used with usleep_range()

Users of the iopoll macros may need to poll addresses that take
a long time to update. In such cases, the hardcoded value of 1 us
passed as the minimum delay to usleep_range() may result in
reads that occur more often than necessary.

Use (sleep_us/4) as the min delay instead of 1 us to resolve this
is a scalable way.

Change-Id: I8f679a7ecdb9ea2666c78aabca3c8ba806e0ead3
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
iopoll: Introduce the readl_iopoll_timeout_noirq macro

It is sometimes necessary to poll a register - until a
certain value is read - in atomic context. Introduce
a macro that allows one to specify the maximum number
of reads attempts and the number of microseconds to
delay between each read attempt.

Change-Id: Ice27e78cf4e156da9de00d58783c220bdbc758d3
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
(cherry picked from commit 7a35f5abde0192e72d4e7982411e376d8b898944)
dsi: fix mismerge

Change-Id: Iba766a1d31ea2310db430ee03d3e2fc89463ef54
msm_fb: Fix display corruption with continuous splash screen feature

During boot up, we observe random lines on screen between the
splash_screen image and the android animation. MDP clocks
were turned off during bootup. Fix this issue by enabling
the clocks when this feature is enabled.

Add check to see that the video mode engine is not busy before
turning off the dsi controller to avoid any underruns.

CRs-Fixed: 399634

Change-Id: I8fdb50fa848362a548b8cdd53ee1817346b57716
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
dsi: fix build

Remove old motorola code and fix uninitialized variable.

Change-Id: I1574c491a0596a76b2269c4ee4a58ec97af9101f
msm_fb: display: Update video format on fps change

Added check for frame rate change. Corner case if there is no
change in xres,yres and pixclock.

Change-Id: I0ff5eb65364d2a370e0973da7e84f738bd042a20
CRs-Fixed: 356328
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>

Conflicts:
	drivers/video/msm/msm_fb_panel.h
msm_fb: display: wake up system around vsync

To avoid frame drops due to power collapse,
wake up cpu right before vsync.

Change-Id: I63385eb329ae5e74cbac5256823fd3a213e0a0e1
Signed-off-by: Ken Zhang <kenz@codeaurora.org>

Conflicts:
	drivers/video/msm/msm_fb.h
	drivers/video/msm/msm_fb_panel.h
msm_fb: display:  add mdp bandwidth runtime calculation

Currently mdp bandwidth request logic is based on source image size
and number of layers. This logic can not support complicated mdp
usecases and it is not power efficient. The logic is improved by
calculating mdp bandwidth request at runtime from all pipes and mixers.

CRs-fixed: 425823
Change-Id: I63206f00f8d3017a2449f8ac617fce3ba2a4d36c
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>

Conflicts:
	drivers/video/msm/lvds.c
	drivers/video/msm/mdp.c
	drivers/video/msm/mdp.h
	drivers/video/msm/mdp4.h
	drivers/video/msm/mdp4_overlay.c
	drivers/video/msm/mdp4_overlay_writeback.c
	drivers/video/msm/mipi_dsi.c
msm: event_timer: Support to add event timers.

Add support to allow drivers to specify future events
that need to be treated as hard deadlines. Upon event timer
expiry the driver will be notified by callback function
that the driver provides.
The pm code can query the earliest event and modify
the event timer accounting for the back off based on the
latency of the low power mode being entered.

(cherry picked from commit 388c308cebef8e9cdbd80608a032abc810d46e62)
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>

Change-Id: I461e2c31c285b93588aa56dd25905efab020e0c8
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
msm_fb: fix mismerge

Change-Id: Ibe7976b0428a1a8c171ffc6b99d8d600ac37a9e0
mdp: fix build

warning: format '%llu' expects argument of type 'long long unsigned
int', but argument 6 has type 'unsigned int'

Change-Id: Idf755d28d31177d80c1a91e94684f184a29666ee
msm_fb: display: free borderfill pipe when ref_cnt reach 0

Borderfill pipe need to be kept as baselayer which is not
suppose to be freed at suspend. It only be freed when
ref_cnt reach 0 by "adb stop".

CRs-fixed: 429196
Change-Id: Ibffe7960cc194162d1ba71e8dc8636393938483f
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>