From patchwork Tue Jan 10 10:50:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sekhar Nori X-Patchwork-Id: 90672 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp554116qgi; Tue, 10 Jan 2017 02:52:16 -0800 (PST) X-Received: by 10.84.140.3 with SMTP id 3mr3980149pls.61.1484045535987; Tue, 10 Jan 2017 02:52:15 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id a3si1765618pln.255.2017.01.10.02.52.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Jan 2017 02:52:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ti.com 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 1cQu2G-0000dX-TO; Tue, 10 Jan 2017 10:52:12 +0000 Received: from fllnx210.ext.ti.com ([198.47.19.17]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cQu2C-0000S9-3s for linux-arm-kernel@lists.infradead.org; Tue, 10 Jan 2017 10:52:10 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id v0AAovDt013812; Tue, 10 Jan 2017 04:50:57 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id v0AAov3h029189; Tue, 10 Jan 2017 04:50:57 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.294.0; Tue, 10 Jan 2017 04:50:56 -0600 Received: from [172.24.190.171] (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v0AAordL002402; Tue, 10 Jan 2017 04:50:54 -0600 Subject: Re: [PATCH v2 4/6] ARM: davinci: add skeleton for pdata-quirks To: Kevin Hilman References: <20170109205531.3435-1-khilman@baylibre.com> <20170109205531.3435-5-khilman@baylibre.com> From: Sekhar Nori Message-ID: <5300e77b-0e76-245d-8f80-689865d471b8@ti.com> Date: Tue, 10 Jan 2017 16:20:53 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170110_025208_273197_AE1ABAEA X-CRM114-Status: GOOD ( 15.90 ) X-Spam-Score: -5.1 (-----) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-5.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -3.2 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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 , =?UTF-8?Q?Bartosz_Go=c5=82aszewski?= , Fabien Parent , Alexandre Bailon , Patrick Titiano , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org On Tuesday 10 January 2017 03:56 PM, Sekhar Nori wrote: > On Tuesday 10 January 2017 02:25 AM, Kevin Hilman wrote: >> Add skeleton pdata-quirks for for davinci. > > s/for for/for > >> >> Signed-off-by: Kevin Hilman > > Applied to v4.11/soc After reviewing 5/6, I think some parts of that patch should actually be part of basic pdata-quirks support addition. I have moved them here. Here is the updated patch. Let me know if it looks fine. Thanks, Sekhar ---8<--- Author: Kevin Hilman AuthorDate: Mon Jan 9 12:55:29 2017 -0800 Commit: Sekhar Nori CommitDate: Tue Jan 10 16:12:22 2017 +0530 ARM: davinci: add skeleton for pdata-quirks Add skeleton pdata-quirks for davinci. Signed-off-by: Kevin Hilman [nsekhar@ti.com: move changes to build pdata-quirks.c and call to pdata_quirks_init() to this patch] Signed-off-by: Sekhar Nori _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm/mach-davinci/Makefile b/arch/arm/mach-davinci/Makefile index 0a2e6da45f28..df96ca9eab6d 100644 --- a/arch/arm/mach-davinci/Makefile +++ b/arch/arm/mach-davinci/Makefile @@ -21,7 +21,7 @@ obj-$(CONFIG_AINTC) += irq.o obj-$(CONFIG_CP_INTC) += cp_intc.o # Board specific -obj-$(CONFIG_MACH_DA8XX_DT) += da8xx-dt.o +obj-$(CONFIG_MACH_DA8XX_DT) += da8xx-dt.o pdata-quirks.o obj-$(CONFIG_MACH_DAVINCI_EVM) += board-dm644x-evm.o obj-$(CONFIG_MACH_SFFSDR) += board-sffsdr.o obj-$(CONFIG_MACH_NEUROS_OSD2) += board-neuros-osd2.o diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c index 9ee44da6eb7b..d2be1941a687 100644 --- a/arch/arm/mach-davinci/da8xx-dt.c +++ b/arch/arm/mach-davinci/da8xx-dt.c @@ -62,6 +62,7 @@ static void __init da850_init_machine(void) of_platform_default_populate(NULL, da850_auxdata_lookup, NULL); davinci_pm_init(); + pdata_quirks_init(); } static const char *const da850_boards_compat[] __initconst = { 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); +}