Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1510255

Re: [PATCH 2/4] Input: goodix - Allow tweaking of configuration file dynamically

From Bastien Nocera <hadess@hadess.net>
Newsgroups linux.kernel
Subject Re: [PATCH 2/4] Input: goodix - Allow tweaking of configuration file dynamically
Date 2016-10-27 16:30 +0200
Message-ID <swTQR-355-1@gated-at.bofh.it> (permalink)
References <surP3-3PX-11@gated-at.bofh.it> <surP3-3PX-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] Input: goodix - Support dynamic reconfiguration Franklin S Cooper Jr <fcooper@ti.com> - 2016-10-20 22:10 +0200
  [PATCH 3/4] Input: goodix - Tweak configuration to use passed in touchscreen resolution Franklin S Cooper Jr <fcooper@ti.com> - 2016-10-20 22:10 +0200
    Re: [PATCH 3/4] Input: goodix - Tweak configuration to use passed in  touchscreen resolution Rob Herring <robh@kernel.org> - 2016-10-27 01:20 +0200
    Re: [PATCH 3/4] Input: goodix - Tweak configuration to use passed  in touchscreen resolution Bastien Nocera <hadess@hadess.net> - 2016-10-27 16:20 +0200
      Re: [PATCH 3/4] Input: goodix - Tweak configuration to use passed in  touchscreen resolution Franklin S Cooper Jr <fcooper@ti.com> - 2016-10-27 19:10 +0200
  [PATCH 4/4] Input: goodix - Support interchanging x and y coordinates in hardware Franklin S Cooper Jr <fcooper@ti.com> - 2016-10-20 22:10 +0200
    Re: [PATCH 4/4] Input: goodix - Support interchanging x and y  coordinates in hardware Rob Herring <robh@kernel.org> - 2016-10-27 01:20 +0200
      Re: [PATCH 4/4] Input: goodix - Support interchanging x and y  coordinates in hardware Bastien Nocera <hadess@hadess.net> - 2016-10-27 16:30 +0200
        Re: [PATCH 4/4] Input: goodix - Support interchanging x and y  coordinates in hardware Franklin S Cooper Jr <fcooper@ti.com> - 2016-10-27 19:50 +0200
          Re: [PATCH 4/4] Input: goodix - Support interchanging x and y  coordinates in hardware Bastien Nocera <hadess@hadess.net> - 2016-10-28 02:10 +0200
      Re: [PATCH 4/4] Input: goodix - Support interchanging x and y  coordinates in hardware Franklin S Cooper Jr <fcooper@ti.com> - 2016-10-27 20:00 +0200
  [PATCH 2/4] Input: goodix - Allow tweaking of configuration file dynamically Franklin S Cooper Jr <fcooper@ti.com> - 2016-10-20 22:10 +0200
    Re: [PATCH 2/4] Input: goodix - Allow tweaking of configuration  file dynamically Bastien Nocera <hadess@hadess.net> - 2016-10-27 16:30 +0200
      Re: [PATCH 2/4] Input: goodix - Allow tweaking of configuration file  dynamically Franklin S Cooper Jr <fcooper@ti.com> - 2016-10-27 19:00 +0200
        Re: [PATCH 2/4] Input: goodix - Allow tweaking of configuration  file dynamically Bastien Nocera <hadess@hadess.net> - 2016-10-27 19:50 +0200

csiph-web