From patchwork Tue Nov 20 10:12:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrice Gasnier X-Patchwork-Id: 10690837 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AB45713BF for ; Tue, 20 Nov 2018 16:52:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 984612AC39 for ; Tue, 20 Nov 2018 16:52:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C2A02AC6A; Tue, 20 Nov 2018 16:52:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 45F702AC55 for ; Tue, 20 Nov 2018 16:52:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=+M8hUSdKolkP+ORJB+j/AULoRdzDYNTxm6a8De5pdmw=; b=TlXz3E3Qf0ve6M 1nuIDVVh7Vqu1ps7oCkw6ViE+e9frU090g82sEVua6w3eFJSptjsJ1GGDXOkW+CdsHbEiT3QuLyQM o8McVq6/AIgoet7tfL0ctHp6024szFRKaC3h+OeWNGhVm9CBK4Piz4NguvKEeJ2HFs2V6NScJbsQ8 lLgHw1FE8fUtJ7uOLW/eGTlL4Itgt4Eu2c6b9nn3dPrcZyTtcWycHZuYFJDp0Q22rq3V+L083YKna 2zr7HaelYqrAfjvg+pvD3Okgj7KO8Jp9XwJe6dgE9DbcsT+KtIf9NId39JUntTrriKz5WOnVDkjgv 77UYZFQVjENvWiUhHY7g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gP9Fj-0005HV-OL; Tue, 20 Nov 2018 16:51:55 +0000 Received: from merlin.infradead.org ([205.233.59.134]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gP8Gi-0003nl-Ul for linux-arm-kernel@bombadil.infradead.org; Tue, 20 Nov 2018 15:48:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Type:MIME-Version:Message-ID: Date:Subject:CC:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=LZYWIZ73Zd9CHwZMPGvrrnMNZUc0hGiO2+8ujTrYztI=; b=k1BiGD7UNq5thrlLI47lqsheBr C+81sI0YS8nFPlbM9nm9Wz7PsrfDFan/DTXd70xtrhfeSmAAQrvCE09249W47ZTz1u1lfBddwl2+e udXRdk/OaN36z/BXfDEaLutFMZHVanddqpNrln9tf8U2meisyCP2MAkR9PZ9d+5LBkP4XN43tNJn/ g1k8y0mU5XBaD7G7FZbqct9pjNDLRwltnNdS26xdQNnTadXMBANy9q3bNkQmrWSu3P16+jYsBQUw7 atNdm71t67AeBDeRy6+WsC7j/OSTzydSuZyEAAilgrZmV+zHspZZ6KZUxweZwzKT9RtzFf0imfFXR XhV1+b8Q==; Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gP322-0006O2-At for linux-arm-kernel@lists.infradead.org; Tue, 20 Nov 2018 10:13:23 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id wAKA90qv018886; Tue, 20 Nov 2018 11:13:04 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2nvg2c034u-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 20 Nov 2018 11:13:04 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id BCFD83D; Tue, 20 Nov 2018 10:13:02 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node3.st.com [10.75.127.15]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 96C2D266E; Tue, 20 Nov 2018 10:13:02 +0000 (GMT) Received: from localhost (10.75.127.47) by SFHDAG5NODE3.st.com (10.75.127.15) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Tue, 20 Nov 2018 11:13:01 +0100 From: Fabrice Gasnier To: Subject: [PATCH 0/3] iio: stm32-adc: add PM support Date: Tue, 20 Nov 2018 11:12:29 +0100 Message-ID: <1542708752-26163-1-git-send-email-fabrice.gasnier@st.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.75.127.47] X-ClientProxiedBy: SFHDAG3NODE1.st.com (10.75.127.7) To SFHDAG5NODE3.st.com (10.75.127.15) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-11-20_04:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181120_051322_563531_C96F615F X-CRM114-Status: GOOD ( 10.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lars@metafoo.de, alexandre.torgue@st.com, linux-iio@vger.kernel.org, pmeerw@pmeerw.net, linux-kernel@vger.kernel.org, mcoquelin.stm32@gmail.com, knaack.h@gmx.de, fabrice.gasnier@st.com, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch series adds support for power management to stm32-adc iio driver. It slighlty reworks regulator and clock handling, to move them in dedicated routines. Then these routines can be called from probe/remove and PM callbacks. It also takes care of running ADC when going to low power mode. Fabrice Gasnier (3): iio: adc: stm32-adc: move self-calibration to prepare routine iio: adc: stm32-adc: add power management support iio: adc: stm32-adc: switch off running adc when going to low power drivers/iio/adc/stm32-adc-core.c | 182 +++++++++++++++-------- drivers/iio/adc/stm32-adc.c | 303 ++++++++++++++++++++++++++++----------- 2 files changed, 343 insertions(+), 142 deletions(-)