Re: [linux-sunxi] [PATCH 1/3] sunxi: A20-OLinuXino-LIME2: Fix ldo3/ldo4 in DTS

2016-03-30 Thread Hans de Goede
Hi, On 30-03-16 06:57, Michael Haas wrote: On 03/28/2016 03:01 PM, Hans de Goede wrote: but unless there's a real need for me to verify this, I'll simply revert the u-boot patch and enjoy working GPIO. Given the entire discussion in this thread, I agree that fixing this in u-boot is best. But

Re: [linux-sunxi] [PATCH 1/3] sunxi: A20-OLinuXino-LIME2: Fix ldo3/ldo4 in DTS

2016-03-30 Thread Michael Haas
Am 30. März 2016 09:55:54 MESZ, schrieb Hans de Goede : >Hi, > >On 30-03-16 06:57, Michael Haas wrote: >> On 03/28/2016 03:01 PM, Hans de Goede wrote: but unless there's a real need for me to verify this, I'll simply revert the u-boot patch and enjoy working GPIO. >>> >>> Given the e

Re: [linux-sunxi] [PATCH 1/3] sunxi: A20-OLinuXino-LIME2: Fix ldo3/ldo4 in DTS

2016-03-30 Thread Hans de Goede
HI, On 30-03-16 10:58, Michael Haas wrote: Am 30. März 2016 09:55:54 MESZ, schrieb Hans de Goede : Hi, On 30-03-16 06:57, Michael Haas wrote: On 03/28/2016 03:01 PM, Hans de Goede wrote: but unless there's a real need for me to verify this, I'll simply revert the u-boot patch and enjoy worki

[linux-sunxi] [PATCH v2 2/7] mtd: nand: sunxi: make OOB retrieval optional

2016-03-30 Thread Boris Brezillon
sunxi_nfc_hw_ecc_read_chunk() always retrieves the ECC and protected free bytes, no matter if the user really asked for it or not. This can take a non negligible amount of time, especially on NAND chips exposing large OOB areas (> 1KB). Make it optional. Signed-off-by: Boris Brezillon --- driver

[linux-sunxi] [PATCH v2 0/7] mtd: nand: sunxi: add support for DMA operations

2016-03-30 Thread Boris Brezillon
Hello, This patch series aims at adding support for DMA assisted operations to the sunxi_nand driver. The first 3 patches are just reworks in the existing driver preparing things for DMA ->read/write_page() operations. Those ones are mainly re-arranging existing functions, and moving some code in

[linux-sunxi] [PATCH v2 1/7] mtd: nand: sunxi: move some ECC related operations to their own functions

2016-03-30 Thread Boris Brezillon
In order to support DMA operations in a clean way we need to extract some of the logic coded in sunxi_nfc_hw_ecc_read/write_page() into their own function. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/sunxi_nand.c | 163 -- 1 file changed, 108 inser

[linux-sunxi] [PATCH v2 6/7] mtd: nand: sunxi: add support for DMA assisted operations

2016-03-30 Thread Boris Brezillon
The sunxi NAND controller is able to pipeline ECC operations only when operated in DMA mode, which improves a lot NAND throughput while keeping CPU usage low. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/sunxi_nand.c | 324 +- 1 file changed, 320 in

[linux-sunxi] [PATCH v2 5/7] mtd: provide helper to prepare buffers for DMA operations

2016-03-30 Thread Boris Brezillon
Some NAND controller drivers are making use of DMA to transfer data from the controller to the buffer passed by the MTD user. Provide a generic mtd_map/unmap_buf() implementation to avoid open coded (and sometime erroneous) implementations. Signed-off-by: Boris Brezillon --- drivers/mtd/mtdcore.

[linux-sunxi] [PATCH v2 7/7] mtd: nand: sunxi: update DT bindings

2016-03-30 Thread Boris Brezillon
Document dmas and dma-names properties. Signed-off-by: Boris Brezillon Acked-by: Rob Herring --- Documentation/devicetree/bindings/mtd/sunxi-nand.txt | 4 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/mtd/sunxi-nand.txt b/Documentation/devicetree/bindings

[linux-sunxi] [PATCH v2 3/7] mtd: nand: sunxi: make cur_off parameter optional in extra oob helpers

2016-03-30 Thread Boris Brezillon
Allow for NULL cur_offs values when the caller does not know where the NAND page register pointer point to. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/sunxi_nand.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/

[linux-sunxi] [PATCH v2 4/7] scatterlist: add sg_alloc_table_from_buf() helper

