summaryrefslogtreecommitdiffstats
path: root/include/linux/mfd/arizona/core.h
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-06-19 16:31:53 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-06-23 13:30:40 +0100
commit3cc72986947501a6a8fd12330e0963b59ed2f964 (patch)
tree1bad5a4aa1521bde7f232784e5f6ace70ec177b1 /include/linux/mfd/arizona/core.h
parentc46a019a7941ff92291cda1cc2774bf720552ad9 (diff)
downloadlinux-3cc72986947501a6a8fd12330e0963b59ed2f964.tar.bz2
mfd: arizona: Core driver
Several forthcoming Wolfson devices are based on a common platform known as Arizona allowing a great deal of reuse of driver code. This patch adds core support for these devices. In order to handle systems which do not use the generic clock API a simple wrapper for the 32kHz clock domain in the devices is provided. Once the generic clock API is widely available this code will be moved over to use that. For simplicity some WM5102 specific code is included in the core driver, the effort involved in splitting the device out isn't worth it. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'include/linux/mfd/arizona/core.h')
-rw-r--r--include/linux/mfd/arizona/core.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/include/linux/mfd/arizona/core.h b/include/linux/mfd/arizona/core.h
new file mode 100644
index 000000000000..0157d845c2ff
--- /dev/null
+++ b/include/linux/mfd/arizona/core.h
@@ -0,0 +1,102 @@
+/*
+ * Arizona MFD internals
+ *
+ * Copyright 2012 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 version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef _WM_ARIZONA_CORE_H
+#define _WM_ARIZONA_CORE_H
+
+#include <linux/interrupt.h>
+#include <linux/regmap.h>
+#include <linux/regulator/consumer.h>
+#include <linux/mfd/arizona/pdata.h>
+
+#define ARIZONA_MAX_CORE_SUPPLIES 3
+
+enum arizona_type {
+ WM5102 = 1,
+};
+
+#define ARIZONA_IRQ_GP1 0
+#define ARIZONA_IRQ_GP2 1
+#define ARIZONA_IRQ_GP3 2
+#define ARIZONA_IRQ_GP4 3
+#define ARIZONA_IRQ_GP5_FALL 4
+#define ARIZONA_IRQ_GP5_RISE 5
+#define ARIZONA_IRQ_JD_FALL 6
+#define ARIZONA_IRQ_JD_RISE 7
+#define ARIZONA_IRQ_DSP1_RAM_RDY 8
+#define ARIZONA_IRQ_DSP_IRQ1 9
+#define ARIZONA_IRQ_DSP_IRQ2 10
+#define ARIZONA_IRQ_SPK_SHUTDOWN_WARN 11
+#define ARIZONA_IRQ_SPK_SHUTDOWN 12
+#define ARIZONA_IRQ_MICDET 13
+#define ARIZONA_IRQ_HPDET 14
+#define ARIZONA_IRQ_WSEQ_DONE 15
+#define ARIZONA_IRQ_DRC2_SIG_DET 16
+#define ARIZONA_IRQ_DRC1_SIG_DET 17
+#define ARIZONA_IRQ_ASRC2_LOCK 18
+#define ARIZONA_IRQ_ASRC1_LOCK 19
+#define ARIZONA_IRQ_UNDERCLOCKED 20
+#define ARIZONA_IRQ_OVERCLOCKED 21
+#define ARIZONA_IRQ_FLL2_LOCK 22
+#define ARIZONA_IRQ_FLL1_LOCK 23
+#define ARIZONA_IRQ_CLKGEN_ERR 24
+#define ARIZONA_IRQ_CLKGEN_ERR_ASYNC 25
+#define ARIZONA_IRQ_ASRC_CFG_ERR 26
+#define ARIZONA_IRQ_AIF3_ERR 27
+#define ARIZONA_IRQ_AIF2_ERR 28
+#define ARIZONA_IRQ_AIF1_ERR 29
+#define ARIZONA_IRQ_CTRLIF_ERR 30
+#define ARIZONA_IRQ_MIXER_DROPPED_SAMPLES 31
+#define ARIZONA_IRQ_ASYNC_CLK_ENA_LOW 32
+#define ARIZONA_IRQ_SYSCLK_ENA_LOW 33
+#define ARIZONA_IRQ_ISRC1_CFG_ERR 34
+#define ARIZONA_IRQ_ISRC2_CFG_ERR 35
+#define ARIZONA_IRQ_BOOT_DONE 36
+#define ARIZONA_IRQ_DCS_DAC_DONE 37
+#define ARIZONA_IRQ_DCS_HP_DONE 38
+#define ARIZONA_IRQ_FLL2_CLOCK_OK 39
+#define ARIZONA_IRQ_FLL1_CLOCK_OK 40
+
+#define ARIZONA_NUM_IRQ 41
+
+struct arizona {
+ struct regmap *regmap;
+ struct device *dev;
+
+ enum arizona_type type;
+ unsigned int rev;
+
+ int num_core_supplies;
+ struct regulator_bulk_data core_supplies[ARIZONA_MAX_CORE_SUPPLIES];
+
+ struct arizona_pdata pdata;
+
+ int irq;
+ struct irq_domain *virq;
+ struct regmap_irq_chip_data *aod_irq_chip;
+ struct regmap_irq_chip_data *irq_chip;
+
+ struct mutex clk_lock;
+ int clk32k_ref;
+};
+
+int arizona_clk32k_enable(struct arizona *arizona);
+int arizona_clk32k_disable(struct arizona *arizona);
+
+int arizona_request_irq(struct arizona *arizona, int irq, char *name,
+ irq_handler_t handler, void *data);
+void arizona_free_irq(struct arizona *arizona, int irq, void *data);
+int arizona_set_irq_wake(struct arizona *arizona, int irq, int on);
+
+int wm5102_patch(struct arizona *arizona);
+
+#endif