--- therm_adx.c	2004-03-17 14:17:26.000000000 +0100
+++ therm_adt7467.c	2004-03-11 03:55:37.000000000 +0100
@@ -31,22 +31,16 @@
 
 #undef DEBUG
 
-#define CONFIG_REG       0x40
-#define MANUAL_MASK      0xe0
-#define AUTO_MASK        0x20
-#define ADM_MANUAL_MASK ~0x80
-#define ADM_AUTO_MASK    0x80
- 
-static u8 TEMP_REG[3]     = {0x26, 0x25, 0x27}; /* local, cpu, gpu */
-static u8 LIMIT_REG[3]    = {0x6b, 0x6a, 0x6c}; /* local, cpu, gpu */
-static u8 MANUAL_MODE[2]  = {0x5c, 0x5d};       
-static u8 REM_CONTROL[2]  = {0x00, 0x40};
-static u8 FAN_SPEED[2]    = {0x28, 0x2a};
-static u8 FAN_SPD_SET[2]  = {0x30, 0x31};
-
-static u8 ADM_MANUAL_MODE = 0x00;
-static u8 ADM_LIMIT_REG[3]= {0x24, 0x25, 0x26}; /* local, remote, remote */
-static u8 ADM_TEMP_REG[3] = {0x0a, 0x0b, 0x0c}; /* local, remote, remote */
+#define CONFIG_REG   0x40
+#define MANUAL_MASK  0xe0
+#define AUTO_MASK    0x20
+
+static u8 TEMP_REG[3]    = {0x26, 0x25, 0x27}; /* local, cpu, gpu */
+static u8 LIMIT_REG[3]   = {0x6b, 0x6a, 0x6c}; /* local, cpu, gpu */
+static u8 MANUAL_MODE[2] = {0x5c, 0x5d};       
+static u8 REM_CONTROL[2] = {0x00, 0x40};
+static u8 FAN_SPEED[2]   = {0x28, 0x2a};
+static u8 FAN_SPD_SET[2] = {0x30, 0x31};
 
 static u8 default_limits_local[3] = {70, 50, 70};    /* local, cpu, gpu */
 static u8 default_limits_chip[3] = {80, 65, 80};    /* local, cpu, gpu */
@@ -72,8 +66,7 @@
 	int			overriding[2];
 };
 
-static enum {ADT7460, ADT7467, ADM1030, ADM1031} therm_type;
-static char *therm_name[]={"adt7460", "adt7467", "adm1030", "adm1031"};
+static enum {ADT7460, ADT7467} therm_type;
 static int therm_bus, therm_address;
 static struct of_device * of_dev;
 static struct thermostat* thermostat;
@@ -147,16 +140,14 @@
 		monitor_running = 0;
 		wait_for_completion(&monitor_task_compl);
 	}
-	
-	if (therm_type == ADT7467 || therm_type == ADT7460) {	
-		printk(KERN_INFO "adt746x: Putting max temperatures back from %d, %d, %d,"
+		
+	printk(KERN_INFO "adt746x: Putting max temperatures back from %d, %d, %d,"
 		" to %d, %d, %d, (°C)\n", 
 		th->limits[0], th->limits[1], th->limits[2],
 		th->initial_limits[0], th->initial_limits[1], th->initial_limits[2]);
-		for (i = 0; i < 3; i++)
-			write_reg(th, LIMIT_REG[i], th->initial_limits[i]);
-
-	} 
+	
+	for (i = 0; i < 3; i++)
+		write_reg(th, LIMIT_REG[i], th->initial_limits[i]);
 
 	write_both_fan_speed(th, -1);
 
@@ -183,15 +174,11 @@
 	u16 res;
 	
 	/* should start with low byte */
-	if (therm_type == ADT7467 || therm_type == ADT7460) {
-		tmp[1] = read_reg(th, addr);
-		tmp[0] = read_reg(th, addr + 1);
-		
-		res = tmp[1] + (tmp[0] << 8);
-		return (90000*60)/res;
-	} else {
-		return -1;
-	}
+	tmp[1] = read_reg(th, addr);
+	tmp[0] = read_reg(th, addr + 1);
+	
+	res = tmp[1] + (tmp[0] << 8);
+	return (90000*60)/res;
 }
 
 static void write_both_fan_speed(struct thermostat *th, int speed)
@@ -210,13 +197,8 @@
 	else if (speed < -1) 
 		speed = 0;
 	
-	if (therm_type != ADT7460 && fan == 1)
+	if (therm_type == ADT7467 && fan == 1)
 		return;
