Commit Graph

1229 Commits

Author SHA1 Message Date
Duy Truong
04e554807c Update copyright to The Linux Foundation
Change-Id: Ibead64ce2e901dede2ddd1b86088b88f2350ce92
Signed-off-by: Duy Truong <dtruong@codeaurora.org>
2013-03-15 17:07:39 -07:00
Liron Kuch
ab581838dc tspp: Improve GPIO configuration mechanism
The TSPP driver requires using 3 or 4 GPIOs per TSIF instance,
depending on the TSIF operation mode. The driver used to configure
all the GPIOs regardless of TSIF instance and mode.
This commit changes the driver's GPIO configuration mechanism to
take into account the TSIF instance and mode, and use only the relevant
GPIOs. This is required by customers who may now utilize the unused GPIOs
for other purposes.

Change-Id: Ia216f479871e613ca48f73dc63c0a6cdab4dad57
Signed-off-by: Liron Kuch <lkuch@codeaurora.org>
2013-03-15 17:07:36 -07:00
Liron Kuch
787dfa9e95 tspp: support device tree mechanism in the driver
Update the TSPP driver to support using the device tree mechanism
for getting platform-dependent data.

Change-Id: I5ac0f90266c3f30621865cf097db4dba1ee07fc6
Signed-off-by: Liron Kuch <lkuch@codeaurora.org>
2013-03-15 17:07:36 -07:00
Mona Hossain
a572f57b1a qseecom: Check if app exists before loading the app
There is a chance of send a request to QSEE to load an app that
is already previously loaded. Requesting QSEE to load an app
that is already loaded will result in a failure.

Issuing a request to QSEE to check if app already exists before
issuing a request to load it, all within the same app_access_lock
mutex, fixes this issue.

CRs-Fixed: 420473
Change-Id: I5dfb02c7b0f0144d142fc70084ec1e096ada0439
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-03-15 17:06:37 -07:00
Mona Hossain
dc326510ef qseecom: Fix failure to release qseecom handle
qseecom_release() returns a failure, if it is unable to find
app_id of zero, associated with the handle in the app list.

There exists scenarios where the handle may not have the
app_id initialized and remain to be 0.  In these scenarios,
once the uninitialized zero app_id is not found in the list,
it returns a failure.

Fix to this is look for non-zero valid app_id in the app_list when
releasing the handle.

Change-Id: I7b6489526da57cd2106f4aae9fdc0547e7a5fe86
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-03-15 17:06:30 -07:00
Hamad Kadmany
c29c79bb54 tsif: Add option to read TSIF clock reference counter
Reading the current value of TSIF clock reference counter
is required by some application.

Change-Id: I5ca2a280f864fbb9c4a69518ce9672538f9c8489
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
2013-03-15 17:06:27 -07:00
Hamad Kadmany
d1003a1d4c tspp: Add option to read TSIF clock reference counter
Reading the current value of TSIF clock reference counter
is required by some application.

Change-Id: I0fceb46ee50b8c76674ea9b8169e0b31f63fba3d
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
2013-03-15 17:06:27 -07:00
Ramesh Masavarapu
e7651f3cbd qseecom: Remove extra call to disable clock.
Currently the qseecom driver calls qsee_disable_clock_vote() in
the release function. This reduces the reference count during
disabling of the clock and results in turning off the bus clocks
inconsistently.
This change fixes the inconsistency.

Change-Id: I37d048928373f0539da9fee0910fc9a20239c307
Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
2013-03-15 17:06:21 -07:00
Mona Hossain
8f0bf4cc1e qseecom: Add SFAB clock voting in set_bandwidth request
Vote for SFAB clock when requesting to set to crypto high
performance mode.
The SFAB clock needs to be bumped up to its optimal
value when operating in high bandwidth mode (for max
crypto performance)

Change-Id: Ifea68a15d48f737a855acd05e59ac20d4438a9cd
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-03-15 17:05:39 -07:00
Hariprasad Dhalinarasimha
3c8c66f754 qseecom: Fix the kernel_qseecom_client send_cmd fucntionality
Give the correct address of shared virtual buffer
address to be used during start_app.

