android_kernel_google_msm/include/media/v4l2-ctrls.h
David Brown a01a8cabfd msm: video: vcap: Add video capture driver
commit 6a744e339817d68e2b371fa35b0040382b38d044
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Fri Dec 7 15:50:32 2012 -0500

    media: video: Allow NR threshold to be updated by motion est

    VCAP did not allow for client to update threshold values based
    on the motion estimation. By enabling an option for this threshold
    to be updated dynamically by hardware, this allows for a more
    aggressive noise reduction to be applied at the request of the
    client.

    Change-Id: I0ac590ef826ce4567c048745efafbeb05011f31e
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 06550627e1f08b3956e9bf190999cd14123acf9d
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Fri Nov 30 14:35:16 2012 -0500

    media: video: Prevent memory leak in VCAP

    If a client were to do the following, VCAP would not free the ion
    handle:
     -Opened VCAP
     -Start initial configuration
     -Queues buffers
     -Close VCAP without ever calling stream on

    Since VCAP was not freeing ion this would cause a memory leak

    CRs-Fixed: 423881
    Change-Id: I594924d85884aa5e0a647bc52fa9e89e720f4ff6
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 14600e5b94992cebb0cdc1b541293c8f6c952715
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Wed Nov 7 17:16:27 2012 -0500

    media: video: vp_enabled state incorrect after a forced reset

    After a forced reset occurred on VP, during a stream_off call,
    vp_enabled state was incorrect causing one extra call to
    disable_irq. This would result in VP isr to be called whenever
    interrupt was triggered.

    CRs-Fixed: 418792
    Change-Id: Ia66b2d70506d4b06782bc5c25c83587c78f8e9c8
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit df1d4deafb7931eed7ae102440aea76647aab234
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Mon Nov 5 17:06:02 2012 -0500

    media: video: Stride alignment configurable by client

    Prior to this patch VCAP assumed that the line stride should be
    aligned to 16 bytes. It is possible that that the client needs a
    line stride to be 32 bytes aligned. Line stride is now a
    configurable parameter.

    Change-Id: Id05aa862813582c23b18c79bd9edf95b2cdfffbe
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit b0c58b1c28f95b653808a32e1069f88e474bfd0d
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Tue Oct 30 17:56:36 2012 -0400

    media: video: Prevent buffer ion resource from being freed twice

    It was possible for the client to have two threads running where
    one would be blocked in dq_buf that would wake up while the other
    thread was in the process of turning the stream off. This cause
    two thread to try freeing the ion resource which would result
    in a crash.

    Change-Id: Ibbbf34c7770eed99e1a89d2a4c41ad48f5b6a13a
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit aa64d3a2c70286485c37ae640bf929c451ac6188
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Mon Oct 29 13:05:37 2012 -0400

    media: video: VC ISR restructure to make code more readable

    As new features were added to VCAP the ISR for VC has become
    increasingly complex and difficult to read. It was determined that
    the VC ISR code should be simplified and cleaned up in order to
    make the code flow more easier to read.

    Change-Id: If7bc0a41e14c40f67120dacde9a1544e8f1ef7b1
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 37b1ecc312d7fcc3baa4423dfde6a107d85c2500
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Mon Oct 29 17:53:39 2012 -0400

    media: video: Make VCAP properly call regulator_get

    VCAP was not providing a pointer to the device when calling
    regulator_get. Although the call was able to get the regulator,
    there was always an error message regarding not being able to
    create a debugfs node. The problem was because the device provided
    to the regulator_get call was NULL.

    Change-Id: I6b344cafd96db50e95abfbf46021a361ac0de638
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 1f0f274818326a871184fa3e5597d0d2d82002b1
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Wed Oct 24 17:43:47 2012 -0400

    media: video: VC to use data polarity given by client

    VC would ignore the polarity given by the client and hardcode the
    value to zero. Now client is properly reporting value, VC now
    takes the value provided by the client.

    Change-Id: I511b59ed3e9f6b47d14cd688592d85ab97a5204d
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit f0ab1ee4a19e9616b8726d7974b1fb89baec9086
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Mon Oct 22 12:43:36 2012 -0400

    media: video: Force drop 2nd field after VC drops 1st field

    If a field was dropped by the VC, the VP would not be able to
    de-interlace the content properly. The problem with the VP is
    it would have an unbalanced number of top fields and bottom
    fields. In order to alleviate this problem the subsequent field
    will also be dropped. That way there would be a balanced number
    of top and bottom fields in the VP which would prevent jumping
    behavior observed in the de-interlaced frame.

    Change-Id: I96e8c0670b5b29baea8d1574b21c259c16a7a32e
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 0857c97b89fdc6316ed3a1029179963a07c785b4
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Wed Oct 17 16:24:21 2012 -0400

    media: video: Prevent VCAP from dequeue buffers once turned off

    VCAP should not report any buffers ready to be dequeued or allow
    for any buffers to be dq once streamoff has been called.

    CRs-Fixed: 398896
    Change-Id: I2eccf62b7ddff0f7cc0343c8e26bd699b335b9dc
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 8d1c327634466332a93c6d7403758e61de79f728
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Fri Jul 27 16:36:31 2012 -0400

    media: video: Use IOMMU mapping API

    The ion_phys API is being deprecated. Instead there is a new set
    of API.

    Change-Id: I701cc045fe5a0cb0026574dd08016a2bccbc4c72
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit f1b7b584430f6cd33bfee13b916a084fc1b80419
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Tue Oct 16 11:49:24 2012 -0400

    media: video: Shutdown VP before freeing VP buffers

    It was possible for buffers to be freed while VP was still using
    them. This patch ensures that VP has been stopped before that
    happens.

    Change-Id: Ifff689f690cdc43c935ee355dfaca61ade9e9d65
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 9d6f89cb2343ff5adaccb77a177fdc6c3844c65d
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Wed Oct 3 16:24:04 2012 -0400

    msm: mpq8064: Correct VCAP stride calucation

    VCAP was not properly calucating the stride values. This patch
    allows for line stride to be 16 byte aligned.

    CRs-Fixed: 390191
    Change-Id: Id9eca2fd3ec4a51347f2656271591f7bccf36ad5
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit c4aa4c09475ed3029d010417393a6a6368449772
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Fri Aug 31 04:49:21 2012 -0400

    msm: mpq8064: Adding debugfs support to VCAP

    In order to assist in debugging various VCAP issue it would be
    useful to have debugfs. This patch is about making everything to
    debug VCAP, from message to getting important data, available
    within debugfs.

    Change-Id: Ic9373036af6a5eb795da2d89d6f26fcd404264af
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit f3cd9a12838bfe4688e184f90ad16b6c304a8245
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Fri Sep 21 11:18:02 2012 -0400

    msm: mpq8064: Correct VP event type

    There is a VP error that was being incorrectly reported as a VC
    error event. This patch allows for the error to properly be
    reported.

    Change-Id: Ic2a1c6eb3b149bb7075417d54e2040d2261dda08
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 674f4799a54da7f5c38675308c3471c1b70bba4f
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Fri Sep 21 11:10:22 2012 -0400

    msm: mpq8064: VCAP probe properly reports failures

    It was possible for VCAP probe to fail, but still return 0.

    Change-Id: I395cecea90475ea07491a57dde12aae1fa67166e
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit f51f6e6d43c8d1d9b5a8ed86e044f19020146407
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Wed Aug 29 11:02:17 2012 -0400

    msm: mpq8064: Improve VCAP performance

    This patch increase bandwidth request and VCAP core clock
    for 1080 interlace or progressive content. This increase
    helps VCAP capture and process content in a timely manner.

    Change-Id: I8cb8d6e87954272b28a8e83351152354ea75a184
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 911b4b702a63fbd241863966cad45909e40e4665
Author: Mitchel Humpherys <mitchelh@codeaurora.org>
Date:   Wed Sep 12 14:42:50 2012 -0700

    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: I91589ca7b1ab142bb5ac8e6b0f4c06fa1305f23a
    Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>

