16 #include <linux/kernel.h>
17 #include <linux/module.h>
18 #include <linux/device.h>
19 #include <linux/types.h>
25 #include "../w1_int.h"
26 #include "../w1_family.h"
57 struct w1_slave *sl =
container_of(dev,
struct w1_slave, dev);
65 ret = w1_ds2780_do_io(dev, buf, addr, count, io);
75 struct w1_slave *sl =
container_of(dev,
struct w1_slave, dev);
92 static ssize_t w1_ds2780_read_bin(
struct file *filp,
95 char *buf, loff_t off,
size_t count)
107 .read = w1_ds2780_read_bin,
112 static int w1_ds2780_add_slave(
struct w1_slave *sl)
127 goto pdev_alloc_failed;
129 pdev->
dev.parent = &sl->dev;
133 goto pdev_add_failed;
137 goto bin_attr_failed;
152 static void w1_ds2780_remove_slave(
struct w1_slave *sl)
163 .add_slave = w1_ds2780_add_slave,
164 .remove_slave = w1_ds2780_remove_slave,
167 static struct w1_family w1_ds2780_family = {
169 .fops = &w1_ds2780_fops,
172 static int __init w1_ds2780_init(
void)
178 static void __exit w1_ds2780_exit(
void)
189 MODULE_DESCRIPTION(
"1-wire Driver for Maxim/Dallas DS2780 Stand-Alone Fuel Gauge IC");