devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Stultz <john.stultz@linaro.org>
To: lkml <linux-kernel@vger.kernel.org>
Cc: Dmitry Shmidt <dimitrysh@google.com>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Frank Rowand <frowand.list@gmail.com>,
	devicetree@vger.kernel.org, John Stultz <john.stultz@linaro.org>
Subject: [RFC][PATCH 3/3] of: overlay_mgr: Add ability to apply several hardware configurations
Date: Mon,  9 Oct 2017 22:34:20 -0700	[thread overview]
Message-ID: <1507613660-27236-4-git-send-email-john.stultz@linaro.org> (raw)
In-Reply-To: <1507613660-27236-1-git-send-email-john.stultz@linaro.org>

From: Dmitry Shmidt <dimitrysh@google.com>

This adds the ability to specify multiple DT overlay
configurations, which are predefined in the overlay_mgr entry,
at once via the boot arguments.

Example:
  overlay_mgr.overlay_dt_entry=hardware_cfg_0,hardware_cfg_1,...

Cc: Rob Herring <robh+dt@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: Dmitry Shmidt <dimitrysh@google.com>
Cc: devicetree@vger.kernel.org
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
[jstultz: reworded commit message]
Signed-off-by: John Stultz <john.stultz@linaro.org>
---
 drivers/of/overlay_mgr.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/of/overlay_mgr.c b/drivers/of/overlay_mgr.c
index 5a082be..6b15f7c 100644
--- a/drivers/of/overlay_mgr.c
+++ b/drivers/of/overlay_mgr.c
@@ -112,12 +112,22 @@ static DEVICE_ATTR(current_overlay, 0644, current_overlay_show,
 
 static int of_overlay_mgr_probe(struct platform_device *pdev)
 {
+	char *cur_entry;
+	char *next_entry;
+
 	if (device_create_file(&pdev->dev, &dev_attr_current_overlay))
 		pr_err("overlay_mgr: fail to register apply entry\n");
 
 	if (!of_overlay_dt_entry)
 		return 0;
-	of_overlay_mgr_apply_dt(&pdev->dev, of_overlay_dt_entry);
+	next_entry = of_overlay_dt_entry;
+	do {
+		cur_entry = next_entry;
+		next_entry = strchr(cur_entry, ',');
+		if (next_entry)
+			*next_entry++ = '\0';
+		of_overlay_mgr_apply_dt(&pdev->dev, cur_entry);
+	} while (next_entry);
 	return 0;
 }
 
-- 
2.7.4

  parent reply	other threads:[~2017-10-10  5:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-10  5:34 [RFC][PATCH 0/3] Overlay manager for predefined DT overlay fragments John Stultz
2017-10-10  5:34 ` [RFC][PATCH 1/3] of: overlay_mgr: Add overlay manager driver John Stultz
2017-10-10  5:34 ` [RFC][PATCH 2/3] of: overlay_mgr: Add ability to apply through sysfs entry John Stultz
2017-10-10  5:34 ` John Stultz [this message]
     [not found] ` <1507613660-27236-1-git-send-email-john.stultz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-10-13 21:41   ` [RFC][PATCH 0/3] Overlay manager for predefined DT overlay fragments Rob Herring
2017-10-13 23:51     ` John Stultz
2017-10-17 19:46       ` Rob Herring
2017-10-17 21:20         ` John Stultz
     [not found]           ` <CALAqxLWSLqmN8WWGktVDxfcs3zyk8ktqVJbtAEoHtqZZw5KTVw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-07 23:10             ` John Stultz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1507613660-27236-4-git-send-email-john.stultz@linaro.org \
    --to=john.stultz@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dimitrysh@google.com \
    --cc=frowand.list@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).