Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
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
25struct gpio_desc;
26struct pinctrl_map;
27struct madera_codec_pdata;
28
29/**
30 * struct madera_pdata - Configuration data for Madera devices
31 *
32 * @reset: GPIO controlling /RESET (NULL = none)
33 * @ldo1: Substruct of pdata for the LDO1 regulator
34 * @micvdd: Substruct of pdata for the MICVDD regulator
35 * @irq_flags: Mode for primary IRQ (defaults to active low)
36 * @gpio_base: Base GPIO number
37 * @gpio_configs: Array of GPIO configurations (See Documentation/pinctrl.txt)
38 * @n_gpio_configs: Number of entries in gpio_configs
39 * @gpsw: General purpose switch mode setting. Depends on the external
40 * hardware connected to the switch. (See the SW1_MODE field
41 * in the datasheet for the available values for your codec)
42 */
43struct madera_pdata {
44 struct gpio_desc *reset;
45
46 struct arizona_ldo1_pdata ldo1;
47 struct arizona_micsupp_pdata micvdd;
48
49 unsigned int irq_flags;
50 int gpio_base;
51
52 const struct pinctrl_map *gpio_configs;
53 int n_gpio_configs;
54
55 u32 gpsw[MADERA_MAX_GPSW];
56};
57
58#endif