diff options
author | Super Liu <supercjliu@google.com> | 2021-07-05 00:04:16 +0000 |
---|---|---|
committer | Super Liu <supercjliu@google.com> | 2021-07-05 02:44:20 +0000 |
commit | d4aba2a6b5c4965027d814fdd2574a965cc1e1fe (patch) | |
tree | bf4d9c1ce38642b02fa486196396bab3a495d563 | |
parent | b8087beeee726fb474db1feea55412bc0b0acfb1 (diff) | |
download | fts_touch-d4aba2a6b5c4965027d814fdd2574a965cc1e1fe.tar.gz |
touch/fts: set rt priority for SPI transfer
When system is busy, the kthread of SPI transfer might be preempted
by other tasks due to its low priority. This could potentially
delay or block the driver reading touch events. Therefore, set the
priority of SPI transfer as IRQ bottom-half thread to mitigate the
latency.
Bug: 191712843
Test: Check the trace that only affect touch SPI bus.
Signed-off-by: Super Liu <supercjliu@google.com>
Change-Id: I729cd64c01cf67af28bf10770dcb79d897b00cfc
-rw-r--r-- | fts.c | 20 |
1 files changed, 9 insertions, 11 deletions
@@ -6148,7 +6148,7 @@ static int fts_probe(struct spi_device *client) #ifdef I2C_INTERFACE dev_info(&client->dev, "I2C interface...\n"); if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { - dev_err(info->dev, "Unsupported I2C functionality\n"); + dev_err(&client->dev, "Unsupported I2C functionality\n"); error = -EIO; goto ProbeErrorExit_0; } @@ -6156,21 +6156,19 @@ static int fts_probe(struct spi_device *client) dev_info(&client->dev, "i2c address: %x\n", client->addr); bus_type = BUS_I2C; #else - dev_info(&client->dev, "SPI interface...\n"); - - client->bits_per_word = 8; - if (spi_setup(client) < 0) { - dev_err(&client->dev, "Unsupported SPI functionality\n"); - error = -EIO; - goto ProbeErrorExit_0; + if (client->controller->rt == false) { + client->rt = true; + retval = spi_setup(client); + if (retval < 0) { + dev_err(&client->dev, "%s: setup SPI rt failed(%d)\n", + __func__, retval); + } } + dev_info(&client->dev, "SPI interface...\n"); bus_type = BUS_SPI; #endif - - dev_info(&client->dev, "SET Device driver INFO:\n"); - info = kzalloc(sizeof(struct fts_ts_info), GFP_KERNEL); if (!info) { dev_err(&client->dev, "Out of memory... Impossible to allocate struct info!\n"); |