From patchwork Mon Jan 9 20:55:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 9505965 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0FD0D606E1 for ; Mon, 9 Jan 2017 20:56:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBB20284DA for ; Mon, 9 Jan 2017 20:56:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E07B028518; Mon, 9 Jan 2017 20:56:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6E102284DA for ; Mon, 9 Jan 2017 20:56:48 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cQgzl-0006RQ-9x; Mon, 09 Jan 2017 20:56:45 +0000 Received: from mail-pf0-x22b.google.com ([2607:f8b0:400e:c00::22b]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cQgyz-00051T-O6 for linux-arm-kernel@lists.infradead.org; Mon, 09 Jan 2017 20:56:00 +0000 Received: by mail-pf0-x22b.google.com with SMTP id f144so23972381pfa.2 for ; Mon, 09 Jan 2017 12:55:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GkL2X/JEYRbHv3xLBEIAeee0td5arAqJEdqaX8lA7hY=; b=zA1wit/H6wUKZr6ce3j1iHrMn6v3BxnF/GnO07DRqalKVtzt1CRZNOmakHKPyUm/Te LwNUYRnk2oXUomSCRQo4GW52eQpmlNgKPBG85jRaHaZ3FpfmO4WbEMaf1d+JTAExBzck YE5zvzV+VJFKLmCYDHYwK0JT9kOAGQHA+mAYJsiRquY9oIMWhezK7j9yMhj56xgn14cE m5KqmLK+SpAlIfj27c/VOr0fBLJ3J3jCxSAuWU3lEMh987EUHbVg6XmOsqCaXRcoMjE9 eAUe0EFfb2k3OeIIj2Up1Mv82GC9R2j5sKFXzEE1rHgRLvQ/u/RWoIAg4m2fuHCXtJbH NfLA== 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=GkL2X/JEYRbHv3xLBEIAeee0td5arAqJEdqaX8lA7hY=; b=Q7roCK9EH/SOfcNjXJbjNUNnIsfma+LcGCUDyKCo6QUYx6nIKATVVAofUffUrdtq0G S4Vdg2KdDcowfQ5RVjFFZ0B3siiEpFCY1uT2PW8+0yUkKhuLwoUTD7a4jlXFVkeJxguM QSUc621NZEwAS/Biqb+74tUDFKFW79Q1Om5leI4ROrHTNCCKLYiegJua6Ygxldj8lKqx 6rIeF9u2LjCkfchSIXf2MMMLNreFMaEOgA5tUfO8ozfX1mqyCaqBGBrnUq3mrIC/FoHw pGclOt9d9j9iAfel8qCJ+fE6dtkLvrC8Jc5PjIEmkg4ZzmXAGpcRjUnqwan8QTGjPxsj veDQ== X-Gm-Message-State: AIkVDXIiCFdEy4yZ8Vqc2TrhJGnRruJqF1PpqU384RmkZL/M9TcOhfVjTzEsjZu8mj6lUJrW X-Received: by 10.84.209.172 with SMTP id y41mr187172918plh.96.1483995336941; Mon, 09 Jan 2017 12:55:36 -0800 (PST) Received: from localhost (c-98-203-232-209.hsd1.wa.comcast.net. [98.203.232.209]) by smtp.gmail.com with ESMTPSA id e88sm19149472pfb.16.2017.01.09.12.55.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jan 2017 12:55:36 -0800 (PST) From: Kevin Hilman To: Sekhar Nori Subject: [PATCH v2 4/6] ARM: davinci: add skeleton for pdata-quirks Date: Mon, 9 Jan 2017 12:55:29 -0800 Message-Id: <20170109205531.3435-5-khilman@baylibre.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170109205531.3435-1-khilman@baylibre.com> References: <20170109205531.3435-1-khilman@baylibre.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170109_125557_814280_57909A95 X-CRM114-Status: GOOD ( 15.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Lechner , Axel Haslam , Fabien Parent , =?UTF-8?q?Bartosz=20Go=C5=82aszewski?= , Alexandre Bailon , Patrick Titiano , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add skeleton pdata-quirks for for davinci. Signed-off-by: Kevin Hilman --- arch/arm/mach-davinci/include/mach/common.h | 2 ++ arch/arm/mach-davinci/pdata-quirks.c | 39 +++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 arch/arm/mach-davinci/pdata-quirks.c diff --git a/arch/arm/mach-davinci/include/mach/common.h b/arch/arm/mach-davinci/include/mach/common.h index 0b3c169758ed..037aa66bcac1 100644 --- a/arch/arm/mach-davinci/include/mach/common.h +++ b/arch/arm/mach-davinci/include/mach/common.h @@ -102,6 +102,8 @@ int davinci_pm_init(void); static inline int davinci_pm_init(void) { return 0; } #endif +void __init pdata_quirks_init(void); + #define SRAM_SIZE SZ_128K #endif /* __ARCH_ARM_MACH_DAVINCI_COMMON_H */ diff --git a/arch/arm/mach-davinci/pdata-quirks.c b/arch/arm/mach-davinci/pdata-quirks.c new file mode 100644 index 000000000000..5b57da475065 --- /dev/null +++ b/arch/arm/mach-davinci/pdata-quirks.c @@ -0,0 +1,39 @@ +/* + * Legacy platform_data quirks + * + * Copyright (C) 2016 BayLibre, Inc + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +#include +#include + +#include + +struct pdata_init { + const char *compatible; + void (*fn)(void); +}; + +static void pdata_quirks_check(struct pdata_init *quirks) +{ + while (quirks->compatible) { + if (of_machine_is_compatible(quirks->compatible)) { + if (quirks->fn) + quirks->fn(); + break; + } + quirks++; + } +} + +static struct pdata_init pdata_quirks[] __initdata = { + { /* sentinel */ }, +}; + +void __init pdata_quirks_init(void) +{ + pdata_quirks_check(pdata_quirks); +}