From patchwork Tue Sep 10 17:53:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 13799139 X-Patchwork-Delegate: kieran@bingham.xyz Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2124718EFF8; Tue, 10 Sep 2024 17:54:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990863; cv=none; b=UDdI9pfaz0A6cU1/7rI6UrzVn3V4W3OzL58u2DbIzdyZx/LEZZVysKJn6BqDSYS5hhbxYVQZt1odWzxzXaImGC24xSOVX2y/1aDb2fafxKWjges67kp3SMXjWaau292IUNTblwbIN7xhVIw3EfrB+Lt62B+ikxs6S8HlbYq4U/Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990863; c=relaxed/simple; bh=GpOciCVq4t/tJoPu521/2pt+bx2It1u3tQQVxBe82Mo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pZst87i2KK/HgixSYmcZP5MMaNMvktmBBOQmJ81cK6nOw0VmtEJmPMX07WTuEr+lDoti1gzt8aQLacqNWTQEIIE2ozpXeBIBmecRLAKoRvK3qVvmHiIpH/fqEiEaeyq5RG1d/+15iQWQt4sYziIddQ4X7Yl+8mlSo8yrPgdENTQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gZh3DNT0; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gZh3DNT0" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-42cbb08a1a5so10713975e9.3; Tue, 10 Sep 2024 10:54:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725990860; x=1726595660; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0YpDvq1aX8RM/8T4KEaByBhSLAjHidzJa16dqw9KTCc=; b=gZh3DNT0lmilKP+3apknAKb4v35VVDAUI/U2SCXnjNdJRabo9yFd5QSoNazjmb2Q8i 7YfMHUIAHfOz69K0tPo8DvFP6DTvg4zPiiYHivjRqgr6bdKqZjNvUyAu0KV4HafpkzaH VFOXB1G8tdBKVH+ifT7TQX4ICCKfaljlGtHJ89V8ASTTF54HztSORvCTG06fOgdXbG+h pf6husd24ZWWdFR7MoJ05uzROjc4XaXlOmuQ9HEQok7Fr14LfRjBjRa6QxNwVVwrlX1s 7PTjGD3X7vCal2jBG55IpWouZ8AOjgrNUT1dOQmt26+sIObum31asFTOfD49qxhFTOQi tucQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725990860; x=1726595660; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0YpDvq1aX8RM/8T4KEaByBhSLAjHidzJa16dqw9KTCc=; b=Vrea/UyC8kaAecWj9jv9SgdRGoonSPyHW6arRbIi/8Dquq6HMV9xCMUnfkQtChGhJW y8VnIEW5BlOk9S/6SArcPB4eOOr6DuLD/3J+mpTzu4sJFIMcs9M3qelWecWNI9lAi0pI V9KB71/R6ztZugJ+AqVEejwWZ4byt3wcaiP+sErG64raaXHbPf1X3CyEmUwHqPCIwtgr 5JwQuNXL0oU6SLcrnXBbUXkYxPNJudqOB0EtYoR9EuaxknfxZi3ZV+XOm0xuuJzicS76 SwOy2N/4H9cUDp2zS822fO1zlfjM7jSuR1vSg0jacHmJIsPqMmGh04LFPqqqMj9CuFi+ uLSQ== X-Forwarded-Encrypted: i=1; AJvYcCUUG4EjHgn+/yn9zXUUZnGVZLgO6rWyK/fRDKUouPLIUjnCHGia2l4ExuiRMy+kshRVI+XKyVEufmf7a9k0gEEZI2s=@vger.kernel.org, AJvYcCVsC8buJkCsMeZqxylsblsISl5SAUfc0R8SBL0YecUQUXG9Zfsj0yEN+1KKyxYrwol5euoZk95zHY+cNr8=@vger.kernel.org X-Gm-Message-State: AOJu0YxJZUVaI5HvCen0MaaAsAHuUpBr7wCuSvuJTMTDL8wPiYiAICV1 tfZlCv27YzyhkH9BQ3BaER3RYLqeYNxKW8JLZ5LheXORif0CgEsy X-Google-Smtp-Source: AGHT+IGCnLGn2NbSb5IisyeGs1jbhQbm8aHmE69KOdX9MnTXZBrQ0nrfIb6GbqB6tfmg8YeFFshAsQ== X-Received: by 2002:a5d:5244:0:b0:374:b97b:c69 with SMTP id ffacd0b85a97d-378b07fecfbmr330663f8f.48.1725990860274; Tue, 10 Sep 2024 10:54:20 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2500:a01:94a6:1e64:e5a2:2b2a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37895675c40sm9516562f8f.51.2024.09.10.10.54.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 10:54:19 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH v2 01/16] media: platform: rzg2l-cru: rzg2l-ip: Use the RZG2L_CRU_IP_SINK/SOURCE enum entries Date: Tue, 10 Sep 2024 18:53:42 +0100 Message-Id: <20240910175357.229075-2-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar Use enum values (`RZG2L_CRU_IP_SINK` and `RZG2L_CRU_IP_SOURCE`) instead of hardcoded array indices. Signed-off-by: Lad Prabhakar Reviewed-by: Laurent Pinchart --- drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c index ac8ebae4ed07..9f0ea1de50da 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c @@ -217,8 +217,8 @@ int rzg2l_cru_ip_subdev_register(struct rzg2l_cru_dev *cru) ip->subdev.entity.function = MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER; ip->subdev.entity.ops = &rzg2l_cru_ip_entity_ops; - ip->pads[0].flags = MEDIA_PAD_FL_SINK; - ip->pads[1].flags = MEDIA_PAD_FL_SOURCE; + ip->pads[RZG2L_CRU_IP_SINK].flags = MEDIA_PAD_FL_SINK; + ip->pads[RZG2L_CRU_IP_SOURCE].flags = MEDIA_PAD_FL_SOURCE; ret = media_entity_pads_init(&ip->subdev.entity, 2, ip->pads); if (ret) From patchwork Tue Sep 10 17:53:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 13799140 X-Patchwork-Delegate: kieran@bingham.xyz Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E72C71A2C0D; Tue, 10 Sep 2024 17:54:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990864; cv=none; b=gL1uDZ+No5PYUSXxa3xbQUcIEEtPRbvEovZZvYIuD+j9P3XWvM9dlMnsraXTWhQ0rwSR/vHESiCntRi2IuPFbeE+yhJ87i+AyyPMt+DJYm2GO8dbYaqTQ6RzuxhdpV1AOfFBq2A59sHElzEy1yJijsV8SiwVxOfNcWgR29qfC5w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990864; c=relaxed/simple; bh=p0rcSqNDkoae1ANIInQxI34EtffO8V7joAOxUotvwII=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sRaoAY1DLDjtXhHv4BOfYq2kyUXgDpNOeAfIdtFbQ80BVQu0EVnRe3T7jP/QaLt4zI7TYJTtIxvSSAjwThYierzS0b2+e+YGrIki/2T3qiT2bDp9r7hnTKInGaw9XF970vjID7aURPHA3Et6N/BOnSgBy7gad/PlzSlQuBfNX84= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=auen0yZW; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="auen0yZW" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-42cba0dc922so17831615e9.3; Tue, 10 Sep 2024 10:54:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725990861; x=1726595661; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=h2T4TNtnyTy5Xj6sUcPx5X44BZb7uZwTscRdIHIEFNg=; b=auen0yZWElqnG1TZc3q5eBYwy6eoFHa/3CgPLfBZkn9JYCNNG4QQxgF3886fTP0ed6 QwmtpEuvXS5ypUKd4rnr350bjP5MhWpTUkCsNGJAsTADWzXImBYODIshBUIBFyaOf+oS r687WqmPuO6MxxmSVjmMe0v3PpyfO52YOPq6f+WrlbPFZIqNV7kt7P9B9bQ9oaorS1V3 Q0x1LeboyRF0LctF5A6UvDzc29YH919h4mzVPOCbWMHnMBFqCtvaBIAz7bNi/GGvMGPA Z6kp+qINNVHLkc6EV7Prl2m15pETyqKBuQJ/syl83cU9GZDc1sKEd/ZqkpcpJJ3lwpF6 rfXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725990861; x=1726595661; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h2T4TNtnyTy5Xj6sUcPx5X44BZb7uZwTscRdIHIEFNg=; b=kR8nqIyGlYj2+g4Hu5KaUFQ4ezN8ydawxrOBSy9QXctOx/QB2LgaYw6/qQJZfxeLqs nPoGSl1BtRhIz87Fjb768W9a1W2zZWzYz6yjZH6wj0zAMDgdK3ya2wGEkvlT3C6PMFBR UfeV2B3WzB78pMrcTaIAzdtHop5L4UEPr/YCYQd4OmEu/Y7MhEeYx6vrzRtxwWKSM0D4 DF0wHgiFFApjaXN5RZoh4kajhD7Bl05bIg+jwd3xqeoZsFPGc3KmJBYGH3bHeFjsOSAe xvvPz2M7pele6Z2PeugNVWidtF5nY4rWdyzLJ5TSrjW5eXg9uQey7hGazZkfXK2Li85O uWpw== X-Forwarded-Encrypted: i=1; AJvYcCWs0gI2QEoKm9sPF5PG0o77fSacYET/ZVWquD59CUH4Sac34ZdHUSzbvaPbiKyZvHT6/Y+gY9gcd6TnpxM=@vger.kernel.org, AJvYcCXjHpOyO+XhRPDSAhKRolllyasUHjs++6Tfkr2FPWmgYM6ELG5OXuAAsYWF+iww0K8En6+bDqsb1hzJbPQWvyQpzts=@vger.kernel.org X-Gm-Message-State: AOJu0YxkPM4v7La7Ig2CTc3FFEP5lqhEdSIkPxA5KGdKnP9+3E3PijNe LkSK+Or0iII8mtOcn4gq/Lxxzu7+Ys6TIpubpbl1IIbEmR2niKur X-Google-Smtp-Source: AGHT+IEp9bOA281vLQrsc4XSGHi0S4IHku5gEPv7cgaQvldLdqUXIgZN97R24MwtxSv6XvyxaM4FUQ== X-Received: by 2002:a05:600c:314c:b0:42b:a88f:f872 with SMTP id 5b1f17b1804b1-42cadb699b9mr93432435e9.32.1725990861261; Tue, 10 Sep 2024 10:54:21 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2500:a01:94a6:1e64:e5a2:2b2a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37895675c40sm9516562f8f.51.2024.09.10.10.54.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 10:54:20 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH v2 02/16] media: platform: rzg2l-cru: Mark sink pads with MUST_CONNECT flag Date: Tue, 10 Sep 2024 18:53:43 +0100 Message-Id: <20240910175357.229075-3-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar Mark the sink pads with the MEDIA_PAD_FL_MUST_CONNECT flag to ensure pipeline validation fails if it is not connected. Signed-off-by: Lad Prabhakar Reviewed-by: Laurent Pinchart --- drivers/media/platform/renesas/rzg2l-cru/rzg2l-core.c | 2 +- drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-core.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-core.c index 19e0ba9596c9..69cd45b26951 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-core.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-core.c @@ -209,7 +209,7 @@ static int rzg2l_cru_media_init(struct rzg2l_cru_dev *cru) const struct of_device_id *match; int ret; - cru->pad.flags = MEDIA_PAD_FL_SINK; + cru->pad.flags = MEDIA_PAD_FL_SINK | MEDIA_PAD_FL_MUST_CONNECT; ret = media_entity_pads_init(&cru->vdev.entity, 1, &cru->pad); if (ret) return ret; diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c index 9f0ea1de50da..db48118fc817 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c @@ -217,7 +217,8 @@ int rzg2l_cru_ip_subdev_register(struct rzg2l_cru_dev *cru) ip->subdev.entity.function = MEDIA_ENT_F_PROC_VIDEO_PIXEL_FORMATTER; ip->subdev.entity.ops = &rzg2l_cru_ip_entity_ops; - ip->pads[RZG2L_CRU_IP_SINK].flags = MEDIA_PAD_FL_SINK; + ip->pads[RZG2L_CRU_IP_SINK].flags = MEDIA_PAD_FL_SINK | + MEDIA_PAD_FL_MUST_CONNECT; ip->pads[RZG2L_CRU_IP_SOURCE].flags = MEDIA_PAD_FL_SOURCE; ret = media_entity_pads_init(&ip->subdev.entity, 2, ip->pads); From patchwork Tue Sep 10 17:53:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 13799141 X-Patchwork-Delegate: kieran@bingham.xyz Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC7F51A3BB8; Tue, 10 Sep 2024 17:54:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990865; cv=none; b=pGHOX2czx87aMBh79InOz2oQhDmHogXaBg/Cr+Gfa0DtoYwA6NJQLvseiYeq/9qPsog4RrakdnRPE8EIemKt6C34BQ7OE7YRjnVwbL3dTSyXMvFOXutcywWrIheLqvhEkrKP98ktbg4lZKEjcg9sDEoJfL1b7aw4vbq4fQ4D9S0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990865; c=relaxed/simple; bh=pu8CI4aObR/sIx7XLer+ZDdniuRp0/w3So7nbJrThlU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GYAbxjxg3MsiD5UTQ22PMASE0byy2WBrbf0T/kN3CDDatS3I7Zp2KDht0uRGc2bMN65AXMfqFMXS6L3WHQJvaD8jblZmO8CsxcS0JJ8sczPTWTcvjKoFOoacm8Te0Bo10CwTnb5Vc6bzqoQ8Bhj0M7pQ50HJebVatvLQXfNZmPE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UmovN/ag; arc=none smtp.client-ip=209.85.221.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UmovN/ag" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-371ba7e46easo902242f8f.0; Tue, 10 Sep 2024 10:54:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725990862; x=1726595662; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Tmgy5KAK/lbCPSPxqggEBRyXRnt1xL/QszOPz2p24Qk=; b=UmovN/agVot1Jn6ZrcHJiBflQIuTXsa2Y/8J1ntHGz0zRugdkqoT1wpRx4Nee6rmJ/ ocM7AxtRp6xU9gAiuH/qQ2uD0IYB2W2/X3OuDiuKYTrqHjdnejeqh9aIFXfQzKpSdhhT GIzaI19ULewJs2AdzkmvMOPftR5xRCiicBq7QdHKZEdr6ZIonXJQfjndgGBg9QqVlSwj cdGLxH1IuEm15Vzoi9e1H9gRekc90NRM6TvQrHNVGKwP6B9QU6nJgB8bBt12ePpxSvWU yDJCbFDDsi4V0TNLEf2ho6Ei7WHYJhpjJKW8woXVhhahtcmI07JlYECEjS2ufph0HeQr Er/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725990862; x=1726595662; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Tmgy5KAK/lbCPSPxqggEBRyXRnt1xL/QszOPz2p24Qk=; b=kYndnnFzROzvh0C6dyd9AVKpGdo/QDkR0ReOVdIK+GGKxqJUw+jNvN/rOLR7s2I84b LJVgsPgIZkewMSXj8OPffjEX9dpxozElokThNtsYEOrcF7m9JLv9upkLXbHZauL11IOS h8rnGj4bzcoYP+tqYuyfpw2+595AY5MVnphaWhxilzX0Q6MyifWy3FT0l24m+GnJucLV yout2h1Pvo8E4bx2r+zUbqHIWp02V1mP8tZs56eKrGCf6YbDMqDX5DEURBxX6H78i61I S7gi2SEHNUXOj5ylXGvHXrDOWbgHD5YHx8mDYqNnHgFvn+vHNMj50rr1en23qMY5TJpX N8mA== X-Forwarded-Encrypted: i=1; AJvYcCUpkuhsfusStcuf9vj5a3/j6YeLR8p5IpS1X9TKhG5U5x6J3RQDJyf5VfWKHjpF5o8/4cCn6Vaj0cRVT8E=@vger.kernel.org, AJvYcCVydeVbHTRP7WnNJUq3SoNs4mW3UdHrQWJnvqFbimz142GySjmyGL3ze668jn5SbLcJ1Y6HAkC70oR/dyDXuLWq7a4=@vger.kernel.org X-Gm-Message-State: AOJu0YzBm6PsbtYkxb89c/waPMFh52hh438P1Xu8liYRUyspao3UF6jP bzDjoqwygihRn3phjkf+Ef9GgaiK2gF2xIGacNpcJ1ddiLk/DDgD X-Google-Smtp-Source: AGHT+IFe6jWAikngv0108Oqsd3njrDUvEmlfPZbWaxeswZ1jTUcCzzgoWLiltUBKjbHatcbXQKvnfw== X-Received: by 2002:a5d:668e:0:b0:367:980a:6af with SMTP id ffacd0b85a97d-378b080e293mr266636f8f.59.1725990862150; Tue, 10 Sep 2024 10:54:22 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2500:a01:94a6:1e64:e5a2:2b2a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37895675c40sm9516562f8f.51.2024.09.10.10.54.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 10:54:21 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH v2 03/16] media: platform: rzg2l-cru: rzg2l-csi2: Mark sink and source pad with MUST_CONNECT flag Date: Tue, 10 Sep 2024 18:53:44 +0100 Message-Id: <20240910175357.229075-4-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar Mark the sink and source pad with the MEDIA_PAD_FL_MUST_CONNECT flag to ensure pipeline validation fails if it is not connected. Signed-off-by: Lad Prabhakar Reviewed-by: Laurent Pinchart --- drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c index c7fdee347ac8..2f4c87ede8bf 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c @@ -795,13 +795,15 @@ static int rzg2l_csi2_probe(struct platform_device *pdev) csi2->subdev.entity.function = MEDIA_ENT_F_VID_IF_BRIDGE; csi2->subdev.entity.ops = &rzg2l_csi2_entity_ops; - csi2->pads[RZG2L_CSI2_SINK].flags = MEDIA_PAD_FL_SINK; + csi2->pads[RZG2L_CSI2_SINK].flags = MEDIA_PAD_FL_SINK | + MEDIA_PAD_FL_MUST_CONNECT; /* * TODO: RZ/G2L CSI2 supports 4 virtual channels, as virtual * channels should be implemented by streams API which is under * development lets hardcode to VC0 for now. */ - csi2->pads[RZG2L_CSI2_SOURCE].flags = MEDIA_PAD_FL_SOURCE; + csi2->pads[RZG2L_CSI2_SOURCE].flags = MEDIA_PAD_FL_SOURCE | + MEDIA_PAD_FL_MUST_CONNECT; ret = media_entity_pads_init(&csi2->subdev.entity, 2, csi2->pads); if (ret) goto error_pm; From patchwork Tue Sep 10 17:53:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 13799142 X-Patchwork-Delegate: kieran@bingham.xyz Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D383D1A4B82; Tue, 10 Sep 2024 17:54:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990866; cv=none; b=lsoFGe1AtiKkpZh95zRuwDY6Td65MGQTlgvpYRy4VxiERkKmu6y6WGfP2fObHSchZXAeKBWGnnzIptmBpkaJoD1ExfxiMnGG+pdDdHHuGXBtEM5sbeCzSL8YPZ9GEdMz2c/iQzwlYm16syNrvyU4nKYk9rGhPnI6FscSLyAzHqA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990866; c=relaxed/simple; bh=RovCLfsnDlrsmjJjptM1IJKbfXPN4/LbCsAEJElBZU0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=EADqzkO0bxUkl3REwyKyR3v6xPFYoIYMqksm0zTjORjXQduPvB4FYZYVtItTvroQlV571Xak6++Cb9G1Iwt7vjTe6NpI7OnXf7+kPMx7UGmbWr5wiuzwko1Gw6MOGT79UFzGIcFz9/+FyCGAdIXKh3FWnJL4sFKw/WxyTOoLXOI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=E1JDBuX8; arc=none smtp.client-ip=209.85.221.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="E1JDBuX8" Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-374d29ad870so3628748f8f.3; Tue, 10 Sep 2024 10:54:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725990863; x=1726595663; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=T365CfszrGDfzoyk4g1jrrFrtycMXH2Ev66xLzYf1T0=; b=E1JDBuX8kQJGfKJvWb3FGFEGpiPMkuGCHeF/OOiTNLjuwWarGr1YQUM666ndwUN+g8 lV4v7VrhzzzVltGCU0ZT04oG4/JnbFEUK4ICymTYHYN3XiUByhBP4iX3Cl6kJM5oNnQY haXm2WvzACJ+Ab/pSfK2TpdskuH5Ku69XZXQIiC7RBpivykRljOrZoi6nDRN6VYop+5V 1zkTEKvgcCHi6URb1iNNHxY5ADjXOn6QJzJHqyNJptqLZGDXYsJ6ANLUhax1Iedn+SoK jaoYF0HCWEBdcTHDWKcXwB22/QSsZO9Afsxa0UB91wsJiZN0UbnkIWeU9H73268RIalD P+Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725990863; x=1726595663; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T365CfszrGDfzoyk4g1jrrFrtycMXH2Ev66xLzYf1T0=; b=GV3MiT2wjrUotbwICGHZS7Exld2TgKSFq+Plc6NB8vCVyEnRQb+LFZhrOMjxfLWSS0 nGjowfdxjZ+A9IICYQ9OoO4l1fMENGBlodK5Rsv0tMKiUQVVPbYQmJTXZJDyEQ/GO75u 7F7rvtxJPCL4sIxjROm6URYBJXGYmkYBfKFML9e/NbKhc+h+JGQRH+M49xGZUJGnCQEP 88vzhriFo3ryUwo2/UtiMeB2uvEnJb9NcqO8Ndu1pNYEuy8I7w2LEWPOBZoQBzCtFiE4 onEgkutf+BINqTlvGGBwr4RThOOd4cvFPCQRJKLKpjR9FBiK4oPlatUyaUWfuYfyJdf0 wt8A== X-Forwarded-Encrypted: i=1; AJvYcCUofnw66FvZxtaW/cNSg/6VL1cTod8r0MjDxfNyMviqtbKC/0S0WTc5CdD2yuw8aQvzUKaxiv6z8roCeBeKR30pwWE=@vger.kernel.org, AJvYcCVdVAlV/u7qAAaFIFMqdeC9P+X5ZobuQ+iXHJPLuNoKvnM4o3zLYgAS8MdvodqtiHRq4U5iyA/8Rt/BmIs=@vger.kernel.org X-Gm-Message-State: AOJu0YxaWHuV3TrgvZGTHjl/Nn8rI6lr88bYAx7NMOxXwmAT6J94bPJZ LeRSD5VlSCEAZ7d6FPOzqlxSzsVvAA3JoQxEFN/lo5CAKZgyAW2s X-Google-Smtp-Source: AGHT+IHNMj4+P9FHg+a2BtNp0gsOMhiiqS6grdg4xYI1tUevBlZqjTZDLFMbVTqMPPqtpJggv1JC9w== X-Received: by 2002:adf:f3ca:0:b0:371:8eb3:8c64 with SMTP id ffacd0b85a97d-378896c7ddfmr8380588f8f.54.1725990863171; Tue, 10 Sep 2024 10:54:23 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2500:a01:94a6:1e64:e5a2:2b2a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37895675c40sm9516562f8f.51.2024.09.10.10.54.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 10:54:22 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH v2 04/16] media: platform: rzg2l-cru: rzg2l-csi2: Make use of NR_OF_RZG2L_CSI2_PAD Date: Tue, 10 Sep 2024 18:53:45 +0100 Message-Id: <20240910175357.229075-5-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar Make use of NR_OF_RZG2L_CSI2_PAD enum entry in media_entity_pads_init() instead of magic number. Signed-off-by: Lad Prabhakar Reviewed-by: Laurent Pinchart --- drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c index 2f4c87ede8bf..10b8b0c87c1f 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c @@ -804,7 +804,7 @@ static int rzg2l_csi2_probe(struct platform_device *pdev) */ csi2->pads[RZG2L_CSI2_SOURCE].flags = MEDIA_PAD_FL_SOURCE | MEDIA_PAD_FL_MUST_CONNECT; - ret = media_entity_pads_init(&csi2->subdev.entity, 2, csi2->pads); + ret = media_entity_pads_init(&csi2->subdev.entity, NR_OF_RZG2L_CSI2_PAD, csi2->pads); if (ret) goto error_pm; From patchwork Tue Sep 10 17:53:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 13799143 X-Patchwork-Delegate: kieran@bingham.xyz Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8B581A4F2D; Tue, 10 Sep 2024 17:54:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990867; cv=none; b=OBh7FP1VvaW/14Iowky7QEB2Fjpbyswx5Iw+Z86qD9G7EVT6KzMymNQsQTd3HLEi9N+o1GMUY2DtPI7l8rlimihLFDJ5wqJaEdnOeEK5HPM5zP4hgDrzqgK+G8We2k8KFJrA5Y+0rHAxaIX89WAN6gokOfk1ICoTHzepFecnAl4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990867; c=relaxed/simple; bh=Rug2G/cq2zgB+wXzCC2v3xDbeD5WdaUO6mgJp69FfuA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=el57Pk7ZtxXm5DNEmAdBQY96aJEL8FY5tCtcoyqWy4U5UAfIgg6L73M/6iaPM1stnBJXrKDuuoveAZNICreFTthcMOTGtZjulFp/P07QSuL4GCBAK4YRqLTIyPxPM0cxNo4yhpC13PV5/usdjXAa7sNyLpPKyT8qj8ze/2kVulk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=jsjjTjKg; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jsjjTjKg" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-42cb2191107so23971145e9.1; Tue, 10 Sep 2024 10:54:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725990864; x=1726595664; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ejTEHNcsBD1DrfHR6s4LkPhnkpDczz0iTfYbRqUbEt8=; b=jsjjTjKgdKBWsycUYKiupbAqFKjLUvJtOxHaa3NriAC+jh/pFNlodJKxBSZ1ylcdvr CzBrZYu408Ff1rQS179A29dOAx2IhiKnFWNBVDqS27M8vmvY4pKPhEsylDXpI4o8dA+f J/Oknf/4f/GpNfyW4K5YeAMDByolN0EgdUF08gACgL2Njz2Uew9khhtawn1m5mWrVBV3 9zZaZvMlsWjueWp/LAfjnfOSlogVsIOpFkpBujGhBjf5l01a9o8FqHLs2AjDjg+whjXK SQzr409TRmvgPYHfj06jMJ9Aw4cM+B2Kum3GFWewzf5aL/4O7sGE1JINqeA23sq0kdmG oB7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725990864; x=1726595664; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ejTEHNcsBD1DrfHR6s4LkPhnkpDczz0iTfYbRqUbEt8=; b=veq483CwjgrxqRlWd+7H/x0iUq3sHBOm2wg42EI223qKjbZ+em4MRMLpRdB34DJ2TB uHDxXkyF9HDLviAeg4uOTzysNodTyiJfhAXZYEAS36CmnASZMwSu33qeOBB/Djwvmfh0 GjtC/MYysUr201Uh16Idavqek8Npig5nljCZgzX287/j5axrYLrF2M7HLR8sOYIm/7Qz Ja1wJQnxBq9ntKiECuKkmePqnsd/knkZPEt6Z4zdXsUYCIquvl7Rhp75793vEvwQQH69 1xFN4jUSTWzXxVF5BdNgaRpNh/rmie9Wxrq2W/dnetCgsFIr6F2vImEiHDlN1ELRZuYm B4+Q== X-Forwarded-Encrypted: i=1; AJvYcCUljejGkXIrAC6eLIGaMQqDfA1uIinW51pqHj0+Y2I+ITaeWHAPL7GSYEXGyROQXtCM2j8C++V272ML0pk=@vger.kernel.org, AJvYcCWlFjYZM9WD5PS7kzS6tBbbLR9aI3Cnyl3uxBagU7JWUpGxvmWyEdK570HpkPfTCknwqn1GDIMGSa6punF54l2lsRU=@vger.kernel.org X-Gm-Message-State: AOJu0YxsmeV/xZ5XtNbx2PHnQOZZD4Mxw2JZvpmGOwGr9Miz20qL6uYo IsmlQtAHEsyBFxcZDqlrT7uiaN8j6Y/2VYMrx/pKY9JNBPZFM20D X-Google-Smtp-Source: AGHT+IGebAElVIF8QVZ4GEbRR2hEbzxYJuaIpZR5mpONcz6SgWxls1mOSh5nkUiDCOIUQWaOnjEQWA== X-Received: by 2002:a05:600c:450b:b0:426:60b8:d8ba with SMTP id 5b1f17b1804b1-42cad87efc7mr86741475e9.28.1725990864157; Tue, 10 Sep 2024 10:54:24 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2500:a01:94a6:1e64:e5a2:2b2a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37895675c40sm9516562f8f.51.2024.09.10.10.54.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 10:54:23 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH v2 05/16] media: platform: rzg2l-cru: rzg2l-csi2: Implement .get_frame_desc() Date: Tue, 10 Sep 2024 18:53:46 +0100 Message-Id: <20240910175357.229075-6-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar The RZ/G2L CRU requires information about which VCx to process data from, among the four available VCs. To obtain this information, the .get_frame_desc() routine is implemented. This routine, in turn, calls .get_frame_desc() on the remote sensor connected to the CSI2 bridge. Signed-off-by: Lad Prabhakar Reviewed-by: Laurent Pinchart --- .../platform/renesas/rzg2l-cru/rzg2l-csi2.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c index 10b8b0c87c1f..26953499f305 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c @@ -582,6 +582,24 @@ static int rzg2l_csi2_enum_frame_size(struct v4l2_subdev *sd, return 0; } +static int rzg2l_csi2_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, + struct v4l2_mbus_frame_desc *fd) +{ + struct rzg2l_csi2 *csi2 = sd_to_csi2(sd); + struct media_pad *remote_pad; + + if (!csi2->remote_source) + return -ENODEV; + + remote_pad = media_pad_remote_pad_unique(&csi2->pads[RZG2L_CSI2_SINK]); + if (IS_ERR(remote_pad)) { + dev_err(csi2->dev, "can't get source pad of %s (%ld)\n", + csi2->remote_source->name, PTR_ERR(remote_pad)); + return PTR_ERR(remote_pad); + } + return v4l2_subdev_call(csi2->remote_source, pad, get_frame_desc, remote_pad->index, fd); +} + static const struct v4l2_subdev_video_ops rzg2l_csi2_video_ops = { .s_stream = rzg2l_csi2_s_stream, .pre_streamon = rzg2l_csi2_pre_streamon, @@ -593,6 +611,7 @@ static const struct v4l2_subdev_pad_ops rzg2l_csi2_pad_ops = { .enum_frame_size = rzg2l_csi2_enum_frame_size, .set_fmt = rzg2l_csi2_set_format, .get_fmt = v4l2_subdev_get_fmt, + .get_frame_desc = rzg2l_csi2_get_frame_desc, }; static const struct v4l2_subdev_ops rzg2l_csi2_subdev_ops = { From patchwork Tue Sep 10 17:53:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 13799144 X-Patchwork-Delegate: kieran@bingham.xyz Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 00DB61A706A; Tue, 10 Sep 2024 17:54:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990868; cv=none; b=TrrqOuTiE2HU1zRlaacRStDXc24VSaJE/NC3VMVgFZ5GL4SzN9EoB1f2XfHcVLOhADUX56iAj8JViBKtiN7VgTWDKW2M4RORoJDQKP/5NPSzyXIs3pt86lOOEZNr1fptz3OuyV6bgfIZ+Nxm3x4iB4ps6Tt40AauRGflcUix/KA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990868; c=relaxed/simple; bh=rMVzxUxmL/AfHPz6X0c3/OvL4+N9WTRGjvnU6CFagwM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MZmGhUefWP1jEJxaAIabfNM406GK212PbIqIDmh3Lrk19EoTtf7uvuI1tecghiCy6EhD5jWVy/+yim8rvTAL6Ao/nPMPViyENZgcANmnG/7JBw/atF6PtpKewXB4Eg/hs5PsqIGRSu74Koexxz6fikvmsaaGHP8nxMVY/hdYmuc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fksq4a2C; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fksq4a2C" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-428e0d18666so53814545e9.3; Tue, 10 Sep 2024 10:54:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725990865; x=1726595665; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AqTUaY459686Xh1e9Gh+LVLup4oplxjhdBIU+XZ0cUo=; b=fksq4a2CAXctcHXU/E6SsHZK3Xp/O9a9rmgkbQD6rGV+S/yelzYGEnPdx+D4cKf8kF M2ymwkTkm6BGBd368riChVkE3brUs6bd5zpApb3yVxv3kYp0sRhKha5bPvxo/NbzKhq0 POiOqqHocCxFVg1/3Zg2y9byuuCtZq90jZC+52C0XbrZ+O5lQwV+NEyasw74qDtH1TJN vtXtZDN45zmduIFVSjK2pKBJjg+LEuDoz7LopQrEtmUcIPSoOpr2aDgIfKDCiyetpNYJ PnTLHNJnpVKNk8db80HJchkfeI3Y1R5RTh/j8ssFpUXFsfHKu165D5zA1zKDitGf00PE Q7FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725990865; x=1726595665; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AqTUaY459686Xh1e9Gh+LVLup4oplxjhdBIU+XZ0cUo=; b=IQdYaQ4HcaF60Y0M7IKeG57WmeG13m7O45PDOEXzhtbPNWO8uyFr2NmLu+aAXw263C nJIXWX/ZruE+91xkvemW9PMpHcsJHUc1pkQ9ilblFikkI9Oh+BFsyh8OhHo2vDKHsNfu RMhXAnEvzcy6t45vrx3J4oXhRtvANQLryF86INh7S33SMHBU5wuBp0m8F8vnYC2DU8er xZrqYwTcKdKcDYHo9Rkzy1R69Lmk9vDz5o91WL3K683uSKtuPpbsHBTwzKGo4eVi03S8 sSG9udLYsfSSZaXQhaJC1mPCp/IZnl7OLob+bJc2C8eMb9hOq2KOx4UmTk4pLArff3QO XeAQ== X-Forwarded-Encrypted: i=1; AJvYcCV5XZALpQ9awF58z/mdpvtIDwfippQrLOvC+8IoAgoprJULUvMVSpBolKVC35L7USrDBNDpG/j905vGi5w=@vger.kernel.org, AJvYcCWT2ssk8hT0AZLoD3hHSDCufHeV1tnvb3yH1m1ahN1j6TEMxM3239aCC+MRGpC2m/xwCuFmnVawEjjwXOzGHQvtmWw=@vger.kernel.org X-Gm-Message-State: AOJu0YxbUzPD+oVZAfHuJBvNJvx0I9gBDZpA8eCiqwG70rHd6vVY5T1j 3A47AS31QCxQo/UAgYT/nOjjD77RrDWmpd2WAEBiWA8Ubq8bVDDD X-Google-Smtp-Source: AGHT+IEXcvS+bqWHFK+ARpO2uiWOe9AiWkU0x/NXXsTxNqdUUdoodohpICX3TzTI1JsKW9e9dZAD9g== X-Received: by 2002:a5d:6608:0:b0:374:cbe8:6f43 with SMTP id ffacd0b85a97d-37889600838mr8903475f8f.33.1725990865297; Tue, 10 Sep 2024 10:54:25 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2500:a01:94a6:1e64:e5a2:2b2a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37895675c40sm9516562f8f.51.2024.09.10.10.54.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 10:54:24 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH v2 06/16] media: platform: rzg2l-cru: rzg2l-video: Retrieve virtual channel information Date: Tue, 10 Sep 2024 18:53:47 +0100 Message-Id: <20240910175357.229075-7-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar The RZ/G2L CRU needs to configure the ICnMC.VCSEL bits to specify which virtual channel should be processed from the four available VCs. To retrieve this information from the connected subdevice, the .get_frame_desc() function is called. Signed-off-by: Lad Prabhakar Reviewed-by: Laurent Pinchart --- .../platform/renesas/rzg2l-cru/rzg2l-cru.h | 5 +++ .../platform/renesas/rzg2l-cru/rzg2l-ip.c | 5 --- .../platform/renesas/rzg2l-cru/rzg2l-video.c | 34 +++++++++++++++++++ 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-cru.h b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-cru.h index 174760239548..8fbd45c43763 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-cru.h +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-cru.h @@ -31,6 +31,11 @@ #define RZG2L_CRU_MIN_INPUT_HEIGHT 240 #define RZG2L_CRU_MAX_INPUT_HEIGHT 4095 +enum rzg2l_csi2_pads { + RZG2L_CRU_IP_SINK = 0, + RZG2L_CRU_IP_SOURCE, +}; + /** * enum rzg2l_cru_dma_state - DMA states * @RZG2L_CRU_DMA_STOPPED: No operation in progress diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c index db48118fc817..75c3c4f1d10b 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c @@ -18,11 +18,6 @@ static const struct rzg2l_cru_ip_format rzg2l_cru_ip_formats[] = { { .code = MEDIA_BUS_FMT_UYVY8_1X16, .datatype = 0x1e, .bpp = 16 }, }; -enum rzg2l_csi2_pads { - RZG2L_CRU_IP_SINK = 0, - RZG2L_CRU_IP_SOURCE, -}; - static const struct rzg2l_cru_ip_format *rzg2l_cru_ip_code_to_fmt(unsigned int code) { unsigned int i; diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c index bbf4674f888d..7cd33eb1939c 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c @@ -433,12 +433,46 @@ void rzg2l_cru_stop_image_processing(struct rzg2l_cru_dev *cru) spin_unlock_irqrestore(&cru->qlock, flags); } +static int rzg2l_cru_get_virtual_channel(struct rzg2l_cru_dev *cru) +{ + struct v4l2_mbus_frame_desc fd = { }; + struct media_pad *remote_pad; + int ret; + + remote_pad = media_pad_remote_pad_unique(&cru->ip.pads[RZG2L_CRU_IP_SINK]); + ret = v4l2_subdev_call(cru->ip.remote, pad, get_frame_desc, remote_pad->index, &fd); + if (ret < 0 && ret != -ENOIOCTLCMD) { + dev_err(cru->dev, "get_frame_desc failed on IP remote subdev\n"); + return ret; + } + /* If remote subdev does not implement .get_frame_desc default to VC0. */ + if (ret == -ENOIOCTLCMD) + return 0; + + if (fd.type != V4L2_MBUS_FRAME_DESC_TYPE_CSI2) { + dev_err(cru->dev, "get_frame_desc returned invalid bus type %d\n", fd.type); + return -EINVAL; + } + + if (!fd.num_entries) { + dev_err(cru->dev, "get_frame_desc returned zero entries\n"); + return -EINVAL; + } + + return fd.entry[0].bus.csi2.vc; +} + int rzg2l_cru_start_image_processing(struct rzg2l_cru_dev *cru) { struct v4l2_mbus_framefmt *fmt = rzg2l_cru_ip_get_src_fmt(cru); unsigned long flags; int ret; + ret = rzg2l_cru_get_virtual_channel(cru); + if (ret < 0) + return ret; + cru->csi.channel = ret; + spin_lock_irqsave(&cru->qlock, flags); /* Select a video input */ From patchwork Tue Sep 10 17:53:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 13799145 X-Patchwork-Delegate: kieran@bingham.xyz Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4CB571A76CC; Tue, 10 Sep 2024 17:54:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990869; cv=none; b=ZPaXIWRgZnPH/cpFDMVlnQMV+vI3VQikTcLqL8Eqlo6NvQvXszDeUPJiNIptI3zQbu1YrLYOS8FhbLirjCvBsTvkNCau3EHAbtZ1YZumQ0GPQlnVkPUBrR1wbswkZDkqgYoPxqAm4xyqXdm7r6PcCC0+ivuEwRIpKJeLnJBMBPs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990869; c=relaxed/simple; bh=fysTbBluWwxIoblGwfgowX2kfVUVH1+43tNJySTN42s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ezohTmA/o2l9RZuE1VwaQSCg9mqm/bMZMhoVOjUnaTnhRyozqS05Pb6e2KnKugSZy1jdLZH72pA34V1Bq3fq3DPy2o0pXM8EUREX+lTLjik46kN02zzr4+3z5SXJtjYzSM/DlOvddCMuDLcXW5YNFPF6ZMb24KVPy/DwaKdo+2g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ns034Poe; arc=none smtp.client-ip=209.85.167.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ns034Poe" Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-536584f6c84so5961227e87.0; Tue, 10 Sep 2024 10:54:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725990866; x=1726595666; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=s9js1uW4BriZI3v7lrk19RwKKXrIt1Jzw13AJ+bvanI=; b=ns034Poe+6cLqFpJUuszAK1qF57u9N77P1kETCrFP3iJrLgK7YfexbM7HYVLfEhhva sBGMIgXM7fF0IF2unNSLC+DxaQ8R+te6uIelAC6nS4ehUXfHtFNODKv9k11ECtUU5bJ9 thk/z94h5fFXpls13gLJqzyeda+0DonkBbD1BNQrHbI3z+HqrJeEvfabUeyAUzSKsD85 hAA6fU+d2NQ3AvS7W/GIJSZI0RFgtFyhn3EznwpecElaayuhjZ25bM7mWbaF7Jt2IvDJ 421OlpMrS0wiUnyVlMgg0+gcvNNP3c0II43Ucovpn7u2sV0w8BvFUW+lF49jbcKzo2+7 mGEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725990866; x=1726595666; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s9js1uW4BriZI3v7lrk19RwKKXrIt1Jzw13AJ+bvanI=; b=QCWimwi5StmsSqmWQp8of+U9fN0bWrrJACp5ILa7jE57N1XYUoR6MP5gVDTzutJ/0I AW0vettvxO7l2WR5erncsdcHOZt090E8be7RbQFTmjDGv/nQfpoqcUo2BOTr3xMLxikp +zZ9w2xo8rIM6Vitk81uHCSTpMp3i0lufuJ9jWn235kxc+GY1ONz0/aHGMk1HAErxFgK 1r5goVxPMDvsphXy5dxNxPDzli0sMO0y3LE0rznajnwUWGLPfmnC6NbPjeXb/SY3J27J JQFksn8Xk3wZcrpTp4agwquoFzRd0mFpZLmMkmCGvv+7wYqZqiJKNysYamgbN9PA3Jhp HWrw== X-Forwarded-Encrypted: i=1; AJvYcCVXDAeLqwAT7wY3lHN3R631PZGgLiKTpH9sTUKqHKfWSV/xxMwVKUUarQkbE3OZnSW0FJyNv4MOVtdcRcc=@vger.kernel.org, AJvYcCW/9lg2eQfFfcfcclExSZkKjjOCyDTw1xoWydDRhjBnjLrNtlxFd0zGAyHdleuHJnRTuZpsvroCL81aFgzj/leaKhg=@vger.kernel.org X-Gm-Message-State: AOJu0YzH2T4r4yjjBk/Jh4k+VuP3E7kfSwV87fbLBLJTxw6KLV5T8JMk 0ThETjnL6tE4w3o1EaiWYWFuRKknaPwSCsNJlaY2w2VsusGg8rfeTetBqg== X-Google-Smtp-Source: AGHT+IEREf+WU0yRXHL06gqx8AE/VmaRJSZnjgkdg3Xqu0e2wgQkC0P/XTJozFs7x2cnhljfKgQuuw== X-Received: by 2002:a05:6512:2388:b0:536:55ef:69e8 with SMTP id 2adb3069b0e04-5365856ca37mr10504076e87.0.1725990866291; Tue, 10 Sep 2024 10:54:26 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2500:a01:94a6:1e64:e5a2:2b2a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37895675c40sm9516562f8f.51.2024.09.10.10.54.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 10:54:25 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar , Laurent Pinchart Subject: [PATCH v2 07/16] media: platform: rzg2l-cru: Remove `channel` member from `struct rzg2l_cru_csi` Date: Tue, 10 Sep 2024 18:53:48 +0100 Message-Id: <20240910175357.229075-8-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar Remove the CSI virtual channel number from `struct rzg2l_cru_csi`. Instead, pass the CSI virtual channel number as an argument to `rzg2l_cru_csi2_setup()`. Suggested-by: Laurent Pinchart Signed-off-by: Lad Prabhakar Reviewed-by: Laurent Pinchart --- .../media/platform/renesas/rzg2l-cru/rzg2l-core.c | 1 - .../media/platform/renesas/rzg2l-cru/rzg2l-cru.h | 1 - .../media/platform/renesas/rzg2l-cru/rzg2l-video.c | 14 ++++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-core.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-core.c index 69cd45b26951..b21a66e2ce5c 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-core.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-core.c @@ -72,7 +72,6 @@ static int rzg2l_cru_group_notify_complete(struct v4l2_async_notifier *notifier) source->name, sink->name); return ret; } - cru->csi.channel = 0; cru->ip.remote = cru->csi.subdev; /* Create media device link between CRU IP <-> CRU OUTPUT */ diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-cru.h b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-cru.h index 8fbd45c43763..4fe24bdde5b2 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-cru.h +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-cru.h @@ -53,7 +53,6 @@ enum rzg2l_cru_dma_state { struct rzg2l_cru_csi { struct v4l2_async_connection *asd; struct v4l2_subdev *subdev; - u32 channel; }; struct rzg2l_cru_ip { diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c index 7cd33eb1939c..9ab7ef33c9da 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c @@ -301,7 +301,7 @@ static void rzg2l_cru_initialize_axi(struct rzg2l_cru_dev *cru) } static void rzg2l_cru_csi2_setup(struct rzg2l_cru_dev *cru, bool *input_is_yuv, - struct v4l2_mbus_framefmt *ip_sd_fmt) + struct v4l2_mbus_framefmt *ip_sd_fmt, u8 csi_vc) { u32 icnmc; @@ -319,19 +319,20 @@ static void rzg2l_cru_csi2_setup(struct rzg2l_cru_dev *cru, bool *input_is_yuv, icnmc |= (rzg2l_cru_read(cru, ICnMC) & ~ICnMC_INF_MASK); /* Set virtual channel CSI2 */ - icnmc |= ICnMC_VCSEL(cru->csi.channel); + icnmc |= ICnMC_VCSEL(csi_vc); rzg2l_cru_write(cru, ICnMC, icnmc); } static int rzg2l_cru_initialize_image_conv(struct rzg2l_cru_dev *cru, - struct v4l2_mbus_framefmt *ip_sd_fmt) + struct v4l2_mbus_framefmt *ip_sd_fmt, + u8 csi_vc) { bool output_is_yuv = false; bool input_is_yuv = false; u32 icndmr; - rzg2l_cru_csi2_setup(cru, &input_is_yuv, ip_sd_fmt); + rzg2l_cru_csi2_setup(cru, &input_is_yuv, ip_sd_fmt, csi_vc); /* Output format */ switch (cru->format.pixelformat) { @@ -466,12 +467,13 @@ int rzg2l_cru_start_image_processing(struct rzg2l_cru_dev *cru) { struct v4l2_mbus_framefmt *fmt = rzg2l_cru_ip_get_src_fmt(cru); unsigned long flags; + u8 csi_vc; int ret; ret = rzg2l_cru_get_virtual_channel(cru); if (ret < 0) return ret; - cru->csi.channel = ret; + csi_vc = ret; spin_lock_irqsave(&cru->qlock, flags); @@ -489,7 +491,7 @@ int rzg2l_cru_start_image_processing(struct rzg2l_cru_dev *cru) rzg2l_cru_initialize_axi(cru); /* Initialize image convert */ - ret = rzg2l_cru_initialize_image_conv(cru, fmt); + ret = rzg2l_cru_initialize_image_conv(cru, fmt, csi_vc); if (ret) { spin_unlock_irqrestore(&cru->qlock, flags); return ret; From patchwork Tue Sep 10 17:53:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 13799146 X-Patchwork-Delegate: kieran@bingham.xyz Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E8C981A76DC; Tue, 10 Sep 2024 17:54:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990870; cv=none; b=bQRZRnH9fNm311EMxJVD4nE3OawqrEdz9ztKObSezetMN4MEl2aVWV3tpI+GhxW47sb88/YeD+OHVK/f2w0ASOJTe0TOIdLiYPyu3JQQWiiBmLCMq5jYcYrY2R4MpUh0anIT+dwdbvHUPdb9YaFZv1RLbr47fdnkIG73IjzfXaU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990870; c=relaxed/simple; bh=IIZrxqBWpBualEucrvRbwq/W4kMtlIGisufKS9Y7Gp4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tkOWMP3silBX1urQdUUN5xpmMMRBsI0nwLNDPBK0d1oJDRQ6Hu/15pzDivvR9z3SPi+BOeGvLTSnVPYV8mxOaeNpW38FJS85V96xDqn2FcgBFLUYZVNB43zlgL0oObsikRfB3viJav/mIx4afvRSPPjSpNmHWjC7Oi0LtnmqhK0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=IM71dfND; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IM71dfND" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-374ba78f192so3515133f8f.3; Tue, 10 Sep 2024 10:54:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725990867; x=1726595667; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=d3MIdF05wW2BMzr5XjwUwLKKt7kk8kOEADyH/19j9Ew=; b=IM71dfNDKP1y2Yb8SLWYrBe5gx1dvbOk1XqEXDTOAt2Ems8zA185KUCYOTgTq2/QMx nnQGU/grZVe6WBxMv9zYgcVlj1OoOZG05g+s8IEz0S/h1xIKjaPALD6AKWmSi3dMqVxA xRSu/p95loHma4Wds8PrcT9Zgm562fb47B7l92PuTtsTULYGlibWvKbp5bpEaSF76WO2 dIahubXB95BV9V8pxS0fwEGJEB8WgLH9Z8AsFe/W3LPKhbsez6iNPFVdMzMUgt6B07mR 0a3uuUHADGFo3MLiXTzBdB7mQQV28hL9J09QinYpV/3UCYdKlp6QErRzdYRe7zqrqB00 TvwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725990867; x=1726595667; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d3MIdF05wW2BMzr5XjwUwLKKt7kk8kOEADyH/19j9Ew=; b=NYg3MFIjlIvHHMDkoqOclm4qhkqPrVK3I0vXoJ/o0shfUHSSL0SiHvZyBwidILFg0L Eg6ooNcjhP+gfD4tbAwSOW9s6qT/gbcwDt1zhewDKCAY7UXeWpwDWCNrUH9BdJsGlIk6 +i1IgQ3fYFwjv20yylWgekieZsuO+uccy3VZlSHB0oOCYm2IHGnuFeqtIbj+FsqgK+W9 mGqgfN2a7FSh79S7bT4C7ylUn+NZZzpJji5gh3D6ZT4ZypD+e3LvTHUMrIoWHBwjpOxG qBy5PK1jDtiWglnA/n+rvx9XwtQ5HS4/oq0OGgq3PegBW3qMCaw6ISjZdWHGi61VWNyH CzVA== X-Forwarded-Encrypted: i=1; AJvYcCVuSN4WjPFfShrgtKkhkEUJfXBGBiTtuPe92Tz9OwnSekwDk4Wr7cTctQ2rT0fZh+GepzSmD6I1X7pcCv6ErAE9paU=@vger.kernel.org, AJvYcCVxCYqj1YyRGCRTrPWgGJxApCgIcai5aAOOwVe4oW2nQoaRxm88HGSx84ZHBC3V9ifldY9FqEGtoMmGiXI=@vger.kernel.org X-Gm-Message-State: AOJu0Yx5fUXp8+phorsJTUgj0CqhCtIfyF6jg7mNDPzN5W9hBmyO0jd0 zL2/BJgXs/j8oNbemhpctvoraTsssfLI0uLdaSoEG2q6PXDuFN0q X-Google-Smtp-Source: AGHT+IHfXa1uX/7zmxiU2yW7apAdq8ipHyEjW/mGfPuhcxNrc5qH8g9KEcjq0Hyw1J5tdPivVCGKuA== X-Received: by 2002:a05:6000:a8e:b0:371:8dcc:7f9f with SMTP id ffacd0b85a97d-378895c5343mr9965437f8f.5.1725990867275; Tue, 10 Sep 2024 10:54:27 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2500:a01:94a6:1e64:e5a2:2b2a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37895675c40sm9516562f8f.51.2024.09.10.10.54.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 10:54:26 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar , Laurent Pinchart Subject: [PATCH v2 08/16] media: platform: rzg2l-cru: rzg2l-video: Use MIPI CSI-2 data types for ICnMC_INF definitions Date: Tue, 10 Sep 2024 18:53:49 +0100 Message-Id: <20240910175357.229075-9-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar The INF field in the ICnMC register accepts data type codes as specified in the MIPI CSI-2 v2.1 specification. This patch introduces the `ICnMC_INF()` macro to use the MIPI CSI-2 data types, which are available in the `media/mipi-csi2.h` header. Suggested-by: Laurent Pinchart Signed-off-by: Lad Prabhakar Reviewed-by: Laurent Pinchart --- drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c index 9ab7ef33c9da..de88c0fab961 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c @@ -15,6 +15,7 @@ #include #include +#include #include #include @@ -77,8 +78,7 @@ /* CRU Image Processing Main Control Register */ #define ICnMC 0x208 #define ICnMC_CSCTHR BIT(5) -#define ICnMC_INF_YUV8_422 (0x1e << 16) -#define ICnMC_INF_USER (0x30 << 16) +#define ICnMC_INF(x) ((x) << 16) #define ICnMC_VCSEL(x) ((x) << 22) #define ICnMC_INF_MASK GENMASK(21, 16) @@ -307,12 +307,12 @@ static void rzg2l_cru_csi2_setup(struct rzg2l_cru_dev *cru, bool *input_is_yuv, switch (ip_sd_fmt->code) { case MEDIA_BUS_FMT_UYVY8_1X16: - icnmc = ICnMC_INF_YUV8_422; + icnmc = ICnMC_INF(MIPI_CSI2_DT_YUV422_8B); *input_is_yuv = true; break; default: *input_is_yuv = false; - icnmc = ICnMC_INF_USER; + icnmc = ICnMC_INF(MIPI_CSI2_DT_USER_DEFINED(0)); break; } From patchwork Tue Sep 10 17:53:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 13799147 X-Patchwork-Delegate: kieran@bingham.xyz Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 259221AAE06; Tue, 10 Sep 2024 17:54:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990871; cv=none; b=pn5zkr1GILO6MM4zRJxaHHLbZigOYV94ozb34AD1DdxCiAjPND0g4+BtFI+xI+SZIiqXv9JZQBJK3Rh1r3oyTVhC1zz3k4XoD7SK7RYFsKuz1uOyu2S7jEnylyLBdgNYlA1EUi6yjvOR3CAM9AoEYwX28wEkIIoQOTZd+Sj6Kl8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990871; c=relaxed/simple; bh=GAchrra7cBIPbaolDy57nyAS/mV1eysPmaNOwAM6jH4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SGf1Z4I60WjxjL8al5UPn/IFMWnXEBNhhz18ha+FP2WRimNzVzjsu6ZvneDIijCtNN3SNbfG3y54SPqNFkBF+8p3iG8awwfDMVdqLOXhO+ZTC27/lHxTZPI992CPGKIzqDChXD5Hf5TZXUv+SuXKP0D3xND+f0O4TluZNynw3ek= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HNdDo7/6; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HNdDo7/6" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-42cc8782869so5576695e9.2; Tue, 10 Sep 2024 10:54:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725990868; x=1726595668; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8eb7BD17LCmNaoJhN3opCdJu2nnbqNIwLCYHoL7PxQA=; b=HNdDo7/6ruoO2yElZtbDOzxbWrOVbii/ZHUQmfGJkit7y73fS79IiChydr4wZWCewZ LBzICeDJ20U7/hCu9sVGzzDZXPUbDJSwerNcxgd6I468z/iP4W09gCwZIYF2GIrum/9o LNiyVByE5pSnaWYacL1gC+1/zAHnU6ltvuSG47/xkFZLyTPbESdffNOJtHV4+5Y01W3V xqF7/sDx4IXQwd2MIVScBy7qZc/4H3F4aXhISaSOFoL8HwfqrkFwsYJm8FPiBk2jmE17 ItlpLbGnKx1kdjuSL2mzjeBFW9vf5k3zRxDB8K+K7hm8Yb7E01o0pTSH7ZmL1bvk4kIJ Vyww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725990868; x=1726595668; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8eb7BD17LCmNaoJhN3opCdJu2nnbqNIwLCYHoL7PxQA=; b=XI4pKAmofUJoW2fT8fzqrybJjKCJhl3YK9RReR/yPbEE5JkHHwZWzIbtHeDY1tIe6U ngHFayBI5njirGC6QUBwPaM23VA0WQCDaVPLbboGiymHvlIk9bk2YcWrbbLT9nkIhQZG nnWa8Lxl6DnWbJP0lLHmtukPQgcR+AE3y0vzUojCtlHb+wbGoKAF9ZKzEEG8EaXLTAB5 2myd3X6ejibE1tpOXlSQBeUMwJ0HtNajB/rZQ34A1yOt6Yan0mIOJNe1mrucDVtdHIjz eCJONzAwamUKtJzHvJ064qcWyIdUP/RGw1ynsU97jZ6FeC69c03m4Gn8M5WhM5MsASrX i6TA== X-Forwarded-Encrypted: i=1; AJvYcCWIazmy8Pm4UfOiNw4OEpW2xRCelOaOChHqiPENlIRqFxvAy+msXhnTSeuCWpVW04MHRtqvNSv0/LGF0J0=@vger.kernel.org, AJvYcCXLOqxeQoRz96ismJ6KZlE/5W758DfeSL9h2ZFPRTMRA7MrBUBqS/kOq2IYIHdwGa3wVSd0H8RznlUbGhmCIyGam00=@vger.kernel.org X-Gm-Message-State: AOJu0YxDNWkwktxRFMVPQZ90K6V8O64GFu/YUPHmjVOKFo4J4PwcQg78 NKUEWFb7tKulHUjx53+6lw4abU/f6EDd3pWbLw+D1iXTIq6L89zR X-Google-Smtp-Source: AGHT+IFt2YMGh/r3azisUtR7nf0IrOhVuhOOVgrp5AtMbiIlqgL9J5NthytTEKYIOAUxEFeTGqDqog== X-Received: by 2002:a5d:440a:0:b0:368:3731:1613 with SMTP id ffacd0b85a97d-378b07a5051mr345026f8f.13.1725990868536; Tue, 10 Sep 2024 10:54:28 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2500:a01:94a6:1e64:e5a2:2b2a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37895675c40sm9516562f8f.51.2024.09.10.10.54.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 10:54:27 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH v2 09/16] media: platform: rzg2l-cru: Remove unused fields from rzg2l_cru_ip_format struct Date: Tue, 10 Sep 2024 18:53:50 +0100 Message-Id: <20240910175357.229075-10-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar Simplified the `rzg2l_cru_ip_format` struct by removing the unused `datatype` and `bpp` fields from the structure in `rzg2l-ip.c`. Signed-off-by: Lad Prabhakar Reviewed-by: Laurent Pinchart --- drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c index 75c3c4f1d10b..cc297e137f3e 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c @@ -10,12 +10,10 @@ struct rzg2l_cru_ip_format { u32 code; - unsigned int datatype; - unsigned int bpp; }; static const struct rzg2l_cru_ip_format rzg2l_cru_ip_formats[] = { - { .code = MEDIA_BUS_FMT_UYVY8_1X16, .datatype = 0x1e, .bpp = 16 }, + { .code = MEDIA_BUS_FMT_UYVY8_1X16, }, }; static const struct rzg2l_cru_ip_format *rzg2l_cru_ip_code_to_fmt(unsigned int code) From patchwork Tue Sep 10 17:53:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 13799148 X-Patchwork-Delegate: kieran@bingham.xyz Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ADC6D1AB502; Tue, 10 Sep 2024 17:54:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990873; cv=none; b=TCuMvR9vWF0coYmfArUb59LJoqrgMP6XJlgZs/laMN4+N9VVCRa5wlxWY7ubTyYgM7eiK1rD/Iyttl4ni3DqxezrigDgZ/9kEO291sEgt6c+HekBpPh1plgKAvPJUXJiAXqd1DSXp/L322dug5k4BgMUvMp28hJd3kuXRCBZ0bk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990873; c=relaxed/simple; bh=ECKbYASNIC0ZAqt/EshKY0e3wAJyaGWoWbbT4UY/AI0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ivK8ZN8fizqT4vjfpbPxIc9sqZUlR/8P9Pu+fk46UEtNP/lKdgxs62H+jrr+VigpE6ZgiIrvJ0lybfFqtb4GsKKjZYheXp+8oGz47V4Hfp80MgJdciRuH8Db6+h22wNtzqq2XbxOXjBBE+fKS9BK2GcxEz9SfU2dN2JMt+YubjQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FVwzqveA; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FVwzqveA" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-428e1915e18so49992545e9.1; Tue, 10 Sep 2024 10:54:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725990870; x=1726595670; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Msje048Z+e5hW9A6nOJl8RR5mB2zk5tG570BFows/LY=; b=FVwzqveAbNAjXfB1FxJI/N13hnXNhL+NiPjHw475sorswY8p0/spnpZrFeY5Eqye+J Km7lj76Rm7I04iEAe4aZadbukxPRUitR1BykvBJyjBuz0B+K44ctxWUeSd/TVLbwGIZc H6fN6X0yHCurr2O0uHIJzciH7byIC9WIm4vnRMaI884SLHDs8+pexb5xWzqGsZjguyXm G0UC4EHueWRXMKsnzh8KKJ99kxnVQPt5UgNHQBssh7KVGlKbawLw5qyAIpuUPnhleSPQ /OlDQsoZIu89WJrS+UQhltPAELx/uzynrvChGgrRiQt8r9Q4LcI411ME+Bv48h9OlNHB CWdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725990870; x=1726595670; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Msje048Z+e5hW9A6nOJl8RR5mB2zk5tG570BFows/LY=; b=WAAWbXccPAO7Jzf4h0bujnsEAz+XAv268dadOuu85XYLhD+mwCaZilzqQJzRCULHit 3srKPpHEkHx6sin4W22QlDAMwlIcjcZHFZwDERdG0sUTj1kV1RDitjvMOTL1YROguVPL N0323bL804FLE0yvbxD8fya6IHLPAlZiR1WEgwO19QCIizJWICO7UToDYReYJSdh/i7B HlC1M0BOe1sJwj6ZGvPZ3Tx4zoMAhGXRVmmkz56SXYyzSvwPAD1PfvsThqRhXl7JXQKh uk9GRG2Tc2RLLVWO9FfzRCouOQ31J1fYnw4Tk4jzaqj7DdwRy2Wq3nGze5ppKuJ5EydA xR8w== X-Forwarded-Encrypted: i=1; AJvYcCWr13vGQdM3T6VV6i3mzVuYznJOSuSl4/3H9zQg4w5LpacJLl3pdjAJnzYyR0gKc5MObIawty9fq6ZD9MA=@vger.kernel.org, AJvYcCX6B1mZR54DAbIpt1IcKdEgC7hzOko5TD+S/MszGMO5eUt4HDZw/ftkDh1zozpunJZAuLsy9VAfUDujj34bbop8fSo=@vger.kernel.org X-Gm-Message-State: AOJu0YxW1T4xnpTp/d7jfWA7A0K5WoKo/sRzxFbIBdreX19uKAaiWgUq I5Dl6VesojLovcd+UqGtolTMAexmoIWrmdvgsi1NLArNmZvccm5JX4bIvw== X-Google-Smtp-Source: AGHT+IGgSaRZU+W2fP4Cg9IX+mu5pLOo9YTvMr46JPHadZJn3BBxiuVfkRgNsQRx26i2SXOdsuqsNA== X-Received: by 2002:a5d:558f:0:b0:36b:bb84:33e2 with SMTP id ffacd0b85a97d-378896a3fb0mr10127547f8f.37.1725990869968; Tue, 10 Sep 2024 10:54:29 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2500:a01:94a6:1e64:e5a2:2b2a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37895675c40sm9516562f8f.51.2024.09.10.10.54.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 10:54:29 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar , Laurent Pinchart Subject: [PATCH v2 10/16] media: platform: rzg2l-cru: Simplify handling of supported formats Date: Tue, 10 Sep 2024 18:53:51 +0100 Message-Id: <20240910175357.229075-11-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar Refactor the handling of supported formats in the RZ/G2L CRU driver by moving the `rzg2l_cru_ip_format` struct to the common header to allow reuse across multiple files and adding pixelformat and bpp members to it. This change centralizes format handling, making it easier to manage and extend. - Moved the `rzg2l_cru_ip_format` struct to `rzg2l-cru.h` for better accessibility. - Added format, datatype and bpp members to `rzg2l_cru_ip_format` struct - Dropped rzg2l_cru_formats - Introduced helper functions `rzg2l_cru_ip_code_to_fmt()`, `rzg2l_cru_ip_pix_fmt_to_bpp()`, and `rzg2l_cru_ip_index_to_pix_fmt()` to streamline format lookups. - Refactored the `rzg2l_cru_csi2_setup` and format alignment functions to utilize the new helpers. Suggested-by: Laurent Pinchart Signed-off-by: Lad Prabhakar --- .../platform/renesas/rzg2l-cru/rzg2l-cru.h | 20 +++++- .../platform/renesas/rzg2l-cru/rzg2l-ip.c | 35 +++++++-- .../platform/renesas/rzg2l-cru/rzg2l-video.c | 71 +++++++------------ 3 files changed, 72 insertions(+), 54 deletions(-) diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-cru.h b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-cru.h index 4fe24bdde5b2..24097df14881 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-cru.h +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-cru.h @@ -62,6 +62,20 @@ struct rzg2l_cru_ip { struct v4l2_subdev *remote; }; +/** + * struct rzg2l_cru_ip_format - CRU IP format + * @code: Media bus code + * @format: 4CC format identifier (V4L2_PIX_FMT_*) + * @datatype: MIPI CSI2 data type + * @bpp: bytes per pixel + */ +struct rzg2l_cru_ip_format { + u32 code; + u32 format; + u32 datatype; + u8 bpp; +}; + /** * struct rzg2l_cru_dev - Renesas CRU device structure * @dev: (OF) device @@ -144,10 +158,12 @@ int rzg2l_cru_video_register(struct rzg2l_cru_dev *cru); void rzg2l_cru_video_unregister(struct rzg2l_cru_dev *cru); irqreturn_t rzg2l_cru_irq(int irq, void *data); -const struct v4l2_format_info *rzg2l_cru_format_from_pixel(u32 format); - int rzg2l_cru_ip_subdev_register(struct rzg2l_cru_dev *cru); void rzg2l_cru_ip_subdev_unregister(struct rzg2l_cru_dev *cru); struct v4l2_mbus_framefmt *rzg2l_cru_ip_get_src_fmt(struct rzg2l_cru_dev *cru); +const struct rzg2l_cru_ip_format *rzg2l_cru_ip_code_to_fmt(unsigned int code); +u8 rzg2l_cru_ip_pix_fmt_to_bpp(u32 format); +int rzg2l_cru_ip_index_to_pix_fmt(u32 index); + #endif diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c index cc297e137f3e..2d3b985b7b0d 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c @@ -6,17 +6,21 @@ */ #include -#include "rzg2l-cru.h" -struct rzg2l_cru_ip_format { - u32 code; -}; +#include + +#include "rzg2l-cru.h" static const struct rzg2l_cru_ip_format rzg2l_cru_ip_formats[] = { - { .code = MEDIA_BUS_FMT_UYVY8_1X16, }, + { + .code = MEDIA_BUS_FMT_UYVY8_1X16, + .format = V4L2_PIX_FMT_UYVY, + .datatype = MIPI_CSI2_DT_YUV422_8B, + .bpp = 2, + }, }; -static const struct rzg2l_cru_ip_format *rzg2l_cru_ip_code_to_fmt(unsigned int code) +const struct rzg2l_cru_ip_format *rzg2l_cru_ip_code_to_fmt(unsigned int code) { unsigned int i; @@ -27,6 +31,25 @@ static const struct rzg2l_cru_ip_format *rzg2l_cru_ip_code_to_fmt(unsigned int c return NULL; } +u8 rzg2l_cru_ip_pix_fmt_to_bpp(u32 format) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(rzg2l_cru_ip_formats); i++) + if (rzg2l_cru_ip_formats[i].format == format) + return rzg2l_cru_ip_formats[i].bpp; + + return 0; +} + +int rzg2l_cru_ip_index_to_pix_fmt(u32 index) +{ + if (index >= ARRAY_SIZE(rzg2l_cru_ip_formats)) + return -EINVAL; + + return rzg2l_cru_ip_formats[index].format; +} + struct v4l2_mbus_framefmt *rzg2l_cru_ip_get_src_fmt(struct rzg2l_cru_dev *cru) { struct v4l2_subdev_state *state; diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c index de88c0fab961..014c0ff2721b 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c @@ -300,21 +300,10 @@ static void rzg2l_cru_initialize_axi(struct rzg2l_cru_dev *cru) rzg2l_cru_write(cru, AMnAXIATTR, amnaxiattr); } -static void rzg2l_cru_csi2_setup(struct rzg2l_cru_dev *cru, bool *input_is_yuv, - struct v4l2_mbus_framefmt *ip_sd_fmt, u8 csi_vc) +static void rzg2l_cru_csi2_setup(struct rzg2l_cru_dev *cru, u8 csi_vc, + u32 csi2_datatype) { - u32 icnmc; - - switch (ip_sd_fmt->code) { - case MEDIA_BUS_FMT_UYVY8_1X16: - icnmc = ICnMC_INF(MIPI_CSI2_DT_YUV422_8B); - *input_is_yuv = true; - break; - default: - *input_is_yuv = false; - icnmc = ICnMC_INF(MIPI_CSI2_DT_USER_DEFINED(0)); - break; - } + u32 icnmc = ICnMC_INF(csi2_datatype); icnmc |= (rzg2l_cru_read(cru, ICnMC) & ~ICnMC_INF_MASK); @@ -328,17 +317,23 @@ static int rzg2l_cru_initialize_image_conv(struct rzg2l_cru_dev *cru, struct v4l2_mbus_framefmt *ip_sd_fmt, u8 csi_vc) { - bool output_is_yuv = false; - bool input_is_yuv = false; + const struct v4l2_format_info *src_finfo, *dst_finfo; + const struct rzg2l_cru_ip_format *cru_ip_fmt; u32 icndmr; - rzg2l_cru_csi2_setup(cru, &input_is_yuv, ip_sd_fmt, csi_vc); + cru_ip_fmt = rzg2l_cru_ip_code_to_fmt(ip_sd_fmt->code); + if (!cru_ip_fmt) + return -EINVAL; + + rzg2l_cru_csi2_setup(cru, csi_vc, cru_ip_fmt->datatype); + + src_finfo = v4l2_format_info(cru_ip_fmt->format); + dst_finfo = v4l2_format_info(cru->format.pixelformat); /* Output format */ switch (cru->format.pixelformat) { case V4L2_PIX_FMT_UYVY: icndmr = ICnDMR_YCMODE_UYVY; - output_is_yuv = true; break; default: dev_err(cru->dev, "Invalid pixelformat (0x%x)\n", @@ -347,7 +342,7 @@ static int rzg2l_cru_initialize_image_conv(struct rzg2l_cru_dev *cru, } /* If input and output use same colorspace, do bypass mode */ - if (output_is_yuv == input_is_yuv) + if (v4l2_is_format_yuv(src_finfo) && v4l2_is_format_yuv(dst_finfo)) rzg2l_cru_write(cru, ICnMC, rzg2l_cru_read(cru, ICnMC) | ICnMC_CSCTHR); else @@ -810,35 +805,16 @@ int rzg2l_cru_dma_register(struct rzg2l_cru_dev *cru) /* ----------------------------------------------------------------------------- * V4L2 stuff */ - -static const struct v4l2_format_info rzg2l_cru_formats[] = { - { - .format = V4L2_PIX_FMT_UYVY, - .bpp[0] = 2, - }, -}; - -const struct v4l2_format_info *rzg2l_cru_format_from_pixel(u32 format) -{ - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(rzg2l_cru_formats); i++) - if (rzg2l_cru_formats[i].format == format) - return rzg2l_cru_formats + i; - - return NULL; -} - static u32 rzg2l_cru_format_bytesperline(struct v4l2_pix_format *pix) { - const struct v4l2_format_info *fmt; + u8 bpp; - fmt = rzg2l_cru_format_from_pixel(pix->pixelformat); + bpp = rzg2l_cru_ip_pix_fmt_to_bpp(pix->pixelformat); - if (WARN_ON(!fmt)) - return -EINVAL; + if (WARN_ON(!bpp)) + return 0; - return pix->width * fmt->bpp[0]; + return pix->width * bpp; } static u32 rzg2l_cru_format_sizeimage(struct v4l2_pix_format *pix) @@ -849,7 +825,7 @@ static u32 rzg2l_cru_format_sizeimage(struct v4l2_pix_format *pix) static void rzg2l_cru_format_align(struct rzg2l_cru_dev *cru, struct v4l2_pix_format *pix) { - if (!rzg2l_cru_format_from_pixel(pix->pixelformat)) + if (!rzg2l_cru_ip_pix_fmt_to_bpp(pix->pixelformat)) pix->pixelformat = RZG2L_CRU_DEFAULT_FORMAT; switch (pix->field) { @@ -941,10 +917,13 @@ static int rzg2l_cru_g_fmt_vid_cap(struct file *file, void *priv, static int rzg2l_cru_enum_fmt_vid_cap(struct file *file, void *priv, struct v4l2_fmtdesc *f) { - if (f->index >= ARRAY_SIZE(rzg2l_cru_formats)) + int ret; + + ret = rzg2l_cru_ip_index_to_pix_fmt(f->index); + if (ret < 0) return -EINVAL; - f->pixelformat = rzg2l_cru_formats[f->index].format; + f->pixelformat = ret; return 0; } From patchwork Tue Sep 10 17:53:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 13799149 X-Patchwork-Delegate: kieran@bingham.xyz Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2B6F1AB535; Tue, 10 Sep 2024 17:54:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990874; cv=none; b=fscyu/5//w+4RTFgkeiePvjEMliRLwsxO0vb2sPuxURHNfteC3xWq60oLuxAJrUViDNLn7x1tNF2l+etipLgcrrRmbUb4Hb7YF7Ud2GMjuV2vcO4EKZ4VKfifCGBZj9ubdJtT/00l6sDPQCgdu6ZvhZNj8z/UsKRJsGHOH3wssQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990874; c=relaxed/simple; bh=mUUW33nU4rnskWaWHErFoUtBXG/2GUtHTWuN/3rZSgg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UXVsCc7kuRZCbUU4Gr15JJRs7I4quxQt1qkXsN4IPMpfqT02qYqL/q1y8IRyTGESwGDo3I704Aoi6wDEIt42CsQFRM13klGBvNddl4k3vycJtwnvROk9QEQ0mKehyPZvi1NmwaqPHjyH5og97ACnVJpuAIXdq9JJoGDWayxMDgE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lN9n49Dk; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lN9n49Dk" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-42cbe624c59so10615905e9.3; Tue, 10 Sep 2024 10:54:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725990871; x=1726595671; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bhIJbgVG4vXLXIA1ruCJBKWynUkQGlZ1u1ic3MfgJss=; b=lN9n49DkEJ0AiL+tfMA/1AQ7HUsJu7uSvSscgpyJqoh9tX8yDRornRUIvZusT1eMgQ aqw+o8C7KT4qWld/aRT6zwa4+zlGUYJ5mTpP2+7/t54KeAFNxzHOPb3gB8bGmYSBzrdm O6+zAYicrYpOh0Vhch93o3/aVakb/5Ct6WGmVvwgaNiBj8uneuwhUnZOD3BjlRhu9aZF cTGJnuChccZ97/rebVgtH1BfxpFmRw7HOTwUsGJ5rKdEABQmUkUBi+E5axKCIrSKRPe/ MYA4ADbX532wGD/18bMGgvw/cIUDnIXgEBh5+GrQGZ9hU6yteBesj0fthEZuFTQ4q6D/ 31Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725990871; x=1726595671; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bhIJbgVG4vXLXIA1ruCJBKWynUkQGlZ1u1ic3MfgJss=; b=ikxUUoXuQ7/A6IQYhBdvJ6UyWETvAypmu4FJyV3u+6715UJlsOn6ZUxv7iXebWSRTc GvIEyCdVfN05sIM/vcAJN1V9a97QGQyFUn5dqhVoA6XSLbvCltzdUCnsPSvS13TXuus7 WWQz3fOsmVREbUN4riPM73h6gRzHTglZlL1SYcuCFPgf2WlSvdNaFzjCGI99UoKMmRQ6 kGo3706u4GU02o7CA+4BTJD6LctcXq0rv0yPAZsIAJ1S+kwKhxdcR+KAsjkaomcA2eUp 2GaJKdLxEC1y5LO7sWVLx7BIiuSBnv0DBBf9OEW20j1rRhmbX+OWudD/wXHoKFr/lDpj Yspw== X-Forwarded-Encrypted: i=1; AJvYcCU5hgdtog0ou8U+q6T9mGbvdICk+auiM10Q2LTt5R9EkpJIq78yFScCl2pxSbe7zl4qekG0dcHZ6SRBzhg=@vger.kernel.org, AJvYcCV/4LoKYzCO82fr81gt3Sa/HMAa1NziYuTzx3y8nTprGA8+SQZciI4ZKnVzYm8QVP898sOsqn1X4uM0MEyatcBpQLQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzwjRXxiMc25UzxVB6BXmrzlO+KOm33nNdwxKhlJrU5XOC0OrJK bwUAbdeOn1ronW3tHsIoO/mKuo9oNM97MQQygPs6n3Mvt9FKROZG X-Google-Smtp-Source: AGHT+IGAf0SNtFSIZWMh6pXRjMc+FPAnuX+FXtORL/hsmUPe4nFy87KLOUnlrSMRLszulawHzrky8A== X-Received: by 2002:a7b:c858:0:b0:42c:af06:71b with SMTP id 5b1f17b1804b1-42caf060978mr80409155e9.28.1725990871288; Tue, 10 Sep 2024 10:54:31 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2500:a01:94a6:1e64:e5a2:2b2a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37895675c40sm9516562f8f.51.2024.09.10.10.54.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 10:54:30 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH v2 11/16] media: platform: rzg2l-cru: rzg2l-ip: Use `rzg2l_cru_ip_formats` array in enum_frame_size callback Date: Tue, 10 Sep 2024 18:53:52 +0100 Message-Id: <20240910175357.229075-12-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar Use the `rzg2l_cru_ip_formats` array in `rzg2l_cru_ip_enum_frame_size()` to validate the index range and format code. Signed-off-by: Lad Prabhakar Reviewed-by: Laurent Pinchart --- drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c index 2d3b985b7b0d..c7bc82bf3f14 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c @@ -162,10 +162,10 @@ static int rzg2l_cru_ip_enum_frame_size(struct v4l2_subdev *sd, struct v4l2_subdev_state *state, struct v4l2_subdev_frame_size_enum *fse) { - if (fse->index != 0) + if (fse->index >= ARRAY_SIZE(rzg2l_cru_ip_formats)) return -EINVAL; - if (fse->code != MEDIA_BUS_FMT_UYVY8_1X16) + if (!rzg2l_cru_ip_code_to_fmt(fse->code)) return -EINVAL; fse->min_width = RZG2L_CRU_MIN_INPUT_WIDTH; From patchwork Tue Sep 10 17:53:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 13799150 X-Patchwork-Delegate: kieran@bingham.xyz Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C3481ABEB8; Tue, 10 Sep 2024 17:54:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990875; cv=none; b=OXH0yXSsYqNKzr64bJ2rIiq64JIeTAJkUWp6jIkdw1ExbAnyu2vVWNoD1oUrzA9pVB9A1Dc4JC9WTt/5zuqiBLmxbcoxv/1RpSd0ud37Mz99V/a3iLc+nAqMQck7cTgEkiGyTtMYDQIvi2C/dZ6lBFhseKIsGYqOaKpPdbtH9jA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990875; c=relaxed/simple; bh=HgxUrMEjYJEKxGpQrDvrI+BfEBoeOYPNDE+sM5Rd/A4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=IQLbNp+RdfPe8F+9OyfiFhQIJ8VZ6dM2/idl+8GL5QyBtJF3Fj6tvRLaLbcieoNCuiFQKZ3lGdqz4RfdJM1FMbkGtPTXX4KdMotAVIkswjeCTiE0D76WGS70HVg4ew3puYQCfv50x7+oLEMDt7tCGoSwjRSbD/5jQjaMyxdSHHA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=e5IDUV1l; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="e5IDUV1l" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-42cae4eb026so35006025e9.0; Tue, 10 Sep 2024 10:54:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725990873; x=1726595673; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OZkhRVGSlIjG6hcNnb+rRSC8GIk4MWOtSnhmErptxVA=; b=e5IDUV1l+WswzLmhXEfYGnMdQfbEcKDg2eyFMoXdmH7gNv+LEgnrsWLoRYfM+XxLPD H9F4VYOuD8wV3XjjpPMfNkTNRLGg1onrP87xLHRFEvqNPXAvinyAgQMKNhscEFmgQz37 lTgicpyZKiUh57u7azQz4o4p4azMMpuIEccQzuCq7d8UwfFcF67ageQb1b15y+05fwf2 1m8swC7Svq6LJZ+QAfJR/TIyOwLNWhrN3he8PumtZPVssEMNpzxQcXpSkU9TdH8tj6/R 570bIQiK7D6kXehEZKtIiEuJP5EEbvicmWw+puM4IV5cgzMb+290w194SurGlknjYYwk Vv9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725990873; x=1726595673; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OZkhRVGSlIjG6hcNnb+rRSC8GIk4MWOtSnhmErptxVA=; b=cnJvvuMDXkdXr4LTXAKceEBR60LEburE959RXEloYl0/m2n2SoRHxEGllHH0MV9gH/ Zw/SMzLwcY60p25uwLqLuLOsl1RgzjiHd6dcVth/efSlSZ/DL4LVYw8w5UVuNNXzkU04 D7bD9p0nRvKlTF1Usu16XpvhusjrJHfqTh+HqAHGb/oP+7HCYln54zR2nd25RLfOR8Yq ROFNN1M14L4tcDX6Tt1cg8WhWND7qL8C1DcMhIGXKpZaRI2klfXXkoHtt4VLFY9Y+6uU D12rHJotYOpv1DLBFG/ag+Tp8sS7ji2Nhu6kvqOTlnj+qlUlyXPz0aQEaIEv+orkcfNd qpRg== X-Forwarded-Encrypted: i=1; AJvYcCVmdmooxYEeUxRw3LLJhafyIdcmYeNL7QnGrZJVfydUi79NlHJOJbFjoG9wsp6IwOTpBpmS3df+gIzAVx7GFYXiTh0=@vger.kernel.org, AJvYcCXn3yZGPsnh16izD867c6+0zL7fPsuptA8Xzx1T+xLiJq+Z89i4tfPq3MXa1UjRte4+Wh7w597fdnnOtuk=@vger.kernel.org X-Gm-Message-State: AOJu0YwlAPJKlMB0aKqk/715GDRHrCRt2Fr4t1mqsDcsb3BSA19bdrV3 AISbGTGZ7+41SFS8NBCIIxCgMWJMilD3D/5/8OOG0xpULkDKz7ZBLBQBcg== X-Google-Smtp-Source: AGHT+IHne6vgu+Q48KyPbWvlLGdYKDfKDm57eEnjd/FOjqqKfHeKD7V7cnECz29kBUHUSN5CnL90Dg== X-Received: by 2002:a05:600c:5102:b0:42c:bbd5:af60 with SMTP id 5b1f17b1804b1-42cbbd5b298mr46602565e9.24.1725990872632; Tue, 10 Sep 2024 10:54:32 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2500:a01:94a6:1e64:e5a2:2b2a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37895675c40sm9516562f8f.51.2024.09.10.10.54.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 10:54:31 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH v2 12/16] media: platform: rzg2l-cru: rzg2l-csi2: Remove unused datatype field from rzg2l_csi2_format Date: Tue, 10 Sep 2024 18:53:53 +0100 Message-Id: <20240910175357.229075-13-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar Remove the unused `datatype` field from the `rzg2l_csi2_format` struct and update the `rzg2l_csi2_formats[]` array to reflect the updated structure. Signed-off-by: Lad Prabhakar Reviewed-by: Laurent Pinchart --- drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c index 26953499f305..79d99d865c1f 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c @@ -183,12 +183,11 @@ static const struct rzg2l_csi2_timings rzg2l_csi2_global_timings[] = { struct rzg2l_csi2_format { u32 code; - unsigned int datatype; unsigned int bpp; }; static const struct rzg2l_csi2_format rzg2l_csi2_formats[] = { - { .code = MEDIA_BUS_FMT_UYVY8_1X16, .datatype = 0x1e, .bpp = 16 }, + { .code = MEDIA_BUS_FMT_UYVY8_1X16, .bpp = 16 }, }; static inline struct rzg2l_csi2 *sd_to_csi2(struct v4l2_subdev *sd) From patchwork Tue Sep 10 17:53:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 13799151 X-Patchwork-Delegate: kieran@bingham.xyz Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 794EC1ABED3; Tue, 10 Sep 2024 17:54:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990877; cv=none; b=tkqbYBCeDoI0wrC0Hbs9YXdKjedV0y4vAflCJapxzDbM+RIzCksBeWTU8uj4RSbwPNIufZHpOdLqTKlSZ+WVFJEkfV0ej4k5ZlntCA4w70HzWIBfzuqXVweS7CgD0pMCyvkl1jTlkqZFPjXnoxmkPLv8bdCg+PFzxx31ciVAnSI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990877; c=relaxed/simple; bh=LHbIuamZvJ39m6siSO+//JcL3iKfPuz4w6P3j65aeGE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mqA4eBs/yU1YwvSFTsh64vIfUvr998gNUxhUY8DZmsu0dsVCl4fCDFTxGgAHn3mJnSe7dyHFFHKOsWRst2PsdpcWk8uD4Blyi5Y2UUoZ9Fhj9QNYbhLUM7PEC7prlgRuDqlG8t/85DWyWnzunOCLQV0OVyHjxcMYyGPfMA3MU/0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=d8lDFRoN; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="d8lDFRoN" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-42cb0f28bfbso10201525e9.1; Tue, 10 Sep 2024 10:54:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725990874; x=1726595674; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=t2XXdUMfe/h0/nnAIkOlqEyRspBx9XBGOkc9nucMT4E=; b=d8lDFRoNtFCihRdAHk6gBeJN/g/+3CA6YfrOCjic8nauu5OAhe4xJnLXbE614Mj2KQ xEUFgYi4yJsDB2XjOx23dk4i5KcE18Kc4zUM1kp/mSjpX8o0xHua63Q/jRrS/l1AzCjX BWjuAzeea7Jmed6PCMjVEna6EY7F9Pg47twIW3fVrDcaa0vzXXdpTOzjGg9idf3iem6/ SXg0e00+GNsC55YXzaIWKr1FpURdUusc91z9najCPkYxwDFiv4FYI9UJtyUZosjZrW3U WyXe3qd1VzQGPgcszbfVqXaqvYwdJYDKtV1hqsKXj3dVgPGXSDYqpSBeNIwAmGErDFoA owOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725990874; x=1726595674; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t2XXdUMfe/h0/nnAIkOlqEyRspBx9XBGOkc9nucMT4E=; b=JNroDvxEIEErNLNbXf5YggmAgS7mAh1wV97H1e5PEQhsvaTX5KnuGmSvye9rRSy06y ZEw3GGUAIwV64UBHvJ+f9N1P+Zn5WQ9jXyvqcrditukR1N+AukdcVgWP7sXmO0+enphP Lw6hnqNZbqhvilh4/GpWCWALkDapqKb8jhyG8F31BTE7Kvkt/gcSSYgIQk2aenCvgpBi ed2dfW4izr4/Dssin2gUKpzfClGztp60eLh5MGnkdoB9hzZPyoR0d/bEYwuo5gFvDSgi L7IMG0GE35bB7p3Yewuww9qS5/KzgMBwiPTlnLC86A1uZoNEP6rUsN/blf52JQZqjHsX foNg== X-Forwarded-Encrypted: i=1; AJvYcCU1Em17wrBFVthepDNRtmTGKMk8/X8j8LO4Nez5WHgcyXN7d1NUGgByeUqN23kHW6rC9wG9JPDcImVsljqqwaS7gt8=@vger.kernel.org, AJvYcCXNbU1uZS9KFhYaNw3VxZQ9/SQ0qpqnXITQLRgNf5KoCIr/lpphutksNVmKGRSesF5yFL/6FP/0fXhpOr0=@vger.kernel.org X-Gm-Message-State: AOJu0Yx7BZMtOjXmJIjDYcqBTaf+wovwBLiFTrJdPJZHi3XOfX9pDjUD 547+02Jf2XGnCy8eFcSLb+Rr3j2um/zzlTV1itUtIkVJ0UP07OZr X-Google-Smtp-Source: AGHT+IG3z1pvsNeSpTUBH5v8tKZXIgo0lCINi5UgVfXyzcAlHyLulNl9We4vCKTqqLIwzmyb/h3tzw== X-Received: by 2002:a05:600c:3109:b0:42c:b9dd:93ee with SMTP id 5b1f17b1804b1-42ccd35fcbemr3554795e9.34.1725990873795; Tue, 10 Sep 2024 10:54:33 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2500:a01:94a6:1e64:e5a2:2b2a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37895675c40sm9516562f8f.51.2024.09.10.10.54.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 10:54:33 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH v2 13/16] media: platform: rzg2l-cru: rzg2l-video: Use rzg2l_cru_ip_code_to_fmt() to validate format Date: Tue, 10 Sep 2024 18:53:54 +0100 Message-Id: <20240910175357.229075-14-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar Utilize `rzg2l_cru_ip_code_to_fmt()` in `rzg2l_cru_mc_validate_format()` to validate whether the format is supported. This change removes the need to manually add new entries when a new format is added to the CRU driver, simplifying the validation process. Signed-off-by: Lad Prabhakar --- drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c index 014c0ff2721b..c32608c557a3 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c @@ -201,12 +201,8 @@ static int rzg2l_cru_mc_validate_format(struct rzg2l_cru_dev *cru, if (v4l2_subdev_call_state_active(sd, pad, get_fmt, &fmt)) return -EPIPE; - switch (fmt.format.code) { - case MEDIA_BUS_FMT_UYVY8_1X16: - break; - default: + if (!rzg2l_cru_ip_code_to_fmt(fmt.format.code)) return -EPIPE; - } switch (fmt.format.field) { case V4L2_FIELD_TOP: From patchwork Tue Sep 10 17:53:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 13799152 X-Patchwork-Delegate: kieran@bingham.xyz Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0B73A1AC441; Tue, 10 Sep 2024 17:54:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990878; cv=none; b=PZVe9bW0/Zss8d0+5NDH53G+MuqcvNIZ/6rQKqgtHTyHneV6zFgiG6S+NEGZXWDH3BKPyNEKk2tKptJtnmj+Apel4COx4MntK0qfp6IC6/cfv49xNNlWvIVUvK8WmLITTRXPeHH/r9E7J+wQCP9nrogegN9eETUWrvBoAc3LFLc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990878; c=relaxed/simple; bh=lzxK5hox+fyZCWiXsxH3re9rjYjo+weB7srtiaRgcAc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=VeBc71isBUHxN0LUS8NkPIIhPn+YnCrCkIdtuKa579+t8DsEOv56grLvwnY5UXsiL9/oyoORj43/wBw4NPNejtghehrkOqIcoCC+ZAXtF1TKxkroBPr89oyh1GfjhkdEVMwEDpuilfWYPrjwUyKeMoTBMwT8VU5Jmm2nrASFW14= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=i33bf+hW; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="i33bf+hW" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-42cbbb1727eso15841635e9.2; Tue, 10 Sep 2024 10:54:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725990875; x=1726595675; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JR/4EdKCW2JPuHwI0LXuWMHFn99oxRnJuLKUXC8slUU=; b=i33bf+hWr2EquchfE0OKvIv5VwCs/anOTcIIUd11CB394wjDq0iCbX2sXhDzfQfs8c vUlnTslddV51mmvsRp6I0x6PAZIBb2Icca3T6b+IVp1rePw+2GWe3M2+CJCTUAmHWHlF +jQKlZ2JI8dvNayO3khAHbz6yE89EJgifaVj6gfN8OWcvE9+96Ey40jHCzE1zawBU/jt snrCGZukELKWCpESJeYM8kcUSD1X/ITC1nNaMRk069zDovhnrr+kq0/M1Bb3kpN1cvdw h7YCGH7LhIjXhcxK5UyspF0U/4jDzoZgziKGjIJ9anMxtMkdO89XHvsYWrcE0GnylBAi 9NVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725990875; x=1726595675; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JR/4EdKCW2JPuHwI0LXuWMHFn99oxRnJuLKUXC8slUU=; b=PQI0Z6Ve7j9a1glN/sJJgPy8a7TaM34ZqYI0zp3o2f2fNN8vDIxBLQ2oAxGrz8/2D5 gUAE8JLZ5wwXsU0Xg7K5rAR2hhvBAyICzQaVGcRyunefjuvQJnUOJFNzZVbWtRCIQuxA dMmXywRu2YHTaDqMDB+7a7eXkUyg2bvHDEqEuf1//VfTtA1YuBedCIZUOkAew9Hkp66V 9eme4ckCriUyrSb9tjI/3LJZYjuv8SePDEFL8COiJ55vLXj43yjMpSju0PM1BDM7P3UR U17IkFviIQzlmGCG/LFslfvnr4Hig0+NCmmNysWKbASEK+HR22+fMJ75tuI34PnXWYZb SeFA== X-Forwarded-Encrypted: i=1; AJvYcCVcaUT8JbZzWCqYJov1SJ+V6fbVtsewFERDiCp3X3QYQpHRS/8Ah6HC6YIkiIEAFLNJfPJP6xEtDlze2CB8tXuX38c=@vger.kernel.org, AJvYcCX2FF7UlanOhP0r+vme29tH8mnuXNVkAP5GHpHU8yUhgb+A0eD920NZGqI8T9jNveW2gZpSS7vQeVQcq2c=@vger.kernel.org X-Gm-Message-State: AOJu0YwF6tJUktOL8wowZQf+1seG20WmzvO6pzuNmQe/Huz44eU/j65s E2MieIo1uAW26IIrLtRm9TUu7gfVa7ixOgjuUEWzVEhW33n2ihIO X-Google-Smtp-Source: AGHT+IFYZH84e0tZw3pG2lJ71J8xunccgPaGCV1llsfHpV97rKTU7vYBkqS/0r2FprXfgbqf6oKBpw== X-Received: by 2002:a05:600c:1d15:b0:42c:b9a5:ebbc with SMTP id 5b1f17b1804b1-42cb9a5ee47mr48778205e9.16.1725990875347; Tue, 10 Sep 2024 10:54:35 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2500:a01:94a6:1e64:e5a2:2b2a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37895675c40sm9516562f8f.51.2024.09.10.10.54.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 10:54:34 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH v2 14/16] media: platform: rzg2l-cru: rzg2l-csi2: Make use of rzg2l_csi2_formats array in rzg2l_csi2_enum_frame_size() Date: Tue, 10 Sep 2024 18:53:55 +0100 Message-Id: <20240910175357.229075-15-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar Make use `rzg2l_csi2_formats` array in rzg2l_csi2_enum_frame_size(). Signed-off-by: Lad Prabhakar Reviewed-by: Laurent Pinchart --- drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c index 79d99d865c1f..e630283dd1f1 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c @@ -570,7 +570,10 @@ static int rzg2l_csi2_enum_frame_size(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_frame_size_enum *fse) { - if (fse->index != 0) + if (fse->index >= ARRAY_SIZE(rzg2l_csi2_formats)) + return -EINVAL; + + if (!rzg2l_csi2_code_to_fmt(fse->code)) return -EINVAL; fse->min_width = RZG2L_CSI2_MIN_WIDTH; From patchwork Tue Sep 10 17:53:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 13799153 X-Patchwork-Delegate: kieran@bingham.xyz Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 038621AC893; Tue, 10 Sep 2024 17:54:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990879; cv=none; b=hsxaVCAggg1seI5seuKmP5+bi4Rp+/q481bIQQg8zVOoBJ+7jKo+TVGY6aYSJCwIerIBX/hPAms6IkbJNIxWmMvkUq/qG0ryEOojRtEhcRBssxtvtUyvskOaIiY/sUpvhoCQp+sADIWsMk23v2MQd5iuRFFaRnhIaq5YO0f78U8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990879; c=relaxed/simple; bh=92PJWxvu4hdjFtUY0RAGxCc3sRYdFrmtVdbPoU8oJtM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=vA37ENe03ltF6CpKV9yYP9iDI+2U4QAdiomV0ub/jSFojDl1oO6QmcyeS9r5yeWROKRtJfjdCXa5H1bwtO4nD7jVF5U8dljuGw/lwM9PfkE2Y8EY9s8Gb8qrv26tK6iQIzMcLPztLHFosqrLEeJ4BNheOkde0UA/Tcn6S3PaWQ8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eopbo3p4; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eopbo3p4" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-428e0d18666so53816565e9.3; Tue, 10 Sep 2024 10:54:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725990876; x=1726595676; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Q1FDqmmVAFWYeiOLy22eo1C5cXTJQk9ZLPSgkByFFAc=; b=eopbo3p4JiW5YPJ18/8W1fg3EyZ0I6YyC0bMThbfyRF5TmaKs/dzHSSrPb1k22cxRN e5ACf5XsQMzXw02I158b1mJygt/uhgCcfyPTwHRZb1KXvGuwHY1kx+PkYy3CBmhFhSvp xx6WUnTOFjkNWZDyf82K3dY6RevPs2zbrCjOgrfP7MOWIBCHZqPW4ERdwg+Qm4wBxT2g FEc1wWXiHVTjLSi/RD4FbZUVNifl6YA1Q+98uxcpaubqB5V2sObOql/bwONC5aNcRKfQ 9UwQuAqTEOeM9sIGAVyEOByonejhZEEFuDrLQrtrTHo1yPTOLXB9pnKIm1go2211YYHQ uDpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725990876; x=1726595676; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Q1FDqmmVAFWYeiOLy22eo1C5cXTJQk9ZLPSgkByFFAc=; b=DitBKge3niuZgK7tPx5c8ch4AcJmioo76MFdgwcvm0CJhQd+aBW0SBJaksCiM/kExz dKjfcM3gnhhpCVxuYJxMFNJTU5xOzQ/ZlGFSI/pvcNabGWqt7QWVYwNtJRf4a2m534q3 gvshyFb+A/997/LPkVM80cJ3qiAFaMcAcfKdK2cmiYiZk8YjVlHgOMep41RHOGPcQYI0 LCUQZP6NsBQTednKmR0pyBs+QmdXGwPyI2J2N0fb/jBfuXqPnI8vkv0Zrno0vXEP25X+ B/x8bK5F0bP7BWdsacGKIOIuLPtQaZ5DHd7tl1qMHYec+9j7rEz6XTB2q6415mgT02p0 64pg== X-Forwarded-Encrypted: i=1; AJvYcCUcDwBG5K5gbgNg9LWlkggkSMRuEQ/o1t7V3D3cdKkjah9VDmInv6i0/QOdFe6z0OJzSm+h2HO+Ufda3oIQRGEJBy4=@vger.kernel.org, AJvYcCVwEe598nCS9VQXN86xDnnP9OYD2/3NDKi7n1Cn62KP8f8Vy8JsS71ABCV2jvw5Acf/IFbBRjtcnKHD+Wg=@vger.kernel.org X-Gm-Message-State: AOJu0Yzltm29G1YMaSl0TDSIN1opUHxMgfGYlpggzW0Yl6wsEV90pnfO Xei9oo5lwu7kI+/ARvuz6lhG3goUCsXuX0rRwkiEmMKPlorhHdAL X-Google-Smtp-Source: AGHT+IG4gGghGT9dWoHSijVgAkIzg4LFg89Kkdbbo3FUcCGzCcjL4mIYdjgr35Z9cVqOh18FTrJj8Q== X-Received: by 2002:a05:600c:4f82:b0:42c:b9c8:2bb0 with SMTP id 5b1f17b1804b1-42cb9c82edfmr50186025e9.4.1725990876388; Tue, 10 Sep 2024 10:54:36 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2500:a01:94a6:1e64:e5a2:2b2a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37895675c40sm9516562f8f.51.2024.09.10.10.54.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 10:54:35 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar , Laurent Pinchart Subject: [PATCH v2 15/16] media: renesas: rzg2l-cru: Refactor ICnDMR register configuration Date: Tue, 10 Sep 2024 18:53:56 +0100 Message-Id: <20240910175357.229075-16-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar Refactor the ICnDMR register configuration in `rzg2l_cru_initialize_image_conv()` by adding a new member `icndmr` in the `rzg2l_cru_ip_format` structure. This change introduces a new function `rzg2l_cru_ip_pix_fmt_to_icndmr()` to map the pixel format to its corresponding ICnDMR value. Suggested-by: Laurent Pinchart Signed-off-by: Lad Prabhakar --- drivers/media/platform/renesas/rzg2l-cru/rzg2l-cru.h | 5 +++++ drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c | 12 ++++++++++++ .../media/platform/renesas/rzg2l-cru/rzg2l-video.c | 10 ++++------ 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-cru.h b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-cru.h index 24097df14881..3da9e8e7025a 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-cru.h +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-cru.h @@ -31,6 +31,8 @@ #define RZG2L_CRU_MIN_INPUT_HEIGHT 240 #define RZG2L_CRU_MAX_INPUT_HEIGHT 4095 +#define ICnDMR_YCMODE_UYVY (1 << 4) + enum rzg2l_csi2_pads { RZG2L_CRU_IP_SINK = 0, RZG2L_CRU_IP_SOURCE, @@ -68,12 +70,14 @@ struct rzg2l_cru_ip { * @format: 4CC format identifier (V4L2_PIX_FMT_*) * @datatype: MIPI CSI2 data type * @bpp: bytes per pixel + * @icndmr: ICnDMR register value */ struct rzg2l_cru_ip_format { u32 code; u32 format; u32 datatype; u8 bpp; + u32 icndmr; }; /** @@ -165,5 +169,6 @@ struct v4l2_mbus_framefmt *rzg2l_cru_ip_get_src_fmt(struct rzg2l_cru_dev *cru); const struct rzg2l_cru_ip_format *rzg2l_cru_ip_code_to_fmt(unsigned int code); u8 rzg2l_cru_ip_pix_fmt_to_bpp(u32 format); int rzg2l_cru_ip_index_to_pix_fmt(u32 index); +int rzg2l_cru_ip_pix_fmt_to_icndmr(u32 format); #endif diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c index c7bc82bf3f14..9b0563198b50 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c @@ -17,6 +17,7 @@ static const struct rzg2l_cru_ip_format rzg2l_cru_ip_formats[] = { .format = V4L2_PIX_FMT_UYVY, .datatype = MIPI_CSI2_DT_YUV422_8B, .bpp = 2, + .icndmr = ICnDMR_YCMODE_UYVY, }, }; @@ -50,6 +51,17 @@ int rzg2l_cru_ip_index_to_pix_fmt(u32 index) return rzg2l_cru_ip_formats[index].format; } +int rzg2l_cru_ip_pix_fmt_to_icndmr(u32 format) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(rzg2l_cru_ip_formats); i++) + if (rzg2l_cru_ip_formats[i].format == format) + return rzg2l_cru_ip_formats[i].icndmr; + + return -EINVAL; +} + struct v4l2_mbus_framefmt *rzg2l_cru_ip_get_src_fmt(struct rzg2l_cru_dev *cru) { struct v4l2_subdev_state *state; diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c index c32608c557a3..1f25dcff2515 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-video.c @@ -88,7 +88,6 @@ /* CRU Data Output Mode Register */ #define ICnDMR 0x26c -#define ICnDMR_YCMODE_UYVY (1 << 4) #define RZG2L_TIMEOUT_MS 100 #define RZG2L_RETRIES 10 @@ -316,6 +315,7 @@ static int rzg2l_cru_initialize_image_conv(struct rzg2l_cru_dev *cru, const struct v4l2_format_info *src_finfo, *dst_finfo; const struct rzg2l_cru_ip_format *cru_ip_fmt; u32 icndmr; + int ret; cru_ip_fmt = rzg2l_cru_ip_code_to_fmt(ip_sd_fmt->code); if (!cru_ip_fmt) @@ -327,15 +327,13 @@ static int rzg2l_cru_initialize_image_conv(struct rzg2l_cru_dev *cru, dst_finfo = v4l2_format_info(cru->format.pixelformat); /* Output format */ - switch (cru->format.pixelformat) { - case V4L2_PIX_FMT_UYVY: - icndmr = ICnDMR_YCMODE_UYVY; - break; - default: + ret = rzg2l_cru_ip_pix_fmt_to_icndmr(cru->format.pixelformat); + if (ret < 0) { dev_err(cru->dev, "Invalid pixelformat (0x%x)\n", cru->format.pixelformat); return -EINVAL; } + icndmr = ret; /* If input and output use same colorspace, do bypass mode */ if (v4l2_is_format_yuv(src_finfo) && v4l2_is_format_yuv(dst_finfo)) From patchwork Tue Sep 10 17:53:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 13799154 X-Patchwork-Delegate: kieran@bingham.xyz Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 548A91ACDE2; Tue, 10 Sep 2024 17:54:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990881; cv=none; b=iBHr1MIIWYX/qcq4HChLzPZ/9WS1k4E4FVNkTJt9TG7bPhn4J8vzT08tM1Z612kSx0mx/TUBfOR4pMZU5l4NP2/oixM0LOkBE2hWNHiXYcQnY7imZkY/8QsRvCalDmeCN48XN2npYUjP3yHL9idficKvb/6ByxHUYxHQXsR2Fdg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725990881; c=relaxed/simple; bh=btQfCavCwM7F4Z1EU4V7koqZbZVMdlatdXFGeH8GtP8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GV++WrA+Z/bGn3payy9RlLAro2hogp5lTDJrt54Rb/GRI750kqmR8wfe6cU2L2m2gGRelon3uUfSW4y4qFUWnL2EFbawhU9tWuiFalCudXIJad0WGyKU7XUHFaX7Czq+NgNez5blNOWGSZzFJkSKukjGApiTuvSH+W2+f7iRPdU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OlQByKeS; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OlQByKeS" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-42cb0f28bfbso10202185e9.1; Tue, 10 Sep 2024 10:54:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725990877; x=1726595677; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hLJn4K6OxMNAg/6NgI7KlpPGUijXI80GlBkh2HpGxtY=; b=OlQByKeSwKVrYsm6976hAyUkSFxM7WTB8gl6NUmUZcYKkC91B6QfP8NfHvcZY8p1ik xq7xYqy7FSukAAEVMb48AM274XJeWP1gTp3Kazd+qakenB3Aj7BX8r+TPxHAmNtiIc6N qW/fPVB1vIBPNVR3jLtoB1DR6TxJPAPW4kH+C4aCq08issiq/7bS7xolE550VZhEctp2 lHB92xlKvo7tyhJKe+MAwZxNU8HkpYJdb2KdYuUHQ40bxKAxE/LsGY7IEL60tOAXj8ki PU5ERi8JmABGUJXmNS3dT5kHxUlbtMqh6y8kAwDPI9ItCm8CL5QhVSglbjgYFAbQyHma 8VKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725990877; x=1726595677; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hLJn4K6OxMNAg/6NgI7KlpPGUijXI80GlBkh2HpGxtY=; b=v9GrGPxklHW/jALCac8oskzb6S/uKVYJO5i4UYh8Ijv5bQfGO4COt4LBrk2x0PqeBY D3dgJPDo8G7V3l8OQeW3HFeBo7ADYbHDTj6ryG/W7rIV8YUAQvKlXDapkCXnOtmqYkgs G3beHNOv/89+si6XH/tri67aSo4rVDJLQoXzGuMarRAE0TLKmoiF6ZtRHA6YZuCca5cW kyBzx98iVxUHWTHO9DF8MDgvhuja1VBuEi7OiXUVJZqeht7kxED6tG9I0f4xscTODzbC FQPG1aCgBNaUd4/u+mYy0H8lSIP65UAvyGcjNkvNsxSl4zipSd/K1GIxQ8gcXpu6fFq5 OZDw== X-Forwarded-Encrypted: i=1; AJvYcCW948Mh8Sl482Vg0d9gW4F9lhQoKI+mqAEbua7+4FxPhl9CbDMjhuctJ64wHwRd6vDZRCOPxGfoZsQ9m0wgAMECDMM=@vger.kernel.org, AJvYcCX3gMtwVut3TsOuLwR1pQ+kd4NvL8Y7cq4EOvDtDuJc0AbZ0BID1/gUp6cct/eD2NUd2fWcbbyfacER8BQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwSrmT4Ylk6+jvtgXqNd5t62MK01YRp77b7MDt7PP5BVdNN4WIC VRk/4aSwtR9bCwj86jFq0eiBBOlJ816DYHkkxVLF9Ot8ziSQF0M5 X-Google-Smtp-Source: AGHT+IFU4Iu8XvBOQgmZ8DtiQ7elW7WkvJbAXLGsWCtwGPrB/ej0kTqeruFaqVfqB4uSj25ewkvTow== X-Received: by 2002:a05:600c:1547:b0:42c:b2fa:1c0a with SMTP id 5b1f17b1804b1-42ccd35ae2amr3238015e9.23.1725990877661; Tue, 10 Sep 2024 10:54:37 -0700 (PDT) Received: from prasmi.home ([2a00:23c8:2500:a01:94a6:1e64:e5a2:2b2a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37895675c40sm9516562f8f.51.2024.09.10.10.54.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 10:54:37 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Sakari Ailus , Laurent Pinchart , Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH v2 16/16] media: platform: rzg2l-cru: Add support to capture 8bit raw sRGB Date: Tue, 10 Sep 2024 18:53:57 +0100 Message-Id: <20240910175357.229075-17-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20240910175357.229075-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Lad Prabhakar Add support to capture 8bit Bayer formats. Signed-off-by: Lad Prabhakar Reviewed-by: Laurent Pinchart --- .../platform/renesas/rzg2l-cru/rzg2l-csi2.c | 4 +++ .../platform/renesas/rzg2l-cru/rzg2l-ip.c | 28 +++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c index e630283dd1f1..d46f0bd10cec 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c @@ -188,6 +188,10 @@ struct rzg2l_csi2_format { static const struct rzg2l_csi2_format rzg2l_csi2_formats[] = { { .code = MEDIA_BUS_FMT_UYVY8_1X16, .bpp = 16 }, + { .code = MEDIA_BUS_FMT_SBGGR8_1X8, .bpp = 8, }, + { .code = MEDIA_BUS_FMT_SGBRG8_1X8, .bpp = 8, }, + { .code = MEDIA_BUS_FMT_SGRBG8_1X8, .bpp = 8, }, + { .code = MEDIA_BUS_FMT_SRGGB8_1X8, .bpp = 8, }, }; static inline struct rzg2l_csi2 *sd_to_csi2(struct v4l2_subdev *sd) diff --git a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c index 9b0563198b50..9bb192655f25 100644 --- a/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c +++ b/drivers/media/platform/renesas/rzg2l-cru/rzg2l-ip.c @@ -19,6 +19,34 @@ static const struct rzg2l_cru_ip_format rzg2l_cru_ip_formats[] = { .bpp = 2, .icndmr = ICnDMR_YCMODE_UYVY, }, + { + .code = MEDIA_BUS_FMT_SBGGR8_1X8, + .format = V4L2_PIX_FMT_SBGGR8, + .datatype = MIPI_CSI2_DT_RAW8, + .bpp = 1, + .icndmr = 0, + }, + { + .code = MEDIA_BUS_FMT_SGBRG8_1X8, + .format = V4L2_PIX_FMT_SGBRG8, + .datatype = MIPI_CSI2_DT_RAW8, + .bpp = 1, + .icndmr = 0, + }, + { + .code = MEDIA_BUS_FMT_SGRBG8_1X8, + .format = V4L2_PIX_FMT_SGRBG8, + .datatype = MIPI_CSI2_DT_RAW8, + .bpp = 1, + .icndmr = 0, + }, + { + .code = MEDIA_BUS_FMT_SRGGB8_1X8, + .format = V4L2_PIX_FMT_SRGGB8, + .datatype = MIPI_CSI2_DT_RAW8, + .bpp = 1, + .icndmr = 0, + }, }; const struct rzg2l_cru_ip_format *rzg2l_cru_ip_code_to_fmt(unsigned int code)