2016-03-30 Thread Boris Brezillon
sg_alloc_table_from_buf() provides an easy solution to create an sg_table from a virtual address pointer. This function takes care of dealing with vmallocated buffers, buffer alignment, or DMA engine limitations (maximum DMA transfer size). Signed-off-by: Boris Brezillon --- include/linux/scatte

[linux-sunxi] [PATCH v5 15/50] mtd: docg3: use mtd_set_ecclayout() where appropriate

2016-03-30 Thread Boris Brezillon
Use the mtd_set_ecclayout() helper instead of directly assigning the mtd->ecclayout field. Signed-off-by: Boris Brezillon Acked-by: Robert Jarzmik --- drivers/mtd/devices/docg3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/device

[linux-sunxi] [PATCH v5 02/50] mtd: use mtd_ooblayout_xxx() helpers where appropriate

2016-03-30 Thread Boris Brezillon
The mtd_ooblayout_xxx() helper functions have been added to avoid direct accesses to the ecclayout field, and thus ease for future reworks. Use these helpers in all places where the oobfree[] and eccpos[] arrays where directly accessed. Signed-off-by: Boris Brezillon --- drivers/mtd/mtdchar.c |

[linux-sunxi] [PATCH v5 18/50] mtd: nand: implement the default mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Replace the default nand_ecclayout definitions for large and small page devices with the equivalent mtd_ooblayout_ops. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/nand_base.c | 148 --- include/linux/mtd/nand.h | 3 + 2 files changed, 99 inse

[linux-sunxi] [PATCH v5 06/50] mtd: nand: gpmi: use mtd_ooblayout_xxx() helpers where appropriate

2016-03-30 Thread Boris Brezillon
The mtd_ooblayout_xxx() helper functions have been added to avoid direct accesses to the ecclayout field, and thus ease for future reworks. Use these helpers in all places where the oobfree[] and eccpos[] arrays where directly accessed. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/gpmi-na

[linux-sunxi] [PATCH v5 13/50] mtd: nand: use mtd_set_ecclayout() where appropriate

2016-03-30 Thread Boris Brezillon
Use the mtd_set_ecclayout() helper instead of directly assigning the mtd->ecclayout field. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/nand_base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 36a58a0

[linux-sunxi] [PATCH v5 00/52] mtd: rework ECC layout definition

2016-03-30 Thread Boris Brezillon
Hello, Hopefully the last version of this patchset (but don't be sad, I'm not done bothering you with NAND related patches :-)). If possible, I'd like to have as much Tested/Reviewed/Acked-by tags as possible, particularly on the changes done in arch/arm and arch/mips (since the last set of commi

[linux-sunxi] [PATCH v5 25/50] mtd: nand: cafe: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/cafe_nand.c | 44 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/drivers/mtd/nand

[linux-sunxi] [PATCH v5 05/50] mtd: nand: fsl_ifc: use mtd_ooblayout_xxx() helpers where appropriate

2016-03-30 Thread Boris Brezillon
The mtd_ooblayout_xxx() helper functions have been added to avoid direct accesses to the ecclayout field, and thus ease for future reworks. Use these helpers in all places where the oobfree[] and eccpos[] arrays where directly accessed. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/fsl_ifc

[linux-sunxi] [PATCH v5 14/50] mtd: onenand: use mtd_set_ecclayout() where appropriate

2016-03-30 Thread Boris Brezillon
Use the mtd_set_ecclayout() helper instead of directly assigning the mtd->ecclayout field. Signed-off-by: Boris Brezillon --- drivers/mtd/onenand/onenand_base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_b

[linux-sunxi] [PATCH v5 16/50] mtd: create an mtd_ooblayout_ops struct to ease ECC layout definition

2016-03-30 Thread Boris Brezillon
ECC layout definitions are currently exposed using the nand_ecclayout struct which embeds oobfree and eccpos arrays with predefined size. This approach was acceptable when NAND chips were providing relatively small OOB regions, but MLC and TLC now provide OOB regions of several hundreds of bytes, w

[linux-sunxi] [PATCH v5 27/50] mtd: nand: denali: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/denali.c | 50 +-- 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/drivers/mtd/nand

[linux-sunxi] [PATCH v5 28/50] mtd: nand: diskonchip: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/diskonchip.c | 60 --- 1 file changed, 45 insertions(+), 15 deletions(-) diff --git a/drivers/mtd/nand

[linux-sunxi] [PATCH v5 09/50] mtd: nand: qcom: use mtd_ooblayout_xxx() helpers where appropriate

