1 /* include/linux/memory-state-time.h
3 * Copyright (C) 2016 Google, Inc.
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
16 #include <linux/workqueue.h>
18 #define UPDATE_MEMORY_STATE(BLOCK, VALUE) BLOCK->update_call(BLOCK, VALUE)
20 struct memory_state_update_block;
22 typedef void (*memory_state_update_fn_t)(struct memory_state_update_block *ub,
25 /* This struct is populated when you pass it to a memory_state_register*
26 * function. The update_call function is used for an update and defined in the
27 * typedef memory_state_update_fn_t
29 struct memory_state_update_block {
30 memory_state_update_fn_t update_call;
34 /* Register a frequency struct memory_state_update_block to provide updates to
35 * memory_state_time about frequency changes using its update_call function.
37 struct memory_state_update_block *memory_state_register_frequency_source(void);
39 /* Register a bandwidth struct memory_state_update_block to provide updates to
40 * memory_state_time about bandwidth changes using its update_call function.
42 struct memory_state_update_block *memory_state_register_bandwidth_source(void);