1 /*
2 ** =============================================================================
3 ** Copyright (c) 2016 Texas Instruments Inc.
4 **
5 ** This program is free software; you can redistribute it and/or modify it under
6 ** the terms of the GNU General Public License as published by the Free Software
7 ** Foundation; version 2.
8 **
9 ** This program is distributed in the hope that it will be useful, but WITHOUT
10 ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 ** FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12 **
13 ** You should have received a copy of the GNU General Public License along with
14 ** this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15 ** Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 **
17 ** File:
18 ** tiload.h
19 **
20 ** Description:
21 ** header file for tiload.c
22 **
23 ** =============================================================================
24 */
26 #ifndef _TILOAD_H
27 #define _TILOAD_H
29 #include "tas2555.h"
32 #define BPR_REG(book, page, reg) (((book * 256 * 128) + \
33 (page * 128)) + reg)
35 /* typedefs required for the included header files */
36 typedef char *string;
38 typedef struct {
39 unsigned char nBook;
40 unsigned char nPage;
41 unsigned char nRegister;
42 } BPR;
44 /* defines */
45 #define DEVICE_NAME "tiload_node"
47 #define TILOAD_IOC_MAGIC 0xE0
48 #define TILOAD_IOMAGICNUM_GET _IOR(TILOAD_IOC_MAGIC, 1, int)
49 #define TILOAD_IOMAGICNUM_SET _IOW(TILOAD_IOC_MAGIC, 2, int)
50 #define TILOAD_BPR_READ _IOR(TILOAD_IOC_MAGIC, 3, BPR)
51 #define TILOAD_BPR_WRITE _IOW(TILOAD_IOC_MAGIC, 4, BPR)
52 #define TILOAD_IOCTL_SET_CHL _IOW(TILOAD_IOC_MAGIC, 5, int)
53 #define TILOAD_IOCTL_SET_CONFIG _IOW(TILOAD_IOC_MAGIC, 6, int)
54 #define TILOAD_IOCTL_SET_CALIBRATION _IOW(TILOAD_IOC_MAGIC, 7, int)
56 int tiload_driver_init(struct tas2555_priv *pTAS2555);
58 #endif