Skip to contentSkip to conversation

Add the Lantiq PEF2256 audio support

PATCH Superseded Herve Codina 4 participants 26 messages Mar 22, 2023 – Mar 26, 2023

Subsystems (4)

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v3 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.
The second part (patches 5 to 7) adds the audio support using the Lantiq PEF2256 driver core.

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/linux-kernel/[email protected]/
This v3 series mainly:
- takes into account pef2256.c modifications suggested by Christophe.
- fixes binding
- Moves to MFD.
- Merges MAINTAINERS entries

Best regards,
Herve Codina

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 (6):
dt-bindings: mfd: Add the Lantiq PEF2256 E1/T1/J1 framer
mfd: Add support for the Lantiq PEF2256 framer
Documentation: sysfs: Document the Lantiq PEF2256 sysfs entry
dt-bindings: sound: Add support for the Lantiq PEF2256 codec
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          |  205 +++
 .../bindings/sound/lantiq,pef2256-codec.yaml  |   54 +
 MAINTAINERS                                   |   10 +
 drivers/mfd/Kconfig                           |   16 +
 drivers/mfd/Makefile                          |    1 +
 drivers/mfd/pef2256.c                         | 1355 +++++++++++++++++
 include/linux/mfd/pef2256.h                   |   28 +
 sound/soc/codecs/Kconfig                      |   14 +
 sound/soc/codecs/Makefile                     |    2 +
 sound/soc/codecs/pef2256-codec.c              |  390 +++++
 11 files changed, 2087 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-platform-devices-pef2256
 create mode 100644 Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml
 create mode 100644 drivers/mfd/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
#1 lore raw

PATCH v3 1/6 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          | 205 ++++++++++++++++++
 1 file changed, 205 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml
Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml new file +205 -0
new file mode 100644
index 000000000000..affbf20df0a2
@@ -0,0 +1,205 @@
+# 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#
+
+    patternProperties:
+      '-pins$':
+        type: object
+        $ref: /schemas/pinctrl/pincfg-node.yaml#
+
+        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 ]
+
+        additionalProperties: false
+
+        required:
+          - pins
+          - function
+
+    additionalProperties: false
+
+  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])?$':
+    $ref: /schemas/sound/lantiq,pef2256-codec.yaml
+
+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)
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - interrupts
+
+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";
+        };
+      };
+
+      codec {
+        compatible = "lantiq,pef2256-codec";
+        #sound-dai-cells = <0>;
+      };
+    };
Signature · 1 line
2.39.2
#2 lore raw

Re: [PATCH v3 1/6] dt-bindings: mfd: Add the Lantiq PEF2256 E1/T1/J1 framer

Quoted 31 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.

Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml new file +25 -0
+  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 ->
+

Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml line 133

Quoted 10 lines
Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml new file +10 -0
+  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])?$':
+    $ref: /schemas/sound/lantiq,pef2256-codec.yaml

Does not look bisectable. I also could not find in commit msg or in cover letter description of patch merging requirements.

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+allOf:

allOf goes usually after required, just like in example-schema. Best regards,
Krzysztof

#3 lore raw

PATCH v3 2/6 mfd: Add support for the Lantiq PEF2256 framer

In reply to 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.

---
 drivers/mfd/Kconfig         |   16 +
 drivers/mfd/Makefile        |    1 +
 drivers/mfd/pef2256.c       | 1355 +++++++++++++++++++++++++++++++++++
 include/linux/mfd/pef2256.h |   28 +
 4 files changed, 1400 insertions(+)
 create mode 100644 drivers/mfd/pef2256.c
 create mode 100644 include/linux/mfd/pef2256.h
drivers/mfd/Kconfig +16 -0
index fcc141e067b9..174c6fe3e539 100644
@@ -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"
+	select PINCTRL
+	select PINMUX
+	select GENERIC_PINCONF
+	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
index 2f6c89d1e277..b2bb6e6a141c 100644
@@ -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.c new file +1355 -0

1,355 lines not on this page · raw message

