tspp: support device tree mechanism in the driver

Update the TSPP driver to support using the device tree mechanism
for getting platform-dependent data.

Change-Id: I5ac0f90266c3f30621865cf097db4dba1ee07fc6
Signed-off-by: Liron Kuch <lkuch@codeaurora.org>

Conflicts:
	drivers/misc/tspp.c
tspp: Improve GPIO configuration mechanism

The TSPP driver requires using 3 or 4 GPIOs per TSIF instance,
depending on the TSIF operation mode. The driver used to configure
all the GPIOs regardless of TSIF instance and mode.
This commit changes the driver's GPIO configuration mechanism to
take into account the TSIF instance and mode, and use only the relevant
GPIOs. This is required by customers who may now utilize the unused GPIOs
for other purposes.

Change-Id: Ia216f479871e613ca48f73dc63c0a6cdab4dad57
Signed-off-by: Liron Kuch <lkuch@codeaurora.org>
msm: mdm: Fix bug in retrieving driver's private data

The current code retrieves driver's private data based on platform
device id or device file name.  The device id match is broken
for targets which has only one external modem (platform device
id = -1).

Use device's private data and file's private data fields for
storing the driver's private data.

CRs-Fixed: 451830
Change-Id: I080ef86cce8d346c0b3e380432712dde07b64aea
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
gpu: ion: allocate huge pages in iommu heap

As a performance optimization, use higher-order page allocations if
possible. This can reduce TLB misses and the total number of page
structures.

CRs-Fixed: 449035
Change-Id: I6b76ec69599a100fd7209161c4286284ae347be0
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>

Conflicts:
	drivers/gpu/ion/ion_iommu_heap.c
Update copyright to The Linux Foundation

Change-Id: Ibead64ce2e901dede2ddd1b86088b88f2350ce92
Signed-off-by: Duy Truong <dtruong@codeaurora.org>

Conflicts:
	arch/arm/mach-msm/board-sony_viskan-storage.c
	arch/arm/mach-msm/board-sony_viskan_huashan_ct-regulator.c
	arch/arm/mach-msm/clock.h
	arch/arm/mach-msm/devices-msm7x01a.c
	arch/arm/mach-msm/hsic_tty.c
	arch/arm/mach-msm/include/mach/board_lge.h
	arch/arm/mach-msm/include/mach/clk.h
	arch/arm/mach-msm/include/mach/lge/board_mako.h
	arch/arm/mach-msm/include/mach/qdsp5/qdsp5audppmsg.h
	arch/arm/mach-msm/include/mach/qdsp5/qdsp5audpreproc.h
	arch/arm/mach-msm/include/mach/qdsp5/qdsp5audpreproccmdi.h
	arch/arm/mach-msm/include/mach/qdsp5/qdsp5audpreprocmsg.h
	arch/arm/mach-msm/lge/mako/board-mako-camera.c
	arch/arm/mach-msm/lge/mako/board-mako-display.c
	arch/arm/mach-msm/lge/mako/board-mako-gpiomux.c
	arch/arm/mach-msm/lge/mako/board-mako-gpu.c
	arch/arm/mach-msm/lge/mako/board-mako-input.c
	arch/arm/mach-msm/lge/mako/board-mako-pmic.c
	arch/arm/mach-msm/lge/mako/board-mako.c
	arch/arm/mach-msm/lge/mako/board-mako.h
	arch/arm/mach-msm/qdsp5/audmgr.c
	arch/arm/mach-msm/qdsp5/audmgr_new.h
	arch/arm/mach-msm/qdsp5/audpreproc.c
	arch/arm/mach-msm/qdsp5/audrec.c
	drivers/hwmon/pm8xxx-adc-scale.c
	drivers/hwmon/pm8xxx-adc.c
	drivers/media/video/msm/csi/msm_csid.c
	drivers/media/video/msm/sensors/imx091.c
	drivers/media/video/msm/sensors/imx111.c
	drivers/media/video/msm/sensors/imx119_v4l2.c
	drivers/media/video/msm/server/msm_cam_server.c
	drivers/media/video/msm/vfe/msm_vfe32.c
	drivers/media/video/msm/vfe/msm_vfe32.h
	drivers/misc/pm8xxx-vibrator.c
	drivers/video/msm/external_common.c
	drivers/video/msm/mdp_hw_init.c
	drivers/video/msm/mipi_lgit.h
	drivers/video/msm/msm_fb_panel.h
	drivers/video/msm/vidc/1080p/ddl/vcd_ddl_vidc.c
	include/linux/legacy_ion.h
	include/linux/mfd/pm8xxx/pm8921-charger.h
	include/linux/mhl_defs.h
	include/linux/usb/msm_hsusb.h
	include/media/msm_camera.h
	net/bluetooth/hidp/core.c
	net/bluetooth/mgmt.c
	sound/soc/msm/msm8960.c
msm: vidc: unsecure heaps in the right order during error handling

Unsecure MM and CP heaps in the right order in case of failure
CRs-Fixed: 445400

Change-Id: I2b5d414c5d9f109740a931b75b0cfbdb196c465f
Signed-off-by: Praveen Chavan <pchava@codeaurora.org>
gpu: ion: handle allocation error during heap protection in CP heap

Return error and do not increment ref count in case of failure to
protect the CP heap.
CRs-Fixed: 445400

