Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp59993imp; Wed, 20 Feb 2019 19:14:35 -0800 (PST) X-Google-Smtp-Source: AHgI3IadA5myhuCcAHKydGrawF5/+5dGwYnzj+vLbP03qUT4LHXCDWpoVkP4WG+uxEd+XXLfJbXP X-Received: by 2002:a63:cc4e:: with SMTP id q14mr35881656pgi.291.1550718875833; Wed, 20 Feb 2019 19:14:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550718875; cv=none; d=google.com; s=arc-20160816; b=RcFA3tRz89ul68UnPWTHhWHs7f7X5Amg5YiMgw+DXH/USlY4frxSMc/GZoCByh7ffv cOkjze60qzL5T2XDk7e8FJ+3ymG/lvxbmx09/pIXhD7gMH9g33F+o4oQSB4N6SSErPh+ JnTzqG7BPYJnP0vzL/VZ76ujdmQMmk5ZCWrJ2nv2+gQgeOKZ3Bjbn+Klz/ZmZVTBcN+0 YeU0Azt59XYG3YWmz5dBoV+e7v/9OX0ZVpyKhBTXbvbl9SQsjHSZe0og9kC/cDcBQ+xw 98//nOMMqqnv3jvfjK5ewi8Dz2obuU64EpBBToqIc51lL/OymRtU5GLJTSL0GtxPVHwe wbeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:message-id:date:thread-index:thread-topic:subject :to:from; bh=m5x9p+ti2VlKqaWcXxrmu9uAm8wz2YrhSnJ8ZadwWFA=; b=S2X2B/GW2mqVqr2wZ0yDsVjGgyHcIsXNDopPNQwaD6myFT3H5zB2F7e3pE6JsH2SzM 0leOJDE8V2cmNphpgrrgFxCur4JZuF9D+M1yMPWlPLLzanvbuWD6w4arasjtcsgymL4i 6dhtDDwM3heqITh4im0wcu6pgSQX76BRSlB7HcEyxEgyGsRdqLrmNilPHm3X4uNTQlEQ bDvaU9IMEMkHTngXxd8sCTukCA0DTCvoH92gfKZjTzvg2d0Yobaz/DmkxXCv92F5weQ8 6kDcviykQk1B7rWTgQ6igKdUKIZh3fVdn7DyxD0ocv6hk98cFp9rjCmbfzJujF/9U3Qd SPQw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z33si21528657plb.415.2019.02.20.19.14.11; Wed, 20 Feb 2019 19:14:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726980AbfBUDNs convert rfc822-to-8bit (ORCPT + 99 others); Wed, 20 Feb 2019 22:13:48 -0500 Received: from mga02.intel.com ([134.134.136.20]:22077 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725989AbfBUDNs (ORCPT ); Wed, 20 Feb 2019 22:13:48 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Feb 2019 19:13:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,393,1544515200"; d="scan'208";a="124040098" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga007.fm.intel.com with ESMTP; 20 Feb 2019 19:13:47 -0800 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 20 Feb 2019 19:13:46 -0800 Received: from shsmsx105.ccr.corp.intel.com (10.239.4.158) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 20 Feb 2019 19:13:46 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.102]) by SHSMSX105.ccr.corp.intel.com ([169.254.11.253]) with mapi id 14.03.0415.000; Thu, 21 Feb 2019 11:13:44 +0800 From: "He, Bo" To: "linux-kernel@vger.kernel.org" , "linux-iio@vger.kernel.org" , "ic23@kernel.org" , "knaack.h@gmx.de" , "lars@metafoo.de" , "pmeerw@pmeerw.net" , "Chen, Hu1" Subject: [PATCH] io: accel: kxcjk1013: restore the range after resume. Thread-Topic: [PATCH] io: accel: kxcjk1013: restore the range after resume. Thread-Index: AdTJklHsGhceer30SUizI4A3viRlAQ== Date: Thu, 21 Feb 2019 03:13:44 +0000 Message-ID: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiN2ZiMzNmMTAtNmNkNS00ZGU3LWE2NTAtZjhkYjNiYjVjMWUyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiaHZEaktHTFlYY2tSUlZJK29cL1NKSmt1SFFiRUdFMzdvTVJucktmQ2tQSDRyQ3VMZFY0eUJaeFpEK01iZFhXQncifQ== dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org restore the range register in case kxcjk1013 power is off after suspend we see the issue on some laptops, after system suspend and resume, the CTRL_REG1 register changed from 0xc8 to 0x80, so acceleration range is changed, the patch is to restore the acceleration range after resume. Signed-off-by: he, bo Signed-off-by: Chen, Hu --- drivers/iio/accel/kxcjk-1013.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c index 7506bd9..c6bb3be 100644 --- a/drivers/iio/accel/kxcjk-1013.c +++ b/drivers/iio/accel/kxcjk-1013.c @@ -1340,6 +1340,7 @@ static int kxcjk1013_resume(struct device *dev) mutex_lock(&data->mutex); ret = kxcjk1013_set_mode(data, OPERATION); + ret += kxcjk1013_set_range(data, data->range); mutex_unlock(&data->mutex); return ret; -- 2.7.4