1472e5df0SCharles Keepax /* SPDX-License-Identifier: GPL-2.0-only */ 22735b683SRichard Fitzgerald /* 32735b683SRichard Fitzgerald * Platform data for Madera codec driver 42735b683SRichard Fitzgerald * 52735b683SRichard Fitzgerald * Copyright (C) 2016-2019 Cirrus Logic, Inc. and 62735b683SRichard Fitzgerald * Cirrus Logic International Semiconductor Ltd. 72735b683SRichard Fitzgerald */ 82735b683SRichard Fitzgerald 92735b683SRichard Fitzgerald #ifndef MADERA_CODEC_PDATA_H 102735b683SRichard Fitzgerald #define MADERA_CODEC_PDATA_H 112735b683SRichard Fitzgerald 12*dcc165d6SAndy Shevchenko #include <linux/types.h> 132735b683SRichard Fitzgerald 142735b683SRichard Fitzgerald #define MADERA_MAX_INPUT 6 152735b683SRichard Fitzgerald #define MADERA_MAX_MUXED_CHANNELS 4 162735b683SRichard Fitzgerald #define MADERA_MAX_OUTPUT 6 172735b683SRichard Fitzgerald #define MADERA_MAX_AIF 4 182735b683SRichard Fitzgerald #define MADERA_MAX_PDM_SPK 2 192735b683SRichard Fitzgerald #define MADERA_MAX_DSP 7 202735b683SRichard Fitzgerald 212735b683SRichard Fitzgerald /** 222735b683SRichard Fitzgerald * struct madera_codec_pdata 232735b683SRichard Fitzgerald * 242735b683SRichard Fitzgerald * @max_channels_clocked: Maximum number of channels that I2S clocks will be 252735b683SRichard Fitzgerald * generated for. Useful when clock master for systems 262735b683SRichard Fitzgerald * where the I2S bus has multiple data lines. 272735b683SRichard Fitzgerald * @dmic_ref: Indicates how the MICBIAS pins have been externally 282735b683SRichard Fitzgerald * connected to DMICs on each input. A value of 0 292735b683SRichard Fitzgerald * indicates MICVDD and is the default. Other values are: 302735b683SRichard Fitzgerald * For CS47L35 one of the CS47L35_DMIC_REF_xxx values 312735b683SRichard Fitzgerald * For all other codecs one of the MADERA_DMIC_REF_xxx 322735b683SRichard Fitzgerald * Also see the datasheet for a description of the 332735b683SRichard Fitzgerald * INn_DMIC_SUP field. 342735b683SRichard Fitzgerald * @inmode: Mode for the ADC inputs. One of the MADERA_INMODE_xxx 352735b683SRichard Fitzgerald * values. Two-dimensional array 362735b683SRichard Fitzgerald * [input_number][channel number], with four slots per 372735b683SRichard Fitzgerald * input in the order 382735b683SRichard Fitzgerald * [n][0]=INnAL [n][1]=INnAR [n][2]=INnBL [n][3]=INnBR 392735b683SRichard Fitzgerald * @out_mono: For each output set the value to TRUE to indicate that 402735b683SRichard Fitzgerald * the output is mono. [0]=OUT1, [1]=OUT2, ... 412735b683SRichard Fitzgerald * @pdm_fmt: PDM speaker data format. See the PDM_SPKn_FMT field in 422735b683SRichard Fitzgerald * the datasheet for a description of this value. 432735b683SRichard Fitzgerald * @pdm_mute: PDM mute format. See the PDM_SPKn_CTRL_1 register 442735b683SRichard Fitzgerald * in the datasheet for a description of this value. 452735b683SRichard Fitzgerald */ 462735b683SRichard Fitzgerald struct madera_codec_pdata { 472735b683SRichard Fitzgerald u32 max_channels_clocked[MADERA_MAX_AIF]; 482735b683SRichard Fitzgerald 492735b683SRichard Fitzgerald u32 dmic_ref[MADERA_MAX_INPUT]; 502735b683SRichard Fitzgerald 512735b683SRichard Fitzgerald u32 inmode[MADERA_MAX_INPUT][MADERA_MAX_MUXED_CHANNELS]; 522735b683SRichard Fitzgerald 532735b683SRichard Fitzgerald bool out_mono[MADERA_MAX_OUTPUT]; 542735b683SRichard Fitzgerald 552735b683SRichard Fitzgerald u32 pdm_fmt[MADERA_MAX_PDM_SPK]; 562735b683SRichard Fitzgerald u32 pdm_mute[MADERA_MAX_PDM_SPK]; 572735b683SRichard Fitzgerald }; 582735b683SRichard Fitzgerald 592735b683SRichard Fitzgerald #endif 60