2016-03-30 Thread Boris Brezillon
The mtd_ooblayout_xxx() helper functions have been added to avoid direct accesses to ecclayout fields, and thus ease for future reworks. Use these helpers in all places where the oobfree[] and eccpos[] arrays where directly accessed. Signed-off-by: Boris Brezillon Tested-by: Archit Taneja --- d

[linux-sunxi] [PATCH v5 03/50] mtd: nand: core: use mtd_ooblayout_xxx() helpers where appropriate

2016-03-30 Thread Boris Brezillon
The mtd_ooblayout_xxx() helper functions have been added to avoid direct accesses to the ecclayout field, and thus ease for future reworks. Use these helpers in all places where the oobfree[] and eccpos[] arrays where directly accessed. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/nand_ba

[linux-sunxi] [PATCH v5 24/50] mtd: nand: brcm: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/brcmnand/brcmnand.c | 258 +-- 1 file changed, 157 insertions(+), 101 deletions(-) diff --git a/drivers/mtd/na

[linux-sunxi] [PATCH v5 26/50] mtd: nand: davinci: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/davinci_nand.c | 118 +++- 1 file changed, 44 insertions(+), 74 deletions(-) diff --git a/drivers/mtd/nand

[linux-sunxi] [PATCH v5 23/50] mtd: nand: bf5xx: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/bf5xx_nand.c | 51 --- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/drivers/mtd/nand

[linux-sunxi] [PATCH v5 21/50] mtd: nand: jz4740: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- arch/mips/include/asm/mach-jz4740/jz4740_nand.h | 2 +- arch/mips/jz4740/board-qi_lb60.c| 87 +++-- drivers/mtd/nand/jz4740

[linux-sunxi] [PATCH v5 20/50] mtd: nand: sharpsl: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- arch/arm/mach-pxa/spitz.c | 55 - drivers/mtd/nand/sharpsl.c | 2 +- include/linux/mtd/sharpsl.h | 2 +- 3 file

[linux-sunxi] [PATCH v5 22/50] mtd: nand: atmel: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/atmel_nand.c | 84 --- 1 file changed, 38 insertions(+), 46 deletions(-) diff --git a/drivers/mtd/nand

[linux-sunxi] [PATCH v5 08/50] mtd: nand: omap2: use mtd_ooblayout_xxx() helpers where appropriate

2016-03-30 Thread Boris Brezillon
The mtd_ooblayout_xxx() helper functions have been added to avoid direct accesses to the ecclayout field, and thus ease for future reworks. Use these helpers in all places where the oobfree[] and eccpos[] arrays where directly accessed. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/omap2.c

[linux-sunxi] [PATCH v5 01/50] mtd: add mtd_ooblayout_xxx() helper functions

2016-03-30 Thread Boris Brezillon
In order to make the ecclayout definition completely dynamic we need to rework the way the OOB layout are defined and iterated. Create a few mtd_ooblayout_xxx() helpers to ease OOB bytes manipulation and hide ecclayout internals to their users. Signed-off-by: Boris Brezillon --- drivers/mtd/mtd

[linux-sunxi] [PATCH v5 10/50] mtd: onenand: use mtd_ooblayout_xxx() helpers where appropriate

2016-03-30 Thread Boris Brezillon
The mtd_ooblayout_xxx() helper functions have been added to avoid direct accesses to the ecclayout field, and thus ease for future reworks. Use these helpers in all places where the oobfree[] and eccpos[] arrays where directly accessed. Signed-off-by: Boris Brezillon --- drivers/mtd/onenand/onen

[linux-sunxi] [PATCH v5 19/50] mtd: nand: bch: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Replace the nand_ecclayout definition by the equivalent mtd_ooblayout_ops definition. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/nand_bch.c | 33 +++-- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/drivers/mtd/nand/nand_bch.c b/drivers/mtd/n

[linux-sunxi] [PATCH v5 29/50] mtd: nand: docg4: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/docg4.c | 33 - 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/nand/docg4.c b/drive

[linux-sunxi] [PATCH v5 34/50] mtd: nand: gpmi: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 52 ++ 1 file changed, 40 insertions(+), 12 deletions(-) diff --git a/drivers/mtd/nand

[linux-sunxi] [PATCH v5 38/50] mtd: nand: mxc: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/mxc_nand.c | 212 ++-- 1 file changed, 105 insertions(+), 107 deletions(-) diff --git a/drivers/mtd/na

[linux-sunxi] [PATCH v5 04/50] mtd: nand: atmel: use mtd_ooblayout_xxx() helpers where appropriate

2016-03-30 Thread Boris Brezillon
The mtd_ooblayout_xxx() helper functions have been added to avoid direct accesses to the ecclayout field, and thus ease for future reworks. Use these helpers in all places where the oobfree[] and eccpos[] arrays where directly accessed. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/atmel_n