include/linux/mfd/pef2256.h new file +28 -0
new file mode 100644
index 000000000000..0c0afcefa3ef
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * PEF2256 management
+ *
+ * Copyright 2023 CS GROUP France
+ *
+ * Author: Herve Codina <[email protected]>
+ */
+#ifndef __PEF2256_H__
+#define __PEF2256_H__
+
+#include <linux/types.h>
+
+struct pef2256;
+struct notifier_block;
+
+enum pef2256_event {
+	PEF2256_EVENT_CARRIER, /* Carrier state changed */
+};
+
+/* The nb.notifier_call function registered must not sleep */
+int pef2256_register_event_notifier(struct pef2256 *pef2256, struct notifier_block *nb);
+int pef2256_unregister_event_notifier(struct pef2256 *pef2256, struct notifier_block *nb);
+
+/* Retrieve carrier state. true: carrier on, false: carrier off */
+bool pef2256_get_carrier(struct pef2256 *pef2256);
+
+#endif /* __PEF2256_H__ */
Signature · 1 line
2.39.2
#4 lore raw

Re: [PATCH v3 2/6] mfd: Add support for the Lantiq PEF2256 framer

Quoted 7 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.

drivers/mfd/pef2256.c line 1328

Quoted 10 lines
drivers/mfd/pef2256.c new file +10 -0
+static const struct of_device_id pef2256_id_table[] = {
+	{ .compatible = "lantiq,pef2256" },
+	{} /* sentinel */
+};
+MODULE_DEVICE_TABLE(of, pef2256_id_table);
+
+static struct platform_driver pef2256_driver = {
+	.driver = {
+		.name = "lantiq-pef2256",
+		.of_match_table = of_match_ptr(pef2256_id_table),

Drop of_match_ptr. This will case warnings with W=1 and !OF.

Best regards,
Krzysztof

#5 lore raw

Re: [PATCH v3 2/6] mfd: Add support for the Lantiq PEF2256 framer

Quoted 21 lines · On Thu, 23 Mar 2023 08:30:39 +0100 Krzysztof Kozlowski…
Quoted 7 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.

drivers/mfd/pef2256.c line 1328

Quoted 10 lines
drivers/mfd/pef2256.c new file +10 -0
+static const struct of_device_id pef2256_id_table[] = {
+	{ .compatible = "lantiq,pef2256" },
+	{} /* sentinel */
+};
+MODULE_DEVICE_TABLE(of, pef2256_id_table);
+
+static struct platform_driver pef2256_driver = {
+	.driver = {
+		.name = "lantiq-pef2256",
+		.of_match_table = of_match_ptr(pef2256_id_table),  

Drop of_match_ptr. This will case warnings with W=1 and !OF.

Quoted 3 lines

Best regards,
Krzysztof

Acked. Will be dropped in v4.

Thanks.
Hervé

Signature · 3 lines
Hervé Codina, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#6 lore raw

Re: [PATCH v3 2/6] mfd: Add support for the Lantiq PEF2256 framer

In reply to Krzysztof Kozlowski
Quoted 21 lines · On Thu, 23 Mar 2023 08:30:39 +0100 Krzysztof Kozlowski…
Quoted 7 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.

drivers/mfd/pef2256.c line 1328

Quoted 10 lines
drivers/mfd/pef2256.c new file +10 -0
+static const struct of_device_id pef2256_id_table[] = {
+	{ .compatible = "lantiq,pef2256" },
+	{} /* sentinel */
+};
+MODULE_DEVICE_TABLE(of, pef2256_id_table);
+
+static struct platform_driver pef2256_driver = {
+	.driver = {
+		.name = "lantiq-pef2256",
+		.of_match_table = of_match_ptr(pef2256_id_table),  

Drop of_match_ptr. This will case warnings with W=1 and !OF.

Quoted 3 lines

Best regards,
Krzysztof

Acked. Will be dropped in v4.

Thanks.
Hervé

Signature · 3 lines
Hervé Codina, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#7 lore raw

Re: [PATCH v3 2/6] mfd: Add support for the Lantiq PEF2256 framer

In reply to Herve Codina
I love your patch! Yet something to improve:

Hi Herve,

I love your patch! Yet something to improve:

[auto build test ERROR on lee-mfd/for-mfd-next]
[also build test ERROR on broonie-sound/for-next lee-leds/for-leds-next robh/for-next linus/master v6.3-rc3 next-20230324] [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/20230322-214827
base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git for-mfd-next
patch link:    https://lore.kernel.org/r/20230322134654.219957-3-herve.codina%40bootlin.com
patch subject: [PATCH v3 2/6] mfd: Add support for the Lantiq PEF2256 framer
config: parisc-randconfig-p001-20230326 (https://download.01.org/0day-ci/archive/20230326/[email protected]/config)
compiler: hppa-linux-gcc (GCC) 12.1.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/53e683ee1cad96a898f7fed03f88a3898e8dcd15
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/20230322-214827 git checkout 53e683ee1cad96a898f7fed03f88a3898e8dcd15
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=parisc olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=parisc SHELL=/bin/bash

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]/

All errors (new ones prefixed by >>):

hppa-linux-ld: drivers/mfd/pef2256.o: in function `.LC58':

>> pef2256.c:(.rodata.cst4+0x54): undefined reference to `pinconf_generic_dt_node_to_map'
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
#8 lore raw

PATCH v3 3/6 Documentation: sysfs: Document the Lantiq PEF2256 sysfs entry

In reply to Herve Codina

Document 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
new file mode 100644
index 000000000000..95ba1ae55daf
@@ -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
#9 lore raw

PATCH v3 4/6 dt-bindings: sound: Add support for the Lantiq PEF2256 codec

In reply to 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.

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.

---
 .../bindings/sound/lantiq,pef2256-codec.yaml  | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml
Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml new file +54 -0
new file mode 100644
index 000000000000..da35b70cda99
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/lantiq,pef2256-codec.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Lantiq PEF2256 codec
+
+maintainers:
+  - Herve Codina <[email protected]>
+
+description: |
+  Codec support for PEF2256.
+
+  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.
+
+  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.
+
+  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 ALSA 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.
+
+  The PEF2256 codec node should be a child of a PEF2256 node.
+  Refer to the bindings described in
+  Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml
+
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  compatible:
+    const: lantiq,pef2256-codec
+
+  '#sound-dai-cells':
+    const: 0
+
+required:
+  - compatible
+  - '#sound-dai-cells'
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    codec {
+        compatible = "lantiq,pef2256-codec";
+        #sound-dai-cells = <0>;
+    };
Signature · 1 line
2.39.2
#10 lore raw

Re: [PATCH v3 4/6] dt-bindings: sound: Add support for the Lantiq PEF2256 codec

Quoted 51 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.

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.

---
 .../bindings/sound/lantiq,pef2256-codec.yaml  | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml
Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml new file +31 -0
new file mode 100644
index 000000000000..da35b70cda99
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/lantiq,pef2256-codec.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Lantiq PEF2256 codec
+
+maintainers:
+  - Herve Codina <[email protected]>
+
+description: |
+  Codec support for PEF2256.
+
+  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.
+
+  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.
+
+  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 ALSA 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.
+
+  The PEF2256 codec node should be a child of a PEF2256 node.
+  Refer to the bindings described in
+  Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml

Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml line 41

Quoted 10 lines
Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml new file +10 -0
+
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  compatible:
+    const: lantiq,pef2256-codec
+
+  '#sound-dai-cells':
+    const: 0

You do not have here any resources, so the entire binding can be dropped and merged into the parent.

Best regards,
Krzysztof

#11 lore raw

Re: [PATCH v3 4/6] dt-bindings: sound: Add support for the Lantiq PEF2256 codec

Hi Krzysztof

Quoted 66 lines · On Wed, 22 Mar 2023 22:59:37 +0100 Krzysztof Kozlowski…
Quoted 51 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.

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.

---
 .../bindings/sound/lantiq,pef2256-codec.yaml  | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml
Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml new file +31 -0
new file mode 100644
index 000000000000..da35b70cda99
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/lantiq,pef2256-codec.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Lantiq PEF2256 codec
+
+maintainers:
+  - Herve Codina <[email protected]>
+
+description: |
+  Codec support for PEF2256.
+
+  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.
+
+  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.
+
+  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 ALSA 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.
+
+  The PEF2256 codec node should be a child of a PEF2256 node.
+  Refer to the bindings described in
+  Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml

Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml line 41

Quoted 10 lines
Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml new file +10 -0
+
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  compatible:
+    const: lantiq,pef2256-codec
+
+  '#sound-dai-cells':
+    const: 0  

You do not have here any resources, so the entire binding can be dropped and merged into the parent.

Quoted 3 lines

Best regards,
Krzysztof

Ok,
Do you expect all these properties (except compatible) merged at the parent level or may I keep a child node with these properties including the compatible property (ie. yaml file merge).

Regards,
Hervé

Signature · 3 lines
Hervé Codina, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#12 lore raw

Re: [PATCH v3 4/6] dt-bindings: sound: Add support for the Lantiq PEF2256 codec

Quoted 71 lines · Herve Codina

Hi Krzysztof

Quoted 66 lines · On Wed, 22 Mar 2023 22:59:37 +0100 Krzysztof Kozlowski…
Quoted 51 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.

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.

---
 .../bindings/sound/lantiq,pef2256-codec.yaml  | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml
Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml new file +31 -0
new file mode 100644
index 000000000000..da35b70cda99
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/lantiq,pef2256-codec.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Lantiq PEF2256 codec
+
+maintainers:
+  - Herve Codina <[email protected]>
+
+description: |
+  Codec support for PEF2256.
+
+  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.
+
+  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.
+
+  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 ALSA 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.
+
+  The PEF2256 codec node should be a child of a PEF2256 node.
+  Refer to the bindings described in
+  Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml

Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml line 41

Quoted 10 lines
Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml new file +10 -0
+
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  compatible:
+    const: lantiq,pef2256-codec
+
+  '#sound-dai-cells':
+    const: 0  

You do not have here any resources, so the entire binding can be dropped and merged into the parent.

Quoted 6 lines
Quoted 3 lines

Best regards,
Krzysztof

Ok,
Do you expect all these properties (except compatible) merged at the parent

You have only two properties here - dai cells and name-prefix...

Quoted 2 lines

level or may I keep a child node with these properties including the compatible property (ie. yaml file merge).

I was thinking that these should be merged into parent because usually you do not need child node for this. However now I started to think how the codec driver would look like. Essentially the parent MFD driver would need to register dais...

Best regards,
Krzysztof

#13 lore raw

Re: [PATCH v3 4/6] dt-bindings: sound: Add support for the Lantiq PEF2256 codec

Quoted 81 lines · On Thu, 23 Mar 2023 08:31:28 +0100 Krzysztof Kozlowski…
Quoted 71 lines · Herve Codina

Hi Krzysztof

Quoted 66 lines · On Wed, 22 Mar 2023 22:59:37 +0100 Krzysztof Kozlowski…
Quoted 51 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.

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.

---
 .../bindings/sound/lantiq,pef2256-codec.yaml  | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml
Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml new file +31 -0
new file mode 100644
index 000000000000..da35b70cda99
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/lantiq,pef2256-codec.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Lantiq PEF2256 codec
+
+maintainers:
+  - Herve Codina <[email protected]>
+
+description: |
+  Codec support for PEF2256.
+
+  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.
+
+  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.
+
+  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 ALSA 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.
+
+  The PEF2256 codec node should be a child of a PEF2256 node.
+  Refer to the bindings described in
+  Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml

Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml line 41

Quoted 10 lines
Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml new file +10 -0
+
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  compatible:
+    const: lantiq,pef2256-codec
+
+  '#sound-dai-cells':
+    const: 0    

You do not have here any resources, so the entire binding can be dropped and merged into the parent.

Quoted 6 lines
Quoted 3 lines

Best regards,
Krzysztof

Ok,
Do you expect all these properties (except compatible) merged at the parent

You have only two properties here - dai cells and name-prefix...

Quoted 8 lines
Quoted 2 lines

level or may I keep a child node with these properties including the compatible property (ie. yaml file merge).

I was thinking that these should be merged into parent because usually you do not need child node for this. However now I started to think how the codec driver would look like. Essentially the parent MFD driver would need to register dais...

There is also something specific to audio, the slots definition 'dai-tdm-slot-tx-mask' and 'dai-tdm-slot-rx-mask'. These slots definitions are set at the ALSA sound card sub-nodes.
So, I can have multiple codec in the PEF2256.

For instance:

  framer {
    compatible = "lantiq,pef2256", "simple-mfd";
    ...
    pef2256_codec0: codec0 {
      compatible = "lantiq,pef2256-codec";
      #sound-dai-cells = <0>;
    };
    pef2256_codec1: codec1 {
      compatible = "lantiq,pef2256-codec";
      #sound-dai-cells = <0>;
    };

};

  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 2, 3, 4, 5 */
	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 6, 7, 8, 9 */
	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>;
      };
    };

};

To solve this, I can use #sound-dai-cells = <1>; but this will complicate the driver itself and is it really needed ?
Having "simple-mfd" dans sub-nodes keep all things simple.

Regards,
Hervé

Signature · 3 lines
Hervé Codina, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#14 lore raw

Re: [PATCH v3 4/6] dt-bindings: sound: Add support for the Lantiq PEF2256 codec

Quoted 110 lines · Herve Codina
Quoted 81 lines · On Thu, 23 Mar 2023 08:31:28 +0100 Krzysztof Kozlowski…
Quoted 71 lines · Herve Codina

Hi Krzysztof

Quoted 66 lines · On Wed, 22 Mar 2023 22:59:37 +0100 Krzysztof Kozlowski…
Quoted 51 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.

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.

---
 .../bindings/sound/lantiq,pef2256-codec.yaml  | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml
Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml new file +31 -0
new file mode 100644
index 000000000000..da35b70cda99
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/lantiq,pef2256-codec.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Lantiq PEF2256 codec
+
+maintainers:
+  - Herve Codina <[email protected]>
+
+description: |
+  Codec support for PEF2256.
+
+  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.
+
+  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.
+
+  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 ALSA 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.
+
+  The PEF2256 codec node should be a child of a PEF2256 node.
+  Refer to the bindings described in
+  Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml

Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml line 41

Quoted 10 lines
Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml new file +10 -0
+
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  compatible:
+    const: lantiq,pef2256-codec
+
+  '#sound-dai-cells':
+    const: 0    

You do not have here any resources, so the entire binding can be dropped and merged into the parent.

Quoted 6 lines
Quoted 3 lines

Best regards,
Krzysztof

Ok,
Do you expect all these properties (except compatible) merged at the parent

You have only two properties here - dai cells and name-prefix...

Quoted 8 lines
Quoted 2 lines

level or may I keep a child node with these properties including the compatible property (ie. yaml file merge).

I was thinking that these should be merged into parent because usually you do not need child node for this. However now I started to think how the codec driver would look like. Essentially the parent MFD driver would need to register dais...

There is also something specific to audio, the slots definition 'dai-tdm-slot-tx-mask' and 'dai-tdm-slot-rx-mask'. These slots definitions are set at the ALSA sound card sub-nodes.
So, I can have multiple codec in the PEF2256.

For instance:

  framer {
    compatible = "lantiq,pef2256", "simple-mfd";
    ...
    pef2256_codec0: codec0 {
      compatible = "lantiq,pef2256-codec";
      #sound-dai-cells = <0>;
    };
    pef2256_codec1: codec1 {
      compatible = "lantiq,pef2256-codec";
      #sound-dai-cells = <0>;
    };
Quoted 1 line

};

Then include it in the example. It would cut short this discussion.

Best regards,
Krzysztof

#15 lore raw

Re: [PATCH v3 4/6] dt-bindings: sound: Add support for the Lantiq PEF2256 codec

In reply to Krzysztof Kozlowski
Quoted 81 lines · On Thu, 23 Mar 2023 08:31:28 +0100 Krzysztof Kozlowski…
Quoted 71 lines · Herve Codina

Hi Krzysztof

Quoted 66 lines · On Wed, 22 Mar 2023 22:59:37 +0100 Krzysztof Kozlowski…
Quoted 51 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.

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.

---
 .../bindings/sound/lantiq,pef2256-codec.yaml  | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml
Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml new file +31 -0
new file mode 100644
index 000000000000..da35b70cda99
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/lantiq,pef2256-codec.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Lantiq PEF2256 codec
+
+maintainers:
+  - Herve Codina <[email protected]>
+
+description: |
+  Codec support for PEF2256.
+
+  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.
+
+  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.
+
+  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 ALSA 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.
+
+  The PEF2256 codec node should be a child of a PEF2256 node.
+  Refer to the bindings described in
+  Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml

Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml line 41

Quoted 10 lines
Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml new file +10 -0
+
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  compatible:
+    const: lantiq,pef2256-codec
+
+  '#sound-dai-cells':
+    const: 0    

You do not have here any resources, so the entire binding can be dropped and merged into the parent.

Quoted 6 lines
Quoted 3 lines

Best regards,
Krzysztof

Ok,
Do you expect all these properties (except compatible) merged at the parent

You have only two properties here - dai cells and name-prefix...

Quoted 8 lines
Quoted 2 lines

level or may I keep a child node with these properties including the compatible property (ie. yaml file merge).

I was thinking that these should be merged into parent because usually you do not need child node for this. However now I started to think how the codec driver would look like. Essentially the parent MFD driver would need to register dais...

There is also something specific to audio, the slots definition 'dai-tdm-slot-tx-mask' and 'dai-tdm-slot-rx-mask'. These slots definitions are set at the ALSA sound card sub-nodes.
So, I can have multiple codec in the PEF2256.

For instance:

  framer {
    compatible = "lantiq,pef2256", "simple-mfd";
    ...
    pef2256_codec0: codec0 {
      compatible = "lantiq,pef2256-codec";
      #sound-dai-cells = <0>;
    };
    pef2256_codec1: codec1 {
      compatible = "lantiq,pef2256-codec";
      #sound-dai-cells = <0>;
    };

};

  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 2, 3, 4, 5 */
	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 6, 7, 8, 9 */
	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>;
      };
    };

};

To solve this, I can use #sound-dai-cells = <1>; but this will complicate the driver itself and is it really needed ?
Having "simple-mfd" dans sub-nodes keep all things simple.

Regards,
Hervé

Signature · 3 lines
Hervé Codina, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#16 lore raw

Re: [PATCH v3 4/6] dt-bindings: sound: Add support for the Lantiq PEF2256 codec

In reply to Krzysztof Kozlowski

Hi Krzysztof

Quoted 66 lines · On Wed, 22 Mar 2023 22:59:37 +0100 Krzysztof Kozlowski…
Quoted 51 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.

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.

---
 .../bindings/sound/lantiq,pef2256-codec.yaml  | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml
Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml new file +31 -0
new file mode 100644
index 000000000000..da35b70cda99
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/lantiq,pef2256-codec.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Lantiq PEF2256 codec
+
+maintainers:
+  - Herve Codina <[email protected]>
+
+description: |
+  Codec support for PEF2256.
+
+  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.
+
+  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.
+
+  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 ALSA 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.
+
+  The PEF2256 codec node should be a child of a PEF2256 node.
+  Refer to the bindings described in
+  Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml

Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml line 41

Quoted 10 lines
Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml new file +10 -0
+
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  compatible:
+    const: lantiq,pef2256-codec
+
+  '#sound-dai-cells':
+    const: 0  

You do not have here any resources, so the entire binding can be dropped and merged into the parent.

Quoted 3 lines

Best regards,
Krzysztof

Ok,
Do you expect all these properties (except compatible) merged at the parent level or may I keep a child node with these properties including the compatible property (ie. yaml file merge).

Regards,
Hervé

Signature · 3 lines
Hervé Codina, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#17 lore raw

PATCH v3 5/6 ASoC: codecs: Add support for the Lantiq PEF2256 codec

In reply to 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.

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
index 0be061953e9a..4f78da914fc7 100644
@@ -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
index 20b388b77f1f..11bd66d46f7b 100644
@@ -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
#18 lore raw

PATCH v3 6/6 MAINTAINERS: Add the Lantiq PEF2256 driver entry

In reply to Herve Codina

After contributing the driver, add myself as the maintainer for the Lantiq PEF2256 driver.

---
 MAINTAINERS | 10 ++++++++++
 1 file changed, 10 insertions(+)
MAINTAINERS +10 -0
index fcb69242cd19..be38a24c031c 100644
@@ -11651,6 +11651,16 @@ 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:	Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml
+F:	drivers/mfd/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
#19 lore raw

PATCH v3 1/6 dt-bindings: mfd: Add the Lantiq PEF2256 E1/T1/J1 framer

In reply to 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.

---
 .../bindings/mfd/lantiq,pef2256.yaml          | 205 ++++++++++++++++++
 1 file changed, 205 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml
Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml new file +205 -0
new file mode 100644
index 000000000000..affbf20df0a2
@@ -0,0 +1,205 @@
+# 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#
+
+    patternProperties:
+      '-pins$':
+        type: object
+        $ref: /schemas/pinctrl/pincfg-node.yaml#
+
+        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 ]
+
+        additionalProperties: false
+
+        required:
+          - pins
+          - function
+
+    additionalProperties: false
+
+  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])?$':
+    $ref: /schemas/sound/lantiq,pef2256-codec.yaml
+
+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)
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - interrupts
+
+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";
+        };
+      };
+
+      codec {
+        compatible = "lantiq,pef2256-codec";
+        #sound-dai-cells = <0>;
+      };
+    };
Signature · 1 line
2.39.2
#20 lore raw

