summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-10-02 08:54:41 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-10-02 08:54:41 +0200
commitd0064495d3325cb630bc79550d60a4f4eef57e31 (patch)
tree0011e3237f2501588bc37b286253764a3e855b3c /include
parent13f1dedaeea0077554111a0075eeb24f66ceacbd (diff)
parentd0a0e807ab4449aec068b1e86dac85b687f93ea5 (diff)
downloadbarebox-d0064495d3325cb630bc79550d60a4f4eef57e31.tar.gz
barebox-d0064495d3325cb630bc79550d60a4f4eef57e31.tar.xz
Merge branch 'for-next/firmware'
Diffstat (limited to 'include')
-rw-r--r--include/firmware.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/include/firmware.h b/include/firmware.h
new file mode 100644
index 0000000000..f6f78c840c
--- /dev/null
+++ b/include/firmware.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2013 Juergen Beisert <kernel@pengutronix.de>, Pengutronix
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef FIRMWARE_H
+#define FIRMWARE_H
+
+#include <types.h>
+#include <driver.h>
+
+struct firmware_handler {
+ char *id; /* unique identifier for this firmware device */
+ char *model; /* description for this device */
+ struct device_d *dev;
+ /* called once to prepare the firmware's programming cycle */
+ int (*open)(struct firmware_handler*);
+ /* called multiple times to program the firmware with the given data */
+ int (*write)(struct firmware_handler*, const void*, size_t);
+ /* called once to finish programming cycle */
+ int (*close)(struct firmware_handler*);
+};
+
+struct firmware_mgr;
+
+int firmwaremgr_register(struct firmware_handler *);
+
+struct firmware_mgr *firmwaremgr_find(const char *);
+
+void firmwaremgr_list_handlers(void);
+
+int firmwaremgr_load_file(struct firmware_mgr *, const char *path);
+
+#endif /* FIRMWARE_H */