[linux-sunxi] [PATCH v5 12/50] mtd: use mtd_set_ecclayout() where appropriate

2016-03-30 Thread Boris Brezillon
Use the mtd_set_ecclayout() helper instead of directly assigning the mtd->ecclayout field. Signed-off-by: Boris Brezillon --- drivers/mtd/mtdconcat.c | 2 +- drivers/mtd/mtdpart.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdco

[linux-sunxi] [PATCH v5 07/50] mtd: nand: lpc32xx: use mtd_ooblayout_xxx() helpers where appropriate

2016-03-30 Thread Boris Brezillon
The mtd_ooblayout_xxx() helper functions have been added to avoid direct accesses to the ecclayout field, and thus ease for future reworks. Use these helpers in all places where the oobfree[] and eccpos[] arrays where directly accessed. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/lpc32xx

[linux-sunxi] [PATCH v5 11/50] mtd: add mtd_set_ecclayout() helper function

2016-03-30 Thread Boris Brezillon
Add an mtd_set_ecclayout() helper function to avoid direct accesses to the mtd->ecclayout field. This will ease future reworks of ECC layout definition. Signed-off-by: Boris Brezillon --- include/linux/mtd/mtd.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/linux/mtd/mtd.h b/

[linux-sunxi] [PATCH v5 40/50] mtd: nand: pxa3xx: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/pxa3xx_nand.c | 104 + 1 file changed, 64 insertions(+), 40 deletions(-) diff --git a/drivers/mtd/nand

[linux-sunxi] [PATCH v5 17/50] mtd: docg3: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Replace the nand_ecclayout definition by the equivalent mtd_ooblayout_ops definition. Signed-off-by: Boris Brezillon Acked-by: Robert Jarzmik --- drivers/mtd/devices/docg3.c | 46 ++--- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/drive

[linux-sunxi] [PATCH v5 37/50] mtd: nand: lpc32xx: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/lpc32xx_mlc.c | 50 -- drivers/mtd/nand/lpc32xx_slc.c | 41 +++--- 2 files

[linux-sunxi] [PATCH v5 31/50] mtd: nand: fsl_ifc: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/fsl_ifc_nand.c | 230 1 file changed, 66 insertions(+), 164 deletions(-) diff --git a/drivers/mtd/nan

[linux-sunxi] [PATCH v5 32/50] mtd: nand: fsmc: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/fsmc_nand.c | 298 --- 1 file changed, 82 insertions(+), 216 deletions(-) diff --git a/drivers/mtd/nan

[linux-sunxi] [PATCH v5 30/50] mtd: nand: fsl_elbc: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/fsl_elbc_nand.c | 83 +++- 1 file changed, 47 insertions(+), 36 deletions(-) diff --git a/drivers/mtd/nand

[linux-sunxi] [PATCH v5 33/50] mtd: nand: fsmc: get rid of the fsmc_nand_eccplace struct

2016-03-30 Thread Boris Brezillon
Now that mtd_ooblayout_ecc() returns the ECC byte position using the OOB free method, we can get rid of the fsmc_nand_eccplace struct. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/fsmc_nand.c | 60 +++- include/linux/mtd/fsmc.h | 18

[linux-sunxi] [PATCH v5 36/50] mtd: nand: jz4780: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon Tested-by: Harvey Hunt --- drivers/mtd/nand/jz4780_nand.c | 19 +-- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/drivers/mtd/nand

[linux-sunxi] [PATCH v5 41/50] mtd: nand: s3c2410: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/s3c2410.c | 32 +++- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/nand/s3c2410.c b/dr

[linux-sunxi] [PATCH v5 43/50] mtd: nand: sm_common: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/sm_common.c | 93 1 file changed, 77 insertions(+), 16 deletions(-) diff --git a/drivers/mtd/nand

[linux-sunxi] [PATCH v5 49/50] mtd: nand: kill the ecc->layout field

2016-03-30 Thread Boris Brezillon
Now that all NAND drivers have switch to mtd_ooblayout_ops, we can kill the ecc->layout field. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/nand_base.c | 7 --- drivers/mtd/nand/nand_bch.c | 9 - include/linux/mtd/nand.h | 2 -- 3 files changed, 18 deletions(-) diff --gi

[linux-sunxi] [PATCH v5 48/50] staging: mt29f_spinand: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Replace the nand_ecclayout definition by the equivalent mtd_ooblayout_ops definition. Signed-off-by: Boris Brezillon --- drivers/staging/mt29f_spinand/mt29f_spinand.c | 48 +-- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/drivers/staging/mt29f_spinand/m

