forked from linux-msm/cdba
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevice.h
56 lines (43 loc) · 1.42 KB
/
device.h
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
#ifndef __DEVICE_H__
#define __DEVICE_H__
#include "list.h"
struct cdb_assist;
struct fastboot;
struct fastboot_ops;
struct device {
char *board;
char *cdb_serial;
char *alpaca_dev;
char *console_dev;
char *name;
char *serial;
unsigned voltage;
bool tickle_mmc;
bool pshold_shutdown;
struct fastboot *fastboot;
void (*boot)(struct device *);
void *(*open)(struct device *dev);
int (*power_on)(struct device *dev);
int (*power_off)(struct device *dev);
void (*print_status)(struct device *dev);
void (*vbus)(struct device *dev, bool on);
int (*write)(struct device *dev, const void *buf, size_t len);
void (*fastboot_key)(struct device *dev, bool on);
void (*send_break)(struct device *dev);
bool set_active;
void *cdb;
struct list_head node;
};
void device_add(struct device *device);
struct device *device_open(const char *board, struct fastboot_ops *fastboot_ops);
int device_power_on(struct device *device);
int device_power_off(struct device *device);
void device_print_status(struct device *device);
void device_vbus(struct device *device, bool enable);
int device_write(struct device *device, const void *buf, size_t len);
void device_boot(struct device *device, const void *data, size_t len);
void device_fastboot_boot(struct device *device);
void device_fastboot_flash_reboot(struct device *device);
void device_fastboot_key(struct device *device, bool on);
void device_send_break(struct device *device);
#endif