Change-Id: Iebe10304c9c295c34eb3e1aeba9255e7c91609cc
CRs-fixed: 434753
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-03-15 17:05:39 -07:00
Mona Hossain
9e2fc64f49 qseecom: Remove mutex lock in load_fw API
Loading of app is stuck waiting for lock on app_access_lock
being released.  This mutex is already locked prior to invoking
load_fw.
Removing the mutex lock (already called before invoking load_fw),
in load_fw, fixes the issue with the loading getting stuck.

Change-Id: Ia095bf268c6c1c08dfe1544280567ba4bd4661d6
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-03-15 17:05:38 -07:00
Mona Hossain
4a226f77f3 qseecom: Add API to set bandwidth for CE HW
Add API to allow kernel space clients to bump up
CE clks for improved performance

Change-Id: Iecd13cf4efe9b2b1415be56d3ec9e4dc040918f8
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-03-15 17:05:37 -07:00
Mona Hossain
5e5949c4f1 qseecom: Vote for CE clk before loading image
Add support for setting the Crypto HW to operate in
high bandwidth mode before issuing a request to load
image.

This is needed for better performance when using crypto
HW to authenticate the image before loading it.

Change-Id: Ib976d8227e605b9aad8191c6fe8f1dcc5d28e90e
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-03-15 17:05:37 -07:00
Mona Hossain
2a59c6fb52 qseecom: Add kernel space client support
Add support for kernel space client:
    - add support for starting secure app by kernel client
    - add support for shutting down secure app by kernel client
    - add support for sending command to secure app loaded by
      kernel space client(s)

The above is needed for allowing kernel modules to communicate
with app running in secure domain.

Change-Id: I3ae3a7648714eb7d7f4801b2f8e7cd94b5c64bdf
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-03-15 17:05:36 -07:00
Ramesh Masavarapu
bb3b4e5e55 qseecom: Enable clocks for the Crypto Engine used by Trustzone.
All interactions with secure applications on TZ by non-secure
apps on HLOS need the crypto clocks on.
Without this, simple operations as loading secure apps in
Trust zone fail.

Change-Id: I37097cb401508f7582de014e502f3709170ca6b2
Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
2013-03-15 17:05:36 -07:00
Hamad Kadmany
eb982a04e3 tspp: Allocate from DMA pool for small buffer sizes
dma_alloc_coherent allocates minimum of page size. When
TSPP output buffers are smaller than page size memory
is heavily wasted using dma_alloc_coherent. DMA pools
are designed to handle allocations smaller than page size.

Change-Id: I942cc8cdc9d57ec3b87b14a6601dc4b3e642e7da
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
2013-03-15 17:05:23 -07:00
Mona Hossain
eddbacf20d qseecom: Add SFAB clock voting.
Add SFAB voting in  QSEECOM_IOCTL_PERF_ENABLE_REQ.
The SFAB clock needs to be bumped up to its optimal
value when opearting in high bandwidth mode (for max
crypto performance)

Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
(cherry picked from commit 8e2d73a0ade94ffd27882043d562c7ee825d9f7c)

Conflicts:

	drivers/misc/qseecom.c

Change-Id: I281e544756304f19969afbab7196a227dad0e2b1
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:24:59 -08:00
Ramesh Masavarapu
34e76fb621 qseecom:Fix race condition while voting for clocks
In the current functionality, if DFAB clock is already on and a
request is made to turn on SFPB clock, the DFAB clock is turned
off and SFPB clock is turned on and vice-versa.

The above situation can lead to unexpected errors. The current fix
makes sure that clocks that are on are not voted to be off without
explicit request.

Change-Id: I6c3230e23b105c049cdb0aace579b8a176328c84
Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
(cherry picked from commit 8d7565828aca6023ca968d2e5350737bd6d86215)
2013-03-07 15:24:59 -08:00
Hamad Kadmany
a452cd5bc4 tsif: Add option to inverse tsif signals
TSIF signals (clock, data, enable and sync) may be configured
to be inversed at TSIF unit input. This is useful in case
TSIF signals from external units need to be inversed.

