upload tizen1.0 source
[kernel/linux-2.6.36.git] / drivers / haptic / tspdrv / ImmVibeSPI.h
1 /*
2 ** =========================================================================
3 ** Copyright (c) 2004-2010  Immersion Corporation.  All rights reserved.
4 **                          Immersion Corporation Confidential and Proprietary
5 **
6 ** File:
7 **     ImmVibeSPI.h
8 **
9 ** Description: 
10 **     Device-dependent functions called by Immersion TSP API
11 **     to control PWM duty cycle, amp enable/disable, save IVT file, etc...
12 **
13 ** =========================================================================
14 */
15 #ifndef _IMMVIBESPI_H
16 #define _IMMVIBESPI_H
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif /* __cplusplus */
21
22 #ifndef IMMVIBESPIAPI
23         #if defined(WIN32)
24                 #define IMMVIBESPIAPI __declspec(dllimport)
25         #else
26                 #define IMMVIBESPIAPI extern
27         #endif
28 #endif
29
30 #include <linux/device.h>
31
32 enum chip_type {
33         ISA1000,
34         ISA1200,
35         MAX8997,
36 };
37
38 /*
39 ** Called at initialization time to set PWM freq, disable amp, etc...
40 */
41 IMMVIBESPIAPI VibeStatus ImmVibeSPI_ForceOut_Initialize(struct device *dev, enum chip_type type);
42
43 /*
44 ** Called at termination time to set PWM freq, disable amp, etc...
45 */
46 IMMVIBESPIAPI VibeStatus ImmVibeSPI_ForceOut_Terminate(void);
47
48 /*
49 ** Called to disable amp (disable output force)
50 */
51 IMMVIBESPIAPI VibeStatus ImmVibeSPI_ForceOut_AmpDisable(VibeUInt8 nActuatorIndex);
52
53 /*
54 ** Called to enable amp (enable output force)
55 */
56 IMMVIBESPIAPI VibeStatus ImmVibeSPI_ForceOut_AmpEnable(VibeUInt8 nActuatorIndex);
57
58 /*
59 ** Called to save an IVT data file (pIVT) to a file (szPathName)
60 */
61 IMMVIBESPIAPI VibeStatus ImmVibeSPI_IVTFile_Save(const VibeUInt8 *pIVT, VibeUInt32 nIVTSize, const char *szPathname);
62
63 /*
64 ** Called to delete an IVT file
65 */
66 IMMVIBESPIAPI VibeStatus ImmVibeSPI_IVTFile_Delete(const char *szPathname);
67
68 /*
69 ** Called to get the device name (device name must be returned as ANSI char)
70 */
71 IMMVIBESPIAPI VibeStatus ImmVibeSPI_Device_GetName(VibeUInt8 nActuatorIndex, char *szDevName, int nSize);
72
73 /*
74 ** Called to send output force samples
75 */
76 IMMVIBESPIAPI VibeStatus ImmVibeSPI_ForceOut_SetSamples(VibeUInt8 nActuatorIndex, VibeUInt16 nOutputSignalBitDepth, VibeUInt16 nBufferSizeInBytes, VibeInt8* pForceOutputBuffer);
77
78 /*
79 ** Called to set output frequency parameters
80 */
81 IMMVIBESPIAPI VibeStatus ImmVibeSPI_ForceOut_SetFrequency(VibeUInt8 nActuatorIndex, VibeUInt16 nFrequencyParameterID, VibeUInt32 nFrequencyParameterValue);
82
83 /*
84 ** Called at initialization time to get the number of actuators
85 */
86 IMMVIBESPIAPI VibeStatus ImmVibeSPI_Device_GetNum(void);
87
88 struct controller_chip;
89
90 void Turn_on_chip(struct controller_chip *chip);
91 void Turn_off_chip(struct controller_chip *chip);
92
93 #ifdef __cplusplus
94 }
95 #endif /* __cplusplus */
96
97 #endif /* _IMMVIBESPI_H */