From patchwork Fri Oct 13 06:30:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 733498 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B102CDB47E for ; Fri, 13 Oct 2023 06:30:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229786AbjJMGaR (ORCPT ); Fri, 13 Oct 2023 02:30:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229781AbjJMGaQ (ORCPT ); Fri, 13 Oct 2023 02:30:16 -0400 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE380BC; Thu, 12 Oct 2023 23:30:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1697178614; x=1728714614; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=c8NemQmEEtATdCtPjluXwUnrBkqItgm8r0eFaVBUzMw=; b=I760LBV9USYelfzJyg5/eSLL6clOrUvTZx/HV36iSa8AIIeKFzZQYF8D l8XjeOPllZxXWuJsyJRRSu12fKTYFbFfMdZL3GDWFslTwXnOWJgqPo6WO J8D6gdV6z3VIWOGaJ0IIbpkhSUs9c2pqmsrASw30oHYoDUzsi0yVo2CM7 jzdv1tFweMRccD8BImO6X6MB3kqw0x3GjryvWkHe0k+sPOP4/M5dfvuvB NQFD59LJqE5KNrw5kHYTzQoRRPMnGJUeMoRFZKYGwQksOGBEvlKcFCeRH YsXF2VKYOblmTOVER4uWxDvTDASkJXU8nn1HJLkoaGI/JGDMn30VH4jUC w==; X-IronPort-AV: E=Sophos;i="6.03,221,1694728800"; d="scan'208";a="33444546" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 13 Oct 2023 08:30:11 +0200 Received: from steina-w.tq-net.de (steina-w.tq-net.de [10.123.53.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id 529E7280082; Fri, 13 Oct 2023 08:30:11 +0200 (CEST) From: Alexander Stein To: Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Arnd Bergmann , Greg Kroah-Hartman , linux-i2c@vger.kernel.org Cc: Alexander Stein , devicetree@vger.kernel.org, Marek Vasut Subject: [PATCH 1/2] dt-bindings: at24: add ST M24C64-D Additional Write lockable page Date: Fri, 13 Oct 2023 08:30:07 +0200 Message-Id: <20231013063008.2879314-1-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org The ST M24C64-D behaves as a regular M24C64, except for the -D variant which uses up another I2C address for Additional Write lockable page. This page is 32 Bytes long and can contain additional data. Document compatible string for it, so users can describe that page in DT. Note that users still have to describe the main M24C64 area separately as that is on separate I2C address from this page. Signed-off-by: Alexander Stein Reviewed-by: Marek Vasut Acked-by: Conor Dooley --- This is a copy & paste of [1] for ST M24C64-D. I reused the same pattern and also used Marek's commit message. [1] https://lore.kernel.org/all/20231010190926.57674-1-marex@denx.de/#t Documentation/devicetree/bindings/eeprom/at24.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/eeprom/at24.yaml b/Documentation/devicetree/bindings/eeprom/at24.yaml index 7be127e9b2507..6385b05a1e62f 100644 --- a/Documentation/devicetree/bindings/eeprom/at24.yaml +++ b/Documentation/devicetree/bindings/eeprom/at24.yaml @@ -73,6 +73,8 @@ properties: pattern: cs32$ - items: pattern: c64$ + - items: + pattern: c64d-wl$ - items: pattern: cs64$ - items: From patchwork Fri Oct 13 06:30:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 733792 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 291F0CDB483 for ; Fri, 13 Oct 2023 06:30:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229794AbjJMGaT (ORCPT ); Fri, 13 Oct 2023 02:30:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229797AbjJMGaS (ORCPT ); Fri, 13 Oct 2023 02:30:18 -0400 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 973D6C0; Thu, 12 Oct 2023 23:30:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1697178615; x=1728714615; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=t8hb8DajnLzTWBUQiRCBFwi/7VzTbtHdAUnkV0j8nuk=; b=Y68TCcLZtyQzc3HF/hYbc0Zpv0pTBzpqyOusFXD7QmPl4Nm145P9AKTe pe5PpZEMnrzaiWXbH2jnZSU7VUaQI0eNjUvD1lk3UFGwq2yNfLTlckGgn 019W/MFHNmgxNIDTOgdrxuAF4mhnFvLzZz+yJPuDUdekVbuinc75vNX7M eLMPrhOhTUqqwxiqnbjHE4ea5oSzOX6QEh1cVaBpuPo1BdOMrrGS2Tk2/ XlNg0sQXBZcv2n6aB4MhODUup3v0aWDjYJndOobHfoowdJ42VGbPEGpAj PmToh3tWBgXjbEYK4V4D/tZ03VwPNxCCDDnPtmiT64KIVRaQsqY23vRUR Q==; X-IronPort-AV: E=Sophos;i="6.03,221,1694728800"; d="scan'208";a="33444547" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 13 Oct 2023 08:30:11 +0200 Received: from steina-w.tq-net.de (steina-w.tq-net.de [10.123.53.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id 8B47D280084; Fri, 13 Oct 2023 08:30:11 +0200 (CEST) From: Alexander Stein To: Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Arnd Bergmann , Greg Kroah-Hartman , linux-i2c@vger.kernel.org Cc: Alexander Stein , devicetree@vger.kernel.org, Marek Vasut Subject: [PATCH 2/2] eeprom: at24: add ST M24C64-D Additional Write lockable page support Date: Fri, 13 Oct 2023 08:30:08 +0200 Message-Id: <20231013063008.2879314-2-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231013063008.2879314-1-alexander.stein@ew.tq-group.com> References: <20231013063008.2879314-1-alexander.stein@ew.tq-group.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org The ST M24C64-D behaves as a regular M24C64, except for the -D variant which uses up another I2C address for Additional Write lockable page. This page is 32 Bytes long and can contain additional data. Add entry for it, so users can describe that page in DT. Note that users still have to describe the main M24C64 area separately as that is on separate I2C address from this page. Signed-off-by: Alexander Stein --- This is a copy & paste of [1] for ST M24C64-D. I reused the same pattern and also used Marek's commit message. [1] https://lore.kernel.org/all/20231010190926.57674-2-marex@denx.de/ drivers/misc/eeprom/at24.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c index 616e63efc9864..f61a80597a22d 100644 --- a/drivers/misc/eeprom/at24.c +++ b/drivers/misc/eeprom/at24.c @@ -196,6 +196,8 @@ AT24_CHIP_DATA(at24_data_24c32d_wlp, 32, AT24_FLAG_ADDR16); AT24_CHIP_DATA(at24_data_24cs32, 16, AT24_FLAG_ADDR16 | AT24_FLAG_SERIAL | AT24_FLAG_READONLY); AT24_CHIP_DATA(at24_data_24c64, 65536 / 8, AT24_FLAG_ADDR16); +/* M24C64-D Additional Write lockable page (M24C64-D order codes) */ +AT24_CHIP_DATA(at24_data_24c64d_wlp, 32, AT24_FLAG_ADDR16); AT24_CHIP_DATA(at24_data_24cs64, 16, AT24_FLAG_ADDR16 | AT24_FLAG_SERIAL | AT24_FLAG_READONLY); AT24_CHIP_DATA(at24_data_24c128, 131072 / 8, AT24_FLAG_ADDR16); @@ -227,6 +229,7 @@ static const struct i2c_device_id at24_ids[] = { { "24c32d-wl", (kernel_ulong_t)&at24_data_24c32d_wlp }, { "24cs32", (kernel_ulong_t)&at24_data_24cs32 }, { "24c64", (kernel_ulong_t)&at24_data_24c64 }, + { "24c64-wl", (kernel_ulong_t)&at24_data_24c64d_wlp }, { "24cs64", (kernel_ulong_t)&at24_data_24cs64 }, { "24c128", (kernel_ulong_t)&at24_data_24c128 }, { "24c256", (kernel_ulong_t)&at24_data_24c256 }, @@ -258,6 +261,7 @@ static const struct of_device_id at24_of_match[] = { { .compatible = "atmel,24c32d-wl", .data = &at24_data_24c32d_wlp }, { .compatible = "atmel,24cs32", .data = &at24_data_24cs32 }, { .compatible = "atmel,24c64", .data = &at24_data_24c64 }, + { .compatible = "atmel,24c64d-wl", .data = &at24_data_24c64d_wlp }, { .compatible = "atmel,24cs64", .data = &at24_data_24cs64 }, { .compatible = "atmel,24c128", .data = &at24_data_24c128 }, { .compatible = "atmel,24c256", .data = &at24_data_24c256 },