Lines Matching refs:iod
62 void (*init)(struct rockchip_iodomain *iod);
66 struct rockchip_iodomain *iod; member
82 struct rockchip_iodomain *iod = supply->iod; in rockchip_iodomain_write() local
93 ret = regmap_write(iod->grf, iod->soc_data->grf_offset, val); in rockchip_iodomain_write()
95 dev_err(iod->dev, "Couldn't write to GRF\n"); in rockchip_iodomain_write()
133 dev_dbg(supply->iod->dev, "Setting to %d\n", uV); in rockchip_iodomain_notify()
136 dev_err(supply->iod->dev, "Voltage too high: %d\n", uV); in rockchip_iodomain_notify()
146 dev_dbg(supply->iod->dev, "Setting to %d done\n", uV); in rockchip_iodomain_notify()
150 static void px30_iodomain_init(struct rockchip_iodomain *iod) in px30_iodomain_init() argument
156 if (!iod->supplies[PX30_IO_VSEL_VCCIO6_SUPPLY_NUM].reg) in px30_iodomain_init()
164 ret = regmap_write(iod->grf, PX30_IO_VSEL, val); in px30_iodomain_init()
166 dev_warn(iod->dev, "couldn't update vccio6 ctrl\n"); in px30_iodomain_init()
169 static void rk3288_iodomain_init(struct rockchip_iodomain *iod) in rk3288_iodomain_init() argument
175 if (!iod->supplies[RK3288_SOC_FLASH_SUPPLY_NUM].reg) in rk3288_iodomain_init()
183 ret = regmap_write(iod->grf, RK3288_SOC_CON2, val); in rk3288_iodomain_init()
185 dev_warn(iod->dev, "couldn't update flash0 ctrl\n"); in rk3288_iodomain_init()
188 static void rk3328_iodomain_init(struct rockchip_iodomain *iod) in rk3328_iodomain_init() argument
194 if (!iod->supplies[RK3328_SOC_VCCIO2_SUPPLY_NUM].reg) in rk3328_iodomain_init()
202 ret = regmap_write(iod->grf, RK3328_SOC_CON4, val); in rk3328_iodomain_init()
204 dev_warn(iod->dev, "couldn't update vccio2 vsel ctrl\n"); in rk3328_iodomain_init()
207 static void rk3368_iodomain_init(struct rockchip_iodomain *iod) in rk3368_iodomain_init() argument
213 if (!iod->supplies[RK3368_SOC_FLASH_SUPPLY_NUM].reg) in rk3368_iodomain_init()
221 ret = regmap_write(iod->grf, RK3368_SOC_CON15, val); in rk3368_iodomain_init()
223 dev_warn(iod->dev, "couldn't update flash0 ctrl\n"); in rk3368_iodomain_init()
226 static void rk3399_pmu_iodomain_init(struct rockchip_iodomain *iod) in rk3399_pmu_iodomain_init() argument
232 if (!iod->supplies[RK3399_PMUGRF_VSEL_SUPPLY_NUM].reg) in rk3399_pmu_iodomain_init()
240 ret = regmap_write(iod->grf, RK3399_PMUGRF_CON0, val); in rk3399_pmu_iodomain_init()
242 dev_warn(iod->dev, "couldn't update pmu io iodomain ctrl\n"); in rk3399_pmu_iodomain_init()
491 struct rockchip_iodomain *iod; in rockchip_iodomain_probe() local
498 iod = devm_kzalloc(&pdev->dev, sizeof(*iod), GFP_KERNEL); in rockchip_iodomain_probe()
499 if (!iod) in rockchip_iodomain_probe()
502 iod->dev = &pdev->dev; in rockchip_iodomain_probe()
503 platform_set_drvdata(pdev, iod); in rockchip_iodomain_probe()
506 iod->soc_data = match->data; in rockchip_iodomain_probe()
510 iod->grf = syscon_node_to_regmap(parent->of_node); in rockchip_iodomain_probe()
513 iod->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf"); in rockchip_iodomain_probe()
516 if (IS_ERR(iod->grf)) { in rockchip_iodomain_probe()
518 return PTR_ERR(iod->grf); in rockchip_iodomain_probe()
522 const char *supply_name = iod->soc_data->supply_names[i]; in rockchip_iodomain_probe()
523 struct rockchip_iodomain_supply *supply = &iod->supplies[i]; in rockchip_iodomain_probe()
530 reg = devm_regulator_get_optional(iod->dev, supply_name); in rockchip_iodomain_probe()
538 dev_err(iod->dev, "couldn't get regulator %s\n", in rockchip_iodomain_probe()
548 dev_err(iod->dev, "Can't determine voltage: %s\n", in rockchip_iodomain_probe()
554 dev_crit(iod->dev, in rockchip_iodomain_probe()
563 supply->iod = iod; in rockchip_iodomain_probe()
583 if (iod->soc_data->init) in rockchip_iodomain_probe()
584 iod->soc_data->init(iod); in rockchip_iodomain_probe()
590 struct rockchip_iodomain_supply *io_supply = &iod->supplies[i]; in rockchip_iodomain_probe()
602 struct rockchip_iodomain *iod = platform_get_drvdata(pdev); in rockchip_iodomain_remove() local
606 struct rockchip_iodomain_supply *io_supply = &iod->supplies[i]; in rockchip_iodomain_remove()