On Mon, Jan 24, 2011 at 10:36 AM, Dmitry Torokhov
[off-list ref] wrote:
On Mon, Jan 24, 2011 at 10:18:54AM -0800, Ping Cheng wrote:
quoted
On Mon, Jan 24, 2011 at 6:40 AM, Henrik Rydberg [off-list ref] wrote:
quoted
Hi Ping,
quoted
@@ -1228,8 +1228,13 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
case TABLETPC:
if (features->device_type == BTN_TOOL_DOUBLETAP ||
features->device_type == BTN_TOOL_TRIPLETAP) {
- input_set_abs_params(input_dev, ABS_RX, 0, features->x_phy, 0, 0);
- input_set_abs_params(input_dev, ABS_RY, 0, features->y_phy, 0, 0);
+ /* set touch resolution in points/mm */
+ res = features->x_phy/100;
+ input_abs_set_res(input_dev, ABS_X,
+ features->x_max/res);
It seems to me the construction above looses precision twice for no
apparent reason.
Well, there was a reason (logically instead of mathematically though):
features->x_phy/100 gives us the physical size of the touch area in
mm.
quoted
How about instead use "100 * features->x_max /
features->x_phy"?
Sure.
quoted
Besides, it is a bit unfortunate that "res" is short
for both result and resolution.
Resolution is defined as __s32 in input_absinfo. How about we use __s32 then?
input_abs_set_res() takes and int argument so keep it int (or just
embed the expression into the call and forgo 'res').
I added 'res' to avoid confusion hence questions about the formula. I
am still questioned ;).
I'll forgo 'res' in v2. Thank you for the suggestions.
Ping
--
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