[linux-sunxi] [PATCH v5 44/50] mtd: nand: sunxi: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/sunxi_nand.c | 114 +++--- 1 file changed, 52 insertions(+), 62 deletions(-) diff --git a/drivers/mtd/nand

[linux-sunxi] [PATCH v5 50/50] mtd: kill the nand_ecclayout struct

2016-03-30 Thread Boris Brezillon
Now that all MTD drivers have moved to the mtd_ooblayout_ops model we can safely remove the struct nand_ecclayout definition, and all the remaining places where it was still used. Signed-off-by: Boris Brezillon --- drivers/mtd/mtdchar.c | 12 ++--- drivers/mtd/mtdcore.c | 117

[linux-sunxi] [PATCH v5 46/50] mtd: nand: qcom: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon Tested-by: Archit Taneja --- drivers/mtd/nand/qcom_nandc.c | 79 +++ 1 file changed, 34 insertions(+), 45 deletions(-) dif

[linux-sunxi] [PATCH v5 45/50] mtd: nand: vf610: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/vf610_nfc.c | 34 -- 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/drivers/mtd/nand/vf610_nfc.

[linux-sunxi] [PATCH v5 39/50] mtd: nand: omap2: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/omap2.c | 194 +++ 1 file changed, 113 insertions(+), 81 deletions(-) diff --git a/drivers/mtd/nan

[linux-sunxi] [PATCH v5 47/50] mtd: onenand: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Modify the onenand drivers to switch to this approach. Signed-off-by: Boris Brezillon --- drivers/mtd/onenand/onenand_base.c | 162 ++--- include/linux/mtd/onenand

[linux-sunxi] [PATCH v5 35/50] mtd: nand: hisi504: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/hisi504_nand.c | 26 +++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/hisi504_nand.c

[linux-sunxi] [PATCH v5 42/50] mtd: nand: sh_flctl: switch to mtd_ooblayout_ops

2016-03-30 Thread Boris Brezillon
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: Boris Brezillon --- drivers/mtd/nand/sh_flctl.c | 87 ++--- 1 file changed, 67 insertions(+), 20 deletions(-) diff --git a/drivers/mtd/nand

[linux-sunxi] Re: [PATCH v5 00/52] mtd: rework ECC layout definition

2016-03-30 Thread Boris Brezillon
Despite what's said in the subject, this series only contains 50 patches, not 52. On Wed, 30 Mar 2016 18:14:15 +0200 Boris Brezillon wrote: > Hello, > > Hopefully the last version of this patchset (but don't be sad, I'm not > done bothering you with NAND related patches :-)). > > If possible,

[linux-sunxi] Re: [PATCH v2 4/7] scatterlist: add sg_alloc_table_from_buf() helper

2016-03-30 Thread Mark Brown
On Wed, Mar 30, 2016 at 05:39:51PM +0200, Boris Brezillon wrote: > sg_alloc_table_from_buf() provides an easy solution to create an sg_table > from a virtual address pointer. This function takes care of dealing with > vmallocated buffers, buffer alignment, or DMA engine limitations (maximum > DMA t

[linux-sunxi] Re: [PATCH v2 4/7] scatterlist: add sg_alloc_table_from_buf() helper

2016-03-30 Thread Boris Brezillon
On Wed, 30 Mar 2016 09:51:43 -0700 Mark Brown wrote: > On Wed, Mar 30, 2016 at 05:39:51PM +0200, Boris Brezillon wrote: > > sg_alloc_table_from_buf() provides an easy solution to create an sg_table > > from a virtual address pointer. This function takes care of dealing with > > vmallocated buffer

[linux-sunxi] Re: [PATCH v2 4/7] scatterlist: add sg_alloc_table_from_buf() helper

2016-03-30 Thread Mark Brown
On Wed, Mar 30, 2016 at 08:18:31PM +0200, Boris Brezillon wrote: > BTW, do you see other things that should be added in sg_constraints? It looked to do everything SPI does which is everything I know about. -- You received this message because you are subscribed to the Google Groups "linux-sunx

[linux-sunxi] [PATCH v5 03/46] backlight: lm3630a_bl: stop messing with the pwm->period field

2016-03-30 Thread Boris Brezillon
pwm->period field is not supposed to be changed by PWM users. The only ones authorized to change it are the PWM core and PWM drivers. Signed-off-by: Boris Brezillon --- drivers/video/backlight/lm3630a_bl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/video/backli

[linux-sunxi] [PATCH v5 00/46] pwm: add support for atomic update

2016-03-30 Thread Boris Brezillon
Hello, This series adds support for atomic PWM update, or IOW, the capability to update all the parameters of a PWM device (enabled/disabled, period, duty and polarity) in one go. It also adds support for initial PWM state retrieval (or hardware readout), which should allow smooth handover betwee

[linux-sunxi] [PATCH v5 02/46] backlight: pwm_bl: remove useless call to pwm_set_period()

2016-03-30 Thread Boris Brezillon
The PWM period will be set when calling pwm_config. Remove this useless call to pwm_set_period(), which might mess up with the internal PWM state. Signed-off-by: Boris Brezillon Acked-by: Lee Jones --- drivers/video/backlight/pwm_bl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) di

