ARM: dts: msm: add gcc mux to hardware event dt node for 8610

Add support for gcc mux registers to CoreSight Hardware event dt
node for MSM8610. These registers can be configured to generate
GCC Hardware events.

Change-Id: If37ad3de2e70cfc15769e559b54122d974aaf4b9
Signed-off-by: Aparna Das <adas@codeaurora.org>
msm: ipc_logging: move deserialize function

To enable testing using dynamically-loaded kernel modules, the
deserialization function is needed which requires it to be exported.

Rename function, move it to the main driver file and export it.

Change-Id: I5f49ebf9e9268c9e2c04fc61703a9beb6ec5f242
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
ASoC: msm: Change the definition of port_session variable

The definition of the post session variable used during port
mixer command is 32 bit wide, if the port number selected
is more than 32 bit and set_bit will end up in changing the
variable other than port_session as it is out of bound access.
Change the port session variable to 64 bit to take care of out of bound
access.

CRs-Fixed: 502025
Change-Id: I86b21d2dcfe6773b255dbf4a85eaa8f87e86826e
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
socinfo: Add of_board_is_cdp API

Some targets need to choose the board-specific
config data at run-time and hence this API is required.
E.g. gpiomux_install for a gpio that is used differently
on a CDP vs other boards.

Change-Id: I80b3f7f7c52ab0beadfd14d91536289f331ca08d
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
msm: vidc: Fix bug in subsystem_get error handling

On failure, subsystem_put returns an error code. Video
driver should not mistake this error code with a valid handle.

Change-Id: Ibc13adda1b2a6b64b5ae0c1fd13c179678817233
Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>
msm: mdss: remove pipe queue from pan display

Instead of directly queueing the data to pipe, store buffer contents in
in pipe structure during pan display. This will result in the contents
to be updated once kickoff is called, which is the expected behavior.

Change-Id: Ic6167317f32220497ca05447c896b44c33b1ee1f
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
msm: ipa: fix IPA module init failure code to avoid kernel crash

BAM driver will unmap the ioremap performed by IPA driver as
part of sps_deregister_bam_device. IPA driver does not really
need to setup this mapping so remove that code. Also fix clock
cleanup.

Change-Id: I8dcbeb4cc2a025898b4f1d2d813a17a9805d3858
Signed-off-by: Ravi Gummadidala <rgummadi@codeaurora.org>
diag: Fix incorrect handling of buffers

In diag driver, processing dci transaction takes place even if the
incoming buffer is invalid. Also, we are handling the memory pools
incorrectly. This patch fixes these two issues

Change-Id: Ibdcc9759e3e1030f34f82c4e6b0315a8e5c79ab7
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
msm: kgsl: Use a standard function for register access

There were dual functions for reading and writing registers for
adreno devices. Stop the use of one of these dual functions as
it makes the code more uniform.

Change-Id: I703d27d1674a85a6c2d7a9fe6dc49f13005a3410
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
diag: Update SSIDs and log codes

The SSIDs, event IDs and log codes have fallen out of date.
Bring the SSIDs, event IDs and log codes up to date.

Change-Id: Ie23de1e86c131df081e33fa600bde367510f9f3c
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
ARM: dts: msm: Add phandle for ADC devices in PMIC pm8941

Add phandle to VADC, IADC and ADC_TM device nodes.

Change-Id: Ib8ee6ada7c1e1cc6985169b2677396f0305ef86d
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
msm: mdss: parse device tree for dedicated wfd blk property

The presence of a dedicated wfd writeback block needs to be
retrieved from device tree, which can be used to determine
if WFD and rotator sessions need to be multiplexed.

Change-Id: I150b17d0ebb045aecc9c6e694632e5f89007c957
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
ARM: dts: msm: Add a boolean property for WFD writeback block for
msm8974

Dedicated writeback block for WFD needs separate handling
as opposed to regular line mode writeback blocks.

Change-Id: I71aba9bc4de5ca6c91295a4a6fc16cf3768787ee
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
msm: mdss: support wfd and rotation simultaneously

Concurrent rotation and WFD usecases need to be supported
using a single writeback hw module for low end targets.
To enable this feature, mixer, ctl and DMA pipe needs to be
shared between block and line mode operations and hardware
programing is synchronized with a shared mutex.

Change-Id: I0fe909dd07006282239c65d5fe92d270069a3920
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
msm: mdss: Release smp's held for writeback mixers

Smp's reserved for writeback interface can be released safely
as long as the pipeline is idle. This allows pipe reprogramming
during concurrent line and block mode operations.

