mbox series

[00/12] Add support for the Cirrus Logic CS48L32 audio codecs

Message ID 20221109165331.29332-1-rf@opensource.cirrus.com
Headers show
Series Add support for the Cirrus Logic CS48L32 audio codecs | expand

Message

Richard Fitzgerald Nov. 9, 2022, 4:53 p.m. UTC
The CS48L32 is a high-performance low-power audio DSP for smartphones
and other portable audio devices. It has various digital audio I/O,
a programmable Halo Core DSP, fixed-function audio processors,
configurable GPIO and microphone bias regulators.

The CS48L31 and CS48L33 were derivatives of the CS48L32.

Piotr Stankiewicz (2):
  mfd: cs48l32: Add support for CS48L31/32/33 codecs
  pinctrl: cirrus: Add support for CS48L31/32/33 codecs

Richard Fitzgerald (9):
  dt-bindings: mfd: Add Cirrus Logic CS48L32 audio codec
  mfd: cs48l32: Add register definitions for Cirrus Logic CS48L31/32/33
  dt-bindings: pinctrl: Add Cirrus Logic CS48L31/32/33
  regulator: arizona-micsupp: Don't hardcode use of ARIZONA defines
  regulator: arizona-micsupp: Don't use a common regulator name
  regulator: arizona-micsupp: Support Cirrus Logic CS48L31/32/33
  irqchip: cirrus: Add driver for Cirrus Logic CS48L31/32/33 codecs
  ASoC: wm_adsp: Allow client to hook into pre_run callback
  dt-bindings: sound: Add Cirrus Logic CS48L31/32/33 codecs

Stuart Henderson (1):
  ASoC: cs48l32: Add codec driver for Cirrus Logic CS48L31/32/33

 .../bindings/mfd/cirrus,cs48l32.yaml          |  166 +
 .../bindings/pinctrl/cirrus,cs48l32.yaml      |   98 +
 .../bindings/sound/cirrus,cs48l32.yaml        |   96 +
 MAINTAINERS                                   |   12 +-
 drivers/irqchip/Kconfig                       |    3 +
 drivers/irqchip/Makefile                      |    1 +
 drivers/irqchip/irq-cirrus-cs48l32.c          |  281 ++
 drivers/irqchip/irq-cirrus-cs48l32.h          |   74 +
 drivers/mfd/Kconfig                           |   13 +
 drivers/mfd/Makefile                          |    2 +
 drivers/mfd/cs48l32-tables.c                  |  541 ++++
 drivers/mfd/cs48l32.c                         |  434 +++
 drivers/mfd/cs48l32.h                         |   28 +
 drivers/pinctrl/cirrus/Kconfig                |    5 +
 drivers/pinctrl/cirrus/Makefile               |    2 +
 drivers/pinctrl/cirrus/pinctrl-cs48l32.c      |  932 ++++++
 drivers/pinctrl/cirrus/pinctrl-cs48l32.h      |   62 +
 drivers/regulator/Kconfig                     |    8 +-
 drivers/regulator/arizona-micsupp.c           |   78 +-
 include/dt-bindings/sound/cs48l32.h           |   25 +
 include/linux/irqchip/irq-cirrus-cs48l32.h    |  101 +
 include/linux/mfd/cs48l32/core.h              |   49 +
 include/linux/mfd/cs48l32/registers.h         |  509 +++
 include/sound/cs48l32.h                       |   89 +
 sound/soc/codecs/Kconfig                      |    9 +
 sound/soc/codecs/Makefile                     |    2 +
 sound/soc/codecs/cs48l32-core.c               | 2782 +++++++++++++++++
 sound/soc/codecs/cs48l32.c                    | 1211 +++++++
 sound/soc/codecs/cs48l32.h                    |  386 +++
 sound/soc/codecs/wm_adsp.c                    |   11 +
 sound/soc/codecs/wm_adsp.h                    |    1 +
 31 files changed, 7997 insertions(+), 14 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mfd/cirrus,cs48l32.yaml
 create mode 100644 Documentation/devicetree/bindings/pinctrl/cirrus,cs48l32.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/cirrus,cs48l32.yaml
 create mode 100644 drivers/irqchip/irq-cirrus-cs48l32.c
 create mode 100644 drivers/irqchip/irq-cirrus-cs48l32.h
 create mode 100644 drivers/mfd/cs48l32-tables.c
 create mode 100644 drivers/mfd/cs48l32.c
 create mode 100644 drivers/mfd/cs48l32.h
 create mode 100644 drivers/pinctrl/cirrus/pinctrl-cs48l32.c
 create mode 100644 drivers/pinctrl/cirrus/pinctrl-cs48l32.h
 create mode 100644 include/dt-bindings/sound/cs48l32.h
 create mode 100644 include/linux/irqchip/irq-cirrus-cs48l32.h
 create mode 100644 include/linux/mfd/cs48l32/core.h
 create mode 100644 include/linux/mfd/cs48l32/registers.h
 create mode 100644 include/sound/cs48l32.h
 create mode 100644 sound/soc/codecs/cs48l32-core.c
 create mode 100644 sound/soc/codecs/cs48l32.c
 create mode 100644 sound/soc/codecs/cs48l32.h

