msm_serial_hs: Fix the wrong register offset Macro usage

In the msm_hs_tx_empty() API, accessing wrong register offset
macro UARTDM_SR_ADDR.This leading to the unexpected issues
The right register offset macro is UART_DM_SR.
Also the msm_hs_request_clock_off() API is accessing wrong
register macro UARTDM_IMR instead of UART_DM_IMR.

This patch places the right macros at respective points.

Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: LaboDJ <jacopolabardi@gmail.com>
msm_serial_hs: Add IPC Logging

This patch enables IPC Logging in the high speed UART driver.
The logs are available under sysfs. Log level can be changed by
changing the mask provided in /sys/module.
This patch prints UART Registers while
1)Port Open
2)Port Configuration
3)Rx/Tx Flow
4)Handling ISR and
Prints Tx/Rx Data and Count

Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: LaboDJ <jacopolabardi@gmail.com>
msm_serial_hs: Fix register access issue

Crash is seen in the dump_uart_hs_registers()
function due to improper array offset passed to
access the registers. This patch corrects the
array index during the register access.

Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: LaboDJ <jacopolabardi@gmail.com>
msm_serial_hs:Enable Error/Break Char off

Follow the hardware sequence of enabling
RX_ERROR_CHAR_OFF and RX_BREAK_ZERO_CHAR_OFF in
MR2 register, for not allowing the Break and
parity/frame Error characters into Rx FIFO.

Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: LaboDJ <jacopolabardi@gmail.com>
msm_serial_hs: Initialize tty_flush_recieve while Port Open

Initialize the tty_flush_recieve to default value during
Port Open to avoid a corner case where Tx bytes may get queued
twice by UART in the absence of initialization.

Corner Case:
UART client calls uart_flush_buffer() API to flush the
data on Tx while UART Tx is in middle of operation.
If client immediately calls UART Port close followed by UART Tx
after Port-Open, it may result in queueing same bytes twice

Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: LaboDJ <jacopolabardi@gmail.com>
msm_serial_hs: Disable RX PIPE before sps_disconnect

We need to disable RX PIPE interrupt to avoid any
race condition between sps_disconnect and bam_isr

Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: LaboDJ <jacopolabardi@gmail.com>
msm_serial_hs: Dynamic allocation of port structures

This patch allocates the msm_hs_port structures
dynamically during probe and cleans up during exit.
The msm_hs_get_uart_port function now looks up the
uart_state data structure to find the right uart_port.

Signed-off-by: Naveen Kaje <nkaje@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: LaboDJ <jacopolabardi@gmail.com>
msm_serial_hs: Implement driver functionality to be closer to HW spec

Implement TX callflow to be in accordance with HW spec and make
sure TXEMT clock off logic is correct. On receiver side, issue
force stale interrupt and make sure upper layer get bytes upto
size of RX buffer

Signed-off-by: Naveen Kaje <nkaje@codeaurora.org>
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: LaboDJ <jacopolabardi@gmail.com>
msm_serial_hs: Defensive checks

Add defensive checks in the APIs exposed to clients
and tty layer to avoid unclocked access

Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: LaboDJ <jacopolabardi@gmail.com>
msm_serial_hs: Cleanup

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: LaboDJ <jacopolabardi@gmail.com>
msm: watchdog-v2: use request_mem_region instead of request_region

Use request_mem_region api to request for allocating io resource in place
of request_region since the resource is actually not an io port resource
but io memory.

Signed-off-by: Aparna Das <adas@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: LaboDJ <jacopolabardi@gmail.com>
qcom: watchdog-v2: Update last_pet during the suspend and resume

Currently last_pet time is not getting modified during the device
suspend and resume. Hence update last_pet variable accordingly.

Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Ramesh Gupta Guntha <rggupt@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: LaboDJ <jacopolabardi@gmail.com>
common: make cpaccess module code writeable

cpaccess has self-modifying code. This does not work when
CONFIG_DEBUG_SET_MODULE_RONX is set and cpaccess is built
as a module, because the text section is marked not writeable.
Call mm function to make the modified instruction writeable.

Change-Id: I317ab55cd6bdceae429ad89629818ab5f7f99599
Signed-off-by: Neil Leeder <nleeder@codeaurora.org>
Signed-off-by: LaboDJ <jacopolabardi@gmail.com>
cpaccess: remove use of set_get_l2_indirect_reg()

cpaccess is the only client of set_get_l2_indirect_reg(), a special-
purpose API for writing an indirect Krait CP15 register and reading
back the new value. For simplicity, this API is being removed and
replaced with bacl-to-back calls to set_l2_indirect_reg() and
get_l2_indirect_reg(), which should perform comparably.

Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: LaboDJ <jacopolabardi@gmail.com>
drivers/staging: Configurable android log buffer sizes

Purpose is reduce the buffer size accordingly and observe savings
in the total kernel static size, which is useful for
memory constrained devices.

Signed-off-by: Bhargav Upperla <bhargavuln@codeaurora.org>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: LaboDJ <jacopolabardi@gmail.com>
Enable proprietary charger detection (e.g. iPhone/iPad charger) and treat it as AC power source.
Remove unnecessary input current limitation in fast charge.
The fast charge patch changes SDP input current to 1500mA. Then it was limited to 1200mA here.
Additionally, this limits CDP and DCP (AC charger) input current to 1200mA in fast charge mode, where with it disabled it defaults to 1500mA with option to go up to 2000mA for high power AC adapters.
cpufreq: interactive: Honor changed minimum frequency

This saves a few cycles in the timer routine.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: interactive: Use parts of native boost routine

Not all governors are created equal. Set boostpulse_endtime
and floor_freq to smoothen the timer routine.

[franciscofranco] removed boostpulse_endtime from the
original commit because I'm not using it.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
cpufreq: interactive: Use frequency dependent per cpu timings

This allows in-depth testing of the timer routine.

[franciscofranco] made some structural changes to compile on top
of my governor changes. Functionality was not changed.

Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>