Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1635725imw; Tue, 5 Jul 2022 12:48:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uhTiqtSfiXIMg5WN3iGr9tqk1PsZu7tetv5nQj72CAov/UTB6sn67jFDCAQBCSO7nDcUn5 X-Received: by 2002:a05:6402:350f:b0:437:6618:174a with SMTP id b15-20020a056402350f00b004376618174amr48928236edd.329.1657050517215; Tue, 05 Jul 2022 12:48:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657050517; cv=none; d=google.com; s=arc-20160816; b=AMty6Kwxkh2tzSKGf1w9dgnN+pB8bzzPlVwy7a5OwnprUn3gZGgbxFGGkdwRvR1WI1 2qn30tRGf3iwNnPEbKfJiyzFuKz1+ETr5fRrHtqyWPm1t3KncvhWeTerxLYiHEbHQFiE WTnLMTaPeKE4Ppw8ZTem2jOkXKqhJxUk6URoYccwGflezeU2wpp/YE8903nGo2WFyTWP UYx4GAKBuyuFaWv8D2KMsyjIBJtBm2u2aicUO+nLpdUAzUu3gGobe3Xg8B9pkUXUyL67 13DS70FzLidxkRo4wTwHMVutUeyJBITYp2XQE+gDnJBHnU3S8BoeUrLh/ThjitJWQxhb gcaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=57cUWhF9VaqTVA1734zTG0eBBoeZZWbpzvCVHxEeHsg=; b=NkqwdKnKIzXE81KFybNV+y3tHKUWgfHWklrxK0QDdXwwcACDIgTyCCDPfPHHF80zYr qiZ10H+R9mz+2IWh91Cu1ngfQm5awFgtN46+6RQun8I9xHVCc5XfqgwGQNYAQEjHOdYf nbBwQYnPDHSmW+8Yte40Nk9IiZsqm7VwE2IUMUIrKeUVgZ3SniUFDS8lXglbXBSEOCIH vilk1PWH/HFEVilBruj7s8o4uve7vkXLW5EY6UuSmyeIScoYZEtd6Of8pXB7A23XdbNi 3ioAWndIjHYO9oRCYQOfCjhdjgUvGCNA+zbGYpdSF4GAyuEbtf6WUrcb1D8FdxlUuQMn /LFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qgYeHABw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dt20-20020a170907729400b00726be0cb176si25751474ejc.837.2022.07.05.12.48.12; Tue, 05 Jul 2022 12:48:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qgYeHABw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233387AbiGETMz (ORCPT + 99 others); Tue, 5 Jul 2022 15:12:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233779AbiGETMm (ORCPT ); Tue, 5 Jul 2022 15:12:42 -0400 Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC74020F7A; Tue, 5 Jul 2022 12:12:40 -0700 (PDT) Received: by mail-yb1-xb36.google.com with SMTP id b85so10300327yba.8; Tue, 05 Jul 2022 12:12:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=57cUWhF9VaqTVA1734zTG0eBBoeZZWbpzvCVHxEeHsg=; b=qgYeHABwiqO25p0BTSmbVdaFuDZo3wWingdIK42NsVZRRyHfNRojZ3lSIqIJsFP7ek QsWwbk8Gw2jxnfZru1Xj2c7TcsWbocfl2KRRwkSFwNSVHzz+n95ww4s47QLs2/pS8pEK RLIH1iTTayK8I3DKHsSBGDixxFxRp9AtoRHfMMbdVrUhcFkYuKd+IWD/psYCMQ/1ehuW QrynLtYB7hEqCmb3YkMIY7BLavlgiSPOuWS1/ay4CDuNJBCfTrnYDP5qwg9LxAyATVtT GQn5bmpZd4Fndt6IlqlGIAnyYzWrS5AiVN5zXHT4M16sbZBVZlvZ8/Z0YXYeMO5Lm+nP GT/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=57cUWhF9VaqTVA1734zTG0eBBoeZZWbpzvCVHxEeHsg=; b=khhO/7yvkGtqesVBw5y548XOonp7iZHESUV8uItp8FNNjY/yODHOzFCFr7QayvYYbZ wl3XlwCIldfo/flT4khahohlEY+QYpNtzDCFswaxCosvlNpr+o2MSM0/RmEW8CVw7KGO Rv/IPwGDOM2eM2KxJiRQ701W4wmJZ5mYp8v/rL5B8CnLym7tYD+qBIOWzHvYAtJz0Ns/ pVwe6YUZsW/BbO7VLQVJgnOPREPINMHvymjmFUr3RnIY91OlLBYnxN/vtzl7AVgZk+B2 GT/lAg2eGdKakqjKNTGok3JktUGJ4vbsB78QTNZ0NwmfdnXnQdy6U5tyKD4vd6P0/+m+ k9pw== X-Gm-Message-State: AJIora8bT35PKmd8ygpmVUNQ9f3XtSJh1yXjDV0B2vTRO9JM8Y88T5ZU lafUxUVLOLidfOG6iSNZaDtt5YLMFZ9aUImgr7mQqlkfTtz4yA== X-Received: by 2002:a25:cbcf:0:b0:66e:8893:a02c with SMTP id b198-20020a25cbcf000000b0066e8893a02cmr2851299ybg.460.1657048359433; Tue, 05 Jul 2022 12:12:39 -0700 (PDT) MIME-Version: 1.0 References: <20220705121756.41660-1-kai.heng.feng@canonical.com> In-Reply-To: <20220705121756.41660-1-kai.heng.feng@canonical.com> From: Andy Shevchenko Date: Tue, 5 Jul 2022 21:12:03 +0200 Message-ID: Subject: Re: [PATCH] iio: light: cm32181: Add PM support To: Kai-Heng Feng Cc: Kevin Tsai , Jonathan Cameron , Lars-Peter Clausen , Hans de Goede , linux-iio , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 5, 2022 at 2:31 PM Kai-Heng Feng wrote: > > The read on in_illuminance_input keeps at 0 after system sleep. > > So add proper suspend and resume callback to make the sensor keep > working after system sleep. ... > +static int cm32181_resume(struct device *dev) > +{ > + struct i2c_client *client = to_i2c_client(dev); > + struct cm32181_chip *cm32181 = iio_priv(i2c_get_clientdata(client)); Simply device_get_drvdata(dev) ? > + return i2c_smbus_write_word_data(client, CM32181_REG_ADDR_CMD, > + cm32181->conf_regs[CM32181_REG_ADDR_CMD]); > +} -- With Best Regards, Andy Shevchenko