Skip to content

Adding Support for interlude audio Hats. - #5949

Merged
pelwell merged 2 commits into
raspberrypi:rpi-6.1.yfrom
InterludeAudio:rpi-6.1.y
Feb 15, 2024
Merged

pelwell merged 2 commits into
raspberrypi:rpi-6.1.yfrom
InterludeAudio:rpi-6.1.y

Conversation

@Yash-BlueRockSoft

Copy link
Copy Markdown

Interlude Audio has created 2 hats for the raspberry to be put up for sale online at www.interludeaudio.com the hats are based of the cs4272 and wm8805 codec and spdif chip which which leverage pre-existing drivers, enhanced with support for the unique features of our devices. We hope to mainline our changes to the kernel so as to have them readily available for inclusion in future releases.

@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.

It's good that you are adding your code to an existing driver, but it shouldn't impact other users of the driver. Go through the review comments and checkpatch complaints, squash the results down to two commits - a driver patch and one for the overlays - then force push it so we can review the result.

Comment thread sound/soc/bcm/rpi-wm8804-soundcard.c Outdated
snd_clk48gpio =
devm_gpiod_get(&pdev->dev, "clock48", GPIOD_OUT_LOW);

led_gpio_1 = devm_gpiod_get(&pdev->dev, "led1", GPIOD_OUT_LOW);

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.

Board-specific code like this needs to go into the board-specific probe function, in this case snd_interlude_audio_digital_probe.

Comment thread sound/soc/bcm/rpi-wm8804-soundcard.c Outdated
dev_err(rtd->card->dev,
"Failed to set WM8804 SYSCLK, unsupported samplerate %d\n",
samplerate);

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.

Don't make random whitespace changes.


/* clear until all clocks are setup properly */
wm8804_samplerate = 0;

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.

Don't make random whitespace changes.

Comment thread sound/soc/bcm/rpi-wm8804-soundcard.c Outdated
break;
case 44100:
sampling_freq = 0x00;
gpiod_set_value_cansleep(led_gpio_1, 1);

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 code is shared with all the other wm8804-based cards. You should create your own hw_params function that calls this one and also sets the LEDs as you want them. You can hook that in by providing a .ops member to snd_interlude_audio_digital_dai.

Comment thread sound/soc/bcm/rpi-wm8804-soundcard.c Resolved
@Yash-BlueRockSoft

Copy link
Copy Markdown
Author

Hello @pelwell all requested changes have been completed we have squashed the changes down to 2 commits and have tested the modified driver code and confirmed it works; look forward to your review

@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.

I think you're nearly there, but there are a few improvements still to be made. See the inline comments. Also, please fix the checkpatch errors and warnings: https://github.com/raspberrypi/linux/actions/runs/7908859459/job/21601350819?pr=5949#step:6:74

Comment thread sound/soc/bcm/rpi-wm8804-soundcard.c Outdated

static int snd_interlude_audio_digital_probe(struct platform_device *pdev)
{
pr_debug("%s\n", __func__);

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.

You can drop this line now.

Comment thread sound/soc/bcm/rpi-wm8804-soundcard.c Outdated
{
snd_soc_add_component_controls(component, wm8805_input_controls_card,
ARRAY_SIZE(wm8805_input_controls_card));
pr_debug("adding new controls");

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.

Drop this line.

Comment thread sound/soc/bcm/rpi-wm8804-soundcard.c Outdated
snd_clk48gpio =
devm_gpiod_get(&pdev->dev, "clock48", GPIOD_OUT_LOW);

custom_reset = devm_gpiod_get(&pdev->dev, "reset", GPIOD_OUT_LOW);

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.

All of this can go in your custom probe function.

@Yash-BlueRockSoft
Yash-BlueRockSoft force-pushed the rpi-6.1.y branch 3 times, most recently from e60c176 to 31d0747 Compare February 15, 2024 18:18
Comment thread sound/soc/bcm/rpi-wm8804-soundcard.c Outdated
snd_clk48gpio =
devm_gpiod_get(&pdev->dev, "clock48", GPIOD_OUT_LOW);

if(of_property_read_u32(pdev->dev.of_node, "sys_clk", &sysclk_freq))

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 meant all of it, including the sys_clk logic - you have no reason to make changes for the other drivers, particularly the kernel log spam.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

okay sounds good changes have been made

@Yash-BlueRockSoft
Yash-BlueRockSoft force-pushed the rpi-6.1.y branch 4 times, most recently from 738a168 to 01bd752 Compare February 15, 2024 21:54
Implementing driver support for
Interlude audio's WM8805 based digital hat
by leveraging existing drivers
Adding 2 new overlays for use with
Interlude Audio's Digital and Analog hats
adding descriptions for both in README
adding changes to Makefile to include both DT's
@Yash-BlueRockSoft

Copy link
Copy Markdown
Author

All changes have been made the build tests and checkpatch review action should pass as well

@pelwell

pelwell commented Feb 15, 2024

Copy link
Copy Markdown
Contributor

If you're happy with that then so am I. I'll merge once the build checks have completed.

@pelwell
pelwell merged commit d787ecf into raspberrypi:rpi-6.1.y Feb 15, 2024
@Yash-BlueRockSoft

Copy link
Copy Markdown
Author

Thanks for your help

popcornmix added a commit to raspberrypi/firmware that referenced this pull request Feb 19, 2024
kernel: vc4/hvs: Fix lbm size calculation for yuv
See: raspberrypi/linux#5963

kernel: Set PCIe QOS chicken bits for 2712D0
See: raspberrypi/linux#5955

kernel: Add support for VEML6075 and HTS221 in i2c-sensor overlay
See: raspberrypi/linux#5965

kernel: Adding Support for interlude audio Hats
See: raspberrypi/linux#5949

kernel: brcmfmac: Add sae_ext WPA3 support
See: raspberrypi/linux#5945

kernel: arm: dt: bcm2712: Reduce DDC frequency to 97.5kHz from 200kHz
See: raspberrypi/linux#5954

kernel: ARM: dts: Add CM5 DTS support
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Feb 19, 2024
kernel: vc4/hvs: Fix lbm size calculation for yuv
See: raspberrypi/linux#5963

kernel: Set PCIe QOS chicken bits for 2712D0
See: raspberrypi/linux#5955

kernel: Add support for VEML6075 and HTS221 in i2c-sensor overlay
See: raspberrypi/linux#5965

kernel: Adding Support for interlude audio Hats
See: raspberrypi/linux#5949

kernel: brcmfmac: Add sae_ext WPA3 support
See: raspberrypi/linux#5945

kernel: arm: dt: bcm2712: Reduce DDC frequency to 97.5kHz from 200kHz
See: raspberrypi/linux#5954

kernel: ARM: dts: Add CM5 DTS support
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.

3 participants