From patchwork Wed Dec 16 07:51:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 344499 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp163874ejs; Tue, 15 Dec 2020 23:52:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJwlgbNdinrjYx4qj5KHKBmQr+P3h/REvB8W4cwFFk0YQdJEFLIzUBFQ8Vfo2+3o9FcU8o/T X-Received: by 2002:a17:906:890:: with SMTP id n16mr14282777eje.463.1608105162679; Tue, 15 Dec 2020 23:52:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608105162; cv=none; d=google.com; s=arc-20160816; b=MaiFgnmhoVSPQzbl1AyXj0VnG3T/HBJ4XKijdZ1fR51Ir4RpQcrImnIAjFqDVmhFgw uWbzJYJZj33o6NqFnxv7WE47gT3/rWgt5MQF8Yo1t40w2jjcsPB0A48SG8H8oePFmSVA Ke5xaNog9+a1nUMKZE72zY5ln7CZrzSAzd98yGjiqStumBAgLry3LUP93Jm2AJ8QK6Ll 3PHkfdlK7VmIe1FTNuaWhDN32J1NksfEHZF+EV6xSgt65Q3IxWesg22G3DFfF61InxCO DDRXpQX1H5xAqZYlkKTvXVxR/jBZAJXS8jIoOICHsLdO++KsFalDJdItlKbFNjNihhtZ FHwA== 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=niKH6BNL1ADCXiwc4ADswQfLUZeqREE5EgoAsfjsh+8=; b=q1f82uSDpbvsq+QPpFam6HpWngikaYb9BFoSSt10WWYtIaphs1jD14Bq0c+39WTdn2 2GRqBXdw/zl9z/Zs2uPviAC9FEumjYCBXPBjvi3K+7hapAR+IaNx1HRcDygTwMjW9+WL GJpU0nESDunVgX3da90tMley4R8uEJb6tuagNHO3qMXL1L9UE8fDGtpiQeiGTt4UBbOg 5+tim7bvXGjWcCqUX/eWcLQY4JypBHmljKLyUz1ckFdfvMVETev8MO5azILVWhqtQVxM ddxyEDXgngGhJfn8+lxWOwOGdCZZttM0ekKYVSAl0NHp/KrYbQzc0nbc/8EXE2bdjP2F 5K8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=VAUdGGmb; 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 dm6si538527ejc.159.2020.12.15.23.52.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Dec 2020 23:52:42 -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=VAUdGGmb; 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 1A95E82A63; Wed, 16 Dec 2020 08:52:26 +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="VAUdGGmb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BCB2082A45; Wed, 16 Dec 2020 08:52:21 +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 0C2C182A45 for ; Wed, 16 Dec 2020 08:52:17 +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 20201216075206euoutp02a44c08452488e1ebf9d1e6c2d8d2c9af~RIxev1oGB2646526465euoutp02O for ; Wed, 16 Dec 2020 07:52:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201216075206euoutp02a44c08452488e1ebf9d1e6c2d8d2c9af~RIxev1oGB2646526465euoutp02O DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1608105126; bh=niKH6BNL1ADCXiwc4ADswQfLUZeqREE5EgoAsfjsh+8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VAUdGGmbARHLCI1wxMWw2VNMxkZskTbPSzpiU+9oz6f87v12xb1gBZWckdNR89Pph uPgFdSiB32fY/b8MysbU5e0mDAnGDZ1U/Ob1RLjOUaajv/xg+WyQpo2m2zu59dDzHu 19/InrgT4rreaRgIbR91JAO1wytJbpLh4EmRTGCw= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20201216075206eucas1p22d10b85b2cd90bd3571738b53926d84e~RIxeVx60P0937409374eucas1p21; Wed, 16 Dec 2020 07:52:06 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 50.11.27958.6ACB9DF5; Wed, 16 Dec 2020 07:52:06 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201216075205eucas1p1d1c5e19ec9e1cdd2867daddee81eb28e~RIxdxBzKx1281112811eucas1p1B; Wed, 16 Dec 2020 07:52:05 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201216075205eusmtrp2c2c899aa08cf2fac4e7f7f63ac9d119e~RIxdfEipf0040100401eusmtrp22; Wed, 16 Dec 2020 07:52:05 +0000 (GMT) X-AuditID: cbfec7f2-f15ff70000006d36-55-5fd9bca67692 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 66.9C.21957.5ACB9DF5; Wed, 16 Dec 2020 07:52:05 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201216075204eusmtip243ff9ad9d9a5cbc41e31629c854721e3~RIxc-35tb1697116971eusmtip2F; Wed, 16 Dec 2020 07:52:04 +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 v3 3/6] adc: meson-saradc: skip hardware init only if ADC is enabled Date: Wed, 16 Dec 2020 08:51:55 +0100 Message-Id: <20201216075158.16458-4-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201216075158.16458-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupileLIzCtJLcpLzFFi42LZduzned1le27GG9y+wWyxccZ6Vosbv9pY LZ6/u8xksfbIXXaLQ33RFh2HlS2+bdnGaDFpwi82i7d7O9ktDk/9wOjA5fH+Riu7x+yGiywe 82adYPH48DHOY37ndyaPs3d2MHr0bVnF6LFx2QHmAI4oLpuU1JzMstQifbsErowP/14xFczj rFg5bTVrA+MH9i5GTg4JAROJzQfusXQxcnEICaxglHi1+AIrhPOFUeLwy9ssIFVCAp8ZJV7e L4PpOHHpARNE0XJGiR9LniN0vF/4mhmkik3AUKLrbRcbiC0iYCRxqWkH2A5mgTtMEl2TG8DG CguESUyZupMRxGYRUJVYeP4BmM0rYCuxdPYXZoh18hKrNxwAszkF7CQOb2tggogf4ZD4+Sqk i5EDyHaR6LyjDhEWlnh1fAvUbzIS/3fOB7tUQqCZUeLhubXsEE4Po8TlphmMEFXWEnfO/WID GcQsoCmxfpc+RNhR4lrzcUaI+XwSN94KgoSZgcxJ26YzQ4R5JTrahCCq1SRmHV8Ht/bghUtQ 13tI/NvdBQ2fiYwS85Z2sk9glJ+FsGwBI+MqRvHU0uLc9NRiw7zUcr3ixNzi0rx0veT83E2M wORy+t/xTzsY5776qHeIkYmD8RCjBAezkgjvn7c34oV4UxIrq1KL8uOLSnNSiw8xSnOwKInz rpq9Jl5IID2xJDU7NbUgtQgmy8TBKdXANF3VR23iGcEF2zhSue46XbxyOsJ9/k7Gp7vW2MvP Zsk0my10dOsLw4NHJ74WYtscGG/pWWbTkZcmcPH++xt3eIU03qcmO28SvjYte8YcKb5ZOe5p QuG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W YBdP+QeBv8JHGkMt81LN9GRXT9+g8CegJtLjmM7v9F010V/imBmVOb6LBfVdKPjylcu8PSBj e6taQLXRdNdy3RRx7emKG8/zMTpHKkZ4WsXrC7Ok/1ijFO7cxdWTsnval6fLy/3ON/J8n+21 4tpErsz7B9r+zKp+t+rHfoPqa1/n6+5ISI15d5K1svL41umys27dV7Plffryqu1OJZbijERD Leai4kQANLmrPP8CAAA= X-CMS-MailID: 20201216075205eucas1p1d1c5e19ec9e1cdd2867daddee81eb28e X-Msg-Generator: CA X-RootMTR: 20201216075205eucas1p1d1c5e19ec9e1cdd2867daddee81eb28e X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201216075205eucas1p1d1c5e19ec9e1cdd2867daddee81eb28e References: <20201216075158.16458-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 Reviewed-by: Neil Armstrong Tested-by: Jaehoon Chung Reviewed-by: Jaehoon Chung --- drivers/adc/meson-saradc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/adc/meson-saradc.c b/drivers/adc/meson-saradc.c index 998cef24d8..ce7ae990ad 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);