5 #include <linux/of_device.h>
6 #include <linux/list.h>
8 struct bbc_i2c_client {
9 struct bbc_i2c_bus *bp;
10 struct platform_device *op;
15 enum fan_action { FAN_SLOWER, FAN_SAME, FAN_FASTER, FAN_FULLBLAST, FAN_STATE_MAX };
17 struct bbc_cpu_temperature {
18 struct list_head bp_list;
19 struct list_head glob_list;
21 struct bbc_i2c_client *client;
24 /* Current readings, and history. */
34 enum fan_action fan_todo[2];
39 struct bbc_fan_control {
40 struct list_head bp_list;
41 struct list_head glob_list;
43 struct bbc_i2c_client *client;
51 #define NUM_CHILDREN 8
54 struct bbc_i2c_bus *next;
57 void __iomem *i2c_bussel_reg;
58 void __iomem *i2c_control_regs;
59 unsigned char own, clock;
64 struct list_head temps;
65 struct list_head fans;
67 struct platform_device *op;
69 struct platform_device *device;
74 /* Probing and attachment. */
75 extern struct platform_device *bbc_i2c_getdev(struct bbc_i2c_bus *, int);
76 extern struct bbc_i2c_client *bbc_i2c_attach(struct bbc_i2c_bus *bp, struct platform_device *);
77 extern void bbc_i2c_detach(struct bbc_i2c_client *);
79 /* Register read/write. NOTE: Blocking! */
80 extern int bbc_i2c_writeb(struct bbc_i2c_client *, unsigned char val, int off);
81 extern int bbc_i2c_readb(struct bbc_i2c_client *, unsigned char *byte, int off);
82 extern int bbc_i2c_write_buf(struct bbc_i2c_client *, char *buf, int len, int off);
83 extern int bbc_i2c_read_buf(struct bbc_i2c_client *, char *buf, int len, int off);
85 #endif /* _BBC_I2C_H */