From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Marek Vasut <marex@denx.de>
Cc: linux-input@vger.kernel.org, ch@denx.de,
Joe Hung <joe_hung@ilitek.com>, Luca Hsu <luca_hsu@ilitek.com>
Subject: Re: [PATCH v3 1/3] Input: ili210x - use resolution from ili251x firmware
Date: Sat, 16 Oct 2021 22:23:43 -0700 [thread overview]
Message-ID: <YWuzX43d2m7cKO6E@google.com> (raw)
In-Reply-To: <20210831202506.181927-1-marex@denx.de>
Hi Marek,
On Tue, Aug 31, 2021 at 10:25:04PM +0200, Marek Vasut wrote:
> +static int ili251x_firmware_update_resolution(struct device *dev)
> +{
> + struct i2c_client *client = to_i2c_client(dev);
> + struct ili210x *priv = i2c_get_clientdata(client);
> + __le16 resx, resy;
These are normal variables, so I changed it to u16, otherwise sparse is
rightfully unhappy.
> + u8 rs[10];
> + int error;
> +
> + /* The firmware update blob might have changed the resolution. */
> + error = priv->chip->read_reg(client, REG_PANEL_INFO, &rs, sizeof(rs));
> + if (error)
> + return error;
> +
> + resx = le16_to_cpup((__le16 *)rs);
> + resy = le16_to_cpup((__le16 *)(rs + 2));
> +
> + /* The value reported by the firmware is invalid. */
> + if (!resx || resx == 0xffff || !resy || resy == 0xffff)
> + return -EINVAL;
> +
> + input_abs_set_max(priv->input, ABS_X, resx - 1);
> + input_abs_set_max(priv->input, ABS_Y, resy - 1);
> + input_abs_set_max(priv->input, ABS_MT_POSITION_X, resx - 1);
> + input_abs_set_max(priv->input, ABS_MT_POSITION_Y, resy - 1);
> +
> + return 0;
> +}
> +
> +static int ili251x_firmware_update_cached_state(struct device *dev)
> +{
> + struct i2c_client *client = to_i2c_client(dev);
> + struct ili210x *priv = i2c_get_clientdata(client);
> + int ret;
Changed this to "error" and applied, thank you.
--
Dmitry
prev parent reply other threads:[~2021-10-17 5:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-31 20:25 [PATCH v3 1/3] Input: ili210x - use resolution from ili251x firmware Marek Vasut
2021-08-31 20:25 ` [PATCH v3 2/3] Input: ili210x - export ili251x version details via sysfs Marek Vasut
2021-10-17 5:23 ` Dmitry Torokhov
2021-08-31 20:25 ` [PATCH v3 3/3] Input: ili210x - add ili251x firmware update support Marek Vasut
2021-10-17 5:26 ` Dmitry Torokhov
2021-10-17 14:27 ` Marek Vasut
2021-10-16 19:50 ` [PATCH v3 1/3] Input: ili210x - use resolution from ili251x firmware Marek Vasut
2021-10-17 5:23 ` Dmitry Torokhov [this message]
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=YWuzX43d2m7cKO6E@google.com \
--to=dmitry.torokhov@gmail.com \
--cc=ch@denx.de \
--cc=joe_hung@ilitek.com \
--cc=linux-input@vger.kernel.org \
--cc=luca_hsu@ilitek.com \
--cc=marex@denx.de \
/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.