summaryrefslogtreecommitdiff
path: root/lwis_device_dpm.h
blob: 0aeba1f8041e27153b361d343580973e27a52e16 (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
/*
 * Google LWIS Dynamic Power Managerment
 *
 * Copyright (c) 2020 Google, LLC
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#ifndef LWIS_DPM_DEVICE_H_
#define LWIS_DPM_DEVICE_H_

#include "lwis_commands.h"
#include "lwis_device.h"

/*
 *  struct lwis_dpm_device
 *  The device majorly control/handle requests from dpm clients.
 */
struct lwis_dpm_device {
	struct lwis_device base_dev;
};

/*
 *  lwis_dpm_update_clock: update specific clock setting on lwis device.
 *  clk_settings needs to be freed at the end of this function.
 */
int lwis_dpm_update_clock(struct lwis_device *lwis_dev, struct lwis_clk_setting *clk_settings,
			  size_t num_settings);

/*
 *  lwis_dpm_update_qos: update qos requirement from dpm client.
 */
int lwis_dpm_update_qos(struct lwis_device *lwis_dev, struct lwis_qos_setting_v2 *qos_setting);

/*
 *  lwis_dpm_read_clock: read current IP core clock for given lwis device.
 *  The unit is hz.
 */
uint32_t lwis_dpm_read_clock(struct lwis_device *lwis_dev);

int lwis_dpm_device_deinit(void);

#endif /* LWIS_DPM_DEVICE_H_ */