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: 832634 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: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: 832633 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);