aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/eeprom/at24.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-05-21Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/stagingLinus Torvalds1-11/+48
* '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 <khali@linux-fr.org> Reviewed-by: Wolfram Sang <w.sang@pengutronix.de> Cc: Konstantin Lazarev <klazarev@sbcglobal.net>
2010-05-21sysfs: add struct file* to bin_attr callbacksChris Wright1-2/+4
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 <chrisw@sous-sol.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-13at24: Init dynamic bin_attribute structuresWolfram Sang1-0/+1
Commit 6992f5334995af474c2b58d010d08bc597f0f2fe introduced this requirement. Reported-by: Albrecht Dress <albrecht.dress@arcor.de> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
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 <ivanov.aleks@gmail.com> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Tested-by: Aleksandar Ivanov <ivanov.aleks@gmail.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
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 <geert@linux-m68k.org> Cc: Kevin Hilman <khilman@deeprootsystems.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Cc: Jean Delvare <khali@linux-fr.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
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 <khilman@deeprootsystems.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Cc: Jean Delvare <khali@linux-fr.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-26i2c: Move at24 to drivers/misc/eepromWolfram Sang1-0/+582
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 <w.sang@pengutronix.de> Signed-off-by: Jean Delvare <khali@linux-fr.org>