aboutsummaryrefslogtreecommitdiff
path: root/include/linux/hsidev.h
blob: 39f734e4d9a9ee3ac1b35e4a43c2a86a071810e0 (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
/*
 * Copyright (C) 2007 STMicroelectronics
 *
 * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#ifndef __HSIDEV_H__
#define __HSIDEV_H__

#ifdef __KERNEL__
#include <linux/mutex.h>
#include <linux/list.h>
#include <linux/wait.h>
#include <mach/debug.h>

#define MAX_CHANNELS_MONITORED 4

#define DRIVER_NAME            "HSI LOOPBACK"
/* enables/disables debug msgs */
#define DRIVER_DEBUG            0
/* msg header represents this module */
#define DRIVER_DEBUG_PFX        DRIVER_NAME
#define DRIVER_DBG              KERN_ERR

/** struct hsidev_data - HSI loopback slave device
 * @devt - Device major and minor number for each channel
 * @hsidev_lock - Lock protecting the channel from simultaneous
 * 		 operations.
 * @wq - Wait queue for processed to sleep for event arrival
 * @hsi - Slave hsi device representing the channel
 * @device_entry - To enable insertion into loopback list
 * @xfer - Structure representing each transfer
 * @users - Number of users currently
 * @xfer_done - Flag to indicate trnasfer completion
**/
struct hsidev_data {
	dev_t devt;
	struct mutex hsidev_lock;
	wait_queue_head_t wq;
	struct hsi_device *hsi;
	struct list_head device_entry;
	struct hsi_data *xfer;
	unsigned users;
	int xfer_done;
};

#endif

#endif /* __HSIDEV_H__ */