From patchwork Mon Jan 31 17:26:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 520401 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0VHPlPl019362 for ; Mon, 31 Jan 2011 17:26:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755508Ab1AaR0y (ORCPT ); Mon, 31 Jan 2011 12:26:54 -0500 Received: from mail-gx0-f174.google.com ([209.85.161.174]:56628 "EHLO mail-gx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752227Ab1AaR0x (ORCPT ); Mon, 31 Jan 2011 12:26:53 -0500 Received: by gxk9 with SMTP id 9so2087169gxk.19 for ; Mon, 31 Jan 2011 09:26:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=UXnNgex5EpTO3GX8Lcb1cOpBo2dm9Ht4IVMQBn0tsDw=; b=k5sve3/IImsZgbzSbx7/8EIlYhkGor685PcaS0Zj4B3oZd6008XOj5kLAm+Hcx0tjr YiZPbZQ/Ea4oflT+Ca4oS86dksdTrrQiHbvvLOH0d3rAR3aRBusc8ipRvf+CX1x9D8IK TlWSuOgCCY3NVqz3ymfXkvF05lpj9QNrgi/Ho= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=vyLdHsLBd4+KoW3Oz2qoouBTCHQmInwzL2t4/zhNntsyLjp2LP8XCDnfDT/wDwqkA4 Sqt3h5/O6+4xhRI28HmW6DuBbbxq5kFiESBrlNmL6QrCSL9j7x+pasDFbpCnE14Ped1M wVLs5q/X4pVIe4Dgyr1vZetb50LlA217nYvdQ= Received: by 10.100.3.12 with SMTP id 12mr4028448anc.233.1296494812409; Mon, 31 Jan 2011 09:26:52 -0800 (PST) Received: from mailhub.coreip.homeip.net (c-98-234-113-65.hsd1.ca.comcast.net [98.234.113.65]) by mx.google.com with ESMTPS id c7sm26137499ana.17.2011.01.31.09.26.47 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 31 Jan 2011 09:26:48 -0800 (PST) Date: Mon, 31 Jan 2011 09:26:44 -0800 From: Dmitry Torokhov To: Henrik Rydberg Cc: Ping Cheng , linux-input@vger.kernel.org, Ping Cheng Subject: Re: [PATCH v3] input : wacom_w8001 - report resolution to userland Message-ID: <20110131172643.GC31891@core.coreip.homeip.net> References: <1296283062-20469-1-git-send-email-pinglinux@gmail.com> <20110131115014.GA5576@polaris.bitmath.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110131115014.GA5576@polaris.bitmath.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 31 Jan 2011 17:26:54 +0000 (UTC) diff --git a/drivers/input/touchscreen/wacom_w8001.c b/drivers/input/touchscreen/wacom_w8001.c index 5cb8449..c14412e 100644 --- a/drivers/input/touchscreen/wacom_w8001.c +++ b/drivers/input/touchscreen/wacom_w8001.c @@ -51,6 +51,10 @@ MODULE_LICENSE("GPL"); #define W8001_PKTLEN_TPCCTL 11 /* control packet */ #define W8001_PKTLEN_TOUCH2FG 13 +/* resolution in points/mm */ +#define W8001_PEN_RESOLUTION 100 +#define W8001_TOUCH_RESOLUTION 10 + struct w8001_coord { u8 rdy; u8 tsw; @@ -198,7 +202,7 @@ static void parse_touchquery(u8 *data, struct w8001_touch_query *query) query->y = 1024; if (query->panel_res) query->x = query->y = (1 << query->panel_res); - query->panel_res = 10; + query->panel_res = W8001_TOUCH_RESOLUTION; } } @@ -394,6 +398,8 @@ static int w8001_setup(struct w8001 *w8001) input_set_abs_params(dev, ABS_X, 0, coord.x, 0, 0); input_set_abs_params(dev, ABS_Y, 0, coord.y, 0, 0); + input_abs_set_res(dev, ABS_X, W8001_PEN_RESOLUTION); + input_abs_set_res(dev, ABS_Y, W8001_PEN_RESOLUTION); input_set_abs_params(dev, ABS_PRESSURE, 0, coord.pen_pressure, 0, 0); if (coord.tilt_x && coord.tilt_y) { input_set_abs_params(dev, ABS_TILT_X, 0, coord.tilt_x, 0, 0); @@ -418,14 +424,17 @@ static int w8001_setup(struct w8001 *w8001) w8001->max_touch_x = touch.x; w8001->max_touch_y = touch.y; - /* scale to pen maximum */ if (w8001->max_pen_x && w8001->max_pen_y) { + /* if pen is supported scale to pen maximum */ touch.x = w8001->max_pen_x; touch.y = w8001->max_pen_y; + touch.panel_res = W8001_PEN_RESOLUTION; } input_set_abs_params(dev, ABS_X, 0, touch.x, 0, 0); input_set_abs_params(dev, ABS_Y, 0, touch.y, 0, 0); + input_abs_set_res(dev, ABS_X, touch.panel_res); + input_abs_set_res(dev, ABS_Y, touch.panel_res); switch (touch.sensor_id) { case 0: