From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f170.google.com (mail-dy1-f170.google.com [74.125.82.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4B153A7827 for ; Tue, 21 Apr 2026 22:52:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776811959; cv=none; b=jHRi5+ymfbMwPymc0Kkjj5c4Jf8NJztoOM7ImEeO9dCmRst3zk+YEGv5AgRAiKhdxG31DvUVi0NIh/qBMFvC6jdZwWarIQTpZENuB7ZFitG1PYVGK7HFraWnCF5MBwZQUpFcqhkisKSu4RveIpCRRG8QTnAoauHj2nxyD3wmPhc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776811959; c=relaxed/simple; bh=pkISsqV/Vd/AkxRoaxIZdYMzBbCImLUZNm6/QZ3JzIA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OWwjtz8e2O5WhNYhyFGjBKrROb9/8nbfdxPC4mmFEo+gizYg4khFOc5f4DE/8dluKFWb3FIVBGyXuqigcGZdju4sIWGmYFadgL2E7c41z9zQlJgZCnxaeVTPasvk44eKvkd9ru8qcJ7bkA1lV5S8Jw6pU2pJYMK4OBSe0qmYqwQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OGupfWbU; arc=none smtp.client-ip=74.125.82.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OGupfWbU" Received: by mail-dy1-f170.google.com with SMTP id 5a478bee46e88-2dec803f9f0so2825908eec.0 for ; Tue, 21 Apr 2026 15:52:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776811956; x=1777416756; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qMmU13XWi2hz/awwYwuaTGeoy/1gyMry/mt49asroCk=; b=OGupfWbUQAXYCzcLTVxk4AAuqIZ+3ToqdEVaY7cmfRSvUWs4Z/GHUopGy6GOKz/wDK qs03Uyx3Fsb71jjW8XY0/JyluX+ZZE75bsUBvzd19z9y1c+N/0ZXNojijEUbu1p4T1Ef ev2KpeKOJoL5/MYOlDGAxYxoa9HyqHKqHMJdAN/9oIRoj7bQyxyvV0aA+1puAScURy0c RbDlj5R+NAk4veVRzWZ9GmncKcqRuytq0eDUKNaJeL9vS4NYd1BgT70YMz+WzB1Tv+qO QVdqJBizZRBiNoxiJOk7HR0LHBMwgwPa0lMD5038+kmNujYB4Nu6GUGKVyLdXsYexYUi DNrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776811956; x=1777416756; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=qMmU13XWi2hz/awwYwuaTGeoy/1gyMry/mt49asroCk=; b=j5S8v93LX+DMMZIazggmwtq56CJCCIGRQY20931KCKj2vtb5ivOy7Mo4ykc3MUgq84 kx9Ynbh7nFiAaqfmUR4yOTAI4zG1UbUR+sAyK/EjtGv7ay/OehEoiw8KGUX4JqNWhfhY 1JTId0KUunydjScg4wu0PflZJK9iQcHVoJZNWsv6U+50/PsO//CnqlBfu4C0pBMBXulm qUEsg5fnoIvTbtcAhAQi1ftygnCwQClJetYfH5UyxSE/s2C7BiBqG3q8kYuFnWdkb16F kvFShGCyOk+t/MEP704jhRM2S8uZva35SLxrEA1ScTLR9QJfkR3pwByIUjFCWwhyUNgt sJsg== X-Gm-Message-State: AOJu0Yy84rvxt8yFM+8jb1vAHuRPs8NZH0gpEW2yaPg+LuWmxCYm74Z7 QdNQSwu/HNmhonzwIoDTosWMA1HOfFySRjpc/Ethgi/C25LOVzZeayf5fb/rA6wFot8= X-Gm-Gg: AeBDiesN31iQqezab+cnzi8WrfzUebYk/o8mUGEAyVCKmuRnP3jOhLpTqqK1DllYVP3 VkOce6eQ2iRgX7rNXrgq+lLnAGTS00QP/ZX4RlXrv7rKYUi++7Cb1XoHnO6vaCvt4F65sM+RqXM ZPWXsMzKvyeSWi0buOxdCM12mKTzsooR8ooTPYbZZ0ouE3DVJ/l6EfbKn0V+Iv4xLexA36WCDg0 e8YYu+QVQLpVgMYZa9OM/HIVFs9IT7wH7/AcLdlc7xLc+LHYOyWmWrxFeoiTrqcHu54IlxblUNj ymChIqUAzsljdngoGeJ6u4YXxDVheZ4kuET1n+2XawgfWcWS074kY020pFyBsFiuHgZ79rDHZ5i xPWXLZf8CyX3pPN1J/t7t/9iAzFCwpD77kvQdLMdjvWqX4KbXRsPiy0ey1IpxoLOFtO3MDEjV4N Yk3b2yAKfEpiD7LA1PUjFQ6jpgGphgQLB5 X-Received: by 2002:a05:7300:5711:b0:2c5:c532:1fe1 with SMTP id 5a478bee46e88-2e42c15ceacmr9582888eec.3.1776811955691; Tue, 21 Apr 2026 15:52:35 -0700 (PDT) Received: from TC-LAPTOP.lan ([209.76.64.37]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2e53a4a8018sm26145884eec.8.2026.04.21.15.52.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2026 15:52:35 -0700 (PDT) From: Thierry Chatard To: linux-kernel@vger.kernel.org Cc: hansg@kernel.org, lee@kernel.org, platform-driver-x86@vger.kernel.org, ilpo.jarvinen@linux.intel.com, djrscally@gmail.com, linux-media@vger.kernel.org, mchehab@kernel.org, sakari.ailus@linux.intel.com, jacopo.mondi@ideasonboard.com, nicholas@rothemail.net, Thierry Chatard Subject: [PATCH v4 2/5] platform/x86: int3472: tps68470: fix clock consumer registration for Dell Latitude 5285 Date: Tue, 21 Apr 2026 15:52:14 -0700 Message-ID: <20260421225217.12472-3-tchatard@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260421225217.12472-1-tchatard@gmail.com> References: <20260421225217.12472-1-tchatard@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The BIOS on the Dell Latitude 5285 leaves GNVS field C0TP at zero. With C0TP=0 the ACPI _DEP method on INT3479 (OV5670, front camera) resolves to PCI0 instead of the INT3472 (TPS68470 PMIC) device. Because for_each_acpi_consumer_dev() walks the _DEP reverse-mapping, INT3479 is invisible to it: the clock consumer lookup entry for the front camera is never registered with the tps68470-clk driver, and the OV5670 sensor driver cannot acquire its MCLK. Fix this without touching ACPI tables by adding optional static clock consumer fields to struct int3472_tps68470_board_data: unsigned int n_clk_consumers; const struct tps68470_clk_consumer *clk_consumers; When board data is present and n_clk_consumers is non-zero, probe uses the static list instead of for_each_acpi_consumer_dev() to populate tps68470-clk platform data. Platforms that do not set these fields continue to use the existing ACPI traversal path unchanged. The board_data lookup is moved before the clock-pdata allocation so that it is available for both the static and dynamic paths. Signed-off-by: Thierry Chatard --- drivers/platform/x86/intel/int3472/tps68470.c | 36 +++++++++++++++---- drivers/platform/x86/intel/int3472/tps68470.h | 10 ++++++ 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/drivers/platform/x86/intel/int3472/tps68470.c b/drivers/platform/x86/intel/int3472/tps68470.c index a496075c0..e121eb24a 100644 --- a/drivers/platform/x86/intel/int3472/tps68470.c +++ b/drivers/platform/x86/intel/int3472/tps68470.c @@ -147,17 +147,40 @@ static int skl_int3472_tps68470_probe(struct i2c_client *client) struct tps68470_clk_platform_data *clk_pdata; struct mfd_cell *cells; struct regmap *regmap; - int n_consumers; + unsigned int n_consumers; int device_type; int ret; - int i; + unsigned int i; if (!adev) return -ENODEV; - n_consumers = skl_int3472_fill_clk_pdata(&client->dev, &clk_pdata); - if (n_consumers < 0) - return n_consumers; + /* + * Look up board data before building clock platform data. On + * platforms where a sensor's ACPI _DEP does not list the INT3472 + * device, for_each_acpi_consumer_dev() misses that sensor and its + * clock consumer entry is never registered. Board data can supply + * a static consumer list to use instead, bypassing the broken _DEP + * traversal. + */ + board_data = int3472_tps68470_get_board_data(dev_name(&client->dev)); + + if (board_data && board_data->n_clk_consumers) { + clk_pdata = devm_kzalloc(&client->dev, + struct_size(clk_pdata, consumers, + board_data->n_clk_consumers), + GFP_KERNEL); + if (!clk_pdata) + return -ENOMEM; + clk_pdata->n_consumers = board_data->n_clk_consumers; + for (i = 0; i < board_data->n_clk_consumers; i++) + clk_pdata->consumers[i] = board_data->clk_consumers[i]; + n_consumers = board_data->n_clk_consumers; + } else { + 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)) { @@ -176,7 +199,6 @@ static int skl_int3472_tps68470_probe(struct i2c_client *client) device_type = skl_int3472_tps68470_calc_type(adev); switch (device_type) { case DESIGNED_FOR_WINDOWS: - board_data = int3472_tps68470_get_board_data(dev_name(&client->dev)); if (!board_data) return dev_err_probe(&client->dev, -ENODEV, "No board-data found for this model\n"); @@ -233,7 +255,7 @@ static int skl_int3472_tps68470_probe(struct i2c_client *client) static void skl_int3472_tps68470_remove(struct i2c_client *client) { const struct int3472_tps68470_board_data *board_data; - int i; + unsigned int i; board_data = int3472_tps68470_get_board_data(dev_name(&client->dev)); if (board_data) { diff --git a/drivers/platform/x86/intel/int3472/tps68470.h b/drivers/platform/x86/intel/int3472/tps68470.h index 35915e701..1d3d67459 100644 --- a/drivers/platform/x86/intel/int3472/tps68470.h +++ b/drivers/platform/x86/intel/int3472/tps68470.h @@ -12,11 +12,21 @@ #define _INTEL_SKL_INT3472_TPS68470_H struct gpiod_lookup_table; +struct tps68470_clk_consumer; struct tps68470_regulator_platform_data; struct int3472_tps68470_board_data { const char *dev_name; const struct tps68470_regulator_platform_data *tps68470_regulator_pdata; + /* + * Static clock consumers. When n_clk_consumers is non-zero these + * are used in place of for_each_acpi_consumer_dev() to build the + * tps68470-clk platform data. Needed on platforms where a sensor's + * ACPI _DEP does not list the INT3472 device, causing that sensor + * to be missed by the ACPI dependency traversal. + */ + unsigned int n_clk_consumers; + const struct tps68470_clk_consumer *clk_consumers; unsigned int n_gpiod_lookups; struct gpiod_lookup_table *tps68470_gpio_lookup_tables[]; }; -- 2.51.0