# [bootlin/training-materials updates] master: labs/kernel-i2c-input-interface: improve the wording (a8732d80)

Thomas Petazzoni thomas.petazzoni at bootlin.com
Wed Nov 27 14:46:23 CET 2019

Repository : https://github.com/bootlin/training-materials
On branch  : master
Link       : https://github.com/bootlin/training-materials/commit/a8732d80fba1a8c3eac3a7d3712611857ca6d044

>---------------------------------------------------------------

commit a8732d80fba1a8c3eac3a7d3712611857ca6d044
Author: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
Date:   Wed Nov 27 14:46:23 2019 +0100

labs/kernel-i2c-input-interface: improve the wording

The "First, add lines [...]" text was very confusing, because the
explanation about the private structures is so long that we no longer
remember that we were working on the nunchuk_poll() function. And in
fact, just a few lines above, we are working on nunchuk_probe(), which
is very confusing.

Try to improve the wording to make it clear we are now back to
implementing the nunchuk_poll() function.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>

>---------------------------------------------------------------

a8732d80fba1a8c3eac3a7d3712611857ca6d044
labs/kernel-i2c-input-interface/kernel-i2c-input-interface.tex | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/labs/kernel-i2c-input-interface/kernel-i2c-input-interface.tex b/labs/kernel-i2c-input-interface/kernel-i2c-input-interface.tex
index f90c66ab..8d74a5ec 100644
--- a/labs/kernel-i2c-input-interface/kernel-i2c-input-interface.tex
+++ b/labs/kernel-i2c-input-interface/kernel-i2c-input-interface.tex
@@ -121,7 +121,7 @@ This way, when the \code{remove()} routine is called, we can find out
which logical device to unregister (though that's not necessary in our
case as logical device unregistration is automatic). Conversely, when we
have an event on the logical side (such as running the polling
-function), we can find out which i2c slave this corresponds to,
+function), we can find out which I2C device this corresponds to,
to communicate with the hardware.

This need is typically implemented by creating a {\em private} data
@@ -161,9 +161,10 @@ Make sure you add this code before registering the input device. You
don't want to enable a device with incomplete information or when it is
not completely yet (there could be race conditions).

-First, add lines retrieving the I2C physical device from the
-\ksym{input_polled_dev} structure. That's where you will need your
-private \code{nunchuk} structure.
+So, back to the \code{nunchuk_poll()} function, you will first need to
+retrieve the I2C physical device from the \ksym{input_polled_dev}
+structure. That's where you will use your private \code{nunchuk}
+structure.

Now that you have a handle on the I2C physical device, you can move the
code reading the nunchuk registers to this function. You can



More information about the training-materials-updates mailing list