From patchwork Fri Jan 17 12:25:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 23334 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f198.google.com (mail-ig0-f198.google.com [209.85.213.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 37A8620540 for ; Fri, 17 Jan 2014 12:56:35 +0000 (UTC) Received: by mail-ig0-f198.google.com with SMTP id uq10sf2395262igb.1 for ; Fri, 17 Jan 2014 04:56:34 -0800 (PST) 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:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=ASX5952h/7XuIJAxIujtVtGL4he3pqgR6WLfHTd77Mk=; b=QyMA9gHx7jpfwMKihVXqrris6xNWRi2WaF+eeYs4JBbbtGBbjJYOYyJlfgLTk+/n6C iRbO1dpfR/fh3NnHC9PWABxawMKnLp55J/kvGIJGozutSASEpGnRKgZjvO3Dn1pAQH2n hcfkqtNJa71A+1KJNLfqyTs8tdDYvwZEf6MHOGq7KYkO6iKHdwyCLCaxHPniMEXOXv6U Fjf3u1nZD3WAjl610yjr3UTbXwVJ0Bs47mJ/g8G5kJxVUHSj/TTo48N5FTwInJ16dPwF Aq9LJ9OC9Uu9+hsIT7IcQ0PjM24dFDpbMysNP8kDSTOYL2UsaOTeOdxUEJUgbzP6lkXb FCFQ== X-Gm-Message-State: ALoCoQksValPcU8snqXzcbf89wdOIr58BwB7pYfImrzaX1iYiYIIKbkiR6cOtWvpsxzoaavND7Nb X-Received: by 10.50.154.73 with SMTP id vm9mr911330igb.2.1389963394455; Fri, 17 Jan 2014 04:56:34 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.81.102 with SMTP id z6ls1127449qex.97.gmail; Fri, 17 Jan 2014 04:56:34 -0800 (PST) X-Received: by 10.52.231.162 with SMTP id th2mr87650vdc.61.1389963394322; Fri, 17 Jan 2014 04:56:34 -0800 (PST) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id dr8si4869522vcb.88.2014.01.17.04.56.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Jan 2014 04:56:34 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id ik5so1513104vcb.23 for ; Fri, 17 Jan 2014 04:56:34 -0800 (PST) X-Received: by 10.220.247.68 with SMTP id mb4mr145045vcb.37.1389963394227; Fri, 17 Jan 2014 04:56:34 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.59.13.131 with SMTP id ey3csp17527ved; Fri, 17 Jan 2014 04:56:33 -0800 (PST) X-Received: by 10.68.223.9 with SMTP id qq9mr2015217pbc.58.1389963393172; Fri, 17 Jan 2014 04:56:33 -0800 (PST) Received: from mail-pb0-f47.google.com (mail-pb0-f47.google.com [209.85.160.47]) by mx.google.com with ESMTPS id eb3si10093464pbd.137.2014.01.17.04.56.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Jan 2014 04:56:33 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.47 is neither permitted nor denied by best guess record for domain of hanjun.guo@linaro.org) client-ip=209.85.160.47; Received: by mail-pb0-f47.google.com with SMTP id um1so4059662pbc.6 for ; Fri, 17 Jan 2014 04:56:32 -0800 (PST) X-Received: by 10.66.149.37 with SMTP id tx5mr1842405pab.81.1389963392749; Fri, 17 Jan 2014 04:56:32 -0800 (PST) Received: from localhost ([218.17.215.175]) by mx.google.com with ESMTPSA id bz4sm22679575pbb.12.2014.01.17.04.56.12 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 17 Jan 2014 04:56:32 -0800 (PST) From: Hanjun Guo To: "Rafael J. Wysocki" , Catalin Marinas , Will Deacon , Russell King - ARM Linux Cc: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Grant Likely , Matthew Garrett , Olof Johansson , Linus Walleij , Bjorn Helgaas , Rob Herring , Mark Rutland , Arnd Bergmann , patches@linaro.org, linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org, linaro-acpi@lists.linaro.org, Charles.Garcia-Tobin@arm.com, Amit Daniel Kachhap , Hanjun Guo Subject: [PATCH 18/20] clocksource / acpi: Add macro CLOCKSOURCE_ACPI_DECLARE Date: Fri, 17 Jan 2014 20:25:12 +0800 Message-Id: <1389961514-13562-19-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1389961514-13562-1-git-send-email-hanjun.guo@linaro.org> References: <1389961514-13562-1-git-send-email-hanjun.guo@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: hanjun.guo@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Amit Daniel Kachhap This macro does the same job as CLOCKSOURCE_OF_DECLARE. The device name from the ACPI timer table is matched with all the registered timer controllers and matching initialisation routine is invoked. Signed-off-by: Amit Daniel Kachhap Signed-off-by: Hanjun Guo --- include/asm-generic/vmlinux.lds.h | 10 ++++++++++ include/linux/clocksource.h | 12 ++++++++++++ 2 files changed, 22 insertions(+) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index bc2121f..3216bee 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -148,6 +148,15 @@ #define CLKSRC_OF_TABLES() #endif +#ifdef CONFIG_ACPI +#define CLKSRC_ACPI_TABLES() . = ALIGN(8); \ + VMLINUX_SYMBOL(__clksrc_acpi_table) = .; \ + *(__clksrc_acpi_table) \ + *(__clksrc_acpi_table_end) +#else +#define CLKSRC_ACPI_TABLES() +#endif + #ifdef CONFIG_IRQCHIP #define IRQCHIP_OF_MATCH_TABLE() \ . = ALIGN(8); \ @@ -491,6 +500,7 @@ MEM_DISCARD(init.rodata) \ CLK_OF_TABLES() \ CLKSRC_OF_TABLES() \ + CLKSRC_ACPI_TABLES() \ KERNEL_DTB() \ IRQCHIP_OF_MATCH_TABLE() diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 67301a4..1d500cf 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h @@ -341,6 +341,8 @@ extern int clocksource_i8253_init(void); struct device_node; typedef void(*clocksource_of_init_fn)(struct device_node *); +typedef void(*clocksource_acpi_init_fn)(void); + #ifdef CONFIG_CLKSRC_OF extern void clocksource_of_init(void); @@ -358,4 +360,14 @@ static inline void clocksource_of_init(void) {} .data = (fn == (clocksource_of_init_fn)NULL) ? fn : fn } #endif +#ifdef CONFIG_ACPI +#define CLOCKSOURCE_ACPI_DECLARE(name, compat, fn) \ + static const struct acpi_device_id __clksrc_acpi_table_##name \ + __used __section(__clksrc_acpi_table) \ + = { .id = compat, \ + .driver_data = (kernel_ulong_t)fn } +#else +#define CLOCKSOURCE_ACPI_DECLARE(name, compat, fn) +#endif + #endif /* _LINUX_CLOCKSOURCE_H */