summaryrefslogtreecommitdiff
path: root/cleopatre/linux-2.6.25.10-spc300/include/linux
diff options
context:
space:
mode:
authorYacine Belkadi2012-06-13 16:45:02 +0200
committerYacine Belkadi2012-06-14 08:37:00 +0200
commit0f8bd5942370483aa76b13fb86dc535656c2bbc3 (patch)
tree1125306d8e2c1ba46e31f29a461056c6ca0e9da7 /cleopatre/linux-2.6.25.10-spc300/include/linux
parente592cc445170cabfe1137111fc95d0801bf293ba (diff)
parente16ebfca306ed5923faaf34bf67429506df8ee4a (diff)
Merge branch 't3082-afe_api_change-p1' into t3082-afe_api_change-eoc-p1
Diffstat (limited to 'cleopatre/linux-2.6.25.10-spc300/include/linux')
-rw-r--r--cleopatre/linux-2.6.25.10-spc300/include/linux/afe.h54
1 files changed, 52 insertions, 2 deletions
diff --git a/cleopatre/linux-2.6.25.10-spc300/include/linux/afe.h b/cleopatre/linux-2.6.25.10-spc300/include/linux/afe.h
index 42f300a16a..59de98f0e9 100644
--- a/cleopatre/linux-2.6.25.10-spc300/include/linux/afe.h
+++ b/cleopatre/linux-2.6.25.10-spc300/include/linux/afe.h
@@ -25,8 +25,58 @@
#ifdef __KERNEL__
-int afe_read_reg(uint8_t reg, uint8_t *val);
-int afe_write_reg(uint8_t reg, uint8_t val);
+/**
+ * struct afe - An Analog Front End (AFE).
+ * @read: read from a register of the AFE.
+ * @write: write to a register of the AFE.
+ */
+struct afe {
+ int (*read)(uint8_t reg, uint8_t *val);
+ int (*write)(uint8_t reg, uint8_t val);
+};
+
+/**
+ * afe_register - Register an AFE.
+ * @afe: the AFE.
+ *
+ * Returns 0 on success.
+ */
+int afe_register(struct afe *afe);
+
+/**
+ * afe_unregister - Unregister an AFE.
+ * @afe: the AFE.
+ *
+ * Returns 0 on success.
+ */
+int afe_unregister(struct afe *afe);
+
+/**
+ * afe_get - Get the AFE.
+ *
+ * Returns the AFE, if one is registered. NULL, otherwise.
+ */
+struct afe* afe_get(void);
+
+/**
+ * afe_read - Read a register of the AFE.
+ * @afe: AFE.
+ * @reg: register.
+ * @val: [out]value of the register.
+ *
+ * Returns 0, on success. -EFAULT, on error.
+ */
+int afe_read(struct afe *afe, uint8_t reg, uint8_t *val);
+
+/**
+ * afe_write - Write to a register of the AFE.
+ * @afe: AFE.
+ * @reg: register.
+ * @val: value to write.
+ *
+ * Returns 0, on success. -EFAULT, on error.
+ */
+int afe_write(struct afe *afe, uint8_t reg, uint8_t val);
#endif /* __KERNEL__ */