From patchwork Sat Jul 13 08:45:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 3221 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 2392D40F45 for ; Sat, 13 Jul 2024 10:45:59 +0200 (CEST) Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-58c38bcd765sf2276715a12.1 for ; Sat, 13 Jul 2024 01:45:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1720860359; cv=pass; d=google.com; s=arc-20160816; b=mKFAUdlbYDKJqeyKxNP/3qVuQQ+lBWcFYKdg0cUpfHuKiAEnTKXgD20a3oo6mMwidL RLU+eVBOBhaGlGMvN5AyCdREIXy+LTZJhQ80gIC7IAZ+qvJH194r7VoaOdU/6kBU2/V0 8sKgJw8/3OrjxyWmqziXAIbHy+TolzJY2R3VBrF6t/tUW3Xh2h/eLawDfXZgbheeYMxl zsBy4zoKt43bCuhVJsaVUEc0rAcj7gCto3PTyrkgqUb0bIQo6hOZpv8cVmO7v75ajMUt ljSbD/e+9C5j2XeSnIrxcMl8I4gsH05p5Lsdj6pePxj053Z3j7IgSH8ZMMdinmZwNuGf EFBQ== 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=js7IXGd3JW3wA7xkqNx7VnfTouOTSv4JcHfpH9MVRcw=; b=ZTFi11U9b9E+ypmPTuU7AJhSNGmRC3rJyqFhd1MYscCjMLVFMe5Rqvt5rW2HA4QYnY evvhp+iyZCVZvzGFbWOSPzW049ct4WMQ79Zn7VS/9uo454a7Nf/vD37EHOPQXVE0tu6g EP0zqE5tFeKmzBnuIYsvN1Sd0Os7xerP9IVZwYpvaNV1QLbBCQv0OsVdY7DVYwRA1aPR Rof+zUHt7t8ew+UhuXBkg/hiWaQ9KW1Rqgrw4RmS13SATPgwCaGY+R4pp25IXEyd47eM pxxysfgSJ7cdxGhWXPNO5pCGfT/WcjY9PCtZ7XD0XsDn6cEWntOIt0ZTYn+sv7uFfP0p Oq3Q==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=BuIYNrAI; 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=1720860359; x=1721465159; 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=LDvyLyFOn7FRvkNv4A0QtFGSxMENKFJRFWtAJOUscz0A+/5uYQS/5sKmVahoJwhQJr LFyeI2gK7Oq2TjOU4iOPrsbCRXrbNVJjyEQyqhBx51dV/yFEZaknJQuCbEwpJPbbblTk FbZiVxq0XOb7GO8xtEVJNtypjYL8gfwnIILi8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720860359; x=1721465159; 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=bsjhCgIXhlkc3IlfmY7wi09O8ASb0kyIs5FCTBid0FMY/QJTl8h1PDgFBRhpYen07/ EqrkQ1ltXFvY9vyNiqkGXK6sr7/NOBfSN4X1qPKiiOBM4nuhCPTJZ36ia+O9/3+PepIX vk4dJYwaGmzuAAZny1Nwh+k23uqD+7w4C5u00hjbYJF92iyr5weohP/wxFX1j4Sk0h8t 6WrZRlb+2tgGFYYXDeisW+BMMdAB6og/Ar2CNllvQ5/eBQJkMqATfpUuC9G35JBEm7pg E9hWnI/Gm7nHoevzMyWzwBUCVGT7WaNk7NaQVNGf+c2RZ3HUaYPLAziS3fRmebYrH0hc tHWA== X-Forwarded-Encrypted: i=2; AJvYcCW53LvDxdl7Eu3C8xQkS+lHPJsJsZh57aDmcEAN7eQl+rvvC24EvwJMSvGrqpKnysv+dYmIs26HHSORR6yfjSrCrBD8yY9oP4DblEzLReuoTcJ8FtOSFwgOmJK+1w== X-Gm-Message-State: AOJu0YzUybsyHe6Jz+QgCHmtKaTanCJrlVBXpfWZeT4p3qYoCLF8RPGc G24BsC45uNdU3a+HMoNlYLxuWt7NMNYit5p7lBxmCB1zBkQsyyGB2lgodi4+RRCgtg== X-Google-Smtp-Source: AGHT+IH3sZd/qY8ou+jNhk94pn+6sufuI1/yrlT5itamPxqGCXw6q4Cp/1nxyggK1Ppcp0Kq1kciGg== X-Received: by 2002:a05:6402:231a:b0:58d:c542:2500 with SMTP id 4fb4d7f45d1cf-594baf87753mr7201126a12.10.1720860358778; Sat, 13 Jul 2024 01:45:58 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:48f:b0:58b:4780:bb2f with SMTP id 4fb4d7f45d1cf-59826710febls1371326a12.2.-pod-prod-02-eu; Sat, 13 Jul 2024 01:45:57 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXGDmwaOpkdWrFhY0VZ3BAajSvH5pxhdGpw7lcVOu7NWwdOAF3wffwqp4LF7qlGNxhwtkPLmXaiXP7zaZHGFmxGzRddfwkzVndKysGC/0uPba0O X-Received: by 2002:a17:906:6895:b0:a6f:718f:39b6 with SMTP id a640c23a62f3a-a780b6b1818mr854890466b.25.1720860357088; Sat, 13 Jul 2024 01:45:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720860357; cv=none; d=google.com; s=arc-20160816; b=W3f7NxjDGQ6M0pY1bwsGuAZAKD7ZC7jm+QXEM/Rp/1EqCc+oerCJR7vzLeKzU0x0vX qX2h9llNuY2ZPypriVBLyJ38LXL+ojjZZW3Z8qDn2LUdbWNIcbKy4gnPxHq3qycv8XO0 t+N3KSAUGNWFk/pB0w904kXCsm23YcDaaKB1FrXIjYQ/rkLWvJmap2qzS3UH4lvXyeFV aqwmtRz78GDRip9q0hj1SbsH4uQeXSMUYxkKL00umtao6jSRMwaKTDPS5iOGvHuA4KCY WwL9UXEL9HaP2gVzsQQBVvZNiWKnO1pJ+WhTUhrW+8JU2328mYbuwSRC+Jx5Re+WVw6d aqAQ== 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=T0eakuPA9/1C/gYLfl/OKloPLpkEw41bA0DsBXHV9bo=; b=jLrttqJQsRTMu3XGU1BRVo4YPsIE6HkWMxbM8XP3wGgXKTYvmkHkGH0MrPvMOXla2y CIhPY4dc6cUarhXDXIhKRVa/BaI5sLC2t6OgbW+OPbvZr2PybFUoEgxXLdwczBRbUtKb SM/doRXGLyZEXQrKRnKhp83aLCSH7X/P8Lr3AdLLw24lxy1CFNrbl1EwylVjqBAQa9pU XkUoxImCH+GWHhK1V7RGWjid3ubE4Nzzcnu7l0f6qmoEtPs603iW8Wt9VHNeYxGMPKuv T1YmhbK+x3E+dxhC5NIyrmsGj9mMZsEYtXzIjd8weQLyytiAXi9CDaPj+B3VSc3mriaF av7g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=BuIYNrAI; 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-a79bc950436sor14164266b.13.2024.07.13.01.45.57 for (Google Transport Security); Sat, 13 Jul 2024 01:45:57 -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; AJvYcCXHeQE3qboPg8tx6N4bU/vBe+A/cCH67vV5ar3rsm5nIGd+tgi0cuRsfUNaIOr9LW4cDVz6hailSVFtp1/r8UGZOC4iLgB+DuebkbI0j9CgYWR2 X-Received: by 2002:a17:906:4a54:b0:a77:f2c5:84bf with SMTP id a640c23a62f3a-a780b6881ecmr822211366b.2.1720860355619; Sat, 13 Jul 2024 01:45:55 -0700 (PDT) Received: from panicking.amarulasolutions.com (93-35-128-17.ip55.fastwebnet.it. [93.35.128.17]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a79bc7f1e20sm31483966b.116.2024.07.13.01.45.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jul 2024 01:45:55 -0700 (PDT) From: Michael Trimarchi To: Michael Trimarchi Cc: Dario Binacchi , Patrick Barsanti , linux-amarula@amarulasolutions.com, Ye Li Subject: [PATCH 15/21] video: bridge: Add check_timing interface Date: Sat, 13 Jul 2024 10:45:20 +0200 Message-ID: <20240713084526.922537-15-michael@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240713084526.922537-1-michael@amarulasolutions.com> References: <20240713084526.922537-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=BuIYNrAI; 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 *