~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/dsp/syslink/devh/devh.h

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * OMAP Device Handler driver
3
 
 *
4
 
 * Copyright (C) 2010 Texas Instruments Inc.
5
 
 *
6
 
 * Written by Angela Stegmaier <angelabaker@ti.com>
7
 
 *
8
 
 * This program is free software; you can redistribute it and/or
9
 
 * modify it under the terms of the GNU General Public License
10
 
 * version 2 as published by the Free Software Foundation.
11
 
 *
12
 
 * This program is distributed in the hope that it will be useful, but
13
 
 * WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
 
 * General Public License for more details.
16
 
 *
17
 
 * You should have received a copy of the GNU General Public License
18
 
 * along with this program; if not, write to the Free Software
19
 
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20
 
 * 02110-1301 USA
21
 
 *
22
 
 */
23
 
 
24
 
#ifndef DEVH_H
25
 
#define DEVH_H
26
 
 
27
 
#include <linux/ioctl.h>
28
 
#include <linux/cdev.h>
29
 
#include <linux/semaphore.h>
30
 
 
31
 
#define DEVH_IOC_MAGIC                 'E'
32
 
 
33
 
#define DEVH_IOCWAITONEVENTS            _IO(DEVH_IOC_MAGIC, 0)
34
 
#define DEVH_IOCEVENTREG                _IOW(DEVH_IOC_MAGIC, 1, \
35
 
                                        struct deh_reg_event_args)
36
 
#define DEVH_IOCEVENTUNREG              _IOW(DEVH_IOC_MAGIC, 2, \
37
 
                                        struct deh_reg_event_args)
38
 
 
39
 
#define DEVH_IOC_MAXNR          (2)
40
 
 
41
 
/* Device error types */
42
 
enum {
43
 
        DEV_SYS_ERROR = 1,
44
 
        DEV_WATCHDOG_ERROR,
45
 
};
46
 
 
47
 
struct omap_devh;
48
 
 
49
 
struct omap_devh_ops {
50
 
        int (*register_notifiers)(struct omap_devh *devh);
51
 
        int (*unregister_notifiers)(struct omap_devh *devh);
52
 
        int (*register_event_notification)(struct omap_devh *devh,
53
 
                                                const void __user *args);
54
 
        int (*unregister_event_notification)(struct omap_devh *devh,
55
 
                                                const void __user *args);
56
 
};
57
 
 
58
 
struct omap_devh_platform_data {
59
 
        struct omap_devh_ops *ops;
60
 
        char *name;
61
 
        int  proc_id;
62
 
        int  err_event_id;
63
 
        int  line_id;
64
 
        struct semaphore sem_handle;
65
 
        void *private_data;
66
 
};
67
 
 
68
 
struct omap_devh {
69
 
        struct device *dev;
70
 
        struct cdev cdev;
71
 
        atomic_t count;
72
 
        int state;
73
 
        int minor;
74
 
        char *name;
75
 
        struct list_head event_list;
76
 
        spinlock_t event_lock;
77
 
};
78
 
 
79
 
struct deh_reg_event_args {
80
 
        int fd;
81
 
        u32 event;
82
 
};
83
 
 
84
 
extern struct omap_devh_platform_data *devh_get_plat_data(void);
85
 
extern int devh_get_plat_data_size(void);
86
 
 
87
 
#endif /* DEVH_H */