From patchwork Sun Jul 14 07:10:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 3246 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 5406B4130C for ; Sun, 14 Jul 2024 09:10:48 +0200 (CEST) Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-5998e08a7e4sf1795590a12.0 for ; Sun, 14 Jul 2024 00:10:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1720941048; cv=pass; d=google.com; s=arc-20160816; b=eAxds+vyJ3ajLjsHSYUd8ARlR2Er5LpUvvtlra9Ta+gkA4N9oqN+pGX/7AMBITMbj4 R9qr6pEj80gxCDRRBj5fZhoTTikShHIGKIsJTbRRBolMGeTTnvtgYq92fUpytyYPb2Wk D8Lc4gDR48yzohxdOAYpW1NdPjyP177qvRcCz2vINZxoa09jTTvNH14e9p/ggoBczGHx 8jkufZFoRCva9SQRRzcio8nPYX4i3ouBOhWRyekJhqCOvdfRlvC8zOTzQWd1ehMIRuvi vA7DNrmNK/FdydIvcRIUMv0GxyEeH07QQQRq538eg4s97gXEe4LUl81wS23vSTi91I+/ nOag== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=MRXg1fUr7XdBl6XUJ6jNsXS8plF3TvfQ6XYHmhnROGg=; fh=dsH41V6NlfsziaTSy1WXHMNNv3h3uvdScHk3k+0kovU=; b=DTgiQJqKoa5gKb2USA93robirkooa8m68bcjmLsMlfxPu4dqekfcxO2KGLkIfDQywe qIU5x40XAFVp7fw96jq9OFlXHDa0DOXKEdIbKttLuiFIBtDtzBkLz4PbUi+2RYh3rZHM qeiYNG2zCFilCaoxhzIz83MI+y3sK+QnOrNwH2sxVsZdpd9C36CogL0gUOEmPQ1ZMNo5 caAb53JCkJQYmj+0+1nAOJ+MLFyeBucxfqvf9SwBlBFpd6JBvLwOalh3V6GpR1YnofK/ Mz3mYJOFee4t1qFbiZVkhCyZDQKpCDWuqteEWtdPkK7KuzpH/c1P4BG2h7JbdAGd/0r5 uSQg==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nw6qteQM; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@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=1720941048; x=1721545848; 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:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=MRXg1fUr7XdBl6XUJ6jNsXS8plF3TvfQ6XYHmhnROGg=; b=MNJSdRqEVXhIyITSeSN65Uo7W6EJ7ybc4lasuBb55L4D7nUnYyQdOipoppT6RpwlcY X58QjFAuEuj6zwOEl+uTPDt8H976ku6xLvrg5AJb1VLhs+or6fHz/T82jtxImyPobhQg g13srf+oIWFXWL0q9SLxxY7PvDLL1R/aMrwHU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720941048; x=1721545848; 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:cc:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MRXg1fUr7XdBl6XUJ6jNsXS8plF3TvfQ6XYHmhnROGg=; b=wdiyCvXH5Gh2uMuBMaVaj6sD987v6wCMg21QtKRrlTeOk0x7ED+pkwufOq8h6IrfhX M6vgMzqIEmFjiAUc5yzoGEqq7p+eXYZkRFZMh9LvvOMgjSPZgtVzPY8nBfomik7jtK1O NZ/v8LkAnj/WHuifMRVqg+ZEG0m2CbpfG2wB9GOKlr9jIsLkeBfamxhTm4VPi/qriXif n/MPqplW5uYnheaE4OXcFrYz4anDvlJb9Bdn/TbSrQ4+HS4A9kIbqXrCeIfyGAzszO5R YxYPLlmXCyKsVojzkxVzokzM37mABI6w7Ip3cpjCBmAASIFkhQBEx1iWijsDjJdcOqCb gV7A== X-Forwarded-Encrypted: i=2; AJvYcCUD+hSRj1C6932gBRxx03ok9yJocMrqlgkSkKBIfvACG+nrDgPFJwJsJN1dbTccirsGCaUgZvI+Ko/hN1CJEx3u52942+NBsyB2CAJi/ibWT9ZEaR9uq/trctN0QQ== X-Gm-Message-State: AOJu0Yx8im8PaoGFjITpbogS8+5gdPOdR78F7h8o0db9JTMxvUB8zw/X X1PO/ZF4RY/x7BgKn6uWLvUlKaIE6s8VeFVxsj5osOXKCNQ9ri1PzG0VkrHCYRK63g== X-Google-Smtp-Source: AGHT+IGZWfxYMKeJghybkzUBQ9zXfOabXIJ5PQUsdzp9ii//Y+Z0U6s6VB11TyIi183m+CHa1YGk7A== X-Received: by 2002:a05:6402:11cd:b0:57d:2db9:15e7 with SMTP id 4fb4d7f45d1cf-594baf917e8mr14682302a12.12.1720941048038; Sun, 14 Jul 2024 00:10:48 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:5249:b0:599:9c73:c38b with SMTP id 4fb4d7f45d1cf-5999c73c444ls979361a12.2.-pod-prod-08-eu; Sun, 14 Jul 2024 00:10:46 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXciXCWWxydqvwTCp/nxEl+LpzaG0e8i7gMKzM8PXTgljozg4e6oIlB5qObEQAsDAFywm3dNwNOMZHG9VCuOSDVaD5Az4BgSYNWHaa/95Af6Dex X-Received: by 2002:a17:906:1388:b0:a77:c4f6:9f9b with SMTP id a640c23a62f3a-a780b6b194cmr1149169966b.26.1720941046396; Sun, 14 Jul 2024 00:10:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720941046; cv=none; d=google.com; s=arc-20160816; b=VELRTiN4QQ2mUf/y44gDmLnu7/uyZjURhJLGoLyMurMYI/H+ntdhz++tZUGEIPH+9P iCuXqOdjkk2ths8avhhvZONlIVYrB2SVvruqDsN6n5aNbri/ZopBt+91cSVTSAPJvZgC h7IONrqaV7cUs6eUcpxp5/fp2MfyzV54Y71/q8cmwP7k9QILb7TJ5gxPJprFi4DSWDuk U3QFAs/GEy/fntGwXCfhDgHPCg2xLxh0Z/VRPP9MCFF7QzGzAdIIDZL3rjO3wijPnS+1 A4Pj3znvkfEti1UglRYSwoepzIX3ZZXC7B8fSfSk52Id7mD1qvjVHlFMzbUi7Bruf+IT UL5g== 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:cc:to:from:dkim-signature; bh=TTOWBx8DMPu8LybIgtKiJrsWkTkUWek75Fh0Xk6RnBA=; fh=X12b0e+cwvhWNuQ7Goyxjsst9LUXKmeDiAgTrzqdflk=; b=V5L+YhIpjMoZq8IKNOuVy3xbQ42WUFGoCf8+1QhhShULqwp1fqRCkTslVRLVDltCfS O8TIp2Gx8JZgK1kLtDDUubQGvWY/rMVvOxTZzy6HGbvTxivY3FQ56zCoPBxjVGzBaK4q u/Ke9q2ZbKgEG3BCPLPV3a2i90v+HilWiOALBU3M1eIWSu/98spnYGRWN3IibKZfrO4K /nq8RCZghg465+1jDKxeBTSEGwxr0LEaZ+N6qwMN8Nwa6jjzZlr2TwnBkOGaEVPKLOh5 ZAVGs8d5Dgsvjpz1oXS/dkRHaREuxn3SnRqlVMw2irwUQv9hkcrlfRMJvU46roQECJY8 CjHw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nw6qteQM; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@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 a640c23a62f3a-a79bc7f6218sor52415366b.20.2024.07.14.00.10.46 for (Google Transport Security); Sun, 14 Jul 2024 00:10:46 -0700 (PDT) Received-SPF: pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Forwarded-Encrypted: i=1; AJvYcCWbpc7zEQpz8CnDHGkN/YvMm6CXvYxV4iv7BDKvXt0nt2/Ov19YzKtQpylzr5k9E0yhlA8cTeEbbFt9BvtdeqnpiO8kBF5G0Sn0nLHB7mwK5Gbu X-Received: by 2002:a17:906:66da:b0:a6f:58a6:fed8 with SMTP id a640c23a62f3a-a780b6b2029mr1044077066b.28.1720941045980; Sun, 14 Jul 2024 00:10:45 -0700 (PDT) Received: from panicking.. (93-35-128-17.ip55.fastwebnet.it. [93.35.128.17]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a79bc820d52sm104950266b.214.2024.07.14.00.10.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jul 2024 00:10:45 -0700 (PDT) From: Michael Trimarchi To: Michael Trimarchi Cc: Dario Binacchi , Patrick Barsanti , linux-amarula@amarulasolutions.com Subject: [PATCH 15/25] video: bridge: Add check_timing interface Date: Sun, 14 Jul 2024 09:10:13 +0200 Message-ID: <20240714071023.10417-15-michael@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240714071023.10417-1-michael@amarulasolutions.com> References: <20240714071023.10417-1-michael@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: michael@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=nw6qteQM; spf=pass (google.com: domain of michael@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=michael@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: , 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 2084a2e03e..7432107238 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 3b429eac57..8b71b04a11 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 *