mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

Add a codec driver for the Cirrus Logic CS48L32 audio DSP. The CS48L32 is a low-power audio DSP with microphone inputs for "Always on Voice" (i.e. voice trigger) and voice command processing. It has a programmable Halo Core DSP and a variety of power-efficient fixed-function audio processors, with configurable digital mixing and routing. There are two I2S/TDM audio serial ports. Four analogue inputs are available through IN1. These feed into a 2-channel ADC through an analogue mux. There is an ALSA control for each IN1 ADC channel to select which analogue input to use. A dedicated digital mic (DMIC) PDM input is available on IN2. Two PDM outputs can feed DMIC inputs on another codec or a host DMIC/PDM input. An on-board regulator provides a power supply or bias voltage to attached microphones. Three switchable MICBIAS outputs are fed from this allowing only the microphone in use to be powered-up. There are DAPM widgets for these outputs: MICBIAS1A, MICBIAS1B and MICBIAS1C. The machine driver must create a DAPM route from the required MICBIAS1x widget to the INn input widgets to make the MICBIAS switch on when the audio input is powered-up. For example if the microphone feeding CS48L32 pin IN1LN_1 is powered from MICBIAS1A, the machine driver must create the path: (sink) IN1LN_1 <----- (source) MICBIAS1A Co-developed-by: Stuart Henderson <stuarth@opensource.cirrus.com> Signed-off-by: Stuart Henderson <stuarth@opensource.cirrus.com> Co-developed-by: Qi Zhou <qi.zhou@cirrus.com> Signed-off-by: Qi Zhou <qi.zhou@cirrus.com> Co-developed-by: Piotr Stankiewicz <piotrs@opensource.cirrus.com> Signed-off-by: Piotr Stankiewicz <piotrs@opensource.cirrus.com> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20250415115016.505777-3-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
47 lines
1.3 KiB
C
47 lines
1.3 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Register definitions for Cirrus Logic CS48L32
|
|
*
|
|
* Copyright (C) 2017-2018, 2020, 2022, 2025 Cirrus Logic, Inc. and
|
|
* Cirrus Logic International Semiconductor Ltd.
|
|
*/
|
|
|
|
#ifndef CS48L32_H
|
|
#define CS48L32_H
|
|
|
|
/* pll_id for snd_soc_component_set_pll() */
|
|
#define CS48L32_FLL1_REFCLK 1
|
|
|
|
/* source for snd_soc_component_set_pll() */
|
|
#define CS48L32_FLL_SRC_NONE -1
|
|
#define CS48L32_FLL_SRC_MCLK1 0
|
|
#define CS48L32_FLL_SRC_PDMCLK 5
|
|
#define CS48L32_FLL_SRC_ASP1_BCLK 8
|
|
#define CS48L32_FLL_SRC_ASP2_BCLK 9
|
|
#define CS48L32_FLL_SRC_ASP1_FSYNC 12
|
|
#define CS48L32_FLL_SRC_ASP2_FSYNC 13
|
|
|
|
/* clk_id for snd_soc_component_set_sysclk() and snd_soc_dai_set_sysclk() */
|
|
#define CS48L32_CLK_SYSCLK_1 1
|
|
#define CS48L32_CLK_SYSCLK_2 2
|
|
#define CS48L32_CLK_SYSCLK_3 3
|
|
#define CS48L32_CLK_SYSCLK_4 4
|
|
#define CS48L32_CLK_DSPCLK 7
|
|
#define CS48L32_CLK_PDM_FLLCLK 13
|
|
|
|
/* source for snd_soc_component_set_sysclk() */
|
|
#define CS48L32_CLK_SRC_MCLK1 0x0
|
|
#define CS48L32_CLK_SRC_FLL1 0x4
|
|
#define CS48L32_CLK_SRC_ASP1_BCLK 0x8
|
|
#define CS48L32_CLK_SRC_ASP2_BCLK 0x9
|
|
|
|
struct cs48l32 {
|
|
struct regmap *regmap;
|
|
struct device *dev;
|
|
struct gpio_desc *reset_gpio;
|
|
struct clk *mclk1;
|
|
struct regulator_bulk_data core_supplies[2];
|
|
struct regulator *vdd_d;
|
|
int irq;
|
|
};
|
|
#endif
|