Cirrus Logic CS35L41 Amplifier
Subsystems (4)
cover Cirrus Logic CS35L41 Amplifier
ASoC driver and devicetree documentation for a new Cirrus Logic amplifier CS35L41
David Rhodes (2):
ASoC: cs35l41: CS35L41 Boosted Smart Amplifier
ASoC: cs35l41: Add bindings for CS35L41
.../devicetree/bindings/sound/cs35l41.yaml | 395 ++++ include/sound/cs35l41.h | 83 + sound/soc/codecs/Kconfig | 12 + sound/soc/codecs/Makefile | 4 + sound/soc/codecs/cs35l41-i2c.c | 126 ++ sound/soc/codecs/cs35l41-spi.c | 148 ++ sound/soc/codecs/cs35l41-tables.c | 688 +++++++ sound/soc/codecs/cs35l41.c | 1758 +++++++++++++++++ sound/soc/codecs/cs35l41.h | 755 +++++++ 9 files changed, 3969 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/cs35l41.yaml create mode 100644 include/sound/cs35l41.h create mode 100644 sound/soc/codecs/cs35l41-i2c.c create mode 100644 sound/soc/codecs/cs35l41-spi.c create mode 100644 sound/soc/codecs/cs35l41-tables.c create mode 100644 sound/soc/codecs/cs35l41.c create mode 100644 sound/soc/codecs/cs35l41.h
Signature · 1 line
2.25.1
PATCH 1/2 ASoC: cs35l41: CS35L41 Boosted Smart Amplifier
SoC Audio driver for the Cirrus Logic CS35L41 amplifier
--- include/sound/cs35l41.h | 83 ++ sound/soc/codecs/Kconfig | 12 + sound/soc/codecs/Makefile | 4 + sound/soc/codecs/cs35l41-i2c.c | 126 +++ sound/soc/codecs/cs35l41-spi.c | 148 +++ sound/soc/codecs/cs35l41-tables.c | 688 +++++++++++ sound/soc/codecs/cs35l41.c | 1758 +++++++++++++++++++++++++++++ sound/soc/codecs/cs35l41.h | 755 +++++++++++++ 8 files changed, 3574 insertions(+) create mode 100644 include/sound/cs35l41.h create mode 100644 sound/soc/codecs/cs35l41-i2c.c create mode 100644 sound/soc/codecs/cs35l41-spi.c create mode 100644 sound/soc/codecs/cs35l41-tables.c create mode 100644 sound/soc/codecs/cs35l41.c create mode 100644 sound/soc/codecs/cs35l41.h
include/sound/cs35l41.h new file +83 -0
@@ -0,0 +1,83 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +/* +* linux/sound/cs35l41.h -- Platform data for CS35L41 +* +* Copyright (c) 2017-2021 Cirrus Logic Inc. +* +* Author: David Rhodes <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef __CS35L41_H +#define __CS35L41_H + +enum cs35l41_clk_ids { +CS35L41_CLKID_SCLK =0 , +CS35L41_CLKID_LRCLK =1 , +CS35L41_CLKID_MCLK =4 , +}; + +struct cs35l41_classh_cfg { +bool classh_bst_override; +bool classh_algo_enable; +int classh_bst_max_limit; +int classh_mem_depth; +int classh_release_rate; +int classh_headroom; +int classh_wk_fet_delay; +int classh_wk_fet_thld; +}; + +struct cs35l41_irq_cfg { +bool irq_pol_inv; +bool irq_out_en; +int irq_src_sel; +}; + +struct cs35l41_platform_data { +bool sclk_frc; +bool lrclk_frc; +bool right_channel; +bool amp_gain_zc; +bool dsp_ng_enable; +bool invert_pcm; +int bst_ind; +int bst_vctrl; +int bst_ipk; +int bst_cap; +int temp_warn_thld; +int dsp_ng_pcm_thld; +int dsp_ng_delay; +unsigned int hw_ng_sel; +unsigned int hw_ng_delay; +unsigned int hw_ng_thld; +int dout_hiz; +struct cs35l41_irq_cfg irq_config1; +struct cs35l41_irq_cfg irq_config2; +struct cs35l41_classh_cfg classh_config; +}; + +struct cs35l41_private { +struct snd_soc_codec *codec; +struct cs35l41_platform_data pdata; +struct device *dev; +struct regmap *regmap; +struct regulator_bulk_data supplies[2 ]; +int num_supplies; +int irq; +bool i2s_mode; +/* GPIO for /RST */ +struct gpio_desc *reset_gpio; +void (*otp_setup)(struct cs35l41_private *cs35l41,bool is_pre_setup, +unsigned int *freq); +}; + +int cs35l41_probe (struct cs35l41_private *cs35l41, +struct cs35l41_platform_data *pdata); +int cs35l41_remove (struct cs35l41_private *cs35l41); + +#endif /* __CS35L41_H */
sound/soc/codecs/Kconfig +12 -0
@@ -61,6 +61,8 @@ config SND_SOC_ALL_CODECS imply SND_SOC_CS35L34 imply SND_SOC_CS35L35 imply SND_SOC_CS35L36 + imply SND_SOC_CS35L41_SPI + imply SND_SOC_CS35L41_I2C imply SND_SOC_CS42L42 imply SND_SOC_CS42L51_I2C imply SND_SOC_CS42L52
@@ -597,6 +599,16 @@ config SND_SOC_CS35L36 tristate "Cirrus Logic CS35L36 CODEC" depends on I2C +config SND_SOC_CS35L41_SPI + tristate "Cirrus Logic CS35L41 CODEC (SPI)" + depends on SPI_MASTER + select REGMAP_SPI + +config SND_SOC_CS35L41_I2C + tristate "Cirrus Logic CS35L41 CODEC (I2C)" + depends on I2C + select REGMAP_I2C + config SND_SOC_CS42L42 tristate "Cirrus Logic CS42L42 CODEC" depends on I2C
sound/soc/codecs/Makefile +4 -0
@@ -54,6 +54,8 @@ snd-soc-cs35l33-objs := cs35l33.o snd-soc-cs35l34-objs := cs35l34.o snd-soc-cs35l35-objs := cs35l35.o snd-soc-cs35l36-objs := cs35l36.o +snd-soc-cs35l41-spi-objs := cs35l41-spi.o cs35l41.o cs35l41-tables.o +snd-soc-cs35l41-i2c-objs := cs35l41-i2c.o cs35l41.o cs35l41-tables.o snd-soc-cs42l42-objs := cs42l42.o snd-soc-cs42l51-objs := cs42l51.o snd-soc-cs42l51-i2c-objs := cs42l51-i2c.o
@@ -379,6 +381,8 @@ obj-$(CONFIG_SND_SOC_CS35L33) += snd-soc-cs35l33.o obj-$(CONFIG_SND_SOC_CS35L34) += snd-soc-cs35l34.o obj-$(CONFIG_SND_SOC_CS35L35) += snd-soc-cs35l35.o obj-$(CONFIG_SND_SOC_CS35L36) += snd-soc-cs35l36.o +obj-$(CONFIG_SND_SOC_CS35L41_SPI) += snd-soc-cs35l41-spi.o +obj-$(CONFIG_SND_SOC_CS35L41_I2C) += snd-soc-cs35l41-i2c.o obj-$(CONFIG_SND_SOC_CS42L42) += snd-soc-cs42l42.o obj-$(CONFIG_SND_SOC_CS42L51) += snd-soc-cs42l51.o obj-$(CONFIG_SND_SOC_CS42L51_I2C) += snd-soc-cs42l51-i2c.o
sound/soc/codecs/cs35l41-i2c.c new file +126 -0
126 lines not on this page · raw message
sound/soc/codecs/cs35l41-spi.c new file +148 -0
148 lines not on this page · raw message
sound/soc/codecs/cs35l41-tables.c new file +688 -0
688 lines not on this page · raw message
sound/soc/codecs/cs35l41.c new file +1758 -0
1,758 lines not on this page · raw message
sound/soc/codecs/cs35l41.h new file +755 -0
157 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.25.1
Part of the diff is not shown here. View the raw message.
Re: [PATCH 1/2] ASoC: cs35l41: CS35L41 Boosted Smart Amplifier
Quoted 8 lines · David Rhodes
SoC Audio driver for the Cirrus Logic CS35L41 amplifier
Signed-off-by David Rhodes <[email protected]>---
sound/soc/codecs/cs35l41-spi.c new file +4
-0+static void cs35l41_spi_otp_setup (struct cs35l41_private *cs35l41, +bool is_pre_setup,unsigned int *freq) +{ +struct spi_device *spi =NULL ;
sound/soc/codecs/cs35l41-spi.c line 69
Quoted 10 lines
sound/soc/codecs/cs35l41-spi.c new file +10
-0+u32 orig_spi_freq; + + spi =to_spi_device (cs35l41->dev); + +if (!spi) +return ; + +if (is_pre_setup) { + orig_spi_freq = spi->max_speed_hz; + spi->max_speed_hz =CS35L41_SPI_MAX_FREQ_OTP ;
We probably need special handling for the case spi->max_speed_hz is smaller than CS35L41_SPI_MAX_FREQ_OTP here, in that case this code would increase the SPI speed. If the max speed was set lower that is probably because something other than the amp in the system limits it. Track length or the host or something.
Quoted 7 lines
sound/soc/codecs/cs35l41-spi.c new file +7
-0+spi_setup (spi); + *freq = orig_spi_freq; + }else { + spi->max_speed_hz = *freq; +spi_setup (spi); + } +}
...
Quoted 31 lines
sound/soc/codecs/cs35l41-tables.c new file +31
-0+const struct reg_default cs35l41_reg[CS35L41_MAX_CACHE_REG ] = { + {CS35L41_TEST_KEY_CTL ,0x00000000 }, + {CS35L41_USER_KEY_CTL ,0x00000000 }, + {CS35L41_OTP_CTRL0 ,0x00006418 }, + {CS35L41_OTP_CTRL1 ,0x00000000 }, + {CS35L41_OTP_CTRL3 ,0x00000000 }, + {CS35L41_OTP_CTRL4 ,0x00000000 }, + {CS35L41_OTP_CTRL5 ,0x00000030 }, + {CS35L41_OTP_CTRL6 ,0x00000000 }, + {CS35L41_OTP_CTRL7 ,0x00000000 }, + {CS35L41_OTP_CTRL8 ,0x00000000 }, + {CS35L41_PWR_CTRL1 ,0x00000000 }, + {CS35L41_PWR_CTRL3 ,0x01000010 }, + {CS35L41_CTRL_OVRRIDE ,0x00000002 }, + {CS35L41_AMP_OUT_MUTE ,0x00000000 }, + {CS35L41_PROTECT_REL_ERR_IGN ,0x00000000 }, + {CS35L41_GPIO_PAD_CONTROL ,0x00000000 }, + {CS35L41_JTAG_CONTROL ,0x00000000 }, + {CS35L41_PLL_CLK_CTRL ,0x00000010 }, + {CS35L41_DSP_CLK_CTRL ,0x00000003 }, + {CS35L41_GLOBAL_CLK_CTRL ,0x00000003 }, + {CS35L41_DATA_FS_SEL ,0x00000000 }, + {CS35L41_MDSYNC_EN ,0x00000200 }, + {CS35L41_MDSYNC_TX_ID ,0x00000000 }, + {CS35L41_MDSYNC_PWR_CTRL ,0x00000002 }, + {CS35L41_MDSYNC_DATA_TX ,0x00000000 }, + {CS35L41_MDSYNC_TX_STATUS ,0x00000002 }, + {CS35L41_MDSYNC_DATA_RX ,0x00000000 }, + {CS35L41_MDSYNC_RX_STATUS ,0x00000002 }, + {CS35L41_MDSYNC_ERR_STATUS ,0x00000000 }, + {CS35L41_MDSYNC_SYNC_PTE2 ,0x00000000 },
sound/soc/codecs/cs35l41-tables.c line 58
Quoted 10 lines
sound/soc/codecs/cs35l41-tables.c new file +10
-0+ {CS35L41_MDSYNC_SYNC_PTE3, 0x00000000}, + {CS35L41_MDSYNC_SYNC_MSM_STATUS, 0x00000000}, + {CS35L41_BSTCVRT_VCTRL1, 0x00000000}, + {CS35L41_BSTCVRT_VCTRL2, 0x00000001}, + {CS35L41_BSTCVRT_PEAK_CUR, 0x0000004A}, + {CS35L41_BSTCVRT_SFT_RAMP, 0x00000003}, + {CS35L41_BSTCVRT_COEFF, 0x00002424}, + {CS35L41_BSTCVRT_SLOPE_LBST, 0x00007500}, + {CS35L41_BSTCVRT_SW_FREQ, 0x01008000}, + {CS35L41_BSTCVRT_DCM_CTRL, 0x00002001},
The default needs to be updated to match the register patch here. regmap_register_patch does a bypassed write so the default should be set to the patched value.
sound/soc/codecs/cs35l41-tables.c line 64
Quoted 6 lines
sound/soc/codecs/cs35l41-tables.c new file +6
-0+ {CS35L41_BSTCVRT_DCM_MODE_FORCE, 0x00000000}, + {CS35L41_BSTCVRT_OVERVOLT_CTRL, 0x00000130}, + {CS35L41_VI_VOL_POL, 0x08000800}, + {CS35L41_DTEMP_WARN_THLD, 0x00000002}, + {CS35L41_DTEMP_EN, 0x00000000}, + {CS35L41_VPVBST_FS_SEL, 0x00000001},
ditto.
Quoted 52 lines
sound/soc/codecs/cs35l41-tables.c new file +52
-0+ {CS35L41_SP_ENABLES, 0x00000000}, + {CS35L41_SP_RATE_CTRL, 0x00000028}, + {CS35L41_SP_FORMAT, 0x18180200}, + {CS35L41_SP_HIZ_CTRL, 0x00000002}, + {CS35L41_SP_FRAME_TX_SLOT, 0x03020100}, + {CS35L41_SP_FRAME_RX_SLOT, 0x00000100}, + {CS35L41_SP_TX_WL, 0x00000018}, + {CS35L41_SP_RX_WL, 0x00000018}, + {CS35L41_DAC_PCM1_SRC, 0x00000008}, + {CS35L41_ASP_TX1_SRC, 0x00000018}, + {CS35L41_ASP_TX2_SRC, 0x00000019}, + {CS35L41_ASP_TX3_SRC, 0x00000020}, + {CS35L41_ASP_TX4_SRC, 0x00000021}, + {CS35L41_DSP1_RX1_SRC, 0x00000008}, + {CS35L41_DSP1_RX2_SRC, 0x00000009}, + {CS35L41_DSP1_RX3_SRC, 0x00000018}, + {CS35L41_DSP1_RX4_SRC, 0x00000019}, + {CS35L41_DSP1_RX5_SRC, 0x00000020}, + {CS35L41_DSP1_RX6_SRC, 0x00000021}, + {CS35L41_DSP1_RX7_SRC, 0x0000003A}, + {CS35L41_DSP1_RX8_SRC, 0x00000001}, + {CS35L41_NGATE1_SRC, 0x00000008}, + {CS35L41_NGATE2_SRC, 0x00000009}, + {CS35L41_AMP_DIG_VOL_CTRL, 0x00008000}, + {CS35L41_VPBR_CFG, 0x02AA1905}, + {CS35L41_VBBR_CFG, 0x02AA1905}, + {CS35L41_VPBR_STATUS, 0x00000000}, + {CS35L41_VBBR_STATUS, 0x00000000}, + {CS35L41_OVERTEMP_CFG, 0x00000001}, + {CS35L41_AMP_ERR_VOL, 0x00000000}, + {CS35L41_VOL_STATUS_TO_DSP, 0x00000000}, + {CS35L41_CLASSH_CFG, 0x000B0405}, + {CS35L41_WKFET_CFG, 0x00000111}, + {CS35L41_NG_CFG, 0x00000033}, + {CS35L41_AMP_GAIN_CTRL, 0x00000273}, + {CS35L41_DAC_MSM_CFG, 0x00580000}, + {CS35L41_GPIO1_CTRL1, 0xE1000001}, + {CS35L41_GPIO2_CTRL1, 0xE1000001}, + {CS35L41_MIXER_NGATE_CFG, 0x00000000}, + {CS35L41_MIXER_NGATE_CH1_CFG, 0x00000303}, + {CS35L41_MIXER_NGATE_CH2_CFG, 0x00000303}, + {CS35L41_CLOCK_DETECT_1, 0x00000000}, + {CS35L41_TIMER1_CONTROL, 0x00000000}, + {CS35L41_TIMER1_COUNT_PRESET, 0x00000000}, + {CS35L41_TIMER1_START_STOP, 0x00000000}, + {CS35L41_TIMER1_STATUS, 0x00000000}, + {CS35L41_TIMER1_COUNT_READBACK, 0x00000000}, + {CS35L41_TIMER1_DSP_CLK_CFG, 0x00000000}, + {CS35L41_TIMER1_DSP_CLK_STATUS, 0x00000000}, + {CS35L41_TIMER2_CONTROL, 0x00000000}, + {CS35L41_TIMER2_COUNT_PRESET, 0x00000000}, + {CS35L41_TIMER2_START_STOP, 0x00000000},
sound/soc/codecs/cs35l41-tables.c line 126
Quoted 10 lines
sound/soc/codecs/cs35l41-tables.c new file +10
-0+ {CS35L41_TIMER2_STATUS, 0x00000000}, + {CS35L41_TIMER2_COUNT_READBACK, 0x00000000}, + {CS35L41_TIMER2_DSP_CLK_CFG, 0x00000000}, + {CS35L41_TIMER2_DSP_CLK_STATUS, 0x00000000}, + {CS35L41_DFT_JTAG_CONTROL, 0x00000000}, + {CS35L41_DIE_STS1, 0x00000000}, + {CS35L41_DIE_STS2, 0x00000000}, + {CS35L41_TEMP_CAL1, 0x00000000}, + {CS35L41_TEMP_CAL2, 0x00000000}, +};
There are a bunch of registers with status/sts in the name in here with defaults, normally you wouldn't want a default for a status register, since it would be a volatile register. Are we sure these are correct?
Quoted 7 lines
sound/soc/codecs/cs35l41.c new file +7
-0+static const struct snd_kcontrol_new cs35l41_aud_controls[] = { +SOC_SINGLE_SX_TLV ("Digital PCM Volume" ,CS35L41_AMP_DIG_VOL_CTRL , +3 ,0x4CF ,0x391 , dig_vol_tlv), +SOC_SINGLE_TLV ("AMP PCM Gain" ,CS35L41_AMP_GAIN_CTRL ,5 ,0x14 ,0 , + amp_gain_tlv), +SOC_SINGLE_RANGE ("ASPTX1 Slot Position" ,CS35L41_SP_FRAME_TX_SLOT ,0 , +0 ,7 ,0 ),
sound/soc/codecs/cs35l41.c line 289
Quoted 10 lines
sound/soc/codecs/cs35l41.c new file +10
-0+SOC_SINGLE_RANGE ("ASPTX2 Slot Position" ,CS35L41_SP_FRAME_TX_SLOT ,8 , +0 ,7 ,0 ), +SOC_SINGLE_RANGE ("ASPTX3 Slot Position" ,CS35L41_SP_FRAME_TX_SLOT ,16 , +0 ,7 ,0 ), +SOC_SINGLE_RANGE ("ASPTX4 Slot Position" ,CS35L41_SP_FRAME_TX_SLOT ,24 , +0 ,7 ,0 ), +SOC_SINGLE_RANGE ("ASPRX1 Slot Position" ,CS35L41_SP_FRAME_RX_SLOT ,0 , +0 ,7 ,0 ), +SOC_SINGLE_RANGE ("ASPRX2 Slot Position" ,CS35L41_SP_FRAME_RX_SLOT ,8 , + 0, 7, 0),
Probably worth explaining why you want to do this through ALSA controls rather than set_tdm/set_channel_map.
sound/soc/codecs/cs35l41.c line 1262
Quoted 6 lines
sound/soc/codecs/cs35l41.c new file +6
-0+static int cs35l41_component_probe (struct snd_soc_component *component) +{ +struct cs35l41_private *cs35l41 = +snd_soc_component_get_drvdata (component); + + component->regmap = cs35l41->regmap;
Is this necessary I think ASoC handles this internally since the regmap is already on the CODEC device?
sound/soc/codecs/cs35l41.c line 1265
Quoted 3 lines
sound/soc/codecs/cs35l41.c new file +3
-0+ +return cs35l41_set_pdata (cs35l41); +}
Thanks,
Charles
PATCH 2/2 ASoC: cs35l41: Add bindings for CS35L41
In reply to David RhodesDevicetree binding documentation for CS35L41 driver
CS35L41 is a 11-V Boosted Mono Class D Amplifier with DSP Speaker Protection and Equalization
--- .../devicetree/bindings/sound/cs35l41.yaml | 395 ++++++++++++++++++ 1 file changed, 395 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/cs35l41.yaml
Documentation/devicetree/bindings/sound/cs35l41.yaml new file +395 -0
@@ -0,0 +1,395 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/cs35l41.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Cirrus Logic CS35L41 Speaker Amplifier + +maintainers: + - [email protected] + +description: | + CS35L41 is a boosted mono Class D amplifier with DSP + speaker protection and equalization + +properties: + compatible: + enum: + - cirrus,cs35l40 + - cirrus,cs35l41 + + reg: + maxItems: 1 + + '#sound-dai-cells': + description: + The first cell indicating the audio interface. + const: 1 + + cirrus,boost-peak-milliamp: + description: + Boost-converter peak current limit in mA. + Configures the peak current by monitoring the current through the boost FET. + Range starts at 1600 mA and goes to a maximum of 4500 mA with increments + of 50 mA. See section 4.3.6 of the datasheet for details. + $ref: "/schemas/types.yaml#/definitions/uint32" + minimum: 1600 + maximum: 4500 + default: 4500 + + cirrus,boost-ind-nanohenry: + description: + Boost inductor value, expressed in nH. Valid + values include 1000, 1200, 1500 and 2200. + $ref: "/schemas/types.yaml#/definitions/uint32" + minimum: 1000 + maximum: 2200 + + cirrus,boost-cap-microfarad: + description: + Total equivalent boost capacitance on the VBST + and VAMP pins, derated at 11 volts DC. The value must be rounded to the + nearest integer and expressed in uF. + $ref: "/schemas/types.yaml#/definitions/uint32" + + + cirrus,sclk-force-output: + description: + Audio serial port SCLK force + output control. Forces the SCLK to continue to drive even + if no ASP_TXn channels are enabled. + type: boolean + + cirrus,lrclk-force-output: + description: + Audio serial port LRCLK force + output control. Forces the LRCLK to continue to drive even + if no ASP_TXn channels are enabled. + type: boolean + + cirrus,right-channel-amp: + description: + Boolean to determine which channel + the amplifier is to receive the audio data on. If present the + amplifier receives data on the right channel of I2S data. + If not present the amplifier receives data on the left + channel of I2S data + type: boolean + + cirrus,boost-ctl-millivolt: + description: + Boost Voltage Value. Configures the + boost converter's output voltage in mV. The range is from 2550 mV to + 11000 mV with increments of 50 mV. This will be the maximum voltage + in Class-H mode if 'classh-bst-max-limit' is set to 1, or the fixed + boost voltage if 'classh-bst-overide' is set to true. + $ref: "/schemas/types.yaml#/definitions/uint32" + minimum: 2550 + maximum: 11000 + + cirrus,amp-gain-zc: + description: + Boolean to determine whether to use the amplifier + gain-change zero-crossing feature. If the feature is enabled, any + user-controlled amplifier gain change will occur on a zero-crossing point. + (Default) Disabled + type: boolean + + cirrus,asp-sdout-hiz: + description: + Audio serial port SDOUT Hi-Z control. Sets the Hi-Z + configuration for SDOUT pin of amplifier. + 0 = Logic 0 during unused slots, and while all transmit channels disabled + 1 = Hi-Z during unused slots but logic 0 while all transmit channels disabled + 2 = (Default) Logic 0 during unused slots, but Hi-Z while all transmit channels disabled + 3 = Hi-Z during unused slots and while all transmit channels disabled + $ref: "/schemas/types.yaml#/definitions/uint32" + minimum: 0 + maximum: 3 + default: 2 + + cirrus,temp-warn-threshold: + description: + Amplifier overtemperature warning threshold. + Configures the threshold at which the overtemperature warning condition occurs. + When the threshold is met, the ovetemperature warning attenuation is applied + and the TEMP_WARN_EINT interrupt status bit is set. + If TEMP_WARN_MASK = 0, INTb is asserted. + 0 = 105C + 1 = 115C + 2 = 125C (Default) + 3 = 135C + $ref: "/schemas/types.yaml#/definitions/uint32" + minimum: 0 + maximum: 3 + default: 2 + + cirrus,hw-noise-gate-select: + description: Hardware Noise Gate feature. Each bit selects + a different block for detection. + 000000 - All noise gating functionality disabled + xxxxx1 - Amplifier noise gating detection enabled + xxxx1x - Boost converter DCM detection enabled + xxx1xx - VMON low power mode detection enabled + xx1xxx - IMON low power mode detection enabled + x1xxxx - VP brownout prevention detection enabled + 1xxxxx - VBST brownout prevention detection enabled + type: boolean + + cirrus,hw-noise-gate-delay: + description: Time that the incoming audio signal must be + below the noise gate threshold prior to entering a noise gated state + 0 = 5 ms + 1 = 10 ms + 2 = 25 ms + 3 = 50 ms (default) + 4 = 100 ms + 5 = 250 ms + 6 = 500 ms + 7 = 1 s + $ref: "/schemas/types.yaml#/definitions/uint32" + minimum: 0 + maximum: 7 + default: 3 + + cirrus,hw-noise-gate-threshold: + description: Threshold of audio signal input which the + noise gate considers the input audio to be at a low enough level to be + valid to enter a noise gating state of operation. + 0 = 0.654 mVpk + 1 = 0.328 mVpk + 2 = 0.164 mVpk + 3 = 0.082 mVpk (default) + 4 = 0.041 mVpk + 5 = 0.021 mVpk + 6 = 0.010 mVpk + 7 = True zero data (no LSB dither) + $ref: "/schemas/types.yaml#/definitions/uint32" + minimum: 0 + maximum: 7 + default: 3 + + cirrus,dsp-noise-gate-enable: + description: + DSP Noise Gate feature. If present, noise gate feature will be enabled. + type: boolean + + cirrus,dsp-noise-gate-threshold: + description: + Threshold of audio signal input which the + noise gate considers the input audio to be at a low enough level to be + valid to enter a noise gating state of operation. + 0 = -66 dBFS + 1 = -72 dBFS + 2 = -78 dBFS + 3 = -84 dBFS (default) + 4 = -90 dBFS + 5 = -96 dBFS + 6 = -102 dBFS + 7 = -108 dBFS + $ref: "/schemas/types.yaml#/definitions/uint32" + minimum: 0 + maximum: 7 + default: 3 + + cirrus,dsp-noise-gate-delay: + description: + Time that the incoming audio signal must be + below the noise gate threshold prior to entering a noise gated state + 0 = 5 ms + 1 = 10 ms + 2 = 25 ms + 3 = 50 ms (default) + 4 = 100 ms + 5 = 250 ms + 6 = 500 ms + 7 = 1 s + 8 = 5 s + 9 = 10 s + 10 = 20 s + 11 = 30 s + 12 = 40 s + 13 = 50 s + 14 = 60 s + 15 = 120 s + $ref: "/schemas/types.yaml#/definitions/uint32" + minimum: 0 + maximum: 15 + default: 3 + + cirrus,invert-pcm: + description: + Inverts the polarity of the audio signal output from + the Class-D amplifier. + type: boolean + + classh-internal-algo: + description: + Sub-node for the Internal Class H Algorithm + See Section 4.4 Internal Class H Algorithm in the Datasheet. + If not used, the device manages the ClassH Algorithm internally. + It is strongly recommended that the Datasheet be referenced when adjusting + or using these Class H Algorithm controls over the internal Algorithm. + Serious damage can occur to the Device and surrounding components. + Unavailable for cs35l41l. + type: + boolean + cirrus,classh-bst-overide: + description: + Boolean which will disable Class H tracking and + set Boost voltage to the value in the 'boost-ctl-millivolt' property + type: boolean + cirrus,classh-bst-max-limit: + description: + Value set to the BST_CTL_LIM_EN field. + A value of 1 will limit the Class-H voltage to the value in the + 'boost-ctl-millivolt' property. + 0 = No Class-H limit (default) + 1 = Class-H limited to 'boost-ctl-millivolt' value + $ref: "/schemas/types.yaml#/definitions/uint32" + minimum: 0 + maximum: 1 + cirrus,classh-headroom: + description: + Class H algorithm headroom. Controls VBST headroom + in the max detection path of the Class H algorithm. Step size is 0.1 V. + Range is from -6.4V to +6.3V with 7-bit 2's complement representation. + 0 = 0V + 1 = 0.1V + 2 = 0.2V + === + 11 = 1.1V (Default) + === + 62 = 6.2V + 63 = 6.3V + 64 = -6.4V + 65 = -6.3V + === + 126 = -0.2V + 127 = -0.1V + $ref: "/schemas/types.yaml#/definitions/uint32" + minimum: 0 + maximum: 127 + cirrus,classh-release-rate: + description: + Class H release rate. Controls the amount of + time required before allowing consecutive release condition VBST supply + tracking updates. Step size is 5us with range from 20us to 1275us. + 4 = 20us (Default) + 5 = 25us + === + 254 = 1270us + 255 = 1275us + $ref: "/schemas/types.yaml#/definitions/uint32" + minimum: 4 + maximum: 255 + cirrus,classh-mem-depth: + description: + Class H memory depth. Controls the memory depth + used in the Class H algorithm for audio data buffering and analysis. + 0 = 20.83 - 23.4 us + 1 = 41.67 - 46.88 us + 2 = 83.33 - 85.94 us + 3 = 166.67 - 171.88 us + 4 = 250.00 - 255.10 us + 5 = 333.33 - 335.93 us (Default) + $ref: "/schemas/types.yaml#/definitions/uint32" + minimum: 0 + maximum: 5 + cirrus,classh-wk-fet-thld: + description: + Weak-FET amplifier driver threshold. + Configures the signal threshold at which the PWM output stage enters weak-FET + operation. Step size is 0.05V. Range is from 0.05V to 0.7V. + 1 = 0.05V + 2 = 0.1V + 3 = 0.15V + === + 13 = 0.65V + 14 = 0.7V + $ref: "/schemas/types.yaml#/definitions/uint32" + minimum: 1 + maximum: 14 + cirrus,classh-wk-fet-delay: + description: + Weak-Fet entry . Controls the delay in ms + before the Class H algorithm switches to the weak-FET voltage after the audio + falls and remains below the value specified in 'classh-wk-fet-thld'. + 0 = 0ms + 1 = 5ms + 2 = 10ms + 3 = 50ms + 4 = 100ms (Default) + 5 = 200ms + 6 = 500ms + 7 = 1000ms + $ref: "/schemas/types.yaml#/definitions/uint32" + minimum: 0 + maximum: 7 + cirrus,gpio1-polarity-invert: + description: + Boolean which specifies whether the GPIO1 + level is inverted. If this property is not present the level is not inverted. + type: boolean + cirrus,gpio1-output-enable: + description: + Boolean which specifies whether the GPIO1 pin + is configured as an output. If this property is not present the + pin will be configured as an input. + type: boolean + cirrus,gpio1-src-select: + description: + Configures the function of the GPIO1 pin. + Note that the options are different from the GPIO2 pin + 0 = High Impedance (Default) + 1 = GPIO + 2 = Sync + 3 = MCLK input + $ref: "/schemas/types.yaml#/definitions/uint32" + minimum: 0 + maximum: 3 + cirrus,gpio2-polarity-invert: + description: + Boolean which specifies whether the GPIO2 + level is inverted. If this property is not present the level is not inverted. + type: boolean + cirrus,gpio2-output-enable: + description: + Boolean which specifies whether the GPIO2 pin + is configured as an output. If this property is not present the + pin will be configured as an input. + type: boolean + cirrus,gpio2-src-select: + description: + Configures the function of the GPIO2 pin. + Note that the options are different from the GPIO1 pin. + 0 = High Impedance (Default) + 1 = GPIO + 2 = Open Drain INTB + 3 = MCLK input + 4 = Push-pull INTB (active low) + 5 = Push-pull INT (active high) + $ref: "/schemas/types.yaml#/definitions/uint32" + minimum: 0 + maximum: 5 + +required: + - compatible + - cirrus,boost-peak-milliamp + - cirrus,boost-ind-nanohenry + - cirrus,boost-cap-microfarad + +unevaluatedProperties: false + +examples: + - | + cs35l41: cs35l41@2 { + compatible = "cirrus,cs35l41"; + reg = <2>; + VA-supply = <&dummy_vreg>; + VP-supply = <&dummy_vreg>; + cirrus,boost-peak-milliamp = <4500>; + cirrus,boost-ind-nanohenry = <1000>; + cirrus,boost-cap-microfarad = <15>; + };
Signature · 1 line
2.25.1
Re: [PATCH 2/2] ASoC: cs35l41: Add bindings for CS35L41
Quoted 7 lines · David Rhodes
Devicetree binding documentation for CS35L41 driver
CS35L41 is a 11-V Boosted Mono Class D Amplifier with DSP Speaker Protection and Equalization
Signed-off-by David Rhodes <[email protected]>---
Should really CC the DT maintainers on this patch too, Rob Herring and the DT list.
Thanks,
Charles