Skip to content

Conversation

@j-schambacher
Copy link
Contributor

With this PR we are trying a implement a new driver concept for more complex, multi-channel soundcards.
All cards have their own firmware on a MCU managing controls of various DACs or ADCs. During the initial setup the driver
reads some basic configuration like UUID, number of DAC and ADC channels etc. Based on this fundamental data volume and gain controls are generated and applied. Later, we may implement more specific controls based on UUID and/or other register settings. That's also the reason why there are already more definitions than the current driver uses.
We hope this approach could ease maintenance on HW and SW side.

Joerg

This adds a new driver for complex, multi-channel soundcards.
The cards have their own management using an onboard MCU for clock
generation and controls of various DACs or ADCs. Data provided by
the MCU's register via I2C allows flexible configuration of a
number of DAC and ADC channels, volumes, gain settings and other
functions like mute and filter settings.

Signed-off-by: j-schambacher <[email protected]>
@j-schambacher
Copy link
Contributor Author

I'll wait for further feedback before I'll add the forgotten README ....

"gpio24", "gpio25", "gpio26",
"gpio27";
bias-disable;
status = "okay";
Copy link
Contributor

Choose a reason for hiding this comment

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

This line is always unnecessary (no status means enabled), except where it overwrites a status = "disabled";, but for gpio/pin declarations like this it is meaningless.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

"gpio24", "gpio25", "gpio26",
"gpio27";
bias-disable;
status = "okay";
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed


static int hb_controller_probe(struct platform_device *pdev)
{
struct i2c_adapter *adap = i2c_get_adapter(1);
Copy link
Contributor

Choose a reason for hiding this comment

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

This was a surprise - embedding what is effectively the codec driver. How do you arrange the I2C1 is enabled, since the overlays aren't doing so?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added the i2c1 to the our dt-overlays. Seems no one in the team tested without manually enabling the i2c1 in the config including me. Thanks for checking and finding!

__overlay__ {
compatible = "hifiberry,hifiberry-studio-dac8x";
i2s-controller = <&i2s_clk_consumer>;
clk-provider;
Copy link
Contributor

Choose a reason for hiding this comment

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

This would not be necessary if the Pro had a different compatible string, but you may have reasons to prefer doing it like this - I'm not really bothered either way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd like to keep it as is. It seems the easiest and simple way for us.

Adds two overlays for clock consumer and provider mode.
Only compatible with Pi 5 (bcm2712).

Signed-off-by: j-schambacher <[email protected]>
Adding the Studio DAC8x to the Pi 5 defconfig.

Signed-off-by: j-schambacher <[email protected]>
CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUSADC=m
CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUSADCPRO=m
CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUSDSP=m
CONFIG_SND_BCM2708_SOC_HIFIBERRY_STUDIO_DAC8X=m
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you should also add this to bcm2711_defconfig, which runs happily on Pi 5, just with 4kB pages instead of 16kB.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see that bcm2711 kernel runs on a Pi 5 but our driver does not support Pi 4 as it's made for multi channel audio (only).

Copy link
Contributor

Choose a reason for hiding this comment

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

That's not a problem. All the kernels have support for lots of hardware that most people don't have, which is fine if the drivers are modules.

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