aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc/eeprom
AgeCommit message (Collapse)AuthorFilesLines
2010-12-24misc/at24: parse device tree dataWolfram Sang1-6/+27
Information about the pagesize and read-only-status may also come from the devicetree. Parse this data, too, and act accordingly. While we are here, change the initialization printout a bit. write_max is useful to know to detect performance bottlenecks, the rest is superfluous. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2010-06-03i2c: Remove all i2c_set_clientdata(client, NULL) in driversWolfram Sang1-1/+0
I2C drivers can use the clientdata-pointer to point to private data. As I2C devices are not really unregistered, but merely detached from their driver, it used to be the drivers obligation to clear this pointer during remove() or a failed probe(). As a couple of drivers forgot to do this, it was agreed that it was cleaner if the i2c-core does this clearance when appropriate, as there is no guarantee for the lifetime of the clientdata-pointer after remove() anyhow. This feature was added to the core with commit e4a7b9b04de15f6b63da5ccdd373ffa3057a3681 to fix the faulty drivers. As there is no need anymore to clear the clientdata-pointer, remove all current occurrences in the drivers to simplify the code and prevent confusion. Signed-off-by: Wolfram Sang <[email protected]> Acked-by: Mark Brown <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Acked-by: Richard Purdie <[email protected]> Acked-by: Dmitry Torokhov <[email protected]> Signed-off-by: Jean Delvare <[email protected]>
2010-05-21Merge branch 'i2c-for-linus' of ↵Linus Torvalds1-11/+48
git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging * 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging: i2c-nforce2: Remove redundant error messages on ACPI conflict i2c: Use <linux/io.h> instead of <asm/io.h> i2c-algo-pca: Fix coding style issues i2c-dev: Fix all coding style issues i2c-core: Fix some coding style issues i2c-gpio: Move initialization code to subsys_initcall() i2c-parport: Make template structure const i2c-dev: Remove unnecessary casts at24: Fall back to byte or word reads if needed i2c-stub: Expose the default functionality flags i2c/scx200_acb: Make PCI device ids constant i2c-i801: Fix all checkpatch warnings i2c-i801: All newer devices have all the optional features i2c-i801: Let the user disable selected driver features
2010-05-21at24: Fall back to byte or word reads if neededJean Delvare1-11/+48
Increase the portability of the at24 driver by letting it read from EEPROM chips connected to cheap SMBus controllers that support neither raw I2C messages nor even I2C block reads. All SMBus controllers should support either word reads or byte reads, so read support becomes universal, much like with the legacy "eeprom" driver. Obviously, this only works with EEPROM chips up to AT24C16, that use 8-bit offset addressing. 16-bit offset addressing is almost impossible to support on SMBus controllers. I did not add universal support for writes, as I had no immediate need for this, but it could be added later if needed (with the same performance issue as byte and word reads have, of course.) Signed-off-by: Jean Delvare <[email protected]> Reviewed-by: Wolfram Sang <[email protected]> Cc: Konstantin Lazarev <[email protected]>
2010-05-21sysfs: add struct file* to bin_attr callbacksChris Wright4-6/+11
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]>
2010-05-14EEPROM: max6875: Header file cleanupArce, Abraham1-26/+26
Change max6875.c header file to format as in conventions Signed-off-by: Abraham Arce <[email protected]> Acked-by: Wolfram Sang <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2010-05-14EEPROM: 93cx6: Header file cleanupArce, Abraham1-23/+16
Change eeprom_93cx6.c header file to format as in conventions Signed-off-by: Abraham Arce <[email protected]> Acked-by: Wolfram Sang <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2010-05-14EEPROM: Header file cleanupArce, Abraham1-20/+16
Change eeprom.c header file to format as in conventions Signed-off-by: Abraham Arce <[email protected]> Acked-by: Jean Delvare <[email protected]> Acked-by: Wolfram Sang <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2010-03-14init dynamic bin_attribute structuresWolfram Sang1-0/+1
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]>
2010-03-13at24: Init dynamic bin_attribute structuresWolfram Sang1-0/+1
Commit 6992f5334995af474c2b58d010d08bc597f0f2fe introduced this requirement. Reported-by: Albrecht Dress <[email protected]> Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Eric W. Biederman <[email protected]> Signed-off-by: Jean Delvare <[email protected]>
2009-12-14i2c: Drop I2C_CLIENT_INSMOD_1Jean Delvare1-3/+0
This macro simply declares an enum, so drivers might as well declare it themselves. Signed-off-by: Jean Delvare <[email protected]> Tested-by: Wolfram Sang <[email protected]>
2009-12-14i2c: Get rid of struct i2c_client_address_dataJean Delvare1-1/+1
Struct i2c_client_address_data only contains one field at this point, which makes its usefulness questionable. Get rid of it and pass simple address lists around instead. Signed-off-by: Jean Delvare <[email protected]> Tested-by: Wolfram Sang <[email protected]>
2009-12-14i2c: Drop the kind parameter from detect callbacksJean Delvare1-2/+1
The "kind" parameter always has value -1, and nobody is using it any longer, so we can remove it. Signed-off-by: Jean Delvare <[email protected]> Tested-by: Wolfram Sang <[email protected]>
2009-11-26at24: Use timeout also for readWolfram Sang1-31/+45
Writes may take some time on EEPROMs, so for consecutive writes, we already have a loop waiting for the EEPROM to become ready. Use such a loop for reads, too, in case somebody wants to immediately read after a write. Detailed bug report and test case can be found here: http://article.gmane.org/gmane.linux.drivers.i2c/4660 Reported-by: Aleksandar Ivanov <[email protected]> Signed-off-by: Wolfram Sang <[email protected]> Tested-by: Aleksandar Ivanov <[email protected]> Cc: David Brownell <[email protected]> Signed-off-by: Jean Delvare <[email protected]>
2009-10-04max6875: Discard obsolete detect methodJean Delvare1-24/+5
There is no point in implementing a detect callback for the MAX6875, as this device can't be detected. It was there solely to handle "force" module parameters to instantiate devices, but now we have a better sysfs interface that can do the same. So we can get rid of the ugly module parameters and the detect callback. This basically divides the binary module size by 2. Signed-off-by: Jean Delvare <[email protected]> Acked-by: Wolfram Sang <[email protected]> Acked-by: Ben Gardner <[email protected]>
2009-09-23spi: prefix modalias with "spi:"Anton Vorontsov1-1/+1
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]>
2009-07-29eeprom/at25: bugfix "not ready" timeout after writeSebastian Heutling1-2/+2
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]>
2009-06-15i2c/chips: Move max6875 to drivers/misc/eepromWolfram Sang3-0/+261
This driver only reads the user EEPROM of that chip, so we can move it to the eeprom-directory in order to further clean up (and later remove) drivers/i2c/chips. The Kconfig text was updated to match the current functionality, dropping the meanwhile obsoleted parts. Defconfigs have been adapted. Signed-off-by: Wolfram Sang <[email protected]> Acked-by: Ben Gardner <[email protected]> Signed-off-by: Jean Delvare <[email protected]>
2009-04-13at25: make input buffers of at25_*write() constGeert Uytterhoeven1-2/+3
| 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]>
2009-04-13at24: make input buffers of at24_*write() constGeert Uytterhoeven1-4/+4
| drivers/misc/eeprom/at24.c:508: 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]>
2009-04-02memory_accessor: implement the new memory_accessor interfaces for SPI EEPROMsDavid Brownell1-14/+44
- 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]>
2009-04-02memory_accessor: implement the new memory_accessor interface for I2C EEPROMKevin Hilman1-13/+54
In the case of at24, the platform code registers a 'setup' callback with the at24_platform_data. When the at24 driver detects an EEPROM, it fills out the read and write functions of the memory_accessor and calls the setup callback passing the memory_accessor struct. The platform code can then use the read/write functions in the memory_accessor struct for reading and writing the EEPROM. Signed-off-by: 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]>
2009-03-28eeprom/at24: Remove EXPERIMENTALWolfram Sang1-1/+1
This driver has been widely used since inclusion and no problems have been reported. Signed-off-by: Wolfram Sang <[email protected]> Cc: David Brownell <[email protected]> Signed-off-by: Jean Delvare <[email protected]>
2009-01-26eeprom: More consistent symbol namesJean Delvare2-7/+7
Now that all EEPROM drivers live in the same place, let's harmonize their symbol names. Also fix eeprom's dependencies, it definitely needs sysfs, and is no longer experimental after many years in the kernel tree. Signed-off-by: Jean Delvare <[email protected]> Acked-by: Wolfram Sang <[email protected]> Cc: David Brownell <[email protected]>
2009-01-26eeprom: Move 93cx6 eeprom driver to /drivers/misc/eepromWolfram Sang3-0/+249
Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Jean Delvare <[email protected]>
2009-01-26spi: Move at25 (for SPI eeproms) to /drivers/misc/eepromWolfram Sang3-0/+401
Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Jean Delvare <[email protected]>
2009-01-26i2c: Move old eeprom driver to /drivers/misc/eepromWolfram Sang3-0/+269
Update Kconfig text to specify this driver as I2C. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Jean Delvare <[email protected]>
2009-01-26i2c: Move at24 to drivers/misc/eepromWolfram Sang3-0/+612
As drivers/i2c/chips is going to go away, move the driver to drivers/misc/eeprom. Other eeprom drivers may be moved here later, too. Update Kconfig text to specify this driver as I2C. Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Jean Delvare <[email protected]>