1 // SPDX-License-Identifier: GPL-2.0
3 * Platform data for Cirrus Logic Madera codecs
5 * Copyright (C) 2015-2018 Cirrus Logic
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.
12 #ifndef MADERA_PDATA_H
13 #define MADERA_PDATA_H
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>
20 #define MADERA_MAX_MICBIAS 4
21 #define MADERA_MAX_CHILD_MICBIAS 4
23 #define MADERA_MAX_GPSW 2
27 struct madera_irqchip_pdata;
28 struct madera_codec_pdata;
31 * struct madera_pdata - Configuration data for Madera devices
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)
45 struct gpio_desc *reset;
47 struct arizona_ldo1_pdata ldo1;
48 struct arizona_micsupp_pdata micvdd;
50 unsigned int irq_flags;
53 const struct pinctrl_map *gpio_configs;
56 u32 gpsw[MADERA_MAX_GPSW];