linux/drivers/soc/qcom/qcom_aoss.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2019, Linaro Ltd
 */
#include <linux/clk-provider.h>
#include <linux/debugfs.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/mailbox_client.h>
#include <linux/module.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/thermal.h>
#include <linux/slab.h>
#include <linux/soc/qcom/qcom_aoss.h>

#define CREATE_TRACE_POINTS
#include "trace-aoss.h"

#define QMP_DESC_MAGIC
#define QMP_DESC_VERSION
#define QMP_DESC_FEATURES

/* AOP-side offsets */
#define QMP_DESC_UCORE_LINK_STATE
#define QMP_DESC_UCORE_LINK_STATE_ACK
#define QMP_DESC_UCORE_CH_STATE
#define QMP_DESC_UCORE_CH_STATE_ACK
#define QMP_DESC_UCORE_MBOX_SIZE
#define QMP_DESC_UCORE_MBOX_OFFSET

/* Linux-side offsets */
#define QMP_DESC_MCORE_LINK_STATE
#define QMP_DESC_MCORE_LINK_STATE_ACK
#define QMP_DESC_MCORE_CH_STATE
#define QMP_DESC_MCORE_CH_STATE_ACK
#define QMP_DESC_MCORE_MBOX_SIZE
#define QMP_DESC_MCORE_MBOX_OFFSET

#define QMP_STATE_UP
#define QMP_STATE_DOWN

#define QMP_MAGIC
#define QMP_VERSION

/* 64 bytes is enough to store the requests and provides padding to 4 bytes */
#define QMP_MSG_LEN

#define QMP_NUM_COOLING_RESOURCES

#define QMP_DEBUGFS_FILES

static bool qmp_cdev_max_state =;

struct qmp_cooling_device {};

/**
 * struct qmp - driver state for QMP implementation
 * @msgram: iomem referencing the message RAM used for communication
 * @dev: reference to QMP device
 * @mbox_client: mailbox client used to ring the doorbell on transmit
 * @mbox_chan: mailbox channel used to ring the doorbell on transmit
 * @offset: offset within @msgram where messages should be written
 * @size: maximum size of the messages to be transmitted
 * @event: wait_queue for synchronization with the IRQ
 * @tx_lock: provides synchronization between multiple callers of qmp_send()
 * @qdss_clk: QDSS clock hw struct
 * @cooling_devs: thermal cooling devices
 * @debugfs_root: directory for the developer/tester interface
 * @debugfs_files: array of individual debugfs entries under debugfs_root
 */
struct qmp {};

static void qmp_kick(struct qmp *qmp)
{}

static bool qmp_magic_valid(struct qmp *qmp)
{}

static bool qmp_link_acked(struct qmp *qmp)
{}

static bool qmp_mcore_channel_acked(struct qmp *qmp)
{}

static bool qmp_ucore_channel_up(struct qmp *qmp)
{}

static int qmp_open(struct qmp *qmp)
{}

static void qmp_close(struct qmp *qmp)
{}

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

static bool qmp_message_empty(struct qmp *qmp)
{}

/**
 * qmp_send() - send a message to the AOSS
 * @qmp: qmp context
 * @fmt: format string for message to be sent
 * @...: arguments for the format string
 *
 * Transmit message to AOSS and wait for the AOSS to acknowledge the message.
 * data must not be longer than the mailbox size. Access is synchronized by
 * this implementation.
 *
 * Return: 0 on success, negative errno on failure
 */
int __printf(2, 3) qmp_send(struct qmp *qmp, const char *fmt, ...)
{}
EXPORT_SYMBOL_GPL();

static int qmp_qdss_clk_prepare(struct clk_hw *hw)
{}

static void qmp_qdss_clk_unprepare(struct clk_hw *hw)
{}

static const struct clk_ops qmp_qdss_clk_ops =;

static int qmp_qdss_clk_add(struct qmp *qmp)
{}

static void qmp_qdss_clk_remove(struct qmp *qmp)
{}

static int qmp_cdev_get_max_state(struct thermal_cooling_device *cdev,
				  unsigned long *state)
{}

static int qmp_cdev_get_cur_state(struct thermal_cooling_device *cdev,
				  unsigned long *state)
{}

static int qmp_cdev_set_cur_state(struct thermal_cooling_device *cdev,
				  unsigned long state)
{}

static const struct thermal_cooling_device_ops qmp_cooling_device_ops =;

static int qmp_cooling_device_add(struct qmp *qmp,
				  struct qmp_cooling_device *qmp_cdev,
				  struct device_node *node)
{}

static int qmp_cooling_devices_register(struct qmp *qmp)
{}

static void qmp_cooling_devices_remove(struct qmp *qmp)
{}

/**
 * qmp_get() - get a qmp handle from a device
 * @dev: client device pointer
 *
 * Return: handle to qmp device on success, ERR_PTR() on failure
 */
struct qmp *qmp_get(struct device *dev)
{}
EXPORT_SYMBOL_GPL();

/**
 * qmp_put() - release a qmp handle
 * @qmp: qmp handle obtained from qmp_get()
 */
void qmp_put(struct qmp *qmp)
{}
EXPORT_SYMBOL_GPL();

struct qmp_debugfs_entry {};

static const struct qmp_debugfs_entry qmp_debugfs_entries[QMP_DEBUGFS_FILES] =;

static ssize_t qmp_debugfs_write(struct file *file, const char __user *user_buf,
				 size_t count, loff_t *pos)
{}

static const struct file_operations qmp_debugfs_fops =;

static void qmp_debugfs_create(struct qmp *qmp)
{}

static int qmp_probe(struct platform_device *pdev)
{}

static void qmp_remove(struct platform_device *pdev)
{}

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

static struct platform_driver qmp_driver =;
module_platform_driver();

MODULE_DESCRIPTION();
MODULE_LICENSE();