From patchwork Tue Oct 10 05:34:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 115337 Delivered-To: patches@linaro.org Received: by 10.140.22.163 with SMTP id 32csp3355664qgn; Mon, 9 Oct 2017 22:34:38 -0700 (PDT) X-Received: by 10.99.181.25 with SMTP id y25mr11075458pge.270.1507613677926; Mon, 09 Oct 2017 22:34:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507613677; cv=none; d=google.com; s=arc-20160816; b=JsEJ+NCxjTc6mm38+YaYLcdkBDdy4Xf04RGIC8Vln4mzs8XWaShn11voWP6hwyZVcM PQ9sHLnaMlHHf5+GUNpQDqf+UOfa4DjctFooIqjSgLoc6Sd1a6aBNsa00NNwfO1y50QF RhK9Uu5KMWKzSP0wfu5IHQyXIV6ncvKA4wD+A60EeIuh02f0RAJ7Y7jZrKoad1vtL9zR bD4ZFPqWhK9iJlSj3TZWYedB5KFNEB9NynvmEJTqf35WBjAsdjTfYcM9BhJ9kpoEitbW IBe0pdsBOYjfLvX7xuF+oCzSRo43n/Gxynj/aMRaOtuQ6/0Y5aOkL5qjbESZfAe4wn5L 0wDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=2Q6cXyfCDrGFlAhwU1Jx9SMHXa+2PtIyt4p1xzkoch0=; b=eJumgFohzcxXgkgubJzWqpxsFDR2dAMJD/RcAIlJuYFM6ndg3TpkSqxdTCcMA0gm0n GNLvnlmg7FZ11mU2kma+zuzHAa1aEJ2F74p9Ykd4EUTOjhEKBRfzPhlg9QQksIa/ru2x KyV1TxzvK3bHwreBZlagxwiu2AYpqNVvy4nouQmU9IbAeoKEvdCuS0nMUBjEoWuvExLf YBH/yTOjckVaoBQm/WKf6d6r2oR1ybuzINgmxd9v1cpwKIUn30T7HG9ckKxCBji5f20H VAZyE4iKVaCIqy5sXPqwj88gHAgDiEAq+Gfc8fMqwosbA0HDaB0aH4tGjDvTdEg1upxS QvaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b0uR82z8; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id x10sor1576517plv.65.2017.10.09.22.34.37 for (Google Transport Security); Mon, 09 Oct 2017 22:34:37 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b0uR82z8; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2Q6cXyfCDrGFlAhwU1Jx9SMHXa+2PtIyt4p1xzkoch0=; b=b0uR82z8Fi+lKa+inshttDusahdKtUkX4jEUd/qBGQgvOvUFxO5Duoqmyev9czBocU MWE1shkobK6rX+XvtfU4RrByi2s0d/jRUEk4ulS+bRgYGnQq/ogzSmNMuESB9HBVEZz1 TCSO+RdKrHF7UVdkyUDsYTR4qKOOOvfrbv+kA= 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; bh=2Q6cXyfCDrGFlAhwU1Jx9SMHXa+2PtIyt4p1xzkoch0=; b=qFJffRfFs6HkGmrB3bNHaMCYEhmRKqFpuOmoJCOgsEXjrssScamG+X5tzBSNlmUJkV w3Qe1LPWPbur+He2v5s1yzbHMMO2lJic0mSBFh70QHdrW8bINkdhAvtTL35wxIYsOzyg JzZadeFCu13zjZTN5Qs16A8ebSHUt1uQqPUxGAdTDCKt18EFPehvYniHcP6R/fFgO45j BcU3llp01uPahJhh/Ah0yhGLiLMvZBeKTUvckW0bQTELkaYlGoW9GDi4BvXuHFzYOpEz 2Ilpp6277QWk/XLfJltMgsmGkxi43TZPS2IqQPGfDyeR+a9B2ziF05LtAbnM+HYQamhK YggQ== X-Gm-Message-State: AMCzsaVGhYv6BFLx3yoL6FvC3hdBA7MUJuFDoHeRApWXU1giPXlQUoEN Owj3R4WgK959A1iGkZR9Uzvbrqtl X-Google-Smtp-Source: AOwi7QCDKqS2eymj9MPMECvLB9XBr7FeGskBMnAVWlDWKy97bt/37b2vW5ga0sjg0SSE/EbIPNJu9g== X-Received: by 10.84.209.238 with SMTP id y101mr11058828plh.211.1507613677663; Mon, 09 Oct 2017 22:34:37 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:1002:83f0:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id b16sm9603595pfe.58.2017.10.09.22.34.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Oct 2017 22:34:36 -0700 (PDT) From: John Stultz To: lkml Cc: Dmitry Shmidt , Rob Herring , Mark Rutland , Frank Rowand , devicetree@vger.kernel.org, John Stultz Subject: [RFC][PATCH 3/3] of: overlay_mgr: Add ability to apply several hardware configurations Date: Mon, 9 Oct 2017 22:34:20 -0700 Message-Id: <1507613660-27236-4-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507613660-27236-1-git-send-email-john.stultz@linaro.org> References: <1507613660-27236-1-git-send-email-john.stultz@linaro.org> From: Dmitry Shmidt 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 Cc: Mark Rutland Cc: Frank Rowand Cc: Dmitry Shmidt Cc: devicetree@vger.kernel.org Signed-off-by: Dmitry Shmidt [jstultz: reworded commit message] Signed-off-by: John Stultz --- drivers/of/overlay_mgr.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) -- 2.7.4 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; }