rpmsg: omx: return actual user-provided bytes written in write

rpmsg: omx: return actual user-provided bytes written in write

The 'write' system call is expected to return the number of bytes
written back to userspace. The rpmsg omx driver adds a small packet
header when sending a message to the remote processor, and is
currently returning this header length as well in the driver's write
fop function. This results in the write call always returning more
bytes than what the user has requested. The header length is now
left out of the bytes returned back.

Change-Id: I7132001fbc6fb34d01913bb3c30f455626c91658
Signed-off-by: Suman Anna <s-anna@ti.com>
rpmsg: omx: copy_from_user() errors should return -EFAULT

rpmsg: omx: copy_from_user() errors should return -EFAULT

Change-Id: Ib4a2d92dd3b8afa18e60019871cfea2e6b446a4d
Signed-off-by: David Schleef <ds@ti.com>
rpmsg: omx: return ENXIO in rpmsg_omx_write

rpmsg: omx: return ENXIO in rpmsg_omx_write

The error code, ENXIO is used in rpmsg_omx driver to indicate
a terminal error on the remote processor side. This status is
maintained during the recovery of the remote processor, while
the cdev gets reinitialized/recreated.

The rpmsg_omx's write file operation is currently not returning
this error. This has been added now to have it behave in the
same way as the read file operation.

Change-Id: I61d6e6c07aa39208d913da622ed32d809c51d409
Signed-off-by: Vidhoon Viswanathan <vidhoon@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
rpmsg: omx: fix copy_to_user in register/unregister ioctls

rpmsg: omx: fix copy_to_user in register/unregister ioctls

The ION fd registration and deregistration ioctls has the
arguments reversed in the copy_to_user() calls. The same
has been fixed.

Also included a minor additional case for returning a NULL
ION handle back to user-space.

Change-Id: I9d45957f9b913fa1775e70618f0da82e914a41d6
Signed-off-by: Tyler Luu <tluu@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
rpmsg: omx: send disconnect only if omx state is connected

rpmsg: omx: send disconnect only if omx state is connected

The rpmsg_omx driver sends a disconnect message automatically when the
driver's .release is called. This should be done only if a connection
has been established, otherwise just destroy the local end point.

Change-Id: I21b84aa6d91ae0d456f49cbe958f8e64caf691d5
Signed-off-by: Miguel Vadillo <vadillo@ti.com>
rpmsg: omx: initialize completion event in rpmsg_omx_open

rpmsg: omx: initialize completion event in rpmsg_omx_open

An omx object is created when opening the rpmsg-omx device. However
the "reply_arrived" completion event is not initialized until the
connection message is sent across.

When the rpmsg_omx driver is removed (like in recovery), all pending
threads waiting on the "reply_arrived" are unblocked by a complete_all
call, however, if the rpmsg-omx device was only opened, such event is
not initialized yet, so the complete_all call will dereference a null
object causing a panic.

This patch moves the initialization of the "reply_arrived" completion
event to the open call, after the allocation of the omx object.

Change-Id: I92cf9cf5ac748456cb43bedc88fe1a8d80addd6c
Signed-off-by: Juan Gutierrez <jgutierrez@ti.com>
fs/fat/dir.c:43: warning: 'de' may be used uninitialized in this function

The complexity of the code flow makes this seem possible.  Initialize
the value to NULL to eliminate the compiler warning.  This only masks
the warning, since if the value were unused, there would still be a
NULL pointer.

Change-Id: I9fc36abace09409853b63e0997328b75ce703769
Signed-off-by: David Brown <davidb@codeaurora.org>
rpmsg: omx: add return values to the pa to da convert function

This patch adds return values to the pa to da conversion function.
This will help in propagation of proper error codes to the calling
functions.

Change-Id: Ie547f7b7e7c51eff4b7998cbd336a61663995708
Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
rpmsg: omx: re-work buffer lookup to support contiguous NV12

SGX544 requires Y and UV to be contiguous in SGX virtual address space. This
is done by using single FD for two ion handles.

Change-Id: I33ced876905d74e6293a2c32df0612f01a23d13f
Signed-off-by: Hemant Hariyani <hemanthariyani@ti.com>
Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
rpmsg-omx: tiler_virt2phys called for 1D buffers

While migrating to the new PVR APIs, the changes caused
a the tiler_virt2phys to be bypassed in case it is not
a PVR buffer. This patches fixes the issue

