Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1511733rdb; Mon, 8 Jan 2024 01:12:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IF2LsQyT+SIDt9pWnYGwaqRvcTKCZXdC9q7Zn1XGs2RHPzG4LrNOHhw5RYZwAM169Qv+C04 X-Received: by 2002:a17:90a:3ccb:b0:28c:b325:a740 with SMTP id k11-20020a17090a3ccb00b0028cb325a740mr1447157pjd.5.1704705134026; Mon, 08 Jan 2024 01:12:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704705134; cv=none; d=google.com; s=arc-20160816; b=ifAgf5AgrOMRszzfWLk8M7lNpwM9DoZYJ6139zkmGdIiuovgqXAuioKQcofMDUhgAc GXkzL1o4jmsLrS9W77uKOYRydQnSDtsHYLytl7u6wm4CUg5U0xFk45o4WSWEBZ9VOsCo YUBYy73/tOJsHLiex+c+weytzv4D1UmdyqJchihJt9P2nsF5GhgS3M/pHKwY51kkCfEw ZV+ERY6vbjj2ZWXJFiG8HTH+UH521TFPSwYc0syW8XibB4H82vIzlJhF50o2+V5U99mT uCW9zUeYBrjpeVuk3LvuwKo5Hgw35izVlOrobB9DMwy/+/5e6aNy/nwPgl2ytAnngc+J W7zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=Q32arpW9VYokTI1g1zjoaAan34PPiJ6o4aHn6sD00Y8=; fh=6cZkgjpzjEO+f/SzNnWrtdV7wybYvCUpsAbA6tSpYZo=; b=sUlp724G5ZOmQZ2vytfmpURHnu5wxsezADXnvzOcEmnUsX8TdFHWZfrGs4Yf1wllPF kE13YuXtmqTqzAhVf/6G3lBuV6WrZ7wDXepkk3EWyCVHmqbdsXYj2IQN6pCHSBrRFNib twu2eZEaROqXSwF10wvfuAF1rN2plPLxXsC6G2hUqLyXTwybqtkp/VJWNtgjE+u2wCzC GheZiSEOv9kr9jMFMA7yZeUCBL9z2K5I+dMa0Iy3MF48+7kSLgq2my7T7nEXsuxbFQFR OvYVPbWbEj/0t7pEVGsmMx7m3gd0OUd7W7Yldopa+JZ3/C/HRdsi2u+BI5fkbcqAR4Te JKLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=hZMIDHT2; spf=pass (google.com: domain of linux-kernel+bounces-19247-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19247-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id hv15-20020a17090ae40f00b0028cada1edb4si5347905pjb.89.2024.01.08.01.12.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 01:12:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-19247-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=hZMIDHT2; spf=pass (google.com: domain of linux-kernel+bounces-19247-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19247-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 845EBB21E5D for ; Mon, 8 Jan 2024 09:09:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E1C9C11CAD; Mon, 8 Jan 2024 09:09:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="hZMIDHT2" X-Original-To: linux-kernel@vger.kernel.org Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7623611709; Mon, 8 Jan 2024 09:09:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1704704963; bh=N4STaPWl6V/kzg3Bq/Q6+nrlEzgQfF4x9E66Po7nkRM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=hZMIDHT2SC6URiMOoZ/b5ZUhzDsxnjEsYp109u65CUaCvBDf3nFkgr8g4n7OVeFC8 E2NQ8fpTUllihhBulsD3L010AhXM2UyGc2GMcPGGtRIAFpNjxCp8JlG+fjTBTBNvWU 6anB9WFLbg5FLX9o2rIxmguvVc14294GBSOLN4qHZzyKhdrS4ELEQrVoKXi+IGrgNe 3oDBaPLx1bFaHF/eySKaIVcWRBtyJDzJG5BrhtkJSYH+HZOXHcpwxXLaQMy1dCMbJ0 Kwfi/kQE+gP46XEVxlPaG1FbmmV5ojaAC1FhfKM/wdFQPTiD5uVh7NrVUYTfoneQlK CWdeDnTvUbPiw== Received: from [100.74.67.65] (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: jmassot) by madrid.collaboradmins.com (Postfix) with ESMTPSA id DAB8737804B2; Mon, 8 Jan 2024 09:09:22 +0000 (UTC) Message-ID: <83fe7beb-de1a-4c71-a584-f3d205249d9d@collabora.com> Date: Mon, 8 Jan 2024 10:09:21 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1] media: cadence: csi2rx: Add enum_mbus_code pad ops Content-Language: en-US To: Changhuang Liang , Maxime Ripard , Mauro Carvalho Chehab Cc: Jack Zhu , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231211094329.9090-1-changhuang.liang@starfivetech.com> From: Julien Massot In-Reply-To: <20231211094329.9090-1-changhuang.liang@starfivetech.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, On 12/11/23 10:43, Changhuang Liang wrote: > Add enum_mbus_code ioctl so that user space can know what > formats are supported to csi2rx. > > Signed-off-by: Changhuang Liang Reviewed-by: Julien Massot Tested-by: Julien Massot > --- > drivers/media/platform/cadence/cdns-csi2rx.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c > index 889f4fbbafb3..7788ce0e3171 100644 > --- a/drivers/media/platform/cadence/cdns-csi2rx.c > +++ b/drivers/media/platform/cadence/cdns-csi2rx.c > @@ -389,6 +389,18 @@ static int csi2rx_s_stream(struct v4l2_subdev *subdev, int enable) > return ret; > } > > +static int csi2rx_enum_mbus_code(struct v4l2_subdev *subdev, > + struct v4l2_subdev_state *state, > + struct v4l2_subdev_mbus_code_enum *code_enum) > +{ > + if (code_enum->index >= ARRAY_SIZE(formats)) > + return -EINVAL; > + > + code_enum->code = formats[code_enum->index].code; > + > + return 0; > +} > + > static int csi2rx_set_fmt(struct v4l2_subdev *subdev, > struct v4l2_subdev_state *state, > struct v4l2_subdev_format *format) > @@ -439,6 +451,7 @@ static int csi2rx_init_cfg(struct v4l2_subdev *subdev, > } > > static const struct v4l2_subdev_pad_ops csi2rx_pad_ops = { > + .enum_mbus_code = csi2rx_enum_mbus_code, > .get_fmt = v4l2_subdev_get_fmt, > .set_fmt = csi2rx_set_fmt, > .init_cfg = csi2rx_init_cfg, Regards, -- Julien Massot