firmware/br-ext-chip-allwinner/board/v83x/kernel/patches/00000-include_linux_mfd_ac1...

45 lines
1.3 KiB
Diff

diff -drupN a/include/linux/mfd/ac100-mfd.h b/include/linux/mfd/ac100-mfd.h
--- a/include/linux/mfd/ac100-mfd.h 1970-01-01 03:00:00.000000000 +0300
+++ b/include/linux/mfd/ac100-mfd.h 2022-06-12 05:28:14.000000000 +0300
@@ -0,0 +1,40 @@
+/*
+ * include/linux/mfd/ac100/core.h -- Core interface for AC100
+ *
+ * Copyright 2009 Wolfson Microelectronics PLC.
+ *
+ * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ */
+
+#ifndef __MFD_AC100_CORE_H__
+#define __MFD_AC100_CORE_H__
+
+#include <linux/mutex.h>
+#include <linux/interrupt.h>
+
+/* GPIOs in the chip are numbered from 1-11 */
+#define AC100_IRQ_GPIO(x) (x + AC100_IRQ_TEMP_WARN)
+
+struct ac100 {
+ struct mutex irq_lock;
+
+ struct device *dev;
+ struct regmap *regmap;
+ int irq;
+};
+
+/* Device I/O API */
+int ac100_reg_read(struct ac100 *ac100, unsigned short reg);
+int ac100_reg_write(struct ac100 *ac100, unsigned short reg,
+ unsigned short val);
+
+int ac100_set_bits(struct ac100 *ac100, unsigned short reg,
+ unsigned short mask, unsigned short val);
+
+#endif