27
27
#include <linux/version.h>
28
28
#include <linux/slab.h>
29
29
#include <linux/of_gpio.h>
30
+ #include <linux/regulator/consumer.h>
30
31
#include "../tp_suspend.h"
31
32
#include "rockchip_gslX680_88v.h"
32
33
#include "rockchip_gsl3670.h"
@@ -156,6 +157,7 @@ struct gsl_ts {
156
157
#if defined(CONFIG_HAS_EARLYSUSPEND )
157
158
struct early_suspend early_suspend ;
158
159
#endif
160
+ struct regulator * rst ;
159
161
};
160
162
161
163
#ifdef GSL_DEBUG
@@ -1120,6 +1122,8 @@ static int gsl_ts_resume(struct device *dev)
1120
1122
}
1121
1123
#endif
1122
1124
1125
+ if ((!IS_ERR (ts -> rst )) && regulator_is_enabled (ts -> rst ) > 0 )
1126
+ regulator_disable (ts -> rst );
1123
1127
gslX680_shutdown_high ();
1124
1128
msleep (20 );
1125
1129
reset_chip (ts -> client );
@@ -1230,6 +1234,7 @@ static int gsl_ts_probe(struct i2c_client *client,
1230
1234
1231
1235
of_property_read_u32 (np , "screen_max_x" , & (ts -> screen_max_x ));
1232
1236
of_property_read_u32 (np , "screen_max_y" , & (ts -> screen_max_y ));
1237
+ of_property_read_u32 (np , "revert_y" , & revert_y );
1233
1238
1234
1239
ts -> irq_pin = of_get_named_gpio_flags (np , "touch-gpio" , 0 , NULL );
1235
1240
ts -> wake_pin = of_get_named_gpio_flags (np , "wake-gpio" , 0 , & wake_flags );
@@ -1248,6 +1253,12 @@ static int gsl_ts_probe(struct i2c_client *client,
1248
1253
goto error_mutex_destroy ;
1249
1254
}
1250
1255
1256
+ ts -> rst = devm_regulator_get (& client -> dev , "rst" );
1257
+ if (IS_ERR (ts -> rst )) {
1258
+ dev_err (& client -> dev , "failed to get regulator, %ld\n" ,
1259
+ PTR_ERR (ts -> rst ));
1260
+ }
1261
+
1251
1262
rc = gsl_ts_init_ts (client , ts );
1252
1263
if (rc < 0 ) {
1253
1264
dev_err (& client -> dev , "GSLX680 init failed\n" );
0 commit comments