14 #include <linux/kernel.h>
15 #include <linux/module.h>
16 #include <linux/device.h>
17 #include <linux/types.h>
23 #include "../w1_int.h"
24 #include "../w1_family.h"
55 struct w1_slave *sl =
container_of(dev,
struct w1_slave, dev);
63 ret = w1_ds2781_do_io(dev, buf, addr, count, io);
73 struct w1_slave *sl =
container_of(dev,
struct w1_slave, dev);
90 static ssize_t w1_ds2781_read_bin(
struct file *filp,
93 char *buf, loff_t off,
size_t count)
105 .read = w1_ds2781_read_bin,
110 static int w1_ds2781_add_slave(
struct w1_slave *sl)
125 goto pdev_alloc_failed;
127 pdev->
dev.parent = &sl->dev;
131 goto pdev_add_failed;
135 goto bin_attr_failed;
150 static void w1_ds2781_remove_slave(
struct w1_slave *sl)
161 .add_slave = w1_ds2781_add_slave,
162 .remove_slave = w1_ds2781_remove_slave,
165 static struct w1_family w1_ds2781_family = {
167 .fops = &w1_ds2781_fops,
170 static int __init w1_ds2781_init(
void)
176 static void __exit w1_ds2781_exit(
void)
187 MODULE_DESCRIPTION(
"1-wire Driver for Maxim/Dallas DS2781 Stand-Alone Fuel Gauge IC");