Tejas Patel | 9d09ff9 | 2019-01-08 01:46:35 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2019, Xilinx, Inc. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #ifndef PM_API_SYS_H |
| 8 | #define PM_API_SYS_H |
| 9 | |
| 10 | #include <stdint.h> |
Tejas Patel | fe0e10a | 2019-12-08 23:29:44 -0800 | [diff] [blame] | 11 | #include "pm_defs.h" |
Tejas Patel | 9d09ff9 | 2019-01-08 01:46:35 -0800 | [diff] [blame] | 12 | |
| 13 | /********************************************************** |
| 14 | * PM API function declarations |
| 15 | **********************************************************/ |
| 16 | |
| 17 | enum pm_ret_status pm_get_api_version(unsigned int *version); |
Tejas Patel | fe0e10a | 2019-12-08 23:29:44 -0800 | [diff] [blame] | 18 | enum pm_ret_status pm_self_suspend(uint32_t nid, |
| 19 | unsigned int latency, |
| 20 | unsigned int state, |
| 21 | uintptr_t address); |
| 22 | enum pm_ret_status pm_abort_suspend(enum pm_abort_reason reason); |
| 23 | enum pm_ret_status pm_req_suspend(uint32_t target, |
| 24 | uint8_t ack, |
| 25 | unsigned int latency, |
| 26 | unsigned int state); |
Tejas Patel | 49cd871 | 2019-01-23 14:18:51 +0530 | [diff] [blame] | 27 | enum pm_ret_status pm_req_wakeup(uint32_t target, uint32_t set_address, |
| 28 | uintptr_t address, uint8_t ack); |
Tejas Patel | db81205 | 2019-01-23 14:18:53 +0530 | [diff] [blame] | 29 | enum pm_ret_status pm_set_wakeup_source(uint32_t target, uint32_t device_id, |
| 30 | uint8_t enable); |
Tejas Patel | 41f3e0b | 2019-01-08 01:46:37 -0800 | [diff] [blame] | 31 | enum pm_ret_status pm_request_device(uint32_t device_id, uint32_t capabilities, |
| 32 | uint32_t qos, uint32_t ack); |
| 33 | enum pm_ret_status pm_release_device(uint32_t device_id); |
| 34 | enum pm_ret_status pm_set_requirement(uint32_t device_id, uint32_t capabilities, |
| 35 | uint32_t latency, uint32_t qos); |
| 36 | enum pm_ret_status pm_get_device_status(uint32_t device_id, uint32_t *response); |
Tejas Patel | 87c4f3a | 2019-01-08 01:46:38 -0800 | [diff] [blame] | 37 | enum pm_ret_status pm_reset_assert(uint32_t reset, bool assert); |
| 38 | enum pm_ret_status pm_reset_get_status(uint32_t reset, uint32_t *status); |
Tejas Patel | 20e9202 | 2019-01-08 01:46:39 -0800 | [diff] [blame] | 39 | enum pm_ret_status pm_pinctrl_request(uint32_t pin); |
| 40 | enum pm_ret_status pm_pinctrl_release(uint32_t pin); |
| 41 | enum pm_ret_status pm_pinctrl_set_function(uint32_t pin, uint32_t function); |
| 42 | enum pm_ret_status pm_pinctrl_get_function(uint32_t pin, uint32_t *function); |
| 43 | enum pm_ret_status pm_pinctrl_set_pin_param(uint32_t pin, uint32_t param, |
| 44 | uint32_t value); |
| 45 | enum pm_ret_status pm_pinctrl_get_pin_param(uint32_t pin, uint32_t param, |
| 46 | uint32_t *value); |
Tejas Patel | 1f56fb1 | 2019-01-08 01:46:40 -0800 | [diff] [blame] | 47 | enum pm_ret_status pm_clock_enable(uint32_t clk_id); |
| 48 | enum pm_ret_status pm_clock_disable(uint32_t clk_id); |
| 49 | enum pm_ret_status pm_clock_get_state(uint32_t clk_id, uint32_t *state); |
| 50 | enum pm_ret_status pm_clock_set_divider(uint32_t clk_id, uint32_t divider); |
| 51 | enum pm_ret_status pm_clock_get_divider(uint32_t clk_id, uint32_t *divider); |
| 52 | enum pm_ret_status pm_clock_set_parent(uint32_t clk_id, uint32_t parent); |
| 53 | enum pm_ret_status pm_clock_get_parent(uint32_t clk_id, uint32_t *parent); |
Tejas Patel | 023116d | 2019-01-08 01:46:41 -0800 | [diff] [blame] | 54 | enum pm_ret_status pm_pll_set_param(uint32_t clk_id, uint32_t param, |
| 55 | uint32_t value); |
| 56 | enum pm_ret_status pm_pll_get_param(uint32_t clk_id, uint32_t param, |
| 57 | uint32_t *value); |
| 58 | enum pm_ret_status pm_pll_set_mode(uint32_t clk_id, uint32_t mode); |
| 59 | enum pm_ret_status pm_pll_get_mode(uint32_t clk_id, uint32_t *mode); |
Tejas Patel | 6b28225 | 2019-01-10 03:03:47 -0800 | [diff] [blame] | 60 | enum pm_ret_status pm_force_powerdown(uint32_t target, uint8_t ack); |
| 61 | enum pm_ret_status pm_system_shutdown(uint32_t type, uint32_t subtype); |
Tejas Patel | 9141f44 | 2019-01-10 03:03:48 -0800 | [diff] [blame] | 62 | enum pm_ret_status pm_api_ioctl(uint32_t device_id, uint32_t ioctl_id, |
| 63 | uint32_t arg1, uint32_t arg2, uint32_t *value); |
Tejas Patel | a3e34ad | 2019-02-01 17:25:19 +0530 | [diff] [blame] | 64 | enum pm_ret_status pm_query_data(uint32_t qid, uint32_t arg1, uint32_t arg2, |
| 65 | uint32_t arg3, uint32_t *data); |
Tejas Patel | 9d09ff9 | 2019-01-08 01:46:35 -0800 | [diff] [blame] | 66 | #endif /* PM_API_SYS_H */ |