[PATCH v8 1/4] lib: vsprintf: scanf: Negative number must have field width > 1

2021-03-30 Thread Richard Fitzgerald
dth of 1 if it starts with a digit. In that case the single digit can be converted. Signed-off-by: Richard Fitzgerald Reviewed-by: Petr Mladek Acked-by: Andy Shevchenko --- lib/vsprintf.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c in

[PATCH v8 2/4] lib: vsprintf: Fix handling of number field widths in vsscanf

2021-03-30 Thread Richard Fitzgerald
lt because the value obviously overflows INT_MAX. But sscanf will report a successful conversion. Note that where a very large number is used to mean "unlimited", the value INT_MAX is used for consistency with the behaviour of vsnprintf(). Signed-off-by: Richard Fitzgerald Reviewed

[PATCH v8 4/4] selftests: lib: Add wrapper script for test_scanf

2021-03-30 Thread Richard Fitzgerald
Adds a wrapper shell script for the test_scanf module. Signed-off-by: Richard Fitzgerald Reviewed-by: Petr Mladek Acked-by: Andy Shevchenko --- Changed since v6: Fixed typo in tools/testing/selftests/lib/config: -CONFIG_TEST_SCANTF=m +CONFIG_TEST_SCANF=m As this is a trivial

[PATCH v8 3/4] lib: test_scanf: Add tests for sscanf number conversion

2021-03-30 Thread Richard Fitzgerald
Adds test_sscanf to test various number conversion cases, as number conversion was previously broken. This also tests the simple_strtoxxx() functions exported from vsprintf.c. Signed-off-by: Richard Fitzgerald Acked-by: Andy Shevchenko --- Changed since v6: Use the KSTM_MODULE_GLOBALS define

Re: [PATCH v7 2/4] lib: vsprintf: Fix handling of number field widths in vsscanf

2021-03-29 Thread Richard Fitzgerald
On 29/03/2021 14:36, Andy Shevchenko wrote: On Mon, Mar 29, 2021 at 01:08:22PM +0100, Richard Fitzgerald wrote: The existing code attempted to handle numbers by doing a strto[u]l(), ignoring the field width, and then repeatedly dividing to extract the field out of the full converted value

[PATCH v7 4/4] selftests: lib: Add wrapper script for test_scanf

2021-03-29 Thread Richard Fitzgerald
Adds a wrapper shell script for the test_scanf module. Signed-off-by: Richard Fitzgerald Reviewed-by: Petr Mladek Acked-by: Andy Shevchenko --- Changes since v6: Fixed typo in tools/testing/selftests/lib/config: -CONFIG_TEST_SCANTF=m +CONFIG_TEST_SCANF=m As this is a trivial

[PATCH RESEND] lib: crc8: Pointer to data block should be const

2021-03-29 Thread Richard Fitzgerald
crc8() does not change the data passed to it, so the pointer argument should be declared const. This avoids callers that receive const data having to cast it to a non-const pointer to call crc8(). Signed-off-by: Richard Fitzgerald Acked-by: Randy Dunlap --- No maintainer listed for this file so

[PATCH v7 1/4] lib: vsprintf: scanf: Negative number must have field width > 1

2021-03-29 Thread Richard Fitzgerald
dth of 1 if it starts with a digit. In that case the single digit can be converted. Signed-off-by: Richard Fitzgerald Reviewed-by: Petr Mladek Acked-by: Andy Shevchenko --- lib/vsprintf.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c in

[PATCH v7 3/4] lib: test_scanf: Add tests for sscanf number conversion

2021-03-29 Thread Richard Fitzgerald
Adds test_sscanf to test various number conversion cases, as number conversion was previously broken. This also tests the simple_strtoxxx() functions exported from vsprintf.c. Signed-off-by: Richard Fitzgerald Acked-by: Andy Shevchenko --- Changed since v6: Use the KSTM_MODULE_GLOBALS define

[PATCH v7 2/4] lib: vsprintf: Fix handling of number field widths in vsscanf

2021-03-29 Thread Richard Fitzgerald
lt because the value obviously overflows INT_MAX. But sscanf will report a successful conversion. Note that where a very large number is used to mean "unlimited", the value INT_MAX is used for consistency with the behaviour of vsnprintf(). Signed-off-by: Richard Fitzgerald Reviewed-b

[PATCH v6 3/4] lib: test_scanf: Add tests for sscanf number conversion

2021-02-09 Thread Richard Fitzgerald
Adds test_sscanf to test various number conversion cases, as number conversion was previously broken. This also tests the simple_strtoxxx() functions exported from vsprintf.c. Signed-off-by: Richard Fitzgerald Acked-by: Andy Shevchenko --- MAINTAINERS | 1 + lib/Kconfig.debug | 3

[PATCH v6 4/4] selftests: lib: Add wrapper script for test_scanf

2021-02-09 Thread Richard Fitzgerald
Adds a wrapper shell script for the test_scanf module. Signed-off-by: Richard Fitzgerald Reviewed-by: Petr Mladek Acked-by: Andy Shevchenko --- tools/testing/selftests/lib/Makefile | 2 +- tools/testing/selftests/lib/config | 1 + tools/testing/selftests/lib/scanf.sh | 4 3 files

[PATCH v6 1/4] lib: vsprintf: scanf: Negative number must have field width > 1

2021-02-09 Thread Richard Fitzgerald
dth of 1 if it starts with a digit. In that case the single digit can be converted. Signed-off-by: Richard Fitzgerald Reviewed-by: Petr Mladek Acked-by: Andy Shevchenko --- lib/vsprintf.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c in

