From patchwork Wed Apr 15 23:54:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping Cheng X-Patchwork-Id: 6223451 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EDEF49F2EC for ; Wed, 15 Apr 2015 23:54:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 235022034B for ; Wed, 15 Apr 2015 23:54:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 388FD202FF for ; Wed, 15 Apr 2015 23:54:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756210AbbDOXyS (ORCPT ); Wed, 15 Apr 2015 19:54:18 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:36736 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755719AbbDOXyS (ORCPT ); Wed, 15 Apr 2015 19:54:18 -0400 Received: by pabsx10 with SMTP id sx10so67976462pab.3 for ; Wed, 15 Apr 2015 16:54:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=/CLWIc/o4LLvL8sxvcAJPF4sSSbHKliQ+76OYDy7dEE=; b=C0bv3pA/qguU4rhRSvIHp2tu0aVHNJ4/dFWlaSj5lUVzWhV5rsJ3WSdRLDYJP+Vs9S LVKaGrFK1QcDUZL8beOHfOXYaYcnRreQinQSnUDgXqsHbAs+pqU6+cEOTd3IsDgt/lSj +PUwPYtQlsjRr/EUgqDoXFLAVwuk9hO33CESVUUhkidpxTbWAkM1o5IsH/EUiu+vEs7T 258a08cGO+1XL/f0asWl7npuL2B/TcYEsQnAwtXqqwc+3LVyqAoMSrhTE65oSfLXIeJV oao4u3SKEbWGAHNHdTLY/xP36uSMX5+pWAl0dkAt2XprodpkjfiDEw5wYVMGHl/7M9Im zrPA== X-Received: by 10.66.129.174 with SMTP id nx14mr50383140pab.12.1429142057738; Wed, 15 Apr 2015 16:54:17 -0700 (PDT) Received: from wacom-XPS-8500.wacom.com ([67.51.163.2]) by mx.google.com with ESMTPSA id gm3sm5146435pbb.83.2015.04.15.16.54.17 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 15 Apr 2015 16:54:17 -0700 (PDT) From: Ping Cheng X-Google-Original-From: Ping Cheng To: jkosina@suse.cz Cc: linux-input@vger.kernel.org, Ping Cheng Subject: [PATCH 3/4] HID: wacom: move unit and unitExpo initialization to wacom_calculate_res Date: Wed, 15 Apr 2015 16:54:14 -0700 Message-Id: <1429142054-16871-1-git-send-email-pingc@wacom.com> X-Mailer: git-send-email 1.9.1 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP That is where they belong... Signed-off-by: Ping Cheng --- drivers/hid/wacom_sys.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index ca30eab..855f3b3 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c @@ -1365,6 +1365,12 @@ static void wacom_set_default_phy(struct wacom_features *features) static void wacom_calculate_res(struct wacom_features *features) { + /* set unit to "100th of a mm" for devices not reported by HID */ + if (!features->unit) { + features->unit = 0x11; + features->unitExpo = -3; + } + features->x_resolution = wacom_calc_hid_res(features->x_max, features->x_phy, features->unit, @@ -1505,16 +1511,8 @@ static int wacom_probe(struct hid_device *hdev, wacom_retrieve_hid_descriptor(hdev, features); wacom_setup_device_quirks(wacom); - - /* set unit to "100th of a mm" for devices not reported by HID */ - if (!features->unit) { - features->unit = 0x11; - features->unitExpo = -3; - } wacom_calculate_res(features); - wacom_update_name(wacom); - error = wacom_add_shared_data(hdev); if (error) goto fail_shared_data;