Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Platform data for Madera codec driver
0004  *
0005  * Copyright (C) 2016-2019 Cirrus Logic, Inc. and
0006  *                         Cirrus Logic International Semiconductor Ltd.
0007  */
0008 
0009 #ifndef MADERA_CODEC_PDATA_H
0010 #define MADERA_CODEC_PDATA_H
0011 
0012 #include <linux/types.h>
0013 
0014 #define MADERA_MAX_INPUT        6
0015 #define MADERA_MAX_MUXED_CHANNELS   4
0016 #define MADERA_MAX_OUTPUT       6
0017 #define MADERA_MAX_AIF          4
0018 #define MADERA_MAX_PDM_SPK      2
0019 #define MADERA_MAX_DSP          7
0020 
0021 /**
0022  * struct madera_codec_pdata
0023  *
0024  * @max_channels_clocked: Maximum number of channels that I2S clocks will be
0025  *            generated for. Useful when clock master for systems
0026  *            where the I2S bus has multiple data lines.
0027  * @dmic_ref:         Indicates how the MICBIAS pins have been externally
0028  *            connected to DMICs on each input. A value of 0
0029  *            indicates MICVDD and is the default. Other values are:
0030  *            For CS47L35 one of the CS47L35_DMIC_REF_xxx values
0031  *            For all other codecs one of the MADERA_DMIC_REF_xxx
0032  *            Also see the datasheet for a description of the
0033  *            INn_DMIC_SUP field.
0034  * @inmode:       Mode for the ADC inputs. One of the MADERA_INMODE_xxx
0035  *            values. Two-dimensional array
0036  *            [input_number][channel number], with four slots per
0037  *            input in the order
0038  *            [n][0]=INnAL [n][1]=INnAR [n][2]=INnBL [n][3]=INnBR
0039  * @out_mono:         For each output set the value to TRUE to indicate that
0040  *            the output is mono. [0]=OUT1, [1]=OUT2, ...
0041  * @pdm_fmt:          PDM speaker data format. See the PDM_SPKn_FMT field in
0042  *            the datasheet for a description of this value.
0043  * @pdm_mute:         PDM mute format. See the PDM_SPKn_CTRL_1 register
0044  *            in the datasheet for a description of this value.
0045  */
0046 struct madera_codec_pdata {
0047     u32 max_channels_clocked[MADERA_MAX_AIF];
0048 
0049     u32 dmic_ref[MADERA_MAX_INPUT];
0050 
0051     u32 inmode[MADERA_MAX_INPUT][MADERA_MAX_MUXED_CHANNELS];
0052 
0053     bool out_mono[MADERA_MAX_OUTPUT];
0054 
0055     u32 pdm_fmt[MADERA_MAX_PDM_SPK];
0056     u32 pdm_mute[MADERA_MAX_PDM_SPK];
0057 };
0058 
0059 #endif