bkj

C code posted
created at 29 Oct 11:40

Edit | Back
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
MODULE_LICENSE("Dual BSD/GPL");
MODULE_AUTHOR("Macken");
MODULE_DESCRIPTION("SW2");

static int mygpio_open(struct inode*, struct file*);
static int mygpio_release(struct inode *inode, struct file *filep);
ssize_t mygpio_read(struct file *filep, char __user *ubuf, size_t count, loff_t *f_pos);
static struct cdev my_cdev;
static struct class *plat_drv_class;

#define GPIO 16
#define Major 63
#define Minor 0
#define ch 1
#define ADC_MINOR 0
#define ADC_NBR_MINOR 8 //8-ch ADC

struct file_operations my_fops = {
    .open = mygpio_open,
    .release = mygpio_release,
    .read = mygpio_read,
};

static int devno;

643 Bytes in 2 ms with coderay