<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/input/keyboard/applespi.c, branch linux-5.14.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.14.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.14.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-02-19T19:13:29Z</updated>
<entry>
<title>Input: applespi - fix occasional crc errors under load.</title>
<updated>2021-02-19T19:13:29Z</updated>
<author>
<name>Ronald Tschalär</name>
</author>
<published>2021-02-19T19:12:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e64123949e6c9581c97fc14594f1cf34bf1d87a8'/>
<id>urn:sha1:e64123949e6c9581c97fc14594f1cf34bf1d87a8</id>
<content type='text'>
For some reason, when the system is under heavy CPU load, the read
following the write sometimes occurs unusually quickly, resulting in
the read data not being quite ready and hence a bad packet getting read.
Adding another delay after reading the status message appears to fix
this.

Signed-off-by: Ronald Tschalär &lt;ronald@innovation.ch&gt;
Link: https://lore.kernel.org/r/20210217190718.11035-2-ronald@innovation.ch
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: applespi - don't wait for responses to commands indefinitely.</title>
<updated>2021-02-19T19:13:27Z</updated>
<author>
<name>Ronald Tschalär</name>
</author>
<published>2021-02-19T19:10:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0ce1ac23149c6da939a5926c098c270c58c317a0'/>
<id>urn:sha1:0ce1ac23149c6da939a5926c098c270c58c317a0</id>
<content type='text'>
The response to a command may never arrive or it may be corrupted (and
hence dropped) for some reason. While exceedingly rare, when it did
happen it blocked all further commands. One way to fix this was to
do a suspend/resume. However, recovering automatically seems like a
nicer option. Hence this puts a time limit (1 sec) on how long we're
willing to wait for a response, after which we assume it got lost.

Signed-off-by: Ronald Tschalär &lt;ronald@innovation.ch&gt;
Link: https://lore.kernel.org/r/20210217190718.11035-1-ronald@innovation.ch
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: applespi - use new structure for SPI transfer delays</title>
<updated>2020-12-11T07:39:16Z</updated>
<author>
<name>Sergiu Cuciurean</name>
</author>
<published>2020-12-11T05:57:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6a8f9ed23a8e06a3ca823aeb6058202f99e557f2'/>
<id>urn:sha1:6a8f9ed23a8e06a3ca823aeb6058202f99e557f2</id>
<content type='text'>
In a recent change to the SPI subsystem [1], a new `delay` struct was added
to replace the `delay_usecs`. This change replaces the current
`delay_usecs` with `delay` for this driver.

The `spi_transfer_delay_exec()` function [in the SPI framework] makes sure
that both `delay_usecs` &amp; `delay` are used (in this order to preserve
backwards compatibility).