commit 7d72bad55a0e03392d81eee77a9a8c9df6b73a9a
Author: Hanumant Singh <hanumant@codeaurora.org>
Date:   Wed Aug 29 18:39:44 2012 -0700

    ion: Port heap mask change to ion

    Heap mask field passes as argument at allocation time to specify ion
    heap.

    Change-Id: I8881dfc491dc0f8f70581ad97b35756a6a33dd6d
    Signed-off-by: Hanumant Singh <hanumant@codeaurora.org>
    Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>

commit 8ba7ad9492496e12c5555da796bc1f60d52c46f8
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Tue Sep 18 17:01:34 2012 -0400

    msm: mpq8064: Improve VP de-interlacing completion time

    VP time to de-interlacing for 1080i content was over 20ms. This
    was way too long considering content updating at 60Hz requires
    latency to be under 16ms. This change allow for de-interlacing
    to complete within 7ms.

    Change-Id: Iae2be758ef8d5a6fcecb96df93448226c9ed9109
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 9c4f8a220532407fd890187522b0ddb365b1d660
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Wed Sep 12 10:25:50 2012 -0400

    msm: mpq8064: VC report field info that is used by VP

    VP assumed that the first field provided was a bottom field, if VP
    was incorrect in this assumption it would not properly de-interlace
    content. It was also possible for VC to drop a field, when this
    happened VP would become out of sync again causing de-interlacing
    to be incorrect.

    CRs-Fixed: 397534
    Change-Id: I7a75a5dcd27149220273284a3d48f407bc5a4f31
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 3af95c07d0ff5be80502734f87ed90dc811face7
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Tue Sep 18 16:43:38 2012 -0400

    msm: mpq8064: VP report proper timestamp value

    There was a problem where de-interlace content was not getting a
    valid timestamp.

    Change-Id: Ief9e19c9d20bae3d785a7932b5021e2bba36d238
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit a1e8af4e6cf4bf8a4187a1be844a1462d37affff
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Tue Sep 18 16:41:57 2012 -0400

    msm: mpq8064: Timestamp properly populated within VCAP

    Before this change VCAP was only populating the usec parameter in
    timeval. Now VCAP populates sec and accounts for timestamp counter
    overflows.

    Change-Id: I32b2c49604baba95f56faa483acfe787fdb13b34
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 616762dc78540d8cf82fed1cbbc19cf90956aa4b
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Thu Aug 16 17:47:44 2012 -0400

    msm: mpq8064: Allow any client to control noise reduction parms

    It was requested that any client be allowed to modify the nr
    parameters. Reason for this is that there will be a separate
    pc tool that will be controlling NR for demos. Also fixed a
    bug with that cause s_fmt to failed with EINVAL when arguments
    were valid.

    Change-Id: Ie58972a036bb6637a938b48212ef85faf894002e
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 4b88553634efb3b8748a4c2462c71b69bf491947
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Tue Sep 4 03:51:55 2012 -0400

    msm: mpq8064: Prevent VC from running after error reported

    If VC continues to capture frames after receiving an error the
    frames do not contain a valid frame it is possible for a system
    crash to occur. This change resets NPL as soon as an error occurs,
    thus preventing VC from capturing any more frames. VC waits for
    client to handle error reported by VC.

    CRs-Fixed: 372564
    Change-Id: I72bdbab3251852520801541ed6d5521dc75f7cf1
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 2cba63f9f64c1c5e7d53eeddefc67d075d78d6f8
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Tue Aug 21 10:54:38 2012 -0400

    msm: mpq8064: Allow client to select num bufs for VC to hold onto

    VC part of the VCAP driver was initial implmented for the hardware
    to 2 store and work with 2 buffers. Since hardware is capable of
    storing and filling up to 6 buffers, a new API was created to allow
    client to select how many they want VC to use.

    Change-Id: I0548f1322c9703d9ccf12700be05511b0e1eb0de
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit b128b98ac802c210dfb0ea0b279271c0c24bc2eb
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Thu Aug 16 14:41:19 2012 -0400

    msm: mpq8064: Correct VCAP shutdown procedure

    VCAP hardware shutdown sequence was incorrect. This would cause
    the hardware to become unstable, which would result in the system
    crashing. This patch corrects it so the driver calls the correct
    shutdown procedure.

    Change-Id: I78273f2c70d9eab060dcc34aef0b3704ed685f40
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 72452631e2db3ca641414d05d2437144ac0366c6
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Mon Aug 13 12:32:24 2012 -0400

    msm: mpq8064: Fix false error reported by VP

    Logical or where there should have been a bitwise or. Also ignoring
    cadence change interrupt, because there is nothing for the driver
    to do cadence change occurs.

    Change-Id: I8a6214a66b67f6397a7b99ef54969761640abedf
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit a2cba0df366dc571feb8f8a750405f2ad8284cf6
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Wed Aug 8 11:39:53 2012 -0400

    msm: mpq8064: Use ION to alloc driver buffers

    Since VCAP is behind IOMMU, in order to get proper address for VCAP
    hw to write to driver needs to alloc buffer from ION and not
    kzalloc.

    Change-Id: I1f4fcc6834d0ea09ba0fc812b301219d35f40721
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit cc88c1256aaf04ad1ecc1d7ae6b35ae05112a397
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Mon Jul 16 18:20:02 2012 -0400

    msm: mpq8064: Avoid NPL clock overflow

    Since external components has its own variation there is a need
    for an additional 2% margin for the npl_clk

    Change-Id: I27d77ccd2f5cd9a9635975ea286bf3d0f8dba1d2
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 3dff4ef26eb40494eebb17adef80e66a0a469478
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Wed Jun 13 15:20:59 2012 -0400

    msm: mpq8064: Enable separate ioctl call for noise reduction (nr)

    NR for VCAP is capable of receiving manual tuning parameters. In
    order for the client to pass in these parameters a separate ioctl
    was developed.

    Change-Id: Ia8d7e8de80ee4fd7ccd2019d30b4457f1000e106
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 54d3a6d39374c5fe3bd22be970717f57480d6ad8
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Tue Jul 10 14:05:35 2012 -0400

    msm: mpq8064: Dummy read to prevent false interrupt from triggering

    The VBIF is capable of triggering a false bus error the first time
    it performs a read. This fix creates a dummy read event that
    happens every time that the VCAP is powered on that will ignore
    the false positive VBIF interrupt error, so that during normal
    operation the error can be properly identified.

    Change-Id: Ie56e60faf2067fab7a05a0f16c2d840408c35035
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit ad33c513b4b9455f0822c125affc39138603459e
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Mon Jul 16 17:50:00 2012 -0400

    msm: mpq8064: VCAP corner case bug fixes

    Closing VCAP devices could be called without calling stream off:
    This problem would make VCAP resources taken by devices no longer
    running.

    Using unsigned variable to store signed result: This problem would
    allow stream on to continue even when function returned error.

    Fix problem of reading VP irq status register too early: It was
    possible for cadence detection bit to be propgated faster by only
    a few clock cycles then the picture done bit. When the irq status
    read was performed and by the time a write to the clear register
    was performed the picture done bit would propgate. Since the irq
    is rising edge triggered this would cause a problem and the irq
    would not be triggered until VP was reset.

    Remove unused code

    Change-Id: Iba72354c06287efb27178edf64d8d3f459dbf954
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit a6c9648dd8e85e1e1e854347a78e4497578ebf51
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Fri Jul 6 17:53:09 2012 -0400

    msm: mpq8064: Separate q/dq buffer for VCAP de-interlacing mode

    This change fixes a crash when running VCAP in de-interlace mode.
    The problem was noticed in the introduction of kernel 3.4. VCAP
    was improperly using the videobuf2 framework APIs. Since VCAP is
    already reliant on queue structure provided by videobuf2 framework,
    we created our own basic version of the qbuf and dqbuf calls that
    have some similarities to the videobuf2 framework. This addition
    was necessary since we are calling qbuf from a kernel work thread.
    Since moving to kernel 3.4 there has been a change in videobuf2
    qbuf that dereferences the current process.s mm_struct, from a
    kernel work thread this struct is NULL, which was causing a crash.
    When we are de-interlacing a captured video we are cycling the
    buffers internally in the driver, which is why we needed to create
    our own q/dq buffer functionality.

    Change-Id: Id51b775ae7f0a58bbac8a581e07fa02417802a30
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit b14ed96f74b1258b1f102831a2b0ccd56f991132
Author: Laura Abbott <lauraa@codeaurora.org>
Date:   Mon Jan 30 14:18:08 2012 -0800

    gpu: ion: Pull in patches for 3.4

    Pull in Ion patches for 3.4 upgrade. Inclues the following
    patches from google:

     commit 7191e9ba25
     Author: Rebecca Schultz Zavin <rebecca@android.com>
     Date:   Mon Jan 30 14:18:08 2012 -0800

         ion: Switch map/unmap dma api to sg_tables

         Switch these api's from scatterlists to sg_tables

         Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

     commit 6f9e56945d
     Author: Rebecca Schultz Zavin <rebecca@android.com>
     Date:   Tue Jan 31 09:40:30 2012 -0800

         ion: Add reserve function to ion

         Rather than requiring each platform call memblock_remove or reserve
         from the board file, add this to ion

         Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

     commit 9ae7e01de1
     Author: KyongHo Cho <pullip.cho@samsung.com>
     Date:   Wed Sep 7 11:27:07 2011 +0900

         gpu: ion: several bugfixes and enhancements of ION

         1. Verifying if the size of memory allocation in ion_alloc() is aligned
         by PAGE_SIZE at least. If it is not, this change makes the size to be
         aligned by PAGE_SIZE.

         2. Unmaps all mappings to the kernel and DMA address spaces when
         destroying ion_buffer in ion_buffer_destroy(). This prevents leaks in
         those virtual address spaces.

         3. Makes the return value of ion_alloc() to be explicit Linux error code
         when it fails to allocate a buffer.

         4. Makes ion_alloc() implementation simpler. Removes 'goto' statement and
         relavant call to ion_buffer_put().

         5. Checks if the task is valid before calling put_task_struct() due
         to failure on creating a ion client in ion_client_create().

         6. Returns error when buffer allocation requested by userspace is failed.

         Signed-off-by: KyongHo Cho <pullip.cho@samsung.com>

     commit 043a61468f
     Author: Rebecca Schultz Zavin <rebecca@android.com>
     Date:   Wed Feb 1 11:09:46 2012 -0800

         ion: Switch ion to use dma-buf

         Ion now uses dma-buf file descriptors to share
         buffers with userspace.  Ion becomes a dma-buf
         exporter and any driver that can import dma-bufs
         can now import ion file descriptors.

         Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

     commit 0d1259b5f8
     Author: Rebecca Schultz Zavin <rebecca@android.com>
     Date:   Mon Apr 30 16:45:38 2012 -0700

         gpu: ion: Use alloc_pages instead of vmalloc from the system heap

         With this change the ion_system_heap will only use kernel address
         space when the memory is mapped into the kernel (rare case).

         Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

     commit be4a1ee79a
     Author: Rebecca Schultz Zavin <rebecca@android.com>
     Date:   Thu Apr 26 20:44:10 2012 -0700

         gpu: ion: support begin/end and kmap/kunmap dma_buf ops

         These ops were added in the 3.4 kernel.  This patch adds support
         for them to ion.  Previous ion_map/unmap_kernel api is also
         retained in addition to this new api.

         Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

     commit 46d71337f9
     Author: Rebecca Schultz Zavin <rebecca@android.com>
     Date:   Mon May 7 16:06:32 2012 -0700

         gpu: ion: Allocate the sg_table at creation time rather than dynamically

         Rather than calling map_dma on the allocations dynamically, this patch
         switches to creating the sg_table at the time the buffer is created.
         This is necessary because in future updates the sg_table will be used
         for cache maintenance.

         Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

     commit 903f6c716d
     Author: Rebecca Schultz Zavin <rebecca@android.com>
     Date:   Wed May 23 12:55:55 2012 -0700

         gpu: ion: Get an sg_table from an ion handle

         This patch adds an interface to return and sg_table given a
         valid ion handle.

         Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>

    The commit also includes fixups needed for MSM specific code.

    Change-Id: Idbcfa9d6af0febf06f56daaa6beaa59cc08e4351
    Signed-off-by: Laura Abbott <lauraa@codeaurora.org>