[PATCH v6 2/4] lib: vsprintf: Fix handling of number field widths in vsscanf

2021-02-09 Thread Richard Fitzgerald
lt because the value obviously overflows INT_MAX. But sscanf will report a successful conversion. Note that where a very large number is used to mean "unlimited", the value INT_MAX is used for consistency with the behaviour of vsnprintf(). Signed-off-by: Richard Fitzgerald --

Re: [PATCH v5 2/4] lib: vsprintf: Fix handling of number field widths in vsscanf

2021-02-08 Thread Richard Fitzgerald
On 08/02/2021 15:18, Andy Shevchenko wrote: On Mon, Feb 08, 2021 at 02:01:52PM +, Richard Fitzgerald wrote: The existing code attempted to handle numbers by doing a strto[u]l(), ignoring the field width, and then repeatedly dividing to extract the field out of the full converted value

[PATCH v5 3/4] lib: test_scanf: Add tests for sscanf number conversion

2021-02-08 Thread Richard Fitzgerald
Adds test_sscanf to test various number conversion cases, as number conversion was previously broken. This also tests the simple_strtoxxx() functions exported from vsprintf.c. Signed-off-by: Richard Fitzgerald Acked-by: Andy Shevchenko --- MAINTAINERS | 1 + lib/Kconfig.debug | 3

[PATCH v5 2/4] lib: vsprintf: Fix handling of number field widths in vsscanf

2021-02-08 Thread Richard Fitzgerald
lt because the value obviously overflows INT_MAX. But sscanf will report a successful conversion. Signed-off-by: Richard Fitzgerald --- Changed since v3: - Consistently use SIZE_MAX as the "infinity" value when passing to size_t arguments. - Use while-loop instead of for-loop in _p

[PATCH v5 1/4] lib: vsprintf: scanf: Negative number must have field width > 1

2021-02-08 Thread Richard Fitzgerald
dth of 1 if it starts with a digit. In that case the single digit can be converted. Signed-off-by: Richard Fitzgerald Reviewed-by: Petr Mladek Acked-by: Andy Shevchenko --- lib/vsprintf.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c in

[PATCH v5 4/4] selftests: lib: Add wrapper script for test_scanf

2021-02-08 Thread Richard Fitzgerald
Adds a wrapper shell script for the test_scanf module. Signed-off-by: Richard Fitzgerald Reviewed-by: Petr Mladek Acked-by: Andy Shevchenko --- tools/testing/selftests/lib/Makefile | 2 +- tools/testing/selftests/lib/config | 1 + tools/testing/selftests/lib/scanf.sh | 4 3 files

Re: [PATCH v4 2/4] lib: vsprintf: Fix handling of number field widths in vsscanf

2021-02-08 Thread Richard Fitzgerald
On 04/02/2021 16:35, Petr Mladek wrote: On Wed 2021-02-03 21:45:55, Andy Shevchenko wrote: On Wed, Feb 03, 2021 at 04:50:07PM +, Richard Fitzgerald wrote: The existing code attempted to handle numbers by doing a strto[u]l(), ignoring the field width, and then repeatedly dividing to extract

Re: [PATCH v4 2/4] lib: vsprintf: Fix handling of number field widths in vsscanf

2021-02-05 Thread Richard Fitzgerald
On 04/02/2021 16:35, Petr Mladek wrote: On Wed 2021-02-03 21:45:55, Andy Shevchenko wrote: On Wed, Feb 03, 2021 at 04:50:07PM +, Richard Fitzgerald wrote: The existing code attempted to handle numbers by doing a strto[u]l(), ignoring the field width, and then repeatedly dividing

[PATCH v4 3/4] lib: test_scanf: Add tests for sscanf number conversion

2021-02-03 Thread Richard Fitzgerald
Adds test_sscanf to test various number conversion cases, as number conversion was previously broken. This also tests the simple_strtoxxx() functions exported from vsprintf.c. Signed-off-by: Richard Fitzgerald --- MAINTAINERS | 1 + lib/Kconfig.debug | 3 + lib/Makefile | 1

[PATCH v4 2/4] lib: vsprintf: Fix handling of number field widths in vsscanf

2021-02-03 Thread Richard Fitzgerald
lt because the value obviously overflows INT_MAX. But sscanf will report a successful conversion. Signed-off-by: Richard Fitzgerald Reviewed-by: Petr Mladek --- lib/kstrtox.c | 13 ++-- lib/kstrtox.h | 2 ++ lib/vsprintf.c | 88 +- 3 files

[PATCH v4 1/4] lib: vsprintf: scanf: Negative number must have field width > 1

2021-02-03 Thread Richard Fitzgerald
dth of 1 if it starts with a digit. In that case the single digit can be converted. Signed-off-by: Richard Fitzgerald Reviewed-by: Petr Mladek --- lib/vsprintf.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 3b53c73580c5..28bb26cd1

[PATCH v4 4/4] selftests: lib: Add wrapper script for test_scanf

2021-02-03 Thread Richard Fitzgerald
Adds a wrapper shell script for the test_scanf module. Signed-off-by: Richard Fitzgerald Reviewed-by: Petr Mladek --- tools/testing/selftests/lib/Makefile | 2 +- tools/testing/selftests/lib/config | 1 + tools/testing/selftests/lib/scanf.sh | 4 3 files changed, 6 insertions(+), 1

