M2: Port M2-kernel on top of jb_2.5 AU_LINUX_ANDROID_JB_2.5.04.02.02.40.171

Squash the following:

Initial board files and mach-type

going through board file - doesnt compile

HACK:remove otg calls from board file - need to bring them back later

add i2c defines

update samsung max17040 battery driver from cyano

msm/Kconfig: add another select for M2; will remove these in time and adjust d2spr_defconfig appropriately

Add bmp180 pressure driver

power_supply.h: more defines

board*m2: otg: HACK: return a sane value/remove non-existing field

m2_spr:pn544 fix return type; err_ldo_gpio_set_dir remove unused label

m2spr: HACK remove irrelevant touch device causing compilation problems

M2_SPR: rpm: use 8960 pdata

M2_SPR: no more sleep stats in 3.4

M2_SPR: int = null doesnt really make sense does it

M2_SPR: no QDSS devices for now

M2_SPR: no msm governor; if needed the commit is a4d6f11f348d2303f79049404b2101d1f62f40f4

M2_SPR: bring in msm governor after all no idea whats done on probe here

M2_SPR: q6 modem subsystem, new device registration per board-8960

M2_SPR: clock fixup - MAJOR DERPING opportunity

M2_SPR: gfx_init from board-8960; remove cpu_idle device per c1ed66c9035b4fbf240e46837d86a9a6442531f1

pm8xxx: Samsung defines

M2_SPR: rpmrs_levels init as in board-8960

Missing defines and drivers

M2_SPR: new acpuclk init; TOUCHSCREEN additions; swfi_latency for android_usb rathern than otg

M2_SPR: Makefile derp - more things to compile

M2_SPR: cpuidle set_states has been moved into driver per 42da9d2634a6e0d335e81a72d77dc606669ae022

M2_SPR: if 0 unused items in m2_sprc.c; add missing define in 8960.h

M2_SPR: msising defines + gpiomux if 0 unneeded

M2_SPR: out of board files; compilation fixes benign

M2_SPR: drivers: adding files + cleanup

M2_SPR: battery: derping-opportunity in i2c_write

M2_SPR: drivers/power: fixups benign

M2_SPR: drivers/video/msm compilation fixes mostly benign

M2_SPR: video/msm: no more idle wake locks; change to pm_qos requests as in 2fcabf92eea31cad2ec4852dcab563f2c93e4294

M2_SPR: switch to board-m2_spr-display (copy from 8960-display).  Too
much samsung crap in there to port it statement by statement.

M2_SPR: drivers/video: compilation fixes; minor derping poss (where else do we need pinfo->width pinfo->height?)

M2_SPR: mostly benign video compilation fixes; (new) camera (requirements) added to defconfig)

M2_SPR: board-m2spr: set_rpm_wakup_irq: this is no handled in devices-8960 via irq_wakeup=

M2_SPR: board-m2: footswitch device name change

M2_SPR: devices-8960: add msm_i2s_cpudai0 and *1 devices; DERP-ing possibility: how does this compare with cpudai_slimbus_2_rx(tx) see board-8960

M2_SPR mdp4_util missing stuff; benign

M2_SPR: hdmi DERP-ing opportunity; samsung mhl_v2 doesnt really conform to current hdmi code

M2_SPR: add drivers/battery and drivers/sensors

M2_SPR: init/main add poweroff_charging; Do we need it in msm_fb.c as well?

M2_SPR: pm8xxx compilation fixes; benign

M2_SPR: sec_misc: comment out sec_debug functions DERP-ing opportunity

sound/soc: wcd missing defines - need more?
DERP-ing opportunity

M2_SPR: defconfig: missing options - it compiles!

M2_SPR: re-implement ram-console to use persistent ram

M2_SPR: 8960-display revert any changes we made (we have a new display file for m2_spr)

M2_SPR: benign ifdef/compilation changes (make sure we can compile other boardfiles too)

M2_SPR: drivers/hwmon: properly ifdef our changes

M2_SPR: devices-8960: benign ifdef our changes

M2_SPR: low level debugging

M2_SPR: remove CMA/MSM_IOMMU/GPU_SYNC(dirty); bring back original reserve_ion

M2_SPR: add more low level debugging prints current failure local_flush_tlb_all

M2_SPR: defconfig: disable memory strict RWX while debugging

M2_SPR: defconfig: Add MEMBLOCK_NODE_MAP (substitute for ARCH_POPULATES_NODE*); Add SPARSEMEM, HOLES_IN_ZONE

M2_SPR: move debugging console to bb705*; HACK: mmu: disable clearing pmd under MODULES_VADDR - otherwise we lose our debugging console - this WILL break things

M2_SPR: board-m2*: fix init irq; remove debugging checks (we are past
those)

M2_SPR: change ram_console address; register early (IT WORKS!) remove duplicated socinfo_init

M2_SPR: add/remove various debugging prints

