From patchwork Wed Feb 26 15:39:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathis Foerst X-Patchwork-Id: 13992714 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2089.outbound.protection.outlook.com [40.107.21.89]) (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 E378E21D595; Wed, 26 Feb 2025 15:40:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.89 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740584403; cv=fail; b=GgUalfhMbcmJURhc5IxcX/O1rjbLOnpbWAlnW9Z2XoyUrOjZQr317cK61yx6opP6CsVakbHWGf8JNsVBsAOmRjugeUrGyiMc3r6hMZu615TItikM6VcCXL64iEl+sXbJpfkrlUkeamK+UnzsWoBhH6Ft8wOM1KqNQFLPHRmjXX0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740584403; c=relaxed/simple; bh=SLNnFY1cvgG6zHSSankSBXZkOFp0CmR4Rji7LEtTK3M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=oo6ivgUZY0sSZcHNOkYV1I+lhe7usnD+EBM4KHmN7i0ztT9VFTMQ5PG9qcJyIMPNTx80vXkA9j0wN3N9iIdPa7Nj/6/MtJ/reMWduFn1vAInFXrx5DxwYmBZ7yOzSR6EJ/wSIWnGxE96XXKtLMDKiJ0jbZ2Vnpw0JYL2aEj/dPM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com; spf=pass smtp.mailfrom=mt.com; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b=c3Ni+pha; arc=fail smtp.client-ip=40.107.21.89 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mt.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b="c3Ni+pha" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fzD6bpOd5NTQktrQ8aEyMFH3aE1D55IUufGGLXLCO8HuVWqhqSSIn3dYQOGwWG76ZAVHp/1sDonGdG4p6dnDCZlKWbqBVDhqOexAbPe/SBxmL6bDvT9Bzmo0PS2YULhVcwYHApjcCtpXHfKUjDS3dpyK2h3AQj041wTKPliueE918a6+3IsZjR7ePplbq/14VKuaWgNC4jlbMdmZjGLGFR5EkCf3ulQEn6Aph5NjK2KaPqNLSuy7MjZGiEZ+J2yQRsaG6mk/vvrBVCdSHLm1YTjIRoNRry4Z/6IEKV2TCvRoDgfcnrgO53+rSFjkIZ6cDczu5fiCRgGDcLBNBsdcWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YJV5qNo0OEeNMCiuHLR1seQuXC2SEuiSMcFP86UIO+g=; b=A3p0LwnpuE7+zEqzjiZFekWnOnoLTziSYSmdrGjeuXmaz4McgUm1EIGJcTCgWrhBjDb8WxTwlmf7yV3ntqxhUHPSoCJJdEeKwSZpDImh8PO5GV/rOIZDFeVmISbfD5kwHgijBW4QCu5dlMV2GDCDNdIy5mRVGGgPrC2/oKHPmELJ8WNGb1EH1NXZvvavVfFnqelIqZqCIQ1c8JbBLZj9qibV/uiO/xnGIv1wbW3lSt+kiF8pDYHO4I4Z86KzMcFhbFbHlap5Tw1HnM9jPISK0GPilB7LFz3HLJmLZNV+W8+V1iSLYFDLs8CORT4Otcf0IFtReXmGBNZh/L06TOooZw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mt.com; dmarc=pass action=none header.from=mt.com; dkim=pass header.d=mt.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mt.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YJV5qNo0OEeNMCiuHLR1seQuXC2SEuiSMcFP86UIO+g=; b=c3Ni+pha1wRrH9TxTMqmGGeuvlZK4dkU1ueBK5Rb59U8raptBMz9j77ZfZMiSkgrAnMpeHh0tFjZlQWUcxx7RfRv6IdF9GI47CvHdbihOA5S+aHI+OCtF8jRBGyxl2pSKE56oN4XaNpA74KS/97CZxFM6n9dSUJ1diuVH0bi3ikzgSqR6/sWIHY8zx8yag8SsiH08zAzUEHJEtmJQVS6sZevDgmoC+/D2eEdYLu28xIcnjLZ5aL/XtJQaqsY8j6sYr4ylCBTOIsLtqx+UX3olvSIsvWBh2mc9KVWluw4lK20e/EepcmHq9hbARn//xx1VypZS7pXuG19My4SVrkF+Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=mt.com; Received: from DBBPR03MB10396.eurprd03.prod.outlook.com (2603:10a6:10:53a::11) by GV2PR03MB8559.eurprd03.prod.outlook.com (2603:10a6:150:af::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8466.19; Wed, 26 Feb 2025 15:39:57 +0000 Received: from DBBPR03MB10396.eurprd03.prod.outlook.com ([fe80::ee3c:c9be:681:c0bf]) by DBBPR03MB10396.eurprd03.prod.outlook.com ([fe80::ee3c:c9be:681:c0bf%7]) with mapi id 15.20.8466.016; Wed, 26 Feb 2025 15:39:57 +0000 From: Mathis Foerst To: linux-kernel@vger.kernel.org Cc: Mathis Foerst , Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sakari Ailus , linux-media@vger.kernel.org, devicetree@vger.kernel.org, manuel.traut@mt.com Subject: [PATCH v1 1/8] MT9M114: Add bypass-pll DT-binding Date: Wed, 26 Feb 2025 16:39:22 +0100 Message-Id: <20250226153929.274562-2-mathis.foerst@mt.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250226153929.274562-1-mathis.foerst@mt.com> References: <20250226153929.274562-1-mathis.foerst@mt.com> X-ClientProxiedBy: ZR0P278CA0062.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:21::13) To DBBPR03MB10396.eurprd03.prod.outlook.com (2603:10a6:10:53a::11) Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBPR03MB10396:EE_|GV2PR03MB8559:EE_ X-MS-Office365-Filtering-Correlation-Id: 054a17f1-3d4a-4507-1294-08dd567bd2eb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|52116014|376014|38350700014; X-Microsoft-Antispam-Message-Info: uwjNDd7SxT0s8WN52qtUeGKyA70OKbv2xhErC50SC/i9ruHvUrr4rRutefKScW1jyYZwtS530WFB3D/hMLL4NyQWHNLaJrCsoRMRkG8ALplpNQpcN93OdbQSnGcLflN1seiHL8STdQfenw1JRTbPm01RA2AeSFq2SjA/3qJ0b95i3vGx+DgUC5Hv0G3DajB+NqG5WPmN+K4NeoiqY63+dW9URwYZ3OyaYkVQ4nXjAA/+QC4iv98LJ3OfpsyR/LQJGm2rW8k/mLylB+zpPkCwTb3mVtLMpQwP07uK5OPGK42ZVOQwsJ3VDVxybuBuodRPxzbAbgKojyQihRX63bw9F1jLzgYHNohBrGzl8rkjmC8+q1/QCQUpqgD7gSLjMWV5QGe3v2+dBh4Xn8oMm3lRuov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P:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DBBPR03MB10396.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(52116014)(376014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: duR9wYTkHrVw6JNBTCpvS6TT1Al2MUlrt0rPYiWwkJXZ/8KWRrF7KJsn28/NXxFTFLaxxlFPUFWdqV2PlSpgYvvinKS3svcXmZg++V+U97HAb8oOv6zZq2eEgYGipkXN1Kx6WoMhFcZhoUYLaYokb4g7Cb0SItspzKXkE0x5VYw7gLWeCpxAB6XaZW/RDn0H9GhNFFrwtnci/Rx3wm231oZPUOdbXsArV3g+8fsCpntOqtjG9wRx1kRDJ/XwewKTqj4pgWJiMhwixg0Wm5FrTgYMcPbUT7oqmyqLLqyVgrboVKK2cdz4YETQ5rlaL7bMqF34VGP/wTZmUDG0iBMkFyjgzJ3zcfPr4m7I6n/k9a6VzdA03E3K75eSkx5xC18icth4MEJJzGUFpZmPsL2zm8rgHvrwBhP5wMeeYVmMj5/+Ye0ZH1cGSzF65dhxAHNbyvBXI713lsv5SfcJWOwUJIhkWNh7fItl0WGS2Em6TrxUZthsQDsO+Uc3MXloA8geTNRW+7BuQoxgVfuMKseEcTFWA2OV+dfoRpt2v2mvAODtKKE674krTvoAC8dVH3Ld+tfsHcc0qxAP22h3b5fYo7QpAkSdfTPYciCsrOQfTe4KEf+E1pyjRCutYc13+1B2DquurFOqLTMO8L6EQmYHhw81LrFqksL/55b5WiwGG2HqRcgfWA2jJwbR1ij9mX7QYjX/Lb6wPfZK83FZtpPRJ7KWWyMmykGadJ/5VM0an2CzpqsUn+b/iuxoW66DX43EmVH7sY46ntA96VFsmdhEf27LHjEenWkY5zDp/gQCBAptWvXNqeFd4g5iariNQBszW9xVaJI15y6CpyAjzJq7/NnUL1iZMesLXrH7yt9kSvXTwF2atdGhrzrV8gfInwXt0CzieIFc2CU5oNTFYei15Qe8M00bymTL0IvNcmBfdMhTHKq/1OpgbMVtAcuJupVANV3jCkK6ZFy4SmSMt9ia8OtKSsQGuxSMudZRvIo0jvuloDokpYNw7CaqUUxUZxw00V4OVL+E6vyM1U6bA8ONPgAe3tzF9hs82OlE/MXPf+HVJWWkDEFVSVcd1xexxv41ubsIkX0iYYUCjTUCJL69weQOTBgU9OHVexZGFntHUjB9Vcq5Czo/DujdwoWGKj2OOsuFTqak3z1Gi3ilXuQInBDwOdtujeiurIdWER/BInKK2jDLD/O3PT4+8vn9b18gCe4La/16GQXRuWyunY3a3ldZDgLliQMdD2aXwn5GA/kPufG9Gj3uu65msKMV6D6WLVVUCIT1vlE2pYY+3fIbelMuR1LhF8IGPN/jfQNwWIyGAxFvJ6oyqf0c5Tdn1sU3mNFWRw4kxnxhnppUE2BSb5fbiTJdIdsjbAHaHECj1h0p94dph2yMknPm5bao9UYcT834HgjVtlgXKOi4L6/0JHi4A01job/Ki/k4FYv6VXx/ywor2N1mO5lImLj1mDQuMpkBC0vJBtrHrX+dmLPqBB87g6dQfC0vYzpw5VGlZLPf4OHjt1jjIeQl0aT13Dtf/IrXCojp5s/8XTiIGWDGag1dYg/gFN1D4LZv6JEX4LVQkKE3TQQL/87bIvMzb4NTXbMszV4RQslrY0i3D/gVLA== X-OriginatorOrg: mt.com X-MS-Exchange-CrossTenant-Network-Message-Id: 054a17f1-3d4a-4507-1294-08dd567bd2eb X-MS-Exchange-CrossTenant-AuthSource: DBBPR03MB10396.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Feb 2025 15:39:57.7638 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fb4c0aee-6cd2-482f-a1a5-717e7c02496b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VlNaU7+DPWUqqKbmeX2lIBjxLRcE/YlaeIQZt+sBRAv9c6A7GcjD9xw+YaVge2RCGTtXsnwPZ8QzCgpG/NvNmQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR03MB8559 The MT9M114 sensor has an internal PLL that generates the required SYSCLK from EXTCLK. It also has the option to bypass the PLL and use EXTCLK directly as SYSCLK. The current driver implementation uses a hardcoded PLL configuration that requires a specific EXTCLK frequency. Depending on the available clocks, it can be desirable to use a different PLL configuration or to bypass it. Add the 'bypass-pll' property to the MT9M114 DT-bindings to allow selecting the PLL bypass mode. Signed-off-by: Mathis Foerst --- Documentation/devicetree/bindings/media/i2c/onnn,mt9m114.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/media/i2c/onnn,mt9m114.yaml b/Documentation/devicetree/bindings/media/i2c/onnn,mt9m114.yaml index f6b87892068a..72e258d57186 100644 --- a/Documentation/devicetree/bindings/media/i2c/onnn,mt9m114.yaml +++ b/Documentation/devicetree/bindings/media/i2c/onnn,mt9m114.yaml @@ -70,6 +70,10 @@ properties: - bus-type - link-frequencies + onnn,bypass-pll: + description: Bypass the internal PLL of the sensor to use EXTCLK directly as SYSCLK. + type: boolean + required: - compatible - reg From patchwork Wed Feb 26 15:39:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathis Foerst X-Patchwork-Id: 13992715 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2089.outbound.protection.outlook.com [40.107.21.89]) (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 CC89921E0BF; Wed, 26 Feb 2025 15:40:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.89 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740584405; cv=fail; b=ErGYX82T/GSpWbthzo1aEK3spqyrBsKymrkSrikM/BVk3trYL0zCnM4tKXvBZ9KkxQJTZO7p/YZMJ1R2t8kzagP1GcjnvbBSCq2878pDD3oEa5+b1EMyunWl0UozRvUZQqQEBL53J0PQVZFvLbcwnUop5SuA/onLf2JFfAJeBsk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740584405; c=relaxed/simple; bh=OX1ZdROEMjnlj8gVmNSQqRrZvKRi2OQgZ512YHLUV+Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=C8GiSY4ON3KIG029IPuPHf79BKdsVlXRPhYWsGpHfuYiY+VKxCvT3aI2FDqNy5d0UlJO9NiCCbjzh93FTsCdjww+UKFhJtHxHwYZ1IWhrjzKA1B5wo7gYU+tkE3VM273uX2GHzumC9pixIJq/CZAkw3X4QkzfzCpXihgVwn5P48= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com; spf=pass smtp.mailfrom=mt.com; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b=GCY5hMU+; arc=fail smtp.client-ip=40.107.21.89 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mt.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b="GCY5hMU+" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=P68pzKlWBFHFA57sIqq/RUDgYZVZwLSYV+xw5EUE/Mt113GEw3pRh3k6EMAgL4RtxyLl0LzXbvXU/J/O5eufMqLL9eYvXUGIux/d+1DDqDhXKAqFxPvDXD+XU1aWx4I6YDAu/5cG3jbTqGrmbVmP4syYVvTDq/6TYDxy4HVKqgAINu0wKj+IkeKTVRTvfMqoudlovzJBYI119AIa+F9VvoVfK2ZGr9HtBcid/a2HTNgo8FlhvXCM3s2CY5NNk8UI0ebMTlMyWBU/Cm7zmnd4RWWgJnun68+/NwxdQ5NXVYc41NCLVmI0maLPzFwkv5hC/x7HGgo+qRaymAIR+mf67A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ib8KwctYeEy3grroBh22E90oTXNjxgMBTWQ9NxbcJcw=; b=zG0DmFrGLdZsgxlAWB77RU9Vn5n2HAhn9Bnn+KYckXlqEYkXBTKdPJKZ+8amSps+YSxC2HBR5bax+1TdH0Q0R7E+ntE3dbTigpzusptAVFHEfu8pFERpnoWc39nLvQv98Og8wgxWrvW7Ne+W2ZBp9CBViQmSvKOPjRslCQhP58D9xMVWnsCzEqbI2BMHVZ4gTf8odMRJ9+l3Xlx0rQdqunZ6DoOdYbXRQJBJwOPe5+z5UGkfQGozun7/49eTVuyQB9KmgRdGTReuWOwW7nccO4ebQ1kk9Z7V6nkwlJQSlhU9FVvLxAjP8wvu70yYPVloq4wMPyhkbBBAE/TzVrDmSg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mt.com; dmarc=pass action=none header.from=mt.com; dkim=pass header.d=mt.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mt.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ib8KwctYeEy3grroBh22E90oTXNjxgMBTWQ9NxbcJcw=; b=GCY5hMU+lGPF4sTUZrY6UxMe8Gd9PF19lvr3EDOXkbV+4MkEdFDn5BtCYoOf5jBytqfkJJSvqwkW+6zSfWxPrWlTi+4FElGo4Zto80l+b03CizOhG25unfUidOh7v4naA5MA8v0wfMypF1VUXx77fKqe5Ec8O4sQSOD5Zh8gy0pF9JXE9joyEDlc0oJz0nmrynZsZLFkitQQ76XtNKSwTFzrVtjtRsgTymhmtMwaIqMl+m6orMkd9LOPgqjUhperMEFrmdO7nsGg7mYp1eieAaM0B4nVA2M9GN9yo7EjxqcLNl4QosuYMB+vOiSjEqO9lk0UC7AGsHL8AL0cGAhUGg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=mt.com; Received: from DBBPR03MB10396.eurprd03.prod.outlook.com (2603:10a6:10:53a::11) by GV2PR03MB8559.eurprd03.prod.outlook.com (2603:10a6:150:af::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8466.19; Wed, 26 Feb 2025 15:39:58 +0000 Received: from DBBPR03MB10396.eurprd03.prod.outlook.com ([fe80::ee3c:c9be:681:c0bf]) by DBBPR03MB10396.eurprd03.prod.outlook.com ([fe80::ee3c:c9be:681:c0bf%7]) with mapi id 15.20.8466.016; Wed, 26 Feb 2025 15:39:58 +0000 From: Mathis Foerst To: linux-kernel@vger.kernel.org Cc: Mathis Foerst , Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sakari Ailus , linux-media@vger.kernel.org, devicetree@vger.kernel.org, manuel.traut@mt.com Subject: [PATCH v1 2/8] MT9M114: Add pad-slew-rate DT-binding Date: Wed, 26 Feb 2025 16:39:23 +0100 Message-Id: <20250226153929.274562-3-mathis.foerst@mt.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250226153929.274562-1-mathis.foerst@mt.com> References: <20250226153929.274562-1-mathis.foerst@mt.com> X-ClientProxiedBy: ZR0P278CA0090.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:22::23) To DBBPR03MB10396.eurprd03.prod.outlook.com (2603:10a6:10:53a::11) Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBPR03MB10396:EE_|GV2PR03MB8559:EE_ X-MS-Office365-Filtering-Correlation-Id: e1b2c80e-d91d-4ec9-f6e6-08dd567bd391 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|52116014|376014|38350700014; X-Microsoft-Antispam-Message-Info: SnnQOna9tHbcOYvNNynupNNVn+GHsrQga9QjSzWqFZeqvxJc7FV5ZlG89gI3AUI+TM0vLZ7sAmiiqG+bT09rFNgMof/+PClsc8hiAWxKhkfyDWI4FFkaX2+a7LGN5ri4/nlDPpniJrw0fP/Qc+4b1HIktBYQhmu+0NqKO6/eWIK1Sx6yn5gCepQUQ5NEpX67f8awQWxz/snFQvN0K6UccuLEhAiFrhsXNga540al/BbH0MpKqmIIbDWN926b+QBnrdt3RdMms+FXdAOqdKMhL7av//1xM+61hvnCbOBpts3CV3B/JYy6NkTWsZ7EMuWKC1hQ+wwK1VJjlBUC/zG8vmLkLlTddCnQSk2ytQTls8aYflt3H2O87pBOdvq+umIKTjsMG57JOKszuhVz3PgtkO+xBpBQJx7D29rYoVjyfa0oEfq43nj5cSa5IX4+8ngR9OM7wOrz9wyc5/oCI29ekDdx4FQHZ+tHdRGOMuwSnmJO9YJ/qMJoRjtcZCdi57jGfAceyY1S5N/2dgarlxcgW4Ft/QcLar0DLGvsrJHY7YKjV86a7HlqgjsUDlC+onoUCSD7Lhuv07sH6DRCtxR9jOp6TTxZoMX+gXp4uc8a37PTkDlEvc19sFA+KwmLpWSZFrhgolZGYuu8aHog6GDglIXrA+HdI+wlmQ3S5dafiIcMCm53UYZStW3hy+m9WXrqLWGVf+k/3jAEpMi7v8XVxz4MC5p1DXZq+mWJpotcPzKHTeLI9O0qoiuZtHy1Im/30D36W1Giu8EVhs3YSpXOEQo+ROll4S34KOY08G5Ne37cyNlLOO2yQgmEL9W09sokLVZLgQ6cyeC8AMlB6epvZVnCTAgxg97pmmDnv2avAX9HL8wBPgQdJ2D78inbhSGs/RkSfMGOgE1Ax1TqymiZjeVEzUWa+3UpbCR6yXAyCcNPI3omXWEj6RwsaNTn6GtzYKarC6DGPg3/NFQ1IhljukZP4QqJy99MnS5RQZZ4slxG/fSlyNnS5J0jryGVjIE1zwlrIQpQ22Nw92JjSofg9dbR7TBChszfwWkKAhtXv5fIY9cPh4fL0zESuxeJ1L6ocyEPLpm+BKlSypRN71lX7rq+sCoRjs5+rKkzv7AmfwisgOaRtZQaOR/rcP3mT58SIpZ8nYx2mwms20uAk1EUO1vzzaiRJHpdPyMZpP07aZ9OVJYfBMTw0yoR9J9+sJoRVmZvS08dTDU6P3TJmZwjBfD+6ElYQNHgFmr9ivxErSPgZWNa1E+/Vo5qxI5nhNKBxc3OTB/gonlqtpXHDVwK2CiDkxtl1n4hkc9YYcUfZYcFY+2qqvr7NPq1iUCcsBQ0GqxxVuoXUghoYM2ZYgXJ7ZBhQL1QU3xyQYJ8JfUyCtmXN37qPjnecqc5czxFhTo1xWL9ZtQfKXUReWWCtbQ7BgnBzvTK/eRu8Kxf3SBmOYScuC2nbgWpgBkoAp21krVN X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DBBPR03MB10396.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(52116014)(376014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: F65DncaERK/BVcseqRHunaEpc3Kw18rp3h9zjK0hTS2+WIkEXsoSNPTrCkP16mfGfWOVaHO2rJdoRsOLcIm1LHsHzqXliF8FC/pCBxBH/jPmUMNRVWEwp5SN6elNLBGKXxmy6cbQA8zZFaZbCT4Nsre41trOmKrQz7ZnbAbsDtoAOq1192Ky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r16gjbdIkSxFGZZBdXEGlEInehjGjvlCUc4s38yDIMwp82LzqQ6B+lKklhVIwRQO3pXwI5LBzNHZ7KAjqL8AHXFkUlwcJ+blYnqbuYNyDcYQzGmkxIcFMKkGWB0bvhvEqdCyla9/AM2/Xeaf5G4evxixnl1/UfaOv+9fUnOv8wZ3/W2zJIMgk8bc4Jmck1U99jD/qELHYWzaHt8niNQ/4JXCwLM9XqIYUr0JqJQS62/AEulmQzsoiatRC31ojiY4/BMElzJHAnAIDkBKJncZK41H+/uns4nPeoZR7Tj582eTilYWlJRzR4IUfqWmohw8UitSxtmp4htPpzogF4EnAlNr8HQP86Kt02XkeJXziqcCfcQ== X-OriginatorOrg: mt.com X-MS-Exchange-CrossTenant-Network-Message-Id: e1b2c80e-d91d-4ec9-f6e6-08dd567bd391 X-MS-Exchange-CrossTenant-AuthSource: DBBPR03MB10396.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Feb 2025 15:39:58.8142 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fb4c0aee-6cd2-482f-a1a5-717e7c02496b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: c2HzKXG/uKPy5sI+N8LqVYp8ZX2j4sz/cfHiG+y+f0bRdzGlxQVdEm0bmS1o7YO6XfuEtl3ZZVOdIGwlK7QDow== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR03MB8559 The MT9M114 supports the different slew rates (0 to 7) on the output pads. At the moment, this is hardcoded to 7 (the fastest rate). The user might want to change this values due to EMC requirements. Add the 'pad-slew-rate' property to the MT9M114 DT-bindings for selecting the desired slew rate. Signed-off-by: Mathis Foerst --- .../devicetree/bindings/media/i2c/onnn,mt9m114.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/media/i2c/onnn,mt9m114.yaml b/Documentation/devicetree/bindings/media/i2c/onnn,mt9m114.yaml index 72e258d57186..666afe10c538 100644 --- a/Documentation/devicetree/bindings/media/i2c/onnn,mt9m114.yaml +++ b/Documentation/devicetree/bindings/media/i2c/onnn,mt9m114.yaml @@ -74,6 +74,12 @@ properties: description: Bypass the internal PLL of the sensor to use EXTCLK directly as SYSCLK. type: boolean + onnn,slew-rate: + $ref: /schemas/types.yaml#/definitions/uint8 + description: Slew rate ot the output pads DOUT[7:0], LINE_VALID, FRAME_VALID and PIXCLK + minimum: 0 + maximum: 7 + required: - compatible - reg From patchwork Wed Feb 26 15:39:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathis Foerst X-Patchwork-Id: 13992716 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2089.outbound.protection.outlook.com [40.107.21.89]) (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 B9923221DB5; Wed, 26 Feb 2025 15:40:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.89 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740584407; cv=fail; b=uW2UB0lOtrwNkSsO5WWGok5x+RwsLGcTeHnxDDb4Ct91AkbbaUdAfBE7bO3zWGh8hKbJ78D9nC5/CAQwyHWnrN1iMTGnXdz/jLKeQmLfZdDYvLxN8tHjVWNFHjRIRfN6XLOranVHqo5CGRP1TJ5Z+PH5Nw/ILfd8qFc97QXAPo4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740584407; c=relaxed/simple; bh=JDyjTuUtmBrknHl67BapgfVeza/o7HEhSsMyml9s780=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=FlCmbTLd3s6wNVqSNgTcgsyAw5sfhadY6+xnj+UZXxVKHGe/2rj0wbXsQhK9O/R/iqAUC48sSNbj/QGNBW9G5T/xDUikqFsZSVVYDBhBjoVkmytCUb2MEGc6A9pETUDLzBDWaX9GoNuI8CTHe5cTmUGXhqDnNtjW/SwsE+6xNug= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com; spf=pass smtp.mailfrom=mt.com; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b=oFRAoHBG; arc=fail smtp.client-ip=40.107.21.89 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mt.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b="oFRAoHBG" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dqsW03DHtfxY8Ficj81SMrwIYyO0VH1RvZj4aERDKMKzTZItTSrKe7INjtlO3SJFh3b70GBMLLhOuddWjQ9F18Z3HACDyL/lRSUkxi7j6QAOkIGSz19l6d/bnOIFcbAYettPf42fEXA4wmx7drcx3Q3Rn+StjC79HPlXUzw6+UUVjr0VMoXmXOrhfk0QtIkCzbfgerNO+KddEwHv5Z1SkTBB4eoC8u71kgi6Pg2hkJnedDprM1YgOnsct4JP9TgXTY4hU6K77sQbOFEhgzVeDoBzYGaRQzTUWxgqv3ZA7B8mQaKAo+Ek/MZJu6+P2adYDjBm1IweVlG9Z6GoikYAkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=s1IXGsz+W3YQlgdefjKpJElb9gHzoOTFEwPIJflJ51Y=; b=T91nslIOhs0HZcXFnqfayu5TpkKogFnZN63qS3BBsXOL8TQHAJoKmDwq3V8twl0RzM3iEfXp29ajBawp3vLKc8HMBmfS2W2hMl9DKyBzQNC6AXc6pY2Lw1/mGZBLFbbaxZ05bSje2Ujzx6XrW+CpVkilrWH3y4ilqzFHfuyZaAxB60/KHL6qfsdo5Qs6HadwraPvtj8vNoHBtq5jHTeP9HthHspegvtkxYUR9rxyqvXbyxp69jHncnBMXq9fH7rne/YBajAGxOx1eEiIgqXE7dJRuIRQHUEBbmzmuwx6EdWnCAW5gammlDFZcDEYjM8kEbqiR7I6rfc3zhllVVe23g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mt.com; dmarc=pass action=none header.from=mt.com; dkim=pass header.d=mt.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mt.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=s1IXGsz+W3YQlgdefjKpJElb9gHzoOTFEwPIJflJ51Y=; b=oFRAoHBGcj/2Vp2l3DoK6MDGuXhtjq7a7e/bJXAErK2+2rUR8K1m0RFzs7shmoXP+8fao7fcTKaF4BYBN+ohObngurrioeOZN7+OE0J9AIRv5EnRdA9la4NsY7+RFcZoSyCvsov1UCgzavZ/SsU28zVa/IVQ8jxFhoOC6KP96tPA2T9TtK5MV2hWXn7Ko8vRoyrgtgku4LvUsPb8KEr0HnKXLbDwjqq65YnN0WZkMtT6+OzcaCMuyu8PHd/eLue8ifVXaOStkPt1jmck776s1ZffqRcohes3BgvMZ3S+x+1v1dWhz5dcf6orsHHubOkwZo+/TEAuFGh/ng3MszSMKg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=mt.com; Received: from DBBPR03MB10396.eurprd03.prod.outlook.com (2603:10a6:10:53a::11) by GV2PR03MB8559.eurprd03.prod.outlook.com (2603:10a6:150:af::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8466.19; Wed, 26 Feb 2025 15:39:59 +0000 Received: from DBBPR03MB10396.eurprd03.prod.outlook.com ([fe80::ee3c:c9be:681:c0bf]) by DBBPR03MB10396.eurprd03.prod.outlook.com ([fe80::ee3c:c9be:681:c0bf%7]) with mapi id 15.20.8466.016; Wed, 26 Feb 2025 15:39:59 +0000 From: Mathis Foerst To: linux-kernel@vger.kernel.org Cc: Mathis Foerst , Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sakari Ailus , linux-media@vger.kernel.org, devicetree@vger.kernel.org, manuel.traut@mt.com Subject: [PATCH v1 3/8] MT9M114: Add get_mbus_config Date: Wed, 26 Feb 2025 16:39:24 +0100 Message-Id: <20250226153929.274562-4-mathis.foerst@mt.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250226153929.274562-1-mathis.foerst@mt.com> References: <20250226153929.274562-1-mathis.foerst@mt.com> X-ClientProxiedBy: ZR0P278CA0132.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:40::11) To DBBPR03MB10396.eurprd03.prod.outlook.com (2603:10a6:10:53a::11) Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBPR03MB10396:EE_|GV2PR03MB8559:EE_ X-MS-Office365-Filtering-Correlation-Id: cc5d04e9-fcd3-4990-bb32-08dd567bd422 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|52116014|376014|38350700014; X-Microsoft-Antispam-Message-Info: KcIxXU+LRaKjx9vKt5tr3Z1XNHMw7yW10fKQd+UpkB4cmHcg3ZECuNQFfMM8lfiCjNHexrd/64soBoJUdsd1z/hLv2JlbRwURtuFtWXDCDwM7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Ghyu47Vd5/99bkbWWJUDe/rdIJEzHi46Wpu/4CpenJzoPoksLo6Nius7hZvt0fsvY7bBk8GlJFe3Kxvykv8jrMh5MhzUronrymHZ7q/m18HWlmgrm7GW5QVKCdmlaDKluP6TSKABc1bPOBy3yDA6FkrNpXWbaDlGzwzUL+ZQwZUjB+CiFGYmddIK3kL4rJm267syGAkta1BxsU9s6SKY7H3zzL063EVOaQcCPiINauTY8Td8o1nvyzJfMCZ74advNVb1DseL48zg2OPNWoVwqW+/fD65XsP7PeP X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DBBPR03MB10396.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(52116014)(376014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0ePC8bCP6roW3jkgbDZ1ceQ5g7FGPYOBxj2e6IySPR120t0I1awye8gWuExVgwXkuPY0CWfpY7HHyuZ1IwxQXuOX5QsL9WFrRSsAffW+Y0eC+xpdw2aegVLTsabAE9wY21aN/shm02LftmvHdLXIHfNVKvF4X2wsLg+hTefB84kH/r0K9h2Mq10d7y7DbC5VU9+Yja0YN2dA6PMl+YWSerzl3hlwEfFEEK8Jx0mXknv7yMhtWMaq4+h7cudFREiIDKSPyiZw6RX5pstd1NzkBwz1xAfqv+iu+VZc2fUgcUbSU2p+JLOuTcfadPmFBX0npcTmOCOedVr7rwQKBy73gNwQTqYdojzKkHHP2atM0THORG5GY55+5ACMWKn52tUbnUi2REVw87aywCFzlGTg+6immf1em9tI4EDYU5M48TC+bVtdS5PzE7idAtR1QgVVFsktcLs7Xp/2EJ+pR1Xj9ujQzEYNJ3pFgpBjoZVgBI6KYis4t0RTuesS1GYGNrJ2dQsNSXKQO2wDsKhEZBe7hqIWelWZynD7sETflau8yIPUK/MjfdAw73x0bAlG6C751EL40g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cd3-4990-bb32-08dd567bd422 X-MS-Exchange-CrossTenant-AuthSource: DBBPR03MB10396.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Feb 2025 15:39:59.8365 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fb4c0aee-6cd2-482f-a1a5-717e7c02496b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4CQQi8BHfKIRxlL3SexzejSz17Yrb11rQFgKyoXHadAuoTNIoNdxy8/jFTPUO4LBhs69kjrKld91uiJKFRCvhQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR03MB8559 The i.MX6 camera frameworks requires get_mbus_config to be implemented. See [0]. [0] drivers/staging/media/imx/imx-media-csi.c - line 211..216 Signed-off-by: Mathis Foerst --- drivers/media/i2c/mt9m114.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/media/i2c/mt9m114.c b/drivers/media/i2c/mt9m114.c index 5f0b0ad8f885..fa64d6d315a1 100644 --- a/drivers/media/i2c/mt9m114.c +++ b/drivers/media/i2c/mt9m114.c @@ -1977,6 +1977,24 @@ static int mt9m114_ifp_registered(struct v4l2_subdev *sd) v4l2_device_unregister_subdev(&sensor->pa.sd); return ret; } + return 0; +} + +static int mt9m114_ifp_get_mbus_config(struct v4l2_subdev *sd, + unsigned int pad, + struct v4l2_mbus_config *cfg) +{ + struct mt9m114 *sensor = ifp_to_mt9m114(sd); + + if (sensor->bus_cfg.bus_type == V4L2_MBUS_CSI2_DPHY) { + cfg->type = V4L2_MBUS_CSI2_DPHY; + } else { + cfg->type = V4L2_MBUS_PARALLEL; + cfg->bus.parallel.flags = V4L2_MBUS_MASTER | + V4L2_MBUS_PCLK_SAMPLE_RISING | + V4L2_MBUS_DATA_ACTIVE_HIGH; + cfg->bus.parallel.bus_width = 8; + } return 0; } @@ -1993,6 +2011,7 @@ static const struct v4l2_subdev_pad_ops mt9m114_ifp_pad_ops = { .set_fmt = mt9m114_ifp_set_fmt, .get_selection = mt9m114_ifp_get_selection, .set_selection = mt9m114_ifp_set_selection, + .get_mbus_config = mt9m114_ifp_get_mbus_config, .get_frame_interval = mt9m114_ifp_get_frame_interval, .set_frame_interval = mt9m114_ifp_set_frame_interval, }; From patchwork Wed Feb 26 15:39:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathis Foerst X-Patchwork-Id: 13992717 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2089.outbound.protection.outlook.com [40.107.21.89]) (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 BA7A4223330; Wed, 26 Feb 2025 15:40:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.89 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740584409; cv=fail; b=A/NV09A/Cu0OwGVyYiLkzlB9rrlEptr5cCPObeVlqvwx1KzQSzBgTS7aBnfRovIKgVgeFYjb9jq+I+ppuUzkTlx4ZKHd/kc2/wU9bslu/9LXdAAXz2X8Gp5t+FDDEmiZuJhsIO/sIPUQnBM5iCrsb6j6bp1LUQId7mTeimoguec= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740584409; c=relaxed/simple; bh=RP+o10M8l64pkQvEGKdkMNQJ44dETFn+DX+SSAclQTU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=id6HQ/Z1EWVaY9vmQRYwtBcm2MC7ypEpUfZJVxvUKhr5xl7VB2Mw+X4Uu8C5expLTnr9HlJB24WpBJDFO5mzwSJ/iv0tDK29U5F1PVR+dxHhxouPNtfd/lMUR6QjZS35H2jYmY28DshkM4Ap7ZrgjTULlvQnRGREL8mP9wpCHHA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com; spf=pass smtp.mailfrom=mt.com; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b=lRpa+PNU; arc=fail smtp.client-ip=40.107.21.89 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mt.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b="lRpa+PNU" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yWbg8KrvpORmPMzqXs5fHTZhGJXOQwsUmyEoYMdWZ8USG2US6hitlprUyzbBqjAyIqaPHAL2Kxyc3JwNftVdUbc7cIerWeLoqGRNunRhYCZglncxNHgrFIGi0+bL7vpF1/baumqvlKZveczyPu3dlVaaFHkfQ7A723CPBLRHIl4Swy5pqIGVBeW0vBGfqs6QD8vlmQ4OAhhQ200DJn4ojOPlZ8asUNprnHnBKRNF9yLaQZtiumaaS7gkF3K17HVaOza0aQHO6omnn3GJT0yjJDRPHu5/rmHcT7rfaLpejqh0HtW6c5r0jm4LE/9g9Ul0s+PTuyD6KEBSd0bZ5Wj8pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TfSZI3TLRGGiNHLp/JIrVZuvrz6FUYarlpD348u1iG4=; b=oMZAubd4cuMuhMLW4AsFey+YkFDu0DRp6JeDvMXvhnaD6dkWJzYsMPROAIT7S5OEsWEoke3RihM2EC5Wk4DYyj3jNm2++BKETxoqW3XPYQDxGNUzHelchKUfWOUs2S1vHqnbaqlCxiNdclrZH4W1hQ5LRsrFC00+qrpaSfed0/6j+sXNtOnNAr9DUQtmaAmoGOioL7xZs0MKpEYFZRgRiebDpCyqssWrPeUMVOnMKIz+uF9t2L8QE7R7EB1BqIHhGCwzY/ITEtRcC0u0poWsNIzsa3DNjCQPEGegRbkYlCdlzVg8AA3tzNYfeKCB+qi37nVMHdgp2g8FO2RUI2t9Aw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mt.com; dmarc=pass action=none header.from=mt.com; dkim=pass header.d=mt.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mt.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TfSZI3TLRGGiNHLp/JIrVZuvrz6FUYarlpD348u1iG4=; b=lRpa+PNUcgQrhmHRRz+4IekE3W96L2lz7KqsXWzDtIgj+t4rGK7Quz3f2zts/bPHDyd3eZ23wCiuKx0cVLNjOuHN3LQEL4Yg2esUHzXKrfr2Oqo5PpmpzgArG/gwNERzdI+UGh9iCo17ham5VVtitMwbGW6IKtTcCvjMlaLGaSEqF5pUwHlnmiwuDDfkwTCVsnQK41k6jxZCvDTrd/XGigUYmyO4iHGYjmhoiHfrbMZdZ71oUIUejZyxPA0xqfciAWrcCjte2NPJyw6FnWVax6lTf1CLOSJfqSqCXzE/Fo1ZSVIU+A3Ouj30PyUl74ncOFjYdywITdn4nVjyAg+g2Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=mt.com; Received: from DBBPR03MB10396.eurprd03.prod.outlook.com (2603:10a6:10:53a::11) by GV2PR03MB8559.eurprd03.prod.outlook.com (2603:10a6:150:af::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8466.19; Wed, 26 Feb 2025 15:40:01 +0000 Received: from DBBPR03MB10396.eurprd03.prod.outlook.com ([fe80::ee3c:c9be:681:c0bf]) by DBBPR03MB10396.eurprd03.prod.outlook.com ([fe80::ee3c:c9be:681:c0bf%7]) with mapi id 15.20.8466.016; Wed, 26 Feb 2025 15:40:00 +0000 From: Mathis Foerst To: linux-kernel@vger.kernel.org Cc: Mathis Foerst , Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sakari Ailus , linux-media@vger.kernel.org, devicetree@vger.kernel.org, manuel.traut@mt.com Subject: [PATCH v1 4/8] MT9M114: Add option to bypass PLL Date: Wed, 26 Feb 2025 16:39:25 +0100 Message-Id: <20250226153929.274562-5-mathis.foerst@mt.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250226153929.274562-1-mathis.foerst@mt.com> References: <20250226153929.274562-1-mathis.foerst@mt.com> X-ClientProxiedBy: ZR2P278CA0041.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:47::10) To DBBPR03MB10396.eurprd03.prod.outlook.com (2603:10a6:10:53a::11) Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBPR03MB10396:EE_|GV2PR03MB8559:EE_ X-MS-Office365-Filtering-Correlation-Id: b5435a6e-9e30-4a8c-653d-08dd567bd4ce X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|52116014|376014|38350700014; X-Microsoft-Antispam-Message-Info: f0n7dFPS4o1gxC08HDUdQGhITEDTWkml3x8HxQq/jvcXZSgsJ91k9m7vakvl7Cz1+UfgROUw/nra10PRjgcgweYUMNBj3PsWXb3SKQ/Cc1sSn0S8wcBz7ZKRs/8jPz/NK7P7zsTn30MzCZdn3hhhuWcp/55JQyPfz2zMAzD3dGUjiNvREEWncpMjOrTwULIa1z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givj2mavqV8t02S3pQeQSAoLXWXbXjfMbqVlbQ4ey33VU746vEIhtnS8yKwkedt/51p4DYmLVxUEPTC2OvYfE/uo8vppCAZtQUvb3j62F/ViTViql6MCbQmAzoTuFtoaR47cJ/dnbGa2ZoI/pdNWACqebxvS6w+ewyZuuFCOMOn1Vdofez5hrWxVHO6k3lt1xeIJYc X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DBBPR03MB10396.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(52116014)(376014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VrXcqAPMbVfqyoPxRky5xh0iK8ERSK8NyiscQCyH9sZygI+6be6WqBKGre5ga0WFqoMAoZAkaheMRTInJp0QqUsPT6a+oqcS4W/r1atJqG5xXb+g7TiXIvXBRRCqoByzbIZBiwD50VD7UZuMacl7wM2upHEm+wtP017wP2c3nKG/I8DSODpZWvqJojn1FAOvVktosuWJthNKnJFl1rv9gQwc8Kt5eeoSW2rQ/ctf5d4WyLymveCuCFnywZp20UdeDrVHSzZLv/rL0ibesVxOd1j6ubu1EoaRhYE5HOkQHUBu2ZE7hPhg9Dy1YSmzXUr1M5sX9wx4qpFp6mn7hMSLkB3ltcpXFx7iqT5PkeeTGfGGFU2cS/8ax4aRVX/5b5skCPk/NFjIodYRacTiXAIvjadV8U8lA3x3FLdMhHz7AEUYkr3BNM5dZ06OKVIJc22xFzyr17dQMfvjPBZeEqb+TE1ajvL5lF6ROlBMHVNyHjyKwkGLzwMvJBhMqs8Xz6fjrhyM+GUBja3PRZkwqDTs+a1tfZJqTLCrA1o+X+oTYKpybJPjQgPpHgoQwvX06I9KmPVss8oDQY1FU3sTAGX2VR++lSx6hyT7ZM80Bs0mg86MIlEUASzBC5L5sMJcEcOxIwn+QtSZnXpIG96HDfFF5LIGoHBKB4w99jCkoOg5IDha88/RigQoOyCT/wtn6hlNwPbXw2hRICIFTSX8b5VG57UMgd7PS8EAHuBPf9pX1+F4WdoYZLEbJ6xWspoeqJiaagPX1H7bgsirJuIxpLyOCgnJtvdx50tCepzslX9cEFp8FwdDithxqamwTjmr1qCxWQA2e6L9A6rxl3X3WLRRI4vOBUq4HO4s9qbDw3YrsJoqx0kaMAQudrK+3dF3v30jnOJEJSnD3eay2REZYlMoQnl5t5DVh2A6N9R16mi8waylg/3bQuHQuVcHyPgZDlWwQ638BpdbFhM9eQjMXqnLBGNr1u+dPqorLOeKH80Hvl8o5M5hDkQUS/zCA5p7/ES61cBMRQ0lmbj/tfMCnBn+nA4gMFvds+w5iMCDEBYy/gizJpvtgXCe6//VAj8WVmr3eRrmCshYKu3q7Z72ZxTpPRCIBZEL+vmS1GrYHgT6DK+Tef+3avsb89JSaH4LBQPzaeWVcxxHNmnIDAqKh99eT0ZqoNfpodtKa4LbL9zrpX1IumbU8LmwjKThPd285/10P4KDXMkWedUPkbkVgL21zX/sUhWyCI9eR3k2LyV3Ra0e/Rjw+Fq3m4CGqAgqUU1KCnzph6EbfksCqLrEB7XqdTpbdeVjSWQbnWT+VpJqtICpmewRKAXWpSFbfmuRcjpQPpgfcVYl7y+6aN+3nul0bxxlbZ2NlYwQNDyihXf+ZxrxPdtsh1wdHBm8osqErjaTZ4jcqfcbS7iognYxFf5cufhUHqZibxMNdGECkp1sXZqSh/AtFbJH0B60Kxs6AnHb/1a/Mut5uuodvGGbFzQ3ZFmiTE3V76gyfsXBCyQGrPiu5f6kdsatnrYDwFxxSFe+GwZqQAbHNqH6yA5f0X2AgSwVgjTguvNpSBcsqZztuQL67LoTZVo68qHvJst8mgtZ X-OriginatorOrg: mt.com X-MS-Exchange-CrossTenant-Network-Message-Id: b5435a6e-9e30-4a8c-653d-08dd567bd4ce X-MS-Exchange-CrossTenant-AuthSource: DBBPR03MB10396.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Feb 2025 15:40:00.9116 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fb4c0aee-6cd2-482f-a1a5-717e7c02496b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CeIeq8ADgZNMXbKS/NpqdxcJi9UTtOHHe4DPwRe2hBspWNMDS1ZdHtvtqvOBCT9pw3jSLai5tpQRMKyZ/xyQ0Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR03MB8559 The MT9M114 sensor has an internal PLL that generates the required SYSCLK from EXTCLK. It also has the option to bypass the PLL and use EXTCLK directly as SYSCLK. The current driver implementation uses a hardcoded PLL configuration that requires a specific EXTCLK frequency. Depending on the available clocks, it can be desirable to use a different PLL configuration or to bypass it. Read the property 'bypass-pll' from the DT in mt9m114_parse_dt(). Depending on this value, write the correct PLL register values and calculate the correct pixel clock value. Signed-off-by: Mathis Foerst --- drivers/media/i2c/mt9m114.c | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/drivers/media/i2c/mt9m114.c b/drivers/media/i2c/mt9m114.c index fa64d6d315a1..edbc0447141d 100644 --- a/drivers/media/i2c/mt9m114.c +++ b/drivers/media/i2c/mt9m114.c @@ -261,6 +261,7 @@ #define MT9M114_CAM_PGA_PGA_CONTROL CCI_REG16(0xc95e) #define MT9M114_CAM_SYSCTL_PLL_ENABLE CCI_REG8(0xc97e) #define MT9M114_CAM_SYSCTL_PLL_ENABLE_VALUE BIT(0) +#define MT9M114_CAM_SYSCTL_PLL_DISABLE_VALUE 0x00 #define MT9M114_CAM_SYSCTL_PLL_DIVIDER_M_N CCI_REG16(0xc980) #define MT9M114_CAM_SYSCTL_PLL_DIVIDER_VALUE(m, n) (((n) << 8) | (m)) #define MT9M114_CAM_SYSCTL_PLL_DIVIDER_P CCI_REG16(0xc982) @@ -377,6 +378,7 @@ struct mt9m114 { struct gpio_desc *reset; struct regulator_bulk_data supplies[3]; struct v4l2_fwnode_endpoint bus_cfg; + bool bypass_pll; struct { unsigned int m; @@ -743,14 +745,20 @@ static int mt9m114_initialize(struct mt9m114 *sensor) } /* Configure the PLL. */ - cci_write(sensor->regmap, MT9M114_CAM_SYSCTL_PLL_ENABLE, - MT9M114_CAM_SYSCTL_PLL_ENABLE_VALUE, &ret); - cci_write(sensor->regmap, MT9M114_CAM_SYSCTL_PLL_DIVIDER_M_N, - MT9M114_CAM_SYSCTL_PLL_DIVIDER_VALUE(sensor->pll.m, - sensor->pll.n), - &ret); - cci_write(sensor->regmap, MT9M114_CAM_SYSCTL_PLL_DIVIDER_P, - MT9M114_CAM_SYSCTL_PLL_DIVIDER_P_VALUE(sensor->pll.p), &ret); + if (sensor->bypass_pll) { + cci_write(sensor->regmap, MT9M114_CAM_SYSCTL_PLL_ENABLE, + MT9M114_CAM_SYSCTL_PLL_DISABLE_VALUE, &ret); + } else { + cci_write(sensor->regmap, MT9M114_CAM_SYSCTL_PLL_ENABLE, + MT9M114_CAM_SYSCTL_PLL_ENABLE_VALUE, &ret); + cci_write(sensor->regmap, MT9M114_CAM_SYSCTL_PLL_DIVIDER_M_N, + MT9M114_CAM_SYSCTL_PLL_DIVIDER_VALUE(sensor->pll.m, + sensor->pll.n), + &ret); + cci_write(sensor->regmap, MT9M114_CAM_SYSCTL_PLL_DIVIDER_P, + MT9M114_CAM_SYSCTL_PLL_DIVIDER_P_VALUE(sensor->pll.p), + &ret); + } cci_write(sensor->regmap, MT9M114_CAM_SENSOR_CFG_PIXCLK, sensor->pixrate, &ret); @@ -2268,8 +2276,12 @@ static int mt9m114_clk_init(struct mt9m114 *sensor) * for 16-bit per pixel, transmitted in DDR over a single lane. For * parallel mode, the sensor ouputs one pixel in two PIXCLK cycles. */ - sensor->pixrate = clk_get_rate(sensor->clk) * sensor->pll.m + if (sensor->bypass_pll) { + sensor->pixrate = clk_get_rate(sensor->clk) / 2; + } else { + sensor->pixrate = clk_get_rate(sensor->clk) * sensor->pll.m / ((sensor->pll.n + 1) * (sensor->pll.p + 1)); + } link_freq = sensor->bus_cfg.bus_type == V4L2_MBUS_CSI2_DPHY ? sensor->pixrate * 8 : sensor->pixrate * 2; @@ -2321,6 +2333,7 @@ static int mt9m114_parse_dt(struct mt9m114 *sensor) { struct fwnode_handle *fwnode = dev_fwnode(&sensor->client->dev); struct fwnode_handle *ep; + struct device_node *dev_node = sensor->client->dev.of_node; int ret; ep = fwnode_graph_get_next_endpoint(fwnode, NULL); @@ -2349,6 +2362,8 @@ static int mt9m114_parse_dt(struct mt9m114 *sensor) goto error; } + sensor->bypass_pll = of_property_read_bool(dev_node, "bypass-pll"); + return 0; error: From patchwork Wed Feb 26 15:39:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathis Foerst X-Patchwork-Id: 13992719 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2089.outbound.protection.outlook.com [40.107.21.89]) (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 F01303209; Wed, 26 Feb 2025 15:40:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.89 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740584411; cv=fail; b=fB0qecOBE6JgOrDrvwLJ5MWazU+5XQxcltAsGBQGmCwK+O5HE002vnbZqdV7PHe45+JFJlYSoKi50/qWgTp04KE/osgodkzR+XqUHN6fed/V9qQRu46n7BUtxWK/dRQq29yd/GO7CKdBy1SAXjNIvqOZ4D8Ra+lNYTLTEm5c+R8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740584411; c=relaxed/simple; bh=+AuiWZBHdI6gQjcYQlUWYJStVL6sKuzSEVZ86ENVR1U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=AOzfd43TzwbdbVZrmxYk/VB/uDdEjNXVODDW2XT0nFELZdfIOiY++Hbvz8OQSZhwnGbTYGXxwUSDyzDE5wZMRwweNqS449Oo26c1d/l+jnYK1Jq5Tw78HCJnhtMjL1I9X9KANQntAmwp7wS3MB38CV2TpyHDwz21SWBS9bK8v58= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com; spf=pass smtp.mailfrom=mt.com; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b=hygyxhFA; arc=fail smtp.client-ip=40.107.21.89 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mt.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b="hygyxhFA" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QOLW6uPt+/VXJqmmOsw8YKSJmrtVTXctyjMXtGNmkWMdrdCuzygfyzuSu3bqS7ee9bkpdRhd1iz3QuXIDgpY1mfydMgRMvz8bpq1qsMDoQMpBG4WENnfwDviFuvQuypQjQngW5jzjq4md8FnukZPC9Dh0tWDMtjgPIcaD/O4nkPX0i5jD3+h55HPpHj6e4Ceb+ed9Jf3cUhn6VsP5vDm85UxDOw5JihM0sTMO5IwBJgyJ8E0mHCF3fjEb3f3ykEVcrOOEw3SQoMUmdXDtIKI5obg9LAC9a8LR75mdieubeJ9GBZ8cpikjoiV9zf1V4r6v0tL/PorSbQ04ttlMYmfJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yc0f5rTXwBAs7/o7qyPsXP1fZ7bs10GaJgGqKOErqQA=; b=FgsrWbGe+CAI/lUpZUpAtMFDo744AKJx8wZXiLoITQ/5YlPCMd5L7ZX7bc9sWJbjuvTBs/RE0vv1sGQxfTubra0+Q/7f+GY2CrnWZJv+pBPVeoZD7EmJIaO02d78lPAKJduSoMTjVoC6ckuGJppo2/xvyXieKSHLpVAL2xxfquTjXObxsY6g6vLKXbDO60fxA6599vjrXpQSnffNAVD7ekMZiLaA3cixc+meDnwl1sYj0racSev7jDLiUWT2jslnwC7bXk7MisNFs3cuP3+RQIh/Vg/61PT5un94KnAUa7ATiMumDss9wrqIe/6421Os2dfi/7TdPO11amieogogYQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mt.com; dmarc=pass action=none header.from=mt.com; dkim=pass header.d=mt.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mt.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yc0f5rTXwBAs7/o7qyPsXP1fZ7bs10GaJgGqKOErqQA=; b=hygyxhFAJw6uC25JL4IopYxPtseElKlf+XaDRYZXtTkkESVm79v0ym3aEkWhj8rz9Twv73ANRtgm+rjPFRN+nuj6opg2MvinUw77QUlrg5cca3pvr2BCREAZ4I0JGereXto7YBFIzaBRH57TsY3lXukgZH0+hpMFzyGltd3uY0MxqC8Usao+779FgM3XlnU7gjTKdAk2Df/arsgfjHQYFmKIBXtGOlDzKoIYUdSl0lmHkRnPG1sWQyB4Jr6QeZHtv9ny6TapmiMgfC5Kd78h/Q7YHQzrBmNFsDPnwmWJcioY7afMwyk3ah1iB+xKfNKwao73KipOURRhsRAsJpDHHg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=mt.com; Received: from DBBPR03MB10396.eurprd03.prod.outlook.com (2603:10a6:10:53a::11) by GV2PR03MB8559.eurprd03.prod.outlook.com (2603:10a6:150:af::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8466.19; Wed, 26 Feb 2025 15:40:02 +0000 Received: from DBBPR03MB10396.eurprd03.prod.outlook.com ([fe80::ee3c:c9be:681:c0bf]) by DBBPR03MB10396.eurprd03.prod.outlook.com ([fe80::ee3c:c9be:681:c0bf%7]) with mapi id 15.20.8466.016; Wed, 26 Feb 2025 15:40:01 +0000 From: Mathis Foerst To: linux-kernel@vger.kernel.org Cc: Mathis Foerst , Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sakari Ailus , linux-media@vger.kernel.org, devicetree@vger.kernel.org, manuel.traut@mt.com Subject: [PATCH v1 5/8] MT9M114: Factor out mt9m114_configure_pa Date: Wed, 26 Feb 2025 16:39:26 +0100 Message-Id: <20250226153929.274562-6-mathis.foerst@mt.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250226153929.274562-1-mathis.foerst@mt.com> References: <20250226153929.274562-1-mathis.foerst@mt.com> X-ClientProxiedBy: ZR0P278CA0046.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:1d::15) To DBBPR03MB10396.eurprd03.prod.outlook.com (2603:10a6:10:53a::11) Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBPR03MB10396:EE_|GV2PR03MB8559:EE_ X-MS-Office365-Filtering-Correlation-Id: 72887143-9a39-40a4-7126-08dd567bd564 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|52116014|376014|38350700014; X-Microsoft-Antispam-Message-Info: 1wL5aMSfvnWDaV/2od2G6SIIZ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T/6y8Ap57DQyrEp2Z4ZloqEhcIuOCdDODTlDuCU1gbse6EW6vyHtXFQ4qiupVwicPi74y1XZzeXKxL5IFJ96OV/7x4LUhgMCdwKgMT4a9GVGXQM56bLJfGjW+MgsE7W2ZuNhUO+swvhGuWLLZ2BulO15WWSTQ2JFl3vZ0Zucfr+/tbaBKu7xf4Duyzhu4tJJw3R7SJ4o+9bZwDNyEP3QOAuiNBZLmyIVB+HdKYw4foSWejRzRnt/XZ1L9eHErWpj4hBZW8qj3Iug9R62iD1BRnLCk6A+BP5wz8X/Q/pY1X3dQeVMqjX1zHm1FI88+G4F2HbsFbHrZ4HcK8vnyWP1ObOtj2W9J4jO1JBd9Lsvt/ublWxQSqRV+QIuZ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DBBPR03MB10396.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(52116014)(376014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3zZHfqTUcf7pNBkgukQSLJdP5pO+2GpmP0L/fSI7mWKPqXxTrYCgO1+QCntBC4GlkEryO5Ik2wDILC26M6v8h/oNgp2GsDnJ3dkDAaKuvsctpFJhZUfDjjHhC37D41eMLsmm7paRBdjOGo5HwQWM8scytBu1mW3w41zNVzjblHF2febemAzxkI35CVqTTxZdWX1TIqpwEw1BL0wjyfF4DK8+sEaEcLcJmTRdsMNcaNtXQd2iPLEUuccO9VIocluDS47E8svNN3mtKfwbKK9QQmTrHSj9Iv5B528g474qs1s7m9GJpk2cB4+NhJ1WNflULwpJkn7Raxui3muV/6a99cBLTSkDYKfOPl7Y5GLnOChXxXYcFJzrRtYBl1YEsWvZdEUSjva1XCvY3bWVyjHxRzyFdzak0km/b3qyXZTqsysnK2gm633hXCozrWmGPJ45FL1s1jRhaCfIYMPy0NUbj5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3ku6P2cH9uw2+wg0N/RLH9r97ddb3SHOfhguXe6nmHGXv5Gl7wxhF0++WBr X-OriginatorOrg: mt.com X-MS-Exchange-CrossTenant-Network-Message-Id: 72887143-9a39-40a4-7126-08dd567bd564 X-MS-Exchange-CrossTenant-AuthSource: DBBPR03MB10396.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Feb 2025 15:40:01.9070 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fb4c0aee-6cd2-482f-a1a5-717e7c02496b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TzrwzynP0AJ2tFXYILTvVjKaic+RtPsBpaPQEh1ZPT6TaNks5roOdkroZdfmuRTeJy+/5oGZsslyjoH3OiTVag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR03MB8559 The function mt9m114_configure writes the configuration registers of both, the pixel array (pa) and the image flow processor (ifp). This is undesirable if only the config of the pa should be changed without affecting the ifp. Factor out the function mt9m114_configure_pa() that just writes the pa-configuration. Signed-off-by: Mathis Foerst --- drivers/media/i2c/mt9m114.c | 49 +++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/drivers/media/i2c/mt9m114.c b/drivers/media/i2c/mt9m114.c index edbc0447141d..a1976da74c08 100644 --- a/drivers/media/i2c/mt9m114.c +++ b/drivers/media/i2c/mt9m114.c @@ -789,39 +789,22 @@ static int mt9m114_initialize(struct mt9m114 *sensor) return 0; } -static int mt9m114_configure(struct mt9m114 *sensor, - struct v4l2_subdev_state *pa_state, - struct v4l2_subdev_state *ifp_state) +static int mt9m114_configure_pa(struct mt9m114 *sensor, struct v4l2_subdev_state *pa_state) { const struct v4l2_mbus_framefmt *pa_format; const struct v4l2_rect *pa_crop; - const struct mt9m114_format_info *ifp_info; - const struct v4l2_mbus_framefmt *ifp_format; - const struct v4l2_rect *ifp_crop; - const struct v4l2_rect *ifp_compose; - unsigned int hratio, vratio; - u64 output_format; u64 read_mode; + unsigned int hratio, vratio; int ret = 0; pa_format = v4l2_subdev_state_get_format(pa_state, 0); pa_crop = v4l2_subdev_state_get_crop(pa_state, 0); - ifp_format = v4l2_subdev_state_get_format(ifp_state, 1); - ifp_info = mt9m114_format_info(sensor, 1, ifp_format->code); - ifp_crop = v4l2_subdev_state_get_crop(ifp_state, 0); - ifp_compose = v4l2_subdev_state_get_compose(ifp_state, 0); - ret = cci_read(sensor->regmap, MT9M114_CAM_SENSOR_CONTROL_READ_MODE, &read_mode, NULL); if (ret < 0) return ret; - ret = cci_read(sensor->regmap, MT9M114_CAM_OUTPUT_FORMAT, - &output_format, NULL); - if (ret < 0) - return ret; - hratio = pa_crop->width / pa_format->width; vratio = pa_crop->height / pa_format->height; @@ -853,6 +836,34 @@ static int mt9m114_configure(struct mt9m114 *sensor, cci_write(sensor->regmap, MT9M114_CAM_SENSOR_CONTROL_READ_MODE, read_mode, &ret); + return ret; +} + +static int mt9m114_configure(struct mt9m114 *sensor, + struct v4l2_subdev_state *pa_state, + struct v4l2_subdev_state *ifp_state) +{ + const struct mt9m114_format_info *ifp_info; + const struct v4l2_mbus_framefmt *ifp_format; + const struct v4l2_rect *ifp_crop; + const struct v4l2_rect *ifp_compose; + u64 output_format; + int ret = 0; + + ifp_format = v4l2_subdev_state_get_format(ifp_state, 1); + ifp_info = mt9m114_format_info(sensor, 1, ifp_format->code); + ifp_crop = v4l2_subdev_state_get_crop(ifp_state, 0); + ifp_compose = v4l2_subdev_state_get_compose(ifp_state, 0); + + ret = cci_read(sensor->regmap, MT9M114_CAM_OUTPUT_FORMAT, + &output_format, NULL); + if (ret < 0) + return ret; + + ret = mt9m114_configure_pa(sensor, pa_state); + if (ret < 0) + return ret; + /* * Color pipeline (IFP) cropping and scaling. Subtract 4 from the left * and top coordinates to compensate for the lines and columns removed From patchwork Wed Feb 26 15:39:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathis Foerst X-Patchwork-Id: 13992721 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2089.outbound.protection.outlook.com [40.107.21.89]) (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 F3A0E224B15; Wed, 26 Feb 2025 15:40:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.89 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740584413; cv=fail; b=pnMPf/xUk4gP3nFbLDJ474La7AH2jmDXBzm50pFP/wvQbKE4ufoJPWG7cEOJqcw01qtH8TO8Cnzf5K9+4NjL+k59IMaTiIa9NNj2hKxU5K+xZ0atUuHsa93R7bLYlg81YE2Tlhvernm8iUPmyWUUmfyW79IDxSZNnGTnKz/uTSg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740584413; c=relaxed/simple; bh=176Fg9aeaKYOFYzKxNM0nfFiKzrP7YvaRDSCNoLhED0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=PkFCO6yiY+078r52NQznWojMMm1pIIxXw/5nPdblSP3/1/mxWqL5p7Lg6dyyn+BXjCwTdPKPnCKeJpdK8S04z7/HT7/dG1S5eC8i1IxPbseKzNUsFDMV9wsyyzuZqymeJ9eOoiIrrYC1yHj+lpBTcBzZOjB2YydOlluR7HEkyoc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com; spf=pass smtp.mailfrom=mt.com; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b=xKYBUn4U; arc=fail smtp.client-ip=40.107.21.89 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mt.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b="xKYBUn4U" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lI3PZxNt/0KwAyGOl5EUpeWmd4RdTPiDJ2+SVdtbRHhCmxChhJ26Mk2XEn4moKf0y/6jlLri88OqdoxSZJoPP/RMQ02i12gooDpjmgnUmDhK1V1YQHuQJAJWnu//DELO36lds6JwMvezH9IeQlEvUTkxNHGr7SwbcDut/MLsN7o00fhmJGGkpRohq3Oiw8fWpXCGTeY5bek0gyXgcEukoQIr5P0gkYwtin4EGRE//ixIwVCxxf95jeXGLZAtEEnLsub19iQnM3QnX1eOh/LR6uxRKFz1O9b3WTIXn4bwj2Lx90pV8wNFrNLf1rsx32vrlDchsqfklDWY0om9wB3zBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=s5retvrIfN902pYWgyW6LA5ck2sdmGzIu6Foojuk58c=; b=uD9ikhSCnogmWboXeBPiEK/t8JKKiktJt09b2ERc84f+YdSedtY/QoWfr4qj5JP1gTT0Vn39RFqO83yjCI3klp5cb+7klN2h+r8E4CTncADAZ45vF6lk3inTLLxQBGQsz+GHQNsLzO36dRLwR4bJ4jD9/3UpwsgoSLIgu+5KDlVLENhuPh+gGyzLFlQXGQ+Xldxd+Yz+o4RTAwHkoSm0/AuL+RDbD1ACT+Cu1cwbu9BH2P+WZFIINyDg2ZDv4J3CnXA1ibdl1i51J2YL0JaWh7pHNRoP3m4UWhaPXGv9p7c2+7QL/gauXPgpe63Omj0e2U9Rp8W17hSLBYoG1I4Klw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mt.com; dmarc=pass action=none header.from=mt.com; dkim=pass header.d=mt.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mt.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=s5retvrIfN902pYWgyW6LA5ck2sdmGzIu6Foojuk58c=; b=xKYBUn4U3XPL8R6rjyb9WDXqHQYRe1IzAfw6dQc0W32tF7OucEFnYSokX/EE/PrLw/vWzp+/51WMityHkJ3+ZeDVyXlCkd5vK1Czz0NF3HuugW06L2C6I16LyP2CYdIexcV2KIPf9vpZL8dY0nkwkNGBzBSv1Tal52FXBQxaj8fmj+hIX315y9kotB9eJqSrAGJ4wtOnbtbKwOD5jmjcGEwDX8z0IW8vpCVpLcids//uPd4NSuaEpUBM4QNa2s286cjfKsxBKUBQuQHn2dxk3aFm2aHPoYOb6xBHduuzxqOKUWxVHKOedeRbM6OCyMD2WKpCxpYi83Vzs5Grw6U4lw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=mt.com; Received: from DBBPR03MB10396.eurprd03.prod.outlook.com (2603:10a6:10:53a::11) by GV2PR03MB8559.eurprd03.prod.outlook.com (2603:10a6:150:af::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8466.19; Wed, 26 Feb 2025 15:40:03 +0000 Received: from DBBPR03MB10396.eurprd03.prod.outlook.com ([fe80::ee3c:c9be:681:c0bf]) by DBBPR03MB10396.eurprd03.prod.outlook.com ([fe80::ee3c:c9be:681:c0bf%7]) with mapi id 15.20.8466.016; Wed, 26 Feb 2025 15:40:03 +0000 From: Mathis Foerst To: linux-kernel@vger.kernel.org Cc: Mathis Foerst , Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sakari Ailus , linux-media@vger.kernel.org, devicetree@vger.kernel.org, manuel.traut@mt.com Subject: [PATCH v1 6/8] MT9M114: Allow set_selection while streaming Date: Wed, 26 Feb 2025 16:39:27 +0100 Message-Id: <20250226153929.274562-7-mathis.foerst@mt.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250226153929.274562-1-mathis.foerst@mt.com> References: <20250226153929.274562-1-mathis.foerst@mt.com> X-ClientProxiedBy: ZR2P278CA0043.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:47::17) To DBBPR03MB10396.eurprd03.prod.outlook.com (2603:10a6:10:53a::11) Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBPR03MB10396:EE_|GV2PR03MB8559:EE_ X-MS-Office365-Filtering-Correlation-Id: b3663bbe-24c9-4220-525f-08dd567bd606 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|52116014|376014|38350700014; X-Microsoft-Antispam-Message-Info: Oan1JIdP6DYxcF3YW/R+NYdQyi7/xXZYwMAZDGFe4M9N+gNLj0vUPKZ67EeAHrUuIsJ87/YsD+uwB9FspL0Nh72eGszHay2bmV60nbIgw0aPs7LvdVceYNsgvbJMakm1x4C2OXg+5QjbiJz1QmQv4m8fTsYkd95haKiUS5OxBzsvVwbYoxlwRflbRNvB3QsZ2VgRd5inKHb/AfFP/iPbYxApC/ENYdWcDrQ6UR8FwBRAaU92uqA2SEafzuudnooAI27AVnjd0E6glueQjsH3NGY+6GCDw+HY2NeTxpO/VNvlAtidTxk8E6yJLJLmexqDMnUGXHr2MXFSaeQQr8LslFrOyaIv2lGUIxtT3QzZXgLrO0EpSQweOAO0F0A427T6iKuf/zMmCcKFkBToyMTa00tygVrqiobMImEXsPvyVcagP23tUtbfFiLTXioT8DvKn+jB0/Zedhc7eaDkS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;SFV:NSPM;H:DBBPR03MB10396.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(52116014)(376014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0bF8/RrlHSQC25hTeJkBY4erAMs5CRIVqSD6pFXrnELfSciw6mPK8BMMRGgZKIacWmvcSgYiYGh54lFg66we1wbmUDHk6HaYx5qXOuq4HcUm69A1ySwQlM7Y/0nDfUwNuzMGDLYTtcwOkjvZ8ms9fqrvGO8l9ECEtLqCCKKtHg6A/9axep/km5zPLTKSPkm+EvF+tKQN3E3GtVl4mWk3qIszZLciMOL07fx4XiBqAd6qfNHpIblSPaXi0nyVzhVreVesXPeCFEC1NK6ZisZDIe9JJSJPUxolJsnrhey4QMMKYM9IIWRyVuMUj48sBvNprxVnNTQWIcZOoGmnF+oGpV9IyiPGfaGHgmfY30QJ7bqewxD1Aj1Ga0GhWGeOeLgjuPr6Uhq1U9SipNDSGVzJzi30NxP0mwdP60j43hB9bBvbP4+tIbZIuOJ4HF0NGCWtHBxUYNR5OEPGGVFqTkme3z/vp0Eb80ZRdWm5hwWMN1U42BqOeMsRV9BY+no3rnUF5vGRprB2fiMPadovxKa1zWIfGfIwz/2A7maji9CobcDprD1tEzn+xtjnt3nRLiPgY5Bts8nAqcNPWn2AP9+wl295Eke9vta+HXwmY1550+w8vYEPDkxJTalhxLe5fIf7IyIOjb+064PKPJ2xEDVEXcBWkizVfNtUeHofvvR7sMaE5UuyHNQORb5sIfrrndr3dYStNo3lOXMIa1bFRMb7wmbdUigewh5JE97GCMoElihcF0ITZrdF0EFo6z/90Pv1EMS2QITIS2+pzNHiv9cMj3gEd+eRdkXGfXXUg/3zXDcRorfnQUVwWSj6QuVAGPWTtyULljyqPAGzQEXYtRyUzmABDoFHIoFSteiw35RCD6HcTbQh/2+wzOa4csIBtO1tXbmucYNZFKPaA87uJtOiiFexVqVwac5M6xRD9t364Xi3u0beZ2Pj7pr3c0QVX1KqGHIRkP/VBkDaHMhGk49NNpTM6WW2RB8Uplng/9jnahv3FRNYm8i98/wnDuOxinSeX3gDIdiTJgHBVcTgGfUUB2B15gu7iTZcnOk9lvunQHQleyeVq6gQMUMrp747F94RPoFRyaxTJqGCCVjusRSAQb/OA3MUx6d2LtCzb+4/JIQzJivbTrguSTU8n7AHMjHYshIFnOytUnjhHBHxOZ+BwSgbAuTpJJr9umZG9JdG/BeSzn08PKC6o2SS+SLYKKhsHcInx14YhyHSk2GOEZnoQ7h0kU57zJeQ8ijA0//AbY4N4GCz+S18uO5PyVEmeIk/3v+KLKzqe8979W7KygQYXS1wkh1je1xz/G2gHZ17/xaot+Z/IDSrvLSRPATYC4gedNx8zGv1/0D9zYcvD4a2MT8w+xXjkZp8tKkdRALx9HKBmO6+8dkwcuIk7fJdQWntNNtzqNFz71OnOVPgvoqc16L+MmV2uUjxeMk5v9K+l1B72Kx7FTh3mRZUGoCF4esS/9x+QaeoqH/KFCNhkFHJl2kmgKraugZ0rsRR+ZpVEbpuTlY/bKFrNu/rPeR2Bs7woP5uigMIznwQdD+o3Rv3uozPY/DmLtq3QIPFWGaRzRTX1000R4qNeNfEVNYJO4sx1KhsMOOr1PMhH9fQaQ1Xtw== X-OriginatorOrg: mt.com X-MS-Exchange-CrossTenant-Network-Message-Id: b3663bbe-24c9-4220-525f-08dd567bd606 X-MS-Exchange-CrossTenant-AuthSource: DBBPR03MB10396.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Feb 2025 15:40:02.9778 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fb4c0aee-6cd2-482f-a1a5-717e7c02496b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UzV4VQBOW4/OC0J9F1Aw+ISgJ8Vyh+BW+1XP32AV5zQErvAJ4fo74qWkld/FlvkE1EXY1V88eQ2Ydoe9M8umLA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR03MB8559 The current implementation does not apply changes to the crop- configuration of the sensor immediately if the sensor is in streaming state. The user has to stop and restart the stream for the changes to be applied. The same holds for changes to the V4L2 controls HFLIP & VFLIP. This can be undesirable e.g. in a calibration usecase where the user wants to see the impact of his changes in a live video stream. Call mt9m114_configure_pa() in mt9m114_pa_set_selection() if the sensor is in streaming state and issue a CONFIG_CHANGE to apply the changes immediately. Issue a CONFIG_CHANGE when the V4L2 controls HFLIP or VFLIP are set if the sensor is in streaming state to apply the change immediately. Signed-off-by: Mathis Foerst --- drivers/media/i2c/mt9m114.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/drivers/media/i2c/mt9m114.c b/drivers/media/i2c/mt9m114.c index a1976da74c08..5c0a8a940fd2 100644 --- a/drivers/media/i2c/mt9m114.c +++ b/drivers/media/i2c/mt9m114.c @@ -1098,6 +1098,13 @@ static int mt9m114_pa_s_ctrl(struct v4l2_ctrl *ctrl) ret = cci_update_bits(sensor->regmap, MT9M114_CAM_SENSOR_CONTROL_READ_MODE, mask, ctrl->val ? mask : 0, NULL); + if (ret) + return ret; + if (sensor->streaming) { + // Changing the flip config while streaming requires a CONFIG_CHANGE + ret = mt9m114_set_state(sensor, + MT9M114_SYS_STATE_ENTER_CONFIG_CHANGE); + } break; case V4L2_CID_VFLIP: @@ -1105,6 +1112,13 @@ static int mt9m114_pa_s_ctrl(struct v4l2_ctrl *ctrl) ret = cci_update_bits(sensor->regmap, MT9M114_CAM_SENSOR_CONTROL_READ_MODE, mask, ctrl->val ? mask : 0, NULL); + if (ret) + return ret; + if (sensor->streaming) { + // Changing the flip config while streaming requires a CONFIG_CHANGE + ret = mt9m114_set_state(sensor, + MT9M114_SYS_STATE_ENTER_CONFIG_CHANGE); + } break; default: @@ -1286,6 +1300,7 @@ static int mt9m114_pa_set_selection(struct v4l2_subdev *sd, struct mt9m114 *sensor = pa_to_mt9m114(sd); struct v4l2_mbus_framefmt *format; struct v4l2_rect *crop; + int ret = 0; if (sel->target != V4L2_SEL_TGT_CROP) return -EINVAL; @@ -1316,10 +1331,21 @@ static int mt9m114_pa_set_selection(struct v4l2_subdev *sd, format->width = crop->width; format->height = crop->height; - if (sel->which == V4L2_SUBDEV_FORMAT_ACTIVE) - mt9m114_pa_ctrl_update_blanking(sensor, format); + if (sel->which != V4L2_SUBDEV_FORMAT_ACTIVE) + return ret; - return 0; + mt9m114_pa_ctrl_update_blanking(sensor, format); + + /* Apply values immediately if streaming */ + if (sensor->streaming) { + ret = mt9m114_configure_pa(sensor, state); + if (ret) + return ret; + // Changing the cropping config requires a CONFIG_CHANGE + ret = mt9m114_set_state(sensor, MT9M114_SYS_STATE_ENTER_CONFIG_CHANGE); + } + + return ret; } static const struct v4l2_subdev_pad_ops mt9m114_pa_pad_ops = { From patchwork Wed Feb 26 15:39:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathis Foerst X-Patchwork-Id: 13992718 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011001.outbound.protection.outlook.com [52.101.70.1]) (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 5B90D223709; Wed, 26 Feb 2025 15:40:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.1 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740584410; cv=fail; b=ltDn202ra8WtcK9uTgjAROi6z84708oJ0gUfcLLhZ16qMNfXes/jyXIlOa5o+Y/EyuB7OHNerwVEfZTJhM3uPrjqsR8rr5S1qc0uWT0ogEnH1BZX6RQ0JJnfmlazq0JavlC6s8J0P8LOIcYpvst4ij/1w2eXvyfx9jr1l0wMsyk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740584410; c=relaxed/simple; bh=1JP7aWPO8k6I+YJFty9QOh8eNsl4CDSnlEphFYf4pDM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=q27AMLEzM4QLMtowYWcCIUQB/fY9AS4QD5Vltgxa7PIQppdqiqxdMf7EqEVpQSF92RcN2HnY72s2yYH5DN+c9wUcgJmWoh2lIiSzkJBACrrDPff0xfBI0T1LHhpiBfrIbjD0sr9//v8H4rxM7LSPvafPUqhmnhY2FYIzHHSGppQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com; spf=pass smtp.mailfrom=mt.com; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b=Fi39l3lP; arc=fail smtp.client-ip=52.101.70.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mt.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b="Fi39l3lP" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JE2KFniN6mR5ACNAFodaIdjRIR2Jy82trLGevnsuYleEjA4pkdClxHeyfw+5DolmVqzy6qHuf1iBuMXQjmkFneckqMMd4VR3Zs+SchWO/Cga/LUCoCeK052gE5AXVVawlK2l9yEN4mgCKEa8Qe0TSI/XyhXiEzpLstexGmjGVo2IaQu1a/c58KTqQaDkUvmgmwRwLJ5ISKh3CeVbcUA5qIehM3hASQAfZXQuwm4dOpvI5CFGhBwKHAFaYRgoZPKkychyvHp7LqbCsVQ5QIbaVLS38thxk5lI39J9A8Ukuk662FONDGF72+FFXzZTtAN2M5D4JlLVyfKKZFAvEG3MPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=T68x65wRt9cDRBjngyWaRSvAYHHwASzRV3dYdWYl334=; b=WiLCn8Ixz4DBPNxqBIlnjcxiWzI4Flww9bxXiqRCtzwz1Q00ne1asLCkcsmLFkP29FPOEuNlMLdi3bHUZwx0lmoF63hME7Z0dgI5DtQZnOaJYolQWULPM76kotMzrttd3TmXa1eCB+MdskOevMbEQa7gnIkvzsfp/ikA3Jj02btBJoPT8MMsj3hKi2uIcJ+Sz2NRmc4Aq5+hL6czsgx+QDKonRZ1RzxP6CY1Cgo8uRd/QYkL8o6wib3mwpuV55RJo9GDfdfRkVzvp0eds5BnMzoo8tvVZDPlFSFRFQTllMW6hQG6t+mMhYHIhdnBat7Uhd8RAf++EgRl5O98SESJXQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mt.com; dmarc=pass action=none header.from=mt.com; dkim=pass header.d=mt.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mt.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=T68x65wRt9cDRBjngyWaRSvAYHHwASzRV3dYdWYl334=; b=Fi39l3lPb8SU9uad96o1dNN4UQoADUwm8h1d0jmXCHF/gSnuLe/7hUmqp17LfLT8D47DGRqbR3oddIql1b5Nkdd7yKFMUgKA4GrPxJilUgvnZcb4pPpyzehakfwZvKGHyotIoWjnuoQL576tP9z7n0RomXGDQG6b2NsGppJq+HwCveWoZoTfay/xg3TNHk5snDlJBlkcj2OkvD7u8ik0QCRdYyFPty5gvh0bKBACsQ9D5ZeAjj7x+Is33VUwCbV10+G8fikEwhoN2u1/olOeDginR2VPdaXenY5CeyehuRHi+uNfF2KtpO/W9tV1uvTWLxgprOgx4YqlEsmk7R1V5g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=mt.com; Received: from DBBPR03MB10396.eurprd03.prod.outlook.com (2603:10a6:10:53a::11) by GVXPR03MB10289.eurprd03.prod.outlook.com (2603:10a6:150:151::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8489.19; Wed, 26 Feb 2025 15:40:04 +0000 Received: from DBBPR03MB10396.eurprd03.prod.outlook.com ([fe80::ee3c:c9be:681:c0bf]) by DBBPR03MB10396.eurprd03.prod.outlook.com ([fe80::ee3c:c9be:681:c0bf%7]) with mapi id 15.20.8466.016; Wed, 26 Feb 2025 15:40:04 +0000 From: Mathis Foerst To: linux-kernel@vger.kernel.org Cc: Mathis Foerst , Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sakari Ailus , linux-media@vger.kernel.org, devicetree@vger.kernel.org, manuel.traut@mt.com Subject: [PATCH v1 7/8] MT9M114: Fix deadlock in get_frame_interval/set_frame_interval Date: Wed, 26 Feb 2025 16:39:28 +0100 Message-Id: <20250226153929.274562-8-mathis.foerst@mt.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250226153929.274562-1-mathis.foerst@mt.com> References: <20250226153929.274562-1-mathis.foerst@mt.com> X-ClientProxiedBy: ZR2P278CA0057.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:53::14) To DBBPR03MB10396.eurprd03.prod.outlook.com (2603:10a6:10:53a::11) Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBPR03MB10396:EE_|GVXPR03MB10289:EE_ X-MS-Office365-Filtering-Correlation-Id: 34030cd6-cef7-47a5-2e93-08dd567bd6ab X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: MWsQgaihr0I22+uBIqT3WwTOAN7VRXNG32z+dE0NMQN1MTkTdSc3JTNKNAy/kHMB1uWNcPcpa1yljL6gM5juA3/FKbLkGzpwDKMkACet3cjdnysrbzW05Pry3UkfW+d8e3kKrsuvVR6vHdb+FKGDhmqvIC5ojhjLENG2Lwq85ST6QSKaKTfB2+dqfzQcVkNg+OFYiqrk/tn/pLFISl9+vYKmXBCiZpdTfpWjKLPUNkfyNTz4rmxifdRooj1lrgVKjvcfeTiP2EWZfdqGSzEW9GaGvgDGQSKvYnMBlCNfadAdWs1t5J7bMyuPKpWoHIzbzBtAD6eJeXidpJNAh9I8lQ4Dc0FuSQhBM1nb81FKH+1Pi04zyct7YRT9BqA1zY9eB7pIzsbkaDhw+Pl3f+LuI2pByA5dTjvtOH3ER6+6pNqWDzb9lD8CISjSBcORBalphJy9sve7o04T2wVW2boQL7gFP1OVM90Y77AMYGOBFPcZVrHNWWqxRUEaurtYwzg1J8+dr0iI+b2dvzI9YBjVPzOsMIeNbOOwoTxDMnc+T/7FTitUSRs35a6AtLSg0z5Fc8JSXol2eSwxQc7SRVPsYzbUro6fB47eiUt93Jkt/JWBS7wlF/XWxah/QArIQSi8VHLI1ZcY+uDO4KBImoHe8UojEsiwxMnwuwmekXQr9CaNOspsK0xMUYvUY6kTtm3IBOiFJ/CyEqaK121VulvynamN779YEYrBRFhXVe5E+7ogl8IkROrCxQgZdWLly055Appd60z7n5stgtvmXsrFuvbzrUkEypwxzFYI1hPnC+DiLeC8teLgJYv2cDaUXUSj5xTihjwKhtuCptY6ScdyIFXDRwT5Sn7aIDnQYTRukL6rDgQwJTgDbMJ2MFQE5cv8s2akaCL2qph0EAbwk1s51ajkwcBWj70/u1D4EYgaFD+dn4o4Qkj0niCO/LIKIdWSBaeKpcNOV4Ym/n0evSt/h7y6cZ+VHkuRMvgMCUSPLjLZQSTntOlW/0TyCDCxnvBrK6fYhIoLHeIvY+f90sG5/veqh3DuvgnkpWC2Mio5oqhYndV1tbC1JwosFtgtZ1pVt+SpNR5ggxYuOvIQ0aUqe7RKceURTz+SosmWeWEd0XPAPajO2LOU2soaRcmt6UpETzx6PqYo6zEyFtcUY0KaS/QAd1/52aO2YCEJ6p6KHyxKj62VQXqlAxSFQZ9OE7+YILCEh6nY4yuqqOG0d7qT/tvDvKS7eQi36/p263JGQGPvfw/i9z1FE7y7OFxX6BhrTM7r5BzxKnSX+lxL9fS3zozxia8MKdTKysf+8byI0ay+Q57lOLBKbzKSzwSeV4fUhucAo374c9d3k5jNSb/EokuNhbJg7wXcJagqebMK3SbS/jW/s/1kaB6I2wUafn2C+L5L4JIuzYMsCgFHCAbcKXogZXuqQTtpHdeO030rpCttJSvp/A4zEsjXVDgXhU7x X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DBBPR03MB10396.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: N/kqhDbe0yKw7cGIxQYgLKM4/qu7zsD6N4XWYFY0k3tudzw3Ijy5lYH5oXIpwgA1DIcX0+ab6WjbQWX7OICLXgRqAiy+krz7hJ92EFVLNPOXhk+QEE04Ru7lYY70MVhpHl5YmUui8Y0c5d6mcYqaA9e89l8MjTgOZ9hznxRW1Eu7G8qR4qiEfT4W510BT9gFWKhBOiwNnShg3RgRoaRBc4c3vb1v5mmm6mUzQXP07bKFnQ/4rkagbME8HE6+MsroEmG5HVWIvDP7WhM3pnozHSDMix9lF/KHEEZwbErWBtvX8FPHvVBSA8FnsaxWEajZehVaG1PmLpM8IZU7CNxFfRImJTchfgBXCTBjAkkVU78T+pXcTvm5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zF8I+jVrraumoOPV6ZTyqyo03Exa03WTbrWcxr7kwGz3tGUh/05FaPvaxnLq2xifjxHF3HC1obyi3xq5Gig9ahhSCW4riwdmEePm8ACGBBLcTwKNO/9hOB83gjPMy7oQIyQLdq2iCjtENReYuLrW9CP8/HuzQ+cziig== X-OriginatorOrg: mt.com X-MS-Exchange-CrossTenant-Network-Message-Id: 34030cd6-cef7-47a5-2e93-08dd567bd6ab X-MS-Exchange-CrossTenant-AuthSource: DBBPR03MB10396.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Feb 2025 15:40:04.0292 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fb4c0aee-6cd2-482f-a1a5-717e7c02496b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kpyC0pr0Pel6KfpFq1dy0ly21jy9AhOY0NvqxbzcU7M3OjieEeecizSyMLJehxoIHmh67h35UoAe0UjnaalOKg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR03MB10289 Getting / Setting the frame interval using the V4L2 subdev pad ops get_frame_interval/set_frame_interval causes a deadlock, as the subdev state is locked in the [1] but also in the driver itself. In [2] it's described that the caller is responsible to acquire and release the lock in this case. Therefore, acquiring the lock in the driver is wrong. Remove the lock acquisitions/releases from mt9m114_ifp_get_frame_interval() and mt9m114_ifp_set_frame_interval(). [1] drivers/media/v4l2-core/v4l2-subdev.c - line 1129 [2] Documentation/driver-api/media/v4l2-subdev.rst Signed-off-by: Mathis Foerst --- drivers/media/i2c/mt9m114.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/media/i2c/mt9m114.c b/drivers/media/i2c/mt9m114.c index 5c0a8a940fd2..f96f6c010e1b 100644 --- a/drivers/media/i2c/mt9m114.c +++ b/drivers/media/i2c/mt9m114.c @@ -1644,13 +1644,9 @@ static int mt9m114_ifp_get_frame_interval(struct v4l2_subdev *sd, if (interval->which != V4L2_SUBDEV_FORMAT_ACTIVE) return -EINVAL; - mutex_lock(sensor->ifp.hdl.lock); - ival->numerator = 1; ival->denominator = sensor->ifp.frame_rate; - mutex_unlock(sensor->ifp.hdl.lock); - return 0; } @@ -1669,8 +1665,6 @@ static int mt9m114_ifp_set_frame_interval(struct v4l2_subdev *sd, if (interval->which != V4L2_SUBDEV_FORMAT_ACTIVE) return -EINVAL; - mutex_lock(sensor->ifp.hdl.lock); - if (ival->numerator != 0 && ival->denominator != 0) sensor->ifp.frame_rate = min_t(unsigned int, ival->denominator / ival->numerator, @@ -1684,8 +1678,6 @@ static int mt9m114_ifp_set_frame_interval(struct v4l2_subdev *sd, if (sensor->streaming) ret = mt9m114_set_frame_rate(sensor); - mutex_unlock(sensor->ifp.hdl.lock); - return ret; } From patchwork Wed Feb 26 15:39:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathis Foerst X-Patchwork-Id: 13992720 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011001.outbound.protection.outlook.com [52.101.70.1]) (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 45E302248AF; Wed, 26 Feb 2025 15:40:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.1 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740584411; cv=fail; b=cxA1ZhLQbToYalqlfvYbO/oOaSEG9cUXsBaCmi6oYdETbUl3iE7JgoySGcU6PTrJT+4GiJuRKWZCjmLonC2uPKuTudD7J+cmXcaXlOHbgOm0MR5UXHpoDCSCCT0TegI/CXIdNqHwTUKRzgdVrrbsDZ6AzzQ6uQNRVf3FadYq+3s= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740584411; c=relaxed/simple; bh=YXKKPKL6EdlPD2MRZ39l4+/l42t4TGmMjbUCmEYVxMU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=hf6yskbZV+ycOO1+03/fJ2VaJ0yQKdRnQljoEsMeH4bplennx/1W+G+jVjgRseIXnmbj2yZWPFf84ykqJ44N3nUxkKkTPajK3QtV8qfgpnPKhQaJRlhe1DIGjPQIdwGRYHXrFocfR0fn7w5BltPANTFZDaiRXflGz4IUixJ5kZk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com; spf=pass smtp.mailfrom=mt.com; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b=ElzQwZiO; arc=fail smtp.client-ip=52.101.70.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mt.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mt.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mt.com header.i=@mt.com header.b="ElzQwZiO" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MRH6E7WicvpZ4019/wn8MD+I8AZGtXTq/SAHZzswEUilEqrlUIyYhekxfpkFbLwbfVZviRWXxoscD6Q7AoMOySz6LdFijPuPYl1FiomPLPm8z0j2ej266cNfHN6EtBdUEJ7Z4BUCjXxp+UzV26NzOiOxJU794ZjSp/49WyxFaURcqByD2zhAnlB+SwI+FXPNHNrWcdE45vM5mzEWfbfu0iD6poheG6V/KxEpzMiWFPw5DzpUDJ/ra28zl3PbJLKeWniXSipimjKl/Ie6V+RXDJeWTv3esw1zZRYp8wswxAig4FRy+jkj5jQM1nGLhuN0CxVv41FCA3P52xpO88xPBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZzjYH+UjgmSVlqAzmJMPXm0njuyzYupkSb0KzMWImcg=; b=WxU/dC6fNtXkeYh4u6/OUlgonFrku/zSSfAEUwolw040BHQ0XVhDMOX64z8VheJdVUHlD4OAUAGIk5jvZg+Ng+GZaX/we1BUPtY27qiiy8rTmJATBoGdCUFXDL9WvbxBDgSkU7qnKY8auvvgKH/H27GYAkdbtFa2PMnkLRQ6V7ihlbxC7BS1juh0MRW/6rPPfmNsLcN42qLE3JRXx3VxRrNc8d4mPtXXZ45KaiaGuHoF7DrI4R55fFx9ZuxvRgYBCNuvLxAevKQMbNfceRL2BIm3wgcUvSQinjVZSszF+WkmHVtCCfPQb1lXh6wzaD/1NYARkNKpkw7DpMTDU53KCw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mt.com; dmarc=pass action=none header.from=mt.com; dkim=pass header.d=mt.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mt.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZzjYH+UjgmSVlqAzmJMPXm0njuyzYupkSb0KzMWImcg=; b=ElzQwZiOPaSMm/dzHAF40BTRPwjZAWzqMzzSRIwtAbC/mcvwKmen/X7ivb4KZBNhjzkjYFP5u81yNiVDEr+M5e3imGVoZihOaaqbZqw99q6ejHZTh+vCRB4Lk3ibUmz1Rcajah40lkI7NEwsXgwbaaQBlDIMyt3elssDGAmZEVbN/ESKxqXxyvBeECA+Jefg00kgcsQxbhAXyhW2S24EzIRcTLqSZQ6aEFGwTuOmy1rAgbR9BNcDEXicVbkpb5hf47HdEg6XlSFLHAn+lPsQNzFS/dABmdvPCN1czhC45DkOUoynlN+g1AaagN7dvpvV5eVwlzyc13qkhrpnMMQnsA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=mt.com; Received: from DBBPR03MB10396.eurprd03.prod.outlook.com (2603:10a6:10:53a::11) by GVXPR03MB10289.eurprd03.prod.outlook.com (2603:10a6:150:151::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8489.19; Wed, 26 Feb 2025 15:40:05 +0000 Received: from DBBPR03MB10396.eurprd03.prod.outlook.com ([fe80::ee3c:c9be:681:c0bf]) by DBBPR03MB10396.eurprd03.prod.outlook.com ([fe80::ee3c:c9be:681:c0bf%7]) with mapi id 15.20.8466.016; Wed, 26 Feb 2025 15:40:05 +0000 From: Mathis Foerst To: linux-kernel@vger.kernel.org Cc: Mathis Foerst , Laurent Pinchart , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sakari Ailus , linux-media@vger.kernel.org, devicetree@vger.kernel.org, manuel.traut@mt.com Subject: [PATCH v1 8/8] MT9M114: Set pad-slew-rate Date: Wed, 26 Feb 2025 16:39:29 +0100 Message-Id: <20250226153929.274562-9-mathis.foerst@mt.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250226153929.274562-1-mathis.foerst@mt.com> References: <20250226153929.274562-1-mathis.foerst@mt.com> X-ClientProxiedBy: ZR0P278CA0104.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:23::19) To DBBPR03MB10396.eurprd03.prod.outlook.com (2603:10a6:10:53a::11) Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DBBPR03MB10396:EE_|GVXPR03MB10289:EE_ X-MS-Office365-Filtering-Correlation-Id: f5aa050a-c584-4b21-f662-08dd567bd755 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|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M/z0LYdpXsJnNwBnXgK5u4YAmAGkrbIQ7gksgzh61aj9bazMA4PbHLTRO9h31iVECC5MX3ywKGcVZS0yR2YSdZL1XxdGxDYyyGLKOg/+l1tl7ehSCOJW+UldCdF0xzyZJzG6ylf1pfhr6sE9pSFeXQwFgcb4+/U6oLuJzhmIa0I9NwDEh7/F5bf3TQ/IOlrC59AVRyabzkWLdmapVXW5nZnYPdm0M2/T9S34J4z43O7zVFeV+JdS4BASfF1BP5Msa0lr+hNI8vsjUxg1yqhhB3YWrh4QwFsr8Pb2W4bQaDJtyFobb5x5Eh+7bWFDD4CQilRsXgyKOc1Y02faNOpi2lyK3oor6CT/klM+Nwd5GKYf+cCcGfvQytpTstBmdDtYvAs/33VZAj04BkarIOWZWh6xrHzbpHvT1D X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DBBPR03MB10396.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mw7QliL2OLeSei/FY7FT6dUh6MCYoZ0gnJrEx6SEUXytM2n9JqQTDw3TRNHcCY+Wo9kbCZ9d+V+NqF4stzUvjoWNRDjraTrHm/+AOSWLi3mnwgoiRUoD5x+jNauFe5dZVcPX7RXLCdro8y1ebDMOL7i1WdX/CuWEAnftl5D8ffVmS8LKcu339ghKO+Md6S77Fge/fciNjfIUCPWApq/mf5tpfN31QMnpCfKIdTzg0/ud16iIQC40HY0zXN3WG6X8icuTk0Y927J3GXMIgGdp4Juw/DYGa+dBWekVf3qrb3J7hwm0HO07XuzuParFTPJw1pGomCG3OkhYPmj1sd2Iv7Pf2S3OeVGWfMjYr9YtkQMHNDJggaaLLYYNrAY3zDRGm4CWGVWAwV0o+o+hOf+d3It7cJthpyVPwpCTOyBKs0zCmVP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aE3p8CpQBMeYVJbFzUP4v54HaG0qX0Lu9kNvTfXvxGkoF4FiTHOW312Zbx6Q9fuNtHp7xMxE8J8zntw6UqoqjtCE83jIGvhEcKwYgDXYLtZMRQ== X-OriginatorOrg: mt.com X-MS-Exchange-CrossTenant-Network-Message-Id: f5aa050a-c584-4b21-f662-08dd567bd755 X-MS-Exchange-CrossTenant-AuthSource: DBBPR03MB10396.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Feb 2025 15:40:05.1523 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fb4c0aee-6cd2-482f-a1a5-717e7c02496b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rb7LUSfaLdmv7n4GcWhlRzZ52q3mjMjL+ez2MJMvfPRXV5sCmONY0IWpY7KvBxg2+Ua5DGS+dL+HVy7OB/Pz6A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR03MB10289 The MT9M114 supports the different slew rates (0 to 7) on the output pads. At the moment, this is hardcoded to 7 (the fastest rate). The user might want to change this values due to EMC requirements. Read the 'pad-slew-rate' from the DT and configure the pad slew rates of the output pads accordingly in mt9m114_initialize(). Remove the hardcoded slew rate setting from the mt9m114_init table. Signed-off-by: Mathis Foerst --- drivers/media/i2c/mt9m114.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/media/i2c/mt9m114.c b/drivers/media/i2c/mt9m114.c index f96f6c010e1b..327384e8427d 100644 --- a/drivers/media/i2c/mt9m114.c +++ b/drivers/media/i2c/mt9m114.c @@ -42,6 +42,9 @@ #define MT9M114_RESET_AND_MISC_CONTROL CCI_REG16(0x001a) #define MT9M114_RESET_SOC BIT(0) #define MT9M114_PAD_SLEW CCI_REG16(0x001e) +#define MT9M114_PAD_SLEW_MIN 0x00 +#define MT9M114_PAD_SLEW_MAX 0x07 +#define MT9M114_PAD_SLEW_DEFAULT 0x07 #define MT9M114_PAD_CONTROL CCI_REG16(0x0032) /* XDMA registers */ @@ -388,6 +391,7 @@ struct mt9m114 { unsigned int pixrate; bool streaming; + u8 pad_slew_rate; /* Pixel Array */ struct { @@ -645,9 +649,6 @@ static const struct cci_reg_sequence mt9m114_init[] = { { MT9M114_CAM_SENSOR_CFG_FINE_INTEG_TIME_MAX, 1459 }, { MT9M114_CAM_SENSOR_CFG_FINE_CORRECTION, 96 }, { MT9M114_CAM_SENSOR_CFG_REG_0_DATA, 32 }, - - /* Miscellaneous settings */ - { MT9M114_PAD_SLEW, 0x0777 }, }; /* ----------------------------------------------------------------------------- @@ -778,6 +779,13 @@ static int mt9m114_initialize(struct mt9m114 *sensor) if (ret < 0) return ret; + value = sensor->pad_slew_rate | + sensor->pad_slew_rate << 4 | + sensor->pad_slew_rate << 8; + cci_write(sensor->regmap, MT9M114_PAD_SLEW, value, &ret); + if (ret < 0) + return ret; + ret = mt9m114_set_state(sensor, MT9M114_SYS_STATE_ENTER_CONFIG_CHANGE); if (ret < 0) return ret; @@ -2363,6 +2371,7 @@ static int mt9m114_parse_dt(struct mt9m114 *sensor) struct fwnode_handle *fwnode = dev_fwnode(&sensor->client->dev); struct fwnode_handle *ep; struct device_node *dev_node = sensor->client->dev.of_node; + u8 slew_rate; int ret; ep = fwnode_graph_get_next_endpoint(fwnode, NULL); @@ -2393,6 +2402,11 @@ static int mt9m114_parse_dt(struct mt9m114 *sensor) sensor->bypass_pll = of_property_read_bool(dev_node, "bypass-pll"); + ret = of_property_read_u8(dev_node, "pad-slew-rate", &slew_rate); + if (ret || slew_rate < MT9M114_PAD_SLEW_MIN || slew_rate > MT9M114_PAD_SLEW_MAX) + slew_rate = MT9M114_PAD_SLEW_DEFAULT; + sensor->pad_slew_rate = slew_rate; + return 0; error: