From patchwork Sun Jul 14 11:32:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Trimarchi X-Patchwork-Id: 3297 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id F357E4130C for ; Sun, 14 Jul 2024 13:33:24 +0200 (CEST) Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-58e847f01f7sf2946218a12.1 for ; Sun, 14 Jul 2024 04:33:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1720956804; cv=pass; d=google.com; s=arc-20160816; b=CrFLpj1+3CAadGzrLhtLgUEg/Z53Rwisy72+W1oJayFX8tMfU4y+Td2VK2R7V02eaD K2QlKbT4nXUX2vsSuu+B6okyD94B/w6+0P5ySxd1CeYA4KFKYfF8I8SuI/H2BHCPII21 53vQoihSXX8P0xc8fEh+5a9YQ58RalAJ25/s/ooi6kJ8rht4jRUwTZcXseArrZALdlWw VJiOo6p+pkvMk21wUgMmiEzBXZu00IT6nc/ORVEsaFerqEiYgm4pjU3HWA/+Dah/kchI 3Foga89B74f1AFQS2sJaRaq6oeje/1hqRCOKNBR5rS82abR7UaCBPm+Y+un+mfMyWgWS kkZw== 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=SaYhItvPcTtdaCpNhQUgRDe2oYdwJsNbjuOoG11fKn0=; b=sayZLtW05KyngVDda/FfRzJ+bpThtH47QXAk26Rnsg/OlxzRoXKPoPU1DHwUC6crWD YHCSgF/UnRI0NSwX8BZHYanStamWRQ75imcmB+ewjFvbtMRSN7R6CXgxe6yUWu7LG8eo co4DwE7QkNbl0g48C1de/x/ITSgH3Pfz0Z7BdOVjABURhItKdCo31gL+oToKNAjyI/QL yNqj/znlNcP0nDidFjy7aj7xtqcsjxN3gKNRZ0RsF91hAAC4DwBEZ/BoEWNkZiI9rPE6 A6U5Tsl93pXLNqUSnllxzww2kp5qJ2nPopbWAPoT5KSyGTCzKHx99TZjw0XBhx+wtHBr amXA==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=iYQns8tN; 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=1720956804; x=1721561604; 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=Xs9gNAzC+1ejFA+ulPXjB3jA7UbRkK88f4LzK9yM2SWhxHyApUREy6SNbzGXHnqUW1 KA8bUDBz8c+6aGm921lS4PtKjI0P0ORk3gFZYHkzFQrEd/Bj+nvQRNLtthoK8zF0F7WP QNvKqbCEs2XsFfo0BAvRHf+D529S9bjoEln3Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720956804; x=1721561604; 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=LtwoWHv3F0vmo3FgdI5rr4HAvHDoCGg8spsNeuMYMLa/snxjc0na3J51BpHHRZHUxl YNJxFZxbIXI68ZOOd1jdHRtZybCN178LYSFWVbwax/fUlgCw4ScE7QUpg2Q+eCyIA3Kz skbom1jWfz4kimJvPqwL4+uFxA3l1od8iU4QLeukuh6kW5evU4GafqpHhV0oZ2/CeIvJ 1bPCU7+eav6U4fndi2Ls/d4fZK0AYil/cq9L6+oNVdqvtVLnSB+8FJDmjImA9R2jBfN1 CjG9f2F8RGcLRqdbEgFjwhsjVT7PkAvPLU5l7Xty83cETfZqqXQAr/eVOd6uxEbYwzKj hHkw== X-Forwarded-Encrypted: i=2; AJvYcCUZFGl0hjc5J1zr6Q2R4a5hchlgE2/jWWU4eCichEZGPGFWltGfGHYaScARZv0OUMcn05PZhrYyapSO8vwVUOIGdbgoVTo2mJryikL2PyPe/hlDpw/E28Kjmez9aA== X-Gm-Message-State: AOJu0Yy9SBEkvCcuFtJKgZxVGnTkw1LGJerMhE5nwHpBrPVg9WFdA2OR Xid8Jk19QoMxoUTLz0gBwNrTxXZTX6tD+OifeHCSpsjYWNbjqArpqp2C36TwCa1jMw== X-Google-Smtp-Source: AGHT+IHMcpa24dYhNu3xEm5+LWzi42QpzNS5sggi58k60t//3IqMlQm8db470zItptNi/86iK2UXvA== X-Received: by 2002:a05:6402:4408:b0:58c:ccc1:17ec with SMTP id 4fb4d7f45d1cf-594baf9110amr13201993a12.13.1720956804707; Sun, 14 Jul 2024 04:33:24 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:2022:b0:58b:fffc:bc33 with SMTP id 4fb4d7f45d1cf-5982622b6cdls1642165a12.1.-pod-prod-04-eu; Sun, 14 Jul 2024 04:33:23 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUivZC4rJzt8+u+SHdOnf+dzBJsBv3eynEugzCEFI+XoIiQkrQBUFsGFUoEIYjvov+0hyxDrB12j5W+3YJADdSK/S4ZxeJGltcfVHDEpQh59WvN X-Received: by 2002:a05:6402:4408:b0:58c:ccc1:17ec with SMTP id 4fb4d7f45d1cf-594baf9110amr13201954a12.13.1720956802976; Sun, 14 Jul 2024 04:33:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1720956802; cv=none; d=google.com; s=arc-20160816; b=MeQ19DOsvh3M21fE7/fdeEVI+6399xRs+XHJpceLhqaVqeCwsHD0pPsc5mLN0xQGd9 Ojbg2ZcnARx5LL9ZhmvNYYQb0HGu/83LCF5+FUnCj71j2JMM4irrF6pU7MG7q81Ck/Mz 9kh65keN92a0eyrBUqTEfArt/i70Pw8x8OR4Rk0FWLJojVyEsDAXU6PgrEJoKYLZDYRp GXZHwEwR9d9vVu6Qf/0+Sd6bX0YJ2m9YXqC4uylbJMMDHGxdBvcUxD/MA1YDIwFk8861 3cfii0hTUkbuyQ+JofxYsVvLFTkN6bV8MZiAE/454n1vq3ArFsUvQP3D2rp79I+wV1gQ cvCQ== 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=0GFDNHh0KoKEVxvH2zEYubRdCCyYvIjfGmSXwFEXqgs=; b=zYu1cgaAnHb2shwEKQUZNwZlHGW01KT7ZECuT3GXfmINTko0nY+Wz/bo5s+ecsKuSS R/UxXuV5M2VmmcOBa/p18WnEtSOK5b7EL3Ogdnp42G88xf9YdKppRBWO+ZqxefxjlTSl HoMTbBRSVKcWKVYG1X5YtNsfHYn5YjPrjJwYK6uIq62Y+YAByjnodGmyW54Vr31++sxY 3ld74dDlbL/pHXFQ2j5kbZHF0he+ctFMGQEX+E9IqGbNXJbnGIpoBIrTFfTIEV43OwGg LjX+xfXTosM4KuKAzTml+TTLzX82tnQxC0nbkz7X7tqt9wtbmJNpA3bQigLMHnyK7IBZ I9Sw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=iYQns8tN; 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 4fb4d7f45d1cf-59b26f65fb8sor520230a12.12.2024.07.14.04.33.22 for (Google Transport Security); Sun, 14 Jul 2024 04:33:22 -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; AJvYcCVz0SHM85DgxzIKxU9tYiPN/ci2DRADBpe4eLaawC83ECPF4FjRlo1RVeyU+KsIRLdhodZrLEdciATeOY9cPBl1UiaexBRKn2m8XNyAkwDfgxrJ X-Received: by 2002:a50:cdd1:0:b0:599:4e93:33c9 with SMTP id 4fb4d7f45d1cf-5994e933435mr4993631a12.12.1720956802664; Sun, 14 Jul 2024 04:33:22 -0700 (PDT) Received: from panicking.. (mob-5-91-58-211.net.vodafone.it. [5.91.58.211]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-59b25528dc1sm1929469a12.52.2024.07.14.04.33.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jul 2024 04:33:22 -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 13:32:52 +0200 Message-ID: <20240714113302.133399-15-michael@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240714113302.133399-1-michael@amarulasolutions.com> References: <20240714113302.133399-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=iYQns8tN; 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 *