2 * Copyright (C) 2017, Lothar Waßmann <LW@KARO-electronics.de>
4 * SPDX-License-Identifier: GPL-2.0+
6 * based on: platform/msm_shared/include/rpm-smd.h
7 * from Android Little Kernel: https://github.com/littlekernel/lk
9 * Copyright (c) 2014, The Linux Foundation. All rights reserved.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions are
14 * * Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * * Redistributions in binary form must reproduce the above
17 * copyright notice, this list of conditions and the following
18 * disclaimer in the documentation and/or other materials provided
19 * with the distribution.
20 * * Neither the name of The Linux Fundation, Inc. nor the names of its
21 * contributors may be used to endorse or promote products derived
22 * from this software without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
25 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
26 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
28 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
31 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
32 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
33 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
34 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 #ifndef __PMIC_QCOM_SMD_RPM_H
39 #define __PMIC_QCOM_SMD_RPM_H
41 #define KEY_SOFTWARE_ENABLE 0x6E657773 // swen - software enable
42 #define KEY_LDO_SOFTWARE_MODE 0X646D736C // lsmd - LDO software mode
43 #define KEY_SMPS_SOFTWARE_MODE 0X646D7373 // ssmd - SMPS software mode
44 #define KEY_PIN_CTRL_ENABLE 0x6E656370 //pcen - pin control enable
45 #define KEY_PIN_CTRL_POWER_MODE 0x646d6370 // pcmd - pin control mode
46 #define KEY_CURRENT 0x616D //ma
47 #define KEY_MICRO_VOLT 0x7675 //uv
48 #define KEY_FREQUENCY 0x71657266 //freq
49 #define KEY_FREQUENCY_REASON 0x6E736572 //resn
50 #define KEY_FOLLOW_QUIET_MODE 0x6D71 //qm
51 #define KEY_HEAD_ROOM 0x7268 // hr
52 #define KEY_PIN_CTRL_CLK_BUFFER_ENABLE_KEY 0x62636370 // pccb - clk buffer pin control
53 #define KEY_BYPASS_ALLOWED_KEY 0x61707962 //bypa - bypass allowed
54 #define KEY_CORNER_LEVEL_KEY 0x6E726F63 // corn - coner voltage
55 #define KEY_ACTIVE_FLOOR 0x636676
56 #define GENERIC_DISABLE 0
57 #define GENERIC_ENABLE 1
58 #define SW_MODE_LDO_IPEAK 1
59 #define LDOA_RES_TYPE 0x616F646C //aodl
60 #define SMPS_RES_TYPE 0x61706D73 //apms
62 #ifdef CONFIG_QCOM_SMD_RPM
93 uint32_t resourceType;
116 int rpm_send_data(uint32_t *data, uint32_t len, msg_type type);
117 uint32_t rpm_recv_data(uint32_t *data, uint32_t *len);
118 void rpm_clk_enable(uint32_t *data, uint32_t len);
119 void rpm_clk_disable(uint32_t *data, uint32_t len);
120 void smd_rpm_init(void);
121 void smd_rpm_uninit(void);
122 #else /* !CONFIG_QCOM_SMD_RPM */
123 static inline void smd_rpm_init(void)
127 static inline void smd_rpm_uninit(void)
130 #endif /* !CONFIG_QCOM_SMD_RPM */
132 #endif /* __PMIC_QCOM_SMD_RPM_H */