Lines Matching +full:gpio30 +full:- +full:supply

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
66 struct rk_iodomain_supply *supply; member
81 {"lcdc-supply", 0},
82 {"dvp-supply", 1},
83 {"flash0-supply", 2},
84 {"flash1-supply", 3},
85 {"wifi-supply", 4},
86 {"bb-supply", 5},
87 {"audio-supply", 6},
88 {"sdcard-supply", 7},
89 {"gpio30-supply", 8},
90 {"gpio1830-supply", 9},
94 .supply = rk3288_supply,
101 {"bt656-supply", 0},
102 {"audio-supply", 1},
103 {"sdmmc-supply", 2},
104 {"gpio1830-supply", 3},
108 .supply = rk3399_supply,
115 {"pmu1830-supply", 9},
120 .supply = rk3399_pmu_supply,
128 {"pmuio1-supply", 0},
129 {"pmuio2-supply", 1},
130 {"vccio1-supply", 1},
131 {"vccio2-supply", 2},
132 {"vccio3-supply", 3},
133 {"vccio4-supply", 4},
134 {"vccio5-supply", 5},
135 {"vccio6-supply", 6},
136 {"vccio7-supply", 7},
139 .supply = rk3568_pmu_supply,
145 {"rockchip,rk3288-io-voltage-domain", (uintptr_t)&rk3288_conf},
146 {"rockchip,rk3399-io-voltage-domain", (uintptr_t)&rk3399_conf},
147 {"rockchip,rk3399-pmu-io-voltage-domain", (uintptr_t)&rk3399_pmu_conf},
148 {"rockchip,rk3568-pmu-io-voltage-domain", (uintptr_t)&rk3568_pmu_conf},
156 SYSCON_WRITE_4(sc->grf, RK3399_PMUGRF_SOC_CON0, in rk3399_pmu_init()
163 regulator_t supply; in rk_iodomain_set() local
168 for (i = 0; i < sc->conf->nsupply; i++) { in rk_iodomain_set()
169 if (regulator_get_by_ofw_property(sc->dev, sc->node, in rk_iodomain_set()
170 sc->conf->supply[i].name, &supply) != 0) { in rk_iodomain_set()
171 device_printf(sc->dev, in rk_iodomain_set()
173 sc->conf->supply[i].name); in rk_iodomain_set()
177 if (regulator_get_voltage(supply, &uvolt) != 0) { in rk_iodomain_set()
178 device_printf(sc->dev, in rk_iodomain_set()
180 sc->conf->supply[i].name); in rk_iodomain_set()
184 if (sc->conf->type != RK3568) { in rk_iodomain_set()
186 mask |= (1 << sc->conf->supply[i].bit) << 16; in rk_iodomain_set()
188 reg |= (1 << sc->conf->supply[i].bit); in rk_iodomain_set()
190 device_printf(sc->dev, in rk_iodomain_set()
192 sc->conf->supply[i].name, uvolt); in rk_iodomain_set()
196 device_printf(sc->dev, in rk_iodomain_set()
198 sc->conf->supply[i].name, uvolt); in rk_iodomain_set()
204 SYSCON_WRITE_4(sc->grf, RK3568_PMUGRF_IO_VSEL2, in rk_iodomain_set()
205 (1 << (sc->conf->supply[i].bit + 16)) | in rk_iodomain_set()
207 0 : 1 << sc->conf->supply[i].bit)); in rk_iodomain_set()
208 SYSCON_WRITE_4(sc->grf, RK3568_PMUGRF_IO_VSEL2, in rk_iodomain_set()
209 (1 << (sc->conf->supply[i].bit + 4 + 16)) | in rk_iodomain_set()
211 1 << (sc->conf->supply[i].bit + 4) : 0)); in rk_iodomain_set()
220 SYSCON_WRITE_4(sc->grf, RK3568_PMUGRF_IO_VSEL0, in rk_iodomain_set()
221 (1 << (sc->conf->supply[i].bit + 16)) | in rk_iodomain_set()
223 0 : 1 << sc->conf->supply[i].bit)); in rk_iodomain_set()
224 SYSCON_WRITE_4(sc->grf, RK3568_PMUGRF_IO_VSEL1, in rk_iodomain_set()
225 (1 << (sc->conf->supply[i].bit + 16)) | in rk_iodomain_set()
227 1 << sc->conf->supply[i].bit : 0)); in rk_iodomain_set()
230 device_printf(sc->dev, "Index out of range\n"); in rk_iodomain_set()
234 if (sc->conf->type != RK3568) in rk_iodomain_set()
235 SYSCON_WRITE_4(sc->grf, sc->conf->grf_reg, reg | mask); in rk_iodomain_set()
236 if (sc->conf->init != NULL) in rk_iodomain_set()
237 sc->conf->init(sc); in rk_iodomain_set()
249 if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) in rk_iodomain_probe()
263 sc->dev = dev; in rk_iodomain_attach()
264 sc->node = ofw_bus_get_node(dev); in rk_iodomain_attach()
266 rv = syscon_get_handle_default(dev, &sc->grf); in rk_iodomain_attach()
272 sc->conf = (struct rk_iodomain_conf *)ofw_bus_search_compatible(dev, compat_data)->ocd_data; in rk_iodomain_attach()