summaryrefslogtreecommitdiff
path: root/drivers/input/touchscreen/msg2138/mstar_drv_utility_adaption.h
blob: 5e72956936192c5a68a111b73e3bff2315f3a4b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2006-2012 MStar Semiconductor, Inc.
// All rights reserved.
//
// Unless otherwise stipulated in writing, any and all information contained
// herein regardless in any format shall remain the sole proprietary of
// MStar Semiconductor Inc. and be kept in strict confidence
// (??MStar Confidential Information??) by the recipient.
// Any unauthorized act including without limitation unauthorized disclosure,
// copying, use, reproduction, sale, distribution, modification, disassembling,
// reverse engineering and compiling of the contents of MStar Confidential
// Information is unlawful and strictly prohibited. MStar hereby reserves the
// rights to any and all damages, losses, costs and expenses resulting therefrom.
//
////////////////////////////////////////////////////////////////////////////////

/**
 *
 * @file    mstar_drv_utility_adaption.h
 *
 * @brief   This file defines the interface of touch screen
 *
 * @version v2.2.0.0
 *
 */

#ifndef __MSTAR_DRV_UTILITY_ADAPTION_H__
#define __MSTAR_DRV_UTILITY_ADAPTION_H__ (1)


////////////////////////////////////////////////////////////
/// Included Files
////////////////////////////////////////////////////////////

#include "mstar_drv_common.h"

////////////////////////////////////////////////////////////
/// Constant
////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////
/// Data Types
////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////
/// Variables
////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////
/// Macro
////////////////////////////////////////////////////////////
#define BK_REG8_WL(addr,val)    ( RegSetLByteValue( addr, val ) )
#define BK_REG8_WH(addr,val)    ( RegSetHByteValue( addr, val ) )
#define BK_REG16_W(addr,val)    ( RegSet16BitValue( addr, val ) )
#define BK_REG8_RL(addr)        ( RegGetLByteValue( addr ) )
#define BK_REG8_RH(addr)        ( RegGetHByteValue( addr ) )
#define BK_REG16_R(addr)        ( RegGet16BitValue( addr ) )

#define PRINTF_EMERG(fmt, ...)  printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
#define PRINTF_ALERT(fmt, ...)  printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)
#define PRINTF_CRIT(fmt, ...)   printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__) 
#define PRINTF_ERR(fmt, ...)    printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
#define PRINTF_WARN(fmt, ...)   printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
#define PRINTF_NOTICE(fmt, ...) printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
#define PRINTF_INFO(fmt, ...)   printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
#define PRINTF_DEBUG(fmt, ...)  printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) 

////////////////////////////////////////////////////////////
/// Function Prototypes
////////////////////////////////////////////////////////////

#ifdef CONFIG_ENABLE_DMA_IIC
extern void DmaAlloc(void);
extern void DmaFree(void);
#endif //CONFIG_ENABLE_DMA_IIC
extern u16  RegGet16BitValue(u16 nAddr);
extern u8   RegGetLByteValue(u16 nAddr);
extern u8   RegGetHByteValue(u16 nAddr);
extern void RegSet16BitValue(u16 nAddr, u16 nData);
extern void RegSetLByteValue(u16 nAddr, u8 nData);
extern void RegSetHByteValue(u16 nAddr, u8 nData);
extern void RegSet16BitValueOn(u16 nAddr, u16 nData);
extern void RegSet16BitValueOff(u16 nAddr, u16 nData);
extern void DbBusEnterSerialDebugMode(void);
extern void DbBusExitSerialDebugMode(void);
extern void DbBusIICUseBus(void);
extern void DbBusIICNotUseBus(void);
extern void DbBusIICReshape(void);
extern void DbBusStopMCU(void);
extern void DbBusNotStopMCU(void);
extern s32 IicWriteData(u8 nSlaveId, u8* pBuf, u16 nSize);
extern s32 IicReadData(u8 nSlaveId, u8* pBuf, u16 nSize);
extern void mstpMemSet(void *pDst, s8 nVal, u32 nSize);
extern void mstpMemCopy(void *pDst, void *pSource, u32 nSize);
extern void mstpDelay(u32 nTime);

#endif // __MSTAR_DRV_UTILITY_ADAPTION_H__