Change-Id: I21a5c8eca73df0f4458c0d035ef8ae90920ea0c5
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
2013-03-07 15:24:16 -08:00
Hamad Kadmany
fff97e7a87 tspp: Disable read-complete interrupt
Read-complete interrupt can be generated from TSPP HW for test
purposes only. It is generated for each TS packet TSPP fetches from
TSIF interface. Having it enabled cause great load of interrupts
that are not used by the SW.

Change-Id: I4eb1be173cb3e30a8540fb17223abc034c54f048
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
2013-03-07 15:24:07 -08:00
Hamad Kadmany
4b31c3f28c tspp: Improve data-path handling
Existing driver allocated BAM descriptor at fixed sizes each
with interrupt flag set. Notification on data was received when
the descriptor is fully consumed by the HW. The descriptor size
on one hand need to be big enough so that we don't receive too much
interrupts for high-bitrate streams, and on other hand needs
to be small enough so that for low-bitrate stream we are not starved
waiting for data for a long period of time.

The change adds support of allocating small descriptors and set
interrupt flags on part of descriptors. In addition, expiration
timer is used so that if interrupt is not received after long period
of time the timer handler reports back descriptors are already ready
to be consumed. This allows low-rate of interrupts and
handling of low-bitrate streams.

As descriptors are smaller now (size of single TS packet), exposed
API within SW demux that handles a single packet to save the function
call to the API that handles multiple packets for efficiency. Information
regarding the new buffer allocation was added to debugfs.

CRs-Fixed: 420818

Change-Id: I9dedb1d1bc99c871d1aa12addeed9fe187f17bb1
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
2013-03-07 15:24:05 -08:00
Hamad Kadmany
cf8e8b4daa misc: tspp: Enable notification of TSIF status and expose it in debugfs
Enable TSIF status interrupt to expose the following
information in debugfs:
- stat_rx_chunks: Counts number of TS packets chunks received from HW.
- stat_overflow: Counts number of times buffer has overflowed.
- stat_lost_sync: Counts number of times TSIF lost sync with input.
- stat_timeout: Counts number of times TSIF reached timeout
waiting for packets.

All counters can read and reset by writing to the respective file.

Change-Id: I42e71d072d8b92bdc8ecf941daef4ac0faa94de6
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
2013-03-07 15:24:03 -08:00
Liron Kuch
f765dfd37f media: dvb: mpq: TSPP output buffer allocation by demux plugin
The TSPP driver can allocate its output buffers internally or
externally. External buffer allocation is required when Demux wishes
to use the ION driver to allocate a physically contiguous buffer
(e.g. to pass to TZ).
This commit improves the TSPP driver support for external buffer
allocation and implements the external memory allocation and free
functions in the Demux driver.

Change-Id: Id7e815fa56b76401ed593a786eb61d97735deba9
Signed-off-by: Liron Kuch <lkuch@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
2013-03-07 15:24:01 -08:00
Hamad Kadmany
df7e43cddf tspp: Add option to inverse tsif signals
TSIF signals (clock, data, enable and sync) may be configured
to be inversed at TSPP unit input. This is useful in case
TSIF signals from external units need to be inversed.

Change-Id: I4f0bfdc58fb8658dbf10fe3805b8787f9d36aeca
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
2013-03-07 15:24:00 -08:00
Mitchel Humpherys
5ebf0bb53c ion: change ion kernel map function to not take flags argument
Buffer flags are going to be specified at allocation time rather than
map time. This removes the flags argument from the ion kernel map
function.

Change-Id: Ib983ecd0dcd7befb36287ae7037c71d4ca475f90
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2013-03-07 15:23:16 -08:00
Mitchel Humpherys
08bfff20c6 qseecom: include msm-specific ion header
All msm_ion clients need to use <linux/msm_ion.h> instead of
<linux/ion.h>

