Skip to content

VCHIQ audio Device Tree support - #3448

Merged
pelwell merged 4 commits into
raspberrypi:rpi-5.5.yfrom
pelwell:vchiqaud
Feb 5, 2020
Merged

pelwell merged 4 commits into
raspberrypi:rpi-5.5.yfrom
pelwell:vchiqaud

Conversation

@pelwell

@pelwell pelwell commented Feb 4, 2020

Copy link
Copy Markdown
Contributor

This is an attempt to solve the problem of the BCM2835 audio driver - a client of VCHIQ - which in its downstream incarnation makes use of Device Tree properties. Until a recent reversion the audio device was being instantiated twice - once via DT and once directly by the VCHIQ parent.

VCHIQ kernel client drivers have been transformed into platform drivers instantiated explicitly by the parent. This solves the issue of device creation order, but it poses a problem for downstream use - the clients lose their Device Tree nodes. I understand that use of DT by "devices" that don't directly address hardware is against some of the DT principles, but the VCHIQ clients do control hardware - they just present proxies for services running on the RPi firmware. I therefore don't think it's unreasonable to use DT to describe them, allowing them to benefit from automatic pin configuration etc.

The solution is to give each child device an optional DT node, identified by name, and initialise the platform device object with a pointer to it. In this way the device creation is still controlled by the vchiq "bus" driver, but the children are free to use DT.

Stefan Wahren and others added 4 commits February 3, 2020 16:26
Following Eric's commit 37b7b30 ("staging/vc04_services: Register a
platform device for the camera driver.") this register the audio driver as
a platform device, too.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
vchiq kernel clients are now instantiated as platform drivers rather
than using DT, but the children of the vchiq interface may still
benefit from access to DT properties. Give them the option of a
a sub-node of the vchiq parent for configuration and to allow
them to be disabled.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
All the registered children of vchiq have a corresponding call to
platform_device_unregister except bcm2835_audio. Fix that.

Fixes: 25c7597 ("staging: vchiq_arm: Register a platform device for audio")

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
VCHIQ kernel clients are now instantiated as platform drivers rather
than using DT, but the children of the vchiq device can optionally be
given a sub-node of the vchiq parent for configuration and to disable
them.

Move the existing audio node beneath the vchiq parent, to prevent
multiple instantiation and unpleasant warnings.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
@pelwell

pelwell commented Feb 4, 2020

Copy link
Copy Markdown
Contributor Author

@popcornmix This is my proposal to resolve the audio problems in a way which is more closely aligned to upstream.
@vianpl Is this less unacceptable than the previous mess we had? I'm not expecting to upstream it, but it would be nice if it wasn't likely to get broken soon by another major upstream change.

@pelwell

pelwell commented Feb 5, 2020

Copy link
Copy Markdown
Contributor Author

Are there any objections to me merging this?

@vianpl

vianpl commented Feb 5, 2020

Copy link
Copy Markdown
Contributor

@pelwell Sadly, I wasn't here when you fixed the previous mess so my perspective is limited. But I don't think this part of the driver is likely to change. We've been using this device registering pattern all over the place and seems to work fine. So no objections.

@pelwell

pelwell commented Feb 5, 2020

Copy link
Copy Markdown
Contributor Author

Thank you for the feedback - I'm trying not to diverge too far from the upstream way.

@pelwell
pelwell merged commit b7a8fae into raspberrypi:rpi-5.5.y Feb 5, 2020
@pelwell
pelwell deleted the vchiqaud branch September 15, 2021 07:54
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