From patchwork Wed Sep 21 23:04:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scally X-Patchwork-Id: 12984281 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 967F1C6FA91 for ; Wed, 21 Sep 2022 23:04:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230358AbiIUXEv (ORCPT ); Wed, 21 Sep 2022 19:04:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229785AbiIUXEu (ORCPT ); Wed, 21 Sep 2022 19:04:50 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 262B559250; Wed, 21 Sep 2022 16:04:49 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id c2-20020a1c3502000000b003b2973dafb7so221926wma.2; Wed, 21 Sep 2022 16:04:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=tkaw2t+B6c8owIS12c7Onfy2EYjl3zBqJf7jdOufviU=; b=ovRk512mAT3JaTZrcrWoImvW967ZusXKdeRAgRrmPL6KnAQRpelyZ+OtTDkxiebRv3 KOkTBEzZr7lE2mPXpo9QAxKGqsSZdKn21HrWEp7/CT4TSnhX5qWehcEpqYv/rOJylNY5 LC83R3EDC4R2+i9PB8ST84CRLTriBcHi6I7herocyVnD59f4M7xlCbAUcd+GX5aNJrSS zFykrmaTVcOR3vB4Sn2MMw4x84CLgVkVdmBDRotmy5X3qdqtnDw05iIxUn1J6KxY4/o7 s2X9uXT5dTBAVw5NJFXI8i0vdaSV7azk+82tXnwTAxAGMOo8SOYzLyEEJIHgBTBM1RVN S/qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=tkaw2t+B6c8owIS12c7Onfy2EYjl3zBqJf7jdOufviU=; b=tojWTjuevYmX7398yIg1LwOkXQihkO1C8v+9geIgF7si/4WFYeM1FHp5t8Tp2yPt1m xbxtL3kGHhb+Up7ET4EClwOItkU3q4ssUVp5pDnRFEpZjCeoJCrG24xDCOFo3gahrBZm bvvYFnbDm+6BaKVdYWNKylG5Xa4aFQcOHWMkskcRgMFK4UlzX9Mb66cUsRaRIz2523X2 YO8tnvBJH4DH9WSYJbgLIIATyt6lfKWK4ixKxb7RQxzJBSmgyo0Lmj6WmaJ58WjL7c05 GNw/TIOkh0EdAIUIs16Ixhv2x7cDxLPSKyNLrKtJZ6n0GiBeCE+1yqu1jE4UdtS6rH/b jpgg== X-Gm-Message-State: ACrzQf1MQPy7V9Bw+mzd8Dw2o5ulsNeKMDk7nbHrbjpkJDEPtrG/Zoyo PIuXLnooX2JYO5P/V1UOlVVfic6Tlp8= X-Google-Smtp-Source: AMsMyM6o+RRn5VBV9VRWvNHeuhGkxt4ZBle80NX757tRkycoaINK/ebVYXrfEy6U0yy21gvbCweInA== X-Received: by 2002:a05:600c:3585:b0:3b4:a308:1581 with SMTP id p5-20020a05600c358500b003b4a3081581mr7612070wmq.77.1663801487659; Wed, 21 Sep 2022 16:04:47 -0700 (PDT) Received: from localhost.localdomain (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net. [86.13.91.161]) by smtp.gmail.com with ESMTPSA id x12-20020adfffcc000000b0022ac672654dsm3519252wrs.58.2022.09.21.16.04.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Sep 2022 16:04:47 -0700 (PDT) From: Daniel Scally To: linux-acpi@vger.kernel.org, linux-clk@vger.kernel.org, platform-driver-x86@vger.kernel.org Cc: rafael@kernel.org, lenb@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, hdegoede@redhat.com, markgross@kernel.org, robert.moore@intel.com Subject: [PATCH v3 1/5] ACPI: scan: Add acpi_dev_get_next_consumer_dev() Date: Thu, 22 Sep 2022 00:04:35 +0100 Message-Id: <20220921230439.768185-2-djrscally@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220921230439.768185-1-djrscally@gmail.com> References: <20220921230439.768185-1-djrscally@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org In commit b83e2b306736 ("ACPI: scan: Add function to fetch dependent of ACPI device") we added a means of fetching the first device to declare itself dependent on another ACPI device in the _DEP method. One assumption in that patch was that there would only be a single consuming device, but this has not held. Replace that function with a new function that fetches the next consumer of a supplier device. Where no "previous" consumer is passed in, it behaves identically to the original function. Reviewed-by: Hans de Goede Signed-off-by: Daniel Scally --- Changes since v2: - Separated adev_p and adev instead of relying on a cast (Rafael) - Used a separate if block to check for adev == start in acpi_dev_get_next_consumer_dev() (Rafael) drivers/acpi/scan.c | 40 +++++++++++++++------ drivers/platform/x86/intel/int3472/common.c | 2 +- include/acpi/acpi_bus.h | 4 ++- 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 42cec8120f18..12ac2f3ae5d2 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -2235,9 +2235,22 @@ static int acpi_bus_attach(struct acpi_device *device, void *first_pass) return 0; } -static int acpi_dev_get_first_consumer_dev_cb(struct acpi_dep_data *dep, void *data) +static int acpi_dev_get_next_consumer_dev_cb(struct acpi_dep_data *dep, void *data) { - struct acpi_device *adev; + struct acpi_device **adev_p = data; + struct acpi_device *adev = *adev_p; + + /* + * If we're passed a 'previous' consumer device then we need to skip + * any consumers until we meet the previous one, and then NULL @data + * so the next one can be returned. + */ + if (adev) { + if (dep->consumer == adev->handle) + *adev_p = NULL; + + return 0; + } adev = acpi_bus_get_acpi_device(dep->consumer); if (adev) { @@ -2368,25 +2381,32 @@ bool acpi_dev_ready_for_enumeration(const struct acpi_device *device) EXPORT_SYMBOL_GPL(acpi_dev_ready_for_enumeration); /** - * acpi_dev_get_first_consumer_dev - Return ACPI device dependent on @supplier + * acpi_dev_get_next_consumer_dev - Return the next adev dependent on @supplier * @supplier: Pointer to the dependee device + * @start: Pointer to the current dependent device * - * Returns the first &struct acpi_device which declares itself dependent on + * Returns the next &struct acpi_device which declares itself dependent on * @supplier via the _DEP buffer, parsed from the acpi_dep_list. * - * The caller is responsible for putting the reference to adev when it is no - * longer needed. + * If the returned adev is not passed as @start to this function, the caller is + * responsible for putting the reference to adev when it is no longer needed. */ -struct acpi_device *acpi_dev_get_first_consumer_dev(struct acpi_device *supplier) +struct acpi_device *acpi_dev_get_next_consumer_dev(struct acpi_device *supplier, + struct acpi_device *start) { - struct acpi_device *adev = NULL; + struct acpi_device *adev = start; acpi_walk_dep_device_list(supplier->handle, - acpi_dev_get_first_consumer_dev_cb, &adev); + acpi_dev_get_next_consumer_dev_cb, &adev); + + acpi_dev_put(start); + + if (adev == start) + return NULL; return adev; } -EXPORT_SYMBOL_GPL(acpi_dev_get_first_consumer_dev); +EXPORT_SYMBOL_GPL(acpi_dev_get_next_consumer_dev); /** * acpi_bus_scan - Add ACPI device node objects in a given namespace scope. diff --git a/drivers/platform/x86/intel/int3472/common.c b/drivers/platform/x86/intel/int3472/common.c index 77cf058e4168..9db2bb0bbba4 100644 --- a/drivers/platform/x86/intel/int3472/common.c +++ b/drivers/platform/x86/intel/int3472/common.c @@ -62,7 +62,7 @@ int skl_int3472_get_sensor_adev_and_name(struct device *dev, struct acpi_device *sensor; int ret = 0; - sensor = acpi_dev_get_first_consumer_dev(adev); + sensor = acpi_dev_get_next_consumer_dev(adev, NULL); if (!sensor) { dev_err(dev, "INT3472 seems to have no dependents.\n"); return -ENODEV; diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index e7d27373ff71..bf0886dca6eb 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -736,7 +736,9 @@ bool acpi_dev_hid_uid_match(struct acpi_device *adev, const char *hid2, const ch void acpi_dev_clear_dependencies(struct acpi_device *supplier); bool acpi_dev_ready_for_enumeration(const struct acpi_device *device); -struct acpi_device *acpi_dev_get_first_consumer_dev(struct acpi_device *supplier); +struct acpi_device *acpi_dev_get_next_consumer_dev(struct acpi_device *supplier, + struct acpi_device *start); + struct acpi_device * acpi_dev_get_next_match_dev(struct acpi_device *adev, const char *hid, const char *uid, s64 hrv); struct acpi_device * From patchwork Wed Sep 21 23:04:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scally X-Patchwork-Id: 12984279 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12342C6FA93 for ; Wed, 21 Sep 2022 23:04:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229785AbiIUXEw (ORCPT ); Wed, 21 Sep 2022 19:04:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230325AbiIUXEv (ORCPT ); Wed, 21 Sep 2022 19:04:51 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 402965A3D2; Wed, 21 Sep 2022 16:04:50 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id e10-20020a05600c4e4a00b003b4eff4ab2cso204995wmq.4; Wed, 21 Sep 2022 16:04:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=Hg39dyimgm7lunzbqIkD5pGfg/LBZjGZ6Kg26DrWVrk=; b=ORXEvXSwVVOhiyNaKF41hd1MCBbz4lpxnIr8QnofC0vejyCZ+eR94z7SOJYcJDTjMa xUhNEY4H8a/bLcWgFerhBFf9WpFqvf8jncJVGZlK9vayE05NS9Ruwk01VG2xT7IgYl2B MGCALbea4zY39QNsvrMJr5xGQjKAdAbZYr64+hdbw+FX3sQSfElycApT2IG+68cYNcSL Eu5LgoSl2OoXCKGwzcd+6I46cozbyt/DgMDlO87lIFM9SSAqvn7Ia3lSjdo33UCK9Nej A8KfUtHLMICUSs4pstR/1oV7F/ucPrxn/Fs8k/and9RIA72Jye8006shGaNZI4uiniYa a3ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=Hg39dyimgm7lunzbqIkD5pGfg/LBZjGZ6Kg26DrWVrk=; b=2HfA5iXLep2fYatsYDU4GmPKVsigbXszdY2gC9vzCTW04S6kbVYOG0jO14UGvn76ny Q06qgHm8DbPHgathfVrPlk58x6nUwh+BVc7bfY5HDQoXJLxgsDPj+Q3/olqu6GARET/u bqw+eQzG0up1OW9CqgaPrAHH9ihZ3dIHVrecXoQavXNI8O8JqI3UDGWKPciT1fvcHuHe naMmwSuNCQfLxzPMWzEf0tHgDOtWnheYY4cYZWqwflOuX9VjY7VJgnDkjAvAVaqJrzte e6corGXpLQ66htjTf8/MHaRMBS/NyA0BCpwQ2ktRGd69PYwRAHjIFW/zrUxC9kSxnkhy 4YeQ== X-Gm-Message-State: ACrzQf3g0wgOa6m8KxeHI733g+Dm1VBkIy0/029GN78hNhb5bQZPqX1T BOWRH9oSO4zgOFOyt3eY6kE+r6zzuqI= X-Google-Smtp-Source: AMsMyM50X1vfh2/TAuzwguEAv6xy7yFmdSnf3fF3Jj+crms3jHTFZu4gO055J+XMiJv8YyY5MXHj2Q== X-Received: by 2002:a05:600c:19cc:b0:3b4:b15a:7df with SMTP id u12-20020a05600c19cc00b003b4b15a07dfmr312589wmq.185.1663801488670; Wed, 21 Sep 2022 16:04:48 -0700 (PDT) Received: from localhost.localdomain (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net. [86.13.91.161]) by smtp.gmail.com with ESMTPSA id x12-20020adfffcc000000b0022ac672654dsm3519252wrs.58.2022.09.21.16.04.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Sep 2022 16:04:48 -0700 (PDT) From: Daniel Scally To: linux-acpi@vger.kernel.org, linux-clk@vger.kernel.org, platform-driver-x86@vger.kernel.org Cc: rafael@kernel.org, lenb@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, hdegoede@redhat.com, markgross@kernel.org, robert.moore@intel.com Subject: [PATCH v3 2/5] ACPI: bus: Add iterator for dependent devices Date: Thu, 22 Sep 2022 00:04:36 +0100 Message-Id: <20220921230439.768185-3-djrscally@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220921230439.768185-1-djrscally@gmail.com> References: <20220921230439.768185-1-djrscally@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Add a helper macro to iterate over ACPI devices that are flagged as consumers of an initial supplier ACPI device. Reviewed-by: Hans de Goede Signed-off-by: Daniel Scally --- Changes since v2: - None include/acpi/acpi_bus.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index bf0886dca6eb..abce6f0219ea 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -739,6 +739,17 @@ bool acpi_dev_ready_for_enumeration(const struct acpi_device *device); struct acpi_device *acpi_dev_get_next_consumer_dev(struct acpi_device *supplier, struct acpi_device *start); +/** + * for_each_acpi_consumer_dev - iterate over the consumer ACPI devices for a + * given supplier + * @supplier: Pointer to the supplier's ACPI device + * @consumer: Pointer to &struct acpi_device to hold the consumer, initially NULL + */ +#define for_each_acpi_consumer_dev(supplier, consumer) \ + for (consumer = acpi_dev_get_next_consumer_dev(supplier, NULL); \ + consumer; \ + consumer = acpi_dev_get_next_consumer_dev(supplier, consumer)) + struct acpi_device * acpi_dev_get_next_match_dev(struct acpi_device *adev, const char *hid, const char *uid, s64 hrv); struct acpi_device * From patchwork Wed Sep 21 23:04:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scally X-Patchwork-Id: 12984280 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2631C6FA8E for ; Wed, 21 Sep 2022 23:04:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229624AbiIUXEz (ORCPT ); Wed, 21 Sep 2022 19:04:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229768AbiIUXEw (ORCPT ); Wed, 21 Sep 2022 19:04:52 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E44358DF1; Wed, 21 Sep 2022 16:04:51 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id n15so5686613wrq.5; Wed, 21 Sep 2022 16:04:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=GU0yOGtUWApdWw1YP5/oReOigylKqhYlPcMjFaOZ1a4=; b=hsXXyQG5xjFx5DcN9TQQwZWlZTE4u7OUFESRc0wRInYR3LEPF+MDvgZ245pLCkzHRP +qonf0wVh8hXgdzkSsgZm/QaamCwicfL6z3Zq5rfTds5+GDcDPOfeLcD1hmvZy3kcdUR CuC6zvUtpaxUZ+qpdAmVnuqJ+kEndUrrr+CxIY4qCRgWd44rTN6gkNVJ9f0LtPhoCUY3 LcHTIpg0cuxScmK17IMAXj/4+38W7ltTVCwuK90FGKCMmPgLf/qJ8goCpnC9lFSD6PUA bo4xgA5INzX0CfHo24NyfrG5Nusxn+TzLXuf9EEqM+DZso2qpHkETuBmLi5txl1pdru3 Zb+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=GU0yOGtUWApdWw1YP5/oReOigylKqhYlPcMjFaOZ1a4=; b=IWFaRiWX154J1Edn1W7WAp1uw8y+zwfTiCycLki07Nkwh0cBG4PekFDFurcBGMGAcc N6j2gZyCq6qGDvjYcl9VYUnWW7GLzuBVBBJEWnL/2R68T0mFVLaa4Xnkb6r2vED0Qs0J 9L/lz66N+rT0ItuOx6qFTV7mXZbNfZsV9v7mNtMKXm1m8Z3xAnTmJDOm1l8N5WkFBKRm Qobaa9NBI1zW/8zImy4aq3uvec2umELF1QDPdya0hKSPHiQKHOhlUB42wjhCRJwZ3NtK 8ne8spySpACoN9Y8ZtwXwSqo9eJbhQKfK0Wd0bmKPl4lI0sBEf+V4yNTo92Qh3pachlv Hl1Q== X-Gm-Message-State: ACrzQf2Oqh2WE/U+dbyA9x+VQjdJvIvzgp4IVN16OJamWqQ7w/I5juK/ gPrWe9hLQl/YMY5XHGJmxaJbo7soUEg= X-Google-Smtp-Source: AMsMyM74SGVdqXrkhznuJEBRr++dBPlt1yRbIRAuKUafGwGHaPwT1fT01svctxYz5808sVX5Q6o2OQ== X-Received: by 2002:a5d:464e:0:b0:228:c179:6b0a with SMTP id j14-20020a5d464e000000b00228c1796b0amr214378wrs.402.1663801489659; Wed, 21 Sep 2022 16:04:49 -0700 (PDT) Received: from localhost.localdomain (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net. [86.13.91.161]) by smtp.gmail.com with ESMTPSA id x12-20020adfffcc000000b0022ac672654dsm3519252wrs.58.2022.09.21.16.04.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Sep 2022 16:04:49 -0700 (PDT) From: Daniel Scally To: linux-acpi@vger.kernel.org, linux-clk@vger.kernel.org, platform-driver-x86@vger.kernel.org Cc: rafael@kernel.org, lenb@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, hdegoede@redhat.com, markgross@kernel.org, robert.moore@intel.com Subject: [PATCH v3 3/5] platform/x86: int3472: Support multiple clock consumers Date: Thu, 22 Sep 2022 00:04:37 +0100 Message-Id: <20220921230439.768185-4-djrscally@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220921230439.768185-1-djrscally@gmail.com> References: <20220921230439.768185-1-djrscally@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org At present, the tps68470.c only supports a single clock consumer when passing platform data to the clock driver. In some devices multiple sensors depend on the clock provided by a single TPS68470 and so all need to be able to acquire the clock. Support passing multiple consumers as platform data. Reviewed-by: Hans de Goede Signed-off-by: Daniel Scally Reviewed-by: Stephen Boyd Acked-by: Stephen Boyd --- Changes since v2: - None drivers/clk/clk-tps68470.c | 13 ++-- drivers/platform/x86/intel/int3472/tps68470.c | 59 ++++++++++++++++--- include/linux/platform_data/tps68470.h | 7 ++- 3 files changed, 67 insertions(+), 12 deletions(-) diff --git a/drivers/clk/clk-tps68470.c b/drivers/clk/clk-tps68470.c index e5fbefd6ac2d..38f44b5b9b1b 100644 --- a/drivers/clk/clk-tps68470.c +++ b/drivers/clk/clk-tps68470.c @@ -200,7 +200,9 @@ static int tps68470_clk_probe(struct platform_device *pdev) .flags = CLK_SET_RATE_GATE, }; struct tps68470_clkdata *tps68470_clkdata; + struct tps68470_clk_consumer *consumer; int ret; + int i; tps68470_clkdata = devm_kzalloc(&pdev->dev, sizeof(*tps68470_clkdata), GFP_KERNEL); @@ -223,10 +225,13 @@ static int tps68470_clk_probe(struct platform_device *pdev) return ret; if (pdata) { - ret = devm_clk_hw_register_clkdev(&pdev->dev, - &tps68470_clkdata->clkout_hw, - pdata->consumer_con_id, - pdata->consumer_dev_name); + for (i = 0; i < pdata->n_consumers; i++) { + consumer = &pdata->consumers[i]; + ret = devm_clk_hw_register_clkdev(&pdev->dev, + &tps68470_clkdata->clkout_hw, + consumer->consumer_con_id, + consumer->consumer_dev_name); + } } return ret; diff --git a/drivers/platform/x86/intel/int3472/tps68470.c b/drivers/platform/x86/intel/int3472/tps68470.c index 22f61b47f9e5..8a684030933d 100644 --- a/drivers/platform/x86/intel/int3472/tps68470.c +++ b/drivers/platform/x86/intel/int3472/tps68470.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /* Author: Dan Scally */ +#include #include #include #include @@ -95,20 +96,64 @@ static int skl_int3472_tps68470_calc_type(struct acpi_device *adev) return DESIGNED_FOR_WINDOWS; } +/* + * Return the size of the flexible array member, because we'll need that later + * on to pass .pdata_size to cells. + */ +static int +skl_int3472_fill_clk_pdata(struct device *dev, struct tps68470_clk_platform_data **clk_pdata) +{ + struct acpi_device *adev = ACPI_COMPANION(dev); + struct acpi_device *consumer; + unsigned int n_consumers = 0; + const char *sensor_name; + unsigned int i = 0; + + for_each_acpi_consumer_dev(adev, consumer) + n_consumers++; + + if (!n_consumers) { + dev_err(dev, "INT3472 seems to have no dependents\n"); + return -ENODEV; + } + + *clk_pdata = devm_kzalloc(dev, struct_size(*clk_pdata, consumers, n_consumers), + GFP_KERNEL); + if (!*clk_pdata) + return -ENOMEM; + + (*clk_pdata)->n_consumers = n_consumers; + i = 0; + + for_each_acpi_consumer_dev(adev, consumer) { + sensor_name = devm_kasprintf(dev, GFP_KERNEL, I2C_DEV_NAME_FORMAT, + acpi_dev_name(consumer)); + if (!sensor_name) + return -ENOMEM; + + (*clk_pdata)->consumers[i].consumer_dev_name = sensor_name; + i++; + } + + acpi_dev_put(consumer); + + return n_consumers; +} + static int skl_int3472_tps68470_probe(struct i2c_client *client) { struct acpi_device *adev = ACPI_COMPANION(&client->dev); const struct int3472_tps68470_board_data *board_data; - struct tps68470_clk_platform_data clk_pdata = {}; + struct tps68470_clk_platform_data *clk_pdata; struct mfd_cell *cells; struct regmap *regmap; + int n_consumers; int device_type; int ret; - ret = skl_int3472_get_sensor_adev_and_name(&client->dev, NULL, - &clk_pdata.consumer_dev_name); - if (ret) - return ret; + n_consumers = skl_int3472_fill_clk_pdata(&client->dev, &clk_pdata); + if (n_consumers < 0) + return n_consumers; regmap = devm_regmap_init_i2c(client, &tps68470_regmap_config); if (IS_ERR(regmap)) { @@ -142,8 +187,8 @@ static int skl_int3472_tps68470_probe(struct i2c_client *client) * the clk + regulators must be ready when this happens. */ cells[0].name = "tps68470-clk"; - cells[0].platform_data = &clk_pdata; - cells[0].pdata_size = sizeof(clk_pdata); + cells[0].platform_data = clk_pdata; + cells[0].pdata_size = struct_size(clk_pdata, consumers, n_consumers); cells[1].name = "tps68470-regulator"; cells[1].platform_data = (void *)board_data->tps68470_regulator_pdata; cells[1].pdata_size = sizeof(struct tps68470_regulator_platform_data); diff --git a/include/linux/platform_data/tps68470.h b/include/linux/platform_data/tps68470.h index 126d082c3f2e..e605a2cab07f 100644 --- a/include/linux/platform_data/tps68470.h +++ b/include/linux/platform_data/tps68470.h @@ -27,9 +27,14 @@ struct tps68470_regulator_platform_data { const struct regulator_init_data *reg_init_data[TPS68470_NUM_REGULATORS]; }; -struct tps68470_clk_platform_data { +struct tps68470_clk_consumer { const char *consumer_dev_name; const char *consumer_con_id; }; +struct tps68470_clk_platform_data { + unsigned int n_consumers; + struct tps68470_clk_consumer consumers[]; +}; + #endif From patchwork Wed Sep 21 23:04:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scally X-Patchwork-Id: 12984282 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A34FC32771 for ; Wed, 21 Sep 2022 23:04:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229899AbiIUXE4 (ORCPT ); Wed, 21 Sep 2022 19:04:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbiIUXEw (ORCPT ); Wed, 21 Sep 2022 19:04:52 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 258EA5303E; Wed, 21 Sep 2022 16:04:51 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id d12-20020a05600c3acc00b003b4c12e47f3so233743wms.4; Wed, 21 Sep 2022 16:04:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=ttAPtBvVDayfAZFEAiurM2USRVzwfizzaTOK/jSLWhg=; b=YwoFHi5MFH45Q2dqstzKOfXUkAxGKTfIUjXElm7aGdVaJoRXouDkhq6IpGrGOCYekK 6RDuJYsddop+pX3oDc1tIjFSo4pP8A6PVKhdy5+YQsFuxVPbG7difhHexwqWGsKhbBZi 16PIbebkkv5l5Roev2tUvg489Vp9BqOfg5y3WKSt1UwHMxc9wC2gl8QSxFxhJ05RZiyj 4NKroGpGqHUIdHF2T/tUEVBhE4GuQlKAHsYmLk0v+DRJYkDNM0m+O8B/N9rVYo4qdqIL KQB2BnuhChmOhxmPL2LPG4P6MbfngYeBgsfYPiAZIkIwMB4S4hQQaUb+2cPf/fM1qPXx BfKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=ttAPtBvVDayfAZFEAiurM2USRVzwfizzaTOK/jSLWhg=; b=B717DmiNSEmw6V5cXIWz9R48pEXyn6WsK0J8bsXlLEsnZed9d9Ef8MircKooXKn9X9 Xe+3jJrYa8CXWJj02fH+h8mhVQbxnwvzJUfiXtkUM1RcaqFYYfJegOJCmcvrSNRFpDxi woUXnLPHZ3mNZ93LMCcswZIPyIFbYjfhrX3/Ps9JtcQz5jQspGDlGG42EkEnvf05GPcG AngZy7UBiARqfowr2XDe72VBCaMGdfD7RYddE5wAtcYMXn+3P8sIkSU3D9ewwn9Iwc9m mjT9kCxbkCD8u73xR9/pd2cH/pYREaM3ig3pVPt3fPHHRsDsi9lopf2Zi+3w2yqAOMeX Swxw== X-Gm-Message-State: ACrzQf2gUcNjN9wnC6R8JGSStRxy5EwLcep0bdXfuTBJShiIDlL6V8OJ BqD6V5qBG0qPRJsXTOWnCUulFbiWs4A= X-Google-Smtp-Source: AMsMyM7o6+kbEKzggHEmviYKODkwBnuoGY1J1WCIVAZGbsEkxpCJvLN5TWuW+rGqIpzdceToeI/dAw== X-Received: by 2002:a05:600c:310b:b0:3b4:c618:180d with SMTP id g11-20020a05600c310b00b003b4c618180dmr323922wmo.25.1663801490649; Wed, 21 Sep 2022 16:04:50 -0700 (PDT) Received: from localhost.localdomain (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net. [86.13.91.161]) by smtp.gmail.com with ESMTPSA id x12-20020adfffcc000000b0022ac672654dsm3519252wrs.58.2022.09.21.16.04.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Sep 2022 16:04:50 -0700 (PDT) From: Daniel Scally To: linux-acpi@vger.kernel.org, linux-clk@vger.kernel.org, platform-driver-x86@vger.kernel.org Cc: rafael@kernel.org, lenb@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, hdegoede@redhat.com, markgross@kernel.org, robert.moore@intel.com Subject: [PATCH v3 4/5] platform/x86: int3472: Support multiple gpio lookups in board data Date: Thu, 22 Sep 2022 00:04:38 +0100 Message-Id: <20220921230439.768185-5-djrscally@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220921230439.768185-1-djrscally@gmail.com> References: <20220921230439.768185-1-djrscally@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Currently, we only support passing a single gpiod_lookup_table as part of the board data for the tps68470 driver. This carries the implicit assumption that each TPS68470 device will only support a single sensor, which does not hold true. Extend the code to support the possibility of multiple sensors each having a gpiod_lookup_table, and opportunistically add the lookup table for the Surface Go line's IR camera. Reviewed-by: Hans de Goede Signed-off-by: Daniel Scally --- Changes since v2: - None drivers/platform/x86/intel/int3472/tps68470.c | 17 ++++++++++----- drivers/platform/x86/intel/int3472/tps68470.h | 3 ++- .../x86/intel/int3472/tps68470_board_data.c | 21 ++++++++++++++++--- 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/drivers/platform/x86/intel/int3472/tps68470.c b/drivers/platform/x86/intel/int3472/tps68470.c index 8a684030933d..49fc379fe680 100644 --- a/drivers/platform/x86/intel/int3472/tps68470.c +++ b/drivers/platform/x86/intel/int3472/tps68470.c @@ -150,6 +150,7 @@ static int skl_int3472_tps68470_probe(struct i2c_client *client) int n_consumers; int device_type; int ret; + int i; n_consumers = skl_int3472_fill_clk_pdata(&client->dev, &clk_pdata); if (n_consumers < 0) @@ -194,15 +195,18 @@ static int skl_int3472_tps68470_probe(struct i2c_client *client) cells[1].pdata_size = sizeof(struct tps68470_regulator_platform_data); cells[2].name = "tps68470-gpio"; - gpiod_add_lookup_table(board_data->tps68470_gpio_lookup_table); + for (i = 0; i < board_data->n_gpiod_lookups; i++) + gpiod_add_lookup_table(board_data->tps68470_gpio_lookup_tables[i]); ret = devm_mfd_add_devices(&client->dev, PLATFORM_DEVID_NONE, cells, TPS68470_WIN_MFD_CELL_COUNT, NULL, 0, NULL); kfree(cells); - if (ret) - gpiod_remove_lookup_table(board_data->tps68470_gpio_lookup_table); + if (ret) { + for (i = 0; i < board_data->n_gpiod_lookups; i++) + gpiod_remove_lookup_table(board_data->tps68470_gpio_lookup_tables[i]); + } break; case DESIGNED_FOR_CHROMEOS: @@ -226,10 +230,13 @@ static int skl_int3472_tps68470_probe(struct i2c_client *client) static int skl_int3472_tps68470_remove(struct i2c_client *client) { const struct int3472_tps68470_board_data *board_data; + int i; board_data = int3472_tps68470_get_board_data(dev_name(&client->dev)); - if (board_data) - gpiod_remove_lookup_table(board_data->tps68470_gpio_lookup_table); + if (board_data) { + for (i = 0; i < board_data->n_gpiod_lookups; i++) + gpiod_remove_lookup_table(board_data->tps68470_gpio_lookup_tables[i]); + } return 0; } diff --git a/drivers/platform/x86/intel/int3472/tps68470.h b/drivers/platform/x86/intel/int3472/tps68470.h index cfd33eb62740..35915e701593 100644 --- a/drivers/platform/x86/intel/int3472/tps68470.h +++ b/drivers/platform/x86/intel/int3472/tps68470.h @@ -16,8 +16,9 @@ struct tps68470_regulator_platform_data; struct int3472_tps68470_board_data { const char *dev_name; - struct gpiod_lookup_table *tps68470_gpio_lookup_table; const struct tps68470_regulator_platform_data *tps68470_regulator_pdata; + unsigned int n_gpiod_lookups; + struct gpiod_lookup_table *tps68470_gpio_lookup_tables[]; }; const struct int3472_tps68470_board_data *int3472_tps68470_get_board_data(const char *dev_name); diff --git a/drivers/platform/x86/intel/int3472/tps68470_board_data.c b/drivers/platform/x86/intel/int3472/tps68470_board_data.c index 525f09a3b5ff..e6cc8f40f5af 100644 --- a/drivers/platform/x86/intel/int3472/tps68470_board_data.c +++ b/drivers/platform/x86/intel/int3472/tps68470_board_data.c @@ -96,7 +96,7 @@ static const struct tps68470_regulator_platform_data surface_go_tps68470_pdata = }, }; -static struct gpiod_lookup_table surface_go_tps68470_gpios = { +static struct gpiod_lookup_table surface_go_int347a_gpios = { .dev_id = "i2c-INT347A:00", .table = { GPIO_LOOKUP("tps68470-gpio", 9, "reset", GPIO_ACTIVE_LOW), @@ -105,16 +105,31 @@ static struct gpiod_lookup_table surface_go_tps68470_gpios = { } }; +static struct gpiod_lookup_table surface_go_int347e_gpios = { + .dev_id = "i2c-INT347E:00", + .table = { + GPIO_LOOKUP("tps68470-gpio", 5, "enable", GPIO_ACTIVE_HIGH), + { } + } +}; + static const struct int3472_tps68470_board_data surface_go_tps68470_board_data = { .dev_name = "i2c-INT3472:05", - .tps68470_gpio_lookup_table = &surface_go_tps68470_gpios, .tps68470_regulator_pdata = &surface_go_tps68470_pdata, + .n_gpiod_lookups = 2, + .tps68470_gpio_lookup_tables = { + &surface_go_int347a_gpios, + &surface_go_int347e_gpios, + }, }; static const struct int3472_tps68470_board_data surface_go3_tps68470_board_data = { .dev_name = "i2c-INT3472:01", - .tps68470_gpio_lookup_table = &surface_go_tps68470_gpios, .tps68470_regulator_pdata = &surface_go_tps68470_pdata, + .n_gpiod_lookups = 1, + .tps68470_gpio_lookup_tables = { + &surface_go_int347a_gpios + }, }; static const struct dmi_system_id int3472_tps68470_board_data_table[] = { From patchwork Wed Sep 21 23:04:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scally X-Patchwork-Id: 12984283 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFE1AC6FA97 for ; Wed, 21 Sep 2022 23:04:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229969AbiIUXE5 (ORCPT ); Wed, 21 Sep 2022 19:04:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbiIUXEy (ORCPT ); Wed, 21 Sep 2022 19:04:54 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FFFC59250; Wed, 21 Sep 2022 16:04:53 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id g3so12549158wrq.13; Wed, 21 Sep 2022 16:04:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=mYmlNW/kvE5Te9Epoe8eYigERXBZjlLl2bpj3cEE2Es=; b=SpuNUYLgGgvbSn5pRcc7+/m4OGVWOfPc7EQNdvwlyDfMiVavG8MDKhd8uP7xw1HnF4 uCbRQurmwuxfEuShOkWEdGRQXknH+6lZ8itnpxpfpudjg2ijszNZ3K4UD8kl6ZjY4D0G R0Wn1LLV2msH/D94rVn92xmFoXtu7URSFc5tSoJJuBKWo/8/XglECwL88bnrviiI6Ee1 Lf368RqQRaIB4pMr3KV3IgSc5S8ET3fYCLh+Ed/x4/olrZHYuhNmLcJ7Rs8HzLX1PZ29 q5KL998BAjQRZN9HXuXKtpRS+lfpSlSgooUjlT79EF2pSYTN0mMbHXMEzV3VxprSYSFc FSCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=mYmlNW/kvE5Te9Epoe8eYigERXBZjlLl2bpj3cEE2Es=; b=v1voJI+NLdS9M7TLssNuJkhZAq+YSjbHC+MLOTyms/PER1EYc6iZPwWffWT6onoiA1 yhEbPZkMYEeiE5J3URM8gKxsziPUi7gw7Ss+Z7n3ucg7JiyfSerrE7xTw7GsW6Cmfoig 80+S4Bimd6jdac2E6VWFfThnohmQlynIvvbU7vENGNatnWakzNcrOE+L7uWZkrWFliqn R4hqGWE7UGXgUt9TSOP8hK6hphqFwmVkRq0EJt98IUb9LNmYnTUMzXp7ivc2UsaHBgjN xYpqlU6NrkyQcT+bsS7RzISigQqF+shh/G8OPggnmSprKrWKd6O/uG+ygWltrpJhWAA7 QtPQ== X-Gm-Message-State: ACrzQf1IRg8LHlDac3yw2qzNxjY+j4O7co+1pRtfveZHicqUrrSigvno JxdMg5/MuegrkfH6QLpPVMgLbDsGt6k= X-Google-Smtp-Source: AMsMyM5J2t2iu7/Zw9vzJaL0kcXLnOhkNbyLAj4OO9WCDk4cVJqZJcibbHS/hCOxq7k+VO7A+Dgs0A== X-Received: by 2002:a5d:5382:0:b0:22a:c36f:8e36 with SMTP id d2-20020a5d5382000000b0022ac36f8e36mr200173wrv.245.1663801492094; Wed, 21 Sep 2022 16:04:52 -0700 (PDT) Received: from localhost.localdomain (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net. [86.13.91.161]) by smtp.gmail.com with ESMTPSA id x12-20020adfffcc000000b0022ac672654dsm3519252wrs.58.2022.09.21.16.04.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Sep 2022 16:04:51 -0700 (PDT) From: Daniel Scally To: linux-acpi@vger.kernel.org, linux-clk@vger.kernel.org, platform-driver-x86@vger.kernel.org Cc: rafael@kernel.org, lenb@kernel.org, mturquette@baylibre.com, sboyd@kernel.org, hdegoede@redhat.com, markgross@kernel.org, robert.moore@intel.com Subject: [PATCH v3 5/5] platform/x86: int3472: Add board data for Surface Go2 IR camera Date: Thu, 22 Sep 2022 00:04:39 +0100 Message-Id: <20220921230439.768185-6-djrscally@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220921230439.768185-1-djrscally@gmail.com> References: <20220921230439.768185-1-djrscally@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Add the board data describing the regulators for the Microsoft Surface Go line's IR camera. Reviewed-by: Hans de Goede Signed-off-by: Daniel Scally --- Changes since v2: - None .../x86/intel/int3472/tps68470_board_data.c | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/drivers/platform/x86/intel/int3472/tps68470_board_data.c b/drivers/platform/x86/intel/int3472/tps68470_board_data.c index e6cc8f40f5af..309eab9c0558 100644 --- a/drivers/platform/x86/intel/int3472/tps68470_board_data.c +++ b/drivers/platform/x86/intel/int3472/tps68470_board_data.c @@ -30,6 +30,15 @@ static struct regulator_consumer_supply int347a_vcm_consumer_supplies[] = { static struct regulator_consumer_supply int347a_vsio_consumer_supplies[] = { REGULATOR_SUPPLY("dovdd", "i2c-INT347A:00"), REGULATOR_SUPPLY("vsio", "i2c-INT347A:00-VCM"), + REGULATOR_SUPPLY("vddd", "i2c-INT347E:00"), +}; + +static struct regulator_consumer_supply int347a_aux1_consumer_supplies[] = { + REGULATOR_SUPPLY("vdda", "i2c-INT347E:00"), +}; + +static struct regulator_consumer_supply int347a_aux2_consumer_supplies[] = { + REGULATOR_SUPPLY("vdddo", "i2c-INT347E:00"), }; static const struct regulator_init_data surface_go_tps68470_core_reg_init_data = { @@ -86,6 +95,28 @@ static const struct regulator_init_data surface_go_tps68470_vsio_reg_init_data = .consumer_supplies = int347a_vsio_consumer_supplies, }; +static const struct regulator_init_data surface_go_tps68470_aux1_reg_init_data = { + .constraints = { + .min_uV = 2815200, + .max_uV = 2815200, + .apply_uV = 1, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = ARRAY_SIZE(int347a_aux1_consumer_supplies), + .consumer_supplies = int347a_aux1_consumer_supplies, +}; + +static const struct regulator_init_data surface_go_tps68470_aux2_reg_init_data = { + .constraints = { + .min_uV = 1800600, + .max_uV = 1800600, + .apply_uV = 1, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = ARRAY_SIZE(int347a_aux2_consumer_supplies), + .consumer_supplies = int347a_aux2_consumer_supplies, +}; + static const struct tps68470_regulator_platform_data surface_go_tps68470_pdata = { .reg_init_data = { [TPS68470_CORE] = &surface_go_tps68470_core_reg_init_data, @@ -93,6 +124,8 @@ static const struct tps68470_regulator_platform_data surface_go_tps68470_pdata = [TPS68470_VCM] = &surface_go_tps68470_vcm_reg_init_data, [TPS68470_VIO] = &surface_go_tps68470_vio_reg_init_data, [TPS68470_VSIO] = &surface_go_tps68470_vsio_reg_init_data, + [TPS68470_AUX1] = &surface_go_tps68470_aux1_reg_init_data, + [TPS68470_AUX2] = &surface_go_tps68470_aux2_reg_init_data, }, };