linux/drivers/mailbox/sprd-mailbox.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Spreadtrum mailbox driver
 *
 * Copyright (c) 2020 Spreadtrum Communications Inc.
 */

#include <linux/delay.h>
#include <linux/err.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/mailbox_controller.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/clk.h>

#define SPRD_MBOX_ID
#define SPRD_MBOX_MSG_LOW
#define SPRD_MBOX_MSG_HIGH
#define SPRD_MBOX_TRIGGER
#define SPRD_MBOX_FIFO_RST
#define SPRD_MBOX_FIFO_STS
#define SPRD_MBOX_IRQ_STS
#define SPRD_MBOX_IRQ_MSK
#define SPRD_MBOX_LOCK
#define SPRD_MBOX_FIFO_DEPTH

/* Bit and mask definition for inbox's SPRD_MBOX_FIFO_STS register */
#define SPRD_INBOX_FIFO_DELIVER_MASK
#define SPRD_INBOX_FIFO_OVERLOW_MASK
#define SPRD_INBOX_FIFO_DELIVER_SHIFT
#define SPRD_INBOX_FIFO_BUSY_MASK

/* Bit and mask definition for SPRD_MBOX_IRQ_STS register */
#define SPRD_MBOX_IRQ_CLR

/* Bit and mask definition for outbox's SPRD_MBOX_FIFO_STS register */
#define SPRD_OUTBOX_FIFO_FULL
#define SPRD_OUTBOX_FIFO_WR_SHIFT
#define SPRD_OUTBOX_FIFO_RD_SHIFT
#define SPRD_OUTBOX_FIFO_POS_MASK

/* Bit and mask definition for inbox's SPRD_MBOX_IRQ_MSK register */
#define SPRD_INBOX_FIFO_BLOCK_IRQ
#define SPRD_INBOX_FIFO_OVERFLOW_IRQ
#define SPRD_INBOX_FIFO_DELIVER_IRQ
#define SPRD_INBOX_FIFO_IRQ_MASK

/* Bit and mask definition for outbox's SPRD_MBOX_IRQ_MSK register */
#define SPRD_OUTBOX_FIFO_NOT_EMPTY_IRQ
#define SPRD_OUTBOX_FIFO_IRQ_MASK

#define SPRD_OUTBOX_BASE_SPAN
#define SPRD_MBOX_CHAN_MAX
#define SPRD_SUPP_INBOX_ID_SC9863A

struct sprd_mbox_priv {};

static struct sprd_mbox_priv *to_sprd_mbox_priv(struct mbox_controller *mbox)
{}

static u32 sprd_mbox_get_fifo_len(struct sprd_mbox_priv *priv, u32 fifo_sts)
{}

static irqreturn_t do_outbox_isr(void __iomem *base, struct sprd_mbox_priv *priv)
{}

static irqreturn_t sprd_mbox_outbox_isr(int irq, void *data)
{}

static irqreturn_t sprd_mbox_supp_isr(int irq, void *data)
{}

static irqreturn_t sprd_mbox_inbox_isr(int irq, void *data)
{}

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

static int sprd_mbox_flush(struct mbox_chan *chan, unsigned long timeout)
{}

static int sprd_mbox_startup(struct mbox_chan *chan)
{}

static void sprd_mbox_shutdown(struct mbox_chan *chan)
{}

static const struct mbox_chan_ops sprd_mbox_ops =;

static void sprd_mbox_disable(void *data)
{}

static int sprd_mbox_probe(struct platform_device *pdev)
{}

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

static struct platform_driver sprd_mbox_driver =;
module_platform_driver();

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