All of lore.kernel.org
 help / color / mirror / Atom feed
From: dmitry.torokhov@gmail.com
To: kholk11@gmail.com
Cc: robh+dt@kernel.org, rydberg@bitmath.org, priv.luk@gmail.com,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	marijns95@gmail.com, konradybcio@gmail.com,
	martin.botka1@gmail.com, phone-devel@vger.kernel.org,
	devicetree@vger.kernel.org, krzk@kernel.org
Subject: Re: [PATCH v5 2/3] Input: Add Novatek NT36xxx touchscreen driver
Date: Wed, 21 Oct 2020 14:16:48 -0700	[thread overview]
Message-ID: <20201021211648.GE444962@dtor-ws> (raw)
In-Reply-To: <20201017190152.12780-3-kholk11@gmail.com>

Hi AngeloGioacchino,

[obviously not a complete review, but wanted to call out regmap concern]

On Sat, Oct 17, 2020 at 09:01:51PM +0200, kholk11@gmail.com wrote:
> +static int nt36xxx_read_pid(struct nt36xxx_i2c *ts)
> +{
> +	u8 buf[2] = { 0 };

	__be16 pid;

> +	int ret = 0;
> +
> +	ret = nt36xxx_set_page(ts, ts->mmap->evtbuf_addr);
> +	if (unlikely(ret < 0))
> +		return ret;

regmap is supposed to help with the paged registers, that is why I
recommended using it.

> +
> +	ret = regmap_noinc_read(ts->fw_regmap, NT36XXX_EVT_PROJECTID,
> +				buf, sizeof(buf));
> +	if (unlikely(ret < 0))
> +		return ret;
> +
> +	ts->fw_info.nvt_pid = (buf[1] << 8) + buf[0];

	ts->fw_info.nvt_pid = be16_to_cpu(pid);

Thanks.

-- 
Dmitry

  parent reply	other threads:[~2020-10-21 21:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-17 19:01 [PATCH v5 0/3] Add Novatek NT36xxx touchscreen driver kholk11
2020-10-17 19:01 ` [PATCH v5 1/3] dt-bindings: Add vendor prefix for Novatek Microelectronics Corp kholk11
2020-10-19 16:04   ` Krzysztof Kozlowski
2020-10-17 19:01 ` [PATCH v5 2/3] Input: Add Novatek NT36xxx touchscreen driver kholk11
2020-10-18 19:49   ` Andy Shevchenko
2020-10-21 21:16   ` dmitry.torokhov [this message]
2020-10-17 19:01 ` [PATCH v5 3/3] dt-bindings: touchscreen: Add binding for Novatek NT36xxx series driver kholk11
2020-10-19 16:08   ` Krzysztof Kozlowski

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=20201021211648.GE444962@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kholk11@gmail.com \
    --cc=konradybcio@gmail.com \
    --cc=krzk@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marijns95@gmail.com \
    --cc=martin.botka1@gmail.com \
    --cc=phone-devel@vger.kernel.org \
    --cc=priv.luk@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.