ARM: AM43XX: hwmod: build in omap2xxx/3xxx ipblock data

This is referenced from the base AM43xx hwmod data by DSS hwmods, and
because of this, the build currently fails with AM43XX only build.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Cc: Darren Etheridge <detheridge@ti.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Darren Etheridge <detheridge@ti.com>
Merge branch 'audio-display-ti-linux-3.14.y' of git://git.ti.com/~darrene/ti-linux-kernel/audio-display-linux-feature-tree into ti-linux-3.14.y

TI-Feature: audio-display
TI-Tree: git://git.ti.com/~darrene/ti-linux-kernel/audio-display-linux-feature-tree.git
TI-Branch: audio-display-ti-linux-3.14.y

* 'audio-display-ti-linux-3.14.y' of git://git.ti.com/~darrene/ti-linux-kernel/audio-display-linux-feature-tree:
  ARM: AM43XX: hwmod: build in omap2xxx/3xxx ipblock data

Signed-off-by: Dan Murphy <DMurphy@ti.com>
Merge tag 'v3.14.19' of http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into ti-linux-3.14.y

This is the 3.14.19 stable release

* tag 'v3.14.19' of http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable: (114 commits)
  Linux 3.14.19
  KEYS: Fix termination condition in assoc array garbage collection
  KEYS: Fix use-after-free in assoc_array_gc()
  libceph: gracefully handle large reply messages from the mon
  vfs: fix bad hashing of dentries
  drm/nouveau: Bump version from 1.1.1 to 1.1.2
  IB/srp: Fix deadlock between host removal and multipathd
  mtd: nand: omap: Fix 1-bit Hamming code scheme, omap_calculate_ecc()
  mtd/ftl: fix the double free of the buffers allocated in build_maps()
  CIFS: Fix wrong restart readdir for SMB1
  CIFS: Fix wrong filename length for SMB2
  CIFS: Fix directory rename error
  vfs: add d_is_dir()
  CIFS: Fix wrong directory attributes after rename
  CIFS: Possible null ptr deref in SMB2_tcon
  CIFS: Fix async reading on reconnects
  CIFS: Fix STATUS_CANNOT_DELETE error mapping for SMB2
  libceph: do not hard code max auth ticket len
  libceph: add process_one_ticket() helper
  libceph: set last_piece in ceph_msg_data_pages_cursor_init() correctly
  ...

Signed-off-by: Dan Murphy <DMurphy@ti.com>
ti_config_fragments/connectivity: Enable PCIe RC

Enable PCIe in connectivity config fragments.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Input: atmel_mxt_ts: remove chip reset during resume

