From: Bastien Nocera <hadess@hadess.net>
To: Franklin S Cooper Jr <fcooper@ti.com>,
dmitry.torokhov@gmail.com, robh+dt@kernel.org,
octavian.purdila@intel.com, irina.tirdea@intel.com,
merker@debian.org, linux-input@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
nsekhar@ti.com, nm@ti.com
Subject: Re: [PATCH 2/4] Input: goodix - Allow tweaking of configuration file dynamically
Date: Thu, 27 Oct 2016 19:41:23 +0200 [thread overview]
Message-ID: <1477590083.18960.0.camel@hadess.net> (raw)
In-Reply-To: <f3a9de30-eba6-0738-ed91-f4834f142a2c@ti.com>
On Thu, 2016-10-27 at 11:58 -0500, Franklin S Cooper Jr wrote:
>
> On 10/27/2016 05:33 AM, Bastien Nocera wrote:
> > On Thu, 2016-10-20 at 14:59 -0500, Franklin S Cooper Jr wrote:
> > > Some goodix touchscreen controllers don't have the correct
> > > configuration
> > > firmware for the display panel it is attached to. Therefore,
> > > settings
> > > such
> > > as touchscreen x and y size may need to be passed in via DT and
> > > have
> > > the
> > > panel reprogrammed for the updated touchscreen resolution.
> > >
> > > This patchset adds support for reading the current configuration
> > > firmware
> > > on the panel and allowing it to be modified and rewritten back to
> > > the
> > > device.
> > >
> > > Currently this function is unused but later patches will make use
> > > of
> > > it.
> > >
> > > Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com>
> > > ---
> > > drivers/input/touchscreen/goodix.c | 28
> > > ++++++++++++++++++++++++++++
> > > 1 file changed, 28 insertions(+)
> > >
> > > diff --git a/drivers/input/touchscreen/goodix.c
> > > b/drivers/input/touchscreen/goodix.c
> > > index a43c8ca..01e12f8 100644
> > > --- a/drivers/input/touchscreen/goodix.c
> > > +++ b/drivers/input/touchscreen/goodix.c
> > > @@ -478,6 +478,34 @@ static int goodix_get_gpio_config(struct
> > > goodix_ts_data *ts)
> > > return 0;
> > > }
> > >
> > > +static void goodix_tweak_config(struct goodix_ts_data *ts)
> > > +{
> > > + u8 config[GOODIX_CONFIG_MAX_LENGTH];
> > > + int error;
> > > + int raw_cfg_len;
> > > + u8 check_sum = 0;
> > > +
> > > + raw_cfg_len = ts->cfg_len - 2;
> > > +
> > > + error = goodix_i2c_read(ts->client,
> > > GOODIX_REG_CONFIG_DATA,
> > > + config, ts->cfg_len);
> > > + if (error) {
> > > + dev_warn(&ts->client->dev,
> > > + "Error reading config (%d), avoid
> > > tweaking
> > > config\n",
> > > + error);
> > > + return;
> > > + }
> >
> > Please add a placeholder comment here, to go along with the commit
> > message explanation.
>
> You just want a comment here stating that changes to the firmware
> should
> be made here?
Yes, at least for this intermediary patch. You can remove in in
subsequent patches when it's clearer that this is where things go.
> > > + check_sum = goodix_calculate_checksum(ts->cfg_len,
> > > config);
> > > +
> > > + config[raw_cfg_len] = check_sum;
> > > + config[raw_cfg_len + 1] = 1;
> > > +
> > > + error = goodix_send_cfg(ts, ts->cfg_len, config);
> > > + if (error)
> > > + dev_warn(&ts->client->dev,
> > > + "Error writing config (%d)\n", error);
> > > +}
> > > /**
> > > * goodix_read_config - Read the embedded configuration of the
> > > panel
> > > *
next prev parent reply other threads:[~2016-10-27 17:41 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-20 19:59 [PATCH 0/4] Input: goodix - Support dynamic reconfiguration Franklin S Cooper Jr
2016-10-20 19:59 ` Franklin S Cooper Jr
2016-10-20 19:59 ` [PATCH 1/4] Input: goodix - Restructure cfg checksum function Franklin S Cooper Jr
2016-10-20 19:59 ` Franklin S Cooper Jr
[not found] ` <20161020195917.20051-2-fcooper-l0cyMroinI0@public.gmane.org>
2016-10-27 10:32 ` Bastien Nocera
2016-10-27 10:32 ` Bastien Nocera
2016-10-20 19:59 ` [PATCH 2/4] Input: goodix - Allow tweaking of configuration file dynamically Franklin S Cooper Jr
2016-10-20 19:59 ` Franklin S Cooper Jr
2016-10-27 10:33 ` Bastien Nocera
[not found] ` <1477564424.2458.9.camel-0MeiytkfxGOsTnJN9+BGXg@public.gmane.org>
2016-10-27 16:58 ` Franklin S Cooper Jr
2016-10-27 16:58 ` Franklin S Cooper Jr
2016-10-27 17:41 ` Bastien Nocera [this message]
2016-10-20 19:59 ` [PATCH 3/4] Input: goodix - Tweak configuration to use passed in touchscreen resolution Franklin S Cooper Jr
2016-10-20 19:59 ` Franklin S Cooper Jr
2016-10-26 23:10 ` Rob Herring
[not found] ` <20161020195917.20051-4-fcooper-l0cyMroinI0@public.gmane.org>
2016-10-27 10:34 ` Bastien Nocera
2016-10-27 10:34 ` Bastien Nocera
[not found] ` <1477564458.2458.10.camel-0MeiytkfxGOsTnJN9+BGXg@public.gmane.org>
2016-10-27 17:03 ` Franklin S Cooper Jr
2016-10-27 17:03 ` Franklin S Cooper Jr
[not found] ` <20161020195917.20051-1-fcooper-l0cyMroinI0@public.gmane.org>
2016-10-20 19:59 ` [PATCH 4/4] Input: goodix - Support interchanging x and y coordinates in hardware Franklin S Cooper Jr
2016-10-20 19:59 ` Franklin S Cooper Jr
[not found] ` <20161020195917.20051-5-fcooper-l0cyMroinI0@public.gmane.org>
2016-10-26 23:18 ` Rob Herring
2016-10-26 23:18 ` Rob Herring
2016-10-27 10:34 ` Bastien Nocera
2016-10-27 17:42 ` Franklin S Cooper Jr
2016-10-27 17:42 ` Franklin S Cooper Jr
[not found] ` <317acd32-f363-3b2b-9e30-106d5b335342-l0cyMroinI0@public.gmane.org>
2016-10-28 0:08 ` Bastien Nocera
2016-10-28 0:08 ` Bastien Nocera
2016-10-27 17:54 ` Franklin S Cooper Jr
2016-10-27 17:54 ` Franklin S Cooper Jr
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=1477590083.18960.0.camel@hadess.net \
--to=hadess@hadess.net \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=fcooper@ti.com \
--cc=irina.tirdea@intel.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=merker@debian.org \
--cc=nm@ti.com \
--cc=nsekhar@ti.com \
--cc=octavian.purdila@intel.com \
--cc=robh+dt@kernel.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.