Comments

Rob Herring (Arm) Nov. 9, 2022, 9:09 p.m. UTC | #1
On Wed, 09 Nov 2022 16:53:30 +0000, Richard Fitzgerald wrote:
> Codecs in this family have multiple digital and analog audio I/O that
> support a variety of external hardware connections and configurations.
> 
> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
> ---
>  .../bindings/sound/cirrus,cs48l32.yaml        | 96 +++++++++++++++++++
>  include/dt-bindings/sound/cs48l32.h           | 25 +++++
>  2 files changed, 121 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/sound/cirrus,cs48l32.yaml
>  create mode 100644 include/dt-bindings/sound/cs48l32.h
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:
./Documentation/devicetree/bindings/sound/cirrus,cs48l32.yaml:44:20: [error] syntax error: mapping values are not allowed here (syntax)

dtschema/dtc warnings/errors:
make[1]: *** Deleting file 'Documentation/devicetree/bindings/sound/cirrus,cs48l32.example.dts'
Documentation/devicetree/bindings/sound/cirrus,cs48l32.yaml:44:20: mapping values are not allowed here
make[1]: *** [Documentation/devicetree/bindings/Makefile:26: Documentation/devicetree/bindings/sound/cirrus,cs48l32.example.dts] Error 1
make[1]: *** Waiting for unfinished jobs....
./Documentation/devicetree/bindings/sound/cirrus,cs48l32.yaml:44:20: mapping values are not allowed here
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/sound/cirrus,cs48l32.yaml: ignoring, error parsing file
make: *** [Makefile:1492: dt_binding_check] Error 2

doc reference errors (make refcheckdocs):
Documentation/devicetree/bindings/sound/cirrus,cs48l32.yaml: Documentation/devicetree/bindings/mfd/cirrus,cs48l32.yaml

See https://patchwork.ozlabs.org/patch/

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.
Rob Herring (Arm) Nov. 9, 2022, 9:09 p.m. UTC | #2
On Wed, 09 Nov 2022 16:53:20 +0000, Richard Fitzgerald wrote:
> The CS48L32 has multiple digital and analog audio I/O, a
> high-performance low-power programmable audio DSP, and a variety of
> power-efficient fixed-function audio processors, with digital
> mixing and routing.
> 
> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
> ---
>  .../bindings/mfd/cirrus,cs48l32.yaml          | 166 ++++++++++++++++++
>  1 file changed, 166 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mfd/cirrus,cs48l32.yaml
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:
./Documentation/devicetree/bindings/mfd/cirrus,cs48l32.yaml:107:7: [warning] wrong indentation: expected 4 but found 6 (indentation)
./Documentation/devicetree/bindings/mfd/cirrus,cs48l32.yaml:108:7: [warning] wrong indentation: expected 8 but found 6 (indentation)

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mfd/cirrus,cs48l32.yaml: properties:clocks: 'oneOf' conditional failed, one must be fixed:
	/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mfd/cirrus,cs48l32.yaml: properties:clocks: 'anyOf' conditional failed, one must be fixed:
		'minItems' is not one of ['maxItems', 'description', 'deprecated']
			hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values.
		'minItems' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf']
		'maxItems' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf']
		1 is less than the minimum of 2
			hint: Arrays must be described with a combination of minItems/maxItems/items
		hint: cell array properties must define how many entries and what the entries are when there is more than one entry.
		from schema $id: http://devicetree.org/meta-schemas/clocks.yaml#
	'minItems' is not one of ['type', 'description', 'dependencies', 'dependentRequired', 'dependentSchemas', 'properties', 'patternProperties', 'additionalProperties', 'unevaluatedProperties', 'deprecated', 'required', 'allOf', 'anyOf', 'oneOf', '$ref']
	'maxItems' is not one of ['type', 'description', 'dependencies', 'dependentRequired', 'dependentSchemas', 'properties', 'patternProperties', 'additionalProperties', 'unevaluatedProperties', 'deprecated', 'required', 'allOf', 'anyOf', 'oneOf', '$ref']
	'type' is a required property
		hint: DT nodes ("object" type in schemas) can only use a subset of json-schema keywords
	from schema $id: http://devicetree.org/meta-schemas/clocks.yaml#
