Commit graph

13 commits

Author SHA1 Message Date
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
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
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
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
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
Joel Nider
db2d4417f3 tspp: use new clock preparation functions
Replace the clk_enable() with clk_prepare_enable() and replace
clk_disable() with clk_disable_unprepare() functions.

Change-Id: I63479090eccbeac46f091bf95faeb857139d23a4
Signed-off-by: Joel Nider <jnider@codeaurora.org>
2013-02-27 18:16:05 -08:00
Joel Nider
b5df0cfb58 tspp: use device name when getting clock
The new method for requesting clocks requires a driver to pass its
device name for comparison to the list of available clocks.

Change-Id: Ica5b09447de177beead90f8b7c721b84820fbdf7
Signed-off-by: Joel Nider <jnider@codeaurora.org>
2013-02-27 18:13:35 -08:00
David Brown
d1098dd2a8 tspp: Add transport stream packet processor
Including:

commit 6bac783fae7e7c5a5bfc95e2cdc9b4f22ca53d44
Author: Hamad Kadmany <hkadmany@codeaurora.org>
Date:   Thu Dec 20 18:30:40 2012 +0200

    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: If2038f184a8b0904fba3e1cca5e110fd9daa52d3
    Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>

commit 81cee0596e3cdf8102bf8c8ef45e5f3a07fc8a4d
Author: Hamad Kadmany <hkadmany@codeaurora.org>
Date:   Thu Nov 29 14:15:57 2012 +0200

    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: I4bb05177774ab0e0bad0737ca1106a0c33f843ae
    Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>

commit 44307d32e23a2bb2a190d88bb049cc34d1e20418
Author: Hamad Kadmany <hkadmany@codeaurora.org>
Date:   Sun Nov 25 09:49:51 2012 +0200

    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: I475c2c0845c85ac22ea720059fb28c4a588fedcf
    Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>

commit 72b785570b265c6fcb4cb907c0c3a3a4b311f1f1
Author: Liron Kuch <lkuch@codeaurora.org>
Date:   Tue Oct 30 17:47:50 2012 +0200

    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: I71da4f18c090ef224c4fc7b23f55b9b3636be996
    Signed-off-by: Liron Kuch <lkuch@codeaurora.org>

commit 92705b3eb380826abf8ddefc25a8d210ffa64ff5
Author: Hamad Kadmany <hkadmany@codeaurora.org>
Date:   Tue Oct 23 14:15:41 2012 +0200

    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: Idd21948baccedc7499b31ed1d4df0f737538c870
    Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>

commit 435ad8e2157eec5783a435f1e7ec47f67d759882
Author: Joel Nider <jnider@codeaurora.org>
Date:   Wed Dec 14 16:53:30 2011 +0200

    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.

    Change-Id: I22799eb19d9049e3635d5c589b02f999d9b8e1c7
    Signed-off-by: Joel Nider <jnider@codeaurora.org>

commit 6544f3e52c9c1707a5a8fa90d32f89d80dabb4b9
Author: Joel Nider <jnider@codeaurora.org>
Date:   Tue Jul 10 13:50:06 2012 +0300

    tspp: use new clock preparation functions

    Replace the clk_enable() with clk_prepare_enable() and replace
    clk_disable() with clk_disable_unprepare() functions.

    Change-Id: I63479090eccbeac46f091bf95faeb857139d23a4
    Signed-off-by: Joel Nider <jnider@codeaurora.org>

commit b9662ca49cfe619e076476dcf8297a4031f0c310
Author: Joel Nider <jnider@codeaurora.org>
Date:   Sun Jun 10 14:21:11 2012 +0300

    tspp: use device name when getting clock

    The new method for requesting clocks requires a driver to pass its
    device name for comparison to the list of available clocks.

    Change-Id: Ica5b09447de177beead90f8b7c721b84820fbdf7
    Signed-off-by: Joel Nider <jnider@codeaurora.org>

commit 5556a8524591e4d1c4c9188316551900e8b8382d
Author: Joel Nider <jnider@codeaurora.org>
Date:   Sun Oct 16 10:52:13 2011 +0200

    misc: tspp: adding TSPP driver files

    The TSPP driver manages the transport stream packet processor.  This core
    is used to offload the main CPU by handling MPEG TS packets, generally
    coming from a broadcast modem using the ISDB-T (or variant) protocol.

    Change-Id: Ia4c16dcce970ae0f52d8d17957a92fce34ecdb44
    Signed-off-by: Joel Nider <jnider@codeaurora.org>

Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:30:54 -08:00