mbox series

[0/9] staging: bcm2835-audio: Cleanups and upgrades

Message ID 20181016150228.16994-1-nsaenzjulienne@suse.de
Headers show
Series staging: bcm2835-audio: Cleanups and upgrades | expand

Message

Nicolas Saenz Julienne Oct. 16, 2018, 3:02 p.m. UTC
Hi,

I just received a RPi3B+ and decided to have a go at fixing stuff in
the audio driver:

The first half of the patchset are just random fixes found while reading
the code.

The second half provides devicetree bindings for bcm2835-audio and fixes
the probe sequence so it fails gracefully if VCHIQ isn't there (as per
TODO).

The series was developed on top of linux-next and tested on a RPi2B and
RPi3B+. Sadly I don't have an HDMI monitor with sound so I only tested
the mini jack output.

Thanks,
Nicolas

===

Nicolas Saenz Julienne (9):
  staging: bcm2835-audio: unify FOURCC command definitions
  staging: bcm2835-audio: don't initialize memory twice
  staging: bcm2835-audio: reorder variable declarations & remove trivial
    comments
  staging: bcm2835-audio: use anonymous union in struct vc_audio_msg
  staging: bcm2835-audio: more generic probe function name
  ASoC: dt-bindings: bcm2835-rpi: add onboard audio bindings
  ARM: dts: bcm2835-rpi: add onboard audio device
  staging: vchiq_arm: add function to check if probe was successful
  staging: bcm2835-audio: check for VCHIQ during probe

 .../bindings/sound/brcm,bcm2835-audio.txt     | 15 +++++++
 arch/arm/boot/dts/bcm2835-rpi.dtsi            |  5 +++
 .../vc04_services/bcm2835-audio/bcm2835-pcm.c | 10 +----
 .../bcm2835-audio/bcm2835-vchiq.c             | 39 ++++++++-----------
 .../vc04_services/bcm2835-audio/bcm2835.c     | 30 ++++++++------
 .../bcm2835-audio/vc_vchi_audioserv_defs.h    |  6 ++-
 .../vc04_services/interface/vchi/vchi.h       |  3 ++
 .../interface/vchiq_arm/vchiq_2835_arm.c      |  2 +
 .../interface/vchiq_arm/vchiq_arm.c           | 16 ++++++++
 .../interface/vchiq_arm/vchiq_arm.h           |  1 +
 .../interface/vchiq_arm/vchiq_if.h            |  4 ++
 .../interface/vchiq_arm/vchiq_shim.c          |  7 ++++
 12 files changed, 95 insertions(+), 43 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/brcm,bcm2835-audio.txt

Comments

Takashi Iwai Oct. 16, 2018, 3:47 p.m. UTC | #1
On Tue, 16 Oct 2018 17:02:19 +0200,
Nicolas Saenz Julienne wrote:
> 
> Hi,
> 
> I just received a RPi3B+ and decided to have a go at fixing stuff in
> the audio driver:
> 
> The first half of the patchset are just random fixes found while reading
> the code.
> 
> The second half provides devicetree bindings for bcm2835-audio and fixes
> the probe sequence so it fails gracefully if VCHIQ isn't there (as per
> TODO).
> 
> The series was developed on top of linux-next and tested on a RPi2B and
> RPi3B+. Sadly I don't have an HDMI monitor with sound so I only tested
> the mini jack output.

All patches look good to me:
  Reviewed-by: Takashi Iwai <tiwai@suse.de>


thanks,

Takashi

