Blame view
include/linux/maple.h
2.68 KB
17be2d2b1 sh: Add maple bus... |
1 2 3 4 |
#ifndef __LINUX_MAPLE_H #define __LINUX_MAPLE_H #include <linux/device.h> |
1795cf48b sh/maple: clean m... |
5 |
#include <mach/maple.h> |
17be2d2b1 sh: Add maple bus... |
6 7 8 9 10 |
extern struct bus_type maple_bus_type; /* Maple Bus command and response codes */ enum maple_code { |
b233b28ea sh: maple: Suppor... |
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 |
MAPLE_RESPONSE_FILEERR = -5, MAPLE_RESPONSE_AGAIN, /* retransmit */ MAPLE_RESPONSE_BADCMD, MAPLE_RESPONSE_BADFUNC, MAPLE_RESPONSE_NONE, /* unit didn't respond*/ MAPLE_COMMAND_DEVINFO = 1, MAPLE_COMMAND_ALLINFO, MAPLE_COMMAND_RESET, MAPLE_COMMAND_KILL, MAPLE_RESPONSE_DEVINFO, MAPLE_RESPONSE_ALLINFO, MAPLE_RESPONSE_OK, MAPLE_RESPONSE_DATATRF, MAPLE_COMMAND_GETCOND, MAPLE_COMMAND_GETMINFO, MAPLE_COMMAND_BREAD, MAPLE_COMMAND_BWRITE, MAPLE_COMMAND_BSYNC, MAPLE_COMMAND_SETCOND, MAPLE_COMMAND_MICCONTROL }; enum maple_file_errors { MAPLE_FILEERR_INVALID_PARTITION = 0x01000000, MAPLE_FILEERR_PHASE_ERROR = 0x02000000, MAPLE_FILEERR_INVALID_BLOCK = 0x04000000, MAPLE_FILEERR_WRITE_ERROR = 0x08000000, MAPLE_FILEERR_INVALID_WRITE_LENGTH = 0x10000000, MAPLE_FILEERR_BAD_CRC = 0x20000000 }; struct maple_buffer { char bufx[0x400]; void *buf; |
17be2d2b1 sh: Add maple bus... |
45 46 47 |
}; struct mapleq { |
b94823789 maple: fix up whi... |
48 49 |
struct list_head list; struct maple_device *dev; |
b233b28ea sh: maple: Suppor... |
50 51 |
struct maple_buffer *recvbuf; void *sendbuf, *recvbuf_p2; |
b94823789 maple: fix up whi... |
52 53 |
unsigned char length; enum maple_code command; |
17be2d2b1 sh: Add maple bus... |
54 55 56 |
}; struct maple_devinfo { |
b94823789 maple: fix up whi... |
57 58 59 |
unsigned long function; unsigned long function_data[3]; unsigned char area_code; |
5c8f82c64 maple: Fix up map... |
60 |
unsigned char connector_direction; |
b94823789 maple: fix up whi... |
61 62 63 64 |
char product_name[31]; char product_licence[61]; unsigned short standby_power; unsigned short max_power; |
17be2d2b1 sh: Add maple bus... |
65 66 67 |
}; struct maple_device { |
b94823789 maple: fix up whi... |
68 69 |
struct maple_driver *driver; struct mapleq *mq; |
b94823789 maple: fix up whi... |
70 |
void (*callback) (struct mapleq * mq); |
b233b28ea sh: maple: Suppor... |
71 72 |
void (*fileerr_handler)(struct maple_device *mdev, void *recvbuf); int (*can_unload)(struct maple_device *mdev); |
b94823789 maple: fix up whi... |
73 74 75 76 77 |
unsigned long when, interval, function; struct maple_devinfo devinfo; unsigned char port, unit; char product_name[32]; char product_licence[64]; |
b233b28ea sh: maple: Suppor... |
78 79 |
atomic_t busy; wait_queue_head_t maple_wait; |
b94823789 maple: fix up whi... |
80 |
struct device dev; |
17be2d2b1 sh: Add maple bus... |
81 82 83 |
}; struct maple_driver { |
b94823789 maple: fix up whi... |
84 |
unsigned long function; |
b94823789 maple: fix up whi... |
85 |
struct device_driver drv; |
17be2d2b1 sh: Add maple bus... |
86 87 88 |
}; void maple_getcond_callback(struct maple_device *dev, |
b94823789 maple: fix up whi... |
89 90 91 |
void (*callback) (struct mapleq * mq), unsigned long interval, unsigned long function); |
63870295d maple: Clean up m... |
92 93 |
int maple_driver_register(struct maple_driver *); void maple_driver_unregister(struct maple_driver *); |
b233b28ea sh: maple: Suppor... |
94 |
int maple_add_packet(struct maple_device *mdev, u32 function, |
1795cf48b sh/maple: clean m... |
95 96 |
u32 command, u32 length, void *data); void maple_clear_dev(struct maple_device *mdev); |
17be2d2b1 sh: Add maple bus... |
97 98 99 |
#define to_maple_dev(n) container_of(n, struct maple_device, dev) #define to_maple_driver(n) container_of(n, struct maple_driver, drv) |
617870632 maple: Kill usele... |
100 101 |
#define maple_get_drvdata(d) dev_get_drvdata(&(d)->dev) #define maple_set_drvdata(d,p) dev_set_drvdata(&(d)->dev, (p)) |
b94823789 maple: fix up whi... |
102 |
#endif /* __LINUX_MAPLE_H */ |