/* vendor properties */ if (device_property_read_bool(dev, "richtek,pwm-enable"))
val = RT4831_BLPWMEN_MASK;
ret = regmap_update_bits(priv->regmap, RT4831_REG_BLCFG, RT4831_BLPWMEN_MASK, val); if (ret) return ret;
ret = device_property_read_u8(dev, "richtek,bled-ovp-sel", &propval); if (ret)
propval = RT4831_BLOVPLVL_21V;
propval = min_t(u8, propval, RT4831_BLOVPLVL_29V);
ret = regmap_update_bits(priv->regmap, RT4831_REG_BLCFG, RT4831_BLOVP_MASK,
propval << RT4831_BLOVP_SHIFT); if (ret) return ret;
/* * This OCP level is used to protect and limit the inductor current. * If inductor peak current reach the level, low-side MOSFET will be * turned off. Meanwhile, the output channel current may be limited. * To match the configured channel current, the inductor chosen must * be higher than the OCP level. * * Not like the OVP level, the default 21V can be used in the most * application. But if the chosen OCP level is smaller than needed, * it will also affect the backlight channel output current to be * smaller than the register setting.
*/
ret = device_property_read_u32(dev, "richtek,bled-ocp-microamp",
&ocp_uA); if (!ret) {
ocp_uA = clamp_val(ocp_uA, RT4831_BLOCP_MINUA,
RT4831_BLOCP_MAXUA);
val = DIV_ROUND_UP(ocp_uA - RT4831_BLOCP_MINUA,
RT4831_BLOCP_STEPUA);
ret = regmap_update_bits(priv->regmap, RT4831_REG_BLOPT2,
RT4831_BLOCP_MASK, val); if (ret) return ret;
}
ret = device_property_read_u8(dev, "richtek,channel-use", &propval); if (ret) {
dev_err(dev, "richtek,channel-use DT property missing\n"); return ret;
}
if (!(propval & RT4831_BLCH_MASK)) {
dev_err(dev, "No channel specified\n"); return -EINVAL;
}
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.