Lines Matching refs:data
61 struct atxp1_data *data = dev_get_drvdata(dev); in atxp1_update_device() local
62 struct i2c_client *client = data->client; in atxp1_update_device()
64 mutex_lock(&data->update_lock); in atxp1_update_device()
66 if (time_after(jiffies, data->last_updated + HZ) || !data->valid) { in atxp1_update_device()
69 data->reg.vid = i2c_smbus_read_byte_data(client, ATXP1_VID); in atxp1_update_device()
70 data->reg.cpu_vid = i2c_smbus_read_byte_data(client, in atxp1_update_device()
72 data->reg.gpio1 = i2c_smbus_read_byte_data(client, ATXP1_GPIO1); in atxp1_update_device()
73 data->reg.gpio2 = i2c_smbus_read_byte_data(client, ATXP1_GPIO2); in atxp1_update_device()
75 data->valid = 1; in atxp1_update_device()
78 mutex_unlock(&data->update_lock); in atxp1_update_device()
80 return data; in atxp1_update_device()
88 struct atxp1_data *data; in atxp1_showvcore() local
90 data = atxp1_update_device(dev); in atxp1_showvcore()
92 size = sprintf(buf, "%d\n", vid_from_reg(data->reg.vid & ATXP1_VIDMASK, in atxp1_showvcore()
93 data->vrm)); in atxp1_showvcore()
102 struct atxp1_data *data = atxp1_update_device(dev); in atxp1_storevcore() local
103 struct i2c_client *client = data->client; in atxp1_storevcore()
116 vid = vid_to_reg(vcore, data->vrm); in atxp1_storevcore()
126 if (data->reg.vid & ATXP1_VIDENA) in atxp1_storevcore()
127 cvid = data->reg.vid & ATXP1_VIDMASK; in atxp1_storevcore()
129 cvid = data->reg.cpu_vid; in atxp1_storevcore()
148 data->valid = 0; in atxp1_storevcore()
165 struct atxp1_data *data; in atxp1_showgpio1() local
167 data = atxp1_update_device(dev); in atxp1_showgpio1()
169 size = sprintf(buf, "0x%02x\n", data->reg.gpio1 & ATXP1_GPIO1MASK); in atxp1_showgpio1()
178 struct atxp1_data *data = atxp1_update_device(dev); in atxp1_storegpio1() local
179 struct i2c_client *client = data->client; in atxp1_storegpio1()
189 if (value != (data->reg.gpio1 & ATXP1_GPIO1MASK)) { in atxp1_storegpio1()
194 data->valid = 0; in atxp1_storegpio1()
211 struct atxp1_data *data; in atxp1_showgpio2() local
213 data = atxp1_update_device(dev); in atxp1_showgpio2()
215 size = sprintf(buf, "0x%02x\n", data->reg.gpio2); in atxp1_showgpio2()
224 struct atxp1_data *data = atxp1_update_device(dev); in atxp1_storegpio2() local
225 struct i2c_client *client = data->client; in atxp1_storegpio2()
234 if (value != data->reg.gpio2) { in atxp1_storegpio2()
239 data->valid = 0; in atxp1_storegpio2()
263 struct atxp1_data *data; in atxp1_probe() local
266 data = devm_kzalloc(dev, sizeof(struct atxp1_data), GFP_KERNEL); in atxp1_probe()
267 if (!data) in atxp1_probe()
271 data->vrm = vid_which_vrm(); in atxp1_probe()
272 if (data->vrm != 90 && data->vrm != 91) { in atxp1_probe()
274 data->vrm / 10, data->vrm % 10); in atxp1_probe()
278 data->client = client; in atxp1_probe()
279 mutex_init(&data->update_lock); in atxp1_probe()
282 data, in atxp1_probe()
287 dev_info(dev, "Using VRM: %d.%d\n", data->vrm / 10, data->vrm % 10); in atxp1_probe()