hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/clk/qcom/reset.c
....@@ -1,14 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
3
- *
4
- * This software is licensed under the terms of the GNU General Public
5
- * License version 2, as published by the Free Software Foundation, and
6
- * may be copied, distributed, and modified under those terms.
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.
124 */
135
146 #include <linux/bitops.h>
....@@ -21,8 +13,11 @@
2113
2214 static int qcom_reset(struct reset_controller_dev *rcdev, unsigned long id)
2315 {
16
+ struct qcom_reset_controller *rst = to_qcom_reset_controller(rcdev);
17
+
2418 rcdev->ops->assert(rcdev, id);
25
- udelay(1);
19
+ fsleep(rst->reset_map[id].udelay ?: 1); /* use 1 us as default */
20
+
2621 rcdev->ops->deassert(rcdev, id);
2722 return 0;
2823 }
....@@ -36,7 +31,7 @@
3631
3732 rst = to_qcom_reset_controller(rcdev);
3833 map = &rst->reset_map[id];
39
- mask = BIT(map->bit);
34
+ mask = map->bitmask ? map->bitmask : BIT(map->bit);
4035
4136 return regmap_update_bits(rst->regmap, map->reg, mask, mask);
4237 }
....@@ -50,7 +45,7 @@
5045
5146 rst = to_qcom_reset_controller(rcdev);
5247 map = &rst->reset_map[id];
53
- mask = BIT(map->bit);
48
+ mask = map->bitmask ? map->bitmask : BIT(map->bit);
5449
5550 return regmap_update_bits(rst->regmap, map->reg, mask, 0);
5651 }