qup_i2c: Move to new clock APIs

Replace use of clk_enable() and clk_disable() with calls to
clk_prepare_enable() and clk_disable_unprepare(), respectively.

Change-Id: Ib29b5e4340f1a8cbde85efe3d129470788cbf0cd
Signed-off-by: Harini Jayaraman <harinij@codeaurora.org>

Conflicts:

	drivers/i2c/busses/i2c-qup.c
qup_i2c: Remove Soc specific check while enabling CORE_ON_EN bit

Enabling of CORE_ON_EN bit in qup_i2c driver is not dependent on soc.
Same code will work for all. Hence remove the SOC specific part from the
function.

CRs-Fixed: 335884
Change-Id: I55054b0c17e1710c1d268322f1a78c42c94b3db8
Signed-off-by: Pankaj Kumar <pakuma@codeaurora.org>
qup_i2c: Use clk_prepare, clk_unprepare APIs correctly.

clk_unprepare cannot be called from timer context since the call may
block.

Change-Id: I7decb011031231046c4f0b822b3f47ed086bd7df
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>

Conflicts:

	drivers/i2c/busses/i2c-qup.c
i2c: qup: Add Device tree support for Qualcomm I2C controller

Device tree support is added for Qualcomm I2C controller and
documentation is provided for required and optional device-node
properties.
Slave devices can be added using register_board_info (boards file),
or by listing them as child of I2C of_node in the device tree.

Change-Id: I10e9b8c7805c49dfe6a51975129f1599bbca84eb
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
qup_i2c: Reset QUP before registering for interrupts.

If bootloaders leave a pending interrupt on certain GSBI's,
the driver registers for an interrupt handler during boot up.
The interrupt handler immediately fires because the interrupt was
triggered in the bootloader. The ahb clock is also off at this time,
hence any register writes in the interrupt handler does not go through.
Thus we loop forever in the interrupt handler effectively hanging the
device.

CRs-Fixed: 345805
Change-Id: I5545785142a39f8b78132745e74dfc55a8a5c917
Signed-off-by: Harini Jayaraman <harinij@codeaurora.org>

Conflicts:

	drivers/i2c/busses/i2c-qup.c
qup_i2c: Set the clock rate before enabling the clock.

There is a warning during boot up since the driver
enables the QUP clock before setting its rate. Hence,
make sure clock rate is set for applicable targets to
fix warning.

Change-Id: I249d642f5f14c5ff627c00766f9d399f48f55610
Signed-off-by: Harini Jayaraman <harinij@codeaurora.org>
qup_i2c: set up node before calling of_i2c_register_devices

Device-tree framework for I2C expects adapter of device's
of_node to be initialized before adding I2C slave devices
on the bus.

Change-Id: I64af0b6bafb71ec94ad5acfe3034e9be887ebc47
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
qup_i2c: turn off the ahb clock conditionally

Each GSBI has QUP-I2C and UART cores which can be
used independently. However, the AHB clock is
shared by these blocks. So we keep it on if the
cores are used independently from different processors.

CRs-Fixed: 387908
Change-Id: I84f96cc6dd4873d96437884d18c911e4cf2bfd51
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
qup_i2c: Add runtime PM support to I2C QUP controller

Runtime PM is used to turn clocks on and off when the
controller is not in use. When the controller is used
for messaging, pm_runtime_get_sync is called before
sending the message. pm_runtime_mark_last_busy and
pm_runtime_put_autosuspend are called when message
is sent and/or response is received.

Change-Id: I970def8eb601f7beb8ac256ed1496ddd48ca1257
CRs-Fixed: 406910
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
qup_i2c: Manage gpio configuration from runtime pm

Due to gpio_request and gpio_free calls are made from
multiple places in i2c driver code and can cause erroneous
condition where same gpios are assigned/freed multiple times.

Move the gpio reques/free calls under runtime pm to
manage better.

CRs-Fixed: 432971
Change-Id: Ic44202e0743fa56806a0612243d3b800bad1433f
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
qup_i2c: Set parent device to enable runtime PM support for clients

