Lines Matching defs:chip
30 static int ad714x_i2c_write(struct ad714x_chip *chip,
33 struct i2c_client *client = to_i2c_client(chip->dev);
36 chip->xfer_buf[0] = cpu_to_be16(reg);
37 chip->xfer_buf[1] = cpu_to_be16(data);
39 error = i2c_master_send(client, (u8 *)chip->xfer_buf,
40 2 * sizeof(*chip->xfer_buf));
49 static int ad714x_i2c_read(struct ad714x_chip *chip,
52 struct i2c_client *client = to_i2c_client(chip->dev);
56 chip->xfer_buf[0] = cpu_to_be16(reg);
58 error = i2c_master_send(client, (u8 *)chip->xfer_buf,
59 sizeof(*chip->xfer_buf));
61 error = i2c_master_recv(client, (u8 *)chip->xfer_buf,
62 len * sizeof(*chip->xfer_buf));
70 data[i] = be16_to_cpu(chip->xfer_buf[i]);
78 struct ad714x_chip *chip;
80 chip = ad714x_probe(&client->dev, BUS_I2C, client->irq,
82 if (IS_ERR(chip))
83 return PTR_ERR(chip);
85 i2c_set_clientdata(client, chip);
92 struct ad714x_chip *chip = i2c_get_clientdata(client);
94 ad714x_remove(chip);