orchardaudio
Posts: 102
Joined: Wed Feb 03, 2016 11:19 pm
Contact: Website Facebook Twitter

Volume Control data over SPI BUS

Mon Dec 10, 2018 12:26 pm

Hello,

Can somebody here please point me in the right direction.

I need to send volume control data over spi bus to a a HW volume control device.

Is there any existing way of doing this?

What do I need to to to get this to work?

Thanks;
Leo
~~Orchard Audio~~
How do you like them apples?
www.orchardaudio.com
www.facebook.com/orchardaudio

HiassofT
Posts: 222
Joined: Fri Jun 30, 2017 10:07 pm
Location: Salzburg, Austria
Contact: Website

Re: Volume Control data over SPI BUS

Mon Dec 10, 2018 12:56 pm

If this is in addition to an (I2S) audio card then just create a codec driver that exposes a volume control mixer and add that as an auxiliary device in the card driver (aux_dev list in snd_soc_card or aux-devs DT property in the simple audio card driver).

See for example the various amplifier drivers in sound/soc/codecs (grep Kconfig for amplifier), most of them use I2C but for SPI it'll work exactly the same way (just use spi_driver instead of i2c_driver, actual bus access is handled via regmap).

so long,

Hias

orchardaudio
Posts: 102
Joined: Wed Feb 03, 2016 11:19 pm
Contact: Website Facebook Twitter

Re: Volume Control data over SPI BUS

Mon Dec 10, 2018 5:40 pm

HiassofT wrote:
Mon Dec 10, 2018 12:56 pm
If this is in addition to an (I2S) audio card then just create a codec driver that exposes a volume control mixer and add that as an auxiliary device in the card driver (aux_dev list in snd_soc_card or aux-devs DT property in the simple audio card driver).

See for example the various amplifier drivers in sound/soc/codecs (grep Kconfig for amplifier), most of them use I2C but for SPI it'll work exactly the same way (just use spi_driver instead of i2c_driver, actual bus access is handled via regmap).

so long,

Hias
Yes this in in addition to I2S sound card.

I am not a linux person so isv there a step by step guide on how to do this.

I have some code written for a PIC16F from micro chip but how do I port that or reuse it for the Pi?
~~Orchard Audio~~
How do you like them apples?
www.orchardaudio.com
www.facebook.com/orchardaudio

HiassofT
Posts: 222
Joined: Fri Jun 30, 2017 10:07 pm
Location: Salzburg, Austria
Contact: Website

Re: Volume Control data over SPI BUS

Mon Dec 10, 2018 9:05 pm

Look at the kernel docs in Documentation/sound, especially the soc folder. An check the existing drivers in sound/soc/codecs, there a re a lot of examples in there.

so long,

Hias

Return to “Advanced users”