* [PATCH v4 1/6 RESEND] dt-bindings: leds: leds-cpcap: convert to DT schema
2026-04-28 15:36 [PATCH v4 0/6 RESEND] mfd: cpcap: convert documentation to schema and add Mot board support Svyatoslav Ryhel
@ 2026-04-28 15:36 ` Svyatoslav Ryhel
2026-04-28 17:15 ` Rob Herring (Arm)
2026-04-28 15:36 ` [PATCH v4 2/6 RESEND] dt-bindings: input: cpcap-pwrbutton: " Svyatoslav Ryhel
` (4 subsequent siblings)
5 siblings, 1 reply; 14+ messages in thread
From: Svyatoslav Ryhel @ 2026-04-28 15:36 UTC (permalink / raw)
To: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Lee Jones, Pavel Machek, Svyatoslav Ryhel, David Lechner,
Tony Lindgren
Cc: linux-input, devicetree, linux-kernel, linux-leds
Convert LEDs devicetree bindings for the Motorola CPCAP MFD from TXT to
YAML format. This patch does not change any functionality; the bindings
remain the same.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
---
.../devicetree/bindings/leds/leds-cpcap.txt | 29 -------------
.../bindings/leds/motorola,cpcap-leds.yaml | 42 +++++++++++++++++++
2 files changed, 42 insertions(+), 29 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/leds/leds-cpcap.txt
create mode 100644 Documentation/devicetree/bindings/leds/motorola,cpcap-leds.yaml
diff --git a/Documentation/devicetree/bindings/leds/leds-cpcap.txt b/Documentation/devicetree/bindings/leds/leds-cpcap.txt
deleted file mode 100644
index ebf7cdc7f70c..000000000000
--- a/Documentation/devicetree/bindings/leds/leds-cpcap.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-Motorola CPCAP PMIC LEDs
-------------------------
-
-This module is part of the CPCAP. For more details about the whole
-chip see Documentation/devicetree/bindings/mfd/motorola-cpcap.txt.
-
-Requires node properties:
-- compatible: should be one of
- * "motorola,cpcap-led-mdl" (Main Display Lighting)
- * "motorola,cpcap-led-kl" (Keyboard Lighting)
- * "motorola,cpcap-led-adl" (Aux Display Lighting)
- * "motorola,cpcap-led-red" (Red Triode)
- * "motorola,cpcap-led-green" (Green Triode)
- * "motorola,cpcap-led-blue" (Blue Triode)
- * "motorola,cpcap-led-cf" (Camera Flash)
- * "motorola,cpcap-led-bt" (Bluetooth)
- * "motorola,cpcap-led-cp" (Camera Privacy LED)
-- label: see Documentation/devicetree/bindings/leds/common.txt
-- vdd-supply: A phandle to the regulator powering the LED
-
-Example:
-
-&cpcap {
- cpcap_led_red: red-led {
- compatible = "motorola,cpcap-led-red";
- label = "cpcap:red";
- vdd-supply = <&sw5>;
- };
-};
diff --git a/Documentation/devicetree/bindings/leds/motorola,cpcap-leds.yaml b/Documentation/devicetree/bindings/leds/motorola,cpcap-leds.yaml
new file mode 100644
index 000000000000..c8e7b88a05cc
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/motorola,cpcap-leds.yaml
@@ -0,0 +1,42 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/motorola,cpcap-leds.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Motorola CPCAP PMIC LEDs
+
+maintainers:
+ - Svyatoslav Ryhel <clamor95@gmail.com>
+
+description:
+ This module is part of the Motorola CPCAP MFD device. For more details
+ see Documentation/devicetree/bindings/mfd/motorola,cpcap.yaml. LEDs are
+ represented as sub-nodes of the PMIC node on the device tree.
+
+allOf:
+ - $ref: /schemas/leds/common.yaml#
+
+properties:
+ compatible:
+ enum:
+ - motorola,cpcap-led-adl # Display Lighting
+ - motorola,cpcap-led-blue # Blue Triode
+ - motorola,cpcap-led-bt # Bluetooth
+ - motorola,cpcap-led-cf # Camera Flash
+ - motorola,cpcap-led-cp # Camera Privacy LED
+ - motorola,cpcap-led-green # Green Triode
+ - motorola,cpcap-led-kl # Keyboard Lighting
+ - motorola,cpcap-led-mdl # Main Display Lighting
+ - motorola,cpcap-led-red # Red Triode
+
+ vdd-supply: true
+
+required:
+ - compatible
+ - label
+ - vdd-supply
+
+unevaluatedProperties: false
+
+...
--
2.51.0
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH v4 1/6 RESEND] dt-bindings: leds: leds-cpcap: convert to DT schema
2026-04-28 15:36 ` [PATCH v4 1/6 RESEND] dt-bindings: leds: leds-cpcap: convert to DT schema Svyatoslav Ryhel
@ 2026-04-28 17:15 ` Rob Herring (Arm)
0 siblings, 0 replies; 14+ messages in thread
From: Rob Herring (Arm) @ 2026-04-28 17:15 UTC (permalink / raw)
To: Svyatoslav Ryhel
Cc: Pavel Machek, Lee Jones, Dmitry Torokhov, linux-input,
Krzysztof Kozlowski, David Lechner, Conor Dooley, devicetree,
Tony Lindgren, linux-kernel, linux-leds
On Tue, 28 Apr 2026 18:36:06 +0300, Svyatoslav Ryhel wrote:
> Convert LEDs devicetree bindings for the Motorola CPCAP MFD from TXT to
> YAML format. This patch does not change any functionality; the bindings
> remain the same.
>
> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
> ---
> .../devicetree/bindings/leds/leds-cpcap.txt | 29 -------------
> .../bindings/leds/motorola,cpcap-leds.yaml | 42 +++++++++++++++++++
> 2 files changed, 42 insertions(+), 29 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/leds/leds-cpcap.txt
> create mode 100644 Documentation/devicetree/bindings/leds/motorola,cpcap-leds.yaml
>
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:
dtschema/dtc warnings/errors:
doc reference errors (make refcheckdocs):
Warning: Documentation/devicetree/bindings/leds/motorola,cpcap-leds.yaml references a file that doesn't exist: Documentation/devicetree/bindings/mfd/motorola,cpcap.yaml
Warning: Documentation/devicetree/bindings/mfd/motorola-cpcap.txt references a file that doesn't exist: Documentation/devicetree/bindings/leds/leds-cpcap.txt
Documentation/devicetree/bindings/leds/motorola,cpcap-leds.yaml: Documentation/devicetree/bindings/mfd/motorola,cpcap.yaml
Documentation/devicetree/bindings/mfd/motorola-cpcap.txt: Documentation/devicetree/bindings/leds/leds-cpcap.txt
See https://patchwork.kernel.org/project/devicetree/patch/20260428153611.142816-2-clamor95@gmail.com
The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v4 2/6 RESEND] dt-bindings: input: cpcap-pwrbutton: convert to DT schema
2026-04-28 15:36 [PATCH v4 0/6 RESEND] mfd: cpcap: convert documentation to schema and add Mot board support Svyatoslav Ryhel
2026-04-28 15:36 ` [PATCH v4 1/6 RESEND] dt-bindings: leds: leds-cpcap: convert to DT schema Svyatoslav Ryhel
@ 2026-04-28 15:36 ` Svyatoslav Ryhel
2026-04-28 17:15 ` Rob Herring (Arm)
2026-04-28 15:36 ` [PATCH v4 3/6 RESEND] dt-bindings: mfd: motorola-cpcap: " Svyatoslav Ryhel
` (3 subsequent siblings)
5 siblings, 1 reply; 14+ messages in thread
From: Svyatoslav Ryhel @ 2026-04-28 15:36 UTC (permalink / raw)
To: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Lee Jones, Pavel Machek, Svyatoslav Ryhel, David Lechner,
Tony Lindgren
Cc: linux-input, devicetree, linux-kernel, linux-leds
Convert power button devicetree bindings for the Motorola CPCAP MFD from
TXT to YAML format. This patch does not change any functionality; the
bindings remain the same.
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
---
.../bindings/input/cpcap-pwrbutton.txt | 20 ------------
.../input/motorola,cpcap-pwrbutton.yaml | 32 +++++++++++++++++++
2 files changed, 32 insertions(+), 20 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/input/cpcap-pwrbutton.txt
create mode 100644 Documentation/devicetree/bindings/input/motorola,cpcap-pwrbutton.yaml
diff --git a/Documentation/devicetree/bindings/input/cpcap-pwrbutton.txt b/Documentation/devicetree/bindings/input/cpcap-pwrbutton.txt
deleted file mode 100644
index 0dd0076daf71..000000000000
--- a/Documentation/devicetree/bindings/input/cpcap-pwrbutton.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-Motorola CPCAP on key
-
-This module is part of the CPCAP. For more details about the whole
-chip see Documentation/devicetree/bindings/mfd/motorola-cpcap.txt.
-
-This module provides a simple power button event via an Interrupt.
-
-Required properties:
-- compatible: should be one of the following
- - "motorola,cpcap-pwrbutton"
-- interrupts: irq specifier for CPCAP's ON IRQ
-
-Example:
-
-&cpcap {
- cpcap_pwrbutton: pwrbutton {
- compatible = "motorola,cpcap-pwrbutton";
- interrupts = <23 IRQ_TYPE_NONE>;
- };
-};
diff --git a/Documentation/devicetree/bindings/input/motorola,cpcap-pwrbutton.yaml b/Documentation/devicetree/bindings/input/motorola,cpcap-pwrbutton.yaml
new file mode 100644
index 000000000000..77a3e5a47d1a
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/motorola,cpcap-pwrbutton.yaml
@@ -0,0 +1,32 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/motorola,cpcap-pwrbutton.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Motorola CPCAP PMIC power key
+
+maintainers:
+ - Svyatoslav Ryhel <clamor95@gmail.com>
+
+description:
+ This module is part of the Motorola CPCAP MFD device. For more details
+ see Documentation/devicetree/bindings/mfd/motorola,cpcap.yaml. The
+ power key is represented as a sub-node of the PMIC node on the device
+ tree.
+
+properties:
+ compatible:
+ const: motorola,cpcap-pwrbutton
+
+ interrupts:
+ items:
+ - description: CPCAP's ON interrupt
+
+required:
+ - compatible
+ - interrupts
+
+additionalProperties: false
+
+...
--
2.51.0
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH v4 2/6 RESEND] dt-bindings: input: cpcap-pwrbutton: convert to DT schema
2026-04-28 15:36 ` [PATCH v4 2/6 RESEND] dt-bindings: input: cpcap-pwrbutton: " Svyatoslav Ryhel
@ 2026-04-28 17:15 ` Rob Herring (Arm)
0 siblings, 0 replies; 14+ messages in thread
From: Rob Herring (Arm) @ 2026-04-28 17:15 UTC (permalink / raw)
To: Svyatoslav Ryhel
Cc: Conor Dooley, linux-leds, devicetree, linux-kernel, Tony Lindgren,
Krzysztof Kozlowski, David Lechner, Lee Jones, Dmitry Torokhov,
linux-input, Pavel Machek
On Tue, 28 Apr 2026 18:36:07 +0300, Svyatoslav Ryhel wrote:
> Convert power button devicetree bindings for the Motorola CPCAP MFD from
> TXT to YAML format. This patch does not change any functionality; the
> bindings remain the same.
>
> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
> ---
> .../bindings/input/cpcap-pwrbutton.txt | 20 ------------
> .../input/motorola,cpcap-pwrbutton.yaml | 32 +++++++++++++++++++
> 2 files changed, 32 insertions(+), 20 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/input/cpcap-pwrbutton.txt
> create mode 100644 Documentation/devicetree/bindings/input/motorola,cpcap-pwrbutton.yaml
>
My bot found errors running 'make dt_binding_check' on your patch:
yamllint warnings/errors:
dtschema/dtc warnings/errors:
doc reference errors (make refcheckdocs):
Warning: Documentation/devicetree/bindings/input/motorola,cpcap-pwrbutton.yaml references a file that doesn't exist: Documentation/devicetree/bindings/mfd/motorola,cpcap.yaml
Warning: Documentation/devicetree/bindings/mfd/motorola-cpcap.txt references a file that doesn't exist: Documentation/devicetree/bindings/input/cpcap-pwrbutton.txt
Documentation/devicetree/bindings/input/motorola,cpcap-pwrbutton.yaml: Documentation/devicetree/bindings/mfd/motorola,cpcap.yaml
Documentation/devicetree/bindings/mfd/motorola-cpcap.txt: Documentation/devicetree/bindings/input/cpcap-pwrbutton.txt
See https://patchwork.kernel.org/project/devicetree/patch/20260428153611.142816-3-clamor95@gmail.com
The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v4 3/6 RESEND] dt-bindings: mfd: motorola-cpcap: convert to DT schema
2026-04-28 15:36 [PATCH v4 0/6 RESEND] mfd: cpcap: convert documentation to schema and add Mot board support Svyatoslav Ryhel
2026-04-28 15:36 ` [PATCH v4 1/6 RESEND] dt-bindings: leds: leds-cpcap: convert to DT schema Svyatoslav Ryhel
2026-04-28 15:36 ` [PATCH v4 2/6 RESEND] dt-bindings: input: cpcap-pwrbutton: " Svyatoslav Ryhel
@ 2026-04-28 15:36 ` Svyatoslav Ryhel
2026-04-28 15:36 ` [PATCH v4 4/6 RESEND] dt-bindings: mfd: motorola-cpcap: document Mapphone and Mot CPCAP Svyatoslav Ryhel
` (2 subsequent siblings)
5 siblings, 0 replies; 14+ messages in thread
From: Svyatoslav Ryhel @ 2026-04-28 15:36 UTC (permalink / raw)
To: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Lee Jones, Pavel Machek, Svyatoslav Ryhel, David Lechner,
Tony Lindgren
Cc: linux-input, devicetree, linux-kernel, linux-leds
Convert devicetree bindings for the Motorola CPCAP MFD from TXT to YAML.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
---
.../bindings/mfd/motorola,cpcap.yaml | 414 ++++++++++++++++++
.../bindings/mfd/motorola-cpcap.txt | 78 ----
2 files changed, 414 insertions(+), 78 deletions(-)
create mode 100644 Documentation/devicetree/bindings/mfd/motorola,cpcap.yaml
delete mode 100644 Documentation/devicetree/bindings/mfd/motorola-cpcap.txt
diff --git a/Documentation/devicetree/bindings/mfd/motorola,cpcap.yaml b/Documentation/devicetree/bindings/mfd/motorola,cpcap.yaml
new file mode 100644
index 000000000000..7f257f3a1a5a
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/motorola,cpcap.yaml
@@ -0,0 +1,414 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/motorola,cpcap.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Motorola CPCAP PMIC MFD
+
+maintainers:
+ - Svyatoslav Ryhel <clamor95@gmail.com>
+
+allOf:
+ - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+properties:
+ compatible:
+ items:
+ - const: motorola,cpcap
+ - const: st,6556002
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ interrupt-controller: true
+
+ "#interrupt-cells":
+ const: 2
+
+ "#address-cells":
+ const: 1
+
+ "#size-cells":
+ const: 0
+
+ spi-max-frequency:
+ maximum: 9600000
+
+ spi-cs-high: true
+ spi-cpol: true
+ spi-cpha: true
+
+ adc:
+ $ref: /schemas/iio/adc/motorola,cpcap-adc.yaml#
+
+ audio-codec:
+ type: object
+ additionalProperties: false
+
+ properties:
+ interrupts:
+ items:
+ - description: headset detect interrupt
+ - description: microphone bias 2 detect interrupt
+
+ interrupt-names:
+ items:
+ - const: hs
+ - const: mb2
+
+ "#sound-dai-cells":
+ const: 1
+
+ VAUDIO-supply:
+ description:
+ Codec power supply, usually VAUDIO regulator of CPCAP.
+
+ ports:
+ $ref: /schemas/graph.yaml#/properties/ports
+
+ properties:
+ port@0:
+ $ref: /schemas/graph.yaml#/properties/port
+ description: port connected to the Stereo HiFi DAC
+
+ port@1:
+ $ref: /schemas/graph.yaml#/properties/port
+ description: port connected to the Voice DAC
+
+ required:
+ - port@0
+ - port@1
+
+ required:
+ - interrupts
+ - interrupt-names
+ - "#sound-dai-cells"
+
+ battery:
+ $ref: /schemas/power/supply/cpcap-battery.yaml#
+
+ charger:
+ $ref: /schemas/power/supply/cpcap-charger.yaml#
+
+ key-power:
+ $ref: /schemas/input/motorola,cpcap-pwrbutton.yaml#
+
+ phy:
+ $ref: /schemas/phy/motorola,cpcap-usb-phy.yaml#
+
+ regulator:
+ $ref: /schemas/regulator/motorola,cpcap-regulator.yaml#
+
+ rtc:
+ $ref: /schemas/rtc/motorola,cpcap-rtc.yaml#
+
+patternProperties:
+ "^led(-[a-z]+)?$":
+ $ref: /schemas/leds/motorola,cpcap-leds.yaml#
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - interrupt-controller
+ - "#interrupt-cells"
+ - spi-max-frequency
+ - "#address-cells"
+ - "#size-cells"
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/gpio/gpio.h>
+ #include <dt-bindings/interrupt-controller/irq.h>
+ #include <dt-bindings/input/linux-event-codes.h>
+
+ spi {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ cpcap: pmic@0 {
+ compatible = "motorola,cpcap", "st,6556002";
+ reg = <0>; /* cs0 */
+
+ interrupt-parent = <&gpio1>;
+ interrupts = <7 IRQ_TYPE_EDGE_RISING>;
+
+ interrupt-controller;
+ #interrupt-cells = <2>;
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ spi-max-frequency = <3000000>;
+ spi-cs-high;
+
+ spi-cpol;
+ spi-cpha;
+
+ cpcap_adc: adc {
+ compatible = "motorola,cpcap-adc";
+
+ interrupt-parent = <&cpcap>;
+ interrupts = <8 IRQ_TYPE_NONE>;
+ interrupt-names = "adcdone";
+
+ #io-channel-cells = <1>;
+ };
+
+ cpcap_audio: audio-codec {
+ interrupt-parent = <&cpcap>;
+ interrupts = <9 IRQ_TYPE_NONE>, <10 IRQ_TYPE_NONE>;
+ interrupt-names = "hs", "mb2";
+
+ VAUDIO-supply = <&vdd_audio>;
+
+ #sound-dai-cells = <1>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ /* HiFi */
+ port@0 {
+ reg = <0>;
+
+ cpcap_audio_codec0: endpoint {
+ };
+ };
+
+ /* Voice */
+ port@1 {
+ reg = <1>;
+
+ cpcap_audio_codec1: endpoint {
+ };
+ };
+ };
+ };
+
+ cpcap_battery: battery {
+ compatible = "motorola,cpcap-battery";
+
+ interrupt-parent = <&cpcap>;
+ interrupts = <6 IRQ_TYPE_NONE>, <5 IRQ_TYPE_NONE>,
+ <3 IRQ_TYPE_NONE>, <20 IRQ_TYPE_NONE>,
+ <54 IRQ_TYPE_NONE>, <57 IRQ_TYPE_NONE>;
+ interrupt-names = "eol", "lowbph", "lowbpl",
+ "chrgcurr1", "battdetb", "cccal";
+
+ io-channels = <&cpcap_adc 0>, <&cpcap_adc 1>,
+ <&cpcap_adc 5>, <&cpcap_adc 6>;
+ io-channel-names = "battdetb", "battp",
+ "chg_isense", "batti";
+ power-supplies = <&cpcap_charger>;
+ };
+
+ cpcap_charger: charger {
+ compatible = "motorola,mapphone-cpcap-charger";
+
+ interrupt-parent = <&cpcap>;
+ interrupts = <13 IRQ_TYPE_NONE>, <12 IRQ_TYPE_NONE>,
+ <29 IRQ_TYPE_NONE>, <28 IRQ_TYPE_NONE>,
+ <22 IRQ_TYPE_NONE>, <21 IRQ_TYPE_NONE>,
+ <20 IRQ_TYPE_NONE>, <19 IRQ_TYPE_NONE>,
+ <54 IRQ_TYPE_NONE>;
+ interrupt-names = "chrg_det", "rvrs_chrg", "chrg_se1b",
+ "se0conn", "rvrs_mode", "chrgcurr2",
+ "chrgcurr1", "vbusvld", "battdetb";
+
+ mode-gpios = <&gpio3 29 GPIO_ACTIVE_LOW>,
+ <&gpio3 23 GPIO_ACTIVE_LOW>;
+
+ io-channels = <&cpcap_adc 0>, <&cpcap_adc 1>,
+ <&cpcap_adc 2>, <&cpcap_adc 5>,
+ <&cpcap_adc 6>;
+ io-channel-names = "battdetb", "battp",
+ "vbus", "chg_isense",
+ "batti";
+ };
+
+ key-power {
+ compatible = "motorola,cpcap-pwrbutton";
+
+ interrupt-parent = <&cpcap>;
+ interrupts = <23 IRQ_TYPE_NONE>;
+ };
+
+ led-red {
+ compatible = "motorola,cpcap-led-red";
+ vdd-supply = <&vdd_led>;
+ label = "status-led::red";
+ };
+
+ led-green {
+ compatible = "motorola,cpcap-led-green";
+ vdd-supply = <&vdd_led>;
+ label = "status-led::green";
+ };
+
+ led-blue {
+ compatible = "motorola,cpcap-led-blue";
+ vdd-supply = <&vdd_led>;
+ label = "status-led::blue";
+ };
+
+ cpcap_usb2_phy: phy {
+ compatible = "motorola,cpcap-usb-phy";
+
+ pinctrl-0 = <&usb_gpio_mux_sel1>, <&usb_gpio_mux_sel2>;
+ pinctrl-1 = <&usb_ulpi_pins>;
+ pinctrl-2 = <&usb_utmi_pins>;
+ pinctrl-3 = <&uart3_pins>;
+ pinctrl-names = "default", "ulpi", "utmi", "uart";
+ #phy-cells = <0>;
+
+ interrupts-extended =
+ <&cpcap 15 IRQ_TYPE_NONE>, <&cpcap 14 IRQ_TYPE_NONE>,
+ <&cpcap 28 IRQ_TYPE_NONE>, <&cpcap 19 IRQ_TYPE_NONE>,
+ <&cpcap 18 IRQ_TYPE_NONE>, <&cpcap 17 IRQ_TYPE_NONE>,
+ <&cpcap 16 IRQ_TYPE_NONE>, <&cpcap 49 IRQ_TYPE_NONE>,
+ <&cpcap 48 IRQ_TYPE_NONE>;
+ interrupt-names = "id_ground", "id_float", "se0conn",
+ "vbusvld", "sessvld", "sessend",
+ "se1", "dm", "dp";
+
+ mode-gpios = <&gpio2 28 GPIO_ACTIVE_HIGH>,
+ <&gpio1 0 GPIO_ACTIVE_HIGH>;
+
+ io-channels = <&cpcap_adc 2>, <&cpcap_adc 7>;
+ io-channel-names = "vbus", "id";
+
+ vusb-supply = <&avdd_usb>;
+ };
+
+ regulator {
+ compatible = "motorola,cpcap-regulator";
+
+ regulators {
+ vdd_cpu: SW1 {
+ regulator-name = "vdd_cpu";
+ regulator-min-microvolt = <750000>;
+ regulator-max-microvolt = <1125000>;
+ regulator-enable-ramp-delay = <1500>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ vdd_core: SW2 {
+ regulator-name = "vdd_core";
+ regulator-min-microvolt = <950000>;
+ regulator-max-microvolt = <1300000>;
+ regulator-enable-ramp-delay = <1500>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ vdd_1v8_vio: SW3 {
+ regulator-name = "vdd_1v8_vio";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-enable-ramp-delay = <0>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ vdd_aon: SW4 {
+ regulator-name = "vdd_aon";
+ regulator-min-microvolt = <950000>;
+ regulator-max-microvolt = <1300000>;
+ regulator-enable-ramp-delay = <1500>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ vdd_led: SW5 {
+ regulator-name = "vdd_led";
+ regulator-min-microvolt = <5050000>;
+ regulator-max-microvolt = <5050000>;
+ regulator-enable-ramp-delay = <1500>;
+ regulator-boot-on;
+ };
+
+ vdd_hvio: VHVIO {
+ regulator-name = "vdd_hvio";
+ regulator-min-microvolt = <2775000>;
+ regulator-max-microvolt = <2775000>;
+ regulator-enable-ramp-delay = <1000>;
+ };
+
+ vcore_emmc: VSDIO {
+ regulator-name = "vcore_emmc";
+ regulator-min-microvolt = <1500000>;
+ regulator-max-microvolt = <3000000>;
+ regulator-enable-ramp-delay = <1000>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ avdd_dsi_csi: VCSI {
+ regulator-name = "avdd_dsi_csi";
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <1200000>;
+ regulator-enable-ramp-delay = <1000>;
+ regulator-boot-on;
+ };
+
+ avdd_3v3_periph: VWLAN2 {
+ regulator-name = "avdd_3v3_periph";
+ regulator-min-microvolt = <2775000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-enable-ramp-delay = <1000>;
+ regulator-boot-on;
+ };
+
+ vddio_usd: VSIMCARD {
+ regulator-name = "vddio_usd";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <2900000>;
+ regulator-enable-ramp-delay = <1000>;
+ regulator-boot-on;
+ };
+
+ vdd_haptic: VVIB {
+ regulator-name = "vdd_haptic";
+ regulator-min-microvolt = <1300000>;
+ regulator-max-microvolt = <3000000>;
+ regulator-enable-ramp-delay = <1000>;
+ };
+
+ avdd_usb: VUSB {
+ regulator-name = "avdd_usb";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-enable-ramp-delay = <1000>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ vdd_audio: VAUDIO {
+ regulator-name = "vdd_audio";
+ regulator-min-microvolt = <2775000>;
+ regulator-max-microvolt = <2775000>;
+ regulator-enable-ramp-delay = <1000>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+ };
+ };
+
+ cpcap_rtc: rtc {
+ compatible = "motorola,cpcap-rtc";
+
+ interrupt-parent = <&cpcap>;
+ interrupts = <39 IRQ_TYPE_NONE>, <26 IRQ_TYPE_NONE>;
+ };
+ };
+ };
+
+...
diff --git a/Documentation/devicetree/bindings/mfd/motorola-cpcap.txt b/Documentation/devicetree/bindings/mfd/motorola-cpcap.txt
deleted file mode 100644
index 18c3fc26ca93..000000000000
--- a/Documentation/devicetree/bindings/mfd/motorola-cpcap.txt
+++ /dev/null
@@ -1,78 +0,0 @@
-Motorola CPCAP PMIC device tree binding
-
-Required properties:
-- compatible : One or both of "motorola,cpcap" or "ste,6556002"
-- reg : SPI chip select
-- interrupts : The interrupt line the device is connected to
-- interrupt-controller : Marks the device node as an interrupt controller
-- #interrupt-cells : The number of cells to describe an IRQ, should be 2
-- #address-cells : Child device offset number of cells, should be 1
-- #size-cells : Child device size number of cells, should be 0
-- spi-max-frequency : Typically set to 3000000
-- spi-cs-high : SPI chip select direction
-
-Optional subnodes:
-
-The sub-functions of CPCAP get their own node with their own compatible values,
-which are described in the following files:
-
-- Documentation/devicetree/bindings/power/supply/cpcap-battery.yaml
-- Documentation/devicetree/bindings/power/supply/cpcap-charger.yaml
-- Documentation/devicetree/bindings/regulator/cpcap-regulator.txt
-- Documentation/devicetree/bindings/phy/motorola,cpcap-usb-phy.yaml
-- Documentation/devicetree/bindings/input/cpcap-pwrbutton.txt
-- Documentation/devicetree/bindings/rtc/cpcap-rtc.txt
-- Documentation/devicetree/bindings/leds/leds-cpcap.txt
-- Documentation/devicetree/bindings/iio/adc/motorola,cpcap-adc.yaml
-
-The only exception is the audio codec. Instead of a compatible value its
-node must be named "audio-codec".
-
-Required properties for the audio-codec subnode:
-
-- #sound-dai-cells = <1>;
-- interrupts : should contain jack detection interrupts, with headset
- detect interrupt matching "hs" and microphone bias 2
- detect interrupt matching "mb2" in interrupt-names.
-- interrupt-names : Contains "hs", "mb2"
-
-The audio-codec provides two DAIs. The first one is connected to the
-Stereo HiFi DAC and the second one is connected to the Voice DAC.
-
-Example:
-
-&mcspi1 {
- cpcap: pmic@0 {
- compatible = "motorola,cpcap", "ste,6556002";
- reg = <0>; /* cs0 */
- interrupt-parent = <&gpio1>;
- interrupts = <7 IRQ_TYPE_EDGE_RISING>;
- interrupt-controller;
- #interrupt-cells = <2>;
- #address-cells = <1>;
- #size-cells = <0>;
- spi-max-frequency = <3000000>;
- spi-cs-high;
-
- audio-codec {
- #sound-dai-cells = <1>;
- interrupts-extended = <&cpcap 9 0>, <&cpcap 10 0>;
- interrupt-names = "hs", "mb2";
-
- /* HiFi */
- port@0 {
- endpoint {
- remote-endpoint = <&cpu_dai1>;
- };
- };
-
- /* Voice */
- port@1 {
- endpoint {
- remote-endpoint = <&cpu_dai2>;
- };
- };
- };
- };
-};
-
--
2.51.0
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH v4 4/6 RESEND] dt-bindings: mfd: motorola-cpcap: document Mapphone and Mot CPCAP
2026-04-28 15:36 [PATCH v4 0/6 RESEND] mfd: cpcap: convert documentation to schema and add Mot board support Svyatoslav Ryhel
` (2 preceding siblings ...)
2026-04-28 15:36 ` [PATCH v4 3/6 RESEND] dt-bindings: mfd: motorola-cpcap: " Svyatoslav Ryhel
@ 2026-04-28 15:36 ` Svyatoslav Ryhel
2026-04-28 15:36 ` [PATCH v4 5/6 RESEND] mfd: motorola-cpcap: diverge configuration per-board Svyatoslav Ryhel
2026-04-28 15:36 ` [PATCH v4 6/6 RESEND] mfd: motorola-cpcap: add support for Mot CPCAP composition Svyatoslav Ryhel
5 siblings, 0 replies; 14+ messages in thread
From: Svyatoslav Ryhel @ 2026-04-28 15:36 UTC (permalink / raw)
To: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Lee Jones, Pavel Machek, Svyatoslav Ryhel, David Lechner,
Tony Lindgren
Cc: linux-input, devicetree, linux-kernel, linux-leds
Add compatibles for Mapphone and Mot CPCAP subdevice compositions. Both
variations cannot use st,6556002 fallback since they may be based on
different controllers.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
---
.../devicetree/bindings/mfd/motorola,cpcap.yaml | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/mfd/motorola,cpcap.yaml b/Documentation/devicetree/bindings/mfd/motorola,cpcap.yaml
index 7f257f3a1a5a..542d149d2b39 100644
--- a/Documentation/devicetree/bindings/mfd/motorola,cpcap.yaml
+++ b/Documentation/devicetree/bindings/mfd/motorola,cpcap.yaml
@@ -14,9 +14,14 @@ allOf:
properties:
compatible:
- items:
- - const: motorola,cpcap
- - const: st,6556002
+ oneOf:
+ - enum:
+ - motorola,mapphone-cpcap
+ - motorola,mot-cpcap
+
+ - items:
+ - const: motorola,cpcap
+ - const: st,6556002
reg:
maxItems: 1
--
2.51.0
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH v4 5/6 RESEND] mfd: motorola-cpcap: diverge configuration per-board
2026-04-28 15:36 [PATCH v4 0/6 RESEND] mfd: cpcap: convert documentation to schema and add Mot board support Svyatoslav Ryhel
` (3 preceding siblings ...)
2026-04-28 15:36 ` [PATCH v4 4/6 RESEND] dt-bindings: mfd: motorola-cpcap: document Mapphone and Mot CPCAP Svyatoslav Ryhel
@ 2026-04-28 15:36 ` Svyatoslav Ryhel
2026-05-07 14:05 ` Lee Jones
2026-04-28 15:36 ` [PATCH v4 6/6 RESEND] mfd: motorola-cpcap: add support for Mot CPCAP composition Svyatoslav Ryhel
5 siblings, 1 reply; 14+ messages in thread
From: Svyatoslav Ryhel @ 2026-04-28 15:36 UTC (permalink / raw)
To: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Lee Jones, Pavel Machek, Svyatoslav Ryhel, David Lechner,
Tony Lindgren
Cc: linux-input, devicetree, linux-kernel, linux-leds
MFD have rigid subdevice structure which does not allow flexible dynamic
subdevice linking. Address this by diverging CPCAP subdevice composition
to take into account board specific configuration.
Create a common default subdevice composition, rename existing subdevice
composition into cpcap_mapphone_mfd_devices since it targets mainly
Mapphone board.
Removed st,6556002 as it is no longer applicable to all cases and
duplicates motorola,cpcap, which is used as the default composition.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
drivers/mfd/motorola-cpcap.c | 101 ++++++++++++++++++++++++++++-------
1 file changed, 83 insertions(+), 18 deletions(-)
diff --git a/drivers/mfd/motorola-cpcap.c b/drivers/mfd/motorola-cpcap.c
index d8243b956f87..516d1e33affa 100644
--- a/drivers/mfd/motorola-cpcap.c
+++ b/drivers/mfd/motorola-cpcap.c
@@ -12,6 +12,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
+#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/sysfs.h>
@@ -24,10 +25,16 @@
#define CPCAP_REGISTER_SIZE 4
#define CPCAP_REGISTER_BITS 16
+struct cpcap_chip_data {
+ const struct mfd_cell *mfd_devices;
+ unsigned int num_devices;
+};
+
struct cpcap_ddata {
struct spi_device *spi;
struct regmap_irq *irqs;
struct regmap_irq_chip_data *irqdata[CPCAP_NR_IRQ_CHIPS];
+ const struct cpcap_chip_data *cdata;
const struct regmap_config *regmap_conf;
struct regmap *regmap;
};
@@ -195,20 +202,6 @@ static int cpcap_init_irq(struct cpcap_ddata *cpcap)
return 0;
}
-static const struct of_device_id cpcap_of_match[] = {
- { .compatible = "motorola,cpcap", },
- { .compatible = "st,6556002", },
- {},
-};
-MODULE_DEVICE_TABLE(of, cpcap_of_match);
-
-static const struct spi_device_id cpcap_spi_ids[] = {
- { .name = "cpcap", },
- { .name = "6556002", },
- {},
-};
-MODULE_DEVICE_TABLE(spi, cpcap_spi_ids);
-
static const struct regmap_config cpcap_regmap_config = {
.reg_bits = 16,
.reg_stride = 4,
@@ -241,7 +234,56 @@ static int cpcap_resume(struct device *dev)
static DEFINE_SIMPLE_DEV_PM_OPS(cpcap_pm, cpcap_suspend, cpcap_resume);
-static const struct mfd_cell cpcap_mfd_devices[] = {
+static const struct mfd_cell cpcap_default_mfd_devices[] = {
+ {
+ .name = "cpcap_adc",
+ .of_compatible = "motorola,cpcap-adc",
+ }, {
+ .name = "cpcap_battery",
+ .of_compatible = "motorola,cpcap-battery",
+ }, {
+ .name = "cpcap-regulator",
+ .of_compatible = "motorola,cpcap-regulator",
+ }, {
+ .name = "cpcap-rtc",
+ .of_compatible = "motorola,cpcap-rtc",
+ }, {
+ .name = "cpcap-pwrbutton",
+ .of_compatible = "motorola,cpcap-pwrbutton",
+ }, {
+ .name = "cpcap-usb-phy",
+ .of_compatible = "motorola,cpcap-usb-phy",
+ }, {
+ .name = "cpcap-led",
+ .id = 0,
+ .of_compatible = "motorola,cpcap-led-red",
+ }, {
+ .name = "cpcap-led",
+ .id = 1,
+ .of_compatible = "motorola,cpcap-led-green",
+ }, {
+ .name = "cpcap-led",
+ .id = 2,
+ .of_compatible = "motorola,cpcap-led-blue",
+ }, {
+ .name = "cpcap-led",
+ .id = 3,
+ .of_compatible = "motorola,cpcap-led-adl",
+ }, {
+ .name = "cpcap-led",
+ .id = 4,
+ .of_compatible = "motorola,cpcap-led-cp",
+ }, {
+ .name = "cpcap-codec",
+ },
+};
+
+static const struct cpcap_chip_data cpcap_default_data = {
+ .mfd_devices = cpcap_default_mfd_devices,
+ .num_devices = ARRAY_SIZE(cpcap_default_mfd_devices),
+};
+
+static const struct mfd_cell cpcap_mapphone_mfd_devices[] = {
{
.name = "cpcap_adc",
.of_compatible = "motorola,mapphone-cpcap-adc",
@@ -285,7 +327,12 @@ static const struct mfd_cell cpcap_mfd_devices[] = {
.of_compatible = "motorola,cpcap-led-cp",
}, {
.name = "cpcap-codec",
- }
+ },
+};
+
+static const struct cpcap_chip_data cpcap_mapphone_data = {
+ .mfd_devices = cpcap_mapphone_mfd_devices,
+ .num_devices = ARRAY_SIZE(cpcap_mapphone_mfd_devices),
};
static int cpcap_probe(struct spi_device *spi)
@@ -297,6 +344,10 @@ static int cpcap_probe(struct spi_device *spi)
if (!cpcap)
return -ENOMEM;
+ cpcap->cdata = device_get_match_data(&spi->dev);
+ if (!cpcap->cdata)
+ return -ENODEV;
+
cpcap->spi = spi;
spi_set_drvdata(spi, cpcap);
@@ -331,10 +382,24 @@ static int cpcap_probe(struct spi_device *spi)
spi->dev.coherent_dma_mask = 0;
spi->dev.dma_mask = &spi->dev.coherent_dma_mask;
- return devm_mfd_add_devices(&spi->dev, 0, cpcap_mfd_devices,
- ARRAY_SIZE(cpcap_mfd_devices), NULL, 0, NULL);
+ return devm_mfd_add_devices(&spi->dev, 0, cpcap->cdata->mfd_devices,
+ cpcap->cdata->num_devices, NULL, 0, NULL);
}
+static const struct of_device_id cpcap_of_match[] = {
+ { .compatible = "motorola,cpcap", .data = &cpcap_default_data },
+ { .compatible = "motorola,mapphone-cpcap", .data = &cpcap_mapphone_data },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, cpcap_of_match);
+
+static const struct spi_device_id cpcap_spi_ids[] = {
+ { .name = "cpcap", .driver_data = (kernel_ulong_t)&cpcap_default_data },
+ { .name = "mapphone-cpcap", .driver_data = (kernel_ulong_t)&cpcap_mapphone_data },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(spi, cpcap_spi_ids);
+
static struct spi_driver cpcap_driver = {
.driver = {
.name = "cpcap-core",
--
2.51.0
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH v4 5/6 RESEND] mfd: motorola-cpcap: diverge configuration per-board
2026-04-28 15:36 ` [PATCH v4 5/6 RESEND] mfd: motorola-cpcap: diverge configuration per-board Svyatoslav Ryhel
@ 2026-05-07 14:05 ` Lee Jones
2026-05-07 14:33 ` Svyatoslav Ryhel
2026-05-07 14:42 ` Svyatoslav Ryhel
0 siblings, 2 replies; 14+ messages in thread
From: Lee Jones @ 2026-05-07 14:05 UTC (permalink / raw)
To: Svyatoslav Ryhel
Cc: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Pavel Machek, David Lechner, Tony Lindgren, linux-input,
devicetree, linux-kernel, linux-leds
On Tue, 28 Apr 2026, Svyatoslav Ryhel wrote:
> MFD have rigid subdevice structure which does not allow flexible dynamic
> subdevice linking. Address this by diverging CPCAP subdevice composition
> to take into account board specific configuration.
>
> Create a common default subdevice composition, rename existing subdevice
> composition into cpcap_mapphone_mfd_devices since it targets mainly
> Mapphone board.
>
> Removed st,6556002 as it is no longer applicable to all cases and
> duplicates motorola,cpcap, which is used as the default composition.
>
> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> ---
Changelog?
> drivers/mfd/motorola-cpcap.c | 101 ++++++++++++++++++++++++++++-------
> 1 file changed, 83 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/mfd/motorola-cpcap.c b/drivers/mfd/motorola-cpcap.c
> index d8243b956f87..516d1e33affa 100644
> --- a/drivers/mfd/motorola-cpcap.c
> +++ b/drivers/mfd/motorola-cpcap.c
> @@ -12,6 +12,7 @@
> #include <linux/kernel.h>
> #include <linux/module.h>
> #include <linux/mod_devicetable.h>
> +#include <linux/property.h>
> #include <linux/regmap.h>
> #include <linux/sysfs.h>
>
> @@ -24,10 +25,16 @@
> #define CPCAP_REGISTER_SIZE 4
> #define CPCAP_REGISTER_BITS 16
>
> +struct cpcap_chip_data {
> + const struct mfd_cell *mfd_devices;
> + unsigned int num_devices;
> +};
This is a red flag.
> struct cpcap_ddata {
> struct spi_device *spi;
> struct regmap_irq *irqs;
> struct regmap_irq_chip_data *irqdata[CPCAP_NR_IRQ_CHIPS];
> + const struct cpcap_chip_data *cdata;
> const struct regmap_config *regmap_conf;
> struct regmap *regmap;
> };
> @@ -195,20 +202,6 @@ static int cpcap_init_irq(struct cpcap_ddata *cpcap)
> return 0;
> }
>
> -static const struct of_device_id cpcap_of_match[] = {
> - { .compatible = "motorola,cpcap", },
> - { .compatible = "st,6556002", },
> - {},
> -};
> -MODULE_DEVICE_TABLE(of, cpcap_of_match);
> -
> -static const struct spi_device_id cpcap_spi_ids[] = {
> - { .name = "cpcap", },
> - { .name = "6556002", },
> - {},
> -};
> -MODULE_DEVICE_TABLE(spi, cpcap_spi_ids);
> -
> static const struct regmap_config cpcap_regmap_config = {
> .reg_bits = 16,
> .reg_stride = 4,
> @@ -241,7 +234,56 @@ static int cpcap_resume(struct device *dev)
>
> static DEFINE_SIMPLE_DEV_PM_OPS(cpcap_pm, cpcap_suspend, cpcap_resume);
>
> -static const struct mfd_cell cpcap_mfd_devices[] = {
> +static const struct mfd_cell cpcap_default_mfd_devices[] = {
> + {
> + .name = "cpcap_adc",
> + .of_compatible = "motorola,cpcap-adc",
> + }, {
> + .name = "cpcap_battery",
> + .of_compatible = "motorola,cpcap-battery",
> + }, {
> + .name = "cpcap-regulator",
> + .of_compatible = "motorola,cpcap-regulator",
> + }, {
> + .name = "cpcap-rtc",
> + .of_compatible = "motorola,cpcap-rtc",
> + }, {
> + .name = "cpcap-pwrbutton",
> + .of_compatible = "motorola,cpcap-pwrbutton",
> + }, {
> + .name = "cpcap-usb-phy",
> + .of_compatible = "motorola,cpcap-usb-phy",
> + }, {
> + .name = "cpcap-led",
> + .id = 0,
> + .of_compatible = "motorola,cpcap-led-red",
> + }, {
> + .name = "cpcap-led",
> + .id = 1,
> + .of_compatible = "motorola,cpcap-led-green",
> + }, {
> + .name = "cpcap-led",
> + .id = 2,
> + .of_compatible = "motorola,cpcap-led-blue",
> + }, {
> + .name = "cpcap-led",
> + .id = 3,
> + .of_compatible = "motorola,cpcap-led-adl",
> + }, {
> + .name = "cpcap-led",
> + .id = 4,
> + .of_compatible = "motorola,cpcap-led-cp",
> + }, {
> + .name = "cpcap-codec",
> + },
> +};
> +
> +static const struct cpcap_chip_data cpcap_default_data = {
> + .mfd_devices = cpcap_default_mfd_devices,
> + .num_devices = ARRAY_SIZE(cpcap_default_mfd_devices),
> +};
> +
> +static const struct mfd_cell cpcap_mapphone_mfd_devices[] = {
> {
> .name = "cpcap_adc",
> .of_compatible = "motorola,mapphone-cpcap-adc",
> @@ -285,7 +327,12 @@ static const struct mfd_cell cpcap_mfd_devices[] = {
> .of_compatible = "motorola,cpcap-led-cp",
> }, {
> .name = "cpcap-codec",
> - }
> + },
> +};
> +
> +static const struct cpcap_chip_data cpcap_mapphone_data = {
> + .mfd_devices = cpcap_mapphone_mfd_devices,
> + .num_devices = ARRAY_SIZE(cpcap_mapphone_mfd_devices),
> };
>
> static int cpcap_probe(struct spi_device *spi)
> @@ -297,9 +344,17 @@ static int cpcap_probe(struct spi_device *spi)
> if (!cpcap)
> return -ENOMEM;
>
> + cpcap->cdata = device_get_match_data(&spi->dev);
> + if (!cpcap->cdata)
> + return -ENODEV;
> +
> cpcap->spi = spi;
> spi_set_drvdata(spi, cpcap);
>
> @@ -331,16 +382,24 @@ static int cpcap_probe(struct spi_device *spi)
> spi->dev.coherent_dma_mask = 0;
> spi->dev.dma_mask = &spi->dev.coherent_dma_mask;
>
> - return devm_mfd_add_devices(&spi->dev, 0, cpcap_mfd_devices,
> - ARRAY_SIZE(cpcap_mfd_devices), NULL, 0, NULL);
> + return devm_mfd_add_devices(&spi->dev, 0, cpcap->cdata->mfd_devices,
> + cpcap->cdata->num_devices, NULL, 0, NULL);
> }
>
> +static const struct of_device_id cpcap_of_match[] = {
> + { .compatible = "motorola,cpcap", .data = &cpcap_default_data },
> + { .compatible = "motorola,mapphone-cpcap", .data = &cpcap_mapphone_data },
We don't allow data from one device registration API (MFD) to be passed
through another (OF) because it tends to lead to all sorts of "creative
solutions". Pass a value instead and match on that in a switch()
statement like all of the other MFD drivers do.
> + { /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(of, cpcap_of_match);
> +
> +static const struct spi_device_id cpcap_spi_ids[] = {
> + { .name = "cpcap", .driver_data = (kernel_ulong_t)&cpcap_default_data },
> + { .name = "mapphone-cpcap", .driver_data = (kernel_ulong_t)&cpcap_mapphone_data },
> + { /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(spi, cpcap_spi_ids);
> +
> static struct spi_driver cpcap_driver = {
> .driver = {
> .name = "cpcap-core",
> --
> 2.51.0
>
>
--
Lee Jones
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH v4 5/6 RESEND] mfd: motorola-cpcap: diverge configuration per-board
2026-05-07 14:05 ` Lee Jones
@ 2026-05-07 14:33 ` Svyatoslav Ryhel
2026-05-07 14:42 ` Svyatoslav Ryhel
1 sibling, 0 replies; 14+ messages in thread
From: Svyatoslav Ryhel @ 2026-05-07 14:33 UTC (permalink / raw)
To: Lee Jones
Cc: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Pavel Machek, David Lechner, Tony Lindgren, linux-input,
devicetree, linux-kernel, linux-leds
чт, 7 трав. 2026 р. о 17:05 Lee Jones <lee@kernel.org> пише:
>
> On Tue, 28 Apr 2026, Svyatoslav Ryhel wrote:
>
> > MFD have rigid subdevice structure which does not allow flexible dynamic
> > subdevice linking. Address this by diverging CPCAP subdevice composition
> > to take into account board specific configuration.
> >
> > Create a common default subdevice composition, rename existing subdevice
> > composition into cpcap_mapphone_mfd_devices since it targets mainly
> > Mapphone board.
> >
> > Removed st,6556002 as it is no longer applicable to all cases and
> > duplicates motorola,cpcap, which is used as the default composition.
> >
> > Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> > ---
>
> Changelog?
>
Changelog is in the cover.
> > drivers/mfd/motorola-cpcap.c | 101 ++++++++++++++++++++++++++++-------
> > 1 file changed, 83 insertions(+), 18 deletions(-)
> >
> > diff --git a/drivers/mfd/motorola-cpcap.c b/drivers/mfd/motorola-cpcap.c
> > index d8243b956f87..516d1e33affa 100644
> > --- a/drivers/mfd/motorola-cpcap.c
> > +++ b/drivers/mfd/motorola-cpcap.c
> > @@ -12,6 +12,7 @@
> > #include <linux/kernel.h>
> > #include <linux/module.h>
> > #include <linux/mod_devicetable.h>
> > +#include <linux/property.h>
> > #include <linux/regmap.h>
> > #include <linux/sysfs.h>
> >
> > @@ -24,10 +25,16 @@
> > #define CPCAP_REGISTER_SIZE 4
> > #define CPCAP_REGISTER_BITS 16
> >
> > +struct cpcap_chip_data {
> > + const struct mfd_cell *mfd_devices;
> > + unsigned int num_devices;
> > +};
>
> This is a red flag.
>
> > struct cpcap_ddata {
> > struct spi_device *spi;
> > struct regmap_irq *irqs;
> > struct regmap_irq_chip_data *irqdata[CPCAP_NR_IRQ_CHIPS];
> > + const struct cpcap_chip_data *cdata;
> > const struct regmap_config *regmap_conf;
> > struct regmap *regmap;
> > };
> > @@ -195,20 +202,6 @@ static int cpcap_init_irq(struct cpcap_ddata *cpcap)
> > return 0;
> > }
> >
> > -static const struct of_device_id cpcap_of_match[] = {
> > - { .compatible = "motorola,cpcap", },
> > - { .compatible = "st,6556002", },
> > - {},
> > -};
> > -MODULE_DEVICE_TABLE(of, cpcap_of_match);
> > -
> > -static const struct spi_device_id cpcap_spi_ids[] = {
> > - { .name = "cpcap", },
> > - { .name = "6556002", },
> > - {},
> > -};
> > -MODULE_DEVICE_TABLE(spi, cpcap_spi_ids);
> > -
> > static const struct regmap_config cpcap_regmap_config = {
> > .reg_bits = 16,
> > .reg_stride = 4,
> > @@ -241,7 +234,56 @@ static int cpcap_resume(struct device *dev)
> >
> > static DEFINE_SIMPLE_DEV_PM_OPS(cpcap_pm, cpcap_suspend, cpcap_resume);
> >
> > -static const struct mfd_cell cpcap_mfd_devices[] = {
> > +static const struct mfd_cell cpcap_default_mfd_devices[] = {
> > + {
> > + .name = "cpcap_adc",
> > + .of_compatible = "motorola,cpcap-adc",
> > + }, {
> > + .name = "cpcap_battery",
> > + .of_compatible = "motorola,cpcap-battery",
> > + }, {
> > + .name = "cpcap-regulator",
> > + .of_compatible = "motorola,cpcap-regulator",
> > + }, {
> > + .name = "cpcap-rtc",
> > + .of_compatible = "motorola,cpcap-rtc",
> > + }, {
> > + .name = "cpcap-pwrbutton",
> > + .of_compatible = "motorola,cpcap-pwrbutton",
> > + }, {
> > + .name = "cpcap-usb-phy",
> > + .of_compatible = "motorola,cpcap-usb-phy",
> > + }, {
> > + .name = "cpcap-led",
> > + .id = 0,
> > + .of_compatible = "motorola,cpcap-led-red",
> > + }, {
> > + .name = "cpcap-led",
> > + .id = 1,
> > + .of_compatible = "motorola,cpcap-led-green",
> > + }, {
> > + .name = "cpcap-led",
> > + .id = 2,
> > + .of_compatible = "motorola,cpcap-led-blue",
> > + }, {
> > + .name = "cpcap-led",
> > + .id = 3,
> > + .of_compatible = "motorola,cpcap-led-adl",
> > + }, {
> > + .name = "cpcap-led",
> > + .id = 4,
> > + .of_compatible = "motorola,cpcap-led-cp",
> > + }, {
> > + .name = "cpcap-codec",
> > + },
> > +};
> > +
> > +static const struct cpcap_chip_data cpcap_default_data = {
> > + .mfd_devices = cpcap_default_mfd_devices,
> > + .num_devices = ARRAY_SIZE(cpcap_default_mfd_devices),
> > +};
> > +
> > +static const struct mfd_cell cpcap_mapphone_mfd_devices[] = {
> > {
> > .name = "cpcap_adc",
> > .of_compatible = "motorola,mapphone-cpcap-adc",
> > @@ -285,7 +327,12 @@ static const struct mfd_cell cpcap_mfd_devices[] = {
> > .of_compatible = "motorola,cpcap-led-cp",
> > }, {
> > .name = "cpcap-codec",
> > - }
> > + },
> > +};
> > +
> > +static const struct cpcap_chip_data cpcap_mapphone_data = {
> > + .mfd_devices = cpcap_mapphone_mfd_devices,
> > + .num_devices = ARRAY_SIZE(cpcap_mapphone_mfd_devices),
> > };
> >
> > static int cpcap_probe(struct spi_device *spi)
> > @@ -297,9 +344,17 @@ static int cpcap_probe(struct spi_device *spi)
> > if (!cpcap)
> > return -ENOMEM;
> >
> > + cpcap->cdata = device_get_match_data(&spi->dev);
> > + if (!cpcap->cdata)
> > + return -ENODEV;
> > +
> > cpcap->spi = spi;
> > spi_set_drvdata(spi, cpcap);
> >
> > @@ -331,16 +382,24 @@ static int cpcap_probe(struct spi_device *spi)
> > spi->dev.coherent_dma_mask = 0;
> > spi->dev.dma_mask = &spi->dev.coherent_dma_mask;
> >
> > - return devm_mfd_add_devices(&spi->dev, 0, cpcap_mfd_devices,
> > - ARRAY_SIZE(cpcap_mfd_devices), NULL, 0, NULL);
> > + return devm_mfd_add_devices(&spi->dev, 0, cpcap->cdata->mfd_devices,
> > + cpcap->cdata->num_devices, NULL, 0, NULL);
> > }
> >
> > +static const struct of_device_id cpcap_of_match[] = {
> > + { .compatible = "motorola,cpcap", .data = &cpcap_default_data },
> > + { .compatible = "motorola,mapphone-cpcap", .data = &cpcap_mapphone_data },
>
> We don't allow data from one device registration API (MFD) to be passed
> through another (OF) because it tends to lead to all sorts of "creative
> solutions". Pass a value instead and match on that in a switch()
> statement like all of the other MFD drivers do.
>
You don't allow this. I have not seen this enforced anywhere in the
kernel except the mfd subsystem. Fine, does not matter, if this makes
you happy I will adjust.
> > + { /* sentinel */ }
> > +};
> > +MODULE_DEVICE_TABLE(of, cpcap_of_match);
> > +
> > +static const struct spi_device_id cpcap_spi_ids[] = {
> > + { .name = "cpcap", .driver_data = (kernel_ulong_t)&cpcap_default_data },
> > + { .name = "mapphone-cpcap", .driver_data = (kernel_ulong_t)&cpcap_mapphone_data },
> > + { /* sentinel */ }
> > +};
> > +MODULE_DEVICE_TABLE(spi, cpcap_spi_ids);
> > +
> > static struct spi_driver cpcap_driver = {
> > .driver = {
> > .name = "cpcap-core",
> > --
> > 2.51.0
> >
> >
>
> --
> Lee Jones
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH v4 5/6 RESEND] mfd: motorola-cpcap: diverge configuration per-board
2026-05-07 14:05 ` Lee Jones
2026-05-07 14:33 ` Svyatoslav Ryhel
@ 2026-05-07 14:42 ` Svyatoslav Ryhel
1 sibling, 0 replies; 14+ messages in thread
From: Svyatoslav Ryhel @ 2026-05-07 14:42 UTC (permalink / raw)
To: Lee Jones
Cc: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Pavel Machek, David Lechner, Tony Lindgren, linux-input,
devicetree, linux-kernel, linux-leds
чт, 7 трав. 2026 р. о 17:05 Lee Jones <lee@kernel.org> пише:
>
> On Tue, 28 Apr 2026, Svyatoslav Ryhel wrote:
>
> > MFD have rigid subdevice structure which does not allow flexible dynamic
> > subdevice linking. Address this by diverging CPCAP subdevice composition
> > to take into account board specific configuration.
> >
> > Create a common default subdevice composition, rename existing subdevice
> > composition into cpcap_mapphone_mfd_devices since it targets mainly
> > Mapphone board.
> >
> > Removed st,6556002 as it is no longer applicable to all cases and
> > duplicates motorola,cpcap, which is used as the default composition.
> >
> > Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> > ---
>
> Changelog?
>
> > drivers/mfd/motorola-cpcap.c | 101 ++++++++++++++++++++++++++++-------
> > 1 file changed, 83 insertions(+), 18 deletions(-)
> >
> > diff --git a/drivers/mfd/motorola-cpcap.c b/drivers/mfd/motorola-cpcap.c
> > index d8243b956f87..516d1e33affa 100644
> > --- a/drivers/mfd/motorola-cpcap.c
> > +++ b/drivers/mfd/motorola-cpcap.c
> > @@ -12,6 +12,7 @@
> > #include <linux/kernel.h>
> > #include <linux/module.h>
> > #include <linux/mod_devicetable.h>
> > +#include <linux/property.h>
> > #include <linux/regmap.h>
> > #include <linux/sysfs.h>
> >
> > @@ -24,10 +25,16 @@
> > #define CPCAP_REGISTER_SIZE 4
> > #define CPCAP_REGISTER_BITS 16
> >
> > +struct cpcap_chip_data {
> > + const struct mfd_cell *mfd_devices;
> > + unsigned int num_devices;
> > +};
>
> This is a red flag.
>
> > struct cpcap_ddata {
> > struct spi_device *spi;
> > struct regmap_irq *irqs;
> > struct regmap_irq_chip_data *irqdata[CPCAP_NR_IRQ_CHIPS];
> > + const struct cpcap_chip_data *cdata;
> > const struct regmap_config *regmap_conf;
> > struct regmap *regmap;
> > };
> > @@ -195,20 +202,6 @@ static int cpcap_init_irq(struct cpcap_ddata *cpcap)
> > return 0;
> > }
> >
> > -static const struct of_device_id cpcap_of_match[] = {
> > - { .compatible = "motorola,cpcap", },
> > - { .compatible = "st,6556002", },
> > - {},
> > -};
> > -MODULE_DEVICE_TABLE(of, cpcap_of_match);
> > -
> > -static const struct spi_device_id cpcap_spi_ids[] = {
> > - { .name = "cpcap", },
> > - { .name = "6556002", },
> > - {},
> > -};
> > -MODULE_DEVICE_TABLE(spi, cpcap_spi_ids);
> > -
> > static const struct regmap_config cpcap_regmap_config = {
> > .reg_bits = 16,
> > .reg_stride = 4,
> > @@ -241,7 +234,56 @@ static int cpcap_resume(struct device *dev)
> >
> > static DEFINE_SIMPLE_DEV_PM_OPS(cpcap_pm, cpcap_suspend, cpcap_resume);
> >
> > -static const struct mfd_cell cpcap_mfd_devices[] = {
> > +static const struct mfd_cell cpcap_default_mfd_devices[] = {
> > + {
> > + .name = "cpcap_adc",
> > + .of_compatible = "motorola,cpcap-adc",
> > + }, {
> > + .name = "cpcap_battery",
> > + .of_compatible = "motorola,cpcap-battery",
> > + }, {
> > + .name = "cpcap-regulator",
> > + .of_compatible = "motorola,cpcap-regulator",
> > + }, {
> > + .name = "cpcap-rtc",
> > + .of_compatible = "motorola,cpcap-rtc",
> > + }, {
> > + .name = "cpcap-pwrbutton",
> > + .of_compatible = "motorola,cpcap-pwrbutton",
> > + }, {
> > + .name = "cpcap-usb-phy",
> > + .of_compatible = "motorola,cpcap-usb-phy",
> > + }, {
> > + .name = "cpcap-led",
> > + .id = 0,
> > + .of_compatible = "motorola,cpcap-led-red",
> > + }, {
> > + .name = "cpcap-led",
> > + .id = 1,
> > + .of_compatible = "motorola,cpcap-led-green",
> > + }, {
> > + .name = "cpcap-led",
> > + .id = 2,
> > + .of_compatible = "motorola,cpcap-led-blue",
> > + }, {
> > + .name = "cpcap-led",
> > + .id = 3,
> > + .of_compatible = "motorola,cpcap-led-adl",
> > + }, {
> > + .name = "cpcap-led",
> > + .id = 4,
> > + .of_compatible = "motorola,cpcap-led-cp",
> > + }, {
> > + .name = "cpcap-codec",
> > + },
> > +};
Lee, would you mind if I convert these mfd_cell structures to use
macros in this commit since I am refactoring them anyway?
> > +
> > +static const struct cpcap_chip_data cpcap_default_data = {
> > + .mfd_devices = cpcap_default_mfd_devices,
> > + .num_devices = ARRAY_SIZE(cpcap_default_mfd_devices),
> > +};
> > +
> > +static const struct mfd_cell cpcap_mapphone_mfd_devices[] = {
> > {
> > .name = "cpcap_adc",
> > .of_compatible = "motorola,mapphone-cpcap-adc",
> > @@ -285,7 +327,12 @@ static const struct mfd_cell cpcap_mfd_devices[] = {
> > .of_compatible = "motorola,cpcap-led-cp",
> > }, {
> > .name = "cpcap-codec",
> > - }
> > + },
> > +};
> > +
> > +static const struct cpcap_chip_data cpcap_mapphone_data = {
> > + .mfd_devices = cpcap_mapphone_mfd_devices,
> > + .num_devices = ARRAY_SIZE(cpcap_mapphone_mfd_devices),
> > };
> >
> > static int cpcap_probe(struct spi_device *spi)
> > @@ -297,9 +344,17 @@ static int cpcap_probe(struct spi_device *spi)
> > if (!cpcap)
> > return -ENOMEM;
> >
> > + cpcap->cdata = device_get_match_data(&spi->dev);
> > + if (!cpcap->cdata)
> > + return -ENODEV;
> > +
> > cpcap->spi = spi;
> > spi_set_drvdata(spi, cpcap);
> >
> > @@ -331,16 +382,24 @@ static int cpcap_probe(struct spi_device *spi)
> > spi->dev.coherent_dma_mask = 0;
> > spi->dev.dma_mask = &spi->dev.coherent_dma_mask;
> >
> > - return devm_mfd_add_devices(&spi->dev, 0, cpcap_mfd_devices,
> > - ARRAY_SIZE(cpcap_mfd_devices), NULL, 0, NULL);
> > + return devm_mfd_add_devices(&spi->dev, 0, cpcap->cdata->mfd_devices,
> > + cpcap->cdata->num_devices, NULL, 0, NULL);
> > }
> >
> > +static const struct of_device_id cpcap_of_match[] = {
> > + { .compatible = "motorola,cpcap", .data = &cpcap_default_data },
> > + { .compatible = "motorola,mapphone-cpcap", .data = &cpcap_mapphone_data },
>
> We don't allow data from one device registration API (MFD) to be passed
> through another (OF) because it tends to lead to all sorts of "creative
> solutions". Pass a value instead and match on that in a switch()
> statement like all of the other MFD drivers do.
>
> > + { /* sentinel */ }
> > +};
> > +MODULE_DEVICE_TABLE(of, cpcap_of_match);
> > +
> > +static const struct spi_device_id cpcap_spi_ids[] = {
> > + { .name = "cpcap", .driver_data = (kernel_ulong_t)&cpcap_default_data },
> > + { .name = "mapphone-cpcap", .driver_data = (kernel_ulong_t)&cpcap_mapphone_data },
> > + { /* sentinel */ }
> > +};
> > +MODULE_DEVICE_TABLE(spi, cpcap_spi_ids);
> > +
> > static struct spi_driver cpcap_driver = {
> > .driver = {
> > .name = "cpcap-core",
> > --
> > 2.51.0
> >
> >
>
> --
> Lee Jones
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v4 6/6 RESEND] mfd: motorola-cpcap: add support for Mot CPCAP composition
2026-04-28 15:36 [PATCH v4 0/6 RESEND] mfd: cpcap: convert documentation to schema and add Mot board support Svyatoslav Ryhel
` (4 preceding siblings ...)
2026-04-28 15:36 ` [PATCH v4 5/6 RESEND] mfd: motorola-cpcap: diverge configuration per-board Svyatoslav Ryhel
@ 2026-04-28 15:36 ` Svyatoslav Ryhel
2026-05-07 14:07 ` Lee Jones
5 siblings, 1 reply; 14+ messages in thread
From: Svyatoslav Ryhel @ 2026-04-28 15:36 UTC (permalink / raw)
To: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Lee Jones, Pavel Machek, Svyatoslav Ryhel, David Lechner,
Tony Lindgren
Cc: linux-input, devicetree, linux-kernel, linux-leds
Add a MFD subdevice composition used in Tegra20 based Mot board
(Motorola Atrix 4G and Droid X2).
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
drivers/mfd/motorola-cpcap.c | 50 ++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/drivers/mfd/motorola-cpcap.c b/drivers/mfd/motorola-cpcap.c
index 516d1e33affa..fdec92f5c6b0 100644
--- a/drivers/mfd/motorola-cpcap.c
+++ b/drivers/mfd/motorola-cpcap.c
@@ -335,6 +335,54 @@ static const struct cpcap_chip_data cpcap_mapphone_data = {
.num_devices = ARRAY_SIZE(cpcap_mapphone_mfd_devices),
};
+/*
+ * The Mot board features a USB-PHY and charger similar to the ones in
+ * Mapphone; however, because Mot is based on Tegra20, it is incompatible
+ * with the existing implementation, which is tightly interconnected with
+ * the OMAP USB PHY.
+ */
+static const struct mfd_cell cpcap_mot_mfd_devices[] = {
+ {
+ .name = "cpcap_adc",
+ .of_compatible = "motorola,mot-cpcap-adc",
+ }, {
+ .name = "cpcap_battery",
+ .of_compatible = "motorola,cpcap-battery",
+ }, {
+ .name = "cpcap-regulator",
+ .of_compatible = "motorola,mot-cpcap-regulator",
+ }, {
+ .name = "cpcap-rtc",
+ .of_compatible = "motorola,cpcap-rtc",
+ }, {
+ .name = "cpcap-pwrbutton",
+ .of_compatible = "motorola,cpcap-pwrbutton",
+ }, {
+ .name = "cpcap-led",
+ .id = 0,
+ .of_compatible = "motorola,cpcap-led-red",
+ }, {
+ .name = "cpcap-led",
+ .id = 1,
+ .of_compatible = "motorola,cpcap-led-green",
+ }, {
+ .name = "cpcap-led",
+ .id = 2,
+ .of_compatible = "motorola,cpcap-led-blue",
+ }, {
+ .name = "cpcap-led",
+ .id = 3,
+ .of_compatible = "motorola,cpcap-led-adl",
+ }, {
+ .name = "cpcap-codec",
+ },
+};
+
+static const struct cpcap_chip_data cpcap_mot_data = {
+ .mfd_devices = cpcap_mot_mfd_devices,
+ .num_devices = ARRAY_SIZE(cpcap_mot_mfd_devices),
+};
+
static int cpcap_probe(struct spi_device *spi)
{
struct cpcap_ddata *cpcap;
@@ -389,6 +437,7 @@ static int cpcap_probe(struct spi_device *spi)
static const struct of_device_id cpcap_of_match[] = {
{ .compatible = "motorola,cpcap", .data = &cpcap_default_data },
{ .compatible = "motorola,mapphone-cpcap", .data = &cpcap_mapphone_data },
+ { .compatible = "motorola,mot-cpcap", .data = &cpcap_mot_data },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, cpcap_of_match);
@@ -396,6 +445,7 @@ MODULE_DEVICE_TABLE(of, cpcap_of_match);
static const struct spi_device_id cpcap_spi_ids[] = {
{ .name = "cpcap", .driver_data = (kernel_ulong_t)&cpcap_default_data },
{ .name = "mapphone-cpcap", .driver_data = (kernel_ulong_t)&cpcap_mapphone_data },
+ { .name = "mot-cpcap", .driver_data = (kernel_ulong_t)&cpcap_mot_data },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(spi, cpcap_spi_ids);
--
2.51.0
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH v4 6/6 RESEND] mfd: motorola-cpcap: add support for Mot CPCAP composition
2026-04-28 15:36 ` [PATCH v4 6/6 RESEND] mfd: motorola-cpcap: add support for Mot CPCAP composition Svyatoslav Ryhel
@ 2026-05-07 14:07 ` Lee Jones
2026-05-07 14:36 ` Svyatoslav Ryhel
0 siblings, 1 reply; 14+ messages in thread
From: Lee Jones @ 2026-05-07 14:07 UTC (permalink / raw)
To: Svyatoslav Ryhel
Cc: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Pavel Machek, David Lechner, Tony Lindgren, linux-input,
devicetree, linux-kernel, linux-leds
On Tue, 28 Apr 2026, Svyatoslav Ryhel wrote:
> Add a MFD subdevice composition used in Tegra20 based Mot board
> (Motorola Atrix 4G and Droid X2).
>
> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> ---
> drivers/mfd/motorola-cpcap.c | 50 ++++++++++++++++++++++++++++++++++++
> 1 file changed, 50 insertions(+)
>
> diff --git a/drivers/mfd/motorola-cpcap.c b/drivers/mfd/motorola-cpcap.c
> index 516d1e33affa..fdec92f5c6b0 100644
> --- a/drivers/mfd/motorola-cpcap.c
> +++ b/drivers/mfd/motorola-cpcap.c
> @@ -335,6 +335,54 @@ static const struct cpcap_chip_data cpcap_mapphone_data = {
> .num_devices = ARRAY_SIZE(cpcap_mapphone_mfd_devices),
> };
>
> +/*
> + * The Mot board features a USB-PHY and charger similar to the ones in
> + * Mapphone; however, because Mot is based on Tegra20, it is incompatible
> + * with the existing implementation, which is tightly interconnected with
> + * the OMAP USB PHY.
> + */
> +static const struct mfd_cell cpcap_mot_mfd_devices[] = {
> + {
> + .name = "cpcap_adc",
> + .of_compatible = "motorola,mot-cpcap-adc",
> + }, {
> + .name = "cpcap_battery",
> + .of_compatible = "motorola,cpcap-battery",
> + }, {
> + .name = "cpcap-regulator",
> + .of_compatible = "motorola,mot-cpcap-regulator",
> + }, {
> + .name = "cpcap-rtc",
> + .of_compatible = "motorola,cpcap-rtc",
> + }, {
> + .name = "cpcap-pwrbutton",
> + .of_compatible = "motorola,cpcap-pwrbutton",
> + }, {
> + .name = "cpcap-led",
> + .id = 0,
> + .of_compatible = "motorola,cpcap-led-red",
> + }, {
> + .name = "cpcap-led",
> + .id = 1,
> + .of_compatible = "motorola,cpcap-led-green",
> + }, {
> + .name = "cpcap-led",
> + .id = 2,
> + .of_compatible = "motorola,cpcap-led-blue",
> + }, {
> + .name = "cpcap-led",
> + .id = 3,
> + .of_compatible = "motorola,cpcap-led-adl",
MFD_CELL_OF() for all.
> + }, {
> + .name = "cpcap-codec",
> + },
MFD_CELL_NAME()
> +};
> +
> +static const struct cpcap_chip_data cpcap_mot_data = {
> + .mfd_devices = cpcap_mot_mfd_devices,
> + .num_devices = ARRAY_SIZE(cpcap_mot_mfd_devices),
> +};
> +
> static int cpcap_probe(struct spi_device *spi)
> {
> struct cpcap_ddata *cpcap;
> @@ -389,6 +437,7 @@ static int cpcap_probe(struct spi_device *spi)
> static const struct of_device_id cpcap_of_match[] = {
> { .compatible = "motorola,cpcap", .data = &cpcap_default_data },
> { .compatible = "motorola,mapphone-cpcap", .data = &cpcap_mapphone_data },
> + { .compatible = "motorola,mot-cpcap", .data = &cpcap_mot_data },
> { /* sentinel */ }
> };
> MODULE_DEVICE_TABLE(of, cpcap_of_match);
> @@ -396,6 +445,7 @@ MODULE_DEVICE_TABLE(of, cpcap_of_match);
> static const struct spi_device_id cpcap_spi_ids[] = {
> { .name = "cpcap", .driver_data = (kernel_ulong_t)&cpcap_default_data },
> { .name = "mapphone-cpcap", .driver_data = (kernel_ulong_t)&cpcap_mapphone_data },
> + { .name = "mot-cpcap", .driver_data = (kernel_ulong_t)&cpcap_mot_data },
> { /* sentinel */ }
> };
> MODULE_DEVICE_TABLE(spi, cpcap_spi_ids);
> --
> 2.51.0
>
--
Lee Jones
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH v4 6/6 RESEND] mfd: motorola-cpcap: add support for Mot CPCAP composition
2026-05-07 14:07 ` Lee Jones
@ 2026-05-07 14:36 ` Svyatoslav Ryhel
0 siblings, 0 replies; 14+ messages in thread
From: Svyatoslav Ryhel @ 2026-05-07 14:36 UTC (permalink / raw)
To: Lee Jones
Cc: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Pavel Machek, David Lechner, Tony Lindgren, linux-input,
devicetree, linux-kernel, linux-leds
чт, 7 трав. 2026 р. о 17:07 Lee Jones <lee@kernel.org> пише:
>
> On Tue, 28 Apr 2026, Svyatoslav Ryhel wrote:
>
> > Add a MFD subdevice composition used in Tegra20 based Mot board
> > (Motorola Atrix 4G and Droid X2).
> >
> > Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> > ---
> > drivers/mfd/motorola-cpcap.c | 50 ++++++++++++++++++++++++++++++++++++
> > 1 file changed, 50 insertions(+)
> >
> > diff --git a/drivers/mfd/motorola-cpcap.c b/drivers/mfd/motorola-cpcap.c
> > index 516d1e33affa..fdec92f5c6b0 100644
> > --- a/drivers/mfd/motorola-cpcap.c
> > +++ b/drivers/mfd/motorola-cpcap.c
> > @@ -335,6 +335,54 @@ static const struct cpcap_chip_data cpcap_mapphone_data = {
> > .num_devices = ARRAY_SIZE(cpcap_mapphone_mfd_devices),
> > };
> >
> > +/*
> > + * The Mot board features a USB-PHY and charger similar to the ones in
> > + * Mapphone; however, because Mot is based on Tegra20, it is incompatible
> > + * with the existing implementation, which is tightly interconnected with
> > + * the OMAP USB PHY.
> > + */
> > +static const struct mfd_cell cpcap_mot_mfd_devices[] = {
> > + {
> > + .name = "cpcap_adc",
> > + .of_compatible = "motorola,mot-cpcap-adc",
> > + }, {
> > + .name = "cpcap_battery",
> > + .of_compatible = "motorola,cpcap-battery",
> > + }, {
> > + .name = "cpcap-regulator",
> > + .of_compatible = "motorola,mot-cpcap-regulator",
> > + }, {
> > + .name = "cpcap-rtc",
> > + .of_compatible = "motorola,cpcap-rtc",
> > + }, {
> > + .name = "cpcap-pwrbutton",
> > + .of_compatible = "motorola,cpcap-pwrbutton",
> > + }, {
> > + .name = "cpcap-led",
> > + .id = 0,
> > + .of_compatible = "motorola,cpcap-led-red",
> > + }, {
> > + .name = "cpcap-led",
> > + .id = 1,
> > + .of_compatible = "motorola,cpcap-led-green",
> > + }, {
> > + .name = "cpcap-led",
> > + .id = 2,
> > + .of_compatible = "motorola,cpcap-led-blue",
> > + }, {
> > + .name = "cpcap-led",
> > + .id = 3,
> > + .of_compatible = "motorola,cpcap-led-adl",
>
> MFD_CELL_OF() for all.
>
> > + }, {
> > + .name = "cpcap-codec",
> > + },
>
> MFD_CELL_NAME()
>
I was not aware these macros exist. Thank you for pointing to them.
> > +};
> > +
> > +static const struct cpcap_chip_data cpcap_mot_data = {
> > + .mfd_devices = cpcap_mot_mfd_devices,
> > + .num_devices = ARRAY_SIZE(cpcap_mot_mfd_devices),
> > +};
> > +
> > static int cpcap_probe(struct spi_device *spi)
> > {
> > struct cpcap_ddata *cpcap;
> > @@ -389,6 +437,7 @@ static int cpcap_probe(struct spi_device *spi)
> > static const struct of_device_id cpcap_of_match[] = {
> > { .compatible = "motorola,cpcap", .data = &cpcap_default_data },
> > { .compatible = "motorola,mapphone-cpcap", .data = &cpcap_mapphone_data },
> > + { .compatible = "motorola,mot-cpcap", .data = &cpcap_mot_data },
> > { /* sentinel */ }
> > };
> > MODULE_DEVICE_TABLE(of, cpcap_of_match);
> > @@ -396,6 +445,7 @@ MODULE_DEVICE_TABLE(of, cpcap_of_match);
> > static const struct spi_device_id cpcap_spi_ids[] = {
> > { .name = "cpcap", .driver_data = (kernel_ulong_t)&cpcap_default_data },
> > { .name = "mapphone-cpcap", .driver_data = (kernel_ulong_t)&cpcap_mapphone_data },
> > + { .name = "mot-cpcap", .driver_data = (kernel_ulong_t)&cpcap_mot_data },
> > { /* sentinel */ }
> > };
> > MODULE_DEVICE_TABLE(spi, cpcap_spi_ids);
> > --
> > 2.51.0
> >
>
> --
> Lee Jones
^ permalink raw reply [flat|nested] 14+ messages in thread