Cirrus Logic CS35L41 Amplifier
Subsystems (4)
v5 cover Cirrus Logic CS35L41 Amplifier
ASoC driver and devicetree documentation for a new Cirrus Logic amplifier CS35L41
v5 changes:
Reverse xmas-tree style for declarations
At probe, regulator enable before handle pdata
At probe, set pdata before component registration Remove several DT properties and implement as mixer controls Remove some unnecessary NULL inits in otp_unpack Revise license header style
David Rhodes (2):
ASoC: cs35l41: CS35L41 Boosted Smart Amplifier
ASoC: cs35l41: Add bindings for CS35L41
.../devicetree/bindings/sound/cs35l41.yaml | 162 ++ include/sound/cs35l41.h | 35 + sound/soc/codecs/Kconfig | 12 + sound/soc/codecs/Makefile | 4 + sound/soc/codecs/cs35l41-i2c.c | 115 ++ sound/soc/codecs/cs35l41-spi.c | 144 ++ sound/soc/codecs/cs35l41-tables.c | 611 +++++++ sound/soc/codecs/cs35l41.c | 1587 +++++++++++++++++ sound/soc/codecs/cs35l41.h | 774 ++++++++ 9 files changed, 3444 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 v5 1/2 ASoC: cs35l41: CS35L41 Boosted Smart Amplifier
SoC Audio driver for the Cirrus Logic CS35L41 amplifier
--- include/sound/cs35l41.h | 35 + sound/soc/codecs/Kconfig | 12 + sound/soc/codecs/Makefile | 4 + sound/soc/codecs/cs35l41-i2c.c | 115 +++ sound/soc/codecs/cs35l41-spi.c | 144 +++ sound/soc/codecs/cs35l41-tables.c | 611 +++++++++++ sound/soc/codecs/cs35l41.c | 1587 +++++++++++++++++++++++++++++ sound/soc/codecs/cs35l41.h | 774 ++++++++++++++ 8 files changed, 3282 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 +35 -0
@@ -0,0 +1,35 @@ +/* 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]> +*/ + +#ifndef __CS35L41_H +#define __CS35L41_H + +enum cs35l41_clk_ids { +CS35L41_CLKID_SCLK =0 , +CS35L41_CLKID_LRCLK =1 , +CS35L41_CLKID_MCLK =4 , +}; + +struct cs35l41_irq_cfg { +bool irq_pol_inv; +bool irq_out_en; +int irq_src_sel; +}; + +struct cs35l41_platform_data { +int bst_ind; +int bst_ipk; +int bst_cap; +int dout_hiz; +int classh_bst_max_limit; +struct cs35l41_irq_cfg irq_config1; +struct cs35l41_irq_cfg irq_config2; +}; + +#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
@@ -601,6 +603,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
@@ -384,6 +386,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 +115 -0
115 lines not on this page · raw message
sound/soc/codecs/cs35l41-spi.c new file +144 -0
144 lines not on this page · raw message
sound/soc/codecs/cs35l41-tables.c new file +611 -0
611 lines not on this page · raw message
sound/soc/codecs/cs35l41.c new file +1587 -0
1,587 lines not on this page · raw message
sound/soc/codecs/cs35l41.h new file +774 -0
468 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 v5 1/2] ASoC: cs35l41: CS35L41 Boosted Smart Amplifier
Quoted 33 lines
sound/soc/codecs/cs35l41-i2c.c +30
-0+#ifdef CONFIG_ACPI +static const struct acpi_device_id cs35l41_acpi_match[] = { + {"CSC3541" ,0 },/* Cirrus Logic PnP ID + part ID */ + {}, +}; +MODULE_DEVICE_TABLE (acpi, cs35l41_acpi_match); +#endif + +static struct i2c_driver cs35l41_i2c_driver = { + .driver = { + .name ="cs35l41" , + .of_match_table =of_match_ptr (cs35l41_of_match), + .acpi_match_table =ACPI_PTR (cs35l41_acpi_match), + }, + .id_table = cs35l41_id_i2c, + .probe = cs35l41_i2c_probe, + .remove = cs35l41_i2c_remove, +}; + +module_i2c_driver (cs35l41_i2c_driver); +#ifdef CONFIG_ACPI +static const struct acpi_device_id cs35l41_acpi_match[] = { + {"CSC3541" ,0 },/* Cirrus Logic PnP ID + part ID */ + {}, +}; +MODULE_DEVICE_TABLE (acpi, cs35l41_acpi_match); +#endif + +static struct spi_driver cs35l41_spi_driver = { + .driver = {
sound/soc/codecs/cs35l41-i2c.c
Quoted 10 lines
sound/soc/codecs/cs35l41-i2c.c +10
-0+ .name = "cs35l41", + .of_match_table = of_match_ptr(cs35l41_of_match), + .acpi_match_table = ACPI_PTR(cs35l41_acpi_match), + }, + .id_table = cs35l41_id_spi, + .probe = cs35l41_spi_probe, + .remove = cs35l41_spi_remove, +}; + +module_spi_driver (cs35l41_spi_driver);
Is the ACPI probe smart enough to deal with two different drivers registering for the *same* HID?
I haven't seen any precedent, e.g. the RT6777 uses a different ACPI HID for its I2C and SPI modes.
Re: [PATCH v5 1/2] ASoC: cs35l41: CS35L41 Boosted Smart Amplifier
Quoted 8 lines · Pierre-Louis Bossart
Is the ACPI probe smart enough to deal with two different drivers registering for the *same* HID?
I haven't seen any precedent, e.g. the RT6777 uses a different ACPI HID for its I2C and SPI modes.
I2C and SPI buses, when they are looking for a driver with an ID that matches a device declared in ACPI, will iterate over drivers that belong to the bus only (bus_for_each_drv()). It is not possible for an I2C driver to be matched during SPI device enumeration or vice versa.
Thanks,
David
Re: [PATCH v5 1/2] ASoC: cs35l41: CS35L41 Boosted Smart Amplifier
Quoted 10 lines
Quoted 9 lines
Is the ACPI probe smart enough to deal with two different drivers registering for the *same* HID?
I haven't seen any precedent, e.g. the RT6777 uses a different ACPI HID for its I2C and SPI modes.
Quoted 4 lines
I2C and SPI buses, when they are looking for a driver with an ID that matches a device declared in ACPI, will iterate over drivers that belong to the bus only (
bus_for_each_drv()). It is not possible for an I2C driver to be matched during SPI device enumeration or vice versa.
That's good but that use of the same HID for two different solutions is still be problematic. On ACPI solutions, we use the HID as a key to identify what machine driver to load, see e.g. snd_soc_acpi_find_machine(). By using the *same* HID, you will prevent that machine detection from uniquely identifying what mode is used, and force the machine detection to be expanded with e.g. DMI-based quirks. It's really far from ideal for integrators. The only case where this would work with impacts on the machine selection would be if the choice of the SPI and I2C modes had no impact on the functionality of the device, but is this really the case?
Richard Fitzgerald
maintainerRe: [PATCH v5 1/2] ASoC: cs35l41: CS35L41 Boosted Smart Amplifier
Quoted 10 lines · Pierre-Louis Bossart
Quoted 10 lines
Quoted 9 lines
Is the ACPI probe smart enough to deal with two different drivers registering for the *same* HID?
I haven't seen any precedent, e.g. the RT6777 uses a different ACPI HID for its I2C and SPI modes.
Quoted 8 lines
Quoted 4 lines
I2C and SPI buses, when they are looking for a driver with an ID that matches a device declared in ACPI, will iterate over drivers that belong to the bus only (
bus_for_each_drv()). It is not possible for an I2C driver to be matched during SPI device enumeration or vice versa.That's good but that use of the same HID for two different solutions is still be problematic. On ACPI solutions, we use the HID as a key to identify what machine driver to load, see e.g.
snd_soc_acpi_find_machine().
We know that HIDs are required to setup machine-specific stuff, but that doesn't prevent having a generic ID string. We still allocate a generic ACPI ID for the part. As machine-specific HIDs are likely, there's no strong reason to allocate two generic IDs for the same part.
Unfortunately we don't have a crystal ball to be able to include now all the machine-unique HIDs that will be allocated in the future, so they will have to be added when they exist.
Quoted 7 lines
By using the *same* HID, you will prevent that machine detection from uniquely identifying what mode is used, and force the machine detection to be expanded with e.g. DMI-based quirks. It's really far from ideal for integrators. The only case where this would work with impacts on the machine selection would be if the choice of the SPI and I2C modes had no impact on the functionality of the device, but is this really the case?
I can't think what you'd need to setup differently in a machine driver for I2C versus SPI control. Do you have the bus ID hardcoded into your machine drivers for some reason?
Mark Brown
maintainerRe: [PATCH v5 1/2] ASoC: cs35l41: CS35L41 Boosted Smart Amplifier
In reply to Pierre-Louis BossartQuoted 11 lines · Pierre-Louis Bossart
Quoted 4 lines
I2C and SPI buses, when they are looking for a driver with an ID that matches a device declared in ACPI, will iterate over drivers that belong to the bus only (
bus_for_each_drv()). It is not possible for an I2C driver to be matched during SPI device enumeration or vice versa.That's good but that use of the same HID for two different solutions is still be problematic. On ACPI solutions, we use the HID as a key to identify what machine driver to load, see e.g.
snd_soc_acpi_find_machine(). By using the *same* HID, you will prevent that machine detection from uniquely identifying what mode is used, and force the machine detection to be expanded with e.g. DMI-based quirks. It's really far from ideal
You can always add the bus type as a key if you really need to?
Quoted 3 lines
for integrators. The only case where this would work with impacts on the machine selection would be if the choice of the SPI and I2C modes had no impact on the functionality of the device, but is this really the case?
Usually that's the case for CODECs, it's just going to be a question of how fast the I/O is, physical design considerations and what interfaces you have available. It'll be limiting for some applications of course (slow firmware downloads for example) but given the way these things are built I'd be fairly surprised to see something actively gated off. If you look at the I2C and SPI bus handling for individual CODECs they're usually extremely thin wrapper that just pass a regmap into common code with nothing else done conditionally.
Re: [PATCH v5 1/2] ASoC: cs35l41: CS35L41 Boosted Smart Amplifier
Quoted 7 lines · Mark Brown
Quoted 4 lines · Pierre-Louis Bossart
Quoted 4 lines
I2C and SPI buses, when they are looking for a driver with an ID that matches a device declared in ACPI, will iterate over drivers that belong to the bus only (
bus_for_each_drv()). It is not possible for an I2C driver to be matched during SPI device enumeration or vice versa.
Quoted 8 lines
Quoted 6 lines
That's good but that use of the same HID for two different solutions is still be problematic. On ACPI solutions, we use the HID as a key to identify what machine driver to load, see e.g.
snd_soc_acpi_find_machine(). By using the *same* HID, you will prevent that machine detection from uniquely identifying what mode is used, and force the machine detection to be expanded with e.g. DMI-based quirks. It's really far from idealYou can always add the bus type as a key if you really need to?
I could but this adds more work.
Quoted 4 lines
Quoted 3 lines
for integrators. The only case where this would work with impacts on the machine selection would be if the choice of the SPI and I2C modes had no impact on the functionality of the device, but is this really the case?
Quoted 8 lines
Usually that's the case for CODECs, it's just going to be a question of how fast the I/O is, physical design considerations and what interfaces you have available. It'll be limiting for some applications of course (slow firmware downloads for example) but given the way these things are built I'd be fairly surprised to see something actively gated off. If you look at the I2C and SPI bus handling for individual CODECs they're usually extremely thin wrapper that just pass a regmap into common code with nothing else done conditionally.
In general yes, but the SPI can be used for faster upload of e.g. history data on capture, something I2C is not capable of. That would e.g. expose new dailinks in a machine driver. the RT5677 is the typical example of this.
Anyways, I am not going to lay on the tracks for an HID, BIOS folks usually get them wrong anyways.
Re: [PATCH v5 1/2] ASoC: cs35l41: CS35L41 Boosted Smart Amplifier
In reply to David RhodesQuoted 6 lines · David Rhodes
SoC Audio driver for the Cirrus Logic CS35L41 amplifier
Signed-off-by David Rhodes <[email protected]>---
+++b/sound/soc/codecs/cs35l41-i2c.c
sound/soc/codecs/cs35l41-i2c.c line 8
Quoted 8 lines
sound/soc/codecs/cs35l41-i2c.c new file +8
-0@@ -0,0 +1,115 @@ +/* SPDX-License-Identifier: GPL-2.0 +* +* cs35l41-i2c.c -- CS35l41 I2C driver +* +* Copyright 2017-2021 Cirrus Logic, Inc. +* +* Author: David Rhodes <[email protected]> +*/
SPDX headers in the C files need to be //, it's apparently some tooling thing somewhere that requires the C and H files to be different. I believe Mark was suggesting you changed this to look like:
// SPDX-License-Identifier: GPL-2.0
//
// cs35l41-i2c.c -- CS35l41 I2C driver
//
// Copyright 2017-2021 Cirrus Logic, Inc.
//
// Author: David Rhodes <[email protected]>
Quoted 3 lines
sound/soc/codecs/cs35l41-tables.c new file +3
-0+bool cs35l41_readable_reg (struct device *dev,unsigned int reg) +{ +switch (reg) {
<snip>
sound/soc/codecs/cs35l41-tables.c line 212
Quoted 13 lines
sound/soc/codecs/cs35l41-tables.c new file +13
-0+case CS35L41_TIMER1_CONTROL : +case CS35L41_TIMER1_COUNT_PRESET : +case CS35L41_TIMER1_STATUS : +case CS35L41_TIMER1_COUNT_READBACK : +case CS35L41_TIMER1_DSP_CLK_CFG : +case CS35L41_TIMER1_DSP_CLK_STATUS : +case CS35L41_TIMER2_CONTROL : +case CS35L41_TIMER2_COUNT_PRESET : +case CS35L41_TIMER2_STATUS : +case CS35L41_TIMER2_COUNT_READBACK : +case CS35L41_TIMER2_DSP_CLK_CFG : +case CS35L41_TIMER2_DSP_CLK_STATUS : +case CS35L41_DFT_JTAG_CONTROL :
These should be dropped, these are registers for the firmware peripherals and will never be used from the driver.
sound/soc/codecs/cs35l41.c line 267
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 ("Analog PCM Volume" ,CS35L41_AMP_GAIN_CTRL ,5 ,0x14 ,0 , + amp_gain_tlv), +SOC_ENUM ("PCM Soft Ramp" , pcm_sft_ramp), +SOC_SINGLE ("Boost Converter Enable" ,CS35L41_PWR_CTRL2 ,4 ,3 ,0 ),
Doesn't seem right to have an ALSA control to enable the boost converter. Controlling high voltages is definitely something that should be under kernel control.
sound/soc/codecs/cs35l41.c line 270
Quoted 1 line
sound/soc/codecs/cs35l41.c new file +1
-0+ SOC_SINGLE("Boost Target Voltage", CS35L41_BSTCVRT_VCTRL1, 0, 0xAA, 0),
Ditto here for the boost voltage.
sound/soc/codecs/cs35l41.c line 295
Quoted 4 lines
sound/soc/codecs/cs35l41.c new file +4
-0+SOC_SINGLE ("Weak FET Threshold" ,CS35L41_WKFET_CFG , +CS35L41_CH_WKFET_THLD_SHIFT ,0xF ,0 ), +SOC_SINGLE ("Weak FET Delay" ,CS35L41_WKFET_CFG , + CS35L41_CH_WKFET_DLY_SHIFT, 7, 0),
Likewise this weak FET stuff, it looks hardware dependent and probably shouldn't be in userspace control, the datasheet states:
The strength of the output drivers is reduced when operating in a Weak-FET Drive Mode and must not be used to drive a large load.
Which strongly implies to me this should be in DT/driver control.
sound/soc/codecs/cs35l41.c line 297
Quoted 2 lines
sound/soc/codecs/cs35l41.c new file +2
-0+SOC_SINGLE ("Temp Warn Threshold" ,CS35L41_DTEMP_WARN_THLD , + 0, CS35L41_TEMP_THLD_MASK, 0),
Again temperature warnings don't feel like they should be getting set through an ALSA control.
sound/soc/codecs/cs35l41.c line 1164
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;
You sure this is necessary? The core should do this for us, its only necessary if the regmap is on a different struct device to the CODEC which isn't the case in this driver. Also if this is necessary it should be using snd_soc_component_init_regmap.
Quoted 6 lines
sound/soc/codecs/cs35l41.c new file +6
-0+static const struct snd_soc_component_driver soc_component_dev_cs35l41 = { + .name ="cs35l41-codec" , + .probe = cs35l41_component_probe, + + .dapm_widgets = cs35l41_dapm_widgets, + .num_dapm_widgets =ARRAY_SIZE (cs35l41_dapm_widgets),
sound/soc/codecs/cs35l41.c line 1267
Quoted 10 lines
sound/soc/codecs/cs35l41.c new file +10
-0+ .dapm_routes = cs35l41_audio_map, + .num_dapm_routes = ARRAY_SIZE(cs35l41_audio_map), + + .controls = cs35l41_aud_controls, + .num_controls = ARRAY_SIZE(cs35l41_aud_controls), + .set_sysclk = cs35l41_component_set_sysclk, +}; + + +
Probably don't need quite so many blank lines here.
sound/soc/codecs/cs35l41.c line 1384
Quoted 9 lines
sound/soc/codecs/cs35l41.c new file +9
-0+int cs35l41_probe (struct cs35l41_private *cs35l41, +struct cs35l41_platform_data *pdata) +{ +u32 regid, reg_revid, i, mtl_revid, int_status, chipid_match; +int irq_pol =0 ; +int timeout; +int ret; + +
Extra blank line.
Quoted 19 lines
sound/soc/codecs/cs35l41.c new file +19
-0+for (i =0 ; i <CS35L41_NUM_SUPPLIES ; i++) + cs35l41->supplies[i].supply = cs35l41_supplies[i]; + + ret =devm_regulator_bulk_get (cs35l41->dev,CS35L41_NUM_SUPPLIES , + cs35l41->supplies); +if (ret !=0 ) { +dev_err (cs35l41->dev, +"Failed to request core supplies: %d\n" , + ret); +return ret; + } + + ret =regulator_bulk_enable (CS35L41_NUM_SUPPLIES , cs35l41->supplies); +if (ret !=0 ) { +dev_err (cs35l41->dev, +"Failed to enable core supplies: %d\n" , ret); +return ret; + } +
sound/soc/codecs/cs35l41.c line 1413
Quoted 10 lines
sound/soc/codecs/cs35l41.c new file +10
-0+if (pdata) { + cs35l41->pdata = *pdata; + }else { + ret =cs35l41_handle_pdata (cs35l41->dev, &cs35l41->pdata, + cs35l41); +if (ret !=0 ) { + ret = -ENODEV ; + goto err; + } + }
Any reason to not just parse this before enabling the supplies? Parsing the pdata shouldn't require the hardware to be enabled all the settings are being applied through set_pdata later on, means you can just return on an error as well rather than having to disable the supplies again. On the topic of errors any reason this sets all errors to ENODEV, why not return the error that cs35l41_handle_pdata returned? Seems more helpful.
Thanks,
Charles
Re: [PATCH v5 1/2] ASoC: cs35l41: CS35L41 Boosted Smart Amplifier
Quoted 12 lines · Charles Keepax
sound/soc/codecs/cs35l41.c line 1164
Quoted 6 lines · David Rhodes
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;You sure this is necessary? The core should do this for us, its only necessary if the regmap is on a different struct device to the CODEC which isn't the case in this driver. Also if this is necessary it should be using
snd_soc_component_init_regmap.
Not necessary. As far as I can tell this is just a relic of something long since refactored.
I agree with all the other comments as well and I will include in v6.
Thanks,
David
PATCH v5 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 | 162 ++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/cs35l41.yaml
Documentation/devicetree/bindings/sound/cs35l41.yaml new file +162 -0
@@ -0,0 +1,162 @@ +# 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 + + reset-gpios: + maxItems: 1 + + VA-supply: + description: voltage regulator phandle for the VA supply + + VP-supply: + description: voltage regulator phandle for the VP supply + + 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,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,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,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 + - reg + - "#sound-dai-cells" + - 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>; + reset-gpios = <&gpio 110 0>; + cirrus,boost-peak-milliamp = <4500>; + cirrus,boost-ind-nanohenry = <1000>; + cirrus,boost-cap-microfarad = <15>; + };
Signature · 1 line
2.25.1