PATCH v3 2/6 mfd: Add support for the Lantiq PEF2256 framer

In reply to 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.

---
 drivers/mfd/Kconfig         |   16 +
 drivers/mfd/Makefile        |    1 +
 drivers/mfd/pef2256.c       | 1355 +++++++++++++++++++++++++++++++++++
 include/linux/mfd/pef2256.h |   28 +
 4 files changed, 1400 insertions(+)
 create mode 100644 drivers/mfd/pef2256.c
 create mode 100644 include/linux/mfd/pef2256.h
drivers/mfd/Kconfig +16 -0
index fcc141e067b9..174c6fe3e539 100644
@@ -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"
+	select PINCTRL
+	select PINMUX
+	select GENERIC_PINCONF
+	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
index 2f6c89d1e277..b2bb6e6a141c 100644
@@ -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.c new file +1355 -0

1,355 lines not on this page · raw message

include/linux/mfd/pef2256.h new file +28 -0
new file mode 100644
index 000000000000..0c0afcefa3ef
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * PEF2256 management
+ *
+ * Copyright 2023 CS GROUP France
+ *
+ * Author: Herve Codina <[email protected]>
+ */
+#ifndef __PEF2256_H__
+#define __PEF2256_H__
+
+#include <linux/types.h>
+
+struct pef2256;
+struct notifier_block;
+
+enum pef2256_event {
+	PEF2256_EVENT_CARRIER, /* Carrier state changed */
+};
+
+/* The nb.notifier_call function registered must not sleep */
+int pef2256_register_event_notifier(struct pef2256 *pef2256, struct notifier_block *nb);
+int pef2256_unregister_event_notifier(struct pef2256 *pef2256, struct notifier_block *nb);
+
+/* Retrieve carrier state. true: carrier on, false: carrier off */
+bool pef2256_get_carrier(struct pef2256 *pef2256);
+
+#endif /* __PEF2256_H__ */
Signature · 1 line
2.39.2
#21 lore raw

