Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp664034pxb; Wed, 6 Oct 2021 12:42:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8h4tdu+x2kp3m3IhZAWTRxLyZCt+pwBSWwxGVdcwjugZK7L/G11KJeLYjzoeBYZ30Uh3J X-Received: by 2002:a17:90a:8b04:: with SMTP id y4mr680016pjn.142.1633549369806; Wed, 06 Oct 2021 12:42:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633549369; cv=none; d=google.com; s=arc-20160816; b=ZOk2Blw6OoKHoTOUcDeznMOdpXdgaRfbDHa7YWrIbYZOWR2EAmIdh4/ajc23YtUJeM pZ2j7N4OESvz/WquJoA+piOm7wZ8glXIdvIbg5tCqcK0kfUa+sYDijhTVlDMsTSh9tqO faulu749KXekTwr3mMkT9VChE+B9aYCMPBKU7V9hf0BatnmXMf/+bk1MsOvWSgqhr+5k bwn6keQunAW/liOfPn+hByMK5OJaSiHCgwVRUWxdqk38o2N+j8MN8iY/WcIGHXpK0F43 BYQjC9U7aN/FgWrTpxL0iojALw9KaA2BDVSon8XV/LS5Wdd96/hBybMxrIB9Obox8zWS xWng== 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=fm8Ray60W+gsuBVO8IyR/yw2T2Yz5Ywf4X0EOYohXDA=; b=jCHziQSiDMVxqtGdv2bN/FtziCai/LGn0rv9qEGalBTKire8z2bBrWQFgGqDpVO4TG ZE7zDOjFZVAOmf1oHhwY7Dfufyn1LG3pqODu68rmu8snpq1udif3gpElmm7NYFOsK1Zg dyFRpuEOZez93q9vgbWwb7rOPtmynLsICp7SSm8r6Lrl2ftFwvoSOc95biSMiByDsnlh ae4G7RPqtXlI5f/0bHTnmbhzZOUiV5ruhjntrh01WW3Mv81NLwydEFanEH7uUhyE1XOE mo7l5RhRHRuqaBCfN9N8n6AtRdZdYGBICramLs8CMkkbl44oFQLBYihgQ9eZ5RTBJVG4 TsSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=M9bnTNDC; 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 f185si28053484pgc.204.2021.10.06.12.42.37; Wed, 06 Oct 2021 12:42:49 -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=M9bnTNDC; 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 S239554AbhJFTmb (ORCPT + 99 others); Wed, 6 Oct 2021 15:42:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239847AbhJFTmF (ORCPT ); Wed, 6 Oct 2021 15:42:05 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7EC5C0613A3 for ; Wed, 6 Oct 2021 12:38:59 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id q19so2799965pfl.4 for ; Wed, 06 Oct 2021 12:38:59 -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=fm8Ray60W+gsuBVO8IyR/yw2T2Yz5Ywf4X0EOYohXDA=; b=M9bnTNDCnWZ/AbmQrReLF0e9g14dbA2hMeAudESF0IRy+EF1EO5K2SqFpOXTYT37uU +xiIEGGNUokqXTN+fkT+Ar/FbOVmdVa11MMVtVg+n2H9yF/wuPa634sJWEjxXsnaWnIi Jm3hHKiIfWl3hAvdG6otRnoM3OP1/4OE9lnUk= 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=fm8Ray60W+gsuBVO8IyR/yw2T2Yz5Ywf4X0EOYohXDA=; b=bCj1IEXsEUbDo/hk/4/YDl9qs2TI2T6YkEhadfC7I3Y6CRQZzAYEhiEtANWMjbM2za AmFKFufBh30+f8pQz7AdON/PntZNXlNB0Py46/+biXJsX+W1Rqd8BWBgCHB4bGsmJ0nl c6KXPqC/i+u1hvFA0em9flusIlFufGbCDKMpqMHpCV7bUQpF/nBnA8FpDi3nqsxZ3OJS 0t/95JLhV7WoD3dtzvcddkH0Pji7NR89geSwtz9VihCdv570h7wusV1bGpzZVhpVyy7L B3kQbtzvG1pNEyQbjiNvRkXEA9KbKx2nsqJ+rBy8tlmeRAABpN5if7yLlooHtnMtA5jh PgtQ== X-Gm-Message-State: AOAM533SRaYolvPMvOc9dIAhHvIrjQQ8cxZIVSVbapb75LNGzYUS2Z9H MFfAmgyDzcF/cPx5l7iwb/9bTw== X-Received: by 2002:a63:7456:: with SMTP id e22mr458679pgn.324.1633549139432; Wed, 06 Oct 2021 12:38:59 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:201:d412:c5eb:4aca:4738]) by smtp.gmail.com with ESMTPSA id o14sm22011296pfh.84.2021.10.06.12.38.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 12:38:59 -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 v2 31/34] ASoC: codecs: wcd938x: Migrate to aggregate driver Date: Wed, 6 Oct 2021 12:38:16 -0700 Message-Id: <20211006193819.2654854-32-swboyd@chromium.org> X-Mailer: git-send-email 2.33.0.800.g4c38ced690-goog In-Reply-To: <20211006193819.2654854-1-swboyd@chromium.org> References: <20211006193819.2654854-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: 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