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
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
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
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
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
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
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
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.
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
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/
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
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
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 |
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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/
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
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
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
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
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
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,
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
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
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
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
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
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
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
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
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
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/
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
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
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
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
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
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(-)
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
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
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
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;
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
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
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
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
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
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
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
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
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
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
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
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
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 +
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
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
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(+),
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 - 100 of 125 matches
Mail list logo