Change-Id: Ib0fdf4d45412daa4478ac0fb7aff2e3564b2a584
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
block: add a flag to identify PM request

Add a flag REQ_PM to identify the request is PM related, such requests
will not change the device request queue's runtime status. It is
intended to be used in driver's runtime PM callback, so that driver can
perform some IO to the device there with the queue's runtime status
unaffected. e.g. in SCSI disk's runtime suspend callback, the disk will
be put into stopped power state, and this require sending a command to
the device. Such command processing should not change the disk's runtime
status.

Change-Id: I522bbee6cc911cefeefba50517ebc283e2838918
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Git-commit: 66311274691ec65972cad3626057fa8d00c146d8
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[sthumma@codeaurora.org: resolve trival merge conflicts]
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
block: add runtime pm helpers

Add runtime pm helper functions:

void blk_pm_runtime_init(struct request_queue *q, struct device *dev)
  - Initialization function for drivers to call.

int blk_pre_runtime_suspend(struct request_queue *q)
  - If any requests are in the queue, mark last busy and return -EBUSY.
    Otherwise set q->rpm_status to RPM_SUSPENDING and return 0.

void blk_post_runtime_suspend(struct request_queue *q, int err)
  - If the suspend succeeded then set q->rpm_status to RPM_SUSPENDED.
    Otherwise set it to RPM_ACTIVE and mark last busy.

void blk_pre_runtime_resume(struct request_queue *q)
  - Set q->rpm_status to RPM_RESUMING.

void blk_post_runtime_resume(struct request_queue *q, int err)
  - If the resume succeeded then set q->rpm_status to RPM_ACTIVE
    and call __blk_run_queue, then mark last busy and autosuspend.
    Otherwise set q->rpm_status to RPM_SUSPENDED.

The idea and API is designed by Alan Stern and described here:
http://marc.info/?l=linux-scsi&m=133727953625963&w=2

Change-Id: I486612af79c7887116f70a4fde552c107f7fa360
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Git-commit: 6c9546675864f51506af69eca388e5d922942c56
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
block: implement runtime pm strategy

When a request is added:
    If device is suspended or is suspending and the request is not a
    PM request, resume the device.

When the last request finishes:
    Call pm_runtime_mark_last_busy().

When pick a request:
    If device is resuming/suspending, then only PM request is allowed
    to go.

The idea and API is designed by Alan Stern and described here:
http://marc.info/?l=linux-scsi&m=133727953625963&w=2

Change-Id: If9c8332164afba6aeca984277e3398008ad9c45a
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Git-commit: c8158819d506a8aedeca53c52dfb709a0aabe011
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
scsi_pm: resume device if suspend failed

For scsi devices which use scsi bus runtime callback, runtime suspend
will call scsi_dev_type_suspend, and if the drv->suspend failed, the
device will still be in active state. But since scsi_device_quiesce is
called, the device will not be able to respond any more commands.
So add a check here to see if err occured, if so, bring the device back
to normal state with scsi_device_resume.

Change-Id: I9d92645cae9a72da7e3f6d7596d18e5f925109a4
Signed-off-by: Aaron Lu <aaron.lu@amd.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Git-commit: d20ec597cba1e8ea407c9a7c668a9e04fc057c83
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
scsi_pm: use callbacks from dev_pm_ops for scsi devices

Use of pm_message_t is deprecated and device driver is not supposed
to use that. This patch migrates the SCSI bus level pm callbacks
to call device's pm callbacks defined in its driver's dev_pm_ops.

This is achieved by finding out which device pm callback should be used
in bus callback function, and then pass that callback function pointer
as a param to the scsi_bus_{suspend,resume}_common routine, which will
further pass that callback to scsi_dev_type_{suspend,resume} after
proper handling.

The special case for freeze in scsi_bus_suspend_common is not necessary
since there is no high level SCSI driver has implemented freeze, so no
need to runtime resume the device if it is in runtime suspended state
for system freeze, just return like the system suspend/hibernate case.

Since only sd has implemented drv->suspend/drv->resume, and I'll update
sd driver to use the new callbacks in the following patch, there is no
need to fallback to call drv->suspend/drv->resume if dev_pm_ops is NULL.

Change-Id: I08b44d12e480cdbb736a39c8a4a7c7e7e8a42c36
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Git-commit: 80d2fd48cca2a0de806c3130551744a04ad5b80b
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[sthumma@codeaurora.org: resolve trivial merge conflicts]
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>