|
@@ -349,6 +349,8 @@ static int as3722_i2c_of_probe(struct i2c_client *i2c,
|
|
"ams,enable-internal-int-pullup");
|
|
"ams,enable-internal-int-pullup");
|
|
as3722->en_intern_i2c_pullup = of_property_read_bool(np,
|
|
as3722->en_intern_i2c_pullup = of_property_read_bool(np,
|
|
"ams,enable-internal-i2c-pullup");
|
|
"ams,enable-internal-i2c-pullup");
|
|
|
|
+ as3722->en_ac_ok_pwr_on = of_property_read_bool(np,
|
|
|
|
+ "ams,enable-ac-ok-power-on");
|
|
as3722->irq_flags = irqd_get_trigger_type(irq_data);
|
|
as3722->irq_flags = irqd_get_trigger_type(irq_data);
|
|
dev_dbg(&i2c->dev, "IRQ flags are 0x%08lx\n", as3722->irq_flags);
|
|
dev_dbg(&i2c->dev, "IRQ flags are 0x%08lx\n", as3722->irq_flags);
|
|
return 0;
|
|
return 0;
|
|
@@ -360,6 +362,7 @@ static int as3722_i2c_probe(struct i2c_client *i2c,
|
|
struct as3722 *as3722;
|
|
struct as3722 *as3722;
|
|
unsigned long irq_flags;
|
|
unsigned long irq_flags;
|
|
int ret;
|
|
int ret;
|
|
|
|
+ u8 val = 0;
|
|
|
|
|
|
as3722 = devm_kzalloc(&i2c->dev, sizeof(struct as3722), GFP_KERNEL);
|
|
as3722 = devm_kzalloc(&i2c->dev, sizeof(struct as3722), GFP_KERNEL);
|
|
if (!as3722)
|
|
if (!as3722)
|
|
@@ -398,6 +401,15 @@ static int as3722_i2c_probe(struct i2c_client *i2c,
|
|
if (ret < 0)
|
|
if (ret < 0)
|
|
return ret;
|
|
return ret;
|
|
|
|
|
|
|
|
+ if (as3722->en_ac_ok_pwr_on)
|
|
|
|
+ val = AS3722_CTRL_SEQU1_AC_OK_PWR_ON;
|
|
|
|
+ ret = as3722_update_bits(as3722, AS3722_CTRL_SEQU1_REG,
|
|
|
|
+ AS3722_CTRL_SEQU1_AC_OK_PWR_ON, val);
|
|
|
|
+ if (ret < 0) {
|
|
|
|
+ dev_err(as3722->dev, "CTRLsequ1 update failed: %d\n", ret);
|
|
|
|
+ return ret;
|
|
|
|
+ }
|
|
|
|
+
|
|
ret = devm_mfd_add_devices(&i2c->dev, -1, as3722_devs,
|
|
ret = devm_mfd_add_devices(&i2c->dev, -1, as3722_devs,
|
|
ARRAY_SIZE(as3722_devs), NULL, 0,
|
|
ARRAY_SIZE(as3722_devs), NULL, 0,
|
|
regmap_irq_get_domain(as3722->irq_data));
|
|
regmap_irq_get_domain(as3722->irq_data));
|