commit 779dc76f0a8d5db02df5d8b7d9794cd6766d0b9d
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Thu Jun 7 15:59:27 2012 -0400

    msm: mpq8064: Allow power up and down to be more dynamic

    To save power regulators are only powered on when needed. Also in
    this change is that clock rate is not longer set to max rate.
    Clock speed set to lowest rate and still remain properly functional

    Change-Id: I7141c8d630e4dbf5c2593e0aea9a18dc3866a1fd
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 98d11809bd87467a452f9e74d591515499abcfd8
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Wed Jun 6 18:18:43 2012 -0400

    msm: mpq8064: Enable v4l2 event handle in VCAP

    This will allow client to subscribe and receive events regarding
    VCAP device

    Change-Id: If8b6723feaa29dcf4e6a3bb9275ccc776081c830
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 5b1e6f1afb70ace03b32b48d4d70f34302decdc2
Author: Laura Abbott <lauraa@codeaurora.org>
Date:   Mon May 28 08:13:55 2012 -0700

    msm: camera: Remove subsystem_map header

    The old subsystem_map APIs are being deprecated. The
    msm_subsystem_map.h header file used to have definitions for
    iommu domains. Remove this header file and include iommu_domains.h
    to get the necessary iommu definitions.

    Change-Id: I417a357789a8fea16bbadd98663a8ebe873ff4e7
    Signed-off-by: Laura Abbott <lauraa@codeaurora.org>

