summaryrefslogtreecommitdiff
path: root/include/linux/firmware/samsung/exynos-acpm-protocol.h
blob: f628bf1862c25fa018a2fe5e7e123bf05c5254b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* 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_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_pmic_ops pmic_ops;
};

/**
 * struct acpm_handle - Reference to an initialized protocol instance
 * @ops:
 */
struct acpm_handle {
	struct acpm_ops ops;
};

struct device;

const struct acpm_handle *devm_acpm_get_by_node(struct device *dev,
						struct device_node *np);

#endif /* __EXYNOS_ACPM_PROTOCOL_H */