Change-Id: I9a3353053d58a7bc0ef89012de46534fad5f4b88
Signed-off-by: Subramaniam C.A <subramaniam.ca@ti.com>
Signed-off-by: Tate Hornbeck <tate.hornbeck@ti.com>
rpmsg-omx: Use ion abstraction to get handle from PVR fd

PVRExportFDToIONHandles was being called directly by rpmsg-omx.
This is now abstracted by ion and drivers should use
omap_ion_fd_to_handles instead.

Change-Id: I2f750887a048eb3d9cd28cdc9c4b08eb3e83e31b
Signed-off-by: Hemant Hariyani <hemanthariyani@ti.com>

Conflicts:
	drivers/rpmsg/rpmsg_omx.c
rpmsg: omx: implement separate register ioctl for sgx buffers

rpmsg: omx: implement separate register ioctl for sgx buffers

This implements a new register ioctl specifically meant for sgx
buffers. rpmsg_omx clients are expected to call register ioctl
for the specific buffer type (ion or sgx) before sending a buffer
to .write for mapping. The registration allows the rpmsg_omx
driver to hold a reference to the ion buffers making up the sgx
buffer, thereby preventing the buffer(s) to be freed up from
under the remote processor.

The individual imported ion handles are expected to be passed
into the .write call.

When a client no longer expects remote processor to use the buffer,
client should call unregister ioctl. A separate unregister ioctl
for pvr buffers is not created, and the same ion unregister ioctl
is expected to be used for all the ion handles a sgx buffer is
comprised of.

Change-Id: Ib36aab90136627899e98717aeb29bfa637ec09fd
Signed-off-by: Tyler Luu <tluu@ti.com>
Signed-off-by: Suman Anna <s-anna@ti.com>

Conflicts:
	drivers/rpmsg/rpmsg_omx.c
usb: ehci: fix the host wakeup state machine.

usb: ehci: fix the host wakeup state machine.

Current code enables host clocks and disables immediately
which can have side effects if port status change is not propagated
and clocks are cut, so enable clocks if ports are suspended
in all wakeup paths either from io-pad wakeup or through
bus resume in suspend path.

Change-Id: I5a03fcf46160176289d41cda6574c0c261a13e94
Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Ruchika Kharwar <ruchika@ti.com>
omap: Add ION system heap to omap board file

gives ion clients access to system heap for allocation
instead of being restricted to pre-allocated carveouts

Change-Id: I560e7b8cda1b561d737b9c5bc427b5cbf2591731
Signed-off-by: David Schleef <ds@ti.com>
mmc: OMAP HSMMC: DDR support added.

OMAP HSMMC updated to support DDR mode

Change-Id: Ifb8643e264216edf514a7e31ec989316700ee322
Signed-off-by: Viswanath Puttagunta <vishp@ti.com>
mmc: Fix bug to enable DDR on MMC

MMC_CAP_UHS_DDR50 is an SD card feature and not
MMC feature. We don't have to check for this flag
to enable DDR on MMC. Checking for MMC_CAP_1.8V_DDR
is sufficient.

Change-Id: I6f44cb1f4dde6fe70cc816a2119c7b2b90944500
Signed-off-by: Viswanath Puttagunta <vishp@ti.com>
add /dev/hci_tty module for userspace BT in 4.2.1

Change-Id: I50770b39a3f156e70b98c6f338b313af04e6f77d

Conflicts:

	arch/arm/configs/mapphone_maserati_jb_defconfig
	arch/arm/configs/mapphone_solana_jb_defconfig
	arch/arm/configs/mapphone_spyder_jb_defconfig
	arch/arm/configs/mapphone_targa_jb_defconfig

Conflicts:
	drivers/misc/ti-st/Kconfig
	drivers/misc/ti-st/Makefile
DRIVERS: MISC: Add OMAP4430 Static Thermal Policy

Adding Static Thermal Policy for OMAP4430.
Added new driver module to control max opp duty cycle.

Change-Id: I9781f4db19b055eefb0a4bf28bf5f5c516307509
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Eugen Mandrenko <ievgen.mandrenko@ti.com>

Conflicts:
	drivers/misc/Makefile
 temp_control: increase the maximum temperature threshold to 80*C
zimage - SmittyV3.17