From: Neil Armstrong <neil.armstrong@linaro.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Bastien Nocera <hadess@hadess.net>,
Hans de Goede <hdegoede@redhat.com>,
Henrik Rydberg <rydberg@bitmath.org>,
Jeff LaBundy <jeff@labundy.com>,
linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v12 2/4] Input: add core support for Goodix Berlin Touchscreen IC
Date: Tue, 12 Dec 2023 15:43:59 +0100 [thread overview]
Message-ID: <be39f74b-e04f-48c8-acc9-cc818adfc4db@linaro.org> (raw)
In-Reply-To: <ZXVgYuzE6jPPSfnZ@google.com>
Hi Dmitry,
On 10/12/2023 07:53, Dmitry Torokhov wrote:
> Hi Neil,
>
> On Sat, Dec 09, 2023 at 08:33:40AM +0100, Neil Armstrong wrote:
>> Add initial support for the new Goodix "Berlin" touchscreen ICs.
>>
>> These touchscreen ICs support SPI, I2C and I3C interface, up to
>> 10 finger touch, stylus and gestures events.
>>
>> This initial driver is derived from the Goodix goodix_ts_berlin
>> available at [1] and [2] and only supports the GT9916 IC
>> present on the Qualcomm SM8550 MTP & QRD touch panel.
>>
>> The current implementation only supports BerlinD, aka GT9916.
>>
>> Support for advanced features like:
>> - Firmware & config update
>> - Stylus events
>> - Gestures events
>> - Previous revisions support (BerlinA or BerlinB)
>> is not included in current version.
>>
>> The current support will work with currently flashed firmware
>> and config, and bail out if firmware or config aren't flashed yet.
>>
>> [1] https://github.com/goodix/goodix_ts_berlin
>> [2] https://git.codelinaro.org/clo/la/platform/vendor/opensource/touch-drivers
>>
>> Reviewed-by: Jeff LaBundy <jeff@labundy.com>
>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>
> Thank you for resending the patch. I think there is an issue in how you
> read and parse the data in case of more than 2 fingers. It looks like in
> that case you are overwriting the checksum form the first 2 and then not
> reading the new checksum but use some garbage past the touch data. I
> might be mistaken though...
I carefully inspected the code again, and it's correct, otherwise I would have experimented
checksum errors, which isn't the case.
First read from goodix_berlin_irq() is GOODIX_BERLIN_IRQ_READ_LEN(2) length in memory:
[GOODIX_BERLIN_IRQ_EVENT_HEAD_LEN][GOODIX_BERLIN_COOR_DATA_CHECKSUM_SIZE][GOODIX_BERLIN_BYTES_PER_POINT * x]
the pre_buf_len goodix_berlin_touch_handler() get is GOODIX_BERLIN_IRQ_READ_LEN(2), the we complete the
read after the first read, but since the touch checksum is before the touch data, it works because
we complete the data.
I added some comments to clarify the memory layout and re-ordered the items
in the GOODIX_BERLIN_IRQ_READ_LEN() macro to show GOODIX_BERLIN_COOR_DATA_CHECKSUM
is before the GOODIX_BERLIN_BYTES_PER_POINT data.
>
> I also believe you are leaking afe_data in case of success. We have the
> newfangled __free(kfree) from cleanup.h that should help there.
Indeed it was leaking.
>
> Another request - we should not have anything in goodix_berlin.h that is
> not used by the I2C and SPI sub-drivers, so the only thing it should
> contain is goodix_berlin_probe() declaration and dev_pm_ops. All other
> defines and definitions should go to goodix_berlin_core.h.
>
> I made a few more cosmetic changes in the attached patch, please
> consider applying it.
>
> Thanks.
Thanks,
Neil
next prev parent reply other threads:[~2023-12-12 14:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-09 7:33 [PATCH v12 0/4] Input: add initial support for Goodix Berlin touchscreen IC Neil Armstrong
2023-12-09 7:33 ` [PATCH v12 1/4] dt-bindings: input: document Goodix Berlin Touchscreen IC Neil Armstrong
2023-12-09 7:33 ` [PATCH v12 2/4] Input: add core support for " Neil Armstrong
2023-12-10 6:53 ` Dmitry Torokhov
2023-12-11 9:31 ` Neil Armstrong
2023-12-12 14:43 ` Neil Armstrong [this message]
2023-12-12 15:17 ` Neil Armstrong
2023-12-09 7:33 ` [PATCH v12 3/4] Input: goodix-berlin - add I2C " Neil Armstrong
2023-12-09 7:33 ` [PATCH v12 4/4] Input: goodix-berlin - add SPI " Neil Armstrong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=be39f74b-e04f-48c8-acc9-cc818adfc4db@linaro.org \
--to=neil.armstrong@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=hadess@hadess.net \
--cc=hdegoede@redhat.com \
--cc=jeff@labundy.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=rydberg@bitmath.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).