/* * Enable EL Driving Voltage first - doing that at the beginning * or at the end of the power sequence doesn't matter, so enable * it here to avoid yet another usleep at the end.
*/
ret = regulator_enable(boe->vregs[BF060Y8M_VREG_EL_VDD].consumer); if (ret) return ret;
ret = regulator_enable(boe->vregs[BF060Y8M_VREG_EL_VSS].consumer); if (ret) goto err_elvss;
ret = regulator_enable(boe->vregs[BF060Y8M_VREG_VCC].consumer); if (ret) goto err_vcc;
usleep_range(1000, 2000);
ret = regulator_enable(boe->vregs[BF060Y8M_VREG_VDDIO].consumer); if (ret) goto err_vddio;
usleep_range(500, 1000);
ret = regulator_enable(boe->vregs[BF060Y8M_VREG_VCI].consumer); if (ret) goto err_vci;
usleep_range(2000, 3000);
boe_bf060y8m_aj0_reset(boe);
ret = boe_bf060y8m_aj0_on(boe); if (ret < 0) {
gpiod_set_value_cansleep(boe->reset_gpio, 1); goto err_on;
}
boe->vregs[BF060Y8M_VREG_VCC].supply = "vcc";
boe->vregs[BF060Y8M_VREG_VDDIO].supply = "vddio";
boe->vregs[BF060Y8M_VREG_VCI].supply = "vci";
boe->vregs[BF060Y8M_VREG_EL_VDD].supply = "elvdd";
boe->vregs[BF060Y8M_VREG_EL_VSS].supply = "elvss";
ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(boe->vregs),
boe->vregs); if (ret < 0) {
dev_err(dev, "Failed to get regulators: %d\n", ret); return ret;
}
vreg = boe->vregs[BF060Y8M_VREG_VCC].consumer;
ret = regulator_is_supported_voltage(vreg, 2700000, 3600000); if (!ret) return ret;
vreg = boe->vregs[BF060Y8M_VREG_VDDIO].consumer;
ret = regulator_is_supported_voltage(vreg, 1620000, 1980000); if (!ret) return ret;
vreg = boe->vregs[BF060Y8M_VREG_VCI].consumer;
ret = regulator_is_supported_voltage(vreg, 2600000, 3600000); if (!ret) return ret;
vreg = boe->vregs[BF060Y8M_VREG_EL_VDD].consumer;
ret = regulator_is_supported_voltage(vreg, 4400000, 4800000); if (!ret) return ret;
/* ELVSS is negative: -5.00V to -1.40V */
vreg = boe->vregs[BF060Y8M_VREG_EL_VSS].consumer;
ret = regulator_is_supported_voltage(vreg, 1400000, 5000000); if (!ret) return ret;
/* * Set min/max rated current, known only for VCI and VDDIO and, * in case of failure, just go on gracefully, as this step is not * guaranteed to succeed on all regulator HW but do a debug print * to inform the developer during debugging. * In any case, these two supplies are also optional, so they may * be fixed-regulator which, at the time of writing, does not * support fake current limiting.
*/
vreg = boe->vregs[BF060Y8M_VREG_VDDIO].consumer;
ret = regulator_set_current_limit(vreg, 1500, 2500); if (ret)
dev_dbg(dev, "Current limit cannot be set on %s: %d\n",
boe->vregs[1].supply, ret);
vreg = boe->vregs[BF060Y8M_VREG_VCI].consumer;
ret = regulator_set_current_limit(vreg, 20000, 40000); if (ret)
dev_dbg(dev, "Current limit cannot be set on %s: %d\n",
boe->vregs[2].supply, ret);
ret = boe_bf060y8m_aj0_init_vregs(boe, dev); if (ret) return dev_err_probe(dev, ret, "Failed to initialize supplies.\n");
boe->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_ASIS); if (IS_ERR(boe->reset_gpio)) return dev_err_probe(dev, PTR_ERR(boe->reset_gpio), "Failed to get reset-gpios\n");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.