From patchwork Wed Oct 2 09:23:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 13819542 Received: from fhigh-a6-smtp.messagingengine.com (fhigh-a6-smtp.messagingengine.com [103.168.172.157]) (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 152CE1991CD; Wed, 2 Oct 2024 09:24:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727861049; cv=none; b=c65INELurU55tvPhgukr81PKVQ/hxL00zhLO7bfcKpdcKjoVWEABn5jyFdyrY+r2ts6HyktNSV1hBAxnukKH3fUjfWQni6cJ1eNwBfzAsYWLNmqt4qYYmT6Ozx5G8OBX/TW82liaRnyRNgXr9GFA836ts2AjXxhal02qSGReJ5Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727861049; c=relaxed/simple; bh=kMiQDBKueJ+EjXlJYy8rAw4cUggtbuSciza+fXvr+E0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=P4UQeVcVQAdFFijBYERTXVDRivIoICuKvDE/KgGS6f/jpUpFjsIc8JANKDfyr7ET3w/AKEQANgVdDnregRpf7pcB4YPss0gtS96D2u7pXt7gG6KnyOqv1ZmB0nHdsjxELROWvN/71XJ1NKTKl91IdRs2mrBLWT2qkdaWKXpNJYY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ragnatech.se; spf=pass smtp.mailfrom=ragnatech.se; dkim=pass (2048-bit key) header.d=ragnatech.se header.i=@ragnatech.se header.b=B8JB2rrv; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=AB3o0z6k; arc=none smtp.client-ip=103.168.172.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ragnatech.se Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ragnatech.se Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ragnatech.se header.i=@ragnatech.se header.b="B8JB2rrv"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="AB3o0z6k" Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfhigh.phl.internal (Postfix) with ESMTP id 3CD3211400BC; Wed, 2 Oct 2024 05:24:05 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Wed, 02 Oct 2024 05:24:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech.se; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1727861045; x=1727947445; bh=/XZTNnbVuE2LDhmUvIV6yOBhzHzCLRfZxmhADoD83pA=; b= B8JB2rrvK6GmWDzhAHWwKTSA/teQskj3jM0jXT50UrHkQpI1TlX7dh81l5aDadf6 djWcXHeIVF8WW2Dq48P4xK+hsmenVa3PyU8W7sv10zquKJaHFoIuNpyiAtPXArra LVkJETr4u81ZgFjn5F7EGisy73FypX27rrRREy8u0Ryqqis0Y98QL1VTpkx+ts9O QoIVLwRbJyTENvCy++XmFrf9r09Q0i/nA6S15PyKxT1z0QFWcKM3wff9K/i/+Url A4aer784QUhWt7SYDa3s+rV2LEcdrDdCFvGUcRNZhMdUkH8MsfLnxf1elpVtKRN8 ZfPtNaERxHQhUsh1fR4ktw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1727861045; x= 1727947445; bh=/XZTNnbVuE2LDhmUvIV6yOBhzHzCLRfZxmhADoD83pA=; b=A B3o0z6kz/jounHxeUTya+iKxpGTWkS5tQWlpu0NB9t3XkgMQN309SWbgUqcB1AHu oo/0uYXShLUeRzp0jaa2qRXNZitwaDFg8lxRKmOrfZ4cMNM7HiOOshWZed6fIjYR Kffq7OE2rrSX6yYsBvaBKoiEr/pfUw+vMRnm4LBbn9VUeaq3dlfeUC2aKqaUYwxI PJvspPOrm3jELnwUsXjtHXnTWmnBDN4bQqU2OXl3g+HLX+QbyZkO5RTKX2OFKfb+ wI1fTcEXdOaKWdpe7pAhEx6Pzbzbgr0HoLWdKGqORmPE57UqJ9ONbbw6fMS/tZqX YXfwje2vJ8/Tyv0+c7yrA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdduledguddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefufffkofgjfhggtgfgsehtkeertdertdej necuhfhrohhmpefpihhklhgrshcuufpnuggvrhhluhhnugcuoehnihhklhgrshdrshhoug gvrhhluhhnugdorhgvnhgvshgrshesrhgrghhnrghtvggthhdrshgvqeenucggtffrrght thgvrhhnpeehiefgueevuedtfefhheegkeevtdelueeukeevfeduhefhhfejfffggeffle efgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehn ihhklhgrshdrshhouggvrhhluhhnugesrhgrghhnrghtvggthhdrshgvpdhnsggprhgtph htthhopedugedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepshgrkhgrrhhirdgr ihhluhhssehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtohepmhgthhgvhhgrsg eskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhosghhsehkvghrnhgvlhdrohhrghdp rhgtphhtthhopehkrhiikhdoughtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopegtoh hnohhrodgutheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepghhrvghgkhhhsehlihhn uhigfhhouhhnuggrthhiohhnrdhorhhgpdhrtghpthhtohepshgrkhgrrhhirdgrihhluh hssehikhhirdhfihdprhgtphhtthhopehjuhhlihgvnhdrmhgrshhsohhtsegtohhllhgr sghorhgrrdgtohhmpdhrtghpthhtoheplhhinhhugidqmhgvughirgesvhhgvghrrdhkvg hrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i80c9496c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 2 Oct 2024 05:24:04 -0400 (EDT) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: Sakari Ailus , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Greg Kroah-Hartman , Sakari Ailus , Julien Massot , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-staging@lists.linux.dev Cc: linux-renesas-soc@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= , Conor Dooley Subject: [PATCH v4 1/5] dt-bindings: i2c: maxim,max96712: Add compatible for MAX96724 Date: Wed, 2 Oct 2024 11:23:27 +0200 Message-ID: <20241002092331.4135906-2-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20241002092331.4135906-1-niklas.soderlund+renesas@ragnatech.se> References: <20241002092331.4135906-1-niklas.soderlund+renesas@ragnatech.se> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The MAX96712 and MAX96724 are both quad GMSL2 to CSI-2 deserializers and are in parts similar, but not identical. The most obvious difference is on the CSI-2 side where the MAX96712 have 4 PHYs and support D-PHY with 1x4, 2x2 and 4x2 lanes where the MAX96724 only have 2 PHYs and supports D-PHY with 2x4 or 4x2 lanes. The register layout overlap in part but there are differences and holes. Most of the differences are related to the different number of CSI-2 PHYs, but there are other capability differences between the two. Add a specific compatible for MAX96724 to the max96712 bindings. The bindings do not yet support validating all DT properties to limit it the each devices capabilities. However to allow for this in future a specific compatible for the two different devices are needed. Signed-off-by: Niklas Söderlund Acked-by: Conor Dooley --- * Changes since v2 - Expand on the differences of the two devices and why a specific binding is needed for the new device. * Changes since v1 - Group in series together with driver change. --- .../devicetree/bindings/media/i2c/maxim,max96712.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/media/i2c/maxim,max96712.yaml b/Documentation/devicetree/bindings/media/i2c/maxim,max96712.yaml index 6c72e77b927c..26f85151afbd 100644 --- a/Documentation/devicetree/bindings/media/i2c/maxim,max96712.yaml +++ b/Documentation/devicetree/bindings/media/i2c/maxim,max96712.yaml @@ -25,7 +25,10 @@ description: | properties: compatible: - const: maxim,max96712 + items: + - enum: + - maxim,max96712 + - maxim,max96724 reg: description: I2C device address From patchwork Wed Oct 2 09:23:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 13819543 Received: from fout-a8-smtp.messagingengine.com (fout-a8-smtp.messagingengine.com [103.168.172.151]) (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 A8AED1991C9; Wed, 2 Oct 2024 09:24:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727861051; cv=none; b=er37hAK6vsMewrOaDv4Cc2gzS+HUZhB8ILmz4g689Bn+Rvjyg7WV4ZaR0piYFaDgPXU/KjM8PYS8Fq8mFEjUeEj8DU6luf1avCm6WyfAAZohiNido/DiO0DPOlY1RRlpmShAwIrkU0Ed8jPaC4zKLD9Ybu9L/evoqceKX89aJR8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727861051; c=relaxed/simple; bh=OM2EhQyAgBsjJtBVAg9wZVHt+Bi2YXrJBm9DFDO9O7g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hBSfnOdtSNgGN5jJjCVCwdlooslcnjo3y1CWqL3BZzhU3J5S8YlmYz6ZMbgtzyGwCI4SRaC85l8OURg39/NoT1I9uqP2MNAZUlhmQrc9+oSMX51C5NXmWJmTyssWMlCnjgLJ/alav+mw46U6kSGhBh7MtxqGVBjhisjX1cP2XK4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ragnatech.se; spf=pass smtp.mailfrom=ragnatech.se; dkim=pass (2048-bit key) header.d=ragnatech.se header.i=@ragnatech.se header.b=LMZWb4IH; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=gKtWGpD8; arc=none smtp.client-ip=103.168.172.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ragnatech.se Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ragnatech.se Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ragnatech.se header.i=@ragnatech.se header.b="LMZWb4IH"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="gKtWGpD8" Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfout.phl.internal (Postfix) with ESMTP id EB53C1380586; Wed, 2 Oct 2024 05:24:07 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Wed, 02 Oct 2024 05:24:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech.se; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1727861047; x=1727947447; bh=1kAPxtP6rXmdSNZapdFIBezQ2V8DVAypLU9JA7zRiMA=; b= LMZWb4IHibG5nUyRSKrhq/fByKNszJtuLbdl6ngXTVCEh0f8MVCyNEownL3LfsYw zXMv3U8xcGKTRiJAaOhnTNtR5cuB180Jh643D1R0B8Dna+eUNlVpC01ipMLUPG9T Fzv2hygN7I8JLVApEBSR9XLhFJ2GKDEGDcCTKG+35rNQDk54DjTOCXFYUXO6NJgR hLWSRynVCYLsvIzpsSOkY5AbhJBFTEJ2M4dYxlg72xNN8TOWySg9wURQfaFBH1uZ ZWo2nwAfZyWx7GtUqhOYqCOxvtNEIIE5nNTHEsUwoTFb1a9qKY2FJ9q1mR/FQDPV XbDDCTTxd6kawH4Q2PdMAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1727861047; x= 1727947447; bh=1kAPxtP6rXmdSNZapdFIBezQ2V8DVAypLU9JA7zRiMA=; b=g KtWGpD84CK9czfxQd/l0+lhotAoqxi5C/yuKue2xebiUqSdG6ZVYurlSDBVvDluW /HGNigUhz2qZjTGryk+7AKKlyE+Jv5mBHUroT9vqqTna+WMFA0f1255aEGULmwa7 LqjOOHOsGJQVijzC5oC/R5cFQGuxWAeuuYmhv1QwkQL8UHy2KrVWcVpXU1T+J0g/ b/uwljUxgBi7UqOOuHQtCl+OLx8a1IqsTec2YxD43j0ZM3TvMdFNp5EYRLe4IHCw AXAbPm+UJx3yPEG4VyMcWAXDvyRED0aQbr9kuE3Z/NwqrzhdSO65gJ4P77ynb+se e5O7Nwmb9pGX/kpGCXBSw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdduledguddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefufffkofgjfhggtgfgsehtkeertdertdej necuhfhrohhmpefpihhklhgrshcuufpnuggvrhhluhhnugcuoehnihhklhgrshdrshhoug gvrhhluhhnugdorhgvnhgvshgrshesrhgrghhnrghtvggthhdrshgvqeenucggtffrrght thgvrhhnpeehiefgueevuedtfefhheegkeevtdelueeukeevfeduhefhhfejfffggeffle efgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehn ihhklhgrshdrshhouggvrhhluhhnugesrhgrghhnrghtvggthhdrshgvpdhnsggprhgtph htthhopedufedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepshgrkhgrrhhirdgr ihhluhhssehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtohepmhgthhgvhhgrsg eskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhosghhsehkvghrnhgvlhdrohhrghdp rhgtphhtthhopehkrhiikhdoughtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopegtoh hnohhrodgutheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepghhrvghgkhhhsehlihhn uhigfhhouhhnuggrthhiohhnrdhorhhgpdhrtghpthhtohepshgrkhgrrhhirdgrihhluh hssehikhhirdhfihdprhgtphhtthhopehjuhhlihgvnhdrmhgrshhsohhtsegtohhllhgr sghorhgrrdgtohhmpdhrtghpthhtoheplhhinhhugidqmhgvughirgesvhhgvghrrdhkvg hrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i80c9496c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 2 Oct 2024 05:24:07 -0400 (EDT) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: Sakari Ailus , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Greg Kroah-Hartman , Sakari Ailus , Julien Massot , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-staging@lists.linux.dev Cc: linux-renesas-soc@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= Subject: [PATCH v4 2/5] media: staging: max96712: Remove device id check Date: Wed, 2 Oct 2024 11:23:28 +0200 Message-ID: <20241002092331.4135906-3-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20241002092331.4135906-1-niklas.soderlund+renesas@ragnatech.se> References: <20241002092331.4135906-1-niklas.soderlund+renesas@ragnatech.se> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This check is incorrect and checks the wrong register. Furthermore there is no documented shared device id register for MAX96712. There might be overlap with the soon to be added MAX96724 device which do document such a register. However as the check was merely a precaution and to check during development that the driver could talk to the device there is no harm in removing it all together. A correct and more sophisticated check can be added later if there ever is a need to differentiate between different versions of a device. Signed-off-by: Niklas Söderlund --- * Changes since v2 - New in v3. --- drivers/staging/media/max96712/max96712.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/drivers/staging/media/max96712/max96712.c b/drivers/staging/media/max96712/max96712.c index 6bdbccbee05a..07f353f60e71 100644 --- a/drivers/staging/media/max96712/max96712.c +++ b/drivers/staging/media/max96712/max96712.c @@ -16,8 +16,6 @@ #include #include -#define MAX96712_ID 0x20 - #define MAX96712_DPLL_FREQ 1000 enum max96712_pattern { @@ -40,19 +38,6 @@ struct max96712_priv { enum max96712_pattern pattern; }; -static int max96712_read(struct max96712_priv *priv, int reg) -{ - int ret, val; - - ret = regmap_read(priv->regmap, reg, &val); - if (ret) { - dev_err(&priv->client->dev, "read 0x%04x failed\n", reg); - return ret; - } - - return val; -} - static int max96712_write(struct max96712_priv *priv, unsigned int reg, u8 val) { int ret; @@ -438,9 +423,6 @@ static int max96712_probe(struct i2c_client *client) if (priv->gpiod_pwdn) usleep_range(4000, 5000); - if (max96712_read(priv, 0x4a) != MAX96712_ID) - return -ENODEV; - max96712_reset(priv); ret = max96712_parse_dt(priv); From patchwork Wed Oct 2 09:23:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 13819544 Received: from fhigh-a6-smtp.messagingengine.com (fhigh-a6-smtp.messagingengine.com [103.168.172.157]) (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 80B751991CD; Wed, 2 Oct 2024 09:24:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727861053; cv=none; b=jp/ZA811SWQ6VndwAhjpyBqa59N0qX1b1v0Qeng2L/JzF+PoGUXcm6A2SslpqaenV+YkpfOV/glEAE/1C5XyS1AGfOPNMw1nQI3s5Z92Dzkf89dslkTSZuKi9V8+i40FR7WJdWHGxhhVx91xPb5bbz6GrZEm9XBggKSWGRAOQx4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727861053; c=relaxed/simple; bh=n1Tq6EwLFubmL5yxVvROd2zboDfpq20zgtUlCHtJRn0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WF9JXxqLo/A53ppK1UQTRhLX4ERvDVm9MAS8JRQMFAfjTQfEe1pz/Hbo0+JQ/WVdQxnGx050E8KKexWXrvpGBwOuvoZkNydhDS2fi+6b1TPNqaMpa8SdkBxwqfgL3MEgQKiPi9ZT8ybZ+eNnY7ZSiNa6QEUHzjTPvKPHRNbga48= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ragnatech.se; spf=pass smtp.mailfrom=ragnatech.se; dkim=pass (2048-bit key) header.d=ragnatech.se header.i=@ragnatech.se header.b=VT++f6YG; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=oPwf8ZrZ; arc=none smtp.client-ip=103.168.172.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ragnatech.se Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ragnatech.se Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ragnatech.se header.i=@ragnatech.se header.b="VT++f6YG"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="oPwf8ZrZ" Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfhigh.phl.internal (Postfix) with ESMTP id BD64D1140222; Wed, 2 Oct 2024 05:24:10 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-09.internal (MEProxy); Wed, 02 Oct 2024 05:24:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech.se; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1727861050; x=1727947450; bh=5F4cM/CSZbGemnfH60H88zETbO0T/QT5GvIZkeQJqXg=; b= VT++f6YGBvsAN7T6UXUNzcXaV1dpRm6fyAzGxyNbc8MUaRe5xEG4utNTQ4eW+9Nv BVtCCbx6fkBMe6DOxcuqsTz4azsin8slNmTR30OzKAD3lUlJFbzU2KCEo6Ii+K8B G5O5nBgDIKYHTYQRa64caeF6i60Kbpatp6uUUE9nMnT/wVJZ8FJy0DCXotgp62o2 ALu3vzH1s1ojnqDSa8vwKEHv++ql91eiwGkjOOywWEuxwNweO2QzLkLlxaRfJn3G vbi9RnDGKptCStLwFSXXJluAJ6mX/z9qkF6gncNhl7YeVFV315WckozhRaZKgUFK dkPR9U4qiUGA4xFE4/lRRA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1727861050; x= 1727947450; bh=5F4cM/CSZbGemnfH60H88zETbO0T/QT5GvIZkeQJqXg=; b=o Pwf8ZrZCXJh7JZnaXjTN7Pv5k2AWdAAA4w67hTjDRDSWqtSjl27c0rKOuKGGTAMU u71r9rkwHBR3+p4LwfysvQfzU7y227JSjxaKDw1c7I7Lm4VWXVWrjASSaKFJj5+i 9Td3K3S2EMGnntHgd9rCwDxdRKn2stGSZTxT6/ks4ZePyi+GUuquTah5dNn8d5u1 U33FgcoRWaA5W6h7U12RTIg0NAv+PYmW0rWsEVtzxcME0Rr+AZbkvuTGUy0TTDFd FY6TyVtYvNtVVPJjjJZfoKrjBYSfD1/C48MKYrFVyj0HY8laPvG7n4Da6axdgqK3 Kt5kBqCQUmSN9HtMmk2mw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdduledgudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefufffkofgjfhggtgfgsehtkeertdertdej necuhfhrohhmpefpihhklhgrshcuufpnuggvrhhluhhnugcuoehnihhklhgrshdrshhoug gvrhhluhhnugdorhgvnhgvshgrshesrhgrghhnrghtvggthhdrshgvqeenucggtffrrght thgvrhhnpeehiefgueevuedtfefhheegkeevtdelueeukeevfeduhefhhfejfffggeffle efgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehn ihhklhgrshdrshhouggvrhhluhhnugesrhgrghhnrghtvggthhdrshgvpdhnsggprhgtph htthhopedugedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepshgrkhgrrhhirdgr ihhluhhssehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtohepmhgthhgvhhgrsg eskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhosghhsehkvghrnhgvlhdrohhrghdp rhgtphhtthhopehkrhiikhdoughtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopegtoh hnohhrodgutheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepghhrvghgkhhhsehlihhn uhigfhhouhhnuggrthhiohhnrdhorhhgpdhrtghpthhtohepshgrkhgrrhhirdgrihhluh hssehikhhirdhfihdprhgtphhtthhopehjuhhlihgvnhdrmhgrshhsohhtsegtohhllhgr sghorhgrrdgtohhmpdhrtghpthhtoheplhhinhhugidqmhgvughirgesvhhgvghrrdhkvg hrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i80c9496c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 2 Oct 2024 05:24:09 -0400 (EDT) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: Sakari Ailus , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Greg Kroah-Hartman , Sakari Ailus , Julien Massot , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-staging@lists.linux.dev Cc: linux-renesas-soc@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= , Geert Uytterhoeven Subject: [PATCH v4 3/5] media: staging: max96712: Move link frequency setting to device struct Date: Wed, 2 Oct 2024 11:23:29 +0200 Message-ID: <20241002092331.4135906-4-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20241002092331.4135906-1-niklas.soderlund+renesas@ragnatech.se> References: <20241002092331.4135906-1-niklas.soderlund+renesas@ragnatech.se> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Prepare for supporting MAX96724 by moving the soon device specific link frequency setting into information structure. This struct will be extended to carry more differences between the two devices supported. While at it remove trailing comma in device table, no entries will be appended after the sentinel. Signed-off-by: Niklas Söderlund Reviewed-by: Geert Uytterhoeven --- * Changes since v2 - New in v3. --- drivers/staging/media/max96712/max96712.c | 24 ++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/drivers/staging/media/max96712/max96712.c b/drivers/staging/media/max96712/max96712.c index 07f353f60e71..46a6bb018fe2 100644 --- a/drivers/staging/media/max96712/max96712.c +++ b/drivers/staging/media/max96712/max96712.c @@ -16,18 +16,22 @@ #include #include -#define MAX96712_DPLL_FREQ 1000 - enum max96712_pattern { MAX96712_PATTERN_CHECKERBOARD = 0, MAX96712_PATTERN_GRADIENT, }; +struct max96712_info { + unsigned int dpllfreq; +}; + struct max96712_priv { struct i2c_client *client; struct regmap *regmap; struct gpio_desc *gpiod_pwdn; + const struct max96712_info *info; + bool cphy; struct v4l2_mbus_config_mipi_csi2 mipi; @@ -138,9 +142,9 @@ static void max96712_mipi_configure(struct max96712_priv *priv) /* Set link frequency for PHY0 and PHY1. */ max96712_update_bits(priv, 0x415, 0x3f, - ((MAX96712_DPLL_FREQ / 100) & 0x1f) | BIT(5)); + ((priv->info->dpllfreq / 100) & 0x1f) | BIT(5)); max96712_update_bits(priv, 0x418, 0x3f, - ((MAX96712_DPLL_FREQ / 100) & 0x1f) | BIT(5)); + ((priv->info->dpllfreq / 100) & 0x1f) | BIT(5)); /* Enable PHY0 and PHY1 */ max96712_update_bits(priv, 0x8a2, 0xf0, 0x30); @@ -302,7 +306,7 @@ static int max96712_v4l2_register(struct max96712_priv *priv) * TODO: Once V4L2_CID_LINK_FREQ is changed from a menu control to an * INT64 control it should be used here instead of V4L2_CID_PIXEL_RATE. */ - pixel_rate = MAX96712_DPLL_FREQ / priv->mipi.num_data_lanes * 1000000; + pixel_rate = priv->info->dpllfreq / priv->mipi.num_data_lanes * 1000000; v4l2_ctrl_new_std(&priv->ctrl_handler, NULL, V4L2_CID_PIXEL_RATE, pixel_rate, pixel_rate, 1, pixel_rate); @@ -405,6 +409,8 @@ static int max96712_probe(struct i2c_client *client) if (!priv) return -ENOMEM; + priv->info = of_device_get_match_data(&client->dev); + priv->client = client; i2c_set_clientdata(client, priv); @@ -443,9 +449,13 @@ static void max96712_remove(struct i2c_client *client) gpiod_set_value_cansleep(priv->gpiod_pwdn, 0); } +static const struct max96712_info max96712_info_max96712 = { + .dpllfreq = 1000, +}; + static const struct of_device_id max96712_of_table[] = { - { .compatible = "maxim,max96712" }, - { /* sentinel */ }, + { .compatible = "maxim,max96712", .data = &max96712_info_max96712 }, + { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, max96712_of_table); From patchwork Wed Oct 2 09:23:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 13819545 Received: from fhigh-a6-smtp.messagingengine.com (fhigh-a6-smtp.messagingengine.com [103.168.172.157]) (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 BBC2119993F; Wed, 2 Oct 2024 09:24:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727861055; cv=none; b=EMngc4YLXJY3nbM7yXlqCFlTsvRHJgyr7gM0lPIsd3QCnW4Btn/t5GOXPjTawBSsDSWhuWfrupxfq5OtYBsANBKdOazj0dXzYUJOMlOgtFPRrlfktsHJMbw5H9Lr2NRJJwkIJZQzfyeNp6yojmDQ3QHPi46e6sHDHCh4fihp4r0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727861055; c=relaxed/simple; bh=uwE9OHNlYxThlbjczUHekig0IqYW0jV1KH2+wvQVVM4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=K0xZSxZd0zaLWjZ3k6L30csPXPnHQHODLF0VrzC2BbhccknALTgaEDsBdSEu4SHICG4+ZkJ1MWH9tdYyTKGHG5Fv/7QVcAx+c6mxSNQu93tANIpf1uwyASxEUKY8sSaD/Fh63PGyA2YW1VY5/lRo0151tWgu23Ilg3t3zmDOOp4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ragnatech.se; spf=pass smtp.mailfrom=ragnatech.se; dkim=pass (2048-bit key) header.d=ragnatech.se header.i=@ragnatech.se header.b=Bi20DKfQ; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=AyrltPeP; arc=none smtp.client-ip=103.168.172.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ragnatech.se Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ragnatech.se Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ragnatech.se header.i=@ragnatech.se header.b="Bi20DKfQ"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="AyrltPeP" Received: from phl-compute-06.internal (phl-compute-06.phl.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id CE66911401FE; Wed, 2 Oct 2024 05:24:12 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Wed, 02 Oct 2024 05:24:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech.se; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1727861052; x=1727947452; bh=8cxyk2OLbPobtuJOkQl/8jYqwQNeXifeQSsKLECjKMQ=; b= Bi20DKfQumO16+HU3W5Z3TDBEa/bEefgzjpU1K1wtW518b8pAObhxJSNSV8FXaGD OVUtPXCBTEmInRJFQiHaUgOpK3RatlJwLsLbOSVe7IHx5HWdn/NF+aJZrxViv9Gz CdNl537jNAq12/erOmdis3x2ZnGwFH6aepIU4wrg4CKQJrsADDFlidJ6mZMqL497 ySwo8062JtplTOuwsB+hlWQ0fZY4zBaZWRHoFgJdIu8QflNRm6pv/jN5kxNmT+s6 dU6WgMx/5/oiwFxSFEtGejEK22K6K5c2xskkYQKnw/RyOCH4vt1qzmqQz975g4AA 1IutrC9ZQRFfOheB22rNWA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1727861052; x= 1727947452; bh=8cxyk2OLbPobtuJOkQl/8jYqwQNeXifeQSsKLECjKMQ=; b=A yrltPePL0j8mTesJZeHSr825PWxPvkIruRKgnlmejUyvcSvh4cyPP6oMTQdf2I/Z DW68gio3lhxL96KPxFJ6fbHdIjmtOhB0q9q9vKYmYqeSTDcM7m67JToaNXaJCgJS zRbDbMrjx2g7v+8FXo7ODVWep1/Zs81CW6L5kNtpU3qEPSsaO+d15W2rWo0woumb rYHOX7yzq6OnRXGjqx6mGM3r1MebiOCIcB0H7fZKuHCqPp1RdowHGDr2imV+IdHt 77MfwLhLfAWtBw5sGNI1jKRl2Zs+Hh1ifeQ6tmYUz9NOy25ThRwudXxjUdxhleoP kAN9pDsuWqOSkN2LQnkFQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdduledgudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefufffkofgjfhggtgfgsehtkeertdertdej necuhfhrohhmpefpihhklhgrshcuufpnuggvrhhluhhnugcuoehnihhklhgrshdrshhoug gvrhhluhhnugdorhgvnhgvshgrshesrhgrghhnrghtvggthhdrshgvqeenucggtffrrght thgvrhhnpeehiefgueevuedtfefhheegkeevtdelueeukeevfeduhefhhfejfffggeffle efgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehn ihhklhgrshdrshhouggvrhhluhhnugesrhgrghhnrghtvggthhdrshgvpdhnsggprhgtph htthhopedufedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepshgrkhgrrhhirdgr ihhluhhssehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtohepmhgthhgvhhgrsg eskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhosghhsehkvghrnhgvlhdrohhrghdp rhgtphhtthhopehkrhiikhdoughtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopegtoh hnohhrodgutheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepghhrvghgkhhhsehlihhn uhigfhhouhhnuggrthhiohhnrdhorhhgpdhrtghpthhtohepshgrkhgrrhhirdgrihhluh hssehikhhirdhfihdprhgtphhtthhopehjuhhlihgvnhdrmhgrshhsohhtsegtohhllhgr sghorhgrrdgtohhmpdhrtghpthhtoheplhhinhhugidqmhgvughirgesvhhgvghrrdhkvg hrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i80c9496c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 2 Oct 2024 05:24:12 -0400 (EDT) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: Sakari Ailus , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Greg Kroah-Hartman , Sakari Ailus , Julien Massot , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-staging@lists.linux.dev Cc: linux-renesas-soc@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= Subject: [PATCH v4 4/5] media: staging: max96712: Document the DEBUG_EXTRA register Date: Wed, 2 Oct 2024 11:23:30 +0200 Message-ID: <20241002092331.4135906-5-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20241002092331.4135906-1-niklas.soderlund+renesas@ragnatech.se> References: <20241002092331.4135906-1-niklas.soderlund+renesas@ragnatech.se> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The DEBUG_EXTRA register is not part of soon to be added MAX96724 device. To make it easier to understand the differences when reading the code prepare for the addition by creating named defines for the register. Signed-off-by: Niklas Söderlund --- * Changes since v3 - Fix misspelling of EXTRA in defines. * Changes since v2 - New in v3. --- drivers/staging/media/max96712/max96712.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/staging/media/max96712/max96712.c b/drivers/staging/media/max96712/max96712.c index 46a6bb018fe2..0ee66022026e 100644 --- a/drivers/staging/media/max96712/max96712.c +++ b/drivers/staging/media/max96712/max96712.c @@ -16,6 +16,10 @@ #include #include +#define DEBUG_EXTRA_REG 0x09 +#define DEBUG_EXTRA_PCLK_25MHZ 0x00 +#define DEBUG_EXTRA_PCLK_75MHZ 0x01 + enum max96712_pattern { MAX96712_PATTERN_CHECKERBOARD = 0, MAX96712_PATTERN_GRADIENT, @@ -170,7 +174,7 @@ static void max96712_pattern_enable(struct max96712_priv *priv, bool enable) } /* PCLK 75MHz. */ - max96712_write(priv, 0x0009, 0x01); + max96712_write(priv, DEBUG_EXTRA_REG, DEBUG_EXTRA_PCLK_75MHZ); /* Configure Video Timing Generator for 1920x1080 @ 30 fps. */ max96712_write_bulk_value(priv, 0x1052, 0, 3); From patchwork Wed Oct 2 09:23:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 13819546 Received: from fhigh-a6-smtp.messagingengine.com (fhigh-a6-smtp.messagingengine.com [103.168.172.157]) (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 8B64F199E98; Wed, 2 Oct 2024 09:24:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727861057; cv=none; b=NLlLgx8JnpZ/SfeMzekV09220+3jaVCin1vwh2CchUyZoLudZFGqE5lN6NOyb9UpH1g8wxPoGbaIVOleuKku9mvSlEvhx2tAG1ZxxD/LGFKsmXBiKPgT+rQSkl2FCNLYd4o1xCTHYmcKaWvOdm5IurBPRUWrXLVMNe1akEmrxck= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727861057; c=relaxed/simple; bh=+sW71fMhknxpcA3opf+DYaW9ctx6YYxo+keoEe+fPpA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=OuQWDCrTJ2BfKIXM4nxsoNq/lZxe9/DCCk62Ib1IpB2mv9/Q5B6vvSH1Wz7oUfZJwS6KmTXkW1S2gJNAykIIXwa1bw81KWUt80A4Pm29EqmCNJ+89Rl+COFEH1qPpotRhHB25t+fvVZpdyjU60LG+LBhocqQcnPig3JU9632208= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ragnatech.se; spf=pass smtp.mailfrom=ragnatech.se; dkim=pass (2048-bit key) header.d=ragnatech.se header.i=@ragnatech.se header.b=YRbGd1lu; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=S0JOwN0S; arc=none smtp.client-ip=103.168.172.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ragnatech.se Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ragnatech.se Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ragnatech.se header.i=@ragnatech.se header.b="YRbGd1lu"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="S0JOwN0S" Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfhigh.phl.internal (Postfix) with ESMTP id D0BE31140191; Wed, 2 Oct 2024 05:24:14 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Wed, 02 Oct 2024 05:24:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech.se; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1727861054; x=1727947454; bh=hVVCX2ag5XBXOwf74k/blaHyu3bR2YQZ2vJgRSmE4Xc=; b= YRbGd1lutFjNS2IRq0ylLx99NJu0TmZ6O3Qyw7jT3sYhd3HuzYjPyZ8FQHvjDVuc KVNI3/3pxQ0UXH+NuM1FTK5die/xr+cO3lnTjVGWnFMyC9mGgAgHDq7chV/EiW8v Cq/izHcrCaD6+rJH9RElkby7fuR5r3naNC6271GynR18yAxtynpNFQMFT6p1t14c Ae0v6y4c9Myf4kFfo6HAxaqqRePZEx6vpbQKVhKVdqUhgDAkTVrWgHzNUpck0Ik7 Bvyd1xInvpNBIvueq8m6L45A6NdW+D9zOO6D02mx5TawSza6KfxX5mcpC/fEGse0 koIHjdQ/wTdBbPNPXXNYFQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1727861054; x= 1727947454; bh=hVVCX2ag5XBXOwf74k/blaHyu3bR2YQZ2vJgRSmE4Xc=; b=S 0JOwN0Sl6o54cRL1fmE7iuV6ijPPA7ldoyfJAjb/HIVaqEGIgJlYaQOjz77QWnTk XKdFSXOxyTVAmEK8X7CM0QFDlvLLL/tVSBQH4DiZZDoL8fbNINLxB/b3+x9dmpKN bT2iolJTAd27/uGzPPvR347kDL6/00IhpChtQqJNPkgRD8TBxUJIYdOXhg+2uxsF SBaPSxoEmFHEd5+858cBaeHmgbPX3BgCkUxk5xXfCZzkAtA0y3Nd4tF42OPu3Vmb d+ubrITzom/89ZAAKCQZok+BSqTcF1JJaX+TTovCgK+mCWRzgzL1rJe0gJitBL8l kmXg+LQ2dpGC/LYD7pG9A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdduledguddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefufffkofgjfhggtgfgsehtkeertdertdej necuhfhrohhmpefpihhklhgrshcuufpnuggvrhhluhhnugcuoehnihhklhgrshdrshhoug gvrhhluhhnugdorhgvnhgvshgrshesrhgrghhnrghtvggthhdrshgvqeenucggtffrrght thgvrhhnpeehiefgueevuedtfefhheegkeevtdelueeukeevfeduhefhhfejfffggeffle efgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehn ihhklhgrshdrshhouggvrhhluhhnugesrhgrghhnrghtvggthhdrshgvpdhnsggprhgtph htthhopedufedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepshgrkhgrrhhirdgr ihhluhhssehlihhnuhigrdhinhhtvghlrdgtohhmpdhrtghpthhtohepmhgthhgvhhgrsg eskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhosghhsehkvghrnhgvlhdrohhrghdp rhgtphhtthhopehkrhiikhdoughtsehkvghrnhgvlhdrohhrghdprhgtphhtthhopegtoh hnohhrodgutheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepghhrvghgkhhhsehlihhn uhigfhhouhhnuggrthhiohhnrdhorhhgpdhrtghpthhtohepshgrkhgrrhhirdgrihhluh hssehikhhirdhfihdprhgtphhtthhopehjuhhlihgvnhdrmhgrshhsohhtsegtohhllhgr sghorhgrrdgtohhmpdhrtghpthhtoheplhhinhhugidqmhgvughirgesvhhgvghrrdhkvg hrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i80c9496c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 2 Oct 2024 05:24:14 -0400 (EDT) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: Sakari Ailus , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Greg Kroah-Hartman , Sakari Ailus , Julien Massot , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-staging@lists.linux.dev Cc: linux-renesas-soc@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= Subject: [PATCH v4 5/5] media: staging: max96712: Add support for MAX96724 Date: Wed, 2 Oct 2024 11:23:31 +0200 Message-ID: <20241002092331.4135906-6-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20241002092331.4135906-1-niklas.soderlund+renesas@ragnatech.se> References: <20241002092331.4135906-1-niklas.soderlund+renesas@ragnatech.se> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The MAX96724 is almost identical to the MAX96712 and can be supported by the same driver, add support for it. For the staging driver which only supports patter generation the big difference is that the datasheet (rev 4) for MAX96724 do not describe the DEBUG_EXTRA register, which is at offset 0x0009 on MAX96712. It's not clear if this register is removed or moved to a different offset. What is known is writing to register 0x0009 have no effect on MAX96724. This makes it impossible to increase the test pattern clock frequency from 25 MHz to 75Mhz on MAX96724. To be able to get a stable test pattern the DPLL frequency have to be increase instead to compensate for this. The frequency selected is found by experimentation as the MAX96724 datasheet is much sparser then what's available for MAX96712. Signed-off-by: Niklas Söderlund --- * Changes since v2 - Use device information instead of if and switches statements to differentiate between to two devices. * Changes since v1 - Group in series together with binding. --- drivers/staging/media/max96712/max96712.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/max96712/max96712.c b/drivers/staging/media/max96712/max96712.c index 0ee66022026e..ede02e8c891c 100644 --- a/drivers/staging/media/max96712/max96712.c +++ b/drivers/staging/media/max96712/max96712.c @@ -27,6 +27,7 @@ enum max96712_pattern { struct max96712_info { unsigned int dpllfreq; + bool have_debug_extra; }; struct max96712_priv { @@ -173,8 +174,9 @@ static void max96712_pattern_enable(struct max96712_priv *priv, bool enable) return; } - /* PCLK 75MHz. */ - max96712_write(priv, DEBUG_EXTRA_REG, DEBUG_EXTRA_PCLK_75MHZ); + /* Set PCLK to 75MHz if device have DEBUG_EXTRA register. */ + if (priv->info->have_debug_extra) + max96712_write(priv, DEBUG_EXTRA_REG, DEBUG_EXTRA_PCLK_75MHZ); /* Configure Video Timing Generator for 1920x1080 @ 30 fps. */ max96712_write_bulk_value(priv, 0x1052, 0, 3); @@ -455,10 +457,16 @@ static void max96712_remove(struct i2c_client *client) static const struct max96712_info max96712_info_max96712 = { .dpllfreq = 1000, + .have_debug_extra = true, +}; + +static const struct max96712_info max96712_info_max96724 = { + .dpllfreq = 1200, }; static const struct of_device_id max96712_of_table[] = { { .compatible = "maxim,max96712", .data = &max96712_info_max96712 }, + { .compatible = "maxim,max96724", .data = &max96712_info_max96724 }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, max96712_of_table);