[PATCH v2 0/2] Support mailbox interface in qcom,smsm driver

2024-06-06 Thread Luca Weiss
Take a shot at converting the last driver that requires direct
"qcom,ipc*" syscon references in devicetree by allowing the smsm driver
to use the mailbox interface to achieve the same effect.

Still not sure if the devicetree bindings are the prettiest but they're
functional.

One alternative I'm thinking of is to use mbox-names to not have <0>
elements in dt, and reference the items by name from the driver?

e.g. this change for msm8226 could be represented differently.

-   qcom,ipc-1 = < 8 13>;
-   qcom,ipc-2 = < 8 9>;
-   qcom,ipc-3 = < 8 19>;
+   mboxes = <0>, < 13>, < 9>, < 19>;

vs. for example:

-   qcom,ipc-1 = < 8 13>;
-   qcom,ipc-2 = < 8 9>;
-   qcom,ipc-3 = < 8 19>;
+   mboxes = < 13>, < 9>, < 19>;
+   mbox-names = "ipc-1", "ipc-2", "ipc-3";

But also here the name with 'ipc-N' is probably not particularly
fitting?

Please let me know your thoughts and any suggestions.

Signed-off-by: Luca Weiss 
---
Changes in v2:
- Mark qcom,ipc-N as deprecated
- Update & expand description for mboxes property
- Don't duplicate example, just update existing one since qcom,ipc-N is
  deprecated now anyways
- Pick up tags
- Link to v1: 
https://lore.kernel.org/r/20240424-smsm-mbox-v1-0-555f3f442...@z3ntu.xyz

---
Luca Weiss (2):
  dt-bindings: soc: qcom,smsm: Allow specifying mboxes instead of qcom,ipc
  soc: qcom: smsm: Support using mailbox interface

 .../devicetree/bindings/soc/qcom/qcom,smsm.yaml| 30 +
 drivers/soc/qcom/smsm.c| 51 +-
 2 files changed, 71 insertions(+), 10 deletions(-)
---
base-commit: ee78a17615ad0cfdbbc27182b1047cd36c9d4d5f
change-id: 20240424-smsm-mbox-0666f35eae44

Best regards,
-- 
Luca Weiss 




[PATCH v2 2/2] soc: qcom: smsm: Support using mailbox interface

2024-06-06 Thread Luca Weiss
Add support for using the mbox interface instead of manually writing to
the syscon. With this change the driver will attempt to get the mailbox
first, and if that fails it will fall back to the existing way of using
qcom,ipc-* properties and converting to syscon.

Reviewed-by: Konrad Dybcio 
Signed-off-by: Luca Weiss 
---
 drivers/soc/qcom/smsm.c | 51 -
 1 file changed, 50 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/qcom/smsm.c b/drivers/soc/qcom/smsm.c
index e7c7e9a640a6..ffe78ae34386 100644
--- a/drivers/soc/qcom/smsm.c
+++ b/drivers/soc/qcom/smsm.c
@@ -5,6 +5,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -71,6 +72,7 @@ struct smsm_host;
  * @lock:  spinlock for read-modify-write of the outgoing state
  * @entries:   context for each of the entries
  * @hosts: context for each of the hosts
+ * @mbox_client: mailbox client handle
  */
 struct qcom_smsm {
struct device *dev;
@@ -88,6 +90,8 @@ struct qcom_smsm {
 
struct smsm_entry *entries;
struct smsm_host *hosts;
+
+   struct mbox_client mbox_client;
 };
 
 /**
@@ -120,11 +124,14 @@ struct smsm_entry {
  * @ipc_regmap:regmap for outgoing interrupt
  * @ipc_offset:offset in @ipc_regmap for outgoing interrupt
  * @ipc_bit:   bit in @ipc_regmap + @ipc_offset for outgoing interrupt
+ * @mbox_chan: apcs ipc mailbox channel handle
  */
 struct smsm_host {
struct regmap *ipc_regmap;
int ipc_offset;
int ipc_bit;
+
+   struct mbox_chan *mbox_chan;
 };
 
 /**
@@ -172,7 +179,13 @@ static int smsm_update_bits(void *data, u32 mask, u32 
value)
hostp = >hosts[host];
 
val = readl(smsm->subscription + host);
-   if (val & changes && hostp->ipc_regmap) {
+   if (!(val & changes))
+   continue;
+
+   if (hostp->mbox_chan) {
+   mbox_send_message(hostp->mbox_chan, NULL);
+   mbox_client_txdone(hostp->mbox_chan, 0);
+   } else if (hostp->ipc_regmap) {
regmap_write(hostp->ipc_regmap,
 hostp->ipc_offset,
 BIT(hostp->ipc_bit));
@@ -352,6 +365,28 @@ static const struct irq_domain_ops smsm_irq_ops = {
.xlate = irq_domain_xlate_twocell,
 };
 
+/**
+ * smsm_parse_mbox() - requests an mbox channel
+ * @smsm:  smsm driver context
+ * @host_id:   index of the remote host to be resolved
+ *
+ * Requests the desired channel using the mbox interface which is needed for
+ * sending the outgoing interrupts to a remove hosts - identified by @host_id.
+ */
+static int smsm_parse_mbox(struct qcom_smsm *smsm, unsigned int host_id)
+{
+   struct smsm_host *host = >hosts[host_id];
+   int ret = 0;
+
+   host->mbox_chan = mbox_request_channel(>mbox_client, host_id);
+   if (IS_ERR(host->mbox_chan)) {
+   ret = PTR_ERR(host->mbox_chan);
+   host->mbox_chan = NULL;
+   }
+
+   return ret;
+}
+
 /**
  * smsm_parse_ipc() - parses a qcom,ipc-%d device tree property
  * @smsm:  smsm driver context
@@ -521,8 +556,16 @@ static int qcom_smsm_probe(struct platform_device *pdev)
 "qcom,local-host",
 >local_host);
 
+   smsm->mbox_client.dev = >dev;
+   smsm->mbox_client.knows_txdone = true;
+
/* Parse the host properties */
for (id = 0; id < smsm->num_hosts; id++) {
+   /* Try using mbox interface first, otherwise fall back to 
syscon */
+   ret = smsm_parse_mbox(smsm, id);
+   if (!ret)
+   continue;
+
ret = smsm_parse_ipc(smsm, id);
if (ret < 0)
goto out_put;
@@ -609,6 +652,9 @@ static int qcom_smsm_probe(struct platform_device *pdev)
 
qcom_smem_state_unregister(smsm->state);
 out_put:
+   for (id = 0; id < smsm->num_hosts; id++)
+   mbox_free_channel(smsm->hosts[id].mbox_chan);
+
of_node_put(local_node);
return ret;
 }
@@ -622,6 +668,9 @@ static void qcom_smsm_remove(struct platform_device *pdev)
if (smsm->entries[id].domain)
irq_domain_remove(smsm->entries[id].domain);
 
+   for (id = 0; id < smsm->num_hosts; id++)
+   mbox_free_channel(smsm->hosts[id].mbox_chan);
+
qcom_smem_state_unregister(smsm->state);
 }
 

-- 
2.45.2




[PATCH v2 1/2] dt-bindings: soc: qcom,smsm: Allow specifying mboxes instead of qcom,ipc

2024-06-06 Thread Luca Weiss
The qcom,ipc-N properties are essentially providing a reference to a
mailbox, so allow using the mboxes property to do the same in a more
structured way.

Since multiple SMSM hosts are supported, we need to be able to provide
the correct mailbox for each host. The old qcom,ipc-N properties map to
the mboxes property by index, starting at 0 since that's a valid SMSM
host also.

Mark the older qcom,ipc-N as deprecated and update the example with
mboxes.

Signed-off-by: Luca Weiss 
---
 .../devicetree/bindings/soc/qcom/qcom,smsm.yaml| 30 +++---
 1 file changed, 21 insertions(+), 9 deletions(-)

diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,smsm.yaml 
b/Documentation/devicetree/bindings/soc/qcom/qcom,smsm.yaml
index db67cf043256..4900215f26af 100644
--- a/Documentation/devicetree/bindings/soc/qcom/qcom,smsm.yaml
+++ b/Documentation/devicetree/bindings/soc/qcom/qcom,smsm.yaml
@@ -33,6 +33,14 @@ properties:
   specifier of the column in the subscription matrix representing the local
   processor.
 
+  mboxes:
+minItems: 1
+maxItems: 5
+description:
+  Reference to the mailbox representing the outgoing doorbell in APCS for
+  this client. Each entry represents the N:th remote processor by index
+  (0-indexed).
+
   '#size-cells':
 const: 0
 
@@ -47,6 +55,7 @@ patternProperties:
 description:
   Three entries specifying the outgoing ipc bit used for signaling the N:th
   remote processor.
+deprecated: true
 
   "@[0-9a-f]$":
 type: object
@@ -98,15 +107,18 @@ required:
   - '#address-cells'
   - '#size-cells'
 
-anyOf:
+oneOf:
   - required:
-  - qcom,ipc-1
-  - required:
-  - qcom,ipc-2
-  - required:
-  - qcom,ipc-3
-  - required:
-  - qcom,ipc-4
+  - mboxes
+  - anyOf:
+  - required:
+  - qcom,ipc-1
+  - required:
+  - qcom,ipc-2
+  - required:
+  - qcom,ipc-3
+  - required:
+  - qcom,ipc-4
 
 additionalProperties: false
 
@@ -122,7 +134,7 @@ examples:
 compatible = "qcom,smsm";
 #address-cells = <1>;
 #size-cells = <0>;
