Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 97726C433F5 for ; Sun, 8 May 2022 15:11:29 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CA13D84197; Sun, 8 May 2022 17:09:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="D4VhsVhc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AD97683F63; Sun, 8 May 2022 17:09:00 +0200 (CEST) Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B938583F42 for ; Sun, 8 May 2022 17:08:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jbx6244@gmail.com Received: by mail-ej1-x634.google.com with SMTP id dk23so22494288ejb.8 for ; Sun, 08 May 2022 08:08:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HcnArjogag4mV3yLposc3MHYRnf4VqzJ+6zKZZSQ0DM=; b=D4VhsVhcBBlroi8/3BZ//B9Dwq1iEM1xuPNN3tzEgDVRoIfBGvVrYaM0GjjoVc0DEm iTtFVpNKIgCXVah3BhslFprgbld2rfZxDTWPXqkhhH4vzvVi7YPX2Ao4GTgrFu9p4lhu uXooyh+GGz6szRImXvFWHhzm/txNxlnlIL2TFcPYun37jjMQljvfM8+tPwpMvMakyGp3 rq9b2bZnXiGlwX/7dHCFKHyEq75z1bbO5UB483iTZg6MRjCoKXfWMCl37i6iwjYpGTXl 0WRomARc8fbNlj2XkQ/nVfTTKFzH9XN8pH7NLnyZA3eeG4q0U/XCRxqwZ4YiEDF192nP MaGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HcnArjogag4mV3yLposc3MHYRnf4VqzJ+6zKZZSQ0DM=; b=v7I9bfGQETiPCYniwqxnrX48zu9XrwSCGsikhdeDHQs24jDx0Ef5qo2+BLCuZemTXW qQobDSOQqV1J6kAYneS56frUt/LPymXDA/gvhVEfDR3s2GyuuuXwmgq1IIypqi3TvpJB WU/RpX5DsqKLTu3Stu9mzQF2CrPNqznN8cWSUhZjcWHGyis7fvvg9/al1iyQ5uX234rx z8fwPM+YXPNAvT6snyJCRVQTTEUh+MRJbME0ZlxsNh9ohW57QZpW6h8+WZ3QEDC8C9gP aN8waW8fRn53DaiqHayexHLJPOK0O/TMOUGrdeFLfeqrm4nsJ6B/cv+g4iGapaSuWODd sHgg== X-Gm-Message-State: AOAM531Lh6R8pxeQIqzu10XJi2/rSn+MRg7+KuSAks0orO8aSuVAbdeH Za5heRGMHWZsdOZj6WSa/c8= X-Google-Smtp-Source: ABdhPJyOr+7TJBOeJxB7VorydsULX3EoLmpxboi6mi/J55U7ZE7W93XXlKjWEJKJ0jUIz+i4f7OA3A== X-Received: by 2002:a17:906:6a28:b0:6f4:d368:ccf1 with SMTP id qw40-20020a1709066a2800b006f4d368ccf1mr10947671ejc.35.1652022521562; Sun, 08 May 2022 08:08:41 -0700 (PDT) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id yl26-20020a17090693fa00b006f3ef214dc2sm4102721ejb.40.2022.05.08.08.08.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 08:08:41 -0700 (PDT) From: Johan Jonker To: kever.yang@rock-chips.com Cc: sjg@chromium.org, philipp.tomsich@vrull.eu, lukma@denx.de, marex@denx.de, u-boot@lists.denx.de Subject: [PATCH v1 13/17] rockchip: adc: make adc branch compile in SPL Date: Sun, 8 May 2022 17:08:21 +0200 Message-Id: <20220508150825.21711-14-jbx6244@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220508150825.21711-1-jbx6244@gmail.com> References: <20220508150825.21711-1-jbx6244@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.5 at phobos.denx.de X-Virus-Status: Clean Make the ADC branch compile in SPL. Signed-off-by: Johan Jonker --- drivers/Makefile | 3 ++- drivers/adc/Kconfig | 29 +++++++++++++++++++++++++++++ drivers/adc/Makefile | 4 ++-- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/drivers/Makefile b/drivers/Makefile index 4e7cf284..e79bbe29 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -40,6 +40,7 @@ obj-$(CONFIG_$(SPL_)FPGA) += fpga/ ifndef CONFIG_TPL_BUILD ifdef CONFIG_SPL_BUILD +obj-$(CONFIG_SPL_ADC) += adc/ obj-$(CONFIG_SPL_CPU) += cpu/ obj-$(CONFIG_SPL_CRYPTO) += crypto/ obj-$(CONFIG_SPL_MPC8XXX_INIT_DDR) += ddr/fsl/ @@ -71,7 +72,7 @@ endif ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),) -obj-y += adc/ +obj-$(CONFIG_ADC) += adc/ obj-y += ata/ obj-y += bus/ obj-$(CONFIG_DM_DEMO) += demo/ diff --git a/drivers/adc/Kconfig b/drivers/adc/Kconfig index e719c38b..68e0d2d3 100644 --- a/drivers/adc/Kconfig +++ b/drivers/adc/Kconfig @@ -1,5 +1,6 @@ config ADC bool "Enable ADC drivers using Driver Model" + depends on DM help This enables ADC API for drivers, which allows driving ADC features by single and multi-channel methods for: @@ -11,8 +12,23 @@ config ADC - support supply's phandle with auto-enable - supply polarity setting in fdt +config SPL_ADC + bool "Enable ADC drivers using Driver Model in SPL" + depends on SPL_DM + help + This enables ADC API for drivers, which allows driving ADC features + by single and multi-channel methods in SPL for: + - start/stop/get data for conversion of a single-channel selected by + a number or multi-channels selected by a bitmask + - get data mask (ADC resolution) + ADC reference Voltage supply options: + - methods for get Vdd/Vss reference Voltage values with polarity + - support supply's phandle with auto-enable + - supply polarity setting in fdt + config ADC_EXYNOS bool "Enable Exynos 54xx ADC driver" + depends on ADC help This enables basic driver for Exynos ADC compatible with Exynos54xx. It provides: @@ -22,6 +38,7 @@ config ADC_EXYNOS config ADC_SANDBOX bool "Enable Sandbox ADC test driver" + depends on ADC help This enables driver for Sandbox ADC device emulation. It provides: @@ -31,6 +48,7 @@ config ADC_SANDBOX config SARADC_MESON bool "Enable Amlogic Meson SARADC driver" + depends on ADC imply REGMAP help This enables driver for Amlogic Meson SARADC. @@ -41,6 +59,7 @@ config SARADC_MESON config SARADC_ROCKCHIP bool "Enable Rockchip SARADC driver" + depends on ADC help This enables driver for Rockchip SARADC. It provides: @@ -48,6 +67,16 @@ config SARADC_ROCKCHIP - 1O or 12 bits resolution - Up to 1MSPS of sample rate +config SPL_SARADC_ROCKCHIP + bool "Enable Rockchip SARADC driver in SPL" + depends on SPL_ADC + help + This enables driver for Rockchip SARADC in SPL. + It provides: + - 2~6 analog input channels + - 1O or 12 bits resolution + - Up to 1MSPS of sample rate + config STM32_ADC bool "Enable STMicroelectronics STM32 ADC driver" depends on ADC && (STM32H7 || ARCH_STM32MP) diff --git a/drivers/adc/Makefile b/drivers/adc/Makefile index c1387f3a..43788c48 100644 --- a/drivers/adc/Makefile +++ b/drivers/adc/Makefile @@ -4,9 +4,9 @@ # Przemyslaw Marczak # -obj-$(CONFIG_ADC) += adc-uclass.o +obj-y += adc-uclass.o obj-$(CONFIG_ADC_EXYNOS) += exynos-adc.o obj-$(CONFIG_ADC_SANDBOX) += sandbox.o -obj-$(CONFIG_SARADC_ROCKCHIP) += rockchip-saradc.o +obj-$(CONFIG_$(SPL_)SARADC_ROCKCHIP) += rockchip-saradc.o obj-$(CONFIG_SARADC_MESON) += meson-saradc.o obj-$(CONFIG_STM32_ADC) += stm32-adc.o stm32-adc-core.o -- 2.20.1