Linux Input/HID development
 help / color / mirror / Atom feed
From: Neil Armstrong <neil.armstrong@linaro.org>
To: Jeff LaBundy <jeff@labundy.com>
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, 2 Nov 2023 11:32:13 +0100	[thread overview]
Message-ID: <0126493b-6735-42a6-b346-dfabdf23bcaf@linaro.org> (raw)
In-Reply-To: <ZTnzorJ4h1zva1AZ@nixie71>

Hi Jeff,

On 26/10/2023 07:05, Jeff LaBundy wrote:
> 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().

Ack

> 
>> +		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.

Ack

> 
>> +		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().

Ack

> 
>> +
>> +	/* 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.

Ack

> 
>> +		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?

Indeed, it was dropped, I'll add it back thx for noticing !

> 
>> +
>> +	return 0;
>> +}
> 
> Kind regards,
> Jeff LaBundy

Thanks,
Neil


  reply	other threads:[~2023-11-02 10:32 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
2023-11-02 10:32     ` Neil Armstrong [this message]
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=0126493b-6735-42a6-b346-dfabdf23bcaf@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