summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidycchen <davidycchen@google.com>2021-05-07 17:33:08 +0800
committerdavidycchen <davidycchen@google.com>2021-05-31 12:27:53 +0800
commitf3a4a020a0e8ee49119e26bb124d1b8e3a66e06b (patch)
tree3d6f211c4cd76d4fd2265a9e79e461723272bc23
parent5c0eb1f2506dd132b5ed1684056c1a8968bfef82 (diff)
downloadsec_touch-f3a4a020a0e8ee49119e26bb124d1b8e3a66e06b.tar.gz
touch: sec: tbn function changes
As the touch bus negotiator function changes, modify the related functions. Bug: 186717670 Test: tbn works. Signed-off-by: davidycchen <davidycchen@google.com> Change-Id: I37db62f0037262611ab05b65c53ad8633b208e3e
-rw-r--r--sec_ts.c23
-rw-r--r--sec_ts.h2
2 files changed, 14 insertions, 11 deletions
diff --git a/sec_ts.c b/sec_ts.c
index 1bd2a93..dacfef3 100644
--- a/sec_ts.c
+++ b/sec_ts.c
@@ -4078,13 +4078,14 @@ static int sec_ts_probe(struct spi_device *client)
#endif
#if IS_ENABLED(CONFIG_TOUCHSCREEN_TBN)
- ts->tbn = tbn_init(&ts->client->dev);
- if (!ts->tbn) {
- input_err(true, &ts->client->dev,
- "%s: TBN initialization error\n", __func__);
+ if (register_tbn(&ts->tbn_register_mask)) {
ret = -ENODEV;
+ input_err(true, &ts->client->dev,
+ "%s: Failed to register tbn context.\n", __func__);
goto err_init_tbn;
}
+ input_info(true, &ts->client->dev, "%s: tbn_register_mask = %#x.\n",
+ __func__, ts->tbn_register_mask);
#endif
if (gpio_is_valid(ts->plat_data->tsp_id))
@@ -4369,7 +4370,8 @@ err_allocate_input_dev_pad:
input_free_device(ts->input_dev);
err_allocate_input_dev:
#if IS_ENABLED(CONFIG_TOUCHSCREEN_TBN)
- tbn_cleanup(ts->tbn);
+ if (ts->tbn_register_mask)
+ unregister_tbn(&ts->tbn_register_mask);
err_init_tbn:
#endif
@@ -4863,7 +4865,8 @@ static int sec_ts_remove(struct spi_device *client)
ts->plat_data->power(ts, false);
#if IS_ENABLED(CONFIG_TOUCHSCREEN_TBN)
- tbn_cleanup(ts->tbn);
+ if (ts->tbn_register_mask)
+ unregister_tbn(&ts->tbn_register_mask);
#endif
if (gpio_is_valid(ts->plat_data->irq_gpio))
@@ -5144,8 +5147,8 @@ static void sec_ts_suspend_work(struct work_struct *work)
sec_set_switch_gpio(ts, SEC_SWITCH_GPIO_VALUE_SLPI_MASTER);
#if IS_ENABLED(CONFIG_TOUCHSCREEN_TBN)
- if (ts->tbn)
- tbn_release_bus(ts->tbn);
+ if (ts->tbn_register_mask)
+ tbn_release_bus(ts->tbn_register_mask);
#endif
mutex_unlock(&ts->device_mutex);
}
@@ -5161,8 +5164,8 @@ static void sec_ts_resume_work(struct work_struct *work)
mutex_lock(&ts->device_mutex);
#if IS_ENABLED(CONFIG_TOUCHSCREEN_TBN)
- if (ts->tbn)
- tbn_request_bus(ts->tbn);
+ if (ts->tbn_register_mask)
+ tbn_request_bus(ts->tbn_register_mask);
#endif
sec_set_switch_gpio(ts, SEC_SWITCH_GPIO_VALUE_AP_MASTER);
diff --git a/sec_ts.h b/sec_ts.h
index 28b47bd..f4dd33f 100644
--- a/sec_ts.h
+++ b/sec_ts.h
@@ -1071,7 +1071,7 @@ struct sec_ts_data {
bool grips_leaved_once;
#if IS_ENABLED(CONFIG_TOUCHSCREEN_TBN)
- struct tbn_context *tbn;
+ u32 tbn_register_mask;
#endif
struct power_supply *wireless_psy;