Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ */
0002 /*
0003  * Core MFD defines for ATC260x PMICs
0004  *
0005  * Copyright (C) 2019 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
0006  * Copyright (C) 2020 Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
0007  */
0008 
0009 #ifndef __LINUX_MFD_ATC260X_CORE_H
0010 #define __LINUX_MFD_ATC260X_CORE_H
0011 
0012 #include <linux/mfd/atc260x/atc2603c.h>
0013 #include <linux/mfd/atc260x/atc2609a.h>
0014 
0015 enum atc260x_type {
0016     ATC2603A = 0,
0017     ATC2603C,
0018     ATC2609A,
0019 };
0020 
0021 enum atc260x_ver {
0022     ATC260X_A = 0,
0023     ATC260X_B,
0024     ATC260X_C,
0025     ATC260X_D,
0026     ATC260X_E,
0027     ATC260X_F,
0028     ATC260X_G,
0029     ATC260X_H,
0030 };
0031 
0032 struct atc260x {
0033     struct device *dev;
0034 
0035     struct regmap *regmap;
0036     const struct regmap_irq_chip *regmap_irq_chip;
0037     struct regmap_irq_chip_data *irq_data;
0038 
0039     struct mutex *regmap_mutex; /* mutex for custom regmap locking */
0040 
0041     const struct mfd_cell *cells;
0042     int nr_cells;
0043     int irq;
0044 
0045     enum atc260x_type ic_type;
0046     enum atc260x_ver ic_ver;
0047     const char *type_name;
0048     unsigned int rev_reg;
0049 
0050     const struct atc260x_init_regs *init_regs; /* regs for device init */
0051 };
0052 
0053 struct regmap_config;
0054 
0055 int atc260x_match_device(struct atc260x *atc260x, struct regmap_config *regmap_cfg);
0056 int atc260x_device_probe(struct atc260x *atc260x);
0057 
0058 #endif /* __LINUX_MFD_ATC260X_CORE_H */