Register the current device as parent of the adaptor device in order to
allow the client drivers to use runtime PM.  Client drivers can vote to
enable and disable clocks as needed.

Change-Id: Ie2d6b96ab0cbe5af56b4da0f5f18b37d0495e053
Acked-by: Christian Bolis <cbolis@qti.qualcomm.com>
Signed-off-by: Kenneth Heitke <kheitke@codeaurora.org>
i2c_qup: always set rate and log a message when fail

Clock set rate is failing silently when clock rate is not
available. Additionally clock rate is not set when no rate
is specified in platform data. This patch always set the
clock's rate and logs a message if it fails to set rate
or if no rate is set by platfrom data.

CRs-Fixed: 452047
Change-Id: I0551a12ca2861f8e1a48ee344d6ffcf898c96971
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
qup_i2c: Avoid potential panic issue

I2c register access is happening in isr before PM runtime
status check. This can lead to potential hang because of
unwanted interrupts and i2c clocks are off.

Update the i2c driver code to have register access
after PM runtime status check.

CRs-Fixed: 454710
Change-Id: I11a3d8df24c514205203f24be8e08d7c1ea1a7b8
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
Revert "mac80211: fix ibss scanning"

This reverts commit 0771b54704267b8ebcbf1a60fc88e4a306a6e3c2.
Revert "Revert "mac80211: Do not scan for IBSS merge with a fixed BSSID.""

This reverts commit 58e49245ba4864a3f4a9b807e36dbb217ff672cc.
Revert "mac80211: Do not scan for IBSS merge with a fixed BSSID."

This reverts commit 717292575a1dc01ce3219ca57f6feefb280532a7.
msm: msm_bus: Add support for 64-bit bandwidth requests

With 8974, bandwidth requests are exceeding integer size.
Update ab and ib to ensure values over 4Gbps can be requested.
For 64-bit support, there are four changes in this patch:
Changes in the bus driver structures and functions to
update ab and ib values to uint64.
Updates in client drivers to ensure that the bus APIs
are called with the right types.
Updates to the device-tree. Device-tree nodes don't
provide a clean mechanism to read a combination of u32
and u64 variables within the same property name. So, the
ab and ib values must be specified in kbps instead of
bytes/sec from the device tree. The bus driver function
will convert the ab and ib values read from device-tree
to Mbps.
Change the existing property names to make them consistent
with the convention used by the new property  name, which
abides to the Device Tree convention.

Change-Id: Ib0a6db0e221af366c61c51cc21ac722f02cb7a34
CRs-Fixed: 408786
Signed-off-by: Gagan Mac <gmac@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
msm_fb: display: check bus scale handler for registration

mdp bus client could be registered multiple times without the check.

Change-Id: I582741c75e815873357e62bc9bf0ff61a4cecf9f
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm: audio: qdsp6v2: Set end of frame flag to avoid aac multiseek issue

- During aac playback, multiple seek lead to target freeze.
- DSP starts decoding when internal buffer size maximum is
  reached, hence, if there are corrupted frames in that buffer,
  the entire set will not be decoded. This results in target freeze.
- Fix is to set the end of frame flag in the buffers that
  are sent to DSP for decoding.

Signed-off-by: Swaminathan Sathappan <Swami@codeaurora.org>
Change-Id: I0135c64e0ebf50bddddd08d73399f95db6409fbd
msm: audio: qdsp6v2: Fix for jumping to next track when seeked to end

- During tunnel playback, when seek to end of the clip, and then
  seek back to other position, music player jumps to next track.
- When progress bar is dragged to end of the clip or beginning,
  this will invoke fsync function. fsync function waits for WRITE_DONE
  event from DSP. AUDIO_STOP or AUDIO_FLUSH should wake up fsync,
  but this wake up is not happening, as result driver issuing EOS
  cmd to DSP. Causing music player to jump to next track.
- Fix is to wake up the fsync during AUDIO_STOP and AUDIO_FLUSH.

Change-Id: I1f6da57136b7a957861c4f731350c7fa4452f61b
Signed-off-by: Deepa Madiregama <dmadireg@codeaurora.org>