From patchwork Fri Sep 13 09:55:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3478 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 3211F412C3 for ; Fri, 13 Sep 2024 11:57:14 +0200 (CEST) Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-5c25cf44030sf1202665a12.0 for ; Fri, 13 Sep 2024 02:57:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1726221434; cv=pass; d=google.com; s=arc-20240605; b=hKW3rQXzJx1yJuzVLyG1+RvqbWngU2yf4t1R9Y4D/ByBtcVscwDETThl3ortgKE5oo c7SViolnjDbeQzatO4DbMJi89/2L/Xh9bLUcBj56g01M9dV67LKbFdjRusCpb0NbIqNs 3zsvO3ZKNKiuZQl1oG4WLucdfloSRYT/f3l8L9qf60jGqtYjf+8WbgDPYVxktkaO6WD4 WCZ4RbLSe2S4dmY14fdKO50KQBgrz3RI5PuswTif9henNmDkFKFm2Ad6QBiJw2/1tlYI DJo0pxuWUxPcTdbipQ2ASDbsIVUNR889OwZeqVlnpq8f8MRmHqCLKh+2348Z6BBceXKa 66BQ== 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:cc:to:from:dkim-signature; bh=zbA3bhKgzT2GIl70JQXZLMSeIhsAnZHbOr3Zjf6ftJM=; fh=X/IOgz6F1CZDF0UTR4hb4hFfFy2xXnj6XlhK36WB2UQ=; b=Ou0ZBBlvbil/kEE/UYmWOxWH1MlXd0NjyiWgLTzLuXMfZW2y4XrnyvTR+BY1kiqu02 WuZM2FfJGZNdKwSUnbtjeYQzRuyS5YUOjBp7ql3KAvRR/eJH9x5Tzup5fM2bP8UPfD1I 9uz2LT3KtPWARzmL1pndOrC9pHyKCc3+kyUMaSB+XG62Z97xXPzfYjf9KQYDLgp3IIQJ oaxFvlx5Kuu8Nk1smhp2Ob1iC2tzMlC34WF03wXNtAwJjeBJYbT4T/GiJspFHxZAf933 k2b332wFPajJlZcEHpjRyooetClgUd2VIVeoJxzEhvKjUlGjREkIegPgb4AWwa8C1FFa CTsw==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=EoZ76suQ; 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=1726221434; x=1726826234; 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=zbA3bhKgzT2GIl70JQXZLMSeIhsAnZHbOr3Zjf6ftJM=; b=YF4inTq/pbP8UwBtyMekpGdWBkNidaMtNr01/HA9foRrVzn7SpaSP2f3iKcbW+Mm5w PKZmip59lD4tU98uaIphxWOsMpLUnICP9prNWqElxVANpXffSgG6mWpvoOro9TmdYZWC DSxBEztlyGzqKQWL2M4Sye4aMPZJgc63OUiO4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726221434; x=1726826234; 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=zbA3bhKgzT2GIl70JQXZLMSeIhsAnZHbOr3Zjf6ftJM=; b=IqQTy4W3Jql8Dn7clxsW7IVAoSVrWoJS/3n/9dMkdLXPyYgtDYJCXafkid4/WVjNTZ oz7MsLTmStXTxUABC6vUZ5mRgGqo/uZFfvVPomfzml32bKWOV3lxUZ86p7YnZMRBnrhN j6/1wrD/8sN3vYUQV63EvKhqJCXL5Q+mgJ0nTnExDqGE2QpiVUNnkFE5SIsl7phVFTZc DS/7JGJUeISSzOp54eCBWRGNqFfHCMgirfOMnW/6PLJUaF5A5bNvaOmy9cV3xks1NO1w cl6am57DlaO5y5bS/ZrIjggmrGAkJtI351QNBh3/ZsMzKuLFxGqfXsealnu+zpHisKaD 8+vQ== X-Forwarded-Encrypted: i=2; AJvYcCW5fkwxHQtp1SeXVQPjfI5rco3UgeWiSd0H/egIxM+OmuEi8rBk3Sv+Hzi4uHKbyfvkyvC4NaXGPtJvcTJI@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YxNLTaHmgbCKBthKjdMf+HVgPfXwfysnWz0aagsQuJl5CnpEl3R xG92B7WN9VaTSf8YryNqMK768c10yo7xyuM/AmnLr2uAuRBzHY3SMeU2tfuJWp4mcA== X-Google-Smtp-Source: AGHT+IHXgnx4D5pAXMDIuaTM+36HvZlU8fnQpcOwj69YfaLluIZSyHTcsqdh9JLK1RjFJHTNjwLYag== X-Received: by 2002:a05:6402:2805:b0:5c4:a64:e7fc with SMTP id 4fb4d7f45d1cf-5c413e119cfmr4978303a12.13.1726221433751; Fri, 13 Sep 2024 02:57:13 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:2685:b0:5be:dded:4357 with SMTP id 4fb4d7f45d1cf-5c41408e81dls608936a12.2.-pod-prod-09-eu; Fri, 13 Sep 2024 02:57:12 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWGR57AEuJDzJIHbz2J/7HIwZwXP1x8U8hP/cvinHESHsGuii3fJAGkVfFawHvONuyVol4mftGKYZlmk3sr@amarulasolutions.com X-Received: by 2002:a17:907:d59d:b0:a86:78fd:1df0 with SMTP id a640c23a62f3a-a90294d0a7dmr567854566b.34.1726221432111; Fri, 13 Sep 2024 02:57:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726221432; cv=none; d=google.com; s=arc-20160816; b=A1z0b/Ng3Cf20fIBhGc3f5cZcDaTgg6gGbNfdfQAwVzM8l+6Ll0cp8djojloBo8r5h NRYM7kRAy80ZxpvCl1FVKwaTcKZZA3zxfM7RQnMi7rY2gGACiGZCggbZE+/hc517dFiF pH/6JfcMhexCj/yJlQ7Q0UB9nKTcL9odaT31a34MxraPRw7K/zZTIJxw8p9DSbgJAy45 Ii3gaV4aVJQdEK5Rf3rAUzqM7SXWCwwgCv0qKzPY/5fDwxsQf3GhNdOzGkoYte+2mO0J CYxFmeyJsNjl7SrvTrAcpG3LgbH/NLT7d/ZX8areIesa9k+B0ul63J+BTlMLx6psT2pF FXyw== 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=FFRO6COzZ3cv5Gq5S+ZSJewQI2yeUOKQWAgGGqlan8k=; fh=gkhhEFD8CuFOfh/cB0hPSX67PepGDSu/ge4uyfRduNE=; b=dT+ItHU/NTGubnksJ0lAkV9bHQSBGmE6z+nQjm2rwJR7ezn64JaWJz7QM7Z1UzPntY tAhYYdvn+QPBD/Oj7d2UBHXaK7Lo1epRQrBUrrCSaZsQ9Y2KQF6TiJtrlKzNPg8ZOZTh rtDm4VQt/D74+jECjvcqRLqOFVyEz+M4eywr0PAaSuGLLbbWnJ1WYnKBx4VZcy3aMFe/ gcayDSCmEUt+8N4yJEZx6cTZaNlGErQqrW4wKg+6m6myTVtk5xbz5UaaKu8s0T+l/y5t kizrEiVonZVpu0c5fD19SxDhTIPXYIHRA1RKp538bVz+s1bLGA7/YW986vypKCGq5DK8 YeEA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=EoZ76suQ; 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 a640c23a62f3a-a8d25c2aea9sor449727066b.13.2024.09.13.02.57.12 for (Google Transport Security); Fri, 13 Sep 2024 02:57:12 -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-Forwarded-Encrypted: i=1; AJvYcCV0EqxlZ93maEmXKNY/MCAFdIJErhRPjB/ztg8zTSkhyPFYu4hwzBOS8V9v5snIYRLmYInw6e3r58N5jNBO@amarulasolutions.com X-Received: by 2002:a17:907:1b05:b0:a72:69e8:f039 with SMTP id a640c23a62f3a-a902941d803mr498746166b.12.1726221431502; Fri, 13 Sep 2024 02:57:11 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-87-4-102-18.retail.telecomitalia.it. [87.4.102.18]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25cee72bsm863224766b.173.2024.09.13.02.57.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Sep 2024 02:57:11 -0700 (PDT) From: Dario Binacchi To: u-boot@lists.denx.de Cc: Fabio Estevam , linux-amarula@amarulasolutions.com, michael@amarulasolutions.com, Miquel Raynal , Ye Li , Dario Binacchi , Anatolij Gustschin , Peter Robinson , Tom Rini Subject: [PATCH 10/26] video: bridge: Add check_timing interface Date: Fri, 13 Sep 2024 11:55:52 +0200 Message-ID: <20240913095622.72377-11-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240913095622.72377-1-dario.binacchi@amarulasolutions.com> References: <20240913095622.72377-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=EoZ76suQ; 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 Signed-off-by: Dario Binacchi --- 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 *