linux/drivers/soc/qcom/qcom-pbs.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
 */

#include <linux/delay.h>
#include <linux/err.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/of_platform.h>
#include <linux/regmap.h>
#include <linux/spmi.h>
#include <linux/soc/qcom/qcom-pbs.h>

#define PBS_CLIENT_TRIG_CTL
#define PBS_CLIENT_SW_TRIG_BIT
#define PBS_CLIENT_SCRATCH1
#define PBS_CLIENT_SCRATCH2
#define PBS_CLIENT_SCRATCH2_ERROR

#define RETRIES
#define DELAY

struct pbs_dev {};

static int qcom_pbs_wait_for_ack(struct pbs_dev *pbs, u8 bit_pos)
{}

/**
 * qcom_pbs_trigger_event() - Trigger the PBS RAM sequence
 * @pbs: Pointer to PBS device
 * @bitmap: bitmap
 *
 * This function is used to trigger the PBS RAM sequence to be
 * executed by the client driver.
 *
 * The PBS trigger sequence involves
 * 1. setting the PBS sequence bit in PBS_CLIENT_SCRATCH1
 * 2. Initiating the SW PBS trigger
 * 3. Checking the equivalent bit in PBS_CLIENT_SCRATCH2 for the
 *    completion of the sequence.
 * 4. If PBS_CLIENT_SCRATCH2 == 0xFF, the PBS sequence failed to execute
 *
 * Return: 0 on success, < 0 on failure
 */
int qcom_pbs_trigger_event(struct pbs_dev *pbs, u8 bitmap)
{}
EXPORT_SYMBOL_GPL();

/**
 * get_pbs_client_device() - Get the PBS device used by client
 * @dev: Client device
 *
 * This function is used to get the PBS device that is being
 * used by the client.
 *
 * Return: pbs_dev on success, ERR_PTR on failure
 */
struct pbs_dev *get_pbs_client_device(struct device *dev)
{}
EXPORT_SYMBOL_GPL();

static int qcom_pbs_probe(struct platform_device *pdev)
{}

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

static struct platform_driver qcom_pbs_driver =;
module_platform_driver()

MODULE_DESCRIPTION();
MODULE_LICENSE();