Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1551898lqp; Mon, 15 Apr 2024 09:33:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUISJaimbZBEJNOziFiY4OC8yN8mKuEjy86XxZw50ysGpQDoC/LnWWHyEUuFV0FlD12aVWTC0u8uqoGuaJnOXkmyZMLftYzMXeaTBlRTw== X-Google-Smtp-Source: AGHT+IEPhuMiZHq4mFJKhvckWYcMtlVlsBUn+y/G7B588GU5aPZVhYsjGV2RAvCAe+6JmM0W7LC2 X-Received: by 2002:a05:6122:901:b0:4d3:43f8:8541 with SMTP id j1-20020a056122090100b004d343f88541mr7997460vka.1.1713198787749; Mon, 15 Apr 2024 09:33:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713198787; cv=pass; d=google.com; s=arc-20160816; b=h9qbkGPS6RnfLKCjZjEmtq1it/DBxli9T8I9QnhP70IfNRR08ztpmsm/QE1EXAHnaT L0p5SnwffgFvJ/INRMPN1C+LIU5YfvUmXJgYrAxJMH5vRrKeP++cZqTKT4yyHJMqqxo+ HCPfB1fj4pqgSS+AgwKHBp376ECirtSc6KYFGV3x+K4z6OaeFywErdt6fHhBHFI2TutS toKTjJcPjqivgYXI35sfMys5bKC7MOZ41/u1xlYpbwe3rIvbnayH5KZJoDr44/0zOcBY tPly7bHlmrfCNUKArIR4F4duRBmdlwZoIUB0va3EvweKpjjjdSavR1bMBHg0L+7OmXQV 02Hg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=V2Nn7Jrr3tkjyvXhAtGFNC4qmjJ+nKbbMNdFT82JTT0=; fh=JOXOV/t46Y/7uXiPks5H/c8QUSAME03vPPaRnw+zggE=; b=is5vMNoJR7wGxHEhAMrX+ox2utfhFXrBGIC9bDONoQFEIay6g8rCaAcETPM1cGjoJo lshwPskLKQ+wnjnn2rR/WbMzUCexdM1P4w8iAAF33A03REB5j2D3Bp1X/wN7mfIiUbUq rm3XG2BzWnnbTNLrvl8/Nf9sEQPqVqVV+QpBMZM0Hm3VPEMHAQMesn9XhS2l/61+SZdW C25adyKLagUaWfiRXNW39iO8BMHOou8i53TP+6+TGUbr0i3zIsOoVfDu0GBs5U/SO/yw C8gcwQlEuVMfWGuqm14iym4qveY893JezLTvg7cBBolgNGpNL2iPhIXR+K6x1/F6do/l pNzA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@luigi311.com header.s=x header.b=aa8DdZTB; arc=pass (i=1 spf=pass spfdomain=luigi311.com dkim=pass dkdomain=luigi311.com); spf=pass (google.com: domain of linux-kernel+bounces-145557-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145557-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id o39-20020a05612217a700b004cd27bd4329si1548174vkf.279.2024.04.15.09.33.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 09:33:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145557-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=fail header.i=@luigi311.com header.s=x header.b=aa8DdZTB; arc=pass (i=1 spf=pass spfdomain=luigi311.com dkim=pass dkdomain=luigi311.com); spf=pass (google.com: domain of linux-kernel+bounces-145557-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145557-linux.lists.archive=gmail.com@vger.kernel.org" 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 754FB1C2111F for ; Mon, 15 Apr 2024 16:33:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5C80382495; Mon, 15 Apr 2024 16:32:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=luigi311.com header.i=@luigi311.com header.b="aa8DdZTB" Received: from mail-108-mta33.mxroute.com (mail-108-mta33.mxroute.com [136.175.108.33]) (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 260661CD23 for ; Mon, 15 Apr 2024 16:32:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=136.175.108.33 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713198767; cv=none; b=AnDflAW+pPyVu7pwaOHKA2Pk3sNZ8SHAMAUrGT+RWH4JNLeOWglBgAhllXRJhXY9Ni4Oj7jpPhLfgIEKCSeyxzYLjhkiXFs93czy31SGJ4SXrLcNVwFEn4h+4MtlFj4XWXTBYst6bkvP2KljMswUfJibnno2Gs9PpA+yDKCpoPk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713198767; c=relaxed/simple; bh=+exoGmCOK4B2TtxLi9b/ila3bGXOXu85jVJIdxsj6mg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=aROcCyyzZoJhdPIvyfVHJoXhgHKDvEo500IJSW44MCR/7a0ZMe5XbQ9qaSA/OQYeOpTOlbTMWjYjRYPTEJIZUBFmQ0B2gxbjwZZT8lrIzDqdx30rknQBhZD4SbzKpsKO1vegtPVZRJ6XT6JBMLwiXIky0UCLtK0hrrdod99Uyzw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=luigi311.com; spf=pass smtp.mailfrom=luigi311.com; dkim=pass (2048-bit key) header.d=luigi311.com header.i=@luigi311.com header.b=aa8DdZTB; arc=none smtp.client-ip=136.175.108.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=luigi311.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=luigi311.com Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta33.mxroute.com (ZoneMTA) with ESMTPSA id 18ee295d2890003bea.011 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Mon, 15 Apr 2024 16:27:33 +0000 X-Zone-Loop: c34f974572cfb78ac6c768e94899715187bea3e007ad DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=luigi311.com; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: From:References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=V2Nn7Jrr3tkjyvXhAtGFNC4qmjJ+nKbbMNdFT82JTT0=; b=aa8DdZTBpjNxd1bP/EKMfyI4Mx tIOkjezMnyxWR4TLiN5ypsnhdPM8o8RLVeO6ccjvkoeBGt47xkRYnNm/6kUsUZfiQlnCf2OE8jiM1 qSh3nLgateh6NXvemhs0tKo0inFmmT2jghc3e7qVCId6N3SJauot80rEyAhkQJZDYvCbjp9AR1Uod NKDy7tlTDeGT3k8NKdCxNiOapt2TCuLKPnhlSq+0s1gS8e+ZOEvyQxthDDRedP3NUjdA4E6qJ7h6A k8zPSBuVoMfbKHG5i0uRNxY/v9UG6f5rSHgpJttbrZ8jEGyNjBxyNr6wkTPstyIjrVGKyKSELG353 FFRtmd4Q==; Message-ID: <656bf349-38bf-44b7-936c-58f424613a49@luigi311.com> Date: Mon, 15 Apr 2024 10:27:28 -0600 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 v4 24/25] media:i2c: imx258: Use v4l2_link_freq_to_bitmap helper To: Tommaso Merciai Cc: linux-media@vger.kernel.org, dave.stevenson@raspberrypi.com, jacopo.mondi@ideasonboard.com, mchehab@kernel.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, sakari.ailus@linux.intel.com, devicetree@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, pavel@ucw.cz, phone-devel@vger.kernel.org References: <20240414203503.18402-1-git@luigi311.com> <20240414203503.18402-25-git@luigi311.com> Content-Language: en-US From: Luis Garcia In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Authenticated-Id: git@luigi311.com On 4/15/24 09:18, Tommaso Merciai wrote: > Hi Luis, > > On Sun, Apr 14, 2024 at 02:35:02PM -0600, git@luigi311.com wrote: >> From: Luis Garcia >> >> Use the v4l2_link_freq_to_bitmap() helper to figure out which >> driver-supported link freq can be used on a given system. >> >> Signed-off-by: Luis Garcia >> Reviewed-by: Pavel Machek >> --- >> drivers/media/i2c/imx258.c | 12 ++++++++++++ >> 1 file changed, 12 insertions(+) >> >> diff --git a/drivers/media/i2c/imx258.c b/drivers/media/i2c/imx258.c >> index 5de71cb7c1ae..65846dff775e 100644 >> --- a/drivers/media/i2c/imx258.c >> +++ b/drivers/media/i2c/imx258.c >> @@ -693,6 +693,7 @@ struct imx258 { >> /* Current mode */ >> const struct imx258_mode *cur_mode; >> >> + unsigned long link_freq_bitmap; >> const struct imx258_link_freq_config *link_freq_configs; >> const s64 *link_freq_menu_items; >> unsigned int lane_mode_idx; >> @@ -1552,6 +1553,17 @@ static int imx258_probe(struct i2c_client *client) >> return ret; >> } >> >> + ret = v4l2_link_freq_to_bitmap(&client->dev, >> + ep.link_frequencies, >> + ep.nr_of_link_frequencies, >> + imx258->link_freq_menu_items, >> + ARRAY_SIZE(link_freq_menu_items_19_2), >> + &imx258->link_freq_bitmap); >> + if (ret) { >> + dev_err(&client->dev, "Link frequency not supported\n"); >> + goto error_endpoint_free; >> + } >> + >> /* Get number of data lanes */ >> switch (ep.bus.mipi_csi2.num_data_lanes) { >> case 2: > > Looks good to me. > > ps: > Maybe a good plan for the future would be to use: dev_err_probe > (instead of dev_err into probe function) > > But this I think is somenthing for next improvements. :) > > Thanks & Regards, > Tommaso > Perfect, can i go ahead and add in your reviewed by looks like you didnt add it here. >> -- >> 2.44.0 >> >>