Age | Commit message (Collapse) | Author | Files | Lines |
|
Set type as NVMEM_TYPE_EEPROM to expose this info via
sysfs:
$ cat /sys/bus/nvmem/devices/{DEVICE}/type
EEPROM
Signed-off-by: Vadym Kochan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
We need the fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
SPI eeproms are addressed by byte.
Signed-off-by: Christian Eggers <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Storage technologies like FRAM have no "write pages", the whole chip can
be written within one SPI transfer. For these chips, the page size can
be set equal to the device size. Currently available devices are already
bigger than 64 kiB.
Signed-off-by: Christian Eggers <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.
[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
Signed-off-by: Gustavo A. R. Silva <[email protected]>
|
|
Based on 1 normalized pattern(s):
this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version
extracted by the scancode license scanner the SPDX license identifier
GPL-2.0-or-later
has been chosen to replace the boilerplate/reference in 3029 file(s).
Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Allison Randal <[email protected]>
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/misc/eeprom/at25.c: In function 'at25_remove':
drivers/misc/eeprom/at25.c:384:20: warning:
variable 'at25' set but not used [-Wunused-but-set-variable]
Since commit 96d08fb43e30 ("eeprom: at25: use devm_nvmem_register()"),
at25_remove is do nothing, so can be removed.
Signed-off-by: YueHaibing <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Use the resource managed variant of nvmem_register().
Signed-off-by: Bartosz Golaszewski <[email protected]>
Signed-off-by: Srinivas Kandagatla <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.
Signed-off-by: Gustavo A. R. Silva <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Resolved checkpatch warning "sizeof t should be sizeof(t)"
issue found by checkpatch.
Signed-off-by: Devang Panchal <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Certain EEPROMS have a size that is larger than the number of address
bytes would allow, and store the MSB of the address in bit 3 of the
instruction byte.
This can be described in platform data using EE_INSTR_BIT3_IS_ADDR, or
in DT using the obsolete legacy "at25,addr-mode" property.
But currently there exists no non-deprecated way to describe this in DT.
Hence extend the existing "address-width" DT property to allow
specifying 9 address bits, and enable support for that in the driver.
This has been tested with a Microchip 25LC040A.
Signed-off-by: Geert Uytterhoeven <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
The patch does the following:
- fixes specifiers and removes explicit casting of the parameters
- joins literals to one line
- increases readability of the parameters
Signed-off-by: Andy Shevchenko <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
The at25 driver is using spi_dev_get() apparently just to take a copy
of the SPI device used to instantiate it but never calls spi_dev_put()
to free it. Since the device is guaranteed to exist between probe() and
remove() there should be no need for the driver to take an extra
reference to it so fix the leak by just using a straight assignment.
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
This patch moves to nvmem support in the driver to use callback instead
of regmap.
Signed-off-by: Srinivas Kandagatla <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Add a regmap for accessing the EEPROM, and then use that with the
NVMEM framework. Enable backwards compatibility in the NVMEM config,
so that the 'eeprom' file in sys is provided by the framework.
Signed-off-by: Andrew Lunn <[email protected]>
Acked-by: Srinivas Kandagatla <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
The setup() callback is not used by any in kernel code. Remove it.
Any new code which requires access to the eeprom can use the NVMEM
API.
Signed-off-by: Andrew Lunn <[email protected]>
Acked-by: Srinivas Kandagatla <[email protected]>
Acked-by: Wolfram Sang <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Use kobj_to_dev() instead of open-coding it.
Signed-off-by: Geliang Tang <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
An spi_driver does not need to set an owner, it will be populated by the
driver core.
Signed-off-by: Andrew F. Davis <[email protected]>
Acked-by: Jonathan Cameron <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
|
|
Make use of device property API in this driver so that both DT and ACPI
based systems can use this driver.
In addition we hard-code the name of the chip to be "at25" for the
reason that there is no common mechanism to fetch name of the firmware
node. The only existing user (arch/arm/boot/dts/phy3250.dts) uses the
same name so it should continue to work.
Signed-off-by: Mika Westerberg <[email protected]>
Acked-by: Grant Likely <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
|
|
None of these files are actually using any __init type directives
and hence don't need to include <linux/init.h>. Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.
Cc: Arnd Bergmann <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Paul Gortmaker <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
The commit d6ae0d578d24303941c1424b049d2cae28277666 introduced devicetree
binding documentation for this driver, but the driver itself does not yet
support the documented compatible entry. Fix this by adding the documented
entry to the driver.
Signed-off-by: Jan Luebbe <[email protected]>
Signed-off-by: Markus Pargmann <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Use devm_kzalloc to make cleanup paths simpler
Signed-off-by: Nikolay Balandin <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Reviewed-by: Jingoo Han <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Use the wrapper functions for getting and setting the driver data using
spi_device instead of using dev_{get|set}_drvdata with &spi->dev, so we
can directly pass a struct spi_device.
Signed-off-by: Jingoo Han <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.
Signed-off-by: Bill Pemberton <[email protected]>
Cc: "Michał Mirosław" <[email protected]>
Cc: Wolfram Sang <[email protected]>
Cc: Eric Piel <[email protected]>
Cc: Jiri Slaby <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.
Signed-off-by: Bill Pemberton <[email protected]>
Cc: "Michał Mirosław" <[email protected]>
Cc: Wolfram Sang <[email protected]>
Cc: Eric Piel <[email protected]>
Cc: Jiri Slaby <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Commit 002176db (misc: at25: Parse dt settings) added device tree
bindings the differ significantly in style from the I2C EEPROM
bindings and don't seem well vetted. Here I deprecate (but still
support) the "at25,*" properties, and add what I hope is a better
alternative. These new bindings also happen to be deployed in the
field and were previously submitted for consideration here:
https://lists.ozlabs.org/pipermail/devicetree-discuss/2012-May/015556.html
The advantages of the new bindings are that they are similar to the
I2C EEPROMs and they don't conflate read-only and the address width
modes in a binary encoded blob.
Signed-off-by: David Daney <[email protected]>
Cc: Alexandre Pereira da Silva <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Michael Hennerich <[email protected]>
Cc: Axel Lin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
This adds dt support to the at25 eeprom driver.
Signed-off-by: Alexandre Pereira da Silva <[email protected]>
Tested-by: Roland Stigge <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Updated the generic SPI EEPROM driver AT25 for support of an additional address
bit in the instruction byte. Certain EEPROMS have a size that is larger than the
number of address bytes would allow (e.g. like M95040 from ST that has 512 Byte
size but uses only one address byte (A0 to A7) for addressing.) For the extra
address bit (A8, A16 or A24) bit 3 of the instruction byte is used. This
instruction bit is normally defined as don't care for other AT25 like chips.
Reviewed-by: Wolfram Sang <[email protected]>
Signed-off-by: Ivo Sieben <[email protected]>
Acked-by: Chris Wright <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
This patch converts the drivers in drivers/misc/* to use the
module_spi_driver() macro which makes the code smaller and a bit
simpler.
Signed-off-by: Axel Lin <[email protected]>
Cc: Michael Hennerich <[email protected]>
Cc: Anatolij Gustschin <[email protected]>
Cc: Daniel Mack <[email protected]>
Acked-by: Michael Hennerich <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
This allows bin_attr->read,write,mmap callbacks to check file specific data
(such as inode owner) as part of any privilege validation.
Signed-off-by: Chris Wright <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
Commit 6992f5334995af474c2b58d010d08bc597f0f2fe ("sysfs: Use one lockdep
class per sysfs attribute.") introduced this requirement. First, at25
was fixed manually. Then, other occurences were found with coccinelle
and the following semantic patch. Results were reviewed and fixed up:
@ init @
identifier struct_name, bin;
@@
struct struct_name {
...
struct bin_attribute bin;
...
};
@ main extends init @
expression E;
statement S;
identifier name, err;
@@
(
struct struct_name *name;
|
- struct struct_name *name = NULL;
+ struct struct_name *name;
)
...
(
sysfs_bin_attr_init(&name->bin);
|
+ sysfs_bin_attr_init(&name->bin);
if (sysfs_create_bin_file(E, &name->bin))
S
|
+ sysfs_bin_attr_init(&name->bin);
err = sysfs_create_bin_file(E, &name->bin);
)
Signed-off-by: Wolfram Sang <[email protected]>
Cc: Eric W. Biederman <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
This makes it consistent with other buses (platform, i2c, vio, ...). I'm
not sure why we use the prefixes, but there must be a reason.
This was easy enough to do it, and I did it.
Signed-off-by: Anton Vorontsov <[email protected]>
Cc: David Brownell <[email protected]>
Cc: David Woodhouse <[email protected]>
Cc: Grant Likely <[email protected]>
Cc: Jean Delvare <[email protected]>
Cc: Ben Dooks <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Samuel Ortiz <[email protected]>
Cc: "John W. Linville" <[email protected]>
Acked-by: Mike Frysinger <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Under certain circumstances msleep(1) within the loop, which waits for the
EEPROM to be finished, might take longer than the timeout. On the next
loop the status register might now return to be ready and therefore the
loop finishes. The following check now tests if a timeout occurred and if
so returns an error although the device reported it was ready.
This fix replaces testing the occurrence of the timeout by testing the
"not ready" bit in the status register.
Signed-off-by: Sebastian Heutling <[email protected]>
Signed-off-by: David Brownell <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
| drivers/misc/eeprom/at25.c:358: warning: assignment from incompatible pointer type
Signed-off-by: Geert Uytterhoeven <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: David Brownell <[email protected]>
Cc: Jean Delvare <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
- Define new setup() hook to export the accessor
- Implement accessor methods
Moves some error checking out of the sysfs interface code into the layer
below it, which is now shared by both sysfs and memory access code.
Signed-off-by: David Brownell <[email protected]>
Signed-off-by: Kevin Hilman <[email protected]>
Cc: Jean Delvare <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
|
|
Signed-off-by: Wolfram Sang <[email protected]>
Signed-off-by: Jean Delvare <[email protected]>
|