[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZTnzorJ4h1zva1AZ@nixie71>
Date: Thu, 26 Oct 2023 00:05:38 -0500
From: Jeff LaBundy <jeff@...undy.com>
To: Neil Armstrong <neil.armstrong@...aro.org>
Cc: Dmitry Torokhov <dmitry.torokhov@...il.com>,
linux-input@...r.kernel.org, Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
Bastien Nocera <hadess@...ess.net>,
Hans de Goede <hdegoede@...hat.com>,
Henrik Rydberg <rydberg@...math.org>,
linux-arm-msm@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v10 2/4] Input: add core support for Goodix Berlin
Touchscreen IC
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
Powered by blists - more mailing lists