> 
> Thanks,
> Nicolas
> 
> ===
> 
> Nicolas Saenz Julienne (9):
>   staging: bcm2835-audio: unify FOURCC command definitions
>   staging: bcm2835-audio: don't initialize memory twice
>   staging: bcm2835-audio: reorder variable declarations & remove trivial
>     comments
>   staging: bcm2835-audio: use anonymous union in struct vc_audio_msg
>   staging: bcm2835-audio: more generic probe function name
>   ASoC: dt-bindings: bcm2835-rpi: add onboard audio bindings
>   ARM: dts: bcm2835-rpi: add onboard audio device
>   staging: vchiq_arm: add function to check if probe was successful
>   staging: bcm2835-audio: check for VCHIQ during probe
> 
>  .../bindings/sound/brcm,bcm2835-audio.txt     | 15 +++++++
>  arch/arm/boot/dts/bcm2835-rpi.dtsi            |  5 +++
>  .../vc04_services/bcm2835-audio/bcm2835-pcm.c | 10 +----
>  .../bcm2835-audio/bcm2835-vchiq.c             | 39 ++++++++-----------
>  .../vc04_services/bcm2835-audio/bcm2835.c     | 30 ++++++++------
>  .../bcm2835-audio/vc_vchi_audioserv_defs.h    |  6 ++-
>  .../vc04_services/interface/vchi/vchi.h       |  3 ++
>  .../interface/vchiq_arm/vchiq_2835_arm.c      |  2 +
>  .../interface/vchiq_arm/vchiq_arm.c           | 16 ++++++++
>  .../interface/vchiq_arm/vchiq_arm.h           |  1 +
>  .../interface/vchiq_arm/vchiq_if.h            |  4 ++
>  .../interface/vchiq_arm/vchiq_shim.c          |  7 ++++
>  12 files changed, 95 insertions(+), 43 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/sound/brcm,bcm2835-audio.txt
> 
> -- 
> 2.19.1
>
Takashi Iwai Oct. 16, 2018, 3:47 p.m. UTC | #2
On Tue, 16 Oct 2018 17:02:24 +0200,
Nicolas Saenz Julienne wrote:
> 
> There will only be one probe function, there is no use for appendig
> "_dt" the end of the name.
> 
> Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
> ---
>  drivers/staging/vc04_services/bcm2835-audio/bcm2835.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
> index 6ee8334dfc81..039565311d10 100644
> --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
> +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835.c
> @@ -291,7 +291,7 @@ static int snd_add_child_devices(struct device *device, u32 numchans)
>  	return 0;
>  }
>  
> -static int snd_bcm2835_alsa_probe_dt(struct platform_device *pdev)
> +static int snd_bcm2835_alsa_probe(struct platform_device *pdev)
>  {
>  	struct device *dev = &pdev->dev;
>  	u32 numchans;
> @@ -344,7 +344,7 @@ static const struct of_device_id snd_bcm2835_of_match_table[] = {
>  MODULE_DEVICE_TABLE(of, snd_bcm2835_of_match_table);
>  
>  static struct platform_driver bcm2835_alsa0_driver = {

Actually now I wonder why this "0" here...

It has nothing to do with the patch, but it's a good opportunity to
clean it up, too.


thanks,

Takashi
Eric Anholt Oct. 16, 2018, 4:18 p.m. UTC | #3
Nicolas Saenz Julienne <nsaenzjulienne@suse.de> writes:

> The audio device interfaces with VCHIQ to send audio through the rpi's
> Headphones & HDMI.
>
> Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
> ---
>  arch/arm/boot/dts/bcm2835-rpi.dtsi | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/arch/arm/boot/dts/bcm2835-rpi.dtsi b/arch/arm/boot/dts/bcm2835-rpi.dtsi
> index cb2d6d78a7fb..6cc580d17862 100644
> --- a/arch/arm/boot/dts/bcm2835-rpi.dtsi
> +++ b/arch/arm/boot/dts/bcm2835-rpi.dtsi
> @@ -35,6 +35,11 @@
>  			reg = <0x7e00b840 0xf>;
>  			interrupts = <0 2>;
>  		};
> +
> +		audio: audio {
> +			compatible = "brcm,bcm2835-audio";
> +			brcm,pwm-channels = <8>;
> +		};
>  	};
>  };

Assuming the DT binding gets acked,

Acked-by: Eric Anholt <eric@anholt.net>