From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936450AbcLTTGK (ORCPT ); Tue, 20 Dec 2016 14:06:10 -0500 Received: from mout.gmx.net ([212.227.15.18]:53582 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936227AbcLTTFw (ORCPT ); Tue, 20 Dec 2016 14:05:52 -0500 From: Heinrich Schuchardt To: Pantelis Antoniou , Rob Herring , Mark Rutland , Frank Rowand Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Heinrich Schuchardt Subject: [PATCH 0/4 v2] of/overlay: sysfs based ABI for dt overlays Date: Tue, 20 Dec 2016 20:04:51 +0100 Message-Id: <20161220190455.25115-1-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.11.0 X-Provags-ID: V03:K0:dSJWfoRdx83H3quBmnrzOIKsJ4W/ax6NY5Vk5dFp0QvLPb3rM+C RgJg8D61kfO7ysj91bSnB0ATxcrPZBNGVbzBh9gnQSsE3KPqUhCUWV2t2f7Gc4gcIBPKNgq S3L+T7Upq3AVKx4VYiZVJ2AQN9xQIpjUOR9ndTRPTljsnVb11XwfHLIMyU7tsngshS1XQiS 0k5O3sfp8AGkwBFZfGkSw== X-UI-Out-Filterresults: notjunk:1;V01:K0:CNLcT1rmaGQ=:C6t8GdznNVWOS7isPeM8PD QORappLCnU0FTECacp8epAYnJduA93RgkbszjSu1Z8MVLszxHLd+LK5S8hackR1Fr1X4SyiVT waNHy8pnj9DcZLSYJ2xJig4P6LWSQdRs9+GrBoKdXv0JDYo5/t0jnstFnxOMdSDktczi7eWt0 Maentrt+n37pmG0d8S4Ffclt1veJx6ABNrQBqMlnyDgFN+D+20gcU2Ygz4F5HUCt/ZzqGUXzQ TAAKfH0XCWL79AouAHcmSCE3+ixhZzdqm4nAbINr82OInpAwaImBs0ehHJLzLlGi+dYFp0oFo e1Fqipon+Fil/HwAPLcPKJshrvuqWh2tiHWxUUHjtZgsRDr+z49cQrYS8u3+pAgiqq90hIm3u tvmsvBNcDJKNEeG+7DdTJaVDMiHogyzp6eNwqHZdU3byv0afwI/6TmHLh1IecRcFlgxb1vLyr +7Iy+tVRw9iAGqjpjQ8IwIMw1lUJv61hZd06pJT58NJV7rNsomSgu/0Y91ni/PdT8beGKjEDB vRzZbBkBTCqB9s7GAcvETxeEx/bVhfGtKnNyR8SZWWWgcEqSxYjy9fgHmwhsrdOeQN0VRxumL fArt41cVH3VTxjg9qnvT+X+4P/Jg4IoV5reutSSmRG+CFW73HfL26wC+bChd/senUpnk9zPxG 7Wnlb3f8tiLVCYMS+mo+i4edUHE7SaGfZdiRUSSvQQEGE8BWMVli+q8rkdLqRiivPbH0YZ8s+ /zgl3+3paNJbVRv0E/Gmk+JLvwsIf1mhIBedRK+3lm2+BPtyL0VA3RyqBDo= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently the kernel only supplies an internal API for creating and destroying device tree overlays. For some boards vendor specific kernel modules exist for managing device tree overlays but they have not been upstreamed or upstreaming stalled. https://lkml.org/lkml/2015/6/12/624 https://lkml.org/lkml/2013/1/7/366 This patch series provides a sysfs based ABI for creation and destruction of dt overlays in /sys/firmware/devicetree/overlays. The following files are provided: load: This is a write only file. A string written to it is interpreted as the path to a flattened device tree overlay file. It is used to create and apply the contained overlays. loaded: This is a read only file. It provides the count of loaded overlays as a decimal number. unload: This is a write only file. If a positive number n is wrtten to this file the n most recent overlays are destroyed. If a negative number is written to this file all overlays are destroyed. Signed-off-by: Heinrich Schuchardt version 2: change sysfs path to /sys/firmware/devicetree/overlays Fix errors indicated by kbuild robot: Add missing inline attribute to of_overlay_count in patch 1. Add 'select CONFIG_OF_EARLY_FLATTREE' to Kconfig in patch 2. Change unit test cases to check new functions of_overlay_count and of_overlay_destroy_last. Heinrich Schuchardt (4): of/overlay: add API function to count and pop last of/overlay: sysfs based ABI for dt overlays of/overlay: documentation for sysfs ABI of/overlay: test count and destroy_last .../ABI/testing/sysfs-firmware-devicetree-overlays | 24 +++ Documentation/devicetree/overlay-notes.txt | 7 +- drivers/of/Kconfig | 15 ++ drivers/of/Makefile | 2 + drivers/of/base.c | 1 + drivers/of/ov_sysfs.c | 223 +++++++++++++++++++++ drivers/of/overlay.c | 50 +++++ drivers/of/unittest.c | 15 +- include/linux/of.h | 12 ++ 9 files changed, 346 insertions(+), 3 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-firmware-devicetree-overlays create mode 100644 drivers/of/ov_sysfs.c -- 2.11.0