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 #include <sound/madera-pdata.h> 20 21 #define MADERA_MAX_MICBIAS 4 22 #define MADERA_MAX_CHILD_MICBIAS 4 23 24 #define MADERA_MAX_GPSW 2 25 26 struct gpio_desc; 27 struct pinctrl_map; 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 * @codec: Substruct of pdata for the ASoC codec driver 44 */ 45 struct madera_pdata { 46 struct gpio_desc *reset; 47 48 struct arizona_ldo1_pdata ldo1; 49 struct arizona_micsupp_pdata micvdd; 50 51 unsigned int irq_flags; 52 int gpio_base; 53 54 const struct pinctrl_map *gpio_configs; 55 int n_gpio_configs; 56 57 u32 gpsw[MADERA_MAX_GPSW]; 58 59 struct madera_codec_pdata codec; 60 }; 61 62 #endif 63