M2_SPR: bring in m2_spr-regulator

M2_SPR: 8960-pmic: sec additions

M2_SPR: board: gic ppi manual trigger no longer needed (see 1e52e43443009e7ee0c0afab603e71f5d532d7c4 in msm-3.0)
Also bring adjust_ion_secure from board-8960
Also bring in spm data from board-8960
Also bring in tz_retention_flag adjustment from board-8960

M2_SPR: remove ALL low-level debugging prints/ram_console is functional

M2_SPR: board: add qseecom device

M2_SPR: Kconfig: select LPASS/MODEM_QDSPSV4

M2_SPR: ram_console: console_verbose()

M2_SPR: msm_bus: add debugging print

M2_SPR: drivers: hush some warnings

M2_SPR: board: kgsl devices now registered in gfx_init

M2_SPR: spr-regulator.c: add consumer mapping; need to reconsider switching back to 8960-regulator

M2_SPR: regulator: more changes

M2_SPR: register msmgpio device (new format for this in 3.4)

M2_SPR: board*: no gov_device afterall

M2_SPR: board: tabl_i2c_*_data needs explicit regulators (not hardcoded anymore); use proper structs if we are to couple with wcd9xxx driver

M2_SPR: add drivers/cypress_236

M2_SPR: Kconfig: select REGULATOR_MSM_GPIO

M2_SPR: back to original 8960-regulator; mod with m2 additions; DERP-ing opportunity

M2_SPR: m2_spr-pmic; bring in leds-pm8xxx-m2; samsung really did a number here

M2_SPR: otg additions; not done here, more might be needed

M2_SPR: usb: BUGFIX: oh google

M2_SPR: gadget/android: BUGFIX ctd

M2_SPR: video: add debugging

M2_SPR: arm/mm/fault: bionic cant dabrt

M2_SPR: leds fixup (compiile new pm8xxx-m2)

M2_SPR: cleanup from msm-3.4-dev; DERP-ing opportunity(esp in msm_otg); vsync fires though!

M2_SPR: video: no footswitch (as in 3.0) <- possibly unncessary

M2_SPR: WIP: camera sensor

M2_SPR: add m2_spr-camera.c: was 8960-camera in 3.0

M2_SPR: m2_spr-camera: delete ifdefs for non d2 devices

M2_SPR: board* more cleanup

M2_SPR: media/video/msm_zsl from 3.0

M2_SPR: legacy camera fixups: bunch of hacks; compiles but hard reboot upon starting camera service

M2_SPR: fix thermal - new init sequence in 3.4

M2_SPR: video/msm: quiet down debugging

M2_SPR: sound: Add d2 files

M2_SPR: msm/msm8960-d2 3.4 fixups; DERP-ing opportunity: register only i2c dais (no slim)

Looking at 3.0, slim codecs aren't even getting probed

M2_SPR: Disable pmem_audio devices

M2_SPR: regulator: make audio regulators accessible

M2_SPR: audio: make audio related clocks accessible

M2_SPR: sound/msm8960-d2: clock fixup - benign

M2_SPR: board*: remove audio slimbus devices; irrelevant

Revert "ASoc: msm: Increase default buffersize to 4k for audio playback"

This reverts commit 3449f7b315ae563569f41ef2d1a0edc9b7c999e8.

M2: add d2vzw support

M2_SPR: gpio_keys: compile gpio_keys_sec; Home/Vol Up/Down rocker should work

M2: add vibrator

