Lines Matching +full:device +full:- +full:id
4 * SPDX-License-Identifier: Apache-2.0
9 #include <zephyr/dt-bindings/reset/ast10x0_reset.h>
17 * - Each bit in these registers controls a reset line
18 * - Write '1' to a bit: assert the corresponding reset line
19 * - Write '0' to a bit: no effect
21 * - Write '1' to a bit: clear the corresponding bit in RESET_CTRL0/1_ASSERT.
30 const struct device *syscon;
33 static int aspeed_reset_line_assert(const struct device *dev, uint32_t id) in aspeed_reset_line_assert() argument
35 const struct reset_aspeed_config *config = dev->config; in aspeed_reset_line_assert()
36 const struct device *syscon = config->syscon; in aspeed_reset_line_assert()
39 if (id >= ASPEED_RESET_GRP_1_OFFSET) { in aspeed_reset_line_assert()
40 id -= ASPEED_RESET_GRP_1_OFFSET; in aspeed_reset_line_assert()
44 return syscon_write_reg(syscon, addr, BIT(id)); in aspeed_reset_line_assert()
47 static int aspeed_reset_line_deassert(const struct device *dev, uint32_t id) in aspeed_reset_line_deassert() argument
49 const struct reset_aspeed_config *config = dev->config; in aspeed_reset_line_deassert()
50 const struct device *syscon = config->syscon; in aspeed_reset_line_deassert()
53 if (id >= ASPEED_RESET_GRP_1_OFFSET) { in aspeed_reset_line_deassert()
54 id -= ASPEED_RESET_GRP_1_OFFSET; in aspeed_reset_line_deassert()
58 return syscon_write_reg(syscon, addr, BIT(id)); in aspeed_reset_line_deassert()
61 static int aspeed_reset_status(const struct device *dev, uint32_t id, uint8_t *status) in aspeed_reset_status() argument
63 const struct reset_aspeed_config *config = dev->config; in aspeed_reset_status()
64 const struct device *syscon = config->syscon; in aspeed_reset_status()
69 if (id >= ASPEED_RESET_GRP_1_OFFSET) { in aspeed_reset_status()
70 id -= ASPEED_RESET_GRP_1_OFFSET; in aspeed_reset_status()
76 *status = !!(reg_value & BIT(id)); in aspeed_reset_status()
82 static int aspeed_reset_line_toggle(const struct device *dev, uint32_t id) in aspeed_reset_line_toggle() argument
86 ret = aspeed_reset_line_assert(dev, id); in aspeed_reset_line_toggle()
88 ret = aspeed_reset_line_deassert(dev, id); in aspeed_reset_line_toggle()