aboutsummaryrefslogtreecommitdiff
path: root/drivers/sbus/char/bbc_i2c.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-12 11:40:55 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-12 11:40:55 -0700
commit07104839597803ccd9b2c4f543ee4651522b4aa1 (patch)
treeb3b569c955fb7abe10d1b89139c0f4a388933609 /drivers/sbus/char/bbc_i2c.h
parent589acce53e235055806e81e330af1e8f115bfcc2 (diff)
parent56c5d900dbb8e042bfad035d18433476931d8f93 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6: (180 commits) leo: disable cursor when leaving graphics mode cg6: disable cursor when leaving graphics mode sparc32: sun4m interrupt mask cleanup drivers/rtc/Kconfig: don't build rtc-cmos.o on sparc32 sparc: arch/sparc/kernel/pmc.c -- extra #include? sparc32: Add more extensive documentation of sun4m interrupts. sparc32: Kill irq_rcvreg from sun4m_irq.c sparc32: Delete master_l10_limit. sparc32: Use PROM device probing for sun4c timers. sparc32: Use PROM device probing for sun4c interrupt register. sparc32: Delete claim_ticker14(). sparc32: Stop calling claim_ticker14() from sun4c_irq.c sparc32: Kill clear_profile_irq btfixup entry. sparc32: Call sun4m_clear_profile_irq() directly from sun4m_smp.c sparc32: Remove #if 0'd code from sun4c_irq.c sparc32: Remove some SMP ifdefs in sun4d_irq.c sparc32: Use PROM infrastructure for probing and mapping sun4d timers. sparc32: Use PROM device probing for sun4m irq registers. sparc32: Use PROM device probing for sun4m timer registers. sparc: Fix user_regset 'n' field values. ...
Diffstat (limited to 'drivers/sbus/char/bbc_i2c.h')
-rw-r--r--drivers/sbus/char/bbc_i2c.h75
1 files changed, 70 insertions, 5 deletions
diff --git a/drivers/sbus/char/bbc_i2c.h b/drivers/sbus/char/bbc_i2c.h
index fb01bd17704..83c4811b7b5 100644
--- a/drivers/sbus/char/bbc_i2c.h
+++ b/drivers/sbus/char/bbc_i2c.h
@@ -1,14 +1,79 @@
-/* $Id: bbc_i2c.h,v 1.2 2001/04/02 09:59:25 davem Exp $ */
#ifndef _BBC_I2C_H
#define _BBC_I2C_H
-#include <asm/ebus.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
+#include <linux/list.h>
-struct bbc_i2c_client;
+struct bbc_i2c_client {
+ struct bbc_i2c_bus *bp;
+ struct of_device *op;
+ int bus;
+ int address;
+};
+
+enum fan_action { FAN_SLOWER, FAN_SAME, FAN_FASTER, FAN_FULLBLAST, FAN_STATE_MAX };
+
+struct bbc_cpu_temperature {
+ struct list_head bp_list;
+ struct list_head glob_list;
+
+ struct bbc_i2c_client *client;
+ int index;
+
+ /* Current readings, and history. */
+ s8 curr_cpu_temp;
+ s8 curr_amb_temp;
+ s8 prev_cpu_temp;
+ s8 prev_amb_temp;
+ s8 avg_cpu_temp;
+ s8 avg_amb_temp;
+
+ int sample_tick;
+
+ enum fan_action fan_todo[2];
+#define FAN_AMBIENT 0
+#define FAN_CPU 1
+};
+
+struct bbc_fan_control {
+ struct list_head bp_list;
+ struct list_head glob_list;
+
+ struct bbc_i2c_client *client;
+ int index;
+
+ int psupply_fan_on;
+ int cpu_fan_speed;
+ int system_fan_speed;
+};
+
+#define NUM_CHILDREN 8
+
+struct bbc_i2c_bus {
+ struct bbc_i2c_bus *next;
+ int index;
+ spinlock_t lock;
+ void __iomem *i2c_bussel_reg;
+ void __iomem *i2c_control_regs;
+ unsigned char own, clock;
+
+ wait_queue_head_t wq;
+ volatile int waiting;
+
+ struct list_head temps;
+ struct list_head fans;
+
+ struct of_device *op;
+ struct {
+ struct of_device *device;
+ int client_claimed;
+ } devs[NUM_CHILDREN];
+};
/* Probing and attachment. */
-extern struct linux_ebus_child *bbc_i2c_getdev(int);
-extern struct bbc_i2c_client *bbc_i2c_attach(struct linux_ebus_child *);
+extern struct of_device *bbc_i2c_getdev(struct bbc_i2c_bus *, int);
+extern struct bbc_i2c_client *bbc_i2c_attach(struct bbc_i2c_bus *bp, struct of_device *);
extern void bbc_i2c_detach(struct bbc_i2c_client *);
/* Register read/write. NOTE: Blocking! */