commit aeb793ea48f0958b0aafac76c3fe774862f4dc69
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Fri May 11 11:41:16 2012 -0400

    msm: mpq8064: Add Video processing driver block for VCAP

    Adding VP portion to MSM VCAP. VP is used for deinterlacing video.

    Change-Id: I888e841cf4d65cf1e5b0316db16923c914469235
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 7d5bfbc69248f59e4889372e536d310ccfeb49a3
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Tue May 8 13:33:48 2012 -0400

    msm: mpq8064: Client passes timing information to VCAP

    This will allow the VCAP driver to be more dynamic and will allow
    for the timing table to be removed from the Video Capture

    Change-Id: Ib631104cc2c45adf429b6a6ca90415c191e24566
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit 3cd5b3d7ce774bf6ea5b1aa5cf38db9ac470985c
Author: Matt Wagantall <mattw@codeaurora.org>
Date:   Thu May 3 20:35:20 2012 -0700

    msm: vcap: Pass device pointers to regulator_get()

    Passing a device pointer instead of NULL as the first argument
    to regulator_get() allows the device to be taken into account
    when finding a matching regulator.

    Change-Id: I8cb02e5dc3294090f2f81371fca64b82139756d7
    Signed-off-by: Matt Wagantall <mattw@codeaurora.org>

