From: Jeff LaBundy <jeff@labundy.com>
To: Neil Armstrong <neil.armstrong@linaro.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
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>,
linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v10 2/4] Input: add core support for Goodix Berlin Touchscreen IC
Date: Thu, 26 Oct 2023 00:05:38 -0500 [thread overview]
Message-ID: <ZTnzorJ4h1zva1AZ@nixie71> (raw)
In-Reply-To: <20231023-topic-goodix-berlin-upstream-initial-v10-2-88eec2e51c0b@linaro.org>
Hi Neil,
On Mon, Oct 23, 2023 at 05:03:46PM +0200, Neil Armstrong wrote:
[...]
> +static int goodix_berlin_get_ic_info(struct goodix_berlin_core *cd)
> +{
> + __le16 length_raw;
> + u8 *afe_data;
> + u16 length;
> + int error;
> +
> + afe_data = kzalloc(GOODIX_BERLIN_IC_INFO_MAX_LEN, GFP_KERNEL);
> + if (!afe_data)
> + return -ENOMEM;
> +
> + error = regmap_raw_read(cd->regmap, GOODIX_BERLIN_IC_INFO_ADDR,
> + &length_raw, sizeof(length_raw));
> + if (error) {
> + dev_info(cd->dev, "failed get ic info length, %d\n", error);
This should be dev_err().
> + goto free_afe_data;
> + }
> +
> + length = le16_to_cpu(length_raw);
> + if (length >= GOODIX_BERLIN_IC_INFO_MAX_LEN) {
> + dev_info(cd->dev, "invalid ic info length %d\n", length);
And here.
> + error = -EINVAL;
> + goto free_afe_data;
> + }
> +
> + error = regmap_raw_read(cd->regmap, GOODIX_BERLIN_IC_INFO_ADDR,
> + afe_data, length);
> + if (error) {
> + dev_info(cd->dev, "failed get ic info data, %d\n", error);
> + return error;
> + goto free_afe_data;
> + }
This return statement is left over from v9; the print should also be dev_err().
> +
> + /* check whether the data is valid (ex. bus default values) */
> + if (goodix_berlin_is_dummy_data(cd, afe_data, length)) {
> + dev_err(cd->dev, "fw info data invalid\n");
> + error = -EINVAL;
> + goto free_afe_data;
> + }
> +
> + if (!goodix_berlin_checksum_valid(afe_data, length)) {
> + dev_info(cd->dev, "fw info checksum error\n");
And here.
> + error = -EINVAL;
> + goto free_afe_data;
> + }
> +
> + error = goodix_berlin_convert_ic_info(cd, afe_data, length);
> + if (error)
> + goto free_afe_data;
> +
> + /* check some key info */
> + if (!cd->touch_data_addr) {
> + dev_err(cd->dev, "touch_data_addr is null\n");
> + error = -EINVAL;
> + goto free_afe_data;
> + }
> +
> + return 0;
> +
> +free_afe_data:
> + kfree(afe_data);
> +
> + return error;
> +}
[...]
> +static int goodix_berlin_request_handle_reset(struct goodix_berlin_core *cd)
> +{
> + gpiod_set_value(cd->reset_gpio, 1);
> + usleep_range(2000, 2100);
> + gpiod_set_value(cd->reset_gpio, 0);
I see that now, this function is only called if the reset GPIO is defined,
but there used to be another msleep() here that has since been dropped. Is
that intentional?
> +
> + return 0;
> +}
Kind regards,
Jeff LaBundy
next prev parent reply other threads:[~2023-10-26 5:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-23 15:03 [PATCH v10 0/4] Input: add initial support for Goodix Berlin touchscreen IC Neil Armstrong
2023-10-23 15:03 ` [PATCH v10 1/4] dt-bindings: input: document Goodix Berlin Touchscreen IC Neil Armstrong
2023-10-23 15:03 ` [PATCH v10 2/4] Input: add core support for " Neil Armstrong
2023-10-26 5:05 ` Jeff LaBundy [this message]
2023-11-02 10:32 ` Neil Armstrong
2023-10-23 15:03 ` [PATCH v10 3/4] Input: goodix-berlin - add I2C " Neil Armstrong
2023-10-23 15:03 ` [PATCH v10 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=ZTnzorJ4h1zva1AZ@nixie71 \
--to=jeff@labundy.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=hadess@hadess.net \
--cc=hdegoede@redhat.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=neil.armstrong@linaro.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