linux/drivers/w1/slaves/w1_ds2805.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * w1_ds2805 - w1 family 0d (DS28E05) driver
 *
 * Copyright (c) 2016 Andrew Worsley [email protected]
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/device.h>
#include <linux/types.h>
#include <linux/delay.h>

#include <linux/w1.h>

#define W1_EEPROM_DS2805

#define W1_F0D_EEPROM_SIZE
#define W1_F0D_PAGE_BITS
#define W1_F0D_PAGE_SIZE
#define W1_F0D_PAGE_MASK

#define W1_F0D_SCRATCH_BITS
#define W1_F0D_SCRATCH_SIZE
#define W1_F0D_SCRATCH_MASK

#define W1_F0D_READ_EEPROM
#define W1_F0D_WRITE_EEPROM
#define W1_F0D_RELEASE

#define W1_F0D_CS_OK

#define W1_F0D_TPROG_MS

#define W1_F0D_READ_RETRIES
#define W1_F0D_READ_MAXLEN

/*
 * Check the file size bounds and adjusts count as needed.
 * This would not be needed if the file size didn't reset to 0 after a write.
 */
static inline size_t w1_f0d_fix_count(loff_t off, size_t count, size_t size)
{}

/*
 * Read a block from W1 ROM two times and compares the results.
 * If they are equal they are returned, otherwise the read
 * is repeated W1_F0D_READ_RETRIES times.
 *
 * count must not exceed W1_F0D_READ_MAXLEN.
 */
static int w1_f0d_readblock(struct w1_slave *sl, int off, int count, char *buf)
{}

static ssize_t w1_f0d_read_bin(struct file *filp, struct kobject *kobj,
			       struct bin_attribute *bin_attr,
			       char *buf, loff_t off, size_t count)
{}

/*
 * Writes to the scratchpad and reads it back for verification.
 * Then copies the scratchpad to EEPROM.
 * The data must be aligned at W1_F0D_SCRATCH_SIZE bytes and
 * must be W1_F0D_SCRATCH_SIZE bytes long.
 * The master must be locked.
 *
 * @param sl	The slave structure
 * @param addr	Address for the write
 * @param len   length must be <= (W1_F0D_PAGE_SIZE - (addr & W1_F0D_PAGE_MASK))
 * @param data	The data to write
 * @return	0=Success -1=failure
 */
static int w1_f0d_write(struct w1_slave *sl, int addr, int len, const u8 *data)
{}

static ssize_t w1_f0d_write_bin(struct file *filp, struct kobject *kobj,
				struct bin_attribute *bin_attr,
				char *buf, loff_t off, size_t count)
{}

static struct bin_attribute w1_f0d_bin_attr =;

static int w1_f0d_add_slave(struct w1_slave *sl)
{}

static void w1_f0d_remove_slave(struct w1_slave *sl)
{}

static const struct w1_family_ops w1_f0d_fops =;

static struct w1_family w1_family_0d =;

module_w1_family();

MODULE_LICENSE();
MODULE_AUTHOR();
MODULE_DESCRIPTION();