Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1954104imw; Tue, 5 Jul 2022 19:33:18 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tU7MM9uvgJNNs0sOTx3EnuQS5SiGXXkvw27uxnretbgfAsnairm/psQ5YjynBSwKvWG0ow X-Received: by 2002:a17:906:8447:b0:72a:f120:50cd with SMTP id e7-20020a170906844700b0072af12050cdmr3017154ejy.114.1657074798523; Tue, 05 Jul 2022 19:33:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657074798; cv=none; d=google.com; s=arc-20160816; b=afNkpBjnI81S8M8/mJIKkuWaDQNLHFgtNtu7joA/EdbFeqmRja03a79Kp/HtQ/8UjU UOK8ovhPqmzEUy6R7zUxDpxzF1hX3eiw/yk4UY8uKcgBCqpyyJbuhHR9GPN+wbTYMPPd JCGfOI4HhT+WyoxDcfBd7eMUbazeBYxMi19gnwhF6GmcfsgnVZEdWB4xPn6POZqcRfNz NYILNO1k1Pub/zInxp24NrEDCH7QTKeA13q1I54u7Mc+xJ7C0drJZn4zgRp+mUykYOqA MvYocDJm7SFl/CExTaCBtzVivSyHWd0sByoONHpfrRebI4+FciUXRYTi7GJfd3/PSYkG kliA== 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=jnmb0zpL4NW6n76DYnJeaBav9/Yc3ZJVxQW1CIFh74k=; b=C9H1smcnmy34Cj71EEHILfVqnvWF8BjaQFIJzKeFnnMFasENYWNq2lJFrFHbvVbV0X ndeqlNf23uqXsxhoqdfdiCyyqEvDQ+LraDzPc7FKXTYYH5KeJzChE805ZL2ZpenZJrZr ymJnqlWVFovbvbzhD2h02+yn0um50+1uaqUowpFyzsP6ddieTWYLcxgE627cjrRepMsg nt6s4I0+AExdj/upHc//XrQbMkpNmnatkU7P9CilrPa8LQ3rFTpgA5yhIqfN0/4sCbo7 JhspH+pw16Q8IU5Fbm+EK5Wkqtx/RUgmFuWrnusk8i7sguVj99Q4+vM4M75DGzWUa2TZ snKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b="aAAuVX/k"; 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=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq40-20020a1709073f2800b007269d1e0b96si38467411ejc.918.2022.07.05.19.32.53; Tue, 05 Jul 2022 19:33:18 -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=@canonical.com header.s=20210705 header.b="aAAuVX/k"; 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=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229754AbiGFCCQ (ORCPT + 99 others); Tue, 5 Jul 2022 22:02:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbiGFCCN (ORCPT ); Tue, 5 Jul 2022 22:02:13 -0400 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98B04193C6 for ; Tue, 5 Jul 2022 19:02:12 -0700 (PDT) Received: from mail-oa1-f72.google.com (mail-oa1-f72.google.com [209.85.160.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 090663F170 for ; Wed, 6 Jul 2022 02:02:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1657072931; bh=jnmb0zpL4NW6n76DYnJeaBav9/Yc3ZJVxQW1CIFh74k=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=aAAuVX/kiFDl53SaM81pUxOzhIl7Ri7lAp1oo9MlN1LR9ttmDic/nUZr+mP7/LMRu KPCvcAG2C+zYUtizGM/uzE8dld0vnlIbb60grK7jI+xlMTLeyAHhml1r0CBmP58bM8 plTNuVvHnq94tSOJAMGll7697A+OYFb3nVgUws4y0VyBTMxI9w0wk1nJlhJy7XioIY 7MelqF+iOeDmoVrKdsCPcKoCzKPJ9KqBUf6zX2KIuIz5N+IJGfMjDBdlgl1yWrjeBd 9f2rMEPuSVZtkWjV3CAyVrRh2E7yItuBYvLMBe+9l5f0w8OA9WcUABUyROHqpRX75H f/HoVZ26nI2Iw== Received: by mail-oa1-f72.google.com with SMTP id 586e51a60fabf-101dcba4a0aso9515352fac.14 for ; Tue, 05 Jul 2022 19:02:10 -0700 (PDT) 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=jnmb0zpL4NW6n76DYnJeaBav9/Yc3ZJVxQW1CIFh74k=; b=5T/2e1YaD/BhyCgduzzmwsBPMDAN5mZvM+j+1wZQ1mRR2aqezoLSUrLB7BGZbnbUgd EzolJJqgfJbAsuVljoeCzPlBnmLXa8OFQ5Xya63I8EtGpTyYBEuNovY8Mu5txo0zZT5L gisvRDlc+FOpc0UQhxIKijArIalDP0c7OIFOltQy5wEMqX3lyJa2826maUhGCWLskVnT BElhKGc5QmdCPYNA9gv1cr+5MoTI4uvqoL38bC4pnWeL6uy5MSmntji8vqzGnXN39ig7 oafM7gMeWAB0RgW2OPdWW/sPDXV7UmoJ1jjiGq9LIeU0/9HDHQoDzOIbaj2MjdAKKweu mOHw== X-Gm-Message-State: AJIora/osTsfvyR5zIA7Ex/AcsZLJR/YsjVEkaycnHlPMiDwUITdPl54 CwzZv6Kw4EJ+gB9+CoxO+pfUMcoD32lq8I7CzzJC695zbYcDXKAYTc5IJQ66ll0ndBah3GOqGGT S3okmS8WW827deulmKLc0WHzd+K+K8vmGZTc42FiOslblMavBt5kHowMeXA== X-Received: by 2002:a05:6808:1805:b0:335:8dcd:5d95 with SMTP id bh5-20020a056808180500b003358dcd5d95mr21886988oib.176.1657072929956; Tue, 05 Jul 2022 19:02:09 -0700 (PDT) X-Received: by 2002:a05:6808:1805:b0:335:8dcd:5d95 with SMTP id bh5-20020a056808180500b003358dcd5d95mr21886969oib.176.1657072929635; Tue, 05 Jul 2022 19:02:09 -0700 (PDT) MIME-Version: 1.0 References: <20220705121756.41660-1-kai.heng.feng@canonical.com> In-Reply-To: From: Kai-Heng Feng Date: Wed, 6 Jul 2022 10:01:57 +0800 Message-ID: Subject: Re: [PATCH] iio: light: cm32181: Add PM support To: Andy Shevchenko 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=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 Wed, Jul 6, 2022 at 3:12 AM Andy Shevchenko wrote: > > 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) ? iio_priv() is still needed to get the struct priv. Kai-Heng > > > + return i2c_smbus_write_word_data(client, CM32181_REG_ADDR_CMD, > > + cm32181->conf_regs[CM32181_REG_ADDR_CMD]); > > +} > > -- > With Best Regards, > Andy Shevchenko