10 #include <linux/module.h>
18 return spi_write(client, &data, 1);
24 return spi_write(client, data, 2);
30 return spi_write(client, data, 3);
33 static int read8(
void *
client)
37 ret = spi_read(client, &data, 1);
44 static int read16(
void *client,
u8 reg)
49 write16(client, reg, 0);
50 ret = spi_read(client, buf_rx, 2);
54 return (buf_rx[0] << 8) | buf_rx[1];
57 static int read24(
void *client,
u8 reg)
62 write24(client, reg, 0);
63 ret = spi_read(client, buf_rx, 3);
67 return (buf_rx[1] << 8) | buf_rx[2];
75 .write_r8d8 = write16,
76 .write_r8d16 = write24,
128 static struct spi_driver ad_dpot_spi_driver = {
133 .probe = ad_dpot_spi_probe,
135 .id_table = ad_dpot_spi_id,