[PATCH] of overlay callbacks

From: Alan Tull
Date: Tue Feb 16 2016 - 13:39:51 EST


Adding functionality for registering callbacks with the
of overlay code.

When DT overlays are being added, some drivers/subsystems
will want to know about the changes before they go into the
live tree. Similarly there is a need for post-remove
callbacks.

Each handler is registered with a of_device_id. When
an overlay target matches a handler's id, the handler
gets called.

The following 4 cases are handled: pre-apply, post-apply,
pre-remove, and post-remove.

This is useful for me as I can apply an FPGA overlay that
contains the file name that I want to program the FPGA with
and the child device information. My FPGA code gets the
pre-apply callback and attempts to program the FPGA. If
the programming failed, the callback can return an error
and prevent the overlay from being applied.

I've tested this with code that uses pre-apply and post-remove
handlers. Tested on next-20160216 and Pantelis' current
bbb-overlays branch.

Alan Tull (1):
of/overlay: of overlay callbacks

drivers/of/overlay.c | 90 +++++++++++++++++++++++++++++++++++++++++++++++++-
include/linux/of.h | 31 +++++++++++++++++
2 files changed, 120 insertions(+), 1 deletion(-)

--
1.7.9.5