linux/drivers/mfd/ssbi.c

// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2009-2013, The Linux Foundation. All rights reserved.
 * Copyright (c) 2010, Google Inc.
 *
 * Original authors: Code Aurora Forum
 *
 * Author: Dima Zavin <[email protected]>
 *  - Largely rewritten from original to not be an i2c driver.
 */

#define pr_fmt(fmt)

#include <linux/delay.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/ssbi.h>

/* SSBI 2.0 controller registers */
#define SSBI2_CMD
#define SSBI2_RD
#define SSBI2_STATUS
#define SSBI2_MODE2

/* SSBI_CMD fields */
#define SSBI_CMD_RDWRN

/* SSBI_STATUS fields */
#define SSBI_STATUS_RD_READY
#define SSBI_STATUS_READY
#define SSBI_STATUS_MCHN_BUSY

/* SSBI_MODE2 fields */
#define SSBI_MODE2_REG_ADDR_15_8_SHFT
#define SSBI_MODE2_REG_ADDR_15_8_MASK

#define SET_SSBI_MODE2_REG_ADDR_15_8(MD, AD)

/* SSBI PMIC Arbiter command registers */
#define SSBI_PA_CMD
#define SSBI_PA_RD_STATUS

/* SSBI_PA_CMD fields */
#define SSBI_PA_CMD_RDWRN
#define SSBI_PA_CMD_ADDR_MASK

/* SSBI_PA_RD_STATUS fields */
#define SSBI_PA_RD_STATUS_TRANS_DONE
#define SSBI_PA_RD_STATUS_TRANS_DENIED

#define SSBI_TIMEOUT_US

enum ssbi_controller_type {};

struct ssbi {};

static inline u32 ssbi_readl(struct ssbi *ssbi, u32 reg)
{}

static inline void ssbi_writel(struct ssbi *ssbi, u32 val, u32 reg)
{}

/*
 * Via private exchange with one of the original authors, the hardware
 * should generally finish a transaction in about 5us.  The worst
 * case, is when using the arbiter and both other CPUs have just
 * started trying to use the SSBI bus will result in a time of about
 * 20us.  It should never take longer than this.
 *
 * As such, this wait merely spins, with a udelay.
 */
static int ssbi_wait_mask(struct ssbi *ssbi, u32 set_mask, u32 clr_mask)
{}

static int
ssbi_read_bytes(struct ssbi *ssbi, u16 addr, u8 *buf, int len)
{}

static int
ssbi_write_bytes(struct ssbi *ssbi, u16 addr, const u8 *buf, int len)
{}

/*
 * See ssbi_wait_mask for an explanation of the time and the
 * busywait.
 */
static inline int
ssbi_pa_transfer(struct ssbi *ssbi, u32 cmd, u8 *data)
{}

static int
ssbi_pa_read_bytes(struct ssbi *ssbi, u16 addr, u8 *buf, int len)
{}

static int
ssbi_pa_write_bytes(struct ssbi *ssbi, u16 addr, const u8 *buf, int len)
{}

int ssbi_read(struct device *dev, u16 addr, u8 *buf, int len)
{}
EXPORT_SYMBOL_GPL();

int ssbi_write(struct device *dev, u16 addr, const u8 *buf, int len)
{}
EXPORT_SYMBOL_GPL();

static int ssbi_probe(struct platform_device *pdev)
{}

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

static struct platform_driver ssbi_driver =;
module_platform_driver();

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