From: Jiri Prchal <jiri.prchal@aksignal.cz>
To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Rob Herring <robh+dt@kernel.org>,
Christian Eggers <ceggers@arri.de>, Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Prchal <jiri.prchal@aksignal.cz>
Subject: [PATCH v10 1/4] nvmem: prepare basics for FRAM support
Date: Fri, 11 Jun 2021 11:45:58 +0200 [thread overview]
Message-ID: <20210611094601.95131-2-jiri.prchal@aksignal.cz> (raw)
In-Reply-To: <20210611094601.95131-1-jiri.prchal@aksignal.cz>
Added enum and string for FRAM (ferroelectric RAM) to expose it as file
named "fram".
Added documentation of sysfs file.
Signed-off-by: Jiri Prchal <jiri.prchal@aksignal.cz>
---
v2: no change here
v3: resend and added more recipients
v4: resend
v5: no change here
v6: changed commit subject
v7: no change here
v8: changed subject
v9: no change here
v10: moved documentation to here
---
Documentation/ABI/testing/sysfs-class-spi-eeprom | 8 ++++++++
drivers/nvmem/core.c | 4 ++++
include/linux/nvmem-provider.h | 1 +
3 files changed, 13 insertions(+)
create mode 100644 Documentation/ABI/testing/sysfs-class-spi-eeprom
diff --git a/Documentation/ABI/testing/sysfs-class-spi-eeprom b/Documentation/ABI/testing/sysfs-class-spi-eeprom
new file mode 100644
index 000000000000..7447e242d415
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-class-spi-eeprom
@@ -0,0 +1,8 @@
+What: /sys/class/spi_master/spi<bus>/spi<bus>.<dev>/fram
+Date: June 2021
+KernelVersion: 5.14
+Contact: Jiri Prchal <jiri.prchal@aksignal.cz>
+Description:
+ Contains the FRAM binary data. Same as EEPROM, just another file
+ name to indicate that it employs ferroelectric process.
+ It performs write operations at bus speed - no write delays.
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index 177f5bf27c6d..01ef9a934b0a 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -180,6 +180,7 @@ static const char * const nvmem_type_str[] = {
[NVMEM_TYPE_EEPROM] = "EEPROM",
[NVMEM_TYPE_OTP] = "OTP",
[NVMEM_TYPE_BATTERY_BACKED] = "Battery backed",
+ [NVMEM_TYPE_FRAM] = "FRAM",
};
#ifdef CONFIG_DEBUG_LOCK_ALLOC
@@ -359,6 +360,9 @@ static int nvmem_sysfs_setup_compat(struct nvmem_device *nvmem,
if (!config->base_dev)
return -EINVAL;
+ if (config->type == NVMEM_TYPE_FRAM)
+ bin_attr_nvmem_eeprom_compat.attr.name = "fram";
+
nvmem->eeprom = bin_attr_nvmem_eeprom_compat;
nvmem->eeprom.attr.mode = nvmem_bin_attr_get_umode(nvmem);
nvmem->eeprom.size = nvmem->size;
diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h
index e162b757b6d5..890003565761 100644
--- a/include/linux/nvmem-provider.h
+++ b/include/linux/nvmem-provider.h
@@ -25,6 +25,7 @@ enum nvmem_type {
NVMEM_TYPE_EEPROM,
NVMEM_TYPE_OTP,
NVMEM_TYPE_BATTERY_BACKED,
+ NVMEM_TYPE_FRAM,
};
#define NVMEM_DEVID_NONE (-1)
--
2.25.1
next prev parent reply other threads:[~2021-06-11 9:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-11 9:45 [PATCH v10 0/4] add support for FRAM Jiri Prchal
2021-06-11 9:45 ` Jiri Prchal [this message]
2021-06-11 9:45 ` [PATCH v10 2/4] nvmem: eeprom: at25: " Jiri Prchal
2021-06-16 18:59 ` kernel test robot
2021-06-22 7:44 ` kernel test robot
2021-06-11 9:46 ` [PATCH v10 3/4] dt-bindings: nvmem: at25: add for FRAM support Jiri Prchal
2021-06-11 9:46 ` [PATCH v10 4/4] nvmem: eeprom: at25: export FRAM serial num Jiri Prchal
2021-06-16 20:10 ` kernel test robot
2021-06-22 9:33 ` kernel test robot
2021-06-11 10:25 ` [PATCH v10 0/4] add support for FRAM Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210611094601.95131-2-jiri.prchal@aksignal.cz \
--to=jiri.prchal@aksignal.cz \
--cc=arnd@arndb.de \
--cc=ceggers@arri.de \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®