-qcom,ipc-3 = < 8 19>;
+mboxes = <0>, <0>, <0>, < 19>;
 
 apps_smsm: apps@0 {
 reg = <0>;

-- 
2.45.2




[PATCH v2] rpmsg: qcom_smd: Improve error handling for qcom_smd_parse_edge

2024-06-06 Thread Luca Weiss
When the mailbox driver has not probed yet, the error message "failed to
parse smd edge" is just going to confuse users, so improve the error
prints a bit.

Cover the last remaining exits from qcom_smd_parse_edge with proper
error prints, especially the one for the mbox_chan deserved
dev_err_probe to handle EPROBE_DEFER nicely. And add one for ipc_regmap
also to be complete.

With this done, we can remove the outer print completely.

Signed-off-by: Luca Weiss 
---
Changes in v2:
- Rebase on qcom for-next, drop dts patches which have been applied
- Improve error printing situation (Bjorn)
- Link to v1: 
https://lore.kernel.org/r/20240424-apcs-mboxes-v1-0-6556c47cb...@z3ntu.xyz
---
 drivers/rpmsg/qcom_smd.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c
index 43f601c84b4f..06e6ba653ea1 100644
--- a/drivers/rpmsg/qcom_smd.c
+++ b/drivers/rpmsg/qcom_smd.c
@@ -1369,7 +1369,8 @@ static int qcom_smd_parse_edge(struct device *dev,
edge->mbox_chan = mbox_request_channel(>mbox_client, 0);
if (IS_ERR(edge->mbox_chan)) {
if (PTR_ERR(edge->mbox_chan) != -ENODEV) {
-   ret = PTR_ERR(edge->mbox_chan);
+   ret = dev_err_probe(dev, PTR_ERR(edge->mbox_chan),
+   "failed to acquire IPC mailbox\n");
goto put_node;
}
 
@@ -1386,6 +1387,7 @@ static int qcom_smd_parse_edge(struct device *dev,
of_node_put(syscon_np);
if (IS_ERR(edge->ipc_regmap)) {
ret = PTR_ERR(edge->ipc_regmap);
+   dev_err(dev, "failed to get regmap from syscon: %d\n", 
ret);
goto put_node;
}
 
@@ -1501,10 +1503,8 @@ struct qcom_smd_edge *qcom_smd_register_edge(struct 
device *parent,
}
 
ret = qcom_smd_parse_edge(>dev, node, edge);
-   if (ret) {
-   dev_err(>dev, "failed to parse smd edge\n");
+   if (ret)
goto unregister_dev;
-   }
 
ret = qcom_smd_create_chrdev(edge);
if (ret) {

---
base-commit: 2c79712cc83b172ce26c3086ced1c1fae087d8fb
change-id: 20240423-apcs-mboxes-12ee6c01a5b3

Best regards,
-- 
Luca Weiss 




[PATCH] arm64: dts: qcom: qcm6490-fairphone-fp5: Use .mbn firmware for IPA

2024-06-06 Thread Luca Weiss
Specify the file name for the squashed/non-split firmware with the .mbn
extension instead of the split .mdt. The kernel can load both but the
squashed version is preferred in dts nowadays.

Signed-off-by: Luca Weiss 
---
 arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts 
b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
index 8cd2fe80dbb2..6b4ffc585dcf 100644
--- a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
+++ b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
@@ -551,7 +551,7 @@  {
  {
qcom,gsi-loader = "self";
memory-region = <_fw_mem>;
-   firmware-name = "qcom/qcm6490/fairphone5/ipa_fws.mdt";
+   firmware-name = "qcom/qcm6490/fairphone5/ipa_fws.mbn";
status = "okay";
 };
 

---
base-commit: ee78a17615ad0cfdbbc27182b1047cd36c9d4d5f
change-id: 20240606-fp5-ipa-mbn-d0466de6b5bf

Best regards,
-- 
Luca Weiss 




Re: [PATCH v2] media: dt-bindings: qcom,sc7280-venus: Allow one IOMMU entry

2024-06-03 Thread Luca Weiss
On Fri Apr 12, 2024 at 4:19 PM CEST, Luca Weiss wrote:
> Some SC7280-based boards crash when providing the "secure_non_pixel"
> context bank, so allow only one iommu in the bindings also.

Hi all,

This patch is still pending and not having it causes dt validation
warnings for some qcom-sc7280 boards.

Regards
Luca

>
> Acked-by: Krzysztof Kozlowski 
> Signed-off-by: Luca Weiss 
> ---
> Reference:
> https://lore.kernel.org/linux-arm-msm/20231201-sc7280-venus-pas-v3-2-bc132dc5f...@fairphone.com/
> ---
> Changes in v2:
> - Pick up tags
> - Otherwise just a resend, v1 was sent in January
> - Link to v1: 
> https://lore.kernel.org/r/20240129-sc7280-venus-bindings-v1-1-20a9ba194...@fairphone.com
> ---
>  Documentation/devicetree/bindings/media/qcom,sc7280-venus.yaml | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/devicetree/bindings/media/qcom,sc7280-venus.yaml 
> b/Documentation/devicetree/bindings/media/qcom,sc7280-venus.yaml
> index 8f9b6433aeb8..10c334e6b3dc 100644
> --- a/Documentation/devicetree/bindings/media/qcom,sc7280-venus.yaml
> +++ b/Documentation/devicetree/bindings/media/qcom,sc7280-venus.yaml
> @@ -43,6 +43,7 @@ properties:
>- const: vcodec_bus
>  
>iommus:
> +minItems: 1
>  maxItems: 2
>  
>interconnects:
>
> ---
> base-commit: 9ed46da14b9b9b2ad4edb3b0c545b6dbe5c00d39
> change-id: 20240129-sc7280-venus-bindings-6e62a99620de
>
> Best regards,




[PATCH v3 3/3] arm64: dts: qcom: sm7225-fairphone-fp4: Enable USB role switching

2024-05-30 Thread Luca Weiss
Configure the Type-C and VBUS regulator on PM7250B and wire it up to the
USB PHY, so that USB role and orientation switching works.

For now USB Power Delivery properties are skipped / disabled, so that
the (presumably) bootloader-configured charger doesn't get messed with
and we can charge the phone with at least some amount of power.

Reviewed-by: Konrad Dybcio 
Signed-off-by: Luca Weiss 
---
 .../dts/qcom/sm6350-sony-xperia-lena-pdx213.dts|  1 +
 arch/arm64/boot/dts/qcom/sm6350.dtsi   | 50 +++
 arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts  | 58 +-
 3 files changed, 108 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sm6350-sony-xperia-lena-pdx213.dts 
b/arch/arm64/boot/dts/qcom/sm6350-sony-xperia-lena-pdx213.dts
index 6e44d280..88ee04973a2f 100644
--- a/arch/arm64/boot/dts/qcom/sm6350-sony-xperia-lena-pdx213.dts
+++ b/arch/arm64/boot/dts/qcom/sm6350-sony-xperia-lena-pdx213.dts
@@ -375,6 +375,7 @@ _1 {
 };
 
 _1_dwc3 {
+   /delete-property/ usb-role-switch;
maximum-speed = "super-speed";
dr_mode = "peripheral";
 };
diff --git a/arch/arm64/boot/dts/qcom/sm6350.dtsi 
b/arch/arm64/boot/dts/qcom/sm6350.dtsi
index acf0b0f73af9..1ac626d963b8 100644
--- a/arch/arm64/boot/dts/qcom/sm6350.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm6350.dtsi
@@ -1715,10 +1715,39 @@ usb_1_qmpphy: phy@88e8000 {
 < GCC_USB3_DP_PHY_PRIM_BCR>;
reset-names = "phy", "common";
 
+   orientation-switch;
+
#clock-cells = <1>;
#phy-cells = <1>;
 
status = "disabled";
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   port@0 {
+   reg = <0>;
+
+   usb_1_qmpphy_out: endpoint {
+   };
+   };
+
+   port@1 {
+   reg = <1>;
+
+   usb_1_qmpphy_usb_ss_in: endpoint {
+   remote-endpoint = 
<_1_dwc3_ss_out>;
+   };
+   };
+
+   port@2 {
+   reg = <2>;
+
+   usb_1_qmpphy_dp_in: endpoint {
+   };
+   };
+   };
};
 
dc_noc: interconnect@916 {
@@ -1894,6 +1923,27 @@ usb_1_dwc3: usb@a60 {
snps,hird-threshold = /bits/ 8 <0x10>;
phys = <_1_hsphy>, <_1_qmpphy 
QMP_USB43DP_USB3_PHY>;
phy-names = "usb2-phy", "usb3-phy";
+   usb-role-switch;
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   port@0 {
+   reg = <0>;
+
+   usb_1_dwc3_hs_out: endpoint {
+   };
+   };
+
+   port@1 {
+   reg = <1>;
+
+   usb_1_dwc3_ss_out: endpoint {
+   remote-endpoint = 
<_1_qmpphy_usb_ss_in>;
+   };
+   };
+   };
};
};
 
diff --git a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts 
b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
index bc67e8c1fe4d..d2632f011353 100644
--- a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
+++ b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
@@ -19,6 +19,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "sm7225.dtsi"
 #include "pm6150l.dtsi"
 #include "pm6350.dtsi"
@@ -543,6 +544,53 @@ conn-therm@1 {
};
 };
 
+_typec {
+   vdd-pdphy-supply = <_l3a>;
+
+   status = "okay";
+
+   connector {
+   compatible = "usb-c-connector";
+
+   power-role = "dual";
+   data-role = "dual";
+   self-powered;
+
+   /*
+* Disable USB

[PATCH v3 0/3] Add TCPM support for PM7250B and Fairphone 4

2024-05-30 Thread Luca Weiss
This series adds support for Type-C Port Management on the Fairphone 4
which enables USB role switching and orientation switching.

This enables a user for example to plug in a USB stick or a USB keyboard
to the Type-C port.

To: Bjorn Andersson 
To: Konrad Dybcio 
To: Rob Herring 
To: Krzysztof Kozlowski 
To: Conor Dooley 
Cc: ~postmarketos/upstream...@lists.sr.ht
Cc: phone-de...@vger.kernel.org
Cc: linux-arm-...@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Luca Weiss 

Changes in v3:
- Disable pm7250b typec node by default since on some platforms the ADSP
  firmware will manage it and not Linux (Bjorn)
- Move usb-role-switch and orientation-switch to dtsi (Konrad) - update
  sony-lena also as per 
https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git/commit/?id=dad66630a083263b513448426523a3b52a959c79
- Link to v2: 
https://lore.kernel.org/r/20240329-fp4-tcpm-v2-0-d7f8cd165...@fairphone.com

Changes in v2:
- Move disabled as last property for pm7250b_vbus
- Update USB graph to newer version, connect both HS and SS signals
- Update FP4 Type-C properties, try to keep phone charging intact by
  disabling USB PD for now
- Pick up tags
- Drop patches that landed in linux-next already
- Link to v1: 
https://lore.kernel.org/r/20240322-fp4-tcpm-v1-0-c5644099d...@fairphone.com

---
Luca Weiss (3):
  arm64: dts: qcom: pm7250b: Add node for PMIC VBUS booster
  arm64: dts: qcom: pm7250b: Add a TCPM description
  arm64: dts: qcom: sm7225-fairphone-fp4: Enable USB role switching

 arch/arm64/boot/dts/qcom/pm7250b.dtsi  | 46 +
 .../dts/qcom/sm6350-sony-xperia-lena-pdx213.dts|  1 +
 arch/arm64/boot/dts/qcom/sm6350.dtsi   | 50 +++
 arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts  | 58 +-
 4 files changed, 154 insertions(+), 1 deletion(-)
---
base-commit: 4adcd8f0525c79f058c10e3ecaaba74932f6
change-id: 20240322-fp4-tcpm-2ad68ef55346

Best regards,
-- 
Luca Weiss 




[PATCH v3 2/3] arm64: dts: qcom: pm7250b: Add a TCPM description

2024-05-30 Thread Luca Weiss
Type-C port management functionality lives inside of the PMIC block on
pm7250b.

The Type-C port management logic controls orientation detection,
vbus/vconn sense and to send/receive Type-C Power Domain messages.

Reviewed-by: Bryan O'Donoghue 
Reviewed-by: Konrad Dybcio 
Signed-off-by: Luca Weiss 
---
 arch/arm64/boot/dts/qcom/pm7250b.dtsi | 40 +++
 1 file changed, 40 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/pm7250b.dtsi 
b/arch/arm64/boot/dts/qcom/pm7250b.dtsi
index 4faed25a787f..7dc7262f1537 100644
--- a/arch/arm64/boot/dts/qcom/pm7250b.dtsi
+++ b/arch/arm64/boot/dts/qcom/pm7250b.dtsi
@@ -51,6 +51,46 @@ pm7250b_vbus: usb-vbus-regulator@1100 {
status = "disabled";
};
 
+   pm7250b_typec: typec@1500 {
+   compatible = "qcom,pm7250b-typec", "qcom,pm8150b-typec";
+   reg = <0x1500>,
+ <0x1700>;
+   interrupts = ,
+,
+,
+,
+,
+,
+,
+,
+,
+,
+,
+,
+,
+,
+,
+;
+   interrupt-names = "or-rid-detect-change",
+ "vpd-detect",
+ "cc-state-change",
+ "vconn-oc",
+ "vbus-change",
+ "attach-detach",
+ "legacy-cable-detect",
+ "try-snk-src-detect",
+ "sig-tx",
+ "sig-rx",
+ "msg-tx",
+ "msg-rx",
+ "msg-tx-failed",
+ "msg-tx-discarded",
+ "msg-rx-discarded",
+ "fr-swap";
+   vdd-vbus-supply = <_vbus>;
+   status = "disabled";
+   };
+
pm7250b_temp: temp-alarm@2400 {
compatible = "qcom,spmi-temp-alarm";
reg = <0x2400>;

-- 
2.45.1




[PATCH v3 1/3] arm64: dts: qcom: pm7250b: Add node for PMIC VBUS booster

2024-05-30 Thread Luca Weiss
Add the required DTS node for the USB VBUS output regulator, which is
available on PM7250B. This will provide the VBUS source to connected
peripherals.

Reviewed-by: Bryan O'Donoghue 
Signed-off-by: Luca Weiss 
---
 arch/arm64/boot/dts/qcom/pm7250b.dtsi | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/pm7250b.dtsi 
b/arch/arm64/boot/dts/qcom/pm7250b.dtsi
index 3bf7cf5d1700..4faed25a787f 100644
--- a/arch/arm64/boot/dts/qcom/pm7250b.dtsi
+++ b/arch/arm64/boot/dts/qcom/pm7250b.dtsi
@@ -45,6 +45,12 @@ pmic@PM7250B_SID {
#address-cells = <1>;
#size-cells = <0>;
 
+   pm7250b_vbus: usb-vbus-regulator@1100 {
+   compatible = "qcom,pm7250b-vbus-reg", 
"qcom,pm8150b-vbus-reg";
+   reg = <0x1100>;
+   status = "disabled";
+   };
+
pm7250b_temp: temp-alarm@2400 {
compatible = "qcom,spmi-temp-alarm";
reg = <0x2400>;

-- 
2.45.1




Re: [PATCH RFC 1/2] dt-bindings: soc: qcom,smsm: Allow specifying mboxes instead of qcom,ipc

2024-05-29 Thread Luca Weiss
On Samstag, 25. Mai 2024 18:47:08 MESZ Krzysztof Kozlowski wrote:
> On 24/05/2024 19:55, Luca Weiss wrote:
> > On Donnerstag, 23. Mai 2024 08:19:11 MESZ Krzysztof Kozlowski wrote:
> >> On 23/05/2024 08:16, Luca Weiss wrote:
> >>> On Donnerstag, 23. Mai 2024 08:02:13 MESZ Krzysztof Kozlowski wrote:
> >>>> On 22/05/2024 19:34, Luca Weiss wrote:
> >>>>> On Mittwoch, 22. Mai 2024 08:49:43 MESZ Krzysztof Kozlowski wrote:
> >>>>>> On 21/05/2024 22:35, Luca Weiss wrote:
> >>>>>>> On Dienstag, 21. Mai 2024 10:58:07 MESZ Krzysztof Kozlowski wrote:
> >>>>>>>> On 20/05/2024 17:11, Luca Weiss wrote:
> >>>>>>>>> Hi Krzysztof
> >>>>>>>>>
> >>>>>>>>> Ack, sounds good.
> >>>>>>>>>
> >>>>>>>>> Maybe also from you, any opinion between these two binding styles?
> >>>>>>>>>
> >>>>>>>>> So first using index of mboxes for the numbering, where for the 
> >>>>>>>>> known
> >>>>>>>>> usages the first element (and sometimes the 3rd - ipc-2) are empty 
> >>>>>>>>> <>.
> >>>>>>>>>
> >>>>>>>>> The second variant is using mbox-names to get the correct 
> >>>>>>>>> channel-mbox
> >>>>>>>>> mapping.
> >>>>>>>>>
> >>>>>>>>> -   qcom,ipc-1 = < 8 13>;
> >>>>>>>>> -   qcom,ipc-2 = < 8 9>;
> >>>>>>>>> -   qcom,ipc-3 = < 8 19>;
> >>>>>>>>> +   mboxes = <0>, < 13>, < 9>, < 19>;
> >>>>>>>>>
> >>>>>>>>> vs.
> >>>>>>>>>
> >>>>>>>>> -   qcom,ipc-1 = < 8 13>;
> >>>>>>>>> -   qcom,ipc-2 = < 8 9>;
> >>>>>>>>> -   qcom,ipc-3 = < 8 19>;
> >>>>>>>>> +   mboxes = < 13>, < 9>, < 19>;
> >>>>>>>>> +   mbox-names = "ipc-1", "ipc-2", "ipc-3";
> >>>>>>>>
> >>>>>>>> Sorry, don't get, ipc-1 is the first mailbox, so why would there be 
> >>>>>>>> <0>
> >>>>>>>> in first case?
> >>>>>>>
> >>>>>>> Actually not, ipc-0 would be permissible by the driver, used for the 
> >>>>>>> 0th host
> >>>>>>>
> >>>>>>> e.g. from:
> >>>>>>>
> >>>>>>>   /* Iterate over all hosts to check whom wants a kick */
> >>>>>>>   for (host = 0; host < smsm->num_hosts; host++) {
> >>>>>>>   hostp = >hosts[host];
> >>>>>>>
> >>>>>>> Even though no mailbox is specified in any upstream dts for this 0th 
> >>>>>>> host I
> >>>>>>> didn't want the bindings to restrict that, that's why in the first 
> >>>>>>> example
> >>>>>>> there's an empty element (<0>) for the 0th smsm host
> >>>>>>>
> >>>>>>>> Anyway, the question is if you need to know that some
> >>>>>>>> mailbox is missing. But then it is weird to name them "ipc-1" etc.
> >>>>>>>
> >>>>>>> In either case we'd just query the mbox (either by name or index) and 
> >>>>>>> then
> >>>>>>> see if it's there? Not quite sure I understand the sentence..
> >>>>>>> Pretty sure either binding would work the same way.
> >>>>>>
> >>>>>> The question is: does the driver care only about having some mailboxes
> >>>>>> or the driver cares about each specific mailbox? IOW, is skipping ipc-0
> >>>>>> important for the driver?
> >>>>>
> >>>>> There's nothing special from driver side about any mailbox. Some SoCs 
> >>>>> have
> >>>>> a mailbox for e.g.

Re: [PATCH DNM 2/2] arm64: dts: qcom: qcm6490-fairphone-fp5: Add DisplayPort sound support

2024-05-29 Thread Luca Weiss
On Tue May 28, 2024 at 11:35 PM CEST, Bjorn Andersson wrote:
> On Fri, May 10, 2024 at 02:27:09PM GMT, Luca Weiss wrote:
> > Add the required nodes for sound playback via a connected external
> > display (DisplayPort over USB-C).
> > 
> > Signed-off-by: Luca Weiss 
> > ---
> > Depends on a bunch of patches upstream doing bringup of Display (DSI),
> > DisplayPort, GPU, and then finally audio could land. But we're blocked
> > on DPU 1:1:1 topology for all of that unfortunately.
> > 
> > And also machine driver for sound just exists a bit hackily.
>
> Thanks for sharing this, Luca. Can you please resubmit this once it's
> ready to be merged, so that I don't need to keep track of it?

Definitely, though I don't expect it to be soon unfortunately, maybe you
can ask your colleagues though to fix that DPU 1:1:1 topology ;)

>
> Regards,
> Bjorn
>
> > ---
> >  arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 36 
> > ++
> >  1 file changed, 36 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts 
> > b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
> > index 05bbf1da5cb8..2bbbcaeff95e 100644
> > --- a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
> > +++ b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
> > @@ -14,6 +14,8 @@
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> > +#include 
> >  #include "sc7280.dtsi"
> >  #include "pm7250b.dtsi"
> >  #include "pm7325.dtsi"
> > @@ -774,6 +776,12 @@ _resin {
> > status = "okay";
> >  };
> >  
> > + {
> > +   dai@104 {
> > +   reg = ;
> > +   };
> > +};
> > +
> >  _spi13_cs {
> > drive-strength = <6>;
> > bias-disable;
> > @@ -847,6 +855,34 @@ _2 {
> > status = "okay";
> >  };
> >  
> > + {
> > +   compatible = "fairphone,fp5-sndcard";
> > +   model = "Fairphone 5";
> > +
> > +   mm1-dai-link {
> > +   link-name = "MultiMedia1";
> > +   cpu {
> > +   sound-dai = < MSM_FRONTEND_DAI_MULTIMEDIA1>;
> > +   };
> > +   };
> > +
> > +   displayport-rx-dai-link {
> > +   link-name = "DisplayPort Playback";
> > +
> > +   cpu {
> > +   sound-dai = < DISPLAY_PORT_RX>;
> > +   };
> > +
> > +   platform {
> > +   sound-dai = <>;
> > +   };
> > +
> > +   codec {
> > +   sound-dai = <_dp>;
> > +   };
> > +   };
> > +};
> > +
> >   {
> > status = "okay";
> >  
> > 
> > -- 
> > 2.45.0
> > 




Re: [PATCH RFC 1/2] dt-bindings: soc: qcom,smsm: Allow specifying mboxes instead of qcom,ipc

2024-05-24 Thread Luca Weiss
On Donnerstag, 23. Mai 2024 08:19:11 MESZ Krzysztof Kozlowski wrote:
> On 23/05/2024 08:16, Luca Weiss wrote:
> > On Donnerstag, 23. Mai 2024 08:02:13 MESZ Krzysztof Kozlowski wrote:
> >> On 22/05/2024 19:34, Luca Weiss wrote:
> >>> On Mittwoch, 22. Mai 2024 08:49:43 MESZ Krzysztof Kozlowski wrote:
> >>>> On 21/05/2024 22:35, Luca Weiss wrote:
> >>>>> On Dienstag, 21. Mai 2024 10:58:07 MESZ Krzysztof Kozlowski wrote:
> >>>>>> On 20/05/2024 17:11, Luca Weiss wrote:
> >>>>>>> Hi Krzysztof
> >>>>>>>
> >>>>>>> Ack, sounds good.
> >>>>>>>
> >>>>>>> Maybe also from you, any opinion between these two binding styles?
> >>>>>>>
> >>>>>>> So first using index of mboxes for the numbering, where for the known
> >>>>>>> usages the first element (and sometimes the 3rd - ipc-2) are empty <>.
> >>>>>>>
> >>>>>>> The second variant is using mbox-names to get the correct channel-mbox
> >>>>>>> mapping.
> >>>>>>>
> >>>>>>> -   qcom,ipc-1 = < 8 13>;
> >>>>>>> -   qcom,ipc-2 = < 8 9>;
> >>>>>>> -   qcom,ipc-3 = < 8 19>;
> >>>>>>> +   mboxes = <0>, < 13>, < 9>, < 19>;
> >>>>>>>
> >>>>>>> vs.
> >>>>>>>
> >>>>>>> -   qcom,ipc-1 = < 8 13>;
> >>>>>>> -   qcom,ipc-2 = < 8 9>;
> >>>>>>> -   qcom,ipc-3 = < 8 19>;
> >>>>>>> +   mboxes = < 13>, < 9>, < 19>;
> >>>>>>> +   mbox-names = "ipc-1", "ipc-2", "ipc-3";
> >>>>>>
> >>>>>> Sorry, don't get, ipc-1 is the first mailbox, so why would there be <0>
> >>>>>> in first case?
> >>>>>
> >>>>> Actually not, ipc-0 would be permissible by the driver, used for the 
> >>>>> 0th host
> >>>>>
> >>>>> e.g. from:
> >>>>>
> >>>>> /* Iterate over all hosts to check whom wants a kick */
> >>>>> for (host = 0; host < smsm->num_hosts; host++) {
> >>>>> hostp = >hosts[host];
> >>>>>
> >>>>> Even though no mailbox is specified in any upstream dts for this 0th 
> >>>>> host I
> >>>>> didn't want the bindings to restrict that, that's why in the first 
> >>>>> example
> >>>>> there's an empty element (<0>) for the 0th smsm host
> >>>>>
> >>>>>> Anyway, the question is if you need to know that some
> >>>>>> mailbox is missing. But then it is weird to name them "ipc-1" etc.
> >>>>>
> >>>>> In either case we'd just query the mbox (either by name or index) and 
> >>>>> then
> >>>>> see if it's there? Not quite sure I understand the sentence..
> >>>>> Pretty sure either binding would work the same way.
> >>>>
> >>>> The question is: does the driver care only about having some mailboxes
> >>>> or the driver cares about each specific mailbox? IOW, is skipping ipc-0
> >>>> important for the driver?
> >>>
> >>> There's nothing special from driver side about any mailbox. Some SoCs have
> >>> a mailbox for e.g. hosts 1&2&3, some have only 1&3, and apq8064 even has
> >>> 1&2&3&4.
> >>>
> >>> And if the driver doesn't find a mailbox for a host, it just ignores it
> >>> but then of course it can't 'ring' the mailbox for that host when 
> >>> necessary.
> >>>
> >>> Not sure how much more I can add here, to be fair I barely understand what
> >>> this driver is doing myself apart from the obvious.
> >>
> >> From what you said, it looks like it is enough to just list mailboxes,
> >> e.g. for ipc-1, ipc-2 and ipc-4 (so no ipc-0 and ipc-3):
> > 
> > No, for sure we need also the possibility to list ipc-3.
> 
> ? You can list it, what's the problem>

Maybe we're ta

Re: [PATCH RFC 1/2] dt-bindings: soc: qcom,smsm: Allow specifying mboxes instead of qcom,ipc

2024-05-23 Thread Luca Weiss
On Donnerstag, 23. Mai 2024 08:02:13 MESZ Krzysztof Kozlowski wrote:
> On 22/05/2024 19:34, Luca Weiss wrote:
> > On Mittwoch, 22. Mai 2024 08:49:43 MESZ Krzysztof Kozlowski wrote:
> >> On 21/05/2024 22:35, Luca Weiss wrote:
> >>> On Dienstag, 21. Mai 2024 10:58:07 MESZ Krzysztof Kozlowski wrote:
> >>>> On 20/05/2024 17:11, Luca Weiss wrote:
> >>>>> Hi Krzysztof
> >>>>>
> >>>>> Ack, sounds good.
> >>>>>
> >>>>> Maybe also from you, any opinion between these two binding styles?
> >>>>>
> >>>>> So first using index of mboxes for the numbering, where for the known
> >>>>> usages the first element (and sometimes the 3rd - ipc-2) are empty <>.
> >>>>>
> >>>>> The second variant is using mbox-names to get the correct channel-mbox
> >>>>> mapping.
> >>>>>
> >>>>> -   qcom,ipc-1 = < 8 13>;
> >>>>> -   qcom,ipc-2 = < 8 9>;
> >>>>> -   qcom,ipc-3 = < 8 19>;
> >>>>> +   mboxes = <0>, < 13>, < 9>, < 19>;
> >>>>>
> >>>>> vs.
> >>>>>
> >>>>> -   qcom,ipc-1 = < 8 13>;
> >>>>> -   qcom,ipc-2 = < 8 9>;
> >>>>> -   qcom,ipc-3 = < 8 19>;
> >>>>> +   mboxes = < 13>, < 9>, < 19>;
> >>>>> +   mbox-names = "ipc-1", "ipc-2", "ipc-3";
> >>>>
> >>>> Sorry, don't get, ipc-1 is the first mailbox, so why would there be <0>
> >>>> in first case?
> >>>
> >>> Actually not, ipc-0 would be permissible by the driver, used for the 0th 
> >>> host
> >>>
> >>> e.g. from:
> >>>
> >>>   /* Iterate over all hosts to check whom wants a kick */
> >>>   for (host = 0; host < smsm->num_hosts; host++) {
> >>>   hostp = >hosts[host];
> >>>
> >>> Even though no mailbox is specified in any upstream dts for this 0th host 
> >>> I
> >>> didn't want the bindings to restrict that, that's why in the first example
> >>> there's an empty element (<0>) for the 0th smsm host
> >>>
> >>>> Anyway, the question is if you need to know that some
> >>>> mailbox is missing. But then it is weird to name them "ipc-1" etc.
> >>>
> >>> In either case we'd just query the mbox (either by name or index) and then
> >>> see if it's there? Not quite sure I understand the sentence..
> >>> Pretty sure either binding would work the same way.
> >>
> >> The question is: does the driver care only about having some mailboxes
> >> or the driver cares about each specific mailbox? IOW, is skipping ipc-0
> >> important for the driver?
> > 
> > There's nothing special from driver side about any mailbox. Some SoCs have
> > a mailbox for e.g. hosts 1&2&3, some have only 1&3, and apq8064 even has
> > 1&2&3&4.
> > 
> > And if the driver doesn't find a mailbox for a host, it just ignores it
> > but then of course it can't 'ring' the mailbox for that host when necessary.
> > 
> > Not sure how much more I can add here, to be fair I barely understand what
> > this driver is doing myself apart from the obvious.
> 
> From what you said, it looks like it is enough to just list mailboxes,
> e.g. for ipc-1, ipc-2 and ipc-4 (so no ipc-0 and ipc-3):

No, for sure we need also the possibility to list ipc-3.

And my point is that I'm not sure if any platform will ever need ipc-0, but
the code to use that if it ever exists is there - the driver always
tries getting an mbox (currently just syscon of course) for every host
from 0 to n.

These are the current (non-mbox-API) mboxes provided to smsm:

$ git grep qcom,ipc- arch/
arch/arm/boot/dts/qcom/qcom-apq8064.dtsi:   qcom,ipc-1 = < 8 
4>;
arch/arm/boot/dts/qcom/qcom-apq8064.dtsi:   qcom,ipc-2 = < 8 
14>;
arch/arm/boot/dts/qcom/qcom-apq8064.dtsi:   qcom,ipc-3 = < 8 
23>;
arch/arm/boot/dts/qcom/qcom-apq8064.dtsi:   qcom,ipc-4 = 
<_sic_non_secure 0x4094 0>;
arch/arm/boot/dts/qcom/qcom-msm8974.dtsi:   qcom,ipc-1 = < 8 
13>;
arch/arm/boot/dts/qcom/qcom-msm8974.dtsi:   qcom,ipc-2 = < 8 
9>;
arch/arm/boot/dts/qcom/qcom-msm8974.dtsi:   qcom,ipc-3 = < 8 
19>;
arch/arm64/boot/dts/qcom/msm8916.dtsi:  qcom,ipc-1 = < 8 13>;
arch/arm64/boot/dts/qcom/msm8916.dtsi:  qcom,ipc-3 = < 8 19>;
arch/arm64/boot/dts/qcom/msm8939.dtsi:  qcom,ipc-1 = <_mbox 8 13>;
arch/arm64/boot/dts/qcom/msm8939.dtsi:  qcom,ipc-3 = <_mbox 8 19>;
arch/arm64/boot/dts/qcom/msm8953.dtsi:  qcom,ipc-1 = < 8 13>;
arch/arm64/boot/dts/qcom/msm8953.dtsi:  qcom,ipc-3 = < 8 19>;
arch/arm64/boot/dts/qcom/msm8976.dtsi:  qcom,ipc-1 = < 8 13>;
arch/arm64/boot/dts/qcom/msm8976.dtsi:  qcom,ipc-2 = < 8 9>;
arch/arm64/boot/dts/qcom/msm8976.dtsi:  qcom,ipc-3 = < 8 19>;

> 
> mboxes = < 13>, < 9>, < 19>;
> 
> Best regards,
> Krzysztof
> 
> 







Re: [PATCH RFC 1/2] dt-bindings: soc: qcom,smsm: Allow specifying mboxes instead of qcom,ipc

2024-05-22 Thread Luca Weiss
On Mittwoch, 22. Mai 2024 08:49:43 MESZ Krzysztof Kozlowski wrote:
> On 21/05/2024 22:35, Luca Weiss wrote:
> > On Dienstag, 21. Mai 2024 10:58:07 MESZ Krzysztof Kozlowski wrote:
> >> On 20/05/2024 17:11, Luca Weiss wrote:
> >>> Hi Krzysztof
> >>>
> >>> Ack, sounds good.
> >>>
> >>> Maybe also from you, any opinion between these two binding styles?
> >>>
> >>> So first using index of mboxes for the numbering, where for the known
> >>> usages the first element (and sometimes the 3rd - ipc-2) are empty <>.
> >>>
> >>> The second variant is using mbox-names to get the correct channel-mbox
> >>> mapping.
> >>>
> >>> -   qcom,ipc-1 = < 8 13>;
> >>> -   qcom,ipc-2 = < 8 9>;
> >>> -   qcom,ipc-3 = < 8 19>;
> >>> +   mboxes = <0>, < 13>, < 9>, < 19>;
> >>>
> >>> vs.
> >>>
> >>> -   qcom,ipc-1 = < 8 13>;
> >>> -   qcom,ipc-2 = < 8 9>;
> >>> -   qcom,ipc-3 = < 8 19>;
> >>> +   mboxes = < 13>, < 9>, < 19>;
> >>> +   mbox-names = "ipc-1", "ipc-2", "ipc-3";
> >>
> >> Sorry, don't get, ipc-1 is the first mailbox, so why would there be <0>
> >> in first case?
> > 
> > Actually not, ipc-0 would be permissible by the driver, used for the 0th 
> > host
> > 
> > e.g. from:
> > 
> > /* Iterate over all hosts to check whom wants a kick */
> > for (host = 0; host < smsm->num_hosts; host++) {
> > hostp = >hosts[host];
> > 
> > Even though no mailbox is specified in any upstream dts for this 0th host I
> > didn't want the bindings to restrict that, that's why in the first example
> > there's an empty element (<0>) for the 0th smsm host
> > 
> >> Anyway, the question is if you need to know that some
> >> mailbox is missing. But then it is weird to name them "ipc-1" etc.
> > 
> > In either case we'd just query the mbox (either by name or index) and then
> > see if it's there? Not quite sure I understand the sentence..
> > Pretty sure either binding would work the same way.
> 
> The question is: does the driver care only about having some mailboxes
> or the driver cares about each specific mailbox? IOW, is skipping ipc-0
> important for the driver?

There's nothing special from driver side about any mailbox. Some SoCs have
a mailbox for e.g. hosts 1&2&3, some have only 1&3, and apq8064 even has
1&2&3&4.

And if the driver doesn't find a mailbox for a host, it just ignores it
but then of course it can't 'ring' the mailbox for that host when necessary.

Not sure how much more I can add here, to be fair I barely understand what
this driver is doing myself apart from the obvious.

Regards
Luca

> 
> 
> Best regards,
> Krzysztof
> 
> 







Re: [PATCH RFC 1/2] dt-bindings: soc: qcom,smsm: Allow specifying mboxes instead of qcom,ipc

2024-05-21 Thread Luca Weiss
On Dienstag, 21. Mai 2024 10:58:07 MESZ Krzysztof Kozlowski wrote:
> On 20/05/2024 17:11, Luca Weiss wrote:
> > Hi Krzysztof
> > 
> > Ack, sounds good.
> > 
> > Maybe also from you, any opinion between these two binding styles?
> > 
> > So first using index of mboxes for the numbering, where for the known
> > usages the first element (and sometimes the 3rd - ipc-2) are empty <>.
> > 
> > The second variant is using mbox-names to get the correct channel-mbox
> > mapping.
> > 
> > -   qcom,ipc-1 = < 8 13>;
> > -   qcom,ipc-2 = < 8 9>;
> > -   qcom,ipc-3 = < 8 19>;
> > +   mboxes = <0>, < 13>, < 9>, < 19>;
> > 
> > vs.
> > 
> > -   qcom,ipc-1 = < 8 13>;
> > -   qcom,ipc-2 = < 8 9>;
> > -   qcom,ipc-3 = < 8 19>;
> > +   mboxes = < 13>, < 9>, < 19>;
> > +   mbox-names = "ipc-1", "ipc-2", "ipc-3";
> 
> Sorry, don't get, ipc-1 is the first mailbox, so why would there be <0>
> in first case?

Actually not, ipc-0 would be permissible by the driver, used for the 0th host

e.g. from:

/* Iterate over all hosts to check whom wants a kick */
for (host = 0; host < smsm->num_hosts; host++) {
hostp = >hosts[host];

Even though no mailbox is specified in any upstream dts for this 0th host I
didn't want the bindings to restrict that, that's why in the first example
there's an empty element (<0>) for the 0th smsm host

> Anyway, the question is if you need to know that some
> mailbox is missing. But then it is weird to name them "ipc-1" etc.

In either case we'd just query the mbox (either by name or index) and then
see if it's there? Not quite sure I understand the sentence..
Pretty sure either binding would work the same way.

Regards
Luca

> 
> Best regards,
> Krzysztof
> 
> 







Re: [PATCH RFC 1/2] dt-bindings: soc: qcom,smsm: Allow specifying mboxes instead of qcom,ipc

2024-05-20 Thread Luca Weiss
On Montag, 20. Mai 2024 08:46:39 MESZ Krzysztof Kozlowski wrote:
> On 15/05/2024 17:06, Luca Weiss wrote:
> > Hi Rob,
> > 
> > Any feedback on the below topic?
> 
> Can be explained in description, like
> mboxes:
>   description: Each entry corresponds to one remote processor
>   maxItems: 5

Hi Krzysztof

Ack, sounds good.

Maybe also from you, any opinion between these two binding styles?

So first using index of mboxes for the numbering, where for the known
usages the first element (and sometimes the 3rd - ipc-2) are empty <>.

The second variant is using mbox-names to get the correct channel-mbox
mapping.

-   qcom,ipc-1 = < 8 13>;
-   qcom,ipc-2 = < 8 9>;
-   qcom,ipc-3 = < 8 19>;
+   mboxes = <0>, < 13>, < 9>, < 19>;

vs.

-   qcom,ipc-1 = < 8 13>;
-   qcom,ipc-2 = < 8 9>;
-   qcom,ipc-3 = < 8 19>;
+   mboxes = < 13>, < 9>, < 19>;
+   mbox-names = "ipc-1", "ipc-2", "ipc-3";

Regards
Luca

> 
> Best regards,
> Krzysztof
> 
> 







Re: [PATCH RFC 1/2] dt-bindings: soc: qcom,smsm: Allow specifying mboxes instead of qcom,ipc

2024-05-15 Thread Luca Weiss
Hi Rob,

Any feedback on the below topic?

Regards
Luca

On Donnerstag, 25. April 2024 20:54:40 MESZ Luca Weiss wrote:
> On Donnerstag, 25. April 2024 18:17:15 MESZ Rob Herring wrote:
> > On Wed, Apr 24, 2024 at 07:21:51PM +0200, Luca Weiss wrote:
> > > The qcom,ipc-N properties are essentially providing a reference to a
> > > mailbox, so allow using the mboxes property to do the same in a more
> > > structured way.
> > 
> > Can we mark qcom,ipc-N as deprecated then?
> 
> Yes, that should be ok. Will also send a similar change to the other bindings
> that support both qcom,ipc and mboxes.
> 
> >  
> > > Since multiple SMSM hosts are supported, we need to be able to provide
> > > the correct mailbox for each host. The old qcom,ipc-N properties map to
> > > the mboxes property by index, starting at 0 since that's a valid SMSM
> > > host also.
> > > 
> > > The new example shows how an smsm node with just qcom,ipc-3 should be
> > > specified with the mboxes property.
> > > 
> > > Signed-off-by: Luca Weiss 
> > > ---
> > >  .../devicetree/bindings/soc/qcom/qcom,smsm.yaml| 48 
> > > ++
> > >  1 file changed, 40 insertions(+), 8 deletions(-)
> > > 
> > > diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,smsm.yaml 
> > > b/Documentation/devicetree/bindings/soc/qcom/qcom,smsm.yaml
> > > index db67cf043256..b12589171169 100644
> > > --- a/Documentation/devicetree/bindings/soc/qcom/qcom,smsm.yaml
> > > +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,smsm.yaml
> > > @@ -33,6 +33,13 @@ properties:
> > >specifier of the column in the subscription matrix representing 
> > > the local
> > >processor.
> > >  
> > > +  mboxes:
> > > +minItems: 1
> > > +maxItems: 5
> > 
> > Need to define what each entry is.
> 
> The entry is (description from qcom,ipc-N)
> 
>   "the outgoing ipc bit used for signaling the N:th remote processor."
> 
> So you want me to add 5 times e.g.
> 
> - the IPC mailbox used for signaling the 0th remote processor
> - the IPC mailbox used for signaling the 1st remote processor
> 
> etc? I don't really have any extra knowledge on smsm to be able to write
> something better there..
> 
> Also what are your thoughts on this binding vs the alternative I wrote
> in the cover letter? I'm not really happy about how the properties are
> represented.
> 
> Regards
> Luca
> 
> 
> > 
> > > +description:
> > > +  Reference to the mailbox representing the outgoing doorbell in 
> > > APCS for
> > > +  this client.
> > > +
> > >'#size-cells':
> > >  const: 0
> > >  
> > > @@ -98,15 +105,18 @@ required:
> > >- '#address-cells'
> > >- '#size-cells'
> > >  
> > > -anyOf:
> > > +oneOf:
> > >- required:
> > > -  - qcom,ipc-1
> > > -  - required:
> > > -  - qcom,ipc-2
> > > -  - required:
> > > -  - qcom,ipc-3
> > > -  - required:
> > > -  - qcom,ipc-4
> > > +  - mboxes
> > > +  - anyOf:
> > > +  - required:
> > > +  - qcom,ipc-1
> > > +  - required:
> > > +  - qcom,ipc-2
> > > +  - required:
> > > +  - qcom,ipc-3
> > > +  - required:
> > > +  - qcom,ipc-4
> > >  
> > >  additionalProperties: false
> > >  
> > > @@ -136,3 +146,25 @@ examples:
> > >  #interrupt-cells = <2>;
> > >  };
> > >  };
> > > +  # Example using mboxes property
> > > +  - |
> > > +#include 
> > > +
> > > +shared-memory {
> > > +compatible = "qcom,smsm";
> > > +#address-cells = <1>;
> > > +#size-cells = <0>;
> > > +mboxes = <0>, <0>, <0>, < 19>;
> > > +
> > > +apps@0 {
> > > +reg = <0>;
> > > +#qcom,smem-state-cells = <1>;
> > > +};
> > > +
> > > +wcnss@7 {
> > > +reg = <7>;
> > > +interrupts = ;
> > > +interrupt-controller;
> > > +#interrupt-cells = <2>;
> > > +};
> > > +};
> > > 
> > 
> 
> 







[PATCH 1/2] arm64: dts: qcom: sc7280: Add APR nodes for sound

2024-05-10 Thread Luca Weiss
Add the different services found on APR on some devices with SC7280 SoC.
Additionally add an empty sound node in the root node as is seen on
other SoC dtsi files so device dt's can easily use that.

Signed-off-by: Luca Weiss 
---
 arch/arm64/boot/dts/qcom/sc7280.dtsi | 73 
 1 file changed, 73 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi 
b/arch/arm64/boot/dts/qcom/sc7280.dtsi
index fc9ec367e3a5..659212bb38c1 100644
--- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -3762,6 +3763,75 @@ IPCC_MPROC_SIGNAL_GLINK_QMP
label = "lpass";
qcom,remote-pid = <2>;
 
+   apr {
+   compatible = "qcom,apr-v2";
+   qcom,glink-channels = "apr_audio_svc";
+   qcom,domain = ;
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   service@3 {
+   reg = ;
+   compatible = "qcom,q6core";
+   qcom,protection-domain = 
"avs/audio", "msm/adsp/audio_pd";
+   };
+
+   q6afe: service@4 {
+   compatible = "qcom,q6afe";
+   reg = ;
+   qcom,protection-domain = 
"avs/audio", "msm/adsp/audio_pd";
+
+   q6afedai: dais {
+   compatible = 
"qcom,q6afe-dais";
+   #address-cells = <1>;
+   #size-cells = <0>;
+   #sound-dai-cells = <1>;
+   };
+
+   q6afecc: clock-controller {
+   compatible = 
"qcom,q6afe-clocks";
+   #clock-cells = <2>;
+   };
+   };
+
+   q6asm: service@7 {
+   compatible = "qcom,q6asm";
+   reg = ;
+   qcom,protection-domain = 
"avs/audio", "msm/adsp/audio_pd";
+
+   q6asmdai: dais {
+   compatible = 
"qcom,q6asm-dais";
+   #address-cells = <1>;
+   #size-cells = <0>;
+   #sound-dai-cells = <1>;
+   iommus = <_smmu 
0x1801 0x0>;
+
+   dai@0 {
+   reg = <0>;
+   };
+
+   dai@1 {
+   reg = <1>;
+   };
+
+   dai@2 {
+   reg = <2>;
+   };
+   };
+   };
+
+   q6adm: service@8 {
+   compatible = "qcom,q6adm";
+   reg = ;
+   qcom,protection-domain = 
"avs/audio", "msm/adsp/audio_pd";
+
+   q6routing: routing {
+   compatible = 
"qcom,q6adm-routing";
+   #sound-dai-cells = <0>;
+   };
+   };
+ 

[PATCH DNM 2/2] arm64: dts: qcom: qcm6490-fairphone-fp5: Add DisplayPort sound support

2024-05-10 Thread Luca Weiss
Add the required nodes for sound playback via a connected external
display (DisplayPort over USB-C).

Signed-off-by: Luca Weiss 
---
Depends on a bunch of patches upstream doing bringup of Display (DSI),
DisplayPort, GPU, and then finally audio could land. But we're blocked
on DPU 1:1:1 topology for all of that unfortunately.

And also machine driver for sound just exists a bit hackily.
---
 arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 36 ++
 1 file changed, 36 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts 
b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
index 05bbf1da5cb8..2bbbcaeff95e 100644
--- a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
+++ b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
@@ -14,6 +14,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include "sc7280.dtsi"
 #include "pm7250b.dtsi"
 #include "pm7325.dtsi"
@@ -774,6 +776,12 @@ _resin {
status = "okay";
 };
 
+ {
+   dai@104 {
+   reg = ;
+   };
+};
+
 _spi13_cs {
drive-strength = <6>;
bias-disable;
@@ -847,6 +855,34 @@ _2 {
status = "okay";
 };
 
+ {
+   compatible = "fairphone,fp5-sndcard";
+   model = "Fairphone 5";
+
+   mm1-dai-link {
+   link-name = "MultiMedia1";
+   cpu {
+   sound-dai = < MSM_FRONTEND_DAI_MULTIMEDIA1>;
+   };
+   };
+
+   displayport-rx-dai-link {
+   link-name = "DisplayPort Playback";
+
+   cpu {
+   sound-dai = < DISPLAY_PORT_RX>;
+   };
+
+   platform {
+   sound-dai = <>;
+   };
+
+   codec {
+   sound-dai = <_dp>;
+   };
+   };
+};
+
  {
status = "okay";
 

-- 
2.45.0




[PATCH 0/2] Add basic APR sound support for SC7280 SoC

2024-05-10 Thread Luca Weiss
Validated on Fairphone 5 (QCM6490) smartphone by using DisplayPort over
USB-C audio, connected to a TV, with a basic UCM to enable
'DISPLAY_PORT_RX Audio Mixer MultiMedia1':
https://gitlab.com/postmarketOS/pmaports/-/tree/master/device/testing/device-fairphone-fp5/ucm

Unfortunately all the device-specific things can't be enabled yet
upstream as detailed in the second patch, but the SoC parts should be
good to go.

As an extra note, I'm not sure how this will behave on SC7280 devices
that seem to use GPR (q6apm + q6prm) / "audioreach" as added in this
series from mid 2023 which was never applied:
https://lore.kernel.org/linux-arm-msm/20230616103534.4031331-1-quic_m...@quicinc.com/

Signed-off-by: Luca Weiss 
---
Luca Weiss (2):
  arm64: dts: qcom: sc7280: Add APR nodes for sound
  [DNM] arm64: dts: qcom: qcm6490-fairphone-fp5: Add DisplayPort sound 
support

 arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 36 +++
 arch/arm64/boot/dts/qcom/sc7280.dtsi   | 73 ++
 2 files changed, 109 insertions(+)
---
base-commit: 940d65ef852b4a58c9115eb82b07844c999b8356
change-id: 20240510-sc7280-apr-c6d10ac2c331

Best regards,
-- 
Luca Weiss 




[PATCH] clk: qcom: gcc-sm6350: Fix gpll6* & gpll7 parents

2024-05-08 Thread Luca Weiss
Both gpll6 and gpll7 are parented to CXO at 19.2 MHz and not to GPLL0
which runs at 600 MHz. Also gpll6_out_even should have the parent gpll6
and not gpll0.

Adjust the parents of these clocks to make Linux report the correct rate
and not absurd numbers like gpll7 at ~25 GHz or gpll6 at 24 GHz.

Corrected rates are the following:

  gpll7  80702 Hz
  gpll6  76800 Hz
 gpll6_out_even  38400 Hz
  gpll0  6 Hz
 gpll0_out_odd   2 Hz
 gpll0_out_even  3 Hz

And because gpll6 is the parent of gcc_sdcc2_apps_clk_src (at 202 MHz)
that clock also reports the correct rate now and avoids this warning:

  [5.984062] mmc0: Card appears overclocked; req 20200 Hz, actual 
6312499237 Hz

Fixes: 131abae905df ("clk: qcom: Add SM6350 GCC driver")
Signed-off-by: Luca Weiss 
---
 drivers/clk/qcom/gcc-sm6350.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/qcom/gcc-sm6350.c b/drivers/clk/qcom/gcc-sm6350.c
index cf4a7b6e0b23..0559a33faf00 100644
--- a/drivers/clk/qcom/gcc-sm6350.c
+++ b/drivers/clk/qcom/gcc-sm6350.c
@@ -100,8 +100,8 @@ static struct clk_alpha_pll gpll6 = {
.enable_mask = BIT(6),
.hw.init = &(struct clk_init_data){
.name = "gpll6",
-   .parent_hws = (const struct clk_hw*[]){
-   ,
+   .parent_data = &(const struct clk_parent_data){
+   .fw_name = "bi_tcxo",
},
.num_parents = 1,
.ops = _alpha_pll_fixed_fabia_ops,
@@ -124,7 +124,7 @@ static struct clk_alpha_pll_postdiv gpll6_out_even = {
.clkr.hw.init = &(struct clk_init_data){
.name = "gpll6_out_even",
.parent_hws = (const struct clk_hw*[]){
-   ,
+   ,
},
.num_parents = 1,
.ops = _alpha_pll_postdiv_fabia_ops,
@@ -139,8 +139,8 @@ static struct clk_alpha_pll gpll7 = {
.enable_mask = BIT(7),
.hw.init = &(struct clk_init_data){
.name = "gpll7",
-   .parent_hws = (const struct clk_hw*[]){
-   ,
+   .parent_data = &(const struct clk_parent_data){
+   .fw_name = "bi_tcxo",
},
.num_parents = 1,
.ops = _alpha_pll_fixed_fabia_ops,

---
base-commit: dd5a440a31fae6e459c0d627162825505361
change-id: 20240508-sm6350-gpll-fix-a308bb393434

Best regards,
-- 
Luca Weiss 




[PATCH 2/2] dt-bindings: soc: qcom,smp2p: Mark qcom,ipc as deprecated

2024-04-25 Thread Luca Weiss
Deprecate the qcom,ipc way of accessing the mailbox in favor of the
'mboxes' property.

Update the example to use mboxes.

Signed-off-by: Luca Weiss 
---
 Documentation/devicetree/bindings/soc/qcom/qcom,smp2p.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,smp2p.yaml 
b/Documentation/devicetree/bindings/soc/qcom/qcom,smp2p.yaml
index 58500529b90f..141d666dc3f7 100644
--- a/Documentation/devicetree/bindings/soc/qcom/qcom,smp2p.yaml
+++ b/Documentation/devicetree/bindings/soc/qcom/qcom,smp2p.yaml
@@ -41,6 +41,7 @@ properties:
 description:
   Three entries specifying the outgoing ipc bit used for signaling the
   remote end of the smp2p edge.
+deprecated: true
 
   qcom,local-pid:
 $ref: /schemas/types.yaml#/definitions/uint32
@@ -128,7 +129,7 @@ examples:
 compatible = "qcom,smp2p";
 qcom,smem = <431>, <451>;
 interrupts = ;
-qcom,ipc = < 8 18>;
+mboxes = < 18>;
 qcom,local-pid = <0>;
 qcom,remote-pid = <4>;
 

-- 
2.44.0




[PATCH 1/2] dt-bindings: remoteproc: qcom,smd-edge: Mark qcom,ipc as deprecated

2024-04-25 Thread Luca Weiss
Deprecate the qcom,ipc way of accessing the mailbox in favor of the
'mboxes' property.

Update the example to use mboxes.

Signed-off-by: Luca Weiss 
---
 Documentation/devicetree/bindings/remoteproc/qcom,smd-edge.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,smd-edge.yaml 
b/Documentation/devicetree/bindings/remoteproc/qcom,smd-edge.yaml
index 02c85b420c1a..63500b1a0f6f 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,smd-edge.yaml
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,smd-edge.yaml
@@ -61,6 +61,7 @@ properties:
 description:
   Three entries specifying the outgoing ipc bit used for signaling the
   remote processor.
+deprecated: true
 
   qcom,smd-edge:
 $ref: /schemas/types.yaml#/definitions/uint32
@@ -111,7 +112,7 @@ examples:
 smd-edge {
 interrupts = ;
 
-qcom,ipc = < 8 8>;
+mboxes = < 8>;
 qcom,smd-edge = <1>;
 };
 };

-- 
2.44.0




[PATCH 0/2] Mark qcom,ipc as deprecated in two schemas

2024-04-25 Thread Luca Weiss
The mboxes property has been supported in those bindings since a while
and was always meant to the replace qcom,ipc properties, so let's mark
qcom,ipc as deprecated - and update the examples to use mboxes.

Related:
https://lore.kernel.org/linux-arm-msm/20240424-apcs-mboxes-v1-0-6556c47cb...@z3ntu.xyz/

Signed-off-by: Luca Weiss 
---
Luca Weiss (2):
  dt-bindings: remoteproc: qcom,smd-edge: Mark qcom,ipc as deprecated
  dt-bindings: soc: qcom,smp2p: Mark qcom,ipc as deprecated

 Documentation/devicetree/bindings/remoteproc/qcom,smd-edge.yaml | 3 ++-
 Documentation/devicetree/bindings/soc/qcom/qcom,smp2p.yaml  | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
---
base-commit: a59668a9397e7245b26e9be85d23f242ff757ae8
change-id: 20240425-qcom-ipc-deprecate-37afbe33cadc

Best regards,
-- 
Luca Weiss 




Re: [PATCH RFC 1/2] dt-bindings: soc: qcom,smsm: Allow specifying mboxes instead of qcom,ipc

2024-04-25 Thread Luca Weiss
On Donnerstag, 25. April 2024 18:17:15 MESZ Rob Herring wrote:
> On Wed, Apr 24, 2024 at 07:21:51PM +0200, Luca Weiss wrote:
> > The qcom,ipc-N properties are essentially providing a reference to a
> > mailbox, so allow using the mboxes property to do the same in a more
> > structured way.
> 
> Can we mark qcom,ipc-N as deprecated then?

Yes, that should be ok. Will also send a similar change to the other bindings
that support both qcom,ipc and mboxes.

>  
> > Since multiple SMSM hosts are supported, we need to be able to provide
> > the correct mailbox for each host. The old qcom,ipc-N properties map to
> > the mboxes property by index, starting at 0 since that's a valid SMSM
> > host also.
> > 
> > The new example shows how an smsm node with just qcom,ipc-3 should be
> > specified with the mboxes property.
> > 
> > Signed-off-by: Luca Weiss 
> > ---
> >  .../devicetree/bindings/soc/qcom/qcom,smsm.yaml| 48 
> > ++
> >  1 file changed, 40 insertions(+), 8 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,smsm.yaml 
> > b/Documentation/devicetree/bindings/soc/qcom/qcom,smsm.yaml
> > index db67cf043256..b12589171169 100644
> > --- a/Documentation/devicetree/bindings/soc/qcom/qcom,smsm.yaml
> > +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,smsm.yaml
> > @@ -33,6 +33,13 @@ properties:
> >specifier of the column in the subscription matrix representing the 
> > local
> >processor.
> >  
> > +  mboxes:
> > +minItems: 1
> > +maxItems: 5
> 
> Need to define what each entry is.

The entry is (description from qcom,ipc-N)

  "the outgoing ipc bit used for signaling the N:th remote processor."

So you want me to add 5 times e.g.

- the IPC mailbox used for signaling the 0th remote processor
- the IPC mailbox used for signaling the 1st remote processor

etc? I don't really have any extra knowledge on smsm to be able to write
something better there..

Also what are your thoughts on this binding vs the alternative I wrote
in the cover letter? I'm not really happy about how the properties are
represented.

Regards
Luca


> 
> > +description:
> > +  Reference to the mailbox representing the outgoing doorbell in APCS 
> > for
> > +  this client.
> > +
> >'#size-cells':
> >  const: 0
> >  
> > @@ -98,15 +105,18 @@ required:
> >- '#address-cells'
> >- '#size-cells'
> >  
> > -anyOf:
> > +oneOf:
> >- required:
> > -  - qcom,ipc-1
> > -  - required:
> > -  - qcom,ipc-2
> > -  - required:
> > -  - qcom,ipc-3
> > -  - required:
> > -  - qcom,ipc-4
> > +  - mboxes
> > +  - anyOf:
> > +  - required:
> > +  - qcom,ipc-1
> > +  - required:
> > +  - qcom,ipc-2
> > +  - required:
> > +  - qcom,ipc-3
> > +  - required:
> > +  - qcom,ipc-4
> >  
> >  additionalProperties: false
> >  
> > @@ -136,3 +146,25 @@ examples:
> >  #interrupt-cells = <2>;
> >  };
> >  };
> > +  # Example using mboxes property
> > +  - |
> > +#include 
> > +
> > +shared-memory {
> > +compatible = "qcom,smsm";
> > +#address-cells = <1>;
> > +#size-cells = <0>;
> > +mboxes = <0>, <0>, <0>, < 19>;
> > +
> > +apps@0 {
> > +reg = <0>;
> > +#qcom,smem-state-cells = <1>;
> > +};
> > +
> > +wcnss@7 {
> > +reg = <7>;
> > +interrupts = ;
> > +interrupt-controller;
> > +#interrupt-cells = <2>;
> > +};
> > +};
> > 
> 







[PATCH RFC 2/2] soc: qcom: smsm: Support using mailbox interface

2024-04-24 Thread Luca Weiss
Add support for using the mbox interface instead of manually writing to
the syscon. With this change the driver will attempt to get the mailbox
first, and if that fails it will fall back to the existing way of using
qcom,ipc-* properties and converting to syscon.

Signed-off-by: Luca Weiss 
---
 drivers/soc/qcom/smsm.c | 51 -
 1 file changed, 50 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/qcom/smsm.c b/drivers/soc/qcom/smsm.c
index e7c7e9a640a6..ffe78ae34386 100644
--- a/drivers/soc/qcom/smsm.c
+++ b/drivers/soc/qcom/smsm.c
@@ -5,6 +5,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -71,6 +72,7 @@ struct smsm_host;
  * @lock:  spinlock for read-modify-write of the outgoing state
  * @entries:   context for each of the entries
  * @hosts: context for each of the hosts
+ * @mbox_client: mailbox client handle
  */
 struct qcom_smsm {
struct device *dev;
@@ -88,6 +90,8 @@ struct qcom_smsm {
 
struct smsm_entry *entries;
struct smsm_host *hosts;
+
+   struct mbox_client mbox_client;
 };
 
 /**
@@ -120,11 +124,14 @@ struct smsm_entry {
  * @ipc_regmap:regmap for outgoing interrupt
  * @ipc_offset:offset in @ipc_regmap for outgoing interrupt
  * @ipc_bit:   bit in @ipc_regmap + @ipc_offset for outgoing interrupt
+ * @mbox_chan: apcs ipc mailbox channel handle
  */
 struct smsm_host {
struct regmap *ipc_regmap;
int ipc_offset;
int ipc_bit;
+
+   struct mbox_chan *mbox_chan;
 };
 
 /**
@@ -172,7 +179,13 @@ static int smsm_update_bits(void *data, u32 mask, u32 
value)
hostp = >hosts[host];
 
val = readl(smsm->subscription + host);
-   if (val & changes && hostp->ipc_regmap) {
+   if (!(val & changes))
+   continue;
+
+   if (hostp->mbox_chan) {
+   mbox_send_message(hostp->mbox_chan, NULL);
+   mbox_client_txdone(hostp->mbox_chan, 0);
+   } else if (hostp->ipc_regmap) {
regmap_write(hostp->ipc_regmap,
 hostp->ipc_offset,
 BIT(hostp->ipc_bit));
@@ -352,6 +365,28 @@ static const struct irq_domain_ops smsm_irq_ops = {
.xlate = irq_domain_xlate_twocell,
 };
 
+/**
+ * smsm_parse_mbox() - requests an mbox channel
+ * @smsm:  smsm driver context
+ * @host_id:   index of the remote host to be resolved
+ *
+ * Requests the desired channel using the mbox interface which is needed for
+ * sending the outgoing interrupts to a remove hosts - identified by @host_id.
+ */
+static int smsm_parse_mbox(struct qcom_smsm *smsm, unsigned int host_id)
+{
+   struct smsm_host *host = >hosts[host_id];
+   int ret = 0;
+
+   host->mbox_chan = mbox_request_channel(>mbox_client, host_id);
+   if (IS_ERR(host->mbox_chan)) {
+   ret = PTR_ERR(host->mbox_chan);
+   host->mbox_chan = NULL;
+   }
+
+   return ret;
+}
+
 /**
  * smsm_parse_ipc() - parses a qcom,ipc-%d device tree property
  * @smsm:  smsm driver context
@@ -521,8 +556,16 @@ static int qcom_smsm_probe(struct platform_device *pdev)
 "qcom,local-host",
 >local_host);
 
+   smsm->mbox_client.dev = >dev;
+   smsm->mbox_client.knows_txdone = true;
+
/* Parse the host properties */
for (id = 0; id < smsm->num_hosts; id++) {
+   /* Try using mbox interface first, otherwise fall back to 
syscon */
+   ret = smsm_parse_mbox(smsm, id);
+   if (!ret)
+   continue;
+
ret = smsm_parse_ipc(smsm, id);
if (ret < 0)
goto out_put;
@@ -609,6 +652,9 @@ static int qcom_smsm_probe(struct platform_device *pdev)
 
qcom_smem_state_unregister(smsm->state);
 out_put:
+   for (id = 0; id < smsm->num_hosts; id++)
+   mbox_free_channel(smsm->hosts[id].mbox_chan);
+
of_node_put(local_node);
return ret;
 }
@@ -622,6 +668,9 @@ static void qcom_smsm_remove(struct platform_device *pdev)
if (smsm->entries[id].domain)
irq_domain_remove(smsm->entries[id].domain);
 
+   for (id = 0; id < smsm->num_hosts; id++)
+   mbox_free_channel(smsm->hosts[id].mbox_chan);
+
qcom_smem_state_unregister(smsm->state);
 }
 

-- 
2.44.0




[PATCH RFC 0/2] Support mailbox interface in qcom,smsm driver

2024-04-24 Thread Luca Weiss
Take a shot at converting the last driver that requires direct
"qcom,ipc*" syscon references in devicetree by allowing the smsm driver
to use the mailbox interface to achieve the same effect.

I'm not very happy about how the devicetree change looks in the end.
Perhaps it's better to use mbox-names to not have <0> elements in dt,
and reference the items by name from the driver?

e.g. this change for msm8226 could be represented differently.

-   qcom,ipc-1 = < 8 13>;
-   qcom,ipc-2 = < 8 9>;
-   qcom,ipc-3 = < 8 19>;
+   mboxes = <0>, < 13>, < 9>, < 19>;

vs. for example:

-   qcom,ipc-1 = < 8 13>;
-   qcom,ipc-2 = < 8 9>;
-   qcom,ipc-3 = < 8 19>;
+   mboxes = < 13>, < 9>, < 19>;
+   mbox-names = "ipc-1", "ipc-2", "ipc-3";

But also here the name with 'ipc-N' is probably not particularly
fitting?

Please let me know your thoughts and any suggestions.

Signed-off-by: Luca Weiss 
---
Luca Weiss (2):
  dt-bindings: soc: qcom,smsm: Allow specifying mboxes instead of qcom,ipc
  soc: qcom: smsm: Support using mailbox interface

 .../devicetree/bindings/soc/qcom/qcom,smsm.yaml| 48 
 drivers/soc/qcom/smsm.c| 51 +-
 2 files changed, 90 insertions(+), 9 deletions(-)
---
base-commit: ed30a4a51bb196781c8058073ea720133a65596f
change-id: 20240424-smsm-mbox-0666f35eae44

Best regards,
-- 
Luca Weiss 




[PATCH RFC 1/2] dt-bindings: soc: qcom,smsm: Allow specifying mboxes instead of qcom,ipc

2024-04-24 Thread Luca Weiss
The qcom,ipc-N properties are essentially providing a reference to a
mailbox, so allow using the mboxes property to do the same in a more
structured way.

Since multiple SMSM hosts are supported, we need to be able to provide
the correct mailbox for each host. The old qcom,ipc-N properties map to
the mboxes property by index, starting at 0 since that's a valid SMSM
host also.

The new example shows how an smsm node with just qcom,ipc-3 should be
specified with the mboxes property.

Signed-off-by: Luca Weiss 
---
 .../devicetree/bindings/soc/qcom/qcom,smsm.yaml| 48 ++
 1 file changed, 40 insertions(+), 8 deletions(-)

diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,smsm.yaml 
b/Documentation/devicetree/bindings/soc/qcom/qcom,smsm.yaml
index db67cf043256..b12589171169 100644
--- a/Documentation/devicetree/bindings/soc/qcom/qcom,smsm.yaml
+++ b/Documentation/devicetree/bindings/soc/qcom/qcom,smsm.yaml
@@ -33,6 +33,13 @@ properties:
   specifier of the column in the subscription matrix representing the local
   processor.
 
+  mboxes:
+minItems: 1
+maxItems: 5
+description:
+  Reference to the mailbox representing the outgoing doorbell in APCS for
+  this client.
+
   '#size-cells':
 const: 0
 
@@ -98,15 +105,18 @@ required:
   - '#address-cells'
   - '#size-cells'
 
-anyOf:
+oneOf:
   - required:
-  - qcom,ipc-1
-  - required:
-  - qcom,ipc-2
-  - required:
-  - qcom,ipc-3
-  - required:
-  - qcom,ipc-4
+  - mboxes
+  - anyOf:
+  - required:
+  - qcom,ipc-1
+  - required:
+  - qcom,ipc-2
+  - required:
+  - qcom,ipc-3
+  - required:
+  - qcom,ipc-4
 
 additionalProperties: false
 
@@ -136,3 +146,25 @@ examples:
 #interrupt-cells = <2>;
 };
 };
+  # Example using mboxes property
+  - |
+#include 
+
+shared-memory {
+compatible = "qcom,smsm";
+#address-cells = <1>;
+#size-cells = <0>;
+mboxes = <0>, <0>, <0>, < 19>;
+
+apps@0 {
+reg = <0>;
+#qcom,smem-state-cells = <1>;
+};
+
+wcnss@7 {
+reg = <7>;
+interrupts = ;
+interrupt-controller;
+#interrupt-cells = <2>;
+};
+};

-- 
2.44.0




Re: [PATCH 0/7] Use mboxes instead of syscon for APCS (arm32 & arm64)

2024-04-24 Thread Luca Weiss
On Mittwoch, 24. April 2024 18:23:53 MESZ Luca Weiss wrote:
> The first patch is for removing a bogus error warning I've noticed while
> developing this on msm8226 - there the patches are also coming later for
> this SoC since apcs is getting hooked up to cpufreq there also.
> 
> Apart from usages from the qcom,smsm driver (patches coming!) all other
> usages of the apcs mailbox now go via the mailbox driver - where one is
> used, so some arm32 boards will continue using "qcom,ipc*" properties in
> the short or long term.
> 
> Only compile-tested apart from msm8953 (tested on sdm632-fairphone-fp3)
> and msm8974 (tested on msm8974pro-fairphone-fp2), but I don't expect any
> complications with this.

I think I forgot to mention this, but the msm8974 patch depends on
this series:
https://lore.kernel.org/linux-arm-msm/20240408-msm8974-apcs-v1-0-90cb73688...@z3ntu.xyz/

> 
> Signed-off-by: Luca Weiss 
> ---
> Luca Weiss (7):
>   rpmsg: qcom_smd: Don't print error during probe deferral
>   ARM: dts: qcom: msm8974: Use mboxes properties for APCS
>   arm64: dts: qcom: msm8916: Use mboxes properties for APCS
>   arm64: dts: qcom: msm8939: Use mboxes properties for APCS
>   arm64: dts: qcom: msm8953: Use mboxes properties for APCS
>   arm64: dts: qcom: msm8976: Use mboxes properties for APCS
>   arm64: dts: qcom: msm8994: Use mboxes properties for APCS
> 
>  arch/arm/boot/dts/qcom/qcom-msm8974.dtsi | 14 +++---
>  arch/arm64/boot/dts/qcom/msm8916.dtsi| 10 +-
>  arch/arm64/boot/dts/qcom/msm8939.dtsi|  4 ++--
>  arch/arm64/boot/dts/qcom/msm8953.dtsi| 10 +-
>  arch/arm64/boot/dts/qcom/msm8976.dtsi|  8 
>  arch/arm64/boot/dts/qcom/msm8994.dtsi|  6 +++---
>  drivers/rpmsg/qcom_smd.c |  3 ++-
>  7 files changed, 28 insertions(+), 27 deletions(-)
> ---
> base-commit: 43173e6dbaa227f3107310d4df4a3bacd5e0df33
> change-id: 20240423-apcs-mboxes-12ee6c01a5b3
> 
> Best regards,
> 







[PATCH 2/7] ARM: dts: qcom: msm8974: Use mboxes properties for APCS

2024-04-24 Thread Luca Weiss
Instead of passing the syscon to the various nodes, use the mbox
interface using the mboxes property.

Signed-off-by: Luca Weiss 
---
 arch/arm/boot/dts/qcom/qcom-msm8974.dtsi | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi 
b/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
index 20958c47ff3a..0f1dc4355c7a 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
+++ b/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
@@ -130,7 +130,7 @@ master-stats {
 
smd-edge {
interrupts = ;
-   qcom,ipc = < 8 0>;
+   mboxes = < 0>;
qcom,smd-edge = <15>;
 
rpm_requests: rpm-requests {
@@ -217,7 +217,7 @@ smp2p-adsp {
interrupt-parent = <>;
interrupts = ;
 
-   qcom,ipc = < 8 10>;
+   mboxes = < 10>;
 
qcom,local-pid = <0>;
qcom,remote-pid = <2>;
@@ -242,7 +242,7 @@ smp2p-modem {
interrupt-parent = <>;
interrupts = ;
 
-   qcom,ipc = < 8 14>;
+   mboxes = < 14>;
 
qcom,local-pid = <0>;
qcom,remote-pid = <1>;
@@ -267,7 +267,7 @@ smp2p-wcnss {
interrupt-parent = <>;
interrupts = ;
 
-   qcom,ipc = < 8 18>;
+   mboxes = < 18>;
 
qcom,local-pid = <0>;
qcom,remote-pid = <4>;
@@ -757,7 +757,7 @@ iris {
smd-edge {
interrupts = ;
 
-   qcom,ipc = < 8 17>;
+   mboxes = < 17>;
qcom,smd-edge = <6>;
 
wcnss {
@@ -1576,7 +1576,7 @@ bam_dmux: bam-dmux {
smd-edge {
interrupts = ;
 
-   qcom,ipc = < 8 12>;
+   mboxes = < 12>;
qcom,smd-edge = <0>;
 
label = "modem";
@@ -2213,7 +2213,7 @@ remoteproc_adsp: remoteproc@fe20 {
smd-edge {
interrupts = ;
 
-   qcom,ipc = < 8 8>;
+   mboxes = < 8>;
qcom,smd-edge = <1>;
label = "lpass";
};

-- 
2.44.0




[PATCH 0/7] Use mboxes instead of syscon for APCS (arm32 & arm64)

2024-04-24 Thread Luca Weiss
The first patch is for removing a bogus error warning I've noticed while
developing this on msm8226 - there the patches are also coming later for
this SoC since apcs is getting hooked up to cpufreq there also.

Apart from usages from the qcom,smsm driver (patches coming!) all other
usages of the apcs mailbox now go via the mailbox driver - where one is
used, so some arm32 boards will continue using "qcom,ipc*" properties in
the short or long term.

Only compile-tested apart from msm8953 (tested on sdm632-fairphone-fp3)
and msm8974 (tested on msm8974pro-fairphone-fp2), but I don't expect any
complications with this.

Signed-off-by: Luca Weiss 
---
Luca Weiss (7):
  rpmsg: qcom_smd: Don't print error during probe deferral
  ARM: dts: qcom: msm8974: Use mboxes properties for APCS
  arm64: dts: qcom: msm8916: Use mboxes properties for APCS
  arm64: dts: qcom: msm8939: Use mboxes properties for APCS
  arm64: dts: qcom: msm8953: Use mboxes properties for APCS
  arm64: dts: qcom: msm8976: Use mboxes properties for APCS
  arm64: dts: qcom: msm8994: Use mboxes properties for APCS

 arch/arm/boot/dts/qcom/qcom-msm8974.dtsi | 14 +++---
 arch/arm64/boot/dts/qcom/msm8916.dtsi| 10 +-
 arch/arm64/boot/dts/qcom/msm8939.dtsi|  4 ++--
 arch/arm64/boot/dts/qcom/msm8953.dtsi| 10 +-
 arch/arm64/boot/dts/qcom/msm8976.dtsi|  8 
 arch/arm64/boot/dts/qcom/msm8994.dtsi|  6 +++---
 drivers/rpmsg/qcom_smd.c |  3 ++-
 7 files changed, 28 insertions(+), 27 deletions(-)
---
base-commit: 43173e6dbaa227f3107310d4df4a3bacd5e0df33
change-id: 20240423-apcs-mboxes-12ee6c01a5b3

Best regards,
-- 
Luca Weiss 




[PATCH 1/7] rpmsg: qcom_smd: Don't print error during probe deferral

2024-04-24 Thread Luca Weiss
When the mailbox driver has not probed yet, skip printing the error
message since it's just going to confuse users.

Signed-off-by: Luca Weiss 
---
 drivers/rpmsg/qcom_smd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c
index 43f601c84b4f..6fc299657adf 100644
--- a/drivers/rpmsg/qcom_smd.c
+++ b/drivers/rpmsg/qcom_smd.c
@@ -1502,7 +1502,8 @@ struct qcom_smd_edge *qcom_smd_register_edge(struct 
device *parent,
 
ret = qcom_smd_parse_edge(>dev, node, edge);
if (ret) {
-   dev_err(>dev, "failed to parse smd edge\n");
+   if (ret != -EPROBE_DEFER)
+   dev_err(>dev, "failed to parse smd edge\n");
goto unregister_dev;
}
 

-- 
2.44.0




[PATCH 4/7] arm64: dts: qcom: msm8939: Use mboxes properties for APCS

2024-04-24 Thread Luca Weiss
Instead of passing the syscon to the various nodes, use the mbox
interface using the mboxes property.

Signed-off-by: Luca Weiss 
---
 arch/arm64/boot/dts/qcom/msm8939.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/msm8939.dtsi 
b/arch/arm64/boot/dts/qcom/msm8939.dtsi
index dd45975682b2..95487de2ca6a 100644
--- a/arch/arm64/boot/dts/qcom/msm8939.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8939.dtsi
@@ -248,7 +248,7 @@ rpm: remoteproc {
 
smd-edge {
interrupts = ;
-   qcom,ipc = <_mbox 8 0>;
+   mboxes = <_mbox 0>;
qcom,smd-edge = <15>;
 
rpm_requests: rpm-requests {
@@ -2067,7 +2067,7 @@ wcnss_iris: iris {
 
smd-edge {
interrupts = ;
-   qcom,ipc = <_mbox 8 17>;
+   mboxes = <_mbox 17>;
qcom,smd-edge = <6>;
qcom,remote-pid = <4>;
 

-- 
2.44.0




[PATCH 3/7] arm64: dts: qcom: msm8916: Use mboxes properties for APCS

2024-04-24 Thread Luca Weiss
Instead of passing the syscon to the various nodes, use the mbox
interface using the mboxes property.

Signed-off-by: Luca Weiss 
---
 arch/arm64/boot/dts/qcom/msm8916.dtsi | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi 
b/arch/arm64/boot/dts/qcom/msm8916.dtsi
index cedff4166bfb..46bb322ae133 100644
--- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
@@ -308,7 +308,7 @@ rpm: remoteproc {
 
smd-edge {
interrupts = ;
-   qcom,ipc = < 8 0>;
+   mboxes = < 0>;
qcom,smd-edge = <15>;
 
rpm_requests: rpm-requests {
@@ -360,7 +360,7 @@ smp2p-hexagon {
 
interrupts = ;
 
-   qcom,ipc = < 8 14>;
+   mboxes = < 14>;
 
qcom,local-pid = <0>;
qcom,remote-pid = <1>;
@@ -385,7 +385,7 @@ smp2p-wcnss {
 
interrupts = ;
 
-   qcom,ipc = < 8 18>;
+   mboxes = < 18>;
 
qcom,local-pid = <0>;
qcom,remote-pid = <4>;
@@ -1978,7 +1978,7 @@ smd-edge {
interrupts = ;
 
qcom,smd-edge = <0>;
-   qcom,ipc = < 8 12>;
+   mboxes = < 12>;
qcom,remote-pid = <1>;
 
label = "hexagon";
@@ -2459,7 +2459,7 @@ wcnss_iris: iris {
smd-edge {
interrupts = ;
 
-   qcom,ipc = < 8 17>;
+   mboxes = < 17>;
qcom,smd-edge = <6>;
qcom,remote-pid = <4>;
 

-- 
2.44.0




[PATCH 5/7] arm64: dts: qcom: msm8953: Use mboxes properties for APCS

2024-04-24 Thread Luca Weiss
Instead of passing the syscon to the various nodes, use the mbox
interface using the mboxes property.

Signed-off-by: Luca Weiss 
---
 arch/arm64/boot/dts/qcom/msm8953.dtsi | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/msm8953.dtsi 
b/arch/arm64/boot/dts/qcom/msm8953.dtsi
index f1011bb641c6..650ad75923f8 100644
--- a/arch/arm64/boot/dts/qcom/msm8953.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8953.dtsi
@@ -195,7 +195,7 @@ rpm: remoteproc {
 
smd-edge {
interrupts = ;
-   qcom,ipc = < 8 0>;
+   mboxes = < 0>;
qcom,smd-edge = <15>;
 
rpm_requests: rpm-requests {
@@ -361,7 +361,7 @@ smp2p-modem {
 
interrupts = ;
 
-   qcom,ipc = < 8 14>;
+   mboxes = < 14>;
 
qcom,local-pid = <0>;
qcom,remote-pid = <1>;
@@ -386,7 +386,7 @@ smp2p-wcnss {
 
interrupts = ;
 
-   qcom,ipc = < 8 18>;
+   mboxes = < 18>;
 
qcom,local-pid = <0>;
qcom,remote-pid = <4>;
@@ -1267,7 +1267,7 @@ smd-edge {
interrupts = ;
 
qcom,smd-edge = <0>;
-   qcom,ipc = < 8 12>;
+   mboxes = < 12>;
qcom,remote-pid = <1>;
 
label = "modem";
@@ -1734,7 +1734,7 @@ wcnss_iris: iris {
smd-edge {
interrupts = ;
 
-   qcom,ipc = < 8 17>;
+   mboxes = < 17>;
qcom,smd-edge = <6>;
qcom,remote-pid = <4>;
 

-- 
2.44.0




[PATCH 7/7] arm64: dts: qcom: msm8994: Use mboxes properties for APCS

2024-04-24 Thread Luca Weiss
Instead of passing the syscon to the various nodes, use the mbox
interface using the mboxes property.

Signed-off-by: Luca Weiss 
---
 arch/arm64/boot/dts/qcom/msm8994.dtsi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/msm8994.dtsi 
b/arch/arm64/boot/dts/qcom/msm8994.dtsi
index 695e541832ad..9949d2cd23d8 100644
--- a/arch/arm64/boot/dts/qcom/msm8994.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8994.dtsi
@@ -183,7 +183,7 @@ rpm: remoteproc {
 
smd-edge {
interrupts = ;
-   qcom,ipc = < 8 0>;
+   mboxes = < 0>;
qcom,smd-edge = <15>;
qcom,remote-pid = <6>;
 
@@ -300,7 +300,7 @@ smp2p-lpass {
 
interrupts = ;
 
-   qcom,ipc = < 8 10>;
+   mboxes = < 10>;
 
qcom,local-pid = <0>;
qcom,remote-pid = <2>;
@@ -325,7 +325,7 @@ smp2p-modem {
interrupt-parent = <>;
interrupts = ;
 
-   qcom,ipc = < 8 14>;
+   mboxes = < 14>;
 
qcom,local-pid = <0>;
qcom,remote-pid = <1>;

-- 
2.44.0




[PATCH 6/7] arm64: dts: qcom: msm8976: Use mboxes properties for APCS

2024-04-24 Thread Luca Weiss
Instead of passing the syscon to the various nodes, use the mbox
interface using the mboxes property.

Signed-off-by: Luca Weiss 
---
 arch/arm64/boot/dts/qcom/msm8976.dtsi | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/msm8976.dtsi 
b/arch/arm64/boot/dts/qcom/msm8976.dtsi
index d2bb1ada361a..9ca0867e45ba 100644
--- a/arch/arm64/boot/dts/qcom/msm8976.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8976.dtsi
@@ -237,7 +237,7 @@ rpm: remoteproc {
 
smd-edge {
interrupts = ;
-   qcom,ipc = < 8 0>;
+   mboxes = < 0>;
qcom,smd-edge = <15>;
 
rpm_requests: rpm-requests {
@@ -361,7 +361,7 @@ tz-apps@8dd0 {
smp2p-hexagon {
compatible = "qcom,smp2p";
interrupts = ;
-   qcom,ipc = < 8 10>;
+   mboxes = < 10>;
 
qcom,local-pid = <0>;
qcom,remote-pid = <2>;
@@ -384,7 +384,7 @@ adsp_smp2p_in: slave-kernel {
smp2p-modem {
compatible = "qcom,smp2p";
interrupts = ;
-   qcom,ipc = < 8 14>;
+   mboxes = < 14>;
 
qcom,local-pid = <0>;
qcom,remote-pid = <1>;
@@ -407,7 +407,7 @@ modem_smp2p_in: slave-kernel {
smp2p-wcnss {
compatible = "qcom,smp2p";
interrupts = ;
-   qcom,ipc = < 8 18>;
+   mboxes = < 18>;
 
qcom,local-pid = <0>;
qcom,remote-pid = <4>;

-- 
2.44.0




Re: [PATCH 1/2] arm64: dts: qcom: pmi632: Add vibrator

2024-04-18 Thread Luca Weiss
On Thu Apr 18, 2024 at 12:01 PM CEST, Konrad Dybcio wrote:
> On 18.04.2024 8:36 AM, Luca Weiss wrote:
> > Add a node for the vibrator module found inside the PMI632.
> > 
> > Signed-off-by: Luca Weiss 
> > ---
>
> Reviewed-by: Konrad Dybcio 
>
> On a side note, this is a totally configuration-free peripheral that doesn't 
> do
> anything crazy until manually configured.
>
> In the slow quest to be (hopefully) more sane about the defaults, should we 
> keep
> them enabled by default? Bjorn?

But many (most?) devices don't have a vibration motor connected to
PMI632, some (like devboards) don't have anything, and other phones have
a separate chip that controls the vibration motor.

Enabling this by default would mean all devices with PMI632 would get an
input device for the vibrator that probably doesn't work?

Regards
Luca

>
> Konrad




[PATCH 2/2] arm64: dts: qcom: sdm632-fairphone-fp3: Enable vibrator

2024-04-18 Thread Luca Weiss
Enable the vibrator on the PMI632 which is used on this phone.

Signed-off-by: Luca Weiss 
---
 arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts 
b/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts
index e2708c74e95a..2c1172aa97e4 100644
--- a/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts
+++ b/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts
@@ -143,6 +143,10 @@ _vbus {
status = "okay";
 };
 
+_vib {
+   status = "okay";
+};
+
 _1 {
status = "okay";
vmmc-supply = <_l8>;

-- 
2.44.0




[PATCH 1/2] arm64: dts: qcom: pmi632: Add vibrator

2024-04-18 Thread Luca Weiss
Add a node for the vibrator module found inside the PMI632.

Signed-off-by: Luca Weiss 
---
 arch/arm64/boot/dts/qcom/pmi632.dtsi | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/pmi632.dtsi 
b/arch/arm64/boot/dts/qcom/pmi632.dtsi
index 94d53b1cf6c8..b4313728f3e7 100644
--- a/arch/arm64/boot/dts/qcom/pmi632.dtsi
+++ b/arch/arm64/boot/dts/qcom/pmi632.dtsi
@@ -200,5 +200,11 @@ pmi632_lpg: pwm {
 
status = "disabled";
};
+
+   pmi632_vib: vibrator@5700 {
+   compatible = "qcom,pmi632-vib";
+   reg = <0x5700>;
+   status = "disabled";
+   };
};
 };

-- 
2.44.0




[PATCH 0/2] Enable vibrator on PMI632 + Fairphone 3

2024-04-18 Thread Luca Weiss
With the patches to add vibration support for PMI632 finally applied,
let's enable this for the PMI632 PMIC and Fairphone 3 smartphone.

https://lore.kernel.org/linux-arm-msm/20240416-pm8xxx-vibrator-new-design-v11-0-7b1c951e1...@quicinc.com/

Patches have landed in the input tree:
https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git/

Signed-off-by: Luca Weiss 
---
Luca Weiss (2):
  arm64: dts: qcom: pmi632: Add vibrator
  arm64: dts: qcom: sdm632-fairphone-fp3: Enable vibrator

 arch/arm64/boot/dts/qcom/pmi632.dtsi  | 6 ++
 arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts | 4 
 2 files changed, 10 insertions(+)
---
base-commit: eecc5d90861b551d3b8fbd0d0e6f25c40496f3c0
change-id: 20240418-fp3-vibra-18c400889853

Best regards,
-- 
Luca Weiss 




Re: [PATCH] Bluetooth: Add more Bluetooth version defines

2024-04-12 Thread Luca Weiss
On Fri Feb 16, 2024 at 2:22 PM CET, Luca Weiss wrote:
> Add the various Bluetooth version identifiers found in the "Assigned
> Numbers" document[0] from the Bluetooth SIG.
>
> [0] https://www.bluetooth.com/specifications/assigned-numbers/

Hi all,

Is there any interest in this patch? Would be nice to get at least a
positive or negative reaction to it.

Regards
Luca

>
> Signed-off-by: Luca Weiss 
> ---
> To be clear, I don't have a use case for these extra defines myself but
> some time ago when working on Bluetooth I came across this and thought
> it would be interesting to have the list complete. No other motives.
> ---
>  include/net/bluetooth/bluetooth.h | 9 +
>  1 file changed, 9 insertions(+)
>
> diff --git a/include/net/bluetooth/bluetooth.h 
> b/include/net/bluetooth/bluetooth.h
> index 7ffa8c192c3f..818eb142eda3 100644
> --- a/include/net/bluetooth/bluetooth.h
> +++ b/include/net/bluetooth/bluetooth.h
> @@ -39,11 +39,20 @@
>  #endif
>  
>  /* Bluetooth versions */
> +#define BLUETOOTH_VER_1_0B   0
>  #define BLUETOOTH_VER_1_11
>  #define BLUETOOTH_VER_1_22
>  #define BLUETOOTH_VER_2_03
>  #define BLUETOOTH_VER_2_14
> +#define BLUETOOTH_VER_3_05
>  #define BLUETOOTH_VER_4_06
> +#define BLUETOOTH_VER_4_17
> +#define BLUETOOTH_VER_4_28
> +#define BLUETOOTH_VER_5_09
> +#define BLUETOOTH_VER_5_110
> +#define BLUETOOTH_VER_5_211
> +#define BLUETOOTH_VER_5_312
> +#define BLUETOOTH_VER_5_413
>  
>  /* Reserv for core and drivers use */
>  #define BT_SKB_RESERVE   8
>
> ---
> base-commit: 841c35169323cd833294798e58b9bf63fa4fa1de
> change-id: 20240216-bluetooth-defines-b810ce543191
>
> Best regards,




[PATCH v2] dt-bindings: mfd: qcom,spmi-pmic: Add pbs to SPMI device types

2024-04-12 Thread Luca Weiss
Add the PBS (Programmable Boot Sequencer) to the list of devices.

Reviewed-by: Bjorn Andersson 
Signed-off-by: Luca Weiss 
---
Changes in v2:
- Pick up tags
- Rebase on linux-next, drop merged patches
- Link to v1: 
https://lore.kernel.org/r/20240205-pmi632-ppg-v1-0-e236c95a2...@fairphone.com
---
 Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml | 4 
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml 
b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
index 8103fb61a16c..b7f01cbb8fff 100644
--- a/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
+++ b/Documentation/devicetree/bindings/mfd/qcom,spmi-pmic.yaml
@@ -160,6 +160,10 @@ patternProperties:
 type: object
 $ref: /schemas/nvmem/qcom,spmi-sdam.yaml#
 
+  "^pbs@[0-9a-f]+$":
+type: object
+$ref: /schemas/soc/qcom/qcom,pbs.yaml#
+
   "phy@[0-9a-f]+$":
 type: object
 $ref: /schemas/phy/qcom,snps-eusb2-repeater.yaml#

---
base-commit: fa8c2b5f446d6e8ff4bc8f67ba944b1be3aad790
change-id: 20240117-pmi632-ppg-f1efb4318722

Best regards,
-- 
Luca Weiss 




[PATCH v2] media: dt-bindings: qcom,sc7280-venus: Allow one IOMMU entry

2024-04-12 Thread Luca Weiss
Some SC7280-based boards crash when providing the "secure_non_pixel"
context bank, so allow only one iommu in the bindings also.

Acked-by: Krzysztof Kozlowski 
Signed-off-by: Luca Weiss 
---
Reference:
https://lore.kernel.org/linux-arm-msm/20231201-sc7280-venus-pas-v3-2-bc132dc5f...@fairphone.com/
---
Changes in v2:
- Pick up tags
- Otherwise just a resend, v1 was sent in January
- Link to v1: 
https://lore.kernel.org/r/20240129-sc7280-venus-bindings-v1-1-20a9ba194...@fairphone.com
---
 Documentation/devicetree/bindings/media/qcom,sc7280-venus.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/media/qcom,sc7280-venus.yaml 
b/Documentation/devicetree/bindings/media/qcom,sc7280-venus.yaml
index 8f9b6433aeb8..10c334e6b3dc 100644
--- a/Documentation/devicetree/bindings/media/qcom,sc7280-venus.yaml
+++ b/Documentation/devicetree/bindings/media/qcom,sc7280-venus.yaml
@@ -43,6 +43,7 @@ properties:
   - const: vcodec_bus
 
   iommus:
+minItems: 1
 maxItems: 2
 
   interconnects:

---
base-commit: 9ed46da14b9b9b2ad4edb3b0c545b6dbe5c00d39
change-id: 20240129-sc7280-venus-bindings-6e62a99620de

Best regards,
-- 
Luca Weiss 




[PATCH] arm64: dts: qcom: qcm6490-fairphone-fp5: Add USB-C orientation GPIO

2024-04-11 Thread Luca Weiss
Define the USB-C orientation GPIOs so that the USB-C ports orientation
is known without having to resort to the altmode notifications.

On PCB level this is the signal from PM7250B (pin CC_OUT) which is
called USB_PHY_PS.

Signed-off-by: Luca Weiss 
---
Depends on (for bindings): 
https://lore.kernel.org/linux-arm-msm/20240409-hdk-orientation-gpios-v2-0-658efd993...@linaro.org/
---
 arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts 
b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
index 4ff9fc24e50e..f3432701945f 100644
--- a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
+++ b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
@@ -77,6 +77,8 @@ pmic-glink {
#address-cells = <1>;
#size-cells = <0>;
 
+   orientation-gpios = < 140 GPIO_ACTIVE_HIGH>;
+
connector@0 {
compatible = "usb-c-connector";
reg = <0>;

---
base-commit: 65b0418f6e86eef0f62fc053fb3622fbaa3e506e
change-id: 20240411-fp5-usb-c-gpio-afd22741adcd

Best regards,
-- 
Luca Weiss 




[PATCH v2 2/2] ARM: dts: qcom: msm8974-hammerhead: Update gpio hog node name

2024-04-09 Thread Luca Weiss
Follow the gpio-hog bindings and use otg-hog as node name.

Signed-off-by: Luca Weiss 
---
 arch/arm/boot/dts/qcom/qcom-msm8974-lge-nexus5-hammerhead.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/qcom/qcom-msm8974-lge-nexus5-hammerhead.dts 
b/arch/arm/boot/dts/qcom/qcom-msm8974-lge-nexus5-hammerhead.dts
index 4aaae8537a3f..06549051be50 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8974-lge-nexus5-hammerhead.dts
+++ b/arch/arm/boot/dts/qcom/qcom-msm8974-lge-nexus5-hammerhead.dts
@@ -328,7 +328,7 @@ wlan_regulator_pin: wl-reg-active-state {
power-source = ;
};
 
-   otg {
+   otg-hog {
gpio-hog;
gpios = <35 GPIO_ACTIVE_HIGH>;
output-high;

-- 
2.44.0




[PATCH v2 1/2] dt-bindings: pinctrl: qcom,pmic-gpio: Allow gpio-hog nodes

2024-04-09 Thread Luca Weiss
Allow specifying a GPIO hog, as already used on
qcom-msm8974-lge-nexus5-hammerhead.dts.

Signed-off-by: Luca Weiss 
---
 .../devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml  | 12 
 1 file changed, 12 insertions(+)

diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml 
b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
index a786357ed1af..bd9471de0c69 100644
--- a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
@@ -424,6 +424,10 @@ patternProperties:
 $ref: "#/$defs/qcom-pmic-gpio-state"
 additionalProperties: false
 
+  "-hog(-[0-9]+)?$":
+required:
+  - gpio-hog
+
 $defs:
   qcom-pmic-gpio-state:
 type: object
@@ -571,6 +575,7 @@ $defs:
 
 examples:
   - |
+#include 
 #include 
 
 pm8921_gpio: gpio@150 {
@@ -594,5 +599,12 @@ examples:
   power-source = ;
 };
   };
+
+  otg-hog {
+gpio-hog;
+gpios = <35 GPIO_ACTIVE_HIGH>;
+output-high;
+line-name = "otg-gpio";
+  };
 };
 ...

-- 
2.44.0




[PATCH v2 0/2] Allow gpio-hog nodes in qcom,pmic-gpio bindings (& dt fixup)

2024-04-09 Thread Luca Weiss
Resolve the dt validation failure on Nexus 5.

Signed-off-by: Luca Weiss 
---
Changes in v2:
- Use simpler regex from tlmm bindings (Krzysztof)
- Link to v1: 
https://lore.kernel.org/r/20240408-qcom-pmic-gpio-hog-v1-0-f61fc5323...@z3ntu.xyz

---
Luca Weiss (2):
  dt-bindings: pinctrl: qcom,pmic-gpio: Allow gpio-hog nodes
  ARM: dts: qcom: msm8974-hammerhead: Update gpio hog node name

 .../devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml  | 12 
 .../arm/boot/dts/qcom/qcom-msm8974-lge-nexus5-hammerhead.dts |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
---
base-commit: 8568bb2ccc278f344e6ac44af6ed010a90aa88dc
change-id: 20240408-qcom-pmic-gpio-hog-2b4c5f103126

Best regards,
-- 
Luca Weiss 




Re: [PATCH 0/3] Fix up qcom,halt-regs definition in various schemas

2024-04-09 Thread Luca Weiss
On Dienstag, 9. April 2024 17:10:41 CEST Rob Herring wrote:
> On Sun, Apr 07, 2024 at 11:58:29AM +0200, Luca Weiss wrote:
> > The original motivation is that a bunch of other schemas fail to
> > validate qcom,halt-regs, for example like in the following examples:
> > 
> > arch/arm64/boot/dts/qcom/apq8016-sbc.dtb: remoteproc@408: 
> > qcom,halt-regs:0: [20] is too short
> > from schema $id: 
> > http://devicetree.org/schemas/remoteproc/qcom,msm8916-mss-pil.yaml#
> > arch/arm64/boot/dts/qcom/apq8096-ifc6640.dtb: remoteproc@208: 
> > qcom,halt-regs:0: [82] is too short
> > from schema $id: 
> > http://devicetree.org/schemas/remoteproc/qcom,msm8996-mss-pil.yaml#
> > arch/arm64/boot/dts/qcom/apq8039-t2.dtb: remoteproc@408: 
> > qcom,halt-regs:0: [32] is too short
> > from schema $id: 
> > http://devicetree.org/schemas/remoteproc/qcom,msm8916-mss-pil.yaml#
> > 
> > While I'm actually not quite sure why these patches fix this in
> > the other schemas - feels like a bug/limitation in dt-schema maybe? -
> 
> Was this with v2024.02? It should be a bit better there. Though it 
> may just have different errors. The limitation is that property 
> types and in the case of matrix's (which phandle-array actually is) 
> range for dimensions are global. So if there's not correct dimensions 
> for a property, the tools aren't going to decode it properly.

You're right, I doesn't look like I can reproduce this with the latest
dtschema installed.

Anyways these patches should be good to actually validate qcom,halt-regs for
the schemas I'm touching here.

Regards
Luca

> 
> Rob
> 







[PATCH 2/2] ARM: dts: qcom: msm8974: Use proper compatible for APCS syscon

2024-04-08 Thread Luca Weiss
Use the apcs-kpss-global compatible for the APCS global mailbox block
found on this SoC.

This also resolves a dt-binding checker warning:

  arch/arm/boot/dts/qcom/qcom-msm8974pro-fairphone-fp2.dtb: syscon@f9011000: 
compatible: 'anyOf' conditional failed, one must be fixed:
  ['syscon'] is too short
  'syscon' is not one of ['allwinner,sun8i-a83t-system-controller', 
'allwinner,sun8i-h3-system-controller', 
'allwinner,sun8i-v3s-system-controller', 
'allwinner,sun50i-a64-system-controller', 'amd,pensando-elba-syscon', 
'brcm,cru-clkset', 'freecom,fsg-cs2-system-controller', 
'fsl,imx93-aonmix-ns-syscfg', 'fsl,imx93-wakeupmix-syscfg', 
'hisilicon,dsa-subctrl', 'hisilicon,hi6220-sramctrl', 
'hisilicon,pcie-sas-subctrl', 'hisilicon,peri-subctrl', 'hpe,gxp-sysreg', 
'intel,lgm-syscon', 'loongson,ls1b-syscon', 'loongson,ls1c-syscon', 
'marvell,armada-3700-usb2-host-misc', 'mediatek,mt8135-pctl-a-syscfg', 
'mediatek,mt8135-pctl-b-syscfg', 'mediatek,mt8365-syscfg', 
'microchip,lan966x-cpu-syscon', 'microchip,sparx5-cpu-syscon', 
'mstar,msc313-pmsleep', 'nuvoton,ma35d1-sys', 'nuvoton,wpcm450-shm', 
'rockchip,px30-qos', 'rockchip,rk3036-qos', 'rockchip,rk3066-qos', 
'rockchip,rk3128-qos', 'rockchip,rk3228-qos', 'rockchip,rk3288-qos', 
'rockchip,rk3368-qos', 'rockchip,rk3399-qos', 'rockchip,rk356
 8-qos', 'rockchip,rk3588-qos', 'rockchip,rv1126-qos', 
'starfive,jh7100-sysmain', 'ti,am62-usb-phy-ctrl', 'ti,am654-dss-oldi-io-ctrl', 
'ti,am654-serdes-ctrl', 'ti,j784s4-pcie-ctrl']
  from schema $id: http://devicetree.org/schemas/mfd/syscon.yaml#

Signed-off-by: Luca Weiss 
---
 arch/arm/boot/dts/qcom/qcom-msm8974.dtsi | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi 
b/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
index 233d9bf42298..7e0224006b1f 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
+++ b/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
@@ -341,9 +341,11 @@ intc: interrupt-controller@f900 {
  <0xf9002000 0x1000>;
};
 
-   apcs: syscon@f9011000 {
-   compatible = "syscon";
+   apcs: mailbox@f9011000 {
+   compatible = "qcom,msm8974-apcs-kpss-global",
+"qcom,msm8994-apcs-kpss-global", "syscon";
reg = <0xf9011000 0x1000>;
+   #mbox-cells = <1>;
};
 
saw_l2: power-manager@f9012000 {

-- 
2.44.0




[PATCH 1/2] dt-bindings: mailbox: qcom: Add MSM8974 APCS compatible

2024-04-08 Thread Luca Weiss
Add compatible for the Qualcomm MSM8974 APCS block.

Signed-off-by: Luca Weiss 
---
 Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml 
b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
index 79eb523b8436..982c741e6225 100644
--- a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
+++ b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
@@ -30,6 +30,7 @@ properties:
   - const: syscon
   - items:
   - enum:
+  - qcom,msm8974-apcs-kpss-global
   - qcom,msm8976-apcs-kpss-global
   - const: qcom,msm8994-apcs-kpss-global
   - const: syscon

-- 
2.44.0




[PATCH 0/2] Fix msm8974 apcs syscon compatible

2024-04-08 Thread Luca Weiss
Finally fix a warning about the apcs-global syscon used on msm8974 that
has been around forever.

Signed-off-by: Luca Weiss 
---
Luca Weiss (2):
  dt-bindings: mailbox: qcom: Add MSM8974 APCS compatible
  ARM: dts: qcom: msm8974: Use proper compatible for APCS syscon

 .../devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml  | 1 +
 arch/arm/boot/dts/qcom/qcom-msm8974.dtsi| 6 --
 2 files changed, 5 insertions(+), 2 deletions(-)
---
base-commit: 8568bb2ccc278f344e6ac44af6ed010a90aa88dc
change-id: 20240408-msm8974-apcs-b7765f6bab99

Best regards,
-- 
Luca Weiss 




Re: [PATCH 1/2] dt-bindings: pinctrl: qcom,pmic-gpio: Allow gpio-hog nodes

2024-04-08 Thread Luca Weiss
On Montag, 8. April 2024 19:26:49 CEST Konrad Dybcio wrote:
> 
> On 4/8/24 18:39, Luca Weiss wrote:
> > Allow specifying a GPIO hog, as already used on
> > qcom-msm8974-lge-nexus5-hammerhead.dts.
> > 
> > Signed-off-by: Luca Weiss 
> > ---
> >   .../devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml  | 12 
> > 
> >   1 file changed, 12 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml 
> > b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
> > index a786357ed1af..510a05369dbb 100644
> > --- a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
> > +++ b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
> > @@ -424,6 +424,10 @@ patternProperties:
> >   $ref: "#/$defs/qcom-pmic-gpio-state"
> >   additionalProperties: false
> >   
> > +  "^(hog-[0-9]+|.+-hog(-[0-9]+)?)$":
> 
> I see a couple bindings do this, but I'm not sure if we want two
> allow two styles for no reason.. Rob?

This regex is actually from the gpio-hog.yaml base
https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/gpio/gpio-hog.yaml#L23

Why it's made this way I cannot tell you, but I didn't want to 'artifically'
restrict the pattern for qcom,pmic-gpio.

> 
> Konrad
> 







[PATCH 2/2] ARM: dts: qcom: msm8974-hammerhead: Update gpio hog node name

2024-04-08 Thread Luca Weiss
Follow the gpio-hog bindings and use otg-hog as node name.

Signed-off-by: Luca Weiss 
---
 arch/arm/boot/dts/qcom/qcom-msm8974-lge-nexus5-hammerhead.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/qcom/qcom-msm8974-lge-nexus5-hammerhead.dts 
b/arch/arm/boot/dts/qcom/qcom-msm8974-lge-nexus5-hammerhead.dts
index 4aaae8537a3f..06549051be50 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8974-lge-nexus5-hammerhead.dts
+++ b/arch/arm/boot/dts/qcom/qcom-msm8974-lge-nexus5-hammerhead.dts
@@ -328,7 +328,7 @@ wlan_regulator_pin: wl-reg-active-state {
power-source = ;
};
 
-   otg {
+   otg-hog {
gpio-hog;
gpios = <35 GPIO_ACTIVE_HIGH>;
output-high;

-- 
2.44.0




[PATCH 0/2] Allow gpio-hog nodes in qcom,pmic-gpio bindings (& dt fixup)

2024-04-08 Thread Luca Weiss
Resolve the dt validation failure on Nexus 5.

Signed-off-by: Luca Weiss 
---
Luca Weiss (2):
  dt-bindings: pinctrl: qcom,pmic-gpio: Allow gpio-hog nodes
  ARM: dts: qcom: msm8974-hammerhead: Update gpio hog node name

 .../devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml  | 12 
 .../arm/boot/dts/qcom/qcom-msm8974-lge-nexus5-hammerhead.dts |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
---
base-commit: 8568bb2ccc278f344e6ac44af6ed010a90aa88dc
change-id: 20240408-qcom-pmic-gpio-hog-2b4c5f103126

Best regards,
-- 
Luca Weiss 




[PATCH 1/2] dt-bindings: pinctrl: qcom,pmic-gpio: Allow gpio-hog nodes

2024-04-08 Thread Luca Weiss
Allow specifying a GPIO hog, as already used on
qcom-msm8974-lge-nexus5-hammerhead.dts.

Signed-off-by: Luca Weiss 
---
 .../devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml  | 12 
 1 file changed, 12 insertions(+)

diff --git a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml 
b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
index a786357ed1af..510a05369dbb 100644
--- a/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/qcom,pmic-gpio.yaml
@@ -424,6 +424,10 @@ patternProperties:
 $ref: "#/$defs/qcom-pmic-gpio-state"
 additionalProperties: false
 
+  "^(hog-[0-9]+|.+-hog(-[0-9]+)?)$":
+required:
+  - gpio-hog
+
 $defs:
   qcom-pmic-gpio-state:
 type: object
@@ -571,6 +575,7 @@ $defs:
 
 examples:
   - |
+#include 
 #include 
 
 pm8921_gpio: gpio@150 {
@@ -594,5 +599,12 @@ examples:
   power-source = ;
 };
   };
+
+  otg-hog {
+gpio-hog;
+gpios = <35 GPIO_ACTIVE_HIGH>;
+output-high;
+line-name = "otg-gpio";
+  };
 };
 ...

-- 
2.44.0




[PATCH] dt-bindings: iio: imu: mpu6050: Improve i2c-gate disallow list

2024-04-08 Thread Luca Weiss
Before all supported sensors except for MPU{9150,9250,9255} were not
allowed to use i2c-gate in the bindings which excluded quite a few
supported sensors where this functionality is supported.

Switch the list of sensors to ones where the Linux driver explicitly
disallows support for the auxiliary bus ("inv_mpu_i2c_aux_bus"). Since
the driver is also based on "default: return true" this should scale
better into the future.

Signed-off-by: Luca Weiss 
---
This fixes dt validation error on qcom-msm8974-lge-nexus5-hammerhead
which uses mpu6515

arch/arm/boot/dts/qcom/qcom-msm8974-lge-nexus5-hammerhead.dtb: mpu6515@68: 
i2c-gate: False schema does not allow {'#address-cells': [[1]], '#size-cells': 
[[0]], 'ak8963@f': {'compatible': ['asahi-kasei,ak8963'], 'reg': [[15]], 
'gpios': [[40, 67, 0]], 'vid-supply': [[50]], 'vdd-supply': [[49]]}, 
'bmp280@76': {'compatible': ['bosch,bmp280'], 'reg': [[118]], 'vdda-supply': 
[[50]], 'vddd-supply': [[49]]}}
from schema $id: 
http://devicetree.org/schemas/iio/imu/invensense,mpu6050.yaml#
---
 .../devicetree/bindings/iio/imu/invensense,mpu6050.yaml | 17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml 
b/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml
index 297b8a1a7ffb..587ff2bced2d 100644
--- a/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml
+++ b/Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml
@@ -62,14 +62,15 @@ properties:
 allOf:
   - $ref: /schemas/spi/spi-peripheral-props.yaml#
   - if:
-  not:
-properties:
-  compatible:
-contains:
-  enum:
-- invensense,mpu9150
-- invensense,mpu9250
-- invensense,mpu9255
+  properties:
+compatible:
+  contains:
+enum:
+  - invensense,iam20680
+  - invensense,icm20602
+  - invensense,icm20608
+  - invensense,icm20609
+  - invensense,icm20689
 then:
   properties:
 i2c-gate: false

---
base-commit: 8568bb2ccc278f344e6ac44af6ed010a90aa88dc
change-id: 20240408-mpu6050-i2c-gate-4ea473e492f4

Best regards,
-- 
Luca Weiss 




[PATCH 3/3] dt-bindings: remoteproc: qcom,sdm845-adsp-pil: Fix qcom,halt-regs definition

2024-04-07 Thread Luca Weiss
Set the 'items' correctly for the qcom,halt-regs property and update the
description to match what it should be.

Signed-off-by: Luca Weiss 
---
 .../devicetree/bindings/remoteproc/qcom,sdm845-adsp-pil.yaml| 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/Documentation/devicetree/bindings/remoteproc/qcom,sdm845-adsp-pil.yaml 
b/Documentation/devicetree/bindings/remoteproc/qcom,sdm845-adsp-pil.yaml
index 20df83a96ef3..a3c74871457f 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,sdm845-adsp-pil.yaml
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,sdm845-adsp-pil.yaml
@@ -81,7 +81,11 @@ properties:
 $ref: /schemas/types.yaml#/definitions/phandle-array
 description:
   Phandle reference to a syscon representing TCSR followed by the
-  three offsets within syscon for q6, modem and nc halt registers.
+  offset within syscon for q6 halt register.
+items:
+  - items:
+  - description: phandle to TCSR syscon region
+  - description: offset to the Q6 halt register
 
   qcom,smem-states:
 $ref: /schemas/types.yaml#/definitions/phandle-array

-- 
2.44.0




[PATCH 2/3] dt-bindings: remoteproc: qcom,sc7280-wpss-pil: Fix qcom,halt-regs definition

2024-04-07 Thread Luca Weiss
Set the 'items' correctly for the qcom,halt-regs property and update the
description to match what it should be.

Signed-off-by: Luca Weiss 
---
 .../devicetree/bindings/remoteproc/qcom,sc7280-wpss-pil.yaml| 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/Documentation/devicetree/bindings/remoteproc/qcom,sc7280-wpss-pil.yaml 
b/Documentation/devicetree/bindings/remoteproc/qcom,sc7280-wpss-pil.yaml
index 9381c7022ff4..f4118b2da5f6 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,sc7280-wpss-pil.yaml
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,sc7280-wpss-pil.yaml
@@ -89,7 +89,11 @@ properties:
 $ref: /schemas/types.yaml#/definitions/phandle-array
 description:
   Phandle reference to a syscon representing TCSR followed by the
-  three offsets within syscon for q6, modem and nc halt registers.
+  offset within syscon for q6 halt register.
+items:
+  - items:
+  - description: phandle to TCSR syscon region
+  - description: offset to the Q6 halt register
 
   qcom,qmp:
 $ref: /schemas/types.yaml#/definitions/phandle

-- 
2.44.0




[PATCH 1/3] dt-bindings: remoteproc: qcom,qcs404-cdsp-pil: Fix qcom,halt-regs definition

2024-04-07 Thread Luca Weiss
Set the 'items' correctly for the qcom,halt-regs property and update the
description to match what it should be.

Signed-off-by: Luca Weiss 
---
 .../devicetree/bindings/remoteproc/qcom,qcs404-cdsp-pil.yaml| 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/Documentation/devicetree/bindings/remoteproc/qcom,qcs404-cdsp-pil.yaml 
b/Documentation/devicetree/bindings/remoteproc/qcom,qcs404-cdsp-pil.yaml
index 06f5f93f62a9..bca59394aef4 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,qcs404-cdsp-pil.yaml
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,qcs404-cdsp-pil.yaml
@@ -81,7 +81,11 @@ properties:
 $ref: /schemas/types.yaml#/definitions/phandle-array
 description:
   Phandle reference to a syscon representing TCSR followed by the
-  three offsets within syscon for q6, modem and nc halt registers.
+  offset within syscon for q6 halt register.
+items:
+  - items:
+  - description: phandle to TCSR syscon region
+  - description: offset to the Q6 halt register
 
   qcom,smem-states:
 $ref: /schemas/types.yaml#/definitions/phandle-array

-- 
2.44.0




[PATCH 0/3] Fix up qcom,halt-regs definition in various schemas

2024-04-07 Thread Luca Weiss
The original motivation is that a bunch of other schemas fail to
validate qcom,halt-regs, for example like in the following examples:

arch/arm64/boot/dts/qcom/apq8016-sbc.dtb: remoteproc@408: qcom,halt-regs:0: 
[20] is too short
from schema $id: 
http://devicetree.org/schemas/remoteproc/qcom,msm8916-mss-pil.yaml#
arch/arm64/boot/dts/qcom/apq8096-ifc6640.dtb: remoteproc@208: 
qcom,halt-regs:0: [82] is too short
from schema $id: 
http://devicetree.org/schemas/remoteproc/qcom,msm8996-mss-pil.yaml#
arch/arm64/boot/dts/qcom/apq8039-t2.dtb: remoteproc@408: qcom,halt-regs:0: 
[32] is too short
from schema $id: 
http://devicetree.org/schemas/remoteproc/qcom,msm8916-mss-pil.yaml#

While I'm actually not quite sure why these patches fix this in
the other schemas - feels like a bug/limitation in dt-schema maybe? -
the patches should be correct anyways to validate qcom,halt-regs in the
schemas I'm touching.

Signed-off-by: Luca Weiss 
---
Luca Weiss (3):
  dt-bindings: remoteproc: qcom,qcs404-cdsp-pil: Fix qcom,halt-regs 
definition
  dt-bindings: remoteproc: qcom,sc7280-wpss-pil: Fix qcom,halt-regs 
definition
  dt-bindings: remoteproc: qcom,sdm845-adsp-pil: Fix qcom,halt-regs 
definition

 .../devicetree/bindings/remoteproc/qcom,qcs404-cdsp-pil.yaml| 6 +-
 .../devicetree/bindings/remoteproc/qcom,sc7280-wpss-pil.yaml| 6 +-
 .../devicetree/bindings/remoteproc/qcom,sdm845-adsp-pil.yaml| 6 +-
 3 files changed, 15 insertions(+), 3 deletions(-)
---
base-commit: 8568bb2ccc278f344e6ac44af6ed010a90aa88dc
change-id: 20240407-qcom-halt-regs-fixup-2c6cce9734e4

Best regards,
-- 
Luca Weiss 




Re: [PATCH] Documentation: ABI: document in_temp_input file

2024-04-06 Thread Luca Weiss
On Samstag, 6. April 2024 18:45:21 CEST Jonathan Cameron wrote:
> On Sat, 06 Apr 2024 17:31:04 +0200
> Luca Weiss  wrote:
> 
> > For example the BMP280 barometric pressure sensor on Qualcomm
> > MSM8974-based Nexus 5 smartphone exposes such file in sysfs.
> > Document it.
> > 
> > Signed-off-by: Luca Weiss 
> 
> Hi Luca,
> 
> Applied with a note added on fixing the line above to not reuse X.
> A good additional thing but needs mentioning in the commit message.

Good point! I wrote the patch in Feb 2021 without any description so
I had to retroactively make something up ;)

Thanks for amending and applying!

Regards
Luca

> 
> Thanks,
> 
> Jonathan
> 
> > ---
> >  Documentation/ABI/testing/sysfs-bus-iio | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/ABI/testing/sysfs-bus-iio 
> > b/Documentation/ABI/testing/sysfs-bus-iio
> > index 2e6d5ebfd3c7..7cee78ad4108 100644
> > --- a/Documentation/ABI/testing/sysfs-bus-iio
> > +++ b/Documentation/ABI/testing/sysfs-bus-iio
> > @@ -243,7 +243,8 @@ Description:
> > less measurements. Units after application of scale and offset
> > are milli degrees Celsius.
> >  
> > -What:  /sys/bus/iio/devices/iio:deviceX/in_tempX_input
> > +What:  /sys/bus/iio/devices/iio:deviceX/in_tempY_input
> > +What:  /sys/bus/iio/devices/iio:deviceX/in_temp_input
> >  KernelVersion: 2.6.38
> >  Contact:   linux-...@vger.kernel.org
> >  Description:
> > 
> > ---
> > base-commit: 8568bb2ccc278f344e6ac44af6ed010a90aa88dc
> > change-id: 20240406-in_temp_input-4505d7fafff8
> > 
> > Best regards,
> 
> 







[PATCH] ARM: dts: qcom: msm8974-sony-shinano: Enable vibrator

2024-04-06 Thread Luca Weiss
Enable the vibrator connected to PM8941 found on the Sony shinano
platform.

Signed-off-by: Luca Weiss 
---
 .../arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-common.dtsi | 4 
 1 file changed, 4 insertions(+)

diff --git 
a/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-common.dtsi 
b/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-common.dtsi
index 3a0c0035de09..e129bb1bd6ec 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-common.dtsi
+++ b/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-common.dtsi
@@ -202,6 +202,10 @@ led@7 {
};
 };
 
+_vib {
+   status = "okay";
+};
+
 _adsp {
cx-supply = <_s2>;
status = "okay";

---
base-commit: 956abeb75f90eac3d5ba1f4cff7c048f7c079502
change-id: 20240406-shinano-vib-80e27e9bab2c

Best regards,
-- 
Luca Weiss 




[PATCH] Documentation: ABI: document in_temp_input file

2024-04-06 Thread Luca Weiss
For example the BMP280 barometric pressure sensor on Qualcomm
MSM8974-based Nexus 5 smartphone exposes such file in sysfs.
Document it.

Signed-off-by: Luca Weiss 
---
 Documentation/ABI/testing/sysfs-bus-iio | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/ABI/testing/sysfs-bus-iio 
b/Documentation/ABI/testing/sysfs-bus-iio
index 2e6d5ebfd3c7..7cee78ad4108 100644
--- a/Documentation/ABI/testing/sysfs-bus-iio
+++ b/Documentation/ABI/testing/sysfs-bus-iio
@@ -243,7 +243,8 @@ Description:
less measurements. Units after application of scale and offset
are milli degrees Celsius.
 
-What:  /sys/bus/iio/devices/iio:deviceX/in_tempX_input
+What:  /sys/bus/iio/devices/iio:deviceX/in_tempY_input
+What:  /sys/bus/iio/devices/iio:deviceX/in_temp_input
 KernelVersion: 2.6.38
 Contact:   linux-...@vger.kernel.org
 Description:

---
base-commit: 8568bb2ccc278f344e6ac44af6ed010a90aa88dc
change-id: 20240406-in_temp_input-4505d7fafff8

Best regards,
-- 
Luca Weiss 




[PATCH v2 3/3] arm64: dts: qcom: sm7225-fairphone-fp4: Enable USB role switching

2024-03-29 Thread Luca Weiss
Configure the Type-C and VBUS regulator on PM7250B and wire it up to the
USB PHY, so that USB role and orientation switching works.

For now USB Power Delivery properties are skipped / disabled, so that
the (presumably) bootloader-configured charger doesn't get messed with
and we can charge the phone with at least some amount of power.

Signed-off-by: Luca Weiss 
---
 arch/arm64/boot/dts/qcom/sm6350.dtsi  | 47 ++
 arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts | 60 ++-
 2 files changed, 106 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sm6350.dtsi 
b/arch/arm64/boot/dts/qcom/sm6350.dtsi
index b663c1b18f61..2e135989de8c 100644
--- a/arch/arm64/boot/dts/qcom/sm6350.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm6350.dtsi
@@ -1717,6 +1717,33 @@ usb_1_qmpphy: phy@88e8000 {
#phy-cells = <1>;
 
status = "disabled";
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   port@0 {
+   reg = <0>;
+
+   usb_1_qmpphy_out: endpoint {
+   };
+   };
+
+   port@1 {
+   reg = <1>;
+
+   usb_1_qmpphy_usb_ss_in: endpoint {
+   remote-endpoint = 
<_1_dwc3_ss_out>;
+   };
+   };
+
+   port@2 {
+   reg = <2>;
+
+   usb_1_qmpphy_dp_in: endpoint {
+   };
+   };
+   };
};
 
dc_noc: interconnect@916 {
@@ -1892,6 +1919,26 @@ usb_1_dwc3: usb@a60 {
snps,hird-threshold = /bits/ 8 <0x10>;
phys = <_1_hsphy>, <_1_qmpphy 
QMP_USB43DP_USB3_PHY>;
phy-names = "usb2-phy", "usb3-phy";
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   port@0 {
+   reg = <0>;
+
+   usb_1_dwc3_hs_out: endpoint {
+   };
+   };
+
+   port@1 {
+   reg = <1>;
+
+   usb_1_dwc3_ss_out: endpoint {
+   remote-endpoint = 
<_1_qmpphy_usb_ss_in>;
+   };
+   };
+   };
};
};
 
diff --git a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts 
b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
index bc67e8c1fe4d..5d7778c48413 100644
--- a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
+++ b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
@@ -19,6 +19,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "sm7225.dtsi"
 #include "pm6150l.dtsi"
 #include "pm6350.dtsi"
@@ -543,6 +544,53 @@ conn-therm@1 {
};
 };
 
+_typec {
+   vdd-pdphy-supply = <_l3a>;
+
+   status = "okay";
+
+   connector {
+   compatible = "usb-c-connector";
+
+   power-role = "dual";
+   data-role = "dual";
+   self-powered;
+
+   /*
+* Disable USB Power Delivery for now, seems to need extra work
+* to support role switching while also letting the battery
+* charge still - without charger driver
+*/
+   typec-power-opmode = "default";
+   pd-disable;
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   port@0 {
+   reg = <0>;
+   pm7250b_hs_in: endpoint {
+   remote-endpoint = <_1_dwc3_hs_out>;
+   };
+   };
+
+   port@1 {
+   reg = <1>;
+   pm7250b_ss_in: endpoint {
+  

[PATCH v2 2/3] arm64: dts: qcom: pm7250b: Add a TCPM description

2024-03-29 Thread Luca Weiss
Type-C port management functionality lives inside of the PMIC block on
pm7250b.

The Type-C port management logic controls orientation detection,
vbus/vconn sense and to send/receive Type-C Power Domain messages.

Reviewed-by: Bryan O'Donoghue 
Reviewed-by: Konrad Dybcio 
Signed-off-by: Luca Weiss 
---
 arch/arm64/boot/dts/qcom/pm7250b.dtsi | 39 +++
 1 file changed, 39 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/pm7250b.dtsi 
b/arch/arm64/boot/dts/qcom/pm7250b.dtsi
index 4faed25a787f..0205c2669093 100644
--- a/arch/arm64/boot/dts/qcom/pm7250b.dtsi
+++ b/arch/arm64/boot/dts/qcom/pm7250b.dtsi
@@ -51,6 +51,45 @@ pm7250b_vbus: usb-vbus-regulator@1100 {
status = "disabled";
};
 
+   pm7250b_typec: typec@1500 {
+   compatible = "qcom,pm7250b-typec", "qcom,pm8150b-typec";
+   reg = <0x1500>,
+ <0x1700>;
+   interrupts = ,
+,
+,
+,
+,
+,
+,
+,
+,
+,
+,
+,
+,
+,
+,
+;
+   interrupt-names = "or-rid-detect-change",
+ "vpd-detect",
+ "cc-state-change",
+ "vconn-oc",
+ "vbus-change",
+ "attach-detach",
+ "legacy-cable-detect",
+ "try-snk-src-detect",
+ "sig-tx",
+ "sig-rx",
+ "msg-tx",
+ "msg-rx",
+ "msg-tx-failed",
+ "msg-tx-discarded",
+ "msg-rx-discarded",
+ "fr-swap";
+   vdd-vbus-supply = <_vbus>;
+   };
+
pm7250b_temp: temp-alarm@2400 {
compatible = "qcom,spmi-temp-alarm";
reg = <0x2400>;

-- 
2.44.0




[PATCH v2 1/3] arm64: dts: qcom: pm7250b: Add node for PMIC VBUS booster

2024-03-29 Thread Luca Weiss
Add the required DTS node for the USB VBUS output regulator, which is
available on PM7250B. This will provide the VBUS source to connected
peripherals.

Reviewed-by: Bryan O'Donoghue 
Signed-off-by: Luca Weiss 
---
 arch/arm64/boot/dts/qcom/pm7250b.dtsi | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/pm7250b.dtsi 
b/arch/arm64/boot/dts/qcom/pm7250b.dtsi
index 3bf7cf5d1700..4faed25a787f 100644
--- a/arch/arm64/boot/dts/qcom/pm7250b.dtsi
+++ b/arch/arm64/boot/dts/qcom/pm7250b.dtsi
@@ -45,6 +45,12 @@ pmic@PM7250B_SID {
#address-cells = <1>;
#size-cells = <0>;
 
+   pm7250b_vbus: usb-vbus-regulator@1100 {
+   compatible = "qcom,pm7250b-vbus-reg", 
"qcom,pm8150b-vbus-reg";
+   reg = <0x1100>;
+   status = "disabled";
+   };
+
pm7250b_temp: temp-alarm@2400 {
compatible = "qcom,spmi-temp-alarm";
reg = <0x2400>;

-- 
2.44.0




[PATCH v2 0/3] Add TCPM support for PM7250B and Fairphone 4

2024-03-29 Thread Luca Weiss
This series adds support for Type-C Port Management on the Fairphone 4
which enables USB role switching and orientation switching.

This enables a user for example to plug in a USB stick or a USB keyboard
to the Type-C port.

To: Bjorn Andersson 
To: Konrad Dybcio 
To: Rob Herring 
To: Krzysztof Kozlowski 
To: Conor Dooley 
Cc: ~postmarketos/upstream...@lists.sr.ht
Cc: phone-de...@vger.kernel.org
Cc: linux-arm-...@vger.kernel.org
Cc: devicet...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Luca Weiss 

Changes in v2:
- Move disabled as last property for pm7250b_vbus
- Update USB graph to newer version, connect both HS and SS signals
- Update FP4 Type-C properties, try to keep phone charging intact by
  disabling USB PD for now
- Pick up tags
- Drop patches that landed in linux-next already
- Link to v1: 
https://lore.kernel.org/r/20240322-fp4-tcpm-v1-0-c5644099d...@fairphone.com

---
Luca Weiss (3):
  arm64: dts: qcom: pm7250b: Add node for PMIC VBUS booster
  arm64: dts: qcom: pm7250b: Add a TCPM description
  arm64: dts: qcom: sm7225-fairphone-fp4: Enable USB role switching

 arch/arm64/boot/dts/qcom/pm7250b.dtsi | 45 +
 arch/arm64/boot/dts/qcom/sm6350.dtsi  | 47 ++
 arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts | 60 ++-
 3 files changed, 151 insertions(+), 1 deletion(-)
---
base-commit: f3583a292140e0a2a2ca0ae0019108401b4c9158
change-id: 20240322-fp4-tcpm-2ad68ef55346

Best regards,
-- 
Luca Weiss 




[PATCH 5/5] arm64: dts: qcom: sm7225-fairphone-fp4: Enable USB role switching

2024-03-22 Thread Luca Weiss
Configure the Type-C and VBUS regulator on PM7250B and wire it up to the
USB PHY, so that USB role and orientation switching works.

Signed-off-by: Luca Weiss 
---
With this patch I'm not quite sure if the 'ports' are connected
correctly, though functionally everything appears to work fine.

On some other SoCs port@1 in qmpphy and a second port in dwc3 are
connected together also - one port of USB 2.0 HS, one for USB 3.0 SS.

Here I'm following sm8250's solution. Also checking the binding doc
doesn't reveal anything useful.
---
 arch/arm64/boot/dts/qcom/sm6350.dtsi  | 25 ++
 arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts | 57 ++-
 2 files changed, 81 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sm6350.dtsi 
b/arch/arm64/boot/dts/qcom/sm6350.dtsi
index 24bcec3366ef..b267500467f0 100644
--- a/arch/arm64/boot/dts/qcom/sm6350.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm6350.dtsi
@@ -1686,6 +1686,27 @@ usb_1_qmpphy: phy@88e8000 {
#phy-cells = <1>;
 
status = "disabled";
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   port@0 {
+   reg = <0>;
+
+   usb_1_qmpphy_out: endpoint {};
+   };
+
+   port@1 {
+   reg = <1>;
+   };
+
+   port@2 {
+   reg = <2>;
+
+   usb_1_qmpphy_dp_in: endpoint {};
+   };
+   };
};
 
dc_noc: interconnect@916 {
@@ -1861,6 +1882,10 @@ usb_1_dwc3: usb@a60 {
snps,hird-threshold = /bits/ 8 <0x10>;
phys = <_1_hsphy>, <_1_qmpphy 
QMP_USB43DP_USB3_PHY>;
phy-names = "usb2-phy", "usb3-phy";
+
+   port {
+   usb_1_role_switch_out: endpoint {};
+   };
};
};
 
diff --git a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts 
b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
index bc67e8c1fe4d..104f23ec322d 100644
--- a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
+++ b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
@@ -19,6 +19,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "sm7225.dtsi"
 #include "pm6150l.dtsi"
 #include "pm6350.dtsi"
@@ -543,6 +544,50 @@ conn-therm@1 {
};
 };
 
+_typec {
+   vdd-pdphy-supply = <_l3a>;
+
+   status = "okay";
+
+   connector {
+   compatible = "usb-c-connector";
+
+   power-role = "source";
+   data-role = "dual";
+   self-powered;
+
+   source-pdos = ;
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   port@0 {
+   reg = <0>;
+   pm7250b_role_switch_in: endpoint {
+   remote-endpoint = 
<_1_role_switch_out>;
+   };
+   };
+
+   port@1 {
+   reg = <1>;
+   pm7250b_typec_mux_in: endpoint {
+   remote-endpoint = <_1_qmpphy_out>;
+   };
+   };
+   };
+   };
+};
+
+_vbus {
+   regulator-min-microamp = <50>;
+   regulator-max-microamp = <150>;
+   status = "okay";
+};
+
 _rtc {
status = "okay";
 };
@@ -726,7 +771,12 @@ _1 {
 
 _1_dwc3 {
maximum-speed = "super-speed";
-   dr_mode = "peripheral";
+   dr_mode = "otg";
+   usb-role-switch;
+};
+
+_1_role_switch_out {
+   remote-endpoint = <_role_switch_in>;
 };
 
 _1_hsphy {
@@ -740,10 +790,15 @@ _1_hsphy {
 _1_qmpphy {
vdda-phy-supply = <_l22a>;
vdda-pll-supply = <_l16a>;
+   orientation-switch;
 
status = "okay";
 };
 
+_1_qmpphy_out {
+   remote-endpoint = <_typec_mux_in>;
+};
+
  {
vdd-0.8-cx-mx-supply = <_l4a>;
vdd-1.8-xo-supply = <_l7a>;

-- 
2.44.0




[PATCH 4/5] arm64: dts: qcom: pm7250b: Add a TCPM description

2024-03-22 Thread Luca Weiss
Type-C port management functionality lives inside of the PMIC block on
pm7250b.

The Type-C port management logic controls orientation detection,
vbus/vconn sense and to send/receive Type-C Power Domain messages.

Signed-off-by: Luca Weiss 
---
 arch/arm64/boot/dts/qcom/pm7250b.dtsi | 39 +++
 1 file changed, 39 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/pm7250b.dtsi 
b/arch/arm64/boot/dts/qcom/pm7250b.dtsi
index 91a046b3529c..d9abac052afe 100644
--- a/arch/arm64/boot/dts/qcom/pm7250b.dtsi
+++ b/arch/arm64/boot/dts/qcom/pm7250b.dtsi
@@ -51,6 +51,45 @@ pm7250b_vbus: usb-vbus-regulator@1100 {
reg = <0x1100>;
};
 
+   pm7250b_typec: typec@1500 {
+   compatible = "qcom,pm7250b-typec", "qcom,pm8150b-typec";
+   reg = <0x1500>,
+ <0x1700>;
+   interrupts = ,
+,
+,
+,
+,
+,
+,
+,
+,
+,
+,
+,
+,
+,
+,
+;
+   interrupt-names = "or-rid-detect-change",
+ "vpd-detect",
+ "cc-state-change",
+ "vconn-oc",
+ "vbus-change",
+ "attach-detach",
+ "legacy-cable-detect",
+ "try-snk-src-detect",
+ "sig-tx",
+ "sig-rx",
+ "msg-tx",
+ "msg-rx",
+ "msg-tx-failed",
+ "msg-tx-discarded",
+ "msg-rx-discarded",
+ "fr-swap";
+   vdd-vbus-supply = <_vbus>;
+   };
+
pm7250b_temp: temp-alarm@2400 {
compatible = "qcom,spmi-temp-alarm";
reg = <0x2400>;

-- 
2.44.0




[PATCH 3/5] arm64: dts: qcom: pm7250b: Add node for PMIC VBUS booster

2024-03-22 Thread Luca Weiss
Add the required DTS node for the USB VBUS output regulator, which is
available on PM7250B. This will provide the VBUS source to connected
peripherals.

Signed-off-by: Luca Weiss 
---
 arch/arm64/boot/dts/qcom/pm7250b.dtsi | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/pm7250b.dtsi 
b/arch/arm64/boot/dts/qcom/pm7250b.dtsi
index 3bf7cf5d1700..91a046b3529c 100644
--- a/arch/arm64/boot/dts/qcom/pm7250b.dtsi
+++ b/arch/arm64/boot/dts/qcom/pm7250b.dtsi
@@ -45,6 +45,12 @@ pmic@PM7250B_SID {
#address-cells = <1>;
#size-cells = <0>;
 
+   pm7250b_vbus: usb-vbus-regulator@1100 {
+   compatible = "qcom,pm7250b-vbus-reg", 
"qcom,pm8150b-vbus-reg";
+   status = "disabled";
+   reg = <0x1100>;
+   };
+
pm7250b_temp: temp-alarm@2400 {
compatible = "qcom,spmi-temp-alarm";
reg = <0x2400>;

-- 
2.44.0




[PATCH 2/5] dt-bindings: usb: qcom,pmic-typec: Add support for the PM7250B PMIC

2024-03-22 Thread Luca Weiss
The PM6150 PMIC has the same Type-C register block as the PM8150B.
Define corresponding compatible string, having the qcom,pm8150b-vbus-reg
as a fallback.

Signed-off-by: Luca Weiss 
---
 Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml 
b/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml
index d9694570c419..0cdc60b76fbd 100644
--- a/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml
+++ b/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml
@@ -21,6 +21,7 @@ properties:
   - items:
   - enum:
   - qcom,pm6150-typec
+  - qcom,pm7250b-typec
   - const: qcom,pm8150b-typec
   - items:
   - enum:

-- 
2.44.0




[PATCH 1/5] dt-bindings: regulator: qcom,usb-vbus-regulator: Add PM7250B compatible

2024-03-22 Thread Luca Weiss
The VBUS register block on the PM6150 PMIC shares the design with the
PM8150B one. Define corresponding compatible string, having the
qcom,pm8150b-vbus-reg as a fallback.

Signed-off-by: Luca Weiss 
---
 Documentation/devicetree/bindings/regulator/qcom,usb-vbus-regulator.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/Documentation/devicetree/bindings/regulator/qcom,usb-vbus-regulator.yaml 
b/Documentation/devicetree/bindings/regulator/qcom,usb-vbus-regulator.yaml
index 33ae1f786802..fcefc722ee2a 100644
--- a/Documentation/devicetree/bindings/regulator/qcom,usb-vbus-regulator.yaml
+++ b/Documentation/devicetree/bindings/regulator/qcom,usb-vbus-regulator.yaml
@@ -26,6 +26,7 @@ properties:
   - enum:
   - qcom,pm4125-vbus-reg
   - qcom,pm6150-vbus-reg
+  - qcom,pm7250b-vbus-reg
   - qcom,pmi632-vbus-reg
   - const: qcom,pm8150b-vbus-reg
 

-- 
2.44.0




[PATCH 0/5] Add TCPM support for PM7250B and Fairphone 4

2024-03-22 Thread Luca Weiss
This series adds support for Type-C Port Management on the Fairphone 4
which enables USB role switching and orientation switching.

This enables a user for example to plug in a USB stick or a USB keyboard
to the Type-C port.

Signed-off-by: Luca Weiss 
---
Luca Weiss (5):
  dt-bindings: regulator: qcom,usb-vbus-regulator: Add PM7250B compatible
  dt-bindings: usb: qcom,pmic-typec: Add support for the PM7250B PMIC
  arm64: dts: qcom: pm7250b: Add node for PMIC VBUS booster
  arm64: dts: qcom: pm7250b: Add a TCPM description
  arm64: dts: qcom: sm7225-fairphone-fp4: Enable USB role switching

 .../regulator/qcom,usb-vbus-regulator.yaml |  1 +
 .../devicetree/bindings/usb/qcom,pmic-typec.yaml   |  1 +
 arch/arm64/boot/dts/qcom/pm7250b.dtsi  | 45 +
 arch/arm64/boot/dts/qcom/sm6350.dtsi   | 25 ++
 arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts  | 57 +-
 5 files changed, 128 insertions(+), 1 deletion(-)
---
base-commit: fa564eb0e6faf40ceea92b2e5ba7a08d0a79594c
change-id: 20240322-fp4-tcpm-2ad68ef55346

Best regards,
-- 
Luca Weiss 




Re: [PATCH v5 2/3] arm64: dts: qcom: sc7280: Add UFS nodes for sc7280 soc

2024-03-22 Thread Luca Weiss
On Mon Dec 4, 2023 at 6:28 PM CET, Manivannan Sadhasivam wrote:
> On Mon, Dec 04, 2023 at 01:21:42PM +0100, Luca Weiss wrote:
> > On Mon Dec 4, 2023 at 1:15 PM CET, Nitin Rawat wrote:
> > >
> > >
> > > On 12/4/2023 3:54 PM, Luca Weiss wrote:
> > > > From: Nitin Rawat 
> > > > 
> > > > Add UFS host controller and PHY nodes for sc7280 soc.
> > > > 
> > > > Signed-off-by: Nitin Rawat 
> > > > Reviewed-by: Konrad Dybcio 
> > > > Tested-by: Konrad Dybcio  # QCM6490 FP5
> > > > [luca: various cleanups and additions as written in the cover letter]
> > > > Signed-off-by: Luca Weiss 
> > > > ---
> > > >   arch/arm64/boot/dts/qcom/sc7280.dtsi | 74 
> > > > +++-
> > > >   1 file changed, 73 insertions(+), 1 deletion(-)
> > > > 
> > > > diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi 
> > > > b/arch/arm64/boot/dts/qcom/sc7280.dtsi
> > > > index 04bf85b0399a..8b08569f2191 100644
> > > > --- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
> > > > +++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
> > > > @@ -15,6 +15,7 @@
> > > >   #include 
> > > >   #include 
> > > >   #include 
> > > > +#include 
> > > >   #include 
> > > >   #include 
> > > >   #include 
> > > > @@ -906,7 +907,7 @@ gcc: clock-controller@10 {
> > > > clocks = < RPMH_CXO_CLK>,
> > > >  < RPMH_CXO_CLK_A>, <_clk>,
> > > >  <0>, <_phy>,
> > > > -<0>, <0>, <0>,
> > > > +<_mem_phy 0>, <_mem_phy 1>, 
> > > > <_mem_phy 2>,
> > > >  <_1_qmpphy 
> > > > QMP_USB43DP_USB3_PIPE_CLK>;
> > > > clock-names = "bi_tcxo", "bi_tcxo_ao", 
> > > > "sleep_clk",
> > > >   "pcie_0_pipe_clk", 
> > > > "pcie_1_pipe_clk",
> > > > @@ -2238,6 +2239,77 @@ pcie1_phy: phy@1c0e000 {
> > > > status = "disabled";
> > > > };
> > > >   
> > > > +   ufs_mem_hc: ufs@1d84000 {
> > > > +   compatible = "qcom,sc7280-ufshc", "qcom,ufshc",
> > > > +"jedec,ufs-2.0";
> > > > +   reg = <0x0 0x01d84000 0x0 0x3000>;
> > > > +   interrupts = ;
> > > > +   phys = <_mem_phy>;
> > > > +   phy-names = "ufsphy";
> > > > +   lanes-per-direction = <2>;
> > > > +   #reset-cells = <1>;
> > > > +   resets = < GCC_UFS_PHY_BCR>;
> > > > +   reset-names = "rst";
> > > > +
> > > > +   power-domains = < GCC_UFS_PHY_GDSC>;
> > > > +   required-opps = <_opp_nom>;
> > > > +
> > > > +   iommus = <_smmu 0x80 0x0>;
> > > > +   dma-coherent;
> > > > +
> > > > +   interconnects = <_noc MASTER_UFS_MEM 
> > > > QCOM_ICC_TAG_ALWAYS
> > > > +_virt SLAVE_EBI1 
> > > > QCOM_ICC_TAG_ALWAYS>,
> > > > +   <_noc MASTER_APPSS_PROC 
> > > > QCOM_ICC_TAG_ALWAYS
> > > > + SLAVE_UFS_MEM_CFG 
> > > > QCOM_ICC_TAG_ALWAYS>;
> > > > +   interconnect-names = "ufs-ddr", "cpu-ufs";
> > > > +
> > > > +   clocks = < GCC_UFS_PHY_AXI_CLK>,
> > > > +< GCC_AGGRE_UFS_PHY_AXI_CLK>,
> > > > +< GCC_UFS_PHY_AHB_CLK>,
> > > > +< GCC_UFS_PHY_UNIPRO_CORE_CLK>,
> > > > +

[PATCH 1/2] ARM: dts: qcom: msm8974: Add @0 to memory node name

2024-03-18 Thread Luca Weiss
Add the @0 from reg to the node name, so that both dtc warning and dt
validation failure get resolved.

  arch/arm/boot/dts/qcom/qcom-msm8974.dtsi:106.9-109.4: Warning 
(unit_address_vs_reg): /memory: node has a reg or ranges property, but no unit 
name

  [..]/arch/arm/boot/dts/qcom/qcom-msm8974pro-fairphone-fp2.dtb: /: memory: 
False schema does not allow {'device_type': ['memory'], 'reg': [[0, 0]]}
  from schema $id: http://devicetree.org/schemas/root-node.yaml#

Signed-off-by: Luca Weiss 
---
 arch/arm/boot/dts/qcom/qcom-msm8974.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi 
b/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
index 5efc38d712cc..00c6526a525d 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
+++ b/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
@@ -103,7 +103,7 @@ scm {
};
};
 
-   memory {
+   memory@0 {
device_type = "memory";
reg = <0x0 0x0>;
};

-- 
2.44.0




[PATCH 2/2] ARM: dts: qcom: msm8974: Add empty chosen node

2024-03-18 Thread Luca Weiss
Add an empty /chosen node to the dtsi like is common on most other
Qualcomm SoC files, so that various pieces of software expecting this
node to exist don't complain.

Signed-off-by: Luca Weiss 
---
 arch/arm/boot/dts/qcom/qcom-msm8974.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi 
b/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
index 00c6526a525d..2ec4ec4e5d2a 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
+++ b/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
@@ -14,6 +14,8 @@ / {
#size-cells = <1>;
interrupt-parent = <>;
 
+   chosen { };
+
clocks {
xo_board: xo_board {
compatible = "fixed-clock";

-- 
2.44.0




[PATCH 0/2] Small fixes for MSM8974 SoC dtsi

2024-03-18 Thread Luca Weiss
One fix for dt schema validation, one for the /chosen node.

Signed-off-by: Luca Weiss 
---
Luca Weiss (2):
  ARM: dts: qcom: msm8974: Add @0 to memory node name
  ARM: dts: qcom: msm8974: Add empty chosen node

 arch/arm/boot/dts/qcom/qcom-msm8974.dtsi | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
base-commit: f6cef5f8c37f58a3bc95b3754c3ae98e086631ca
change-id: 20240318-msm8974-misc2-1fb92ae6bdf3

Best regards,
-- 
Luca Weiss 




[PATCH] usb: typec: ptn36502: switch to DRM_AUX_BRIDGE

2024-03-15 Thread Luca Weiss
Switch to using the new DRM_AUX_BRIDGE helper to create the transparent
DRM bridge device instead of handcoding corresponding functionality.

Signed-off-by: Luca Weiss 
---
Very similar to this patch:
c5d296bad640 ("usb: typec: nb7vpq904m: switch to DRM_AUX_BRIDGE")
---
 drivers/usb/typec/mux/Kconfig|  2 +-
 drivers/usb/typec/mux/ptn36502.c | 44 ++--
 2 files changed, 3 insertions(+), 43 deletions(-)

diff --git a/drivers/usb/typec/mux/Kconfig b/drivers/usb/typec/mux/Kconfig
index 399c7b0983df..4827e86fed6d 100644
--- a/drivers/usb/typec/mux/Kconfig
+++ b/drivers/usb/typec/mux/Kconfig
@@ -60,7 +60,7 @@ config TYPEC_MUX_PTN36502
tristate "NXP PTN36502 Type-C redriver driver"
depends on I2C
depends on DRM || DRM=n
-   select DRM_PANEL_BRIDGE if DRM
+   select DRM_AUX_BRIDGE if DRM_BRIDGE
select REGMAP_I2C
help
  Say Y or M if your system has a NXP PTN36502 Type-C redriver chip
diff --git a/drivers/usb/typec/mux/ptn36502.c b/drivers/usb/typec/mux/ptn36502.c
index 72ae38a1b2be..0ec86ef32a87 100644
--- a/drivers/usb/typec/mux/ptn36502.c
+++ b/drivers/usb/typec/mux/ptn36502.c
@@ -8,7 +8,7 @@
  * Copyright (C) 2023 Dmitry Baryshkov 
  */
 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -68,8 +68,6 @@ struct ptn36502 {
 
struct typec_switch *typec_switch;
 
-   struct drm_bridge bridge;
-
struct mutex lock; /* protect non-concurrent retimer & switch */
 
enum typec_orientation orientation;
@@ -283,44 +281,6 @@ static int ptn36502_detect(struct ptn36502 *ptn)
return 0;
 }
 
-#if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_DRM_PANEL_BRIDGE)
-static int ptn36502_bridge_attach(struct drm_bridge *bridge,
- enum drm_bridge_attach_flags flags)
-{
-   struct ptn36502 *ptn = container_of(bridge, struct ptn36502, bridge);
-   struct drm_bridge *next_bridge;
-
-   if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR))
-   return -EINVAL;
-
-   next_bridge = devm_drm_of_get_bridge(>client->dev, 
ptn->client->dev.of_node, 0, 0);
-   if (IS_ERR(next_bridge)) {
-   dev_err(>client->dev, "failed to acquire drm_bridge: 
%pe\n", next_bridge);
-   return PTR_ERR(next_bridge);
-   }
-
-   return drm_bridge_attach(bridge->encoder, next_bridge, bridge,
-DRM_BRIDGE_ATTACH_NO_CONNECTOR);
-}
-
-static const struct drm_bridge_funcs ptn36502_bridge_funcs = {
-   .attach = ptn36502_bridge_attach,
-};
-
-static int ptn36502_register_bridge(struct ptn36502 *ptn)
-{
-   ptn->bridge.funcs = _bridge_funcs;
-   ptn->bridge.of_node = ptn->client->dev.of_node;
-
-   return devm_drm_bridge_add(>client->dev, >bridge);
-}
-#else
-static int ptn36502_register_bridge(struct ptn36502 *ptn)
-{
-   return 0;
-}
-#endif
-
 static const struct regmap_config ptn36502_regmap = {
.max_register = 0x0d,
.reg_bits = 8,
@@ -369,7 +329,7 @@ static int ptn36502_probe(struct i2c_client *client)
if (ret)
goto err_disable_regulator;
 
-   ret = ptn36502_register_bridge(ptn);
+   ret = drm_aux_bridge_register(dev);
if (ret)
goto err_disable_regulator;
 

---
base-commit: 9bb9b28d0568991b1d63e66fe75afa5f97ad1156
change-id: 20240315-ptn36502-aux-15dd6f289aff

Best regards,
-- 
Luca Weiss 




[PATCH v2 1/2] dt-bindings: arm: qcom: Add Samsung Galaxy Note 3

2024-03-14 Thread Luca Weiss
Add the compatible for this Samsung smartphone ("phablet" as it was
named in that era).

Acked-by: Krzysztof Kozlowski 
Signed-off-by: Luca Weiss 
---
 Documentation/devicetree/bindings/arm/qcom.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/arm/qcom.yaml 
b/Documentation/devicetree/bindings/arm/qcom.yaml
index 1a5fb889a444..57182bfa27ee 100644
--- a/Documentation/devicetree/bindings/arm/qcom.yaml
+++ b/Documentation/devicetree/bindings/arm/qcom.yaml
@@ -214,6 +214,7 @@ properties:
   - items:
   - enum:
   - lge,hammerhead
+  - samsung,hlte
   - sony,xperia-amami
   - sony,xperia-honami
   - const: qcom,msm8974

-- 
2.44.0




[PATCH v2 2/2] ARM: dts: qcom: msm8974: Add Samsung Galaxy Note 3

2024-03-14 Thread Luca Weiss
From: Adam Honse 

Add the devicetree for this "phablet" using the Snapdragon 800 SoC.

Signed-off-by: Adam Honse 
[l...@z3ntu.xyz: clean up, prepare for upstream]
Signed-off-by: Luca Weiss 
---
 arch/arm/boot/dts/qcom/Makefile|   1 +
 .../boot/dts/qcom/qcom-msm8974-samsung-hlte.dts| 401 +
 2 files changed, 402 insertions(+)

diff --git a/arch/arm/boot/dts/qcom/Makefile b/arch/arm/boot/dts/qcom/Makefile
index 9cc1e14e6cd0..845af12d15a2 100644
--- a/arch/arm/boot/dts/qcom/Makefile
+++ b/arch/arm/boot/dts/qcom/Makefile
@@ -39,6 +39,7 @@ dtb-$(CONFIG_ARCH_QCOM) += \
qcom-msm8960-cdp.dtb \
qcom-msm8960-samsung-expressatt.dtb \
qcom-msm8974-lge-nexus5-hammerhead.dtb \
+   qcom-msm8974-samsung-hlte.dtb \
qcom-msm8974-sony-xperia-rhine-amami.dtb \
qcom-msm8974-sony-xperia-rhine-honami.dtb \
qcom-msm8974pro-fairphone-fp2.dtb \
diff --git a/arch/arm/boot/dts/qcom/qcom-msm8974-samsung-hlte.dts 
b/arch/arm/boot/dts/qcom/qcom-msm8974-samsung-hlte.dts
new file mode 100644
index ..903bb4d12513
--- /dev/null
+++ b/arch/arm/boot/dts/qcom/qcom-msm8974-samsung-hlte.dts
@@ -0,0 +1,401 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "qcom-msm8974.dtsi"
+#include "pm8841.dtsi"
+#include "pm8941.dtsi"
+#include 
+#include 
+#include 
+
+/ {
+   model = "Samsung Galaxy Note 3";
+   compatible = "samsung,hlte", "qcom,msm8974";
+   chassis-type = "handset";
+
+   aliases {
+   mmc0 = _1; /* SDC1 eMMC slot */
+   mmc1 = _3; /* SDC3 SD card slot */
+   serial0 = _uart1;
+   };
+
+   chosen {
+   stdout-path = "serial0:115200n8";
+   };
+
+   gpio-keys {
+   compatible = "gpio-keys";
+
+   pinctrl-0 = <_keys_pin_a>;
+   pinctrl-names = "default";
+
+   key-home {
+   label = "Home Key";
+   gpios = <_gpios 3 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   wakeup-source;
+   debounce-interval = <15>;
+   };
+
+   key-volume-down {
+   label = "Volume Down";
+   gpios = <_gpios 2 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   debounce-interval = <15>;
+   };
+
+   key-volume-up {
+   label = "Volume Up";
+   gpios = <_gpios 5 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   debounce-interval = <15>;
+   };
+   };
+
+   touch_ldo: regulator-touch {
+   compatible = "regulator-fixed";
+   regulator-name = "touch-ldo";
+
+   gpio = <_gpios 9 GPIO_ACTIVE_HIGH>;
+   enable-active-high;
+   regulator-boot-on;
+
+   pinctrl-0 = <_ldo_pin>;
+   pinctrl-names = "default";
+   };
+};
+
+_i2c2 {
+   status = "okay";
+
+   touchscreen@20 {
+   compatible = "syna,rmi4-i2c";
+   reg = <0x20>;
+
+   interrupt-parent = <_gpios>;
+   interrupts = <30 IRQ_TYPE_EDGE_FALLING>;
+
+   vdd-supply = <_l10>;
+   vio-supply = <_ldo>;
+
+   pinctrl-0 = <_pin>;
+   pinctrl-names = "default";
+
+   syna,startup-delay-ms = <100>;
+
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   rmi4-f01@1 {
+   reg = <0x1>;
+   syna,nosleep-mode = <1>;
+   };
+
+   rmi4-f12@12 {
+   reg = <0x12>;
+   syna,sensor-type = <1>;
+   };
+   };
+};
+
+_i2c6 {
+   status = "okay";
+
+   fuelgauge@36 {
+   compatible = "maxim,max17048";
+   reg = <0x36>;
+
+   maxim,double-soc;
+   maxim,rcomp = /bits/ 8 <0x56>;
+
+   interrupt-parent = <_gpios>;
+   interrupts = <26 IRQ_TYPE_EDGE_FALLING>;
+
+   pinctrl-0 = <_pin>;
+   pinctrl-names = "default";
+   };
+};
+
+_uart2 {
+   status = "okay";
+};
+
+_gpios {
+   gpio_keys_pin_a: gpio-keys-active-state {
+   pins = "gpio2", "gpio3", "gpio5";
+   function = "normal";
+   bias-pull-up;
+   power-source = ;
+   };
+
+   fuelgauge_pin: fuelgauge-int

[PATCH v2 0/2] Add Samsung Galaxy Note 3 support

2024-03-14 Thread Luca Weiss
Add the dts for "hlte" which is a phablet from 2013.

Signed-off-by: Luca Weiss 
---
Changes in v2:
- Correct property order (Konrad)
- Pick up tags
- Link to v1: 
https://lore.kernel.org/r/20240310-samsung-hlte-v1-0-e9b55bf98...@z3ntu.xyz

---
Adam Honse (1):
  ARM: dts: qcom: msm8974: Add Samsung Galaxy Note 3

Luca Weiss (1):
  dt-bindings: arm: qcom: Add Samsung Galaxy Note 3

 Documentation/devicetree/bindings/arm/qcom.yaml|   1 +
 arch/arm/boot/dts/qcom/Makefile|   1 +
 .../boot/dts/qcom/qcom-msm8974-samsung-hlte.dts| 401 +
 3 files changed, 403 insertions(+)
---
base-commit: 90d35da658da8cff0d4ecbb5113f5fac9d00eb72
change-id: 20240310-samsung-hlte-78d1a287b0a8

Best regards,
-- 
Luca Weiss 




[PATCH v2 3/3] ARM: dts: qcom: Add Sony Xperia Z3 smartphone

2024-03-14 Thread Luca Weiss
Add the dts for the Xperia Z3 smartphone which is based on Sony's
shinano platform, so at the moment there's little device-specific dts to
add on top of the common parts.

Signed-off-by: Luca Weiss 
---
 arch/arm/boot/dts/qcom/Makefile|  1 +
 .../qcom-msm8974pro-sony-xperia-shinano-leo.dts| 44 ++
 2 files changed, 45 insertions(+)

diff --git a/arch/arm/boot/dts/qcom/Makefile b/arch/arm/boot/dts/qcom/Makefile
index 9cc1e14e6cd0..92eca505a4ab 100644
--- a/arch/arm/boot/dts/qcom/Makefile
+++ b/arch/arm/boot/dts/qcom/Makefile
@@ -45,6 +45,7 @@ dtb-$(CONFIG_ARCH_QCOM) += \
qcom-msm8974pro-oneplus-bacon.dtb \
qcom-msm8974pro-samsung-klte.dtb \
qcom-msm8974pro-sony-xperia-shinano-castor.dtb \
+   qcom-msm8974pro-sony-xperia-shinano-leo.dtb \
qcom-mdm9615-wp8548-mangoh-green.dtb \
qcom-sdx55-mtp.dtb \
qcom-sdx55-t55.dtb \
diff --git a/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-leo.dts 
b/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-leo.dts
new file mode 100644
index ..1ed6e1cc21d5
--- /dev/null
+++ b/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-leo.dts
@@ -0,0 +1,44 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "qcom-msm8974pro-sony-xperia-shinano-common.dtsi"
+
+/ {
+   model = "Sony Xperia Z3";
+   compatible = "sony,xperia-leo", "qcom,msm8974pro", "qcom,msm8974";
+   chassis-type = "handset";
+
+   gpio-keys {
+   key-camera-snapshot {
+   label = "camera_snapshot";
+   gpios = <_gpios 3 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   debounce-interval = <15>;
+   };
+
+   key-camera-focus {
+   label = "camera_focus";
+   gpios = <_gpios 4 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   debounce-interval = <15>;
+   };
+   };
+};
+
+_keys_pin_a {
+   pins = "gpio2", "gpio3", "gpio4", "gpio5";
+};
+
+ {
+   usb-charge-current-limit = <150>;
+   qcom,fast-charge-safe-current = <300>;
+   qcom,fast-charge-current-limit = <215>;
+   qcom,fast-charge-safe-voltage = <440>;
+   qcom,fast-charge-high-threshold-voltage = <435>;
+   qcom,auto-recharge-threshold-voltage = <428>;
+   qcom,minimum-input-voltage = <420>;
+
+   status = "okay";
+};
+
+_touchscreen {
+   vio-supply = <_s3>;
+};

-- 
2.44.0




[PATCH v2 2/3] dt-bindings: arm: qcom: Add Sony Xperia Z3

2024-03-14 Thread Luca Weiss
Add the compatible for this Sony smartphone.

Acked-by: Krzysztof Kozlowski 
Signed-off-by: Luca Weiss 
---
 Documentation/devicetree/bindings/arm/qcom.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/arm/qcom.yaml 
b/Documentation/devicetree/bindings/arm/qcom.yaml
index 1a5fb889a444..d6a7ee5e1d91 100644
--- a/Documentation/devicetree/bindings/arm/qcom.yaml
+++ b/Documentation/devicetree/bindings/arm/qcom.yaml
@@ -224,6 +224,7 @@ properties:
   - oneplus,bacon
   - samsung,klte
   - sony,xperia-castor
+  - sony,xperia-leo
   - const: qcom,msm8974pro
   - const: qcom,msm8974
 

-- 
2.44.0




[PATCH v2 1/3] ARM: dts: qcom: msm8974-sony-castor: Split into shinano-common

2024-03-14 Thread Luca Weiss
In preparation for adding the Sony Xperia Z3 smartphone, split the
common parts into shinano-common.dtsi.

No functional change intended.

Reviewed-by: Konrad Dybcio 
Signed-off-by: Luca Weiss 
---
 .../qcom-msm8974pro-sony-xperia-shinano-castor.dts | 863 +
 ...com-msm8974pro-sony-xperia-shinano-common.dtsi} | 155 +---
 2 files changed, 179 insertions(+), 839 deletions(-)

diff --git 
a/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts 
b/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts
dissimilarity index 74%
index 20f98a9e49ea..409d1798de34 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts
+++ b/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts
@@ -1,686 +1,177 @@
-// SPDX-License-Identifier: GPL-2.0
-#include "qcom-msm8974pro.dtsi"
-#include "pm8841.dtsi"
-#include "pm8941.dtsi"
-#include 
-#include 
-#include 
-
-/ {
-   model = "Sony Xperia Z2 Tablet";
-   compatible = "sony,xperia-castor", "qcom,msm8974pro", "qcom,msm8974";
-   chassis-type = "tablet";
-
-   aliases {
-   mmc0 = _1;
-   mmc1 = _2;
-   serial0 = _uart2;
-   serial1 = _uart1;
-   };
-
-   chosen {
-   stdout-path = "serial0:115200n8";
-   };
-
-   gpio-keys {
-   compatible = "gpio-keys";
-
-   pinctrl-0 = <_keys_pin_a>;
-   pinctrl-names = "default";
-
-   key-volume-down {
-   label = "volume_down";
-   gpios = <_gpios 2 GPIO_ACTIVE_LOW>;
-   linux,code = ;
-   debounce-interval = <15>;
-   };
-
-   key-volume-up {
-   label = "volume_up";
-   gpios = <_gpios 5 GPIO_ACTIVE_LOW>;
-   linux,code = ;
-   debounce-interval = <15>;
-   };
-   };
-
-   vreg_bl_vddio: lcd-backlight-vddio {
-   compatible = "regulator-fixed";
-   regulator-name = "vreg_bl_vddio";
-   regulator-min-microvolt = <315>;
-   regulator-max-microvolt = <315>;
-
-   gpio = < 69 0>;
-   enable-active-high;
-
-   vin-supply = <_s3>;
-   startup-delay-us = <7>;
-
-   pinctrl-0 = <_backlight_en_pin_a>;
-   pinctrl-names = "default";
-   };
-
-   vreg_vsp: lcd-dcdc-regulator {
-   compatible = "regulator-fixed";
-   regulator-name = "vreg_vsp";
-   regulator-min-microvolt = <560>;
-   regulator-max-microvolt = <560>;
-
-   gpio = <_gpios 20 GPIO_ACTIVE_HIGH>;
-   enable-active-high;
-
-   pinctrl-0 = <_dcdc_en_pin_a>;
-   pinctrl-names = "default";
-   };
-
-   vreg_boost: vreg-boost {
-   compatible = "regulator-fixed";
-
-   regulator-name = "vreg-boost";
-   regulator-min-microvolt = <315>;
-   regulator-max-microvolt = <315>;
-
-   regulator-always-on;
-   regulator-boot-on;
-
-   gpio = <_gpios 21 GPIO_ACTIVE_HIGH>;
-   enable-active-high;
-
-   pinctrl-names = "default";
-   pinctrl-0 = <_bypass_n_pin>;
-   };
-
-   vreg_vph_pwr: vreg-vph-pwr {
-   compatible = "regulator-fixed";
-   regulator-name = "vph-pwr";
-
-   regulator-min-microvolt = <360>;
-   regulator-max-microvolt = <360>;
-
-   regulator-always-on;
-   };
-
-   vreg_wlan: wlan-regulator {
-   compatible = "regulator-fixed";
-
-   regulator-name = "wl-reg";
-   regulator-min-microvolt = <330>;
-   regulator-max-microvolt = <330>;
-
-   gpio = <_gpios 18 GPIO_ACTIVE_HIGH>;
-   enable-active-high;
-
-   pinctrl-0 = <_regulator_pin>;
-   pinctrl-names = "default";
-   };
-};
-
-_uart2 {
-   status = "okay";
-};
-
-_i2c2 {
-   clock-frequency = <355000>;
-
-   status = "okay";
-
-   synaptics@2c {
-   compatible = "syna,rmi4-i2c";
-   reg = <0x2c>;
-
-   interrupt-parent = <>;
-   interrupts = <86 IRQ_TYPE_EDGE_FALLING>;
-
-   #address-cells = <1>;

[PATCH v2 0/3] Split sony-castor into shinano-common and add Sony Xperia Z3

2024-03-14 Thread Luca Weiss
Prepare for adding sony-leo dts by splitting common parts into a
separate dtsi file.

Then add the dts for Sony Xperia Z3.

Depends on:
https://lore.kernel.org/linux-arm-msm/20240306-castor-changes-v1-0-2286eaf85...@z3ntu.xyz/T/

Signed-off-by: Luca Weiss 
---
Changes in v2:
- Add leo dtb to Makefile
- Add newlines between the subnodes in the backlight node
- Pick up tags
- Link to v1: 
https://lore.kernel.org/r/20240310-shinano-common-v1-0-d64cd322e...@z3ntu.xyz

---
Luca Weiss (3):
  ARM: dts: qcom: msm8974-sony-castor: Split into shinano-common
  dt-bindings: arm: qcom: Add Sony Xperia Z3
  ARM: dts: qcom: Add Sony Xperia Z3 smartphone

 Documentation/devicetree/bindings/arm/qcom.yaml|   1 +
 arch/arm/boot/dts/qcom/Makefile|   1 +
 .../qcom-msm8974pro-sony-xperia-shinano-castor.dts | 551 +
 ...qcom-msm8974pro-sony-xperia-shinano-common.dtsi | 535 
 .../qcom-msm8974pro-sony-xperia-shinano-leo.dts|  44 ++
 5 files changed, 602 insertions(+), 530 deletions(-)
---
base-commit: bee52eeb37d8124a07711657d1650bf3b467e7dd
change-id: 20240310-shinano-common-093fe25fe3a1

Best regards,
-- 
Luca Weiss 




Re: [PATCH 0/2] Add Samsung Galaxy Note 3 support

2024-03-11 Thread Luca Weiss
On Montag, 11. März 2024 15:23:30 CET Rob Herring wrote:
> 
> On Sun, 10 Mar 2024 15:13:35 +0100, Luca Weiss wrote:
> > Add the dts for "hlte" which is a phablet from 2013.
> > 
> > Signed-off-by: Luca Weiss 
> > ---
> > Adam Honse (1):
> >   ARM: dts: qcom: msm8974: Add Samsung Galaxy Note 3
> > 
> > Luca Weiss (1):
> >   dt-bindings: arm: qcom: Add Samsung Galaxy Note 3
> > 
> >  Documentation/devicetree/bindings/arm/qcom.yaml|   1 +
> >  arch/arm/boot/dts/qcom/Makefile|   1 +
> >  .../boot/dts/qcom/qcom-msm8974-samsung-hlte.dts| 403 
> > +
> >  3 files changed, 405 insertions(+)
> > ---
> > base-commit: 90d35da658da8cff0d4ecbb5113f5fac9d00eb72
> > change-id: 20240310-samsung-hlte-78d1a287b0a8
> > 
> > Best regards,
> > --
> > Luca Weiss 
> > 
> > 
> > 
> 
> 
> My bot found new DTB warnings on the .dts files added or changed in this
> series.
> 
> Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings
> are fixed by another series. Ultimately, it is up to the platform
> maintainer whether these warnings are acceptable or not. No need to reply
> unless the platform maintainer has comments.
> 
> If you already ran DT checks and didn't see these error(s), then
> make sure dt-schema is up to date:
> 
>   pip3 install dtschema --upgrade
> 
> 
> New warnings running 'make CHECK_DTBS=y qcom/qcom-msm8974-samsung-hlte.dtb' 
> for 20240310-samsung-hlte-v1-0-e9b55bf98...@z3ntu.xyz:
> 
> arch/arm/boot/dts/qcom/qcom-msm8974-samsung-hlte.dtb: /: memory: False schema 
> does not allow {'device_type': ['memory'], 'reg': [[0, 0]]}
>   from schema $id: http://devicetree.org/schemas/root-node.yaml#
> arch/arm/boot/dts/qcom/qcom-msm8974-samsung-hlte.dtb: l2-cache: Unevaluated 
> properties are not allowed ('qcom,saw' was unexpected)
>   from schema $id: http://devicetree.org/schemas/cache.yaml#
> arch/arm/boot/dts/qcom/qcom-msm8974-samsung-hlte.dtb: idle-states: 'spc' does 
> not match any of the regexes: '^(cpu|cluster)-', 'pinctrl-[0-9]+'
>   from schema $id: http://devicetree.org/schemas/cpu/idle-states.yaml#
> arch/arm/boot/dts/qcom/qcom-msm8974-samsung-hlte.dtb: syscon@f9011000: 
> compatible: 'anyOf' conditional failed, one must be fixed:
>   ['syscon'] is too short
>   'syscon' is not one of ['allwinner,sun8i-a83t-system-controller', 
> 'allwinner,sun8i-h3-system-controller', 
> 'allwinner,sun8i-v3s-system-controller', 
> 'allwinner,sun50i-a64-system-controller', 'amd,pensando-elba-syscon', 
> 'brcm,cru-clkset', 'freecom,fsg-cs2-system-controller', 
> 'fsl,imx93-aonmix-ns-syscfg', 'fsl,imx93-wakeupmix-syscfg', 
> 'hisilicon,dsa-subctrl', 'hisilicon,hi6220-sramctrl', 
> 'hisilicon,pcie-sas-subctrl', 'hisilicon,peri-subctrl', 'hpe,gxp-sysreg', 
> 'intel,lgm-syscon', 'loongson,ls1b-syscon', 'loongson,ls1c-syscon', 
> 'marvell,armada-3700-usb2-host-misc', 'mediatek,mt8135-pctl-a-syscfg', 
> 'mediatek,mt8135-pctl-b-syscfg', 'mediatek,mt8365-syscfg', 
> 'microchip,lan966x-cpu-syscon', 'microchip,sparx5-cpu-syscon', 
> 'mstar,msc313-pmsleep', 'nuvoton,ma35d1-sys', 'nuvoton,wpcm450-shm', 
> 'rockchip,px30-qos', 'rockchip,rk3036-qos', 'rockchip,rk3066-qos', 
> 'rockchip,rk3128-qos', 'rockchip,rk3228-qos', 'rockchip,rk3288-qos', 
> 'rockchip,rk3368-qos', 'rockchip,rk3399-qos', 'rockchip,rk3568-qos', '
>  rockchip,rk3588-qos', 'rockchip,rv1126-qos', 'starfive,jh7100-sysmain', 
> 'ti,am62-usb-phy-ctrl', 'ti,am654-dss-oldi-io-ctrl', 'ti,am654-serdes-ctrl', 
> 'ti,j784s4-pcie-ctrl']
>   from schema $id: http://devicetree.org/schemas/mfd/syscon.yaml#

Unfortunately all existing warnings from the .dtsi.

Regards
Luca

[PATCH 2/2] ARM: dts: qcom: msm8974: Add Samsung Galaxy Note 3

2024-03-10 Thread Luca Weiss
From: Adam Honse 

Add the devicetree for this "phablet" using the Snapdragon 800 SoC.

Signed-off-by: Adam Honse 
[l...@z3ntu.xyz: clean up, prepare for upstream]
Signed-off-by: Luca Weiss 
---
 arch/arm/boot/dts/qcom/Makefile|   1 +
 .../boot/dts/qcom/qcom-msm8974-samsung-hlte.dts| 403 +
 2 files changed, 404 insertions(+)

diff --git a/arch/arm/boot/dts/qcom/Makefile b/arch/arm/boot/dts/qcom/Makefile
index 9cc1e14e6cd0..845af12d15a2 100644
--- a/arch/arm/boot/dts/qcom/Makefile
+++ b/arch/arm/boot/dts/qcom/Makefile
@@ -39,6 +39,7 @@ dtb-$(CONFIG_ARCH_QCOM) += \
qcom-msm8960-cdp.dtb \
qcom-msm8960-samsung-expressatt.dtb \
qcom-msm8974-lge-nexus5-hammerhead.dtb \
+   qcom-msm8974-samsung-hlte.dtb \
qcom-msm8974-sony-xperia-rhine-amami.dtb \
qcom-msm8974-sony-xperia-rhine-honami.dtb \
qcom-msm8974pro-fairphone-fp2.dtb \
diff --git a/arch/arm/boot/dts/qcom/qcom-msm8974-samsung-hlte.dts 
b/arch/arm/boot/dts/qcom/qcom-msm8974-samsung-hlte.dts
new file mode 100644
index ..e03227a49b67
--- /dev/null
+++ b/arch/arm/boot/dts/qcom/qcom-msm8974-samsung-hlte.dts
@@ -0,0 +1,403 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "qcom-msm8974.dtsi"
+#include "pm8841.dtsi"
+#include "pm8941.dtsi"
+#include 
+#include 
+#include 
+
+/ {
+   model = "Samsung Galaxy Note 3";
+   compatible = "samsung,hlte", "qcom,msm8974";
+   chassis-type = "handset";
+
+   aliases {
+   mmc0 = _1; /* SDC1 eMMC slot */
+   mmc1 = _3; /* SDC3 SD card slot */
+   serial0 = _uart1;
+   };
+
+   chosen {
+   stdout-path = "serial0:115200n8";
+   };
+
+   gpio-keys {
+   compatible = "gpio-keys";
+
+   pinctrl-names = "default";
+   pinctrl-0 = <_keys_pin_a>;
+
+   key-home {
+   label = "home_key";
+   gpios = <_gpios 3 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   wakeup-source;
+   debounce-interval = <15>;
+   };
+
+   key-volume-down {
+   label = "volume_down";
+   gpios = <_gpios 2 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   debounce-interval = <15>;
+   };
+
+   key-volume-up {
+   label = "volume_up";
+   gpios = <_gpios 5 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   debounce-interval = <15>;
+   };
+   };
+
+   touch_ldo: regulator-touch {
+   compatible = "regulator-fixed";
+   regulator-name = "touch-ldo";
+
+   gpio = <_gpios 9 GPIO_ACTIVE_HIGH>;
+   enable-active-high;
+   regulator-boot-on;
+
+   pinctrl-names = "default";
+   pinctrl-0 = <_ldo_pin>;
+   };
+};
+
+_i2c2 {
+   status = "okay";
+
+   touchscreen@20 {
+   compatible = "syna,rmi4-i2c";
+   reg = <0x20>;
+
+   interrupt-parent = <_gpios>;
+   interrupts = <30 IRQ_TYPE_EDGE_FALLING>;
+
+   vdd-supply = <_l10>;
+   vio-supply = <_ldo>;
+
+   pinctrl-names = "default";
+   pinctrl-0 = <_pin>;
+
+   syna,startup-delay-ms = <100>;
+
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   rmi4-f01@1 {
+   reg = <0x1>;
+   syna,nosleep-mode = <1>;
+   };
+
+   rmi4-f12@12 {
+   reg = <0x12>;
+   syna,sensor-type = <1>;
+   };
+   };
+};
+
+_i2c6 {
+   status = "okay";
+
+   fuelgauge@36 {
+   compatible = "maxim,max17048";
+   reg = <0x36>;
+
+   maxim,double-soc;
+   maxim,rcomp = /bits/ 8 <0x56>;
+
+   interrupt-parent = <_gpios>;
+   interrupts = <26 IRQ_TYPE_EDGE_FALLING>;
+
+   pinctrl-names = "default";
+   pinctrl-0 = <_pin>;
+   };
+};
+
+_uart2 {
+   status = "okay";
+};
+
+_gpios {
+   gpio_keys_pin_a: gpio-keys-active-state {
+   pins = "gpio2", "gpio3", "gpio5";
+   function = "normal";
+   bias-pull-up;
+   power-source = ;
+   };
+
+   fuelgauge_pin: fuelgauge-int

[PATCH 1/2] dt-bindings: arm: qcom: Add Samsung Galaxy Note 3

2024-03-10 Thread Luca Weiss
Add the compatible for this Samsung smartphone ("phablet" as it was
named in that era).

Signed-off-by: Luca Weiss 
---
 Documentation/devicetree/bindings/arm/qcom.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/arm/qcom.yaml 
b/Documentation/devicetree/bindings/arm/qcom.yaml
index 1a5fb889a444..57182bfa27ee 100644
--- a/Documentation/devicetree/bindings/arm/qcom.yaml
+++ b/Documentation/devicetree/bindings/arm/qcom.yaml
@@ -214,6 +214,7 @@ properties:
   - items:
   - enum:
   - lge,hammerhead
+  - samsung,hlte
   - sony,xperia-amami
   - sony,xperia-honami
   - const: qcom,msm8974

-- 
2.44.0




[PATCH 0/2] Add Samsung Galaxy Note 3 support

2024-03-10 Thread Luca Weiss
Add the dts for "hlte" which is a phablet from 2013.

Signed-off-by: Luca Weiss 
---
Adam Honse (1):
  ARM: dts: qcom: msm8974: Add Samsung Galaxy Note 3

Luca Weiss (1):
  dt-bindings: arm: qcom: Add Samsung Galaxy Note 3

 Documentation/devicetree/bindings/arm/qcom.yaml|   1 +
 arch/arm/boot/dts/qcom/Makefile|   1 +
 .../boot/dts/qcom/qcom-msm8974-samsung-hlte.dts| 403 +
 3 files changed, 405 insertions(+)
---
base-commit: 90d35da658da8cff0d4ecbb5113f5fac9d00eb72
change-id: 20240310-samsung-hlte-78d1a287b0a8

Best regards,
-- 
Luca Weiss 




Re: [PATCH 3/3] ARM: dts: qcom: Add Sony Xperia Z3 smartphone

2024-03-10 Thread Luca Weiss
On Sonntag, 10. März 2024 12:41:09 CET Luca Weiss wrote:
> Add the dts for the Xperia Z3 smartphone which is based on Sony's
> shinano platform, so at the moment there's little device-specific dts to
> add on top of the common parts.
> 
> Signed-off-by: Luca Weiss 
> ---
>  .../qcom-msm8974pro-sony-xperia-shinano-leo.dts| 44 +++
+++
>  1 file changed, 44 insertions(+)

Of course I forgot to add the dtb to the Makefile...

Apparently "make qcom/qcom-msm8974pro-sony-xperia-shinano-leo.dtb" doesn't 
care about whether the dtb is in the Makefile so I didn't notice.

Will fix in v2 but I'm going to wait for any comments on this or the other 
patches for at least a day or so.

Regards
Luca

> 
> diff --git a/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-
leo.dts b/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-leo.dts
> new file mode 100644
> index ..1ed6e1cc21d5
> --- /dev/null
> +++ b/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-leo.dts
> @@ -0,0 +1,44 @@
> +// SPDX-License-Identifier: GPL-2.0
> +#include "qcom-msm8974pro-sony-xperia-shinano-common.dtsi"
> +
> +/ {
> + model = "Sony Xperia Z3";
> + compatible = "sony,xperia-leo", "qcom,msm8974pro", "qcom,msm8974";
> + chassis-type = "handset";
> +
> + gpio-keys {
> + key-camera-snapshot {
> + label = "camera_snapshot";
> + gpios = <_gpios 3 GPIO_ACTIVE_LOW>;
> + linux,code = ;
> + debounce-interval = <15>;
> + };
> +
> + key-camera-focus {
> + label = "camera_focus";
> + gpios = <_gpios 4 GPIO_ACTIVE_LOW>;
> + linux,code = ;
> + debounce-interval = <15>;
> + };
> + };
> +};
> +
> +_keys_pin_a {
> + pins = "gpio2", "gpio3", "gpio4", "gpio5";
> +};
> +
> + {
> + usb-charge-current-limit = <150>;
> + qcom,fast-charge-safe-current = <300>;
> + qcom,fast-charge-current-limit = <215>;
> + qcom,fast-charge-safe-voltage = <440>;
> + qcom,fast-charge-high-threshold-voltage = <435>;
> + qcom,auto-recharge-threshold-voltage = <428>;
> + qcom,minimum-input-voltage = <420>;
> +
> + status = "okay";
> +};
> +
> +_touchscreen {
> + vio-supply = <_s3>;
> +};
> 
> 







[PATCH 2/3] dt-bindings: arm: qcom: Add Sony Xperia Z3

2024-03-10 Thread Luca Weiss
Add the compatible for this Sony smartphone.

Signed-off-by: Luca Weiss 
---
 Documentation/devicetree/bindings/arm/qcom.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/arm/qcom.yaml 
b/Documentation/devicetree/bindings/arm/qcom.yaml
index 1a5fb889a444..d6a7ee5e1d91 100644
--- a/Documentation/devicetree/bindings/arm/qcom.yaml
+++ b/Documentation/devicetree/bindings/arm/qcom.yaml
@@ -224,6 +224,7 @@ properties:
   - oneplus,bacon
   - samsung,klte
   - sony,xperia-castor
+  - sony,xperia-leo
   - const: qcom,msm8974pro
   - const: qcom,msm8974
 

-- 
2.44.0




[PATCH 3/3] ARM: dts: qcom: Add Sony Xperia Z3 smartphone

2024-03-10 Thread Luca Weiss
Add the dts for the Xperia Z3 smartphone which is based on Sony's
shinano platform, so at the moment there's little device-specific dts to
add on top of the common parts.

Signed-off-by: Luca Weiss 
---
 .../qcom-msm8974pro-sony-xperia-shinano-leo.dts| 44 ++
 1 file changed, 44 insertions(+)

diff --git a/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-leo.dts 
b/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-leo.dts
new file mode 100644
index ..1ed6e1cc21d5
--- /dev/null
+++ b/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-leo.dts
@@ -0,0 +1,44 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "qcom-msm8974pro-sony-xperia-shinano-common.dtsi"
+
+/ {
+   model = "Sony Xperia Z3";
+   compatible = "sony,xperia-leo", "qcom,msm8974pro", "qcom,msm8974";
+   chassis-type = "handset";
+
+   gpio-keys {
+   key-camera-snapshot {
+   label = "camera_snapshot";
+   gpios = <_gpios 3 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   debounce-interval = <15>;
+   };
+
+   key-camera-focus {
+   label = "camera_focus";
+   gpios = <_gpios 4 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   debounce-interval = <15>;
+   };
+   };
+};
+
+_keys_pin_a {
+   pins = "gpio2", "gpio3", "gpio4", "gpio5";
+};
+
+ {
+   usb-charge-current-limit = <150>;
+   qcom,fast-charge-safe-current = <300>;
+   qcom,fast-charge-current-limit = <215>;
+   qcom,fast-charge-safe-voltage = <440>;
+   qcom,fast-charge-high-threshold-voltage = <435>;
+   qcom,auto-recharge-threshold-voltage = <428>;
+   qcom,minimum-input-voltage = <420>;
+
+   status = "okay";
+};
+
+_touchscreen {
+   vio-supply = <_s3>;
+};

-- 
2.44.0




[PATCH 1/3] ARM: dts: qcom: msm8974-sony-castor: Split into shinano-common

2024-03-10 Thread Luca Weiss
In preparation for adding the Sony Xperia Z3 smartphone, split the
common parts into shinano-common.dtsi.

No functional change intended.

Signed-off-by: Luca Weiss 
---
 .../qcom-msm8974pro-sony-xperia-shinano-castor.dts | 853 -
 ...com-msm8974pro-sony-xperia-shinano-common.dtsi} | 155 +---
 2 files changed, 169 insertions(+), 839 deletions(-)

diff --git 
a/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts 
b/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts
dissimilarity index 74%
index 20f98a9e49ea..727ad5c53e7f 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts
+++ b/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts
@@ -1,686 +1,167 @@
-// SPDX-License-Identifier: GPL-2.0
-#include "qcom-msm8974pro.dtsi"
-#include "pm8841.dtsi"
-#include "pm8941.dtsi"
-#include 
-#include 
-#include 
-
-/ {
-   model = "Sony Xperia Z2 Tablet";
-   compatible = "sony,xperia-castor", "qcom,msm8974pro", "qcom,msm8974";
-   chassis-type = "tablet";
-
-   aliases {
-   mmc0 = _1;
-   mmc1 = _2;
-   serial0 = _uart2;
-   serial1 = _uart1;
-   };
-
-   chosen {
-   stdout-path = "serial0:115200n8";
-   };
-
-   gpio-keys {
-   compatible = "gpio-keys";
-
-   pinctrl-0 = <_keys_pin_a>;
-   pinctrl-names = "default";
-
-   key-volume-down {
-   label = "volume_down";
-   gpios = <_gpios 2 GPIO_ACTIVE_LOW>;
-   linux,code = ;
-   debounce-interval = <15>;
-   };
-
-   key-volume-up {
-   label = "volume_up";
-   gpios = <_gpios 5 GPIO_ACTIVE_LOW>;
-   linux,code = ;
-   debounce-interval = <15>;
-   };
-   };
-
-   vreg_bl_vddio: lcd-backlight-vddio {
-   compatible = "regulator-fixed";
-   regulator-name = "vreg_bl_vddio";
-   regulator-min-microvolt = <315>;
-   regulator-max-microvolt = <315>;
-
-   gpio = < 69 0>;
-   enable-active-high;
-
-   vin-supply = <_s3>;
-   startup-delay-us = <7>;
-
-   pinctrl-0 = <_backlight_en_pin_a>;
-   pinctrl-names = "default";
-   };
-
-   vreg_vsp: lcd-dcdc-regulator {
-   compatible = "regulator-fixed";
-   regulator-name = "vreg_vsp";
-   regulator-min-microvolt = <560>;
-   regulator-max-microvolt = <560>;
-
-   gpio = <_gpios 20 GPIO_ACTIVE_HIGH>;
-   enable-active-high;
-
-   pinctrl-0 = <_dcdc_en_pin_a>;
-   pinctrl-names = "default";
-   };
-
-   vreg_boost: vreg-boost {
-   compatible = "regulator-fixed";
-
-   regulator-name = "vreg-boost";
-   regulator-min-microvolt = <315>;
-   regulator-max-microvolt = <315>;
-
-   regulator-always-on;
-   regulator-boot-on;
-
-   gpio = <_gpios 21 GPIO_ACTIVE_HIGH>;
-   enable-active-high;
-
-   pinctrl-names = "default";
-   pinctrl-0 = <_bypass_n_pin>;
-   };
-
-   vreg_vph_pwr: vreg-vph-pwr {
-   compatible = "regulator-fixed";
-   regulator-name = "vph-pwr";
-
-   regulator-min-microvolt = <360>;
-   regulator-max-microvolt = <360>;
-
-   regulator-always-on;
-   };
-
-   vreg_wlan: wlan-regulator {
-   compatible = "regulator-fixed";
-
-   regulator-name = "wl-reg";
-   regulator-min-microvolt = <330>;
-   regulator-max-microvolt = <330>;
-
-   gpio = <_gpios 18 GPIO_ACTIVE_HIGH>;
-   enable-active-high;
-
-   pinctrl-0 = <_regulator_pin>;
-   pinctrl-names = "default";
-   };
-};
-
-_uart2 {
-   status = "okay";
-};
-
-_i2c2 {
-   clock-frequency = <355000>;
-
-   status = "okay";
-
-   synaptics@2c {
-   compatible = "syna,rmi4-i2c";
-   reg = <0x2c>;
-
-   interrupt-parent = <>;
-   interrupts = <86 IRQ_TYPE_EDGE_FALLING>;
-
-   #address-cells = <1>;
-   #

[PATCH 0/3] Split sony-castor into shinano-common and add Sony Xperia Z3

2024-03-10 Thread Luca Weiss
Prepare for adding sony-leo dts by splitting common parts into a
separate dtsi file.

Then add the dts for Sony Xperia Z3.

Depends on:
https://lore.kernel.org/linux-arm-msm/20240306-castor-changes-v1-0-2286eaf85...@z3ntu.xyz/T/

Signed-off-by: Luca Weiss 
---
Luca Weiss (3):
  ARM: dts: qcom: msm8974-sony-castor: Split into shinano-common
  dt-bindings: arm: qcom: Add Sony Xperia Z3
  ARM: dts: qcom: Add Sony Xperia Z3 smartphone

 Documentation/devicetree/bindings/arm/qcom.yaml|   1 +
 .../qcom-msm8974pro-sony-xperia-shinano-castor.dts | 541 +
 ...qcom-msm8974pro-sony-xperia-shinano-common.dtsi | 535 
 .../qcom-msm8974pro-sony-xperia-shinano-leo.dts|  44 ++
 4 files changed, 591 insertions(+), 530 deletions(-)
---
base-commit: bee52eeb37d8124a07711657d1650bf3b467e7dd
change-id: 20240310-shinano-common-093fe25fe3a1

Best regards,
-- 
Luca Weiss 




[PATCH 3/5] ARM: dts: qcom: msm8974pro-castor: Remove camera button definitions

2024-03-05 Thread Luca Weiss
>From what I can tell, the camera buttons are not part of Z2 Tablet
hardware even though other devices based on 'shinano' do have them.

Fixes: ab80661883de ("ARM: dts: qcom: msm8974: Add Sony Xperia Z2 Tablet")
Signed-off-by: Luca Weiss 
---
 .../dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts  | 12 
 1 file changed, 12 deletions(-)

diff --git 
a/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts 
b/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts
index da554f72528a..97b55bda9189 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts
+++ b/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts
@@ -34,18 +34,6 @@ key-volume-down {
linux,code = ;
};
 
-   key-camera-snapshot {
-   label = "camera_snapshot";
-   gpios = <_gpios 3 GPIO_ACTIVE_LOW>;
-   linux,code = ;
-   };
-
-   key-camera-focus {
-   label = "camera_focus";
-   gpios = <_gpios 4 GPIO_ACTIVE_LOW>;
-   linux,code = ;
-   };
-
key-volume-up {
label = "volume_up";
gpios = <_gpios 5 GPIO_ACTIVE_LOW>;

-- 
2.44.0




[PATCH 1/5] ARM: dts: qcom: msm8974pro-castor: Clean up formatting

2024-03-05 Thread Luca Weiss
Clean up some easy things do prepare the dts for further changes.

* Move pinctrl-names below pinctrl-*
* Move status as last property
* Remove default linux,input-type value

Signed-off-by: Luca Weiss 
---
 .../qcom-msm8974pro-sony-xperia-shinano-castor.dts | 65 +-
 1 file changed, 27 insertions(+), 38 deletions(-)

diff --git 
a/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts 
b/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts
index ee94741a26ed..2db2ddf00580 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts
+++ b/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts
@@ -23,34 +23,30 @@ chosen {
gpio-keys {
compatible = "gpio-keys";
 
-   pinctrl-names = "default";
pinctrl-0 = <_keys_pin_a>;
+   pinctrl-names = "default";
 
key-volume-down {
label = "volume_down";
gpios = <_gpios 2 GPIO_ACTIVE_LOW>;
-   linux,input-type = <1>;
linux,code = ;
};
 
key-camera-snapshot {
label = "camera_snapshot";
gpios = <_gpios 3 GPIO_ACTIVE_LOW>;
-   linux,input-type = <1>;
linux,code = ;
};
 
key-camera-focus {
label = "camera_focus";
gpios = <_gpios 4 GPIO_ACTIVE_LOW>;
-   linux,input-type = <1>;
linux,code = ;
};
 
key-volume-up {
label = "volume_up";
gpios = <_gpios 5 GPIO_ACTIVE_LOW>;
-   linux,input-type = <1>;
linux,code = ;
};
};
@@ -67,8 +63,8 @@ vreg_bl_vddio: lcd-backlight-vddio {
vin-supply = <_s3>;
startup-delay-us = <7>;
 
-   pinctrl-names = "default";
pinctrl-0 = <_backlight_en_pin_a>;
+   pinctrl-names = "default";
};
 
vreg_vsp: lcd-dcdc-regulator {
@@ -80,8 +76,8 @@ vreg_vsp: lcd-dcdc-regulator {
gpio = <_gpios 20 GPIO_ACTIVE_HIGH>;
enable-active-high;
 
-   pinctrl-names = "default";
pinctrl-0 = <_dcdc_en_pin_a>;
+   pinctrl-names = "default";
};
 
vreg_boost: vreg-boost {
@@ -121,8 +117,8 @@ vreg_wlan: wlan-regulator {
gpio = <_gpios 18 GPIO_ACTIVE_HIGH>;
enable-active-high;
 
-   pinctrl-names = "default";
pinctrl-0 = <_regulator_pin>;
+   pinctrl-names = "default";
};
 };
 
@@ -131,9 +127,10 @@ _uart2 {
 };
 
 _i2c2 {
-   status = "okay";
clock-frequency = <355000>;
 
+   status = "okay";
+
synaptics@2c {
compatible = "syna,rmi4-i2c";
reg = <0x2c>;
@@ -147,8 +144,8 @@ synaptics@2c {
vdd-supply = <_l22>;
vio-supply = <_lvs3>;
 
-   pinctrl-names = "default";
pinctrl-0 = <_int_pin>;
+   pinctrl-names = "default";
 
syna,startup-delay-ms = <100>;
 
@@ -166,9 +163,10 @@ rmi4-f11@11 {
 };
 
 _i2c5 {
-   status = "okay";
clock-frequency = <355000>;
 
+   status = "okay";
+
lp8566_wled: backlight@2c {
compatible = "ti,lp8556";
reg = <0x2c>;
@@ -232,8 +230,8 @@ bluetooth {
compatible = "brcm,bcm43438-bt";
max-speed = <300>;
 
-   pinctrl-names = "default";
pinctrl-0 = <_host_wake_pin>, <_dev_wake_pin>, 
<_reg_on_pin>;
+   pinctrl-names = "default";
 
host-wakeup-gpios = < 95 GPIO_ACTIVE_HIGH>;
device-wakeup-gpios = < 96 GPIO_ACTIVE_HIGH>;
@@ -242,17 +240,16 @@ bluetooth {
 };
 
 _coincell {
-   status = "okay";
-
qcom,rset-ohms = <2100>;
qcom,vset-millivolts = <3000>;
+
+   status = "okay";
 };
 
 _gpios {
gpio_keys_pin_a: gpio-keys-active-state {
pins = "gpio2", "gpio5";
function = "normal";
-
bias-pull-up;
power-source = ;
};
@@ -260,7 +257,6 @@ gpio_keys_pin_a: gpio-keys-active-state {
   

[PATCH 4/5] ARM: dts: qcom: msm8974pro-castor: Add debounce-interval for keys

2024-03-05 Thread Luca Weiss
Set the debounce-interval for the GPIO keys.

Signed-off-by: Luca Weiss 
---
 arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts 
b/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts
index 97b55bda9189..c9f74bf2f8bd 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts
+++ b/arch/arm/boot/dts/qcom/qcom-msm8974pro-sony-xperia-shinano-castor.dts
@@ -32,12 +32,14 @@ key-volume-down {
label = "volume_down";
gpios = <_gpios 2 GPIO_ACTIVE_LOW>;
linux,code = ;
+   debounce-interval = <15>;
};
 
key-volume-up {
label = "volume_up";
gpios = <_gpios 5 GPIO_ACTIVE_LOW>;
linux,code = ;
+   debounce-interval = <15>;
};
};
 

-- 
2.44.0




[PATCH 0/5] Some devicetree cleanup for MSM8974 Sony Xperia Z2 Tablet

2024-03-05 Thread Luca Weiss
The sony-castor dts has been around for a while, clean up some things to
prepare for further changes including the introduction of the
shinano-based Sony Xperia Z3.

Signed-off-by: Luca Weiss 
---
Luca Weiss (5):
  ARM: dts: qcom: msm8974pro-castor: Clean up formatting
  ARM: dts: qcom: msm8974pro-castor: Add mmc aliases
  ARM: dts: qcom: msm8974pro-castor: Remove camera button definitions
  ARM: dts: qcom: msm8974pro-castor: Add debounce-interval for keys
  ARM: dts: qcom: msm8974pro-castor: Rename wifi node name

 .../qcom-msm8974pro-sony-xperia-shinano-castor.dts | 83 +-
 1 file changed, 32 insertions(+), 51 deletions(-)
---
base-commit: 2e397253aae928c6d318beb18c05bc2236f69a8a
change-id: 20240305-castor-changes-bc6785ba8458

Best regards,
-- 
Luca Weiss 




  1   2   3   4   5   >