From patchwork Thu Mar 28 05:13:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13608005 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (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 D12A518026 for ; Thu, 28 Mar 2024 05:14:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711602897; cv=none; b=fFKBlp4VoyumnYdxPuPXBnaiANTi3j2+AdRFnqYuOE606wumq57KD+AS/5hzCdexXJhjid5wGrVo5w2WbO319mJ327XLTJ8RvjDF+Gf1eUPXIRk3VRFZH1BB0kxhkHnnyRTcNR8ivpGS0UzwN+9Hb7slRCoWlt6b1M1aYxwevQo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711602897; c=relaxed/simple; bh=trUztcXBMs5OtcQkM6L5zAjPMeq4iHwSnTYH7Cn31b8=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=pzkHM8EPwoBSVgtZH4UEFyJv6szRIsc0Vw19B0TYhi6NJlMvNofo6uHxkOEK31QG791CtKXIvZlZPcohxNgdi5h9aWZtdXbpahBn/KjitPp1RnP76y9x6JKm5Bx955qQkJ2yXpYuu3StoWGjwelfsWocNt9zcZpzfwHBesLrUvo= 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=HP7ID8+L; arc=none smtp.client-ip=209.85.214.169 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="HP7ID8+L" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1def81ee762so1368765ad.0 for ; Wed, 27 Mar 2024 22:14:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711602895; x=1712207695; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=al+bOrMYpCO69loz9WSbHwDyCvLHsj+k363/YJ1kS+o=; b=HP7ID8+L86UHvt9qoxSqpuonqifbDicfXH1BS04u140LpdHRxwlrmOgrRZuF68SmvJ 6caj0RAVGQRfOXWO/ztsS3p2wahEs5jncuNB1KbzOdAtm2DxDo2SHPAUH0/W3r6Z3FAj xaO1teus3IV4vKSXxWHf9fQyXYo8pN+NlgjjcbzJTn1auEQ+fXATR6O0JJ4ept7tQ5YG ECUG1IlWTTfg6w9d8KEw5IHcTZ/oVWmAaEa/CxgPqfm5ZKemrU0BWKPKsJOO8jRg92uJ Qts7+1Y/0ZGnrbLRvk/pAkHZIRE+K8vbB+Sk3FGy0hyiA0Fe78IX17Bd3ZaNih8FC2NP HYWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711602895; x=1712207695; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=al+bOrMYpCO69loz9WSbHwDyCvLHsj+k363/YJ1kS+o=; b=bh8Y0s5zaKvSa6rdYd6BQ3IOr4YdpeGDVW2/JVlk8NkzMRmRDK7+Hoa3i2hyan1jIk KGZNN+Uj9THuRPoHqjXgak/4OQKiiWpFP7M+uOkNpukKm6eM+43h4Z5cE+UJ/+MMulSd 3WtVEhDMi9a+WRcdNoHUcVigv0LgL+D8NNM7MEGfzzU8EcGoA4IHOIJeKO62vVXfCDsk PU+nLZAYqZhh+oQpZrfG9uBwYc5LSB/ms2ubWGNB2MCDfTZAo9P72DCixkqGguZxQglw ZIoRjjGPyE7ngayk6dN/LI23hxUQHQXXWI1aPqhAkfI4tOFCx17DVO3sAPRwlXanaiqe HEhQ== X-Forwarded-Encrypted: i=1; AJvYcCW9EOXvFFlVvswkQmf+aYZptgX9omTjEYcGhQuskxzPbO0eFFmzTWqPFC/pb12k3IRynci9QAvslhJYGNlOMfHkgE9u4THrtAgOGKw= X-Gm-Message-State: AOJu0Yyzr8lSm/XyYSEQInrQsgIISt4ioe12OU9wVy7VO5ST+hgMKQiX qJBVEiXIgqxU1ULYg7KsEJIlqZyd1aMuouKdRZJ3vaWGBRp1MlLV X-Google-Smtp-Source: AGHT+IFSrPQNNhxoTs8f2wdufeJyd0f5yeWeQ81raNPm3FXfLsMRQ9Zz06N5034jbp7YbLWmLvyEPg== X-Received: by 2002:a17:902:c3c4:b0:1db:ce31:96b1 with SMTP id j4-20020a170902c3c400b001dbce3196b1mr1777965plj.6.1711602895050; Wed, 27 Mar 2024 22:14:55 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:ba70:b18e:9570:2643]) by smtp.gmail.com with ESMTPSA id b15-20020a170902d50f00b001e0eae230f2sm492030plg.151.2024.03.27.22.14.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 22:14:54 -0700 (PDT) From: Fabio Estevam To: sakari.ailus@linux.intel.com Cc: rmfrfs@gmail.com, hansg@kernel.org, linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com, Fabio Estevam Subject: [PATCH 1/2] media: ov2680: Allow probing if link-frequencies is absent Date: Thu, 28 Mar 2024 02:13:19 -0300 Message-Id: <20240328051320.2428125-1-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Fabio Estevam Since commit 63b0cd30b78e ("media: ov2680: Add bus-cfg / endpoint property verification") the ov2680 no longer probes on a imx7s-warp7: ov2680 1-0036: error -EINVAL: supported link freq 330000000 not found ov2680 1-0036: probe with driver ov2680 failed with error -2 As the 'link-frequencies' property is not mandatory, allow the probe to succeed by skipping the link-frequency verification when the property is absent. Fixes: 63b0cd30b78e ("media: ov2680: Add bus-cfg / endpoint property verification") Signed-off-by: Fabio Estevam --- drivers/media/i2c/ov2680.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/i2c/ov2680.c b/drivers/media/i2c/ov2680.c index 39d321e2b7f9..f611ce3a749c 100644 --- a/drivers/media/i2c/ov2680.c +++ b/drivers/media/i2c/ov2680.c @@ -1123,6 +1123,9 @@ static int ov2680_parse_dt(struct ov2680_dev *sensor) goto out_free_bus_cfg; } + if (!bus_cfg.nr_of_link_frequencies) + return 0; + for (i = 0; i < bus_cfg.nr_of_link_frequencies; i++) if (bus_cfg.link_frequencies[i] == sensor->link_freq[0]) break; From patchwork Thu Mar 28 05:13:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 13608006 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (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 4E9C118026 for ; Thu, 28 Mar 2024 05:14:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711602899; cv=none; b=WIWPprv4dq/oBHA7WowY0PwNJqmGBweJhNT+TLqfCYd/YatsDKM4bGCBCI9SMOD8OUd9S7GS0BDDHmlpcSsT6RoHIZXuGyT6LDRNs3H3m+wzrew1CLyRFzZa+nAb0FkKjILkOXJjgn6GqCSDaw8oZvzBoPri9jMq96IS123NkBQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711602899; c=relaxed/simple; bh=2EPZRor9QrJOjCmxrA3GZX5JmhoQ6mfy5ccU7ElxgD0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HTTmnXerOgqA3s6295NK3nFy7z4yB6RENsaAr9polsVqqAAnVpmUz+fxg2WfKIZnBd4NG4nkIbK+pzqtqALSRf6HOmouPR8p382df6/lhz25Mqh12E1j0qrzGl4lhvNcneSETQsdNCyuo2Mh8/sFPPVtPAtpQnZhyNECXURIvr4= 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=lpZztm4Z; arc=none smtp.client-ip=209.85.214.180 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="lpZztm4Z" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1e0e89faf47so1688605ad.1 for ; Wed, 27 Mar 2024 22:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711602897; x=1712207697; 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=7R/TEAO3zmsktRBKQhrymEWAHBiB7lCybP6vbYknfOU=; b=lpZztm4ZeLxuTSx9jDbx4c/kOVC4jUzS/RdEDcoY2f0XDpI3o6arG+eI2pkNuqYTld 12ZaxPE3VQ/Vej5Wd3NpaZkzAXW903aX0dsHMThP7Xb00xabgherC3JgUaArsCDCBBt/ RMwBv88e8roNY137i65X4uDZPYM3IBT7sfNnuXUVh5aAZSE34gZK6j5TGMRcN8ZcTjfk IniFTxRmnF923+hlCgpTLECLl7ROD85bCOzXZyc2NVHTrdB/8+Ipt8u0MmQL9vqaf+N6 D0uG8JQUzBUTB3gyt8A1ZM8Me/naWXESgIzs6zhpnP3n28QDynYZ+u8b5kP3AkQ4IL2v 4djA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711602897; x=1712207697; 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=7R/TEAO3zmsktRBKQhrymEWAHBiB7lCybP6vbYknfOU=; b=JSAjqwNqF79pMJFl5YBYH1D7WwU453BsBspDLWg9rcRQIwyn0TY7R6aCpvQKZ/56PA pmvA0Unsq5qahn+zDiExhdUW46/FUOoq11TWn2Md705V2u2nJc4gXhKwNcPRaS2nTW3Z 40YrWDapUUclmrUgM3ocW9msnsel1HFL9MGsjPx2jaA/IGYv+s44fOG1A+Xv+R5ELXVy j7LMXZzX3iww/iXkleKAhepoygjbj7OGijMqD2XM8H2VFbxxVKd7eXsSk8+UnTZrA+eX Ibf/OsvBMzFyqQL2btuYxKcZ3A79Dq4obF2DgdXq5Tl8iIVJJXdRZvsVYvSGQNJo6VNd BkIA== X-Forwarded-Encrypted: i=1; AJvYcCU368Dy/onxomgcjgrB1oseISqjxaWIDAlin8c1W986mqmwrASikfK9EDxRmWnQ30Wlzp/xi0rluckh5izclrXh0HBfcDf9ffb+HZE= X-Gm-Message-State: AOJu0Ywd/49LgpZuMXgWW4XAlvb9mXnEwFZGrYu82rv1AdXxQ0iwYsVH hSgosycIOu6P17doTe7Gieq3Ul9VLzrUOJgwmdT+bcikWWNumsi5ZIIp4nf9 X-Google-Smtp-Source: AGHT+IEBS/XyQwLmV1zoih8RFnzjgiAm9m/JUrTizbIhBzB3WdwC49NtVGsM1Lv1Iw0ZSip7ZZZ7lA== X-Received: by 2002:a17:902:c3c4:b0:1db:ce31:96b1 with SMTP id j4-20020a170902c3c400b001dbce3196b1mr1778030plj.6.1711602897565; Wed, 27 Mar 2024 22:14:57 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:ba70:b18e:9570:2643]) by smtp.gmail.com with ESMTPSA id b15-20020a170902d50f00b001e0eae230f2sm492030plg.151.2024.03.27.22.14.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 22:14:57 -0700 (PDT) From: Fabio Estevam To: sakari.ailus@linux.intel.com Cc: rmfrfs@gmail.com, hansg@kernel.org, linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com, Fabio Estevam Subject: [PATCH 2/2] media: ov2680: Report success on link-frequency match Date: Thu, 28 Mar 2024 02:13:20 -0300 Message-Id: <20240328051320.2428125-2-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240328051320.2428125-1-festevam@gmail.com> References: <20240328051320.2428125-1-festevam@gmail.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Fabio Estevam When passing the correct 'link-frequencies' in the DT, the driver should report success on the match case: port { ov2680_to_mipi: endpoint { remote-endpoint = <&mipi_from_sensor>; clock-lanes = <0>; data-lanes = <1>; link-frequencies = /bits/ 64 <330000000>; }; }; However, this does not happen and the probe fails like this: ov2680 1-0036: probe with driver ov2680 failed with error -22 Fix it by returning success upon link-frequency match. Also tested passing a wrong link-frequencies value in th DT and confirmed that the driver correctly rejects it. Fixes: 63b0cd30b78e ("media: ov2680: Add bus-cfg / endpoint property verification") Signed-off-by: Fabio Estevam --- drivers/media/i2c/ov2680.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/ov2680.c b/drivers/media/i2c/ov2680.c index f611ce3a749c..37c21749dc14 100644 --- a/drivers/media/i2c/ov2680.c +++ b/drivers/media/i2c/ov2680.c @@ -1128,7 +1128,7 @@ static int ov2680_parse_dt(struct ov2680_dev *sensor) for (i = 0; i < bus_cfg.nr_of_link_frequencies; i++) if (bus_cfg.link_frequencies[i] == sensor->link_freq[0]) - break; + return 0; if (bus_cfg.nr_of_link_frequencies == 0 || bus_cfg.nr_of_link_frequencies == i) {