From patchwork Mon Dec 14 11:24:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 343486 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp2911334jai; Mon, 14 Dec 2020 03:25:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJw+vn6mO+l1NR7lYBXH2bpFYIa4wMF2sTS+PpinilUJscIjxWy4dJN7RYM1z5ubIsL5tE7d X-Received: by 2002:a17:907:2131:: with SMTP id qo17mr21835079ejb.546.1607945114481; Mon, 14 Dec 2020 03:25:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607945114; cv=none; d=google.com; s=arc-20160816; b=CX18TO78nqNR6f4zTnObKsDIqH5N7B8sKOuBe13h0KQBl8fnj1HJVqHvNo5BnjHpG+ kBLuxAxtSUCefdbsLyqHm4m9VmL69pLzqPm4t/1WMNR/R4P5Mcm76J2l4oZWMU4UyGYX z4Lq5s7IOx6ElFveByCJ11pWd5bPUJ2TIlx8OEj7vaoTk7G4kS1s1somymvDmKTaprK0 vSKDSGNqKWWQeflRvZ2R7gbwjTOil1YE2pHr735vlVGEzsT32QGddhZg4GhV/nBW8niF ++qybvwRK0fvCw7jYO/fdBsat9RsyReX+2A/WsaKC0AWo2kEsn5ivJSug9P4xeOfLJTH KXPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=2H9BBNyv5/vxNOUw1+2E7KnTxYztD616hrCcE1zfDEs=; b=mwee4+4jpHDhKJQM0rZuDAs/LeLBUtN5U5OZNUL3kOJHVVBVs3S9iRhFrj2kLSsNeS 9LP/QLtZXarY64l9ASpYopb6E55cC6ZbZTHLD4GvPVAeGoAALCKafvfkeANlQdJJc2WW wfYleitlmhKqOPxOhLZ7K+I9WHQRhsug39KmoOXZgtr3J3cGGpSpFDrJ6a3DYijtaHkM /IiZ6e3AjmLY5srwppR8UGmLk2dEmMrhI0q5HbUckhlhaB1JDJto+fTmIVGIDNz84hQ4 tgj3GK7bOPeFnj3u2mgtiDFPF3pJAbIdaVjUKr2izxJkqxHyD9KroS/Qd+r0ZjIcR3MA 80cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=KII3jivT; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id g13si2583680edk.411.2020.12.14.03.25.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Dec 2020 03:25:14 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=KII3jivT; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E3FAE82815; Mon, 14 Dec 2020 12:25:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=samsung.com header.i=@samsung.com header.b="KII3jivT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 546A582821; Mon, 14 Dec 2020 12:25:06 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0D8598280C for ; Mon, 14 Dec 2020 12:25:02 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=m.szyprowski@samsung.com Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201214112451euoutp021d21fa2452ee7837e8fef62cdffcfb68~QkYqQ904Q2239122391euoutp02T for ; Mon, 14 Dec 2020 11:24:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201214112451euoutp021d21fa2452ee7837e8fef62cdffcfb68~QkYqQ904Q2239122391euoutp02T DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1607945091; bh=2H9BBNyv5/vxNOUw1+2E7KnTxYztD616hrCcE1zfDEs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KII3jivTQTsOdpnQ/fO2aOBlqDESmLS4GS14qo0yxlWoO/ZFw83xvUbUGtKcvTyCX SAe4sZOLAOmoI963kjPPx45Do12RO52Mk1aIRW6nxCzRH4iBRPrrLx1XeuB4y9dJaW hJBoxbss11EsXLO0g6HyJWwiaAvWbh0PzuWuf6Xo= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20201214112450eucas1p22e6c1144407bc381b9b28fdc26b660ea~QkYp8TWT61573015730eucas1p2L; Mon, 14 Dec 2020 11:24:50 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 61.07.27958.28B47DF5; Mon, 14 Dec 2020 11:24:50 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201214112450eucas1p1e7ad389bceaaf1082c9afdcb0733e9c0~QkYpf61Ya3050030500eucas1p1y; Mon, 14 Dec 2020 11:24:50 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201214112450eusmtrp2de2e1eb793855741b3c7ee58b955feb4~QkYpfQYJk0877908779eusmtrp2l; Mon, 14 Dec 2020 11:24:50 +0000 (GMT) X-AuditID: cbfec7f2-efdff70000006d36-d0-5fd74b82d913 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id AB.E8.16282.28B47DF5; Mon, 14 Dec 2020 11:24:50 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201214112449eusmtip1f99c9ee74846e05c1c02ca06b0a853d6~QkYo9QalF1812918129eusmtip1b; Mon, 14 Dec 2020 11:24:49 +0000 (GMT) From: Marek Szyprowski To: u-boot@lists.denx.de, u-boot-amlogic@groups.io Cc: Marek Szyprowski , Neil Armstrong , Lukasz Majewski , Philippe Reynes , Simon Glass , Heinrich Schuchardt , Jaehoon Chung , Bartlomiej Zolnierkiewicz Subject: [PATCH 3/6] adc: meson-saradc: skip hardware init only if ADC is enabled Date: Mon, 14 Dec 2020 12:24:34 +0100 Message-Id: <20201214112437.18757-4-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201214112437.18757-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupkleLIzCtJLcpLzFFi42LZduzned0m7+vxBsfOmVhsnLGe1eLGrzZW i+fvLjNZrD1yl93iUF+0RcdhZYtvW7YxWkya8IvN4u3eTnaLw1M/MDpweby/0cruMbvhIovH vFknWDw+fIzzmN/5ncnj7J0djB59W1YxemxcdoA5gCOKyyYlNSezLLVI3y6BK2PllKksBds5 Kub0rmdsYJzK3sXIwSEhYCJx7KlwFyMnh5DACkaJ8zd5uhi5gOwvjBI3zm1ng3A+M0pMnd3O BlIF0vDh0luoxHJGiVszt7DAtXw4/IwJpIpNwFCi620XWIeIgJHEpaYdYEXMAneYJLomN7CA JIQFgiV2P20Gu4NFQFXieGsiSJhXwFbi370ZjBDb5CVWbzjADGJzCthJbJy7FmyzhMABDonp XQ9ZIYpcJE7P28AOYQtLvDq+BcqWkfi/cz4TREMzo8TDc2vZIZweRonLTTArrCXunPvFBnIF s4CmxPpd+hBhR4mVbd9YIIHEJ3HjrSBImBnInLRtOjNEmFeio00IolpNYtbxdXBrD164BFXi IdG8Nh0SPhMZJY7+ucA6gVF+FsKuBYyMqxjFU0uLc9NTiw3zUsv1ihNzi0vz0vWS83M3MQJT y+l/xz/tYJz76qPeIUYmDsZDjBIczEoivL/rL8cL8aYkVlalFuXHF5XmpBYfYpTmYFES5101 e028kEB6YklqdmpqQWoRTJaJg1OqgWlWvtMjkbtLrpctaahYc8+0SevFhoCKH9PFWJdGTD1/ SkhD25hvWwWHp39x/0cvo/Xt/Ikq8xav/zwlxFHXWeSj+/1d+1b6O738da3uloobX9CfJWH2 ss4+nz+mfmDSXB+Zu/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8/8+GstgPc//7NqDEZu3fmnxPVSUeGtecdfeQxKOR/8WZd+XW/mt SELN/X32rJvTpNZdCK2a0qX97M39zZuVn35pyFudPcN+adSbyFkNQlrf7idNL86Qe6ZSfD7R ZG7WRem3VjurLS2FPeefU8+p4rzPxb0orWONzjkhy5AMXqd1h2Ysirq3319gthJLcUaioRZz UXEiAFFjhGv+AgAA X-CMS-MailID: 20201214112450eucas1p1e7ad389bceaaf1082c9afdcb0733e9c0 X-Msg-Generator: CA X-RootMTR: 20201214112450eucas1p1e7ad389bceaaf1082c9afdcb0733e9c0 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201214112450eucas1p1e7ad389bceaaf1082c9afdcb0733e9c0 References: <20201214112437.18757-1-m.szyprowski@samsung.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean The driver skips hardware initialization if it is already configured by the earlier bootloader stage (BL30). Skip the initialization only if the hardware is really initialized and enabled. Signed-off-by: Marek Szyprowski Change-Id: I3e2e2d270ad3e7e7f38e2bc3ce2a924a47b164af --- drivers/adc/meson-saradc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -- 2.17.1 Reviewed-by: Neil Armstrong Tested-by: Jaehoon Chung Reviewed-by: Jaehoon Chung diff --git a/drivers/adc/meson-saradc.c b/drivers/adc/meson-saradc.c index 998cef24d88..ce7ae990ad0 100644 --- a/drivers/adc/meson-saradc.c +++ b/drivers/adc/meson-saradc.c @@ -512,8 +512,11 @@ static int meson_saradc_init(struct meson_saradc_priv *priv) * reading the temperature sensor. */ regmap_read(priv->regmap, MESON_SAR_ADC_REG3, ®val); - if (regval & MESON_SAR_ADC_REG3_BL30_INITIALIZED) - return 0; + if (regval & MESON_SAR_ADC_REG3_BL30_INITIALIZED) { + regmap_read(priv->regmap, MESON_SAR_ADC_REG3, ®val); + if (regval & MESON_SAR_ADC_REG3_ADC_EN) + return 0; + } meson_saradc_stop_sample_engine(priv);