From patchwork Tue Sep 3 15:30:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3383 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 866B841742 for ; Tue, 3 Sep 2024 17:31:13 +0200 (CEST) Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-42bafca2438sf61934915e9.3 for ; Tue, 03 Sep 2024 08:31:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1725377473; cv=pass; d=google.com; s=arc-20240605; b=BXMk7L5/y+YQniWg6reOvgBsyXNg9L1MFsYrLOuUZ9bVWWIT2Lpc/8gw1nmyYQPMrn FMUpLHbSJq2oiqKZK6TNarTpRC/cUylmDjqiMgfCOZl1YDc61KjX8d2x5z1fWExboTlq vSC5pVX9XLGi/WK+kQP5BPEMmrJ1yOw2Dd0H5Sc7GnVCvMtnrIAF1a3urLN70aHQlahy QI2bBzyDRJft3i+UaXnrYDdE89nDKkpjkdMwF9h9PPPk2EiGbgtDB6vfg/v8fIeONR+c rInJkLjmpw54QLXQSfDfvpv3FjEVMCogbqQXmc5Qczs6ClZT2GeDQwuxR8JQRaBpg7Tc 9EpA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=qmTPwqBR9rbXKSBUWJhSJIri8cFmBf9EvddF4MLIYE4=; fh=4aU+nCD+MM28uM3kY6+Ijor+GRHD/VepEHAYZrRgyFU=; b=lP2NyeEP0POUC0XiJFot0isaU/wNEh7GIWw6mMiSsdgyusPkOUHlK1tvdoENpaok6S IQXqiknuKy2oD4y55RSTyvhk/oDs535McqYZ3KZGojcs+UZSW8gY0DZuAiBRhVHLAFw0 oVKiy25oUG3dEkOm17YvHHWC/UaRSH964kzmqM3FxOJSZUbBKgLCiiydNzuMJp0HaNmz KVEVf3PBpJg6zMDkb72e+kNlWq4K1Ra5Fkf1CiRowXfi9SuwIABPmHEEJyo1b/Z/dwMr zpMsy94obAmharx7ZJvCBFf8cX/qHvkMENYKpAYZG4LrR5X8+llGSS31iMiP0gXa25Sp FPaQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=l3Mhr3E3; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1725377473; x=1725982273; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=qmTPwqBR9rbXKSBUWJhSJIri8cFmBf9EvddF4MLIYE4=; b=D+Zu6oZ8JxP+yG3h9vG3IT8fKBAehyu0xjl46EXZpr6H016r7tzeD+T2/rHIDwhYFA 16N8D8RQB3f6/Dwmhs65mJDgAhHmcJ05m5xBeAYVx38B+/c4NEAqUw5Axp/mjWqiLORZ QKcGYZoPrRgdu4d+/5bg8lYRzeap+dKpMVzXM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725377473; x=1725982273; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qmTPwqBR9rbXKSBUWJhSJIri8cFmBf9EvddF4MLIYE4=; b=fmXHqARhLtoDUgTVBR7zm/OxWdk41MjHuZwJjA0LGP7wHbDyvzuTH0vWMAWLbIU7PP nLS4v9KSBPanpKjMaiSMAQDZx1gaQEWRcAMuw3gwvFdR3w8bMENgK3RVuX52OiFWgXWu N1EJn6hjOUwoDsCh94WJNhi6dUqKgTJu/ycmOBTqofTAwP/2nMHWZT7FexhWvRwL1W0o T6AxKJqDRDT41KHDeB1IECvMJnd33ZiX88lZL+dqxx3JF1Kt9ph4vC+Se48U0TIOpdNe lCOQ5mA7EYEIUc/+w2qLFNAguHSkiHPXR2mJSG+COdjP2dPal5hbbpm69DujKdovYpkX 4wiw== X-Forwarded-Encrypted: i=2; AJvYcCWtUemjef5cDnv7hxuEjf9Hjdt8vi/qmmyWWVA0qIM1dWIi9M03ZOghw+LkktBczzkCL3C/32/81MD0E4yW@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yx2lGsi2ERM51nQeg8pK6RRHWd/WM1TYkDdJ6DoKacW1ZWJXdg+ yjEKz/IgrWH2orVaVp4BTy3GxARcFDpCgh9NTuZU4Dq/V3ZNkTYtOgby1D1AEroRcA== X-Google-Smtp-Source: AGHT+IEZxuWnlfgaAwDHW0KnT6aSSWTyhItFKNbWFMBVQDISKa7d6CHX/aKUc5aJ4fL6GiFBNCWcng== X-Received: by 2002:a05:600c:1391:b0:426:6f87:65fc with SMTP id 5b1f17b1804b1-42bb01c19c0mr162661925e9.17.1725377473137; Tue, 03 Sep 2024 08:31:13 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:4506:b0:426:7318:c5a0 with SMTP id 5b1f17b1804b1-42bb2a0f33cls1306785e9.2.-pod-prod-05-eu; Tue, 03 Sep 2024 08:31:12 -0700 (PDT) X-Received: by 2002:a05:600c:a03:b0:426:5f09:cf53 with SMTP id 5b1f17b1804b1-42bb01b9c73mr177923765e9.15.1725377471659; Tue, 03 Sep 2024 08:31:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725377471; cv=none; d=google.com; s=arc-20160816; b=iGjFbDj02xrKPueaKa3VP3U8zANxUy6MIUxx9uiCCxsl+NVTf+xsu/0SB0vbmB8wbf FLtE8Hf/N+klvrqem5OUBuTVUw5JVKWZWd1R87EAoX0fj+K+0FK7If1G0+yvHg53UbyX N4MrkAL6TIyMT6m+2rF/4WyBF7se++kvUiDtEUEJNl3bN67Z6vVmxVfU3qPDI/WPkAnb QKPcL6xxQbuH/NaYqYHPxBPvt2tIKFBXXPhcRQxZ061YMjUJcylZXknaOyjBYyx8uZU4 HYSJnCxSlrZmElgo8S05wgOx5md9/MEnCzaA0x6v8CGcNrknejq9YS//7wZMl6ToJW5i BFRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=18UE/TjtsBSoQafY0oEo7+M0f8SVrTD2gpyVr8YhC8E=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=S4nFH0jZwMgQdK63lG7SHYTyw8yfpMyjmfKhsYGpy7vWEbYIqjsvAoDcYOF5Kna8OZ KXF90esRGV9zsxXCCzQ3mOqJWwlzapAlMCly8VhrcULZffSOST95Itqhu0QEY/WnoqB0 9Pjye+su4S/0LM3J9TvgZHEYltnFHslkgD6j7XksROsCulf9Sp4ojk1KGIPt+CwXfoKu 42m5Py1fnnrnSS3xa0gGZzzQ8pFyJ5VJjItaFESZOiHHANCFNHkAqZyhBeChrUQgEm+I Pa8A9BSaU94LcBEzSH7iFXyqb3nuVmEseF928+7MXs5RGZ+4PU7WP6i8LTHWLuCu4twf t/vw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=l3Mhr3E3; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id 5b1f17b1804b1-42bb705f8ccsor4098595e9.4.2024.09.03.08.31.11 for (Google Transport Security); Tue, 03 Sep 2024 08:31:11 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Received: by 2002:a05:600c:3b99:b0:426:62c5:4731 with SMTP id 5b1f17b1804b1-42bb01edd20mr159912115e9.29.1725377471064; Tue, 03 Sep 2024 08:31:11 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.42.65]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6e273e3sm174168685e9.30.2024.09.03.08.31.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Sep 2024 08:31:10 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH 11/29] video: bridge: Add check_timing interface Date: Tue, 3 Sep 2024 17:30:42 +0200 Message-ID: <20240903153100.918077-11-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> References: <20240903153100.918077-1-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=l3Mhr3E3; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Michael Trimarchi Add new interface check_timing to video bridge uclass. For bridge device who may update timing needs to implement the callback. So host device can sync the timing with the bridge. Signed-off-by: Ye Li Signed-off-by: Michael Trimarchi --- drivers/video/bridge/video-bridge-uclass.c | 10 ++++++++++ include/video_bridge.h | 20 ++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/drivers/video/bridge/video-bridge-uclass.c b/drivers/video/bridge/video-bridge-uclass.c index 2084a2e03ee8..7432107238cc 100644 --- a/drivers/video/bridge/video-bridge-uclass.c +++ b/drivers/video/bridge/video-bridge-uclass.c @@ -48,6 +48,16 @@ int video_bridge_check_attached(struct udevice *dev) return ops->check_attached(dev); } +int video_bridge_check_timing(struct udevice *dev, struct display_timing *timing) +{ + struct video_bridge_ops *ops = video_bridge_get_ops(dev); + + if (ops->check_timing) + return ops->check_timing(dev, timing); + + return 0; +} + int video_bridge_read_edid(struct udevice *dev, u8 *buf, int buf_size) { struct video_bridge_ops *ops = video_bridge_get_ops(dev); diff --git a/include/video_bridge.h b/include/video_bridge.h index 3b429eac578a..8b71b04a1119 100644 --- a/include/video_bridge.h +++ b/include/video_bridge.h @@ -44,6 +44,17 @@ struct video_bridge_ops { */ int (*check_attached)(struct udevice *dev); + /** + * check_timing() - check if the timing need update after the bridge device attached + * + * This method is optional - if not provided then return 0 + * + * @dev: Device to check + * @active: The timing to be checked and updated + * Return: 0 if OK, -ve on error + */ + int (*check_timing)(struct udevice *dev, struct display_timing *timing); + /** * set_backlight() - Set the backlight brightness * @@ -98,6 +109,15 @@ int video_bridge_set_active(struct udevice *dev, bool active); */ int video_bridge_check_attached(struct udevice *dev); +/** + * check_timing() - check if the timing need update after the bridge device attached + * + * @dev: Device to check + * @active: The timing to be checked and updated + * Return: 0 if OK, -ve on error + */ +int video_bridge_check_timing(struct udevice *dev, struct display_timing *timing); + /** * video_bridge_read_edid() - Read information from EDID *