summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices/mtd_dataflash.c
Commit message (Collapse)AuthorAgeFilesLines
* mtd: mtd_dataflash: Don't print bogus command values for READsAndrey Smirnov2018-07-021-3/+3
| | | | | | | | | | Call to dev_dbg in dataflash_read() is located to early, before command[] is initialize to correct values, so it end up printing values from previous invocation. Move it such that it prints current call's values. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: dataflash: Add flash_info for AT45DB641EAndrey Smirnov2017-06-201-0/+3
| | | | | | | | This is a backport of kernel commit 67e4145ebf2c161d7404770461b8404f00a6d3bf Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: dataflash: Make use of "extened device information"Andrey Smirnov2017-06-201-31/+58
| | | | | | | | | | | | | In anticipation of supporting chips that need it, extend the size of struct flash_info's 'jedec_id' field to make room 2 byte of extended device information as well as add code to fetch this data during jedec_probe(). This is a backport of kernel commit 1da8869a428317a6d3cd8d47184cf87feb34a98b Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: dataflash: Get rid of loop counter in jedec_probe()Andrey Smirnov2017-06-201-4/+4
| | | | | | | | | | | "For" loop in jedec_probe can be simplified to not need counter 'i'. Convert the code and get rid of the variable. This is a backport of kernel commit a296a1bc3eb54382d2a61d47529e71c9d3bc615e Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: dataflash: Replace pr_debug, printk with dev_* functionsAndrey Smirnov2017-06-201-42/+33
| | | | | | | | | | | | | | | | | | | | | Lion's share of calls to pr_debug in this driver follow the pattern of pr_debug("%s <message>", dev_name(<dev>), <arguments>), which should be semantically identical to dev_dbg(<dev>, "<message>", <arguments>), so replace such occurencies to simplify the code. Convert the small minority of pr_debug that do not follow pattern from above to use dev_dbg as well, for the sake of consistency. Convert similar patter of printk(KERN_ERR, "%s: ...", dev_name(...), ...) to use dev_err instead. No functional change intended. This is a backport of kernel commit 02f62864f6cebbbbff6bb611fddf78c1d05a9747 Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: dataflash: Improve coding style in jedec_probe()Andrey Smirnov2017-06-201-14/+17
| | | | | | | | | | | | | | | | | | | | | Change the following: - Replace indentation between type and name of local variable from tabs to spaces - Replace magic number 0x1F with CFI_MFR_ATMEL macro - Replace variable 'tmp' with 'ret' and 'i' where appropriate - Reformat multi-line comments and add newlines where appropriate No functional change intended. This is a backport of kernel commit 41c9c6621afa22c86fe74cf07536fd21c7719ca6 Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: dataflash: Replace C99 types with their kernel counterpartsAndrey Smirnov2017-06-201-20/+20
| | | | | | | | | | No functional change intended. This is a backport of kernel commit c41e43c6faf68a9b70afdb0dfee45d196c27031b Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: Update internal API to support 64-bit device sizeDmitry Lavnikevich2014-03-121-1/+1
| | | | | | | | | | | | | | | | | | | MTD internal API presently uses 32-bit values to represent device size. This patch updates them to 64-bits but leaves the external API unchanged. In general, changing from 32-bit to 64-bit values cause little or no changes to the majority of the code with the following exceptions: - printk message formats; - division and modulus of 64-bit values (mtd_div_by_wb, mtd_div_by_eb may be used in some of such cases). Was tested on phyFLEX i.MX6. Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com> Signed-off-by: Grigory Milev <g.milev@sam-solutions.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Add missing includesSascha Hauer2013-11-081-0/+1
| | | | | | | | A lot of files rely on include/driver.h including include/of.h (and this including include/errno.h. include the files explicitly so we can eventually get rid of including of.h from driver.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: Pass device_id to add_mtd_deviceSascha Hauer2013-10-291-1/+1
| | | | | | | | | Right now we do not support persistent names for mtd devices. The base name can be passed to add_mtd_device, but this is always appended with a dynamic number. With this patch add_mtd_device takes a device_id argument which can be used to create a mtd device with an exact name. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: dataflash: Add devicetree probing supportSascha Hauer2013-05-211-0/+11
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Introduce device_spi_driver() macro and use it for SPI driversAlexander Shiyan2013-03-141-7/+1
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* SPI: Rename spi_register_driver() for using with register_driver_macro()Alexander Shiyan2013-03-141-1/+1
| | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: dataflash: fix spi_transfer initJean-Christophe PLAGNIOL-VILLARD2012-11-021-0/+6
| | | | | | | | on some system as the spi_transfer is not set to 0 if the rx_buf or tx_buf are not used they are not set to NULL Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: add parent supportJean-Christophe PLAGNIOL-VILLARD2012-10-171-0/+2
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: add dataflash supportJean-Christophe PLAGNIOL-VILLARD2012-10-151-0/+880
from linux 3.6 Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>