Change-Id: If78e8a3aa66209b93449569cc9bd670b8d21008c
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
2013-03-07 15:22:49 -08:00
Joel Nider
adec35c3d6 tspp: add kernel api for video demux component
The demux is an in-kernel software component whose purpose is to take
an incoming TSIF stream and split it into multiple output channels
based on the PID field in each TS packet. Each output channel can be
used for a different purpose, such as audio, video or channel
information. In order to get good performance when moving such large
data streams around, the demux was placed in kernel-space as to
prevent copying memory buffers between kernel-space and user-space, at
least at this early stage in processing the traffic. Originally the
design of the TSPP driver was based on the earlier TSIF driver, so it
contained only a user-space API.

Signed-off-by: Joel Nider <jnider@codeaurora.org>
(cherry picked from commit 435ad8e2157eec5783a435f1e7ec47f67d759882)

Change-Id: I0dadf04ec2694c82fc8378fbed5fbf81fc889337
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:19:31 -08:00
Hamad Kadmany
1140ef05b7 tsif: Improve workaround for DMA bug
During tsif stress tests it was reported that the dma flush caused by
calling action_close() is sometimes unrecoverable. The root cause is
stopping the tsif while a read by the dma of the tsif FIFO is in
progress. The previous workaround relied on closing the tsif GPIOs
to stop incoming data to the tsif, then add a delay to allow the
dma to complete all outstanding transactions. A customer still reported
seeing the dma issue. The reason the issue was still happening is due to
the call of gpio API (request/free) which was done on pins not configured
to act as GPIOs. Doing so caused tsif interface not to be closed properly.

Per gpio-mux documentation, pins with function configured as non-gpio
may suffer from un-expected behavior when calling gpio API, these calls
were removed. The delay after closing tsif interface was enlarged to better
cope with low bitrate streams.

Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
(cherry picked from commit b18fac5fe2c45d24bcac2bcd3db9bceb98317909)

Change-Id: I5115d9cd51bac5a7cd5200731c5dd4eb0d4fc352
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:19:07 -08:00
Ramesh Masavarapu
2a1f81cc66 msm: Fix correct topology for qseecom bus scaling.
Currently, bus scaling topology for qseecom is incorrect.
 -Added the correct topology paths for accessing Crypto
  Engine which is controlled by QSEE.
 -Removed setting the clock frequency of DFAB. This is
  done by the bus driver.
 -Removed references to the dfab clock instance defined
  in clocks file.

Change-Id: Ib6953ea3bf5721d458bfe2aa06c54be329a8fdb9
Signed-off-by: Ramesh Masavarapu <rameshm@codeaurora.org>
(cherry picked from commit 1e8c7242fd3f32ade703484d2113f4a6f442a0e8)

Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2013-03-07 15:18:37 -08:00
jh.koo
cbff6e7a0c slimport: Modify to support slimport-to-VGA and slimport-to-DP dongles
Change-Id: I4bbe996351d50bfa2a4073987c97db37a4ed3484
2013-03-04 12:46:21 -08:00
jh.koo
d44611bea2 slimport: reduce hdmi connection setup time
There are pretty long delay between cable plug-in and
image display on TV.
So this patch optimize the delay and remove unnecessary
register access.

Change-Id: I1fb334d9603c15bb3c0562cef852b1cc41d61e52
2013-03-04 12:46:20 -08:00
Devin Kim
bce4b3340b android_vibrator: set maximum value of amp to 100 from 127
Change-Id: I9ab61f7fe26fd2b01a510d9008bc33d88f2406f3
2013-03-04 12:46:02 -08:00
Devin Kim
ace7135a0e vibrator: tspdrv: clean up codes
Change-Id: I85ecec9fb01e21ea0cdf3fda1c43851c26c7f552
2013-03-04 12:46:01 -08:00
Devin Kim
3880882ecf android_vibrator: improve the vibration response.
Vibration on should be always set. So even if there is pending workqueue,
it should be run. And using mutex is minimu for quick response.

Change-Id: I859fde428d2a0e8619e3f5a140bb5a33a0b05041
2013-03-04 12:45:56 -08:00
Devin Kim
be65d0bafa android_vibrator: warmup delay for vibration sensitivity
add warmup delay before vibrator off

Change-Id: Ie6dd325cc6c6b0f6d4501414442472cd40beb4df
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-03-04 12:45:54 -08:00
Devin Kim
cb9874a2ba android_vibrator: improve the vibrator-off sequence
Clean up code and improve the vibrator-off sequence

