| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | | - * Copyright (c) 2015, 2017-2018, The Linux Foundation. All rights reserved. |
|---|
| 3 | | - * |
|---|
| 4 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 5 | | - * it under the terms of the GNU General Public License version 2 and |
|---|
| 6 | | - * only version 2 as published by the Free Software Foundation. |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 9 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 10 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 11 | | - * GNU General Public License for more details. |
|---|
| 3 | + * Copyright (c) 2015, 2017-2018, 2022, The Linux Foundation. All rights reserved. |
|---|
| 12 | 4 | */ |
|---|
| 13 | 5 | |
|---|
| 14 | 6 | #ifndef __QCOM_GDSC_H__ |
|---|
| .. | .. |
|---|
| 18 | 10 | #include <linux/pm_domain.h> |
|---|
| 19 | 11 | |
|---|
| 20 | 12 | struct regmap; |
|---|
| 13 | +struct regulator; |
|---|
| 21 | 14 | struct reset_controller_dev; |
|---|
| 22 | 15 | |
|---|
| 23 | 16 | /** |
|---|
| .. | .. |
|---|
| 29 | 22 | * @cxcs: offsets of branch registers to toggle mem/periph bits in |
|---|
| 30 | 23 | * @cxc_count: number of @cxcs |
|---|
| 31 | 24 | * @pwrsts: Possible powerdomain power states |
|---|
| 25 | + * @en_rest_wait_val: transition delay value for receiving enr ack signal |
|---|
| 26 | + * @en_few_wait_val: transition delay value for receiving enf ack signal |
|---|
| 27 | + * @clk_dis_wait_val: transition delay value for halting clock |
|---|
| 32 | 28 | * @resets: ids of resets associated with this gdsc |
|---|
| 33 | 29 | * @reset_count: number of @resets |
|---|
| 34 | 30 | * @rcdev: reset controller |
|---|
| .. | .. |
|---|
| 42 | 38 | unsigned int clamp_io_ctrl; |
|---|
| 43 | 39 | unsigned int *cxcs; |
|---|
| 44 | 40 | unsigned int cxc_count; |
|---|
| 41 | + unsigned int en_rest_wait_val; |
|---|
| 42 | + unsigned int en_few_wait_val; |
|---|
| 43 | + unsigned int clk_dis_wait_val; |
|---|
| 45 | 44 | const u8 pwrsts; |
|---|
| 46 | 45 | /* Powerdomain allowable state bitfields */ |
|---|
| 47 | 46 | #define PWRSTS_OFF BIT(0) |
|---|
| .. | .. |
|---|
| 49 | 48 | #define PWRSTS_ON BIT(2) |
|---|
| 50 | 49 | #define PWRSTS_OFF_ON (PWRSTS_OFF | PWRSTS_ON) |
|---|
| 51 | 50 | #define PWRSTS_RET_ON (PWRSTS_RET | PWRSTS_ON) |
|---|
| 52 | | - const u8 flags; |
|---|
| 51 | + const u16 flags; |
|---|
| 53 | 52 | #define VOTABLE BIT(0) |
|---|
| 54 | 53 | #define CLAMP_IO BIT(1) |
|---|
| 55 | 54 | #define HW_CTRL BIT(2) |
|---|
| .. | .. |
|---|
| 57 | 56 | #define AON_RESET BIT(4) |
|---|
| 58 | 57 | #define POLL_CFG_GDSCR BIT(5) |
|---|
| 59 | 58 | #define ALWAYS_ON BIT(6) |
|---|
| 59 | +#define RETAIN_FF_ENABLE BIT(7) |
|---|
| 60 | +#define NO_RET_PERIPH BIT(8) |
|---|
| 60 | 61 | struct reset_controller_dev *rcdev; |
|---|
| 61 | 62 | unsigned int *resets; |
|---|
| 62 | 63 | unsigned int reset_count; |
|---|
| 64 | + |
|---|
| 65 | + const char *supply; |
|---|
| 66 | + struct regulator *rsupply; |
|---|
| 63 | 67 | }; |
|---|
| 64 | 68 | |
|---|
| 65 | 69 | struct gdsc_desc { |
|---|
| .. | .. |
|---|
| 72 | 76 | int gdsc_register(struct gdsc_desc *desc, struct reset_controller_dev *, |
|---|
| 73 | 77 | struct regmap *); |
|---|
| 74 | 78 | void gdsc_unregister(struct gdsc_desc *desc); |
|---|
| 79 | +int gdsc_gx_do_nothing_enable(struct generic_pm_domain *domain); |
|---|
| 75 | 80 | #else |
|---|
| 76 | 81 | static inline int gdsc_register(struct gdsc_desc *desc, |
|---|
| 77 | 82 | struct reset_controller_dev *rcdev, |
|---|