ARM: Align with upstream

Undo our diff from upstream where upstreamed patches were
slightly different or merges introduced duplicate symbols, etc.

Change-Id: Iab263aa3d85b7b8b414b43afd6d70be358e6b7c9
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Remove unrelated sound changes carried forward from msm-3.0

These changes were a merge of a ti sound branch that never got
merged in the same state upstream. Drop the omap and sh changes
that have been carried forward.

Change-Id: I5c15152ebc67a90719e78dcf91d7f70bebf149cf
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
mmc: Undo mmc changes that diverge us from upstream

All this is useless diff from mainline, so undo the changes to
get us closer to mainline.

Change-Id: I782f4ac0f82aabda7a5a0f547982df26e67abe92
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
spinlock_debug: Fix mismerge

This file was mismerged in the 3.4 kernel upgrade. We shouldn't
print the lockup twice.

Change-Id: If09a07d8b6c570632e1abac0a23c3ed203cd3ced
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
msm: clock.h: Fix compile with CONFIG_DEBUG_FS=n

The prototypes for clock_debug_init() differ between the debugfs
on and off case in the type of argument passed. Make them the
same to fix a compile error.

Change-Id: I905b9f1c752e3b419d0a1646b51a6ac1e54cfecc
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
msm: clock: Fix hardware clock gating detection for mdp_axi_clk

clock-debug uses a clock flag (CLKFLAG_HWCG) to determine if a
clock is capable of hardware gating. Unfortunately, recent
changes to clock handoff cause this flag to not always be set.

Take mdp_axi_clk for example. It is a depends of mdp_clk, and so
if mdp_clk is on out of the bootloader, mdp_axi_clk is indirectly
enabled by the clk_prepare_enable() call in __handoff_clk() when
mdp_clk is enabled. We could add support for handing off depends
clocks, but we're planning on removing the depends code and there
isn't a real problem in failing to hand off branches that are
depends since they're hidden from consumers anyway.

The only problem with this scenario is that branch_handoff() is
not called and so mdp_axi_clk is not marked as supporting
hardware clock gating. The clock flag is only used to indicate
support for hardware clock gating, so let's just read the
hardware anytime a users wants to know if the clock has hardware
gating or not.

This changes the semantics of the has_hw_gating file because we
read the hardware instead of returning a cached value and the
state of the hardware changes at runtime (e.g. if the clock is
put into reset hardware gating is turned off). In practice these
clocks aren't switching in and out of hardware gating mode while
a clock test is in progress so the impact of this change is
minimal to zero.

Change-Id: I4f646b1b32b42e3ef00067b47ffb78df8fb761d5
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
msm: hotplug/platsmp: Fix cpu invaldation pointer arithmetic

These functions take two void pointers indicating where to start
and end the invalidation and cache flush. The pointer arithmetic
is considering the pen_release pointer as an int pointer so
adding sizeof(pen_release) is adding 16 bytes to the pointer and
specifying that as the end. This inadvertently invalidates data
next to the pen_release variable which could be bad. Fix the
pointer math to only invalidate or clean the region for the
pen_release variable.

Change-Id: If0cf0e5de7c9f4b8c70662b29957a1f347809124
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
msm: Remove idle stats and cpuidle hooks

Calling RCU functions from within the RCU quiescent state is
illegal and probably a bug. The idlestats code uses an atomic
notifier called from msm_cpuidle_enter() and that atomic notifier
takes an rcu read lock. We could fix this with a raw notifier,
but this code is unused so let's just remove the code entirely.

Change-Id: I319f0eabb56a8721c19a3b2b4bc9a7f416c88384
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
msm: cpuidle: Don't disable irqs again

cpu_idle() disables irqs before calling down into the cpuidle
driver via cpuidle_idle_call(). Disabling irqs again in
msm_cpuidle_enter() is wasteful and unnecessary. It also inhibits
our ability to determine the largest irq latency when the cpu
idles for extended periods of time because the irqsoff trace is
reenabled when the irqs are disabled in msm_cpuidle_enter().

Note that we still reenable irqs before returning, as is required
by the ARM idle loop.

Change-Id: I925478d8fef88ab490959622bc68303f59cc6e79
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
msm: scm-boot: Clarify types for scm_set_boot_addr()

The boot address is a physical address (even if the secure
monitor only considers it to be 32 bits). Move to using
phys_addr_t to clarify this is a physical address and to ease
any support of LPAE in the future. Also make the flags unsigned
so that we can use the highest bit if necessary.

Change-Id: I1aa5ca9cb75ea94b4df72c5a536cf42f73ff8051
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Remove apanic driver

Google has removed this in android-3.4-common, but we haven't.
Remove it from our tree as well.

Change-Id: I01a50a489d15c49b037baaa27a3e05e4005a5e5e
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
ARM: mm: Remove SW emulation for ARM domain manager

8x50 is no longer supported in the msm-3.4 kernel, so remove this
feature.

Change-Id: I2156ef22cca82d3cce6a7d39e366b93cab32f811
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
iommu_domains: Remove duplicate vmalloc include

It's included twice.

Change-Id: I0ae772cd355b6bacaf54f77b856660ebdb9a2a0c
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
usb: Remove android_composite.h

Nobody is using this contents of this header file except for
8x50 boards (which aren't compiled). Remove it.

Change-Id: I45369b687662adf2a17a4fa8d24cdf538c4a7d7d
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
gadget: ci13xxx_udc: Fix duplicate kmalloc and plug leak

A bad merge duplicated this kmalloc and leaks the previous
allocation. Remove the duplicate kmalloc.

Change-Id: I27dccdebaa30786cd302f58614401955bc4eba61
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
usb: msm_otg: Reduce diff with upstream

Try to make this code more similar to upstream. Reduces diff with
v3.4.

Change-Id: I0bf5910b27fdbd8f71e8a05d426689e816cb1b97
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
gadget: android: Undo acm code movement

This code has moved for no reason and causes the android.c diff
to be vastly different from upstream android code. Undo the code
movement to reduce our diff.

Change-Id: I6f10d9538ed358b318c67705c50e631dc945b94f
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
gadget: f_mass_storage: Don't force name to be mass_storage

Google was doing this but then they dropped it and we kept it.
Move closer to google's code and stop doing it.

Change-Id: I6f574de2920a0c3c501fa4d903a3fef108a932b8
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Revert "Bluetooth: Fix sending LE data over USB"

See 9fd481e03c1e9c76c814b88b9ea1cbda9afb0812 (Bluetooth: Allow
ACL packets over USB in HCI_RAW mode, 2011-07-14) for more info
on why this check was dropped.

Change-Id: I0b7134cfafd44a881514548a354832e1a9fb06e3
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
gadget: Fix bad merge in u_serial.c

The put_tty_driver() line is an upstream bug fix that was
mistakenly reverted. The write_started line is also from
upstream, it seems to have been lost during the merge.

Change-Id: I923f48d9b70018828e1541fb6353aa3bdeafe881
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>