From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.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 A43603191BA for ; Tue, 11 Aug 2026 05:02:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786424577; cv=none; b=EOy4nU7KDIWqtw29yydrkH4yJG5NTHLG3wyQao83Yzn+ZDQ4l59ApXdSFVk8iSXof43UaueqDj0w0m3CUYW0GtVskqAgCl6tpuGkiw80+ksLkVAMwTnATprlAcok13fphQAepX1kFG/ylBm/WPo9RCkinNZONv1Vjw0nLXYbKWQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786424577; c=relaxed/simple; bh=GfzBwg4ZHphT0HU4JIpIzgvGvublxLx3VU0uduAtHN8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PVTzvRjMh1mKBQOpa1E8h6sa2//mpw3CAAxkCi4zcsU1g+6neD2pcMi6RQIx64mvmsRuGzWQa71OP++QWb6Bk5FSt8zhAR20T0KAz4WwH93mQJAjPQYspqFpmxOR1SEwMXGw40vjIGgrFZ/RJDe1Bxe71cxjwFGkU04NfqqvhV0= 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=SINizHnq; arc=none smtp.client-ip=209.85.215.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="SINizHnq" Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-ca88130e09aso1883876a12.3 for ; Mon, 10 Aug 2026 22:02:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786424575; x=1787029375; 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:content-type; bh=/70XqHwKtpkb8Nem1mvPAp3age5VnZSIpQXUrCBp0Sw=; b=SINizHnqCGCjyEBUdA2HTT8VNbxB6jGkoPBjT1PkxzNvfoAEEWJ+EF440Pvjo9VdLC dOVcum7R+XjGAFnFDjGKkPSh7YMIhpclrH0J4YOZoqM5USz/Qr5M6M57AJZbThdo7LHN /IR0qIEUcuGSS9umTLdeex/Hhkj8Sx8yOjX295VvScNJxrF1KdRrWLLv6djCCFkM2psu m4o+XxgcKsusz5dZkl+JSqjikHyrEk/YdDmcKHpUNdGX2FbnoAHk86yPHtVBE+VC9YHT cmLW3kF02QFyaO2GqgCkdvJJkSB5sBan1LykDnxQr8sbKLgUgsGdeEc9NX5j7MX2OejW No3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786424575; x=1787029375; 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:content-type; bh=/70XqHwKtpkb8Nem1mvPAp3age5VnZSIpQXUrCBp0Sw=; b=Qeef+tTu7ugrM+DlhyJL/A/xXzYgplsmzKB1EK4qMF2NRoxB7Z23nw9uk74pmfDvSd JAB85RggVpaJDzgo1RTo/AkN5rRoEUAKpQNOVJu4obcjLoi7X8RAI/LS3FCie4gxvR3/ hnnYsFGB1hyvyHrTQ8qHjlap+1yKNZCcOUjy3bIyXZ8jzE5XiAa6OvNKky55l4qehfgH rjK2sR1twdkkUHFWuX5b8M1+yN9dqLMdJCoHMir9lEmw3si0G+8PEHeSseJoPSRt3F38 VjgjFokeUp+1bCxCx+JC75Wkl7dkXPtTBpMyKdxMxKgKVs6UEmyjTq2R7glrEJv9LkXm OlSA== X-Gm-Message-State: AOJu0YxU2YEZWQVXPEpSxi3/2hkPhcJAeQ5XWQA/qVBE6iXgOuD1cynh FpMTO0Md1uYxojGNJWA1ncU4A+4o8O659JtKgGjR9AWVirk0TF3UXO7Fl2jzp9ckG6k= X-Gm-Gg: AR+sD11OUhhIQo8b1CwT5NeiixilgkVIYuR6Wxr886qUrR1TfwJGQ9RFjYS3IoFIA6k omv3t8kIRJnk7rzE3Y4V0fN0DZyfsZBE/pygtxlV/nT3VEjGPr5ribHJkaXYonNmT6WbIxhJUwP iOGG3YRRRK8N2rcXUBvwAYXQ8BMQTfVxI+rw39VMw9IE77rmQcaAKT4K5yBnvwAKsRPFDEm3j+d PQhablxFFf19dqIJaT61WkUT9+54MOgRijWiP0IVa/cEGRIUDiH8+nqVUIBDcY/GRNQkmVHxFKT 0PM0v/nualtIW/YhRiYRZ0wi2NVAg/RyD5r8cOiMKmNQm2xKswjV7GTBub18L8cBYWItDFCpm+5 5FwkTTquPABqKWiZolv79N9C/eLTMkiZPmevwXuWDB5E5a228d4Anh5qPVbOLnDT8ZkTV/WBFlm AG3LMy2CcGOmYVkQd1Ov7lzJukoPBGU+24uRQk6QD7biNTByLpIopiqAp8LV85YoFWoN5mBOzPg +xRTpccxHIJN7qkV6d/WRKqxJmdH/rtZbhmEc52i891YtC0isLNzHhqJRzS X-Received: by 2002:a05:6a20:2d13:b0:3c4:397a:69ba with SMTP id adf61e73a8af0-3cc2bac423emr1261864637.28.1786424574951; Mon, 10 Aug 2026 22:02:54 -0700 (PDT) Received: from Mac.localdomain (198-27-228-154.fiber.dynamic.sonic.net. [198.27.228.154]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-31c619cf07dsm660421eec.4.2026.08.10.22.02.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 10 Aug 2026 22:02:54 -0700 (PDT) From: Ahmad Byagowi To: netdev@vger.kernel.org Cc: Lee Jones , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nam Tran , Kees Cook , "Gustavo A. R. Silva" , Peter Rosin , Andi Shyti , Richard Cochran , Vadim Fedorenko , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: [PATCH net-next v3 5/5] ptp: ocp: Add Time Card V9 I2C peripheral topology Date: Mon, 10 Aug 2026 22:02:44 -0700 Message-ID: <1931d6019cdaa80c681c38b6ff4d0359ec42230d.1786423898.git.ahmadexp@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Time Card V9 places a BME280 at 0x76, a BNO055 at 0x29, and an IS32FL3207 at 0x37 on PCA9546 channel 1. Describe GNSS1 and GNSS2 as RGB LEDs on outputs 0 through 5 and SMA1 through SMA4 on outputs 6 through 17. The board uses a 4.7 kohm RISET resistor, sequential red, green, and blue output wiring, and an 8100 uA per-output limit. Select this profile only for the exact fixed-width EEPROM ID "TIMECARD-V9". Earlier revisions expose the same I2C devices with different LED routing, so probing cannot distinguish them safely. Leave erased, malformed, and unknown board IDs unconfigured. Signed-off-by: Ahmad Byagowi --- drivers/ptp/ptp_ocp.c | 73 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 72 insertions(+), 1 deletion(-) diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c index f2c2979daaf1..a843198796ab 100644 --- a/drivers/ptp/ptp_ocp.c +++ b/drivers/ptp/ptp_ocp.c @@ -353,7 +353,7 @@ struct ptp_ocp_serial_port { #define OCP_I2C_MUX_CHANNELS 4 #define OCP_I2C_MAX_SENSOR_COUNT 5 -#define OCP_I2C_MAX_LED_COUNT 5 +#define OCP_I2C_MAX_LED_COUNT 6 #define OCP_I2C_MAX_LED_COMPONENT_COUNT (3 * OCP_I2C_MAX_LED_COUNT) #define OCP_I2C_MUX_NAME_LEN 32 #define OCP_I2C_MUX_COMPATIBLE "nxp,pca9546" @@ -613,9 +613,61 @@ static const struct ptp_ocp_led ptp_ocp_r4006_leds[] = { }, }; +static const struct ptp_ocp_i2c_device ptp_ocp_v9_sensors[] = { + { "pressure@76", "bosch,bme280", "bme280", 1, 0x76 }, + { "imu@29", "bosch,bno055", "bno055", 1, 0x29 }, +}; + +static const struct ptp_ocp_led ptp_ocp_v9_leds[] = { + { + .node_name = "multi-led@0", + .function = LED_FUNCTION_STATUS, + .function_enumerator = 1, + .has_function_enumerator = true, + .channel = { 0, 1, 2 }, + }, + { + .node_name = "multi-led@3", + .function = LED_FUNCTION_STATUS, + .function_enumerator = 2, + .has_function_enumerator = true, + .channel = { 3, 4, 5 }, + }, + { + .node_name = "multi-led@6", + .function = LED_FUNCTION_INDICATOR, + .function_enumerator = 1, + .has_function_enumerator = true, + .channel = { 6, 7, 8 }, + }, + { + .node_name = "multi-led@9", + .function = LED_FUNCTION_INDICATOR, + .function_enumerator = 2, + .has_function_enumerator = true, + .channel = { 9, 10, 11 }, + }, + { + .node_name = "multi-led@c", + .function = LED_FUNCTION_INDICATOR, + .function_enumerator = 3, + .has_function_enumerator = true, + .channel = { 12, 13, 14 }, + }, + { + .node_name = "multi-led@f", + .function = LED_FUNCTION_INDICATOR, + .function_enumerator = 4, + .has_function_enumerator = true, + .channel = { 15, 16, 17 }, + }, +}; + static_assert(ARRAY_SIZE(ptp_ocp_r4006_sensors) <= OCP_I2C_MAX_SENSOR_COUNT); static_assert(ARRAY_SIZE(ptp_ocp_r4006_leds) <= OCP_I2C_MAX_LED_COUNT); +static_assert(ARRAY_SIZE(ptp_ocp_v9_sensors) <= OCP_I2C_MAX_SENSOR_COUNT); +static_assert(ARRAY_SIZE(ptp_ocp_v9_leds) <= OCP_I2C_MAX_LED_COUNT); static const struct ptp_ocp_i2c_profile ptp_ocp_r4006_profile = { .name = "r4006", @@ -630,6 +682,19 @@ static const struct ptp_ocp_i2c_profile ptp_ocp_r4006_profile = { .led_max_microamp = 8150, }; +static const struct ptp_ocp_i2c_profile ptp_ocp_v9_profile = { + .name = "v9", + .sensors = ptp_ocp_v9_sensors, + .sensor_count = ARRAY_SIZE(ptp_ocp_v9_sensors), + .leds = ptp_ocp_v9_leds, + .led_count = ARRAY_SIZE(ptp_ocp_v9_leds), + .led_node_name = "led-controller@37", + .led_mux_channel = 1, + .led_address = 0x37, + .led_riset_ohms = 4700, + .led_max_microamp = 8100, +}; + #define bp_assign_entry(bp, res, val) ({ \ uintptr_t addr = (uintptr_t)(bp) + (res)->bp_offset; \ *(typeof(val) *)addr = val; \ @@ -2230,6 +2295,7 @@ static const struct ptp_ocp_i2c_profile * ptp_ocp_i2c_select_profile(struct ptp_ocp *bp) { static const char r4006_id[] = "R4006"; + static const char v9_id[] = "TIMECARD-V9"; size_t board_id_len; if (!ptp_ocp_has_eeprom_data(bp)) @@ -2242,6 +2308,11 @@ ptp_ocp_i2c_select_profile(struct ptp_ocp *bp) !memcmp(bp->board_id, r4006_id, sizeof(r4006_id) - 1)) return &ptp_ocp_r4006_profile; + /* Older revisions share V9's I2C devices but not its LED wiring. */ + if (board_id_len == sizeof(v9_id) - 1 && + !memcmp(bp->board_id, v9_id, sizeof(v9_id) - 1)) + return &ptp_ocp_v9_profile; + return NULL; } -- 2.50.1 (Apple Git-155)