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 




[PATCH 2/5] ARM: dts: qcom: msm8974pro-castor: Add mmc aliases

2024-03-05 Thread Luca Weiss
Add the mmc0 & mmc1 aliases to make sure internal storage always becomes
/dev/mmcblk0 and SD card becomes /dev/mmcblk1

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 2db2ddf00580..da554f72528a 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
@@ -12,6 +12,8 @@ / {
chassis-type = "tablet";
 
aliases {
+   mmc0 = _1;
+   mmc1 = _2;
serial0 = _uart2;
serial1 = _uart1;
};

-- 
2.44.0




[PATCH 5/5] ARM: dts: qcom: msm8974pro-castor: Rename wifi node name

2024-03-05 Thread Luca Weiss
Give the wifi node a generic node name 'wifi'.

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

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 c9f74bf2f8bd..20f98a9e49ea 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
@@ -547,7 +547,7 @@ _3 {
 
status = "okay";
 
-   bcrmf@1 {
+   wifi@1 {
compatible = "brcm,bcm4339-fmac", "brcm,bcm4329-fmac";
reg = <1>;
 

-- 
2.44.0




[PATCH] arm64: dts: qcom: sdm632-fairphone-fp3: enable USB-C port handling

2024-02-20 Thread Luca Weiss
Add the definition for the USB-C connector found on this phone and hook
up the relevant bits. This enables USB role switching.

Signed-off-by: Luca Weiss 
---
 arch/arm64/boot/dts/qcom/msm8953.dtsi | 14 ++
 arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts | 31 +--
 2 files changed, 43 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/msm8953.dtsi 
b/arch/arm64/boot/dts/qcom/msm8953.dtsi
index 383657407c6f..6726d15c38c3 100644
--- a/arch/arm64/boot/dts/qcom/msm8953.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8953.dtsi
@@ -1330,6 +1330,20 @@ usb3_dwc3: usb@700 {
snps,hird-threshold = /bits/ 8 <0x00>;
 
maximum-speed = "high-speed";
+
+   usb-role-switch;
+
+   ports {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   port@0 {
+   reg = <0>;
+
+   usb_dwc3_hs: endpoint {
+   };
+   };
+   };
};
};
 
diff --git a/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts 
b/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts
index c49a196189e3..2a65849f0da2 100644
--- a/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts
+++ b/arch/arm64/boot/dts/qcom/sdm632-fairphone-fp3.dts
@@ -162,6 +162,33 @@ led@3 {
};
 };
 
+_typec {
+   status = "okay";
+
+   connector {
+   compatible = "usb-c-connector";
+
+   power-role = "dual";
+   data-role = "dual";
+   self-powered;
+
+   typec-power-opmode = "default";
+   pd-disable;
+
+   port {
+   pmi632_hs_in: endpoint {
+   remote-endpoint = <_dwc3_hs>;
+   };
+   };
+   };
+};
+
+_vbus {
+   regulator-min-microamp = <50>;
+   regulator-max-microamp = <100>;
+   status = "okay";
+};
+
 _1 {
status = "okay";
vmmc-supply = <_l8>;
@@ -286,8 +313,8 @@  {
status = "okay";
 };
 
-_dwc3 {
-   dr_mode = "peripheral";
+_dwc3_hs {
+   remote-endpoint = <_hs_in>;
 };
 
  {

---
base-commit: 103eb8e019aefd616735200ce46833bc74cfe132
change-id: 20240220-fp3-typec-25eb002db8b5

Best regards,
-- 
Luca Weiss 




[PATCH] arm64: dts: qcom: Fix type of "wdog" IRQs for remoteprocs

2024-02-19 Thread Luca Weiss
The code in qcom_q6v5_init() requests the "wdog" IRQ as
IRQF_TRIGGER_RISING. If dt defines the interrupt type as LEVEL_HIGH then
the driver will have issues getting the IRQ again after probe deferral
with an error like:

  irq: type mismatch, failed to map hwirq-14 for interrupt-controller@b22!

Fix that by updating the devicetrees to use IRQ_TYPE_EDGE_RISING for
these interrupts, as is already used in most dt's. Also the driver was
already using the interrupts with that type.

Signed-off-by: Luca Weiss 
---
See also this thread:
https://lore.kernel.org/linux-arm-msm/efecb4cf-e42b-40fb-aa68-374335296...@linaro.org/
---
 arch/arm64/boot/dts/qcom/sc7280.dtsi   | 4 ++--
 arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 6 +++---
 arch/arm64/boot/dts/qcom/sm6350.dtsi   | 4 ++--
 arch/arm64/boot/dts/qcom/sm6375.dtsi   | 2 +-
 arch/arm64/boot/dts/qcom/sm8250.dtsi   | 6 +++---
 5 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi 
b/arch/arm64/boot/dts/qcom/sc7280.dtsi
index c31a09bac4ed..8379ca283d52 100644
--- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
@@ -3707,7 +3707,7 @@ remoteproc_adsp: remoteproc@370 {
compatible = "qcom,sc7280-adsp-pas";
reg = <0 0x0370 0 0x100>;
 
-   interrupts-extended = < 6 IRQ_TYPE_LEVEL_HIGH>,
+   interrupts-extended = < 6 IRQ_TYPE_EDGE_RISING>,
  <_smp2p_in 0 
IRQ_TYPE_EDGE_RISING>,
  <_smp2p_in 1 
IRQ_TYPE_EDGE_RISING>,
  <_smp2p_in 2 
IRQ_TYPE_EDGE_RISING>,
@@ -3944,7 +3944,7 @@ remoteproc_cdsp: remoteproc@a30 {
compatible = "qcom,sc7280-cdsp-pas";
reg = <0 0x0a30 0 0x1>;
 
-   interrupts-extended = < GIC_SPI 578 
IRQ_TYPE_LEVEL_HIGH>,
+   interrupts-extended = < GIC_SPI 578 
IRQ_TYPE_EDGE_RISING>,
  <_smp2p_in 0 
IRQ_TYPE_EDGE_RISING>,
  <_smp2p_in 1 
IRQ_TYPE_EDGE_RISING>,
  <_smp2p_in 2 
IRQ_TYPE_EDGE_RISING>,
diff --git a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi 
b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
index a5b194813079..c9058c7fc1a3 100644
--- a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
@@ -2641,7 +2641,7 @@ remoteproc_adsp: remoteproc@300 {
compatible = "qcom,sc8280xp-adsp-pas";
reg = <0 0x0300 0 0x100>;
 
-   interrupts-extended = < GIC_SPI 162 
IRQ_TYPE_LEVEL_HIGH>,
+   interrupts-extended = < GIC_SPI 162 
IRQ_TYPE_EDGE_RISING>,
  <_adsp_in 0 
IRQ_TYPE_EDGE_RISING>,
  <_adsp_in 1 
IRQ_TYPE_EDGE_RISING>,
  <_adsp_in 2 
IRQ_TYPE_EDGE_RISING>,
@@ -4977,7 +4977,7 @@ remoteproc_nsp0: remoteproc@1b30 {
compatible = "qcom,sc8280xp-nsp0-pas";
reg = <0 0x1b30 0 0x100>;
 
-   interrupts-extended = < GIC_SPI 578 
IRQ_TYPE_LEVEL_HIGH>,
+   interrupts-extended = < GIC_SPI 578 
IRQ_TYPE_EDGE_RISING>,
  <_nsp0_in 0 
IRQ_TYPE_EDGE_RISING>,
  <_nsp0_in 1 
IRQ_TYPE_EDGE_RISING>,
  <_nsp0_in 2 
IRQ_TYPE_EDGE_RISING>,
@@ -5108,7 +5108,7 @@ remoteproc_nsp1: remoteproc@2130 {
compatible = "qcom,sc8280xp-nsp1-pas";
reg = <0 0x2130 0 0x100>;
 
-   interrupts-extended = < GIC_SPI 887 
IRQ_TYPE_LEVEL_HIGH>,
+   interrupts-extended = < GIC_SPI 887 
IRQ_TYPE_EDGE_RISING>,
  <_nsp1_in 0 
IRQ_TYPE_EDGE_RISING>,
  <_nsp1_in 1 
IRQ_TYPE_EDGE_RISING>,
  <_nsp1_in 2 
IRQ_TYPE_EDGE_RISING>,
diff --git a/arch/arm64/boot/dts/qcom/sm6350.dtsi 
b/arch/arm64/boot/dts/qcom/sm6350.dtsi
index 24bcec3366ef..0be053555602 100644
--- a/arch/arm64/boot/dts/qcom/sm6350.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm6350.dtsi
@@ -1252,7 +1252,7 @@ adsp: remoteproc@300 {
compatible = "qcom,sm6350-adsp-pas";
reg = <0 0x0300 0 0x100>;
 
-   inte

[PATCH v2 2/3] clk: qcom: hfpll: Add QCS404-specific compatible

2024-02-18 Thread Luca Weiss
It doesn't appear that the configuration is for the HFPLL is generic, so
add a qcs404-specific compatible and rename the existing struct to
qcs404.

Keep qcom,hfpll in the driver for compatibility with old dtbs.

Signed-off-by: Luca Weiss 
---
 drivers/clk/qcom/hfpll.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/qcom/hfpll.c b/drivers/clk/qcom/hfpll.c
index dac27e31ef60..b0b0cb074b4a 100644
--- a/drivers/clk/qcom/hfpll.c
+++ b/drivers/clk/qcom/hfpll.c
@@ -14,7 +14,7 @@
 #include "clk-regmap.h"
 #include "clk-hfpll.h"
 
-static const struct hfpll_data hdata = {
+static const struct hfpll_data qcs404 = {
.mode_reg = 0x00,
.l_reg = 0x04,
.m_reg = 0x08,
@@ -84,10 +84,12 @@ static const struct hfpll_data msm8976_cci = {
 };
 
 static const struct of_device_id qcom_hfpll_match_table[] = {
-   { .compatible = "qcom,hfpll", .data =  },
{ .compatible = "qcom,msm8976-hfpll-a53", .data = _a53 },
{ .compatible = "qcom,msm8976-hfpll-a72", .data = _a72 },
{ .compatible = "qcom,msm8976-hfpll-cci", .data = _cci },
+   { .compatible = "qcom,qcs404-hfpll", .data =  },
+   /* Deprecated in bindings */
+   { .compatible = "qcom,hfpll", .data =  },
{ }
 };
 MODULE_DEVICE_TABLE(of, qcom_hfpll_match_table);

-- 
2.43.2




[PATCH v2 1/3] dt-bindings: clock: qcom,hfpll: Convert to YAML

2024-02-18 Thread Luca Weiss
Convert the .txt documentation to .yaml with some adjustments.

* APQ8064/IPQ8064/MSM8960 compatibles are dropped since their HFPLLs are
  a part of GCC so there is no need for a separate compat entry.
* Change the MSM8974 compatible to follow the updated naming schema.
  Theis compatible is not used upstream yet.
* Add qcs404-hfpll. QCS404 currently uses qcom,hfpll. Mark that as
  deprecated since every SoC appears to need different driver data so
  "qcom,hfpll" makes no sense to keep

Signed-off-by: Luca Weiss 
---
 .../devicetree/bindings/clock/qcom,hfpll.txt   | 63 
 .../devicetree/bindings/clock/qcom,hfpll.yaml  | 69 ++
 2 files changed, 69 insertions(+), 63 deletions(-)

diff --git a/Documentation/devicetree/bindings/clock/qcom,hfpll.txt 
b/Documentation/devicetree/bindings/clock/qcom,hfpll.txt
deleted file mode 100644
index 5769cbbe76be..
--- a/Documentation/devicetree/bindings/clock/qcom,hfpll.txt
+++ /dev/null
@@ -1,63 +0,0 @@
-High-Frequency PLL (HFPLL)
-
-PROPERTIES
-
-- compatible:
-   Usage: required
-   Value type: :
-   shall contain only one of the following. The generic
-   compatible "qcom,hfpll" should be also included.
-
-"qcom,hfpll-ipq8064", "qcom,hfpll"
-"qcom,hfpll-apq8064", "qcom,hfpll"
-"qcom,hfpll-msm8974", "qcom,hfpll"
-"qcom,hfpll-msm8960", "qcom,hfpll"
-"qcom,msm8976-hfpll-a53", "qcom,hfpll"
-"qcom,msm8976-hfpll-a72", "qcom,hfpll"
-"qcom,msm8976-hfpll-cci", "qcom,hfpll"
-
-- reg:
-   Usage: required
-   Value type: 
-   Definition: address and size of HPLL registers. An optional second
-   element specifies the address and size of the alias
-   register region.
-
-- clocks:
-   Usage: required
-   Value type: 
-   Definition: reference to the xo clock.
-
-- clock-names:
-   Usage: required
-   Value type: 
-   Definition: must be "xo".
-
-- clock-output-names:
-   Usage: required
-   Value type: 
-   Definition: Name of the PLL. Typically hfpllX where X is a CPU number
-   starting at 0. Otherwise hfpll_Y where Y is more specific
-   such as "l2".
-
-Example:
-
-1) An HFPLL for the L2 cache.
-
-   clock-controller@f9016000 {
-   compatible = "qcom,hfpll-ipq8064", "qcom,hfpll";
-   reg = <0xf9016000 0x30>;
-   clocks = <_board>;
-   clock-names = "xo";
-   clock-output-names = "hfpll_l2";
-   };
-
-2) An HFPLL for CPU0. This HFPLL has the alias register region.
-
-   clock-controller@f908a000 {
-   compatible = "qcom,hfpll-ipq8064", "qcom,hfpll";
-   reg = <0xf908a000 0x30>, <0xf900a000 0x30>;
-   clocks = <_board>;
-   clock-names = "xo";
-   clock-output-names = "hfpll0";
-   };
diff --git a/Documentation/devicetree/bindings/clock/qcom,hfpll.yaml 
b/Documentation/devicetree/bindings/clock/qcom,hfpll.yaml
new file mode 100644
index ..8cb1c164f760
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/qcom,hfpll.yaml
@@ -0,0 +1,69 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/qcom,hfpll.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm High-Frequency PLL
+
+maintainers:
+  - Bjorn Andersson 
+
+description:
+  The HFPLL is used as CPU PLL on various Qualcomm SoCs.
+
+properties:
+  compatible:
+oneOf:
+  - enum:
+  - qcom,msm8974-hfpll
+  - qcom,msm8976-hfpll-a53
+  - qcom,msm8976-hfpll-a72
+  - qcom,msm8976-hfpll-cci
+  - qcom,qcs404-hfpll
+  - const: qcom,hfpll
+deprecated: true
+
+  reg:
+items:
+  - description: HFPLL registers
+  - description: Alias register region
+minItems: 1
+
+  '#clock-cells':
+const: 0
+
+  clocks:
+items:
+  - description: board XO clock
+
+  clock-names:
+items:
+  - const: xo
+
+  clock-output-names:
+description:
+  Name of the PLL. Typically hfpllX where X is a CPU number starting at 0.
+  Otherwise hfpll_Y where Y is more specific such as "l2".
+maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - '#clock-cells'
+  - clocks
+  - clock-names
+  - clock-output-names
+
+additionalProperties: false
+
+examples:
+  - |
+clock-controller@f908a000 {
+compatible = "qcom,msm8974-hfpll";
+reg = <0xf908a000 0x30>, <0xf900a000 0x30>;
+#clock-cells = <0>;
+clock-output-names = "hfpll0";
+clocks = <_board>;
+clock-names = "xo";
+};

-- 
2.43.2




[PATCH v2 3/3] arm64: dts: qcom: qcs404: Use qcs404-hfpll compatible for hfpll

2024-02-18 Thread Luca Weiss
Follow the updated bindings and use a QCS404-specific compatible for the
HFPLL on this SoC.

Signed-off-by: Luca Weiss 
---
Please note that this patch should only land after the patch for the
clock driver.
---
 arch/arm64/boot/dts/qcom/qcs404.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/qcs404.dtsi 
b/arch/arm64/boot/dts/qcom/qcs404.dtsi
index 2f2eeaf2e945..4133d5a19deb 100644
--- a/arch/arm64/boot/dts/qcom/qcs404.dtsi
+++ b/arch/arm64/boot/dts/qcom/qcs404.dtsi
@@ -1308,7 +1308,7 @@ apcs_glb: mailbox@b011000 {
};
 
apcs_hfpll: clock-controller@b016000 {
-   compatible = "qcom,hfpll";
+   compatible = "qcom,qcs404-hfpll";
reg = <0x0b016000 0x30>;
#clock-cells = <0>;
clock-output-names = "apcs_hfpll";

-- 
2.43.2




[PATCH v2 0/3] Convert qcom,hfpll documentation to yaml + related changes

2024-02-18 Thread Luca Weiss
Finally touch the hfpll doc and convert it to yaml, and do some related
changes along the way.

Signed-off-by: Luca Weiss 
---
Changes in v2:
- Drop APQ8064/IPQ8064/MSM8960 compatibles (Dmitry)
- Update example to MSM8974 since IPQ8064 is dropped
- Clean up dt binding description (Krzysztof)
- Remove second example in docs (Krzysztof)
- Try to clear up the text and content around deprecating qcom,hfpll
- Link to v1: 
https://lore.kernel.org/r/20231231-hfpll-yaml-v1-0-359d44a4e...@z3ntu.xyz

---
Luca Weiss (3):
  dt-bindings: clock: qcom,hfpll: Convert to YAML
  clk: qcom: hfpll: Add QCS404-specific compatible
  arm64: dts: qcom: qcs404: Use qcs404-hfpll compatible for hfpll

 .../devicetree/bindings/clock/qcom,hfpll.txt   | 63 
 .../devicetree/bindings/clock/qcom,hfpll.yaml  | 69 ++
 arch/arm64/boot/dts/qcom/qcs404.dtsi   |  2 +-
 drivers/clk/qcom/hfpll.c   |  6 +-
 4 files changed, 74 insertions(+), 66 deletions(-)
---
base-commit: 841c35169323cd833294798e58b9bf63fa4fa1de
change-id: 20231231-hfpll-yaml-9266f012365c

Best regards,
-- 
Luca Weiss 




[PATCH] Bluetooth: Add more Bluetooth version defines

2024-02-16 Thread Luca Weiss
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/

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_1  1
 #define BLUETOOTH_VER_1_2  2
 #define BLUETOOTH_VER_2_0  3
 #define BLUETOOTH_VER_2_1  4
+#define BLUETOOTH_VER_3_0  5
 #define BLUETOOTH_VER_4_0  6
+#define BLUETOOTH_VER_4_1  7
+#define BLUETOOTH_VER_4_2  8
+#define BLUETOOTH_VER_5_0  9
+#define BLUETOOTH_VER_5_1  10
+#define BLUETOOTH_VER_5_2  11
+#define BLUETOOTH_VER_5_3  12
+#define BLUETOOTH_VER_5_4  13
 
 /* Reserv for core and drivers use */
 #define BT_SKB_RESERVE 8

---
base-commit: 841c35169323cd833294798e58b9bf63fa4fa1de
change-id: 20240216-bluetooth-defines-b810ce543191

Best regards,
-- 
Luca Weiss 




[PATCH] arm64: dts: qcom: sm6350: Add interconnect for MDSS

2024-02-16 Thread Luca Weiss
Add the definition for the interconnect used in the display subsystem.

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

diff --git a/arch/arm64/boot/dts/qcom/sm6350.dtsi 
b/arch/arm64/boot/dts/qcom/sm6350.dtsi
index 5e8c8896ba66..ef4d847c4acf 100644
--- a/arch/arm64/boot/dts/qcom/sm6350.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm6350.dtsi
@@ -1973,6 +1973,13 @@ mdss: display-subsystem@ae0 {
interrupt-controller;
#interrupt-cells = <1>;
 
+   interconnects = <_noc MASTER_MDP_PORT0 
QCOM_ICC_TAG_ALWAYS
+_virt SLAVE_EBI_CH0 
QCOM_ICC_TAG_ALWAYS>,
+   <_noc MASTER_AMPSS_M0 
QCOM_ICC_TAG_ACTIVE_ONLY
+_noc SLAVE_DISPLAY_CFG 
QCOM_ICC_TAG_ACTIVE_ONLY>;
+   interconnect-names = "mdp0-mem",
+"cpu-cfg";
+
clocks = < GCC_DISP_AHB_CLK>,
 < GCC_DISP_AXI_CLK>,
 < DISP_CC_MDSS_MDP_CLK>;

---
base-commit: 84c11540697ba996a7f55b16565945b52db3019e
change-id: 20240124-sm6350-interconnect-a9c2857a5594

Best regards,
-- 
Luca Weiss 




Re: [PATCH RFT] arm64: dts: qcom: sm8350: Reenable crypto & cryptobam

2024-02-16 Thread Luca Weiss
On Mon Jan 8, 2024 at 11:45 PM CET, Dmitry Baryshkov wrote:
> On Mon, 8 Jan 2024 at 16:23, Luca Weiss  wrote:
> >
> > On Mon Jan 8, 2024 at 3:18 PM CET, Konrad Dybcio wrote:
> > > On 8.01.2024 14:49, Luca Weiss wrote:
> > > > When num-channels and qcom,num-ees is not provided in devicetree, the
> > > > driver will try to read these values from the registers during probe but
> > > > this fails if the interconnect is not on and then crashes the system.
> > > >
> > > > So we can provide these properties in devicetree (queried after patching
> > > > BAM driver to enable the necessary interconnect) so we can probe
> > > > cryptobam without reading registers and then also use the QCE as
> > > > expected.
> > >
> > > This really feels a bit backwards.. Enable the resource to query the
> > > hardware for numbers, so that said resource can be enabled, but
> > > slightly later :/
> >
> > If you think adding interconnect support to driver and dtsi is better,
> > let me know.
>
> I'd say, adding the proper interconnect is a better option. Otherwise
> we just depend on the QCE itself to set up the vote for us.

Yes, currently we depend on that.

>
> >
> > Stephan (+CC) mentioned it should be okay like this *shrug*
> >
> > For the record, this is the same way I got the values for sc7280[0] and
> > sm6350[1].
> >
> > [0] 
> > https://lore.kernel.org/linux-arm-msm/20231229-sc7280-cryptobam-fixup-v1-1-bd8f68589...@fairphone.com/
> > [1] 
> > https://lore.kernel.org/linux-arm-msm/20240105-sm6350-qce-v1-0-416e5c731...@fairphone.com/
> >
> > diff --git a/arch/arm64/boot/dts/qcom/sm8350.dtsi 
> > b/arch/arm64/boot/dts/qcom/sm8350.dtsi
> > index b46236235b7f..cd4dd9852d9e 100644
> > --- a/arch/arm64/boot/dts/qcom/sm8350.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/sm8350.dtsi
> > @@ -1756,8 +1756,8 @@ cryptobam: dma-controller@1dc4000 {
> > qcom,controlled-remotely;
> > iommus = <_smmu 0x594 0x0011>,
> >  <_smmu 0x596 0x0011>;
> > -   /* FIXME: Probing BAM DMA causes some abort and 
> > system hang */
> > -   status = "fail";
> > +   interconnects = <_noc MASTER_CRYPTO 0 
> > _virt SLAVE_EBI1 0>;
> > +   interconnect-names = "memory";
> > };
> >
> > crypto: crypto@1dfa000 {
> > diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c
> > index 5e7d332731e0..9de28f615639 100644
> > --- a/drivers/dma/qcom/bam_dma.c
> > +++ b/drivers/dma/qcom/bam_dma.c
> > @@ -40,6 +40,7 @@
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> >  #include 
> >
> >  #include "../dmaengine.h"
> > @@ -394,6 +395,7 @@ struct bam_device {
> > const struct reg_offset_data *layout;
> >
> > struct clk *bamclk;
> > +   struct icc_path *mem_path;
> > int irq;
> >
> > /* dma start transaction tasklet */
> > @@ -1206,6 +1208,7 @@ static int bam_init(struct bam_device *bdev)
> > bdev->num_channels = val & BAM_NUM_PIPES_MASK;
> > }
> >
> > +   printk(KERN_ERR "%s:%d DBG num_ees=%u num_channels=%u\n", __func__, 
> > __LINE__, bdev->num_ees, bdev->num_channels);
> > /* Reset BAM now if fully controlled locally */
> > if (!bdev->controlled_remotely && !bdev->powered_remotely)
> > bam_reset(bdev);
> > @@ -1298,6 +1301,14 @@ static int bam_dma_probe(struct platform_device 
> > *pdev)
> > return ret;
> > }
> >
> > +   bdev->mem_path = devm_of_icc_get(bdev->dev, "memory");
> > +   if (IS_ERR(bdev->mem_path))
> > +   return PTR_ERR(bdev->mem_path);
> > +
> > +   ret = icc_set_bw(bdev->mem_path, 1, 1);
>
> Probably this needs some more sensible value.

So downstream qcedev driver uses 384 for the interconnect. But this is
crypto-specific and probably different BAMs have different minimum
requirements?

#define CRYPTO_AVG_BW   384
#define CRYPTO_PEAK_BW  384
https://github.com/xiaomi-sm8450-kernel/android_kernel_platform_msm-kernel/blob/lineage-20/drivers/crypto/msm/qce.h#L57

Do you have any suggestion what to use here?

Also I'd assume that with pm_runtime suspended we'd need to clear the
votes in the driver so we don't keep the interconnect alive
unnecessarily?

If someone wants to pick up that patch, I'd be very glad since
especially for sm8350 this is just a drive-by, I don't care too much
about the SoC myself ;)

Regards
Luca

>
> > +   if (ret)
> > +   return ret;
> > +
> > ret = bam_init(bdev);
> > if (ret)
> > goto err_disable_clk;
> >




Re: [PATCH v2 2/2] ARM: dts: qcom: Add support for Samsung Galaxy Tab 4 8.0 Wi-Fi

2024-02-15 Thread Luca Weiss
 = <0>;
> +
> + backlight@2c {
> + compatible = "ti,lp8556";
> + reg = <0x2c>;
> + enable-supply = <_backlight_vddio>;
> +
> + dev-ctrl = /bits/ 8 <0x80>;
> + init-brt = /bits/ 8 <0x3f>;
> +
> + /*
> +  * Change transition duration: 200ms, Change 
transition strength: heavy,
> +  * PWM hysteresis: 1-bit w/ 8-bit resolution
> +  */
> + rom-a3h {
> + rom-addr = /bits/ 8 <0xa3>;
> + rom-val = /bits/ 8 <0x5e>;
> + };
> +
> + /*
> +  * PWM phase configuration: 3-phase/3 drivers 
(0, 120deg, 240deg, -, -,
> -), +  * PWM frequency: 9616Hz (10-bit)
> +  */
> + rom-a5h {
> + rom-addr = /bits/ 8 <0xa5>;
> + rom-val = /bits/ 8 <0x34>;
> + };
> +
> + /* Enable LED drivers 2 & 3, Boot inductor 
current limit: 1.5A/2.6A */
> + rom-a7h {
> + rom-addr = /bits/ 8 <0xa7>;
> + rom-val = /bits/ 8 <0xfa>;
> + };
> + };
> + };
> +
> + reg_backlight_vddio: regulator-backlight-vddio {
> + compatible = "regulator-fixed";
> + regulator-name = "backlight_vddio";
> + regulator-min-microvolt = <180>;
> + regulator-max-microvolt = <180>;
> +
> + gpio = < 74 GPIO_ACTIVE_HIGH>;
> + enable-active-high;
> +
> + pinctrl-names = "default";
> + pinctrl-0 = <_vddio_default_state>;

Use this order:

pinctrl-0
pinctrl-names

Also applies a few more times below.

> + };
> +
> + reg_tsp_1p8v: regulator-tsp-1p8v {
> + compatible = "regulator-fixed";
> + regulator-name = "tsp_1p8v";
> + regulator-min-microvolt = <180>;
> + regulator-max-microvolt = <180>;
> +
> + gpio = < 114 GPIO_ACTIVE_HIGH>;
> + enable-active-high;
> +
> + pinctrl-names = "default";
> + pinctrl-0 = <_en1_default_state>;
> + };
> +
> + reg_tsp_3p3v: regulator-tsp-3p3v {
> + compatible = "regulator-fixed";
> + regulator-name = "tsp_3p3v";
> + regulator-min-microvolt = <330>;
> + regulator-max-microvolt = <330>;
> +
> + gpio = < 31 GPIO_ACTIVE_HIGH>;
> + enable-active-high;
> +
> + pinctrl-names = "default";
> + pinctrl-0 = <_en_default_state>;
> + };
> +
> + reserved-memory {
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges;
> +
> + framebuffer@320 {
> + reg = <0x0320 0x80>;
> + no-map;
> + };
> +
> + mpss_region: mpss@840 {
> + reg = <0x0840 0x1f0>;
> + no-map;
> + };
> +
> + mba_region: mba@a30 {
> + reg = <0x0a30 0x10>;
> + no-map;
> + };
> +
> + reserved@cb0 {
> + reg = <0x0cb0 0x70>;
> + no-map;
> + };
> +
> + wcnss_region: wcnss@d20 {
> + reg = <0x0d20 0x70>;
> + no-map;
> + };
> +
> + adsp_region: adsp@d90 {
> + reg = <0x0d90 0x180>;
> + no-map;
> + };
> +
> + venus@f10 {
> + reg = <0x0f10 0x50>;
> + no-map;
> + };
> +
> + smem_region: smem@fa0 {
> + reg = <0x0fa0 0x10>;
> + no-map;
> + };
> +
> + reserved@fb0 {
> + reg = <0x0fb0 0x26>;
> + no-map;
> + };
> +
> + rfsa@fd6 {
> +

[PATCH v2] ARM: dts: qcom: msm8226: Add watchdog node

2024-02-14 Thread Luca Weiss
From: Matti Lehtimäki 

Add watchdog for MSM8226 platform.

Signed-off-by: Matti Lehtimäki 
Reviewed-by: Konrad Dybcio 
Signed-off-by: Luca Weiss 
---
Changes in v2:
- Rebase on qcom for-next
- Pick up tags
- Link to v1: 
https://lore.kernel.org/r/20231011-msm8226-msm8974-watchdog-v1-0-2c472818f...@z3ntu.xyz
---
 arch/arm/boot/dts/qcom/qcom-msm8226.dtsi | 8 
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/qcom/qcom-msm8226.dtsi 
b/arch/arm/boot/dts/qcom/qcom-msm8226.dtsi
index 8fae6058bf58..270973e85625 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8226.dtsi
+++ b/arch/arm/boot/dts/qcom/qcom-msm8226.dtsi
@@ -241,6 +241,14 @@ saw_l2: power-manager@f9012000 {
reg = <0xf9012000 0x1000>;
};
 
+   watchdog@f9017000 {
+   compatible = "qcom,apss-wdt-msm8226", "qcom,kpss-wdt";
+   reg = <0xf9017000 0x1000>;
+   interrupts = ,
+;
+   clocks = <_clk>;
+   };
+
timer@f902 {
compatible = "arm,armv7-timer-mem";
reg = <0xf902 0x1000>;

---
base-commit: 2b3f57690f30a70ea87aab7169388956fd1932db
change-id: 20231011-msm8226-msm8974-watchdog-a88e45f4e2a4

Best regards,
-- 
Luca Weiss 




Re: [PATCH v2 1/3] dt-bindings: power: rpmpd: Add MSM8974 power domains

2024-02-11 Thread Luca Weiss
On Sonntag, 11. Februar 2024 12:03:15 CET Stephan Gerhold wrote:
> On Sat, Feb 10, 2024 at 05:38:56PM +0100, Luca Weiss wrote:
> > Add the compatibles and indexes for the rpmpd in MSM8974, both with the
> > standard PM8841+PM8941 PMICs but also devices found with PMA8084.
> > 
> > Signed-off-by: Luca Weiss 
> > ---
> > 
> >  Documentation/devicetree/bindings/power/qcom,rpmpd.yaml | 2 ++
> >  include/dt-bindings/power/qcom-rpmpd.h  | 7 +++
> >  2 files changed, 9 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
> > b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml index
> > 2ff246cf8b81..929b7ef9c1bc 100644
> > --- a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
> > +++ b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml
> > 
> > @@ -24,6 +24,8 @@ properties:
> >- qcom,msm8917-rpmpd
> >- qcom,msm8939-rpmpd
> >- qcom,msm8953-rpmpd
> > 
> > +  - qcom,msm8974-rpmpd
> > +  - qcom,msm8974pro-pma8084-rpmpd
> > 
> >- qcom,msm8976-rpmpd
> >- qcom,msm8994-rpmpd
> >- qcom,msm8996-rpmpd
> 
> This is maybe more something for the DT reviewers to decide but I wonder
> if it is a bit confusing/misleading to describe one particular PMIC with
> a generic compatible, and the other with a more specific one. Perhaps it
> would be clearer to include the PMIC name in both compatibles, i.e.
> "qcom,msm8974-pm8941-rpmpd" instead of "qcom,msm8974-rpmpd".

FWIW if we'd do that it should be qcom,msm8974-pm8841-rpmpd (so pm8841 instead 
of pm8941)

But also in the same vain, it was maybe a bit of a bad decision originally to 
make the compatibles SoC-specific and not SoC+PMIC-specific - though in nearly 
all cases this combo is fixed for a given SoC?

Anyways, I'll wait for more comments about this, I'm open to changing it 
either way.

Regards
Luca

> 
> The "qcom,msm8974-rpmpd" compatible could be maybe added as fallback.
> While it wouldn't be used for matching in the (Linux) driver the DT
> binding itself *is* "compatible" between the two PMICs because they both
> have the same power domain indexes.
> 
> i.e.
>   compatible = "qcom,msm8974-pm8941-rpmpd", "qcom,msm8974-rpmpd";
>   compatible = "qcom,msm8974pro-pma8084-rpmpd", "qcom,msm8974-rpmpd";
> 
> Thanks,
> Stephan







[PATCH v3] ARM: dts: qcom: msm8974: correct qfprom node size

2024-02-10 Thread Luca Weiss
From: Craig Tatlor 

The qfprom actually is bigger than 0x1000, so adjust the reg.

Note that the non-ECC-corrected qfprom can be found at 0xfc4b8000
(-0x4000). The current reg points to the ECC-corrected qfprom block
which should have equivalent values at all offsets compared to the
non-corrected version.

[l...@z3ntu.xyz: extract to standalone patch and adjust for review
comments]

Fixes: c59ffb519357 ("arm: dts: msm8974: Add thermal zones, tsens and qfprom 
nodes")
Signed-off-by: Craig Tatlor 
Signed-off-by: Luca Weiss 
---
Changes in v3:
- Update size from 0x3000 to 0x2100 (Dmitry)
- Link to v2: 
https://lore.kernel.org/r/20230130-msm8974-qfprom-v2-1-3839cf41d...@z3ntu.xyz

Changes in v2:
- Keep base offset but expand reg from 0x1000 to 0x3000 (Konrad)
- Link to v1: 
https://lore.kernel.org/r/20230130-msm8974-qfprom-v1-1-975aa0e5e...@z3ntu.xyz
---
 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 b1413983787c..083ab780ab7e 100644
--- a/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
+++ b/arch/arm/boot/dts/qcom/qcom-msm8974.dtsi
@@ -1234,7 +1234,7 @@ restart@fc4ab000 {
 
qfprom: qfprom@fc4bc000 {
compatible = "qcom,msm8974-qfprom", "qcom,qfprom";
-   reg = <0xfc4bc000 0x1000>;
+   reg = <0xfc4bc000 0x2100>;
#address-cells = <1>;
#size-cells = <1>;
 

---
base-commit: 54be6c6c5ae8e0d93a6c4641cb7528eb0b6ba478
change-id: 20230130-msm8974-qfprom-619c0e8f26eb

Best regards,
-- 
Luca Weiss 




[PATCH v2 3/3] pmdomain: qcom: rpmpd: Add MSM8974PRO+PMA8084 power domains

2024-02-10 Thread Luca Weiss
Add the power domains CX & GFX found on MSM8974 devices that use PMA8084
instead of the standard PM8841+PM8941 combo.

Signed-off-by: Luca Weiss 
---
 drivers/pmdomain/qcom/rpmpd.c | 29 +
 1 file changed, 29 insertions(+)

diff --git a/drivers/pmdomain/qcom/rpmpd.c b/drivers/pmdomain/qcom/rpmpd.c
index 3fa6a0325fc0..2d47e3357f10 100644
--- a/drivers/pmdomain/qcom/rpmpd.c
+++ b/drivers/pmdomain/qcom/rpmpd.c
@@ -252,6 +252,20 @@ static struct rpmpd cx_s2b_vfc = {
 };
 
 /* G(F)X */
+static struct rpmpd gfx_s7a_corner = {
+   .pd = { .name = "gfx", },
+   .res_type = RPMPD_SMPA,
+   .res_id = 7,
+   .key = KEY_CORNER,
+};
+
+static struct rpmpd gfx_s7a_vfc = {
+   .pd = { .name = "gfx_vfc", },
+   .res_type = RPMPD_SMPA,
+   .res_id = 7,
+   .key = KEY_FLOOR_CORNER,
+};
+
 static struct rpmpd gfx_s2b_corner = {
.pd = { .name = "gfx", },
.res_type = RPMPD_SMPB,
@@ -716,6 +730,20 @@ static const struct rpmpd_desc msm8974_desc = {
.max_state = MAX_CORNER_RPMPD_STATE,
 };
 
+static struct rpmpd *msm8974pro_pma8084_rpmpds[] = {
+   [MSM8974_VDDCX] =   _s2a_corner,
+   [MSM8974_VDDCX_AO] =_s2a_corner_ao,
+   [MSM8974_VDDCX_VFC] =   _s2a_vfc,
+   [MSM8974_VDDGFX] =  _s7a_corner,
+   [MSM8974_VDDGFX_VFC] =  _s7a_vfc,
+};
+
+static const struct rpmpd_desc msm8974pro_pma8084_desc = {
+   .rpmpds = msm8974pro_pma8084_rpmpds,
+   .num_pds = ARRAY_SIZE(msm8974pro_pma8084_rpmpds),
+   .max_state = MAX_CORNER_RPMPD_STATE,
+};
+
 static struct rpmpd *msm8976_rpmpds[] = {
[MSM8976_VDDCX] =   _s2a_lvl,
[MSM8976_VDDCX_AO] =_s2a_lvl_ao,
@@ -910,6 +938,7 @@ static const struct of_device_id rpmpd_match_table[] = {
{ .compatible = "qcom,msm8939-rpmpd", .data = _desc },
{ .compatible = "qcom,msm8953-rpmpd", .data = _desc },
{ .compatible = "qcom,msm8974-rpmpd", .data = _desc },
+   { .compatible = "qcom,msm8974pro-pma8084-rpmpd", .data = 
_pma8084_desc },
{ .compatible = "qcom,msm8976-rpmpd", .data = _desc },
{ .compatible = "qcom,msm8994-rpmpd", .data = _desc },
{ .compatible = "qcom,msm8996-rpmpd", .data = _desc },

-- 
2.43.0




[PATCH v2 2/3] pmdomain: qcom: rpmpd: Add MSM8974+PM8841 power domains

2024-02-10 Thread Luca Weiss
Add the power domains CX & GFX found on devices with MSM8974 and PM8841.

Signed-off-by: Luca Weiss 
---
 drivers/pmdomain/qcom/rpmpd.c | 54 +++
 1 file changed, 54 insertions(+)

diff --git a/drivers/pmdomain/qcom/rpmpd.c b/drivers/pmdomain/qcom/rpmpd.c
index 7796d65f96e8..3fa6a0325fc0 100644
--- a/drivers/pmdomain/qcom/rpmpd.c
+++ b/drivers/pmdomain/qcom/rpmpd.c
@@ -226,6 +226,31 @@ static struct rpmpd cx_s3a_vfl = {
.key = KEY_FLOOR_LEVEL,
 };
 
+static struct rpmpd cx_s2b_corner_ao;
+static struct rpmpd cx_s2b_corner = {
+   .pd = { .name = "cx", },
+   .peer = _s2b_corner_ao,
+   .res_type = RPMPD_SMPB,
+   .res_id = 2,
+   .key = KEY_CORNER,
+};
+
+static struct rpmpd cx_s2b_corner_ao = {
+   .pd = { .name = "cx_ao", },
+   .peer = _s2b_corner,
+   .active_only = true,
+   .res_type = RPMPD_SMPB,
+   .res_id = 2,
+   .key = KEY_CORNER,
+};
+
+static struct rpmpd cx_s2b_vfc = {
+   .pd = { .name = "cx_vfc", },
+   .res_type = RPMPD_SMPB,
+   .res_id = 2,
+   .key = KEY_FLOOR_CORNER,
+};
+
 /* G(F)X */
 static struct rpmpd gfx_s2b_corner = {
.pd = { .name = "gfx", },
@@ -241,6 +266,20 @@ static struct rpmpd gfx_s2b_vfc = {
.key = KEY_FLOOR_CORNER,
 };
 
+static struct rpmpd gfx_s4b_corner = {
+   .pd = { .name = "gfx", },
+   .res_type = RPMPD_SMPB,
+   .res_id = 4,
+   .key = KEY_CORNER,
+};
+
+static struct rpmpd gfx_s4b_vfc = {
+   .pd = { .name = "gfx_vfc", },
+   .res_type = RPMPD_SMPB,
+   .res_id = 4,
+   .key = KEY_FLOOR_CORNER,
+};
+
 static struct rpmpd mx_rwmx0_lvl;
 static struct rpmpd gx_rwgx0_lvl_ao;
 static struct rpmpd gx_rwgx0_lvl = {
@@ -663,6 +702,20 @@ static const struct rpmpd_desc msm8953_desc = {
.max_state = RPM_SMD_LEVEL_TURBO,
 };
 
+static struct rpmpd *msm8974_rpmpds[] = {
+   [MSM8974_VDDCX] =   _s2b_corner,
+   [MSM8974_VDDCX_AO] =_s2b_corner_ao,
+   [MSM8974_VDDCX_VFC] =   _s2b_vfc,
+   [MSM8974_VDDGFX] =  _s4b_corner,
+   [MSM8974_VDDGFX_VFC] =  _s4b_vfc,
+};
+
+static const struct rpmpd_desc msm8974_desc = {
+   .rpmpds = msm8974_rpmpds,
+   .num_pds = ARRAY_SIZE(msm8974_rpmpds),
+   .max_state = MAX_CORNER_RPMPD_STATE,
+};
+
 static struct rpmpd *msm8976_rpmpds[] = {
[MSM8976_VDDCX] =   _s2a_lvl,
[MSM8976_VDDCX_AO] =_s2a_lvl_ao,
@@ -856,6 +909,7 @@ static const struct of_device_id rpmpd_match_table[] = {
{ .compatible = "qcom,msm8917-rpmpd", .data = _desc },
{ .compatible = "qcom,msm8939-rpmpd", .data = _desc },
{ .compatible = "qcom,msm8953-rpmpd", .data = _desc },
+   { .compatible = "qcom,msm8974-rpmpd", .data = _desc },
{ .compatible = "qcom,msm8976-rpmpd", .data = _desc },
{ .compatible = "qcom,msm8994-rpmpd", .data = _desc },
{ .compatible = "qcom,msm8996-rpmpd", .data = _desc },

-- 
2.43.0




  1   2   3   4   >