From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f53.google.com (mail-dl1-f53.google.com [74.125.82.53]) (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 9118733A9FE for ; Fri, 17 Apr 2026 16:33:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776443590; cv=none; b=sfq5A0MbZRNRiWhtBVhmmwubIGAT8/SySsMBE6Rab9y4KJBZOeYwVVLBE7w/4+Rg0fe85H4dDZ5SMYBmRgqkaPjcXH2jvwivFt8uWuRJx9KK2WB/WUtZeVTF1qFeUUafZfRHJ0FFcYn1WuQcr0HearCFZeKJ9CRNtld1KSLHJJ4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776443590; c=relaxed/simple; bh=LRi+8j1uv4IQyt+SAcNH9ZeGWEkOX3C75mNUd0mLMwo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=K9aTRKagzEOPaUIe0oD9BxEOZpGo2XER4sIXEi65jLpROMlfRljKfdnKLuB3BwA+bH6kifZo/tbysBQzzFmGdiaZaAqUaly6gwEttFIGiWzq0vvDk1FDWfS/0Mo7dcnRvOvCOJs78zMy/Tst11XBXowwq4ixHoQgmFIGWE+voeA= 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=YZBhD0wj; arc=none smtp.client-ip=74.125.82.53 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="YZBhD0wj" Received: by mail-dl1-f53.google.com with SMTP id a92af1059eb24-12c726f46baso1212968c88.1 for ; Fri, 17 Apr 2026 09:33:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776443586; x=1777048386; 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=OZYzSmgJreVWUypCLvWA6sUD7qzkFl9KFowiKMZhy/4=; b=YZBhD0wjLsPA1xLU3hD877iYG9/rqT7vfEZcg02XQIDvmoyHBpbECILodegmD/hEH5 ooROrabaIMU+VZAZP6O9VwN2+u1DMxPFYkjefM8P4J/ZdwlDU1qRcdJ0WghDPfUe4SoA 8AIyyReXOpN+HUGXD1Qk6KkrTcc51xyzZvhwKQL6Aai5Yg+ahv1IwB/0AzxsI9La1Vjt NA2zDj3vb0kop/TlINgfBDfVZw7fvH+R8VFk4lHl2PM174vLWelWaCEf52Us4yNhKVse X/L3JpjfGARLxige6it5ykXuLaHSGjj4nKSgWywzwK9fw/0WcjXUdma9JO/foQPC2IX7 HfJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776443586; x=1777048386; 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=OZYzSmgJreVWUypCLvWA6sUD7qzkFl9KFowiKMZhy/4=; b=Nlw0wr1zYNYpmC5N/yIYyJTgU5ERmuN/IZx1FGWQccqCj1Pk5NC3ElibhESv8Qu+mQ 8wO5a2TnhzWxLSdB5IGV4cne/7mNullr/s5ETMSA0LXQ847QYKmBlNVKjRHEu0UzML0U MTwyF96zfZEfljScwo45IOBm7ouEpJK8kVugFYH6DImXuN6susgTF/E1MAiss8UnA22k FXHt2kKbHPU348Inds2dGLaU4pmEFqc6IKXL7jsFOhyytLNuxokkV6KoD20swUrEsonj JnCa/o52vKkl9yhjBVpdy6V9+bV0nU4zJ0YLi7JzO6lN/v4zNyFc34bHcJ+T2TbIri0R tdJQ== X-Gm-Message-State: AOJu0Yyk+V7alQ/3Vebl4TcEyu7h1iZVUzYYWi9PT5Kjmbkb97LDdKGB XqsNzYvSKxO8XXv4tvyP8Zy23tATiRaviKkOs+eWnZ5+J9nshdtDI3/4JNz8HSDC X-Gm-Gg: AeBDiesIdKZVUgy1m8sfZU3cvZNDLa+amWuWO8nwB+gpSJAqg5036GE2jm9CuU7daht uY97td+y5x2Y/slD8jp1yjtVWxwWaq/Y4+mBhS1Dm2V5kK8wJx2NwPgkKi2IEBilhNL8lb6T5cP NoHav6HvRpCbgZPrQAWT+T2WiBJWH6rF8En5g9eW6aLe60Cd1OE+r+Yo7XPRv6KVqs516vO2688 dSV3ddwrdAaQ+WSs02MgW2v22IMSdPWkXB9y/R9AylSSDMxYomvopwN+/oot4y8OYCOuP3il5Fj EPhHOdA6gOSOQG/FZfm8LQByIcN8a5bAbIX38tiEhB/wrYds8jgekvOVd1bL80ax+xGVJivO02b lVFhvgN8TrAIpV58nPmBwhawViMHny0D81rVPhptyOvDx9gx6N9y9i/aorSqZ7RmHuya4ZAZViP ZEJ+qNi1aGF8o5I1nuXOZ/FBhozg3ymx699r0psI9as3dXCs2hL4tJqa6sgQScPWqVapW7PA== X-Received: by 2002:a05:7022:11c:b0:128:d3de:c9e4 with SMTP id a92af1059eb24-12c73f9da5amr1468930c88.30.1776443586139; Fri, 17 Apr 2026 09:33:06 -0700 (PDT) Received: from TC-LAPTOP (23-93-157-142.fiber.dynamic.sonic.net. [23.93.157.142]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-12c749dc86bsm3603777c88.8.2026.04.17.09.33.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Apr 2026 09:33:05 -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 v3 3/5] platform/x86: int3472: tps68470: add board data for Dell Latitude 5285 Date: Fri, 17 Apr 2026 09:32:50 -0700 Message-ID: <20260417163252.15603-4-tchatard@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260417163252.15603-1-tchatard@gmail.com> References: <4ef5f305-0234-4193-a190-edbfe770ea04@kernel.org> <20260417163252.15603-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 Dell Latitude 5285 2-in-1 has two cameras connected through a TPS68470 PMIC/clock/GPIO hub: Front: OV5670 (ACPI INT3479) on I2C4 Back: OV8858 (ACPI INT3477) on I2C2, daisy-chained behind TPS68470 S_I2C port (controlled by reg 0x43 S_I2C_CTL) GPIO mapping (TPS68470): INT3479 (OV5670): GPIO3 = reset, GPIO4 = powerdown (both active-low) INT3477 (OV8858): GPIO9 = s_resetn, GPIO7 = s_enable (both active-low) GPIO9 and GPIO7 are the TPS68470 secondary-port GPIOs (SGPO reg 0x22 bits 2 and 0), not regular GPDO outputs. Regulator mapping: CORE -> dvdd / INT3477 ANA -> avdd / INT3477 VIO -> dovdd / INT3477 VSIO -> avdd / INT3479 and vsio / INT3477 (always_on: keeps S_I2C_CTL non-zero from boot so OV8858 is reachable on I2C2 at any time) AUX1 -> dvdd / INT3479 AUX2 -> dovdd / INT3479 Marking VSIO always_on ensures the TPS68470 S_I2C passthrough is active from the moment the PMIC driver probes, eliminating a timing dependency between TPS68470 and ov8858 probe ordering. A static clock consumer list is provided for both sensors (INT3477 and INT3479) to work around the broken ACPI _DEP on INT3479 described in the previous patch. Signed-off-by: Thierry Chatard --- .../x86/intel/int3472/tps68470_board_data.c | 176 ++++++++++++++++++ 1 file changed, 176 insertions(+) diff --git a/drivers/platform/x86/intel/int3472/tps68470_board_data.c b/drivers/platform/x86/intel/int3472/tps68470_board_data.c index 71357a036..c1bf13faf 100644 --- a/drivers/platform/x86/intel/int3472/tps68470_board_data.c +++ b/drivers/platform/x86/intel/int3472/tps68470_board_data.c @@ -287,6 +287,175 @@ static const struct int3472_tps68470_board_data dell_7212_tps68470_board_data = }, }; +/* Settings for Dell Latitude 5285 2-in-1 */ + +/* + * The BIOS leaves GNVS field C0TP at zero, which causes INT3479's _DEP to + * resolve to PCI0 instead of the INT3472 device. Provide a static clock + * consumer list so probe registers MCLK lookups for both sensors regardless + * of the broken _DEP traversal. + */ +static const struct tps68470_clk_consumer dell_5285_clk_consumers[] = { + { .consumer_dev_name = "i2c-INT3477:00" }, /* OV8858 rear camera */ + { .consumer_dev_name = "i2c-INT3479:00" }, /* OV5670 front camera */ +}; + +static struct regulator_consumer_supply dell_5285_int3477_ana_consumer_supplies[] = { + REGULATOR_SUPPLY("avdd", "i2c-INT3477:00"), +}; + +static struct regulator_consumer_supply dell_5285_int3477_core_consumer_supplies[] = { + REGULATOR_SUPPLY("dvdd", "i2c-INT3477:00"), +}; + +static struct regulator_consumer_supply dell_5285_int3477_vio_consumer_supplies[] = { + REGULATOR_SUPPLY("dovdd", "i2c-INT3477:00"), +}; + +static struct regulator_consumer_supply dell_5285_int3479_vsio_consumer_supplies[] = { + REGULATOR_SUPPLY("avdd", "i2c-INT3479:00"), + /* S_I2C_CTL: must be enabled for OV8858 I2C daisy-chain access */ + REGULATOR_SUPPLY("vsio", "i2c-INT3477:00"), +}; + +static struct regulator_consumer_supply dell_5285_int3479_aux1_consumer_supplies[] = { + REGULATOR_SUPPLY("dvdd", "i2c-INT3479:00"), +}; + +static struct regulator_consumer_supply dell_5285_int3479_aux2_consumer_supplies[] = { + REGULATOR_SUPPLY("dovdd", "i2c-INT3479:00"), +}; + +static const struct regulator_init_data dell_5285_tps68470_core_reg_init_data = { + .constraints = { + .min_uV = 1200000, + .max_uV = 1200000, + .apply_uV = 1, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = ARRAY_SIZE(dell_5285_int3477_core_consumer_supplies), + .consumer_supplies = dell_5285_int3477_core_consumer_supplies, +}; + +static const struct regulator_init_data dell_5285_tps68470_ana_reg_init_data = { + .constraints = { + .min_uV = 2815200, + .max_uV = 2815200, + .apply_uV = 1, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = ARRAY_SIZE(dell_5285_int3477_ana_consumer_supplies), + .consumer_supplies = dell_5285_int3477_ana_consumer_supplies, +}; + +static const struct regulator_init_data dell_5285_tps68470_vcm_reg_init_data = { + .constraints = { + .min_uV = 2815200, + .max_uV = 2815200, + .apply_uV = 1, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = 0, + .consumer_supplies = NULL, +}; + +static const struct regulator_init_data dell_5285_tps68470_vio_reg_init_data = { + .constraints = { + .min_uV = 1800600, + .max_uV = 1800600, + .apply_uV = 1, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = ARRAY_SIZE(dell_5285_int3477_vio_consumer_supplies), + .consumer_supplies = dell_5285_int3477_vio_consumer_supplies, +}; + +static const struct regulator_init_data dell_5285_tps68470_vsio_reg_init_data = { + .constraints = { + .min_uV = 1800600, + .max_uV = 1800600, + .apply_uV = 1, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + /* + * Keep S_I2C_CTL enabled from boot so OV8858 I2C daisy-chain + * is accessible before ov8858 driver probes. + */ + .always_on = 1, + }, + .num_consumer_supplies = ARRAY_SIZE(dell_5285_int3479_vsio_consumer_supplies), + .consumer_supplies = dell_5285_int3479_vsio_consumer_supplies, +}; + +static const struct regulator_init_data dell_5285_tps68470_aux1_reg_init_data = { + .constraints = { + .min_uV = 1213200, + .max_uV = 1213200, + .apply_uV = 1, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = ARRAY_SIZE(dell_5285_int3479_aux1_consumer_supplies), + .consumer_supplies = dell_5285_int3479_aux1_consumer_supplies, +}; + +static const struct regulator_init_data dell_5285_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(dell_5285_int3479_aux2_consumer_supplies), + .consumer_supplies = dell_5285_int3479_aux2_consumer_supplies, +}; + +static const struct tps68470_regulator_platform_data dell_5285_tps68470_pdata = { + .reg_init_data = { + [TPS68470_CORE] = &dell_5285_tps68470_core_reg_init_data, + [TPS68470_ANA] = &dell_5285_tps68470_ana_reg_init_data, + [TPS68470_VCM] = &dell_5285_tps68470_vcm_reg_init_data, + [TPS68470_VIO] = &dell_5285_tps68470_vio_reg_init_data, + [TPS68470_VSIO] = &dell_5285_tps68470_vsio_reg_init_data, + [TPS68470_AUX1] = &dell_5285_tps68470_aux1_reg_init_data, + [TPS68470_AUX2] = &dell_5285_tps68470_aux2_reg_init_data, + }, +}; + +static struct gpiod_lookup_table dell_5285_int3477_gpios = { + .dev_id = "i2c-INT3477:00", + .table = { + /* + * TPS68470 GPIO9 = s_resetn (secondary camera reset, active-low) + * TPS68470 GPIO7 = s_enable (secondary camera enable/powerdown) + * These logic outputs are specifically designed for secondary + * camera control on the TPS68470. Matches Surface Go pattern. + */ + GPIO_LOOKUP("tps68470-gpio", 9, "reset", GPIO_ACTIVE_LOW), + GPIO_LOOKUP("tps68470-gpio", 7, "powerdown", GPIO_ACTIVE_LOW), + { } + } +}; + +static struct gpiod_lookup_table dell_5285_int3479_gpios = { + .dev_id = "i2c-INT3479:00", + .table = { + GPIO_LOOKUP("tps68470-gpio", 3, "reset", GPIO_ACTIVE_LOW), + GPIO_LOOKUP("tps68470-gpio", 4, "powerdown", GPIO_ACTIVE_LOW), + { } + } +}; + +static const struct int3472_tps68470_board_data dell_5285_tps68470_board_data = { + .dev_name = "i2c-INT3472:05", + .tps68470_regulator_pdata = &dell_5285_tps68470_pdata, + .n_clk_consumers = ARRAY_SIZE(dell_5285_clk_consumers), + .clk_consumers = dell_5285_clk_consumers, + .n_gpiod_lookups = 2, + .tps68470_gpio_lookup_tables = { + &dell_5285_int3477_gpios, + &dell_5285_int3479_gpios, + }, +}; + static const struct dmi_system_id int3472_tps68470_board_data_table[] = { { .matches = { @@ -316,6 +485,13 @@ static const struct dmi_system_id int3472_tps68470_board_data_table[] = { }, .driver_data = (void *)&dell_7212_tps68470_board_data, }, + { + .matches = { + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Latitude 5285"), + }, + .driver_data = (void *)&dell_5285_tps68470_board_data, + }, { } }; -- 2.51.0