Skip to content

Commit 2533e8a

Browse files
Andrew Chantdmd79
authored andcommitted
input: touchscreen: synaptics: Remove fw_update sysfs entries
Remove the sysfs entrypoints to fw_update of synaptics driver. BUG: 32769717 Change-Id: I710cb37a8b5382dce7aa6a1d8748be5853a18a7a Git-commit: 2615c5f302441568e6dd20007bc5246d72837e80 Git-repo: https://android.googlesource.com/kernel/msm.git Signed-off-by: Andrew Chant <[email protected]> [[email protected]: picked those lines that are applying cleanly to the driver. Some of the lines as per googlesource.com git commit is not applying cleanly.] Signed-off-by: Shantanu Jain <[email protected]>
1 parent 6872e2b commit 2533e8a

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

drivers/input/touchscreen/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,16 @@ config TOUCHSCREEN_FT5X06_GESTURE
995995

996996
If unsure, say N.
997997

998+
config TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
999+
bool "Synaptics DSX firmware update extra sysfs attributes"
1000+
depends on TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE
1001+
help
1002+
Say Y here to enable support for extra sysfs attributes
1003+
supporting firmware update in a development environment.
1004+
This does not affect the core or other subsystem attributes.
1005+
1006+
If unsure, say N.
1007+
9981008
config SECURE_TOUCH
9991009
bool "Secure Touch"
10001010
depends on (TOUCHSCREEN_SYNAPTICS_I2C_RMI4 || \

drivers/input/touchscreen/synaptics_fw_update.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,6 +1305,7 @@ static int fwu_do_write_config(void)
13051305
return retval;
13061306
}
13071307

1308+
#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
13081309
static int fwu_start_write_config(void)
13091310
{
13101311
int retval;
@@ -1357,6 +1358,7 @@ static int fwu_start_write_config(void)
13571358

13581359
return retval;
13591360
}
1361+
#endif
13601362

13611363
static int fwu_do_write_lockdown(bool reset)
13621364
{
@@ -1404,6 +1406,7 @@ static int fwu_do_write_lockdown(bool reset)
14041406
return retval;
14051407
}
14061408

1409+
#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
14071410
static int fwu_start_write_lockdown(void)
14081411
{
14091412
if (parse_header())
@@ -1505,6 +1508,7 @@ static int fwu_do_read_config(void)
15051508
exit:
15061509
return retval;
15071510
}
1511+
#endif
15081512

15091513
static int fwu_do_reflash(void)
15101514
{
@@ -1730,6 +1734,7 @@ int synaptics_fw_updater(void)
17301734
}
17311735
EXPORT_SYMBOL(synaptics_fw_updater);
17321736

1737+
#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
17331738
static ssize_t fwu_sysfs_show_image(struct file *data_file,
17341739
struct kobject *kobj, struct bin_attribute *attributes,
17351740
char *buf, loff_t pos, size_t count)
@@ -2154,6 +2159,7 @@ static ssize_t fwu_sysfs_package_id_show(struct device *dev,
21542159
(pkg_id[1] << 8) | pkg_id[0],
21552160
(pkg_id[3] << 8) | pkg_id[2]);
21562161
}
2162+
#endif
21572163

21582164
static int synaptics_rmi4_debug_dump_info(struct seq_file *m, void *v)
21592165
{
@@ -2187,6 +2193,7 @@ static void synaptics_rmi4_fwu_attn(struct synaptics_rmi4_data *rmi4_data,
21872193
return;
21882194
}
21892195

2196+
#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
21902197
static struct bin_attribute dev_attr_data = {
21912198
.attr = {
21922199
.name = "data",
@@ -2196,8 +2203,10 @@ static struct bin_attribute dev_attr_data = {
21962203
.read = fwu_sysfs_show_image,
21972204
.write = fwu_sysfs_store_image,
21982205
};
2206+
#endif
21992207

22002208
static struct device_attribute attrs[] = {
2209+
#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
22012210
__ATTR(fw_name, S_IRUGO | S_IWUSR | S_IWGRP,
22022211
fwu_sysfs_image_name_show,
22032212
fwu_sysfs_image_name_store),
@@ -2246,6 +2255,7 @@ static struct device_attribute attrs[] = {
22462255
__ATTR(package_id, S_IRUGO,
22472256
fwu_sysfs_package_id_show,
22482257
synaptics_rmi4_store_error),
2258+
#endif
22492259
};
22502260

22512261

@@ -2325,6 +2335,7 @@ static int synaptics_rmi4_fwu_init(struct synaptics_rmi4_data *rmi4_data)
23252335
fwu->initialized = true;
23262336
fwu->polling_mode = false;
23272337

2338+
#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
23282339
retval = sysfs_create_bin_file(&rmi4_data->i2c_client->dev.kobj,
23292340
&dev_attr_data);
23302341
if (retval < 0) {
@@ -2333,6 +2344,7 @@ static int synaptics_rmi4_fwu_init(struct synaptics_rmi4_data *rmi4_data)
23332344
__func__);
23342345
goto exit_free_mem;
23352346
}
2347+
#endif
23362348

23372349
for (attr_count = 0; attr_count < ARRAY_SIZE(attrs); attr_count++) {
23382350
retval = sysfs_create_file(&rmi4_data->i2c_client->dev.kobj,
@@ -2380,7 +2392,9 @@ static int synaptics_rmi4_fwu_init(struct synaptics_rmi4_data *rmi4_data)
23802392
&attrs[attr_count].attr);
23812393
}
23822394

2395+
#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
23832396
sysfs_remove_bin_file(&rmi4_data->input_dev->dev.kobj, &dev_attr_data);
2397+
#endif
23842398

23852399
exit_free_mem:
23862400
kfree(fwu->fn_ptr);
@@ -2397,7 +2411,9 @@ static void synaptics_rmi4_fwu_remove(struct synaptics_rmi4_data *rmi4_data)
23972411
{
23982412
unsigned char attr_count;
23992413

2414+
#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_EXTRA_SYSFS
24002415
sysfs_remove_bin_file(&rmi4_data->input_dev->dev.kobj, &dev_attr_data);
2416+
#endif
24012417

24022418
for (attr_count = 0; attr_count < ARRAY_SIZE(attrs); attr_count++) {
24032419
sysfs_remove_file(&rmi4_data->input_dev->dev.kobj,

0 commit comments

Comments
 (0)