[0/2] ASoC: pcm179x: Add support for pcm1795 and pcm1796
mbox series

Message ID 20260917171439.3822603-1-michael@amarulasolutions.com
Headers show
Series
  • ASoC: pcm179x: Add support for pcm1795 and pcm1796
Related show

Message

Michael Trimarchi Sept. 17, 2026, 5:14 p.m. UTC
This adds support for the PCM1795 and the PCM1796 to the pcm179x driver.

The PCM1795 is register compatible with the PCM1792A, but it encodes two
of the register 18 FMT[2:0] values differently, so the format encoding is
described with a per-codec table instead of the width switches. Only the
PCM1795 has real 32-bit formats; on the PCM1792A and the PCM1796 a 32-bit
container keeps the 24-bit code, as it always has. Left-justified, which
the driver accepted but never programmed, is added on the way.

Change history (v6 come from 2016):

Today -> v6:
	- Do not move a 32-bit container to the 32-bit codes on the pcm1792a
	  and the pcm1796, they have no 32-bit format. Go back to the v3
	  behaviour of keeping the 24-bit code, and advertise S32_LE on them
	  again. Only the pcm1795 uses the 32-bit codes
	- Add per-codec tables mapping the DAI format and the sample width to
	  the FMT[2:0] value, instead of extending the width switches
	- Add left-justified support
	- Resolve the codec model with device_get_match_data() and keep the
	  of_device_id tables in the bus drivers. MODULE_DEVICE_TABLE() aliases
	  a table that has to be defined in the same translation unit, it
	  cannot alias one defined in the common file
	- Split the device tree documentation into its own patch, and add the
	  compatibles to trivial-codec.yaml, pcm179x.txt was folded into it
	  when the trivial codec bindings were consolidated

Changes v5 -> v6
	- Add device tree documentation

Changes v4 -> v5
	- remove dead code

Changes v3 -> v4:
	- clean up compatible list
	- use enum type instead of pointer of int

Changes v2 -> v3:
	- rebase after i2c support

Changes v1 -> v2:
	- Use switch for support new variants
	- sort the compatible list

Michael Trimarchi (2):
  ASoC: dt-bindings: Add ti,pcm1795 and ti,pcm1796
  ASoC: pcm179x: Add support for pcm1795 and pcm1796

 .../devicetree/bindings/sound/trivial-codec.yaml   |   2 +
 sound/soc/codecs/pcm179x-i2c.c                     |   2 +
 sound/soc/codecs/pcm179x-spi.c                     |   2 +
 sound/soc/codecs/pcm179x.c                         | 116 +++++++++++++++------
 sound/soc/codecs/pcm179x.h                         |  11 ++
 5 files changed, 102 insertions(+), 31 deletions(-)

To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.