Skip to content

ASoC: hifiberry_studio: change driver name and add support for new soundcards#7487

Merged
pelwell merged 4 commits into
raspberrypi:rpi-6.18.yfrom
j-schambacher:upstream-pr-prep
Jul 14, 2026
Merged

ASoC: hifiberry_studio: change driver name and add support for new soundcards#7487
pelwell merged 4 commits into
raspberrypi:rpi-6.18.yfrom
j-schambacher:upstream-pr-prep

Conversation

@j-schambacher

Copy link
Copy Markdown
Contributor

As discussed the first commit is only the name change w/o functional changes.

  1. ASoC: rename hifiberry_studio_dac8x.c to hifiberry_studio.c
    Pure rename: file, DAC8x-specific identifiers, the Kconfig symbol and the
    Makefile object/obj-y references. No behavioural change.

  2. ASoC: hifiberry_studio: add multi-card and Digi/AES support
    Splits the onboard controller handling into a separate I2C client driver
    (hifiberry,hb-studio-ctrl) that reads firmware/hardware version, UUID,
    channel counts and clock capabilities once at probe; the card type
    (DAC8x/ADC8x vs. AES) is decoded from the controller UUID and
    published for the platform/machine driver, which defers
    (-EPROBE_DEFER) until it's available. Registers a
    different ALSA control set depending on detected card type, adds
    AES input-rate detection/locking (capture forces DIR/RX only when a
    valid, matching-rate AES input is present; mismatched rates are
    rejected), and adds GPIO7 FS-change/PLL-lost interrupt handling for
    AES-type cards only, decided automatically from the detected card type.

  3. overlays: hifiberry-studio: add Digi/AES overlay, register controller
    Adds hifiberry-studio-digi-overlay.dts (wired like the DAC8x PRO
    overlay: i2s1, clk-provider) plus the GPIO7 interrupt line. Adds the
    hb_studio_ctrl I2C client node and a no_controls override to the two
    existing DAC8x overlays. The PRO overlay switches to the new
    hifiberry,hifiberry-studio compatible string; the base overlay keeps
    hifiberry,hifiberry-studio-dac8x for backwards compatibility.

  4. arm64: configs: fix stale HIFIBERRY_STUDIO_DAC8X symbol name
    bcm2711_defconfig, bcm2711_rt_defconfig and bcm2712_defconfig.
    Updates all three to the new name.

The driver is going to add support for other HiFiBerry Studio-family
cards (e.g. AES/SPDIF variants) that share the same onboard
controller/firmware and I2C register protocol as the DAC8x cards. Rename
the file and its DAC8x-specific identifiers to the more generic
"hifiberry_studio" name in preparation for that, without changing any
behaviour.

No functional change.

Signed-off-by: j-schambacher <joerg@hifiberry.com>

@pelwell pelwell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a large change to non-mainline code that I don't care about that much. It seems to be well written, but I haven't been through it line by line checking the functionality - there are just a few minor comments.

Comment thread sound/soc/bcm/hifiberry_studio.c Outdated
* analog card to report here, so only look for it for AES cards.
*/
if (priv->card_type == AES) {
dev_info(&pdev->dev, "GPIO checking ..\n");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unnecessary log spam, presumably left over from development.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, going to remove it.

static struct i2c_client *hb_uni_i2c_client;
struct hb_uni_private {
static struct i2c_client *hb_studio_i2c_client;
struct hb_studio_private {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a lot of these name changes would have been better in an up-front commit, so that the logic changes stand out, but don't resubmit it now - it's just feedback for next time.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thanks. I know, it's a lot of rewritten and renamed stuff.

Comment thread sound/soc/bcm/hifiberry_studio.c Outdated
&priv->card_info.master_vol, MUTE_OUTPUTS - MASTER_VOL);
regcache_cache_only(priv->regmap, false);
ret = of_property_read_string(pdev->dev.of_node,
"card-type", &priv->type);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value seems to only be used here - the "using default" message doesn't appear to have any consequences.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another leftover from development and now disconnected from any other control. I left it in under the impression that we can potentially use it somehow. I'm going to remove it, also in the overlays.

Generalize the driver to support different cards that share the
same onboard controller/firmware and I2C register protocol:
the existing DAC8x/ADC8x analog cards and the new Studio Digi/AES card.

- Split the onboard controller handling into a separate I2C client
  driver (compatible "hifiberry,hb-studio-ctrl") that creates a shared
  regmap and reads firmware/hardware capabilities at probe time.
  The card type is decoded from the last 4 bytes of the controller's
  UUID and used by the platform/machine driver.
- It now registers different ALSA controls depending on the
  detected card.
- Add AES input-rate detection and locking: capture on an AES card
  requires DIR/RX mode as the Pi's I2S interface can only run at the
  same sample rate for either direction.
- Add GPIO7 interrupt handling (FS-change / PLL-lost) for Digi/AES
  cards: the IRQ stops any active playback/capture substreams via
  snd_pcm_stop() under a spinlock shared with the hw_params/startup/
  shutdown paths. The IRQ is only requested for AES-type cards, decided
  automatically from the detected card type.
- Add the "hifiberry,hifiberry-studio" compatible string alongside the
  existing "hifiberry,hifiberry-studio-dac8x" one, used by card
  variants that don't need the DAC8x-specific compatible string for
  backwards compatibility.

Signed-off-by: j-schambacher <joerg@hifiberry.com>
Add hifiberry-studio-digi-overlay.dts for the Studio Digi/AES card,
wired the same way as the DAC8x PRO overlay (i2s1, clk-provider), plus
the GPIO7 FS-change/PLL-lost interrupt line the driver now requests
automatically for AES-type cards.

Both existing DAC8x overlays use the "hb_studio_ctrl" I2C client node
(compatible "hifiberry,hb-studio-ctrl") so the driver's separate
controller probe can be attached.
A "no_controls" can be used to skip registering the ALSA controls for
a card. The PRO overlay also switches to the new
"hifiberry,hifiberry-studio" compatible string and
adds the informational "card-type" property; the base overlay keeps
"hifiberry,hifiberry-studio-dac8x" for backwards compatibility.

Signed-off-by: j-schambacher <joerg@hifiberry.com>
The Kconfig symbol backing the HiFiBerry Studio driver was renamed
from SND_BCM2708_SOC_HIFIBERRY_STUDIO_DAC8X to
SND_BCM2708_SOC_HIFIBERRY_STUDIO as part of generalizing the driver
beyond the DAC8x card, but the defconfigs enabling it by default were
left referencing the old, now nonexistent symbol name, silently
dropping the driver from being built by these defconfigs. Update all
three affected defconfigs to the new symbol name.

Signed-off-by: j-schambacher <joerg@hifiberry.com>
@pelwell pelwell merged commit 4b25f72 into raspberrypi:rpi-6.18.y Jul 14, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants