linux/drivers/spmi/hisi-spmi-controller.c

// SPDX-License-Identifier: GPL-2.0

#include <linux/delay.h>
#include <linux/err.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <linux/spmi.h>

/*
 * SPMI register addr
 */
#define SPMI_CHANNEL_OFFSET
#define SPMI_SLAVE_OFFSET

#define SPMI_APB_SPMI_CMD_BASE_ADDR

#define SPMI_APB_SPMI_WDATA0_BASE_ADDR
#define SPMI_APB_SPMI_WDATA1_BASE_ADDR
#define SPMI_APB_SPMI_WDATA2_BASE_ADDR
#define SPMI_APB_SPMI_WDATA3_BASE_ADDR

#define SPMI_APB_SPMI_STATUS_BASE_ADDR

#define SPMI_APB_SPMI_RDATA0_BASE_ADDR
#define SPMI_APB_SPMI_RDATA1_BASE_ADDR
#define SPMI_APB_SPMI_RDATA2_BASE_ADDR
#define SPMI_APB_SPMI_RDATA3_BASE_ADDR

#define SPMI_PER_DATAREG_BYTE
/*
 * SPMI cmd register
 */
#define SPMI_APB_SPMI_CMD_EN
#define SPMI_APB_SPMI_CMD_TYPE_OFFSET
#define SPMI_APB_SPMI_CMD_LENGTH_OFFSET
#define SPMI_APB_SPMI_CMD_SLAVEID_OFFSET
#define SPMI_APB_SPMI_CMD_ADDR_OFFSET

/* Command Opcodes */

enum spmi_controller_cmd_op_code {};

/*
 * SPMI status register
 */
#define SPMI_APB_TRANS_DONE
#define SPMI_APB_TRANS_FAIL

/* Command register fields */
#define SPMI_CONTROLLER_CMD_MAX_BYTE_COUNT

/* Maximum number of support PMIC peripherals */
#define SPMI_CONTROLLER_TIMEOUT_US
#define SPMI_CONTROLLER_MAX_TRANS_BYTES

struct spmi_controller_dev {};

static int spmi_controller_wait_for_done(struct device *dev,
					 struct spmi_controller_dev *ctrl_dev,
					 void __iomem *base, u8 sid, u16 addr)
{}

static int spmi_read_cmd(struct spmi_controller *ctrl,
			 u8 opc, u8 slave_id, u16 slave_addr, u8 *__buf, size_t bc)
{}

static int spmi_write_cmd(struct spmi_controller *ctrl,
			  u8 opc, u8 slave_id, u16 slave_addr, const u8 *__buf, size_t bc)
{}

static int spmi_controller_probe(struct platform_device *pdev)
{}

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

static struct platform_driver spmi_controller_driver =;

static int __init spmi_controller_init(void)
{}
postcore_initcall(spmi_controller_init);

static void __exit spmi_controller_exit(void)
{}
module_exit(spmi_controller_exit);

MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_VERSION();
MODULE_ALIAS();