summaryrefslogtreecommitdiffstats
path: root/drivers/misc/eeprom/at25.c
Commit message (Collapse)AuthorAgeFilesLines
* misc/at25, dt: support probing at25 SPI EEPROM from DTJan Luebbe2013-10-161-0/+7
| | | | | | | | | | | 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 <jlu@pengutronix.de> Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* drivers/misc: at25: convert to use devm_kzallocNikolay Balandin2013-05-301-17/+8
| | | | | | | | | Use devm_kzalloc to make cleanup paths simpler Signed-off-by: Nikolay Balandin <nbalandin@dev.rtsoft.ru> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: at25: use spi_get_drvdata() and spi_set_drvdata()Jingoo Han2013-04-051-2/+2
| | | | | | | | | 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 <jg1.han@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: remove use of __devexitBill Pemberton2012-11-211-1/+1
| | | | | | | | | | | | CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: Wolfram Sang <w.sang@pengutronix.de> Cc: Eric Piel <eric.piel@tremplin-utc.net> Cc: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* drivers/misc: remove use of __devexit_pBill Pemberton2012-11-211-1/+1
| | | | | | | | | | | | CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl> Cc: Wolfram Sang <w.sang@pengutronix.de> Cc: Eric Piel <eric.piel@tremplin-utc.net> Cc: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc/at25, dt: Improve at25 SPI eeprom device tree bindings.David Daney2012-09-051-25/+58
| | | | | | | | | | | | | | | | | | | | | | 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 <david.daney@cavium.com> Cc: Alexandre Pereira da Silva <aletes.xgr@gmail.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Michael Hennerich <michael.hennerich@analog.com> Cc: Axel Lin <axel.lin@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* misc: at25: Parse dt settingsAlexandre Pereira da Silva2012-06-141-16/+45
| | | | | | | | This adds dt support to the at25 eeprom driver. Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com> Tested-by: Roland Stigge <stigge@antcom.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Support M95040 SPI EEPROMIvo Sieben2012-04-181-3/+16
| | | | | | | | | | | | | | 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 <w.sang@pengutronix.de> Signed-off-by: Ivo Sieben <meltedpianoman@gmail.com> Acked-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* MISC: convert drivers/misc/* to use module_spi_driver()Axel Lin2012-01-241-11/+1
| | | | | | | | | | | | | 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 <axel.lin@gmail.com> Cc: Michael Hennerich <hennerich@blackfin.uclinux.org> Cc: Anatolij Gustschin <agust@denx.de> Cc: Daniel Mack <zonque@gmail.com> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysfs: add struct file* to bin_attr callbacksChris Wright2010-05-211-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>
* init dynamic bin_attribute structuresWolfram Sang2010-03-141-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 <w.sang@pengutronix.de> Cc: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* spi: prefix modalias with "spi:"Anton Vorontsov2009-09-231-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 <avorontsov@ru.mvista.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: Jean Delvare <khali@linux-fr.org> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Dmitry Torokhov <dtor@mail.ru> Cc: Samuel Ortiz <sameo@openedhand.com> Cc: "John W. Linville" <linville@tuxdriver.com> Acked-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* eeprom/at25: bugfix "not ready" timeout after writeSebastian Heutling2009-07-291-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 <heutling@who-ing.de> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* at25: make input buffers of at25_*write() constGeert Uytterhoeven2009-04-131-2/+3
| | | | | | | | | | | | drivers/misc/eeprom/at25.c:358: 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>
* memory_accessor: implement the new memory_accessor interfaces for SPI EEPROMsDavid Brownell2009-04-021-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 <dbrownell@users.sourceforge.net> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> 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>
* spi: Move at25 (for SPI eeproms) to /drivers/misc/eepromWolfram Sang2009-01-261-0/+389
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Jean Delvare <khali@linux-fr.org>
OpenPOWER on IntegriCloud