Upstream commit 9d469d033d13 ("Input: atmel_mxt_ts - use
deep sleep mode when stopped") removes reset of touchscreen
chip during resume calling it "counterproductive" and "resulting
in a long delay".

During testing on TI DRA7x EVM, this chip reset is seen to result
in large stream of "__mxt_read_reg: i2c transfer failed (-121)"
messages due to an interrupt occurring while the chip is in
reset (why the touchscreen interrupt triggers is still unknown).

Remove chip reset during resume like upstream code.

Power consumption should remain the same before and after this patch
as we only remove reset from resume and do not touch suspend path (which
incidentally does not issue a reset).

Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
ti_config_fragments/connectivity.cfg Enable GPIO based EXTCON

Enable EXTCON GPIO for ID pin detection in DRA7x

Signed-off-by: George Cherian <george.cherian@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
usb: dwc3: core: only reset res->start in case of error

[ Upstream commit 28f17ad6a24700b7b2594988740cee0347028713 ]

That trick is only needed if we end up with an error, so
there's no point in messing that outside of an error path.

In fact doing so causes problems when removing dwc3.ko,
problems which commit c5a1fbc (usb: dwc3: dwc3-omap: Fix
the crash on module removal) mistakenly tried to fix.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Tested-by: Aparna Balasubramanian <aparnab@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
usb: dwc3: gadget: Fix desc NULL pointer in dwc3_gadget_ep_queue()

[ upstream commit fdee4ebac96bb44c9c488fdd830b7cc831cd295d ]

dep->endpoint.desc is checked at the beginning of
dwc3_gadget_ep_queue(), but after that it may be set to NULL
by another thread and then accessed again in dwc3_gadget_ep_queue().
This will lead to kernel oops.

Expand spinlock protection area to aviod race condition.

Signed-off-by: Zhuang Jin Can <jin.can.zhuang@intel.com>
Signed-off-by: Jiebing Li <jiebing.li@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Tested-by: Aparna Balasubramanian <aparnab@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
mtd: mtd_oobtest: generate consistent data for verification

[ Upstream commit be54f8f1c76890f4b6163715aed5a3d0a7309dc2 ]

mtd_oobtest writes OOB, read it back and verify.  The verification is
not correctly done if oobsize is not multiple of 4.  Although the data
to be written and the data to be compared are generated by several
prandom_byte_state() calls starting with the same seed, these two are
generated with the different size and different number of calls.

Due to the implementation of prandom_byte_state() if the size on each
call is not multiple of 4, the resulting data is not always same.

This fixes it by just calling prandom_byte_state() once and using
correct range instead of calling it multiple times for each.

Reported-by: George Cherian <george.cherian@ti.com>
Reported-by: Lothar Waßmann <LW@KARO-electronics.de>
Tested-by: Lothar Waßmann <LW@KARO-electronics.de>
Cc: George Cherian <george.cherian@ti.com>
Cc: Lothar Waßmann <LW@KARO-electronics.de>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: linux-mtd@lists.infradead.org
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Merge branch 'connectivity-ti-linux-3.14.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel into ti-linux-3.14.y

TI-Feature: connectivity
TI-Tree: git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel.git
TI-Branch: connectivity-ti-linux-3.14.y

* 'connectivity-ti-linux-3.14.y' of git://git.ti.com/connectivity-integration-tree/connectivity-ti-linux-kernel:
  mtd: mtd_oobtest: generate consistent data for verification
  usb: dwc3: gadget: Fix desc NULL pointer in dwc3_gadget_ep_queue()
  usb: dwc3: core: only reset res->start in case of error
  ti_config_fragments/connectivity.cfg Enable GPIO based EXTCON
  Input: atmel_mxt_ts: remove chip reset during resume
  ti_config_fragments/connectivity: Enable PCIe RC

Signed-off-by: Dan Murphy <DMurphy@ti.com>
Merge branch 'platform-ti-linux-3.14.y' into pm-ti-linux-3.14.y

Conflicts:
	arch/arm/boot/dts/dra72x.dtsi
	arch/arm/boot/dts/dra74x.dtsi

Signed-off-by: Tero Kristo <t-kristo@ti.com>
ARM: OMAP2+: AM43XX: Add PRCM int16 as the wake up source

Add PRCM int16 as the wake up source.

Signed-off-by: Keerthy <j-keerthy@ti.com>
ARM: OMAP4+: PRM: fix omap4 version of prm_save_and_clear_irqen

This was incorrectly saving the irq status registers, instead of the
irq enable.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
ARM: OMAP4: PRM: Add nr_irqs check to extend support to single core SOCs.

Add nr_irqs check to extend support to single core SOCs.

Signed-off-by: Keerthy <j-keerthy@ti.com>
ARM: OMAP4: PRM: Remove hardcoding of PRM_IO_PMCTRL_OFFSET register

PRM_IO_PMCTRL_OFFSET need not be same for all SOCs hence
remove hardcoding and use the value provided by the omap_prcm_irq_setup
structure.

Signed-off-by: Keerthy <j-keerthy@ti.com>
ARM: AM43XX: PRM: Add IO Wake up support

Add IO wake up support. The patch reuses the omap4 based
IO wake up support and enables the same on AM43XX.

Signed-off-by: Keerthy <j-keerthy@ti.com>
ARM: OMAP2: sleep43xx: Use correct address for MPU Clockdomain

Patch 95306a5: ARM: OMAP2: sleep43xx: Set MPU Clockdomain to HW_AUTO
after suspend attempted to set MPU clockdomain to HW_AUTO but was
writing to the virtual address rather than physical address after
resume. Correct code to use physical address as the MMU has not yet been
turned on.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
remoteproc: wkup_m3_rproc: Move aux_data region

Move auxdata region in wkup_m3 dmem to take over first 0x100 bytes of
logbuf region. Otherwise i2c sequences get overwritten occasionally.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
cpufreq: cpufreq-cpu0: Use cpufreq_generic_suspend()

Use suspend support present in cpufreq core to set suspend frequency
and configure suspend frequency to first defined OPP.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
ARM: OMAP2: pm33xx: Fix race condition between cpuidle and suspend

CPUIdle does not get disabled until noirq suspend, but am33xx_pm_enter
is called early in the suspend sequence, which configures the wkup_m3
for deep sleep before waiting for the m3_irq2 interrupt. On AM43xx, this
interrupt is triggerred by a WFI instruction with MPU clockdomain set to
HW_AUTO and SCU set to low power state, which is the same condition present
in cpuidle state.

If system attempts to enter cpuidle c-state during
suspend path (happens very rarely) the system will hang because it will
gate the MPU clock and pass control to wkup_m3 which attempts to put
system in DeepSleep when it is not actually prepared.

By using cpu_idle_poll_ctrl we can prevent cpuidle from entering
c-states during the suspend path and prevent this hang. Also useful on
AM33xx to prevent suspend from failing without a hang due to cpuidle
reconfiguring the wkup_m3 during suspend for mpu pll bypass only rather
than deep sleep.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>