lm78.c (fde0950903ce8cc38a91dd095280decceda2ff82) lm78.c (2d8672c5a6ba0d3f1d8d3ad61ef67868941364f0)
1/*
2 lm78.c - Part of lm_sensors, Linux kernel modules for hardware
3 monitoring
4 Copyright (c) 1998, 1999 Frodo Looijaard <frodol@dds.nl>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or

--- 20 unchanged lines hidden (view full) ---

29#include <linux/err.h>
30#include <asm/io.h>
31
32/* Addresses to scan */
33static unsigned short normal_i2c[] = { 0x20, 0x21, 0x22, 0x23, 0x24,
34 0x25, 0x26, 0x27, 0x28, 0x29,
35 0x2a, 0x2b, 0x2c, 0x2d, 0x2e,
36 0x2f, I2C_CLIENT_END };
1/*
2 lm78.c - Part of lm_sensors, Linux kernel modules for hardware
3 monitoring
4 Copyright (c) 1998, 1999 Frodo Looijaard <frodol@dds.nl>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or

--- 20 unchanged lines hidden (view full) ---

29#include <linux/err.h>
30#include <asm/io.h>
31
32/* Addresses to scan */
33static unsigned short normal_i2c[] = { 0x20, 0x21, 0x22, 0x23, 0x24,
34 0x25, 0x26, 0x27, 0x28, 0x29,
35 0x2a, 0x2b, 0x2c, 0x2d, 0x2e,
36 0x2f, I2C_CLIENT_END };
37static unsigned int normal_isa[] = { 0x0290, I2C_CLIENT_ISA_END };
37static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END };
38static unsigned short isa_address = 0x290;
38
39/* Insmod parameters */
40SENSORS_INSMOD_2(lm78, lm79);
41
42/* Many LM78 constants specified below */
43
44/* Length of ISA address segment */
45#define LM78_EXTENT 8

--- 109 unchanged lines hidden (view full) ---

155 s8 temp_hyst; /* Register value */
156 u8 fan_div[3]; /* Register encoding, shifted right */
157 u8 vid; /* Register encoding, combined */
158 u16 alarms; /* Register encoding, combined */
159};
160
161
162static int lm78_attach_adapter(struct i2c_adapter *adapter);
39
40/* Insmod parameters */
41SENSORS_INSMOD_2(lm78, lm79);
42
43/* Many LM78 constants specified below */
44
45/* Length of ISA address segment */
46#define LM78_EXTENT 8

--- 109 unchanged lines hidden (view full) ---

156 s8 temp_hyst; /* Register value */
157 u8 fan_div[3]; /* Register encoding, shifted right */
158 u8 vid; /* Register encoding, combined */
159 u16 alarms; /* Register encoding, combined */
160};
161
162
163static int lm78_attach_adapter(struct i2c_adapter *adapter);
164static int lm78_isa_attach_adapter(struct i2c_adapter *adapter);
163static int lm78_detect(struct i2c_adapter *adapter, int address, int kind);
164static int lm78_detach_client(struct i2c_client *client);
165
166static int lm78_read_value(struct i2c_client *client, u8 register);
167static int lm78_write_value(struct i2c_client *client, u8 register, u8 value);
168static struct lm78_data *lm78_update_device(struct device *dev);
169static void lm78_init_client(struct i2c_client *client);
170

--- 5 unchanged lines hidden (view full) ---

176 .flags = I2C_DF_NOTIFY,
177 .attach_adapter = lm78_attach_adapter,
178 .detach_client = lm78_detach_client,
179};
180
181static struct i2c_driver lm78_isa_driver = {
182 .owner = THIS_MODULE,
183 .name = "lm78-isa",
165static int lm78_detect(struct i2c_adapter *adapter, int address, int kind);
166static int lm78_detach_client(struct i2c_client *client);
167
168static int lm78_read_value(struct i2c_client *client, u8 register);
169static int lm78_write_value(struct i2c_client *client, u8 register, u8 value);
170static struct lm78_data *lm78_update_device(struct device *dev);
171static void lm78_init_client(struct i2c_client *client);
172

--- 5 unchanged lines hidden (view full) ---

178 .flags = I2C_DF_NOTIFY,
179 .attach_adapter = lm78_attach_adapter,
180 .detach_client = lm78_detach_client,
181};
182
183static struct i2c_driver lm78_isa_driver = {
184 .owner = THIS_MODULE,
185 .name = "lm78-isa",
184 .attach_adapter = lm78_attach_adapter,
186 .attach_adapter = lm78_isa_attach_adapter,
185 .detach_client = lm78_detach_client,
186};
187
188
189/* 7 Voltages */
190static ssize_t show_in(struct device *dev, char *buf, int nr)
191{
192 struct lm78_data *data = lm78_update_device(dev);

--- 282 unchanged lines hidden (view full) ---

475 * when a new adapter is inserted (and lm78_driver is still present) */
476static int lm78_attach_adapter(struct i2c_adapter *adapter)
477{
478 if (!(adapter->class & I2C_CLASS_HWMON))
479 return 0;
480 return i2c_detect(adapter, &addr_data, lm78_detect);
481}
482
187 .detach_client = lm78_detach_client,
188};
189
190
191/* 7 Voltages */
192static ssize_t show_in(struct device *dev, char *buf, int nr)
193{
194 struct lm78_data *data = lm78_update_device(dev);

--- 282 unchanged lines hidden (view full) ---

477 * when a new adapter is inserted (and lm78_driver is still present) */
478static int lm78_attach_adapter(struct i2c_adapter *adapter)
479{
480 if (!(adapter->class & I2C_CLASS_HWMON))
481 return 0;
482 return i2c_detect(adapter, &addr_data, lm78_detect);
483}
484
485static int lm78_isa_attach_adapter(struct i2c_adapter *adapter)
486{
487 return lm78_detect(adapter, isa_address, -1);
488}
489
483/* This function is called by i2c_detect */
484int lm78_detect(struct i2c_adapter *adapter, int address, int kind)
485{
486 int i, err;
487 struct i2c_client *new_client;
488 struct lm78_data *data;
489 const char *client_name = "";
490 int is_isa = i2c_is_isa_adapter(adapter);

--- 339 unchanged lines hidden ---
490/* This function is called by i2c_detect */
491int lm78_detect(struct i2c_adapter *adapter, int address, int kind)
492{
493 int i, err;
494 struct i2c_client *new_client;
495 struct lm78_data *data;
496 const char *client_name = "";
497 int is_isa = i2c_is_isa_adapter(adapter);

--- 339 unchanged lines hidden ---