xref: /openbmc/linux/include/linux/mfd/madera/pdata.h (revision 762f99f4f3cb41a775b5157dd761217beba65873)
1d6871a73SCharles Keepax /* SPDX-License-Identifier: GPL-2.0-only */
216b27467SRichard Fitzgerald /*
316b27467SRichard Fitzgerald  * Platform data for Cirrus Logic Madera codecs
416b27467SRichard Fitzgerald  *
516b27467SRichard Fitzgerald  * Copyright (C) 2015-2018 Cirrus Logic
616b27467SRichard Fitzgerald  */
716b27467SRichard Fitzgerald 
816b27467SRichard Fitzgerald #ifndef MADERA_PDATA_H
916b27467SRichard Fitzgerald #define MADERA_PDATA_H
1016b27467SRichard Fitzgerald 
1116b27467SRichard Fitzgerald #include <linux/kernel.h>
1216b27467SRichard Fitzgerald #include <linux/regulator/arizona-ldo1.h>
1316b27467SRichard Fitzgerald #include <linux/regulator/arizona-micsupp.h>
1416b27467SRichard Fitzgerald #include <linux/regulator/machine.h>
152735b683SRichard Fitzgerald #include <sound/madera-pdata.h>
1616b27467SRichard Fitzgerald 
1716b27467SRichard Fitzgerald #define MADERA_MAX_MICBIAS		4
1816b27467SRichard Fitzgerald #define MADERA_MAX_CHILD_MICBIAS	4
1916b27467SRichard Fitzgerald 
2016b27467SRichard Fitzgerald #define MADERA_MAX_GPSW			2
2116b27467SRichard Fitzgerald 
2216b27467SRichard Fitzgerald struct gpio_desc;
2316b27467SRichard Fitzgerald struct pinctrl_map;
2416b27467SRichard Fitzgerald 
2516b27467SRichard Fitzgerald /**
2616b27467SRichard Fitzgerald  * struct madera_pdata - Configuration data for Madera devices
2716b27467SRichard Fitzgerald  *
2816b27467SRichard Fitzgerald  * @reset:	    GPIO controlling /RESET (NULL = none)
2916b27467SRichard Fitzgerald  * @ldo1:	    Substruct of pdata for the LDO1 regulator
3016b27467SRichard Fitzgerald  * @micvdd:	    Substruct of pdata for the MICVDD regulator
3116b27467SRichard Fitzgerald  * @irq_flags:	    Mode for primary IRQ (defaults to active low)
3216b27467SRichard Fitzgerald  * @gpio_base:	    Base GPIO number
336987fd42SOtto Sabart  * @gpio_configs:   Array of GPIO configurations (See
34*4b0c9948SMauro Carvalho Chehab  *		    Documentation/driver-api/pin-control.rst)
3516b27467SRichard Fitzgerald  * @n_gpio_configs: Number of entries in gpio_configs
3616b27467SRichard Fitzgerald  * @gpsw:	    General purpose switch mode setting. Depends on the external
3716b27467SRichard Fitzgerald  *		    hardware connected to the switch. (See the SW1_MODE field
3816b27467SRichard Fitzgerald  *		    in the datasheet for the available values for your codec)
392735b683SRichard Fitzgerald  * @codec:	    Substruct of pdata for the ASoC codec driver
4016b27467SRichard Fitzgerald  */
4116b27467SRichard Fitzgerald struct madera_pdata {
4216b27467SRichard Fitzgerald 	struct gpio_desc *reset;
4316b27467SRichard Fitzgerald 
4416b27467SRichard Fitzgerald 	struct arizona_ldo1_pdata ldo1;
4516b27467SRichard Fitzgerald 	struct arizona_micsupp_pdata micvdd;
4616b27467SRichard Fitzgerald 
4716b27467SRichard Fitzgerald 	unsigned int irq_flags;
4816b27467SRichard Fitzgerald 	int gpio_base;
4916b27467SRichard Fitzgerald 
5016b27467SRichard Fitzgerald 	const struct pinctrl_map *gpio_configs;
5116b27467SRichard Fitzgerald 	int n_gpio_configs;
5216b27467SRichard Fitzgerald 
5316b27467SRichard Fitzgerald 	u32 gpsw[MADERA_MAX_GPSW];
542735b683SRichard Fitzgerald 
552735b683SRichard Fitzgerald 	struct madera_codec_pdata codec;
5616b27467SRichard Fitzgerald };
5716b27467SRichard Fitzgerald 
5816b27467SRichard Fitzgerald #endif
59