Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp860146pxb; Mon, 25 Oct 2021 20:51:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+21Rk+okpLJl2fZat7z8yWDDQ7uj/vGQBPr2gV4E+LiwXX2k/WD3MdSzQZ3ZUpe1YhI1C X-Received: by 2002:a17:90b:4a0f:: with SMTP id kk15mr40191300pjb.34.1635220281267; Mon, 25 Oct 2021 20:51:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635220281; cv=none; d=google.com; s=arc-20160816; b=sWbB2780AnQnAHAnQrZH8lpyUU+MLDc6Sb5cJecys9qu29Vt0Jefz0m7VwpAYlL+Rz wGjoJ8tnlNG2tWvMHPeS6YPaCyAJReC5V4cENT9msYWsKJguyc+yDtdFUJwF8bQhAGqn /AsaUMRopI3UsbtTs8ZWGnFHTqccLm1+tGp4qRGA4ZzeVSj4rOYNXx13nk3r4ZgDUviF +c+EzA4BMT1PAQpl/q6h0TfjmYru46dxIr5B0a85HgjhnKfzLg1KRpWPjuPbkTEEsfmJ MTLhhQ8mZSNnSqCajw8DYvFqVMbA1St3YFHBVrYe/i96sWawL0OXrYbZC7+rMy0lm63h +uhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8jRHJbzxJCo8C1IXTJW3KiTq5EwC3cp5SncHLYDZJzc=; b=M/qdqOIzAeo3qz2knslRIGIHY4QzBpK0KgMmkp0JLRJmHFvPF+Ydqgf2te89Gitjze 3KEEApKl0u5suxC+/sh9yxa87w0W0TW/4yH6NN5wBZDFw1KL+p+UKuwHViQfzLt3D/V1 kOZ68Xxu2FCT3mxUQDpjBMqqIOrhmhNHbPxdtU7L2Oej09+QfQP3rtE+tER9wajENioK Dy7wj6ZLWAGvGDR8YAgfusW6WxkBgwjhXT2hNMMH8KdGO3feDmF/qLLvD+7g0zMv12Ty qzciu0Wa2FRRkEMQWj+QRl3qq1w2rbE2GfZrbIGChfapCiSyirdm6xDM2DeqsWOLbW3t CDpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=bunBYlNm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g1si27045493pjl.47.2021.10.25.20.51.08; Mon, 25 Oct 2021 20:51:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=bunBYlNm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236312AbhJZAGS (ORCPT + 99 others); Mon, 25 Oct 2021 20:06:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235575AbhJZADi (ORCPT ); Mon, 25 Oct 2021 20:03:38 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09FF4C061767 for ; Mon, 25 Oct 2021 17:01:14 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id t21so9031076plr.6 for ; Mon, 25 Oct 2021 17:01:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8jRHJbzxJCo8C1IXTJW3KiTq5EwC3cp5SncHLYDZJzc=; b=bunBYlNm4MBSSwDY9FFTh2Q7n01hTP2TxTgpRDzaG7jxxi7NaxxZDlwJQoGZBhO7DC YUqQu/W9/Ey/QCwO0Wo3XlipBwg6MDQol3xm5XqBOMm3FJgcGPy9HyC6Rrmj+DRi8WZ8 ZAfRuZrG+lygeImvhmGTyPRMjkCN1OZVZNRdw= 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=8jRHJbzxJCo8C1IXTJW3KiTq5EwC3cp5SncHLYDZJzc=; b=oDN/BKvAAUm4brH2ithgZA4oYWzhBmzwW3LDs0aFH8J0VKvtlcv3jJ1e6x+5xPKMDX qgEuw86Y69mhpIhXRT4nli0Kp/UAwKcm7Vi6+/xmy+CYzkxJsv7P/tAimRJ90tZ72UpL /oO1fIeZXlGNHo7UjWn+3bPfhvi+PU5qUdfwFokIljuaZ25EOlr/Es7XUJcTUy6fQbZO WkbTCeTcyw9FKyuIhceg21fseWinwYJ/HWzX4HAv11nafdXeoUizUS23XzoFO9NQFmoY YzxuE1W0BLt7gchYhn8SFCHb4m5HiAosYH3GV2NVJ2vPDYnYgMfwtvV2qPY4YyJcK3IO aNOA== X-Gm-Message-State: AOAM530q1Ag1VPZDicKm57532dsFTiLlAGVqNe0i350pPo5MjipxRco9 sgrc/Z2AA7l6rg8wTMd62lX+ew== X-Received: by 2002:a17:902:f687:b0:140:4098:1e12 with SMTP id l7-20020a170902f68700b0014040981e12mr13194756plg.81.1635206473428; Mon, 25 Oct 2021 17:01:13 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:201:f5e3:5eb1:d5ee:6893]) by smtp.gmail.com with ESMTPSA id b7sm9900747pfm.28.2021.10.25.17.01.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 17:01:12 -0700 (PDT) From: Stephen Boyd To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Jaroslav Kysela , Takashi Iwai , Kai Vehmanen , Daniel Vetter , "Rafael J. Wysocki" , Rob Clark , Russell King , Saravana Kannan Subject: [PATCH v3 31/34] sound: hdac: Migrate to aggregate driver Date: Mon, 25 Oct 2021 17:00:41 -0700 Message-Id: <20211026000044.885195-32-swboyd@chromium.org> X-Mailer: git-send-email 2.33.0.1079.g6e70778dc9-goog In-Reply-To: <20211026000044.885195-1-swboyd@chromium.org> References: <20211026000044.885195-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use an aggregate driver instead of component ops so that we can get proper driver probe ordering of the aggregate device with respect to all the component devices that make up the aggregate device. Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: Kai Vehmanen Cc: Daniel Vetter Cc: "Rafael J. Wysocki" Cc: Rob Clark Cc: Russell King Cc: Saravana Kannan Signed-off-by: Stephen Boyd --- sound/hda/hdac_component.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/sound/hda/hdac_component.c b/sound/hda/hdac_component.c index bb37e7e0bd79..9e4dab97f485 100644 --- a/sound/hda/hdac_component.c +++ b/sound/hda/hdac_component.c @@ -181,8 +181,9 @@ int snd_hdac_acomp_get_eld(struct hdac_device *codec, hda_nid_t nid, int dev_id, } EXPORT_SYMBOL_GPL(snd_hdac_acomp_get_eld); -static int hdac_component_master_bind(struct device *dev) +static int hdac_component_master_bind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct drm_audio_component *acomp = hdac_get_acomp(dev); int ret; @@ -222,8 +223,9 @@ static int hdac_component_master_bind(struct device *dev) return ret; } -static void hdac_component_master_unbind(struct device *dev) +static void hdac_component_master_unbind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct drm_audio_component *acomp = hdac_get_acomp(dev); if (acomp->audio_ops && acomp->audio_ops->master_unbind) @@ -233,9 +235,13 @@ static void hdac_component_master_unbind(struct device *dev) WARN_ON(acomp->ops || acomp->dev); } -static const struct component_master_ops hdac_component_master_ops = { - .bind = hdac_component_master_bind, - .unbind = hdac_component_master_unbind, +static struct aggregate_driver hdac_aggregate_driver = { + .probe = hdac_component_master_bind, + .remove = hdac_component_master_unbind, + .driver = { + .name = "hdac_agg", + .owner = THIS_MODULE, + }, }; /** @@ -303,8 +309,7 @@ int snd_hdac_acomp_init(struct hdac_bus *bus, devres_add(dev, acomp); component_match_add_typed(dev, &match, match_master, bus); - ret = component_master_add_with_match(dev, &hdac_component_master_ops, - match); + ret = component_aggregate_register(dev, &hdac_aggregate_driver, match); if (ret < 0) goto out_err; @@ -344,7 +349,7 @@ int snd_hdac_acomp_exit(struct hdac_bus *bus) bus->display_power_active = 0; bus->display_power_status = 0; - component_master_del(dev, &hdac_component_master_ops); + component_aggregate_unregister(dev, &hdac_aggregate_driver); bus->audio_component = NULL; devres_destroy(dev, hdac_acomp_release, NULL, NULL); -- https://chromeos.dev