Re: [PATCH v3 2/6] mfd: Add support for the Lantiq PEF2256 framer

Thank you for the patch! Yet something to improve:

Hi Herve,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on lee-mfd/for-mfd-next]
[also build test ERROR on broonie-sound/for-next lee-leds/for-leds-next robh/for-next linus/master v6.3-rc3 next-20230324] [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-via-Alsa-devel/mfd-Add-support-for-the-Lantiq-PEF2256-framer/20230322-215208
base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git for-mfd-next
patch link:    https://lore.kernel.org/r/167949286900.26.3992817728812049195%40mailman-core.alsa-project.org
patch subject: [PATCH v3 2/6] mfd: Add support for the Lantiq PEF2256 framer
config: m68k-randconfig-c024-20230326 (https://download.01.org/0day-ci/archive/20230327/[email protected]/config)
compiler: m68k-linux-gcc (GCC) 12.1.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/d60948895815b59306d870e7c189741b7d14d5e2
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Herve-Codina-via-Alsa-devel/mfd-Add-support-for-the-Lantiq-PEF2256-framer/20230322-215208 git checkout d60948895815b59306d870e7c189741b7d14d5e2
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k SHELL=/bin/bash

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]/

All errors (new ones prefixed by >>):

m68k-linux-ld: drivers/mfd/pef2256.o: in function `pinconf_generic_dt_node_to_map_pin':

>> pef2256.c:(.text+0x280): undefined reference to `pinconf_generic_dt_node_to_map'
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
#22 lore raw

PATCH v3 3/6 Documentation: sysfs: Document the Lantiq PEF2256 sysfs entry

In reply to Herve Codina

Document 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
new file mode 100644
index 000000000000..95ba1ae55daf
@@ -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
#23 lore raw

PATCH v3 4/6 dt-bindings: sound: Add support for the Lantiq PEF2256 codec

In reply to 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.

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.

---
 .../bindings/sound/lantiq,pef2256-codec.yaml  | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml
Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml new file +54 -0
new file mode 100644
index 000000000000..da35b70cda99
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/lantiq,pef2256-codec.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Lantiq PEF2256 codec
+
+maintainers:
+  - Herve Codina <[email protected]>
+
+description: |
+  Codec support for PEF2256.
+
+  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.
+
+  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.
+
+  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 ALSA 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.
+
+  The PEF2256 codec node should be a child of a PEF2256 node.
+  Refer to the bindings described in
+  Documentation/devicetree/bindings/mfd/lantiq,pef2256.yaml
+
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  compatible:
+    const: lantiq,pef2256-codec
+
+  '#sound-dai-cells':
+    const: 0
+
+required:
+  - compatible
+  - '#sound-dai-cells'
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    codec {
+        compatible = "lantiq,pef2256-codec";
+        #sound-dai-cells = <0>;
+    };
Signature · 1 line
2.39.2
#24 lore raw

PATCH v3 5/6 ASoC: codecs: Add support for the Lantiq PEF2256 codec

In reply to 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.

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
index 0be061953e9a..4f78da914fc7 100644
@@ -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
index 20b388b77f1f..11bd66d46f7b 100644
@@ -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
#25 lore raw

PATCH v3 6/6 MAINTAINERS: Add the Lantiq PEF2256 driver entry

In reply to Herve Codina

After contributing the driver, add myself as the maintainer for the Lantiq PEF2256 driver.

---
 MAINTAINERS | 10 ++++++++++
 1 file changed, 10 insertions(+)
MAINTAINERS +10 -0
index fcb69242cd19..be38a24c031c 100644
@@ -11651,6 +11651,16 @@ 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:	Documentation/devicetree/bindings/sound/lantiq,pef2256-codec.yaml
+F:	drivers/mfd/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