Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp853288pxb; Mon, 25 Oct 2021 20:39:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpVTgGsVPeiviqj4ZIYoxR6PFaQItWGXVvhNcvw8N0MQzWTqqj9/6Rl5HYIF2geRCRDspk X-Received: by 2002:a05:6a00:24c8:b0:44c:654b:403b with SMTP id d8-20020a056a0024c800b0044c654b403bmr21990313pfv.55.1635219557338; Mon, 25 Oct 2021 20:39:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635219557; cv=none; d=google.com; s=arc-20160816; b=BsHYOOBp0Ibj2f2S1XvU/Hm8jtgNAPSrreO/0gl7jMEywQ/PydQSiGlkSeXje0Fn2H HKmdpnY4EIJEsCGy2l9T4Ka/GQlziDUtgq3lu/epsBVLsGIYXcdpInWtz1hvkOH/BP4o uDWMOMKB0v1lJYiq+o9IULTR3vm85G+53N7vj/h38cARRCI2pAiLD21VOeP/FDIyYZ25 TnHh4vY5rUb42OjwnBmc9Yw0/QeRdxlHLesgbr4++5pfy2lQdUoXvUCw63Gjg1Ycl/tg IaiS6SpW03DGTUlrT2xNkJOsYx8lUYMQRUUyq30XhnDZhxS86q3fw20Kcz7032R/ADJj ZWVQ== 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=+JAo2MaGppQnqjiILYakqrQo0dvp6TO6MPFSMqu2Msw=; b=rEEKXSLcAOTD7dPYTyyPkNekqm4PkqNL25D60AGWYzS+zGpwRJ78Vj6kUwNurckzio 3HN/M6WsI5hfM+Di2q4N2Kd/rBtXwSBtij5+KxoZPSWYUbuBbZW6/6EXC3pF+xdLzKfM xWA6lyJ86nRC7hhluHvIKCe3YCDdj7TcADN0XLtTyr/jYFVciChUguBCX5IpZP+pEjSx TRpaQ0J6MzweBOczb9Y9Q1zQQAUfTJNJMXzvA3wsuxIERyyKd6rtkaSIiZ3Cb74pf9dh WAz6DgAIbQ1sf2RdBX/n9SPsEkxQXIFYaV9fEfKBIccnuVFNJb3Kw72GUaNsimb7sDFa 2DOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PYjqBgBu; 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 e27si26929845pgl.492.2021.10.25.20.38.52; Mon, 25 Oct 2021 20:39:17 -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=PYjqBgBu; 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 S236160AbhJZAFr (ORCPT + 99 others); Mon, 25 Oct 2021 20:05:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235786AbhJZADg (ORCPT ); Mon, 25 Oct 2021 20:03:36 -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 14238C06122D for ; Mon, 25 Oct 2021 17:01:12 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id v16so3643156ple.9 for ; Mon, 25 Oct 2021 17:01:12 -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=+JAo2MaGppQnqjiILYakqrQo0dvp6TO6MPFSMqu2Msw=; b=PYjqBgBuC4Ln3ClxVTkBrUeIYtIzbr3/5t+stBdwqdI5JN2yqaozNc3LTXIWEmp43Y 6PHTQ4PjUxKD5uPJ1pH5iA38AouWfjyJQePxoiYsvWR9QQ5fP9IZR6rgjj9GCecp9Z+u XVoZw9JtkZ0XlO8+AVypz02I0Tiq/Y4wGz3rM= 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=+JAo2MaGppQnqjiILYakqrQo0dvp6TO6MPFSMqu2Msw=; b=IBnE841WXvwRQA6pMPCW63RrDfD+6+bmmE1uAQUwzgA9l5lin6s9outqAo1SIO/awr sABha5aXDdCvlnK4NExNbnfuckZreHWIimHHfQTMwqTuiMTuurwH5YjAyDkwVqct2fWG ve/9JCNnj0GI51Gx5KV1gGBIhA2CrV/qLsWEgvz+ZmYv1t1cTiXhx1URmpkOXCzGYbHH 6cfNG0j54hETAho/JBO00IgxBiOsNq2kIh78XocmBdC4Pr5EWhDC4+CHiaWJo0Ll6jzu T+bHoEUMtJata9zxNL/olgF0cT7h/x0nIqOZx7H5Q/5+HckV9IG1F7iTTjtjzvRM3Goj kGpQ== X-Gm-Message-State: AOAM532oCx+VyjjtFLBt0aeEVg/bIV9ZQ16+cIsfQAzm1aK4UPDMvnDe avxqCyiKASBqQTzUHKNlUWk8gw== X-Received: by 2002:a17:902:ecc5:b0:140:4db1:e74 with SMTP id a5-20020a170902ecc500b001404db10e74mr9949902plh.10.1635206471632; Mon, 25 Oct 2021 17:01:11 -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.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 17:01:11 -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, Sebastian Reichel , linux-pm@vger.kernel.org, Daniel Vetter , Linus Walleij , "Rafael J. Wysocki" , Rob Clark , Russell King , Saravana Kannan Subject: [PATCH v3 29/34] power: supply: ab8500: Migrate to aggregate driver Date: Mon, 25 Oct 2021 17:00:39 -0700 Message-Id: <20211026000044.885195-30-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: Sebastian Reichel Cc: Cc: Daniel Vetter Cc: Linus Walleij Cc: "Rafael J. Wysocki" Cc: Rob Clark Cc: Russell King Cc: Saravana Kannan Signed-off-by: Stephen Boyd --- drivers/power/supply/ab8500_charger.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/power/supply/ab8500_charger.c b/drivers/power/supply/ab8500_charger.c index 15eadaf46f14..52d4105e28f2 100644 --- a/drivers/power/supply/ab8500_charger.c +++ b/drivers/power/supply/ab8500_charger.c @@ -3312,8 +3312,9 @@ static const struct power_supply_desc ab8500_usb_chg_desc = { .get_property = ab8500_charger_usb_get_property, }; -static int ab8500_charger_bind(struct device *dev) +static int ab8500_charger_bind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct ab8500_charger *di = dev_get_drvdata(dev); int ch_stat; int ret; @@ -3354,8 +3355,9 @@ static int ab8500_charger_bind(struct device *dev) return 0; } -static void ab8500_charger_unbind(struct device *dev) +static void ab8500_charger_unbind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct ab8500_charger *di = dev_get_drvdata(dev); int ret; @@ -3380,9 +3382,13 @@ static void ab8500_charger_unbind(struct device *dev) component_unbind_all(dev, di); } -static const struct component_master_ops ab8500_charger_comp_ops = { - .bind = ab8500_charger_bind, - .unbind = ab8500_charger_unbind, +static struct aggregate_driver ab8500_charger_aggregate_driver = { + .probe = ab8500_charger_bind, + .remove = ab8500_charger_unbind, + .driver = { + .name = "ab8500_charger_agg", + .owner = THIS_MODULE, + }, }; static struct platform_driver *const ab8500_charger_component_drivers[] = { @@ -3663,9 +3669,7 @@ static int ab8500_charger_probe(struct platform_device *pdev) } - ret = component_master_add_with_match(&pdev->dev, - &ab8500_charger_comp_ops, - match); + ret = component_aggregate_register(&pdev->dev, &ab8500_charger_aggregate_driver, match); if (ret) { dev_err(dev, "failed to add component master\n"); goto free_notifier; @@ -3688,7 +3692,7 @@ static int ab8500_charger_remove(struct platform_device *pdev) { struct ab8500_charger *di = platform_get_drvdata(pdev); - component_master_del(&pdev->dev, &ab8500_charger_comp_ops); + component_aggregate_unregister(&pdev->dev, &ab8500_charger_aggregate_driver); usb_unregister_notifier(di->usb_phy, &di->nb); usb_put_phy(di->usb_phy); -- https://chromeos.dev