1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Platform data for Cirrus Logic Madera codecs
4  *
5  * Copyright (C) 2015-2018 Cirrus Logic
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by the
9  * Free Software Foundation; version 2.
10  */
11 
12 #ifndef MADERA_PDATA_H
13 #define MADERA_PDATA_H
14 
15 #include <linux/kernel.h>
16 #include <linux/regulator/arizona-ldo1.h>
17 #include <linux/regulator/arizona-micsupp.h>
18 #include <linux/regulator/machine.h>
19 
20 #define MADERA_MAX_MICBIAS		4
21 #define MADERA_MAX_CHILD_MICBIAS	4
22 
23 #define MADERA_MAX_GPSW			2
24 
25 struct gpio_desc;
26 struct pinctrl_map;
27 struct madera_irqchip_pdata;
28 struct madera_codec_pdata;
29 
30 /**
31  * struct madera_pdata - Configuration data for Madera devices
32  *
33  * @reset:	    GPIO controlling /RESET (NULL = none)
34  * @ldo1:	    Substruct of pdata for the LDO1 regulator
35  * @micvdd:	    Substruct of pdata for the MICVDD regulator
36  * @irq_flags:	    Mode for primary IRQ (defaults to active low)
37  * @gpio_base:	    Base GPIO number
38  * @gpio_configs:   Array of GPIO configurations (See Documentation/pinctrl.txt)
39  * @n_gpio_configs: Number of entries in gpio_configs
40  * @gpsw:	    General purpose switch mode setting. Depends on the external
41  *		    hardware connected to the switch. (See the SW1_MODE field
42  *		    in the datasheet for the available values for your codec)
43  */
44 struct madera_pdata {
45 	struct gpio_desc *reset;
46 
47 	struct arizona_ldo1_pdata ldo1;
48 	struct arizona_micsupp_pdata micvdd;
49 
50 	unsigned int irq_flags;
51 	int gpio_base;
52 
53 	const struct pinctrl_map *gpio_configs;
54 	int n_gpio_configs;
55 
56 	u32 gpsw[MADERA_MAX_GPSW];
57 };
58 
59 #endif
60