File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -442,6 +442,18 @@ static void tps65910_power_off(void *data)
442
442
DEVCTRL_DEV_OFF_MASK );
443
443
}
444
444
445
+ static void tps65910_restart (struct restart_data * data )
446
+ {
447
+ struct i2c_client * tps65910_i2c_client = data -> cb_data ;
448
+ struct tps65910 * tps65910 ;
449
+
450
+ tps65910 = dev_get_drvdata (& tps65910_i2c_client -> dev );
451
+
452
+ regmap_update_bits (tps65910 -> regmap , TPS65910_DEVCTRL ,
453
+ DEVCTRL_DEV_OFF_RST_MASK | DEVCTRL_DEV_ON_MASK ,
454
+ DEVCTRL_DEV_OFF_RST_MASK );
455
+ }
456
+
445
457
static int tps65910_i2c_probe (struct i2c_client * i2c ,
446
458
const struct i2c_device_id * id )
447
459
{
@@ -517,6 +529,15 @@ static int tps65910_i2c_probe(struct i2c_client *i2c,
517
529
"failed to register power-off handler: %d\n" , ret );
518
530
return ret ;
519
531
}
532
+
533
+ ret = devm_register_simple_restart_handler (& i2c -> dev ,
534
+ tps65910_restart ,
535
+ i2c );
536
+ if (ret ) {
537
+ dev_err (& i2c -> dev ,
538
+ "failed to register restart handler: %d\n" , ret );
539
+ return ret ;
540
+ }
520
541
}
521
542
522
543
ret = devm_mfd_add_devices (tps65910 -> dev , -1 ,
You can’t perform that action at this time.
0 commit comments