From patchwork Sun Jul 14 10:53:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 3272 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 E06AC412C7 for ; Sun, 14 Jul 2024 12:53:52 +0200 (CEST) Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-59980727364sf2005632a12.3 for ; Sun, 14 Jul 2024 03:53:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1720954432; cv=pass; d=google.com; s=arc-20160816; b=YQKqH1D6o/v92DfPw/f8/m80pz21O7OK7Ut/rrOpWboxaiqNTkzeAoUy7DoltKxItQ 2bImWqFL8SHDr7HgdLD5t7U4ZdlIY96dSuczi4o5AmjThcPZzkzk4W6jsFJglA/ltvCx KCaIMf5zG1QP4F4rBzgzS9Vobpn8K8h2pFRFzR9UGCuNAJiEn+5Yw1d6pve/ZZ8d7WLZ Tgtl7h/n8jad9GUrbPblhwuFx+Go/ABH92ItW9Xh888cp7ngaUxiOZ4C1yhxePiJ/EIb CNg23qLpxHLXtPI2MnXAQfafSvTy7Q8+hfZTKj6VwUDvvykmsFscDHs4V1kULWOGccil q6fw== 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=JldH8uILYkCjO2dg/MPj8UToyaA8od5AGTKxaBgglkE=; b=zBerSNSpHLpOVfozaCm7fO9aKszmuBZ0YeJExPpqe78JP4F4XHPynweLCCzQll4Wrb F1YbvbPfDFi2NVJMoazQwXcwn5WESNuu8CtdwvcgipRATuaRzDGPmfcCaFlJOxguYDzX hF/nqniuWQh3NvLbgaCUI6dVw/zXVv5U5Zkx4LUDw7/o+0j6ZGIjuHtYOGaBNzB209ws OUAEKcGo/ZQkmQcNZAhTtDXGWYENX3Tq4L4WfnN0ZLTGRVh4DhHcODxzObcucEAEcWGU kIqf9POB1MwgtOqUCfPMM3SRAFldMbzlmVDRgxq0aZacde0TzJKw/WLvYkzpEitcpBQZ gUhA==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=maV41oE5; 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=1720954432; x=1721559232; 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=GOyaemLdEInPQj/k6kpBsYRiwNwah+gGue6tuQWSPzP9yxmbdis8M4Fc3CMcakY0Jy Tgo43j5cXr/YyQoRorDRy/HqC5G8PVSzbb3rZXjZx++vscPqtrx9Y2+Itc678QV1tdTx AC80P5nT41PwmeStCnkXRBLMJnvuvV7aSt7Vk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720954432; x=1721559232; 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=bVGUGLG/FglZUcvDhUJdxf8QaWfUL+rIVtDl3TsjPv3VHEBJcDlFwIQGXcJnElLIWO juCiQRRmu7tQ/SXR8wvvex0XjbcYOgX2RLUFF3YGHSqeXDOT7qbuSJNWQJglsltHIg4z H8qT2FvqJ9jtExZkbciG3jncBiYwOHsU/vD/+23N6UlkJ5YUIf/OLg48D7cfjGeBrGfI oDP9QldezVkTQiC4Fo+WH/UULa6KlMz4vEYmziUehlg+OETFKXAswOBb6ot/YFi3zB0U mTLCtcChPcOi9bQdWscOiRwW9ijPqeC3WGkYj2oJsXDLRg2YYVcW5546HcgvIpl7cYNl +q+Q== X-Forwarded-Encrypted: i=2; AJvYcCXEFBtrUpKMweDJ0TM8fL8QCr4q7ap/T3h6cNto43Bq5diftYseNm2OLxUrEgk2O2QmwrXulrEQuEemf0IlQKsujlH9W0Q2IZPY1YJwbjnhVai4rr/Ov/eBz1SDNA== X-Gm-Message-State: AOJu0YyQZ3ZZ/f465zk5E2gAeAdP/yxzwNY+FXV3ke5sWsyAkaTrUKG2 T1Jj5vLHR4BwFprAa5Bw9T+62EqKE1WFP4NVniy3VVBOLXgyxCoL+9waMqHhZJ0mBw== X-Google-Smtp-Source: AGHT+IGgwRfE2tezbAVPRBD+h0DVlIFCrxRMEBmXPqFtiNC8w6FxWJsQ05TCTCY81MtY86V9y1meyg== X-Received: by 2002:a05:6402:40cf:b0:58f:4420:8167 with SMTP id 4fb4d7f45d1cf-594baf87996mr12449587a12.14.1720954432667; Sun, 14 Jul 2024 03:53:52 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:4309:b0:599:9a12:f5cc with SMTP id 4fb4d7f45d1cf-5999a12f8e2ls988303a12.1.-pod-prod-06-eu; Sun, 14 Jul 2024 03:53:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVKyA92TyLuf1DvSlVErBZJGuXCMjcnsedaOLNabbB3obywQs9xyK8p3WIP0zZ8+I6RwO/guVb+S1On8EskYrW9J8LIy21SZhZyFDJhUOlEJb53 X-Received: by 2002:a17:906:f189:b0:a77:cca9:b216 with SMTP id a640c23a62f3a-a780b6fd816mr1044592266b.33.1720954431103; Sun, 14 Jul 2024 03:53:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720954431; cv=none; d=google.com; s=arc-20160816; b=OjbltOsLEyr8am3qWHWvxW4HhI+ZB0BXfSkE4w3zkBWj8x8j4bSo4LIstyeITfAchH qJWwvMJHZu/K54iKL5ElUgxkSYsW//Y/N07NEBOdn5LI8rdF2rGVcMB+iYW4J3hvewLa c8et9yU3GyqspNRk8DT9QeVzm1GNG5CYMw2hBuLX/Zmwwb1wq7zOGVL3SW2qqYz4Lm7e lKgbgQcKg1OO9rMVIldBF/DKgKxgaf/kApaps1e+kvdw5l7kh/UDgWRrDZ8lJix4sW8c +Gu87sfiWq3ixt/c6vuDn6FuVRuMSP/M0Lk9h0LSLMm4S75mVJ1Qo0zgDnDepSLJIEM1 7/AQ== 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=t185EEbZPOBft5AenbtIrteyecWFCMqDfm2+GQYe+zA=; b=xG+YNKl2p0TlxmKzkeFwRepMqX5qU9ZM8R8RqtaASHbJeMaDhP8ZMji5dz+ksRPglq nZFy8KVlFR1jv9WfBsFKC/UJwaLfaKkkBrJviIbCQAHH9iZMtth6Zwsl+wWiwXdIS3Lu LlOdA7RC18h7GuPjgpV1uQWyUrfqGeWynitEklsQP96Jzm0OrP6SylE3mdZ45Eo9/Yi4 ObawGZjWorT+wWvMUFhmBe0zjzkqKrbZQCs2UfvCynYjh62JvNmAL/Bt4GstVEqgwHc+ WoDU8uDG6dEq8rmBnSgnQ4UHoRlVbxoP7o3nSvftKrqzkVsKEkO8uzkgQKK+aRgCWrE/ Pz2A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=maV41oE5; 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-a79bc56f591sor26764566b.3.2024.07.14.03.53.51 for (Google Transport Security); Sun, 14 Jul 2024 03:53:51 -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; AJvYcCW7hFyQe0F9T4+ITJSRm8LHbWoRpToYoGGYd3nOKmpJxu0vPVlZdcPpDa6NmJH2Vowe0I+sXGdZBv5LUhjKjtX3enOZY8p/9ln6E1lyYjQB9xVi X-Received: by 2002:a17:907:7759:b0:a77:c364:c4f1 with SMTP id a640c23a62f3a-a780b705189mr1020960666b.46.1720954430684; Sun, 14 Jul 2024 03:53:50 -0700 (PDT) Received: from panicking.. (mob-5-91-58-211.net.vodafone.it. [5.91.58.211]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a79bc5a36c7sm119966166b.7.2024.07.14.03.53.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jul 2024 03:53:50 -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 12:53:18 +0200 Message-ID: <20240714105328.35825-15-michael@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240714105328.35825-1-michael@amarulasolutions.com> References: <20240714105328.35825-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=maV41oE5; 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 *