Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1885617rwl; Thu, 30 Mar 2023 02:57:39 -0700 (PDT) X-Google-Smtp-Source: AKy350b9CKO0iJISmjnOA3bQbxJfkXZhG1hKcAYm8//U9Kkk/5nUthoD4Q3+LPXdbSah+9LIsApL X-Received: by 2002:a17:90a:448a:b0:240:c4e6:2b2f with SMTP id t10-20020a17090a448a00b00240c4e62b2fmr1548974pjg.0.1680170259191; Thu, 30 Mar 2023 02:57:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680170259; cv=none; d=google.com; s=arc-20160816; b=iNTpXbFH242wxm7dSGzs1me285a0+fa1okOpBi7v18SpJA3JOXFtWnLrlUA+LpzlcL OuhFatZ37S0Al+rKHjZEL7MvOPwvKTWDKwYZ9qmFAxhgimcsDTuRWuX/Ft21rCWMsFms T5NoQznl/4pzRwAlCMKnn6H37uy06OUZf0tJIzVP4cGrnaVG9Gd2Wzx9LZ9zQLFva6+p gZljthsKCcrpUXr0SiMVRpZWYy1lRCiwcjYXrDff1zwMlSUHtX5Wc0CYhFg0Ze7xwoDa 6I2yrAHpEFRQKk677n9ynuCgl//YsINsDBw1ivzVJyIdYWBd9t8H5BB/R9d3bvxMtKb4 quhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BfCqrBgiqxweVNM1TXbSkTYgh4gxLV1zcEcv6yIVr5w=; b=BRqjOT0LpfF5xJqabTdrTCaMR73zAzDlDHMi0rkzgEezLMC53QMXyKat+SAqSBhf1J ESvH5ksOWqvqnLFgJs83ImbLAm9MLQKC1pjOGgYSabG3O/i/oLhadKASipRMHIfXLRX1 XSYQrBI1cFRHUepZZr6yZaObEoU0m8OujRpRwX4ecTmgN/wTc5MHDHNACRMDMq7Yj56V mLDZ9zyxPZRTjZSeoJJO6L3MDjzZ4q53e7xlQG//YysXPJKoCB6Bwj75tUOs7TlFwrg4 +aQpi9eoT6mpVmT5ZSh2aVPp1JzrnRYcD/PxGAP+bVitin5qK/G9m6Esb37mdQPAd9SA sgEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=qjhBh38I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id em4-20020a17090b014400b002409e4ae257si3557232pjb.92.2023.03.30.02.57.26; Thu, 30 Mar 2023 02:57:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=qjhBh38I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230119AbjC3JxH (ORCPT + 99 others); Thu, 30 Mar 2023 05:53:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230198AbjC3Jwt (ORCPT ); Thu, 30 Mar 2023 05:52:49 -0400 Received: from mail.3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D6AE728A; Thu, 30 Mar 2023 02:51:52 -0700 (PDT) Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (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 mail.3ffe.de (Postfix) with ESMTPSA id 463511272; Thu, 30 Mar 2023 11:51:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1680169910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BfCqrBgiqxweVNM1TXbSkTYgh4gxLV1zcEcv6yIVr5w=; b=qjhBh38Itt0cwBjWXOoTtH38EhHSnjiqyZVZb88hPF1f4H3D/+g1kTF8sb8o3Q24S2i9KH AtreYhCTsaHF2zyxZ/zxCWfNU2GTDslbu9K8BXOMf5bhFZeO3PbaW6SqKzB0Gcbay12L+L HsTNVh3Uzb36PQVd+wTRBqGe2GrTsek23VXOYEeuevUoY2TejtoKR1hNC0jIsh6phAbyd/ OM8tpjoo7bR444kZEtvmh2U/2AVBfMXyJvYjdiHIz6OC0JB6T616kJwL/fI6023H8Ldv1f RamYA+lcWwVxeomFSfkyuqkFq5xOFSbxevpIGE5phaQwHLFfT6GjkQcr14mPTg== From: Michael Walle To: vaibhaavram.tl@microchip.com Cc: Tharunkumar.Pasumarthi@microchip.com, UNGLinuxDriver@microchip.com, arnd@arndb.de, gregkh@linuxfoundation.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla , Michael Walle Subject: Re: [PATCH v8 char-misc-next 3/5] misc: microchip: pci1xxxx: Add EEPROM Functionality to read and write into EEPROM bin sysfs Date: Thu, 30 Mar 2023 11:51:40 +0200 Message-Id: <20230330095140.3384441-1-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [First, please CC people who did comments on previous versions.] > > > Microchip's pci1xxxx is an unmanaged PCIe3.1a switch for consumer, > > > industrial, and automotive applications. This switch integrates OTP > > > and EEPROM to enable customization of the part in the field. > > > This patch adds EEPROM functionality to support the same. > > > > Again, why not use the in-kernel eeprom api instead? > Unlike other in-Kernel EEPROM APIs, this EEPROM is not accessible > through any of the i2c/spi buses available to the kernel. I fail to see how this matters. NVMEM has a generic read/write callback. There is no dependency on I2C or SPI. Again, you should look into nvmem. And it should be perfectly fine to use nvmem without nvmem cells at all. With CONFIG_NVMEM_SYSFS you should get a "nvmem" binary file in sysfs. Wit config->compat set (although I don't know if that is recommended) you should get an "eeprom" binary file in sysfs. > It is only accessible through the register interface available in the > EEPROM controller of the PCI1XXXX device. -michael