[PATCH] soundwire: bus: Make sdw_nwrite() data pointer argument const

2021-02-03 Thread Richard Fitzgerald
, but this is an implementation detail that should be hidden by the public API. Signed-off-by: Richard Fitzgerald --- drivers/soundwire/bus.c | 6 +++--- include/linux/soundwire/sdw.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/soundwire/bus.c b/drivers

[PATCH RESEND] lib: crc8: Pointer to data block should be const

2021-02-02 Thread Richard Fitzgerald
crc8() does not change the data passed to it, so the pointer argument should be declared const. This avoids callers that receive const data having to cast it to a non-const pointer to call crc8(). Signed-off-by: Richard Fitzgerald Acked-by: Randy Dunlap --- No maintainer listed for this file so

[PATCH] dmaengine: xilinx_dma: Alloc tx descriptors GFP_NOWAIT

2021-01-29 Thread Richard Fitzgerald
Use GFP_NOWAIT allocation in xilinx_dma_alloc_tx_descriptor(). This is necessary for compatibility with ALSA, which calls dmaengine_prep_dma_cyclic() from an atomic context. Signed-off-by: Richard Fitzgerald --- drivers/dma/xilinx/xilinx_dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH] lib: crc8: Pointer to data block should be const

2021-01-29 Thread Richard Fitzgerald
crc8() does not change the data passed to it, so the pointer argument should be declared const. This avoids callers that receive const data having to cast it to a non-const pointer to call crc8(). Signed-off-by: Richard Fitzgerald --- include/linux/crc8.h | 2 +- lib/crc8.c | 2 +- 2

Re: [PATCH v2 08/12] ASoC: arizona-jack: convert into a helper library for codec drivers

2021-01-19 Thread Richard Fitzgerald
On 18/01/2021 17:24, Andy Shevchenko wrote: On Sun, Jan 17, 2021 at 6:06 PM Hans de Goede wrote: Convert the arizona extcon driver into a helper library for direct use from the arizona codec-drivers, rather then being bound to a separate MFD cell. Note the probe (and remove) sequence is

Re: [PATCH v4 2/6] dt-bindings: audio-graph-card: Add plls and sysclks properties

2021-01-15 Thread Richard Fitzgerald
On 15/01/2021 15:20, Mark Brown wrote: On Fri, Jan 15, 2021 at 02:42:12PM +, Richard Fitzgerald wrote: On 15/01/2021 13:11, Mark Brown wrote: On Fri, Jan 15, 2021 at 10:35:23AM +, Richard Fitzgerald wrote: On 13/01/2021 16:09, Mark Brown wrote: On Wed, Jan 13, 2021 at 09:22:25AM

Re: [PATCH v4 2/6] dt-bindings: audio-graph-card: Add plls and sysclks properties

