File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -89,9 +89,19 @@ static int rpi_panel_v2_i2c_probe(struct i2c_client *i2c)
89
89
if (ret )
90
90
return dev_err_probe (& i2c -> dev , ret , "Failed to create gpiochip\n" );
91
91
92
+ i2c_set_clientdata (i2c , regmap );
93
+
92
94
return devm_pwmchip_add (& i2c -> dev , pc );
93
95
}
94
96
97
+ static void rpi_panel_v2_i2c_shutdown (struct i2c_client * client )
98
+ {
99
+ struct regmap * regmap = i2c_get_clientdata (client );
100
+
101
+ regmap_write (regmap , REG_PWM , 0 );
102
+ regmap_write (regmap , REG_POWERON , 0 );
103
+ }
104
+
95
105
static const struct of_device_id rpi_panel_v2_dt_ids [] = {
96
106
{ .compatible = "raspberrypi,touchscreen-panel-regulator-v2" },
97
107
{ },
@@ -105,6 +115,7 @@ static struct i2c_driver rpi_panel_v2_regulator_driver = {
105
115
.of_match_table = rpi_panel_v2_dt_ids ,
106
116
},
107
117
.probe = rpi_panel_v2_i2c_probe ,
118
+ .shutdown = rpi_panel_v2_i2c_shutdown ,
108
119
};
109
120
110
121
module_i2c_driver (rpi_panel_v2_regulator_driver );
You can’t perform that action at this time.
0 commit comments