[linux-sunxi] [PATCH v5 12/46] fbdev: ssd1307fb: use pwm_get_args() where appropriate

2016-03-30 Thread Boris Brezillon
The PWM framework has clarified the concept of reference PWM config (the platform dependent config retrieved from the DT or the PWM lookup table) and real PWM state. Use pwm_get_args() when the PWM user wants to retrieve this reference config and not the current state. This is part of the rework

[linux-sunxi] [PATCH v5 20/46] pwm: add information about polarity, duty cycle and period to debugfs

2016-03-30 Thread Boris Brezillon
From: Heiko Stübner The pwm-states make it possible to also output the polarity, duty cycle and period information in the debugfs pwm summary-outout. This makes it easier to gather overview information about pwms without needing to walk through the sysfs attributes of every pwm. Signed-off-by: H

[linux-sunxi] [PATCH v5 01/46] pwm: rcar: make use of pwm_is_enabled()

2016-03-30 Thread Boris Brezillon
Commit 5c31252c4a86 ("pwm: Add the pwm_is_enabled() helper") introduced a new function to test whether a PWM device is enabled or not without manipulating PWM internal fields. Hiding this is necessary if we want to smoothly move to the atomic PWM config approach without impacting PWM drivers. Fix t

[linux-sunxi] [PATCH v5 17/46] pwm: add the PWM initial state retrieval infra

2016-03-30 Thread Boris Brezillon
Add a ->get_state() function to the pwm_ops struct to let PWM drivers initialize the PWM state attached to a PWM device. Signed-off-by: Boris Brezillon --- drivers/pwm/core.c | 3 +++ include/linux/pwm.h | 5 + 2 files changed, 8 insertions(+) diff --git a/drivers/pwm/core.c b/drivers/pwm/

[linux-sunxi] [PATCH v5 14/46] pwm: keep PWM state in sync with hardware state

2016-03-30 Thread Boris Brezillon
Before the introduction of pwm_args, the core and some drivers were resetting the PWM period and polarity states to the reference values (those provided through the DT, a PWM lookup table or hardcoded in the driver). Now that all PWM users are correctly using pwm_args to configure their PWM device

[linux-sunxi] [PATCH v5 04/46] pwm: get rid of pwm->lock

2016-03-30 Thread Boris Brezillon
PWM devices are not protected against concurrent accesses. The lock in pwm_device might let PWM users think it is, but it's actually only protecting the enabled state. Removing this lock should be fine as long as all PWM users are aware that accesses to the PWM device have to be serialized, which

[linux-sunxi] [PATCH v5 05/46] pwm: introduce the pwm_args concept

2016-03-30 Thread Boris Brezillon
Currently the PWM core mixes the current PWM state with the per-platform reference config (specified through the PWM lookup table, DT definition or directly hardcoded in PWM drivers). Create a pwm_args struct to store this reference config, so that PWM users can differentiate the current config fr

[linux-sunxi] [PATCH v5 11/46] regulator: pwm: use pwm_get_args() where appropriate

2016-03-30 Thread Boris Brezillon
The PWM framework has clarified the concept of reference PWM config (the platform dependent config retrieved from the DT or the PWM lookup table) and real PWM state. Use pwm_get_args() when the PWM user wants to retrieve this reference config and not the current state. This is part of the rework

[linux-sunxi] [PATCH v5 13/46] backlight: pwm_bl: use pwm_get_args() where appropriate

2016-03-30 Thread Boris Brezillon
The PWM framework has clarified the concept of reference PWM config (the platform dependent config retrieved from the DT or the PWM lookup table) and real PWM state. Use pwm_get_args() when the PWM user wants to retrieve this reference config and not the current state. This is part of the rework

[linux-sunxi] [PATCH v5 19/46] pwm: switch to the atomic API

