13 #include <linux/module.h>
17 #include <linux/slab.h>
22 static int max7301_spi_write(
struct device *
dev,
unsigned int reg,
26 u16 word = ((reg & 0x7F) << 8) | (val & 0xFF);
28 return spi_write(spi, (
const u8 *)&word,
sizeof(word));
33 static int max7301_spi_read(
struct device *dev,
unsigned int reg)
39 word = 0x8000 | (reg << 8);
40 ret = spi_write(spi, (
const u8 *)&word,
sizeof(word));
47 ret = spi_read(spi, (
u8 *)&word,
sizeof(word));
68 ts->
read = max7301_spi_read;
69 ts->
write = max7301_spi_write;
94 .probe = max7301_probe,
96 .id_table = max7301_id,
99 static int __init max7301_init(
void)
108 static void __exit max7301_exit(
void)
110 spi_unregister_driver(&max7301_driver);