From nobody Tue Dec 16 07:41:39 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650874945; cv=none; d=zohomail.com; s=zohoarc; b=DCIDQcQZXvxl5B8F+EG83DKw9vV/Q6YmUqWxdspilpCVJ1SQIqBp+3l05eYmGw3Ams/uWQ8CceCrd2DmIv+jOtLR/XROadIdzUZW/aeVE6rIsdxIlJVXgNhnPSTxOy7tboa0522dQIpyUAZJ0PgVKxnYVDeQmLnasYqy5GAneLI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650874945; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oyMfkcUILkmpK1r/qqI5Brm2uf6KpBJ8gcX2dxLTNQQ=; b=nn6DavFABQY4Vra2udH1Cw2CGFX1Gnn+Pa0ju8O1Vfm77EX/fpedSOKtT43o5Z40XcKHlBcaPBSlpGI/92d0nDdvee4oGNOh8b6z8DY73if0Jw8fMSOAW0g77+V1bLX82At1IkGpdHPs9lLAVmUM5Z9KfTNqjSMJHtYFAyGyIzQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1650874945472113.54587298012052; Mon, 25 Apr 2022 01:22:25 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-336-bqs9olulPt6dwJNY__nOxQ-1; Mon, 25 Apr 2022 04:22:20 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 571931014A79; Mon, 25 Apr 2022 08:22:15 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3319F1468F35; Mon, 25 Apr 2022 08:22:15 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 39C871947BBE; Mon, 25 Apr 2022 08:22:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id ED20C1940358 for ; Mon, 25 Apr 2022 08:22:10 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E9B5F40316B; Mon, 25 Apr 2022 08:22:09 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E5909403156 for ; Mon, 25 Apr 2022 08:22:09 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C52EA811E78 for ; Mon, 25 Apr 2022 08:22:09 +0000 (UTC) Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-91-t-Ioje2nPx6-QcMZ4lCzpA-1; Mon, 25 Apr 2022 04:22:06 -0400 Received: by mail-wm1-f70.google.com with SMTP id v191-20020a1cacc8000000b0038ce818d2efso6472533wme.1 for ; Mon, 25 Apr 2022 01:22:06 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id f14-20020a0560001a8e00b0020aaf034e59sm10200944wry.90.2022.04.25.01.22.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 01:22:04 -0700 (PDT) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 5B24167B1B60; Mon, 25 Apr 2022 10:22:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650874944; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=oyMfkcUILkmpK1r/qqI5Brm2uf6KpBJ8gcX2dxLTNQQ=; b=FD0JSy2S84KO5cp9lJsTV4u9sqY8bV6OdeNE+UCejygBSjHcFcDw5XGpVQ4yK4E/j1impN qGeiPAGoJDq6GTx9MrKB8xrsPs0luTTuN8BdpULusjoYAbZe66MKNI+gYn3tm4hul31qQx 5adHxs5AKZVfNrSN/fEChWk+8eZ5WnI= X-MC-Unique: bqs9olulPt6dwJNY__nOxQ-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: t-Ioje2nPx6-QcMZ4lCzpA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oyMfkcUILkmpK1r/qqI5Brm2uf6KpBJ8gcX2dxLTNQQ=; b=i2A8gqjt+O+5ahl53cuWZ6J+BoWF6QarYNOxtKroWHBglDBszFWvqj5cLNIr3w2W+e p3VkR0JI2WVzczcuHiecw1gzQDh4AaKg/Sb7FUUUKQjytbkEc4Pky63/PyNk1Z8xWFl+ 5Inm8ndzUbH3kTssG3HODzmWnR5droRefPRZrjODf4TiJJhNtfPEU1sq5Fu1Dj10EMSD LjvQ8OzzbYuGg4rWWqCdoi4Nw/8nzlC3d6N0ZPHmKDx4oZxz6wPQceNED3XITXQ6lJv4 CYCHMidI/Rp1YXY6YNFVqqnASQ7P69nLkyXuMBMHdHvw2OILHyu0huCNhEMvXGA2dWoV C1Sg== X-Gm-Message-State: AOAM532CJcFx4AQbgTbjIR0+aezYV/XWAkE4eQjs4mWwkurja9xppGq1 6aE3jqb1qwUlXDuJc7Cro0Klp2iV3s8gv7Bfw0x/81ktNiwp91oxiVP4/KroadVKsQK0cs6Mk/7 k2rHKQFJTD0aQjkUWmiA= X-Received: by 2002:a05:600c:1f0f:b0:38e:c9c8:9983 with SMTP id bd15-20020a05600c1f0f00b0038ec9c89983mr15260371wmb.105.1650874925591; Mon, 25 Apr 2022 01:22:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfD48BjcAECR06YOf9cPKRyTCroqPF2jgrk5q5uvbVqvWjFeT6iIsEtGTyaM6j9J+f1w4xow== X-Received: by 2002:a05:600c:1f0f:b0:38e:c9c8:9983 with SMTP id bd15-20020a05600c1f0f00b0038ec9c89983mr15260357wmb.105.1650874925311; Mon, 25 Apr 2022 01:22:05 -0700 (PDT) From: Martin Kletzander To: qemu-devel@nongnu.org Subject: [PATCH 11/18] hw/arm: Support machine-default audiodev with fallback Date: Mon, 25 Apr 2022 10:21:54 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi , libvir-list@redhat.com, Christian Schoenebeck , Yanan Wang , Gerd Hoffmann , "Edgar E. Iglesias" , Qiuhao Li , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Marcel Apfelbaum , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Laurent Vivier , Thomas Huth , Alistair Francis , Alexander Bulekov , Bandan Das , qemu-arm@nongnu.org, Jan Kiszka , Pavel Dovgalyuk , Eduardo Habkost , Darren Kenny , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, Paolo Bonzini Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1650874972967100006 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Martin Kletzander --- hw/arm/integratorcp.c | 8 +++++++- hw/arm/musicpal.c | 8 +++++++- hw/arm/omap2.c | 8 ++++++++ hw/arm/realview.c | 3 +++ hw/arm/spitz.c | 10 +++++++--- hw/arm/versatilepb.c | 3 +++ hw/arm/vexpress.c | 3 +++ hw/arm/xlnx-zcu102.c | 4 ++++ hw/arm/z2.c | 12 +++++++++++- 9 files changed, 53 insertions(+), 6 deletions(-) diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c index b109ece3ae02..0a6d4186dad6 100644 --- a/hw/arm/integratorcp.c +++ b/hw/arm/integratorcp.c @@ -27,6 +27,7 @@ #include "hw/irq.h" #include "hw/sd/sd.h" #include "qom/object.h" +#include "audio/audio.h" =20 #define TYPE_INTEGRATOR_CM "integrator_core" OBJECT_DECLARE_SIMPLE_TYPE(IntegratorCMState, INTEGRATOR_CM) @@ -660,7 +661,12 @@ static void integratorcp_init(MachineState *machine) &error_fatal); } =20 - sysbus_create_varargs("pl041", 0x1d000000, pic[25], NULL); + dev =3D qdev_new("pl041"); + qdev_prop_set_string(dev, "audiodev", + audio_maybe_init_dummy("integrator.defaudio")); + sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0x1d000000); + sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[25]); =20 if (nd_table[0].used) smc91c111_init(&nd_table[0], 0xc8000000, pic[27]); diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c index 7c840fb4283e..5d53ed3a8709 100644 --- a/hw/arm/musicpal.c +++ b/hw/arm/musicpal.c @@ -35,6 +35,7 @@ #include "qemu/cutils.h" #include "qom/object.h" #include "hw/net/mv88w8618_eth.h" +#include "audio/audio.h" =20 #define MP_MISC_BASE 0x80002000 #define MP_MISC_SIZE 0x00001000 @@ -1324,7 +1325,12 @@ static void musicpal_init(MachineState *machine) qdev_connect_gpio_out(key_dev, i, qdev_get_gpio_in(dev, i + 15)); } =20 - wm8750_dev =3D i2c_slave_create_simple(i2c, TYPE_WM8750, MP_WM_ADDR); + wm8750_dev =3D i2c_slave_new(TYPE_WM8750, MP_WM_ADDR); + + qdev_prop_set_string(DEVICE(wm8750_dev), "audiodev", + audio_maybe_init_dummy("musicpal.defaudio")); + i2c_slave_realize_and_unref(wm8750_dev, i2c, &error_abort); + dev =3D qdev_new(TYPE_MV88W8618_AUDIO); s =3D SYS_BUS_DEVICE(dev); object_property_set_link(OBJECT(dev), "wm8750", OBJECT(wm8750_dev), diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c index 02b1aa8c974b..4ae524a1a1a6 100644 --- a/hw/arm/omap2.c +++ b/hw/arm/omap2.c @@ -604,12 +604,20 @@ static struct omap_eac_s *omap_eac_init(struct omap_t= arget_agent_s *ta, qemu_irq irq, qemu_irq *drq, omap_clk fclk, omap_clk iclk) { struct omap_eac_s *s =3D g_new0(struct omap_eac_s, 1); + const char *audiodev_id =3D audio_maybe_init_dummy("eac.defaudio"); =20 s->irq =3D irq; s->codec.rxdrq =3D *drq ++; s->codec.txdrq =3D *drq; omap_eac_reset(s); =20 + s->codec.card.name =3D g_strdup(audiodev_id); + s->codec.card.state =3D audio_state_by_name(s->codec.card.name); + if (!s->codec.card.state) { + error_setg(&error_fatal, "Cannot find audiodev with id '%s'", + s->codec.card.name); + } + AUD_register_card("OMAP EAC", &s->codec.card); =20 memory_region_init_io(&s->iomem, NULL, &omap_eac_ops, s, "omap.eac", diff --git a/hw/arm/realview.c b/hw/arm/realview.c index d2dc8a895258..4fcdd821789a 100644 --- a/hw/arm/realview.c +++ b/hw/arm/realview.c @@ -29,6 +29,7 @@ #include "hw/irq.h" #include "hw/i2c/arm_sbcon_i2c.h" #include "hw/sd/sd.h" +#include "audio/audio.h" =20 #define SMP_BOOT_ADDR 0xe0000000 #define SMP_BOOTREG_ADDR 0x10000030 @@ -207,6 +208,8 @@ static void realview_init(MachineState *machine, =20 pl041 =3D qdev_new("pl041"); qdev_prop_set_uint32(pl041, "nc_fifo_depth", 512); + qdev_prop_set_string(pl041, "audiodev", + audio_maybe_init_dummy("realview.defaudio")); sysbus_realize_and_unref(SYS_BUS_DEVICE(pl041), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(pl041), 0, 0x10004000); sysbus_connect_irq(SYS_BUS_DEVICE(pl041), 0, pic[19]); diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c index 5aab0b856574..94fff2f460ca 100644 --- a/hw/arm/spitz.c +++ b/hw/arm/spitz.c @@ -35,6 +35,7 @@ #include "exec/address-spaces.h" #include "cpu.h" #include "qom/object.h" +#include "audio/audio.h" =20 enum spitz_model_e { spitz, akita, borzoi, terrier }; =20 @@ -779,10 +780,13 @@ static void spitz_i2c_setup(PXA2xxState *cpu) /* Attach the CPU on one end of our I2C bus. */ I2CBus *bus =3D pxa2xx_i2c_bus(cpu->i2c[0]); =20 - DeviceState *wm; - /* Attach a WM8750 to the bus */ - wm =3D DEVICE(i2c_slave_create_simple(bus, TYPE_WM8750, 0)); + I2CSlave *i2c_dev =3D i2c_slave_new(TYPE_WM8750, 0); + DeviceState *wm =3D DEVICE(i2c_dev); + + qdev_prop_set_string(wm, "audiodev", + audio_maybe_init_dummy("spitz.defaudio")); + i2c_slave_realize_and_unref(i2c_dev, bus, &error_abort); =20 spitz_wm8750_addr(wm, 0, 0); qdev_connect_gpio_out(cpu->gpio, SPITZ_GPIO_WM, diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index ecc1f6cf74ff..e068f592b134 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -26,6 +26,7 @@ #include "hw/char/pl011.h" #include "hw/sd/sd.h" #include "qom/object.h" +#include "audio/audio.h" =20 #define VERSATILE_FLASH_ADDR 0x34000000 #define VERSATILE_FLASH_SIZE (64 * 1024 * 1024) @@ -343,6 +344,8 @@ static void versatile_init(MachineState *machine, int b= oard_id) /* Add PL041 AACI Interface to the LM4549 codec */ pl041 =3D qdev_new("pl041"); qdev_prop_set_uint32(pl041, "nc_fifo_depth", 512); + qdev_prop_set_string(pl041, "audiodev", + audio_maybe_init_dummy("versatilepb.defaudio")); sysbus_realize_and_unref(SYS_BUS_DEVICE(pl041), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(pl041), 0, 0x10004000); sysbus_connect_irq(SYS_BUS_DEVICE(pl041), 0, sic[24]); diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index e1d1983ae657..f312a4d5315e 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -44,6 +44,7 @@ #include "hw/i2c/arm_sbcon_i2c.h" #include "hw/sd/sd.h" #include "qom/object.h" +#include "audio/audio.h" =20 #define VEXPRESS_BOARD_ID 0x8e0 #define VEXPRESS_FLASH_SIZE (64 * 1024 * 1024) @@ -614,6 +615,8 @@ static void vexpress_common_init(MachineState *machine) =20 pl041 =3D qdev_new("pl041"); qdev_prop_set_uint32(pl041, "nc_fifo_depth", 512); + qdev_prop_set_string(pl041, "audiodev", + audio_maybe_init_dummy("vexpress.defaudio")); sysbus_realize_and_unref(SYS_BUS_DEVICE(pl041), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(pl041), 0, map[VE_PL041]); sysbus_connect_irq(SYS_BUS_DEVICE(pl041), 0, pic[11]); diff --git a/hw/arm/xlnx-zcu102.c b/hw/arm/xlnx-zcu102.c index 4c84bb932aa0..e4c32e158b61 100644 --- a/hw/arm/xlnx-zcu102.c +++ b/hw/arm/xlnx-zcu102.c @@ -24,6 +24,7 @@ #include "sysemu/device_tree.h" #include "qom/object.h" #include "net/can_emu.h" +#include "audio/audio.h" =20 struct XlnxZCU102 { MachineState parent_obj; @@ -143,6 +144,9 @@ static void xlnx_zcu102_init(MachineState *machine) =20 object_initialize_child(OBJECT(machine), "soc", &s->soc, TYPE_XLNX_ZYN= QMP); =20 + qdev_prop_set_string(DEVICE(&s->soc.dp), "audiodev", + audio_maybe_init_dummy("zcu102.defaudio")); + object_property_set_link(OBJECT(&s->soc), "ddr-ram", OBJECT(machine->r= am), &error_abort); object_property_set_bool(OBJECT(&s->soc), "secure", s->secure, diff --git a/hw/arm/z2.c b/hw/arm/z2.c index 9c1e876207b3..8d9141998870 100644 --- a/hw/arm/z2.c +++ b/hw/arm/z2.c @@ -26,6 +26,7 @@ #include "exec/address-spaces.h" #include "cpu.h" #include "qom/object.h" +#include "qapi/error.h" =20 #ifdef DEBUG_Z2 #define DPRINTF(fmt, ...) \ @@ -306,6 +307,7 @@ static void z2_init(MachineState *machine) void *z2_lcd; I2CBus *bus; DeviceState *wm; + I2CSlave *i2c_dev; =20 /* Setup CPU & memory */ mpu =3D pxa270_init(address_space_mem, z2_binfo.ram_size, machine->cpu= _type); @@ -330,8 +332,16 @@ static void z2_init(MachineState *machine) type_register_static(&aer915_info); z2_lcd =3D ssi_create_peripheral(mpu->ssp[1], TYPE_ZIPIT_LCD); bus =3D pxa2xx_i2c_bus(mpu->i2c[0]); + i2c_slave_create_simple(bus, TYPE_AER915, 0x55); - wm =3D DEVICE(i2c_slave_create_simple(bus, TYPE_WM8750, 0x1b)); + + i2c_dev =3D i2c_slave_new(TYPE_WM8750, 0x1b); + wm =3D DEVICE(i2c_dev); + + qdev_prop_set_string(wm, "audiodev", + audio_maybe_init_dummy("z2.defaudio")); + i2c_slave_realize_and_unref(i2c_dev, bus, &error_abort); + mpu->i2s->opaque =3D wm; mpu->i2s->codec_out =3D wm8750_dac_dat; mpu->i2s->codec_in =3D wm8750_adc_dat; --=20 2.35.1