Change-Id: Ia615773fe2c52386d9522de7a182edd633a66e1c
Signed-off-by: Praveen Chavan <pchava@codeaurora.org>

Conflicts:
	drivers/gpu/ion/ion_cp_heap.c
msm: ADSPRPC: Cleanup header and source.

Cleanup header and source to conform with coding guidelines.

Change-Id: I0fba2a7a758930003d5bce9c8ffc0036574736b8
Acked-by: Anatoly Yakovenko <anatolyy@qti.qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
msm: ADSPRPC: Update driver to create its own device node

Create device node under /dev/adsprpc-smd. Users no longer have to run
mknod after the driver is installed.

Change-Id: I5f5ae4dafc37ce8e87ef2c91358be9bfd5934b8a
Acked-by: Anatoly Yakovenko <anatolyy@qti.qualcomm.com>
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Merge "usb: gadget: Support multiple HSIC transport instances for dun and rmnet"
Conflicts:
	drivers/usb/misc/mdm_data_bridge.c
msm_fb: display: remove extra mdp4_dsi_cmd_clk_check()

Since mdp4_dsi_cmd_clk_check() is called inside of
mdp4_dsi_cmd_pipe_commit() also, mdp4_dsi_cmd_clk_check()
is called two times from pan display route. This patch
remove mdp4_dsi_cmd_clk_check() from mdp4_dsi_cmd_overlay()
to avoid mdp4_dsi_cmd_clk_check() called twice from
pan display route.

CRs-fixed: 449809
Change-Id: Idbeb968e6af73abac2bb8c800a8c55015ea6a0bf
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
msm: socinfo: Add support for MSM8130 variants of MSM8930

Add the SoC ID for MSM8130, MSM8130AA and MSM8130AB (all
are variants of MSM8930).

Change-Id: I1fe89b6f75eca8064b580e52ffee4a5e2dfda9b9
Signed-off-by: David Ng <dave@codeaurora.org>
USB: android: Wakeup both reader and writer processes upon TX/RX error

The writer process is blocked on a wait queue if there are no free
TX requests.  It is unblocked from TX completion handler. When error
is encountered on RX path, wakeup the writer thread.  If the host
stops reading the data after RX errors, the writer process will never
be unblocked.  Similarly wakeup reader process when error is encountered
on TX path.

(cherry picked from commit e8757ca19d3f2230af507fc44262f9c92af37b59)

CRs-Fixed: 449129
Change-Id: I4fa133d293c96b629d1506a0054b048e9551abd1
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
mmc: msm_sdcc: Hard reset controller on errors

For APQ8064 V2 (SDCC version = 0x06000018) doing a soft
reset on errors doesn't reset the state machine that
handles side-band signalling with SPS-BAM fully and can
lead to controller hang for the data transfers after
the reset.

Since there is no register interface to soft reset such
state machine inside the controller, we do hard reset of
the controller in case of errors. SDCC hard reset is
defined as assert and de-assert of asynchronous clock
reset line of the controller.

CRs-Fixed: 451632
Change-Id: I366856e7508a3843688c8acead8a701e7b06fc19
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>

Conflicts:
	drivers/mmc/host/msm_sdcc.h
diag: Modify diag to support multiple hsic instances

The debugfs implementation and diag code interfacing with the
diag userspace library currently only supports one instance
of diag bridge using hsic.  Make changes to support multiple
instances of diag bridge using hsic.

Change-Id: I58b37006d652338392527fd46985c44f31accec6
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>

Conflicts:
	drivers/char/diag/diag_debugfs.c
USB: gadget: Add module parameter for Rx transfer length

The Rx request transfer length is 16K bytes by default.  The test
results indicate that larger transfers improve write speeds.  Add
provision for specifying Rx transfer length at runtime.

echo -n 1048576 > /sys/module/g_android/parameters/mtp_rx_req_len

The above command can be used to set Rx transfer length to 1MB.  If
the memory allocation is failed, fallback to the default length.

CRs-Fixed: 429212
Change-Id: I7bed5aeefabf1a50c08a9a8e5b876e0cf59515fd
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
USB: ci13xxx_udc: Add module param to enable streaming mode

The streaming mode is disabled by default for ci13xxx_msm.  Add
a module param to enable streaming.  This module param overrides
flag.

This allows user space to enable streaming mode for selected USB
compositions.

CRs-Fixed: 429212
Change-Id: I50c55c005d1eccec094195e3394bfb9415d94596
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
USB: ci13xxx_udc: Add support for large requests

Spanning large request into multiple dTDs will fail with short
packets.  Instead queue one dTD at a time.  This patch has
the following limitations.

1. Large requests are supported only on Bulk OUT endpoints. This
feature is mainly required for MTP driver to achieve better write
throughputs. The VFS performs well with larger buffers.

2. To keep it simple, don't allow queuing while processing large
request. Don't allow larger request queuing while the queue is
busy.

CRs-Fixed: 449733
Change-Id: I262a62af3316d673a97f11842290609092c6e7df
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
msm: vidc: Move metadata shared input mem to firmware heap.

Metadata shared input is used to communicate between the
video core and video driver. Allocate it from firmware
heap for specific targets as MFC command heap size is
limited.

CRs-Fixed: 450118
Change-Id: I3d04cf6dd498ae67adcec7a8cba513bd7932d158
Signed-off-by: Shobhit Pandey <cshopan@codeaurora.org>
Signed-off-by: Deepak Verma <dverma@codeaurora.org>