linux/drivers/mailbox/hi3660-mailbox.c

// SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2017-2018 HiSilicon Limited.
// Copyright (c) 2017-2018 Linaro Limited.

#include <linux/bitops.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/mailbox_controller.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/slab.h>

#include "mailbox.h"

#define MBOX_CHAN_MAX

#define MBOX_RX
#define MBOX_TX

#define MBOX_BASE(mbox, ch)
#define MBOX_SRC_REG
#define MBOX_DST_REG
#define MBOX_DCLR_REG
#define MBOX_DSTAT_REG
#define MBOX_MODE_REG
#define MBOX_IMASK_REG
#define MBOX_ICLR_REG
#define MBOX_SEND_REG
#define MBOX_DATA_REG

#define MBOX_IPC_LOCK_REG
#define MBOX_IPC_UNLOCK

#define MBOX_AUTOMATIC_ACK

#define MBOX_STATE_IDLE
#define MBOX_STATE_READY
#define MBOX_STATE_ACK

#define MBOX_MSG_LEN

/**
 * struct hi3660_chan_info - Hi3660 mailbox channel information
 * @dst_irq:	Interrupt vector for remote processor
 * @ack_irq:	Interrupt vector for local processor
 *
 * A channel can be used for TX or RX, it can trigger remote
 * processor interrupt to notify remote processor and can receive
 * interrupt if it has an incoming message.
 */
struct hi3660_chan_info {};

/**
 * struct hi3660_mbox - Hi3660 mailbox controller data
 * @dev:	Device to which it is attached
 * @base:	Base address of the register mapping region
 * @chan:	Representation of channels in mailbox controller
 * @mchan:	Representation of channel info
 * @controller:	Representation of a communication channel controller
 *
 * Mailbox controller includes 32 channels and can allocate
 * channel for message transferring.
 */
struct hi3660_mbox {};

static struct hi3660_mbox *to_hi3660_mbox(struct mbox_controller *mbox)
{}

static int hi3660_mbox_check_state(struct mbox_chan *chan)
{}

static int hi3660_mbox_unlock(struct mbox_chan *chan)
{}

static int hi3660_mbox_acquire_channel(struct mbox_chan *chan)
{}

static int hi3660_mbox_startup(struct mbox_chan *chan)
{}

static int hi3660_mbox_send_data(struct mbox_chan *chan, void *msg)
{}

static const struct mbox_chan_ops hi3660_mbox_ops =;

static struct mbox_chan *hi3660_mbox_xlate(struct mbox_controller *controller,
					   const struct of_phandle_args *spec)
{}

static const struct of_device_id hi3660_mbox_of_match[] =;

MODULE_DEVICE_TABLE(of, hi3660_mbox_of_match);

static int hi3660_mbox_probe(struct platform_device *pdev)
{}

static struct platform_driver hi3660_mbox_driver =;

static int __init hi3660_mbox_init(void)
{}
core_initcall(hi3660_mbox_init);

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

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