21 #include <linux/kernel.h>
22 #include <linux/module.h>
25 #include <linux/slab.h>
26 #include <linux/i2c.h>
41 #define to_zl6100_data(x) container_of(x, struct zl6100_data, info)
43 #define ZL6100_MFR_CONFIG 0xd0
44 #define ZL6100_DEVICE_ID 0xe4
46 #define ZL6100_MFR_XTEMP_ENABLE (1 << 7)
48 #define ZL6100_WAIT_TIME 1000
59 if (delta < data->
delay)
93 static int zl6100_read_byte_data(
struct i2c_client *client,
int page,
int reg)
109 static int zl6100_write_word_data(
struct i2c_client *client,
int page,
int reg,
162 static int zl6100_probe(
struct i2c_client *client,
171 if (!i2c_check_functionality(client->
adapter,
179 dev_err(&client->
dev,
"Failed to read device ID\n");
182 device_id[
ret] =
'\0';
183 dev_info(&client->
dev,
"Device ID %s\n", device_id);
186 for (mid = zl6100_id; mid->
name[0]; mid++) {
191 dev_err(&client->
dev,
"Unsupported device\n");
194 if (id->driver_data != mid->driver_data)
195 dev_notice(&client->
dev,
196 "Device mismatch: Configured %s, detected %s\n",
204 data->
id = mid->driver_data;
250 .probe = zl6100_probe,
252 .id_table = zl6100_id,