OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (c) 2009 NVIDIA Corporation. |
| 3 * All rights reserved. |
| 4 * |
| 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: |
| 7 * |
| 8 * Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. |
| 10 * |
| 11 * Redistributions in binary form must reproduce the above copyright notice, |
| 12 * this list of conditions and the following disclaimer in the documentation |
| 13 * and/or other materials provided with the distribution. |
| 14 * |
| 15 * Neither the name of the NVIDIA Corporation nor the names of its contributors |
| 16 * may be used to endorse or promote products derived from this software |
| 17 * without specific prior written permission. |
| 18 * |
| 19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
| 23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 29 * POSSIBILITY OF SUCH DAMAGE. |
| 30 * |
| 31 */ |
| 32 |
| 33 /** |
| 34 * @file |
| 35 * <b>NVIDIA Tegra ODM Kit: |
| 36 * Touch Pad Sensor Interface</b> |
| 37 * |
| 38 * @b Description: Defines the ODM adaptation interface for touch pad sensor dev
ices. |
| 39 * |
| 40 */ |
| 41 |
| 42 #ifndef INCLUDED_NVODM_MOUSE_H |
| 43 #define INCLUDED_NVODM_MOUSE_H |
| 44 |
| 45 #if defined(__cplusplus) |
| 46 extern "C" |
| 47 { |
| 48 #endif |
| 49 |
| 50 #include "nvodm_services.h" |
| 51 #include "nverror.h" |
| 52 |
| 53 /** |
| 54 * @defgroup nvodm_mouse Mouse Adaptation Interface |
| 55 * |
| 56 * This is the mouse ODM adaptation interface. |
| 57 * |
| 58 * @ingroup nvodm_adaptation |
| 59 * @{ |
| 60 */ |
| 61 |
| 62 |
| 63 /** |
| 64 * Defines an opaque handle that exists for each mouse device in the |
| 65 * system, each of which is defined by the customer implementation. |
| 66 */ |
| 67 typedef struct NvOdmMouseDeviceRec *NvOdmMouseDeviceHandle; |
| 68 |
| 69 |
| 70 /** |
| 71 * Gets a handle to the mouse in the system. |
| 72 * |
| 73 * @param hDevice A pointer to the handle of the mouse. |
| 74 * @return NV_TRUE if successful, or NV_FALSE otherwise. |
| 75 */ |
| 76 NvBool |
| 77 NvOdmMouseDeviceOpen( NvOdmMouseDeviceHandle *hDevice ); |
| 78 |
| 79 /** |
| 80 * Hooks up the interrupt handle to the GPIO interrupt and enables the interrupt
. |
| 81 * |
| 82 * @param hDevice The handle to the mouse. |
| 83 * @param hInterruptSemaphore A handle to hook up the interrupt. |
| 84 * @return NV_TRUE if successful, or NV_FALSE otherwise. |
| 85 */ |
| 86 NvBool NvOdmMouseEnableInterrupt(NvOdmMouseDeviceHandle hDevice, NvOdmOsSemaphor
eHandle hInterruptSemaphore); |
| 87 |
| 88 /** |
| 89 * Un-registers the interrupt. |
| 90 * |
| 91 * @param hDevice The handle to the mouse. |
| 92 * @return NV_TRUE if successful, or NV_FALSE otherwise. |
| 93 */ |
| 94 NvBool NvOdmMouseDisableInterrupt(NvOdmMouseDeviceHandle hDevice); |
| 95 |
| 96 /** |
| 97 * Returns the event response information. |
| 98 * |
| 99 * @param hDevice A handle to the mouse. |
| 100 * @param NumPayLoad A pointer to the number of bytes in the returned payload. |
| 101 * @param PayLoadBuf A pointer to the returned payload buffer. |
| 102 * @return NV_TRUE if successful, or NV_FALSE otherwise. |
| 103 */ |
| 104 NvBool NvOdmMouseGetEventInfo(NvOdmMouseDeviceHandle hDevice, NvU32 *NumPayLoad,
NvU8 *PayLoadBuf); |
| 105 |
| 106 /** |
| 107 * Releases the mouse handle. |
| 108 * |
| 109 * @param hDevice The mouse handle to be released. If |
| 110 * NULL, this API has no effect. |
| 111 */ |
| 112 void NvOdmMouseDeviceClose(NvOdmMouseDeviceHandle hDevice); |
| 113 |
| 114 /** |
| 115 * Sends the commands to HW in a form of request packet. |
| 116 * |
| 117 * @param hDevice A handle to the mouse. |
| 118 * @param cmd The command to send. |
| 119 * @param ExpectedResponseSize The size expected in the response. |
| 120 * @param NumPayLoad A pointer to the number of bytes in the payload. |
| 121 * @param PayLoadBuf A pointer to the payload buffer. |
| 122 */ |
| 123 NvBool |
| 124 NvOdmMouseSendRequest( |
| 125 NvOdmMouseDeviceHandle hDevice, |
| 126 NvU32 cmd, |
| 127 NvU32 ExpectedResponseSize, |
| 128 NvU32 *NumPayLoad, |
| 129 NvU8 *PayLoadBuf); |
| 130 |
| 131 /** |
| 132 * Enables the EC to stream data from the mouse. |
| 133 * |
| 134 * @param hDevice A handle to the mouse. |
| 135 * @param NumBytesPerSample Number of payload bytes to be sent in each event |
| 136 * packet. |
| 137 * |
| 138 * @return NV_TRUE if successful, or NV_FALSE otherwise. |
| 139 */ |
| 140 NvBool |
| 141 NvOdmMouseStartStreaming( |
| 142 NvOdmMouseDeviceHandle hDevice, |
| 143 NvU32 NumBytesPerSample); |
| 144 |
| 145 /** |
| 146 * Suspends power for mouse. |
| 147 * |
| 148 * @param hDevice A handle to the mouse. |
| 149 * @return NV_TRUE if successful, or NV_FALSE otherwise. |
| 150 */ |
| 151 NvBool NvOdmMousePowerSuspend(NvOdmMouseDeviceHandle hDevice); |
| 152 |
| 153 /** |
| 154 * Resumes power for mouse. |
| 155 * |
| 156 * @param hDevice A handle to the mouse. |
| 157 * @return NV_TRUE if successful, or NV_FALSE otherwise. |
| 158 */ |
| 159 NvBool NvOdmMousePowerResume(NvOdmMouseDeviceHandle hDevice); |
| 160 |
| 161 |
| 162 #if defined(__cplusplus) |
| 163 } |
| 164 #endif |
| 165 |
| 166 /** @} */ |
| 167 |
| 168 #endif // INCLUDED_NVODM_MOUSE_H |
OLD | NEW |