mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] of overlay callbacks
@ 2016-02-16 18:37 Alan Tull
  2016-02-16 18:37 ` [PATCH] of/overlay: " Alan Tull
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Tull @ 2016-02-16 18:37 UTC (permalink / raw)
  To: Pantelis Antoniou, Rob Herring
  Cc: Frank Rowand, Grant Likely, devicetree, linux-kernel,
	Moritz Fischer, Alan Tull, Dinh Nguyen, Alan Tull

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-16 18:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-16 18:37 [PATCH] of overlay callbacks Alan Tull
2016-02-16 18:37 ` [PATCH] of/overlay: " Alan Tull

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®