mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
regulator: pca9450: Correct default t_off_deb for PCA9451A/PCA9452
The PMIC PCA9451A and PCA9452 have a default power-off debounce time of 2ms according to their datasheet, while PCA9450A and PCA9450BC use 120us. Add default_t_off_deb field to struct pca9450 to support per-variant default configuration when the device tree property is not specified. Datasheet reference links: - PCA9451A Rev.2.1: https://www.nxp.com/docs/en/data-sheet/PCA9451A.pdf - PCA9452 Rev.1.0: https://www.nxp.com/docs/en/data-sheet/PCA9452.pdf Signed-off-by: Joy Zou <joy.zou@nxp.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20260618-b4-regulator-opt-v1-1-c43b1f62aaf6@oss.nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
fd964ee0ac
commit
fbef4191b4
|
|
@ -44,6 +44,7 @@ struct pca9450 {
|
|||
unsigned int rcnt;
|
||||
int irq;
|
||||
bool sd_vsel_fixed_low;
|
||||
int default_t_off_deb;
|
||||
};
|
||||
|
||||
static const struct regmap_range pca9450_status_range = {
|
||||
|
|
@ -1209,7 +1210,7 @@ static int pca9450_of_init(struct pca9450 *pca9450)
|
|||
|
||||
ret = of_property_read_u32(i2c->dev.of_node, "nxp,pmic-on-req-off-debounce-us", &val);
|
||||
if (ret == -EINVAL)
|
||||
t_off_deb = T_OFF_DEB_120US;
|
||||
t_off_deb = pca9450->default_t_off_deb;
|
||||
else if (ret)
|
||||
return ret;
|
||||
else {
|
||||
|
|
@ -1304,21 +1305,25 @@ static int pca9450_i2c_probe(struct i2c_client *i2c)
|
|||
case PCA9450_TYPE_PCA9450A:
|
||||
regulator_desc = pca9450a_regulators;
|
||||
pca9450->rcnt = ARRAY_SIZE(pca9450a_regulators);
|
||||
pca9450->default_t_off_deb = T_OFF_DEB_120US;
|
||||
type_name = "pca9450a";
|
||||
break;
|
||||
case PCA9450_TYPE_PCA9450BC:
|
||||
regulator_desc = pca9450bc_regulators;
|
||||
pca9450->rcnt = ARRAY_SIZE(pca9450bc_regulators);
|
||||
pca9450->default_t_off_deb = T_OFF_DEB_120US;
|
||||
type_name = "pca9450bc";
|
||||
break;
|
||||
case PCA9450_TYPE_PCA9451A:
|
||||
regulator_desc = pca9451a_regulators;
|
||||
pca9450->rcnt = ARRAY_SIZE(pca9451a_regulators);
|
||||
pca9450->default_t_off_deb = T_OFF_DEB_2MS;
|
||||
type_name = "pca9451a";
|
||||
break;
|
||||
case PCA9450_TYPE_PCA9452:
|
||||
regulator_desc = pca9451a_regulators;
|
||||
pca9450->rcnt = ARRAY_SIZE(pca9451a_regulators);
|
||||
pca9450->default_t_off_deb = T_OFF_DEB_2MS;
|
||||
type_name = "pca9452";
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user