M2: sound/*/codecs/wcd*: some fixups to match msm8960-d2

M2: sound: regulator: make more regulators easily accessible; board_m2*: increase audio ion heap

M2: sound: add debugging prints

M2: Audience a2220 (Nothing newer than (c) 2009 HTC?)

M2: board: add restart function in machine description

M2: configs: unset WCNSS_CORE; remove PRE_ALLOC carryover from msm-3.4

Almost ready to re-generate defconfigs.

M2: fwd-port our old bcmdhd drivers and fixup board files to make them work.

M2: @bluetooth - ohai!

M2: ipc_socket: gps fix:

Too much paranoia never a good thing - gps is functional

M2: video: clocks: make sure set_rate is called before enable

(benign, should get rid of some warning stacks on boot)
Also use correct rate for esc_clk (incorrect value fro msm-3.4 branch)

M2: wakelock: enable suspend debugging prints

Looking for active wakelocks here.

M2: otg: fixup suspend/resume

The change in init_sm is needed because

wait_for_completion(&pmic_vbus_init);

blocks the init thread (and the otg wakelock taken out on probe is never
released).  Also make sure FSA9* toggles
msm_otg_set_vbus_state both on plug-in as well as plug-out.

Should be actually suspending now.

M2: audio: fix some things I broke when porting (BT related)

M2: max8952: from 3.0 (camera related regulator control)

M2: camera: un/prepare clocks before enable/disable (get rid of warning stacks)

M2: clocks: make camera related clocks accessible

M2: bugfix: Fix a kernel bug causing ioctl mismatches in the media
layer.

Thanks to jonpry for finding the root of the problem.

M2: header file fixup: bring in MSM camera headers in include/media from 3.0

Otherwise, there would be no end to ifdefs.  Adjust headers elsewhere,
as needed.

M2: force evt->id=subscription->id=0; Our userland blob doesnt know about ids yet

M2: HACK: media: Comment out a failing check during QBUF

This check is not present in 3.0 -> if it were, it would fail there as
well (I tried this).  Need to figure out why it fails.

M2: msm_wfd: compile

This is compiled in 3.0.  No idea why we would need it.

M2: Makefile: bring back "treat warnings as errors"

M2: compilation warning fixes; benign

M2: vidc firmware download address to a sane value

Compare to PIL_FW_BASE_ADDR in drivers/video/msm/vidc in 3.0.

M2: camera: mach/camera.h from 3.0 as well; adjust headers elsewhere

M2: camera: s5c73m3: fix my derp in antibanding settings (50/60HZ mismatch)

M2: camera/vfe: request footswitch regulator using consumer supply name (benign)

No functional change

M2: add debug: print the footswitch on enable/disable

M2: clocks: access to correct clock for front camera driver

M2: mmc: Fix sdcc.4 suspend/resume handling

Was causing bus failures on resume, resulting in hard resets when coming
out of suspend with WiFi on.  This is present in older msm
kernels before they went with their built-in wifi solution (and used broadcom cards).

M2: Squashed set of commits from invisiblek

M2_VZW: fix rotation

I must have been sleeping when I derped this

M2: General cleanup and commonize common board files

Cleaned up the board files to be more similar (easier to diff)
Commonized the the common board files and created CONFIG_MACH_M2 to
enable them.

M2: add d2att/d2tmo, d2-r530 variantes and d2cri

M2: defconfig: finally, new defconfigs

M2: otg: Make sure the otg state machine workqueue is scheduled on first un/plug

Fixes having to re-plug initially to get gadget started.

msm: rotator: sync point support

Wait for fence before do rotate
Put the fence and fd after fence is signaled

(cherry picked from commit 78c7b6971a12a541c7bd55cb4998bf1bf285609e)

*detule: Rotator rendering support was failing (in particular when playing HD videos
without HW support) because of the ioctl mismatch (see struct
msm_rotator_data_info in MSM_ROTATOR_IOCTL_ROTATE).  Even though I dislike the way this sync pt
framework is implemented in the video layer, commit the entire patch
rather than just changing the size of the data structure so that the
IOCTL's match.

Change-Id: Ia9092a9d19e5c8390a05cef7bdf908732bbbf8d6
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>

M2: HACK: better camera hack

M2: ion: ioctl compatibility with userland using old api

As far as I can tell, flags passed by userland are now used to determine
buffer caching.

Note in ION_IOC_ALLOC_COMPAT we are currently forcing uncached buffer
allocations (needed to make a choice here).  This
may need to change.

M2: hardboot: Squash set of commits by mkasick

M2: rebase fixups

Conflicts:

	include/media/msm_camera.h
	include/media/msm_isp.h

M2: defconfig: update non-spr defconfigs.
M2: video: fix panel flicker introduced in rebase (CAF you cant sabotage us)

Problem was introduced in
Revert "mako: debug: disable lge_crash_handler"
M2: Revert "msm: display: sync point clean up"

Can't do these header changes while userland lags behind us

This reverts commit 3e3ba5ffc92a6a831b144ee151665751355ae530.

Conflicts:

	drivers/video/msm/msm_fb.c
	drivers/video/msm/msm_fb.h
	include/linux/msm_mdp.h
M2: Revert "msm: display: Add data stuctures for MSM8974 target support"

Can't do these header changes while userland lags behind us.

This reverts commit d262b5e923284c66f79d8d7623223250058a5bea.
M2: Revert "msm: vidc: Add a check for separate metadata buffers"

Userland lags with metadata commits.

This reverts commit 3883780c95fb50a2c1c24c748a4411c55f409f9c.
M2: Revert "msm: vidc: Separate meta buffers support in secure mode"

Userland lags with metadata commits.

This reverts commit eb8179b17b0d31ab9ab4605bf4842acb30058102.

Conflicts:

	drivers/video/msm/vidc/1080p/ddl/vcd_ddl.c
Revert "Fix warnings."

This reverts commit 6f2cc2f541ea696aa6ba81520eec2ede461c03b9.
Merge remote-tracking branch 'origin/jb_2.5-171' into jb_2.5-163-mine
Revert "Revert "Fix warnings.""

This reverts commit cd0dd4fb57c37da6407f561d52b28a916400c6f6.
M2: fix restart to download mode (thanks to aerovan)