Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ */
0002 /*
0003  * Definitions for DA9063 MFD driver
0004  *
0005  * Copyright 2012 Dialog Semiconductor Ltd.
0006  *
0007  * Author: Michal Hajduk, Dialog Semiconductor
0008  * Author: Krystian Garbaciak, Dialog Semiconductor
0009  */
0010 
0011 #ifndef __MFD_DA9063_CORE_H__
0012 #define __MFD_DA9063_CORE_H__
0013 
0014 #include <linux/interrupt.h>
0015 #include <linux/mfd/da9063/registers.h>
0016 
0017 /* DA9063 modules */
0018 #define DA9063_DRVNAME_CORE     "da9063-core"
0019 #define DA9063_DRVNAME_REGULATORS   "da9063-regulators"
0020 #define DA9063_DRVNAME_LEDS     "da9063-leds"
0021 #define DA9063_DRVNAME_WATCHDOG     "da9063-watchdog"
0022 #define DA9063_DRVNAME_HWMON        "da9063-hwmon"
0023 #define DA9063_DRVNAME_ONKEY        "da9063-onkey"
0024 #define DA9063_DRVNAME_RTC      "da9063-rtc"
0025 #define DA9063_DRVNAME_VIBRATION    "da9063-vibration"
0026 
0027 #define PMIC_CHIP_ID_DA9063     0x61
0028 
0029 enum da9063_type {
0030     PMIC_TYPE_DA9063 = 0,
0031     PMIC_TYPE_DA9063L,
0032 };
0033 
0034 enum da9063_variant_codes {
0035     PMIC_DA9063_AD = 0x3,
0036     PMIC_DA9063_BB = 0x5,
0037     PMIC_DA9063_CA = 0x6,
0038     PMIC_DA9063_DA = 0x7,
0039     PMIC_DA9063_EA = 0x8,
0040 };
0041 
0042 /* Interrupts */
0043 enum da9063_irqs {
0044     DA9063_IRQ_ONKEY = 0,
0045     DA9063_IRQ_ALARM,
0046     DA9063_IRQ_TICK,
0047     DA9063_IRQ_ADC_RDY,
0048     DA9063_IRQ_SEQ_RDY,
0049     DA9063_IRQ_WAKE,
0050     DA9063_IRQ_TEMP,
0051     DA9063_IRQ_COMP_1V2,
0052     DA9063_IRQ_LDO_LIM,
0053     DA9063_IRQ_REG_UVOV,
0054     DA9063_IRQ_DVC_RDY,
0055     DA9063_IRQ_VDD_MON,
0056     DA9063_IRQ_WARN,
0057     DA9063_IRQ_GPI0,
0058     DA9063_IRQ_GPI1,
0059     DA9063_IRQ_GPI2,
0060     DA9063_IRQ_GPI3,
0061     DA9063_IRQ_GPI4,
0062     DA9063_IRQ_GPI5,
0063     DA9063_IRQ_GPI6,
0064     DA9063_IRQ_GPI7,
0065     DA9063_IRQ_GPI8,
0066     DA9063_IRQ_GPI9,
0067     DA9063_IRQ_GPI10,
0068     DA9063_IRQ_GPI11,
0069     DA9063_IRQ_GPI12,
0070     DA9063_IRQ_GPI13,
0071     DA9063_IRQ_GPI14,
0072     DA9063_IRQ_GPI15,
0073 };
0074 
0075 struct da9063 {
0076     /* Device */
0077     struct device   *dev;
0078     enum da9063_type type;
0079     unsigned char   variant_code;
0080     unsigned int    flags;
0081 
0082     /* Control interface */
0083     struct regmap   *regmap;
0084 
0085     /* Interrupts */
0086     int     chip_irq;
0087     unsigned int    irq_base;
0088     struct regmap_irq_chip_data *regmap_irq;
0089 };
0090 
0091 int da9063_device_init(struct da9063 *da9063, unsigned int irq);
0092 int da9063_irq_init(struct da9063 *da9063);
0093 
0094 #endif /* __MFD_DA9063_CORE_H__ */