Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp3936449imb; Wed, 6 Mar 2019 00:58:49 -0800 (PST) X-Google-Smtp-Source: APXvYqxBBY/tEKkCSYq+8Mf3agABtEZN8jpMAM4J03RcBLGXI/bEpnKkWt2EBieoV0/qKmHsqgZS X-Received: by 2002:a17:902:5e2:: with SMTP id f89mr761275plf.170.1551862729119; Wed, 06 Mar 2019 00:58:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551862729; cv=none; d=google.com; s=arc-20160816; b=FqYSe/MqmFm+TP0Q3iwScuDZ8W9JXGUURitbWR/Uc91fvQuarJFTz/NTRjj2lvdJMm b5pnLmEUVZBL+1nP/JBTL+eMHhtJkmnmjlw2g8IulbEu9Z6TbvUj5PVcIkU69PpS/gss QKmQH66L3zxD6e01j3TEWHRdsl9/7zakHyYcqnQm2iiZiXb5j1u0A+Qa1iBa/d5m9Um7 MqspeITgwHF/aVVg+sbCYNGQxUMTyhRW55jNoohIa25FE45RKMYxEvIU8MfLqIaclXdK 9DB3uKR10F6etbA4s7KIqNcVluPYQTPXR7EoWA9IGjj5+oIYDnZLPFd3tUT7Ai7ug0Uj LeOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=Jk6odKMg/O/nSsls4wjhQaV1/5sByi0cTfR8gR1keOk=; b=iKLWloqYplyhI68L2rC5TxjPowZVTT3vCWHu1NYNtSJ6ky07ergiM64fugn7Ce9A49 VlDPUcLlxD2NwZHAnIxjmkthZC5mhrmwmiu3+HzppqqR4+xqDhmLTeiPRZURQ6wUraUr dtDohP4tbMLKiUJDIkjTcgY/zdNuMxBSWKej3epnz0DC7l45F8ao4icfBDZKMs2GVrsY nzoyg4n4+nq2PxumRpsQ3EXaoRo3Lsun96sMaHLxBxVd9EmNN9mNhUMN0ZIM/m7jevA1 tSJfRckYA5xg2psX4htL67L7v9t0kQ95T9GHadb6u3h4smLHQ/foUaCcKZ9qfqRYnDE4 5Lkw== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o3si988021pgh.189.2019.03.06.00.58.34; Wed, 06 Mar 2019 00:58:49 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729360AbfCFIn2 (ORCPT + 99 others); Wed, 6 Mar 2019 03:43:28 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:44306 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728899AbfCFIn1 (ORCPT ); Wed, 6 Mar 2019 03:43:27 -0500 Received: by mail-ed1-f67.google.com with SMTP id b20so9589335edw.11 for ; Wed, 06 Mar 2019 00:43:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Jk6odKMg/O/nSsls4wjhQaV1/5sByi0cTfR8gR1keOk=; b=CWyI6ZXDKBOBA2zHQTpT9L7LQE6g1lRdKNIY8P+clsKG3xzd6gCfsq1M9ltleIHv5M R2cvMSCTXNUf+fiZPnHsCS5QDCoSOecnnc2Cl39tnF7SElpXSMnTQfrJtyw7Bb25viX6 H0hwU/L0zPY7ZzYMKkpUgSawkiUx+8tgWcHRK1/17nhVv1bn3QKH+Ma0jXWY4UGIy2Dd pkZupyYeF9hwPVZP2CexV02afXjGIE/KdlgWXf6+rPDmsezaRMF9BFe0xUQxY0GAkmsg VP42bEdBJ9+QCor1oSvlEU+DYuJcE01kQ56I332Xs4Nd/y/6km2pJVsE1E6M7BDOmUtl NF/g== X-Gm-Message-State: APjAAAXXpUflsSQHMj281b8Sn/lMMaOPSFhCTvi8Zl8ivDgpWfbi7hxV ITePnlpcZ3sPfPVF+r9LAiXkzOaXldY= X-Received: by 2002:a17:906:4347:: with SMTP id z7mr3164978ejm.190.1551861805562; Wed, 06 Mar 2019 00:43:25 -0800 (PST) Received: from shalem.localdomain (546A5441.cm-12-3b.dynamic.ziggo.nl. [84.106.84.65]) by smtp.gmail.com with ESMTPSA id t25sm279483eda.69.2019.03.06.00.43.24 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Wed, 06 Mar 2019 00:43:24 -0800 (PST) Subject: Re: [PATCH v3] io: accel: kxcjk1013: restore the range after resume. To: "Chen, Hu" Cc: bo.he@intel.com, Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Stephan Gerhold , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org References: <23ced5ac-b0a0-7d87-76d7-bdec0c3e0e15@redhat.com> <20190306023224.23695-1-hu1.chen@intel.com> From: Hans de Goede Message-ID: Date: Wed, 6 Mar 2019 09:43:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190306023224.23695-1-hu1.chen@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 06-03-19 03:32, Chen, Hu wrote: > From: "he, bo" > > On some laptops, kxcjk1013 is powered off when system enters S3. We need > restore the range regiter during resume. Otherwise, the sensor doesn't > work properly after S3. > > Signed-off-by: he, bo > Signed-off-by: Chen, Hu Thanks, patch looks good to me: Reviewed-by: Hans de Goede Regards, Hans > --- > v3: Avoid unnecessary mutex_unlock (Hans). > v2: Handle return value independently (Jonathan). > > drivers/iio/accel/kxcjk-1013.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c > index 7096e577b23f..50f3ff386bea 100644 > --- a/drivers/iio/accel/kxcjk-1013.c > +++ b/drivers/iio/accel/kxcjk-1013.c > @@ -1437,6 +1437,8 @@ static int kxcjk1013_resume(struct device *dev) > > mutex_lock(&data->mutex); > ret = kxcjk1013_set_mode(data, OPERATION); > + if (ret == 0) > + ret = kxcjk1013_set_range(data, data->range); > mutex_unlock(&data->mutex); > > return ret; >