From patchwork Wed Sep 11 15:10:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3441 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 6A4C54355C for ; Wed, 11 Sep 2024 17:10:53 +0200 (CEST) Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-42cb050acc3sf5955445e9.1 for ; Wed, 11 Sep 2024 08:10:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1726067453; cv=pass; d=google.com; s=arc-20240605; b=erAkea93RjwWHZXzjtfbnpMgznhWbVHaj6f8ARw63Qad3b1Ap3tE/QgzAPBj/0pa5v fmIOGG4Kp2kIuYy1JT3S83Gbz7OFYwgi17KDDuvdwBvtI8MLklxHs7d2gUJhI4tZ/XrX XWPR4Jwin2i1NpQMOnU0IrELdYbqNUfSXxn7FUMm6Hs6DNCekFZEaA7VHe2o7xk9nGzJ gnC+dh7FoBX4UQES4kM9JY/fLF1SZMZ6HR3fgbLHO3P1/Kt4nyzrR5lregpkzLx12uqX PFQHoIbDCyNPw8PDq2fec0motWmZqMh4pXgZL914P3G16RHiEBV5wjC0xL9uV4b1yFU9 CE3w== 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:to:from:dkim-signature; bh=qmTPwqBR9rbXKSBUWJhSJIri8cFmBf9EvddF4MLIYE4=; fh=eHH8ciw1bHmaIbJJVtZ/AY3fDXB75EqljBnA+BAoSBE=; b=el5Z6+oDOnYZWTHSkgDelaMXmRi/CJPpWzjHw/xEXlS5ff6ZZoCQ7Z10+2itrZ8R5Q KvPT9vwQp6hr8P6dz8aWcPoxOhwGWY4/RyjbD5D3dB8/W1SokJ08Fy5TndGkUMLkVigy 3eoSDlIaCclOwYyhjTuwsyZ8BuBzedCiyvYvqmeMUnjRrdow2qs9CN1Zj39MqPxvYkiG 2io/VlrCNaL2eIR1zghyyMwz0Apkpqhhkzomm3p+8XrssNCoDLIj+dalnfomiNtffxHy RAIvd9Z+9vOHt2QEQZulDJ7SXu4Y/Vcb/Exn5JkHYkMxefvrA/zvb+jh0NMeS44DEsmQ sCPA==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=YBIoaeIK; 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=1726067453; x=1726672253; 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:to:from:from:to:cc:subject:date:message-id:reply-to; bh=qmTPwqBR9rbXKSBUWJhSJIri8cFmBf9EvddF4MLIYE4=; b=G87Rfn4juP3AL+OerTG8lXQEgrT6ZQBNemwCX2Qccm3s1jLphhP8hLu5MJ7E+WmasC D+6TzBp8GJozUtBKc9UGYoxVh279F707xsknRvdmTOHxdYZDqBAao5yZeGZpXqAzR9DG xk8w8HKGNi2NIoh7VOqwQSEcMa4Tn3TwKrR10= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726067453; x=1726672253; 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:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qmTPwqBR9rbXKSBUWJhSJIri8cFmBf9EvddF4MLIYE4=; b=rJVSYIwsoHiL4d6LPcJzrBTU+ktwSLV5yEvJ+arD8zXSVH7Fk3+/7oeAy35Pm9o7tQ ohY4O6O5BcI93rRE91kEyktnS7G+PJ2AFDjvaqY4Y9Iz5RBy6Pi+KbMuxBX65LqqSoJ1 l/gf9dHMtnYWSEUfQHYp/ymfEgQRcalDcXFZ3yFRu+Sp9HA72ophkk57Xi7HQKFZqIc5 IFu+gHXeN9sjAiK1yZw5S23bV4ozGb6D/CNCL2q0P62kwLUUH+yHxQlCsvv3oCVuqyvb q0NoacMM7Qph6YD7qUgB5Bjrc3hk0bu87NisycvF3LCWoAsOjDBeIqgS+Sos8EFso1Ne o5cQ== X-Forwarded-Encrypted: i=2; AJvYcCXTznkiZU1KeIFlfI/lzMq8+uebFNxwaGntTkAM6eSJ/CAzu+BVfTAc+8dN/LkjivfzZpcHVCCaQDIilt/X@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yzv6OSDbjk8fepEFjtYjC6X1rCl82XSwsTQMAKbtyd0pnXfTLZC o5OvYouFH65Sbn88tmcGGCU8a6Hkip3ids967DdR98daujZgkbNaLoSMzmCzhUMQOw== X-Google-Smtp-Source: AGHT+IFh+1RPCBsDKEvq+9i8DYqQyKD7BLt7/5iLyeLyzqNcaoeNCtNBaPcPerZjvoGMoMGZMVPRXw== X-Received: by 2002:a05:600c:5110:b0:42c:b377:3f55 with SMTP id 5b1f17b1804b1-42cbddb7f79mr41509585e9.3.1726067452987; Wed, 11 Sep 2024 08:10:52 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:600c:19d1:b0:42c:ad31:3843 with SMTP id 5b1f17b1804b1-42ccde3c699ls3984785e9.0.-pod-prod-00-eu; Wed, 11 Sep 2024 08:10:51 -0700 (PDT) X-Received: by 2002:a05:600c:1553:b0:42c:b603:422 with SMTP id 5b1f17b1804b1-42cbddd70abmr42051865e9.8.1726067451527; Wed, 11 Sep 2024 08:10:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726067451; cv=none; d=google.com; s=arc-20160816; b=f1VwfcMR7TwBBN0kI9jGd5jQiDBlnwtXCqMjl9q5ZN4xeG1QiCi7tw+sYpcZRdr/16 OnZ3adfR3RwVijVYvBrHPRuSm+XL7RFB92N52tRBXOBbeCvlajR46+DE8GjqZ3TvB6N7 ShxbA29Dc2r7YjQgB481Hj2OMfYD4/pI22nvW7X2qZCc51jXWsjB5LGVKeDwo8JCyV12 GWL1GerGBiCyRgasHrzK9tR4VZk8To55IaqQBoT8hVtGCxhmrf0BVDn13bCeN9ncjM7U XxvIV8SrH0Aa3wnJ9/Ciiu1RfBYcVQw7YylIugtGD/JdZAQEBdc8ktkCBhg/s87Ah6qr Sxpg== 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:to:from:dkim-signature; bh=18UE/TjtsBSoQafY0oEo7+M0f8SVrTD2gpyVr8YhC8E=; fh=FtQepR0uNoeKT2PVdKfTKOkvEYfwbRmoVE9BmlYw3tk=; b=SgHVbTu331YluK3xhiLEcC4OH/lIkTpNoJ7jLoE9lK4ZkNSAi1T0oD0CDOAL+ZcGAW +kB5KRIiVJc1NCB6o6YekCXswmsTskJVHQoG3Kd5TtpsnKh9X+jrNqW+Nak4+FLwEwDX oZlGgIQSIXi+faRFXWUFB7wocRVIwZ9yx+Xy999gA9UKEnSExhMdV0YaV2cyCQtPWf2s eq0RgYYccYPQSD1goBT9w5feKW2Mesmepo2gm987rn+g5DAdGBnSjVg+pZIUAdlTtMUo as3okPbRyavo/UDP4d0k+bNJc+zH68DRGq0ciLHndNhM2PTw4ovcSkTXom89439sUnD4 O9sA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=YBIoaeIK; 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 5b1f17b1804b1-42cb10c08fbsor22469895e9.1.2024.09.11.08.10.51 for (Google Transport Security); Wed, 11 Sep 2024 08:10:51 -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-Received: by 2002:a05:600c:46d1:b0:42c:b336:8f1 with SMTP id 5b1f17b1804b1-42cbde016c9mr42080345e9.13.1726067450888; Wed, 11 Sep 2024 08:10:50 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.amarulasolutions.com ([2.196.41.3]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42cb116f44esm137688375e9.45.2024.09.11.08.10.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2024 08:10:50 -0700 (PDT) From: Dario Binacchi To: linux-amarula@amarulasolutions.com Subject: [PATCH v2 11/27] video: bridge: Add check_timing interface Date: Wed, 11 Sep 2024 17:10:23 +0200 Message-ID: <20240911151039.2914886-11-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240911151039.2914886-1-dario.binacchi@amarulasolutions.com> References: <20240911151039.2914886-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=YBIoaeIK; 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 --- 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 *