linux/drivers/misc/amd-sbi/tsi-core.h
Prathima 48ad55cda0 misc: amd-sbi: Add SBTSI ioctl register transfer interface
Implement IOCTL interface for SB-TSI driver to enable userspace access
to TSI register read/write operations through the AMD Advanced Platform
Management Link (APML) protocol.
Add an ioctl command (SBTSI_IOCTL_REG_XFER_CMD) that accepts a register
address, data byte, and direction flag.
The mutex is taken on the ioctl path here; the hwmon path is placed
under the same lock in the next patch, which completes serialization between
the hwmon and ioctl paths.

Reviewed-by: Akshay Gupta <Akshay.Gupta@amd.com>
Signed-off-by: Prathima <Prathima.Lk@amd.com>
Link: https://patch.msgid.link/20260710111642.850022-7-Akshay.Gupta@amd.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-07-17 15:50:48 +02:00

30 lines
799 B
C

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* AMD SBTSI core driver private definitions.
*
* Copyright (C) 2026 Advanced Micro Devices, Inc.
*/
#ifndef _LINUX_TSI_CORE_H_
#define _LINUX_TSI_CORE_H_
#include <linux/cache.h>
#include <linux/misc/tsi.h>
/**
* struct sbtsi_i3c_priv - per-device state for I3C SBTSI (includes DMA-safe buffers)
* @data: public device state exposed via dev_set_drvdata()
* @tx: outgoing I3C bytes (DMA_TO_DEVICE); [0] register address, [1] value
* @rx: incoming I3C data byte (DMA_FROM_DEVICE)
*/
struct sbtsi_i3c_priv {
struct sbtsi_data data;
u8 tx[2];
u8 rx __aligned(ARCH_DMA_MINALIGN);
};
int create_misc_tsi_device(struct sbtsi_data *data, struct device *dev);
void sbtsi_data_release(struct kref *kref);
#endif /* _LINUX_TSI_CORE_H_ */