./Documentation/devicetree/bindings/mfd/cirrus,cs48l32.yaml: Unable to find schema file matching $id: http://devicetree.org/schemas/pinctrl/cirrus,cs48l32.yaml
Documentation/devicetree/bindings/mfd/cirrus,cs48l32.example.dts:21:18: fatal error: dt-bindings/sound/cs48l32.h: No such file or directory
   21 |         #include <dt-bindings/sound/cs48l32.h>
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [scripts/Makefile.lib:406: Documentation/devicetree/bindings/mfd/cirrus,cs48l32.example.dtb] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1492: dt_binding_check] Error 2

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.
Linus Walleij Nov. 10, 2022, 10:02 a.m. UTC | #3
On Wed, Nov 9, 2022 at 5:53 PM Richard Fitzgerald
<rf@opensource.cirrus.com> wrote:

> From: Piotr Stankiewicz <piotrs@opensource.cirrus.com>
>
> Codecs in this family have multiple digital I/O functions for audio,
> DSP subsystem, GPIO and various special functions. All muxable pins
> are selectable as either a GPIO or an alternate function.
>
> Signed-off-by: Piotr Stankiewicz <piotrs@opensource.cirrus.com>
> Signed-off-by: Qi Zhou <qi.zhou@cirrus.com>
> Signed-off-by: Stuart Henderson <stuarth@opensource.cirrus.com>
> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>

This looks OK.
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Does this patch have compile-time dependencies on the other
patches or is it something I can just merge separately?

Yours,
Linus Walleij
Richard Fitzgerald Nov. 10, 2022, 10:55 a.m. UTC | #4
On 10/11/2022 10:02, Linus Walleij wrote:
> On Wed, Nov 9, 2022 at 5:53 PM Richard Fitzgerald
> <rf@opensource.cirrus.com> wrote:
> 
>> From: Piotr Stankiewicz <piotrs@opensource.cirrus.com>
>>
>> Codecs in this family have multiple digital I/O functions for audio,
>> DSP subsystem, GPIO and various special functions. All muxable pins
>> are selectable as either a GPIO or an alternate function.
>>
>> Signed-off-by: Piotr Stankiewicz <piotrs@opensource.cirrus.com>
>> Signed-off-by: Qi Zhou <qi.zhou@cirrus.com>
>> Signed-off-by: Stuart Henderson <stuarth@opensource.cirrus.com>
>> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
> 
> This looks OK.
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> 
> Does this patch have compile-time dependencies on the other
> patches or is it something I can just merge separately?
> 

It has compile-time dependencies on the MFD at least.
I should have said that in the cover letter.

> Yours,
> Linus Walleij
Mark Brown Nov. 10, 2022, 8:53 p.m. UTC | #5
On Wed, Nov 09, 2022 at 04:53:19PM +0000, Richard Fitzgerald wrote:

>   regulator: arizona-micsupp: Don't hardcode use of ARIZONA defines
>   regulator: arizona-micsupp: Don't use a common regulator name
>   ASoC: wm_adsp: Allow client to hook into pre_run callback

The regulator and ASoC bits look good.  It looks like this is going to
need another spin for at least the DT and irqchip bits, I think it'd
make sense to take the above cleanup patches for this release even if
everything else misses it to cut down on future patch volume.  I'll
leave it for a bit and do that unless someone has concerns, it's going
to be easier than applying and sending pull requests.
Richard Fitzgerald Nov. 11, 2022, 1:50 p.m. UTC | #6
On 10/11/2022 20:53, Mark Brown wrote:
> On Wed, Nov 09, 2022 at 04:53:19PM +0000, Richard Fitzgerald wrote:
> 
>>    regulator: arizona-micsupp: Don't hardcode use of ARIZONA defines
>>    regulator: arizona-micsupp: Don't use a common regulator name
>>    ASoC: wm_adsp: Allow client to hook into pre_run callback
> 
> The regulator and ASoC bits look good.  It looks like this is going to
> need another spin for at least the DT and irqchip bits, I think it'd
> make sense to take the above cleanup patches for this release even if
> everything else misses it to cut down on future patch volume.  I'll
> leave it for a bit and do that unless someone has concerns, it's going
> to be easier than applying and sending pull requests.

Yes, I have tested that these 3 patches can apply and build on their
own and don't break the older chips.

I should have put these at the start of the chain and mentioned in the
cover letter that they can be taken independently.
Mark Brown Nov. 23, 2022, 1:11 p.m. UTC | #7
On Wed, 9 Nov 2022 16:53:19 +0000, Richard Fitzgerald wrote:
> The CS48L32 is a high-performance low-power audio DSP for smartphones
> and other portable audio devices. It has various digital audio I/O,
> a programmable Halo Core DSP, fixed-function audio processors,
> configurable GPIO and microphone bias regulators.
> 
> The CS48L31 and CS48L33 were derivatives of the CS48L32.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[10/12] ASoC: wm_adsp: Allow client to hook into pre_run callback
        commit: fe07130870c8540bc0cddbaa8d4521ecdba6b560

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark