From patchwork Fri Jun 13 18:50:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Salter X-Patchwork-Id: 31886 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f198.google.com (mail-pd0-f198.google.com [209.85.192.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EFE2F201EF for ; Fri, 13 Jun 2014 18:55:22 +0000 (UTC) Received: by mail-pd0-f198.google.com with SMTP id w10sf9968529pde.9 for ; Fri, 13 Jun 2014 11:55:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=hqSlTTMkZqXB0HM/8bzB5HlHZS4t7H69MiC8VVWKXBM=; b=Fa+uwOYhYwuOelxFXtEgPQUhXDxvAjrup+3uftUyTR5ml2O/0iEpCk/VawtbnR5yeU XLXXONNsRQ+NiIsL529O/hNL6sqUHlJZFjc2Y3Gd2d51ApPJZ5Mrmd4X/vHOkJNnO2AM YhqhcFy1Uasy4UQZ8WEJdUni/wQw/N3j7z7iwD9W7BQxIt24NMj8BYBHWKZSDKMC3cI7 UOzwqk6loQsQLpLQsX8Wab+X++EGA0FUCUY1fyntzokDEKLOYE1eHtXgE3ov4mlwg5eE tHxtrhmx2j8cO64gJ0X/1VIrsET7OwhSSoMDdxHIkS7wvSu23PWIzvEc2pA/K7pHXgA3 JKrg== X-Gm-Message-State: ALoCoQnO/vqelTM16TcqmEMv9GM0H41fWJyjbYqQgIyi5SYrUZDn1zv1H8SZJApWK90iyNG2/JeB X-Received: by 10.66.217.170 with SMTP id oz10mr444834pac.9.1402685722235; Fri, 13 Jun 2014 11:55:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.43.135 with SMTP id e7ls3665572qga.70.gmail; Fri, 13 Jun 2014 11:55:22 -0700 (PDT) X-Received: by 10.52.244.84 with SMTP id xe20mr2495045vdc.3.1402685722114; Fri, 13 Jun 2014 11:55:22 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id t2si1687696vey.21.2014.06.13.11.55.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Jun 2014 11:55:22 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id id10so2768092vcb.30 for ; Fri, 13 Jun 2014 11:55:22 -0700 (PDT) X-Received: by 10.53.8.162 with SMTP id dl2mr2522236vdd.24.1402685721976; Fri, 13 Jun 2014 11:55:21 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp518606vcb; Fri, 13 Jun 2014 11:55:21 -0700 (PDT) X-Received: by 10.66.121.197 with SMTP id lm5mr5575419pab.118.1402685721017; Fri, 13 Jun 2014 11:55:21 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id il1si3044543pbb.73.2014.06.13.11.55.20; Fri, 13 Jun 2014 11:55:20 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752595AbaFMSzJ (ORCPT + 24 others); Fri, 13 Jun 2014 14:55:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28689 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751172AbaFMSzH (ORCPT ); Fri, 13 Jun 2014 14:55:07 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5DIoq0F031463 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Jun 2014 14:50:53 -0400 Received: from deneb.redhat.com (ovpn-113-44.phx2.redhat.com [10.3.113.44]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s5DIop5D026700; Fri, 13 Jun 2014 14:50:52 -0400 From: Mark Salter To: Alessandro Zummo , Tony Luck , Fenghua Yu Cc: linux-ia64@vger.kernel.org, rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org, Mark Salter Subject: [PATCH] rtc: ia64: allow other architectures to use EFI RTC Date: Fri, 13 Jun 2014 14:50:30 -0400 Message-Id: <1402685430-32591-1-git-send-email-msalter@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: msalter@redhat.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Currently, the rtc-efi driver is restricted to ia64 only. Newer architectures with EFI support may want to also use that driver. This patch moves the platform device setup from ia64 into drivers/rtc and allow any architecture with CONFIG_EFI=y to use the rtc-efi driver. Signed-off-by: Mark Salter --- arch/ia64/kernel/time.c | 15 --------------- drivers/rtc/Kconfig | 2 +- drivers/rtc/Makefile | 4 ++++ drivers/rtc/rtc-efi-platform.c | 30 ++++++++++++++++++++++++++++++ 4 files changed, 35 insertions(+), 16 deletions(-) create mode 100644 drivers/rtc/rtc-efi-platform.c diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c index 71c52bc..a149c67 100644 --- a/arch/ia64/kernel/time.c +++ b/arch/ia64/kernel/time.c @@ -384,21 +384,6 @@ static struct irqaction timer_irqaction = { .name = "timer" }; -static struct platform_device rtc_efi_dev = { - .name = "rtc-efi", - .id = -1, -}; - -static int __init rtc_init(void) -{ - if (platform_device_register(&rtc_efi_dev) < 0) - printk(KERN_ERR "unable to register rtc device...\n"); - - /* not necessarily an error */ - return 0; -} -module_init(rtc_init); - void read_persistent_clock(struct timespec *ts) { efi_gettimeofday(ts); diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index 0754f5c..4478a59 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig @@ -789,7 +789,7 @@ config RTC_DRV_DA9063 config RTC_DRV_EFI tristate "EFI RTC" - depends on IA64 + depends on EFI help If you say yes here you will get support for the EFI Real Time Clock. diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile index 70347d0..f1dfc36 100644 --- a/drivers/rtc/Makefile +++ b/drivers/rtc/Makefile @@ -10,6 +10,10 @@ obj-$(CONFIG_RTC_SYSTOHC) += systohc.o obj-$(CONFIG_RTC_CLASS) += rtc-core.o rtc-core-y := class.o interface.o +ifdef CONFIG_RTC_DRV_EFI +rtc-core-y += rtc-efi-platform.o +endif + rtc-core-$(CONFIG_RTC_INTF_DEV) += rtc-dev.o rtc-core-$(CONFIG_RTC_INTF_PROC) += rtc-proc.o rtc-core-$(CONFIG_RTC_INTF_SYSFS) += rtc-sysfs.o diff --git a/drivers/rtc/rtc-efi-platform.c b/drivers/rtc/rtc-efi-platform.c new file mode 100644 index 0000000..1a7f890 --- /dev/null +++ b/drivers/rtc/rtc-efi-platform.c @@ -0,0 +1,30 @@ +/* + * Moved from arch/ia64/kernel/time.c + * + * Copyright (C) 1998-2003 Hewlett-Packard Co + * Stephane Eranian + * David Mosberger + * Copyright (C) 1999 Don Dugger + * Copyright (C) 1999-2000 VA Linux Systems + * Copyright (C) 1999-2000 Walt Drummond + */ +#include +#include +#include +#include +#include + +static struct platform_device rtc_efi_dev = { + .name = "rtc-efi", + .id = -1, +}; + +static int __init rtc_init(void) +{ + if (platform_device_register(&rtc_efi_dev) < 0) + pr_err("unable to register rtc device...\n"); + + /* not necessarily an error */ + return 0; +} +module_init(rtc_init);