-
-	if ((therm_type == ADM1030 || therm_type == ADM1031) && speed >= 0) {
-		printk(KERN_INFO "adt746x: Manual setting of speed not supported on adm103x\n");
-		speed = -1;
-	}
 	
 	if (th->last_speed[fan] != speed) {
 		if (speed == -1)
@@ -229,27 +211,17 @@
 		return;
 	
 	if (speed >= 0) {
-		/* switch to manual */
-		if (therm_type == ADT7467 || therm_type == ADT7460) {
-			manual = read_reg(th, MANUAL_MODE[fan]);
-			write_reg(th, MANUAL_MODE[fan], manual|MANUAL_MASK);
-			write_reg(th, FAN_SPD_SET[fan], speed);
-		} else {
-			manual = read_reg(th, ADM_MANUAL_MODE);
-			write_reg(th, ADM_MANUAL_MODE, manual & ADM_MANUAL_MASK); 
-		}
-		
+		manual = read_reg(th, MANUAL_MODE[fan]);
+		write_reg(th, MANUAL_MODE[fan], manual|MANUAL_MASK);
+		write_reg(th, FAN_SPD_SET[fan], speed);
 	} else {
 		/* back to automatic */
 		if(therm_type == ADT7460) {
 			manual = read_reg(th, MANUAL_MODE[fan]) & (~MANUAL_MASK);
 			write_reg(th, MANUAL_MODE[fan], manual|REM_CONTROL[fan]);
-		} else if (therm_type == ADT7467) {
+		} else {
 			manual = read_reg(th, MANUAL_MODE[fan]);
 			write_reg(th, MANUAL_MODE[fan], manual&(~AUTO_MASK));
-		} else {
-			manual = read_reg(th, ADM_MANUAL_MODE);
-			write_reg(th, ADM_MANUAL_MODE, manual | ADM_AUTO_MASK);
 		}
 	}
 	
@@ -285,10 +257,7 @@
 		if (fan_speed != -1) {
 #endif
 			for (i = 0; i < 3; i++) {
-				if (therm_type == ADT7467 || therm_type == ADT7460)
-					temps[i]  = read_reg(th, TEMP_REG[i]);
-				else
-					temps[i]  = read_reg(th, ADM_TEMP_REG[i]);
+				temps[i]  = read_reg(th, TEMP_REG[i]);
 				lims[i]   = th->limits[i];
 			}
 #ifndef DEBUG
@@ -362,14 +331,8 @@
 {
 		/* Set CPU limit higher to avoid powerdowns */ 
 		th->limits[i] = default_limits_chip[i] + limit_adjust;
-		if (therm_type == ADT7467 || therm_type == ADT7460) {
-			write_reg(th, LIMIT_REG[i], th->limits[i]);
-		} else {
-			if (th->limits[i] > 124)
-				th->limits[i] = 124;
-			write_reg(th, LIMIT_REG[i], th->limits[i] << 1);
-			
-		}
+		write_reg(th, LIMIT_REG[i], th->limits[i]);
+		
 		/* set our limits to normal */
 		th->limits[i] = default_limits_local[i] + limit_adjust;
 }
@@ -405,22 +368,22 @@
 	if (fan_speed == -1)
 		fan_speed=128;
 	
-	if(therm_type == ADT7460)
+	if(therm_type == ADT7460) {
+		printk(KERN_INFO "adt746x: ADT7460 initializing\n");
+		/* The 7460 needs to be started explicitly */
 		write_reg(th, CONFIG_REG, 1);
+	} else
+		printk(KERN_INFO "adt746x: ADT7467 initializing\n");
 
-	printk(KERN_INFO "adt746x: %s initializing\n" therm_name[therm_type]);
-
-	if (therm_type == ADT7467 || therm_type == ADT7460) {
-		for (i = 0; i < 3; i++) {
-			th->initial_limits[i] = read_reg(th, LIMIT_REG[i]);
-			set_limit(th, i);
-		}
-
-		printk(KERN_INFO "adt746x: Lowering max temperatures from %d, %d, %d"
+	for (i = 0; i < 3; i++) {
+		th->initial_limits[i] = read_reg(th, LIMIT_REG[i]);
+		set_limit(th, i);
+	}
+	
+	printk(KERN_INFO "adt746x: Lowering max temperatures from %d, %d, %d"
 		" to %d, %d, %d (°C)\n", 
 		th->initial_limits[0], th->initial_limits[1], th->initial_limits[2], 
 		th->limits[0], th->limits[1], th->limits[2]);
-	} 
 
 	thermostat = th;
 
@@ -496,10 +459,6 @@
 BUILD_SHOW_FUNC_DEG(cpu_limit,		 thermostat->limits[1])
 BUILD_SHOW_FUNC_DEG(gpu_limit,		 thermostat->limits[2])
 
-BUILD_SHOW_FUNC_DEG(adm_cpu_temperature, (read_reg(thermostat, ADM_TEMP_REG[1])))
-BUILD_SHOW_FUNC_DEG(adm_gpu_temperature, (read_reg(thermostat, ADM_TEMP_REG[2])))
-
-
 BUILD_SHOW_FUNC_INT(specified_fan_speed, fan_speed)
 BUILD_SHOW_FUNC_INT(cpu_fan_speed,	 (read_fan_speed(thermostat, FAN_SPEED[0])))
 BUILD_SHOW_FUNC_INT(gpu_fan_speed,	 (read_fan_speed(thermostat, FAN_SPEED[1])))
@@ -512,12 +471,6 @@
 		   show_cpu_temperature,NULL);
 static DEVICE_ATTR(gpu_temperature,	S_IRUGO,
 		   show_gpu_temperature,NULL);
-static DEVICE_ATTR(adm_cpu_temperature,	S_IRUGO,
-		   show_adm_cpu_temperature,NULL);
-static DEVICE_ATTR(adm_gpu_temperature,	S_IRUGO,
-		   show_adm_gpu_temperature,NULL);
-
-
 static DEVICE_ATTR(cpu_limit,		S_IRUGO,
 		   show_cpu_limit,	NULL);
 static DEVICE_ATTR(gpu_limit,		S_IRUGO,
@@ -551,23 +504,7 @@
 		therm_type = ADT7460;
 	else if (device_is_compatible(np, "adt7467"))
 		therm_type = ADT7467;
-	else if (device_is_compatible(np, "adm1030")) {
-		therm_type = ADM1030;
-		/* patch nonexistent remote2 */
-		ADM_TEMP_REG[2] = ADM_TEMP_REG[1];
-		ADM_TEMP_REG[1] = ADM_TEMP_REG[0];
-		ADM_LIMIT_REG[2]= ADM_LIMIT_REG[1];
-		ADM_LIMIT_REG[1]= ADM_LIMIT_REG[0];
-		default_limits_local[0] = default_limits_local[1];
-		for (i = 0; i < 3; i++)
-			default_limits_chip[i] = default_limits_local[i];
-	}
-	else if (device_is_compatible(np, "adm1031")) {
-		therm_type = ADM1031;
-		for (i = 0; i < 3; i++)
-			default_limits_chip[i] = default_limits_local[i];
-		
-	} else
+	else
 		return -ENODEV;
 
 	prop = (u32 *)get_property(np, "reg", NULL);
@@ -585,23 +522,14 @@
 		printk(KERN_ERR "Can't register temperatures device !\n");
 		return -ENODEV;
 	}
-
-	if (therm_type == ADT7467 || therm_type == ADT7460) {	
-		device_create_file(&of_dev->dev, &dev_attr_cpu_temperature);
-		device_create_file(&of_dev->dev, &dev_attr_gpu_temperature);
-	} else {
-		device_create_file(&of_dev->dev, &dev_attr_adm_cpu_temperature);
-		device_create_file(&of_dev->dev, &dev_attr_adm_gpu_temperature);
-	}
+	
+	device_create_file(&of_dev->dev, &dev_attr_cpu_temperature);
+	device_create_file(&of_dev->dev, &dev_attr_gpu_temperature);
 	device_create_file(&of_dev->dev, &dev_attr_cpu_limit);
 	device_create_file(&of_dev->dev, &dev_attr_gpu_limit);
 	device_create_file(&of_dev->dev, &dev_attr_limit_adjust);
-	
-	if (therm_type == ADT7467 || therm_type == ADT7460) {	
-		device_create_file(&of_dev->dev, &dev_attr_specified_fan_speed);
-		device_create_file(&of_dev->dev, &dev_attr_cpu_fan_speed);
-	}
-
+	device_create_file(&of_dev->dev, &dev_attr_specified_fan_speed);
+	device_create_file(&of_dev->dev, &dev_attr_cpu_fan_speed);
 	if(therm_type == ADT7460)
 		device_create_file(&of_dev->dev, &dev_attr_gpu_fan_speed);
 
@@ -616,23 +544,13 @@
 thermostat_exit(void)
 {
 	if (of_dev) {
-		if (therm_type == ADT7467 || therm_type == ADT7460) {
-			device_remove_file(&of_dev->dev, &dev_attr_cpu_temperature);
-			device_remove_file(&of_dev->dev, &dev_attr_gpu_temperature);
-		} else {
-			device_remove_file(&of_dev->dev, &dev_attr_adm_cpu_temperature);
-			device_remove_file(&of_dev->dev, &dev_attr_adm_gpu_temperature);
-		}
-
+		device_remove_file(&of_dev->dev, &dev_attr_cpu_temperature);
+		device_remove_file(&of_dev->dev, &dev_attr_gpu_temperature);
 		device_remove_file(&of_dev->dev, &dev_attr_cpu_limit);
 		device_remove_file(&of_dev->dev, &dev_attr_gpu_limit);
 		device_remove_file(&of_dev->dev, &dev_attr_limit_adjust);
-
-		if (therm_type == ADT7467 || therm_type == ADT7460) {
-			device_remove_file(&of_dev->dev, &dev_attr_specified_fan_speed);
-			device_remove_file(&of_dev->dev, &dev_attr_cpu_fan_speed);
-		}
-
+		device_remove_file(&of_dev->dev, &dev_attr_specified_fan_speed);
+		device_remove_file(&of_dev->dev, &dev_attr_cpu_fan_speed);
 		if(therm_type == ADT7460)
 			device_remove_file(&of_dev->dev, &dev_attr_gpu_fan_speed);
 		of_device_unregister(of_dev);
