linux/drivers/w1/masters/amd_axi_w1.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * amd_axi_w1 - AMD 1Wire programmable logic bus host driver
 *
 * Copyright (C) 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.
 */

#include <linux/atomic.h>
#include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/types.h>
#include <linux/wait.h>

#include <linux/w1.h>

/* 1-wire AMD IP definition */
#define AXIW1_IPID
/* Registers offset */
#define AXIW1_INST_REG
#define AXIW1_CTRL_REG
#define AXIW1_IRQE_REG
#define AXIW1_STAT_REG
#define AXIW1_DATA_REG
#define AXIW1_IPVER_REG
#define AXIW1_IPID_REG
/* Instructions */
#define AXIW1_INITPRES
#define AXIW1_READBIT
#define AXIW1_WRITEBIT
#define AXIW1_READBYTE
#define AXIW1_WRITEBYTE
/* Status flag masks */
#define AXIW1_DONE
#define AXIW1_READY
#define AXIW1_PRESENCE
#define AXIW1_MAJORVER_MASK
#define AXIW1_MINORVER_MASK
/* Control flag */
#define AXIW1_GO
#define AXI_CLEAR
#define AXI_RESET
#define AXIW1_READDATA
/* Interrupt Enable */
#define AXIW1_READY_IRQ_EN
#define AXIW1_DONE_IRQ_EN

#define AXIW1_TIMEOUT

#define DRIVER_NAME

struct amd_axi_w1_local {};

/**
 * amd_axi_w1_wait_irq_interruptible_timeout() - Wait for IRQ with timeout.
 *
 * @amd_axi_w1_local:	Pointer to device structure
 * @IRQ:		IRQ channel to wait on
 *
 * Return:		%0 - OK, %-EINTR - Interrupted, %-EBUSY - Timed out
 */
static int amd_axi_w1_wait_irq_interruptible_timeout(struct amd_axi_w1_local *amd_axi_w1_local,
						     u32 IRQ)
{}

/**
 * amd_axi_w1_touch_bit() - Performs the touch-bit function - write a 0 or 1 and reads the level.
 *
 * @data:	Pointer to device structure
 * @bit:	The level to write
 *
 * Return:	The level read
 */
static u8 amd_axi_w1_touch_bit(void *data, u8 bit)
{}

/**
 * amd_axi_w1_read_byte - Performs the read byte function.
 *
 * @data:	Pointer to device structure
 * Return:	The value read
 */
static u8 amd_axi_w1_read_byte(void *data)
{}

/**
 * amd_axi_w1_write_byte - Performs the write byte function.
 *
 * @data:	The ds2482 channel pointer
 * @val:	The value to write
 */
static void amd_axi_w1_write_byte(void *data, u8 val)
{}

/**
 * amd_axi_w1_reset_bus() - Issues a reset bus sequence.
 *
 * @data:	the bus host data struct
 * Return:	0=Device present, 1=No device present or error
 */
static u8 amd_axi_w1_reset_bus(void *data)
{}

/* Reset the 1-wire AXI IP. Put the IP in reset state and clear registers */
static void amd_axi_w1_reset(struct amd_axi_w1_local *amd_axi_w1_local)
{}

static irqreturn_t amd_axi_w1_irq(int irq, void *lp)
{}

static int amd_axi_w1_probe(struct platform_device *pdev)
{}

static void amd_axi_w1_remove(struct platform_device *pdev)
{}

static const struct of_device_id amd_axi_w1_of_match[] =;
MODULE_DEVICE_TABLE(of, amd_axi_w1_of_match);

static struct platform_driver amd_axi_w1_driver =;
module_platform_driver();

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