Skip to content

Commit

Permalink
Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/jdelvare/staging

* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  i2c-core: i2c bus should support PM entries in struct dev_pm_ops
  i2c: Get rid of I2C_CLIENT_MODULE_PARM
  i2c: Drop I2C_CLIENT_INSMOD_2 to 8
  i2c: Drop I2C_CLIENT_INSMOD_1
  i2c: Get rid of struct i2c_client_address_data
  i2c: Drop the kind parameter from detect callbacks
  • Loading branch information
Linus Torvalds committed Dec 14, 2009
2 parents 3ea6b3d + 54067ee commit 5443040
Show file tree
Hide file tree
Showing 50 changed files with 232 additions and 411 deletions.
2 changes: 1 addition & 1 deletion Documentation/i2c/writing-clients
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static struct i2c_driver foo_driver = {
/* if device autodetection is needed: */
.class = I2C_CLASS_SOMETHING,
.detect = foo_detect,
.address_data = &addr_data,
.address_list = normal_i2c,

.shutdown = foo_shutdown, /* optional */
.suspend = foo_suspend, /* optional */
Expand Down
11 changes: 5 additions & 6 deletions drivers/hwmon/adm1021.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@
static const unsigned short normal_i2c[] = {
0x18, 0x19, 0x1a, 0x29, 0x2a, 0x2b, 0x4c, 0x4d, 0x4e, I2C_CLIENT_END };

/* Insmod parameters */
I2C_CLIENT_INSMOD_8(adm1021, adm1023, max1617, max1617a, thmc10, lm84, gl523sm,
mc1066);
enum chips {
adm1021, adm1023, max1617, max1617a, thmc10, lm84, gl523sm, mc1066 };

/* adm1021 constants specified below */

Expand Down Expand Up @@ -97,7 +96,7 @@ struct adm1021_data {

static int adm1021_probe(struct i2c_client *client,
const struct i2c_device_id *id);
static int adm1021_detect(struct i2c_client *client, int kind,
static int adm1021_detect(struct i2c_client *client,
struct i2c_board_info *info);
static void adm1021_init_client(struct i2c_client *client);
static int adm1021_remove(struct i2c_client *client);
Expand Down Expand Up @@ -130,7 +129,7 @@ static struct i2c_driver adm1021_driver = {
.remove = adm1021_remove,
.id_table = adm1021_id,
.detect = adm1021_detect,
.address_data = &addr_data,
.address_list = normal_i2c,
};

static ssize_t show_temp(struct device *dev,
Expand Down Expand Up @@ -284,7 +283,7 @@ static const struct attribute_group adm1021_group = {
};

/* Return 0 if detection is successful, -ENODEV otherwise */
static int adm1021_detect(struct i2c_client *client, int kind,
static int adm1021_detect(struct i2c_client *client,
struct i2c_board_info *info)
{
struct i2c_adapter *adapter = client->adapter;
Expand Down
12 changes: 4 additions & 8 deletions drivers/hwmon/adm1025.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,7 @@

static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END };

/*
* Insmod parameters
*/

I2C_CLIENT_INSMOD_2(adm1025, ne1619);
enum chips { adm1025, ne1619 };

/*
* The ADM1025 registers
Expand Down Expand Up @@ -111,7 +107,7 @@ static const int in_scale[6] = { 2500, 2250, 3300, 5000, 12000, 3300 };

static int adm1025_probe(struct i2c_client *client,
const struct i2c_device_id *id);
static int adm1025_detect(struct i2c_client *client, int kind,
static int adm1025_detect(struct i2c_client *client,
struct i2c_board_info *info);
static void adm1025_init_client(struct i2c_client *client);
static int adm1025_remove(struct i2c_client *client);
Expand All @@ -137,7 +133,7 @@ static struct i2c_driver adm1025_driver = {
.remove = adm1025_remove,
.id_table = adm1025_id,
.detect = adm1025_detect,
.address_data = &addr_data,
.address_list = normal_i2c,
};

/*
Expand Down Expand Up @@ -409,7 +405,7 @@ static const struct attribute_group adm1025_group_in4 = {
};

/* Return 0 if detection is successful, -ENODEV otherwise */
static int adm1025_detect(struct i2c_client *client, int kind,
static int adm1025_detect(struct i2c_client *client,
struct i2c_board_info *info)
{
struct i2c_adapter *adapter = client->adapter;
Expand Down
11 changes: 4 additions & 7 deletions drivers/hwmon/adm1026.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@
/* Addresses to scan */
static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END };

/* Insmod parameters */
I2C_CLIENT_INSMOD_1(adm1026);

static int gpio_input[17] = { -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1 };
static int gpio_output[17] = { -1, -1, -1, -1, -1, -1, -1, -1, -1,
Expand Down Expand Up @@ -293,7 +290,7 @@ struct adm1026_data {

static int adm1026_probe(struct i2c_client *client,
const struct i2c_device_id *id);
static int adm1026_detect(struct i2c_client *client, int kind,
static int adm1026_detect(struct i2c_client *client,
struct i2c_board_info *info);
static int adm1026_remove(struct i2c_client *client);
static int adm1026_read_value(struct i2c_client *client, u8 reg);
Expand All @@ -305,7 +302,7 @@ static void adm1026_init_client(struct i2c_client *client);


static const struct i2c_device_id adm1026_id[] = {
{ "adm1026", adm1026 },
{ "adm1026", 0 },
{ }
};
MODULE_DEVICE_TABLE(i2c, adm1026_id);
Expand All @@ -319,7 +316,7 @@ static struct i2c_driver adm1026_driver = {
.remove = adm1026_remove,
.id_table = adm1026_id,
.detect = adm1026_detect,
.address_data = &addr_data,
.address_list = normal_i2c,
};

static int adm1026_read_value(struct i2c_client *client, u8 reg)
Expand Down Expand Up @@ -1650,7 +1647,7 @@ static const struct attribute_group adm1026_group_in8_9 = {
};

/* Return 0 if detection is successful, -ENODEV otherwise */
static int adm1026_detect(struct i2c_client *client, int kind,
static int adm1026_detect(struct i2c_client *client,
struct i2c_board_info *info)
{
struct i2c_adapter *adapter = client->adapter;
Expand Down
14 changes: 4 additions & 10 deletions drivers/hwmon/adm1029.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@ static const unsigned short normal_i2c[] = { 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d,
0x2e, 0x2f, I2C_CLIENT_END
};

/*
* Insmod parameters
*/

I2C_CLIENT_INSMOD_1(adm1029);

/*
* The ADM1029 registers
* Manufacturer ID is 0x41 for Analog Devices
Expand Down Expand Up @@ -117,7 +111,7 @@ static const u8 ADM1029_REG_FAN_DIV[] = {

static int adm1029_probe(struct i2c_client *client,
const struct i2c_device_id *id);
static int adm1029_detect(struct i2c_client *client, int kind,
static int adm1029_detect(struct i2c_client *client,
struct i2c_board_info *info);
static int adm1029_remove(struct i2c_client *client);
static struct adm1029_data *adm1029_update_device(struct device *dev);
Expand All @@ -128,7 +122,7 @@ static int adm1029_init_client(struct i2c_client *client);
*/

static const struct i2c_device_id adm1029_id[] = {
{ "adm1029", adm1029 },
{ "adm1029", 0 },
{ }
};
MODULE_DEVICE_TABLE(i2c, adm1029_id);
Expand All @@ -142,7 +136,7 @@ static struct i2c_driver adm1029_driver = {
.remove = adm1029_remove,
.id_table = adm1029_id,
.detect = adm1029_detect,
.address_data = &addr_data,
.address_list = normal_i2c,
};

/*
Expand Down Expand Up @@ -297,7 +291,7 @@ static const struct attribute_group adm1029_group = {
*/

/* Return 0 if detection is successful, -ENODEV otherwise */
static int adm1029_detect(struct i2c_client *client, int kind,
static int adm1029_detect(struct i2c_client *client,
struct i2c_board_info *info)
{
struct i2c_adapter *adapter = client->adapter;
Expand Down
9 changes: 4 additions & 5 deletions drivers/hwmon/adm1031.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@
/* Addresses to scan */
static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, I2C_CLIENT_END };

/* Insmod parameters */
I2C_CLIENT_INSMOD_2(adm1030, adm1031);
enum chips { adm1030, adm1031 };

typedef u8 auto_chan_table_t[8][2];

Expand Down Expand Up @@ -102,7 +101,7 @@ struct adm1031_data {

static int adm1031_probe(struct i2c_client *client,
const struct i2c_device_id *id);
static int adm1031_detect(struct i2c_client *client, int kind,
static int adm1031_detect(struct i2c_client *client,
struct i2c_board_info *info);
static void adm1031_init_client(struct i2c_client *client);
static int adm1031_remove(struct i2c_client *client);
Expand All @@ -125,7 +124,7 @@ static struct i2c_driver adm1031_driver = {
.remove = adm1031_remove,
.id_table = adm1031_id,
.detect = adm1031_detect,
.address_data = &addr_data,
.address_list = normal_i2c,
};

static inline u8 adm1031_read_value(struct i2c_client *client, u8 reg)
Expand Down Expand Up @@ -813,7 +812,7 @@ static const struct attribute_group adm1031_group_opt = {
};

/* Return 0 if detection is successful, -ENODEV otherwise */
static int adm1031_detect(struct i2c_client *client, int kind,
static int adm1031_detect(struct i2c_client *client,
struct i2c_board_info *info)
{
struct i2c_adapter *adapter = client->adapter;
Expand Down
9 changes: 4 additions & 5 deletions drivers/hwmon/adm9240.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@
static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, 0x2f,
I2C_CLIENT_END };

/* Insmod parameters */
I2C_CLIENT_INSMOD_3(adm9240, ds1780, lm81);
enum chips { adm9240, ds1780, lm81 };

/* ADM9240 registers */
#define ADM9240_REG_MAN_ID 0x3e
Expand Down Expand Up @@ -132,7 +131,7 @@ static inline unsigned int AOUT_FROM_REG(u8 reg)

static int adm9240_probe(struct i2c_client *client,
const struct i2c_device_id *id);
static int adm9240_detect(struct i2c_client *client, int kind,
static int adm9240_detect(struct i2c_client *client,
struct i2c_board_info *info);
static void adm9240_init_client(struct i2c_client *client);
static int adm9240_remove(struct i2c_client *client);
Expand All @@ -156,7 +155,7 @@ static struct i2c_driver adm9240_driver = {
.remove = adm9240_remove,
.id_table = adm9240_id,
.detect = adm9240_detect,
.address_data = &addr_data,
.address_list = normal_i2c,
};

/* per client data */
Expand Down Expand Up @@ -545,7 +544,7 @@ static const struct attribute_group adm9240_group = {
/*** sensor chip detect and driver install ***/

/* Return 0 if detection is successful, -ENODEV otherwise */
static int adm9240_detect(struct i2c_client *new_client, int kind,
static int adm9240_detect(struct i2c_client *new_client,
struct i2c_board_info *info)
{
struct i2c_adapter *adapter = new_client->adapter;
Expand Down
13 changes: 5 additions & 8 deletions drivers/hwmon/ads7828.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@
static const unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b,
I2C_CLIENT_END };

/* Insmod parameters */
I2C_CLIENT_INSMOD_1(ads7828);

/* Other module parameters */
/* Module parameters */
static int se_input = 1; /* Default is SE, 0 == diff */
static int int_vref = 1; /* Default is internal ref ON */
static int vref_mv = ADS7828_INT_VREF_MV; /* set if vref != 2.5V */
Expand All @@ -72,7 +69,7 @@ struct ads7828_data {
};

/* Function declaration - necessary due to function dependencies */
static int ads7828_detect(struct i2c_client *client, int kind,
static int ads7828_detect(struct i2c_client *client,
struct i2c_board_info *info);
static int ads7828_probe(struct i2c_client *client,
const struct i2c_device_id *id);
Expand Down Expand Up @@ -168,7 +165,7 @@ static int ads7828_remove(struct i2c_client *client)
}

static const struct i2c_device_id ads7828_id[] = {
{ "ads7828", ads7828 },
{ "ads7828", 0 },
{ }
};
MODULE_DEVICE_TABLE(i2c, ads7828_id);
Expand All @@ -183,11 +180,11 @@ static struct i2c_driver ads7828_driver = {
.remove = ads7828_remove,
.id_table = ads7828_id,
.detect = ads7828_detect,
.address_data = &addr_data,
.address_list = normal_i2c,
};

/* Return 0 if detection is successful, -ENODEV otherwise */
static int ads7828_detect(struct i2c_client *client, int kind,
static int ads7828_detect(struct i2c_client *client,
struct i2c_board_info *info)
{
struct i2c_adapter *adapter = client->adapter;
Expand Down
11 changes: 4 additions & 7 deletions drivers/hwmon/adt7462.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
/* Addresses to scan */
static const unsigned short normal_i2c[] = { 0x58, 0x5C, I2C_CLIENT_END };

/* Insmod parameters */
I2C_CLIENT_INSMOD_1(adt7462);

/* ADT7462 registers */
#define ADT7462_REG_DEVICE 0x3D
#define ADT7462_REG_VENDOR 0x3E
Expand Down Expand Up @@ -237,12 +234,12 @@ struct adt7462_data {

static int adt7462_probe(struct i2c_client *client,
const struct i2c_device_id *id);
static int adt7462_detect(struct i2c_client *client, int kind,
static int adt7462_detect(struct i2c_client *client,
struct i2c_board_info *info);
static int adt7462_remove(struct i2c_client *client);

static const struct i2c_device_id adt7462_id[] = {
{ "adt7462", adt7462 },
{ "adt7462", 0 },
{ }
};
MODULE_DEVICE_TABLE(i2c, adt7462_id);
Expand All @@ -256,7 +253,7 @@ static struct i2c_driver adt7462_driver = {
.remove = adt7462_remove,
.id_table = adt7462_id,
.detect = adt7462_detect,
.address_data = &addr_data,
.address_list = normal_i2c,
};

/*
Expand Down Expand Up @@ -1902,7 +1899,7 @@ static struct attribute *adt7462_attr[] =
};

/* Return 0 if detection is successful, -ENODEV otherwise */
static int adt7462_detect(struct i2c_client *client, int kind,
static int adt7462_detect(struct i2c_client *client,
struct i2c_board_info *info)
{
struct i2c_adapter *adapter = client->adapter;
Expand Down
11 changes: 4 additions & 7 deletions drivers/hwmon/adt7470.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
/* Addresses to scan */
static const unsigned short normal_i2c[] = { 0x2C, 0x2E, 0x2F, I2C_CLIENT_END };

/* Insmod parameters */
I2C_CLIENT_INSMOD_1(adt7470);

/* ADT7470 registers */
#define ADT7470_REG_BASE_ADDR 0x20
#define ADT7470_REG_TEMP_BASE_ADDR 0x20
Expand Down Expand Up @@ -177,12 +174,12 @@ struct adt7470_data {

static int adt7470_probe(struct i2c_client *client,
const struct i2c_device_id *id);
static int adt7470_detect(struct i2c_client *client, int kind,
static int adt7470_detect(struct i2c_client *client,
struct i2c_board_info *info);
static int adt7470_remove(struct i2c_client *client);

static const struct i2c_device_id adt7470_id[] = {
{ "adt7470", adt7470 },
{ "adt7470", 0 },
{ }
};
MODULE_DEVICE_TABLE(i2c, adt7470_id);
Expand All @@ -196,7 +193,7 @@ static struct i2c_driver adt7470_driver = {
.remove = adt7470_remove,
.id_table = adt7470_id,
.detect = adt7470_detect,
.address_data = &addr_data,
.address_list = normal_i2c,
};

/*
Expand Down Expand Up @@ -1225,7 +1222,7 @@ static struct attribute *adt7470_attr[] =
};

/* Return 0 if detection is successful, -ENODEV otherwise */
static int adt7470_detect(struct i2c_client *client, int kind,
static int adt7470_detect(struct i2c_client *client,
struct i2c_board_info *info)
{
struct i2c_adapter *adapter = client->adapter;
Expand Down
Loading

0 comments on commit 5443040

Please sign in to comment.