#include <linux/crc16.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/i2c.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/uaccess.h>
#define CRC16_INIT …
#include <linux/w1.h>
#define W1_FAMILY_DS28E17 …
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_ALIAS(…) …;
static int i2c_speed = …;
module_param_named(speed, i2c_speed, int, 0600);
MODULE_PARM_DESC(…) …;
static char i2c_stretch = …;
module_param_named(stretch, i2c_stretch, byte, 0600);
MODULE_PARM_DESC(…) …;
#define W1_F19_WRITE_DATA_WITH_STOP …
#define W1_F19_WRITE_DATA_NO_STOP …
#define W1_F19_WRITE_DATA_ONLY …
#define W1_F19_WRITE_DATA_ONLY_WITH_STOP …
#define W1_F19_READ_DATA_WITH_STOP …
#define W1_F19_WRITE_READ_DATA_WITH_STOP …
#define W1_F19_WRITE_CONFIGURATION …
#define W1_F19_READ_CONFIGURATION …
#define W1_F19_ENABLE_SLEEP_MODE …
#define W1_F19_READ_DEVICE_REVISION …
#define W1_F19_STATUS_CRC …
#define W1_F19_STATUS_ADDRESS …
#define W1_F19_STATUS_START …
#define W1_F19_WRITE_DATA_LIMIT …
#define W1_F19_READ_DATA_LIMIT …
#define W1_F19_BUSY_TIMEBASES …
#define W1_F19_BUSY_GRATUITY …
#define W1_F19_BUSY_CHECKS …
struct w1_f19_data { … };
static int w1_f19_i2c_busy_wait(struct w1_slave *sl, size_t count)
{ … }
static size_t w1_f19_error(struct w1_slave *sl, u8 w1_buf[])
{ … }
static int __w1_f19_i2c_write(struct w1_slave *sl,
const u8 *command, size_t command_count,
const u8 *buffer, size_t count)
{ … }
static int w1_f19_i2c_write(struct w1_slave *sl, u16 i2c_address,
const u8 *buffer, size_t count, bool stop)
{ … }
static int w1_f19_i2c_read(struct w1_slave *sl, u16 i2c_address,
u8 *buffer, size_t count)
{ … }
static int w1_f19_i2c_write_read(struct w1_slave *sl, u16 i2c_address,
const u8 *wbuffer, size_t wcount, u8 *rbuffer, size_t rcount)
{ … }
static int w1_f19_i2c_master_transfer(struct i2c_adapter *adapter,
struct i2c_msg *msgs, int num)
{ … }
static u32 w1_f19_i2c_functionality(struct i2c_adapter *adapter)
{ … }
static const struct i2c_adapter_quirks w1_f19_i2c_adapter_quirks = …;
static const struct i2c_algorithm w1_f19_i2c_algorithm = …;
static int w1_f19_get_i2c_speed(struct w1_slave *sl)
{ … }
static int __w1_f19_set_i2c_speed(struct w1_slave *sl, u8 speed)
{ … }
static int w1_f19_set_i2c_speed(struct w1_slave *sl, u8 speed)
{ … }
static ssize_t speed_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t speed_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(speed);
static ssize_t stretch_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t stretch_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(stretch);
static struct attribute *w1_f19_attrs[] = …;
static const struct attribute_group w1_f19_group = …;
static const struct attribute_group *w1_f19_groups[] = …;
static int w1_f19_add_slave(struct w1_slave *sl)
{ … }
static void w1_f19_remove_slave(struct w1_slave *sl)
{ … }
static const struct w1_family_ops w1_f19_fops = …;
static struct w1_family w1_family_19 = …;
module_w1_family(…);