commit 2dd21d788f51b52b32b3bbfd9baeda9726940ad7
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Tue Apr 24 11:16:51 2012 -0400

    msm: mpq8064: Change in how vcap req_buf calcs num buf

    A design change in how req_buf is suppose to work. Before req_buf
    would set the number of buffers needed to the minimum required by
    VCAP plus one buffer for cycling. The design now is now designed
    that req_buf now adds the minimum number of buffers requred by the
    VCAP to the value passed in.

    Change-Id: If3ac47fee076aefc9095804abfb38cf26c4a806f
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

commit a6914ca5f03f7f8e35ad443c612a6081a8efa127
Author: Terence Hampson <thampson@codeaurora.org>
Date:   Mon Apr 9 14:06:50 2012 -0400

    msm: mpq8064: Add VCAP v4l2 device for MPQ8064

    Adding v4l2 interface for VCAP device driver that utilizes
    video capture (VC) portion of VCAP.

    Future addition will allow for v4l2 VCAP to utilize video
    processing (VP).

    Change-Id: I5e68f4ba39f569ef07d67ca39fb922ad5a19aa4e
    Signed-off-by: Terence Hampson <thampson@codeaurora.org>

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

529 lines
20 KiB
C

/*
V4L2 controls support header.
Copyright (C) 2010 Hans Verkuil <hverkuil@xs4all.nl>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _V4L2_CTRLS_H
#define _V4L2_CTRLS_H
#include <linux/list.h>
#include <linux/videodev2.h>
/* forward references */
struct v4l2_ctrl_handler;
struct v4l2_ctrl_helper;
struct v4l2_ctrl;
struct video_device;
struct v4l2_subdev;
struct v4l2_subscribed_event;
struct v4l2_fh;
struct poll_table_struct;
struct file;
/** struct v4l2_ctrl_ops - The control operations that the driver has to provide.
* @g_volatile_ctrl: Get a new value for this control. Generally only relevant
* for volatile (and usually read-only) controls such as a control
* that returns the current signal strength which changes
* continuously.
* If not set, then the currently cached value will be returned.
* @try_ctrl: Test whether the control's value is valid. Only relevant when
* the usual min/max/step checks are not sufficient.
* @s_ctrl: Actually set the new control value. s_ctrl is compulsory. The
* ctrl->handler->lock is held when these ops are called, so no
* one else can access controls owned by that handler.
*/
struct v4l2_ctrl_ops {
int (*g_volatile_ctrl)(struct v4l2_ctrl *ctrl);
int (*try_ctrl)(struct v4l2_ctrl *ctrl);
int (*s_ctrl)(struct v4l2_ctrl *ctrl);
};
/** struct v4l2_ctrl - The control structure.
* @node: The list node.
* @ev_subs: The list of control event subscriptions.
* @handler: The handler that owns the control.
* @cluster: Point to start of cluster array.
* @ncontrols: Number of controls in cluster array.
* @done: Internal flag: set for each processed control.
* @is_new: Set when the user specified a new value for this control. It
* is also set when called from v4l2_ctrl_handler_setup. Drivers
* should never set this flag.
* @is_private: If set, then this control is private to its handler and it
* will not be added to any other handlers. Drivers can set
* this flag.
* @is_auto: If set, then this control selects whether the other cluster
* members are in 'automatic' mode or 'manual' mode. This is
* used for autogain/gain type clusters. Drivers should never
* set this flag directly.
* @has_volatiles: If set, then one or more members of the cluster are volatile.
* Drivers should never touch this flag.
* @manual_mode_value: If the is_auto flag is set, then this is the value
* of the auto control that determines if that control is in
* manual mode. So if the value of the auto control equals this
* value, then the whole cluster is in manual mode. Drivers should
* never set this flag directly.
* @ops: The control ops.
* @id: The control ID.
* @name: The control name.
* @type: The control type.
* @minimum: The control's minimum value.
* @maximum: The control's maximum value.
* @default_value: The control's default value.
* @step: The control's step value for non-menu controls.
* @menu_skip_mask: The control's skip mask for menu controls. This makes it
* easy to skip menu items that are not valid. If bit X is set,
* then menu item X is skipped. Of course, this only works for
* menus with <= 32 menu items. There are no menus that come
* close to that number, so this is OK. Should we ever need more,
* then this will have to be extended to a u64 or a bit array.
* @qmenu: A const char * array for all menu items. Array entries that are
* empty strings ("") correspond to non-existing menu items (this
* is in addition to the menu_skip_mask above). The last entry
* must be NULL.
* @flags: The control's flags.
* @cur: The control's current value.
* @val: The control's new s32 value.
* @val64: The control's new s64 value.
* @string: The control's new string value.
* @priv: The control's private pointer. For use by the driver. It is
* untouched by the control framework. Note that this pointer is
* not freed when the control is deleted. Should this be needed
* then a new internal bitfield can be added to tell the framework
* to free this pointer.
*/
struct v4l2_ctrl {
/* Administrative fields */
struct list_head node;
struct list_head ev_subs;
struct v4l2_ctrl_handler *handler;
struct v4l2_ctrl **cluster;
unsigned ncontrols;
unsigned int done:1;
unsigned int is_new:1;
unsigned int is_private:1;
unsigned int is_auto:1;
unsigned int has_volatiles:1;
unsigned int manual_mode_value:8;
const struct v4l2_ctrl_ops *ops;
u32 id;
const char *name;
enum v4l2_ctrl_type type;
s32 minimum, maximum, default_value;
union {
u32 step;
u32 menu_skip_mask;
};
const char * const *qmenu;
unsigned long flags;
union {
s32 val;
s64 val64;
char *string;
} cur;
union {
s32 val;
s64 val64;
char *string;
};
void *priv;
};
/** struct v4l2_ctrl_ref - The control reference.
* @node: List node for the sorted list.
* @next: Single-link list node for the hash.
* @ctrl: The actual control information.
* @helper: Pointer to helper struct. Used internally in prepare_ext_ctrls().
*
* Each control handler has a list of these refs. The list_head is used to
* keep a sorted-by-control-ID list of all controls, while the next pointer
* is used to link the control in the hash's bucket.
*/
struct v4l2_ctrl_ref {
struct list_head node;
struct v4l2_ctrl_ref *next;
struct v4l2_ctrl *ctrl;
struct v4l2_ctrl_helper *helper;
};
/** struct v4l2_ctrl_handler - The control handler keeps track of all the
* controls: both the controls owned by the handler and those inherited
* from other handlers.
* @lock: Lock to control access to this handler and its controls.
* @ctrls: The list of controls owned by this handler.
* @ctrl_refs: The list of control references.
* @cached: The last found control reference. It is common that the same
* control is needed multiple times, so this is a simple
* optimization.
* @buckets: Buckets for the hashing. Allows for quick control lookup.
* @nr_of_buckets: Total number of buckets in the array.
* @error: The error code of the first failed control addition.
*/
struct v4l2_ctrl_handler {
struct mutex lock;
struct list_head ctrls;
struct list_head ctrl_refs;
struct v4l2_ctrl_ref *cached;
struct v4l2_ctrl_ref **buckets;
u16 nr_of_buckets;
int error;
};
/** struct v4l2_ctrl_config - Control configuration structure.
* @ops: The control ops.
* @id: The control ID.
* @name: The control name.
* @type: The control type.
* @min: The control's minimum value.
* @max: The control's maximum value.
* @step: The control's step value for non-menu controls.
* @def: The control's default value.
* @flags: The control's flags.
* @menu_skip_mask: The control's skip mask for menu controls. This makes it
* easy to skip menu items that are not valid. If bit X is set,
* then menu item X is skipped. Of course, this only works for
* menus with <= 32 menu items. There are no menus that come
* close to that number, so this is OK. Should we ever need more,
* then this will have to be extended to a u64 or a bit array.
* @qmenu: A const char * array for all menu items. Array entries that are
* empty strings ("") correspond to non-existing menu items (this
* is in addition to the menu_skip_mask above). The last entry
* must be NULL.
* @is_private: If set, then this control is private to its handler and it
* will not be added to any other handlers.
*/
struct v4l2_ctrl_config {
const struct v4l2_ctrl_ops *ops;
u32 id;
const char *name;
enum v4l2_ctrl_type type;
s32 min;
s32 max;
u32 step;
s32 def;
u32 flags;
u32 menu_skip_mask;
const char * const *qmenu;
unsigned int is_private:1;
};
/** v4l2_ctrl_fill() - Fill in the control fields based on the control ID.
*
* This works for all standard V4L2 controls.
* For non-standard controls it will only fill in the given arguments
* and @name will be NULL.
*
* This function will overwrite the contents of @name, @type and @flags.
* The contents of @min, @max, @step and @def may be modified depending on
* the type.
*
* Do not use in drivers! It is used internally for backwards compatibility
* control handling only. Once all drivers are converted to use the new
* control framework this function will no longer be exported.
*/
void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
s32 *min, s32 *max, s32 *step, s32 *def, u32 *flags);
/** v4l2_ctrl_handler_init() - Initialize the control handler.
* @hdl: The control handler.
* @nr_of_controls_hint: A hint of how many controls this handler is
* expected to refer to. This is the total number, so including
* any inherited controls. It doesn't have to be precise, but if
* it is way off, then you either waste memory (too many buckets
* are allocated) or the control lookup becomes slower (not enough
* buckets are allocated, so there are more slow list lookups).
* It will always work, though.
*
* Returns an error if the buckets could not be allocated. This error will
* also be stored in @hdl->error.
*/
int v4l2_ctrl_handler_init(struct v4l2_ctrl_handler *hdl,
unsigned nr_of_controls_hint);
/** v4l2_ctrl_handler_free() - Free all controls owned by the handler and free
* the control list.
* @hdl: The control handler.
*
* Does nothing if @hdl == NULL.
*/
void v4l2_ctrl_handler_free(struct v4l2_ctrl_handler *hdl);
/** v4l2_ctrl_handler_setup() - Call the s_ctrl op for all controls belonging
* to the handler to initialize the hardware to the current control values.
* @hdl: The control handler.
*
* Button controls will be skipped, as are read-only controls.
*
* If @hdl == NULL, then this just returns 0.
*/
int v4l2_ctrl_handler_setup(struct v4l2_ctrl_handler *hdl);
/** v4l2_ctrl_handler_log_status() - Log all controls owned by the handler.
* @hdl: The control handler.
* @prefix: The prefix to use when logging the control values. If the
* prefix does not end with a space, then ": " will be added
* after the prefix. If @prefix == NULL, then no prefix will be
* used.
*
* For use with VIDIOC_LOG_STATUS.
*
* Does nothing if @hdl == NULL.
*/
void v4l2_ctrl_handler_log_status(struct v4l2_ctrl_handler *hdl,
const char *prefix);
/** v4l2_ctrl_new_custom() - Allocate and initialize a new custom V4L2
* control.
* @hdl: The control handler.
* @cfg: The control's configuration data.
* @priv: The control's driver-specific private data.
*
* If the &v4l2_ctrl struct could not be allocated then NULL is returned
* and @hdl->error is set to the error code (if it wasn't set already).
*/
struct v4l2_ctrl *v4l2_ctrl_new_custom(struct v4l2_ctrl_handler *hdl,
const struct v4l2_ctrl_config *cfg, void *priv);
/** v4l2_ctrl_new_std() - Allocate and initialize a new standard V4L2 non-menu control.
* @hdl: The control handler.
* @ops: The control ops.
* @id: The control ID.
* @min: The control's minimum value.
* @max: The control's maximum value.
* @step: The control's step value
* @def: The control's default value.
*
* If the &v4l2_ctrl struct could not be allocated, or the control
* ID is not known, then NULL is returned and @hdl->error is set to the
* appropriate error code (if it wasn't set already).
*
* If @id refers to a menu control, then this function will return NULL.
*
* Use v4l2_ctrl_new_std_menu() when adding menu controls.
*/
struct v4l2_ctrl *v4l2_ctrl_new_std(struct v4l2_ctrl_handler *hdl,
const struct v4l2_ctrl_ops *ops,
u32 id, s32 min, s32 max, u32 step, s32 def);
/** v4l2_ctrl_new_std_menu() - Allocate and initialize a new standard V4L2 menu control.
* @hdl: The control handler.
* @ops: The control ops.
* @id: The control ID.
* @max: The control's maximum value.
* @mask: The control's skip mask for menu controls. This makes it
* easy to skip menu items that are not valid. If bit X is set,
* then menu item X is skipped. Of course, this only works for
* menus with <= 32 menu items. There are no menus that come
* close to that number, so this is OK. Should we ever need more,
* then this will have to be extended to a u64 or a bit array.
* @def: The control's default value.
*
* Same as v4l2_ctrl_new_std(), but @min is set to 0 and the @mask value
* determines which menu items are to be skipped.
*
* If @id refers to a non-menu control, then this function will return NULL.
*/
struct v4l2_ctrl *v4l2_ctrl_new_std_menu(struct v4l2_ctrl_handler *hdl,
const struct v4l2_ctrl_ops *ops,
u32 id, s32 max, s32 mask, s32 def);
/** v4l2_ctrl_add_ctrl() - Add a control from another handler to this handler.
* @hdl: The control handler.
* @ctrl: The control to add.
*
* It will return NULL if it was unable to add the control reference.
* If the control already belonged to the handler, then it will do
* nothing and just return @ctrl.
*/
struct v4l2_ctrl *v4l2_ctrl_add_ctrl(struct v4l2_ctrl_handler *hdl,
struct v4l2_ctrl *ctrl);
/** v4l2_ctrl_add_handler() - Add all controls from handler @add to
* handler @hdl.
* @hdl: The control handler.
* @add: The control handler whose controls you want to add to
* the @hdl control handler.
*
* Does nothing if either of the two is a NULL pointer.
* In case of an error @hdl->error will be set to the error code (if it
* wasn't set already).
*/
int v4l2_ctrl_add_handler(struct v4l2_ctrl_handler *hdl,
struct v4l2_ctrl_handler *add);
/** v4l2_ctrl_cluster() - Mark all controls in the cluster as belonging to that cluster.
* @ncontrols: The number of controls in this cluster.
* @controls: The cluster control array of size @ncontrols.
*/
void v4l2_ctrl_cluster(unsigned ncontrols, struct v4l2_ctrl **controls);
/** v4l2_ctrl_auto_cluster() - Mark all controls in the cluster as belonging to
* that cluster and set it up for autofoo/foo-type handling.
* @ncontrols: The number of controls in this cluster.
* @controls: The cluster control array of size @ncontrols. The first control
* must be the 'auto' control (e.g. autogain, autoexposure, etc.)
* @manual_val: The value for the first control in the cluster that equals the
* manual setting.
* @set_volatile: If true, then all controls except the first auto control will
* be volatile.
*
* Use for control groups where one control selects some automatic feature and
* the other controls are only active whenever the automatic feature is turned
* off (manual mode). Typical examples: autogain vs gain, auto-whitebalance vs
* red and blue balance, etc.
*
* The behavior of such controls is as follows:
*
* When the autofoo control is set to automatic, then any manual controls
* are set to inactive and any reads will call g_volatile_ctrl (if the control
* was marked volatile).
*
* When the autofoo control is set to manual, then any manual controls will
* be marked active, and any reads will just return the current value without
* going through g_volatile_ctrl.
*
* In addition, this function will set the V4L2_CTRL_FLAG_UPDATE flag
* on the autofoo control and V4L2_CTRL_FLAG_INACTIVE on the foo control(s)
* if autofoo is in auto mode.
*/
void v4l2_ctrl_auto_cluster(unsigned ncontrols, struct v4l2_ctrl **controls,
u8 manual_val, bool set_volatile);
/** v4l2_ctrl_find() - Find a control with the given ID.
* @hdl: The control handler.
* @id: The control ID to find.
*
* If @hdl == NULL this will return NULL as well. Will lock the handler so
* do not use from inside &v4l2_ctrl_ops.
*/
struct v4l2_ctrl *v4l2_ctrl_find(struct v4l2_ctrl_handler *hdl, u32 id);
/** v4l2_ctrl_activate() - Make the control active or inactive.
* @ctrl: The control to (de)activate.
* @active: True if the control should become active.
*
* This sets or clears the V4L2_CTRL_FLAG_INACTIVE flag atomically.
* Does nothing if @ctrl == NULL.
* This will usually be called from within the s_ctrl op.
* The V4L2_EVENT_CTRL event will be generated afterwards.
*
* This function assumes that the control handler is locked.
*/
void v4l2_ctrl_activate(struct v4l2_ctrl *ctrl, bool active);
/** v4l2_ctrl_grab() - Mark the control as grabbed or not grabbed.
* @ctrl: The control to (de)activate.
* @grabbed: True if the control should become grabbed.
*
* This sets or clears the V4L2_CTRL_FLAG_GRABBED flag atomically.
* Does nothing if @ctrl == NULL.
* The V4L2_EVENT_CTRL event will be generated afterwards.
* This will usually be called when starting or stopping streaming in the
* driver.
*
* This function assumes that the control handler is not locked and will
* take the lock itself.
*/
void v4l2_ctrl_grab(struct v4l2_ctrl *ctrl, bool grabbed);
/** v4l2_ctrl_lock() - Helper function to lock the handler
* associated with the control.
* @ctrl: The control to lock.
*/
static inline void v4l2_ctrl_lock(struct v4l2_ctrl *ctrl)
{
mutex_lock(&ctrl->handler->lock);
}
/** v4l2_ctrl_lock() - Helper function to unlock the handler
* associated with the control.
* @ctrl: The control to unlock.
*/
static inline void v4l2_ctrl_unlock(struct v4l2_ctrl *ctrl)
{
mutex_unlock(&ctrl->handler->lock);
}
/** v4l2_ctrl_g_ctrl() - Helper function to get the control's value from within a driver.
* @ctrl: The control.
*
* This returns the control's value safely by going through the control
* framework. This function will lock the control's handler, so it cannot be
* used from within the &v4l2_ctrl_ops functions.
*
* This function is for integer type controls only.
*/
s32 v4l2_ctrl_g_ctrl(struct v4l2_ctrl *ctrl);
/** v4l2_ctrl_s_ctrl() - Helper function to set the control's value from within a driver.
* @ctrl: The control.
* @val: The new value.
*
* This set the control's new value safely by going through the control
* framework. This function will lock the control's handler, so it cannot be
* used from within the &v4l2_ctrl_ops functions.
*
* This function is for integer type controls only.
*/
int v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val);
/* Internal helper functions that deal with control events. */
void v4l2_ctrl_add_event(struct v4l2_ctrl *ctrl,
struct v4l2_subscribed_event *sev);
void v4l2_ctrl_del_event(struct v4l2_ctrl *ctrl,
struct v4l2_subscribed_event *sev);
/* Can be used as a vidioc_log_status function that just dumps all controls
associated with the filehandle. */
int v4l2_ctrl_log_status(struct file *file, void *fh);
/* Can be used as a vidioc_subscribe_event function that just subscribes
control events. */
int v4l2_ctrl_subscribe_event(struct v4l2_fh *fh,
struct v4l2_event_subscription *sub);
/* Can be used as a poll function that just polls for control events. */
unsigned int v4l2_ctrl_poll(struct file *file, struct poll_table_struct *wait);
/* Helpers for ioctl_ops. If hdl == NULL then they will all return -EINVAL. */
int v4l2_queryctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_queryctrl *qc);
int v4l2_querymenu(struct v4l2_ctrl_handler *hdl, struct v4l2_querymenu *qm);
int v4l2_g_ctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_control *ctrl);
int v4l2_s_ctrl(struct v4l2_fh *fh, struct v4l2_ctrl_handler *hdl,
struct v4l2_control *ctrl);
int v4l2_g_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *c);
int v4l2_try_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *c);
int v4l2_s_ext_ctrls(struct v4l2_fh *fh, struct v4l2_ctrl_handler *hdl,
struct v4l2_ext_controls *c);
/* Helpers for subdevices. If the associated ctrl_handler == NULL then they
will all return -EINVAL. */
int v4l2_subdev_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc);
int v4l2_subdev_querymenu(struct v4l2_subdev *sd, struct v4l2_querymenu *qm);
int v4l2_subdev_g_ext_ctrls(struct v4l2_subdev *sd, struct v4l2_ext_controls *cs);
int v4l2_subdev_try_ext_ctrls(struct v4l2_subdev *sd, struct v4l2_ext_controls *cs);
int v4l2_subdev_s_ext_ctrls(struct v4l2_subdev *sd, struct v4l2_ext_controls *cs);
int v4l2_subdev_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl);
int v4l2_subdev_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl);
#endif