Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp858981pxb; Mon, 25 Oct 2021 20:49:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhSY9ykbR1KzLm1WC/o1xtfbJW4+RY1Z9EwVt6UrZKzBapsSbGph3Hxu+ZmaKI6M4XUnXm X-Received: by 2002:a17:90b:4c02:: with SMTP id na2mr5870195pjb.153.1635220143774; Mon, 25 Oct 2021 20:49:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635220143; cv=none; d=google.com; s=arc-20160816; b=tdpymJIMJoyVdl82WuueXi+0ztuaMiQNDs805Vra8/ZGYvOlIk3fGxHn30h2QzuQ3E UxQp4O10zcdQy2YTDN4MeC3DJ3wQHiCWPJz4RFoz+hxHDBv61RpatmnyVdIX2++xINnU q7M04mEOFLd0E7Ed3tqYMncepcE9ejOSx0fGdjhFD1i90Jgy2rbYpPCwnPJ7a/rg5XFn 5n8UM7yrtFHNCu0Ecq3kcZlmpEYawgO9AJSOaK8f45fE1B3FRNg73d2ZvvZQxznlFmpB 5X6uk3qUmVyWXNUe4+CiWkVPF7OgbJ+REh0MkTd+hpNQN02jkqGiq/EYVdqucjWg4f+A 7gnw== 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=qtSBdARAbq/LhSD/0GoJpBn1wQtyRrb0Wrn7wC9yscA=; b=ofQwV9SFBQELyQ/8N1xhmOPWRcblAdGuxYBzhF4DcIfLyn0QuhuYwtuURMwzixWKGT z+fRHpyhCIfLsru94JRt3w3DjoNnTjFsrWw0D9NvU1JeA/q159Bd/erMgI8GOiGFODjs T/Zr198kjCXE2eu0Aug/Gk25zltUNNAElcVXnRgtMQF6ay542CG6YFYprMiNcIs0ZspD FCmHIrR2y/1h9ZqJpF10Hys4LzdQunqqjkPErkBH2YTjJ0H81LqDCJo1A6s9pLr/j37k bn/sUlOgR63J8PJSElIfsX14Y882Zv2RmSSjZyhMI7eQFl7m14WBLiziGM+W3jDoFAyJ B6LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=nyUU2nEl; 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.48.50; Mon, 25 Oct 2021 20:49:03 -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=nyUU2nEl; 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 S236055AbhJZAGO (ORCPT + 99 others); Mon, 25 Oct 2021 20:06:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235812AbhJZADj (ORCPT ); Mon, 25 Oct 2021 20:03:39 -0400 Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6DC3C061348 for ; Mon, 25 Oct 2021 17:01:14 -0700 (PDT) Received: by mail-pg1-x533.google.com with SMTP id r28so7952046pga.0 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=qtSBdARAbq/LhSD/0GoJpBn1wQtyRrb0Wrn7wC9yscA=; b=nyUU2nElQbtMsEiN3eH8baHbyx4vIDgLtpGND0ueLc+d38AP9nLIWNViYZ8LcY10FK bNARmqtynLnphzcrh/QBobUupmoZ2DpVmRvWGCKdtMWdgKjKCufbemezK22pZqRO/UuK 3pT7BSLUIWNchpJcrZK5ij+jhcAxdFD21pU6I= 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=qtSBdARAbq/LhSD/0GoJpBn1wQtyRrb0Wrn7wC9yscA=; b=ZDC99ztSjmNJlQcdRwTPpqRe8wIGTW5R68R37NfYoeNSecfU5hqRGUyBEXeYHRLGqX 3vYs32UnUkvGva6ftmRLbUAzD20gc/28mvoG3qpkXlbAVQaeQ7jK7TaEKxX3bgUw1K9r MB13qFst1KBzwzUhN3fNsFn5sXFMy1DvPnv6/K3QoyR+qzv7Tbw3vW5D/Vxu0enkrL0q o7YFrzAkjjq8g+AL5qZX2Ba/EuG/T6oJ7FeGZ9cj08KLOfRxMCjS7nH+ESZs1HTb3gi3 Jt0cOe1iJWeusKkAiXtAZRXSHOSwICwHga/j3m0K2KK2cK86+JP5nDzZG3YMkBxJR24e PPBQ== X-Gm-Message-State: AOAM5337gGeaXbgsdktLVDTceI2d0kj2FmSLEQxqR6it6w6yhUp9Aduh QNmOj0AEddw5CRPNq2saW88WbQ== X-Received: by 2002:a05:6a00:198b:b0:47b:ac2d:68f4 with SMTP id d11-20020a056a00198b00b0047bac2d68f4mr21340303pfl.1.1635206474295; Mon, 25 Oct 2021 17:01:14 -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.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 17:01:14 -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, Mark Brown , Jaroslav Kysela , Daniel Vetter , "Rafael J. Wysocki" , Rob Clark , Russell King , Saravana Kannan Subject: [PATCH v3 32/34] ASoC: codecs: wcd938x: Migrate to aggregate driver Date: Mon, 25 Oct 2021 17:00:42 -0700 Message-Id: <20211026000044.885195-33-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. Acked-by: Mark Brown Cc: Jaroslav Kysela Cc: Daniel Vetter Cc: "Rafael J. Wysocki" Cc: Rob Clark Cc: Russell King Cc: Saravana Kannan Signed-off-by: Stephen Boyd --- sound/soc/codecs/wcd938x.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c index f0daf8defcf1..6033de7f57ef 100644 --- a/sound/soc/codecs/wcd938x.c +++ b/sound/soc/codecs/wcd938x.c @@ -4316,8 +4316,9 @@ static struct snd_soc_dai_driver wcd938x_dais[] = { }, }; -static int wcd938x_bind(struct device *dev) +static int wcd938x_bind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct wcd938x_priv *wcd938x = dev_get_drvdata(dev); int ret; @@ -4400,8 +4401,9 @@ static int wcd938x_bind(struct device *dev) } -static void wcd938x_unbind(struct device *dev) +static void wcd938x_unbind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct wcd938x_priv *wcd938x = dev_get_drvdata(dev); device_link_remove(dev, wcd938x->txdev); @@ -4411,9 +4413,13 @@ static void wcd938x_unbind(struct device *dev) component_unbind_all(dev, wcd938x); } -static const struct component_master_ops wcd938x_comp_ops = { - .bind = wcd938x_bind, - .unbind = wcd938x_unbind, +static struct aggregate_driver wcd938x_aggregate_driver = { + .probe = wcd938x_bind, + .remove = wcd938x_unbind, + .driver = { + .name = "wcd938x_snd", + .owner = THIS_MODULE, + }, }; static int wcd938x_compare_of(struct device *dev, void *data) @@ -4482,7 +4488,7 @@ static int wcd938x_probe(struct platform_device *pdev) wcd938x_reset(wcd938x); - ret = component_master_add_with_match(dev, &wcd938x_comp_ops, match); + ret = component_aggregate_register(dev, &wcd938x_aggregate_driver, match); if (ret) return ret; @@ -4498,7 +4504,7 @@ static int wcd938x_probe(struct platform_device *pdev) static int wcd938x_remove(struct platform_device *pdev) { - component_master_del(&pdev->dev, &wcd938x_comp_ops); + component_aggregate_unregister(&pdev->dev, &wcd938x_aggregate_driver); return 0; } -- https://chromeos.dev