Link: https://lore.kernel.org/r/20260217200002.683975158@linuxfoundation.org Tested-by: Florian Fainelli <florian.fainelli@broadcom.com> Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com> Tested-by: Peter Schneider <pschneider1968@googlemail.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Salvatore Bonaccorso <carnil@debian.org> Tested-by: Brett A C Sheffield <bacs@librecast.net> Tested-by: Mark Brown <broonie@kernel.org> Tested-by: Luna Jernberg <droidbittin@gmail.com> Tested-by: Ronald Warsow <rwarsow@gmx.de> Tested-by: Justin M. Forbes <jforbes@fedoraproject.org> Tested-by: Ron Economos <re@w6rz.net> Tested-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
71 lines
1.8 KiB
C
71 lines
1.8 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright 2020 Samsung Electronics Co., Ltd.
|
|
* Copyright 2020 Google LLC.
|
|
* Copyright 2024 Linaro Ltd.
|
|
*/
|
|
|
|
#ifndef __EXYNOS_ACPM_PROTOCOL_H
|
|
#define __EXYNOS_ACPM_PROTOCOL_H
|
|
|
|
#include <linux/types.h>
|
|
|
|
struct acpm_handle;
|
|
struct device_node;
|
|
|
|
struct acpm_dvfs_ops {
|
|
int (*set_rate)(const struct acpm_handle *handle,
|
|
unsigned int acpm_chan_id, unsigned int clk_id,
|
|
unsigned long rate);
|
|
unsigned long (*get_rate)(const struct acpm_handle *handle,
|
|
unsigned int acpm_chan_id,
|
|
unsigned int clk_id);
|
|
};
|
|
|
|
struct acpm_pmic_ops {
|
|
int (*read_reg)(const struct acpm_handle *handle,
|
|
unsigned int acpm_chan_id, u8 type, u8 reg, u8 chan,
|
|
u8 *buf);
|
|
int (*bulk_read)(const struct acpm_handle *handle,
|
|
unsigned int acpm_chan_id, u8 type, u8 reg, u8 chan,
|
|
u8 count, u8 *buf);
|
|
int (*write_reg)(const struct acpm_handle *handle,
|
|
unsigned int acpm_chan_id, u8 type, u8 reg, u8 chan,
|
|
u8 value);
|
|
int (*bulk_write)(const struct acpm_handle *handle,
|
|
unsigned int acpm_chan_id, u8 type, u8 reg, u8 chan,
|
|
u8 count, const u8 *buf);
|
|
int (*update_reg)(const struct acpm_handle *handle,
|
|
unsigned int acpm_chan_id, u8 type, u8 reg, u8 chan,
|
|
u8 value, u8 mask);
|
|
};
|
|
|
|
struct acpm_ops {
|
|
struct acpm_dvfs_ops dvfs_ops;
|
|
struct acpm_pmic_ops pmic_ops;
|
|
};
|
|
|
|
/**
|
|
* struct acpm_handle - Reference to an initialized protocol instance
|
|
* @ops:
|
|
*/
|
|
struct acpm_handle {
|
|
struct acpm_ops ops;
|
|
};
|
|
|
|
struct device;
|
|
|
|
#if IS_ENABLED(CONFIG_EXYNOS_ACPM_PROTOCOL)
|
|
const struct acpm_handle *devm_acpm_get_by_node(struct device *dev,
|
|
struct device_node *np);
|
|
#else
|
|
|
|
static inline const struct acpm_handle *devm_acpm_get_by_node(struct device *dev,
|
|
struct device_node *np)
|
|
{
|
|
return NULL;
|
|
}
|
|
#endif
|
|
|
|
#endif /* __EXYNOS_ACPM_PROTOCOL_H */
|