[1] commit bebcfd272df6 ("spi: introduce `delay` field for
`spi_transfer` + spi_transfer_delay_exec()")

Signed-off-by: Sergiu Cuciurean &lt;sergiu.cuciurean@analog.com&gt;
Tested-by: Ronald Tschalär &lt;ronald@innovation.ch&gt;
Reviewed-by: Ronald Tschalär &lt;ronald@innovation.ch&gt;
Link: https://lore.kernel.org/r/20200227124534.23399-1-sergiu.cuciurean@analog.com
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;</content>
</entry>
<entry>
<title>Input: applespi - provide missing struct 'message' descriptions</title>
<updated>2020-11-20T03:56:41Z</updated>
<author>
<name>Lee Jones</name>
</author>
<published>2020-11-20T03:20:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=39f4879e99a42d3ebcf9876bf4201d95679445d3'/>
<id>urn:sha1:39f4879e99a42d3ebcf9876bf4201d95679445d3</id>
<content type='text'>
Fixes the following W=1 kernel build warning(s):

 drivers/input/keyboard/applespi.c:306: warning: Function parameter or member 'keyboard' not described in 'message'
 drivers/input/keyboard/applespi.c:306: warning: Function parameter or member 'touchpad' not described in 'message'
 drivers/input/keyboard/applespi.c:306: warning: Function parameter or member 'tp_info' not described in 'message'
 drivers/input/keyboard/applespi.c:306: warning: Function parameter or member 'tp_info_command' not described in 'message'
 drivers/input/keyboard/applespi.c:306: warning: Function parameter or member 'init_mt_command' not described in 'message'
 drivers/input/keyboard/applespi.c:306: warning: Function parameter or member 'capsl_command' not described in 'message'
 drivers/input/keyboard/applespi.c:306: warning: Function parameter or member 'bl_command' not described in 'message'
 drivers/input/keyboard/applespi.c:306: warning: Function parameter or member 'data' not described in 'message'

Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Link: https://lore.kernel.org/r/20201112110204.2083435-15-lee.jones@linaro.org
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: applespi - replace zero-length array with flexible-array</title>
<updated>2020-05-10T05:15:41Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
</author>
<published>2020-05-07T19:29:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d34fced41e172fae2df7819b1d5a398c62067599'/>
<id>urn:sha1:d34fced41e172fae2df7819b1d5a398c62067599</id>
<content type='text'>
The current codebase makes use of the zero-length array language
extension to the C90 standard, but the preferred mechanism to declare
variable-length types such as these ones is a flexible array member[1][2],
introduced in C99:

struct foo {
        int stuff;
        struct boo array[];
};

By making use of the mechanism above, we will get a compiler warning
in case the flexible array does not occur last in the structure, which
will help us prevent some kind of undefined behavior bugs from being
inadvertently introduced[3] to the codebase from now on.

Also, notice that, dynamic memory allocations won't be affected by
this change:

"Flexible array members have incomplete type, and so the sizeof operator
may not be applied. As a quirk of the original implementation of
zero-length arrays, sizeof evaluates to zero."[1]

sizeof(flexible-array-member) triggers a warning because flexible array
members have incomplete type[1]. There are some instances of code in
which the sizeof operator is being incorrectly/erroneously applied to
zero-length arrays and the result is zero. Such instances may be hiding
some bugs. So, this work (flexible-array member conversions) will also
help to get completely rid of those sorts of issues.

This issue was found with the help of Coccinelle.

[1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
[2] https://github.com/KSPP/linux/issues/21
[3] commit 76497732932f ("cxgb3/l2t: Fix undefined behaviour")

Signed-off-by: Gustavo A. R. Silva &lt;gustavoars@kernel.org&gt;
Link: https://lore.kernel.org/r/20200507185347.GA14499@embeddedor
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: applespi - no need to check return value of debugfs_create functions</title>
<updated>2019-08-12T07:10:59Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
</author>
<published>2019-08-12T07:06:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f5d4c647d0ddcf4ffcb9ff584fba87a976addcbd'/>
<id>urn:sha1:f5d4c647d0ddcf4ffcb9ff584fba87a976addcbd</id>
<content type='text'>
When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: applespi - use struct_size() helper</title>
<updated>2019-08-06T16:10:56Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
</author>
<published>2019-08-06T16:03:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=37ad2e343449ced9e41505eae5494bf40f433181'/>
<id>urn:sha1:37ad2e343449ced9e41505eae5494bf40f433181</id>
<content type='text'>
One of the more common cases of allocation size calculations is finding
the size of a structure that has a zero-sized array at the end, along
with memory for some number of elements for that array. For example:

struct touchpad_protocol {
	...
        struct tp_finger        fingers[0];
};

Make use of the struct_size() helper instead of an open-coded version
in order to avoid any potential type mistakes.

So, replace the following form:

sizeof(*tp) + tp-&gt;number_of_fingers * sizeof(tp-&gt;fingers[0]);

with:

struct_size(tp, fingers, tp-&gt;number_of_fingers)

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>Input: applespi - fix trivial typo in struct description</title>
<updated>2019-07-23T13:48:59Z</updated>
<author>
<name>Nikolas Nyby</name>
</author>
<published>2019-07-23T13:42:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b1cbb2f09d7b3f1726215987d5b28f5aea9548da'/>
<id>urn:sha1:b1cbb2f09d7b3f1726215987d5b28f5aea9548da</id>
<content type='text'>
This fixes a typo in the keyboard_protocol description.
coodinate -&gt; coordinate.

Signed-off-by: Nikolas Nyby &lt;nikolas@gnu.org&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;</content>
</entry>
<entry>
<title>Input: applespi - fix warnings detected by sparse</title>
<updated>2019-07-21T12:26:33Z</updated>
<author>
<name>Ronald Tschalär</name>
</author>
<published>2019-07-21T12:15:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a7cd67e2b76edd46fbd2517078eeba369f933575'/>
<id>urn:sha1:a7cd67e2b76edd46fbd2517078eeba369f933575</id>
<content type='text'>
This makes sure that we convert from on-wire to CPU endianness in
applespi_debug_update_dimensions() and also marks as "static" as it is not
needed to be visible outside of the driver.

Reported-by: kbuild test robot &lt;lkp@intel.com&gt;
Signed-off-by: Ronald Tschalär &lt;ronald@innovation.ch&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;</content>
</entry>
<entry>
<title>Input: applespi - remove set but not used variables 'sts'</title>
<updated>2019-07-19T08:58:49Z</updated>
<author>
<name>Mao Wenan</name>
</author>
<published>2019-07-16T18:16:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d56fef0ec85b8a8bae5d7d003b93f0a0aaf82ed9'/>
<id>urn:sha1:d56fef0ec85b8a8bae5d7d003b93f0a0aaf82ed9</id>
<content type='text'>
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/input/keyboard/applespi.c: In function applespi_set_bl_level:
drivers/input/keyboard/applespi.c:902:6: warning: variable sts set but not used [-Wunused-but-set-variable]

Fixes: b426ac0452093d ("Input: add Apple SPI keyboard and trackpad driver")
Signed-off-by: Mao Wenan &lt;maowenan@huawei.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;</content>
</entry>
</feed>
