From patchwork Fri Oct 25 10:07:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 1183971 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="BiEUyE8q"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 4700FQ5bqvz9sPh for ; Fri, 25 Oct 2019 21:08:58 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 65DD2C21EE5; Fri, 25 Oct 2019 10:08:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 064CCC21EC2; Fri, 25 Oct 2019 10:08:13 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id EC9CCC21E89; Fri, 25 Oct 2019 10:08:05 +0000 (UTC) Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by lists.denx.de (Postfix) with ESMTPS id A6AEFC21E1E for ; Fri, 25 Oct 2019 10:08:02 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id 3so1251725pfb.10 for ; Fri, 25 Oct 2019 03:08:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wYKi6IhB7BKaPr7E+TKstNh3jCwJ+YN8rpsGWGjCZn0=; b=BiEUyE8qOm57y3RK/mW8vQgWj8sKE4GuCpKEBuyK6J8lHEG6NCkMxDgXvAbBiQKNAU xxvtmOM30yK6rikaF7/CmfLNelfgikIJaLiDYxb6yXV/+QQlecMa4IxM4PuTemKt4Ize 1gXAHureiUglzyy5UjZMZ6TCxnRWUMJRUHGsWh0M3s/NdmqYVtgQgXF8dLa8z4Nv/ZgJ qmoGmG5/v6hBefAYiNUL0Wb9rtc4qxUDSEG5kiLGmdWn13hqiapirNSDmWXnB49osPEE Ffu7J+t+J7ZZyLqCya4kcPGexHpnEHQ3k87Vpi3Tuw/1T0w4Ut9P/whKl/9W5lO3TRVI F7Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wYKi6IhB7BKaPr7E+TKstNh3jCwJ+YN8rpsGWGjCZn0=; b=mAAIJCHMsi5aMVKo4rU0fNapaDIt+aKxMRw9nK3dM+/9+l0lVx+EcT7fTCwggQKLfm OccIXIofBwmG68mqd4QkxrRQa7USxh/bTPz69bYWo0mwRRqgrsvxaFD+Nsh4ASyqT9T0 W5wzPAnevuZAaR4XxtP2YGwzxuOBbbE9CRktpPOd17fhowsE60oE7BV2wGDoSowIe9kD SEsLe4hyAtfluSOpVHMbwtwOep7vaw+VRMBJvYffAGiatzOHQpCCNsvlJsBf6MEVTjcR vx0/2SxWwwuyA0wSZLb+rcNCCEZuEjE03EMq5fxQDUG8fkzPVPcw8wJPinCXu6VXd9W2 BS7w== X-Gm-Message-State: APjAAAUFZmqxF2xNNn3v1hOYE94EJrR+w0bAvJvYCDiQPVWEia5ZeI+/ JRLNEEtGlCudhTDUGTFE4+8Dxg== X-Google-Smtp-Source: APXvYqxRMo7Lu3clKDpv9zGswVCHmdji6uBuA/IBOg7OT1/ZvbLBcpqV+ydSBehHUBK4ly5/UezR0Q== X-Received: by 2002:a63:950c:: with SMTP id p12mr3568886pgd.238.1571998081096; Fri, 25 Oct 2019 03:08:01 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id w189sm1906000pfw.101.2019.10.25.03.08.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Oct 2019 03:08:00 -0700 (PDT) From: AKASHI Takahiro To: trini@konsulko.com, xypron.glpk@gmx.de, agraf@csgraf.de Date: Fri, 25 Oct 2019 19:07:35 +0900 Message-Id: <20191025100749.16165-4-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191025100749.16165-1-takahiro.akashi@linaro.org> References: <20191025100749.16165-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH v2 03/17] rtc: move date.c from drivers/rtc/ to lib/ X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" In the next commit, rtc_mktime(), for compatibility with linux, will be implemented using rtc_mktime(), which is no longer drivers/rtc specific. So move this file under lib/. Signed-off-by: AKASHI Takahiro --- cmd/Kconfig | 1 + drivers/rtc/Kconfig | 1 + drivers/rtc/Makefile | 1 - lib/Kconfig | 3 +++ lib/Makefile | 2 ++ {drivers/rtc => lib}/date.c | 5 ++--- 6 files changed, 9 insertions(+), 4 deletions(-) rename {drivers/rtc => lib}/date.c (96%) diff --git a/cmd/Kconfig b/cmd/Kconfig index 8e55b34c961f..e7213e9fe31f 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1610,6 +1610,7 @@ config CMD_LED config CMD_DATE bool "date" default y if DM_RTC + select LIB_DATE help Enable the 'date' command for getting/setting the time/date in RTC devices. diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index 8778cc7b264c..89e71cc7ebef 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig @@ -7,6 +7,7 @@ menu "Real Time Clock" config DM_RTC bool "Enable Driver Model for RTC drivers" depends on DM + select LIB_DATE help Enable drver model for real-time-clock drivers. The RTC uclass then provides the rtc_get()/rtc_set() interface, delegating to diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile index f97a6699820e..e8875ce10f5e 100644 --- a/drivers/rtc/Makefile +++ b/drivers/rtc/Makefile @@ -7,7 +7,6 @@ obj-$(CONFIG_$(SPL_TPL_)DM_RTC) += rtc-uclass.o obj-$(CONFIG_RTC_AT91SAM9_RTT) += at91sam9_rtt.o -obj-y += date.o obj-y += rtc-lib.o obj-$(CONFIG_RTC_DAVINCI) += davinci.o obj-$(CONFIG_RTC_DS1302) += ds1302.o diff --git a/lib/Kconfig b/lib/Kconfig index 3da45a5ec322..e093129a912c 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -529,4 +529,7 @@ config TEST_FDTDEC bool "enable fdtdec test" depends on OF_LIBFDT +config LIB_DATE + bool + endmenu diff --git a/lib/Makefile b/lib/Makefile index 2fffd68f943c..a44f9cc0ae20 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -117,4 +117,6 @@ else obj-y += vsprintf.o strto.o strmhz.o endif +obj-y += date.o + subdir-ccflags-$(CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED) += -O2 diff --git a/drivers/rtc/date.c b/lib/date.c similarity index 96% rename from drivers/rtc/date.c rename to lib/date.c index c57317d2c267..63af4a142612 100644 --- a/drivers/rtc/date.c +++ b/lib/date.c @@ -9,8 +9,7 @@ #include #include -#if defined(CONFIG_CMD_DATE) || defined(CONFIG_DM_RTC) || \ - defined(CONFIG_TIMESTAMP) +#if defined(CONFIG_LIB_DATE) || defined(CONFIG_TIMESTAMP) #define FEBRUARY 2 #define STARTOFTIME 1970 @@ -97,4 +96,4 @@ unsigned long rtc_mktime(const struct rtc_time *tm) return (hours * 60 + tm->tm_min) * 60 + tm->tm_sec; } -#endif +#endif /* CONFIG_LIB_DATE || CONFIG_TIMESTAMP */