diff options
author | davidycchen <davidycchen@google.com> | 2021-05-07 17:33:08 +0800 |
---|---|---|
committer | davidycchen <davidycchen@google.com> | 2021-05-31 12:27:53 +0800 |
commit | f3a4a020a0e8ee49119e26bb124d1b8e3a66e06b (patch) | |
tree | 3d6f211c4cd76d4fd2265a9e79e461723272bc23 | |
parent | 5c0eb1f2506dd132b5ed1684056c1a8968bfef82 (diff) | |
download | sec_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.c | 23 | ||||
-rw-r--r-- | sec_ts.h | 2 |
2 files changed, 14 insertions, 11 deletions
@@ -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); @@ -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; |