0001
0002
0003
0004
0005
0006
0007
0008
0009 #define C2PORT_NAME_LEN 32
0010
0011 struct device;
0012
0013
0014
0015
0016
0017
0018 struct c2port_ops;
0019 struct c2port_device {
0020 unsigned int access:1;
0021 unsigned int flash_access:1;
0022
0023 int id;
0024 char name[C2PORT_NAME_LEN];
0025 struct c2port_ops *ops;
0026 struct mutex mutex;
0027
0028 struct device *dev;
0029
0030 void *private_data;
0031 };
0032
0033
0034 struct c2port_ops {
0035
0036 unsigned short block_size;
0037 unsigned short blocks_num;
0038
0039
0040 void (*access)(struct c2port_device *dev, int status);
0041
0042
0043 void (*c2d_dir)(struct c2port_device *dev, int dir);
0044
0045
0046 int (*c2d_get)(struct c2port_device *dev);
0047 void (*c2d_set)(struct c2port_device *dev, int status);
0048
0049
0050 void (*c2ck_set)(struct c2port_device *dev, int status);
0051 };
0052
0053
0054
0055
0056
0057 extern struct c2port_device *c2port_device_register(char *name,
0058 struct c2port_ops *ops, void *devdata);
0059 extern void c2port_device_unregister(struct c2port_device *dev);