Change-Id: Id04ea0735d1817db5ec05b8cfbc9216247758892
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-03-04 12:45:53 -08:00
jh.koo
6ff2586036 slimport: Add slimport detection function
It will be used for charger detection codes. slimport is also used
as charger like as usb charger

Change-Id: Idd40dd88b8a5f035dfb207dd787d7fd3f4ae713b
2013-03-04 12:45:23 -08:00
jh.koo
9eade7c5c4 slimport: Change slimport certification confirmed driver
Change-Id: I6f85315d02df51dc8ad13b0527312657221ac610
2013-03-04 12:45:23 -08:00
jh.koo
071b7f58aa slimport: add wake lock for stability in connected status
Change-Id: I4dba4af2ae997677a0383a9a9c2dad5a62d2e907
2013-03-04 12:45:22 -08:00
Devin Kim
152964bd36 android_vibrator: clean up codes and handle errors
Change-Id: I86e8d7a77a1f0a2b03bcb1b434fb68cb1d7b6e1a
2013-03-04 12:44:40 -08:00
choongryeol.lee
9164868787 slimport: support ANX7808BA hardware
Supporting of ANX7808BA which is new version of slimport
tx device and refining the driver

Change-Id: I44b06861c1350d551b23adbf7bc74fe070415e9d
2013-03-04 12:43:52 -08:00
choongryeol.lee
56a1b1e227 slimport : change i2c slave address
Anx7808 port0 i2c address is conflicting with lm3530 i2c address.
So this patch change i2c address to another one.

Change-Id: Ie2bee9bb648f12a98129ec7f61fe4558ea3c0afc
2013-03-04 12:43:51 -08:00
Jaeseong GIM
a3e0d0b14d mako: fix compile error without PM_RUNTIME
Change-Id: Ie1703e004fb92d6d7ddfdd1366a2376a27b95f94
2013-03-04 12:43:47 -08:00
choongryeol.lee
69c553ed59 slimport: add slimport anx7808 driver
add slimport anx7808 driver

Change-Id: I133d5272172532a52e27e08779b97789c104173a
2013-03-04 12:43:19 -08:00
Devin Kim
cc9c72ebc0 mako: vibrator: use ns_to_ktime
use ns_to_ktime instead of ktime_set

Change-Id: I29c2e99a4a655ca4ed26aca1acc270d3bcdb9700
2013-03-04 12:43:15 -08:00
Devin Kim
9710588005 cradle: add hall ic driver
support hall ic (BU52031NVX) for cradle

Change-Id: I1de44a0c1d5ab1359fc1a02eb674b08be8590100
2013-03-04 09:12:07 -08:00
Devin Kim
6a2109d1ca vibrator: add immersion touchsense vibrator
Change-Id: I543987642578f35a3a923a2d1368bee0997fdec1
2013-03-04 09:12:06 -08:00
Devin Kim
81efdd55c1 mako: vibrator: add android_vibrator driver and enable it
- cleanup vibrator codes
- add new android_vibrator
- enable android_vibrator

Change-Id: I7e005e8c8abc0b09ace6d278e01944e17f7adb6c
2013-03-04 09:11:52 -08:00
Mona Hossain
3e4c65cb5a qseecom: Fix kernel panic
When qseecom_unload_app() is invoked, wait_event_freezable() is called
in an atomic context (within a spinlock).  wait_event_freezable() allows
sleep and should not  be called in an atomic context where sleep is not
allowed.

Change-Id: I8c9c6d28f9e492fbbf2ac74a5ee3d1067c7733ad
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2013-02-27 18:21:26 -08:00
Joel Nider
0244a0576d tsif: use new clock preparation functions
Replace the clk_enable() with clk_prepare_enable() and replace
clk_disable() with clk_disable_unprepare() functions.
Add a new tasklet so the clocks can be turned off and
unprepared from the irq context in the case of emergency.

Change-Id: Ic63c6c25600069938b414974c5e1237943ffe2e7
Signed-off-by: Joel Nider <jnider@codeaurora.org>
2013-02-27 18:18:44 -08:00