All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Leech <christopher.leech@linux.intel.com>
To: Joonyoung Shim <jy0922.shim@samsung.com>
Cc: linux-input@vger.kernel.org
Subject: Re: [PATCH 3/5] qt602240_ts: Trust factory configuration of touchscreen.
Date: Thu, 18 Nov 2010 11:41:12 -0800	[thread overview]
Message-ID: <20101118194112.GF1273@cleech-lnx.jf.intel.com> (raw)
In-Reply-To: <4CE5258F.4030507@samsung.com>

On Thu, Nov 18, 2010 at 10:09:35PM +0900, Joonyoung Shim wrote:
> Hi, Chris.
> On 2010-11-17 오전 5:42, Chris Leech wrote:

>> +static void qt602240_read_config(struct qt602240_data *data)
>> +{
>> +	struct qt602240_platform_data *pdata = data->pdata;
>> +	u8 val;
>> +	u8 high, low;
>> +
>> +	/* touchscreen lines */
>> +	qt602240_read_object(data, QT602240_TOUCH_MULTI, QT602240_TOUCH_XSIZE,
>> +			&val);
>> +		pdata->x_line = val;
>> +	qt602240_read_object(data, QT602240_TOUCH_MULTI, QT602240_TOUCH_YSIZE,
>> +			&val);
>> +		pdata->x_line = val;
>> +
>> +	/* touchscreen orient */
>> +	qt602240_read_object(data, QT602240_TOUCH_MULTI, QT602240_TOUCH_ORIENT,
>> +			&val);
>> +		pdata->orient = val;
>> +
>> +	/* touchscreen burst length */
>> +	qt602240_read_object(data, QT602240_TOUCH_MULTI, QT602240_TOUCH_BLEN,
>> +			&val);
>> +		pdata->blen = val;
>> +
>> +	/* touchscreen threshold */
>> +	qt602240_read_object(data, QT602240_TOUCH_MULTI, QT602240_TOUCH_TCHTHR,
>> +			&val);
>> +		pdata->threshold = val;
>> +
>> +	/* touchscreen resolution */
>> +	qt602240_read_object(data, QT602240_TOUCH_MULTI,
>> +			QT602240_TOUCH_XRANGE_LSB,&low);
>> +	qt602240_read_object(data, QT602240_TOUCH_MULTI,
>> +			QT602240_TOUCH_XRANGE_MSB,&high);
>> +	pdata->x_size = (high<<  8) | (low + 1);
>> +	qt602240_read_object(data, QT602240_TOUCH_MULTI,
>> +			QT602240_TOUCH_YRANGE_LSB,&low);
>> +	qt602240_read_object(data, QT602240_TOUCH_MULTI,
>> +			QT602240_TOUCH_YRANGE_MSB,&high);
>> +	pdata->y_size = (high<<  8) | (low + 1);
>> +}
>> +
>
> Please don't modify pdata, the pdata means platform specific data from
> machine file. The pdata of struct qt602240_data be used only in
> qt602240_initialize function when driver is probed, so we need to
> remove pdata from struct qt602240_data.

OK. If I add the relevant fields to qt602240_data, and either copy over
from pdata or read from the hardware configuration based on trust_nvm,
does that approach seem acceptable to you?

>> +	/*
>> +	 * Bit 0 of TOUCH_ORIENT is the X/Y swap configuration.
>> +	 * If the axises are swapped the reporting will change, and in order to
>> +	 * get the scaling correct we need to swap the maximum range values
>> +	 * reported to the input layer.
>> +	 */
>> +	if (data->pdata->orient&  1) {
>> +		x_size = data->pdata->y_size;
>> +		y_size = data->pdata->x_size;
>> +	} else {
>> +		x_size = data->pdata->x_size;
>> +		y_size = data->pdata->y_size;
>> +	}
>> +
>> +	/* For single touch */
>> +	input_set_abs_params(input_dev, ABS_X, 0, x_size, 0, 0);
>> +	input_set_abs_params(input_dev, ABS_Y, 0, y_size, 0, 0);
>> +
>> +	/* For multi touch */
>> +	input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0,
>> +			QT602240_MAX_AREA, 0, 0);
>> +	input_set_abs_params(input_dev, ABS_MT_POSITION_X, 0, x_size, 0, 0);
>> +	input_set_abs_params(input_dev, ABS_MT_POSITION_Y, 0, y_size, 0, 0);
>> +
>
> I'm not sure but i know this max is maximum value to be supported by
> touch chip.

I think the maxtouch scales it's output based on the TOUCH_XRANGE and
TOUCH_YRANGE configuration, so there should be the maximum values that
will ever be reported.

I can test this again, but if these values are wrong I get messed up
scaling when they events are translated to windowing coordinates.

- Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2010-11-18 19:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-16 20:41 [PATCH 0/4] qt602240_ts changes for Intel mid platform Chris Leech
2010-11-16 20:41 ` [PATCH 1/5] qt602240_ts: fix wrong sizeof in object table allocation Chris Leech
2010-11-18 11:16   ` Joonyoung Shim
2010-11-18 11:30     ` Joonyoung Shim
2010-11-16 20:41 ` [PATCH 2/5] qt602240_ts: move clearing of pending interrupt closer to request_threaded_irq Chris Leech
2010-11-18 12:53   ` Joonyoung Shim
2010-11-18 19:29     ` Chris Leech
2010-11-18 22:54       ` Dmitry Torokhov
2010-11-16 20:42 ` [PATCH 3/5] qt602240_ts: Trust factory configuration of touchscreen Chris Leech
2010-11-18 13:09   ` Joonyoung Shim
2010-11-18 19:41     ` Chris Leech [this message]
2010-11-16 20:42 ` [PATCH 4/5] qt602240_ts: add optional hooks for board specific reset logic Chris Leech
2010-11-18 11:32   ` Joonyoung Shim
2010-11-18 19:46     ` Chris Leech
2010-11-16 20:42 ` [PATCH 5/5] qt602240_ts: add mXT224 identifier to id_table, to match Intel mid firmware identifier Chris Leech
2010-11-18 11:34   ` Joonyoung Shim

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=20101118194112.GF1273@cleech-lnx.jf.intel.com \
    --to=christopher.leech@linux.intel.com \
    --cc=jy0922.shim@samsung.com \
    --cc=linux-input@vger.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.