2016-03-30 Thread Boris Brezillon
Replace legacy pwm_get/set_xxx() and pwm_config/enable/disable() calls by pwm_get/apply_state(). Signed-off-by: Boris Brezillon --- drivers/pwm/core.c | 5 - drivers/pwm/sysfs.c | 61 +++-- 2 files changed, 40 insertions(+), 26 deletions(-)

[linux-sunxi] [PATCH v5 22/46] pwm: rockchip: avoid glitches on already running PWMs

2016-03-30 Thread Boris Brezillon
The current logic will disable the PWM clk even if the PWM was left enabled by the bootloader (because it's controlling a critical device like a regulator for example). Keep the PWM clk enabled if the PWM is enabled to avoid any glitches. Signed-off-by: Boris Brezillon --- drivers/pwm/pwm-rockch

[linux-sunxi] [PATCH v5 08/46] hwmon: pwm-fan: use pwm_get_args() where appropriate

2016-03-30 Thread Boris Brezillon
The PWM framework has clarified the concept of reference PWM config (the platform dependent config retrieved from the DT or the PWM lookup table) and real PWM state. Use pwm_get_args() when the PWM user wants to retrieve this reference config and not the current state. This is part of the rework

[linux-sunxi] [PATCH v5 16/46] pwm: move the enabled/disabled info into pwm_state

2016-03-30 Thread Boris Brezillon
Prepare the transition to PWM atomic update by moving the enabled/disabled state into the pwm_state struct. This way we can easily update the whole PWM state by copying the new state in the ->state field. Signed-off-by: Boris Brezillon --- drivers/pwm/core.c | 13 + include/linux/pw

[linux-sunxi] [PATCH v5 06/46] pwm: use pwm_get/set_xxx() helpers where appropriate

2016-03-30 Thread Boris Brezillon
Use pwm_get/set_xxx() helpers instead of directly accessing the pwm->xxx field. Doing that will ease adaptation of the PWM framework to support atomic update. Signed-off-by: Boris Brezillon --- Patch generated with the following coccinelle script: --->8--- virtual patch @@ struct pwm_device *p;

[linux-sunxi] [PATCH v5 10/46] leds: pwm: use pwm_get_args() where appropriate

2016-03-30 Thread Boris Brezillon
The PWM framework has clarified the concept of reference PWM config (the platform dependent config retrieved from the DT or the PWM lookup table) and real PWM state. Use pwm_get_args() when the PWM user wants to retrieve this reference config and not the current state. This is part of the rework

[linux-sunxi] [PATCH v5 18/46] pwm: add the core infrastructure to allow atomic update

2016-03-30 Thread Boris Brezillon
Add an ->apply() method to the pwm_ops struct to allow PWM drivers to implement atomic update. This method will be preferred over the ->enable(), ->disable() and ->config() methods if available. Add the pwm_apply_state() function to the PWM user API. Note that the pwm_apply_state() does not guara

[linux-sunxi] [PATCH v5 07/46] clk: pwm: use pwm_get_args() where appropriate

2016-03-30 Thread Boris Brezillon
The PWM framework has clarified the concept of reference PWM config (the platform dependent config retrieved from the DT or the PWM lookup table) and real PWM state. Use pwm_get_args() when the PWM user wants to retrieve this reference config and not the current state. This is part of the rework

[linux-sunxi] [PATCH v5 21/46] pwm: rockchip: add initial state retrieval

2016-03-30 Thread Boris Brezillon
Implement the ->get_state() function to expose initial state. Signed-off-by: Boris Brezillon --- drivers/pwm/pwm-rockchip.c | 69 ++ 1 file changed, 69 insertions(+) diff --git a/drivers/pwm/pwm-rockchip.c b/drivers/pwm/pwm-rockchip.c index 7d9cc90..6

[linux-sunxi] [PATCH v5 15/46] pwm: introduce the pwm_state concept

2016-03-30 Thread Boris Brezillon
The PWM state, represented by its period, duty_cycle and polarity, is currently directly stored in the PWM device. Declare a pwm_state structure embedding those field so that we can later use this struct to atomically update all the PWM parameters at once. All pwm_get_xxx() helpers are now impleme

[linux-sunxi] [PATCH v5 30/46] regulator: pwm: retrieve correct voltage

2016-03-30 Thread Boris Brezillon
The continuous PWM voltage regulator is caching the voltage value in the ->volt_uV field. While most of the time this value should reflect the real voltage, sometime it can be sightly different if the PWM device rounded the set_duty_cycle request. Moreover, this value is not valid until someone has

[linux-sunxi] [PATCH v5 09/46] misc: max77693-haptic: use pwm_get_args() where appropriate

2016-03-30 Thread Boris Brezillon
The PWM framework has clarified the concept of reference PWM config (the platform dependent config retrieved from the DT or the PWM lookup table) and real PWM state. Use pwm_get_args() when the PWM user wants to retrieve this reference config and not the current state. This is part of the rework

[linux-sunxi] [PATCH v5 29/46] regulator: pwm: properly initialize the ->state field

2016-03-30 Thread Boris Brezillon
The ->state field is currently initialized to 0, thus referencing the voltage selector at index 0, which might not reflect the current voltage value. If possible, retrieve the current voltage selector from the PWM state, else return -EINVAL. Signed-off-by: Boris Brezillon Tested-by: Heiko Stuebne

[linux-sunxi] [PATCH v5 26/46] pwm: sun4i: implement hardware readout

2016-03-30 Thread Boris Brezillon
Implement ->get_state() instead of only initializing the polarity in the probe function. This implementation also takes care of keeping the PWM clk enabled if at least one of the PWM exported by the PWM chip is already enabled, which should prevent glitches. Signed-off-by: Boris Brezillon --- d

[linux-sunxi] [PATCH v5 34/46] clk: pwm: switch to the atomic API

2016-03-30 Thread Boris Brezillon
pwm_config/enable/disable() have been deprecated and should be replaced by pwm_apply_state(). Signed-off-by: Boris Brezillon --- drivers/clk/clk-pwm.c | 26 +++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/clk/clk-pwm.c b/drivers/clk/clk-pwm.c ind

[linux-sunxi] [PATCH v5 32/46] pwm: deprecate pwm_config(), pwm_enable() and pwm_disable()

2016-03-30 Thread Boris Brezillon
Prefix those function as deprecated to encourage all existing users to switch to pwm_apply_state(). Signed-off-by: Boris Brezillon --- include/linux/pwm.h | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/include/linux/pwm.h b/include/linux/pwm.h inde

[linux-sunxi] [PATCH v5 33/46] pwm: replace pwm_disable() by pwm_apply_state()

2016-03-30 Thread Boris Brezillon
Some PWM drivers are calling the deprecated pwm_disable() function in their pwm->free() or pdev->remove() function. Replace those calls by the pwm_apply_state(). Signed-off-by: Boris Brezillon --- drivers/pwm/pwm-lpc18xx-sct.c | 7 +-- drivers/pwm/pwm-lpc32xx.c | 9 +++-- drivers/pwm

[linux-sunxi] [PATCH v5 27/46] regulator: pwm: adjust PWM config at probe time

2016-03-30 Thread Boris Brezillon
The PWM attached to a PWM regulator device might have been previously configured by the bootloader. Make sure the bootloader and linux config are in sync, and adjust the PWM config if that's not the case. Signed-off-by: Boris Brezillon --- drivers/regulator/pwm-regulator.c | 50 +

[linux-sunxi] [PATCH v5 31/46] pwm: update documentation

2016-03-30 Thread Boris Brezillon
Update the PWM subsystem documentation to reflect the atomic PWM changes. Signed-off-by: Boris Brezillon --- Documentation/pwm.txt | 27 +-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/Documentation/pwm.txt b/Documentation/pwm.txt index ca895fd..cb25fca

[linux-sunxi] [PATCH v5 37/46] input: misc: max8997: switch to the atomic PWM API

2016-03-30 Thread Boris Brezillon
pwm_config/enable/disable() have been deprecated and should be replaced by pwm_apply_state(). Signed-off-by: Boris Brezillon --- drivers/input/misc/max8997_haptic.c | 23 ++- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/drivers/input/misc/max8997_haptic.c b

[linux-sunxi] [PATCH v5 28/46] regulator: pwm: swith to the atomic PWM API

2016-03-30 Thread Boris Brezillon
pwm_config/enable/disable() have been deprecated in favor of pwm_apply_state(). Replace all those calls with the equivalent pwm_get/apply_state(). Signed-off-by: Boris Brezillon --- drivers/regulator/pwm-regulator.c | 54 --- 1 file changed, 34 insertions(+),

[linux-sunxi] [PATCH v5 23/46] pwm: rockchip: add support for atomic update

2016-03-30 Thread Boris Brezillon
Implement the ->apply() function to add support for atomic update. Signed-off-by: Boris Brezillon Tested-by: Heiko Stuebner --- drivers/pwm/pwm-rockchip.c | 63 -- 1 file changed, 39 insertions(+), 24 deletions(-) diff --git a/drivers/pwm/pwm-rockchi

  1   2   >