summaryrefslogtreecommitdiff
path: root/snd-alpx-dkms/snd-alpx/alpx_mtd.h
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2024-05-10 18:56:00 (GMT)
committerChristian Pointner <equinox@helsinki.at>2024-05-10 18:56:00 (GMT)
commitaf6bfbbd2496b1f5aa02b94caff4e6f988fa32c9 (patch)
tree45bebb68a0bf3bfc2fff1646f6fa0f4b976fba57 /snd-alpx-dkms/snd-alpx/alpx_mtd.h
parent7035064ca063fdf15669ceb790ecef1e5ed054b0 (diff)
rename package to snd-alpx-dkms
Diffstat (limited to 'snd-alpx-dkms/snd-alpx/alpx_mtd.h')
-rw-r--r--snd-alpx-dkms/snd-alpx/alpx_mtd.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/snd-alpx-dkms/snd-alpx/alpx_mtd.h b/snd-alpx-dkms/snd-alpx/alpx_mtd.h
new file mode 100644
index 0000000..1735619
--- /dev/null
+++ b/snd-alpx-dkms/snd-alpx/alpx_mtd.h
@@ -0,0 +1,48 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+* Support for Digigram AlpX PCI-e boards
+*
+* Copyright (c) 2024 Digigram Digital (info@digigram.com)
+*/
+#ifndef _ALPX_MTD_H
+#define _ALPX_MTD_H
+
+#include "alpx.h"
+#include "alpx_proc.h"
+#include <linux/mtd/partitions.h>
+
+int alpx_mtd_read(struct mtd_info *mtd, loff_t from, size_t len,
+ size_t *retlen, u_char *buf);
+int alpx_mtd_write(struct mtd_info *mtd, loff_t to, size_t len,
+ size_t *retlen, const u_char *buf);
+int alpx_mtd_probe(struct alpx_device *alpx_dev, const struct mtd_partition* partitions, u32 partitions_size);
+int alpx_mtd_remove(struct alpx_device *alpx_dev);
+
+/* Check validity of PRODUCTION area in Golden Region : Serial Number set */
+int alpx_mtd_is_golden_prod_area_valid(struct alpx_device* alpx_dev);
+
+/*replicate the USER's Production area into the GOLDEN's Production area */
+int alpx_mtd_replicate_prod_area(struct alpx_device* alpx_dev);
+
+/* Read lenght Bytes out of the flash FROM to the TO buffer using the SHARED area => length limited*/
+int alpx_mtd_read_from(struct alpx_device* alpx_dev,
+ uint32_t from,
+ unsigned char* to,
+ unsigned int length);
+
+/* Load the SHARED Area with Flash data "from" , NOT MT safe */
+int alpx_mtd_load_shared_from(struct alpx_device* alpx_dev, uint32_t from);
+
+/* Read Shared Area "at" to for "length" bytes NOT MT safe */
+int alpx_mtd_read_shared(struct alpx_device* alpx_dev,
+ uint32_t at,
+ unsigned char* to,
+ unsigned int length);
+
+/* Clean the Shared Area NOT MT safe */
+int alpx_mtd_clean_shared(struct alpx_device* alpx_dev);
+
+/* return true if the MTD is availble for the given device */
+int alpx_mtd_is_available(struct alpx_device* alpx_dev);
+
+#endif