Add the Lantiq PEF2256 audio support
Subsystems (6)
Herve Codina
maintainerv6 cover Add the Lantiq PEF2256 audio support
Hi,
This series adds support for audio using the Lantiq PEF2256 framer.
The Lantiq PEF2256 is a framer and line interface component designed to fulfill all required interfacing between an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus.
The first part of this series (patches 1 to 4) adds the Lantiq PEF2256 driver core fixing a MFD core issue at patch 2.
The patch 5 adds the PEF2256 pinmux support.
The patch 6 adds the audio support using the Lantiq PEF2256 driver core. The last patch adds myself as the PEF2256 maintainer.
The consumer/provider relation between the codec and the driver core allows to use the PEF2256 framer for other purpose than audio support.
Compared to the previous iteration
https://lore.kernel.org/all/[email protected]/
This v6 series mainly:
- Use regmap
- Move the pinmux part to the pinctrl subsystem
- Move register definitions to header files.
- Split pef2256_setup_e1() in several parts.
- Fixed issues raised by checkpatch.pl.
- Removed debug prints.
Best regards,
Herve Codina
Changes v5 -> v6
- Patch 1
Add 'Reviewed-by: Krzysztof Kozlowski <[email protected]>'
- Patch 2
New patch added fixing an MFD core issue.
- Patch 3 (patch 2 in v5)
Remove the pinmux part.
Move registers definition to a header file and rework the definition.
Use a regmap for register accesses
Various minor fixes (typos, comments, ...) Fixed issues raised by checkpatch.pl --strict Removed debug prints.
- Patch 4 (patch 3 in v5)
No changes
- Patch 5
New patch adding the PEF2256 pinmux part in the pinctrl subsystem.
- Patch 6 (patch 4 in v5)
Fixed issues raised by checkpatch.pl --strict
- Patch 7 (patch 5 in v5)
Updated according to files creation and move.
Changes v4 -> v5
- Patch 1
Fix 'additionalProperties' and 'unevaluatedProperties' positions Fix sub-nodes names suffixes
Changes v3 -> v4
- Patch 1
Merge the codec sub-node description.
Move the 'allOf' property after the 'required' property. Rework the example to be more complete.
- Patches 2 and 5
Drop of_match_ptr()
- Patch 2
Add 'depends on OF' as pinconf_generic_dt_node_to_map_pin() needs OF support to be compiled (error raised by the kernel test robot).
- Patch 4
Remove patch (merged in patch 1)
Changes v2 -> v3
- Patch 1
Remove unneeded 'allOf' and quotes.
Add several 'additionalProperties: false'
Fix example (node name, interrupts and reg properties) Replace the lantiq,sysclk-rate-hz property by sclkr and sclkx clocks. Define 'lantiq,frame-format' property in top level.
Move to MFD
- Patch 2
Fix some #define.
Compact the register accessor helpers.
Rework pef2256_get_version().
Merge v1.2 and v2.x GCM setup functions into one pef2256_setup_gcm(). Update comments, avoid duplicates and change some conditionals. Remove the carrier spinlock and use atomic_t.
Make exported symbol consistent and use EXPORT_SYMBOL_GPL. Remove the no more needed pef2256_get_byphandle() and devm_pef2256_get_byphandle().
Replace the lantiq,sysclk-rate-hz property by sclkr and sclkx clocks. Move to MFD
- Patch 4
Remove, merged with patch 7
- Patch 4 (patch 5 in v2)
Update title and description.
Remove incorrect SPI reference.
Remove the 'lantiq,pef2256' phandle.
Fix commit log
- Patch 5 (patch 6 in v2)
Remove devm_pef2256_get_byphandle().
Fix commit log
- Patch 6 (patch 7 in v2)
Merge v2 patch 4. One entry only for PEF2256
Changes v1 -> v2
- Patch 2
Remove duplicate const qualifiers.
Add HAS_IOMEM as a dependency
- Patch 3
Fix a "Block quote ends without a blank line; unexpected unindent" syntax issue.
Herve Codina (7):
dt-bindings: mfd: Add the Lantiq PEF2256 E1/T1/J1 framer
mfd: core: Ensure disabled devices are skiped without aborting
mfd: Add support for the Lantiq PEF2256 framer
Documentation: sysfs: Document the Lantiq PEF2256 sysfs entry
pinctrl: Add support for the Lantic PEF2256 pinmux
ASoC: codecs: Add support for the Lantiq PEF2256 codec
MAINTAINERS: Add the Lantiq PEF2256 driver entry
.../sysfs-bus-platform-devices-pef2256 | 12 + .../bindings/mfd/lantiq,pef2256.yaml | 267 +++++ MAINTAINERS | 12 + drivers/mfd/Kconfig | 16 + drivers/mfd/Makefile | 1 + drivers/mfd/mfd-core.c | 18 +- drivers/mfd/pef2256-regs.h | 250 +++++ drivers/mfd/pef2256.c | 950 ++++++++++++++++++ drivers/pinctrl/Kconfig | 14 + drivers/pinctrl/Makefile | 1 + drivers/pinctrl/pinctrl-pef2256-regs.h | 65 ++ drivers/pinctrl/pinctrl-pef2256.c | 310 ++++++ include/linux/mfd/pef2256.h | 52 + sound/soc/codecs/Kconfig | 14 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/pef2256-codec.c | 390 +++++++ 16 files changed, 2369 insertions(+), 5 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-bus-platform-devices-pef2256 create mode 100644 Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml create mode 100644 drivers/mfd/pef2256-regs.h create mode 100644 drivers/mfd/pef2256.c create mode 100644 drivers/pinctrl/pinctrl-pef2256-regs.h create mode 100644 drivers/pinctrl/pinctrl-pef2256.c create mode 100644 include/linux/mfd/pef2256.h create mode 100644 sound/soc/codecs/pef2256-codec.c
Signature · 1 line
2.39.2
Herve Codina
maintainerPATCH v6 1/7 dt-bindings: mfd: Add the Lantiq PEF2256 E1/T1/J1 framer
The Lantiq PEF2256 is a framer and line interface component designed to fulfill all required interfacing between an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus.
--- .../bindings/mfd/lantiq,pef2256.yaml | 267 ++++++++++++++++++ 1 file changed, 267 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml
Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml new file +267 -0
@@ -0,0 +1,267 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/lantiq,pef2256.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Lantiq PEF2256 + +maintainers: + - Herve Codina <[email protected]> + +description: + The Lantiq PEF2256, also known as Infineon PEF2256 or FALC56, is a framer and + line interface component designed to fulfill all required interfacing between + an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus. + +properties: + compatible: + items: + - const: lantiq,pef2256 + - const: simple-mfd + + reg: + maxItems: 1 + + clocks: + items: + - description: Master clock + - description: Receive System Clock + - description: Transmit System Clock + + clock-names: + items: + - const: mclk + - const: sclkr + - const: sclkx + + interrupts: + maxItems: 1 + + reset-gpios: + description: + GPIO used to reset the device. + maxItems: 1 + + pinctrl: + $ref: /schemas/pinctrl/pinctrl.yaml# + additionalProperties: false + + patternProperties: + '-pins$': + type: object + $ref: /schemas/pinctrl/pincfg-node.yaml# + additionalProperties: false + + properties: + pins: + enum: [ RPA, RPB, RPC, RPD, XPA, XPB, XPC, XPD ] + + function: + enum: [ SYPR, RFM, RFMB, RSIGM, RSIG, DLR, FREEZE, RFSP, LOS, + SYPX, XFMS, XSIG, TCLK, XMFB, XSIGM, DLX, XCLK, XLT, + GPI, GPOH, GPOL ] + + required: + - pins + - function + + lantiq,line-interface: + $ref: /schemas/types.yaml#/definitions/string + enum: [e1, t1j1] + default: e1 + description: | + The line interface type + - e1: E1 line + - t1j1: T1/J1 line + + lantiq,frame-format: + $ref: /schemas/types.yaml#/definitions/string + description: + The line interface frame format. + + lantiq,data-rate-bps: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [2048000, 4096000, 8192000, 16384000] + default: 2048000 + description: + Data rate (bit per seconds) on the system highway. + + lantiq,clock-falling-edge: + $ref: /schemas/types.yaml#/definitions/flag + description: + Data is sent on falling edge of the clock (and received on the rising + edge). If 'clock-falling-edge' is not present, data is sent on the + rising edge (and received on the falling edge). + + lantiq,channel-phase: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1, 2, 3, 4, 5, 6, 7] + default: 0 + description: + The pef2256 delivers a full frame (32 8bit time-slots in E1 and 24 8bit + time-slots 8 8bit signaling in E1/J1) every 125us. This lead to a data + rate of 2048000 bit/s. When lantiq,data-rate-bps is more than 2048000 + bit/s, the data (all 32 8bit) present in the frame are interleave with + unused time-slots. The lantiq,channel-phase property allows to set the + correct alignment of the interleave mechanism. + For instance, suppose lantiq,data-rate-bps = 8192000 (ie 4*2048000), and + lantiq,channel-phase = 2, the interleave schema with unused time-slots + (nu) and used time-slots (XX) for TSi is + nu nu XX nu nu nu XX nu nu nu XX nu + <-- TSi --> <- TSi+1 -> <- TSi+2 -> + With lantiq,data-rate-bps = 8192000, and lantiq,channel-phase = 1, the + interleave schema is + nu XX nu nu nu XX nu nu nu XX nu nu + <-- TSi --> <- TSi+1 -> <- TSi+2 -> + With lantiq,data-rate-bps = 4096000 (ie 2*2048000), and + lantiq,channel-phase = 1, the interleave schema is + nu XX nu XX nu XX + <-- TSi --> <- TSi+1 -> <- TSi+2 -> + + lantiq,subordinate: + $ref: /schemas/types.yaml#/definitions/flag + description: + If present, the pef2256 works in subordinate mode. In this mode it + synchronizes on line interface clock signals. Otherwise, it synchronizes + on internal clocks. + +patternProperties: + '^codec(-([0-9]|[1-2][0-9]|3[0-1]))?$': + type: object + $ref: /schemas/sound/dai-common.yaml + unevaluatedProperties: false + description: + Codec provided by the pef2256. This codec allows to use some of the PCM + system highway time-slots as audio channels to transport audio data over + the E1/T1/J1 lines. + The time-slots used by the codec must be set and so, the properties + 'dai-tdm-slot-num', 'dai-tdm-slot-width', 'dai-tdm-slot-tx-mask' and + 'dai-tdm-slot-rx-mask' must be present in the sound card node for + sub-nodes that involve the codec. The codec uses 8bit time-slots. + 'dai-tdm-tdm-slot-with' must be set to 8. + The tx and rx masks define the pef2256 time-slots assigned to the codec. + + properties: + compatible: + const: lantiq,pef2256-codec + + '#sound-dai-cells': + const: 0 + + required: + - compatible + - '#sound-dai-cells' + +required: + - compatible + - reg + - clocks + - clock-names + - interrupts + +allOf: + - if: + properties: + lantiq,line-interface: + contains: + const: e1 + then: + properties: + lantiq,frame-format: + enum: [doubleframe, crc4-multiframe, auto-multiframe] + default: doubleframe + description: | + The E1 line interface frame format + - doubleframe: Doubleframe format + - crc4-multiframe: CRC4 multiframe format + - auto-multiframe: CRC4 multiframe format with interworking + capabilities (ITU-T G.706 Annex B) + + else: + # T1/J1 line + properties: + lantiq,frame-format: + enum: [4frame, 12frame, 24frame, 72frame] + default: 12frame + description: | + The T1/J1 line interface frame format + - 4frame: 4-frame multiframe format (F4) + - 12frame: 12-frame multiframe format (F12, D3/4) + - 24frame: 24-frame multiframe format (ESF) + - 72frame: 72-frame multiframe format (F72, remote switch mode) + +additionalProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + #include <dt-bindings/interrupt-controller/irq.h> + + framer@2000000 { + compatible = "lantiq,pef2256", "simple-mfd"; + reg = <0x2000000 0x100>; + interrupts = <8 IRQ_TYPE_LEVEL_LOW>; + interrupt-parent = <&intc>; + clocks = <&clk_mclk>, <&clk_sclkr>, <&clk_sclkx>; + clock-names = "mclk", "sclkr", "sclkx"; + reset-gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + lantiq,data-rate-bps = <4096000>; + + pinctrl { + pef2256_rpa_sypr: rpa-pins { + pins = "RPA"; + function = "SYPR"; + }; + pef2256_xpa_sypx: xpa-pins { + pins = "XPA"; + function = "SYPX"; + }; + }; + + pef2256_codec0: codec-0 { + compatible = "lantiq,pef2256-codec"; + #sound-dai-cells = <0>; + sound-name-prefix = "PEF2256_0"; + }; + + pef2256_codec1: codec-1 { + compatible = "lantiq,pef2256-codec"; + #sound-dai-cells = <0>; + sound-name-prefix = "PEF2256_1"; + }; + }; + + sound { + compatible = "simple-audio-card"; + #address-cells = <1>; + #size-cells = <0>; + simple-audio-card,dai-link@0 { /* CPU DAI1 - pef2256 codec 1 */ + reg = <0>; + cpu { + sound-dai = <&cpu_dai1>; + }; + codec { + sound-dai = <&pef2256_codec0>; + dai-tdm-slot-num = <4>; + dai-tdm-slot-width = <8>; + /* TS 1, 2, 3, 4 */ + dai-tdm-slot-tx-mask = <0 1 1 1 1>; + dai-tdm-slot-rx-mask = <0 1 1 1 1>; + }; + }; + simple-audio-card,dai-link@1 { /* CPU DAI2 - pef2256 codec 2 */ + reg = <1>; + cpu { + sound-dai = <&cpu_dai2>; + }; + codec { + sound-dai = <&pef2256_codec1>; + dai-tdm-slot-num = <4>; + dai-tdm-slot-width = <8>; + /* TS 5, 6, 7, 8 */ + dai-tdm-slot-tx-mask = <0 0 0 0 0 1 1 1 1>; + dai-tdm-slot-rx-mask = <0 0 0 0 0 1 1 1 1>; + }; + }; + };
Signature · 1 line
2.39.2
Herve Codina
maintainerPATCH v6 2/7 mfd: core: Ensure disabled devices are skiped without aborting
In reply to Herve CodinaThe loop searching for a matching device based on its compatible string is aborted when a matching disabled device is found. This abort avoid to add devices as soon as one disabled device is found.
Continue searching for an other device instead of aborting on the first disabled one fixes the issue.
--- drivers/mfd/mfd-core.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)
drivers/mfd/mfd-core.c +13 -5
@@ -176,6 +176,7 @@ static int mfd_add_device(struct device *parent, int id,struct platform_device *pdev;struct device_node *np =NULL ;struct mfd_of_node_entry *of_entry, *tmp; +bool not_available;int ret = -ENOMEM ;int platform_id;int r;
@@ -211,13 +212,13 @@ static int mfd_add_device(struct device *parent, int id, goto fail_res;if (IS_ENABLED (CONFIG_OF ) && parent->of_node && cell->of_compatible) { + not_available = false;for_each_child_of_node (parent->of_node, np) {if (of_device_is_compatible (np, cell->of_compatible)) { -/* Ignore 'disabled' devices error free */ +/* Skip 'disabled' devices */ if (!of_device_is_available (np)) { -of_node_put (np); - ret =0 ; - goto fail_alias; + not_available = true; +continue ; } ret =mfd_match_of_node_to_dev (pdev, np, cell);
@@ -227,10 +228,17 @@ static int mfd_add_device(struct device *parent, int id,if (ret) goto fail_alias; -break ; + goto match; } } +if (not_available) { +/* Ignore 'disabled' devices error free */ + ret =0 ; + goto fail_alias; + } + +match:if (!pdev->dev.of_node)pr_warn ("%s: Failed to locate of_node [id: %d]\n" , cell->name, platform_id);
Signature · 1 line
2.39.2
Lee Jones
maintainerRe: [PATCH v6 2/7] mfd: core: Ensure disabled devices are skiped without aborting
Quoted 27 lines · Herve Codina
The loop searching for a matching device based on its compatible string is aborted when a matching disabled device is found. This abort avoid to add devices as soon as one disabled device is found.
Continue searching for an other device instead of aborting on the first disabled one fixes the issue.
Fixes 22380b65dc70 ("mfd: mfd-core: Ensure disabled devices are ignored without error")Signed-off-by Herve Codina <[email protected]>--- drivers/mfd/mfd-core.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)drivers/mfd/mfd-core.c +1
-0@@ -176,6 +176,7 @@ static int mfd_add_device(struct device *parent, int id,struct platform_device *pdev;struct device_node *np =NULL ;struct mfd_of_node_entry *of_entry, *tmp; +bool not_available;int ret = -ENOMEM ;int platform_id;int r;
drivers/mfd/mfd-core.c static int mfd_add_device(struct device *parent, int id, · line 215
Quoted 4 lines
drivers/mfd/mfd-core.c +1
-0@@ -211,13 +212,13 @@ static int mfd_add_device(struct device *parent, int id, goto fail_res;if (IS_ENABLED (CONFIG_OF ) && parent->of_node && cell->of_compatible) { + not_available = false;
Why not do:
bool disabled = false;
... here instead?
drivers/mfd/mfd-core.c static int mfd_add_device(struct device *parent, int id, · line 218
Quoted 6 lines
drivers/mfd/mfd-core.c +1
-2for_each_child_of_node (parent->of_node, np) {if (of_device_is_compatible (np, cell->of_compatible)) { -/* Ignore 'disabled' devices error free */ +/* Skip 'disabled' devices */ if (!of_device_is_available (np)) { -of_node_put (np);
Why are you removing the put?
Quoted 29 lines
drivers/mfd/mfd-core.c +10
-3- ret =0 ; - goto fail_alias; + not_available = true; +continue ; } ret =mfd_match_of_node_to_dev (pdev, np, cell);@@ -227,10 +228,17 @@ static int mfd_add_device(struct device *parent, int id,if (ret) goto fail_alias; -break ; + goto match; } } +if (not_available) { +/* Ignore 'disabled' devices error free */ + ret =0 ; + goto fail_alias; + } + +match:if (!pdev->dev.of_node)pr_warn ("%s: Failed to locate of_node [id: %d]\n" , cell->name, platform_id);Signature · 1 line
2.39.2
Signature · 1 line
Lee Jones [李琼斯]
Herve Codina
maintainerRe: [PATCH v6 2/7] mfd: core: Ensure disabled devices are skiped without aborting
Quoted 31 lines · On Thu, 20 Apr 2023 13:29:55 +0100 Lee Jones <[email protected]> wrote:
Quoted 29 lines · Herve Codina
The loop searching for a matching device based on its compatible string is aborted when a matching disabled device is found. This abort avoid to add devices as soon as one disabled device is found.
Continue searching for an other device instead of aborting on the first disabled one fixes the issue.
Fixes 22380b65dc70 ("mfd: mfd-core: Ensure disabled devices are ignored without error")Signed-off-by Herve Codina <[email protected]>--- drivers/mfd/mfd-core.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)drivers/mfd/mfd-core.c +1
-0@@ -176,6 +176,7 @@ static int mfd_add_device(struct device *parent, int id,struct platform_device *pdev;struct device_node *np =NULL ;struct mfd_of_node_entry *of_entry, *tmp; +bool not_available;int ret = -ENOMEM ;int platform_id;int r;@@ -211,13 +212,13 @@ static int mfd_add_device(struct device *parent, int id, goto fail_res;
Quoted 8 lines
drivers/mfd/mfd-core.c static int mfd_add_device(struct device *parent, int id, · line 215
Quoted 2 lines
drivers/mfd/mfd-core.c +1
-0if (IS_ENABLED (CONFIG_OF ) && parent->of_node && cell->of_compatible) { + not_available = false;Why not do:
bool disabled = false;... here instead?
Yes, I can change to 'disabled'.
Quoted 9 lines
drivers/mfd/mfd-core.c static int mfd_add_device(struct device *parent, int id, · line 218
Quoted 7 lines
drivers/mfd/mfd-core.c +1
-2for_each_child_of_node (parent->of_node, np) {if (of_device_is_compatible (np, cell->of_compatible)) { -/* Ignore 'disabled' devices error free */ +/* Skip 'disabled' devices */ if (!of_device_is_available (np)) { -of_node_put (np);Why are you removing the put?
The of_node_put() is done internally by for_each_child_of_node() calling of_get_next_child().
As the for_each_child_of_node() loop is not break, the of_node_put() must not be called here as it will be called by of_get_next_child().
Quoted 17 lines
Quoted 17 lines
drivers/mfd/mfd-core.c +3
-3- ret =0 ; - goto fail_alias; + not_available = true; +continue ; } ret =mfd_match_of_node_to_dev (pdev, np, cell);@@ -227,10 +228,17 @@ static int mfd_add_device(struct device *parent, int id,if (ret) goto fail_alias; -break ; + goto match; } }
Quoted 14 lines
Quoted 13 lines
drivers/mfd/mfd-core.c +7
-0+if (not_available) { +/* Ignore 'disabled' devices error free */ + ret =0 ; + goto fail_alias; + } + +match:if (!pdev->dev.of_node)pr_warn ("%s: Failed to locate of_node [id: %d]\n" , cell->name, platform_id);Signature · 1 line
2.39.2
Best regards,
Hervé
Re: [PATCH v6 2/7] mfd: core: Ensure disabled devices are skiped without aborting
In reply to Lee JonesQuoted 31 lines · On Thu, 20 Apr 2023 13:29:55 +0100 Lee Jones <[email protected]> wrote:
Quoted 29 lines · Herve Codina
The loop searching for a matching device based on its compatible string is aborted when a matching disabled device is found. This abort avoid to add devices as soon as one disabled device is found.
Continue searching for an other device instead of aborting on the first disabled one fixes the issue.
Fixes 22380b65dc70 ("mfd: mfd-core: Ensure disabled devices are ignored without error")Signed-off-by Herve Codina <[email protected]>--- drivers/mfd/mfd-core.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)drivers/mfd/mfd-core.c +1
-0@@ -176,6 +176,7 @@ static int mfd_add_device(struct device *parent, int id,struct platform_device *pdev;struct device_node *np =NULL ;struct mfd_of_node_entry *of_entry, *tmp; +bool not_available;int ret = -ENOMEM ;int platform_id;int r;@@ -211,13 +212,13 @@ static int mfd_add_device(struct device *parent, int id, goto fail_res;
Quoted 8 lines
drivers/mfd/mfd-core.c static int mfd_add_device(struct device *parent, int id, · line 215
Quoted 2 lines
drivers/mfd/mfd-core.c +1
-0if (IS_ENABLED (CONFIG_OF ) && parent->of_node && cell->of_compatible) { + not_available = false;Why not do:
bool disabled = false;... here instead?
Yes, I can change to 'disabled'.
Quoted 9 lines
drivers/mfd/mfd-core.c static int mfd_add_device(struct device *parent, int id, · line 218
Quoted 7 lines
drivers/mfd/mfd-core.c +1
-2for_each_child_of_node (parent->of_node, np) {if (of_device_is_compatible (np, cell->of_compatible)) { -/* Ignore 'disabled' devices error free */ +/* Skip 'disabled' devices */ if (!of_device_is_available (np)) { -of_node_put (np);Why are you removing the put?
The of_node_put() is done internally by for_each_child_of_node() calling of_get_next_child().
As the for_each_child_of_node() loop is not break, the of_node_put() must not be called here as it will be called by of_get_next_child().
Quoted 17 lines
Quoted 17 lines
drivers/mfd/mfd-core.c +3
-3- ret =0 ; - goto fail_alias; + not_available = true; +continue ; } ret =mfd_match_of_node_to_dev (pdev, np, cell);@@ -227,10 +228,17 @@ static int mfd_add_device(struct device *parent, int id,if (ret) goto fail_alias; -break ; + goto match; } }
Quoted 14 lines
Quoted 13 lines
drivers/mfd/mfd-core.c +7
-0+if (not_available) { +/* Ignore 'disabled' devices error free */ + ret =0 ; + goto fail_alias; + } + +match:if (!pdev->dev.of_node)pr_warn ("%s: Failed to locate of_node [id: %d]\n" , cell->name, platform_id);Signature · 1 line
2.39.2
Best regards,
Hervé
Herve Codina
maintainerPATCH v6 3/7 mfd: Add support for the Lantiq PEF2256 framer
In reply to Herve CodinaThe Lantiq PEF2256 is a framer and line interface component designed to fulfill all required interfacing between an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus.
--- drivers/mfd/Kconfig | 16 + drivers/mfd/Makefile | 1 + drivers/mfd/pef2256-regs.h | 250 ++++++++++ drivers/mfd/pef2256.c | 950 ++++++++++++++++++++++++++++++++++++ include/linux/mfd/pef2256.h | 52 ++ 5 files changed, 1269 insertions(+) create mode 100644 drivers/mfd/pef2256-regs.h create mode 100644 drivers/mfd/pef2256.c create mode 100644 include/linux/mfd/pef2256.h
drivers/mfd/Kconfig +16 -0
@@ -1063,6 +1063,22 @@ config PCF50633_GPIO Say yes here if you want to include support GPIO for pins on the PCF50633 chip. +config MFD_PEF2256 + tristate "Lantiq PEF2256 (FALC56) framer" + depends on OF + select MFD_CORE + select REGMAP_MMIO + help + This option enables support for the Lantiq PEF2256 framer, also known + as FALC56. This framer and its line interface component is designed + to fulfill all required interfacing between analog E1/T1/J1 lines and + the digital PCM system highway. + + If unsure, say N. + + To compile this driver as a module, choose M here: the + module will be called pef2256. + config MFD_PM8XXX tristate "Qualcomm PM8xxx PMIC chips driver" depends on (ARM || HEXAGON || COMPILE_TEST)
drivers/mfd/Makefile +1 -0
@@ -195,6 +195,7 @@ obj-$(CONFIG_MFD_SI476X_CORE) += si476x-core.o obj-$(CONFIG_MFD_CS5535) += cs5535-mfd.o obj-$(CONFIG_MFD_OMAP_USB_HOST) += omap-usb-host.o omap-usb-tll.o +obj-$(CONFIG_MFD_PEF2256) += pef2256.o obj-$(CONFIG_MFD_PM8XXX) += qcom-pm8xxx.o ssbi.o obj-$(CONFIG_MFD_QCOM_RPM) += qcom_rpm.o obj-$(CONFIG_MFD_SPMI_PMIC) += qcom-spmi-pmic.o
drivers/mfd/pef2256-regs.h new file +250 -0
250 lines not on this page · raw message
drivers/mfd/pef2256.c new file +950 -0
950 lines not on this page · raw message
include/linux/mfd/pef2256.h new file +52 -0
52 lines not on this page · raw message
Signature · 1 line
2.39.2
Lee Jones
maintainerRe: [PATCH v6 3/7] mfd: Add support for the Lantiq PEF2256 framer
Quoted 10 lines · Herve Codina
The Lantiq PEF2256 is a framer and line interface component designed to fulfill all required interfacing between an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus.
Signed-off-by Herve Codina <[email protected]>--- drivers/mfd/Kconfig | 16 + drivers/mfd/Makefile | 1 + drivers/mfd/pef2256-regs.h | 250 ++++++++++ drivers/mfd/pef2256.c | 950 ++++++++++++++++++++++++++++++++++++
95% of this driver needs to be moved somewhere else.
What is a Framer? Perhaps sound/ is a good candidate?
Quoted 5 lines
include/linux/mfd/pef2256.h | 52 ++ 5 files changed, 1269 insertions(+) create mode 100644 drivers/mfd/pef2256-regs.h create mode 100644 drivers/mfd/pef2256.c create mode 100644 include/linux/mfd/pef2256.h
[...]
drivers/mfd/pef2256.c line 728
Quoted 13 lines
drivers/mfd/pef2256.c new file +13
-0+static int pef2256_add_audio_devices (struct pef2256 *pef2256) +{ +const char *compatible ="lantiq,pef2256-codec" ; +struct mfd_cell *audio_devs; +struct device_node *np; +unsigned int count =0 ; +unsigned int i; +int ret; + +for_each_available_child_of_node (pef2256->dev->of_node, np) { +if (of_device_is_compatible (np, compatible)) + count++; + }
Converting Device Tree nodes into MFD cells to register with the Platform Device API is not a reasonable use-case of MFD.
Have the CODEC driver match on "lantiq,pef2256-codec" and let it instantiate itself.
Your first version using of_platform_populate() was closer to the mark.
Quoted 17 lines
drivers/mfd/pef2256.c new file +17
-0+if (!count) +return 0 ; + + audio_devs =kcalloc (count,sizeof (*audio_devs),GFP_KERNEL ); +if (!audio_devs) +return -ENOMEM ; + +for (i =0 ; i < count; i++) { + (audio_devs + i)->name ="lantiq-pef2256-codec" ; + (audio_devs + i)->of_compatible = compatible; + (audio_devs + i)->id = i; + } + + ret =mfd_add_devices (pef2256->dev,0 , audio_devs, count,NULL ,0 ,NULL ); +kfree (audio_devs); +return ret; +}
Signature · 1 line
Lee Jones [李琼斯]
Herve Codina
maintainerRe: [PATCH v6 3/7] mfd: Add support for the Lantiq PEF2256 framer
Quoted 13 lines · On Thu, 20 Apr 2023 13:39:46 +0100 Lee Jones <[email protected]> wrote:
Quoted 10 lines · Herve Codina
The Lantiq PEF2256 is a framer and line interface component designed to fulfill all required interfacing between an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus.
Signed-off-by Herve Codina <[email protected]>--- drivers/mfd/Kconfig | 16 + drivers/mfd/Makefile | 1 + drivers/mfd/pef2256-regs.h | 250 ++++++++++ drivers/mfd/pef2256.c | 950 ++++++++++++++++++++++++++++++++++++
Quoted 3 lines
95% of this driver needs to be moved somewhere else.
What is a Framer? Perhaps
sound/is a good candidate?
The pef2256 framer is a device that transfers data to/from a TDM (time-slots data) from/to quite old telecommunication lines (E1 in my case). Several subsystem can set/get data to/from the TDM. Each device using their own time-slots set.
On my use-case, I have some audio consumer and a not yet upstreamed HDLC consumer. Both of them uses the framer to know the E1 link state. The framer needs to be initialized 'globally' and not by a specific consumer as several consumers can use the framer.
Quoted 26 lines
Quoted 6 lines
include/linux/mfd/pef2256.h | 52 ++ 5 files changed, 1269 insertions(+) create mode 100644 drivers/mfd/pef2256-regs.h create mode 100644 drivers/mfd/pef2256.c create mode 100644 include/linux/mfd/pef2256.h[...]
drivers/mfd/pef2256.c line 728
Quoted 13 lines
drivers/mfd/pef2256.c new file +13
-0+static int pef2256_add_audio_devices (struct pef2256 *pef2256) +{ +const char *compatible ="lantiq,pef2256-codec" ; +struct mfd_cell *audio_devs; +struct device_node *np; +unsigned int count =0 ; +unsigned int i; +int ret; + +for_each_available_child_of_node (pef2256->dev->of_node, np) { +if (of_device_is_compatible (np, compatible)) + count++; + }Converting Device Tree nodes into MFD cells to register with the Platform Device API is not a reasonable use-case of MFD.
Quoted 2 lines
Have the CODEC driver match on "lantiq,pef2256-codec" and let it instantiate itself.
As the framer is going to used by several subsystem, I cannot instantiate it in the specific ASoC subsystem.
Quoted 2 lines
Your first version using
of_platform_populate()was closer to the mark.
The issue was that I need MFD cells for the pinctrl part.
Quoted 10 lines
Quoted 10 lines
drivers/mfd/pef2256.c new file +9
-0+if (!count) +return 0 ; + + audio_devs =kcalloc (count,sizeof (*audio_devs),GFP_KERNEL ); +if (!audio_devs) +return -ENOMEM ; + +for (i =0 ; i < count; i++) { + (audio_devs + i)->name ="lantiq-pef2256-codec" ;
Quoted 9 lines
drivers/mfd/pef2256.c line 746
Quoted 8 lines
drivers/mfd/pef2256.c new file +8
-0+ (audio_devs + i)->of_compatible = compatible; + (audio_devs + i)->id = i; + } + + ret =mfd_add_devices (pef2256->dev,0 , audio_devs, count,NULL ,0 ,NULL ); +kfree (audio_devs); +return ret; +}
Best regards,
Hervé
Signature · 3 lines
Hervé Codina, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Lee Jones
maintainerRe: [PATCH v6 3/7] mfd: Add support for the Lantiq PEF2256 framer
Quoted 25 lines · Herve Codina
Quoted 13 lines · On Thu, 20 Apr 2023 13:39:46 +0100 Lee Jones <[email protected]> wrote:
Quoted 10 lines · Herve Codina
The Lantiq PEF2256 is a framer and line interface component designed to fulfill all required interfacing between an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus.
Signed-off-by Herve Codina <[email protected]>--- drivers/mfd/Kconfig | 16 + drivers/mfd/Makefile | 1 + drivers/mfd/pef2256-regs.h | 250 ++++++++++ drivers/mfd/pef2256.c | 950 ++++++++++++++++++++++++++++++++++++Quoted 3 lines
95% of this driver needs to be moved somewhere else.
What is a Framer? Perhaps
sound/is a good candidate?The pef2256 framer is a device that transfers data to/from a TDM (time-slots data) from/to quite old telecommunication lines (E1 in my case). Several subsystem can set/get data to/from the TDM. Each device using their own time-slots set.
Quoted 4 lines
On my use-case, I have some audio consumer and a not yet upstreamed HDLC consumer. Both of them uses the framer to know the E1 link state. The framer needs to be initialized 'globally' and not by a specific consumer as several consumers can use the framer.
I can't think of a good place for this.
If all else fails, it's drivers/misc
Quoted 28 lines
Quoted 25 lines
Quoted 5 lines
include/linux/mfd/pef2256.h | 52 ++ 5 files changed, 1269 insertions(+) create mode 100644 drivers/mfd/pef2256-regs.h create mode 100644 drivers/mfd/pef2256.c create mode 100644 include/linux/mfd/pef2256.h[...]
drivers/mfd/pef2256.c line 728
Quoted 13 lines
drivers/mfd/pef2256.c new file +13
-0+static int pef2256_add_audio_devices (struct pef2256 *pef2256) +{ +const char *compatible ="lantiq,pef2256-codec" ; +struct mfd_cell *audio_devs; +struct device_node *np; +unsigned int count =0 ; +unsigned int i; +int ret; + +for_each_available_child_of_node (pef2256->dev->of_node, np) { +if (of_device_is_compatible (np, compatible)) + count++; + }Converting Device Tree nodes into MFD cells to register with the Platform Device API is not a reasonable use-case of MFD.
Quoted 2 lines
Have the CODEC driver match on "lantiq,pef2256-codec" and let it instantiate itself.
Quoted 7 lines
As the framer is going to used by several subsystem, I cannot instantiate it in the specific ASoC subsystem.
Quoted 2 lines
Your first version using
of_platform_populate()was closer to the mark.The issue was that I need MFD cells for the pinctrl part.
Why can't it be represented in DT?
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
drivers/mfd/pef2256.c new file +17
-0+if (!count) +return 0 ; + + audio_devs =kcalloc (count,sizeof (*audio_devs),GFP_KERNEL ); +if (!audio_devs) +return -ENOMEM ; + +for (i =0 ; i < count; i++) { + (audio_devs + i)->name ="lantiq-pef2256-codec" ; + (audio_devs + i)->of_compatible = compatible; + (audio_devs + i)->id = i; + } + + ret =mfd_add_devices (pef2256->dev,0 , audio_devs, count,NULL ,0 ,NULL ); +kfree (audio_devs); +return ret; +}
Signature · 1 line
Lee Jones [李琼斯]
Herve Codina
maintainerRe: [PATCH v6 3/7] mfd: Add support for the Lantiq PEF2256 framer
Hi Lee, Krzysztof,
Quoted 68 lines · On Thu, 20 Apr 2023 14:47:03 +0100 Lee Jones <[email protected]> wrote:
Quoted 25 lines · Herve Codina
Quoted 13 lines · On Thu, 20 Apr 2023 13:39:46 +0100 Lee Jones <[email protected]> wrote:
Quoted 10 lines · Herve Codina
The Lantiq PEF2256 is a framer and line interface component designed to fulfill all required interfacing between an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus.
Signed-off-by Herve Codina <[email protected]>--- drivers/mfd/Kconfig | 16 + drivers/mfd/Makefile | 1 + drivers/mfd/pef2256-regs.h | 250 ++++++++++ drivers/mfd/pef2256.c | 950 ++++++++++++++++++++++++++++++++++++Quoted 3 lines
95% of this driver needs to be moved somewhere else.
What is a Framer? Perhaps
sound/is a good candidate?The pef2256 framer is a device that transfers data to/from a TDM (time-slots data) from/to quite old telecommunication lines (E1 in my case). Several subsystem can set/get data to/from the TDM. Each device using their own time-slots set.
Quoted 4 lines
On my use-case, I have some audio consumer and a not yet upstreamed HDLC consumer. Both of them uses the framer to know the E1 link state. The framer needs to be initialized 'globally' and not by a specific consumer as several consumers can use the framer.
I can't think of a good place for this.
If all else fails, it's
drivers/miscQuoted 32 lines
Quoted 25 lines
Quoted 5 lines
include/linux/mfd/pef2256.h | 52 ++ 5 files changed, 1269 insertions(+) create mode 100644 drivers/mfd/pef2256-regs.h create mode 100644 drivers/mfd/pef2256.c create mode 100644 include/linux/mfd/pef2256.h[...]
drivers/mfd/pef2256.c line 728
Quoted 13 lines
drivers/mfd/pef2256.c new file +13
-0+static int pef2256_add_audio_devices (struct pef2256 *pef2256) +{ +const char *compatible ="lantiq,pef2256-codec" ; +struct mfd_cell *audio_devs; +struct device_node *np; +unsigned int count =0 ; +unsigned int i; +int ret; + +for_each_available_child_of_node (pef2256->dev->of_node, np) { +if (of_device_is_compatible (np, compatible)) + count++; + }Converting Device Tree nodes into MFD cells to register with the Platform Device API is not a reasonable use-case of MFD.
Quoted 2 lines
Have the CODEC driver match on "lantiq,pef2256-codec" and let it instantiate itself.
As the framer is going to used by several subsystem, I cannot instantiate it in the specific ASoC subsystem.
Quoted 1 line
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Your first version using
of_platform_populate()was closer to the mark.The issue was that I need MFD cells for the pinctrl part.
Why can't it be represented in DT?
The pinctrl part has no specific compatible string.
Not sure that a compatible string for pinctrl can be accepted as there is only one pinctrl subnode and no specific reg for this subnode.
The DT looks like this:
framer@2000000 {
compatible = "lantiq,pef2256";
reg = <0x2000000 0x100>;
...
pinctrl {
pef2256_rpa_sypr: rpa-pins {
pins = "RPA";
function = "SYPR";
};
};
pef2256_codec0: codec-0 {
compatible = "lantiq,pef2256-codec";
#sound-dai-cells = <0>;
sound-name-prefix = "PEF2256_0";
};
};Krzysztof, is it acceptable to have a compatible string in the pinctrl node ? In this case, it will looks like this:
framer@2000000 {
compatible = "lantiq,pef2256";
reg = <0x2000000 0x100>;
...
pinctrl {
compatible = "lantiq,pef2256-pinctrl";
pef2256_rpa_sypr: rpa-pins {
pins = "RPA";
function = "SYPR";
};
};
pef2256_codec0: codec-0 {
compatible = "lantiq,pef2256-codec";
#sound-dai-cells = <0>;
sound-name-prefix = "PEF2256_0";
};
};Best regards,
Hervé
Lee Jones
maintainerRe: [PATCH v6 3/7] mfd: Add support for the Lantiq PEF2256 framer
Quoted 103 lines · Herve Codina
Hi Lee, Krzysztof,
Quoted 68 lines · On Thu, 20 Apr 2023 14:47:03 +0100 Lee Jones <[email protected]> wrote:
Quoted 25 lines · Herve Codina
Quoted 13 lines · On Thu, 20 Apr 2023 13:39:46 +0100 Lee Jones <[email protected]> wrote:
Quoted 10 lines · Herve Codina
The Lantiq PEF2256 is a framer and line interface component designed to fulfill all required interfacing between an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus.
Signed-off-by Herve Codina <[email protected]>--- drivers/mfd/Kconfig | 16 + drivers/mfd/Makefile | 1 + drivers/mfd/pef2256-regs.h | 250 ++++++++++ drivers/mfd/pef2256.c | 950 ++++++++++++++++++++++++++++++++++++Quoted 3 lines
95% of this driver needs to be moved somewhere else.
What is a Framer? Perhaps
sound/is a good candidate?The pef2256 framer is a device that transfers data to/from a TDM (time-slots data) from/to quite old telecommunication lines (E1 in my case). Several subsystem can set/get data to/from the TDM. Each device using their own time-slots set.
Quoted 4 lines
On my use-case, I have some audio consumer and a not yet upstreamed HDLC consumer. Both of them uses the framer to know the E1 link state. The framer needs to be initialized 'globally' and not by a specific consumer as several consumers can use the framer.
I can't think of a good place for this.
If all else fails, it's
drivers/miscQuoted 32 lines
Quoted 25 lines
Quoted 5 lines
include/linux/mfd/pef2256.h | 52 ++ 5 files changed, 1269 insertions(+) create mode 100644 drivers/mfd/pef2256-regs.h create mode 100644 drivers/mfd/pef2256.c create mode 100644 include/linux/mfd/pef2256.h[...]
drivers/mfd/pef2256.c line 728
Quoted 13 lines
drivers/mfd/pef2256.c new file +13
-0+static int pef2256_add_audio_devices (struct pef2256 *pef2256) +{ +const char *compatible ="lantiq,pef2256-codec" ; +struct mfd_cell *audio_devs; +struct device_node *np; +unsigned int count =0 ; +unsigned int i; +int ret; + +for_each_available_child_of_node (pef2256->dev->of_node, np) { +if (of_device_is_compatible (np, compatible)) + count++; + }Converting Device Tree nodes into MFD cells to register with the Platform Device API is not a reasonable use-case of MFD.
Quoted 2 lines
Have the CODEC driver match on "lantiq,pef2256-codec" and let it instantiate itself.
As the framer is going to used by several subsystem, I cannot instantiate it in the specific ASoC subsystem.
Quoted 1 line
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Your first version using
of_platform_populate()was closer to the mark.The issue was that I need MFD cells for the pinctrl part.
Why can't it be represented in DT?
The pinctrl part has no specific compatible string.
Not sure that a compatible string for pinctrl can be accepted as there is only one pinctrl subnode and no specific reg for this subnode.The DT looks like this:
framer@2000000 { compatible = "lantiq,pef2256"; reg = <0x2000000 0x100>; ... pinctrl { pef2256_rpa_sypr: rpa-pins { pins = "RPA"; function = "SYPR"; }; }; pef2256_codec0: codec-0 { compatible = "lantiq,pef2256-codec"; #sound-dai-cells = <0>; sound-name-prefix = "PEF2256_0"; }; };
Quoted 1 line
Krzysztof, is it acceptable to have a compatible string in the pinctrl node ?
Why wouldn't it be?
$ git grep ".compatible" -- drivers/pinctrl/
Quoted 22 lines
In this case, it will looks like this:
framer@2000000 { compatible = "lantiq,pef2256"; reg = <0x2000000 0x100>; ... pinctrl { compatible = "lantiq,pef2256-pinctrl"; pef2256_rpa_sypr: rpa-pins { pins = "RPA"; function = "SYPR"; }; }; pef2256_codec0: codec-0 { compatible = "lantiq,pef2256-codec"; #sound-dai-cells = <0>; sound-name-prefix = "PEF2256_0"; }; };Best regards,
Hervé
Signature · 1 line
Lee Jones [李琼斯]
Re: [PATCH v6 3/7] mfd: Add support for the Lantiq PEF2256 framer
Quoted 105 lines · Lee Jones
Quoted 103 lines · Herve Codina
Hi Lee, Krzysztof,
Quoted 68 lines · On Thu, 20 Apr 2023 14:47:03 +0100 Lee Jones <[email protected]> wrote:
Quoted 25 lines · Herve Codina
Quoted 13 lines · On Thu, 20 Apr 2023 13:39:46 +0100 Lee Jones <[email protected]> wrote:
Quoted 10 lines · Herve Codina
The Lantiq PEF2256 is a framer and line interface component designed to fulfill all required interfacing between an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus.
Signed-off-by Herve Codina <[email protected]>--- drivers/mfd/Kconfig | 16 + drivers/mfd/Makefile | 1 + drivers/mfd/pef2256-regs.h | 250 ++++++++++ drivers/mfd/pef2256.c | 950 ++++++++++++++++++++++++++++++++++++Quoted 3 lines
95% of this driver needs to be moved somewhere else.
What is a Framer? Perhaps
sound/is a good candidate?The pef2256 framer is a device that transfers data to/from a TDM (time-slots data) from/to quite old telecommunication lines (E1 in my case). Several subsystem can set/get data to/from the TDM. Each device using their own time-slots set.
Quoted 4 lines
On my use-case, I have some audio consumer and a not yet upstreamed HDLC consumer. Both of them uses the framer to know the E1 link state. The framer needs to be initialized 'globally' and not by a specific consumer as several consumers can use the framer.
I can't think of a good place for this.
If all else fails, it's
drivers/miscQuoted 32 lines
Quoted 25 lines
Quoted 5 lines
include/linux/mfd/pef2256.h | 52 ++ 5 files changed, 1269 insertions(+) create mode 100644 drivers/mfd/pef2256-regs.h create mode 100644 drivers/mfd/pef2256.c create mode 100644 include/linux/mfd/pef2256.h[...]
drivers/mfd/pef2256.c line 728
Quoted 13 lines
drivers/mfd/pef2256.c new file +13
-0+static int pef2256_add_audio_devices (struct pef2256 *pef2256) +{ +const char *compatible ="lantiq,pef2256-codec" ; +struct mfd_cell *audio_devs; +struct device_node *np; +unsigned int count =0 ; +unsigned int i; +int ret; + +for_each_available_child_of_node (pef2256->dev->of_node, np) { +if (of_device_is_compatible (np, compatible)) + count++; + }Converting Device Tree nodes into MFD cells to register with the Platform Device API is not a reasonable use-case of MFD.
Quoted 2 lines
Have the CODEC driver match on "lantiq,pef2256-codec" and let it instantiate itself.
As the framer is going to used by several subsystem, I cannot instantiate it in the specific ASoC subsystem.
Quoted 1 line
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Your first version using
of_platform_populate()was closer to the mark.The issue was that I need MFD cells for the pinctrl part.
Why can't it be represented in DT?
The pinctrl part has no specific compatible string.
Not sure that a compatible string for pinctrl can be accepted as there is only one pinctrl subnode and no specific reg for this subnode.The DT looks like this:
framer@2000000 { compatible = "lantiq,pef2256"; reg = <0x2000000 0x100>; ... pinctrl { pef2256_rpa_sypr: rpa-pins { pins = "RPA"; function = "SYPR"; }; }; pef2256_codec0: codec-0 { compatible = "lantiq,pef2256-codec"; #sound-dai-cells = <0>; sound-name-prefix = "PEF2256_0"; }; };
Quoted 13 lines
Quoted 1 line
Krzysztof, is it acceptable to have a compatible string in the pinctrl node ?
Why wouldn't it be?
$ git grep ".compatible" -- drivers/pinctrl/Quoted 7 lines
In this case, it will looks like this:
framer@2000000 { compatible = "lantiq,pef2256"; reg = <0x2000000 0x100>; ... pinctrl { compatible = "lantiq,pef2256-pinctrl";
If you do not have any resources, there is no point in having separate compatible for separate device node.
Anyway this discussions should not be about DT. How Linux drivers are implementing DT is not really a guide how to write DT. Since these series were brought there were some DT decisions made based how you want to write the driver. No, please don't. I also do not see any problems in handling more-or-less complex driver structures without poking the DT. We have already many such device families.
Best regards,
Krzysztof
Lee Jones
maintainerRe: [PATCH v6 3/7] mfd: Add support for the Lantiq PEF2256 framer
Quoted 120 lines · Krzysztof Kozlowski
Quoted 105 lines · Lee Jones
Quoted 103 lines · Herve Codina
Hi Lee, Krzysztof,
Quoted 68 lines · On Thu, 20 Apr 2023 14:47:03 +0100 Lee Jones <[email protected]> wrote:
Quoted 25 lines · Herve Codina
Quoted 13 lines · On Thu, 20 Apr 2023 13:39:46 +0100 Lee Jones <[email protected]> wrote:
Quoted 10 lines · Herve Codina
The Lantiq PEF2256 is a framer and line interface component designed to fulfill all required interfacing between an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus.
Signed-off-by Herve Codina <[email protected]>--- drivers/mfd/Kconfig | 16 + drivers/mfd/Makefile | 1 + drivers/mfd/pef2256-regs.h | 250 ++++++++++ drivers/mfd/pef2256.c | 950 ++++++++++++++++++++++++++++++++++++Quoted 3 lines
95% of this driver needs to be moved somewhere else.
What is a Framer? Perhaps
sound/is a good candidate?The pef2256 framer is a device that transfers data to/from a TDM (time-slots data) from/to quite old telecommunication lines (E1 in my case). Several subsystem can set/get data to/from the TDM. Each device using their own time-slots set.
Quoted 4 lines
On my use-case, I have some audio consumer and a not yet upstreamed HDLC consumer. Both of them uses the framer to know the E1 link state. The framer needs to be initialized 'globally' and not by a specific consumer as several consumers can use the framer.
I can't think of a good place for this.
If all else fails, it's
drivers/miscQuoted 32 lines
Quoted 25 lines
Quoted 5 lines
include/linux/mfd/pef2256.h | 52 ++ 5 files changed, 1269 insertions(+) create mode 100644 drivers/mfd/pef2256-regs.h create mode 100644 drivers/mfd/pef2256.c create mode 100644 include/linux/mfd/pef2256.h[...]
Review
Quoted 13 lines
(quoted diff) +13
-0+static int pef2256_add_audio_devices(struct pef2256 *pef2256) +{ + const char *compatible = "lantiq,pef2256-codec"; + struct mfd_cell *audio_devs; + struct device_node *np; + unsigned int count = 0; + unsigned int i; + int ret; + + for_each_available_child_of_node(pef2256->dev->of_node, np) { + if (of_device_is_compatible(np, compatible)) + count++; + }Converting Device Tree nodes into MFD cells to register with the Platform Device API is not a reasonable use-case of MFD.
Quoted 2 lines
Have the CODEC driver match on "lantiq,pef2256-codec" and let it instantiate itself.
As the framer is going to used by several subsystem, I cannot instantiate it in the specific ASoC subsystem.
Quoted 1 line
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Your first version using
of_platform_populate()was closer to the mark.The issue was that I need MFD cells for the pinctrl part.
Why can't it be represented in DT?
The pinctrl part has no specific compatible string.
Not sure that a compatible string for pinctrl can be accepted as there is only one pinctrl subnode and no specific reg for this subnode.The DT looks like this:
framer@2000000 { compatible = "lantiq,pef2256"; reg = <0x2000000 0x100>; ... pinctrl { pef2256_rpa_sypr: rpa-pins { pins = "RPA"; function = "SYPR"; }; }; pef2256_codec0: codec-0 { compatible = "lantiq,pef2256-codec"; #sound-dai-cells = <0>; sound-name-prefix = "PEF2256_0"; }; };Quoted 13 lines
Quoted 1 line
Krzysztof, is it acceptable to have a compatible string in the pinctrl node ?
Why wouldn't it be?
$ git grep ".compatible" -- drivers/pinctrl/Quoted 7 lines
In this case, it will looks like this:
framer@2000000 { compatible = "lantiq,pef2256"; reg = <0x2000000 0x100>; ... pinctrl { compatible = "lantiq,pef2256-pinctrl";
Quoted 2 lines
If you do not have any resources, there is no point in having separate compatible for separate device node.
That's a new rule. Is that documented somewhere? I'm sure we already have device nodes for devices whom only operate on shared resources.
Quoted 6 lines
Anyway this discussions should not be about DT. How Linux drivers are implementing DT is not really a guide how to write DT. Since these series were brought there were some DT decisions made based how you want to write the driver. No, please don't. I also do not see any problems in handling more-or-less complex driver structures without poking the DT. We have already many such device families.
Signature · 1 line
Lee Jones [李琼斯]
Re: [PATCH v6 3/7] mfd: Add support for the Lantiq PEF2256 framer
Quoted 76 lines · Lee Jones
Quoted 76 lines
Quoted 75 lines
Quoted 62 lines
Quoted 32 lines
Quoted 32 lines
Quoted 25 lines
Quoted 5 lines
include/linux/mfd/pef2256.h | 52 ++ 5 files changed, 1269 insertions(+) create mode 100644 drivers/mfd/pef2256-regs.h create mode 100644 drivers/mfd/pef2256.c create mode 100644 include/linux/mfd/pef2256.h[...]
Review
Quoted 13 lines
(quoted diff) +13
-0+static int pef2256_add_audio_devices(struct pef2256 *pef2256) +{ + const char *compatible = "lantiq,pef2256-codec"; + struct mfd_cell *audio_devs; + struct device_node *np; + unsigned int count = 0; + unsigned int i; + int ret; + + for_each_available_child_of_node(pef2256->dev->of_node, np) { + if (of_device_is_compatible(np, compatible)) + count++; + }Converting Device Tree nodes into MFD cells to register with the Platform Device API is not a reasonable use-case of MFD.
Quoted 2 lines
Have the CODEC driver match on "lantiq,pef2256-codec" and let it instantiate itself.
As the framer is going to used by several subsystem, I cannot instantiate it in the specific ASoC subsystem.
Quoted 1 line
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Your first version using
of_platform_populate()was closer to the mark.The issue was that I need MFD cells for the pinctrl part.
Why can't it be represented in DT?
The pinctrl part has no specific compatible string.
Not sure that a compatible string for pinctrl can be accepted as there is only one pinctrl subnode and no specific reg for this subnode.The DT looks like this:
framer@2000000 { compatible = "lantiq,pef2256"; reg = <0x2000000 0x100>; ... pinctrl { pef2256_rpa_sypr: rpa-pins { pins = "RPA"; function = "SYPR"; }; }; pef2256_codec0: codec-0 { compatible = "lantiq,pef2256-codec"; #sound-dai-cells = <0>; sound-name-prefix = "PEF2256_0"; }; };Quoted 1 line
Krzysztof, is it acceptable to have a compatible string in the pinctrl node ?
Why wouldn't it be?
$ git grep ".compatible" -- drivers/pinctrl/Quoted 7 lines
In this case, it will looks like this:
framer@2000000 { compatible = "lantiq,pef2256"; reg = <0x2000000 0x100>; ... pinctrl { compatible = "lantiq,pef2256-pinctrl";
Quoted 5 lines
Quoted 2 lines
If you do not have any resources, there is no point in having separate compatible for separate device node.
That's a new rule. Is that documented somewhere? I'm sure we already have device nodes for devices whom only operate on shared resources.
Let me clarify - no need for separate node for such case, when this is in general one device and it's sub-block does not look re-usable. For SoC blocks it is a bit different. For PMICs which pretty often re-use pieces between different devices, as well.
But here there is not much benefit of separate device node for pinctrl.
Whether rule is new? Dunno, depends, I saw it from reviews from Rob since long time, e.g.:
https://lore.kernel.org/all/[email protected]/
Maybe this is a bit different because of children - pinconf settings? But I would still look at this as:
1. For a re-usable sub-block: separate device node and compatible is useful,
2. Non-reusable but having a child node only to group children like pin configuration nodes: no need for compatible.
Best regards,
Krzysztof
Re: [PATCH v6 3/7] mfd: Add support for the Lantiq PEF2256 framer
In reply to Lee JonesHi Lee, Krzysztof,
Quoted 68 lines · On Thu, 20 Apr 2023 14:47:03 +0100 Lee Jones <[email protected]> wrote:
Quoted 25 lines · Herve Codina
Quoted 13 lines · On Thu, 20 Apr 2023 13:39:46 +0100 Lee Jones <[email protected]> wrote:
Quoted 10 lines · Herve Codina
The Lantiq PEF2256 is a framer and line interface component designed to fulfill all required interfacing between an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus.
Signed-off-by Herve Codina <[email protected]>--- drivers/mfd/Kconfig | 16 + drivers/mfd/Makefile | 1 + drivers/mfd/pef2256-regs.h | 250 ++++++++++ drivers/mfd/pef2256.c | 950 ++++++++++++++++++++++++++++++++++++Quoted 3 lines
95% of this driver needs to be moved somewhere else.
What is a Framer? Perhaps
sound/is a good candidate?The pef2256 framer is a device that transfers data to/from a TDM (time-slots data) from/to quite old telecommunication lines (E1 in my case). Several subsystem can set/get data to/from the TDM. Each device using their own time-slots set.
Quoted 4 lines
On my use-case, I have some audio consumer and a not yet upstreamed HDLC consumer. Both of them uses the framer to know the E1 link state. The framer needs to be initialized 'globally' and not by a specific consumer as several consumers can use the framer.
I can't think of a good place for this.
If all else fails, it's
drivers/miscQuoted 32 lines
Quoted 25 lines
Quoted 5 lines
include/linux/mfd/pef2256.h | 52 ++ 5 files changed, 1269 insertions(+) create mode 100644 drivers/mfd/pef2256-regs.h create mode 100644 drivers/mfd/pef2256.c create mode 100644 include/linux/mfd/pef2256.h[...]
drivers/mfd/pef2256.c line 728
Quoted 13 lines
drivers/mfd/pef2256.c new file +13
-0+static int pef2256_add_audio_devices (struct pef2256 *pef2256) +{ +const char *compatible ="lantiq,pef2256-codec" ; +struct mfd_cell *audio_devs; +struct device_node *np; +unsigned int count =0 ; +unsigned int i; +int ret; + +for_each_available_child_of_node (pef2256->dev->of_node, np) { +if (of_device_is_compatible (np, compatible)) + count++; + }Converting Device Tree nodes into MFD cells to register with the Platform Device API is not a reasonable use-case of MFD.
Quoted 2 lines
Have the CODEC driver match on "lantiq,pef2256-codec" and let it instantiate itself.
As the framer is going to used by several subsystem, I cannot instantiate it in the specific ASoC subsystem.
Quoted 1 line
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Your first version using
of_platform_populate()was closer to the mark.The issue was that I need MFD cells for the pinctrl part.
Why can't it be represented in DT?
The pinctrl part has no specific compatible string.
Not sure that a compatible string for pinctrl can be accepted as there is only one pinctrl subnode and no specific reg for this subnode.
The DT looks like this:
framer@2000000 {
compatible = "lantiq,pef2256";
reg = <0x2000000 0x100>;
...
pinctrl {
pef2256_rpa_sypr: rpa-pins {
pins = "RPA";
function = "SYPR";
};
};
pef2256_codec0: codec-0 {
compatible = "lantiq,pef2256-codec";
#sound-dai-cells = <0>;
sound-name-prefix = "PEF2256_0";
};
};Krzysztof, is it acceptable to have a compatible string in the pinctrl node ? In this case, it will looks like this:
framer@2000000 {
compatible = "lantiq,pef2256";
reg = <0x2000000 0x100>;
...
pinctrl {
compatible = "lantiq,pef2256-pinctrl";
pef2256_rpa_sypr: rpa-pins {
pins = "RPA";
function = "SYPR";
};
};
pef2256_codec0: codec-0 {
compatible = "lantiq,pef2256-codec";
#sound-dai-cells = <0>;
sound-name-prefix = "PEF2256_0";
};
};Best regards,
Hervé
Re: [PATCH v6 3/7] mfd: Add support for the Lantiq PEF2256 framer
In reply to Lee JonesQuoted 13 lines · On Thu, 20 Apr 2023 13:39:46 +0100 Lee Jones <[email protected]> wrote:
Quoted 10 lines · Herve Codina
The Lantiq PEF2256 is a framer and line interface component designed to fulfill all required interfacing between an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus.
Signed-off-by Herve Codina <[email protected]>--- drivers/mfd/Kconfig | 16 + drivers/mfd/Makefile | 1 + drivers/mfd/pef2256-regs.h | 250 ++++++++++ drivers/mfd/pef2256.c | 950 ++++++++++++++++++++++++++++++++++++
Quoted 3 lines
95% of this driver needs to be moved somewhere else.
What is a Framer? Perhaps
sound/is a good candidate?
The pef2256 framer is a device that transfers data to/from a TDM (time-slots data) from/to quite old telecommunication lines (E1 in my case). Several subsystem can set/get data to/from the TDM. Each device using their own time-slots set.
On my use-case, I have some audio consumer and a not yet upstreamed HDLC consumer. Both of them uses the framer to know the E1 link state. The framer needs to be initialized 'globally' and not by a specific consumer as several consumers can use the framer.
Quoted 26 lines
Quoted 6 lines
include/linux/mfd/pef2256.h | 52 ++ 5 files changed, 1269 insertions(+) create mode 100644 drivers/mfd/pef2256-regs.h create mode 100644 drivers/mfd/pef2256.c create mode 100644 include/linux/mfd/pef2256.h[...]
drivers/mfd/pef2256.c line 728
Quoted 13 lines
drivers/mfd/pef2256.c new file +13
-0+static int pef2256_add_audio_devices (struct pef2256 *pef2256) +{ +const char *compatible ="lantiq,pef2256-codec" ; +struct mfd_cell *audio_devs; +struct device_node *np; +unsigned int count =0 ; +unsigned int i; +int ret; + +for_each_available_child_of_node (pef2256->dev->of_node, np) { +if (of_device_is_compatible (np, compatible)) + count++; + }Converting Device Tree nodes into MFD cells to register with the Platform Device API is not a reasonable use-case of MFD.
Quoted 2 lines
Have the CODEC driver match on "lantiq,pef2256-codec" and let it instantiate itself.
As the framer is going to used by several subsystem, I cannot instantiate it in the specific ASoC subsystem.
Quoted 2 lines
Your first version using
of_platform_populate()was closer to the mark.
The issue was that I need MFD cells for the pinctrl part.
Quoted 10 lines
Quoted 10 lines
drivers/mfd/pef2256.c new file +9
-0+if (!count) +return 0 ; + + audio_devs =kcalloc (count,sizeof (*audio_devs),GFP_KERNEL ); +if (!audio_devs) +return -ENOMEM ; + +for (i =0 ; i < count; i++) { + (audio_devs + i)->name ="lantiq-pef2256-codec" ;
Quoted 9 lines
drivers/mfd/pef2256.c line 746
Quoted 8 lines
drivers/mfd/pef2256.c new file +8
-0+ (audio_devs + i)->of_compatible = compatible; + (audio_devs + i)->id = i; + } + + ret =mfd_add_devices (pef2256->dev,0 , audio_devs, count,NULL ,0 ,NULL ); +kfree (audio_devs); +return ret; +}
Best regards,
Hervé
Signature · 3 lines
Hervé Codina, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Herve Codina
maintainerPATCH v6 4/7 Documentation: sysfs: Document the Lantiq PEF2256 sysfs entry
In reply to Herve CodinaDocument the "subordinate" sysfs attribute exposed by the PEF2256 driver.
--- .../ABI/testing/sysfs-bus-platform-devices-pef2256 | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-bus-platform-devices-pef2256
Documentation/ABI/testing/sysfs-bus-platform-devices-pef2256 new file +12 -0
@@ -0,0 +1,12 @@ +What: /sys/bus/platform/devices/*.pef2256/subordinate +KernelVersion: 6.4 +Contact: Herve Codina <[email protected]> +Description: + (RW) Controls whether the PEF2256 works as subordinate or main + device mode. + + - 0: main device mode + - 1: subordinate mode + + In subordinate device mode it synchronizes on line interface + clock signals. Otherwise, it synchronizes on internal clocks.
Signature · 1 line
2.39.2
Herve Codina
maintainerPATCH v6 5/7 pinctrl: Add support for the Lantic PEF2256 pinmux
In reply to Herve CodinaThe Lantiq PEF2256 is a framer and line interface component designed to fulfill all required interfacing between an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus.
This pinmux support handles the pin muxing part (pins RP(A..D) and pins XP(A..D)) of the PEF2256.
--- drivers/pinctrl/Kconfig | 14 ++ drivers/pinctrl/Makefile | 1 + drivers/pinctrl/pinctrl-pef2256-regs.h | 65 ++++++ drivers/pinctrl/pinctrl-pef2256.c | 310 +++++++++++++++++++++++++ 4 files changed, 390 insertions(+) create mode 100644 drivers/pinctrl/pinctrl-pef2256-regs.h create mode 100644 drivers/pinctrl/pinctrl-pef2256.c
drivers/pinctrl/Kconfig +14 -0
@@ -377,6 +377,20 @@ config PINCTRL_PALMAS open drain configuration for the Palmas series devices like TPS65913, TPS80036 etc. +config PINCTRL_PEF2256 + tristate "Lantiq PEF2256 (FALC56) pin controller driver" + depends on OF && MFD_PEF2256 + select PINMUX + select GENERIC_PINCONF + help + This option enables the pin controller support for the Lantiq PEF2256 + framer, also known as FALC56. + + If unsure, say N. + + To compile this driver as a module, choose M here: the + module will be called pinctrl-pef2256. + config PINCTRL_PIC32 bool "Microchip PIC32 pin controller driver" depends on OF
drivers/pinctrl/Makefile +1 -0
@@ -39,6 +39,7 @@ obj-$(CONFIG_PINCTRL_MICROCHIP_SGPIO) += pinctrl-microchip-sgpio.o obj-$(CONFIG_PINCTRL_OCELOT) += pinctrl-ocelot.o obj-$(CONFIG_PINCTRL_OXNAS) += pinctrl-oxnas.o obj-$(CONFIG_PINCTRL_PALMAS) += pinctrl-palmas.o +obj-$(CONFIG_PINCTRL_PEF2256) += pinctrl-pef2256.o obj-$(CONFIG_PINCTRL_PIC32) += pinctrl-pic32.o obj-$(CONFIG_PINCTRL_PISTACHIO) += pinctrl-pistachio.o obj-$(CONFIG_PINCTRL_RK805) += pinctrl-rk805.o
drivers/pinctrl/pinctrl-pef2256-regs.h new file +65 -0
65 lines not on this page · raw message
drivers/pinctrl/pinctrl-pef2256.c new file +310 -0
310 lines not on this page · raw message
Signature · 1 line
2.39.2
Herve Codina
maintainerPATCH v6 6/7 ASoC: codecs: Add support for the Lantiq PEF2256 codec
In reply to Herve CodinaThe Lantiq PEF2256 is a framer and line interface component designed to fulfill all required interfacing between an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus.
The codec support allows to use some of the PCM system highway time-slots as audio channels to transport audio data over the E1/T1/J1 lines. It provides also line carrier detection events reported through the ALSA jack detection feature.
--- sound/soc/codecs/Kconfig | 14 ++ sound/soc/codecs/Makefile | 2 + sound/soc/codecs/pef2256-codec.c | 390 +++++++++++++++++++++++++++++++ 3 files changed, 406 insertions(+) create mode 100644 sound/soc/codecs/pef2256-codec.c
sound/soc/codecs/Kconfig +14 -0
@@ -168,6 +168,7 @@ config SND_SOC_ALL_CODECS imply SND_SOC_PCM512x_I2C imply SND_SOC_PCM512x_SPI imply SND_SOC_PEB2466 + imply SND_SOC_PEF2256 imply SND_SOC_RK3328 imply SND_SOC_RK817 imply SND_SOC_RT274
@@ -1252,6 +1253,19 @@ config SND_SOC_PEB2466 To compile this driver as a module, choose M here: the module will be called snd-soc-peb2466. +config SND_SOC_PEF2256 + tristate "Lantiq PEF2256 codec" + depends on MFD_PEF2256 + help + Enable support for the Lantiq PEF2256 (FALC56) codec. + The PEF2256 is a framer and line interface between analog E1/T1/J1 + line and a digital PCM bus. + This codec allows to use some of the time slots available on the + PEF2256 PCM bus to transport some audio data. + + To compile this driver as a module, choose M here: the module + will be called snd-soc-pef2256. + config SND_SOC_RK3328 tristate "Rockchip RK3328 audio CODEC" select REGMAP_MMIO
sound/soc/codecs/Makefile +2 -0
@@ -188,6 +188,7 @@ snd-soc-pcm512x-objs := pcm512x.o snd-soc-pcm512x-i2c-objs := pcm512x-i2c.o snd-soc-pcm512x-spi-objs := pcm512x-spi.o snd-soc-peb2466-objs := peb2466.o +snd-soc-pef2256-objs := pef2256-codec.o snd-soc-rk3328-objs := rk3328_codec.o snd-soc-rk817-objs := rk817_codec.o snd-soc-rl6231-objs := rl6231.o
@@ -551,6 +552,7 @@ obj-$(CONFIG_SND_SOC_PCM512x) += snd-soc-pcm512x.o obj-$(CONFIG_SND_SOC_PCM512x_I2C) += snd-soc-pcm512x-i2c.o obj-$(CONFIG_SND_SOC_PCM512x_SPI) += snd-soc-pcm512x-spi.o obj-$(CONFIG_SND_SOC_PEB2466) += snd-soc-peb2466.o +obj-$(CONFIG_SND_SOC_PEF2256) += snd-soc-pef2256.o obj-$(CONFIG_SND_SOC_RK3328) += snd-soc-rk3328.o obj-$(CONFIG_SND_SOC_RK817) += snd-soc-rk817.o obj-$(CONFIG_SND_SOC_RL6231) += snd-soc-rl6231.o
sound/soc/codecs/pef2256-codec.c new file +390 -0
390 lines not on this page · raw message
Signature · 1 line
2.39.2
kernel test robot
build botRe: [PATCH v6 6/7] ASoC: codecs: Add support for the Lantiq PEF2256 codec
kernel test robot noticed the following build warnings:
Hi Herve,
kernel test robot noticed the following build warnings:
[auto build test WARNING on lee-mfd/for-mfd-next]
[also build test WARNING on linusw-pinctrl/devel linusw-pinctrl/for-next broonie-sound/for-next linus/master v6.3-rc7 next-20230421] [cannot apply to lee-mfd/for-mfd-fixes]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Herve-Codina/dt-bindings-mfd-Add-the-Lantiq-PEF2256-E1-T1-J1-framer/20230418-011757 base: https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git for-mfd-next patch link: https://lore.kernel.org/r/20230417171601.74656-7-herve.codina%40bootlin.com patch subject: [PATCH v6 6/7] ASoC: codecs: Add support for the Lantiq PEF2256 codec config: loongarch-randconfig-s051-20230421 (https://download.01.org/0day-ci/archive/20230422/[email protected]/config) compiler: loongarch64-linux-gcc (GCC) 12.1.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-39-gce1a6720-dirty
# https://github.com/intel-lab-lkp/linux/commit/1b22af56c892af6c0b5f6f18eff40f1fbefcb699
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Herve-Codina/dt-bindings-mfd-Add-the-Lantiq-PEF2256-E1-T1-J1-framer/20230418-011757
git checkout 1b22af56c892af6c0b5f6f18eff40f1fbefcb699
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=loongarch olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=loongarch SHELL=/bin/bash sound/soc/codecs/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>
| Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/
sparse warnings: (new ones prefixed by >>)
>> sound/soc/codecs/pef2256-codec.c:137:26: sparse: sparse: restricted snd_pcm_format_t degrades to integer >> sound/soc/codecs/pef2256-codec.c:139:59: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted snd_pcm_format_t [usertype] format @@ got unsigned int [assigned] i @@ sound/soc/codecs/pef2256-codec.c:139:59: sparse: expected restricted snd_pcm_format_t [usertype] format sound/soc/codecs/pef2256-codec.c:139:59: sparse: got unsigned int [assigned] i sound/soc/codecs/pef2256-codec.c:177:26: sparse: sparse: restricted snd_pcm_format_t degrades to integer >> sound/soc/codecs/pef2256-codec.c:179:62: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted snd_pcm_format_t [usertype] format @@ got int [assigned] i @@
sound/soc/codecs/pef2256-codec.c:179:62: sparse: expected restricted snd_pcm_format_t [usertype] format
sound/soc/codecs/pef2256-codec.c:179:62: sparse: got int [assigned] i
vim +137 sound/soc/codecs/pef2256-codec.c
118
119 static int pef2256_dai_hw_rule_format_by_channels(struct snd_soc_dai *dai,
120 struct snd_pcm_hw_params *params,
121 unsigned int nb_ts)
122 {
123 struct snd_mask *f_old = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
124 unsigned int channels = params_channels(params);
125 unsigned int slot_width;
126 struct snd_mask f_new;
127 unsigned int i;
128
129 if (!channels || channels > nb_ts) {
130 dev_err(dai->dev, "channels %u not supported\n", nb_ts);
131 return -EINVAL;
132 }
133
134 slot_width = (nb_ts / channels) * 8;
135
136 snd_mask_none(&f_new);
> 137 for (i = 0; i <= SNDRV_PCM_FORMAT_LAST; i++) {
138 if (snd_mask_test(f_old, i)) {
> 139 if (snd_pcm_format_physical_width(i) <= slot_width)
140 snd_mask_set(&f_new, i);
141 }
142 }
143
144 return snd_mask_refine(f_old, &f_new);
145 }
146
147 static int pef2256_dai_hw_rule_playback_format_by_channels(struct snd_pcm_hw_params *params,
148 struct snd_pcm_hw_rule *rule)
149 {
150 struct snd_soc_dai *dai = rule->private;
151 struct pef2256_codec *pef2256 = snd_soc_component_get_drvdata(dai->component);
152
153 return pef2256_dai_hw_rule_format_by_channels(dai, params, pef2256->max_chan_playback);
154 }
155
156 static int pef2256_dai_hw_rule_capture_format_by_channels(struct snd_pcm_hw_params *params,
157 struct snd_pcm_hw_rule *rule)
158 {
159 struct snd_soc_dai *dai = rule->private;
160 struct pef2256_codec *pef2256 = snd_soc_component_get_drvdata(dai->component);
161
162 return pef2256_dai_hw_rule_format_by_channels(dai, params, pef2256->max_chan_capture);
163 }
164
165 static u64 pef2256_formats(u8 nb_ts)
166 {
167 u64 formats;
168 unsigned int chan_width;
169 unsigned int format_width;
170 int i;
171
172 if (!nb_ts)
173 return 0;
174
175 formats = 0;
176 chan_width = nb_ts * 8;
177 for (i = 0; i <= SNDRV_PCM_FORMAT_LAST; i++) {
178 /* Support physical width multiple of 8bit */
> 179 format_width = snd_pcm_format_physical_width(i); 180 if (format_width == 0 || format_width % 8)
181 continue;
182
183 /*
184 * And support physical width that can fit N times in the
185 * channel
186 */
187 if (format_width > chan_width || chan_width % format_width)
188 continue;
189
190 formats |= (1ULL << i);
191 }
192 return formats;
193 }
194
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests
Herve Codina
maintainerPATCH v6 7/7 MAINTAINERS: Add the Lantiq PEF2256 driver entry
In reply to Herve CodinaAfter contributing the driver, add myself as the maintainer for the Lantiq PEF2256 driver.
--- MAINTAINERS | 12 ++++++++++++ 1 file changed, 12 insertions(+)
MAINTAINERS +12 -0
@@ -11651,6 +11651,18 @@ S: Maintained F: arch/mips/lantiq F: drivers/soc/lantiq +LANTIQ PEF2256 DRIVER +M: Herve Codina <[email protected]> +S: Maintained +F: Documentation/ABI/testing/sysfs-bus-platform-devices-pef2256 +F: Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml +F: drivers/mfd/pef2256-regs.h +F: drivers/mfd/pef2256.c +F: drivers/pinctrl/pinctrl-pef2256-regs.h +F: drivers/pinctrl/pinctrl-pef2256.c +F: include/linux/mfd/pef2256.h +F: sound/soc/codecs/pef2256-codec.c + LASI 53c700 driver for PARISC M: "James E.J. Bottomley" <[email protected]> L: [email protected]
Signature · 1 line
2.39.2
PATCH v6 1/7 dt-bindings: mfd: Add the Lantiq PEF2256 E1/T1/J1 framer
In reply to Herve CodinaThe Lantiq PEF2256 is a framer and line interface component designed to fulfill all required interfacing between an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus.
--- .../bindings/mfd/lantiq,pef2256.yaml | 267 ++++++++++++++++++ 1 file changed, 267 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml
Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml new file +267 -0
@@ -0,0 +1,267 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/lantiq,pef2256.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Lantiq PEF2256 + +maintainers: + - Herve Codina <[email protected]> + +description: + The Lantiq PEF2256, also known as Infineon PEF2256 or FALC56, is a framer and + line interface component designed to fulfill all required interfacing between + an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus. + +properties: + compatible: + items: + - const: lantiq,pef2256 + - const: simple-mfd + + reg: + maxItems: 1 + + clocks: + items: + - description: Master clock + - description: Receive System Clock + - description: Transmit System Clock + + clock-names: + items: + - const: mclk + - const: sclkr + - const: sclkx + + interrupts: + maxItems: 1 + + reset-gpios: + description: + GPIO used to reset the device. + maxItems: 1 + + pinctrl: + $ref: /schemas/pinctrl/pinctrl.yaml# + additionalProperties: false + + patternProperties: + '-pins$': + type: object + $ref: /schemas/pinctrl/pincfg-node.yaml# + additionalProperties: false + + properties: + pins: + enum: [ RPA, RPB, RPC, RPD, XPA, XPB, XPC, XPD ] + + function: + enum: [ SYPR, RFM, RFMB, RSIGM, RSIG, DLR, FREEZE, RFSP, LOS, + SYPX, XFMS, XSIG, TCLK, XMFB, XSIGM, DLX, XCLK, XLT, + GPI, GPOH, GPOL ] + + required: + - pins + - function + + lantiq,line-interface: + $ref: /schemas/types.yaml#/definitions/string + enum: [e1, t1j1] + default: e1 + description: | + The line interface type + - e1: E1 line + - t1j1: T1/J1 line + + lantiq,frame-format: + $ref: /schemas/types.yaml#/definitions/string + description: + The line interface frame format. + + lantiq,data-rate-bps: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [2048000, 4096000, 8192000, 16384000] + default: 2048000 + description: + Data rate (bit per seconds) on the system highway. + + lantiq,clock-falling-edge: + $ref: /schemas/types.yaml#/definitions/flag + description: + Data is sent on falling edge of the clock (and received on the rising + edge). If 'clock-falling-edge' is not present, data is sent on the + rising edge (and received on the falling edge). + + lantiq,channel-phase: + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1, 2, 3, 4, 5, 6, 7] + default: 0 + description: + The pef2256 delivers a full frame (32 8bit time-slots in E1 and 24 8bit + time-slots 8 8bit signaling in E1/J1) every 125us. This lead to a data + rate of 2048000 bit/s. When lantiq,data-rate-bps is more than 2048000 + bit/s, the data (all 32 8bit) present in the frame are interleave with + unused time-slots. The lantiq,channel-phase property allows to set the + correct alignment of the interleave mechanism. + For instance, suppose lantiq,data-rate-bps = 8192000 (ie 4*2048000), and + lantiq,channel-phase = 2, the interleave schema with unused time-slots + (nu) and used time-slots (XX) for TSi is + nu nu XX nu nu nu XX nu nu nu XX nu + <-- TSi --> <- TSi+1 -> <- TSi+2 -> + With lantiq,data-rate-bps = 8192000, and lantiq,channel-phase = 1, the + interleave schema is + nu XX nu nu nu XX nu nu nu XX nu nu + <-- TSi --> <- TSi+1 -> <- TSi+2 -> + With lantiq,data-rate-bps = 4096000 (ie 2*2048000), and + lantiq,channel-phase = 1, the interleave schema is + nu XX nu XX nu XX + <-- TSi --> <- TSi+1 -> <- TSi+2 -> + + lantiq,subordinate: + $ref: /schemas/types.yaml#/definitions/flag + description: + If present, the pef2256 works in subordinate mode. In this mode it + synchronizes on line interface clock signals. Otherwise, it synchronizes + on internal clocks. + +patternProperties: + '^codec(-([0-9]|[1-2][0-9]|3[0-1]))?$': + type: object + $ref: /schemas/sound/dai-common.yaml + unevaluatedProperties: false + description: + Codec provided by the pef2256. This codec allows to use some of the PCM + system highway time-slots as audio channels to transport audio data over + the E1/T1/J1 lines. + The time-slots used by the codec must be set and so, the properties + 'dai-tdm-slot-num', 'dai-tdm-slot-width', 'dai-tdm-slot-tx-mask' and + 'dai-tdm-slot-rx-mask' must be present in the sound card node for + sub-nodes that involve the codec. The codec uses 8bit time-slots. + 'dai-tdm-tdm-slot-with' must be set to 8. + The tx and rx masks define the pef2256 time-slots assigned to the codec. + + properties: + compatible: + const: lantiq,pef2256-codec + + '#sound-dai-cells': + const: 0 + + required: + - compatible + - '#sound-dai-cells' + +required: + - compatible + - reg + - clocks + - clock-names + - interrupts + +allOf: + - if: + properties: + lantiq,line-interface: + contains: + const: e1 + then: + properties: + lantiq,frame-format: + enum: [doubleframe, crc4-multiframe, auto-multiframe] + default: doubleframe + description: | + The E1 line interface frame format + - doubleframe: Doubleframe format + - crc4-multiframe: CRC4 multiframe format + - auto-multiframe: CRC4 multiframe format with interworking + capabilities (ITU-T G.706 Annex B) + + else: + # T1/J1 line + properties: + lantiq,frame-format: + enum: [4frame, 12frame, 24frame, 72frame] + default: 12frame + description: | + The T1/J1 line interface frame format + - 4frame: 4-frame multiframe format (F4) + - 12frame: 12-frame multiframe format (F12, D3/4) + - 24frame: 24-frame multiframe format (ESF) + - 72frame: 72-frame multiframe format (F72, remote switch mode) + +additionalProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + #include <dt-bindings/interrupt-controller/irq.h> + + framer@2000000 { + compatible = "lantiq,pef2256", "simple-mfd"; + reg = <0x2000000 0x100>; + interrupts = <8 IRQ_TYPE_LEVEL_LOW>; + interrupt-parent = <&intc>; + clocks = <&clk_mclk>, <&clk_sclkr>, <&clk_sclkx>; + clock-names = "mclk", "sclkr", "sclkx"; + reset-gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + lantiq,data-rate-bps = <4096000>; + + pinctrl { + pef2256_rpa_sypr: rpa-pins { + pins = "RPA"; + function = "SYPR"; + }; + pef2256_xpa_sypx: xpa-pins { + pins = "XPA"; + function = "SYPX"; + }; + }; + + pef2256_codec0: codec-0 { + compatible = "lantiq,pef2256-codec"; + #sound-dai-cells = <0>; + sound-name-prefix = "PEF2256_0"; + }; + + pef2256_codec1: codec-1 { + compatible = "lantiq,pef2256-codec"; + #sound-dai-cells = <0>; + sound-name-prefix = "PEF2256_1"; + }; + }; + + sound { + compatible = "simple-audio-card"; + #address-cells = <1>; + #size-cells = <0>; + simple-audio-card,dai-link@0 { /* CPU DAI1 - pef2256 codec 1 */ + reg = <0>; + cpu { + sound-dai = <&cpu_dai1>; + }; + codec { + sound-dai = <&pef2256_codec0>; + dai-tdm-slot-num = <4>; + dai-tdm-slot-width = <8>; + /* TS 1, 2, 3, 4 */ + dai-tdm-slot-tx-mask = <0 1 1 1 1>; + dai-tdm-slot-rx-mask = <0 1 1 1 1>; + }; + }; + simple-audio-card,dai-link@1 { /* CPU DAI2 - pef2256 codec 2 */ + reg = <1>; + cpu { + sound-dai = <&cpu_dai2>; + }; + codec { + sound-dai = <&pef2256_codec1>; + dai-tdm-slot-num = <4>; + dai-tdm-slot-width = <8>; + /* TS 5, 6, 7, 8 */ + dai-tdm-slot-tx-mask = <0 0 0 0 0 1 1 1 1>; + dai-tdm-slot-rx-mask = <0 0 0 0 0 1 1 1 1>; + }; + }; + };
Signature · 1 line
2.39.2
PATCH v6 2/7 mfd: core: Ensure disabled devices are skiped without aborting
In reply to Herve CodinaThe loop searching for a matching device based on its compatible string is aborted when a matching disabled device is found. This abort avoid to add devices as soon as one disabled device is found.
Continue searching for an other device instead of aborting on the first disabled one fixes the issue.
--- drivers/mfd/mfd-core.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)
drivers/mfd/mfd-core.c +13 -5
@@ -176,6 +176,7 @@ static int mfd_add_device(struct device *parent, int id,struct platform_device *pdev;struct device_node *np =NULL ;struct mfd_of_node_entry *of_entry, *tmp; +bool not_available;int ret = -ENOMEM ;int platform_id;int r;
@@ -211,13 +212,13 @@ static int mfd_add_device(struct device *parent, int id, goto fail_res;if (IS_ENABLED (CONFIG_OF ) && parent->of_node && cell->of_compatible) { + not_available = false;for_each_child_of_node (parent->of_node, np) {if (of_device_is_compatible (np, cell->of_compatible)) { -/* Ignore 'disabled' devices error free */ +/* Skip 'disabled' devices */ if (!of_device_is_available (np)) { -of_node_put (np); - ret =0 ; - goto fail_alias; + not_available = true; +continue ; } ret =mfd_match_of_node_to_dev (pdev, np, cell);
@@ -227,10 +228,17 @@ static int mfd_add_device(struct device *parent, int id,if (ret) goto fail_alias; -break ; + goto match; } } +if (not_available) { +/* Ignore 'disabled' devices error free */ + ret =0 ; + goto fail_alias; + } + +match:if (!pdev->dev.of_node)pr_warn ("%s: Failed to locate of_node [id: %d]\n" , cell->name, platform_id);
Signature · 1 line
2.39.2
PATCH v6 3/7 mfd: Add support for the Lantiq PEF2256 framer
In reply to Herve CodinaThe Lantiq PEF2256 is a framer and line interface component designed to fulfill all required interfacing between an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus.
--- drivers/mfd/Kconfig | 16 + drivers/mfd/Makefile | 1 + drivers/mfd/pef2256-regs.h | 250 ++++++++++ drivers/mfd/pef2256.c | 950 ++++++++++++++++++++++++++++++++++++ include/linux/mfd/pef2256.h | 52 ++ 5 files changed, 1269 insertions(+) create mode 100644 drivers/mfd/pef2256-regs.h create mode 100644 drivers/mfd/pef2256.c create mode 100644 include/linux/mfd/pef2256.h
drivers/mfd/Kconfig +16 -0
@@ -1063,6 +1063,22 @@ config PCF50633_GPIO Say yes here if you want to include support GPIO for pins on the PCF50633 chip. +config MFD_PEF2256 + tristate "Lantiq PEF2256 (FALC56) framer" + depends on OF + select MFD_CORE + select REGMAP_MMIO + help + This option enables support for the Lantiq PEF2256 framer, also known + as FALC56. This framer and its line interface component is designed + to fulfill all required interfacing between analog E1/T1/J1 lines and + the digital PCM system highway. + + If unsure, say N. + + To compile this driver as a module, choose M here: the + module will be called pef2256. + config MFD_PM8XXX tristate "Qualcomm PM8xxx PMIC chips driver" depends on (ARM || HEXAGON || COMPILE_TEST)
drivers/mfd/Makefile +1 -0
@@ -195,6 +195,7 @@ obj-$(CONFIG_MFD_SI476X_CORE) += si476x-core.o obj-$(CONFIG_MFD_CS5535) += cs5535-mfd.o obj-$(CONFIG_MFD_OMAP_USB_HOST) += omap-usb-host.o omap-usb-tll.o +obj-$(CONFIG_MFD_PEF2256) += pef2256.o obj-$(CONFIG_MFD_PM8XXX) += qcom-pm8xxx.o ssbi.o obj-$(CONFIG_MFD_QCOM_RPM) += qcom_rpm.o obj-$(CONFIG_MFD_SPMI_PMIC) += qcom-spmi-pmic.o
drivers/mfd/pef2256-regs.h new file +250 -0
250 lines not on this page · raw message
drivers/mfd/pef2256.c new file +950 -0
950 lines not on this page · raw message
include/linux/mfd/pef2256.h new file +52 -0
52 lines not on this page · raw message
Signature · 1 line
2.39.2
PATCH v6 4/7 Documentation: sysfs: Document the Lantiq PEF2256 sysfs entry
In reply to Herve CodinaDocument the "subordinate" sysfs attribute exposed by the PEF2256 driver.
--- .../ABI/testing/sysfs-bus-platform-devices-pef2256 | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-bus-platform-devices-pef2256
Documentation/ABI/testing/sysfs-bus-platform-devices-pef2256 new file +12 -0
@@ -0,0 +1,12 @@ +What: /sys/bus/platform/devices/*.pef2256/subordinate +KernelVersion: 6.4 +Contact: Herve Codina <[email protected]> +Description: + (RW) Controls whether the PEF2256 works as subordinate or main + device mode. + + - 0: main device mode + - 1: subordinate mode + + In subordinate device mode it synchronizes on line interface + clock signals. Otherwise, it synchronizes on internal clocks.
Signature · 1 line
2.39.2
PATCH v6 5/7 pinctrl: Add support for the Lantic PEF2256 pinmux
In reply to Herve CodinaThe Lantiq PEF2256 is a framer and line interface component designed to fulfill all required interfacing between an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus.
This pinmux support handles the pin muxing part (pins RP(A..D) and pins XP(A..D)) of the PEF2256.
--- drivers/pinctrl/Kconfig | 14 ++ drivers/pinctrl/Makefile | 1 + drivers/pinctrl/pinctrl-pef2256-regs.h | 65 ++++++ drivers/pinctrl/pinctrl-pef2256.c | 310 +++++++++++++++++++++++++ 4 files changed, 390 insertions(+) create mode 100644 drivers/pinctrl/pinctrl-pef2256-regs.h create mode 100644 drivers/pinctrl/pinctrl-pef2256.c
drivers/pinctrl/Kconfig +14 -0
@@ -377,6 +377,20 @@ config PINCTRL_PALMAS open drain configuration for the Palmas series devices like TPS65913, TPS80036 etc. +config PINCTRL_PEF2256 + tristate "Lantiq PEF2256 (FALC56) pin controller driver" + depends on OF && MFD_PEF2256 + select PINMUX + select GENERIC_PINCONF + help + This option enables the pin controller support for the Lantiq PEF2256 + framer, also known as FALC56. + + If unsure, say N. + + To compile this driver as a module, choose M here: the + module will be called pinctrl-pef2256. + config PINCTRL_PIC32 bool "Microchip PIC32 pin controller driver" depends on OF
drivers/pinctrl/Makefile +1 -0
@@ -39,6 +39,7 @@ obj-$(CONFIG_PINCTRL_MICROCHIP_SGPIO) += pinctrl-microchip-sgpio.o obj-$(CONFIG_PINCTRL_OCELOT) += pinctrl-ocelot.o obj-$(CONFIG_PINCTRL_OXNAS) += pinctrl-oxnas.o obj-$(CONFIG_PINCTRL_PALMAS) += pinctrl-palmas.o +obj-$(CONFIG_PINCTRL_PEF2256) += pinctrl-pef2256.o obj-$(CONFIG_PINCTRL_PIC32) += pinctrl-pic32.o obj-$(CONFIG_PINCTRL_PISTACHIO) += pinctrl-pistachio.o obj-$(CONFIG_PINCTRL_RK805) += pinctrl-rk805.o
drivers/pinctrl/pinctrl-pef2256-regs.h new file +65 -0
65 lines not on this page · raw message
drivers/pinctrl/pinctrl-pef2256.c new file +310 -0
310 lines not on this page · raw message
Signature · 1 line
2.39.2
PATCH v6 6/7 ASoC: codecs: Add support for the Lantiq PEF2256 codec
In reply to Herve CodinaThe Lantiq PEF2256 is a framer and line interface component designed to fulfill all required interfacing between an analog E1/T1/J1 line and the digital PCM system highway/H.100 bus.
The codec support allows to use some of the PCM system highway time-slots as audio channels to transport audio data over the E1/T1/J1 lines. It provides also line carrier detection events reported through the ALSA jack detection feature.
--- sound/soc/codecs/Kconfig | 14 ++ sound/soc/codecs/Makefile | 2 + sound/soc/codecs/pef2256-codec.c | 390 +++++++++++++++++++++++++++++++ 3 files changed, 406 insertions(+) create mode 100644 sound/soc/codecs/pef2256-codec.c
sound/soc/codecs/Kconfig +14 -0
@@ -168,6 +168,7 @@ config SND_SOC_ALL_CODECS imply SND_SOC_PCM512x_I2C imply SND_SOC_PCM512x_SPI imply SND_SOC_PEB2466 + imply SND_SOC_PEF2256 imply SND_SOC_RK3328 imply SND_SOC_RK817 imply SND_SOC_RT274
@@ -1252,6 +1253,19 @@ config SND_SOC_PEB2466 To compile this driver as a module, choose M here: the module will be called snd-soc-peb2466. +config SND_SOC_PEF2256 + tristate "Lantiq PEF2256 codec" + depends on MFD_PEF2256 + help + Enable support for the Lantiq PEF2256 (FALC56) codec. + The PEF2256 is a framer and line interface between analog E1/T1/J1 + line and a digital PCM bus. + This codec allows to use some of the time slots available on the + PEF2256 PCM bus to transport some audio data. + + To compile this driver as a module, choose M here: the module + will be called snd-soc-pef2256. + config SND_SOC_RK3328 tristate "Rockchip RK3328 audio CODEC" select REGMAP_MMIO
sound/soc/codecs/Makefile +2 -0
@@ -188,6 +188,7 @@ snd-soc-pcm512x-objs := pcm512x.o snd-soc-pcm512x-i2c-objs := pcm512x-i2c.o snd-soc-pcm512x-spi-objs := pcm512x-spi.o snd-soc-peb2466-objs := peb2466.o +snd-soc-pef2256-objs := pef2256-codec.o snd-soc-rk3328-objs := rk3328_codec.o snd-soc-rk817-objs := rk817_codec.o snd-soc-rl6231-objs := rl6231.o
@@ -551,6 +552,7 @@ obj-$(CONFIG_SND_SOC_PCM512x) += snd-soc-pcm512x.o obj-$(CONFIG_SND_SOC_PCM512x_I2C) += snd-soc-pcm512x-i2c.o obj-$(CONFIG_SND_SOC_PCM512x_SPI) += snd-soc-pcm512x-spi.o obj-$(CONFIG_SND_SOC_PEB2466) += snd-soc-peb2466.o +obj-$(CONFIG_SND_SOC_PEF2256) += snd-soc-pef2256.o obj-$(CONFIG_SND_SOC_RK3328) += snd-soc-rk3328.o obj-$(CONFIG_SND_SOC_RK817) += snd-soc-rk817.o obj-$(CONFIG_SND_SOC_RL6231) += snd-soc-rl6231.o
sound/soc/codecs/pef2256-codec.c new file +390 -0
390 lines not on this page · raw message
Signature · 1 line
2.39.2
PATCH v6 7/7 MAINTAINERS: Add the Lantiq PEF2256 driver entry
In reply to Herve CodinaAfter contributing the driver, add myself as the maintainer for the Lantiq PEF2256 driver.
--- MAINTAINERS | 12 ++++++++++++ 1 file changed, 12 insertions(+)
MAINTAINERS +12 -0
@@ -11651,6 +11651,18 @@ S: Maintained F: arch/mips/lantiq F: drivers/soc/lantiq +LANTIQ PEF2256 DRIVER +M: Herve Codina <[email protected]> +S: Maintained +F: Documentation/ABI/testing/sysfs-bus-platform-devices-pef2256 +F: Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml +F: drivers/mfd/pef2256-regs.h +F: drivers/mfd/pef2256.c +F: drivers/pinctrl/pinctrl-pef2256-regs.h +F: drivers/pinctrl/pinctrl-pef2256.c +F: include/linux/mfd/pef2256.h +F: sound/soc/codecs/pef2256-codec.c + LASI 53c700 driver for PARISC M: "James E.J. Bottomley" <[email protected]> L: [email protected]
Signature · 1 line
2.39.2