usb: diag: Avoid NULL pointer dereference in debugfs

The debugfs entry functions used to read and clear the statistics
counters loop over the list of open diag channels. However, a
channel might not be bound to a gadget interface if diag_function_add
doesn't get called, hence its priv_usb member may be NULL. In that
case simply avoid accessing it altogether as its counters aren't used
anyway.

CRs-fixed: 346598
Change-Id: Icbd84ae0df83a5fe4c62b19fd7c95585e8e6e491
Signed-off-by: Jack Pham <jackp@codeaurora.org>

Conflicts:
	drivers/usb/gadget/f_diag.c
Fix mismerge: USB: fix endpoint-disabling for failed config changes

commit b436f48a31692bc41b9d049dec23cf55714d70d5

Change-Id: I15ba9e4d3231572e771cdcb2ecd88fdc9f69e09d
USB: Set AHB HPROT Mode to allow posted data writes

Currently writing 0x0 into AHBMODE register which means both data
transactions and QH and TD descriptors are non-posted writes to
system memory. As per HW team recommendation, should write 0x08 value
to set AHB HPROT mode into the AHBMODE register which allows posted
data writes to system memory and will improve the throughput numbers.

Change-Id: Ib44a8cfe11c6ff96ff712643227532e24548e706
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>

Conflicts:
	drivers/usb/gadget/ci13xxx_msm_hsic.c
	drivers/usb/host/ehci-msm2.c
Revert "USB: OTG: msm: Fix wall charger compliance issues"

This reverts commit 7d357c14ac0087fce41d2db49d2750227cae9d95.
[moto] f_rndis: Logging and other fixes Thanks to Kazuki Yasumatsu

Change-Id: I1923bfef30596af812b0f47e9203fc2f83b69089
msm_fb: display:  free writeback buffer at correct time

When mdp pipe is freed at end of video play back, Writeback
buffer is freed while mdp still fetchs data from it. This cause
system crashed and blue screen shows on screen. This patch
will free writeback buffer at correct time.

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

Conflicts:
	drivers/video/msm/mdp.h
	drivers/video/msm/mdp4_overlay.c
	drivers/video/msm/mdp4_overlay_dsi_video.c
	drivers/video/msm/mdp4_overlay_lcdc.c
[moto] mipi_mot_video_smd_hd_465: ELVSS support

Change-Id: Ifd05d29481c646f9c3569242699ed8b9c45cadfd
ALSA: PCM: volume API implementation

Introduced a new helper function snd_pcm_add_volume_ctls() to
create control elements representing the volume for each PCM
(sub)stream.

Change-Id: Id483257c4fe84a909e7a4af3a5aa3e4f0d5d9ea5
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
ASoC: msm: Modify default buffer params of compressed driver

There can be a use case where HAL may request for
Smaller period size and corresponding buffer size for
A session, update compressed driver default period size
And buffer size based on the userspace configuration

Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
(cherry picked from commit d4e62aeb8839cf9accf2356568a14adb8d24152f)
(cherry picked from commit 462a09e10e32afb49ca50bdbfb8c4a4e13cc068a)

Change-Id: Id1aef6c71c5c71b269b6607816f7c3e5c4fd4314
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
ASoC: msm: Add support for configuring buffer size in multichannel driver

The buffer size is hardcoded in multichannel pcm driver. This results
in more pcm data in the driver for smaller sampling rates causing
Audio Video sync issues and old buffers played during seek operation.
Add support for configuring buffer size in multi channel pcm driver.
based on sample rate and channels.

Change-Id: I3db4a026b6627177168656769c3f2751dbb12391
Signed-off-by: Krishnankutty Kolathappilly <kkolat@codeaurora.org>
Revert "msm: mdp: Revert MDP Port split changes"

This reverts commit 3c3109beb62b1e19251e000df438b6b90b1194a1.
mmi: Raise MDP bandwidth values

* Apparently some users are still having underruns. Raise the bw
  multipliers a bit again and comment out logging that kicks in
  during mdp4_overlay_mdp_perf_req

Change-Id: Ic192a6fa08116dece64bee294917e0e905c04a56
ASoC : msm: HDMI 5.1 LPCM playback support.

Support 6 channels configuration in HDMI driver
and the ALSA framework to play 5.1 LPCM format

CRs-Fixed: 370096
Signed-off-by: Aviral Gupta <aviralg@codeaurora.org>
(cherry picked from commit fc3b780b571b62f302fe38c9faaa58508ad5464f)
(cherry picked from commit 7fd4b7af623ac3dfef0b23d4e68758b1a65941d6)

Change-Id: I091cd3187e9c68eb2589c9b3412b1d8a7bb59164
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>

Conflicts:
	sound/soc/msm/mpq8064.c
	sound/soc/msm/msm-dai-fe.c
	sound/soc/msm/msm-dai-q6.c
msm: display: Clear performance request data in turning on

In resume, previous cached request data needs be cleared as
they do not reflect the current hw status.

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

Conflicts:

	drivers/video/msm/mdp4_overlay.c

Change-Id: I6e3abe09a38b4499ceb168ea7b0351672253a6cd
Signed-off-by: Ramakrishna Prasad N <crpn@codeaurora.org>

Conflicts:
	drivers/video/msm/mdp4.h
	drivers/video/msm/mdp4_overlay.c
msm_fb: display: add panel's late_init

Some panels need to be initialized after panel is on.
Add late_init to support this feature.

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

Conflicts:
	drivers/video/msm/mipi_dsi.c
	drivers/video/msm/mipi_novatek.c
msm_fb: display: add wfd clk ctrl in pipe_commit

mdp_clk_ctrl on is not called when commit is from overlay commit path
which can cause mdp hang. mdp_clk_ctrl off should be after mdp
overlay2 is done, so schedule a work in overlay2 done isr.

Change-Id: I94fd08da27cfda114f5cc0056a5103f0a9b772f6
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm_fb : display : Change fps level dynamically.

This change lets the user modify the fps level dynamically using
sysfs interface.

Change-Id: Ie99bbca5ec1a0b5ff5fa3570874b254e3fb7235c
Signed-off-by: Vishnuvardhan Prodduturi <vproddut@codeaurora.org>

Conflicts:
	drivers/video/msm/mipi_dsi.h
	drivers/video/msm/msm_dss_io_8960.c
	drivers/video/msm/msm_fb_panel.c
	drivers/video/msm/msm_fb_panel.h
msm_fb: display: add early_off during panel off

Some panels need to send display_off command before
dsi controller turned off. This patch add early_off
feature for this purpose.

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

Conflicts:
	drivers/video/msm/mdp.c
video: msm: Maintain histogram LUT state through suspend resume

Make sure LUT state is maintained after suspend resume. Required to ensure
HistLUT and backlight scale are in sync.

CRs-Fixed: 476491
Change-Id: Icc999aa0b04cad93ceed334426f61b71cbdd0a13
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>

Conflicts:
	drivers/video/msm/mdp.c
video: msm: Initialize HistLUT with last saved LUT

Set HistLUT to last value written to LUT when MDP is turned on. Assumes
that last LUT corresponds to last BL scale value sent.

CRs-Fixed: 475149
Change-Id: I7383666c2d1f3d8800c5f25e2ef648568eb33a74
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>