2021-01-15 Thread Richard Fitzgerald
On 15/01/2021 13:11, Mark Brown wrote: On Fri, Jan 15, 2021 at 10:35:23AM +, Richard Fitzgerald wrote: On 13/01/2021 16:09, Mark Brown wrote: On Wed, Jan 13, 2021 at 09:22:25AM -0600, Rob Herring wrote: some_codec { pll: pll { compatible = "fixed-

Re: [PATCH v4 2/6] dt-bindings: audio-graph-card: Add plls and sysclks properties

2021-01-15 Thread Richard Fitzgerald
On 13/01/2021 16:09, Mark Brown wrote: On Wed, Jan 13, 2021 at 09:22:25AM -0600, Rob Herring wrote: I'm not sure this makes sense to be generic, but if so, we already have the clock binding and should use (and possibly extend) that. This appears to all be configuration of clocks within the

Re: [PATCH v4 2/6] dt-bindings: audio-graph-card: Add plls and sysclks properties

2021-01-14 Thread Richard Fitzgerald
On 13/01/2021 15:22, Rob Herring wrote: On Fri, Jan 08, 2021 at 04:04:57PM +, Richard Fitzgerald wrote: The audio-graph-card driver has properties for configuring the clocking for DAIs within a component, but is missing properties for setting up the PLLs and sysclks of the component

Re: [PATCH v4 3/6] ASoC: audio-graph-card: Support setting component plls and sysclks

2021-01-12 Thread Richard Fitzgerald
are applied to a component as it is passed to the card set_bias_level/ set_bias_level_post callbacks. It follows from this that the order components are configured is the order that they are passed to those callbacks. Signed-off-by: Richard Fitzgerald --- As I mentioned in v3, adding *general* pll

[PATCH] ASoC: wm_adsp: Fix uninitialized variable warnings

2021-01-11 Thread Richard Fitzgerald
variables later in the outer function. Fix this by changing the test in wm_adsp_read_data_word() to be if (ret < 0). Signed-off-by: Richard Fitzgerald --- sound/soc/codecs/wm_adsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/code

Re: [PATCH v3 1/4] lib: vsprintf: scanf: Negative number must have field width > 1

2021-01-11 Thread Richard Fitzgerald
On 11/01/2021 10:39, Richard Fitzgerald wrote: On 11/01/2021 10:36, Andy Shevchenko wrote: On Mon, Jan 11, 2021 at 12:28 PM Petr Mladek wrote: Sigh, I have just realized that Andy and Rasmus, the other vsprintf maintainers and reviewers, were not in CC. I am sorry for not noticing

Re: [PATCH v3 1/4] lib: vsprintf: scanf: Negative number must have field width > 1

2021-01-11 Thread Richard Fitzgerald
On 11/01/2021 10:36, Andy Shevchenko wrote: On Mon, Jan 11, 2021 at 12:28 PM Petr Mladek wrote: Sigh, I have just realized that Andy and Rasmus, the other vsprintf maintainers and reviewers, were not in CC. I am sorry for not noticing this earlier. The patchset is ready for 5.12 from my POV.

Re: [PATCH v3 1/4] lib: vsprintf: scanf: Negative number must have field width > 1

2021-01-11 Thread Richard Fitzgerald
hould also be directly mailed. I am sorry for not noticing this earlier. The patchset is ready for 5.12 from my POV. Best Regards, Petr On Thu 2020-12-17 18:00:54, Richard Fitzgerald wrote: If a signed number field starts with a '-' the field width must be > 1, or unlimited, to allow at le

[PATCH v4 2/6] dt-bindings: audio-graph-card: Add plls and sysclks properties

2021-01-08 Thread Richard Fitzgerald
the component clocking. Signed-off-by: Richard Fitzgerald --- .../bindings/sound/audio-graph.yaml | 46 +++ 1 file changed, 46 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/audio-graph.yaml b/Documentation/devicetree/bindings/sound/audio-graph.yaml

[PATCH v4 5/6] ASoC: madera: Export clock config defines to dt-bindings

2021-01-08 Thread Richard Fitzgerald
Move the defines for clock/fll IDs and sources into the dt-bindings header so that they can be used by machine driver dts files. Signed-off-by: Richard Fitzgerald --- include/dt-bindings/sound/madera.h | 60 ++ sound/soc/codecs/madera.h | 56

[PATCH v4 0/6] Add support for Rpi4b + Cirrus Lochnagar2 and CS47L15

2021-01-08 Thread Richard Fitzgerald
and access to the registers would cause a nested get of the bus clock. The clock framework does not support this and it would result in a deadlock. Richard Fitzgerald (6): of: base: Add of_count_phandle_with_fixed_args() dt-bindings: audio-graph-card: Add plls and sysclks properties ASoC: audio

[PATCH v4 4/6] ASoC: madera: Allow codecs to be selected from kernel config

2021-01-08 Thread Richard Fitzgerald
, allowing the codec to be used with simple-card and other machine drivers that are not hardcoded to use a fixed set of codecs. Signed-off-by: Richard Fitzgerald --- sound/soc/codecs/Kconfig | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/Kconfig b

[PATCH v4 3/6] ASoC: audio-graph-card: Support setting component plls and sysclks

2021-01-08 Thread Richard Fitzgerald
/ set_bias_level_post callbacks. It follows from this that the order components are configured is the order that they are passed to those callbacks. Signed-off-by: Richard Fitzgerald --- include/sound/simple_card_utils.h | 25 +++ sound/soc/generic/audio-graph-card.c | 13 ++ sound/soc

[PATCH v4 1/6] of: base: Add of_count_phandle_with_fixed_args()

2021-01-08 Thread Richard Fitzgerald
-by: Richard Fitzgerald Reviewed-by: Rob Herring --- drivers/of/base.c | 73 +++--- include/linux/of.h | 9 ++ 2 files changed, 59 insertions(+), 23 deletions(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index 161a23631472..c5ff2524bf40

[PATCH v4 6/6] ARM: dts: Add dts for RPi4b + Cirrus Logic Lochnagar2 + CS47L15

2021-01-08 Thread Richard Fitzgerald
This adds a devicetree configuration for Raspberry Pi 4b connected to Cirrus Logic Lochnagar 2 audio development board and CS47L15 codec. The common (codec-independent) Lochnagar 2 configuration is separated into a dtsi to simplify re-using it for other codecs. Signed-off-by: Richard Fitzgerald

[PATCH] spi: bcm2835: Set controller max_speed_hz

2021-01-07 Thread Richard Fitzgerald
only the minimum possible bus frequency would be used. Signed-off-by: Richard Fitzgerald --- drivers/spi/spi-bcm2835.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c index 197485f2c2b2..8e161f4f7766 100644 --- a/drivers/spi/spi-bcm2835

[PATCH 2/2] ASoC: wm_adsp: Use snd_ctl_elem_type_t for control types

2020-12-30 Thread Richard Fitzgerald
block. Signed-off-by: Richard Fitzgerald --- sound/soc/codecs/wm_adsp.c | 12 +++- sound/soc/codecs/wmfw.h| 6 +++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index 8cfa8ac1b8c4..f8ad768364c2 100644

[PATCH 1/2] ASoC: wm_adsp: Only use __be32 for big-endian data

2020-12-30 Thread Richard Fitzgerald
(as there's no point introducing another buffer) so a cast to (__be32 *) is added when passing it to wm_adsp_read_raw_data_block(). Signed-off-by: Richard Fitzgerald --- sound/soc/codecs/wm_adsp.c | 33 - 1 file changed, 16 insertions(+), 17 deletions(-) diff

Re: [PATCH 01/14] mfd: arizona: Add jack pointer to struct arizona

2020-12-30 Thread Richard Fitzgerald
On 30/12/2020 11:04, Hans de Goede wrote: Hi, On 12/29/20 5:51 PM, Richard Fitzgerald wrote: On 29/12/2020 15:40, Hans de Goede wrote: Hi, On 12/29/20 4:15 PM, Mark Brown wrote: On Tue, Dec 29, 2020 at 03:06:35PM +, Charles Keepax wrote: There is maybe more argument for porting

Re: [PATCH 01/14] mfd: arizona: Add jack pointer to struct arizona

2020-12-29 Thread Richard Fitzgerald
On 29/12/2020 15:40, Hans de Goede wrote: Hi, On 12/29/20 4:15 PM, Mark Brown wrote: On Tue, Dec 29, 2020 at 03:06:35PM +, Charles Keepax wrote: There is maybe more argument for porting the Arizona code across anyways, since for a long time Android didn't properly support extcon

Re: [PATCH 01/14] mfd: arizona: Add jack pointer to struct arizona

2020-12-29 Thread Richard Fitzgerald
On 29/12/2020 15:06, Charles Keepax wrote: On Tue, Dec 29, 2020 at 02:57:38PM +0100, Hans de Goede wrote: On 12/29/20 2:06 PM, Charles Keepax wrote: On Mon, Dec 28, 2020 at 04:28:07PM +, Mark Brown wrote: On Mon, Dec 28, 2020 at 02:16:04PM +0100, Hans de Goede wrote: And more in

Re: [PATCH v3 3/6] ASoC: audio-graph-card: Support setting component plls and sysclks

2020-12-21 Thread Richard Fitzgerald
components are configured is the order that they are passed to those callbacks. Signed-off-by: Richard Fitzgerald --- include/sound/simple_card_utils.h | 25 +++ sound/soc/generic/audio-graph-card.c | 16 +- sound/soc/generic/simple-card-utils.c | 236 ++ 3 files

[PATCH v3 3/4] lib: test_scanf: Add tests for sscanf number conversion

2020-12-17 Thread Richard Fitzgerald
Adds test_sscanf to test various number conversion cases, as number conversion was previously broken. This also tests the simple_strtoxxx() functions exported from vsprintf.c. Signed-off-by: Richard Fitzgerald --- MAINTAINERS | 1 + lib/Kconfig.debug | 3 + lib/Makefile | 1

[PATCH v3 1/4] lib: vsprintf: scanf: Negative number must have field width > 1

2020-12-17 Thread Richard Fitzgerald
dth of 1 if it starts with a digit. In that case the single digit can be converted. Signed-off-by: Richard Fitzgerald --- lib/vsprintf.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 14c9a6af1b23..8954ff94a53c 100644 --- a/

[PATCH v3 2/4] lib: vsprintf: Fix handling of number field widths in vsscanf

2020-12-17 Thread Richard Fitzgerald
lt because the value obviously overflows INT_MAX. But sscanf will report a successful conversion. Signed-off-by: Richard Fitzgerald --- lib/kstrtox.c | 13 ++-- lib/kstrtox.h | 2 ++ lib/vsprintf.c | 88 +- 3 files changed, 64 insertions(+),

[PATCH v3 4/4] selftests: lib: Add wrapper script for test_scanf

2020-12-17 Thread Richard Fitzgerald
Adds a wrapper shell script for the test_scanf module. Signed-off-by: Richard Fitzgerald Reviewed-by: Petr Mladek --- tools/testing/selftests/lib/Makefile | 2 +- tools/testing/selftests/lib/config | 1 + tools/testing/selftests/lib/scanf.sh | 4 3 files changed, 6 insertions(+), 1

[PATCH v3 6/6] ARM: dts: Add dts for RPi4b + Cirrus Logic Lochnagar2 + CS47L15

2020-12-17 Thread Richard Fitzgerald
This adds a devicetree configuration for Raspberry Pi 4b connected to Cirrus Logic Lochnagar 2 audio development board and CS47L15 codec. The common (codec-independent) Lochnagar 2 configuration is separated into a dtsi to simplify re-using it for other codecs. Signed-off-by: Richard Fitzgerald

[PATCH v3 3/6] ASoC: audio-graph-card: Support setting component plls and sysclks

2020-12-17 Thread Richard Fitzgerald
/ set_bias_level_post callbacks. It follows from this that the order components are configured is the order that they are passed to those callbacks. Signed-off-by: Richard Fitzgerald --- include/sound/simple_card_utils.h | 25 +++ sound/soc/generic/audio-graph-card.c | 16 +- sound/soc

[PATCH v3 2/6] ASoC: audio-graph-card: Add plls and sysclks DT bindings

2020-12-17 Thread Richard Fitzgerald
the component clocking. Signed-off-by: Richard Fitzgerald --- .../bindings/sound/audio-graph-card.txt | 72 +++ 1 file changed, 72 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/audio-graph-card.txt b/Documentation/devicetree/bindings/sound/audio-graph-card.txt

[PATCH v3 5/6] ASoC: madera: Export clock config defines to dt-bindings

2020-12-17 Thread Richard Fitzgerald
Move the defines for clock/fll IDs and sources into the dt-bindings header so that they can be used by machine driver dts files. Signed-off-by: Richard Fitzgerald --- include/dt-bindings/sound/madera.h | 60 ++ sound/soc/codecs/madera.h | 56

[PATCH v3 0/6] Add support for Rpi4b + Cirrus Lochnagar2 and CS47L15

2020-12-17 Thread Richard Fitzgerald
and access to the registers would cause a nested get of the bus clock. The clock framework does not support this and it would result in a deadlock. Richard Fitzgerald (6): of: base: Add of_count_phandle_with_fixed_args() ASoC: audio-graph-card: Add plls and sysclks DT bindings ASoC: audio-graph

[PATCH v3 1/6] of: base: Add of_count_phandle_with_fixed_args()

2020-12-17 Thread Richard Fitzgerald
-by: Richard Fitzgerald Reviewed-by: Rob Herring --- drivers/of/base.c | 73 +++--- include/linux/of.h | 9 ++ 2 files changed, 59 insertions(+), 23 deletions(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index 161a23631472..c5ff2524bf40

[PATCH v3 4/6] ASoC: madera: Allow codecs to be selected from kernel config

2020-12-17 Thread Richard Fitzgerald
, allowing the codec to be used with simple-card and other machine drivers that are not hardcoded to use a fixed set of codecs. Signed-off-by: Richard Fitzgerald --- sound/soc/codecs/Kconfig | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/Kconfig b

[PATCH] ASoC: wm_adsp: Improve handling of raw byte streams

2020-12-16 Thread Richard Fitzgerald
together in a single walk, and it is not dependent on the endianness of the CPU. The data_word_size argument to wm_adsp_remove_padding() has been dropped because currently this is always 3. Signed-off-by: Richard Fitzgerald --- sound/soc/codecs/wm_adsp.c | 55 +- 1

Re: [PATCH v2 2/4] lib: test_scanf: Add tests for sscanf number conversion

2020-12-15 Thread Richard Fitzgerald
On 09/12/2020 14:15, Petr Mladek wrote: On Mon 2020-11-30 14:57:58, Richard Fitzgerald wrote: Adds test_sscanf to test various number conversion cases, as number conversion was previously broken. This also tests the simple_strtoxxx() functions exported from vsprintf.c. It is impressive

[PATCH v2 4/4] MAINTAINERS: Add lib/test_scanf.c to VSPRINTF

2020-11-30 Thread Richard Fitzgerald
Adds the new scanf test to the VSPRINTF group. Signed-off-by: Richard Fitzgerald --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 7887d2161be4..d2bf38bd3d0c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -18782,6 +18782,7 @@ S: Maintained

[PATCH v2 2/4] lib: test_scanf: Add tests for sscanf number conversion

2020-11-30 Thread Richard Fitzgerald
Adds test_sscanf to test various number conversion cases, as number conversion was previously broken. This also tests the simple_strtoxxx() functions exported from vsprintf.c. Signed-off-by: Richard Fitzgerald --- lib/Kconfig.debug | 3 + lib/Makefile | 1 + lib/test_scanf.c | 747

[PATCH v2 3/4] selftests: lib: Add wrapper script for test_scanf

2020-11-30 Thread Richard Fitzgerald
Adds a wrapper shell script for the test_scanf module. Signed-off-by: Richard Fitzgerald --- tools/testing/selftests/lib/Makefile | 2 +- tools/testing/selftests/lib/config | 1 + tools/testing/selftests/lib/scanf.sh | 4 3 files changed, 6 insertions(+), 1 deletion(-) create mode

[PATCH v2 1/4] lib: vsprintf: Fix handling of number field widths in vsscanf

2020-11-30 Thread Richard Fitzgerald
prefix or leading '-' that is >= the maximum field width is handled such that the result of a sccanf is consistent with the observed behaviour of userland sscanf. Signed-off-by: Richard Fitzgerald --- lib/kstrtox.c | 13 +-- lib/kstrtox.h | 2 ++ lib/vsprintf.c |

Re: [PATCH] lib: vsprintf: Fix handling of number field widths in vsscanf

2020-11-20 Thread Richard Fitzgerald
On 20/11/2020 15:07, Steven Rostedt wrote: On Fri, 20 Nov 2020 12:05:25 +0100 Petr Mladek wrote: On Mon 2020-11-16 14:32:52, Richard Fitzgerald wrote: The existing code attempted to handle numbers by doing a strto[u]l(), ignoring the field width, and then bitshifting the field out

[PATCH] lib: vsprintf: Fix handling of number field widths in vsscanf

2020-11-16 Thread Richard Fitzgerald
ong and long long conversions. Signed-off-by: Richard Fitzgerald --- lib/kstrtox.c | 14 --- lib/kstrtox.h | 2 ++ lib/vsprintf.c | 65 +++--- 3 files changed, 48 insertions(+), 33 deletions(-) diff --git a/lib/kstrtox.c b/lib/kstrtox.c in

Re: [PATCH] lib: vsprintf: Avoid 32-bit truncation in vsscanf number parsing

2020-11-16 Thread Richard Fitzgerald
On 13/11/2020 14:00, Petr Mladek wrote: On Thu 2020-11-12 12:04:27, Steven Rostedt wrote: On Thu, 12 Nov 2020 15:46:46 + Richard Fitzgerald wrote: See this thread from 2014 where the field width problem was raised and explained: http://lkml.iu.edu/hypermail/linux/kernel/1401.1/03443.html

Re: [PATCH] lib: vsprintf: Avoid 32-bit truncation in vsscanf number parsing

2020-11-12 Thread Richard Fitzgerald
On 12/11/2020 15:35, Steven Rostedt wrote: On Thu, 12 Nov 2020 11:17:59 + Richard Fitzgerald wrote: Number conversion in vsscanf converts a whole string of digits and then extracts the field width part from the converted value. The maximum run of digits is limited by overflow. Conversion

Re: [PATCH 11/15] input: touchscreen: wm97xx-core: Provide missing description for 'status'

2020-11-12 Thread Richard Fitzgerald
- * + * @status: status * * Set the status of a codec GPIO pin */ Acked-by: Richard Fitzgerald

Re: [PATCH 09/15] input: misc: wm831x-on: Source file headers are not good candidates for kernel-doc

2020-11-12 Thread Richard Fitzgerald
/wm831x-on.c @@ -1,4 +1,4 @@ -/** +/* * wm831x-on.c - WM831X ON pin driver * * Copyright (C) 2009 Wolfson Microelectronics plc Acked-by: Richard Fitzgerald

[PATCH] lib: vsprintf: Avoid 32-bit truncation in vsscanf number parsing

2020-11-12 Thread Richard Fitzgerald
the result is manipulated as a u64, so this is an avoidable behaviour difference between 32-bit and 64-bit builds. The conversion can call simple_strto[u]ll directly and preserve the full 64-bits that were parsed out of the string. Signed-off-by: Richard Fitzgerald --- lib/vsprintf.c | 8 ++-- 1 fi

Re: [PATCH v2 2/7] ASoC: audio-graph-card: Add plls and sysclks DT bindings

2020-11-02 Thread Richard Fitzgerald
On 26/10/2020 13:27, Rob Herring wrote: On Fri, Oct 16, 2020 at 06:35:36PM +0100, Richard Fitzgerald wrote: This adds the two new properties 'plls' and 'sysclks' to the dt bindings. These add the ability to set values that will be passed to snd_soc_component_set_sysclk

[PATCH v2 7/7] MAINTAINERS: Add dts for Cirrus Logic Lochnagar on RPi4

2020-10-16 Thread Richard Fitzgerald
Update the Cirrus Logic driver maintainers to include the device tree files for using the Lochnagar with a Raspberry Pi 4. Signed-off-by: Richard Fitzgerald --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 0f59b0412953..d0065cba9535 100644

[PATCH v2 3/7] ASoC: audio-graph-card: Support setting component plls and sysclks

2020-10-16 Thread Richard Fitzgerald
components. The plls and sysclks are applied to a component as it is passed to the card set_bias_level/ set_bias_level_post callbacks. It follows from this that the order components are configured is the order that they are passed to those callbacks. Signed-off-by: Richard Fitzgerald --- include

[PATCH v2 5/7] ASoC: madera: Allow codecs to be selected from kernel config

2020-10-16 Thread Richard Fitzgerald
, allowing the codec to be used with simple-card and other machine drivers that are not hardcoded to use a fixed set of codecs. Signed-off-by: Richard Fitzgerald --- sound/soc/codecs/Kconfig | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/Kconfig b

[PATCH v2 6/7] ARM: dts: Add dts for RPi4b + Cirrus Logic Lochnagar2 + CS47L15

2020-10-16 Thread Richard Fitzgerald
This adds a devicetree configuration for Raspberry Pi 4b connected to Cirrus Logic Lochnagar 2 audio development board and CS47L15 codec. The common (codec-independent) Lochnagar 2 configuration is separated into a dtsi to simplify re-using it for other codecs. Signed-off-by: Richard Fitzgerald

[PATCH v2 0/7] Add support for Rpi4b + Cirrus Lochnagar2 and CS47L15

2020-10-16 Thread Richard Fitzgerald
be placed under the clock framwork because they are I2C/SPI-connected peripherals and access to the registers would cause a nested get of the I2C/SPI bus clock. The clock framework does not support this and it would result in a deadlock. Richard Fitzgerald (7): of: base: Add

[PATCH v2 2/7] ASoC: audio-graph-card: Add plls and sysclks DT bindings

2020-10-16 Thread Richard Fitzgerald
This adds the two new properties 'plls' and 'sysclks' to the dt bindings. These add the ability to set values that will be passed to snd_soc_component_set_sysclk() and snd_soc_component_set_pll(). Signed-off-by: Richard Fitzgerald --- .../bindings/sound/audio-graph-card.txt | 44

[PATCH v2 1/7] of: base: Add of_count_phandle_with_fixed_args()

2020-10-16 Thread Richard Fitzgerald
-by: Richard Fitzgerald --- drivers/of/base.c | 73 +++--- include/linux/of.h | 9 ++ 2 files changed, 59 insertions(+), 23 deletions(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index 161a23631472..c5ff2524bf40 100644 --- a/drivers/of/base.c

[PATCH v2 4/7] ASoC: arizona: Allow codecs to be selected from kernel config

2020-10-16 Thread Richard Fitzgerald
, allowing the codec to be used with simple-card and other machine drivers that are not hardcoded to use a fixed set of codecs. Signed-off-by: Richard Fitzgerald --- sound/soc/codecs/Kconfig | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/Kconfig b

Re: [PATCH 1/7] of: base: Add of_count_phandle_with_fixed_args()

2020-10-16 Thread Richard Fitzgerald
On 16/10/2020 14:31, Rob Herring wrote: On Thu, Oct 15, 2020 at 11:52 AM Robin Murphy wrote: On 2020-10-14 19:39, Rob Herring wrote: On Wed, Oct 14, 2020 at 9:54 AM Richard Fitzgerald wrote: Add an equivalent of of_count_phandle_with_args() for fixed argument sets, to pair

Re: [PATCH 0/7] Add dts for Rpi4 + Cirrus Lochnagar and codecs

2020-10-16 Thread Richard Fitzgerald
On 14/10/2020 19:56, Mark Brown wrote: On Wed, Oct 14, 2020 at 03:54:11PM +0100, Richard Fitzgerald wrote: This set of patches provides support for using the Cirrus Logic Lochnagar audio development platform plus Cirrus Logic Madera/Arizona codecs with the simple-card machine driver

Re: [PATCH 1/7] of: base: Add of_count_phandle_with_fixed_args()

2020-10-16 Thread Richard Fitzgerald
On 15/10/2020 17:52, Robin Murphy wrote: On 2020-10-14 19:39, Rob Herring wrote: On Wed, Oct 14, 2020 at 9:54 AM Richard Fitzgerald wrote: Add an equivalent of of_count_phandle_with_args() for fixed argument sets, to pair with of_parse_phandle_with_fixed_args(). Signed-off-by: Richard

Re: [PATCH 6/7] ARM: dts: Add dts for Raspberry Pi 4 + Cirrus Logic Lochnagar2

2020-10-16 Thread Richard Fitzgerald
On 15/10/2020 16:12, Nicolas Saenz Julienne wrote: On Thu, 2020-10-15 at 12:14 +0100, Richard Fitzgerald wrote: Sadly I don't think creating a new device tree is a good solution here. If we were to do so for every RPi hat/usage it'd become unmanageable very fast. There is a way to maintain

Re: [PATCH 6/7] ARM: dts: Add dts for Raspberry Pi 4 + Cirrus Logic Lochnagar2

2020-10-15 Thread Richard Fitzgerald
development board. Info on the codecs is available from www.cirrus.com. The Lochnagar audio development board is not a hat, but it can be wired over to the RPi GPIO header. It is not specific to the RPi. On Wed, 2020-10-14 at 15:54 +0100, Richard Fitzgerald wrote: This is based on the default

[PATCH] ASoC: wm5102: Use get_unaligned_be16() for dac_comp_coeff

2020-10-15 Thread Richard Fitzgerald
Replace the two-step copy-and-convert in wm5102_out_comp_coeff_put() with get_unaligned_be16(). Apart from looking nicer, it avoids this sparse warning: wm5102.c:687:35: sparse: sparse: cast to restricted __be16 Signed-off-by: Richard Fitzgerald --- sound/soc/codecs/wm5102.c | 4 +--- 1 file

[PATCH 4/7] ASoC: arizona: Allow codecs to be selected from kernel config

2020-10-14 Thread Richard Fitzgerald
, allowing the codec to be used with simple-card and other machine drivers that are not hardcoded to use a fixed set of codecs. Signed-off-by: Richard Fitzgerald --- sound/soc/codecs/Kconfig | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/Kconfig b

[PATCH 7/7] MAINTAINERS: Add dts for Cirrus Logic Lochnagar on RPi4

2020-10-14 Thread Richard Fitzgerald
Update the Cirrus Logic driver maintainers to include the device tree .dts for using the Lochnagar with a Raspberry Pi 4. Signed-off-by: Richard Fitzgerald --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 87ceaac748a4..09bc583a5b2b 100644

[PATCH 5/7] ASoC: madera: Allow codecs to be selected from kernel config

2020-10-14 Thread Richard Fitzgerald
, allowing the codec to be used with simple-card and other machine drivers that are not hardcoded to use a fixed set of codecs. Signed-off-by: Richard Fitzgerald --- sound/soc/codecs/Kconfig | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/Kconfig b

[PATCH 3/7] ASoC: simple-card: Support setting component plls and sysclks

2020-10-14 Thread Richard Fitzgerald
interdependencies between components. The plls and sysclks are applied to a component as it is passed to the card set_bias_level/set_bias_level_post callbacks. It follows from this that the order components are configured is the order that they are passed to those callbacks. Signed-off-by: Richard

[PATCH 2/7] ASoC: simple-card: Add plls and sysclks DT schema

2020-10-14 Thread Richard Fitzgerald
This adds the two new properties 'plls' and 'sysclks' to the dt bindings schema document. These add the ability to set values that will be passed to snd_soc_component_set_sysclk() and snd_soc_component_set_pll(). Signed-off-by: Richard Fitzgerald --- .../bindings/sound/simple-card.yaml

[PATCH 6/7] ARM: dts: Add dts for Raspberry Pi 4 + Cirrus Logic Lochnagar2

2020-10-14 Thread Richard Fitzgerald
-off-by: Richard Fitzgerald --- arch/arm/boot/dts/Makefile|1 + .../dts/bcm2711-rpi4b-cirrus-lochnagar.dts| 1296 + 2 files changed, 1297 insertions(+) create mode 100644 arch/arm/boot/dts/bcm2711-rpi4b-cirrus-lochnagar.dts diff --git a/arch/arm/boot/dts

[PATCH 1/7] of: base: Add of_count_phandle_with_fixed_args()

2020-10-14 Thread Richard Fitzgerald
Add an equivalent of of_count_phandle_with_args() for fixed argument sets, to pair with of_parse_phandle_with_fixed_args(). Signed-off-by: Richard Fitzgerald --- drivers/of/base.c | 42 ++ include/linux/of.h | 9 + 2 files changed, 51 insertions

[PATCH 0/7] Add dts for Rpi4 + Cirrus Lochnagar and codecs

2020-10-14 Thread Richard Fitzgerald
. The clock framework does not support this and it would result in a deadlock. Richard Fitzgerald (7): of: base: Add of_count_phandle_with_fixed_args() ASoC: simple-card: Add plls and sysclks DT schema ASoC: simple-card: Support setting component plls and sysclks ASoC: arizona: Allow codecs

  1   2   3   4   5   6   7   8   9   10   >